{"ast":null,"code":"import _createForOfIteratorHelper from \"C:/Users/user/Desktop/03portreact/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js\";\nimport _objectSpread from \"C:/Users/user/Desktop/03portreact/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _objectWithoutProperties from \"C:/Users/user/Desktop/03portreact/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nimport _slicedToArray from \"C:/Users/user/Desktop/03portreact/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nvar _excluded = [\"__scopeMenu\"],\n  _excluded2 = [\"forceMount\"],\n  _excluded3 = [\"__scopeMenu\", \"loop\", \"trapFocus\", \"onOpenAutoFocus\", \"onCloseAutoFocus\", \"disableOutsidePointerEvents\", \"onEntryFocus\", \"onEscapeKeyDown\", \"onPointerDownOutside\", \"onFocusOutside\", \"onInteractOutside\", \"onDismiss\", \"disableOutsideScroll\"],\n  _excluded4 = [\"__scopeMenu\"],\n  _excluded5 = [\"__scopeMenu\"],\n  _excluded6 = [\"disabled\", \"onSelect\"],\n  _excluded7 = [\"__scopeMenu\", \"disabled\", \"textValue\"],\n  _excluded8 = [\"checked\", \"onCheckedChange\"],\n  _excluded9 = [\"value\", \"onValueChange\"],\n  _excluded10 = [\"value\"],\n  _excluded11 = [\"__scopeMenu\", \"forceMount\"],\n  _excluded12 = [\"__scopeMenu\"],\n  _excluded13 = [\"__scopeMenu\"],\n  _excluded14 = [\"forceMount\"];\nimport $epM9y$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport { useState as $epM9y$useState, useRef as $epM9y$useRef, useEffect as $epM9y$useEffect, createElement as $epM9y$createElement, useCallback as $epM9y$useCallback, forwardRef as $epM9y$forwardRef, Fragment as $epM9y$Fragment } from \"react\";\nimport { composeEventHandlers as $epM9y$composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection as $epM9y$createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs as $epM9y$useComposedRefs, composeRefs as $epM9y$composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope as $epM9y$createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection as $epM9y$useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer as $epM9y$DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards as $epM9y$useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope as $epM9y$FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId as $epM9y$useId } from \"@radix-ui/react-id\";\nimport { createPopperScope as $epM9y$createPopperScope, Root as $epM9y$Root, Anchor as $epM9y$Anchor, Content as $epM9y$Content, Arrow as $epM9y$Arrow } from \"@radix-ui/react-popper\";\nimport { Portal as $epM9y$Portal } from \"@radix-ui/react-portal\";\nimport { Presence as $epM9y$Presence } from \"@radix-ui/react-presence\";\nimport { Primitive as $epM9y$Primitive, dispatchDiscreteCustomEvent as $epM9y$dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { createRovingFocusGroupScope as $epM9y$createRovingFocusGroupScope, Root as $epM9y$Root1, Item as $epM9y$Item } from \"@radix-ui/react-roving-focus\";\nimport { Slot as $epM9y$Slot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef as $epM9y$useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers as $epM9y$hideOthers } from \"aria-hidden\";\nimport { RemoveScroll as $epM9y$RemoveScroll } from \"react-remove-scroll\";\nvar $6cc32821e9371a1c$var$SELECTION_KEYS = ['Enter', ' '];\nvar $6cc32821e9371a1c$var$FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nvar $6cc32821e9371a1c$var$LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nvar $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [].concat($6cc32821e9371a1c$var$FIRST_KEYS, $6cc32821e9371a1c$var$LAST_KEYS);\nvar $6cc32821e9371a1c$var$SUB_OPEN_KEYS = {\n  ltr: [].concat($6cc32821e9371a1c$var$SELECTION_KEYS, ['ArrowRight']),\n  rtl: [].concat($6cc32821e9371a1c$var$SELECTION_KEYS, ['ArrowLeft'])\n};\nvar $6cc32821e9371a1c$var$SUB_CLOSE_KEYS = {\n  ltr: ['ArrowLeft'],\n  rtl: ['ArrowRight']\n};\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$MENU_NAME = 'Menu';\nvar _$epM9y$createCollect = $epM9y$createCollection($6cc32821e9371a1c$var$MENU_NAME),\n  _$epM9y$createCollect2 = _slicedToArray(_$epM9y$createCollect, 3),\n  $6cc32821e9371a1c$var$Collection = _$epM9y$createCollect2[0],\n  $6cc32821e9371a1c$var$useCollection = _$epM9y$createCollect2[1],\n  $6cc32821e9371a1c$var$createCollectionScope = _$epM9y$createCollect2[2];\nvar _$epM9y$createContext = $epM9y$createContextScope($6cc32821e9371a1c$var$MENU_NAME, [$6cc32821e9371a1c$var$createCollectionScope, $epM9y$createPopperScope, $epM9y$createRovingFocusGroupScope]),\n  _$epM9y$createContext2 = _slicedToArray(_$epM9y$createContext, 2),\n  $6cc32821e9371a1c$var$createMenuContext = _$epM9y$createContext2[0],\n  $6cc32821e9371a1c$export$4027731b685e72eb = _$epM9y$createContext2[1];\nvar $6cc32821e9371a1c$var$usePopperScope = $epM9y$createPopperScope();\nvar $6cc32821e9371a1c$var$useRovingFocusGroupScope = $epM9y$createRovingFocusGroupScope();\nvar _$6cc32821e9371a1c$va = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME),\n  _$6cc32821e9371a1c$va2 = _slicedToArray(_$6cc32821e9371a1c$va, 2),\n  $6cc32821e9371a1c$var$MenuProvider = _$6cc32821e9371a1c$va2[0],\n  $6cc32821e9371a1c$var$useMenuContext = _$6cc32821e9371a1c$va2[1];\nvar _$6cc32821e9371a1c$va3 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME),\n  _$6cc32821e9371a1c$va4 = _slicedToArray(_$6cc32821e9371a1c$va3, 2),\n  $6cc32821e9371a1c$var$MenuRootProvider = _$6cc32821e9371a1c$va4[0],\n  $6cc32821e9371a1c$var$useMenuRootContext = _$6cc32821e9371a1c$va4[1];\nvar $6cc32821e9371a1c$export$d9b273488cd8ce6f = function $6cc32821e9371a1c$export$d9b273488cd8ce6f(props) {\n  var __scopeMenu = props.__scopeMenu,\n    _props$open = props.open,\n    open = _props$open === void 0 ? false : _props$open,\n    children = props.children,\n    dir = props.dir,\n    onOpenChange = props.onOpenChange,\n    _props$modal = props.modal,\n    modal = _props$modal === void 0 ? true : _props$modal;\n  var popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  var _$epM9y$useState = $epM9y$useState(null),\n    _$epM9y$useState2 = _slicedToArray(_$epM9y$useState, 2),\n    content = _$epM9y$useState2[0],\n    setContent = _$epM9y$useState2[1];\n  var isUsingKeyboardRef = $epM9y$useRef(false);\n  var handleOpenChange = $epM9y$useCallbackRef(onOpenChange);\n  var direction = $epM9y$useDirection(dir);\n  $epM9y$useEffect(function () {\n    // Capture phase ensures we set the boolean before any side effects execute\n    // in response to the key or pointer event as they might depend on this value.\n    var handleKeyDown = function handleKeyDown() {\n      isUsingKeyboardRef.current = true;\n      document.addEventListener('pointerdown', handlePointer, {\n        capture: true,\n        once: true\n      });\n      document.addEventListener('pointermove', handlePointer, {\n        capture: true,\n        once: true\n      });\n    };\n    var handlePointer = function handlePointer() {\n      return isUsingKeyboardRef.current = false;\n    };\n    document.addEventListener('keydown', handleKeyDown, {\n      capture: true\n    });\n    return function () {\n      document.removeEventListener('keydown', handleKeyDown, {\n        capture: true\n      });\n      document.removeEventListener('pointerdown', handlePointer, {\n        capture: true\n      });\n      document.removeEventListener('pointermove', handlePointer, {\n        capture: true\n      });\n    };\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Root, popperScope, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuProvider, {\n    scope: __scopeMenu,\n    open: open,\n    onOpenChange: handleOpenChange,\n    content: content,\n    onContentChange: setContent\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootProvider, {\n    scope: __scopeMenu,\n    onClose: $epM9y$useCallback(function () {\n      return handleOpenChange(false);\n    }, [handleOpenChange]),\n    isUsingKeyboardRef: isUsingKeyboardRef,\n    dir: direction,\n    modal: modal\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$d9b273488cd8ce6f, {\n  displayName: $6cc32821e9371a1c$var$MENU_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$ANCHOR_NAME = 'MenuAnchor';\nvar $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    anchorProps = _objectWithoutProperties(props, _excluded);\n  var popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Anchor, $epM9y$babelruntimehelpersesmextends({}, popperScope, anchorProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$9fa5ebd18bee4d43, {\n  displayName: $6cc32821e9371a1c$var$ANCHOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$PORTAL_NAME = 'MenuPortal';\nvar _$6cc32821e9371a1c$va5 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, {\n    forceMount: undefined\n  }),\n  _$6cc32821e9371a1c$va6 = _slicedToArray(_$6cc32821e9371a1c$va5, 2),\n  $6cc32821e9371a1c$var$PortalProvider = _$6cc32821e9371a1c$va6[0],\n  $6cc32821e9371a1c$var$usePortalContext = _$6cc32821e9371a1c$va6[1];\nvar $6cc32821e9371a1c$export$793392f970497feb = function $6cc32821e9371a1c$export$793392f970497feb(props) {\n  var __scopeMenu = props.__scopeMenu,\n    forceMount = props.forceMount,\n    children = props.children,\n    container = props.container;\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, __scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$PortalProvider, {\n    scope: __scopeMenu,\n    forceMount: forceMount\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Portal, {\n    asChild: true,\n    container: container\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$793392f970497feb, {\n  displayName: $6cc32821e9371a1c$var$PORTAL_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$CONTENT_NAME = 'MenuContent';\nvar _$6cc32821e9371a1c$va7 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$CONTENT_NAME),\n  _$6cc32821e9371a1c$va8 = _slicedToArray(_$6cc32821e9371a1c$va7, 2),\n  $6cc32821e9371a1c$var$MenuContentProvider = _$6cc32821e9371a1c$va8[0],\n  $6cc32821e9371a1c$var$useMenuContentContext = _$6cc32821e9371a1c$va8[1];\nvar $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var _props$forceMount = props.forceMount,\n    forceMount = _props$forceMount === void 0 ? portalContext.forceMount : _props$forceMount,\n    contentProps = _objectWithoutProperties(props, _excluded2);\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Provider, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Slot, {\n    scope: props.__scopeMenu\n  }, rootContext.modal ? /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootContentModal, $epM9y$babelruntimehelpersesmextends({}, contentProps, {\n    ref: forwardedRef\n  })) : /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootContentNonModal, $epM9y$babelruntimehelpersesmextends({}, contentProps, {\n    ref: forwardedRef\n  })))));\n});\n/* ---------------------------------------------------------------------------------------------- */\nvar $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var ref = $epM9y$useRef(null);\n  var composedRefs = $epM9y$useComposedRefs(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`\n  $epM9y$useEffect(function () {\n    var content = ref.current;\n    if (content) return $epM9y$hideOthers(content);\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({}, props, {\n    ref: composedRefs // we make sure we're not trapping once it's been closed\n    ,\n\n    trapFocus: context.open // make sure to only disable pointer events when open\n    ,\n\n    disableOutsidePointerEvents: context.open,\n    disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen.\n    ,\n\n    onFocusOutside: $epM9y$composeEventHandlers(props.onFocusOutside, function (event) {\n      return event.preventDefault();\n    }, {\n      checkForDefaultPrevented: false\n    }),\n    onDismiss: function onDismiss() {\n      return context.onOpenChange(false);\n    }\n  }));\n});\nvar $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({}, props, {\n    ref: forwardedRef,\n    trapFocus: false,\n    disableOutsidePointerEvents: false,\n    disableOutsideScroll: false,\n    onDismiss: function onDismiss() {\n      return context.onOpenChange(false);\n    }\n  }));\n});\n/* ---------------------------------------------------------------------------------------------- */\nvar $6cc32821e9371a1c$var$MenuContentImpl = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    _props$loop = props.loop,\n    loop = _props$loop === void 0 ? false : _props$loop,\n    trapFocus = props.trapFocus,\n    onOpenAutoFocus = props.onOpenAutoFocus,\n    onCloseAutoFocus = props.onCloseAutoFocus,\n    disableOutsidePointerEvents = props.disableOutsidePointerEvents,\n    onEntryFocus = props.onEntryFocus,\n    onEscapeKeyDown = props.onEscapeKeyDown,\n    onPointerDownOutside = props.onPointerDownOutside,\n    onFocusOutside = props.onFocusOutside,\n    onInteractOutside = props.onInteractOutside,\n    onDismiss = props.onDismiss,\n    disableOutsideScroll = props.disableOutsideScroll,\n    contentProps = _objectWithoutProperties(props, _excluded3);\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu);\n  var rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu);\n  var popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  var rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);\n  var getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu);\n  var _$epM9y$useState3 = $epM9y$useState(null),\n    _$epM9y$useState4 = _slicedToArray(_$epM9y$useState3, 2),\n    currentItemId = _$epM9y$useState4[0],\n    setCurrentItemId = _$epM9y$useState4[1];\n  var contentRef = $epM9y$useRef(null);\n  var composedRefs = $epM9y$useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n  var timerRef = $epM9y$useRef(0);\n  var searchRef = $epM9y$useRef('');\n  var pointerGraceTimerRef = $epM9y$useRef(0);\n  var pointerGraceIntentRef = $epM9y$useRef(null);\n  var pointerDirRef = $epM9y$useRef('right');\n  var lastPointerXRef = $epM9y$useRef(0);\n  var ScrollLockWrapper = disableOutsideScroll ? $epM9y$RemoveScroll : $epM9y$Fragment;\n  var scrollLockWrapperProps = disableOutsideScroll ? {\n    as: $epM9y$Slot,\n    allowPinchZoom: true\n  } : undefined;\n  var handleTypeaheadSearch = function handleTypeaheadSearch(key) {\n    var _items$find, _items$find2;\n    var search = searchRef.current + key;\n    var items = getItems().filter(function (item) {\n      return !item.disabled;\n    });\n    var currentItem = document.activeElement;\n    var currentMatch = (_items$find = items.find(function (item) {\n      return item.ref.current === currentItem;\n    })) === null || _items$find === void 0 ? void 0 : _items$find.textValue;\n    var values = items.map(function (item) {\n      return item.textValue;\n    });\n    var nextMatch = $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch);\n    var newItem = (_items$find2 = items.find(function (item) {\n      return item.textValue === nextMatch;\n    })) === null || _items$find2 === void 0 ? void 0 : _items$find2.ref.current; // Reset `searchRef` 1 second after it was last updated\n    (function updateSearch(value) {\n      searchRef.current = value;\n      window.clearTimeout(timerRef.current);\n      if (value !== '') timerRef.current = window.setTimeout(function () {\n        return updateSearch('');\n      }, 1000);\n    })(search);\n    if (newItem)\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 newItem.focus();\n      });\n  };\n  $epM9y$useEffect(function () {\n    return function () {\n      return window.clearTimeout(timerRef.current);\n    };\n  }, []); // Make sure the whole tree has focus guards as our `MenuContent` may be\n  // the last element in the DOM (beacuse of the `Portal`)\n  $epM9y$useFocusGuards();\n  var isPointerMovingToSubmenu = $epM9y$useCallback(function (event) {\n    var _pointerGraceIntentRe, _pointerGraceIntentRe2;\n    var isMovingTowards = pointerDirRef.current === ((_pointerGraceIntentRe = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe === void 0 ? void 0 : _pointerGraceIntentRe.side);\n    return isMovingTowards && $6cc32821e9371a1c$var$isPointerInGraceArea(event, (_pointerGraceIntentRe2 = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe2 === void 0 ? void 0 : _pointerGraceIntentRe2.area);\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentProvider, {\n    scope: __scopeMenu,\n    searchRef: searchRef,\n    onItemEnter: $epM9y$useCallback(function (event) {\n      if (isPointerMovingToSubmenu(event)) event.preventDefault();\n    }, [isPointerMovingToSubmenu]),\n    onItemLeave: $epM9y$useCallback(function (event) {\n      var _contentRef$current;\n      if (isPointerMovingToSubmenu(event)) return;\n      (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();\n      setCurrentItemId(null);\n    }, [isPointerMovingToSubmenu]),\n    onTriggerLeave: $epM9y$useCallback(function (event) {\n      if (isPointerMovingToSubmenu(event)) event.preventDefault();\n    }, [isPointerMovingToSubmenu]),\n    pointerGraceTimerRef: pointerGraceTimerRef,\n    onPointerGraceIntentChange: $epM9y$useCallback(function (intent) {\n      pointerGraceIntentRef.current = intent;\n    }, [])\n  }, /*#__PURE__*/$epM9y$createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/$epM9y$createElement($epM9y$FocusScope, {\n    asChild: true,\n    trapped: trapFocus,\n    onMountAutoFocus: $epM9y$composeEventHandlers(onOpenAutoFocus, function (event) {\n      var _contentRef$current2;\n      // when opening, explicitly focus the content area only and leave\n      // `onEntryFocus` in  control of focusing first item\n      event.preventDefault();\n      (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus();\n    }),\n    onUnmountAutoFocus: onCloseAutoFocus\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$DismissableLayer, {\n    asChild: true,\n    disableOutsidePointerEvents: disableOutsidePointerEvents,\n    onEscapeKeyDown: onEscapeKeyDown,\n    onPointerDownOutside: onPointerDownOutside,\n    onFocusOutside: onFocusOutside,\n    onInteractOutside: onInteractOutside,\n    onDismiss: onDismiss\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Root1, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, rovingFocusGroupScope, {\n    dir: rootContext.dir,\n    orientation: \"vertical\",\n    loop: loop,\n    currentTabStopId: currentItemId,\n    onCurrentTabStopIdChange: setCurrentItemId,\n    onEntryFocus: $epM9y$composeEventHandlers(onEntryFocus, function (event) {\n      // only focus first item when using keyboard\n      if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n    })\n  }), /*#__PURE__*/$epM9y$createElement($epM9y$Content, $epM9y$babelruntimehelpersesmextends({\n    role: \"menu\",\n    \"aria-orientation\": \"vertical\",\n    \"data-state\": $6cc32821e9371a1c$var$getOpenState(context.open),\n    \"data-radix-menu-content\": \"\",\n    dir: rootContext.dir\n  }, popperScope, contentProps, {\n    ref: composedRefs,\n    style: _objectSpread({\n      outline: 'none'\n    }, contentProps.style),\n    onKeyDown: $epM9y$composeEventHandlers(contentProps.onKeyDown, function (event) {\n      // submenu key events bubble through portals. We only care about keys in this menu.\n      var target = event.target;\n      var isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget;\n      var isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n      var isCharacterKey = event.key.length === 1;\n      if (isKeyDownInside) {\n        // menus should not be navigated using tab key so we prevent it\n        if (event.key === 'Tab') event.preventDefault();\n        if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n      } // focus first/last item based on key pressed\n      var content = contentRef.current;\n      if (event.target !== content) return;\n      if (!$6cc32821e9371a1c$var$FIRST_LAST_KEYS.includes(event.key)) return;\n      event.preventDefault();\n      var items = getItems().filter(function (item) {\n        return !item.disabled;\n      });\n      var candidateNodes = items.map(function (item) {\n        return item.ref.current;\n      });\n      if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n      $6cc32821e9371a1c$var$focusFirst(candidateNodes);\n    }),\n    onBlur: $epM9y$composeEventHandlers(props.onBlur, function (event) {\n      // clear search buffer when leaving the menu\n      if (!event.currentTarget.contains(event.target)) {\n        window.clearTimeout(timerRef.current);\n        searchRef.current = '';\n      }\n    }),\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(function (event) {\n      var target = event.target;\n      var pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will\n      // always return `0` on a pointer event.\n      if (event.currentTarget.contains(target) && pointerXHasChanged) {\n        var newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n        pointerDirRef.current = newDir;\n        lastPointerXRef.current = event.clientX;\n      }\n    }))\n  })))))));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$479f0f2f71193efe, {\n  displayName: $6cc32821e9371a1c$var$CONTENT_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$GROUP_NAME = 'MenuGroup';\nvar $6cc32821e9371a1c$export$22a631d1f72787bb = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    groupProps = _objectWithoutProperties(props, _excluded4);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"group\"\n  }, groupProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$22a631d1f72787bb, {\n  displayName: $6cc32821e9371a1c$var$GROUP_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$LABEL_NAME = 'MenuLabel';\nvar $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    labelProps = _objectWithoutProperties(props, _excluded5);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({}, labelProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$dd37bec0e8a99143, {\n  displayName: $6cc32821e9371a1c$var$LABEL_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$ITEM_NAME = 'MenuItem';\nvar $6cc32821e9371a1c$var$ITEM_SELECT = 'menu.itemSelect';\nvar $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var _props$disabled = props.disabled,\n    disabled = _props$disabled === void 0 ? false : _props$disabled,\n    onSelect = props.onSelect,\n    itemProps = _objectWithoutProperties(props, _excluded6);\n  var ref = $epM9y$useRef(null);\n  var rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);\n  var contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);\n  var composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  var isPointerDownRef = $epM9y$useRef(false);\n  var handleSelect = function handleSelect() {\n    var menuItem = ref.current;\n    if (!disabled && menuItem) {\n      var itemSelectEvent = new CustomEvent($6cc32821e9371a1c$var$ITEM_SELECT, {\n        bubbles: true,\n        cancelable: true\n      });\n      menuItem.addEventListener($6cc32821e9371a1c$var$ITEM_SELECT, function (event) {\n        return onSelect === null || onSelect === void 0 ? void 0 : onSelect(event);\n      }, {\n        once: true\n      });\n      $epM9y$dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n      if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;else rootContext.onClose();\n    }\n  };\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuItemImpl, $epM9y$babelruntimehelpersesmextends({}, itemProps, {\n    ref: composedRefs,\n    disabled: disabled,\n    onClick: $epM9y$composeEventHandlers(props.onClick, handleSelect),\n    onPointerDown: function onPointerDown(event) {\n      var _props$onPointerDown;\n      (_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event);\n      isPointerDownRef.current = true;\n    },\n    onPointerUp: $epM9y$composeEventHandlers(props.onPointerUp, function (event) {\n      var _event$currentTarget;\n      // Pointer down can move to a different menu item which should activate it on pointer up.\n      // We dispatch a click for selection to allow composition with click based triggers and to\n      // prevent Firefox from getting stuck in text selection mode when the menu closes.\n      if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click();\n    }),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, function (event) {\n      var isTypingAhead = contentContext.searchRef.current !== '';\n      if (disabled || isTypingAhead && event.key === ' ') return;\n      if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) {\n        event.currentTarget.click();\n        /**\n        * We prevent default browser behaviour for selection keys as they should trigger\n        * a selection only:\n        * - prevents space from scrolling the page.\n        * - if keydown causes focus to move, prevents keydown from firing on the new target.\n        */\n        event.preventDefault();\n      }\n    })\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$2ce376c2cc3355c8, {\n  displayName: $6cc32821e9371a1c$var$ITEM_NAME\n});\n/* ---------------------------------------------------------------------------------------------- */\nvar $6cc32821e9371a1c$var$MenuItemImpl = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    _props$disabled2 = props.disabled,\n    disabled = _props$disabled2 === void 0 ? false : _props$disabled2,\n    textValue = props.textValue,\n    itemProps = _objectWithoutProperties(props, _excluded7);\n  var contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu);\n  var rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);\n  var ref = $epM9y$useRef(null);\n  var composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  var _$epM9y$useState5 = $epM9y$useState(false),\n    _$epM9y$useState6 = _slicedToArray(_$epM9y$useState5, 2),\n    isFocused = _$epM9y$useState6[0],\n    setIsFocused = _$epM9y$useState6[1]; // get the item's `.textContent` as default strategy for typeahead `textValue`\n  var _$epM9y$useState7 = $epM9y$useState(''),\n    _$epM9y$useState8 = _slicedToArray(_$epM9y$useState7, 2),\n    textContent = _$epM9y$useState8[0],\n    setTextContent = _$epM9y$useState8[1];\n  $epM9y$useEffect(function () {\n    var menuItem = ref.current;\n    if (menuItem) {\n      var _menuItem$textContent;\n      setTextContent(((_menuItem$textContent = menuItem.textContent) !== null && _menuItem$textContent !== void 0 ? _menuItem$textContent : '').trim());\n    }\n  }, [itemProps.children]);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.ItemSlot, {\n    scope: __scopeMenu,\n    disabled: disabled,\n    textValue: textValue !== null && textValue !== void 0 ? textValue : textContent\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Item, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, rovingFocusGroupScope, {\n    focusable: !disabled\n  }), /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitem\",\n    \"data-highlighted\": isFocused ? '' : undefined,\n    \"aria-disabled\": disabled || undefined,\n    \"data-disabled\": disabled ? '' : undefined\n  }, itemProps, {\n    ref: composedRefs,\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(function (event) {\n      if (disabled) contentContext.onItemLeave(event);else {\n        contentContext.onItemEnter(event);\n        if (!event.defaultPrevented) {\n          var item = event.currentTarget;\n          item.focus();\n        }\n      }\n    })),\n    onPointerLeave: $epM9y$composeEventHandlers(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse(function (event) {\n      return contentContext.onItemLeave(event);\n    })),\n    onFocus: $epM9y$composeEventHandlers(props.onFocus, function () {\n      return setIsFocused(true);\n    }),\n    onBlur: $epM9y$composeEventHandlers(props.onBlur, function () {\n      return setIsFocused(false);\n    })\n  }))));\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\nvar $6cc32821e9371a1c$export$f6f243521332502d = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var _props$checked = props.checked,\n    checked = _props$checked === void 0 ? false : _props$checked,\n    onCheckedChange = props.onCheckedChange,\n    checkboxItemProps = _objectWithoutProperties(props, _excluded8);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$ItemIndicatorProvider, {\n    scope: props.__scopeMenu,\n    checked: checked\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$2ce376c2cc3355c8, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitemcheckbox\",\n    \"aria-checked\": $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'mixed' : checked\n  }, checkboxItemProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(checked),\n    onSelect: $epM9y$composeEventHandlers(checkboxItemProps.onSelect, function () {\n      return onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange($6cc32821e9371a1c$var$isIndeterminate(checked) ? true : !checked);\n    }, {\n      checkForDefaultPrevented: false\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$f6f243521332502d, {\n  displayName: $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$RADIO_GROUP_NAME = 'MenuRadioGroup';\nvar _$6cc32821e9371a1c$va9 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$RADIO_GROUP_NAME, {\n    value: undefined,\n    onValueChange: function onValueChange() {}\n  }),\n  _$6cc32821e9371a1c$va10 = _slicedToArray(_$6cc32821e9371a1c$va9, 2),\n  $6cc32821e9371a1c$var$RadioGroupProvider = _$6cc32821e9371a1c$va10[0],\n  $6cc32821e9371a1c$var$useRadioGroupContext = _$6cc32821e9371a1c$va10[1];\nvar $6cc32821e9371a1c$export$ea2200c9eee416b3 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var value = props.value,\n    onValueChange = props.onValueChange,\n    groupProps = _objectWithoutProperties(props, _excluded9);\n  var handleValueChange = $epM9y$useCallbackRef(onValueChange);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$RadioGroupProvider, {\n    scope: props.__scopeMenu,\n    value: value,\n    onValueChange: handleValueChange\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$22a631d1f72787bb, $epM9y$babelruntimehelpersesmextends({}, groupProps, {\n    ref: forwardedRef\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$ea2200c9eee416b3, {\n  displayName: $6cc32821e9371a1c$var$RADIO_GROUP_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$RADIO_ITEM_NAME = 'MenuRadioItem';\nvar $6cc32821e9371a1c$export$69bd225e9817f6d0 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var value = props.value,\n    radioItemProps = _objectWithoutProperties(props, _excluded10);\n  var context = $6cc32821e9371a1c$var$useRadioGroupContext($6cc32821e9371a1c$var$RADIO_ITEM_NAME, props.__scopeMenu);\n  var checked = value === context.value;\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$ItemIndicatorProvider, {\n    scope: props.__scopeMenu,\n    checked: checked\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$2ce376c2cc3355c8, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitemradio\",\n    \"aria-checked\": checked\n  }, radioItemProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(checked),\n    onSelect: $epM9y$composeEventHandlers(radioItemProps.onSelect, function () {\n      var _context$onValueChang;\n      return (_context$onValueChang = context.onValueChange) === null || _context$onValueChang === void 0 ? void 0 : _context$onValueChang.call(context, value);\n    }, {\n      checkForDefaultPrevented: false\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$69bd225e9817f6d0, {\n  displayName: $6cc32821e9371a1c$var$RADIO_ITEM_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME = 'MenuItemIndicator';\nvar _$6cc32821e9371a1c$va11 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, {\n    checked: false\n  }),\n  _$6cc32821e9371a1c$va12 = _slicedToArray(_$6cc32821e9371a1c$va11, 2),\n  $6cc32821e9371a1c$var$ItemIndicatorProvider = _$6cc32821e9371a1c$va12[0],\n  $6cc32821e9371a1c$var$useItemIndicatorContext = _$6cc32821e9371a1c$va12[1];\nvar $6cc32821e9371a1c$export$a2593e23056970a3 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    forceMount = props.forceMount,\n    itemIndicatorProps = _objectWithoutProperties(props, _excluded11);\n  var indicatorContext = $6cc32821e9371a1c$var$useItemIndicatorContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, __scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || $6cc32821e9371a1c$var$isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.span, $epM9y$babelruntimehelpersesmextends({}, itemIndicatorProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(indicatorContext.checked)\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$a2593e23056970a3, {\n  displayName: $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$SEPARATOR_NAME = 'MenuSeparator';\nvar $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    separatorProps = _objectWithoutProperties(props, _excluded12);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"separator\",\n    \"aria-orientation\": \"horizontal\"\n  }, separatorProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$1cec7dcdd713e220, {\n  displayName: $6cc32821e9371a1c$var$SEPARATOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$ARROW_NAME = 'MenuArrow';\nvar $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var __scopeMenu = props.__scopeMenu,\n    arrowProps = _objectWithoutProperties(props, _excluded13);\n  var popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Arrow, $epM9y$babelruntimehelpersesmextends({}, popperScope, arrowProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$bcdda4773debf5fa, {\n  displayName: $6cc32821e9371a1c$var$ARROW_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$SUB_NAME = 'MenuSub';\nvar _$6cc32821e9371a1c$va13 = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME),\n  _$6cc32821e9371a1c$va14 = _slicedToArray(_$6cc32821e9371a1c$va13, 2),\n  $6cc32821e9371a1c$var$MenuSubProvider = _$6cc32821e9371a1c$va14[0],\n  $6cc32821e9371a1c$var$useMenuSubContext = _$6cc32821e9371a1c$va14[1];\nvar $6cc32821e9371a1c$export$71bdb9d1e2909932 = function $6cc32821e9371a1c$export$71bdb9d1e2909932(props) {\n  var __scopeMenu = props.__scopeMenu,\n    children = props.children,\n    _props$open2 = props.open,\n    open = _props$open2 === void 0 ? false : _props$open2,\n    onOpenChange = props.onOpenChange;\n  var parentMenuContext = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_NAME, __scopeMenu);\n  var popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  var _$epM9y$useState9 = $epM9y$useState(null),\n    _$epM9y$useState10 = _slicedToArray(_$epM9y$useState9, 2),\n    trigger = _$epM9y$useState10[0],\n    setTrigger = _$epM9y$useState10[1];\n  var _$epM9y$useState11 = $epM9y$useState(null),\n    _$epM9y$useState12 = _slicedToArray(_$epM9y$useState11, 2),\n    content = _$epM9y$useState12[0],\n    setContent = _$epM9y$useState12[1];\n  var handleOpenChange = $epM9y$useCallbackRef(onOpenChange); // Prevent the parent menu from reopening with open submenus.\n  $epM9y$useEffect(function () {\n    if (parentMenuContext.open === false) handleOpenChange(false);\n    return function () {\n      return handleOpenChange(false);\n    };\n  }, [parentMenuContext.open, handleOpenChange]);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Root, popperScope, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuProvider, {\n    scope: __scopeMenu,\n    open: open,\n    onOpenChange: handleOpenChange,\n    content: content,\n    onContentChange: setContent\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuSubProvider, {\n    scope: __scopeMenu,\n    contentId: $epM9y$useId(),\n    triggerId: $epM9y$useId(),\n    trigger: trigger,\n    onTriggerChange: setTrigger\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$71bdb9d1e2909932, {\n  displayName: $6cc32821e9371a1c$var$SUB_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$SUB_TRIGGER_NAME = 'MenuSubTrigger';\nvar $6cc32821e9371a1c$export$5fbbb3ba7297405f = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  var rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  var subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  var contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  var openTimerRef = $epM9y$useRef(null);\n  var pointerGraceTimerRef = contentContext.pointerGraceTimerRef,\n    onPointerGraceIntentChange = contentContext.onPointerGraceIntentChange;\n  var scope = {\n    __scopeMenu: props.__scopeMenu\n  };\n  var clearOpenTimer = $epM9y$useCallback(function () {\n    if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n    openTimerRef.current = null;\n  }, []);\n  $epM9y$useEffect(function () {\n    return clearOpenTimer;\n  }, [clearOpenTimer]);\n  $epM9y$useEffect(function () {\n    var pointerGraceTimer = pointerGraceTimerRef.current;\n    return function () {\n      window.clearTimeout(pointerGraceTimer);\n      onPointerGraceIntentChange(null);\n    };\n  }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$9fa5ebd18bee4d43, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, scope), /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuItemImpl, $epM9y$babelruntimehelpersesmextends({\n    id: subContext.triggerId,\n    \"aria-haspopup\": \"menu\",\n    \"aria-expanded\": context.open,\n    \"aria-controls\": subContext.contentId,\n    \"data-state\": $6cc32821e9371a1c$var$getOpenState(context.open)\n  }, props, {\n    ref: $epM9y$composeRefs(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from\n    ,\n\n    onClick: function onClick(event) {\n      var _props$onClick;\n      (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event);\n      if (props.disabled || event.defaultPrevented) return;\n      /**\n      * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n      * and we rely heavily on `onFocusOutside` for submenus to close when switching\n      * between separate submenus.\n      */\n      event.currentTarget.focus();\n      if (!context.open) context.onOpenChange(true);\n    },\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(function (event) {\n      contentContext.onItemEnter(event);\n      if (event.defaultPrevented) return;\n      if (!props.disabled && !context.open && !openTimerRef.current) {\n        contentContext.onPointerGraceIntentChange(null);\n        openTimerRef.current = window.setTimeout(function () {\n          context.onOpenChange(true);\n          clearOpenTimer();\n        }, 100);\n      }\n    })),\n    onPointerLeave: $epM9y$composeEventHandlers(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse(function (event) {\n      var _context$content;\n      clearOpenTimer();\n      var contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect();\n      if (contentRect) {\n        var _context$content2;\n        // TODO: make sure to update this when we change positioning logic\n        var side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side;\n        var rightSide = side === 'right';\n        var bleed = rightSide ? -5 : 5;\n        var contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n        var contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n        contentContext.onPointerGraceIntentChange({\n          area: [\n          // consistently within polygon bounds\n          {\n            x: event.clientX + bleed,\n            y: event.clientY\n          }, {\n            x: contentNearEdge,\n            y: contentRect.top\n          }, {\n            x: contentFarEdge,\n            y: contentRect.top\n          }, {\n            x: contentFarEdge,\n            y: contentRect.bottom\n          }, {\n            x: contentNearEdge,\n            y: contentRect.bottom\n          }],\n          side: side\n        });\n        window.clearTimeout(pointerGraceTimerRef.current);\n        pointerGraceTimerRef.current = window.setTimeout(function () {\n          return contentContext.onPointerGraceIntentChange(null);\n        }, 300);\n      } else {\n        contentContext.onTriggerLeave(event);\n        if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened.\n        contentContext.onPointerGraceIntentChange(null);\n      }\n    })),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, function (event) {\n      var isTypingAhead = contentContext.searchRef.current !== '';\n      if (props.disabled || isTypingAhead && event.key === ' ') return;\n      if ($6cc32821e9371a1c$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n        var _context$content3;\n        context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction\n        // so we ensure content is given focus again when switching to keyboard.\n        (_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling\n        event.preventDefault();\n      }\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$5fbbb3ba7297405f, {\n  displayName: $6cc32821e9371a1c$var$SUB_TRIGGER_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\nvar $6cc32821e9371a1c$var$SUB_CONTENT_NAME = 'MenuSubContent';\nvar $6cc32821e9371a1c$export$e7142ab31822bde6 = /*#__PURE__*/$epM9y$forwardRef(function (props, forwardedRef) {\n  var portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var _props$forceMount2 = props.forceMount,\n    forceMount = _props$forceMount2 === void 0 ? portalContext.forceMount : _props$forceMount2,\n    subContentProps = _objectWithoutProperties(props, _excluded14);\n  var context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  var subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_CONTENT_NAME, props.__scopeMenu);\n  var ref = $epM9y$useRef(null);\n  var composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Provider, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Slot, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({\n    id: subContext.contentId,\n    \"aria-labelledby\": subContext.triggerId\n  }, subContentProps, {\n    ref: composedRefs,\n    align: \"start\",\n    side: rootContext.dir === 'rtl' ? 'left' : 'right',\n    disableOutsidePointerEvents: false,\n    disableOutsideScroll: false,\n    trapFocus: false,\n    onOpenAutoFocus: function onOpenAutoFocus(event) {\n      var _ref$current;\n      // when opening a submenu, focus content for keyboard users only\n      if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();\n      event.preventDefault();\n    } // The menu might close because of focusing another menu item in the parent menu. We\n    ,\n\n    onCloseAutoFocus: function onCloseAutoFocus(event) {\n      return event.preventDefault();\n    },\n    onFocusOutside: $epM9y$composeEventHandlers(props.onFocusOutside, function (event) {\n      // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n      // on pointer interaction.\n      if (event.target !== subContext.trigger) context.onOpenChange(false);\n    }),\n    onEscapeKeyDown: $epM9y$composeEventHandlers(props.onEscapeKeyDown, function (event) {\n      rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode\n      event.preventDefault();\n    }),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, function (event) {\n      // Submenu key events bubble through portals. We only care about keys in this menu.\n      var isKeyDownInside = event.currentTarget.contains(event.target);\n      var isCloseKey = $6cc32821e9371a1c$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n      if (isKeyDownInside && isCloseKey) {\n        var _subContext$trigger;\n        context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus`\n        (_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling\n        event.preventDefault();\n      }\n    })\n  })))));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$e7142ab31822bde6, {\n  displayName: $6cc32821e9371a1c$var$SUB_CONTENT_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/\nfunction $6cc32821e9371a1c$var$getOpenState(open) {\n  return open ? 'open' : 'closed';\n}\nfunction $6cc32821e9371a1c$var$isIndeterminate(checked) {\n  return checked === 'indeterminate';\n}\nfunction $6cc32821e9371a1c$var$getCheckedState(checked) {\n  return $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\nfunction $6cc32821e9371a1c$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 $6cc32821e9371a1c$var$wrapArray(array, startIndex) {\n  return array.map(function (_, index) {\n    return array[(startIndex + index) % array.length];\n  });\n}\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch) {\n  var isRepeated = search.length > 1 && Array.from(search).every(function (char) {\n    return char === search[0];\n  });\n  var normalizedSearch = isRepeated ? search[0] : search;\n  var currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n  var wrappedValues = $6cc32821e9371a1c$var$wrapArray(values, Math.max(currentMatchIndex, 0));\n  var excludeCurrentMatch = normalizedSearch.length === 1;\n  if (excludeCurrentMatch) wrappedValues = wrappedValues.filter(function (v) {\n    return v !== currentMatch;\n  });\n  var nextMatch = wrappedValues.find(function (value) {\n    return value.toLowerCase().startsWith(normalizedSearch.toLowerCase());\n  });\n  return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction $6cc32821e9371a1c$var$isPointInPolygon(point, polygon) {\n  var x = point.x,\n    y = point.y;\n  var inside = false;\n  for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n    var xi = polygon[i].x;\n    var yi = polygon[i].y;\n    var xj = polygon[j].x;\n    var yj = polygon[j].y; // prettier-ignore\n    var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n    if (intersect) inside = !inside;\n  }\n  return inside;\n}\nfunction $6cc32821e9371a1c$var$isPointerInGraceArea(event, area) {\n  if (!area) return false;\n  var cursorPos = {\n    x: event.clientX,\n    y: event.clientY\n  };\n  return $6cc32821e9371a1c$var$isPointInPolygon(cursorPos, area);\n}\nfunction $6cc32821e9371a1c$var$whenMouse(handler) {\n  return function (event) {\n    return event.pointerType === 'mouse' ? handler(event) : undefined;\n  };\n}\nvar $6cc32821e9371a1c$export$be92b6f5f03c0fe9 = $6cc32821e9371a1c$export$d9b273488cd8ce6f;\nvar $6cc32821e9371a1c$export$b688253958b8dfe7 = $6cc32821e9371a1c$export$9fa5ebd18bee4d43;\nvar $6cc32821e9371a1c$export$602eac185826482c = $6cc32821e9371a1c$export$793392f970497feb;\nvar $6cc32821e9371a1c$export$7c6e2c02157bb7d2 = $6cc32821e9371a1c$export$479f0f2f71193efe;\nvar $6cc32821e9371a1c$export$eb2fcfdbd7ba97d4 = $6cc32821e9371a1c$export$22a631d1f72787bb;\nvar $6cc32821e9371a1c$export$b04be29aa201d4f5 = $6cc32821e9371a1c$export$dd37bec0e8a99143;\nvar $6cc32821e9371a1c$export$6d08773d2e66f8f2 = $6cc32821e9371a1c$export$2ce376c2cc3355c8;\nvar $6cc32821e9371a1c$export$16ce288f89fa631c = $6cc32821e9371a1c$export$f6f243521332502d;\nvar $6cc32821e9371a1c$export$a98f0dcb43a68a25 = $6cc32821e9371a1c$export$ea2200c9eee416b3;\nvar $6cc32821e9371a1c$export$371ab307eab489c0 = $6cc32821e9371a1c$export$69bd225e9817f6d0;\nvar $6cc32821e9371a1c$export$c3468e2714d175fa = $6cc32821e9371a1c$export$a2593e23056970a3;\nvar $6cc32821e9371a1c$export$1ff3c3f08ae963c0 = $6cc32821e9371a1c$export$1cec7dcdd713e220;\nvar $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda4773debf5fa;\nvar $6cc32821e9371a1c$export$d7a01e11500dfb6f = $6cc32821e9371a1c$export$71bdb9d1e2909932;\nvar $6cc32821e9371a1c$export$2ea8a7a591ac5eac = $6cc32821e9371a1c$export$5fbbb3ba7297405f;\nvar $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142ab31822bde6;\nexport { $6cc32821e9371a1c$export$4027731b685e72eb as createMenuScope, $6cc32821e9371a1c$export$d9b273488cd8ce6f as Menu, $6cc32821e9371a1c$export$9fa5ebd18bee4d43 as MenuAnchor, $6cc32821e9371a1c$export$793392f970497feb as MenuPortal, $6cc32821e9371a1c$export$479f0f2f71193efe as MenuContent, $6cc32821e9371a1c$export$22a631d1f72787bb as MenuGroup, $6cc32821e9371a1c$export$dd37bec0e8a99143 as MenuLabel, $6cc32821e9371a1c$export$2ce376c2cc3355c8 as MenuItem, $6cc32821e9371a1c$export$f6f243521332502d as MenuCheckboxItem, $6cc32821e9371a1c$export$ea2200c9eee416b3 as MenuRadioGroup, $6cc32821e9371a1c$export$69bd225e9817f6d0 as MenuRadioItem, $6cc32821e9371a1c$export$a2593e23056970a3 as MenuItemIndicator, $6cc32821e9371a1c$export$1cec7dcdd713e220 as MenuSeparator, $6cc32821e9371a1c$export$bcdda4773debf5fa as MenuArrow, $6cc32821e9371a1c$export$71bdb9d1e2909932 as MenuSub, $6cc32821e9371a1c$export$5fbbb3ba7297405f as MenuSubTrigger, $6cc32821e9371a1c$export$e7142ab31822bde6 as MenuSubContent, $6cc32821e9371a1c$export$be92b6f5f03c0fe9 as Root, $6cc32821e9371a1c$export$b688253958b8dfe7 as Anchor, $6cc32821e9371a1c$export$602eac185826482c as Portal, $6cc32821e9371a1c$export$7c6e2c02157bb7d2 as Content, $6cc32821e9371a1c$export$eb2fcfdbd7ba97d4 as Group, $6cc32821e9371a1c$export$b04be29aa201d4f5 as Label, $6cc32821e9371a1c$export$6d08773d2e66f8f2 as Item, $6cc32821e9371a1c$export$16ce288f89fa631c as CheckboxItem, $6cc32821e9371a1c$export$a98f0dcb43a68a25 as RadioGroup, $6cc32821e9371a1c$export$371ab307eab489c0 as RadioItem, $6cc32821e9371a1c$export$c3468e2714d175fa as ItemIndicator, $6cc32821e9371a1c$export$1ff3c3f08ae963c0 as Separator, $6cc32821e9371a1c$export$21b07c8f274aebd5 as Arrow, $6cc32821e9371a1c$export$d7a01e11500dfb6f as Sub, $6cc32821e9371a1c$export$2ea8a7a591ac5eac as SubTrigger, $6cc32821e9371a1c$export$6d4de93b380beddf as SubContent };","map":{"version":3,"names":["$6cc32821e9371a1c$var$SELECTION_KEYS","$6cc32821e9371a1c$var$FIRST_KEYS","$6cc32821e9371a1c$var$LAST_KEYS","$6cc32821e9371a1c$var$FIRST_LAST_KEYS","concat","$6cc32821e9371a1c$var$SUB_OPEN_KEYS","ltr","rtl","$6cc32821e9371a1c$var$SUB_CLOSE_KEYS","$6cc32821e9371a1c$var$MENU_NAME","_$epM9y$createCollect","$epM9y$createCollection","_$epM9y$createCollect2","_slicedToArray","$6cc32821e9371a1c$var$Collection","$6cc32821e9371a1c$var$useCollection","$6cc32821e9371a1c$var$createCollectionScope","_$epM9y$createContext","$epM9y$createContextScope","$epM9y$createPopperScope","$epM9y$createRovingFocusGroupScope","_$epM9y$createContext2","$6cc32821e9371a1c$var$createMenuContext","$6cc32821e9371a1c$export$4027731b685e72eb","$6cc32821e9371a1c$var$usePopperScope","$6cc32821e9371a1c$var$useRovingFocusGroupScope","_$6cc32821e9371a1c$va","_$6cc32821e9371a1c$va2","$6cc32821e9371a1c$var$MenuProvider","$6cc32821e9371a1c$var$useMenuContext","_$6cc32821e9371a1c$va3","_$6cc32821e9371a1c$va4","$6cc32821e9371a1c$var$MenuRootProvider","$6cc32821e9371a1c$var$useMenuRootContext","$6cc32821e9371a1c$export$d9b273488cd8ce6f","Menu","props","__scopeMenu","open","_props$open","children","dir","onOpenChange","modal","_props$modal","popperScope","_$epM9y$useState","$epM9y$useState","_$epM9y$useState2","content","setContent","isUsingKeyboardRef","$epM9y$useRef","handleOpenChange","$epM9y$useCallbackRef","direction","$epM9y$useDirection","$epM9y$useEffect","handleKeyDown","current","document","addEventListener","handlePointer","capture","once","removeEventListener","$epM9y$createElement","$epM9y$Root","scope","onContentChange","onClose","$epM9y$useCallback","Object","assign","displayName","$6cc32821e9371a1c$var$ANCHOR_NAME","$6cc32821e9371a1c$export$9fa5ebd18bee4d43","$epM9y$forwardRef","forwardedRef","anchorProps","_objectWithoutProperties","_excluded","$epM9y$Anchor","$epM9y$babelruntimehelpersesmextends","ref","$6cc32821e9371a1c$var$PORTAL_NAME","_$6cc32821e9371a1c$va5","forceMount","undefined","_$6cc32821e9371a1c$va6","$6cc32821e9371a1c$var$PortalProvider","$6cc32821e9371a1c$var$usePortalContext","$6cc32821e9371a1c$export$793392f970497feb","MenuPortal","container","context","$epM9y$Presence","present","$epM9y$Portal","asChild","$6cc32821e9371a1c$var$CONTENT_NAME","_$6cc32821e9371a1c$va7","_$6cc32821e9371a1c$va8","$6cc32821e9371a1c$var$MenuContentProvider","$6cc32821e9371a1c$var$useMenuContentContext","$6cc32821e9371a1c$export$479f0f2f71193efe","portalContext","_props$forceMount","contentProps","_excluded2","rootContext","Provider","Slot","$6cc32821e9371a1c$var$MenuRootContentModal","$6cc32821e9371a1c$var$MenuRootContentNonModal","composedRefs","$epM9y$useComposedRefs","$epM9y$hideOthers","$6cc32821e9371a1c$var$MenuContentImpl","trapFocus","disableOutsidePointerEvents","disableOutsideScroll","onFocusOutside","$epM9y$composeEventHandlers","event","preventDefault","checkForDefaultPrevented","onDismiss","loop","_props$loop","onOpenAutoFocus","onCloseAutoFocus","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside","_excluded3","rovingFocusGroupScope","getItems","_$epM9y$useState3","_$epM9y$useState4","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","$epM9y$RemoveScroll","$epM9y$Fragment","scrollLockWrapperProps","as","$epM9y$Slot","allowPinchZoom","handleTypeaheadSearch","key","_items$find","_items$find2","search","items","filter","item","disabled","currentItem","activeElement","currentMatch","find","textValue","values","map","nextMatch","$6cc32821e9371a1c$var$getNextMatch","newItem","updateSearch","value","window","clearTimeout","setTimeout","focus","$epM9y$useFocusGuards","isPointerMovingToSubmenu","_pointerGraceIntentRe","_pointerGraceIntentRe2","isMovingTowards","side","$6cc32821e9371a1c$var$isPointerInGraceArea","area","onItemEnter","onItemLeave","_contentRef$current","onTriggerLeave","onPointerGraceIntentChange","intent","$epM9y$FocusScope","trapped","onMountAutoFocus","_contentRef$current2","onUnmountAutoFocus","$epM9y$DismissableLayer","$epM9y$Root1","orientation","currentTabStopId","onCurrentTabStopIdChange","$epM9y$Content","role","$6cc32821e9371a1c$var$getOpenState","style","_objectSpread","outline","onKeyDown","target","isKeyDownInside","closest","currentTarget","isModifierKey","ctrlKey","altKey","metaKey","isCharacterKey","length","includes","candidateNodes","reverse","$6cc32821e9371a1c$var$focusFirst","onBlur","contains","onPointerMove","$6cc32821e9371a1c$var$whenMouse","pointerXHasChanged","clientX","newDir","$6cc32821e9371a1c$var$GROUP_NAME","$6cc32821e9371a1c$export$22a631d1f72787bb","groupProps","_excluded4","$epM9y$Primitive","div","$6cc32821e9371a1c$var$LABEL_NAME","$6cc32821e9371a1c$export$dd37bec0e8a99143","labelProps","_excluded5","$6cc32821e9371a1c$var$ITEM_NAME","$6cc32821e9371a1c$var$ITEM_SELECT","$6cc32821e9371a1c$export$2ce376c2cc3355c8","_props$disabled","onSelect","itemProps","_excluded6","contentContext","isPointerDownRef","handleSelect","menuItem","itemSelectEvent","CustomEvent","bubbles","cancelable","$epM9y$dispatchDiscreteCustomEvent","defaultPrevented","$6cc32821e9371a1c$var$MenuItemImpl","onClick","onPointerDown","_props$onPointerDown","call","onPointerUp","_event$currentTarget","click","isTypingAhead","_props$disabled2","_excluded7","_$epM9y$useState5","_$epM9y$useState6","isFocused","setIsFocused","_$epM9y$useState7","_$epM9y$useState8","textContent","setTextContent","_menuItem$textContent","trim","ItemSlot","$epM9y$Item","focusable","onPointerLeave","onFocus","$6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME","$6cc32821e9371a1c$export$f6f243521332502d","_props$checked","checked","onCheckedChange","checkboxItemProps","_excluded8","$6cc32821e9371a1c$var$ItemIndicatorProvider","$6cc32821e9371a1c$var$isIndeterminate","$6cc32821e9371a1c$var$getCheckedState","$6cc32821e9371a1c$var$RADIO_GROUP_NAME","_$6cc32821e9371a1c$va9","onValueChange","_$6cc32821e9371a1c$va10","$6cc32821e9371a1c$var$RadioGroupProvider","$6cc32821e9371a1c$var$useRadioGroupContext","$6cc32821e9371a1c$export$ea2200c9eee416b3","_excluded9","handleValueChange","$6cc32821e9371a1c$var$RADIO_ITEM_NAME","$6cc32821e9371a1c$export$69bd225e9817f6d0","radioItemProps","_excluded10","_context$onValueChang","$6cc32821e9371a1c$var$ITEM_INDICATOR_NAME","_$6cc32821e9371a1c$va11","_$6cc32821e9371a1c$va12","$6cc32821e9371a1c$var$useItemIndicatorContext","$6cc32821e9371a1c$export$a2593e23056970a3","itemIndicatorProps","_excluded11","indicatorContext","span","$6cc32821e9371a1c$var$SEPARATOR_NAME","$6cc32821e9371a1c$export$1cec7dcdd713e220","separatorProps","_excluded12","$6cc32821e9371a1c$var$ARROW_NAME","$6cc32821e9371a1c$export$bcdda4773debf5fa","arrowProps","_excluded13","$epM9y$Arrow","$6cc32821e9371a1c$var$SUB_NAME","_$6cc32821e9371a1c$va13","_$6cc32821e9371a1c$va14","$6cc32821e9371a1c$var$MenuSubProvider","$6cc32821e9371a1c$var$useMenuSubContext","$6cc32821e9371a1c$export$71bdb9d1e2909932","MenuSub","_props$open2","parentMenuContext","_$epM9y$useState9","_$epM9y$useState10","trigger","setTrigger","_$epM9y$useState11","_$epM9y$useState12","contentId","$epM9y$useId","triggerId","onTriggerChange","$6cc32821e9371a1c$var$SUB_TRIGGER_NAME","$6cc32821e9371a1c$export$5fbbb3ba7297405f","subContext","openTimerRef","clearOpenTimer","pointerGraceTimer","id","$epM9y$composeRefs","_props$onClick","_context$content","contentRect","getBoundingClientRect","_context$content2","dataset","rightSide","bleed","contentNearEdge","contentFarEdge","x","y","clientY","top","bottom","_context$content3","$6cc32821e9371a1c$var$SUB_CONTENT_NAME","$6cc32821e9371a1c$export$e7142ab31822bde6","_props$forceMount2","subContentProps","_excluded14","align","_ref$current","isCloseKey","_subContext$trigger","getOpenState","isIndeterminate","getCheckedState","focusFirst","candidates","PREVIOUSLY_FOCUSED_ELEMENT","_iterator","_createForOfIteratorHelper","_step","s","n","done","candidate","err","e","f","$6cc32821e9371a1c$var$wrapArray","wrapArray","array","startIndex","_","index","getNextMatch","isRepeated","Array","from","every","char","normalizedSearch","currentMatchIndex","indexOf","wrappedValues","Math","max","excludeCurrentMatch","v","toLowerCase","startsWith","$6cc32821e9371a1c$var$isPointInPolygon","isPointInPolygon","point","polygon","inside","i","j","xi","yi","xj","yj","intersect","isPointerInGraceArea","cursorPos","whenMouse","handler","pointerType","$6cc32821e9371a1c$export$be92b6f5f03c0fe9","$6cc32821e9371a1c$export$b688253958b8dfe7","$6cc32821e9371a1c$export$602eac185826482c","$6cc32821e9371a1c$export$7c6e2c02157bb7d2","$6cc32821e9371a1c$export$eb2fcfdbd7ba97d4","$6cc32821e9371a1c$export$b04be29aa201d4f5","$6cc32821e9371a1c$export$6d08773d2e66f8f2","$6cc32821e9371a1c$export$16ce288f89fa631c","$6cc32821e9371a1c$export$a98f0dcb43a68a25","$6cc32821e9371a1c$export$371ab307eab489c0","$6cc32821e9371a1c$export$c3468e2714d175fa","$6cc32821e9371a1c$export$1ff3c3f08ae963c0","$6cc32821e9371a1c$export$21b07c8f274aebd5","$6cc32821e9371a1c$export$d7a01e11500dfb6f","$6cc32821e9371a1c$export$2ea8a7a591ac5eac","$6cc32821e9371a1c$export$6d4de93b380beddf"],"sources":["C:\\Users\\user\\Desktop\\03portreact\\node_modules\\@radix-ui\\react-menu\\dist\\packages\\react\\menu\\src\\index.ts","C:\\Users\\user\\Desktop\\03portreact\\node_modules\\@radix-ui\\react-menu\\dist\\packages\\react\\menu\\src\\Menu.tsx"],"sourcesContent":["export {\n  createMenuScope,\n  //\n  Menu,\n  MenuAnchor,\n  MenuPortal,\n  MenuContent,\n  MenuGroup,\n  MenuLabel,\n  MenuItem,\n  MenuCheckboxItem,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuItemIndicator,\n  MenuSeparator,\n  MenuArrow,\n  MenuSub,\n  MenuSubTrigger,\n  MenuSubContent,\n  //\n  Root,\n  Anchor,\n  Portal,\n  Content,\n  Group,\n  Label,\n  Item,\n  CheckboxItem,\n  RadioGroup,\n  RadioItem,\n  ItemIndicator,\n  Separator,\n  Arrow,\n  Sub,\n  SubTrigger,\n  SubContent,\n} from './Menu';\nexport type {\n  MenuProps,\n  MenuAnchorProps,\n  MenuPortalProps,\n  MenuContentProps,\n  MenuGroupProps,\n  MenuLabelProps,\n  MenuItemProps,\n  MenuCheckboxItemProps,\n  MenuRadioGroupProps,\n  MenuRadioItemProps,\n  MenuItemIndicatorProps,\n  MenuSeparatorProps,\n  MenuArrowProps,\n  MenuSubProps,\n  MenuSubTriggerProps,\n  MenuSubContentProps,\n} from './Menu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs, composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst SELECTION_KEYS = ['Enter', ' '];\nconst FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS: Record<Direction, string[]> = {\n  ltr: [...SELECTION_KEYS, 'ArrowRight'],\n  rtl: [...SELECTION_KEYS, 'ArrowLeft'],\n};\nconst SUB_CLOSE_KEYS: Record<Direction, string[]> = {\n  ltr: ['ArrowLeft'],\n  rtl: ['ArrowRight'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'Menu';\n\ntype ItemData = { disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n  MenuItemElement,\n  ItemData\n>(MENU_NAME);\n\ntype ScopedProps<P> = P & { __scopeMenu?: Scope };\nconst [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n  createCollectionScope,\n  createPopperScope,\n  createRovingFocusGroupScope,\n]);\nconst usePopperScope = createPopperScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenuContextValue = {\n  open: boolean;\n  onOpenChange(open: boolean): void;\n  content: MenuContentElement | null;\n  onContentChange(content: MenuContentElement | null): void;\n};\n\nconst [MenuProvider, useMenuContext] = createMenuContext<MenuContextValue>(MENU_NAME);\n\ntype MenuRootContextValue = {\n  onClose(): void;\n  isUsingKeyboardRef: React.RefObject<boolean>;\n  dir: Direction;\n  modal: boolean;\n};\n\nconst [MenuRootProvider, useMenuRootContext] = createMenuContext<MenuRootContextValue>(MENU_NAME);\n\ninterface MenuProps {\n  children?: React.ReactNode;\n  open?: boolean;\n  onOpenChange?(open: boolean): void;\n  dir?: Direction;\n  modal?: boolean;\n}\n\nconst Menu: React.FC<MenuProps> = (props: ScopedProps<MenuProps>) => {\n  const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n  const popperScope = usePopperScope(__scopeMenu);\n  const [content, setContent] = React.useState<MenuContentElement | null>(null);\n  const isUsingKeyboardRef = React.useRef(false);\n  const handleOpenChange = useCallbackRef(onOpenChange);\n  const direction = useDirection(dir);\n\n  React.useEffect(() => {\n    // Capture phase ensures we set the boolean before any side effects execute\n    // in response to the key or pointer event as they might depend on this value.\n    const handleKeyDown = () => {\n      isUsingKeyboardRef.current = true;\n      document.addEventListener('pointerdown', handlePointer, { capture: true, once: true });\n      document.addEventListener('pointermove', handlePointer, { capture: true, once: true });\n    };\n    const handlePointer = () => (isUsingKeyboardRef.current = false);\n    document.addEventListener('keydown', handleKeyDown, { capture: true });\n    return () => {\n      document.removeEventListener('keydown', handleKeyDown, { capture: true });\n      document.removeEventListener('pointerdown', handlePointer, { capture: true });\n      document.removeEventListener('pointermove', handlePointer, { capture: true });\n    };\n  }, []);\n\n  return (\n    <PopperPrimitive.Root {...popperScope}>\n      <MenuProvider\n        scope={__scopeMenu}\n        open={open}\n        onOpenChange={handleOpenChange}\n        content={content}\n        onContentChange={setContent}\n      >\n        <MenuRootProvider\n          scope={__scopeMenu}\n          onClose={React.useCallback(() => handleOpenChange(false), [handleOpenChange])}\n          isUsingKeyboardRef={isUsingKeyboardRef}\n          dir={direction}\n          modal={modal}\n        >\n          {children}\n        </MenuRootProvider>\n      </MenuProvider>\n    </PopperPrimitive.Root>\n  );\n};\n\nMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'MenuAnchor';\n\ntype MenuAnchorElement = React.ElementRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface MenuAnchorProps extends PopperAnchorProps {}\n\nconst MenuAnchor = React.forwardRef<MenuAnchorElement, MenuAnchorProps>(\n  (props: ScopedProps<MenuAnchorProps>, forwardedRef) => {\n    const { __scopeMenu, ...anchorProps } = props;\n    const popperScope = usePopperScope(__scopeMenu);\n    return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n  }\n);\n\nMenuAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenuPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createMenuContext<PortalContextValue>(PORTAL_NAME, {\n  forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface MenuPortalProps extends Omit<PortalProps, 'asChild'> {\n  children?: React.ReactNode;\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuPortal: React.FC<MenuPortalProps> = (props: ScopedProps<MenuPortalProps>) => {\n  const { __scopeMenu, forceMount, children, container } = props;\n  const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n  return (\n    <PortalProvider scope={__scopeMenu} forceMount={forceMount}>\n      <Presence present={forceMount || context.open}>\n        <PortalPrimitive asChild container={container}>\n          {children}\n        </PortalPrimitive>\n      </Presence>\n    </PortalProvider>\n  );\n};\n\nMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenuContent';\n\ntype MenuContentContextValue = {\n  onItemEnter(event: React.PointerEvent): void;\n  onItemLeave(event: React.PointerEvent): void;\n  onTriggerLeave(event: React.PointerEvent): void;\n  searchRef: React.RefObject<string>;\n  pointerGraceTimerRef: React.MutableRefObject<number>;\n  onPointerGraceIntentChange(intent: GraceIntent | null): void;\n};\nconst [MenuContentProvider, useMenuContentContext] =\n  createMenuContext<MenuContentContextValue>(CONTENT_NAME);\n\ntype MenuContentElement = MenuRootContentTypeElement;\n/**\n * We purposefully don't union MenuRootContent and MenuSubContent props here because\n * they have conflicting prop types. We agreed that we would allow MenuSubContent to\n * accept props that it would just ignore.\n */\ninterface MenuContentProps extends MenuRootContentTypeProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuContent = React.forwardRef<MenuContentElement, MenuContentProps>(\n  (props: ScopedProps<MenuContentProps>, forwardedRef) => {\n    const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n    const { forceMount = portalContext.forceMount, ...contentProps } = props;\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n\n    return (\n      <Collection.Provider scope={props.__scopeMenu}>\n        <Presence present={forceMount || context.open}>\n          <Collection.Slot scope={props.__scopeMenu}>\n            {rootContext.modal ? (\n              <MenuRootContentModal {...contentProps} ref={forwardedRef} />\n            ) : (\n              <MenuRootContentNonModal {...contentProps} ref={forwardedRef} />\n            )}\n          </Collection.Slot>\n        </Presence>\n      </Collection.Provider>\n    );\n  }\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuRootContentTypeElement = MenuContentImplElement;\ninterface MenuRootContentTypeProps\n  extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {}\n\nconst MenuRootContentModal = React.forwardRef<MenuRootContentTypeElement, MenuRootContentTypeProps>(\n  (props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const ref = React.useRef<MenuRootContentTypeElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n\n    // Hide everything from ARIA except the `MenuContent`\n    React.useEffect(() => {\n      const content = ref.current;\n      if (content) return hideOthers(content);\n    }, []);\n\n    return (\n      <MenuContentImpl\n        {...props}\n        ref={composedRefs}\n        // we make sure we're not trapping once it's been closed\n        // (closed !== unmounted when animating out)\n        trapFocus={context.open}\n        // make sure to only disable pointer events when open\n        // this avoids blocking interactions while animating out\n        disableOutsidePointerEvents={context.open}\n        disableOutsideScroll\n        // When focus is trapped, a `focusout` event may still happen.\n        // We make sure we don't trigger our `onDismiss` in such case.\n        onFocusOutside={composeEventHandlers(\n          props.onFocusOutside,\n          (event) => event.preventDefault(),\n          { checkForDefaultPrevented: false }\n        )}\n        onDismiss={() => context.onOpenChange(false)}\n      />\n    );\n  }\n);\n\nconst MenuRootContentNonModal = React.forwardRef<\n  MenuRootContentTypeElement,\n  MenuRootContentTypeProps\n>((props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n  const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n  return (\n    <MenuContentImpl\n      {...props}\n      ref={forwardedRef}\n      trapFocus={false}\n      disableOutsidePointerEvents={false}\n      disableOutsideScroll={false}\n      onDismiss={() => context.onOpenChange(false)}\n    />\n  );\n});\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ntype MenuContentImplPrivateProps = {\n  onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n  onDismiss?: DismissableLayerProps['onDismiss'];\n  disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];\n\n  /**\n   * Whether scrolling outside the `MenuContent` should be prevented\n   * (default: `false`)\n   */\n  disableOutsideScroll?: boolean;\n\n  /**\n   * Whether focus should be trapped within the `MenuContent`\n   * (default: false)\n   */\n  trapFocus?: FocusScopeProps['trapped'];\n};\ninterface MenuContentImplProps\n  extends MenuContentImplPrivateProps,\n    Omit<PopperContentProps, 'dir' | 'onPlaced'> {\n  /**\n   * Event handler called when auto-focusing on close.\n   * Can be prevented.\n   */\n  onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n\n  /**\n   * Whether keyboard navigation should loop around\n   * @defaultValue false\n   */\n  loop?: RovingFocusGroupProps['loop'];\n\n  onEntryFocus?: RovingFocusGroupProps['onEntryFocus'];\n  onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n  onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n  onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n  onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst MenuContentImpl = React.forwardRef<MenuContentImplElement, MenuContentImplProps>(\n  (props: ScopedProps<MenuContentImplProps>, forwardedRef) => {\n    const {\n      __scopeMenu,\n      loop = false,\n      trapFocus,\n      onOpenAutoFocus,\n      onCloseAutoFocus,\n      disableOutsidePointerEvents,\n      onEntryFocus,\n      onEscapeKeyDown,\n      onPointerDownOutside,\n      onFocusOutside,\n      onInteractOutside,\n      onDismiss,\n      disableOutsideScroll,\n      ...contentProps\n    } = props;\n    const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n    const popperScope = usePopperScope(__scopeMenu);\n    const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n    const getItems = useCollection(__scopeMenu);\n    const [currentItemId, setCurrentItemId] = React.useState<string | null>(null);\n    const contentRef = React.useRef<HTMLDivElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n    const timerRef = React.useRef(0);\n    const searchRef = React.useRef('');\n    const pointerGraceTimerRef = React.useRef(0);\n    const pointerGraceIntentRef = React.useRef<GraceIntent | null>(null);\n    const pointerDirRef = React.useRef<Side>('right');\n    const lastPointerXRef = React.useRef(0);\n\n    const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n    const scrollLockWrapperProps = disableOutsideScroll\n      ? { as: Slot, allowPinchZoom: true }\n      : undefined;\n\n    const handleTypeaheadSearch = (key: string) => {\n      const search = searchRef.current + key;\n      const items = getItems().filter((item) => !item.disabled);\n      const currentItem = document.activeElement;\n      const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n      const values = items.map((item) => item.textValue);\n      const nextMatch = getNextMatch(values, search, currentMatch);\n      const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n\n      // Reset `searchRef` 1 second after it was last updated\n      (function updateSearch(value: string) {\n        searchRef.current = value;\n        window.clearTimeout(timerRef.current);\n        if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n      })(search);\n\n      if (newItem) {\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(() => (newItem as HTMLElement).focus());\n      }\n    };\n\n    React.useEffect(() => {\n      return () => window.clearTimeout(timerRef.current);\n    }, []);\n\n    // Make sure the whole tree has focus guards as our `MenuContent` may be\n    // the last element in the DOM (beacuse of the `Portal`)\n    useFocusGuards();\n\n    const isPointerMovingToSubmenu = React.useCallback((event: React.PointerEvent) => {\n      const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n      return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n    }, []);\n\n    return (\n      <MenuContentProvider\n        scope={__scopeMenu}\n        searchRef={searchRef}\n        onItemEnter={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) event.preventDefault();\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        onItemLeave={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) return;\n            contentRef.current?.focus();\n            setCurrentItemId(null);\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        onTriggerLeave={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) event.preventDefault();\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        pointerGraceTimerRef={pointerGraceTimerRef}\n        onPointerGraceIntentChange={React.useCallback((intent) => {\n          pointerGraceIntentRef.current = intent;\n        }, [])}\n      >\n        <ScrollLockWrapper {...scrollLockWrapperProps}>\n          <FocusScope\n            asChild\n            trapped={trapFocus}\n            onMountAutoFocus={composeEventHandlers(onOpenAutoFocus, (event) => {\n              // when opening, explicitly focus the content area only and leave\n              // `onEntryFocus` in  control of focusing first item\n              event.preventDefault();\n              contentRef.current?.focus();\n            })}\n            onUnmountAutoFocus={onCloseAutoFocus}\n          >\n            <DismissableLayer\n              asChild\n              disableOutsidePointerEvents={disableOutsidePointerEvents}\n              onEscapeKeyDown={onEscapeKeyDown}\n              onPointerDownOutside={onPointerDownOutside}\n              onFocusOutside={onFocusOutside}\n              onInteractOutside={onInteractOutside}\n              onDismiss={onDismiss}\n            >\n              <RovingFocusGroup.Root\n                asChild\n                {...rovingFocusGroupScope}\n                dir={rootContext.dir}\n                orientation=\"vertical\"\n                loop={loop}\n                currentTabStopId={currentItemId}\n                onCurrentTabStopIdChange={setCurrentItemId}\n                onEntryFocus={composeEventHandlers(onEntryFocus, (event) => {\n                  // only focus first item when using keyboard\n                  if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n                })}\n              >\n                <PopperPrimitive.Content\n                  role=\"menu\"\n                  aria-orientation=\"vertical\"\n                  data-state={getOpenState(context.open)}\n                  data-radix-menu-content=\"\"\n                  dir={rootContext.dir}\n                  {...popperScope}\n                  {...contentProps}\n                  ref={composedRefs}\n                  style={{ outline: 'none', ...contentProps.style }}\n                  onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n                    // submenu key events bubble through portals. We only care about keys in this menu.\n                    const target = event.target as HTMLElement;\n                    const isKeyDownInside =\n                      target.closest('[data-radix-menu-content]') === event.currentTarget;\n                    const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n                    const isCharacterKey = event.key.length === 1;\n                    if (isKeyDownInside) {\n                      // menus should not be navigated using tab key so we prevent it\n                      if (event.key === 'Tab') event.preventDefault();\n                      if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n                    }\n                    // focus first/last item based on key pressed\n                    const content = contentRef.current;\n                    if (event.target !== content) return;\n                    if (!FIRST_LAST_KEYS.includes(event.key)) return;\n                    event.preventDefault();\n                    const items = getItems().filter((item) => !item.disabled);\n                    const candidateNodes = items.map((item) => item.ref.current!);\n                    if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n                    focusFirst(candidateNodes);\n                  })}\n                  onBlur={composeEventHandlers(props.onBlur, (event) => {\n                    // clear search buffer when leaving the menu\n                    if (!event.currentTarget.contains(event.target)) {\n                      window.clearTimeout(timerRef.current);\n                      searchRef.current = '';\n                    }\n                  })}\n                  onPointerMove={composeEventHandlers(\n                    props.onPointerMove,\n                    whenMouse((event) => {\n                      const target = event.target as HTMLElement;\n                      const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n\n                      // We don't use `event.movementX` for this check because Safari will\n                      // always return `0` on a pointer event.\n                      if (event.currentTarget.contains(target) && pointerXHasChanged) {\n                        const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n                        pointerDirRef.current = newDir;\n                        lastPointerXRef.current = event.clientX;\n                      }\n                    })\n                  )}\n                />\n              </RovingFocusGroup.Root>\n            </DismissableLayer>\n          </FocusScope>\n        </ScrollLockWrapper>\n      </MenuContentProvider>\n    );\n  }\n);\n\nMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenuGroup';\n\ntype MenuGroupElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface MenuGroupProps extends PrimitiveDivProps {}\n\nconst MenuGroup = React.forwardRef<MenuGroupElement, MenuGroupProps>(\n  (props: ScopedProps<MenuGroupProps>, forwardedRef) => {\n    const { __scopeMenu, ...groupProps } = props;\n    return <Primitive.div role=\"group\" {...groupProps} ref={forwardedRef} />;\n  }\n);\n\nMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenuLabel';\n\ntype MenuLabelElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuLabelProps extends PrimitiveDivProps {}\n\nconst MenuLabel = React.forwardRef<MenuLabelElement, MenuLabelProps>(\n  (props: ScopedProps<MenuLabelProps>, forwardedRef) => {\n    const { __scopeMenu, ...labelProps } = props;\n    return <Primitive.div {...labelProps} ref={forwardedRef} />;\n  }\n);\n\nMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenuItem';\nconst ITEM_SELECT = 'menu.itemSelect';\n\ntype MenuItemElement = MenuItemImplElement;\ninterface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {\n  onSelect?: (event: Event) => void;\n}\n\nconst MenuItem = React.forwardRef<MenuItemElement, MenuItemProps>(\n  (props: ScopedProps<MenuItemProps>, forwardedRef) => {\n    const { disabled = false, onSelect, ...itemProps } = props;\n    const ref = React.useRef<HTMLDivElement>(null);\n    const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n    const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    const isPointerDownRef = React.useRef(false);\n\n    const handleSelect = () => {\n      const menuItem = ref.current;\n      if (!disabled && menuItem) {\n        const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n        menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n        dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n        if (itemSelectEvent.defaultPrevented) {\n          isPointerDownRef.current = false;\n        } else {\n          rootContext.onClose();\n        }\n      }\n    };\n\n    return (\n      <MenuItemImpl\n        {...itemProps}\n        ref={composedRefs}\n        disabled={disabled}\n        onClick={composeEventHandlers(props.onClick, handleSelect)}\n        onPointerDown={(event) => {\n          props.onPointerDown?.(event);\n          isPointerDownRef.current = true;\n        }}\n        onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n          // Pointer down can move to a different menu item which should activate it on pointer up.\n          // We dispatch a click for selection to allow composition with click based triggers and to\n          // prevent Firefox from getting stuck in text selection mode when the menu closes.\n          if (!isPointerDownRef.current) event.currentTarget?.click();\n        })}\n        onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n          const isTypingAhead = contentContext.searchRef.current !== '';\n          if (disabled || (isTypingAhead && event.key === ' ')) return;\n          if (SELECTION_KEYS.includes(event.key)) {\n            event.currentTarget.click();\n            /**\n             * We prevent default browser behaviour for selection keys as they should trigger\n             * a selection only:\n             * - prevents space from scrolling the page.\n             * - if keydown causes focus to move, prevents keydown from firing on the new target.\n             */\n            event.preventDefault();\n          }\n        })}\n      />\n    );\n  }\n);\n\nMenuItem.displayName = ITEM_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuItemImplElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuItemImplProps extends PrimitiveDivProps {\n  disabled?: boolean;\n  textValue?: string;\n}\n\nconst MenuItemImpl = React.forwardRef<MenuItemImplElement, MenuItemImplProps>(\n  (props: ScopedProps<MenuItemImplProps>, forwardedRef) => {\n    const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n    const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n    const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n    const ref = React.useRef<HTMLDivElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    const [isFocused, setIsFocused] = React.useState(false);\n\n    // get the item's `.textContent` as default strategy for typeahead `textValue`\n    const [textContent, setTextContent] = React.useState('');\n    React.useEffect(() => {\n      const menuItem = ref.current;\n      if (menuItem) {\n        setTextContent((menuItem.textContent ?? '').trim());\n      }\n    }, [itemProps.children]);\n\n    return (\n      <Collection.ItemSlot\n        scope={__scopeMenu}\n        disabled={disabled}\n        textValue={textValue ?? textContent}\n      >\n        <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} focusable={!disabled}>\n          <Primitive.div\n            role=\"menuitem\"\n            data-highlighted={isFocused ? '' : undefined}\n            aria-disabled={disabled || undefined}\n            data-disabled={disabled ? '' : undefined}\n            {...itemProps}\n            ref={composedRefs}\n            /**\n             * We focus items on `pointerMove` to achieve the following:\n             *\n             * - Mouse over an item (it focuses)\n             * - Leave mouse where it is and use keyboard to focus a different item\n             * - Wiggle mouse without it leaving previously focused item\n             * - Previously focused item should re-focus\n             *\n             * If we used `mouseOver`/`mouseEnter` it would not re-focus when the mouse\n             * wiggles. This is to match native menu implementation.\n             */\n            onPointerMove={composeEventHandlers(\n              props.onPointerMove,\n              whenMouse((event) => {\n                if (disabled) {\n                  contentContext.onItemLeave(event);\n                } else {\n                  contentContext.onItemEnter(event);\n                  if (!event.defaultPrevented) {\n                    const item = event.currentTarget;\n                    item.focus();\n                  }\n                }\n              })\n            )}\n            onPointerLeave={composeEventHandlers(\n              props.onPointerLeave,\n              whenMouse((event) => contentContext.onItemLeave(event))\n            )}\n            onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n            onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n          />\n        </RovingFocusGroup.Item>\n      </Collection.ItemSlot>\n    );\n  }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\n\ntype MenuCheckboxItemElement = MenuItemElement;\n\ntype CheckedState = boolean | 'indeterminate';\n\ninterface MenuCheckboxItemProps extends MenuItemProps {\n  checked?: CheckedState;\n  // `onCheckedChange` can never be called with `\"indeterminate\"` from the inside\n  onCheckedChange?: (checked: boolean) => void;\n}\n\nconst MenuCheckboxItem = React.forwardRef<MenuCheckboxItemElement, MenuCheckboxItemProps>(\n  (props: ScopedProps<MenuCheckboxItemProps>, forwardedRef) => {\n    const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n    return (\n      <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n        <MenuItem\n          role=\"menuitemcheckbox\"\n          aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n          {...checkboxItemProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(checked)}\n          onSelect={composeEventHandlers(\n            checkboxItemProps.onSelect,\n            () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n            { checkForDefaultPrevented: false }\n          )}\n        />\n      </ItemIndicatorProvider>\n    );\n  }\n);\n\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenuRadioGroup';\n\nconst [RadioGroupProvider, useRadioGroupContext] = createMenuContext<MenuRadioGroupProps>(\n  RADIO_GROUP_NAME,\n  { value: undefined, onValueChange: () => {} }\n);\n\ntype MenuRadioGroupElement = React.ElementRef<typeof MenuGroup>;\ninterface MenuRadioGroupProps extends MenuGroupProps {\n  value?: string;\n  onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioGroup = React.forwardRef<MenuRadioGroupElement, MenuRadioGroupProps>(\n  (props: ScopedProps<MenuRadioGroupProps>, forwardedRef) => {\n    const { value, onValueChange, ...groupProps } = props;\n    const handleValueChange = useCallbackRef(onValueChange);\n    return (\n      <RadioGroupProvider scope={props.__scopeMenu} value={value} onValueChange={handleValueChange}>\n        <MenuGroup {...groupProps} ref={forwardedRef} />\n      </RadioGroupProvider>\n    );\n  }\n);\n\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenuRadioItem';\n\ntype MenuRadioItemElement = React.ElementRef<typeof MenuItem>;\ninterface MenuRadioItemProps extends MenuItemProps {\n  value: string;\n}\n\nconst MenuRadioItem = React.forwardRef<MenuRadioItemElement, MenuRadioItemProps>(\n  (props: ScopedProps<MenuRadioItemProps>, forwardedRef) => {\n    const { value, ...radioItemProps } = props;\n    const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n    const checked = value === context.value;\n    return (\n      <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n        <MenuItem\n          role=\"menuitemradio\"\n          aria-checked={checked}\n          {...radioItemProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(checked)}\n          onSelect={composeEventHandlers(\n            radioItemProps.onSelect,\n            () => context.onValueChange?.(value),\n            { checkForDefaultPrevented: false }\n          )}\n        />\n      </ItemIndicatorProvider>\n    );\n  }\n);\n\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'MenuItemIndicator';\n\ntype CheckboxContextValue = { checked: CheckedState };\n\nconst [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext<CheckboxContextValue>(\n  ITEM_INDICATOR_NAME,\n  { checked: false }\n);\n\ntype MenuItemIndicatorElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface MenuItemIndicatorProps extends PrimitiveSpanProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuItemIndicator = React.forwardRef<MenuItemIndicatorElement, MenuItemIndicatorProps>(\n  (props: ScopedProps<MenuItemIndicatorProps>, forwardedRef) => {\n    const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n    const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n    return (\n      <Presence\n        present={\n          forceMount ||\n          isIndeterminate(indicatorContext.checked) ||\n          indicatorContext.checked === true\n        }\n      >\n        <Primitive.span\n          {...itemIndicatorProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(indicatorContext.checked)}\n        />\n      </Presence>\n    );\n  }\n);\n\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenuSeparator';\n\ntype MenuSeparatorElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuSeparatorProps extends PrimitiveDivProps {}\n\nconst MenuSeparator = React.forwardRef<MenuSeparatorElement, MenuSeparatorProps>(\n  (props: ScopedProps<MenuSeparatorProps>, forwardedRef) => {\n    const { __scopeMenu, ...separatorProps } = props;\n    return (\n      <Primitive.div\n        role=\"separator\"\n        aria-orientation=\"horizontal\"\n        {...separatorProps}\n        ref={forwardedRef}\n      />\n    );\n  }\n);\n\nMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenuArrow';\n\ntype MenuArrowElement = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface MenuArrowProps extends PopperArrowProps {}\n\nconst MenuArrow = React.forwardRef<MenuArrowElement, MenuArrowProps>(\n  (props: ScopedProps<MenuArrowProps>, forwardedRef) => {\n    const { __scopeMenu, ...arrowProps } = props;\n    const popperScope = usePopperScope(__scopeMenu);\n    return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n  }\n);\n\nMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenuSub';\n\ntype MenuSubContextValue = {\n  contentId: string;\n  triggerId: string;\n  trigger: MenuSubTriggerElement | null;\n  onTriggerChange(trigger: MenuSubTriggerElement | null): void;\n};\n\nconst [MenuSubProvider, useMenuSubContext] = createMenuContext<MenuSubContextValue>(SUB_NAME);\n\ninterface MenuSubProps {\n  children?: React.ReactNode;\n  open?: boolean;\n  onOpenChange?(open: boolean): void;\n}\n\nconst MenuSub: React.FC<MenuSubProps> = (props: ScopedProps<MenuSubProps>) => {\n  const { __scopeMenu, children, open = false, onOpenChange } = props;\n  const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n  const popperScope = usePopperScope(__scopeMenu);\n  const [trigger, setTrigger] = React.useState<MenuSubTriggerElement | null>(null);\n  const [content, setContent] = React.useState<MenuContentElement | null>(null);\n  const handleOpenChange = useCallbackRef(onOpenChange);\n\n  // Prevent the parent menu from reopening with open submenus.\n  React.useEffect(() => {\n    if (parentMenuContext.open === false) handleOpenChange(false);\n    return () => handleOpenChange(false);\n  }, [parentMenuContext.open, handleOpenChange]);\n\n  return (\n    <PopperPrimitive.Root {...popperScope}>\n      <MenuProvider\n        scope={__scopeMenu}\n        open={open}\n        onOpenChange={handleOpenChange}\n        content={content}\n        onContentChange={setContent}\n      >\n        <MenuSubProvider\n          scope={__scopeMenu}\n          contentId={useId()}\n          triggerId={useId()}\n          trigger={trigger}\n          onTriggerChange={setTrigger}\n        >\n          {children}\n        </MenuSubProvider>\n      </MenuProvider>\n    </PopperPrimitive.Root>\n  );\n};\n\nMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenuSubTrigger';\n\ntype MenuSubTriggerElement = MenuItemImplElement;\ninterface MenuSubTriggerProps extends MenuItemImplProps {}\n\nconst MenuSubTrigger = React.forwardRef<MenuSubTriggerElement, MenuSubTriggerProps>(\n  (props: ScopedProps<MenuSubTriggerProps>, forwardedRef) => {\n    const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const openTimerRef = React.useRef<number | null>(null);\n    const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n    const scope = { __scopeMenu: props.__scopeMenu };\n\n    const clearOpenTimer = React.useCallback(() => {\n      if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n      openTimerRef.current = null;\n    }, []);\n\n    React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n\n    React.useEffect(() => {\n      const pointerGraceTimer = pointerGraceTimerRef.current;\n      return () => {\n        window.clearTimeout(pointerGraceTimer);\n        onPointerGraceIntentChange(null);\n      };\n    }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n\n    return (\n      <MenuAnchor asChild {...scope}>\n        <MenuItemImpl\n          id={subContext.triggerId}\n          aria-haspopup=\"menu\"\n          aria-expanded={context.open}\n          aria-controls={subContext.contentId}\n          data-state={getOpenState(context.open)}\n          {...props}\n          ref={composeRefs(forwardedRef, subContext.onTriggerChange)}\n          // This is redundant for mouse users but we cannot determine pointer type from\n          // click event and we cannot use pointerup event (see git history for reasons why)\n          onClick={(event) => {\n            props.onClick?.(event);\n            if (props.disabled || event.defaultPrevented) return;\n            /**\n             * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n             * and we rely heavily on `onFocusOutside` for submenus to close when switching\n             * between separate submenus.\n             */\n            event.currentTarget.focus();\n            if (!context.open) context.onOpenChange(true);\n          }}\n          onPointerMove={composeEventHandlers(\n            props.onPointerMove,\n            whenMouse((event) => {\n              contentContext.onItemEnter(event);\n              if (event.defaultPrevented) return;\n              if (!props.disabled && !context.open && !openTimerRef.current) {\n                contentContext.onPointerGraceIntentChange(null);\n                openTimerRef.current = window.setTimeout(() => {\n                  context.onOpenChange(true);\n                  clearOpenTimer();\n                }, 100);\n              }\n            })\n          )}\n          onPointerLeave={composeEventHandlers(\n            props.onPointerLeave,\n            whenMouse((event) => {\n              clearOpenTimer();\n\n              const contentRect = context.content?.getBoundingClientRect();\n              if (contentRect) {\n                // TODO: make sure to update this when we change positioning logic\n                const side = context.content?.dataset.side as Side;\n                const rightSide = side === 'right';\n                const bleed = rightSide ? -5 : +5;\n                const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n                const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n\n                contentContext.onPointerGraceIntentChange({\n                  area: [\n                    // Apply a bleed on clientX to ensure that our exit point is\n                    // consistently within polygon bounds\n                    { x: event.clientX + bleed, y: event.clientY },\n                    { x: contentNearEdge, y: contentRect.top },\n                    { x: contentFarEdge, y: contentRect.top },\n                    { x: contentFarEdge, y: contentRect.bottom },\n                    { x: contentNearEdge, y: contentRect.bottom },\n                  ],\n                  side,\n                });\n\n                window.clearTimeout(pointerGraceTimerRef.current);\n                pointerGraceTimerRef.current = window.setTimeout(\n                  () => contentContext.onPointerGraceIntentChange(null),\n                  300\n                );\n              } else {\n                contentContext.onTriggerLeave(event);\n                if (event.defaultPrevented) return;\n\n                // There's 100ms where the user may leave an item before the submenu was opened.\n                contentContext.onPointerGraceIntentChange(null);\n              }\n            })\n          )}\n          onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n            const isTypingAhead = contentContext.searchRef.current !== '';\n            if (props.disabled || (isTypingAhead && event.key === ' ')) return;\n            if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n              context.onOpenChange(true);\n              // The trigger may hold focus if opened via pointer interaction\n              // so we ensure content is given focus again when switching to keyboard.\n              context.content?.focus();\n              // prevent window from scrolling\n              event.preventDefault();\n            }\n          })}\n        />\n      </MenuAnchor>\n    );\n  }\n);\n\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenuSubContent';\n\ntype MenuSubContentElement = MenuContentImplElement;\ninterface MenuSubContentProps\n  extends Omit<\n    MenuContentImplProps,\n    keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'\n  > {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuSubContent = React.forwardRef<MenuSubContentElement, MenuSubContentProps>(\n  (props: ScopedProps<MenuSubContentProps>, forwardedRef) => {\n    const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n    const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n    const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n    const ref = React.useRef<MenuSubContentElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    return (\n      <Collection.Provider scope={props.__scopeMenu}>\n        <Presence present={forceMount || context.open}>\n          <Collection.Slot scope={props.__scopeMenu}>\n            <MenuContentImpl\n              id={subContext.contentId}\n              aria-labelledby={subContext.triggerId}\n              {...subContentProps}\n              ref={composedRefs}\n              align=\"start\"\n              side={rootContext.dir === 'rtl' ? 'left' : 'right'}\n              disableOutsidePointerEvents={false}\n              disableOutsideScroll={false}\n              trapFocus={false}\n              onOpenAutoFocus={(event) => {\n                // when opening a submenu, focus content for keyboard users only\n                if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n                event.preventDefault();\n              }}\n              // The menu might close because of focusing another menu item in the parent menu. We\n              // don't want it to refocus the trigger in that case so we handle trigger focus ourselves.\n              onCloseAutoFocus={(event) => event.preventDefault()}\n              onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n                // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n                // on pointer interaction.\n                if (event.target !== subContext.trigger) context.onOpenChange(false);\n              })}\n              onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (event) => {\n                rootContext.onClose();\n                // ensure pressing escape in submenu doesn't escape full screen mode\n                event.preventDefault();\n              })}\n              onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n                // Submenu key events bubble through portals. We only care about keys in this menu.\n                const isKeyDownInside = event.currentTarget.contains(event.target as HTMLElement);\n                const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n                if (isKeyDownInside && isCloseKey) {\n                  context.onOpenChange(false);\n                  // We focus manually because we prevented it in `onCloseAutoFocus`\n                  subContext.trigger?.focus();\n                  // prevent window from scrolling\n                  event.preventDefault();\n                }\n              })}\n            />\n          </Collection.Slot>\n        </Presence>\n      </Collection.Provider>\n    );\n  }\n);\n\nMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getOpenState(open: boolean) {\n  return open ? 'open' : 'closed';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n  return checked === 'indeterminate';\n}\n\nfunction getCheckedState(checked: CheckedState) {\n  return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\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\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction getNextMatch(values: string[], search: string, currentMatch?: string) {\n  const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n  const normalizedSearch = isRepeated ? search[0] : search;\n  const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n  let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n  const excludeCurrentMatch = normalizedSearch.length === 1;\n  if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n  const nextMatch = wrappedValues.find((value) =>\n    value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n  );\n  return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\ntype Side = 'left' | 'right';\ntype GraceIntent = { area: Polygon; side: Side };\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n  const { x, y } = point;\n  let inside = false;\n  for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n    const xi = polygon[i].x;\n    const yi = polygon[i].y;\n    const xj = polygon[j].x;\n    const yj = polygon[j].y;\n\n    // prettier-ignore\n    const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n    if (intersect) inside = !inside;\n  }\n\n  return inside;\n}\n\nfunction isPointerInGraceArea(event: React.PointerEvent, area?: Polygon) {\n  if (!area) return false;\n  const cursorPos = { x: event.clientX, y: event.clientY };\n  return isPointInPolygon(cursorPos, area);\n}\n\nfunction whenMouse<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n  return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = Menu;\nconst Anchor = MenuAnchor;\nconst Portal = MenuPortal;\nconst Content = MenuContent;\nconst Group = MenuGroup;\nconst Label = MenuLabel;\nconst Item = MenuItem;\nconst CheckboxItem = MenuCheckboxItem;\nconst RadioGroup = MenuRadioGroup;\nconst RadioItem = MenuRadioItem;\nconst ItemIndicator = MenuItemIndicator;\nconst Separator = MenuSeparator;\nconst Arrow = MenuArrow;\nconst Sub = MenuSub;\nconst SubTrigger = MenuSubTrigger;\nconst SubContent = MenuSubContent;\n\nexport {\n  createMenuScope,\n  //\n  Menu,\n  MenuAnchor,\n  MenuPortal,\n  MenuContent,\n  MenuGroup,\n  MenuLabel,\n  MenuItem,\n  MenuCheckboxItem,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuItemIndicator,\n  MenuSeparator,\n  MenuArrow,\n  MenuSub,\n  MenuSubTrigger,\n  MenuSubContent,\n  //\n  Root,\n  Anchor,\n  Portal,\n  Content,\n  Group,\n  Label,\n  Item,\n  CheckboxItem,\n  RadioGroup,\n  RadioItem,\n  ItemIndicator,\n  Separator,\n  Arrow,\n  Sub,\n  SubTrigger,\n  SubContent,\n};\nexport type {\n  MenuProps,\n  MenuAnchorProps,\n  MenuPortalProps,\n  MenuContentProps,\n  MenuGroupProps,\n  MenuLabelProps,\n  MenuItemProps,\n  MenuCheckboxItemProps,\n  MenuRadioGroupProps,\n  MenuRadioItemProps,\n  MenuItemIndicatorProps,\n  MenuSeparatorProps,\n  MenuArrowProps,\n  MenuSubProps,\n  MenuSubTriggerProps,\n  MenuSubContentProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC2BA,IAAMA,oCAAc,GAAG,CAAC,OAAD,EAAU,GAAV,CAAvB;AACA,IAAMC,gCAAU,GAAG,CAAC,WAAD,EAAc,QAAd,EAAwB,MAAxB,CAAnB;AACA,IAAMC,+BAAS,GAAG,CAAC,SAAD,EAAY,UAAZ,EAAwB,KAAxB,CAAlB;AACA,IAAMC,qCAAe,MAAAC,MAAA,CAAOH,gCAAJ,EAAmBC,+BAAnB,CAAxB;AACA,IAAMG,mCAA0C,GAAG;EACjDC,GAAG,KAAAF,MAAA,CAAMJ,oCAAJ,GAAoB,YAApB,EAD4C;EAEjDO,GAAG,KAAAH,MAAA,CAAMJ,oCAAJ,GAAoB,WAApB;CAFP;AAIA,IAAMQ,oCAA2C,GAAG;EAClDF,GAAG,EAAE,CAAC,WAAD,CAD6C;EAElDC,GAAG,EAAE,CAAC,YAAD;CAFP;AAKA;;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