@koide-labs/ui 0.0.0 → 0.0.2
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 +53 -3
- package/{src/-types.ts → dist/-types.d.ts} +1 -6
- package/dist/-types.js +1 -0
- package/dist/-utils.d.ts +19 -0
- package/dist/-utils.js +33 -0
- package/dist/Button-DrPFFzo7.js +31 -0
- package/dist/CompositeRoot-CVk5a-pR.js +233 -0
- package/dist/DirectionContext-C2o_MF_i.js +9 -0
- package/dist/FieldItemContext-DAvk99to.js +11 -0
- package/dist/FloatingPortal-tWyuKRSN.js +435 -0
- package/dist/FloatingPortalLite-DVyq6YhV.js +28 -0
- package/dist/InternalBackdrop-jYAiOJ8v.js +574 -0
- package/dist/LabelableContext-BMvjVwor.js +169 -0
- package/dist/ToolbarRootContext-CvvL0Tk1.js +9 -0
- package/dist/clamp-D0KDAQIz.js +6 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/accordion/index.d.ts +12 -0
- package/dist/components/accordion/index.js +699 -0
- package/dist/components/alert-dialog/index.d.ts +26 -0
- package/dist/components/alert-dialog/index.js +136 -0
- package/dist/components/anchor/index.d.ts +8 -0
- package/dist/components/anchor/index.js +38 -0
- package/dist/components/avatar/index.d.ts +21 -0
- package/dist/components/avatar/index.js +161 -0
- package/dist/components/badge/index.d.ts +16 -0
- package/dist/components/badge/index.js +40 -0
- package/dist/components/button/index.d.ts +24 -0
- package/dist/components/button/index.js +47 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +269 -0
- package/dist/components/code/index.d.ts +9 -0
- package/dist/components/code/index.js +10 -0
- package/dist/components/collapse/index.d.ts +11 -0
- package/dist/components/collapse/index.js +41 -0
- package/dist/components/command/index.d.ts +14 -0
- package/dist/components/command/index.js +1695 -0
- package/dist/components/context-menu/index.d.ts +42 -0
- package/dist/components/context-menu/index.js +1444 -0
- package/dist/components/dialog/index.d.ts +48 -0
- package/dist/components/dialog/index.js +138 -0
- package/dist/components/heading/index.d.ts +44 -0
- package/dist/components/heading/index.js +56 -0
- package/dist/components/icon/icon-names.d.ts +1 -0
- package/dist/components/icon/icon-names.js +1 -0
- package/dist/components/icon/index.d.ts +24 -0
- package/dist/components/icon/index.js +43 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/icon-button/index.js +45 -0
- package/dist/components/inline-code/index.d.ts +6 -0
- package/dist/components/inline-code/index.js +22 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +119 -0
- package/dist/components/meter/index.d.ts +18 -0
- package/dist/components/meter/index.js +165 -0
- package/dist/components/multiline-input/index.d.ts +6 -0
- package/dist/components/multiline-input/index.js +100 -0
- package/dist/components/number-input/index.d.ts +10 -0
- package/dist/components/number-input/index.js +1169 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +29 -0
- package/dist/components/pill/index.d.ts +13 -0
- package/dist/components/pill/index.js +38 -0
- package/dist/components/popover/index.d.ts +21 -0
- package/dist/components/popover/index.js +636 -0
- package/dist/components/preview-card/index.d.ts +17 -0
- package/dist/components/preview-card/index.js +402 -0
- package/dist/components/radio/index.d.ts +13 -0
- package/dist/components/radio/index.js +404 -0
- package/dist/components/search-bar/index.d.ts +12 -0
- package/dist/components/search-bar/index.js +48 -0
- package/dist/components/select/index.d.ts +16 -0
- package/dist/components/select/index.js +1263 -0
- package/dist/components/separator/index.d.ts +7 -0
- package/dist/components/separator/index.js +6 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/index.js +902 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +14 -0
- package/dist/components/stacked-avatars/index.js +92 -0
- package/dist/components/status-banner/index.d.ts +17 -0
- package/dist/components/status-banner/index.js +69 -0
- package/dist/components/surface/index.d.ts +27 -0
- package/dist/components/surface/index.js +41 -0
- package/dist/components/switch/index.d.ts +5 -0
- package/dist/components/switch/index.js +196 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +509 -0
- package/dist/components/text/index.d.ts +26 -0
- package/dist/components/text/index.js +51 -0
- package/dist/components/theme-provider/index.d.ts +2 -0
- package/dist/components/theme-provider/index.js +6 -0
- package/dist/components/theme-provider/theme-context.d.ts +9 -0
- package/dist/components/theme-provider/theme-context.js +13 -0
- package/dist/components/theme-provider/theme-provider.d.ts +17 -0
- package/dist/components/theme-provider/theme-provider.js +30 -0
- package/dist/components/timestamp/index.d.ts +23 -0
- package/dist/components/timestamp/index.js +1392 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +7 -0
- package/dist/components/toast/toast.d.ts +2 -0
- package/dist/components/toast/toast.js +878 -0
- package/dist/components/toast/use-toast-manager.d.ts +27 -0
- package/dist/components/toast/use-toast-manager.js +4 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +712 -0
- package/dist/components/tooltip/tooltip-arrow.d.ts +3 -0
- package/dist/components/tooltip/tooltip-arrow.js +6 -0
- package/dist/components/view/index.d.ts +30 -0
- package/dist/components/view/index.js +84 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/index.js +4 -0
- package/dist/composite-Bx7Szd_T.js +208 -0
- package/dist/composite-C9L5QmZL.js +66 -0
- package/dist/createBaseUIEventDetails-D8M2Yl-a.js +59 -0
- package/dist/detectBrowser-I-s3yzIE.js +43 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.module-BeF-6XAo.js +415 -0
- package/dist/element-CZEOj04G.js +80 -0
- package/dist/event-CKoGyQEJ.js +30 -0
- package/dist/floating-ui.utils-C7pRWMZ_.js +128 -0
- package/dist/floating-ui.utils.dom-C7FS5id0.js +135 -0
- package/dist/formatErrorMessage-BqPuTBN-.js +7 -0
- package/dist/formatNumber-1UNwjeqf.js +25 -0
- package/dist/getDisabledMountTransitionStyles-YfHPge6T.js +1510 -0
- package/dist/index-BX1XbbRk.js +1206 -0
- package/dist/index-CeuccO-T.js +109 -0
- package/dist/index-DN9Bn1qm.js +29 -0
- package/dist/index-FMoPxlJ2.js +52 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +108 -0
- package/dist/index10.css +1 -0
- package/dist/index11.css +1 -0
- package/dist/index12.css +1 -0
- package/dist/index13.css +1 -0
- package/dist/index14.css +1 -0
- package/dist/index15.css +1 -0
- package/dist/index16.css +1 -0
- package/dist/index17.css +1 -0
- package/dist/index18.css +1 -0
- package/dist/index19.css +1 -0
- package/dist/index2.css +1 -0
- package/dist/index20.css +1 -0
- package/dist/index21.css +1 -0
- package/dist/index22.css +1 -0
- package/dist/index23.css +1 -0
- package/dist/index24.css +1 -0
- package/dist/index25.css +1 -0
- package/dist/index26.css +1 -0
- package/dist/index27.css +1 -0
- package/dist/index28.css +1 -0
- package/dist/index29.css +1 -0
- package/dist/index3.css +1 -0
- package/dist/index30.css +1 -0
- package/dist/index31.css +1 -0
- package/dist/index32.css +1 -0
- package/dist/index33.css +1 -0
- package/dist/index34.css +1 -0
- package/dist/index35.css +1 -0
- package/dist/index36.css +1 -0
- package/dist/index37.css +1 -0
- package/dist/index4.css +1 -0
- package/dist/index5.css +1 -0
- package/dist/index6.css +1 -0
- package/dist/index7.css +1 -0
- package/dist/index8.css +1 -0
- package/dist/index9.css +1 -0
- package/dist/inertValue-BCYGsdmf.js +7 -0
- package/dist/input.css +1 -0
- package/dist/input.module-DDQY_Ij6.js +7 -0
- package/dist/integrations/react-markdown/index.d.ts +5 -0
- package/dist/integrations/react-markdown/index.js +6895 -0
- package/dist/integrations/remix/index.d.ts +9 -0
- package/{src/integrations/remix.ts → dist/integrations/remix/index.js} +7 -4
- package/dist/integrations/tailwind.css +1 -0
- package/dist/integrations/twemoij/index.d.ts +3 -0
- package/dist/integrations/twemoij/index.js +18 -0
- package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
- package/dist/owner-rKN292Q9.js +6 -0
- package/dist/safePolygon-DWy1dGKJ.js +308 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/tokens.d.ts +400 -0
- package/{src/styles/tokens.ts → dist/styles/tokens.js} +54 -96
- package/dist/toast.css +1 -0
- package/dist/tooltip-arrow-C1qXdi5T.js +24 -0
- package/dist/tooltip-arrow.css +1 -0
- package/dist/transitions.css +1 -0
- package/dist/transitions.module-CWX8e5cx.js +1343 -0
- package/dist/use-toast-manager-Dq-44AuW.js +37 -0
- package/dist/useAnimationFrame-451ugS_6.js +68 -0
- package/dist/useBaseUiId-B7WyxtIE.js +7 -0
- package/dist/useButton-DfIwsdb8.js +127 -0
- package/dist/useCompositeListItem-OkcAim_1.js +148 -0
- package/dist/useControlled-Du4sJyMj.js +31 -0
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +264 -0
- package/dist/useId-C5kyn6tA.js +22 -0
- package/dist/useIsoLayoutEffect-CIDbvm3Q.js +6 -0
- package/dist/useLabelableId-Ci_jDvmv.js +29 -0
- package/dist/useOnMount-VRW6CK2u.js +8 -0
- package/dist/useOpenChangeComplete-Dse9kY9E.js +61 -0
- package/dist/usePopupAutoResize-CNR6Ekmx.js +85 -0
- package/dist/useRender-CLx7dR_1.js +7 -0
- package/dist/useRenderElement-DwToLA61.js +244 -0
- package/dist/useRole-oDBdbuwQ.js +77 -0
- package/dist/useStableCallback-CkTrVkNX.js +29 -0
- package/dist/useSyncedFloatingRootContext-Dorsv-jf.js +167 -0
- package/dist/useTimeout-CflX-kz3.js +32 -0
- package/dist/useTransitionStatus-CUfcuGAV.js +42 -0
- package/dist/useTypeahead-D85V2IUx.js +333 -0
- package/dist/useValueAsRef-HURLzret.js +19 -0
- package/dist/useValueChanged-DL757-yD.js +14 -0
- package/dist/valueToPercent-DaP9qN4u.js +6 -0
- package/dist/view.css +1 -0
- package/dist/view.module-DfDLgJE0.js +6 -0
- package/dist/visuallyHidden-CpJ-mhai.js +16 -0
- package/dist/warn-CKtX8MLJ.js +11 -0
- package/package.json +18 -2
- package/.husky/pre-commit +0 -1
- package/.storybook/main.ts +0 -25
- package/.storybook/preview-head.html +0 -6
- package/.storybook/preview.tsx +0 -48
- package/.storybook/vitest.setup.ts +0 -8
- package/eslint.config.mjs +0 -29
- package/lint-staged.config.js +0 -15
- package/pnpm-workspace.yaml +0 -2
- package/postcss.config.mjs +0 -7
- package/prettier.config.mjs +0 -24
- package/scripts/build-icon-types.ts +0 -38
- package/src/-utils.tsx +0 -64
- package/src/components/accordion/accordion.module.css +0 -44
- package/src/components/accordion/accordion.stories.tsx +0 -36
- package/src/components/accordion/index.tsx +0 -67
- package/src/components/alert-dialog/alert-dialog.module.css +0 -5
- package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -53
- package/src/components/alert-dialog/index.tsx +0 -138
- package/src/components/anchor/anchor.module.css +0 -18
- package/src/components/anchor/anchor.stories.tsx +0 -28
- package/src/components/anchor/index.tsx +0 -45
- package/src/components/avatar/avatar.module.css +0 -56
- package/src/components/avatar/avatar.stories.tsx +0 -61
- package/src/components/avatar/index.tsx +0 -82
- package/src/components/badge/badge.module.css +0 -35
- package/src/components/badge/badge.stories.tsx +0 -60
- package/src/components/badge/index.tsx +0 -71
- package/src/components/button/button.module.css +0 -42
- package/src/components/button/button.stories.tsx +0 -108
- package/src/components/button/index.tsx +0 -63
- package/src/components/checkbox/checkbox.module.css +0 -36
- package/src/components/checkbox/checkbox.stories.tsx +0 -21
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/code/code.module.css +0 -20
- package/src/components/code/code.stories.tsx +0 -42
- package/src/components/code/index.tsx +0 -73
- package/src/components/collapse/collapse.module.css +0 -27
- package/src/components/collapse/collapse.stories.tsx +0 -27
- package/src/components/collapse/index.tsx +0 -59
- package/src/components/command/command.module.css +0 -95
- package/src/components/command/command.stories.tsx +0 -38
- package/src/components/command/index.tsx +0 -108
- package/src/components/context-menu/context-menu.module.css +0 -36
- package/src/components/context-menu/context-menu.stories.tsx +0 -99
- package/src/components/context-menu/index.tsx +0 -242
- package/src/components/dialog/dialog.module.css +0 -71
- package/src/components/dialog/dialog.stories.tsx +0 -29
- package/src/components/dialog/index.tsx +0 -148
- package/src/components/heading/heading.module.css +0 -3
- package/src/components/heading/heading.stories.tsx +0 -52
- package/src/components/heading/index.tsx +0 -112
- package/src/components/icon/icon-names.ts +0 -3189
- package/src/components/icon/icon.module.css +0 -36
- package/src/components/icon/icon.stories.tsx +0 -40
- package/src/components/icon/index.tsx +0 -60
- package/src/components/icon-button/icon-button.module.css +0 -33
- package/src/components/icon-button/icon-button.stories.tsx +0 -59
- package/src/components/icon-button/index.tsx +0 -48
- package/src/components/inline-code/index.tsx +0 -29
- package/src/components/inline-code/inline-code.module.css +0 -13
- package/src/components/inline-code/inline-code.stories.tsx +0 -31
- package/src/components/input/index.tsx +0 -22
- package/src/components/input/input.module.css +0 -23
- package/src/components/input/input.stories.tsx +0 -52
- package/src/components/meter/index.tsx +0 -55
- package/src/components/meter/meter.module.css +0 -23
- package/src/components/meter/meter.stories.tsx +0 -31
- package/src/components/multiline-input/index.tsx +0 -58
- package/src/components/multiline-input/multiline-input.stories.tsx +0 -26
- package/src/components/number-input/index.tsx +0 -74
- package/src/components/number-input/number-input.module.css +0 -41
- package/src/components/number-input/number-input.stories.tsx +0 -24
- package/src/components/password-input/index.tsx +0 -24
- package/src/components/password-input/password-input.module.css +0 -10
- package/src/components/password-input/password-input.stories.tsx +0 -24
- package/src/components/pill/index.tsx +0 -45
- package/src/components/pill/pill.module.css +0 -22
- package/src/components/pill/pill.stories.tsx +0 -83
- package/src/components/popover/index.tsx +0 -94
- package/src/components/popover/popover.module.css +0 -8
- package/src/components/popover/popover.stories.tsx +0 -53
- package/src/components/preview-card/index.tsx +0 -68
- package/src/components/preview-card/preview-card.module.css +0 -5
- package/src/components/preview-card/preview-card.stories.tsx +0 -58
- package/src/components/radio/index.tsx +0 -67
- package/src/components/radio/radio-group.module.css +0 -5
- package/src/components/radio/radio.module.css +0 -36
- package/src/components/radio/radio.stories.tsx +0 -27
- package/src/components/search-bar/index.tsx +0 -60
- package/src/components/search-bar/search-bar.module.css +0 -29
- package/src/components/search-bar/search-bar.stories.tsx +0 -37
- package/src/components/select/index.tsx +0 -132
- package/src/components/select/select.module.css +0 -63
- package/src/components/select/select.stories.tsx +0 -49
- package/src/components/separator/index.tsx +0 -28
- package/src/components/separator/separator.module.css +0 -24
- package/src/components/separator/separator.stories.tsx +0 -40
- package/src/components/slider/index.tsx +0 -28
- package/src/components/slider/slider.module.css +0 -52
- package/src/components/slider/slider.stories.tsx +0 -53
- package/src/components/spinner/index.tsx +0 -14
- package/src/components/spinner/spinner.module.css +0 -13
- package/src/components/spinner/spinner.stories.tsx +0 -17
- package/src/components/stacked-avatars/index.tsx +0 -88
- package/src/components/stacked-avatars/stacked-avatars.module.css +0 -79
- package/src/components/stacked-avatars/stacked-avatars.stories.tsx +0 -48
- package/src/components/status-banner/index.tsx +0 -96
- package/src/components/status-banner/status-banner.module.css +0 -52
- package/src/components/status-banner/status-banner.stories.tsx +0 -44
- package/src/components/surface/index.tsx +0 -83
- package/src/components/surface/surface.module.css +0 -35
- package/src/components/surface/surface.stories.tsx +0 -84
- package/src/components/switch/index.tsx +0 -23
- package/src/components/switch/switch.module.css +0 -45
- package/src/components/switch/switch.stories.tsx +0 -48
- package/src/components/tabs/index.tsx +0 -126
- package/src/components/tabs/tabs.module.css +0 -134
- package/src/components/tabs/tabs.stories.tsx +0 -88
- package/src/components/text/index.tsx +0 -69
- package/src/components/text/text.module.css +0 -76
- package/src/components/text/text.stories.tsx +0 -107
- package/src/components/theme-provider/index.ts +0 -2
- package/src/components/theme-provider/theme-context.tsx +0 -18
- package/src/components/theme-provider/theme-provider.stories.tsx +0 -47
- package/src/components/theme-provider/theme-provider.tsx +0 -77
- package/src/components/timestamp/index.tsx +0 -131
- package/src/components/timestamp/timestamp.module.css +0 -8
- package/src/components/timestamp/timestamp.stories.tsx +0 -37
- package/src/components/toast/index.ts +0 -2
- package/src/components/toast/toast.module.css +0 -163
- package/src/components/toast/toast.stories.tsx +0 -53
- package/src/components/toast/toast.tsx +0 -104
- package/src/components/toast/use-toast-manager.ts +0 -63
- package/src/components/tooltip/index.tsx +0 -61
- package/src/components/tooltip/tooltip-arrow.tsx +0 -17
- package/src/components/tooltip/tooltip.module.css +0 -44
- package/src/components/tooltip/tooltip.stories.tsx +0 -76
- package/src/components/view/index.tsx +0 -137
- package/src/components/view/view.module.css +0 -11
- package/src/components/view/view.stories.tsx +0 -131
- package/src/components/view/view_colorway.module.css +0 -280
- package/src/components/view/view_interactive.module.css +0 -127
- package/src/components/view/view_loading.module.css +0 -58
- package/src/components/visually-hidden/index.ts +0 -1
- package/src/index.ts +0 -49
- package/src/integrations/react-markdown/index.tsx +0 -134
- package/src/integrations/react-markdown/react-markdown.module.css +0 -62
- package/src/integrations/react-markdown/react-markdown.stories.tsx +0 -31
- package/src/integrations/tailwind.css +0 -173
- package/src/integrations/twemoij/index.tsx +0 -13
- package/src/integrations/twemoij/twemoji.module.css +0 -7
- package/src/integrations/twemoij/twemoji.stories.tsx +0 -40
- package/src/stories/components/all-variants.tsx +0 -40
- package/src/stories/data.ts +0 -72
- package/src/stories/utils.ts +0 -20
- package/src/styles/core.css +0 -153
- package/src/styles/themes/dark.css +0 -86
- package/src/styles/themes/light.css +0 -86
- package/src/styles/transitions.module.css +0 -31
- package/stylelint.config.mjs +0 -29
- package/tsconfig.app.json +0 -35
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -103
- package/vitest.shims.d.ts +0 -1
|
@@ -0,0 +1,1510 @@
|
|
|
1
|
+
import * as O from "react";
|
|
2
|
+
import { useLayoutEffect as qt } from "react";
|
|
3
|
+
import { e as q, g as z, a as Y, b as Ut, c as Jt, d as Kt, h as Gt, i as re, m as ue, j as _, k as bt, l as be, s as Qt, n as At, o as Ot, p as He, q as St, t as j, f as ye, r as Ae } from "./floating-ui.utils-C7pRWMZ_.js";
|
|
4
|
+
import { o as Et } from "./owner-rKN292Q9.js";
|
|
5
|
+
import { u as oe } from "./useIsoLayoutEffect-CIDbvm3Q.js";
|
|
6
|
+
import { u as ke } from "./useValueAsRef-HURLzret.js";
|
|
7
|
+
import { u as Zt } from "./useStableCallback-CkTrVkNX.js";
|
|
8
|
+
import { u as en } from "./DirectionContext-C2o_MF_i.js";
|
|
9
|
+
import { h as We, a as k, j as J, d as K, k as ut, g as U, i as G, l as Ct, m as Ve, n as de, o as Oe, p as tn, q as Pt, r as nn, f as Ie, e as _e, s as Ee } from "./floating-ui.utils.dom-C7FS5id0.js";
|
|
10
|
+
import * as on from "react-dom";
|
|
11
|
+
import { u as sn, F as rn, P as cn, a as ln } from "./transitions.module-CWX8e5cx.js";
|
|
12
|
+
import { u as an } from "./useId-C5kyn6tA.js";
|
|
13
|
+
import { a as fn, E as un } from "./useRenderElement-DwToLA61.js";
|
|
14
|
+
import { D as dn } from "./FloatingPortal-tWyuKRSN.js";
|
|
15
|
+
function dt(e, t, i) {
|
|
16
|
+
let {
|
|
17
|
+
reference: n,
|
|
18
|
+
floating: o
|
|
19
|
+
} = e;
|
|
20
|
+
const s = Y(t), r = At(t), c = Ot(r), a = z(t), f = s === "y", l = n.x + n.width / 2 - o.width / 2, u = n.y + n.height / 2 - o.height / 2, g = n[c] / 2 - o[c] / 2;
|
|
21
|
+
let d;
|
|
22
|
+
switch (a) {
|
|
23
|
+
case "top":
|
|
24
|
+
d = {
|
|
25
|
+
x: l,
|
|
26
|
+
y: n.y - o.height
|
|
27
|
+
};
|
|
28
|
+
break;
|
|
29
|
+
case "bottom":
|
|
30
|
+
d = {
|
|
31
|
+
x: l,
|
|
32
|
+
y: n.y + n.height
|
|
33
|
+
};
|
|
34
|
+
break;
|
|
35
|
+
case "right":
|
|
36
|
+
d = {
|
|
37
|
+
x: n.x + n.width,
|
|
38
|
+
y: u
|
|
39
|
+
};
|
|
40
|
+
break;
|
|
41
|
+
case "left":
|
|
42
|
+
d = {
|
|
43
|
+
x: n.x - o.width,
|
|
44
|
+
y: u
|
|
45
|
+
};
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
d = {
|
|
49
|
+
x: n.x,
|
|
50
|
+
y: n.y
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
switch (re(t)) {
|
|
54
|
+
case "start":
|
|
55
|
+
d[r] -= g * (i && f ? -1 : 1);
|
|
56
|
+
break;
|
|
57
|
+
case "end":
|
|
58
|
+
d[r] += g * (i && f ? -1 : 1);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
return d;
|
|
62
|
+
}
|
|
63
|
+
const mn = async (e, t, i) => {
|
|
64
|
+
const {
|
|
65
|
+
placement: n = "bottom",
|
|
66
|
+
strategy: o = "absolute",
|
|
67
|
+
middleware: s = [],
|
|
68
|
+
platform: r
|
|
69
|
+
} = i, c = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
70
|
+
let f = await r.getElementRects({
|
|
71
|
+
reference: e,
|
|
72
|
+
floating: t,
|
|
73
|
+
strategy: o
|
|
74
|
+
}), {
|
|
75
|
+
x: l,
|
|
76
|
+
y: u
|
|
77
|
+
} = dt(f, n, a), g = n, d = {}, m = 0;
|
|
78
|
+
for (let h = 0; h < c.length; h++) {
|
|
79
|
+
const {
|
|
80
|
+
name: x,
|
|
81
|
+
fn: w
|
|
82
|
+
} = c[h], {
|
|
83
|
+
x: y,
|
|
84
|
+
y: v,
|
|
85
|
+
data: A,
|
|
86
|
+
reset: b
|
|
87
|
+
} = await w({
|
|
88
|
+
x: l,
|
|
89
|
+
y: u,
|
|
90
|
+
initialPlacement: n,
|
|
91
|
+
placement: g,
|
|
92
|
+
strategy: o,
|
|
93
|
+
middlewareData: d,
|
|
94
|
+
rects: f,
|
|
95
|
+
platform: r,
|
|
96
|
+
elements: {
|
|
97
|
+
reference: e,
|
|
98
|
+
floating: t
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
l = y ?? l, u = v ?? u, d = {
|
|
102
|
+
...d,
|
|
103
|
+
[x]: {
|
|
104
|
+
...d[x],
|
|
105
|
+
...A
|
|
106
|
+
}
|
|
107
|
+
}, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (g = b.placement), b.rects && (f = b.rects === !0 ? await r.getElementRects({
|
|
108
|
+
reference: e,
|
|
109
|
+
floating: t,
|
|
110
|
+
strategy: o
|
|
111
|
+
}) : b.rects), {
|
|
112
|
+
x: l,
|
|
113
|
+
y: u
|
|
114
|
+
} = dt(f, g, a)), h = -1);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
x: l,
|
|
118
|
+
y: u,
|
|
119
|
+
placement: g,
|
|
120
|
+
strategy: o,
|
|
121
|
+
middlewareData: d
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
async function me(e, t) {
|
|
125
|
+
var i;
|
|
126
|
+
t === void 0 && (t = {});
|
|
127
|
+
const {
|
|
128
|
+
x: n,
|
|
129
|
+
y: o,
|
|
130
|
+
platform: s,
|
|
131
|
+
rects: r,
|
|
132
|
+
elements: c,
|
|
133
|
+
strategy: a
|
|
134
|
+
} = e, {
|
|
135
|
+
boundary: f = "clippingAncestors",
|
|
136
|
+
rootBoundary: l = "viewport",
|
|
137
|
+
elementContext: u = "floating",
|
|
138
|
+
altBoundary: g = !1,
|
|
139
|
+
padding: d = 0
|
|
140
|
+
} = q(t, e), m = bt(d), x = c[g ? u === "floating" ? "reference" : "floating" : u], w = be(await s.getClippingRect({
|
|
141
|
+
element: (i = await (s.isElement == null ? void 0 : s.isElement(x))) == null || i ? x : x.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
142
|
+
boundary: f,
|
|
143
|
+
rootBoundary: l,
|
|
144
|
+
strategy: a
|
|
145
|
+
})), y = u === "floating" ? {
|
|
146
|
+
x: n,
|
|
147
|
+
y: o,
|
|
148
|
+
width: r.floating.width,
|
|
149
|
+
height: r.floating.height
|
|
150
|
+
} : r.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), A = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
|
|
151
|
+
x: 1,
|
|
152
|
+
y: 1
|
|
153
|
+
} : {
|
|
154
|
+
x: 1,
|
|
155
|
+
y: 1
|
|
156
|
+
}, b = be(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
157
|
+
elements: c,
|
|
158
|
+
rect: y,
|
|
159
|
+
offsetParent: v,
|
|
160
|
+
strategy: a
|
|
161
|
+
}) : y);
|
|
162
|
+
return {
|
|
163
|
+
top: (w.top - b.top + m.top) / A.y,
|
|
164
|
+
bottom: (b.bottom - w.bottom + m.bottom) / A.y,
|
|
165
|
+
left: (w.left - b.left + m.left) / A.x,
|
|
166
|
+
right: (b.right - w.right + m.right) / A.x
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const gn = function(e) {
|
|
170
|
+
return e === void 0 && (e = {}), {
|
|
171
|
+
name: "flip",
|
|
172
|
+
options: e,
|
|
173
|
+
async fn(t) {
|
|
174
|
+
var i, n;
|
|
175
|
+
const {
|
|
176
|
+
placement: o,
|
|
177
|
+
middlewareData: s,
|
|
178
|
+
rects: r,
|
|
179
|
+
initialPlacement: c,
|
|
180
|
+
platform: a,
|
|
181
|
+
elements: f
|
|
182
|
+
} = t, {
|
|
183
|
+
mainAxis: l = !0,
|
|
184
|
+
crossAxis: u = !0,
|
|
185
|
+
fallbackPlacements: g,
|
|
186
|
+
fallbackStrategy: d = "bestFit",
|
|
187
|
+
fallbackAxisSideDirection: m = "none",
|
|
188
|
+
flipAlignment: h = !0,
|
|
189
|
+
...x
|
|
190
|
+
} = q(e, t);
|
|
191
|
+
if ((i = s.arrow) != null && i.alignmentOffset)
|
|
192
|
+
return {};
|
|
193
|
+
const w = z(o), y = Y(c), v = z(c) === c, A = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), b = g || (v || !h ? [Ut(c)] : Jt(c)), E = m !== "none";
|
|
194
|
+
!g && E && b.push(...Kt(c, h, m, A));
|
|
195
|
+
const R = [c, ...b], S = await me(t, x), V = [];
|
|
196
|
+
let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
197
|
+
if (l && V.push(S[w]), u) {
|
|
198
|
+
const $ = Gt(o, r, A);
|
|
199
|
+
V.push(S[$[0]], S[$[1]]);
|
|
200
|
+
}
|
|
201
|
+
if (L = [...L, {
|
|
202
|
+
placement: o,
|
|
203
|
+
overflows: V
|
|
204
|
+
}], !V.every(($) => $ <= 0)) {
|
|
205
|
+
var B, H;
|
|
206
|
+
const $ = (((B = s.flip) == null ? void 0 : B.index) || 0) + 1, D = R[$];
|
|
207
|
+
if (D && (!(u === "alignment" ? y !== Y(D) : !1) || // We leave the current main axis only if every placement on that axis
|
|
208
|
+
// overflows the main axis.
|
|
209
|
+
L.every((p) => Y(p.placement) === y ? p.overflows[0] > 0 : !0)))
|
|
210
|
+
return {
|
|
211
|
+
data: {
|
|
212
|
+
index: $,
|
|
213
|
+
overflows: L
|
|
214
|
+
},
|
|
215
|
+
reset: {
|
|
216
|
+
placement: D
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
let M = (H = L.filter((F) => F.overflows[0] <= 0).sort((F, p) => F.overflows[1] - p.overflows[1])[0]) == null ? void 0 : H.placement;
|
|
220
|
+
if (!M)
|
|
221
|
+
switch (d) {
|
|
222
|
+
case "bestFit": {
|
|
223
|
+
var P;
|
|
224
|
+
const F = (P = L.filter((p) => {
|
|
225
|
+
if (E) {
|
|
226
|
+
const C = Y(p.placement);
|
|
227
|
+
return C === y || // Create a bias to the `y` side axis due to horizontal
|
|
228
|
+
// reading directions favoring greater width.
|
|
229
|
+
C === "y";
|
|
230
|
+
}
|
|
231
|
+
return !0;
|
|
232
|
+
}).map((p) => [p.placement, p.overflows.filter((C) => C > 0).reduce((C, N) => C + N, 0)]).sort((p, C) => p[1] - C[1])[0]) == null ? void 0 : P[0];
|
|
233
|
+
F && (M = F);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
case "initialPlacement":
|
|
237
|
+
M = c;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
if (o !== M)
|
|
241
|
+
return {
|
|
242
|
+
reset: {
|
|
243
|
+
placement: M
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return {};
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
function mt(e, t) {
|
|
252
|
+
return {
|
|
253
|
+
top: e.top - t.height,
|
|
254
|
+
right: e.right - t.width,
|
|
255
|
+
bottom: e.bottom - t.height,
|
|
256
|
+
left: e.left - t.width
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function gt(e) {
|
|
260
|
+
return Qt.some((t) => e[t] >= 0);
|
|
261
|
+
}
|
|
262
|
+
const hn = function(e) {
|
|
263
|
+
return e === void 0 && (e = {}), {
|
|
264
|
+
name: "hide",
|
|
265
|
+
options: e,
|
|
266
|
+
async fn(t) {
|
|
267
|
+
const {
|
|
268
|
+
rects: i
|
|
269
|
+
} = t, {
|
|
270
|
+
strategy: n = "referenceHidden",
|
|
271
|
+
...o
|
|
272
|
+
} = q(e, t);
|
|
273
|
+
switch (n) {
|
|
274
|
+
case "referenceHidden": {
|
|
275
|
+
const s = await me(t, {
|
|
276
|
+
...o,
|
|
277
|
+
elementContext: "reference"
|
|
278
|
+
}), r = mt(s, i.reference);
|
|
279
|
+
return {
|
|
280
|
+
data: {
|
|
281
|
+
referenceHiddenOffsets: r,
|
|
282
|
+
referenceHidden: gt(r)
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
case "escaped": {
|
|
287
|
+
const s = await me(t, {
|
|
288
|
+
...o,
|
|
289
|
+
altBoundary: !0
|
|
290
|
+
}), r = mt(s, i.floating);
|
|
291
|
+
return {
|
|
292
|
+
data: {
|
|
293
|
+
escapedOffsets: r,
|
|
294
|
+
escaped: gt(r)
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
default:
|
|
299
|
+
return {};
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
}, Dt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
304
|
+
async function pn(e, t) {
|
|
305
|
+
const {
|
|
306
|
+
placement: i,
|
|
307
|
+
platform: n,
|
|
308
|
+
elements: o
|
|
309
|
+
} = e, s = await (n.isRTL == null ? void 0 : n.isRTL(o.floating)), r = z(i), c = re(i), a = Y(i) === "y", f = Dt.has(r) ? -1 : 1, l = s && a ? -1 : 1, u = q(t, e);
|
|
310
|
+
let {
|
|
311
|
+
mainAxis: g,
|
|
312
|
+
crossAxis: d,
|
|
313
|
+
alignmentAxis: m
|
|
314
|
+
} = typeof u == "number" ? {
|
|
315
|
+
mainAxis: u,
|
|
316
|
+
crossAxis: 0,
|
|
317
|
+
alignmentAxis: null
|
|
318
|
+
} : {
|
|
319
|
+
mainAxis: u.mainAxis || 0,
|
|
320
|
+
crossAxis: u.crossAxis || 0,
|
|
321
|
+
alignmentAxis: u.alignmentAxis
|
|
322
|
+
};
|
|
323
|
+
return c && typeof m == "number" && (d = c === "end" ? m * -1 : m), a ? {
|
|
324
|
+
x: d * l,
|
|
325
|
+
y: g * f
|
|
326
|
+
} : {
|
|
327
|
+
x: g * f,
|
|
328
|
+
y: d * l
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
const xn = function(e) {
|
|
332
|
+
return e === void 0 && (e = 0), {
|
|
333
|
+
name: "offset",
|
|
334
|
+
options: e,
|
|
335
|
+
async fn(t) {
|
|
336
|
+
var i, n;
|
|
337
|
+
const {
|
|
338
|
+
x: o,
|
|
339
|
+
y: s,
|
|
340
|
+
placement: r,
|
|
341
|
+
middlewareData: c
|
|
342
|
+
} = t, a = await pn(t, e);
|
|
343
|
+
return r === ((i = c.offset) == null ? void 0 : i.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
|
|
344
|
+
x: o + a.x,
|
|
345
|
+
y: s + a.y,
|
|
346
|
+
data: {
|
|
347
|
+
...a,
|
|
348
|
+
placement: r
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
}, wn = function(e) {
|
|
354
|
+
return e === void 0 && (e = {}), {
|
|
355
|
+
name: "shift",
|
|
356
|
+
options: e,
|
|
357
|
+
async fn(t) {
|
|
358
|
+
const {
|
|
359
|
+
x: i,
|
|
360
|
+
y: n,
|
|
361
|
+
placement: o
|
|
362
|
+
} = t, {
|
|
363
|
+
mainAxis: s = !0,
|
|
364
|
+
crossAxis: r = !1,
|
|
365
|
+
limiter: c = {
|
|
366
|
+
fn: (x) => {
|
|
367
|
+
let {
|
|
368
|
+
x: w,
|
|
369
|
+
y
|
|
370
|
+
} = x;
|
|
371
|
+
return {
|
|
372
|
+
x: w,
|
|
373
|
+
y
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
...a
|
|
378
|
+
} = q(e, t), f = {
|
|
379
|
+
x: i,
|
|
380
|
+
y: n
|
|
381
|
+
}, l = await me(t, a), u = Y(z(o)), g = St(u);
|
|
382
|
+
let d = f[g], m = f[u];
|
|
383
|
+
if (s) {
|
|
384
|
+
const x = g === "y" ? "top" : "left", w = g === "y" ? "bottom" : "right", y = d + l[x], v = d - l[w];
|
|
385
|
+
d = He(y, d, v);
|
|
386
|
+
}
|
|
387
|
+
if (r) {
|
|
388
|
+
const x = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", y = m + l[x], v = m - l[w];
|
|
389
|
+
m = He(y, m, v);
|
|
390
|
+
}
|
|
391
|
+
const h = c.fn({
|
|
392
|
+
...t,
|
|
393
|
+
[g]: d,
|
|
394
|
+
[u]: m
|
|
395
|
+
});
|
|
396
|
+
return {
|
|
397
|
+
...h,
|
|
398
|
+
data: {
|
|
399
|
+
x: h.x - i,
|
|
400
|
+
y: h.y - n,
|
|
401
|
+
enabled: {
|
|
402
|
+
[g]: s,
|
|
403
|
+
[u]: r
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}, yn = function(e) {
|
|
410
|
+
return e === void 0 && (e = {}), {
|
|
411
|
+
options: e,
|
|
412
|
+
fn(t) {
|
|
413
|
+
const {
|
|
414
|
+
x: i,
|
|
415
|
+
y: n,
|
|
416
|
+
placement: o,
|
|
417
|
+
rects: s,
|
|
418
|
+
middlewareData: r
|
|
419
|
+
} = t, {
|
|
420
|
+
offset: c = 0,
|
|
421
|
+
mainAxis: a = !0,
|
|
422
|
+
crossAxis: f = !0
|
|
423
|
+
} = q(e, t), l = {
|
|
424
|
+
x: i,
|
|
425
|
+
y: n
|
|
426
|
+
}, u = Y(o), g = St(u);
|
|
427
|
+
let d = l[g], m = l[u];
|
|
428
|
+
const h = q(c, t), x = typeof h == "number" ? {
|
|
429
|
+
mainAxis: h,
|
|
430
|
+
crossAxis: 0
|
|
431
|
+
} : {
|
|
432
|
+
mainAxis: 0,
|
|
433
|
+
crossAxis: 0,
|
|
434
|
+
...h
|
|
435
|
+
};
|
|
436
|
+
if (a) {
|
|
437
|
+
const v = g === "y" ? "height" : "width", A = s.reference[g] - s.floating[v] + x.mainAxis, b = s.reference[g] + s.reference[v] - x.mainAxis;
|
|
438
|
+
d < A ? d = A : d > b && (d = b);
|
|
439
|
+
}
|
|
440
|
+
if (f) {
|
|
441
|
+
var w, y;
|
|
442
|
+
const v = g === "y" ? "width" : "height", A = Dt.has(z(o)), b = s.reference[u] - s.floating[v] + (A && ((w = r.offset) == null ? void 0 : w[u]) || 0) + (A ? 0 : x.crossAxis), E = s.reference[u] + s.reference[v] + (A ? 0 : ((y = r.offset) == null ? void 0 : y[u]) || 0) - (A ? x.crossAxis : 0);
|
|
443
|
+
m < b ? m = b : m > E && (m = E);
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
[g]: d,
|
|
447
|
+
[u]: m
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
}, Rn = function(e) {
|
|
452
|
+
return e === void 0 && (e = {}), {
|
|
453
|
+
name: "size",
|
|
454
|
+
options: e,
|
|
455
|
+
async fn(t) {
|
|
456
|
+
var i, n;
|
|
457
|
+
const {
|
|
458
|
+
placement: o,
|
|
459
|
+
rects: s,
|
|
460
|
+
platform: r,
|
|
461
|
+
elements: c
|
|
462
|
+
} = t, {
|
|
463
|
+
apply: a = () => {
|
|
464
|
+
},
|
|
465
|
+
...f
|
|
466
|
+
} = q(e, t), l = await me(t, f), u = z(o), g = re(o), d = Y(o) === "y", {
|
|
467
|
+
width: m,
|
|
468
|
+
height: h
|
|
469
|
+
} = s.floating;
|
|
470
|
+
let x, w;
|
|
471
|
+
u === "top" || u === "bottom" ? (x = u, w = g === (await (r.isRTL == null ? void 0 : r.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = u, x = g === "end" ? "top" : "bottom");
|
|
472
|
+
const y = h - l.top - l.bottom, v = m - l.left - l.right, A = ue(h - l[x], y), b = ue(m - l[w], v), E = !t.middlewareData.shift;
|
|
473
|
+
let R = A, S = b;
|
|
474
|
+
if ((i = t.middlewareData.shift) != null && i.enabled.x && (S = v), (n = t.middlewareData.shift) != null && n.enabled.y && (R = y), E && !g) {
|
|
475
|
+
const L = _(l.left, 0), B = _(l.right, 0), H = _(l.top, 0), P = _(l.bottom, 0);
|
|
476
|
+
d ? S = m - 2 * (L !== 0 || B !== 0 ? L + B : _(l.left, l.right)) : R = h - 2 * (H !== 0 || P !== 0 ? H + P : _(l.top, l.bottom));
|
|
477
|
+
}
|
|
478
|
+
await a({
|
|
479
|
+
...t,
|
|
480
|
+
availableWidth: S,
|
|
481
|
+
availableHeight: R
|
|
482
|
+
});
|
|
483
|
+
const V = await r.getDimensions(c.floating);
|
|
484
|
+
return m !== V.width || h !== V.height ? {
|
|
485
|
+
reset: {
|
|
486
|
+
rects: !0
|
|
487
|
+
}
|
|
488
|
+
} : {};
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
function Mt(e) {
|
|
493
|
+
const t = U(e);
|
|
494
|
+
let i = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
|
|
495
|
+
const o = G(e), s = o ? e.offsetWidth : i, r = o ? e.offsetHeight : n, c = Ae(i) !== s || Ae(n) !== r;
|
|
496
|
+
return c && (i = s, n = r), {
|
|
497
|
+
width: i,
|
|
498
|
+
height: n,
|
|
499
|
+
$: c
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function ze(e) {
|
|
503
|
+
return k(e) ? e : e.contextElement;
|
|
504
|
+
}
|
|
505
|
+
function se(e) {
|
|
506
|
+
const t = ze(e);
|
|
507
|
+
if (!G(t))
|
|
508
|
+
return j(1);
|
|
509
|
+
const i = t.getBoundingClientRect(), {
|
|
510
|
+
width: n,
|
|
511
|
+
height: o,
|
|
512
|
+
$: s
|
|
513
|
+
} = Mt(t);
|
|
514
|
+
let r = (s ? Ae(i.width) : i.width) / n, c = (s ? Ae(i.height) : i.height) / o;
|
|
515
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
516
|
+
x: r,
|
|
517
|
+
y: c
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
const vn = /* @__PURE__ */ j(0);
|
|
521
|
+
function Tt(e) {
|
|
522
|
+
const t = K(e);
|
|
523
|
+
return !Ct() || !t.visualViewport ? vn : {
|
|
524
|
+
x: t.visualViewport.offsetLeft,
|
|
525
|
+
y: t.visualViewport.offsetTop
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function bn(e, t, i) {
|
|
529
|
+
return t === void 0 && (t = !1), !i || t && i !== K(e) ? !1 : t;
|
|
530
|
+
}
|
|
531
|
+
function Q(e, t, i, n) {
|
|
532
|
+
t === void 0 && (t = !1), i === void 0 && (i = !1);
|
|
533
|
+
const o = e.getBoundingClientRect(), s = ze(e);
|
|
534
|
+
let r = j(1);
|
|
535
|
+
t && (n ? k(n) && (r = se(n)) : r = se(e));
|
|
536
|
+
const c = bn(s, i, n) ? Tt(s) : j(0);
|
|
537
|
+
let a = (o.left + c.x) / r.x, f = (o.top + c.y) / r.y, l = o.width / r.x, u = o.height / r.y;
|
|
538
|
+
if (s) {
|
|
539
|
+
const g = K(s), d = n && k(n) ? K(n) : n;
|
|
540
|
+
let m = g, h = ut(m);
|
|
541
|
+
for (; h && n && d !== m; ) {
|
|
542
|
+
const x = se(h), w = h.getBoundingClientRect(), y = U(h), v = w.left + (h.clientLeft + parseFloat(y.paddingLeft)) * x.x, A = w.top + (h.clientTop + parseFloat(y.paddingTop)) * x.y;
|
|
543
|
+
a *= x.x, f *= x.y, l *= x.x, u *= x.y, a += v, f += A, m = K(h), h = ut(m);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return be({
|
|
547
|
+
width: l,
|
|
548
|
+
height: u,
|
|
549
|
+
x: a,
|
|
550
|
+
y: f
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function Ce(e, t) {
|
|
554
|
+
const i = Ee(e).scrollLeft;
|
|
555
|
+
return t ? t.left + i : Q(J(e)).left + i;
|
|
556
|
+
}
|
|
557
|
+
function Lt(e, t) {
|
|
558
|
+
const i = e.getBoundingClientRect(), n = i.left + t.scrollLeft - Ce(e, i), o = i.top + t.scrollTop;
|
|
559
|
+
return {
|
|
560
|
+
x: n,
|
|
561
|
+
y: o
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
function An(e) {
|
|
565
|
+
let {
|
|
566
|
+
elements: t,
|
|
567
|
+
rect: i,
|
|
568
|
+
offsetParent: n,
|
|
569
|
+
strategy: o
|
|
570
|
+
} = e;
|
|
571
|
+
const s = o === "fixed", r = J(n), c = t ? Ve(t.floating) : !1;
|
|
572
|
+
if (n === r || c && s)
|
|
573
|
+
return i;
|
|
574
|
+
let a = {
|
|
575
|
+
scrollLeft: 0,
|
|
576
|
+
scrollTop: 0
|
|
577
|
+
}, f = j(1);
|
|
578
|
+
const l = j(0), u = G(n);
|
|
579
|
+
if ((u || !u && !s) && ((Ie(n) !== "body" || _e(r)) && (a = Ee(n)), G(n))) {
|
|
580
|
+
const d = Q(n);
|
|
581
|
+
f = se(n), l.x = d.x + n.clientLeft, l.y = d.y + n.clientTop;
|
|
582
|
+
}
|
|
583
|
+
const g = r && !u && !s ? Lt(r, a) : j(0);
|
|
584
|
+
return {
|
|
585
|
+
width: i.width * f.x,
|
|
586
|
+
height: i.height * f.y,
|
|
587
|
+
x: i.x * f.x - a.scrollLeft * f.x + l.x + g.x,
|
|
588
|
+
y: i.y * f.y - a.scrollTop * f.y + l.y + g.y
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function On(e) {
|
|
592
|
+
return Array.from(e.getClientRects());
|
|
593
|
+
}
|
|
594
|
+
function Sn(e) {
|
|
595
|
+
const t = J(e), i = Ee(e), n = e.ownerDocument.body, o = _(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = _(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
|
|
596
|
+
let r = -i.scrollLeft + Ce(e);
|
|
597
|
+
const c = -i.scrollTop;
|
|
598
|
+
return U(n).direction === "rtl" && (r += _(t.clientWidth, n.clientWidth) - o), {
|
|
599
|
+
width: o,
|
|
600
|
+
height: s,
|
|
601
|
+
x: r,
|
|
602
|
+
y: c
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
const ht = 25;
|
|
606
|
+
function En(e, t) {
|
|
607
|
+
const i = K(e), n = J(e), o = i.visualViewport;
|
|
608
|
+
let s = n.clientWidth, r = n.clientHeight, c = 0, a = 0;
|
|
609
|
+
if (o) {
|
|
610
|
+
s = o.width, r = o.height;
|
|
611
|
+
const l = Ct();
|
|
612
|
+
(!l || l && t === "fixed") && (c = o.offsetLeft, a = o.offsetTop);
|
|
613
|
+
}
|
|
614
|
+
const f = Ce(n);
|
|
615
|
+
if (f <= 0) {
|
|
616
|
+
const l = n.ownerDocument, u = l.body, g = getComputedStyle(u), d = l.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, m = Math.abs(n.clientWidth - u.clientWidth - d);
|
|
617
|
+
m <= ht && (s -= m);
|
|
618
|
+
} else f <= ht && (s += f);
|
|
619
|
+
return {
|
|
620
|
+
width: s,
|
|
621
|
+
height: r,
|
|
622
|
+
x: c,
|
|
623
|
+
y: a
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
const Cn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
627
|
+
function Pn(e, t) {
|
|
628
|
+
const i = Q(e, !0, t === "fixed"), n = i.top + e.clientTop, o = i.left + e.clientLeft, s = G(e) ? se(e) : j(1), r = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, f = n * s.y;
|
|
629
|
+
return {
|
|
630
|
+
width: r,
|
|
631
|
+
height: c,
|
|
632
|
+
x: a,
|
|
633
|
+
y: f
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function pt(e, t, i) {
|
|
637
|
+
let n;
|
|
638
|
+
if (t === "viewport")
|
|
639
|
+
n = En(e, i);
|
|
640
|
+
else if (t === "document")
|
|
641
|
+
n = Sn(J(e));
|
|
642
|
+
else if (k(t))
|
|
643
|
+
n = Pn(t, i);
|
|
644
|
+
else {
|
|
645
|
+
const o = Tt(e);
|
|
646
|
+
n = {
|
|
647
|
+
x: t.x - o.x,
|
|
648
|
+
y: t.y - o.y,
|
|
649
|
+
width: t.width,
|
|
650
|
+
height: t.height
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
return be(n);
|
|
654
|
+
}
|
|
655
|
+
function Ft(e, t) {
|
|
656
|
+
const i = de(e);
|
|
657
|
+
return i === t || !k(i) || Oe(i) ? !1 : U(i).position === "fixed" || Ft(i, t);
|
|
658
|
+
}
|
|
659
|
+
function Dn(e, t) {
|
|
660
|
+
const i = t.get(e);
|
|
661
|
+
if (i)
|
|
662
|
+
return i;
|
|
663
|
+
let n = We(e, [], !1).filter((c) => k(c) && Ie(c) !== "body"), o = null;
|
|
664
|
+
const s = U(e).position === "fixed";
|
|
665
|
+
let r = s ? de(e) : e;
|
|
666
|
+
for (; k(r) && !Oe(r); ) {
|
|
667
|
+
const c = U(r), a = Pt(r);
|
|
668
|
+
!a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o && Cn.has(o.position) || _e(r) && !a && Ft(e, r)) ? n = n.filter((l) => l !== r) : o = c, r = de(r);
|
|
669
|
+
}
|
|
670
|
+
return t.set(e, n), n;
|
|
671
|
+
}
|
|
672
|
+
function Mn(e) {
|
|
673
|
+
let {
|
|
674
|
+
element: t,
|
|
675
|
+
boundary: i,
|
|
676
|
+
rootBoundary: n,
|
|
677
|
+
strategy: o
|
|
678
|
+
} = e;
|
|
679
|
+
const r = [...i === "clippingAncestors" ? Ve(t) ? [] : Dn(t, this._c) : [].concat(i), n], c = r[0], a = r.reduce((f, l) => {
|
|
680
|
+
const u = pt(t, l, o);
|
|
681
|
+
return f.top = _(u.top, f.top), f.right = ue(u.right, f.right), f.bottom = ue(u.bottom, f.bottom), f.left = _(u.left, f.left), f;
|
|
682
|
+
}, pt(t, c, o));
|
|
683
|
+
return {
|
|
684
|
+
width: a.right - a.left,
|
|
685
|
+
height: a.bottom - a.top,
|
|
686
|
+
x: a.left,
|
|
687
|
+
y: a.top
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function Tn(e) {
|
|
691
|
+
const {
|
|
692
|
+
width: t,
|
|
693
|
+
height: i
|
|
694
|
+
} = Mt(e);
|
|
695
|
+
return {
|
|
696
|
+
width: t,
|
|
697
|
+
height: i
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function Ln(e, t, i) {
|
|
701
|
+
const n = G(t), o = J(t), s = i === "fixed", r = Q(e, !0, s, t);
|
|
702
|
+
let c = {
|
|
703
|
+
scrollLeft: 0,
|
|
704
|
+
scrollTop: 0
|
|
705
|
+
};
|
|
706
|
+
const a = j(0);
|
|
707
|
+
function f() {
|
|
708
|
+
a.x = Ce(o);
|
|
709
|
+
}
|
|
710
|
+
if (n || !n && !s)
|
|
711
|
+
if ((Ie(t) !== "body" || _e(o)) && (c = Ee(t)), n) {
|
|
712
|
+
const d = Q(t, !0, s, t);
|
|
713
|
+
a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
|
|
714
|
+
} else o && f();
|
|
715
|
+
s && !n && o && f();
|
|
716
|
+
const l = o && !n && !s ? Lt(o, c) : j(0), u = r.left + c.scrollLeft - a.x - l.x, g = r.top + c.scrollTop - a.y - l.y;
|
|
717
|
+
return {
|
|
718
|
+
x: u,
|
|
719
|
+
y: g,
|
|
720
|
+
width: r.width,
|
|
721
|
+
height: r.height
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function $e(e) {
|
|
725
|
+
return U(e).position === "static";
|
|
726
|
+
}
|
|
727
|
+
function xt(e, t) {
|
|
728
|
+
if (!G(e) || U(e).position === "fixed")
|
|
729
|
+
return null;
|
|
730
|
+
if (t)
|
|
731
|
+
return t(e);
|
|
732
|
+
let i = e.offsetParent;
|
|
733
|
+
return J(e) === i && (i = i.ownerDocument.body), i;
|
|
734
|
+
}
|
|
735
|
+
function kt(e, t) {
|
|
736
|
+
const i = K(e);
|
|
737
|
+
if (Ve(e))
|
|
738
|
+
return i;
|
|
739
|
+
if (!G(e)) {
|
|
740
|
+
let o = de(e);
|
|
741
|
+
for (; o && !Oe(o); ) {
|
|
742
|
+
if (k(o) && !$e(o))
|
|
743
|
+
return o;
|
|
744
|
+
o = de(o);
|
|
745
|
+
}
|
|
746
|
+
return i;
|
|
747
|
+
}
|
|
748
|
+
let n = xt(e, t);
|
|
749
|
+
for (; n && tn(n) && $e(n); )
|
|
750
|
+
n = xt(n, t);
|
|
751
|
+
return n && Oe(n) && $e(n) && !Pt(n) ? i : n || nn(e) || i;
|
|
752
|
+
}
|
|
753
|
+
const Fn = async function(e) {
|
|
754
|
+
const t = this.getOffsetParent || kt, i = this.getDimensions, n = await i(e.floating);
|
|
755
|
+
return {
|
|
756
|
+
reference: Ln(e.reference, await t(e.floating), e.strategy),
|
|
757
|
+
floating: {
|
|
758
|
+
x: 0,
|
|
759
|
+
y: 0,
|
|
760
|
+
width: n.width,
|
|
761
|
+
height: n.height
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
function kn(e) {
|
|
766
|
+
return U(e).direction === "rtl";
|
|
767
|
+
}
|
|
768
|
+
const $n = {
|
|
769
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: An,
|
|
770
|
+
getDocumentElement: J,
|
|
771
|
+
getClippingRect: Mn,
|
|
772
|
+
getOffsetParent: kt,
|
|
773
|
+
getElementRects: Fn,
|
|
774
|
+
getClientRects: On,
|
|
775
|
+
getDimensions: Tn,
|
|
776
|
+
getScale: se,
|
|
777
|
+
isElement: k,
|
|
778
|
+
isRTL: kn
|
|
779
|
+
};
|
|
780
|
+
function $t(e, t) {
|
|
781
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
782
|
+
}
|
|
783
|
+
function Bn(e, t) {
|
|
784
|
+
let i = null, n;
|
|
785
|
+
const o = J(e);
|
|
786
|
+
function s() {
|
|
787
|
+
var c;
|
|
788
|
+
clearTimeout(n), (c = i) == null || c.disconnect(), i = null;
|
|
789
|
+
}
|
|
790
|
+
function r(c, a) {
|
|
791
|
+
c === void 0 && (c = !1), a === void 0 && (a = 1), s();
|
|
792
|
+
const f = e.getBoundingClientRect(), {
|
|
793
|
+
left: l,
|
|
794
|
+
top: u,
|
|
795
|
+
width: g,
|
|
796
|
+
height: d
|
|
797
|
+
} = f;
|
|
798
|
+
if (c || t(), !g || !d)
|
|
799
|
+
return;
|
|
800
|
+
const m = ye(u), h = ye(o.clientWidth - (l + g)), x = ye(o.clientHeight - (u + d)), w = ye(l), v = {
|
|
801
|
+
rootMargin: -m + "px " + -h + "px " + -x + "px " + -w + "px",
|
|
802
|
+
threshold: _(0, ue(1, a)) || 1
|
|
803
|
+
};
|
|
804
|
+
let A = !0;
|
|
805
|
+
function b(E) {
|
|
806
|
+
const R = E[0].intersectionRatio;
|
|
807
|
+
if (R !== a) {
|
|
808
|
+
if (!A)
|
|
809
|
+
return r();
|
|
810
|
+
R ? r(!1, R) : n = setTimeout(() => {
|
|
811
|
+
r(!1, 1e-7);
|
|
812
|
+
}, 1e3);
|
|
813
|
+
}
|
|
814
|
+
R === 1 && !$t(f, e.getBoundingClientRect()) && r(), A = !1;
|
|
815
|
+
}
|
|
816
|
+
try {
|
|
817
|
+
i = new IntersectionObserver(b, {
|
|
818
|
+
...v,
|
|
819
|
+
// Handle <iframe>s
|
|
820
|
+
root: o.ownerDocument
|
|
821
|
+
});
|
|
822
|
+
} catch {
|
|
823
|
+
i = new IntersectionObserver(b, v);
|
|
824
|
+
}
|
|
825
|
+
i.observe(e);
|
|
826
|
+
}
|
|
827
|
+
return r(!0), s;
|
|
828
|
+
}
|
|
829
|
+
function wt(e, t, i, n) {
|
|
830
|
+
n === void 0 && (n = {});
|
|
831
|
+
const {
|
|
832
|
+
ancestorScroll: o = !0,
|
|
833
|
+
ancestorResize: s = !0,
|
|
834
|
+
elementResize: r = typeof ResizeObserver == "function",
|
|
835
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
836
|
+
animationFrame: a = !1
|
|
837
|
+
} = n, f = ze(e), l = o || s ? [...f ? We(f) : [], ...We(t)] : [];
|
|
838
|
+
l.forEach((w) => {
|
|
839
|
+
o && w.addEventListener("scroll", i, {
|
|
840
|
+
passive: !0
|
|
841
|
+
}), s && w.addEventListener("resize", i);
|
|
842
|
+
});
|
|
843
|
+
const u = f && c ? Bn(f, i) : null;
|
|
844
|
+
let g = -1, d = null;
|
|
845
|
+
r && (d = new ResizeObserver((w) => {
|
|
846
|
+
let [y] = w;
|
|
847
|
+
y && y.target === f && d && (d.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
848
|
+
var v;
|
|
849
|
+
(v = d) == null || v.observe(t);
|
|
850
|
+
})), i();
|
|
851
|
+
}), f && !a && d.observe(f), d.observe(t));
|
|
852
|
+
let m, h = a ? Q(e) : null;
|
|
853
|
+
a && x();
|
|
854
|
+
function x() {
|
|
855
|
+
const w = Q(e);
|
|
856
|
+
h && !$t(h, w) && i(), h = w, m = requestAnimationFrame(x);
|
|
857
|
+
}
|
|
858
|
+
return i(), () => {
|
|
859
|
+
var w;
|
|
860
|
+
l.forEach((y) => {
|
|
861
|
+
o && y.removeEventListener("scroll", i), s && y.removeEventListener("resize", i);
|
|
862
|
+
}), u?.(), (w = d) == null || w.disconnect(), d = null, a && cancelAnimationFrame(m);
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
const Hn = xn, Wn = wn, Vn = gn, In = Rn, _n = hn, zn = yn, Nn = (e, t, i) => {
|
|
866
|
+
const n = /* @__PURE__ */ new Map(), o = {
|
|
867
|
+
platform: $n,
|
|
868
|
+
...i
|
|
869
|
+
}, s = {
|
|
870
|
+
...o.platform,
|
|
871
|
+
_c: n
|
|
872
|
+
};
|
|
873
|
+
return mn(e, t, {
|
|
874
|
+
...o,
|
|
875
|
+
platform: s
|
|
876
|
+
});
|
|
877
|
+
};
|
|
878
|
+
var Yn = typeof document < "u", Xn = function() {
|
|
879
|
+
}, Re = Yn ? qt : Xn;
|
|
880
|
+
function Se(e, t) {
|
|
881
|
+
if (e === t)
|
|
882
|
+
return !0;
|
|
883
|
+
if (typeof e != typeof t)
|
|
884
|
+
return !1;
|
|
885
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
886
|
+
return !0;
|
|
887
|
+
let i, n, o;
|
|
888
|
+
if (e && t && typeof e == "object") {
|
|
889
|
+
if (Array.isArray(e)) {
|
|
890
|
+
if (i = e.length, i !== t.length) return !1;
|
|
891
|
+
for (n = i; n-- !== 0; )
|
|
892
|
+
if (!Se(e[n], t[n]))
|
|
893
|
+
return !1;
|
|
894
|
+
return !0;
|
|
895
|
+
}
|
|
896
|
+
if (o = Object.keys(e), i = o.length, i !== Object.keys(t).length)
|
|
897
|
+
return !1;
|
|
898
|
+
for (n = i; n-- !== 0; )
|
|
899
|
+
if (!{}.hasOwnProperty.call(t, o[n]))
|
|
900
|
+
return !1;
|
|
901
|
+
for (n = i; n-- !== 0; ) {
|
|
902
|
+
const s = o[n];
|
|
903
|
+
if (!(s === "_owner" && e.$$typeof) && !Se(e[s], t[s]))
|
|
904
|
+
return !1;
|
|
905
|
+
}
|
|
906
|
+
return !0;
|
|
907
|
+
}
|
|
908
|
+
return e !== e && t !== t;
|
|
909
|
+
}
|
|
910
|
+
function Bt(e) {
|
|
911
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
912
|
+
}
|
|
913
|
+
function yt(e, t) {
|
|
914
|
+
const i = Bt(e);
|
|
915
|
+
return Math.round(t * i) / i;
|
|
916
|
+
}
|
|
917
|
+
function Be(e) {
|
|
918
|
+
const t = O.useRef(e);
|
|
919
|
+
return Re(() => {
|
|
920
|
+
t.current = e;
|
|
921
|
+
}), t;
|
|
922
|
+
}
|
|
923
|
+
function jn(e) {
|
|
924
|
+
e === void 0 && (e = {});
|
|
925
|
+
const {
|
|
926
|
+
placement: t = "bottom",
|
|
927
|
+
strategy: i = "absolute",
|
|
928
|
+
middleware: n = [],
|
|
929
|
+
platform: o,
|
|
930
|
+
elements: {
|
|
931
|
+
reference: s,
|
|
932
|
+
floating: r
|
|
933
|
+
} = {},
|
|
934
|
+
transform: c = !0,
|
|
935
|
+
whileElementsMounted: a,
|
|
936
|
+
open: f
|
|
937
|
+
} = e, [l, u] = O.useState({
|
|
938
|
+
x: 0,
|
|
939
|
+
y: 0,
|
|
940
|
+
strategy: i,
|
|
941
|
+
placement: t,
|
|
942
|
+
middlewareData: {},
|
|
943
|
+
isPositioned: !1
|
|
944
|
+
}), [g, d] = O.useState(n);
|
|
945
|
+
Se(g, n) || d(n);
|
|
946
|
+
const [m, h] = O.useState(null), [x, w] = O.useState(null), y = O.useCallback((p) => {
|
|
947
|
+
p !== E.current && (E.current = p, h(p));
|
|
948
|
+
}, []), v = O.useCallback((p) => {
|
|
949
|
+
p !== R.current && (R.current = p, w(p));
|
|
950
|
+
}, []), A = s || m, b = r || x, E = O.useRef(null), R = O.useRef(null), S = O.useRef(l), V = a != null, L = Be(a), B = Be(o), H = Be(f), P = O.useCallback(() => {
|
|
951
|
+
if (!E.current || !R.current)
|
|
952
|
+
return;
|
|
953
|
+
const p = {
|
|
954
|
+
placement: t,
|
|
955
|
+
strategy: i,
|
|
956
|
+
middleware: g
|
|
957
|
+
};
|
|
958
|
+
B.current && (p.platform = B.current), Nn(E.current, R.current, p).then((C) => {
|
|
959
|
+
const N = {
|
|
960
|
+
...C,
|
|
961
|
+
// The floating element's position may be recomputed while it's closed
|
|
962
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
963
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
964
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
965
|
+
isPositioned: H.current !== !1
|
|
966
|
+
};
|
|
967
|
+
$.current && !Se(S.current, N) && (S.current = N, on.flushSync(() => {
|
|
968
|
+
u(N);
|
|
969
|
+
}));
|
|
970
|
+
});
|
|
971
|
+
}, [g, t, i, B, H]);
|
|
972
|
+
Re(() => {
|
|
973
|
+
f === !1 && S.current.isPositioned && (S.current.isPositioned = !1, u((p) => ({
|
|
974
|
+
...p,
|
|
975
|
+
isPositioned: !1
|
|
976
|
+
})));
|
|
977
|
+
}, [f]);
|
|
978
|
+
const $ = O.useRef(!1);
|
|
979
|
+
Re(() => ($.current = !0, () => {
|
|
980
|
+
$.current = !1;
|
|
981
|
+
}), []), Re(() => {
|
|
982
|
+
if (A && (E.current = A), b && (R.current = b), A && b) {
|
|
983
|
+
if (L.current)
|
|
984
|
+
return L.current(A, b, P);
|
|
985
|
+
P();
|
|
986
|
+
}
|
|
987
|
+
}, [A, b, P, L, V]);
|
|
988
|
+
const D = O.useMemo(() => ({
|
|
989
|
+
reference: E,
|
|
990
|
+
floating: R,
|
|
991
|
+
setReference: y,
|
|
992
|
+
setFloating: v
|
|
993
|
+
}), [y, v]), M = O.useMemo(() => ({
|
|
994
|
+
reference: A,
|
|
995
|
+
floating: b
|
|
996
|
+
}), [A, b]), F = O.useMemo(() => {
|
|
997
|
+
const p = {
|
|
998
|
+
position: i,
|
|
999
|
+
left: 0,
|
|
1000
|
+
top: 0
|
|
1001
|
+
};
|
|
1002
|
+
if (!M.floating)
|
|
1003
|
+
return p;
|
|
1004
|
+
const C = yt(M.floating, l.x), N = yt(M.floating, l.y);
|
|
1005
|
+
return c ? {
|
|
1006
|
+
...p,
|
|
1007
|
+
transform: "translate(" + C + "px, " + N + "px)",
|
|
1008
|
+
...Bt(M.floating) >= 1.5 && {
|
|
1009
|
+
willChange: "transform"
|
|
1010
|
+
}
|
|
1011
|
+
} : {
|
|
1012
|
+
position: i,
|
|
1013
|
+
left: C,
|
|
1014
|
+
top: N
|
|
1015
|
+
};
|
|
1016
|
+
}, [i, c, M.floating, l.x, l.y]);
|
|
1017
|
+
return O.useMemo(() => ({
|
|
1018
|
+
...l,
|
|
1019
|
+
update: P,
|
|
1020
|
+
refs: D,
|
|
1021
|
+
elements: M,
|
|
1022
|
+
floatingStyles: F
|
|
1023
|
+
}), [l, P, D, M, F]);
|
|
1024
|
+
}
|
|
1025
|
+
const qn = (e, t) => ({
|
|
1026
|
+
...Hn(e),
|
|
1027
|
+
options: [e, t]
|
|
1028
|
+
}), Un = (e, t) => ({
|
|
1029
|
+
...Wn(e),
|
|
1030
|
+
options: [e, t]
|
|
1031
|
+
}), Jn = (e, t) => ({
|
|
1032
|
+
...zn(e),
|
|
1033
|
+
options: [e, t]
|
|
1034
|
+
}), Kn = (e, t) => ({
|
|
1035
|
+
...Vn(e),
|
|
1036
|
+
options: [e, t]
|
|
1037
|
+
}), Gn = (e, t) => ({
|
|
1038
|
+
...In(e),
|
|
1039
|
+
options: [e, t]
|
|
1040
|
+
}), Qn = (e, t) => ({
|
|
1041
|
+
..._n(e),
|
|
1042
|
+
options: [e, t]
|
|
1043
|
+
});
|
|
1044
|
+
function Zn(e) {
|
|
1045
|
+
const {
|
|
1046
|
+
open: t = !1,
|
|
1047
|
+
onOpenChange: i,
|
|
1048
|
+
elements: n = {}
|
|
1049
|
+
} = e, o = an(), s = sn() != null;
|
|
1050
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1051
|
+
const c = n.reference;
|
|
1052
|
+
c && !k(c) && console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
|
|
1053
|
+
}
|
|
1054
|
+
const r = fn(() => new rn({
|
|
1055
|
+
open: t,
|
|
1056
|
+
onOpenChange: i,
|
|
1057
|
+
referenceElement: n.reference ?? null,
|
|
1058
|
+
floatingElement: n.floating ?? null,
|
|
1059
|
+
triggerElements: n.triggers ?? new cn(),
|
|
1060
|
+
floatingId: o,
|
|
1061
|
+
nested: s,
|
|
1062
|
+
noEmit: e.noEmit || !1
|
|
1063
|
+
})).current;
|
|
1064
|
+
return oe(() => {
|
|
1065
|
+
const c = {
|
|
1066
|
+
open: t,
|
|
1067
|
+
floatingId: o
|
|
1068
|
+
};
|
|
1069
|
+
n.reference !== void 0 && (c.referenceElement = n.reference, c.domReferenceElement = k(n.reference) ? n.reference : null), n.floating !== void 0 && (c.floatingElement = n.floating), r.update(c);
|
|
1070
|
+
}, [t, o, n.reference, n.floating, r]), r.context.onOpenChange = i, r.context.nested = s, r.context.noEmit = e.noEmit || !1, r;
|
|
1071
|
+
}
|
|
1072
|
+
function ei(e = {}) {
|
|
1073
|
+
const {
|
|
1074
|
+
nodeId: t,
|
|
1075
|
+
externalTree: i
|
|
1076
|
+
} = e, n = Zn(e), o = e.rootContext || n, s = {
|
|
1077
|
+
reference: o.useState("referenceElement"),
|
|
1078
|
+
floating: o.useState("floatingElement"),
|
|
1079
|
+
domReference: o.useState("domReferenceElement")
|
|
1080
|
+
}, [r, c] = O.useState(null), a = O.useRef(null), f = ln(i);
|
|
1081
|
+
oe(() => {
|
|
1082
|
+
s.domReference && (a.current = s.domReference);
|
|
1083
|
+
}, [s.domReference]);
|
|
1084
|
+
const l = jn({
|
|
1085
|
+
...e,
|
|
1086
|
+
elements: {
|
|
1087
|
+
...s,
|
|
1088
|
+
...r && {
|
|
1089
|
+
reference: r
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}), u = O.useCallback((R) => {
|
|
1093
|
+
const S = k(R) ? {
|
|
1094
|
+
getBoundingClientRect: () => R.getBoundingClientRect(),
|
|
1095
|
+
getClientRects: () => R.getClientRects(),
|
|
1096
|
+
contextElement: R
|
|
1097
|
+
} : R;
|
|
1098
|
+
c(S), l.refs.setReference(S);
|
|
1099
|
+
}, [l.refs]), [g, d] = O.useState(null), [m, h] = O.useState(null);
|
|
1100
|
+
o.useSyncedValue("referenceElement", g), o.useSyncedValue("domReferenceElement", k(g) ? g : null), o.useSyncedValue("floatingElement", m);
|
|
1101
|
+
const x = O.useCallback((R) => {
|
|
1102
|
+
(k(R) || R === null) && (a.current = R, d(R)), (k(l.refs.reference.current) || l.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1103
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
1104
|
+
// callback ref.
|
|
1105
|
+
R !== null && !k(R)) && l.refs.setReference(R);
|
|
1106
|
+
}, [l.refs, d]), w = O.useCallback((R) => {
|
|
1107
|
+
h(R), l.refs.setFloating(R);
|
|
1108
|
+
}, [l.refs]), y = O.useMemo(() => ({
|
|
1109
|
+
...l.refs,
|
|
1110
|
+
setReference: x,
|
|
1111
|
+
setFloating: w,
|
|
1112
|
+
setPositionReference: u,
|
|
1113
|
+
domReference: a
|
|
1114
|
+
}), [l.refs, x, w, u]), v = O.useMemo(() => ({
|
|
1115
|
+
...l.elements,
|
|
1116
|
+
domReference: s.domReference
|
|
1117
|
+
}), [l.elements, s.domReference]), A = o.useState("open"), b = o.useState("floatingId"), E = O.useMemo(() => ({
|
|
1118
|
+
...l,
|
|
1119
|
+
dataRef: o.context.dataRef,
|
|
1120
|
+
open: A,
|
|
1121
|
+
onOpenChange: o.setOpen,
|
|
1122
|
+
events: o.context.events,
|
|
1123
|
+
floatingId: b,
|
|
1124
|
+
refs: y,
|
|
1125
|
+
elements: v,
|
|
1126
|
+
nodeId: t,
|
|
1127
|
+
rootStore: o
|
|
1128
|
+
}), [l, y, v, t, o, A, b]);
|
|
1129
|
+
return oe(() => {
|
|
1130
|
+
o.context.dataRef.current.floatingContext = E;
|
|
1131
|
+
const R = f?.nodesRef.current.find((S) => S.id === t);
|
|
1132
|
+
R && (R.context = E);
|
|
1133
|
+
}), O.useMemo(() => ({
|
|
1134
|
+
...l,
|
|
1135
|
+
context: E,
|
|
1136
|
+
refs: y,
|
|
1137
|
+
elements: v,
|
|
1138
|
+
rootStore: o
|
|
1139
|
+
}), [l, y, v, E, o]);
|
|
1140
|
+
}
|
|
1141
|
+
const ti = (e) => ({
|
|
1142
|
+
name: "arrow",
|
|
1143
|
+
options: e,
|
|
1144
|
+
async fn(t) {
|
|
1145
|
+
const {
|
|
1146
|
+
x: i,
|
|
1147
|
+
y: n,
|
|
1148
|
+
placement: o,
|
|
1149
|
+
rects: s,
|
|
1150
|
+
platform: r,
|
|
1151
|
+
elements: c,
|
|
1152
|
+
middlewareData: a
|
|
1153
|
+
} = t, {
|
|
1154
|
+
element: f,
|
|
1155
|
+
padding: l = 0,
|
|
1156
|
+
offsetParent: u = "real"
|
|
1157
|
+
} = q(e, t) || {};
|
|
1158
|
+
if (f == null)
|
|
1159
|
+
return {};
|
|
1160
|
+
const g = bt(l), d = {
|
|
1161
|
+
x: i,
|
|
1162
|
+
y: n
|
|
1163
|
+
}, m = At(o), h = Ot(m), x = await r.getDimensions(f), w = m === "y", y = w ? "top" : "left", v = w ? "bottom" : "right", A = w ? "clientHeight" : "clientWidth", b = s.reference[h] + s.reference[m] - d[m] - s.floating[h], E = d[m] - s.reference[m], R = u === "real" ? await r.getOffsetParent?.(f) : c.floating;
|
|
1164
|
+
let S = c.floating[A] || s.floating[h];
|
|
1165
|
+
(!S || !await r.isElement?.(R)) && (S = c.floating[A] || s.floating[h]);
|
|
1166
|
+
const V = b / 2 - E / 2, L = S / 2 - x[h] / 2 - 1, B = Math.min(g[y], L), H = Math.min(g[v], L), P = B, $ = S - x[h] - H, D = S / 2 - x[h] / 2 + V, M = He(P, D, $), F = !a.arrow && re(o) != null && D !== M && s.reference[h] / 2 - (D < P ? B : H) - x[h] / 2 < 0, p = F ? D < P ? D - P : D - $ : 0;
|
|
1167
|
+
return {
|
|
1168
|
+
[m]: d[m] + p,
|
|
1169
|
+
data: {
|
|
1170
|
+
[m]: M,
|
|
1171
|
+
centerOffset: D - M - p,
|
|
1172
|
+
...F && {
|
|
1173
|
+
alignmentOffset: p
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
reset: F
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
}), ni = (e, t) => ({
|
|
1180
|
+
...ti(e),
|
|
1181
|
+
options: [e, t]
|
|
1182
|
+
}), ii = {
|
|
1183
|
+
name: "hide",
|
|
1184
|
+
async fn(e) {
|
|
1185
|
+
const {
|
|
1186
|
+
width: t,
|
|
1187
|
+
height: i,
|
|
1188
|
+
x: n,
|
|
1189
|
+
y: o
|
|
1190
|
+
} = e.rects.reference, s = t === 0 && i === 0 && n === 0 && o === 0;
|
|
1191
|
+
return {
|
|
1192
|
+
data: {
|
|
1193
|
+
referenceHidden: (await Qn().fn(e)).data?.referenceHidden || s
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
}, ve = {
|
|
1198
|
+
sideX: "left",
|
|
1199
|
+
sideY: "top"
|
|
1200
|
+
}, wi = {
|
|
1201
|
+
name: "adaptiveOrigin",
|
|
1202
|
+
async fn(e) {
|
|
1203
|
+
const {
|
|
1204
|
+
x: t,
|
|
1205
|
+
y: i,
|
|
1206
|
+
rects: {
|
|
1207
|
+
floating: n
|
|
1208
|
+
},
|
|
1209
|
+
elements: {
|
|
1210
|
+
floating: o
|
|
1211
|
+
},
|
|
1212
|
+
platform: s,
|
|
1213
|
+
strategy: r,
|
|
1214
|
+
placement: c
|
|
1215
|
+
} = e, a = K(o), f = a.getComputedStyle(o);
|
|
1216
|
+
if (!(f.transitionDuration !== "0s" && f.transitionDuration !== ""))
|
|
1217
|
+
return {
|
|
1218
|
+
x: t,
|
|
1219
|
+
y: i,
|
|
1220
|
+
data: ve
|
|
1221
|
+
};
|
|
1222
|
+
const u = await s.getOffsetParent?.(o);
|
|
1223
|
+
let g = {
|
|
1224
|
+
width: 0,
|
|
1225
|
+
height: 0
|
|
1226
|
+
};
|
|
1227
|
+
if (r === "fixed" && a?.visualViewport)
|
|
1228
|
+
g = {
|
|
1229
|
+
width: a.visualViewport.width,
|
|
1230
|
+
height: a.visualViewport.height
|
|
1231
|
+
};
|
|
1232
|
+
else if (u === a) {
|
|
1233
|
+
const y = Et(o);
|
|
1234
|
+
g = {
|
|
1235
|
+
width: y.documentElement.clientWidth,
|
|
1236
|
+
height: y.documentElement.clientHeight
|
|
1237
|
+
};
|
|
1238
|
+
} else await s.isElement?.(u) && (g = await s.getDimensions(u));
|
|
1239
|
+
const d = z(c);
|
|
1240
|
+
let m = t, h = i;
|
|
1241
|
+
d === "left" && (m = g.width - (t + n.width)), d === "top" && (h = g.height - (i + n.height));
|
|
1242
|
+
const x = d === "left" ? "right" : ve.sideX, w = d === "top" ? "bottom" : ve.sideY;
|
|
1243
|
+
return {
|
|
1244
|
+
x: m,
|
|
1245
|
+
y: h,
|
|
1246
|
+
data: {
|
|
1247
|
+
sideX: x,
|
|
1248
|
+
sideY: w
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
function Ht(e, t, i) {
|
|
1254
|
+
const n = e === "inline-start" || e === "inline-end";
|
|
1255
|
+
return {
|
|
1256
|
+
top: "top",
|
|
1257
|
+
right: n ? i ? "inline-start" : "inline-end" : "right",
|
|
1258
|
+
bottom: "bottom",
|
|
1259
|
+
left: n ? i ? "inline-end" : "inline-start" : "left"
|
|
1260
|
+
}[t];
|
|
1261
|
+
}
|
|
1262
|
+
function Rt(e, t, i) {
|
|
1263
|
+
const {
|
|
1264
|
+
rects: n,
|
|
1265
|
+
placement: o
|
|
1266
|
+
} = e;
|
|
1267
|
+
return {
|
|
1268
|
+
side: Ht(t, z(o), i),
|
|
1269
|
+
align: re(o) || "center",
|
|
1270
|
+
anchor: {
|
|
1271
|
+
width: n.reference.width,
|
|
1272
|
+
height: n.reference.height
|
|
1273
|
+
},
|
|
1274
|
+
positioner: {
|
|
1275
|
+
width: n.floating.width,
|
|
1276
|
+
height: n.floating.height
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
function yi(e) {
|
|
1281
|
+
const {
|
|
1282
|
+
// Public parameters
|
|
1283
|
+
anchor: t,
|
|
1284
|
+
positionMethod: i = "absolute",
|
|
1285
|
+
side: n = "bottom",
|
|
1286
|
+
sideOffset: o = 0,
|
|
1287
|
+
align: s = "center",
|
|
1288
|
+
alignOffset: r = 0,
|
|
1289
|
+
collisionBoundary: c,
|
|
1290
|
+
collisionPadding: a = 5,
|
|
1291
|
+
sticky: f = !1,
|
|
1292
|
+
arrowPadding: l = 5,
|
|
1293
|
+
disableAnchorTracking: u = !1,
|
|
1294
|
+
// Private parameters
|
|
1295
|
+
keepMounted: g = !1,
|
|
1296
|
+
floatingRootContext: d,
|
|
1297
|
+
mounted: m,
|
|
1298
|
+
collisionAvoidance: h,
|
|
1299
|
+
shiftCrossAxis: x = !1,
|
|
1300
|
+
nodeId: w,
|
|
1301
|
+
adaptiveOrigin: y,
|
|
1302
|
+
lazyFlip: v = !1,
|
|
1303
|
+
externalTree: A
|
|
1304
|
+
} = e, [b, E] = O.useState(null);
|
|
1305
|
+
!m && b !== null && E(null);
|
|
1306
|
+
const R = h.side || "flip", S = h.align || "flip", V = h.fallbackAxisSide || "end", L = typeof t == "function" ? t : void 0, B = Zt(L), H = L ? B : t, P = ke(t), D = en() === "rtl", M = b || {
|
|
1307
|
+
top: "top",
|
|
1308
|
+
right: "right",
|
|
1309
|
+
bottom: "bottom",
|
|
1310
|
+
left: "left",
|
|
1311
|
+
"inline-end": D ? "left" : "right",
|
|
1312
|
+
"inline-start": D ? "right" : "left"
|
|
1313
|
+
}[n], F = s === "center" ? M : `${M}-${s}`;
|
|
1314
|
+
let p = a;
|
|
1315
|
+
const C = 1, N = n === "bottom" ? C : 0, Ne = n === "top" ? C : 0, Ye = n === "right" ? C : 0, Xe = n === "left" ? C : 0;
|
|
1316
|
+
typeof p == "number" ? p = {
|
|
1317
|
+
top: p + N,
|
|
1318
|
+
right: p + Xe,
|
|
1319
|
+
bottom: p + Ne,
|
|
1320
|
+
left: p + Ye
|
|
1321
|
+
} : p && (p = {
|
|
1322
|
+
top: (p.top || 0) + N,
|
|
1323
|
+
right: (p.right || 0) + Xe,
|
|
1324
|
+
bottom: (p.bottom || 0) + Ne,
|
|
1325
|
+
left: (p.left || 0) + Ye
|
|
1326
|
+
});
|
|
1327
|
+
const ge = {
|
|
1328
|
+
boundary: c === "clipping-ancestors" ? "clippingAncestors" : c,
|
|
1329
|
+
padding: p
|
|
1330
|
+
}, Z = O.useRef(null), Pe = ke(o), De = ke(r), he = [qn((T) => {
|
|
1331
|
+
const W = Rt(T, n, D), X = typeof Pe.current == "function" ? Pe.current(W) : Pe.current, I = typeof De.current == "function" ? De.current(W) : De.current;
|
|
1332
|
+
return {
|
|
1333
|
+
mainAxis: X,
|
|
1334
|
+
crossAxis: I,
|
|
1335
|
+
alignmentAxis: I
|
|
1336
|
+
};
|
|
1337
|
+
}, [typeof o != "function" ? o : 0, typeof r != "function" ? r : 0, D, n])], je = S === "none" && R !== "shift", qe = !je && (f || x || R === "shift"), Ue = R === "none" ? null : Kn({
|
|
1338
|
+
...ge,
|
|
1339
|
+
// Ensure the popup flips if it's been limited by its --available-height and it resizes.
|
|
1340
|
+
// Since the size() padding is smaller than the flip() padding, flip() will take precedence.
|
|
1341
|
+
padding: {
|
|
1342
|
+
top: p.top + C,
|
|
1343
|
+
right: p.right + C,
|
|
1344
|
+
bottom: p.bottom + C,
|
|
1345
|
+
left: p.left + C
|
|
1346
|
+
},
|
|
1347
|
+
mainAxis: !x && R === "flip",
|
|
1348
|
+
crossAxis: S === "flip" ? "alignment" : !1,
|
|
1349
|
+
fallbackAxisSideDirection: V
|
|
1350
|
+
}), Je = je ? null : Un((T) => {
|
|
1351
|
+
const W = Et(T.elements.floating).documentElement;
|
|
1352
|
+
return {
|
|
1353
|
+
...ge,
|
|
1354
|
+
// Use the Layout Viewport to avoid shifting around when pinch-zooming
|
|
1355
|
+
// for context menus.
|
|
1356
|
+
rootBoundary: x ? {
|
|
1357
|
+
x: 0,
|
|
1358
|
+
y: 0,
|
|
1359
|
+
width: W.clientWidth,
|
|
1360
|
+
height: W.clientHeight
|
|
1361
|
+
} : void 0,
|
|
1362
|
+
mainAxis: S !== "none",
|
|
1363
|
+
crossAxis: qe,
|
|
1364
|
+
limiter: f || x ? void 0 : Jn((X) => {
|
|
1365
|
+
if (!Z.current)
|
|
1366
|
+
return {};
|
|
1367
|
+
const {
|
|
1368
|
+
width: I,
|
|
1369
|
+
height: ne
|
|
1370
|
+
} = Z.current.getBoundingClientRect(), ie = Y(z(X.placement)), we = ie === "y" ? I : ne, Le = ie === "y" ? p.left + p.right : p.top + p.bottom;
|
|
1371
|
+
return {
|
|
1372
|
+
offset: we / 2 + Le / 2
|
|
1373
|
+
};
|
|
1374
|
+
})
|
|
1375
|
+
};
|
|
1376
|
+
}, [ge, f, x, p, S]);
|
|
1377
|
+
R === "shift" || S === "shift" || s === "center" ? he.push(Je, Ue) : he.push(Ue, Je), he.push(Gn({
|
|
1378
|
+
...ge,
|
|
1379
|
+
apply({
|
|
1380
|
+
elements: {
|
|
1381
|
+
floating: T
|
|
1382
|
+
},
|
|
1383
|
+
rects: {
|
|
1384
|
+
reference: W
|
|
1385
|
+
},
|
|
1386
|
+
availableWidth: X,
|
|
1387
|
+
availableHeight: I
|
|
1388
|
+
}) {
|
|
1389
|
+
Object.entries({
|
|
1390
|
+
"--available-width": `${X}px`,
|
|
1391
|
+
"--available-height": `${I}px`,
|
|
1392
|
+
"--anchor-width": `${W.width}px`,
|
|
1393
|
+
"--anchor-height": `${W.height}px`
|
|
1394
|
+
}).forEach(([ne, ie]) => {
|
|
1395
|
+
T.style.setProperty(ne, ie);
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
}), ni(() => ({
|
|
1399
|
+
// `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
|
|
1400
|
+
// we'll create a fake element.
|
|
1401
|
+
element: Z.current || document.createElement("div"),
|
|
1402
|
+
padding: l,
|
|
1403
|
+
offsetParent: "floating"
|
|
1404
|
+
}), [l]), {
|
|
1405
|
+
name: "transformOrigin",
|
|
1406
|
+
fn(T) {
|
|
1407
|
+
const {
|
|
1408
|
+
elements: W,
|
|
1409
|
+
middlewareData: X,
|
|
1410
|
+
placement: I,
|
|
1411
|
+
rects: ne,
|
|
1412
|
+
y: ie
|
|
1413
|
+
} = T, we = z(I), Le = Y(we), at = Z.current, Wt = X.arrow?.x || 0, Vt = X.arrow?.y || 0, It = at?.clientWidth || 0, _t = at?.clientHeight || 0, Fe = Wt + It / 2, ft = Vt + _t / 2, zt = Math.abs(X.shift?.y || 0), Nt = ne.reference.height / 2, fe = typeof o == "function" ? o(Rt(T, n, D)) : o, Yt = zt > fe, Xt = {
|
|
1414
|
+
top: `${Fe}px calc(100% + ${fe}px)`,
|
|
1415
|
+
bottom: `${Fe}px ${-fe}px`,
|
|
1416
|
+
left: `calc(100% + ${fe}px) ${ft}px`,
|
|
1417
|
+
right: `${-fe}px ${ft}px`
|
|
1418
|
+
}[we], jt = `${Fe}px ${ne.reference.y + Nt - ie}px`;
|
|
1419
|
+
return W.floating.style.setProperty("--transform-origin", qe && Le === "y" && Yt ? jt : Xt), {};
|
|
1420
|
+
}
|
|
1421
|
+
}, ii, y), oe(() => {
|
|
1422
|
+
!m && d && d.update({
|
|
1423
|
+
referenceElement: null,
|
|
1424
|
+
floatingElement: null,
|
|
1425
|
+
domReferenceElement: null
|
|
1426
|
+
});
|
|
1427
|
+
}, [m, d]);
|
|
1428
|
+
const Me = O.useMemo(() => ({
|
|
1429
|
+
elementResize: !u && typeof ResizeObserver < "u",
|
|
1430
|
+
layoutShift: !u && typeof IntersectionObserver < "u"
|
|
1431
|
+
}), [u]), {
|
|
1432
|
+
refs: ee,
|
|
1433
|
+
elements: ce,
|
|
1434
|
+
x: Ke,
|
|
1435
|
+
y: Ge,
|
|
1436
|
+
middlewareData: te,
|
|
1437
|
+
update: pe,
|
|
1438
|
+
placement: Qe,
|
|
1439
|
+
context: Ze,
|
|
1440
|
+
isPositioned: le,
|
|
1441
|
+
floatingStyles: et
|
|
1442
|
+
} = ei({
|
|
1443
|
+
rootContext: d,
|
|
1444
|
+
placement: F,
|
|
1445
|
+
middleware: he,
|
|
1446
|
+
strategy: i,
|
|
1447
|
+
whileElementsMounted: g ? void 0 : (...T) => wt(...T, Me),
|
|
1448
|
+
nodeId: w,
|
|
1449
|
+
externalTree: A
|
|
1450
|
+
}), {
|
|
1451
|
+
sideX: tt,
|
|
1452
|
+
sideY: nt
|
|
1453
|
+
} = te.adaptiveOrigin || ve, Te = le ? i : "fixed", it = O.useMemo(() => y ? {
|
|
1454
|
+
position: Te,
|
|
1455
|
+
[tt]: Ke,
|
|
1456
|
+
[nt]: Ge
|
|
1457
|
+
} : {
|
|
1458
|
+
position: Te,
|
|
1459
|
+
...et
|
|
1460
|
+
}, [y, Te, tt, Ke, nt, Ge, et]), xe = O.useRef(null);
|
|
1461
|
+
oe(() => {
|
|
1462
|
+
if (!m)
|
|
1463
|
+
return;
|
|
1464
|
+
const T = P.current, W = typeof T == "function" ? T() : T, I = (vt(W) ? W.current : W) || null || null;
|
|
1465
|
+
I !== xe.current && (ee.setPositionReference(I), xe.current = I);
|
|
1466
|
+
}, [m, ee, H, P]), O.useEffect(() => {
|
|
1467
|
+
if (!m)
|
|
1468
|
+
return;
|
|
1469
|
+
const T = P.current;
|
|
1470
|
+
typeof T != "function" && vt(T) && T.current !== xe.current && (ee.setPositionReference(T.current), xe.current = T.current);
|
|
1471
|
+
}, [m, ee, H, P]), O.useEffect(() => {
|
|
1472
|
+
if (g && m && ce.domReference && ce.floating)
|
|
1473
|
+
return wt(ce.domReference, ce.floating, pe, Me);
|
|
1474
|
+
}, [g, m, ce, pe, Me]);
|
|
1475
|
+
const ae = z(Qe), ot = Ht(n, ae, D), st = re(Qe) || "center", rt = !!te.hide?.referenceHidden;
|
|
1476
|
+
oe(() => {
|
|
1477
|
+
v && m && le && E(ae);
|
|
1478
|
+
}, [v, m, le, ae]);
|
|
1479
|
+
const ct = O.useMemo(() => ({
|
|
1480
|
+
position: "absolute",
|
|
1481
|
+
top: te.arrow?.y,
|
|
1482
|
+
left: te.arrow?.x
|
|
1483
|
+
}), [te.arrow]), lt = te.arrow?.centerOffset !== 0;
|
|
1484
|
+
return O.useMemo(() => ({
|
|
1485
|
+
positionerStyles: it,
|
|
1486
|
+
arrowStyles: ct,
|
|
1487
|
+
arrowRef: Z,
|
|
1488
|
+
arrowUncentered: lt,
|
|
1489
|
+
side: ot,
|
|
1490
|
+
align: st,
|
|
1491
|
+
physicalSide: ae,
|
|
1492
|
+
anchorHidden: rt,
|
|
1493
|
+
refs: ee,
|
|
1494
|
+
context: Ze,
|
|
1495
|
+
isPositioned: le,
|
|
1496
|
+
update: pe
|
|
1497
|
+
}), [it, ct, Z, lt, ot, st, ae, rt, ee, Ze, le, pe]);
|
|
1498
|
+
}
|
|
1499
|
+
function vt(e) {
|
|
1500
|
+
return e != null && "current" in e;
|
|
1501
|
+
}
|
|
1502
|
+
function Ri(e) {
|
|
1503
|
+
return e === "starting" ? dn : un;
|
|
1504
|
+
}
|
|
1505
|
+
export {
|
|
1506
|
+
yi as a,
|
|
1507
|
+
wi as b,
|
|
1508
|
+
Ri as g,
|
|
1509
|
+
Zn as u
|
|
1510
|
+
};
|