{"version":3,"file":"Select.cjs","sources":["../../node_modules/@mui/base/Option/optionClasses.js","../../node_modules/@mui/base/useOption/useOption.js","../../node_modules/@mui/base/useOption/useOptionContextStabilizer.js","../../node_modules/@mui/base/Option/Option.js","../../node_modules/@mui/base/useSelect/useSelect.types.js","../../node_modules/@mui/base/useSelect/defaultOptionStringifier.js","../../node_modules/@mui/base/useSelect/selectReducer.js","../../node_modules/@mui/base/useSelect/useSelect.js","../../node_modules/@mui/base/useSelect/SelectProvider.js","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../../node_modules/@mui/base/Unstable_Popup/popupClasses.js","../../node_modules/@mui/base/useTransition/TransitionContext.js","../../node_modules/@mui/base/useTransition/useTransitionTrigger.js","../../node_modules/@mui/base/Unstable_Popup/PopupContext.js","../../node_modules/@mui/base/Unstable_Popup/Popup.js","../../node_modules/@mui/base/Select/selectClasses.js","../../node_modules/@mui/base/Select/Select.js","../src/Select/Select.tsx"],"sourcesContent":["import { generateUtilityClass } from '../generateUtilityClass';\nimport { generateUtilityClasses } from '../generateUtilityClasses';\nconst COMPONENT_NAME = 'Option';\nexport function getOptionUtilityClass(slot) {\n  return generateUtilityClass(COMPONENT_NAME, slot);\n}\nexport const optionClasses = generateUtilityClasses(COMPONENT_NAME, ['root', 'disabled', 'selected', 'highlighted']);","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useForkRef as useForkRef, unstable_useId as useId } from '@mui/utils';\nimport { extractEventHandlers } from '../utils/extractEventHandlers';\nimport { useListItem } from '../useList';\nimport { useCompoundItem } from '../useCompound';\nimport { useButton } from '../useButton';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\n/**\n *\n * Demos:\n *\n * - [Select](https://mui.com/base-ui/react-select/#hooks)\n *\n * API:\n *\n * - [useOption API](https://mui.com/base-ui/react-select/hooks-api/#use-option)\n */\nexport function useOption(params) {\n  const {\n    value,\n    label,\n    disabled,\n    rootRef: optionRefParam,\n    id: idParam\n  } = params;\n  const {\n    getRootProps: getListItemProps,\n    highlighted,\n    selected\n  } = useListItem({\n    item: value\n  });\n  const {\n    getRootProps: getButtonProps,\n    rootRef: buttonRefHandler\n  } = useButton({\n    disabled,\n    focusableWhenDisabled: true\n  });\n  const id = useId(idParam);\n  const optionRef = React.useRef(null);\n  const selectOption = React.useMemo(() => ({\n    disabled,\n    label,\n    value,\n    ref: optionRef,\n    id\n  }), [disabled, label, value, id]);\n  const {\n    index\n  } = useCompoundItem(value, selectOption);\n  const handleRef = useForkRef(optionRefParam, optionRef, buttonRefHandler);\n  const createHandleKeyDown = otherHandlers => event => {\n    var _otherHandlers$onKeyD;\n    (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);\n    if (event.defaultMuiPrevented) {\n      return;\n    }\n    if ([' ', 'Enter'].includes(event.key)) {\n      event.defaultMuiPrevented = true; // prevent listbox onKeyDown\n    }\n  };\n  const getOwnHandlers = (otherHandlers = {}) => ({\n    onKeyDown: createHandleKeyDown(otherHandlers)\n  });\n  return {\n    getRootProps: (externalProps = {}) => {\n      const externalEventHandlers = extractEventHandlers(externalProps);\n      const getCombinedRootProps = combineHooksSlotProps(getListItemProps, combineHooksSlotProps(getButtonProps, getOwnHandlers));\n      return _extends({}, externalProps, externalEventHandlers, getCombinedRootProps(externalEventHandlers), {\n        id,\n        ref: handleRef,\n        role: 'option',\n        'aria-selected': selected\n      });\n    },\n    highlighted,\n    index,\n    selected,\n    rootRef: handleRef\n  };\n}","'use client';\n\nimport * as React from 'react';\nimport { ListContext } from '../useList';\n\n/**\n * Stabilizes the ListContext value for the Option component, so it doesn't change when sibling Options update.\n *\n * @param value The value of the Option.\n * @returns The stable ListContext value.\n *\n * Demos:\n *\n * - [Select](https://mui.com/base-ui/react-select/#hooks)\n *\n * API:\n *\n * - [useOptionContextStabilizer API](https://mui.com/base-ui/react-select/hooks-api/#use-option-context-stabilizer)\n */\nexport function useOptionContextStabilizer(value) {\n  const listContext = React.useContext(ListContext);\n  if (!listContext) {\n    throw new Error('Option: ListContext was not found.');\n  }\n  const {\n    getItemState,\n    dispatch\n  } = listContext;\n  const {\n    highlighted,\n    selected,\n    focusable\n  } = getItemState(value);\n\n  // The local version of getItemState can be only called with the current Option's value.\n  // It doesn't make much sense to render an Option depending on other Options' state anyway.\n  const localGetItemState = React.useCallback(itemValue => {\n    if (itemValue !== value) {\n      throw new Error(['Base UI Option: Tried to access the state of another Option.', 'This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization.'].join('/n'));\n    }\n    return {\n      highlighted,\n      selected,\n      focusable\n    };\n  }, [highlighted, selected, focusable, value]);\n\n  // Create a local (per Option) instance of the ListContext that changes only when\n  // the getItemState's return value changes.\n  // This makes Options re-render only when their state actually change, not when any Option's state changes.\n  const localContextValue = React.useMemo(() => ({\n    dispatch,\n    getItemState: localGetItemState\n  }), [dispatch, localGetItemState]);\n  return {\n    contextValue: localContextValue\n  };\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"disabled\", \"label\", \"slotProps\", \"slots\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '../composeClasses';\nimport { getOptionUtilityClass } from './optionClasses';\nimport { useSlotProps } from '../utils';\nimport { useOption, useOptionContextStabilizer } from '../useOption';\nimport { useClassNamesOverride } from '../utils/ClassNameConfigurator';\nimport { ListContext } from '../useList';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction useUtilityClasses(ownerState) {\n  const {\n    disabled,\n    highlighted,\n    selected\n  } = ownerState;\n  const slots = {\n    root: ['root', disabled && 'disabled', highlighted && 'highlighted', selected && 'selected']\n  };\n  return composeClasses(slots, useClassNamesOverride(getOptionUtilityClass));\n}\nconst InnerOption = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Option(props, forwardedRef) {\n  var _slots$root, _optionRef$current;\n  const {\n      children,\n      disabled = false,\n      label,\n      slotProps = {},\n      slots = {},\n      value\n    } = props,\n    other = _objectWithoutPropertiesLoose(props, _excluded);\n  const Root = (_slots$root = slots.root) != null ? _slots$root : 'li';\n  const optionRef = React.useRef(null);\n  const combinedRef = useForkRef(optionRef, forwardedRef);\n\n  // If `label` is not explicitly provided, the `children` are used for convenience.\n  // This is used to populate the select's trigger with the selected option's label.\n  const computedLabel = label != null ? label : typeof children === 'string' ? children : (_optionRef$current = optionRef.current) == null || (_optionRef$current = _optionRef$current.textContent) == null ? void 0 : _optionRef$current.trim();\n  const {\n    getRootProps,\n    selected,\n    highlighted,\n    index\n  } = useOption({\n    disabled,\n    label: computedLabel,\n    rootRef: combinedRef,\n    value\n  });\n  const ownerState = _extends({}, props, {\n    disabled,\n    highlighted,\n    index,\n    selected\n  });\n  const classes = useUtilityClasses(ownerState);\n  const rootProps = useSlotProps({\n    getSlotProps: getRootProps,\n    elementType: Root,\n    externalSlotProps: slotProps.root,\n    externalForwardedProps: other,\n    className: classes.root,\n    ownerState\n  });\n  return /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {\n    children: children\n  }));\n}));\n\n/**\n * An unstyled option to be used within a Select.\n *\n * Demos:\n *\n * - [Select](https://mui.com/base-ui/react-select/)\n *\n * API:\n *\n * - [Option API](https://mui.com/base-ui/react-select/components-api/#option)\n */\nconst Option = /*#__PURE__*/React.forwardRef(function Option(props, ref) {\n  const {\n    value\n  } = props;\n\n  // This wrapper component is used as a performance optimization.\n  // `useOptionContextStabilizer` ensures that the context value\n  // is stable across renders, so that the actual Option re-renders\n  // only when it needs to.\n  const {\n    contextValue\n  } = useOptionContextStabilizer(value);\n  return /*#__PURE__*/_jsx(ListContext.Provider, {\n    value: contextValue,\n    children: /*#__PURE__*/_jsx(InnerOption, _extends({}, props, {\n      ref: ref\n    }))\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Option.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * @ignore\n   */\n  children: PropTypes.node,\n  /**\n   * @ignore\n   */\n  className: PropTypes.string,\n  /**\n   * If `true`, the option will be disabled.\n   * @default false\n   */\n  disabled: PropTypes.bool,\n  /**\n   * A text representation of the option's content.\n   * Used for keyboard text navigation matching.\n   */\n  label: PropTypes.string,\n  /**\n   * The props used for each slot inside the Option.\n   * @default {}\n   */\n  slotProps: PropTypes.shape({\n    root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n  }),\n  /**\n   * The components used for each slot inside the Option.\n   * Either a string to use a HTML element or a component.\n   * @default {}\n   */\n  slots: PropTypes.shape({\n    root: PropTypes.elementType\n  }),\n  /**\n   * The value of the option.\n   */\n  value: PropTypes.any.isRequired\n} : void 0;\nexport { Option };","export const SelectActionTypes = {\n  buttonClick: 'buttonClick',\n  browserAutoFill: 'browserAutoFill'\n};","const defaultOptionStringifier = option => {\n  const {\n    label,\n    value\n  } = option;\n  if (typeof label === 'string') {\n    return label;\n  }\n  if (typeof value === 'string') {\n    return value;\n  }\n\n  // Fallback string representation\n  return String(option);\n};\nexport { defaultOptionStringifier };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { moveHighlight, listReducer, ListActionTypes, handleItemSelection } from '../useList';\nimport { SelectActionTypes } from './useSelect.types';\nexport function selectReducer(state, action) {\n  const {\n    open\n  } = state;\n  const {\n    context: {\n      selectionMode\n    }\n  } = action;\n  if (action.type === SelectActionTypes.buttonClick) {\n    var _state$selectedValues;\n    const itemToHighlight = (_state$selectedValues = state.selectedValues[0]) != null ? _state$selectedValues : moveHighlight(null, 'start', action.context);\n    return _extends({}, state, {\n      open: !open,\n      highlightedValue: !open ? itemToHighlight : null\n    });\n  }\n  if (action.type === SelectActionTypes.browserAutoFill) {\n    return handleItemSelection(action.item, state, action.context);\n  }\n  const newState = listReducer(state, action);\n  switch (action.type) {\n    case ListActionTypes.keyDown:\n      if (state.open) {\n        if (action.event.key === 'Escape') {\n          return _extends({}, newState, {\n            open: false\n          });\n        }\n      } else {\n        if (action.event.key === 'ArrowDown') {\n          var _state$selectedValues2;\n          return _extends({}, state, {\n            open: true,\n            highlightedValue: (_state$selectedValues2 = state.selectedValues[0]) != null ? _state$selectedValues2 : moveHighlight(null, 'start', action.context)\n          });\n        }\n        if (action.event.key === 'ArrowUp') {\n          var _state$selectedValues3;\n          return _extends({}, state, {\n            open: true,\n            highlightedValue: (_state$selectedValues3 = state.selectedValues[0]) != null ? _state$selectedValues3 : moveHighlight(null, 'end', action.context)\n          });\n        }\n      }\n      break;\n    case ListActionTypes.itemClick:\n      if (selectionMode === 'single') {\n        return _extends({}, newState, {\n          open: false\n        });\n      }\n      break;\n    case ListActionTypes.blur:\n      return _extends({}, newState, {\n        open: false\n      });\n    default:\n      return newState;\n  }\n  return newState;\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useForkRef as useForkRef, unstable_useId as useId, unstable_useEnhancedEffect as useEnhancedEffect, visuallyHidden as visuallyHiddenStyle } from '@mui/utils';\nimport { useButton } from '../useButton';\nimport { SelectActionTypes } from './useSelect.types';\nimport { ListActionTypes, useList } from '../useList';\nimport { defaultOptionStringifier } from './defaultOptionStringifier';\nimport { useCompoundParent } from '../useCompound';\nimport { extractEventHandlers } from '../utils/extractEventHandlers';\nimport { selectReducer } from './selectReducer';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\nfunction defaultFormValueProvider(selectedOption) {\n  if (Array.isArray(selectedOption)) {\n    if (selectedOption.length === 0) {\n      return '';\n    }\n    return JSON.stringify(selectedOption.map(o => o.value));\n  }\n  if ((selectedOption == null ? void 0 : selectedOption.value) == null) {\n    return '';\n  }\n  if (typeof selectedOption.value === 'string' || typeof selectedOption.value === 'number') {\n    return selectedOption.value;\n  }\n  return JSON.stringify(selectedOption.value);\n}\n\n/**\n *\n * Demos:\n *\n * - [Select](https://mui.com/base-ui/react-select/#hooks)\n *\n * API:\n *\n * - [useSelect API](https://mui.com/base-ui/react-select/hooks-api/#use-select)\n */\nfunction useSelect(props) {\n  const {\n    areOptionsEqual,\n    buttonRef: buttonRefProp,\n    defaultOpen = false,\n    defaultValue: defaultValueProp,\n    disabled = false,\n    listboxId: listboxIdProp,\n    listboxRef: listboxRefProp,\n    multiple = false,\n    name,\n    required,\n    onChange,\n    onHighlightChange,\n    onOpenChange,\n    open: openProp,\n    options: optionsParam,\n    getOptionAsString = defaultOptionStringifier,\n    getSerializedValue = defaultFormValueProvider,\n    value: valueProp,\n    componentName = 'useSelect'\n  } = props;\n  const buttonRef = React.useRef(null);\n  const handleButtonRef = useForkRef(buttonRefProp, buttonRef);\n  const listboxRef = React.useRef(null);\n  const listboxId = useId(listboxIdProp);\n  let defaultValue;\n  if (valueProp === undefined && defaultValueProp === undefined) {\n    defaultValue = [];\n  } else if (defaultValueProp !== undefined) {\n    if (multiple) {\n      defaultValue = defaultValueProp;\n    } else {\n      defaultValue = defaultValueProp == null ? [] : [defaultValueProp];\n    }\n  }\n  const value = React.useMemo(() => {\n    if (valueProp !== undefined) {\n      if (multiple) {\n        return valueProp;\n      }\n      return valueProp == null ? [] : [valueProp];\n    }\n    return undefined;\n  }, [valueProp, multiple]);\n  const {\n    subitems,\n    contextValue: compoundComponentContextValue\n  } = useCompoundParent();\n  const options = React.useMemo(() => {\n    if (optionsParam != null) {\n      return new Map(optionsParam.map((option, index) => [option.value, {\n        value: option.value,\n        label: option.label,\n        disabled: option.disabled,\n        ref: /*#__PURE__*/React.createRef(),\n        id: `${listboxId}_${index}`\n      }]));\n    }\n    return subitems;\n  }, [optionsParam, subitems, listboxId]);\n  const handleListboxRef = useForkRef(listboxRefProp, listboxRef);\n  const {\n    getRootProps: getButtonRootProps,\n    active: buttonActive,\n    focusVisible: buttonFocusVisible,\n    rootRef: mergedButtonRef\n  } = useButton({\n    disabled,\n    rootRef: handleButtonRef\n  });\n  const optionValues = React.useMemo(() => Array.from(options.keys()), [options]);\n  const getOptionByValue = React.useCallback(valueToGet => {\n    // This can't be simply `options.get(valueToGet)` because of the `areOptionsEqual` prop.\n    // If it's provided, we assume that the user wants to compare the options by value.\n    if (areOptionsEqual !== undefined) {\n      const similarValue = optionValues.find(optionValue => areOptionsEqual(optionValue, valueToGet));\n      return options.get(similarValue);\n    }\n    return options.get(valueToGet);\n  }, [options, areOptionsEqual, optionValues]);\n  const isItemDisabled = React.useCallback(valueToCheck => {\n    var _option$disabled;\n    const option = getOptionByValue(valueToCheck);\n    return (_option$disabled = option == null ? void 0 : option.disabled) != null ? _option$disabled : false;\n  }, [getOptionByValue]);\n  const stringifyOption = React.useCallback(valueToCheck => {\n    const option = getOptionByValue(valueToCheck);\n    if (!option) {\n      return '';\n    }\n    return getOptionAsString(option);\n  }, [getOptionByValue, getOptionAsString]);\n  const controlledState = React.useMemo(() => ({\n    selectedValues: value,\n    open: openProp\n  }), [value, openProp]);\n  const getItemId = React.useCallback(itemValue => {\n    var _options$get;\n    return (_options$get = options.get(itemValue)) == null ? void 0 : _options$get.id;\n  }, [options]);\n  const handleSelectionChange = React.useCallback((event, newValues) => {\n    if (multiple) {\n      onChange == null || onChange(event, newValues);\n    } else {\n      var _newValues$;\n      onChange == null || onChange(event, (_newValues$ = newValues[0]) != null ? _newValues$ : null);\n    }\n  }, [multiple, onChange]);\n  const handleHighlightChange = React.useCallback((event, newValue) => {\n    onHighlightChange == null || onHighlightChange(event, newValue != null ? newValue : null);\n  }, [onHighlightChange]);\n  const handleStateChange = React.useCallback((event, field, fieldValue) => {\n    if (field === 'open') {\n      onOpenChange == null || onOpenChange(fieldValue);\n      if (fieldValue === false && (event == null ? void 0 : event.type) !== 'blur') {\n        var _buttonRef$current;\n        (_buttonRef$current = buttonRef.current) == null || _buttonRef$current.focus();\n      }\n    }\n  }, [onOpenChange]);\n  const getItemDomElement = React.useCallback(itemId => {\n    var _subitems$get$ref$cur, _subitems$get;\n    if (itemId == null) {\n      return null;\n    }\n    return (_subitems$get$ref$cur = (_subitems$get = subitems.get(itemId)) == null ? void 0 : _subitems$get.ref.current) != null ? _subitems$get$ref$cur : null;\n  }, [subitems]);\n  const useListParameters = {\n    getInitialState: () => {\n      var _defaultValue;\n      return {\n        highlightedValue: null,\n        selectedValues: (_defaultValue = defaultValue) != null ? _defaultValue : [],\n        open: defaultOpen\n      };\n    },\n    getItemId,\n    controlledProps: controlledState,\n    focusManagement: 'DOM',\n    getItemDomElement,\n    itemComparer: areOptionsEqual,\n    isItemDisabled,\n    rootRef: handleListboxRef,\n    onChange: handleSelectionChange,\n    onHighlightChange: handleHighlightChange,\n    onStateChange: handleStateChange,\n    reducerActionContext: React.useMemo(() => ({\n      multiple\n    }), [multiple]),\n    items: optionValues,\n    getItemAsString: stringifyOption,\n    selectionMode: multiple ? 'multiple' : 'single',\n    stateReducer: selectReducer,\n    componentName\n  };\n  const {\n    dispatch,\n    getRootProps: getListboxRootProps,\n    contextValue: listContextValue,\n    state: {\n      open,\n      highlightedValue: highlightedOption,\n      selectedValues: selectedOptions\n    },\n    rootRef: mergedListRootRef\n  } = useList(useListParameters);\n\n  // store the initial open state to prevent focus stealing\n  // (the first option gets focused only when the select is opened by the user)\n  const isInitiallyOpen = React.useRef(open);\n  useEnhancedEffect(() => {\n    if (open && highlightedOption !== null) {\n      var _getOptionByValue;\n      const optionRef = (_getOptionByValue = getOptionByValue(highlightedOption)) == null ? void 0 : _getOptionByValue.ref;\n      if (!listboxRef.current || !(optionRef != null && optionRef.current)) {\n        return;\n      }\n      if (!isInitiallyOpen.current) {\n        optionRef.current.focus({\n          preventScroll: true\n        });\n      }\n      const listboxClientRect = listboxRef.current.getBoundingClientRect();\n      const optionClientRect = optionRef.current.getBoundingClientRect();\n      if (optionClientRect.top < listboxClientRect.top) {\n        listboxRef.current.scrollTop -= listboxClientRect.top - optionClientRect.top;\n      } else if (optionClientRect.bottom > listboxClientRect.bottom) {\n        listboxRef.current.scrollTop += optionClientRect.bottom - listboxClientRect.bottom;\n      }\n    }\n  }, [open, highlightedOption, getOptionByValue]);\n  const getOptionMetadata = React.useCallback(optionValue => getOptionByValue(optionValue), [getOptionByValue]);\n  const createHandleButtonClick = externalEventHandlers => event => {\n    var _externalEventHandler;\n    externalEventHandlers == null || (_externalEventHandler = externalEventHandlers.onClick) == null || _externalEventHandler.call(externalEventHandlers, event);\n    if (!event.defaultMuiPrevented) {\n      const action = {\n        type: SelectActionTypes.buttonClick,\n        event\n      };\n      dispatch(action);\n    }\n  };\n  const createHandleButtonKeyDown = otherHandlers => event => {\n    var _otherHandlers$onKeyD;\n    (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);\n    if (event.defaultMuiPrevented) {\n      return;\n    }\n    if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n      event.preventDefault();\n      dispatch({\n        type: ListActionTypes.keyDown,\n        key: event.key,\n        event\n      });\n    }\n  };\n  const getButtonOwnRootProps = (otherHandlers = {}) => ({\n    onClick: createHandleButtonClick(otherHandlers),\n    onKeyDown: createHandleButtonKeyDown(otherHandlers)\n  });\n  const getSelectTriggerProps = (otherHandlers = {}) => {\n    return _extends({}, otherHandlers, getButtonOwnRootProps(otherHandlers), {\n      role: 'combobox',\n      'aria-expanded': open,\n      'aria-controls': listboxId\n    });\n  };\n  const getButtonProps = (externalProps = {}) => {\n    const externalEventHandlers = extractEventHandlers(externalProps);\n    const combinedProps = combineHooksSlotProps(getSelectTriggerProps, getButtonRootProps);\n    return _extends({}, externalProps, combinedProps(externalEventHandlers));\n  };\n  const createListboxHandleBlur = otherHandlers => event => {\n    var _otherHandlers$onBlur, _listboxRef$current;\n    (_otherHandlers$onBlur = otherHandlers.onBlur) == null || _otherHandlers$onBlur.call(otherHandlers, event);\n    if (event.defaultMuiPrevented) {\n      return;\n    }\n    if ((_listboxRef$current = listboxRef.current) != null && _listboxRef$current.contains(event.relatedTarget) || event.relatedTarget === buttonRef.current) {\n      event.defaultMuiPrevented = true;\n    }\n  };\n  const getOwnListboxHandlers = (otherHandlers = {}) => ({\n    onBlur: createListboxHandleBlur(otherHandlers)\n  });\n  const getListboxProps = (externalProps = {}) => {\n    const externalEventHandlers = extractEventHandlers(externalProps);\n    const getCombinedRootProps = combineHooksSlotProps(getOwnListboxHandlers, getListboxRootProps);\n    return _extends({\n      id: listboxId,\n      role: 'listbox',\n      'aria-multiselectable': multiple ? 'true' : undefined\n    }, externalProps, getCombinedRootProps(externalEventHandlers));\n  };\n  React.useDebugValue({\n    selectedOptions,\n    highlightedOption,\n    open\n  });\n  const contextValue = React.useMemo(() => _extends({}, listContextValue, compoundComponentContextValue), [listContextValue, compoundComponentContextValue]);\n  let selectValue;\n  if (props.multiple) {\n    selectValue = selectedOptions;\n  } else {\n    selectValue = selectedOptions.length > 0 ? selectedOptions[0] : null;\n  }\n  let selectedOptionsMetadata;\n  if (multiple) {\n    selectedOptionsMetadata = selectValue.map(v => getOptionMetadata(v)).filter(o => o !== undefined);\n  } else {\n    var _getOptionMetadata;\n    selectedOptionsMetadata = (_getOptionMetadata = getOptionMetadata(selectValue)) != null ? _getOptionMetadata : null;\n  }\n  const createHandleHiddenInputChange = externalEventHandlers => event => {\n    var _externalEventHandler2;\n    externalEventHandlers == null || (_externalEventHandler2 = externalEventHandlers.onChange) == null || _externalEventHandler2.call(externalEventHandlers, event);\n    if (event.defaultMuiPrevented) {\n      return;\n    }\n    const option = options.get(event.target.value);\n\n    // support autofill\n    if (event.target.value === '') {\n      dispatch({\n        type: ListActionTypes.clearSelection\n      });\n    } else if (option !== undefined) {\n      dispatch({\n        type: SelectActionTypes.browserAutoFill,\n        item: option.value,\n        event\n      });\n    }\n  };\n  const getHiddenInputProps = (externalProps = {}) => {\n    const externalEventHandlers = extractEventHandlers(externalProps);\n    return _extends({\n      name,\n      tabIndex: -1,\n      'aria-hidden': true,\n      required: required ? true : undefined,\n      value: getSerializedValue(selectedOptionsMetadata),\n      style: visuallyHiddenStyle\n    }, externalProps, {\n      onChange: createHandleHiddenInputChange(externalEventHandlers)\n    });\n  };\n  return {\n    buttonActive,\n    buttonFocusVisible,\n    buttonRef: mergedButtonRef,\n    contextValue,\n    disabled,\n    dispatch,\n    getButtonProps,\n    getHiddenInputProps,\n    getListboxProps,\n    getOptionMetadata,\n    listboxRef: mergedListRootRef,\n    open,\n    options: optionValues,\n    value: selectValue,\n    highlightedOption\n  };\n}\nexport { useSelect };","'use client';\n\nimport * as React from 'react';\nimport { ListContext } from '../useList/ListContext';\nimport { CompoundComponentContext } from '../useCompound';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Sets up the contexts for the underlying Option components.\n *\n * @ignore - do not document.\n */\nexport function SelectProvider(props) {\n  const {\n    value,\n    children\n  } = props;\n  const {\n    dispatch,\n    getItemIndex,\n    getItemState,\n    registerItem,\n    totalSubitemCount\n  } = value;\n  const listContextValue = React.useMemo(() => ({\n    dispatch,\n    getItemState,\n    getItemIndex\n  }), [dispatch, getItemIndex, getItemState]);\n  const compoundComponentContextValue = React.useMemo(() => ({\n    getItemIndex,\n    registerItem,\n    totalSubitemCount\n  }), [registerItem, getItemIndex, totalSubitemCount]);\n  return /*#__PURE__*/_jsx(CompoundComponentContext.Provider, {\n    value: compoundComponentContextValue,\n    children: /*#__PURE__*/_jsx(ListContext.Provider, {\n      value: listContextValue,\n      children: children\n    })\n  });\n}","/**\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};\nconst oppositeAlignmentMap = {\n  start: 'end',\n  end: 'start'\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  return ['top', 'bottom'].includes(getSide(placement)) ? '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.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n  const lr = ['left', 'right'];\n  const rl = ['right', 'left'];\n  const tb = ['top', 'bottom'];\n  const bt = ['bottom', 'top'];\n  switch (side) {\n    case 'top':\n    case 'bottom':\n      if (rtl) return isStart ? rl : lr;\n      return isStart ? lr : rl;\n    case 'left':\n    case 'right':\n      return isStart ? tb : bt;\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  return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    ...padding\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  return {\n    ...rect,\n    top: rect.y,\n    left: rect.x,\n    right: rect.x + rect.width,\n    bottom: rect.y + rect.height\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 { 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  switch (getAlignment(placement)) {\n    case 'start':\n      coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n    case 'end':\n      coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n  }\n  return coords;\n}\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 validMiddleware = middleware.filter(Boolean);\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 middlewareData = {};\n  let resetCount = 0;\n  for (let i = 0; i < validMiddleware.length; i++) {\n    const {\n      name,\n      fn\n    } = validMiddleware[i];\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,\n      elements: {\n        reference,\n        floating\n      }\n    });\n    x = nextX != null ? nextX : x;\n    y = nextY != null ? nextY : y;\n    middlewareData = {\n      ...middlewareData,\n      [name]: {\n        ...middlewareData[name],\n        ...data\n      }\n    };\n    if (reset && resetCount <= 50) {\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 * 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    ...rects.floating,\n    x,\n    y\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    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/**\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 min$1 = minPadding;\n    const max = clientSize - arrowDimensions[length] - maxPadding;\n    const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n    const offset = clamp(min$1, 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$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n    const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : 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 overflow = await detectOverflow(state, detectOverflowOptions);\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      const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\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 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 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      if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n        fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n      }\n      const placements = [initialPlacement, ...fallbackPlacements];\n      const overflow = await 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          // 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        // 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$map$so;\n                const placement = (_overflowsData$map$so = overflowsData.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$map$so[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      } = state;\n      const {\n        strategy = 'referenceHidden',\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      switch (strategy) {\n        case 'referenceHidden':\n          {\n            const overflow = await 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 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      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 && 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            const width = right - left;\n            const height = bottom - top;\n            return {\n              top,\n              bottom,\n              left,\n              right,\n              width,\n              height,\n              x: left,\n              y: 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          const left = minLeft;\n          const right = maxRight;\n          const width = right - left;\n          const height = bottom - top;\n          return {\n            top,\n            bottom,\n            left,\n            right,\n            width,\n            height,\n            x: left,\n            y: 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\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 = ['left', 'top'].includes(side) ? -1 : 1;\n  const crossAxisMulti = rtl && isVertical ? -1 : 1;\n  const rawValue = evaluate(options, state);\n  let {\n    mainAxis,\n    crossAxis,\n    alignmentAxis\n  } = typeof rawValue === 'number' ? {\n    mainAxis: rawValue,\n    crossAxis: 0,\n    alignmentAxis: null\n  } : {\n    mainAxis: 0,\n    crossAxis: 0,\n    alignmentAxis: null,\n    ...rawValue\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      } = 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 detectOverflow(state, detectOverflowOptions);\n      const crossAxis = getSideAxis(getSide(placement));\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      if (checkMainAxis) {\n        const minSide = mainAxis === 'y' ? 'top' : 'left';\n        const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n        const min = mainAxisCoord + overflow[minSide];\n        const max = mainAxisCoord - overflow[maxSide];\n        mainAxisCoord = clamp(min, mainAxisCoord, max);\n      }\n      if (checkCrossAxis) {\n        const minSide = crossAxis === 'y' ? 'top' : 'left';\n        const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n        const min = crossAxisCoord + overflow[minSide];\n        const max = crossAxisCoord - overflow[maxSide];\n        crossAxisCoord = clamp(min, crossAxisCoord, max);\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        }\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      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: 0,\n        crossAxis: 0,\n        ...rawOffset\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 = ['top', 'left'].includes(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/**\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 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 overflowAvailableHeight = height - overflow[heightSide];\n      const overflowAvailableWidth = width - overflow[widthSide];\n      const noShift = !state.middlewareData.shift;\n      let availableHeight = overflowAvailableHeight;\n      let availableWidth = overflowAvailableWidth;\n      if (isYAxis) {\n        const maximumClippingWidth = width - overflow.left - overflow.right;\n        availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n      } else {\n        const maximumClippingHeight = height - overflow.top - overflow.bottom;\n        availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;\n      }\n      if (noShift && !alignment) {\n        const xMin = max(overflow.left, 0);\n        const xMax = max(overflow.right, 0);\n        const yMin = max(overflow.top, 0);\n        const yMax = max(overflow.bottom, 0);\n        if (isYAxis) {\n          availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n        } else {\n          availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : 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","function 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  return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n  return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n  // Browsers without `ShadowRoot` support.\n  if (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) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n  return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isContainingBlock(element) {\n  const webkit = isWebKit();\n  const css = getComputedStyle(element);\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n  let currentNode = getParentNode(element);\n  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    if (isContainingBlock(currentNode)) {\n      return currentNode;\n    } else {\n      currentNode = getParentNode(currentNode);\n    }\n  }\n  return null;\n}\nfunction isWebKit() {\n  if (typeof CSS === 'undefined' || !CSS.supports) return false;\n  return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n  return ['html', 'body', '#document'].includes(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.pageXOffset,\n    scrollTop: element.pageYOffset\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.ownerDocument.body : 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    return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);\n  }\n  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isWebKit };\n","import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nexport { detectOverflow, offset } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getContainingBlock, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction 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    $: 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  if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n    return false;\n  }\n  return isFixed;\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) {\n    const win = getWindow(domElement);\n    const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n    let currentIFrame = win.frameElement;\n    while (currentIFrame && offsetParent && offsetWin !== win) {\n      const iframeScale = getScale(currentIFrame);\n      const iframeRect = currentIFrame.getBoundingClientRect();\n      const css = getComputedStyle(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      currentIFrame = getWindow(currentIFrame).frameElement;\n    }\n  }\n  return rectToClientRect({\n    width,\n    height,\n    x,\n    y\n  });\n}\n\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction topLayer(floating) {\n  let isTopLayer = false;\n  let x = 0;\n  let y = 0;\n  function setIsTopLayer(selector) {\n    try {\n      isTopLayer = isTopLayer || floating.matches(selector);\n    } catch (e) {}\n  }\n  topLayerSelectors.forEach(selector => {\n    setIsTopLayer(selector);\n  });\n  const containingBlock = getContainingBlock(floating);\n  if (isTopLayer && containingBlock) {\n    const rect = containingBlock.getBoundingClientRect();\n    x = rect.x;\n    y = rect.y;\n  }\n  return [isTopLayer, x, y];\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n  let {\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  } = _ref;\n  const documentElement = getDocumentElement(offsetParent);\n  const [isTopLayer] = elements ? topLayer(elements.floating) : [false];\n  if (offsetParent === documentElement || isTopLayer) {\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 || !isOffsetParentAnElement && strategy !== 'fixed') {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isHTMLElement(offsetParent)) {\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  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,\n    y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n  };\n}\n\nfunction getClientRects(element) {\n  return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n  // If <html> has a CSS width greater than the viewport, then this will be\n  // incorrect for RTL.\n  return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\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(element) {\n  const html = getDocumentElement(element);\n  const scroll = getNodeScroll(element);\n  const body = element.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(element);\n  const y = -scroll.scrollTop;\n  if (getComputedStyle(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\nfunction getViewportRect(element, strategy) {\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    width = visualViewport.width;\n    height = visualViewport.height;\n    const visualViewportBased = isWebKit();\n    if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\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 = isHTMLElement(element) ? getScale(element) : createCoords(1);\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') {\n    rect = getViewportRect(element, strategy);\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      ...clippingAncestor,\n      x: clippingAncestor.x - visualOffsets.x,\n      y: clippingAncestor.y - visualOffsets.y\n    };\n  }\n  return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n  const parentNode = getParentNode(element);\n  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n    return false;\n  }\n  return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\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 currentContainingBlockComputedStyle = null;\n  const elementIsFixed = getComputedStyle(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(currentNode);\n    const currentNodeIsContaining = isContainingBlock(currentNode);\n    if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n      currentContainingBlockComputedStyle = null;\n    }\n    const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n    if (shouldDropCurrentNode) {\n      // Drop non-containing blocks.\n      result = result.filter(ancestor => ancestor !== currentNode);\n    } else {\n      // Record last containing block for next iteration.\n      currentContainingBlockComputedStyle = 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' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);\n  const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n  const firstClippingAncestor = clippingAncestors[0];\n  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n    const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n  return {\n    width: clippingRect.right - clippingRect.left,\n    height: clippingRect.bottom - clippingRect.top,\n    x: clippingRect.left,\n    y: clippingRect.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, floating) {\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 || !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    } else if (documentElement) {\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n  let x = rect.left + scroll.scrollLeft - offsets.x;\n  let y = rect.top + scroll.scrollTop - offsets.y;\n  const [isTopLayer, topLayerX, topLayerY] = topLayer(floating);\n  if (isTopLayer) {\n    x += topLayerX;\n    y += topLayerY;\n    if (isOffsetParentAnElement) {\n      x += offsetParent.clientLeft;\n      y += offsetParent.clientTop;\n    }\n  }\n  return {\n    x,\n    y,\n    width: rect.width,\n    height: rect.height\n  };\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n  if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n  if (polyfill) {\n    return polyfill(element);\n  }\n  return element.offsetParent;\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 window = getWindow(element);\n  if (!isHTMLElement(element)) {\n    return window;\n  }\n  let offsetParent = getTrueOffsetParent(element, polyfill);\n  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n    offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n  }\n  if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n    return window;\n  }\n  return offsetParent || getContainingBlock(element) || window;\n}\n\nconst getElementRects = async function (data) {\n  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n  const getDimensionsFn = this.getDimensions;\n  return {\n    reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy, data.floating),\n    floating: {\n      x: 0,\n      y: 0,\n      ...(await getDimensionsFn(data.floating))\n    }\n  };\n};\n\nfunction isRTL(element) {\n  return getComputedStyle(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\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\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 {\n      left,\n      top,\n      width,\n      height\n    } = element.getBoundingClientRect();\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      if (ratio !== threshold) {\n        if (!isFirstUpdate) {\n          return refresh();\n        }\n        if (!ratio) {\n          timeoutId = setTimeout(() => {\n            refresh(false, 1e-7);\n          }, 100);\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  refresh(true);\n  return cleanup;\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) : []), ...getOverflowAncestors(floating)] : [];\n  ancestors.forEach(ancestor => {\n    ancestorScroll && ancestor.addEventListener('scroll', update, {\n      passive: true\n    });\n    ancestorResize && ancestor.addEventListener('resize', update);\n  });\n  const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : 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) {\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    resizeObserver.observe(floating);\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 && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\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 * 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 = {\n    platform,\n    ...options\n  };\n  const platformWithCache = {\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, flip, hide, inline, limitShift, platform, shift, size };\n","import { arrow as arrow$1, computePosition } from '@floating-ui/dom';\nexport { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\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 => {\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$1({\n            element: element.current,\n            padding\n          }).fn(state);\n        }\n        return {};\n      }\n      if (element) {\n        return arrow$1({\n          element,\n          padding\n        }).fn(state);\n      }\n      return {};\n    }\n  };\n};\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\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\n  // biome-ignore lint/suspicious/noSelfCompare: in source\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 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        isPositioned: true\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]);\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\n  // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included.\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\nexport { arrow, useFloating };\n","import { generateUtilityClass } from '../generateUtilityClass';\nimport { generateUtilityClasses } from '../generateUtilityClasses';\nconst COMPONENT_NAME = 'Popup';\nexport function getPopupUtilityClass(slot) {\n  return generateUtilityClass(COMPONENT_NAME, slot);\n}\nexport const popupClasses = generateUtilityClasses(COMPONENT_NAME, ['root', 'open']);","import * as React from 'react';\nexport const TransitionContext = /*#__PURE__*/React.createContext(null);","'use client';\n\nimport * as React from 'react';\n/**\n * Allows child elements to be transitioned in and out.\n *\n * Demos:\n *\n * - [Transitions](https://mui.com/base-ui/react-transitions/#hooks)\n *\n * API:\n *\n * - [useTransitionTrigger API](https://mui.com/base-ui/react-transitions/hooks-api/#use-transition-trigger)\n */\nexport function useTransitionTrigger(requestEnter) {\n  const [exitTransitionFinished, setExitTransitionFinished] = React.useState(true);\n  const hasPendingExitTransition = React.useRef(false);\n  const registeredTransitions = React.useRef(0);\n  const [hasTransition, setHasTransition] = React.useState(false);\n  const previousRequestEnter = React.useRef(requestEnter);\n  React.useEffect(() => {\n    if (!requestEnter &&\n    // checking registeredTransitions.current instead of hasTransition to avoid this effect re-firing whenever hasTransition changes\n    registeredTransitions.current > 0 &&\n    // prevents waiting for a pending transition right after mounting\n    previousRequestEnter.current !== requestEnter) {\n      hasPendingExitTransition.current = true;\n      setExitTransitionFinished(false);\n    }\n    previousRequestEnter.current = requestEnter;\n  }, [requestEnter]);\n  const handleExited = React.useCallback(() => {\n    hasPendingExitTransition.current = false;\n    setExitTransitionFinished(true);\n  }, []);\n  const registerTransition = React.useCallback(() => {\n    registeredTransitions.current += 1;\n    setHasTransition(true);\n    return () => {\n      registeredTransitions.current -= 1;\n      if (registeredTransitions.current === 0) {\n        setHasTransition(false);\n      }\n    };\n  }, []);\n  let hasExited;\n  if (!hasTransition) {\n    // If there are no transitions registered, the `exited` state is opposite of `requestEnter` immediately.\n    hasExited = !requestEnter;\n  } else if (requestEnter) {\n    hasExited = false;\n  } else {\n    hasExited = !hasPendingExitTransition.current && exitTransitionFinished;\n  }\n\n  // console.log({ hasExited, requestEnter, hasPendingExitTransition, exitTransitionFinished });\n\n  const contextValue = React.useMemo(() => ({\n    requestedEnter: requestEnter,\n    onExited: handleExited,\n    registerTransition,\n    hasExited\n  }), [handleExited, requestEnter, registerTransition, hasExited]);\n  return {\n    contextValue,\n    hasExited\n  };\n}","import * as React from 'react';\nexport const PopupContext = /*#__PURE__*/React.createContext(null);","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"anchor\", \"children\", \"container\", \"disablePortal\", \"keepMounted\", \"middleware\", \"offset\", \"open\", \"placement\", \"slotProps\", \"slots\", \"strategy\", \"withTransition\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/react-dom';\nimport { HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '../composeClasses';\nimport { Portal } from '../Portal';\nimport { useSlotProps } from '../utils';\nimport { useClassNamesOverride } from '../utils/ClassNameConfigurator';\nimport { getPopupUtilityClass } from './popupClasses';\nimport { useTransitionTrigger, TransitionContext } from '../useTransition';\nimport { PopupContext } from './PopupContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction useUtilityClasses(ownerState) {\n  const {\n    open\n  } = ownerState;\n  const slots = {\n    root: ['root', open && 'open']\n  };\n  return composeClasses(slots, useClassNamesOverride(getPopupUtilityClass));\n}\nfunction resolveAnchor(anchor) {\n  return typeof anchor === 'function' ? anchor() : anchor;\n}\n\n/**\n *\n * Demos:\n *\n * - [Popup](https://mui.com/base-ui/react-popup/)\n *\n * API:\n *\n * - [Popup API](https://mui.com/base-ui/react-popup/components-api/#popup)\n */\nconst Popup = /*#__PURE__*/React.forwardRef(function Popup(props, forwardedRef) {\n  var _slots$root;\n  const {\n      anchor: anchorProp,\n      children,\n      container,\n      disablePortal = false,\n      keepMounted = false,\n      middleware,\n      offset: offsetProp = 0,\n      open = false,\n      placement = 'bottom',\n      slotProps = {},\n      slots = {},\n      strategy = 'absolute',\n      withTransition = false\n    } = props,\n    other = _objectWithoutPropertiesLoose(props, _excluded);\n  const {\n    refs,\n    elements,\n    floatingStyles,\n    update,\n    placement: finalPlacement\n  } = useFloating({\n    elements: {\n      reference: resolveAnchor(anchorProp)\n    },\n    open,\n    middleware: middleware != null ? middleware : [offset(offsetProp != null ? offsetProp : 0), flip(), shift()],\n    placement,\n    strategy,\n    whileElementsMounted: !keepMounted ? autoUpdate : undefined\n  });\n  const handleRef = useForkRef(refs.setFloating, forwardedRef);\n  useEnhancedEffect(() => {\n    if (keepMounted && open && elements.reference && elements.floating) {\n      const cleanup = autoUpdate(elements.reference, elements.floating, update);\n      return cleanup;\n    }\n    return undefined;\n  }, [keepMounted, open, elements, update]);\n  const ownerState = _extends({}, props, {\n    disablePortal,\n    keepMounted,\n    offset,\n    open,\n    placement,\n    finalPlacement,\n    strategy,\n    withTransition\n  });\n  const {\n    contextValue,\n    hasExited: hasTransitionExited\n  } = useTransitionTrigger(open);\n  const visibility = keepMounted && hasTransitionExited ? 'hidden' : undefined;\n  const classes = useUtilityClasses(ownerState);\n  const Root = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : 'div';\n  const rootProps = useSlotProps({\n    elementType: Root,\n    externalSlotProps: slotProps.root,\n    externalForwardedProps: other,\n    ownerState,\n    className: classes.root,\n    additionalProps: {\n      ref: handleRef,\n      role: 'tooltip',\n      style: _extends({}, floatingStyles, {\n        visibility\n      })\n    }\n  });\n  const popupContextValue = React.useMemo(() => ({\n    placement: finalPlacement\n  }), [finalPlacement]);\n  const shouldRender = keepMounted || !hasTransitionExited;\n  if (!shouldRender) {\n    return null;\n  }\n  return /*#__PURE__*/_jsx(Portal, {\n    disablePortal: disablePortal,\n    container: container,\n    children: /*#__PURE__*/_jsx(PopupContext.Provider, {\n      value: popupContextValue,\n      children: /*#__PURE__*/_jsx(TransitionContext.Provider, {\n        value: contextValue,\n        children: /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {\n          children: children\n        }))\n      })\n    })\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Popup.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * An HTML element, [virtual element](https://floating-ui.com/docs/virtual-elements),\n   * or a function that returns either.\n   * It's used to set the position of the popup.\n   */\n  anchor: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),\n  /**\n   * @ignore\n   */\n  children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),\n  /**\n   * An HTML element or function that returns one. The container will have the portal children appended to it.\n   * By default, it uses the body of the top-level document object, so it's `document.body` in these cases.\n   */\n  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n  /**\n   * If `true`, the popup will be rendered where it is defined, without the use of portals.\n   * @default false\n   */\n  disablePortal: PropTypes.bool,\n  /**\n   * If `true`, the popup will exist in the DOM even if it's closed.\n   * Its visibility will be controlled by the `visibility` CSS property.\n   *\n   * Otherwise, a closed popup will be removed from the DOM.\n   *\n   * @default false\n   */\n  keepMounted: PropTypes.bool,\n  /**\n   * Collection of Floating UI middleware to use when positioning the popup.\n   * If not provided, the [`offset`](https://floating-ui.com/docs/offset)\n   * and [`flip`](https://floating-ui.com/docs/flip) functions will be used.\n   *\n   * @see https://floating-ui.com/docs/computePosition#middleware\n   */\n  middleware: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.shape({\n    fn: PropTypes.func.isRequired,\n    name: PropTypes.string.isRequired,\n    options: PropTypes.any\n  })])),\n  /**\n   * Distance between a popup and the trigger element.\n   * This prop is ignored when custom `middleware` is provided.\n   *\n   * @default 0\n   * @see https://floating-ui.com/docs/offset\n   */\n  offset: PropTypes.oneOfType([PropTypes.func, PropTypes.number, PropTypes.shape({\n    alignmentAxis: PropTypes.number,\n    crossAxis: PropTypes.number,\n    mainAxis: PropTypes.number\n  })]),\n  /**\n   * If `true`, the popup is visible.\n   *\n   * @default false\n   */\n  open: PropTypes.bool,\n  /**\n   * Determines where to place the popup relative to the trigger element.\n   *\n   * @default 'bottom'\n   * @see https://floating-ui.com/docs/computePosition#placement\n   */\n  placement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n  /**\n   * The props used for each slot inside the Popup.\n   *\n   * @default {}\n   */\n  slotProps: PropTypes.shape({\n    root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n  }),\n  /**\n   * The components used for each slot inside the Popup.\n   * Either a string to use a HTML element or a component.\n   *\n   * @default {}\n   */\n  slots: PropTypes.shape({\n    root: PropTypes.elementType\n  }),\n  /**\n   * The type of CSS position property to use (absolute or fixed).\n   *\n   * @default 'absolute'\n   * @see https://floating-ui.com/docs/computePosition#strategy\n   */\n  strategy: PropTypes.oneOf(['absolute', 'fixed']),\n  /**\n   * If `true`, the popup will not disappear immediately when it needs to be closed\n   * but wait until the exit transition has finished.\n   * In such a case, a function form of `children` must be used and `onExited`\n   * callback function must be called when the transition or animation finish.\n   *\n   * @default false\n   */\n  withTransition: PropTypes.bool\n} : void 0;\nexport { Popup };","import { generateUtilityClass } from '../generateUtilityClass';\nimport { generateUtilityClasses } from '../generateUtilityClasses';\nconst COMPONENT_NAME = 'Select';\nexport function getSelectUtilityClass(slot) {\n  return generateUtilityClass(COMPONENT_NAME, slot);\n}\nexport const selectClasses = generateUtilityClasses(COMPONENT_NAME, ['root', 'button', 'listbox', 'popup', 'active', 'expanded', 'disabled', 'focusVisible']);","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _span;\nconst _excluded = [\"areOptionsEqual\", \"autoComplete\", \"autoFocus\", \"children\", \"defaultValue\", \"defaultListboxOpen\", \"disabled\", \"getSerializedValue\", \"listboxId\", \"listboxOpen\", \"multiple\", \"name\", \"required\", \"onChange\", \"onListboxOpenChange\", \"getOptionAsString\", \"renderValue\", \"placeholder\", \"slotProps\", \"slots\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { useSelect } from '../useSelect';\nimport { useSlotProps } from '../utils';\nimport { Popup } from '../Unstable_Popup/Popup';\nimport { unstable_composeClasses as composeClasses } from '../composeClasses';\nimport { getSelectUtilityClass } from './selectClasses';\nimport { defaultOptionStringifier } from '../useSelect/defaultOptionStringifier';\nimport { useClassNamesOverride } from '../utils/ClassNameConfigurator';\nimport { SelectProvider } from '../useSelect/SelectProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction defaultRenderValue(selectedOptions) {\n  var _selectedOptions$labe;\n  if (Array.isArray(selectedOptions)) {\n    return /*#__PURE__*/_jsx(React.Fragment, {\n      children: selectedOptions.map(o => o.label).join(', ')\n    });\n  }\n  return (_selectedOptions$labe = selectedOptions == null ? void 0 : selectedOptions.label) != null ? _selectedOptions$labe : null;\n}\nfunction useUtilityClasses(ownerState) {\n  const {\n    active,\n    disabled,\n    open,\n    focusVisible\n  } = ownerState;\n  const slots = {\n    root: ['root', disabled && 'disabled', focusVisible && 'focusVisible', active && 'active', open && 'expanded'],\n    listbox: ['listbox', disabled && 'disabled'],\n    popup: ['popup']\n  };\n  return composeClasses(slots, useClassNamesOverride(getSelectUtilityClass));\n}\n\n/**\n * The foundation for building custom-styled select components.\n *\n * Demos:\n *\n * - [Select](https://mui.com/base-ui/react-select/)\n *\n * API:\n *\n * - [Select API](https://mui.com/base-ui/react-select/components-api/#select)\n */\nconst Select = /*#__PURE__*/React.forwardRef(function Select(props, forwardedRef) {\n  var _slots$root, _slots$listbox, _slots$popup, _ref, _renderValue;\n  const {\n      areOptionsEqual,\n      autoComplete,\n      autoFocus,\n      children,\n      defaultValue,\n      defaultListboxOpen = false,\n      disabled: disabledProp,\n      getSerializedValue,\n      listboxId,\n      listboxOpen: listboxOpenProp,\n      multiple = false,\n      name,\n      required = false,\n      onChange,\n      onListboxOpenChange,\n      getOptionAsString = defaultOptionStringifier,\n      renderValue: renderValueProp,\n      placeholder,\n      slotProps = {},\n      slots = {},\n      value: valueProp\n    } = props,\n    other = _objectWithoutPropertiesLoose(props, _excluded);\n  const renderValue = renderValueProp != null ? renderValueProp : defaultRenderValue;\n  const [buttonDefined, setButtonDefined] = React.useState(false);\n  const buttonRef = React.useRef(null);\n  const listboxRef = React.useRef(null);\n  const Button = (_slots$root = slots.root) != null ? _slots$root : 'button';\n  const ListboxRoot = (_slots$listbox = slots.listbox) != null ? _slots$listbox : 'ul';\n  const PopupComponent = (_slots$popup = slots.popup) != null ? _slots$popup : 'div';\n  const handleButtonRefChange = React.useCallback(element => {\n    setButtonDefined(element != null);\n  }, []);\n  const handleButtonRef = useForkRef(forwardedRef, buttonRef, handleButtonRefChange);\n  React.useEffect(() => {\n    if (autoFocus) {\n      buttonRef.current.focus();\n    }\n  }, [autoFocus]);\n  const {\n    buttonActive,\n    buttonFocusVisible,\n    contextValue,\n    disabled,\n    getButtonProps,\n    getListboxProps,\n    getHiddenInputProps,\n    getOptionMetadata,\n    value,\n    open\n  } = useSelect({\n    name,\n    required,\n    getSerializedValue,\n    areOptionsEqual,\n    buttonRef: handleButtonRef,\n    defaultOpen: defaultListboxOpen,\n    defaultValue,\n    disabled: disabledProp,\n    listboxId,\n    multiple,\n    open: listboxOpenProp,\n    onChange,\n    onOpenChange: onListboxOpenChange,\n    getOptionAsString,\n    value: valueProp,\n    componentName: 'Select'\n  });\n  const ownerState = _extends({}, props, {\n    active: buttonActive,\n    defaultListboxOpen,\n    disabled,\n    focusVisible: buttonFocusVisible,\n    open,\n    multiple,\n    renderValue,\n    value\n  });\n  const classes = useUtilityClasses(ownerState);\n  const buttonProps = useSlotProps({\n    elementType: Button,\n    getSlotProps: getButtonProps,\n    externalSlotProps: slotProps.root,\n    externalForwardedProps: other,\n    ownerState,\n    className: classes.root\n  });\n  const listboxProps = useSlotProps({\n    elementType: ListboxRoot,\n    getSlotProps: getListboxProps,\n    externalSlotProps: slotProps.listbox,\n    additionalProps: {\n      ref: listboxRef\n    },\n    ownerState,\n    className: classes.listbox\n  });\n  const popupProps = useSlotProps({\n    elementType: PopupComponent,\n    externalSlotProps: slotProps.popup,\n    additionalProps: {\n      anchor: buttonRef.current,\n      keepMounted: true,\n      open,\n      placement: 'bottom-start',\n      role: undefined\n    },\n    ownerState,\n    className: classes.popup\n  });\n  let selectedOptionsMetadata;\n  if (multiple) {\n    selectedOptionsMetadata = value.map(v => getOptionMetadata(v)).filter(o => o !== undefined);\n  } else {\n    var _getOptionMetadata;\n    selectedOptionsMetadata = (_getOptionMetadata = getOptionMetadata(value)) != null ? _getOptionMetadata : null;\n  }\n  return /*#__PURE__*/_jsxs(React.Fragment, {\n    children: [/*#__PURE__*/_jsx(Button, _extends({}, buttonProps, {\n      children: (_ref = (_renderValue = renderValue(selectedOptionsMetadata)) != null ? _renderValue : placeholder) != null ? _ref : // fall back to a zero-width space to prevent layout shift\n      // from https://github.com/mui/material-ui/pull/24563\n      _span || (_span = /*#__PURE__*/_jsx(\"span\", {\n        className: \"notranslate\",\n        children: \"\\u200B\"\n      }))\n    })), buttonDefined && /*#__PURE__*/_jsx(Popup, _extends({\n      slots: {\n        root: PopupComponent\n      }\n    }, popupProps, {\n      children: /*#__PURE__*/_jsx(ListboxRoot, _extends({}, listboxProps, {\n        children: /*#__PURE__*/_jsx(SelectProvider, {\n          value: contextValue,\n          children: children\n        })\n      }))\n    })), /*#__PURE__*/_jsx(\"input\", _extends({}, getHiddenInputProps(), {\n      autoComplete: autoComplete\n    }))]\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Select.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * A function used to determine if two options' values are equal.\n   * By default, reference equality is used.\n   *\n   * There is a performance impact when using the `areOptionsEqual` prop (proportional to the number of options).\n   * Therefore, it's recommented to use the default reference equality comparison whenever possible.\n   */\n  areOptionsEqual: PropTypes.func,\n  /**\n   * This prop helps users to fill forms faster, especially on mobile devices.\n   * The name can be confusing, as it's more like an autofill.\n   * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n   */\n  autoComplete: PropTypes.string,\n  /**\n   * If `true`, the select element is focused during the first mount\n   * @default false\n   */\n  autoFocus: PropTypes.bool,\n  /**\n   * @ignore\n   */\n  children: PropTypes.node,\n  /**\n   * @ignore\n   */\n  className: PropTypes.string,\n  /**\n   * If `true`, the select will be initially open.\n   * @default false\n   */\n  defaultListboxOpen: PropTypes.bool,\n  /**\n   * The default selected value. Use when the component is not controlled.\n   */\n  defaultValue: PropTypes.any,\n  /**\n   * If `true`, the select is disabled.\n   * @default false\n   */\n  disabled: PropTypes.bool,\n  /**\n   * A function used to convert the option label to a string.\n   * It's useful when labels are elements and need to be converted to plain text\n   * to enable navigation using character keys on a keyboard.\n   *\n   * @default defaultOptionStringifier\n   */\n  getOptionAsString: PropTypes.func,\n  /**\n   * A function to convert the currently selected value to a string.\n   * Used to set a value of a hidden input associated with the select,\n   * so that the selected value can be posted with a form.\n   */\n  getSerializedValue: PropTypes.func,\n  /**\n   * `id` attribute of the listbox element.\n   */\n  listboxId: PropTypes.string,\n  /**\n   * Controls the open state of the select's listbox.\n   * @default undefined\n   */\n  listboxOpen: PropTypes.bool,\n  /**\n   * If `true`, selecting multiple values is allowed.\n   * This affects the type of the `value`, `defaultValue`, and `onChange` props.\n   *\n   * @default false\n   */\n  multiple: PropTypes.bool,\n  /**\n   * Name of the element. For example used by the server to identify the fields in form submits.\n   */\n  name: PropTypes.string,\n  /**\n   * Callback fired when an option is selected.\n   */\n  onChange: PropTypes.func,\n  /**\n   * Callback fired when the component requests to be opened.\n   * Use in controlled mode (see listboxOpen).\n   */\n  onListboxOpenChange: PropTypes.func,\n  /**\n   * Text to show when there is no selected value.\n   */\n  placeholder: PropTypes.node,\n  /**\n   * Function that customizes the rendering of the selected value.\n   */\n  renderValue: PropTypes.func,\n  /**\n   * If `true`, the Select cannot be empty when submitting form.\n   * @default false\n   */\n  required: PropTypes.bool,\n  /**\n   * The props used for each slot inside the Input.\n   * @default {}\n   */\n  slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({\n    listbox: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n    popup: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n    root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n  }),\n  /**\n   * The components used for each slot inside the Select.\n   * Either a string to use a HTML element or a component.\n   * @default {}\n   */\n  slots: PropTypes /* @typescript-to-proptypes-ignore */.shape({\n    listbox: PropTypes.elementType,\n    popup: PropTypes.elementType,\n    root: PropTypes.elementType\n  }),\n  /**\n   * The selected value.\n   * Set to `null` to deselect all options.\n   */\n  value: PropTypes.any\n} : void 0;\nexport { Select };","import {\n  Option as MuiOption,\n  type OptionOwnerState,\n  type OptionOwnProps,\n} from '@mui/base/Option';\nimport {\n  Select as MuiSelect,\n  type SelectOwnerState,\n  type SelectOwnProps,\n} from '@mui/base/Select';\nimport clsx from 'clsx';\nimport { assocPath, identity, pipe } from 'ramda';\nimport React, {\n  forwardRef,\n  useCallback,\n  useEffect,\n  useMemo,\n  useRef,\n} from 'react';\n\nimport type {\n  ComponentProps,\n  SlotComponentPropsWithoutOverride,\n} from '../components.ts';\nimport { useFieldContext } from '../Form/useFieldContext.ts';\nimport { assocDefaultStyle } from '../utils/assign-default-style.ts';\nimport { mergeRootSlotPropsToComponentProps } from '../utils/merge-root-slot-props-to-component-prop.ts';\n\ninterface SlotProps {\n  listbox?: SlotComponentPropsWithoutOverride<\n    'ul',\n    SelectOwnerState<string, false>\n  >;\n  popper?: SlotComponentPropsWithoutOverride<\n    'div',\n    SelectOwnerState<string, false>\n  >;\n  root?: SlotComponentPropsWithoutOverride<\n    'button',\n    SelectOwnerState<string, false>\n  >;\n}\n\nexport type SelectProps = ComponentProps<\n  SlotProps,\n  SelectOwnProps<string, false>\n>;\n\nexport const Select = forwardRef<HTMLInputElement, SelectProps>(function Select(\n  { disableDefaultClasses, name: inputName, slotProps, ...rest },\n  ref,\n) {\n  const containerRef = useRef<HTMLSpanElement>(null);\n  const {\n    formControlContext,\n    id,\n    name: fieldName,\n  } = useFieldContext({\n    // @ts-expect-error TODO: fix this\n    onChange: rest.onChange,\n    value: rest.value,\n  });\n  const name = fieldName || inputName;\n  const slotPropsWithDefaultStyle = useMemo<SlotProps | undefined>(\n    () =>\n      pipe(\n        name\n          ? assocPath(['listbox', 'aria-label'], `${name} options`)\n          : identity,\n      )(\n        disableDefaultClasses\n          ? slotProps\n          : assocDefaultStyle<SlotProps>({\n              slotWithDefaultClasses: {\n                listbox: clsx(\n                  'tw-m-0 tw-mt-1 tw-flex tw-flex-col tw-border-2 tw-border-primary tw-pt-0.5',\n                ),\n                popper: clsx('tw-z-10'),\n                root: (state: SelectOwnerState<string, false>) => {\n                  if (state.open)\n                    return clsx(\n                      \"tw-cursor-default tw-border-0 tw-bg-disabled tw-px-2 tw-py-1 tw-text-disabled after:tw-float-right after:tw-content-['▴']\",\n                    );\n                  return clsx(\n                    \"tw-border tw-border-primary tw-bg-white tw-px-2 tw-py-1 tw-text-primary after:tw-float-right after:tw-content-['▾'] focus:tw-border-primary-user-action focus:tw-outline-primary\",\n                  );\n                },\n              },\n            })(slotProps),\n      ) as SlotProps,\n    [disableDefaultClasses, name, slotProps],\n  );\n  const rootProps = mergeRootSlotPropsToComponentProps()(\n    slotPropsWithDefaultStyle,\n    rest,\n  );\n  const connectMuiSelectToFormContext = useCallback(\n    (_: unknown, value: string | null) => {\n      if (!formControlContext?.onChange) return;\n      formControlContext.onChange({\n        target: { value },\n      } as any);\n    },\n    [formControlContext],\n  );\n\n  useEffect(() => {\n    if (!containerRef.current || !ref) return;\n    const inputElement = containerRef.current.querySelector<HTMLInputElement>(\n      `input[name=\"${name}\"]`,\n    );\n    if (!inputElement) return;\n    if (typeof ref === 'function') ref(inputElement);\n    if (formControlContext?.required)\n      inputElement.setAttribute('required', 'true');\n  }, [name, ref, formControlContext?.required]);\n\n  return (\n    <span\n      data-description={'workaround-to-make-sure-hidden-input-is-selected'}\n      ref={containerRef}\n    >\n      <MuiSelect\n        id={id}\n        name={name}\n        onChange={connectMuiSelectToFormContext}\n        slotProps={slotPropsWithDefaultStyle}\n        value={formControlContext?.value}\n        {...rootProps}\n      />\n    </span>\n  );\n});\ninterface SelectOptionSlotProps {\n  root?: SlotComponentPropsWithoutOverride<'li', OptionOwnerState<string>>;\n}\n\nexport type SelectOptionProps = ComponentProps<\n  SelectOptionSlotProps,\n  OptionOwnProps<string>\n>;\nexport function SelectOption({\n  disableDefaultClasses,\n  slotProps,\n  value,\n  ...rest\n}: SelectOptionProps) {\n  const slotPropsWithDefaultStyle = useMemo<SelectOptionSlotProps | undefined>(\n    () =>\n      disableDefaultClasses\n        ? slotProps\n        : assocDefaultStyle<SelectOptionSlotProps>({\n            slotWithDefaultClasses: {\n              root: (state: OptionOwnerState<string>) => {\n                if (state.disabled)\n                  return clsx(\n                    'tw-cursor-default tw-bg-disabled tw-text-center tw-text-disabled focus-visible:tw-outline-primary',\n                  );\n                if (state.selected)\n                  return clsx(\n                    'tw-cursor-default tw-bg-primary tw-text-center tw-font-bold tw-text-primary focus-visible:tw-outline-primary',\n                  );\n                return clsx(\n                  'tw-cursor-default tw-bg-white tw-px-1 tw-text-center tw-text-primary hover:tw-cursor-pointer hover:tw-bg-primary hover:tw-text-primary focus-visible:tw-outline-primary',\n                );\n              },\n            },\n          })(slotProps),\n    [disableDefaultClasses, slotProps],\n  );\n  const rootProps = mergeRootSlotPropsToComponentProps()(\n    slotPropsWithDefaultStyle,\n    rest,\n  );\n\n  return (\n    <MuiOption\n      {...rootProps}\n      data-value={value}\n      slotProps={slotPropsWithDefaultStyle}\n      value={value}\n    />\n  );\n}\n"],"names":["COMPONENT_NAME","getOptionUtilityClass","slot","generateUtilityClass","generateUtilityClasses","useOption","params","value","label","disabled","optionRefParam","idParam","getListItemProps","highlighted","selected","useListItem","getButtonProps","buttonRefHandler","useButton","id","useId","optionRef","React","selectOption","index","useCompoundItem","handleRef","useForkRef","createHandleKeyDown","otherHandlers","event","_otherHandlers$onKeyD","getOwnHandlers","externalProps","externalEventHandlers","extractEventHandlers","getCombinedRootProps","combineHooksSlotProps","_extends","useOptionContextStabilizer","listContext","ListContext","getItemState","dispatch","focusable","localGetItemState","itemValue","_excluded","useUtilityClasses","ownerState","slots","composeClasses","useClassNamesOverride","InnerOption","props","forwardedRef","_slots$root","_optionRef$current","children","slotProps","other","_objectWithoutPropertiesLoose","Root","combinedRef","computedLabel","getRootProps","classes","rootProps","useSlotProps","_jsx","Option","ref","contextValue","PropTypes","SelectActionTypes","defaultOptionStringifier","option","selectReducer","state","action","open","selectionMode","_state$selectedValues","itemToHighlight","moveHighlight","handleItemSelection","newState","listReducer","ListActionTypes","_state$selectedValues2","_state$selectedValues3","defaultFormValueProvider","selectedOption","o","useSelect","areOptionsEqual","buttonRefProp","defaultOpen","defaultValueProp","listboxIdProp","listboxRefProp","multiple","name","required","onChange","onHighlightChange","onOpenChange","openProp","optionsParam","getOptionAsString","getSerializedValue","valueProp","componentName","buttonRef","handleButtonRef","listboxRef","listboxId","defaultValue","subitems","compoundComponentContextValue","useCompoundParent","options","handleListboxRef","getButtonRootProps","buttonActive","buttonFocusVisible","mergedButtonRef","optionValues","getOptionByValue","valueToGet","similarValue","optionValue","isItemDisabled","valueToCheck","_option$disabled","stringifyOption","controlledState","getItemId","_options$get","handleSelectionChange","newValues","_newValues$","handleHighlightChange","newValue","handleStateChange","field","fieldValue","_buttonRef$current","getItemDomElement","itemId","_subitems$get$ref$cur","_subitems$get","useListParameters","_defaultValue","getListboxRootProps","listContextValue","highlightedOption","selectedOptions","mergedListRootRef","useList","isInitiallyOpen","useEnhancedEffect","_getOptionByValue","listboxClientRect","optionClientRect","getOptionMetadata","createHandleButtonClick","_externalEventHandler","createHandleButtonKeyDown","getButtonOwnRootProps","getSelectTriggerProps","combinedProps","createListboxHandleBlur","_otherHandlers$onBlur","_listboxRef$current","getOwnListboxHandlers","getListboxProps","selectValue","selectedOptionsMetadata","v","_getOptionMetadata","createHandleHiddenInputChange","_externalEventHandler2","visuallyHiddenStyle","SelectProvider","getItemIndex","registerItem","totalSubitemCount","CompoundComponentContext","min","max","round","floor","createCoords","oppositeSideMap","oppositeAlignmentMap","clamp","start","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","getSideList","side","isStart","lr","rl","tb","bt","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","computeCoordsFromPlacement","_ref","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","config","strategy","middleware","platform","validMiddleware","x","y","statefulPlacement","middlewareData","resetCount","i","fn","nextX","nextY","data","reset","detectOverflow","_await$platform$isEle","elements","boundary","rootBoundary","elementContext","altBoundary","paddingObject","element","clippingClientRect","offsetParent","offsetScale","elementClientRect","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","isBasePlacement","fallbackPlacements","placements","overflow","overflows","overflowsData","sides","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","d","a","b","_overflowsData$map$so","acc","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","offset","_middlewareData$offse","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","minSide","maxSide","limitedCoords","getNodeName","node","isNode","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","isOverflowElement","overflowX","overflowY","display","getComputedStyle","isTableElement","isContainingBlock","webkit","isWebKit","css","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","result","getNearestOverflowAncestor","parentNode","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","getCssDimensions","width","height","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentIFrame","iframeScale","iframeRect","left","top","topLayerSelectors","topLayer","isTopLayer","setIsTopLayer","selector","containingBlock","convertOffsetParentRelativeRectToViewportRelativeRect","documentElement","scroll","offsets","isOffsetParentAnElement","offsetRect","getClientRects","getWindowScrollBarX","getDocumentRect","html","body","getViewportRect","visualViewport","visualViewportBased","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingRect","clippingAncestors","firstClippingAncestor","clippingRect","accRect","getDimensions","getRectRelativeToOffsetParent","topLayerX","topLayerY","getTrueOffsetParent","polyfill","getOffsetParent","window","getElementRects","getOffsetParentFn","getDimensionsFn","isRTL","observeMove","onMove","io","timeoutId","root","cleanup","_io","refresh","skip","threshold","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","entries","ratio","autoUpdate","update","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","shift$1","flip$1","mergedOptions","platformWithCache","computePosition$1","useLayoutEffect","useEffect","deepEqual","keys","key","getDPR","roundByDPR","dpr","useLatestRef","useFloating","externalReference","externalFloating","transform","whileElementsMounted","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","setReference","referenceRef","setFloating","floatingRef","floatingEl","dataRef","hasWhileElementsMounted","whileElementsMountedRef","platformRef","fullData","isMountedRef","ReactDOM","refs","floatingStyles","initialStyles","getPopupUtilityClass","TransitionContext","useTransitionTrigger","requestEnter","exitTransitionFinished","setExitTransitionFinished","hasPendingExitTransition","registeredTransitions","hasTransition","setHasTransition","previousRequestEnter","handleExited","registerTransition","hasExited","PopupContext","resolveAnchor","anchor","Popup","anchorProp","container","disablePortal","keepMounted","offsetProp","withTransition","finalPlacement","hasTransitionExited","visibility","popupContextValue","Portal","HTMLElementType","getSelectUtilityClass","_span","defaultRenderValue","_selectedOptions$labe","active","focusVisible","Select","_slots$listbox","_slots$popup","_renderValue","autoComplete","autoFocus","defaultListboxOpen","disabledProp","listboxOpenProp","onListboxOpenChange","renderValueProp","placeholder","renderValue","buttonDefined","setButtonDefined","Button","ListboxRoot","PopupComponent","handleButtonRefChange","getHiddenInputProps","buttonProps","listboxProps","popupProps","_jsxs","forwardRef","disableDefaultClasses","inputName","rest","containerRef","useRef","formControlContext","fieldName","useFieldContext","slotPropsWithDefaultStyle","useMemo","pipe","assocPath","identity","assocDefaultStyle","clsx","mergeRootSlotPropsToComponentProps","connectMuiSelectToFormContext","useCallback","_","inputElement","jsx","MuiSelect","SelectOption","MuiOption"],"mappings":"22CAEMA,GAAiB,SAChB,SAASC,GAAsBC,EAAM,CAC1C,OAAOC,EAAoB,qBAACH,GAAgBE,CAAI,CAClD,CAC6BE,EAAsB,uBAACJ,GAAgB,CAAC,OAAQ,WAAY,WAAY,aAAa,CAAC,ECc5G,SAASK,GAAUC,EAAQ,CAChC,KAAM,CACJ,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAASC,EACT,GAAIC,CACL,EAAGL,EACE,CACJ,aAAcM,EACd,YAAAC,EACA,SAAAC,CACD,EAAGC,cAAY,CACd,KAAMR,CACV,CAAG,EACK,CACJ,aAAcS,EACd,QAASC,CACV,EAAGC,aAAU,CACZ,SAAAT,EACA,sBAAuB,EAC3B,CAAG,EACKU,EAAKC,SAAMT,CAAO,EAClBU,EAAYC,EAAM,OAAO,IAAI,EAC7BC,EAAeD,EAAM,QAAQ,KAAO,CACxC,SAAAb,EACA,MAAAD,EACA,MAAAD,EACA,IAAK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