"use strict";exports.id=4219,exports.ids=[4219,4983,1697,6621],exports.modules={15741:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Dropdown_DropdownMenu});var n=r(16689),o=r.n(n),d=r(66405),s=r(55494);let useDropdownPosition=(e="left")=>{let{dropdownTriggerRef:t,isOpen:r}=(0,s.x)(),[o,d]=(0,n.useState)({top:0,left:0,right:"auto",transform:"none",loading:!0});return(0,n.useEffect)(()=>{let updateMenuPosition=()=>{let r="undefined"!=typeof window;if(!t?.current)return;let n=t.current.getBoundingClientRect(),o=n?.top??0,s=n?.height??0,u=n?.left??0,a=n?.width??0,l=r?document?.documentElement?.scrollTop:0,i=r?document?.documentElement?.scrollLeft:0,c=u+i,p="auto",w="none";"right"===e?(p=`${document.documentElement.clientWidth-u-a}px`,c="auto"):"center"===e&&(c=u+a/2+i,w="translateX(-50%)"),d({top:o+s+l,left:c,right:p,transform:w,loading:!1})};return r&&(updateMenuPosition(),window.addEventListener("resize",updateMenuPosition)),()=>{window.removeEventListener("resize",updateMenuPosition)}},[t,r,e]),{...o,position:"absolute"}},Dropdown_DropdownMenu=({children:e,testId:t="fs-dropdown-menu",size:r="regular",align:n="left",style:u,...a})=>{let{isOpen:l,close:i,dropdownItemsRef:c,selectedDropdownItemIndexRef:p,dropdownTriggerRef:w,id:f}=(0,s.x)(),{loading:h,...m}=useDropdownPosition(n),P=o().Children.toArray(e).length,handleDownPress=()=>{p.current<P-1?p.current++:p.current=0,c?.current[p.current]?.focus()},handleUpPress=()=>{p.current>0?p.current--:p.current=P-1,c?.current[p.current]?.focus()},handleHomePress=()=>{p.current=0,c?.current[p.current]?.focus()},handleEndPress=()=>{p.current=P-1,c?.current[p.current]?.focus()},handleEscapePress=()=>{i?.(),w?.current?.focus()},handleKeyNavigatePress=e=>{let t=c?.current??[],r=p.current,n=[...t.slice(r+1),...t.slice(0,r+1)],o=n.find(t=>t.textContent?.[0]?.toLowerCase()===e.toLowerCase());o&&(p.current=t.indexOf(o),o.focus())};return l&&!h?(0,d.createPortal)(o().createElement("div",{role:"presentation","data-fs-dropdown-overlay":!0,onKeyDown:e=>{if(!e.defaultPrevented&&"Enter"!==e.key&&" "!==e.key){switch(e.preventDefault(),e.key){case"Escape":handleEscapePress();break;case"ArrowDown":handleDownPress();break;case"ArrowUp":handleUpPress();break;case"Home":handleHomePress();break;case"End":handleEndPress();break;default:handleKeyNavigatePress(e.key)}e.stopPropagation()}},"data-testid":`${t}-overlay`},o().createElement("div",{role:"menu","aria-orientation":"vertical","data-fs-dropdown-menu":!0,"data-fs-dropdown-menu-size":r,"data-testid":t,style:{...m,...u},id:f,...a},e)),document.body):(c.current=[],null)}},49642:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(16689);let o=(0,n.createContext)({isOpen:!1,dropdownTriggerRef:null,selectedDropdownItemIndexRef:null,dropdownItemsRef:null,id:"fs-dropdown"}),d=o},55494:(e,t,r)=>{r.d(t,{x:()=>useDropdown});var n=r(16689),o=r(49642);let useDropdown=()=>{let e=(0,n.useContext)(o.Z);if(void 0===e)throw Error("Do not use useDropdown hook outside the Dropdown context.");return e}}};