@iress-oss/ids-components 0.0.1-dev.9 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AutocompleteNoResults-D-7ik_op.js +12 -0
- package/dist/ComboboxHiddenInput-Bo5hqUzo.js +32 -0
- package/dist/FieldAppendToLabel-kSkgzhQp.js +75 -0
- package/dist/InputBase-2wLvSYMJ.js +56 -0
- package/dist/Loading.module-nxv4vxd0.js +13 -0
- package/dist/LoadingSuspense-BDiikfSh.js +5691 -0
- package/dist/LogoFromSrc-RCkIBALM.js +59 -0
- package/dist/MenuItem.module-C1hy3JLs.js +24 -0
- package/dist/Popover.module-BVuEALLH.js +11 -0
- package/dist/SelectControl-ebML3vaP.js +47 -0
- package/dist/SliderTicks-Bvc90tyk.js +78 -0
- package/dist/TabSet.module-DLn6e1BG.js +13 -0
- package/dist/Table.module-CztzYVfs.js +32 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/components/Alert/Alert.js +11 -0
- package/dist/components/Alert/Alert.types.js +9 -0
- package/dist/components/Alert/index.js +6 -0
- package/dist/components/Autocomplete/Autocomplete.js +43 -0
- package/dist/components/Autocomplete/Autocomplete.types.js +1 -0
- package/dist/components/Autocomplete/components/AutocompleteNoResults.js +5 -0
- package/dist/components/Autocomplete/hooks/useAutocompleteFlags.js +16 -0
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +112 -0
- package/dist/components/Autocomplete/index.js +6 -0
- package/dist/components/Badge/Badge.js +49 -0
- package/dist/components/Badge/Badge.types.js +15 -0
- package/dist/components/Badge/index.js +7 -0
- package/dist/components/Button/Button.js +10 -0
- package/dist/components/Button/Button.types.js +20 -0
- package/dist/components/Button/CloseButton/CloseButton.js +7 -0
- package/dist/components/Button/CloseButton/CloseButton.types.js +1 -0
- package/dist/components/Button/index.js +11 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +72 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.js +1 -0
- package/dist/components/ButtonGroup/ButtonGroupProvider.js +34 -0
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +6 -0
- package/dist/components/ButtonGroup/hooks/useIDSButtonGroupItem.js +6 -0
- package/dist/components/ButtonGroup/index.js +6 -0
- package/dist/components/Card/Card.js +50 -0
- package/dist/components/Card/Card.types.js +5 -0
- package/dist/components/Card/components/ButtonCard.js +38 -0
- package/dist/components/Card/components/LinkCard.js +37 -0
- package/dist/components/Card/helpers/composeIDSCard.js +27 -0
- package/dist/components/Card/helpers/composeIDSCardSlots.js +33 -0
- package/dist/components/Card/index.js +15 -0
- package/dist/components/Checkbox/Checkbox.js +15 -0
- package/dist/components/Checkbox/Checkbox.types.js +1 -0
- package/dist/components/Checkbox/helpers/mapCheckboxGroupOptions.js +19 -0
- package/dist/components/Checkbox/index.js +4 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +100 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.types.js +11 -0
- package/dist/components/CheckboxGroup/CheckboxGroupContext.js +5 -0
- package/dist/components/CheckboxGroup/index.js +7 -0
- package/dist/components/CheckboxMark/CheckboxMark.js +40 -0
- package/dist/components/CheckboxMark/CheckboxMark.types.js +16 -0
- package/dist/components/CheckboxMark/index.js +6 -0
- package/dist/components/Col/Col.js +33 -0
- package/dist/components/Col/Col.types.js +66 -0
- package/dist/components/Col/index.js +12 -0
- package/dist/components/Combobox/Combobox.js +46 -0
- package/dist/components/Combobox/Combobox.types.js +1 -0
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.js +44 -0
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.types.js +1 -0
- package/dist/components/Combobox/components/ComboboxHiddenInput.js +8 -0
- package/dist/components/Combobox/components/ComboboxResults.js +39 -0
- package/dist/components/Combobox/components/ComboboxResultsDescriptor.js +38 -0
- package/dist/components/Combobox/hooks/useComboboxFlags.js +15 -0
- package/dist/components/Combobox/hooks/useComboboxInlineCompletion.js +63 -0
- package/dist/components/Combobox/index.js +5 -0
- package/dist/components/Container/Container.js +21 -0
- package/dist/components/Container/Container.types.js +4 -0
- package/dist/components/Container/index.js +6 -0
- package/dist/components/Divider/Divider.js +21 -0
- package/dist/components/Divider/Divider.types.js +4 -0
- package/dist/components/Divider/index.js +6 -0
- package/dist/components/Expander/Expander.js +80 -0
- package/dist/components/Expander/Expander.types.js +6 -0
- package/dist/components/Expander/index.js +7 -0
- package/dist/components/Field/Field.js +71 -0
- package/dist/components/Field/Field.types.js +1 -0
- package/dist/components/Field/FieldGroup/FieldGroup.js +77 -0
- package/dist/components/Field/FieldGroup/FieldGroup.types.js +1 -0
- package/dist/components/Field/components/FieldAppendToLabel.js +41 -0
- package/dist/components/Field/components/FieldLegend.js +6 -0
- package/dist/components/Field/helpers/getUniqueItemsByKey.js +8 -0
- package/dist/components/Field/index.js +6 -0
- package/dist/components/Filter/Filter.js +43 -0
- package/dist/components/Filter/Filter.types.js +1 -0
- package/dist/components/Filter/components/FilterLabel.js +10 -0
- package/dist/components/Filter/components/FilterResetButton.js +37 -0
- package/dist/components/Filter/components/FilterSearch.js +37 -0
- package/dist/components/Filter/hooks/useFilterFlags.js +25 -0
- package/dist/components/Filter/index.js +4 -0
- package/dist/components/Form/Form.js +6 -0
- package/dist/components/Form/Form.types.js +4 -0
- package/dist/components/Form/FormContext.js +7 -0
- package/dist/components/Form/FormField/FormField.js +88 -0
- package/dist/components/Form/FormField/FormField.types.js +4 -0
- package/dist/components/Form/FormField/FormFieldset.js +82 -0
- package/dist/components/Form/FormField/helpers/getErrorTypeMessage.js +19 -0
- package/dist/components/Form/FormField/helpers/transformCustomRulesToValidateRule.js +34 -0
- package/dist/components/Form/HookForm/HookForm.js +12 -0
- package/dist/components/Form/components/FormValidationSummary.js +24 -0
- package/dist/components/Form/hooks/useNoDefaultValueInForms.js +15 -0
- package/dist/components/Form/index.js +13 -0
- package/dist/components/HeadingWithDeprecatedFallback/HeadingWithDeprecatedFallback.js +14 -0
- package/dist/components/Hide/Hide.js +7 -0
- package/dist/components/Hide/Hide.types.js +5 -0
- package/dist/components/Hide/helpers/composeHideClasses.js +38 -0
- package/dist/components/Hide/index.js +7 -0
- package/dist/components/Icon/Icon.js +38 -0
- package/dist/components/Icon/Icon.types.js +31 -0
- package/dist/components/Icon/index.js +15 -0
- package/dist/components/Inline/Inline.js +39 -0
- package/dist/components/Inline/Inline.types.js +4 -0
- package/dist/components/Inline/index.js +6 -0
- package/dist/components/Input/ClearButton/ClearButton.js +20 -0
- package/dist/components/Input/Input.js +14 -0
- package/dist/components/Input/Input.types.js +16 -0
- package/dist/components/Input/InputBase/InputBase.js +9 -0
- package/dist/components/Input/InputBase/InputBase.types.js +1 -0
- package/dist/components/Input/index.js +7 -0
- package/dist/components/InputCurrency/InputCurrency.js +8 -0
- package/dist/components/InputCurrency/InputCurrency.types.js +1 -0
- package/dist/components/InputCurrency/index.js +4 -0
- package/dist/components/Label/Label.js +6 -0
- package/dist/components/Label/Label.types.js +1 -0
- package/dist/components/Label/LabelBase/LabelBase.js +70 -0
- package/dist/components/Label/LabelBase/LabelBase.types.js +1 -0
- package/dist/components/Label/index.js +4 -0
- package/dist/components/Menu/Menu.js +64 -0
- package/dist/components/Menu/Menu.types.js +10 -0
- package/dist/components/Menu/MenuDivider/MenuDivider.js +37 -0
- package/dist/components/Menu/MenuHeading/MenuHeading.js +8 -0
- package/dist/components/Menu/MenuItem/MenuItem.js +11 -0
- package/dist/components/Menu/MenuItem/MenuItem.types.js +6 -0
- package/dist/components/Menu/MenuItem/hooks/useMenuItemAria.js +17 -0
- package/dist/components/Menu/MenuItem/hooks/useMenuItemButtonProps.js +47 -0
- package/dist/components/Menu/MenuItem/hooks/useMenuItemComposite.js +15 -0
- package/dist/components/Menu/MenuItem/hooks/useMenuItemInteractions.js +67 -0
- package/dist/components/Menu/MenuItem/hooks/useMenuItemRole.js +9 -0
- package/dist/components/Menu/MenuProvider.js +67 -0
- package/dist/components/Menu/MenuText/MenuText.js +38 -0
- package/dist/components/Menu/helpers/mapMenuItems.js +47 -0
- package/dist/components/Menu/hooks/useMenu.js +6 -0
- package/dist/components/Menu/hooks/useMenuAria.js +19 -0
- package/dist/components/Menu/hooks/useMenuComposite.js +9 -0
- package/dist/components/Menu/hooks/useMenuRole.js +13 -0
- package/dist/components/Menu/hooks/useMenuStyles.js +26 -0
- package/dist/components/Menu/index.js +29 -0
- package/dist/components/Modal/Modal.js +16 -0
- package/dist/components/Modal/Modal.types.js +4 -0
- package/dist/components/Modal/ModalProvider.js +32 -0
- package/dist/components/Modal/hooks/useIDSProvidedModal.js +13 -0
- package/dist/components/Modal/hooks/useModal.js +20 -0
- package/dist/components/Modal/index.js +11 -0
- package/dist/components/Navbar/Navbar.js +13 -0
- package/dist/components/Navbar/Navbar.types.js +4 -0
- package/dist/components/Navbar/components/HomeLinkContent.js +6 -0
- package/dist/components/Navbar/components/LogoFromSrc.js +6 -0
- package/dist/components/Navbar/components/NavbarLogo.js +8 -0
- package/dist/components/Navbar/index.js +6 -0
- package/dist/components/Panel/Panel.js +36 -0
- package/dist/components/Panel/Panel.types.js +12 -0
- package/dist/components/Panel/index.js +8 -0
- package/dist/components/Placeholder/Placeholder.js +42 -0
- package/dist/components/Placeholder/Placeholder.types.js +1 -0
- package/dist/components/Placeholder/index.js +4 -0
- package/dist/components/Popover/InputPopover/InputPopover.js +87 -0
- package/dist/components/Popover/InputPopover/InputPopover.types.js +1 -0
- package/dist/components/Popover/InputPopover/InputPopoverActivator.js +62 -0
- package/dist/components/Popover/InputPopover/InputPopoverProvider.js +103 -0
- package/dist/components/Popover/Popover.js +97 -0
- package/dist/components/Popover/Popover.types.js +15 -0
- package/dist/components/Popover/PopoverProvider.js +115 -0
- package/dist/components/Popover/components/NestedPopoverActivator.js +9 -0
- package/dist/components/Popover/components/PopoverActivator.js +88 -0
- package/dist/components/Popover/components/PopoverContent.js +59 -0
- package/dist/components/Popover/helpers/composeFloatingProps.js +37 -0
- package/dist/components/Popover/helpers/composePopoverWidth.js +4 -0
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +30 -0
- package/dist/components/Popover/helpers/hasFocus.js +8 -0
- package/dist/components/Popover/helpers/waitUntilTrue.js +12 -0
- package/dist/components/Popover/hooks/usePopover.js +6 -0
- package/dist/components/Popover/hooks/usePopoverActivatorInteractions.js +36 -0
- package/dist/components/Popover/hooks/usePopoverAria.js +18 -0
- package/dist/components/Popover/hooks/usePopoverImperativeHandle.js +25 -0
- package/dist/components/Popover/hooks/usePopoverItem.js +18 -0
- package/dist/components/Popover/hooks/usePopoverNavigation.js +32 -0
- package/dist/components/Popover/hooks/usePopoverState.js +29 -0
- package/dist/components/Popover/index.js +13 -0
- package/dist/components/Progress/Progress.js +52 -0
- package/dist/components/Progress/Progress.types.js +1 -0
- package/dist/components/Progress/index.js +4 -0
- package/dist/components/Radio/Radio.js +11 -0
- package/dist/components/Radio/Radio.types.js +1 -0
- package/dist/components/Radio/helpers/mapRadioGroupOptions.js +19 -0
- package/dist/components/Radio/index.js +4 -0
- package/dist/components/RadioGroup/RadioGroup.js +86 -0
- package/dist/components/RadioGroup/RadioGroup.types.js +12 -0
- package/dist/components/RadioGroup/RadioGroupContext.js +5 -0
- package/dist/components/RadioGroup/index.js +7 -0
- package/dist/components/Readonly/Readonly.js +41 -0
- package/dist/components/Readonly/Readonly.types.js +1 -0
- package/dist/components/Readonly/index.js +4 -0
- package/dist/components/RichSelect/RichSelect.js +40 -0
- package/dist/components/RichSelect/RichSelect.types.js +1 -0
- package/dist/components/RichSelect/SelectBody/SelectBody.js +54 -0
- package/dist/components/RichSelect/SelectBody/SelectBody.types.js +1 -0
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +61 -0
- package/dist/components/RichSelect/SelectCreate/SelectCreate.types.js +1 -0
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +38 -0
- package/dist/components/RichSelect/SelectHeading/SelectHeading.types.js +1 -0
- package/dist/components/RichSelect/SelectLabel/SelectLabel.js +12 -0
- package/dist/components/RichSelect/SelectLabel/SelectLabel.types.js +1 -0
- package/dist/components/RichSelect/SelectMenu/SelectMenu.js +42 -0
- package/dist/components/RichSelect/SelectMenu/SelectMenu.types.js +1 -0
- package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +37 -0
- package/dist/components/RichSelect/SelectSearch/SelectSearch.js +37 -0
- package/dist/components/RichSelect/SelectSearch/SelectSearch.types.js +1 -0
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +8 -0
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.types.js +1 -0
- package/dist/components/RichSelect/SelectTags/SelectTags.js +43 -0
- package/dist/components/RichSelect/SelectTags/SelectTags.types.js +1 -0
- package/dist/components/RichSelect/components/SelectActivator.js +7 -0
- package/dist/components/RichSelect/components/SelectHiddenInput.js +29 -0
- package/dist/components/RichSelect/components/SelectOptions.js +38 -0
- package/dist/components/RichSelect/hooks/useRichSelectState.js +18 -0
- package/dist/components/RichSelect/index.js +16 -0
- package/dist/components/Row/Row.js +39 -0
- package/dist/components/Row/Row.types.js +4 -0
- package/dist/components/Row/index.js +6 -0
- package/dist/components/Select/Select.js +14 -0
- package/dist/components/Select/Select.types.js +1 -0
- package/dist/components/Select/SelectOption/SelectOption.js +9 -0
- package/dist/components/Select/components/SelectControl.js +9 -0
- package/dist/components/Select/components/SelectReadonly.js +38 -0
- package/dist/components/Select/helpers/mapSelectOptions.js +21 -0
- package/dist/components/Select/helpers/nodesToSelectOptions.js +9 -0
- package/dist/components/Select/index.js +9 -0
- package/dist/components/Skeleton/Skeleton.js +44 -0
- package/dist/components/Skeleton/Skeleton.types.js +6 -0
- package/dist/components/Skeleton/index.js +7 -0
- package/dist/components/SkipLink/SkipLink.js +30 -0
- package/dist/components/SkipLink/SkipLink.types.js +1 -0
- package/dist/components/SkipLink/index.js +4 -0
- package/dist/components/Slideout/Slideout.js +16 -0
- package/dist/components/Slideout/Slideout.types.js +14 -0
- package/dist/components/Slideout/SlideoutProvider.js +91 -0
- package/dist/components/Slideout/components/SlideoutInner.js +7 -0
- package/dist/components/Slideout/hooks/useIDSProvidedSlideout.js +13 -0
- package/dist/components/Slideout/hooks/useSlideout.js +20 -0
- package/dist/components/Slideout/index.js +16 -0
- package/dist/components/Slider/Slider.js +12 -0
- package/dist/components/Slider/Slider.types.js +1 -0
- package/dist/components/Slider/components/SliderTicks.js +10 -0
- package/dist/components/Slider/index.js +4 -0
- package/dist/components/Spinner/Spinner.js +6 -0
- package/dist/components/Spinner/Spinner.types.js +1 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Stack/Stack.js +26 -0
- package/dist/components/Stack/Stack.types.js +4 -0
- package/dist/components/Stack/index.js +6 -0
- package/dist/components/TabSet/Tab/Tab.js +88 -0
- package/dist/components/TabSet/Tab/Tab.types.js +1 -0
- package/dist/components/TabSet/TabSet.js +59 -0
- package/dist/components/TabSet/TabSet.types.js +6 -0
- package/dist/components/TabSet/TabSetProvider.js +50 -0
- package/dist/components/TabSet/components/TabSetItem.js +45 -0
- package/dist/components/TabSet/helpers/mapTabs.js +33 -0
- package/dist/components/TabSet/hooks/useTabSetItems.js +6 -0
- package/dist/components/TabSet/index.js +11 -0
- package/dist/components/Table/Table.js +17 -0
- package/dist/components/Table/Table.types.js +23 -0
- package/dist/components/Table/TableBody/TableBody.js +125 -0
- package/dist/components/Table/TableBody/TableBody.types.js +1 -0
- package/dist/components/Table/TableContext.js +11 -0
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.js +17 -0
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.types.js +1 -0
- package/dist/components/Table/TableProvider.js +34 -0
- package/dist/components/Table/components/TableBodyCell.js +31 -0
- package/dist/components/Table/components/TableEmpty.js +12 -0
- package/dist/components/Table/components/TableHeader.js +8 -0
- package/dist/components/Table/components/TableHeaderCell.js +8 -0
- package/dist/components/Table/components/TableRows.js +49 -0
- package/dist/components/Table/components/TableSortButton.js +7 -0
- package/dist/components/Table/helpers/composeIDSTableColumnDefs.js +42 -0
- package/dist/components/Table/helpers/composeIDSTableInitialSorting.js +10 -0
- package/dist/components/Table/helpers/findColumnByKey.js +4 -0
- package/dist/components/Table/helpers/getFormatFromValue.js +11 -0
- package/dist/components/Table/helpers/hasColumns.js +4 -0
- package/dist/components/Table/hooks/useIDSTableColumnSort.js +24 -0
- package/dist/components/Table/hooks/useIDSTableColumnStyles.js +25 -0
- package/dist/components/Table/hooks/useTable.js +6 -0
- package/dist/components/Table/index.js +15 -0
- package/dist/components/Tag/Tag.js +8 -0
- package/dist/components/Tag/Tag.types.js +1 -0
- package/dist/components/Tag/TagInput/TagInput.js +8 -0
- package/dist/components/Tag/TagInput/TagInput.types.js +1 -0
- package/dist/components/Tag/components/TagListInput/TagListInput.js +8 -0
- package/dist/components/Tag/components/TagListInput/TagListInput.types.js +1 -0
- package/dist/components/Tag/index.js +5 -0
- package/dist/components/Text/Text.js +34 -0
- package/dist/components/Text/Text.types.js +19 -0
- package/dist/components/Text/index.js +6 -0
- package/dist/components/Toaster/Toast/Toast.js +13 -0
- package/dist/components/Toaster/Toast/Toast.types.js +10 -0
- package/dist/components/Toaster/Toast/ToastAnimated.js +9 -0
- package/dist/components/Toaster/Toast/ToastIcon.js +6 -0
- package/dist/components/Toaster/Toaster.js +11 -0
- package/dist/components/Toaster/Toaster.types.js +26 -0
- package/dist/components/Toaster/ToasterProvider.js +7 -0
- package/dist/components/Toaster/hooks/useToaster.js +5 -0
- package/dist/components/Toaster/index.js +16 -0
- package/dist/components/Toggle/Toggle.js +101 -0
- package/dist/components/Toggle/Toggle.types.js +11 -0
- package/dist/components/Toggle/index.js +7 -0
- package/dist/components/Tooltip/Tooltip.js +77 -0
- package/dist/components/Tooltip/Tooltip.types.js +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.js +51 -0
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.types.js +1 -0
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.js +21 -0
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.types.js +1 -0
- package/dist/components/ValidationMessage/ValidationMessage.js +8 -0
- package/dist/components/ValidationMessage/ValidationMessage.types.js +1 -0
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +69 -0
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.types.js +1 -0
- package/dist/components/ValidationMessage/index.js +8 -0
- package/dist/constants/index.css +1 -0
- package/dist/constants/index.scss +2 -0
- package/dist/constants.js +193 -0
- package/dist/enums.js +22 -0
- package/dist/floating-ui.react-RKRjRgyj.js +3453 -0
- package/dist/fuzzysort-eoXOpoo6.js +395 -0
- package/dist/helpers/dom/focusableElements.js +10 -0
- package/dist/helpers/dom/getActiveElement.js +9 -0
- package/dist/helpers/dom/hasShadowDom.js +4 -0
- package/dist/helpers/form/getFormControlValueAsString.js +4 -0
- package/dist/helpers/form/getFormControlValueAsStringIfDefined.js +8 -0
- package/dist/helpers/form/getValueAsEvent.js +7 -0
- package/dist/helpers/form/isValidFormInputElement.js +4 -0
- package/dist/helpers/formatting/capitalizeFirstLetter.js +4 -0
- package/dist/helpers/formatting/formatCurrency.js +22 -0
- package/dist/helpers/formatting/formatDate.js +23 -0
- package/dist/helpers/formatting/formatDateTime.js +49 -0
- package/dist/helpers/formatting/formatObjectKey.js +4 -0
- package/dist/helpers/formatting/formatPercentage.js +7 -0
- package/dist/helpers/formatting/stringReplacer.js +9 -0
- package/dist/helpers/formatting/toArray.js +4 -0
- package/dist/helpers/formatting/toCSSLengthValue.js +7 -0
- package/dist/helpers/label-value/composeLabelValueDescriptor.js +13 -0
- package/dist/helpers/label-value/getQueryRangeExclusive.js +14 -0
- package/dist/helpers/label-value/getValueFromLabelValues.js +9 -0
- package/dist/helpers/label-value/highlightQueryInLabel.js +9 -0
- package/dist/helpers/label-value/highlightQueryInLabelValue.js +8 -0
- package/dist/helpers/label-value/searchLabelValues.js +10 -0
- package/dist/helpers/responsive/getResponsiveLayoutModifiers.js +11 -0
- package/dist/helpers/responsive/getResponsivePaddingClasses.js +11 -0
- package/dist/helpers/transition/getTransitionDuration.js +10 -0
- package/dist/helpers/transition/timeStringToNumber.js +4 -0
- package/dist/helpers/utility/generateScopedName.js +9 -0
- package/dist/helpers/utility/idsLogger.js +10 -0
- package/dist/helpers/utility/propagateTestid.js +4 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/useAriaRelationship.js +38 -0
- package/dist/hooks/useBreakpoint.js +20 -0
- package/dist/hooks/useControlledState.js +54 -0
- package/dist/hooks/useIdIfNeeded.js +8 -0
- package/dist/hooks/useResponsiveProps.js +25 -0
- package/dist/index-2QXL0WYc.js +45 -0
- package/dist/index-CmsyHM_3.js +1703 -0
- package/dist/index-CtOScEKX.js +57 -0
- package/dist/index.esm-BnSuefUA.js +196 -0
- package/dist/interfaces.js +1 -0
- package/dist/main.js +332 -0
- package/dist/patterns/Loading/Loading.js +8 -0
- package/dist/patterns/Loading/LoadingSuspense.js +7 -0
- package/dist/patterns/Loading/components/ComponentLoading.js +10 -0
- package/dist/patterns/Loading/components/DefaultLoading.js +9 -0
- package/dist/patterns/Loading/components/LongLoading.js +132 -0
- package/dist/patterns/Loading/components/PageLoading.js +14 -0
- package/dist/patterns/Loading/components/StartUpLoading.js +107 -0
- package/dist/patterns/Loading/components/ValidateLoading.js +9 -0
- package/dist/patterns/Loading/hooks/useEstimatedProgressValue.js +29 -0
- package/dist/patterns/Loading/hooks/useShouldRenderLoading.js +24 -0
- package/dist/patterns/Loading/hooks/useShowIndicator.js +20 -0
- package/dist/patterns/Loading/hooks/useSuspenseResource.js +27 -0
- package/dist/patterns/Loading/index.js +5 -0
- package/dist/setupTests.d.ts +0 -0
- package/dist/src/components/Alert/Alert.d.ts +9 -0
- package/dist/src/components/Alert/Alert.types.d.ts +41 -0
- package/dist/src/components/Alert/index.d.ts +2 -0
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +3 -0
- package/dist/src/components/Autocomplete/Autocomplete.types.d.ts +106 -0
- package/dist/src/components/Autocomplete/components/AutocompleteNoResults.d.ts +2 -0
- package/dist/src/components/Autocomplete/hooks/useAutocompleteFlags.d.ts +5 -0
- package/dist/src/components/Autocomplete/hooks/useAutocompleteSearch.d.ts +2 -0
- package/dist/src/components/Autocomplete/index.d.ts +3 -0
- package/dist/src/components/Badge/Badge.d.ts +2 -0
- package/dist/src/components/Badge/Badge.types.d.ts +37 -0
- package/dist/src/components/Badge/index.d.ts +2 -0
- package/dist/src/components/Button/Button.d.ts +2 -0
- package/dist/src/components/Button/Button.types.d.ts +106 -0
- package/dist/src/components/Button/CloseButton/CloseButton.d.ts +3 -0
- package/dist/src/components/Button/CloseButton/CloseButton.types.d.ts +8 -0
- package/dist/src/components/Button/index.d.ts +4 -0
- package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/src/components/ButtonGroup/ButtonGroup.types.d.ts +63 -0
- package/dist/src/components/ButtonGroup/ButtonGroupProvider.d.ts +3 -0
- package/dist/src/components/ButtonGroup/hooks/useButtonGroup.d.ts +1 -0
- package/dist/src/components/ButtonGroup/hooks/useIDSButtonGroupItem.d.ts +2 -0
- package/dist/src/components/ButtonGroup/index.d.ts +3 -0
- package/dist/src/components/Card/Card.d.ts +2 -0
- package/dist/src/components/Card/Card.types.d.ts +91 -0
- package/dist/src/components/Card/components/ButtonCard.d.ts +2 -0
- package/dist/src/components/Card/components/LinkCard.d.ts +2 -0
- package/dist/src/components/Card/helpers/composeIDSCard.d.ts +3 -0
- package/dist/src/components/Card/helpers/composeIDSCardSlots.d.ts +2 -0
- package/dist/src/components/Card/index.d.ts +6 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/src/components/Checkbox/Checkbox.types.d.ts +65 -0
- package/dist/src/components/Checkbox/helpers/mapCheckboxGroupOptions.d.ts +5 -0
- package/dist/src/components/Checkbox/index.d.ts +2 -0
- package/dist/src/components/CheckboxGroup/CheckboxGroup.d.ts +2 -0
- package/dist/src/components/CheckboxGroup/CheckboxGroup.types.d.ts +70 -0
- package/dist/src/components/CheckboxGroup/CheckboxGroupContext.d.ts +2 -0
- package/dist/src/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/src/components/CheckboxMark/CheckboxMark.d.ts +2 -0
- package/dist/src/components/CheckboxMark/CheckboxMark.types.d.ts +11 -0
- package/dist/src/components/CheckboxMark/index.d.ts +2 -0
- package/dist/src/components/Col/Col.d.ts +2 -0
- package/dist/src/components/Col/Col.types.d.ts +78 -0
- package/dist/src/components/Col/index.d.ts +2 -0
- package/dist/src/components/Combobox/Combobox.d.ts +6 -0
- package/dist/src/components/Combobox/Combobox.types.d.ts +55 -0
- package/dist/src/components/Combobox/MultiCombobox/MultiCombobox.d.ts +6 -0
- package/dist/src/components/Combobox/MultiCombobox/MultiCombobox.types.d.ts +27 -0
- package/dist/src/components/Combobox/components/ComboboxHiddenInput.d.ts +2 -0
- package/dist/src/components/Combobox/components/ComboboxResults.d.ts +2 -0
- package/dist/src/components/Combobox/components/ComboboxResultsDescriptor.d.ts +2 -0
- package/dist/src/components/Combobox/hooks/useComboboxFlags.d.ts +5 -0
- package/dist/src/components/Combobox/hooks/useComboboxInlineCompletion.d.ts +2 -0
- package/dist/src/components/Combobox/index.d.ts +4 -0
- package/dist/src/components/Container/Container.d.ts +2 -0
- package/dist/src/components/Container/Container.types.d.ts +15 -0
- package/dist/src/components/Container/index.d.ts +2 -0
- package/dist/src/components/Divider/Divider.d.ts +2 -0
- package/dist/src/components/Divider/Divider.types.d.ts +17 -0
- package/dist/src/components/Divider/index.d.ts +2 -0
- package/dist/src/components/Expander/Expander.d.ts +2 -0
- package/dist/src/components/Expander/Expander.types.d.ts +39 -0
- package/dist/src/components/Expander/index.d.ts +2 -0
- package/dist/src/components/Field/Field.d.ts +2 -0
- package/dist/src/components/Field/Field.types.d.ts +34 -0
- package/dist/src/components/Field/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/src/components/Field/FieldGroup/FieldGroup.types.d.ts +15 -0
- package/dist/src/components/Field/components/FieldAppendToLabel.d.ts +2 -0
- package/dist/src/components/Field/components/FieldLegend.d.ts +2 -0
- package/dist/src/components/Field/helpers/getUniqueItemsByKey.d.ts +1 -0
- package/dist/src/components/Field/index.d.ts +4 -0
- package/dist/src/components/Filter/Filter.d.ts +2 -0
- package/dist/src/components/Filter/Filter.types.d.ts +71 -0
- package/dist/src/components/Filter/components/FilterLabel.d.ts +2 -0
- package/dist/src/components/Filter/components/FilterResetButton.d.ts +2 -0
- package/dist/src/components/Filter/components/FilterSearch.d.ts +3 -0
- package/dist/src/components/Filter/hooks/useFilterFlags.d.ts +7 -0
- package/dist/src/components/Filter/index.d.ts +2 -0
- package/dist/src/components/Form/Form.d.ts +11 -0
- package/dist/src/components/Form/Form.types.d.ts +179 -0
- package/dist/src/components/Form/FormContext.d.ts +8 -0
- package/dist/src/components/Form/FormField/FormField.d.ts +7 -0
- package/dist/src/components/Form/FormField/FormField.types.d.ts +105 -0
- package/dist/src/components/Form/FormField/FormFieldset.d.ts +7 -0
- package/dist/src/components/Form/FormField/helpers/getErrorTypeMessage.d.ts +2 -0
- package/dist/src/components/Form/FormField/helpers/transformCustomRulesToValidateRule.d.ts +3 -0
- package/dist/src/components/Form/HookForm/HookForm.d.ts +5 -0
- package/dist/src/components/Form/components/FormValidationSummary.d.ts +5 -0
- package/dist/src/components/Form/hooks/useNoDefaultValueInForms.d.ts +8 -0
- package/dist/src/components/Form/index.d.ts +6 -0
- package/dist/src/components/HeadingWithDeprecatedFallback/HeadingWithDeprecatedFallback.d.ts +10 -0
- package/dist/src/components/Hide/Hide.d.ts +2 -0
- package/dist/src/components/Hide/Hide.types.d.ts +24 -0
- package/dist/src/components/Hide/helpers/composeHideClasses.d.ts +4 -0
- package/dist/src/components/Hide/index.d.ts +2 -0
- package/dist/src/components/Icon/Icon.d.ts +2 -0
- package/dist/src/components/Icon/Icon.types.d.ts +99 -0
- package/dist/src/components/Icon/index.d.ts +2 -0
- package/dist/src/components/Inline/Inline.d.ts +2 -0
- package/dist/src/components/Inline/Inline.types.d.ts +41 -0
- package/dist/src/components/Inline/index.d.ts +2 -0
- package/dist/src/components/Input/ClearButton/ClearButton.d.ts +4 -0
- package/dist/src/components/Input/Input.d.ts +14 -0
- package/dist/src/components/Input/Input.types.d.ts +73 -0
- package/dist/src/components/Input/InputBase/InputBase.d.ts +9 -0
- package/dist/src/components/Input/InputBase/InputBase.types.d.ts +15 -0
- package/dist/src/components/Input/index.d.ts +3 -0
- package/dist/src/components/InputCurrency/InputCurrency.d.ts +4 -0
- package/dist/src/components/InputCurrency/InputCurrency.types.d.ts +23 -0
- package/dist/src/components/InputCurrency/index.d.ts +2 -0
- package/dist/src/components/Label/Label.d.ts +2 -0
- package/dist/src/components/Label/Label.types.d.ts +15 -0
- package/dist/src/components/Label/LabelBase/LabelBase.d.ts +2 -0
- package/dist/src/components/Label/LabelBase/LabelBase.types.d.ts +35 -0
- package/dist/src/components/Label/index.d.ts +2 -0
- package/dist/src/components/Menu/Menu.d.ts +2 -0
- package/dist/src/components/Menu/Menu.types.d.ts +130 -0
- package/dist/src/components/Menu/MenuDivider/MenuDivider.d.ts +2 -0
- package/dist/src/components/Menu/MenuHeading/MenuHeading.d.ts +2 -0
- package/dist/src/components/Menu/MenuItem/MenuItem.d.ts +2 -0
- package/dist/src/components/Menu/MenuItem/MenuItem.types.d.ts +122 -0
- package/dist/src/components/Menu/MenuItem/hooks/useMenuItemAria.d.ts +11 -0
- package/dist/src/components/Menu/MenuItem/hooks/useMenuItemButtonProps.d.ts +14 -0
- package/dist/src/components/Menu/MenuItem/hooks/useMenuItemComposite.d.ts +20 -0
- package/dist/src/components/Menu/MenuItem/hooks/useMenuItemInteractions.d.ts +11 -0
- package/dist/src/components/Menu/MenuItem/hooks/useMenuItemRole.d.ts +9 -0
- package/dist/src/components/Menu/MenuProvider.d.ts +3 -0
- package/dist/src/components/Menu/MenuText/MenuText.d.ts +2 -0
- package/dist/src/components/Menu/helpers/mapMenuItems.d.ts +6 -0
- package/dist/src/components/Menu/hooks/useMenu.d.ts +1 -0
- package/dist/src/components/Menu/hooks/useMenuAria.d.ts +11 -0
- package/dist/src/components/Menu/hooks/useMenuComposite.d.ts +18 -0
- package/dist/src/components/Menu/hooks/useMenuRole.d.ts +12 -0
- package/dist/src/components/Menu/hooks/useMenuStyles.d.ts +11 -0
- package/dist/src/components/Menu/index.d.ts +13 -0
- package/dist/src/components/Modal/Modal.d.ts +2 -0
- package/dist/src/components/Modal/Modal.types.d.ts +101 -0
- package/dist/src/components/Modal/ModalProvider.d.ts +3 -0
- package/dist/src/components/Modal/hooks/useIDSProvidedModal.d.ts +5 -0
- package/dist/src/components/Modal/hooks/useModal.d.ts +3 -0
- package/dist/src/components/Modal/index.d.ts +4 -0
- package/dist/src/components/Navbar/Navbar.d.ts +2 -0
- package/dist/src/components/Navbar/Navbar.types.d.ts +65 -0
- package/dist/src/components/Navbar/components/HomeLinkContent.d.ts +7 -0
- package/dist/src/components/Navbar/components/LogoFromSrc.d.ts +6 -0
- package/dist/src/components/Navbar/components/NavbarLogo.d.ts +8 -0
- package/dist/src/components/Navbar/index.d.ts +2 -0
- package/dist/src/components/Panel/Panel.d.ts +2 -0
- package/dist/src/components/Panel/Panel.types.d.ts +59 -0
- package/dist/src/components/Panel/index.d.ts +2 -0
- package/dist/src/components/Placeholder/Placeholder.d.ts +2 -0
- package/dist/src/components/Placeholder/Placeholder.types.d.ts +24 -0
- package/dist/src/components/Placeholder/index.d.ts +2 -0
- package/dist/src/components/Popover/InputPopover/InputPopover.d.ts +3 -0
- package/dist/src/components/Popover/InputPopover/InputPopover.types.d.ts +26 -0
- package/dist/src/components/Popover/InputPopover/InputPopoverActivator.d.ts +2 -0
- package/dist/src/components/Popover/InputPopover/InputPopoverProvider.d.ts +2 -0
- package/dist/src/components/Popover/Popover.d.ts +2 -0
- package/dist/src/components/Popover/Popover.types.d.ts +177 -0
- package/dist/src/components/Popover/PopoverProvider.d.ts +3 -0
- package/dist/src/components/Popover/components/NestedPopoverActivator.d.ts +5 -0
- package/dist/src/components/Popover/components/PopoverActivator.d.ts +2 -0
- package/dist/src/components/Popover/components/PopoverContent.d.ts +2 -0
- package/dist/src/components/Popover/helpers/composeFloatingProps.d.ts +15 -0
- package/dist/src/components/Popover/helpers/composePopoverWidth.d.ts +2 -0
- package/dist/src/components/Popover/helpers/handlePopoverTabKey.d.ts +8 -0
- package/dist/src/components/Popover/helpers/hasFocus.d.ts +1 -0
- package/dist/src/components/Popover/helpers/waitUntilTrue.d.ts +1 -0
- package/dist/src/components/Popover/hooks/usePopover.d.ts +1 -0
- package/dist/src/components/Popover/hooks/usePopoverActivatorInteractions.d.ts +15 -0
- package/dist/src/components/Popover/hooks/usePopoverAria.d.ts +6 -0
- package/dist/src/components/Popover/hooks/usePopoverImperativeHandle.d.ts +4 -0
- package/dist/src/components/Popover/hooks/usePopoverItem.d.ts +12 -0
- package/dist/src/components/Popover/hooks/usePopoverNavigation.d.ts +16 -0
- package/dist/src/components/Popover/hooks/usePopoverState.d.ts +10 -0
- package/dist/src/components/Popover/index.d.ts +5 -0
- package/dist/src/components/Progress/Progress.d.ts +2 -0
- package/dist/src/components/Progress/Progress.types.d.ts +23 -0
- package/dist/src/components/Progress/index.d.ts +1 -0
- package/dist/src/components/Radio/Radio.d.ts +2 -0
- package/dist/src/components/Radio/Radio.types.d.ts +45 -0
- package/dist/src/components/Radio/helpers/mapRadioGroupOptions.d.ts +5 -0
- package/dist/src/components/Radio/index.d.ts +2 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +2 -0
- package/dist/src/components/RadioGroup/RadioGroup.types.d.ts +70 -0
- package/dist/src/components/RadioGroup/RadioGroupContext.d.ts +2 -0
- package/dist/src/components/RadioGroup/index.d.ts +2 -0
- package/dist/src/components/Readonly/Readonly.d.ts +3 -0
- package/dist/src/components/Readonly/Readonly.types.d.ts +10 -0
- package/dist/src/components/Readonly/index.d.ts +2 -0
- package/dist/src/components/RichSelect/RichSelect.d.ts +2 -0
- package/dist/src/components/RichSelect/RichSelect.types.d.ts +181 -0
- package/dist/src/components/RichSelect/SelectBody/SelectBody.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectBody/SelectBody.types.d.ts +12 -0
- package/dist/src/components/RichSelect/SelectCreate/SelectCreate.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectCreate/SelectCreate.types.d.ts +29 -0
- package/dist/src/components/RichSelect/SelectHeading/SelectHeading.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectHeading/SelectHeading.types.d.ts +17 -0
- package/dist/src/components/RichSelect/SelectLabel/SelectLabel.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectLabel/SelectLabel.types.d.ts +3 -0
- package/dist/src/components/RichSelect/SelectMenu/SelectMenu.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectMenu/SelectMenu.types.d.ts +49 -0
- package/dist/src/components/RichSelect/SelectMenu/SelectMenuItem.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectSearch/SelectSearch.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectSearch/SelectSearch.types.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectSearchInput/SelectSearchInput.d.ts +3 -0
- package/dist/src/components/RichSelect/SelectSearchInput/SelectSearchInput.types.d.ts +18 -0
- package/dist/src/components/RichSelect/SelectTags/SelectTags.d.ts +2 -0
- package/dist/src/components/RichSelect/SelectTags/SelectTags.types.d.ts +27 -0
- package/dist/src/components/RichSelect/components/SelectActivator.d.ts +7 -0
- package/dist/src/components/RichSelect/components/SelectHiddenInput.d.ts +4 -0
- package/dist/src/components/RichSelect/components/SelectOptions.d.ts +6 -0
- package/dist/src/components/RichSelect/hooks/useRichSelectState.d.ts +17 -0
- package/dist/src/components/RichSelect/index.d.ts +19 -0
- package/dist/src/components/Row/Row.d.ts +2 -0
- package/dist/src/components/Row/Row.types.d.ts +42 -0
- package/dist/src/components/Row/index.d.ts +2 -0
- package/dist/src/components/Select/Select.d.ts +2 -0
- package/dist/src/components/Select/Select.types.d.ts +89 -0
- package/dist/src/components/Select/SelectOption/SelectOption.d.ts +2 -0
- package/dist/src/components/Select/components/SelectControl.d.ts +2 -0
- package/dist/src/components/Select/components/SelectReadonly.d.ts +2 -0
- package/dist/src/components/Select/helpers/mapSelectOptions.d.ts +3 -0
- package/dist/src/components/Select/helpers/nodesToSelectOptions.d.ts +11 -0
- package/dist/src/components/Select/index.d.ts +4 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/src/components/Skeleton/Skeleton.types.d.ts +36 -0
- package/dist/src/components/Skeleton/index.d.ts +2 -0
- package/dist/src/components/SkipLink/SkipLink.d.ts +2 -0
- package/dist/src/components/SkipLink/SkipLink.types.d.ts +22 -0
- package/dist/src/components/SkipLink/index.d.ts +2 -0
- package/dist/src/components/Slideout/Slideout.d.ts +2 -0
- package/dist/src/components/Slideout/Slideout.types.d.ts +146 -0
- package/dist/src/components/Slideout/SlideoutProvider.d.ts +3 -0
- package/dist/src/components/Slideout/components/SlideoutInner.d.ts +2 -0
- package/dist/src/components/Slideout/hooks/useIDSProvidedSlideout.d.ts +5 -0
- package/dist/src/components/Slideout/hooks/useSlideout.d.ts +3 -0
- package/dist/src/components/Slideout/index.d.ts +4 -0
- package/dist/src/components/Slider/Slider.d.ts +2 -0
- package/dist/src/components/Slider/Slider.types.d.ts +94 -0
- package/dist/src/components/Slider/components/SliderTicks.d.ts +2 -0
- package/dist/src/components/Slider/index.d.ts +2 -0
- package/dist/src/components/Spinner/Spinner.d.ts +2 -0
- package/dist/src/components/Spinner/Spinner.types.d.ts +13 -0
- package/dist/src/components/Spinner/index.d.ts +2 -0
- package/dist/src/components/Stack/Stack.d.ts +2 -0
- package/dist/src/components/Stack/Stack.types.d.ts +22 -0
- package/dist/src/components/Stack/index.d.ts +2 -0
- package/dist/src/components/TabSet/Tab/Tab.d.ts +2 -0
- package/dist/src/components/TabSet/Tab/Tab.types.d.ts +21 -0
- package/dist/src/components/TabSet/TabSet.d.ts +2 -0
- package/dist/src/components/TabSet/TabSet.types.d.ts +84 -0
- package/dist/src/components/TabSet/TabSetProvider.d.ts +3 -0
- package/dist/src/components/TabSet/components/TabSetItem.d.ts +2 -0
- package/dist/src/components/TabSet/helpers/mapTabs.d.ts +3 -0
- package/dist/src/components/TabSet/hooks/useTabSetItems.d.ts +1 -0
- package/dist/src/components/TabSet/index.d.ts +5 -0
- package/dist/src/components/Table/Table.d.ts +6 -0
- package/dist/src/components/Table/Table.types.d.ts +199 -0
- package/dist/src/components/Table/TableBody/TableBody.d.ts +2 -0
- package/dist/src/components/Table/TableBody/TableBody.types.d.ts +29 -0
- package/dist/src/components/Table/TableContext.d.ts +2 -0
- package/dist/src/components/Table/TableFormattedValue/TableFormattedValue.d.ts +2 -0
- package/dist/src/components/Table/TableFormattedValue/TableFormattedValue.types.d.ts +30 -0
- package/dist/src/components/Table/TableProvider.d.ts +2 -0
- package/dist/src/components/Table/components/TableBodyCell.d.ts +2 -0
- package/dist/src/components/Table/components/TableEmpty.d.ts +2 -0
- package/dist/src/components/Table/components/TableHeader.d.ts +2 -0
- package/dist/src/components/Table/components/TableHeaderCell.d.ts +2 -0
- package/dist/src/components/Table/components/TableRows.d.ts +2 -0
- package/dist/src/components/Table/components/TableSortButton.d.ts +2 -0
- package/dist/src/components/Table/helpers/composeIDSTableColumnDefs.d.ts +2 -0
- package/dist/src/components/Table/helpers/composeIDSTableInitialSorting.d.ts +3 -0
- package/dist/src/components/Table/helpers/findColumnByKey.d.ts +2 -0
- package/dist/src/components/Table/helpers/getFormatFromValue.d.ts +2 -0
- package/dist/src/components/Table/helpers/hasColumns.d.ts +2 -0
- package/dist/src/components/Table/hooks/useIDSTableColumnSort.d.ts +2 -0
- package/dist/src/components/Table/hooks/useIDSTableColumnStyles.d.ts +2 -0
- package/dist/src/components/Table/hooks/useTable.d.ts +1 -0
- package/dist/src/components/Table/index.d.ts +6 -0
- package/dist/src/components/Tag/Tag.d.ts +2 -0
- package/dist/src/components/Tag/Tag.types.d.ts +25 -0
- package/dist/src/components/Tag/TagInput/TagInput.d.ts +3 -0
- package/dist/src/components/Tag/TagInput/TagInput.types.d.ts +21 -0
- package/dist/src/components/Tag/components/TagListInput/TagListInput.d.ts +3 -0
- package/dist/src/components/Tag/components/TagListInput/TagListInput.types.d.ts +45 -0
- package/dist/src/components/Tag/index.d.ts +4 -0
- package/dist/src/components/Text/Text.d.ts +2 -0
- package/dist/src/components/Text/Text.types.d.ts +45 -0
- package/dist/src/components/Text/index.d.ts +2 -0
- package/dist/src/components/Toaster/Toast/Toast.d.ts +3 -0
- package/dist/src/components/Toaster/Toast/Toast.types.d.ts +94 -0
- package/dist/src/components/Toaster/Toast/ToastAnimated.d.ts +2 -0
- package/dist/src/components/Toaster/Toast/ToastIcon.d.ts +6 -0
- package/dist/src/components/Toaster/Toaster.d.ts +2 -0
- package/dist/src/components/Toaster/Toaster.types.d.ts +37 -0
- package/dist/src/components/Toaster/ToasterProvider.d.ts +11 -0
- package/dist/src/components/Toaster/hooks/useToaster.d.ts +9 -0
- package/dist/src/components/Toaster/index.d.ts +5 -0
- package/dist/src/components/Toggle/Toggle.d.ts +2 -0
- package/dist/src/components/Toggle/Toggle.types.d.ts +45 -0
- package/dist/src/components/Toggle/index.d.ts +2 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/src/components/Tooltip/Tooltip.types.d.ts +33 -0
- package/dist/src/components/Tooltip/index.d.ts +2 -0
- package/dist/src/components/ValidationMessage/ValidationBase/ValidationBase.d.ts +2 -0
- package/dist/src/components/ValidationMessage/ValidationBase/ValidationBase.types.d.ts +27 -0
- package/dist/src/components/ValidationMessage/ValidationLink/ValidationLink.d.ts +2 -0
- package/dist/src/components/ValidationMessage/ValidationLink/ValidationLink.types.d.ts +12 -0
- package/dist/src/components/ValidationMessage/ValidationMessage.d.ts +2 -0
- package/dist/src/components/ValidationMessage/ValidationMessage.types.d.ts +13 -0
- package/dist/src/components/ValidationMessage/ValidationSummary/ValidationSummary.d.ts +2 -0
- package/dist/src/components/ValidationMessage/ValidationSummary/ValidationSummary.types.d.ts +27 -0
- package/dist/src/components/ValidationMessage/index.d.ts +6 -0
- package/dist/src/constants.d.ts +123 -0
- package/dist/src/enums.d.ts +215 -0
- package/dist/src/helpers/dom/focusableElements.d.ts +1 -0
- package/dist/src/helpers/dom/getActiveElement.d.ts +1 -0
- package/dist/src/helpers/dom/hasShadowDom.d.ts +1 -0
- package/dist/src/helpers/form/getFormControlValueAsString.d.ts +2 -0
- package/dist/src/helpers/form/getFormControlValueAsStringIfDefined.d.ts +2 -0
- package/dist/src/helpers/form/getValueAsEvent.d.ts +15 -0
- package/dist/src/helpers/form/isValidFormInputElement.d.ts +1 -0
- package/dist/src/helpers/formatting/capitalizeFirstLetter.d.ts +1 -0
- package/dist/src/helpers/formatting/formatCurrency.d.ts +25 -0
- package/dist/src/helpers/formatting/formatDate.d.ts +5 -0
- package/dist/src/helpers/formatting/formatDateTime.d.ts +3 -0
- package/dist/src/helpers/formatting/formatObjectKey.d.ts +1 -0
- package/dist/src/helpers/formatting/formatPercentage.d.ts +1 -0
- package/dist/src/helpers/formatting/stringReplacer.d.ts +2 -0
- package/dist/src/helpers/formatting/toArray.d.ts +1 -0
- package/dist/src/helpers/formatting/toCSSLengthValue.d.ts +1 -0
- package/dist/src/helpers/label-value/composeLabelValueDescriptor.d.ts +9 -0
- package/dist/src/helpers/label-value/getQueryRangeExclusive.d.ts +8 -0
- package/dist/src/helpers/label-value/getValueFromLabelValues.d.ts +2 -0
- package/dist/src/helpers/label-value/highlightQueryInLabel.d.ts +2 -0
- package/dist/src/helpers/label-value/highlightQueryInLabelValue.d.ts +3 -0
- package/dist/src/helpers/label-value/searchLabelValues.d.ts +2 -0
- package/dist/src/helpers/responsive/getResponsiveLayoutModifiers.d.ts +2 -0
- package/dist/src/helpers/responsive/getResponsivePaddingClasses.d.ts +2 -0
- package/dist/src/helpers/transition/getTransitionDuration.d.ts +1 -0
- package/dist/src/helpers/transition/timeStringToNumber.d.ts +1 -0
- package/dist/src/helpers/utility/generateScopedName.d.ts +8 -0
- package/dist/src/helpers/utility/idsLogger.d.ts +3 -0
- package/dist/src/helpers/utility/propagateTestid.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/useAriaRelationship.d.ts +11 -0
- package/dist/src/hooks/useBreakpoint.d.ts +11 -0
- package/dist/src/hooks/useControlledState.d.ts +22 -0
- package/dist/src/hooks/useIdIfNeeded.d.ts +2 -0
- package/dist/src/hooks/useResponsiveProps.d.ts +19 -0
- package/dist/src/interfaces.d.ts +67 -0
- package/dist/src/main.d.ts +57 -0
- package/dist/src/patterns/Loading/Loading.d.ts +47 -0
- package/dist/src/patterns/Loading/LoadingSuspense.d.ts +73 -0
- package/dist/src/patterns/Loading/components/ComponentLoading.d.ts +53 -0
- package/dist/src/patterns/Loading/components/DefaultLoading.d.ts +27 -0
- package/dist/src/patterns/Loading/components/LongLoading.d.ts +60 -0
- package/dist/src/patterns/Loading/components/PageLoading.d.ts +41 -0
- package/dist/src/patterns/Loading/components/StartUpLoading.d.ts +67 -0
- package/dist/src/patterns/Loading/components/ValidateLoading.d.ts +38 -0
- package/dist/src/patterns/Loading/hooks/useEstimatedProgressValue.d.ts +11 -0
- package/dist/src/patterns/Loading/hooks/useShouldRenderLoading.d.ts +10 -0
- package/dist/src/patterns/Loading/hooks/useShowIndicator.d.ts +9 -0
- package/dist/src/patterns/Loading/hooks/useSuspenseResource.d.ts +17 -0
- package/dist/src/patterns/Loading/index.d.ts +2 -0
- package/dist/src/types.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types.js +1 -0
- package/dist/useIDSButtonGroupItem-D278MaLC.js +30 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +27 -5
|
@@ -0,0 +1,3453 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { useLayoutEffect as Wn, useEffect as $n } from "react";
|
|
3
|
+
import { t as At, i as Bn, f as Or } from "./index.esm-BnSuefUA.js";
|
|
4
|
+
import { jsx as ge, jsxs as Hn, Fragment as Ar } from "react/jsx-runtime";
|
|
5
|
+
import * as tn from "react-dom";
|
|
6
|
+
function Mt() {
|
|
7
|
+
return typeof window < "u";
|
|
8
|
+
}
|
|
9
|
+
function _e(e) {
|
|
10
|
+
return zn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
11
|
+
}
|
|
12
|
+
function he(e) {
|
|
13
|
+
var t;
|
|
14
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
15
|
+
}
|
|
16
|
+
function Te(e) {
|
|
17
|
+
var t;
|
|
18
|
+
return (t = (zn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
19
|
+
}
|
|
20
|
+
function zn(e) {
|
|
21
|
+
return Mt() ? e instanceof Node || e instanceof he(e).Node : !1;
|
|
22
|
+
}
|
|
23
|
+
function Y(e) {
|
|
24
|
+
return Mt() ? e instanceof Element || e instanceof he(e).Element : !1;
|
|
25
|
+
}
|
|
26
|
+
function oe(e) {
|
|
27
|
+
return Mt() ? e instanceof HTMLElement || e instanceof he(e).HTMLElement : !1;
|
|
28
|
+
}
|
|
29
|
+
function Xt(e) {
|
|
30
|
+
return !Mt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof he(e).ShadowRoot;
|
|
31
|
+
}
|
|
32
|
+
function ut(e) {
|
|
33
|
+
const {
|
|
34
|
+
overflow: t,
|
|
35
|
+
overflowX: n,
|
|
36
|
+
overflowY: r,
|
|
37
|
+
display: o
|
|
38
|
+
} = we(e);
|
|
39
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
|
|
40
|
+
}
|
|
41
|
+
function Mr(e) {
|
|
42
|
+
return ["table", "td", "th"].includes(_e(e));
|
|
43
|
+
}
|
|
44
|
+
function Pt(e) {
|
|
45
|
+
return [":popover-open", ":modal"].some((t) => {
|
|
46
|
+
try {
|
|
47
|
+
return e.matches(t);
|
|
48
|
+
} catch {
|
|
49
|
+
return !1;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function nn(e) {
|
|
54
|
+
const t = St(), n = Y(e) ? we(e) : e;
|
|
55
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
|
|
56
|
+
}
|
|
57
|
+
function Pr(e) {
|
|
58
|
+
let t = Pe(e);
|
|
59
|
+
for (; oe(t) && !Me(t); ) {
|
|
60
|
+
if (nn(t))
|
|
61
|
+
return t;
|
|
62
|
+
if (Pt(t))
|
|
63
|
+
return null;
|
|
64
|
+
t = Pe(t);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
function St() {
|
|
69
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
70
|
+
}
|
|
71
|
+
function Me(e) {
|
|
72
|
+
return ["html", "body", "#document"].includes(_e(e));
|
|
73
|
+
}
|
|
74
|
+
function we(e) {
|
|
75
|
+
return he(e).getComputedStyle(e);
|
|
76
|
+
}
|
|
77
|
+
function Dt(e) {
|
|
78
|
+
return Y(e) ? {
|
|
79
|
+
scrollLeft: e.scrollLeft,
|
|
80
|
+
scrollTop: e.scrollTop
|
|
81
|
+
} : {
|
|
82
|
+
scrollLeft: e.scrollX,
|
|
83
|
+
scrollTop: e.scrollY
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function Pe(e) {
|
|
87
|
+
if (_e(e) === "html")
|
|
88
|
+
return e;
|
|
89
|
+
const t = (
|
|
90
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
91
|
+
e.assignedSlot || // DOM Element detected.
|
|
92
|
+
e.parentNode || // ShadowRoot detected.
|
|
93
|
+
Xt(e) && e.host || // Fallback.
|
|
94
|
+
Te(e)
|
|
95
|
+
);
|
|
96
|
+
return Xt(t) ? t.host : t;
|
|
97
|
+
}
|
|
98
|
+
function Un(e) {
|
|
99
|
+
const t = Pe(e);
|
|
100
|
+
return Me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : oe(t) && ut(t) ? t : Un(t);
|
|
101
|
+
}
|
|
102
|
+
function ke(e, t, n) {
|
|
103
|
+
var r;
|
|
104
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
105
|
+
const o = Un(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = he(o);
|
|
106
|
+
if (s) {
|
|
107
|
+
const c = Jt(i);
|
|
108
|
+
return t.concat(i, i.visualViewport || [], ut(o) ? o : [], c && n ? ke(c) : []);
|
|
109
|
+
}
|
|
110
|
+
return t.concat(o, ke(o, [], n));
|
|
111
|
+
}
|
|
112
|
+
function Jt(e) {
|
|
113
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
114
|
+
}
|
|
115
|
+
const Sr = ["top", "right", "bottom", "left"], dn = ["start", "end"], mn = /* @__PURE__ */ Sr.reduce((e, t) => e.concat(t, t + "-" + dn[0], t + "-" + dn[1]), []), Je = Math.min, be = Math.max, wt = Math.round, je = Math.floor, Ee = (e) => ({
|
|
116
|
+
x: e,
|
|
117
|
+
y: e
|
|
118
|
+
}), Dr = {
|
|
119
|
+
left: "right",
|
|
120
|
+
right: "left",
|
|
121
|
+
bottom: "top",
|
|
122
|
+
top: "bottom"
|
|
123
|
+
}, kr = {
|
|
124
|
+
start: "end",
|
|
125
|
+
end: "start"
|
|
126
|
+
};
|
|
127
|
+
function pn(e, t, n) {
|
|
128
|
+
return be(e, Je(t, n));
|
|
129
|
+
}
|
|
130
|
+
function Qe(e, t) {
|
|
131
|
+
return typeof e == "function" ? e(t) : e;
|
|
132
|
+
}
|
|
133
|
+
function Ce(e) {
|
|
134
|
+
return e.split("-")[0];
|
|
135
|
+
}
|
|
136
|
+
function Ie(e) {
|
|
137
|
+
return e.split("-")[1];
|
|
138
|
+
}
|
|
139
|
+
function Gn(e) {
|
|
140
|
+
return e === "x" ? "y" : "x";
|
|
141
|
+
}
|
|
142
|
+
function jn(e) {
|
|
143
|
+
return e === "y" ? "height" : "width";
|
|
144
|
+
}
|
|
145
|
+
function He(e) {
|
|
146
|
+
return ["top", "bottom"].includes(Ce(e)) ? "y" : "x";
|
|
147
|
+
}
|
|
148
|
+
function qn(e) {
|
|
149
|
+
return Gn(He(e));
|
|
150
|
+
}
|
|
151
|
+
function Yn(e, t, n) {
|
|
152
|
+
n === void 0 && (n = !1);
|
|
153
|
+
const r = Ie(e), o = qn(e), s = jn(o);
|
|
154
|
+
let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
155
|
+
return t.reference[s] > t.floating[s] && (i = Et(i)), [i, Et(i)];
|
|
156
|
+
}
|
|
157
|
+
function Lr(e) {
|
|
158
|
+
const t = Et(e);
|
|
159
|
+
return [Rt(e), t, Rt(t)];
|
|
160
|
+
}
|
|
161
|
+
function Rt(e) {
|
|
162
|
+
return e.replace(/start|end/g, (t) => kr[t]);
|
|
163
|
+
}
|
|
164
|
+
function Fr(e, t, n) {
|
|
165
|
+
const r = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
|
|
166
|
+
switch (e) {
|
|
167
|
+
case "top":
|
|
168
|
+
case "bottom":
|
|
169
|
+
return n ? t ? o : r : t ? r : o;
|
|
170
|
+
case "left":
|
|
171
|
+
case "right":
|
|
172
|
+
return t ? s : i;
|
|
173
|
+
default:
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function Nr(e, t, n, r) {
|
|
178
|
+
const o = Ie(e);
|
|
179
|
+
let s = Fr(Ce(e), n === "start", r);
|
|
180
|
+
return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Rt)))), s;
|
|
181
|
+
}
|
|
182
|
+
function Et(e) {
|
|
183
|
+
return e.replace(/left|right|bottom|top/g, (t) => Dr[t]);
|
|
184
|
+
}
|
|
185
|
+
function _r(e) {
|
|
186
|
+
return {
|
|
187
|
+
top: 0,
|
|
188
|
+
right: 0,
|
|
189
|
+
bottom: 0,
|
|
190
|
+
left: 0,
|
|
191
|
+
...e
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function Kr(e) {
|
|
195
|
+
return typeof e != "number" ? _r(e) : {
|
|
196
|
+
top: e,
|
|
197
|
+
right: e,
|
|
198
|
+
bottom: e,
|
|
199
|
+
left: e
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function It(e) {
|
|
203
|
+
const {
|
|
204
|
+
x: t,
|
|
205
|
+
y: n,
|
|
206
|
+
width: r,
|
|
207
|
+
height: o
|
|
208
|
+
} = e;
|
|
209
|
+
return {
|
|
210
|
+
width: r,
|
|
211
|
+
height: o,
|
|
212
|
+
top: n,
|
|
213
|
+
left: t,
|
|
214
|
+
right: t + r,
|
|
215
|
+
bottom: n + o,
|
|
216
|
+
x: t,
|
|
217
|
+
y: n
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function rn() {
|
|
221
|
+
const e = navigator.userAgentData;
|
|
222
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
223
|
+
}
|
|
224
|
+
function Xn() {
|
|
225
|
+
const e = navigator.userAgentData;
|
|
226
|
+
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
227
|
+
let {
|
|
228
|
+
brand: n,
|
|
229
|
+
version: r
|
|
230
|
+
} = t;
|
|
231
|
+
return n + "/" + r;
|
|
232
|
+
}).join(" ") : navigator.userAgent;
|
|
233
|
+
}
|
|
234
|
+
function Jn() {
|
|
235
|
+
return /apple/i.test(navigator.vendor);
|
|
236
|
+
}
|
|
237
|
+
function Qt() {
|
|
238
|
+
const e = /android/i;
|
|
239
|
+
return e.test(rn()) || e.test(Xn());
|
|
240
|
+
}
|
|
241
|
+
function Vr() {
|
|
242
|
+
return rn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
243
|
+
}
|
|
244
|
+
function Qn() {
|
|
245
|
+
return Xn().includes("jsdom/");
|
|
246
|
+
}
|
|
247
|
+
const gn = "data-floating-ui-focusable", Wr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", _t = "ArrowLeft", Kt = "ArrowRight", $r = "ArrowUp", Br = "ArrowDown";
|
|
248
|
+
function Re(e) {
|
|
249
|
+
let t = e.activeElement;
|
|
250
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
251
|
+
var n;
|
|
252
|
+
t = t.shadowRoot.activeElement;
|
|
253
|
+
}
|
|
254
|
+
return t;
|
|
255
|
+
}
|
|
256
|
+
function ue(e, t) {
|
|
257
|
+
if (!e || !t)
|
|
258
|
+
return !1;
|
|
259
|
+
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
260
|
+
if (e.contains(t))
|
|
261
|
+
return !0;
|
|
262
|
+
if (n && Xt(n)) {
|
|
263
|
+
let r = t;
|
|
264
|
+
for (; r; ) {
|
|
265
|
+
if (e === r)
|
|
266
|
+
return !0;
|
|
267
|
+
r = r.parentNode || r.host;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return !1;
|
|
271
|
+
}
|
|
272
|
+
function De(e) {
|
|
273
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
274
|
+
}
|
|
275
|
+
function Vt(e, t) {
|
|
276
|
+
if (t == null)
|
|
277
|
+
return !1;
|
|
278
|
+
if ("composedPath" in e)
|
|
279
|
+
return e.composedPath().includes(t);
|
|
280
|
+
const n = e;
|
|
281
|
+
return n.target != null && t.contains(n.target);
|
|
282
|
+
}
|
|
283
|
+
function Hr(e) {
|
|
284
|
+
return e.matches("html,body");
|
|
285
|
+
}
|
|
286
|
+
function ae(e) {
|
|
287
|
+
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
288
|
+
}
|
|
289
|
+
function on(e) {
|
|
290
|
+
return oe(e) && e.matches(Wr);
|
|
291
|
+
}
|
|
292
|
+
function Zt(e) {
|
|
293
|
+
return e ? e.getAttribute("role") === "combobox" && on(e) : !1;
|
|
294
|
+
}
|
|
295
|
+
function zr(e) {
|
|
296
|
+
if (!e || Qn()) return !0;
|
|
297
|
+
try {
|
|
298
|
+
return e.matches(":focus-visible");
|
|
299
|
+
} catch {
|
|
300
|
+
return !0;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function Ct(e) {
|
|
304
|
+
return e ? e.hasAttribute(gn) ? e : e.querySelector("[" + gn + "]") || e : null;
|
|
305
|
+
}
|
|
306
|
+
function qe(e, t) {
|
|
307
|
+
let n = e.filter((o) => {
|
|
308
|
+
var s;
|
|
309
|
+
return o.parentId === t && ((s = o.context) == null ? void 0 : s.open);
|
|
310
|
+
}), r = n;
|
|
311
|
+
for (; r.length; )
|
|
312
|
+
r = e.filter((o) => {
|
|
313
|
+
var s;
|
|
314
|
+
return (s = r) == null ? void 0 : s.some((i) => {
|
|
315
|
+
var c;
|
|
316
|
+
return o.parentId === i.id && ((c = o.context) == null ? void 0 : c.open);
|
|
317
|
+
});
|
|
318
|
+
}), n = n.concat(r);
|
|
319
|
+
return n;
|
|
320
|
+
}
|
|
321
|
+
function Ur(e, t) {
|
|
322
|
+
let n, r = -1;
|
|
323
|
+
function o(s, i) {
|
|
324
|
+
i > r && (n = s, r = i), qe(e, s).forEach((a) => {
|
|
325
|
+
o(a.id, i + 1);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
return o(t, 0), e.find((s) => s.id === n);
|
|
329
|
+
}
|
|
330
|
+
function hn(e, t) {
|
|
331
|
+
var n;
|
|
332
|
+
let r = [], o = (n = e.find((s) => s.id === t)) == null ? void 0 : n.parentId;
|
|
333
|
+
for (; o; ) {
|
|
334
|
+
const s = e.find((i) => i.id === o);
|
|
335
|
+
o = s == null ? void 0 : s.parentId, s && (r = r.concat(s));
|
|
336
|
+
}
|
|
337
|
+
return r;
|
|
338
|
+
}
|
|
339
|
+
function pe(e) {
|
|
340
|
+
e.preventDefault(), e.stopPropagation();
|
|
341
|
+
}
|
|
342
|
+
function Gr(e) {
|
|
343
|
+
return "nativeEvent" in e;
|
|
344
|
+
}
|
|
345
|
+
function Zn(e) {
|
|
346
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Qt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
347
|
+
}
|
|
348
|
+
function er(e) {
|
|
349
|
+
return Qn() ? !1 : !Qt() && e.width === 0 && e.height === 0 || Qt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
350
|
+
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
351
|
+
}
|
|
352
|
+
function it(e, t) {
|
|
353
|
+
const n = ["mouse", "pen"];
|
|
354
|
+
return t || n.push("", void 0), n.includes(e);
|
|
355
|
+
}
|
|
356
|
+
var X = typeof document < "u" ? Wn : $n;
|
|
357
|
+
const jr = {
|
|
358
|
+
...f
|
|
359
|
+
};
|
|
360
|
+
function xe(e) {
|
|
361
|
+
const t = f.useRef(e);
|
|
362
|
+
return X(() => {
|
|
363
|
+
t.current = e;
|
|
364
|
+
}), t;
|
|
365
|
+
}
|
|
366
|
+
const qr = jr.useInsertionEffect, Yr = qr || ((e) => e());
|
|
367
|
+
function ce(e) {
|
|
368
|
+
const t = f.useRef(() => {
|
|
369
|
+
if (process.env.NODE_ENV !== "production")
|
|
370
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
371
|
+
});
|
|
372
|
+
return Yr(() => {
|
|
373
|
+
t.current = e;
|
|
374
|
+
}), f.useCallback(function() {
|
|
375
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
376
|
+
r[o] = arguments[o];
|
|
377
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
378
|
+
}, []);
|
|
379
|
+
}
|
|
380
|
+
function pt(e, t, n) {
|
|
381
|
+
return Math.floor(e / t) !== n;
|
|
382
|
+
}
|
|
383
|
+
function Ye(e, t) {
|
|
384
|
+
return t < 0 || t >= e.current.length;
|
|
385
|
+
}
|
|
386
|
+
function yt(e, t) {
|
|
387
|
+
return le(e, {
|
|
388
|
+
disabledIndices: t
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
function en(e, t) {
|
|
392
|
+
return le(e, {
|
|
393
|
+
decrement: !0,
|
|
394
|
+
startingIndex: e.current.length,
|
|
395
|
+
disabledIndices: t
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function le(e, t) {
|
|
399
|
+
let {
|
|
400
|
+
startingIndex: n = -1,
|
|
401
|
+
decrement: r = !1,
|
|
402
|
+
disabledIndices: o,
|
|
403
|
+
amount: s = 1
|
|
404
|
+
} = t === void 0 ? {} : t, i = n;
|
|
405
|
+
do
|
|
406
|
+
i += r ? -s : s;
|
|
407
|
+
while (i >= 0 && i <= e.current.length - 1 && Be(e, i, o));
|
|
408
|
+
return i;
|
|
409
|
+
}
|
|
410
|
+
function tr(e, t) {
|
|
411
|
+
let {
|
|
412
|
+
event: n,
|
|
413
|
+
orientation: r,
|
|
414
|
+
loop: o,
|
|
415
|
+
rtl: s,
|
|
416
|
+
cols: i,
|
|
417
|
+
disabledIndices: c,
|
|
418
|
+
minIndex: a,
|
|
419
|
+
maxIndex: u,
|
|
420
|
+
prevIndex: l,
|
|
421
|
+
stopEvent: p = !1
|
|
422
|
+
} = t, g = l;
|
|
423
|
+
if (n.key === $r) {
|
|
424
|
+
if (p && pe(n), l === -1)
|
|
425
|
+
g = u;
|
|
426
|
+
else if (g = le(e, {
|
|
427
|
+
startingIndex: g,
|
|
428
|
+
amount: i,
|
|
429
|
+
decrement: !0,
|
|
430
|
+
disabledIndices: c
|
|
431
|
+
}), o && (l - i < a || g < 0)) {
|
|
432
|
+
const d = l % i, h = u % i, m = u - (h - d);
|
|
433
|
+
h === d ? g = u : g = h > d ? m : m - i;
|
|
434
|
+
}
|
|
435
|
+
Ye(e, g) && (g = l);
|
|
436
|
+
}
|
|
437
|
+
if (n.key === Br && (p && pe(n), l === -1 ? g = a : (g = le(e, {
|
|
438
|
+
startingIndex: l,
|
|
439
|
+
amount: i,
|
|
440
|
+
disabledIndices: c
|
|
441
|
+
}), o && l + i > u && (g = le(e, {
|
|
442
|
+
startingIndex: l % i - i,
|
|
443
|
+
amount: i,
|
|
444
|
+
disabledIndices: c
|
|
445
|
+
}))), Ye(e, g) && (g = l)), r === "both") {
|
|
446
|
+
const d = je(l / i);
|
|
447
|
+
n.key === (s ? _t : Kt) && (p && pe(n), l % i !== i - 1 ? (g = le(e, {
|
|
448
|
+
startingIndex: l,
|
|
449
|
+
disabledIndices: c
|
|
450
|
+
}), o && pt(g, i, d) && (g = le(e, {
|
|
451
|
+
startingIndex: l - l % i - 1,
|
|
452
|
+
disabledIndices: c
|
|
453
|
+
}))) : o && (g = le(e, {
|
|
454
|
+
startingIndex: l - l % i - 1,
|
|
455
|
+
disabledIndices: c
|
|
456
|
+
})), pt(g, i, d) && (g = l)), n.key === (s ? Kt : _t) && (p && pe(n), l % i !== 0 ? (g = le(e, {
|
|
457
|
+
startingIndex: l,
|
|
458
|
+
decrement: !0,
|
|
459
|
+
disabledIndices: c
|
|
460
|
+
}), o && pt(g, i, d) && (g = le(e, {
|
|
461
|
+
startingIndex: l + (i - l % i),
|
|
462
|
+
decrement: !0,
|
|
463
|
+
disabledIndices: c
|
|
464
|
+
}))) : o && (g = le(e, {
|
|
465
|
+
startingIndex: l + (i - l % i),
|
|
466
|
+
decrement: !0,
|
|
467
|
+
disabledIndices: c
|
|
468
|
+
})), pt(g, i, d) && (g = l));
|
|
469
|
+
const h = je(u / i) === d;
|
|
470
|
+
Ye(e, g) && (o && h ? g = n.key === (s ? Kt : _t) ? u : le(e, {
|
|
471
|
+
startingIndex: l - l % i - 1,
|
|
472
|
+
disabledIndices: c
|
|
473
|
+
}) : g = l);
|
|
474
|
+
}
|
|
475
|
+
return g;
|
|
476
|
+
}
|
|
477
|
+
function nr(e, t, n) {
|
|
478
|
+
const r = [];
|
|
479
|
+
let o = 0;
|
|
480
|
+
return e.forEach((s, i) => {
|
|
481
|
+
let {
|
|
482
|
+
width: c,
|
|
483
|
+
height: a
|
|
484
|
+
} = s;
|
|
485
|
+
if (c > t && process.env.NODE_ENV !== "production")
|
|
486
|
+
throw new Error("[Floating UI]: Invalid grid - item width at index " + i + " is greater than grid columns");
|
|
487
|
+
let u = !1;
|
|
488
|
+
for (n && (o = 0); !u; ) {
|
|
489
|
+
const l = [];
|
|
490
|
+
for (let p = 0; p < c; p++)
|
|
491
|
+
for (let g = 0; g < a; g++)
|
|
492
|
+
l.push(o + p + g * t);
|
|
493
|
+
o % t + c <= t && l.every((p) => r[p] == null) ? (l.forEach((p) => {
|
|
494
|
+
r[p] = i;
|
|
495
|
+
}), u = !0) : o++;
|
|
496
|
+
}
|
|
497
|
+
}), [...r];
|
|
498
|
+
}
|
|
499
|
+
function rr(e, t, n, r, o) {
|
|
500
|
+
if (e === -1) return -1;
|
|
501
|
+
const s = n.indexOf(e), i = t[e];
|
|
502
|
+
switch (o) {
|
|
503
|
+
case "tl":
|
|
504
|
+
return s;
|
|
505
|
+
case "tr":
|
|
506
|
+
return i ? s + i.width - 1 : s;
|
|
507
|
+
case "bl":
|
|
508
|
+
return i ? s + (i.height - 1) * r : s;
|
|
509
|
+
case "br":
|
|
510
|
+
return n.lastIndexOf(e);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function or(e, t) {
|
|
514
|
+
return t.flatMap((n, r) => e.includes(n) ? [r] : []);
|
|
515
|
+
}
|
|
516
|
+
function Be(e, t, n) {
|
|
517
|
+
if (typeof n == "function")
|
|
518
|
+
return n(t);
|
|
519
|
+
if (n)
|
|
520
|
+
return n.includes(t);
|
|
521
|
+
const r = e.current[t];
|
|
522
|
+
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
523
|
+
}
|
|
524
|
+
const lt = () => ({
|
|
525
|
+
getShadowRoot: !0,
|
|
526
|
+
displayCheck: (
|
|
527
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
528
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
529
|
+
// determines if the current environment is JSDOM-like.
|
|
530
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
531
|
+
)
|
|
532
|
+
});
|
|
533
|
+
function ir(e, t) {
|
|
534
|
+
const n = At(e, lt()), r = n.length;
|
|
535
|
+
if (r === 0) return;
|
|
536
|
+
const o = Re(ae(e)), s = n.indexOf(o), i = s === -1 ? t === 1 ? 0 : r - 1 : s + t;
|
|
537
|
+
return n[i];
|
|
538
|
+
}
|
|
539
|
+
function sr(e) {
|
|
540
|
+
return ir(ae(e).body, 1) || e;
|
|
541
|
+
}
|
|
542
|
+
function cr(e) {
|
|
543
|
+
return ir(ae(e).body, -1) || e;
|
|
544
|
+
}
|
|
545
|
+
function ot(e, t) {
|
|
546
|
+
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
547
|
+
return !r || !ue(n, r);
|
|
548
|
+
}
|
|
549
|
+
function Xr(e) {
|
|
550
|
+
At(e, lt()).forEach((n) => {
|
|
551
|
+
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function vn(e) {
|
|
555
|
+
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
556
|
+
const r = n.dataset.tabindex;
|
|
557
|
+
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
function bn(e, t, n) {
|
|
561
|
+
let {
|
|
562
|
+
reference: r,
|
|
563
|
+
floating: o
|
|
564
|
+
} = e;
|
|
565
|
+
const s = He(t), i = qn(t), c = jn(i), a = Ce(t), u = s === "y", l = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, g = r[c] / 2 - o[c] / 2;
|
|
566
|
+
let d;
|
|
567
|
+
switch (a) {
|
|
568
|
+
case "top":
|
|
569
|
+
d = {
|
|
570
|
+
x: l,
|
|
571
|
+
y: r.y - o.height
|
|
572
|
+
};
|
|
573
|
+
break;
|
|
574
|
+
case "bottom":
|
|
575
|
+
d = {
|
|
576
|
+
x: l,
|
|
577
|
+
y: r.y + r.height
|
|
578
|
+
};
|
|
579
|
+
break;
|
|
580
|
+
case "right":
|
|
581
|
+
d = {
|
|
582
|
+
x: r.x + r.width,
|
|
583
|
+
y: p
|
|
584
|
+
};
|
|
585
|
+
break;
|
|
586
|
+
case "left":
|
|
587
|
+
d = {
|
|
588
|
+
x: r.x - o.width,
|
|
589
|
+
y: p
|
|
590
|
+
};
|
|
591
|
+
break;
|
|
592
|
+
default:
|
|
593
|
+
d = {
|
|
594
|
+
x: r.x,
|
|
595
|
+
y: r.y
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
switch (Ie(t)) {
|
|
599
|
+
case "start":
|
|
600
|
+
d[i] -= g * (n && u ? -1 : 1);
|
|
601
|
+
break;
|
|
602
|
+
case "end":
|
|
603
|
+
d[i] += g * (n && u ? -1 : 1);
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
return d;
|
|
607
|
+
}
|
|
608
|
+
const Jr = async (e, t, n) => {
|
|
609
|
+
const {
|
|
610
|
+
placement: r = "bottom",
|
|
611
|
+
strategy: o = "absolute",
|
|
612
|
+
middleware: s = [],
|
|
613
|
+
platform: i
|
|
614
|
+
} = n, c = s.filter(Boolean), a = await (i.isRTL == null ? void 0 : i.isRTL(t));
|
|
615
|
+
let u = await i.getElementRects({
|
|
616
|
+
reference: e,
|
|
617
|
+
floating: t,
|
|
618
|
+
strategy: o
|
|
619
|
+
}), {
|
|
620
|
+
x: l,
|
|
621
|
+
y: p
|
|
622
|
+
} = bn(u, r, a), g = r, d = {}, h = 0;
|
|
623
|
+
for (let m = 0; m < c.length; m++) {
|
|
624
|
+
const {
|
|
625
|
+
name: y,
|
|
626
|
+
fn: R
|
|
627
|
+
} = c[m], {
|
|
628
|
+
x: v,
|
|
629
|
+
y: x,
|
|
630
|
+
data: I,
|
|
631
|
+
reset: A
|
|
632
|
+
} = await R({
|
|
633
|
+
x: l,
|
|
634
|
+
y: p,
|
|
635
|
+
initialPlacement: r,
|
|
636
|
+
placement: g,
|
|
637
|
+
strategy: o,
|
|
638
|
+
middlewareData: d,
|
|
639
|
+
rects: u,
|
|
640
|
+
platform: i,
|
|
641
|
+
elements: {
|
|
642
|
+
reference: e,
|
|
643
|
+
floating: t
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
l = v ?? l, p = x ?? p, d = {
|
|
647
|
+
...d,
|
|
648
|
+
[y]: {
|
|
649
|
+
...d[y],
|
|
650
|
+
...I
|
|
651
|
+
}
|
|
652
|
+
}, A && h <= 50 && (h++, typeof A == "object" && (A.placement && (g = A.placement), A.rects && (u = A.rects === !0 ? await i.getElementRects({
|
|
653
|
+
reference: e,
|
|
654
|
+
floating: t,
|
|
655
|
+
strategy: o
|
|
656
|
+
}) : A.rects), {
|
|
657
|
+
x: l,
|
|
658
|
+
y: p
|
|
659
|
+
} = bn(u, g, a)), m = -1);
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
x: l,
|
|
663
|
+
y: p,
|
|
664
|
+
placement: g,
|
|
665
|
+
strategy: o,
|
|
666
|
+
middlewareData: d
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
async function kt(e, t) {
|
|
670
|
+
var n;
|
|
671
|
+
t === void 0 && (t = {});
|
|
672
|
+
const {
|
|
673
|
+
x: r,
|
|
674
|
+
y: o,
|
|
675
|
+
platform: s,
|
|
676
|
+
rects: i,
|
|
677
|
+
elements: c,
|
|
678
|
+
strategy: a
|
|
679
|
+
} = e, {
|
|
680
|
+
boundary: u = "clippingAncestors",
|
|
681
|
+
rootBoundary: l = "viewport",
|
|
682
|
+
elementContext: p = "floating",
|
|
683
|
+
altBoundary: g = !1,
|
|
684
|
+
padding: d = 0
|
|
685
|
+
} = Qe(t, e), h = Kr(d), y = c[g ? p === "floating" ? "reference" : "floating" : p], R = It(await s.getClippingRect({
|
|
686
|
+
element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
687
|
+
boundary: u,
|
|
688
|
+
rootBoundary: l,
|
|
689
|
+
strategy: a
|
|
690
|
+
})), v = p === "floating" ? {
|
|
691
|
+
x: r,
|
|
692
|
+
y: o,
|
|
693
|
+
width: i.floating.width,
|
|
694
|
+
height: i.floating.height
|
|
695
|
+
} : i.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), I = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
|
|
696
|
+
x: 1,
|
|
697
|
+
y: 1
|
|
698
|
+
} : {
|
|
699
|
+
x: 1,
|
|
700
|
+
y: 1
|
|
701
|
+
}, A = It(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
702
|
+
elements: c,
|
|
703
|
+
rect: v,
|
|
704
|
+
offsetParent: x,
|
|
705
|
+
strategy: a
|
|
706
|
+
}) : v);
|
|
707
|
+
return {
|
|
708
|
+
top: (R.top - A.top + h.top) / I.y,
|
|
709
|
+
bottom: (A.bottom - R.bottom + h.bottom) / I.y,
|
|
710
|
+
left: (R.left - A.left + h.left) / I.x,
|
|
711
|
+
right: (A.right - R.right + h.right) / I.x
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
function Qr(e, t, n) {
|
|
715
|
+
return (e ? [...n.filter((o) => Ie(o) === e), ...n.filter((o) => Ie(o) !== e)] : n.filter((o) => Ce(o) === o)).filter((o) => e ? Ie(o) === e || (t ? Rt(o) !== o : !1) : !0);
|
|
716
|
+
}
|
|
717
|
+
const Zr = function(e) {
|
|
718
|
+
return e === void 0 && (e = {}), {
|
|
719
|
+
name: "autoPlacement",
|
|
720
|
+
options: e,
|
|
721
|
+
async fn(t) {
|
|
722
|
+
var n, r, o;
|
|
723
|
+
const {
|
|
724
|
+
rects: s,
|
|
725
|
+
middlewareData: i,
|
|
726
|
+
placement: c,
|
|
727
|
+
platform: a,
|
|
728
|
+
elements: u
|
|
729
|
+
} = t, {
|
|
730
|
+
crossAxis: l = !1,
|
|
731
|
+
alignment: p,
|
|
732
|
+
allowedPlacements: g = mn,
|
|
733
|
+
autoAlignment: d = !0,
|
|
734
|
+
...h
|
|
735
|
+
} = Qe(e, t), m = p !== void 0 || g === mn ? Qr(p || null, d, g) : g, y = await kt(t, h), R = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, v = m[R];
|
|
736
|
+
if (v == null)
|
|
737
|
+
return {};
|
|
738
|
+
const x = Yn(v, s, await (a.isRTL == null ? void 0 : a.isRTL(u.floating)));
|
|
739
|
+
if (c !== v)
|
|
740
|
+
return {
|
|
741
|
+
reset: {
|
|
742
|
+
placement: m[0]
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
const I = [y[Ce(v)], y[x[0]], y[x[1]]], A = [...((r = i.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
746
|
+
placement: v,
|
|
747
|
+
overflows: I
|
|
748
|
+
}], k = m[R + 1];
|
|
749
|
+
if (k)
|
|
750
|
+
return {
|
|
751
|
+
data: {
|
|
752
|
+
index: R + 1,
|
|
753
|
+
overflows: A
|
|
754
|
+
},
|
|
755
|
+
reset: {
|
|
756
|
+
placement: k
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
const N = A.map((F) => {
|
|
760
|
+
const _ = Ie(F.placement);
|
|
761
|
+
return [F.placement, _ && l ? (
|
|
762
|
+
// Check along the mainAxis and main crossAxis side.
|
|
763
|
+
F.overflows.slice(0, 2).reduce((U, V) => U + V, 0)
|
|
764
|
+
) : (
|
|
765
|
+
// Check only the mainAxis.
|
|
766
|
+
F.overflows[0]
|
|
767
|
+
), F.overflows];
|
|
768
|
+
}).sort((F, _) => F[1] - _[1]), L = ((o = N.filter((F) => F[2].slice(
|
|
769
|
+
0,
|
|
770
|
+
// Aligned placements should not check their opposite crossAxis
|
|
771
|
+
// side.
|
|
772
|
+
Ie(F[0]) ? 2 : 3
|
|
773
|
+
).every((_) => _ <= 0))[0]) == null ? void 0 : o[0]) || N[0][0];
|
|
774
|
+
return L !== c ? {
|
|
775
|
+
data: {
|
|
776
|
+
index: R + 1,
|
|
777
|
+
overflows: A
|
|
778
|
+
},
|
|
779
|
+
reset: {
|
|
780
|
+
placement: L
|
|
781
|
+
}
|
|
782
|
+
} : {};
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
}, eo = function(e) {
|
|
786
|
+
return e === void 0 && (e = {}), {
|
|
787
|
+
name: "flip",
|
|
788
|
+
options: e,
|
|
789
|
+
async fn(t) {
|
|
790
|
+
var n, r;
|
|
791
|
+
const {
|
|
792
|
+
placement: o,
|
|
793
|
+
middlewareData: s,
|
|
794
|
+
rects: i,
|
|
795
|
+
initialPlacement: c,
|
|
796
|
+
platform: a,
|
|
797
|
+
elements: u
|
|
798
|
+
} = t, {
|
|
799
|
+
mainAxis: l = !0,
|
|
800
|
+
crossAxis: p = !0,
|
|
801
|
+
fallbackPlacements: g,
|
|
802
|
+
fallbackStrategy: d = "bestFit",
|
|
803
|
+
fallbackAxisSideDirection: h = "none",
|
|
804
|
+
flipAlignment: m = !0,
|
|
805
|
+
...y
|
|
806
|
+
} = Qe(e, t);
|
|
807
|
+
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
808
|
+
return {};
|
|
809
|
+
const R = Ce(o), v = He(c), x = Ce(c) === c, I = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), A = g || (x || !m ? [Et(c)] : Lr(c)), k = h !== "none";
|
|
810
|
+
!g && k && A.push(...Nr(c, m, h, I));
|
|
811
|
+
const N = [c, ...A], S = await kt(t, y), L = [];
|
|
812
|
+
let F = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
813
|
+
if (l && L.push(S[R]), p) {
|
|
814
|
+
const O = Yn(o, i, I);
|
|
815
|
+
L.push(S[O[0]], S[O[1]]);
|
|
816
|
+
}
|
|
817
|
+
if (F = [...F, {
|
|
818
|
+
placement: o,
|
|
819
|
+
overflows: L
|
|
820
|
+
}], !L.every((O) => O <= 0)) {
|
|
821
|
+
var _, U;
|
|
822
|
+
const O = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, w = N[O];
|
|
823
|
+
if (w)
|
|
824
|
+
return {
|
|
825
|
+
data: {
|
|
826
|
+
index: O,
|
|
827
|
+
overflows: F
|
|
828
|
+
},
|
|
829
|
+
reset: {
|
|
830
|
+
placement: w
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
let K = (U = F.filter((T) => T.overflows[0] <= 0).sort((T, b) => T.overflows[1] - b.overflows[1])[0]) == null ? void 0 : U.placement;
|
|
834
|
+
if (!K)
|
|
835
|
+
switch (d) {
|
|
836
|
+
case "bestFit": {
|
|
837
|
+
var V;
|
|
838
|
+
const T = (V = F.filter((b) => {
|
|
839
|
+
if (k) {
|
|
840
|
+
const E = He(b.placement);
|
|
841
|
+
return E === v || // Create a bias to the `y` side axis due to horizontal
|
|
842
|
+
// reading directions favoring greater width.
|
|
843
|
+
E === "y";
|
|
844
|
+
}
|
|
845
|
+
return !0;
|
|
846
|
+
}).map((b) => [b.placement, b.overflows.filter((E) => E > 0).reduce((E, M) => E + M, 0)]).sort((b, E) => b[1] - E[1])[0]) == null ? void 0 : V[0];
|
|
847
|
+
T && (K = T);
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
case "initialPlacement":
|
|
851
|
+
K = c;
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
if (o !== K)
|
|
855
|
+
return {
|
|
856
|
+
reset: {
|
|
857
|
+
placement: K
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
return {};
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
async function to(e, t) {
|
|
866
|
+
const {
|
|
867
|
+
placement: n,
|
|
868
|
+
platform: r,
|
|
869
|
+
elements: o
|
|
870
|
+
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Ce(n), c = Ie(n), a = He(n) === "y", u = ["left", "top"].includes(i) ? -1 : 1, l = s && a ? -1 : 1, p = Qe(t, e);
|
|
871
|
+
let {
|
|
872
|
+
mainAxis: g,
|
|
873
|
+
crossAxis: d,
|
|
874
|
+
alignmentAxis: h
|
|
875
|
+
} = typeof p == "number" ? {
|
|
876
|
+
mainAxis: p,
|
|
877
|
+
crossAxis: 0,
|
|
878
|
+
alignmentAxis: null
|
|
879
|
+
} : {
|
|
880
|
+
mainAxis: p.mainAxis || 0,
|
|
881
|
+
crossAxis: p.crossAxis || 0,
|
|
882
|
+
alignmentAxis: p.alignmentAxis
|
|
883
|
+
};
|
|
884
|
+
return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), a ? {
|
|
885
|
+
x: d * l,
|
|
886
|
+
y: g * u
|
|
887
|
+
} : {
|
|
888
|
+
x: g * u,
|
|
889
|
+
y: d * l
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
const no = function(e) {
|
|
893
|
+
return e === void 0 && (e = 0), {
|
|
894
|
+
name: "offset",
|
|
895
|
+
options: e,
|
|
896
|
+
async fn(t) {
|
|
897
|
+
var n, r;
|
|
898
|
+
const {
|
|
899
|
+
x: o,
|
|
900
|
+
y: s,
|
|
901
|
+
placement: i,
|
|
902
|
+
middlewareData: c
|
|
903
|
+
} = t, a = await to(t, e);
|
|
904
|
+
return i === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
905
|
+
x: o + a.x,
|
|
906
|
+
y: s + a.y,
|
|
907
|
+
data: {
|
|
908
|
+
...a,
|
|
909
|
+
placement: i
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
}, ro = function(e) {
|
|
915
|
+
return e === void 0 && (e = {}), {
|
|
916
|
+
name: "shift",
|
|
917
|
+
options: e,
|
|
918
|
+
async fn(t) {
|
|
919
|
+
const {
|
|
920
|
+
x: n,
|
|
921
|
+
y: r,
|
|
922
|
+
placement: o
|
|
923
|
+
} = t, {
|
|
924
|
+
mainAxis: s = !0,
|
|
925
|
+
crossAxis: i = !1,
|
|
926
|
+
limiter: c = {
|
|
927
|
+
fn: (y) => {
|
|
928
|
+
let {
|
|
929
|
+
x: R,
|
|
930
|
+
y: v
|
|
931
|
+
} = y;
|
|
932
|
+
return {
|
|
933
|
+
x: R,
|
|
934
|
+
y: v
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
...a
|
|
939
|
+
} = Qe(e, t), u = {
|
|
940
|
+
x: n,
|
|
941
|
+
y: r
|
|
942
|
+
}, l = await kt(t, a), p = He(Ce(o)), g = Gn(p);
|
|
943
|
+
let d = u[g], h = u[p];
|
|
944
|
+
if (s) {
|
|
945
|
+
const y = g === "y" ? "top" : "left", R = g === "y" ? "bottom" : "right", v = d + l[y], x = d - l[R];
|
|
946
|
+
d = pn(v, d, x);
|
|
947
|
+
}
|
|
948
|
+
if (i) {
|
|
949
|
+
const y = p === "y" ? "top" : "left", R = p === "y" ? "bottom" : "right", v = h + l[y], x = h - l[R];
|
|
950
|
+
h = pn(v, h, x);
|
|
951
|
+
}
|
|
952
|
+
const m = c.fn({
|
|
953
|
+
...t,
|
|
954
|
+
[g]: d,
|
|
955
|
+
[p]: h
|
|
956
|
+
});
|
|
957
|
+
return {
|
|
958
|
+
...m,
|
|
959
|
+
data: {
|
|
960
|
+
x: m.x - n,
|
|
961
|
+
y: m.y - r,
|
|
962
|
+
enabled: {
|
|
963
|
+
[g]: s,
|
|
964
|
+
[p]: i
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
}, oo = function(e) {
|
|
971
|
+
return e === void 0 && (e = {}), {
|
|
972
|
+
name: "size",
|
|
973
|
+
options: e,
|
|
974
|
+
async fn(t) {
|
|
975
|
+
var n, r;
|
|
976
|
+
const {
|
|
977
|
+
placement: o,
|
|
978
|
+
rects: s,
|
|
979
|
+
platform: i,
|
|
980
|
+
elements: c
|
|
981
|
+
} = t, {
|
|
982
|
+
apply: a = () => {
|
|
983
|
+
},
|
|
984
|
+
...u
|
|
985
|
+
} = Qe(e, t), l = await kt(t, u), p = Ce(o), g = Ie(o), d = He(o) === "y", {
|
|
986
|
+
width: h,
|
|
987
|
+
height: m
|
|
988
|
+
} = s.floating;
|
|
989
|
+
let y, R;
|
|
990
|
+
p === "top" || p === "bottom" ? (y = p, R = g === (await (i.isRTL == null ? void 0 : i.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (R = p, y = g === "end" ? "top" : "bottom");
|
|
991
|
+
const v = m - l.top - l.bottom, x = h - l.left - l.right, I = Je(m - l[y], v), A = Je(h - l[R], x), k = !t.middlewareData.shift;
|
|
992
|
+
let N = I, S = A;
|
|
993
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = x), (r = t.middlewareData.shift) != null && r.enabled.y && (N = v), k && !g) {
|
|
994
|
+
const F = be(l.left, 0), _ = be(l.right, 0), U = be(l.top, 0), V = be(l.bottom, 0);
|
|
995
|
+
d ? S = h - 2 * (F !== 0 || _ !== 0 ? F + _ : be(l.left, l.right)) : N = m - 2 * (U !== 0 || V !== 0 ? U + V : be(l.top, l.bottom));
|
|
996
|
+
}
|
|
997
|
+
await a({
|
|
998
|
+
...t,
|
|
999
|
+
availableWidth: S,
|
|
1000
|
+
availableHeight: N
|
|
1001
|
+
});
|
|
1002
|
+
const L = await i.getDimensions(c.floating);
|
|
1003
|
+
return h !== L.width || m !== L.height ? {
|
|
1004
|
+
reset: {
|
|
1005
|
+
rects: !0
|
|
1006
|
+
}
|
|
1007
|
+
} : {};
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
function ur(e) {
|
|
1012
|
+
const t = we(e);
|
|
1013
|
+
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
1014
|
+
const o = oe(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, c = wt(n) !== s || wt(r) !== i;
|
|
1015
|
+
return c && (n = s, r = i), {
|
|
1016
|
+
width: n,
|
|
1017
|
+
height: r,
|
|
1018
|
+
$: c
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function sn(e) {
|
|
1022
|
+
return Y(e) ? e : e.contextElement;
|
|
1023
|
+
}
|
|
1024
|
+
function Xe(e) {
|
|
1025
|
+
const t = sn(e);
|
|
1026
|
+
if (!oe(t))
|
|
1027
|
+
return Ee(1);
|
|
1028
|
+
const n = t.getBoundingClientRect(), {
|
|
1029
|
+
width: r,
|
|
1030
|
+
height: o,
|
|
1031
|
+
$: s
|
|
1032
|
+
} = ur(t);
|
|
1033
|
+
let i = (s ? wt(n.width) : n.width) / r, c = (s ? wt(n.height) : n.height) / o;
|
|
1034
|
+
return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
1035
|
+
x: i,
|
|
1036
|
+
y: c
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
const io = /* @__PURE__ */ Ee(0);
|
|
1040
|
+
function lr(e) {
|
|
1041
|
+
const t = he(e);
|
|
1042
|
+
return !St() || !t.visualViewport ? io : {
|
|
1043
|
+
x: t.visualViewport.offsetLeft,
|
|
1044
|
+
y: t.visualViewport.offsetTop
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function so(e, t, n) {
|
|
1048
|
+
return t === void 0 && (t = !1), !n || t && n !== he(e) ? !1 : t;
|
|
1049
|
+
}
|
|
1050
|
+
function ze(e, t, n, r) {
|
|
1051
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1052
|
+
const o = e.getBoundingClientRect(), s = sn(e);
|
|
1053
|
+
let i = Ee(1);
|
|
1054
|
+
t && (r ? Y(r) && (i = Xe(r)) : i = Xe(e));
|
|
1055
|
+
const c = so(s, n, r) ? lr(s) : Ee(0);
|
|
1056
|
+
let a = (o.left + c.x) / i.x, u = (o.top + c.y) / i.y, l = o.width / i.x, p = o.height / i.y;
|
|
1057
|
+
if (s) {
|
|
1058
|
+
const g = he(s), d = r && Y(r) ? he(r) : r;
|
|
1059
|
+
let h = g, m = Jt(h);
|
|
1060
|
+
for (; m && r && d !== h; ) {
|
|
1061
|
+
const y = Xe(m), R = m.getBoundingClientRect(), v = we(m), x = R.left + (m.clientLeft + parseFloat(v.paddingLeft)) * y.x, I = R.top + (m.clientTop + parseFloat(v.paddingTop)) * y.y;
|
|
1062
|
+
a *= y.x, u *= y.y, l *= y.x, p *= y.y, a += x, u += I, h = he(m), m = Jt(h);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return It({
|
|
1066
|
+
width: l,
|
|
1067
|
+
height: p,
|
|
1068
|
+
x: a,
|
|
1069
|
+
y: u
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
function cn(e, t) {
|
|
1073
|
+
const n = Dt(e).scrollLeft;
|
|
1074
|
+
return t ? t.left + n : ze(Te(e)).left + n;
|
|
1075
|
+
}
|
|
1076
|
+
function ar(e, t, n) {
|
|
1077
|
+
n === void 0 && (n = !1);
|
|
1078
|
+
const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
|
|
1079
|
+
// RTL <body> scrollbar.
|
|
1080
|
+
cn(e, r)
|
|
1081
|
+
)), s = r.top + t.scrollTop;
|
|
1082
|
+
return {
|
|
1083
|
+
x: o,
|
|
1084
|
+
y: s
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function co(e) {
|
|
1088
|
+
let {
|
|
1089
|
+
elements: t,
|
|
1090
|
+
rect: n,
|
|
1091
|
+
offsetParent: r,
|
|
1092
|
+
strategy: o
|
|
1093
|
+
} = e;
|
|
1094
|
+
const s = o === "fixed", i = Te(r), c = t ? Pt(t.floating) : !1;
|
|
1095
|
+
if (r === i || c && s)
|
|
1096
|
+
return n;
|
|
1097
|
+
let a = {
|
|
1098
|
+
scrollLeft: 0,
|
|
1099
|
+
scrollTop: 0
|
|
1100
|
+
}, u = Ee(1);
|
|
1101
|
+
const l = Ee(0), p = oe(r);
|
|
1102
|
+
if ((p || !p && !s) && ((_e(r) !== "body" || ut(i)) && (a = Dt(r)), oe(r))) {
|
|
1103
|
+
const d = ze(r);
|
|
1104
|
+
u = Xe(r), l.x = d.x + r.clientLeft, l.y = d.y + r.clientTop;
|
|
1105
|
+
}
|
|
1106
|
+
const g = i && !p && !s ? ar(i, a, !0) : Ee(0);
|
|
1107
|
+
return {
|
|
1108
|
+
width: n.width * u.x,
|
|
1109
|
+
height: n.height * u.y,
|
|
1110
|
+
x: n.x * u.x - a.scrollLeft * u.x + l.x + g.x,
|
|
1111
|
+
y: n.y * u.y - a.scrollTop * u.y + l.y + g.y
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
function uo(e) {
|
|
1115
|
+
return Array.from(e.getClientRects());
|
|
1116
|
+
}
|
|
1117
|
+
function lo(e) {
|
|
1118
|
+
const t = Te(e), n = Dt(e), r = e.ownerDocument.body, o = be(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = be(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1119
|
+
let i = -n.scrollLeft + cn(e);
|
|
1120
|
+
const c = -n.scrollTop;
|
|
1121
|
+
return we(r).direction === "rtl" && (i += be(t.clientWidth, r.clientWidth) - o), {
|
|
1122
|
+
width: o,
|
|
1123
|
+
height: s,
|
|
1124
|
+
x: i,
|
|
1125
|
+
y: c
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function ao(e, t) {
|
|
1129
|
+
const n = he(e), r = Te(e), o = n.visualViewport;
|
|
1130
|
+
let s = r.clientWidth, i = r.clientHeight, c = 0, a = 0;
|
|
1131
|
+
if (o) {
|
|
1132
|
+
s = o.width, i = o.height;
|
|
1133
|
+
const u = St();
|
|
1134
|
+
(!u || u && t === "fixed") && (c = o.offsetLeft, a = o.offsetTop);
|
|
1135
|
+
}
|
|
1136
|
+
return {
|
|
1137
|
+
width: s,
|
|
1138
|
+
height: i,
|
|
1139
|
+
x: c,
|
|
1140
|
+
y: a
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
function fo(e, t) {
|
|
1144
|
+
const n = ze(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = oe(e) ? Xe(e) : Ee(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, u = r * s.y;
|
|
1145
|
+
return {
|
|
1146
|
+
width: i,
|
|
1147
|
+
height: c,
|
|
1148
|
+
x: a,
|
|
1149
|
+
y: u
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
function yn(e, t, n) {
|
|
1153
|
+
let r;
|
|
1154
|
+
if (t === "viewport")
|
|
1155
|
+
r = ao(e, n);
|
|
1156
|
+
else if (t === "document")
|
|
1157
|
+
r = lo(Te(e));
|
|
1158
|
+
else if (Y(t))
|
|
1159
|
+
r = fo(t, n);
|
|
1160
|
+
else {
|
|
1161
|
+
const o = lr(e);
|
|
1162
|
+
r = {
|
|
1163
|
+
x: t.x - o.x,
|
|
1164
|
+
y: t.y - o.y,
|
|
1165
|
+
width: t.width,
|
|
1166
|
+
height: t.height
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
return It(r);
|
|
1170
|
+
}
|
|
1171
|
+
function fr(e, t) {
|
|
1172
|
+
const n = Pe(e);
|
|
1173
|
+
return n === t || !Y(n) || Me(n) ? !1 : we(n).position === "fixed" || fr(n, t);
|
|
1174
|
+
}
|
|
1175
|
+
function mo(e, t) {
|
|
1176
|
+
const n = t.get(e);
|
|
1177
|
+
if (n)
|
|
1178
|
+
return n;
|
|
1179
|
+
let r = ke(e, [], !1).filter((c) => Y(c) && _e(c) !== "body"), o = null;
|
|
1180
|
+
const s = we(e).position === "fixed";
|
|
1181
|
+
let i = s ? Pe(e) : e;
|
|
1182
|
+
for (; Y(i) && !Me(i); ) {
|
|
1183
|
+
const c = we(i), a = nn(i);
|
|
1184
|
+
!a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ut(i) && !a && fr(e, i)) ? r = r.filter((l) => l !== i) : o = c, i = Pe(i);
|
|
1185
|
+
}
|
|
1186
|
+
return t.set(e, r), r;
|
|
1187
|
+
}
|
|
1188
|
+
function po(e) {
|
|
1189
|
+
let {
|
|
1190
|
+
element: t,
|
|
1191
|
+
boundary: n,
|
|
1192
|
+
rootBoundary: r,
|
|
1193
|
+
strategy: o
|
|
1194
|
+
} = e;
|
|
1195
|
+
const i = [...n === "clippingAncestors" ? Pt(t) ? [] : mo(t, this._c) : [].concat(n), r], c = i[0], a = i.reduce((u, l) => {
|
|
1196
|
+
const p = yn(t, l, o);
|
|
1197
|
+
return u.top = be(p.top, u.top), u.right = Je(p.right, u.right), u.bottom = Je(p.bottom, u.bottom), u.left = be(p.left, u.left), u;
|
|
1198
|
+
}, yn(t, c, o));
|
|
1199
|
+
return {
|
|
1200
|
+
width: a.right - a.left,
|
|
1201
|
+
height: a.bottom - a.top,
|
|
1202
|
+
x: a.left,
|
|
1203
|
+
y: a.top
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
function go(e) {
|
|
1207
|
+
const {
|
|
1208
|
+
width: t,
|
|
1209
|
+
height: n
|
|
1210
|
+
} = ur(e);
|
|
1211
|
+
return {
|
|
1212
|
+
width: t,
|
|
1213
|
+
height: n
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
function ho(e, t, n) {
|
|
1217
|
+
const r = oe(t), o = Te(t), s = n === "fixed", i = ze(e, !0, s, t);
|
|
1218
|
+
let c = {
|
|
1219
|
+
scrollLeft: 0,
|
|
1220
|
+
scrollTop: 0
|
|
1221
|
+
};
|
|
1222
|
+
const a = Ee(0);
|
|
1223
|
+
if (r || !r && !s)
|
|
1224
|
+
if ((_e(t) !== "body" || ut(o)) && (c = Dt(t)), r) {
|
|
1225
|
+
const g = ze(t, !0, s, t);
|
|
1226
|
+
a.x = g.x + t.clientLeft, a.y = g.y + t.clientTop;
|
|
1227
|
+
} else o && (a.x = cn(o));
|
|
1228
|
+
const u = o && !r && !s ? ar(o, c) : Ee(0), l = i.left + c.scrollLeft - a.x - u.x, p = i.top + c.scrollTop - a.y - u.y;
|
|
1229
|
+
return {
|
|
1230
|
+
x: l,
|
|
1231
|
+
y: p,
|
|
1232
|
+
width: i.width,
|
|
1233
|
+
height: i.height
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
function Wt(e) {
|
|
1237
|
+
return we(e).position === "static";
|
|
1238
|
+
}
|
|
1239
|
+
function xn(e, t) {
|
|
1240
|
+
if (!oe(e) || we(e).position === "fixed")
|
|
1241
|
+
return null;
|
|
1242
|
+
if (t)
|
|
1243
|
+
return t(e);
|
|
1244
|
+
let n = e.offsetParent;
|
|
1245
|
+
return Te(e) === n && (n = n.ownerDocument.body), n;
|
|
1246
|
+
}
|
|
1247
|
+
function dr(e, t) {
|
|
1248
|
+
const n = he(e);
|
|
1249
|
+
if (Pt(e))
|
|
1250
|
+
return n;
|
|
1251
|
+
if (!oe(e)) {
|
|
1252
|
+
let o = Pe(e);
|
|
1253
|
+
for (; o && !Me(o); ) {
|
|
1254
|
+
if (Y(o) && !Wt(o))
|
|
1255
|
+
return o;
|
|
1256
|
+
o = Pe(o);
|
|
1257
|
+
}
|
|
1258
|
+
return n;
|
|
1259
|
+
}
|
|
1260
|
+
let r = xn(e, t);
|
|
1261
|
+
for (; r && Mr(r) && Wt(r); )
|
|
1262
|
+
r = xn(r, t);
|
|
1263
|
+
return r && Me(r) && Wt(r) && !nn(r) ? n : r || Pr(e) || n;
|
|
1264
|
+
}
|
|
1265
|
+
const vo = async function(e) {
|
|
1266
|
+
const t = this.getOffsetParent || dr, n = this.getDimensions, r = await n(e.floating);
|
|
1267
|
+
return {
|
|
1268
|
+
reference: ho(e.reference, await t(e.floating), e.strategy),
|
|
1269
|
+
floating: {
|
|
1270
|
+
x: 0,
|
|
1271
|
+
y: 0,
|
|
1272
|
+
width: r.width,
|
|
1273
|
+
height: r.height
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
function bo(e) {
|
|
1278
|
+
return we(e).direction === "rtl";
|
|
1279
|
+
}
|
|
1280
|
+
const yo = {
|
|
1281
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: co,
|
|
1282
|
+
getDocumentElement: Te,
|
|
1283
|
+
getClippingRect: po,
|
|
1284
|
+
getOffsetParent: dr,
|
|
1285
|
+
getElementRects: vo,
|
|
1286
|
+
getClientRects: uo,
|
|
1287
|
+
getDimensions: go,
|
|
1288
|
+
getScale: Xe,
|
|
1289
|
+
isElement: Y,
|
|
1290
|
+
isRTL: bo
|
|
1291
|
+
};
|
|
1292
|
+
function mr(e, t) {
|
|
1293
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1294
|
+
}
|
|
1295
|
+
function xo(e, t) {
|
|
1296
|
+
let n = null, r;
|
|
1297
|
+
const o = Te(e);
|
|
1298
|
+
function s() {
|
|
1299
|
+
var c;
|
|
1300
|
+
clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
|
|
1301
|
+
}
|
|
1302
|
+
function i(c, a) {
|
|
1303
|
+
c === void 0 && (c = !1), a === void 0 && (a = 1), s();
|
|
1304
|
+
const u = e.getBoundingClientRect(), {
|
|
1305
|
+
left: l,
|
|
1306
|
+
top: p,
|
|
1307
|
+
width: g,
|
|
1308
|
+
height: d
|
|
1309
|
+
} = u;
|
|
1310
|
+
if (c || t(), !g || !d)
|
|
1311
|
+
return;
|
|
1312
|
+
const h = je(p), m = je(o.clientWidth - (l + g)), y = je(o.clientHeight - (p + d)), R = je(l), x = {
|
|
1313
|
+
rootMargin: -h + "px " + -m + "px " + -y + "px " + -R + "px",
|
|
1314
|
+
threshold: be(0, Je(1, a)) || 1
|
|
1315
|
+
};
|
|
1316
|
+
let I = !0;
|
|
1317
|
+
function A(k) {
|
|
1318
|
+
const N = k[0].intersectionRatio;
|
|
1319
|
+
if (N !== a) {
|
|
1320
|
+
if (!I)
|
|
1321
|
+
return i();
|
|
1322
|
+
N ? i(!1, N) : r = setTimeout(() => {
|
|
1323
|
+
i(!1, 1e-7);
|
|
1324
|
+
}, 1e3);
|
|
1325
|
+
}
|
|
1326
|
+
N === 1 && !mr(u, e.getBoundingClientRect()) && i(), I = !1;
|
|
1327
|
+
}
|
|
1328
|
+
try {
|
|
1329
|
+
n = new IntersectionObserver(A, {
|
|
1330
|
+
...x,
|
|
1331
|
+
// Handle <iframe>s
|
|
1332
|
+
root: o.ownerDocument
|
|
1333
|
+
});
|
|
1334
|
+
} catch {
|
|
1335
|
+
n = new IntersectionObserver(A, x);
|
|
1336
|
+
}
|
|
1337
|
+
n.observe(e);
|
|
1338
|
+
}
|
|
1339
|
+
return i(!0), s;
|
|
1340
|
+
}
|
|
1341
|
+
function oi(e, t, n, r) {
|
|
1342
|
+
r === void 0 && (r = {});
|
|
1343
|
+
const {
|
|
1344
|
+
ancestorScroll: o = !0,
|
|
1345
|
+
ancestorResize: s = !0,
|
|
1346
|
+
elementResize: i = typeof ResizeObserver == "function",
|
|
1347
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1348
|
+
animationFrame: a = !1
|
|
1349
|
+
} = r, u = sn(e), l = o || s ? [...u ? ke(u) : [], ...ke(t)] : [];
|
|
1350
|
+
l.forEach((R) => {
|
|
1351
|
+
o && R.addEventListener("scroll", n, {
|
|
1352
|
+
passive: !0
|
|
1353
|
+
}), s && R.addEventListener("resize", n);
|
|
1354
|
+
});
|
|
1355
|
+
const p = u && c ? xo(u, n) : null;
|
|
1356
|
+
let g = -1, d = null;
|
|
1357
|
+
i && (d = new ResizeObserver((R) => {
|
|
1358
|
+
let [v] = R;
|
|
1359
|
+
v && v.target === u && d && (d.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
1360
|
+
var x;
|
|
1361
|
+
(x = d) == null || x.observe(t);
|
|
1362
|
+
})), n();
|
|
1363
|
+
}), u && !a && d.observe(u), d.observe(t));
|
|
1364
|
+
let h, m = a ? ze(e) : null;
|
|
1365
|
+
a && y();
|
|
1366
|
+
function y() {
|
|
1367
|
+
const R = ze(e);
|
|
1368
|
+
m && !mr(m, R) && n(), m = R, h = requestAnimationFrame(y);
|
|
1369
|
+
}
|
|
1370
|
+
return n(), () => {
|
|
1371
|
+
var R;
|
|
1372
|
+
l.forEach((v) => {
|
|
1373
|
+
o && v.removeEventListener("scroll", n), s && v.removeEventListener("resize", n);
|
|
1374
|
+
}), p == null || p(), (R = d) == null || R.disconnect(), d = null, a && cancelAnimationFrame(h);
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
const wo = no, Ro = Zr, Eo = ro, Io = eo, Co = oo, To = (e, t, n) => {
|
|
1378
|
+
const r = /* @__PURE__ */ new Map(), o = {
|
|
1379
|
+
platform: yo,
|
|
1380
|
+
...n
|
|
1381
|
+
}, s = {
|
|
1382
|
+
...o.platform,
|
|
1383
|
+
_c: r
|
|
1384
|
+
};
|
|
1385
|
+
return Jr(e, t, {
|
|
1386
|
+
...o,
|
|
1387
|
+
platform: s
|
|
1388
|
+
});
|
|
1389
|
+
};
|
|
1390
|
+
var xt = typeof document < "u" ? Wn : $n;
|
|
1391
|
+
function Tt(e, t) {
|
|
1392
|
+
if (e === t)
|
|
1393
|
+
return !0;
|
|
1394
|
+
if (typeof e != typeof t)
|
|
1395
|
+
return !1;
|
|
1396
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1397
|
+
return !0;
|
|
1398
|
+
let n, r, o;
|
|
1399
|
+
if (e && t && typeof e == "object") {
|
|
1400
|
+
if (Array.isArray(e)) {
|
|
1401
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1402
|
+
for (r = n; r-- !== 0; )
|
|
1403
|
+
if (!Tt(e[r], t[r]))
|
|
1404
|
+
return !1;
|
|
1405
|
+
return !0;
|
|
1406
|
+
}
|
|
1407
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
1408
|
+
return !1;
|
|
1409
|
+
for (r = n; r-- !== 0; )
|
|
1410
|
+
if (!{}.hasOwnProperty.call(t, o[r]))
|
|
1411
|
+
return !1;
|
|
1412
|
+
for (r = n; r-- !== 0; ) {
|
|
1413
|
+
const s = o[r];
|
|
1414
|
+
if (!(s === "_owner" && e.$$typeof) && !Tt(e[s], t[s]))
|
|
1415
|
+
return !1;
|
|
1416
|
+
}
|
|
1417
|
+
return !0;
|
|
1418
|
+
}
|
|
1419
|
+
return e !== e && t !== t;
|
|
1420
|
+
}
|
|
1421
|
+
function pr(e) {
|
|
1422
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1423
|
+
}
|
|
1424
|
+
function wn(e, t) {
|
|
1425
|
+
const n = pr(e);
|
|
1426
|
+
return Math.round(t * n) / n;
|
|
1427
|
+
}
|
|
1428
|
+
function $t(e) {
|
|
1429
|
+
const t = f.useRef(e);
|
|
1430
|
+
return xt(() => {
|
|
1431
|
+
t.current = e;
|
|
1432
|
+
}), t;
|
|
1433
|
+
}
|
|
1434
|
+
function Oo(e) {
|
|
1435
|
+
e === void 0 && (e = {});
|
|
1436
|
+
const {
|
|
1437
|
+
placement: t = "bottom",
|
|
1438
|
+
strategy: n = "absolute",
|
|
1439
|
+
middleware: r = [],
|
|
1440
|
+
platform: o,
|
|
1441
|
+
elements: {
|
|
1442
|
+
reference: s,
|
|
1443
|
+
floating: i
|
|
1444
|
+
} = {},
|
|
1445
|
+
transform: c = !0,
|
|
1446
|
+
whileElementsMounted: a,
|
|
1447
|
+
open: u
|
|
1448
|
+
} = e, [l, p] = f.useState({
|
|
1449
|
+
x: 0,
|
|
1450
|
+
y: 0,
|
|
1451
|
+
strategy: n,
|
|
1452
|
+
placement: t,
|
|
1453
|
+
middlewareData: {},
|
|
1454
|
+
isPositioned: !1
|
|
1455
|
+
}), [g, d] = f.useState(r);
|
|
1456
|
+
Tt(g, r) || d(r);
|
|
1457
|
+
const [h, m] = f.useState(null), [y, R] = f.useState(null), v = f.useCallback((b) => {
|
|
1458
|
+
b !== k.current && (k.current = b, m(b));
|
|
1459
|
+
}, []), x = f.useCallback((b) => {
|
|
1460
|
+
b !== N.current && (N.current = b, R(b));
|
|
1461
|
+
}, []), I = s || h, A = i || y, k = f.useRef(null), N = f.useRef(null), S = f.useRef(l), L = a != null, F = $t(a), _ = $t(o), U = $t(u), V = f.useCallback(() => {
|
|
1462
|
+
if (!k.current || !N.current)
|
|
1463
|
+
return;
|
|
1464
|
+
const b = {
|
|
1465
|
+
placement: t,
|
|
1466
|
+
strategy: n,
|
|
1467
|
+
middleware: g
|
|
1468
|
+
};
|
|
1469
|
+
_.current && (b.platform = _.current), To(k.current, N.current, b).then((E) => {
|
|
1470
|
+
const M = {
|
|
1471
|
+
...E,
|
|
1472
|
+
// The floating element's position may be recomputed while it's closed
|
|
1473
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1474
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1475
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1476
|
+
isPositioned: U.current !== !1
|
|
1477
|
+
};
|
|
1478
|
+
O.current && !Tt(S.current, M) && (S.current = M, tn.flushSync(() => {
|
|
1479
|
+
p(M);
|
|
1480
|
+
}));
|
|
1481
|
+
});
|
|
1482
|
+
}, [g, t, n, _, U]);
|
|
1483
|
+
xt(() => {
|
|
1484
|
+
u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, p((b) => ({
|
|
1485
|
+
...b,
|
|
1486
|
+
isPositioned: !1
|
|
1487
|
+
})));
|
|
1488
|
+
}, [u]);
|
|
1489
|
+
const O = f.useRef(!1);
|
|
1490
|
+
xt(() => (O.current = !0, () => {
|
|
1491
|
+
O.current = !1;
|
|
1492
|
+
}), []), xt(() => {
|
|
1493
|
+
if (I && (k.current = I), A && (N.current = A), I && A) {
|
|
1494
|
+
if (F.current)
|
|
1495
|
+
return F.current(I, A, V);
|
|
1496
|
+
V();
|
|
1497
|
+
}
|
|
1498
|
+
}, [I, A, V, F, L]);
|
|
1499
|
+
const w = f.useMemo(() => ({
|
|
1500
|
+
reference: k,
|
|
1501
|
+
floating: N,
|
|
1502
|
+
setReference: v,
|
|
1503
|
+
setFloating: x
|
|
1504
|
+
}), [v, x]), K = f.useMemo(() => ({
|
|
1505
|
+
reference: I,
|
|
1506
|
+
floating: A
|
|
1507
|
+
}), [I, A]), T = f.useMemo(() => {
|
|
1508
|
+
const b = {
|
|
1509
|
+
position: n,
|
|
1510
|
+
left: 0,
|
|
1511
|
+
top: 0
|
|
1512
|
+
};
|
|
1513
|
+
if (!K.floating)
|
|
1514
|
+
return b;
|
|
1515
|
+
const E = wn(K.floating, l.x), M = wn(K.floating, l.y);
|
|
1516
|
+
return c ? {
|
|
1517
|
+
...b,
|
|
1518
|
+
transform: "translate(" + E + "px, " + M + "px)",
|
|
1519
|
+
...pr(K.floating) >= 1.5 && {
|
|
1520
|
+
willChange: "transform"
|
|
1521
|
+
}
|
|
1522
|
+
} : {
|
|
1523
|
+
position: n,
|
|
1524
|
+
left: E,
|
|
1525
|
+
top: M
|
|
1526
|
+
};
|
|
1527
|
+
}, [n, c, K.floating, l.x, l.y]);
|
|
1528
|
+
return f.useMemo(() => ({
|
|
1529
|
+
...l,
|
|
1530
|
+
update: V,
|
|
1531
|
+
refs: w,
|
|
1532
|
+
elements: K,
|
|
1533
|
+
floatingStyles: T
|
|
1534
|
+
}), [l, V, w, K, T]);
|
|
1535
|
+
}
|
|
1536
|
+
const ii = (e, t) => ({
|
|
1537
|
+
...wo(e),
|
|
1538
|
+
options: [e, t]
|
|
1539
|
+
}), si = (e, t) => ({
|
|
1540
|
+
...Eo(e),
|
|
1541
|
+
options: [e, t]
|
|
1542
|
+
}), ci = (e, t) => ({
|
|
1543
|
+
...Io(e),
|
|
1544
|
+
options: [e, t]
|
|
1545
|
+
}), ui = (e, t) => ({
|
|
1546
|
+
...Co(e),
|
|
1547
|
+
options: [e, t]
|
|
1548
|
+
}), li = (e, t) => ({
|
|
1549
|
+
...Ro(e),
|
|
1550
|
+
options: [e, t]
|
|
1551
|
+
});
|
|
1552
|
+
function Ao(e) {
|
|
1553
|
+
const t = f.useRef(void 0), n = f.useCallback((r) => {
|
|
1554
|
+
const o = e.map((s) => {
|
|
1555
|
+
if (s != null) {
|
|
1556
|
+
if (typeof s == "function") {
|
|
1557
|
+
const i = s, c = i(r);
|
|
1558
|
+
return typeof c == "function" ? c : () => {
|
|
1559
|
+
i(null);
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
return s.current = r, () => {
|
|
1563
|
+
s.current = null;
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
return () => {
|
|
1568
|
+
o.forEach((s) => s == null ? void 0 : s());
|
|
1569
|
+
};
|
|
1570
|
+
}, e);
|
|
1571
|
+
return f.useMemo(() => e.every((r) => r == null) ? null : (r) => {
|
|
1572
|
+
t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
|
|
1573
|
+
}, e);
|
|
1574
|
+
}
|
|
1575
|
+
function Mo(e, t) {
|
|
1576
|
+
const n = e.compareDocumentPosition(t);
|
|
1577
|
+
return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1578
|
+
}
|
|
1579
|
+
const gr = /* @__PURE__ */ f.createContext({
|
|
1580
|
+
register: () => {
|
|
1581
|
+
},
|
|
1582
|
+
unregister: () => {
|
|
1583
|
+
},
|
|
1584
|
+
map: /* @__PURE__ */ new Map(),
|
|
1585
|
+
elementsRef: {
|
|
1586
|
+
current: []
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
function Po(e) {
|
|
1590
|
+
const {
|
|
1591
|
+
children: t,
|
|
1592
|
+
elementsRef: n,
|
|
1593
|
+
labelsRef: r
|
|
1594
|
+
} = e, [o, s] = f.useState(() => /* @__PURE__ */ new Set()), i = f.useCallback((u) => {
|
|
1595
|
+
s((l) => new Set(l).add(u));
|
|
1596
|
+
}, []), c = f.useCallback((u) => {
|
|
1597
|
+
s((l) => {
|
|
1598
|
+
const p = new Set(l);
|
|
1599
|
+
return p.delete(u), p;
|
|
1600
|
+
});
|
|
1601
|
+
}, []), a = f.useMemo(() => {
|
|
1602
|
+
const u = /* @__PURE__ */ new Map();
|
|
1603
|
+
return Array.from(o.keys()).sort(Mo).forEach((p, g) => {
|
|
1604
|
+
u.set(p, g);
|
|
1605
|
+
}), u;
|
|
1606
|
+
}, [o]);
|
|
1607
|
+
return /* @__PURE__ */ ge(gr.Provider, {
|
|
1608
|
+
value: f.useMemo(() => ({
|
|
1609
|
+
register: i,
|
|
1610
|
+
unregister: c,
|
|
1611
|
+
map: a,
|
|
1612
|
+
elementsRef: n,
|
|
1613
|
+
labelsRef: r
|
|
1614
|
+
}), [i, c, a, n, r]),
|
|
1615
|
+
children: t
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
function So(e) {
|
|
1619
|
+
e === void 0 && (e = {});
|
|
1620
|
+
const {
|
|
1621
|
+
label: t
|
|
1622
|
+
} = e, {
|
|
1623
|
+
register: n,
|
|
1624
|
+
unregister: r,
|
|
1625
|
+
map: o,
|
|
1626
|
+
elementsRef: s,
|
|
1627
|
+
labelsRef: i
|
|
1628
|
+
} = f.useContext(gr), [c, a] = f.useState(null), u = f.useRef(null), l = f.useCallback((p) => {
|
|
1629
|
+
if (u.current = p, c !== null && (s.current[c] = p, i)) {
|
|
1630
|
+
var g;
|
|
1631
|
+
const d = t !== void 0;
|
|
1632
|
+
i.current[c] = d ? t : (g = p == null ? void 0 : p.textContent) != null ? g : null;
|
|
1633
|
+
}
|
|
1634
|
+
}, [c, s, i, t]);
|
|
1635
|
+
return X(() => {
|
|
1636
|
+
const p = u.current;
|
|
1637
|
+
if (p)
|
|
1638
|
+
return n(p), () => {
|
|
1639
|
+
r(p);
|
|
1640
|
+
};
|
|
1641
|
+
}, [n, r]), X(() => {
|
|
1642
|
+
const p = u.current ? o.get(u.current) : null;
|
|
1643
|
+
p != null && a(p);
|
|
1644
|
+
}, [o]), f.useMemo(() => ({
|
|
1645
|
+
ref: l,
|
|
1646
|
+
index: c ?? -1
|
|
1647
|
+
}), [c, l]);
|
|
1648
|
+
}
|
|
1649
|
+
const Do = "data-floating-ui-focusable", Rn = "active", En = "selected", Fe = "ArrowLeft", Ne = "ArrowRight", st = "ArrowUp", Le = "ArrowDown";
|
|
1650
|
+
function hr(e, t) {
|
|
1651
|
+
return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ f.cloneElement(e, t) : /* @__PURE__ */ ge("div", {
|
|
1652
|
+
...t
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
const vr = /* @__PURE__ */ f.createContext({
|
|
1656
|
+
activeIndex: 0,
|
|
1657
|
+
onNavigate: () => {
|
|
1658
|
+
}
|
|
1659
|
+
}), br = [Fe, Ne], yr = [st, Le], Bt = [...br, ...yr], ai = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
1660
|
+
const {
|
|
1661
|
+
render: r,
|
|
1662
|
+
orientation: o = "both",
|
|
1663
|
+
loop: s = !0,
|
|
1664
|
+
rtl: i = !1,
|
|
1665
|
+
cols: c = 1,
|
|
1666
|
+
disabledIndices: a,
|
|
1667
|
+
activeIndex: u,
|
|
1668
|
+
onNavigate: l,
|
|
1669
|
+
itemSizes: p,
|
|
1670
|
+
dense: g = !1,
|
|
1671
|
+
...d
|
|
1672
|
+
} = t, [h, m] = f.useState(0), y = u ?? h, R = ce(l ?? m), v = f.useRef([]), x = r && typeof r != "function" ? r.props : {}, I = f.useMemo(() => ({
|
|
1673
|
+
activeIndex: y,
|
|
1674
|
+
onNavigate: R
|
|
1675
|
+
}), [y, R]), A = c > 1;
|
|
1676
|
+
function k(S) {
|
|
1677
|
+
if (!Bt.includes(S.key)) return;
|
|
1678
|
+
let L = y;
|
|
1679
|
+
const F = yt(v, a), _ = en(v, a), U = i ? Fe : Ne, V = i ? Ne : Fe;
|
|
1680
|
+
if (A) {
|
|
1681
|
+
const b = p || Array.from({
|
|
1682
|
+
length: v.current.length
|
|
1683
|
+
}, () => ({
|
|
1684
|
+
width: 1,
|
|
1685
|
+
height: 1
|
|
1686
|
+
})), E = nr(b, c, g), M = E.findIndex((W) => W != null && !Be(v, W, a)), G = E.reduce((W, Z, fe) => Z != null && !Be(v, Z, a) ? fe : W, -1), C = E[tr({
|
|
1687
|
+
current: E.map((W) => W ? v.current[W] : null)
|
|
1688
|
+
}, {
|
|
1689
|
+
event: S,
|
|
1690
|
+
orientation: o,
|
|
1691
|
+
loop: s,
|
|
1692
|
+
rtl: i,
|
|
1693
|
+
cols: c,
|
|
1694
|
+
// treat undefined (empty grid spaces) as disabled indices so we
|
|
1695
|
+
// don't end up in them
|
|
1696
|
+
disabledIndices: or([...(typeof a != "function" ? a : null) || v.current.map((W, Z) => Be(v, Z, a) ? Z : void 0), void 0], E),
|
|
1697
|
+
minIndex: M,
|
|
1698
|
+
maxIndex: G,
|
|
1699
|
+
prevIndex: rr(
|
|
1700
|
+
y > _ ? F : y,
|
|
1701
|
+
b,
|
|
1702
|
+
E,
|
|
1703
|
+
c,
|
|
1704
|
+
// use a corner matching the edge closest to the direction we're
|
|
1705
|
+
// moving in so we don't end up in the same item. Prefer
|
|
1706
|
+
// top/left over bottom/right.
|
|
1707
|
+
S.key === Le ? "bl" : S.key === U ? "tr" : "tl"
|
|
1708
|
+
)
|
|
1709
|
+
})];
|
|
1710
|
+
C != null && (L = C);
|
|
1711
|
+
}
|
|
1712
|
+
const O = {
|
|
1713
|
+
horizontal: [U],
|
|
1714
|
+
vertical: [Le],
|
|
1715
|
+
both: [U, Le]
|
|
1716
|
+
}[o], w = {
|
|
1717
|
+
horizontal: [V],
|
|
1718
|
+
vertical: [st],
|
|
1719
|
+
both: [V, st]
|
|
1720
|
+
}[o], K = A ? Bt : {
|
|
1721
|
+
horizontal: br,
|
|
1722
|
+
vertical: yr,
|
|
1723
|
+
both: Bt
|
|
1724
|
+
}[o];
|
|
1725
|
+
if (L === y && [...O, ...w].includes(S.key) && (s && L === _ && O.includes(S.key) ? L = F : s && L === F && w.includes(S.key) ? L = _ : L = le(v, {
|
|
1726
|
+
startingIndex: L,
|
|
1727
|
+
decrement: w.includes(S.key),
|
|
1728
|
+
disabledIndices: a
|
|
1729
|
+
})), L !== y && !Ye(v, L)) {
|
|
1730
|
+
var T;
|
|
1731
|
+
S.stopPropagation(), K.includes(S.key) && S.preventDefault(), R(L), (T = v.current[L]) == null || T.focus();
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
const N = {
|
|
1735
|
+
...d,
|
|
1736
|
+
...x,
|
|
1737
|
+
ref: n,
|
|
1738
|
+
"aria-orientation": o === "both" ? void 0 : o,
|
|
1739
|
+
onKeyDown(S) {
|
|
1740
|
+
d.onKeyDown == null || d.onKeyDown(S), x.onKeyDown == null || x.onKeyDown(S), k(S);
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
return /* @__PURE__ */ ge(vr.Provider, {
|
|
1744
|
+
value: I,
|
|
1745
|
+
children: /* @__PURE__ */ ge(Po, {
|
|
1746
|
+
elementsRef: v,
|
|
1747
|
+
children: hr(r, N)
|
|
1748
|
+
})
|
|
1749
|
+
});
|
|
1750
|
+
}), fi = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
1751
|
+
const {
|
|
1752
|
+
render: r,
|
|
1753
|
+
...o
|
|
1754
|
+
} = t, s = r && typeof r != "function" ? r.props : {}, {
|
|
1755
|
+
activeIndex: i,
|
|
1756
|
+
onNavigate: c
|
|
1757
|
+
} = f.useContext(vr), {
|
|
1758
|
+
ref: a,
|
|
1759
|
+
index: u
|
|
1760
|
+
} = So(), l = Ao([a, n, s.ref]), p = i === u, g = {
|
|
1761
|
+
...o,
|
|
1762
|
+
...s,
|
|
1763
|
+
ref: l,
|
|
1764
|
+
tabIndex: p ? 0 : -1,
|
|
1765
|
+
"data-active": p ? "" : void 0,
|
|
1766
|
+
onFocus(d) {
|
|
1767
|
+
o.onFocus == null || o.onFocus(d), s.onFocus == null || s.onFocus(d), c(u);
|
|
1768
|
+
}
|
|
1769
|
+
};
|
|
1770
|
+
return hr(r, g);
|
|
1771
|
+
}), ko = {
|
|
1772
|
+
...f
|
|
1773
|
+
};
|
|
1774
|
+
let In = !1, Lo = 0;
|
|
1775
|
+
const Cn = () => (
|
|
1776
|
+
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1777
|
+
// on <React 18
|
|
1778
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Lo++
|
|
1779
|
+
);
|
|
1780
|
+
function Fo() {
|
|
1781
|
+
const [e, t] = f.useState(() => In ? Cn() : void 0);
|
|
1782
|
+
return X(() => {
|
|
1783
|
+
e == null && t(Cn());
|
|
1784
|
+
}, []), f.useEffect(() => {
|
|
1785
|
+
In = !0;
|
|
1786
|
+
}, []), e;
|
|
1787
|
+
}
|
|
1788
|
+
const No = ko.useId, Lt = No || Fo;
|
|
1789
|
+
let ct;
|
|
1790
|
+
process.env.NODE_ENV !== "production" && (ct = /* @__PURE__ */ new Set());
|
|
1791
|
+
function Ht() {
|
|
1792
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1793
|
+
n[r] = arguments[r];
|
|
1794
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1795
|
+
if (!((e = ct) != null && e.has(o))) {
|
|
1796
|
+
var s;
|
|
1797
|
+
(s = ct) == null || s.add(o), console.warn(o);
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
function _o() {
|
|
1801
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1802
|
+
n[r] = arguments[r];
|
|
1803
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1804
|
+
if (!((e = ct) != null && e.has(o))) {
|
|
1805
|
+
var s;
|
|
1806
|
+
(s = ct) == null || s.add(o), console.error(o);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
function xr() {
|
|
1810
|
+
const e = /* @__PURE__ */ new Map();
|
|
1811
|
+
return {
|
|
1812
|
+
emit(t, n) {
|
|
1813
|
+
var r;
|
|
1814
|
+
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
1815
|
+
},
|
|
1816
|
+
on(t, n) {
|
|
1817
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
1818
|
+
},
|
|
1819
|
+
off(t, n) {
|
|
1820
|
+
var r;
|
|
1821
|
+
(r = e.get(t)) == null || r.delete(n);
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
const wr = /* @__PURE__ */ f.createContext(null), Rr = /* @__PURE__ */ f.createContext(null), Ze = () => {
|
|
1826
|
+
var e;
|
|
1827
|
+
return ((e = f.useContext(wr)) == null ? void 0 : e.id) || null;
|
|
1828
|
+
}, et = () => f.useContext(Rr);
|
|
1829
|
+
function di(e) {
|
|
1830
|
+
const t = Lt(), n = et(), o = Ze();
|
|
1831
|
+
return X(() => {
|
|
1832
|
+
if (!t) return;
|
|
1833
|
+
const s = {
|
|
1834
|
+
id: t,
|
|
1835
|
+
parentId: o
|
|
1836
|
+
};
|
|
1837
|
+
return n == null || n.addNode(s), () => {
|
|
1838
|
+
n == null || n.removeNode(s);
|
|
1839
|
+
};
|
|
1840
|
+
}, [n, t, o]), t;
|
|
1841
|
+
}
|
|
1842
|
+
function mi(e) {
|
|
1843
|
+
const {
|
|
1844
|
+
children: t,
|
|
1845
|
+
id: n
|
|
1846
|
+
} = e, r = Ze();
|
|
1847
|
+
return /* @__PURE__ */ ge(wr.Provider, {
|
|
1848
|
+
value: f.useMemo(() => ({
|
|
1849
|
+
id: n,
|
|
1850
|
+
parentId: r
|
|
1851
|
+
}), [n, r]),
|
|
1852
|
+
children: t
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
function pi(e) {
|
|
1856
|
+
const {
|
|
1857
|
+
children: t
|
|
1858
|
+
} = e, n = f.useRef([]), r = f.useCallback((i) => {
|
|
1859
|
+
n.current = [...n.current, i];
|
|
1860
|
+
}, []), o = f.useCallback((i) => {
|
|
1861
|
+
n.current = n.current.filter((c) => c !== i);
|
|
1862
|
+
}, []), [s] = f.useState(() => xr());
|
|
1863
|
+
return /* @__PURE__ */ ge(Rr.Provider, {
|
|
1864
|
+
value: f.useMemo(() => ({
|
|
1865
|
+
nodesRef: n,
|
|
1866
|
+
addNode: r,
|
|
1867
|
+
removeNode: o,
|
|
1868
|
+
events: s
|
|
1869
|
+
}), [r, o, s]),
|
|
1870
|
+
children: t
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
function Ue(e) {
|
|
1874
|
+
return "data-floating-ui-" + e;
|
|
1875
|
+
}
|
|
1876
|
+
function ve(e) {
|
|
1877
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1878
|
+
}
|
|
1879
|
+
const Tn = /* @__PURE__ */ Ue("safe-polygon");
|
|
1880
|
+
function zt(e, t, n) {
|
|
1881
|
+
if (n && !it(n))
|
|
1882
|
+
return 0;
|
|
1883
|
+
if (typeof e == "number")
|
|
1884
|
+
return e;
|
|
1885
|
+
if (typeof e == "function") {
|
|
1886
|
+
const r = e();
|
|
1887
|
+
return typeof r == "number" ? r : r == null ? void 0 : r[t];
|
|
1888
|
+
}
|
|
1889
|
+
return e == null ? void 0 : e[t];
|
|
1890
|
+
}
|
|
1891
|
+
function Ut(e) {
|
|
1892
|
+
return typeof e == "function" ? e() : e;
|
|
1893
|
+
}
|
|
1894
|
+
function gi(e, t) {
|
|
1895
|
+
t === void 0 && (t = {});
|
|
1896
|
+
const {
|
|
1897
|
+
open: n,
|
|
1898
|
+
onOpenChange: r,
|
|
1899
|
+
dataRef: o,
|
|
1900
|
+
events: s,
|
|
1901
|
+
elements: i
|
|
1902
|
+
} = e, {
|
|
1903
|
+
enabled: c = !0,
|
|
1904
|
+
delay: a = 0,
|
|
1905
|
+
handleClose: u = null,
|
|
1906
|
+
mouseOnly: l = !1,
|
|
1907
|
+
restMs: p = 0,
|
|
1908
|
+
move: g = !0
|
|
1909
|
+
} = t, d = et(), h = Ze(), m = xe(u), y = xe(a), R = xe(n), v = xe(p), x = f.useRef(), I = f.useRef(-1), A = f.useRef(), k = f.useRef(-1), N = f.useRef(!0), S = f.useRef(!1), L = f.useRef(() => {
|
|
1910
|
+
}), F = f.useRef(!1), _ = ce(() => {
|
|
1911
|
+
var T;
|
|
1912
|
+
const b = (T = o.current.openEvent) == null ? void 0 : T.type;
|
|
1913
|
+
return (b == null ? void 0 : b.includes("mouse")) && b !== "mousedown";
|
|
1914
|
+
});
|
|
1915
|
+
f.useEffect(() => {
|
|
1916
|
+
if (!c) return;
|
|
1917
|
+
function T(b) {
|
|
1918
|
+
let {
|
|
1919
|
+
open: E
|
|
1920
|
+
} = b;
|
|
1921
|
+
E || (ve(I), ve(k), N.current = !0, F.current = !1);
|
|
1922
|
+
}
|
|
1923
|
+
return s.on("openchange", T), () => {
|
|
1924
|
+
s.off("openchange", T);
|
|
1925
|
+
};
|
|
1926
|
+
}, [c, s]), f.useEffect(() => {
|
|
1927
|
+
if (!c || !m.current || !n) return;
|
|
1928
|
+
function T(E) {
|
|
1929
|
+
_() && r(!1, E, "hover");
|
|
1930
|
+
}
|
|
1931
|
+
const b = ae(i.floating).documentElement;
|
|
1932
|
+
return b.addEventListener("mouseleave", T), () => {
|
|
1933
|
+
b.removeEventListener("mouseleave", T);
|
|
1934
|
+
};
|
|
1935
|
+
}, [i.floating, n, r, c, m, _]);
|
|
1936
|
+
const U = f.useCallback(function(T, b, E) {
|
|
1937
|
+
b === void 0 && (b = !0), E === void 0 && (E = "hover");
|
|
1938
|
+
const M = zt(y.current, "close", x.current);
|
|
1939
|
+
M && !A.current ? (ve(I), I.current = window.setTimeout(() => r(!1, T, E), M)) : b && (ve(I), r(!1, T, E));
|
|
1940
|
+
}, [y, r]), V = ce(() => {
|
|
1941
|
+
L.current(), A.current = void 0;
|
|
1942
|
+
}), O = ce(() => {
|
|
1943
|
+
if (S.current) {
|
|
1944
|
+
const T = ae(i.floating).body;
|
|
1945
|
+
T.style.pointerEvents = "", T.removeAttribute(Tn), S.current = !1;
|
|
1946
|
+
}
|
|
1947
|
+
}), w = ce(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
1948
|
+
f.useEffect(() => {
|
|
1949
|
+
if (!c) return;
|
|
1950
|
+
function T(C) {
|
|
1951
|
+
if (ve(I), N.current = !1, l && !it(x.current) || Ut(v.current) > 0 && !zt(y.current, "open"))
|
|
1952
|
+
return;
|
|
1953
|
+
const W = zt(y.current, "open", x.current);
|
|
1954
|
+
W ? I.current = window.setTimeout(() => {
|
|
1955
|
+
R.current || r(!0, C, "hover");
|
|
1956
|
+
}, W) : n || r(!0, C, "hover");
|
|
1957
|
+
}
|
|
1958
|
+
function b(C) {
|
|
1959
|
+
if (w()) {
|
|
1960
|
+
O();
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
L.current();
|
|
1964
|
+
const W = ae(i.floating);
|
|
1965
|
+
if (ve(k), F.current = !1, m.current && o.current.floatingContext) {
|
|
1966
|
+
n || ve(I), A.current = m.current({
|
|
1967
|
+
...o.current.floatingContext,
|
|
1968
|
+
tree: d,
|
|
1969
|
+
x: C.clientX,
|
|
1970
|
+
y: C.clientY,
|
|
1971
|
+
onClose() {
|
|
1972
|
+
O(), V(), w() || U(C, !0, "safe-polygon");
|
|
1973
|
+
}
|
|
1974
|
+
});
|
|
1975
|
+
const fe = A.current;
|
|
1976
|
+
W.addEventListener("mousemove", fe), L.current = () => {
|
|
1977
|
+
W.removeEventListener("mousemove", fe);
|
|
1978
|
+
};
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
(x.current === "touch" ? !ue(i.floating, C.relatedTarget) : !0) && U(C);
|
|
1982
|
+
}
|
|
1983
|
+
function E(C) {
|
|
1984
|
+
w() || o.current.floatingContext && (m.current == null || m.current({
|
|
1985
|
+
...o.current.floatingContext,
|
|
1986
|
+
tree: d,
|
|
1987
|
+
x: C.clientX,
|
|
1988
|
+
y: C.clientY,
|
|
1989
|
+
onClose() {
|
|
1990
|
+
O(), V(), w() || U(C);
|
|
1991
|
+
}
|
|
1992
|
+
})(C));
|
|
1993
|
+
}
|
|
1994
|
+
function M() {
|
|
1995
|
+
ve(I);
|
|
1996
|
+
}
|
|
1997
|
+
function G(C) {
|
|
1998
|
+
w() || U(C, !1);
|
|
1999
|
+
}
|
|
2000
|
+
if (Y(i.domReference)) {
|
|
2001
|
+
const C = i.domReference, W = i.floating;
|
|
2002
|
+
return n && C.addEventListener("mouseleave", E), g && C.addEventListener("mousemove", T, {
|
|
2003
|
+
once: !0
|
|
2004
|
+
}), C.addEventListener("mouseenter", T), C.addEventListener("mouseleave", b), W && (W.addEventListener("mouseleave", E), W.addEventListener("mouseenter", M), W.addEventListener("mouseleave", G)), () => {
|
|
2005
|
+
n && C.removeEventListener("mouseleave", E), g && C.removeEventListener("mousemove", T), C.removeEventListener("mouseenter", T), C.removeEventListener("mouseleave", b), W && (W.removeEventListener("mouseleave", E), W.removeEventListener("mouseenter", M), W.removeEventListener("mouseleave", G));
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
}, [i, c, e, l, g, U, V, O, r, n, R, d, y, m, o, w, v]), X(() => {
|
|
2009
|
+
var T;
|
|
2010
|
+
if (c && n && (T = m.current) != null && (T = T.__options) != null && T.blockPointerEvents && _()) {
|
|
2011
|
+
S.current = !0;
|
|
2012
|
+
const E = i.floating;
|
|
2013
|
+
if (Y(i.domReference) && E) {
|
|
2014
|
+
var b;
|
|
2015
|
+
const M = ae(i.floating).body;
|
|
2016
|
+
M.setAttribute(Tn, "");
|
|
2017
|
+
const G = i.domReference, C = d == null || (b = d.nodesRef.current.find((W) => W.id === h)) == null || (b = b.context) == null ? void 0 : b.elements.floating;
|
|
2018
|
+
return C && (C.style.pointerEvents = ""), M.style.pointerEvents = "none", G.style.pointerEvents = "auto", E.style.pointerEvents = "auto", () => {
|
|
2019
|
+
M.style.pointerEvents = "", G.style.pointerEvents = "", E.style.pointerEvents = "";
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}, [c, n, h, i, d, m, _]), X(() => {
|
|
2024
|
+
n || (x.current = void 0, F.current = !1, V(), O());
|
|
2025
|
+
}, [n, V, O]), f.useEffect(() => () => {
|
|
2026
|
+
V(), ve(I), ve(k), O();
|
|
2027
|
+
}, [c, i.domReference, V, O]);
|
|
2028
|
+
const K = f.useMemo(() => {
|
|
2029
|
+
function T(b) {
|
|
2030
|
+
x.current = b.pointerType;
|
|
2031
|
+
}
|
|
2032
|
+
return {
|
|
2033
|
+
onPointerDown: T,
|
|
2034
|
+
onPointerEnter: T,
|
|
2035
|
+
onMouseMove(b) {
|
|
2036
|
+
const {
|
|
2037
|
+
nativeEvent: E
|
|
2038
|
+
} = b;
|
|
2039
|
+
function M() {
|
|
2040
|
+
!N.current && !R.current && r(!0, E, "hover");
|
|
2041
|
+
}
|
|
2042
|
+
l && !it(x.current) || n || Ut(v.current) === 0 || F.current && b.movementX ** 2 + b.movementY ** 2 < 2 || (ve(k), x.current === "touch" ? M() : (F.current = !0, k.current = window.setTimeout(M, Ut(v.current))));
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
}, [l, r, n, R, v]);
|
|
2046
|
+
return f.useMemo(() => c ? {
|
|
2047
|
+
reference: K
|
|
2048
|
+
} : {}, [c, K]);
|
|
2049
|
+
}
|
|
2050
|
+
let On = 0;
|
|
2051
|
+
function We(e, t) {
|
|
2052
|
+
t === void 0 && (t = {});
|
|
2053
|
+
const {
|
|
2054
|
+
preventScroll: n = !1,
|
|
2055
|
+
cancelPrevious: r = !0,
|
|
2056
|
+
sync: o = !1
|
|
2057
|
+
} = t;
|
|
2058
|
+
r && cancelAnimationFrame(On);
|
|
2059
|
+
const s = () => e == null ? void 0 : e.focus({
|
|
2060
|
+
preventScroll: n
|
|
2061
|
+
});
|
|
2062
|
+
o ? s() : On = requestAnimationFrame(s);
|
|
2063
|
+
}
|
|
2064
|
+
function Ko(e) {
|
|
2065
|
+
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
2066
|
+
}
|
|
2067
|
+
let Ge = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), ht = {}, Gt = 0;
|
|
2068
|
+
const Vo = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Er = (e) => e && (e.host || Er(e.parentNode)), Wo = (e, t) => t.map((n) => {
|
|
2069
|
+
if (e.contains(n))
|
|
2070
|
+
return n;
|
|
2071
|
+
const r = Er(n);
|
|
2072
|
+
return e.contains(r) ? r : null;
|
|
2073
|
+
}).filter((n) => n != null);
|
|
2074
|
+
function $o(e, t, n, r) {
|
|
2075
|
+
const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = Wo(t, e), c = /* @__PURE__ */ new Set(), a = new Set(i), u = [];
|
|
2076
|
+
ht[o] || (ht[o] = /* @__PURE__ */ new WeakMap());
|
|
2077
|
+
const l = ht[o];
|
|
2078
|
+
i.forEach(p), g(t), c.clear();
|
|
2079
|
+
function p(d) {
|
|
2080
|
+
!d || c.has(d) || (c.add(d), d.parentNode && p(d.parentNode));
|
|
2081
|
+
}
|
|
2082
|
+
function g(d) {
|
|
2083
|
+
!d || a.has(d) || [].forEach.call(d.children, (h) => {
|
|
2084
|
+
if (_e(h) !== "script")
|
|
2085
|
+
if (c.has(h))
|
|
2086
|
+
g(h);
|
|
2087
|
+
else {
|
|
2088
|
+
const m = s ? h.getAttribute(s) : null, y = m !== null && m !== "false", R = Ge.get(h) || 0, v = s ? R + 1 : R, x = (l.get(h) || 0) + 1;
|
|
2089
|
+
Ge.set(h, v), l.set(h, x), u.push(h), v === 1 && y && gt.add(h), x === 1 && h.setAttribute(o, ""), !y && s && h.setAttribute(s, s === "inert" ? "" : "true");
|
|
2090
|
+
}
|
|
2091
|
+
});
|
|
2092
|
+
}
|
|
2093
|
+
return Gt++, () => {
|
|
2094
|
+
u.forEach((d) => {
|
|
2095
|
+
const h = Ge.get(d) || 0, m = s ? h - 1 : h, y = (l.get(d) || 0) - 1;
|
|
2096
|
+
Ge.set(d, m), l.set(d, y), m || (!gt.has(d) && s && d.removeAttribute(s), gt.delete(d)), y || d.removeAttribute(o);
|
|
2097
|
+
}), Gt--, Gt || (Ge = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), ht = {});
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2100
|
+
function An(e, t, n) {
|
|
2101
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2102
|
+
const r = Ko(e[0]).body;
|
|
2103
|
+
return $o(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
|
|
2104
|
+
}
|
|
2105
|
+
const Ft = {
|
|
2106
|
+
border: 0,
|
|
2107
|
+
clip: "rect(0 0 0 0)",
|
|
2108
|
+
height: "1px",
|
|
2109
|
+
margin: "-1px",
|
|
2110
|
+
overflow: "hidden",
|
|
2111
|
+
padding: 0,
|
|
2112
|
+
position: "fixed",
|
|
2113
|
+
whiteSpace: "nowrap",
|
|
2114
|
+
width: "1px",
|
|
2115
|
+
top: 0,
|
|
2116
|
+
left: 0
|
|
2117
|
+
}, Ot = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
2118
|
+
const [r, o] = f.useState();
|
|
2119
|
+
X(() => {
|
|
2120
|
+
Jn() && o("button");
|
|
2121
|
+
}, []);
|
|
2122
|
+
const s = {
|
|
2123
|
+
ref: n,
|
|
2124
|
+
tabIndex: 0,
|
|
2125
|
+
// Role is only for VoiceOver
|
|
2126
|
+
role: r,
|
|
2127
|
+
"aria-hidden": r ? void 0 : !0,
|
|
2128
|
+
[Ue("focus-guard")]: "",
|
|
2129
|
+
style: Ft
|
|
2130
|
+
};
|
|
2131
|
+
return /* @__PURE__ */ ge("span", {
|
|
2132
|
+
...t,
|
|
2133
|
+
...s
|
|
2134
|
+
});
|
|
2135
|
+
}), Ir = /* @__PURE__ */ f.createContext(null), Mn = /* @__PURE__ */ Ue("portal");
|
|
2136
|
+
function Bo(e) {
|
|
2137
|
+
e === void 0 && (e = {});
|
|
2138
|
+
const {
|
|
2139
|
+
id: t,
|
|
2140
|
+
root: n
|
|
2141
|
+
} = e, r = Lt(), o = Cr(), [s, i] = f.useState(null), c = f.useRef(null);
|
|
2142
|
+
return X(() => () => {
|
|
2143
|
+
s == null || s.remove(), queueMicrotask(() => {
|
|
2144
|
+
c.current = null;
|
|
2145
|
+
});
|
|
2146
|
+
}, [s]), X(() => {
|
|
2147
|
+
if (!r || c.current) return;
|
|
2148
|
+
const a = t ? document.getElementById(t) : null;
|
|
2149
|
+
if (!a) return;
|
|
2150
|
+
const u = document.createElement("div");
|
|
2151
|
+
u.id = r, u.setAttribute(Mn, ""), a.appendChild(u), c.current = u, i(u);
|
|
2152
|
+
}, [t, r]), X(() => {
|
|
2153
|
+
if (n === null || !r || c.current) return;
|
|
2154
|
+
let a = n || (o == null ? void 0 : o.portalNode);
|
|
2155
|
+
a && !Y(a) && (a = a.current), a = a || document.body;
|
|
2156
|
+
let u = null;
|
|
2157
|
+
t && (u = document.createElement("div"), u.id = t, a.appendChild(u));
|
|
2158
|
+
const l = document.createElement("div");
|
|
2159
|
+
l.id = r, l.setAttribute(Mn, ""), a = u || a, a.appendChild(l), c.current = l, i(l);
|
|
2160
|
+
}, [t, n, r, o]), s;
|
|
2161
|
+
}
|
|
2162
|
+
function hi(e) {
|
|
2163
|
+
const {
|
|
2164
|
+
children: t,
|
|
2165
|
+
id: n,
|
|
2166
|
+
root: r,
|
|
2167
|
+
preserveTabOrder: o = !0
|
|
2168
|
+
} = e, s = Bo({
|
|
2169
|
+
id: n,
|
|
2170
|
+
root: r
|
|
2171
|
+
}), [i, c] = f.useState(null), a = f.useRef(null), u = f.useRef(null), l = f.useRef(null), p = f.useRef(null), g = i == null ? void 0 : i.modal, d = i == null ? void 0 : i.open, h = (
|
|
2172
|
+
// The FocusManager and therefore floating element are currently open/
|
|
2173
|
+
// rendered.
|
|
2174
|
+
!!i && // Guards are only for non-modal focus management.
|
|
2175
|
+
!i.modal && // Don't render if unmount is transitioning.
|
|
2176
|
+
i.open && o && !!(r || s)
|
|
2177
|
+
);
|
|
2178
|
+
return f.useEffect(() => {
|
|
2179
|
+
if (!s || !o || g)
|
|
2180
|
+
return;
|
|
2181
|
+
function m(y) {
|
|
2182
|
+
s && ot(y) && (y.type === "focusin" ? vn : Xr)(s);
|
|
2183
|
+
}
|
|
2184
|
+
return s.addEventListener("focusin", m, !0), s.addEventListener("focusout", m, !0), () => {
|
|
2185
|
+
s.removeEventListener("focusin", m, !0), s.removeEventListener("focusout", m, !0);
|
|
2186
|
+
};
|
|
2187
|
+
}, [s, o, g]), f.useEffect(() => {
|
|
2188
|
+
s && (d || vn(s));
|
|
2189
|
+
}, [d, s]), /* @__PURE__ */ Hn(Ir.Provider, {
|
|
2190
|
+
value: f.useMemo(() => ({
|
|
2191
|
+
preserveTabOrder: o,
|
|
2192
|
+
beforeOutsideRef: a,
|
|
2193
|
+
afterOutsideRef: u,
|
|
2194
|
+
beforeInsideRef: l,
|
|
2195
|
+
afterInsideRef: p,
|
|
2196
|
+
portalNode: s,
|
|
2197
|
+
setFocusManagerState: c
|
|
2198
|
+
}), [o, s]),
|
|
2199
|
+
children: [h && s && /* @__PURE__ */ ge(Ot, {
|
|
2200
|
+
"data-type": "outside",
|
|
2201
|
+
ref: a,
|
|
2202
|
+
onFocus: (m) => {
|
|
2203
|
+
if (ot(m, s)) {
|
|
2204
|
+
var y;
|
|
2205
|
+
(y = l.current) == null || y.focus();
|
|
2206
|
+
} else {
|
|
2207
|
+
const R = i ? i.domReference : null, v = cr(R);
|
|
2208
|
+
v == null || v.focus();
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
}), h && s && /* @__PURE__ */ ge("span", {
|
|
2212
|
+
"aria-owns": s.id,
|
|
2213
|
+
style: Ft
|
|
2214
|
+
}), s && /* @__PURE__ */ tn.createPortal(t, s), h && s && /* @__PURE__ */ ge(Ot, {
|
|
2215
|
+
"data-type": "outside",
|
|
2216
|
+
ref: u,
|
|
2217
|
+
onFocus: (m) => {
|
|
2218
|
+
if (ot(m, s)) {
|
|
2219
|
+
var y;
|
|
2220
|
+
(y = p.current) == null || y.focus();
|
|
2221
|
+
} else {
|
|
2222
|
+
const R = i ? i.domReference : null, v = sr(R);
|
|
2223
|
+
v == null || v.focus(), i != null && i.closeOnFocusOut && (i == null || i.onOpenChange(!1, m.nativeEvent, "focus-out"));
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
})]
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
const Cr = () => f.useContext(Ir);
|
|
2230
|
+
function Pn(e) {
|
|
2231
|
+
return f.useMemo(() => (t) => {
|
|
2232
|
+
e.forEach((n) => {
|
|
2233
|
+
n && (n.current = t);
|
|
2234
|
+
});
|
|
2235
|
+
}, e);
|
|
2236
|
+
}
|
|
2237
|
+
const Ho = 20;
|
|
2238
|
+
let $e = [];
|
|
2239
|
+
function zo(e) {
|
|
2240
|
+
$e = $e.filter((t) => t.isConnected), e && _e(e) !== "body" && ($e.push(e), $e.length > Ho && ($e = $e.slice(-20)));
|
|
2241
|
+
}
|
|
2242
|
+
function Sn() {
|
|
2243
|
+
return $e.slice().reverse().find((e) => e.isConnected);
|
|
2244
|
+
}
|
|
2245
|
+
function Uo(e) {
|
|
2246
|
+
const t = lt();
|
|
2247
|
+
return Bn(e, t) ? e : At(e, t)[0] || e;
|
|
2248
|
+
}
|
|
2249
|
+
function Dn(e, t) {
|
|
2250
|
+
var n;
|
|
2251
|
+
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
2252
|
+
return;
|
|
2253
|
+
const r = lt(), s = Or(e, r).filter((c) => {
|
|
2254
|
+
const a = c.getAttribute("data-tabindex") || "";
|
|
2255
|
+
return Bn(c, r) || c.hasAttribute("data-tabindex") && !a.startsWith("-");
|
|
2256
|
+
}), i = e.getAttribute("tabindex");
|
|
2257
|
+
t.current.includes("floating") || s.length === 0 ? i !== "0" && e.setAttribute("tabindex", "0") : (i !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
2258
|
+
}
|
|
2259
|
+
const Go = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
2260
|
+
return /* @__PURE__ */ ge("button", {
|
|
2261
|
+
...t,
|
|
2262
|
+
type: "button",
|
|
2263
|
+
ref: n,
|
|
2264
|
+
tabIndex: -1,
|
|
2265
|
+
style: Ft
|
|
2266
|
+
});
|
|
2267
|
+
});
|
|
2268
|
+
function vi(e) {
|
|
2269
|
+
const {
|
|
2270
|
+
context: t,
|
|
2271
|
+
children: n,
|
|
2272
|
+
disabled: r = !1,
|
|
2273
|
+
order: o = ["content"],
|
|
2274
|
+
guards: s = !0,
|
|
2275
|
+
initialFocus: i = 0,
|
|
2276
|
+
returnFocus: c = !0,
|
|
2277
|
+
restoreFocus: a = !1,
|
|
2278
|
+
modal: u = !0,
|
|
2279
|
+
visuallyHiddenDismiss: l = !1,
|
|
2280
|
+
closeOnFocusOut: p = !0,
|
|
2281
|
+
outsideElementsInert: g = !1,
|
|
2282
|
+
getInsideElements: d = () => []
|
|
2283
|
+
} = e, {
|
|
2284
|
+
open: h,
|
|
2285
|
+
onOpenChange: m,
|
|
2286
|
+
events: y,
|
|
2287
|
+
dataRef: R,
|
|
2288
|
+
elements: {
|
|
2289
|
+
domReference: v,
|
|
2290
|
+
floating: x
|
|
2291
|
+
}
|
|
2292
|
+
} = t, I = ce(() => {
|
|
2293
|
+
var B;
|
|
2294
|
+
return (B = R.current.floatingContext) == null ? void 0 : B.nodeId;
|
|
2295
|
+
}), A = ce(d), k = typeof i == "number" && i < 0, N = Zt(v) && k, S = Vo(), L = S ? s : !0, F = !L || S && g, _ = xe(o), U = xe(i), V = xe(c), O = et(), w = Cr(), K = f.useRef(null), T = f.useRef(null), b = f.useRef(!1), E = f.useRef(!1), M = f.useRef(-1), G = w != null, C = Ct(x), W = ce(function(B) {
|
|
2296
|
+
return B === void 0 && (B = C), B ? At(B, lt()) : [];
|
|
2297
|
+
}), Z = ce((B) => {
|
|
2298
|
+
const z = W(B);
|
|
2299
|
+
return _.current.map((H) => v && H === "reference" ? v : C && H === "floating" ? C : z).filter(Boolean).flat();
|
|
2300
|
+
});
|
|
2301
|
+
f.useEffect(() => {
|
|
2302
|
+
if (r || !u) return;
|
|
2303
|
+
function B(H) {
|
|
2304
|
+
if (H.key === "Tab") {
|
|
2305
|
+
ue(C, Re(ae(C))) && W().length === 0 && !N && pe(H);
|
|
2306
|
+
const $ = Z(), se = De(H);
|
|
2307
|
+
_.current[0] === "reference" && se === v && (pe(H), H.shiftKey ? We($[$.length - 1]) : We($[1])), _.current[1] === "floating" && se === C && H.shiftKey && (pe(H), We($[0]));
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
const z = ae(C);
|
|
2311
|
+
return z.addEventListener("keydown", B), () => {
|
|
2312
|
+
z.removeEventListener("keydown", B);
|
|
2313
|
+
};
|
|
2314
|
+
}, [r, v, C, u, _, N, W, Z]), f.useEffect(() => {
|
|
2315
|
+
if (r || !x) return;
|
|
2316
|
+
function B(z) {
|
|
2317
|
+
const H = De(z), se = W().indexOf(H);
|
|
2318
|
+
se !== -1 && (M.current = se);
|
|
2319
|
+
}
|
|
2320
|
+
return x.addEventListener("focusin", B), () => {
|
|
2321
|
+
x.removeEventListener("focusin", B);
|
|
2322
|
+
};
|
|
2323
|
+
}, [r, x, W]), f.useEffect(() => {
|
|
2324
|
+
if (r || !p) return;
|
|
2325
|
+
function B() {
|
|
2326
|
+
E.current = !0, setTimeout(() => {
|
|
2327
|
+
E.current = !1;
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
function z(H) {
|
|
2331
|
+
const $ = H.relatedTarget, se = H.currentTarget;
|
|
2332
|
+
queueMicrotask(() => {
|
|
2333
|
+
const re = I(), me = !(ue(v, $) || ue(x, $) || ue($, x) || ue(w == null ? void 0 : w.portalNode, $) || $ != null && $.hasAttribute(Ue("focus-guard")) || O && (qe(O.nodesRef.current, re).find((ne) => {
|
|
2334
|
+
var j, ee;
|
|
2335
|
+
return ue((j = ne.context) == null ? void 0 : j.elements.floating, $) || ue((ee = ne.context) == null ? void 0 : ee.elements.domReference, $);
|
|
2336
|
+
}) || hn(O.nodesRef.current, re).find((ne) => {
|
|
2337
|
+
var j, ee, tt;
|
|
2338
|
+
return [(j = ne.context) == null ? void 0 : j.elements.floating, Ct((ee = ne.context) == null ? void 0 : ee.elements.floating)].includes($) || ((tt = ne.context) == null ? void 0 : tt.elements.domReference) === $;
|
|
2339
|
+
})));
|
|
2340
|
+
if (se === v && C && Dn(C, _), a && me && Re(ae(C)) === ae(C).body) {
|
|
2341
|
+
oe(C) && C.focus();
|
|
2342
|
+
const ne = M.current, j = W(), ee = j[ne] || j[j.length - 1] || C;
|
|
2343
|
+
oe(ee) && ee.focus();
|
|
2344
|
+
}
|
|
2345
|
+
if (R.current.insideReactTree) {
|
|
2346
|
+
R.current.insideReactTree = !1;
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
(N || !u) && $ && me && !E.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2350
|
+
$ !== Sn() && (b.current = !0, m(!1, H, "focus-out"));
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2353
|
+
if (x && oe(v))
|
|
2354
|
+
return v.addEventListener("focusout", z), v.addEventListener("pointerdown", B), x.addEventListener("focusout", z), () => {
|
|
2355
|
+
v.removeEventListener("focusout", z), v.removeEventListener("pointerdown", B), x.removeEventListener("focusout", z);
|
|
2356
|
+
};
|
|
2357
|
+
}, [r, v, x, C, u, O, w, m, p, a, W, N, I, _, R]);
|
|
2358
|
+
const fe = f.useRef(null), te = f.useRef(null), de = Pn([fe, w == null ? void 0 : w.beforeInsideRef]), Oe = Pn([te, w == null ? void 0 : w.afterInsideRef]);
|
|
2359
|
+
f.useEffect(() => {
|
|
2360
|
+
var B, z;
|
|
2361
|
+
if (r || !x) return;
|
|
2362
|
+
const H = Array.from((w == null || (B = w.portalNode) == null ? void 0 : B.querySelectorAll("[" + Ue("portal") + "]")) || []), $ = O ? hn(O.nodesRef.current, I()) : [], se = O && !u ? $.map((j) => {
|
|
2363
|
+
var ee;
|
|
2364
|
+
return (ee = j.context) == null ? void 0 : ee.elements.floating;
|
|
2365
|
+
}) : [], re = (z = $.find((j) => {
|
|
2366
|
+
var ee;
|
|
2367
|
+
return Zt(((ee = j.context) == null ? void 0 : ee.elements.domReference) || null);
|
|
2368
|
+
})) == null || (z = z.context) == null ? void 0 : z.elements.domReference, me = [x, re, ...H, ...se, ...A(), K.current, T.current, fe.current, te.current, w == null ? void 0 : w.beforeOutsideRef.current, w == null ? void 0 : w.afterOutsideRef.current, _.current.includes("reference") || N ? v : null].filter((j) => j != null), ne = u || N ? An(me, !F, F) : An(me);
|
|
2369
|
+
return () => {
|
|
2370
|
+
ne();
|
|
2371
|
+
};
|
|
2372
|
+
}, [r, v, x, u, _, w, N, L, F, O, I, A]), X(() => {
|
|
2373
|
+
if (r || !oe(C)) return;
|
|
2374
|
+
const B = ae(C), z = Re(B);
|
|
2375
|
+
queueMicrotask(() => {
|
|
2376
|
+
const H = Z(C), $ = U.current, se = (typeof $ == "number" ? H[$] : $.current) || C, re = ue(C, z);
|
|
2377
|
+
!k && !re && h && We(se, {
|
|
2378
|
+
preventScroll: se === C
|
|
2379
|
+
});
|
|
2380
|
+
});
|
|
2381
|
+
}, [r, h, C, k, Z, U]), X(() => {
|
|
2382
|
+
if (r || !C) return;
|
|
2383
|
+
const B = ae(C), z = Re(B);
|
|
2384
|
+
zo(z);
|
|
2385
|
+
function H(re) {
|
|
2386
|
+
let {
|
|
2387
|
+
reason: me,
|
|
2388
|
+
event: ne,
|
|
2389
|
+
nested: j
|
|
2390
|
+
} = re;
|
|
2391
|
+
if (["hover", "safe-polygon"].includes(me) && ne.type === "mouseleave" && (b.current = !0), me === "outside-press")
|
|
2392
|
+
if (j)
|
|
2393
|
+
b.current = !1;
|
|
2394
|
+
else if (Zn(ne) || er(ne))
|
|
2395
|
+
b.current = !1;
|
|
2396
|
+
else {
|
|
2397
|
+
let ee = !1;
|
|
2398
|
+
document.createElement("div").focus({
|
|
2399
|
+
get preventScroll() {
|
|
2400
|
+
return ee = !0, !1;
|
|
2401
|
+
}
|
|
2402
|
+
}), ee ? b.current = !1 : b.current = !0;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
y.on("openchange", H);
|
|
2406
|
+
const $ = B.createElement("span");
|
|
2407
|
+
$.setAttribute("tabindex", "-1"), $.setAttribute("aria-hidden", "true"), Object.assign($.style, Ft), G && v && v.insertAdjacentElement("afterend", $);
|
|
2408
|
+
function se() {
|
|
2409
|
+
if (typeof V.current == "boolean") {
|
|
2410
|
+
const re = v || Sn();
|
|
2411
|
+
return re && re.isConnected ? re : $;
|
|
2412
|
+
}
|
|
2413
|
+
return V.current.current || $;
|
|
2414
|
+
}
|
|
2415
|
+
return () => {
|
|
2416
|
+
y.off("openchange", H);
|
|
2417
|
+
const re = Re(B), me = ue(x, re) || O && qe(O.nodesRef.current, I()).some((j) => {
|
|
2418
|
+
var ee;
|
|
2419
|
+
return ue((ee = j.context) == null ? void 0 : ee.elements.floating, re);
|
|
2420
|
+
}), ne = se();
|
|
2421
|
+
queueMicrotask(() => {
|
|
2422
|
+
const j = Uo(ne);
|
|
2423
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2424
|
+
V.current && !b.current && oe(j) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2425
|
+
// since it likely entered a different element which should be
|
|
2426
|
+
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2427
|
+
(!(j !== re && re !== B.body) || me) && j.focus({
|
|
2428
|
+
preventScroll: !0
|
|
2429
|
+
}), $.remove();
|
|
2430
|
+
});
|
|
2431
|
+
};
|
|
2432
|
+
}, [r, x, C, V, R, y, O, G, v, I]), f.useEffect(() => {
|
|
2433
|
+
queueMicrotask(() => {
|
|
2434
|
+
b.current = !1;
|
|
2435
|
+
});
|
|
2436
|
+
}, [r]), X(() => {
|
|
2437
|
+
if (!r && w)
|
|
2438
|
+
return w.setFocusManagerState({
|
|
2439
|
+
modal: u,
|
|
2440
|
+
closeOnFocusOut: p,
|
|
2441
|
+
open: h,
|
|
2442
|
+
onOpenChange: m,
|
|
2443
|
+
domReference: v
|
|
2444
|
+
}), () => {
|
|
2445
|
+
w.setFocusManagerState(null);
|
|
2446
|
+
};
|
|
2447
|
+
}, [r, w, u, h, m, p, v]), X(() => {
|
|
2448
|
+
r || C && Dn(C, _);
|
|
2449
|
+
}, [r, C, _]);
|
|
2450
|
+
function Ke(B) {
|
|
2451
|
+
return r || !l || !u ? null : /* @__PURE__ */ ge(Go, {
|
|
2452
|
+
ref: B === "start" ? K : T,
|
|
2453
|
+
onClick: (z) => m(!1, z.nativeEvent),
|
|
2454
|
+
children: typeof l == "string" ? l : "Dismiss"
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
const Ae = !r && L && (u ? !N : !0) && (G || u);
|
|
2458
|
+
return /* @__PURE__ */ Hn(Ar, {
|
|
2459
|
+
children: [Ae && /* @__PURE__ */ ge(Ot, {
|
|
2460
|
+
"data-type": "inside",
|
|
2461
|
+
ref: de,
|
|
2462
|
+
onFocus: (B) => {
|
|
2463
|
+
if (u) {
|
|
2464
|
+
const H = Z();
|
|
2465
|
+
We(o[0] === "reference" ? H[0] : H[H.length - 1]);
|
|
2466
|
+
} else if (w != null && w.preserveTabOrder && w.portalNode)
|
|
2467
|
+
if (b.current = !1, ot(B, w.portalNode)) {
|
|
2468
|
+
const H = sr(v);
|
|
2469
|
+
H == null || H.focus();
|
|
2470
|
+
} else {
|
|
2471
|
+
var z;
|
|
2472
|
+
(z = w.beforeOutsideRef.current) == null || z.focus();
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}), !N && Ke("start"), n, Ke("end"), Ae && /* @__PURE__ */ ge(Ot, {
|
|
2476
|
+
"data-type": "inside",
|
|
2477
|
+
ref: Oe,
|
|
2478
|
+
onFocus: (B) => {
|
|
2479
|
+
if (u)
|
|
2480
|
+
We(Z()[0]);
|
|
2481
|
+
else if (w != null && w.preserveTabOrder && w.portalNode)
|
|
2482
|
+
if (p && (b.current = !0), ot(B, w.portalNode)) {
|
|
2483
|
+
const H = cr(v);
|
|
2484
|
+
H == null || H.focus();
|
|
2485
|
+
} else {
|
|
2486
|
+
var z;
|
|
2487
|
+
(z = w.afterOutsideRef.current) == null || z.focus();
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
})]
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
let vt = 0;
|
|
2494
|
+
const kn = "--floating-ui-scrollbar-width";
|
|
2495
|
+
function jo() {
|
|
2496
|
+
const e = rn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
2497
|
+
e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", s = window.innerWidth - document.documentElement.clientWidth, i = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2498
|
+
if (n.overflow = "hidden", n.setProperty(kn, s + "px"), s && (n[o] = s + "px"), t) {
|
|
2499
|
+
var a, u;
|
|
2500
|
+
const l = ((a = window.visualViewport) == null ? void 0 : a.offsetLeft) || 0, p = ((u = window.visualViewport) == null ? void 0 : u.offsetTop) || 0;
|
|
2501
|
+
Object.assign(n, {
|
|
2502
|
+
position: "fixed",
|
|
2503
|
+
top: -(c - Math.floor(p)) + "px",
|
|
2504
|
+
left: -(i - Math.floor(l)) + "px",
|
|
2505
|
+
right: "0"
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
return () => {
|
|
2509
|
+
Object.assign(n, {
|
|
2510
|
+
overflow: "",
|
|
2511
|
+
[o]: ""
|
|
2512
|
+
}), n.removeProperty(kn), t && (Object.assign(n, {
|
|
2513
|
+
position: "",
|
|
2514
|
+
top: "",
|
|
2515
|
+
left: "",
|
|
2516
|
+
right: ""
|
|
2517
|
+
}), window.scrollTo(i, c));
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
let Ln = () => {
|
|
2521
|
+
};
|
|
2522
|
+
const bi = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
2523
|
+
const {
|
|
2524
|
+
lockScroll: r = !1,
|
|
2525
|
+
...o
|
|
2526
|
+
} = t;
|
|
2527
|
+
return X(() => {
|
|
2528
|
+
if (r)
|
|
2529
|
+
return vt++, vt === 1 && (Ln = jo()), () => {
|
|
2530
|
+
vt--, vt === 0 && Ln();
|
|
2531
|
+
};
|
|
2532
|
+
}, [r]), /* @__PURE__ */ ge("div", {
|
|
2533
|
+
ref: n,
|
|
2534
|
+
...o,
|
|
2535
|
+
style: {
|
|
2536
|
+
position: "fixed",
|
|
2537
|
+
overflow: "auto",
|
|
2538
|
+
top: 0,
|
|
2539
|
+
right: 0,
|
|
2540
|
+
bottom: 0,
|
|
2541
|
+
left: 0,
|
|
2542
|
+
...o.style
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
});
|
|
2546
|
+
function Fn(e) {
|
|
2547
|
+
return oe(e.target) && e.target.tagName === "BUTTON";
|
|
2548
|
+
}
|
|
2549
|
+
function qo(e) {
|
|
2550
|
+
return oe(e.target) && e.target.tagName === "A";
|
|
2551
|
+
}
|
|
2552
|
+
function Nn(e) {
|
|
2553
|
+
return on(e);
|
|
2554
|
+
}
|
|
2555
|
+
function yi(e, t) {
|
|
2556
|
+
t === void 0 && (t = {});
|
|
2557
|
+
const {
|
|
2558
|
+
open: n,
|
|
2559
|
+
onOpenChange: r,
|
|
2560
|
+
dataRef: o,
|
|
2561
|
+
elements: {
|
|
2562
|
+
domReference: s
|
|
2563
|
+
}
|
|
2564
|
+
} = e, {
|
|
2565
|
+
enabled: i = !0,
|
|
2566
|
+
event: c = "click",
|
|
2567
|
+
toggle: a = !0,
|
|
2568
|
+
ignoreMouse: u = !1,
|
|
2569
|
+
keyboardHandlers: l = !0,
|
|
2570
|
+
stickIfOpen: p = !0
|
|
2571
|
+
} = t, g = f.useRef(), d = f.useRef(!1), h = f.useMemo(() => ({
|
|
2572
|
+
onPointerDown(m) {
|
|
2573
|
+
g.current = m.pointerType;
|
|
2574
|
+
},
|
|
2575
|
+
onMouseDown(m) {
|
|
2576
|
+
const y = g.current;
|
|
2577
|
+
m.button === 0 && c !== "click" && (it(y, !0) && u || (n && a && (!(o.current.openEvent && p) || o.current.openEvent.type === "mousedown") ? r(!1, m.nativeEvent, "click") : (m.preventDefault(), r(!0, m.nativeEvent, "click"))));
|
|
2578
|
+
},
|
|
2579
|
+
onClick(m) {
|
|
2580
|
+
const y = g.current;
|
|
2581
|
+
if (c === "mousedown" && g.current) {
|
|
2582
|
+
g.current = void 0;
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2585
|
+
it(y, !0) && u || (n && a && (!(o.current.openEvent && p) || o.current.openEvent.type === "click") ? r(!1, m.nativeEvent, "click") : r(!0, m.nativeEvent, "click"));
|
|
2586
|
+
},
|
|
2587
|
+
onKeyDown(m) {
|
|
2588
|
+
g.current = void 0, !(m.defaultPrevented || !l || Fn(m)) && (m.key === " " && !Nn(s) && (m.preventDefault(), d.current = !0), !qo(m) && m.key === "Enter" && r(!(n && a), m.nativeEvent, "click"));
|
|
2589
|
+
},
|
|
2590
|
+
onKeyUp(m) {
|
|
2591
|
+
m.defaultPrevented || !l || Fn(m) || Nn(s) || m.key === " " && d.current && (d.current = !1, r(!(n && a), m.nativeEvent, "click"));
|
|
2592
|
+
}
|
|
2593
|
+
}), [o, s, c, u, l, r, n, p, a]);
|
|
2594
|
+
return f.useMemo(() => i ? {
|
|
2595
|
+
reference: h
|
|
2596
|
+
} : {}, [i, h]);
|
|
2597
|
+
}
|
|
2598
|
+
const Yo = {
|
|
2599
|
+
pointerdown: "onPointerDown",
|
|
2600
|
+
mousedown: "onMouseDown",
|
|
2601
|
+
click: "onClick"
|
|
2602
|
+
}, Xo = {
|
|
2603
|
+
pointerdown: "onPointerDownCapture",
|
|
2604
|
+
mousedown: "onMouseDownCapture",
|
|
2605
|
+
click: "onClickCapture"
|
|
2606
|
+
}, _n = (e) => {
|
|
2607
|
+
var t, n;
|
|
2608
|
+
return {
|
|
2609
|
+
escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
|
|
2610
|
+
outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
|
|
2611
|
+
};
|
|
2612
|
+
};
|
|
2613
|
+
function xi(e, t) {
|
|
2614
|
+
t === void 0 && (t = {});
|
|
2615
|
+
const {
|
|
2616
|
+
open: n,
|
|
2617
|
+
onOpenChange: r,
|
|
2618
|
+
elements: o,
|
|
2619
|
+
dataRef: s
|
|
2620
|
+
} = e, {
|
|
2621
|
+
enabled: i = !0,
|
|
2622
|
+
escapeKey: c = !0,
|
|
2623
|
+
outsidePress: a = !0,
|
|
2624
|
+
outsidePressEvent: u = "pointerdown",
|
|
2625
|
+
referencePress: l = !1,
|
|
2626
|
+
referencePressEvent: p = "pointerdown",
|
|
2627
|
+
ancestorScroll: g = !1,
|
|
2628
|
+
bubbles: d,
|
|
2629
|
+
capture: h
|
|
2630
|
+
} = t, m = et(), y = ce(typeof a == "function" ? a : () => !1), R = typeof a == "function" ? y : a, v = f.useRef(!1), {
|
|
2631
|
+
escapeKey: x,
|
|
2632
|
+
outsidePress: I
|
|
2633
|
+
} = _n(d), {
|
|
2634
|
+
escapeKey: A,
|
|
2635
|
+
outsidePress: k
|
|
2636
|
+
} = _n(h), N = f.useRef(!1), S = f.useRef(-1), L = ce((w) => {
|
|
2637
|
+
var K;
|
|
2638
|
+
if (!n || !i || !c || w.key !== "Escape" || N.current)
|
|
2639
|
+
return;
|
|
2640
|
+
const T = (K = s.current.floatingContext) == null ? void 0 : K.nodeId, b = m ? qe(m.nodesRef.current, T) : [];
|
|
2641
|
+
if (!x && (w.stopPropagation(), b.length > 0)) {
|
|
2642
|
+
let E = !0;
|
|
2643
|
+
if (b.forEach((M) => {
|
|
2644
|
+
var G;
|
|
2645
|
+
if ((G = M.context) != null && G.open && !M.context.dataRef.current.__escapeKeyBubbles) {
|
|
2646
|
+
E = !1;
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
}), !E)
|
|
2650
|
+
return;
|
|
2651
|
+
}
|
|
2652
|
+
r(!1, Gr(w) ? w.nativeEvent : w, "escape-key");
|
|
2653
|
+
}), F = ce((w) => {
|
|
2654
|
+
var K;
|
|
2655
|
+
const T = () => {
|
|
2656
|
+
var b;
|
|
2657
|
+
L(w), (b = De(w)) == null || b.removeEventListener("keydown", T);
|
|
2658
|
+
};
|
|
2659
|
+
(K = De(w)) == null || K.addEventListener("keydown", T);
|
|
2660
|
+
}), _ = ce((w) => {
|
|
2661
|
+
var K;
|
|
2662
|
+
const T = s.current.insideReactTree;
|
|
2663
|
+
s.current.insideReactTree = !1;
|
|
2664
|
+
const b = v.current;
|
|
2665
|
+
if (v.current = !1, u === "click" && b || T || typeof R == "function" && !R(w))
|
|
2666
|
+
return;
|
|
2667
|
+
const E = De(w), M = "[" + Ue("inert") + "]", G = ae(o.floating).querySelectorAll(M);
|
|
2668
|
+
let C = Y(E) ? E : null;
|
|
2669
|
+
for (; C && !Me(C); ) {
|
|
2670
|
+
const te = Pe(C);
|
|
2671
|
+
if (Me(te) || !Y(te))
|
|
2672
|
+
break;
|
|
2673
|
+
C = te;
|
|
2674
|
+
}
|
|
2675
|
+
if (G.length && Y(E) && !Hr(E) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2676
|
+
!ue(E, o.floating) && // If the target root element contains none of the markers, then the
|
|
2677
|
+
// element was injected after the floating element rendered.
|
|
2678
|
+
Array.from(G).every((te) => !ue(C, te)))
|
|
2679
|
+
return;
|
|
2680
|
+
if (oe(E) && O) {
|
|
2681
|
+
const te = Me(E), de = we(E), Oe = /auto|scroll/, Ke = te || Oe.test(de.overflowX), Ae = te || Oe.test(de.overflowY), B = Ke && E.clientWidth > 0 && E.scrollWidth > E.clientWidth, z = Ae && E.clientHeight > 0 && E.scrollHeight > E.clientHeight, H = de.direction === "rtl", $ = z && (H ? w.offsetX <= E.offsetWidth - E.clientWidth : w.offsetX > E.clientWidth), se = B && w.offsetY > E.clientHeight;
|
|
2682
|
+
if ($ || se)
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
const W = (K = s.current.floatingContext) == null ? void 0 : K.nodeId, Z = m && qe(m.nodesRef.current, W).some((te) => {
|
|
2686
|
+
var de;
|
|
2687
|
+
return Vt(w, (de = te.context) == null ? void 0 : de.elements.floating);
|
|
2688
|
+
});
|
|
2689
|
+
if (Vt(w, o.floating) || Vt(w, o.domReference) || Z)
|
|
2690
|
+
return;
|
|
2691
|
+
const fe = m ? qe(m.nodesRef.current, W) : [];
|
|
2692
|
+
if (fe.length > 0) {
|
|
2693
|
+
let te = !0;
|
|
2694
|
+
if (fe.forEach((de) => {
|
|
2695
|
+
var Oe;
|
|
2696
|
+
if ((Oe = de.context) != null && Oe.open && !de.context.dataRef.current.__outsidePressBubbles) {
|
|
2697
|
+
te = !1;
|
|
2698
|
+
return;
|
|
2699
|
+
}
|
|
2700
|
+
}), !te)
|
|
2701
|
+
return;
|
|
2702
|
+
}
|
|
2703
|
+
r(!1, w, "outside-press");
|
|
2704
|
+
}), U = ce((w) => {
|
|
2705
|
+
var K;
|
|
2706
|
+
const T = () => {
|
|
2707
|
+
var b;
|
|
2708
|
+
_(w), (b = De(w)) == null || b.removeEventListener(u, T);
|
|
2709
|
+
};
|
|
2710
|
+
(K = De(w)) == null || K.addEventListener(u, T);
|
|
2711
|
+
});
|
|
2712
|
+
f.useEffect(() => {
|
|
2713
|
+
if (!n || !i)
|
|
2714
|
+
return;
|
|
2715
|
+
s.current.__escapeKeyBubbles = x, s.current.__outsidePressBubbles = I;
|
|
2716
|
+
let w = -1;
|
|
2717
|
+
function K(G) {
|
|
2718
|
+
r(!1, G, "ancestor-scroll");
|
|
2719
|
+
}
|
|
2720
|
+
function T() {
|
|
2721
|
+
window.clearTimeout(w), N.current = !0;
|
|
2722
|
+
}
|
|
2723
|
+
function b() {
|
|
2724
|
+
w = window.setTimeout(
|
|
2725
|
+
() => {
|
|
2726
|
+
N.current = !1;
|
|
2727
|
+
},
|
|
2728
|
+
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
2729
|
+
// Only apply to WebKit for the test to remain 0ms.
|
|
2730
|
+
St() ? 5 : 0
|
|
2731
|
+
);
|
|
2732
|
+
}
|
|
2733
|
+
const E = ae(o.floating);
|
|
2734
|
+
c && (E.addEventListener("keydown", A ? F : L, A), E.addEventListener("compositionstart", T), E.addEventListener("compositionend", b)), R && E.addEventListener(u, k ? U : _, k);
|
|
2735
|
+
let M = [];
|
|
2736
|
+
return g && (Y(o.domReference) && (M = ke(o.domReference)), Y(o.floating) && (M = M.concat(ke(o.floating))), !Y(o.reference) && o.reference && o.reference.contextElement && (M = M.concat(ke(o.reference.contextElement)))), M = M.filter((G) => {
|
|
2737
|
+
var C;
|
|
2738
|
+
return G !== ((C = E.defaultView) == null ? void 0 : C.visualViewport);
|
|
2739
|
+
}), M.forEach((G) => {
|
|
2740
|
+
G.addEventListener("scroll", K, {
|
|
2741
|
+
passive: !0
|
|
2742
|
+
});
|
|
2743
|
+
}), () => {
|
|
2744
|
+
c && (E.removeEventListener("keydown", A ? F : L, A), E.removeEventListener("compositionstart", T), E.removeEventListener("compositionend", b)), R && E.removeEventListener(u, k ? U : _, k), M.forEach((G) => {
|
|
2745
|
+
G.removeEventListener("scroll", K);
|
|
2746
|
+
}), window.clearTimeout(w);
|
|
2747
|
+
};
|
|
2748
|
+
}, [s, o, c, R, u, n, r, g, i, x, I, L, A, F, _, k, U]), f.useEffect(() => {
|
|
2749
|
+
s.current.insideReactTree = !1;
|
|
2750
|
+
}, [s, R, u]);
|
|
2751
|
+
const V = f.useMemo(() => ({
|
|
2752
|
+
onKeyDown: L,
|
|
2753
|
+
...l && {
|
|
2754
|
+
[Yo[p]]: (w) => {
|
|
2755
|
+
r(!1, w.nativeEvent, "reference-press");
|
|
2756
|
+
},
|
|
2757
|
+
...p !== "click" && {
|
|
2758
|
+
onClick(w) {
|
|
2759
|
+
r(!1, w.nativeEvent, "reference-press");
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
}), [L, r, l, p]), O = f.useMemo(() => ({
|
|
2764
|
+
onKeyDown: L,
|
|
2765
|
+
onMouseDown() {
|
|
2766
|
+
v.current = !0;
|
|
2767
|
+
},
|
|
2768
|
+
onMouseUp() {
|
|
2769
|
+
v.current = !0;
|
|
2770
|
+
},
|
|
2771
|
+
[Xo[u]]: () => {
|
|
2772
|
+
s.current.insideReactTree = !0;
|
|
2773
|
+
},
|
|
2774
|
+
onBlurCapture() {
|
|
2775
|
+
m || (ve(S), s.current.insideReactTree = !0, S.current = window.setTimeout(() => {
|
|
2776
|
+
s.current.insideReactTree = !1;
|
|
2777
|
+
}));
|
|
2778
|
+
}
|
|
2779
|
+
}), [L, u, s, m]);
|
|
2780
|
+
return f.useMemo(() => i ? {
|
|
2781
|
+
reference: V,
|
|
2782
|
+
floating: O
|
|
2783
|
+
} : {}, [i, V, O]);
|
|
2784
|
+
}
|
|
2785
|
+
function Jo(e) {
|
|
2786
|
+
const {
|
|
2787
|
+
open: t = !1,
|
|
2788
|
+
onOpenChange: n,
|
|
2789
|
+
elements: r
|
|
2790
|
+
} = e, o = Lt(), s = f.useRef({}), [i] = f.useState(() => xr()), c = Ze() != null;
|
|
2791
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2792
|
+
const d = r.reference;
|
|
2793
|
+
d && !Y(d) && _o("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2794
|
+
}
|
|
2795
|
+
const [a, u] = f.useState(r.reference), l = ce((d, h, m) => {
|
|
2796
|
+
s.current.openEvent = d ? h : void 0, i.emit("openchange", {
|
|
2797
|
+
open: d,
|
|
2798
|
+
event: h,
|
|
2799
|
+
reason: m,
|
|
2800
|
+
nested: c
|
|
2801
|
+
}), n == null || n(d, h, m);
|
|
2802
|
+
}), p = f.useMemo(() => ({
|
|
2803
|
+
setPositionReference: u
|
|
2804
|
+
}), []), g = f.useMemo(() => ({
|
|
2805
|
+
reference: a || r.reference || null,
|
|
2806
|
+
floating: r.floating || null,
|
|
2807
|
+
domReference: r.reference
|
|
2808
|
+
}), [a, r.reference, r.floating]);
|
|
2809
|
+
return f.useMemo(() => ({
|
|
2810
|
+
dataRef: s,
|
|
2811
|
+
open: t,
|
|
2812
|
+
onOpenChange: l,
|
|
2813
|
+
elements: g,
|
|
2814
|
+
events: i,
|
|
2815
|
+
floatingId: o,
|
|
2816
|
+
refs: p
|
|
2817
|
+
}), [t, l, g, i, o, p]);
|
|
2818
|
+
}
|
|
2819
|
+
function wi(e) {
|
|
2820
|
+
e === void 0 && (e = {});
|
|
2821
|
+
const {
|
|
2822
|
+
nodeId: t
|
|
2823
|
+
} = e, n = Jo({
|
|
2824
|
+
...e,
|
|
2825
|
+
elements: {
|
|
2826
|
+
reference: null,
|
|
2827
|
+
floating: null,
|
|
2828
|
+
...e.elements
|
|
2829
|
+
}
|
|
2830
|
+
}), r = e.rootContext || n, o = r.elements, [s, i] = f.useState(null), [c, a] = f.useState(null), l = (o == null ? void 0 : o.domReference) || s, p = f.useRef(null), g = et();
|
|
2831
|
+
X(() => {
|
|
2832
|
+
l && (p.current = l);
|
|
2833
|
+
}, [l]);
|
|
2834
|
+
const d = Oo({
|
|
2835
|
+
...e,
|
|
2836
|
+
elements: {
|
|
2837
|
+
...o,
|
|
2838
|
+
...c && {
|
|
2839
|
+
reference: c
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
}), h = f.useCallback((x) => {
|
|
2843
|
+
const I = Y(x) ? {
|
|
2844
|
+
getBoundingClientRect: () => x.getBoundingClientRect(),
|
|
2845
|
+
getClientRects: () => x.getClientRects(),
|
|
2846
|
+
contextElement: x
|
|
2847
|
+
} : x;
|
|
2848
|
+
a(I), d.refs.setReference(I);
|
|
2849
|
+
}, [d.refs]), m = f.useCallback((x) => {
|
|
2850
|
+
(Y(x) || x === null) && (p.current = x, i(x)), (Y(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2851
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
2852
|
+
// callback ref.
|
|
2853
|
+
x !== null && !Y(x)) && d.refs.setReference(x);
|
|
2854
|
+
}, [d.refs]), y = f.useMemo(() => ({
|
|
2855
|
+
...d.refs,
|
|
2856
|
+
setReference: m,
|
|
2857
|
+
setPositionReference: h,
|
|
2858
|
+
domReference: p
|
|
2859
|
+
}), [d.refs, m, h]), R = f.useMemo(() => ({
|
|
2860
|
+
...d.elements,
|
|
2861
|
+
domReference: l
|
|
2862
|
+
}), [d.elements, l]), v = f.useMemo(() => ({
|
|
2863
|
+
...d,
|
|
2864
|
+
...r,
|
|
2865
|
+
refs: y,
|
|
2866
|
+
elements: R,
|
|
2867
|
+
nodeId: t
|
|
2868
|
+
}), [d, y, R, t, r]);
|
|
2869
|
+
return X(() => {
|
|
2870
|
+
r.dataRef.current.floatingContext = v;
|
|
2871
|
+
const x = g == null ? void 0 : g.nodesRef.current.find((I) => I.id === t);
|
|
2872
|
+
x && (x.context = v);
|
|
2873
|
+
}), f.useMemo(() => ({
|
|
2874
|
+
...d,
|
|
2875
|
+
context: v,
|
|
2876
|
+
refs: y,
|
|
2877
|
+
elements: R
|
|
2878
|
+
}), [d, y, R, v]);
|
|
2879
|
+
}
|
|
2880
|
+
function jt() {
|
|
2881
|
+
return Vr() && Jn();
|
|
2882
|
+
}
|
|
2883
|
+
function Ri(e, t) {
|
|
2884
|
+
t === void 0 && (t = {});
|
|
2885
|
+
const {
|
|
2886
|
+
open: n,
|
|
2887
|
+
onOpenChange: r,
|
|
2888
|
+
events: o,
|
|
2889
|
+
dataRef: s,
|
|
2890
|
+
elements: i
|
|
2891
|
+
} = e, {
|
|
2892
|
+
enabled: c = !0,
|
|
2893
|
+
visibleOnly: a = !0
|
|
2894
|
+
} = t, u = f.useRef(!1), l = f.useRef(-1), p = f.useRef(!0);
|
|
2895
|
+
f.useEffect(() => {
|
|
2896
|
+
if (!c) return;
|
|
2897
|
+
const d = he(i.domReference);
|
|
2898
|
+
function h() {
|
|
2899
|
+
!n && oe(i.domReference) && i.domReference === Re(ae(i.domReference)) && (u.current = !0);
|
|
2900
|
+
}
|
|
2901
|
+
function m() {
|
|
2902
|
+
p.current = !0;
|
|
2903
|
+
}
|
|
2904
|
+
function y() {
|
|
2905
|
+
p.current = !1;
|
|
2906
|
+
}
|
|
2907
|
+
return d.addEventListener("blur", h), jt() && (d.addEventListener("keydown", m, !0), d.addEventListener("pointerdown", y, !0)), () => {
|
|
2908
|
+
d.removeEventListener("blur", h), jt() && (d.removeEventListener("keydown", m, !0), d.removeEventListener("pointerdown", y, !0));
|
|
2909
|
+
};
|
|
2910
|
+
}, [i.domReference, n, c]), f.useEffect(() => {
|
|
2911
|
+
if (!c) return;
|
|
2912
|
+
function d(h) {
|
|
2913
|
+
let {
|
|
2914
|
+
reason: m
|
|
2915
|
+
} = h;
|
|
2916
|
+
(m === "reference-press" || m === "escape-key") && (u.current = !0);
|
|
2917
|
+
}
|
|
2918
|
+
return o.on("openchange", d), () => {
|
|
2919
|
+
o.off("openchange", d);
|
|
2920
|
+
};
|
|
2921
|
+
}, [o, c]), f.useEffect(() => () => {
|
|
2922
|
+
ve(l);
|
|
2923
|
+
}, []);
|
|
2924
|
+
const g = f.useMemo(() => ({
|
|
2925
|
+
onMouseLeave() {
|
|
2926
|
+
u.current = !1;
|
|
2927
|
+
},
|
|
2928
|
+
onFocus(d) {
|
|
2929
|
+
if (u.current) return;
|
|
2930
|
+
const h = De(d.nativeEvent);
|
|
2931
|
+
if (a && Y(h)) {
|
|
2932
|
+
if (jt() && !d.relatedTarget) {
|
|
2933
|
+
if (!p.current && !on(h))
|
|
2934
|
+
return;
|
|
2935
|
+
} else if (!zr(h))
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
r(!0, d.nativeEvent, "focus");
|
|
2939
|
+
},
|
|
2940
|
+
onBlur(d) {
|
|
2941
|
+
u.current = !1;
|
|
2942
|
+
const h = d.relatedTarget, m = d.nativeEvent, y = Y(h) && h.hasAttribute(Ue("focus-guard")) && h.getAttribute("data-type") === "outside";
|
|
2943
|
+
l.current = window.setTimeout(() => {
|
|
2944
|
+
var R;
|
|
2945
|
+
const v = Re(i.domReference ? i.domReference.ownerDocument : document);
|
|
2946
|
+
!h && v === i.domReference || ue((R = s.current.floatingContext) == null ? void 0 : R.refs.floating.current, v) || ue(i.domReference, v) || y || r(!1, m, "focus");
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
}), [s, i.domReference, r, a]);
|
|
2950
|
+
return f.useMemo(() => c ? {
|
|
2951
|
+
reference: g
|
|
2952
|
+
} : {}, [c, g]);
|
|
2953
|
+
}
|
|
2954
|
+
function qt(e, t, n) {
|
|
2955
|
+
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
2956
|
+
let s = e;
|
|
2957
|
+
if (o && e) {
|
|
2958
|
+
const {
|
|
2959
|
+
[Rn]: i,
|
|
2960
|
+
[En]: c,
|
|
2961
|
+
...a
|
|
2962
|
+
} = e;
|
|
2963
|
+
s = a;
|
|
2964
|
+
}
|
|
2965
|
+
return {
|
|
2966
|
+
...n === "floating" && {
|
|
2967
|
+
tabIndex: -1,
|
|
2968
|
+
[Do]: ""
|
|
2969
|
+
},
|
|
2970
|
+
...s,
|
|
2971
|
+
...t.map((i) => {
|
|
2972
|
+
const c = i ? i[n] : null;
|
|
2973
|
+
return typeof c == "function" ? e ? c(e) : null : c;
|
|
2974
|
+
}).concat(e).reduce((i, c) => (c && Object.entries(c).forEach((a) => {
|
|
2975
|
+
let [u, l] = a;
|
|
2976
|
+
if (!(o && [Rn, En].includes(u)))
|
|
2977
|
+
if (u.indexOf("on") === 0) {
|
|
2978
|
+
if (r.has(u) || r.set(u, []), typeof l == "function") {
|
|
2979
|
+
var p;
|
|
2980
|
+
(p = r.get(u)) == null || p.push(l), i[u] = function() {
|
|
2981
|
+
for (var g, d = arguments.length, h = new Array(d), m = 0; m < d; m++)
|
|
2982
|
+
h[m] = arguments[m];
|
|
2983
|
+
return (g = r.get(u)) == null ? void 0 : g.map((y) => y(...h)).find((y) => y !== void 0);
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
} else
|
|
2987
|
+
i[u] = l;
|
|
2988
|
+
}), i), {})
|
|
2989
|
+
};
|
|
2990
|
+
}
|
|
2991
|
+
function Ei(e) {
|
|
2992
|
+
e === void 0 && (e = []);
|
|
2993
|
+
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), r = e.map((c) => c == null ? void 0 : c.item), o = f.useCallback(
|
|
2994
|
+
(c) => qt(c, e, "reference"),
|
|
2995
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2996
|
+
t
|
|
2997
|
+
), s = f.useCallback(
|
|
2998
|
+
(c) => qt(c, e, "floating"),
|
|
2999
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3000
|
+
n
|
|
3001
|
+
), i = f.useCallback(
|
|
3002
|
+
(c) => qt(c, e, "item"),
|
|
3003
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3004
|
+
r
|
|
3005
|
+
);
|
|
3006
|
+
return f.useMemo(() => ({
|
|
3007
|
+
getReferenceProps: o,
|
|
3008
|
+
getFloatingProps: s,
|
|
3009
|
+
getItemProps: i
|
|
3010
|
+
}), [o, s, i]);
|
|
3011
|
+
}
|
|
3012
|
+
const Qo = "Escape";
|
|
3013
|
+
function Nt(e, t, n) {
|
|
3014
|
+
switch (e) {
|
|
3015
|
+
case "vertical":
|
|
3016
|
+
return t;
|
|
3017
|
+
case "horizontal":
|
|
3018
|
+
return n;
|
|
3019
|
+
default:
|
|
3020
|
+
return t || n;
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
function bt(e, t) {
|
|
3024
|
+
return Nt(t, e === st || e === Le, e === Fe || e === Ne);
|
|
3025
|
+
}
|
|
3026
|
+
function Yt(e, t, n) {
|
|
3027
|
+
return Nt(t, e === Le, n ? e === Fe : e === Ne) || e === "Enter" || e === " " || e === "";
|
|
3028
|
+
}
|
|
3029
|
+
function Kn(e, t, n) {
|
|
3030
|
+
return Nt(t, n ? e === Fe : e === Ne, e === Le);
|
|
3031
|
+
}
|
|
3032
|
+
function Vn(e, t, n, r) {
|
|
3033
|
+
const o = n ? e === Ne : e === Fe, s = e === st;
|
|
3034
|
+
return t === "both" || t === "horizontal" && r && r > 1 ? e === Qo : Nt(t, o, s);
|
|
3035
|
+
}
|
|
3036
|
+
function Ii(e, t) {
|
|
3037
|
+
const {
|
|
3038
|
+
open: n,
|
|
3039
|
+
onOpenChange: r,
|
|
3040
|
+
elements: o,
|
|
3041
|
+
floatingId: s
|
|
3042
|
+
} = e, {
|
|
3043
|
+
listRef: i,
|
|
3044
|
+
activeIndex: c,
|
|
3045
|
+
onNavigate: a = () => {
|
|
3046
|
+
},
|
|
3047
|
+
enabled: u = !0,
|
|
3048
|
+
selectedIndex: l = null,
|
|
3049
|
+
allowEscape: p = !1,
|
|
3050
|
+
loop: g = !1,
|
|
3051
|
+
nested: d = !1,
|
|
3052
|
+
rtl: h = !1,
|
|
3053
|
+
virtual: m = !1,
|
|
3054
|
+
focusItemOnOpen: y = "auto",
|
|
3055
|
+
focusItemOnHover: R = !0,
|
|
3056
|
+
openOnArrowKeyDown: v = !0,
|
|
3057
|
+
disabledIndices: x = void 0,
|
|
3058
|
+
orientation: I = "vertical",
|
|
3059
|
+
parentOrientation: A,
|
|
3060
|
+
cols: k = 1,
|
|
3061
|
+
scrollItemIntoView: N = !0,
|
|
3062
|
+
virtualItemRef: S,
|
|
3063
|
+
itemSizes: L,
|
|
3064
|
+
dense: F = !1
|
|
3065
|
+
} = t;
|
|
3066
|
+
process.env.NODE_ENV !== "production" && (p && (g || Ht("`useListNavigation` looping must be enabled to allow escaping."), m || Ht("`useListNavigation` must be virtual to allow escaping.")), I === "vertical" && k > 1 && Ht("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
3067
|
+
const _ = Ct(o.floating), U = xe(_), V = Ze(), O = et();
|
|
3068
|
+
X(() => {
|
|
3069
|
+
e.dataRef.current.orientation = I;
|
|
3070
|
+
}, [e, I]);
|
|
3071
|
+
const w = ce(() => {
|
|
3072
|
+
a(b.current === -1 ? null : b.current);
|
|
3073
|
+
}), K = Zt(o.domReference), T = f.useRef(y), b = f.useRef(l ?? -1), E = f.useRef(null), M = f.useRef(!0), G = f.useRef(w), C = f.useRef(!!o.floating), W = f.useRef(n), Z = f.useRef(!1), fe = f.useRef(!1), te = xe(x), de = xe(n), Oe = xe(N), Ke = xe(l), [Ae, B] = f.useState(), [z, H] = f.useState(), $ = ce(() => {
|
|
3074
|
+
function D(Q) {
|
|
3075
|
+
if (m) {
|
|
3076
|
+
var ie;
|
|
3077
|
+
(ie = Q.id) != null && ie.endsWith("-fui-option") && (Q.id = s + "-" + Math.random().toString(16).slice(2, 10)), B(Q.id), O == null || O.events.emit("virtualfocus", Q), S && (S.current = Q);
|
|
3078
|
+
} else
|
|
3079
|
+
We(Q, {
|
|
3080
|
+
sync: Z.current,
|
|
3081
|
+
preventScroll: !0
|
|
3082
|
+
});
|
|
3083
|
+
}
|
|
3084
|
+
const q = i.current[b.current], P = fe.current;
|
|
3085
|
+
q && D(q), (Z.current ? (Q) => Q() : requestAnimationFrame)(() => {
|
|
3086
|
+
const Q = i.current[b.current] || q;
|
|
3087
|
+
if (!Q) return;
|
|
3088
|
+
q || D(Q);
|
|
3089
|
+
const ie = Oe.current;
|
|
3090
|
+
ie && re && (P || !M.current) && (Q.scrollIntoView == null || Q.scrollIntoView(typeof ie == "boolean" ? {
|
|
3091
|
+
block: "nearest",
|
|
3092
|
+
inline: "nearest"
|
|
3093
|
+
} : ie));
|
|
3094
|
+
});
|
|
3095
|
+
});
|
|
3096
|
+
X(() => {
|
|
3097
|
+
u && (n && o.floating ? T.current && l != null && (fe.current = !0, b.current = l, w()) : C.current && (b.current = -1, G.current()));
|
|
3098
|
+
}, [u, n, o.floating, l, w]), X(() => {
|
|
3099
|
+
if (u && n && o.floating)
|
|
3100
|
+
if (c == null) {
|
|
3101
|
+
if (Z.current = !1, Ke.current != null)
|
|
3102
|
+
return;
|
|
3103
|
+
if (C.current && (b.current = -1, $()), (!W.current || !C.current) && T.current && (E.current != null || T.current === !0 && E.current == null)) {
|
|
3104
|
+
let D = 0;
|
|
3105
|
+
const q = () => {
|
|
3106
|
+
i.current[0] == null ? (D < 2 && (D ? requestAnimationFrame : queueMicrotask)(q), D++) : (b.current = E.current == null || Yt(E.current, I, h) || d ? yt(i, te.current) : en(i, te.current), E.current = null, w());
|
|
3107
|
+
};
|
|
3108
|
+
q();
|
|
3109
|
+
}
|
|
3110
|
+
} else Ye(i, c) || (b.current = c, $(), fe.current = !1);
|
|
3111
|
+
}, [u, n, o.floating, c, Ke, d, i, I, h, w, $, te]), X(() => {
|
|
3112
|
+
var D;
|
|
3113
|
+
if (!u || o.floating || !O || m || !C.current)
|
|
3114
|
+
return;
|
|
3115
|
+
const q = O.nodesRef.current, P = (D = q.find((ie) => ie.id === V)) == null || (D = D.context) == null ? void 0 : D.elements.floating, J = Re(ae(o.floating)), Q = q.some((ie) => ie.context && ue(ie.context.elements.floating, J));
|
|
3116
|
+
P && !Q && M.current && P.focus({
|
|
3117
|
+
preventScroll: !0
|
|
3118
|
+
});
|
|
3119
|
+
}, [u, o.floating, O, V, m]), X(() => {
|
|
3120
|
+
if (!u || !O || !m || V) return;
|
|
3121
|
+
function D(q) {
|
|
3122
|
+
H(q.id), S && (S.current = q);
|
|
3123
|
+
}
|
|
3124
|
+
return O.events.on("virtualfocus", D), () => {
|
|
3125
|
+
O.events.off("virtualfocus", D);
|
|
3126
|
+
};
|
|
3127
|
+
}, [u, O, m, V, S]), X(() => {
|
|
3128
|
+
G.current = w, W.current = n, C.current = !!o.floating;
|
|
3129
|
+
}), X(() => {
|
|
3130
|
+
n || (E.current = null, T.current = y);
|
|
3131
|
+
}, [n, y]);
|
|
3132
|
+
const se = c != null, re = f.useMemo(() => {
|
|
3133
|
+
function D(P) {
|
|
3134
|
+
if (!de.current) return;
|
|
3135
|
+
const J = i.current.indexOf(P);
|
|
3136
|
+
J !== -1 && b.current !== J && (b.current = J, w());
|
|
3137
|
+
}
|
|
3138
|
+
return {
|
|
3139
|
+
onFocus(P) {
|
|
3140
|
+
let {
|
|
3141
|
+
currentTarget: J
|
|
3142
|
+
} = P;
|
|
3143
|
+
Z.current = !0, D(J);
|
|
3144
|
+
},
|
|
3145
|
+
onClick: (P) => {
|
|
3146
|
+
let {
|
|
3147
|
+
currentTarget: J
|
|
3148
|
+
} = P;
|
|
3149
|
+
return J.focus({
|
|
3150
|
+
preventScroll: !0
|
|
3151
|
+
});
|
|
3152
|
+
},
|
|
3153
|
+
// Safari
|
|
3154
|
+
...R && {
|
|
3155
|
+
onMouseMove(P) {
|
|
3156
|
+
let {
|
|
3157
|
+
currentTarget: J
|
|
3158
|
+
} = P;
|
|
3159
|
+
Z.current = !0, fe.current = !1, D(J);
|
|
3160
|
+
},
|
|
3161
|
+
onPointerLeave(P) {
|
|
3162
|
+
let {
|
|
3163
|
+
pointerType: J
|
|
3164
|
+
} = P;
|
|
3165
|
+
if (!(!M.current || J === "touch") && (Z.current = !0, b.current = -1, w(), !m)) {
|
|
3166
|
+
var Q;
|
|
3167
|
+
(Q = U.current) == null || Q.focus({
|
|
3168
|
+
preventScroll: !0
|
|
3169
|
+
});
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
};
|
|
3174
|
+
}, [de, U, R, i, w, m]), me = f.useCallback(() => {
|
|
3175
|
+
var D;
|
|
3176
|
+
return A ?? (O == null || (D = O.nodesRef.current.find((q) => q.id === V)) == null || (D = D.context) == null || (D = D.dataRef) == null ? void 0 : D.current.orientation);
|
|
3177
|
+
}, [V, O, A]), ne = ce((D) => {
|
|
3178
|
+
if (M.current = !1, Z.current = !0, D.which === 229 || !de.current && D.currentTarget === U.current)
|
|
3179
|
+
return;
|
|
3180
|
+
if (d && Vn(D.key, I, h, k)) {
|
|
3181
|
+
bt(D.key, me()) || pe(D), r(!1, D.nativeEvent, "list-navigation"), oe(o.domReference) && (m ? O == null || O.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
|
|
3182
|
+
return;
|
|
3183
|
+
}
|
|
3184
|
+
const q = b.current, P = yt(i, x), J = en(i, x);
|
|
3185
|
+
if (K || (D.key === "Home" && (pe(D), b.current = P, w()), D.key === "End" && (pe(D), b.current = J, w())), k > 1) {
|
|
3186
|
+
const Q = L || Array.from({
|
|
3187
|
+
length: i.current.length
|
|
3188
|
+
}, () => ({
|
|
3189
|
+
width: 1,
|
|
3190
|
+
height: 1
|
|
3191
|
+
})), ie = nr(Q, k, F), nt = ie.findIndex((ye) => ye != null && !Be(i, ye, x)), at = ie.reduce((ye, Ve, ft) => Ve != null && !Be(i, Ve, x) ? ft : ye, -1), rt = ie[tr({
|
|
3192
|
+
current: ie.map((ye) => ye != null ? i.current[ye] : null)
|
|
3193
|
+
}, {
|
|
3194
|
+
event: D,
|
|
3195
|
+
orientation: I,
|
|
3196
|
+
loop: g,
|
|
3197
|
+
rtl: h,
|
|
3198
|
+
cols: k,
|
|
3199
|
+
// treat undefined (empty grid spaces) as disabled indices so we
|
|
3200
|
+
// don't end up in them
|
|
3201
|
+
disabledIndices: or([...(typeof x != "function" ? x : null) || i.current.map((ye, Ve) => Be(i, Ve, x) ? Ve : void 0), void 0], ie),
|
|
3202
|
+
minIndex: nt,
|
|
3203
|
+
maxIndex: at,
|
|
3204
|
+
prevIndex: rr(
|
|
3205
|
+
b.current > J ? P : b.current,
|
|
3206
|
+
Q,
|
|
3207
|
+
ie,
|
|
3208
|
+
k,
|
|
3209
|
+
// use a corner matching the edge closest to the direction
|
|
3210
|
+
// we're moving in so we don't end up in the same item. Prefer
|
|
3211
|
+
// top/left over bottom/right.
|
|
3212
|
+
D.key === Le ? "bl" : D.key === (h ? Fe : Ne) ? "tr" : "tl"
|
|
3213
|
+
),
|
|
3214
|
+
stopEvent: !0
|
|
3215
|
+
})];
|
|
3216
|
+
if (rt != null && (b.current = rt, w()), I === "both")
|
|
3217
|
+
return;
|
|
3218
|
+
}
|
|
3219
|
+
if (bt(D.key, I)) {
|
|
3220
|
+
if (pe(D), n && !m && Re(D.currentTarget.ownerDocument) === D.currentTarget) {
|
|
3221
|
+
b.current = Yt(D.key, I, h) ? P : J, w();
|
|
3222
|
+
return;
|
|
3223
|
+
}
|
|
3224
|
+
Yt(D.key, I, h) ? g ? b.current = q >= J ? p && q !== i.current.length ? -1 : P : le(i, {
|
|
3225
|
+
startingIndex: q,
|
|
3226
|
+
disabledIndices: x
|
|
3227
|
+
}) : b.current = Math.min(J, le(i, {
|
|
3228
|
+
startingIndex: q,
|
|
3229
|
+
disabledIndices: x
|
|
3230
|
+
})) : g ? b.current = q <= P ? p && q !== -1 ? i.current.length : J : le(i, {
|
|
3231
|
+
startingIndex: q,
|
|
3232
|
+
decrement: !0,
|
|
3233
|
+
disabledIndices: x
|
|
3234
|
+
}) : b.current = Math.max(P, le(i, {
|
|
3235
|
+
startingIndex: q,
|
|
3236
|
+
decrement: !0,
|
|
3237
|
+
disabledIndices: x
|
|
3238
|
+
})), Ye(i, b.current) && (b.current = -1), w();
|
|
3239
|
+
}
|
|
3240
|
+
}), j = f.useMemo(() => m && n && se && {
|
|
3241
|
+
"aria-activedescendant": z || Ae
|
|
3242
|
+
}, [m, n, se, z, Ae]), ee = f.useMemo(() => ({
|
|
3243
|
+
"aria-orientation": I === "both" ? void 0 : I,
|
|
3244
|
+
...K ? {} : j,
|
|
3245
|
+
onKeyDown: ne,
|
|
3246
|
+
onPointerMove() {
|
|
3247
|
+
M.current = !0;
|
|
3248
|
+
}
|
|
3249
|
+
}), [j, ne, I, K]), tt = f.useMemo(() => {
|
|
3250
|
+
function D(P) {
|
|
3251
|
+
y === "auto" && Zn(P.nativeEvent) && (T.current = !0);
|
|
3252
|
+
}
|
|
3253
|
+
function q(P) {
|
|
3254
|
+
T.current = y, y === "auto" && er(P.nativeEvent) && (T.current = !0);
|
|
3255
|
+
}
|
|
3256
|
+
return {
|
|
3257
|
+
...j,
|
|
3258
|
+
onKeyDown(P) {
|
|
3259
|
+
M.current = !1;
|
|
3260
|
+
const J = P.key.startsWith("Arrow"), Q = ["Home", "End"].includes(P.key), ie = J || Q, nt = Kn(P.key, I, h), at = Vn(P.key, I, h, k), rt = Kn(P.key, me(), h), ye = bt(P.key, I), Ve = (d ? rt : ye) || P.key === "Enter" || P.key.trim() === "";
|
|
3261
|
+
if (m && n) {
|
|
3262
|
+
const dt = O == null ? void 0 : O.nodesRef.current.find((mt) => mt.parentId == null), Se = O && dt ? Ur(O.nodesRef.current, dt.id) : null;
|
|
3263
|
+
if (ie && Se && S) {
|
|
3264
|
+
const mt = new KeyboardEvent("keydown", {
|
|
3265
|
+
key: P.key,
|
|
3266
|
+
bubbles: !0
|
|
3267
|
+
});
|
|
3268
|
+
if (nt || at) {
|
|
3269
|
+
var ft, un;
|
|
3270
|
+
const Tr = ((ft = Se.context) == null ? void 0 : ft.elements.domReference) === P.currentTarget, an = at && !Tr ? (un = Se.context) == null ? void 0 : un.elements.domReference : nt ? i.current.find((fn) => (fn == null ? void 0 : fn.id) === Ae) : null;
|
|
3271
|
+
an && (pe(P), an.dispatchEvent(mt), H(void 0));
|
|
3272
|
+
}
|
|
3273
|
+
if ((ye || Q) && Se.context && Se.context.open && Se.parentId && P.currentTarget !== Se.context.elements.domReference) {
|
|
3274
|
+
var ln;
|
|
3275
|
+
pe(P), (ln = Se.context.elements.domReference) == null || ln.dispatchEvent(mt);
|
|
3276
|
+
return;
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
return ne(P);
|
|
3280
|
+
}
|
|
3281
|
+
if (!(!n && !v && J)) {
|
|
3282
|
+
if (Ve) {
|
|
3283
|
+
const dt = bt(P.key, me());
|
|
3284
|
+
E.current = d && dt ? null : P.key;
|
|
3285
|
+
}
|
|
3286
|
+
if (d) {
|
|
3287
|
+
rt && (pe(P), n ? (b.current = yt(i, te.current), w()) : r(!0, P.nativeEvent, "list-navigation"));
|
|
3288
|
+
return;
|
|
3289
|
+
}
|
|
3290
|
+
ye && (l != null && (b.current = l), pe(P), !n && v ? r(!0, P.nativeEvent, "list-navigation") : ne(P), n && w());
|
|
3291
|
+
}
|
|
3292
|
+
},
|
|
3293
|
+
onFocus() {
|
|
3294
|
+
n && !m && (b.current = -1, w());
|
|
3295
|
+
},
|
|
3296
|
+
onPointerDown: q,
|
|
3297
|
+
onPointerEnter: q,
|
|
3298
|
+
onMouseDown: D,
|
|
3299
|
+
onClick: D
|
|
3300
|
+
};
|
|
3301
|
+
}, [Ae, j, k, ne, te, y, i, d, w, r, n, v, I, me, h, l, O, m, S]);
|
|
3302
|
+
return f.useMemo(() => u ? {
|
|
3303
|
+
reference: tt,
|
|
3304
|
+
floating: ee,
|
|
3305
|
+
item: re
|
|
3306
|
+
} : {}, [u, tt, ee, re]);
|
|
3307
|
+
}
|
|
3308
|
+
const Zo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
3309
|
+
function Ci(e, t) {
|
|
3310
|
+
var n, r;
|
|
3311
|
+
t === void 0 && (t = {});
|
|
3312
|
+
const {
|
|
3313
|
+
open: o,
|
|
3314
|
+
elements: s,
|
|
3315
|
+
floatingId: i
|
|
3316
|
+
} = e, {
|
|
3317
|
+
enabled: c = !0,
|
|
3318
|
+
role: a = "dialog"
|
|
3319
|
+
} = t, u = Lt(), l = ((n = s.domReference) == null ? void 0 : n.id) || u, p = f.useMemo(() => {
|
|
3320
|
+
var v;
|
|
3321
|
+
return ((v = Ct(s.floating)) == null ? void 0 : v.id) || i;
|
|
3322
|
+
}, [s.floating, i]), g = (r = Zo.get(a)) != null ? r : a, h = Ze() != null, m = f.useMemo(() => g === "tooltip" || a === "label" ? {
|
|
3323
|
+
["aria-" + (a === "label" ? "labelledby" : "describedby")]: o ? p : void 0
|
|
3324
|
+
} : {
|
|
3325
|
+
"aria-expanded": o ? "true" : "false",
|
|
3326
|
+
"aria-haspopup": g === "alertdialog" ? "dialog" : g,
|
|
3327
|
+
"aria-controls": o ? p : void 0,
|
|
3328
|
+
...g === "listbox" && {
|
|
3329
|
+
role: "combobox"
|
|
3330
|
+
},
|
|
3331
|
+
...g === "menu" && {
|
|
3332
|
+
id: l
|
|
3333
|
+
},
|
|
3334
|
+
...g === "menu" && h && {
|
|
3335
|
+
role: "menuitem"
|
|
3336
|
+
},
|
|
3337
|
+
...a === "select" && {
|
|
3338
|
+
"aria-autocomplete": "none"
|
|
3339
|
+
},
|
|
3340
|
+
...a === "combobox" && {
|
|
3341
|
+
"aria-autocomplete": "list"
|
|
3342
|
+
}
|
|
3343
|
+
}, [g, p, h, o, l, a]), y = f.useMemo(() => {
|
|
3344
|
+
const v = {
|
|
3345
|
+
id: p,
|
|
3346
|
+
...g && {
|
|
3347
|
+
role: g
|
|
3348
|
+
}
|
|
3349
|
+
};
|
|
3350
|
+
return g === "tooltip" || a === "label" ? v : {
|
|
3351
|
+
...v,
|
|
3352
|
+
...g === "menu" && {
|
|
3353
|
+
"aria-labelledby": l
|
|
3354
|
+
}
|
|
3355
|
+
};
|
|
3356
|
+
}, [g, p, l, a]), R = f.useCallback((v) => {
|
|
3357
|
+
let {
|
|
3358
|
+
active: x,
|
|
3359
|
+
selected: I
|
|
3360
|
+
} = v;
|
|
3361
|
+
const A = {
|
|
3362
|
+
role: "option",
|
|
3363
|
+
...x && {
|
|
3364
|
+
id: p + "-fui-option"
|
|
3365
|
+
}
|
|
3366
|
+
};
|
|
3367
|
+
switch (a) {
|
|
3368
|
+
case "select":
|
|
3369
|
+
return {
|
|
3370
|
+
...A,
|
|
3371
|
+
"aria-selected": x && I
|
|
3372
|
+
};
|
|
3373
|
+
case "combobox":
|
|
3374
|
+
return {
|
|
3375
|
+
...A,
|
|
3376
|
+
"aria-selected": I
|
|
3377
|
+
};
|
|
3378
|
+
}
|
|
3379
|
+
return {};
|
|
3380
|
+
}, [p, a]);
|
|
3381
|
+
return f.useMemo(() => c ? {
|
|
3382
|
+
reference: m,
|
|
3383
|
+
floating: y,
|
|
3384
|
+
item: R
|
|
3385
|
+
} : {}, [c, m, y, R]);
|
|
3386
|
+
}
|
|
3387
|
+
function ei(e, t) {
|
|
3388
|
+
const [n, r] = f.useState(e);
|
|
3389
|
+
return e && !n && r(!0), f.useEffect(() => {
|
|
3390
|
+
if (!e && n) {
|
|
3391
|
+
const o = setTimeout(() => r(!1), t);
|
|
3392
|
+
return () => clearTimeout(o);
|
|
3393
|
+
}
|
|
3394
|
+
}, [e, n, t]), n;
|
|
3395
|
+
}
|
|
3396
|
+
function Ti(e, t) {
|
|
3397
|
+
t === void 0 && (t = {});
|
|
3398
|
+
const {
|
|
3399
|
+
open: n,
|
|
3400
|
+
elements: {
|
|
3401
|
+
floating: r
|
|
3402
|
+
}
|
|
3403
|
+
} = e, {
|
|
3404
|
+
duration: o = 250
|
|
3405
|
+
} = t, i = (typeof o == "number" ? o : o.close) || 0, [c, a] = f.useState("unmounted"), u = ei(n, i);
|
|
3406
|
+
return !u && c === "close" && a("unmounted"), X(() => {
|
|
3407
|
+
if (r) {
|
|
3408
|
+
if (n) {
|
|
3409
|
+
a("initial");
|
|
3410
|
+
const l = requestAnimationFrame(() => {
|
|
3411
|
+
tn.flushSync(() => {
|
|
3412
|
+
a("open");
|
|
3413
|
+
});
|
|
3414
|
+
});
|
|
3415
|
+
return () => {
|
|
3416
|
+
cancelAnimationFrame(l);
|
|
3417
|
+
};
|
|
3418
|
+
}
|
|
3419
|
+
a("close");
|
|
3420
|
+
}
|
|
3421
|
+
}, [n, r]), {
|
|
3422
|
+
isMounted: u,
|
|
3423
|
+
status: c
|
|
3424
|
+
};
|
|
3425
|
+
}
|
|
3426
|
+
export {
|
|
3427
|
+
ai as C,
|
|
3428
|
+
pi as F,
|
|
3429
|
+
fi as a,
|
|
3430
|
+
li as b,
|
|
3431
|
+
ui as c,
|
|
3432
|
+
wi as d,
|
|
3433
|
+
yi as e,
|
|
3434
|
+
ci as f,
|
|
3435
|
+
xi as g,
|
|
3436
|
+
Ci as h,
|
|
3437
|
+
Ei as i,
|
|
3438
|
+
oi as j,
|
|
3439
|
+
Ze as k,
|
|
3440
|
+
di as l,
|
|
3441
|
+
mi as m,
|
|
3442
|
+
hi as n,
|
|
3443
|
+
ii as o,
|
|
3444
|
+
Po as p,
|
|
3445
|
+
vi as q,
|
|
3446
|
+
Ii as r,
|
|
3447
|
+
si as s,
|
|
3448
|
+
gi as t,
|
|
3449
|
+
So as u,
|
|
3450
|
+
Ri as v,
|
|
3451
|
+
Ti as w,
|
|
3452
|
+
bi as x
|
|
3453
|
+
};
|