{"ast":null,"code":"import { useEffect as $1wErz$useEffect } from \"react\";\n\n/** Number of components which have requested interest to have focus guards */\nvar $3db38b7d1fb3fe6a$var$count = 0;\nfunction $3db38b7d1fb3fe6a$export$ac5b58043b79449b(props) {\n  $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();\n  return props.children;\n}\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {\n  $1wErz$useEffect(function () {\n    var _edgeGuards$, _edgeGuards$2;\n    var edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n    document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());\n    document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());\n    $3db38b7d1fb3fe6a$var$count++;\n    return function () {\n      if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach(function (node) {\n        return node.remove();\n      });\n      $3db38b7d1fb3fe6a$var$count--;\n    };\n  }, []);\n}\nfunction $3db38b7d1fb3fe6a$var$createFocusGuard() {\n  var element = document.createElement('span');\n  element.setAttribute('data-radix-focus-guard', '');\n  element.tabIndex = 0;\n  element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';\n  return element;\n}\nvar $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = $3db38b7d1fb3fe6a$export$ac5b58043b79449b;\nexport { $3db38b7d1fb3fe6a$export$ac5b58043b79449b as FocusGuards, $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 as Root, $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c as useFocusGuards };","map":{"version":3,"names":["$3db38b7d1fb3fe6a$var$count","$3db38b7d1fb3fe6a$export$ac5b58043b79449b","FocusGuards","props","$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c","children","useFocusGuards","$1wErz$useEffect","_edgeGuards$","_edgeGuards$2","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","$3db38b7d1fb3fe6a$var$createFocusGuard","forEach","node","remove","createFocusGuard","element","createElement","setAttribute","tabIndex","style","cssText","$3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9"],"sources":["C:\\Users\\user\\Desktop\\000newport\\node_modules\\@radix-ui\\react-focus-guards\\dist\\packages\\react\\focus-guards\\src\\index.ts","C:\\Users\\user\\Desktop\\000newport\\node_modules\\@radix-ui\\react-focus-guards\\dist\\packages\\react\\focus-guards\\src\\FocusGuards.tsx"],"sourcesContent":["export {\n  FocusGuards,\n  //\n  Root,\n  //\n  useFocusGuards,\n} from './FocusGuards';\n","import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\nfunction FocusGuards(props: any) {\n  useFocusGuards();\n  return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n  React.useEffect(() => {\n    const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n    document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? createFocusGuard());\n    document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? createFocusGuard());\n    count++;\n\n    return () => {\n      if (count === 1) {\n        document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n      }\n      count--;\n    };\n  }, []);\n}\n\nfunction createFocusGuard() {\n  const element = document.createElement('span');\n  element.setAttribute('data-radix-focus-guard', '');\n  element.tabIndex = 0;\n  element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';\n  return element;\n}\n\nconst Root = FocusGuards;\n\nexport {\n  FocusGuards,\n  //\n  Root,\n  //\n  useFocusGuards,\n};\n"],"mapp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