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