diff --git "a/dev-ui/node_modules/.vite/deps/bits-ui.js.map" "b/dev-ui/node_modules/.vite/deps/bits-ui.js.map" new file mode 100644--- /dev/null +++ "b/dev-ui/node_modules/.vite/deps/bits-ui.js.map" @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../bits-ui/dist/bits/accordion/exports.js", "../../svelte-toolbelt/dist/utils/is.js", "../../svelte-toolbelt/dist/box/box-extras.svelte.js", "../../svelte-toolbelt/dist/box/box.svelte.js", "../../svelte-toolbelt/dist/utils/compose-handlers.js", "../../svelte-toolbelt/dist/utils/strings.js", "../../svelte-toolbelt/dist/utils/css-to-style-obj.js", "../../svelte-toolbelt/dist/utils/execute-callbacks.js", "../../svelte-toolbelt/dist/utils/style-to-css.js", "../../svelte-toolbelt/dist/utils/style.js", "../../svelte-toolbelt/dist/utils/event-list.js", "../../svelte-toolbelt/dist/utils/merge-props.js", "../../svelte-toolbelt/dist/utils/sr-only-styles.js", "../../runed/dist/internal/configurable-globals.js", "../../runed/dist/internal/utils/dom.js", "../../runed/dist/utilities/active-element/active-element.svelte.js", "../../runed/dist/internal/utils/is.js", "../../runed/dist/utilities/extract/extract.svelte.js", "../../runed/dist/utilities/context/context.js", "../../runed/dist/utilities/use-debounce/use-debounce.svelte.js", "../../runed/dist/utilities/watch/watch.svelte.js", "../../runed/dist/internal/utils/get.js", "../../runed/dist/utilities/element-size/element-size.svelte.js", "../../runed/dist/utilities/is-mounted/is-mounted.svelte.js", "../../runed/dist/utilities/previous/previous.svelte.js", "../../runed/dist/utilities/resource/resource.svelte.js", "../../svelte-toolbelt/dist/utils/on-destroy-effect.svelte.js", "../../svelte-toolbelt/dist/utils/on-mount-effect.svelte.js", "../../svelte-toolbelt/dist/utils/after-sleep.js", "../../svelte-toolbelt/dist/utils/after-tick.js", "../../svelte-toolbelt/dist/utils/dom.js", "../../svelte-toolbelt/dist/utils/dom-context.svelte.js", "../../svelte-toolbelt/dist/utils/attach-ref.js", "../../bits-ui/dist/internal/attrs.js", "../../bits-ui/dist/internal/kbd-constants.js", "../../bits-ui/dist/internal/locale.js", "../../bits-ui/dist/internal/get-directional-keys.js", "../../bits-ui/dist/internal/is.js", "../../bits-ui/dist/internal/roving-focus-group.js", "../../bits-ui/dist/internal/animations-complete.js", "../../bits-ui/dist/internal/presence-manager.svelte.js", "../../bits-ui/dist/bits/accordion/accordion.svelte.js", "../../bits-ui/dist/internal/noop.js", "../../bits-ui/dist/internal/create-id.js", "../../bits-ui/dist/bits/accordion/components/accordion.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-item.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-header.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-trigger.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-content.svelte", "../../bits-ui/dist/bits/alert-dialog/exports.js", "../../bits-ui/dist/bits/dialog/dialog.svelte.js", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-title.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-action.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte", "../../bits-ui/dist/bits/utilities/portal/portal-consumer.svelte", "../../bits-ui/dist/bits/utilities/config/bits-config.js", "../../bits-ui/dist/bits/utilities/config/prop-resolvers.js", "../../bits-ui/dist/bits/utilities/portal/portal.svelte", "../../bits-ui/dist/internal/events.js", "../../bits-ui/dist/internal/debounce.js", "../../bits-ui/dist/internal/elements.js", "../../bits-ui/dist/internal/dom.js", "../../bits-ui/dist/bits/menu/utils.js", "../../bits-ui/dist/internal/focus.js", "../../tabbable/src/index.js", "../../bits-ui/dist/internal/tabbable.js", "../../bits-ui/dist/internal/arrays.js", "../../bits-ui/dist/internal/box-auto-reset.svelte.js", "../../bits-ui/dist/internal/dom-typeahead.svelte.js", "../../bits-ui/dist/internal/grace-area.svelte.js", "../../bits-ui/dist/bits/menu/menu.svelte.js", "../../bits-ui/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js", "../../bits-ui/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte", "../../bits-ui/dist/bits/utilities/escape-layer/use-escape-layer.svelte.js", "../../bits-ui/dist/bits/utilities/escape-layer/escape-layer.svelte", "../../bits-ui/dist/bits/utilities/focus-scope/focus-scope-manager.js", "../../bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte.js", "../../bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte", "../../bits-ui/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js", "../../bits-ui/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte", "../../bits-ui/dist/internal/use-id.js", "../../bits-ui/dist/internal/shared-state.svelte.js", "../../bits-ui/dist/internal/body-scroll-lock.svelte.js", "../../bits-ui/dist/bits/utilities/scroll-lock/scroll-lock.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-overlay.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-trigger.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-description.svelte", "../../bits-ui/dist/bits/aspect-ratio/exports.js", "../../bits-ui/dist/bits/aspect-ratio/aspect-ratio.svelte.js", "../../bits-ui/dist/bits/aspect-ratio/components/aspect-ratio.svelte", "../../bits-ui/dist/bits/avatar/exports.js", "../../bits-ui/dist/bits/avatar/avatar.svelte.js", "../../bits-ui/dist/bits/avatar/components/avatar.svelte", "../../bits-ui/dist/bits/avatar/components/avatar-image.svelte", "../../bits-ui/dist/bits/avatar/components/avatar-fallback.svelte", "../../bits-ui/dist/bits/utilities/config/components/bits-config.svelte", "../../bits-ui/dist/bits/button/exports.js", "../../bits-ui/dist/bits/button/components/button.svelte", "../../bits-ui/dist/bits/calendar/exports.js", "../../@internationalized/date/dist/packages/@internationalized/date/src/utils.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/GregorianCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/weekStartData.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/queries.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/conversion.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/manipulation.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/string.ts", "../../@swc/helpers/esm/_check_private_redeclaration.js", "../../@swc/helpers/esm/_class_private_field_init.js", "../../@internationalized/date/dist/packages/@internationalized/date/src/CalendarDate.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/HebrewCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/DateFormatter.ts", "../../bits-ui/dist/internal/date-time/announcer.js", "../../bits-ui/dist/internal/date-time/utils.js", "../../bits-ui/dist/internal/date-time/field/parts.js", "../../bits-ui/dist/internal/date-time/placeholders.js", "../../bits-ui/dist/internal/date-time/field/helpers.js", "../../bits-ui/dist/internal/date-time/field/segments.js", "../../bits-ui/dist/internal/date-time/field/time-helpers.js", "../../bits-ui/dist/internal/date-time/formatter.js", "../../bits-ui/dist/internal/date-time/calendar-helpers.svelte.js", "../../bits-ui/dist/bits/calendar/calendar.svelte.js", "../../bits-ui/dist/bits/calendar/components/calendar.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-day.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-body.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-cell.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-head.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-head-cell.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-row.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-header.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-heading.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-month-select.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-next-button.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-prev-button.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-year-select.svelte", "../../bits-ui/dist/bits/checkbox/exports.js", "../../bits-ui/dist/bits/checkbox/checkbox.svelte.js", "../../bits-ui/dist/bits/utilities/hidden-input.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox-input.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox-group.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox-group-label.svelte", "../../bits-ui/dist/bits/collapsible/exports.js", "../../bits-ui/dist/bits/collapsible/collapsible.svelte.js", "../../bits-ui/dist/bits/collapsible/components/collapsible.svelte", "../../bits-ui/dist/bits/collapsible/components/collapsible-content.svelte", "../../bits-ui/dist/bits/collapsible/components/collapsible-trigger.svelte", "../../bits-ui/dist/bits/combobox/exports.js", "../../@floating-ui/utils/dist/floating-ui.utils.mjs", "../../@floating-ui/core/dist/floating-ui.core.mjs", "../../@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../../@floating-ui/dom/dist/floating-ui.dom.mjs", "../../bits-ui/dist/internal/floating-svelte/floating-utils.svelte.js", "../../bits-ui/dist/internal/floating-svelte/use-floating.svelte.js", "../../bits-ui/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js", "../../bits-ui/dist/bits/utilities/floating-layer/components/floating-layer.svelte", "../../bits-ui/dist/internal/data-typeahead.svelte.js", "../../bits-ui/dist/bits/select/select.svelte.js", "../../bits-ui/dist/bits/select/components/select-hidden-input.svelte", "../../bits-ui/dist/bits/combobox/components/combobox.svelte", "../../bits-ui/dist/bits/utilities/floating-layer/components/index.js", "../../bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte", "../../bits-ui/dist/bits/utilities/arrow/arrow.svelte", "../../bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-arrow.svelte", "../../bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte", "../../bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content-static.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-input.svelte", "../../bits-ui/dist/bits/separator/separator.svelte.js", "../../bits-ui/dist/bits/separator/components/separator.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-trigger.svelte", "../../bits-ui/dist/bits/utilities/popper-layer/popper-content.svelte", "../../bits-ui/dist/bits/utilities/popper-layer/popper-layer-inner.svelte", "../../bits-ui/dist/bits/utilities/popper-layer/popper-layer.svelte", "../../bits-ui/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte", "../../bits-ui/dist/bits/select/components/select-content.svelte", "../../bits-ui/dist/bits/select/components/select-content-static.svelte", "../../bits-ui/dist/bits/utilities/mounted.svelte", "../../bits-ui/dist/bits/select/components/select-item.svelte", "../../bits-ui/dist/bits/select/components/select-group.svelte", "../../bits-ui/dist/bits/select/components/select-group-heading.svelte", "../../bits-ui/dist/bits/select/components/select-viewport.svelte", "../../bits-ui/dist/bits/select/components/select-scroll-down-button.svelte", "../../bits-ui/dist/bits/select/components/select-scroll-up-button.svelte", "../../bits-ui/dist/bits/command/exports.js", "../../bits-ui/dist/bits/command/utils.js", "../../bits-ui/dist/internal/css-escape.js", "../../bits-ui/dist/bits/command/command.svelte.js", "../../bits-ui/dist/bits/command/components/_command-label.svelte", "../../bits-ui/dist/bits/command/components/command.svelte", "../../bits-ui/dist/bits/command/components/command-empty.svelte", "../../bits-ui/dist/bits/command/components/command-group.svelte", "../../bits-ui/dist/bits/command/components/command-group-heading.svelte", "../../bits-ui/dist/bits/command/components/command-group-items.svelte", "../../bits-ui/dist/bits/command/components/command-input.svelte", "../../bits-ui/dist/bits/command/components/command-item.svelte", "../../bits-ui/dist/bits/command/components/command-link-item.svelte", "../../bits-ui/dist/bits/command/components/command-list.svelte", "../../bits-ui/dist/bits/command/components/command-viewport.svelte", "../../bits-ui/dist/bits/command/components/command-loading.svelte", "../../bits-ui/dist/bits/command/components/command-separator.svelte", "../../bits-ui/dist/bits/command/compute-command-score.js", "../../bits-ui/dist/bits/context-menu/exports.js", "../../bits-ui/dist/bits/context-menu/components/context-menu.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub.svelte", "../../bits-ui/dist/bits/menu/components/menu-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-group.svelte", "../../bits-ui/dist/bits/menu/components/menu-group-heading.svelte", "../../bits-ui/dist/bits/menu/components/menu-arrow.svelte", "../../bits-ui/dist/bits/context-menu/components/context-menu-content.svelte", "../../bits-ui/dist/bits/context-menu/components/context-menu-content-static.svelte", "../../bits-ui/dist/bits/context-menu/components/context-menu-trigger.svelte", "../../bits-ui/dist/bits/menu/components/menu-radio-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-separator.svelte", "../../bits-ui/dist/bits/menu/components/menu-radio-group.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub-content.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub-content-static.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub-trigger.svelte", "../../bits-ui/dist/bits/menu/components/menu-checkbox-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-checkbox-group.svelte", "../../bits-ui/dist/bits/date-field/exports.js", "../../bits-ui/dist/bits/date-field/date-field.svelte.js", "../../bits-ui/dist/bits/date-field/components/date-field.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-hidden-input.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-input.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-label.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-segment.svelte", "../../bits-ui/dist/bits/date-picker/exports.js", "../../bits-ui/dist/bits/date-picker/date-picker.svelte.js", "../../bits-ui/dist/bits/popover/popover.svelte.js", "../../bits-ui/dist/bits/date-picker/components/date-picker.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-calendar.svelte", "../../bits-ui/dist/bits/popover/components/popover-content.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-content.svelte", "../../bits-ui/dist/bits/popover/components/popover-content-static.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-content-static.svelte", "../../bits-ui/dist/bits/popover/components/popover-trigger.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-trigger.svelte", "../../bits-ui/dist/bits/popover/components/popover-arrow.svelte", "../../bits-ui/dist/bits/popover/components/popover-close.svelte", "../../bits-ui/dist/bits/date-range-field/exports.js", "../../bits-ui/dist/bits/date-range-field/date-range-field.svelte.js", "../../bits-ui/dist/bits/date-range-field/components/date-range-field.svelte", "../../bits-ui/dist/bits/date-range-field/components/date-range-field-input.svelte", "../../bits-ui/dist/bits/date-range-field/components/date-range-field-label.svelte", "../../bits-ui/dist/bits/date-range-picker/exports.js", "../../bits-ui/dist/bits/date-range-picker/date-range-picker.svelte.js", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker.svelte", "../../bits-ui/dist/bits/range-calendar/range-calendar.svelte.js", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-trigger.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-cell.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-day.svelte", "../../bits-ui/dist/bits/dialog/exports.js", "../../bits-ui/dist/bits/dialog/components/dialog.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-close.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-content.svelte", "../../bits-ui/dist/bits/dropdown-menu/exports.js", "../../bits-ui/dist/bits/menu/components/menu.svelte", "../../bits-ui/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte", "../../bits-ui/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte", "../../bits-ui/dist/bits/menu/components/menu-trigger.svelte", "../../bits-ui/dist/bits/label/exports.js", "../../bits-ui/dist/bits/label/label.svelte.js", "../../bits-ui/dist/bits/label/components/label.svelte", "../../bits-ui/dist/bits/link-preview/exports.js", "../../bits-ui/dist/bits/link-preview/link-preview.svelte.js", "../../bits-ui/dist/bits/link-preview/components/link-preview.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-content.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-trigger.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-content-static.svelte", "../../bits-ui/dist/bits/menubar/exports.js", "../../bits-ui/dist/bits/menubar/menubar.svelte.js", "../../bits-ui/dist/bits/menubar/components/menubar.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-menu.svelte", "../../bits-ui/dist/bits/menu/components/menu-content.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-content.svelte", "../../bits-ui/dist/bits/menu/components/menu-content-static.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-content-static.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-trigger.svelte", "../../bits-ui/dist/bits/meter/exports.js", "../../bits-ui/dist/bits/meter/meter.svelte.js", "../../bits-ui/dist/bits/meter/components/meter.svelte", "../../bits-ui/dist/bits/navigation-menu/exports.js", "../../bits-ui/dist/bits/pin-input/usePasswordManager.svelte.js", "../../bits-ui/dist/bits/pin-input/pin-input.svelte.js", "../../bits-ui/dist/internal/use-arrow-navigation.js", "../../bits-ui/dist/internal/svelte-resize-observer.svelte.js", "../../bits-ui/dist/bits/navigation-menu/navigation-menu.svelte.js", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte", "../../bits-ui/dist/internal/state-machine.js", "../../bits-ui/dist/bits/utilities/presence-layer/presence.svelte.js", "../../bits-ui/dist/bits/utilities/presence-layer/presence-layer.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-content.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-item.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-link.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-list.svelte", "../../bits-ui/dist/bits/utilities/visually-hidden/visually-hidden.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte", "../../bits-ui/dist/bits/navigation-menu/components/navigation-menu-sub.svelte", "../../bits-ui/dist/bits/pagination/exports.js", "../../bits-ui/dist/bits/pagination/pagination.svelte.js", "../../bits-ui/dist/bits/pagination/components/pagination.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-prev-button.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-next-button.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-page.svelte", "../../bits-ui/dist/bits/pin-input/exports.js", "../../bits-ui/dist/bits/pin-input/components/pin-input.svelte", "../../bits-ui/dist/bits/pin-input/components/pin-input-cell.svelte", "../../bits-ui/dist/bits/popover/exports.js", "../../bits-ui/dist/bits/popover/components/popover.svelte", "../../bits-ui/dist/bits/popover/components/popover-overlay.svelte", "../../bits-ui/dist/bits/progress/exports.js", "../../bits-ui/dist/bits/progress/progress.svelte.js", "../../bits-ui/dist/bits/progress/components/progress.svelte", "../../bits-ui/dist/bits/radio-group/exports.js", "../../bits-ui/dist/bits/radio-group/radio-group.svelte.js", "../../bits-ui/dist/bits/radio-group/components/radio-group-input.svelte", "../../bits-ui/dist/bits/radio-group/components/radio-group.svelte", "../../bits-ui/dist/bits/radio-group/components/radio-group-item.svelte", "../../bits-ui/dist/bits/range-calendar/exports.js", "../../bits-ui/dist/bits/range-calendar/components/range-calendar.svelte", "../../bits-ui/dist/bits/rating-group/exports.js", "../../bits-ui/dist/bits/rating-group/rating-group.svelte.js", "../../bits-ui/dist/bits/rating-group/components/rating-group-input.svelte", "../../bits-ui/dist/bits/rating-group/components/rating-group.svelte", "../../bits-ui/dist/bits/rating-group/components/rating-group-item.svelte", "../../bits-ui/dist/bits/scroll-area/exports.js", "../../bits-ui/dist/internal/clamp.js", "../../bits-ui/dist/bits/scroll-area/scroll-area.svelte.js", "../../bits-ui/dist/bits/scroll-area/components/scroll-area.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-viewport.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-shared.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-x.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-y.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-visible.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-auto.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-scroll.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-hover.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-thumb-impl.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-thumb.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-corner-impl.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-corner.svelte", "../../bits-ui/dist/bits/select/exports.js", "../../bits-ui/dist/bits/select/components/select.svelte", "../../bits-ui/dist/bits/select/components/select-trigger.svelte", "../../bits-ui/dist/bits/separator/exports.js", "../../bits-ui/dist/bits/slider/exports.js", "../../bits-ui/dist/bits/slider/helpers.js", "../../bits-ui/dist/internal/math.js", "../../bits-ui/dist/bits/slider/slider.svelte.js", "../../bits-ui/dist/bits/slider/components/slider.svelte", "../../bits-ui/dist/bits/slider/components/slider-range.svelte", "../../bits-ui/dist/bits/slider/components/slider-thumb.svelte", "../../bits-ui/dist/bits/slider/components/slider-tick.svelte", "../../bits-ui/dist/bits/slider/components/slider-tick-label.svelte", "../../bits-ui/dist/bits/slider/components/slider-thumb-label.svelte", "../../bits-ui/dist/bits/switch/exports.js", "../../bits-ui/dist/bits/switch/switch.svelte.js", "../../bits-ui/dist/bits/switch/components/switch-input.svelte", "../../bits-ui/dist/bits/switch/components/switch.svelte", "../../bits-ui/dist/bits/switch/components/switch-thumb.svelte", "../../bits-ui/dist/bits/tabs/exports.js", "../../bits-ui/dist/bits/tabs/tabs.svelte.js", "../../bits-ui/dist/bits/tabs/components/tabs.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-content.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-list.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-trigger.svelte", "../../bits-ui/dist/bits/time-field/exports.js", "../../bits-ui/dist/bits/time-field/time-field.svelte.js", "../../bits-ui/dist/bits/time-field/components/time-field.svelte", "../../bits-ui/dist/bits/time-field/components/time-field-hidden-input.svelte", "../../bits-ui/dist/bits/time-field/components/time-field-input.svelte", "../../bits-ui/dist/bits/time-field/components/time-field-label.svelte", "../../bits-ui/dist/bits/time-field/components/time-field-segment.svelte", "../../bits-ui/dist/bits/time-range-field/exports.js", "../../bits-ui/dist/bits/time-range-field/time-range-field.svelte.js", "../../bits-ui/dist/bits/time-range-field/components/time-range-field.svelte", "../../bits-ui/dist/bits/time-range-field/components/time-range-field-input.svelte", "../../bits-ui/dist/bits/time-range-field/components/time-range-field-label.svelte", "../../bits-ui/dist/bits/toggle/exports.js", "../../bits-ui/dist/bits/toggle/toggle.svelte.js", "../../bits-ui/dist/bits/toggle/components/toggle.svelte", "../../bits-ui/dist/bits/toggle-group/exports.js", "../../bits-ui/dist/bits/toggle-group/toggle-group.svelte.js", "../../bits-ui/dist/bits/toggle-group/components/toggle-group.svelte", "../../bits-ui/dist/bits/toggle-group/components/toggle-group-item.svelte", "../../bits-ui/dist/bits/toolbar/exports.js", "../../bits-ui/dist/bits/toolbar/toolbar.svelte.js", "../../bits-ui/dist/bits/toolbar/components/toolbar.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-button.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-link.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-group.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-group-item.svelte", "../../bits-ui/dist/bits/tooltip/exports.js", "../../bits-ui/dist/internal/timeout-fn.js", "../../bits-ui/dist/bits/tooltip/tooltip.svelte.js", "../../bits-ui/dist/bits/tooltip/components/tooltip.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-content.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-content-static.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-trigger.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-arrow.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-provider.svelte", "../../bits-ui/dist/bits/utilities/is-using-keyboard/is-using-keyboard.svelte.js"], + "sourcesContent": ["export { default as Root } from \"./components/accordion.svelte\";\nexport { default as Item } from \"./components/accordion-item.svelte\";\nexport { default as Header } from \"./components/accordion-header.svelte\";\nexport { default as Trigger } from \"./components/accordion-trigger.svelte\";\nexport { default as Content } from \"./components/accordion-content.svelte\";\n", "export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nconst CLASS_VALUE_PRIMITIVE_TYPES = [\"string\", \"number\", \"bigint\", \"boolean\"];\nexport function isClassValue(value) {\n // handle primitive types\n if (value === null || value === undefined)\n return true;\n if (CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value))\n return true;\n // handle arrays (ClassArray)\n if (Array.isArray(value))\n return value.every((item) => isClassValue(item));\n // handle objects (ClassDictionary)\n if (typeof value === \"object\") {\n // ensure it's a plain object and not some other object type\n if (Object.getPrototypeOf(value) !== Object.prototype)\n return false;\n return true;\n }\n return false;\n}\n", "import { isFunction, isObject } from \"../utils/is.js\";\nexport const BoxSymbol = Symbol(\"box\");\nexport const isWritableSymbol = Symbol(\"is-writable\");\nfunction boxWith(getter, setter) {\n const derived = $derived.by(getter);\n if (setter) {\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return derived;\n },\n set current(v) {\n setter(v);\n }\n };\n }\n return {\n [BoxSymbol]: true,\n get current() {\n return getter();\n }\n };\n}\n/**\n * @returns Whether the value is a Box\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isBox(value) {\n return isObject(value) && BoxSymbol in value;\n}\n/**\n * @returns Whether the value is a WritableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isWritableBox(value) {\n return isBox(value) && isWritableSymbol in value;\n}\nfunction boxFrom(value) {\n if (isBox(value))\n return value;\n if (isFunction(value))\n return boxWith(value);\n return simpleBox(value);\n}\n/**\n * Function that gets an object of boxes, and returns an object of reactive values\n *\n * @example\n * const count = box(0)\n * const flat = box.flatten({ count, double: box.with(() => count.current) })\n * // type of flat is { count: number, readonly double: number }\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction boxFlatten(boxes) {\n return Object.entries(boxes).reduce((acc, [key, b]) => {\n if (!isBox(b)) {\n return Object.assign(acc, { [key]: b });\n }\n if (isWritableBox(b)) {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(v) {\n b.current = v;\n }\n });\n }\n else {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n }\n });\n }\n return acc;\n }, {});\n}\n/**\n * Function that converts a box to a readonly box.\n *\n * @example\n * const count = box(0) // WritableBox\n * const countReadonly = box.readonly(count) // ReadableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction toReadonlyBox(b) {\n if (!isWritableBox(b))\n return b;\n return {\n [BoxSymbol]: true,\n get current() {\n return b.current;\n }\n };\n}\nfunction simpleBox(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nexport { boxWith, isBox, isWritableBox, boxFrom, boxFlatten, toReadonlyBox, simpleBox };\n", "import { boxFrom, boxWith, boxFlatten, toReadonlyBox, isBox, isWritableBox, BoxSymbol, isWritableSymbol } from \"./box-extras.svelte.js\";\nexport function box(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nbox.from = boxFrom;\nbox.with = boxWith;\nbox.flatten = boxFlatten;\nbox.readonly = toReadonlyBox;\nbox.isBox = isBox;\nbox.isWritableBox = isWritableBox;\n", "/**\n * Composes event handlers into a single function that can be called with an event.\n * If the previous handler cancels the event using `event.preventDefault()`, the handlers\n * that follow will not be called.\n */\nexport function composeHandlers(...handlers) {\n return function (e) {\n for (const handler of handlers) {\n if (!handler)\n continue;\n if (e.defaultPrevented)\n return;\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n else {\n handler.current?.call(this, e);\n }\n }\n };\n}\n", "const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\"-\", \"_\", \"/\", \".\"];\nfunction isUppercase(char = \"\") {\n if (NUMBER_CHAR_RE.test(char))\n return undefined;\n return char !== char.toLowerCase();\n}\nfunction splitByCase(str) {\n const parts = [];\n let buff = \"\";\n let previousUpper;\n let previousSplitter;\n for (const char of str) {\n // Splitter\n const isSplitter = STR_SPLITTERS.includes(char);\n if (isSplitter === true) {\n parts.push(buff);\n buff = \"\";\n previousUpper = undefined;\n continue;\n }\n const isUpper = isUppercase(char);\n if (previousSplitter === false) {\n // Case rising edge\n if (previousUpper === false && isUpper === true) {\n parts.push(buff);\n buff = char;\n previousUpper = isUpper;\n continue;\n }\n // Case falling edge\n if (previousUpper === true && isUpper === false && buff.length > 1) {\n const lastChar = buff.at(-1);\n parts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n buff = lastChar + char;\n previousUpper = isUpper;\n continue;\n }\n }\n // Normal char\n buff += char;\n previousUpper = isUpper;\n previousSplitter = isSplitter;\n }\n parts.push(buff);\n return parts;\n}\nexport function pascalCase(str) {\n if (!str)\n return \"\";\n return splitByCase(str)\n .map((p) => upperFirst(p))\n .join(\"\");\n}\nexport function camelCase(str) {\n return lowerFirst(pascalCase(str || \"\"));\n}\nexport function kebabCase(str) {\n return str\n ? splitByCase(str)\n .map((p) => p.toLowerCase())\n .join(\"-\")\n : \"\";\n}\nfunction upperFirst(str) {\n return str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n return str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\n", "import parse from \"style-to-object\";\nimport { camelCase, pascalCase } from \"./strings.js\";\nexport function cssToStyleObj(css) {\n if (!css)\n return {};\n const styleObj = {};\n function iterator(name, value) {\n if (name.startsWith(\"-moz-\") ||\n name.startsWith(\"-webkit-\") ||\n name.startsWith(\"-ms-\") ||\n name.startsWith(\"-o-\")) {\n styleObj[pascalCase(name)] = value;\n return;\n }\n if (name.startsWith(\"--\")) {\n styleObj[name] = value;\n return;\n }\n styleObj[camelCase(name)] = value;\n }\n parse(css, iterator);\n return styleObj;\n}\n", "/**\n * Executes an array of callback functions with the same arguments.\n * @template T The types of the arguments that the callback functions take.\n * @param callbacks array of callback functions to execute.\n * @returns A new function that executes all of the original callback functions with the same arguments.\n */\nexport function executeCallbacks(...callbacks) {\n return (...args) => {\n for (const callback of callbacks) {\n if (typeof callback === \"function\") {\n callback(...args);\n }\n }\n };\n}\n", "function createParser(matcher, replacer) {\n const regex = RegExp(matcher, \"g\");\n return (str) => {\n // throw an error if not a string\n if (typeof str !== \"string\") {\n throw new TypeError(`expected an argument of type string, but got ${typeof str}`);\n }\n // if no match between string and matcher\n if (!str.match(regex))\n return str;\n // executes the replacer function for each match\n return str.replace(regex, replacer);\n };\n}\nconst camelToKebab = createParser(/[A-Z]/, (match) => `-${match.toLowerCase()}`);\nexport function styleToCSS(styleObj) {\n if (!styleObj || typeof styleObj !== \"object\" || Array.isArray(styleObj)) {\n throw new TypeError(`expected an argument of type object, but got ${typeof styleObj}`);\n }\n return Object.keys(styleObj)\n .map((property) => `${camelToKebab(property)}: ${styleObj[property]};`)\n .join(\"\\n\");\n}\n", "import { styleToCSS } from \"./style-to-css.js\";\nexport function styleToString(style = {}) {\n return styleToCSS(style).replace(\"\\n\", \" \");\n}\n", "const EVENT_LIST = [\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncompositionend\",\n \"oncompositionstart\",\n \"oncompositionupdate\",\n \"oncontextlost\",\n \"oncontextmenu\",\n \"oncontextrestored\",\n \"oncopy\",\n \"oncuechange\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onsecuritypolicyviolation\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwebkitanimationend\",\n \"onwebkitanimationiteration\",\n \"onwebkitanimationstart\",\n \"onwebkittransitionend\",\n \"onwheel\"\n];\nexport const EVENT_LIST_SET = new Set(EVENT_LIST);\n", "/**\n * Modified from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts (see NOTICE.txt for source)\n */\nimport { clsx } from \"clsx\";\nimport { composeHandlers } from \"./compose-handlers.js\";\nimport { cssToStyleObj } from \"./css-to-style-obj.js\";\nimport { isClassValue } from \"./is.js\";\nimport { executeCallbacks } from \"./execute-callbacks.js\";\nimport { styleToString } from \"./style.js\";\nimport { EVENT_LIST_SET } from \"./event-list.js\";\nfunction isEventHandler(key) {\n return EVENT_LIST_SET.has(key);\n}\n/**\n * Given a list of prop objects, merges them into a single object.\n * - Automatically composes event handlers (e.g. `onclick`, `oninput`, etc.)\n * - Chains regular functions with the same name so they are called in order\n * - Merges class strings with `clsx`\n * - Merges style objects and converts them to strings\n * - Handles a bug with Svelte where setting the `hidden` attribute to `false` doesn't remove it\n * - Overrides other values with the last one\n */\nexport function mergeProps(...args) {\n const result = { ...args[0] };\n for (let i = 1; i < args.length; i++) {\n const props = args[i];\n if (!props)\n continue;\n // Handle string keys\n for (const key of Object.keys(props)) {\n const a = result[key];\n const b = props[key];\n const aIsFunction = typeof a === \"function\";\n const bIsFunction = typeof b === \"function\";\n // compose event handlers\n if (aIsFunction && typeof bIsFunction && isEventHandler(key)) {\n // handle merging of event handlers\n const aHandler = a;\n const bHandler = b;\n result[key] = composeHandlers(aHandler, bHandler);\n }\n else if (aIsFunction && bIsFunction) {\n // chain non-event handler functions\n result[key] = executeCallbacks(a, b);\n }\n else if (key === \"class\") {\n // handle merging acceptable class values from clsx\n const aIsClassValue = isClassValue(a);\n const bIsClassValue = isClassValue(b);\n if (aIsClassValue && bIsClassValue) {\n result[key] = clsx(a, b);\n }\n else if (aIsClassValue) {\n result[key] = clsx(a);\n }\n else if (bIsClassValue) {\n result[key] = clsx(b);\n }\n }\n else if (key === \"style\") {\n const aIsObject = typeof a === \"object\";\n const bIsObject = typeof b === \"object\";\n const aIsString = typeof a === \"string\";\n const bIsString = typeof b === \"string\";\n if (aIsObject && bIsObject) {\n // both are style objects, merge them\n result[key] = { ...a, ...b };\n }\n else if (aIsObject && bIsString) {\n // a is style object, b is string, convert b to style object and merge\n const parsedStyle = cssToStyleObj(b);\n result[key] = { ...a, ...parsedStyle };\n }\n else if (aIsString && bIsObject) {\n // a is string, b is style object, convert a to style object and merge\n const parsedStyle = cssToStyleObj(a);\n result[key] = { ...parsedStyle, ...b };\n }\n else if (aIsString && bIsString) {\n // both are strings, convert both to objects and merge\n const parsedStyleA = cssToStyleObj(a);\n const parsedStyleB = cssToStyleObj(b);\n result[key] = { ...parsedStyleA, ...parsedStyleB };\n }\n else if (aIsObject) {\n result[key] = a;\n }\n else if (bIsObject) {\n result[key] = b;\n }\n else if (aIsString) {\n result[key] = a;\n }\n else if (bIsString) {\n result[key] = b;\n }\n }\n else {\n // override other values\n result[key] = b !== undefined ? b : a;\n }\n }\n // handle symbol keys (mostly for `Attachments`)\n for (const key of Object.getOwnPropertySymbols(props)) {\n const a = result[key];\n const b = props[key];\n // for matching symbols, we just override\n result[key] = b !== undefined ? b : a;\n }\n }\n // convert style object to string\n if (typeof result.style === \"object\") {\n result.style = styleToString(result.style).replaceAll(\"\\n\", \" \");\n }\n // handle weird svelte bug where `hidden` is not removed when set to `false`\n if (result.hidden === false) {\n result.hidden = undefined;\n delete result.hidden;\n }\n // handle weird svelte bug where `disabled` is not removed when set to `false`\n if (result.disabled === false) {\n result.disabled = undefined;\n delete result.disabled;\n }\n return result;\n}\n", "import { styleToString } from \"./style.js\";\nexport const srOnlyStyles = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: \"0\",\n transform: \"translateX(-100%)\"\n};\nexport const srOnlyStylesString = styleToString(srOnlyStyles);\n", "import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n", "import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n", "import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n", "export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nexport function isElement(value) {\n return value instanceof Element;\n}\n", "import { isFunction } from \"../../internal/utils/is.js\";\nexport function extract(value, defaultValue) {\n if (isFunction(value)) {\n const getter = value;\n const gotten = getter();\n if (gotten === undefined)\n return defaultValue;\n return gotten;\n }\n if (value === undefined)\n return defaultValue;\n return value;\n}\n", "import { getContext, hasContext, setContext } from \"svelte\";\nexport class Context {\n #name;\n #key;\n /**\n * @param name The name of the context.\n * This is used for generating the context key and error messages.\n */\n constructor(name) {\n this.#name = name;\n this.#key = Symbol(name);\n }\n /**\n * The key used to get and set the context.\n *\n * It is not recommended to use this value directly.\n * Instead, use the methods provided by this class.\n */\n get key() {\n return this.#key;\n }\n /**\n * Checks whether this has been set in the context of a parent component.\n *\n * Must be called during component initialisation.\n */\n exists() {\n return hasContext(this.#key);\n }\n /**\n * Retrieves the context that belongs to the closest parent component.\n *\n * Must be called during component initialisation.\n *\n * @throws An error if the context does not exist.\n */\n get() {\n const context = getContext(this.#key);\n if (context === undefined) {\n throw new Error(`Context \"${this.#name}\" not found`);\n }\n return context;\n }\n /**\n * Retrieves the context that belongs to the closest parent component,\n * or the given fallback value if the context does not exist.\n *\n * Must be called during component initialisation.\n */\n getOr(fallback) {\n const context = getContext(this.#key);\n if (context === undefined) {\n return fallback;\n }\n return context;\n }\n /**\n * Associates the given value with the current component and returns it.\n *\n * Must be called during component initialisation.\n */\n set(context) {\n return setContext(this.#key, context);\n }\n}\n", "import { extract } from \"../extract/extract.svelte.js\";\n/**\n * Function that takes a callback, and returns a debounced version of it.\n * When calling the debounced function, it will wait for the specified time\n * before calling the original callback. If the debounced function is called\n * again before the time has passed, the timer will be reset.\n *\n * You can await the debounced function to get the value when it is eventually\n * called.\n *\n * The second parameter is the time to wait before calling the original callback.\n * Alternatively, it can also be a getter function that returns the time to wait.\n *\n * @see {@link https://runed.dev/docs/utilities/use-debounce}\n *\n * @param callback The callback to call when the time has passed.\n * @param wait The length of time to wait in ms, defaults to 250.\n */\nexport function useDebounce(callback, wait) {\n let context = $state(null);\n const wait$ = $derived(extract(wait, 250));\n function debounced(...args) {\n if (context) {\n // Old context will be reused so callers awaiting the promise will get the\n // new value\n if (context.timeout) {\n clearTimeout(context.timeout);\n }\n }\n else {\n // No old context, create a new one\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n context = {\n timeout: null,\n runner: null,\n promise,\n resolve: resolve,\n reject: reject,\n };\n }\n context.runner = async () => {\n // Grab the context and reset it\n // -> new debounced calls will create a new context\n if (!context)\n return;\n const ctx = context;\n context = null;\n try {\n ctx.resolve(await callback.apply(this, args));\n }\n catch (error) {\n ctx.reject(error);\n }\n };\n context.timeout = setTimeout(context.runner, wait$);\n return context.promise;\n }\n debounced.cancel = async () => {\n if (!context || context.timeout === null) {\n // Wait one event loop to see if something triggered the debounced function\n await new Promise((resolve) => setTimeout(resolve, 0));\n if (!context || context.timeout === null)\n return;\n }\n clearTimeout(context.timeout);\n context.reject(\"Cancelled\");\n context = null;\n };\n debounced.runScheduledNow = async () => {\n if (!context || !context.timeout) {\n // Wait one event loop to see if something triggered the debounced function\n await new Promise((resolve) => setTimeout(resolve, 0));\n if (!context || !context.timeout)\n return;\n }\n clearTimeout(context.timeout);\n context.timeout = null;\n await context.runner?.();\n };\n Object.defineProperty(debounced, \"pending\", {\n enumerable: true,\n get() {\n return !!context?.timeout;\n },\n });\n return debounced;\n}\n", "import { untrack } from \"svelte\";\nfunction runEffect(flush, effect) {\n switch (flush) {\n case \"post\":\n $effect(effect);\n break;\n case \"pre\":\n $effect.pre(effect);\n break;\n }\n}\nfunction runWatcher(sources, flush, effect, options = {}) {\n const { lazy = false } = options;\n // Run the effect immediately if `lazy` is `false`.\n let active = !lazy;\n // On the first run, if the dependencies are an array, pass an empty array\n // to the previous value instead of `undefined` to allow destructuring.\n //\n // watch(() => [a, b], ([a, b], [prevA, prevB]) => { ... });\n let previousValues = Array.isArray(sources)\n ? []\n : undefined;\n runEffect(flush, () => {\n const values = Array.isArray(sources) ? sources.map((source) => source()) : sources();\n if (!active) {\n active = true;\n previousValues = values;\n return;\n }\n const cleanup = untrack(() => effect(values, previousValues));\n previousValues = values;\n return cleanup;\n });\n}\nfunction runWatcherOnce(sources, flush, effect) {\n const cleanupRoot = $effect.root(() => {\n let stop = false;\n runWatcher(sources, flush, (values, previousValues) => {\n if (stop) {\n cleanupRoot();\n return;\n }\n // Since `lazy` is `true`, `previousValues` is always defined.\n const cleanup = effect(values, previousValues);\n stop = true;\n return cleanup;\n }, \n // Running the effect immediately just once makes no sense at all.\n // That's just `onMount` with extra steps.\n { lazy: true });\n });\n $effect(() => {\n return cleanupRoot;\n });\n}\nexport function watch(sources, effect, options) {\n runWatcher(sources, \"post\", effect, options);\n}\nfunction watchPre(sources, effect, options) {\n runWatcher(sources, \"pre\", effect, options);\n}\nwatch.pre = watchPre;\nexport function watchOnce(source, effect) {\n runWatcherOnce(source, \"post\", effect);\n}\nfunction watchOncePre(source, effect) {\n runWatcherOnce(source, \"pre\", effect);\n}\nwatchOnce.pre = watchOncePre;\n", "import { isFunction } from \"./is.js\";\nexport function get(value) {\n if (isFunction(value)) {\n return value();\n }\n return value;\n}\n", "import { defaultWindow } from \"../../internal/configurable-globals.js\";\nimport { get } from \"../../internal/utils/get.js\";\nimport { createSubscriber } from \"svelte/reactivity\";\n/**\n * Returns a reactive value holding the size of `node`.\n *\n * Accepts an `options` object with the following properties:\n * - `initialSize`: The initial size of the element. Defaults to `{ width: 0, height: 0 }`.\n * - `box`: The box model to use. Can be either `\"content-box\"` or `\"border-box\"`. Defaults to `\"border-box\"`.\n *\n * @returns an object with `width` and `height` properties.\n *\n * @see {@link https://runed.dev/docs/utilities/element-size}\n */\nexport class ElementSize {\n // no need to use `$state` here since we are using createSubscriber\n #size = {\n width: 0,\n height: 0,\n };\n #observed = false;\n #options;\n #node;\n #window;\n // we use a derived here to extract the width so that if the width doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #width = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().width;\n });\n // we use a derived here to extract the height so that if the height doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #height = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().height;\n });\n // we need to use a derived here because the class will be created before the node is bound to the ref\n #subscribe = $derived.by(() => {\n const node$ = get(this.#node);\n if (!node$)\n return;\n return createSubscriber((update) => {\n if (!this.#window)\n return;\n const observer = new this.#window.ResizeObserver((entries) => {\n this.#observed = true;\n for (const entry of entries) {\n const boxSize = this.#options.box === \"content-box\" ? entry.contentBoxSize : entry.borderBoxSize;\n const boxSizeArr = Array.isArray(boxSize) ? boxSize : [boxSize];\n this.#size.width = boxSizeArr.reduce((acc, size) => Math.max(acc, size.inlineSize), 0);\n this.#size.height = boxSizeArr.reduce((acc, size) => Math.max(acc, size.blockSize), 0);\n }\n update();\n });\n observer.observe(node$);\n return () => {\n this.#observed = false;\n observer.disconnect();\n };\n });\n });\n constructor(node, options = { box: \"border-box\" }) {\n this.#window = options.window ?? defaultWindow;\n this.#options = options;\n this.#node = node;\n this.#size = {\n width: 0,\n height: 0,\n };\n }\n calculateSize() {\n const element = get(this.#node);\n // no element or no window, return undefined, we will return 0x0 in the getSize method\n if (!element || !this.#window) {\n return;\n }\n const offsetWidth = element.offsetWidth;\n const offsetHeight = element.offsetHeight;\n // easy mode, just return offsets\n if (this.#options.box === \"border-box\") {\n return {\n width: offsetWidth,\n height: offsetHeight,\n };\n }\n // hard mode, we need to calculate the content size\n const style = this.#window.getComputedStyle(element);\n const paddingWidth = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n const paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n const borderWidth = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n const borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n const contentWidth = offsetWidth - paddingWidth - borderWidth;\n const contentHeight = offsetHeight - paddingHeight - borderHeight;\n return {\n width: contentWidth,\n height: contentHeight,\n };\n }\n getSize() {\n // if the resize observer already run we can just return the size\n // otherwise we calculate the size if possible or we return the initial size\n return this.#observed ? this.#size : (this.calculateSize() ?? this.#size);\n }\n get current() {\n this.#subscribe?.();\n return this.getSize();\n }\n get width() {\n return this.#width;\n }\n get height() {\n return this.#height;\n }\n}\n", "import { untrack } from \"svelte\";\n/**\n * Returns an object with the mounted state of the component\n * that invokes this function.\n *\n * @see {@link https://runed.dev/docs/utilities/is-mounted}\n */\nexport class IsMounted {\n #isMounted = $state(false);\n constructor() {\n $effect(() => {\n untrack(() => (this.#isMounted = true));\n return () => {\n this.#isMounted = false;\n };\n });\n }\n get current() {\n return this.#isMounted;\n }\n}\n", "/**\n * Holds the previous value of a getter.\n *\n * @see {@link https://runed.dev/docs/utilities/previous}\n */\nexport class Previous {\n #previousCallback = () => undefined;\n #previous = $derived.by(() => this.#previousCallback());\n constructor(getter, initialValue) {\n let actualPrevious = undefined;\n if (initialValue !== undefined)\n actualPrevious = initialValue;\n this.#previousCallback = () => {\n try {\n return actualPrevious;\n }\n finally {\n actualPrevious = getter();\n }\n };\n }\n get current() {\n return this.#previous;\n }\n}\n", "import { watch } from \"../watch/index.js\";\n// Helper functions for debounce and throttle\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction debounce(fn, delay) {\n let timeoutId;\n let lastResolve = null;\n return (...args) => {\n return new Promise((resolve) => {\n if (lastResolve) {\n lastResolve(undefined);\n }\n lastResolve = resolve;\n clearTimeout(timeoutId);\n timeoutId = setTimeout(async () => {\n const result = await fn(...args);\n if (lastResolve) {\n lastResolve(result);\n lastResolve = null;\n }\n }, delay);\n });\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction throttle(fn, delay) {\n let lastRun = 0;\n let lastPromise = null;\n return (...args) => {\n const now = Date.now();\n if (lastRun && now - lastRun < delay) {\n return lastPromise ?? Promise.resolve(undefined);\n }\n lastRun = now;\n lastPromise = fn(...args);\n return lastPromise;\n };\n}\nfunction runResource(source, fetcher, options = {}, effectFn) {\n const { lazy = false, once = false, initialValue, debounce: debounceTime, throttle: throttleTime, } = options;\n // Create state\n let current = $state(initialValue);\n let loading = $state(false);\n let error = $state(undefined);\n let cleanupFns = $state([]);\n // Helper function to run cleanup functions\n const runCleanup = () => {\n cleanupFns.forEach((fn) => fn());\n cleanupFns = [];\n };\n // Helper function to register cleanup\n const onCleanup = (fn) => {\n cleanupFns = [...cleanupFns, fn];\n };\n // Create the base fetcher function\n const baseFetcher = async (value, previousValue, refetching = false) => {\n try {\n loading = true;\n error = undefined;\n runCleanup();\n // Create new AbortController for this fetch\n const controller = new AbortController();\n onCleanup(() => controller.abort());\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = await fetcher(value, previousValue, {\n data: current,\n refetching,\n onCleanup,\n signal: controller.signal,\n });\n current = result;\n return result;\n }\n catch (e) {\n if (!(e instanceof DOMException && e.name === \"AbortError\")) {\n error = e;\n }\n return undefined;\n }\n finally {\n loading = false;\n }\n };\n // Apply debounce or throttle if specified\n const runFetcher = debounceTime\n ? debounce(baseFetcher, debounceTime)\n : throttleTime\n ? throttle(baseFetcher, throttleTime)\n : baseFetcher;\n // Setup effect\n const sources = Array.isArray(source) ? source : [source];\n let prevValues;\n effectFn((values, previousValues) => {\n // Skip if once and already ran\n if (once && prevValues) {\n return;\n }\n prevValues = values;\n runFetcher(Array.isArray(source) ? values : values[0], Array.isArray(source) ? previousValues : previousValues?.[0]);\n }, { lazy });\n return {\n get current() {\n return current;\n },\n get loading() {\n return loading;\n },\n get error() {\n return error;\n },\n mutate: (value) => {\n current = value;\n },\n refetch: (info) => {\n const values = sources.map((s) => s());\n return runFetcher(Array.isArray(source) ? values : values[0], Array.isArray(source) ? values : values[0], info ?? true);\n },\n };\n}\n// Implementation\nexport function resource(source, fetcher, options) {\n return runResource(source, fetcher, options, (fn, options) => {\n const sources = Array.isArray(source) ? source : [source];\n const getters = () => sources.map((s) => s());\n watch(getters, (values, previousValues) => {\n fn(values, previousValues ?? []);\n }, options);\n });\n}\n// Implementation\nexport function resourcePre(source, fetcher, options) {\n return runResource(source, fetcher, options, (fn, options) => {\n const sources = Array.isArray(source) ? source : [source];\n const getter = () => sources.map((s) => s());\n watch.pre(getter, (values, previousValues) => {\n fn(values, previousValues ?? []);\n }, options);\n });\n}\nresource.pre = resourcePre;\n", "export function onDestroyEffect(fn) {\n $effect(() => {\n return () => {\n fn();\n };\n });\n}\n", "import { untrack } from \"svelte\";\nexport function onMountEffect(fn) {\n $effect(() => {\n const cleanup = untrack(() => fn());\n return cleanup;\n });\n}\n", "/**\n * A utility function that executes a callback after a specified number of milliseconds.\n */\nexport function afterSleep(ms, cb) {\n return setTimeout(cb, ms);\n}\n", "import { tick } from \"svelte\";\nexport function afterTick(fn) {\n tick().then(fn);\n}\n", "import { isObject } from \"./is.js\";\nconst ELEMENT_NODE = 1;\nconst DOCUMENT_NODE = 9;\nconst DOCUMENT_FRAGMENT_NODE = 11;\nexport function isHTMLElement(node) {\n return isObject(node) && node.nodeType === ELEMENT_NODE && typeof node.nodeName === \"string\";\n}\nexport function isDocument(node) {\n return isObject(node) && node.nodeType === DOCUMENT_NODE;\n}\nexport function isWindow(node) {\n return isObject(node) && node.constructor?.name === \"VisualViewport\";\n}\nexport function getNodeName(node) {\n if (isHTMLElement(node))\n return node.localName ?? \"\";\n return \"#document\";\n}\nexport function isNode(node) {\n return isObject(node) && node.nodeType !== undefined;\n}\nexport function isShadowRoot(node) {\n return isNode(node) && node.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in node;\n}\nexport function contains(parent, child) {\n if (!parent || !child)\n return false;\n if (!isHTMLElement(parent) || !isHTMLElement(child))\n return false;\n const rootNode = child.getRootNode?.();\n if (parent === child)\n return true;\n if (parent.contains(child))\n return true;\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next)\n return true;\n // @ts-expect-error - host is not typed\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getDocument(node) {\n if (isDocument(node))\n return node;\n if (isWindow(node))\n return node.document;\n return node?.ownerDocument ?? document;\n}\nexport function getDocumentElement(node) {\n return getDocument(node).documentElement;\n}\nexport function getWindow(node) {\n if (isShadowRoot(node))\n return getWindow(node.host);\n if (isDocument(node))\n return node.defaultView ?? window;\n if (isHTMLElement(node))\n return node.ownerDocument?.defaultView ?? window;\n return window;\n}\nexport function getActiveElement(rootNode) {\n let activeElement = rootNode.activeElement;\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement;\n if (el === activeElement)\n break;\n else\n activeElement = el;\n }\n return activeElement;\n}\nexport function getParentNode(node) {\n if (getNodeName(node) === \"html\")\n return node;\n const result = \n // @ts-expect-error - assignedSlot is not typed\n node.assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n", "import { boxWith } from \"../box/box-extras.svelte.js\";\nimport { getActiveElement, getDocument } from \"./dom.js\";\nexport class DOMContext {\n element;\n root = $derived.by(() => {\n if (!this.element.current)\n return document;\n const rootNode = this.element.current.getRootNode() ?? document;\n return rootNode;\n });\n constructor(element) {\n if (typeof element === \"function\") {\n this.element = boxWith(element);\n }\n else {\n this.element = element;\n }\n }\n getDocument = () => {\n return getDocument(this.root);\n };\n getWindow = () => {\n return this.getDocument().defaultView ?? window;\n };\n getActiveElement = () => {\n return getActiveElement(this.root);\n };\n isActiveElement = (node) => {\n return node === this.getActiveElement();\n };\n getElementById(id) {\n return this.root.getElementById(id);\n }\n querySelector = (selector) => {\n if (!this.root)\n return null;\n return this.root.querySelector(selector);\n };\n querySelectorAll = (selector) => {\n if (!this.root)\n return [];\n return this.root.querySelectorAll(selector);\n };\n setTimeout = (callback, delay) => {\n return this.getWindow().setTimeout(callback, delay);\n };\n clearTimeout = (timeoutId) => {\n return this.getWindow().clearTimeout(timeoutId);\n };\n}\n", "import { untrack } from \"svelte\";\nimport { isBox } from \"../box/box-extras.svelte.js\";\nimport { createAttachmentKey } from \"svelte/attachments\";\n/**\n * Creates a Svelte Attachment that attaches a DOM element to a ref.\n * The ref can be either a WritableBox or a callback function.\n *\n * @param ref - Either a WritableBox to store the element in, or a callback function that receives the element\n * @param onChange - Optional callback that fires when the ref changes\n * @returns An object with a spreadable attachment key that should be spread onto the element\n *\n * @example\n * // Using with WritableBox\n * const ref = box(null);\n *
Content
\n *\n * @example\n * // Using with callback\n *
myNode = node)}>Content
\n *\n * @example\n * // Using with onChange\n *
console.log(node))}>Content
\n */\nexport function attachRef(ref, onChange) {\n return {\n [createAttachmentKey()]: (node) => {\n if (isBox(ref)) {\n ref.current = node;\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref.current = null;\n onChange?.(null);\n };\n }\n ref(node);\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref(null);\n onChange?.(null);\n };\n }\n };\n}\n", "export function boolToStr(condition) {\n return condition ? \"true\" : \"false\";\n}\nexport function boolToStrTrueOrUndef(condition) {\n return condition ? \"true\" : undefined;\n}\nexport function boolToEmptyStrOrUndef(condition) {\n return condition ? \"\" : undefined;\n}\nexport function boolToTrueOrUndef(condition) {\n return condition ? true : undefined;\n}\nexport function getDataOpenClosed(condition) {\n return condition ? \"open\" : \"closed\";\n}\nexport function getDataChecked(condition) {\n return condition ? \"checked\" : \"unchecked\";\n}\nexport function getAriaChecked(checked, indeterminate) {\n if (indeterminate) {\n return \"mixed\";\n }\n return checked ? \"true\" : \"false\";\n}\nexport class BitsAttrs {\n #variant;\n #prefix;\n attrs;\n constructor(config) {\n this.#variant = config.getVariant ? config.getVariant() : null;\n this.#prefix = this.#variant ? `data-${this.#variant}-` : `data-${config.component}-`;\n this.getAttr = this.getAttr.bind(this);\n this.selector = this.selector.bind(this);\n this.attrs = Object.fromEntries(config.parts.map((part) => [part, this.getAttr(part)]));\n }\n getAttr(part, variantOverride) {\n if (variantOverride)\n return `data-${variantOverride}-${part}`;\n return `${this.#prefix}${part}`;\n }\n selector(part, variantOverride) {\n return `[${this.getAttr(part, variantOverride)}]`;\n }\n}\nexport function createBitsAttrs(config) {\n const bitsAttrs = new BitsAttrs(config);\n return {\n ...bitsAttrs.attrs,\n selector: bitsAttrs.selector,\n getAttr: bitsAttrs.getAttr,\n };\n}\n", "export const ALT = \"Alt\";\nexport const ARROW_DOWN = \"ArrowDown\";\nexport const ARROW_LEFT = \"ArrowLeft\";\nexport const ARROW_RIGHT = \"ArrowRight\";\nexport const ARROW_UP = \"ArrowUp\";\nexport const BACKSPACE = \"Backspace\";\nexport const CAPS_LOCK = \"CapsLock\";\nexport const CONTROL = \"Control\";\nexport const DELETE = \"Delete\";\nexport const END = \"End\";\nexport const ENTER = \"Enter\";\nexport const ESCAPE = \"Escape\";\nexport const F1 = \"F1\";\nexport const F10 = \"F10\";\nexport const F11 = \"F11\";\nexport const F12 = \"F12\";\nexport const F2 = \"F2\";\nexport const F3 = \"F3\";\nexport const F4 = \"F4\";\nexport const F5 = \"F5\";\nexport const F6 = \"F6\";\nexport const F7 = \"F7\";\nexport const F8 = \"F8\";\nexport const F9 = \"F9\";\nexport const HOME = \"Home\";\nexport const META = \"Meta\";\nexport const PAGE_DOWN = \"PageDown\";\nexport const PAGE_UP = \"PageUp\";\nexport const SHIFT = \"Shift\";\nexport const SPACE = \" \";\nexport const TAB = \"Tab\";\nexport const CTRL = \"Control\";\nexport const ASTERISK = \"*\";\nexport const a = \"a\";\nexport const P = \"P\";\nexport const A = \"A\";\nexport const p = \"p\";\nexport const n = \"n\";\nexport const j = \"j\";\nexport const k = \"k\";\nexport const h = \"h\";\nexport const l = \"l\";\n", "/**\n * Detects the text direction in the element.\n * @returns {Direction} The text direction ('ltr' for left-to-right or 'rtl' for right-to-left).\n */\nexport function getElemDirection(elem) {\n const style = window.getComputedStyle(elem);\n const direction = style.getPropertyValue(\"direction\");\n return direction;\n}\n", "import { kbd } from \"./kbd.js\";\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SELECTION_KEYS = [kbd.SPACE, kbd.ENTER];\n/**\n * A utility function that returns the next key based on the direction and orientation.\n */\nexport function getNextKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_LEFT : kbd.ARROW_RIGHT,\n vertical: kbd.ARROW_DOWN,\n }[orientation];\n}\n/**\n * A utility function that returns the previous key based on the direction and orientation.\n */\nexport function getPrevKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_RIGHT : kbd.ARROW_LEFT,\n vertical: kbd.ARROW_UP,\n }[orientation];\n}\n/**\n * A utility function that returns the next and previous keys based on the direction\n * and orientation.\n */\nexport function getDirectionalKeys(dir = \"ltr\", orientation = \"horizontal\") {\n if (![\"ltr\", \"rtl\"].includes(dir))\n dir = \"ltr\";\n if (![\"horizontal\", \"vertical\"].includes(orientation))\n orientation = \"horizontal\";\n return {\n nextKey: getNextKey(dir, orientation),\n prevKey: getPrevKey(dir, orientation),\n };\n}\n", "export const isBrowser = typeof document !== \"undefined\";\nexport const isIOS = getIsIOS();\nfunction getIsIOS() {\n return (isBrowser &&\n window?.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.\n (window?.navigator?.maxTouchPoints > 2 &&\n /iPad|Macintosh/.test(window?.navigator.userAgent))));\n}\nexport function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isHTMLElement(element) {\n return element instanceof HTMLElement;\n}\nexport function isElement(element) {\n return element instanceof Element;\n}\nexport function isElementOrSVGElement(element) {\n return element instanceof Element || element instanceof SVGElement;\n}\nexport function isNumberString(value) {\n return !Number.isNaN(Number(value)) && !Number.isNaN(Number.parseFloat(value));\n}\nexport function isNull(value) {\n return value === null;\n}\nexport function isTouch(e) {\n return e.pointerType === \"touch\";\n}\nexport function isFocusVisible(element) {\n return element.matches(\":focus-visible\");\n}\nexport function isNotNull(value) {\n return value !== null;\n}\n/**\n * Determines if the provided object is a valid `HTMLInputElement` with\n * a `select` method available.\n */\nexport function isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n/**\n * Given a node, determine if it is hidden by walking up the\n * DOM tree until we hit the `stopAt` node (exclusive), if provided)\n * otherwise we stop at the document root.\n */\nexport function isElementHidden(node, stopAt) {\n if (getComputedStyle(node).visibility === \"hidden\")\n return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (stopAt !== undefined && node === stopAt)\n return false;\n if (getComputedStyle(node).display === \"none\")\n return true;\n node = node.parentElement;\n }\n return false;\n}\n", "import { box } from \"svelte-toolbelt\";\nimport { getElemDirection } from \"./locale.js\";\nimport { getDirectionalKeys } from \"./get-directional-keys.js\";\nimport { kbd } from \"./kbd.js\";\nimport { BROWSER } from \"esm-env\";\nimport { isHTMLElement } from \"./is.js\";\nexport class RovingFocusGroup {\n #opts;\n #currentTabStopId = box(null);\n constructor(opts) {\n this.#opts = opts;\n }\n getCandidateNodes() {\n if (!BROWSER || !this.#opts.rootNode.current)\n return [];\n if (this.#opts.candidateSelector) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(this.#opts.candidateSelector));\n return candidates;\n }\n else if (this.#opts.candidateAttr) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(`[${this.#opts.candidateAttr}]:not([data-disabled])`));\n return candidates;\n }\n return [];\n }\n focusFirstCandidate() {\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n items[0]?.focus();\n }\n handleKeydown(node, e, both = false) {\n const rootNode = this.#opts.rootNode.current;\n if (!rootNode || !node)\n return;\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n const currentIndex = items.indexOf(node);\n const dir = getElemDirection(rootNode);\n const { nextKey, prevKey } = getDirectionalKeys(dir, this.#opts.orientation.current);\n const loop = this.#opts.loop.current;\n const keyToIndex = {\n [nextKey]: currentIndex + 1,\n [prevKey]: currentIndex - 1,\n [kbd.HOME]: 0,\n [kbd.END]: items.length - 1,\n };\n if (both) {\n const altNextKey = nextKey === kbd.ARROW_DOWN ? kbd.ARROW_RIGHT : kbd.ARROW_DOWN;\n const altPrevKey = prevKey === kbd.ARROW_UP ? kbd.ARROW_LEFT : kbd.ARROW_UP;\n keyToIndex[altNextKey] = currentIndex + 1;\n keyToIndex[altPrevKey] = currentIndex - 1;\n }\n let itemIndex = keyToIndex[e.key];\n if (itemIndex === undefined)\n return;\n e.preventDefault();\n if (itemIndex < 0 && loop) {\n itemIndex = items.length - 1;\n }\n else if (itemIndex === items.length && loop) {\n itemIndex = 0;\n }\n const itemToFocus = items[itemIndex];\n if (!itemToFocus)\n return;\n itemToFocus.focus();\n this.#currentTabStopId.current = itemToFocus.id;\n this.#opts.onCandidateFocus?.(itemToFocus);\n return itemToFocus;\n }\n getTabIndex(node) {\n const items = this.getCandidateNodes();\n const anyActive = this.#currentTabStopId.current !== null;\n if (node && !anyActive && items[0] === node) {\n this.#currentTabStopId.current = node.id;\n return 0;\n }\n else if (node?.id === this.#currentTabStopId.current) {\n return 0;\n }\n return -1;\n }\n setCurrentTabStopId(id) {\n this.#currentTabStopId.current = id;\n }\n focusCurrentTabStop() {\n const currentTabStopId = this.#currentTabStopId.current;\n if (!currentTabStopId)\n return;\n const currentTabStop = this.#opts.rootNode.current?.querySelector(`#${currentTabStopId}`);\n if (!currentTabStop || !isHTMLElement(currentTabStop))\n return;\n currentTabStop.focus();\n }\n}\n", "import { afterTick, onDestroyEffect } from \"svelte-toolbelt\";\nexport class AnimationsComplete {\n #opts;\n #currentFrame = null;\n constructor(opts) {\n this.#opts = opts;\n onDestroyEffect(() => this.#cleanup());\n }\n #cleanup() {\n if (!this.#currentFrame)\n return;\n window.cancelAnimationFrame(this.#currentFrame);\n this.#currentFrame = null;\n }\n run(fn) {\n // if already running, cleanup and restart\n this.#cleanup();\n const node = this.#opts.ref.current;\n if (!node)\n return;\n if (typeof node.getAnimations !== \"function\") {\n this.#executeCallback(fn);\n return;\n }\n this.#currentFrame = window.requestAnimationFrame(() => {\n const animations = node.getAnimations();\n if (animations.length === 0) {\n this.#executeCallback(fn);\n return;\n }\n Promise.allSettled(animations.map((animation) => animation.finished)).then(() => {\n this.#executeCallback(fn);\n });\n });\n }\n #executeCallback(fn) {\n const execute = () => {\n fn();\n };\n if (this.#opts.afterTick) {\n afterTick(execute);\n }\n else {\n execute();\n }\n }\n}\n", "import { watch } from \"runed\";\nimport { AnimationsComplete } from \"./animations-complete.js\";\nexport class PresenceManager {\n #opts;\n #enabled;\n #afterAnimations;\n #shouldRender = $state(false);\n constructor(opts) {\n this.#opts = opts;\n this.#shouldRender = opts.open.current;\n this.#enabled = opts.enabled ?? true;\n this.#afterAnimations = new AnimationsComplete({\n ref: this.#opts.ref,\n afterTick: this.#opts.open,\n });\n watch(() => this.#opts.open.current, (isOpen) => {\n if (isOpen)\n this.#shouldRender = true;\n if (!this.#enabled)\n return;\n this.#afterAnimations.run(() => {\n if (isOpen === this.#opts.open.current) {\n if (!this.#opts.open.current) {\n this.#shouldRender = false;\n }\n this.#opts.onComplete?.();\n }\n });\n });\n }\n get shouldRender() {\n return this.#shouldRender;\n }\n}\n", "import { afterTick, attachRef, boxWith, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { createBitsAttrs } from \"../../internal/attrs.js\";\nimport { RovingFocusGroup } from \"../../internal/roving-focus-group.js\";\nimport { on } from \"svelte/events\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nconst accordionAttrs = createBitsAttrs({\n component: \"accordion\",\n parts: [\"root\", \"trigger\", \"content\", \"item\", \"header\"],\n});\nconst AccordionRootContext = new Context(\"Accordion.Root\");\nconst AccordionItemContext = new Context(\"Accordion.Item\");\nclass AccordionBaseState {\n opts;\n rovingFocusGroup;\n attachment;\n constructor(opts) {\n this.opts = opts;\n this.rovingFocusGroup = new RovingFocusGroup({\n rootNode: this.opts.ref,\n candidateAttr: accordionAttrs.trigger,\n loop: this.opts.loop,\n orientation: this.opts.orientation,\n });\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-orientation\": this.opts.orientation.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n [accordionAttrs.root]: \"\",\n ...this.attachment,\n }));\n}\nclass AccordionSingleState extends AccordionBaseState {\n opts;\n isMulti = false;\n constructor(opts) {\n super(opts);\n this.opts = opts;\n this.includesItem = this.includesItem.bind(this);\n this.toggleItem = this.toggleItem.bind(this);\n }\n includesItem(item) {\n return this.opts.value.current === item;\n }\n toggleItem(item) {\n this.opts.value.current = this.includesItem(item) ? \"\" : item;\n }\n}\nclass AccordionMultiState extends AccordionBaseState {\n #value;\n isMulti = true;\n constructor(props) {\n super(props);\n this.#value = props.value;\n this.includesItem = this.includesItem.bind(this);\n this.toggleItem = this.toggleItem.bind(this);\n }\n includesItem(item) {\n return this.#value.current.includes(item);\n }\n toggleItem(item) {\n this.#value.current = this.includesItem(item)\n ? this.#value.current.filter((v) => v !== item)\n : [...this.#value.current, item];\n }\n}\nexport class AccordionRootState {\n static create(props) {\n const { type, ...rest } = props;\n const rootState = type === \"single\"\n ? new AccordionSingleState(rest)\n : new AccordionMultiState(rest);\n return AccordionRootContext.set(rootState);\n }\n}\nexport class AccordionItemState {\n static create(props) {\n return AccordionItemContext.set(new AccordionItemState({ ...props, rootState: AccordionRootContext.get() }));\n }\n opts;\n root;\n isActive = $derived.by(() => this.root.includesItem(this.opts.value.current));\n isDisabled = $derived.by(() => this.opts.disabled.current || this.root.opts.disabled.current);\n attachment;\n contentNode = $state(null);\n contentPresence;\n constructor(opts) {\n this.opts = opts;\n this.root = opts.rootState;\n this.updateValue = this.updateValue.bind(this);\n this.attachment = attachRef(this.opts.ref);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: boxWith(() => this.isActive),\n });\n }\n updateValue() {\n this.root.toggleItem(this.opts.value.current);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-state\": getDataOpenClosed(this.isActive),\n \"data-disabled\": boolToEmptyStrOrUndef(this.isDisabled),\n \"data-orientation\": this.root.opts.orientation.current,\n [accordionAttrs.item]: \"\",\n ...this.attachment,\n }));\n}\nexport class AccordionTriggerState {\n opts;\n itemState;\n #root;\n #isDisabled = $derived.by(() => this.opts.disabled.current ||\n this.itemState.opts.disabled.current ||\n this.#root.opts.disabled.current);\n attachment;\n constructor(opts, itemState) {\n this.opts = opts;\n this.itemState = itemState;\n this.#root = itemState.root;\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n this.attachment = attachRef(this.opts.ref);\n }\n static create(props) {\n return new AccordionTriggerState(props, AccordionItemContext.get());\n }\n onclick(e) {\n if (this.#isDisabled || e.button !== 0) {\n e.preventDefault();\n return;\n }\n this.itemState.updateValue();\n }\n onkeydown(e) {\n if (this.#isDisabled)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.itemState.updateValue();\n return;\n }\n this.#root.rovingFocusGroup.handleKeydown(this.opts.ref.current, e);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n disabled: this.#isDisabled,\n \"aria-expanded\": boolToStr(this.itemState.isActive),\n \"aria-disabled\": boolToStr(this.#isDisabled),\n \"data-disabled\": boolToEmptyStrOrUndef(this.#isDisabled),\n \"data-state\": getDataOpenClosed(this.itemState.isActive),\n \"data-orientation\": this.#root.opts.orientation.current,\n [accordionAttrs.trigger]: \"\",\n tabindex: 0,\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\nexport class AccordionContentState {\n opts;\n item;\n attachment;\n #originalStyles = undefined;\n #isMountAnimationPrevented = false;\n #dimensions = $state({ width: 0, height: 0 });\n open = $derived.by(() => {\n if (this.opts.hiddenUntilFound.current)\n return this.item.isActive;\n return this.opts.forceMount.current || this.item.isActive;\n });\n constructor(opts, item) {\n this.opts = opts;\n this.item = item;\n this.#isMountAnimationPrevented = this.item.isActive;\n this.attachment = attachRef(this.opts.ref, (v) => (this.item.contentNode = v));\n // Prevent mount animations on initial render\n $effect(() => {\n const rAF = requestAnimationFrame(() => {\n this.#isMountAnimationPrevented = false;\n });\n return () => cancelAnimationFrame(rAF);\n });\n watch.pre([() => this.opts.ref.current, () => this.opts.hiddenUntilFound.current], ([node, hiddenUntilFound]) => {\n if (!node || !hiddenUntilFound)\n return;\n const handleBeforeMatch = () => {\n if (this.item.isActive)\n return;\n // we need to defer opening until after browser completes search highlighting\n // otherwise the browser will immediately open the accordion\n // and the search highlighting will not be visible\n requestAnimationFrame(() => {\n this.item.updateValue();\n });\n };\n return on(node, \"beforematch\", handleBeforeMatch);\n });\n // Handle dimension updates\n watch([() => this.open, () => this.opts.ref.current], this.#updateDimensions);\n }\n static create(props) {\n return new AccordionContentState(props, AccordionItemContext.get());\n }\n #updateDimensions = ([_, node]) => {\n if (!node)\n return;\n afterTick(() => {\n const element = this.opts.ref.current;\n if (!element)\n return;\n // store original styles on first run\n this.#originalStyles ??= {\n transitionDuration: element.style.transitionDuration,\n animationName: element.style.animationName,\n };\n // temporarily disable animations for measurement\n element.style.transitionDuration = \"0s\";\n element.style.animationName = \"none\";\n const rect = element.getBoundingClientRect();\n this.#dimensions = { width: rect.width, height: rect.height };\n // restore animations if not initial mount\n if (!this.#isMountAnimationPrevented && this.#originalStyles) {\n element.style.transitionDuration = this.#originalStyles.transitionDuration;\n element.style.animationName = this.#originalStyles.animationName;\n }\n });\n };\n get shouldRender() {\n return this.item.contentPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({ open: this.item.isActive }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-state\": getDataOpenClosed(this.item.isActive),\n \"data-disabled\": boolToEmptyStrOrUndef(this.item.isDisabled),\n \"data-orientation\": this.item.root.opts.orientation.current,\n [accordionAttrs.content]: \"\",\n style: {\n \"--bits-accordion-content-height\": `${this.#dimensions.height}px`,\n \"--bits-accordion-content-width\": `${this.#dimensions.width}px`,\n },\n hidden: this.opts.hiddenUntilFound.current && !this.item.isActive\n ? \"until-found\"\n : undefined,\n ...(this.opts.hiddenUntilFound.current && !this.shouldRender\n ? {}\n : {\n hidden: this.opts.hiddenUntilFound.current\n ? !this.shouldRender\n : this.opts.forceMount.current\n ? undefined\n : !this.shouldRender,\n }),\n ...this.attachment,\n }));\n}\nexport class AccordionHeaderState {\n opts;\n item;\n attachment;\n constructor(opts, item) {\n this.opts = opts;\n this.item = item;\n this.attachment = attachRef(this.opts.ref);\n }\n static create(props) {\n return new AccordionHeaderState(props, AccordionItemContext.get());\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"heading\",\n \"aria-level\": this.opts.level.current,\n \"data-heading-level\": this.opts.level.current,\n \"data-state\": getDataOpenClosed(this.item.isActive),\n \"data-orientation\": this.item.root.opts.orientation.current,\n [accordionAttrs.header]: \"\",\n ...this.attachment,\n }));\n}\n", "/**\n * A no operation function (does nothing)\n */\nexport function noop() { }\n", "export function createId(prefixOrUid, uid) {\n if (uid === undefined)\n return `bits-${prefixOrUid}`;\n return `bits-${prefixOrUid}-${uid}`;\n}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t
\n\t\t{@render children?.()}\n\t
\n{/if}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t
\n\t\t{@render children?.()}\n\t
\n{/if}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t
\n\t\t{@render children?.()}\n\t
\n{/if}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t\n{/if}\n", "\n\n{#if child}\n\t{@render child({\n\t\tprops: mergedProps,\n\t\t...contentState.snippetProps,\n\t})}\n{:else}\n\t
\n\t\t{@render children?.()}\n\t
\n{/if}\n", "export { default as Root } from \"./components/alert-dialog.svelte\";\nexport { default as Title } from \"../dialog/components/dialog-title.svelte\";\nexport { default as Action } from \"./components/alert-dialog-action.svelte\";\nexport { default as Cancel } from \"./components/alert-dialog-cancel.svelte\";\nexport { default as Portal } from \"../utilities/portal/portal.svelte\";\nexport { default as Content } from \"./components/alert-dialog-content.svelte\";\nexport { default as Overlay } from \"../dialog/components/dialog-overlay.svelte\";\nexport { default as Trigger } from \"../dialog/components/dialog-trigger.svelte\";\nexport { default as Description } from \"../dialog/components/dialog-description.svelte\";\n", "import { attachRef, boxWith, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { createBitsAttrs, boolToStr, getDataOpenClosed, boolToEmptyStrOrUndef, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nconst dialogAttrs = createBitsAttrs({\n component: \"dialog\",\n parts: [\"content\", \"trigger\", \"overlay\", \"title\", \"description\", \"close\", \"cancel\", \"action\"],\n});\nconst DialogRootContext = new Context(\"Dialog.Root | AlertDialog.Root\");\nexport class DialogRootState {\n static create(opts) {\n const parent = DialogRootContext.getOr(null);\n return DialogRootContext.set(new DialogRootState(opts, parent));\n }\n opts;\n triggerNode = $state(null);\n contentNode = $state(null);\n overlayNode = $state(null);\n descriptionNode = $state(null);\n contentId = $state(undefined);\n titleId = $state(undefined);\n triggerId = $state(undefined);\n descriptionId = $state(undefined);\n cancelNode = $state(null);\n nestedOpenCount = $state(0);\n depth;\n parent;\n contentPresence;\n overlayPresence;\n constructor(opts, parent) {\n this.opts = opts;\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.handleOpen = this.handleOpen.bind(this);\n this.handleClose = this.handleClose.bind(this);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n enabled: true,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n this.overlayPresence = new PresenceManager({\n ref: boxWith(() => this.overlayNode),\n open: this.opts.open,\n enabled: true,\n });\n watch(() => this.opts.open.current, (isOpen) => {\n if (!this.parent)\n return;\n if (isOpen) {\n this.parent.incrementNested();\n }\n else {\n this.parent.decrementNested();\n }\n }, { lazy: true });\n onDestroyEffect(() => {\n if (this.opts.open.current) {\n this.parent?.decrementNested();\n }\n });\n }\n handleOpen() {\n if (this.opts.open.current)\n return;\n this.opts.open.current = true;\n }\n handleClose() {\n if (!this.opts.open.current)\n return;\n this.opts.open.current = false;\n }\n getBitsAttr = (part) => {\n return dialogAttrs.getAttr(part, this.opts.variant.current);\n };\n incrementNested() {\n this.nestedOpenCount++;\n this.parent?.incrementNested();\n }\n decrementNested() {\n if (this.nestedOpenCount === 0)\n return;\n this.nestedOpenCount--;\n this.parent?.decrementNested();\n }\n sharedProps = $derived.by(() => ({\n \"data-state\": getDataOpenClosed(this.opts.open.current),\n }));\n}\nexport class DialogTriggerState {\n static create(opts) {\n return new DialogTriggerState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.triggerNode = v;\n this.root.triggerId = v?.id;\n });\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleOpen();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleOpen();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"aria-controls\": this.root.contentId,\n [this.root.getBitsAttr(\"trigger\")]: \"\",\n onkeydown: this.onkeydown,\n onclick: this.onclick,\n disabled: this.opts.disabled.current ? true : undefined,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogCloseState {\n static create(opts) {\n return new DialogCloseState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(this.opts.variant.current)]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n disabled: this.opts.disabled.current ? true : undefined,\n tabindex: 0,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogActionState {\n static create(opts) {\n return new DialogActionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"action\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogTitleState {\n static create(opts) {\n return new DialogTitleState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.titleId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref);\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.titleId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"heading\",\n \"aria-level\": this.opts.level.current,\n [this.root.getBitsAttr(\"title\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogDescriptionState {\n static create(opts) {\n return new DialogDescriptionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.descriptionId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.descriptionNode = v;\n });\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.descriptionId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"description\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogContentState {\n static create(opts) {\n return new DialogContentState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.contentNode = v;\n this.root.contentId = v?.id;\n });\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: this.root.opts.variant.current === \"alert-dialog\" ? \"alertdialog\" : \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-describedby\": this.root.descriptionId,\n \"aria-labelledby\": this.root.titleId,\n [this.root.getBitsAttr(\"content\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n outline: this.root.opts.variant.current === \"alert-dialog\" ? \"none\" : undefined,\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n },\n tabindex: this.root.opts.variant.current === \"alert-dialog\" ? -1 : undefined,\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n}\nexport class DialogOverlayState {\n static create(opts) {\n return new DialogOverlayState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.overlayNode = v));\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"overlay\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n },\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.overlayPresence.shouldRender;\n }\n}\nexport class AlertDialogCancelState {\n static create(opts) {\n return new AlertDialogCancelState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.cancelNode = v));\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"cancel\")]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n tabindex: 0,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\n", "\n\n{@render children?.()}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t
\n\t\t{@render children?.()}\n\t
\n{/if}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t\n{/if}\n", "\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t\n{/if}\n", "\n\n{#key children}\n\t{@render children?.()}\n{/key}\n", "import { Context } from \"runed\";\nimport { boxWith } from \"svelte-toolbelt\";\nexport const BitsConfigContext = new Context(\"BitsConfig\");\n/**\n * Gets the current Bits UI configuration state from the context.\n *\n * Returns a default configuration (where all values are `undefined`) if no configuration is found.\n */\nexport function getBitsConfig() {\n const fallback = new BitsConfigState(null, {});\n return BitsConfigContext.getOr(fallback).opts;\n}\n/**\n * Creates and sets a new Bits UI configuration state that inherits from parent configs.\n *\n * @param opts - Configuration options for this level\n * @returns The configuration state instance\n *\n * @example\n * ```typescript\n * // In a component that wants to set a default portal target\n * const config = useBitsConfig({ defaultPortalTo: box(\"#some-element\") });\n *\n * // Child components will inherit this config and can override specific values\n * const childConfig = useBitsConfig({ someOtherProp: box(\"value\") });\n * // childConfig still has defaultPortalTo=\"#some-element\" from parent\n * ```\n */\nexport function useBitsConfig(opts) {\n return BitsConfigContext.set(new BitsConfigState(BitsConfigContext.getOr(null), opts));\n}\n/**\n * Configuration state that inherits from parent configurations.\n *\n * @example\n * Config resolution:\n * ```\n * Level 1: { defaultPortalTo: \"#some-element\", theme: \"dark\" }\n * Level 2: { spacing: \"large\" } // inherits defaultPortalTo=\"#some-element\", theme=\"dark\"\n * Level 3: { theme: \"light\" } // inherits defaultPortalTo=\"#some-element\", spacing=\"large\", overrides theme=\"light\"\n * ```\n */\nexport class BitsConfigState {\n opts;\n constructor(parent, opts) {\n const resolveConfigOption = createConfigResolver(parent, opts);\n this.opts = {\n defaultPortalTo: resolveConfigOption((config) => config.defaultPortalTo),\n defaultLocale: resolveConfigOption((config) => config.defaultLocale),\n };\n }\n}\n/**\n * Returns a config resolver that resolves a given config option's value.\n *\n * The resolver creates reactive boxes that resolve config option values using this priority:\n * 1. Current level's value (if defined)\n * 2. Parent level's value (if defined and current is undefined)\n * 3. `undefined` (if no value is found in either parent or child)\n *\n * @param parent - Parent configuration state (null if this is root level)\n * @param currentOpts - Current level's configuration options\n *\n * @example\n * ```typescript\n * // Given this hierarchy:\n * // Root: { defaultPortalTo: \"#some-element\" }\n * // Child: { someOtherProp: \"value\" } // no defaultPortalTo specified\n *\n * const resolveConfigOption = createConfigResolver(parent, opts);\n * const portalTo = resolveConfigOption(config => config.defaultPortalTo);\n *\n * // portalTo.current === \"#some-element\" (inherited from parent)\n * // even when child didn't specify `defaultPortalTo`\n * ```\n */\nfunction createConfigResolver(parent, currentOpts) {\n return (getter) => {\n const configOption = boxWith(() => {\n // try current opts first\n const value = getter(currentOpts)?.current;\n if (value !== undefined)\n return value;\n // if no parent, return undefined\n if (parent === null)\n return undefined;\n // get value from parent (which already has its own chain resolved)\n return getter(parent.opts)?.current;\n });\n return configOption;\n };\n}\n", "import { boxWith } from \"svelte-toolbelt\";\nimport { getBitsConfig } from \"./bits-config.js\";\n/**\n * Creates a generic prop resolver that follows a standard priority chain:\n * 1. The getter's prop value (if defined)\n * 2. The config default value (if no getter prop value is defined)\n * 3. The fallback value (if no config value found)\n */\nfunction createPropResolver(configOption, fallback) {\n return (getProp) => {\n const config = getBitsConfig();\n return boxWith(() => {\n // 1. return the prop's value, if provided\n const propValue = getProp();\n if (propValue !== undefined)\n return propValue;\n // 2. return the resolved config option value, if available\n const option = configOption(config).current;\n if (option !== undefined)\n return option;\n // 3. return the fallback if no other value is found\n return fallback;\n });\n };\n}\n/**\n * Resolves a locale value using the prop, the config default, or a fallback.\n *\n * Default value: `\"en\"`\n */\nexport const resolveLocaleProp = createPropResolver((config) => config.defaultLocale, \"en\");\n/**\n * Resolves a portal's `to` value using the prop, the config default, or a fallback.\n *\n * Default value: `\"body\"`\n */\nexport const resolvePortalToProp = createPropResolver((config) => config.defaultPortalTo, \"body\");\n", "\n\n{#if disabled}\n\t{@render children?.()}\n{/if}\n", "import { on } from \"svelte/events\";\n/**\n * Creates a typed event dispatcher and listener pair for custom events\n * @template T - The type of data that will be passed in the event detail\n * @param eventName - The name of the custom event\n * @param options - CustomEvent options (bubbles, cancelable, etc.)\n */\nexport class CustomEventDispatcher {\n eventName;\n options;\n constructor(eventName, options = { bubbles: true, cancelable: true }) {\n this.eventName = eventName;\n this.options = options;\n }\n createEvent(detail) {\n return new CustomEvent(this.eventName, {\n ...this.options,\n detail,\n });\n }\n dispatch(element, detail) {\n const event = this.createEvent(detail);\n element.dispatchEvent(event);\n return event;\n }\n listen(element, callback, options) {\n const handler = (event) => {\n callback(event);\n };\n return on(element, this.eventName, handler, options);\n }\n}\n", "// oxlint-disable-next-line no-explicit-any\nexport function debounce(fn, wait = 500) {\n let timeout = null;\n const debounced = (...args) => {\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n fn(...args);\n }, wait);\n };\n debounced.destroy = () => {\n if (timeout !== null) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n return debounced;\n}\n", "export function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\nexport function getOwnerDocument(el) {\n return el?.ownerDocument ?? document;\n}\n", "export function getFirstNonCommentChild(element) {\n if (!element)\n return null;\n for (const child of element.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) {\n return child;\n }\n }\n return null;\n}\n/**\n * Determines if the click event truly occurred outside the content node.\n * This was added to handle password managers and other elements that may be injected\n * into the DOM but visually appear inside the content.\n */\nexport function isClickTrulyOutside(event, contentNode) {\n const { clientX, clientY } = event;\n const rect = contentNode.getBoundingClientRect();\n return (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom);\n}\n", "import { kbd } from \"../../internal/kbd.js\";\nexport const SELECTION_KEYS = [kbd.ENTER, kbd.SPACE];\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, kbd.ARROW_RIGHT],\n rtl: [...SELECTION_KEYS, kbd.ARROW_LEFT],\n};\nexport const SUB_CLOSE_KEYS = {\n ltr: [kbd.ARROW_LEFT],\n rtl: [kbd.ARROW_RIGHT],\n};\nexport function isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nexport function getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nexport function isMouseEvent(event) {\n return event.pointerType === \"mouse\";\n}\n", "import { getDocument, getWindow } from \"svelte-toolbelt\";\nimport { isBrowser, isElementHidden, isSelectableInput } from \"./is.js\";\n/**\n * Handles `initialFocus` prop behavior for the\n * Calendar & RangeCalendar components.\n */\nexport function handleCalendarInitialFocus(calendar) {\n if (!isBrowser)\n return;\n const selectedDay = calendar.querySelector(\"[data-selected]\");\n if (selectedDay)\n return focusWithoutScroll(selectedDay);\n const today = calendar.querySelector(\"[data-today]\");\n if (today)\n return focusWithoutScroll(today);\n const firstDay = calendar.querySelector(\"[data-calendar-date]\");\n if (firstDay)\n return focusWithoutScroll(firstDay);\n}\n/**\n * A utility function that focuses an element without scrolling.\n */\nexport function focusWithoutScroll(element) {\n const doc = getDocument(element);\n const win = getWindow(element);\n const scrollPosition = {\n x: win.pageXOffset || doc.documentElement.scrollLeft,\n y: win.pageYOffset || doc.documentElement.scrollTop,\n };\n element.focus();\n win.scrollTo(scrollPosition.x, scrollPosition.y);\n}\n/**\n * A utility function that focuses an element.\n */\nexport function focus(element, { select = false } = {}) {\n if (!element || !element.focus)\n return;\n const doc = getDocument(element);\n if (doc.activeElement === element)\n return;\n const previouslyFocusedElement = doc.activeElement;\n // prevent scroll on focus\n element.focus({ preventScroll: true });\n // only elect if its not the same element, it supports selection, and we need to select it\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select) {\n element.select();\n }\n}\n/**\n * Attempts to focus the first element in a list of candidates.\n * Stops when focus is successful.\n */\nexport function focusFirst(candidates, { select = false } = {}, getActiveElement) {\n const previouslyFocusedElement = getActiveElement();\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (getActiveElement() !== previouslyFocusedElement)\n return true;\n }\n}\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nexport function findVisible(elements, container) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isElementHidden(element, container))\n return element;\n }\n}\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nexport function getTabbableCandidates(container) {\n const nodes = [];\n const doc = getDocument(container);\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n // oxlint-disable-next-line no-explicit-any\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput)\n return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode())\n nodes.push(walker.currentNode);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n/**\n * A utility function that returns the first and last elements within a container that are\n * visible and focusable.\n */\nexport function getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n", "// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\n// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes\n// the entire query to fail, resulting in no nodes found, which will break a lot\n// of things... so we have to rely on JS to identify nodes inside an inert container\nconst candidateSelectors = [\n 'input:not([inert])',\n 'select:not([inert])',\n 'textarea:not([inert])',\n 'a[href]:not([inert])',\n 'button:not([inert])',\n '[tabindex]:not(slot):not([inert])',\n 'audio[controls]:not([inert])',\n 'video[controls]:not([inert])',\n '[contenteditable]:not([contenteditable=\"false\"]):not([inert])',\n 'details>summary:first-of-type:not([inert])',\n 'details:not([inert])',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n !NoElement && Element.prototype.getRootNode\n ? (element) => element?.getRootNode?.()\n : (element) => element?.ownerDocument;\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Element} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nconst isInert = function (node, lookUp = true) {\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n const inertAtt = node?.getAttribute?.('inert');\n const inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`\n // so it likely would not support `:is([inert] *)` either...\n const result = inert || (lookUp && node && isInert(node.parentNode)); // recursive\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nconst isContentEditable = function (node) {\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n const attValue = node?.getAttribute?.('contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert, all its children are inert\n if (isInert(el)) {\n return [];\n }\n\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nconst getCandidatesIteratively = function (\n elements,\n includeContainer,\n options\n) {\n const candidates = [];\n const elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n const element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n const assigned = element.assignedElements();\n const content = assigned.length ? assigned : element.children;\n const nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // check candidate element\n const validCandidate = matches.call(element, candidateSelector);\n if (\n validCandidate &&\n options.filter(element) &&\n (includeContainer || !elements.includes(element))\n ) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n const shadowRoot =\n element.shadowRoot ||\n // check for an undisclosed shadow\n (typeof options.getShadowRoot === 'function' &&\n options.getShadowRoot(element));\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n const validShadowRoot =\n !isInert(shadowRoot, false) &&\n (!options.shadowRootFilter || options.shadowRootFilter(element));\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n const nestedCandidates = getCandidatesIteratively(\n shadowRoot === true ? element.children : shadowRoot.children,\n true,\n options\n );\n\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift(...element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nconst hasTabIndex = function (node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nconst getTabIndex = function (node) {\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (node.tabIndex < 0) {\n // in Chrome,
,