brd-ui-kit 0.1.54 → 0.1.57
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/.githooks/pre-commit +19 -0
- package/.prettierignore +13 -0
- package/components.json +25 -0
- package/dist/brd-ui-kit.css +1 -1
- package/dist/components/app-pagination.d.ts +2 -0
- package/dist/components/app-sidebar.d.ts +2 -0
- package/dist/components/avatar-uploader.d.ts +2 -0
- package/dist/components/basic-avatar.d.ts +2 -0
- package/dist/components/basic-chart.d.ts +2 -0
- package/dist/components/basic-checkbox.d.ts +2 -0
- package/dist/components/basic-drawer.d.ts +2 -0
- package/dist/components/basic-modal.d.ts +2 -0
- package/dist/components/basic-select.d.ts +2 -0
- package/dist/components/basic-table.d.ts +2 -0
- package/dist/components/basic-tooltip.d.ts +2 -0
- package/dist/components/files-uploader/files-uploader.d.ts +6 -3
- package/dist/components/files-uploader.d.ts +2 -0
- package/dist/components/input-field.d.ts +2 -0
- package/dist/components/input-password.d.ts +2 -0
- package/dist/components/popover-modal.d.ts +2 -0
- package/dist/components/radio-button.d.ts +2 -0
- package/dist/components/select-field.d.ts +2 -0
- package/dist/components/select-groups.d.ts +2 -0
- package/dist/components/textarea-field.d.ts +2 -0
- package/dist/components/ui/avatar.d.ts +2 -0
- package/dist/components/ui/badge.d.ts +2 -0
- package/dist/components/ui/button.d.ts +2 -0
- package/dist/components/ui/card.d.ts +2 -0
- package/dist/components/ui/chart.d.ts +2 -0
- package/dist/components/ui/checkbox.d.ts +2 -0
- package/dist/components/ui/combobox.d.ts +2 -0
- package/dist/components/ui/dialog.d.ts +2 -0
- package/dist/components/ui/drawer.d.ts +2 -0
- package/dist/components/ui/field.d.ts +2 -0
- package/dist/components/ui/icon.d.ts +2 -0
- package/dist/components/ui/input-group.d.ts +2 -0
- package/dist/components/ui/input.d.ts +2 -0
- package/dist/components/ui/label.d.ts +2 -0
- package/dist/components/ui/navigation-item.d.ts +2 -0
- package/dist/components/ui/navigation-menu.d.ts +2 -0
- package/dist/components/ui/pagination.d.ts +2 -0
- package/dist/components/ui/popover.d.ts +2 -0
- package/dist/components/ui/progress.d.ts +2 -0
- package/dist/components/ui/radio-group.d.ts +2 -0
- package/dist/components/ui/select.d.ts +2 -0
- package/dist/components/ui/separator.d.ts +2 -0
- package/dist/components/ui/sonner.d.ts +2 -0
- package/dist/components/ui/switch.d.ts +2 -0
- package/dist/components/ui/table.d.ts +2 -0
- package/dist/components/ui/tabs.d.ts +2 -0
- package/dist/components/ui/textarea.d.ts +2 -0
- package/dist/components/ui/tooltip.d.ts +2 -0
- package/dist/components/ui/typography.d.ts +2 -0
- package/dist/components-app-pagination-app-pagination.cjs +2 -0
- package/dist/components-app-pagination-app-pagination.cjs.map +1 -0
- package/dist/components-app-pagination-app-pagination.styles.cjs +3 -0
- package/dist/components-app-pagination-app-pagination.styles.cjs.map +1 -0
- package/dist/components-app-pagination.cjs +2 -0
- package/dist/components-app-pagination.cjs.map +1 -0
- package/dist/components-app-sidebar-app-sidebar.cjs +2 -0
- package/dist/components-app-sidebar-app-sidebar.cjs.map +1 -0
- package/dist/components-app-sidebar-app-sidebar.styles.cjs +2 -0
- package/dist/components-app-sidebar-app-sidebar.styles.cjs.map +1 -0
- package/dist/components-app-sidebar.cjs +2 -0
- package/dist/components-app-sidebar.cjs.map +1 -0
- package/dist/components-avatar-uploader-avatar-uploader.cjs +3 -0
- package/dist/components-avatar-uploader-avatar-uploader.cjs.map +1 -0
- package/dist/components-avatar-uploader.cjs +2 -0
- package/dist/components-avatar-uploader.cjs.map +1 -0
- package/dist/components-basic-avatar-basic-avatar.cjs +4 -0
- package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -0
- package/dist/components-basic-avatar.cjs +2 -0
- package/dist/components-basic-avatar.cjs.map +1 -0
- package/dist/components-basic-chart-basic-chart.cjs +2 -0
- package/dist/components-basic-chart-basic-chart.cjs.map +1 -0
- package/dist/components-basic-chart.cjs +2 -0
- package/dist/components-basic-chart.cjs.map +1 -0
- package/dist/components-basic-checkbox-basic-checkbox.cjs +2 -0
- package/dist/components-basic-checkbox-basic-checkbox.cjs.map +1 -0
- package/dist/components-basic-checkbox.cjs +2 -0
- package/dist/components-basic-checkbox.cjs.map +1 -0
- package/dist/components-basic-drawer-basic-drawer.cjs +2 -0
- package/dist/components-basic-drawer-basic-drawer.cjs.map +1 -0
- package/dist/components-basic-drawer.cjs +2 -0
- package/dist/components-basic-drawer.cjs.map +1 -0
- package/dist/components-basic-modal-basic-modal.cjs +2 -0
- package/dist/components-basic-modal-basic-modal.cjs.map +1 -0
- package/dist/components-basic-modal.cjs +2 -0
- package/dist/components-basic-modal.cjs.map +1 -0
- package/dist/components-basic-select-basic-select.cjs +2 -0
- package/dist/components-basic-select-basic-select.cjs.map +1 -0
- package/dist/components-basic-select.cjs +2 -0
- package/dist/components-basic-select.cjs.map +1 -0
- package/dist/components-basic-table-basic-table.cjs +5 -0
- package/dist/components-basic-table-basic-table.cjs.map +1 -0
- package/dist/components-basic-table.cjs +2 -0
- package/dist/components-basic-table.cjs.map +1 -0
- package/dist/components-basic-tooltip-basic-tooltip.cjs +2 -0
- package/dist/components-basic-tooltip-basic-tooltip.cjs.map +1 -0
- package/dist/components-basic-tooltip.cjs +2 -0
- package/dist/components-basic-tooltip.cjs.map +1 -0
- package/dist/components-files-uploader-files-uploader.cjs +8 -0
- package/dist/components-files-uploader-files-uploader.cjs.map +1 -0
- package/dist/components-files-uploader.cjs +2 -0
- package/dist/components-files-uploader.cjs.map +1 -0
- package/dist/components-input-field-input-field.cjs +2 -0
- package/dist/components-input-field-input-field.cjs.map +1 -0
- package/dist/components-input-field.cjs +2 -0
- package/dist/components-input-field.cjs.map +1 -0
- package/dist/components-input-password-input-password.cjs +2 -0
- package/dist/components-input-password-input-password.cjs.map +1 -0
- package/dist/components-input-password.cjs +2 -0
- package/dist/components-input-password.cjs.map +1 -0
- package/dist/components-popover-modal-popover-modal.cjs +2 -0
- package/dist/components-popover-modal-popover-modal.cjs.map +1 -0
- package/dist/components-popover-modal.cjs +2 -0
- package/dist/components-popover-modal.cjs.map +1 -0
- package/dist/components-radio-button-radio-button.cjs +2 -0
- package/dist/components-radio-button-radio-button.cjs.map +1 -0
- package/dist/components-radio-button.cjs +2 -0
- package/dist/components-radio-button.cjs.map +1 -0
- package/dist/components-select-field-select-field.cjs +3 -0
- package/dist/components-select-field-select-field.cjs.map +1 -0
- package/dist/components-select-field.cjs +2 -0
- package/dist/components-select-field.cjs.map +1 -0
- package/dist/components-select-groups-select-groups.cjs +2 -0
- package/dist/components-select-groups-select-groups.cjs.map +1 -0
- package/dist/components-select-groups.cjs +2 -0
- package/dist/components-select-groups.cjs.map +1 -0
- package/dist/components-textarea-field-textarea-field.cjs +2 -0
- package/dist/components-textarea-field-textarea-field.cjs.map +1 -0
- package/dist/components-textarea-field.cjs +2 -0
- package/dist/components-textarea-field.cjs.map +1 -0
- package/dist/components-ui-avatar-avatar.cjs +15 -0
- package/dist/components-ui-avatar-avatar.cjs.map +1 -0
- package/dist/components-ui-avatar.cjs +2 -0
- package/dist/components-ui-avatar.cjs.map +1 -0
- package/dist/components-ui-badge-badge.cjs +2 -0
- package/dist/components-ui-badge-badge.cjs.map +1 -0
- package/dist/components-ui-badge-badge.styles.cjs +3 -0
- package/dist/components-ui-badge-badge.styles.cjs.map +1 -0
- package/dist/components-ui-badge.cjs +2 -0
- package/dist/components-ui-badge.cjs.map +1 -0
- package/dist/components-ui-button-button.cjs +2 -0
- package/dist/components-ui-button-button.cjs.map +1 -0
- package/dist/components-ui-button-button.styles.cjs +9 -0
- package/dist/components-ui-button-button.styles.cjs.map +1 -0
- package/dist/components-ui-button.cjs +2 -0
- package/dist/components-ui-button.cjs.map +1 -0
- package/dist/components-ui-card-card.cjs +2 -0
- package/dist/components-ui-card-card.cjs.map +1 -0
- package/dist/components-ui-card-card.styles.cjs +8 -0
- package/dist/components-ui-card-card.styles.cjs.map +1 -0
- package/dist/components-ui-card.cjs +2 -0
- package/dist/components-ui-card.cjs.map +1 -0
- package/dist/components-ui-chart-chart.cjs +22 -0
- package/dist/components-ui-chart-chart.cjs.map +1 -0
- package/dist/components-ui-chart.cjs +2 -0
- package/dist/components-ui-chart.cjs.map +1 -0
- package/dist/components-ui-checkbox-checkbox.cjs +2 -0
- package/dist/components-ui-checkbox-checkbox.cjs.map +1 -0
- package/dist/components-ui-checkbox-checkbox.styles.cjs +2 -0
- package/dist/components-ui-checkbox-checkbox.styles.cjs.map +1 -0
- package/dist/components-ui-checkbox.cjs +2 -0
- package/dist/components-ui-checkbox.cjs.map +1 -0
- package/dist/components-ui-combobox-combobox.cjs +16 -0
- package/dist/components-ui-combobox-combobox.cjs.map +1 -0
- package/dist/components-ui-combobox-combobox.styles.cjs +36 -0
- package/dist/components-ui-combobox-combobox.styles.cjs.map +1 -0
- package/dist/components-ui-combobox.cjs +2 -0
- package/dist/components-ui-combobox.cjs.map +1 -0
- package/dist/components-ui-dialog-dialog.cjs +2 -0
- package/dist/components-ui-dialog-dialog.cjs.map +1 -0
- package/dist/components-ui-dialog-dialog.styles.cjs +2 -0
- package/dist/components-ui-dialog-dialog.styles.cjs.map +1 -0
- package/dist/components-ui-dialog.cjs +2 -0
- package/dist/components-ui-dialog.cjs.map +1 -0
- package/dist/components-ui-drawer-drawer.cjs +30 -0
- package/dist/components-ui-drawer-drawer.cjs.map +1 -0
- package/dist/components-ui-drawer.cjs +2 -0
- package/dist/components-ui-drawer.cjs.map +1 -0
- package/dist/components-ui-field-field.cjs +2 -0
- package/dist/components-ui-field-field.cjs.map +1 -0
- package/dist/components-ui-field-field.styles.cjs +9 -0
- package/dist/components-ui-field-field.styles.cjs.map +1 -0
- package/dist/components-ui-field.cjs +2 -0
- package/dist/components-ui-field.cjs.map +1 -0
- package/dist/components-ui-icon-icon-dictionary.cjs +2 -0
- package/dist/components-ui-icon-icon-dictionary.cjs.map +1 -0
- package/dist/components-ui-icon-icon.cjs +2 -0
- package/dist/components-ui-icon-icon.cjs.map +1 -0
- package/dist/components-ui-icon-overrides.cjs +2 -0
- package/dist/components-ui-icon-overrides.cjs.map +1 -0
- package/dist/components-ui-icon.cjs +2 -0
- package/dist/components-ui-icon.cjs.map +1 -0
- package/dist/components-ui-input-group-input-group.cjs +14 -0
- package/dist/components-ui-input-group-input-group.cjs.map +1 -0
- package/dist/components-ui-input-group-input-group.styles.cjs +8 -0
- package/dist/components-ui-input-group-input-group.styles.cjs.map +1 -0
- package/dist/components-ui-input-group.cjs +2 -0
- package/dist/components-ui-input-group.cjs.map +1 -0
- package/dist/components-ui-input-input.cjs +2 -0
- package/dist/components-ui-input-input.cjs.map +1 -0
- package/dist/components-ui-input-input.styles.cjs +8 -0
- package/dist/components-ui-input-input.styles.cjs.map +1 -0
- package/dist/components-ui-input.cjs +2 -0
- package/dist/components-ui-input.cjs.map +1 -0
- package/dist/components-ui-label-label.cjs +2 -0
- package/dist/components-ui-label-label.cjs.map +1 -0
- package/dist/components-ui-label.cjs +2 -0
- package/dist/components-ui-label.cjs.map +1 -0
- package/dist/components-ui-navigation-item-navigation-item.cjs +2 -0
- package/dist/components-ui-navigation-item-navigation-item.cjs.map +1 -0
- package/dist/components-ui-navigation-item-navigation-item.styles.cjs +3 -0
- package/dist/components-ui-navigation-item-navigation-item.styles.cjs.map +1 -0
- package/dist/components-ui-navigation-item.cjs +2 -0
- package/dist/components-ui-navigation-item.cjs.map +1 -0
- package/dist/components-ui-navigation-menu-navigation-menu.cjs +2 -0
- package/dist/components-ui-navigation-menu-navigation-menu.cjs.map +1 -0
- package/dist/components-ui-navigation-menu-navigation-menu.styles.cjs +2 -0
- package/dist/components-ui-navigation-menu-navigation-menu.styles.cjs.map +1 -0
- package/dist/components-ui-navigation-menu.cjs +2 -0
- package/dist/components-ui-navigation-menu.cjs.map +1 -0
- package/dist/components-ui-pagination-pagination.cjs +2 -0
- package/dist/components-ui-pagination-pagination.cjs.map +1 -0
- package/dist/components-ui-pagination.cjs +2 -0
- package/dist/components-ui-pagination.cjs.map +1 -0
- package/dist/components-ui-popover-popover.cjs +2 -0
- package/dist/components-ui-popover-popover.cjs.map +1 -0
- package/dist/components-ui-popover-popover.styles.cjs +7 -0
- package/dist/components-ui-popover-popover.styles.cjs.map +1 -0
- package/dist/components-ui-popover.cjs +2 -0
- package/dist/components-ui-popover.cjs.map +1 -0
- package/dist/components-ui-progress-progress.cjs +2 -0
- package/dist/components-ui-progress-progress.cjs.map +1 -0
- package/dist/components-ui-progress.cjs +2 -0
- package/dist/components-ui-progress.cjs.map +1 -0
- package/dist/components-ui-radio-group-radio-group.cjs +2 -0
- package/dist/components-ui-radio-group-radio-group.cjs.map +1 -0
- package/dist/components-ui-radio-group-radio-group.styles.cjs +2 -0
- package/dist/components-ui-radio-group-radio-group.styles.cjs.map +1 -0
- package/dist/components-ui-radio-group.cjs +2 -0
- package/dist/components-ui-radio-group.cjs.map +1 -0
- package/dist/components-ui-select-select.cjs +2 -0
- package/dist/components-ui-select-select.cjs.map +1 -0
- package/dist/components-ui-select-select.styles.cjs +31 -0
- package/dist/components-ui-select-select.styles.cjs.map +1 -0
- package/dist/components-ui-select.cjs +2 -0
- package/dist/components-ui-select.cjs.map +1 -0
- package/dist/components-ui-separator-separator.cjs +2 -0
- package/dist/components-ui-separator-separator.cjs.map +1 -0
- package/dist/components-ui-separator.cjs +2 -0
- package/dist/components-ui-separator.cjs.map +1 -0
- package/dist/components-ui-sonner-sonner.cjs +2 -0
- package/dist/components-ui-sonner-sonner.cjs.map +1 -0
- package/dist/components-ui-sonner-sonner.styles.cjs +36 -0
- package/dist/components-ui-sonner-sonner.styles.cjs.map +1 -0
- package/dist/components-ui-sonner.cjs +2 -0
- package/dist/components-ui-sonner.cjs.map +1 -0
- package/dist/components-ui-switch-switch.cjs +2 -0
- package/dist/components-ui-switch-switch.cjs.map +1 -0
- package/dist/components-ui-switch-switch.styles.cjs +2 -0
- package/dist/components-ui-switch-switch.styles.cjs.map +1 -0
- package/dist/components-ui-switch.cjs +2 -0
- package/dist/components-ui-switch.cjs.map +1 -0
- package/dist/components-ui-table-table.cjs +5 -0
- package/dist/components-ui-table-table.cjs.map +1 -0
- package/dist/components-ui-table.cjs +2 -0
- package/dist/components-ui-table.cjs.map +1 -0
- package/dist/components-ui-tabs-tabs.cjs +3 -0
- package/dist/components-ui-tabs-tabs.cjs.map +1 -0
- package/dist/components-ui-tabs-tabs.styles.cjs +2 -0
- package/dist/components-ui-tabs-tabs.styles.cjs.map +1 -0
- package/dist/components-ui-tabs.cjs +2 -0
- package/dist/components-ui-tabs.cjs.map +1 -0
- package/dist/components-ui-textarea-textarea.cjs +2 -0
- package/dist/components-ui-textarea-textarea.cjs.map +1 -0
- package/dist/components-ui-textarea-textarea.styles.cjs +5 -0
- package/dist/components-ui-textarea-textarea.styles.cjs.map +1 -0
- package/dist/components-ui-textarea.cjs +2 -0
- package/dist/components-ui-textarea.cjs.map +1 -0
- package/dist/components-ui-tooltip-tooltip.cjs +2 -0
- package/dist/components-ui-tooltip-tooltip.cjs.map +1 -0
- package/dist/components-ui-tooltip-tooltip.styles.cjs +8 -0
- package/dist/components-ui-tooltip-tooltip.styles.cjs.map +1 -0
- package/dist/components-ui-tooltip.cjs +2 -0
- package/dist/components-ui-tooltip.cjs.map +1 -0
- package/dist/components-ui-typography-typography.cjs +2 -0
- package/dist/components-ui-typography-typography.cjs.map +1 -0
- package/dist/components-ui-typography-typography.styles.cjs +2 -0
- package/dist/components-ui-typography-typography.styles.cjs.map +1 -0
- package/dist/components-ui-typography.cjs +2 -0
- package/dist/components-ui-typography.cjs.map +1 -0
- package/dist/hooks-usePopupControls.cjs +2 -0
- package/dist/hooks-usePopupControls.cjs.map +1 -0
- package/dist/index.cjs +1 -370
- package/dist/index.cjs.map +1 -1
- package/dist/lib-utils.cjs +2 -0
- package/dist/lib-utils.cjs.map +1 -0
- package/dist/types-types.cjs +2 -0
- package/dist/types-types.cjs.map +1 -0
- package/dist/utils-helpers.cjs +2 -0
- package/dist/utils-helpers.cjs.map +1 -0
- package/package.json +639 -12
- package/prettier.config.mjs +28 -0
- package/public/vite.svg +1 -0
- package/scripts/generate-exports.js +76 -0
- package/scripts/get-entry-points.ts +102 -0
- package/tsconfig.app.json +40 -0
- package/tsconfig.node.json +26 -0
- package/tsconfig.storybook.json +7 -0
- package/dist/components/app-pagination/app-pagination.stories.d.ts +0 -52
- package/dist/components/app-sidebar/app-sidebar.stories.d.ts +0 -52
- package/dist/components/avatar-uploader/avatar-uploader.stories.d.ts +0 -7
- package/dist/components/basic-avatar/basic-avatar.stories.d.ts +0 -15
- package/dist/components/basic-chart/basic-chart.stories.d.ts +0 -23
- package/dist/components/basic-checkbox/basic-checkbox.stories.d.ts +0 -37
- package/dist/components/basic-drawer/basic-drawer.stories.d.ts +0 -7
- package/dist/components/basic-modal/basic-modal.stories.d.ts +0 -57
- package/dist/components/basic-select/basic-select.stories.d.ts +0 -10
- package/dist/components/basic-table/basic-table.stories.d.ts +0 -9
- package/dist/components/files-uploader/files-uploader.stories.d.ts +0 -70
- package/dist/components/input-field/input-field.stories.d.ts +0 -48
- package/dist/components/input-password/input-password.stories.d.ts +0 -57
- package/dist/components/popover-modal/popover-modal.stories.d.ts +0 -32
- package/dist/components/radio-button/radio-button.stories.d.ts +0 -28
- package/dist/components/select-field/select-field.stories.d.ts +0 -39
- package/dist/components/select-groups/select-groups.stories.d.ts +0 -50
- package/dist/components/textarea-field/textarea-field.stories.d.ts +0 -43
- package/dist/components/ui/badge/badge.stories.d.ts +0 -29
- package/dist/components/ui/button/button.stories.d.ts +0 -30
- package/dist/components/ui/card/card.stories.d.ts +0 -38
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +0 -29
- package/dist/components/ui/combobox/combobox.stories.d.ts +0 -10
- package/dist/components/ui/dialog/dialog.stories.d.ts +0 -46
- package/dist/components/ui/field/field.stories.d.ts +0 -45
- package/dist/components/ui/icon/icon.stories.d.ts +0 -28
- package/dist/components/ui/input/input.stories.d.ts +0 -40
- package/dist/components/ui/input-group/input-group.stories.d.ts +0 -46
- package/dist/components/ui/label/label.stories.d.ts +0 -26
- package/dist/components/ui/navigation-item/navigation-item.stories.d.ts +0 -57
- package/dist/components/ui/navigation-menu/navigation-menu.stories.d.ts +0 -34
- package/dist/components/ui/pagination/pagination.stories.d.ts +0 -37
- package/dist/components/ui/popover/popover.stories.d.ts +0 -9
- package/dist/components/ui/progress/progress.stories.d.ts +0 -34
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +0 -27
- package/dist/components/ui/select/select.stories.d.ts +0 -38
- package/dist/components/ui/separator/separator.stories.d.ts +0 -27
- package/dist/components/ui/sonner/sonner.stories.d.ts +0 -9
- package/dist/components/ui/switch/switch.stories.d.ts +0 -23
- package/dist/components/ui/table/table.stories.d.ts +0 -68
- package/dist/components/ui/tabs/tabs.stories.d.ts +0 -32
- package/dist/components/ui/textarea/textarea.stories.d.ts +0 -30
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +0 -42
- package/dist/components/ui/typography/typography.stories.d.ts +0 -304
- package/dist/index.js +0 -47251
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),l=require("@radix-ui/react-checkbox");require("react");const r=require("./lib-utils.cjs"),u=require("./components-ui-icon-icon.cjs"),s=require("./components-ui-checkbox-checkbox.styles.cjs");function b(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const n=b(l),a=({className:e,ref:o,...t})=>c.jsx(n.Root,{ref:o,className:r.cn(s.checkboxRootClassName,e),...t,children:c.jsx(n.Indicator,{className:r.cn(s.checkboxIndicatorClassName),children:c.jsx(u.Icon,{type:"done",viewBox:"3 3 14 14"})})});a.displayName=n.Root.displayName;exports.Checkbox=a;
|
|
2
|
+
//# sourceMappingURL=components-ui-checkbox-checkbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-ui-checkbox-checkbox.cjs","sources":["../src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Icon } from \"../icon\";\nimport { checkboxIndicatorClassName, checkboxRootClassName } from \"./checkbox.styles\";\n\ntype CheckboxRef = React.ComponentRef<typeof CheckboxPrimitive.Root>;\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n ref?: React.Ref<CheckboxRef>;\n};\n\nconst Checkbox = ({ className, ref, ...props }: CheckboxProps) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(checkboxRootClassName, className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={cn(checkboxIndicatorClassName)}>\n <Icon\n type=\"done\"\n viewBox=\"3 3 14 14\"\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n);\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"names":["Checkbox","className","ref","props","jsx","CheckboxPrimitive","cn","checkboxRootClassName","checkboxIndicatorClassName","Icon"],"mappings":"8kBAYMA,EAAW,CAAC,CAAE,UAAAC,EAAW,IAAAC,EAAK,GAAGC,KACrCC,EAAAA,IAACC,EAAkB,KAAlB,CACC,IAAAH,EACA,UAAWI,EAAAA,GAAGC,EAAAA,sBAAuBN,CAAS,EAC7C,GAAGE,EAEJ,eAACE,EAAkB,UAAlB,CAA4B,UAAWC,KAAGE,EAAAA,0BAA0B,EACnE,SAAAJ,EAAAA,IAACK,EAAAA,KAAA,CACC,KAAK,OACL,QAAQ,WAAA,CAAA,CACV,CACF,CAAA,CACF,EAEFT,EAAS,YAAcK,EAAkB,KAAK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["peer bg-primary-bg border-inp-default-border grid size-5 shrink-0 cursor-pointer place-content-center rounded border","focus-visible:ring-inp-focus-border focus-visible:ring-1 focus-visible:outline-none","text-transparent transition-all duration-200","disabled:cursor-not-allowed","disabled:border-disabled-border disabled:bg-disabled-bg","disabled:data-[state=checked]:bg-disabled-bg","disabled:data-[state=checked]:border-disabled-border","disabled:data-[state=checked]:text-disabled-text","data-[state=checked]:border-primary-inverse-bg","data-[state=checked]:bg-primary-inverse-bg data-[state=checked]:text-primary-inverse-text","enabled:hover:border-inp-hover-border","enabled:hover:data-[state=checked]:bg-primary-inverse-hover-bg","enabled:hover:data-[state=checked]:border-primary-inverse-hover-bg"].join(" "),r="grid place-content-center text-current";exports.checkboxIndicatorClassName=r;exports.checkboxRootClassName=e;
|
|
2
|
+
//# sourceMappingURL=components-ui-checkbox-checkbox.styles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-ui-checkbox-checkbox.styles.cjs","sources":["../src/components/ui/checkbox/checkbox.styles.ts"],"sourcesContent":["export const checkboxRootClassName = [\n \"peer bg-primary-bg border-inp-default-border grid size-5 shrink-0 cursor-pointer place-content-center rounded border\",\n \"focus-visible:ring-inp-focus-border focus-visible:ring-1 focus-visible:outline-none\",\n \"text-transparent transition-all duration-200\",\n \"disabled:cursor-not-allowed\",\n \"disabled:border-disabled-border disabled:bg-disabled-bg\",\n \"disabled:data-[state=checked]:bg-disabled-bg\",\n \"disabled:data-[state=checked]:border-disabled-border\",\n \"disabled:data-[state=checked]:text-disabled-text\",\n \"data-[state=checked]:border-primary-inverse-bg\",\n \"data-[state=checked]:bg-primary-inverse-bg data-[state=checked]:text-primary-inverse-text\",\n \"enabled:hover:border-inp-hover-border\",\n \"enabled:hover:data-[state=checked]:bg-primary-inverse-hover-bg\",\n \"enabled:hover:data-[state=checked]:border-primary-inverse-hover-bg\",\n].join(\" \");\n\nexport const checkboxIndicatorClassName = \"grid place-content-center text-current\";\n"],"names":["checkboxRootClassName","checkboxIndicatorClassName"],"mappings":"gFAAO,MAAMA,EAAwB,CACnC,uHACA,sFACA,+CACA,8BACA,0DACA,+CACA,uDACA,mDACA,iDACA,4FACA,wCACA,iEACA,oEACF,EAAE,KAAK,GAAG,EAEGC,EAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-ui-checkbox.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";var Ec=Object.defineProperty;var Cc=(e,t,n)=>t in e?Ec(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Cc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),Lt=require("react"),Ze=require("./lib-utils.cjs"),vc=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const Mn=require("./components-ui-field-field.cjs"),or=require("./components-ui-icon-icon.cjs"),Kn=require("./components-ui-input-group-input-group.cjs"),$e=require("./components-ui-combobox-combobox.styles.cjs"),Gr=require("reselect"),Rc=require("react-dom"),Kt=require("tabbable");function Ts(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=Ts(Lt),Xt=Ts(Rc);function Po({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){u.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
2
|
+
`))},[o,n,e]);const{current:l}=u.useRef(t);u.useEffect(()=>{!r&&JSON.stringify(l)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
3
|
+
`))},[JSON.stringify(t)])}const a=u.useCallback(l=>{r||i(l)},[]);return[c,a]}const Wr={};function ut(e,t){const n=u.useRef(Wr);return n.current===Wr&&(n.current=e(t)),n}const Ao=u[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],wc=Ao&&Ao!==u.useLayoutEffect?Ao:e=>e();function Y(e){const t=ut(Sc).current;return t.next=e,wc(t.effect),t.trampoline}function Sc(){const e={next:void 0,callback:Ic,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ic(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Oc=()=>{},Q=typeof document<"u"?u.useLayoutEffect:Oc,rr=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(rr.displayName="CompositeListContext");function Pc(){return u.useContext(rr)}function Ns(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=Y(r),i=u.useRef(0),c=ut(Tc).current,a=ut(Ac).current,[l,p]=u.useState(0),d=u.useRef(l),b=Y((y,m)=>{a.set(y,m??null),d.current+=1,p(d.current)}),f=Y(y=>{a.delete(y),d.current+=1,p(d.current)}),g=u.useMemo(()=>{const y=new Map;return Array.from(a.keys()).filter(v=>v.isConnected).sort(Nc).forEach((v,E)=>{const C=a.get(v)??{};y.set(v,{...C,index:E})}),y},[a,l]);Q(()=>{if(typeof MutationObserver!="function"||g.size===0)return;const y=new MutationObserver(m=>{const v=new Set,E=C=>v.has(C)?v.delete(C):v.add(C);m.forEach(C=>{C.removedNodes.forEach(E),C.addedNodes.forEach(E)}),v.size===0&&(d.current+=1,p(d.current))});return g.forEach((m,v)=>{v.parentElement&&y.observe(v.parentElement,{childList:!0})}),()=>{y.disconnect()}},[g]),Q(()=>{d.current===l&&(n.current.length!==g.size&&(n.current.length=g.size),o&&o.current.length!==g.size&&(o.current.length=g.size),i.current=g.size),s(g)},[s,g,n,o,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const x=Y(y=>(c.add(y),()=>{c.delete(y)}));Q(()=>{c.forEach(y=>y(g))},[c,g]);const h=u.useMemo(()=>({register:b,unregister:f,subscribeMapChange:x,elementsRef:n,labelsRef:o,nextIndexRef:i}),[b,f,x,n,o,i]);return j.jsx(rr.Provider,{value:h,children:t})}function Ac(){return new Map}function Tc(){return new Set}function Nc(e,t){const n=e.compareDocumentPosition(t);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}const ks=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(ks.displayName="DirectionContext");function Ms(){return u.useContext(ks)?.direction??"ltr"}function gt(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}function En(e,t,n,o){const r=ut(Vs).current;return Mc(r,e,t,n,o)&&Ds(r,[e,t,n,o]),r.callback}function kc(e){const t=ut(Vs).current;return Vc(t,e)&&Ds(t,e),t.callback}function Vs(){return{callback:null,cleanup:null,refs:[]}}function Mc(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Vc(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Ds(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Dc=parseInt(u.version,10);function sr(e){return Dc>=e}function Ur(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(sr(19)?n?.ref:t.ref)??null}function $o(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Lc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function _c(e,t){return typeof e=="function"?e(t):e}function Fc(e,t){return typeof e=="function"?e(t):e}const mn={};function Ls(e,t,n,o,r){let s={...Go(e,mn)};return t&&(s=qn(s,t)),n&&(s=qn(s,n)),o&&(s=qn(s,o)),s}function Bc(e){if(e.length===0)return mn;if(e.length===1)return Go(e[0],mn);let t={...Go(e[0],mn)};for(let n=1;n<e.length;n+=1)t=qn(t,e[n]);return t}function qn(e,t){return _s(t)?t(e):jc(e,t)}function jc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=$o(e.style,o);break}case"className":{e[n]=Fs(e.className,o);break}default:Hc(n,o)?e[n]=$c(e[n],o):e[n]=o}}return e}function Hc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function _s(e){return typeof e=="function"}function Go(e,t){return _s(e)?e(t):e??mn}function $c(e,t){return t?e?n=>{if(Gc(n)){const r=n;Wo(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Wo(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Fs(e,t){return t?e?t+" "+e:t:e}function Gc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function we(){}const Vn=Object.freeze([]),We=Object.freeze({}),Wc={style:{transition:"none"}},Uc="data-base-ui-click-trigger",Kc={fallbackAxisSide:"none"},qc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ue(e,t,n={}){const o=t.render,r=zc(t,n);if(n.enabled===!1)return null;const s=n.state??We;return Xc(e,o,r,s)}function zc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=We,ref:i,props:c,stateAttributesMapping:a,enabled:l=!0}=t,p=l?_c(n,s):void 0,d=l?Fc(o,s):void 0,b=l?Lc(s,a):We,f=l?$o(b,Array.isArray(c)?Bc(c):c)??We:We;return typeof document<"u"&&(l?Array.isArray(i)?f.ref=kc([f.ref,Ur(r),...i]):f.ref=En(f.ref,Ur(r),i):En(null,null)),l?(p!==void 0&&(f.className=Fs(f.className,p)),d!==void 0&&(f.style=$o(f.style,d)),f):We}const Yc=Symbol.for("react.lazy");function Xc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Ls(n,t.props);r.ref=n.ref;let s=t;if(s?.$$typeof===Yc&&(s=u.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!u.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
4
|
+
`));return u.cloneElement(s,r)}if(e&&typeof e=="string")return Jc(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":gt(8))}function Jc(e,t){return e==="button"?Lt.createElement("button",{type:"button",...t,key:t.key}):e==="img"?Lt.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}const it="none",Uo="trigger-press",Qc="trigger-hover",ir="outside-press",Zc="item-press",Kr="clear-press",el="chip-remove-press",Zt="input-change",Nt="input-clear",tl="input-press",no="focus-out",Bs="escape-key",hn="list-navigation";function ce(e,t,n,o){let r=!1,s=!1;const i=We;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function fn(e,t,n){const o=n??We;return{reason:e,event:t??new Event("base-ui"),...o}}const Ko={...u};let qr=0;function nl(e,t="mui"){const[n,o]=u.useState(e),r=e||n;return u.useEffect(()=>{n==null&&(qr+=1,o(`${t}-${qr}`))},[n,t]),r}const zr=Ko.useId;function cr(e,t){if(zr!==void 0){const n=zr();return e??(t?`${t}-${n}`:n)}return nl(e,t)}function lr(e){return cr(e,"base-ui")}const ol=[];function js(e){u.useEffect(e,ol)}const Dn=null;let Yr=globalThis.requestAnimationFrame;class rl{constructor(){Pe(this,"callbacks",[]);Pe(this,"callbacksCount",0);Pe(this,"nextId",1);Pe(this,"startId",1);Pe(this,"isScheduled",!1);Pe(this,"tick",t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const o=process.env.NODE_ENV!=="production"&&Yr!==requestAnimationFrame&&(Yr=requestAnimationFrame,!0);return(!this.isScheduled||o)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ln=new rl;class xt{constructor(){Pe(this,"currentId",Dn);Pe(this,"cancel",()=>{this.currentId!==Dn&&(Ln.cancel(this.currentId),this.currentId=Dn)});Pe(this,"disposeEffect",()=>this.cancel)}static create(){return new xt}static request(t){return Ln.request(t)}static cancel(t){return Ln.cancel(t)}request(t){this.cancel(),this.currentId=Ln.request(()=>{this.currentId=Dn,t()})}}function ur(){const e=ut(xt.create).current;return js(e.disposeEffect),e}function vt(e){return e==null?e:"current"in e?e.current:e}let Cn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const sl={[Cn.startingStyle]:""},il={[Cn.endingStyle]:""},Hs={transitionStatus(e){return e==="starting"?sl:e==="ending"?il:null}};function cl(e,t=!1,n=!0){const o=ur();return Y((r,s=null)=>{o.cancel();function i(){Xt.flushSync(r)}const c=vt(e);if(c==null)return;const a=c;if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const d=Cn.startingStyle;if(!a.hasAttribute(d)){o.request(p);return}const b=new MutationObserver(()=>{a.hasAttribute(d)||(b.disconnect(),p())});b.observe(a,{attributes:!0,attributeFilter:[d]}),s?.addEventListener("abort",()=>b.disconnect(),{once:!0})},p=function(){Promise.all(a.getAnimations().map(d=>d.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const d=a.getAnimations();if(n){if(s?.aborted)return;i()}else d.length>0&&d.some(b=>b.pending||b.playState!=="finished")&&p()})};if(t){l();return}o.request(p)}})}function $s(e,t=!1,n=!1){const[o,r]=u.useState(e&&t?"idle":void 0),[s,i]=u.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),Q(()=>{if(!e&&s&&o!=="ending"&&n){const c=xt.request(()=>{r("ending")});return()=>{xt.cancel(c)}}},[e,s,o,n]),Q(()=>{if(!e||t)return;const c=xt.request(()=>{r(void 0)});return()=>{xt.cancel(c)}},[t,e]),Q(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=xt.request(()=>{r("idle")});return()=>{xt.cancel(c)}},[t,e,s,r,o]),u.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Gs=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Ws(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:c,subscribeMapChange:a,elementsRef:l,labelsRef:p,nextIndexRef:d}=Pc(),b=u.useRef(-1),[f,g]=u.useState(s??(r===Gs.GuessFromOrder?()=>{if(b.current===-1){const y=d.current;d.current+=1,b.current=y}return b.current}:-1)),x=u.useRef(null),h=u.useCallback(y=>{if(x.current=y,f!==-1&&y!==null&&(l.current[f]=y,p)){const m=t!==void 0;p.current[f]=m?t:o?.current?.textContent??y.textContent}},[f,l,p,t,o]);return Q(()=>{if(s!=null)return;const y=x.current;if(y)return i(y,n),()=>{c(y)}},[s,i,c,n]),Q(()=>{if(s==null)return a(y=>{const m=x.current?y.get(x.current)?.index:null;m!=null&&g(m)})},[s,a,g]),u.useMemo(()=>({ref:h,index:f}),[f,h])}function oo(){return typeof window<"u"}function _t(e){return ar(e)?(e.nodeName||"").toLowerCase():"#document"}function Fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(ar(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ar(e){return oo()?e instanceof Node||e instanceof Fe(e).Node:!1}function ve(e){return oo()?e instanceof Element||e instanceof Fe(e).Element:!1}function ke(e){return oo()?e instanceof HTMLElement||e instanceof Fe(e).HTMLElement:!1}function qo(e){return!oo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fe(e).ShadowRoot}function Ft(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ll(e){return/^(table|td|th)$/.test(_t(e))}function ro(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ul=/transform|translate|scale|rotate|perspective|filter/,al=/paint|layout|strict|content/,Wt=e=>!!e&&e!=="none";let To;function fr(e){const t=ve(e)?rt(e):e;return Wt(t.transform)||Wt(t.translate)||Wt(t.scale)||Wt(t.rotate)||Wt(t.perspective)||!so()&&(Wt(t.backdropFilter)||Wt(t.filter))||ul.test(t.willChange||"")||al.test(t.contain||"")}function fl(e){let t=St(e);for(;ke(t)&&!wt(t);){if(fr(t))return t;if(ro(t))return null;t=St(t)}return null}function so(){return To==null&&(To=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),To}function wt(e){return/^(html|body|#document)$/.test(_t(e))}function rt(e){return Fe(e).getComputedStyle(e)}function io(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(_t(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qo(e)&&e.host||Et(e);return qo(t)?t.host:t}function Us(e){const t=St(e);return wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Ft(t)?t:Us(t)}function Mt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Us(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Fe(r);if(s){const c=zo(i);return t.concat(i,i.visualViewport||[],Ft(r)?r:[],c&&n?Mt(c):[])}else return t.concat(r,Mt(r,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let Yo;process.env.NODE_ENV!=="production"&&(Yo=new Set);function Xr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Yo.has(t)||(Yo.add(t),console.error(`Base UI: ${t}`))}}const Ks=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ks.displayName="CompositeRootContext");function dl(e=!1){const t=u.useContext(Ks);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":gt(16));return t}function pl(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:u.useMemo(()=>{const l={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function co(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=u.useRef(null),i=dl(!0)!==void 0,c=Y(()=>{const b=s.current;return!!(b?.tagName==="A"&&b?.href)}),{props:a}=pl({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r});process.env.NODE_ENV!=="production"&&u.useEffect(()=>{if(!s.current)return;const b=s.current.tagName==="BUTTON";if(r){if(!b){const f=Ko.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${f}`)}}else if(b){const f=Ko.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${f}`)}},[r]);const l=u.useCallback(()=>{const b=s.current;ml(b)&&i&&t&&a.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,a.disabled,i]);Q(l,[l]);const p=u.useCallback((b={})=>{const{onClick:f,onMouseDown:g,onKeyUp:x,onKeyDown:h,onPointerDown:y,...m}=b;return Ls({type:r?"button":void 0,onClick(E){if(t){E.preventDefault();return}f?.(E)},onMouseDown(E){t||g?.(E)},onKeyDown(E){if(t||(Wo(E),h?.(E)),E.baseUIHandlerPrevented)return;const C=E.target===E.currentTarget&&!r&&!c()&&!t,S=E.key==="Enter",w=E.key===" ";C&&((w||S)&&E.preventDefault(),S&&f?.(E))},onKeyUp(E){t||(Wo(E),x?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!r&&!t&&E.key===" "&&f?.(E)},onPointerDown(E){if(t){E.preventDefault();return}y?.(E)}},r?void 0:{role:"button"},a,m)},[t,a,r,c]),d=Y(b=>{s.current=b,l()});return{getButtonProps:p,buttonRef:d}}function ml(e){return ke(e)&&e.tagName==="BUTTON"}const Jt=typeof navigator<"u",No=bl(),qs=yl(),dr=xl(),zs=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ys=No.platform==="MacIntel"&&No.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(No.platform),Jr=Jt&&/firefox/i.test(dr),hl=Jt&&/apple/i.test(navigator.vendor),Yn=Jt&&/android/i.test(qs)||/android/i.test(dr);Jt&&qs.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const gl=dr.includes("jsdom/");function bl(){if(!Jt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xl(){if(!Jt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function yl(){if(!Jt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Xo="data-base-ui-focusable",Xs="active",Js="selected",El="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Vt="ArrowLeft",Dt="ArrowRight",pr="ArrowUp",Rn="ArrowDown";function Rt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&qo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ht(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Cl(e){return e.matches("html,body")}function mr(e){return ke(e)&&e.matches(El)}function Jo(e){return e?e.getAttribute("role")==="combobox"&&mr(e):!1}function Qo(e){return e?e.hasAttribute(Xo)?e:e.querySelector(`[${Xo}]`)||e:null}function tn(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...tn(e,r.id,n)])}function Qr(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ce(e){e.preventDefault(),e.stopPropagation()}function vl(e){return"nativeEvent"in e}function Qs(e){return e.pointerType===""&&e.isTrusted?!0:Yn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Zs(e){return gl?!1:!Yn&&e.width===0&&e.height===0||Yn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){return["mouse","pen"].includes(e)}function ei(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Rl=["top","right","bottom","left"],rn=Math.min,nt=Math.max,Xn=Math.round,en=Math.floor,yt=e=>({x:e,y:e}),wl={left:"right",right:"left",bottom:"top",top:"bottom"};function Zo(e,t,n){return nt(e,rn(t,n))}function It(e,t){return typeof e=="function"?e(t):e}function ot(e){return e.split("-")[0]}function Bt(e){return e.split("-")[1]}function hr(e){return e==="x"?"y":"x"}function gr(e){return e==="y"?"height":"width"}function lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function br(e){return hr(lt(e))}function Sl(e,t,n){n===void 0&&(n=!1);const o=Bt(e),r=br(e),s=gr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Jn(i)),[i,Jn(i)]}function Il(e){const t=Jn(e);return[er(e),t,er(t)]}function er(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const es=["left","right"],ts=["right","left"],Ol=["top","bottom"],Pl=["bottom","top"];function Al(e,t,n){switch(e){case"top":case"bottom":return n?t?ts:es:t?es:ts;case"left":case"right":return t?Ol:Pl;default:return[]}}function Tl(e,t,n,o){const r=Bt(e);let s=Al(ot(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(er)))),s}function Jn(e){const t=ot(e);return wl[t]+e.slice(t.length)}function Nl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ti(e){return typeof e!="number"?Nl(e):{top:e,right:e,bottom:e,left:e}}function Qn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function _n(e,t,n){return Math.floor(e/t)!==n}function gn(e,t){return t<0||t>=e.current.length}function ko(e,t){return He(e,{disabledIndices:t})}function ns(e,t){return He(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function He(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&bn(e,s,o));return s}function kl(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:c,maxIndex:a,prevIndex:l,stopEvent:p=!1}){let d=l;const b=[],f={};let g=!1;{let y=null,m=-1;e.current.forEach((v,E)=>{if(v==null)return;const C=v.closest('[role="row"]');C&&(g=!0),(C!==y||m===-1)&&(y=C,m+=1,b[m]=[]),b[m].push(E),f[E]=m})}const x=g&&b.length>0&&b.some(y=>y.length!==s);function h(y){if(!x||l===-1)return;const m=f[l];if(m==null)return;const v=b[m].indexOf(l);let E=y==="up"?m-1:m+1;o&&(E<0?E=b.length-1:E>=b.length&&(E=0));const C=new Set;for(;E>=0&&E<b.length&&!C.has(E);){C.add(E);const S=b[E];if(S.length===0){E=y==="up"?E-1:E+1;continue}const w=Math.min(v,S.length-1);for(let I=w;I>=0;I-=1){const U=S[I];if(!bn(e,U,i))return U}E=y==="up"?E-1:E+1,o&&(E<0?E=b.length-1:E>=b.length&&(E=0))}}if(t.key===pr){const y=h("up");if(y!==void 0)p&&Ce(t),d=y;else{if(p&&Ce(t),l===-1)d=a;else if(d=He(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(l-s<c||d<0)){const m=l%s,v=a%s,E=a-(v-m);v===m?d=a:d=v>m?E:E-s}gn(e,d)&&(d=l)}}if(t.key===Rn){const y=h("down");y!==void 0?(p&&Ce(t),d=y):(p&&Ce(t),l===-1?d=c:(d=He(e,{startingIndex:l,amount:s,disabledIndices:i}),o&&l+s>a&&(d=He(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),gn(e,d)&&(d=l))}if(n==="both"){const y=en(l/s);t.key===(r?Vt:Dt)&&(p&&Ce(t),l%s!==s-1?(d=He(e,{startingIndex:l,disabledIndices:i}),o&&_n(d,s,y)&&(d=He(e,{startingIndex:l-l%s-1,disabledIndices:i}))):o&&(d=He(e,{startingIndex:l-l%s-1,disabledIndices:i})),_n(d,s,y)&&(d=l)),t.key===(r?Dt:Vt)&&(p&&Ce(t),l%s!==0?(d=He(e,{startingIndex:l,decrement:!0,disabledIndices:i}),o&&_n(d,s,y)&&(d=He(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):o&&(d=He(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),_n(d,s,y)&&(d=l));const m=en(a/s)===y;gn(e,d)&&(o&&m?d=t.key===(r?Dt:Vt)?a:He(e,{startingIndex:l-l%s-1,disabledIndices:i}):d=l)}return d}function Ml(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},c)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${c} is greater than grid columns`);let a=!1;for(;!a;){const l=[];for(let p=0;p<s;p+=1)for(let d=0;d<i;d+=1)l.push(r+p+d*t);r%t+s<=t&&l.every(p=>o[p]==null)?(l.forEach(p=>{o[p]=c}),a=!0):r+=1}}),[...o]}function Vl(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function Dl(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function bn(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}function Ne(e){return e?.ownerDocument||document}const wn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ni(e,t){const n=Kt.tabbable(e,wn()),o=n.length;if(o===0)return;const r=Rt(Ne(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function oi(e){return ni(Ne(e).body,1)||e}function ri(e){return ni(Ne(e).body,-1)||e}function xn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!me(n,o)}function Ll(e){Kt.tabbable(e,wn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function os(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function xr(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=cl(o,n,!1);u.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}const dn=0;class sn{constructor(){Pe(this,"currentId",dn);Pe(this,"clear",()=>{this.currentId!==dn&&(clearTimeout(this.currentId),this.currentId=dn)});Pe(this,"disposeEffect",()=>this.clear)}static create(){return new sn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dn,n()},t)}isStarted(){return this.currentId!==dn}}function qt(){const e=ut(sn.create).current;return js(e.disposeEffect),e}let rs={},ss={},is="";function _l(e){if(typeof document>"u")return!1;const t=Ne(e);return Fe(t).innerWidth-t.documentElement.clientWidth>0}function Fl(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ne(e),o=n.documentElement,r=n.body,s=Ft(o)?o:r,i=s.style.overflowY,c=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=c,a===l}function Bl(e){const t=Ne(e),n=t.documentElement,o=t.body,r=Ft(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function jl(e){const t=Ne(e),n=t.documentElement,o=t.body,r=Fe(n);let s=0,i=0,c=!1;const a=xt.create();if(zs&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const b=r.getComputedStyle(n),f=r.getComputedStyle(o),h=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,rs={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},is=n.style.scrollBehavior,ss={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,m=n.scrollWidth>n.clientWidth,v=b.overflowY==="scroll"||f.overflowY==="scroll",E=b.overflowX==="scroll"||f.overflowX==="scroll",C=Math.max(0,r.innerWidth-o.clientWidth),S=Math.max(0,r.innerHeight-o.clientHeight),w=parseFloat(f.marginTop)+parseFloat(f.marginBottom),I=parseFloat(f.marginLeft)+parseFloat(f.marginRight),U=Ft(n)?n:o;if(c=Fl(e),c){n.style.scrollbarGutter=h,U.style.overflowY="hidden",U.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),(y||v)&&(n.style.overflowY="scroll"),(m||E)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:w||S?`calc(100dvh - ${w+S}px)`:"100dvh",width:I||C?`calc(100vw - ${I+C}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,rs),Object.assign(o.style,ss),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=is)}function d(){p(),a.request(l)}return l(),r.addEventListener("resize",d),()=>{a.cancel(),p(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",d)}}class Hl{constructor(){Pe(this,"lockCount",0);Pe(this,"restore",null);Pe(this,"timeoutLock",sn.create());Pe(this,"timeoutUnlock",sn.create());Pe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pe(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ne(t).documentElement,r=Fe(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=we;return}const s=Ys||!_l(t);this.restore=s?Bl(t):jl(t)}}const $l=new Hl;function Gl(e=!0,t=null){Q(()=>{if(e)return $l.acquire(t)},[e,t])}function ct(e){const t=ut(Wl,e).current;return t.next=e,Q(t.effect),t}function Wl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ul(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const si=u.createContext(null);process.env.NODE_ENV!=="production"&&(si.displayName="FloatingNodeContext");const ii=u.createContext(null);process.env.NODE_ENV!=="production"&&(ii.displayName="FloatingTreeContext");const ci=()=>u.useContext(si)?.id||null,lo=e=>{const t=u.useContext(ii);return e??t};function Zn(e){return`data-base-ui-${e}`}const li={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},yr={...li,position:"fixed",top:0,left:0},Kl={...li,position:"absolute"},vn=u.forwardRef(function(t,n){const[o,r]=u.useState();Q(()=>{hl&&r("button")},[]);const s={tabIndex:0,role:o};return j.jsx("span",{...t,ref:n,style:yr,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(vn.displayName="FocusGuard");let cs=0;function yn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(cs);const s=()=>e?.focus({preventScroll:n});r?s():cs=requestAnimationFrame(s)}const nn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ls(e){return e==="inert"?nn.inert:e==="aria-hidden"?nn["aria-hidden"]:nn.none}let Fn=new WeakSet,Bn={},Mo=0;const ui=e=>e&&(e.host||ui(e.parentNode)),ql=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ui(n);return e.contains(o)?o:null}).filter(n=>n!=null);function zl(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=ql(t,e),c=new Set,a=new Set(i),l=[];Bn[r]||(Bn[r]=new WeakMap);const p=Bn[r];i.forEach(d),b(t),c.clear();function d(f){!f||c.has(f)||(c.add(f),f.parentNode&&d(f.parentNode))}function b(f){!f||a.has(f)||[].forEach.call(f.children,g=>{if(_t(g)!=="script")if(c.has(g))b(g);else{const x=s?g.getAttribute(s):null,h=x!==null&&x!=="false",y=ls(s),m=(y.get(g)||0)+1,v=(p.get(g)||0)+1;y.set(g,m),p.set(g,v),l.push(g),m===1&&h&&Fn.add(g),v===1&&g.setAttribute(r,""),!h&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return Mo+=1,()=>{l.forEach(f=>{const g=ls(s),h=(g.get(f)||0)-1,y=(p.get(f)||0)-1;g.set(f,h),p.set(f,y),h||(!Fn.has(f)&&s&&f.removeAttribute(s),Fn.delete(f)),y||f.removeAttribute(r)}),Mo-=1,Mo||(nn.inert=new WeakMap,nn["aria-hidden"]=new WeakMap,nn.none=new WeakMap,Fn=new WeakSet,Bn={})}}function Yl(e,t=!1,n=!1){const o=Ne(e[0]).body;return zl(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Er=u.createContext(null);process.env.NODE_ENV!=="production"&&(Er.displayName="PortalContext");const ai=()=>u.useContext(Er),Xl=Zn("portal");function Jl(e={}){const{ref:t,container:n,componentProps:o=We,elementProps:r}=e,s=cr(),c=ai()?.portalNode,[a,l]=u.useState(null),[p,d]=u.useState(null),b=Y(h=>{h!==null&&d(h)}),f=u.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(s==null)return;const h=(n&&(ar(n)?n:n.current))??c??document.body;if(h==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==h&&(f.current=h,d(null),l(h))},[n,c,s]);const g=Ue("div",o,{ref:[t,b],props:[{id:s,[Xl]:""},r]});return{portalNode:p,portalSubtree:a&&g?Xt.createPortal(g,a):null}}const fi=u.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...a}=t,{portalNode:l,portalSubtree:p}=Jl({container:r,ref:n,componentProps:t,elementProps:a}),d=u.useRef(null),b=u.useRef(null),f=u.useRef(null),g=u.useRef(null),[x,h]=u.useState(null),y=x?.modal,m=x?.open,v=typeof c=="boolean"?c:!!x&&!x.modal&&x.open&&!!l;u.useEffect(()=>{if(!l||y)return;function C(S){l&&S.relatedTarget&&xn(S)&&(S.type==="focusin"?os:Ll)(l)}return l.addEventListener("focusin",C,!0),l.addEventListener("focusout",C,!0),()=>{l.removeEventListener("focusin",C,!0),l.removeEventListener("focusout",C,!0)}},[l,y]),u.useEffect(()=>{!l||m||os(l)},[m,l]);const E=u.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:b,beforeInsideRef:f,afterInsideRef:g,portalNode:l,setFocusManagerState:h}),[l]);return j.jsxs(u.Fragment,{children:[p,j.jsxs(Er.Provider,{value:E,children:[v&&l&&j.jsx(vn,{"data-type":"outside",ref:d,onFocus:C=>{if(xn(C,l))f.current?.focus();else{const S=x?x.domReference:null;ri(S)?.focus()}}}),v&&l&&j.jsx("span",{"aria-owns":l.id,style:qc}),l&&Xt.createPortal(o,l),v&&l&&j.jsx(vn,{"data-type":"outside",ref:b,onFocus:C=>{if(xn(C,l))g.current?.focus();else{const S=x?x.domReference:null;oi(S)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,ce(no,C.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(fi.displayName="FloatingPortal");function Ql(e,t){const n=Fe(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const us=20;let kt=[];function Cr(){kt=kt.filter(e=>e.deref()?.isConnected)}function Zl(e){Cr(),e&&_t(e)!=="body"&&(kt.push(new WeakRef(e)),kt.length>us&&(kt=kt.slice(-us)))}function Vo(){return Cr(),kt[kt.length-1]?.deref()}function eu(e){if(!e)return null;const t=wn();return Kt.isTabbable(e,t)?e:Kt.tabbable(e,t)[0]||e}function tu(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():rt(e).display!=="none"}function as(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=wn(),r=Kt.focusable(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return Kt.isTabbable(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function nu(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:a=!0,openInteractionType:l="",nextFocusableElement:p,previousFocusableElement:d,beforeContentFocusGuardRef:b,externalTree:f}=e,g="rootStore"in t?t.rootStore:t,x=g.useState("open"),h=g.useState("domReferenceElement"),y=g.useState("floatingElement"),{events:m,dataRef:v}=g.context,E=Y(()=>v.current.floatingContext?.nodeId),C=r===!1,S=Jo(h)&&C,w=u.useRef(["content"]),I=ct(r),U=ct(s),q=ct(l),K=lo(f),V=ai(),X=u.useRef(null),Z=u.useRef(null),B=u.useRef(!1),M=u.useRef(!1),G=u.useRef(!1),_=u.useRef(-1),J=u.useRef(""),ne=u.useRef(""),ye=u.useRef(null),ae=u.useRef(null),he=En(ye,b,V?.beforeInsideRef),se=En(ae,V?.afterInsideRef),pe=qt(),Me=qt(),Se=ur(),Re=V!=null,re=Qo(y),fe=Y((k=re)=>k?Kt.tabbable(k,wn()):[]),xe=Y(k=>{const D=fe(k);return w.current.map(()=>D).filter(Boolean).flat()});u.useEffect(()=>{if(o||!c)return;function k(ie){ie.key==="Tab"&&me(re,Rt(Ne(re)))&&fe().length===0&&!S&&Ce(ie)}const D=Ne(re);return D.addEventListener("keydown",k),()=>{D.removeEventListener("keydown",k)}},[o,h,re,c,w,S,fe,xe]),u.useEffect(()=>{if(o||!x)return;const k=Ne(re);function D(){G.current=!1}function ie(L){const F=Qe(L),P=me(y,F)||me(h,F)||me(V?.portalNode,F);G.current=!P,ne.current=L.pointerType||"keyboard",F?.closest(`[${Uc}]`)&&(M.current=!0)}function R(){ne.current="keyboard"}return k.addEventListener("pointerdown",ie,!0),k.addEventListener("pointerup",D,!0),k.addEventListener("pointercancel",D,!0),k.addEventListener("keydown",R,!0),()=>{k.removeEventListener("pointerdown",ie,!0),k.removeEventListener("pointerup",D,!0),k.removeEventListener("pointercancel",D,!0),k.removeEventListener("keydown",R,!0)}},[o,y,h,re,x,V]),u.useEffect(()=>{if(o||!a)return;const k=Ne(re);function D(){M.current=!0,Me.start(0,()=>{M.current=!1})}function ie(H){const T=Qe(H),te=fe().indexOf(T);te!==-1&&(_.current=te)}function R(H){const T=H.relatedTarget,W=H.currentTarget,te=Qe(H);queueMicrotask(()=>{const ue=E(),Ve=g.context.triggerElements,Ke=T?.hasAttribute(Zn("focus-guard"))&&[ye.current,ae.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,vt(d),vt(p)].includes(T),Ie=!(me(h,T)||me(y,T)||me(T,y)||me(V?.portalNode,T)||T!=null&&Ve.hasElement(T)||Ve.hasMatchingElement(ge=>me(ge,T))||Ke||K&&(tn(K.nodesRef.current,ue).find(ge=>me(ge.context?.elements.floating,T)||me(ge.context?.elements.domReference,T))||Qr(K.nodesRef.current,ue).find(ge=>[ge.context?.elements.floating,Qo(ge.context?.elements.floating)].includes(T)||ge.context?.elements.domReference===T)));if(W===h&&re&&as(re,w),i&&W!==h&&!tu(te)&&Rt(k)===k.body){if(ke(re)&&(re.focus(),i==="popup")){Se.request(()=>{re.focus()});return}const ge=_.current,Ae=fe(),qe=Ae[ge]||Ae[Ae.length-1]||re;ke(qe)&&qe.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(S||!c)&&T&&Ie&&!M.current&&(S||T!==Vo())&&(B.current=!0,g.setOpen(!1,ce(no,H)))})}function L(){G.current||(v.current.insideReactTree=!0,pe.start(0,()=>{v.current.insideReactTree=!1}))}const F=ke(h)?h:null,P=[];if(!(!y&&!F))return F&&(F.addEventListener("focusout",R),F.addEventListener("pointerdown",D),P.push(()=>{F.removeEventListener("focusout",R),F.removeEventListener("pointerdown",D)})),y&&(y.addEventListener("focusin",ie),y.addEventListener("focusout",R),V&&(y.addEventListener("focusout",L,!0),P.push(()=>{y.removeEventListener("focusout",L,!0)})),P.push(()=>{y.removeEventListener("focusin",ie),y.removeEventListener("focusout",R)})),()=>{P.forEach(H=>{H()})}},[o,h,y,re,c,K,V,g,a,i,fe,S,E,w,v,pe,Me,Se,p,d]),u.useEffect(()=>{if(o||!y||!x)return;const k=Array.from(V?.portalNode?.querySelectorAll(`[${Zn("portal")}]`)||[]),ie=(K?Qr(K.nodesRef.current,E()):[]).find(L=>Jo(L.context?.elements.domReference||null))?.context?.elements.domReference,R=[y,ie,...k,X.current,Z.current,ye.current,ae.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,vt(d),vt(p),S?h:null].filter(L=>L!=null);return Yl(R,c||S)},[x,o,h,y,c,w,V,S,K,E,p,d]),Q(()=>{if(!x||o||!ke(re))return;const k=Ne(re),D=Rt(k);queueMicrotask(()=>{const ie=xe(re),R=I.current,L=typeof R=="function"?R(q.current||""):R;if(L===void 0||L===!1)return;let F;L===!0||L===null?F=ie[0]||re:F=vt(L),F=F||ie[0]||re,!me(re,D)&&yn(F,{preventScroll:F===re})})},[o,x,re,C,xe,I,q]),Q(()=>{if(o||!re)return;const k=Ne(re),D=Rt(k);Zl(D);function ie(F){if(F.open||(J.current=Ql(F.nativeEvent,ne.current)),F.reason===Qc&&F.nativeEvent.type==="mouseleave"&&(B.current=!0),F.reason===ir)if(F.nested)B.current=!1;else if(Qs(F.nativeEvent)||Zs(F.nativeEvent))B.current=!1;else{let P=!1;document.createElement("div").focus({get preventScroll(){return P=!0,!1}}),P?B.current=!1:B.current=!0}}m.on("openchange",ie);const R=k.createElement("span");R.setAttribute("tabindex","-1"),R.setAttribute("aria-hidden","true"),Object.assign(R.style,yr),Re&&h&&h.insertAdjacentElement("afterend",R);function L(){const F=U.current;let P=typeof F=="function"?F(J.current):F;if(P===void 0||P===!1)return null;if(P===null&&(P=!0),typeof P=="boolean"){const T=h||Vo();return T&&T.isConnected?T:R}const H=h||Vo()||R;return vt(P)||H}return()=>{m.off("openchange",ie);const F=Rt(k),P=me(y,F)||K&&tn(K.nodesRef.current,E(),!1).some(T=>me(T.context?.elements.floating,F)),H=L();queueMicrotask(()=>{const T=eu(H),W=typeof U.current!="boolean";U.current&&!B.current&&ke(T)&&(!(!W&&T!==F&&F!==k.body)||P)&&T.focus({preventScroll:!0}),R.remove(),B.current=!1})}},[o,y,re,U,v,m,K,Re,h,E]),Q(()=>{if(!zs||x||!y)return;const k=Rt(Ne(y));!ke(k)||!mr(k)||me(y,k)&&k.blur()},[x,y]),Q(()=>{if(!(o||!V))return V.setFocusManagerState({modal:c,closeOnFocusOut:a,open:x,onOpenChange:g.setOpen,domReference:h}),()=>{V.setFocusManagerState(null)}},[o,V,c,x,g,a,h]),Q(()=>{if(!(o||!re))return as(re,w),()=>{queueMicrotask(Cr)}},[o,re,w]);const O=!o&&(c?!S:!0)&&(Re||c);return j.jsxs(u.Fragment,{children:[O&&j.jsx(vn,{"data-type":"inside",ref:he,onFocus:k=>{if(c){const D=xe();yn(D[D.length-1])}else V?.portalNode&&(B.current=!1,xn(k,V.portalNode)?oi(h)?.focus():vt(d??V.beforeOutsideRef)?.focus())}}),n,O&&j.jsx(vn,{"data-type":"inside",ref:se,onFocus:k=>{c?yn(xe()[0]):V?.portalNode&&(a&&(B.current=!0),xn(k,V.portalNode)?ri(h)?.focus():vt(p??V.afterOutsideRef)?.focus())}})]})}function di(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:p=Uo}=t,d=u.useRef(void 0),b=ur(),f=qt(),g=u.useMemo(()=>({onPointerDown(x){d.current=x.pointerType},onMouseDown(x){const h=d.current,y=x.nativeEvent,m=n.select("open");if(x.button!==0||s==="click"||Zr(h)&&c)return;const v=o.current.openEvent,E=v?.type,C=n.select("domReferenceElement")!==x.currentTarget,S=m&&C||!(m&&i&&(!(v&&a)||E==="click"||E==="mousedown"));if(mr(y.target)){const I=ce(p,y,y.target);S&&h==="touch"&&l>0?f.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I);return}const w=x.currentTarget;b.request(()=>{const I=ce(p,y,w);S&&h==="touch"&&l>0?f.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I)})},onClick(x){if(s==="mousedown-only")return;const h=d.current;if(s==="mousedown"&&h){d.current=void 0;return}if(Zr(h)&&c)return;const y=n.select("open"),m=o.current.openEvent,v=n.select("domReferenceElement")!==x.currentTarget,E=y&&v||!(y&&i&&(!(m&&a)||ei(m))),C=ce(p,x.nativeEvent,x.currentTarget);E&&h==="touch"&&l>0?f.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(E,C)},onKeyDown(){d.current=void 0}}),[o,s,c,n,a,i,b,f,l,p]);return u.useMemo(()=>r?{reference:g}:We,[r,g])}function fs(e,t,n){let{reference:o,floating:r}=e;const s=lt(t),i=br(t),c=gr(i),a=ot(t),l=s==="y",p=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,b=o[c]/2-r[c]/2;let f;switch(a){case"top":f={x:p,y:o.y-r.height};break;case"bottom":f={x:p,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(Bt(t)){case"start":f[i]-=b*(n&&l?-1:1);break;case"end":f[i]+=b*(n&&l?-1:1);break}return f}async function ou(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:b=!1,padding:f=0}=It(t,e),g=ti(f),h=c[b?d==="floating"?"reference":"floating":d],y=Qn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(h)))==null||n?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:p,strategy:a})),m=d==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=Qn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:m,offsetParent:v,strategy:a}):m);return{top:(y.top-C.top+g.top)/E.y,bottom:(C.bottom-y.bottom+g.bottom)/E.y,left:(y.left-C.left+g.left)/E.x,right:(C.right-y.right+g.right)/E.x}}const ru=50,su=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:ou},a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:d}=fs(l,o,a),b=o,f=0;const g={};for(let x=0;x<s.length;x++){const h=s[x];if(!h)continue;const{name:y,fn:m}=h,{x:v,y:E,data:C,reset:S}=await m({x:p,y:d,initialPlacement:o,placement:b,strategy:r,middlewareData:g,rects:l,platform:c,elements:{reference:e,floating:t}});p=v??p,d=E??d,g[y]={...g[y],...C},S&&f<ru&&(f++,typeof S=="object"&&(S.placement&&(b=S.placement),S.rects&&(l=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:p,y:d}=fs(l,b,a)),x=-1)}return{x:p,y:d,placement:b,strategy:r,middlewareData:g}},iu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:b,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:x=!0,...h}=It(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ot(r),m=lt(c),v=ot(c)===c,E=await(a.isRTL==null?void 0:a.isRTL(l.floating)),C=b||(v||!x?[Jn(c)]:Il(c)),S=g!=="none";!b&&S&&C.push(...Tl(c,x,g,E));const w=[c,...C],I=await a.detectOverflow(t,h),U=[];let q=((o=s.flip)==null?void 0:o.overflows)||[];if(p&&U.push(I[y]),d){const Z=Sl(r,i,E);U.push(I[Z[0]],I[Z[1]])}if(q=[...q,{placement:r,overflows:U}],!U.every(Z=>Z<=0)){var K,V;const Z=(((K=s.flip)==null?void 0:K.index)||0)+1,B=w[Z];if(B&&(!(d==="alignment"?m!==lt(B):!1)||q.every(_=>lt(_.placement)===m?_.overflows[0]>0:!0)))return{data:{index:Z,overflows:q},reset:{placement:B}};let M=(V=q.filter(G=>G.overflows[0]<=0).sort((G,_)=>G.overflows[1]-_.overflows[1])[0])==null?void 0:V.placement;if(!M)switch(f){case"bestFit":{var X;const G=(X=q.filter(_=>{if(S){const J=lt(_.placement);return J===m||J==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(J=>J>0).reduce((J,ne)=>J+ne,0)]).sort((_,J)=>_[1]-J[1])[0])==null?void 0:X[0];G&&(M=G);break}case"initialPlacement":M=c;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ps(e){return Rl.some(t=>e[t]>=0)}const cu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=It(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=ds(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ps(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=ds(i,n.floating);return{data:{escapedOffsets:c,escaped:ps(c)}}}default:return{}}}}},pi=new Set(["left","top"]);async function lu(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ot(n),c=Bt(n),a=lt(n)==="y",l=pi.has(i)?-1:1,p=s&&a?-1:1,d=It(t,e);let{mainAxis:b,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(f=c==="end"?g*-1:g),a?{x:f*p,y:b*l}:{x:b*l,y:f*p}}const uu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await lu(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},au=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...l}=It(e,t),p={x:n,y:o},d=await s.detectOverflow(t,l),b=lt(ot(r)),f=hr(b);let g=p[f],x=p[b];if(i){const y=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=g+d[y],E=g-d[m];g=Zo(v,g,E)}if(c){const y=b==="y"?"top":"left",m=b==="y"?"bottom":"right",v=x+d[y],E=x-d[m];x=Zo(v,x,E)}const h=a.fn({...t,[f]:g,[b]:x});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:i,[b]:c}}}}}},fu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=It(e,t),p={x:n,y:o},d=lt(r),b=hr(d);let f=p[b],g=p[d];const x=It(c,t),h=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(a){const v=b==="y"?"height":"width",E=s.reference[b]-s.floating[v]+h.mainAxis,C=s.reference[b]+s.reference[v]-h.mainAxis;f<E?f=E:f>C&&(f=C)}if(l){var y,m;const v=b==="y"?"width":"height",E=pi.has(ot(r)),C=s.reference[d]-s.floating[v]+(E&&((y=i.offset)==null?void 0:y[d])||0)+(E?0:h.crossAxis),S=s.reference[d]+s.reference[v]+(E?0:((m=i.offset)==null?void 0:m[d])||0)-(E?h.crossAxis:0);g<C?g=C:g>S&&(g=S)}return{[b]:f,[d]:g}}}},du=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=It(e,t),p=await i.detectOverflow(t,l),d=ot(r),b=Bt(r),f=lt(r)==="y",{width:g,height:x}=s.floating;let h,y;d==="top"||d==="bottom"?(h=d,y=b===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=d,h=b==="end"?"top":"bottom");const m=x-p.top-p.bottom,v=g-p.left-p.right,E=rn(x-p[h],m),C=rn(g-p[y],v),S=!t.middlewareData.shift;let w=E,I=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=v),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(w=m),S&&!b){const q=nt(p.left,0),K=nt(p.right,0),V=nt(p.top,0),X=nt(p.bottom,0);f?I=g-2*(q!==0||K!==0?q+K:nt(p.left,p.right)):w=x-2*(V!==0||X!==0?V+X:nt(p.top,p.bottom))}await a({...t,availableWidth:I,availableHeight:w});const U=await i.getDimensions(c.floating);return g!==U.width||x!==U.height?{reset:{rects:!0}}:{}}}};function mi(e){const t=rt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ke(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Xn(n)!==s||Xn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function vr(e){return ve(e)?e:e.contextElement}function on(e){const t=vr(e);if(!ke(t))return yt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=mi(t);let i=(s?Xn(n.width):n.width)/o,c=(s?Xn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const pu=yt(0);function hi(e){const t=Fe(e);return!so()||!t.visualViewport?pu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fe(e)?!1:t}function zt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=vr(e);let i=yt(1);t&&(o?ve(o)&&(i=on(o)):i=on(e));const c=mu(s,n,o)?hi(s):yt(0);let a=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,p=r.width/i.x,d=r.height/i.y;if(s){const b=Fe(s),f=o&&ve(o)?Fe(o):o;let g=b,x=zo(g);for(;x&&o&&f!==g;){const h=on(x),y=x.getBoundingClientRect(),m=rt(x),v=y.left+(x.clientLeft+parseFloat(m.paddingLeft))*h.x,E=y.top+(x.clientTop+parseFloat(m.paddingTop))*h.y;a*=h.x,l*=h.y,p*=h.x,d*=h.y,a+=v,l+=E,g=Fe(x),x=zo(g)}}return Qn({width:p,height:d,x:a,y:l})}function uo(e,t){const n=io(e).scrollLeft;return t?t.left+n:zt(Et(e)).left+n}function gi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-uo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function hu(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Et(o),c=t?ro(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=yt(1);const p=yt(0),d=ke(o);if((d||!d&&!s)&&((_t(o)!=="body"||Ft(i))&&(a=io(o)),d)){const f=zt(o);l=on(o),p.x=f.x+o.clientLeft,p.y=f.y+o.clientTop}const b=i&&!d&&!s?gi(i,a):yt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+p.x+b.x,y:n.y*l.y-a.scrollTop*l.y+p.y+b.y}}function gu(e){return Array.from(e.getClientRects())}function bu(e){const t=Et(e),n=io(e),o=e.ownerDocument.body,r=nt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=nt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+uo(e);const c=-n.scrollTop;return rt(o).direction==="rtl"&&(i+=nt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const ms=25;function xu(e,t){const n=Fe(e),o=Et(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const p=so();(!p||p&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const l=uo(o);if(l<=0){const p=o.ownerDocument,d=p.body,b=getComputedStyle(d),f=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,g=Math.abs(o.clientWidth-d.clientWidth-f);g<=ms&&(s-=g)}else l<=ms&&(s+=l);return{width:s,height:i,x:c,y:a}}function yu(e,t){const n=zt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ke(e)?on(e):yt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,l=o*s.y;return{width:i,height:c,x:a,y:l}}function hs(e,t,n){let o;if(t==="viewport")o=xu(e,n);else if(t==="document")o=bu(Et(e));else if(ve(t))o=yu(t,n);else{const r=hi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Qn(o)}function bi(e,t){const n=St(e);return n===t||!ve(n)||wt(n)?!1:rt(n).position==="fixed"||bi(n,t)}function Eu(e,t){const n=t.get(e);if(n)return n;let o=Mt(e,[],!1).filter(c=>ve(c)&&_t(c)!=="body"),r=null;const s=rt(e).position==="fixed";let i=s?St(e):e;for(;ve(i)&&!wt(i);){const c=rt(i),a=fr(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Ft(i)&&!a&&bi(e,i))?o=o.filter(p=>p!==i):r=c,i=St(i)}return t.set(e,o),o}function Cu(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?ro(t)?[]:Eu(t,this._c):[].concat(n),o],c=hs(t,i[0],r);let a=c.top,l=c.right,p=c.bottom,d=c.left;for(let b=1;b<i.length;b++){const f=hs(t,i[b],r);a=nt(f.top,a),l=rn(f.right,l),p=rn(f.bottom,p),d=nt(f.left,d)}return{width:l-d,height:p-a,x:d,y:a}}function vu(e){const{width:t,height:n}=mi(e);return{width:t,height:n}}function Ru(e,t,n){const o=ke(t),r=Et(t),s=n==="fixed",i=zt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=yt(0);function l(){a.x=uo(r)}if(o||!o&&!s)if((_t(t)!=="body"||Ft(r))&&(c=io(t)),o){const f=zt(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else r&&l();s&&!o&&r&&l();const p=r&&!o&&!s?gi(r,c):yt(0),d=i.left+c.scrollLeft-a.x-p.x,b=i.top+c.scrollTop-a.y-p.y;return{x:d,y:b,width:i.width,height:i.height}}function Do(e){return rt(e).position==="static"}function gs(e,t){if(!ke(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Et(e)===n&&(n=n.ownerDocument.body),n}function xi(e,t){const n=Fe(e);if(ro(e))return n;if(!ke(e)){let r=St(e);for(;r&&!wt(r);){if(ve(r)&&!Do(r))return r;r=St(r)}return n}let o=gs(e,t);for(;o&&ll(o)&&Do(o);)o=gs(o,t);return o&&wt(o)&&Do(o)&&!fr(o)?n:o||fl(e)||n}const wu=async function(e){const t=this.getOffsetParent||xi,n=this.getDimensions,o=await n(e.floating);return{reference:Ru(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Su(e){return rt(e).direction==="rtl"}const Iu={convertOffsetParentRelativeRectToViewportRelativeRect:hu,getDocumentElement:Et,getClippingRect:Cu,getOffsetParent:xi,getElementRects:wu,getClientRects:gu,getDimensions:vu,getScale:on,isElement:ve,isRTL:Su};function yi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ou(e,t){let n=null,o;const r=Et(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:p,top:d,width:b,height:f}=l;if(c||t(),!b||!f)return;const g=en(d),x=en(r.clientWidth-(p+b)),h=en(r.clientHeight-(d+f)),y=en(p),v={rootMargin:-g+"px "+-x+"px "+-h+"px "+-y+"px",threshold:nt(0,rn(1,a))||1};let E=!0;function C(S){const w=S[0].intersectionRatio;if(w!==a){if(!E)return i();w?i(!1,w):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!yi(l,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(C,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return i(!0),s}function bs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=vr(e),p=r||s?[...l?Mt(l):[],...t?Mt(t):[]]:[];p.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=l&&c?Ou(l,n):null;let b=-1,f=null;i&&(f=new ResizeObserver(y=>{let[m]=y;m&&m.target===l&&f&&t&&(f.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),l&&!a&&f.observe(l),t&&f.observe(t));let g,x=a?zt(e):null;a&&h();function h(){const y=zt(e);x&&!yi(x,y)&&n(),x=y,g=requestAnimationFrame(h)}return n(),()=>{var y;p.forEach(m=>{r&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),d?.(),(y=f)==null||y.disconnect(),f=null,a&&cancelAnimationFrame(g)}}const Pu=uu,Au=au,Tu=iu,Nu=du,ku=cu,Mu=fu,Vu=(e,t,n)=>{const o=new Map,r={platform:Iu,...n},s={...r.platform,_c:o};return su(e,t,{...r,platform:s})};var Du=typeof document<"u",Lu=function(){},zn=Du?Lt.useLayoutEffect:Lu;function eo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!eo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!eo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ei(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xs(e,t){const n=Ei(e);return Math.round(t*n)/n}function Lo(e){const t=u.useRef(e);return zn(()=>{t.current=e}),t}function _u(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[p,d]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,f]=u.useState(o);eo(b,o)||f(o);const[g,x]=u.useState(null),[h,y]=u.useState(null),m=u.useCallback(_=>{_!==S.current&&(S.current=_,x(_))},[]),v=u.useCallback(_=>{_!==w.current&&(w.current=_,y(_))},[]),E=s||g,C=i||h,S=u.useRef(null),w=u.useRef(null),I=u.useRef(p),U=a!=null,q=Lo(a),K=Lo(r),V=Lo(l),X=u.useCallback(()=>{if(!S.current||!w.current)return;const _={placement:t,strategy:n,middleware:b};K.current&&(_.platform=K.current),Vu(S.current,w.current,_).then(J=>{const ne={...J,isPositioned:V.current!==!1};Z.current&&!eo(I.current,ne)&&(I.current=ne,Xt.flushSync(()=>{d(ne)}))})},[b,t,n,K,V]);zn(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[l]);const Z=u.useRef(!1);zn(()=>(Z.current=!0,()=>{Z.current=!1}),[]),zn(()=>{if(E&&(S.current=E),C&&(w.current=C),E&&C){if(q.current)return q.current(E,C,X);X()}},[E,C,X,q,U]);const B=u.useMemo(()=>({reference:S,floating:w,setReference:m,setFloating:v}),[m,v]),M=u.useMemo(()=>({reference:E,floating:C}),[E,C]),G=u.useMemo(()=>{const _={position:n,left:0,top:0};if(!M.floating)return _;const J=xs(M.floating,p.x),ne=xs(M.floating,p.y);return c?{..._,transform:"translate("+J+"px, "+ne+"px)",...Ei(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:ne}},[n,c,M.floating,p.x,p.y]);return u.useMemo(()=>({...p,update:X,refs:B,elements:M,floatingStyles:G}),[p,X,B,M,G])}const Fu=(e,t)=>{const n=Pu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bu=(e,t)=>{const n=Au(e);return{name:n.name,fn:n.fn,options:[e,t]}},ju=(e,t)=>({fn:Mu(e).fn,options:[e,t]}),Hu=(e,t)=>{const n=Tu(e);return{name:n.name,fn:n.fn,options:[e,t]}},$u=(e,t)=>{const n=Nu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gu=(e,t)=>{const n=ku(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wu={intentional:"onClick",sloppy:"onPointerDown"};function Uu(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Ku(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:a}=n.context,{enabled:l=!0,escapeKey:p=!0,outsidePress:d=!0,outsidePressEvent:b="sloppy",referencePress:f=!1,referencePressEvent:g="sloppy",ancestorScroll:x=!1,bubbles:h,externalTree:y}=t,m=lo(y),v=Y(typeof d=="function"?d:()=>!1),E=typeof d=="function"?v:d,C=u.useRef(!1),{escapeKey:S,outsidePress:w}=Uu(h),I=u.useRef(null),U=qt(),q=qt(),K=Y(()=>{q.clear(),a.current.insideReactTree=!1}),V=u.useRef(!1),X=u.useRef(""),Z=Y(O=>{X.current=O.pointerType}),B=Y(()=>{const O=X.current,k=O==="pen"||!O?"mouse":O,D=typeof b=="function"?b():b;return typeof D=="string"?D:D[k]}),M=Y(O=>{if(!o||!l||!p||O.key!=="Escape"||V.current)return;const k=a.current.floatingContext?.nodeId,D=m?tn(m.nodesRef.current,k):[];if(!S&&D.length>0){let L=!0;if(D.forEach(F=>{F.context?.open&&!F.context.dataRef.current.__escapeKeyBubbles&&(L=!1)}),!L)return}const ie=vl(O)?O.nativeEvent:O,R=ce(Bs,ie);n.setOpen(!1,R),!S&&!R.isPropagationAllowed&&O.stopPropagation()}),G=Y(O=>{const k=B();return k==="intentional"&&O.type!=="click"||k==="sloppy"&&O.type==="click"}),_=Y(()=>{a.current.insideReactTree=!0,q.start(0,K)}),J=Y((O,k=!1)=>{if(G(O)){K();return}if(a.current.insideReactTree){K();return}if(B()==="intentional"&&k||typeof E=="function"&&!E(O))return;const D=Qe(O),ie=`[${Zn("inert")}]`,R=Ne(n.select("floatingElement")).querySelectorAll(ie),L=n.context.triggerElements;if(D&&(L.hasElement(D)||L.hasMatchingElement(W=>me(W,D))))return;let F=ve(D)?D:null;for(;F&&!wt(F);){const W=St(F);if(wt(W)||!ve(W))break;F=W}if(R.length&&ve(D)&&!Cl(D)&&!me(D,n.select("floatingElement"))&&Array.from(R).every(W=>!me(F,W)))return;if(ke(D)&&!("touches"in O)){const W=wt(D),te=rt(D),ue=/auto|scroll/,Ve=W||ue.test(te.overflowX),Ke=W||ue.test(te.overflowY),Ie=Ve&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,ge=Ke&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,Ae=te.direction==="rtl",qe=ge&&(Ae?O.offsetX<=D.offsetWidth-D.clientWidth:O.offsetX>D.clientWidth),Ge=Ie&&O.offsetY>D.clientHeight;if(qe||Ge)return}const P=a.current.floatingContext?.nodeId,H=m&&tn(m.nodesRef.current,P).some(W=>ht(O,W.context?.elements.floating));if(ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||H)return;const T=m?tn(m.nodesRef.current,P):[];if(T.length>0){let W=!0;if(T.forEach(te=>{te.context?.open&&!te.context.dataRef.current.__outsidePressBubbles&&(W=!1)}),!W)return}n.setOpen(!1,ce(ir,O)),K()}),ne=Y(O=>{B()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!l||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||J(O)}),ye=Y(O=>{if(B()!=="sloppy"||!n.select("open")||!l||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement")))return;const k=O.touches[0];k&&(I.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),ae=Y(O=>{const k=Qe(O);function D(){ye(O),k?.removeEventListener(O.type,D)}k?.addEventListener(O.type,D)}),he=Y(O=>{const k=C.current;if(C.current=!1,U.clear(),O.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const D=Qe(O);function ie(){O.type==="pointerdown"?ne(O):J(O,k),D?.removeEventListener(O.type,ie)}D?.addEventListener(O.type,ie)}),se=Y(O=>{if(B()!=="sloppy"||!I.current||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement")))return;const k=O.touches[0];if(!k)return;const D=Math.abs(k.clientX-I.current.startX),ie=Math.abs(k.clientY-I.current.startY),R=Math.sqrt(D*D+ie*ie);R>5&&(I.current.dismissOnTouchEnd=!0),R>10&&(J(O),U.clear(),I.current=null)}),pe=Y(O=>{const k=Qe(O);function D(){se(O),k?.removeEventListener(O.type,D)}k?.addEventListener(O.type,D)}),Me=Y(O=>{B()!=="sloppy"||!I.current||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(O),U.clear(),I.current=null)}),Se=Y(O=>{const k=Qe(O);function D(){Me(O),k?.removeEventListener(O.type,D)}k?.addEventListener(O.type,D)});u.useEffect(()=>{if(!o||!l)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=w;const O=new sn;function k(F){n.setOpen(!1,ce(it,F))}function D(){O.clear(),V.current=!0}function ie(){O.start(so()?5:0,()=>{V.current=!1})}const R=Ne(r);R.addEventListener("pointerdown",Z,!0),p&&(R.addEventListener("keydown",M),R.addEventListener("compositionstart",D),R.addEventListener("compositionend",ie)),E&&(R.addEventListener("click",he,!0),R.addEventListener("pointerdown",he,!0),R.addEventListener("touchstart",ae,!0),R.addEventListener("touchmove",pe,!0),R.addEventListener("touchend",Se,!0),R.addEventListener("mousedown",he,!0));let L=[];return x&&(ve(i)&&(L=Mt(i)),ve(r)&&(L=L.concat(Mt(r))),!ve(s)&&s&&s.contextElement&&(L=L.concat(Mt(s.contextElement)))),L=L.filter(F=>F!==R.defaultView?.visualViewport),L.forEach(F=>{F.addEventListener("scroll",k,{passive:!0})}),()=>{R.removeEventListener("pointerdown",Z,!0),p&&(R.removeEventListener("keydown",M),R.removeEventListener("compositionstart",D),R.removeEventListener("compositionend",ie)),E&&(R.removeEventListener("click",he,!0),R.removeEventListener("pointerdown",he,!0),R.removeEventListener("touchstart",ae,!0),R.removeEventListener("touchmove",pe,!0),R.removeEventListener("touchend",Se,!0),R.removeEventListener("mousedown",he,!0)),L.forEach(F=>{F.removeEventListener("scroll",k)}),O.clear(),C.current=!1}},[a,r,s,i,p,E,o,c,x,l,S,w,M,J,he,ne,ae,pe,Se,Z,n]),u.useEffect(K,[E,K]);const Re=u.useMemo(()=>({onKeyDown:M,...f&&{[Wu[g]]:O=>{n.setOpen(!1,ce(Uo,O.nativeEvent))},...g!=="intentional"&&{onClick(O){n.setOpen(!1,ce(Uo,O.nativeEvent))}}}}),[M,n,f,g]),re=Y(O=>{const k=Qe(O.nativeEvent);!me(n.select("floatingElement"),k)||O.button!==0||(C.current=!0)}),fe=Y(O=>{!o||!l||O.button!==0||(C.current=!0)}),xe=u.useMemo(()=>({onKeyDown:M,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:_,onMouseDownCapture(O){_(),fe(O)},onPointerDownCapture(O){_(),fe(O)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[M,re,_,fe]);return u.useMemo(()=>l?{reference:Re,floating:xe,trigger:Re}:{},[l,Re,xe])}Gr.createSelectorCreator({memoize:Gr.lruMemoize,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const z=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":gt(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var jn={exports:{}},_o={};var ys;function qu(){if(ys)return _o;ys=1;var e=Lt;function t(d,b){return d===b&&(d!==0||1/d===1/b)||d!==d&&b!==b}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(d,b){var f=b(),g=o({inst:{value:f,getSnapshot:b}}),x=g[0].inst,h=g[1];return s(function(){x.value=f,x.getSnapshot=b,a(x)&&h({inst:x})},[d,f,b]),r(function(){return a(x)&&h({inst:x}),d(function(){a(x)&&h({inst:x})})},[d]),i(f),f}function a(d){var b=d.getSnapshot;d=d.value;try{var f=b();return!n(d,f)}catch{return!0}}function l(d,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return _o.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,_o}var Fo={};var Es;function zu(){return Es||(Es=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}function t(f,g){p||r.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=g();if(!d){var h=g();s(x,h)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}h=i({inst:{value:x,getSnapshot:g}});var y=h[0].inst,m=h[1];return a(function(){y.value=x,y.getSnapshot=g,n(y)&&m({inst:y})},[f,x,g]),c(function(){return n(y)&&m({inst:y}),f(function(){n(y)&&m({inst:y})})},[f]),l(x),x}function n(f){var g=f.getSnapshot;f=f.value;try{var x=g();return!s(f,x)}catch{return!0}}function o(f,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=Lt,s=typeof Object.is=="function"?Object.is:e,i=r.useState,c=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue,p=!1,d=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;Fo.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Fo}var Cs;function Rr(){return Cs||(Cs=1,process.env.NODE_ENV==="production"?jn.exports=qu():jn.exports=zu()),jn.exports}var Yu=Rr(),Hn={exports:{}},Bo={};var vs;function Xu(){if(vs)return Bo;vs=1;var e=Lt,t=Rr();function n(l,p){return l===p&&(l!==0||1/l===1/p)||l!==l&&p!==p}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Bo.useSyncExternalStoreWithSelector=function(l,p,d,b,f){var g=s(null);if(g.current===null){var x={hasValue:!1,value:null};g.current=x}else x=g.current;g=c(function(){function y(S){if(!m){if(m=!0,v=S,S=b(S),f!==void 0&&x.hasValue){var w=x.value;if(f(w,S))return E=w}return E=S}if(w=E,o(v,S))return w;var I=b(S);return f!==void 0&&f(w,I)?(v=S,w):(v=S,E=I)}var m=!1,v,E,C=d===void 0?null:d;return[function(){return y(p())},C===null?void 0:function(){return y(C())}]},[p,d,b,f]);var h=r(l,g[0],g[1]);return i(function(){x.hasValue=!0,x.value=h},[h]),a(h),h},Bo}var jo={};var Rs;function Ju(){return Rs||(Rs=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,p){return l===p&&(l!==0||1/l===1/p)||l!==l&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=Lt,n=Rr(),o=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;jo.useSyncExternalStoreWithSelector=function(l,p,d,b,f){var g=s(null);if(g.current===null){var x={hasValue:!1,value:null};g.current=x}else x=g.current;g=c(function(){function y(S){if(!m){if(m=!0,v=S,S=b(S),f!==void 0&&x.hasValue){var w=x.value;if(f(w,S))return E=w}return E=S}if(w=E,o(v,S))return w;var I=b(S);return f!==void 0&&f(w,I)?(v=S,w):(v=S,E=I)}var m=!1,v,E,C=d===void 0?null:d;return[function(){return y(p())},C===null?void 0:function(){return y(C())}]},[p,d,b,f]);var h=r(l,g[0],g[1]);return i(function(){x.hasValue=!0,x.value=h},[h]),a(h),h},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),jo}var ws;function Qu(){return ws||(ws=1,process.env.NODE_ENV==="production"?Hn.exports=Xu():Hn.exports=Ju()),Hn.exports}var Zu=Qu();const ea=sr(19),ta=ea?oa:ra;function A(e,t,n,o,r){return ta(e,t,n,o,r)}function na(e,t,n,o,r){const s=u.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return Yu.useSyncExternalStore(e.subscribe,s,s)}function oa(e,t,n,o,r){return na(e,t,n,o,r)}function ra(e,t,n,o,r){return Zu.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ci{constructor(t){Pe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Pe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return A(this,t,n,o,r)}}class sa extends Ci{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){u.useDebugValue(t),Q(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;Q(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){u.useDebugValue(t,i=>Object.keys(i));const r=u.useRef(Object.keys(t)).current,s=Object.keys(t);(r.length!==s.length||r.some((i,c)=>i!==s[c]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const o=Object.values(t);Q(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){u.useDebugValue(t);const o=n!==void 0;if(Q(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o]),process.env.NODE_ENV!=="production"){const r=this.controlledValues??(this.controlledValues=new Map);r.has(t)||r.set(t,o);const s=r.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return u.useDebugValue(t),A(this,this.selectors[t],n,o,r)}useContextCallback(t,n){u.useDebugValue(t);const o=Y(n??we);this.context[t]=o}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}const ia={open:z(e=>e.open),domReferenceElement:z(e=>e.domReferenceElement),referenceElement:z(e=>e.positionReference??e.referenceElement),floatingElement:z(e=>e.floatingElement),floatingId:z(e=>e.floatingId)};class ca extends sa{constructor(n){const{nested:o,noEmit:r,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Ul(),nested:o,noEmit:r,triggerElements:i},ia);Pe(this,"setOpen",(n,o)=>{if((!n||!this.state.open||ei(o.event))&&(this.context.dataRef.current.openEvent=n?o.event:void 0),!this.context.noEmit){const r={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(n,o)})}}class la{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);if(o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function vi(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=cr(),s=ci()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!ve(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.")}const i=ut(()=>new ca({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new la,floatingId:r,nested:s,noEmit:!1})).current;return Q(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=ve(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function ua(e={}){const{nodeId:t,externalTree:n}=e,o=vi(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=u.useState(null),a=u.useRef(null),l=lo(n);Q(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const p=_u({...e,elements:{...s,...i&&{reference:i}}}),d=u.useCallback(w=>{const I=ve(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(I),p.refs.setReference(I)},[p.refs]),[b,f]=u.useState(null),[g,x]=u.useState(null);r.useSyncedValue("referenceElement",b),r.useSyncedValue("domReferenceElement",ve(b)?b:null),r.useSyncedValue("floatingElement",g);const h=u.useCallback(w=>{(ve(w)||w===null)&&(a.current=w,f(w)),(ve(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!ve(w))&&p.refs.setReference(w)},[p.refs,f]),y=u.useCallback(w=>{x(w),p.refs.setFloating(w)},[p.refs]),m=u.useMemo(()=>({...p.refs,setReference:h,setFloating:y,setPositionReference:d,domReference:a}),[p.refs,h,y,d]),v=u.useMemo(()=>({...p.elements,domReference:s.domReference}),[p.elements,s.domReference]),E=r.useState("open"),C=r.useState("floatingId"),S=u.useMemo(()=>({...p,dataRef:r.context.dataRef,open:E,onOpenChange:r.setOpen,events:r.context.events,floatingId:C,refs:m,elements:v,nodeId:t,rootStore:r}),[p,m,v,t,r,E,C]);return Q(()=>{r.context.dataRef.current.floatingContext=S;const w=l?.nodesRef.current.find(I=>I.id===t);w&&(w.context=S)}),u.useMemo(()=>({...p,context:S,refs:m,elements:v,rootStore:r}),[p,m,v,S,r])}function aa(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=u.useCallback(l=>$n(l,e,"reference"),t),i=u.useCallback(l=>$n(l,e,"floating"),n),c=u.useCallback(l=>$n(l,e,"item"),o),a=u.useCallback(l=>$n(l,e,"trigger"),r);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:a}),[s,i,c,a])}function $n(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Xo]="");for(const i in e)r&&e&&(i===Xs||i===Js)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const a=t[i]?.[n];typeof a=="function"?c=e?a(e):null:c=a,c&&Ss(s,c,r,o)}return Ss(s,e,r,o),s}function Ss(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Xs||r===Js)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(c=>c(...i)).find(c=>c!==void 0))):e[r]=s)}}const fa="Escape";function ao(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Gn(e,t){return ao(t,e===pr||e===Rn,e===Vt||e===Dt)}function Ho(e,t,n){return ao(t,e===Rn,n?e===Vt:e===Dt)||e==="Enter"||e===" "||e===""}function da(e,t,n){return ao(t,n?e===Vt:e===Dt,e===Rn)}function pa(e,t,n,o){const r=n?e===Dt:e===Vt,s=e===pr;return t==="both"||t==="horizontal"&&o&&o>1?e===fa:ao(t,r,s)}function ma(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:a,onNavigate:l=()=>{},enabled:p=!0,selectedIndex:d=null,allowEscape:b=!1,loopFocus:f=!1,nested:g=!1,rtl:x=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:v=!0,disabledIndices:E=void 0,orientation:C="vertical",parentOrientation:S,cols:w=1,id:I,resetOnPointerLeave:U=!0,externalTree:q}=t;process.env.NODE_ENV!=="production"&&(b&&(f||console.warn("`useListNavigation` looping must be enabled to allow escaping."),h||console.warn("`useListNavigation` must be virtual to allow escaping.")),C==="vertical"&&w>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const K=Qo(r),V=ct(K),X=ci(),Z=lo(q);Q(()=>{i.current.orientation=C},[i,C]);const B=Jo(s),M=u.useRef(y),G=u.useRef(d??-1),_=u.useRef(null),J=u.useRef(!0),ne=Y(P=>{l(G.current===-1?null:G.current,P)}),ye=u.useRef(ne),ae=u.useRef(!!r),he=u.useRef(o),se=u.useRef(!1),pe=u.useRef(!1),Me=ct(E),Se=ct(o),Re=ct(d),re=ct(U),fe=Y(()=>{function P(te){h?Z?.events.emit("virtualfocus",te):yn(te,{sync:se.current,preventScroll:!0})}const H=c.current[G.current],T=pe.current;H&&P(H),(se.current?te=>te():requestAnimationFrame)(()=>{const te=c.current[G.current]||H;if(!te)return;H||P(te),O&&(T||!J.current)&&te.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Q(()=>{p&&(o&&r?(G.current=d??-1,M.current&&d!=null&&(pe.current=!0,ne())):ae.current&&(G.current=-1,ye.current()))},[p,o,r,d,ne]),Q(()=>{if(p){if(!o){se.current=!1;return}if(r)if(a==null){if(se.current=!1,Re.current!=null)return;if(ae.current&&(G.current=-1,fe()),(!he.current||!ae.current)&&M.current&&(_.current!=null||M.current===!0&&_.current==null)){let P=0;const H=()=>{c.current[0]==null?(P<2&&(P?requestAnimationFrame:queueMicrotask)(H),P+=1):(G.current=_.current==null||Ho(_.current,C,x)||g?ko(c):ns(c),_.current=null,ne())};H()}}else gn(c,a)||(G.current=a,fe(),pe.current=!1)}},[p,o,r,a,Re,g,c,C,x,ne,fe,Me]),Q(()=>{if(!p||r||!Z||h||!ae.current)return;const P=Z.nodesRef.current,H=P.find(te=>te.id===X)?.context?.elements.floating,T=Rt(Ne(r)),W=P.some(te=>te.context&&me(te.context.elements.floating,T));H&&!W&&J.current&&H.focus({preventScroll:!0})},[p,r,Z,X,h]),Q(()=>{ye.current=ne,he.current=o,ae.current=!!r}),Q(()=>{o||(_.current=null,M.current=y)},[o,y]);const xe=a!=null,O=u.useMemo(()=>{function P(T){if(!Se.current)return;const W=c.current.indexOf(T.currentTarget);W!==-1&&G.current!==W&&(G.current=W,ne(T))}return{onFocus(T){se.current=!0,P(T)},onClick:({currentTarget:T})=>T.focus({preventScroll:!0}),onMouseMove(T){se.current=!0,pe.current=!1,m&&P(T)},onPointerLeave(T){if(!Se.current||!J.current||T.pointerType==="touch")return;se.current=!0;const W=T.relatedTarget;!m||c.current.includes(W)||re.current&&(yn(null,{sync:!0}),G.current=-1,ne(T),h||V.current?.focus({preventScroll:!0}))}}},[Se,V,m,c,ne,re,h]),k=u.useCallback(()=>S??Z?.nodesRef.current.find(P=>P.id===X)?.context?.dataRef?.current.orientation,[X,Z,S]),D=Y(P=>{if(J.current=!1,se.current=!0,P.which===229||!Se.current&&P.currentTarget===V.current)return;if(g&&pa(P.key,C,x,w)){Gn(P.key,k())||Ce(P),n.setOpen(!1,ce(hn,P.nativeEvent)),ke(s)&&(h?Z?.events.emit("virtualfocus",s):s.focus());return}const H=G.current,T=ko(c,E),W=ns(c,E);if(B||(P.key==="Home"&&(Ce(P),G.current=T,ne(P)),P.key==="End"&&(Ce(P),G.current=W,ne(P))),w>1){const te=Array.from({length:c.current.length},()=>({width:1,height:1})),ue=Ml(te,w),Ve=ue.findIndex(ge=>ge!=null&&!bn(c,ge,E)),Ke=ue.reduce((ge,Ae,qe)=>Ae!=null&&!bn(c,Ae,E)?qe:ge,-1),Ie=ue[kl({current:ue.map(ge=>ge!=null?c.current[ge]:null)},{event:P,orientation:C,loopFocus:f,rtl:x,cols:w,disabledIndices:Dl([...(typeof E!="function"?E:null)||c.current.map((ge,Ae)=>bn(c,Ae,E)?Ae:void 0),void 0],ue),minIndex:Ve,maxIndex:Ke,prevIndex:Vl(G.current>W?T:G.current,te,ue,w,P.key===Rn?"bl":P.key===(x?Vt:Dt)?"tr":"tl"),stopEvent:!0})];if(Ie!=null&&(G.current=Ie,ne(P)),C==="both")return}if(Gn(P.key,C)){if(Ce(P),o&&!h&&Rt(P.currentTarget.ownerDocument)===P.currentTarget){G.current=Ho(P.key,C,x)?T:W,ne(P);return}Ho(P.key,C,x)?f?H>=W?b&&H!==c.current.length?G.current=-1:(se.current=!1,G.current=T):G.current=He(c,{startingIndex:H,disabledIndices:E}):G.current=Math.min(W,He(c,{startingIndex:H,disabledIndices:E})):f?H<=T?b&&H!==-1?G.current=c.current.length:(se.current=!1,G.current=W):G.current=He(c,{startingIndex:H,decrement:!0,disabledIndices:E}):G.current=Math.max(T,He(c,{startingIndex:H,decrement:!0,disabledIndices:E})),gn(c,G.current)&&(G.current=-1),ne(P)}}),ie=u.useMemo(()=>h&&o&&xe&&{"aria-activedescendant":`${I}-${a}`},[h,o,xe,I,a]),R=u.useMemo(()=>({"aria-orientation":C==="both"?void 0:C,...B?{}:ie,onKeyDown(P){if(P.key==="Tab"&&P.shiftKey&&o&&!h){const H=Qe(P.nativeEvent);if(H&&!me(V.current,H))return;Ce(P),n.setOpen(!1,ce(no,P.nativeEvent)),ke(s)&&s.focus();return}D(P)},onPointerMove(){J.current=!0}}),[ie,D,V,C,B,n,o,h,s]),L=u.useMemo(()=>{function P(T){y==="auto"&&Qs(T.nativeEvent)&&(M.current=!h)}function H(T){M.current=y,y==="auto"&&Zs(T.nativeEvent)&&(M.current=!0)}return{onKeyDown(T){const W=n.select("open");J.current=!1;const te=T.key.startsWith("Arrow"),ue=da(T.key,k(),x),Ve=Gn(T.key,C),Ke=(g?ue:Ve)||T.key==="Enter"||T.key.trim()==="";if(h&&W)return D(T);if(!(!W&&!v&&te)){if(Ke){const Ie=Gn(T.key,k());_.current=g&&Ie?null:T.key}if(g){ue&&(Ce(T),W?(G.current=ko(c,Me.current),ne(T)):n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)));return}Ve&&(Re.current!=null&&(G.current=Re.current),Ce(T),!W&&v?n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)):D(T),W&&ne(T))}},onFocus(T){n.select("open")&&!h&&(G.current=-1,ne(T))},onPointerDown:H,onPointerEnter:H,onMouseDown:P,onClick:P}},[D,Me,y,c,g,ne,n,v,C,k,x,Re,h]),F=u.useMemo(()=>({...ie,...L}),[ie,L]);return u.useMemo(()=>p?{reference:F,floating:R,item:O,trigger:L}:{},[p,F,R,L,O])}function ha(e,t){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,r=n.useState("open"),{listRef:s,activeIndex:i,onMatch:c,onTypingChange:a,enabled:l=!0,resetMs:p=750,selectedIndex:d=null}=t,b=qt(),f=u.useRef(""),g=u.useRef(d??i??-1),x=u.useRef(null);Q(()=>{!r&&d!==null||(b.clear(),x.current=null,f.current!==""&&(f.current=""))},[r,d,b]),Q(()=>{r&&f.current===""&&(g.current=d??i??-1)},[r,d,i]);const h=Y(C=>{C?o.current.typing||(o.current.typing=C,a?.(C)):o.current.typing&&(o.current.typing=C,a?.(C))}),y=Y(C=>{function S(V,X,Z){const B=X.find(M=>M?.toLocaleLowerCase().indexOf(Z.toLocaleLowerCase())===0);return B?V.indexOf(B):-1}const w=s.current;if(f.current.length>0&&f.current[0]!==" "&&(S(w,w,f.current)===-1?h(!1):C.key===" "&&Ce(C)),w==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;r&&C.key!==" "&&(Ce(C),h(!0));const I=f.current==="";I&&(g.current=d??i??-1),w.every(V=>V?V[0]?.toLocaleLowerCase()!==V[1]?.toLocaleLowerCase():!0)&&f.current===C.key&&(f.current="",g.current=x.current),f.current+=C.key,b.start(p,()=>{f.current="",g.current=x.current,h(!1)});const q=I?d??i??-1:g.current,K=S(w,[...w.slice((q||0)+1),...w.slice(0,(q||0)+1)],f.current);K!==-1?(c?.(K),x.current=K):C.key!==" "&&(f.current="",h(!1))}),m=Y(C=>{const S=C.relatedTarget,w=n.select("domReferenceElement"),I=n.select("floatingElement"),U=me(w,S),q=me(I,S);U||q||(b.clear(),f.current="",g.current=x.current,h(!1))}),v=u.useMemo(()=>({onKeyDown:y,onBlur:m}),[y,m]),E=u.useMemo(()=>({onKeyDown:y,onKeyUp(C){C.key===" "&&h(!1)},onBlur:m}),[y,m,h]);return u.useMemo(()=>l?{reference:v,floating:E}:{},[l,v,E])}function ga(e){const t=u.useRef(""),n=u.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:u.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ba(e){const[t,n]=u.useState(null),o=Y((c,a)=>{e||n(a||(Ys?"touch":""))}),r=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=ga(o);return u.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let wr=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Cn.startingStyle]="startingStyle",e[e.endingStyle=Cn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),tr=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xa={[tr.popupOpen]:""},ya={[tr.popupOpen]:"",[tr.pressed]:""},Ea={[wr.open]:""},Ca={[wr.closed]:""},va={[wr.anchorHidden]:""},Ra={open(e){return e?xa:null}},wa={open(e){return e?ya:null}},Ri={open(e){return e?Ea:Ca},anchorHidden(e){return e?va:null}};function Sa(e){return sr(19)?e:e?"true":void 0}const wi=u.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
5
|
+
0% 0%,
|
|
6
|
+
100% 0%,
|
|
7
|
+
100% 100%,
|
|
8
|
+
0% 100%,
|
|
9
|
+
0% 0%,
|
|
10
|
+
${i.left}px ${i.top}px,
|
|
11
|
+
${i.left}px ${i.bottom}px,
|
|
12
|
+
${i.right}px ${i.bottom}px,
|
|
13
|
+
${i.right}px ${i.top}px,
|
|
14
|
+
${i.left}px ${i.top}px
|
|
15
|
+
)`}return j.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(wi.displayName="InternalBackdrop");function Ia(e){const t=u.useRef(!0);t.current&&(t.current=!1,e())}const Sr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Sr.displayName="ComboboxRootContext");const Ir=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ir.displayName="ComboboxFloatingContext");const Or=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Or.displayName="ComboboxDerivedItemsContext");const Pr=u.createContext("");process.env.NODE_ENV!=="production"&&(Pr.displayName="ComboboxInputValueContext");function st(){const e=u.useContext(Sr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(22));return e}function fo(){const e=u.useContext(Ir);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(23));return e}function jt(){const e=u.useContext(Or);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(24));return e}function Ar(){return u.useContext(Pr)}const Oa=(e,t)=>Object.is(e,t);function Yt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Pa(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:Yt(t,o,n))}function to(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:Yt(o,t,n))}function Aa(e,t,n){return e.filter(o=>!Yt(t,o,n))}function nr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Ta(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Tr(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Je(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return nr(e)}function pn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?nr(e.value):nr(e)}function Si(e,t,n){function o(){return Je(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const r=Tr(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=r.find(i=>i.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=r.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function Na(e,t,n){return e.reduce((o,r,s)=>(s>0&&o.push(", "),o.push(j.jsx(u.Fragment,{children:Si(r,t,n)},s)),o),[])}const N={id:z(e=>e.id),query:z(e=>e.query),items:z(e=>e.items),selectedValue:z(e=>e.selectedValue),hasSelectionChips:z(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:z(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:z((e,t)=>t?Ta(e.items):!1),open:z(e=>e.open),mounted:z(e=>e.mounted),forceMounted:z(e=>e.forceMounted),inline:z(e=>e.inline),activeIndex:z(e=>e.activeIndex),selectedIndex:z(e=>e.selectedIndex),isActive:z((e,t)=>e.activeIndex===t),isSelected:z((e,t)=>{const n=e.isItemEqualToValue,o=e.selectedValue;return Array.isArray(o)?o.some(r=>Yt(t,r,n)):Yt(t,o,n)}),transitionStatus:z(e=>e.transitionStatus),popupProps:z(e=>e.popupProps),inputProps:z(e=>e.inputProps),triggerProps:z(e=>e.triggerProps),getItemProps:z(e=>e.getItemProps),positionerElement:z(e=>e.positionerElement),listElement:z(e=>e.listElement),triggerElement:z(e=>e.triggerElement),inputElement:z(e=>e.inputElement),popupSide:z(e=>e.popupSide),openMethod:z(e=>e.openMethod),inputInsidePopup:z(e=>e.inputInsidePopup),selectionMode:z(e=>e.selectionMode),listRef:z(e=>e.listRef),labelsRef:z(e=>e.labelsRef),popupRef:z(e=>e.popupRef),emptyRef:z(e=>e.emptyRef),inputRef:z(e=>e.inputRef),keyboardActiveRef:z(e=>e.keyboardActiveRef),chipsContainerRef:z(e=>e.chipsContainerRef),clearRef:z(e=>e.clearRef),valuesRef:z(e=>e.valuesRef),allValuesRef:z(e=>e.allValuesRef),name:z(e=>e.name),disabled:z(e=>e.disabled),readOnly:z(e=>e.readOnly),required:z(e=>e.required),grid:z(e=>e.grid),isGrouped:z(e=>e.isGrouped),virtualized:z(e=>e.virtualized),onOpenChangeComplete:z(e=>e.onOpenChangeComplete),openOnInputClick:z(e=>e.openOnInputClick),itemToStringLabel:z(e=>e.itemToStringLabel),isItemEqualToValue:z(e=>e.isItemEqualToValue),modal:z(e=>e.modal),autoHighlight:z(e=>e.autoHighlight),submitOnItemClick:z(e=>e.submitOnItemClick)};let Is=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const ka={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ma={valid(e){return e===null?null:e?{[Is.valid]:""}:{[Is.invalid]:""}}},Ii=u.createContext({invalid:void 0,name:void 0,validityData:{state:ka,errors:[],error:"",value:"",initialValue:null},setValidityData:we,disabled:void 0,touched:!1,setTouched:we,dirty:!1,setDirty:we,filled:!1,setFilled:we,focused:!1,setFocused:we,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=We)=>e,getInputValidationProps:(e=We)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Ii.displayName="FieldRootContext");function Sn(e=!0){const t=u.useContext(Ii);if(t.setValidityData===we&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":gt(28));return t}function Va(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Oi=u.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:we,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Oi.displayName="FormContext");function Pi(){return u.useContext(Oi)}function Da(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Pi(),{invalid:a,markedDirtyRef:l,validityData:p,setValidityData:d}=Sn(),b=Y(e.getValue);Q(()=>{if(!t)return;let f=n;f===void 0&&(f=b()),p.initialValue===null&&f!==null&&d(g=>({...g,initialValue:f}))},[t,d,n,p.initialValue,b]),Q(()=>{!t||!o||c.current.fields.set(o,{getValue:b,name:r,controlRef:s,validityData:Va(p,a),validate(f=!0){let g=n;g===void 0&&(g=b()),l.current=!0,f?Xt.flushSync(()=>i(g)):i(g)}})},[i,s,t,c,b,o,a,l,r,p,n]),Q(()=>{const f=c.current.fields;return()=>{o&&f.delete(o)}},[c,o])}const Ai=u.createContext({controlId:void 0,registerControlId:we,labelId:void 0,setLabelId:we,messageIds:[],setMessageIds:we,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Ai.displayName="LabelableContext");function Nr(){return u.useContext(Ai)}function Ti(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=Nr(),i=lr(t),c=n?r:void 0,a=ut(()=>Symbol("labelable-control")),l=u.useRef(!1),p=u.useRef(t!=null),d=Y(()=>{!l.current||s===we||(l.current=!1,s(a.current,void 0))});return Q(()=>{if(s===we)return;let b;if(n){const f=o?.current;ve(f)&&f.closest("label")!=null?b=t??null:b=c??i}else if(t!=null)p.current=!0,b=t;else if(p.current)b=i;else{d();return}if(b===void 0){d();return}l.current=!0,s(a.current,b)},[t,o,c,s,n,i,a,d]),u.useEffect(()=>d,[d]),r??i}function La(e,t){return(n,o)=>{if(n==null)return!1;const r=Je(n,t);return e.contains(r,o)}}function _a(e,t,n){return(o,r)=>{if(o==null)return!1;if(!r)return!0;const s=Je(o,t),i=n!=null?Je(n,t):"";return i&&e.contains(i,r)&&i.length===r.length?!0:e.contains(s,r)}}const Os=new Map;function Ni(e){return Array.isArray(e)?e.map(t=>Ni(t)).join(","):e==null?"":String(e)}function Fa(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Ni(e.locale)}|${JSON.stringify(t)}`,o=Os.get(n);if(o)return o;const r=new Intl.Collator(e.locale,t),s={contains(i,c,a){if(!c)return!0;const l=Je(i,a);for(let p=0;p<=l.length-c.length;p+=1)if(r.compare(l.slice(p,p+c.length),c)===0)return!0;return!1},startsWith(i,c,a){if(!c)return!0;const l=Je(i,a);return r.compare(l.slice(0,c.length),c)===0},endsWith(i,c,a){if(!c)return!0;const l=Je(i,a),p=c.length;return l.length>=p&&r.compare(l.slice(l.length-p),c)===0}};return Os.set(n,s),s}const Ba=Fa;function Wn(e,t){const n=u.useRef(e),o=Y(t);Q(()=>{n.current!==e&&o(n.current)},[e,o]),Q(()=>{n.current=e},[e])}const ki=Symbol("none"),Ut={value:ki,index:-1};function ja(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:o=null,selectedValue:r,onSelectedValueChange:s,defaultInputValue:i,inputValue:c,selectionMode:a="none",onItemHighlighted:l,name:p,disabled:d=!1,readOnly:b=!1,required:f=!1,inputRef:g,grid:x=!1,items:h,filteredItems:y,filter:m,openOnInputClick:v=!0,autoHighlight:E=!1,keepHighlight:C=!1,highlightItemOnHover:S=!0,loopFocus:w=!0,itemToStringLabel:I,itemToStringValue:U,isItemEqualToValue:q=Oa,virtualized:K=!1,inline:V=!1,fillInputOnItemPress:X=!0,modal:Z=!1,limit:B=-1,autoComplete:M="list",formAutoComplete:G,locale:_,submitOnItemClick:J=!1}=e,{clearErrors:ne}=Pi(),{setDirty:ye,validityData:ae,shouldValidateOnChange:he,setFilled:se,name:pe,disabled:Me,setTouched:Se,setFocused:Re,validationMode:re,validation:fe}=Sn(),xe=Ti({id:t}),O=Ba({locale:_}),[k,D]=u.useState(!1),[ie,R]=u.useState(null),L=u.useRef([]),F=u.useRef([]),P=u.useRef(null),H=u.useRef(null),T=u.useRef(null),W=u.useRef(!0),te=u.useRef(!1),ue=u.useRef(null),Ve=u.useRef(null),Ke=u.useRef(null),Ie=u.useRef(Ut),ge=u.useRef(null),Ae=u.useRef([]),qe=u.useRef([]),Ge=Me||d,et=pe??p,Be=a==="multiple",ze=a==="single",Ct=c!==void 0||i!==void 0,at=h!==void 0,Ee=y!==void 0;let be;E==="always"?be="always":be=E?"input-change":!1;const[oe,Ye]=Po({controlled:r,default:Be?o??Vn:o,name:"Combobox",state:"selectedValue"}),Xe=u.useMemo(()=>m===null?()=>!0:m!==void 0?m:ze&&!k?_a(O,I,oe):La(O,I),[m,ze,oe,k,O,I]),Ht=ut(()=>Ct?i??"":ze?Je(oe,I):"").current,[De,cn]=Po({controlled:c,default:Ht,name:"Combobox",state:"inputValue"}),[Oe,mo]=Po({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),ft=Tr(h),je=ie??(De===""?"":String(De).trim()),ln=ze?Je(oe,I):"",Qt=ze&&!k&&je!==""&&ln!==""&&ln.length===je.length&&O.contains(ln,je),Ot=Qt?"":je,In=at&&Ee&&Qt,Pt=u.useMemo(()=>h?ft?h.flatMap($=>$.items):h:Vn,[h,ft]),dt=u.useMemo(()=>{if(y&&!In)return y;if(!h)return Vn;if(ft){const ee=h,le=[];let Te=0;for(const Le of ee){if(B>-1&&Te>=B)break;const _e=Ot===""?Le.items:Le.items.filter(kn=>Xe(kn,Ot,I));if(_e.length===0)continue;const $t=B>-1?B-Te:1/0,Gt=_e.slice(0,$t);if(Gt.length>0){const kn={...Le,items:Gt};le.push(kn),Te+=Gt.length}}return le}if(Ot==="")return B>-1?Pt.slice(0,B):Pt;const $=[];for(const ee of Pt){if(B>-1&&$.length>=B)break;Xe(ee,Ot,I)&&$.push(ee)}return $},[y,In,h,ft,Ot,B,Xe,I,Pt]),tt=u.useMemo(()=>ft?dt.flatMap(ee=>ee.items):dt,[dt,ft]),de=ut(()=>new Ci({id:xe,selectedValue:oe,open:Oe,filter:Xe,query:je,items:h,selectionMode:a,listRef:L,labelsRef:F,popupRef:P,emptyRef:T,inputRef:H,keyboardActiveRef:W,chipsContainerRef:ue,clearRef:Ve,valuesRef:Ae,allValuesRef:qe,selectionEventRef:Ke,name:et,disabled:Ge,readOnly:b,required:f,grid:x,isGrouped:ft,virtualized:K,openOnInputClick:v,itemToStringLabel:I,isItemEqualToValue:q,modal:Z,autoHighlight:be,submitOnItemClick:J,hasInputValue:Ct,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:V,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||we,setOpen:we,setInputValue:we,setSelectedValue:we,setIndices:we,onItemHighlighted:we,handleSelection:we,getItemProps:()=>We,forceMount:we,requestSubmit:we})).current,At=a==="none"?De:oe,tc=u.useMemo(()=>a==="none"?At:Array.isArray(oe)?oe.map($=>pn($,U)):pn(oe,U),[At,U,a,oe]),ho=Y(l),go=Y(n),On=A(de,N.activeIndex),nc=A(de,N.selectedIndex),Pn=A(de,N.positionerElement),jr=A(de,N.listElement),un=A(de,N.triggerElement),bo=A(de,N.inputElement),pt=A(de,N.inline),Tt=A(de,N.inputInsidePopup),oc=ct(un),{mounted:Hr,setMounted:rc,transitionStatus:xo}=$s(Oe),{openMethod:$r,triggerProps:yo,reset:sc}=ba(Oe);Da({id:xe,name:et,commit:fe.commit,value:At,controlRef:Tt?oc:H,getValue:()=>tc});const An=Y(()=>{h?F.current=tt.map($=>Je($,I)):de.set("forceMounted",!0)}),ic=u.useRef(oe);Q(()=>{oe!==ic.current&&An()},[An,oe]);const mt=Y($=>{de.update($);const ee=$.type||"none";if($.activeIndex!==void 0)if($.activeIndex===null)Ie.current!==Ut&&(Ie.current=Ut,ho(void 0,fn(ee,void 0,{index:-1})));else{const le=Ae.current[$.activeIndex];Ie.current={value:le,index:$.activeIndex},ho(le,fn(ee,void 0,{index:$.activeIndex}))}}),bt=Y(($,ee)=>{if(te.current=ee.reason===Nt,e.onInputValueChange?.($,ee),!ee.isCanceled){if(ee.reason===Zt){const le=ee.event,Te=le.inputType;if(le.type==="compositionend"||Te!=null&&Te!==""&&Te!=="insertReplacementText"){const _e=$.trim()!=="";_e&&D(!0),ge.current={hasQuery:_e},_e&&be&&de.state.activeIndex==null&&de.set("activeIndex",0)}}cn($)}}),an=Y(($,ee)=>{if(Oe!==$&&(ee.reason==="escape-key"&&at&&tt.length===0&&!de.state.emptyRef.current&&ee.allowPropagation(),e.onOpenChange?.($,ee),!ee.isCanceled&&(!$&&k&&(ze?(pt||R(je),je===""&&D(!1)):Be&&(pt||Tt?mt({activeIndex:null}):R(je),bt("",ce(Nt,ee.event)))),mo($),!$&&Tt&&(ee.reason===no||ee.reason===ir)&&(Se(!0),Re(!1),re==="onBlur")))){const le=a==="none"?De:oe;fe.commit(le)}}),Tn=Y(($,ee)=>{if(s?.($,ee),ee.isCanceled)return;Ye($),(a==="none"&&P.current&&X||ze&&!de.state.inputInsidePopup)&&bt(Je($,I),ce(ee.reason,ee.event)),ze&&$!=null&&ee.reason!==Zt&&k&&!pt&&R(je)}),cc=Y(($,ee)=>{let le=ee;if(le===void 0){if(On===null)return;le=Ae.current[On]}const Te=Qe($),Le=Ke.current??$;Ke.current=null;const _e=ce(Zc,Le),$t=Te?.closest("a")?.getAttribute("href");if($t){$t.startsWith("#")&&an(!1,_e);return}if(Be){const Gt=Array.isArray(oe)?oe:[],yc=Pa(Gt,le,de.state.isItemEqualToValue)?Aa(Gt,le,de.state.isItemEqualToValue):[...Gt,le];if(Tn(yc,_e),!(H.current?H.current.value.trim()!=="":!1))return;de.state.inputInsidePopup?bt("",ce(Nt,_e.event)):an(!1,_e)}else Tn(le,_e),an(!1,_e)}),Eo=Y(()=>{if(!de.state.submitOnItemClick)return;const $=de.state.inputElement?.form;$&&typeof $.requestSubmit=="function"&&$.requestSubmit()}),Co=Y(()=>{if(rc(!1),go?.(!1),D(!1),sc(),R(null),mt(a==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Be&&H.current&&H.current.value!==""&&!te.current&&bt("",ce(Nt)),ze)if(de.state.inputInsidePopup)H.current&&H.current.value!==""&&bt("",ce(Nt));else{const $=Je(oe,I);H.current&&H.current.value!==$&&bt($,ce($===""?Nt:it))}}),lc=u.useMemo(()=>pt&&Pn?{current:Pn.closest('[role="dialog"]')}:P,[pt,Pn]);xr({enabled:!e.actionsRef,open:Oe,ref:lc,onComplete(){Oe||Co()}}),u.useImperativeHandle(e.actionsRef,()=>({unmount:Co}),[Co]),Q(function(){if(Oe||a==="none")return;const ee=h?Pt:qe.current;if(Be){const le=Array.isArray(oe)?oe:[],Te=le[le.length-1],Le=to(ee,Te,q);mt({selectedIndex:Le===-1?null:Le})}else{const le=to(ee,oe,q);mt({selectedIndex:le===-1?null:le})}},[Oe,oe,h,a,Pt,Be,q,mt]),Q(()=>{h&&(Ae.current=tt,L.current.length=tt.length)},[h,tt]),Q(()=>{const $=ge.current;if($&&($.hasQuery?be&&de.set("activeIndex",0):be==="always"&&de.set("activeIndex",0),ge.current=null),!Oe&&!pt)return;const le=at||Ee?tt:Ae.current,Te=de.state.activeIndex;if(Te==null){if(be==="always"&&le.length>0){de.set("activeIndex",0);return}Ie.current!==Ut&&(Ie.current=Ut,de.state.onItemHighlighted(void 0,fn(it,void 0,{index:-1})));return}if(Te>=le.length){Ie.current!==Ut&&(Ie.current=Ut,de.state.onItemHighlighted(void 0,fn(it,void 0,{index:-1}))),de.set("activeIndex",null);return}const Le=le[Te],_e=Ie.current.value,$t=_e!==ki&&Yt(Le,_e,de.state.isItemEqualToValue);(Ie.current.index!==Te||!$t)&&(Ie.current={value:Le,index:Te},de.state.onItemHighlighted(Le,fn(it,void 0,{index:Te})))},[On,be,Ee,at,tt,pt,Oe,de]),Q(()=>{if(a==="none"){se(String(De)!=="");return}se(Be?Array.isArray(oe)&&oe.length>0:oe!=null)},[se,a,De,oe,Be]),u.useEffect(()=>{at&&be&&tt.length===0&&mt({activeIndex:null})},[at,be,tt.length,mt]),Wn(je,()=>{!Oe||je===""||je===String(Ht)||D(!0)}),Wn(oe,()=>{if(a!=="none"&&(ne(et),ye(oe!==ae.initialValue),he()?fe.commit(oe):fe.commit(oe,!0),ze&&!Ct&&!Tt)){const $=Je(oe,I);De!==$&&bt($,ce(it))}}),Wn(De,()=>{a==="none"&&(ne(et),ye(De!==ae.initialValue),he()?fe.commit(De):fe.commit(De,!0))}),Wn(h,()=>{if(!ze||Ct||Tt||k)return;const $=Je(oe,I);De!==$&&bt($,ce(it))});const Nn=vi({open:pt?!0:Oe,onOpenChange:an,elements:{reference:Tt?un:bo,floating:Pn}});let vo,Ro;pt||(vo=x?"grid":"listbox",Ro=Oe?"true":"false");const uc=u.useMemo(()=>{const $=bo?.tagName==="INPUT",ee=$||Oe,le=$?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return ee&&(le.role="combobox",le["aria-expanded"]=Ro,le["aria-haspopup"]=vo,le["aria-controls"]=Oe?jr?.id:void 0,le["aria-autocomplete"]=M),{reference:le,floating:{role:"presentation"}}},[bo,Oe,Ro,vo,jr?.id,M]),ac=di(Nn,{enabled:!b&&!Ge&&v,event:"mousedown-only",toggle:!1,touchOpenDelay:Tt?0:50,reason:tl}),fc=Ku(Nn,{enabled:!b&&!Ge&&!pt,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:pt?!0:void 0,outsidePress($){const ee=Qe($);return!me(un,ee)&&!me(Ve.current,ee)&&!me(ue.current,ee)}}),dc=ma(Nn,{enabled:!b&&!Ge,id:xe,listRef:L,activeIndex:On,selectedIndex:nc,virtual:!0,loopFocus:w,allowEscape:w&&!be,focusItemOnOpen:k||a==="none"&&!be?!1:"auto",focusItemOnHover:S,resetOnPointerLeave:!C,cols:x?2:1,orientation:x?"horizontal":void 0,disabledIndices:Vn,onNavigate($,ee){!ee&&!Oe||xo==="ending"||mt(ee?{activeIndex:$,type:W.current?"keyboard":"pointer"}:{activeIndex:$})}}),{getReferenceProps:wo,getFloatingProps:So,getItemProps:Io}=aa([uc,ac,fc,dc]);Ia(()=>{de.update({inline:V,popupProps:So(),inputProps:wo(),triggerProps:yo,getItemProps:Io,setOpen:an,setInputValue:bt,setSelectedValue:Tn,setIndices:mt,onItemHighlighted:ho,handleSelection:cc,forceMount:An,requestSubmit:Eo})}),Q(()=>{de.update({id:xe,selectedValue:oe,open:Oe,mounted:Hr,transitionStatus:xo,items:h,inline:V,popupProps:So(),inputProps:wo(),triggerProps:yo,openMethod:$r,getItemProps:Io,selectionMode:a,name:et,disabled:Ge,readOnly:b,required:f,grid:x,isGrouped:ft,virtualized:K,onOpenChangeComplete:go,openOnInputClick:v,itemToStringLabel:I,modal:Z,autoHighlight:be,isItemEqualToValue:q,submitOnItemClick:J,hasInputValue:Ct,requestSubmit:Eo})},[de,xe,oe,Oe,Hr,xo,h,So,wo,Io,$r,yo,a,et,Ge,b,f,fe,x,ft,K,go,v,I,Z,q,J,Ct,V,Eo,be]);const pc=En(g,fe.inputRef),mc=u.useMemo(()=>({query:je,hasItems:at,filteredItems:dt,flatFilteredItems:tt}),[je,at,dt,tt]),hc=u.useMemo(()=>Array.isArray(At)?"":pn(At,U),[At,U]),gc=Be&&Array.isArray(oe)&&oe.length>0,Oo=Be||a==="none"?void 0:et,bc=u.useMemo(()=>!Be||!Array.isArray(oe)||!et?null:oe.map($=>{const ee=pn($,U);return j.jsx("input",{type:"hidden",name:et,value:ee},ee)}),[Be,oe,et,U]),xc=j.jsxs(u.Fragment,{children:[e.children,j.jsx("input",{...fe.getInputValidationProps({onFocus(){if(Tt){un?.focus();return}(H.current||un)?.focus()},onChange($){if($.nativeEvent.defaultPrevented)return;const ee=$.target.value,le=ce(it,$.nativeEvent);function Te(){if(Be)return;if(a==="none"){ye(ee!==ae.initialValue),bt(ee,le),he()&&fe.commit(ee);return}const Le=Ae.current.find(_e=>pn(_e,U).toLowerCase()===ee.toLowerCase());Le!=null&&(ye(Le!==ae.initialValue),Tn?.(Le,le),he()&&fe.commit(Le))}h?Te():(An(),queueMicrotask(Te))}}),id:xe&&Oo==null?`${xe}-hidden-input`:void 0,name:Oo,autoComplete:G,disabled:Ge,required:f&&!gc,readOnly:b,value:hc,ref:pc,style:Oo?Kl:yr,tabIndex:-1,"aria-hidden":!0}),bc]});return j.jsx(Sr.Provider,{value:de,children:j.jsx(Ir.Provider,{value:Nn,children:j.jsx(Or.Provider,{value:mc,children:j.jsx(Pr.Provider,{value:De,children:xc})})})})}const Mi={...wa,...Ma,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function Ha(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,a=parseFloat(o.height)||0,l=Math.max(t.width,s,c),p=Math.max(t.height,i,a),d=l-t.width,b=p-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-b/2,bottom:t.bottom+b/2}}const Un=2,Vi=u.forwardRef(function(t,n){const{render:o,className:r,nativeButton:s=!0,disabled:i=!1,id:c,...a}=t,{state:l,disabled:p,setTouched:d,setFocused:b,validationMode:f,validation:g}=Sn(),{labelId:x}=Nr(),h=st(),{filteredItems:y}=jt(),m=A(h,N.selectionMode),v=A(h,N.disabled),E=A(h,N.readOnly),C=A(h,N.required),S=A(h,N.mounted),w=A(h,N.popupSide),I=A(h,N.positionerElement),U=A(h,N.listElement),q=A(h,N.triggerProps),K=A(h,N.triggerElement),V=A(h,N.inputInsidePopup),X=A(h,N.id),Z=A(h,N.open),B=A(h,N.selectedValue),M=A(h,N.activeIndex),G=A(h,N.selectedIndex),_=A(h,N.hasSelectedValue),J=fo(),ne=Ar(),ye=qt(),ae=p||v||i,he=y.length===0,se=S&&I?w:null;Ti({id:V?c:void 0});const pe=V?c??X:c,Me=u.useRef("");function Se(R){Me.current=R.pointerType}const Re=J.useState("domReferenceElement");u.useEffect(()=>{V&&K&&K!==Re&&J.set("domReferenceElement",K)},[K,Re,J,V]);const{reference:re}=ha(J,{enabled:!Z&&!E&&!v&&m==="single",listRef:h.state.labelsRef,activeIndex:M,selectedIndex:G,onMatch(R){const L=h.state.valuesRef.current[R];L!==void 0&&h.state.setSelectedValue(L,ce("none"))}}),{reference:fe}=di(J,{enabled:!E&&!v,event:"mousedown"}),{buttonRef:xe,getButtonProps:O}=co({native:s,disabled:ae}),k={...l,open:Z,disabled:ae,popupSide:se,listEmpty:he,placeholder:!_},D=Y(R=>{h.set("triggerElement",R)});return Ue("button",t,{ref:[n,xe,D],state:k,props:[q,fe,re,{id:pe,tabIndex:V?0:-1,role:V?"combobox":void 0,"aria-expanded":Z?"true":"false","aria-haspopup":V?"dialog":"listbox","aria-controls":Z?U?.id:void 0,"aria-required":V&&C||void 0,"aria-labelledby":x,onPointerDown:Se,onPointerEnter:Se,onFocus(){b(!0),!(ae||E)&&ye.start(0,h.state.forceMount)},onBlur(R){if(!me(I,R.relatedTarget)&&(d(!0),b(!1),f==="onBlur")){const L=m==="none"?ne:B;g.commit(L)}},onMouseDown(R){if(ae||E||(V||J.set("domReferenceElement",R.currentTarget),h.state.forceMount(),Me.current!=="touch"&&(h.state.inputRef.current?.focus(),V||R.preventDefault()),Z))return;const L=Ne(R.currentTarget);function F(P){if(!K)return;const H=Qe(P),T=h.state.positionerElement,W=h.state.listElement;if(me(K,H)||me(T,H)||me(W,H)||H===K)return;const te=Ha(K),ue=P.clientX>=te.left-Un&&P.clientX<=te.right+Un,Ve=P.clientY>=te.top-Un&&P.clientY<=te.bottom+Un;ue&&Ve||h.state.setOpen(!1,ce("cancel-open",P))}V&&L.addEventListener("mouseup",F,{once:!0})},onKeyDown(R){ae||E||(R.key==="ArrowDown"||R.key==="ArrowUp")&&(Ce(R),h.state.setOpen(!0,ce(hn,R.nativeEvent)),h.state.inputRef.current?.focus())}},g?g.getValidationProps(a):a,O],stateAttributesMapping:Mi})});process.env.NODE_ENV!=="production"&&(Vi.displayName="ComboboxTrigger");const kr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(kr.displayName="ComboboxChipsContext");function Di(){return u.useContext(kr)}const Mr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Mr.displayName="ComboboxPositionerContext");function Vr(e){const t=u.useContext(Mr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":gt(21));return t}const Dr=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,id:i,...c}=t,{state:a,disabled:l,setTouched:p,setFocused:d,validationMode:b,validation:f}=Sn(),{labelId:g}=Nr(),x=Di(),y=!!Vr(!0),m=st(),{filteredItems:v}=jt(),E=Ar(),C=Ms(),S=A(m,N.required),w=A(m,N.disabled),I=A(m,N.readOnly),U=A(m,N.name),q=A(m,N.selectionMode),K=A(m,N.autoHighlight),V=A(m,N.inputProps),X=A(m,N.triggerProps),Z=A(m,N.open),B=A(m,N.mounted),M=A(m,N.selectedValue),G=A(m,N.popupSide),_=A(m,N.positionerElement),J=A(m,N.id),ne=A(m,N.inline),ye=!!K,ae=B&&_?G:null,he=l||w||s,se=v.length===0,Me=lr(i??(y||ne?void 0:J)),[Se,Re]=u.useState(null),re=u.useRef(!1),fe=u.useRef(null),xe=u.useRef(!1),O=Y(R=>{const L=y||m.state.inline;L&&!m.state.hasInputValue&&m.state.setInputValue("",ce(it)),m.update({inputElement:R,inputInsidePopup:L})}),k={...a,open:Z,disabled:he,readOnly:I,popupSide:ae,listEmpty:se};function D(R){if(!x)return;let L;const{highlightedChipIndex:F}=x;if(F!==void 0){if(R.key==="ArrowLeft")R.preventDefault(),F>0?L=F-1:L=void 0;else if(R.key==="ArrowRight")R.preventDefault(),F<M.length-1?L=F+1:L=void 0;else if(R.key==="Backspace"||R.key==="Delete"){R.preventDefault();const P=F>=M.length-1?M.length-2:F;L=P>=0?P:void 0,m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return L}return R.key==="ArrowLeft"&&(R.currentTarget.selectionStart??0)===0&&M.length>0?(R.preventDefault(),L=Math.max(M.length-1,0)):R.key==="Backspace"&&R.currentTarget.value===""&&M.length>0&&(m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),R.preventDefault()),L}return Ue("input",t,{state:k,ref:[n,m.state.inputRef,O],props:[V,X,{type:"text",value:t.value??Se??E,"aria-readonly":I||void 0,"aria-required":S||void 0,"aria-labelledby":g,disabled:he,readOnly:I,required:q==="none"?S:void 0,...q==="none"&&U&&{name:U},id:Me,onFocus(){if(d(!0),!ne||!xe.current)return;xe.current=!1;const R=fe.current;R==null||!Object.hasOwn(m.state.valuesRef.current,R)||m.state.setIndices({activeIndex:R})},onBlur(){p(!0),d(!1);const R=m.state.activeIndex;if(ne&&R!==null&&K!=="always"&&(fe.current=R,xe.current=!0,m.state.setIndices({activeIndex:null})),b==="onBlur"){const L=q==="none"?E:M;f.commit(L)}},onCompositionStart(R){Yn||(re.current=!0,Re(R.currentTarget.value))},onCompositionEnd(R){re.current=!1;const L=R.currentTarget.value;Re(null),m.state.setInputValue(L,ce(Zt,R.nativeEvent))},onChange(R){const L=R.nativeEvent.inputType,F=!L||L==="insertReplacementText",P=re.current||!F;if(re.current){const te=R.currentTarget.value;Re(te),te===""&&!m.state.openOnInputClick&&!m.state.inputInsidePopup&&m.state.setOpen(!1,ce(Nt,R.nativeEvent));const ue=te.trim(),Ve=ye&&ue!=="";!I&&!he&&ue&&P&&(m.state.setOpen(!0,ce(Zt,R.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!Ve&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"});return}m.state.setInputValue(R.currentTarget.value,ce(Zt,R.nativeEvent));const H=R.currentTarget.value==="",T=ce(Nt,R.nativeEvent);H&&!m.state.inputInsidePopup&&(q==="single"&&m.state.setSelectedValue(null,T),m.state.openOnInputClick||m.state.setOpen(!1,T));const W=R.currentTarget.value.trim();!I&&!he&&W&&P&&(m.state.setOpen(!0,ce(Zt,R.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!ye&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(R){if(he||I||R.ctrlKey||R.shiftKey||R.altKey||R.metaKey)return;m.state.keyboardActiveRef.current=!0;const L=R.currentTarget,F=L.scrollWidth-L.clientWidth,P=C==="rtl";if(R.key==="Home"){Ce(R);const W=Jr&&P?L.value.length:0;L.setSelectionRange(W,W),L.scrollLeft=0;return}if(R.key==="End"){Ce(R);const W=Jr&&P?0:L.value.length;L.setSelectionRange(W,W),L.scrollLeft=P?-F:F;return}if(!B&&R.key==="Escape"){const W=q==="multiple"&&Array.isArray(M)?M.length===0:M===null,te=ce(Bs,R.nativeEvent),ue=q==="multiple"?[]:null;m.state.setInputValue("",te),m.state.setSelectedValue(ue,te),!W&&!m.state.inline&&!te.isPropagationAllowed&&R.stopPropagation();return}if(x&&R.key==="Backspace"&&L.value===""&&x.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){const W=M.slice(0,-1);m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"}),m.state.setSelectedValue(W,ce(it,R.nativeEvent));return}const H=x?.highlightedChipIndex!==void 0,T=D(R);if(x?.setHighlightedChipIndex(T),T!==void 0?x?.chipsRef.current[T]?.focus():H&&m.state.inputRef.current?.focus(),R.which!==229&&R.key==="Enter"&&Z){const W=m.state.activeIndex,te=R.nativeEvent;if(W===null){m.state.setOpen(!1,ce(it,te));return}Ce(R);const ue=m.state.listRef.current[W];ue&&(m.state.selectionEventRef.current=te,ue.click(),m.state.selectionEventRef.current=null)}},onPointerMove(){m.state.keyboardActiveRef.current=!1},onPointerDown(){m.state.keyboardActiveRef.current=!1}},f?f.getValidationProps(c):c],stateAttributesMapping:Mi})});process.env.NODE_ENV!=="production"&&(Dr.displayName="ComboboxInput");const $a={...Hs,...Ra},Li=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,keepMounted:c=!1,...a}=t,{disabled:l}=Sn(),p=st(),d=A(p,N.selectionMode),b=A(p,N.disabled),f=A(p,N.readOnly),g=A(p,N.open),x=A(p,N.selectedValue),h=A(p,N.hasSelectionChips),y=Ar();let m=!1;d==="none"?m=y!=="":d==="single"?m=x!=null:m=h;const v=l||b||s,{buttonRef:E,getButtonProps:C}=co({native:i,disabled:v}),{mounted:S,transitionStatus:w,setMounted:I}=$s(m),U={disabled:v,open:g,transitionStatus:w};xr({open:m,ref:p.state.clearRef,onComplete(){m||I(!1)}});const q=Ue("button",t,{state:U,ref:[n,E,p.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(V){V.preventDefault()},onClick(V){if(v||f)return;const X=p.state.keyboardActiveRef;p.state.setInputValue("",ce(Kr,V.nativeEvent)),d!=="none"?(p.state.setSelectedValue(Array.isArray(x)?[]:null,ce(Kr,V.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:X.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:X.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},a,C],stateAttributesMapping:$a});return c||S?q:null});process.env.NODE_ENV!=="production"&&(Li.displayName="ComboboxClear");const Lr=u.createContext(null);process.env.NODE_ENV!=="production"&&(Lr.displayName="GroupCollectionContext");function Ga(){return u.useContext(Lr)}function Wa(e){const{children:t,items:n}=e,o=u.useMemo(()=>({items:n}),[n]);return j.jsx(Lr.Provider,{value:o,children:t})}function _i(e){const{children:t}=e,{filteredItems:n}=jt(),o=Ga(),r=o?o.items:n;return r?j.jsx(u.Fragment,{children:r.map(t)}):null}const Fi=u.forwardRef(function(t,n){var o;const{render:r,className:s,children:i,...c}=t,a=st(),l=fo(),p=!!Vr(!0),{filteredItems:d}=jt(),b=A(a,N.items),f=A(a,N.labelsRef),g=A(a,N.listRef),x=A(a,N.selectionMode),h=A(a,N.grid),y=A(a,N.popupProps),m=A(a,N.disabled),v=A(a,N.readOnly),E=A(a,N.virtualized),C=x==="multiple",S=d.length===0,w=Y(X=>{a.set("positionerElement",X)}),I=Y(X=>{a.set("listElement",X)}),U=u.useMemo(()=>typeof i=="function"?o||(o=j.jsx(_i,{children:i})):i,[i]),q={empty:S},K=l.useState("floatingId"),V=Ue("div",t,{state:q,ref:[n,I,p?null:w],props:[y,{children:U,tabIndex:-1,id:K,role:h?"grid":"listbox","aria-multiselectable":C?"true":void 0,onKeyDown(X){if(!(m||v)&&X.key==="Enter"){const Z=a.state.activeIndex;if(Z==null)return;Ce(X);const B=X.nativeEvent,M=a.state.listRef.current[Z];M&&(a.state.selectionEventRef.current=B,M.click(),a.state.selectionEventRef.current=null)}},onKeyDownCapture(){a.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){a.state.keyboardActiveRef.current=!1}},c]});return E?V:j.jsx(Ns,{elementsRef:g,labelsRef:b?void 0:f,children:V})});process.env.NODE_ENV!=="production"&&(Fi.displayName="ComboboxList");const _r=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(_r.displayName="ComboboxPortalContext");function Ua(){const e=u.useContext(_r);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":gt(20));return e}const Bi=u.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,s=st(),i=A(s,N.mounted),c=A(s,N.forceMounted);return i||o||c?j.jsx(_r.Provider,{value:o,children:j.jsx(fi,{ref:n,...r})}):null});process.env.NODE_ENV!=="production"&&(Bi.displayName="ComboboxPortal");const Ka=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:p=0,offsetParent:d="real"}=It(e,t)||{};if(l==null)return{};const b=ti(p),f={x:n,y:o},g=br(r),x=gr(g),h=await i.getDimensions(l),y=g==="y",m=y?"top":"left",v=y?"bottom":"right",E=y?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[g]-f[g]-s.floating[x],S=f[g]-s.reference[g],w=d==="real"?await i.getOffsetParent?.(l):c.floating;let I=c.floating[E]||s.floating[x];(!I||!await i.isElement?.(w))&&(I=c.floating[E]||s.floating[x]);const U=C/2-S/2,q=I/2-h[x]/2-1,K=Math.min(b[m],q),V=Math.min(b[v],q),X=K,Z=I-h[x]-V,B=I/2-h[x]/2+U,M=Zo(X,B,Z),G=!a.arrow&&Bt(r)!=null&&B!==M&&s.reference[x]/2-(B<X?K:V)-h[x]/2<0,_=G?B<X?B-X:B-Z:0;return{[g]:f[g]+_,data:{[g]:M,centerOffset:B-M-_,...G&&{alignmentOffset:_}},reset:G}}}),qa=(e,t)=>({...Ka(e),options:[e,t]}),za={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Gu().fn(e)).data?.referenceHidden||s}}}},Ya={sideX:"left",sideY:"top"};function ji(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Ps(e,t,n){const{rects:o,placement:r}=e;return{side:ji(t,ot(r),n),align:Bt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Xa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:l=!1,arrowPadding:p=5,disableAnchorTracking:d=!1,keepMounted:b=!1,floatingRootContext:f,mounted:g,collisionAvoidance:x,shiftCrossAxis:h=!1,nodeId:y,adaptiveOrigin:m,lazyFlip:v=!1,externalTree:E}=e,[C,S]=u.useState(null);!g&&C!==null&&S(null);const w=x.side||"flip",I=x.align||"flip",U=x.fallbackAxisSide||"end",q=typeof t=="function"?t:void 0,K=Y(q),V=q?K:t,X=ct(t),B=Ms()==="rtl",M=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[o],G=s==="center"?M:`${M}-${s}`;let _=a;const J=1,ne=o==="bottom"?J:0,ye=o==="top"?J:0,ae=o==="right"?J:0,he=o==="left"?J:0;typeof _=="number"?_={top:_+ne,right:_+he,bottom:_+ye,left:_+ae}:_&&(_={top:(_.top||0)+ne,right:(_.right||0)+he,bottom:(_.bottom||0)+ye,left:(_.left||0)+ae});const se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:_},pe=u.useRef(null),Me=ct(r),Se=ct(i),fe=[Fu(Ee=>{const be=Ps(Ee,o,B),oe=typeof Me.current=="function"?Me.current(be):Me.current,Ye=typeof Se.current=="function"?Se.current(be):Se.current;return{mainAxis:oe,crossAxis:Ye,alignmentAxis:Ye}},[typeof r!="function"?r:0,typeof i!="function"?i:0,B,o])],xe=I==="none"&&w!=="shift",O=!xe&&(l||h||w==="shift"),k=w==="none"?null:Hu({...se,padding:{top:_.top+J,right:_.right+J,bottom:_.bottom+J,left:_.left+J},mainAxis:!h&&w==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:U}),D=xe?null:Bu(Ee=>{const be=Ne(Ee.elements.floating).documentElement;return{...se,rootBoundary:h?{x:0,y:0,width:be.clientWidth,height:be.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:O,limiter:l||h?void 0:ju(oe=>{if(!pe.current)return{};const{width:Ye,height:Xe}=pe.current.getBoundingClientRect(),Ht=lt(ot(oe.placement)),De=Ht==="y"?Ye:Xe,cn=Ht==="y"?_.left+_.right:_.top+_.bottom;return{offset:De/2+cn/2}})}},[se,l,h,_,I]);w==="shift"||I==="shift"||s==="center"?fe.push(D,k):fe.push(k,D),fe.push($u({...se,apply({elements:{floating:Ee},rects:{reference:be},availableWidth:oe,availableHeight:Ye}){const Xe=Ee.style;Xe.setProperty("--available-width",`${oe}px`),Xe.setProperty("--available-height",`${Ye}px`),Xe.setProperty("--anchor-width",`${be.width}px`),Xe.setProperty("--anchor-height",`${be.height}px`)}}),qa(()=>({element:pe.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Ee){const{elements:be,middlewareData:oe,placement:Ye,rects:Xe,y:Ht}=Ee,De=ot(Ye),cn=lt(De),Oe=pe.current,mo=oe.arrow?.x||0,ft=oe.arrow?.y||0,je=Oe?.clientWidth||0,ln=Oe?.clientHeight||0,Qt=mo+je/2,Ot=ft+ln/2,In=Math.abs(oe.shift?.y||0),Pt=Xe.reference.height/2,dt=typeof r=="function"?r(Ps(Ee,o,B)):r,tt=In>dt,de={top:`${Qt}px calc(100% + ${dt}px)`,bottom:`${Qt}px ${-dt}px`,left:`calc(100% + ${dt}px) ${Ot}px`,right:`${-dt}px ${Ot}px`}[De],At=`${Qt}px ${Xe.reference.y+Pt-Ht}px`;return be.floating.style.setProperty("--transform-origin",O&&cn==="y"&&tt?At:de),{}}},za,m),Q(()=>{!g&&f&&f.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,f]);const ie=u.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:R,elements:L,x:F,y:P,middlewareData:H,update:T,placement:W,context:te,isPositioned:ue,floatingStyles:Ve}=ua({rootContext:f,placement:G,middleware:fe,strategy:n,whileElementsMounted:b?void 0:(...Ee)=>bs(...Ee,ie),nodeId:y,externalTree:E}),{sideX:Ke,sideY:Ie}=H.adaptiveOrigin||Ya,ge=ue?n:"fixed",Ae=u.useMemo(()=>{const Ee=m?{position:ge,[Ke]:F,[Ie]:P}:{position:ge,...Ve};return ue||(Ee.opacity=0),Ee},[m,ge,Ke,F,Ie,P,Ve,ue]),qe=u.useRef(null);Q(()=>{if(!g)return;const Ee=X.current,be=typeof Ee=="function"?Ee():Ee,Ye=(As(be)?be.current:be)||null||null;Ye!==qe.current&&(R.setPositionReference(Ye),qe.current=Ye)},[g,R,V,X]),u.useEffect(()=>{if(!g)return;const Ee=X.current;typeof Ee!="function"&&As(Ee)&&Ee.current!==qe.current&&(R.setPositionReference(Ee.current),qe.current=Ee.current)},[g,R,V,X]),u.useEffect(()=>{if(b&&g&&L.domReference&&L.floating)return bs(L.domReference,L.floating,T,ie)},[b,g,L,T,ie]);const Ge=ot(W),et=ji(o,Ge,B),Be=Bt(W)||"center",ze=!!H.hide?.referenceHidden;Q(()=>{v&&g&&ue&&S(Ge)},[v,g,ue,Ge]);const Ct=u.useMemo(()=>({position:"absolute",top:H.arrow?.y,left:H.arrow?.x}),[H.arrow]),at=H.arrow?.centerOffset!==0;return u.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:pe,arrowUncentered:at,side:et,align:Be,physicalSide:Ge,anchorHidden:ze,refs:R,context:te,isPositioned:ue,update:T}),[Ae,Ct,pe,at,et,Be,Ge,ze,R,te,ue,T])}function As(e){return e!=null&&"current"in e}function Hi(e){return e==="starting"?Wc:We}const $i=u.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:a="center",sideOffset:l=0,alignOffset:p=0,collisionBoundary:d="clipping-ancestors",collisionPadding:b=5,arrowPadding:f=5,sticky:g=!1,disableAnchorTracking:x=!1,collisionAvoidance:h=Kc,...y}=t,m=st(),{filteredItems:v}=jt(),E=fo(),C=Ua(),S=A(m,N.modal),w=A(m,N.open),I=A(m,N.mounted),U=A(m,N.openMethod),q=A(m,N.triggerElement),K=A(m,N.inputElement),V=A(m,N.inputInsidePopup),X=A(m,N.transitionStatus),Z=v.length===0,M=Xa({anchor:s??(V?q:K),floatingRootContext:E,positionMethod:i,mounted:I,side:c,sideOffset:l,align:a,alignOffset:p,arrowPadding:f,collisionBoundary:d,collisionPadding:b,sticky:g,disableAnchorTracking:x,keepMounted:C,collisionAvoidance:h,lazyFlip:!0});Gl(w&&S&&U!=="touch",q);const G=u.useMemo(()=>{const ae={...M.positionerStyles};return w||(ae.pointerEvents="none"),{role:"presentation",hidden:!I,style:ae}},[w,I,M.positionerStyles]),_={open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:Z};Q(()=>{m.set("popupSide",M.side)},[m,M.side]);const J=u.useMemo(()=>({side:M.side,align:M.align,arrowRef:M.arrowRef,arrowUncentered:M.arrowUncentered,arrowStyles:M.arrowStyles,anchorHidden:M.anchorHidden,isPositioned:M.isPositioned}),[M.side,M.align,M.arrowRef,M.arrowUncentered,M.arrowStyles,M.anchorHidden,M.isPositioned]),ne=Y(ae=>{m.set("positionerElement",ae)}),ye=Ue("div",t,{state:_,ref:[n,ne],props:[G,Hi(X),y],stateAttributesMapping:Ri});return j.jsxs(Mr.Provider,{value:J,children:[I&&S&&j.jsx(wi,{inert:Sa(!w),cutout:K??q}),ye]})});process.env.NODE_ENV!=="production"&&($i.displayName="ComboboxPositioner");const Ja={...Ri,...Hs},Gi=u.forwardRef(function(t,n){const{render:o,className:r,initialFocus:s,finalFocus:i,...c}=t,a=st(),l=Vr(),p=fo(),{filteredItems:d}=jt(),b=A(a,N.mounted),f=A(a,N.open),g=A(a,N.openMethod),x=A(a,N.transitionStatus),h=A(a,N.inputInsidePopup),y=A(a,N.inputElement),m=d.length===0;xr({open:f,ref:a.state.popupRef,onComplete(){f&&a.state.onOpenChangeComplete(!0)}});const v={open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:x,empty:m},E=Ue("div",t,{state:v,ref:[n,a.state.popupRef],props:[{role:h?"dialog":"presentation",tabIndex:-1,onFocus(I){const U=Qe(I.nativeEvent);g!=="touch"&&(me(a.state.listElement,U)||U===I.currentTarget)&&a.state.inputRef.current?.focus()}},Hi(x),c],stateAttributesMapping:Ja}),S=s===void 0?h?I=>I==="touch"?a.state.popupRef.current:y:!1:s;let w;return i!=null?w=i:w=h?void 0:!1,j.jsx(nu,{context:p,disabled:!b,modal:!h,openInteractionType:g,initialFocus:S,returnFocus:w,children:E})});process.env.NODE_ENV!=="production"&&(Gi.displayName="ComboboxPopup");const Fr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Fr.displayName="ComboboxGroupContext");function Qa(){const e=u.useContext(Fr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.":gt(18));return e}const Wi=u.forwardRef(function(t,n){const{render:o,className:r,items:s,...i}=t,[c,a]=u.useState(),l=u.useMemo(()=>({labelId:c,setLabelId:a,items:s}),[c,a,s]),p=Ue("div",t,{ref:n,props:[{role:"group","aria-labelledby":c},i]}),d=j.jsx(Fr.Provider,{value:l,children:p});return s?j.jsx(Wa,{items:s,children:d}):d});process.env.NODE_ENV!=="production"&&(Wi.displayName="ComboboxGroup");const Ui=u.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{setLabelId:c}=Qa(),a=lr(s);return Q(()=>(c(a),()=>{c(void 0)}),[a,c]),Ue("div",t,{ref:n,props:[{id:a},i]})});process.env.NODE_ENV!=="production"&&(Ui.displayName="ComboboxGroupLabel");const Ki=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ki.displayName="ComboboxItemContext");const qi=u.createContext(!1);process.env.NODE_ENV!=="production"&&(qi.displayName="ComboboxRowContext");function Za(){return u.useContext(qi)}const zi=u.memo(u.forwardRef(function(t,n){const{render:o,className:r,value:s=null,index:i,disabled:c=!1,nativeButton:a=!1,...l}=t,p=u.useRef(!1),d=u.useRef(null),b=Ws({index:i,textRef:d,indexGuessBehavior:Gs.GuessFromOrder}),f=st(),g=Za(),{flatFilteredItems:x,hasItems:h}=jt(),y=A(f,N.open),m=A(f,N.selectionMode),v=A(f,N.readOnly),E=A(f,N.virtualized),C=A(f,N.isItemEqualToValue),S=m!=="none",w=i??(E?to(x,s,C):b.index),I=b.index!==-1,U=A(f,N.id),q=A(f,N.isActive,w),K=A(f,N.isSelected,s),V=A(f,N.getItemProps),X=u.useRef(null),Z=U!=null&&I?`${U}-${w}`:void 0,B=K&&S;Q(()=>{if(!(I&&(E||i!=null)))return;const pe=f.state.listRef.current;return pe[w]=X.current,()=>{delete pe[w]}},[I,E,w,i,f]),Q(()=>{if(!I||h)return;const se=f.state.valuesRef.current;return se[w]=s,m!=="none"&&f.state.allValuesRef.current.push(s),()=>{delete se[w]}},[I,h,w,s,f,m]),Q(()=>{if(!y){p.current=!1;return}if(!I||h)return;const se=f.state.selectedValue,pe=Array.isArray(se)?se[se.length-1]:se;Yt(s,pe,C)&&f.set("selectedIndex",w)},[I,h,y,f,w,s,C]);const M={disabled:c,selected:B,highlighted:q},G=V({active:q,selected:B});G.id=void 0,G.onFocus=void 0;const{getButtonProps:_,buttonRef:J}=co({disabled:c,focusableWhenDisabled:!0,native:a});function ne(se){function pe(){f.state.handleSelection(se,s)}f.state.submitOnItemClick?(Xt.flushSync(pe),f.state.requestSubmit()):pe()}const ye={id:Z,role:g?"gridcell":"option","aria-selected":S?B:void 0,tabIndex:void 0,onPointerDownCapture(se){p.current=!0,se.preventDefault()},onClick(se){c||v||ne(se.nativeEvent)},onMouseUp(se){const pe=p.current;p.current=!1,!(c||v||se.button!==0||pe||!q)&&ne(se.nativeEvent)}},ae=Ue("div",t,{ref:[J,n,b.ref,X],state:M,props:[G,ye,l,_]}),he=u.useMemo(()=>({selected:B,textRef:d}),[B,d]);return j.jsx(Ki.Provider,{value:he,children:ae})}));process.env.NODE_ENV!=="production"&&(zi.displayName="ComboboxItem");const Yi=u.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{filteredItems:c}=jt(),a=st(),l=c.length===0?s:null;return Ue("div",t,{ref:[n,a.state.emptyRef],props:[{children:l,role:"status","aria-live":"polite","aria-atomic":!0},i]})});process.env.NODE_ENV!=="production"&&(Yi.displayName="ComboboxEmpty");const Xi=u.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t;return Ue("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(Xi.displayName="Separator");function ef(e){const{multiple:t=!1,defaultValue:n,value:o,onValueChange:r,autoComplete:s,...i}=e;return j.jsx(ja,{...i,selectionMode:t?"multiple":"single",selectedValue:o,defaultSelectedValue:n,onSelectedValueChange:r,formAutoComplete:s})}function tf(e){const{children:t,placeholder:n}=e,o=st(),r=A(o,N.itemToStringLabel),s=A(o,N.selectedValue),i=A(o,N.items),c=A(o,N.selectionMode)==="multiple",a=A(o,N.hasSelectedValue),l=!a&&n!=null&&t==null,p=A(o,N.hasNullItemLabel,l);let d=null;return typeof t=="function"?d=t(s):t!=null?d=t:!a&&n!=null&&!p?d=n:c&&Array.isArray(s)?d=Na(s,i,r):d=Si(s,i,r),j.jsx(u.Fragment,{children:d})}const Ji=u.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=st(),c=A(i,N.open),a=A(i,N.hasSelectionChips),[l,p]=u.useState(void 0);c&&l!==void 0&&p(void 0);const d=u.useRef([]),b=Ue("div",t,{ref:[n,i.state.chipsContainerRef],props:[a?{role:"toolbar"}:We,s]}),f=u.useMemo(()=>({highlightedChipIndex:l,setHighlightedChipIndex:p,chipsRef:d}),[l,p,d]);return j.jsx(kr.Provider,{value:f,children:j.jsx(Ns,{elementsRef:d,children:b})})});process.env.NODE_ENV!=="production"&&(Ji.displayName="ComboboxChips");const Br=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Br.displayName="ComboboxChipContext");function nf(){const e=u.useContext(Br);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":gt(17));return e}const Qi=u.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=st(),{setHighlightedChipIndex:c,chipsRef:a}=Di(),l=A(i,N.disabled),p=A(i,N.readOnly),d=A(i,N.selectedValue),{ref:b,index:f}=Ws();function g(m){let v=f;if(m.key==="ArrowLeft")m.preventDefault(),f>0?v=f-1:v=void 0;else if(m.key==="ArrowRight")m.preventDefault(),f<d.length-1?v=f+1:v=void 0;else if(m.key==="Backspace"||m.key==="Delete"){const E=f>=d.length-1?d.length-2:f;v=E>=0?E:void 0,Ce(m),i.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),i.state.setSelectedValue(d.filter((C,S)=>S!==f),ce(it,m.nativeEvent))}else m.key==="Enter"||m.key===" "?(Ce(m),v=void 0):m.key==="ArrowDown"||m.key==="ArrowUp"?(Ce(m),i.state.setOpen(!0,ce(hn,m.nativeEvent)),v=void 0):m.key.length===1&&!m.ctrlKey&&!m.metaKey&&!m.altKey&&(v=void 0);return v}const h=Ue("div",t,{ref:[n,b],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":p||void 0,onKeyDown(m){if(l||p)return;const v=g(m);Xt.flushSync(()=>{c(v)}),v===void 0?i.state.inputRef.current?.focus():a.current[v]?.focus()},onMouseDown(m){p||(m.preventDefault(),!l&&i.state.inputRef.current?.focus())}},s]}),y=u.useMemo(()=>({index:f}),[f]);return j.jsx(Br.Provider,{value:y,children:h})});process.env.NODE_ENV!=="production"&&(Qi.displayName="ComboboxChip");const Zi=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,a=st(),{index:l}=nf(),p=A(a,N.disabled),d=A(a,N.readOnly),b=A(a,N.selectedValue),f=A(a,N.isItemEqualToValue),g=p||s,{buttonRef:x,getButtonProps:h}=co({native:i,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function m(C){const S=a.state.activeIndex;if(S==null)return;const w=to(a.state.valuesRef.current,C,f);w!==-1&&S===w&&a.state.setIndices({activeIndex:null,type:a.state.keyboardActiveRef.current?"keyboard":"pointer"})}function v(C){const S=ce(el,C.nativeEvent),w=b[l];return m(w),a.state.setSelectedValue(b.filter((I,U)=>U!==l),S),a.state.inputRef.current?.focus(),S}return Ue("button",t,{ref:[n,x],state:y,props:[{tabIndex:-1,onClick(C){if(g||d)return;v(C).isPropagationAllowed||C.stopPropagation()},onKeyDown(C){g||d||(C.key==="Enter"||C.key===" ")&&(v(C).isPropagationAllowed||Ce(C))}},c,h]})});process.env.NODE_ENV!=="production"&&(Zi.displayName="ComboboxChipRemove");const po=u.createContext(null);function of({children:e,...t}){const[n,o]=u.useState(null),r=u.useMemo(()=>({anchorElement:n,setAnchorElement:o}),[n]);return j.jsx(po,{value:r,children:j.jsx(ef,{...t,children:e})})}function rf({className:e,label:t,description:n,error:o,children:r,...s}){return j.jsxs(Mn.Field,{className:e,...s,children:[t&&j.jsx(Mn.FieldLabel,{children:t}),r,n&&j.jsx(Mn.FieldDescription,{children:n}),o&&j.jsx(Mn.FieldError,{children:o})]})}function sf({...e}){return j.jsx(tf,{"data-slot":"combobox-value",...e})}function ec({className:e,children:t,...n}){return j.jsxs(Vi,{"data-slot":"combobox-trigger",className:Ze.cn($e.comboboxTriggerStyles,e),...n,children:[t,j.jsx(or.Icon,{type:"chevron",className:Ze.cn($e.comboboxTriggerIconVariants({disabled:n.disabled})),size:"md"})]})}function cf({className:e,...t}){return j.jsx(Li,{"data-slot":"combobox-clear",className:Ze.cn(e),...t,render:j.jsx(Kn.InputGroupButton,{variant:"link",size:"icon-xs",className:$e.comboboxClearButtonStyles,children:j.jsx(or.Icon,{className:$e.comboboxClearIconStyles,type:"close"})})})}function lf({className:e,children:t,disabled:n=!1,showTrigger:o=!0,showClear:r=!1,...s}){const i=u.use(po),c=u.useCallback(a=>{i&&i.setAnchorElement(l=>l===a?l:a)},[i]);return j.jsxs(Kn.InputGroup,{ref:c,className:Ze.cn($e.comboboxInputGroupStyles,e),children:[j.jsx(Dr,{render:j.jsx(Kn.InputGroupInput,{disabled:n}),...s}),j.jsxs(Kn.InputGroupAddon,{align:"inline-end",className:$e.comboboxInputAddonStyles,children:[o&&j.jsx(ec,{}),r&&j.jsx(cf,{disabled:n})]}),t]})}function uf({className:e,side:t="bottom",sideOffset:n=8,align:o="start",alignOffset:r=0,anchor:s,portalContainer:i,...c}){const l=u.use(po)?.anchorElement??null,p=u.useCallback(()=>{if(typeof document>"u")return null;const x=document.activeElement;return x?x.closest('[data-slot="combobox-chips"]')??x.closest('[data-slot="input-group"]'):null},[]),d=u.useCallback(()=>{const x=l??p();if(typeof Element>"u"||!s)return x;if(s instanceof Element)return s;if(typeof s=="function"){const h=s();return h instanceof Element?h:x}return"current"in s&&s.current instanceof Element?s.current:x},[s,l,p]),b=u.useCallback(()=>{if(typeof document>"u")return;const x=d();if(x instanceof HTMLElement){const y=x.closest('[role="dialog"]');if(y instanceof HTMLElement)return y}const h=document.activeElement?.closest('[role="dialog"]');return h instanceof HTMLElement?h:void 0},[d]),f=s??l??p,g=i??b();return j.jsx(Bi,{container:g,children:j.jsx($i,{side:t,sideOffset:n,align:o,alignOffset:r,anchor:f,className:$e.comboboxPositionerStyles,children:j.jsx(Gi,{"data-slot":"combobox-content","data-chips":!!s,className:Ze.cn($e.comboboxContentStyles,e),...c})})})}function af({className:e,...t}){return j.jsx(Fi,{"data-slot":"combobox-list",className:Ze.cn("flex flex-col gap-1",e),...t})}function ff({className:e,children:t,...n}){return j.jsx(zi,{"data-slot":"combobox-item",className:Ze.cn($e.comboboxItemStyles,e),...n,children:t})}function df({className:e,...t}){return j.jsx(Wi,{"data-slot":"combobox-group",className:Ze.cn(e),...t})}function pf({className:e,...t}){return j.jsx(Ui,{"data-slot":"combobox-label",className:Ze.cn($e.comboboxLabelStyles,e),...t})}function mf({...e}){return j.jsx(_i,{"data-slot":"combobox-collection",...e})}function hf({className:e,...t}){return j.jsx(Yi,{"data-slot":"combobox-empty",className:Ze.cn($e.comboboxEmptyStyles,e),...t})}function gf({className:e,...t}){return j.jsx(Xi,{"data-slot":"combobox-separator",className:Ze.cn($e.comboboxSeparatorStyles,e),...t})}function bf({className:e,disabled:t=!1,...n}){const o=u.use(po),r=u.useCallback(s=>{o&&o.setAnchorElement(i=>i===s?i:s)},[o]);return j.jsx(Ji,{ref:r,"data-slot":"combobox-chips",className:Ze.cn($e.comboboxChipsVariants({disabled:t}),e),...n})}function xf({className:e,children:t,showRemove:n=!0,...o}){return j.jsxs(Qi,{"data-slot":"combobox-chip",className:Ze.cn($e.comboboxChipStyles,e),...o,children:[t,n&&j.jsx(Zi,{render:j.jsx(vc.Button,{className:$e.comboboxClearButtonStyles,variant:"ghost",children:j.jsx(or.Icon,{className:"text-secondary-text",type:"close"})})})]})}function yf({className:e,...t}){return j.jsx(Dr,{"data-slot":"combobox-chip-input",className:Ze.cn($e.comboboxChipsInputVariants({disabled:t.disabled}),e),...t})}exports.Combobox=of;exports.ComboboxChip=xf;exports.ComboboxChips=bf;exports.ComboboxChipsInput=yf;exports.ComboboxCollection=mf;exports.ComboboxContent=uf;exports.ComboboxEmpty=hf;exports.ComboboxField=rf;exports.ComboboxGroup=df;exports.ComboboxInput=lf;exports.ComboboxItem=ff;exports.ComboboxLabel=pf;exports.ComboboxList=af;exports.ComboboxSeparator=gf;exports.ComboboxTrigger=ec;exports.ComboboxValue=sf;
|
|
16
|
+
//# sourceMappingURL=components-ui-combobox-combobox.cjs.map
|