@conscia-labs/design-system 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/mergeObjects.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/merge-props/mergeProps.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useRenderElement.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useRefWithInit.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useMergedRefs.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/getReactElementRef.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/reactVersion.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/warn.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/empty.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/resolveClassName.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/resolveStyle.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/use-render/useRender.mjs","../src/primitives/button.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox/root/CheckboxRoot.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useControlled.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/error.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/visuallyHidden.mjs","../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/owner.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/getDefaultFormSubmitter.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/field-constants/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox/utils/getCheckboxStateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useId.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/safeReact.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useBaseUiId.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/use-button/useButton.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useStableCallback.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/field/item/FieldItemContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/form-context/FormContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox-group/CheckboxGroupContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox/root/CheckboxRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/reason-parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useValueChanged.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/checkbox/indicator/CheckboxIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useOnMount.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useAnimationFrame.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/resolveRef.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useTransitionStatus.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs","../src/primitives/checkbox.tsx","../src/primitives/table.tsx","../src/primitives/select.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/root/SelectRoot.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useOnFirstRender.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/usePreviousValue.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/isElementDisabled.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useValueAsRef.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/store/useStore.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/fastHooks.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/store/Store.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/store/ReactStore.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/mergeCleanups.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/addEventListener.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useForcedRerendering.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useTimeout.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/parts.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/os.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/shared.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/engine.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/screen-reader.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/platform/env.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/shadowDom.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/FocusGuard.mjs","../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingTreeStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs","../node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../node_modules/.pnpm/@floating-ui+react-dom@2.1.9_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/popupHandle.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/utils/getEmptyRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/store.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/root/SelectRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/itemEquality.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/resolveValueLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/serializeValue.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/store.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/areArraysEqual.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/clamp.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/scrollEdges.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/label/SelectLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popupStateMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/value/SelectValue.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/icon/SelectIcon.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/portal/SelectPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/backdrop/SelectBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/positioner/SelectPositioner.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/inertValue.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/hideMiddleware.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/InternalBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/popup/utils.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/usePositioner.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs","../node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useScrollLock.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/popup/SelectPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/styles.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/composite.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/list/SelectList.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/item/SelectItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/item/SelectItemContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/item-text/SelectItemText.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/arrow/SelectArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/scroll-arrow/SelectScrollArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/group/SelectGroup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/group/SelectGroupContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/listbox-separator/ListboxSeparator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/select/separator/SelectSeparator.mjs","../src/primitives/overlay-layers.ts","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/close/DialogClose.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/description/DialogDescription.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/store/DialogStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/NullStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/root/DialogRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/viewport/DialogViewport.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/title/DialogTitle.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/trigger/DialogTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/dialog/store/DialogHandle.mjs","../src/primitives/dialog.tsx","../src/primitives/input.tsx","../src/primitives/shortcut-hint.tsx","../src/primitives/separator.tsx","../src/primitives/sheet.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/popup/DrawerPopupCssVars.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdropCssVars.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/close/DrawerClose.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/content/DrawerContent.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/content/DrawerContentDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/description/DrawerDescription.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/indent/DrawerIndent.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/provider/DrawerProviderContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/indent-background/DrawerIndentBackground.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/popup/DrawerPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/popup/DrawerPopupDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/root/DrawerRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/root/useDrawerSnapPoints.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/viewport/DrawerViewportContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/portal/DrawerPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/provider/DrawerProvider.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/root/DrawerRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/swipe-area/DrawerSwipeArea.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useSwipeDismiss.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/scrollable.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/getElementAtPoint.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/swipe-area/DrawerSwipeAreaDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/title/DrawerTitle.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/trigger/DrawerTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/viewport/DrawerViewport.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/viewport/DrawerViewportCssVars.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/drawer/handle.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/utils/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/usePopupViewport.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/getCssDimensions.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs","../src/primitives/tooltip.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/root/AlertDialogRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/trigger/AlertDialogTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/handle.mjs","../src/primitives/alert-dialog.tsx","../src/primitives/tabs.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/root/TabsRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/tab/TabsTab.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/list/TabsListContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/PrehydrationScript.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useIsHydrating.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/tabs/list/TabsList.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs","../src/primitives/card.tsx","../src/primitives/skeleton.tsx","../src/primitives/collapsible.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/root/CollapsibleRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/root/stateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/arrow/MenuArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/positioner/MenuPositionerContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/root/MenuRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/backdrop/MenuBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/context-menu/root/ContextMenuRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/item/useMenuItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/item/useMenuItemCommonProps.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/checkbox-item/MenuCheckboxItemDataAttributes.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/utils/stateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/group/MenuGroup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/group/MenuGroupContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/group-label/MenuGroupLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/item/MenuItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/link-item/MenuLinkItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/popup/MenuPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/portal/MenuPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/portal/MenuPortalContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/positioner/MenuPositioner.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/radio-group/MenuRadioGroup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/radio-group/MenuRadioGroupContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/radio-item/MenuRadioItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/radio-item/MenuRadioItemContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/radio-item-indicator/MenuRadioItemIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/root/MenuRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menubar/MenubarContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/store/MenuStore.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/trigger/MenuTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/utils/findRootOwnerId.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/popups/useTriggerFocusGuards.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/useMixedToggleClickHandler.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/viewport/MenuViewport.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/separator/Separator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/submenu-trigger/MenuSubmenuTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/menu/store/MenuHandle.mjs","../src/primitives/dropdown-menu.tsx","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/index.parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/ComboboxRoot.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/floating-ui-react/hooks/gridNavigation.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/ComboboxRootContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/store.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/utils/index.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/stringifyLocale.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/internals/filter.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/utils/constants.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/label/ComboboxLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/value/ComboboxValue.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/utils/stateAttributesMapping.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/chips/ComboboxChipsContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/utils/parts.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/input-group/ComboboxInputGroup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/utils/handleInputPress.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/trigger/ComboboxTrigger.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/collection/GroupCollectionContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/status/ComboboxStatus.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/utils/useInitialLiveRegionTextMutation.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/portal/ComboboxPortal.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/portal/ComboboxPortalContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/backdrop/ComboboxBackdrop.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/positioner/ComboboxPositioner.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/popup/ComboboxPopup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/arrow/ComboboxArrow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/icon/ComboboxIcon.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/group/ComboboxGroupContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/item/ComboboxItemContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/row/ComboboxRowContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/item-indicator/ComboboxItemIndicator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/chips/ComboboxChips.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/chip/ComboboxChip.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/chip/ComboboxChipContext.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/chip-remove/ComboboxChipRemove.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/row/ComboboxRow.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/clear/ComboboxClear.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/separator/ComboboxSeparator.mjs","../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/combobox/root/utils/useFilteredItems.mjs"],"sourcesContent":["export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.mjs\";\nimport { resolveClassName } from \"../utils/resolveClassName.mjs\";\nimport { resolveStyle } from \"../utils/resolveStyle.mjs\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.mjs\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n const renderProp = componentProps.render;\n const outProps = useRenderElementProps(componentProps, params);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params = {}) {\n const {\n className: classNameProp,\n style: styleProp,\n render: renderProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n // Called only to keep the hook order stable when disabled; the merged ref is unused.\n void useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/react/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n let newElement = render;\n // Workaround for https://github.com/react/react/issues/32392\n // This works because the toArray() logic unwrap lazy element type in\n // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\n if (newElement?.$$typeof === REACT_LAZY_TYPE) {\n const children = React.Children.toArray(render);\n newElement = children[0];\n }\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(newElement)) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(newElement, mergedProps);\n }\n if (element) {\n if (typeof element === 'string') {\n return renderTag(element, props);\n }\n }\n // Unreachable, but the typings on `useRenderElement` need to be reworked\n // to annotate it correctly.\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n // Legacy ref with no attach-time cleanup: detach by calling it with `null`.\n // It returns nothing; React 19 cleanups are handled in the branch above.\n void ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.mjs\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","let set;\nif (process.env.NODE_ENV !== 'production') {\n set = new Set();\n}\nexport function warn(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const messageKey = messages.join(' ');\n if (!set.has(messageKey)) {\n set.add(messageKey);\n console.warn(`Base UI: ${messageKey}`);\n }\n }\n}","export function NOOP() {}\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { useRenderElement } from \"../internals/useRenderElement.mjs\";\n/**\n * Renders a Base UI element.\n *\n * @public\n */\nexport function useRender(params) {\n return useRenderElement(params.defaultTagName ?? 'div', params, params);\n}","import * as React from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"./utils\";\n\nconst buttonVariants = cva(\n \"ds-type-button inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-focus focus-visible:ring-focus/50 focus-visible:ring-[3px] aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 aria-invalid:border-danger\",\n {\n variants: {\n variant: {\n default:\n \"bg-action text-action-foreground shadow-xs hover:bg-action-hover active:bg-action-active\",\n destructive:\n \"bg-danger text-white shadow-xs hover:bg-danger/90 focus-visible:ring-danger/20 dark:bg-danger-background dark:text-danger-foreground dark:hover:bg-danger-border dark:focus-visible:ring-danger/40\",\n outline:\n \"border border-border-default bg-surface-control text-text-primary shadow-xs hover:bg-surface-control-hover hover:text-text-primary\",\n secondary: \"bg-surface-inverse text-text-inverse shadow-xs hover:bg-surface-inverse/80\",\n ghost: \"text-text-primary hover:bg-surface-muted hover:text-text-primary\",\n link: \"text-text-link underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-[var(--ds-control-height)] px-3 py-2 has-[>svg]:px-3\",\n sm: \"h-[var(--ds-control-height-sm)] rounded-md gap-1.5 px-2.5 has-[>svg]:px-2\",\n lg: \"h-[var(--ds-control-height-lg)] rounded-md px-4 has-[>svg]:px-3.5\",\n icon: \"size-[var(--ds-control-height)]\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n },\n);\n\ntype ButtonProps = React.ComponentProps<\"button\">\n & VariantProps<typeof buttonVariants>\n & {\n render?: useRender.ComponentProps<\"button\">[\"render\"];\n };\n\nfunction Button({\n className,\n variant,\n size,\n render,\n type,\n ...props\n}: ButtonProps) {\n const classNames = buttonVariants({ variant, size, className });\n const defaultProps = {\n \"data-slot\": \"button\",\n className: classNames,\n ...(render ? {} : { type: type ?? \"button\" }),\n ...props,\n } as React.ComponentProps<\"button\">;\n\n return useRender({\n defaultTagName: \"button\",\n render,\n props: mergeProps<\"button\">(defaultProps, {}),\n });\n}\n\ntype IconButtonNameProps =\n | { \"aria-label\": string; \"aria-labelledby\"?: string }\n | { \"aria-label\"?: string; \"aria-labelledby\": string };\n\ntype IconButtonProps = Omit<ButtonProps, \"children\" | \"size\" | \"aria-label\" | \"aria-labelledby\">\n & IconButtonNameProps\n & {\n children: React.ReactNode;\n size?: \"sm\" | \"default\" | \"lg\";\n };\n\nconst iconButtonSizes = {\n sm: \"size-[var(--ds-control-height-sm)]\",\n default: \"size-[var(--ds-control-height)]\",\n lg: \"size-[var(--ds-control-height-lg)]\",\n} as const;\n\nfunction IconButton({\n className,\n size = \"default\",\n ...props\n}: IconButtonProps) {\n return (\n <Button\n size=\"icon\"\n className={cn(iconButtonSizes[size], className)}\n {...props}\n />\n );\n}\n\nexport { Button, IconButton, buttonVariants };\nexport type { ButtonProps, IconButtonProps };\n","export { CheckboxRoot as Root } from \"./root/CheckboxRoot.mjs\";\nexport { CheckboxIndicator as Indicator } from \"./indicator/CheckboxIndicator.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { getDefaultFormSubmitter } from '@base-ui/utils/getDefaultFormSubmitter';\nimport { NOOP } from \"../../internals/noop.mjs\";\nimport { getCheckboxStateAttributesMapping } from \"../utils/getCheckboxStateAttributesMapping.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFieldItemContext } from \"../../field/item/FieldItemContext.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.mjs\";\nimport { useCheckboxGroupContext } from \"../../checkbox-group/CheckboxGroupContext.mjs\";\nimport { CheckboxRootContext } from \"./CheckboxRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PARENT_CHECKBOX = 'data-parent';\n\n/**\n * Represents the checkbox itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)\n */\nexport const CheckboxRoot = /*#__PURE__*/React.forwardRef(function CheckboxRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked = false,\n 'aria-labelledby': ariaLabelledByProp,\n disabled: disabledProp = false,\n form,\n id: idProp,\n indeterminate = false,\n inputRef: inputRefProp,\n name: nameProp,\n onCheckedChange,\n parent = false,\n readOnly = false,\n render,\n required = false,\n uncheckedValue,\n value: valueProp,\n nativeButton = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n disabled: rootDisabled,\n name: fieldName,\n setDirty,\n setFilled,\n setFocused,\n setTouched,\n state: fieldState,\n validationMode,\n validityData,\n validation: localValidation\n } = useFieldRootContext();\n const fieldItemContext = useFieldItemContext();\n const {\n labelId,\n controlId,\n registerControlId,\n getDescriptionProps\n } = useLabelableContext();\n const groupContext = useCheckboxGroupContext();\n const parentContext = groupContext?.allValues === undefined ? undefined : groupContext.parent;\n const isGroupedWithParent = parentContext !== undefined;\n const disabled = rootDisabled || fieldItemContext.disabled || groupContext?.disabled || disabledProp;\n const name = fieldName ?? nameProp;\n const value = valueProp ?? name;\n const id = useBaseUiId();\n const generatedInputId = useBaseUiId();\n let inputId = idProp || controlId;\n if (isGroupedWithParent) {\n if (parent) {\n inputId = generatedInputId;\n } else if (value !== undefined) {\n inputId = `${parentContext.id}-${value}`;\n } else {\n inputId ||= generatedInputId;\n }\n }\n let groupProps = {};\n if (isGroupedWithParent) {\n if (parent) {\n groupProps = parentContext.getParentProps();\n } else if (value !== undefined) {\n groupProps = parentContext.getChildProps(value);\n }\n }\n const {\n checked: groupChecked = checkedProp,\n indeterminate: groupIndeterminate = indeterminate,\n onCheckedChange: groupOnChange,\n ...otherGroupProps\n } = groupProps;\n const groupValue = groupContext?.value;\n const controlRef = React.useRef(null);\n const controlSourceRef = useRefWithInit(() => Symbol());\n const hasRegisteredRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const validation = groupContext?.validation ?? localValidation;\n const [checked, setCheckedState] = useControlled({\n controlled: value !== undefined && groupValue !== undefined && !parent ? groupValue.includes(value) : groupChecked,\n default: defaultChecked,\n name: 'Checkbox',\n state: 'checked'\n });\n const computedChecked = isGroupedWithParent ? Boolean(groupChecked) : checked;\n const computedIndeterminate = isGroupedWithParent ? groupIndeterminate || indeterminate : indeterminate;\n\n // can't use useLabelableId because of optional groupContext and/or parent\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, inputId);\n return undefined;\n }, [inputId, registerControlId, controlSourceRef]);\n React.useEffect(() => {\n const controlSource = controlSourceRef.current;\n return () => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSource, undefined);\n };\n }, [registerControlId, controlSourceRef]);\n useRegisterFieldControl(controlRef, id, checked, undefined, !groupContext && !disabled, nameProp);\n const inputRef = React.useRef(null);\n const registerFieldInput = validation.registerInput;\n const registeredInputValue = groupContext ? value : undefined;\n const registerInput = React.useCallback(element => registerFieldInput(element, {\n controlRef,\n value: registeredInputValue\n }), [registerFieldInput, registeredInputValue]);\n const mergedInputRef = useMergedRefs(inputRefProp, inputRef, parent ? undefined : registerInput);\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, inputId ?? undefined);\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = computedIndeterminate;\n if (checked) {\n setFilled(true);\n }\n }\n }, [checked, computedIndeterminate, setFilled]);\n useValueChanged(checked, () => {\n if (groupContext) {\n return;\n }\n clearErrors(name);\n setFilled(checked);\n setDirty(checked !== validityData.initialValue);\n validation.change(checked);\n });\n const inputProps = mergeProps({\n checked,\n disabled,\n form,\n // parent checkboxes unset `name` to be excluded from form submission\n name: parent ? undefined : name,\n // Set `id` to stop Chrome warning about an unassociated input.\n // When using a native button, the `id` is applied to the button instead.\n id: nativeButton ? undefined : inputId ?? undefined,\n required,\n ref: mergedInputRef,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, details);\n if (details.isCanceled) {\n return;\n }\n groupOnChange?.(nextChecked, details);\n if (details.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n if (value !== undefined && groupContext !== undefined && !parent && !isGroupedWithParent) {\n const nextGroupValue = nextChecked ? [...groupContext.value, value] : groupContext.value.filter(item => item !== value);\n groupContext.setValue(nextGroupValue, details);\n }\n },\n onClick(event) {\n // The click dispatched from the root's `onClick` is an implementation detail\n // and must not reach ancestors, which already receive the original click.\n event.stopPropagation();\n },\n onFocus() {\n controlRef.current?.focus();\n }\n },\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n valueProp !== undefined ? {\n value: (groupContext ? checked && valueProp : valueProp) || ''\n } : EMPTY_OBJECT, getDescriptionProps, props => validation.getValidationProps(disabled, props));\n React.useEffect(() => {\n if (!parentContext || value === undefined) {\n return undefined;\n }\n const disabledStates = parentContext.disabledStatesRef.current;\n disabledStates.set(value, disabled);\n return () => {\n disabledStates.delete(value);\n };\n }, [parentContext, disabled, value]);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked: computedChecked,\n disabled,\n readOnly,\n required,\n indeterminate: computedIndeterminate\n }), [fieldState, computedChecked, disabled, readOnly, required, computedIndeterminate]);\n const stateAttributesMapping = getCheckboxStateAttributesMapping(state);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [buttonRef, controlRef, forwardedRef],\n props: [{\n id: nativeButton ? inputId ?? undefined : id,\n role: 'checkbox',\n 'aria-checked': computedIndeterminate ? 'mixed' : computedChecked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n [PARENT_CHECKBOX]: parent ? '' : undefined,\n onFocus() {\n if (!disabled) {\n setFocused(true);\n }\n },\n onBlur() {\n const inputEl = inputRef.current;\n if (!inputEl) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(groupContext ? groupValue : inputEl.checked);\n }\n },\n onKeyDown(event) {\n if (event.key !== 'Enter') {\n return;\n }\n\n // Let consumer `preventDefault()` handlers opt out while defensively stopping\n // any remaining Base UI Enter handling from treating the checkbox as a button.\n event.preventBaseUIHandler();\n if (event.defaultPrevented) {\n return;\n }\n const formToSubmit = inputRef.current?.form ?? null;\n const currentTarget = event.currentTarget;\n const nativeEvent = event.nativeEvent;\n const originalPreventDefault = event.preventDefault;\n const originalNativePreventDefault = nativeEvent.preventDefault;\n let preventDefaultCalledAfterPropagation = false;\n event.preventDefault = () => {\n preventDefaultCalledAfterPropagation = true;\n originalPreventDefault.call(event);\n };\n nativeEvent.preventDefault = () => {\n preventDefaultCalledAfterPropagation = true;\n originalNativePreventDefault.call(nativeEvent);\n };\n\n // Enter should not activate/toggle the checkbox. Cancel the native button behavior\n // without setting React's synthetic `defaultPrevented`, so ancestor React handlers\n // can still opt out by calling `preventDefault()` during propagation.\n originalNativePreventDefault.call(nativeEvent);\n ownerWindow(currentTarget).queueMicrotask(() => {\n event.preventDefault = originalPreventDefault;\n nativeEvent.preventDefault = originalNativePreventDefault;\n if (!preventDefaultCalledAfterPropagation) {\n getDefaultFormSubmitter(formToSubmit)?.click();\n }\n });\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n dispatchClickWithModifiers(input, event);\n }\n }, elementProps, otherGroupProps, getButtonProps, getDescriptionProps, props => validation.getValidationProps(disabled, props)],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(CheckboxRootContext.Provider, {\n value: state,\n children: [element, !checked && !groupContext && name && !parent && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue,\n disabled: disabled\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") CheckboxRoot.displayName = \"CheckboxRoot\";","'use client';\n\n// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nimport { error } from \"./error.mjs\";\nexport function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n error([`A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {\n error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [defaultProp]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}\nfunction serializeToDevModeString(input) {\n let nextId = 0;\n const seen = new WeakMap();\n try {\n const result = JSON.stringify(input, function replacer(key, value) {\n if (key === '_owner' && this != null && typeof this === 'object' && '$$typeof' in this) {\n return undefined;\n }\n if (typeof value === 'bigint') {\n return `__bigint__:${value}`;\n }\n if (value !== null && typeof value === 'object') {\n const id = seen.get(value);\n if (id !== undefined) {\n return `__object__:${id}`;\n }\n seen.set(value, nextId);\n nextId += 1;\n }\n return value;\n });\n return result ?? `__top__:${typeof input}`;\n } catch {\n return '__unserializable__';\n }\n}","let set;\nif (process.env.NODE_ENV !== 'production') {\n set = new Set();\n}\nexport function error(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const messageKey = messages.join(' ');\n if (!set.has(messageKey)) {\n set.add(messageKey);\n console.error(`Base UI: ${messageKey}`);\n }\n }\n}\nexport function reset() {\n set?.clear();\n}","'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;","const visuallyHiddenBase = {\n clipPath: 'inset(50%)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n border: 0,\n padding: 0,\n width: 1,\n height: 1,\n margin: -1\n};\nexport const visuallyHidden = {\n ...visuallyHiddenBase,\n position: 'fixed',\n top: 0,\n left: 0\n};\nexport const visuallyHiddenInput = {\n ...visuallyHiddenBase,\n position: 'absolute'\n};","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","export { getWindow as ownerWindow } from '@floating-ui/utils/dom';\nexport function ownerDocument(node) {\n return node?.ownerDocument || document;\n}","/**\n * Returns the default button a browser uses for implicit form submission.\n *\n * This is useful for custom form controls that need to mirror native Enter key behavior.\n * Clicking the returned submitter preserves browser semantics such as the submitter's click\n * event, `SubmitEvent.submitter`, and submitter-specific attributes.\n *\n * The function follows the controls exposed by `form.elements`, which includes controls associated\n * through the `form` attribute. Disabled submitters can be returned because the default button is\n * determined before disabled state is considered; clicking a disabled submitter is a no-op.\n */\nexport function getDefaultFormSubmitter(form) {\n if (!form) {\n return null;\n }\n for (const candidate of form.elements) {\n const tagName = candidate.tagName;\n if (tagName === 'BUTTON' || tagName === 'INPUT') {\n const button = candidate;\n\n // Intentionally excludes input[type=\"image\"]: Chromium omits it from form.elements,\n // so supporting it would require separate traversal for an exotic submitter type.\n if (button.type === 'submit') {\n return button;\n }\n }\n }\n return null;\n}","export const DEFAULT_VALIDITY_STATE = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: null,\n valueMissing: false\n};\nexport const DEFAULT_FIELD_STATE_ATTRIBUTES = {\n valid: null,\n touched: false,\n dirty: false,\n filled: false,\n focused: false\n};\nexport const DEFAULT_FIELD_ROOT_STATE = {\n disabled: false,\n ...DEFAULT_FIELD_STATE_ATTRIBUTES\n};\nexport const fieldValidityMapping = {\n valid(value) {\n if (value === null) {\n return null;\n }\n if (value) {\n return {\n 'data-valid': ''\n };\n }\n return {\n 'data-invalid': ''\n };\n }\n};","import { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nexport function getCheckboxStateAttributesMapping(state) {\n return {\n checked(value) {\n if (state.indeterminate) {\n // `data-indeterminate` is already handled by the `indeterminate` prop.\n return {};\n }\n if (value) {\n return {\n 'data-checked': ''\n };\n }\n return {\n 'data-unchecked': ''\n };\n },\n ...fieldValidityMapping\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 (the native convention for keyboard-generated clicks);\n * pass `detail: 1` when the click represents a mouse gesture so consumers keying\n * off `detail === 0` don't classify it as a keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`${prefix}-${globalId}`);\n }\n }, [defaultId, prefix]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 17.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","import * as React from 'react';\n\n/**\n * A clone of the React namespace for reading APIs that may be missing in older\n * supported React versions. Bundlers can rewrite direct `React.someNewApi`\n * reads into named imports, which breaks React 17. Reading from this cloned\n * object keeps those lookups optional.\n *\n * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\n */\nexport const SafeReact = {\n ...React\n};","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}","'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.mjs\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.mjs\";\nexport const DEFAULT_FIELD_ROOT_CONTEXT = {\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n setTouched: NOOP,\n setDirty: NOOP,\n setFilled: NOOP,\n setFocused: NOOP,\n validationMode: 'onSubmit',\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n registeredInputs: new Map(),\n registerInput: NOOP,\n getInputControl: () => null,\n commit: async () => {},\n change: NOOP\n }\n};\nexport const FieldRootContext = /*#__PURE__*/React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.mjs\";\nexport function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = useRefWithInit(() => Symbol());\n\n // Re-register without unregistering first: re-registration with the same id updates the\n // form's fields Map entry in place, while a delete + re-add would move the field to the\n // end of the Map every time its value changes.\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!enabled) {\n registerFieldControl(source, undefined);\n return;\n }\n const registration = {\n controlRef,\n getValue: getFormValueOverride,\n id,\n name,\n value\n };\n registerFieldControl(source, registration);\n }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [registerFieldControl, sourceRef]);\n}","'use client';\n\nimport * as React from 'react';\nexport const FieldItemContext = /*#__PURE__*/React.createContext({\n disabled: false\n});\nif (process.env.NODE_ENV !== \"production\") FieldItemContext.displayName = \"FieldItemContext\";\nexport function useFieldItemContext() {\n const context = React.useContext(FieldItemContext);\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n elementRef: {\n current: null\n },\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitAttemptedRef: {\n current: false\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nexport function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {\n const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();\n const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : undefined);\n const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;\n\n // Fallback for <span> controls labelled by wrapping/sibling native <label>.\n // Run after every commit so DOM association changes (e.g. label mount/unmount)\n // are reflected even when props/state deps are unchanged.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(() => {\n const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? undefined : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);\n if (fallbackAriaLabelledBy !== nextAriaLabelledBy) {\n setFallbackAriaLabelledBy(nextAriaLabelledBy);\n }\n });\n return ariaLabelledBy;\n}\nfunction getAriaLabelledBy(labelSource, generatedLabelId) {\n const label = findAssociatedLabel(labelSource);\n if (!label) {\n return undefined;\n }\n if (!label.id && generatedLabelId) {\n label.id = generatedLabelId;\n }\n return label.id || undefined;\n}\nfunction findAssociatedLabel(labelSource) {\n if (!labelSource) {\n return undefined;\n }\n\n // Fast path before the expensive `.labels` read.\n const parent = labelSource.parentElement;\n if (parent && parent.tagName === 'LABEL') {\n return parent;\n }\n const controlId = labelSource.id;\n if (controlId) {\n const nextSibling = labelSource.nextElementSibling;\n if (nextSibling && nextSibling.htmlFor === controlId) {\n return nextSibling;\n }\n }\n const labels = labelSource.labels;\n return labels && labels[0];\n}","'use client';\n\nimport * as React from 'react';\nexport const CheckboxGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CheckboxGroupContext.displayName = \"CheckboxGroupContext\";\nexport function useCheckboxGroupContext() {\n return React.useContext(CheckboxGroupContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CheckboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CheckboxRootContext.displayName = \"CheckboxRootContext\";\nexport function useCheckboxRootContext() {\n const context = React.useContext(CheckboxRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.' : _formatErrorMessage(14));\n }\n return context;\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { REASONS } from \"./reasons.mjs\";\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nexport function useValueChanged(value, onChange) {\n const valueRef = React.useRef(value);\n const onChangeCallback = useStableCallback(onChange);\n useIsoLayoutEffect(() => {\n if (valueRef.current !== value) {\n onChangeCallback(valueRef.current);\n }\n valueRef.current = value;\n }, [value, onChangeCallback]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useCheckboxRootContext } from \"../root/CheckboxRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { getCheckboxStateAttributesMapping } from \"../utils/getCheckboxStateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Indicates whether the checkbox is ticked.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)\n */\nexport const CheckboxIndicator = /*#__PURE__*/React.forwardRef(function CheckboxIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const rootState = useCheckboxRootContext();\n const rendered = rootState.checked || rootState.indeterminate;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(rendered);\n const indicatorRef = React.useRef(null);\n const state = {\n ...rootState,\n transitionStatus\n };\n useOpenChangeComplete({\n open: rendered,\n ref: indicatorRef,\n onComplete() {\n if (!rendered) {\n setMounted(false);\n }\n }\n });\n const baseStateAttributesMapping = getCheckboxStateAttributesMapping(rootState);\n const stateAttributesMapping = {\n ...baseStateAttributesMapping,\n ...transitionStatusMapping\n };\n const shouldRender = keepMounted || mounted;\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n stateAttributesMapping,\n props: elementProps\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CheckboxIndicator.displayName = \"CheckboxIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.mjs\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}","'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * If an animation is canceled, waits for any replacement animations before executing.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n ReactDOM.flushSync(fnToExecute);\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }, () => {\n if (signal?.aborted) {\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n return;\n }\n done();\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = 'data-starting-style';\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY } from \"./empty.mjs\";\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY_ARRAY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","/**\n * If the provided argument is a ref object, returns its `current` value.\n * Otherwise, returns the argument itself.\n */\nexport function resolveRef(maybeRef) {\n if (maybeRef == null) {\n return maybeRef;\n }\n return 'current' in maybeRef ? maybeRef.current : maybeRef;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n const [mounted, setMounted] = React.useState(open);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n if (!open || enableIdleState) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}","export let TransitionStatusDataAttributes = /*#__PURE__*/function (TransitionStatusDataAttributes) {\n /**\n * Present when the component begins animating in.\n */\n TransitionStatusDataAttributes[\"startingStyle\"] = \"data-starting-style\";\n /**\n * Present when the component is animating out.\n */\n TransitionStatusDataAttributes[\"endingStyle\"] = \"data-ending-style\";\n return TransitionStatusDataAttributes;\n}({});\nconst STARTING_HOOK = {\n 'data-starting-style': ''\n};\nconst ENDING_HOOK = {\n 'data-ending-style': ''\n};\nexport const transitionStatusMapping = {\n transitionStatus(value) {\n if (value === 'starting') {\n return STARTING_HOOK;\n }\n if (value === 'ending') {\n return ENDING_HOOK;\n }\n return null;\n }\n};","\"use client\";\nimport * as React from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"./utils\";\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof BaseCheckbox.Root>) { return <BaseCheckbox.Root data-slot=\"checkbox\" className={cn(\"peer size-4 shrink-0 rounded-[4px] border border-control-border shadow-xs transition-shadow outline-none focus-visible:border-focus focus-visible:ring-[3px] focus-visible:ring-focus/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/20 data-checked:border-action data-checked:bg-action data-checked:text-action-foreground\", className)} {...props}><BaseCheckbox.Indicator data-slot=\"checkbox-indicator\" className=\"grid place-content-center text-current\"><CheckIcon className=\"size-3.5\" /></BaseCheckbox.Indicator></BaseCheckbox.Root>; }\nexport { Checkbox };\n","import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div data-slot=\"table-container\" tabIndex={0} className=\"relative w-full overflow-x-auto outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset\">\n <table data-slot=\"table\" className={cn(\"w-full caption-bottom ds-type-ui\", className)} {...props} />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b [&_tr]:border-border-subtle\", className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return <tbody data-slot=\"table-body\" className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />;\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return <tfoot data-slot=\"table-footer\" className={cn(\"border-t border-border-subtle bg-surface-muted/40 font-medium\", className)} {...props} />;\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\"h-[var(--ds-row-height)] border-b border-border-subtle transition-colors hover:bg-surface-muted/70 focus-within:bg-surface-muted/70 data-[selected=true]:bg-selection-background data-[disabled]:pointer-events-none data-[disabled]:opacity-50\", className)}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\"ds-type-table-head h-[var(--ds-table-header-height)] whitespace-nowrap px-3 text-left align-middle uppercase text-text-supporting\", className)}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return <td data-slot=\"table-cell\" className={cn(\"ds-type-ui whitespace-nowrap px-3 py-2 align-middle\", className)} {...props} />;\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n return <caption data-slot=\"table-caption\" className={cn(\"ds-type-metadata mt-2 text-left text-text-supporting\", className)} {...props} />;\n}\n\nexport {\n Table,\n TableBody,\n TableCell,\n TableCaption,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow\n};\n","\"use client\";\nimport * as React from \"react\";\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\ntype SelectProps = Omit<React.ComponentProps<typeof BaseSelect.Root>, \"onValueChange\"> & { onValueChange?: (value: string) => void };\nfunction collectItems(children: React.ReactNode): Array<{ value: string; label: React.ReactNode }> {\n const items: Array<{ value: string; label: React.ReactNode }> = [];\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n const childProps = child.props as { value?: string; children?: React.ReactNode };\n if (childProps.value !== undefined) items.push({ value: childProps.value, label: childProps.children });\n if (childProps.children) items.push(...collectItems(childProps.children));\n });\n return items;\n}\nfunction Select({ onValueChange, children, items, ...props }: SelectProps & { children?: React.ReactNode; items?: React.ComponentProps<typeof BaseSelect.Root>[\"items\"] }) { const resolvedItems = items ?? collectItems(children); return <BaseSelect.Root data-slot=\"select\" items={resolvedItems} onValueChange={onValueChange as React.ComponentProps<typeof BaseSelect.Root>[\"onValueChange\"]} {...props}>{children}</BaseSelect.Root>; }\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof BaseSelect.Group>) { return <BaseSelect.Group data-slot=\"select-group\" {...props} />; }\nfunction SelectValue({ ...props }: React.ComponentProps<typeof BaseSelect.Value>) { return <BaseSelect.Value data-slot=\"select-value\" {...props} />; }\nfunction SelectTrigger({ className, size=\"default\", children, ...props }: React.ComponentProps<typeof BaseSelect.Trigger> & { size?: \"sm\"|\"default\" }) { return <BaseSelect.Trigger data-slot=\"select-trigger\" data-size={size} className={cn(\"ds-type-control border-control-border data-[placeholder]:text-text-supporting focus-visible:border-focus focus-visible:ring-focus/50 flex w-fit items-center justify-between gap-2 rounded-[var(--ds-field-control-radius)] border bg-surface-control px-[var(--ds-field-control-padding-x)] py-2 whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[var(--ds-field-control-height)] data-[size=sm]:h-[var(--ds-control-height-sm)] [&_svg]:pointer-events-none [&_svg]:shrink-0\", className)} {...props}>{children}<BaseSelect.Icon><ChevronDownIcon className=\"size-4 opacity-50\" /></BaseSelect.Icon></BaseSelect.Trigger>; }\nfunction SelectContent({ className, children, ...props }: React.ComponentProps<typeof BaseSelect.Popup>) { return <BaseSelect.Portal><BaseSelect.Positioner data-slot=\"select-positioner\" className={overlayLayers.popup}><BaseSelect.Popup data-slot=\"select-content\" className={cn(\"bg-surface-floating text-text-primary relative max-h-[var(--available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none data-open:animate-in data-closed:animate-out\", className)} {...props}>{children}</BaseSelect.Popup></BaseSelect.Positioner></BaseSelect.Portal>; }\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof BaseSelect.Item>) { return <BaseSelect.Item data-slot=\"select-item\" className={cn(\"ds-type-menu-item data-highlighted:bg-surface-muted relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50\", className)} {...props}><span className=\"absolute right-2 flex size-3.5 items-center justify-center\"><BaseSelect.ItemIndicator><CheckIcon className=\"size-4\" /></BaseSelect.ItemIndicator></span><BaseSelect.ItemText>{children}</BaseSelect.ItemText></BaseSelect.Item>; }\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof BaseSelect.GroupLabel>) { return <BaseSelect.GroupLabel data-slot=\"select-label\" className={cn(\"ds-type-menu-label text-text-supporting px-2 py-1.5\", className)} {...props} />; }\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof BaseSelect.Separator>) { return <BaseSelect.Separator data-slot=\"select-separator\" className={cn(\"bg-border-default pointer-events-none -mx-1 my-1 h-px\", className)} {...props} />; }\nfunction SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof BaseSelect.ScrollUpArrow>) { return <BaseSelect.ScrollUpArrow data-slot=\"select-scroll-up-button\" className={cn(\"flex items-center justify-center py-1\", className)} {...props}><ChevronUpIcon className=\"size-4\" /></BaseSelect.ScrollUpArrow>; }\nfunction SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof BaseSelect.ScrollDownArrow>) { return <BaseSelect.ScrollDownArrow data-slot=\"select-scroll-down-button\" className={cn(\"flex items-center justify-center py-1\", className)} {...props}><ChevronDownIcon className=\"size-4\" /></BaseSelect.ScrollDownArrow>; }\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };\n","export { SelectRoot as Root } from \"./root/SelectRoot.mjs\";\nexport { SelectLabel as Label } from \"./label/SelectLabel.mjs\";\nexport { SelectTrigger as Trigger } from \"./trigger/SelectTrigger.mjs\";\nexport { SelectValue as Value } from \"./value/SelectValue.mjs\";\nexport { SelectIcon as Icon } from \"./icon/SelectIcon.mjs\";\nexport { SelectPortal as Portal } from \"./portal/SelectPortal.mjs\";\nexport { SelectBackdrop as Backdrop } from \"./backdrop/SelectBackdrop.mjs\";\nexport { SelectPositioner as Positioner } from \"./positioner/SelectPositioner.mjs\";\nexport { SelectPopup as Popup } from \"./popup/SelectPopup.mjs\";\nexport { SelectList as List } from \"./list/SelectList.mjs\";\nexport { SelectItem as Item } from \"./item/SelectItem.mjs\";\nexport { SelectItemIndicator as ItemIndicator } from \"./item-indicator/SelectItemIndicator.mjs\";\nexport { SelectItemText as ItemText } from \"./item-text/SelectItemText.mjs\";\nexport { SelectArrow as Arrow } from \"./arrow/SelectArrow.mjs\";\nexport { SelectScrollDownArrow as ScrollDownArrow } from \"./scroll-down-arrow/SelectScrollDownArrow.mjs\";\nexport { SelectScrollUpArrow as ScrollUpArrow } from \"./scroll-up-arrow/SelectScrollUpArrow.mjs\";\nexport { SelectGroup as Group } from \"./group/SelectGroup.mjs\";\nexport { SelectGroupLabel as GroupLabel } from \"./group-label/SelectGroupLabel.mjs\";\nexport { SelectSeparator as Separator } from \"./separator/SelectSeparator.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { usePreviousValue } from '@base-ui/utils/usePreviousValue';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore, ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useClick, useDismiss, useFloatingRootContext, useListNavigation, useTypeahead } from \"../../floating-ui-react/index.mjs\";\nimport { SelectRootContext } from \"./SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { stringifyAsLabel, stringifyAsValue } from \"../../internals/resolveValueLabel.mjs\";\nimport { compareItemEquality, defaultItemEquality, findItemIndex } from \"../../internals/itemEquality.mjs\";\nimport { areArraysEqual } from \"../../internals/areArraysEqual.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { getMaxScrollOffset, normalizeScrollOffset } from \"../../utils/scrollEdges.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\n\n/**\n * Groups all parts of the select.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function SelectRoot(props) {\n const {\n id,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name: nameProp,\n form,\n autoComplete,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n modal = true,\n actionsRef,\n inputRef,\n onOpenChangeComplete,\n items,\n multiple = false,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n highlightItemOnHover = true,\n children\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n setTouched,\n setFocused,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n validation,\n validationMode\n } = useFieldRootContext();\n const generatedId = useLabelableId({\n id\n });\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue,\n name: 'Select',\n state: 'value'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Select',\n state: 'open'\n });\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const scrollHandlerRef = React.useRef(null);\n const scrollArrowsMountedCountRef = React.useRef(0);\n const valueRef = React.useRef(null);\n const valuesRef = React.useRef([]);\n const typingRef = React.useRef(false);\n const firstItemTextRef = React.useRef(null);\n const selectedItemTextRef = React.useRef(null);\n const selectionRef = React.useRef({\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n });\n const alignItemWithTriggerActiveRef = React.useRef(false);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n const store = useRefWithInit(() => new ReactStore({\n id: generatedId,\n labelId: undefined,\n modal,\n multiple,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n value,\n open,\n mounted,\n transitionStatus,\n items,\n forceMount: false,\n openMethod: null,\n activeIndex: null,\n selectedIndex: null,\n popupProps: {},\n triggerProps: {},\n triggerElement: null,\n positionerElement: null,\n listElement: null,\n popupSide: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false,\n hasScrollArrows: false\n })).current;\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const previousOpenMethod = usePreviousValue(openMethod);\n const renderedOpenMethod = openMethod ?? previousOpenMethod;\n const serializedValue = React.useMemo(() => {\n // In multiple mode the shared input is nameless; per-value entries are submitted via\n // `hiddenInputs`. Its value is therefore irrelevant, and passing the whole array to\n // `stringifyAsValue` would invoke a user `itemToStringValue` with an array it doesn't expect.\n if (multiple) {\n return '';\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const fieldStringValue = React.useMemo(() => {\n if (multiple && Array.isArray(value)) {\n return value.map(currentValue => stringifyAsValue(currentValue, itemToStringValue));\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const controlRef = useValueAsRef(triggerElement);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled, nameProp);\n const initialValueRef = React.useRef(value);\n // Mirror the `hasSelectedValue` store selector so the Field's filled state agrees with the\n // trigger/value placeholder semantics (a value serializing to `''` counts as empty).\n const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && serializedValue !== '';\n useIsoLayoutEffect(() => {\n setFilled(hasSelectedValue);\n }, [hasSelectedValue, setFilled]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n let target = value;\n let empty = false;\n if (multiple) {\n const currentValue = Array.isArray(value) ? value : [];\n empty = currentValue.length === 0;\n target = currentValue[currentValue.length - 1];\n }\n const index = empty ? -1 : findItemIndex(valuesRef.current, target, isItemEqualToValue);\n const nextIndex = index === -1 ? null : index;\n if (nextIndex === null) {\n selectedItemTextRef.current = null;\n }\n if (open) {\n return;\n }\n store.set('selectedIndex', nextIndex);\n }, [multiple, open, value, isItemEqualToValue, store]);\n function isSelectedValueDirty(currentValue) {\n const initialValue = validityData.initialValue;\n if (Array.isArray(currentValue) && Array.isArray(initialValue)) {\n return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));\n }\n return currentValue !== initialValue;\n }\n useValueChanged(value, () => {\n clearErrors(name);\n setDirty(isSelectedValueDirty(value));\n validation.change(value);\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n }\n });\n const handleUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeIndex: null,\n openMethod: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: !actionsRef,\n open,\n ref: popupRef,\n onComplete() {\n if (!open) {\n handleUnmount();\n }\n }\n });\n React.useImperativeHandle(actionsRef, () => ({\n unmount: handleUnmount\n }), [handleUnmount]);\n const setValue = useStableCallback((nextValue, eventDetails) => {\n onValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(nextValue);\n });\n const handleScrollArrowVisibility = useStableCallback(scroller => {\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const shouldShowUp = scrollTop > 0;\n const shouldShowDown = scrollTop < maxScrollTop;\n store.set('scrollUpArrowVisible', shouldShowUp);\n store.set('scrollDownArrowVisible', shouldShowDown);\n });\n const floatingContext = useFloatingRootContext({\n open,\n onOpenChange: setOpen,\n elements: {\n reference: triggerElement,\n floating: positionerElement\n }\n });\n const click = useClick(floatingContext, {\n enabled: !readOnly && !disabled,\n event: 'mousedown'\n });\n const dismiss = useDismiss(floatingContext);\n const listNavigation = useListNavigation(floatingContext, {\n enabled: !readOnly && !disabled,\n listRef,\n activeIndex,\n selectedIndex,\n disabledIndices: EMPTY_ARRAY,\n onNavigate(nextActiveIndex) {\n // Retain the highlight while transitioning out.\n if (nextActiveIndex === null && !open) {\n return;\n }\n store.set('activeIndex', nextActiveIndex);\n },\n focusItemOnHover: highlightItemOnHover\n });\n const typeahead = useTypeahead(floatingContext, {\n enabled: !readOnly && !disabled && (open || !multiple),\n listRef: labelsRef,\n activeIndex,\n selectedIndex,\n // Skip disabled items while matching so typeahead advances to the next selectable item\n // (a click can never select a disabled item and native `<select>` skips them too). Resolve\n // the disabled state from the element via the attribute-only `isElementDisabled` so the\n // hidden, force-mounted items used for closed-trigger typeahead aren't dropped by the\n // `elementsRef`/visibility filter that `disabledIndices` deliberately sidesteps.\n disabledIndices: index => isElementDisabled(listRef.current[index]),\n onMatch(index) {\n if (open) {\n store.set('activeIndex', index);\n } else {\n setValue(valuesRef.current[index], createChangeEventDetails(REASONS.none));\n }\n },\n onTyping(typing) {\n typingRef.current = typing;\n }\n });\n\n // `Select.Trigger` applies the id itself from the store, so it's deliberately not merged here.\n const mergedTriggerProps = React.useMemo(() => mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps), [click.reference, typeahead.reference, listNavigation.reference, dismiss.reference, interactionTypeProps]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [typeahead.floating, listNavigation.floating, dismiss.floating]);\n const itemProps = listNavigation.item ?? EMPTY_OBJECT;\n useOnFirstRender(() => {\n store.update({\n popupProps,\n triggerProps: mergedTriggerProps\n });\n });\n store.useSyncedValues({\n id: generatedId,\n modal,\n multiple,\n value,\n open,\n mounted,\n transitionStatus,\n popupProps,\n triggerProps: mergedTriggerProps,\n items,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n openMethod: renderedOpenMethod\n });\n const contextValue = React.useMemo(() => ({\n store,\n floatingContext,\n required,\n disabled,\n readOnly,\n multiple,\n highlightItemOnHover,\n setValue,\n setOpen,\n listRef,\n popupRef,\n scrollHandlerRef,\n handleScrollArrowVisibility,\n scrollArrowsMountedCountRef,\n itemProps,\n valueRef,\n valuesRef,\n labelsRef,\n typingRef,\n selectionRef,\n firstItemTextRef,\n selectedItemTextRef,\n validation,\n onOpenChangeComplete,\n alignItemWithTriggerActiveRef,\n initialValueRef\n }), [store, floatingContext, required, disabled, readOnly, multiple, highlightItemOnHover, setValue, setOpen, itemProps, validation, onOpenChangeComplete, handleScrollArrowVisibility]);\n const ref = useMergedRefs(inputRef, validation.inputRef);\n const hiddenInputName = multiple ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(value) || !name) {\n return null;\n }\n return value.map(v => {\n const currentSerializedValue = stringifyAsValue(v, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, value, form, name, itemToStringValue, disabled]);\n return /*#__PURE__*/_jsxs(SelectRootContext.Provider, {\n value: contextValue,\n children: [children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n onFocus() {\n // Move focus to the trigger element when the hidden input is focused.\n store.state.triggerElement?.focus({\n // Supported in Chrome from 144 (January 2026)\n focusVisible: true\n });\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n function handleChange() {\n if (multiple) {\n // Browser autofill only writes a single scalar value.\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like `value=\"US\">United States`.\n const nextValueLower = nextValue.toLowerCase();\n let matchingIndex = valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setValue` may be canceled by `onValueChange`; rely on `useValueChanged` to\n // mark the field dirty and run validation only when the value actually changes.\n setValue(matchingValue, details);\n }\n }\n store.set('forceMount', true);\n queueMicrotask(handleChange);\n }\n }),\n id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: autoComplete,\n value: serializedValue,\n disabled: disabled,\n required: required && !(multiple && hasSelectedValue),\n readOnly: readOnly,\n ref: ref,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n}","'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (!Object.is(value, state.current)) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}","export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}","'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.mjs\";\nimport { register, getInstance } from \"../fastHooks.mjs\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (!Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3)\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.value = selector(store.getSnapshot(), a1, a2, a3);\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\n\n/**\n * Wraps a component function to enable performance optimizations for internal hooks.\n *\n * **Performance Optimization:**\n * Components wrapped with `fastComponent` have access to a shared \"instance\" context that enables\n * specialized hook implementations to batch operations and reduce overhead. The wrapper creates a\n * stable instance object that persists across renders, sets it as the current context, calls\n * registered hooks before and after rendering, then clears the context. The primary benefit is\n * with `useStore`, where multiple store subscriptions within the same component are collapsed into\n * a single `useSyncExternalStore` subscription per store, significantly reducing re-render overhead.\n * This optimization is only active on React 19+; on earlier versions `useStore` falls back to a\n * separate subscription per call.\n *\n * **Requirements:**\n * - The component function should follow standard React component patterns\n * - `useStore` calls must keep a stable order and count across renders, as batched hooks are\n * matched by call index\n * - Do not rely on the instance context outside of specialized hooks\n *\n * @param fn - The component function to wrap\n * @returns A wrapped component with the same signature as the input function\n *\n * @example\n * ```tsx\n * // Wrapping a component to enable optimized useStore batching\n * export const TooltipRoot = fastComponent(function TooltipRoot(props) {\n * // These useStore calls share a single subscription\n * const open = useStore(store, (state) => state.open);\n * const disabled = useStore(store, (state) => state.disabled);\n * const value = useStore(store, (state) => state.value);\n * // ...\n * });\n * ```\n */\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\n\n/**\n * Wraps a component function with ref forwarding to enable performance optimizations for internal hooks.\n *\n * This is a convenience wrapper that combines `fastComponent` with `React.forwardRef`, enabling\n * both performance optimizations and proper ref forwarding. See `fastComponent` for details on\n * the performance benefits.\n *\n * @param fn - The component function that accepts props and a forwarded ref\n * @returns A wrapped component with ref forwarding enabled\n *\n * @example\n * ```tsx\n * // Wrapping a component with ref forwarding and optimized hooks\n * export const TooltipTrigger = fastComponentRef(function TooltipTrigger(\n * props,\n * forwardedRef\n * ) {\n * const store = useContext(TooltipContext);\n * const open = useStore(store, (state) => state.open);\n * // ... component logic with ref\n * return <button ref={forwardedRef} {...props} />;\n * });\n * ```\n */\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a function that forces a rerender.\n */\nexport function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\nconst EMPTY = 0;\nexport class Timeout {\n static create() {\n return new Timeout();\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = EMPTY;\n fn();\n }, delay); /* Node.js types are enabled in development */\n }\n isStarted() {\n return this.currentId !== EMPTY;\n }\n clear = () => {\n if (this.currentId !== EMPTY) {\n clearTimeout(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.clear;\n };\n}\n\n/**\n * A `setTimeout` with automatic cleanup and guard.\n */\nexport function useTimeout() {\n const timeout = useRefWithInit(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\nimport * as React from 'react';\nimport { useTimeout, Timeout } from '@base-ui/utils/useTimeout';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { getDelay } from \"../hooks/useHoverShared.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n hasProvider: false,\n timeoutMs: 0,\n delayRef: {\n current: 0\n },\n initialDelayRef: {\n current: 0\n },\n timeout: new Timeout(),\n currentIdRef: {\n current: null\n },\n currentContextRef: {\n current: null\n }\n});\nif (process.env.NODE_ENV !== \"production\") FloatingDelayGroupContext.displayName = \"FloatingDelayGroupContext\";\nfunction resetDelayRef(delayRef, initialDelayRef) {\n delayRef.current = initialDelayRef.current;\n}\n/**\n * Experimental next version of `FloatingDelayGroup` to become the default\n * in the future. This component is not yet stable.\n * Provides context for a group of floating elements that should share a\n * `delay`. Unlike `FloatingDelayGroup`, `useDelayGroup` with this\n * component does not cause a re-render of unrelated consumers of the\n * context when the delay changes.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const delayRef = React.useRef(delay);\n const initialDelayRef = React.useRef(delay);\n const currentIdRef = React.useRef(null);\n const currentContextRef = React.useRef(null);\n const timeout = useTimeout();\n useIsoLayoutEffect(() => {\n initialDelayRef.current = delay;\n if (!currentIdRef.current) {\n delayRef.current = delay;\n return;\n }\n delayRef.current = {\n open: getDelay(delayRef.current, 'open'),\n close: getDelay(delay, 'close')\n };\n }, [delay, currentIdRef, delayRef, initialDelayRef]);\n return /*#__PURE__*/_jsx(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n hasProvider: true,\n delayRef,\n initialDelayRef,\n currentIdRef,\n timeoutMs,\n currentContextRef,\n timeout\n }), [timeoutMs, timeout]),\n children: children\n });\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function useDelayGroup(context, options = {\n open: false\n}) {\n const {\n open\n } = options;\n const store = 'rootStore' in context ? context.rootStore : context;\n const floatingId = store.useState('floatingId');\n const groupContext = React.useContext(FloatingDelayGroupContext);\n const {\n currentIdRef,\n delayRef,\n timeoutMs,\n initialDelayRef,\n currentContextRef,\n hasProvider,\n timeout\n } = groupContext;\n const [isInstantPhase, setIsInstantPhase] = React.useState(false);\n const openRef = React.useRef(open);\n useIsoLayoutEffect(() => {\n openRef.current = open;\n }, [open]);\n useIsoLayoutEffect(() => {\n function unset() {\n currentContextRef.current?.setIsInstantPhase(false);\n currentIdRef.current = null;\n currentContextRef.current = null;\n delayRef.current = initialDelayRef.current;\n timeout.clear();\n }\n if (!currentIdRef.current) {\n return undefined;\n }\n if (!open && currentIdRef.current === floatingId) {\n setIsInstantPhase(false);\n if (timeoutMs) {\n const closingId = floatingId;\n timeout.start(timeoutMs, () => {\n // If another tooltip has taken over the group, skip resetting.\n if (store.select('open') || currentIdRef.current && currentIdRef.current !== closingId) {\n return;\n }\n unset();\n });\n return () => {\n if (openRef.current || currentIdRef.current !== closingId) {\n timeout.clear();\n }\n };\n }\n unset();\n }\n return undefined;\n }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return;\n }\n const prevContext = currentContextRef.current;\n const prevId = currentIdRef.current;\n\n // A new tooltip is opening, so cancel any pending timeout that would reset\n // the group's delay back to the initial value.\n timeout.clear();\n currentContextRef.current = {\n onOpenChange: store.setOpen,\n setIsInstantPhase\n };\n currentIdRef.current = floatingId;\n delayRef.current = {\n open: 0,\n close: getDelay(initialDelayRef.current, 'close')\n };\n if (prevId !== null && prevId !== floatingId) {\n setIsInstantPhase(true);\n prevContext?.setIsInstantPhase(true);\n prevContext?.onOpenChange(false, createChangeEventDetails(REASONS.none));\n } else {\n setIsInstantPhase(false);\n prevContext?.setIsInstantPhase(false);\n }\n }, [open, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);\n useIsoLayoutEffect(() => {\n return () => {\n if (currentIdRef.current === floatingId) {\n currentContextRef.current = null;\n if (!openRef.current) {\n return;\n }\n currentIdRef.current = null;\n resetDelayRef(delayRef, initialDelayRef);\n timeout.clear();\n }\n };\n }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);\n return React.useMemo(() => ({\n hasProvider,\n delayRef,\n isInstantPhase\n }), [hasProvider, delayRef, isInstantPhase]);\n}","export * as os from \"./os.mjs\";\nexport * as engine from \"./engine.mjs\";\nexport * as screenReader from \"./screen-reader.mjs\";\nexport * as env from \"./env.mjs\";","import { lowerUserAgent, lowerPlatform, maxTouchPoints } from \"./shared.mjs\";\n\n// iPadOS 13+ reports `MacIntel` for `navigator.platform`; disambiguated via\n// `maxTouchPoints` so iPad is classified as iOS, not macOS.\n// https://github.com/mui/base-ui/issues/1309\n/** iPhone, iPad (including iPadOS 13+ reporting as macOS), iPod. */\nexport const ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === 'macintel' && maxTouchPoints > 1;\n\n/** Android phones, tablets, and embedded Android browsers. */\nconst ANDROID_STRING = 'android';\nexport const android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);\n\n/** macOS desktop. Excludes iPadOS, which reports as `MacIntel`. */\nexport const mac = !ios && lowerPlatform.startsWith('mac');\n\n/** Windows desktop. */\nexport const windows = lowerPlatform.startsWith('win');\n\n/** Linux desktop (including Chrome OS). */\nexport const linux = !android && /^(linux|chrome os)/.test(lowerPlatform);\n\n/** Any Apple OS (`mac || ios`). */\nexport const apple = mac || ios;","/**\n * Reads `navigator.userAgent` / `navigator.platform` (legacy but universally\n * supported) into a normalized shape. In development, prefers the modern\n * `navigator.userAgentData` API on Chromium to avoid DevTools warnings about\n * the deprecated reads; that branch is dead-code-eliminated in production\n * builds to keep the bundle small.\n *\n * Returns empty/zero values when `navigator` is undefined (SSR), so every\n * derived flag safely evaluates to `false`.\n */\nfunction readRawData() {\n if (typeof navigator === 'undefined') {\n return {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return {\n userAgent: uaData.brands.map(({\n brand,\n version\n }) => `${brand}/${version}`).join(' '),\n platform: uaData.platform ?? navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n }\n }\n return {\n userAgent: navigator.userAgent,\n platform: navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n}\nconst {\n userAgent,\n platform,\n maxTouchPoints\n} = readRawData();\nexport const lowerUserAgent = userAgent.toLowerCase();\nexport const lowerPlatform = platform.toLowerCase();\nexport { maxTouchPoints };","import { lowerUserAgent } from \"./shared.mjs\";\n\n// WebKit (Safari, all iOS browsers, GNOME Web). Distinguished from Blink by\n// the legacy `-webkit-backdrop-filter` name — Blink forked from WebKit in 2013\n// and only ships the unprefixed `backdrop-filter`.\n/** WebKit: Safari, all iOS browsers, GNOME Web. Excludes Blink. */\nexport const webkit = typeof CSS !== 'undefined' && !!CSS.supports?.('-webkit-backdrop-filter:none');\n\n// Anchored to `!webkit` so engines are mutually exclusive by construction.\n// Firefox-on-iOS uses WebKit (its UA marker is `FxiOS/`, not `Firefox/`); the\n// `!webkit` prefix also defends against future iOS-browser UA changes that\n// might inject `Firefox` into a WebKit-based UA.\n/** Gecko: Firefox. */\nexport const gecko = !webkit && lowerUserAgent.includes('firefox');\n\n// All Chromium-based browsers ship `Chrome/` or `Chromium/` in their UA — both\n// share the `chrom` prefix, so a single substring check covers Chrome, Edge,\n// Opera, Brave, etc. Chrome-on-iOS uses `CriOS/` and stays WebKit. The positive\n// UA check also makes this SSR-safe — an empty UA matches nothing.\n/** Blink: Chrome, Edge, Opera, Brave, and other Chromium-based browsers. */\nexport const blink = !webkit && lowerUserAgent.includes('chrom');","import { apple } from \"./os.mjs\";\n\n// Whether a screen reader is *actually* running cannot be detected. These flags\n// identify platforms where a specific screen reader could be active. VoiceOver\n// is the system screen reader on Apple platforms and works with every browser\n// there, so the flag is purely an OS check; engine-specific quirks (e.g. the\n// NSAccessibility virtual-cursor focus path) should be gated at the call site.\n/**\n * The user *may* be using VoiceOver — actual activation is not detectable.\n * True on any Apple platform (macOS, iOS, iPadOS).\n */\nexport const voiceOver = apple;","import { lowerUserAgent } from \"./shared.mjs\";\n\n/** Running in jsdom or HappyDOM (used by unit tests). */\nexport const jsdom = /jsdom|happydom/.test(lowerUserAgent);","import { platform } from '@base-ui/utils/platform';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (platform.os.android && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (platform.env.jsdom) {\n return false;\n }\n return !platform.os.android && event.width === 0 && event.height === 0 || platform.os.android && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}","export const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';\nexport const ACTIVE_KEY = 'active';\nexport const SELECTED_KEY = 'selected';\nexport const TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';","import { isShadowRoot } from '@floating-ui/utils/dom';\nexport function activeElement(doc) {\n let element = doc.activeElement;\n while (element?.shadowRoot?.activeElement != null) {\n element = element.shadowRoot.activeElement;\n }\n return element;\n}\nexport function contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode?.();\n\n // First, attempt with the faster native method.\n if (parent.contains(child)) {\n return true;\n }\n\n // Then fall back to traversing out of shadow roots when needed.\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS assumes `composedPath()` always exists, but older browsers without\n // shadow DOM support still fall back to `target`.\n return event.target;\n}","import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.mjs\";\nimport { activeElement, contains, getTarget } from \"../../internals/shadowDom.mjs\";\nexport { activeElement, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute('data-trigger-disabled');\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute('data-trigger-disabled');\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return element?.closest(`button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || platform.env.jsdom) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}","import { isMouseLikePointerType } from \"../utils/event.mjs\";\nexport { isTargetInsideEnabledTrigger as isInsideEnabledTrigger } from \"../utils/element.mjs\";\nfunction resolveValue(value, pointerType) {\n if (pointerType != null && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function getDelay(value, prop, pointerType) {\n const result = resolveValue(value, pointerType);\n if (typeof result === 'number') {\n return result;\n }\n return result?.[prop];\n}\nexport function getRestMs(value) {\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function isClickLikeOpenEvent(openEventType, interactedInside) {\n return interactedInside || openEventType === 'click' || openEventType === 'mousedown';\n}\nexport function isHoverOpenEvent(openEventType) {\n return openEventType?.includes('mouse') && openEventType !== 'mousedown';\n}","'use client';\n\nimport * as React from 'react';\nimport { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { platform } from '@base-ui/utils/platform';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { activeElement, contains, getTarget, isTypeableCombobox, getFloatingFocusElement, isTypeableElement } from \"../utils/element.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nimport { tabbable, focusable, isOutsideEvent, isTabbable, getNextTabbable, getPreviousTabbable } from \"../utils/tabbable.mjs\";\nimport { getNodeAncestors, getNodeChildren } from \"../utils/nodes.mjs\";\nimport { isElementVisible } from \"../utils/composite.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { markOthers } from \"../utils/markOthers.mjs\";\nimport { usePortalContext } from \"./FloatingPortal.mjs\";\nimport { useFloatingTree } from \"./FloatingTree.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { resolveRef } from \"../../utils/resolveRef.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getEventType(event, lastInteractionType) {\n const win = ownerWindow(getTarget(event));\n if (event instanceof win.KeyboardEvent) {\n return 'keyboard';\n }\n if (event instanceof win.FocusEvent) {\n // Focus events can be caused by a preceding pointer interaction (e.g., focusout on outside press).\n // Prefer the last known pointer type if provided, else treat as keyboard.\n return lastInteractionType || 'keyboard';\n }\n if ('pointerType' in event) {\n return event.pointerType || 'keyboard';\n }\n if ('touches' in event) {\n return 'touch';\n }\n if (event instanceof win.MouseEvent) {\n // onClick events may not contain pointer events, and will fall through to here\n return lastInteractionType || (event.detail === 0 ? 'keyboard' : 'mouse');\n }\n return '';\n}\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(entry => {\n return entry.deref()?.isConnected;\n });\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(new WeakRef(element));\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();\n}\nfunction getFirstTabbableElement(container) {\n if (!container) {\n return null;\n }\n if (isTabbable(container)) {\n return container;\n }\n return tabbable(container)[0] || container;\n}\nfunction handleTabIndex(floatingFocusElement) {\n if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {\n return;\n }\n if (!floatingFocusElement.getAttribute('role')?.includes('dialog')) {\n return;\n }\n const focusableElements = focusable(floatingFocusElement);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n // Mark our own write so the externally-managed early-return above doesn't\n // mistake it for a user-authored `tabindex` and freeze management.\n floatingFocusElement.setAttribute('data-tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n * @internal\n */\nexport function FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n initialFocus = true,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n closeOnFocusOut = true,\n openInteractionType = '',\n nextFocusableElement,\n previousFocusableElement,\n beforeContentFocusGuardRef,\n externalTree,\n getInsideElements\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const domReference = store.useState('domReferenceElement');\n const floating = store.useState('floatingElement');\n const {\n events,\n dataRef\n } = store.context;\n const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);\n const ignoreInitialFocus = initialFocus === false;\n // A typeable combobox reference (e.g. input/textarea) with `initialFocus={false}`\n // has different focus semantics: focus is not trapped inside the floating element,\n // so in the modal case the guards are not rendered, but `aria-hidden` is still\n // applied to the outside nodes.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n const initialFocusRef = useValueAsRef(initialFocus);\n const returnFocusRef = useValueAsRef(returnFocus);\n const openInteractionTypeRef = useValueAsRef(openInteractionType);\n const openRef = useValueAsRef(open);\n const tree = useFloatingTree(externalTree);\n const portalContext = usePortalContext();\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const pointerDownOutsideRef = React.useRef(false);\n const lastFocusedTabbableRef = React.useRef(null);\n const closeTypeRef = React.useRef('');\n const lastInteractionTypeRef = React.useRef('');\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);\n const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);\n const blurTimeout = useTimeout();\n const pointerDownTimeout = useTimeout();\n const restoreFocusFrame = useAnimationFrame();\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useStableCallback((container = floatingFocusElement) => {\n return container ? tabbable(container) : [];\n });\n const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);\n\n // Prevent Tab from escaping the modal when there are no tabbable elements.\n React.useEffect(() => {\n if (disabled || !modal) {\n return undefined;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n }\n }\n const doc = ownerDocument(floatingFocusElement);\n return addEventListener(doc, 'keydown', onKeyDown);\n }, [disabled, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);\n\n // Track pointer/keyboard interactions to disambiguate focus and outside presses.\n React.useEffect(() => {\n if (disabled || !open) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n function clearPointerDownOutside() {\n pointerDownOutsideRef.current = false;\n }\n function onPointerDown(event) {\n const target = getTarget(event);\n const insideElements = getResolvedInsideElements();\n const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some(element => element === target || contains(element, target));\n pointerDownOutsideRef.current = !pointerTargetInside;\n lastInteractionTypeRef.current = event.pointerType || 'keyboard';\n if (target?.closest(`[${CLICK_TRIGGER_IDENTIFIER}]`)) {\n isPointerDownRef.current = true;\n // Reset on the next tick so a single click on a click-trigger doesn't\n // permanently suppress focus-out closing for the lifetime of the instance.\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n }\n function onKeyDown() {\n lastInteractionTypeRef.current = 'keyboard';\n }\n return mergeCleanups(addEventListener(doc, 'pointerdown', onPointerDown, true), addEventListener(doc, 'pointerup', clearPointerDownOutside, true), addEventListener(doc, 'pointercancel', clearPointerDownOutside, true), addEventListener(doc, 'keydown', onKeyDown, true),\n // Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)\n // if the popup dismissed between pointerdown and pointerup.\n clearPointerDownOutside);\n }, [disabled, floating, domReference, floatingFocusElement, open, portalContext, pointerDownTimeout, getResolvedInsideElements]);\n\n // Close on focus out and restore focus within the floating tree when needed.\n React.useEffect(() => {\n if (disabled || !closeOnFocusOut) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusIn(event) {\n const target = getTarget(event);\n if (isTabbable(target)) {\n lastFocusedTabbableRef.current = target;\n }\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget(event);\n\n // When focus is lost to the body (e.g. on a backdrop press), record the element that\n // had focus so a confirmation dialog opened while the body is focused can return focus\n // to it. Scoped to `modal` to avoid non-modal popups polluting the shared stack.\n if (modal && relatedTarget == null && target != null && contains(floating, target)) {\n addPreviouslyFocusedElement(target);\n }\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const triggers = store.context.triggerElements;\n const insideElements = getResolvedInsideElements();\n const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement);\n }\n\n // Restore focus to the previously focused tabbable element to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n // If explicitly requested to restore focus to the popup container, do not search\n // for the next/previous tabbable element.\n if (restoreFocus === 'popup') {\n // If the focused element is removed on pointerdown, the browser\n // tries to move focus to it right after the `.focus()` call above,\n // but because it's removed in the same tick, focus is lost instead.\n // Re-focusing asynchronously (next frame) wins that race.\n restoreFocusFrame.request(() => {\n floatingFocusElement.focus();\n });\n return;\n }\n }\n const tabbableContent = getTabbableContent();\n const prevTabbable = lastFocusedTabbableRef.current;\n const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n // For an \"untrapped\" typeable combobox (input role=combobox with\n // initialFocus=false), re-opening the popup and tabbing out should still close it even\n // when the previously focused element (e.g. the next tabbable outside the popup) is\n // focused again. Otherwise, the popup remains open on the second Tab sequence:\n // click input -> Tab (closes) -> click input -> Tab.\n // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.\n isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {\n preventReturnFocusRef.current = true;\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event));\n }\n });\n }\n function markInsideReactTree() {\n if (pointerDownOutsideRef.current) {\n return;\n }\n dataRef.current.insideReactTree = true;\n blurTimeout.start(0, () => {\n dataRef.current.insideReactTree = false;\n });\n }\n const domReferenceElement = isHTMLElement(domReference) ? domReference : null;\n if (!floating && !domReferenceElement) {\n return undefined;\n }\n return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, 'pointerdown', handlePointerDown), floating && addEventListener(floating, 'focusin', handleFocusIn), floating && addEventListener(floating, 'focusout', handleFocusOutside), floating && portalContext && addEventListener(floating, 'focusout', markInsideReactTree, true));\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Hide everything outside the floating tree from assistive tech while open.\n React.useEffect(() => {\n if (disabled || !floating || !open) {\n return undefined;\n }\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;\n const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];\n const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const ariaHiddenCleanup = markOthers(insideElements, {\n ariaHidden: modal || isUntrappedTypeableCombobox,\n mark: false\n });\n const markerInsideElements = [floating, ...portalNodes].filter(x => x != null);\n const markerCleanup = markOthers(markerInsideElements);\n return () => {\n markerCleanup();\n ariaHiddenCleanup();\n };\n }, [open, disabled, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Focus the initial element when the floating element opens.\n useIsoLayoutEffect(() => {\n if (!open || disabled || !isHTMLElement(floatingFocusElement)) {\n return;\n }\n closeTypeRef.current = '';\n lastInteractionTypeRef.current = '';\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const initialFocusValueOrFn = initialFocusRef.current;\n const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {\n return;\n }\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (focusAlreadyInsideFloatingEl) {\n return;\n }\n let focusableElements = null;\n const getDefaultFocusElement = () => {\n if (focusableElements == null) {\n focusableElements = getTabbableContent(floatingFocusElement);\n }\n return focusableElements[0] || floatingFocusElement;\n };\n let elToFocus;\n if (resolvedInitialFocus === true || resolvedInitialFocus === null) {\n elToFocus = getDefaultFocusElement();\n } else {\n elToFocus = resolveRef(resolvedInitialFocus);\n }\n elToFocus = elToFocus || getDefaultFocusElement();\n const hadFocusInside = contains(floatingFocusElement, activeElement(doc));\n\n // enqueueFocus returns a rAF-cancel function; we intentionally don't cancel this focus.\n void enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement,\n shouldFocus() {\n // This focus is queued on the next animation frame. If the floating element has closed\n // before it runs — e.g. tabbing out of a kept-mounted popup — don't pull focus back\n // onto the initial element after it has legitimately moved elsewhere.\n if (!openRef.current) {\n return false;\n }\n if (hadFocusInside) {\n return true;\n }\n const currentActiveElement = activeElement(doc);\n const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);\n return !focusMovedInside;\n }\n });\n });\n }, [disabled, open, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef]);\n\n // Track return focus targets and restore focus on unmount/close.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n const elementFocusedBeforeOpen = activeElement(doc);\n // Only an explicit `null` interaction type represents a programmatic open.\n // `undefined` is normalized to `''` by the prop default, so it never reaches\n // here as nullish and is intentionally not treated as programmatic.\n const preferPreviousFocus = openInteractionTypeRef.current == null;\n addPreviouslyFocusedElement(elementFocusedBeforeOpen);\n function onOpenChangeLocal(details) {\n if (!details.open) {\n closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);\n }\n if (details.reason === REASONS.triggerHover && details.nativeEvent.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (details.reason !== REASONS.outsidePress) {\n return;\n }\n if (details.nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {\n preventReturnFocusRef.current = false;\n } else {\n // On outside press, only return focus to the reference when the browser supports the\n // `focus({ preventScroll })` option; without it, restoring focus scrolls the page.\n // Chrome on Android and Samsung Internet still don't support `preventScroll`\n // (https://issues.chromium.org/issues/41453122), so the runtime check keeps return\n // focus disabled there to avoid the scroll jump.\n let isPreventScrollSupported = false;\n ownerDocument(floatingFocusElement).createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n function getReturnElement(closeType) {\n const returnFocusValueOrFn = returnFocusRef.current;\n let resolvedReturnFocusValue = typeof returnFocusValueOrFn === 'function' ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedReturnFocusValue === undefined || resolvedReturnFocusValue === false) {\n return null;\n }\n if (resolvedReturnFocusValue === null) {\n resolvedReturnFocusValue = true;\n }\n const referenceReturnElement = domReference?.isConnected ? domReference : null;\n const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== 'body' ? elementFocusedBeforeOpen : null;\n let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;\n if (!defaultReturnElement) {\n defaultReturnElement = getPreviouslyFocusedElement() || null;\n }\n if (typeof resolvedReturnFocusValue === 'boolean') {\n return defaultReturnElement;\n }\n return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;\n }\n return () => {\n events.off('openchange', onOpenChangeLocal);\n const activeEl = activeElement(doc);\n const insideElements = getResolvedInsideElements();\n const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some(element => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some(node => contains(node.context?.elements.floating, activeEl));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const returnFocusValueOrFn = returnFocusRef.current;\n const closeType = closeTypeRef.current;\n const returnElement = getReturnElement(closeType);\n queueMicrotask(() => {\n // `returnElement` if it is tabbable, otherwise its first tabbable child,\n // otherwise `returnElement` itself (which may not be tabbable at all).\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n const hasExplicitReturnFocus = typeof returnFocusValueOrFn !== 'boolean';\n if (returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n !hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n const focusOptions = {\n preventScroll: true\n };\n if (closeType === 'keyboard') {\n focusOptions.focusVisible = true;\n }\n tabbableReturnElement.focus(focusOptions);\n }\n preventReturnFocusRef.current = false;\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);\n\n // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus\n // when the popup unmounts from the DOM.\n // By blurring it before the popup unmounts, we can prevent this behavior.\n useIsoLayoutEffect(() => {\n if (!platform.engine.webkit || open || !floating) {\n return;\n }\n const activeEl = activeElement(ownerDocument(floating));\n if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {\n return;\n }\n if (contains(floating, activeEl)) {\n activeEl.blur();\n }\n }, [open, floating]);\n\n // Synchronize the focus manager state (modal, closeOnFocusOut, open, etc.) to the\n // FloatingPortal context, which uses it to decide whether to render its own guards.\n useIsoLayoutEffect(() => {\n if (disabled || !portalContext) {\n return undefined;\n }\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange: store.setOpen,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);\n\n // Keep the floating element tabIndex in sync and clear stale focus records.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n handleTabIndex(floatingFocusElement);\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled, floatingFocusElement]);\n const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableContent();\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(els[els.length - 1]);\n } else if (portalContext?.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n } else {\n resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();\n }\n }\n }\n }), children, shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(getTabbableContent()[0]);\n } else if (portalContext?.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n } else {\n resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();\n }\n }\n }\n })]\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n // Unlike NVDA and JAWS, VoiceOver's virtual cursor triggers `onFocus` as\n // it moves — but only on focusable/role-button elements through WebKit's\n // NSAccessibility path. Setting `role=\"button\"` lets the focus trap catch\n // the cursor.\n if (platform.screenReader.voiceOver && platform.engine.webkit) {\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { floor } from '@floating-ui/utils';\nimport { getComputedStyle } from '@floating-ui/utils/dom';\nimport { stopEvent } from \"./event.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"./constants.mjs\";\nexport function isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nexport function isIndexOutOfListBounds(list, index) {\n return index < 0 || index >= list.length;\n}\nexport function getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n disabledIndices\n });\n}\nexport function getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nexport function findNonDisabledListIndex(list, {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n} = {}) {\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));\n return index;\n}\nexport function getGridNavigatedIndex(list, {\n event,\n orientation,\n loopFocus,\n onLoop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n}) {\n let nextIndex = prevIndex;\n let verticalDirection;\n if (event.key === ARROW_UP) {\n verticalDirection = 'up';\n } else if (event.key === ARROW_DOWN) {\n verticalDirection = 'down';\n }\n if (verticalDirection) {\n // -------------------------------------------------------------------------\n // Detect row structure only when handling vertical navigation. This keeps\n // the non-vertical key paths free from row inference work.\n // -------------------------------------------------------------------------\n const rows = [];\n const rowIndexMap = [];\n let hasRoleRow = false;\n let visibleItemCount = 0;\n {\n let currentRowEl = null;\n let currentRowIndex = -1;\n list.forEach((el, idx) => {\n if (el == null) {\n return;\n }\n visibleItemCount += 1;\n const rowEl = el.closest('[role=\"row\"]');\n if (rowEl) {\n hasRoleRow = true;\n }\n if (rowEl !== currentRowEl || currentRowIndex === -1) {\n currentRowEl = rowEl;\n currentRowIndex += 1;\n rows[currentRowIndex] = [];\n }\n rows[currentRowIndex].push(idx);\n rowIndexMap[idx] = currentRowIndex;\n });\n }\n let hasDomRows = false;\n let inferredDomCols = 0;\n if (hasRoleRow) {\n for (const row of rows) {\n const rowLength = row.length;\n if (rowLength > inferredDomCols) {\n inferredDomCols = rowLength;\n }\n if (rowLength !== cols) {\n hasDomRows = true;\n }\n }\n }\n const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;\n const verticalCols = inferredDomCols || cols;\n const navigateVertically = direction => {\n if (!hasDomRows || prevIndex === -1) {\n return undefined;\n }\n const currentRow = rowIndexMap[prevIndex];\n if (currentRow == null) {\n return undefined;\n }\n const colInRow = rows[currentRow].indexOf(prevIndex);\n const step = direction === 'up' ? -1 : 1;\n for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {\n if (nextRow < 0 || nextRow >= rows.length) {\n if (!loopFocus || hasVirtualizedGaps) {\n return undefined;\n }\n nextRow = nextRow < 0 ? rows.length - 1 : 0;\n if (onLoop) {\n const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);\n const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];\n const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);\n nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;\n }\n }\n const targetRow = rows[nextRow];\n for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {\n const candidate = targetRow[col];\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n const navigateVerticallyWithInferredRows = direction => {\n if (!hasVirtualizedGaps || prevIndex === -1) {\n return undefined;\n }\n const colInRow = prevIndex % verticalCols;\n const rowStep = direction === 'up' ? -verticalCols : verticalCols;\n const lastRowStart = maxIndex - maxIndex % verticalCols;\n const rowCount = floor(maxIndex / verticalCols) + 1;\n for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {\n if (rowStart < 0 || rowStart > maxIndex) {\n if (!loopFocus) {\n return undefined;\n }\n rowStart = rowStart < 0 ? lastRowStart : 0;\n }\n const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);\n for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n if (stop) {\n stopEvent(event);\n }\n const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);\n if (verticalCandidate !== undefined) {\n nextIndex = verticalCandidate;\n } else if (prevIndex === -1) {\n nextIndex = verticalDirection === 'up' ? maxIndex : minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n amount: verticalCols,\n decrement: verticalDirection === 'up',\n disabledIndices\n });\n if (loopFocus) {\n if (verticalDirection === 'up' && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {\n const col = prevIndex % verticalCols;\n const maxCol = maxIndex % verticalCols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - verticalCols;\n }\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (verticalDirection === 'down' && prevIndex + verticalCols > maxIndex) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex % verticalCols - verticalCols,\n amount: verticalCols,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n }\n }\n if (isIndexOutOfListBounds(list, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(list, nextIndex)) {\n if (loopFocus && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nexport function createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach(({\n width,\n height\n }, index) => {\n if (width > cols) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i += 1) {\n for (let j = 0; j < height; j += 1) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex += 1;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nexport function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) {\n return -1;\n }\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n default:\n return -1;\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nexport function getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nexport function isListIndexDisabled(list, index, disabledIndices) {\n const isExplicitlyDisabled = typeof disabledIndices === 'function' ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;\n if (isExplicitlyDisabled) {\n return true;\n }\n const element = list[index];\n if (!element) {\n return false;\n }\n if (!isElementVisible(element)) {\n return true;\n }\n\n // A natively disabled element can never receive focus, so it must always be\n // skipped, even when `disabledIndices` marks it as enabled. Only\n // `aria-disabled` items can be focusable-while-disabled.\n if (element.matches(':disabled')) {\n return true;\n }\n return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');\n}\nexport function isHiddenByStyles(styles) {\n return styles.visibility === 'hidden' || styles.visibility === 'collapse';\n}\nexport function isElementVisible(element, styles = element ? getComputedStyle(element) : null) {\n if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {\n return false;\n }\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return styles.display !== 'none' && styles.display !== 'contents';\n}","import { getComputedStyle, getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.mjs\";\nimport { isElementVisible } from \"./composite.mjs\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isAncestor = current !== element;\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (isAncestor && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {\n return false;\n }\n }\n return true;\n}\nfunction isVisibleInTabbableTree(element, isAncestor) {\n const styles = getComputedStyle(element);\n if (!isAncestor) {\n return isElementVisible(element, styles);\n }\n return styles.display !== 'none';\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nfunction getTabbableNearElement(referenceElement, dir) {\n if (!referenceElement) {\n return null;\n }\n const list = tabbable(ownerDocument(referenceElement).body);\n const elementCount = list.length;\n if (elementCount === 0) {\n return null;\n }\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const nextIndex = (index + dir + elementCount) % elementCount;\n return list[nextIndex];\n}\nexport function getTabbableAfterElement(referenceElement) {\n return getTabbableNearElement(referenceElement, 1);\n}\nexport function getTabbableBeforeElement(referenceElement) {\n return getTabbableNearElement(referenceElement, -1);\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getNodeChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","import { NOOP } from '@base-ui/utils/empty';\nlet rafId = 0;\nexport function enqueueFocus(el, options = {}) {\n const {\n preventScroll = false,\n sync = false,\n shouldFocus\n } = options;\n cancelAnimationFrame(rafId);\n function exec() {\n if (shouldFocus && !shouldFocus()) {\n return;\n }\n el?.focus({\n preventScroll\n });\n }\n if (sync) {\n exec();\n return NOOP;\n }\n const currentRafId = requestAnimationFrame(exec);\n rafId = currentRafId;\n return () => {\n if (rafId === currentRafId) {\n cancelAnimationFrame(currentRafId);\n rafId = 0;\n }\n };\n}","// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nimport { getNodeName, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nconst counters = {\n inert: new WeakMap(),\n 'aria-hidden': new WeakMap()\n};\nconst markerName = 'data-base-ui-inert';\nconst uncontrolledElementsSets = {\n inert: new WeakSet(),\n 'aria-hidden': new WeakSet()\n};\nlet markerCounterMap = new WeakMap();\nlet lockCount = 0;\nfunction getUncontrolledElementsSet(controlAttribute) {\n return uncontrolledElementsSets[controlAttribute];\n}\nfunction unwrapHost(node) {\n if (!node) {\n return null;\n }\n return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);\n}\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nconst buildKeepSet = targets => {\n const keep = new Set();\n targets.forEach(target => {\n let node = target;\n while (node && !keep.has(node)) {\n keep.add(node);\n node = node.parentNode;\n }\n });\n return keep;\n};\nconst collectOutsideElements = (root, keepElements, stopElements) => {\n const outside = [];\n const walk = parent => {\n if (!parent || stopElements.has(parent)) {\n return;\n }\n Array.from(parent.children).forEach(node => {\n if (getNodeName(node) === 'script') {\n return;\n }\n if (keepElements.has(node)) {\n walk(node);\n } else {\n outside.push(node);\n }\n });\n };\n walk(root);\n return outside;\n};\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert, {\n mark = true\n}) {\n let controlAttribute = null;\n if (inert) {\n controlAttribute = 'inert';\n } else if (ariaHidden) {\n controlAttribute = 'aria-hidden';\n }\n let counterMap = null;\n let uncontrolledElementsSet = null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];\n const hiddenElements = [];\n const markedElements = [];\n if (controlAttribute) {\n const map = counters[controlAttribute];\n const currentUncontrolledElementsSet = getUncontrolledElementsSet(controlAttribute);\n uncontrolledElementsSet = currentUncontrolledElementsSet;\n counterMap = map;\n const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll('[aria-live]')));\n const controlElements = avoidElements.concat(ariaLiveElements);\n const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));\n controlTargets.forEach(node => {\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (map.get(node) || 0) + 1;\n map.set(node, counterValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n currentUncontrolledElementsSet.add(node);\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, controlAttribute === 'inert' ? '' : 'true');\n }\n });\n }\n if (mark) {\n markerTargets.forEach(node => {\n const markerValue = (markerCounterMap.get(node) || 0) + 1;\n markerCounterMap.set(node, markerValue);\n markedElements.push(node);\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n });\n }\n lockCount += 1;\n return () => {\n if (counterMap) {\n hiddenElements.forEach(element => {\n const currentCounterValue = counterMap.get(element) || 0;\n const counterValue = currentCounterValue - 1;\n counterMap.set(element, counterValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet?.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet?.delete(element);\n }\n });\n }\n if (mark) {\n markedElements.forEach(element => {\n const markerValue = (markerCounterMap.get(element) || 0) - 1;\n markerCounterMap.set(element, markerValue);\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n }\n lockCount -= 1;\n if (!lockCount) {\n counters.inert = new WeakMap();\n counters['aria-hidden'] = new WeakMap();\n uncontrolledElementsSets.inert = new WeakSet();\n uncontrolledElementsSets['aria-hidden'] = new WeakSet();\n markerCounterMap = new WeakMap();\n }\n };\n}\nexport function markOthers(avoidElements, options = {}) {\n const {\n ariaHidden = false,\n inert = false,\n mark = true\n } = options;\n const body = ownerDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, {\n mark\n });\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n node: portalNode,\n // `id` and `render` props can override or remove the generated ID. Use the exact\n // rendered value so `aria-owns` never points at an ID absent from the DOM.\n nodeId: /*#__PURE__*/React.isValidElement(portalElement) ? portalElement.props.id : undefined,\n subtree: portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n container,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n nodeId: portalNodeId,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n useIsoLayoutEffect(() => {\n if (!portalNode || open !== true || !focusInsideDisabledRef.current) {\n return;\n }\n\n // Restore tabbability before the focus manager's queued focus-on-open step runs.\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n \"aria-owns\": portalNodeId,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","import { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\n\n/**\n * Stores and manages floating elements in a tree structure.\n * This is a backing store for the `FloatingTree` component.\n */\nexport class FloatingTreeStore {\n nodesRef = {\n current: []\n };\n events = createEventEmitter();\n addNode(node) {\n this.nodesRef.current.push(node);\n }\n removeNode(node) {\n const index = this.nodesRef.current.findIndex(n => n === node);\n if (index !== -1) {\n this.nodesRef.current.splice(index, 1);\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getTarget, isTypeableElement } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType, isVirtualPointerEvent } from \"../utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nexport function useClick(context, props = {}) {\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n stickIfOpen = true,\n touchOpenDelay = 0,\n reason = REASONS.triggerPress\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const dataRef = store.context.dataRef;\n const pointerTypeRef = React.useRef(undefined);\n const frame = useAnimationFrame();\n const touchOpenTimeout = useTimeout();\n const reference = React.useMemo(() => {\n function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {\n const details = createChangeEventDetails(reason, nativeEvent, target);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n }\n function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {\n const openEvent = dataRef.current.openEvent;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== currentTarget;\n if (open && hasClickedOnInactiveTrigger) {\n // Moving between triggers should always open the newly active one.\n return true;\n }\n if (!open) {\n // A closed popup should open on the next press.\n return true;\n }\n if (!toggle) {\n // Non-toggle mode never closes on a repeated trigger press.\n return true;\n }\n if (openEvent && stickIfOpen) {\n // Preserve hover/focus-opened popups until the matching click-like event closes them.\n return !isClickLikeOpenEvent(openEvent.type);\n }\n\n // Otherwise, a repeated click toggles the popup closed.\n return false;\n }\n return {\n onPointerDown(event) {\n // Screen reader activations (Android TalkBack, desktop screen readers) report a\n // mouse-like `pointerType`, but `ignoreMouse` must not drop them: hover logic cannot\n // open for a virtual press since there is no real pointer movement to wait for.\n // Virtual `touch` presses (iOS VoiceOver) keep their type so `touchOpenDelay` applies.\n pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? 'virtual' : event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n const nativeEvent = event.nativeEvent;\n const open = store.select('open');\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown');\n\n // Animations sometimes won't run on a typeable element if using a rAF.\n // Focus is always set on these elements. For touch, we may delay opening.\n const target = getTarget(nativeEvent);\n if (isTypeableElement(target)) {\n setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType);\n return;\n }\n\n // Capture the currentTarget before the rAF.\n // as React sets it to null after the event handler completes.\n const eventCurrentTarget = event.currentTarget;\n\n // Wait until focus is set on the element. This is an alternative to\n // `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.\n frame.request(() => {\n setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);\n });\n },\n onClick(event) {\n if (eventOption === 'mousedown-only') {\n return;\n }\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerType) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const open = store.select('open');\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown' || openEventType === 'keydown' || openEventType === 'keyup');\n setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);\n },\n onKeyDown() {\n pointerTypeRef.current = undefined;\n }\n };\n }, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);\n return React.useMemo(() => enabled ? {\n reference\n } : EMPTY_OBJECT, [enabled, reference]);\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { getWindow } from '@floating-ui/utils/dom';\nimport { contains, getTarget } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../utils/event.mjs\";\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n const domRect = domElement?.getBoundingClientRect() || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(data.dataRef.current.openEvent?.type || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nexport function useClientPoint(context, props = {}) {\n const {\n enabled = true,\n axis = 'both'\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floating = store.useState('floatingElement');\n const domReference = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const resetReference = useStableCallback(reference => {\n store.set('positionReference', reference);\n });\n const setReference = useStableCallback((newX, newY, referenceElement) => {\n if (initialRef.current) {\n return;\n }\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n store.set('positionReference', createVirtualElement(referenceElement ?? domReference, {\n x: newX,\n y: newY,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useStableCallback(event => {\n if (!open) {\n setReference(event.clientX, event.clientY, event.currentTarget);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReference(event.clientX, event.clientY, event.currentTarget);\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n React.useEffect(() => {\n if (!enabled) {\n resetReference(domReference);\n return undefined;\n }\n if (!openCheck) {\n return undefined;\n }\n function cleanupListener() {\n cleanupListenerRef.current?.();\n cleanupListenerRef.current = null;\n }\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n cleanupListener();\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n cleanupListenerRef.current = addEventListener(win, 'mousemove', handleMouseMove);\n } else {\n resetReference(domReference);\n }\n return cleanupListener;\n }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]);\n\n // Clear virtual cursor references when the hook unmounts. Enabled flips are handled above.\n React.useEffect(() => () => {\n store.set('positionReference', null);\n }, [store]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(event) {\n setPointerType(event.pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(context, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return clearInsideReactTree;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const compositionTimeout = new Timeout();\n const preventedPressSuppressionTimeout = new Timeout();\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // In intentional mode, a press that starts inside and ends outside gets\n // one suppressed outside click. Run this after inside-target checks so\n // inside clicks don't consume the one-shot suppression.\n if (getOutsidePressEvent() === 'intentional' && suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n if (event.type === 'pointerdown') {\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const doc = ownerDocument(floatingElement);\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, true), addEventListener(doc, 'touchmove', handleTouchMoveCapture, true), addEventListener(doc, 'touchend', handleTouchEndCapture, true)));\n return () => {\n unsubscribe();\n compositionTimeout.clear();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n clearInsideReactTree();\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloating as usePosition } from '@floating-ui/react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { useFloatingRootContext } from \"./useFloatingRootContext.mjs\";\n\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/useFloating\n */\nexport function useFloating(options = {}) {\n const internalStore = useFloatingRootContext(options);\n const store = options.rootContext || internalStore;\n return useFloatingWithStore(options, store);\n}\n\n/**\n * Base UI's private `useFloating` path. The caller must supply the root store, so this skips the\n * internal root-context hook used by the public Floating UI-compatible API.\n */\nexport function useBaseUIFloating(options) {\n return useFloatingWithStore(options, options.rootContext);\n}\nfunction useFloatingWithStore(options, store) {\n const {\n nodeId,\n externalTree\n } = options;\n const referenceElement = store.useState('referenceElement');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const open = store.useState('open');\n const floatingId = store.useState('floatingId');\n const [positionReference, setPositionReferenceRaw] = React.useState(null);\n const [localDomReference, setLocalDomReference] = React.useState(undefined);\n const [localFloatingElement, setLocalFloatingElement] = React.useState(undefined);\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree(externalTree);\n const storeElements = React.useMemo(() => ({\n reference: referenceElement,\n floating: floatingElement,\n domReference: domReferenceElement\n }), [referenceElement, floatingElement, domReferenceElement]);\n const position = usePosition({\n ...options,\n elements: {\n ...storeElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null;\n const syncedFloatingElement = localFloatingElement === undefined ? store.state.floatingElement : localFloatingElement;\n store.useSyncedValue('referenceElement', localDomReference ?? null);\n store.useSyncedValue('domReferenceElement', localDomReference === undefined ? domReferenceElement : localDomReferenceElement);\n store.useSyncedValue('floatingElement', syncedFloatingElement);\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n getClientRects: () => node.getClientRects(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n setPositionReferenceRaw(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setLocalDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs, setLocalDomReference]);\n const setFloating = React.useCallback(node => {\n setLocalFloatingElement(node);\n position.refs.setFloating(node);\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setFloating,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setFloating, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReferenceElement\n }), [position.elements, domReferenceElement]);\n const context = React.useMemo(() => ({\n ...position,\n dataRef: store.context.dataRef,\n open,\n onOpenChange: store.setOpen,\n events: store.context.events,\n floatingId,\n refs,\n elements,\n nodeId,\n rootStore: store\n }), [position, refs, elements, nodeId, store, open, floatingId]);\n useIsoLayoutEffect(() => {\n if (domReferenceElement) {\n domReferenceRef.current = domReferenceElement;\n }\n }, [domReferenceElement]);\n useIsoLayoutEffect(() => {\n store.context.dataRef.current.floatingContext = context;\n const node = tree?.nodesRef.current.find(n => n.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements,\n rootStore: store\n }), [position, refs, elements, context, store]);\n}","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => {\n const result = offset$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => {\n const result = shift$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => {\n const result = limitShift$1(options);\n return {\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => {\n const result = flip$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => {\n const result = size$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => {\n const result = autoPlacement$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => {\n const result = hide$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => {\n const result = inline$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => {\n const result = arrow$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Minimal store contract exposed by popup handles to detached triggers.\n *\n * Detached triggers read `store` during render and subscribe to be notified when the handle switches\n * between its fallback store and a root's live store.\n *\n * @template HandleStore Store shape exposed to detached triggers.\n */\n\n/**\n * Store shape holding a trigger registry, required by `BasePopupHandle.openByTrigger` to resolve a\n * trigger element by id on both the attached root's store and the fallback store.\n */\n\n/**\n * Store shape required by `BasePopupHandle.openByTrigger`/`closePopup` to drive open/close state.\n * Only the root-owned `Store` needs this — the `HandleStore` view exposed to detached triggers may\n * omit `setOpen` entirely (as Dialog and PreviewCard's do) since it is never called while detached.\n */\n\n/**\n * Shared implementation for popup handles that coordinate detached triggers with a mounted root.\n *\n * Subclasses provide the component-specific imperative methods, while this base class owns the\n * fallback store, root store attachment stack, subscriber notifications, and development warning for\n * overlapping roots.\n *\n * @template HandleStore Store shape exposed to detached triggers.\n * @template Store Root-owned store attached by the component root.\n */\nexport class BasePopupHandle {\n /**\n * Stores of every root currently using this handle, in attach order. A handle is meant to be used\n * by a single mounted root, but roots can transiently overlap (e.g. during an animated route\n * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of\n * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.\n */\n attachedStores = [];\n\n /**\n * Store of the root that currently controls the handle: the most recently attached one still\n * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.\n */\n attachedStoreValue = null;\n\n /**\n * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.\n */\n storeListeners = new Set();\n\n /**\n * Creates a handle backed by the store used while no root is attached.\n *\n * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,\n * so they can render and register without a mounted root. Triggers register into whichever store\n * `store` currently resolves to, so while detached they live in this store's trigger map and\n * migrate themselves to the root's store (and back) as it attaches/detaches.\n * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces\n * `MenuHandle.open()` in warning text.\n * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is\n * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,\n * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.\n */\n constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {\n this.fallbackStore = fallbackStore;\n this.componentName = componentName;\n this.throwOnMissingTrigger = throwOnMissingTrigger;\n }\n get attachedStore() {\n return this.attachedStoreValue;\n }\n\n /**\n * Store that detached triggers read from: the attached root's store, or an inert fallback store\n * used while no root is attached.\n * @internal\n */\n get store() {\n return this.attachedStoreValue ?? this.fallbackStore;\n }\n\n /**\n * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on\n * the handle during render because a handle can be shared by concurrent server-rendered requests.\n * @internal\n */\n get serverStore() {\n return this.fallbackStore;\n }\n\n /**\n * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind\n * when a root attaches or detaches. Returns a function that removes the listener.\n * @internal\n */\n subscribeStore(listener) {\n this.storeListeners.add(listener);\n return () => {\n this.storeListeners.delete(listener);\n };\n }\n\n /**\n * Points the handle at a root's store and notifies subscribers so detached triggers re-render and\n * re-register into it (their registration ref re-fires on the store-pointer change). Returns a\n * cleanup function that detaches the store again.\n * @internal\n */\n attachStore(newStore) {\n this.attachedStores.push(newStore);\n this.setActiveStore(newStore);\n if (process.env.NODE_ENV !== 'production') {\n if (this.attachedStores.length > 1) {\n // More than one root is attached at once. This is usually a transient overlap during an\n // animated route transition, where the outgoing root unmounts shortly after the incoming\n // one mounts. Defer the check by a frame and only warn if the overlap is still present once\n // the transition has settled (more than one root stayed mounted), so a clean handoff doesn't\n // warn regardless of the exact unmount timing.\n // The warning frame only exists in development; it is created lazily so it never appears on\n // instances in production (like `controlledValues` in `ReactStore`).\n const dev = this;\n (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {\n if (this.attachedStores.length > 1) {\n console.warn('Base UI: A handle is attached to more than one mounted root at the same time. ' + 'The most recently mounted root takes over and the previous one stops being controlled by the handle. ' + 'A handle should be used by a single root that stays mounted for the lifetime of the handle.');\n }\n });\n }\n }\n return () => {\n const index = this.attachedStores.lastIndexOf(newStore);\n if (index !== -1) {\n this.attachedStores.splice(index, 1);\n }\n // Restore control to the most recently attached root that is still mounted (or detach fully if\n // none remain). Clearing unconditionally would leave a still-mounted older root uncontrollable\n // when a newer overlapping root detaches first (e.g. a canceled route transition).\n this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);\n };\n }\n\n /**\n * Sets the store that currently controls the handle and notifies subscribers when it changes, so\n * detached triggers re-render and migrate their registration to the new store.\n */\n setActiveStore(store) {\n if (this.attachedStoreValue !== store) {\n this.attachedStoreValue = store;\n this.storeListeners.forEach(listener => {\n listener();\n });\n }\n }\n\n /**\n * Opens the attached root's store and associates it with the trigger with the given id, or a\n * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public\n * `open()` method, which only narrows the parameter type.\n *\n * When a trigger id is given but no matching trigger is registered, anchored popups throw (see\n * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open\n * without associating any trigger.\n */\n openByTrigger(triggerId) {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. ` + 'The call was ignored; mount a root with this handle before opening it imperatively.');\n }\n return;\n }\n\n // Registered triggers normally live in the active root's store. During the commit in which a\n // root attaches, a still-mounted detached trigger has not re-registered into that store yet (it\n // migrates on its next render): it is still registered wherever it lived before — the fallback\n // store when this is the first root to attach, or a previously attached root's store during a\n // transient overlap (e.g. an animated route transition). Search the whole attachment stack\n // (newest first) and the fallback map so an imperative open-by-id called in that commit (e.g.\n // from a layout effect) still resolves the trigger instead of treating it as missing.\n let triggerElement;\n if (triggerId) {\n for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {\n triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);\n }\n triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);\n }\n if (triggerId && !triggerElement) {\n if (this.throwOnMissingTrigger) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id \"${triggerId}\", ` + 'but no matching trigger is registered with this handle. ' + 'An anchored popup cannot open without a trigger to anchor to. ' + `Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its \"handle\" prop.` : _formatErrorMessage(99, this.componentName, triggerId, this.componentName));\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id \"${triggerId}\". ` + 'The popup will open, but the trigger will not be associated with it.');\n }\n }\n attachedStore.setOpen(true, createChangeEventDetails(REASONS.imperativeAction, undefined, triggerElement));\n }\n\n /**\n * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)\n * while no root is attached. Shared by every concrete handle's public `close()` method.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n closePopup() {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. ` + 'The call was ignored.');\n }\n return;\n }\n attachedStore.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\n\n/**\n * The subset of a popup handle that a Root needs to bind its store to. Both the real handle classes\n * and any test double satisfy it.\n */\n\n/**\n * Creates and owns a popup store on behalf of a Root part. The store is created exactly once, with\n * controlled props and root state synced separately after creation. Sets up the synced floating\n * root context and returns the store.\n *\n * @param createStore Factory that builds the store. Called exactly once, receiving the floating id\n * and whether the popup is nested inside another floating element, both resolved on the first render.\n * @param treatPopupAsFloatingElement Whether the popup element is passed to Floating UI as the\n * floating element instead of the default positioner.\n */\nexport function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const store = useRefWithInit(() => createStore(floatingId, nested)).current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return store;\n}\n\n/**\n * Attaches a Root's store to a handle for this component's committed lifetime. Popup Roots render\n * it before their interactions and user children so its layout effect runs before descendant layout\n * effects. This lets descendants call the handle during the Root's initial commit without attaching\n * during render, which would leak suspended or abandoned stores. Store subscribers are notified by\n * `attachStore` in this ordinary layout phase, where React permits synchronous updates.\n *\n * Popup Roots must render this component only when a handle is present so handle-less Roots avoid\n * mounting an extra fiber and layout effect.\n */\nexport function PopupHandleAttachment({\n handle,\n store\n}) {\n useIsoLayoutEffect(() => {\n return handle.attachStore(store);\n }, [handle, store]);\n return null;\n}\n\n/**\n * Returns a callback ref that registers/unregisters the trigger element in the store.\n *\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n // Keep track of the currently registered element to unregister it on unmount or id change.\n const registeredElementIdRef = React.useRef(null);\n const registeredElementRef = React.useRef(null);\n return React.useCallback(element => {\n if (id === undefined) {\n return;\n }\n let shouldSyncTriggerCount = false;\n if (registeredElementIdRef.current !== null) {\n const registeredId = registeredElementIdRef.current;\n const registeredElement = registeredElementRef.current;\n const currentElement = store.context.triggerElements.getById(registeredId);\n if (registeredElement && currentElement === registeredElement) {\n store.context.triggerElements.delete(registeredId);\n shouldSyncTriggerCount = true;\n }\n registeredElementIdRef.current = null;\n registeredElementRef.current = null;\n }\n if (element !== null) {\n registeredElementIdRef.current = id;\n registeredElementRef.current = element;\n store.context.triggerElements.add(id, element);\n shouldSyncTriggerCount = true;\n }\n if (shouldSyncTriggerCount) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n }\n }, [store, id]);\n}\nexport function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n state.preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n state.preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n state.activeTriggerId = triggerId;\n state.activeTriggerElement = trigger ?? null;\n }\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n // Spread `extraState` first so `open` always reflects `nextOpen`, keeping it in\n // sync with the value already passed to `dispatchOpenChange`/`setPopupOpenState`.\n const updatedState = {\n ...options.extraState,\n open: nextOpen\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n\n // Applies trigger-owned state (active-trigger ownership and payload) when the trigger registers.\n // Stable so payload/`stateUpdates` changes do not change the ref identity (which would needlessly\n // churn registration); it reads the latest closure values when invoked.\n const applyTriggerData = useStableCallback(element => {\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n store.update({\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n });\n return;\n }\n if (activeTriggerId == null && open) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work.\n store.update({\n activeTriggerId: triggerId,\n activeTriggerElement: element,\n ...stateUpdates\n });\n }\n });\n\n // Intentionally NOT stable. Its identity is derived from `baseRegisterTrigger`, which is keyed on\n // `[store, id]`, so when a handle-backed trigger's store pointer swaps the merged ref re-fires —\n // unregistering from the previous store and registering into the new one. This lets a detached\n // trigger follow its handle's currently-attached store across attach/detach/remount. (A stable\n // callback would keep its identity and never re-fire on a store swap.)\n const registerTrigger = React.useCallback(element => {\n baseRegisterTrigger(element);\n if (element) {\n applyTriggerData(element);\n }\n }, [baseRegisterTrigger, applyTriggerData]);\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n store.update({\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger. When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger id is missing from the\n * registry but the same element is still registered under a different id (e.g. the rendered trigger\n * carries its own DOM `id` that differs from Base UI's internal trigger id), the active id is\n * reassociated to the registered id instead of being treated as lost. When the active trigger\n * unregisters, the default path preserves existing ownership so non-closing popup families do not\n * silently claim a different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering a previously resolved active trigger\n * requests a close after a microtask so a same-tick replacement trigger with the same id can\n * register first. An active trigger id that has not matched a registered trigger yet is treated as\n * pending and does not request a close.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n // Distinguishes a trigger that unmounted from a new active trigger that has not hydrated yet.\n const resolvedActiveTriggerIdRef = React.useRef(null);\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n // Subscribe to the active trigger id so the reconciliation below reruns when ownership moves to\n // another trigger while the popup stays open (e.g. a focus/hover handoff between triggers).\n const activeTriggerId = store.useState('activeTriggerId');\n // Subscribe to the active trigger element so the reconciliation reruns when a pending active\n // trigger registers in a commit where the trigger count nets out unchanged (registration\n // forwards the element to the store when the registering trigger matches the active id).\n // Without this, the id would never be marked resolved and a later genuine unmount would be\n // misclassified as pending, disabling `closeOnActiveTriggerUnmount`.\n const reactiveActiveTriggerElement = store.useState('activeTriggerElement');\n useIsoLayoutEffect(() => {\n if (!open) {\n resolvedActiveTriggerIdRef.current = null;\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const currentActiveTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (currentActiveTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);\n if (!activeTriggerElement) {\n for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {\n if (triggerElement === store.state.activeTriggerElement) {\n stateUpdates.activeTriggerId = triggerId;\n stateUpdates.activeTriggerElement = triggerElement;\n resolvedActiveTriggerIdRef.current = triggerId;\n break;\n }\n }\n if (stateUpdates.activeTriggerId === undefined) {\n if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {\n lostActiveTriggerId = currentActiveTriggerId;\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = currentActiveTriggerId;\n if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n resolvedActiveTriggerIdRef.current = implicitTriggerId;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n *\n * @returns A function to forcibly unmount the popup.\n */\nexport function useOpenStateTransitions(open, store, onUnmount) {\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');\n // Opening starts a new close cycle. Clear during render so the close-completion hook below\n // reads the synchronized value on the same pass.\n const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose;\n store.useSyncedValues({\n mounted,\n transitionStatus,\n preventUnmountingOnClose: syncedPreventUnmountingOnClose\n });\n const forceUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !syncedPreventUnmountingOnClose,\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\n/**\n * Keeps a FloatingRootStore in sync with the provided PopupStore.\n * Uses the provided FloatingRootStore when one exists, otherwise creates one once and updates it on every render.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n floatingRootContext: floatingRootContextProp,\n floatingId,\n nested,\n onOpenChange\n } = options;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const triggerElements = popupStore.context.triggerElements;\n const handleOpenChange = onOpenChange;\n const internalStoreRef = React.useRef(null);\n if (floatingRootContextProp === undefined && internalStoreRef.current === null) {\n internalStoreRef.current = new FloatingRootStore({\n open,\n transitionStatus: undefined,\n referenceElement,\n floatingElement,\n triggerElements,\n onOpenChange: handleOpenChange,\n floatingId,\n syncOnly: true,\n nested\n });\n }\n const store = floatingRootContextProp ?? internalStoreRef.current;\n popupStore.useSyncedValue('floatingId', floatingId);\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // Keep non-reactive context values fresh for interactions that call `store.setOpen`.\n store.context.onOpenChange = handleOpenChange;\n store.context.nested = nested;\n return store;\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\nimport { isClickLikeEvent } from \"../utils.mjs\";\nconst selectors = {\n open: state => state.open,\n transitionStatus: state => state.transitionStatus,\n domReferenceElement: state => state.domReferenceElement,\n referenceElement: state => state.positionReference ?? state.referenceElement,\n floatingElement: state => state.floatingElement,\n floatingId: state => state.floatingId\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","/**\n * Development-only reverse index of element to registered id, keyed by the owning map.\n *\n * Registration would otherwise have to scan every entry to detect an element claimed by two ids,\n * making the mount of many triggers sharing one handle quadratic. Kept module-scoped, lazily\n * initialized, and read only from `process.env.NODE_ENV` guards so production builds drop it along\n * with the checks.\n */\nlet devElementIdsByMap;\nfunction getDevElementIds(map) {\n devElementIdsByMap ??= new WeakMap();\n let elementIds = devElementIdsByMap.get(map);\n if (!elementIds) {\n elementIds = new WeakMap();\n devElementIdsByMap.set(map, elementIds);\n }\n return elementIds;\n}\n\n/**\n * Data structure to keep track of popup trigger elements by their IDs.\n *\n * Element lookups iterate the id map rather than maintaining a parallel Set. Registration is O(1),\n * while `hasElement` and `hasMatchingElement` are linear in the number of triggers.\n */\nexport class PopupTriggerMap {\n constructor() {\n this.idMap = new Map();\n }\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n if (process.env.NODE_ENV !== 'production') {\n const elementIds = getDevElementIds(this);\n const existingId = elementIds.get(element);\n if (existingId !== undefined && existingId !== id) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n\n // Reusing an id for a different element evicts the previous one, so it must lose its claim\n // on the id or a later registration under a different id would be reported as a duplicate.\n const previousElement = this.idMap.get(id);\n if (previousElement !== undefined && previousElement !== element) {\n elementIds.delete(previousElement);\n }\n elementIds.set(element, id);\n }\n this.idMap.set(id, element);\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n if (process.env.NODE_ENV !== 'production') {\n const element = this.idMap.get(id);\n if (element !== undefined) {\n devElementIdsByMap?.get(this)?.delete(element);\n }\n }\n this.idMap.delete(id);\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n for (const registered of this.idMap.values()) {\n if (registered === element) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.idMap.values()) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.idMap.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","import { PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\nexport function getEmptyRootContext() {\n return new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements: new PopupTriggerMap(),\n floatingId: undefined,\n syncOnly: false,\n nested: false,\n onOpenChange: undefined\n });\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\nimport { getEmptyRootContext } from \"../../floating-ui-react/utils/getEmptyRootContext.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState() {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: getEmptyRootContext(),\n floatingId: undefined,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nexport function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) {\n return new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n });\n}\nconst activeTriggerIdSelector = state => state.triggerIdProp ?? state.activeTriggerId;\nconst openSelector = state => state.openProp ?? state.open;\nconst popupIdSelector = state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n};\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: state => state.mounted,\n transitionStatus: state => state.transitionStatus,\n floatingRootContext: state => state.floatingRootContext,\n triggerCount: state => state.triggerCount,\n preventUnmountingOnClose: state => state.preventUnmountingOnClose,\n payload: state => state.payload,\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: state => state.mounted ? state.activeTriggerElement : null,\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId,\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted,\n triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined,\n popupProps: state => state.popupProps,\n popupElement: state => state.popupElement,\n positionerElement: state => state.positionerElement\n};\n\n/**\n * Store members a detached handle-backed trigger reads or invokes for trigger registration and data\n * forwarding. `set`/`update` are included only for trigger-count and trigger-data bookkeeping; on a\n * detached (inert) store they are intentionally no-ops, so a write through them is not guaranteed to\n * be durable. Component handle-store views Pick these from their concrete store (preserving its\n * context and selectors) and add any component-specific trigger-invoked members such as `setOpen`.\n */\n\n/**\n * The subset of a popup store that trigger registration and data forwarding rely on. Narrow enough\n * that an inert store can be passed while detached.\n */","'use client';\n\nimport * as React from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from '@base-ui/utils/empty';\n/**\n * Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.\n * Detached triggers use this to follow a handle as a root attaches or detaches: while no root is\n * attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and\n * read from the live root store.\n *\n * Returns `undefined` when no handle is provided so callers can fall back to their root context.\n *\n * @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.\n */\nexport function usePopupHandleStore(handle) {\n const subscribe = React.useCallback(listener => {\n if (handle === undefined) {\n return NOOP;\n }\n return handle.subscribeStore(listener);\n }, [handle]);\n const getSnapshot = React.useCallback(() => {\n return handle === undefined ? undefined : handle.store;\n }, [handle]);\n return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);\n}","'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.mjs\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n\n // Only sync elements that are defined to avoid overwriting existing ones\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { platform } from '@base-ui/utils/platform';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { getWindow, isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { activeElement, contains, getTarget, isTargetInsideEnabledTrigger, isTypeableElement, matchesFocusVisible } from \"../utils/element.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nconst isMacSafari = platform.os.mac && platform.engine.webkit;\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nexport function useFocus(context, props = {}) {\n const {\n enabled = true,\n delay\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const {\n events,\n dataRef\n } = store.context;\n const blockFocusRef = React.useRef(false);\n // Track which reference should be blocked from re-opening after Escape/press dismissal.\n const blockedReferenceRef = React.useRef(null);\n const keyboardModalityRef = React.useRef(true);\n const timeout = useTimeout();\n React.useEffect(() => {\n const domReference = store.select('domReferenceElement');\n if (!enabled) {\n return undefined;\n }\n const win = getWindow(domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n const currentDomReference = store.select('domReferenceElement');\n if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {\n blockFocusRef.current = true;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n function onPointerDown() {\n keyboardModalityRef.current = false;\n }\n return mergeCleanups(addEventListener(win, 'blur', onBlur), isMacSafari && addEventListener(win, 'keydown', onKeyDown, true), isMacSafari && addEventListener(win, 'pointerdown', onPointerDown, true));\n }, [store, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (details.reason === REASONS.triggerPress || details.reason === REASONS.escapeKey) {\n const referenceElement = store.select('domReferenceElement');\n if (isElement(referenceElement)) {\n blockedReferenceRef.current = referenceElement;\n blockFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [events, enabled, store]);\n const reference = React.useMemo(() => {\n function resetBlockedFocus() {\n blockFocusRef.current = false;\n blockedReferenceRef.current = null;\n }\n return {\n onMouseLeave() {\n resetBlockedFocus();\n },\n onFocus(event) {\n const focusTarget = event.currentTarget;\n if (blockFocusRef.current) {\n if (blockedReferenceRef.current === focusTarget) {\n return;\n }\n resetBlockedFocus();\n }\n const target = getTarget(event.nativeEvent);\n if (isElement(target)) {\n // Safari fails to match `:focus-visible` if focus was initially\n // outside the document.\n if (isMacSafari && !event.relatedTarget) {\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n } else if (!matchesFocusVisible(target)) {\n return;\n }\n }\n const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);\n const {\n nativeEvent,\n currentTarget\n } = event;\n const delayValue = typeof delay === 'function' ? delay() : delay;\n if (store.select('open') && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === undefined) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n return;\n }\n timeout.start(delayValue, () => {\n if (blockFocusRef.current) {\n return;\n }\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n });\n },\n onBlur(event) {\n resetBlockedFocus();\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeout.start(0, () => {\n const domReference = store.select('domReferenceElement');\n const activeEl = activeElement(ownerDocument(domReference));\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === domReference) {\n return;\n }\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n\n // If the next focused element is one of the triggers, do not close\n // the floating element. The focus handler of that trigger will\n // handle the open state.\n const nextFocusedElement = relatedTarget ?? activeEl;\n if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerFocus, nativeEvent));\n });\n }\n };\n }, [dataRef, delay, store, timeout]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { contains, getTarget } from \"../utils/element.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, isInteractiveElement, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.mjs\";\nimport { getDelay, isClickLikeOpenEvent as isClickLikeOpenEventShared, isHoverOpenEvent, isInsideEnabledTrigger } from \"./useHoverShared.mjs\";\n/**\n * Provides hover interactions that should be attached to the floating element.\n */\nexport function useHoverFloatingInteraction(context, parameters = {}) {\n const {\n enabled = true,\n closeDelay: closeDelayProp = 0,\n nodeId: nodeIdProp\n } = parameters;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const {\n dataRef\n } = store.context;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const instance = useHoverInteractionSharedState(store);\n const childClosedTimeout = useTimeout();\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const isHoverOpen = useStableCallback(() => {\n return isHoverOpenEvent(dataRef.current.openEvent?.type);\n });\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n instance.pointerType = undefined;\n instance.restTimeoutPending = false;\n instance.interactedInside = false;\n clearPointerEvents();\n }\n }, [open, instance, clearPointerEvents]);\n React.useEffect(() => {\n return clearPointerEvents;\n }, [clearPointerEvents]);\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {\n const ref = domReferenceElement;\n const floatingEl = floatingElement;\n const doc = ownerDocument(floatingElement);\n const parentFloating = tree?.nodesRef.current.find(node => node.id === parentId)?.context?.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n\n // A keep-mounted submenu can appear in the tree before it opens, so a\n // cached scope or parent lookup may resolve to the submenu itself. That\n // would not shield sibling items in the parent menu.\n const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;\n const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? ref.closest('[data-rootownerid]') ?? doc.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: ref,\n floatingElement: floatingEl\n });\n return () => {\n clearPointerEvents();\n };\n }\n return undefined;\n }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function hasParentChildren() {\n return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);\n }\n function closeWithDelay(event) {\n const closeDelay = getDelay(closeDelayProp, 'close', instance.pointerType);\n const close = () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n };\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, close);\n } else {\n instance.openChangeTimeout.clear();\n close();\n }\n }\n function handleInteractInside(event) {\n const target = getTarget(event);\n if (!isInteractiveElement(target)) {\n instance.interactedInside = false;\n return;\n }\n instance.interactedInside = target?.closest('[aria-haspopup]') != null;\n }\n function onFloatingMouseEnter() {\n instance.openChangeTimeout.clear();\n childClosedTimeout.clear();\n tree?.events.off('floating.closed', onNodeClosed);\n clearPointerEvents();\n }\n function onFloatingMouseLeave(event) {\n if (hasParentChildren() && tree) {\n tree.events.on('floating.closed', onNodeClosed);\n return;\n }\n if (isInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {\n // If the mouse is leaving the reference element to another trigger, don't explicitly close the popup\n // as it will be moved.\n return;\n }\n const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;\n const relatedTarget = event.relatedTarget;\n const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some(node => contains(node.context?.elements.floating, relatedTarget));\n if (isMovingIntoDescendantFloating) {\n return;\n }\n\n // If the safePolygon handler is active, let it handle the close logic.\n if (instance.handler) {\n instance.handler(event);\n return;\n }\n clearPointerEvents();\n if (isHoverOpen() && !isClickLikeOpenEvent()) {\n closeWithDelay(event);\n }\n }\n function onNodeClosed(event) {\n if (!tree || !parentId || hasParentChildren()) {\n return;\n }\n // Allow the mouseenter event to fire in case child was closed because mouse moved into parent.\n childClosedTimeout.start(0, () => {\n tree.events.off('floating.closed', onNodeClosed);\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree.events.emit('floating.closed', event);\n });\n }\n const floating = floatingElement;\n return mergeCleanups(floating && addEventListener(floating, 'mouseenter', onFloatingMouseEnter), floating && addEventListener(floating, 'mouseleave', onFloatingMouseLeave), floating && addEventListener(floating, 'pointerdown', handleInteractInside, true), () => {\n tree?.events.off('floating.closed', onNodeClosed);\n });\n }, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);\n}","'use client';\n\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { isInteractiveElement } from \"../utils.mjs\";\nexport { isInteractiveElement };\nexport class HoverInteraction {\n constructor() {\n this.pointerType = undefined;\n this.interactedInside = false;\n this.handler = undefined;\n this.blockMouseMove = true;\n this.performedPointerEventsMutation = false;\n this.pointerEventsScopeElement = null;\n this.pointerEventsReferenceElement = null;\n this.pointerEventsFloatingElement = null;\n this.restTimeoutPending = false;\n this.openChangeTimeout = new Timeout();\n this.restTimeout = new Timeout();\n this.handleCloseOptions = undefined;\n }\n static create() {\n return new HoverInteraction();\n }\n dispose = () => {\n this.openChangeTimeout.clear();\n this.restTimeout.clear();\n };\n disposeEffect = () => {\n return this.dispose;\n };\n}\nconst pointerEventsMutationOwnerByScopeElement = new WeakMap();\nexport function clearSafePolygonPointerEventsMutation(instance) {\n if (!instance.performedPointerEventsMutation) {\n return;\n }\n const scopeElement = instance.pointerEventsScopeElement;\n if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {\n instance.pointerEventsScopeElement?.style.removeProperty('pointer-events');\n instance.pointerEventsReferenceElement?.style.removeProperty('pointer-events');\n instance.pointerEventsFloatingElement?.style.removeProperty('pointer-events');\n pointerEventsMutationOwnerByScopeElement.delete(scopeElement);\n }\n instance.performedPointerEventsMutation = false;\n instance.pointerEventsScopeElement = null;\n instance.pointerEventsReferenceElement = null;\n instance.pointerEventsFloatingElement = null;\n}\nexport function applySafePolygonPointerEventsMutation(instance, options) {\n const {\n scopeElement,\n referenceElement,\n floatingElement\n } = options;\n const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);\n if (existingOwner && existingOwner !== instance) {\n clearSafePolygonPointerEventsMutation(existingOwner);\n }\n clearSafePolygonPointerEventsMutation(instance);\n instance.performedPointerEventsMutation = true;\n instance.pointerEventsScopeElement = scopeElement;\n instance.pointerEventsReferenceElement = referenceElement;\n instance.pointerEventsFloatingElement = floatingElement;\n pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);\n scopeElement.style.pointerEvents = 'none';\n referenceElement.style.pointerEvents = 'auto';\n floatingElement.style.pointerEvents = 'auto';\n}\nexport function useHoverInteractionSharedState(store) {\n const data = store.context.dataRef.current;\n const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;\n if (!data.hoverInteractionState) {\n data.hoverInteractionState = instance;\n }\n useOnMount(data.hoverInteractionState.disposeEffect);\n return data.hoverInteractionState;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { contains, getTarget } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../utils/event.mjs\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.mjs\";\nimport { getDelay, getRestMs, isClickLikeOpenEvent as isClickLikeOpenEventShared, isInsideEnabledTrigger } from \"./useHoverShared.mjs\";\nconst EMPTY_REF = {\n current: null\n};\n\n/**\n * Provides hover interactions that should be attached to reference or trigger\n * elements.\n */\nexport function useHoverReferenceInteraction(context, props = {}) {\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true,\n triggerElementRef = EMPTY_REF,\n externalTree,\n isActiveTrigger = true,\n getHandleCloseContext,\n isClosing,\n shouldOpen: shouldOpenProp,\n guardStaleOpen = false\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const instance = useHoverInteractionSharedState(store);\n const isHoverCloseActiveRef = React.useRef(false);\n const handleCloseRef = useValueAsRef(handleClose);\n const delayRef = useValueAsRef(delay);\n const restMsRef = useValueAsRef(restMs);\n const enabledRef = useValueAsRef(enabled);\n const shouldOpenRef = useValueAsRef(shouldOpenProp);\n const isClosingRef = useValueAsRef(isClosing);\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const checkShouldOpen = useStableCallback(() => {\n return shouldOpenRef.current?.() !== false;\n });\n const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {\n const allTriggers = store.context.triggerElements;\n\n // Fast path for normal usage where handlers are attached directly to triggers.\n if (allTriggers.hasElement(currentTarget)) {\n return !currentDomReference || !contains(currentDomReference, currentTarget);\n }\n\n // Fallback for delegated/wrapper usage where currentTarget may be outside the trigger map.\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n return allTriggers.hasMatchingElement(trigger => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));\n });\n const cleanupMouseMoveHandler = useStableCallback(() => {\n if (!instance.handler) {\n return;\n }\n const doc = ownerDocument(store.select('domReferenceElement'));\n doc.removeEventListener('mousemove', instance.handler);\n instance.handler = undefined;\n });\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n if (isActiveTrigger) {\n // eslint-disable-next-line no-underscore-dangle\n instance.handleCloseOptions = handleCloseRef.current?.__options;\n }\n React.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (!details.open) {\n isHoverCloseActiveRef.current = details.reason === REASONS.triggerHover;\n cleanupMouseMoveHandler();\n instance.openChangeTimeout.clear();\n instance.restTimeout.clear();\n instance.blockMouseMove = true;\n instance.restTimeoutPending = false;\n } else {\n isHoverCloseActiveRef.current = false;\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [enabled, events, instance, cleanupMouseMoveHandler]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function closeWithDelay(event, runElseBranch = true) {\n const closeDelay = getDelay(delayRef.current, 'close', instance.pointerType);\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n });\n } else if (runElseBranch) {\n instance.openChangeTimeout.clear();\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n }\n }\n const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select('domReferenceElement') : null);\n if (!isElement(trigger)) {\n return undefined;\n }\n function onMouseEnter(event) {\n instance.openChangeTimeout.clear();\n instance.blockMouseMove = false;\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n\n // Only rest delay is set; there's no fallback delay.\n // This will be handled by `onMouseMove`.\n const restMsValue = getRestMs(restMsRef.current);\n const openDelay = getDelay(delayRef.current, 'open', instance.pointerType);\n const eventTarget = getTarget(event);\n const currentTarget = event.currentTarget ?? null;\n const currentDomReference = store.select('domReferenceElement');\n let triggerNode = currentTarget;\n\n // Wrapper/delegated mode: resolve the actual trigger from the event target.\n if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {\n for (const triggerElement of store.context.triggerElements.elements()) {\n if (contains(triggerElement, eventTarget)) {\n triggerNode = triggerElement;\n break;\n }\n }\n }\n\n // Wrapper/delegated mode fallback: if the wrapper contains the active trigger,\n // treat this as re-entering that active trigger.\n if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {\n triggerNode = currentDomReference;\n }\n const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);\n const isOpen = store.select('open');\n const isInClosingTransition = isClosingRef.current?.() ?? store.select('transitionStatus') === 'ending';\n const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;\n const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;\n const isRestOnlyDelay = restMsValue > 0 && !openDelay;\n const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;\n const shouldOpen = !isOpen || isOverInactive;\n\n // Open immediately when moving between triggers while open, or during\n // a hover-driven close transition (including same-trigger re-entry).\n if (shouldOpenImmediately) {\n if (checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n return;\n }\n if (isRestOnlyDelay) {\n return;\n }\n if (openDelay) {\n instance.openChangeTimeout.start(openDelay, () => {\n if (shouldOpen && checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n });\n } else if (shouldOpen) {\n if (checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n clearPointerEvents();\n return;\n }\n cleanupMouseMoveHandler();\n const domReferenceElement = store.select('domReferenceElement');\n const doc = ownerDocument(domReferenceElement);\n instance.restTimeout.clear();\n instance.restTimeoutPending = false;\n const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();\n if (isInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {\n return;\n }\n if (handleCloseRef.current && handleCloseContextBase) {\n if (!store.select('open')) {\n instance.openChangeTimeout.clear();\n }\n const currentTrigger = triggerElementRef.current;\n instance.handler = handleCloseRef.current({\n ...handleCloseContextBase,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (enabledRef.current && !isClickLikeOpenEvent() && currentTrigger === store.select('domReferenceElement')) {\n closeWithDelay(event, true);\n }\n }\n });\n doc.addEventListener('mousemove', instance.handler);\n instance.handler(event);\n return;\n }\n const shouldClose = instance.pointerType === 'touch' ? !contains(store.select('floatingElement'), event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n\n // Backup cancellation for Chrome's dropped `mouseleave` — see `guardStaleOpen`.\n function onMouseOut(event) {\n if (contains(trigger, event.relatedTarget)) {\n return; // moved within the trigger's own subtree\n }\n instance.openChangeTimeout.clear();\n instance.restTimeout.clear();\n instance.restTimeoutPending = false;\n }\n const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, 'mouseout', onMouseOut) : undefined;\n if (move) {\n return mergeCleanups(addEventListener(trigger, 'mousemove', onMouseEnter, {\n once: true\n }), addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);\n }\n return mergeCleanups(addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);\n }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);\n return React.useMemo(() => {\n if (!enabled) {\n return undefined;\n }\n function setPointerRef(event) {\n instance.pointerType = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n const trigger = event.currentTarget;\n const currentDomReference = store.select('domReferenceElement');\n const currentOpen = store.select('open');\n const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {\n const floatingElement = store.select('floatingElement');\n if (floatingElement) {\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: trigger,\n floatingElement\n });\n }\n }\n const restMsValue = getRestMs(restMsRef.current);\n if (currentOpen && !isOverInactive || restMsValue === 0) {\n return;\n }\n if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {\n return;\n }\n instance.restTimeout.clear();\n function handleMouseMove() {\n instance.restTimeoutPending = false;\n\n // A delayed hover open should not override a click-like open that happened\n // while the hover delay was pending.\n if (isClickLikeOpenEvent()) {\n return;\n }\n const latestOpen = store.select('open');\n if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, nativeEvent, trigger));\n }\n }\n if (instance.pointerType === 'touch') {\n ReactDOM.flushSync(() => {\n handleMouseMove();\n });\n } else if (isOverInactive && currentOpen) {\n handleMouseMove();\n } else {\n instance.restTimeoutPending = true;\n instance.restTimeout.start(restMsValue, handleMouseMove);\n }\n }\n };\n }, [enabled, instance, isClickLikeOpenEvent, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { platform } from '@base-ui/utils/platform';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"../utils/constants.mjs\";\nimport { activeElement, contains, getFloatingFocusElement, getTarget, isTypeableCombobox } from \"../utils/element.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nexport const ESCAPE = 'Escape';\n\n// WebKit fires zero-delta `mousemove`/`pointermove` events when the list scrolls\n// beneath a stationary pointer, moving the highlight during keyboard navigation.\n// https://github.com/mui/base-ui/issues/4002\nfunction isStationaryWebKitPointer(event) {\n return platform.engine.webkit && event.movementX === 0 && event.movementY === 0;\n}\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, grid) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && grid) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(context, props) {\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n id,\n resetOnPointerLeave = true,\n externalTree,\n grid: navigateGrid\n } = props;\n const isGrid = navigateGrid != null;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && isGrid) {\n console.warn('In grid list navigation mode, the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusFrame = useAnimationFrame();\n const waitForListPopulatedFrame = useAnimationFrame();\n const focusItem = useStableCallback(() => {\n function runFocus(item) {\n if (virtual) {\n tree?.events.emit('virtualfocus', item);\n } else {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? callback => callback() : callback => focusFrame.request(callback);\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Reset the active index when the list is no longer open and mounted (closing or\n // unmounting). `onNavigate` is a stable callback that always forwards to the latest\n // `onNavigate` prop.\n indexRef.current = -1;\n onNavigate();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? callback => waitForListPopulatedFrame.request(callback) : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // Initially focus the first non-disabled item. `disabledIndices` is deliberately\n // omitted here so attribute-disabled items (`disabled`/`aria-disabled`) are skipped\n // on open even when the consumer passes an empty `disabledIndices` array. Passing it\n // would regress that behavior (see mui/base-ui#2604).\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n // `floatingElement` is null here (see the guard above), so resolve the owner document from an\n // in-DOM element for realm-safety (shadow DOM/iframes): the reference element, falling back to\n // the parent floating element when the reference is virtual (`domReferenceElement` is null).\n const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const getParentOrientation = useStableCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n });\n const getMinEnabledIndex = useStableCallback(() => {\n return getMinListIndex(listRef, disabledIndicesRef.current);\n });\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n if (virtual) {\n tree?.events.emit('virtualfocus', domReferenceElement);\n } else {\n domReferenceElement.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation is injected by grid-capable consumers so non-grid\n // consumers (menu, select) tree-shake the grid helpers out.\n if (navigateGrid != null) {\n const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);\n if (index != null) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loopFocus) {\n if (currentIndex >= maxIndex) {\n if (allowEscape && currentIndex !== listRef.current.length) {\n indexRef.current = -1;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = minIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else if (loopFocus) {\n if (currentIndex <= minIndex) {\n if (allowEscape && currentIndex !== -1) {\n indexRef.current = listRef.current.length;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = maxIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick: ({\n currentTarget\n }) => currentTarget.focus({\n preventScroll: true\n }),\n // Safari\n onMouseMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n domReferenceElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]);\n const trigger = React.useMemo(() => {\n function openOnNavigationKeyDown(event) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinEnabledIndex();\n onNavigate(event);\n } else {\n openOnNavigationKeyDown(event);\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n openOnNavigationKeyDown(event);\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { isElementVisible, isListIndexDisabled } from \"../utils/composite.mjs\";\nimport { contains } from \"../utils/element.mjs\";\nimport { stopEvent } from \"../utils/event.mjs\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(context, props) {\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n disabledIndices,\n onTyping,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n const onKeyDown = useStableCallback(event => {\n function getElement(index) {\n return elementsRef?.current[index];\n }\n function isItemAvailable(index) {\n const element = getElement(index);\n if (element && !isElementVisible(element) || element?.matches(':disabled')) {\n return false;\n }\n // Visibility and native disabled state are handled above; pass an empty\n // element list so `isListIndexDisabled` resolves only the explicit\n // `disabledIndices` (array/predicate) and skips its own fallbacks.\n // Consumers that don't pass `disabledIndices` keep matching every visible\n // item except native disabled elements provided through `elementsRef`.\n return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n onTyping?.(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n onTyping?.(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n onTyping?.(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too. Unavailable items are skipped while matching, so\n // they must be ignored here as well — otherwise a hidden or disabled double-letter\n // label would block rapid cycling through the available items.\n const allowRapidSuccessionOfFirstLetter = listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n onTyping?.(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinComposite) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n }\n }, [open, selectedIndex, timeout]);\n const sharedProps = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference: sharedProps,\n floating: sharedProps\n } : {}, [enabled, sharedProps]);\n}","import { isElement } from '@floating-ui/utils/dom';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { contains, getTarget } from \"./utils/element.mjs\";\nimport { getNodeChildren } from \"./utils/nodes.mjs\";\n\n/* eslint-disable no-nested-ternary */\n\nconst CURSOR_SPEED_THRESHOLD = 0.1;\nconst CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;\nconst POLYGON_BUFFER = 0.5;\nfunction hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {\n return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;\n}\nfunction isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {\n let isInsideValue = false;\n if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {\n isInsideValue = !isInsideValue;\n }\n return isInsideValue;\n}\nfunction isInsideRect(pointX, pointY, rect) {\n return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;\n}\nfunction isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {\n const minX = Math.min(x1, x2);\n const maxX = Math.max(x1, x2);\n const minY = Math.min(y1, y2);\n const maxY = Math.max(y1, y2);\n return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nexport function safePolygon(options = {}) {\n const {\n blockPointerEvents = false\n } = options;\n const timeout = new Timeout();\n const fn = ({\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n }) => {\n const side = placement?.split('-')[0];\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = typeof performance !== 'undefined' ? performance.now() : 0;\n function isCursorMovingSlowly(nextX, nextY) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return false;\n }\n const deltaX = nextX - lastX;\n const deltaY = nextY - lastY;\n const distanceSquared = deltaX * deltaX + deltaY * deltaY;\n const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return distanceSquared < thresholdSquared;\n }\n function close() {\n timeout.clear();\n onClose();\n }\n return function onMouseMove(event) {\n timeout.clear();\n const domReference = elements.domReference;\n const floating = elements.floating;\n if (!domReference || !floating || side == null || x == null || y == null) {\n return undefined;\n }\n const {\n clientX,\n clientY\n } = event;\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(floating, target);\n const isOverReferenceEl = contains(domReference, target);\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return undefined;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n if (!isLeave) {\n hasLanded = true;\n return undefined;\n }\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {\n return undefined;\n }\n function hasOpenChildNode() {\n return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);\n }\n function closeIfNoOpenChild() {\n if (!hasOpenChildNode()) {\n close();\n }\n }\n\n // If any nested child is open, abort.\n if (hasOpenChildNode()) {\n return undefined;\n }\n const refRect = domReference.getBoundingClientRect();\n const rect = floating.getBoundingClientRect();\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n closeIfNoOpenChild();\n return undefined;\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let isInsideTroughRect = false;\n switch (side) {\n case 'top':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);\n break;\n case 'bottom':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);\n break;\n case 'left':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);\n break;\n case 'right':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);\n break;\n default:\n }\n if (isInsideTroughRect) {\n return undefined;\n }\n if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {\n closeIfNoOpenChild();\n return undefined;\n }\n if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {\n closeIfNoOpenChild();\n return undefined;\n }\n let isInsidePolygon = false;\n switch (side) {\n case 'top':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y + POLYGON_BUFFER + 1;\n const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'bottom':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y - POLYGON_BUFFER;\n const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'left':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x + POLYGON_BUFFER + 1;\n const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);\n break;\n }\n case 'right':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x - POLYGON_BUFFER;\n const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);\n break;\n }\n default:\n }\n if (!isInsidePolygon) {\n closeIfNoOpenChild();\n } else if (!hasLanded) {\n timeout.start(40, closeIfNoOpenChild);\n }\n return undefined;\n };\n };\n\n // eslint-disable-next-line no-underscore-dangle\n fn.__options = {\n ...options,\n blockPointerEvents\n };\n return fn;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectRootContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") SelectRootContext.displayName = \"SelectRootContext\";\nexport function useSelectRootContext() {\n const context = React.useContext(SelectRootContext);\n if (context === null) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(60));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n implicit = false,\n controlRef\n } = params;\n const {\n controlId,\n registerControlId\n } = useLabelableContext();\n const defaultId = useBaseUiId(id);\n const controlIdForEffect = implicit ? controlId : undefined;\n const controlSourceRef = useRefWithInit(() => Symbol());\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(id != null);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n let nextId;\n if (implicit) {\n const elem = controlRef?.current;\n if (isElement(elem) && elem.closest('label') != null) {\n nextId = id ?? null;\n } else {\n nextId = controlIdForEffect ?? defaultId;\n }\n } else if (id != null) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n unregisterControlId();\n return undefined;\n }\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);\n React.useEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n return controlId ?? defaultId;\n}","export const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues || selectedValues.length === 0) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues || itemValues.length === 0) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {\n // Only unwrap in multiple mode: an array can itself be a valid single-select value.\n const lastValue = multiple && Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue;\n const index = findItemIndex(itemValues, lastValue, comparer);\n return index === -1 ? null : index;\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}","'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function isGroupedItems(items) {\n return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n return items[value] ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}","export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}","import { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel, stringifyAsValue } from \"../internals/resolveValueLabel.mjs\";\nexport const selectors = {\n id: state => state.id,\n labelId: state => state.labelId,\n modal: state => state.modal,\n items: state => state.items,\n itemToStringLabel: state => state.itemToStringLabel,\n isItemEqualToValue: state => state.isItemEqualToValue,\n value: state => state.value,\n hasSelectedValue: state => {\n const {\n value,\n multiple,\n itemToStringValue\n } = state;\n if (value == null) {\n return false;\n }\n if (multiple && Array.isArray(value)) {\n return value.length > 0;\n }\n return stringifyAsValue(value, itemToStringValue) !== '';\n },\n hasNullItemLabel: (state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n },\n open: state => state.open,\n mounted: state => state.mounted,\n forceMount: state => state.forceMount,\n transitionStatus: state => state.transitionStatus,\n openMethod: state => state.openMethod,\n activeIndex: state => state.activeIndex,\n selectedIndex: state => state.selectedIndex,\n isActive: (state, index) => state.activeIndex === index,\n isSelected: (state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const storeValue = state.value;\n if (state.multiple) {\n return Array.isArray(storeValue) && storeValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n\n // The value is the source of truth: a stale `selectedIndex` (e.g. the controlled\n // value changes while the popup is open, where the index sync is deferred) must not\n // keep a previously selected item marked as selected.\n return compareItemEquality(itemValue, storeValue, comparer);\n },\n isSelectedByFocus: (state, index) => {\n return state.selectedIndex === index;\n },\n popupProps: state => state.popupProps,\n triggerProps: state => state.triggerProps,\n triggerElement: state => state.triggerElement,\n positionerElement: state => state.positionerElement,\n listElement: state => state.listElement,\n popupSide: state => state.popupSide,\n scrollUpArrowVisible: state => state.scrollUpArrowVisible,\n scrollDownArrowVisible: state => state.scrollDownArrowVisible,\n hasScrollArrows: state => state.hasScrollArrows\n};","export function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {\n return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { platform } from '@base-ui/utils/platform';\nimport { useValueChanged } from \"../internals/useValueChanged.mjs\";\nexport function useOpenMethodTriggerProps(open, setOpenMethod) {\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n const isOpen = typeof open === 'function' ? open() : open;\n if (!isOpen) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n platform.os.ios ? 'touch' : ''));\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n onClick,\n onPointerDown\n }), [onClick, onPointerDown]);\n}\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n return React.useMemo(() => ({\n openMethod,\n triggerProps\n }), [openMethod, triggerProps]);\n}","'use client';\n\nimport * as React from 'react';\n/**\n * Provides a cross-browser way to determine the type of the pointer used to click.\n * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.\n * Additionally, this implementation detects if the click was triggered by the keyboard.\n *\n * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.\n */\nexport function useEnhancedClickHandler(handler) {\n const lastClickInteractionTypeRef = React.useRef('');\n const handlePointerDown = React.useCallback(event => {\n if (event.defaultPrevented) {\n return;\n }\n lastClickInteractionTypeRef.current = event.pointerType;\n handler(event, event.pointerType);\n }, [handler]);\n const handleClick = React.useCallback(event => {\n // event.detail has the number of clicks performed on the element. 0 means it was triggered by the keyboard.\n if (event.detail === 0) {\n handler(event, 'keyboard');\n return;\n }\n if ('pointerType' in event) {\n // Chrome and Edge correctly use PointerEvent\n handler(event, event.pointerType);\n } else {\n handler(event, lastClickInteractionTypeRef.current);\n }\n lastClickInteractionTypeRef.current = '';\n }, [handler]);\n return {\n onClick: handleClick,\n onPointerDown: handlePointerDown\n };\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","import { clamp } from \"../internals/clamp.mjs\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabel } from \"../../internals/labelable-provider/useLabel.mjs\";\nimport { getDefaultLabelId } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An accessible label that is automatically associated with the select trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectLabel = /*#__PURE__*/React.forwardRef(function SelectLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.\n const elementPropsWithoutId = elementProps;\n delete elementPropsWithoutId.id;\n const fieldRootContext = useFieldRootContext();\n const {\n store\n } = useSelectRootContext();\n const triggerElement = useStore(store, selectors.triggerElement);\n const rootId = useStore(store, selectors.id);\n const defaultLabelId = getDefaultLabelId(rootId);\n const labelProps = useLabel({\n id: defaultLabelId,\n fallbackControlId: triggerElement?.id ?? rootId,\n setLabelId(nextLabelId) {\n const resolvedLabelId = typeof nextLabelId === 'function' ? nextLabelId(store.state.labelId) : nextLabelId;\n store.set('labelId', resolvedLabelId);\n }\n });\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state: fieldRootContext.state,\n props: [labelProps, elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectLabel.displayName = \"SelectLabel\";","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../internals/useBaseUiId.mjs\";\nexport function useRegisteredLabelId(idProp, setLabelId) {\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n return id;\n}","'use client';\n\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { useRegisteredLabelId } from \"../../utils/useRegisteredLabelId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabel(params = {}) {\n const {\n id: idProp,\n fallbackControlId,\n native = false,\n setLabelId: setLabelIdProp,\n focusControl: focusControlProp\n } = params;\n const {\n controlId: contextControlId,\n setLabelId: setContextLabelId\n } = useLabelableContext();\n const syncLabelId = useStableCallback(nextLabelId => {\n setContextLabelId(nextLabelId);\n setLabelIdProp?.(nextLabelId);\n });\n const id = useRegisteredLabelId(idProp, syncLabelId);\n const resolvedControlId = contextControlId ?? fallbackControlId;\n function focusControl(event) {\n if (focusControlProp) {\n focusControlProp(event, resolvedControlId);\n return;\n }\n if (!resolvedControlId) {\n return;\n }\n const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);\n if (isHTMLElement(controlElement)) {\n focusElementWithVisible(controlElement);\n }\n }\n function handleInteraction(event) {\n const target = getTarget(event.nativeEvent);\n if (target?.closest('button,input,select,textarea')) {\n return;\n }\n\n // Prevent text selection when double clicking label.\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n if (native) {\n return;\n }\n focusControl(event);\n }\n return native ? {\n id,\n htmlFor: resolvedControlId ?? undefined,\n onMouseDown: handleInteraction\n } : {\n id,\n onClick: handleInteraction,\n onPointerDown(event) {\n event.preventDefault();\n }\n };\n}\nexport function focusElementWithVisible(element) {\n element.focus({\n // Available from Chrome 144+ (January 2026).\n // Safari and Firefox already support it.\n focusVisible: true\n });\n}","'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { isMouseWithinBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nconst SELECTED_DELAY = 400;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n setFocused,\n validationMode,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const {\n store,\n setOpen,\n selectionRef,\n validation,\n readOnly,\n required,\n alignItemWithTriggerActiveRef,\n disabled: selectDisabled\n } = useSelectRootContext();\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const value = useStore(store, selectors.value);\n const triggerProps = useStore(store, selectors.triggerProps);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const popupSideValue = useStore(store, selectors.popupSide);\n const rootId = useStore(store, selectors.id);\n const selectLabelId = useStore(store, selectors.labelId);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = store.useStateSetter('triggerElement');\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n // A mousedown on the trigger can open the popup under the cursor. Keep mouseup selection\n // disabled briefly so releasing over either the selected item or a neighboring item doesn't\n // commit an accidental selection. SelectItem can still opt into unselected mouseup sooner\n // after a real drag over the item.\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n selectionRef.current.allowSelectedMouseUp = true;\n });\n return () => {\n selectedDelayTimeout.clear();\n };\n }\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, selectionRef, timeoutMouseDown, selectedDelayTimeout]);\n const mergedProps = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open,\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && alignItemWithTriggerActiveRef.current) {\n setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Don't treat the release as an outside press when it lands on the trigger or inside\n // the popup positioner (or their children).\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n if (isMouseWithinBounds(mouseEvent, triggerRef.current)) {\n return;\n }\n setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, elementProps, getButtonProps);\n const props = validation.getValidationProps(disabled, mergedProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n popupSide,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef, buttonRef, setTriggerElement],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";","import { TransitionStatusDataAttributes, transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\nexport let CommonPopupDataAttributes = function (CommonPopupDataAttributes) {\n /**\n * Present when the popup is open.\n */\n CommonPopupDataAttributes[\"open\"] = \"data-open\";\n /**\n * Present when the popup is closed.\n */\n CommonPopupDataAttributes[\"closed\"] = \"data-closed\";\n /**\n * Present when the popup begins animating in.\n */\n CommonPopupDataAttributes[CommonPopupDataAttributes[\"startingStyle\"] = TransitionStatusDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the popup is animating out.\n */\n CommonPopupDataAttributes[CommonPopupDataAttributes[\"endingStyle\"] = TransitionStatusDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the anchor is hidden.\n */\n CommonPopupDataAttributes[\"anchorHidden\"] = \"data-anchor-hidden\";\n /**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\n CommonPopupDataAttributes[\"side\"] = \"data-side\";\n /**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\n CommonPopupDataAttributes[\"align\"] = \"data-align\";\n return CommonPopupDataAttributes;\n}({});\nexport let CommonTriggerDataAttributes = /*#__PURE__*/function (CommonTriggerDataAttributes) {\n /**\n * Present when the popup is open.\n */\n CommonTriggerDataAttributes[\"popupOpen\"] = \"data-popup-open\";\n /**\n * Present when a pressable trigger is pressed.\n */\n CommonTriggerDataAttributes[\"pressed\"] = \"data-pressed\";\n return CommonTriggerDataAttributes;\n}({});\n\n// Literal keys (instead of enum member references) keep the docs-only enums above\n// tree-shakeable: a runtime reference would retain the whole enum IIFE in every bundle.\nconst TRIGGER_HOOK = {\n 'data-popup-open': ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n 'data-popup-open': '',\n 'data-pressed': ''\n};\nconst POPUP_OPEN_HOOK = {\n 'data-open': ''\n};\nconst POPUP_CLOSED_HOOK = {\n 'data-closed': ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n 'data-anchor-hidden': ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};\nexport const popupTransitionStateMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};","import { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\n// Tolerance around the element bounds so a fast click whose pointer drifts slightly\n// during press-release isn't mistaken for a drag-off-and-release cancellation.\n// Matches typical OS/browser drag-initiation thresholds.\nconst BOUNDARY_OFFSET = 5;\n\n/**\n * Determines if a mouse event occurred within the bounds of an element\n * (including its pseudo-elements), with a small tolerance for pointer drift.\n */\nexport function isMouseWithinBounds(event, element) {\n const bounds = getPseudoElementBounds(element);\n return event.clientX >= bounds.left - BOUNDARY_OFFSET && event.clientX <= bounds.right + BOUNDARY_OFFSET && event.clientY >= bounds.top - BOUNDARY_OFFSET && event.clientY <= bounds.bottom + BOUNDARY_OFFSET;\n}\nexport function getPseudoElementBounds(element) {\n const elementRect = element.getBoundingClientRect();\n const win = ownerWindow(element);\n\n // Avoid \"Not implemented: window.getComputedStyle(elt, pseudoElt)\" in jsdom.\n if (platform.env.jsdom) {\n return elementRect;\n }\n const beforeStyles = win.getComputedStyle(element, '::before');\n const afterStyles = win.getComputedStyle(element, '::after');\n const hasPseudoElements = beforeStyles.content !== 'none' || afterStyles.content !== 'none';\n if (!hasPseudoElements) {\n return elementRect;\n }\n\n // Get dimensions of pseudo-elements\n const beforeWidth = parseFloat(beforeStyles.width) || 0;\n const beforeHeight = parseFloat(beforeStyles.height) || 0;\n const afterWidth = parseFloat(afterStyles.width) || 0;\n const afterHeight = parseFloat(afterStyles.height) || 0;\n\n // Calculate max dimensions including pseudo-elements\n const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);\n const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);\n\n // Calculate the differences to extend the bounds\n const widthDiff = totalWidth - elementRect.width;\n const heightDiff = totalHeight - elementRect.height;\n return {\n left: elementRect.left - widthDiff / 2,\n right: elementRect.right + widthDiff / 2,\n top: elementRect.top - heightDiff / 2,\n bottom: elementRect.bottom + heightDiff / 2\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (shouldCheckNullItemLabel && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * An overlay displayed beneath the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectBackdrop = /*#__PURE__*/React.forwardRef(function SelectBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const state = {\n open,\n transitionStatus\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectBackdrop.displayName = \"SelectBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { SelectPositionerContext } from \"./SelectPositionerContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { clearStyles } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findItemIndex } from \"../../internals/itemEquality.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst FIXED = {\n position: 'fixed'\n};\n\n/**\n * Positions the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPositioner = /*#__PURE__*/React.forwardRef(function SelectPositioner(componentProps, forwardedRef) {\n const {\n anchor,\n className,\n render,\n // `useAnchorPositioning` applies the same defaults to the undefined values; the names\n // remain destructured to exclude the props from `elementProps`.\n positionMethod,\n side,\n align,\n sideOffset,\n alignOffset,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding,\n sticky,\n disableAnchorTracking,\n alignItemWithTrigger = true,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n listRef,\n labelsRef,\n alignItemWithTriggerActiveRef,\n selectedItemTextRef,\n valuesRef,\n initialValueRef,\n popupRef,\n setValue,\n floatingContext: floatingRootContext\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const modal = useStore(store, selectors.modal);\n const value = useStore(store, selectors.value);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const scrollUpArrowRef = React.useRef(null);\n const scrollDownArrowRef = React.useRef(null);\n const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React.useState(alignItemWithTrigger);\n const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== 'touch';\n if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {\n setControlledAlignItemWithTrigger(alignItemWithTrigger);\n }\n React.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);\n useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === 'touch', positionerElement, triggerElement);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,\n collisionAvoidance,\n keepMounted: true\n });\n const renderedSide = alignItemWithTriggerActive ? 'none' : positioning.side;\n const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;\n const state = {\n open,\n side: renderedSide,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = store.useStateSetter('positionerElement');\n const element = usePositioner(componentProps, state, {\n styles: positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n const prevMapSizeRef = React.useRef(0);\n const onMapChange = useStableCallback(map => {\n if (valuesRef.current.length === 0) {\n return;\n }\n const prevSize = prevMapSizeRef.current;\n prevMapSizeRef.current = map.size;\n if (map.size === prevSize) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.none);\n if (prevSize !== 0 && !store.state.multiple && value !== null) {\n const selectedValueIndex = findItemIndex(valuesRef.current, value, isItemEqualToValue);\n if (selectedValueIndex === -1) {\n const initialSelectedValue = initialValueRef.current;\n const hasInitial = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1;\n const nextValue = hasInitial ? initialSelectedValue : null;\n setValue(nextValue, eventDetails);\n if (nextValue === null) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {\n const nextValue = value.filter(selectedItemValue => findItemIndex(valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1);\n if (nextValue.length !== value.length) {\n setValue(nextValue, eventDetails);\n if (nextValue.length === 0) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (open && alignItemWithTriggerActive) {\n store.update({\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n const stylesToClear = {\n height: ''\n };\n clearStyles(positionerElement, stylesToClear);\n clearStyles(popupRef.current, stylesToClear);\n }\n });\n const contextValue = React.useMemo(() => ({\n ...positioning,\n side: renderedSide,\n alignItemWithTriggerActive,\n setControlledAlignItemWithTrigger,\n scrollUpArrowRef,\n scrollDownArrowRef\n }), [positioning, renderedSide, alignItemWithTriggerActive, setControlledAlignItemWithTrigger]);\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: listRef,\n labelsRef: labelsRef,\n onMapChange: onMapChange,\n children: /*#__PURE__*/_jsxs(SelectPositionerContext.Provider, {\n value: contextValue,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: triggerElement\n }), element]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPositioner.displayName = \"SelectPositioner\";","import { isReactVersionAtLeast } from \"./reactVersion.mjs\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}","/* eslint-disable no-bitwise */\n'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { CompositeListContext } from \"./CompositeListContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Provides context for a list of items in a composite component.\n */\nexport function CompositeList(props) {\n const {\n children,\n elementsRef,\n labelsRef,\n onMapChange: onMapChangeProp\n } = props;\n const onMapChange = useStableCallback(onMapChangeProp);\n const [, setMapTick] = React.useState(false);\n const listeners = useRefWithInit(createListeners).current;\n const map = useRefWithInit(createMap).current;\n const nextIndexRef = React.useRef(0);\n const isDirtyRef = React.useRef(true);\n const itemsRef = React.useRef([]);\n const mutationObserverRef = React.useRef(null);\n\n // Item effects can run without their parent rendering. Schedule one synchronous\n // parent update for the whole commit so refs are rebuilt before paint and while\n // the originating React event is still inside `act()` in tests.\n const scheduleMapUpdate = useStableCallback(() => {\n if (isDirtyRef.current) {\n return;\n }\n isDirtyRef.current = true;\n setMapTick(tick => !tick);\n });\n const register = useStableCallback((node, registration) => {\n map.set(node, registration);\n scheduleMapUpdate();\n });\n const unregister = useStableCallback(node => {\n map.delete(node);\n scheduleMapUpdate();\n });\n const syncRefs = useStableCallback(items => {\n const nextMap = new Map();\n elementsRef.current.length = 0;\n if (labelsRef) {\n labelsRef.current.length = 0;\n }\n items.forEach(item => {\n nextMap.set(item.element, {\n ...(item.registration.metadata ?? {}),\n index: item.index\n });\n elementsRef.current[item.index] = item.element;\n if (labelsRef) {\n labelsRef.current[item.index] = item.registration.label !== undefined ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;\n }\n });\n nextIndexRef.current = elementsRef.current.length;\n return nextMap;\n });\n function observe(sortedNodes) {\n mutationObserverRef.current?.disconnect();\n mutationObserverRef.current = null;\n\n // A single item can't reorder.\n if (typeof MutationObserver !== 'function' || sortedNodes.length < 2) {\n return;\n }\n const mutationObserver = new MutationObserver(entries => {\n // Only verify the order after a move: a node that was removed and later\n // re-added within the same batch. Additions and removals alone can't\n // change the relative order of the remaining items, and items that mount\n // or unmount re-sort through `register`/`unregister`.\n if (!hasMovedNode(entries)) {\n return;\n }\n let previousConnectedNode = null;\n\n // If any connected node now appears before the previous connected node,\n // wrappers/items moved and the index map needs to be rebuilt.\n for (const node of sortedNodes) {\n if (!node.isConnected) {\n continue;\n }\n if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {\n mutationObserver.disconnect();\n scheduleMapUpdate();\n return;\n }\n previousConnectedNode = node;\n }\n });\n mutationObserverRef.current = mutationObserver;\n\n // A reorder that changes item indexes must invert at least one adjacent pair\n // from the previous sorted order. Observing each pair's common parent catches\n // both direct item moves and ancestor wrapper moves at the boundary.\n const roots = new Set();\n for (let i = 1; i < sortedNodes.length; i += 1) {\n const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);\n if (root) {\n roots.add(root);\n }\n }\n roots.forEach(root => mutationObserver.observe(root, {\n childList: true\n }));\n }\n const flush = useStableCallback(() => {\n const [items, automaticNodes] = getCompositeListSnapshot(map);\n const nextMap = syncRefs(items);\n observe(automaticNodes);\n itemsRef.current = items;\n isDirtyRef.current = false;\n listeners.forEach(listener => listener(nextMap));\n onMapChange(nextMap);\n });\n useIsoLayoutEffect(() => {\n // Re-copy the last committed snapshot when the ref objects change or Strict Mode replays\n // effects without reattaching callback refs.\n if (!isDirtyRef.current) {\n syncRefs(itemsRef.current);\n }\n return () => {\n elementsRef.current = [];\n if (labelsRef) {\n labelsRef.current = [];\n }\n };\n }, [elementsRef, labelsRef, syncRefs]);\n useIsoLayoutEffect(() => {\n if (isDirtyRef.current) {\n flush();\n }\n });\n useIsoLayoutEffect(() => {\n return () => {\n mutationObserverRef.current?.disconnect();\n // React 18 Strict Mode replays effects without replaying callback refs.\n // Mark the retained map dirty so the replay rebuilds refs and observation.\n isDirtyRef.current = true;\n };\n }, []);\n const subscribeMapChange = useStableCallback(fn => {\n listeners.add(fn);\n return () => {\n listeners.delete(fn);\n };\n });\n const contextValue = React.useMemo(() => ({\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n }), [register, unregister, subscribeMapChange, nextIndexRef]);\n return /*#__PURE__*/_jsx(CompositeListContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createMap() {\n return new Map();\n}\nfunction createListeners() {\n return new Set();\n}\nfunction getCompositeListSnapshot(map) {\n const reservedIndices = new Set();\n const items = [];\n const automaticItems = [];\n map.forEach((registration, node) => {\n if (!node.isConnected) {\n return;\n }\n const index = registration.index;\n const item = {\n index: index ?? -1,\n element: node,\n registration\n };\n if (index === null) {\n automaticItems.push(item);\n } else if (index >= 0) {\n reservedIndices.add(index);\n items.push(item);\n }\n });\n let nextAutomaticIndex = 0;\n automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));\n automaticItems.forEach(item => {\n while (reservedIndices.has(nextAutomaticIndex)) {\n nextAutomaticIndex += 1;\n }\n item.index = nextAutomaticIndex;\n items.push(item);\n nextAutomaticIndex += 1;\n });\n if (reservedIndices.size > 0) {\n items.sort((a, b) => a.index - b.index);\n }\n return [items, automaticItems.map(item => item.element)];\n}\nfunction getCommonAncestor(firstNode, lastNode) {\n let ancestor = firstNode.parentElement;\n\n // The `parentElement` walk cannot cross shadow boundaries, so the native\n // `contains` is sufficient here.\n while (ancestor && !ancestor.contains(lastNode)) {\n ancestor = ancestor.parentElement;\n }\n return ancestor;\n}\nfunction hasMovedNode(entries) {\n for (const entry of entries) {\n for (let i = 0; i < entry.removedNodes.length; i += 1) {\n if (entry.removedNodes[i].isConnected) {\n return true;\n }\n }\n }\n return false;\n}\nfunction sortByDocumentPosition(a, b) {\n // `DOCUMENT_POSITION_CONTAINED_BY` is always reported alongside `FOLLOWING`, and `CONTAINS`\n // alongside `PRECEDING`, so testing `FOLLOWING` alone orders siblings and nested items alike.\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n}","'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => () => {},\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { getSide, getAlignment, getSideAxis } from '@floating-ui/utils';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { autoUpdate, flip, limitShift, offset, shift as floatingShift, size } from \"../floating-ui-react/index.mjs\";\nimport { useBaseUIFloating } from \"../floating-ui-react/hooks/useFloating.mjs\";\nimport { useDirection } from \"./direction-context/DirectionContext.mjs\";\nimport { arrow } from \"../floating-ui-react/middleware/arrow.mjs\";\nimport { hide } from \"../utils/hideMiddleware.mjs\";\nimport { DEFAULT_SIDES } from \"../utils/adaptiveOriginConstants.mjs\";\nconst AVAILABLE_WIDTH_VAR = '--available-width';\nconst AVAILABLE_HEIGHT_VAR = '--available-height';\nfunction getLogicalSide(sideParam, renderedSide, isRtl) {\n const isLogicalSideParam = sideParam === 'inline-start' || sideParam === 'inline-end';\n const logicalRight = isRtl ? 'inline-start' : 'inline-end';\n const logicalLeft = isRtl ? 'inline-end' : 'inline-start';\n return {\n top: 'top',\n right: isLogicalSideParam ? logicalRight : 'right',\n bottom: 'bottom',\n left: isLogicalSideParam ? logicalLeft : 'left'\n }[renderedSide];\n}\nfunction getOffsetData(state, sideParam, isRtl) {\n const {\n rects,\n placement\n } = state;\n const data = {\n side: getLogicalSide(sideParam, getSide(placement), isRtl),\n align: getAlignment(placement) || 'center',\n anchor: {\n width: rects.reference.width,\n height: rects.reference.height\n },\n positioner: {\n width: rects.floating.width,\n height: rects.floating.height\n }\n };\n return data;\n}\n/**\n * Provides standardized anchor positioning behavior for floating elements. Wraps Floating UI's\n * `useFloating` hook.\n */\nexport function useAnchorPositioning(params) {\n return useAnchorPositioningWithHook(params, useBaseUIFloating);\n}\nexport function useAnchorPositioningWithHook(params, useFloatingHook) {\n const {\n // Public parameters\n anchor,\n positionMethod = 'absolute',\n side: sideParam = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n collisionBoundary,\n collisionPadding: collisionPaddingParam = 5,\n sticky = false,\n arrowPadding = 5,\n disableAnchorTracking = false,\n inline: inlineMiddleware,\n // Private parameters\n keepMounted = false,\n floatingRootContext,\n mounted,\n collisionAvoidance,\n shift,\n nodeId,\n adaptiveOrigin,\n lazyFlip = false,\n externalTree\n } = params;\n const [mountSide, setMountSide] = React.useState(null);\n if (!mounted && mountSide !== null) {\n setMountSide(null);\n }\n const collisionAvoidanceSide = collisionAvoidance.side || 'flip';\n const collisionAvoidanceAlign = collisionAvoidance.align || 'flip';\n const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || 'end';\n const shiftCrossAxis = shift?.crossAxis ?? false;\n const shiftRootBoundary = shift?.rootBoundary;\n const anchorFn = typeof anchor === 'function' ? anchor : undefined;\n const anchorFnCallback = useStableCallback(anchorFn);\n const anchorDep = anchorFn ? anchorFnCallback : anchor;\n const anchorValueRef = useValueAsRef(anchor);\n const mountedRef = useValueAsRef(mounted);\n const direction = useDirection();\n const isRtl = direction === 'rtl';\n const side = mountSide || {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n 'inline-end': isRtl ? 'left' : 'right',\n 'inline-start': isRtl ? 'right' : 'left'\n }[sideParam];\n const placement = align === 'center' ? side : `${side}-${align}`;\n let collisionPadding = collisionPaddingParam;\n if (typeof collisionPadding === 'number') {\n collisionPadding = {\n top: collisionPadding,\n right: collisionPadding,\n bottom: collisionPadding,\n left: collisionPadding\n };\n } else if (collisionPadding) {\n collisionPadding = {\n top: collisionPadding.top || 0,\n right: collisionPadding.right || 0,\n bottom: collisionPadding.bottom || 0,\n left: collisionPadding.left || 0\n };\n }\n\n // Create a bias to the preferred side.\n // On iOS, when the mobile software keyboard opens, the input is exactly centered\n // in the viewport, but this can cause it to flip to the top undesirably.\n // The bias is only applied to `flip()` so it doesn't shift the resting position\n // computed by `shift()` and `size()` away from the requested `collisionPadding`.\n const bias = 1;\n const biasTop = sideParam === 'bottom' ? bias : 0;\n const biasBottom = sideParam === 'top' ? bias : 0;\n const biasLeft = sideParam === 'right' ? bias : 0;\n const biasRight = sideParam === 'left' ? bias : 0;\n const commonCollisionProps = {\n boundary: collisionBoundary === 'clipping-ancestors' ? 'clippingAncestors' : collisionBoundary,\n padding: collisionPadding\n };\n\n // Using a ref assumes that the arrow element is always present in the DOM for the lifetime of the\n // popup. If this assumption ends up being false, we can switch to state to manage the arrow's\n // presence.\n const arrowRef = React.useRef(null);\n\n // Keep these reactive if they're not functions\n const sideOffsetRef = useValueAsRef(sideOffset);\n const alignOffsetRef = useValueAsRef(alignOffset);\n const sideOffsetDep = typeof sideOffset !== 'function' ? sideOffset : 0;\n const alignOffsetDep = typeof alignOffset !== 'function' ? alignOffset : 0;\n const middleware = [];\n if (inlineMiddleware) {\n middleware.push(inlineMiddleware);\n }\n middleware.push(offset(state => {\n const data = getOffsetData(state, sideParam, isRtl);\n const sideAxis = typeof sideOffsetRef.current === 'function' ? sideOffsetRef.current(data) : sideOffsetRef.current;\n const alignAxis = typeof alignOffsetRef.current === 'function' ? alignOffsetRef.current(data) : alignOffsetRef.current;\n return {\n mainAxis: sideAxis,\n crossAxis: alignAxis,\n alignmentAxis: alignAxis\n };\n }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));\n const shiftDisabled = collisionAvoidanceAlign === 'none' && collisionAvoidanceSide !== 'shift';\n const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === 'shift');\n const flipMiddleware = collisionAvoidanceSide === 'none' ? null : flip({\n ...commonCollisionProps,\n // Ensure the popup flips if it's been limited by its --available-height and it resizes.\n // Since the size() padding is smaller than the flip() padding, flip() will take precedence.\n padding: {\n top: collisionPadding.top + bias + biasTop,\n right: collisionPadding.right + bias + biasRight,\n bottom: collisionPadding.bottom + bias + biasBottom,\n left: collisionPadding.left + bias + biasLeft\n },\n mainAxis: !shiftCrossAxis && collisionAvoidanceSide === 'flip',\n crossAxis: collisionAvoidanceAlign === 'flip' ? 'alignment' : false,\n fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide\n });\n const shiftMiddleware = shiftDisabled ? null : floatingShift({\n ...commonCollisionProps,\n // Use the Layout Viewport to avoid shifting around when pinch-zooming.\n rootBoundary: shiftRootBoundary,\n mainAxis: collisionAvoidanceAlign !== 'none',\n crossAxis: crossAxisShiftEnabled,\n limiter: sticky || shiftCrossAxis ? undefined : limitShift(limitData => {\n if (!arrowRef.current) {\n return {};\n }\n const {\n width,\n height\n } = arrowRef.current.getBoundingClientRect();\n const sideAxis = getSideAxis(getSide(limitData.placement));\n const arrowSize = sideAxis === 'y' ? width : height;\n const offsetAmount = sideAxis === 'y' ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;\n return {\n offset: arrowSize / 2 + offsetAmount / 2\n };\n })\n }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);\n\n // https://floating-ui.com/docs/flip#combining-with-shift\n if (collisionAvoidanceSide === 'shift' || collisionAvoidanceAlign === 'shift' || align === 'center') {\n middleware.push(shiftMiddleware, flipMiddleware);\n } else {\n middleware.push(flipMiddleware, shiftMiddleware);\n }\n middleware.push(size({\n ...commonCollisionProps,\n apply({\n elements: {\n floating\n },\n availableWidth,\n availableHeight,\n rects\n }) {\n if (!mountedRef.current) {\n return;\n }\n const floatingStyle = floating.style;\n floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth}px`);\n floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight}px`);\n\n // Snap anchor dimensions to device pixels to ensure the popup's visual width matches the anchor's one.\n const dpr = ownerWindow(floating).devicePixelRatio || 1;\n const {\n x,\n y,\n width,\n height\n } = rects.reference;\n const anchorWidth = (Math.round((x + width) * dpr) - Math.round(x * dpr)) / dpr;\n const anchorHeight = (Math.round((y + height) * dpr) - Math.round(y * dpr)) / dpr;\n floatingStyle.setProperty('--anchor-width', `${anchorWidth}px`);\n floatingStyle.setProperty('--anchor-height', `${anchorHeight}px`);\n }\n }), arrow(state => ({\n // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,\n // we'll create a fake element.\n element: arrowRef.current || ownerDocument(state.elements.floating).createElement('div'),\n padding: arrowPadding,\n offsetParent: 'floating'\n }), [arrowPadding]), {\n name: 'transformOrigin',\n fn(state) {\n const {\n elements,\n middlewareData,\n placement: renderedPlacement,\n rects,\n y\n } = state;\n const currentRenderedSide = getSide(renderedPlacement);\n const currentRenderedAxis = getSideAxis(currentRenderedSide);\n const arrowEl = arrowRef.current;\n const arrowX = middlewareData.arrow?.x || 0;\n const arrowY = middlewareData.arrow?.y || 0;\n const arrowWidth = arrowEl?.clientWidth || 0;\n const arrowHeight = arrowEl?.clientHeight || 0;\n const transformX = arrowX + arrowWidth / 2;\n const transformY = arrowY + arrowHeight / 2;\n const shiftY = Math.abs(middlewareData.shift?.y || 0);\n const halfAnchorHeight = rects.reference.height / 2;\n const sideOffsetValue = typeof sideOffset === 'function' ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;\n const isOverlappingAnchor = shiftY > sideOffsetValue;\n const adjacentTransformOrigin = {\n top: `${transformX}px calc(100% + ${sideOffsetValue}px)`,\n bottom: `${transformX}px ${-sideOffsetValue}px`,\n left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`,\n right: `${-sideOffsetValue}px ${transformY}px`\n }[currentRenderedSide];\n const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y}px`;\n elements.floating.style.setProperty('--transform-origin', crossAxisShiftEnabled && currentRenderedAxis === 'y' && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin);\n return {};\n }\n }, hide, adaptiveOrigin);\n useIsoLayoutEffect(() => {\n // Ensure positioning doesn't run initially for `keepMounted` elements that\n // aren't initially open.\n if (!mounted && floatingRootContext) {\n floatingRootContext.update({\n referenceElement: null,\n floatingElement: null,\n domReferenceElement: null,\n positionReference: null\n });\n }\n }, [mounted, floatingRootContext]);\n const autoUpdateOptions = React.useMemo(() => ({\n elementResize: !disableAnchorTracking && typeof ResizeObserver !== 'undefined',\n layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== 'undefined'\n }), [disableAnchorTracking]);\n const {\n refs,\n elements,\n x,\n y,\n middlewareData,\n update,\n placement: renderedPlacement,\n context,\n isPositioned,\n floatingStyles: originalFloatingStyles\n } = useFloatingHook({\n rootContext: floatingRootContext,\n open: keepMounted ? mounted : undefined,\n placement,\n middleware,\n strategy: positionMethod,\n whileElementsMounted: keepMounted ? undefined : (...args) => autoUpdate(...args, autoUpdateOptions),\n nodeId,\n externalTree\n });\n const {\n sideX,\n sideY\n } = middlewareData.adaptiveOrigin || DEFAULT_SIDES;\n\n // Default to `fixed` when not positioned to prevent `autoFocus` scroll jumps.\n // This ensures the popup is inside the viewport initially before it gets positioned.\n const resolvedPosition = isPositioned ? positionMethod : 'fixed';\n const floatingStyles = React.useMemo(() => {\n let base;\n if (!isPositioned) {\n // Until a position for the current open is computed, ignore any coordinates retained from a\n // previous open (or from a pass that measured the hidden popup as 0x0). Rendering the\n // full-size popup at such stale coordinates can overflow the layout viewport, which makes\n // mobile Chrome zoom the page out and reflow everything the popup is anchored to.\n base = {\n position: resolvedPosition,\n top: 0,\n left: 0\n };\n } else if (adaptiveOrigin) {\n base = {\n position: resolvedPosition,\n [sideX]: x,\n [sideY]: y\n };\n } else {\n base = {\n ...originalFloatingStyles,\n position: resolvedPosition\n };\n }\n\n // Seed the available size vars so consumer `max-height: min(x, var(--available-height))` rules\n // resolve to a valid length on the first positioning pass, before `size()` writes the real\n // values. Without a fallback the unresolved `var()` invalidates the whole declaration, so the\n // popup is measured unconstrained while `flip()` picks its side, against the full content\n // height rather than the capped one. Seeded unconditionally (not only while `!isPositioned`):\n // the keys must stay present with a constant value so React's per-property style diff never\n // rewrites them after mount, preserving the px values `size()` sets imperatively. Moving them\n // into the `!isPositioned` branch makes React remove them once positioned, wiping `size()`'s\n // values and leaving the popup unconstrained.\n base[AVAILABLE_WIDTH_VAR] = '100vw';\n base[AVAILABLE_HEIGHT_VAR] = '100vh';\n if (!isPositioned) {\n base.opacity = 0;\n }\n return base;\n }, [adaptiveOrigin, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);\n const registeredPositionReferenceRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n const resolvedAnchor = typeof anchorValue === 'function' ? anchorValue() : anchorValue;\n const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;\n const finalAnchor = unwrappedElement || null;\n if (finalAnchor !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(finalAnchor);\n registeredPositionReferenceRef.current = finalAnchor;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n\n // Refs from parent components are set after useLayoutEffect runs and are available in useEffect.\n // Therefore, if the anchor is a ref, we need to update the position reference in useEffect.\n if (typeof anchorValue === 'function') {\n return;\n }\n if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(anchorValue.current);\n registeredPositionReferenceRef.current = anchorValue.current;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (keepMounted && mounted && elements.reference && elements.floating) {\n return autoUpdate(elements.reference, elements.floating, update, autoUpdateOptions);\n }\n return undefined;\n }, [keepMounted, mounted, elements, update, autoUpdateOptions]);\n const renderedSide = getSide(renderedPlacement);\n const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);\n const renderedAlign = getAlignment(renderedPlacement) || 'center';\n const anchorHidden = Boolean(middlewareData.hide?.referenceHidden);\n\n // Locks the flip (makes it \"sticky\") so it doesn't prefer a given placement\n // and flips back lazily, not eagerly. Ideal for filtered lists that change\n // the size of the popup dynamically to avoid unwanted flipping when typing.\n useIsoLayoutEffect(() => {\n if (lazyFlip && mounted && isPositioned && renderedSide !== side) {\n setMountSide(renderedSide);\n }\n }, [lazyFlip, mounted, isPositioned, renderedSide, side]);\n const arrowStyles = React.useMemo(() => ({\n position: 'absolute',\n top: middlewareData.arrow?.y,\n left: middlewareData.arrow?.x\n }), [middlewareData.arrow]);\n const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;\n return React.useMemo(() => ({\n positionerStyles: floatingStyles,\n arrowStyles,\n arrowRef,\n arrowUncentered,\n side: logicalRenderedSide,\n align: renderedAlign,\n physicalSide: renderedSide,\n anchorHidden,\n refs,\n context,\n isPositioned,\n update\n }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update]);\n}\nfunction isRef(param) {\n return param != null && 'current' in param;\n}","'use client';\n\nimport * as React from 'react';\nexport const DirectionContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DirectionContext.displayName = \"DirectionContext\";\nexport function useDirection() {\n const context = React.useContext(DirectionContext);\n return context?.direction ?? 'ltr';\n}","import { clamp, evaluate, getAlignment, getAlignmentAxis, getAxisLength, getPaddingObject } from '@floating-ui/utils';\n/**\n * Fork of the original `arrow` middleware from Floating UI that allows\n * configuring the offset parent.\n */\nexport const baseArrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0,\n offsetParent = 'real'\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = offsetParent === 'real' ? await platform.getOffsetParent?.(element) : elements.floating;\n let clientSize = elements.floating[clientProp] || rects.floating[length];\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await platform.isElement?.(arrowOffsetParent))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n // eslint-disable-next-line no-nested-ternary\n const alignmentOffset = shouldAddOffset ? center < min ? center - min : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nexport const arrow = (options, deps) => ({\n ...baseArrow(options),\n options: [options, deps]\n});","export const hide = {\n name: 'hide',\n async fn(state) {\n const {\n width,\n height,\n x,\n y\n } = state.rects.reference;\n const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0;\n // Mirrors Floating UI's `hide()` referenceHidden strategy. Floating UI injects\n // `detectOverflow` into the middleware platform before invoking middleware.\n const overflow = await state.platform.detectOverflow(state, {\n elementContext: 'reference'\n });\n const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;\n return {\n data: {\n referenceHidden: referenceHidden || anchorHidden\n }\n };\n }\n};","export const DEFAULT_SIDES = {\n sideX: 'left',\n sideY: 'top'\n};\n\n// Self-contained stand-in for Floating UI's `Middleware` type. Referencing the real type in\n// store state makes `tsc` declaration emit reference `Platform`/`detectOverflow` from\n// `@floating-ui/core` internals, which fails as non-portable (TS2883) in consuming builds.","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPositionerContext.displayName = \"SelectPositionerContext\";\nexport function useSelectPositionerContext() {\n const context = React.useContext(SelectPositionerContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.' : _formatErrorMessage(59));\n }\n return context;\n}","import * as React from 'react';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const InternalBackdrop = /*#__PURE__*/React.forwardRef(function InternalBackdrop(props, ref) {\n const {\n cutout,\n ...otherProps\n } = props;\n let clipPath;\n if (cutout) {\n const rect = cutout.getBoundingClientRect();\n clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"presentation\"\n // Ensures Floating UI's outside press detection runs, as it considers\n // it an element that existed when the popup rendered.\n ,\n \"data-base-ui-inert\": \"\",\n ...otherProps,\n style: {\n position: 'fixed',\n inset: 0,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n clipPath\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") InternalBackdrop.displayName = \"InternalBackdrop\";","export function clearStyles(element, originalStyles) {\n if (element) {\n Object.assign(element.style, originalStyles);\n }\n}\nexport const LIST_FUNCTIONAL_STYLES = {\n position: 'relative',\n maxHeight: '100%',\n overflowX: 'hidden',\n overflowY: 'auto'\n};","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { DISABLED_TRANSITIONS_STYLE } from \"./constants.mjs\";\nexport function getDisabledMountTransitionStyles(transitionStatus) {\n return transitionStatus === 'starting' ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;\n}","'use client';\n\nimport { popupStateMapping } from \"./popupStateMapping.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../internals/getDisabledMountTransitionStyles.mjs\";\n/**\n * Renders the shared outer Positioner element used by popup components.\n * Applies the common role, hidden state, transition styles, state attributes, and optional inert styling.\n */\nexport function usePositioner(componentProps, state, {\n styles,\n transitionStatus,\n props,\n refs,\n hidden,\n inert = false\n}) {\n const style = {\n ...styles\n };\n if (inert) {\n style.pointerEvents = 'none';\n }\n return useRenderElement('div', componentProps, {\n state,\n ref: refs,\n props: [{\n role: 'presentation',\n hidden,\n style\n }, getDisabledMountTransitionStyles(transitionStatus), props],\n stateAttributesMapping: popupStateMapping\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\n\n// Touch-opened popups normally avoid scroll locking so users can still swipe outside to dismiss.\n// This hook re-enables scroll lock only when the popup is effectively full-width.\n// Treat popups with up to 20px of total horizontal gutter as full-width so common ~10px side\n// padding still locks scroll, since that leaves too little outside space for a reliable swipe.\nconst VIEWPORT_WIDTH_TOLERANCE_PX = 20;\n\n/**\n * Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when\n * enabled. For touch opens, scroll lock is applied only when the positioner width is effectively\n * viewport-sized.\n */\nexport function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {\n const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (!enabled || !touchOpen || positionerElement == null) {\n setTouchOpenShouldLockScroll(false);\n return;\n }\n const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;\n const popupWidth = positionerElement.offsetWidth;\n setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);\n }, [enabled, touchOpen, positionerElement]);\n useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);\n}","'use client';\n\nimport { isOverflowElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from \"./addEventListener.mjs\";\nimport { platform } from \"./platform/index.mjs\";\nimport { ownerDocument, ownerWindow } from \"./owner.mjs\";\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { Timeout } from \"./useTimeout.mjs\";\nimport { AnimationFrame } from \"./useAnimationFrame.mjs\";\nlet originalHtmlStyles = {};\nlet originalBodyStyles = {};\nlet originalHtmlScrollBehavior = '';\n\n// The viewport's overflow comes from <html> when it establishes its own scroll container, and\n// propagates from <body> otherwise. An `overflow` style on the other element doesn't lock the page.\nfunction getViewportScroller(html, body) {\n return isOverflowElement(html) ? html : body;\n}\nfunction isPageScrollLocked(win, html, body) {\n return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);\n}\nfunction hasInsetScrollbars(referenceElement) {\n if (typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const win = ownerWindow(doc);\n return win.innerWidth - doc.documentElement.clientWidth > 0;\n}\nfunction supportsStableScrollbarGutter(referenceElement) {\n const supported = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('scrollbar-gutter', 'stable');\n if (!supported || typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const scrollContainer = getViewportScroller(html, body);\n const originalScrollContainerOverflowY = scrollContainer.style.overflowY;\n const originalHtmlStyleGutter = html.style.scrollbarGutter;\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = originalScrollContainerOverflowY;\n html.style.scrollbarGutter = originalHtmlStyleGutter;\n return before === after;\n}\nfunction preventScrollOverlayScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n\n // If an `overflow` style is present on <html>, we need to lock it, because a lock on <body>\n // won't have any effect.\n // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it\n // instead, as sticky elements shift otherwise.\n const elementToLock = getViewportScroller(html, body);\n const originalElementToLockStyles = {\n overflowY: elementToLock.style.overflowY,\n overflowX: elementToLock.style.overflowX\n };\n Object.assign(elementToLock.style, {\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n return () => {\n Object.assign(elementToLock.style, originalElementToLockStyles);\n };\n}\nfunction preventScrollInsetScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n const resizeFrame = AnimationFrame.create();\n\n // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.\n if (platform.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n function lockScroll() {\n /* DOM reads: */\n\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || '';\n const hasBothEdges = htmlScrollbarGutterValue.includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Values can be negative in Firefox\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n\n // Avoid shift due to the default <body> margin. This does cause elements to be clipped\n // with whitespace. Warn if <body> has margins?\n const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);\n const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);\n const elementToLock = getViewportScroller(html, body);\n updateGutterOnly = supportsStableScrollbarGutter(referenceElement);\n\n /*\n * DOM writes:\n * Do not read the DOM past this point!\n */\n\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n // Assign the longhands that `cleanup` restores, so nothing is left behind.\n overflowY: 'hidden',\n overflowX: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.setAttribute('data-base-ui-scroll-locked', '');\n html.style.scrollBehavior = 'unset';\n }\n function cleanup() {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.removeAttribute('data-base-ui-scroll-locked');\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n }\n function handleResize() {\n cleanup();\n resizeFrame.request(lockScroll);\n }\n lockScroll();\n const unsubscribeResize = addEventListener(win, 'resize', handleResize);\n return () => {\n resizeFrame.cancel();\n cleanup();\n // Sometimes this cleanup can run after test teardown because it is called\n // in a `setTimeout(fn, 0)`. Guard the returned cleanup to avoid calling\n // `removeEventListener` when it is no longer available in tests.\n if (typeof win.removeEventListener === 'function') {\n unsubscribeResize();\n }\n };\n}\nclass ScrollLocker {\n lockCount = 0;\n restore = null;\n timeoutLock = Timeout.create();\n timeoutUnlock = Timeout.create();\n acquire(referenceElement) {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.timeoutLock.start(0, () => this.lock(referenceElement));\n }\n return this.release;\n }\n release = () => {\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.timeoutUnlock.start(0, this.unlock);\n }\n };\n unlock = () => {\n if (this.lockCount === 0 && this.restore) {\n this.restore?.();\n this.restore = null;\n }\n };\n lock(referenceElement) {\n if (this.lockCount === 0 || this.restore !== null) {\n return;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n\n // The page is already locked, either by the site author or by a non-Base UI overlay that\n // hasn't cleaned up yet. Leave it alone and wait for the lock to clear before taking over,\n // otherwise we'd snapshot the locked state and restore it after our own lock is released.\n if (isPageScrollLocked(win, html, body)) {\n const observer = new win.MutationObserver(() => {\n if (isPageScrollLocked(win, html, body)) {\n return;\n }\n observer.disconnect();\n this.restore = null;\n this.lock(referenceElement);\n });\n\n // Watch every attribute: locks are applied through inline styles, classes, or attributes\n // paired with a stylesheet (`data-scroll-locked` in react-remove-scroll, for example).\n const options = {\n attributes: true\n };\n observer.observe(html, options);\n observer.observe(body, options);\n this.restore = () => observer.disconnect();\n return;\n }\n const hasOverlayScrollbars = platform.os.ios || !hasInsetScrollbars(referenceElement);\n\n // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous\n // side effects and bugs that arise on iOS, it must be researched extensively before\n // being enabled to ensure it doesn't cause the following issues:\n // - Textboxes must scroll into view when focused, nor cause a glitchy scroll animation.\n // - The navbar must not force itself into view and cause layout shift.\n // - Scroll containers must not flicker upon closing a popup when it has an exit animation.\n this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);\n }\n}\nconst SCROLL_LOCKER = new ScrollLocker();\n\n/**\n * Locks the scroll of the document when enabled.\n *\n * @param enabled - Whether to enable the scroll lock.\n * @param referenceElement - Element to use as a reference for lock calculations.\n */\nexport function useScrollLock(enabled = true, referenceElement = null) {\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n return SCROLL_LOCKER.acquire(referenceElement);\n }, [enabled, referenceElement]);\n}","'use client';\n\nimport * as React from 'react';\nimport { rectToClientRect } from '@floating-ui/utils';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { platform } from '@base-ui/utils/platform';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { FloatingFocusManager, platform as floatingPlatform } from \"../../floating-ui-react/index.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { clearStyles, LIST_FUNCTIONAL_STYLES } from \"./utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { clamp } from \"../../internals/clamp.mjs\";\nimport { getMaxScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.mjs\";\nimport { useCSPContext } from \"../../internals/csp-context/CSPContext.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the select list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPopup = /*#__PURE__*/React.forwardRef(function SelectPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store,\n popupRef,\n onOpenChangeComplete,\n setOpen,\n valueRef,\n firstItemTextRef,\n selectedItemTextRef,\n multiple,\n handleScrollArrowVisibility,\n scrollHandlerRef,\n listRef,\n highlightItemOnHover,\n floatingContext: floatingRootContext\n } = useSelectRootContext();\n const {\n side,\n align,\n alignItemWithTriggerActive,\n isPositioned,\n setControlledAlignItemWithTrigger\n } = useSelectPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const direction = useDirection();\n const {\n nonce,\n disableStyleElements\n } = useCSPContext();\n const id = useStore(store, selectors.id);\n const open = useStore(store, selectors.open);\n const openMethod = useStore(store, selectors.openMethod);\n const mounted = useStore(store, selectors.mounted);\n const popupProps = useStore(store, selectors.popupProps);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const reachedMaxHeightRef = React.useRef(false);\n const initialPlacedRef = React.useRef(false);\n const originalPositionerStylesRef = React.useRef({});\n const scrollArrowFrame = useAnimationFrame();\n const handleScroll = useStableCallback(scroller => {\n if (!positionerElement || !popupRef.current || !initialPlacedRef.current) {\n return;\n }\n const isTopPositioned = positionerElement.style.top === '0px';\n const isBottomPositioned = positionerElement.style.bottom === '0px';\n if (reachedMaxHeightRef.current || !alignItemWithTriggerActive || !isTopPositioned && !isBottomPositioned) {\n handleScrollArrowVisibility(scroller);\n return;\n }\n const scale = getScale(positionerElement);\n const currentHeight = normalizeSize(positionerElement.getBoundingClientRect().height, 'y', scale);\n const doc = ownerDocument(positionerElement);\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const marginTop = parseFloat(positionerStyles.marginTop);\n const marginBottom = parseFloat(positionerStyles.marginBottom);\n const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(popupRef.current));\n const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);\n const scrollTop = scroller.scrollTop;\n const maxScrollTop = getMaxScrollTop(scroller);\n\n // `Infinity` requests a scroll to the recomputed maximum offset.\n let nextScrollTop = null;\n const setHeight = height => {\n positionerElement.style.height = `${height}px`;\n };\n const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;\n const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);\n if (diff <= SCROLL_EDGE_TOLERANCE_PX) {\n const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);\n if (heightDelta > 0) {\n // Consume the remaining scroll in height.\n setHeight(currentHeight + heightDelta);\n }\n scroller.scrollTop = isTopPositioned ? maxScrollTop : 0;\n if (maxAvailableHeight - (currentHeight + heightDelta) <= SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility(scroller);\n return;\n }\n if (maxAvailableHeight - nextHeight > SCROLL_EDGE_TOLERANCE_PX) {\n nextScrollTop = isTopPositioned ? Infinity : 0;\n } else if (isBottomPositioned && scrollTop < maxScrollTop) {\n const overshoot = currentHeight + diff - maxAvailableHeight;\n nextScrollTop = scrollTop - (diff - overshoot);\n }\n const nextPositionerHeight = Math.ceil(nextHeight);\n if (nextPositionerHeight !== 0) {\n setHeight(nextPositionerHeight);\n }\n if (nextScrollTop != null) {\n // Recompute bounds after resizing (clientHeight likely changed).\n const target = clamp(nextScrollTop, 0, getMaxScrollTop(scroller));\n\n // Avoid adjustments that re-trigger scroll events forever.\n if (Math.abs(scroller.scrollTop - target) > SCROLL_EDGE_TOLERANCE_PX) {\n scroller.scrollTop = target;\n }\n }\n if (nextPositionerHeight >= maxAvailableHeight - SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility(scroller);\n });\n React.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n onOpenChangeComplete?.(true);\n }\n }\n });\n const state = {\n open,\n transitionStatus,\n side,\n align\n };\n useIsoLayoutEffect(() => {\n if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) {\n return;\n }\n originalPositionerStylesRef.current = {\n top: positionerElement.style.top || '0',\n left: positionerElement.style.left || '0',\n right: positionerElement.style.right,\n height: positionerElement.style.height,\n bottom: positionerElement.style.bottom,\n minHeight: positionerElement.style.minHeight,\n maxHeight: positionerElement.style.maxHeight,\n marginTop: positionerElement.style.marginTop,\n marginBottom: positionerElement.style.marginBottom\n };\n }, [popupRef, positionerElement]);\n useIsoLayoutEffect(() => {\n if (open || alignItemWithTriggerActive) {\n return;\n }\n initialPlacedRef.current = false;\n reachedMaxHeightRef.current = false;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n }, [open, alignItemWithTriggerActive, positionerElement, popupRef]);\n useIsoLayoutEffect(() => {\n const popupElement = popupRef.current;\n\n // Wait for Floating UI's first positioning pass before reading DOM geometry.\n // We replace the final coordinates for aligned selects, but still need middleware\n // like `size()` to set CSS variables such as `--anchor-width`.\n if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === 'ending') {\n return;\n }\n initialPlacedRef.current = true;\n popupElement.style.removeProperty('--transform-origin');\n if (!alignItemWithTriggerActive) {\n // The wrapper supplies the scroller: the list owns scrolling once it has mounted, and\n // this effect re-runs (cancelling the stale frame) when that happens.\n scrollArrowFrame.request(() => handleScrollArrowVisibility(listElement || popupElement));\n return;\n }\n\n // Ensure we remove any transforms that can affect the location of the popup\n // and therefore the calculations.\n const restoreTransformStyles = unsetTransformStyles(popupElement);\n try {\n let textElement = selectedItemTextRef.current;\n if (!textElement?.isConnected) {\n const hasSelectedValue = selectors.hasSelectedValue(store.state);\n textElement = !hasSelectedValue && firstItemTextRef.current?.isConnected ? firstItemTextRef.current : null;\n }\n const valueElement = valueRef.current;\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const popupStyles = win.getComputedStyle(popupElement);\n const doc = ownerDocument(triggerElement);\n const scale = getScale(triggerElement);\n const triggerRect = normalizeRect(triggerElement.getBoundingClientRect(), scale);\n const positionerRect = normalizeRect(positionerElement.getBoundingClientRect(), scale);\n const triggerHeight = triggerRect.height;\n const scroller = listElement || popupElement;\n const scrollHeight = scroller.scrollHeight;\n const borderBottom = parseFloat(popupStyles.borderBottomWidth);\n // The `|| N` fallbacks cover an unset/`auto` value (parses to `NaN`). Note a literal `0`\n // also resolves to the fallback, so an explicit `margin: 0` or `min-height: 0` still takes\n // the default below.\n const marginTop = parseFloat(positionerStyles.marginTop) || 10;\n const marginBottom = parseFloat(positionerStyles.marginBottom) || 10;\n const minHeight = parseFloat(positionerStyles.minHeight) || 100;\n const maxPopupHeight = getMaxPopupHeight(popupStyles);\n const paddingLeft = 5;\n const paddingRight = 5;\n const triggerCollisionThreshold = 20;\n const viewportHeight = doc.documentElement.clientHeight - marginTop - marginBottom;\n const viewportWidth = doc.documentElement.clientWidth;\n const availableSpaceBeneathTrigger = viewportHeight - triggerRect.bottom + triggerHeight;\n let textRect;\n let alignedLeft = direction === 'rtl' ? triggerRect.right - positionerRect.width : triggerRect.left;\n let offsetY = 0;\n if (textElement && valueElement) {\n const valueRect = normalizeRect(valueElement.getBoundingClientRect(), scale);\n textRect = normalizeRect(textElement.getBoundingClientRect(), scale);\n alignedLeft = positionerRect.left + (direction === 'rtl' ? valueRect.right - textRect.right : valueRect.left - textRect.left);\n const valueCenterFromTriggerTop = valueRect.top - triggerRect.top + valueRect.height / 2;\n const textCenterFromPositionerTop = textRect.top - positionerRect.top + textRect.height / 2;\n offsetY = textCenterFromPositionerTop - valueCenterFromTriggerTop;\n }\n const idealHeight = availableSpaceBeneathTrigger + offsetY + marginBottom + borderBottom;\n let height = Math.min(viewportHeight, idealHeight);\n const maxHeight = viewportHeight - marginTop - marginBottom;\n const scrollTop = idealHeight - height;\n const maxRight = viewportWidth - paddingRight;\n positionerElement.style.left = `${clamp(alignedLeft, paddingLeft, maxRight - positionerRect.width)}px`;\n positionerElement.style.height = `${height}px`;\n // `none` (not the invalid `auto`) so the explicit height governs in align mode and isn't\n // clamped by a `max-height` from user CSS.\n positionerElement.style.maxHeight = 'none';\n positionerElement.style.marginTop = `${marginTop}px`;\n positionerElement.style.marginBottom = `${marginBottom}px`;\n popupElement.style.height = '100%';\n const maxScrollTop = getMaxScrollTop(scroller);\n const isTopPositioned = scrollTop >= maxScrollTop - SCROLL_EDGE_TOLERANCE_PX;\n if (isTopPositioned) {\n height = Math.min(viewportHeight, positionerRect.height) - (scrollTop - maxScrollTop);\n }\n\n // When the trigger is too close to the top or bottom of the viewport, or the minHeight is\n // reached, we fallback to aligning the popup to the trigger as the UX is poor otherwise.\n const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + SCROLL_EDGE_TOLERANCE_PX < Math.min(scrollHeight, minHeight);\n\n // Safari doesn't position the popup correctly when pinch-zoomed.\n const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && platform.engine.webkit;\n if (fallbackToAlignPopupToTrigger || isPinchZoomed) {\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n setControlledAlignItemWithTrigger(false);\n return;\n }\n const initialHeight = Math.max(minHeight, height);\n if (isTopPositioned) {\n const topOffset = Math.max(0, viewportHeight - idealHeight);\n positionerElement.style.top = positionerRect.height >= maxHeight ? '0' : `${topOffset}px`;\n positionerElement.style.height = `${height}px`;\n scroller.scrollTop = getMaxScrollTop(scroller);\n } else {\n positionerElement.style.bottom = '0';\n scroller.scrollTop = scrollTop;\n }\n if (textRect) {\n const popupTop = positionerRect.top;\n const popupHeight = positionerRect.height;\n const textCenterY = textRect.top + textRect.height / 2;\n const clampedY = clamp(popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50, 0, 100);\n popupElement.style.setProperty('--transform-origin', `50% ${clampedY}%`);\n }\n if (initialHeight === viewportHeight || height >= maxPopupHeight) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility(scroller);\n if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && listRef.current[0] != null) {\n store.set('activeIndex', 0);\n }\n } finally {\n restoreTransformStyles();\n }\n }, [store, open, positionerElement, triggerElement, valueRef, firstItemTextRef, selectedItemTextRef, popupRef, handleScrollArrowVisibility, alignItemWithTriggerActive, setControlledAlignItemWithTrigger, scrollArrowFrame, listElement, listRef, highlightItemOnHover, direction, isPositioned]);\n React.useEffect(() => {\n if (!alignItemWithTriggerActive || !positionerElement || !open) {\n return undefined;\n }\n const win = ownerWindow(positionerElement);\n function handleResize(event) {\n setOpen(false, createChangeEventDetails(REASONS.windowResize, event));\n }\n return addEventListener(win, 'resize', handleResize);\n }, [setOpen, alignItemWithTriggerActive, positionerElement, open]);\n const defaultProps = {\n ...(listElement ? {\n role: 'presentation',\n 'aria-orientation': undefined\n } : {\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n id: `${id}-list`\n }),\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n onScroll(event) {\n if (listElement) {\n return;\n }\n handleScroll(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: listElement ? {\n height: '100%'\n } : LIST_FUNCTIONAL_STYLES\n }),\n className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : undefined\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, popupRef],\n state,\n stateAttributesMapping,\n props: [popupProps, defaultProps, getDisabledMountTransitionStyles(transitionStatus), elementProps]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n modal: false,\n disabled: !mounted,\n openInteractionType: openMethod,\n returnFocus: finalFocus,\n restoreFocus: true,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPopup.displayName = \"SelectPopup\";\nfunction getMaxPopupHeight(popupStyles) {\n const maxHeightStyle = popupStyles.maxHeight;\n return maxHeightStyle.endsWith('px') ? parseFloat(maxHeightStyle) || Infinity : Infinity;\n}\nfunction getMaxScrollTop(scroller) {\n return getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n}\nfunction getScale(element) {\n // The platform API is async-capable, but the DOM platform returns a plain scale object.\n return floatingPlatform.getScale(element);\n}\nfunction normalizeSize(size, axis, scale) {\n return size / scale[axis];\n}\nfunction normalizeRect(rect, scale) {\n return rectToClientRect({\n x: normalizeSize(rect.x, 'x', scale),\n y: normalizeSize(rect.y, 'y', scale),\n width: normalizeSize(rect.width, 'x', scale),\n height: normalizeSize(rect.height, 'y', scale)\n });\n}\nconst TRANSFORM_STYLE_RESETS = [['transform', 'none'], ['scale', '1'], ['translate', '0 0']];\nfunction unsetTransformStyles(popupElement) {\n const {\n style\n } = popupElement;\n const originalStyles = {};\n for (const [property, value] of TRANSFORM_STYLE_RESETS) {\n originalStyles[property] = style.getPropertyValue(property);\n style.setProperty(property, value, 'important');\n }\n return () => {\n for (const [property] of TRANSFORM_STYLE_RESETS) {\n const originalValue = originalStyles[property];\n if (originalValue) {\n style.setProperty(property, originalValue);\n } else {\n style.removeProperty(property);\n }\n }\n };\n}","import { jsx as _jsx } from \"react/jsx-runtime\";\nconst DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';\nexport const styleDisableScrollbar = {\n className: DISABLE_SCROLLBAR_CLASS_NAME,\n getElement(nonce) {\n return /*#__PURE__*/_jsx(\"style\", {\n nonce: nonce,\n href: DISABLE_SCROLLBAR_CLASS_NAME,\n precedence: \"base-ui:low\",\n children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`\n });\n }\n};\nif (process.env.NODE_ENV !== \"production\") styleDisableScrollbar.getElement.displayName = \"styleDisableScrollbar.getElement\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToolbarRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToolbarRootContext.displayName = \"ToolbarRootContext\";\nexport function useToolbarRootContext(optional) {\n const context = React.useContext(ToolbarRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : _formatErrorMessage(69));\n }\n return context;\n}","import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const MODIFIER_KEYS = [SHIFT, 'Control', 'Alt', 'Meta'];\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const CSPContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CSPContext.displayName = \"CSPContext\";\nconst DEFAULT_CSP_CONTEXT_VALUE = {\n disableStyleElements: false\n};\nexport function useCSPContext() {\n return React.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n scrollHandlerRef,\n multiple\n } = useSelectRootContext();\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = useStore(store, selectors.hasScrollArrows);\n const openMethod = useStore(store, selectors.openMethod);\n const id = useStore(store, selectors.id);\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n onScroll(event) {\n scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = store.useStateSetter('listElement');\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { SelectItemContext } from \"./SelectItemContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { compareItemEquality, removeItem } from \"../../internals/itemEquality.mjs\";\nimport { isVirtualClick } from \"../../floating-ui-react/utils/event.mjs\";\n\n/**\n * An individual option in the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n value: itemValue = null,\n label,\n disabled: disabledProp = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n label,\n textRef\n });\n const {\n store,\n itemProps,\n setOpen,\n setValue,\n selectionRef,\n typingRef,\n valuesRef,\n multiple,\n selectedItemTextRef,\n disabled: selectDisabled,\n readOnly\n } = useSelectRootContext();\n const disabled = selectDisabled || disabledProp;\n const highlighted = useStore(store, selectors.isActive, listItem.index);\n const open = useStore(store, selectors.open);\n const selected = useStore(store, selectors.isSelected, itemValue);\n const selectedByFocus = useStore(store, selectors.isSelectedByFocus, listItem.index);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const index = listItem.index;\n const itemRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n const values = valuesRef.current;\n values[index] = itemValue;\n return () => {\n delete values[index];\n };\n }, [index, itemValue, valuesRef]);\n useIsoLayoutEffect(() => {\n const selectedValue = store.state.value;\n let selectedCandidate = selectedValue;\n if (multiple && Array.isArray(selectedValue)) {\n // Compare against the last selected item, or `undefined` when nothing is selected — never\n // the raw array, which a custom `isItemEqualToValue` isn't expected to receive.\n selectedCandidate = selectedValue.length > 0 ? selectedValue[selectedValue.length - 1] : undefined;\n }\n if (selectedCandidate !== undefined && compareItemEquality(itemValue, selectedCandidate, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n // Make sure SelectPopup can measure the selected item on first open.\n // SelectItemText can still update this ref later when focus moves.\n if (textRef.current) {\n selectedItemTextRef.current = textRef.current;\n }\n }\n }, [index, multiple, isItemEqualToValue, store, itemValue, selectedItemTextRef]);\n const pointerTypeRef = React.useRef('mouse');\n const allowMouseSelectionRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(event) {\n // A forced-open select (`open`/`defaultOpen`) can still receive item activations even\n // when the root is disabled or read-only, so guard the commit here too.\n if (selectDisabled || readOnly) {\n return;\n }\n const selectedValue = store.state.value;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];\n setValue(nextValue, createChangeEventDetails(REASONS.itemPress, event));\n } else {\n setValue(itemValue, createChangeEventDetails(REASONS.itemPress, event));\n setOpen(false, createChangeEventDetails(REASONS.itemPress, event));\n }\n }\n function resetDragMovement() {\n selectionRef.current.dragY = 0;\n }\n const defaultProps = {\n role: 'option',\n 'aria-selected': selected,\n tabIndex: open && highlighted ? 0 : -1,\n onKeyDown(event) {\n store.set('activeIndex', index);\n if (event.key === ' ' && typingRef.current) {\n // `useButton` skips Space activation for `role=\"option\"` items when the keydown\n // is `defaultPrevented`, keeping typeahead spaces from committing a selection.\n event.preventDefault();\n }\n },\n onClick(event) {\n const isMouseClick = pointerTypeRef.current !== 'touch';\n const clickPointerType = event.nativeEvent.pointerType;\n const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (\n // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual\n // clicks that carry browser pointer data, including an empty string from assistive\n // technology, can activate unhighlighted items.\n clickPointerType !== undefined || highlighted);\n // With alignItemWithTrigger, opening can place an item under the cursor. Real mouse\n // clicks must start on the item, while virtual clicks represent explicit keyboard or\n // assistive technology activation.\n const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;\n allowMouseSelectionRef.current = false;\n if (disabled || isInvalidMouseClick) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerMove(event) {\n if (event.pointerType === 'mouse' && event.buttons === 1) {\n const selection = selectionRef.current;\n selection.dragY += event.movementY;\n if (selection.dragY ** 2 >= 64) {\n selection.allowUnselectedMouseUp = true;\n }\n }\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n allowMouseSelectionRef.current = true;\n resetDragMovement();\n },\n onMouseUp() {\n resetDragMovement();\n if (disabled || pointerTypeRef.current === 'touch') {\n return;\n }\n\n // Regular clicks are committed by the click event.\n if (allowMouseSelectionRef.current) {\n return;\n }\n const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;\n const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;\n if (disallowSelectedMouseUp || disallowUnselectedMouseUp) {\n return;\n }\n allowMouseSelectionRef.current = true;\n itemRef.current?.click();\n allowMouseSelectionRef.current = false;\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n index,\n textRef,\n selectedByFocus\n }), [selected, index, textRef, selectedByFocus]);\n return /*#__PURE__*/_jsx(SelectItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItem.displayName = \"SelectItem\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.mjs\";\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n guess,\n label,\n metadata,\n textRef,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n } = useCompositeListContext();\n\n // Guess the index from the render order. This avoids a re-render after mount for\n // flat lists rendered in DOM order; when the guess is wrong (grouped or out-of-order\n // rendering), the commit flush corrects it before paint.\n const indexRef = React.useRef(-1);\n const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1);\n const index = externalIndex ?? internalIndex;\n const componentRef = React.useRef(null);\n\n // Deliberately identity-sensitive: nested items sharing one DOM node rely on ref attachment\n // order to decide which registration wins, and republishing from an effect instead would let\n // an inner item's later update silently take ownership from the outer one.\n const ref = React.useCallback(node => {\n const previousNode = componentRef.current;\n if (previousNode) {\n unregister(previousNode);\n }\n componentRef.current = node;\n if (node) {\n register(node, {\n metadata: metadata ?? null,\n index: externalIndex ?? null,\n label,\n textRef\n });\n }\n }, [externalIndex, register, unregister, metadata, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setInternalIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange]);\n return {\n ref,\n index\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectItemContext.displayName = \"SelectItemContext\";\nexport function useSelectItemContext() {\n const context = React.useContext(SelectItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.' : _formatErrorMessage(57));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Indicates whether the select item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItemIndicator = /*#__PURE__*/React.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {\n const {\n selected\n } = useSelectItemContext();\n const shouldRender = componentProps.keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return /*#__PURE__*/_jsx(Inner, {\n ...componentProps,\n ref: forwardedRef\n });\n});\n\n// Split the core implementation to avoid paying the hook costs unless the element needs to mount.\nif (process.env.NODE_ENV !== \"production\") SelectItemIndicator.displayName = \"SelectItemIndicator\";\nconst Inner = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((componentProps, forwardedRef) => {\n const {\n render,\n className,\n style,\n keepMounted,\n ...elementProps\n } = componentProps;\n const {\n selected\n } = useSelectItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") Inner.displayName = \"Inner\";","'use client';\n\nimport * as React from 'react';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A text label of the select item.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectItemText = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItemText(componentProps, forwardedRef) {\n const {\n index,\n textRef,\n selectedByFocus\n } = useSelectItemContext();\n const {\n firstItemTextRef,\n selectedItemTextRef\n } = useSelectRootContext();\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const localRef = React.useCallback(node => {\n if (!node) {\n return;\n }\n if (index === 0) {\n firstItemTextRef.current = node;\n }\n if (selectedByFocus) {\n selectedItemTextRef.current = node;\n }\n }, [firstItemTextRef, selectedItemTextRef, index, selectedByFocus]);\n const element = useRenderElement('div', componentProps, {\n ref: [localRef, forwardedRef, textRef],\n props: elementProps\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItemText.displayName = \"SelectItemText\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * Displays an element positioned against the select popup anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectArrow = /*#__PURE__*/React.forwardRef(function SelectArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const {\n side,\n align,\n arrowRef,\n arrowStyles,\n arrowUncentered,\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const open = useStore(store, selectors.open);\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [arrowRef, forwardedRef],\n props: [{\n style: arrowStyles,\n 'aria-hidden': true\n }, elementProps],\n stateAttributesMapping: popupTransitionStateMapping\n });\n if (alignItemWithTriggerActive) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectArrow.displayName = \"SelectArrow\";","'use client';\n\nimport * as React from 'react';\nimport { SelectScrollArrow } from \"../scroll-arrow/SelectScrollArrow.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * An element that scrolls the select popup down when hovered. Does not render when using touch input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectScrollDownArrow = /*#__PURE__*/React.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {\n return /*#__PURE__*/_jsx(SelectScrollArrow, {\n ...props,\n ref: forwardedRef,\n direction: \"down\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollDownArrow.displayName = \"SelectScrollDownArrow\";","'use client';\n\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { getMaxScrollOffset, normalizeScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * @internal\n */\nexport const SelectScrollArrow = /*#__PURE__*/React.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n direction,\n keepMounted,\n ...elementProps\n } = componentProps;\n const isUp = direction === 'up';\n const {\n store,\n popupRef,\n listRef,\n handleScrollArrowVisibility,\n scrollArrowsMountedCountRef\n } = useSelectRootContext();\n const {\n side,\n scrollDownArrowRef,\n scrollUpArrowRef\n } = useSelectPositionerContext();\n const visibleSelector = isUp ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible;\n const stateVisible = useStore(store, visibleSelector);\n const openMethod = useStore(store, selectors.openMethod);\n\n // Scroll arrows are disabled for touch modality as they are a hover-only element.\n const visible = stateVisible && openMethod !== 'touch';\n const timeout = useTimeout();\n const scrollArrowRef = isUp ? scrollUpArrowRef : scrollDownArrowRef;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(visible);\n useIsoLayoutEffect(() => {\n scrollArrowsMountedCountRef.current += 1;\n store.set('hasScrollArrows', true);\n return () => {\n scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);\n if (scrollArrowsMountedCountRef.current === 0) {\n store.set('hasScrollArrows', false);\n }\n };\n }, [store, scrollArrowsMountedCountRef]);\n useOpenChangeComplete({\n open: visible,\n ref: scrollArrowRef,\n onComplete() {\n if (!visible) {\n setMounted(false);\n }\n }\n });\n const state = {\n direction,\n visible,\n side,\n transitionStatus\n };\n const defaultProps = {\n 'aria-hidden': true,\n children: isUp ? '▲' : '▼',\n style: {\n position: 'absolute'\n },\n onMouseMove(event) {\n if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) {\n return;\n }\n store.set('activeIndex', null);\n function scrollNextItem() {\n const scroller = store.state.listElement ?? popupRef.current;\n if (!scroller) {\n return;\n }\n store.set('activeIndex', null);\n handleScrollArrowVisibility(scroller);\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const isScrolledToEdge = scrollTop === (isUp ? 0 : maxScrollTop);\n const items = listRef.current;\n if (scrollTop !== scroller.scrollTop) {\n scroller.scrollTop = scrollTop;\n }\n if (isScrolledToEdge) {\n timeout.clear();\n return;\n }\n if (items.length > 0) {\n const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;\n scroller.scrollTop = getTargetScrollTop(items, isUp, scrollTop, scroller.clientHeight, scrollArrowHeight, maxScrollTop);\n }\n timeout.start(40, scrollNextItem);\n }\n timeout.start(40, scrollNextItem);\n },\n onMouseLeave() {\n timeout.clear();\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, scrollArrowRef],\n state,\n props: [defaultProps, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollArrow.displayName = \"SelectScrollArrow\";\nfunction getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHeight, maxScrollTop) {\n if (isUp) {\n let firstVisibleIndex = 0;\n const visibleTop = scrollTop + scrollArrowHeight - SCROLL_EDGE_TOLERANCE_PX;\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i];\n if (item && item.offsetTop >= visibleTop) {\n firstVisibleIndex = i;\n break;\n }\n }\n const targetIndex = Math.max(0, firstVisibleIndex - 1);\n const targetItem = items[targetIndex];\n return targetIndex < firstVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop - scrollArrowHeight, maxScrollTop) : 0;\n }\n let lastVisibleIndex = items.length - 1;\n const visibleBottom = scrollTop + clientHeight - scrollArrowHeight + SCROLL_EDGE_TOLERANCE_PX;\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i];\n if (item && item.offsetTop + item.offsetHeight > visibleBottom) {\n lastVisibleIndex = Math.max(0, i - 1);\n break;\n }\n }\n const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);\n const targetItem = items[targetIndex];\n return targetIndex > lastVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop + targetItem.offsetHeight - clientHeight + scrollArrowHeight, maxScrollTop) : maxScrollTop;\n}","'use client';\n\nimport * as React from 'react';\nimport { SelectScrollArrow } from \"../scroll-arrow/SelectScrollArrow.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * An element that scrolls the select popup up when hovered. Does not render when using touch input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectScrollUpArrow = /*#__PURE__*/React.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {\n return /*#__PURE__*/_jsx(SelectScrollArrow, {\n ...props,\n ref: forwardedRef,\n direction: \"up\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollUpArrow.displayName = \"SelectScrollUpArrow\";","'use client';\n\nimport * as React from 'react';\nimport { SelectGroupContext } from \"./SelectGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * Groups related select items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectGroup = /*#__PURE__*/React.forwardRef(function SelectGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const contextValue = React.useMemo(() => ({\n labelId,\n setLabelId\n }), [labelId, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'group',\n 'aria-labelledby': labelId\n }, elementProps]\n });\n return /*#__PURE__*/_jsx(SelectGroupContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroup.displayName = \"SelectGroup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectGroupContext.displayName = \"SelectGroupContext\";\nexport function useSelectGroupContext() {\n const context = React.useContext(SelectGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.' : _formatErrorMessage(56));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useSelectGroupContext } from \"../group/SelectGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectGroupLabel = /*#__PURE__*/React.forwardRef(function SelectGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useSelectGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroupLabel.displayName = \"SelectGroupLabel\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A visual separator between items.\n * Renders a `<div>` element.\n *\n * @internal\n */\nexport const ListboxSeparator = /*#__PURE__*/React.forwardRef(function ListboxSeparator(componentProps, forwardedRef) {\n const {\n className,\n render,\n orientation = 'horizontal',\n style,\n ...elementProps\n } = componentProps;\n const state = {\n orientation\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'presentation'\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ListboxSeparator.displayName = \"ListboxSeparator\";","'use client';\n\nimport { ListboxSeparator } from \"../../utils/listbox-separator/ListboxSeparator.mjs\";\n/**\n * A visual separator between items or groups.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectSeparator = ListboxSeparator;","/**\n * Shared stacking layers for portaled surfaces.\n *\n * Keep the layer on the element that owns portal positioning and any\n * interaction backdrop so popup surfaces escape clipping ancestors while\n * retaining a predictable visual order.\n */\nconst overlayLayers = {\n modal: \"z-40\",\n popup: \"z-50\",\n transient: \"z-[100]\",\n} as const;\n\nexport { overlayLayers };\n","export { DialogBackdrop as Backdrop } from \"./backdrop/DialogBackdrop.mjs\";\nexport { DialogClose as Close } from \"./close/DialogClose.mjs\";\nexport { DialogDescription as Description } from \"./description/DialogDescription.mjs\";\nexport { DialogPopup as Popup } from \"./popup/DialogPopup.mjs\";\nexport { DialogPortal as Portal } from \"./portal/DialogPortal.mjs\";\nexport { DialogRoot as Root } from \"./root/DialogRoot.mjs\";\nexport { DialogViewport as Viewport } from \"./viewport/DialogViewport.mjs\";\nexport { DialogTitle as Title } from \"./title/DialogTitle.mjs\";\nexport { DialogTrigger as Trigger } from \"./trigger/DialogTrigger.mjs\";\nexport { createDialogHandle as createHandle, DialogHandle as Handle } from \"./store/DialogHandle.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogBackdrop.displayName = \"DialogBackdrop\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const store = React.useContext(DialogRootContext);\n if (!optional && store === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * A button that closes the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogClose = /*#__PURE__*/React.forwardRef(function DialogClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n function handleClick(event) {\n if (open) {\n store.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent));\n }\n }\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n onClick: handleClick\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogClose.displayName = \"DialogClose\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\n/**\n * A paragraph with additional information about the dialog.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('descriptionElementId', id);\n return useRenderElement('p', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogDescription.displayName = \"DialogDescription\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: floatingId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n '--nested-dialogs': nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: dialogStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}","import { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\n/**\n * Shared by `Dialog.Popup` and `Dialog.Viewport`, whose states have the same shape.\n * `nested` is not mapped: unmapped `true` booleans already render as `data-nested`.\n */\nexport const dialogStateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n 'data-nested-dialog-open': ''\n } : null;\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { DialogPortalContext } from \"./DialogPortalContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const DialogPortal = /*#__PURE__*/React.forwardRef(function DialogPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useDialogRootContext();\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const open = store.useState('open');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(DialogPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsxs(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps,\n children: [mounted && modal === true && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open)\n }), props.children]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPortal.displayName = \"DialogPortal\";","'use client';\n\nimport * as React from 'react';\nimport { DialogInteractions } from \"./useDialogRoot.mjs\";\nimport { DialogRootContext, useDialogRootContext } from \"./DialogRootContext.mjs\";\nimport { DialogStore } from \"../store/DialogStore.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, PopupHandleAttachment, usePopupRootStore, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function useRenderDialogRoot(mode, props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal: disablePointerDismissalProp = false,\n modal: modalProp = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const isDrawer = mode === 'drawer';\n const isAlertDialog = mode === 'alert-dialog';\n const modal = isAlertDialog ? true : modalProp;\n const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;\n const role = isAlertDialog ? 'alertdialog' : 'dialog';\n const parentStore = useDialogRootContext(true);\n const nested = parentStore != null;\n const rootState = {\n modal,\n disablePointerDismissal,\n nested,\n role\n };\n\n // The store is owned by this Root instance and created exactly once. It is not tied to the handle:\n // the handle attaches to it, so swapping the handle re-attaches rather than recreating state.\n // Default values are only initial values; controlled values and root state are synced after creation.\n // Dialogs pass the popup element to Floating UI as the floating element (`treatPopupAsFloatingElement`).\n const store = usePopupRootStore((floatingId, floatingNested) => new DialogStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n ...rootState\n }, floatingId, floatingNested), true);\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useSyncedValues(rootState);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: () => store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [forceUnmount, store]);\n const shouldRenderInteractions = open || mounted;\n return /*#__PURE__*/_jsxs(DialogRootContext.Provider, {\n value: store,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), shouldRenderInteractions && /*#__PURE__*/_jsx(DialogInteractions, {\n store: store,\n parentContext: parentStore?.context,\n isDrawer: isDrawer\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event) {\n // Outside press can be handled on `touchend`, where the lifted point is\n // reported in `changedTouches` and `touches` contains any remaining\n // active points. Treat it as a single-finger tap only when exactly one\n // touch ended and no other fingers are still down.\n if (event.type === 'touchend') {\n if (event.changedTouches.length !== 1 || event.touches.length !== 0) {\n return false;\n }\n } else if (event.touches.length !== 1) {\n return false;\n }\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n const internalBackdrop = store.context.internalBackdropRef.current;\n const backdrop = store.context.backdropRef.current;\n return internalBackdrop || backdrop ? internalBackdrop === target || backdrop === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n // A close notification is an open notification with zeroed counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n useIsoLayoutEffect(() => {\n if (parentContext?.onNestedDialogOpen) {\n if (open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n } else {\n parentContext.onNestedDialogOpen(0, 0);\n }\n }\n return () => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(0, 0);\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n usePopupInteractionProps(store, {\n // `enabled` is not passed to `useDismiss`, so its props are always defined,\n // and `trigger` is the same object as `reference`.\n activeTriggerProps: dismiss.reference,\n inactiveTriggerProps: dismiss.trigger,\n // DialogPopup and DrawerPopup spread `FOCUSABLE_POPUP_PROPS` directly, so\n // this only needs to carry the dismiss handlers.\n popupProps: dismiss.floating,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, setPopupOpenState } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: state => state.modal,\n nested: state => state.nested,\n nestedOpenDialogCount: state => state.nestedOpenDialogCount,\n nestedOpenDrawerCount: state => state.nestedOpenDrawerCount,\n disablePointerDismissal: state => state.disablePointerDismissal,\n openMethod: state => state.openMethod,\n descriptionElementId: state => state.descriptionElementId,\n titleElementId: state => state.titleElementId,\n viewportElement: state => state.viewportElement,\n role: state => state.role\n};\n\n/**\n * The subset of `DialogStore` that detached handle-backed triggers rely on. Both the real\n * `DialogStore` and the inert fallback store satisfy it, so a trigger can read from whichever\n * store the handle currently exposes.\n */\n\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState, triggerElements, floatingId, nested);\n super(state, createInitialContext(triggerElements), selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const updatedState = {\n open: nextOpen\n };\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger);\n this.update(updatedState);\n };\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no\n * `Dialog.Root` is attached. It preserves a dialog-specific trigger registry in context so\n * detached triggers can register before migrating to the live root store.\n */\nexport function createNullDialogStore() {\n const triggerElements = new PopupTriggerMap();\n return new NullStore(Object.freeze(createInitialState(undefined, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);\n}\nfunction createInitialState(initialState, triggerElements, floatingId, nested = false) {\n const state = {\n ...createInitialPopupStoreState(),\n modal: true,\n disablePointerDismissal: false,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n return state;\n}\nfunction createInitialContext(triggerElements) {\n return {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n };\n}","import { ReactStore } from '@base-ui/utils/store';\n/**\n * A `ReactStore` whose state never changes.\n *\n * Useful for fallback stores that need to support normal store reads while detached from the\n * component that owns real state. Context values may still contain mutable refs or maps.\n */\nexport class NullStore extends ReactStore {\n // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding\n // `setState` alone would neutralize them today. They are overridden explicitly so the store stays\n // inert even if a future base-class change stops routing a mutator through `setState`.\n setState(_newState) {}\n update(_changes) {}\n set(_key, _value) {}\n notifyAll() {}\n}","'use client';\n\nimport { useRenderDialogRoot } from \"./useRenderDialogRoot.mjs\";\n\n/**\n * Groups all parts of the dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport function DialogRoot(props) {\n return useRenderDialogRoot('dialog', props);\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A positioning container for the dialog popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const keepMounted = useDialogPortalContext();\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const transitionStatus = store.useState('transitionStatus');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const mounted = store.useState('mounted');\n const setViewportElement = store.useStateSetter('viewportElement');\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const shouldRender = keepMounted || mounted;\n return useRenderElement('div', componentProps, {\n enabled: shouldRender,\n state,\n ref: [forwardedRef, setViewportElement],\n stateAttributesMapping: dialogStateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined\n },\n children\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogViewport.displayName = \"DialogViewport\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\n/**\n * A heading that labels the dialog.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('titleElementId', id);\n return useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTitle.displayName = \"DialogTitle\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { usePopupHandleStore, useTriggerDataForwarding } from \"../../utils/popups/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useClick } from \"../../floating-ui-react/index.mjs\";\nimport { useOpenMethodTriggerProps } from \"../../utils/useOpenInteractionType.mjs\";\n\n/**\n * A button that opens the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTrigger = /*#__PURE__*/React.forwardRef(function DialogTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n id: idProp,\n payload,\n handle,\n ...elementProps\n } = componentProps;\n const dialogRootStore = useDialogRootContext(true);\n const handleStore = usePopupHandleStore(handle);\n const store = handleStore ?? dialogRootStore;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.' : _formatErrorMessage(79));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const floatingContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const popupId = store.useState('triggerPopupId', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const click = useClick(floatingContext);\n const interactionTypeProps = useOpenMethodTriggerProps(() => store.select('open'), interactionType => {\n store.set('openMethod', interactionType);\n });\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n return useRenderElement('button', componentProps, {\n state,\n ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],\n props: [click.reference, rootTriggerProps, interactionTypeProps, {\n [CLICK_TRIGGER_IDENTIFIER]: '',\n id: thisTriggerId,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpenedByThisTrigger,\n 'aria-controls': popupId\n }, elementProps, getButtonProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTrigger.displayName = \"DialogTrigger\";","import { createNullDialogStore } from \"./DialogStore.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { BasePopupHandle } from \"../../utils/popups/popupHandle.mjs\";\n\n/**\n * Controls a Dialog imperatively and associates detached `Dialog.Trigger` components with a\n * `Dialog.Root`. Create one with `Dialog.createHandle()` and pass it to the `handle` prop of the\n * root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class DialogHandle extends BasePopupHandle {\n constructor() {\n super(createNullDialogStore(), 'Dialog', false);\n }\n\n /**\n * Opens the dialog, optionally associating it with a trigger.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the dialog. The trigger must be a matching\n * `Dialog.Trigger` with this handle passed as a prop. Pass `null` to open without associating any trigger.\n */\n open(triggerId) {\n this.openByTrigger(triggerId);\n }\n\n /**\n * Opens the dialog with the given payload, without associating it with any trigger.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param payload Payload to set when opening the dialog. It is exposed to the root's render-prop children.\n */\n openWithPayload(payload) {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. ' + 'The call and its payload were ignored; mount a root with this handle before opening it imperatively.');\n }\n return;\n }\n attachedStore.set('payload', payload);\n attachedStore.setOpen(true, createChangeEventDetails(REASONS.imperativeAction));\n }\n\n /**\n * Closes the dialog.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n close() {\n this.closePopup();\n }\n\n /**\n * Whether the dialog is currently open. Returns `false` while no root is attached to the handle.\n */\n get isOpen() {\n return this.attachedStore?.select('open') ?? false;\n }\n}\n\n/**\n * Creates a new handle to connect a Dialog.Root with detached Dialog.Trigger components.\n */\nexport function createDialogHandle() {\n return new DialogHandle();\n}","\"use client\";\nimport * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { XIcon } from \"lucide-react\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof BaseDialog.Root>) { return <BaseDialog.Root data-slot=\"dialog\" {...props} />; }\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof BaseDialog.Trigger>) { return <BaseDialog.Trigger data-slot=\"dialog-trigger\" {...props} />; }\nfunction DialogClose({ ...props }: React.ComponentProps<typeof BaseDialog.Close>) { return <BaseDialog.Close data-slot=\"dialog-close\" {...props} />; }\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof BaseDialog.Portal>) { return <BaseDialog.Portal data-slot=\"dialog-portal\" {...props} />; }\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof BaseDialog.Backdrop>) { return <BaseDialog.Backdrop data-slot=\"dialog-overlay\" className={cn(\"fixed inset-0\", overlayLayers.modal, \"bg-black/50 data-open:animate-in data-closed:animate-out\", className)} {...props} />; }\nfunction DialogContent({ className, children, showCloseButton = true, size = \"default\", closeLabel = \"Close\", ...props }: React.ComponentProps<typeof BaseDialog.Popup> & { showCloseButton?: boolean; size?: \"small\" | \"default\" | \"large\"; closeLabel?: string }) {\n return <DialogPortal><DialogOverlay /><BaseDialog.Viewport className={cn(\"fixed inset-0 flex items-center justify-center p-4\", overlayLayers.modal)}><BaseDialog.Popup data-slot=\"dialog-content\" data-size={size} className={cn(\"relative grid max-h-[min(42rem,calc(100vh-2rem))] w-full max-w-[calc(100%-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-5 overflow-hidden rounded-lg border bg-canvas p-5 text-text-primary shadow-lg outline-none sm:p-6\", \"data-[size=small]:max-w-sm data-[size=default]:max-w-lg data-[size=large]:max-w-3xl\", className)} {...props}>{children}{showCloseButton ? <BaseDialog.Close data-slot=\"dialog-close\" className=\"absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus focus:ring-offset-2 focus:ring-offset-canvas disabled:pointer-events-none [&_svg]:size-4\"><XIcon /><span className=\"sr-only\">{closeLabel}</span></BaseDialog.Close> : null}</BaseDialog.Popup></BaseDialog.Viewport></DialogPortal>;\n}\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"dialog-header\" className={cn(\"flex flex-col gap-2 text-left\", className)} {...props} />; }\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof BaseDialog.Title>) { return <BaseDialog.Title data-slot=\"dialog-title\" className={cn(\"text-base font-semibold leading-none\", className)} {...props} />; }\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof BaseDialog.Description>) { return <BaseDialog.Description data-slot=\"dialog-description\" className={cn(\"text-sm text-text-supporting\", className)} {...props} />; }\nfunction DialogBody({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"dialog-body\" className={cn(\"-mx-1 min-h-0 overflow-y-auto px-1 text-sm\", className)} {...props} />; }\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"dialog-footer\" className={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)} {...props} />; }\nexport { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };\n","import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type ?? \"text\"}\n data-slot=\"input\"\n className={cn(\n \"ds-type-control border-control-border bg-surface-control flex h-[var(--ds-field-control-height)] w-full min-w-0 rounded-[var(--ds-field-control-radius)] border px-[var(--ds-field-control-padding-x)] py-2 shadow-none transition-colors outline-none selection:bg-action selection:text-action-foreground placeholder:text-text-supporting disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"focus-visible:border-focus focus-visible:ring-focus/50 focus-visible:ring-[3px]\",\n \"aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n","import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\ntype ShortcutHintProps = React.ComponentProps<\"kbd\"> & {\n label?: string;\n};\n\nfunction ShortcutHint({\n \"aria-label\": ariaLabel,\n children,\n className,\n label,\n ...props\n}: ShortcutHintProps) {\n const accessibleLabel = ariaLabel ?? label;\n\n return (\n <kbd\n data-slot=\"shortcut-hint\"\n className={cn(\n \"inline-flex min-w-5 items-center justify-center rounded border border-border-default bg-surface-muted px-1.5 py-0.5 font-mono text-[0.6875rem] font-medium leading-none text-text-supporting shadow-xs\",\n className,\n )}\n aria-hidden={accessibleLabel ? undefined : true}\n aria-label={accessibleLabel}\n {...props}\n >\n {children}\n </kbd>\n );\n}\n\nexport { ShortcutHint };\nexport type { ShortcutHintProps };\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\ntype SeparatorProps = React.ComponentProps<\"div\"> & {\n decorative?: boolean;\n orientation?: \"horizontal\" | \"vertical\";\n};\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n role,\n ...props\n}: SeparatorProps) {\n return (\n <div\n data-slot=\"separator\"\n data-orientation={orientation}\n role={decorative ? role : role ?? \"separator\"}\n aria-orientation={decorative ? undefined : orientation}\n className={cn(\n \"shrink-0 bg-border-subtle data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\nexport type { SeparatorProps };\n","\"use client\";\nimport * as React from \"react\";\nimport { Drawer } from \"@base-ui/react/drawer\";\nimport { XIcon } from \"lucide-react\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\n\ntype SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nconst swipeDirectionBySide: Record<SheetSide, React.ComponentProps<typeof Drawer.Root>[\"swipeDirection\"]> = {\n top: \"up\",\n right: \"right\",\n bottom: \"down\",\n left: \"left\",\n};\n\ntype SheetProps = React.ComponentProps<typeof Drawer.Root> & {\n /** Sets the panel position and the corresponding swipe-to-dismiss direction. */\n side?: SheetSide;\n};\n\nconst SheetSideContext = React.createContext<SheetSide>(\"right\");\n\nfunction Sheet({ side = \"right\", swipeDirection, ...props }: SheetProps) {\n return <SheetSideContext.Provider value={side}><Drawer.Root data-slot=\"sheet\" swipeDirection={swipeDirection ?? swipeDirectionBySide[side]} {...props} /></SheetSideContext.Provider>;\n}\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof Drawer.Trigger>) { return <Drawer.Trigger data-slot=\"sheet-trigger\" {...props} />; }\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof Drawer.Portal>) { return <Drawer.Portal data-slot=\"sheet-portal\" {...props} />; }\nfunction SheetClose({ ...props }: React.ComponentProps<typeof Drawer.Close>) { return <Drawer.Close data-slot=\"sheet-close\" {...props} />; }\nconst sideClasses: Record<SheetSide, string> = { top: \"inset-x-0 top-0 max-h-[90vh] border-b\", right: \"right-0 top-0 h-full max-w-md border-l sm:max-w-lg\", bottom: \"inset-x-0 bottom-0 max-h-[90vh] border-t\", left: \"left-0 top-0 h-full max-w-md border-r sm:max-w-lg\" };\nfunction SheetOverlay({ className, ...props }: React.ComponentProps<typeof Drawer.Backdrop>) { return <Drawer.Backdrop data-slot=\"sheet-overlay\" className={cn(\"fixed inset-0\", overlayLayers.modal, \"bg-black/50 data-open:animate-in data-closed:animate-out\", className)} {...props} />; }\nfunction SheetContent({ className, children, side: sideProp, closeLabel = \"Close\", ...props }: React.ComponentProps<typeof Drawer.Popup> & { side?: SheetSide; closeLabel?: string }) {\n const contextSide = React.useContext(SheetSideContext);\n const side = sideProp ?? contextSide;\n return <SheetPortal><SheetOverlay /><Drawer.Viewport className={cn(\"fixed inset-0 pointer-events-none\", overlayLayers.modal)}><Drawer.Popup data-slot=\"sheet-content\" className={cn(\"pointer-events-auto absolute flex w-full flex-col gap-6 bg-canvas p-6 text-text-primary shadow-lg outline-none data-open:animate-in data-closed:animate-out\", sideClasses[side], className)} {...props}>{children}<Drawer.Close data-slot=\"sheet-close\" className=\"absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus focus:ring-offset-2 focus:ring-offset-canvas [&_svg]:size-4\"><XIcon /><span className=\"sr-only\">{closeLabel}</span></Drawer.Close></Drawer.Popup></Drawer.Viewport></SheetPortal>;\n}\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"sheet-header\" className={cn(\"grid gap-2 pr-8\", className)} {...props} />; }\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof Drawer.Title>) { return <Drawer.Title data-slot=\"sheet-title\" className={cn(\"text-lg font-semibold leading-tight\", className)} {...props} />; }\nfunction SheetDescription({ className, ...props }: React.ComponentProps<typeof Drawer.Description>) { return <Drawer.Description data-slot=\"sheet-description\" className={cn(\"text-sm text-text-supporting\", className)} {...props} />; }\nfunction SheetBody({ className, ...props }: React.ComponentProps<typeof Drawer.Content>) { return <Drawer.Content data-slot=\"sheet-body\" className={cn(\"flex min-h-0 flex-1 flex-col gap-[var(--ds-space-group)] overflow-y-auto pr-1\", className)} {...props} />; }\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"sheet-footer\" className={cn(\"mt-auto flex flex-wrap items-center justify-between gap-2 border-t border-border-subtle pt-4\", className)} {...props} />; }\nexport { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };\n","export { DrawerBackdrop as Backdrop } from \"./backdrop/DrawerBackdrop.mjs\";\nexport { DrawerClose as Close } from \"./close/DrawerClose.mjs\";\nexport { DrawerContent as Content } from \"./content/DrawerContent.mjs\";\nexport { DrawerDescription as Description } from \"./description/DrawerDescription.mjs\";\nexport { DrawerIndent as Indent } from \"./indent/DrawerIndent.mjs\";\nexport { DrawerIndentBackground as IndentBackground } from \"./indent-background/DrawerIndentBackground.mjs\";\nexport { DrawerPopup as Popup } from \"./popup/DrawerPopup.mjs\";\nexport { DrawerPortal as Portal } from \"./portal/DrawerPortal.mjs\";\nexport { DrawerProvider as Provider } from \"./provider/DrawerProvider.mjs\";\nexport { DrawerRoot as Root } from \"./root/DrawerRoot.mjs\";\nexport { DrawerSwipeArea as SwipeArea } from \"./swipe-area/DrawerSwipeArea.mjs\";\nexport { DrawerTitle as Title } from \"./title/DrawerTitle.mjs\";\nexport { DrawerTrigger as Trigger } from \"./trigger/DrawerTrigger.mjs\";\nexport { DrawerViewport as Viewport } from \"./viewport/DrawerViewport.mjs\";\nexport { DrawerVirtualKeyboardProvider as VirtualKeyboardProvider } from \"./virtual-keyboard-provider/DrawerVirtualKeyboardProvider.mjs\";\nexport { createDrawerHandle as createHandle, DrawerHandle as Handle } from \"./handle.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { DrawerPopupCssVars } from \"../popup/DrawerPopupCssVars.mjs\";\nimport { DrawerBackdropCssVars } from \"./DrawerBackdropCssVars.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerBackdrop = /*#__PURE__*/React.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.swipeStrength]: '1'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerBackdrop.displayName = \"DrawerBackdrop\";","export let DrawerPopupCssVars = /*#__PURE__*/function (DrawerPopupCssVars) {\n /**\n * The number of nested drawers that are currently open.\n * @type {number}\n */\n DrawerPopupCssVars[\"nestedDrawers\"] = \"--nested-drawers\";\n /**\n * The height of the drawer popup.\n * @type {CSS length}\n */\n DrawerPopupCssVars[\"height\"] = \"--drawer-height\";\n /**\n * The height of the frontmost open drawer in the current nested drawer stack.\n * @type {CSS length}\n */\n DrawerPopupCssVars[\"frontmostHeight\"] = \"--drawer-frontmost-height\";\n /**\n * The swipe movement on the X axis.\n * @type {CSS length}\n */\n DrawerPopupCssVars[\"swipeMovementX\"] = \"--drawer-swipe-movement-x\";\n /**\n * The swipe movement on the Y axis.\n * @type {CSS length}\n */\n DrawerPopupCssVars[\"swipeMovementY\"] = \"--drawer-swipe-movement-y\";\n /**\n * The snap point offset used for translating the drawer.\n * @type {CSS length}\n */\n DrawerPopupCssVars[\"snapPointOffset\"] = \"--drawer-snap-point-offset\";\n /**\n * A scalar (0.1-1) used to scale the swipe release transition duration in CSS.\n * @type {number}\n */\n DrawerPopupCssVars[\"swipeStrength\"] = \"--drawer-swipe-strength\";\n return DrawerPopupCssVars;\n}({});","export let DrawerBackdropCssVars = /*#__PURE__*/function (DrawerBackdropCssVars) {\n /**\n * The swipe progress of the drawer gesture.\n * @type {number}\n */\n DrawerBackdropCssVars[\"swipeProgress\"] = \"--drawer-swipe-progress\";\n return DrawerBackdropCssVars;\n}({});","'use client';\n\nimport { DialogClose } from \"../../dialog/close/DialogClose.mjs\";\n/**\n * A button that closes the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerClose = DialogClose;","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"./DrawerContentDataAttributes.mjs\";\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerContent = /*#__PURE__*/React.forwardRef(function DrawerContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n useDialogRootContext();\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n [DRAWER_CONTENT_ATTRIBUTE]: ''\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerContent.displayName = \"DrawerContent\";","export const DRAWER_CONTENT_ATTRIBUTE = 'data-drawer-content';","'use client';\n\nimport { DialogDescription } from \"../../dialog/description/DialogDescription.mjs\";\n/**\n * A paragraph with additional information about the drawer.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerDescription = DialogDescription;","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { DrawerBackdropCssVars } from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DrawerPopupCssVars } from \"../popup/DrawerPopupCssVars.mjs\";\nconst stateAttributesMapping = {\n active(value) {\n if (value) {\n return {\n 'data-active': ''\n };\n }\n return {\n 'data-inactive': ''\n };\n }\n};\n\n/**\n * A wrapper element intended to contain your app's main UI.\n * Applies `data-active` when any drawer within the nearest `<Drawer.Provider>` is open.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerIndent = /*#__PURE__*/React.forwardRef(function DrawerIndent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const providerContext = useDrawerProviderContext();\n const active = providerContext?.active ?? false;\n const visualStateStore = providerContext?.visualStateStore;\n const indentRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n const element = indentRef.current;\n if (!element || !visualStateStore) {\n return undefined;\n }\n const syncVisualState = () => {\n const {\n swipeProgress,\n frontmostHeight\n } = visualStateStore.getSnapshot();\n if (swipeProgress <= 0) {\n element.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n } else {\n element.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${swipeProgress}`);\n }\n if (frontmostHeight <= 0) {\n element.style.removeProperty(DrawerPopupCssVars.height);\n } else {\n element.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n }\n };\n syncVisualState();\n const unsubscribe = visualStateStore.subscribe(syncVisualState);\n return () => {\n unsubscribe();\n element.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n element.style.removeProperty(DrawerPopupCssVars.height);\n };\n }, [visualStateStore]);\n const state = {\n active\n };\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, indentRef],\n state,\n props: [{\n style: {\n [DrawerBackdropCssVars.swipeProgress]: '0'\n }\n }, elementProps],\n stateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerIndent.displayName = \"DrawerIndent\";","'use client';\n\nimport * as React from 'react';\nexport const DrawerProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerProviderContext.displayName = \"DrawerProviderContext\";\nexport function useDrawerProviderContext() {\n return React.useContext(DrawerProviderContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nconst stateAttributesMapping = {\n active(value) {\n if (value) {\n return {\n 'data-active': ''\n };\n }\n return {\n 'data-inactive': ''\n };\n }\n};\n\n/**\n * An element placed before `<Drawer.Indent>` to render a background layer that can be styled based on whether any drawer is open.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerIndentBackground = /*#__PURE__*/React.forwardRef(function DrawerIndentBackground(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const providerContext = useDrawerProviderContext();\n const active = providerContext?.active ?? false;\n const state = {\n active\n };\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state,\n props: elementProps,\n stateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerIndentBackground.displayName = \"DrawerIndentBackground\";","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { DrawerBackdropCssVars } from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DrawerPopupCssVars } from \"./DrawerPopupCssVars.mjs\";\nimport { DrawerPopupDataAttributes } from \"./DrawerPopupDataAttributes.mjs\";\nimport { useDialogPortalContext } from \"../../dialog/portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerViewportContext } from \"../viewport/DrawerViewportContext.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n// Module-level flag to ensure we only register the CSS properties once,\n// regardless of how many Drawer components are mounted.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet drawerSwipeVarsRegistered = false;\n\n/**\n * Removes inheritance of high-frequency drawer swipe CSS variables, which\n * reduces style recalculation cost in complex drawers with deep subtrees.\n * See https://motion.dev/blog/web-animation-performance-tier-list\n * under the \"Improving CSS variable performance\" section.\n */\nfunction removeCSSVariableInheritance() {\n if (drawerSwipeVarsRegistered) {\n return;\n }\n\n // Intentionally keep inheritance disabled on WebKit as well. Safari doesn't support\n // opting descendants back in via `--var: inherit` for custom properties registered\n // with `inherits: false`, but Drawer does not rely on descendant access to these vars\n // (unlike ScrollArea), so we keep the performance optimization enabled.\n if (typeof CSS !== 'undefined' && 'registerProperty' in CSS) {\n [DrawerPopupCssVars.swipeMovementX, DrawerPopupCssVars.swipeMovementY, DrawerPopupCssVars.snapPointOffset].forEach(name => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<length>',\n inherits: false,\n initialValue: '0px'\n });\n } catch {\n /* ignore already-registered */\n }\n });\n [{\n name: DrawerBackdropCssVars.swipeProgress,\n initialValue: '0'\n }, {\n name: DrawerPopupCssVars.swipeStrength,\n initialValue: '1'\n }].forEach(({\n name,\n initialValue\n }) => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<number>',\n inherits: false,\n initialValue\n });\n } catch {\n /* ignore already-registered */\n }\n });\n }\n drawerSwipeVarsRegistered = true;\n}\nconst stateAttributesMapping = {\n ...popupTransitionStateMapping,\n expanded(value) {\n return value ? {\n [DrawerPopupDataAttributes.expanded]: ''\n } : null;\n },\n nestedDrawerOpen(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerOpen]: ''\n } : null;\n },\n nestedDrawerSwiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerSwiping]: ''\n } : null;\n },\n swipeDirection(value) {\n return {\n [DrawerPopupDataAttributes.swipeDirection]: value\n };\n },\n swiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.swiping]: ''\n } : null;\n }\n};\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPopup = /*#__PURE__*/React.forwardRef(function DrawerPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const {\n swipeDirection,\n frontmostHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onPopupHeightChange,\n notifyParentFrontmostHeight,\n notifyParentHasNestedDrawer\n } = useDrawerRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const transitionStatus = store.useState('transitionStatus');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n const popupId = elementProps.id ?? floatingId;\n const swipe = useDrawerViewportContext();\n useDialogPortalContext();\n const {\n snapPoints,\n activeSnapPoint,\n activeSnapPointOffset\n } = useDrawerSnapPoints();\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const swiping = swipe?.swiping ?? false;\n const swipeStrength = swipe?.swipeStrength ?? null;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const popupHeightRef = React.useRef(0);\n\n /* istanbul ignore else -- process.env.NODE_ENV is a build-time constant. */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (swipe) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the ' + 'viewport disables drawer swipe handling and touch scroll locking. Wrap ' + '<Drawer.Popup> in <Drawer.Viewport>.';\n error(`${message}${ownerStackMessage}`);\n }, [swipe]);\n }\n const measureHeight = useStableCallback(() => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const offsetHeight = popupElement.offsetHeight;\n\n // Only skip while the element is still actually stretched beyond its last measured height.\n if (popupHeightRef.current > 0 && frontmostHeight > popupHeightRef.current && offsetHeight > popupHeightRef.current) {\n return;\n }\n const keepHeightWhileNested = popupHeightRef.current > 0 && hasNestedDrawer;\n if (keepHeightWhileNested) {\n const oldHeight = popupHeightRef.current;\n setPopupHeight(oldHeight);\n onPopupHeightChange(oldHeight);\n return;\n }\n const nextHeight = offsetHeight;\n if (nextHeight === popupHeightRef.current) {\n return;\n }\n popupHeightRef.current = nextHeight;\n setPopupHeight(nextHeight);\n onPopupHeightChange(nextHeight);\n });\n useIsoLayoutEffect(() => {\n if (!mounted) {\n popupHeightRef.current = 0;\n setPopupHeight(0);\n onPopupHeightChange(0);\n return undefined;\n }\n const popupElement = popupRef.current;\n if (!popupElement) {\n return undefined;\n }\n removeCSSVariableInheritance();\n measureHeight();\n if (typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureHeight);\n resizeObserver.observe(popupElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureHeight, mounted, nestedDrawerOpen, onPopupHeightChange, popupRef]);\n useIsoLayoutEffect(() => {\n const syncNestedSwipeProgress = () => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const progress = nestedSwipeProgressStore.getSnapshot();\n if (progress > 0) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${progress}`);\n } else {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n syncNestedSwipeProgress();\n const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);\n const popupElement = popupRef.current;\n return () => {\n unsubscribe();\n if (popupElement) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n }, [nestedSwipeProgressStore, popupRef]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return undefined;\n }\n notifyParentFrontmostHeight?.(frontmostHeight);\n return () => {\n notifyParentFrontmostHeight?.(0);\n };\n }, [frontmostHeight, open, notifyParentFrontmostHeight]);\n useIsoLayoutEffect(() => {\n if (!notifyParentHasNestedDrawer) {\n return undefined;\n }\n const present = open || transitionStatus === 'ending';\n notifyParentHasNestedDrawer(present);\n return () => {\n notifyParentHasNestedDrawer(false);\n };\n }, [notifyParentHasNestedDrawer, open, transitionStatus]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? popupRef : initialFocus;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n expanded: activeSnapPoint === 1,\n nestedDrawerOpen,\n nestedDrawerSwiping: nestedSwiping,\n swipeDirection,\n swiping\n };\n let popupHeightCssVarValue;\n const shouldUseAutoHeight = !hasNestedDrawer && transitionStatus !== 'ending';\n if (popupHeight && !shouldUseAutoHeight) {\n popupHeightCssVarValue = `${popupHeight}px`;\n }\n const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up');\n let snapPointOffsetValue = null;\n if (shouldApplySnapPoints && activeSnapPointOffset !== null) {\n snapPointOffsetValue = swipeDirection === 'up' ? -activeSnapPointOffset : activeSnapPointOffset;\n }\n let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;\n if (shouldApplySnapPoints && swipeDirection === 'down') {\n const baseOffset = activeSnapPointOffset ?? 0;\n const movementValue = Number.parseFloat(String(dragStyles[DrawerPopupCssVars.swipeMovementY]));\n if (swiping && Number.isFinite(movementValue)) {\n dragStyles = {\n ...dragStyles,\n transform: undefined,\n [DrawerPopupCssVars.swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`\n };\n } else {\n dragStyles = {\n ...dragStyles,\n transform: undefined\n };\n }\n }\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: popupId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n ...dragStyles,\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.nestedDrawers]: nestedOpenDrawerCount,\n [DrawerPopupCssVars.height]: popupHeightCssVarValue,\n [DrawerPopupCssVars.snapPointOffset]: typeof snapPointOffsetValue === 'number' ? `${snapPointOffsetValue}px` : '0px',\n [DrawerPopupCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined,\n [DrawerPopupCssVars.swipeStrength]: typeof swipeStrength === 'number' && Number.isFinite(swipeStrength) && swipeStrength > 0 ? `${swipeStrength}` : '1'\n }\n }, elementProps],\n ref: [forwardedRef, popupRef, setPopupElement],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerPopup.displayName = \"DrawerPopup\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\nexport let DrawerPopupDataAttributes = function (DrawerPopupDataAttributes) {\n /**\n * Present when the drawer is open.\n */\n DrawerPopupDataAttributes[DrawerPopupDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the drawer is closed.\n */\n DrawerPopupDataAttributes[DrawerPopupDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the drawer begins animating in.\n */\n DrawerPopupDataAttributes[DrawerPopupDataAttributes[\"startingStyle\"] = CommonPopupDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the drawer is animating out.\n */\n DrawerPopupDataAttributes[DrawerPopupDataAttributes[\"endingStyle\"] = CommonPopupDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the drawer is at the expanded (full-height) snap point.\n */\n DrawerPopupDataAttributes[\"expanded\"] = \"data-expanded\";\n /**\n * Present when a nested drawer is open.\n */\n DrawerPopupDataAttributes[\"nestedDrawerOpen\"] = \"data-nested-drawer-open\";\n /**\n * Present when a nested drawer is being swiped.\n */\n DrawerPopupDataAttributes[\"nestedDrawerSwiping\"] = \"data-nested-drawer-swiping\";\n /**\n * Present when the drawer is dismissed by swiping.\n */\n DrawerPopupDataAttributes[\"swipeDismiss\"] = \"data-swipe-dismiss\";\n /**\n * Indicates the swipe direction.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\n DrawerPopupDataAttributes[\"swipeDirection\"] = \"data-swipe-direction\";\n /**\n * Present when the drawer is being swiped.\n */\n DrawerPopupDataAttributes[\"swiping\"] = \"data-swiping\";\n return DrawerPopupDataAttributes;\n}({});","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DrawerRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerRootContext.displayName = \"DrawerRootContext\";\nexport function useDrawerRootContext(optional) {\n const drawerRootContext = React.useContext(DrawerRootContext);\n if (optional !== true && drawerRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.' : _formatErrorMessage(90));\n }\n return drawerRootContext;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { clamp } from \"../../internals/clamp.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useDrawerRootContext } from \"./DrawerRootContext.mjs\";\n/**\n * Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag\n * overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.\n */\nexport function getSnapPointSwipeMovement(baseOffset, movementValue) {\n const nextOffset = baseOffset + movementValue;\n if (nextOffset >= 0) {\n return movementValue;\n }\n return -Math.sqrt(-nextOffset) - baseOffset;\n}\nfunction resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return null;\n }\n if (typeof snapPoint === 'number') {\n if (!Number.isFinite(snapPoint)) {\n return null;\n }\n if (snapPoint <= 1) {\n return clamp(snapPoint, 0, 1) * viewportHeight;\n }\n return snapPoint;\n }\n const trimmed = snapPoint.trim();\n if (trimmed.endsWith('px')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value : null;\n }\n if (trimmed.endsWith('rem')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value * rootFontSize : null;\n }\n return null;\n}\n\n/**\n * Returns the index of the value closest to `target`, or `-1` if `values` is empty.\n */\nexport function closestSnapPointIndex(values, target) {\n let closestIndex = -1;\n let closestDistance = Infinity;\n for (let index = 0; index < values.length; index += 1) {\n const distance = Math.abs(values[index] - target);\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n }\n return closestIndex;\n}\nexport function useDrawerSnapPoints() {\n const store = useDialogRootContext();\n const {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerRootContext();\n const viewportElement = store.useState('viewportElement');\n const [viewportHeight, setViewportHeight] = React.useState(0);\n const [rootFontSize, setRootFontSize] = React.useState(16);\n const measureViewportHeight = useStableCallback(() => {\n const doc = ownerDocument(viewportElement);\n const html = doc.documentElement;\n setViewportHeight(viewportElement ? viewportElement.offsetHeight : html.clientHeight);\n const fontSize = parseFloat(getComputedStyle(html).fontSize);\n if (Number.isFinite(fontSize)) {\n setRootFontSize(fontSize);\n }\n });\n useIsoLayoutEffect(() => {\n measureViewportHeight();\n if (!viewportElement || typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureViewportHeight);\n resizeObserver.observe(viewportElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureViewportHeight, viewportElement]);\n const resolvedSnapPoints = React.useMemo(() => {\n if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) {\n return [];\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolved = snapPoints.map(value => {\n const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return null;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return {\n value,\n height: clampedHeight,\n offset: Math.max(0, popupHeight - clampedHeight)\n };\n }).filter(point => Boolean(point));\n if (resolved.length <= 1) {\n return resolved;\n }\n const deduped = [];\n const seenHeights = [];\n for (let index = resolved.length - 1; index >= 0; index -= 1) {\n const point = resolved[index];\n const isDuplicate = seenHeights.some(height => Math.abs(height - point.height) <= 1);\n if (isDuplicate) {\n continue;\n }\n seenHeights.push(point.height);\n deduped.push(point);\n }\n deduped.reverse();\n return deduped;\n }, [popupHeight, rootFontSize, snapPoints, viewportHeight]);\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (activeSnapPoint === null) {\n return undefined;\n }\n const exactMatch = resolvedSnapPoints.find(point => Object.is(point.value, activeSnapPoint));\n if (exactMatch) {\n return exactMatch;\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return undefined;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.height), clampedHeight)];\n }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);\n return {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight,\n viewportHeight,\n resolvedSnapPoints,\n activeSnapPointOffset: resolvedActiveSnapPoint?.offset ?? null\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerViewportContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") DrawerViewportContext.displayName = \"DrawerViewportContext\";\nexport function useDrawerViewportContext() {\n return React.useContext(DrawerViewportContext);\n}","'use client';\n\nimport { DialogPortal } from \"../../dialog/portal/DialogPortal.mjs\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPortal = DialogPortal;","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { DrawerProviderContext } from \"./DrawerProviderContext.mjs\";\n\n/**\n * Provides a shared context for coordinating global Drawer UI, such as indent/background effects based on whether any Drawer is open.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function DrawerProvider(props) {\n const {\n children\n } = props;\n const [openDrawers, setOpenDrawers] = React.useState(() => new Set());\n const [visualStateStore] = React.useState(createVisualStateStore);\n const setDrawerOpen = useStableCallback((drawer, open) => {\n setOpenDrawers(prev => {\n if (prev.has(drawer) === open) {\n return prev;\n }\n const next = new Set(prev);\n if (open) {\n next.add(drawer);\n } else {\n next.delete(drawer);\n }\n return next;\n });\n });\n const removeDrawer = useStableCallback(drawer => {\n setDrawerOpen(drawer, false);\n });\n const active = openDrawers.size > 0;\n const contextValue = React.useMemo(() => ({\n setDrawerOpen,\n removeDrawer,\n active,\n visualStateStore\n }), [active, removeDrawer, setDrawerOpen, visualStateStore]);\n return /*#__PURE__*/_jsx(DrawerProviderContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createVisualStateStore() {\n let state = {\n swipeProgress: 0,\n frontmostHeight: 0\n };\n const listeners = new Set();\n return {\n getSnapshot: () => state,\n set(nextState) {\n let nextSwipeProgress = state.swipeProgress;\n if (nextState.swipeProgress !== undefined) {\n nextSwipeProgress = Number.isFinite(nextState.swipeProgress) ? nextState.swipeProgress : 0;\n }\n let nextFrontmostHeight = state.frontmostHeight;\n if (nextState.frontmostHeight !== undefined) {\n nextFrontmostHeight = Number.isFinite(nextState.frontmostHeight) ? nextState.frontmostHeight : 0;\n }\n if (nextSwipeProgress === state.swipeProgress && nextFrontmostHeight === state.frontmostHeight) {\n return;\n }\n state = {\n swipeProgress: nextSwipeProgress,\n frontmostHeight: nextFrontmostHeight\n };\n listeners.forEach(listener => {\n listener();\n });\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n };\n}","'use client';\n\nvar _DrawerProviderReport, _DrawerProviderReport2;\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\nimport { DrawerRootContext, useDrawerRootContext } from \"./DrawerRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderDialogRoot } from \"../../dialog/root/useRenderDialogRoot.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the drawer.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport function DrawerRoot(props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal = false,\n modal = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n swipeDirection = 'down',\n snapToSequentialPoints = false,\n snapPoints,\n snapPoint: snapPointProp,\n defaultSnapPoint,\n onSnapPointChange\n } = props;\n const parentDrawerRootContext = useDrawerRootContext(true);\n const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;\n const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;\n const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;\n const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [frontmostHeight, setFrontmostHeight] = React.useState(0);\n const [hasNestedDrawer, setHasNestedDrawer] = React.useState(false);\n const [nestedSwiping, setNestedSwiping] = React.useState(false);\n const [nestedSwipeProgressStore] = React.useState(createNestedSwipeProgressStore);\n const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;\n const isSnapPointControlled = snapPointProp !== undefined;\n const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({\n controlled: snapPointProp,\n default: resolvedDefaultSnapPoint,\n name: 'Drawer',\n state: 'snapPoint'\n });\n const isNestedDrawerOpenRef = React.useRef(false);\n const swipeAreaActiveRef = React.useRef(false);\n const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {\n const resolvedEventDetails = eventDetails ?? createChangeEventDetails(REASONS.none);\n onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);\n if (resolvedEventDetails.isCanceled) {\n return;\n }\n setActiveSnapPointUnwrapped(nextSnapPoint);\n });\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (isSnapPointControlled) {\n return activeSnapPoint;\n }\n if (!snapPoints || snapPoints.length === 0) {\n return activeSnapPoint;\n }\n if (activeSnapPoint === null || !snapPoints.some(snapPoint => Object.is(snapPoint, activeSnapPoint))) {\n return resolvedDefaultSnapPoint;\n }\n return activeSnapPoint;\n }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);\n const onPopupHeightChange = useStableCallback(height => {\n setPopupHeight(height);\n if (!isNestedDrawerOpenRef.current && height > 0) {\n setFrontmostHeight(height);\n }\n });\n const onNestedFrontmostHeightChange = useStableCallback(height => {\n if (height > 0) {\n isNestedDrawerOpenRef.current = true;\n setFrontmostHeight(height);\n return;\n }\n isNestedDrawerOpenRef.current = false;\n if (popupHeight > 0) {\n setFrontmostHeight(popupHeight);\n }\n });\n const onNestedDrawerPresenceChange = useStableCallback(present => {\n setHasNestedDrawer(present);\n });\n const onNestedSwipeProgressChange = useStableCallback(progress => {\n nestedSwipeProgressStore.set(progress);\n notifyParentSwipeProgressChange?.(progress);\n });\n const onNestedSwipingChange = useStableCallback(swiping => {\n setNestedSwiping(swiping);\n notifyParentSwipingChange?.(swiping);\n });\n const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen && snapPoints && snapPoints.length > 0) {\n setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));\n }\n });\n const contextValue = React.useMemo(() => ({\n swipeDirection,\n swipeAreaActiveRef,\n snapToSequentialPoints,\n snapPoints,\n activeSnapPoint: resolvedActiveSnapPoint,\n setActiveSnapPoint,\n frontmostHeight,\n popupHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onNestedDrawerPresenceChange,\n onPopupHeightChange,\n onNestedFrontmostHeightChange,\n onNestedSwipingChange,\n onNestedSwipeProgressChange,\n notifyParentFrontmostHeight,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n notifyParentHasNestedDrawer\n }), [resolvedActiveSnapPoint, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, notifyParentHasNestedDrawer, notifyParentSwipeProgressChange, notifyParentSwipingChange, notifyParentFrontmostHeight, onNestedDrawerPresenceChange, onNestedFrontmostHeightChange, onNestedSwipeProgressChange, onNestedSwipingChange, onPopupHeightChange, popupHeight, setActiveSnapPoint, snapPoints, snapToSequentialPoints, swipeAreaActiveRef, swipeDirection]);\n const resolvedChildren = typeof children === 'function' ? payload => /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children(payload)]\n }) : /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children]\n });\n const dialog = useRenderDialogRoot('drawer', {\n open: openProp,\n defaultOpen,\n onOpenChange: handleOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal,\n modal,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp,\n children: resolvedChildren\n });\n return /*#__PURE__*/_jsx(DrawerRootContext.Provider, {\n value: contextValue,\n children: dialog\n });\n}\nfunction createNestedSwipeProgressStore() {\n let progress = 0;\n const listeners = new Set();\n return {\n getSnapshot: () => progress,\n set(nextProgress) {\n const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;\n if (resolved === progress) {\n return;\n }\n progress = resolved;\n listeners.forEach(listener => {\n listener();\n });\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n };\n}\nfunction DrawerProviderReporter() {\n const providerContext = useDrawerProviderContext();\n const store = useDialogRootContext(false);\n const setDrawerOpen = providerContext?.setDrawerOpen;\n const removeDrawer = providerContext?.removeDrawer;\n const open = store.useState('open');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const popupElement = store.useState('popupElement');\n const isTopmost = nestedOpenDialogCount === 0;\n useIsoLayoutEffect(() => {\n if (!removeDrawer) {\n return undefined;\n }\n return () => {\n removeDrawer(store);\n };\n }, [removeDrawer, store]);\n useIsoLayoutEffect(() => {\n setDrawerOpen?.(store, open);\n }, [open, setDrawerOpen, store]);\n React.useEffect(() => {\n // CloseWatcher enables the Android back gesture (Chromium-only).\n // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.\n if (!open || !isTopmost || !platform.os.android) {\n return undefined;\n }\n const win = ownerWindow(popupElement);\n const CloseWatcherCtor = win.CloseWatcher;\n if (!CloseWatcherCtor) {\n return undefined;\n }\n function handleCloseWatcher(event) {\n if (!store.select('open')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.closeWatcher, event));\n }\n const closeWatcher = new CloseWatcherCtor();\n const unsubscribe = addEventListener(closeWatcher, 'close', handleCloseWatcher);\n return () => {\n unsubscribe();\n closeWatcher.destroy();\n };\n }, [store, isTopmost, open, popupElement]);\n return null;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { NOOP } from \"../../internals/noop.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getDisplacement, getElementTransform, useSwipeDismiss } from \"../../utils/useSwipeDismiss.mjs\";\nimport { DrawerPopupCssVars } from \"../popup/DrawerPopupCssVars.mjs\";\nimport { DrawerPopupDataAttributes } from \"../popup/DrawerPopupDataAttributes.mjs\";\nimport { DrawerBackdropCssVars } from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useTriggerRegistration } from \"../../utils/popups/index.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { isVirtualClick } from \"../../floating-ui-react/utils/event.mjs\";\nimport { DrawerSwipeAreaDataAttributes } from \"./DrawerSwipeAreaDataAttributes.mjs\";\nconst DEFAULT_SWIPE_OPEN_RATIO = 0.5;\nconst MIN_SWIPE_START_DISTANCE = 1;\nconst VELOCITY_THRESHOLD = 0.1;\nconst FALLBACK_SWIPE_OPEN_THRESHOLD = 40;\nconst SWIPE_AREA_OPEN_HOOK = {\n [DrawerSwipeAreaDataAttributes.open]: ''\n};\nconst SWIPE_AREA_CLOSED_HOOK = {\n [DrawerSwipeAreaDataAttributes.closed]: ''\n};\nconst SWIPE_AREA_SWIPING_HOOK = {\n [DrawerSwipeAreaDataAttributes.swiping]: ''\n};\nconst SWIPE_AREA_DISABLED_HOOK = {\n [DrawerSwipeAreaDataAttributes.disabled]: ''\n};\nconst stateAttributesMapping = {\n open(value) {\n return value ? SWIPE_AREA_OPEN_HOOK : SWIPE_AREA_CLOSED_HOOK;\n },\n swiping(value) {\n return value ? SWIPE_AREA_SWIPING_HOOK : null;\n },\n swipeDirection(value) {\n return {\n [DrawerSwipeAreaDataAttributes.swipeDirection]: value\n };\n },\n disabled(value) {\n return value ? SWIPE_AREA_DISABLED_HOOK : null;\n }\n};\nconst oppositeSwipeDirection = {\n up: 'down',\n down: 'up',\n left: 'right',\n right: 'left'\n};\nfunction resolveTouchAction(direction) {\n return direction === 'left' || direction === 'right' ? 'pan-y' : 'pan-x';\n}\n\n/**\n * An invisible area that listens for swipe gestures to open the drawer.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerSwipeArea = /*#__PURE__*/React.forwardRef(function DrawerSwipeArea(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n swipeDirection: swipeDirectionProp,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const {\n swipeDirection,\n frontmostHeight,\n swipeAreaActiveRef\n } = useDrawerRootContext();\n const providerContext = useDrawerProviderContext();\n const [swipeActive, setSwipeActive] = React.useState(false);\n const swipeAreaRef = React.useRef(null);\n const swipeStartEventRef = React.useRef(null);\n const openedBySwipeRef = React.useRef(false);\n const dragDeltaRef = React.useRef({\n x: 0,\n y: 0\n });\n const closedOffsetRef = React.useRef(null);\n const appliedSwipeStylesRef = React.useRef(false);\n const swipePopupElementRef = React.useRef(null);\n const swipeBackdropElementRef = React.useRef(null);\n const popupTransitionRef = React.useRef(null);\n const releaseGuardCleanupRef = React.useRef(NOOP);\n const swipeAreaId = useBaseUiId(componentProps.id);\n const registerTrigger = useTriggerRegistration(swipeAreaId, store);\n const open = store.useState('open');\n const resetDragDelta = useStableCallback(() => {\n dragDeltaRef.current.x = 0;\n dragDeltaRef.current.y = 0;\n });\n const resolvedSwipeDirection = swipeDirectionProp ?? oppositeSwipeDirection[swipeDirection];\n const dismissDirection = oppositeSwipeDirection[resolvedSwipeDirection];\n const enabled = !disabled && (!open || swipeActive);\n function disableDismissForSwipe() {\n releaseGuardCleanupRef.current();\n store.context.outsidePressEnabledRef.current = false;\n }\n const enableDismissAfterRelease = useStableCallback(() => {\n releaseGuardCleanupRef.current();\n const doc = ownerDocument(swipeAreaRef.current);\n function restore(event) {\n // The gesture's trailing release click is the one physical click with no `pointerdown` of\n // its own. Ignore it and keep waiting, so it cannot dismiss the drawer it just opened,\n // while a click-only activation (keyboard or assistive tech) still re-enables in time.\n if (event?.type === 'click' && event.detail !== 0 && !isVirtualClick(event)) {\n return;\n }\n releaseGuardCleanupRef.current = NOOP;\n doc.removeEventListener('pointerdown', restore, true);\n doc.removeEventListener('click', restore, true);\n store.context.outsidePressEnabledRef.current = true;\n }\n\n // The pointerup that ends a swipe-open gesture synthesizes a `click`. When the drag released\n // outside the popup (e.g. it was dragged past the popup's size), that click would be treated as\n // an outside press and immediately dismiss the drawer that was just opened. Keep outside-press\n // dismissal disabled until the next interaction that isn't that release click: a deliberate\n // outside press starts with a `pointerdown`, and a click-only activation (keyboard or\n // assistive tech) is distinguishable from a physical release. This is deterministic, unlike\n // re-enabling on a timer that can race the synthesized click and dismiss at random.\n //\n // `restore` runs in document capture, ahead of floating-ui's own outside-press check (which\n // happens on the event target, after capture), so the triggering press still dismisses.\n releaseGuardCleanupRef.current = restore;\n doc.addEventListener('pointerdown', restore, true);\n doc.addEventListener('click', restore, true);\n });\n function getPopupSize(popupElement) {\n const isHorizontal = dismissDirection === 'left' || dismissDirection === 'right';\n const size = isHorizontal ? popupElement.offsetWidth : popupElement.offsetHeight;\n if (size <= 0) {\n return null;\n }\n return size;\n }\n function resolvePopupSize() {\n const popupElement = store.context.popupRef.current;\n return popupElement ? getPopupSize(popupElement) : null;\n }\n function resolveClosedOffset(popupElement) {\n const offset = getPopupSize(popupElement);\n if (offset == null) {\n return null;\n }\n const isHorizontal = dismissDirection === 'left' || dismissDirection === 'right';\n const transform = getElementTransform(popupElement);\n const transformOffset = isHorizontal ? transform.x : transform.y;\n if (Number.isFinite(transformOffset) && Math.abs(transformOffset) > 0.5) {\n return Math.min(offset, Math.abs(transformOffset));\n }\n return offset;\n }\n function resolveSwipeOpenThreshold() {\n const popupSize = resolvePopupSize();\n if (popupSize == null) {\n return FALLBACK_SWIPE_OPEN_THRESHOLD;\n }\n return popupSize * DEFAULT_SWIPE_OPEN_RATIO;\n }\n function applySwipeMovement() {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n return;\n }\n if (!store.select('open') || !store.select('mounted')) {\n return;\n }\n if (closedOffsetRef.current == null) {\n closedOffsetRef.current = resolveClosedOffset(popupElement);\n }\n const closedOffset = closedOffsetRef.current;\n if (closedOffset === null) {\n return;\n }\n const {\n x,\n y\n } = dragDeltaRef.current;\n const displacement = getDisplacement(resolvedSwipeDirection, x, y);\n const clampedDisplacement = Math.max(0, displacement);\n const dampedDisplacement = clampedDisplacement > closedOffset ? closedOffset + Math.sqrt(clampedDisplacement - closedOffset) : clampedDisplacement;\n const remaining = closedOffset - dampedDisplacement;\n const directionSign = dismissDirection === 'left' || dismissDirection === 'up' ? -1 : 1;\n const movement = remaining * directionSign;\n const isHorizontal = dismissDirection === 'left' || dismissDirection === 'right';\n const movementX = isHorizontal ? movement : 0;\n const movementY = isHorizontal ? 0 : movement;\n const openProgress = Math.max(0, Math.min(1, clampedDisplacement / closedOffset));\n const backdropProgress = Math.max(0, Math.min(1, 1 - openProgress));\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementX, `${movementX}px`);\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${movementY}px`);\n popupElement.setAttribute(DrawerPopupDataAttributes.swiping, '');\n swipePopupElementRef.current = popupElement;\n if (popupTransitionRef.current === null) {\n popupTransitionRef.current = popupElement.style.transition;\n }\n popupElement.style.transition = 'none';\n const backdropElement = store.context.backdropRef.current;\n if (backdropElement) {\n backdropElement.setAttribute(DrawerPopupDataAttributes.swiping, '');\n swipeBackdropElementRef.current = backdropElement;\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${backdropProgress}`);\n if (openProgress > 0 && frontmostHeight > 0) {\n backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n } else {\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n }\n providerContext?.visualStateStore.set({\n swipeProgress: openProgress,\n frontmostHeight: openProgress > 0 ? frontmostHeight : 0\n });\n appliedSwipeStylesRef.current = true;\n swipeAreaActiveRef.current = true;\n }\n const clearSwipeStyles = useStableCallback(() => {\n const popupElement = swipePopupElementRef.current;\n if (popupElement) {\n popupElement.style.removeProperty(DrawerPopupCssVars.swipeMovementX);\n popupElement.style.removeProperty(DrawerPopupCssVars.swipeMovementY);\n popupElement.removeAttribute(DrawerPopupDataAttributes.swiping);\n }\n if (popupElement && popupTransitionRef.current !== null) {\n popupElement.style.transition = popupTransitionRef.current;\n popupTransitionRef.current = null;\n }\n const backdropElement = swipeBackdropElementRef.current;\n if (backdropElement) {\n backdropElement.removeAttribute(DrawerPopupDataAttributes.swiping);\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n providerContext?.visualStateStore.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n appliedSwipeStylesRef.current = false;\n swipePopupElementRef.current = null;\n swipeBackdropElementRef.current = null;\n swipeAreaActiveRef.current = false;\n });\n function openDrawer(event) {\n openedBySwipeRef.current = true;\n store.setOpen(true, createChangeEventDetails(REASONS.swipe, event, swipeAreaRef.current));\n }\n function closeDrawer(event) {\n store.setOpen(false, createChangeEventDetails(REASONS.swipe, event, swipeAreaRef.current));\n }\n function resetSwipeInteractionState() {\n swipeStartEventRef.current = null;\n openedBySwipeRef.current = false;\n closedOffsetRef.current = null;\n setSwipeActive(false);\n }\n function finishSwipeInteraction() {\n resetSwipeInteractionState();\n enableDismissAfterRelease();\n resetDragDelta();\n clearSwipeStyles();\n }\n const swipe = useSwipeDismiss({\n enabled,\n directions: [resolvedSwipeDirection],\n elementRef: swipeAreaRef,\n trackDrag: false,\n movementCssVars: {\n x: DrawerPopupCssVars.swipeMovementX,\n y: DrawerPopupCssVars.swipeMovementY\n },\n onSwipeStart(event) {\n disableDismissForSwipe();\n swipeStartEventRef.current = event;\n openedBySwipeRef.current = false;\n setSwipeActive(true);\n resetDragDelta();\n },\n onProgress(_progress, details) {\n if (!details) {\n return;\n }\n if (!swipeStartEventRef.current) {\n return;\n }\n dragDeltaRef.current.x = details.deltaX;\n dragDeltaRef.current.y = details.deltaY;\n if (details.direction !== resolvedSwipeDirection) {\n return;\n }\n const displacement = getDisplacement(resolvedSwipeDirection, details.deltaX, details.deltaY);\n if (!openedBySwipeRef.current && displacement < MIN_SWIPE_START_DISTANCE) {\n return;\n }\n if (!openedBySwipeRef.current && !store.select('open')) {\n openDrawer(swipeStartEventRef.current);\n }\n applySwipeMovement();\n },\n onRelease({\n event,\n direction,\n deltaX,\n deltaY,\n releaseVelocityX,\n releaseVelocityY\n }) {\n const displacement = getDisplacement(resolvedSwipeDirection, deltaX, deltaY);\n const releaseVelocity = getDisplacement(resolvedSwipeDirection, releaseVelocityX, releaseVelocityY);\n const threshold = resolveSwipeOpenThreshold();\n const hasEnoughDistance = displacement >= threshold;\n const hasEnoughVelocity = releaseVelocity >= VELOCITY_THRESHOLD;\n const shouldOpen = direction === resolvedSwipeDirection && (hasEnoughDistance || hasEnoughVelocity) && !disabled;\n if (shouldOpen) {\n if (!store.select('open')) {\n openDrawer(event);\n }\n } else if (openedBySwipeRef.current && store.select('open')) {\n closeDrawer(event);\n }\n finishSwipeInteraction();\n return false;\n },\n onCancel: finishSwipeInteraction\n });\n const swipePointerProps = swipe.getPointerProps();\n const swipeTouchProps = swipe.getTouchProps();\n const resetSwipe = swipe.reset;\n\n // The commit that opens the drawer re-renders the popup, resetting `--swipe-movement-*` to `0px`\n // (the viewport isn't swiping). Re-assert after the DOM mutation but before paint. No deps: must\n // run on every commit the swipe area participates in.\n useIsoLayoutEffect(() => {\n if (swipeActive && appliedSwipeStylesRef.current) {\n applySwipeMovement();\n }\n });\n useIsoLayoutEffect(() => {\n if (!enabled) {\n if (swipeActive) {\n enableDismissAfterRelease();\n }\n resetSwipe();\n resetDragDelta();\n clearSwipeStyles();\n resetSwipeInteractionState();\n }\n }, [clearSwipeStyles, enableDismissAfterRelease, enabled, resetDragDelta, resetSwipe, swipeActive]);\n React.useEffect(() => {\n return () => {\n releaseGuardCleanupRef.current();\n store.context.outsidePressEnabledRef.current = true;\n };\n }, [store]);\n const state = {\n open,\n swiping: swipe.swiping,\n swipeDirection: resolvedSwipeDirection,\n disabled\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, swipeAreaRef, registerTrigger],\n stateAttributesMapping,\n props: [{\n role: 'presentation',\n 'aria-hidden': true,\n style: {\n pointerEvents: !enabled ? 'none' : undefined,\n touchAction: resolveTouchAction(resolvedSwipeDirection)\n },\n onPointerDown(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerDown?.(event);\n\n // Prevent native text selection/drag gestures from competing with swipe-open dragging.\n if (event.cancelable) {\n event.preventDefault();\n }\n },\n onPointerMove(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerMove?.(event);\n },\n onPointerUp(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerUp?.(event);\n },\n onPointerCancel(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerCancel?.(event);\n }\n }, swipeTouchProps, swipeAreaId ? {\n id: swipeAreaId\n } : undefined, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerSwipeArea.displayName = \"DrawerSwipeArea\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { findScrollableTouchTarget, hasScrollableAncestor } from \"./scrollable.mjs\";\nimport { clamp } from \"../internals/clamp.mjs\";\nimport { getElementAtPoint } from \"./getElementAtPoint.mjs\";\nconst DEFAULT_SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst MIN_DRAG_THRESHOLD = 1;\nconst MIN_VELOCITY_DURATION_MS = 50;\nconst MIN_RELEASE_VELOCITY_DURATION_MS = 16;\nconst MAX_RELEASE_VELOCITY_AGE_MS = 80;\nconst DEFAULT_IGNORE_SELECTOR = 'button,a,input,select,textarea,label,[role=\"button\"]';\nexport function getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nexport function getElementTransform(element) {\n const computedStyle = ownerWindow(element).getComputedStyle(element);\n const transform = computedStyle.transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}\nfunction getValidTimeStamp(timeStamp) {\n return Number.isFinite(timeStamp) && timeStamp > 0 ? timeStamp : null;\n}\nfunction getDragTransform(dragOffset, scale) {\n return `translate3d(${dragOffset.x}px,${dragOffset.y}px,0) scale(${scale})`;\n}\nfunction hasPrimaryMouseButton(buttons) {\n return buttons % 2 === 1;\n}\nfunction safelyChangePointerCapture(element, pointerId, method) {\n const pointerCaptureMethod = element[method];\n if (typeof pointerCaptureMethod !== 'function') {\n return;\n }\n try {\n pointerCaptureMethod.call(element, pointerId);\n } catch (error) {\n if (error && typeof error === 'object' && 'name' in error && error.name === 'NotFoundError') {\n return;\n }\n throw error;\n }\n}\nexport function useSwipeDismiss(options) {\n const {\n enabled,\n directions,\n elementRef,\n movementCssVars,\n canStart,\n ignoreSelectorWhenTouch = true,\n ignoreScrollableAncestors = false,\n swipeThreshold: swipeThresholdProp,\n onDismiss,\n onProgress,\n onCancel,\n onSwipeStart,\n onRelease,\n onSwipingChange,\n trackDrag = true\n } = options;\n const ignoreSelector = DEFAULT_IGNORE_SELECTOR;\n const primaryDirection = directions.length === 1 ? directions[0] : undefined;\n const swipeThresholdDefault = Math.max(0, typeof swipeThresholdProp === 'number' ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD);\n const allowLeft = directions.includes('left');\n const allowRight = directions.includes('right');\n const allowUp = directions.includes('up');\n const allowDown = directions.includes('down');\n const hasHorizontal = allowLeft || allowRight;\n const hasVertical = allowUp || allowDown;\n const scrollAxes = React.useMemo(() => {\n const axes = [];\n if (hasVertical) {\n axes.push('vertical');\n }\n if (hasHorizontal) {\n axes.push('horizontal');\n }\n return axes;\n }, [hasHorizontal, hasVertical]);\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastMovePosRef = React.useRef(null);\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const lockedDirectionRef = React.useRef(null);\n const isFirstPointerMoveRef = React.useRef(false);\n const pendingSwipeRef = React.useRef(false);\n const pendingSwipeStartPosRef = React.useRef(null);\n const swipeFromScrollableRef = React.useRef(false);\n const sawPrimaryButtonsOnMoveRef = React.useRef(false);\n const elementSizeRef = React.useRef({\n width: 0,\n height: 0\n });\n const swipeProgressRef = React.useRef(0);\n const swipeThresholdRef = React.useRef(swipeThresholdDefault);\n const swipeThresholdFunctionRef = React.useRef(null);\n const swipeStartTimeRef = React.useRef(null);\n const lastDragSampleRef = React.useRef(null);\n const lastDragVelocityRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastProgressDetailsRef = React.useRef(null);\n const isSwipingRef = React.useRef(false);\n const dragStyleSnapshotRef = React.useRef(null);\n const setSwiping = useStableCallback(nextSwiping => {\n if (isSwipingRef.current === nextSwiping) {\n return;\n }\n isSwipingRef.current = nextSwiping;\n setIsSwiping(nextSwiping);\n onSwipingChange?.(nextSwiping);\n });\n function resolveSwipeThreshold(direction) {\n if (!direction) {\n return;\n }\n const element = elementRef.current;\n const thresholdFunction = swipeThresholdFunctionRef.current;\n if (!element || !thresholdFunction) {\n return;\n }\n const value = thresholdFunction({\n element,\n direction\n });\n swipeThresholdRef.current = Math.max(0, value);\n }\n const updateSwipeProgress = useStableCallback((progress, details) => {\n const nextProgress = Number.isFinite(progress) ? clamp(progress, 0, 1) : 0;\n const progressChanged = nextProgress !== swipeProgressRef.current;\n let detailsChanged = false;\n if (details) {\n const lastDetails = lastProgressDetailsRef.current;\n detailsChanged = !lastDetails || lastDetails.deltaX !== details.deltaX || lastDetails.deltaY !== details.deltaY || lastDetails.direction !== details.direction;\n }\n if (!progressChanged && !detailsChanged) {\n return;\n }\n swipeProgressRef.current = nextProgress;\n if (details) {\n lastProgressDetailsRef.current = details;\n } else if (progressChanged) {\n lastProgressDetailsRef.current = null;\n }\n onProgress?.(nextProgress, details);\n });\n const syncDragStyles = useStableCallback(swiping => {\n const element = elementRef.current;\n if (!trackDrag || !element) {\n if (!swiping) {\n dragStyleSnapshotRef.current = null;\n }\n return;\n }\n const style = element.style;\n const dragStyleSnapshot = dragStyleSnapshotRef.current;\n if (swiping) {\n if (!dragStyleSnapshot) {\n dragStyleSnapshotRef.current = [style.transition, style.transform];\n }\n style.transition = 'none';\n } else if (dragStyleSnapshot) {\n [style.transition, style.transform] = dragStyleSnapshot;\n dragStyleSnapshotRef.current = null;\n }\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (swiping) {\n style.transform = getDragTransform(dragOffset, initialTransform.scale);\n }\n style.setProperty(movementCssVars.x, `${deltaX}px`);\n style.setProperty(movementCssVars.y, `${deltaY}px`);\n });\n function recordDragSample(offset, timeStamp) {\n if (timeStamp === null) {\n return;\n }\n const lastSample = lastDragSampleRef.current;\n if (lastSample && timeStamp > lastSample.time) {\n const durationMs = Math.max(timeStamp - lastSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);\n lastDragVelocityRef.current = {\n x: (offset.x - lastSample.x) / durationMs,\n y: (offset.y - lastSample.y) / durationMs\n };\n }\n lastDragSampleRef.current = {\n x: offset.x,\n y: offset.y,\n time: timeStamp\n };\n }\n const reset = React.useCallback(() => {\n setCurrentSwipeDirection(undefined);\n setSwiping(false);\n setDragDismissed(false);\n updateSwipeProgress(0);\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = null;\n dragStartPosRef.current = {\n x: 0,\n y: 0\n };\n dragOffsetRef.current = {\n x: 0,\n y: 0\n };\n initialTransformRef.current = {\n x: 0,\n y: 0,\n scale: 1\n };\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n cancelledSwipeRef.current = false;\n swipeCancelBaselineRef.current = {\n x: 0,\n y: 0\n };\n lockedDirectionRef.current = null;\n isFirstPointerMoveRef.current = false;\n lastMovePosRef.current = null;\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = false;\n elementSizeRef.current = {\n width: 0,\n height: 0\n };\n swipeStartTimeRef.current = null;\n lastDragSampleRef.current = null;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n lastProgressDetailsRef.current = null;\n syncDragStyles(false);\n }, [setSwiping, swipeThresholdDefault, syncDragStyles, updateSwipeProgress]);\n function getPrimaryPointerPosition(event) {\n if ('touches' in event) {\n const touch = event.touches[0];\n return touch ? {\n x: touch.clientX,\n y: touch.clientY\n } : null;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n function isTouchLikeEvent(event) {\n if ('touches' in event) {\n return true;\n }\n return event.pointerType === 'touch';\n }\n function getTargetAtPoint(position, nativeEvent) {\n const root = elementRef.current?.getRootNode();\n const elementAtPoint = getElementAtPoint(root, position.x, position.y);\n const target = elementAtPoint ?? getTarget(nativeEvent);\n return target;\n }\n function findGestureScrollableTouchTarget(target, root) {\n if (hasHorizontal && !hasVertical) {\n return findScrollableTouchTarget(target, root, 'horizontal');\n }\n if (hasVertical && !hasHorizontal) {\n return findScrollableTouchTarget(target, root, 'vertical');\n }\n return findScrollableTouchTarget(target, root, 'vertical') ?? findScrollableTouchTarget(target, root, 'horizontal');\n }\n function startSwipeAtPosition(event, position, startOptions) {\n swipeFromScrollableRef.current = false;\n const touchLike = isTouchLikeEvent(event);\n const target = getTargetAtPoint(position, event.nativeEvent);\n const doc = ownerDocument(elementRef.current);\n const body = doc.body;\n const scrollableTarget = touchLike && body ? findGestureScrollableTouchTarget(target, body) : null;\n const ignoreScrollableTarget = startOptions?.ignoreScrollableTarget ?? false;\n if (scrollableTarget && !ignoreScrollableTarget) {\n return false;\n }\n swipeFromScrollableRef.current = Boolean(scrollableTarget && ignoreScrollableTarget);\n const isInteractiveElement = target ? target.closest(ignoreSelector) : false;\n if (isInteractiveElement && (!touchLike || ignoreSelectorWhenTouch)) {\n return false;\n }\n const element = elementRef.current;\n if (ignoreScrollableAncestors && element && target && scrollAxes.length > 0) {\n const ignoreAncestors = startOptions?.ignoreScrollableAncestors ?? false;\n if (!ignoreAncestors && hasScrollableAncestor(target, element, scrollAxes)) {\n return false;\n }\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = position;\n swipeStartTimeRef.current = getValidTimeStamp(event.timeStamp);\n swipeCancelBaselineRef.current = position;\n lastMovePosRef.current = position;\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = typeof swipeThresholdProp === 'function' ? swipeThresholdProp : null;\n if (element) {\n elementSizeRef.current = {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n resolveSwipeThreshold(primaryDirection);\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n dragOffsetRef.current = {\n x: transform.x,\n y: transform.y\n };\n recordDragSample({\n x: transform.x,\n y: transform.y\n }, swipeStartTimeRef.current);\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'setPointerCapture');\n }\n }\n onSwipeStart?.(event.nativeEvent);\n setSwiping(true);\n lockedDirectionRef.current = null;\n isFirstPointerMoveRef.current = true;\n updateSwipeProgress(0);\n syncDragStyles(true);\n return true;\n }\n function resetPendingSwipeState() {\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n lastMovePosRef.current = null;\n }\n function clearPendingSwipeStartState() {\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n }\n function cancelSwipeInteraction(event) {\n resetPendingSwipeState();\n if (!isSwipingRef.current) {\n return;\n }\n setSwiping(false);\n lockedDirectionRef.current = null;\n const resolvedInitialTransform = initialTransformRef.current;\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n sawPrimaryButtonsOnMoveRef.current = false;\n syncDragStyles(false);\n const element = elementRef.current;\n if (element) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n updateSwipeProgress(0, {\n deltaX: 0,\n deltaY: 0,\n direction: undefined\n });\n onCancel?.(event.nativeEvent);\n }\n function applyDirectionalDamping(deltaX, deltaY) {\n const exponent = value => Math.sign(value) * Math.abs(value) ** 0.5;\n const dampAxis = (delta, allowNegative, allowPositive) => {\n if (!allowNegative && delta < 0 || !allowPositive && delta > 0) {\n return exponent(delta);\n }\n return delta;\n };\n const newDeltaX = hasHorizontal ? dampAxis(deltaX, allowLeft, allowRight) : exponent(deltaX);\n const newDeltaY = hasVertical ? dampAxis(deltaY, allowUp, allowDown) : exponent(deltaY);\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY) {\n // Swiping toward the axis start edge (down/right) is allowed when scrolled to the start;\n // toward the end edge (up/left) when scrolled to the end.\n const canSwipeOnAxis = (delta, scrollOffset, maxScrollOffset, allowTowardStart, allowTowardEnd) => delta > 0 && scrollOffset <= 0 && allowTowardStart || delta < 0 && scrollOffset >= Math.max(0, maxScrollOffset) && allowTowardEnd;\n const absDeltaX = Math.abs(deltaX);\n const absDeltaY = Math.abs(deltaY);\n if (hasVertical && deltaY !== 0 && (!hasHorizontal || absDeltaY >= absDeltaX)) {\n return canSwipeOnAxis(deltaY, scrollTarget.scrollTop, scrollTarget.scrollHeight - scrollTarget.clientHeight, allowDown, allowUp);\n }\n if (hasHorizontal && deltaX !== 0 && (!hasVertical || absDeltaX > absDeltaY)) {\n return canSwipeOnAxis(deltaX, scrollTarget.scrollLeft, scrollTarget.scrollWidth - scrollTarget.clientWidth, allowRight, allowLeft);\n }\n return null;\n }\n const handleStart = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n if (event.defaultPrevented || event.nativeEvent.defaultPrevented) {\n return;\n }\n if (!('touches' in event) && event.button !== 0) {\n return;\n }\n const startPos = getPrimaryPointerPosition(event);\n if (!startPos) {\n return;\n }\n pendingSwipeRef.current = true;\n pendingSwipeStartPosRef.current = startPos;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = !('touches' in event);\n const allowedToStart = canStart ? canStart(startPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (!allowedToStart) {\n return;\n }\n if (startSwipeAtPosition(event, startPos)) {\n clearPendingSwipeStartState();\n }\n });\n function handleMoveCore(event, position, movement) {\n if (!enabled || !isSwipingRef.current) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n if (isTouchLikeEvent(event) && !swipeFromScrollableRef.current) {\n const boundaryElement = event.currentTarget;\n if (findGestureScrollableTouchTarget(target, boundaryElement)) {\n return;\n }\n }\n if (!('touches' in event)) {\n // Prevent text selection on Safari\n event.preventDefault();\n }\n if (isFirstPointerMoveRef.current) {\n isFirstPointerMoveRef.current = false;\n // Reset the drag origin to the first move's position to absorb the gap between the press and\n // the first move event — notably on iOS touch, where the first `touchmove` arrives already\n // offset from the `touchstart` — which would otherwise make the dragged element jump. This\n // only matters when an element follows the pointer; when `trackDrag` is false (e.g. the\n // swipe-area, which only opens the drawer) keep the original press position so a quick flick\n // still registers: on a low-refresh-rate display the whole travel can land in this single\n // first move, and discarding it would drop the gesture.\n if (trackDrag) {\n dragStartPosRef.current = position;\n const moveTime = getValidTimeStamp(event.timeStamp);\n if (moveTime !== null) {\n swipeStartTimeRef.current = moveTime;\n }\n }\n }\n const clientX = position.x;\n const clientY = position.y;\n const movementX = movement.x;\n const movementY = movement.y;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let lockedDirection = lockedDirectionRef.current;\n if (lockedDirection === null && hasHorizontal && hasVertical) {\n const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (movementDistance >= MIN_DRAG_THRESHOLD) {\n lockedDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'horizontal' : 'vertical';\n lockedDirectionRef.current = lockedDirection;\n }\n }\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (lockedDirection === 'vertical') {\n if (deltaY > 0) {\n candidate = 'down';\n } else if (deltaY < 0) {\n candidate = 'up';\n }\n } else if (lockedDirection === 'horizontal') {\n if (deltaX > 0) {\n candidate = 'right';\n } else if (deltaX < 0) {\n candidate = 'left';\n }\n } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate) {\n const isAllowed = candidate === 'left' && allowLeft || candidate === 'right' && allowRight || candidate === 'up' && allowUp || candidate === 'down' && allowDown;\n if (isAllowed) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n resolveSwipeThreshold(candidate);\n }\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > swipeThresholdRef.current) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(allowLeft && allowRight) && !(allowUp && allowDown) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (lockedDirection === 'horizontal') {\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n } else if (lockedDirection === 'vertical') {\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n } else {\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n }\n\n // Only rewrite drag styles when the drag offset actually changed. `syncDragStyles` writes the\n // raw (undamped) frozen transform and movement vars, relying on the consumer's `onProgress`\n // to overwrite them with damped styles — but `updateSwipeProgress` dedupes unchanged\n // deltas and skips `onProgress`. A move that doesn't change the offset (e.g. the cursor\n // pinned at a screen edge during an off-screen drag, jittering only on the ignored axis)\n // would otherwise reinstate the raw styles with no correction, jumping the element to the\n // undamped position.\n const previousOffset = dragOffsetRef.current;\n const offsetChanged = newOffsetX !== previousOffset.x || newOffsetY !== previousOffset.y;\n dragOffsetRef.current = {\n x: newOffsetX,\n y: newOffsetY\n };\n if (offsetChanged) {\n syncDragStyles(true);\n }\n recordDragSample({\n x: newOffsetX,\n y: newOffsetY\n }, getValidTimeStamp(event.timeStamp));\n const dragDeltaX = newOffsetX - initialTransformRef.current.x;\n const dragDeltaY = newOffsetY - initialTransformRef.current.y;\n const progressDetails = {\n deltaX: dragDeltaX,\n deltaY: dragDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n let progress = 0;\n const progressDirection = primaryDirection ?? intendedSwipeDirectionRef.current;\n if (progressDirection) {\n const size = progressDirection === 'left' || progressDirection === 'right' ? elementSizeRef.current.width : elementSizeRef.current.height;\n const scale = initialTransformRef.current.scale || 1;\n const progressDisplacement = getDisplacement(progressDirection, dragDeltaX, dragDeltaY);\n if (size > 0 && scale > 0 && progressDisplacement > 0) {\n progress = progressDisplacement / (size * scale);\n }\n }\n updateSwipeProgress(progress, progressDetails);\n }\n const handleEnd = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const resolvedInitialTransform = initialTransformRef.current;\n const releaseDeltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const releaseDeltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n const progressDetails = {\n deltaX: releaseDeltaX,\n deltaY: releaseDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n if (!isSwipingRef.current) {\n resetPendingSwipeState();\n updateSwipeProgress(0, progressDetails);\n return;\n }\n setSwiping(false);\n lockedDirectionRef.current = null;\n resetPendingSwipeState();\n sawPrimaryButtonsOnMoveRef.current = false;\n const element = elementRef.current;\n if (element) {\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n }\n const deltaX = releaseDeltaX;\n const deltaY = releaseDeltaY;\n const startTime = swipeStartTimeRef.current;\n const endTime = getValidTimeStamp(event.timeStamp);\n const durationMs = startTime !== null && endTime !== null && endTime > startTime ? endTime - startTime : 0;\n const velocityDurationMs = durationMs > 0 ? Math.max(durationMs, MIN_VELOCITY_DURATION_MS) : 0;\n const velocityX = velocityDurationMs > 0 ? deltaX / velocityDurationMs : 0;\n const velocityY = velocityDurationMs > 0 ? deltaY / velocityDurationMs : 0;\n let releaseVelocityX = lastDragVelocityRef.current.x;\n let releaseVelocityY = lastDragVelocityRef.current.y;\n const lastSample = lastDragSampleRef.current;\n if (lastSample && endTime !== null && endTime >= lastSample.time) {\n const ageMs = endTime - lastSample.time;\n if (ageMs <= MAX_RELEASE_VELOCITY_AGE_MS) {\n const sampleDurationMs = Math.max(ageMs, MIN_RELEASE_VELOCITY_DURATION_MS);\n const deltaFromLastSampleX = resolvedDragOffset.x - lastSample.x;\n const deltaFromLastSampleY = resolvedDragOffset.y - lastSample.y;\n const sampleVelocityX = deltaFromLastSampleX / sampleDurationMs;\n const sampleVelocityY = deltaFromLastSampleY / sampleDurationMs;\n if (sampleVelocityX !== 0) {\n releaseVelocityX = sampleVelocityX;\n }\n if (sampleVelocityY !== 0) {\n releaseVelocityY = sampleVelocityY;\n }\n } else {\n releaseVelocityX = 0;\n releaseVelocityY = 0;\n }\n }\n const releaseDecision = onRelease?.({\n event: event.nativeEvent,\n direction: intendedSwipeDirectionRef.current,\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n });\n const hasReleaseDecision = typeof releaseDecision === 'boolean';\n if (cancelledSwipeRef.current && !hasReleaseDecision) {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n return;\n }\n let shouldClose = false;\n let dismissDirection;\n if (hasReleaseDecision) {\n shouldClose = releaseDecision;\n dismissDirection = intendedSwipeDirectionRef.current ?? primaryDirection;\n } else {\n for (const direction of directions) {\n if (getDisplacement(direction, deltaX, deltaY) > swipeThresholdRef.current) {\n shouldClose = true;\n dismissDirection = direction;\n break;\n }\n }\n }\n if (shouldClose && dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n syncDragStyles(false);\n onDismiss?.(event.nativeEvent, {\n direction: dismissDirection\n });\n } else {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n }\n });\n const handleMove = useStableCallback(event => {\n const currentPos = getPrimaryPointerPosition(event);\n if (!currentPos) {\n return;\n }\n let endAfterMove = false;\n if (!('touches' in event)) {\n const hasPrimaryButton = hasPrimaryMouseButton(event.buttons);\n if (hasPrimaryButton) {\n sawPrimaryButtonsOnMoveRef.current = true;\n }\n\n // Cancel the swipe if a non-primary button takes over the interaction.\n // This handles cases where a right-click interrupts dragging.\n if (event.buttons !== 0 && !hasPrimaryButton) {\n cancelSwipeInteraction(event);\n return;\n }\n\n // A `buttons: 0` pointermove means the primary button was already released, so the gesture is\n // over even if no pointerup reached us. On fast trackpad flicks this trailing move is\n // dispatched just before pointerup; treat it as the release (mirroring touchend) instead of\n // cancelling and snapping the element back.\n if (event.buttons === 0 && sawPrimaryButtonsOnMoveRef.current) {\n if (!isSwipingRef.current) {\n // The gesture never activated — discard it.\n handleEnd(event);\n return;\n }\n // This release move can itself carry the threshold-crossing displacement (and the peak\n // release velocity), so let it flow through `handleMoveCore` below to update the drag\n // offset / velocity sample, then commit the release afterwards.\n endAfterMove = true;\n }\n }\n if (!isSwiping && pendingSwipeRef.current) {\n if (!isTouchLikeEvent(event) && (event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n resetPendingSwipeState();\n return;\n }\n const allowedToStart = canStart ? canStart(currentPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (allowedToStart) {\n const pendingStartPos = pendingSwipeStartPosRef.current;\n let ignoreScrollableOnStart = false;\n if (isTouchLikeEvent(event)) {\n const element = elementRef.current;\n if (pendingStartPos && element) {\n const target = getTargetAtPoint(currentPos, event.nativeEvent);\n const doc = ownerDocument(element);\n const body = doc.body;\n const scrollTarget = body ? findGestureScrollableTouchTarget(target, body) : null;\n if (scrollTarget && (contains(element, scrollTarget) || contains(scrollTarget, element))) {\n const deltaX = currentPos.x - pendingStartPos.x;\n const deltaY = currentPos.y - pendingStartPos.y;\n const canSwipeFromEdge = canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY);\n if (canSwipeFromEdge === false) {\n return;\n }\n if (canSwipeFromEdge === true) {\n ignoreScrollableOnStart = true;\n }\n }\n }\n }\n const started = startSwipeAtPosition(event, currentPos, {\n ignoreScrollableTarget: ignoreScrollableOnStart,\n ignoreScrollableAncestors: ignoreScrollableOnStart\n });\n if (started) {\n if (pendingStartPos && ignoreScrollableOnStart) {\n // Preserve displacement between touchstart and the move that activates swipe from\n // a scroll-edge so quick flicks can dismiss.\n clearPendingSwipeStartState();\n dragStartPosRef.current = pendingStartPos;\n swipeCancelBaselineRef.current = pendingStartPos;\n lastMovePosRef.current = pendingStartPos;\n isFirstPointerMoveRef.current = false;\n } else {\n // Start from the current in-bounds position without dropping follow-up move\n // displacement; this avoids jumps when entering from outside the element while\n // keeping swipe tracking responsive on the next move.\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n }\n }\n }\n }\n const previousPos = lastMovePosRef.current;\n const movement = previousPos === null ? {\n x: 0,\n y: 0\n } : {\n x: currentPos.x - previousPos.x,\n y: currentPos.y - previousPos.y\n };\n lastMovePosRef.current = currentPos;\n handleMoveCore(event, currentPos, movement);\n\n // `endAfterMove` is only set in the non-touch branch above; the `'touches'` guard re-narrows the\n // event type for `handleEnd` after the shared move handling has run.\n if (endAfterMove && !('touches' in event)) {\n handleEnd(event);\n }\n });\n\n // Feeds a native touchmove into the swipe pipeline. Used by consumers that claim the gesture\n // in a capture-phase listener and stop it from reaching React's delegated touch handlers.\n const moveNative = useStableCallback((nativeEvent, currentTarget) => {\n handleMove({\n touches: nativeEvent.touches,\n currentTarget,\n nativeEvent,\n defaultPrevented: nativeEvent.defaultPrevented,\n timeStamp: nativeEvent.timeStamp\n });\n });\n const getDragStyles = React.useCallback(() => {\n // Read `isSwipingRef`, not the lagging `isSwiping` state, to match the imperative writer\n // `syncDragStyles`. Otherwise a render that commits before `setSwiping(true)` flushes strips the\n // transform it just wrote, flashing the popup to its resting position for a frame.\n const swiping = isSwipingRef.current;\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (!swiping && deltaX === 0 && deltaY === 0 && !dragDismissed) {\n return {\n [movementCssVars.x]: '0px',\n [movementCssVars.y]: '0px'\n };\n }\n return {\n transition: swiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: swiping ? getDragTransform(dragOffset, initialTransform.scale) : undefined,\n [movementCssVars.x]: `${deltaX}px`,\n [movementCssVars.y]: `${deltaY}px`\n };\n }, [dragDismissed, movementCssVars]);\n const getPointerProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onPointerDown: handleStart,\n onPointerMove: handleMove,\n onPointerUp: handleEnd,\n onPointerCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n const getTouchProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onTouchStart: handleStart,\n onTouchMove: handleMove,\n onTouchEnd: handleEnd,\n onTouchCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n return {\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n dragDismissed,\n getPointerProps,\n getTouchProps,\n moveNative,\n getDragStyles,\n reset\n };\n}","import { getComputedStyle, getParentNode, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function isScrollableY(element, allowOverflowIntent = false) {\n const {\n overflowY\n } = getComputedStyle(element);\n if (overflowY !== 'auto' && overflowY !== 'scroll') {\n return false;\n }\n // When `allowOverflowIntent` is true, a container that overflows only once extra space is\n // added (e.g. drawer keyboard scroll slack) still counts, as long as it has layout size on\n // the axis.\n return allowOverflowIntent ? element.clientHeight > 0 : element.scrollHeight > element.clientHeight;\n}\nexport function isScrollableX(element, allowOverflowIntent = false) {\n const {\n overflowX\n } = getComputedStyle(element);\n if (overflowX !== 'auto' && overflowX !== 'scroll') {\n return false;\n }\n return allowOverflowIntent ? element.clientWidth > 0 : element.scrollWidth > element.clientWidth;\n}\nexport function isScrollable(element, axis, allowOverflowIntent = false) {\n return axis === 'vertical' ? isScrollableY(element, allowOverflowIntent) : isScrollableX(element, allowOverflowIntent);\n}\nexport function hasScrollableAncestor(target, root, axes) {\n // `getParentNode` crosses shadow boundaries (and slots), so a target inside a shadow root\n // still walks up to scrollable ancestors in the light DOM.\n let node = target;\n while (isHTMLElement(node) && node !== root && !isLastTraversableNode(node)) {\n for (const axis of axes) {\n if (isScrollable(node, axis)) {\n return true;\n }\n }\n node = getParentNode(node);\n }\n return false;\n}\nexport function findScrollableTouchTarget(target, root, axis = 'vertical', allowOverflowIntent = false) {\n // `getParentNode` crosses shadow boundaries (and slots), so a target inside a shadow root\n // still reaches a scrollable ancestor in the light DOM.\n let node = isHTMLElement(target) ? target : null;\n while (isHTMLElement(node) && node !== root && !isLastTraversableNode(node)) {\n if (isScrollable(node, axis, allowOverflowIntent)) {\n return node;\n }\n node = getParentNode(node);\n }\n return isScrollable(root, axis, allowOverflowIntent) ? root : null;\n}","// `Document.elementFromPoint` retargets shadow content to the shadow host, which then fails\n// `contains()` checks against a popup inside that shadow root, so callers pass `getRootNode()`\n// (a document or a shadow root) rather than `ownerDocument()`.\nexport function getElementAtPoint(root, x, y) {\n return typeof root?.elementFromPoint === 'function' ? root.elementFromPoint(x, y) : null;\n}","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\nexport let DrawerSwipeAreaDataAttributes = function (DrawerSwipeAreaDataAttributes) {\n /**\n * Present when the drawer is open.\n */\n DrawerSwipeAreaDataAttributes[DrawerSwipeAreaDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the drawer is closed.\n */\n DrawerSwipeAreaDataAttributes[DrawerSwipeAreaDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the swipe area is disabled.\n */\n DrawerSwipeAreaDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Indicates the swipe direction.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\n DrawerSwipeAreaDataAttributes[\"swipeDirection\"] = \"data-swipe-direction\";\n /**\n * Present when the drawer is being swiped.\n */\n DrawerSwipeAreaDataAttributes[\"swiping\"] = \"data-swiping\";\n return DrawerSwipeAreaDataAttributes;\n}({});","'use client';\n\nimport { DialogTitle } from \"../../dialog/title/DialogTitle.mjs\";\n/**\n * A heading that labels the drawer.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTitle = DialogTitle;","'use client';\n\nimport { DialogTrigger } from \"../../dialog/trigger/DialogTrigger.mjs\";\n/**\n * A button that opens the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTrigger = DialogTrigger;","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { DialogViewport } from \"../../dialog/viewport/DialogViewport.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { closestSnapPointIndex, getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { clamp } from \"../../internals/clamp.mjs\";\nimport { getDisplacement, useSwipeDismiss } from \"../../utils/useSwipeDismiss.mjs\";\nimport { DrawerPopupCssVars } from \"../popup/DrawerPopupCssVars.mjs\";\nimport { DrawerPopupDataAttributes } from \"../popup/DrawerPopupDataAttributes.mjs\";\nimport { DrawerBackdropCssVars } from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"../content/DrawerContentDataAttributes.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { DrawerViewportContext } from \"./DrawerViewportContext.mjs\";\nimport { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\nimport { findScrollableTouchTarget } from \"../../utils/scrollable.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getElementAtPoint } from \"../../utils/getElementAtPoint.mjs\";\nimport { useDrawerVirtualKeyboardContext } from \"../virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MIN_SWIPE_THRESHOLD = 10;\nconst FAST_SWIPE_VELOCITY = 0.5;\nconst SNAP_VELOCITY_THRESHOLD = 0.5;\nconst SNAP_VELOCITY_MULTIPLIER = 300;\nconst MAX_SNAP_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_VELOCITY = 0.2;\nconst MAX_SWIPE_RELEASE_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_DURATION_MS = 80;\nconst MAX_SWIPE_RELEASE_DURATION_MS = 360;\nconst MIN_SWIPE_RELEASE_SCALAR = 0.1;\nconst MAX_SWIPE_RELEASE_SCALAR = 1;\nconst AXIS_LOCK_SLOP = 6;\nconst AXIS_LOCK_BIAS = 2;\nconst DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;\n/**\n * A positioning container for the drawer popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerViewport = /*#__PURE__*/React.forwardRef(function DrawerViewport(props, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = props;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const backdropRef = store.context.backdropRef;\n const {\n swipeDirection,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n frontmostHeight,\n snapToSequentialPoints,\n swipeAreaActiveRef\n } = useDrawerRootContext();\n const providerContext = useDrawerProviderContext();\n const {\n snapPoints,\n resolvedSnapPoints,\n activeSnapPoint,\n activeSnapPointOffset,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerSnapPoints();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const viewportElement = store.useState('viewportElement');\n const popupElementState = store.useState('popupElement');\n const visualStateStore = providerContext?.visualStateStore;\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const scrollAxis = swipeDirection === 'left' || swipeDirection === 'right' ? 'horizontal' : 'vertical';\n const isVerticalScrollAxis = scrollAxis === 'vertical';\n const crossScrollAxis = isVerticalScrollAxis ? 'horizontal' : 'vertical';\n const [swipeRelease, setSwipeRelease] = React.useState(null);\n const pendingSwipeCloseSnapPointRef = React.useRef(undefined);\n const resetSwipeRef = React.useRef(null);\n const controlledDismissFrame = useAnimationFrame();\n const swipingRef = React.useRef(false);\n const nestedSwipeActiveRef = React.useRef(false);\n const lastPointerTypeRef = React.useRef('');\n const ignoreNextTouchStartFromPenRef = React.useRef(false);\n const ignoreTouchSwipeRef = React.useRef(false);\n const touchScrollStateRef = React.useRef(null);\n const virtualKeyboard = useDrawerVirtualKeyboardContext();\n const snapPointRange = React.useMemo(() => {\n if (!snapPoints || snapPoints.length < 2 || resolvedSnapPoints.length < 2 || swipeDirection !== 'down' && swipeDirection !== 'up') {\n return null;\n }\n const offsets = resolvedSnapPoints.map(point => point.offset).sort((a, b) => a - b);\n const minOffset = offsets[0];\n const nextOffset = offsets[1];\n const range = nextOffset - minOffset;\n return {\n minOffset,\n range\n };\n }, [resolvedSnapPoints, snapPoints, swipeDirection]);\n const snapPointProgress = React.useMemo(() => {\n if (!snapPointRange || activeSnapPointOffset === null) {\n return null;\n }\n return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n }, [activeSnapPointOffset, snapPointRange]);\n const swipeDirections = React.useMemo(() => {\n if (snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up')) {\n return swipeDirection === 'down' ? ['down', 'up'] : ['up', 'down'];\n }\n return [swipeDirection];\n }, [snapPoints, swipeDirection]);\n const setSwipeDismissed = useStableCallback(dismissed => {\n popupRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n backdropRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n });\n const clearSwipeRelease = useStableCallback(() => {\n setSwipeDismissed(false);\n popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);\n setSwipeRelease(null);\n });\n const finishNestedSwipe = useStableCallback(() => {\n if (!nestedSwipeActiveRef.current) {\n return;\n }\n nestedSwipeActiveRef.current = false;\n notifyParentSwipingChange?.(false);\n });\n const applySwipeProgress = useStableCallback((resolvedProgress, shouldTrackProgress, notifyParent) => {\n const isActive = open && !nested && shouldTrackProgress;\n const swipeProgress = isActive ? resolvedProgress : 0;\n const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;\n if (notifyParent && notifyParentSwipeProgressChange) {\n notifyParentSwipeProgressChange(nestedSwipeProgress);\n if (nestedSwipeProgress <= 0) {\n finishNestedSwipe();\n }\n }\n visualStateStore?.set({\n swipeProgress,\n frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0\n });\n const backdropElement = backdropRef.current;\n if (!backdropElement) {\n return;\n }\n const showProgress = isActive && swipeProgress > 0;\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, showProgress ? `${swipeProgress}` : '0');\n if (showProgress && frontmostHeight > 0) {\n backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n } else {\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n });\n function resolveSwipeRelease(popupElement, direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY) {\n const size = getBaseSwipeSize(popupElement, direction);\n if (size <= 0) {\n return null;\n }\n\n // The snap point base offset shifts the popup along the dismiss direction for both\n // `down` (+offset) and `up` (-offset), so it always adds to the directional translation.\n const snapPointBaseOffset = (direction === 'down' || direction === 'up') && snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;\n const translationAlongDirection = snapPointBaseOffset + getDisplacement(direction, deltaX, deltaY);\n const remainingDistance = Math.max(0, size - translationAlongDirection);\n if (remainingDistance <= 0) {\n return null;\n }\n const releaseVelocity = getDisplacement(direction, releaseVelocityX, releaseVelocityY);\n const directionalVelocity = Math.abs(releaseVelocity) > 0 ? releaseVelocity : getDisplacement(direction, velocityX, velocityY);\n if (directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {\n return null;\n }\n const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);\n // The gesture hook supplies finite deltas and velocities. The guards above keep the remaining\n // distance and divisor positive, so the duration stays within [MIN, MAX] and the resulting\n // scalar within (0, 1].\n const durationMs = clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);\n const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);\n return MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR);\n }\n function updateNestedSwipeActive(details) {\n if (nestedSwipeActiveRef.current || !details) {\n return;\n }\n const direction = details.direction ?? swipeDirection;\n const delta = getDisplacement(direction, details.deltaX, details.deltaY);\n if (Math.abs(delta) < MIN_SWIPE_THRESHOLD) {\n return;\n }\n nestedSwipeActiveRef.current = true;\n notifyParentSwipingChange?.(true);\n }\n const swipe = useSwipeDismiss({\n enabled: mounted && !nestedDrawerOpen,\n directions: swipeDirections,\n elementRef: store.context.popupRef,\n ignoreSelectorWhenTouch: false,\n ignoreScrollableAncestors: true,\n movementCssVars: {\n x: DrawerPopupCssVars.swipeMovementX,\n y: DrawerPopupCssVars.swipeMovementY\n },\n onSwipeStart(event) {\n if ('touches' in event || event.pointerType === 'touch') {\n return;\n }\n const popupElement = popupRef.current;\n const doc = ownerDocument(popupElement);\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) {\n return;\n }\n selection.removeAllRanges();\n },\n onSwipingChange(swiping) {\n swipingRef.current = swiping;\n setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);\n if (!swiping && !notifyParentSwipeProgressChange) {\n finishNestedSwipe();\n }\n },\n swipeThreshold({\n element,\n direction\n }) {\n return getBaseSwipeThreshold(element, direction);\n },\n canStart(position, details) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n return false;\n }\n const doc = popupElement.ownerDocument;\n const elementAtPoint = getElementAtPoint(popupElement.getRootNode(), position.x, position.y);\n if (!elementAtPoint || !contains(popupElement, elementAtPoint)) {\n return false;\n }\n const nativeEvent = details.nativeEvent;\n const touchLike = 'touches' in nativeEvent || nativeEvent.pointerType === 'touch';\n if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) {\n return false;\n }\n return true;\n },\n onProgress(progress, details) {\n updateNestedSwipeActive(details);\n const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);\n if (swipingRef.current && swipeDirection === 'down' && hasSnapPoints && details) {\n const popupElement = store.context.popupRef.current;\n if (popupElement) {\n popupElement.style.removeProperty('transform');\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);\n }\n }\n let resolvedProgress = progress;\n if (snapPointRange && popupHeight > 0) {\n const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;\n const offsetToProgress = nextOffset => clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n if (details && Number.isFinite(details.deltaY)) {\n resolvedProgress = offsetToProgress(clamp(baseOffset + details.deltaY, 0, popupHeight));\n } else if (snapPointProgress !== null) {\n resolvedProgress = snapPointProgress;\n }\n }\n applySwipeProgress(resolvedProgress, true, true);\n },\n onRelease({\n event,\n deltaX,\n deltaY,\n direction,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n }) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n clearSwipeRelease();\n return undefined;\n }\n const releasePopupElement = popupElement;\n function startSwipeRelease(resolvedDirection) {\n // Start ending transition styles earlier and synchronously to prevent a period where\n // the popup appears stuck on release before the actual closing animation starts.\n finishNestedSwipe();\n setSwipeDismissed(true);\n releasePopupElement.style.removeProperty('transition');\n releasePopupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, '');\n ReactDOM.flushSync(() => {\n setSwipeRelease(resolveSwipeRelease(releasePopupElement, resolvedDirection, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY));\n });\n }\n if (!snapPoints || snapPoints.length === 0) {\n if (!direction) {\n clearSwipeRelease();\n return undefined;\n }\n const directionalDelta = getDisplacement(direction, deltaX, deltaY);\n if (directionalDelta <= 0) {\n clearSwipeRelease();\n return false;\n }\n if (getDisplacement(direction, velocityX, velocityY) >= FAST_SWIPE_VELOCITY) {\n startSwipeRelease(direction);\n return true;\n }\n const shouldClose = directionalDelta > getBaseSwipeThreshold(releasePopupElement, direction);\n if (shouldClose) {\n startSwipeRelease(direction);\n } else {\n clearSwipeRelease();\n }\n return shouldClose;\n }\n if (swipeDirection !== 'down' && swipeDirection !== 'up') {\n clearSwipeRelease();\n return undefined;\n }\n if (!popupHeight) {\n clearSwipeRelease();\n return false;\n }\n if (resolvedSnapPoints.length === 0) {\n clearSwipeRelease();\n return undefined;\n }\n const dragDelta = swipeDirection === 'down' ? deltaY : -deltaY;\n const dragDirection = Math.sign(dragDelta);\n const releaseDirectionalVelocity = swipeDirection === 'down' ? releaseVelocityY : -releaseVelocityY;\n const fallbackDirectionalVelocity = swipeDirection === 'down' ? velocityY : -velocityY;\n let resolvedDirectionalVelocity = releaseDirectionalVelocity;\n if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD) {\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n if (velocityDirection !== 0 && velocityDirection !== dragDirection) {\n // Ignore touch reversals that would otherwise flip the snap decision.\n resolvedDirectionalVelocity = fallbackDirectionalVelocity;\n }\n }\n const currentOffset = activeSnapPointOffset ?? 0;\n const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);\n const velocityOffset = Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -MAX_SNAP_VELOCITY, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;\n const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);\n const snapPointEventDetails = createChangeEventDetails(REASONS.swipe, event);\n const closeFromSnapPoints = () => {\n pendingSwipeCloseSnapPointRef.current = activeSnapPoint;\n setActiveSnapPoint(null, snapPointEventDetails);\n startSwipeRelease(swipeDirection);\n return true;\n };\n if (snapToSequentialPoints) {\n const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);\n const orderedOffsets = orderedSnapPoints.map(point => point.offset);\n const currentIndex = closestSnapPointIndex(orderedOffsets, currentOffset);\n let targetSnapPoint = orderedSnapPoints[closestSnapPointIndex(orderedOffsets, targetOffset)];\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;\n let effectiveTargetOffset = targetOffset;\n if (shouldAdvance) {\n const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);\n if (adjacentIndex !== currentIndex) {\n const adjacentPoint = orderedSnapPoints[adjacentIndex];\n const shouldForceAdjacent = dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset;\n if (shouldForceAdjacent) {\n targetSnapPoint = adjacentPoint;\n effectiveTargetOffset = adjacentPoint.offset;\n }\n } else if (dragDirection > 0) {\n return closeFromSnapPoints();\n }\n }\n const closeDistance = Math.abs(effectiveTargetOffset - popupHeight);\n const snapDistance = Math.abs(effectiveTargetOffset - targetSnapPoint.offset);\n if (closeDistance < snapDistance) {\n return closeFromSnapPoints();\n }\n setActiveSnapPoint(targetSnapPoint.value, snapPointEventDetails);\n clearSwipeRelease();\n return false;\n }\n if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) {\n return closeFromSnapPoints();\n }\n const closestSnapPoint = resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.offset), targetOffset)];\n const closeDistance = Math.abs(targetOffset - popupHeight);\n if (closeDistance < Math.abs(targetOffset - closestSnapPoint.offset)) {\n return closeFromSnapPoints();\n }\n setActiveSnapPoint(closestSnapPoint.value, snapPointEventDetails);\n clearSwipeRelease();\n return false;\n },\n onDismiss(event) {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n const backdropElement = store.context.backdropRef.current;\n if (backdropElement) {\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n const dismissEventDetails = createChangeEventDetails(REASONS.swipe, event);\n store.setOpen(false, dismissEventDetails);\n if (dismissEventDetails.isCanceled) {\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, event));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n resetSwipeRef.current?.();\n clearSwipeRelease();\n return;\n }\n\n // In controlled mode, the effective open state may not have changed yet\n // (openProp takes precedence over state.open). Proceed optimistically with the\n // dismiss animation — React's Scheduler flushes before the next rAF, so we can\n // reliably check whether the parent accepted or rejected the close.\n // Note: if onOpenChange is asynchronous (e.g., closes the drawer after a network\n // call), the rAF check will see open === true, revert the animation, and the\n // drawer will close without animation when the parent eventually sets open={false}.\n if (store.select('open')) {\n const savedEvent = event;\n controlledDismissFrame.request(() => {\n if (store.select('open')) {\n // Parent rejected: revert animation and restore snap point.\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, savedEvent));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n clearSwipeRelease();\n resetSwipeRef.current?.();\n } else {\n // Parent accepted: clean up the ref.\n pendingSwipeCloseSnapPointRef.current = undefined;\n }\n });\n return;\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n setSwipeDismissed(true);\n }\n });\n const swipePointerProps = swipe.getPointerProps();\n const swipeTouchProps = swipe.getTouchProps();\n const {\n moveNative: moveSwipeNative,\n reset: resetSwipe\n } = swipe;\n resetSwipeRef.current = resetSwipe;\n React.useEffect(() => {\n const rootElement = viewportElement ?? popupElementState;\n if (!rootElement) {\n return undefined;\n }\n const resolvedRootElement = rootElement;\n const doc = ownerDocument(resolvedRootElement);\n function processTouchMove(event, touchState, touch) {\n const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;\n\n // Avoid blocking pinch zoom or text selection adjustments on iOS Safari.\n if (event.touches.length === 2) {\n return;\n }\n const allowTouchMove = shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement);\n if (allowTouchMove || !open || !mounted || nestedDrawerOpen) {\n return;\n }\n if (shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis)) {\n return;\n }\n const scrollTarget = touchState.scrollTarget;\n if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {\n if (event.cancelable) {\n event.preventDefault();\n }\n // Claim the gesture before React's delegated touch handlers see it; dispatching the\n // move through React re-rasterizes the popup content on every frame.\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n return;\n }\n if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {\n // If the scroll container doesn't overflow on the drawer axis, prevent the window from\n // scrolling instead.\n if (event.cancelable) {\n event.preventDefault();\n }\n event.stopPropagation();\n return;\n }\n if (drawerAxisDelta !== 0) {\n const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, drawerAxisDelta);\n if (!touchState.allowSwipe) {\n if (event.cancelable && canSwipeFromScrollEdge) {\n touchState.allowSwipe = true;\n event.preventDefault();\n } else {\n touchState.allowSwipe = false;\n }\n } else if (event.cancelable) {\n event.preventDefault();\n }\n }\n if (touchState.allowSwipe === true) {\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n }\n }\n function handleNativeTouchMove(event) {\n // The virtual keyboard provider observes the move to tell a tap apart from a drag.\n // It must run even when the swipe gesture below claims the event with\n // `stopPropagation()`, which would otherwise prevent React's delegated handlers\n // (and the provider) from ever seeing the move.\n virtualKeyboard?.onTouchMove(event);\n if (ignoreTouchSwipeRef.current) {\n return;\n }\n const touchState = touchScrollStateRef.current;\n const touch = event.touches[0];\n if (!touch || !touchState) {\n return;\n }\n processTouchMove(event, touchState, touch);\n updateTouchScrollPosition(touchState, touch);\n }\n return addEventListener(doc, 'touchmove', handleNativeTouchMove, {\n passive: false,\n capture: true\n });\n }, [mounted, nestedDrawerOpen, open, popupElementState, isVerticalScrollAxis, scrollAxis, swipeDirection, moveSwipeNative, viewportElement, virtualKeyboard]);\n useIsoLayoutEffect(() => {\n if (!snapPointRange || swipe.swiping) {\n return;\n }\n applySwipeProgress(!open || nested ? 0 : snapPointProgress ?? 0, true, false);\n }, [applySwipeProgress, frontmostHeight, nested, notifyParentSwipeProgressChange, open, snapPointProgress, snapPointRange, swipe.swiping, store, visualStateStore]);\n useIsoLayoutEffect(() => {\n if (!notifyParentSwipeProgressChange) {\n return undefined;\n }\n if (!open) {\n notifyParentSwipeProgressChange(0);\n }\n return () => {\n notifyParentSwipeProgressChange(0);\n };\n }, [notifyParentSwipeProgressChange, open]);\n useIsoLayoutEffect(() => {\n if (open) {\n // Skip `resetSwipe` while `Drawer.SwipeArea` is driving the open: it zeroes the popup's\n // `--swipe-movement-*` (via `syncDragStyles(false)`), flashing it fully open for a frame.\n // `clearSwipeRelease` doesn't touch those vars, so always run it to clear any leftover\n // release state from a prior dismiss (e.g. when the popup is kept mounted).\n if (!swipeAreaActiveRef.current) {\n resetSwipe();\n }\n clearSwipeRelease();\n }\n }, [clearSwipeRelease, open, resetSwipe, swipeAreaActiveRef]);\n useIsoLayoutEffect(() => {\n const backdropElement = backdropRef.current;\n return () => {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n setBackdropSwipingAttribute(backdropElement, false);\n // `data-swiping` is set on whichever backdrop is current when a swipe starts, which can\n // differ from the captured element if the backdrop mounted late or changed identity.\n // Reading the live ref here is intentional so the current backdrop is cleared too.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const currentBackdrop = backdropRef.current;\n if (currentBackdrop !== backdropElement) {\n setBackdropSwipingAttribute(currentBackdrop, false);\n }\n finishNestedSwipe();\n };\n }, [backdropRef, finishNestedSwipe, visualStateStore]);\n const swipeProviderValue = React.useMemo(() => ({\n swiping: swipe.swiping,\n getDragStyles: swipe.getDragStyles,\n swipeStrength: swipeRelease ?? null,\n setSwipeDismissed\n }), [setSwipeDismissed, swipe.getDragStyles, swipe.swiping, swipeRelease]);\n function resetTouchSwipeState(ignoreSwipe) {\n ignoreTouchSwipeRef.current = ignoreSwipe;\n touchScrollStateRef.current = null;\n }\n function resetTouchTrackingState() {\n resetTouchSwipeState(false);\n lastPointerTypeRef.current = '';\n ignoreNextTouchStartFromPenRef.current = false;\n }\n function handlePointerEnd(event) {\n lastPointerTypeRef.current = '';\n return event.pointerType !== 'touch';\n }\n return /*#__PURE__*/_jsx(DialogViewport, {\n ref: forwardedRef,\n className: className,\n style: style,\n render: render,\n ...mergeProps(elementProps, {\n onPointerDown(event) {\n lastPointerTypeRef.current = event.pointerType;\n ignoreNextTouchStartFromPenRef.current = event.pointerType === 'pen';\n if (!open || !mounted || nestedDrawerOpen) {\n return;\n }\n const elementAtPoint = getElementAtPoint(event.currentTarget.getRootNode(), event.clientX, event.clientY);\n if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) {\n return;\n }\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerDown?.(event);\n },\n onPointerMove(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerMove?.(event);\n },\n onPointerUp(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerUp?.(event);\n }\n },\n onPointerCancel(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerCancel?.(event);\n }\n },\n onTouchStart(event) {\n const startedFromPenPointerDown = lastPointerTypeRef.current === 'pen' && ignoreNextTouchStartFromPenRef.current;\n if (startedFromPenPointerDown) {\n ignoreNextTouchStartFromPenRef.current = false;\n resetTouchSwipeState(false);\n return;\n }\n if (!open || !mounted || nestedDrawerOpen) {\n resetTouchSwipeState(false);\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n if (isReactTouchEventOnRangeInput(event)) {\n resetTouchSwipeState(false);\n return;\n }\n const rootElement = event.currentTarget;\n const elementAtPoint = getElementAtPoint(rootElement.getRootNode(), touch.clientX, touch.clientY);\n const eventTarget = getTarget(event.nativeEvent);\n const target = isElement(eventTarget) ? eventTarget : rootElement;\n if (!contains(rootElement, target)) {\n resetTouchSwipeState(true);\n return;\n }\n virtualKeyboard?.onTouchStart(event);\n if (isSwipeIgnoredTarget(elementAtPoint)) {\n resetTouchSwipeState(true);\n return;\n }\n ignoreTouchSwipeRef.current = false;\n const scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);\n const hasCrossAxisScrollableContent = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null;\n let allowSwipe = null;\n if (scrollTarget) {\n const canSwipeFromEdge = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection);\n allowSwipe = canSwipeFromEdge ? null : false;\n }\n touchScrollStateRef.current = {\n startX: touch.clientX,\n startY: touch.clientY,\n lastX: touch.clientX,\n lastY: touch.clientY,\n scrollTarget,\n hasCrossAxisScrollableContent,\n allowSwipe,\n preserveNativeCrossAxisScroll: false,\n drawerAxisAttributed: false\n };\n swipeTouchProps.onTouchStart?.(event);\n },\n onTouchEnd(event) {\n virtualKeyboard?.onTouchEnd(event);\n resetTouchTrackingState();\n swipeTouchProps.onTouchEnd?.(event);\n },\n onTouchCancel(event) {\n virtualKeyboard?.onTouchCancel();\n resetTouchTrackingState();\n swipeTouchProps.onTouchCancel?.(event);\n },\n // Drawer popups use drawer-specific nested state attributes.\n // Suppress DialogViewport's generic nested dialog attribute.\n ['data-nested-dialog-open']: undefined\n }),\n children: /*#__PURE__*/_jsx(DrawerViewportContext.Provider, {\n value: swipeProviderValue,\n children: children\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerViewport.displayName = \"DrawerViewport\";\nfunction setBackdropSwipingAttribute(backdropElement, swiping) {\n backdropElement?.toggleAttribute(DrawerPopupDataAttributes.swiping, swiping);\n}\nfunction isSwipeIgnoredTarget(target) {\n return Boolean(target?.closest(BASE_UI_SWIPE_IGNORE_SELECTOR));\n}\nfunction isDrawerContentTarget(target) {\n return Boolean(target?.closest(DRAWER_CONTENT_SELECTOR));\n}\nfunction getBaseSwipeSize(element, direction) {\n return direction === 'left' || direction === 'right' ? element.offsetWidth : element.offsetHeight;\n}\nfunction getBaseSwipeThreshold(element, direction) {\n return Math.max(getBaseSwipeSize(element, direction) * 0.5, MIN_SWIPE_THRESHOLD);\n}\nfunction isRangeInput(target, win) {\n return target instanceof win.HTMLInputElement && target.type === 'range';\n}\nfunction isTextSelectionControl(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';\n}\nfunction hasExpandedSelectionWithinTarget(selection, target) {\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);\n}\nfunction shouldIgnoreSwipeForTextSelection(doc, rootElement) {\n const activeEl = activeElement(doc);\n if (activeEl && contains(rootElement, activeEl) && isTextSelectionControl(activeEl)) {\n const {\n selectionStart,\n selectionEnd\n } = activeEl;\n if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) {\n return true;\n }\n }\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n return hasExpandedSelectionWithinTarget(selection, rootElement);\n}\nfunction isEventOnRangeInput(event, win) {\n return event.composedPath().some(pathTarget => isRangeInput(pathTarget, win));\n}\nfunction isReactTouchEventOnRangeInput(event) {\n return isEventOnRangeInput(event.nativeEvent, ownerWindow(event.currentTarget));\n}\nfunction updateTouchScrollPosition(touchState, touch) {\n touchState.lastX = touch.clientX;\n touchState.lastY = touch.clientY;\n}\n\n/**\n * Arbitrates a touchmove between the drawer swipe and a native cross-axis scroll.\n * Returns `true` when the move must be left alone — either because the cross axis already won the\n * gesture, or because neither axis has passed the slop yet and the gesture cannot be attributed.\n */\nfunction shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis) {\n if (touchState.preserveNativeCrossAxisScroll) {\n return true;\n }\n\n // Attribution happens once per gesture. Re-arbitrating after the drawer axis has won would let\n // the pre-attribution branches below fire mid-drag (the slop is measured from the touch origin,\n // which is never re-baselined), freezing the popup and dropping `preventDefault()`.\n if (touchState.drawerAxisAttributed || touchState.allowSwipe === true || !touchState.hasCrossAxisScrollableContent) {\n return false;\n }\n\n // A non-cancelable touchmove means the browser has already committed the gesture to a native\n // scroll; claiming it for the swipe would drag the popup alongside the scrolling content.\n if (!event.cancelable) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;\n const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;\n const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);\n const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);\n if (absCrossAxisGestureDelta >= AXIS_LOCK_SLOP && absCrossAxisGestureDelta > absDrawerAxisGestureDelta + AXIS_LOCK_BIAS) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n if (absDrawerAxisGestureDelta >= AXIS_LOCK_SLOP) {\n touchState.drawerAxisAttributed = true;\n return false;\n }\n\n // Neither axis has traveled past the slop yet, so the gesture cannot be attributed. Leave the\n // event alone: on iOS, `preventDefault()` on the first cancelable touchmove cancels native\n // scrolling for the entire gesture, which would lock a cross-axis scroll that only passes the\n // slop on a later move.\n return true;\n}\nfunction hasScrollableContentOnAxis(scrollTarget, axis) {\n return getScrollMetrics(scrollTarget, axis).max > 0;\n}\nfunction getScrollMetrics(scrollTarget, axis) {\n if (axis === 'vertical') {\n const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);\n return {\n offset: scrollTarget.scrollTop,\n max\n };\n }\n const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);\n return {\n offset: scrollTarget.scrollLeft,\n max\n };\n}\nfunction isAtSwipeStartEdge(scrollTarget, axis, direction) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const {\n offset,\n max\n } = getScrollMetrics(scrollTarget, axis);\n return dismissFromStartEdge ? offset <= 0 : offset >= max;\n}\nfunction canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const movingTowardDismiss = dismissFromStartEdge ? delta > 0 : delta < 0;\n if (!movingTowardDismiss) {\n return false;\n }\n return isAtSwipeStartEdge(scrollTarget, axis, direction);\n}\nfunction shouldDismissFromStartEdge(direction, axis) {\n return axis === 'vertical' ? direction === 'down' : direction === 'right';\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerVirtualKeyboardContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerVirtualKeyboardContext.displayName = \"DrawerVirtualKeyboardContext\";\nexport function useDrawerVirtualKeyboardContext() {\n return React.useContext(DrawerVirtualKeyboardContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { getComputedStyle, getParentNode, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { clamp } from \"../../internals/clamp.mjs\";\nimport { activeElement, contains, getTarget, isInteractiveElement } from \"../../floating-ui-react/utils.mjs\";\nimport { findScrollableTouchTarget } from \"../../utils/scrollable.mjs\";\nimport { getElementAtPoint } from \"../../utils/getElementAtPoint.mjs\";\nimport { DrawerViewportCssVars } from \"../viewport/DrawerViewportCssVars.mjs\";\nimport { DrawerVirtualKeyboardContext } from \"./DrawerVirtualKeyboardContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst KEYBOARD_RESIZE_THRESHOLD = 60;\nconst KEYBOARD_VISIBILITY_MARGIN = 16;\n// Extra breathing room (px) added below the focused field, on top of its measured\n// keyboard overlap, so the field can be scrolled clear of the keyboard instead of\n// ending up flush against it. Only applied when there is actual overlap.\nconst KEYBOARD_SCROLL_SLACK = 48;\n// Cadence of the settle-watching realign passes after focus moves with the keyboard open:\n// long enough for a smooth scroll to show progress between passes, short enough to recover\n// quickly from a scroll canceled by WebKit's reveal; the pass count covers CSS transitions\n// reacting to the focus change (e.g. a 260ms footer resize) with room to spare.\nconst KEYBOARD_REALIGN_INTERVAL = 150;\nconst KEYBOARD_REALIGN_MAX_PASSES = 4;\n// Frames the alignment waits for the scroll destination to stop moving (layout reacting to\n// the focus change, e.g. a footer resizing over a CSS transition) before scrolling anyway.\nconst KEYBOARD_SETTLE_FRAME_LIMIT = 60;\nconst INPUT_TAP_MOVE_THRESHOLD = 10;\nconst INPUT_TAP_HIT_SLOP = 16;\nconst KEYBOARD_INPUT_TYPES = new Set(['email', 'number', 'password', 'search', 'tel', 'text', 'url']);\n\n// Snapshot of a scroll container's relevant styles taken before keyboard slack is\n// applied. The string fields are the exact inline values to restore on cleanup;\n// the parsed numbers are the computed baselines that slack is added on top of.\n\n// Returned by the point-based resolver when the lift point lands on another\n// interactive/label element. It signals that the tap was intentionally rejected, so the\n// caller must NOT fall back to the touchstart target (`touchend.target` stays at the\n// touchstart node on mobile) — doing so would steal a tap meant for that element.\nconst KEYBOARD_TAP_BLOCKED = Symbol('KeyboardTapBlocked');\n\n/**\n * Provides keyboard-aware focus and scroll handling for bottom-sheet drawers with form fields.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport function DrawerVirtualKeyboardProvider(props) {\n const {\n children\n } = props;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const viewportElement = store.useState('viewportElement');\n\n // The provider requires a `<Drawer.Viewport>` to act as the measurement and containment\n // root and to host the keyboard inset variable; `<Drawer.Popup>` already warns when the\n // viewport is missing, so there is no need to fall back to the popup element here.\n const rootElement = viewportElement;\n const nestedDrawerOpen = nestedOpenDialogCount > 0;\n const pendingKeyboardFocusMovedRef = React.useRef(false);\n const keyboardTouchStartRef = React.useRef(null);\n const focusedKeyboardTargetRef = React.useRef(null);\n const keyboardScrollAdjustmentRef = React.useRef(null);\n const programmaticKeyboardFocusRef = React.useRef(false);\n const keyboardFocusFrame = useAnimationFrame();\n const keyboardRealignTimeout = useTimeout();\n const restoreKeyboardScrollAdjustment = useStableCallback(() => {\n const adjustment = keyboardScrollAdjustmentRef.current;\n if (!adjustment) {\n return;\n }\n adjustment.element.style.overflowAnchor = adjustment.overflowAnchor;\n adjustment.element.style.paddingBottom = adjustment.paddingBottom;\n adjustment.element.style.scrollPaddingBottom = adjustment.scrollPaddingBottom;\n keyboardScrollAdjustmentRef.current = null;\n });\n const setKeyboardScrollSlack = useStableCallback((element, slack) => {\n const roundedSlack = Math.max(0, Math.ceil(slack));\n let adjustment = keyboardScrollAdjustmentRef.current;\n if (adjustment && !adjustment.element.isConnected) {\n restoreKeyboardScrollAdjustment();\n adjustment = null;\n }\n if (roundedSlack === 0) {\n restoreKeyboardScrollAdjustment();\n return;\n }\n if (adjustment && adjustment.element !== element) {\n restoreKeyboardScrollAdjustment();\n adjustment = null;\n }\n if (!adjustment) {\n const styles = getComputedStyle(element);\n adjustment = {\n element,\n overflowAnchor: element.style.overflowAnchor,\n paddingBottom: element.style.paddingBottom,\n scrollPaddingBottom: element.style.scrollPaddingBottom,\n computedPaddingBottom: Number.parseFloat(styles.paddingBottom) || 0,\n computedScrollPaddingBottom: Number.parseFloat(styles.scrollPaddingBottom) || 0\n };\n keyboardScrollAdjustmentRef.current = adjustment;\n }\n element.style.overflowAnchor = 'none';\n element.style.paddingBottom = `${adjustment.computedPaddingBottom + roundedSlack}px`;\n element.style.scrollPaddingBottom = `${adjustment.computedScrollPaddingBottom + KEYBOARD_VISIBILITY_MARGIN}px`;\n });\n const animateKeyboardScroll = useStableCallback((element, scrollTop) => {\n const win = ownerWindow(element);\n const behavior = win.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ? 'auto' : 'smooth';\n element.scrollTo({\n top: scrollTop,\n behavior\n });\n });\n const resetTouchTrackingState = useStableCallback(() => {\n pendingKeyboardFocusMovedRef.current = false;\n keyboardTouchStartRef.current = null;\n });\n React.useEffect(() => {\n if (!mounted || !open) {\n focusedKeyboardTargetRef.current = null;\n restoreKeyboardScrollAdjustment();\n keyboardFocusFrame.cancel();\n return undefined;\n }\n if (!rootElement) {\n restoreKeyboardScrollAdjustment();\n return undefined;\n }\n const doc = ownerDocument(rootElement);\n const win = ownerWindow(rootElement);\n const visualViewport = win.visualViewport;\n\n // Alignment scroll bookkeeping: destination stability, whether a scroll was issued,\n // and the last observed progress so delayed passes can distinguish moving from stalled.\n let keyboardScrollElement = null;\n let keyboardScrollDestination = 0;\n let keyboardScrollChecks = 0;\n let keyboardScrollObserved = -1;\n const setDrawerKeyboardInset = inset => {\n rootElement.style.setProperty(DrawerViewportCssVars.keyboardInset, `${Math.max(0, Math.ceil(inset))}px`);\n };\n const clearFocusedKeyboardTarget = () => {\n focusedKeyboardTargetRef.current = null;\n keyboardScrollElement = null;\n setDrawerKeyboardInset(0);\n restoreKeyboardScrollAdjustment();\n keyboardFocusFrame.cancel();\n keyboardRealignTimeout.clear();\n };\n\n // WebKit's native reveal scroll can move the page even while the scroll lock hides\n // overflow (e.g. when the software keyboard's previous/next field arrows move focus).\n // While the drawer is modal, any window scroll during keyboard interaction is spurious,\n // so pin the page to the position it had when the drawer opened.\n const baseScrollX = win.scrollX;\n const baseScrollY = win.scrollY;\n const restoreWindowScroll = () => {\n if (modal !== true || nestedDrawerOpen || !focusedKeyboardTargetRef.current || getKeyboardVisualViewport(win) == null) {\n return false;\n }\n if (win.scrollX !== baseScrollX || win.scrollY !== baseScrollY) {\n // Force an instant jump: the two-argument form defaults `behavior` to `auto`, which\n // obeys the page's `scroll-behavior`, so a global `scroll-behavior: smooth` would\n // animate the restore. The measurements that follow assume the page is already back\n // at rest, and a smooth restore also re-emits `scroll`, re-entering this handler.\n win.scrollTo({\n left: baseScrollX,\n top: baseScrollY,\n behavior: 'instant'\n });\n return true;\n }\n return false;\n };\n\n // Focus moved by the drawer itself goes through `focusKeyboardInputWithoutPageScroll`,\n // but native focus changes (the iOS keyboard's previous/next field arrows) commit\n // WebKit's reveal scroll before `focusin` reaches us — cancelling it afterwards\n // visibly jitters the sheet. `focusout` on the outgoing field fires before focus\n // lands, so override the incoming field's geometry there and restore it in `focusin`.\n let restorePreemptedFocus = null;\n const consumePreemptedFocus = () => {\n restorePreemptedFocus?.();\n restorePreemptedFocus = null;\n };\n const preemptFocusReveal = (target, keyboardViewport) => {\n consumePreemptedFocus();\n\n // Native focus carries no preventScroll, so a fake off-screen rect would make WebKit\n // scroll the drawer's own scroll containers thousands of pixels chasing it. Presenting\n // the field as already centered in the visible band above the keyboard instead makes\n // both the in-page reveal and the viewport pan no-ops.\n const rect = target.getBoundingClientRect();\n restorePreemptedFocus = overrideGeometryDuringFocus(target, (keyboardViewport.top + keyboardViewport.bottom - rect.top - rect.bottom) / 2);\n };\n const alignFocusedKeyboardTarget = () => {\n // If focus never lands on a preempted target, the focusout-scheduled alignment still\n // restores it on the next frame before paint.\n consumePreemptedFocus();\n const target = focusedKeyboardTargetRef.current;\n // If the focused field is removed from the DOM without firing `focusout` (e.g. it is\n // conditionally rendered away), any applied scroll slack is restored here on the next\n // focus/viewport event or when the drawer closes. This self-corrects rather than\n // tracking each field's lifecycle.\n if (nestedDrawerOpen || !target || !contains(rootElement, target)) {\n setDrawerKeyboardInset(0);\n restoreKeyboardScrollAdjustment();\n return;\n }\n\n // Undo any reveal scroll WebKit applied to the locked page before measuring, so the\n // keyboard inset and alignment are computed against the resting viewport.\n restoreWindowScroll();\n const keyboardViewport = getKeyboardVisualViewport(win);\n if (!keyboardViewport) {\n setDrawerKeyboardInset(0);\n restoreKeyboardScrollAdjustment();\n return;\n }\n setDrawerKeyboardInset(Math.max(0, win.innerHeight - keyboardViewport.bottom));\n const scrollTarget = findKeyboardScrollTarget(target, rootElement);\n if (!scrollTarget) {\n restoreKeyboardScrollAdjustment();\n return;\n }\n const scrollTargetRect = scrollTarget.getBoundingClientRect();\n const clippedBottom = Math.min(scrollTargetRect.bottom, keyboardViewport.bottom);\n const overlap = Math.max(0, scrollTargetRect.bottom - keyboardViewport.bottom);\n setKeyboardScrollSlack(scrollTarget, overlap > 0 ? overlap + KEYBOARD_SCROLL_SLACK : 0);\n const maxScrollTop = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);\n if (maxScrollTop <= 0) {\n return;\n }\n const clippedTop = Math.max(scrollTargetRect.top, keyboardViewport.top);\n const visibleTop = clippedTop + KEYBOARD_VISIBILITY_MARGIN;\n const visibleBottom = clippedBottom - KEYBOARD_VISIBILITY_MARGIN;\n if (visibleBottom <= visibleTop) {\n return;\n }\n const targetRect = target.getBoundingClientRect();\n const nextScrollTop = scrollTarget.scrollTop + (targetRect.top + targetRect.bottom - visibleTop - visibleBottom) / 2;\n const destination = Math.round(clamp(nextScrollTop, 0, maxScrollTop));\n const settled = keyboardScrollElement === scrollTarget && Math.abs(keyboardScrollDestination - destination) <= 1;\n if (!settled) {\n // Commit the scroll only once the destination holds across two consecutive checks.\n // Layout may still be reacting to the focus change (e.g. a footer sized by\n // `:focus-within` resizing over a transition), and scrolling toward a\n // mid-transition destination overshoots, then visibly pulls back once corrected.\n // The destination is scroll-position-invariant, so an in-flight scroll of the\n // container itself never defers the commit.\n const checks = keyboardScrollElement === scrollTarget ? keyboardScrollChecks + 1 : 1;\n keyboardScrollElement = scrollTarget;\n keyboardScrollDestination = destination;\n keyboardScrollChecks = checks;\n keyboardScrollObserved = -1;\n // Re-check next frame; give up and scroll anyway if layout never settles.\n if (checks <= KEYBOARD_SETTLE_FRAME_LIMIT) {\n keyboardFocusFrame.request(alignFocusedKeyboardTarget);\n return;\n }\n } else if (keyboardScrollObserved >= 0) {\n // A scroll toward this destination is already out. Leave it alone while it has\n // arrived or is still progressing — re-issuing restarts the smooth-scroll easing\n // curve, a visible stutter on every realign pass — and re-issue only when it\n // stalled short (WebKit cancels in-flight smooth scrolls when its native reveal\n // for the focus resolves).\n const current = scrollTarget.scrollTop;\n if (Math.abs(current - destination) <= 1) {\n return;\n }\n if (current !== keyboardScrollObserved) {\n keyboardScrollObserved = current;\n return;\n }\n }\n keyboardScrollElement = scrollTarget;\n keyboardScrollDestination = destination;\n keyboardScrollChecks = 0;\n keyboardScrollObserved = scrollTarget.scrollTop;\n animateKeyboardScroll(scrollTarget, destination);\n };\n const scheduleKeyboardFocusAlignment = () => {\n keyboardFocusFrame.request(alignFocusedKeyboardTarget);\n };\n\n // When focus moves with the keyboard already up, no viewport resize events follow to\n // re-run alignment, and the single frame-scheduled pass is unreliable: WebKit resolves\n // the reveal for the focus asynchronously (a UI-process round trip) and cancels any\n // in-flight scroll the pass started when it lands, and layout reacting to the focus\n // change (e.g. a footer sized by `:focus-within` and the keyboard inset) settles only\n // after its transition, so the pass measures stale geometry. Re-align on an interval\n // until both settle; the alignment's scroll bookkeeping observes before re-issuing,\n // so passes that find the scroll on course are inert.\n const scheduleDelayedKeyboardRealign = () => {\n let remainingPasses = KEYBOARD_REALIGN_MAX_PASSES;\n const realign = () => {\n alignFocusedKeyboardTarget();\n remainingPasses -= 1;\n if (remainingPasses > 0) {\n keyboardRealignTimeout.start(KEYBOARD_REALIGN_INTERVAL, realign);\n }\n };\n keyboardRealignTimeout.start(KEYBOARD_REALIGN_INTERVAL, realign);\n };\n const captureFocusedKeyboardTarget = eventTarget => {\n if (nestedDrawerOpen) {\n return false;\n }\n\n // Resolve through the same path as taps so contentEditable hosts (and labelled\n // controls) are normalized identically for the focus and touch paths.\n const target = resolveKeyboardInputTarget(eventTarget);\n if (!target || !contains(rootElement, target)) {\n return false;\n }\n\n // A new field starts a fresh alignment; the scroll bookkeeping must not carry\n // over from the previous field's scroll.\n if (focusedKeyboardTargetRef.current !== target) {\n keyboardScrollElement = null;\n }\n focusedKeyboardTargetRef.current = target;\n return true;\n };\n const handleFocusIn = event => {\n // The programmatic transition is over once focus lands, which happens before\n // `.focus()` returns. Any later `focusout` is the consumer's own — an `onFocus`\n // handler that blurs or moves focus — and must be reconciled rather than\n // suppressed, so stop suppressing here instead of waiting for `.focus()` to return.\n programmaticKeyboardFocusRef.current = false;\n consumePreemptedFocus();\n if (!captureFocusedKeyboardTarget(getTarget(event))) {\n // Focus landed outside any drawer keyboard input. The `focusout` on the previous\n // field normally clears the tracked target, but the tap path suppresses that\n // `focusout` via `programmaticKeyboardFocusRef`, so a consumer `onFocus` handler that\n // redirects focus out of the drawer would otherwise leave a stale target holding its\n // inset, slack, and pending realign. Reconcile against the real focus here.\n // A handler that ends focus entirely emits no `focusin` to reconcile from; that case\n // is covered by clearing the suppression flag above so its `focusout` is handled.\n clearFocusedKeyboardTarget();\n return;\n }\n\n // Covers every way focus can land with the keyboard already up: native moves (the\n // keyboard's previous/next arrows) and the tap path (which suppresses `focusout`\n // handling via the programmatic flag).\n if (getKeyboardVisualViewport(win) != null) {\n scheduleDelayedKeyboardRealign();\n }\n scheduleKeyboardFocusAlignment();\n };\n const handleFocusOut = event => {\n // The blur inside `focusKeyboardInputWithoutPageScroll` is followed synchronously by\n // a re-focus; clearing state here would drop the keyboard inset for a frame.\n if (programmaticKeyboardFocusRef.current) {\n return;\n }\n if (captureFocusedKeyboardTarget(event.relatedTarget)) {\n const target = focusedKeyboardTargetRef.current;\n const keyboardViewport = getKeyboardVisualViewport(win);\n // The delayed realign passes are scheduled by the `focusin` that follows once\n // focus lands on the captured target.\n if (target && keyboardViewport) {\n preemptFocusReveal(target, keyboardViewport);\n }\n scheduleKeyboardFocusAlignment();\n return;\n }\n clearFocusedKeyboardTarget();\n };\n const handleViewportUpdate = () => {\n if (focusedKeyboardTargetRef.current || captureFocusedKeyboardTarget(activeElement(doc))) {\n scheduleKeyboardFocusAlignment();\n }\n };\n const cleanupListeners = [];\n if (visualViewport) {\n cleanupListeners.push(addEventListener(visualViewport, 'resize', handleViewportUpdate), addEventListener(visualViewport, 'scroll', handleViewportUpdate));\n }\n const handleWindowScroll = () => {\n if (restoreWindowScroll()) {\n // Recompute the keyboard inset once the page is back at rest; measurements taken\n // mid-reveal (a non-zero visual viewport offset) inflate it and push the popup up.\n scheduleKeyboardFocusAlignment();\n }\n };\n\n // Once the user puts a finger down they own the scroll position. Stop both the frame settle\n // loop, which can center after changing layout settles, and the delayed passes, which can't\n // distinguish a user scroll from a reveal scroll WebKit canceled. A later focus or viewport\n // change reschedules alignment if it's still needed.\n const cancelKeyboardRealignOnPointerDown = () => {\n keyboardFocusFrame.cancel();\n keyboardRealignTimeout.clear();\n keyboardScrollElement = null;\n };\n cleanupListeners.push(addEventListener(doc, 'focusin', handleFocusIn, true), addEventListener(doc, 'focusout', handleFocusOut, true), addEventListener(win, 'scroll', handleWindowScroll), addEventListener(doc, 'pointerdown', cancelKeyboardRealignOnPointerDown, true));\n if (captureFocusedKeyboardTarget(activeElement(doc))) {\n scheduleKeyboardFocusAlignment();\n }\n return () => {\n cleanupListeners.forEach(cleanup => cleanup());\n consumePreemptedFocus();\n clearFocusedKeyboardTarget();\n rootElement.style.removeProperty(DrawerViewportCssVars.keyboardInset);\n };\n }, [animateKeyboardScroll, keyboardFocusFrame, keyboardRealignTimeout, modal, mounted, nestedDrawerOpen, open, restoreKeyboardScrollAdjustment, rootElement, setKeyboardScrollSlack]);\n const onTouchStart = useStableCallback(event => {\n const touch = event.touches[0];\n pendingKeyboardFocusMovedRef.current = false;\n keyboardTouchStartRef.current = {\n x: touch.clientX,\n y: touch.clientY\n };\n });\n const onTouchMove = useStableCallback(event => {\n const touch = event.touches[0];\n const touchStart = keyboardTouchStartRef.current;\n if (!touch || !touchStart || pendingKeyboardFocusMovedRef.current) {\n return;\n }\n\n // Treat the gesture as a scroll/swipe (not a tap-to-focus) once the finger\n // moves past the threshold, so we don't open the keyboard on a drag.\n if (Math.abs(touch.clientX - touchStart.x) > INPUT_TAP_MOVE_THRESHOLD || Math.abs(touch.clientY - touchStart.y) > INPUT_TAP_MOVE_THRESHOLD) {\n pendingKeyboardFocusMovedRef.current = true;\n }\n });\n const onTouchEnd = useStableCallback(event => {\n if (!open || !mounted || nestedDrawerOpen || !rootElement || !keyboardTouchStartRef.current || pendingKeyboardFocusMovedRef.current) {\n resetTouchTrackingState();\n return;\n }\n const touch = event.changedTouches[0] ?? event.touches[0];\n const root = rootElement.getRootNode();\n const nativeEventTarget = getTarget(event.nativeEvent);\n const pointTarget = touch ? resolveKeyboardTouchTargetFromPoint(root, touch.clientX, touch.clientY) : null;\n\n // The lift point landed on another interactive/label element; let its native tap\n // through instead of stealing it for the touchstart input.\n if (pointTarget === KEYBOARD_TAP_BLOCKED) {\n resetTouchTrackingState();\n return;\n }\n const keyboardTarget = touch && (pointTarget ?? resolveKeyboardTouchTarget(nativeEventTarget));\n if (keyboardTarget && (!contains(rootElement, keyboardTarget.focusTarget) || !contains(rootElement, keyboardTarget.clickTarget))) {\n resetTouchTrackingState();\n return;\n }\n if (keyboardTarget) {\n const {\n clickTarget: keyboardClickTarget,\n focusTarget: keyboardFocusTarget\n } = keyboardTarget;\n const win = ownerWindow(keyboardFocusTarget);\n\n // While pinch-zoomed, keyboard alignment is suspended; let native behavior\n // handle focus and caret placement instead of blurring and re-focusing.\n if (win.visualViewport && win.visualViewport.scale !== 1) {\n resetTouchTrackingState();\n return;\n }\n\n // Already focused with the keyboard up: let the native tap through so it can\n // reposition the caret, rather than blurring and re-focusing the same input.\n if (activeElement(ownerDocument(keyboardFocusTarget)) === keyboardFocusTarget && (!win.visualViewport || getKeyboardVisualViewport(win) != null)) {\n resetTouchTrackingState();\n return;\n }\n\n // iOS only opens the software keyboard when focus happens synchronously\n // inside the touch gesture. The flag suppresses the `focusout` cleanup the\n // intermediate blur would otherwise trigger, so the keyboard inset isn't\n // dropped for a frame between the blur and the re-focus. It is cleared by the\n // `focusin` that lands, so only that blur is suppressed; the `finally` is the\n // backstop for a target that never takes focus.\n event.preventDefault();\n programmaticKeyboardFocusRef.current = true;\n try {\n focusKeyboardInputWithoutPageScroll(keyboardFocusTarget);\n } finally {\n programmaticKeyboardFocusRef.current = false;\n }\n // Preventing the touchend default also suppresses the compatibility mouse\n // events, including `click`; redispatch an untrusted replacement on the\n // original tap target so click handlers still run with the tap coordinates.\n dispatchKeyboardClick(keyboardClickTarget, touch);\n resetTouchTrackingState();\n return;\n }\n resetTouchTrackingState();\n });\n const contextValue = React.useMemo(() => ({\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n onTouchCancel: resetTouchTrackingState\n }), [onTouchEnd, onTouchMove, onTouchStart, resetTouchTrackingState]);\n return /*#__PURE__*/_jsx(DrawerVirtualKeyboardContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction isKeyboardInputElement(element) {\n if (element.isContentEditable) {\n return true;\n }\n const win = ownerWindow(element);\n if (element instanceof win.HTMLTextAreaElement || element instanceof win.HTMLInputElement && KEYBOARD_INPUT_TYPES.has(element.type)) {\n // Disabled controls can't focus or open the keyboard, so tap-to-focus must skip them —\n // otherwise the dispatched click fires handlers a native tap on a disabled control never would.\n return !element.matches(':disabled');\n }\n return false;\n}\nfunction resolveKeyboardInputTarget(target) {\n if (!isHTMLElement(target)) {\n return null;\n }\n if (isKeyboardInputElement(target)) {\n return target.isContentEditable ? getContentEditableHost(target) : target;\n }\n const label = target.closest('label');\n const control = label?.control ?? null;\n return isHTMLElement(control) && isKeyboardInputElement(control) ? control : null;\n}\nfunction resolveKeyboardTouchTarget(target) {\n if (!isHTMLElement(target)) {\n return null;\n }\n const focusTarget = resolveKeyboardInputTarget(target);\n if (!focusTarget) {\n return null;\n }\n return {\n focusTarget,\n clickTarget: target\n };\n}\n\n// Inherited-editable descendants (no `contenteditable` attribute of their own) are not\n// focusable, so focusing them is a no-op; resolve taps on them to the editing host.\nfunction getContentEditableHost(element) {\n let host = element;\n while (host.parentElement?.isContentEditable) {\n host = host.parentElement;\n }\n return host;\n}\nfunction resolveKeyboardTouchTargetFromPoint(root, clientX, clientY) {\n const exactTarget = getElementAtPoint(root, clientX, clientY);\n if (isHTMLElement(exactTarget)) {\n const exactKeyboardTarget = resolveKeyboardInputTarget(exactTarget);\n if (exactKeyboardTarget) {\n return {\n focusTarget: exactKeyboardTarget,\n clickTarget: exactTarget\n };\n }\n }\n\n // Probing nearby points compensates for iOS retargeting taps while the page reacts\n // to the keyboard, but it must not steal a tap that lands on another interactive\n // element — that would suppress its click and focus a neighboring field instead.\n // `closest('label')` covers labels of non-keyboard controls (e.g. checkboxes).\n // Returning the blocked sentinel (rather than `null`) stops the caller from falling\n // back to the touchstart target, which would re-steal the very tap rejected here.\n if (isInteractiveElement(exactTarget) || exactTarget?.closest('label') != null) {\n return KEYBOARD_TAP_BLOCKED;\n }\n for (const [offsetX, offsetY] of [[0, INPUT_TAP_HIT_SLOP], [0, -INPUT_TAP_HIT_SLOP], [INPUT_TAP_HIT_SLOP, 0], [-INPUT_TAP_HIT_SLOP, 0]]) {\n const keyboardTarget = resolveKeyboardInputTarget(getElementAtPoint(root, clientX + offsetX, clientY + offsetY));\n if (keyboardTarget) {\n return {\n focusTarget: keyboardTarget,\n clickTarget: keyboardTarget\n };\n }\n }\n return null;\n}\nfunction dispatchKeyboardClick(target, touch) {\n const win = ownerWindow(target);\n const ClickEvent = win.PointerEvent ?? win.MouseEvent;\n target.dispatchEvent(new ClickEvent('click', {\n bubbles: true,\n cancelable: true,\n clientX: touch.clientX,\n clientY: touch.clientY,\n detail: 1,\n view: win\n }));\n}\nfunction focusKeyboardInputWithoutPageScroll(target) {\n const wasFocused = activeElement(ownerDocument(target)) === target;\n // iOS Safari can still scroll the page for transformed sheets even with preventScroll.\n // Move the input off-screen only for the synchronous focus call; `preventScroll`\n // suppresses the in-page ancestor scrolling that would otherwise chase the fake rect.\n const restoreStyles = overrideGeometryDuringFocus(target, -2000);\n try {\n if (wasFocused) {\n target.blur();\n }\n target.focus({\n preventScroll: true\n });\n } finally {\n restoreStyles();\n }\n}\n\n// Overrides the painted geometry WebKit samples when an element gains focus. The rect is\n// hidden (opacity) rather than detached so layout is unaffected; the caller must restore\n// synchronously before the next paint.\nfunction overrideGeometryDuringFocus(target, translateY) {\n const previousOpacity = target.style.opacity;\n const previousTransform = target.style.transform;\n const previousTransition = target.style.transition;\n target.style.transition = 'none';\n target.style.opacity = '0';\n target.style.transform = `translateY(${translateY}px)`;\n return () => {\n target.style.opacity = previousOpacity;\n target.style.transform = previousTransform;\n target.style.transition = previousTransition;\n };\n}\nfunction findKeyboardScrollTarget(target, root) {\n // Start at the parent: scrolling the focused field's own content (an overflowing\n // textarea is scrollable itself) can never move its box out from under the keyboard.\n // `getParentNode` crosses shadow boundaries so an input inside a shadow root still reaches\n // the drawer body scroller. Prefer an already-scrollable ancestor, then fall back to one\n // that only becomes scrollable once keyboard slack is added (overflow intent without\n // current overflow).\n const scrollStart = getParentNode(target);\n return findScrollableTouchTarget(scrollStart, root, 'vertical') ?? findScrollableTouchTarget(scrollStart, root, 'vertical', true);\n}\nfunction getKeyboardVisualViewport(win) {\n const visualViewport = win.visualViewport;\n if (!visualViewport || visualViewport.scale !== 1) {\n return null;\n }\n const reducedHeight = win.innerHeight - visualViewport.height;\n // Treat small viewport changes as browser chrome movement, not the software keyboard.\n if (reducedHeight <= KEYBOARD_RESIZE_THRESHOLD) {\n return null;\n }\n const top = Math.max(0, visualViewport.offsetTop);\n return {\n top,\n bottom: Math.min(win.innerHeight, top + visualViewport.height)\n };\n}","export let DrawerViewportCssVars = /*#__PURE__*/function (DrawerViewportCssVars) {\n /**\n * The software keyboard inset, measured from the bottom edge of the layout viewport.\n * Present only when the drawer is wrapped in `Drawer.VirtualKeyboardProvider`.\n * @type {CSS length}\n */\n DrawerViewportCssVars[\"keyboardInset\"] = \"--drawer-keyboard-inset\";\n return DrawerViewportCssVars;\n}({});","import { DialogHandle } from \"../dialog/store/DialogHandle.mjs\";\n\n/**\n * Controls a Drawer imperatively and associates detached `Drawer.Trigger` components with a\n * `Drawer.Root`. Create one with `Drawer.createHandle()` and pass it to the `handle` prop of the\n * root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class DrawerHandle extends DialogHandle {}\n\n/**\n * Creates a new handle to connect a Drawer.Root with detached Drawer.Trigger components.\n */\nexport function createDrawerHandle() {\n return new DrawerHandle();\n}","export { TooltipRoot as Root } from \"./root/TooltipRoot.mjs\";\nexport { TooltipTrigger as Trigger } from \"./trigger/TooltipTrigger.mjs\";\nexport { TooltipPortal as Portal } from \"./portal/TooltipPortal.mjs\";\nexport { TooltipPositioner as Positioner } from \"./positioner/TooltipPositioner.mjs\";\nexport { TooltipPopup as Popup } from \"./popup/TooltipPopup.mjs\";\nexport { TooltipArrow as Arrow } from \"./arrow/TooltipArrow.mjs\";\nexport { TooltipProvider as Provider } from \"./provider/TooltipProvider.mjs\";\nexport { TooltipViewport as Viewport } from \"./viewport/TooltipViewport.mjs\";\nexport { createTooltipHandle as createHandle, TooltipHandle as Handle } from \"./store/TooltipHandle.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { TooltipRootContext } from \"./TooltipRootContext.mjs\";\nimport { useClientPoint, useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { PopupHandleAttachment, useImplicitActiveTrigger, usePopupRootStore, useOpenStateTransitions, usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { TooltipStore } from \"../store/TooltipStore.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Groups all parts of the tooltip.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const TooltipRoot = fastComponent(function TooltipRoot(props) {\n const {\n disabled = false,\n defaultOpen = false,\n open: openProp,\n disableHoverablePopup = false,\n trackCursorAxis = 'none',\n actionsRef,\n onOpenChange,\n onOpenChangeComplete,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n children\n } = props;\n const store = usePopupRootStore((floatingId, nested) => new TooltipStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp\n }, floatingId, nested));\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const openState = store.useState('open');\n const open = !disabled && openState;\n const activeTriggerId = store.useState('activeTriggerId');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n store.useSyncedValues({\n trackCursorAxis,\n disableHoverablePopup,\n disabled\n });\n useImplicitActiveTrigger(store, {\n closeOnActiveTriggerUnmount: true\n });\n const {\n forceUnmount,\n transitionStatus\n } = useOpenStateTransitions(open, store);\n const isInstantPhase = store.useState('isInstantPhase');\n const instantType = store.useState('instantType');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n\n // Animations should be instant in two cases:\n // 1) Opening during the provider's instant phase (adjacent tooltip opens instantly)\n // 2) Closing because another tooltip opened (reason === 'none')\n // Otherwise, allow the animation to play. In particular, do not disable animations\n // during the 'ending' phase unless it's due to a sibling opening.\n const previousInstantTypeRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (openState && disabled) {\n store.setOpen(false, createChangeEventDetails(REASONS.disabled));\n }\n }, [openState, disabled, store]);\n useIsoLayoutEffect(() => {\n if (transitionStatus === 'ending' && lastOpenChangeReason === REASONS.none || transitionStatus !== 'ending' && isInstantPhase) {\n // Capture the current instant type so we can restore it later\n // and set to 'delay' to disable animations while moving from one trigger to another\n // within a delay group.\n if (instantType !== 'delay') {\n previousInstantTypeRef.current = instantType;\n }\n store.set('instantType', 'delay');\n } else if (previousInstantTypeRef.current !== null) {\n store.set('instantType', previousInstantTypeRef.current);\n previousInstantTypeRef.current = null;\n }\n }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);\n useIsoLayoutEffect(() => {\n if (open) {\n if (activeTriggerId == null) {\n store.set('payload', undefined);\n }\n }\n }, [store, activeTriggerId, open]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: () => store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [forceUnmount, store]);\n const shouldRenderInteractions = open || mounted || !disabled && trackCursorAxis !== 'none';\n return /*#__PURE__*/_jsxs(TooltipRootContext.Provider, {\n value: store,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), shouldRenderInteractions && /*#__PURE__*/_jsx(TooltipInteractions, {\n store: store,\n disabled: disabled,\n trackCursorAxis: trackCursorAxis\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipRoot.displayName = \"TooltipRoot\";\nfunction TooltipInteractions({\n store,\n disabled,\n trackCursorAxis\n}) {\n const floatingRootContext = store.useState('floatingRootContext');\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled,\n referencePress: () => store.select('closeOnClick')\n });\n const clientPoint = useClientPoint(floatingRootContext, {\n enabled: !disabled && trackCursorAxis !== 'none',\n axis: trackCursorAxis === 'none' ? undefined : trackCursorAxis\n });\n\n // Both hooks return `trigger: reference` (same object identity), so the active and\n // inactive trigger props can never differ. `useClientPoint` has no floating-side props.\n const triggerProps = React.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);\n usePopupInteractionProps(store, {\n activeTriggerProps: triggerProps,\n inactiveTriggerProps: triggerProps,\n popupProps: dismiss.floating ?? EMPTY_OBJECT\n });\n return null;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipRootContext.displayName = \"TooltipRootContext\";\nexport function useTooltipRootContext(optional) {\n const context = React.useContext(TooltipRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.' : _formatErrorMessage(72));\n }\n return context;\n}","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { applyPopupOpenChange, createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n disabled: state => state.disabled,\n instantType: state => state.instantType,\n isInstantPhase: state => state.isInstantPhase,\n trackCursorAxis: state => state.trackCursorAxis,\n disableHoverablePopup: state => state.disableHoverablePopup,\n lastOpenChangeReason: state => state.openChangeReason,\n closeOnClick: state => state.closeOnClick,\n closeDelay: state => state.closeDelay,\n adaptiveOrigin: state => state.adaptiveOrigin\n};\n\n/**\n * The store view that detached handle-backed triggers read from. Both the real `TooltipStore` and\n * the inert fallback store satisfy it, so a trigger can read from whichever store the handle\n * currently exposes. Narrowed to the members a trigger actually uses — the trigger-data members plus\n * `setOpen`/`cancelPendingOpen` (called directly by the trigger) and `useSyncedValue` — so the\n * exposed surface can't bypass the open-change pipeline; on the detached fallback store every one of\n * these mutations is a no-op.\n */\n\nexport class TooltipStore extends ReactStore {\n constructor(initialState, floatingId, nested) {\n const triggerElements = new PopupTriggerMap();\n super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n applyPopupOpenChange(this, nextOpen, eventDetails, {\n extraState: {\n openChangeReason: eventDetails.reason\n }\n });\n };\n\n // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.\n cancelPendingOpen(event) {\n this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(REASONS.triggerPress, event));\n }\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no `Tooltip.Root`\n * is attached. It preserves a tooltip-specific trigger registry in context so detached triggers can\n * register before migrating to the live root store. `setOpen`/`cancelPendingOpen` are no-ops\n * (matching the inert reads/writes of `NullStore`), so a trigger can call them from hover/click\n * handlers while detached without any effect.\n */\nexport function createNullTooltipStore() {\n const triggerElements = new PopupTriggerMap();\n const store = new NullStore(Object.freeze(createInitialState(undefined, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);\n return Object.assign(store, {\n setOpen: NOOP,\n cancelPendingOpen: NOOP\n });\n}\nfunction createInitialState(initialState, triggerElements, floatingId, nested = false) {\n const state = {\n ...createInitialPopupStoreState(),\n disabled: false,\n instantType: undefined,\n isInstantPhase: false,\n trackCursorAxis: 'none',\n disableHoverablePopup: false,\n openChangeReason: null,\n closeOnClick: true,\n closeDelay: 0,\n adaptiveOrigin: undefined,\n ...initialState\n };\n state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n return state;\n}\nfunction createInitialContext(triggerElements) {\n return {\n popupRef: /*#__PURE__*/React.createRef(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined,\n triggerElements\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { usePopupHandleStore, useTriggerDataForwarding } from \"../../utils/popups/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useTooltipProviderContext } from \"../provider/TooltipProviderContext.mjs\";\nimport { safePolygon, useDelayGroup, useFocus, useHoverReferenceInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { contains } from \"../../floating-ui-react/utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../../floating-ui-react/utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useHoverInteractionSharedState } from \"../../floating-ui-react/hooks/useHoverInteractionSharedState.mjs\";\nimport { getDelay } from \"../../floating-ui-react/hooks/useHoverShared.mjs\";\nimport { OPEN_DELAY } from \"../utils/constants.mjs\";\nconst TOOLTIP_TRIGGER_IDENTIFIER = 'data-base-ui-tooltip-trigger';\nfunction getTargetElement(event) {\n if ('composedPath' in event) {\n const path = event.composedPath();\n for (let i = 0; i < path.length; i += 1) {\n const element = path[i];\n if (isElement(element)) {\n return element;\n }\n }\n }\n const target = event.target;\n if (isElement(target)) {\n return target;\n }\n return null;\n}\nfunction closestEnabledTooltipTrigger(element) {\n let current = element;\n while (current) {\n const trigger = current.closest(`[${TOOLTIP_TRIGGER_IDENTIFIER}]`);\n if (trigger) {\n return trigger;\n }\n const root = current.getRootNode();\n current = 'host' in root && isElement(root.host) ? root.host : null;\n }\n return null;\n}\n\n/**\n * An element to attach the tooltip to.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipTrigger = fastComponentRef(function TooltipTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n handle,\n payload,\n disabled: disabledProp,\n delay,\n closeOnClick = true,\n closeDelay,\n id: idProp,\n ...elementProps\n } = componentProps;\n const rootContext = useTooltipRootContext(true);\n const handleStore = usePopupHandleStore(handle);\n const store = handleStore ?? rootContext;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.' : _formatErrorMessage(82));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const floatingRootContext = store.useState('floatingRootContext');\n const triggerElementRef = React.useRef(null);\n const delayWithDefault = delay ?? OPEN_DELAY;\n const closeDelayWithDefault = closeDelay ?? 0;\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n closeOnClick,\n closeDelay: closeDelayWithDefault\n });\n const providerDelay = useTooltipProviderContext();\n const {\n delayRef,\n isInstantPhase,\n hasProvider\n } = useDelayGroup(floatingRootContext, {\n open: isOpenedByThisTrigger\n });\n const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);\n store.useSyncedValue('isInstantPhase', isInstantPhase);\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp ?? rootDisabled;\n const disabledRef = useValueAsRef(disabled);\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const isNestedTriggerHoveredRef = React.useRef(false);\n const nestedTriggerOpenTimeout = useTimeout();\n // Local copy so it can be cleared on mouseLeave without resetting the hover hook's own pointerType.\n const pointerTypeRef = React.useRef(undefined);\n function getOpenDelay() {\n if (!hasProvider) {\n return delayWithDefault;\n }\n return getDelay(delayRef.current, 'open') === 0 ? 0 : delay ?? providerDelay ?? OPEN_DELAY;\n }\n function isEnabledNestedTriggerTarget(target) {\n const triggerEl = triggerElementRef.current;\n if (!triggerEl || !target) {\n return false;\n }\n const nearestTrigger = closestEnabledTooltipTrigger(target);\n return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);\n }\n function detectNestedTriggerHover(target) {\n const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);\n isNestedTriggerHoveredRef.current = nestedTriggerHovered;\n if (nestedTriggerHovered) {\n hoverInteraction.openChangeTimeout.clear();\n hoverInteraction.restTimeout.clear();\n hoverInteraction.restTimeoutPending = false;\n nestedTriggerOpenTimeout.clear();\n }\n return nestedTriggerHovered;\n }\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: !disabled,\n mouseOnly: true,\n move: false,\n handleClose: !disableHoverablePopup && trackCursorAxis !== 'both' ? safePolygon() : null,\n restMs: getOpenDelay,\n delay() {\n if (closeDelay == null && hasProvider) {\n return {\n close: getDelay(delayRef.current, 'close')\n };\n }\n return {\n close: closeDelayWithDefault\n };\n },\n triggerElementRef,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending',\n shouldOpen() {\n return !isNestedTriggerHoveredRef.current;\n }\n });\n const focusProps = useFocus(floatingRootContext, {\n enabled: !disabled\n }).reference;\n const handleNestedTriggerHover = event => {\n const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;\n const target = getTargetElement(event);\n const nestedTriggerHovered = detectNestedTriggerHover(target);\n const triggerEl = triggerElementRef.current;\n const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);\n\n // Only close hover-opened parents. Focus/click-like opens remain owned by\n // their original interaction and should not be clobbered by nested hover.\n if (nestedTriggerHovered && store.select('open') && store.select('lastOpenChangeReason') === REASONS.triggerHover) {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n return;\n }\n if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select('open') && triggerEl &&\n // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.\n isMouseLikePointerType(pointerTypeRef.current)) {\n const open = () => {\n if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select('open')) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerEl));\n }\n };\n const openDelay = getOpenDelay();\n\n // With `move: false`, the hover hook only listens to mouseenter/mouseleave\n // on the parent trigger. Leaving a nested child for the parent area fires\n // no event the hook can react to, so reopen locally.\n if (openDelay === 0) {\n nestedTriggerOpenTimeout.clear();\n open();\n } else {\n nestedTriggerOpenTimeout.start(openDelay, open);\n }\n }\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const shouldApplyRootTriggerProps = isMountedByThisTrigger || trackCursorAxis !== 'none';\n const state = {\n open: isOpenedByThisTrigger\n };\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, registerTrigger, triggerElementRef],\n props: [hoverProps, focusProps, shouldApplyRootTriggerProps ? rootTriggerProps : undefined, {\n onMouseOver(event) {\n handleNestedTriggerHover(event.nativeEvent);\n },\n onFocus(event) {\n if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {\n event.preventBaseUIHandler();\n }\n },\n onMouseLeave() {\n isNestedTriggerHoveredRef.current = false;\n nestedTriggerOpenTimeout.clear();\n pointerTypeRef.current = undefined;\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n store.set('closeOnClick', closeOnClick);\n if (closeOnClick && !store.select('open')) {\n store.cancelPendingOpen(event.nativeEvent);\n }\n },\n onClick(event) {\n if (closeOnClick && !store.select('open')) {\n store.cancelPendingOpen(event.nativeEvent);\n }\n },\n id: thisTriggerId,\n 'data-trigger-disabled': disabled ? '' : undefined,\n [TOOLTIP_TRIGGER_IDENTIFIER]: disabled ? undefined : ''\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipTrigger.displayName = \"TooltipTrigger\";","'use client';\n\nimport * as React from 'react';\n\n/**\n * Holds the provider's `delay` value. `closeDelay` is handled by the delay group.\n */\nexport const TooltipProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipProviderContext.displayName = \"TooltipProviderContext\";\nexport function useTooltipProviderContext() {\n return React.useContext(TooltipProviderContext);\n}","export const OPEN_DELAY = 600;","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { TooltipPortalContext } from \"./TooltipPortalContext.mjs\";\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipPortal = /*#__PURE__*/React.forwardRef(function TooltipPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useTooltipRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(TooltipPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPortal.displayName = \"TooltipPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPortalContext.displayName = \"TooltipPortalContext\";\nexport function useTooltipPortalContext() {\n const value = React.useContext(TooltipPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Portal> is missing.' : _formatErrorMessage(70));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useFloatingPortalNode } from \"../floating-ui-react/components/FloatingPortal.mjs\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * `FloatingPortal` includes tabbable logic handling for focus management.\n * For components that don't need tabbable logic, use `FloatingPortalLite`.\n * @internal\n */\nexport const FloatingPortalLite = /*#__PURE__*/React.forwardRef(function FloatingPortalLite(componentProps, forwardedRef) {\n const {\n children,\n container,\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n if (!portalSubtree && !portalNode) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode)]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortalLite.displayName = \"FloatingPortalLite\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { TooltipPositionerContext } from \"./TooltipPositionerContext.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { useTooltipPortalContext } from \"../portal/TooltipPortalContext.mjs\";\nimport { POPUP_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\n\n/**\n * Positions the tooltip against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipPositioner = /*#__PURE__*/React.forwardRef(function TooltipPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n positionMethod = 'absolute',\n side = 'top',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = POPUP_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const keepMounted = useTooltipPortalContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const floatingRootContext = store.useState('floatingRootContext');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const adaptiveOrigin = store.useState('adaptiveOrigin');\n const positioning = useAnchorPositioning({\n anchor,\n positionMethod,\n floatingRootContext,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n collisionBoundary,\n collisionPadding,\n sticky,\n arrowPadding,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n adaptiveOrigin\n });\n const state = React.useMemo(() => ({\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n instant: trackCursorAxis !== 'none' ? 'tracking-cursor' : instantType\n }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, store.useStateSetter('positionerElement')],\n hidden: !mounted,\n inert: !open || trackCursorAxis === 'both' || disableHoverablePopup\n });\n return /*#__PURE__*/_jsx(TooltipPositionerContext.Provider, {\n value: positioning,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPositioner.displayName = \"TooltipPositioner\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPositionerContext.displayName = \"TooltipPositionerContext\";\nexport function useTooltipPositionerContext() {\n const context = React.useContext(TooltipPositionerContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.' : _formatErrorMessage(71));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { useHoverFloatingInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n/**\n * A container for the tooltip contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipPopup = /*#__PURE__*/React.forwardRef(function TooltipPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const {\n side,\n align\n } = useTooltipPositionerContext();\n const open = store.useState('open');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const floatingContext = store.useState('floatingRootContext');\n const disabled = store.useState('disabled');\n const closeDelay = store.useState('closeDelay');\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n useHoverFloatingInteraction(floatingContext, {\n enabled: !disabled,\n closeDelay\n });\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n side,\n align,\n instant: instantType,\n transitionStatus\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping: popupTransitionStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPopup.displayName = \"TooltipPopup\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\n\n/**\n * Displays an element positioned against the tooltip anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipArrow = /*#__PURE__*/React.forwardRef(function TooltipArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = useTooltipPositionerContext();\n const open = store.useState('open');\n const instantType = store.useState('instantType');\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered,\n instant: instantType\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, arrowRef],\n props: [{\n style: arrowStyles,\n 'aria-hidden': true\n }, elementProps],\n stateAttributesMapping: popupStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipArrow.displayName = \"TooltipArrow\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingDelayGroup } from \"../../floating-ui-react/index.mjs\";\nimport { TooltipProviderContext } from \"./TooltipProviderContext.mjs\";\n\n/**\n * Provides a shared delay for multiple tooltips. The grouping logic ensures that\n * once a tooltip becomes visible, the adjacent tooltips will be shown instantly.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipProvider = function TooltipProvider(props) {\n const {\n delay,\n closeDelay,\n timeout = 400\n } = props;\n const delayValue = React.useMemo(() => ({\n open: delay,\n close: closeDelay\n }), [delay, closeDelay]);\n return /*#__PURE__*/_jsx(TooltipProviderContext.Provider, {\n value: delay,\n children: /*#__PURE__*/_jsx(FloatingDelayGroup, {\n delay: delayValue,\n timeoutMs: timeout,\n children: props.children\n })\n });\n};\nif (process.env.NODE_ENV !== \"production\") TooltipProvider.displayName = \"TooltipProvider\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupViewportStateMapping, usePopupViewport } from \"../../utils/usePopupViewport.mjs\";\n\n/**\n * A viewport for displaying content transitions.\n * This component is only required if one popup can be opened by multiple triggers, its content\n * changes based on the trigger, and switching between them is animated.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipViewport = /*#__PURE__*/React.forwardRef(function TooltipViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const positioner = useTooltipPositionerContext();\n const instantType = store.useState('instantType');\n const {\n children: childrenToRender,\n state: viewportState\n } = usePopupViewport({\n store,\n side: positioner.side,\n children\n });\n const state = {\n activationDirection: viewportState.activationDirection,\n transitioning: viewportState.transitioning,\n instant: instantType\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [elementProps, {\n children: childrenToRender\n }],\n stateAttributesMapping: popupViewportStateMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipViewport.displayName = \"TooltipViewport\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { usePreviousValue } from '@base-ui/utils/usePreviousValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useAnimationsFinished } from \"../internals/useAnimationsFinished.mjs\";\nimport { usePopupAutoResize } from \"./usePopupAutoResize.mjs\";\nimport { useDirection } from \"../direction-provider/index.mjs\";\nimport { adaptiveOrigin } from \"./adaptiveOriginMiddleware.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const popupViewportStateMapping = {\n activationDirection: value => value ? {\n 'data-activation-direction': value\n } : null\n};\n/**\n * Builds morphing viewport containers for popups that animate between trigger-based content.\n * Handles previous-content snapshots, auto-resize, and state attributes for transitions.\n */\nexport function usePopupViewport(parameters) {\n const {\n store,\n side,\n children\n } = parameters;\n const direction = useDirection();\n const activeTrigger = store.useState('activeTriggerElement');\n const activeTriggerId = store.useState('activeTriggerId');\n const open = store.useState('open');\n const payload = store.useState('payload');\n const mounted = store.useState('mounted');\n const popupElement = store.useState('popupElement');\n const positionerElement = store.useState('positionerElement');\n const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null);\n // Remount current content on trigger changes (and once more when payload lags) to avoid DOM reuse flashes.\n // The key bumps immediately on trigger switches, then again if the payload arrives on a later render.\n const currentContentKey = usePopupContentKey(activeTriggerId, payload);\n const capturedNodeRef = React.useRef(null);\n const [previousContentNode, setPreviousContentNode] = React.useState(null);\n const [newTriggerOffset, setNewTriggerOffset] = React.useState(null);\n const currentContainerRef = React.useRef(null);\n const previousContainerRef = React.useRef(null);\n const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true);\n const cleanupFrame = useAnimationFrame();\n const cleanupControllerRef = React.useRef(null);\n const [previousContentDimensions, setPreviousContentDimensions] = React.useState(null);\n const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React.useState(false);\n useIsoLayoutEffect(() => {\n store.set('adaptiveOrigin', adaptiveOrigin);\n return () => {\n store.set('adaptiveOrigin', undefined);\n };\n }, [store]);\n const handleMeasureLayout = useStableCallback(() => {\n currentContainerRef.current?.style.setProperty('animation', 'none');\n currentContainerRef.current?.style.setProperty('transition', 'none');\n previousContainerRef.current?.style.setProperty('display', 'none');\n });\n const handleMeasureLayoutComplete = useStableCallback(previousDimensions => {\n currentContainerRef.current?.style.removeProperty('animation');\n currentContainerRef.current?.style.removeProperty('transition');\n previousContainerRef.current?.style.removeProperty('display');\n if (previousDimensions) {\n setPreviousContentDimensions(previousDimensions);\n }\n });\n const armViewportCleanup = useStableCallback(() => {\n cleanupControllerRef.current?.abort();\n const controller = new AbortController();\n cleanupControllerRef.current = controller;\n onAnimationsFinished(() => {\n setPreviousContentNode(null);\n setPreviousContentDimensions(null);\n capturedNodeRef.current = null;\n }, controller.signal);\n });\n const lastHandledTriggerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!open || !mounted) {\n lastHandledTriggerRef.current = null;\n }\n }, [open, mounted]);\n useIsoLayoutEffect(() => {\n // When a trigger changes, set the captured children HTML to state,\n // so we can render both new and old content.\n if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {\n setPreviousContentNode(capturedNodeRef.current);\n setShowStartingStyleAttribute(true);\n\n // Calculate the relative position between the previous and new trigger,\n // so we can pass it to the style hook for animation purposes.\n const offset = calculateRelativePosition(previousActiveTrigger, activeTrigger);\n setNewTriggerOffset(offset);\n lastHandledTriggerRef.current = activeTrigger;\n }\n }, [activeTrigger, previousActiveTrigger]);\n\n // Arm cleanup after a trigger change, and re-arm it if the current container remounts\n // mid-transition when a lagging payload bumps `currentContentKey`. The remount discards\n // the running entry animation (and with transition-style CSS the replacement mounts at\n // final styles with no animation at all), so re-run the starting-style choreography —\n // otherwise the watcher either strands or fires before the previous container's exit\n // animation finishes.\n useIsoLayoutEffect(() => {\n if (previousContentNode == null) {\n return;\n }\n\n // Abort the stale watcher synchronously. The remount cancels the old container's\n // animations, and the resulting promise rejection would otherwise run the cleanup\n // in a microtask before the re-armed watcher below is in place.\n cleanupControllerRef.current?.abort();\n setShowStartingStyleAttribute(true);\n cleanupFrame.request(() => {\n ReactDOM.flushSync(() => {\n setShowStartingStyleAttribute(false);\n });\n armViewportCleanup();\n });\n }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]);\n\n // Capture a clone of the current content DOM subtree when not transitioning.\n // We can't store previous React nodes as they may be stateful; instead we capture DOM clones for visual continuity.\n useIsoLayoutEffect(() => {\n // When a transition is in progress, we store the next content in capturedNodeRef.\n // This handles the case where the trigger changes multiple times before the transition finishes.\n // We want to always capture the latest content for the previous snapshot.\n // So clicking quickly on T1, T2, T3 will result in the following sequence:\n // 1. T1 -> T2: previousContent = T1, currentContent = T2\n // 2. T2 -> T3: previousContent = T2, currentContent = T3\n const source = currentContainerRef.current;\n if (!source) {\n return;\n }\n const wrapper = ownerDocument(source).createElement('div');\n for (const child of Array.from(source.childNodes)) {\n wrapper.appendChild(child.cloneNode(true));\n }\n capturedNodeRef.current = wrapper;\n });\n const isTransitioning = previousContentNode != null;\n let childrenToRender;\n if (!isTransitioning) {\n childrenToRender = /*#__PURE__*/_jsx(\"div\", {\n \"data-current\": true,\n ref: currentContainerRef,\n children: children\n }, currentContentKey);\n } else {\n childrenToRender = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n \"data-previous\": true,\n inert: inertValue(true),\n ref: previousContainerRef,\n style: {\n ...(previousContentDimensions ? {\n '--popup-width': `${previousContentDimensions.width}px`,\n '--popup-height': `${previousContentDimensions.height}px`\n } : null),\n position: 'absolute'\n },\n \"data-ending-style\": showStartingStyleAttribute ? undefined : ''\n }, \"previous\"), /*#__PURE__*/_jsx(\"div\", {\n \"data-current\": true,\n ref: currentContainerRef,\n \"data-starting-style\": showStartingStyleAttribute ? '' : undefined,\n children: children\n }, currentContentKey)]\n });\n }\n\n // When previousContentNode is present, imperatively populate the previous container with the cloned children.\n useIsoLayoutEffect(() => {\n const container = previousContainerRef.current;\n if (!container || !previousContentNode) {\n return;\n }\n container.replaceChildren(...Array.from(previousContentNode.childNodes));\n }, [previousContentNode]);\n usePopupAutoResize({\n popupElement,\n positionerElement,\n mounted,\n content: payload,\n onMeasureLayout: handleMeasureLayout,\n onMeasureLayoutComplete: handleMeasureLayoutComplete,\n side,\n direction\n });\n const state = {\n activationDirection: getActivationDirection(newTriggerOffset),\n transitioning: isTransitioning\n };\n return {\n children: childrenToRender,\n state\n };\n}\n/**\n * Returns a string describing the provided offset.\n * It describes both the horizontal and vertical offset, separated by a space.\n *\n * @param offset\n */\nfunction getActivationDirection(offset) {\n if (!offset) {\n return undefined;\n }\n return `${getValueWithTolerance(offset.horizontal, 5, 'right', 'left')} ${getValueWithTolerance(offset.vertical, 5, 'down', 'up')}`;\n}\n\n/**\n * Returns a label describing the value (positive/negative) treating values\n * within tolerance as zero.\n *\n * @param value Value to check\n * @param tolerance Tolerance to treat the value as zero.\n * @param positiveLabel\n * @param negativeLabel\n * @returns If 0 < abs(value) < tolerance, returns an empty string. Otherwise returns positiveLabel or negativeLabel.\n */\nfunction getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {\n if (value > tolerance) {\n return positiveLabel;\n }\n if (value < -tolerance) {\n return negativeLabel;\n }\n return '';\n}\n\n/**\n * Calculates the relative position between centers of two elements.\n */\nfunction calculateRelativePosition(from, to) {\n const fromRect = from.getBoundingClientRect();\n const toRect = to.getBoundingClientRect();\n const fromCenter = {\n x: fromRect.left + fromRect.width / 2,\n y: fromRect.top + fromRect.height / 2\n };\n const toCenter = {\n x: toRect.left + toRect.width / 2,\n y: toRect.top + toRect.height / 2\n };\n return {\n horizontal: toCenter.x - fromCenter.x,\n vertical: toCenter.y - fromCenter.y\n };\n}\n\n/**\n * Returns a key that forces remounting content when triggers change or a payload is updated.\n */\nfunction usePopupContentKey(activeTriggerId, payload) {\n const [contentKey, setContentKey] = React.useState(0);\n const previousActiveTriggerIdRef = React.useRef(activeTriggerId);\n const previousPayloadRef = React.useRef(payload);\n const pendingPayloadUpdateRef = React.useRef(false);\n useIsoLayoutEffect(() => {\n // Compare against the last committed values to decide whether we need a new DOM subtree.\n const previousActiveTriggerId = previousActiveTriggerIdRef.current;\n const previousPayload = previousPayloadRef.current;\n const triggerIdChanged = activeTriggerId !== previousActiveTriggerId;\n const payloadChanged = payload !== previousPayload;\n if (triggerIdChanged) {\n // Remount immediately on trigger change; remember if payload hasn't caught up yet.\n setContentKey(value => value + 1);\n pendingPayloadUpdateRef.current = !payloadChanged;\n } else if (pendingPayloadUpdateRef.current && payloadChanged) {\n // Payload arrived a render later, so remount once more to avoid reusing the old <img>.\n setContentKey(value => value + 1);\n pendingPayloadUpdateRef.current = false;\n }\n\n // Persist current values for the next render's comparison.\n previousActiveTriggerIdRef.current = activeTriggerId;\n previousPayloadRef.current = payload;\n }, [activeTriggerId, payload]);\n return `${activeTriggerId ?? 'current'}-${contentKey}`;\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { NOOP, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useAnimationsFinished } from \"../internals/useAnimationsFinished.mjs\";\nimport { getCssDimensions } from \"./getCssDimensions.mjs\";\n/**\n * Allows the element to automatically resize based on its content while supporting animations.\n */\nexport function usePopupAutoResize(parameters) {\n const {\n popupElement,\n positionerElement,\n content,\n mounted,\n onMeasureLayout: onMeasureLayoutParam,\n onMeasureLayoutComplete: onMeasureLayoutCompleteParam,\n side,\n direction\n } = parameters;\n const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true);\n const animationFrame = useAnimationFrame();\n const committedDimensionsRef = React.useRef(null);\n const isInitialRenderRef = React.useRef(true);\n const restoreAnchoringStylesRef = React.useRef(NOOP);\n const onMeasureLayout = useStableCallback(onMeasureLayoutParam);\n const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam);\n const anchoringStyles = React.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]);\n useIsoLayoutEffect(() => {\n // Reset the state when the popup is closed.\n if (!mounted) {\n restoreAnchoringStylesRef.current = NOOP;\n isInitialRenderRef.current = true;\n committedDimensionsRef.current = null;\n return undefined;\n }\n if (!popupElement || !positionerElement) {\n return undefined;\n }\n restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles);\n\n // Measure the rendered size to enable transitions:\n setPopupCssSize(popupElement, 'auto');\n const restorePopupPosition = overrideElementStyle(popupElement, 'position', 'static');\n const restorePopupTransform = overrideElementStyle(popupElement, 'transform', 'none');\n const restorePopupScale = overrideElementStyle(popupElement, 'scale', '1');\n const restorePositionerAvailableSize = applyElementStyles(positionerElement, {\n '--available-width': 'max-content',\n '--available-height': 'max-content'\n });\n function restoreMeasurementOverrides() {\n restorePopupPosition();\n restorePopupTransform();\n restorePositionerAvailableSize();\n }\n function restoreMeasurementOverridesIncludingScale() {\n restoreMeasurementOverrides();\n restorePopupScale();\n }\n onMeasureLayout?.();\n\n // Initial render (for each time the popup opens).\n if (isInitialRenderRef.current || committedDimensionsRef.current === null) {\n setPositionerCssSize(positionerElement, 'max-content');\n const dimensions = getCssDimensions(popupElement);\n committedDimensionsRef.current = dimensions;\n setPositionerCssSize(positionerElement, dimensions);\n restoreMeasurementOverridesIncludingScale();\n onMeasureLayoutComplete?.(null, dimensions);\n isInitialRenderRef.current = false;\n return () => {\n restoreAnchoringStylesRef.current();\n restoreAnchoringStylesRef.current = NOOP;\n };\n }\n\n // Subsequent renders while open (when `content` changes).\n setPositionerCssSize(positionerElement, 'max-content');\n const previousDimensions = committedDimensionsRef.current;\n const newDimensions = getCssDimensions(popupElement);\n\n // Commit immediately so future content changes have a stable previous size.\n committedDimensionsRef.current = newDimensions;\n setPopupCssSize(popupElement, previousDimensions);\n restoreMeasurementOverridesIncludingScale();\n onMeasureLayoutComplete?.(previousDimensions, newDimensions);\n setPositionerCssSize(positionerElement, newDimensions);\n const abortController = new AbortController();\n animationFrame.request(() => {\n setPopupCssSize(popupElement, newDimensions);\n runOnceAnimationsFinish(() => {\n popupElement.style.setProperty('--popup-width', 'auto');\n popupElement.style.setProperty('--popup-height', 'auto');\n }, abortController.signal);\n });\n return () => {\n abortController.abort();\n animationFrame.cancel();\n restoreAnchoringStylesRef.current();\n restoreAnchoringStylesRef.current = NOOP;\n };\n }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]);\n}\nfunction getPopupAnchoringStyles(side, direction) {\n // Ensure popup size transitions correctly when anchored to `bottom` (side=top) or `right` (side=left).\n const isPhysicalTop = side === 'top';\n const isPhysicalLeft = side === 'left' || side === (direction === 'rtl' ? 'inline-end' : 'inline-start');\n if (!isPhysicalTop && !isPhysicalLeft) {\n return EMPTY_OBJECT;\n }\n return {\n position: 'absolute',\n [isPhysicalTop ? 'bottom' : 'top']: '0',\n [isPhysicalLeft ? 'right' : 'left']: '0'\n };\n}\nfunction overrideElementStyle(element, property, value) {\n const originalValue = element.style.getPropertyValue(property);\n element.style.setProperty(property, value);\n return () => {\n element.style.setProperty(property, originalValue);\n };\n}\nfunction applyElementStyles(element, styles) {\n const restorers = [];\n for (const [key, value] of Object.entries(styles)) {\n restorers.push(overrideElementStyle(element, key, value));\n }\n return restorers.length ? () => {\n restorers.forEach(restore => restore());\n } : NOOP;\n}\nfunction setPopupCssSize(popupElement, size) {\n const width = size === 'auto' ? 'auto' : `${size.width}px`;\n const height = size === 'auto' ? 'auto' : `${size.height}px`;\n popupElement.style.setProperty('--popup-width', width);\n popupElement.style.setProperty('--popup-height', height);\n}\nfunction setPositionerCssSize(positionerElement, size) {\n const width = size === 'max-content' ? 'max-content' : `${size.width}px`;\n const height = size === 'max-content' ? 'max-content' : `${size.height}px`;\n positionerElement.style.setProperty('--positioner-width', width);\n positionerElement.style.setProperty('--positioner-height', height);\n}","import { round } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement } from '@floating-ui/utils/dom';\nexport function getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height\n };\n}","import { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { getSide } from '@floating-ui/utils';\nimport { DEFAULT_SIDES } from \"./adaptiveOriginConstants.mjs\";\nexport const adaptiveOrigin = {\n name: 'adaptiveOrigin',\n async fn(state) {\n const {\n x: rawX,\n y: rawY,\n rects: {\n floating: floatRect\n },\n elements: {\n floating\n },\n platform,\n strategy,\n placement\n } = state;\n const win = ownerWindow(floating);\n const styles = win.getComputedStyle(floating);\n const hasTransition = styles.transitionDuration !== '0s' && styles.transitionDuration !== '';\n if (!hasTransition) {\n return {\n x: rawX,\n y: rawY,\n data: DEFAULT_SIDES\n };\n }\n const offsetParent = await platform.getOffsetParent?.(floating);\n let offsetDimensions = {\n width: 0,\n height: 0\n };\n\n // For fixed strategy, prefer visualViewport if available\n if (strategy === 'fixed' && win?.visualViewport) {\n offsetDimensions = {\n width: win.visualViewport.width,\n height: win.visualViewport.height\n };\n } else if (offsetParent === win) {\n const doc = ownerDocument(floating);\n offsetDimensions = {\n width: doc.documentElement.clientWidth,\n height: doc.documentElement.clientHeight\n };\n } else if (await platform.isElement?.(offsetParent)) {\n offsetDimensions = await platform.getDimensions(offsetParent);\n }\n const currentSide = getSide(placement);\n let x = rawX;\n let y = rawY;\n if (currentSide === 'left') {\n x = offsetDimensions.width - (rawX + floatRect.width);\n }\n if (currentSide === 'top') {\n y = offsetDimensions.height - (rawY + floatRect.height);\n }\n const sideX = currentSide === 'left' ? 'right' : DEFAULT_SIDES.sideX;\n const sideY = currentSide === 'top' ? 'bottom' : DEFAULT_SIDES.sideY;\n return {\n x,\n y,\n data: {\n sideX,\n sideY\n }\n };\n }\n};","import { createNullTooltipStore } from \"./TooltipStore.mjs\";\nimport { BasePopupHandle } from \"../../utils/popups/popupHandle.mjs\";\n\n/**\n * Controls a Tooltip imperatively and associates detached `Tooltip.Trigger` components with a\n * `Tooltip.Root`. Create one with `Tooltip.createHandle()` and pass it to the `handle` prop of the\n * root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class TooltipHandle extends BasePopupHandle {\n constructor() {\n super(createNullTooltipStore(), 'Tooltip');\n }\n\n /**\n * Opens the tooltip and associates it with the trigger with the given id.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching\n * `Tooltip.Trigger` with this handle passed as a prop.\n */\n open(triggerId) {\n this.openByTrigger(triggerId);\n }\n\n /**\n * Closes the tooltip.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n close() {\n this.closePopup();\n }\n\n /**\n * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle.\n */\n get isOpen() {\n return this.attachedStore?.select('open') ?? false;\n }\n}\n\n/**\n * Creates a new handle to connect a Tooltip.Root with detached Tooltip.Trigger components.\n */\nexport function createTooltipHandle() {\n return new TooltipHandle();\n}","\"use client\";\nimport * as React from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\nfunction TooltipProvider({ delayDuration = 150, ...props }: React.ComponentProps<typeof BaseTooltip.Provider> & { delayDuration?: number }) { return <BaseTooltip.Provider delay={delayDuration} {...props} />; }\nfunction Tooltip({ ...props }: React.ComponentProps<typeof BaseTooltip.Root>) { return <BaseTooltip.Root data-slot=\"tooltip\" {...props} />; }\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof BaseTooltip.Trigger>) { return <BaseTooltip.Trigger data-slot=\"tooltip-trigger\" {...props} />; }\nfunction TooltipContent({ className, sideOffset = 6, side, align, children, ...props }: React.ComponentProps<typeof BaseTooltip.Popup> & { sideOffset?: number; side?: React.ComponentProps<typeof BaseTooltip.Positioner>[\"side\"]; align?: React.ComponentProps<typeof BaseTooltip.Positioner>[\"align\"] }) { return <BaseTooltip.Portal><BaseTooltip.Positioner className={overlayLayers.transient} sideOffset={sideOffset} side={side} align={align}><BaseTooltip.Popup role=\"tooltip\" data-slot=\"tooltip-content\" className={cn(\"w-fit rounded-md bg-text-primary px-3 py-1.5 text-balance text-xs text-canvas shadow-[var(--ds-shadow-floating)]\", className)} {...props}>{children}<BaseTooltip.Arrow className=\"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-text-primary fill-text-primary\" /></BaseTooltip.Popup></BaseTooltip.Positioner></BaseTooltip.Portal>; }\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n","export { AlertDialogRoot as Root } from \"./root/AlertDialogRoot.mjs\";\nexport { DialogBackdrop as Backdrop } from \"../dialog/backdrop/DialogBackdrop.mjs\";\nexport { DialogClose as Close } from \"../dialog/close/DialogClose.mjs\";\nexport { DialogDescription as Description } from \"../dialog/description/DialogDescription.mjs\";\nexport { DialogPopup as Popup } from \"../dialog/popup/DialogPopup.mjs\";\nexport { DialogPortal as Portal } from \"../dialog/portal/DialogPortal.mjs\";\nexport { DialogTitle as Title } from \"../dialog/title/DialogTitle.mjs\";\nexport { AlertDialogTrigger as Trigger } from \"./trigger/AlertDialogTrigger.mjs\";\nexport { DialogViewport as Viewport } from \"../dialog/viewport/DialogViewport.mjs\";\nexport { AlertDialogHandle as Handle, createAlertDialogHandle as createHandle } from \"./handle.mjs\";","'use client';\n\nimport { useRenderDialogRoot } from \"../../dialog/root/useRenderDialogRoot.mjs\";\n/**\n * Groups all parts of the alert dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Alert Dialog](https://base-ui.com/react/components/alert-dialog)\n */\nexport function AlertDialogRoot(props) {\n return useRenderDialogRoot('alert-dialog', props);\n}","'use client';\n\nimport { DialogTrigger } from \"../../dialog/trigger/DialogTrigger.mjs\";\n/**\n * A button that opens the alert dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Alert Dialog](https://base-ui.com/react/components/alert-dialog)\n */\nexport const AlertDialogTrigger = DialogTrigger;","import { DialogHandle } from \"../dialog/store/DialogHandle.mjs\";\n\n/**\n * Controls an Alert Dialog imperatively and associates detached `AlertDialog.Trigger` components with\n * an `AlertDialog.Root`. Create one with `AlertDialog.createHandle()` and pass it to the `handle`\n * prop of the root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class AlertDialogHandle extends DialogHandle {}\n\n/**\n * Creates a new handle to connect an AlertDialog.Root with detached AlertDialog.Trigger components.\n */\nexport function createAlertDialogHandle() {\n return new AlertDialogHandle();\n}","\"use client\";\nimport * as React from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { XIcon } from \"lucide-react\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Root>) { return <BaseAlertDialog.Root data-slot=\"alert-dialog\" {...props} />; }\nfunction AlertDialogTrigger({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Trigger>) { return <BaseAlertDialog.Trigger data-slot=\"alert-dialog-trigger\" {...props} />; }\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Portal>) { return <BaseAlertDialog.Portal data-slot=\"alert-dialog-portal\" {...props} />; }\nfunction AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof BaseAlertDialog.Backdrop>) { return <BaseAlertDialog.Backdrop data-slot=\"alert-dialog-overlay\" className={cn(\"fixed inset-0\", overlayLayers.modal, \"bg-black/50 data-open:animate-in data-closed:animate-out\", className)} {...props} />; }\nfunction AlertDialogContent({ className, children, ...props }: React.ComponentProps<typeof BaseAlertDialog.Popup>) { return <AlertDialogPortal><AlertDialogOverlay /><BaseAlertDialog.Viewport className={cn(\"fixed inset-0 flex items-center justify-center p-4\", overlayLayers.modal)}><BaseAlertDialog.Popup data-slot=\"alert-dialog-content\" className={cn(\"relative grid w-full max-w-[calc(100%-2rem)] gap-5 rounded-lg border bg-canvas p-5 text-text-primary shadow-lg outline-none sm:max-w-lg sm:p-6\", className)} {...props}>{children}<BaseAlertDialog.Close aria-label=\"Close\" className=\"absolute right-4 top-4 rounded-xs opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus [&_svg]:size-4\"><XIcon /></BaseAlertDialog.Close></BaseAlertDialog.Popup></BaseAlertDialog.Viewport></AlertDialogPortal>; }\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"alert-dialog-header\" className={cn(\"flex flex-col gap-2 text-left\", className)} {...props} />; }\nfunction AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof BaseAlertDialog.Title>) { return <BaseAlertDialog.Title data-slot=\"alert-dialog-title\" className={cn(\"text-base font-semibold\", className)} {...props} />; }\nfunction AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof BaseAlertDialog.Description>) { return <BaseAlertDialog.Description data-slot=\"alert-dialog-description\" className={cn(\"text-sm text-text-supporting\", className)} {...props} />; }\nfunction AlertDialogBody({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"alert-dialog-body\" className={cn(\"text-sm\", className)} {...props} />; }\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) { return <div data-slot=\"alert-dialog-footer\" className={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)} {...props} />; }\nfunction AlertDialogCancel({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Close>) { return <BaseAlertDialog.Close data-slot=\"alert-dialog-cancel\" {...props} />; }\nfunction AlertDialogAction({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Close>) { return <BaseAlertDialog.Close data-slot=\"alert-dialog-action\" {...props} />; }\nfunction AlertDialogClose({ ...props }: React.ComponentProps<typeof BaseAlertDialog.Close>) { return <BaseAlertDialog.Close data-slot=\"alert-dialog-close\" {...props} />; }\nexport { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\n\nimport { cn } from \"./utils\";\n\ntype TabsVariant = \"underline\" | \"segmented\";\ntype TabsSize = \"default\" | \"compact\";\ntype ScrollPosition = \"none\" | \"start\" | \"middle\" | \"end\";\n\ntype TabsVisualContextValue = {\n variant: TabsVariant;\n size: TabsSize;\n};\n\nconst defaultTabsVisualContext: TabsVisualContextValue = {\n variant: \"underline\",\n size: \"default\",\n};\n\nconst TabsRootVisualContext = React.createContext(defaultTabsVisualContext);\nconst TabsListVisualContext = React.createContext(defaultTabsVisualContext);\n\nconst tabRailClasses =\n \"flex min-w-0 items-stretch overflow-x-auto overscroll-x-contain border-b border-border-subtle scroll-px-2 snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\";\n\nconst navigationTabClasses =\n \"relative inline-flex h-full shrink-0 snap-start items-center justify-center gap-2 whitespace-nowrap rounded-t-[var(--ds-radius-control)] px-[var(--ds-tab-padding-x)] text-sm font-medium outline-none transition-[background-color,color,box-shadow] duration-150 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-transparent after:transition-colors hover:bg-surface-muted focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus/60 data-[active=false]:text-text-supporting data-[active=false]:hover:text-text-primary data-[active=true]:bg-selection-background data-[active=true]:font-semibold data-[active=true]:text-selection-foreground data-[active=true]:after:bg-selection-indicator\";\n\nfunction assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n}\n\nfunction useHorizontalScrollRail<T extends HTMLElement>(externalRef?: React.Ref<T>) {\n const internalRef = React.useRef<T | null>(null);\n const [scrollPosition, setScrollPosition] = React.useState<ScrollPosition>(\"none\");\n\n const updateScrollPosition = React.useCallback(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const maximumScroll = element.scrollWidth - element.clientWidth;\n const nextPosition: ScrollPosition =\n maximumScroll <= 1\n ? \"none\"\n : element.scrollLeft <= 1\n ? \"start\"\n : element.scrollLeft >= maximumScroll - 1\n ? \"end\"\n : \"middle\";\n\n setScrollPosition((current) =>\n current === nextPosition ? current : nextPosition,\n );\n }, []);\n\n const ref = React.useCallback(\n (node: T | null) => {\n internalRef.current = node;\n assignRef(externalRef, node);\n },\n [externalRef],\n );\n\n React.useEffect(() => {\n updateScrollPosition();\n const element = internalRef.current;\n if (!element || typeof ResizeObserver === \"undefined\") return;\n\n const observer = new ResizeObserver(updateScrollPosition);\n observer.observe(element);\n return () => observer.disconnect();\n }, [updateScrollPosition]);\n\n return [scrollPosition, ref, updateScrollPosition] as const;\n}\n\nfunction Tabs({\n className,\n variant = \"underline\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof BaseTabs.Root> & {\n variant?: TabsVariant;\n size?: TabsSize;\n}) {\n return (\n <TabsRootVisualContext.Provider value={{ variant, size }}>\n <BaseTabs.Root\n data-slot=\"tabs\"\n data-variant={variant}\n data-size={size}\n className={cn(\"flex min-w-0 flex-col gap-2\", className)}\n {...props}\n />\n </TabsRootVisualContext.Provider>\n );\n}\n\nfunction TabsList({\n className,\n variant,\n size,\n children,\n ref: externalRef,\n onScroll,\n ...props\n}: React.ComponentProps<typeof BaseTabs.List> & {\n variant?: TabsVariant;\n size?: TabsSize;\n}) {\n const rootVisuals = React.useContext(TabsRootVisualContext);\n const resolvedVariant = variant ?? rootVisuals.variant;\n const resolvedSize = size ?? rootVisuals.size;\n const [scrollPosition, scrollRailRef, updateScrollPosition] =\n useHorizontalScrollRail<HTMLDivElement>(externalRef);\n\n return (\n <BaseTabs.List\n data-slot=\"tabs-list\"\n data-variant={resolvedVariant}\n data-size={resolvedSize}\n data-scroll-position={\n resolvedVariant === \"underline\" ? scrollPosition : undefined\n }\n ref={scrollRailRef}\n onScroll={(event) => {\n updateScrollPosition();\n onScroll?.(event);\n }}\n className={cn(\n \"text-text-supporting\",\n resolvedVariant === \"underline\" && tabRailClasses,\n resolvedVariant === \"underline\" &&\n (resolvedSize === \"compact\"\n ? \"h-[var(--ds-tab-rail-height-compact)]\"\n : \"h-[var(--ds-tab-rail-height)]\"),\n resolvedVariant === \"segmented\" &&\n \"inline-flex h-[var(--ds-control-height)] items-center gap-1 self-start rounded-md bg-surface-muted p-1\",\n className,\n )}\n {...props}\n >\n <TabsListVisualContext.Provider\n value={{ variant: resolvedVariant, size: resolvedSize }}\n >\n {children}\n </TabsListVisualContext.Provider>\n </BaseTabs.List>\n );\n}\n\nfunction TabsTrigger({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Tab> & {\n variant?: TabsVariant;\n size?: TabsSize;\n}) {\n const listVisuals = React.useContext(TabsListVisualContext);\n const resolvedVariant = variant ?? listVisuals.variant;\n const resolvedSize = size ?? listVisuals.size;\n\n return (\n <BaseTabs.Tab\n data-slot=\"tabs-trigger\"\n data-variant={resolvedVariant}\n data-size={resolvedSize}\n className={cn(\n \"disabled:pointer-events-none disabled:opacity-50\",\n resolvedVariant === \"underline\" &&\n cn(\n navigationTabClasses,\n \"data-active:bg-selection-background data-active:font-semibold data-active:text-selection-foreground data-active:after:bg-selection-indicator\",\n ),\n resolvedVariant === \"segmented\" &&\n \"inline-flex h-full items-center justify-center gap-2 whitespace-nowrap rounded-[calc(var(--ds-radius-control)-2px)] px-3 text-sm font-medium text-text-supporting outline-none transition-[background-color,color,box-shadow] hover:text-text-primary focus-visible:ring-2 focus-visible:ring-focus/60 data-active:bg-canvas data-active:text-text-primary data-active:shadow-xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Panel>) {\n return (\n <BaseTabs.Panel\n data-slot=\"tabs-content\"\n className={cn(\n \"outline-none focus-visible:ring-2 focus-visible:ring-focus/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationTabs({\n className,\n ...props\n}: React.ComponentProps<\"nav\">) {\n return (\n <nav\n data-slot=\"navigation-tabs\"\n className={cn(\"min-w-0\", className)}\n {...props}\n />\n );\n}\n\nfunction NavigationTabsList({\n className,\n ref: externalRef,\n onScroll,\n ...props\n}: React.ComponentProps<\"div\">) {\n const [scrollPosition, scrollRailRef, updateScrollPosition] =\n useHorizontalScrollRail<HTMLDivElement>(externalRef);\n\n return (\n <div\n data-slot=\"navigation-tabs-list\"\n data-scroll-position={scrollPosition}\n ref={scrollRailRef}\n onScroll={(event) => {\n updateScrollPosition();\n onScroll?.(event);\n }}\n className={cn(\n tabRailClasses,\n \"h-[var(--ds-tab-rail-height)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationTab({\n className,\n active = false,\n ref: externalRef,\n ...props\n}: React.ComponentProps<\"a\"> & {\n active?: boolean;\n}) {\n const Comp = \"a\";\n const internalRef = React.useRef<HTMLAnchorElement | null>(null);\n const ref = React.useCallback(\n (node: HTMLAnchorElement | null) => {\n internalRef.current = node;\n assignRef(externalRef, node);\n },\n [externalRef],\n );\n\n React.useEffect(() => {\n if (!active) return;\n internalRef.current?.scrollIntoView({\n behavior: \"auto\",\n block: \"nearest\",\n inline: \"nearest\",\n });\n }, [active]);\n\n return (\n <Comp\n {...props}\n data-slot=\"navigation-tab\"\n data-active={active ? \"true\" : \"false\"}\n aria-current={active ? \"page\" : undefined}\n ref={ref}\n className={cn(\n navigationTabClasses,\n className,\n )}\n />\n );\n}\n\nexport {\n NavigationTab,\n NavigationTabs,\n NavigationTabsList,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n};\nexport type { TabsSize, TabsVariant };\n","export { TabsRoot as Root } from \"./root/TabsRoot.mjs\";\nexport { TabsTab as Tab } from \"./tab/TabsTab.mjs\";\nexport { TabsIndicator as Indicator } from \"./indicator/TabsIndicator.mjs\";\nexport { TabsPanel as Panel } from \"./panel/TabsPanel.mjs\";\nexport { TabsList as List } from \"./list/TabsList.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { TabsRootContext } from \"./TabsRootContext.mjs\";\nimport { tabsStateAttributesMapping } from \"./stateAttributesMapping.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Groups the tabs and the corresponding panels.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TabsRoot = /*#__PURE__*/React.forwardRef(function TabsRoot(componentProps, forwardedRef) {\n const {\n className,\n defaultValue: defaultValueProp = 0,\n onValueChange: onValueChangeProp,\n orientation = 'horizontal',\n render,\n value: valueProp,\n style,\n ...elementProps\n } = componentProps;\n\n // Track whether the user explicitly provided a defined `defaultValue` prop.\n // Used to determine if we should honor a disabled tab selection.\n const hasExplicitDefaultValueProp = componentProps.defaultValue !== undefined;\n const tabPanelRefs = React.useRef([]);\n const [mountedTabPanels, setMountedTabPanels] = React.useState(() => new Map());\n const [value, setValue] = useControlled({\n controlled: valueProp,\n default: defaultValueProp,\n name: 'Tabs',\n state: 'value'\n });\n const isControlled = valueProp !== undefined;\n const [tabMap, setTabMap] = React.useState(() => new Map());\n const lastKnownTabElementRef = React.useRef(undefined);\n\n // Used for activation direction detection via tab element positions.\n const getTabElementBySelectedValue = React.useCallback(selectedValue => findTabElement(tabMap, selectedValue), [tabMap]);\n const [activationDirectionState, setActivationDirectionState] = React.useState(() => ({\n previousValue: value,\n tabActivationDirection: 'none'\n }));\n const {\n previousValue,\n tabActivationDirection: committedTabActivationDirection\n } = activationDirectionState;\n let tabActivationDirection = committedTabActivationDirection;\n let directionComputationIncomplete = false;\n\n // Compute activation direction during render when value changes so children see\n // the correct direction on their very first render after the selection update.\n // The previous value snapshot is stored in state and synced after commit.\n // https://github.com/mui/base-ui/issues/3873\n if (previousValue !== value) {\n tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);\n\n // When a new tab is added and selected in the same controlled update,\n // the tab element may not yet be registered in tabMap, so direction was\n // computed from a value-based fallback. Keep the previous value snapshot\n // stale so we re-compute from DOM positions once tabMap is up to date.\n directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;\n }\n const nextPreviousValue = directionComputationIncomplete ? previousValue : value;\n const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;\n useIsoLayoutEffect(() => {\n if (!shouldSyncActivationDirectionState) {\n return;\n }\n setActivationDirectionState({\n previousValue: nextPreviousValue,\n tabActivationDirection\n });\n }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);\n const onValueChange = useStableCallback((newValue, eventDetails) => {\n const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);\n eventDetails.activationDirection = activationDirection;\n onValueChangeProp?.(newValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValue(newValue);\n });\n const notifyAutomaticValueChange = useStableCallback((nextValue, reason) => {\n onValueChangeProp?.(nextValue, createChangeEventDetails(reason, undefined, undefined, {\n activationDirection: 'none'\n }));\n });\n const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {\n setMountedTabPanels(prev => {\n const next = new Map(prev);\n next.set(panelValue, panelId);\n return next;\n });\n return () => {\n setMountedTabPanels(prev => {\n // Another panel with the same value took ownership in the meantime;\n // leave its registration in place.\n if (prev.get(panelValue) !== panelId) {\n return prev;\n }\n const next = new Map(prev);\n next.delete(panelValue);\n return next;\n });\n };\n });\n\n // get the `id` attribute of <Tabs.Panel> to set as the value of `aria-controls` on <Tabs.Tab>\n const getTabPanelIdByValue = React.useCallback(tabValue => {\n return mountedTabPanels.get(tabValue);\n }, [mountedTabPanels]);\n\n // get the `id` attribute of <Tabs.Tab> to set as the value of `aria-labelledby` on <Tabs.Panel>\n const getTabIdByPanelValue = React.useCallback(tabPanelValue => {\n for (const tabMetadata of tabMap.values()) {\n if (tabPanelValue === tabMetadata.value) {\n return tabMetadata.id;\n }\n }\n return undefined;\n }, [tabMap]);\n const tabsContextValue = React.useMemo(() => ({\n getTabElementBySelectedValue,\n getTabIdByPanelValue,\n getTabPanelIdByValue,\n onValueChange,\n orientation,\n registerMountedTabPanel,\n setTabMap,\n tabActivationDirection,\n value\n }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]);\n const selectedTabMetadata = React.useMemo(() => {\n for (const tabMetadata of tabMap.values()) {\n if (tabMetadata.value === value) {\n return tabMetadata;\n }\n }\n return undefined;\n }, [tabMap, value]);\n\n // Find the first non-disabled tab value.\n // Used as a fallback when the current selection is disabled or missing.\n const firstEnabledTabValue = React.useMemo(() => {\n for (const tabMetadata of tabMap.values()) {\n if (!tabMetadata.disabled) {\n return tabMetadata.value;\n }\n }\n return undefined;\n }, [tabMap]);\n\n // Implicit uncontrolled selections are still automatic changes, so notify\n // once when the tabs first register. Explicit defaults are treated as user-owned.\n const shouldNotifyInitialValueChangeRef = React.useRef(!hasExplicitDefaultValueProp);\n // useControlled warns if defaultValue changes after mount, but the\n // disabled-default honor policy below still needs a stable initial value.\n const initialDefaultValueRef = React.useRef(defaultValueProp);\n // An explicit defaultValue can intentionally point at a disabled tab on mount.\n // Once that selection becomes valid, later disabled states should fall back.\n const shouldHonorDisabledDefaultValueRef = React.useRef(hasExplicitDefaultValueProp);\n const didRegisterTabsRef = React.useRef(false);\n\n // Uncontrolled roots own automatic fallback. Controlled roots keep the exact\n // value supplied by the parent, even when that tab is disabled or missing.\n useIsoLayoutEffect(() => {\n if (isControlled) {\n return;\n }\n function commitAutomaticValueChange(fallbackValue, fallbackReason) {\n setValue(fallbackValue);\n // Automatic fallbacks are not directional transitions; reset the direction\n // alongside the value so the batched commit keeps both in sync.\n setActivationDirectionState({\n previousValue: fallbackValue,\n tabActivationDirection: 'none'\n });\n notifyAutomaticValueChange(fallbackValue, fallbackReason);\n // Mark the initial notification as delivered only after the consumer\n // callback returns. The fallback value is queued first so automatic\n // consistency updates are not cancelable through a throwing handler.\n shouldNotifyInitialValueChangeRef.current = false;\n }\n if (tabMap.size === 0) {\n // A Suspense boundary outside the root can clean up layout effects while\n // keeping the previous tabs connected. Don't treat that as removal.\n if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) {\n commitAutomaticValueChange(null, REASONS.missing);\n }\n return;\n }\n didRegisterTabsRef.current = true;\n lastKnownTabElementRef.current = tabMap.keys().next().value;\n const selectionIsDisabled = selectedTabMetadata?.disabled;\n const selectionIsMissing = selectedTabMetadata == null && value !== null;\n if (!selectionIsDisabled && value === initialDefaultValueRef.current) {\n shouldHonorDisabledDefaultValueRef.current = false;\n }\n if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) {\n return;\n }\n const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current;\n if (selectionIsDisabled || selectionIsMissing) {\n const fallbackValue = firstEnabledTabValue ?? null;\n if (value === fallbackValue) {\n // Already at the fallback value; no commit or notification needed,\n // but record that the implicit-initial transition has resolved.\n shouldNotifyInitialValueChangeRef.current = false;\n return;\n }\n let fallbackReason = REASONS.missing;\n if (shouldNotifyInitialValueChange) {\n fallbackReason = REASONS.initial;\n } else if (selectionIsDisabled) {\n fallbackReason = REASONS.disabled;\n }\n commitAutomaticValueChange(fallbackValue, fallbackReason);\n return;\n }\n if (shouldNotifyInitialValueChange && selectedTabMetadata != null) {\n notifyAutomaticValueChange(value, REASONS.initial);\n shouldNotifyInitialValueChangeRef.current = false;\n }\n }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]);\n const state = {\n orientation,\n tabActivationDirection\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: tabsStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(TabsRootContext.Provider, {\n value: tabsContextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: tabPanelRefs,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsRoot.displayName = \"TabsRoot\";\nfunction findTabElement(tabMap, value) {\n for (const [tabElement, tabMetadata] of tabMap.entries()) {\n if (value === tabMetadata.value) {\n return tabElement;\n }\n }\n return null;\n}\nfunction computeActivationDirection(oldValue, newValue, orientation, tabMap) {\n if (oldValue == null || newValue == null) {\n return 'none';\n }\n const [positionProp, backward, forward] = orientation === 'horizontal' ? ['left', 'left', 'right'] : ['top', 'up', 'down'];\n const oldTab = findTabElement(tabMap, oldValue);\n const newTab = findTabElement(tabMap, newValue);\n if (oldTab == null || newTab == null) {\n // Fallback for dynamic tabs: when a tab element isn't registered yet\n // (e.g. added and selected in the same update), infer direction from\n // the values themselves. Works for comparable types (numbers, strings).\n if (oldTab !== newTab && (typeof oldValue === 'number' || typeof oldValue === 'string') && typeof oldValue === typeof newValue) {\n return newValue > oldValue ? forward : backward;\n }\n return 'none';\n }\n const oldPosition = oldTab.getBoundingClientRect()[positionProp];\n const newPosition = newTab.getBoundingClientRect()[positionProp];\n if (newPosition < oldPosition) {\n return backward;\n }\n if (newPosition > oldPosition) {\n return forward;\n }\n return 'none';\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\n/**\n * @internal\n */\nexport const TabsRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TabsRootContext.displayName = \"TabsRootContext\";\nexport function useTabsRootContext() {\n const context = React.useContext(TabsRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.' : _formatErrorMessage(64));\n }\n return context;\n}","export const tabsStateAttributesMapping = {\n tabActivationDirection: dir => ({\n 'data-activation-direction': dir\n })\n};","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../../internals/composite/constants.mjs\";\nimport { useCompositeItem } from \"../../internals/composite/item/useCompositeItem.mjs\";\nimport { useCompositeRootContext } from \"../../internals/composite/root/CompositeRootContext.mjs\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.mjs\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useTabsListContext } from \"../list/TabsListContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { activeElement, contains } from \"../../floating-ui-react/utils.mjs\";\n\n/**\n * An individual interactive tab button that toggles the corresponding panel.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsTab = /*#__PURE__*/React.forwardRef(function TabsTab(componentProps, forwardedRef) {\n const {\n className,\n disabled = false,\n render,\n value,\n id: idProp,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n value: activeTabValue,\n getTabPanelIdByValue,\n onValueChange,\n orientation,\n tabActivationDirection\n } = useTabsRootContext();\n const {\n activateOnFocus,\n registerTabResizeObserverElement,\n tabsListElement\n } = useTabsListContext();\n const {\n highlightedIndex,\n onHighlightedIndexChange\n } = useCompositeRootContext();\n const id = useBaseUiId(idProp);\n const tabMetadata = React.useMemo(() => ({\n disabled,\n id,\n value\n }), [disabled, id, value]);\n const {\n compositeProps,\n compositeRef,\n index\n // hook is used instead of the CompositeItem component\n // because the index is needed for Tab internals\n } = useCompositeItem({\n metadata: tabMetadata\n });\n const active = value === activeTabValue;\n const isNavigatingRef = React.useRef(false);\n const unobserveTabElementRef = React.useRef(null);\n\n // Registered from the ref callback rather than an effect so the observer\n // follows the rendered element when the `render` prop swaps the host element.\n const observeTabElement = useStableCallback(element => {\n unobserveTabElementRef.current?.();\n unobserveTabElementRef.current = element ? registerTabResizeObserverElement(element) : null;\n });\n\n // Keep the highlighted item in sync with the currently active tab\n // when the value prop changes externally (controlled mode)\n useIsoLayoutEffect(() => {\n if (isNavigatingRef.current) {\n isNavigatingRef.current = false;\n return;\n }\n if (!(active && index > -1 && highlightedIndex !== index)) {\n return;\n }\n\n // If focus is currently within the tabs list, don't override the roving\n // focus highlight. This keeps keyboard navigation relative to the focused\n // item after an external/asynchronous selection change.\n const listElement = tabsListElement;\n if (listElement != null) {\n const activeEl = activeElement(ownerDocument(listElement));\n if (activeEl && contains(listElement, activeEl)) {\n return;\n }\n }\n\n // Don't highlight disabled tabs to prevent them from interfering with keyboard navigation.\n // Keyboard focus (tabIndex) should remain on an enabled tab even when a disabled tab is selected.\n if (!disabled) {\n onHighlightedIndexChange(index);\n }\n }, [active, index, highlightedIndex, onHighlightedIndexChange, disabled, tabsListElement]);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton,\n focusableWhenDisabled: true\n });\n const tabPanelId = getTabPanelIdByValue(value);\n const isPressingRef = React.useRef(false);\n const isMainButtonRef = React.useRef(false);\n\n // Both callers guard on `!active`, so the current value is never re-committed.\n function activate(event) {\n onValueChange(value, createChangeEventDetails(REASONS.none, event.nativeEvent, undefined, {\n activationDirection: 'none'\n }));\n }\n function onClick(event) {\n if (active || disabled) {\n return;\n }\n activate(event);\n }\n function onFocus(event) {\n if (active || disabled) {\n return;\n }\n if (activateOnFocus && (!isPressingRef.current ||\n // keyboard or touch focus\n isMainButtonRef.current) // main mouse button focus\n ) {\n activate(event);\n }\n }\n function onPointerDown(event) {\n if (active || disabled) {\n return;\n }\n isPressingRef.current = true;\n // Secondary presses (context menu, middle click) may focus the tab, but\n // must not activate it with `activateOnFocus`.\n isMainButtonRef.current = event.button === 0;\n\n // Registered for every button so a secondary press doesn't leave the tab\n // stuck in the pressing state, which would suppress later focus activation.\n const doc = ownerDocument(event.currentTarget);\n function handlePointerEnd() {\n isPressingRef.current = false;\n isMainButtonRef.current = false;\n doc.removeEventListener('pointerup', handlePointerEnd);\n doc.removeEventListener('pointercancel', handlePointerEnd);\n }\n doc.addEventListener('pointerup', handlePointerEnd);\n doc.addEventListener('pointercancel', handlePointerEnd);\n }\n const state = {\n disabled,\n active,\n orientation,\n tabActivationDirection\n };\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef, compositeRef, observeTabElement],\n props: [compositeProps, {\n role: 'tab',\n 'aria-controls': tabPanelId,\n 'aria-selected': active,\n id,\n onClick,\n onFocus,\n onPointerDown,\n [ACTIVE_COMPOSITE_ITEM]: active ? '' : undefined,\n onKeyDownCapture() {\n isNavigatingRef.current = true;\n }\n }, elementProps, getButtonProps],\n stateAttributesMapping: tabsStateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TabsTab.displayName = \"TabsTab\";","export const ACTIVE_COMPOSITE_ITEM = 'data-composite-item-active';","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useCompositeRootContext } from \"../root/CompositeRootContext.mjs\";\nimport { useCompositeListItem } from \"../list/useCompositeListItem.mjs\";\nexport function useCompositeItem(params = {}) {\n const {\n highlightItemOnHover,\n highlightedIndex,\n onHighlightedIndexChange\n } = useCompositeRootContext();\n const {\n ref,\n index\n } = useCompositeListItem(params);\n const isHighlighted = highlightedIndex === index;\n const itemRef = React.useRef(null);\n const mergedRef = useMergedRefs(ref, itemRef);\n const compositeProps = {\n tabIndex: isHighlighted ? 0 : -1,\n onFocus() {\n onHighlightedIndexChange(index);\n },\n onMouseMove() {\n const item = itemRef.current;\n if (!highlightItemOnHover || !item) {\n return;\n }\n const disabled = item.hasAttribute('disabled') || item.ariaDisabled === 'true';\n if (!isHighlighted && !disabled) {\n item.focus();\n }\n }\n };\n return {\n compositeProps,\n compositeRef: mergedRef,\n index\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TabsListContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TabsListContext.displayName = \"TabsListContext\";\nexport function useTabsListContext() {\n const context = React.useContext(TabsListContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.' : _formatErrorMessage(65));\n }\n return context;\n}","'use client';\n\nvar _PrehydrationScript;\nimport * as React from 'react';\nimport { useForcedRerendering } from '@base-ui/utils/useForcedRerendering';\nimport { script as prehydrationScript } from '#prehydration/tabs/indicator';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { getCssDimensions } from \"../../utils/getCssDimensions.mjs\";\nimport { PrehydrationScript } from \"../../internals/PrehydrationScript.mjs\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.mjs\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useTabsListContext } from \"../list/TabsListContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...tabsStateAttributesMapping,\n activeTabPosition: () => null,\n activeTabSize: () => null\n};\n\n/**\n * A visual indicator that can be styled to match the position of the currently active tab.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsIndicator = /*#__PURE__*/React.forwardRef(function TabsIndicator(componentProps, forwardedRef) {\n const {\n className,\n render,\n renderBeforeHydration = false,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const {\n getTabElementBySelectedValue,\n orientation,\n tabActivationDirection,\n value\n } = useTabsRootContext();\n const {\n tabsListElement,\n registerIndicatorUpdateListener\n } = useTabsListContext();\n const rerender = useForcedRerendering();\n React.useEffect(() => {\n return registerIndicatorUpdateListener(rerender);\n }, [registerIndicatorUpdateListener, rerender]);\n let left = 0;\n let right = 0;\n let top = 0;\n let bottom = 0;\n let width = 0;\n let height = 0;\n let isTabSelected = false;\n if (value != null && tabsListElement != null) {\n const activeTab = getTabElementBySelectedValue(value);\n if (activeTab != null) {\n isTabSelected = true;\n const {\n width: computedWidth,\n height: computedHeight\n } = getCssDimensions(activeTab);\n const {\n width: tabListWidth,\n height: tabListHeight\n } = getCssDimensions(tabsListElement);\n const tabRect = activeTab.getBoundingClientRect();\n const tabsListRect = tabsListElement.getBoundingClientRect();\n const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;\n const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;\n const hasNonZeroScale = scaleX > Number.EPSILON && scaleY > Number.EPSILON;\n if (hasNonZeroScale) {\n const tabLeftDelta = tabRect.left - tabsListRect.left;\n const tabTopDelta = tabRect.top - tabsListRect.top;\n left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;\n top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;\n } else {\n left = activeTab.offsetLeft;\n top = activeTab.offsetTop;\n }\n width = computedWidth;\n height = computedHeight;\n right = tabsListElement.scrollWidth - left - width;\n bottom = tabsListElement.scrollHeight - top - height;\n }\n }\n const activeTabPosition = isTabSelected ? {\n left,\n right,\n top,\n bottom\n } : null;\n const activeTabSize = isTabSelected ? {\n width,\n height\n } : null;\n const style = isTabSelected ? {\n '--active-tab-left': `${left}px`,\n '--active-tab-right': `${right}px`,\n '--active-tab-top': `${top}px`,\n '--active-tab-bottom': `${bottom}px`,\n '--active-tab-width': `${width}px`,\n '--active-tab-height': `${height}px`\n } : undefined;\n const displayIndicator = isTabSelected && width > 0 && height > 0;\n const state = {\n orientation,\n activeTabPosition,\n activeTabSize,\n tabActivationDirection\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'presentation',\n style,\n hidden: !displayIndicator // do not display the indicator before the layout is settled\n }, elementProps, {\n suppressHydrationWarning: true\n }],\n stateAttributesMapping\n });\n if (value == null) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /*#__PURE__*/_jsx(PrehydrationScript, {\n script: prehydrationScript\n })))]\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsIndicator.displayName = \"TabsIndicator\";","// Shared browser-bundle replacement for the per-component `prehydrationScript.min.ts` files,\n// selected via the `browser` condition of every `#prehydration/*` entry in package.json\n// `imports`. The real scripts only ever execute from server-rendered HTML, so client bundles\n// don't need their contents. See `internals/PrehydrationScript.tsx` for why an empty script is\n// still rendered during hydration.\nexport const script = '';","'use client';\n\nimport * as React from 'react';\nimport { useIsHydrating } from \"../utils/useIsHydrating.mjs\";\nimport { useCSPContext } from \"./csp-context/CSPContext.mjs\";\n\n/**\n * Renders an inline script that runs before React hydrates, used by components that need\n * to position server-rendered content ahead of hydration (e.g. `Tabs.Indicator`,\n * `Slider.Thumb`).\n *\n * The `script` source is imported by the caller through the package's `#prehydration/*`\n * subpath import, whose `browser` condition resolves to a stub module exporting an empty\n * string — so the script body is excluded from client bundles. It only ever executes from\n * server-rendered HTML.\n *\n * Render this only when the script should be emitted (i.e. gate `renderBeforeHydration`\n * and any structural conditions at the call site). The element is still rendered (with\n * empty content) on the client during the hydration pass so the React tree matches the\n * server markup; `suppressHydrationWarning` bridges the content difference and React keeps\n * the already-executed server script. Once `isHydrating` flips to `false` the element\n * unmounts.\n *\n * The component must stay in client bundles: returning `null` on the client (e.g. by\n * stubbing the whole component) would drop an element the server emitted and trigger a\n * recoverable hydration error (React #418) in consumers' apps. Only the script body is\n * excluded from client bundles, via the `#prehydration/*` `browser` condition.\n *\n * When adding a new consumer, register a matching `#prehydration/*` entry (with `browser`\n * and `default` conditions) in `packages/react/package.json` `imports`; the `browser`\n * condition reuses the shared `internals/prehydrationScript.stub.ts`.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function PrehydrationScript(props) {\n const {\n script\n } = props;\n const {\n nonce\n } = useCSPContext();\n const isHydrating = useIsHydrating();\n if (!isHydrating) {\n return null;\n }\n return /*#__PURE__*/_jsx(\"script\", {\n nonce: nonce\n // eslint-disable-next-line react/no-danger\n ,\n dangerouslySetInnerHTML: {\n __html: script\n },\n suppressHydrationWarning: true\n });\n}","import { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from \"../internals/noop.mjs\";\nfunction subscribe() {\n return NOOP;\n}\nfunction getSnapshot() {\n return false;\n}\nfunction getServerSnapshot() {\n return true;\n}\n\n/**\n * Returns `true` while React is hydrating server-rendered markup and `false`\n * for fresh client-only mounts.\n */\nexport function useIsHydrating() {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.mjs\";\nconst stateAttributesMapping = {\n ...tabsStateAttributesMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A panel displayed when the corresponding tab is active.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsPanel = /*#__PURE__*/React.forwardRef(function TabsPanel(componentProps, forwardedRef) {\n const {\n className,\n value,\n render,\n keepMounted = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n value: selectedValue,\n getTabIdByPanelValue,\n orientation,\n tabActivationDirection,\n registerMountedTabPanel\n } = useTabsRootContext();\n const id = useBaseUiId();\n const {\n ref: listItemRef,\n index\n } = useCompositeListItem();\n const open = value === selectedValue;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(open);\n const hidden = !mounted;\n const correspondingTabId = getTabIdByPanelValue(value);\n const state = {\n hidden,\n orientation,\n tabActivationDirection,\n transitionStatus\n };\n const panelRef = React.useRef(null);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, listItemRef, panelRef],\n props: [{\n 'aria-labelledby': correspondingTabId,\n hidden,\n id,\n role: 'tabpanel',\n tabIndex: open ? 0 : -1,\n inert: inertValue(!open),\n // Computed key: a plain literal key fails the DOM-props excess property check.\n ['data-index']: index\n }, elementProps],\n stateAttributesMapping\n });\n useOpenChangeComplete({\n open,\n ref: panelRef,\n onComplete() {\n if (!open) {\n setMounted(false);\n }\n }\n });\n useIsoLayoutEffect(() => {\n // On React 17 `useId` resolves in a passive effect, so `id` is still\n // undefined during this layout effect on the first commit. Skip the\n // registration until the effect re-runs with the resolved id.\n if (id == null || hidden && !keepMounted) {\n return undefined;\n }\n return registerMountedTabPanel(value, id);\n }, [hidden, keepMounted, value, id, registerMountedTabPanel]);\n const shouldRender = keepMounted || mounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TabsPanel.displayName = \"TabsPanel\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { CompositeRoot } from \"../../internals/composite/root/CompositeRoot.mjs\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.mjs\";\nimport { TabsListContext } from \"./TabsListContext.mjs\";\n\n/**\n * Groups the individual tab buttons.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TabsList = /*#__PURE__*/React.forwardRef(function TabsList(componentProps, forwardedRef) {\n const {\n activateOnFocus = false,\n className,\n loopFocus = true,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n orientation,\n setTabMap,\n tabActivationDirection\n } = useTabsRootContext();\n const [highlightedTabIndex, setHighlightedTabIndex] = React.useState(0);\n const [tabsListElement, setTabsListElement] = React.useState(null);\n const indicatorUpdateListenersRef = React.useRef(new Set());\n const tabResizeObserverElementsRef = React.useRef(new Set());\n const resizeObserverRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (typeof ResizeObserver === 'undefined') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(() => {\n indicatorUpdateListenersRef.current.forEach(listener => {\n listener();\n });\n });\n resizeObserverRef.current = resizeObserver;\n if (tabsListElement) {\n resizeObserver.observe(tabsListElement);\n }\n tabResizeObserverElementsRef.current.forEach(element => {\n resizeObserver.observe(element);\n });\n return () => {\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [tabsListElement]);\n const registerIndicatorUpdateListener = useStableCallback(listener => {\n indicatorUpdateListenersRef.current.add(listener);\n return () => {\n indicatorUpdateListenersRef.current.delete(listener);\n };\n });\n const registerTabResizeObserverElement = useStableCallback(element => {\n tabResizeObserverElementsRef.current.add(element);\n resizeObserverRef.current?.observe(element);\n return () => {\n tabResizeObserverElementsRef.current.delete(element);\n resizeObserverRef.current?.unobserve(element);\n };\n });\n const state = {\n orientation,\n tabActivationDirection\n };\n const defaultProps = {\n 'aria-orientation': orientation === 'vertical' ? 'vertical' : undefined,\n role: 'tablist'\n };\n const tabsListContextValue = React.useMemo(() => ({\n activateOnFocus,\n registerIndicatorUpdateListener,\n registerTabResizeObserverElement,\n tabsListElement\n }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]);\n return /*#__PURE__*/_jsx(TabsListContext.Provider, {\n value: tabsListContextValue,\n children: /*#__PURE__*/_jsx(CompositeRoot, {\n render: render,\n className: className,\n style: style,\n state: state,\n refs: [forwardedRef, setTabsListElement],\n props: [defaultProps, elementProps],\n stateAttributesMapping: tabsStateAttributesMapping,\n highlightedIndex: highlightedTabIndex,\n enableHomeAndEndKeys: true,\n loopFocus: loopFocus,\n orientation: orientation,\n onHighlightedIndexChange: setHighlightedTabIndex,\n onMapChange: setTabMap,\n disabledIndices: EMPTY_ARRAY\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsList.displayName = \"TabsList\";","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { CompositeList } from \"../list/CompositeList.mjs\";\nimport { useCompositeRoot } from \"./useCompositeRoot.mjs\";\nimport { CompositeRootContext } from \"./CompositeRootContext.mjs\";\nimport { useRenderElement } from \"../../useRenderElement.mjs\";\nimport { useDirection } from \"../../direction-context/DirectionContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function CompositeRoot(componentProps) {\n const {\n render,\n className,\n style,\n refs = EMPTY_ARRAY,\n props = EMPTY_ARRAY,\n state = EMPTY_OBJECT,\n stateAttributesMapping,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n orientation,\n grid,\n loopFocus,\n onLoop,\n enableHomeAndEndKeys,\n onMapChange: onMapChangeProp,\n stopEventPropagation = true,\n rootRef,\n disabledIndices,\n modifierKeys,\n highlightItemOnHover = false,\n tag = 'div',\n ...elementProps\n } = componentProps;\n const direction = useDirection();\n const {\n props: defaultProps,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n onMapChange: onMapChangeUnwrapped,\n relayKeyboardEvent\n } = useCompositeRoot({\n grid,\n loopFocus,\n onLoop,\n orientation,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n rootRef,\n stopEventPropagation,\n enableHomeAndEndKeys,\n direction,\n disabledIndices,\n modifierKeys\n });\n const element = useRenderElement(tag, componentProps, {\n state,\n ref: refs,\n props: [defaultProps, ...props, elementProps],\n stateAttributesMapping\n });\n const contextValue = React.useMemo(() => ({\n highlightedIndex,\n onHighlightedIndexChange,\n highlightItemOnHover,\n relayKeyboardEvent\n }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);\n return /*#__PURE__*/_jsx(CompositeRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: elementsRef,\n onMapChange: newMap => {\n onMapChangeProp?.(newMap);\n onMapChangeUnwrapped(newMap);\n },\n children: element\n })\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { COMPOSITE_KEYS, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, END, HOME, MODIFIER_KEYS, findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isListIndexDisabled, isIndexOutOfListBounds, isNativeInput, scrollIntoViewIfNeeded } from \"../composite.mjs\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../constants.mjs\";\nimport { getTarget } from \"../../../floating-ui-react/utils.mjs\";\nconst EMPTY_ARRAY = [];\nexport function useCompositeRoot(params) {\n const {\n loopFocus = true,\n orientation = 'both',\n grid,\n onLoop,\n direction,\n highlightedIndex: externalHighlightedIndex,\n onHighlightedIndexChange: externalSetHighlightedIndex,\n rootRef: externalRef,\n enableHomeAndEndKeys = false,\n stopEventPropagation,\n disabledIndices,\n modifierKeys = EMPTY_ARRAY\n } = params;\n const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);\n const isGrid = grid != null;\n const rootRef = React.useRef(null);\n const mergedRef = useMergedRefs(rootRef, externalRef);\n const elementsRef = React.useRef([]);\n const hasSetDefaultIndexRef = React.useRef(false);\n const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;\n const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {\n (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);\n if (shouldScrollIntoView) {\n const newActiveItem = elementsRef.current[index];\n scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);\n }\n });\n const onMapChange = useStableCallback(map => {\n if (map.size === 0 || hasSetDefaultIndexRef.current) {\n return;\n }\n hasSetDefaultIndexRef.current = true;\n const sortedElements = Array.from(map.keys());\n const activeItem = sortedElements.find(compositeElement => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;\n // Set the default highlighted index of an arbitrary composite item. The map value carries\n // the item's own index, which is not its position among the keys once a list mixes explicit\n // and automatic indexes and leaves gaps.\n const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;\n if (activeIndex !== -1) {\n onHighlightedIndexChange(activeIndex);\n } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {\n // The default highlighted item is disabled, so it should not hold the single\n // roving tab stop: a natively disabled element is removed from the tab order,\n // and an aria-disabled one should not be the entry point. Move the tab stop\n // to the first enabled item. If every item is disabled, keep the current\n // highlighted index.\n const firstEnabledIndex = findNonDisabledListIndex(sortedElements, {\n disabledIndices\n });\n if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) {\n onHighlightedIndexChange(firstEnabledIndex);\n }\n }\n scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);\n });\n useIsoLayoutEffect(() => {\n // `disabledIndices` can resolve a render after the initial map population\n // (e.g. Toolbar derives it from item metadata through a state update), so the\n // default tab stop at index 0 may now point at a disabled item, leaving the\n // composite without a reachable tab stop. Re-validate and move it to the first\n // enabled item. Gated on `disabledIndices` being provided so composites that\n // rely on the DOM disabled fallback keep their existing behavior.\n if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) {\n return;\n }\n const elements = elementsRef.current;\n if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {\n const firstEnabledIndex = findNonDisabledListIndex(elements, {\n disabledIndices\n });\n if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) {\n onHighlightedIndexChange(firstEnabledIndex);\n }\n }\n }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]);\n const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {\n if (!onLoop) {\n return nextIndex;\n }\n return onLoop(event, prevIndex, nextIndex, elementsRef);\n });\n\n // Stable so that `relayKeyboardEvent` does not invalidate identity-sensitive\n // consumers (the `CompositeRootContext` value and trigger data forwarding).\n const onKeyDown = useStableCallback(event => {\n const isHomeOrEnd = event.key === HOME || event.key === END;\n if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) {\n return;\n }\n if (isModifierKeySet(event, modifierKeys)) {\n return;\n }\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const isRtl = direction === 'rtl';\n const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;\n const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;\n const forwardKey = orientation === 'vertical' ? ARROW_DOWN : horizontalForwardKey;\n const backwardKey = orientation === 'vertical' ? ARROW_UP : horizontalBackwardKey;\n const target = getTarget(event.nativeEvent);\n if (target != null && isNativeInput(target) && !isElementDisabled(target)) {\n const selectionStart = target.selectionStart;\n const selectionEnd = target.selectionEnd;\n const textContent = target.value;\n // return to native textbox behavior when\n // 1 - Shift is held to make a text selection, or if there already is a text selection\n if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {\n return;\n }\n // 2 - arrow-ing forward and not in the last position of the text\n if (event.key !== backwardKey && selectionStart < textContent.length) {\n return;\n }\n // 3 -arrow-ing backward and not in the first position of the text\n if (event.key !== forwardKey && selectionStart > 0) {\n return;\n }\n }\n let nextIndex = highlightedIndex;\n const minIndex = getMinListIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxListIndex(elementsRef, disabledIndices);\n if (grid != null) {\n nextIndex = grid({\n disabledIndices,\n elementsRef,\n event,\n highlightedIndex,\n loopFocus,\n maxIndex,\n minIndex,\n onLoop: wrappedOnLoop,\n orientation,\n rtl: isRtl\n });\n }\n const isForwardKey = orientation !== 'vertical' && event.key === horizontalForwardKey || orientation !== 'horizontal' && event.key === ARROW_DOWN;\n const isBackwardKey = orientation !== 'vertical' && event.key === horizontalBackwardKey || orientation !== 'horizontal' && event.key === ARROW_UP;\n if (enableHomeAndEndKeys) {\n if (event.key === HOME) {\n nextIndex = minIndex;\n } else if (event.key === END) {\n nextIndex = maxIndex;\n }\n }\n if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {\n if (loopFocus && nextIndex === maxIndex && isForwardKey) {\n nextIndex = minIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {\n nextIndex = maxIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else {\n nextIndex = findNonDisabledListIndex(elementsRef.current, {\n startingIndex: nextIndex,\n decrement: isBackwardKey,\n disabledIndices\n });\n }\n }\n if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {\n if (stopEventPropagation) {\n event.stopPropagation();\n }\n if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) {\n event.preventDefault();\n }\n onHighlightedIndexChange(nextIndex, true);\n\n // Wait for FocusManager `returnFocus` to execute.\n queueMicrotask(() => {\n elementsRef.current[nextIndex]?.focus();\n });\n }\n });\n const props = {\n ref: mergedRef,\n onFocus(event) {\n const element = rootRef.current;\n const target = getTarget(event.nativeEvent);\n if (!element || target == null || !isNativeInput(target)) {\n return;\n }\n target.setSelectionRange(0, target.value.length);\n },\n onKeyDown\n };\n return {\n props,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n onMapChange,\n relayKeyboardEvent: onKeyDown\n };\n}\nfunction isModifierKeySet(event, ignoredModifierKeys) {\n for (const key of MODIFIER_KEYS) {\n if (ignoredModifierKeys.includes(key)) {\n continue;\n }\n if (event.getModifierState(key)) {\n return true;\n }\n }\n return false;\n}","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"./utils\";\n\nconst cardVariants = cva(\n \"flex flex-col gap-5 rounded-lg border border-border-default py-[var(--ds-surface-padding)] text-text-primary\",\n {\n variants: {\n variant: {\n default: \"bg-surface shadow-sm\",\n muted: \"bg-surface-muted shadow-none\",\n elevated: \"bg-surface-raised shadow-md\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\ntype CardProps = React.ComponentProps<\"div\"> & VariantProps<typeof cardVariants>;\n\nfunction Card({ className, variant, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-variant={variant ?? \"default\"}\n className={cn(cardVariants({ variant, className }))}\n {...props}\n />\n );\n}\n\ntype CardHeaderProps = React.ComponentProps<\"div\"> & {\n action?: React.ReactNode;\n};\n\nfunction CardHeader({ action, children, className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"grid auto-rows-min gap-1.5 px-[var(--ds-surface-padding)]\",\n action && \"grid-cols-[minmax(0,1fr)_auto] items-start gap-4\",\n className,\n )}\n {...props}\n >\n {action ? <div className=\"min-w-0\">{children}</div> : children}\n {action ? <div className=\"justify-self-end\">{action}</div> : null}\n </div>\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-title\" className={cn(\"ds-type-card-title\", className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-description\" className={cn(\"ds-type-ui text-text-supporting\", className)} {...props} />;\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-content\" className={cn(\"px-[var(--ds-surface-padding)]\", className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-footer\" className={cn(\"flex items-center px-[var(--ds-surface-padding)]\", className)} {...props} />;\n}\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n cardVariants,\n};\nexport type { CardHeaderProps, CardProps };\n","import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nfunction Skeleton({ \"aria-hidden\": ariaHidden, className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"skeleton\"\n aria-hidden={ariaHidden ?? true}\n className={cn(\"animate-pulse rounded-md bg-surface-muted\", className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","\"use client\";\nimport * as React from \"react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\n\nfunction Collapsible({ open: controlledOpen, defaultOpen = false, onOpenChange, children, ...props }: React.ComponentProps<typeof BaseCollapsible.Root>) {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = controlledOpen ?? uncontrolledOpen;\n const handleOpenChange = (nextOpen: boolean, ...details: Parameters<NonNullable<React.ComponentProps<typeof BaseCollapsible.Root>[\"onOpenChange\"]>> extends [boolean, infer D] ? [D] : []) => {\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen, ...details);\n };\n return <BaseCollapsible.Root data-slot=\"collapsible\" open={open} onOpenChange={handleOpenChange} {...props}>{children}</BaseCollapsible.Root>;\n}\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof BaseCollapsible.Trigger>) { return <BaseCollapsible.Trigger data-slot=\"collapsible-trigger\" {...props} />; }\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof BaseCollapsible.Panel>) { return <BaseCollapsible.Panel data-slot=\"collapsible-content\" {...props} />; }\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n","export { CollapsibleRoot as Root } from \"./root/CollapsibleRoot.mjs\";\nexport { CollapsibleTrigger as Trigger } from \"./trigger/CollapsibleTrigger.mjs\";\nexport { CollapsiblePanel as Panel } from \"./panel/CollapsiblePanel.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRoot } from \"./useCollapsibleRoot.mjs\";\nimport { CollapsibleRootContext } from \"./CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"./stateAttributesMapping.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the collapsible.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleRoot = /*#__PURE__*/React.forwardRef(function CollapsibleRoot(componentProps, forwardedRef) {\n const {\n render,\n className,\n defaultOpen = false,\n disabled = false,\n onOpenChange: onOpenChangeProp,\n open,\n style,\n ...elementProps\n } = componentProps;\n const onOpenChange = useStableCallback(onOpenChangeProp);\n const collapsible = useCollapsibleRoot({\n open,\n defaultOpen,\n onOpenChange,\n disabled\n });\n const state = React.useMemo(() => ({\n open: collapsible.open,\n disabled: collapsible.disabled,\n transitionStatus: collapsible.transitionStatus\n }), [collapsible.open, collapsible.disabled, collapsible.transitionStatus]);\n const contextValue = React.useMemo(() => ({\n ...collapsible,\n onOpenChange,\n state\n }), [collapsible, onOpenChange, state]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(CollapsibleRootContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleRoot.displayName = \"CollapsibleRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nexport function useCollapsibleRoot(parameters) {\n const {\n open: openParam,\n defaultOpen,\n onOpenChange,\n disabled\n } = parameters;\n const [open, setOpen] = useControlled({\n controlled: openParam,\n default: defaultOpen,\n name: 'Collapsible',\n state: 'open'\n });\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, true, true);\n const defaultPanelId = useBaseUiId();\n // `undefined` uses the initial generated fallback; `null` means the panel unmounted.\n const [registeredPanelId, setPanelIdState] = React.useState();\n const panelId = registeredPanelId === null ? undefined : registeredPanelId ?? defaultPanelId;\n const handleTrigger = useStableCallback(event => {\n const nextOpen = !open;\n const eventDetails = createChangeEventDetails(REASONS.triggerPress, event.nativeEvent);\n onOpenChange(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(nextOpen);\n });\n return React.useMemo(() => ({\n defaultPanelId,\n disabled,\n handleTrigger,\n mounted,\n open,\n panelId,\n setMounted,\n setOpen,\n setPanelIdState,\n transitionStatus\n }), [defaultPanelId, disabled, handleTrigger, mounted, open, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CollapsibleRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CollapsibleRootContext.displayName = \"CollapsibleRootContext\";\nexport function useCollapsibleRootContext() {\n const context = React.useContext(CollapsibleRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.' : _formatErrorMessage(15));\n }\n return context;\n}","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\nexport let CollapsiblePanelDataAttributes = function (CollapsiblePanelDataAttributes) {\n /**\n * Present when the collapsible panel is open.\n */\n CollapsiblePanelDataAttributes[\"open\"] = \"data-open\";\n /**\n * Present when the collapsible panel is closed.\n */\n CollapsiblePanelDataAttributes[\"closed\"] = \"data-closed\";\n /**\n * Present when the panel begins animating in.\n */\n CollapsiblePanelDataAttributes[CollapsiblePanelDataAttributes[\"startingStyle\"] = TransitionStatusDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the panel is animating out.\n */\n CollapsiblePanelDataAttributes[CollapsiblePanelDataAttributes[\"endingStyle\"] = TransitionStatusDataAttributes.endingStyle] = \"endingStyle\";\n return CollapsiblePanelDataAttributes;\n}({});","export let CollapsibleTriggerDataAttributes = /*#__PURE__*/function (CollapsibleTriggerDataAttributes) {\n /**\n * Present when the collapsible panel is open.\n */\n CollapsibleTriggerDataAttributes[\"panelOpen\"] = \"data-panel-open\";\n return CollapsibleTriggerDataAttributes;\n}({});","import { CollapsiblePanelDataAttributes } from \"../collapsible/panel/CollapsiblePanelDataAttributes.mjs\";\nimport { CollapsibleTriggerDataAttributes } from \"../collapsible/trigger/CollapsibleTriggerDataAttributes.mjs\";\nconst PANEL_OPEN_HOOK = {\n [CollapsiblePanelDataAttributes.open]: ''\n};\nconst PANEL_CLOSED_HOOK = {\n [CollapsiblePanelDataAttributes.closed]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return {\n [CollapsibleTriggerDataAttributes.panelOpen]: ''\n };\n }\n return null;\n }\n};\nexport const collapsibleOpenStateMapping = {\n open(value) {\n if (value) {\n return PANEL_OPEN_HOOK;\n }\n return PANEL_CLOSED_HOOK;\n }\n};","import { collapsibleOpenStateMapping as baseMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nexport const collapsibleStateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { triggerOpenStateMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nconst stateAttributesMapping = {\n ...triggerOpenStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A button that opens and closes the collapsible panel.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleTrigger = /*#__PURE__*/React.forwardRef(function CollapsibleTrigger(componentProps, forwardedRef) {\n const {\n panelId,\n open,\n handleTrigger,\n state,\n disabled: contextDisabled\n } = useCollapsibleRootContext();\n const {\n className,\n disabled = contextDisabled,\n render,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton\n });\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n 'aria-controls': open ? panelId : undefined,\n 'aria-expanded': open,\n onClick: handleTrigger\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleTrigger.displayName = \"CollapsibleTrigger\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { warn } from '@base-ui/utils/warn';\nimport { resolveStyle } from \"../../utils/resolveStyle.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useCollapsiblePanel } from \"./useCollapsiblePanel.mjs\";\nimport { CollapsiblePanelCssVars } from \"./CollapsiblePanelCssVars.mjs\";\n/**\n * A panel with the collapsible contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsiblePanel = /*#__PURE__*/React.forwardRef(function CollapsiblePanel(componentProps, forwardedRef) {\n const {\n className,\n hiddenUntilFound: hiddenUntilFoundProp,\n keepMounted: keepMountedProp,\n render,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (hiddenUntilFoundProp && keepMountedProp === false) {\n warn('The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.');\n }\n }, [hiddenUntilFoundProp, keepMountedProp]);\n }\n const {\n defaultPanelId,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setPanelIdState,\n setOpen,\n state,\n transitionStatus\n } = useCollapsibleRootContext();\n const hiddenUntilFound = hiddenUntilFoundProp ?? false;\n const keepMounted = keepMountedProp ?? false;\n const registeredId = idProp || undefined;\n const id = registeredId ?? defaultPanelId;\n useIsoLayoutEffect(() => {\n setPanelIdState(currentId => registeredId ?? (currentId === null ? undefined : currentId));\n return () => {\n setPanelIdState(currentId => currentId === registeredId ? null : currentId);\n };\n }, [registeredId, setPanelIdState]);\n const {\n height,\n props,\n ref,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width\n } = useCollapsiblePanel({\n externalRef: forwardedRef,\n hiddenUntilFound,\n id,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n });\n const panelState = {\n ...state,\n transitionStatus: panelTransitionStatus\n };\n const resolvedStyle = resolveStyle(style, panelState);\n const element = useRenderElement('div', {\n ...componentProps,\n style: undefined\n }, {\n state: panelState,\n ref,\n props: [props, {\n style: {\n [CollapsiblePanelCssVars.collapsiblePanelHeight]: height === undefined ? 'auto' : `${height}px`,\n [CollapsiblePanelCssVars.collapsiblePanelWidth]: width === undefined ? 'auto' : `${width}px`\n }\n }, elementProps, resolvedStyle ? {\n style: resolvedStyle\n } : undefined,\n // Resolve the public `style` prop so temporary `animationName: 'none'`\n // can still win after user's inline styles have been merged.\n shouldPreventOpenAnimation ? {\n style: {\n animationName: 'none'\n }\n } : undefined],\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsiblePanel.displayName = \"CollapsiblePanel\";","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { warn } from '@base-ui/utils/warn';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useAnimationsFinished } from \"../../internals/useAnimationsFinished.mjs\";\nimport { CollapsiblePanelDataAttributes } from \"./CollapsiblePanelDataAttributes.mjs\";\nconst EMPTY_DIMENSIONS = {\n height: undefined,\n width: undefined\n};\nexport function useCollapsiblePanel(parameters) {\n const {\n externalRef,\n hiddenUntilFound,\n id: idParam,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n } = parameters;\n const panelRef = React.useRef(null);\n const animationTypeRef = React.useRef(null);\n const [dimensions, setDimensionsUnwrapped] = React.useState(EMPTY_DIMENSIONS);\n const lastMeasuredDimensionsRef = React.useRef(EMPTY_DIMENSIONS);\n // `beforematch` should reveal the matched content immediately, so the next\n // open cycle skips author-defined motion once and then returns to normal.\n const shouldSkipNextOpenRef = React.useRef(false);\n // Keyframe mount animations on initially open panels cause a visible layout\n // shift during the server-rendered first paint, so suppress that first open\n // lifecycle until the panel has been closed once.\n const shouldPreventMountAnimationRef = React.useRef(open);\n // React.Activity tears down Effects while preserving state, so revealing an\n // already-open panel would otherwise replay its CSS keyframe open animation.\n const shouldPreventActivityResumeAnimationRef = React.useRef(false);\n // Some open paths intentionally bypass motion, but the shared root transition\n // status still advances asynchronously. Override the panel to idle so its data\n // attributes and dimension cleanup reflect the immediate open state.\n const [forcePanelIdle, setForcePanelIdle] = React.useState(false);\n const pendingTemporaryStyleRestoreRef = React.useRef(null);\n const mergedPanelRef = useMergedRefs(externalRef, panelRef);\n const latestOpenRef = useValueAsRef(open);\n // Only used to handle panel close\n const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef);\n const hidden = !open && !mounted;\n const panelTransitionStatus = forcePanelIdle ? 'idle' : transitionStatus;\n const shouldPreventOpenAnimation = open && (\n // These 2 refs are safe to read in render, they are only written from committed\n // layout/effect paths and gate one-shot motion suppression for the next open\n // lifecycle. They intentionally expose the last committed motion snapshot.\n shouldPreventMountAnimationRef.current || shouldPreventActivityResumeAnimationRef.current);\n const renderedDimensions = !open && mounted &&\n // These 2 refs are also safe to read in render, both hold the last committed\n // animation mode and measurement. This fallback only restores a previously\n // measured pixel size after the live dimensions state has been reset back to `auto`.\n animationTypeRef.current === 'css-animation' && dimensions.height === undefined && dimensions.width === undefined ? lastMeasuredDimensionsRef.current : dimensions;\n const shouldPersistHiddenTransitionStyles = hiddenUntilFound && hidden && animationTypeRef.current !== 'css-animation';\n\n // Most measured dimensions are reused later when CSS keyframe closes need a\n // pixel size after the rendered dimensions have been reset back to `auto`.\n // Passing `false` is only for clearing the current dimensions state.\n const setDimensions = useStableCallback((nextDimensions, shouldCacheMeasurement = true) => {\n if (shouldCacheMeasurement) {\n lastMeasuredDimensionsRef.current = nextDimensions;\n }\n setDimensionsUnwrapped(nextDimensions);\n });\n const restorePendingTemporaryStyle = useStableCallback(() => {\n pendingTemporaryStyleRestoreRef.current?.();\n pendingTemporaryStyleRestoreRef.current = null;\n });\n const setPendingTemporaryStyleRestore = useStableCallback(restore => {\n restorePendingTemporaryStyle();\n pendingTemporaryStyleRestoreRef.current = () => {\n pendingTemporaryStyleRestoreRef.current = null;\n restore();\n };\n });\n\n // React.Activity unmounts Effects while preserving component state. If that\n // teardown happens while an already-open keyframe panel is visible, remember\n // to suppress the replayed open animation on the next committed reveal.\n const markActivityResumeAnimationSuppressed = useStableCallback(() => {\n if (open && mounted && animationTypeRef.current === 'css-animation') {\n shouldPreventActivityResumeAnimationRef.current = true;\n }\n });\n useIsoLayoutEffect(() => {\n // `forcePanelIdle` is only a temporary override for open paths that skip\n // motion. Keep it active while the shared root still reports `starting`,\n // then drop it once the root transition state catches up.\n if (!forcePanelIdle || transitionStatus === 'starting') {\n return;\n }\n setForcePanelIdle(false);\n }, [forcePanelIdle, transitionStatus]);\n React.useEffect(() => {\n return () => {\n markActivityResumeAnimationSuppressed();\n restorePendingTemporaryStyle();\n };\n }, [markActivityResumeAnimationSuppressed, restorePendingTemporaryStyle]);\n useIsoLayoutEffect(() => {\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n\n // `beforematch` can temporarily force a `0s` motion duration so the matched\n // content reveals immediately. Restore the authored duration before detecting\n // the next close animation type, otherwise that first close is misread as\n // \"no motion\" and the close transition or keyframe gets skipped.\n if (!open && pendingTemporaryStyleRestoreRef.current) {\n restorePendingTemporaryStyle();\n }\n const animationType = getAnimationType(panel, shouldPreventOpenAnimation);\n animationTypeRef.current = animationType;\n\n // Initially open keyframe panels skip their first paint animation to avoid\n // layout shift, but we still need to cache the expanded size so the first\n // close animation can start from pixels instead of `auto`.\n if (open && transitionStatus === 'idle' && shouldPreventMountAnimationRef.current && animationType === 'css-animation') {\n lastMeasuredDimensionsRef.current = getDimensions(panel);\n return undefined;\n }\n\n // Handle the opening pass: measure the expanded size and, when necessary,\n // neutralize author-defined motion so the panel can open immediately.\n if (open && transitionStatus === 'starting') {\n // `beforematch` opens should reveal the panel immediately so find-in-page\n // does not wait for the author-defined transition or animation to finish.\n const skipNextOpen = shouldSkipNextOpenRef.current;\n shouldSkipNextOpenRef.current = false;\n if (animationType === 'none') {\n setDimensions(getDimensions(panel));\n setForcePanelIdle(true);\n return undefined;\n }\n if (animationType === 'css-transition') {\n const restoreLayoutStyles = resetLayoutStyles(panel);\n setDimensions(getDimensions(panel));\n if (!skipNextOpen) {\n return restoreLayoutStyles;\n }\n const restoreTransitionDuration = setTemporaryStyle(panel, 'transition-duration', '0s');\n setPendingTemporaryStyleRestore(restoreTransitionDuration);\n setForcePanelIdle(true);\n return restoreLayoutStyles;\n }\n setDimensions(getDimensions(panel));\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n if (!skipNextOpen) {\n restoreAnimationName();\n return undefined;\n }\n const restoreAnimationDuration = setTemporaryStyle(panel, 'animation-duration', '0s');\n restoreAnimationName();\n setPendingTemporaryStyleRestore(restoreAnimationDuration);\n setForcePanelIdle(true);\n return undefined;\n }\n\n // Capture the current size as soon as close is requested, before the\n // deferred ending phase applies closed styles. This keeps close transitions\n // starting from a measured pixel value, including interrupted opens.\n if (!open && mounted && (transitionStatus === 'idle' || transitionStatus === 'starting')) {\n shouldPreventMountAnimationRef.current = false;\n shouldPreventActivityResumeAnimationRef.current = false;\n if (animationType === 'none') {\n setDimensions(EMPTY_DIMENSIONS, false);\n setMounted(false);\n return undefined;\n }\n setDimensions(getDimensions(panel));\n return undefined;\n }\n if (transitionStatus !== 'ending') {\n return undefined;\n }\n\n // Reachable when `transitionStatus` already flipped to `ending` before this effect ran, so\n // the close branch above was skipped. Without motion there is nothing to wait for, so unmount\n // here instead of deferring to the animation-finished path below.\n if (animationType === 'none') {\n setMounted(false);\n return undefined;\n }\n const nextDimensions = getDimensions(panel);\n const hasMeasuredSize = nextDimensions.height > 0 || nextDimensions.width > 0;\n if (!hasMeasuredSize) {\n setMounted(false);\n return undefined;\n }\n setDimensions(nextDimensions);\n if (animationType === 'css-animation') {\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n restoreAnimationName();\n }\n return undefined;\n }, [mounted, open, restorePendingTemporaryStyle, setDimensions, setMounted, setPendingTemporaryStyleRestore, shouldPreventOpenAnimation, transitionStatus]);\n useOpenChangeComplete({\n enabled: open && mounted && panelTransitionStatus === 'idle',\n open: true,\n ref: panelRef,\n onComplete() {\n // `useOpenChangeComplete` only aborts from its effect cleanup, which React runs in the\n // post-paint passive flush. An animation's `finished` microtask can resolve after the render\n // that set `open` to `false` but before that cleanup, so re-check the latest value here.\n // Clearing the measured size in that window would make the close transition start from\n // `height: 0` instead of the expanded pixel height.\n if (!open) {\n return;\n }\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n });\n\n // Closing panels need extra sequencing beyond `useOpenChangeComplete`.\n // This passive effect runs after the `ending` render has committed, so\n // `[data-ending-style]` is already present. Chrome can still register the\n // exit transition one frame later when an Accordion closes one item while\n // opening another, so wait one frame before watching animations.\n // See https://github.com/mui/base-ui/issues/3099\n React.useEffect(() => {\n if (open || !mounted || panelTransitionStatus !== 'ending') {\n return undefined;\n }\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n const abortController = new AbortController();\n let endingStyleFrame = -1;\n function handleComplete() {\n // Same post-paint race as the `useOpenChangeComplete` callback above, except `open` is\n // captured by this effect's closure and always `false` here, so read the latest value from\n // a ref. Unmounting a panel that has already reopened would drop it from the DOM.\n if (latestOpenRef.current) {\n return;\n }\n setMounted(false);\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n endingStyleFrame = AnimationFrame.request(() => {\n runOnceCloseAnimationsFinish(handleComplete, abortController.signal);\n });\n return () => {\n AnimationFrame.cancel(endingStyleFrame);\n abortController.abort();\n };\n }, [latestOpenRef, mounted, open, panelTransitionStatus, runOnceCloseAnimationsFinish, setDimensions, setMounted]);\n useIsoLayoutEffect(() => {\n const panel = panelRef.current;\n if (!panel || !hiddenUntilFound || !hidden) {\n return;\n }\n\n // React only supports a boolean for the `hidden` attribute and forces\n // legit string values to booleans so we have to force it back in the DOM\n // when necessary: https://github.com/react/react/issues/24740\n panel.setAttribute('hidden', 'until-found');\n }, [hidden, hiddenUntilFound]);\n React.useEffect(function registerBeforeMatchListener() {\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n function handleBeforeMatch(event) {\n const eventDetails = createChangeEventDetails(REASONS.none, event);\n onOpenChange(true, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n shouldSkipNextOpenRef.current = true;\n setOpen(true);\n }\n return addEventListener(panel, 'beforematch', handleBeforeMatch);\n }, [onOpenChange, setOpen]);\n const shouldRender = keepMounted || hiddenUntilFound || mounted || open;\n return {\n height: renderedDimensions.height,\n props: {\n ...(shouldPersistHiddenTransitionStyles ? {\n [CollapsiblePanelDataAttributes.startingStyle]: ''\n } : undefined),\n hidden,\n id: idParam\n },\n ref: mergedPanelRef,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width: renderedDimensions.width\n };\n}\nfunction getDimensions(element) {\n return {\n height: element.scrollHeight,\n width: element.scrollWidth\n };\n}\nfunction getAnimationType(element, hasSuppressedMountAnimation) {\n const panelStyles = ownerWindow(element).getComputedStyle(element);\n const hasAnimation = (panelStyles.animationName.split(',').map(name => name.trim()).some(name => name !== '' && name !== 'none') || hasSuppressedMountAnimation) && hasNonZeroDuration(panelStyles.animationDuration);\n const hasTransition = hasNonZeroDuration(panelStyles.transitionDuration);\n if (hasAnimation && hasTransition) {\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n warn('CSS transitions and CSS animations both detected on Collapsible or Accordion panel.', 'Only one of either animation type should be used.');\n }\n return 'css-transition';\n }\n if (hasTransition) {\n return 'css-transition';\n }\n if (hasAnimation) {\n return 'css-animation';\n }\n return 'none';\n}\nfunction hasNonZeroDuration(value) {\n return value.split(',').map(part => part.trim()).some(part => part !== '' && Number.parseFloat(part) > 0);\n}\n\n/**\n * Temporarily overrides an inline style property and returns a cleanup that\n * restores the previous inline value and priority.\n * @param element - The element whose inline style should be updated.\n * @param property - The CSS property name to override.\n * @param value - The temporary value to assign.\n * @returns A cleanup function that restores the original inline style state.\n */\nfunction setTemporaryStyle(element, property, value) {\n const previousValue = element.style.getPropertyValue(property);\n const previousPriority = element.style.getPropertyPriority(property);\n element.style.setProperty(property, value);\n return () => {\n if (previousValue === '') {\n element.style.removeProperty(property);\n return;\n }\n element.style.setProperty(property, previousValue, previousPriority);\n };\n}\n\n/**\n * Temporarily resets inline alignment styles that can distort scroll-based\n * size measurements, then restores them on the next animation frame.\n * @param element - The panel element being measured.\n * @returns A cleanup function that cancels the scheduled restore and reapplies\n * the original inline layout styles immediately.\n */\nfunction resetLayoutStyles(element) {\n const originalLayoutStyles = {\n 'justify-content': element.style.justifyContent,\n 'align-items': element.style.alignItems,\n 'align-content': element.style.alignContent,\n 'justify-items': element.style.justifyItems\n };\n Object.keys(originalLayoutStyles).forEach(key => {\n element.style.setProperty(key, 'initial', 'important');\n });\n function restoreLayoutStyles() {\n Object.entries(originalLayoutStyles).forEach(([key, value]) => {\n if (value === '') {\n element.style.removeProperty(key);\n return;\n }\n element.style.setProperty(key, value);\n });\n }\n const frame = AnimationFrame.request(restoreLayoutStyles);\n return () => {\n AnimationFrame.cancel(frame);\n restoreLayoutStyles();\n };\n}","export let CollapsiblePanelCssVars = /*#__PURE__*/function (CollapsiblePanelCssVars) {\n /**\n * The collapsible panel's height.\n * @type {number}\n */\n CollapsiblePanelCssVars[\"collapsiblePanelHeight\"] = \"--collapsible-panel-height\";\n /**\n * The collapsible panel's width.\n * @type {number}\n */\n CollapsiblePanelCssVars[\"collapsiblePanelWidth\"] = \"--collapsible-panel-width\";\n return CollapsiblePanelCssVars;\n}({});","export { MenuArrow as Arrow } from \"./arrow/MenuArrow.mjs\";\nexport { MenuBackdrop as Backdrop } from \"./backdrop/MenuBackdrop.mjs\";\nexport { MenuCheckboxItem as CheckboxItem } from \"./checkbox-item/MenuCheckboxItem.mjs\";\nexport { MenuCheckboxItemIndicator as CheckboxItemIndicator } from \"./checkbox-item-indicator/MenuCheckboxItemIndicator.mjs\";\nexport { MenuGroup as Group } from \"./group/MenuGroup.mjs\";\nexport { MenuGroupLabel as GroupLabel } from \"./group-label/MenuGroupLabel.mjs\";\nexport { MenuItem as Item } from \"./item/MenuItem.mjs\";\nexport { MenuLinkItem as LinkItem } from \"./link-item/MenuLinkItem.mjs\";\nexport { MenuPopup as Popup } from \"./popup/MenuPopup.mjs\";\nexport { MenuPortal as Portal } from \"./portal/MenuPortal.mjs\";\nexport { MenuPositioner as Positioner } from \"./positioner/MenuPositioner.mjs\";\nexport { MenuRadioGroup as RadioGroup } from \"./radio-group/MenuRadioGroup.mjs\";\nexport { MenuRadioItem as RadioItem } from \"./radio-item/MenuRadioItem.mjs\";\nexport { MenuRadioItemIndicator as RadioItemIndicator } from \"./radio-item-indicator/MenuRadioItemIndicator.mjs\";\nexport { MenuRoot as Root } from \"./root/MenuRoot.mjs\";\nexport { MenuSubmenuRoot as SubmenuRoot } from \"./submenu-root/MenuSubmenuRoot.mjs\";\nexport { MenuTrigger as Trigger } from \"./trigger/MenuTrigger.mjs\";\nexport { MenuViewport as Viewport } from \"./viewport/MenuViewport.mjs\";\nexport { Separator } from \"../separator/Separator.mjs\";\nexport { MenuSubmenuTrigger as SubmenuTrigger } from \"./submenu-trigger/MenuSubmenuTrigger.mjs\";\nexport { MenuHandle as Handle, createMenuHandle as createHandle } from \"./store/MenuHandle.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Displays an element positioned against the menu anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuArrow = /*#__PURE__*/React.forwardRef(function MenuArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = useMenuPositionerContext();\n const open = store.useState('open');\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n return useRenderElement('div', componentProps, {\n ref: [arrowRef, forwardedRef],\n stateAttributesMapping: popupStateMapping,\n state,\n props: {\n style: arrowStyles,\n 'aria-hidden': true,\n ...elementProps\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuArrow.displayName = \"MenuArrow\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuPositionerContext.displayName = \"MenuPositionerContext\";\nexport function useMenuPositionerContext(optional) {\n const context = React.useContext(MenuPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.' : _formatErrorMessage(33));\n }\n return context;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRootContext.displayName = \"MenuRootContext\";\nexport function useMenuRootContext(optional) {\n const context = React.useContext(MenuRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.' : _formatErrorMessage(36));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * An overlay displayed beneath the menu popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuBackdrop = /*#__PURE__*/React.forwardRef(function MenuBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const contextMenuContext = useContextMenuRootContext();\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n ref: contextMenuContext?.backdropRef ? [forwardedRef, contextMenuContext.backdropRef] : forwardedRef,\n state,\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: lastOpenChangeReason === REASONS.triggerHover ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuBackdrop.displayName = \"MenuBackdrop\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ContextMenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ContextMenuRootContext.displayName = \"ContextMenuRootContext\";\nexport function useContextMenuRootContext(optional = true) {\n const context = React.useContext(ContextMenuRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.' : _formatErrorMessage(25));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { MenuCheckboxItemContext } from \"./MenuCheckboxItemContext.mjs\";\nimport { REGULAR_ITEM, useMenuItem } from \"../item/useMenuItem.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A menu item that toggles a setting on or off.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuCheckboxItem = /*#__PURE__*/React.forwardRef(function MenuCheckboxItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled: disabledProp = false,\n closeOnClick = false,\n checked: checkedProp,\n defaultChecked,\n onCheckedChange,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n guess: true,\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp || rootDisabled;\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const [checked, setChecked] = useControlled({\n controlled: checkedProp,\n default: defaultChecked ?? false,\n name: 'MenuCheckboxItem',\n state: 'checked'\n });\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = React.useMemo(() => ({\n disabled,\n highlighted,\n checked\n }), [disabled, highlighted, checked]);\n function handleClick(event) {\n const details = createChangeEventDetails(REASONS.itemPress, event.nativeEvent, undefined, {\n preventUnmountOnClose: NOOP\n });\n onCheckedChange?.(!checked, details);\n if (details.isCanceled) {\n return;\n }\n setChecked(currentlyChecked => !currentlyChecked);\n }\n const element = useRenderElement('div', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n props: [itemProps, {\n role: 'menuitemcheckbox',\n 'aria-checked': checked,\n onClick: handleClick\n }, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n return /*#__PURE__*/_jsx(MenuCheckboxItemContext.Provider, {\n value: state,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItem.displayName = \"MenuCheckboxItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuCheckboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItemContext.displayName = \"MenuCheckboxItemContext\";\nexport function useMenuCheckboxItemContext() {\n const context = React.useContext(MenuCheckboxItemContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.' : _formatErrorMessage(30));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useMenuItemCommonProps } from \"./useMenuItemCommonProps.mjs\";\nexport const REGULAR_ITEM = {\n type: 'regular-item'\n};\nexport function useMenuItem(params) {\n const {\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n typingRef = store.context.typingRef,\n nativeButton,\n itemMetadata,\n nodeId\n } = params;\n const itemRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const commonProps = useMenuItemCommonProps({\n closeOnClick,\n highlighted,\n id,\n nodeId,\n store,\n typingRef,\n itemRef,\n itemMetadata\n });\n const getItemProps = React.useCallback(externalProps => {\n return mergeProps(commonProps, {\n onMouseEnter() {\n if (itemMetadata.type !== 'submenu-trigger') {\n return;\n }\n itemMetadata.setActive();\n }\n }, externalProps, getButtonProps);\n }, [commonProps, getButtonProps, itemMetadata]);\n const mergedRef = useMergedRefs(itemRef, buttonRef);\n return React.useMemo(() => ({\n getItemProps,\n itemRef: mergedRef\n }), [getItemProps, mergedRef]);\n}","'use client';\n\nimport * as React from 'react';\nimport { platform } from '@base-ui/utils/platform';\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\n/**\n * Returns common props shared by all menu item types.\n * This hook extracts the shared logic for id, role, tabIndex, onKeyDown,\n * onMouseMove, onClick, and onMouseUp handlers.\n */\nexport function useMenuItemCommonProps(params) {\n const {\n closeOnClick,\n highlighted,\n id,\n nodeId,\n store,\n typingRef,\n itemRef,\n itemMetadata\n } = params;\n const {\n events: menuEvents\n } = store.useState('floatingTreeRoot');\n const open = store.useState('open');\n const contextMenuContext = useContextMenuRootContext(true);\n const isContextMenu = contextMenuContext !== undefined;\n return React.useMemo(() => ({\n id,\n role: 'menuitem',\n tabIndex: open && highlighted ? 0 : -1,\n onKeyDown(event) {\n if (event.key === ' ' && typingRef?.current) {\n event.preventDefault();\n }\n },\n onMouseMove(event) {\n if (!nodeId) {\n return;\n }\n\n // Inform the floating tree that a menu item within this menu was hovered/moved over\n // so unrelated descendant submenus can be closed.\n menuEvents.emit('itemhover', {\n nodeId,\n target: event.currentTarget\n });\n },\n onClick(event) {\n if (closeOnClick) {\n menuEvents.emit('close', {\n domEvent: event,\n reason: REASONS.itemPress\n });\n }\n },\n onMouseUp(event) {\n if (contextMenuContext) {\n const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;\n contextMenuContext.initialCursorPointRef.current = null;\n if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) {\n return;\n }\n\n // On non-macOS platforms, this mouseup belongs to the right-click gesture\n // that opened the context menu, so it must not activate an item.\n if (isContextMenu && !platform.os.mac && event.button === 2) {\n return;\n }\n }\n if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {\n // This fires whenever the user clicks on the trigger, moves the cursor, and releases it over the item.\n // We trigger the click and override the `closeOnClick` preference to always close the menu.\n if (itemMetadata.type === 'regular-item') {\n // `detail: 1` marks this as a mouse-gesture click so MenuRoot doesn't\n // treat it as a keyboard activation (`detail === 0` → `data-instant`).\n dispatchClickWithModifiers(itemRef.current, event, {\n detail: 1\n });\n }\n }\n }\n }), [closeOnClick, highlighted, id, menuEvents, nodeId, open, store, typingRef, itemRef, contextMenuContext, isContextMenu, itemMetadata]);\n}","export let MenuCheckboxItemDataAttributes = /*#__PURE__*/function (MenuCheckboxItemDataAttributes) {\n /**\n * Present when the menu checkbox item is checked.\n */\n MenuCheckboxItemDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the menu checkbox item is not checked.\n */\n MenuCheckboxItemDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the menu checkbox item is disabled.\n */\n MenuCheckboxItemDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the menu checkbox item is highlighted.\n */\n MenuCheckboxItemDataAttributes[\"highlighted\"] = \"data-highlighted\";\n return MenuCheckboxItemDataAttributes;\n}({});","import { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { MenuCheckboxItemDataAttributes } from \"../checkbox-item/MenuCheckboxItemDataAttributes.mjs\";\nexport const itemMapping = {\n checked(value) {\n if (value) {\n return {\n [MenuCheckboxItemDataAttributes.checked]: ''\n };\n }\n return {\n [MenuCheckboxItemDataAttributes.unchecked]: ''\n };\n },\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { useMenuCheckboxItemContext } from \"../checkbox-item/MenuCheckboxItemContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\n\n/**\n * Indicates whether the checkbox item is ticked.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuCheckboxItemIndicator = /*#__PURE__*/React.forwardRef(function MenuCheckboxItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const item = useMenuCheckboxItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n mounted,\n setMounted\n } = useTransitionStatus(item.checked);\n useOpenChangeComplete({\n open: item.checked,\n ref: indicatorRef,\n onComplete() {\n if (!item.checked) {\n setMounted(false);\n }\n }\n });\n const state = {\n checked: item.checked,\n disabled: item.disabled,\n highlighted: item.highlighted,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, indicatorRef],\n stateAttributesMapping: itemMapping,\n props: {\n 'aria-hidden': true,\n ...elementProps\n },\n enabled: keepMounted || mounted\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItemIndicator.displayName = \"MenuCheckboxItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { MenuGroupContext } from \"./MenuGroupContext.mjs\";\n\n/**\n * Groups related menu items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuGroup = /*#__PURE__*/React.forwardRef(function MenuGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState(undefined);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: {\n role: 'group',\n 'aria-labelledby': labelId,\n ...elementProps\n }\n });\n return /*#__PURE__*/_jsx(MenuGroupContext.Provider, {\n value: setLabelId,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuGroup.displayName = \"MenuGroup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuGroupContext.displayName = \"MenuGroupContext\";\nexport function useMenuGroupRootContext() {\n const context = React.useContext(MenuGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.' : _formatErrorMessage(31));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useMenuGroupRootContext } from \"../group/MenuGroupContext.mjs\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuGroupLabel = /*#__PURE__*/React.forwardRef(function MenuGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const id = useBaseUiId(idProp);\n const setLabelId = useMenuGroupRootContext();\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [setLabelId, id]);\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: {\n id,\n role: 'presentation',\n ...elementProps\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuGroupLabel.displayName = \"MenuGroupLabel\";","'use client';\n\nimport * as React from 'react';\nimport { REGULAR_ITEM, useMenuItem } from \"./useMenuItem.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\n\n/**\n * An individual interactive item in the menu.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled: disabledProp = false,\n closeOnClick = true,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n guess: true,\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp || rootDisabled;\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = {\n disabled,\n highlighted\n };\n return useRenderElement('div', componentProps, {\n state,\n props: [itemProps, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuItem.displayName = \"MenuItem\";","'use client';\n\nimport * as React from 'react';\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { useMenuItemCommonProps } from \"../item/useMenuItemCommonProps.mjs\";\nimport { REGULAR_ITEM } from \"../item/useMenuItem.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\n\n/**\n * A link in the menu that can be used to navigate to a different page or section.\n * Renders an `<a>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuLinkItem = /*#__PURE__*/React.forwardRef(function MenuLinkItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n closeOnClick = false,\n style,\n ...elementProps\n } = componentProps;\n const linkRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const nodeId = menuPositionerContext?.context.nodeId;\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const typingRef = store.context.typingRef;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n native: false,\n composite: true\n });\n const commonProps = useMenuItemCommonProps({\n closeOnClick,\n highlighted,\n id,\n nodeId,\n store,\n typingRef,\n itemRef: linkRef,\n itemMetadata: REGULAR_ITEM\n });\n function getItemProps(externalProps) {\n return mergeProps(commonProps, externalProps, getButtonProps);\n }\n const state = {\n highlighted\n };\n return useRenderElement('a', componentProps, {\n state,\n props: [itemProps, elementProps, getItemProps],\n ref: [linkRef, buttonRef, forwardedRef, listItem.ref]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuLinkItem.displayName = \"MenuLinkItem\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager, useHoverFloatingInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\n\n/**\n * A container for the menu items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuPopup = /*#__PURE__*/React.forwardRef(function MenuPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const {\n side,\n align\n } = useMenuPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const open = store.useState('open');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const mounted = store.useState('mounted');\n const instantType = store.useState('instantType');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const parent = store.useState('parent');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const rootId = store.useState('rootId');\n const floatingContext = store.useState('floatingRootContext');\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const closeDelay = store.useState('closeDelay');\n const hoverEnabled = store.useState('hoverEnabled');\n const disabled = store.useState('disabled');\n const openMethod = store.useState('openMethod');\n const isContextMenu = parent.type === 'context-menu';\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n React.useEffect(() => {\n function handleClose(event) {\n store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));\n }\n floatingTreeRoot.events.on('close', handleClose);\n return () => {\n floatingTreeRoot.events.off('close', handleClose);\n };\n }, [floatingTreeRoot.events, store]);\n useHoverFloatingInteraction(floatingContext, {\n enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== 'menubar',\n closeDelay\n });\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n transitionStatus,\n side,\n align,\n open,\n nested: parent.type === 'menu',\n instant: instantType\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [popupProps, {\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps, {\n 'data-rootownerid': rootId\n }]\n });\n let returnFocus = parent.type === undefined || isContextMenu;\n if (activeTriggerElement || parent.type === 'menubar' && lastOpenChangeReason !== REASONS.outsidePress) {\n returnFocus = true;\n }\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingContext,\n openInteractionType: openMethod,\n modal: isContextMenu,\n disabled: !mounted,\n returnFocus: finalFocus === undefined ? returnFocus : finalFocus,\n initialFocus: parent.type !== 'menu',\n restoreFocus: true,\n externalTree: parent.type !== 'menubar' ? floatingTreeRoot : undefined,\n previousFocusableElement: activeTriggerElement,\n nextFocusableElement: parent.type === undefined ? store.context.triggerFocusTargetRef : undefined,\n beforeContentFocusGuardRef: parent.type === undefined ? store.context.beforeContentFocusGuardRef : undefined,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPopup.displayName = \"MenuPopup\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { MenuPortalContext } from \"./MenuPortalContext.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuPortal = /*#__PURE__*/React.forwardRef(function MenuPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const {\n store\n } = useMenuRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(MenuPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPortal.displayName = \"MenuPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuPortalContext.displayName = \"MenuPortalContext\";\nexport function useMenuPortalContext() {\n const value = React.useContext(MenuPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Menu.Portal> is missing.' : _formatErrorMessage(32));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { FloatingNode } from \"../../floating-ui-react/index.mjs\";\nimport { MenuPositionerContext } from \"./MenuPositionerContext.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { useMenuPortalContext } from \"../portal/MenuPortalContext.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE, POPUP_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useAnimationsFinished } from \"../../internals/useAnimationsFinished.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\n\n/**\n * Positions the menu popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const MenuPositioner = /*#__PURE__*/React.forwardRef(function MenuPositioner(componentProps, forwardedRef) {\n const {\n anchor: anchorProp,\n positionMethod: positionMethodProp = 'absolute',\n className,\n render,\n side,\n align: alignProp,\n sideOffset: sideOffsetProp = 0,\n alignOffset: alignOffsetProp = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const keepMounted = useMenuPortalContext();\n const contextMenuContext = useContextMenuRootContext(true);\n const parent = store.useState('parent');\n const floatingRootContext = store.useState('floatingRootContext');\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const modal = store.useState('modal');\n const openMethod = store.useState('openMethod');\n const triggerElement = store.useState('activeTriggerElement');\n const transitionStatus = store.useState('transitionStatus');\n const positionerElement = store.useState('positionerElement');\n const instantType = store.useState('instantType');\n const adaptiveOrigin = store.useState('adaptiveOrigin');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const floatingNodeId = store.useState('floatingNodeId');\n const floatingParentNodeId = store.useState('floatingParentNodeId');\n const domReference = floatingRootContext.useState('domReferenceElement');\n const previousTriggerRef = React.useRef(null);\n const runOnceAnimationsFinish = useAnimationsFinished(positionerElement);\n let anchor = anchorProp;\n let sideOffset = sideOffsetProp;\n let alignOffset = alignOffsetProp;\n let align = alignProp;\n let collisionAvoidance = collisionAvoidanceProp;\n if (parent.type === 'context-menu') {\n anchor = anchorProp ?? parent.context?.anchor;\n align = align ?? 'start';\n if (!side && align !== 'center') {\n alignOffset = componentProps.alignOffset ?? 2;\n sideOffset = componentProps.sideOffset ?? -5;\n }\n }\n let computedSide = side;\n let computedAlign = align;\n if (parent.type === 'menu') {\n computedSide = computedSide ?? 'inline-end';\n computedAlign = computedAlign ?? 'start';\n collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;\n } else if (parent.type === 'menubar') {\n computedSide = computedSide ?? (parent.context.orientation === 'vertical' ? 'inline-end' : 'bottom');\n computedAlign = computedAlign ?? 'start';\n }\n const contextMenu = parent.type === 'context-menu';\n const positioner = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod: contextMenuContext ? 'fixed' : positionMethodProp,\n mounted,\n side: computedSide,\n sideOffset,\n align: computedAlign,\n alignOffset,\n arrowPadding: contextMenu ? 0 : arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n nodeId: floatingNodeId,\n keepMounted,\n disableAnchorTracking,\n collisionAvoidance,\n shift: contextMenu ? {\n crossAxis: !('side' in collisionAvoidance && collisionAvoidance.side === 'flip'),\n rootBoundary: 'layoutViewport'\n } : undefined,\n externalTree: floatingTreeRoot,\n adaptiveOrigin\n });\n React.useEffect(() => {\n function onMenuOpenChange(details) {\n if (details.open) {\n if (details.parentNodeId === floatingNodeId) {\n store.set('hoverEnabled', false);\n }\n if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select('floatingParentNodeId')) {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n }\n }\n }\n floatingTreeRoot.events.on('menuopenchange', onMenuOpenChange);\n return () => {\n floatingTreeRoot.events.off('menuopenchange', onMenuOpenChange);\n };\n }, [store, floatingTreeRoot.events, floatingNodeId]);\n React.useEffect(() => {\n if (store.select('floatingParentNodeId') == null) {\n return undefined;\n }\n function onParentClose(details) {\n if (details.open || details.nodeId !== store.select('floatingParentNodeId')) {\n return;\n }\n const reason = details.reason ?? REASONS.siblingOpen;\n store.setOpen(false, createChangeEventDetails(reason));\n }\n floatingTreeRoot.events.on('menuopenchange', onParentClose);\n return () => {\n floatingTreeRoot.events.off('menuopenchange', onParentClose);\n };\n }, [floatingTreeRoot.events, store]);\n const closeTimeout = useTimeout();\n\n // Clear pending close timeout when the menu closes.\n React.useEffect(() => {\n if (!open) {\n closeTimeout.clear();\n }\n }, [open, closeTimeout]);\n\n // Close unrelated child submenus when hovering a different item in the parent menu.\n React.useEffect(() => {\n function onItemHover(event) {\n // If an item within our parent menu is hovered, and this menu's trigger is not that item,\n // close this submenu. This ensures hovering a different item in the parent closes other branches.\n if (!open || event.nodeId !== store.select('floatingParentNodeId')) {\n return;\n }\n if (event.target && triggerElement && triggerElement !== event.target) {\n const delay = store.select('closeDelay');\n if (delay > 0) {\n if (!closeTimeout.isStarted()) {\n closeTimeout.start(delay, () => {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n });\n }\n } else {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n }\n } else {\n // User re-hovered the submenu trigger, cancel pending close.\n closeTimeout.clear();\n }\n }\n floatingTreeRoot.events.on('itemhover', onItemHover);\n return () => {\n floatingTreeRoot.events.off('itemhover', onItemHover);\n };\n }, [floatingTreeRoot.events, open, triggerElement, store, closeTimeout]);\n React.useEffect(() => {\n const eventDetails = {\n open,\n nodeId: floatingNodeId,\n parentNodeId: floatingParentNodeId,\n reason: store.select('lastOpenChangeReason')\n };\n floatingTreeRoot.events.emit('menuopenchange', eventDetails);\n }, [floatingTreeRoot.events, open, store, floatingNodeId, floatingParentNodeId]);\n\n // Keep positioner transition behavior aligned with Popover when switching detached triggers.\n useIsoLayoutEffect(() => {\n const currentTrigger = domReference;\n const previousTrigger = previousTriggerRef.current;\n if (currentTrigger) {\n previousTriggerRef.current = currentTrigger;\n }\n if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {\n store.set('instantType', undefined);\n const abortController = new AbortController();\n runOnceAnimationsFinish(() => {\n store.set('instantType', 'trigger-change');\n }, abortController.signal);\n return () => {\n abortController.abort();\n };\n }\n return undefined;\n }, [domReference, runOnceAnimationsFinish, store]);\n const state = {\n open,\n side: positioner.side,\n align: positioner.align,\n anchorHidden: positioner.anchorHidden,\n nested: parent.type === 'menu',\n instant: instantType\n };\n const menubarModal = parent.type === 'menubar' && parent.context.modal;\n const popupModal = modal && lastOpenChangeReason !== REASONS.triggerHover;\n useAnchoredPopupScrollLock(open && (menubarModal || popupModal), openMethod === 'touch', positionerElement, triggerElement);\n const element = usePositioner(componentProps, state, {\n styles: positioner.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, store.useStateSetter('positionerElement')],\n hidden: !mounted,\n inert: !open\n });\n const shouldRenderBackdrop = mounted && parent.type !== 'menu' && (parent.type !== 'menubar' && modal && lastOpenChangeReason !== REASONS.triggerHover || parent.type === 'menubar' && parent.context.modal);\n\n // cuts a hole in the backdrop to allow pointer interaction with the menubar or dropdown menu trigger element\n let backdropCutout = null;\n if (parent.type === 'menubar') {\n backdropCutout = parent.context.contentElement;\n } else if (parent.type === undefined) {\n backdropCutout = triggerElement;\n }\n return /*#__PURE__*/_jsxs(MenuPositionerContext.Provider, {\n value: positioner,\n children: [shouldRenderBackdrop && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: parent.type === 'context-menu' || parent.type === 'nested-context-menu' ? parent.context.internalBackdropRef : null,\n inert: inertValue(!open),\n cutout: backdropCutout\n }), /*#__PURE__*/_jsx(FloatingNode, {\n id: floatingNodeId,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.context.itemDomElements,\n labelsRef: store.context.itemLabels,\n children: element\n })\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPositioner.displayName = \"MenuPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { MenuRadioGroupContext } from \"./MenuRadioGroupContext.mjs\";\nimport { MenuGroupContext } from \"../group/MenuGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups related radio items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuRadioGroup = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function MenuRadioGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n value: valueProp,\n defaultValue,\n onValueChange: onValueChangeProp,\n disabled = false,\n style,\n 'aria-labelledby': ariaLabelledByProp,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState(undefined);\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: 'MenuRadioGroup'\n });\n const setValue = useStableCallback((newValue, eventDetails) => {\n onValueChangeProp?.(newValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(newValue);\n });\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: {\n role: 'group',\n 'aria-labelledby': ariaLabelledByProp ?? labelId,\n 'aria-disabled': disabled || undefined,\n ...elementProps\n }\n });\n const context = React.useMemo(() => ({\n value,\n setValue,\n disabled\n }), [value, setValue, disabled]);\n return /*#__PURE__*/_jsx(MenuGroupContext.Provider, {\n value: setLabelId,\n children: /*#__PURE__*/_jsx(MenuRadioGroupContext.Provider, {\n value: context,\n children: element\n })\n });\n}));\nif (process.env.NODE_ENV !== \"production\") MenuRadioGroup.displayName = \"MenuRadioGroup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRadioGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRadioGroupContext.displayName = \"MenuRadioGroupContext\";\nexport function useMenuRadioGroupContext() {\n const context = React.useContext(MenuRadioGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.' : _formatErrorMessage(34));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useMenuRadioGroupContext } from \"../radio-group/MenuRadioGroupContext.mjs\";\nimport { MenuRadioItemContext } from \"./MenuRadioItemContext.mjs\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { REGULAR_ITEM, useMenuItem } from \"../item/useMenuItem.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * A menu item that works like a radio button in a given group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuRadioItem = /*#__PURE__*/React.forwardRef(function MenuRadioItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled: disabledProp = false,\n closeOnClick = false,\n value,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n guess: true,\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const {\n value: selectedValue,\n setValue: setSelectedValue,\n disabled: groupDisabled\n } = useMenuRadioGroupContext();\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp || groupDisabled || rootDisabled;\n const checked = selectedValue === value;\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = React.useMemo(() => ({\n disabled,\n highlighted,\n checked\n }), [disabled, highlighted, checked]);\n function handleClick(event) {\n const details = createChangeEventDetails(REASONS.itemPress, event.nativeEvent, undefined, {\n preventUnmountOnClose: NOOP\n });\n setSelectedValue(value, details);\n }\n const element = useRenderElement('div', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n props: [itemProps, {\n role: 'menuitemradio',\n 'aria-checked': checked,\n onClick: handleClick\n }, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n return /*#__PURE__*/_jsx(MenuRadioItemContext.Provider, {\n value: state,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuRadioItem.displayName = \"MenuRadioItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRadioItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRadioItemContext.displayName = \"MenuRadioItemContext\";\nexport function useMenuRadioItemContext() {\n const context = React.useContext(MenuRadioItemContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.' : _formatErrorMessage(35));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMenuRadioItemContext } from \"../radio-item/MenuRadioItemContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\n\n/**\n * Indicates whether the radio item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuRadioItemIndicator = /*#__PURE__*/React.forwardRef(function MenuRadioItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const item = useMenuRadioItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n mounted,\n setMounted\n } = useTransitionStatus(item.checked);\n useOpenChangeComplete({\n open: item.checked,\n ref: indicatorRef,\n onComplete() {\n if (!item.checked) {\n setMounted(false);\n }\n }\n });\n const state = {\n checked: item.checked,\n disabled: item.disabled,\n highlighted: item.highlighted,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n ref: [forwardedRef, indicatorRef],\n props: {\n 'aria-hidden': true,\n ...elementProps\n },\n enabled: keepMounted || mounted\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") MenuRadioItemIndicator.displayName = \"MenuRadioItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { FloatingTree, useDismiss, useFloatingNodeId, useFloatingParentNodeId, useListNavigation, useTypeahead, useSyncedFloatingRootContext } from \"../../floating-ui-react/index.mjs\";\nimport { MenuRootContext, useMenuRootContext } from \"./MenuRootContext.mjs\";\nimport { useMenubarContext } from \"../../menubar/MenubarContext.mjs\";\nimport { TYPEAHEAD_RESET_MS } from \"../../internals/constants.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { MenuStore } from \"../store/MenuStore.mjs\";\nimport { attachPreventUnmountOnClose, FOCUSABLE_POPUP_PROPS, setPopupOpenState, PopupHandleAttachment, useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nimport { useMenuSubmenuRootContext } from \"../submenu-root/MenuSubmenuRootContext.mjs\";\n\n/**\n * Groups all parts of the menu.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const MenuRoot = fastComponent(function MenuRoot(props) {\n const {\n children,\n open: openProp,\n onOpenChange,\n onOpenChangeComplete,\n defaultOpen = false,\n disabled: disabledProp = false,\n modal: modalProp,\n loopFocus = true,\n orientation = 'vertical',\n actionsRef,\n closeParentOnEsc = false,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n highlightItemOnHover = true\n } = props;\n const contextMenuContext = useContextMenuRootContext(true);\n const parentMenuRootContext = useMenuRootContext(true);\n const menubarContext = useMenubarContext(true);\n const isSubmenu = useMenuSubmenuRootContext();\n const parentFromContext = React.useMemo(() => {\n if (isSubmenu && parentMenuRootContext) {\n return {\n type: 'menu',\n store: parentMenuRootContext.store\n };\n }\n if (menubarContext) {\n return {\n type: 'menubar',\n context: menubarContext\n };\n }\n\n // Ensure this is not a Menu nested inside ContextMenu.Trigger.\n // ContextMenu parentContext is always undefined as ContextMenu.Root is instantiated with\n // <MenuRootContext.Provider value={undefined}>\n if (contextMenuContext && !parentMenuRootContext) {\n return {\n type: 'context-menu',\n context: contextMenuContext\n };\n }\n return {\n type: undefined\n };\n }, [contextMenuContext, parentMenuRootContext, menubarContext, isSubmenu]);\n const store = useMenuRootStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n parent: parentFromContext\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const rootId = useId();\n const floatingId = useId();\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);\n const floatingParentNodeIdFromContext = useFloatingParentNodeId();\n const open = store.useState('open');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const positionerElement = store.useState('positionerElement');\n const hoverEnabled = store.useState('hoverEnabled');\n const disabled = store.useState('disabled');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const parent = store.useState('parent');\n const activeIndex = store.useState('activeIndex');\n const payload = store.useState('payload');\n const floatingParentNodeId = store.useState('floatingParentNodeId');\n const openEventRef = React.useRef(null);\n const allowOutsidePressDismissalRef = React.useRef(parent.type !== 'context-menu');\n const allowOutsidePressDismissalTimeout = useTimeout();\n const allowTouchToCloseRef = React.useRef(true);\n const allowTouchToCloseTimeout = useTimeout();\n const nested = floatingParentNodeId != null;\n if (process.env.NODE_ENV !== 'production') {\n if (parent.type !== undefined && modalProp !== undefined) {\n console.warn('Base UI: The `modal` prop is not supported on nested menus. It will be ignored.');\n }\n }\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n store.useSyncedValues({\n disabled: disabledProp,\n highlightItemOnHover,\n modal: parent.type === undefined ? modalProp : undefined,\n openMethod,\n rootId\n });\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store, () => {\n store.set('allowMouseEnter', false);\n });\n useIsoLayoutEffect(() => {\n if (contextMenuContext && !parentMenuRootContext) {\n // This is a context menu root.\n // It doesn't support detached triggers yet, so we have to sync the parent context manually.\n store.update({\n parent: {\n type: 'context-menu',\n context: contextMenuContext\n },\n floatingNodeId: floatingNodeIdFromContext,\n floatingParentNodeId: floatingParentNodeIdFromContext\n });\n } else if (parentMenuRootContext) {\n store.update({\n floatingNodeId: floatingNodeIdFromContext,\n floatingParentNodeId: floatingParentNodeIdFromContext\n });\n }\n }, [contextMenuContext, parentMenuRootContext, floatingNodeIdFromContext, floatingParentNodeIdFromContext, store]);\n React.useEffect(() => {\n if (!open) {\n openEventRef.current = null;\n }\n if (parent.type !== 'context-menu') {\n return;\n }\n if (!open) {\n allowOutsidePressDismissalTimeout.clear();\n allowOutsidePressDismissalRef.current = false;\n return;\n }\n\n // With `mousedown` outside press events and long press touch input, there\n // needs to be a grace period after opening to ensure the dismissal event\n // doesn't fire immediately after open.\n allowOutsidePressDismissalTimeout.start(500, () => {\n allowOutsidePressDismissalRef.current = true;\n });\n }, [allowOutsidePressDismissalTimeout, open, parent.type]);\n useIsoLayoutEffect(() => {\n if (!open && !hoverEnabled) {\n store.set('hoverEnabled', true);\n }\n }, [open, hoverEnabled, store]);\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n const reason = eventDetails.reason;\n\n // Read the store directly, as relayed tree events and stale hover timers can request\n // a close after the state changed but before this component re-rendered.\n if (!nextOpen && !store.select('open')) {\n return;\n }\n if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) {\n return;\n }\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n\n // Do not immediately reset the activeTriggerId to allow\n // exit animations to play and focus to be returned correctly.\n if (!nextOpen && eventDetails.trigger == null) {\n eventDetails.trigger = activeTriggerElement ?? undefined;\n }\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const nativeEvent = eventDetails.event;\n if (nextOpen === false && nativeEvent?.type === 'click' && nativeEvent.pointerType === 'touch' && !allowTouchToCloseRef.current) {\n return;\n }\n\n // Prevent the menu from closing on mobile devices that have a delayed click event.\n // In some cases the menu, when tapped, will fire the focus event first and then the click event.\n // Without this guard, the menu will close immediately after opening.\n if (nextOpen && reason === REASONS.triggerFocus) {\n allowTouchToCloseRef.current = false;\n allowTouchToCloseTimeout.start(300, () => {\n allowTouchToCloseRef.current = true;\n });\n } else {\n allowTouchToCloseRef.current = true;\n allowTouchToCloseTimeout.clear();\n }\n\n // Keyboard and assistive-technology activations produce `detail === 0` clicks;\n // mouse-gesture clicks (including the synthesized drag-release click from\n // `useMenuItemCommonProps`) carry `detail >= 1`.\n const isKeyboardClick = (reason === REASONS.triggerPress || reason === REASONS.itemPress) && nativeEvent.detail === 0;\n const isDismissClose = !nextOpen && (reason === REASONS.escapeKey || reason == null);\n const updatedState = {\n open: nextOpen,\n openChangeReason: reason\n };\n openEventRef.current = eventDetails.event;\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n store.update(updatedState);\n if (parent.type === 'menubar' && (reason === REASONS.triggerFocus || reason === REASONS.focusOut || reason === REASONS.triggerHover || reason === REASONS.listNavigation || reason === REASONS.siblingOpen)) {\n store.set('instantType', 'group');\n } else if (isKeyboardClick || isDismissClose) {\n store.set('instantType', isKeyboardClick ? 'click' : 'dismiss');\n } else {\n store.set('instantType', undefined);\n }\n });\n const floatingRootContext = useSyncedFloatingRootContext({\n popupStore: store,\n floatingId,\n nested: floatingParentNodeIdFromContext != null,\n onOpenChange: setOpen\n });\n const floatingEvents = floatingRootContext.context.events;\n\n // Registered in a layout effect (not a passive one) so `setOpen` emits from imperative\n // `MenuHandle.open()` calls made in the same commit this root mounts — e.g. from another layout\n // effect during a route-transition handoff — are received instead of being silently dropped.\n useIsoLayoutEffect(() => {\n const handleSetOpenEvent = ({\n open: nextOpen,\n eventDetails\n }) => setOpen(nextOpen, eventDetails);\n floatingEvents.on('setOpen', handleSetOpenEvent);\n return () => {\n floatingEvents?.off('setOpen', handleSetOpenEvent);\n };\n }, [floatingEvents, setOpen]);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n let ctx;\n if (parent.type === 'context-menu') {\n ctx = parent.context;\n }\n React.useImperativeHandle(ctx?.positionerRef, () => positionerElement, [positionerElement]);\n React.useImperativeHandle(ctx?.actionsRef, () => ({\n setOpen\n }), [setOpen]);\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled,\n bubbles: {\n escapeKey: closeParentOnEsc && parent.type === 'menu'\n },\n outsidePress() {\n if (parent.type !== 'context-menu' || openEventRef.current?.type === 'contextmenu') {\n return true;\n }\n return allowOutsidePressDismissalRef.current;\n },\n externalTree: nested ? floatingTreeRoot : undefined\n });\n const direction = useDirection();\n const setActiveIndex = React.useCallback(index => {\n if (store.select('activeIndex') === index) {\n return;\n }\n store.set('activeIndex', index);\n }, [store]);\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !disabled,\n listRef: store.context.itemDomElements,\n activeIndex,\n nested: parent.type !== undefined,\n loopFocus,\n orientation,\n parentOrientation: parent.type === 'menubar' ? parent.context.orientation : undefined,\n rtl: direction === 'rtl',\n disabledIndices: EMPTY_ARRAY,\n onNavigate: setActiveIndex,\n openOnArrowKeyDown: parent.type !== 'context-menu',\n externalTree: nested ? floatingTreeRoot : undefined,\n focusItemOnHover: highlightItemOnHover\n });\n const onTyping = React.useCallback(nextTyping => {\n store.context.typingRef.current = nextTyping;\n }, [store]);\n const typeahead = useTypeahead(floatingRootContext, {\n enabled: !disabled,\n listRef: store.context.itemLabels,\n elementsRef: store.context.itemDomElements,\n activeIndex,\n resetMs: TYPEAHEAD_RESET_MS,\n onMatch: index => {\n if (open && index !== activeIndex) {\n store.set('activeIndex', index);\n }\n },\n onTyping\n });\n const activeTriggerProps = React.useMemo(() => {\n const mergedProps = mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, {\n onMouseMove() {\n store.set('allowMouseEnter', true);\n }\n }, interactionTypeProps);\n mergedProps['aria-haspopup'] = 'menu';\n mergedProps['aria-expanded'] = open;\n return mergedProps;\n }, [store, typeahead.reference, listNavigation.reference, dismiss.reference, interactionTypeProps, open]);\n const inactiveTriggerProps = React.useMemo(() => {\n const mergedProps = mergeProps(listNavigation.trigger, dismiss.trigger, interactionTypeProps);\n mergedProps['aria-haspopup'] = 'menu';\n mergedProps['aria-expanded'] = false;\n return mergedProps;\n }, [listNavigation.trigger, dismiss.trigger, interactionTypeProps]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {\n id: floatingId,\n role: 'menu',\n 'aria-labelledby': activeTriggerElement?.id,\n onMouseMove() {\n store.set('allowMouseEnter', true);\n if (parent.type === 'menu') {\n store.set('hoverEnabled', false);\n }\n },\n onClick() {\n if (store.select('hoverEnabled')) {\n store.set('hoverEnabled', false);\n }\n },\n onKeyDown(event) {\n // The Menubar's CompositeRoot captures keyboard events via\n // event delegation. This works well when Menu.Root is nested inside Menubar,\n // but with detached triggers we need to manually forward the event to the CompositeRoot.\n const relay = store.select('keyboardEventRelay');\n if (relay && !event.isPropagationStopped()) {\n relay(event);\n }\n }\n }, typeahead.floating, listNavigation.floating, dismiss.floating), [activeTriggerElement, floatingId, parent.type, store, typeahead.floating, listNavigation.floating, dismiss.floating]);\n const itemProps = listNavigation.item ?? EMPTY_OBJECT;\n usePopupInteractionProps(store, {\n floatingRootContext,\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n itemProps\n });\n const context = React.useMemo(() => ({\n store,\n parent: parentFromContext\n }), [store, parentFromContext]);\n const content = /*#__PURE__*/_jsxs(MenuRootContext.Provider, {\n value: context,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n if (parent.type === undefined || parent.type === 'context-menu') {\n // set up a FloatingTree to provide the context to nested menus\n return /*#__PURE__*/_jsx(FloatingTree, {\n externalTree: floatingTreeRoot,\n children: content\n });\n }\n return content;\n});\nif (process.env.NODE_ENV !== \"production\") MenuRoot.displayName = \"MenuRoot\";\nfunction useMenuRootStore(initialState) {\n // The store is owned by this Root instance and created exactly once. It is not tied to the handle:\n // the handle attaches to it, so swapping the handle re-attaches rather than recreating state.\n // Default values are only initial values; controlled values and root state are synced after creation.\n // Unlike other popups, Menu wires its floating root context separately (it relays open changes\n // through an event).\n const store = useRefWithInit(() => new MenuStore(initialState)).current;\n return store;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenubarContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") MenubarContext.displayName = \"MenubarContext\";\nexport function useMenubarContext(optional) {\n const context = React.useContext(MenubarContext);\n if (context === null && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.' : _formatErrorMessage(5));\n }\n return context;\n}","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_OBJECT, NOOP } from '@base-ui/utils/empty';\nimport { FloatingTreeStore } from \"../../floating-ui-react/components/FloatingTreeStore.mjs\";\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n disabled: state => state.parent.type === 'menubar' ? state.parent.context.disabled || state.disabled : state.disabled,\n modal: state => (state.parent.type === undefined || state.parent.type === 'context-menu') && (state.modal ?? true),\n openMethod: state => state.openMethod,\n allowMouseEnter: state => state.allowMouseEnter,\n highlightItemOnHover: state => state.highlightItemOnHover,\n parent: state => state.parent,\n rootId: state => {\n if (state.parent.type === 'menu') {\n return state.parent.store.select('rootId');\n }\n return state.parent.type !== undefined ? state.parent.context.rootId : state.rootId;\n },\n activeIndex: state => state.activeIndex,\n isActive: (state, itemIndex) => state.activeIndex === itemIndex,\n hoverEnabled: state => state.hoverEnabled,\n instantType: state => state.instantType,\n lastOpenChangeReason: state => state.openChangeReason,\n floatingTreeRoot: state => {\n if (state.parent.type === 'menu') {\n return state.parent.store.select('floatingTreeRoot');\n }\n return state.floatingTreeRoot;\n },\n floatingNodeId: state => state.floatingNodeId,\n floatingParentNodeId: state => state.floatingParentNodeId,\n itemProps: state => state.itemProps,\n closeDelay: state => state.closeDelay,\n adaptiveOrigin: state => state.adaptiveOrigin,\n keyboardEventRelay: state => {\n if (state.keyboardEventRelay) {\n return state.keyboardEventRelay;\n }\n if (state.parent.type === 'menu') {\n return state.parent.store.select('keyboardEventRelay');\n }\n return undefined;\n }\n};\n\n/**\n * The store view that detached handle-backed triggers read from. Both the real `MenuStore` and the\n * inert fallback store satisfy it, so a trigger can read from whichever store the handle currently\n * exposes. Narrowed to the members a trigger actually uses — the trigger-data members plus `setOpen`\n * (called by the focus guards) — so the exposed surface can't bypass the open-change pipeline; on\n * the detached fallback store every one of these mutations is a no-op.\n */\n\nexport class MenuStore extends ReactStore {\n constructor(initialState) {\n super({\n ...createInitialState(),\n ...initialState\n }, createInitialContext(), selectors);\n\n // Set up propagation of state from parent menu if applicable.\n this.unsubscribeParentListener = this.observe('parent', parent => {\n this.unsubscribeParentListener?.();\n if (parent.type === 'menu') {\n let rootId = parent.store.select('rootId');\n let floatingTreeRoot = parent.store.select('floatingTreeRoot');\n let keyboardEventRelay = parent.store.select('keyboardEventRelay');\n this.unsubscribeParentListener = parent.store.subscribe(() => {\n const nextRootId = parent.store.select('rootId');\n const nextFloatingTreeRoot = parent.store.select('floatingTreeRoot');\n const nextKeyboardEventRelay = parent.store.select('keyboardEventRelay');\n if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) {\n return;\n }\n rootId = nextRootId;\n floatingTreeRoot = nextFloatingTreeRoot;\n keyboardEventRelay = nextKeyboardEventRelay;\n this.notifyAll();\n });\n this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;\n return;\n }\n if (parent.type !== undefined) {\n this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;\n }\n this.unsubscribeParentListener = null;\n });\n }\n setOpen(open, eventDetails) {\n this.state.floatingRootContext.context.events.emit('setOpen', {\n open,\n eventDetails\n });\n }\n unsubscribeParentListener = null;\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no `Menu.Root` is\n * attached. It preserves a menu-specific trigger registry in context so detached triggers can\n * register before migrating to the live root store. `setOpen` is a no-op (matching the inert\n * reads/writes of `NullStore`), so a trigger can hand the store to focus-guard helpers that expect\n * `setOpen` without it ever taking effect while detached.\n */\nexport function createNullMenuStore() {\n const store = new NullStore(Object.freeze(createInitialState()), Object.freeze(createInitialContext()), selectors);\n return Object.assign(store, {\n setOpen: NOOP\n });\n}\nfunction createInitialContext() {\n return {\n positionerRef: /*#__PURE__*/React.createRef(),\n popupRef: /*#__PURE__*/React.createRef(),\n typingRef: {\n current: false\n },\n itemDomElements: {\n current: []\n },\n itemLabels: {\n current: []\n },\n allowMouseUpTriggerRef: {\n current: false\n },\n triggerFocusTargetRef: /*#__PURE__*/React.createRef(),\n beforeContentFocusGuardRef: /*#__PURE__*/React.createRef(),\n onOpenChangeComplete: undefined,\n triggerElements: new PopupTriggerMap()\n };\n}\nfunction createInitialState() {\n return {\n ...createInitialPopupStoreState(),\n disabled: false,\n modal: true,\n openMethod: null,\n allowMouseEnter: false,\n highlightItemOnHover: true,\n parent: {\n type: undefined\n },\n rootId: undefined,\n activeIndex: null,\n hoverEnabled: true,\n instantType: undefined,\n openChangeReason: null,\n floatingTreeRoot: new FloatingTreeStore(),\n floatingNodeId: undefined,\n floatingParentNodeId: null,\n itemProps: EMPTY_OBJECT,\n keyboardEventRelay: undefined,\n closeDelay: 0,\n adaptiveOrigin: undefined\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const MenuSubmenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuSubmenuRootContext.displayName = \"MenuSubmenuRootContext\";\nexport function useMenuSubmenuRootContext() {\n return React.useContext(MenuSubmenuRootContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { MenuRoot } from \"../root/MenuRoot.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { MenuSubmenuRootContext } from \"./MenuSubmenuRootContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport { useMenuSubmenuRootContext } from \"./MenuSubmenuRootContext.mjs\";\n\n/**\n * Groups all parts of a submenu.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport function MenuSubmenuRoot(props) {\n const parentMenu = useMenuRootContext().store;\n const contextValue = React.useMemo(() => ({\n parentMenu\n }), [parentMenu]);\n return /*#__PURE__*/_jsx(MenuSubmenuRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(MenuRoot, {\n ...props\n })\n });\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { safePolygon, useClick, useFloatingTree, useFocus, useHoverReferenceInteraction, useFloatingNodeId, useFloatingParentNodeId } from \"../../floating-ui-react/index.mjs\";\nimport { FloatingTreeStore } from \"../../floating-ui-react/components/FloatingTreeStore.mjs\";\nimport { contains } from \"../../floating-ui-react/utils.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { isMouseWithinBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { CompositeItem } from \"../../internals/composite/item/CompositeItem.mjs\";\nimport { useCompositeRootContext } from \"../../internals/composite/root/CompositeRootContext.mjs\";\nimport { findRootOwnerId } from \"../utils/findRootOwnerId.mjs\";\nimport { usePopupHandleStore, useTriggerDataForwarding } from \"../../utils/popups/index.mjs\";\nimport { useTriggerFocusGuards } from \"../../utils/popups/useTriggerFocusGuards.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useMixedToggleClickHandler } from \"../../utils/useMixedToggleClickHandler.mjs\";\nimport { useMenubarContext } from \"../../menubar/MenubarContext.mjs\";\nimport { PATIENT_CLICK_THRESHOLD } from \"../../internals/constants.mjs\";\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\n\n/**\n * A button that opens the menu.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const MenuTrigger = fastComponentRef(function MenuTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled: disabledProp = false,\n nativeButton = true,\n id: idProp,\n openOnHover: openOnHoverProp,\n delay = 100,\n closeDelay = 0,\n handle,\n payload,\n ...elementProps\n } = componentProps;\n const rootContext = useMenuRootContext(true);\n const handleStore = usePopupHandleStore(handle);\n const store = handleStore ?? rootContext?.store;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.' : _formatErrorMessage(85));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const floatingRootContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const popupId = store.useState('triggerPopupId', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const parent = useMenuParent();\n const compositeRootContext = useCompositeRootContext(true);\n const floatingTreeRootFromContext = useFloatingTree();\n const floatingTreeRoot = React.useMemo(() => {\n return floatingTreeRootFromContext ?? new FloatingTreeStore();\n }, [floatingTreeRootFromContext]);\n const floatingNodeId = useFloatingNodeId(floatingTreeRoot);\n const floatingParentNodeId = useFloatingParentNodeId();\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n closeDelay,\n parent,\n floatingTreeRoot,\n floatingNodeId,\n floatingParentNodeId,\n keyboardEventRelay: compositeRootContext?.relayKeyboardEvent\n });\n const isInMenubar = parent.type === 'menubar';\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n React.useEffect(() => {\n if (!isOpenedByThisTrigger && parent.type === undefined) {\n store.context.allowMouseUpTriggerRef.current = false;\n }\n }, [store, isOpenedByThisTrigger, parent.type]);\n const triggerRef = React.useRef(null);\n const allowMouseUpTriggerTimeout = useTimeout();\n const handleDocumentMouseUp = useStableCallback(mouseEvent => {\n if (!triggerRef.current) {\n return;\n }\n allowMouseUpTriggerTimeout.clear();\n store.context.allowMouseUpTriggerRef.current = false;\n const mouseUpTarget = mouseEvent.target;\n if (contains(triggerRef.current, mouseUpTarget) || contains(store.select('positionerElement'), mouseUpTarget) || mouseUpTarget === triggerRef.current) {\n return;\n }\n if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select('rootId')) {\n return;\n }\n if (isMouseWithinBounds(mouseEvent, triggerRef.current)) {\n return;\n }\n floatingTreeRoot.events.emit('close', {\n domEvent: mouseEvent,\n reason: REASONS.cancelOpen\n });\n });\n React.useEffect(() => {\n if (isOpenedByThisTrigger && store.select('lastOpenChangeReason') === REASONS.triggerHover) {\n const doc = ownerDocument(triggerRef.current);\n doc.addEventListener('mouseup', handleDocumentMouseUp, {\n once: true\n });\n }\n }, [isOpenedByThisTrigger, handleDocumentMouseUp, store]);\n const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;\n const openOnHover = openOnHoverProp ?? parentMenubarHasSubmenuOpen;\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: openOnHover && !disabled && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),\n handleClose: safePolygon({\n blockPointerEvents: !isInMenubar\n }),\n mouseOnly: true,\n move: false,\n restMs: parent.type === undefined ? delay : undefined,\n delay: {\n close: closeDelay\n },\n triggerElementRef,\n externalTree: floatingTreeRoot,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending'\n });\n\n // Whether to ignore clicks to open the menu.\n // `lastOpenChangeReason` doesn't need to be reactive here, as we need to run this\n // only when `isOpenedByThisTrigger` changes.\n const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select('lastOpenChangeReason'));\n const click = useClick(floatingRootContext, {\n enabled: !disabled,\n event: isOpenedByThisTrigger && isInMenubar ? 'click' : 'mousedown',\n toggle: true,\n ignoreMouse: false,\n stickIfOpen: parent.type === undefined ? stickIfOpen : false\n });\n const focus = useFocus(floatingRootContext, {\n enabled: !disabled && parentMenubarHasSubmenuOpen\n });\n const mixedToggleHandlers = useMixedToggleClickHandler({\n open: isOpenedByThisTrigger,\n enabled: isInMenubar,\n mouseDownAction: 'open'\n });\n const localInteractionProps = React.useMemo(() => mergeProps(focus.reference, click.reference), [focus.reference, click.reference]);\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n } = useTriggerFocusGuards(store, triggerElementRef);\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const ref = [triggerRef, forwardedRef, buttonRef, registerTrigger, triggerElementRef];\n const props = [localInteractionProps, hoverProps ?? EMPTY_OBJECT, rootTriggerProps, {\n 'aria-haspopup': 'menu',\n 'aria-controls': popupId,\n id: thisTriggerId,\n onMouseDown: event => {\n if (store.select('open')) {\n return;\n }\n\n // mousedown -> mouseup on menu item should not trigger it within 200ms.\n allowMouseUpTriggerTimeout.start(200, () => {\n store.context.allowMouseUpTriggerRef.current = true;\n });\n const doc = ownerDocument(event.currentTarget);\n doc.addEventListener('mouseup', handleDocumentMouseUp, {\n once: true\n });\n }\n }, isInMenubar ? {\n role: 'menuitem'\n } : {}, mixedToggleHandlers, elementProps, getButtonProps];\n const element = useRenderElement('button', componentProps, {\n enabled: !isInMenubar,\n stateAttributesMapping: pressableTriggerOpenStateMapping,\n state,\n ref,\n props\n });\n if (isInMenubar) {\n return /*#__PURE__*/_jsx(CompositeItem, {\n tag: \"button\",\n render: render,\n className: className,\n style: style,\n state: state,\n refs: ref,\n props: props,\n stateAttributesMapping: pressableTriggerOpenStateMapping\n });\n }\n\n // A fragment with key is required to ensure that the `element` is mounted to the same DOM node\n // regardless of whether the focus guards are rendered or not.\n\n if (isOpenedByThisTrigger) {\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(FocusGuard, {\n ref: preFocusGuardRef,\n onFocus: handlePreFocusGuardFocus\n }, `${thisTriggerId}-pre-focus-guard`), /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId), /*#__PURE__*/_jsx(FocusGuard, {\n ref: store.context.triggerFocusTargetRef,\n onFocus: handleFocusTargetFocus\n }, `${thisTriggerId}-post-focus-guard`)]\n });\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId);\n});\nif (process.env.NODE_ENV !== \"production\") MenuTrigger.displayName = \"MenuTrigger\";\n/**\n * Determines whether to ignore clicks after a hover-open.\n */\nfunction useStickIfOpen(open, openReason) {\n const stickIfOpenTimeout = useTimeout();\n const [stickIfOpen, setStickIfOpen] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (open && openReason === REASONS.triggerHover) {\n // Only allow \"patient\" clicks to close the menu if it's open.\n // If they clicked within 500ms of the menu opening, keep it open.\n setStickIfOpen(true);\n stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {\n setStickIfOpen(false);\n });\n } else if (!open) {\n stickIfOpenTimeout.clear();\n setStickIfOpen(false);\n }\n }, [open, openReason, stickIfOpenTimeout]);\n return stickIfOpen;\n}\nfunction useMenuParent() {\n const menubarContext = useMenubarContext(true);\n const parent = React.useMemo(() => {\n if (menubarContext) {\n return {\n type: 'menubar',\n context: menubarContext\n };\n }\n return {\n type: undefined\n };\n }, [menubarContext]);\n return parent;\n}","'use client';\n\nimport { EMPTY_OBJECT, EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../useRenderElement.mjs\";\nimport { useCompositeItem } from \"./useCompositeItem.mjs\";\nexport function CompositeItem(componentProps) {\n const {\n render,\n className,\n style,\n state = EMPTY_OBJECT,\n props = EMPTY_ARRAY,\n refs = EMPTY_ARRAY,\n metadata,\n stateAttributesMapping,\n tag = 'div',\n ...elementProps\n } = componentProps;\n const {\n compositeProps,\n compositeRef\n } = useCompositeItem({\n metadata\n });\n return useRenderElement(tag, componentProps, {\n state,\n // The composite ref attaches first so an outer item wins when nested items share a DOM node.\n ref: [compositeRef, ...refs],\n props: [compositeProps, ...props, elementProps],\n stateAttributesMapping\n });\n}","import { getParentNode, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function findRootOwnerId(node) {\n if (isHTMLElement(node) && node.hasAttribute('data-rootownerid')) {\n return node.getAttribute('data-rootownerid');\n }\n if (isLastTraversableNode(node)) {\n return undefined;\n }\n return findRootOwnerId(getParentNode(node));\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { contains, getNextTabbable, getTabbableAfterElement, getTabbableBeforeElement, isOutsideEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Minimal store interface required by the focus guard hook.\n * Both PopoverStore and MenuStore satisfy this interface.\n */\n\n/**\n * Provides focus guard handlers for popup triggers (Popover, Menu).\n *\n * When the popup is open, invisible focus guard elements are placed before and after\n * the trigger. These handlers close the popup and move focus to the appropriate\n * tabbable element when the guards receive focus (i.e. when the user tabs out).\n */\nexport function useTriggerFocusGuards(store, triggerElementRef) {\n const preFocusGuardRef = React.useRef(null);\n function handlePreFocusGuardFocus(event) {\n ReactDOM.flushSync(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));\n });\n const previousTabbable = getTabbableBeforeElement(preFocusGuardRef.current);\n previousTabbable?.focus();\n }\n function handleFocusTargetFocus(event) {\n const positionerElement = store.select('positionerElement');\n if (positionerElement && isOutsideEvent(event, positionerElement)) {\n store.context.beforeContentFocusGuardRef.current?.focus();\n } else {\n ReactDOM.flushSync(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));\n });\n let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);\n while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {\n const prevTabbable = nextTabbable;\n nextTabbable = getNextTabbable(nextTabbable);\n if (nextTabbable === prevTabbable) {\n break;\n }\n }\n nextTabbable?.focus();\n }\n }\n return {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\n/**\n * Returns `click` and `mousedown` handlers that fix the behavior of triggers of popups that are toggled by different events.\n * For example, a button that opens a popup on mousedown and closes it on click.\n * This hook prevents the popup from closing immediately after the mouse button is released.\n */\nexport function useMixedToggleClickHandler(params) {\n const {\n enabled = true,\n mouseDownAction,\n open\n } = params;\n const ignoreClickRef = React.useRef(false);\n return React.useMemo(() => {\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n return {\n onMouseDown: event => {\n if (mouseDownAction === 'open' && !open || mouseDownAction === 'close' && open) {\n ignoreClickRef.current = true;\n ownerDocument(event.currentTarget).addEventListener('click', () => {\n ignoreClickRef.current = false;\n }, {\n once: true\n });\n }\n },\n onClick: event => {\n if (ignoreClickRef.current) {\n ignoreClickRef.current = false;\n event.preventBaseUIHandler();\n }\n }\n };\n }, [enabled, mouseDownAction, open]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupViewportStateMapping, usePopupViewport } from \"../../utils/usePopupViewport.mjs\";\n\n/**\n * A viewport for displaying content transitions.\n * This component is only required if one popup can be opened by multiple triggers, its content\n * changes based on the trigger, and switching between them is animated.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuViewport = /*#__PURE__*/React.forwardRef(function MenuViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const {\n side\n } = useMenuPositionerContext();\n const instantType = store.useState('instantType');\n const {\n children: childrenToRender,\n state: viewportState\n } = usePopupViewport({\n store,\n side,\n children\n });\n const state = {\n activationDirection: viewportState.activationDirection,\n transitioning: viewportState.transitioning,\n instant: instantType\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [elementProps, {\n children: childrenToRender\n }],\n stateAttributesMapping: popupViewportStateMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuViewport.displayName = \"MenuViewport\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\n\n/**\n * A separator element accessible to screen readers.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)\n */\nexport const Separator = /*#__PURE__*/React.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {\n const {\n className,\n render,\n orientation = 'horizontal',\n style,\n ...elementProps\n } = componentProps;\n const state = {\n orientation\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'separator',\n 'aria-orientation': orientation\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") Separator.displayName = \"Separator\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { warn } from '@base-ui/utils/warn';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { platform } from '@base-ui/utils/platform';\nimport { safePolygon, useClick, useHoverReferenceInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useMenuItem } from \"../item/useMenuItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.mjs\";\nimport { useTriggerRegistration } from \"../../utils/popups/index.mjs\";\nimport { useMenuSubmenuRootContext } from \"../submenu-root/MenuSubmenuRootContext.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nconst VOICE_OVER_EXPANDED_PROPS = {\n 'aria-expanded': undefined\n};\n\n/**\n * A menu item that opens a submenu.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuSubmenuTrigger = /*#__PURE__*/React.forwardRef(function MenuSubmenuTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n label,\n id: idProp,\n nativeButton = false,\n openOnHover = true,\n delay = 100,\n closeDelay = 0,\n disabled: disabledProp = false,\n ...elementProps\n } = componentProps;\n const submenuRootContext = useMenuSubmenuRootContext();\n if (!submenuRootContext?.parentMenu) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.' : _formatErrorMessage(37));\n }\n const listItem = useCompositeListItem({\n guess: true,\n label\n });\n const menuPositionerContext = useMenuPositionerContext();\n const {\n store\n } = useMenuRootContext();\n const thisTriggerId = useBaseUiId(idProp);\n const open = store.useState('open');\n const floatingRootContext = store.useState('floatingRootContext');\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const popupId = store.useState('triggerPopupId', thisTriggerId);\n const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);\n const registerTrigger = React.useCallback(element => {\n const cleanup = baseRegisterTrigger(element);\n if (element !== null && store.select('open') && store.select('activeTriggerId') == null) {\n store.update({\n activeTriggerId: thisTriggerId,\n activeTriggerElement: element,\n closeDelay\n });\n }\n return cleanup;\n }, [baseRegisterTrigger, closeDelay, store, thisTriggerId]);\n const triggerElementRef = React.useRef(null);\n const handleTriggerElementRef = React.useCallback(el => {\n triggerElementRef.current = el;\n store.set('activeTriggerElement', el);\n }, [store]);\n store.useSyncedValue('closeDelay', closeDelay);\n const parentMenuStore = submenuRootContext.parentMenu;\n const rootDisabled = store.useState('disabled');\n const parentDisabled = parentMenuStore.useState('disabled');\n const disabled = disabledProp || rootDisabled || parentDisabled;\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n const element = triggerElementRef.current;\n if (element && isElementDisabled(element) && !disabled) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n warn(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \\`disabled\\` prop on the component instead of setting it on the rendered element.${ownerStackMessage}`);\n }\n });\n }\n const itemProps = parentMenuStore.useState('itemProps');\n const highlighted = parentMenuStore.useState('isActive', listItem.index);\n const itemMetadata = React.useMemo(() => ({\n type: 'submenu-trigger',\n setActive() {\n if (parentMenuStore.select('highlightItemOnHover')) {\n parentMenuStore.set('activeIndex', listItem.index);\n }\n }\n }), [parentMenuStore, listItem.index]);\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick: false,\n disabled,\n highlighted,\n id: thisTriggerId,\n store,\n typingRef: parentMenuStore.context.typingRef,\n nativeButton,\n itemMetadata,\n nodeId: menuPositionerContext?.context.nodeId\n });\n const hoverEnabled = store.useState('hoverEnabled');\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: hoverEnabled && openOnHover && !disabled,\n handleClose: safePolygon({\n blockPointerEvents: true\n }),\n mouseOnly: true,\n move: true,\n restMs: delay,\n delay: {\n open: delay,\n close: closeDelay\n },\n shouldOpen: delay > 0 ? () => parentMenuStore.select('allowMouseEnter') : undefined,\n triggerElementRef,\n externalTree: floatingTreeRoot,\n isClosing: () => store.select('transitionStatus') === 'ending',\n // Chrome can drop the trigger's `mouseleave` during a fast pointer sweep,\n // leaving a stale submenu open (see #5152) — cancel from `mouseout` too.\n guardStaleOpen: true\n });\n const click = useClick(floatingRootContext, {\n enabled: !disabled,\n event: 'mousedown',\n toggle: !openOnHover,\n ignoreMouse: openOnHover,\n stickIfOpen: false\n });\n const localInteractionProps = click.reference ?? EMPTY_OBJECT;\n const rootTriggerProps = store.useState('triggerProps', true);\n delete rootTriggerProps.id;\n const state = {\n disabled,\n highlighted,\n open\n };\n const openMethod = store.useState('openMethod');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n // Arrow keys open the submenu through list navigation without dispatching a click, so\n // `openMethod` stays null there; Enter and Space do dispatch one and report `keyboard`.\n const openedByKeyboard = lastOpenChangeReason === REASONS.listNavigation || openMethod === 'keyboard';\n const shouldOmitExpanded = open && openedByKeyboard && platform.screenReader.voiceOver;\n const element = useRenderElement('div', componentProps, {\n state,\n stateAttributesMapping: triggerOpenStateMapping,\n props: [localInteractionProps, hoverProps, rootTriggerProps, itemProps,\n // Opening a submenu changes the trigger's expanded state while the trigger still holds\n // focus, and VoiceOver announces that state change instead of the submenu item that focus\n // moves to a moment later, so the first item is never announced. Dropping the state while\n // the submenu is open avoids the announcement without claiming the submenu is collapsed;\n // `aria-haspopup` still conveys that the item opens a submenu.\n shouldOmitExpanded ? VOICE_OVER_EXPANDED_PROPS : undefined, {\n 'aria-controls': popupId,\n tabIndex: open || highlighted ? 0 : -1,\n onBlur() {\n if (highlighted) {\n parentMenuStore.set('activeIndex', null);\n }\n }\n }, elementProps, getItemProps],\n ref: [forwardedRef, listItem.ref, itemRef, registerTrigger, handleTriggerElementRef]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") MenuSubmenuTrigger.displayName = \"MenuSubmenuTrigger\";","import { createNullMenuStore } from \"./MenuStore.mjs\";\nimport { BasePopupHandle } from \"../../utils/popups/popupHandle.mjs\";\n\n/**\n * Controls a Menu imperatively and associates detached `Menu.Trigger` components with a `Menu.Root`.\n * Create one with `Menu.createHandle()` and pass it to the `handle` prop of the root and of any\n * triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class MenuHandle extends BasePopupHandle {\n constructor() {\n super(createNullMenuStore(), 'Menu');\n }\n\n /**\n * Opens the menu and associates it with the trigger with the given id.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the menu. The trigger must be a matching\n * `Menu.Trigger` with this handle passed as a prop.\n */\n open(triggerId) {\n this.openByTrigger(triggerId);\n }\n\n /**\n * Closes the menu.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n close() {\n this.closePopup();\n }\n\n /**\n * Whether the menu is currently open. Returns `false` while no root is attached to the handle.\n */\n get isOpen() {\n return this.attachedStore?.select('open') ?? false;\n }\n}\n\n/**\n * Creates a new handle to connect a Menu.Root with detached Menu.Trigger components.\n */\nexport function createMenuHandle() {\n return new MenuHandle();\n}","\"use client\";\nimport * as React from \"react\";\nimport { Menu } from \"@base-ui/react/menu\";\nimport { ChevronRight } from \"lucide-react\";\nimport { overlayLayers } from \"./overlay-layers\";\nimport { cn } from \"./utils\";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof Menu.Root>) { return <Menu.Root data-slot=\"dropdown-menu\" {...props} />; }\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof Menu.Group>) { return <Menu.Group data-slot=\"dropdown-menu-group\" {...props} />; }\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof Menu.SubmenuRoot>) { return <Menu.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />; }\nfunction DropdownMenuSubTrigger({ className, children, ...props }: React.ComponentProps<typeof Menu.SubmenuTrigger>) { return <Menu.SubmenuTrigger data-slot=\"dropdown-menu-sub-trigger\" className={cn(\"ds-type-menu-item focus:bg-surface-muted flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden\", className)} {...props}>{children}<ChevronRight className=\"ml-auto size-4 text-text-supporting\" /></Menu.SubmenuTrigger>; }\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof Menu.Popup>) { return <Menu.Portal><Menu.Positioner data-slot=\"dropdown-menu-sub-positioner\" className={overlayLayers.popup}><Menu.Popup data-slot=\"dropdown-menu-sub-content\" className={cn(\"min-w-56 overflow-hidden rounded-md border bg-surface-floating p-1 text-text-primary shadow-[var(--ds-shadow-floating)]\", className)} {...props} /></Menu.Positioner></Menu.Portal>; }\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof Menu.Trigger>) { return <Menu.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />; }\nfunction DropdownMenuContent({ className, sideOffset = 4, side, align, ...props }: React.ComponentProps<typeof Menu.Popup> & { sideOffset?: number; side?: React.ComponentProps<typeof Menu.Positioner>[\"side\"]; align?: React.ComponentProps<typeof Menu.Positioner>[\"align\"] }) { return <Menu.Portal><Menu.Positioner data-slot=\"dropdown-menu-positioner\" className={overlayLayers.popup} sideOffset={sideOffset} side={side} align={align}><Menu.Popup data-slot=\"dropdown-menu-content\" className={cn(\"min-w-40 overflow-hidden rounded-md border bg-surface-floating p-1 text-text-primary shadow-[var(--ds-shadow-floating)]\", className)} {...props} /></Menu.Positioner></Menu.Portal>; }\nfunction DropdownMenuItem({ className, inset, variant = \"default\", ...props }: React.ComponentProps<typeof Menu.Item> & { inset?: boolean; variant?: \"default\" | \"destructive\" }) { return <Menu.Item data-slot=\"dropdown-menu-item\" data-inset={inset} data-variant={variant} className={cn(\"ds-type-menu-item data-[variant=destructive]:text-danger-foreground data-highlighted:bg-surface-muted relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset=true]:pl-8\", className)} {...props} />; }\nfunction DropdownMenuLinkItem({ className, ...props }: React.ComponentProps<typeof Menu.LinkItem>) { return <Menu.LinkItem data-slot=\"dropdown-menu-link-item\" className={cn(\"ds-type-menu-item data-highlighted:bg-surface-muted flex items-center rounded-sm px-2 py-1.5 outline-hidden\", className)} {...props} />; }\nfunction DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<\"div\"> & { inset?: boolean }) { return <div role=\"presentation\" data-slot=\"dropdown-menu-label\" data-inset={inset} className={cn(\"ds-type-menu-label px-2 py-1.5 font-medium data-[inset=true]:pl-8\", className)} {...props} />; }\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof Menu.Separator>) { return <Menu.Separator data-slot=\"dropdown-menu-separator\" className={cn(\"-mx-1 my-1 h-px bg-border-default\", className)} {...props} />; }\nexport { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };\n","export { ComboboxRoot as Root } from \"./root/ComboboxRoot.mjs\";\nexport { ComboboxLabel as Label } from \"./label/ComboboxLabel.mjs\";\nexport { ComboboxValue as Value } from \"./value/ComboboxValue.mjs\";\nexport { ComboboxInput as Input } from \"./input/ComboboxInput.mjs\";\nexport { ComboboxInputGroup as InputGroup } from \"./input-group/ComboboxInputGroup.mjs\";\nexport { ComboboxTrigger as Trigger } from \"./trigger/ComboboxTrigger.mjs\";\nexport { ComboboxList as List } from \"./list/ComboboxList.mjs\";\nexport { ComboboxStatus as Status } from \"./status/ComboboxStatus.mjs\";\nexport { ComboboxPortal as Portal } from \"./portal/ComboboxPortal.mjs\";\nexport { ComboboxBackdrop as Backdrop } from \"./backdrop/ComboboxBackdrop.mjs\";\nexport { ComboboxPositioner as Positioner } from \"./positioner/ComboboxPositioner.mjs\";\nexport { ComboboxPopup as Popup } from \"./popup/ComboboxPopup.mjs\";\nexport { ComboboxArrow as Arrow } from \"./arrow/ComboboxArrow.mjs\";\nexport { ComboboxIcon as Icon } from \"./icon/ComboboxIcon.mjs\";\nexport { ComboboxGroup as Group } from \"./group/ComboboxGroup.mjs\";\nexport { ComboboxGroupLabel as GroupLabel } from \"./group-label/ComboboxGroupLabel.mjs\";\nexport { ComboboxItem as Item } from \"./item/ComboboxItem.mjs\";\nexport { ComboboxItemIndicator as ItemIndicator } from \"./item-indicator/ComboboxItemIndicator.mjs\";\nexport { ComboboxChips as Chips } from \"./chips/ComboboxChips.mjs\";\nexport { ComboboxChip as Chip } from \"./chip/ComboboxChip.mjs\";\nexport { ComboboxChipRemove as ChipRemove } from \"./chip-remove/ComboboxChipRemove.mjs\";\nexport { ComboboxRow as Row } from \"./row/ComboboxRow.mjs\";\nexport { ComboboxCollection as Collection } from \"./collection/ComboboxCollection.mjs\";\nexport { ComboboxEmpty as Empty } from \"./empty/ComboboxEmpty.mjs\";\nexport { ComboboxClear as Clear } from \"./clear/ComboboxClear.mjs\";\nexport { ComboboxSeparator as Separator } from \"./separator/ComboboxSeparator.mjs\";\nexport { useComboboxFilter as useFilter } from \"./root/utils/useFilter.mjs\";\nexport { useFilteredItems } from \"./root/utils/useFilteredItems.mjs\";","'use client';\n\nimport * as React from 'react';\nimport { AriaCombobox } from \"./AriaCombobox.mjs\";\n\n/**\n * Groups all parts of the combobox.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxRoot(props) {\n const {\n multiple = false,\n defaultValue,\n value,\n onValueChange,\n autoComplete,\n ...other\n } = props;\n return /*#__PURE__*/_jsx(AriaCombobox, {\n ...other,\n selectionMode: multiple ? 'multiple' : 'single',\n selectedValue: value,\n defaultSelectedValue: defaultValue,\n onSelectedValueChange: onValueChange,\n formAutoComplete: autoComplete\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { Store, useStore } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { getOverflowAncestors, useDismiss, useFloatingRootContext, useListNavigation, useClick } from \"../../floating-ui-react/index.mjs\";\nimport { gridNavigation } from \"../../floating-ui-react/hooks/gridNavigation.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails, createGenericEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { ComboboxFloatingContext, ComboboxDerivedItemsContext, ComboboxHasItemsContext, ComboboxRootContext, ComboboxInputValueContext } from \"./ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createCollatorItemFilter } from \"./utils/index.mjs\";\nimport { useCoreFilter } from \"./utils/useFilter.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { isScrollableY } from \"../../utils/scrollable.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { NOOP } from \"../../internals/noop.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { stringifyAsLabel, stringifyAsValue, isGroupedItems } from \"../../internals/resolveValueLabel.mjs\";\nimport { compareItemEquality, defaultItemEquality, findSelectionIndex, removeItem, selectedValueIncludes } from \"../../internals/itemEquality.mjs\";\nimport { areArraysEqual } from \"../../internals/areArraysEqual.mjs\";\nimport { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from \"./utils/constants.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\n\n/**\n * @internal\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function AriaCombobox(props) {\n const {\n id: idProp,\n onOpenChangeComplete: onOpenChangeCompleteProp,\n defaultSelectedValue = null,\n selectedValue: selectedValueProp,\n onSelectedValueChange,\n defaultInputValue: defaultInputValueProp,\n inputValue: inputValueProp,\n open: openProp,\n defaultOpen = false,\n selectionMode,\n onItemHighlighted: onItemHighlightedProp,\n name: nameProp,\n form,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n inputRef: inputRefProp,\n grid = false,\n items,\n filteredItems: filteredItemsProp,\n filter: filterProp,\n openOnInputClick = true,\n autoHighlight = false,\n keepHighlight = false,\n highlightItemOnHover = true,\n loopFocus = true,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n virtualized = false,\n inline: inlineProp = false,\n fillInputOnItemPress = true,\n modal = false,\n limit = -1,\n autoComplete = 'list',\n formAutoComplete,\n locale,\n submitOnItemClick = false\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const direction = useDirection();\n const id = useLabelableId({\n id: idProp\n });\n const collatorFilter = useCoreFilter({\n locale\n });\n const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React.useState(false);\n const [closeQuery, setCloseQuery] = React.useState(null);\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const inputRef = React.useRef(null);\n const startDismissRef = React.useRef(null);\n const endDismissRef = React.useRef(null);\n const emptyRef = React.useRef(null);\n const keyboardActiveRef = React.useRef(true);\n const hadInputClearRef = React.useRef(false);\n const chipsContainerRef = React.useRef(null);\n const clearRef = React.useRef(null);\n const selectionEventRef = React.useRef(null);\n const lastHighlightRef = React.useRef(INITIAL_LAST_HIGHLIGHT);\n const pendingQueryHighlightRef = React.useRef(null);\n\n /**\n * Contains the currently visible list of item values post-filtering.\n */\n const valuesRef = React.useRef([]);\n /**\n * The item element that received the last `pointerdown`, used to detect whether a\n * `mouseup` on an item belongs to a drag-select gesture that started elsewhere.\n */\n const pointerDownItemRef = React.useRef(null);\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const multiple = selectionMode === 'multiple';\n const single = selectionMode === 'single';\n const hasInputValue = inputValueProp !== undefined || defaultInputValueProp !== undefined;\n const hasItems = items !== undefined;\n const hasFilteredItemsProp = filteredItemsProp !== undefined;\n let autoHighlightMode;\n if (autoHighlight === 'always') {\n autoHighlightMode = 'always';\n } else {\n autoHighlightMode = autoHighlight ? 'input-change' : false;\n }\n const [selectedValue, setSelectedValueUnwrapped] = useControlled({\n controlled: selectedValueProp,\n default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,\n name: 'Combobox',\n state: 'selectedValue'\n });\n const filter = React.useMemo(() => {\n if (filterProp === null) {\n return () => true;\n }\n if (filterProp !== undefined) {\n return filterProp;\n }\n // `shouldBypassFiltering` already empties the query whenever a single selection's label\n // matches it exactly, so the filter never needs a selection-aware variant here.\n return createCollatorItemFilter(collatorFilter, itemToStringLabel);\n }, [filterProp, collatorFilter, itemToStringLabel]);\n\n // If neither inputValue nor defaultInputValue are provided, derive it from the\n // selected value for single mode so the input reflects the selection on mount.\n const initialDefaultInputValue = useRefWithInit(() => {\n if (hasInputValue) {\n return defaultInputValueProp ?? '';\n }\n if (single) {\n return stringifyAsLabel(selectedValue, itemToStringLabel);\n }\n return '';\n }).current;\n const [inputValue, setInputValueUnwrapped] = useControlled({\n controlled: inputValueProp,\n default: initialDefaultInputValue,\n name: 'Combobox',\n state: 'inputValue'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Combobox',\n state: 'open'\n });\n const isGrouped = isGroupedItems(items);\n const query = closeQuery ?? String(inputValue).trim();\n const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : '';\n const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== '' && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);\n const filterQuery = shouldBypassFiltering ? '' : query;\n const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;\n const flatItems = React.useMemo(() => {\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n return items.flatMap(group => group.items);\n }\n return items;\n }, [items, isGrouped]);\n const filteredItems = React.useMemo(() => {\n if (filteredItemsProp && !shouldIgnoreExternalFiltering) {\n return filteredItemsProp;\n }\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n const groupedItems = items;\n const resultingGroups = [];\n let currentCount = 0;\n for (const group of groupedItems) {\n if (limit > -1 && currentCount >= limit) {\n break;\n }\n const remainingLimit = limit > -1 ? limit - currentCount : Infinity;\n const itemsToTake = filterQuery === '' ? group.items.slice(0, remainingLimit) : [];\n if (filterQuery !== '') {\n for (const item of group.items) {\n if (itemsToTake.length >= remainingLimit) {\n break;\n }\n if (filter(item, filterQuery, itemToStringLabel)) {\n itemsToTake.push(item);\n }\n }\n }\n if (itemsToTake.length > 0) {\n const newGroup = {\n ...group,\n items: itemsToTake\n };\n resultingGroups.push(newGroup);\n currentCount += itemsToTake.length;\n }\n }\n return resultingGroups;\n }\n if (filterQuery === '') {\n return limit > -1 ? flatItems.slice(0, limit) :\n // The cast here is done as `flatItems` is readonly.\n // valuesRef.current, a mutable ref, can be set to `flatFilteredItems`, which may\n // reference this exact readonly value, creating a mutation risk.\n // However, <Combobox.Item> can never mutate this value as the mutating effect\n // bails early when `items` is provided, and this is only ever returned\n // when `items` is provided due to the early return at the top of this hook.\n flatItems;\n }\n const limitedItems = [];\n for (const item of flatItems) {\n if (limit > -1 && limitedItems.length >= limit) {\n break;\n }\n if (filter(item, filterQuery, itemToStringLabel)) {\n limitedItems.push(item);\n }\n }\n return limitedItems;\n }, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, itemToStringLabel, flatItems]);\n const flatFilteredItems = React.useMemo(() => {\n if (isGrouped) {\n const groups = filteredItems;\n return groups.flatMap(g => g.items);\n }\n return filteredItems;\n }, [filteredItems, isGrouped]);\n const store = useRefWithInit(() => {\n // An inline list open on the first render never gets a closed pass of the closed-state\n // sync effect below, and `items`-prop lists don't self-register their index the way\n // individually rendered `<Combobox.Item>`s do, so the selected item was never highlighted.\n // Seeding the index here lets list navigation highlight and scroll to the selection on\n // mount. Computed once by construction, so a selection or list that resolves after mount\n // doesn't move an existing highlight or scroll the list away.\n let initialSelectedIndex = null;\n if (inlineProp && open && hasItems && selectionMode !== 'none') {\n initialSelectedIndex = findSelectionIndex(flatFilteredItems, selectedValue, isItemEqualToValue, multiple);\n }\n return new Store({\n id,\n labelId: undefined,\n selectedValue,\n open,\n items,\n selectionMode,\n listRef,\n labelsRef,\n popupRef,\n emptyRef,\n inputRef,\n startDismissRef,\n endDismissRef,\n keyboardActiveRef,\n chipsContainerRef,\n clearRef,\n valuesRef,\n pointerDownItemRef,\n selectionEventRef,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n isItemEqualToValue,\n modal,\n autoHighlight: autoHighlightMode,\n submitOnItemClick,\n hasInputValue,\n mounted: false,\n forceMounted: false,\n transitionStatus: 'idle',\n inline: inlineProp,\n activeIndex: null,\n selectedIndex: initialSelectedIndex,\n popupProps: {},\n listProps: {},\n inputProps: {},\n triggerProps: {},\n itemProps: EMPTY_OBJECT,\n positionerElement: null,\n listElement: null,\n popupId: undefined,\n triggerElement: null,\n inputElement: null,\n inputGroupElement: null,\n popupSide: null,\n openMethod: null,\n inputInsidePopup: true,\n // Avoid duplicate names in the server HTML. Popup inputs aren't rendered\n // until after hydration, so the hidden input takes over then if needed.\n inputOwnsFormValue: selectionMode === 'none',\n // Placeholder callbacks replaced on first render\n onOpenChangeComplete: NOOP,\n setOpen: NOOP,\n setInputValue: NOOP,\n setSelectedValue: NOOP,\n setIndices: NOOP,\n handleSelection: NOOP,\n forceMount: NOOP,\n requestSubmit: NOOP\n });\n }).current;\n const fieldRawValue = selectionMode === 'none' ? inputValue : selectedValue;\n const fieldStringValue = React.useMemo(() => {\n if (selectionMode === 'none') {\n return fieldRawValue;\n }\n if (Array.isArray(selectedValue)) {\n return selectedValue.map(value => stringifyAsValue(value, itemToStringValue));\n }\n return stringifyAsValue(selectedValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);\n const onItemHighlighted = useStableCallback(onItemHighlightedProp);\n const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputElement = useStore(store, selectors.inputElement);\n const inputGroupElement = useStore(store, selectors.inputGroupElement);\n const inline = useStore(store, selectors.inline);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const inputOwnsFormValue = useStore(store, selectors.inputOwnsFormValue);\n const triggerRef = useValueAsRef(triggerElement);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const {\n openMethod,\n triggerProps\n } = useOpenInteractionType(open);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);\n const forceMount = useStableCallback(() => {\n if (items) {\n // Ensure typeahead works on a closed list.\n labelsRef.current = flatFilteredItems.map(item => stringifyAsLabel(item, itemToStringLabel));\n } else {\n store.set('forceMounted', true);\n }\n });\n\n /**\n * Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`\n * (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.\n */\n const emitHighlight = useStableCallback((value, index, type) => {\n if (index === -1) {\n if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) {\n return;\n }\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n } else {\n lastHighlightRef.current = {\n value,\n index\n };\n }\n onItemHighlighted(value, createGenericEventDetails(type, undefined, {\n index\n }));\n });\n const setIndices = useStableCallback(options => {\n store.update(options);\n const activeIndexOption = options.activeIndex;\n if (activeIndexOption === undefined) {\n return;\n }\n const type = options.type || REASONS.none;\n if (activeIndexOption === null) {\n emitHighlight(undefined, -1, type);\n } else {\n emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type);\n }\n });\n const setInputValue = useStableCallback((next, eventDetails) => {\n hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;\n props.onInputValueChange?.(next, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n\n // If user is typing, ensure we don't auto-highlight on open due to a race\n // with the post-open effect that sets this flag.\n if (eventDetails.reason === REASONS.inputChange) {\n // A controlled popup may ignore a close request. Resuming input proves the popup\n // is remaining open, so release the query captured for an exit animation.\n if (open && closeQuery !== null) {\n setCloseQuery(null);\n }\n const event = eventDetails.event;\n const inputType = event.inputType;\n // Treat composition commits as typed input; autofill may omit `inputType` or\n // report `insertReplacementText`.\n const isTypedInput = event.type === 'compositionend' || inputType != null && inputType !== '' && inputType !== 'insertReplacementText';\n if (isTypedInput) {\n const hasQuery = next.trim() !== '';\n if (hasQuery) {\n setQueryChangedAfterOpen(true);\n }\n // Defer index updates until after the filtered items have been derived to ensure\n // `onItemHighlighted` receives the latest item.\n pendingQueryHighlightRef.current = {\n hasQuery\n };\n\n // Virtualized lists own their scroller. Reset regular lists directly so a stale\n // composite registry cannot select a reordered item and scrolling cannot escape\n // the popup.\n const list = store.state.listElement;\n if (!store.state.virtualized && list) {\n const popup = popupRef.current;\n for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {\n if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute('role') === 'dialog')) {\n break;\n }\n if (isScrollableY(ancestor)) {\n ancestor.scrollTop = 0;\n break;\n }\n }\n }\n if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) {\n store.set('activeIndex', 0);\n }\n }\n } else if (eventDetails.reason === REASONS.inputClear && next === '' && store.state.inputInsidePopup) {\n // A programmatic clear of an active query (e.g. after selecting an item with the\n // input inside the popup): restore the highlight to the selected item.\n pendingQueryHighlightRef.current = {\n hasQuery: false,\n selection: true\n };\n }\n setInputValueUnwrapped(next);\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n if (open === nextOpen) {\n return;\n }\n\n // If the `Empty` component is not used, the positioner or popup should be hidden\n // with CSS. In this case, allow the Escape key to bubble to close a parent popup\n // if there are no items to show.\n if (eventDetails.reason === REASONS.escapeKey && hasItems && flatFilteredItems.length === 0 && !emptyRef.current) {\n eventDetails.allowPropagation();\n }\n props.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n\n // If reopening interrupts the close animation, handleUnmount won't run to clear the\n // frozen closeQuery and pending popup input.\n if (nextOpen && inputInsidePopup && !inline && closeQuery !== null) {\n setQueryChangedAfterOpen(false);\n setCloseQuery(null);\n if (inputValue !== '' && eventDetails.reason !== REASONS.inputChange) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));\n }\n }\n if (!nextOpen && queryChangedAfterOpen) {\n if (single) {\n if (!inline) {\n setCloseQuery(query);\n }\n // Avoid a flicker when closing the popup with an empty query.\n if (query === '') {\n setQueryChangedAfterOpen(false);\n }\n } else if (multiple) {\n if (!inline) {\n // Freeze the current query so filtering remains stable while exiting.\n setCloseQuery(query);\n }\n if (inputInsidePopup) {\n setIndices({\n activeIndex: null\n });\n }\n\n // Clear the input immediately on close while retaining filtering via closeQuery for exit animations\n // if the input is outside the popup. When the input is inside the popup, defer the clear until\n // unmount so the filtered list doesn't flash to unfiltered during the exit animation.\n if (!inputInsidePopup || inline) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));\n }\n }\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && inputInsidePopup && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n }\n });\n const setSelectedValue = useStableCallback((nextValue, eventDetails) => {\n // Cast to `any` due to conditional value type (single vs. multiple).\n // The runtime implementation already ensures the correct value shape.\n onSelectedValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setSelectedValueUnwrapped(nextValue);\n const shouldFillInput = selectionMode === 'none' && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;\n if (shouldFillInput) {\n setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));\n }\n });\n const handleSelection = useStableCallback((event, itemValue) => {\n const targetEl = getTarget(event);\n const overrideEvent = selectionEventRef.current ?? event;\n selectionEventRef.current = null;\n const eventDetails = createChangeEventDetails(REASONS.itemPress, overrideEvent);\n\n // Let the link handle the click.\n const href = targetEl?.closest('a')?.getAttribute('href');\n if (href) {\n if (href.startsWith('#')) {\n setOpen(false, eventDetails);\n }\n return;\n }\n if (multiple) {\n const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];\n const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);\n const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];\n setSelectedValue(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== '' : false;\n if (!wasFiltering) {\n return;\n }\n if (store.state.inputInsidePopup) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));\n } else {\n setOpen(false, eventDetails);\n }\n } else {\n setSelectedValue(itemValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(false, eventDetails);\n }\n });\n const requestSubmit = useStableCallback(() => {\n const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;\n if (formElement && typeof formElement.requestSubmit === 'function') {\n formElement.requestSubmit();\n }\n });\n const handleUnmount = useStableCallback(() => {\n setMounted(false);\n onOpenChangeComplete?.(false);\n setQueryChangedAfterOpen(false);\n setCloseQuery(null);\n if (selectionMode === 'none') {\n setIndices({\n activeIndex: null,\n selectedIndex: null\n });\n } else {\n setIndices({\n activeIndex: null\n });\n }\n\n // Multiple selection mode:\n // If the user typed a filter and didn't select in multiple mode, clear the input\n // after close completes to avoid mid-exit flicker and start fresh on next open.\n if (multiple && inputRef.current && inputRef.current.value !== '' && !hadInputClearRef.current) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n\n // Single selection mode:\n // - If input is rendered inside the popup, clear it so the next open is blank\n // - If input is outside the popup, sync it to the selected value\n if (single) {\n if (store.state.inputInsidePopup) {\n if (inputRef.current && inputRef.current.value !== '') {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n } else {\n const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel);\n if (inputRef.current && inputRef.current.value !== stringVal) {\n // If no selection was made, treat this as clearing the typed filter.\n const reason = stringVal === '' ? REASONS.inputClear : REASONS.none;\n setInputValue(stringVal, createChangeEventDetails(reason));\n }\n }\n }\n });\n\n // Support composing the Dialog component around an inline combobox.\n // `[role=\"dialog\"]` is more interoperable than using a context, e.g. it can work\n // with third-party modal libraries, though the limitation is that the closest\n // `role=dialog` part must be the animated element.\n const resolvedPopupRef = React.useMemo(() => {\n if (inline && positionerElement) {\n return {\n current: positionerElement.closest('[role=\"dialog\"]')\n };\n }\n return popupRef;\n }, [inline, positionerElement]);\n useOpenChangeComplete({\n enabled: !props.actionsRef,\n open,\n ref: resolvedPopupRef,\n onComplete() {\n if (!open) {\n handleUnmount();\n }\n }\n });\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: handleUnmount\n }), [handleUnmount]);\n useIsoLayoutEffect(function syncClosedState() {\n if (open) {\n return;\n }\n\n // State-driven (not tied to the internal event path) so controlled closes\n // also clear a pointerdown that never received a matching item mouseup.\n pointerDownItemRef.current = null;\n if (selectionMode === 'none') {\n return;\n }\n\n // Without `items`, look the selection up in the live registry of mounted item\n // values (the list stays mounted while closed when closed-state features need\n // it — trigger interaction and rendered-label autofill force-mount it). Mounted\n // items re-assert the index themselves when their registration moves; when\n // nothing is mounted the lookup resolves to `null` and each item re-registers\n // the index on the next open.\n const registry = hasItems ? flatItems : valuesRef.current;\n setIndices({\n selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple)\n });\n }, [open, selectedValue, selectionMode, multiple, hasItems, flatItems, isItemEqualToValue, setIndices]);\n useIsoLayoutEffect(() => {\n if (items) {\n valuesRef.current = flatFilteredItems;\n listRef.current.length = flatFilteredItems.length;\n }\n }, [items, flatFilteredItems]);\n useIsoLayoutEffect(() => {\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight) {\n // A directly rendered list remains visible when the popup state is closed, while a\n // kept-mounted Positioner is hidden and should stay inert.\n const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;\n if (pendingHighlight.hasQuery) {\n if (autoHighlightMode && listIsNavigable) {\n store.set('activeIndex', 0);\n }\n pendingQueryHighlightRef.current = null;\n } else if (String(inputValue).trim() === '') {\n // Only handle the clear once it has committed (a controlled input may reject it),\n // so a restore cannot fire while a query is still active.\n pendingQueryHighlightRef.current = null;\n if (listIsNavigable) {\n const clearedBySelection = pendingHighlight.selection;\n if (autoHighlightMode === 'always' && !clearedBySelection && store.state.selectionMode === 'none') {\n // There is no selection to restore in Autocomplete. Keep the first-item reset\n // synchronous so list navigation sees it before a directly rendered list closes.\n store.set('activeIndex', 0);\n }\n\n // Items re-mounted by the clear publish their composite indices in a follow-up\n // commit, so the item registries are mid-update here. Defer past React's cascade.\n queueMicrotask(() => {\n if (!store.state.open && !store.state.inline || inputRef.current && inputRef.current.value.trim() !== '') {\n return;\n }\n\n // Return the highlight to the selected item, the same anchor the popup uses\n // when it first opens. Read the selection through the store so consumers can\n // pass an inline `isItemEqualToValue` or a fresh `selectedValue` array without\n // re-running this effect on every render.\n const currentSelectedValue = store.state.selectedValue;\n const isMultiple = store.state.selectionMode === 'multiple';\n const lastSelectedValue = isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue[currentSelectedValue.length - 1] : currentSelectedValue;\n const hasSelection = store.state.selectionMode !== 'none' && lastSelectedValue != null;\n if (hasSelection || clearedBySelection) {\n const registry = hasItems || hasFilteredItemsProp ? flatFilteredItems : valuesRef.current;\n // A selection that is no longer in the list drops the highlight rather than\n // leaving it on whichever item now occupies that index.\n store.set('activeIndex', hasSelection ? findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple) : null);\n } else if (autoHighlightMode === 'always') {\n store.set('activeIndex', 0);\n }\n });\n }\n }\n }\n if (!open && !inline) {\n return;\n }\n const shouldUseFlatFilteredItems = hasItems || hasFilteredItemsProp;\n const candidateItems = shouldUseFlatFilteredItems ? flatFilteredItems : valuesRef.current;\n const storeActiveIndex = store.state.activeIndex;\n if (storeActiveIndex == null) {\n if (autoHighlightMode === 'always' && candidateItems.length > 0) {\n store.set('activeIndex', 0);\n return;\n }\n emitHighlight(undefined, -1, REASONS.none);\n return;\n }\n if (storeActiveIndex >= candidateItems.length) {\n emitHighlight(undefined, -1, REASONS.none);\n store.set('activeIndex', null);\n return;\n }\n const itemValue = candidateItems[storeActiveIndex];\n const previouslyHighlightedItemValue = lastHighlightRef.current.value;\n const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);\n if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {\n emitHighlight(itemValue, storeActiveIndex, REASONS.none);\n }\n }, [activeIndex, autoHighlightMode, emitHighlight, hasFilteredItemsProp, hasItems, flatFilteredItems, inline, open, store,\n // Reruns the effect when the query changes without affecting the deps above, such as\n // clearing the input when no items are filtered out (individually rendered items).\n inputValue]);\n useIsoLayoutEffect(() => {\n if (selectionMode === 'none') {\n setFilled(String(inputValue) !== '');\n return;\n }\n setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);\n }, [setFilled, selectionMode, inputValue, selectedValue, multiple]);\n\n // Ensures that the active index is not set to 0 when the list is empty.\n // This avoids needing to press ArrowDown twice under certain conditions.\n React.useEffect(() => {\n if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) {\n setIndices({\n activeIndex: null\n });\n }\n }, [hasItems, autoHighlightMode, flatFilteredItems.length, setIndices]);\n function isSelectedValueDirty(value) {\n const initialValue = validityData.initialValue;\n if (Array.isArray(value) && Array.isArray(initialValue)) {\n return !areArraysEqual(value, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));\n }\n return value !== initialValue;\n }\n useValueChanged(query, () => {\n if (!open || query === '' || query === String(initialDefaultInputValue)) {\n return;\n }\n setQueryChangedAfterOpen(true);\n });\n function syncInputToSelectedLabel() {\n const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);\n if (inputValue !== nextInputValue) {\n setInputValue(nextInputValue, createChangeEventDetails(REASONS.none));\n }\n }\n useValueChanged(selectedValue, () => {\n if (selectionMode === 'none') {\n return;\n }\n clearErrors(name);\n setDirty(isSelectedValueDirty(selectedValue));\n validation.change(selectedValue);\n if (single && !hasInputValue && !inputInsidePopup) {\n syncInputToSelectedLabel();\n }\n });\n useValueChanged(inputValue, () => {\n if (selectionMode !== 'none') {\n return;\n }\n clearErrors(name);\n setDirty(inputValue !== validityData.initialValue);\n validation.change(inputValue);\n });\n useValueChanged(items, () => {\n if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) {\n return;\n }\n syncInputToSelectedLabel();\n });\n const floatingRootContext = useFloatingRootContext({\n open: inline ? true : open,\n onOpenChange: setOpen,\n elements: {\n reference: inputInsidePopup ? triggerElement : inputElement,\n floating: positionerElement\n }\n });\n const ariaHasPopup = grid ? 'grid' : 'listbox';\n // An inline list isn't gated on `open`: it renders for as long as it's in the tree, so the\n // combobox is permanently expanded even while the internal open state is `false`.\n const expanded = open || inline;\n const ariaExpanded = expanded ? 'true' : 'false';\n const role = React.useMemo(() => {\n const isPlainInput = inputElement?.tagName === 'INPUT';\n // During SSR and initial hydration, the input ref is not available yet.\n // Assume an input-like control so combobox ARIA attributes are present.\n const shouldTreatAsInput = inputElement == null || isPlainInput;\n // A non-input control only takes on combobox semantics while the list is exposed, which for\n // an inline list is the whole time.\n const shouldApplyAria = shouldTreatAsInput || expanded;\n const reference = shouldTreatAsInput ? {\n autoComplete: 'off',\n spellCheck: 'false',\n autoCorrect: 'off',\n autoCapitalize: 'none'\n } : {};\n if (shouldApplyAria) {\n reference.role = 'combobox';\n reference['aria-expanded'] = ariaExpanded;\n reference['aria-haspopup'] = ariaHasPopup;\n reference['aria-controls'] = expanded ? listElement?.id : undefined;\n reference['aria-autocomplete'] = autoComplete;\n }\n return {\n reference,\n floating: {\n role: 'presentation'\n }\n };\n }, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete]);\n const click = useClick(floatingRootContext, {\n enabled: !readOnly && !disabled && openOnInputClick,\n event: 'mousedown-only',\n toggle: false,\n // Apply a small delay for touch to let mobile viewport/keyboard positioning settle.\n // This avoids top-bottom flip flickers if the preferred position is \"top\" when first tapping.\n touchOpenDelay: inputInsidePopup ? 0 : 100,\n reason: REASONS.inputPress\n });\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !readOnly && !disabled && !inline,\n outsidePressEvent: {\n mouse: 'sloppy',\n // The visual viewport (affected by the mobile software keyboard) can be\n // somewhat small. The user may want to scroll the screen to see more of\n // the popup.\n touch: 'intentional'\n },\n // Without a popup, let the Escape key bubble the event up to other popups' handlers.\n bubbles: inline ? true : undefined,\n outsidePress(event) {\n const target = getTarget(event);\n return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);\n }\n });\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !readOnly && !disabled,\n id,\n listRef,\n activeIndex,\n selectedIndex,\n virtual: true,\n loopFocus,\n allowEscape: loopFocus && !autoHighlightMode,\n focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',\n focusItemOnHover: highlightItemOnHover,\n resetOnPointerLeave: !keepHighlight,\n orientation: grid ? 'horizontal' : undefined,\n rtl: direction === 'rtl',\n disabledIndices: EMPTY_ARRAY,\n grid: grid ? gridNavigation : undefined,\n onNavigate(nextActiveIndex, event) {\n // Retain the highlight only while actually transitioning out or closed.\n if (!event && !open || transitionStatus === 'ending') {\n return;\n }\n if (!event) {\n setIndices({\n activeIndex: nextActiveIndex\n });\n } else {\n setIndices({\n activeIndex: nextActiveIndex,\n type: keyboardActiveRef.current ? REASONS.keyboard : REASONS.pointer\n });\n }\n }\n });\n const inputProps = React.useMemo(() => mergeProps(listNavigation.reference, {\n onKeyDown(event) {\n // In grid mode the navigation hook treats ArrowLeft/ArrowRight as horizontal\n // grid movement. When the input has focus and no item is highlighted the user\n // is still editing the query, so let the input keep its native caret behavior.\n if (grid && store.state.activeIndex == null && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {\n event.preventBaseUIHandler();\n }\n }\n }, dismiss.reference, click.reference, role.reference), [listNavigation.reference, dismiss.reference, click.reference, role.reference, grid, store]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);\n const listProps = React.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);\n const itemProps = React.useMemo(() => {\n const listNavigationItemProps = listNavigation.item;\n if (!listNavigationItemProps) {\n return EMPTY_OBJECT;\n }\n\n // Combobox keeps focus on the input; item focus would incorrectly sync\n // list navigation state from DOM focus.\n return {\n ...listNavigationItemProps,\n onFocus: undefined\n };\n }, [listNavigation.item]);\n useOnFirstRender(() => {\n store.update({\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n itemProps,\n setOpen,\n setInputValue,\n setSelectedValue,\n setIndices,\n handleSelection,\n forceMount,\n requestSubmit,\n onOpenChangeComplete\n });\n });\n useIsoLayoutEffect(() => {\n store.update({\n id,\n selectedValue,\n open,\n mounted,\n transitionStatus,\n items,\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n openMethod,\n itemProps,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n modal,\n autoHighlight: autoHighlightMode,\n isItemEqualToValue,\n submitOnItemClick,\n hasInputValue,\n inputOwnsFormValue: selectionMode === 'none' && (inlineProp || !store.state.inputInsidePopup)\n });\n }, [store, id, selectedValue, open, mounted, transitionStatus, items, popupProps, listProps, inputProps, itemProps, openMethod, triggerProps, selectionMode, name, disabled, readOnly, required, grid, virtualized, openOnInputClick, itemToStringLabel, modal, isItemEqualToValue, submitOnItemClick, hasInputValue, inlineProp, autoHighlightMode, form]);\n const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);\n const itemsContextValue = React.useMemo(() => ({\n query,\n hasItems,\n filteredItems,\n flatFilteredItems\n }), [query, hasItems, filteredItems, flatFilteredItems]);\n const serializedValue = React.useMemo(() => {\n if (Array.isArray(fieldRawValue)) {\n return '';\n }\n return stringifyAsValue(fieldRawValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue]);\n const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;\n const hiddenInputName = multiple || selectionMode === 'none' && inputOwnsFormValue ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(selectedValue) || !name) {\n return null;\n }\n return selectedValue.map(value => {\n const currentSerializedValue = stringifyAsValue(value, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, selectedValue, form, name, itemToStringValue, disabled]);\n const children = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [props.children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n // Move focus when the hidden input is focused.\n onFocus() {\n if (inputInsidePopup) {\n triggerElement?.focus();\n return;\n }\n (inputRef.current || triggerElement)?.focus();\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const nextValueLower = nextValue.toLowerCase();\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n const findSerializedMatchIndex = () => valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);\n function handleChange() {\n // Browser autofill only writes a single scalar value.\n if (multiple) {\n return;\n }\n if (selectionMode === 'none') {\n setInputValue(nextValue, details);\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like `value=\"US\">United States`.\n let matchingIndex = findSerializedMatchIndex();\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = matchingIndex === -1 ? undefined : valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setSelectedValue` may be canceled by `onValueChange`; rely on\n // `useValueChanged` to mark the field dirty and run validation only\n // when the value actually changes.\n setSelectedValue?.(matchingValue, details);\n }\n }\n\n // Only single-selection autofill matches against the registered values/labels.\n // `multiple` ignores autofill and `none` just writes the input value, so avoid the\n // sticky `forceMounted` mount (which never resets) for those modes.\n if (single) {\n forceMount();\n if (items && findSerializedMatchIndex() === -1) {\n // `forceMount` only refreshes the derived labels for the `items` prop. When\n // serialized matching misses, also mount the list so rendered labels (which can\n // differ from the serialized values) are registered for autofill matching.\n store.set('forceMounted', true);\n }\n }\n queueMicrotask(handleChange);\n }\n }),\n id: id && hiddenInputName == null ? `${id}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: formAutoComplete,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n value: serializedValue,\n ref: hiddenInputRef,\n style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n return /*#__PURE__*/_jsx(ComboboxRootContext.Provider, {\n value: store,\n children: /*#__PURE__*/_jsx(ComboboxFloatingContext.Provider, {\n value: floatingRootContext,\n children: /*#__PURE__*/_jsx(ComboboxHasItemsContext.Provider, {\n value: hasItems,\n children: /*#__PURE__*/_jsx(ComboboxDerivedItemsContext.Provider, {\n value: itemsContextValue,\n children: /*#__PURE__*/_jsx(ComboboxInputValueContext.Provider, {\n value: inputValue,\n children: children\n })\n })\n })\n })\n });\n}","import { getGridNavigatedIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\n\n/**\n * Positional arguments are deliberate: property names of an options object\n * don't minify, and the signature is locked to the caller via `typeof` on the\n * `grid` option of `useListNavigation`.\n *\n * The injected grid navigator only ever operates on a uniform 1x1 grid (sizes are\n * always `1x1` and packing is never dense), so the cell-map machinery that supports\n * multi-cell items collapses to an identity transform over the item list. Calling\n * `getGridNavigatedIndex` directly keeps the cell-map helpers\n * (`createGridCellMap`/`getGridCellIndexOfCorner`/`getGridCellIndices`) out of\n * grid-combobox bundles.\n */\nexport function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {\n const nextIndex = getGridNavigatedIndex(listRef.current, {\n event,\n orientation,\n loopFocus,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n // An out-of-range previous index falls back to the first enabled item.\n prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,\n stopEvent: true\n });\n\n // `getGridNavigatedIndex` can return an out-of-bounds sentinel (e.g. `-1` when there is no\n // previous item to move from); surface that as `undefined` so the caller treats it as\n // \"no navigation\" rather than highlighting index `-1`.\n return isIndexOutOfListBounds(listRef.current, nextIndex) ? undefined : nextIndex;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxRootContext.displayName = \"ComboboxRootContext\";\nexport const ComboboxFloatingContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxFloatingContext.displayName = \"ComboboxFloatingContext\";\nexport const ComboboxDerivedItemsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxDerivedItemsContext.displayName = \"ComboboxDerivedItemsContext\";\nexport const ComboboxHasItemsContext = /*#__PURE__*/React.createContext(false);\n// `inputValue` can't be placed in the store.\n// https://github.com/mui/base-ui/issues/2703\nif (process.env.NODE_ENV !== \"production\") ComboboxHasItemsContext.displayName = \"ComboboxHasItemsContext\";\nexport const ComboboxInputValueContext = /*#__PURE__*/React.createContext('');\nif (process.env.NODE_ENV !== \"production\") ComboboxInputValueContext.displayName = \"ComboboxInputValueContext\";\nexport function useComboboxRootContext() {\n const context = React.useContext(ComboboxRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(22));\n }\n return context;\n}\nexport function useComboboxFloatingContext() {\n const context = React.useContext(ComboboxFloatingContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(23));\n }\n return context;\n}\nexport function useComboboxDerivedItemsContext() {\n const context = React.useContext(ComboboxDerivedItemsContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(24));\n }\n return context;\n}\nexport function useComboboxInputValueContext() {\n return React.useContext(ComboboxInputValueContext);\n}\nexport function useComboboxHasItemsContext() {\n return React.useContext(ComboboxHasItemsContext);\n}","import { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel } from \"../internals/resolveValueLabel.mjs\";\nexport const selectors = {\n id: state => state.id,\n labelId: state => state.labelId,\n items: state => state.items,\n selectedValue: state => state.selectedValue,\n hasSelectionChips: state => {\n const selectedValue = state.selectedValue;\n return Array.isArray(selectedValue) && selectedValue.length > 0;\n },\n hasSelectedValue: state => {\n const {\n selectedValue,\n selectionMode\n } = state;\n if (selectedValue == null) {\n return false;\n }\n if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n return selectedValue.length > 0;\n }\n return true;\n },\n hasNullItemLabel: (state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n },\n open: state => state.open,\n mounted: state => state.mounted,\n forceMounted: state => state.forceMounted,\n inline: state => state.inline,\n activeIndex: state => state.activeIndex,\n selectedIndex: state => state.selectedIndex,\n isActive: (state, index) => state.activeIndex === index,\n isSelected: (state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const selectedValue = state.selectedValue;\n if (Array.isArray(selectedValue)) {\n return selectedValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n },\n transitionStatus: state => state.transitionStatus,\n popupProps: state => state.popupProps,\n listProps: state => state.listProps,\n inputProps: state => state.inputProps,\n triggerProps: state => state.triggerProps,\n itemProps: state => state.itemProps,\n positionerElement: state => state.positionerElement,\n listElement: state => state.listElement,\n popupId: state => state.popupId,\n triggerElement: state => state.triggerElement,\n inputElement: state => state.inputElement,\n inputGroupElement: state => state.inputGroupElement,\n popupSide: state => state.popupSide,\n openMethod: state => state.openMethod,\n inputInsidePopup: state => state.inputInsidePopup,\n inputOwnsFormValue: state => state.inputOwnsFormValue,\n selectionMode: state => state.selectionMode,\n name: state => state.name,\n form: state => state.form,\n disabled: state => state.disabled,\n readOnly: state => state.readOnly,\n required: state => state.required,\n grid: state => state.grid,\n virtualized: state => state.virtualized,\n itemToStringLabel: state => state.itemToStringLabel,\n isItemEqualToValue: state => state.isItemEqualToValue,\n modal: state => state.modal,\n autoHighlight: state => state.autoHighlight\n};","import { stringifyAsLabel } from \"../../../internals/resolveValueLabel.mjs\";\n/**\n * Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.\n * Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)\n * so the convention only lives in one place.\n */\nexport function getComboboxPopupId(rootId) {\n return rootId == null ? undefined : `${rootId}-popup`;\n}\n\n/**\n * Enhanced filter using Intl.Collator for more robust string matching.\n * Uses the provided `itemToStringLabel` function if available, otherwise falls back to:\n * • When `item` is an object with a `value` property, that property is used.\n * • When `item` is a primitive (e.g. `string`), it is used directly.\n */\nexport function createCollatorItemFilter(collatorFilter, itemToStringLabel) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}\n\n/**\n * Enhanced filter for single selection mode using Intl.Collator that shows all items\n * when query is empty or matches the current selection, making it easier to browse options.\n */\nexport function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n if (!query) {\n return true;\n }\n const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : '';\n\n // Handle case-insensitive matching consistently\n if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) {\n return true;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { createCollatorItemFilter, createSingleSelectionCollatorFilter } from \"./index.mjs\";\nimport { getFilter } from \"../../../internals/filter.mjs\";\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport const useCoreFilter = getFilter;\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport function useComboboxFilter(options = {}) {\n const {\n multiple = false,\n value,\n ...collatorOptions\n } = options;\n const coreFilter = getFilter(collatorOptions);\n const contains = React.useCallback((item, query, itemToString) => {\n if (multiple) {\n return createCollatorItemFilter(coreFilter, itemToString)(item, query);\n }\n return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);\n }, [coreFilter, value, multiple]);\n return React.useMemo(() => ({\n ...coreFilter,\n contains\n }), [contains, coreFilter]);\n}","export function stringifyLocale(locale) {\n if (Array.isArray(locale)) {\n return locale.map(value => stringifyLocale(value)).join(',');\n }\n if (locale == null) {\n return '';\n }\n return String(locale);\n}","import { stringifyAsLabel } from \"./resolveValueLabel.mjs\";\nimport { stringifyLocale } from \"../utils/stringifyLocale.mjs\";\nconst filterCache = new Map();\nexport function getFilter(options = {}) {\n const mergedOptions = {\n usage: 'search',\n sensitivity: 'base',\n ignorePunctuation: true,\n ...options\n };\n const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`;\n const cachedFilter = filterCache.get(cacheKey);\n if (cachedFilter) {\n return cachedFilter;\n }\n const collator = new Intl.Collator(options.locale, mergedOptions);\n const filter = {\n contains(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n for (let i = 0; i <= itemString.length - query.length; i += 1) {\n if (collator.compare(itemString.slice(i, i + query.length), query) === 0) {\n return true;\n }\n }\n return false;\n },\n startsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n return collator.compare(itemString.slice(0, query.length), query) === 0;\n },\n endsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n const queryLength = query.length;\n return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;\n }\n };\n filterCache.set(cacheKey, filter);\n return filter;\n}","export const NO_ACTIVE_VALUE = Symbol('none');\nexport const INITIAL_LAST_HIGHLIGHT = {\n value: NO_ACTIVE_VALUE,\n index: -1\n};","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabel } from \"../../internals/labelable-provider/useLabel.mjs\";\nimport { getDefaultLabelId } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An accessible label that is automatically associated with the combobox trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxLabel = /*#__PURE__*/React.forwardRef(function ComboboxLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.\n const elementPropsWithoutId = elementProps;\n delete elementPropsWithoutId.id;\n const fieldRootContext = useFieldRootContext();\n const store = useComboboxRootContext();\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputElement = useStore(store, selectors.inputElement);\n const rootId = useStore(store, selectors.id);\n const defaultLabelId = getDefaultLabelId(rootId);\n const localControlId = triggerElement?.id ?? (inputInsidePopup ? rootId : undefined);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputElement || inputInsidePopup) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Combobox.Label> labels <Combobox.Trigger> only. ' + 'When <Combobox.Input> is the form control, use a native <label> or <Field.Label> instead.';\n error(`${message}${ownerStackMessage}`);\n }, [inputElement, inputInsidePopup]);\n }\n const labelProps = useLabel({\n id: defaultLabelId,\n fallbackControlId: localControlId,\n setLabelId(nextLabelId) {\n const resolvedLabelId = typeof nextLabelId === 'function' ? nextLabelId(store.state.labelId) : nextLabelId;\n store.set('labelId', resolvedLabelId);\n }\n });\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state: fieldRootContext.state,\n props: [labelProps, elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxLabel.displayName = \"ComboboxLabel\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * The current value of the combobox.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxValue(props) {\n const {\n children: childrenProp,\n placeholder\n } = props;\n const store = useComboboxRootContext();\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const selectedValue = useStore(store, selectors.selectedValue);\n const items = useStore(store, selectors.items);\n const multiple = useStore(store, selectors.selectionMode) === 'multiple';\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(selectedValue);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (multiple && Array.isArray(selectedValue)) {\n children = resolveMultipleLabels(selectedValue, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(selectedValue, items, itemToStringLabel);\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { platform } from '@base-ui/utils/platform';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { DEFAULT_FIELD_ROOT_CONTEXT, FieldRootContext, useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { DEFAULT_FIELD_STATE_ATTRIBUTES } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { clickHighlightedItem, getChipNavigationKeys, getIndexAfterChipRemoval, useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\n\n/**\n * A text input to search for items in the list.\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInput(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const comboboxChipsContext = useComboboxChipsContext();\n const positioning = useComboboxPositionerContext(true);\n const hasPositionerParent = Boolean(positioning);\n const store = useComboboxRootContext();\n // `inputValue` can't be placed in the store.\n // https://github.com/mui/base-ui/issues/2703\n const inputValue = useComboboxInputValueContext();\n const direction = useDirection();\n const required = useStore(store, selectors.required);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const name = useStore(store, selectors.name);\n const form = useStore(store, selectors.form);\n const selectionMode = useStore(store, selectors.selectionMode);\n const autoHighlightMode = useStore(store, selectors.autoHighlight);\n const inputProps = useStore(store, selectors.inputProps);\n const triggerProps = useStore(store, selectors.triggerProps);\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const selectedValue = useStore(store, selectors.selectedValue);\n const rootId = useStore(store, selectors.id);\n const inline = useStore(store, selectors.inline);\n const modal = useStore(store, selectors.modal);\n const autoHighlightEnabled = Boolean(autoHighlightMode);\n const popupSide = usePopupSide(store);\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = useListEmpty();\n const isInsidePopup = hasPositionerParent || inline;\n const focusManagerModal = !isInsidePopup || modal;\n const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : undefined));\n const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;\n const [composingValue, setComposingValue] = React.useState(null);\n const isComposingRef = React.useRef(false);\n const lastActiveIndexRef = React.useRef(null);\n const shouldRestoreActiveIndexRef = React.useRef(false);\n const inputOwnsFormValue = selectionMode === 'none' && !hasPositionerParent;\n const setInputElement = useStableCallback(element => {\n const nextIsInsidePopup = hasPositionerParent || store.state.inline;\n if (nextIsInsidePopup && !store.state.hasInputValue) {\n store.state.setInputValue('', createChangeEventDetails(REASONS.none));\n }\n store.update({\n inputElement: element,\n inputInsidePopup: nextIsInsidePopup,\n inputOwnsFormValue\n });\n });\n const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);\n function clearHighlight() {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? REASONS.keyboard : REASONS.pointer\n });\n }\n function markPointerActive() {\n store.state.keyboardActiveRef.current = false;\n }\n const state = {\n ...fieldStateForInput,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty\n };\n function handleKeyDown(event) {\n if (!comboboxChipsContext) {\n return undefined;\n }\n let nextIndex;\n const {\n highlightedChipIndex\n } = comboboxChipsContext;\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const [previousChipKey, nextChipKey] = getChipNavigationKeys(direction);\n if (highlightedChipIndex !== undefined) {\n if (event.key === previousChipKey) {\n event.preventDefault();\n if (highlightedChipIndex > 0) {\n nextIndex = highlightedChipIndex - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === nextChipKey) {\n event.preventDefault();\n if (highlightedChipIndex < renderedChipsCount - 1) {\n nextIndex = highlightedChipIndex + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n // Move highlight appropriately after removal.\n nextIndex = getIndexAfterChipRemoval(highlightedChipIndex, selectedValue.length);\n clearHighlight();\n }\n return nextIndex;\n }\n\n // Handle navigation when no chip is highlighted\n if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {\n event.preventDefault();\n nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : undefined;\n }\n return nextIndex;\n }\n const element = useRenderElement('input', componentProps, {\n state,\n ref: [forwardedRef, store.state.inputRef, setInputElement],\n props: [inputProps, triggerProps, {\n value: composingValue ?? inputValue,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': fieldLabelId,\n disabled,\n readOnly,\n required: selectionMode === 'none' ? required : undefined,\n form,\n ...(inputOwnsFormValue && name && {\n name\n }),\n id,\n onFocus() {\n setFocused(true);\n if (!inline || !shouldRestoreActiveIndexRef.current) {\n return;\n }\n shouldRestoreActiveIndexRef.current = false;\n const nextActiveIndex = lastActiveIndexRef.current;\n if (nextActiveIndex == null ||\n // `valuesRef` can be sparse, so guard against restoring a removed slot.\n !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) {\n return;\n }\n store.state.setIndices({\n activeIndex: nextActiveIndex\n });\n },\n onBlur() {\n setTouched(true);\n setFocused(false);\n const activeIndex = store.state.activeIndex;\n if (inline && activeIndex !== null && autoHighlightMode !== 'always') {\n lastActiveIndexRef.current = activeIndex;\n shouldRestoreActiveIndexRef.current = true;\n store.state.setIndices({\n activeIndex: null\n });\n }\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onCompositionStart(event) {\n if (platform.os.android) {\n return;\n }\n isComposingRef.current = true;\n setComposingValue(event.currentTarget.value);\n },\n onCompositionEnd(event) {\n isComposingRef.current = false;\n const next = event.currentTarget.value;\n setComposingValue(null);\n store.state.setInputValue(next, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n },\n onChange(event) {\n const nativeEvent = event.nativeEvent;\n // Autofill may not provide `inputType` (Chrome) or may report\n // `insertReplacementText` (Firefox).\n const inputType = nativeEvent.inputType;\n const autofillLikeInput = !inputType || inputType === 'insertReplacementText';\n // During composition the input is always considered typed into.\n const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;\n function maybeOpenOnInput(trimmed) {\n if (readOnly || disabled || !trimmed || !shouldOpenOnInput) {\n return;\n }\n store.state.setOpen(true, createChangeEventDetails(REASONS.inputChange, nativeEvent));\n // When autoHighlight is enabled, keep the highlight (will be set to 0 in root).\n if (!autoHighlightEnabled) {\n clearHighlight();\n }\n }\n\n // During IME composition, avoid propagating controlled updates to prevent\n // filtering the options prematurely so `Empty` won't show incorrectly.\n // We can't rely on this check for Android due to how it handles composition\n // events with some keyboards (e.g. Samsung keyboard with predictive text on\n // treats all text as always-composing).\n // https://github.com/mui/base-ui/issues/2942\n if (isComposingRef.current) {\n const nextVal = event.currentTarget.value;\n setComposingValue(nextVal);\n if (nextVal === '' && !store.state.openOnInputClick && !store.state.inputInsidePopup) {\n store.state.setOpen(false, createChangeEventDetails(REASONS.inputClear, nativeEvent));\n }\n const trimmed = nextVal.trim();\n const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== '';\n maybeOpenOnInput(trimmed);\n if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) {\n clearHighlight();\n }\n return;\n }\n const inputChangeDetails = createChangeEventDetails(REASONS.inputChange, nativeEvent);\n store.state.setInputValue(event.currentTarget.value, inputChangeDetails);\n if (inputChangeDetails.isCanceled) {\n return;\n }\n const empty = event.currentTarget.value === '';\n const clearDetails = createChangeEventDetails(REASONS.inputClear, nativeEvent);\n if (empty && !store.state.inputInsidePopup) {\n if (selectionMode === 'single') {\n store.state.setSelectedValue(null, clearDetails);\n }\n if (!store.state.openOnInputClick) {\n store.state.setOpen(false, clearDetails);\n }\n }\n maybeOpenOnInput(event.currentTarget.value.trim());\n\n // When the user types, ensure the list resets its highlight so that\n // virtual focus returns to the input (aria-activedescendant is\n // cleared).\n if (open && store.state.activeIndex !== null && !autoHighlightEnabled) {\n clearHighlight();\n }\n },\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {\n return;\n }\n store.state.keyboardActiveRef.current = true;\n const input = event.currentTarget;\n const scrollAmount = input.scrollWidth - input.clientWidth;\n const isRTL = direction === 'rtl';\n if (event.key === 'Home') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? input.value.length : 0;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = 0;\n return;\n }\n if (event.key === 'End') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? 0 : input.value.length;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;\n return;\n }\n if (!mounted && event.key === 'Escape') {\n const isClear = selectionMode === 'multiple' && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;\n const details = createChangeEventDetails(REASONS.escapeKey, event.nativeEvent);\n const value = selectionMode === 'multiple' ? [] : null;\n store.state.setInputValue('', details);\n store.state.setSelectedValue(value, details);\n if (!isClear && !store.state.inline && !details.isPropagationAllowed) {\n event.stopPropagation();\n }\n return;\n }\n\n // Handle deletion when no chip is highlighted and the input is empty.\n if (comboboxChipsContext && event.key === 'Backspace' && input.value === '' && comboboxChipsContext.highlightedChipIndex === undefined && Array.isArray(selectedValue) && selectedValue.length > 0) {\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;\n const newValue = selectedValue.filter((_, index) => index !== removalIndex);\n // If the removed item was also the active (highlighted) item, clear highlight\n clearHighlight();\n store.state.setSelectedValue(newValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n return;\n }\n const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== undefined;\n const nextIndex = handleKeyDown(event);\n comboboxChipsContext?.setHighlightedChipIndex(nextIndex);\n if (nextIndex !== undefined) {\n comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();\n } else if (hadHighlightedChip) {\n store.state.inputRef.current?.focus();\n }\n\n // event.isComposing\n if (event.which === 229) {\n return;\n }\n if (event.key === 'Enter' && open) {\n const activeIndex = store.state.activeIndex;\n const nativeEvent = event.nativeEvent;\n if (activeIndex === null) {\n if (inline) {\n return;\n }\n\n // Allow form submission when no item is highlighted.\n store.state.setOpen(false, createChangeEventDetails(REASONS.none, nativeEvent));\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, nativeEvent);\n }\n },\n onPointerMove: markPointerActive,\n onPointerDown: markPointerActive\n }, validationProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n const renderedInput = hasPositionerParent ? /*#__PURE__*/_jsx(FieldRootContext.Provider, {\n value: DEFAULT_FIELD_ROOT_CONTEXT,\n children: element\n }) : element;\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [open && focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.state.startDismissRef\n }), renderedInput]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInput.displayName = \"ComboboxInput\";","import { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nexport const triggerStateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n listEmpty: empty => empty ? {\n 'data-list-empty': ''\n } : null\n};","'use client';\n\nimport * as React from 'react';\nexport const ComboboxChipsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipsContext.displayName = \"ComboboxChipsContext\";\nexport function useComboboxChipsContext() {\n return React.useContext(ComboboxChipsContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPositionerContext.displayName = \"ComboboxPositionerContext\";\nexport function useComboboxPositionerContext(optional) {\n const context = React.useContext(ComboboxPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component' : _formatErrorMessage(21));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * @internal\n */\nexport const ComboboxInternalDismissButton = /*#__PURE__*/React.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {\n const store = useComboboxRootContext();\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: false\n });\n const mergedRef = useMergedRefs(forwardedRef, buttonRef);\n function handleDismiss(event) {\n store.state.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent, event.currentTarget));\n }\n const dismissProps = getButtonProps({\n onClick: handleDismiss\n });\n return /*#__PURE__*/_jsx(\"span\", {\n ref: mergedRef,\n ...dismissProps,\n \"aria-label\": \"Dismiss\",\n tabIndex: undefined,\n style: visuallyHiddenInput\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInternalDismissButton.displayName = \"ComboboxInternalDismissButton\";","'use client';\n\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n/**\n * The popup side is only meaningful while the positioner is mounted, as the store retains the\n * last resolved side after the popup unmounts.\n */\nexport function usePopupSide(store) {\n const mounted = useStore(store, selectors.mounted);\n const popupSide = useStore(store, selectors.popupSide);\n const positionerElement = useStore(store, selectors.positionerElement);\n return mounted && positionerElement ? popupSide : null;\n}\n\n/**\n * Whether the filtered list has no items to show.\n */\nexport function useListEmpty() {\n return useComboboxDerivedItemsContext().filteredItems.length === 0;\n}\n\n/**\n * The arrow keys that move the chip highlight backwards and forwards, in that order.\n */\nexport function getChipNavigationKeys(direction) {\n return direction === 'rtl' ? ['ArrowRight', 'ArrowLeft'] : ['ArrowLeft', 'ArrowRight'];\n}\n\n/**\n * Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.\n */\nexport function getIndexAfterChipRemoval(index, chipCount) {\n const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;\n return nextIndex >= 0 ? nextIndex : undefined;\n}\n\n/**\n * Commits the highlighted item by clicking it, tagging the originating event so the item's\n * handler can attribute the selection to it.\n */\nexport function clickHighlightedItem(store, activeIndex, nativeEvent) {\n const listItem = store.state.listRef.current[activeIndex];\n if (listItem) {\n store.state.selectionEventRef.current = nativeEvent;\n listItem.click();\n store.state.selectionEventRef.current = null;\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\nimport { useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\nimport { contains } from \"../../floating-ui-react/utils/element.mjs\";\n\n/**\n * A wrapper for the input and its associated controls.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxInputGroup = /*#__PURE__*/React.forwardRef(function ComboboxInputGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState\n } = useFieldRootContext();\n const store = useComboboxRootContext();\n const open = useStore(store, selectors.open);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const selectionMode = useStore(store, selectors.selectionMode);\n const popupSide = usePopupSide(store);\n const disabled = comboboxDisabled;\n const listEmpty = useListEmpty();\n const placeholder = selectionMode === 'none' ? false : !hasSelectedValue;\n const state = {\n ...fieldState,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty,\n placeholder\n };\n const setInputGroupElement = useStableCallback(element => {\n store.set('inputGroupElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setInputGroupElement],\n props: [{\n role: 'group',\n onMouseDown(event) {\n handleInputPress(event, store, disabled, readOnly, target => {\n return contains(store.state.chipsContainerRef.current, target);\n });\n }\n }, elementProps],\n state,\n stateAttributesMapping: triggerStateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInputGroup.displayName = \"ComboboxInputGroup\";","import { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getTarget, isInteractiveElement } from \"../../floating-ui-react/utils/element.mjs\";\nexport function handleInputPress(event, store, disabled, readOnly, shouldIgnoreTarget) {\n if (event.baseUIHandlerPrevented || readOnly) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n const targetElement = isElement(target) ? target : null;\n if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n store.state.inputRef.current?.focus();\n if (store.state.openOnInputClick) {\n store.state.setOpen(true, createChangeEventDetails(REASONS.inputPress, event.nativeEvent));\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useComboboxFloatingContext, useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { stopEvent, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { isMouseWithinBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useClick, useTypeahead } from \"../../floating-ui-react/index.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { getComboboxPopupId } from \"../root/utils/index.mjs\";\nimport { useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\n\n/**\n * A button that opens the popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n nativeButton = true,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const store = useComboboxRootContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const required = useStore(store, selectors.required);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const storedPopupId = useStore(store, selectors.popupId);\n const triggerProps = useStore(store, selectors.triggerProps);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const rootId = useStore(store, selectors.id);\n const comboboxLabelId = useStore(store, selectors.labelId);\n const open = useStore(store, selectors.open);\n const selectedValue = useStore(store, selectors.selectedValue);\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const floatingRootContext = useComboboxFloatingContext();\n const inputValue = useComboboxInputValueContext();\n const focusTimeout = useTimeout();\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = useListEmpty();\n const popupSide = usePopupSide(store);\n useLabelableId({\n id: inputInsidePopup ? idProp : undefined\n });\n const id = inputInsidePopup ? idProp ?? rootId : idProp;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, comboboxLabelId);\n let ariaControls;\n if (open && inputInsidePopup) {\n // Fall back to the default id while the popup registers its own (custom ids are stored once the\n // popup mounts), so `aria-controls` is set on the same commit `open` becomes `true`.\n ariaControls = storedPopupId ?? getComboboxPopupId(rootId);\n } else if (open) {\n ariaControls = listElement?.id;\n }\n const currentPointerTypeRef = React.useRef('');\n function trackPointerType(event) {\n currentPointerTypeRef.current = event.pointerType;\n }\n const {\n reference: triggerTypeaheadProps\n } = useTypeahead(floatingRootContext, {\n enabled: !open && !readOnly && !comboboxDisabled && selectionMode === 'single',\n listRef: store.state.labelsRef,\n activeIndex,\n selectedIndex,\n onMatch(index) {\n const nextSelectedValue = store.state.valuesRef.current[index];\n if (nextSelectedValue !== undefined) {\n store.state.setSelectedValue(nextSelectedValue, createChangeEventDetails(REASONS.none));\n }\n }\n });\n const {\n reference: triggerClickProps\n } = useClick(floatingRootContext, {\n enabled: !readOnly && !comboboxDisabled,\n event: 'mousedown'\n });\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled\n });\n const state = {\n ...fieldState,\n open,\n disabled,\n popupSide,\n listEmpty,\n placeholder: selectionMode === 'none' ? false : !hasSelectedValue\n };\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef, setTriggerElement],\n state,\n props: [triggerProps, triggerClickProps, triggerTypeaheadProps, {\n id,\n tabIndex: inputInsidePopup ? 0 : -1,\n role: inputInsidePopup ? 'combobox' : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': inputInsidePopup ? 'dialog' : 'listbox',\n 'aria-controls': ariaControls,\n 'aria-required': inputInsidePopup ? required || undefined : undefined,\n 'aria-labelledby': ariaLabelledBy,\n onPointerDown: trackPointerType,\n onPointerEnter: trackPointerType,\n onFocus() {\n setFocused(true);\n if (disabled || readOnly) {\n return;\n }\n focusTimeout.start(0, store.state.forceMount);\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onMouseDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (!inputInsidePopup) {\n floatingRootContext.set('domReferenceElement', event.currentTarget);\n }\n\n // Ensure items are registered for initial selection highlight.\n store.state.forceMount();\n if (currentPointerTypeRef.current !== 'touch') {\n store.state.inputRef.current?.focus();\n if (!inputInsidePopup) {\n event.preventDefault();\n }\n }\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n const currentTriggerElement = store.state.triggerElement;\n if (!currentTriggerElement) {\n return;\n }\n const mouseUpTarget = getTarget(mouseEvent);\n const positioner = store.state.positionerElement;\n const list = store.state.listElement;\n if (contains(currentTriggerElement, mouseUpTarget) || contains(positioner, mouseUpTarget) || contains(list, mouseUpTarget)) {\n return;\n }\n if (isMouseWithinBounds(mouseEvent, currentTriggerElement)) {\n return;\n }\n store.state.setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n if (inputInsidePopup) {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n }\n },\n onKeyDown(event) {\n if (readOnly) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n store.state.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n store.state.inputRef.current?.focus();\n }\n }\n }, validation.getValidationProps(disabled, elementProps), getButtonProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxTrigger.displayName = \"ComboboxTrigger\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { ComboboxCollection } from \"../collection/ComboboxCollection.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { clickHighlightedItem } from \"../utils/parts.mjs\";\n\n/**\n * A list container for the items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxList = /*#__PURE__*/React.forwardRef(function ComboboxList(componentProps, forwardedRef) {\n var _ComboboxCollection;\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const hasPositionerContext = Boolean(useComboboxPositionerContext(true));\n const {\n filteredItems,\n hasItems\n } = useComboboxDerivedItemsContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const grid = useStore(store, selectors.grid);\n const listProps = useStore(store, selectors.listProps);\n const virtualized = useStore(store, selectors.virtualized);\n const forceMounted = useStore(store, selectors.forceMounted);\n const multiple = selectionMode === 'multiple';\n const empty = filteredItems.length === 0;\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n\n // Support \"closed template\" API: if children is a function, implicitly wrap it\n // with a Combobox.Collection that reads items from context/root.\n // Ensures this component's `listProps` subscription does not cause <Combobox.Item>\n // to re-render on every active index change.\n const resolvedChildren = React.useMemo(() => {\n if (typeof children === 'function') {\n return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/_jsx(ComboboxCollection, {\n children: children\n }));\n }\n return children;\n }, [children]);\n const state = {\n empty\n };\n const floatingId = floatingRootContext.useState('floatingId');\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement],\n props: [listProps, {\n children: resolvedChildren,\n tabIndex: -1,\n id: floatingId,\n role: grid ? 'grid' : 'listbox',\n 'aria-multiselectable': multiple ? 'true' : undefined,\n onKeyDown(event) {\n if (store.state.disabled || store.state.readOnly) {\n return;\n }\n if (event.key === 'Enter') {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n // Allow form submission when no item is highlighted.\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, event.nativeEvent);\n }\n },\n onKeyDownCapture() {\n store.state.keyboardActiveRef.current = true;\n },\n onPointerMoveCapture() {\n store.state.keyboardActiveRef.current = false;\n }\n }, elementProps]\n });\n if (virtualized) {\n return element;\n }\n\n // With the `items` prop, typeahead labels are derived from the items so they survive the list\n // unmounting (unmounting clears the registered labels). Rendered labels only need to be\n // registered when the list is force-mounted to match browser autofill against rendered text.\n const labelsRef = hasItems && !forceMounted ? undefined : store.state.labelsRef;\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.state.listRef,\n labelsRef: labelsRef,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxList.displayName = \"ComboboxList\";","'use client';\n\nimport * as React from 'react';\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useGroupCollectionContext } from \"./GroupCollectionContext.mjs\";\n\n/**\n * Renders filtered list items.\n * Doesn't render its own HTML element.\n *\n * If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxCollection(props) {\n const {\n children\n } = props;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const groupContext = useGroupCollectionContext();\n const itemsToRender = groupContext ? groupContext.items : filteredItems;\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: itemsToRender.map(children)\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GroupCollectionContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") GroupCollectionContext.displayName = \"GroupCollectionContext\";\nexport function useGroupCollectionContext() {\n return React.useContext(GroupCollectionContext);\n}\nexport function GroupCollectionProvider(props) {\n const {\n children,\n items\n } = props;\n const contextValue = React.useMemo(() => ({\n items\n }), [items]);\n return /*#__PURE__*/_jsx(GroupCollectionContext.Provider, {\n value: contextValue,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useInitialLiveRegionTextMutation } from \"../utils/useInitialLiveRegionTextMutation.mjs\";\n\n/**\n * Displays a status message whose content changes are announced politely to screen readers.\n * Useful for conveying the status of an asynchronously loaded list.\n * This component's root element must remain mounted in the DOM to announce\n * changes consistently across screen readers. Avoid hiding or removing the\n * component itself with `display: none`, `hidden`, `aria-hidden`, or conditional\n * rendering. Prefer updating or conditionally rendering its children instead.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxStatus = /*#__PURE__*/React.forwardRef(function ComboboxStatus(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const statusRef = useInitialLiveRegionTextMutation();\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, statusRef],\n props: [{\n children: childrenProp,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxStatus.displayName = \"ComboboxStatus\";","'use client';\n\nimport * as React from 'react';\nimport { platform } from '@base-ui/utils/platform';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\n\n// Word Joiner is invisible and zero-width, so it forces a text mutation without shifting layout.\nconst LIVE_REGION_MARKER = '\\u2060';\n// Safari VoiceOver needed roughly 200ms to reliably notice the initial polite live-region change.\nexport const INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200;\nfunction findLastTextNode(root) {\n const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n let lastTextNode = null;\n while (walker.nextNode()) {\n const textNode = walker.currentNode;\n if (textNode.nodeValue !== '') {\n lastTextNode = textNode;\n }\n }\n return lastTextNode;\n}\nexport function useInitialLiveRegionTextMutation() {\n const timeout = useTimeout();\n const rootRef = React.useRef(null);\n\n // Only the initial mounted announcement needs the marker; later text updates announce naturally.\n React.useEffect(() => {\n if (platform.os.ios) {\n return undefined;\n }\n const root = rootRef.current;\n if (root == null) {\n return undefined;\n }\n const textNode = findLastTextNode(root);\n if (textNode == null) {\n return undefined;\n }\n const originalValue = textNode.data;\n const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;\n textNode.nodeValue = markedValue;\n timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => {\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n });\n return () => {\n timeout.clear();\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n };\n }, [rootRef, timeout]);\n return rootRef;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPortalContext } from \"./ComboboxPortalContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxPortal = /*#__PURE__*/React.forwardRef(function ComboboxPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useComboboxRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMounted = useStore(store, selectors.forceMounted);\n const shouldRender = mounted || keepMounted || forceMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ComboboxPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPortal.displayName = \"ComboboxPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPortalContext.displayName = \"ComboboxPortalContext\";\nexport function useComboboxPortalContext() {\n const context = React.useContext(ComboboxPortalContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Portal> is missing.' : _formatErrorMessage(20));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxBackdrop = /*#__PURE__*/React.forwardRef(function ComboboxBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxBackdrop.displayName = \"ComboboxBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPositionerContext } from \"./ComboboxPositionerContext.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { useComboboxPortalContext } from \"../portal/ComboboxPortalContext.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\n\n/**\n * Positions the popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxPositioner = /*#__PURE__*/React.forwardRef(function ComboboxPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n // `useAnchorPositioning` applies the same defaults to the undefined values; the names\n // remain destructured to exclude the props from `elementProps`.\n positionMethod,\n side,\n align,\n sideOffset,\n alignOffset,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding,\n sticky,\n disableAnchorTracking = false,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const keepMounted = useComboboxPortalContext();\n const modal = useStore(store, selectors.modal);\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputElement = useStore(store, selectors.inputElement);\n const inputGroupElement = useStore(store, selectors.inputGroupElement);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const empty = useListEmpty();\n const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement);\n const positioning = useAnchorPositioning({\n anchor: resolvedAnchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n lazyFlip: true\n });\n useAnchoredPopupScrollLock(open && modal, openMethod === 'touch', positionerElement, triggerElement);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n empty\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(ComboboxPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: inputGroupElement ?? inputElement ?? triggerElement\n }), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPositioner.displayName = \"ComboboxPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { getComboboxPopupId } from \"../root/utils/index.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n initialFocus,\n finalFocus,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const positioning = useComboboxPositionerContext();\n const floatingRootContext = useComboboxFloatingContext();\n const mounted = useStore(store, selectors.mounted);\n const open = useStore(store, selectors.open);\n const openMethod = useStore(store, selectors.openMethod);\n const popupProps = useStore(store, selectors.popupProps);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const inputElement = useStore(store, selectors.inputElement);\n const modal = useStore(store, selectors.modal);\n const rootId = useStore(store, selectors.id);\n const empty = useListEmpty();\n const popupId = elementProps.id ?? (inputInsidePopup ? getComboboxPopupId(rootId) : undefined);\n useIsoLayoutEffect(() => {\n // Prefer the rendered DOM id, which a `render` prop element or function may override.\n store.set('popupId', store.state.popupRef.current?.id || popupId);\n return () => {\n store.set('popupId', undefined);\n };\n }, [store, popupId]);\n useOpenChangeComplete({\n open,\n ref: store.state.popupRef,\n onComplete() {\n if (open) {\n store.state.onOpenChangeComplete(true);\n }\n }\n });\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n transitionStatus,\n empty\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.state.popupRef],\n props: [popupProps, {\n id: popupId,\n role: inputInsidePopup ? 'dialog' : 'presentation',\n onFocus(event) {\n const target = getTarget(event.nativeEvent);\n if (openMethod !== 'touch' && (contains(store.state.listElement, target) || target === event.currentTarget)) {\n store.state.inputRef.current?.focus();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n const computedDefaultInitialFocus = inputInsidePopup ? interactionType => interactionType === 'touch' ? store.state.popupRef.current : inputElement : false;\n const resolvedInitialFocus = initialFocus === undefined ? computedDefaultInitialFocus : initialFocus;\n let resolvedFinalFocus;\n if (finalFocus != null) {\n resolvedFinalFocus = finalFocus;\n } else {\n resolvedFinalFocus = inputInsidePopup ? undefined : false;\n }\n const focusManagerModal = !inputInsidePopup || modal;\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n disabled: !mounted,\n modal: focusManagerModal,\n openInteractionType: openMethod,\n initialFocus: resolvedInitialFocus,\n returnFocus: resolvedFinalFocus,\n getInsideElements: () => [store.state.startDismissRef.current, store.state.endDismissRef.current],\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.state.endDismissRef\n })]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPopup.displayName = \"ComboboxPopup\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Displays an element positioned against the anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxArrow = /*#__PURE__*/React.forwardRef(function ComboboxArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = useComboboxPositionerContext();\n const open = useStore(store, selectors.open);\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n return useRenderElement('div', componentProps, {\n ref: [arrowRef, forwardedRef],\n stateAttributesMapping: popupStateMapping,\n state,\n props: {\n style: arrowStyles,\n 'aria-hidden': true,\n ...elementProps\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxArrow.displayName = \"ComboboxArrow\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens the popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxIcon = /*#__PURE__*/React.forwardRef(function ComboboxIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const element = useRenderElement('span', componentProps, {\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxIcon.displayName = \"ComboboxIcon\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxGroupContext } from \"./ComboboxGroupContext.mjs\";\nimport { GroupCollectionProvider } from \"../collection/GroupCollectionContext.mjs\";\n\n/**\n * Groups related items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxGroup = /*#__PURE__*/React.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n items,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const contextValue = React.useMemo(() => ({\n labelId,\n setLabelId,\n items\n }), [labelId, setLabelId, items]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'group',\n 'aria-labelledby': labelId\n }, elementProps]\n });\n const wrappedElement = /*#__PURE__*/_jsx(ComboboxGroupContext.Provider, {\n value: contextValue,\n children: element\n });\n if (items) {\n return /*#__PURE__*/_jsx(GroupCollectionProvider, {\n items: items,\n children: wrappedElement\n });\n }\n return wrappedElement;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxGroup.displayName = \"ComboboxGroup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxGroupContext.displayName = \"ComboboxGroupContext\";\nexport function useComboboxGroupContext() {\n const context = React.useContext(ComboboxGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.' : _formatErrorMessage(18));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useComboboxGroupContext } from \"../group/ComboboxGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxGroupLabel = /*#__PURE__*/React.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useComboboxGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxGroupLabel.displayName = \"ComboboxGroupLabel\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useComboboxRootContext, useComboboxHasItemsContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxItemContext } from \"./ComboboxItemContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useComboboxRowContext } from \"../row/ComboboxRowContext.mjs\";\nimport { compareItemEquality, findItemIndex } from \"../../internals/itemEquality.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction ComboboxItemInner(props) {\n const {\n componentProps,\n forwardedRef,\n virtualized,\n indexFromFilter\n } = props;\n const {\n render,\n className,\n style,\n value: itemValue = null,\n index: indexProp,\n disabled: disabledProp = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n index: indexProp,\n textRef\n });\n const store = useComboboxRootContext();\n const isRow = useComboboxRowContext();\n const hasItems = useComboboxHasItemsContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const rootDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const disabled = rootDisabled || disabledProp;\n const selectable = selectionMode !== 'none';\n const index = indexProp ?? indexFromFilter ?? listItem.index;\n const hasRegistered = index !== -1;\n const rootId = useStore(store, selectors.id);\n const highlighted = useStore(store, selectors.isActive, index);\n const matchesSelectedValue = useStore(store, selectors.isSelected, itemValue);\n const itemProps = useStore(store, selectors.itemProps);\n const itemRef = React.useRef(null);\n const id = rootId != null && hasRegistered ? `${rootId}-${index}` : undefined;\n const selected = matchesSelectedValue && selectable;\n useIsoLayoutEffect(() => {\n const shouldRun = hasRegistered && (virtualized || indexProp != null);\n if (!shouldRun) {\n return undefined;\n }\n const list = store.state.listRef.current;\n list[index] = itemRef.current;\n return () => {\n delete list[index];\n };\n }, [hasRegistered, virtualized, index, indexProp, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return undefined;\n }\n const visibleMap = store.state.valuesRef.current;\n visibleMap[index] = itemValue;\n return () => {\n delete visibleMap[index];\n };\n }, [hasRegistered, hasItems, index, itemValue, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return;\n }\n\n // Runs while closed as well (the list can stay mounted via `keepMounted` or a\n // force-mount) so the index tracks the item's composite position, keeping features\n // like closed-trigger typeahead in sync when the rendered order changes.\n const selectedValue = store.state.selectedValue;\n const lastSelectedValue = Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue;\n if (compareItemEquality(itemValue, lastSelectedValue, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n }\n }, [hasRegistered, hasItems, store, index, itemValue, isItemEqualToValue]);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(nativeEvent) {\n function selectItem() {\n store.state.handleSelection(nativeEvent, itemValue);\n }\n if (store.state.submitOnItemClick) {\n ReactDOM.flushSync(selectItem);\n store.state.requestSubmit();\n } else {\n selectItem();\n }\n }\n const defaultProps = {\n id,\n role: isRow ? 'gridcell' : 'option',\n 'aria-selected': selectable ? selected : undefined,\n // Focusable items steal focus from the input upon mouseup.\n // Warn if the user renders a natively focusable element like `<button>`,\n // as it should be a `<div>` instead.\n tabIndex: undefined,\n onPointerDownCapture(event) {\n // The compat `mouseup` only fires for the primary pointer, so a non-primary\n // touch must not overwrite the shared ref — a mismatch would make the primary\n // pointer's release read as a drag-select and commit a second time after `click`.\n if (event.isPrimary) {\n store.state.pointerDownItemRef.current = event.currentTarget;\n }\n event.preventDefault();\n },\n onMouseDown(event) {\n // iOS Safari can emit a synthetic mousedown for touch taps without a preceding\n // pointerdown. Prevent default here too so tapping an item does not blur the input.\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onMouseUp(event) {\n const pointerStartedOnItem = store.state.pointerDownItemRef.current === event.currentTarget;\n store.state.pointerDownItemRef.current = null;\n if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) {\n return;\n }\n commitSelection(event.nativeEvent);\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n textRef\n }), [selected, textRef]);\n return /*#__PURE__*/_jsx(ComboboxItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}\n\n/**\n * Resolves the index from the filtered items for the virtualized fallback (no `index` prop).\n * Isolated here so that this per-keystroke subscription to the derived-items context is only\n * paid by virtualized items. Those re-render on every input change anyway — the parent\n * virtualizer re-windows the list as the filtered set changes — so the extra subscription costs\n * them nothing, while it keeps every non-virtualized item off that context.\n */\nfunction ComboboxItemVirtualizedIndex(props) {\n const {\n componentProps,\n forwardedRef\n } = props;\n const store = useComboboxRootContext();\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const {\n flatFilteredItems\n } = useComboboxDerivedItemsContext();\n const indexFromFilter = findItemIndex(flatFilteredItems, componentProps.value ?? null, isItemEqualToValue);\n\n // Only reached when `virtualized` is true (see the wrapper below).\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: true,\n indexFromFilter: indexFromFilter\n });\n}\n\n/**\n * An individual item in the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ComboboxItem(componentProps, forwardedRef) {\n const store = useComboboxRootContext();\n const virtualized = useStore(store, selectors.virtualized);\n\n // `virtualized` (and whether an item provides an explicit `index`) must be stable for an\n // item's lifetime: the two branches return different component types, so flipping it at\n // runtime remounts the item and resets its refs and effects.\n if (virtualized && componentProps.index == null) {\n return /*#__PURE__*/_jsx(ComboboxItemVirtualizedIndex, {\n componentProps: componentProps,\n forwardedRef: forwardedRef\n });\n }\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: virtualized,\n indexFromFilter: undefined\n });\n}));\nif (process.env.NODE_ENV !== \"production\") ComboboxItem.displayName = \"ComboboxItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxItemContext.displayName = \"ComboboxItemContext\";\nexport function useComboboxItemContext() {\n const context = React.useContext(ComboboxItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.' : _formatErrorMessage(19));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxRowContext = /*#__PURE__*/React.createContext(false);\nif (process.env.NODE_ENV !== \"production\") ComboboxRowContext.displayName = \"ComboboxRowContext\";\nexport function useComboboxRowContext() {\n return React.useContext(ComboboxRowContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useComboboxItemContext } from \"../item/ComboboxItemContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Indicates whether the item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxItemIndicator = /*#__PURE__*/React.forwardRef(function ComboboxItemIndicator(componentProps, forwardedRef) {\n const {\n selected\n } = useComboboxItemContext();\n const shouldRender = componentProps.keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return /*#__PURE__*/_jsx(Inner, {\n ...componentProps,\n ref: forwardedRef\n });\n});\n\n// Split the core implementation to avoid paying the hook costs unless the element needs to mount.\nif (process.env.NODE_ENV !== \"production\") ComboboxItemIndicator.displayName = \"ComboboxItemIndicator\";\nconst Inner = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((componentProps, forwardedRef) => {\n const {\n render,\n className,\n style,\n keepMounted,\n ...elementProps\n } = componentProps;\n const {\n selected\n } = useComboboxItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") Inner.displayName = \"Inner\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxChipsContext } from \"./ComboboxChipsContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\n\n/**\n * A container for the chips in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChips(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const open = useStore(store, selectors.open);\n const hasSelectionChips = useStore(store, selectors.hasSelectionChips);\n const [highlightedChipIndex, setHighlightedChipIndex] = React.useState(undefined);\n if (open && highlightedChipIndex !== undefined) {\n setHighlightedChipIndex(undefined);\n }\n const chipsRef = React.useRef([]);\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.state.chipsContainerRef],\n // NVDA enters browse mode instead of staying in focus mode when navigating with\n // arrow keys inside a container unless it has a toolbar role.\n props: [hasSelectionChips ? {\n role: 'toolbar'\n } : EMPTY_OBJECT, {\n onMouseDown(event) {\n handleInputPress(event, store, store.state.disabled, store.state.readOnly);\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n highlightedChipIndex,\n setHighlightedChipIndex,\n chipsRef\n }), [highlightedChipIndex, setHighlightedChipIndex, chipsRef]);\n return /*#__PURE__*/_jsx(ComboboxChipsContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: chipsRef,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChips.displayName = \"ComboboxChips\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { ComboboxChipContext } from \"./ComboboxChipContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { getChipNavigationKeys, getIndexAfterChipRemoval } from \"../utils/parts.mjs\";\n\n/**\n * An individual chip that represents a value in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChip = /*#__PURE__*/React.forwardRef(function ComboboxChip(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n setHighlightedChipIndex,\n chipsRef\n } = useComboboxChipsContext();\n const direction = useDirection();\n const disabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const selectedValue = useStore(store, selectors.selectedValue);\n const {\n ref,\n index\n } = useCompositeListItem();\n function handleKeyDown(event) {\n let nextIndex = index;\n const [previousChipKey, nextChipKey] = getChipNavigationKeys(direction);\n if (event.key === previousChipKey) {\n event.preventDefault();\n if (index > 0) {\n nextIndex = index - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === nextChipKey) {\n event.preventDefault();\n if (index < chipsRef.current.length - 1) {\n nextIndex = index + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n nextIndex = getIndexAfterChipRemoval(index, selectedValue.length);\n stopEvent(event);\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: REASONS.keyboard\n });\n store.state.setSelectedValue(selectedValue.filter((_, i) => i !== index), createChangeEventDetails(REASONS.none, event.nativeEvent));\n } else if (event.key === 'Enter' || event.key === ' ') {\n stopEvent(event);\n nextIndex = undefined;\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n store.state.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n nextIndex = undefined;\n } else if (\n // Check for printable characters (letters, numbers, symbols)\n event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n nextIndex = undefined;\n }\n return nextIndex;\n }\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, ref],\n state,\n props: [{\n tabIndex: -1,\n 'aria-disabled': disabled || undefined,\n 'aria-readonly': readOnly || undefined,\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n const nextIndex = handleKeyDown(event);\n ReactDOM.flushSync(() => {\n setHighlightedChipIndex(nextIndex);\n });\n if (nextIndex === undefined) {\n store.state.inputRef.current?.focus();\n } else {\n chipsRef.current[nextIndex]?.focus();\n }\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n index\n }), [index]);\n return /*#__PURE__*/_jsx(ComboboxChipContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChip.displayName = \"ComboboxChip\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxChipContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipContext.displayName = \"ComboboxChipContext\";\nexport function useComboboxChipContext() {\n const context = React.useContext(ComboboxChipContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxChipContext is missing. ComboboxChip parts must be placed within <Combobox.Chip>.' : _formatErrorMessage(17));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxChipContext } from \"../chip/ComboboxChipContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findItemIndex } from \"../../internals/itemEquality.mjs\";\n\n/**\n * A button to remove a chip.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function ComboboxChipRemove(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n index\n } = useComboboxChipContext();\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const selectedValue = useStore(store, selectors.selectedValue);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const disabled = comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled: disabled || readOnly,\n focusableWhenDisabled: true\n });\n const state = {\n disabled\n };\n function clearActiveIndexForRemovedItem(removedItem) {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n return;\n }\n\n // Try current visible list first; if not found, it's filtered out.\n // No need to clear highlight in that case since it can't equal activeIndex.\n const removedIndex = findItemIndex(store.state.valuesRef.current, removedItem, isItemEqualToValue);\n if (removedIndex !== -1 && activeIndex === removedIndex) {\n store.state.setIndices({\n activeIndex: null,\n type: store.state.keyboardActiveRef.current ? REASONS.keyboard : REASONS.pointer\n });\n }\n }\n function removeChip(event) {\n const eventDetails = createChangeEventDetails(REASONS.chipRemovePress, event.nativeEvent);\n const removedItem = selectedValue[index];\n clearActiveIndexForRemovedItem(removedItem);\n store.state.setSelectedValue(selectedValue.filter((_, i) => i !== index), eventDetails);\n store.state.inputRef.current?.focus();\n return eventDetails;\n }\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n tabIndex: -1,\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n },\n onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n stopEvent(event);\n }\n }\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChipRemove.displayName = \"ComboboxChipRemove\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxRowContext } from \"./ComboboxRowContext.mjs\";\n\n/**\n * Displays a single row of items in a grid list.\n * Enable `grid` on the root component to turn the listbox into a grid.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxRow = /*#__PURE__*/React.forwardRef(function ComboboxRow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'row'\n }, elementProps]\n });\n return /*#__PURE__*/_jsx(ComboboxRowContext.Provider, {\n value: true,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxRow.displayName = \"ComboboxRow\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useInitialLiveRegionTextMutation } from \"../utils/useInitialLiveRegionTextMutation.mjs\";\n\n/**\n * Renders its children only when the list is empty.\n * Requires the `items` prop on the root component.\n * Announces changes politely to screen readers.\n * This component's root element must remain mounted in the DOM to announce\n * changes consistently across screen readers. Avoid hiding or removing the\n * component itself with `display: none`, `hidden`, `aria-hidden`, or conditional\n * rendering. Prefer updating or conditionally rendering its children instead.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxEmpty = /*#__PURE__*/React.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const store = useComboboxRootContext();\n const emptyRef = useInitialLiveRegionTextMutation();\n const children = filteredItems.length === 0 ? childrenProp : null;\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.state.emptyRef, emptyRef],\n props: [{\n children,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxEmpty.displayName = \"ComboboxEmpty\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nconst stateAttributesMapping = {\n ...transitionStatusMapping,\n ...triggerOpenStateMapping\n};\n\n/**\n * Clears the value when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxClear = /*#__PURE__*/React.forwardRef(function ComboboxClear(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n keepMounted = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n disabled: fieldDisabled\n } = useFieldRootContext();\n const store = useComboboxRootContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const open = useStore(store, selectors.open);\n const selectedValue = useStore(store, selectors.selectedValue);\n const hasSelectionChips = useStore(store, selectors.hasSelectionChips);\n const inputValue = useComboboxInputValueContext();\n let visible = false;\n if (selectionMode === 'none') {\n visible = inputValue !== '';\n } else if (selectionMode === 'single') {\n visible = selectedValue != null;\n } else {\n visible = hasSelectionChips;\n }\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled\n });\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(visible);\n const state = {\n disabled,\n visible,\n open,\n transitionStatus\n };\n useOpenChangeComplete({\n open: visible,\n ref: store.state.clearRef,\n onComplete() {\n if (!visible) {\n setMounted(false);\n }\n }\n });\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef, store.state.clearRef],\n props: [{\n tabIndex: -1,\n children: 'x',\n // Avoid stealing focus from the input.\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n const type = store.state.keyboardActiveRef.current ? REASONS.keyboard : REASONS.pointer;\n store.state.setInputValue('', createChangeEventDetails(REASONS.clearPress, event.nativeEvent));\n if (selectionMode !== 'none') {\n store.state.setSelectedValue(Array.isArray(selectedValue) ? [] : null, createChangeEventDetails(REASONS.clearPress, event.nativeEvent));\n // A distinct object shape: `Store.update` iterates own keys, so passing an explicit\n // `selectedIndex: undefined` would overwrite the state instead of leaving it alone.\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type\n });\n } else {\n store.state.setIndices({\n activeIndex: null,\n type\n });\n }\n store.state.inputRef.current?.focus();\n }\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n const shouldRender = keepMounted || mounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxClear.displayName = \"ComboboxClear\";","'use client';\n\nimport { ListboxSeparator } from \"../../utils/listbox-separator/ListboxSeparator.mjs\";\n/**\n * A visual separator between items or groups.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxSeparator = ListboxSeparator;","import { useComboboxDerivedItemsContext } from \"../ComboboxRootContext.mjs\";\n\n/**\n * Returns the internally filtered items.\n */\nexport function useFilteredItems() {\n const items = useComboboxDerivedItemsContext();\n return items.filteredItems;\n}"],"mappings":";;;;;;;;;AAAO,SAAS,aAAa,GAAG,GAAG;AACjC,MAAI,KAAK,CAAC,GAAG;AACX,WAAO;AAAA,EACT;AACA,MAAI,CAAC,KAAK,GAAG;AACX,WAAO;AAAA,EACT;AACA,MAAI,KAAK,GAAG;AACV,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,EACF;AACA,SAAO;AACT;;;ACbA,IAAM,cAAc,CAAC;AAiCd,SAAS,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG;AACxC,MAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;AACxB,WAAO,yBAAyB,CAAC;AAAA,EACnC;AAGA,MAAI,SAAS,yBAAyB,CAAC;AACvC,MAAI,GAAG;AACL,aAAS,UAAU,QAAQ,CAAC;AAAA,EAC9B;AACA,MAAI,GAAG;AACL,aAAS,UAAU,QAAQ,CAAC;AAAA,EAC9B;AACA,MAAI,GAAG;AACL,aAAS,UAAU,QAAQ,CAAC;AAAA,EAC9B;AACA,MAAI,GAAG;AACL,aAAS,UAAU,QAAQ,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;AAgBO,SAAS,YAAY,OAAO;AACjC,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO;AAAA,EACT;AACA,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,yBAAyB,MAAM,CAAC,CAAC;AAAA,EAC1C;AAGA,MAAI,SAAS,yBAAyB,MAAM,CAAC,CAAC;AAC9C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;AACxC,aAAS,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,EACrC;AACA,SAAO;AACT;AACA,SAAS,yBAAy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AQ,OAAO;AACb,YAAIA,aAAY,UAAU;AACxB;AAAA,QACF;AACA,cAAM,OAAO,MAAM,MAAM,kBAAkB,UAAU,qBAAQ,WAAW,qBAAQ;AAChF,cAAM,MAAM,cAAc,IAAI,yBAAyB,qBAAQ,YAAY,MAAM,WAAW,CAAC;AAC7F,YAAI,kBAAkB,QAAQ;AAC5B,gBAAM,MAAM,iBAAiB,MAAM,QAAQ,aAAa,IAAI,CAAC,IAAI,MAAM,yBAAyB,qBAAQ,YAAY,MAAM,WAAW,CAAC;AAGtI,gBAAM,MAAM,WAAW;AAAA,YACrB,aAAa;AAAA,YACb,eAAe;AAAA,YACf;AAAA,UACF,CAAC;AAAA,QACH,OAAO;AACL,gBAAM,MAAM,WAAW;AAAA,YACrB,aAAa;AAAA,YACb;AAAA,UACF,CAAC;AAAA,QACH;AACA,cAAM,MAAM,SAAS,SAAS,MAAM;AAAA,MACtC;AAAA,IACF,GAAG,cAAc,cAAc;AAAA,IAC/B,wBAAAH;AAAA,EACF,CAAC;AACD,QAAM,eAAe,eAAe;AACpC,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AACA,SAAO;AACT,CAAC;AACD,IAAI,KAAuC,eAAc,cAAc;;;ACpHhE,IAAM,oBAAoB;;;ACJ1B,SAAS,mBAAmB;AACjC,QAAM,QAAQ,+BAA+B;AAC7C,SAAO,MAAM;AACf;","names":["result","React","index","React","React","stateAttributesMapping","size","React","React","set","React","getComputedStyle","React","React","React","React","React","disabled","disabled","React","React","React","React","React","React","React","React","CheckboxRoot","disabled","element","stateAttributesMapping","React","React","React","index","React","TransitionStatusDataAttributes","CheckboxIndicator","stateAttributesMapping","jsx","jsx","React","index_parts_exports","React","React","React","React","React","didChange","index","React","selectors","index","React","EMPTY","React","version","_jsx","React","React","_jsx","FocusGuard","index","offset","index","getComputedStyle","getComputedStyle","index","attr","React","ReactDOM","_jsx","_jsxs","FloatingPortal","React","index","_jsx","_jsx","_jsxs","disabled","React","isClickLikeOpenEvent","React","reference","React","escapeKey","outsidePress","getComputedStyle","isScrollableX","isScrollableY","isRTL","unsubscribe","React","platform","platform","placements","sides","side","placement","overflow","platform","x","y","offset","getComputedStyle","platform","update","offset","shift","flip","size","limitShift","computePosition","platform","React","useLayoutEffect","ReactDOM","noop","platform","update","computePosition","data","offset","shift","limitShift","flip","size","index","React","ReactDOM","React","React","useSyncExternalStore","subscribe","getSnapshot","useSyncExternalStore","React","React","isClickLikeOpenEvent","React","ReactDOM","isClickLikeOpenEvent","React","item","scheduler","index","React","index","startIndex","offset","React","React","index","React","_jsx","index","selectors","index","index","React","React","clamp","min","max","max","clamp","_jsx","_jsxs","disabled","selectors","index","listNavigation","React","SelectLabel","selectors","React","CommonPopupDataAttributes","SelectTrigger","disabled","selectors","React","stateAttributesMapping","SelectValue","selectors","React","SelectIcon","selectors","React","_jsx","SelectPortal","selectors","React","stateAttributesMapping","SelectBackdrop","selectors","React","React","React","_jsx","register","index","React","React","platform","min","max","offset","arrow","hide","shift","adaptiveOrigin","offset","flip","limitShift","size","x","y","arrow","elements","middlewareData","renderedPlacement","hide","update","React","React","_jsx","InternalBackdrop","React","isScrollableY","isScrollableX","_jsx","_jsxs","SelectPositioner","selectors","React","_jsx","React","ARROW_UP","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","React","_jsx","_jsxs","stateAttributesMapping","SelectPopup","selectors","getScale","clamp","platform","size","React","SelectList","selectors","React","React","register","index","React","_jsx","SelectItem","disabled","selectors","index","React","_jsx","SelectItemIndicator","React","SelectItemText","index","React","SelectArrow","selectors","React","React","SelectScrollArrow","selectors","targetIndex","targetItem","_jsx","SelectScrollDownArrow","React","_jsx","SelectScrollUpArrow","React","React","_jsx","SelectGroup","React","SelectGroupLabel","React","ListboxSeparator","CheckIcon","jsx","index_parts_exports","SelectGroup","SelectValue","SelectTrigger","size","SelectItem","CheckIcon","SelectLabel","SelectSeparator","index_parts_exports","React","React","DialogBackdrop","React","DialogClose","disabled","React","DialogDescription","React","React","_jsx","DialogPopup","React","_jsx","_jsxs","DialogPortal","React","React","React","selectors","_jsx","_jsxs","React","DialogViewport","React","DialogTitle","React","DialogTrigger","disabled","jsx","jsxs","index_parts_exports","DialogTrigger","DialogClose","DialogPortal","size","DialogTitle","DialogDescription","jsx","jsx","jsx","React","index_parts_exports","React","DrawerPopupCssVars","DrawerBackdropCssVars","DrawerBackdrop","React","DrawerContent","React","React","stateAttributesMapping","DrawerIndent","React","stateAttributesMapping","DrawerIndentBackground","React","DrawerPopupDataAttributes","React","React","clamp","index","React","_jsx","stateAttributesMapping","DrawerPopup","swipe","popupElement","React","_jsx","React","_jsx","_jsxs","closeWatcher","React","React","getComputedStyle","error","clamp","offset","isInteractiveElement","size","DrawerSwipeAreaDataAttributes","stateAttributesMapping","DrawerSwipeArea","disabled","size","offset","swipe","React","ReactDOM","React","_jsx","DrawerViewport","clamp","size","swipe","closeDistance","max","offset","React","DrawerViewportCssVars","_jsx","getComputedStyle","clamp","XIcon","jsx","jsxs","index_parts_exports","XIcon","index_parts_exports","React","React","React","selectors","createInitialState","createInitialContext","_jsx","_jsxs","TooltipRoot","disabled","React","React","TooltipTrigger","disabled","React","React","React","ReactDOM","_jsxs","FloatingPortalLite","_jsx","TooltipPortal","React","React","_jsx","TooltipPositioner","adaptiveOrigin","React","TooltipPopup","disabled","React","TooltipArrow","React","_jsx","TooltipProvider","React","React","ReactDOM","React","getCssDimensions","getComputedStyle","getCssDimensions","size","platform","_jsx","_jsxs","offset","TooltipViewport","jsx","jsxs","TooltipProvider","index_parts_exports","TooltipTrigger","index_parts_exports","XIcon","jsx","jsxs","index_parts_exports","AlertDialogTrigger","XIcon","React","index_parts_exports","React","React","_jsx","TabsRoot","React","React","index","disabled","React","TabsTab","disabled","index","element","React","React","useSyncExternalStore","useSyncExternalStore","_jsx","script","_jsx","_jsxs","stateAttributesMapping","TabsIndicator","getCssDimensions","React","stateAttributesMapping","TabsPanel","index","React","React","React","EMPTY_ARRAY","index","ARROW_LEFT","ARROW_RIGHT","ARROW_DOWN","ARROW_UP","_jsx","stateAttributesMapping","_jsx","TabsList","jsx","size","index_parts_exports","TabsList","cva","jsx","jsxs","cva","jsx","React","index_parts_exports","React","React","disabled","React","CollapsiblePanelDataAttributes","CollapsibleTriggerDataAttributes","triggerOpenStateMapping","_jsx","CollapsibleRoot","disabled","React","stateAttributesMapping","triggerOpenStateMapping","CollapsibleTrigger","disabled","React","React","getDimensions","CollapsiblePanelCssVars","CollapsiblePanel","jsx","index_parts_exports","CollapsibleTrigger","index_parts_exports","Separator","React","React","React","MenuArrow","React","React","MenuBackdrop","React","React","React","React","disabled","MenuCheckboxItemDataAttributes","_jsx","MenuCheckboxItem","disabled","React","MenuCheckboxItemIndicator","React","React","_jsx","MenuGroup","React","MenuGroupLabel","React","MenuItem","disabled","React","MenuLinkItem","React","_jsx","MenuPopup","disabled","React","React","_jsx","MenuPortal","React","_jsx","_jsxs","MenuPositioner","adaptiveOrigin","React","React","_jsx","MenuRadioGroup","disabled","React","React","_jsx","MenuRadioItem","disabled","React","MenuRadioItemIndicator","React","React","React","selectors","createInitialState","createInitialContext","React","_jsx","_jsxs","MenuRoot","disabled","index","listNavigation","React","_jsx","_jsx","React","stateAttributesMapping","React","ReactDOM","React","_jsx","_jsxs","MenuTrigger","disabled","React","MenuViewport","React","Separator","React","MenuSubmenuTrigger","element","disabled","jsx","jsxs","index_parts_exports","index_parts_exports","React","React","React","selectors","index","React","contains","_jsx","_jsxs","disabled","selectors","inline","index","listNavigation","_jsx","React","ComboboxLabel","selectors","React","_jsx","selectors","React","React","React","React","_jsx","ComboboxInternalDismissButton","selectors","index","_jsx","_jsxs","ComboboxInput","selectors","inline","disabled","element","isRTL","index","React","disabled","ComboboxInputGroup","selectors","disabled","React","ComboboxTrigger","selectors","disabled","index","element","React","React","React","_jsx","_jsx","_jsx","ComboboxList","selectors","element","React","React","ComboboxStatus","React","React","_jsx","ComboboxPortal","selectors","React","stateAttributesMapping","ComboboxBackdrop","selectors","React","_jsx","_jsxs","ComboboxPositioner","selectors","element","React","_jsx","_jsxs","stateAttributesMapping","ComboboxPopup","selectors","React","ComboboxArrow","selectors","React","ComboboxIcon","React","React","_jsx","ComboboxGroup","React","ComboboxGroupLabel","React","ReactDOM","React","React","_jsx","selectors","disabled","index","ComboboxItem","React","_jsx","ComboboxItemIndicator","Inner","React","_jsx","ComboboxChips","selectors","React","ReactDOM","React","_jsx","ComboboxChip","disabled","selectors","index","React","ComboboxChipRemove","index","selectors","disabled","React","_jsx","ComboboxRow","React","ComboboxEmpty","React","stateAttributesMapping","ComboboxClear","selectors","disabled"]}