{"ast":null,"code":"import _createForOfIteratorHelper from \"C:/Users/user/Desktop/02portreact/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js\";\nimport _toConsumableArray from \"C:/Users/user/Desktop/02portreact/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _objectSpread from \"C:/Users/user/Desktop/02portreact/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _objectWithoutProperties from \"C:/Users/user/Desktop/02portreact/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nimport _slicedToArray from \"C:/Users/user/Desktop/02portreact/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nvar _excluded = [\"__scopeRovingFocusGroup\", \"orientation\", \"loop\", \"dir\", \"currentTabStopId\", \"defaultCurrentTabStopId\", \"onCurrentTabStopIdChange\", \"onEntryFocus\"],\n  _excluded2 = [\"__scopeRovingFocusGroup\", \"focusable\", \"active\", \"tabStopId\"];\nimport $98Iye$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport { forwardRef as $98Iye$forwardRef, createElement as $98Iye$createElement, useRef as $98Iye$useRef, useState as $98Iye$useState, useEffect as $98Iye$useEffect, useCallback as $98Iye$useCallback } from \"react\";\nimport { composeEventHandlers as $98Iye$composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection as $98Iye$createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs as $98Iye$useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope as $98Iye$createContextScope } from \"@radix-ui/react-context\";\nimport { useId as $98Iye$useId } from \"@radix-ui/react-id\";\nimport { Primitive as $98Iye$Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef as $98Iye$useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState as $98Iye$useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection as $98Iye$useDirection } from \"@radix-ui/react-direction\";\nvar $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nvar $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {\n  bubbles: false,\n  cancelable: true\n};\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\nvar $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';\nvar _$98Iye$createCollect = $98Iye$createCollection($d7bdfb9eb0fdf311$var$GROUP_NAME),\n  _$98Iye$createCollect2 = _slicedToArray(_$98Iye$createCollect, 3),\n  $d7bdfb9eb0fdf311$var$Collection = _$98Iye$createCollect2[0],\n  $d7bdfb9eb0fdf311$var$useCollection = _$98Iye$createCollect2[1],\n  $d7bdfb9eb0fdf311$var$createCollectionScope = _$98Iye$createCollect2[2];\nvar _$98Iye$createContext = $98Iye$createContextScope($d7bdfb9eb0fdf311$var$GROUP_NAME, [$d7bdfb9eb0fdf311$var$createCollectionScope]),\n  _$98Iye$createContext2 = _slicedToArray(_$98Iye$createContext, 2),\n  $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext = _$98Iye$createContext2[0],\n  $d7bdfb9eb0fdf311$export$c7109489551a4f4 = _$98Iye$createContext2[1];\nvar _$d7bdfb9eb0fdf311$va = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME),\n  _$d7bdfb9eb0fdf311$va2 = _slicedToArray(_$d7bdfb9eb0fdf311$va, 2),\n  $d7bdfb9eb0fdf311$var$RovingFocusProvider = _$d7bdfb9eb0fdf311$va2[0],\n  $d7bdfb9eb0fdf311$var$useRovingFocusContext = _$d7bdfb9eb0fdf311$va2[1];\nvar $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/$98Iye$forwardRef(function (props, forwardedRef) {\n  return /*#__PURE__*/$98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {\n    scope: props.__scopeRovingFocusGroup\n  }, /*#__PURE__*/$98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {\n    scope: props.__scopeRovingFocusGroup\n  }, /*#__PURE__*/$98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, $98Iye$babelruntimehelpersesmextends({}, props, {\n    ref: forwardedRef\n  }))));\n});\n/*#__PURE__*/\nObject.assign($d7bdfb9eb0fdf311$export$8699f7c8af148338, {\n  displayName: $d7bdfb9eb0fdf311$var$GROUP_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/\nvar $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/$98Iye$forwardRef(function (props, forwardedRef) {\n  var __scopeRovingFocusGroup = props.__scopeRovingFocusGroup,\n    orientation = props.orientation,\n    _props$loop = props.loop,\n    loop = _props$loop === void 0 ? false : _props$loop,\n    dir = props.dir,\n    currentTabStopIdProp = props.currentTabStopId,\n    defaultCurrentTabStopId = props.defaultCurrentTabStopId,\n    onCurrentTabStopIdChange = props.onCurrentTabStopIdChange,\n    onEntryFocus = props.onEntryFocus,\n    groupProps = _objectWithoutProperties(props, _excluded);\n  var ref = $98Iye$useRef(null);\n  var composedRefs = $98Iye$useComposedRefs(forwardedRef, ref);\n  var direction = $98Iye$useDirection(dir);\n  var _$98Iye$useControllab = $98Iye$useControllableState({\n      prop: currentTabStopIdProp,\n      defaultProp: defaultCurrentTabStopId,\n      onChange: onCurrentTabStopIdChange\n    }),\n    _$98Iye$useControllab2 = _slicedToArray(_$98Iye$useControllab, 2),\n    _$98Iye$useControllab3 = _$98Iye$useControllab2[0],\n    currentTabStopId = _$98Iye$useControllab3 === void 0 ? null : _$98Iye$useControllab3,\n    setCurrentTabStopId = _$98Iye$useControllab2[1];\n  var _$98Iye$useState = $98Iye$useState(false),\n    _$98Iye$useState2 = _slicedToArray(_$98Iye$useState, 2),\n    isTabbingBackOut = _$98Iye$useState2[0],\n    setIsTabbingBackOut = _$98Iye$useState2[1];\n  var handleEntryFocus = $98Iye$useCallbackRef(onEntryFocus);\n  var getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);\n  var isClickFocusRef = $98Iye$useRef(false);\n  var _$98Iye$useState3 = $98Iye$useState(0),\n    _$98Iye$useState4 = _slicedToArray(_$98Iye$useState3, 2),\n    focusableItemsCount = _$98Iye$useState4[0],\n    setFocusableItemsCount = _$98Iye$useState4[1];\n  $98Iye$useEffect(function () {\n    var node = ref.current;\n    if (node) {\n      node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);\n      return function () {\n        return node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);\n      };\n    }\n  }, [handleEntryFocus]);\n  return /*#__PURE__*/$98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {\n    scope: __scopeRovingFocusGroup,\n    orientation: orientation,\n    dir: direction,\n    loop: loop,\n    currentTabStopId: currentTabStopId,\n    onItemFocus: $98Iye$useCallback(function (tabStopId) {\n      return setCurrentTabStopId(tabStopId);\n    }, [setCurrentTabStopId]),\n    onItemShiftTab: $98Iye$useCallback(function () {\n      return setIsTabbingBackOut(true);\n    }, []),\n    onFocusableItemAdd: $98Iye$useCallback(function () {\n      return setFocusableItemsCount(function (prevCount) {\n        return prevCount + 1;\n      });\n    }, []),\n    onFocusableItemRemove: $98Iye$useCallback(function () {\n      return setFocusableItemsCount(function (prevCount) {\n        return prevCount - 1;\n      });\n    }, [])\n  }, /*#__PURE__*/$98Iye$createElement($98Iye$Primitive.div, $98Iye$babelruntimehelpersesmextends({\n    tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n    \"data-orientation\": orientation\n  }, groupProps, {\n    ref: composedRefs,\n    style: _objectSpread({\n      outline: 'none'\n    }, props.style),\n    onMouseDown: $98Iye$composeEventHandlers(props.onMouseDown, function () {\n      isClickFocusRef.current = true;\n    }),\n    onFocus: $98Iye$composeEventHandlers(props.onFocus, function (event) {\n      // We normally wouldn't need this check, because we already check\n      // that the focus is on the current target and not bubbling to it.\n      // We do this because Safari doesn't focus buttons when clicked, and\n      // instead, the wrapper will get focused and not through a bubbling event.\n      var isKeyboardFocus = !isClickFocusRef.current;\n      if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n        var entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);\n        event.currentTarget.dispatchEvent(entryFocusEvent);\n        if (!entryFocusEvent.defaultPrevented) {\n          var items = getItems().filter(function (item) {\n            return item.focusable;\n          });\n          var activeItem = items.find(function (item) {\n            return item.active;\n          });\n          var currentItem = items.find(function (item) {\n            return item.id === currentTabStopId;\n          });\n          var candidateItems = [activeItem, currentItem].concat(_toConsumableArray(items)).filter(Boolean);\n          var candidateNodes = candidateItems.map(function (item) {\n            return item.ref.current;\n          });\n          $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);\n        }\n      }\n      isClickFocusRef.current = false;\n    }),\n    onBlur: $98Iye$composeEventHandlers(props.onBlur, function () {\n      return setIsTabbingBackOut(false);\n    })\n  })));\n});\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\nvar $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';\nvar $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/$98Iye$forwardRef(function (props, forwardedRef) {\n  var __scopeRovingFocusGroup = props.__scopeRovingFocusGroup,\n    _props$focusable = props.focusable,\n    focusable = _props$focusable === void 0 ? true : _props$focusable,\n    _props$active = props.active,\n    active = _props$active === void 0 ? false : _props$active,\n    tabStopId = props.tabStopId,\n    itemProps = _objectWithoutProperties(props, _excluded2);\n  var autoId = $98Iye$useId();\n  var id = tabStopId || autoId;\n  var context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);\n  var isCurrentTabStop = context.currentTabStopId === id;\n  var getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);\n  var onFocusableItemAdd = context.onFocusableItemAdd,\n    onFocusableItemRemove = context.onFocusableItemRemove;\n  $98Iye$useEffect(function () {\n    if (focusable) {\n      onFocusableItemAdd();\n      return function () {\n        return onFocusableItemRemove();\n      };\n    }\n  }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n  return /*#__PURE__*/$98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {\n    scope: __scopeRovingFocusGroup,\n    id: id,\n    focusable: focusable,\n    active: active\n  }, /*#__PURE__*/$98Iye$createElement($98Iye$Primitive.span, $98Iye$babelruntimehelpersesmextends({\n    tabIndex: isCurrentTabStop ? 0 : -1,\n    \"data-orientation\": context.orientation\n  }, itemProps, {\n    ref: forwardedRef,\n    onMouseDown: $98Iye$composeEventHandlers(props.onMouseDown, function (event) {\n      // We prevent focusing non-focusable items on `mousedown`.\n      // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n      if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n      else context.onItemFocus(id);\n    }),\n    onFocus: $98Iye$composeEventHandlers(props.onFocus, function () {\n      return context.onItemFocus(id);\n    }),\n    onKeyDown: $98Iye$composeEventHandlers(props.onKeyDown, function (event) {\n      if (event.key === 'Tab' && event.shiftKey) {\n        context.onItemShiftTab();\n        return;\n      }\n      if (event.target !== event.currentTarget) return;\n      var focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);\n      if (focusIntent !== undefined) {\n        event.preventDefault();\n        var items = getItems().filter(function (item) {\n          return item.focusable;\n        });\n        var candidateNodes = items.map(function (item) {\n          return item.ref.current;\n        });\n        if (focusIntent === 'last') candidateNodes.reverse();else if (focusIntent === 'prev' || focusIntent === 'next') {\n          if (focusIntent === 'prev') candidateNodes.reverse();\n          var currentIndex = candidateNodes.indexOf(event.currentTarget);\n          candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n        }\n        /**\n        * Imperative focus during keydown is risky so we prevent React's batching updates\n        * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n        */\n        setTimeout(function () {\n          return $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);\n        });\n      }\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($d7bdfb9eb0fdf311$export$ab9df7c53fe8454, {\n  displayName: $d7bdfb9eb0fdf311$var$ITEM_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ // prettier-ignore\nvar $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {\n  ArrowLeft: 'prev',\n  ArrowUp: 'prev',\n  ArrowRight: 'next',\n  ArrowDown: 'next',\n  PageUp: 'first',\n  Home: 'first',\n  PageDown: 'last',\n  End: 'last'\n};\nfunction $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {\n  if (dir !== 'rtl') return key;\n  return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\nfunction $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {\n  var key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);\n  if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n  if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n  return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction $d7bdfb9eb0fdf311$var$focusFirst(candidates) {\n  var PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n  var _iterator = _createForOfIteratorHelper(candidates),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var candidate = _step.value;\n      // if focus is already where we want to go, we don't want to keep going through the candidates\n      if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n      candidate.focus();\n      if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n}\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {\n  return array.map(function (_, index) {\n    return array[(startIndex + index) % array.length];\n  });\n}\nvar $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338;\nvar $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;\nexport { $d7bdfb9eb0fdf311$export$c7109489551a4f4 as createRovingFocusGroupScope, $d7bdfb9eb0fdf311$export$8699f7c8af148338 as RovingFocusGroup, $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 as RovingFocusGroupItem, $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 as Root, $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 as Item };","map":{"version":3,"names":["$d7bdfb9eb0fdf311$var$ENTRY_FOCUS","$d7bdfb9eb0fdf311$var$EVENT_OPTIONS","bubbles","cancelable","$d7bdfb9eb0fdf311$var$GROUP_NAME","_$98Iye$createCollect","$98Iye$createCollection","_$98Iye$createCollect2","_slicedToArray","$d7bdfb9eb0fdf311$var$Collection","$d7bdfb9eb0fdf311$var$useCollection","$d7bdfb9eb0fdf311$var$createCollectionScope","_$98Iye$createContext","$98Iye$createContextScope","_$98Iye$createContext2","$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext","$d7bdfb9eb0fdf311$export$c7109489551a4f4","_$d7bdfb9eb0fdf311$va","_$d7bdfb9eb0fdf311$va2","$d7bdfb9eb0fdf311$var$RovingFocusProvider","$d7bdfb9eb0fdf311$var$useRovingFocusContext","$d7bdfb9eb0fdf311$export$8699f7c8af148338","$98Iye$forwardRef","props","forwardedRef","$98Iye$createElement","Provider","scope","__scopeRovingFocusGroup","Slot","$d7bdfb9eb0fdf311$var$RovingFocusGroupImpl","$98Iye$babelruntimehelpersesmextends","ref","Object","assign","displayName","orientation","loop","_props$loop","dir","currentTabStopIdProp","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","groupProps","_objectWithoutProperties","_excluded","$98Iye$useRef","composedRefs","$98Iye$useComposedRefs","direction","$98Iye$useDirection","_$98Iye$useControllab","$98Iye$useControllableState","prop","defaultProp","onChange","_$98Iye$useControllab2","_$98Iye$useControllab3","setCurrentTabStopId","_$98Iye$useState","$98Iye$useState","_$98Iye$useState2","isTabbingBackOut","setIsTabbingBackOut","handleEntryFocus","$98Iye$useCallbackRef","getItems","isClickFocusRef","_$98Iye$useState3","_$98Iye$useState4","focusableItemsCount","setFocusableItemsCount","$98Iye$useEffect","node","current","addEventListener","removeEventListener","onItemFocus","$98Iye$useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","$98Iye$Primitive","div","tabIndex","style","_objectSpread","outline","onMouseDown","$98Iye$composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","activeItem","find","active","currentItem","id","candidateItems","concat","_toConsumableArray","Boolean","candidateNodes","map","$d7bdfb9eb0fdf311$var$focusFirst","onBlur","$d7bdfb9eb0fdf311$var$ITEM_NAME","$d7bdfb9eb0fdf311$export$ab9df7c53fe8454","_props$focusable","_props$active","itemProps","_excluded2","autoId","$98Iye$useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","$d7bdfb9eb0fdf311$var$getFocusIntent","undefined","reverse","currentIndex","indexOf","$d7bdfb9eb0fdf311$var$wrapArray","slice","setTimeout","$d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","$d7bdfb9eb0fdf311$var$getDirectionAwareKey","getDirectionAwareKey","getFocusIntent","includes","focusFirst","candidates","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","_iterator","_createForOfIteratorHelper","_step","s","n","done","candidate","value","focus","err","e","f","wrapArray","array","startIndex","_","index","length","$d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9","$d7bdfb9eb0fdf311$export$6d08773d2e66f8f2"],"sources":["C:\\Users\\user\\Desktop\\02portreact\\node_modules\\@radix-ui\\react-roving-focus\\dist\\packages\\react\\roving-focus\\src\\index.ts","C:\\Users\\user\\Desktop\\02portreact\\node_modules\\@radix-ui\\react-roving-focus\\dist\\packages\\react\\roving-focus\\src\\RovingFocusGroup.tsx"],"sourcesContent":["export {\n  createRovingFocusGroupScope,\n  //\n  RovingFocusGroup,\n  RovingFocusGroupItem,\n  //\n  Root,\n  Item,\n} from './RovingFocusGroup';\nexport type { RovingFocusGroupProps, RovingFocusItemProps } from './RovingFocusGroup';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'RovingFocusGroup';\n\ntype ItemData = { id: string; focusable: boolean; active: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n  HTMLSpanElement,\n  ItemData\n>(GROUP_NAME);\n\ntype ScopedProps<P> = P & { __scopeRovingFocusGroup?: Scope };\nconst [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n  GROUP_NAME,\n  [createCollectionScope]\n);\n\ntype Orientation = React.AriaAttributes['aria-orientation'];\ntype Direction = 'ltr' | 'rtl';\n\ninterface RovingFocusGroupOptions {\n  /**\n   * The orientation of the group.\n   * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n   */\n  orientation?: Orientation;\n  /**\n   * The direction of navigation between items.\n   */\n  dir?: Direction;\n  /**\n   * Whether keyboard navigation should loop around\n   * @defaultValue false\n   */\n  loop?: boolean;\n}\n\ntype RovingContextValue = RovingFocusGroupOptions & {\n  currentTabStopId: string | null;\n  onItemFocus(tabStopId: string): void;\n  onItemShiftTab(): void;\n  onFocusableItemAdd(): void;\n  onFocusableItemRemove(): void;\n};\n\nconst [RovingFocusProvider, useRovingFocusContext] =\n  createRovingFocusGroupContext<RovingContextValue>(GROUP_NAME);\n\ntype RovingFocusGroupElement = RovingFocusGroupImplElement;\ninterface RovingFocusGroupProps extends RovingFocusGroupImplProps {}\n\nconst RovingFocusGroup = React.forwardRef<RovingFocusGroupElement, RovingFocusGroupProps>(\n  (props: ScopedProps<RovingFocusGroupProps>, forwardedRef) => {\n    return (\n      <Collection.Provider scope={props.__scopeRovingFocusGroup}>\n        <Collection.Slot scope={props.__scopeRovingFocusGroup}>\n          <RovingFocusGroupImpl {...props} ref={forwardedRef} />\n        </Collection.Slot>\n      </Collection.Provider>\n    );\n  }\n);\n\nRovingFocusGroup.displayName = GROUP_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupImplElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RovingFocusGroupImplProps\n  extends Omit<PrimitiveDivProps, 'dir'>,\n    RovingFocusGroupOptions {\n  currentTabStopId?: string | null;\n  defaultCurrentTabStopId?: string;\n  onCurrentTabStopIdChange?: (tabStopId: string | null) => void;\n  onEntryFocus?: (event: Event) => void;\n}\n\nconst RovingFocusGroupImpl = React.forwardRef<\n  RovingFocusGroupImplElement,\n  RovingFocusGroupImplProps\n>((props: ScopedProps<RovingFocusGroupImplProps>, forwardedRef) => {\n  const {\n    __scopeRovingFocusGroup,\n    orientation,\n    loop = false,\n    dir,\n    currentTabStopId: currentTabStopIdProp,\n    defaultCurrentTabStopId,\n    onCurrentTabStopIdChange,\n    onEntryFocus,\n    ...groupProps\n  } = props;\n  const ref = React.useRef<RovingFocusGroupImplElement>(null);\n  const composedRefs = useComposedRefs(forwardedRef, ref);\n  const direction = useDirection(dir);\n  const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({\n    prop: currentTabStopIdProp,\n    defaultProp: defaultCurrentTabStopId,\n    onChange: onCurrentTabStopIdChange,\n  });\n  const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n  const handleEntryFocus = useCallbackRef(onEntryFocus);\n  const getItems = useCollection(__scopeRovingFocusGroup);\n  const isClickFocusRef = React.useRef(false);\n  const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n\n  React.useEffect(() => {\n    const node = ref.current;\n    if (node) {\n      node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n      return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n    }\n  }, [handleEntryFocus]);\n\n  return (\n    <RovingFocusProvider\n      scope={__scopeRovingFocusGroup}\n      orientation={orientation}\n      dir={direction}\n      loop={loop}\n      currentTabStopId={currentTabStopId}\n      onItemFocus={React.useCallback(\n        (tabStopId) => setCurrentTabStopId(tabStopId),\n        [setCurrentTabStopId]\n      )}\n      onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}\n      onFocusableItemAdd={React.useCallback(\n        () => setFocusableItemsCount((prevCount) => prevCount + 1),\n        []\n      )}\n      onFocusableItemRemove={React.useCallback(\n        () => setFocusableItemsCount((prevCount) => prevCount - 1),\n        []\n      )}\n    >\n      <Primitive.div\n        tabIndex={isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0}\n        data-orientation={orientation}\n        {...groupProps}\n        ref={composedRefs}\n        style={{ outline: 'none', ...props.style }}\n        onMouseDown={composeEventHandlers(props.onMouseDown, () => {\n          isClickFocusRef.current = true;\n        })}\n        onFocus={composeEventHandlers(props.onFocus, (event) => {\n          // We normally wouldn't need this check, because we already check\n          // that the focus is on the current target and not bubbling to it.\n          // We do this because Safari doesn't focus buttons when clicked, and\n          // instead, the wrapper will get focused and not through a bubbling event.\n          const isKeyboardFocus = !isClickFocusRef.current;\n\n          if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n            const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n            event.currentTarget.dispatchEvent(entryFocusEvent);\n\n            if (!entryFocusEvent.defaultPrevented) {\n              const items = getItems().filter((item) => item.focusable);\n              const activeItem = items.find((item) => item.active);\n              const currentItem = items.find((item) => item.id === currentTabStopId);\n              const candidateItems = [activeItem, currentItem, ...items].filter(\n                Boolean\n              ) as typeof items;\n              const candidateNodes = candidateItems.map((item) => item.ref.current!);\n              focusFirst(candidateNodes);\n            }\n          }\n\n          isClickFocusRef.current = false;\n        })}\n        onBlur={composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))}\n      />\n    </RovingFocusProvider>\n  );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RovingFocusGroupItem';\n\ntype RovingFocusItemElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface RovingFocusItemProps extends PrimitiveSpanProps {\n  tabStopId?: string;\n  focusable?: boolean;\n  active?: boolean;\n}\n\nconst RovingFocusGroupItem = React.forwardRef<RovingFocusItemElement, RovingFocusItemProps>(\n  (props: ScopedProps<RovingFocusItemProps>, forwardedRef) => {\n    const {\n      __scopeRovingFocusGroup,\n      focusable = true,\n      active = false,\n      tabStopId,\n      ...itemProps\n    } = props;\n    const autoId = useId();\n    const id = tabStopId || autoId;\n    const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n    const isCurrentTabStop = context.currentTabStopId === id;\n    const getItems = useCollection(__scopeRovingFocusGroup);\n\n    const { onFocusableItemAdd, onFocusableItemRemove } = context;\n\n    React.useEffect(() => {\n      if (focusable) {\n        onFocusableItemAdd();\n        return () => onFocusableItemRemove();\n      }\n    }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n\n    return (\n      <Collection.ItemSlot\n        scope={__scopeRovingFocusGroup}\n        id={id}\n        focusable={focusable}\n        active={active}\n      >\n        <Primitive.span\n          tabIndex={isCurrentTabStop ? 0 : -1}\n          data-orientation={context.orientation}\n          {...itemProps}\n          ref={forwardedRef}\n          onMouseDown={composeEventHandlers(props.onMouseDown, (event) => {\n            // We prevent focusing non-focusable items on `mousedown`.\n            // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n            if (!focusable) event.preventDefault();\n            // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n            else context.onItemFocus(id);\n          })}\n          onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}\n          onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n            if (event.key === 'Tab' && event.shiftKey) {\n              context.onItemShiftTab();\n              return;\n            }\n\n            if (event.target !== event.currentTarget) return;\n\n            const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n\n            if (focusIntent !== undefined) {\n              event.preventDefault();\n              const items = getItems().filter((item) => item.focusable);\n              let candidateNodes = items.map((item) => item.ref.current!);\n\n              if (focusIntent === 'last') candidateNodes.reverse();\n              else if (focusIntent === 'prev' || focusIntent === 'next') {\n                if (focusIntent === 'prev') candidateNodes.reverse();\n                const currentIndex = candidateNodes.indexOf(event.currentTarget);\n                candidateNodes = context.loop\n                  ? wrapArray(candidateNodes, currentIndex + 1)\n                  : candidateNodes.slice(currentIndex + 1);\n              }\n\n              /**\n               * Imperative focus during keydown is risky so we prevent React's batching updates\n               * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n               */\n              setTimeout(() => focusFirst(candidateNodes));\n            }\n          })}\n        />\n      </Collection.ItemSlot>\n    );\n  }\n);\n\nRovingFocusGroupItem.displayName = ITEM_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// prettier-ignore\nconst MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n  ArrowLeft: 'prev', ArrowUp: 'prev',\n  ArrowRight: 'next', ArrowDown: 'next',\n  PageUp: 'first', Home: 'first',\n  PageDown: 'last', End: 'last',\n};\n\nfunction getDirectionAwareKey(key: string, dir?: Direction) {\n  if (dir !== 'rtl') return key;\n  return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nfunction getFocusIntent(event: React.KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n  const key = getDirectionAwareKey(event.key, dir);\n  if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n  if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n  return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n  for (const candidate of candidates) {\n    // if focus is already where we want to go, we don't want to keep going through the candidates\n    if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n    candidate.focus();\n    if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n  }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n  return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\nconst Root = RovingFocusGroup;\nconst Item = RovingFocusGroupItem;\n\nexport {\n  createRovingFocusGroupScope,\n  //\n  RovingFocusGroup,\n  RovingFocusGroupItem,\n  //\n  Root,\n  Item,\n};\nexport type { RovingFocusGroupProps, RovingFocusItemProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;ACcA,IAAMA,iCAAW,GAAG,+BAApB;AACA,IAAMC,mCAAa,GAAG;EAAEC,OAAO,EAAE,KAAX;EAAkBC,UAAU,EAAE;CAApD;AAEA;;;AAIA,IAAMC,gCAAU,GAAG,kBAAnB;AAGA,IAAAC,qBAAA,GAA2DC,uBAAgB,CAGzEF,gCAHyE,CAA3E;EAAAG,sBAAA,GAAAC,cAAA,CAAAH,qBAAA;EAAOI,gCAAD,GAAAF,sBAAA;EAAaG,mCAAb,GAAAH,sBAAA;EAA4BI,2CAA5B,GAAAJ,sBAAA;AAMN,IAAAK,qBAAA,GAAqEC,yBAAkB,CACrFT,gCADqF,EAErF,CAACO,2CAAD,CAFqF,CAAvF;EAAAG,sBAAA,GAAAN,cAAA,CAAAI,qBAAA;EAAOG,mDAAD,GAAAD,sBAAA;EAAgCE,wCAAhC,GAAAF,sBAAA;AAiCN,IAAAG,qBAAA,GACEF,mDAA6B,CAAqBX,gCAArB,CAD/B;EAAAc,sBAAA,GAAAV,cAAA,CAAAS,qBAAA;EAAOE,yCAAD,GAAAD,sBAAA;EAAsBE,2CAAtB,GAAAF,sBAAA;AAMN,IAAMG,yCAAgB,gBAAGC,iBAAA,CACvB,UAACC,KAAD,EAA4CC,YAA5C,EAA6D;EAC3D,oBACEC,oBAAA,CAAChB,gCAAD,CAAYiB,QAAZ,EADF;IACuBC,KAAK,EAAEJ,KAAK,CAACK;GAAlC,eACEH,oBAAA,CAAChB,gCAAD,CAAYoB,IAAZ,EADF;IACmBF,KAAK,EAAEJ,KAAK,CAACK;GAA9B,eACEH,oBAAA,CAACK,0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