{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","FloatingFocusManager","useHoverFloatingInteraction","mergeRootProps","resolveClassStyle","useMenuPositionerContext","useMenuRootContext","MenuPopup","props","root","positioner","floatingRootContext","enabled","open","closeDelay","setPopupRef","el","popupRef","current","state","side","align","transitionStatus","nested","instant","instantType","internal","aria-labelledby","activeTriggerElement","id","aria-orientation","orientation","data-rootownerid","rootId","data-open","undefined","data-closed","data-side","data-align","data-nested","data-instant","data-starting-style","data-ending-style","userClassStyle","userProps","merged","interactions","getFloatingProps","Tag","as","popupElement","modal","mounted","finalFocus"],"sources":["menu-popup.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\n/**\n * `<Menu.Popup>` — the popup container rendered inside `<Menu.Positioner>`.\n * Mirrors `packages/react/src/menu/popup/MenuPopup.tsx`.\n *\n * Wraps `FloatingFocusManager` to trap focus while open (modal) or keep\n * focus reachable while open (non-modal). Carries role=\"menu\" from\n * `useRole`.\n *\n * ### Port deviations\n *\n *  - `useHoverFloatingInteraction` keeps the popup open while the cursor\n *    is over the menu surface during hover-open sessions.\n *  - `finalFocus` accepts the same shape as React but the interaction-type\n *    callback form is not ported.\n */\n\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, omit } from \"solid-js\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { FloatingFocusManager } from \"../../internals/floating-ui/components/floating-focus-manager\";\nimport { useHoverFloatingInteraction } from \"../../internals/floating-ui/hooks/use-hover-floating-interaction\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport type {\n\tMenuAlign,\n\tMenuSide,\n} from \"../positioner/menu-positioner-context\";\nimport { useMenuPositionerContext } from \"../positioner/menu-positioner-context\";\nimport { useMenuRootContext } from \"../root/menu-root-context\";\n\nexport interface MenuPopupState {\n\topen: boolean;\n\tside: MenuSide;\n\talign: MenuAlign;\n\ttransitionStatus: TransitionStatus;\n\tnested: boolean;\n\tinstant: string | undefined;\n}\n\nexport interface MenuPopupProps\n\textends BaseUIComponentProps<\"div\", MenuPopupState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"div\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n\t/** Override where focus goes when the popup closes. */\n\tfinalFocus?:\n\t\t| boolean\n\t\t| HTMLElement\n\t\t| { current: HTMLElement | null }\n\t\t| undefined;\n}\n\nexport function MenuPopup(props: MenuPopupProps): JSX.Element {\n\tconst root = useMenuRootContext();\n\tconst positioner = useMenuPositionerContext();\n\n\tuseHoverFloatingInteraction(root.floatingRootContext, {\n\t\tenabled: () => root.open(),\n\t\tcloseDelay: () => 0,\n\t});\n\n\tconst setPopupRef = (el: HTMLElement | null): void => {\n\t\troot.popupRef.current = el;\n\t};\n\n\tconst state = createMemo<MenuPopupState>(() => ({\n\t\topen: root.open(),\n\t\tside: positioner.side(),\n\t\talign: positioner.align(),\n\t\ttransitionStatus: root.transitionStatus(),\n\t\tnested: root.nested(),\n\t\tinstant: root.instantType(),\n\t}));\n\n\tconst internal = {\n\t\tget \"aria-labelledby\"() {\n\t\t\treturn root.activeTriggerElement()?.id ?? \"\";\n\t\t},\n\t\tget \"aria-orientation\"() {\n\t\t\treturn root.orientation();\n\t\t},\n\t\tget \"data-rootownerid\"() {\n\t\t\treturn root.rootId();\n\t\t},\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-closed\"() {\n\t\t\treturn state().open ? undefined : \"\";\n\t\t},\n\t\tget \"data-side\"() {\n\t\t\treturn state().side;\n\t\t},\n\t\tget \"data-align\"() {\n\t\t\treturn state().align;\n\t\t},\n\t\tget \"data-nested\"() {\n\t\t\treturn state().nested ? \"\" : undefined;\n\t\t},\n\t\tget \"data-instant\"() {\n\t\t\treturn state().instant ? \"\" : undefined;\n\t\t},\n\t\tget \"data-starting-style\"() {\n\t\t\treturn state().transitionStatus === \"starting\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-ending-style\"() {\n\t\t\treturn state().transitionStatus === \"ending\" ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\n\tconst userProps = omit(props, \"as\", \"class\", \"style\", \"attrs\", \"finalFocus\");\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\troot.interactions.getFloatingProps(),\n\t\tinternal,\n\t);\n\tmerged = mergeRootProps(merged, userClassStyle);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"div\");\n\tconst popupElement = (\n\t\t<Tag {...merged} ref={composeRefs(setPopupRef, userRef(props))} />\n\t);\n\n\treturn (\n\t\t<FloatingFocusManager\n\t\t\tcontext={root.floatingRootContext}\n\t\t\tmodal={root.modal()}\n\t\t\tdisabled={!root.mounted()}\n\t\t\tinitialFocus={!root.nested()}\n\t\t\treturnFocus={props.finalFocus ?? true}\n\t\t\trestoreFocus=\"popup\"\n\t\t>\n\t\t\t{popupElement}\n\t\t</FloatingFocusManager>\n\t);\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,UAAU,EAAEC,IAAI,QAAQ,UAAU;AAC3C,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SAASC,oBAAoB,QAAQ,+DAA+D;AACpG,SAASC,2BAA2B,QAAQ,kEAAkE;AAC9G,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAqC;AAOvE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,kBAAkB,QAAQ,2BAA2B;AA0B9D,OAAO,SAASC,SAASA,CAACC,KAAqB,EAA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