"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6621],{4451:function(e,n,t){t.r(n),t.d(n,{default:function(){return d}});var r=t(4194),o=t(5494);let useDropdownItem=({ref:e,onClick:n,dismissOnClick:t=!0})=>{let{dropdownItemsRef:u,selectedDropdownItemIndexRef:d,close:s}=(0,o.x)(),[c,l]=(0,r.useState)(0),i=(0,r.useRef)(),onFocusItem=()=>{d.current=c,u?.current[d.current]?.focus()};return(0,r.useImperativeHandle)(e,()=>i.current,[]),{ref:e=>{e&&!u?.current.includes(e)&&(u?.current.push(e),l(u?.current.findIndex(n=>n===e)??0)),i.current=e},onFocus:onFocusItem,onMouseEnter:onFocusItem,onClick:e=>{n?.(e),t&&s?.()},role:"menuitem",tabIndex:-1,"data-index":c}},u=(0,r.forwardRef)(function({children:e,asChild:n,icon:t,onClick:o,dismissOnClick:u=!0,testId:d="fs-dropdown-item",...s},c){let l=useDropdownItem({ref:c,onClick:o,dismissOnClick:u}),i=r.isValidElement(e)?(0,r.cloneElement)(e,{...l,...e.props}):e;return r.createElement(r.Fragment,null,n?i:r.createElement("button",{"data-fs-dropdown-item":!0,"data-testid":d,...l,...s},!!t&&t,e))});var d=u},9642:function(e,n,t){var r=t(4194);let o=(0,r.createContext)({isOpen:!1,dropdownTriggerRef:null,selectedDropdownItemIndexRef:null,dropdownItemsRef:null,id:"fs-dropdown"});n.Z=o},5494:function(e,n,t){t.d(n,{x:function(){return useDropdown}});var r=t(4194),o=t(9642);let useDropdown=()=>{let e=(0,r.useContext)(o.Z);if(void 0===e)throw Error("Do not use useDropdown hook outside the Dropdown context.");return e}}}]);