@radix-ng/primitives 1.0.0-beta.2 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +76 -6
- package/fesm2022/radix-ng-primitives-accordion.mjs +5 -3
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +31 -24
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +1744 -0
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +1399 -606
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +13 -4
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +51 -10
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +1345 -64
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +271 -145
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +70 -0
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +519 -184
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +154 -64
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +3 -2
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +517 -0
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +296 -70
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +894 -299
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +32 -4
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +176 -207
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +250 -250
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +94 -45
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +107 -17
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +262 -79
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +172 -218
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +4 -2
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +5 -4
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +303 -234
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +5 -3
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +5 -3
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +15 -36
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +105 -145
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +14 -1
- package/types/radix-ng-primitives-accordion.d.ts +4 -3
- package/types/radix-ng-primitives-alert-dialog.d.ts +17 -11
- package/types/radix-ng-primitives-autocomplete.d.ts +661 -0
- package/types/radix-ng-primitives-calendar.d.ts +5 -3
- package/types/radix-ng-primitives-combobox.d.ts +727 -293
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +15 -5
- package/types/radix-ng-primitives-core.d.ts +762 -14
- package/types/radix-ng-primitives-date-field.d.ts +3 -2
- package/types/radix-ng-primitives-dialog.d.ts +107 -55
- package/types/radix-ng-primitives-direction-provider.d.ts +41 -0
- package/types/radix-ng-primitives-dismissable-layer.d.ts +147 -99
- package/types/radix-ng-primitives-drawer.d.ts +49 -22
- package/types/radix-ng-primitives-field.d.ts +1 -0
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +175 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +132 -1
- package/types/radix-ng-primitives-menu.d.ts +204 -112
- package/types/radix-ng-primitives-navigation-menu.d.ts +61 -101
- package/types/radix-ng-primitives-popover.d.ts +82 -115
- package/types/radix-ng-primitives-popper.d.ts +46 -10
- package/types/radix-ng-primitives-portal.d.ts +53 -8
- package/types/radix-ng-primitives-presence.d.ts +98 -17
- package/types/radix-ng-primitives-preview-card.d.ts +63 -95
- package/types/radix-ng-primitives-roving-focus.d.ts +7 -6
- package/types/radix-ng-primitives-scroll-area.d.ts +2 -2
- package/types/radix-ng-primitives-select.d.ts +192 -158
- package/types/radix-ng-primitives-slider.d.ts +5 -4
- package/types/radix-ng-primitives-stepper.d.ts +4 -3
- package/types/radix-ng-primitives-time-field.d.ts +3 -2
- package/types/radix-ng-primitives-toast.d.ts +7 -7
- package/types/radix-ng-primitives-toggle-group.d.ts +5 -4
- package/types/radix-ng-primitives-toolbar.d.ts +3 -2
- package/types/radix-ng-primitives-tooltip.d.ts +48 -84
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-core.mjs","sources":["../../../packages/primitives/core/src/accessor/provide-value-accessor.ts","../../../packages/primitives/core/src/accessor/control-value-accessor.ts","../../../packages/primitives/core/src/clamp.ts","../../../packages/primitives/core/src/create-context.ts","../../../packages/primitives/core/src/chunk.ts","../../../packages/primitives/core/src/date-time/comparators.ts","../../../packages/primitives/core/src/date-time/calendar.ts","../../../packages/primitives/core/src/date-time/formatter.ts","../../../packages/primitives/core/src/date-time/parts.ts","../../../packages/primitives/core/src/date-time/placeholders.ts","../../../packages/primitives/core/src/date-time/utils.ts","../../../packages/primitives/core/src/date-time/parser.ts","../../../packages/primitives/core/src/kbd-constants.ts","../../../packages/primitives/core/src/date-time/segment.ts","../../../packages/primitives/core/src/date-time/types.ts","../../../packages/primitives/core/src/date-time/useDateField.ts","../../../packages/primitives/core/src/handle-and-dispatch-custom-event.ts","../../../packages/primitives/core/src/id-generator.ts","../../../packages/primitives/core/src/predicates.ts","../../../packages/primitives/core/src/item-helpers.ts","../../../packages/primitives/core/src/live-announcer.ts","../../../packages/primitives/core/src/provide-token.ts","../../../packages/primitives/core/src/dom/document.ts","../../../packages/primitives/core/src/dom/element-size.ts","../../../packages/primitives/core/src/dom/get-active-element.ts","../../../packages/primitives/core/src/dom/use-resize-observer.ts","../../../packages/primitives/core/src/dom/use-scroll-lock.ts","../../../packages/primitives/core/src/composables/use-arrow-navigation.ts","../../../packages/primitives/core/src/composables/use-filter.ts","../../../packages/primitives/core/src/composables/use-grace-area.ts","../../../packages/primitives/core/src/composables/use-list-highlight.ts","../../../packages/primitives/core/src/composables/use-pointer-drag.ts","../../../packages/primitives/core/src/composables/use-transition-status.ts","../../../packages/primitives/core/src/composables/watch.ts","../../../packages/primitives/core/src/positioning/types.ts","../../../packages/primitives/core/radix-ng-primitives-core.ts"],"sourcesContent":["import { forwardRef, Provider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * Include in the providers section of a component which utilizes ControlValueAccessor to redundant code.\n *\n * ```ts\n * @Directive({\n * providers: [provideValueAccessor(ExampleDirective)]\n *}\n * export class ExampleDirective{}\n * ```\n */\nexport function provideValueAccessor<T>(type: Type<T>): Provider {\n return {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n","import { Directive, booleanAttribute, inject, input, linkedSignal, output, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { BooleanInput } from '../types';\nimport { provideValueAccessor } from './provide-value-accessor';\n\n/**\n * A reusable ControlValueAccessor implementation for form controls\n * @template T The type of the control's value\n */\n@Directive({\n exportAs: 'rdxControlValueAccessor',\n providers: [provideValueAccessor(RdxControlValueAccessor)]\n})\nexport class RdxControlValueAccessor<T> implements ControlValueAccessor {\n /**\n * Input for the control's value with alias 'value'\n * @default undefined\n */\n readonly valueInput = input<T>(undefined, { alias: 'value' });\n\n /**\n * Input for the disabled state with alias 'disabled'\n * Uses booleanAttribute transform to convert string attributes to booleans\n * @default false\n */\n readonly disabledInput = input<boolean, BooleanInput>(false, {\n alias: 'disabled',\n transform: booleanAttribute\n });\n\n readonly valueChange = output<T>();\n\n private readonly _value = linkedSignal(() => this.valueInput());\n\n /**\n * Readonly access to the current value\n */\n readonly value = this._value.asReadonly();\n\n private readonly _disabled = linkedSignal(() => this.disabledInput());\n\n /**\n * Readonly access to the disabled state\n */\n readonly disabled = this._disabled.asReadonly();\n\n // Callbacks for ControlValueAccessor\n onChange?: (value: T | undefined) => void;\n private onTouched?: () => void;\n\n /**\n * Writes a new value to the control (ControlValueAccessor interface)\n * @param value The new value for the control\n */\n writeValue(value: T | undefined): void {\n untracked(() => this._value.set(value as T));\n }\n\n /**\n * Registers a callback for when the control value changes (ControlValueAccessor interface)\n * @param fn The callback function\n */\n registerOnChange(fn: (value: T | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback for when the control is touched (ControlValueAccessor interface)\n * @param fn The callback function\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control (ControlValueAccessor interface)\n * @param isDisabled Whether the control should be disabled\n */\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n /**\n * Updates the control's value and triggers change detection\n * @param value The new value\n */\n setValue(value: T) {\n this._value.set(value);\n this.valueChange.emit(value);\n this.onChange?.(value);\n }\n\n markAsTouched() {\n this.onTouched?.();\n }\n}\n\n/**\n * Provides a type-safe way to inject the RdxControlValueAccessor\n * @template T The type of the control's value\n * @returns An instance of RdxControlValueAccessor<T>\n */\nexport function injectControlValueAccessor<T>(): RdxControlValueAccessor<T> {\n return inject(RdxControlValueAccessor);\n}\n","/**\n * The `clamp` function restricts a number within a specified range by returning the value itself if it\n * falls within the range, or the closest boundary value if it exceeds the range.\n * @param {number} value - The `value` parameter represents the number that you want to clamp within\n * the specified range defined by `min` and `max` values.\n * @param {number} min - If the `value` parameter is less than the `min` value, the\n * function will return the `min` value.\n * @param {number} max - If the `value` parameter is greater than the `max` value,\n * the function will return `max`.\n * @returns The `clamp` function returns the value of `value` constrained within the range defined by\n * `min` and `max`.\n */\nexport function clamp(\n value: number,\n min: number = Number.NEGATIVE_INFINITY,\n max: number = Number.POSITIVE_INFINITY\n): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/**\n * The function `roundToStepPrecision` rounds a number to a specified precision step.\n * @param {number} value - The `value` parameter is the number that you want to round to a specific\n * precision based on the `step` parameter.\n * @param {number} step - The `step` parameter in the `roundToStepPrecision` function represents the\n * interval at which you want to round the `value`. For example, if `step` is 0.5, the `value` will be\n * rounded to the nearest half.\n * @returns the `roundedValue` after rounding it to the precision specified by the `step`.\n */\nexport function roundToStepPrecision(value: number, step: number) {\n let roundedValue = value;\n const stepString = step.toString();\n const pointIndex = stepString.indexOf('.');\n const precision = pointIndex >= 0 ? stepString.length - pointIndex : 0;\n if (precision > 0) {\n const pow = 10 ** precision;\n roundedValue = Math.round(roundedValue * pow) / pow;\n }\n return roundedValue;\n}\n\n/**\n * The function `snapValueToStep` snaps a given value to the nearest step within a specified range.\n * @param {number} value - The `value` parameter represents the number that you want to snap to the\n * nearest step value.\n * @param {number | undefined} min - The `min` parameter represents the minimum value that the `value`\n * should be snapped to. If `value` is less than `min`, it will be snapped to `min`. If `min` is not\n * provided (undefined), then the snapping will not consider a minimum value.\n * @param {number | undefined} max - The `max` parameter represents the maximum value that the `value`\n * should be snapped to. It ensures that the snapped value does not exceed this maximum value.\n * @param {number} step - The `step` parameter in the `snapValueToStep` function represents the\n * interval at which the `value` should be snapped to. It determines the granularity of the snapping\n * operation. For example, if `step` is 5, the `value` will be snapped to the nearest multiple of\n * @returns a number that has been snapped to the nearest step value within the specified range of minimum and maximum values.\n */\nexport function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number {\n min = Number(min);\n max = Number(max);\n const remainder = (value - (Number.isNaN(min) ? 0 : min)) % step;\n let snappedValue = roundToStepPrecision(\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder,\n step\n );\n\n if (!Number.isNaN(min)) {\n if (snappedValue < min) snappedValue = min;\n else if (!Number.isNaN(max) && snappedValue > max)\n snappedValue = min + Math.floor(roundToStepPrecision((max - min) / step, step)) * step;\n } else if (!Number.isNaN(max) && snappedValue > max) {\n snappedValue = Math.floor(roundToStepPrecision(max / step, step)) * step;\n }\n\n // correct floating point behavior by rounding to step precision\n snappedValue = roundToStepPrecision(snappedValue, step);\n\n return snappedValue;\n}\n","// Thanks for idea.\n// https://github.com/unovue/reka-ui/blob/v2/packages/core/src/shared/createContext.ts\n\nimport { inject, InjectionToken, Provider } from '@angular/core';\n\n/**\n * Retrieves the context value from Angular's dependency injection.\n * Overloaded so the non-optional call returns a non-nullable `T` (no `!` needed),\n * while the optional call may return `null`.\n */\nexport interface InjectContext<T> {\n (): T;\n (optional: false): T;\n (optional: true): T | null;\n (optional?: boolean): T | null;\n}\n\n/**\n * Base URL of the documentation site. Each primitive's docs are also served as plain\n * Markdown at `/<section>/<slug>.md`, which both humans and AI agents can open.\n */\nconst DOCS_BASE_URL = 'https://radix-ng.com';\n\n/**\n * Creates a context with injector and provider functions for a given type\n * @template T The type of the context value\n * @param description Descriptive string for the context (used in token creation)\n * @param docs Documentation path for the owning primitive (e.g. `'components/accordion'`),\n * appended to the missing-context error as a link to the required anatomy\n * @returns A tuple containing:\n * - injectContext: Function to retrieve the context value\n * - provideContext: Function to create a provider for the context\n */\nexport function createContext<T>(\n description: string,\n docs?: string\n): readonly [injectContext: InjectContext<T>, provideContext: (useFactory: () => T) => Provider] {\n // Normalize so both `'FooRoot'` and `'FooRootContext'` read as `FooRootContext`.\n const contextName = `${description.replace(/\\s*Context$/, '')}Context`;\n const CONTEXT_TOKEN = new InjectionToken<T>(contextName);\n\n /**\n * Retrieves the context value from Angular's dependency injection\n * @param optional If true, returns null when context is not provided instead of throwing\n * @returns The context value or null if optional and not provided\n * @throws Error when context is not provided and not optional\n */\n const injectContext = (optional = false): T | null => {\n // Always inject optionally so a missing context produces our own descriptive\n // error instead of Angular's generic NullInjectorError. This also catches a\n // provided factory that returns null/undefined for the non-optional case.\n const value = inject(CONTEXT_TOKEN, { optional: true });\n\n if (value == null && !optional) {\n const docsHint = docs ? ` See ${DOCS_BASE_URL}/${docs}.md for the required part hierarchy.` : '';\n\n throw new Error(\n `No \\`${contextName}\\` found. This part must be placed inside the directive ` +\n `that provides \\`${contextName}\\` (usually the primitive's root).${docsHint}`\n );\n }\n\n return value;\n };\n\n /**\n * Creates a provider that can be used to supply the context value\n * @param useFactory Factory function that creates the context value\n * @returns A provider that can be registered in Angular's DI system\n */\n const provideContext = (useFactory: () => T): Provider => ({\n provide: CONTEXT_TOKEN,\n useFactory: useFactory\n });\n\n return [injectContext as InjectContext<T>, provideContext] as const;\n}\n","/**\n * Splits an array into chunks of a given size.\n * @param arr The array to split.\n * @param size The size of each chunk.\n * @returns An array of arrays, where each sub-array has `size` elements from the original array.\n * @example ```ts\n * const arr = [1, 2, 3, 4, 5, 6, 7, 8];\n * const chunks = chunk(arr, 3);\n * // chunks = [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n */\nexport function chunk<T>(arr: T[], size: number): T[][] {\n const result = [];\n for (let i = 0; i < arr.length; i += size) result.push(arr.slice(i, i + size));\n\n return result;\n}\n","import {\n CalendarDate,\n CalendarDateTime,\n CalendarIdentifier,\n createCalendar,\n DateFormatter,\n type DateValue,\n getDayOfWeek,\n getLocalTimeZone,\n Time,\n toCalendar,\n ZonedDateTime\n} from '@internationalized/date';\nimport type { DateMatcher } from './types';\n\n/**\n * Given a `DateValue` object, convert it to a native `Date` object.\n * If a timezone is provided, the date will be converted to that timezone.\n * If no timezone is provided, the date will be converted to the local timezone.\n */\nexport function toDate(dateValue: DateValue, tz: string = getLocalTimeZone()) {\n if (isZonedDateTime(dateValue)) return dateValue.toDate();\n else return dateValue.toDate(tz);\n}\n\nexport function isCalendarDateTime(dateValue: DateValue): dateValue is CalendarDateTime {\n return dateValue instanceof CalendarDateTime;\n}\n\nexport function isZonedDateTime(dateValue: DateValue): dateValue is ZonedDateTime {\n return dateValue instanceof ZonedDateTime;\n}\n\nexport function hasTime(dateValue: DateValue) {\n return isCalendarDateTime(dateValue) || isZonedDateTime(dateValue);\n}\n\n/**\n * Given a date, return the number of days in the month.\n */\nexport function getDaysInMonth(date: Date | DateValue) {\n if (date instanceof Date) {\n const year = date.getFullYear();\n const month = date.getMonth() + 1;\n /**\n * By using zero as the day, we get the\n * last day of the previous month, which\n * is the month we originally passed in.\n */\n return new Date(year, month, 0).getDate();\n } else {\n return date.set({ day: 100 }).day;\n }\n}\n\n/**\n * Determine if a date is before the reference date.\n * @param dateToCompare - is this date before the `referenceDate`\n * @param referenceDate - is the `dateToCompare` before this date\n *\n * @see {@link isBeforeOrSame} for inclusive\n */\nexport function isBefore(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) < 0;\n}\n\n/**\n * Determine if a date is after the reference date.\n * @param dateToCompare - is this date after the `referenceDate`\n * @param referenceDate - is the `dateToCompare` after this date\n *\n * @see {@link isAfterOrSame} for inclusive\n */\nexport function isAfter(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) > 0;\n}\n\n/**\n * Determine if a date is before or the same as the reference date.\n *\n * @param dateToCompare - the date to compare\n * @param referenceDate - the reference date to make the comparison against\n *\n * @see {@link isBefore} for non-inclusive\n */\nexport function isBeforeOrSame(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) <= 0;\n}\n\n/**\n * Determine if a date is after or the same as the reference date.\n *\n * @param dateToCompare - is this date after or the same as the `referenceDate`\n * @param referenceDate - is the `dateToCompare` after or the same as this date\n *\n * @see {@link isAfter} for non-inclusive\n */\nexport function isAfterOrSame(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) >= 0;\n}\n\n/**\n * Determine if a date is inclusively between a start and end reference date.\n *\n * @param date - is this date inclusively between the `start` and `end` dates\n * @param start - the start reference date to make the comparison against\n * @param end - the end reference date to make the comparison against\n *\n * @see {@link isBetween} for non-inclusive\n */\nexport function isBetweenInclusive(date: DateValue, start: DateValue, end: DateValue) {\n return isAfterOrSame(date, start) && isBeforeOrSame(date, end);\n}\n\n/**\n * Determine if a date is between a start and end reference date.\n *\n * @param date - is this date between the `start` and `end` dates\n * @param start - the start reference date to make the comparison against\n * @param end - the end reference date to make the comparison against\n *\n * @see {@link isBetweenInclusive} for inclusive\n */\nexport function isBetween(date: DateValue, start: DateValue, end: DateValue) {\n return isAfter(date, start) && isBefore(date, end);\n}\n\nexport function getLastFirstDayOfWeek<T extends DateValue = DateValue>(\n date: T,\n firstDayOfWeek: number,\n locale: string\n): T {\n const day = getDayOfWeek(date, locale);\n\n if (firstDayOfWeek > day) return date.subtract({ days: day + 7 - firstDayOfWeek }) as T;\n\n if (firstDayOfWeek === day) return date;\n\n return date.subtract({ days: day - firstDayOfWeek }) as T;\n}\n\nexport function getNextLastDayOfWeek<T extends DateValue = DateValue>(\n date: T,\n firstDayOfWeek: number,\n locale: string\n): T {\n const day = getDayOfWeek(date, locale);\n const lastDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n\n if (day === lastDayOfWeek) return date;\n\n if (day > lastDayOfWeek) return date.add({ days: 7 - day + lastDayOfWeek }) as T;\n\n return date.add({ days: lastDayOfWeek - day }) as T;\n}\n\nexport function areAllDaysBetweenValid(\n start: DateValue,\n end: DateValue,\n isUnavailable: DateMatcher | undefined,\n isDisabled: DateMatcher | undefined\n) {\n if (isUnavailable === undefined && isDisabled === undefined) return true;\n\n let dCurrent = start.add({ days: 1 });\n if (isDisabled?.(dCurrent) || isUnavailable?.(dCurrent)) return false;\n\n const dEnd = end;\n while (dCurrent.compare(dEnd) < 0) {\n dCurrent = dCurrent.add({ days: 1 });\n if (isDisabled?.(dCurrent) || isUnavailable?.(dCurrent)) return false;\n }\n return true;\n}\n\nexport type TimeValue = Time | CalendarDateTime | ZonedDateTime;\n\nexport type Granularity = 'day' | 'hour' | 'minute' | 'second';\nexport type TimeGranularity = 'hour' | 'minute' | 'second';\n\n/**\n * The granularities that require a time component (and therefore a `CalendarDateTime`\n * rather than a `CalendarDate`). Single source of truth — used by both the default-date\n * builder and the segment-value initializer.\n */\nexport const TIME_GRANULARITIES: readonly Granularity[] = ['hour', 'minute', 'second'];\n\ntype GetDefaultDateProps = {\n defaultValue?: DateValue | DateValue[] | undefined;\n defaultPlaceholder?: DateValue | undefined;\n granularity?: Granularity;\n locale?: string;\n};\n\n/**\n * A helper function used throughout the various date builders\n * to generate a default `DateValue` using the `defaultValue`,\n * `defaultPlaceholder`, and `granularity` props.\n *\n * It's important to match the `DateValue` type being used\n * elsewhere in the builder, so they behave according to the\n * behavior the user expects based on the props they've provided.\n *\n */\nexport function getDefaultDate(props: GetDefaultDateProps): DateValue {\n const { defaultValue, defaultPlaceholder, granularity = 'day', locale = 'en' } = props;\n\n if (Array.isArray(defaultValue)) {\n // Multiple-selection calendars pass an array. The view follows the most recently\n // selected date — consistent with calendar-root's value→placeholder sync. An empty\n // array means \"no selection\", so fall through to the placeholder / today.\n if (defaultValue.length) return defaultValue[defaultValue.length - 1].copy();\n } else if (defaultValue) {\n return defaultValue.copy();\n }\n\n if (defaultPlaceholder) return defaultPlaceholder.copy();\n\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth() + 1;\n const day = date.getDate();\n\n const defaultFormatter = new DateFormatter(locale);\n const calendar = createCalendar(defaultFormatter.resolvedOptions().calendar as CalendarIdentifier);\n\n if (TIME_GRANULARITIES.includes(granularity ?? 'day'))\n return toCalendar(new CalendarDateTime(year, month, day, 0, 0, 0), calendar);\n\n return toCalendar(new CalendarDate(year, month, day), calendar);\n}\n\ntype GetDefaultTimeProps = {\n defaultValue?: TimeValue | undefined;\n defaultPlaceholder?: TimeValue | undefined;\n};\n\nexport function getDefaultTime(props: GetDefaultTimeProps): TimeValue {\n const { defaultValue, defaultPlaceholder } = props;\n\n if (defaultValue) {\n return defaultValue.copy();\n }\n\n if (defaultPlaceholder) {\n return defaultPlaceholder.copy();\n }\n\n return new Time(0, 0, 0);\n}\n","/*\n * Implementation ported from from from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/builders/calendar/create.ts\n */\n\nimport { CalendarDate, DateValue, endOfMonth, getDayOfWeek, startOfMonth } from '@internationalized/date';\nimport { chunk } from '../chunk';\nimport { getDaysInMonth, getLastFirstDayOfWeek, getNextLastDayOfWeek } from './comparators';\nimport { Month } from './types';\n\ntype DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';\n\nexport type CreateMonthProps = {\n /**\n * The date object representing the month's date (usually the first day of the month).\n */\n dateObj: DateValue;\n\n /**\n * The day of the week to start the calendar on (0 for Sunday, 1 for Monday, etc.).\n */\n weekStartsOn: number;\n\n /**\n * Whether to always render 6 weeks in the calendar, even if the month doesn't\n * span 6 weeks.\n */\n fixedWeeks: boolean;\n\n /**\n * The locale to use when creating the calendar month.\n */\n locale: string;\n};\n\n/**\n * Retrieves an array of date values representing the days between\n * the provided start and end dates.\n */\nexport function getDaysBetween(start: DateValue, end: DateValue) {\n const days: DateValue[] = [];\n let dCurrent = start.add({ days: 1 });\n const dEnd = end;\n while (dCurrent.compare(dEnd) < 0) {\n days.push(dCurrent);\n dCurrent = dCurrent.add({ days: 1 });\n }\n return days;\n}\n\nexport function createMonth(props: CreateMonthProps): Month<DateValue> {\n const { dateObj, weekStartsOn, fixedWeeks, locale } = props;\n const daysInMonth = getDaysInMonth(dateObj);\n\n const datesArray = Array.from({ length: daysInMonth }, (_, i) => dateObj.set({ day: i + 1 }));\n\n const firstDayOfMonth = startOfMonth(dateObj);\n const lastDayOfMonth = endOfMonth(dateObj);\n\n const lastSunday = getLastFirstDayOfWeek(firstDayOfMonth, weekStartsOn, locale);\n const nextSaturday = getNextLastDayOfWeek(lastDayOfMonth, weekStartsOn, locale);\n\n const lastMonthDays = getDaysBetween(lastSunday.subtract({ days: 1 }), firstDayOfMonth);\n const nextMonthDays = getDaysBetween(lastDayOfMonth, nextSaturday.add({ days: 1 }));\n\n const totalDays = lastMonthDays.length + datesArray.length + nextMonthDays.length;\n\n if (fixedWeeks && totalDays < 42) {\n const extraDays = 42 - totalDays;\n\n let startFrom = nextMonthDays[nextMonthDays.length - 1];\n\n if (!startFrom) startFrom = endOfMonth(dateObj);\n\n const extraDaysArray = Array.from({ length: extraDays }, (_, i) => {\n const incr = i + 1;\n return startFrom.add({ days: incr });\n });\n nextMonthDays.push(...extraDaysArray);\n }\n\n const allDays = lastMonthDays.concat(datesArray, nextMonthDays);\n\n const weeks = chunk(allDays, 7);\n\n return {\n value: dateObj,\n dates: allDays,\n weeks: weeks\n };\n}\n\ntype SetMonthProps = CreateMonthProps & {\n numberOfMonths: number | undefined;\n currentMonths?: Month<DateValue>[];\n};\n\nexport function createMonths(props: SetMonthProps) {\n const { numberOfMonths, dateObj, ...monthProps } = props;\n\n const months: Month<DateValue>[] = [];\n\n if (!numberOfMonths || numberOfMonths === 1) {\n months.push(\n createMonth({\n ...monthProps,\n dateObj\n })\n );\n return months;\n }\n\n months.push(\n createMonth({\n ...monthProps,\n dateObj\n })\n );\n\n // Create all the months, starting with the current month\n for (let i = 1; i < numberOfMonths; i++) {\n const nextMonth = dateObj.add({ months: i });\n months.push(\n createMonth({\n ...monthProps,\n dateObj: nextMonth\n })\n );\n }\n\n return months;\n}\n\n/**\n * Returns the locale-specific week number\n */\nexport function getWeekNumber(date: DateValue, locale: string = 'en-US', firstDayOfWeek?: DayOfWeek): number {\n const firstDayOfYear = new CalendarDate(date.year, 1, 1);\n\n const firstDayOfYearWeekday = getDayOfWeek(firstDayOfYear, locale, firstDayOfWeek);\n\n const firstWeekStart = firstDayOfYear.subtract({ days: firstDayOfYearWeekday });\n\n // If date is before the first week start It belongs to the last week of the previous year\n if (date.compare(firstWeekStart) < 0) {\n const prevYearDate = new CalendarDate(date.year - 1, 12, 31);\n return getWeekNumber(prevYearDate, locale, firstDayOfWeek);\n }\n\n // `getDaysBetween` is exclusive of both ends, so extend the end by a day to count the\n // full span from `firstWeekStart` through `date` (otherwise every 7-day boundary is\n // under-counted by one and the week number lags).\n const days = getDaysBetween(firstWeekStart, date.add({ days: 1 }));\n\n // Week number is days divided by 7 plus 1\n return Math.floor(days.length / 7) + 1;\n}\n","import { DateFormatter, type DateValue, getLocalTimeZone, today } from '@internationalized/date';\nimport { hasTime, isZonedDateTime, toDate } from './comparators';\nimport { HourCycle } from './types';\n\nconst defaultPartOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n};\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string;\n}\n\n/**\n * Constructing a `DateFormatter` (which wraps `Intl.DateTimeFormat`) is by far the most\n * expensive operation here, and `createContent` formats every segment on each keystroke.\n * Reuse instances keyed by locale + options — the set of distinct combinations is tiny and\n * the instances are immutable.\n */\nconst formatterCache = new Map<string, DateFormatter>();\n\nfunction getDateFormatter(locale: string, options: DateFormatterOptions): DateFormatter {\n const key = `${locale}|${JSON.stringify(options)}`;\n let formatter = formatterCache.get(key);\n if (!formatter) {\n formatter = new DateFormatter(locale, options);\n formatterCache.set(key, formatter);\n }\n return formatter;\n}\n\nexport type Formatter = {\n getLocale: () => string;\n setLocale: (newLocale: string) => void;\n custom: (date: Date, options: DateFormatterOptions) => string;\n selectedDate: (date: DateValue, includeTime?: boolean) => string;\n dayOfWeek: (date: Date, length?: DateFormatterOptions['weekday']) => string;\n fullMonthAndYear: (date: Date, options?: DateFormatterOptions) => string;\n fullMonth: (date: Date, options?: DateFormatterOptions) => string;\n fullYear: (date: Date, options?: DateFormatterOptions) => string;\n dayPeriod: (date: Date) => string;\n part: (dateObj: DateValue, type: Intl.DateTimeFormatPartTypes, options?: DateFormatterOptions) => string;\n toParts: (date: DateValue, options?: DateFormatterOptions) => Intl.DateTimeFormatPart[];\n getMonths: () => { label: string; value: number }[];\n};\n\n/**\n * Creates a wrapper around the `DateFormatter`, which is\n * an improved version of the {@link Intl.DateTimeFormat} API,\n * that is used internally by the various date builders to\n * easily format dates in a consistent way.\n *\n * @see [DateFormatter](https://react-spectrum.adobe.com/internationalized/date/DateFormatter.html)\n */\nexport function createFormatter(initialLocale: string, opts: DateFormatterOptions = {}): Formatter {\n let locale = initialLocale;\n\n function setLocale(newLocale: string) {\n locale = newLocale;\n }\n\n function getLocale() {\n return locale;\n }\n\n function custom(date: Date, options: DateFormatterOptions) {\n return getDateFormatter(locale, { ...opts, ...options }).format(date);\n }\n\n function selectedDate(date: DateValue, includeTime = true) {\n if (hasTime(date) && includeTime) {\n return custom(toDate(date), {\n dateStyle: 'long',\n timeStyle: 'long'\n });\n } else {\n return custom(toDate(date), {\n dateStyle: 'long'\n });\n }\n }\n\n function fullMonthAndYear(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, month: 'long', year: 'numeric', ...options }).format(date);\n }\n\n function fullMonth(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, month: 'long', ...options }).format(date);\n }\n\n function fullYear(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, year: 'numeric', ...options }).format(date);\n }\n\n function toParts(date: DateValue, options?: DateFormatterOptions) {\n if (isZonedDateTime(date)) {\n return getDateFormatter(locale, {\n ...opts,\n ...options,\n timeZone: date.timeZone\n }).formatToParts(toDate(date));\n } else {\n return getDateFormatter(locale, { ...opts, ...options }).formatToParts(toDate(date));\n }\n }\n\n function dayOfWeek(date: Date, length: DateFormatterOptions['weekday'] = 'narrow') {\n return getDateFormatter(locale, { ...opts, weekday: length }).format(date);\n }\n\n function dayPeriod(date: Date, hourCycle: HourCycle | undefined = undefined) {\n const parts = getDateFormatter(locale, {\n ...opts,\n hour: 'numeric',\n minute: 'numeric',\n hourCycle: hourCycle === 24 ? 'h23' : undefined\n }).formatToParts(date);\n const value = parts.find((p) => p.type === 'dayPeriod')?.value;\n // Day period can be \"AM\"/\"PM\" or \"a.m.\"/\"p.m.\" in some locales\n if (value === 'PM' || value === 'p.m.') {\n return 'PM';\n }\n return 'AM';\n }\n\n function part(dateObj: DateValue, type: Intl.DateTimeFormatPartTypes, options: Intl.DateTimeFormatOptions = {}) {\n const opts = { ...defaultPartOptions, ...options };\n const parts = toParts(dateObj, opts);\n const part = parts.find((p) => p.type === type);\n return part ? part.value : '';\n }\n\n function getMonths() {\n const defaultDate = today(getLocalTimeZone());\n const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n return months.map((item) => ({ label: fullMonth(toDate(defaultDate.set({ month: item }))), value: item }));\n }\n\n return {\n setLocale,\n getLocale,\n fullMonth,\n fullYear,\n fullMonthAndYear,\n toParts,\n custom,\n part,\n dayPeriod,\n selectedDate,\n dayOfWeek,\n getMonths\n };\n}\n","/*\n * Implementation ported from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/builders/date-field/_internal/helpers.ts\n */\n\nimport type { DateSegmentPart, EditableSegmentPart, SegmentPart, TimeSegmentPart } from './types';\n\nexport const DATE_SEGMENT_PARTS = ['day', 'month', 'year'] as const;\nexport const TIME_SEGMENT_PARTS = ['hour', 'minute', 'second', 'dayPeriod'] as const;\nexport const NON_EDITABLE_SEGMENT_PARTS = ['literal', 'timeZoneName'] as const;\nexport const EDITABLE_SEGMENT_PARTS = [...DATE_SEGMENT_PARTS, ...TIME_SEGMENT_PARTS] as const;\nexport const EDITABLE_TIME_SEGMENT_PARTS = [...TIME_SEGMENT_PARTS] as const;\nexport const ALL_SEGMENT_PARTS = [...EDITABLE_SEGMENT_PARTS, ...NON_EDITABLE_SEGMENT_PARTS] as const;\nexport const ALL_EXCEPT_LITERAL_PARTS = ALL_SEGMENT_PARTS.filter((part) => part !== 'literal');\n\nexport function isDateSegmentPart(part: unknown): part is DateSegmentPart {\n return DATE_SEGMENT_PARTS.includes(part as DateSegmentPart);\n}\n\nexport function isTimeSegmentPart(part: unknown): part is TimeSegmentPart {\n return TIME_SEGMENT_PARTS.includes(part as TimeSegmentPart);\n}\n\nexport function isSegmentPart(part: string): part is EditableSegmentPart {\n return EDITABLE_SEGMENT_PARTS.includes(part as EditableSegmentPart);\n}\n\nexport function isAnySegmentPart(part: unknown): part is SegmentPart {\n return ALL_SEGMENT_PARTS.includes(part as EditableSegmentPart);\n}\n","/*\n * Implementation ported from from from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/internal/helpers/date/placeholders.ts\n */\n\n// prettier-ignore\nconst supportedLocales = [\n 'ach','af','am','an','ar','ast','az','be','bg','bn','br','bs',\n 'ca','cak','ckb','cs','cy','da','de','dsb','el','en','eo','es',\n 'et','eu','fa','ff','fi','fr','fy','ga','gd','gl','he','hr',\n 'hsb','hu','ia','id','it','ja','ka','kk','kn','ko','lb','lo',\n 'lt','lv','meh','ml','ms','nl','nn','no','oc','pl','pt','rm',\n 'ro','ru','sc','scn','sk','sl','sr','sv','szl','tg','th','tr',\n 'uk','zh-CN','zh-TW',\n] as const;\n\nconst placeholderFields = ['year', 'month', 'day'] as const;\n\ntype SupportedLocale = (typeof supportedLocales)[number];\ntype PlaceholderField = (typeof placeholderFields)[number];\nexport type PlaceholderMap = Record<SupportedLocale, Record<PlaceholderField, string>>;\n\nconst placeholders: PlaceholderMap = {\n ach: { year: 'mwaka', month: 'dwe', day: 'nino' },\n af: { year: 'jjjj', month: 'mm', day: 'dd' },\n am: { year: 'ዓዓዓዓ', month: 'ሚሜ', day: 'ቀቀ' },\n an: { year: 'aaaa', month: 'mm', day: 'dd' },\n ar: { year: 'سنة', month: 'شهر', day: 'يوم' },\n ast: { year: 'aaaa', month: 'mm', day: 'dd' },\n az: { year: 'iiii', month: 'aa', day: 'gg' },\n be: { year: 'гггг', month: 'мм', day: 'дд' },\n bg: { year: 'гггг', month: 'мм', day: 'дд' },\n bn: { year: 'yyyy', month: 'মিমি', day: 'dd' },\n br: { year: 'bbbb', month: 'mm', day: 'dd' },\n bs: { year: 'gggg', month: 'mm', day: 'dd' },\n ca: { year: 'aaaa', month: 'mm', day: 'dd' },\n cak: { year: 'jjjj', month: 'ii', day: \"q'q'\" },\n ckb: { year: 'ساڵ', month: 'مانگ', day: 'ڕۆژ' },\n cs: { year: 'rrrr', month: 'mm', day: 'dd' },\n cy: { year: 'bbbb', month: 'mm', day: 'dd' },\n da: { year: 'åååå', month: 'mm', day: 'dd' },\n de: { year: 'jjjj', month: 'mm', day: 'tt' },\n dsb: { year: 'llll', month: 'mm', day: 'źź' },\n el: { year: 'εεεε', month: 'μμ', day: 'ηη' },\n en: { year: 'yyyy', month: 'mm', day: 'dd' },\n eo: { year: 'jjjj', month: 'mm', day: 'tt' },\n es: { year: 'aaaa', month: 'mm', day: 'dd' },\n et: { year: 'aaaa', month: 'kk', day: 'pp' },\n eu: { year: 'uuuu', month: 'hh', day: 'ee' },\n fa: { year: 'سال', month: 'ماه', day: 'روز' },\n ff: { year: 'hhhh', month: 'll', day: 'ññ' },\n fi: { year: 'vvvv', month: 'kk', day: 'pp' },\n fr: { year: 'aaaa', month: 'mm', day: 'jj' },\n fy: { year: 'jjjj', month: 'mm', day: 'dd' },\n ga: { year: 'bbbb', month: 'mm', day: 'll' },\n gd: { year: 'bbbb', month: 'mm', day: 'll' },\n gl: { year: 'aaaa', month: 'mm', day: 'dd' },\n he: { year: 'שנה', month: 'חודש', day: 'יום' },\n hr: { year: 'gggg', month: 'mm', day: 'dd' },\n hsb: { year: 'llll', month: 'mm', day: 'dd' },\n hu: { year: 'éééé', month: 'hh', day: 'nn' },\n ia: { year: 'aaaa', month: 'mm', day: 'dd' },\n id: { year: 'tttt', month: 'bb', day: 'hh' },\n it: { year: 'aaaa', month: 'mm', day: 'gg' },\n ja: { year: ' 年 ', month: '月', day: '日' },\n ka: { year: 'წწწწ', month: 'თთ', day: 'რრ' },\n kk: { year: 'жжжж', month: 'аа', day: 'кк' },\n kn: { year: 'ವವವವ', month: 'ಮಿಮೀ', day: 'ದಿದಿ' },\n ko: { year: '연도', month: '월', day: '일' },\n lb: { year: 'jjjj', month: 'mm', day: 'dd' },\n lo: { year: 'ປປປປ', month: 'ດດ', day: 'ວວ' },\n lt: { year: 'mmmm', month: 'mm', day: 'dd' },\n lv: { year: 'gggg', month: 'mm', day: 'dd' },\n meh: { year: 'aaaa', month: 'mm', day: 'dd' },\n ml: { year: 'വർഷം', month: 'മാസം', day: 'തീയതി' },\n ms: { year: 'tttt', month: 'mm', day: 'hh' },\n nl: { year: 'jjjj', month: 'mm', day: 'dd' },\n nn: { year: 'åååå', month: 'mm', day: 'dd' },\n no: { year: 'åååå', month: 'mm', day: 'dd' },\n oc: { year: 'aaaa', month: 'mm', day: 'jj' },\n pl: { year: 'rrrr', month: 'mm', day: 'dd' },\n pt: { year: 'aaaa', month: 'mm', day: 'dd' },\n rm: { year: 'oooo', month: 'mm', day: 'dd' },\n ro: { year: 'aaaa', month: 'll', day: 'zz' },\n ru: { year: 'гггг', month: 'мм', day: 'дд' },\n sc: { year: 'aaaa', month: 'mm', day: 'dd' },\n scn: { year: 'aaaa', month: 'mm', day: 'jj' },\n sk: { year: 'rrrr', month: 'mm', day: 'dd' },\n sl: { year: 'llll', month: 'mm', day: 'dd' },\n sr: { year: 'гггг', month: 'мм', day: 'дд' },\n sv: { year: 'åååå', month: 'mm', day: 'dd' },\n szl: { year: 'rrrr', month: 'mm', day: 'dd' },\n tg: { year: 'сссс', month: 'мм', day: 'рр' },\n th: { year: 'ปปปป', month: 'ดด', day: 'วว' },\n tr: { year: 'yyyy', month: 'aa', day: 'gg' },\n uk: { year: 'рррр', month: 'мм', day: 'дд' },\n 'zh-CN': { year: '年', month: '月', day: '日' },\n 'zh-TW': { year: '年', month: '月', day: '日' }\n};\n\nfunction getPlaceholderObj(locale: SupportedLocale | (string & {})) {\n if (!isSupportedLocale(locale)) {\n const localeLanguage = getLocaleLanguage(locale);\n if (!isSupportedLocale(localeLanguage)) {\n return placeholders.en;\n } else {\n return placeholders[localeLanguage];\n }\n } else {\n return placeholders[locale];\n }\n}\n\ntype Field = 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod';\n\nexport function getPlaceholder(field: Field, value: string, locale: SupportedLocale | (string & {})) {\n if (isPlaceholderField(field)) return getPlaceholderObj(locale)[field];\n if (isDefaultField(field)) return value;\n if (isTimeField(field)) return '––';\n return '';\n}\n\nfunction isSupportedLocale(locale: string): locale is SupportedLocale {\n return supportedLocales.includes(locale as SupportedLocale);\n}\n\nfunction isPlaceholderField(field: unknown): field is PlaceholderField {\n return placeholderFields.includes(field as PlaceholderField);\n}\n\nfunction isTimeField(field: unknown): field is 'hour' | 'minute' | 'second' {\n return field === 'hour' || field === 'minute' || field === 'second';\n}\n\nfunction isDefaultField(field: unknown): field is 'era' | 'dayPeriod' {\n return field === 'era' || field === 'dayPeriod';\n}\n\nfunction getLocaleLanguage(locale: string) {\n if (Intl.Locale) {\n return new Intl.Locale(locale).language;\n }\n return locale.split('-')[0];\n}\n","import { Granularity } from './comparators';\nimport { DateStep, HourCycle } from './types';\n\nexport function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue: boolean = false) {\n const opts: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n timeZoneName: 'short',\n hourCycle: normalizeHourCycle(hourCycle),\n hour12: normalizeHour12(hourCycle)\n };\n if (isTimeValue) {\n delete opts.year;\n delete opts.month;\n delete opts.day;\n }\n\n if (granularity === 'day') {\n delete opts.second;\n delete opts.hour;\n delete opts.minute;\n delete opts.timeZoneName;\n }\n if (granularity === 'hour') {\n delete opts.minute;\n delete opts.second;\n }\n\n if (granularity === 'minute') delete opts.second;\n\n return opts;\n}\n\nexport function normalizeDateStep(step?: DateStep): DateStep {\n return {\n year: step?.year ?? 1,\n month: step?.month ?? 1,\n day: step?.day ?? 1,\n hour: step?.hour ?? 1,\n minute: step?.minute ?? 1,\n second: step?.second ?? 1,\n millisecond: step?.millisecond ?? 1\n };\n}\n\nexport function handleCalendarInitialFocus(calendar: HTMLElement) {\n const selectedDay = calendar.querySelector<HTMLElement>('[data-selected]');\n if (selectedDay) return selectedDay.focus();\n\n const today = calendar.querySelector<HTMLElement>('[data-today]');\n if (today) return today.focus();\n\n const firstDay = calendar.querySelector<HTMLElement>('[data-rdx-calendar-day]');\n if (firstDay) return firstDay.focus();\n}\n\nexport function normalizeHourCycle(hourCycle: HourCycle) {\n if (hourCycle === 24) return 'h23';\n if (hourCycle === 12) return 'h11';\n return undefined;\n}\n\nexport function normalizeHour12(hourCycle: HourCycle) {\n if (hourCycle === 24) return false;\n if (hourCycle === 12) return true;\n return undefined;\n}\n","import { InputSignal } from '@angular/core';\nimport { DateFields, DateValue } from '@internationalized/date';\nimport { Granularity, isZonedDateTime, TIME_GRANULARITIES, toDate } from './comparators';\nimport { Formatter } from './formatter';\nimport {\n DATE_SEGMENT_PARTS,\n EDITABLE_SEGMENT_PARTS,\n isDateSegmentPart,\n isSegmentPart,\n TIME_SEGMENT_PARTS\n} from './parts';\nimport { getPlaceholder } from './placeholders';\nimport { DateSegmentPart, HourCycle, SegmentContentObj, SegmentPart, SegmentValueObj, TimeSegmentPart } from './types';\nimport { getOptsByGranularity, normalizeHourCycle } from './utils';\n\ntype SyncDateSegmentValuesProps = {\n value: DateValue;\n formatter: Formatter;\n};\n\ntype SyncTimeSegmentValuesProps = {\n value: DateValue;\n formatter: Formatter;\n};\n\nexport function syncTimeSegmentValues(props: SyncTimeSegmentValuesProps) {\n return Object.fromEntries(\n TIME_SEGMENT_PARTS.map((part) => {\n if (part === 'dayPeriod') return [part, props.formatter.dayPeriod(toDate(props.value))];\n return [part, props.value[part as keyof DateValue]];\n })\n ) as SegmentValueObj;\n}\n\nexport function initializeSegmentValues(granularity: Granularity, isTimeValue = false): SegmentValueObj {\n const initialParts = EDITABLE_SEGMENT_PARTS.map((part) => {\n if (part === 'dayPeriod') return [part, 'AM'];\n\n return [part, null];\n }).filter(([key]) => {\n if (key === 'literal' || key === null) return false;\n // A time-only field has no date segments, so they must not be seeded — otherwise they\n // stay null forever and block committing the value (every segment must be filled).\n if (isTimeValue && isDateSegmentPart(key)) return false;\n if (granularity === 'minute' && key === 'second') return false;\n if (granularity === 'hour' && (key === 'second' || key === 'minute')) return false;\n if (granularity === 'day') return !TIME_GRANULARITIES.includes(key as Granularity) && key !== 'dayPeriod';\n else return true;\n });\n\n return Object.fromEntries(initialParts);\n}\n\ntype SharedContentProps = {\n granularity: Granularity;\n dateRef: DateValue;\n formatter: Formatter;\n hideTimeZone: boolean;\n hourCycle: HourCycle;\n isTimeValue?: boolean;\n};\n\ntype CreateContentObjProps = SharedContentProps & {\n segmentValues: SegmentValueObj;\n locale: InputSignal<string>;\n};\n\ntype CreateContentArrProps = SharedContentProps & {\n contentObj: SegmentContentObj;\n};\n\nexport function syncSegmentValues(props: SyncDateSegmentValuesProps) {\n const { formatter } = props;\n\n const dateValues = DATE_SEGMENT_PARTS.map((part) => {\n return [part, props.value[part]];\n });\n if ('hour' in props.value) {\n const timeValues = syncTimeSegmentValues({ value: props.value, formatter });\n\n return { ...Object.fromEntries(dateValues), ...timeValues } as SegmentValueObj;\n }\n\n return Object.fromEntries(dateValues) as SegmentValueObj;\n}\n\nfunction createContentObj(props: CreateContentObjProps) {\n const { segmentValues, formatter, locale } = props;\n function getPartContent(part: DateSegmentPart | TimeSegmentPart) {\n if ('hour' in segmentValues) {\n const value = segmentValues[part];\n if (value !== null) {\n if (part === 'day') {\n return formatter.part(\n props.dateRef.set({\n [part as keyof DateFields]: value,\n /**\n * Edge case for the day field:\n *\n * 1. If the month is filled,\n * we need to ensure that the day snaps to the maximum value of that month.\n * 2. If the month is not filled,\n * we default to the month with the maximum number of days (here just using January, 31 days),\n * so that user can input any possible day.\n */\n month: segmentValues.month ?? 1\n }),\n part,\n { hourCycle: normalizeHourCycle(props.hourCycle) }\n );\n }\n return formatter.part(props.dateRef.set({ [part]: value }), part, {\n hourCycle: normalizeHourCycle(props.hourCycle)\n });\n } else {\n return getPlaceholder(part, '', locale());\n }\n } else {\n if (isDateSegmentPart(part)) {\n const value = segmentValues[part];\n if (value !== null) {\n if (part === 'day') {\n return formatter.part(\n props.dateRef.set({\n [part]: value,\n // Same logic as above for the day field\n month: segmentValues.month ?? 1\n }),\n part\n );\n }\n\n return formatter.part(props.dateRef.set({ [part]: value }), part);\n } else {\n return getPlaceholder(part, '', locale());\n }\n }\n return '';\n }\n }\n\n const content = Object.keys(segmentValues).reduce((obj, part) => {\n if (!isSegmentPart(part)) return obj;\n if ('hour' in segmentValues && part === 'dayPeriod') {\n const value = segmentValues[part];\n\n if (value !== null) obj[part] = value;\n else obj[part] = getPlaceholder(part, 'AM', locale());\n } else {\n obj[part] = getPartContent(part);\n }\n\n return obj;\n }, {} as SegmentContentObj);\n\n return content;\n}\n\nfunction createContentArr(props: CreateContentArrProps) {\n const { granularity, formatter, contentObj, hideTimeZone, hourCycle, isTimeValue } = props;\n const parts = formatter.toParts(props.dateRef, getOptsByGranularity(granularity, hourCycle, isTimeValue));\n\n const segmentContentArr = parts\n .map((part) => {\n const defaultParts = ['literal', 'timeZoneName', null];\n\n if (defaultParts.includes(part.type) || !isSegmentPart(part.type)) {\n return {\n part: part.type,\n value: part.value\n };\n }\n\n return {\n part: part.type,\n value: contentObj[part.type]\n };\n })\n .filter((segment): segment is { part: SegmentPart; value: string } => {\n if (segment.part === null || segment.value === null) return false;\n if (segment.part === 'timeZoneName' && (!isZonedDateTime(props.dateRef) || hideTimeZone)) return false;\n\n return true;\n });\n\n return segmentContentArr;\n}\n\ntype CreateContentProps = CreateContentObjProps;\n\nexport function createContent(props: CreateContentProps) {\n const contentObj = createContentObj(props);\n\n const contentArr = createContentArr({\n contentObj,\n ...props\n });\n\n return {\n obj: contentObj,\n arr: contentArr\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 SPACE_CODE = 'Space';\n","import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BACKSPACE, ENTER, SPACE } from '../kbd-constants';\n\nexport function isSegmentNavigationKey(key: string) {\n if (key === ARROW_RIGHT || key === ARROW_LEFT) return true;\n return false;\n}\n\nexport function isNumberString(value: string) {\n if (Number.isNaN(Number.parseInt(value))) return false;\n return true;\n}\n\nexport function isAcceptableSegmentKey(key: string) {\n const acceptableSegmentKeys = [\n ENTER,\n ARROW_UP,\n ARROW_DOWN,\n ARROW_LEFT,\n ARROW_RIGHT,\n BACKSPACE,\n SPACE,\n 'a',\n 'A',\n 'p',\n 'P'\n ];\n if (acceptableSegmentKeys.includes(key)) return true;\n if (isNumberString(key)) return true;\n return false;\n}\n\nexport function getSegmentElements(parentElement: HTMLElement): Element[] {\n return Array.from(parentElement.querySelectorAll('[data-rdx-date-field-segment]')).filter(\n (item) => item.getAttribute('data-rdx-date-field-segment') !== 'literal'\n );\n}\n","/*\n * Implementation ported from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/internal/helpers/date/types.ts\n */\n\nimport type { DateValue } from '@internationalized/date';\nimport { DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS } from './parts';\n\nexport type DateMatcher = (date: DateValue) => boolean;\n\nexport type DateStep = {\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n millisecond?: number;\n};\n\nexport type DateRange = {\n start: DateValue | undefined;\n end: DateValue | undefined;\n};\n\nexport type HourCycle = 12 | 24 | undefined;\n\nexport type Month<T> = {\n /**\n * A `DateValue` used to represent the month. Since days\n * from the previous and next months may be included in the\n * calendar grid, we need a source of truth for the value\n * the grid is representing.\n */\n value: DateValue;\n\n /**\n * An array of (rows) arrays representing the weeks in the calendar.\n * Each sub-array represents a week, and contains the dates for each\n * day in that week. This structure is useful for rendering the calendar\n * grid using a table, where each row represents a week and each cell\n * represents a day.\n */\n weeks: T[][];\n\n /**\n * An array of (cells) all the dates in the current month, including dates from\n * the previous and next months that are used to fill out the calendar grid.\n * This array is useful for rendering the calendar grid in a customizable way,\n * as it provides all the dates that should be displayed in the grid in a flat\n * array.\n */\n dates: T[];\n};\n\nexport type DateSegmentPart = (typeof DATE_SEGMENT_PARTS)[number];\nexport type TimeSegmentPart = (typeof TIME_SEGMENT_PARTS)[number];\nexport type EditableSegmentPart = (typeof EDITABLE_SEGMENT_PARTS)[number];\nexport type NonEditableSegmentPart = (typeof NON_EDITABLE_SEGMENT_PARTS)[number];\nexport type SegmentPart = EditableSegmentPart | NonEditableSegmentPart;\n\nexport type AnyExceptLiteral = Exclude<SegmentPart, 'literal'>;\n\nexport type DayPeriod = 'AM' | 'PM' | null;\nexport type DateSegmentObj = {\n [K in DateSegmentPart]: number | null;\n};\n\nexport type TimeSegmentObj = {\n [K in TimeSegmentPart]: K extends 'dayPeriod' ? DayPeriod : number | null;\n};\nexport type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj;\nexport type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj;\nexport type SegmentContentObj = Record<EditableSegmentPart, string>;\n","// https://github.com/unovue/reka-ui/blob/v2/packages/core/src/shared/date/useDateField.ts\n\nimport { computed, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { CalendarDateTime, CycleTimeOptions, DateFields, DateValue, TimeFields } from '@internationalized/date';\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BACKSPACE, SHIFT, TAB } from '../kbd-constants';\nimport { getDaysInMonth, toDate } from './comparators';\nimport { Formatter } from './formatter';\nimport { isAcceptableSegmentKey, isNumberString, isSegmentNavigationKey } from './segment';\nimport { AnyExceptLiteral, DateAndTimeSegmentObj, DateStep, HourCycle, SegmentPart, SegmentValueObj } from './types';\n\n/** Convert a canonical 24-hour value (0-23) to its 12-hour clock equivalent (1-12). */\nfunction to12Hour(hour: number): number {\n const h = hour % 12;\n return h === 0 ? 12 : h;\n}\n\n/** Combine a 12-hour clock value (1-12) with a day period into a canonical 24-hour value (0-23). */\nfunction to24Hour(hour: number, period: 'AM' | 'PM'): number {\n const h = hour % 12;\n return period === 'PM' ? h + 12 : h;\n}\n\n/** The day period a canonical 24-hour value belongs to. */\nfunction dayPeriodForHour(hour: number): 'AM' | 'PM' {\n return hour >= 12 ? 'PM' : 'AM';\n}\n\ntype MinuteSecondIncrementProps = {\n e: KeyboardEvent;\n part: keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n};\n\ntype DateTimeValueIncrementation = {\n e: KeyboardEvent;\n part: keyof Omit<DateFields, 'era'> | keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n hourCycle?: HourCycle;\n};\n\nexport type UseDateFieldProps = {\n hasLeftFocus: WritableSignal<boolean>;\n lastKeyZero: WritableSignal<boolean>;\n placeholder: ModelSignal<DateValue> | WritableSignal<DateValue>;\n hourCycle: HourCycle;\n formatter: Formatter;\n segmentValues: WritableSignal<SegmentValueObj>;\n step: Signal<DateStep>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n part: SegmentPart;\n modelValue: ModelSignal<DateValue | undefined> | WritableSignal<DateValue | undefined>;\n focusNext: () => void;\n};\n\ntype SegmentAttrProps = {\n disabled: boolean;\n segmentValues: SegmentValueObj;\n hourCycle: HourCycle;\n placeholder: DateValue;\n formatter: Formatter;\n};\n\nfunction commonSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: 'spinbutton',\n contenteditable: true,\n tabindex: props.disabled ? undefined : 0,\n spellcheck: false,\n inputmode: 'numeric',\n autocorrect: 'off',\n enterkeyhint: 'next',\n style: 'caret-color: transparent;'\n };\n}\n\ntype NumericSegmentConfig = {\n field: 'day' | 'month' | 'year' | 'hour' | 'minute' | 'second';\n label: string;\n valueMin: number;\n valueMax: number | ((date: DateValue) => number);\n valueText?: (date: DateValue) => string;\n /** Time parts only exist on date-time values; bail out when the segment is absent. */\n timePart?: boolean;\n};\n\n/**\n * Shared spinbutton attributes for the numeric segments (day/month/year/hour/minute/second).\n * Each segment differs only in its field, bounds, label and optional value-text formatting.\n */\nfunction numericSegmentAttrs(props: SegmentAttrProps, config: NumericSegmentConfig) {\n const { segmentValues, placeholder } = props;\n const { field } = config;\n\n if (config.timePart && (!(field in segmentValues) || !(field in placeholder))) return {};\n\n const value = (segmentValues as Record<string, number | null>)[field];\n const isEmpty = value == null;\n const date = value != null ? placeholder.set({ [field]: value } as Partial<DateFields & TimeFields>) : placeholder;\n const valueNow = (date as unknown as Record<string, number>)[field];\n const valueMax = typeof config.valueMax === 'function' ? config.valueMax(date) : config.valueMax;\n const valueText = isEmpty ? 'Empty' : (config.valueText?.(date) ?? `${valueNow}`);\n\n return {\n ...commonSegmentAttrs(props),\n 'aria-label': config.label,\n 'aria-valuemin': config.valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText,\n 'data-placeholder': isEmpty ? '' : undefined\n };\n}\n\nfunction daySegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'day',\n label: 'day,',\n valueMin: 1,\n valueMax: (date) => getDaysInMonth(date)\n });\n}\n\nfunction monthSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'month',\n label: 'month, ',\n valueMin: 1,\n valueMax: 12,\n valueText: (date) => `${date.month} - ${props.formatter.fullMonth(toDate(date))}`\n });\n}\n\nfunction yearSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, { field: 'year', label: 'year, ', valueMin: 1, valueMax: 9999 });\n}\n\nfunction hourSegmentAttrs(props: SegmentAttrProps) {\n const is12h = props.hourCycle === 12;\n return numericSegmentAttrs(props, {\n field: 'hour',\n label: 'hour, ',\n valueMin: is12h ? 1 : 0,\n valueMax: is12h ? 12 : 23,\n valueText: (date) =>\n `${(date as CalendarDateTime).hour} ${(props.segmentValues as DateAndTimeSegmentObj).dayPeriod ?? ''}`,\n timePart: true\n });\n}\n\nfunction minuteSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'minute',\n label: 'minute, ',\n valueMin: 0,\n valueMax: 59,\n timePart: true\n });\n}\n\nfunction secondSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'second',\n label: 'second, ',\n valueMin: 0,\n valueMax: 59,\n timePart: true\n });\n}\n\nfunction dayPeriodSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues } = props;\n if (!('dayPeriod' in segmentValues)) return {};\n\n const valueMin = 0;\n const valueMax = 12;\n const valueNow =\n segmentValues.hour != null ? (segmentValues.hour > 12 ? segmentValues.hour - 12 : segmentValues.hour) : 0;\n const valueText = segmentValues.dayPeriod ?? 'AM';\n\n return {\n ...commonSegmentAttrs(props),\n inputmode: 'text',\n 'aria-label': 'AM/PM',\n 'aria-valuemin': valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText\n };\n}\n\nfunction literalSegmentAttrs(_props: SegmentAttrProps) {\n return {\n 'aria-hidden': true,\n 'data-segment': 'literal'\n };\n}\n\nfunction timeZoneSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: 'textbox',\n 'aria-label': 'timezone, ',\n 'data-readonly': true,\n 'data-segment': 'timeZoneName',\n tabindex: props.disabled ? undefined : 0,\n style: 'caret-color: transparent;'\n };\n}\n\nfunction eraSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n\n const valueMin = 0;\n const valueMax = 0;\n const valueNow = 0;\n const valueText = 'era' in segmentValues ? segmentValues.era : placeholder.era;\n\n return {\n ...commonSegmentAttrs(props),\n 'aria-label': 'era',\n 'aria-valuemin': valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText\n };\n}\n\nexport const segmentBuilders = {\n day: {\n attrs: daySegmentAttrs\n },\n month: {\n attrs: monthSegmentAttrs\n },\n year: {\n attrs: yearSegmentAttrs\n },\n hour: {\n attrs: hourSegmentAttrs\n },\n minute: {\n attrs: minuteSegmentAttrs\n },\n second: {\n attrs: secondSegmentAttrs\n },\n dayPeriod: {\n attrs: dayPeriodSegmentAttrs\n },\n literal: {\n attrs: literalSegmentAttrs\n },\n timeZoneName: {\n attrs: timeZoneSegmentAttrs\n },\n era: {\n attrs: eraSegmentAttrs\n }\n};\n\nexport function useDateField(props: UseDateFieldProps) {\n function handleSegmentClick(e: MouseEvent) {\n const disabled = props.disabled();\n if (disabled) e.preventDefault();\n }\n\n function deleteValue(prevValue: number | null) {\n props.hasLeftFocus.set(false);\n\n if (prevValue === null) return prevValue;\n\n const str = prevValue.toString();\n if (str.length === 1) {\n props.modelValue.set(undefined);\n return null;\n }\n\n return Number.parseInt(str.slice(0, -1));\n }\n\n function dateTimeValueIncrementation({\n e,\n part,\n dateRef,\n prevValue,\n hourCycle\n }: DateTimeValueIncrementation): number {\n const step = props.step()[part] ?? 1;\n const sign = e.key === ARROW_UP ? step : -step;\n\n if (prevValue === null) return dateRef[part as keyof Omit<DateFields, 'era'>];\n\n if (part === 'hour' && 'hour' in dateRef) {\n const cycleArgs: [keyof DateFields | keyof TimeFields, number, CycleTimeOptions?] = [\n part,\n sign,\n { hourCycle }\n ];\n return dateRef.set({ [part as keyof DateValue]: prevValue }).cycle(...cycleArgs)[part];\n }\n\n const cycleArgs: [keyof DateFields, number] = [part as keyof DateFields, sign];\n if (part === 'day' && props.segmentValues().month !== null)\n return dateRef\n .set({ [part as keyof DateValue]: prevValue, month: props.segmentValues().month! })\n .cycle(...cycleArgs)[part as keyof Omit<DateFields, 'era'>];\n\n return dateRef.set({ [part as keyof DateValue]: prevValue }).cycle(...cycleArgs)[\n part as keyof Omit<DateFields, 'era'>\n ];\n }\n\n /**\n * Shared two-digit entry state machine for the numeric segments (day, month, hour,\n * minute, second). Types one digit into `prev`, deciding the new value and whether focus\n * should advance to the next segment.\n *\n * @param emptyZero what a leading `0` produces on an empty segment — `0` for time parts\n * (midnight/`:00` are valid), `null` for day/month (no zeroth day/month).\n * @param moveOnOverflow also advance focus when the two-digit total exceeds `max`\n * (day/month behavior; time parts only advance on `num > maxStart`).\n */\n function updateNumberSegment(\n num: number,\n prev: number | null,\n max: number,\n { emptyZero = true, moveOnOverflow = false }: { emptyZero?: boolean; moveOnOverflow?: boolean } = {}\n ): { value: number | null; moveToNext: boolean } {\n let moveToNext = false;\n const maxStart = Math.floor(max / 10);\n\n // If the user has left the segment, reset `prev` so typing restarts the segment.\n if (props.hasLeftFocus()) {\n props.hasLeftFocus.set(false);\n prev = null;\n }\n\n if (prev === null) {\n // A leading 0 is tracked so the next digit can advance to the next segment.\n if (num === 0) {\n props.lastKeyZero.set(true);\n return { value: emptyZero ? 0 : null, moveToNext };\n }\n // If the last key was 0, or the first digit can't start a valid two-digit number\n // (> the max start digit), advance to the next segment.\n if (props.lastKeyZero() || num > maxStart) {\n moveToNext = true;\n }\n props.lastKeyZero.set(false);\n return { value: num, moveToNext };\n }\n\n // Either the segment already holds two digits, or appending this digit overflows `max`:\n // reset the segment as if backspaced and then typed.\n const digits = prev.toString().length;\n const total = Number.parseInt(prev.toString() + num.toString());\n\n if (digits === 2 || total > max) {\n if (num > maxStart || (moveOnOverflow && total > max)) {\n moveToNext = true;\n }\n return { value: num, moveToNext };\n }\n\n moveToNext = true;\n return { value: total, moveToNext };\n }\n\n function updateDayOrMonth(max: number, num: number, prev: number | null) {\n return updateNumberSegment(num, prev, max, { emptyZero: false, moveOnOverflow: true });\n }\n\n function updateYear(num: number, prev: number | null) {\n let moveToNext = false;\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n // probably not implement, kind of weird\n if (props.hasLeftFocus()) {\n props.hasLeftFocus.set(false);\n prev = null;\n }\n\n if (prev === null) return { value: num === 0 ? 1 : num, moveToNext };\n\n const str = prev.toString() + num.toString();\n\n if (str.length > 4) return { value: num === 0 ? 1 : num, moveToNext };\n\n if (str.length === 4) moveToNext = true;\n\n const int = Number.parseInt(str);\n return { value: int, moveToNext };\n }\n\n function updateHour(num: number, prev: number | null, max: number) {\n return updateNumberSegment(num, prev, max);\n }\n\n function updateMinuteOrSecond(num: number, prev: number | null) {\n return updateNumberSegment(num, prev, 59);\n }\n\n function minuteSecondIncrementation({ e, part, dateRef, prevValue }: MinuteSecondIncrementProps): number {\n const step = props.step()[part] ?? 1;\n const sign = e.key === ARROW_UP ? step : -step;\n const min = 0;\n const max = 59;\n\n if (prevValue === null) return sign > 0 ? min : max;\n\n const cycleArgs: [keyof TimeFields, number] = [part, sign];\n return (dateRef as CalendarDateTime).set({ [part]: prevValue }).cycle(...cycleArgs)[part];\n }\n\n const attributes = computed(\n () =>\n segmentBuilders[props.part]?.attrs({\n disabled: props.disabled(),\n placeholder: props.placeholder(),\n hourCycle: props.hourCycle,\n segmentValues: props.segmentValues(),\n formatter: props.formatter\n }) ?? {}\n );\n\n function handleMonthSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().month;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n month: dateTimeValueIncrementation({\n e,\n part: 'month',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateDayOrMonth(12, num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, month: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, month: deleteValue(prevValue) }));\n }\n }\n\n function handleDaySegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().day;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n day: dateTimeValueIncrementation({\n e,\n part: 'day',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const segmentMonthValue = props.segmentValues().month;\n\n const daysInMonth = segmentMonthValue\n ? getDaysInMonth(props.placeholder().set({ month: segmentMonthValue }))\n : getDaysInMonth(props.placeholder());\n\n const { value, moveToNext } = updateDayOrMonth(daysInMonth, num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, day: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, day: deleteValue(prevValue) }));\n }\n }\n\n function handleYearSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().year;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n year: dateTimeValueIncrementation({\n e,\n part: 'year',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateYear(num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, year: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, year: deleteValue(prevValue) }));\n }\n }\n\n function handleHourSegmentKeydown(e: KeyboardEvent) {\n const dateRef = props.placeholder();\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n if (\n !isAcceptableSegmentKey(e.key) ||\n isSegmentNavigationKey(e.key) ||\n !('hour' in dateRef) ||\n !('hour' in values)\n )\n return;\n\n const prevValue = values.hour;\n\n const hourCycle = props.hourCycle;\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n props.segmentValues.update((prev) => ({\n ...prev,\n hour: dateTimeValueIncrementation({\n e,\n part: 'hour',\n dateRef: props.placeholder(),\n prevValue,\n hourCycle\n })\n }));\n\n // Keep the day period in sync with the (just-updated) 24-hour value.\n const updatedHour = (props.segmentValues() as DateAndTimeSegmentObj).hour;\n if ('dayPeriod' in props.segmentValues() && updatedHour != null) {\n props.segmentValues.update((prev) => ({ ...prev, dayPeriod: dayPeriodForHour(updatedHour) }));\n }\n\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const is12h = hourCycle === 12;\n const period: 'AM' | 'PM' = (values.dayPeriod as 'AM' | 'PM') ?? 'AM';\n\n // Run the two-digit entry machine in the user-visible clock space (1-12 in 12h\n // mode, 0-23 otherwise), then store the canonical 24-hour value. The day period\n // is owned by its own segment, so typing the hour must not flip it.\n const prevDisplay = prevValue === null ? null : is12h ? to12Hour(prevValue) : prevValue;\n const { value, moveToNext } = updateHour(num, prevDisplay, is12h ? 12 : 23);\n const hour = value === null ? null : is12h ? to24Hour(value, period) : value;\n\n props.segmentValues.update((prev) => ({ ...prev, hour }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, hour: deleteValue(prevValue) }));\n }\n }\n\n // Minute and second segments behave identically; only the field differs.\n function handleMinuteOrSecondSegmentKeydown(e: KeyboardEvent, part: 'minute' | 'second') {\n const dateRef = props.placeholder();\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key) || !(part in dateRef) || !(part in values))\n return;\n\n const prevValue = values[part];\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n const next = minuteSecondIncrementation({ e, part, dateRef: props.placeholder(), prevValue });\n props.segmentValues.update((prev) => ({ ...prev, [part]: next }));\n }\n\n if (isNumberString(e.key)) {\n const { value, moveToNext } = updateMinuteOrSecond(Number.parseInt(e.key), prevValue);\n props.segmentValues.update((prev) => ({ ...prev, [part]: value }));\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, [part]: deleteValue(prevValue) }));\n }\n }\n\n function handleDayPeriodSegmentKeydown(e: KeyboardEvent) {\n if (\n ((!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) && e.key !== 'a' && e.key !== 'p') ||\n !('hour' in props.placeholder()) ||\n !('dayPeriod' in props.segmentValues())\n )\n return;\n\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n const setPeriod = (period: 'AM' | 'PM') => {\n if (values.dayPeriod === period) return;\n // Re-anchor the canonical 24-hour value to the new period without ever leaving\n // range; keep it null while the hour segment is still empty.\n const hour = values.hour == null ? null : to24Hour(to12Hour(values.hour), period);\n props.segmentValues.update((prev) => ({ ...prev, dayPeriod: period, hour }));\n };\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n setPeriod(values.dayPeriod === 'AM' ? 'PM' : 'AM');\n return;\n }\n\n if (['a', 'A'].includes(e.key)) {\n setPeriod('AM');\n return;\n }\n\n if (['p', 'P'].includes(e.key)) {\n setPeriod('PM');\n }\n }\n\n function handleSegmentKeydown(e: KeyboardEvent) {\n const disabled = props.disabled();\n const readonly = props.readonly();\n\n if (e.key !== TAB) e.preventDefault();\n\n if (disabled || readonly) return;\n\n const segmentKeydownHandlers = {\n month: handleMonthSegmentKeydown,\n day: handleDaySegmentKeydown,\n year: handleYearSegmentKeydown,\n hour: handleHourSegmentKeydown,\n minute: (e: KeyboardEvent) => handleMinuteOrSecondSegmentKeydown(e, 'minute'),\n second: (e: KeyboardEvent) => handleMinuteOrSecondSegmentKeydown(e, 'second'),\n dayPeriod: handleDayPeriodSegmentKeydown,\n timeZoneName: () => {}\n } as const;\n\n segmentKeydownHandlers[props.part as keyof typeof segmentKeydownHandlers](e);\n\n if (\n ![ARROW_LEFT, ARROW_RIGHT].includes(e.key) &&\n e.key !== TAB &&\n e.key !== SHIFT &&\n isAcceptableSegmentKey(e.key)\n ) {\n if (Object.values(props.segmentValues()).every((item) => item !== null)) {\n const updateObject = { ...(props.segmentValues() as Record<AnyExceptLiteral, number>) };\n\n let dateRef = props.placeholder().copy();\n\n Object.keys(updateObject).forEach((part) => {\n const value = updateObject[part as AnyExceptLiteral];\n dateRef = dateRef.set({ [part]: value });\n });\n\n props.modelValue.set(dateRef.copy());\n }\n }\n }\n\n return {\n handleSegmentClick,\n handleSegmentKeydown,\n attributes\n };\n}\n","export function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEvent extends Event>(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent<infer D> ? D : never)\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, {\n bubbles: false,\n cancelable: true,\n detail\n });\n if (handler) target.addEventListener(name, handler, { once: true });\n\n target.dispatchEvent(event);\n}\n","import { APP_ID, inject, Injectable } from '@angular/core';\n\n/**\n * Per-prefix counters, kept module-global so generated IDs stay deterministic within a run.\n * Determinism keeps server and client renders in sync, which matters for hydration.\n */\nconst counters = new Map<string, number>();\n\n/**\n * Generates unique, SSR-stable IDs for DOM nodes.\n *\n * IDs are deterministic per prefix (a monotonic counter) so the server and the client produce the\n * same sequence and hydration does not mismatch. The application's `APP_ID` is folded into the\n * prefix so multiple Angular apps on one page don't collide; the default `ng` app id is omitted to\n * keep IDs short for the common single-app case.\n *\n * Prefer the {@link injectId} hook at call sites; inject this service directly only when you need to\n * generate IDs lazily outside an injection context.\n */\n@Injectable({ providedIn: 'root' })\nexport class RdxIdGenerator {\n private readonly appId = inject(APP_ID);\n\n /** Generates a unique ID with the given prefix. */\n getId(prefix: string): string {\n const key = this.appId === 'ng' ? prefix : prefix + this.appId;\n const next = counters.get(key) ?? 0;\n counters.set(key, next + 1);\n\n return `${key}${next}`;\n }\n}\n\n/**\n * Returns a unique, SSR-stable ID for the given prefix — the Angular counterpart of React's\n * `useId`. Must be called in an injection context (e.g. a field initializer or constructor).\n *\n * @example\n * readonly contentId = injectId('rdx-dialog-content-');\n */\nexport function injectId(prefix: string): string {\n return inject(RdxIdGenerator).getId(prefix);\n}\n","/** Narrows to `null | undefined`. */\nexport function isNullish(value: any): value is null | undefined {\n return value === null || value === undefined;\n}\n\n/**\n * Structural equality for the value shapes a primitive can hold: primitives (incl. `NaN`), arrays,\n * plain objects, and the common built-ins `Date`, `RegExp`, `Map`, and `Set`. Reference cycles are\n * handled. Other opaque objects (e.g. class instances with no own enumerable properties) fall back\n * to per-key comparison and so only match when they expose equal enumerable state.\n */\nexport function isEqual(a: any, b: any): boolean {\n return equals(a, b, new WeakMap());\n}\n\nfunction equals(a: any, b: any, seen: WeakMap<object, unknown>): boolean {\n if (a === b) {\n return true;\n }\n\n // NaN is the one primitive that is not reference-equal to itself.\n if (typeof a === 'number' && typeof b === 'number') {\n return Number.isNaN(a) && Number.isNaN(b);\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n return false;\n }\n\n // Different prototypes (Date vs plain object, class A vs class B, …) are never structurally equal.\n if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) {\n return false;\n }\n\n // Break reference cycles: if this exact pair is already being compared on the current path,\n // the structure has matched so far — treat it as equal. Cleared on ascent so sibling branches\n // start fresh.\n if (seen.get(a) === b) {\n return true;\n }\n seen.set(a, b);\n\n try {\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (Array.isArray(a)) {\n return a.length === b.length && a.every((item: unknown, index: number) => equals(item, b[index], seen));\n }\n\n if (a instanceof Map) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const [key, value] of a) {\n if (!b.has(key) || !equals(value, b.get(key), seen)) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a instanceof Set) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const value of a) {\n if (!b.has(value)) {\n return false;\n }\n }\n\n return true;\n }\n\n const keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n\n return keys.every((key) => Object.prototype.hasOwnProperty.call(b, key) && equals(a[key], b[key], seen));\n } finally {\n seen.delete(a);\n }\n}\n","import { isEqual, isNullish } from './predicates';\n\n/**\n * A comparator for list-item values, aligned with Base UI's `isItemEqualToValue` naming.\n *\n * - a **function** `(a, b) => boolean` — full control over equality;\n * - a **string** — an object key whose values are compared with {@link isEqual} (Reka-style `by`);\n * - omitted — structural deep equality via {@link isEqual}.\n */\nexport type ItemValueComparator<T = unknown> = ((a: T, b: T) => boolean) | string;\n\n/**\n * Converts an item value to the string shown to the user.\n *\n * Strings pass through unchanged; `null`/`undefined` become an empty string; everything else is\n * coerced with `String()`. Primitives that hold object values (e.g. combobox) typically pass their\n * own `itemToStringLabel` to render a field off the object instead.\n */\nexport function itemToStringLabel(value: unknown): string {\n if (typeof value === 'string') {\n return value;\n }\n if (isNullish(value)) {\n return '';\n }\n return String(value);\n}\n\n/**\n * Converts an item value to the string used for form serialization. Defaults to the same rules as\n * {@link itemToStringLabel}; kept as a separate export so a primitive can diverge label vs. value.\n */\nexport function itemToStringValue(value: unknown): string {\n return itemToStringLabel(value);\n}\n\n/**\n * Compares two item values for equality using an optional {@link ItemValueComparator}.\n *\n * @example\n * isItemEqualToValue({ id: 1 }, { id: 1 }, 'id'); // true — compares the `id` key\n * isItemEqualToValue({ id: 1 }, { id: 1 }); // true — deep equality fallback\n */\nexport function isItemEqualToValue<T>(a: T, b: T, comparator?: ItemValueComparator<T>): boolean {\n if (typeof comparator === 'function') {\n return comparator(a, b);\n }\n\n if (typeof comparator === 'string') {\n if (isNullish(a) || isNullish(b)) {\n return a === b;\n }\n return isEqual((a as Record<string, unknown>)[comparator], (b as Record<string, unknown>)[comparator]);\n }\n\n return isEqual(a, b);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\nexport type AriaLivePoliteness = 'off' | 'polite' | 'assertive';\n\n/**\n * Announces messages to screen readers through an `aria-live` region, without moving focus.\n *\n * Own replacement for CDK's `LiveAnnouncer` — lazily appends a visually hidden live region to\n * the document body and writes messages into it. No-op on the server.\n */\n@Injectable({ providedIn: 'root' })\nexport class RdxLiveAnnouncer {\n private readonly document = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private liveElement: HTMLElement | null = null;\n private previousTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n clearTimeout(this.previousTimeout);\n this.liveElement?.remove();\n this.liveElement = null;\n });\n }\n\n /**\n * Announces a message to screen readers.\n *\n * @param message The message to announce.\n * @param politeness The politeness of the announcer element (defaults to `'polite'`).\n * @param duration If provided, the message is cleared after this many milliseconds.\n */\n announce(message: string, politeness: AriaLivePoliteness = 'polite', duration?: number): void {\n if (!this.isBrowser) {\n return;\n }\n\n const liveElement = this.getLiveElement();\n\n clearTimeout(this.previousTimeout);\n\n liveElement.setAttribute('aria-live', politeness);\n\n // Clear the live element first, then set the message after a tick so that screen\n // readers reliably pick up the change even when the text is identical.\n liveElement.textContent = '';\n this.previousTimeout = setTimeout(() => {\n liveElement.textContent = message;\n\n if (typeof duration === 'number') {\n this.previousTimeout = setTimeout(() => (liveElement.textContent = ''), duration);\n }\n });\n }\n\n /** Clears the current announcement. */\n clear(): void {\n if (this.liveElement) {\n this.liveElement.textContent = '';\n }\n }\n\n private getLiveElement(): HTMLElement {\n if (this.liveElement) {\n return this.liveElement;\n }\n\n const element = this.document.createElement('div');\n element.classList.add('rdx-live-announcer');\n element.setAttribute('aria-atomic', 'true');\n element.setAttribute('aria-live', 'polite');\n\n // Visually hide the region while keeping it available to assistive technology.\n element.style.position = 'absolute';\n element.style.width = '1px';\n element.style.height = '1px';\n element.style.margin = '-1px';\n element.style.padding = '0';\n element.style.border = '0';\n element.style.overflow = 'hidden';\n element.style.clip = 'rect(0 0 0 0)';\n element.style.clipPath = 'inset(100%)';\n element.style.whiteSpace = 'nowrap';\n\n this.document.body.appendChild(element);\n this.liveElement = element;\n\n return element;\n }\n}\n","import { forwardRef, InjectionToken, Provider, Type } from '@angular/core';\n\n/**\n * Creates an Angular provider that binds the given token to the existing instance\n * of the specified class. This is especially useful when you want multiple\n * tokens (or interfaces) to resolve to the same directive/component instance.\n *\n * @template T - The type associated with the injection token.\n * @param token - The InjectionToken or abstract type you want to provide.\n * @param type - The class type whose existing instance will be used for this token.\n * @returns A Provider configuration object for Angular's DI system.\n *\n * @example\n *\n * @Directive({\n * providers: [\n * provideToken(RdxFooToken, RdxFooDirective),\n * provideValueAccessor(RdxFooDirective)\n * ]\n * })\n * export class RdxFooDirective {}\n */\nexport function provideToken<T>(token: InjectionToken<T>, type: Type<unknown>): Provider {\n return {\n provide: token,\n useExisting: forwardRef(() => type)\n };\n}\n","import { DOCUMENT, inject } from '@angular/core';\n\nexport function injectDocument(): Document {\n return inject(DOCUMENT);\n}\n","import { afterNextRender, DestroyRef, ElementRef, Injector, signal } from '@angular/core';\n\nexport function elementSize({ elementRef, injector }: { elementRef: ElementRef<HTMLElement>; injector: Injector }) {\n const destroyRef = injector.get(DestroyRef);\n const result = signal({\n width: elementRef.nativeElement.offsetWidth,\n height: elementRef.nativeElement.offsetHeight\n });\n\n afterNextRender(\n () => {\n const resizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n let width: number;\n let height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n width = elementRef.nativeElement.offsetWidth;\n height = elementRef.nativeElement.offsetHeight;\n }\n\n result.set({ width, height });\n });\n\n destroyRef.onDestroy(() => resizeObserver.disconnect());\n },\n { injector: injector }\n );\n\n return result.asReadonly();\n}\n","export function getActiveElement(): Element | null {\n let activeElement = document.activeElement;\n if (activeElement == null) {\n return null;\n }\n\n while (\n activeElement != null &&\n activeElement.shadowRoot != null &&\n activeElement.shadowRoot.activeElement != null\n ) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n","import { effect, EffectRef, ElementRef, Injector, Signal } from '@angular/core';\n\n/**\n * Creates a resize observer effect for element\n *\n * @param options Configuration options\n * @param options.injector Angular injector\n * @param options.element Signal returning the element to observe\n * @param options.onResize Callback when element is resized\n * @returns EffectRef that can be destroyed when needed\n */\nexport function resizeEffect(options: {\n injector: Injector;\n element: Signal<ElementRef | HTMLElement | null | undefined>;\n onResize: ResizeObserverCallback;\n}): EffectRef {\n return effect(\n (onCleanup) => {\n const elementOrRef = options.element();\n if (!elementOrRef) return;\n\n // Extract native element from ElementRef or use directly if it's HTMLElement\n const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n\n const resizeObserver = new ResizeObserver(options.onResize);\n resizeObserver.observe(element);\n\n onCleanup(() => resizeObserver.disconnect());\n },\n { injector: options.injector }\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, effect, inject, Signal } from '@angular/core';\n\n/**\n * Process-wide ownership of the document scroller's overflow while one or more overlays lock\n * scrolling.\n *\n * A single shared counter across every primitive that locks scroll is essential: with separate\n * per-primitive counters, a popover and a dialog open at the same time would each capture the\n * other's already-locked state as the \"original\" and restore it on close, leaving the page\n * permanently unscrollable.\n */\nlet original: { bodyOverflow: string; htmlOverflow: string; htmlPaddingRight: string } | null = null;\nlet scrollLockCount = 0;\n\n/**\n * Locks page scrolling while `active()` is `true`, and restores the original state when it becomes\n * `false` or the calling context is destroyed.\n *\n * Locks **both** `<body>` and `<html>`: a `body { overflow: hidden }` lock alone does *not* stop the\n * page when `<html>` is the scroller (e.g. a global `overflow-y: scroll`, as Storybook sets), because\n * body-overflow only propagates to the viewport when `<html>`'s overflow is `visible`. The width of\n * the removed scrollbar is added as `padding-right` on `<html>` so the page doesn't shift.\n *\n * Lock ownership is shared across all callers via a single module-level counter, so nested or\n * concurrent overlays compose correctly. Must be called in an injection context.\n */\nexport function useScrollLock(active: Signal<boolean>): void {\n const document = inject(DOCUMENT);\n let isLocked = false;\n\n const lock = () => {\n if (isLocked) {\n return;\n }\n\n if (scrollLockCount === 0) {\n const html = document.documentElement;\n const body = document.body;\n const win = document.defaultView;\n const scrollbarWidth = win ? Math.max(0, win.innerWidth - html.clientWidth) : 0;\n\n original = {\n bodyOverflow: body.style.overflow,\n htmlOverflow: html.style.overflow,\n htmlPaddingRight: html.style.paddingRight\n };\n\n body.style.overflow = 'hidden';\n html.style.overflow = 'hidden';\n if (scrollbarWidth > 0) {\n const currentPadding = win ? parseFloat(win.getComputedStyle(html).paddingRight) || 0 : 0;\n html.style.paddingRight = `${currentPadding + scrollbarWidth}px`;\n }\n }\n\n scrollLockCount++;\n isLocked = true;\n };\n\n const unlock = () => {\n if (!isLocked) {\n return;\n }\n\n scrollLockCount--;\n isLocked = false;\n\n if (scrollLockCount === 0 && original !== null) {\n const html = document.documentElement;\n document.body.style.overflow = original.bodyOverflow;\n html.style.overflow = original.htmlOverflow;\n html.style.paddingRight = original.htmlPaddingRight;\n original = null;\n }\n };\n\n effect(() => {\n if (active()) {\n lock();\n } else {\n unlock();\n }\n });\n\n inject(DestroyRef).onDestroy(unlock);\n}\n","// made by https://reka-ui.com/\n\nimport { Direction } from '../types';\n\ntype ArrowKeyOptions = 'horizontal' | 'vertical' | 'both';\n\ninterface ArrowNavigationOptions {\n /**\n * The arrow key options to allow navigation\n *\n * @defaultValue \"both\"\n */\n arrowKeyOptions?: ArrowKeyOptions;\n\n /**\n * The attribute name to find the collection items in the parent element.\n *\n * @defaultValue \"data-rdx-collection-item\"\n */\n attributeName?: string;\n\n /**\n * The parent element where contains all the collection items, this will collect every item to be used when nav\n * It will be ignored if attributeName is provided\n *\n * @defaultValue []\n */\n itemsArray?: HTMLElement[];\n\n /**\n * Allow loop navigation. If false, it will stop at the first and last element\n *\n * @defaultValue true\n */\n loop?: boolean;\n\n /**\n * The orientation of the collection\n *\n * @defaultValue \"ltr\"\n */\n dir?: Direction;\n\n /**\n * Prevent the scroll when navigating. This happens when the direction of the\n * key matches the scroll direction of any ancestor scrollable elements.\n *\n * @defaultValue true\n */\n preventScroll?: boolean;\n\n /**\n * By default all currentElement would trigger navigation. If `true`, currentElement nodeName in the ignore list will return null\n *\n * @defaultValue false\n */\n enableIgnoredElement?: boolean;\n\n /**\n * Focus the element after navigation\n *\n * @defaultValue false\n */\n focus?: boolean;\n}\n\nconst ignoredElement = ['INPUT', 'TEXTAREA'];\n\n/**\n * Allow arrow navigation for every html element with data-rdx-collection-item tag\n *\n * @param e Keyboard event\n * @param currentElement Event initiator element or any element that wants to handle the navigation\n * @param parentElement Parent element where contains all the collection items, this will collect every item to be used when nav\n * @param options further options\n * @returns the navigated html element or null if none\n */\nexport function useArrowNavigation(\n e: KeyboardEvent,\n currentElement: HTMLElement,\n parentElement: HTMLElement | undefined,\n options: ArrowNavigationOptions = {}\n): HTMLElement | null {\n if (!currentElement || (options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)))\n return null;\n\n const {\n arrowKeyOptions = 'both',\n attributeName = '[data-rdx-collection-item]',\n itemsArray = [],\n loop = true,\n dir = 'ltr',\n preventScroll = true,\n focus = false\n } = options;\n\n const [right, left, up, down, home, end] = [\n e.key === 'ArrowRight',\n e.key === 'ArrowLeft',\n e.key === 'ArrowUp',\n e.key === 'ArrowDown',\n e.key === 'Home',\n e.key === 'End'\n ];\n const goingVertical = up || down;\n const goingHorizontal = right || left;\n if (\n !home &&\n !end &&\n ((!goingVertical && !goingHorizontal) ||\n (arrowKeyOptions === 'vertical' && goingHorizontal) ||\n (arrowKeyOptions === 'horizontal' && goingVertical))\n ) {\n return null;\n }\n\n const allCollectionItems: HTMLElement[] = parentElement\n ? Array.from(parentElement.querySelectorAll(attributeName))\n : itemsArray;\n\n if (!allCollectionItems.length) return null;\n\n if (preventScroll) e.preventDefault();\n\n let item: HTMLElement | null = null;\n\n if (goingHorizontal || goingVertical) {\n const goForward = goingVertical ? down : dir === 'ltr' ? right : left;\n item = findNextFocusableElement(allCollectionItems, currentElement, {\n goForward,\n loop\n });\n } else if (home) {\n item = allCollectionItems.length ? allCollectionItems[0] : null;\n } else if (end) {\n item = allCollectionItems.length ? allCollectionItems[allCollectionItems.length - 1] : null;\n }\n\n if (focus) item?.focus();\n\n return item;\n}\n\ninterface FindNextFocusableElementOptions {\n /**\n * Whether to search forwards or backwards.\n */\n goForward: boolean;\n /**\n * Whether to allow looping the search. If false, it will stop at the first/last element.\n *\n * @default true\n */\n loop?: boolean;\n}\n\n/**\n * Recursive function to find the next focusable element to avoid disabled elements\n *\n * @param elements Elements to navigate\n * @param currentElement Current active element\n * @param options\n * @param iterations\n * @returns next focusable element\n */\nfunction findNextFocusableElement(\n elements: HTMLElement[],\n currentElement: HTMLElement,\n options: FindNextFocusableElementOptions,\n iterations = elements.length\n): HTMLElement | null {\n if (--iterations === 0) return null;\n\n const index = elements.indexOf(currentElement);\n const newIndex = options.goForward ? index + 1 : index - 1;\n\n if (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null;\n\n const adjustedNewIndex = (newIndex + elements.length) % elements.length;\n const candidate = elements[adjustedNewIndex];\n if (!candidate) return null;\n\n const isDisabled = candidate.hasAttribute('disabled') && candidate.getAttribute('disabled') !== 'false';\n if (isDisabled) {\n return findNextFocusableElement(elements, candidate, options, iterations);\n }\n return candidate;\n}\n","/**\n * Locale-aware string matching backed by `Intl.Collator`, mirroring Base UI's `useFilter`.\n *\n * The collator defaults to `sensitivity: 'base'`, so matching is both case-insensitive and\n * diacritic-insensitive (`\"Äpfel\"` matches `\"ap\"`, `\"résumé\"` matches `\"resume\"`). Pass `locale`\n * and/or any `Intl.Collator` options to override.\n */\nexport interface UseFilterOptions extends Intl.CollatorOptions {\n /** Locale(s) for the collator. Defaults to the runtime's default locale. */\n locale?: Intl.LocalesArgument;\n}\n\n/** Predicates returned by {@link useFilter}. An empty `query` always matches. */\nexport interface FilterPredicates {\n /** Whether `text` contains `query`. */\n contains: (text: string, query: string) => boolean;\n /** Whether `text` starts with `query`. */\n startsWith: (text: string, query: string) => boolean;\n /** Whether `text` ends with `query`. */\n endsWith: (text: string, query: string) => boolean;\n}\n\n/**\n * Creates locale-aware `contains` / `startsWith` / `endsWith` predicates.\n *\n * Matching uses `Intl.Collator` with `sensitivity: 'base'` and `usage: 'search'` by default, so\n * comparisons ignore case and diacritics. An empty (or whitespace-only) `query` matches everything,\n * which is the natural \"no filter applied\" state for a combobox.\n *\n * @example\n * const { contains } = useFilter();\n * contains('Äpfel', 'ap'); // true\n */\nexport function useFilter(options?: UseFilterOptions): FilterPredicates {\n const { locale, ...collatorOptions } = options ?? {};\n const collator = new Intl.Collator(locale, {\n usage: 'search',\n sensitivity: 'base',\n ...collatorOptions\n });\n\n // `Intl.Collator` only compares whole strings, so we scan every substring window of `text`\n // the same length as `query` and treat a collator match as a hit. This keeps the locale rules\n // (case/diacritic folding) consistent with `===`-style equality the collator provides.\n const matchesAt = (text: string, query: string, start: number): boolean =>\n collator.compare(text.slice(start, start + query.length), query) === 0;\n\n const isEmpty = (query: string): boolean => query.length === 0;\n\n return {\n contains(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n for (let i = 0; i + query.length <= text.length; i++) {\n if (matchesAt(text, query, i)) {\n return true;\n }\n }\n return false;\n },\n startsWith(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n return query.length <= text.length && matchesAt(text, query, 0);\n },\n endsWith(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n return query.length <= text.length && matchesAt(text, query, text.length - query.length);\n }\n };\n}\n","import { effect, signal, type Signal, type WritableSignal } from '@angular/core';\n\ntype Side = 'top' | 'right' | 'bottom' | 'left';\n\nconst graceAreaContainers = new WeakMap<HTMLElement, HTMLElement>();\n\nfunction createSignalEvent<T = void>() {\n const handlers = new Set<(value: T) => void>();\n\n return {\n on(callback: (value: T) => void): () => void {\n handlers.add(callback);\n return () => handlers.delete(callback);\n },\n emitVoid(): void {\n handlers.forEach((handler) => handler(undefined as unknown as T));\n }\n };\n}\n\n/**\n * Keeps hover content open while the pointer crosses the gap between a trigger and a popup.\n */\nexport function useGraceArea(\n triggerEl: Signal<HTMLElement | null | undefined>,\n containerEl: Signal<HTMLElement | null | undefined>,\n resetMs = 300\n) {\n const isPointerInTransit: WritableSignal<boolean> = signal(false);\n const pointerExit = createSignalEvent<void>();\n\n let pointerGraceArea: Polygon | null = null;\n let resetTimer: number | null = null;\n\n function armInTransitAutoReset() {\n if (resetTimer !== null) window.clearTimeout(resetTimer);\n resetTimer = window.setTimeout(() => {\n isPointerInTransit.set(false);\n resetTimer = null;\n }, resetMs);\n }\n\n function clearGraceArea() {\n pointerGraceArea = null;\n isPointerInTransit.set(false);\n\n if (resetTimer !== null) {\n window.clearTimeout(resetTimer);\n resetTimer = null;\n }\n }\n\n function createGraceArea(event: PointerEvent, hoverTarget: HTMLElement) {\n const currentTarget = event.currentTarget as HTMLElement;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n pointerGraceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n isPointerInTransit.set(true);\n armInTransitAutoReset();\n }\n\n function trackPointerGrace(event: PointerEvent) {\n if (!pointerGraceArea || !(event.target instanceof HTMLElement)) return;\n\n const trigger = triggerEl();\n const container = containerEl();\n if (!trigger || !container) return;\n\n const target = event.target;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const enteredContainer = target.closest<HTMLElement>('[data-grace-area-container]');\n const nestedTrigger = enteredContainer ? graceAreaContainers.get(enteredContainer) : undefined;\n const hasEnteredTarget =\n trigger.contains(target) ||\n container.contains(target) ||\n (nestedTrigger ? container.contains(nestedTrigger) : false);\n const isOutsideGrace = !isPointInPolygon(pointerPosition, pointerGraceArea);\n const isAnotherGraceAreaTrigger = !!target.closest('[data-grace-area-trigger]');\n\n if (hasEnteredTarget) {\n clearGraceArea();\n } else if (isOutsideGrace || isAnotherGraceAreaTrigger) {\n clearGraceArea();\n pointerExit.emitVoid();\n }\n }\n\n effect((onCleanup) => {\n const trigger = triggerEl();\n const container = containerEl();\n const onTriggerLeave = (event: PointerEvent) => {\n if (container) createGraceArea(event, container);\n };\n const onContainerLeave = (event: PointerEvent) => {\n if (trigger) createGraceArea(event, trigger);\n };\n\n onCleanup(() => {\n const doc = trigger?.ownerDocument;\n trigger?.removeEventListener('pointerleave', onTriggerLeave as EventListener);\n container?.removeEventListener('pointerleave', onContainerLeave as EventListener);\n doc?.removeEventListener('pointermove', trackPointerGrace as EventListener);\n trigger?.removeAttribute('data-grace-area-trigger');\n container?.removeAttribute('data-grace-area-container');\n\n if (container && graceAreaContainers.get(container) === trigger) {\n graceAreaContainers.delete(container);\n }\n\n clearGraceArea();\n });\n\n if (!trigger || !container) return;\n\n trigger.setAttribute('data-grace-area-trigger', '');\n container.setAttribute('data-grace-area-container', '');\n graceAreaContainers.set(container, trigger);\n\n trigger.addEventListener('pointerleave', onTriggerLeave as EventListener, { passive: true });\n container.addEventListener('pointerleave', onContainerLeave as EventListener, { passive: true });\n trigger.ownerDocument.addEventListener('pointermove', trackPointerGrace as EventListener, { passive: true });\n });\n\n return {\n isPointerInTransit: isPointerInTransit.asReadonly(),\n onPointerExit: pointerExit.on\n };\n}\n\ninterface Point {\n x: number;\n y: number;\n}\n\ntype Polygon = Point[];\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect): Side {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n const min = Math.min(top, bottom, right, left);\n\n if (!Number.isFinite(min)) {\n return 'bottom';\n }\n\n switch (min) {\n case left:\n return 'left';\n case right:\n return 'right';\n case top:\n return 'top';\n case bottom:\n return 'bottom';\n default:\n throw new Error('unreachable');\n }\n}\n\nfunction getPaddedExitPoints(exitPoint: Point, exitSide: Side, padding = 5) {\n const points: Point[] = [];\n\n switch (exitSide) {\n case 'top':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'bottom':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case 'left':\n points.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'right':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n\n return points;\n}\n\nfunction getPointsFromRect(rect: DOMRect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom }\n ];\n}\n\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\nfunction getHull<PointType extends Point>(points: Readonly<Array<PointType>>): Array<PointType> {\n const sortedPoints: Array<PointType> = points.slice();\n sortedPoints.sort((a, b) => a.x - b.x || a.y - b.y);\n return getHullPresorted(sortedPoints);\n}\n\nfunction getHullPresorted<PointType extends Point>(points: Readonly<Array<PointType>>): Array<PointType> {\n if (points.length <= 1) return points.slice();\n\n const upper: Array<PointType> = [];\n for (const point of points) {\n while (upper.length >= 2) {\n const q = upper[upper.length - 1];\n const r = upper[upper.length - 2];\n if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x)) upper.pop();\n else break;\n }\n upper.push(point);\n }\n upper.pop();\n\n const lower: Array<PointType> = [];\n for (let index = points.length - 1; index >= 0; index--) {\n const point = points[index];\n while (lower.length >= 2) {\n const q = lower[lower.length - 1];\n const r = lower[lower.length - 2];\n if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x)) lower.pop();\n else break;\n }\n lower.push(point);\n }\n lower.pop();\n\n if (upper.length === 1 && lower.length === 1 && upper[0].x === lower[0].x && upper[0].y === lower[0].y) {\n return upper;\n }\n\n return upper.concat(lower);\n}\n","import { computed, effect, Injector, Signal, signal, untracked } from '@angular/core';\n\n/** Options for {@link useListHighlight}. */\nexport interface UseListHighlightOptions<T> {\n /** All items in DOM order (e.g. a collection provider's `items()`). */\n items: Signal<readonly T[]>;\n /**\n * Whether an item can be highlighted — must return `false` for hidden (filtered-out) and\n * disabled items. Navigation and self-healing both consult this.\n */\n isNavigable: (item: T) => boolean;\n /** Resolves the item's element id, exposed as {@link ListHighlight.activeId} for `aria-activedescendant`. */\n getId: (item: T) => string | undefined;\n /** Whether navigation wraps at the boundaries. Defaults to `true`. */\n loop?: Signal<boolean>;\n /** Injector to bind the self-healing effect to when not called in an injection context. */\n injector?: Injector;\n}\n\n/** Highlight-model navigation API returned by {@link useListHighlight}. */\nexport interface ListHighlight<T> {\n /** The currently highlighted item, or `null`. DOM focus is never moved by this state. */\n readonly highlightedItem: Signal<T | null>;\n /** The highlighted item's element id, or `undefined`. Bind to `aria-activedescendant`. */\n readonly activeId: Signal<string | undefined>;\n /** Highlight the first navigable item. */\n first(): void;\n /** Highlight the last navigable item. */\n last(): void;\n /** Highlight the next navigable item (wraps when `loop`). */\n next(): void;\n /** Highlight the previous navigable item (wraps when `loop`). */\n previous(): void;\n /** Highlight a specific item (ignored if not navigable); pass `null` to clear. */\n set(item: T | null): void;\n /** Clear the highlight. */\n clear(): void;\n}\n\n/**\n * Highlight-model list navigation over a set of items, decoupled from DOM focus.\n *\n * Unlike roving `tabindex`, the highlight is pure state: callers move it with the keyboard while DOM\n * focus stays on a single controlling element (e.g. a combobox `<input>`), which exposes\n * {@link ListHighlight.activeId} as `aria-activedescendant`. Navigation only ever lands on items for\n * which `isNavigable` returns `true`, so hidden (filtered-out) and disabled items are skipped. A\n * self-healing effect clears the highlight if its item stops being navigable or leaves the list, so\n * `activeId` never references a detached or hidden element.\n *\n * Must be called in an injection context, or given an `injector`.\n */\nexport function useListHighlight<T>(options: UseListHighlightOptions<T>): ListHighlight<T> {\n const { items, isNavigable, getId, loop, injector } = options;\n\n const highlighted = signal<T | null>(null);\n\n const navigable = computed(() => items().filter((item) => isNavigable(item)));\n\n const activeId = computed(() => {\n const item = highlighted();\n return item === null ? undefined : getId(item);\n });\n\n const setIfNavigable = (item: T | null): void => {\n if (item === null || isNavigable(item)) {\n highlighted.set(item);\n }\n };\n\n const step = (direction: 1 | -1): void => {\n const list = navigable();\n if (list.length === 0) {\n highlighted.set(null);\n return;\n }\n\n const current = highlighted();\n const currentIndex = current === null ? -1 : list.indexOf(current);\n\n // No valid anchor → enter from the appropriate end.\n if (currentIndex === -1) {\n highlighted.set(direction === 1 ? list[0] : list[list.length - 1]);\n return;\n }\n\n let nextIndex = currentIndex + direction;\n const shouldLoop = loop ? loop() : true;\n\n if (nextIndex < 0) {\n nextIndex = shouldLoop ? list.length - 1 : 0;\n } else if (nextIndex >= list.length) {\n nextIndex = shouldLoop ? 0 : list.length - 1;\n }\n\n highlighted.set(list[nextIndex]);\n };\n\n // Self-heal: drop a highlight that is no longer navigable (filtered out, disabled, destroyed).\n effect(\n () => {\n const list = navigable();\n const current = untracked(highlighted);\n if (current !== null && !list.includes(current)) {\n highlighted.set(null);\n }\n },\n injector ? { injector } : undefined\n );\n\n return {\n highlightedItem: highlighted.asReadonly(),\n activeId,\n first() {\n const list = navigable();\n highlighted.set(list.length > 0 ? list[0] : null);\n },\n last() {\n const list = navigable();\n highlighted.set(list.length > 0 ? list[list.length - 1] : null);\n },\n next() {\n step(1);\n },\n previous() {\n step(-1);\n },\n set: setIfNavigable,\n clear() {\n highlighted.set(null);\n }\n };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { assertInInjectionContext, DestroyRef, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nexport interface RdxPointerDragHandlers {\n /** Whether a press may begin a drag (e.g. enabled, not on an opt-out element, at a scroll edge). */\n canStart: (event: PointerEvent) => boolean;\n /** A drag actually began (the pointer moved past the start threshold). */\n onStart: (event: PointerEvent) => void;\n /** Pointer moved during a drag. Return `false` to end the gesture early (treated as not committed). */\n onMove: (event: PointerEvent) => void | boolean;\n /** The drag ended. `committed` is true only for a normal `pointerup`, false for cancel/lost-capture/early-stop. */\n onEnd: (event: PointerEvent, committed: boolean) => void;\n}\n\n/** Pointer travel (px) before a press becomes a drag — below this a press stays a click/tap. */\nconst DRAG_THRESHOLD = 4;\n\n/**\n * Shared pointer-drag lifecycle for gesture primitives (drawer swipe, toast swipe, etc.).\n *\n * A press only becomes a drag once the pointer moves past {@link DRAG_THRESHOLD}; until then it is a\n * plain tap, so clicks on buttons inside the element keep working (the gesture never captures the\n * pointer for a tap). Once dragging, the pointer is captured so a drag that leaves the element still\n * completes, and `lostpointercapture` / `pointercancel` count as a non-committed end — a swallowed\n * `pointerup` (native context menu, OS gesture, tab switch) can never wedge the gesture. Only the\n * primary pointer is tracked, so a second finger can't start a parallel gesture. No-op outside the\n * browser, keeping SSR safe.\n *\n * `onEnd` is NOT called if the host is destroyed mid-drag — callers that pair `onStart`/`onEnd`\n * (e.g. to pause/resume timers) should balance that case in their own `DestroyRef` cleanup.\n *\n * Must be called from an injection context (a directive/component constructor).\n */\nexport function usePointerDrag(handlers: RdxPointerDragHandlers): void {\n assertInInjectionContext(usePointerDrag);\n\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return;\n }\n\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n let pointerId: number | null = null;\n let downEvent: PointerEvent | null = null;\n let dragging = false;\n\n const removeWindowListeners = () => {\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n window.removeEventListener('pointercancel', onPointerUp);\n };\n\n const reset = (event: PointerEvent, committed: boolean) => {\n if (pointerId === null) {\n return;\n }\n\n const wasDragging = dragging;\n\n try {\n host.releasePointerCapture?.(pointerId);\n } catch {\n // Capture may already be gone (e.g. on lostpointercapture); ignore.\n }\n\n pointerId = null;\n downEvent = null;\n dragging = false;\n removeWindowListeners();\n\n // A press that never crossed the threshold was a tap — leave the click untouched.\n if (wasDragging) {\n handlers.onEnd(event, committed);\n }\n };\n\n function onPointerMove(event: PointerEvent) {\n if (event.pointerId !== pointerId || !downEvent) {\n return;\n }\n\n if (!dragging) {\n const dx = event.clientX - downEvent.clientX;\n const dy = event.clientY - downEvent.clientY;\n\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD) {\n return;\n }\n\n dragging = true;\n\n try {\n host.setPointerCapture?.(pointerId);\n } catch {\n // Not all environments support pointer capture; the window listeners still drive the gesture.\n }\n\n handlers.onStart(downEvent);\n }\n\n if (handlers.onMove(event) === false) {\n reset(event, false);\n }\n }\n\n function onPointerUp(event: PointerEvent) {\n if (event.pointerId !== pointerId) {\n return;\n }\n\n reset(event, event.type === 'pointerup');\n }\n\n const onLostCapture = (event: PointerEvent) => {\n if (event.pointerId === pointerId) {\n reset(event, false);\n }\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (pointerId !== null || !event.isPrimary || event.button !== 0 || !handlers.canStart(event)) {\n return;\n }\n\n pointerId = event.pointerId;\n downEvent = event;\n dragging = false;\n\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n window.addEventListener('pointercancel', onPointerUp);\n };\n\n host.addEventListener('pointerdown', onPointerDown);\n host.addEventListener('lostpointercapture', onLostCapture as EventListener);\n\n inject(DestroyRef).onDestroy(() => {\n host.removeEventListener('pointerdown', onPointerDown);\n host.removeEventListener('lostpointercapture', onLostCapture as EventListener);\n removeWindowListeners();\n });\n}\n","import { afterNextRender, DestroyRef, inject, Injector, signal, Signal } from '@angular/core';\n\n/**\n * Lifecycle phase of an open/close transition.\n *\n * - `'starting'` — the part has just mounted/opened; the enter animation is about to run.\n * - `'ending'` — the part is closing; the exit animation is running.\n * - `undefined` — settled (no transition in progress).\n */\nexport type RdxTransitionStatus = 'starting' | 'ending' | undefined;\n\n/**\n * Grace period (ms) added to an element's declared transition duration before the\n * safety-net timer force-completes a transition. Only matters when the real\n * `animationend`/`transitionend` never arrives (interrupted, replaced without a\n * cancel event, reduced motion, …).\n */\nconst TRANSITION_FALLBACK_BUFFER = 50;\n\nexport interface RdxTransitionStatusRef {\n /** Reactive transition phase, intended for `data-starting-style` / `data-ending-style` bindings. */\n readonly status: Signal<RdxTransitionStatus>;\n /**\n * Registers the element whose CSS transition/animation duration determines when the close\n * transition is considered complete. Returns a cleanup that unregisters it.\n */\n registerElement: (element: HTMLElement) => () => void;\n /** Drives a new transition for the given open state. Cancels any in-flight transition. */\n start: (open: boolean) => void;\n}\n\n/**\n * Shared open/close transition state machine used by overlay primitives (dialog, popover, …).\n *\n * On `start(open)` it flips `status` to `'starting'`/`'ending'`, then — after the next render and\n * (for opening) one animation frame — clears it and waits for the registered element's running CSS\n * animations/transitions to finish (via the Web Animations API) before invoking `onComplete(open)`.\n * Completing on the real `animationend` rather than a duration timer keeps it from firing a frame\n * late. A duration-based timer remains as a safety net, and if no element is registered or it has no\n * animation (also SSR / jsdom, where computed durations are `0`) completion is synchronous.\n *\n * Must be called in an injection context (uses {@link Injector} and {@link DestroyRef}).\n */\nexport function useTransitionStatus(onComplete: (open: boolean) => void): RdxTransitionStatusRef {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n const status = signal<RdxTransitionStatus>(undefined);\n\n let element: HTMLElement | undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let frame: number | undefined;\n let version = 0;\n\n const clearTimers = () => {\n if (frame !== undefined) {\n cancelAnimationFrame(frame);\n frame = undefined;\n }\n\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const complete = (open: boolean, currentVersion: number) => {\n if (currentVersion !== version) {\n return;\n }\n\n clearTimers();\n status.set(undefined);\n\n if (!destroyRef.destroyed) {\n onComplete(open);\n }\n };\n\n const waitForTransition = (open: boolean, currentVersion: number) => {\n const node = element;\n const duration = node ? getMaxTransitionDuration(node) : 0;\n\n // Nothing animating (also the SSR / jsdom path, where computed durations are\n // 0): settle synchronously, exactly as before.\n if (!node || duration === 0) {\n complete(open, currentVersion);\n return;\n }\n\n // Prefer the Web Animations API so completion lands on the real\n // `animationend` / `transitionend` instead of a timer that can fire a frame\n // late — that lateness is what let a closing collapsible flash back to its\n // natural size before `hidden` was applied.\n const animations = typeof node.getAnimations === 'function' ? node.getAnimations() : [];\n\n // Safety net: if an animation never settles (interrupted, replaced without a\n // cancel event, reduced motion, or simply not exposed by the engine yet)\n // still complete shortly after the declared duration.\n timer = setTimeout(() => complete(open, currentVersion), duration + TRANSITION_FALLBACK_BUFFER);\n\n if (animations.length === 0) {\n return;\n }\n\n // A cancelled animation rejects `finished`; swallow it so reopening (which\n // cancels the in-flight animation) still resolves and settles.\n void Promise.all(animations.map((animation) => animation.finished.catch(() => undefined))).then(() =>\n complete(open, currentVersion)\n );\n };\n\n destroyRef.onDestroy(clearTimers);\n\n return {\n status: status.asReadonly(),\n registerElement: (registered: HTMLElement) => {\n element = registered;\n\n return () => {\n if (element === registered) {\n element = undefined;\n }\n };\n },\n start: (open: boolean) => {\n const currentVersion = ++version;\n clearTimers();\n status.set(open ? 'starting' : 'ending');\n\n afterNextRender(\n () => {\n if (destroyRef.destroyed || currentVersion !== version) {\n return;\n }\n\n if (open) {\n frame = requestAnimationFrame(() => {\n frame = undefined;\n\n if (destroyRef.destroyed || currentVersion !== version) {\n return;\n }\n\n status.set(undefined);\n waitForTransition(open, currentVersion);\n });\n } else {\n waitForTransition(open, currentVersion);\n }\n },\n { injector }\n );\n }\n };\n}\n\n/** Longest of an element's CSS transition / animation durations (including delays), in milliseconds. */\nexport function getMaxTransitionDuration(element: HTMLElement): number {\n const styles = getComputedStyle(element);\n\n return Math.max(\n getMaxCssDuration(styles.transitionDuration, styles.transitionDelay),\n getMaxCssDuration(styles.animationDuration, styles.animationDelay)\n );\n}\n\nfunction getMaxCssDuration(durations: string, delays: string): number {\n const parsedDurations = durations.split(',').map(parseCssTime);\n const parsedDelays = delays.split(',').map(parseCssTime);\n\n return parsedDurations.reduce(\n (max, duration, index) => Math.max(max, duration + parsedDelays[index % parsedDelays.length]),\n 0\n );\n}\n\nfunction parseCssTime(value: string): number {\n const trimmed = value.trim();\n const parsed = Number.parseFloat(trimmed);\n\n if (!Number.isFinite(parsed)) {\n return 0;\n }\n\n return trimmed.endsWith('ms') ? parsed : parsed * 1000;\n}\n","// https://ngxtension.netlify.app/utilities/signals/explicit-effect/\n\nimport { CreateEffectOptions, EffectCleanupRegisterFn, EffectRef, effect, untracked } from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * Extend the regular set of effect options\n */\ndeclare interface CreateExplicitEffectOptions extends CreateEffectOptions {\n /**\n * Option that allows the computation not to execute immediately, but only run on first change.\n */\n defer?: boolean;\n}\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n *\n * @example\n * ```typescript\n * import { watch } from 'radix-ng/primitives/core';\n *\n * const count = signal(0);\n * const state = signal('idle');\n *\n * watch([count, state], ([count, state], cleanup) => {\n * console.log('count updated', count, state);\n *\n * cleanup(() => {\n * console.log('cleanup');\n * });\n * });\n * ```\n *\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function watch<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateExplicitEffectOptions | undefined\n): EffectRef {\n let defer = options && options.defer;\n return effect((onCleanup) => {\n const depValues = deps.map((s) => s());\n untracked(() => {\n if (!defer) {\n fn(depValues as any, onCleanup);\n }\n defer = false;\n });\n }, options);\n}\n","export enum RdxPositionSide {\n Top = 'top',\n Right = 'right',\n Bottom = 'bottom',\n Left = 'left'\n}\n\nexport enum RdxPositionAlign {\n Start = 'start',\n Center = 'center',\n End = 'end'\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DOCUMENT"],"mappings":";;;;;;AAGA;;;;;;;;;AASG;AACG,SAAU,oBAAoB,CAAI,IAAa,EAAA;IACjD,OAAO;AACH,QAAA,OAAO,EAAE,iBAAiB;AAC1B,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC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AACf,IAAA,eAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EALW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;IAOf;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,gBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ACP5B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-core.mjs","sources":["../../../packages/primitives/core/src/accessor/provide-value-accessor.ts","../../../packages/primitives/core/src/accessor/control-value-accessor.ts","../../../packages/primitives/core/src/clamp.ts","../../../packages/primitives/core/src/dev/diagnostics.ts","../../../packages/primitives/core/src/create-context.ts","../../../packages/primitives/core/src/chunk.ts","../../../packages/primitives/core/src/date-time/comparators.ts","../../../packages/primitives/core/src/date-time/calendar.ts","../../../packages/primitives/core/src/date-time/formatter.ts","../../../packages/primitives/core/src/date-time/parts.ts","../../../packages/primitives/core/src/date-time/placeholders.ts","../../../packages/primitives/core/src/date-time/utils.ts","../../../packages/primitives/core/src/date-time/parser.ts","../../../packages/primitives/core/src/kbd-constants.ts","../../../packages/primitives/core/src/date-time/segment.ts","../../../packages/primitives/core/src/date-time/types.ts","../../../packages/primitives/core/src/date-time/useDateField.ts","../../../packages/primitives/core/src/handle-and-dispatch-custom-event.ts","../../../packages/primitives/core/src/id-generator.ts","../../../packages/primitives/core/src/predicates.ts","../../../packages/primitives/core/src/item-helpers.ts","../../../packages/primitives/core/src/live-announcer.ts","../../../packages/primitives/core/src/provide-token.ts","../../../packages/primitives/core/src/floating/cancelable-change-event-details.ts","../../../packages/primitives/core/src/floating/floating-events.ts","../../../packages/primitives/core/src/floating/floating-registration.ts","../../../packages/primitives/core/src/floating/floating-tree.ts","../../../packages/primitives/core/src/floating/provide-floating-tree.ts","../../../packages/primitives/core/src/floating/floating-node-registration.ts","../../../packages/primitives/core/src/floating/trigger-registry.ts","../../../packages/primitives/core/src/floating/floating-root-context.ts","../../../packages/primitives/core/src/floating/internal-backdrop.ts","../../../packages/primitives/core/src/dom/document.ts","../../../packages/primitives/core/src/dom/element-size.ts","../../../packages/primitives/core/src/dom/get-active-element.ts","../../../packages/primitives/core/src/dom/use-resize-observer.ts","../../../packages/primitives/core/src/dom/use-scroll-lock.ts","../../../packages/primitives/core/src/composables/use-arrow-navigation.ts","../../../packages/primitives/core/src/composables/use-filter.ts","../../../packages/primitives/core/src/composables/use-grace-area.ts","../../../packages/primitives/core/src/composables/use-list-highlight.ts","../../../packages/primitives/core/src/composables/use-pointer-drag.ts","../../../packages/primitives/core/src/composables/use-transition-status.ts","../../../packages/primitives/core/src/composables/watch.ts","../../../packages/primitives/core/src/positioning/types.ts","../../../packages/primitives/core/radix-ng-primitives-core.ts"],"sourcesContent":["import { forwardRef, Provider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * Include in the providers section of a component which utilizes ControlValueAccessor to redundant code.\n *\n * ```ts\n * @Directive({\n * providers: [provideValueAccessor(ExampleDirective)]\n *}\n * export class ExampleDirective{}\n * ```\n */\nexport function provideValueAccessor<T>(type: Type<T>): Provider {\n return {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => type),\n multi: true\n };\n}\n","import { Directive, booleanAttribute, inject, input, linkedSignal, output, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { BooleanInput } from '../types';\nimport { provideValueAccessor } from './provide-value-accessor';\n\n/**\n * A reusable ControlValueAccessor implementation for form controls\n * @template T The type of the control's value\n */\n@Directive({\n exportAs: 'rdxControlValueAccessor',\n providers: [provideValueAccessor(RdxControlValueAccessor)]\n})\nexport class RdxControlValueAccessor<T> implements ControlValueAccessor {\n /**\n * Input for the control's value with alias 'value'\n * @default undefined\n */\n readonly valueInput = input<T>(undefined, { alias: 'value' });\n\n /**\n * Input for the disabled state with alias 'disabled'\n * Uses booleanAttribute transform to convert string attributes to booleans\n * @default false\n */\n readonly disabledInput = input<boolean, BooleanInput>(false, {\n alias: 'disabled',\n transform: booleanAttribute\n });\n\n readonly valueChange = output<T>();\n\n private readonly _value = linkedSignal(() => this.valueInput());\n\n /**\n * Readonly access to the current value\n */\n readonly value = this._value.asReadonly();\n\n private readonly _disabled = linkedSignal(() => this.disabledInput());\n\n /**\n * Readonly access to the disabled state\n */\n readonly disabled = this._disabled.asReadonly();\n\n // Callbacks for ControlValueAccessor\n onChange?: (value: T | undefined) => void;\n private onTouched?: () => void;\n\n /**\n * Writes a new value to the control (ControlValueAccessor interface)\n * @param value The new value for the control\n */\n writeValue(value: T | undefined): void {\n untracked(() => this._value.set(value as T));\n }\n\n /**\n * Registers a callback for when the control value changes (ControlValueAccessor interface)\n * @param fn The callback function\n */\n registerOnChange(fn: (value: T | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback for when the control is touched (ControlValueAccessor interface)\n * @param fn The callback function\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control (ControlValueAccessor interface)\n * @param isDisabled Whether the control should be disabled\n */\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n /**\n * Updates the control's value and triggers change detection\n * @param value The new value\n */\n setValue(value: T) {\n this._value.set(value);\n this.valueChange.emit(value);\n this.onChange?.(value);\n }\n\n markAsTouched() {\n this.onTouched?.();\n }\n}\n\n/**\n * Provides a type-safe way to inject the RdxControlValueAccessor\n * @template T The type of the control's value\n * @returns An instance of RdxControlValueAccessor<T>\n */\nexport function injectControlValueAccessor<T>(): RdxControlValueAccessor<T> {\n return inject(RdxControlValueAccessor);\n}\n","/**\n * The `clamp` function restricts a number within a specified range by returning the value itself if it\n * falls within the range, or the closest boundary value if it exceeds the range.\n * @param {number} value - The `value` parameter represents the number that you want to clamp within\n * the specified range defined by `min` and `max` values.\n * @param {number} min - If the `value` parameter is less than the `min` value, the\n * function will return the `min` value.\n * @param {number} max - If the `value` parameter is greater than the `max` value,\n * the function will return `max`.\n * @returns The `clamp` function returns the value of `value` constrained within the range defined by\n * `min` and `max`.\n */\nexport function clamp(\n value: number,\n min: number = Number.NEGATIVE_INFINITY,\n max: number = Number.POSITIVE_INFINITY\n): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/**\n * The function `roundToStepPrecision` rounds a number to a specified precision step.\n * @param {number} value - The `value` parameter is the number that you want to round to a specific\n * precision based on the `step` parameter.\n * @param {number} step - The `step` parameter in the `roundToStepPrecision` function represents the\n * interval at which you want to round the `value`. For example, if `step` is 0.5, the `value` will be\n * rounded to the nearest half.\n * @returns the `roundedValue` after rounding it to the precision specified by the `step`.\n */\nexport function roundToStepPrecision(value: number, step: number) {\n let roundedValue = value;\n const stepString = step.toString();\n const pointIndex = stepString.indexOf('.');\n const precision = pointIndex >= 0 ? stepString.length - pointIndex : 0;\n if (precision > 0) {\n const pow = 10 ** precision;\n roundedValue = Math.round(roundedValue * pow) / pow;\n }\n return roundedValue;\n}\n\n/**\n * The function `snapValueToStep` snaps a given value to the nearest step within a specified range.\n * @param {number} value - The `value` parameter represents the number that you want to snap to the\n * nearest step value.\n * @param {number | undefined} min - The `min` parameter represents the minimum value that the `value`\n * should be snapped to. If `value` is less than `min`, it will be snapped to `min`. If `min` is not\n * provided (undefined), then the snapping will not consider a minimum value.\n * @param {number | undefined} max - The `max` parameter represents the maximum value that the `value`\n * should be snapped to. It ensures that the snapped value does not exceed this maximum value.\n * @param {number} step - The `step` parameter in the `snapValueToStep` function represents the\n * interval at which the `value` should be snapped to. It determines the granularity of the snapping\n * operation. For example, if `step` is 5, the `value` will be snapped to the nearest multiple of\n * @returns a number that has been snapped to the nearest step value within the specified range of minimum and maximum values.\n */\nexport function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number {\n min = Number(min);\n max = Number(max);\n const remainder = (value - (Number.isNaN(min) ? 0 : min)) % step;\n let snappedValue = roundToStepPrecision(\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder,\n step\n );\n\n if (!Number.isNaN(min)) {\n if (snappedValue < min) snappedValue = min;\n else if (!Number.isNaN(max) && snappedValue > max)\n snappedValue = min + Math.floor(roundToStepPrecision((max - min) / step, step)) * step;\n } else if (!Number.isNaN(max) && snappedValue > max) {\n snappedValue = Math.floor(roundToStepPrecision(max / step, step)) * step;\n }\n\n // correct floating point behavior by rounding to step precision\n snappedValue = roundToStepPrecision(snappedValue, step);\n\n return snappedValue;\n}\n","import { ElementRef, HOST_TAG_NAME, inject, isDevMode } from '@angular/core';\n\n/**\n * Base URL of the documentation site. Each primitive's docs are also served as plain\n * Markdown at `/<section>/<slug>.md`, which both humans and AI agents can open.\n */\nexport const DOCS_BASE_URL = 'https://radix-ng.com';\n\n/**\n * Full URL to a primitive's plain-Markdown docs page.\n * @param docsPath Documentation path for the owning primitive (e.g. `'components/select'`).\n */\nexport function docsUrl(docsPath: string): string {\n return `${DOCS_BASE_URL}/${docsPath}.md`;\n}\n\n/**\n * Codes already warned this page load, keyed by their stable `<primitive>/<slug>` code.\n * `rdxDevWarning` consults this so each distinct misuse warns at most once.\n */\nconst warnedCodes = new Set<string>();\n\nfunction formatMessage(code: string, message: string, docsPath?: string): string {\n const hint = docsPath ? ` See ${docsUrl(docsPath)}` : '';\n return `[rdx:${code}] ${message}${hint}`;\n}\n\n/**\n * Emits a deduplicated dev-mode `console.warn` for a recoverable misuse.\n *\n * No-op outside `isDevMode()`, so production builds stay silent (and the message\n * assembly tree-shakes out). Dedupes per `code` per page load, replacing the\n * hand-rolled `warned` flags individual primitives used to carry.\n *\n * @param code Stable, greppable `<primitive>/<slug>` identifier (e.g. `'select/trigger-element'`).\n * @param message Human-readable explanation of the misuse and how to fix it.\n * @param docsPath Optional docs path appended as a `See <url>` hint (e.g. `'components/select'`).\n */\nexport function rdxDevWarning(code: string, message: string, docsPath?: string): void {\n if (!isDevMode() || warnedCodes.has(code)) {\n return;\n }\n\n warnedCodes.add(code);\n console.warn(formatMessage(code, message, docsPath));\n}\n\n/**\n * Throws a dev-mode `Error` for unrecoverable misuse (broken markup that cannot work).\n *\n * Unlike {@link rdxDevWarning} this always throws when reached — callers that want the\n * check to stay dev-only should guard the call with `isDevMode()`.\n *\n * @param code Stable, greppable `<primitive>/<slug>` identifier (e.g. `'popover/portal-on-element'`).\n * @param message Human-readable explanation of the misuse and how to fix it.\n * @param docsPath Optional docs path appended as a `See <url>` hint (e.g. `'components/popover'`).\n */\nexport function rdxDevError(code: string, message: string, docsPath?: string): never {\n throw new Error(formatMessage(code, message, docsPath));\n}\n\n/**\n * Test-only: clears the per-code dedup set so warning specs stay isolated from one another.\n */\nexport function resetRdxDevWarnings(): void {\n warnedCodes.clear();\n}\n\n/** Natively focusable / keyboard-operable host elements a trigger may live on without extra wiring. */\nconst INTERACTIVE_TRIGGER_TAGS = new Set(['button', 'a', 'input']);\n\n/**\n * Dev-mode check: warns when a trigger part sits on a host element that is neither natively\n * interactive (`<button>`, `<a>`, `<input>`) nor made focusable with `tabindex`.\n *\n * Only meaningful for triggers whose selector accepts arbitrary elements **and** that do not\n * adapt their own ARIA/keyboard handling for non-button hosts — triggers scoped to\n * `button[...]` already enforce this at the selector level, and triggers that auto-apply\n * `role`/`tabindex` (e.g. `rdxMenuTrigger`) handle it themselves.\n *\n * Must be called inside an injection context (a directive constructor), where the host element\n * already exists. No-op outside `isDevMode()` and on synthetic hosts (component / `ng-template`),\n * where `HOST_TAG_NAME` is absent.\n *\n * @param triggerName Selector name used in the message, e.g. `'rdxPreviewCardTrigger'`.\n * @param code Stable diagnostics code, e.g. `'preview-card/trigger-element'`.\n * @param docsPath Docs path for the See-link, e.g. `'components/preview-card'`.\n */\nexport function rdxCheckTriggerElement(triggerName: string, code: string, docsPath: string): void {\n if (!isDevMode()) {\n return;\n }\n\n const tag = inject(HOST_TAG_NAME, { optional: true })?.toLowerCase();\n if (!tag || INTERACTIVE_TRIGGER_TAGS.has(tag)) {\n return;\n }\n\n // A consumer-supplied `tabindex` means they opted the element into focusability deliberately.\n if (inject(ElementRef).nativeElement.hasAttribute('tabindex')) {\n return;\n }\n\n rdxDevWarning(\n code,\n `\\`${triggerName}\\` is on a <${tag}>, which is not focusable or keyboard-operable by default. ` +\n `Use a native <button> or <a>, or add an appropriate \\`role\\` and \\`tabindex\\` so keyboard ` +\n `and assistive-technology users can reach it.`,\n docsPath\n );\n}\n\n/**\n * Dev-mode check: warns when a label part sits on a non-`<label>` host. The `for` attribute only\n * associates a `<label>` with a control, so a label part placed on any other element is not\n * programmatically connected to its control.\n *\n * Must be called inside an injection context. No-op outside `isDevMode()` and on synthetic hosts.\n *\n * @param labelName Selector name used in the message, e.g. `'rdxFieldLabel'`.\n * @param code Stable diagnostics code, e.g. `'field/unassociated-label'`.\n * @param docsPath Docs path for the See-link, e.g. `'components/field'`.\n */\nexport function rdxCheckLabelElement(labelName: string, code: string, docsPath: string): void {\n if (!isDevMode()) {\n return;\n }\n\n const tag = inject(HOST_TAG_NAME, { optional: true })?.toLowerCase();\n if (!tag || tag === 'label') {\n return;\n }\n\n rdxDevWarning(\n code,\n `\\`${labelName}\\` is on a <${tag}>. The \\`for\\` attribute only associates a <label> with a ` +\n `control, so this label is not programmatically connected to its control. Place it on a ` +\n `<label>, or associate the control another way (e.g. \\`aria-labelledby\\`).`,\n docsPath\n );\n}\n","// Thanks for idea.\n// https://github.com/unovue/reka-ui/blob/v2/packages/core/src/shared/createContext.ts\n\nimport { inject, InjectionToken, Provider } from '@angular/core';\nimport { docsUrl } from './dev/diagnostics';\n\n/**\n * Retrieves the context value from Angular's dependency injection.\n * Overloaded so the non-optional call returns a non-nullable `T` (no `!` needed),\n * while the optional call may return `null`.\n */\nexport interface InjectContext<T> {\n (): T;\n (optional: false): T;\n (optional: true): T | null;\n (optional?: boolean): T | null;\n}\n\n/**\n * Creates a context with injector and provider functions for a given type\n * @template T The type of the context value\n * @param description Descriptive string for the context (used in token creation)\n * @param docs Documentation path for the owning primitive (e.g. `'components/accordion'`),\n * appended to the missing-context error as a link to the required anatomy\n * @returns A tuple containing:\n * - injectContext: Function to retrieve the context value\n * - provideContext: Function to create a provider for the context\n */\nexport function createContext<T>(\n description: string,\n docs?: string\n): readonly [injectContext: InjectContext<T>, provideContext: (useFactory: () => T) => Provider] {\n // Normalize so both `'FooRoot'` and `'FooRootContext'` read as `FooRootContext`.\n const contextName = `${description.replace(/\\s*Context$/, '')}Context`;\n const CONTEXT_TOKEN = new InjectionToken<T>(contextName);\n\n /**\n * Retrieves the context value from Angular's dependency injection\n * @param optional If true, returns null when context is not provided instead of throwing\n * @returns The context value or null if optional and not provided\n * @throws Error when context is not provided and not optional\n */\n const injectContext = (optional = false): T | null => {\n // Always inject optionally so a missing context produces our own descriptive\n // error instead of Angular's generic NullInjectorError. This also catches a\n // provided factory that returns null/undefined for the non-optional case.\n const value = inject(CONTEXT_TOKEN, { optional: true });\n\n if (value == null && !optional) {\n const docsHint = docs ? ` See ${docsUrl(docs)} for the required part hierarchy.` : '';\n\n throw new Error(\n `No \\`${contextName}\\` found. This part must be placed inside the directive ` +\n `that provides \\`${contextName}\\` (usually the primitive's root).${docsHint}`\n );\n }\n\n return value;\n };\n\n /**\n * Creates a provider that can be used to supply the context value\n * @param useFactory Factory function that creates the context value\n * @returns A provider that can be registered in Angular's DI system\n */\n const provideContext = (useFactory: () => T): Provider => ({\n provide: CONTEXT_TOKEN,\n useFactory: useFactory\n });\n\n return [injectContext as InjectContext<T>, provideContext] as const;\n}\n","/**\n * Splits an array into chunks of a given size.\n * @param arr The array to split.\n * @param size The size of each chunk.\n * @returns An array of arrays, where each sub-array has `size` elements from the original array.\n * @example ```ts\n * const arr = [1, 2, 3, 4, 5, 6, 7, 8];\n * const chunks = chunk(arr, 3);\n * // chunks = [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n */\nexport function chunk<T>(arr: T[], size: number): T[][] {\n const result = [];\n for (let i = 0; i < arr.length; i += size) result.push(arr.slice(i, i + size));\n\n return result;\n}\n","import {\n CalendarDate,\n CalendarDateTime,\n CalendarIdentifier,\n createCalendar,\n DateFormatter,\n type DateValue,\n getDayOfWeek,\n getLocalTimeZone,\n Time,\n toCalendar,\n ZonedDateTime\n} from '@internationalized/date';\nimport type { DateMatcher } from './types';\n\n/**\n * Given a `DateValue` object, convert it to a native `Date` object.\n * If a timezone is provided, the date will be converted to that timezone.\n * If no timezone is provided, the date will be converted to the local timezone.\n */\nexport function toDate(dateValue: DateValue, tz: string = getLocalTimeZone()) {\n if (isZonedDateTime(dateValue)) return dateValue.toDate();\n else return dateValue.toDate(tz);\n}\n\nexport function isCalendarDateTime(dateValue: DateValue): dateValue is CalendarDateTime {\n return dateValue instanceof CalendarDateTime;\n}\n\nexport function isZonedDateTime(dateValue: DateValue): dateValue is ZonedDateTime {\n return dateValue instanceof ZonedDateTime;\n}\n\nexport function hasTime(dateValue: DateValue) {\n return isCalendarDateTime(dateValue) || isZonedDateTime(dateValue);\n}\n\n/**\n * Given a date, return the number of days in the month.\n */\nexport function getDaysInMonth(date: Date | DateValue) {\n if (date instanceof Date) {\n const year = date.getFullYear();\n const month = date.getMonth() + 1;\n /**\n * By using zero as the day, we get the\n * last day of the previous month, which\n * is the month we originally passed in.\n */\n return new Date(year, month, 0).getDate();\n } else {\n return date.set({ day: 100 }).day;\n }\n}\n\n/**\n * Determine if a date is before the reference date.\n * @param dateToCompare - is this date before the `referenceDate`\n * @param referenceDate - is the `dateToCompare` before this date\n *\n * @see {@link isBeforeOrSame} for inclusive\n */\nexport function isBefore(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) < 0;\n}\n\n/**\n * Determine if a date is after the reference date.\n * @param dateToCompare - is this date after the `referenceDate`\n * @param referenceDate - is the `dateToCompare` after this date\n *\n * @see {@link isAfterOrSame} for inclusive\n */\nexport function isAfter(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) > 0;\n}\n\n/**\n * Determine if a date is before or the same as the reference date.\n *\n * @param dateToCompare - the date to compare\n * @param referenceDate - the reference date to make the comparison against\n *\n * @see {@link isBefore} for non-inclusive\n */\nexport function isBeforeOrSame(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) <= 0;\n}\n\n/**\n * Determine if a date is after or the same as the reference date.\n *\n * @param dateToCompare - is this date after or the same as the `referenceDate`\n * @param referenceDate - is the `dateToCompare` after or the same as this date\n *\n * @see {@link isAfter} for non-inclusive\n */\nexport function isAfterOrSame(dateToCompare: DateValue, referenceDate: DateValue) {\n return dateToCompare.compare(referenceDate) >= 0;\n}\n\n/**\n * Determine if a date is inclusively between a start and end reference date.\n *\n * @param date - is this date inclusively between the `start` and `end` dates\n * @param start - the start reference date to make the comparison against\n * @param end - the end reference date to make the comparison against\n *\n * @see {@link isBetween} for non-inclusive\n */\nexport function isBetweenInclusive(date: DateValue, start: DateValue, end: DateValue) {\n return isAfterOrSame(date, start) && isBeforeOrSame(date, end);\n}\n\n/**\n * Determine if a date is between a start and end reference date.\n *\n * @param date - is this date between the `start` and `end` dates\n * @param start - the start reference date to make the comparison against\n * @param end - the end reference date to make the comparison against\n *\n * @see {@link isBetweenInclusive} for inclusive\n */\nexport function isBetween(date: DateValue, start: DateValue, end: DateValue) {\n return isAfter(date, start) && isBefore(date, end);\n}\n\nexport function getLastFirstDayOfWeek<T extends DateValue = DateValue>(\n date: T,\n firstDayOfWeek: number,\n locale: string\n): T {\n const day = getDayOfWeek(date, locale);\n\n if (firstDayOfWeek > day) return date.subtract({ days: day + 7 - firstDayOfWeek }) as T;\n\n if (firstDayOfWeek === day) return date;\n\n return date.subtract({ days: day - firstDayOfWeek }) as T;\n}\n\nexport function getNextLastDayOfWeek<T extends DateValue = DateValue>(\n date: T,\n firstDayOfWeek: number,\n locale: string\n): T {\n const day = getDayOfWeek(date, locale);\n const lastDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n\n if (day === lastDayOfWeek) return date;\n\n if (day > lastDayOfWeek) return date.add({ days: 7 - day + lastDayOfWeek }) as T;\n\n return date.add({ days: lastDayOfWeek - day }) as T;\n}\n\nexport function areAllDaysBetweenValid(\n start: DateValue,\n end: DateValue,\n isUnavailable: DateMatcher | undefined,\n isDisabled: DateMatcher | undefined\n) {\n if (isUnavailable === undefined && isDisabled === undefined) return true;\n\n let dCurrent = start.add({ days: 1 });\n if (isDisabled?.(dCurrent) || isUnavailable?.(dCurrent)) return false;\n\n const dEnd = end;\n while (dCurrent.compare(dEnd) < 0) {\n dCurrent = dCurrent.add({ days: 1 });\n if (isDisabled?.(dCurrent) || isUnavailable?.(dCurrent)) return false;\n }\n return true;\n}\n\nexport type TimeValue = Time | CalendarDateTime | ZonedDateTime;\n\nexport type Granularity = 'day' | 'hour' | 'minute' | 'second';\nexport type TimeGranularity = 'hour' | 'minute' | 'second';\n\n/**\n * The granularities that require a time component (and therefore a `CalendarDateTime`\n * rather than a `CalendarDate`). Single source of truth — used by both the default-date\n * builder and the segment-value initializer.\n */\nexport const TIME_GRANULARITIES: readonly Granularity[] = ['hour', 'minute', 'second'];\n\ntype GetDefaultDateProps = {\n defaultValue?: DateValue | DateValue[] | undefined;\n defaultPlaceholder?: DateValue | undefined;\n granularity?: Granularity;\n locale?: string;\n};\n\n/**\n * A helper function used throughout the various date builders\n * to generate a default `DateValue` using the `defaultValue`,\n * `defaultPlaceholder`, and `granularity` props.\n *\n * It's important to match the `DateValue` type being used\n * elsewhere in the builder, so they behave according to the\n * behavior the user expects based on the props they've provided.\n *\n */\nexport function getDefaultDate(props: GetDefaultDateProps): DateValue {\n const { defaultValue, defaultPlaceholder, granularity = 'day', locale = 'en' } = props;\n\n if (Array.isArray(defaultValue)) {\n // Multiple-selection calendars pass an array. The view follows the most recently\n // selected date — consistent with calendar-root's value→placeholder sync. An empty\n // array means \"no selection\", so fall through to the placeholder / today.\n if (defaultValue.length) return defaultValue[defaultValue.length - 1].copy();\n } else if (defaultValue) {\n return defaultValue.copy();\n }\n\n if (defaultPlaceholder) return defaultPlaceholder.copy();\n\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth() + 1;\n const day = date.getDate();\n\n const defaultFormatter = new DateFormatter(locale);\n const calendar = createCalendar(defaultFormatter.resolvedOptions().calendar as CalendarIdentifier);\n\n if (TIME_GRANULARITIES.includes(granularity ?? 'day'))\n return toCalendar(new CalendarDateTime(year, month, day, 0, 0, 0), calendar);\n\n return toCalendar(new CalendarDate(year, month, day), calendar);\n}\n\ntype GetDefaultTimeProps = {\n defaultValue?: TimeValue | undefined;\n defaultPlaceholder?: TimeValue | undefined;\n};\n\nexport function getDefaultTime(props: GetDefaultTimeProps): TimeValue {\n const { defaultValue, defaultPlaceholder } = props;\n\n if (defaultValue) {\n return defaultValue.copy();\n }\n\n if (defaultPlaceholder) {\n return defaultPlaceholder.copy();\n }\n\n return new Time(0, 0, 0);\n}\n","/*\n * Implementation ported from from from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/builders/calendar/create.ts\n */\n\nimport { CalendarDate, DateValue, endOfMonth, getDayOfWeek, startOfMonth } from '@internationalized/date';\nimport { chunk } from '../chunk';\nimport { getDaysInMonth, getLastFirstDayOfWeek, getNextLastDayOfWeek } from './comparators';\nimport { Month } from './types';\n\ntype DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';\n\nexport type CreateMonthProps = {\n /**\n * The date object representing the month's date (usually the first day of the month).\n */\n dateObj: DateValue;\n\n /**\n * The day of the week to start the calendar on (0 for Sunday, 1 for Monday, etc.).\n */\n weekStartsOn: number;\n\n /**\n * Whether to always render 6 weeks in the calendar, even if the month doesn't\n * span 6 weeks.\n */\n fixedWeeks: boolean;\n\n /**\n * The locale to use when creating the calendar month.\n */\n locale: string;\n};\n\n/**\n * Retrieves an array of date values representing the days between\n * the provided start and end dates.\n */\nexport function getDaysBetween(start: DateValue, end: DateValue) {\n const days: DateValue[] = [];\n let dCurrent = start.add({ days: 1 });\n const dEnd = end;\n while (dCurrent.compare(dEnd) < 0) {\n days.push(dCurrent);\n dCurrent = dCurrent.add({ days: 1 });\n }\n return days;\n}\n\nexport function createMonth(props: CreateMonthProps): Month<DateValue> {\n const { dateObj, weekStartsOn, fixedWeeks, locale } = props;\n const daysInMonth = getDaysInMonth(dateObj);\n\n const datesArray = Array.from({ length: daysInMonth }, (_, i) => dateObj.set({ day: i + 1 }));\n\n const firstDayOfMonth = startOfMonth(dateObj);\n const lastDayOfMonth = endOfMonth(dateObj);\n\n const lastSunday = getLastFirstDayOfWeek(firstDayOfMonth, weekStartsOn, locale);\n const nextSaturday = getNextLastDayOfWeek(lastDayOfMonth, weekStartsOn, locale);\n\n const lastMonthDays = getDaysBetween(lastSunday.subtract({ days: 1 }), firstDayOfMonth);\n const nextMonthDays = getDaysBetween(lastDayOfMonth, nextSaturday.add({ days: 1 }));\n\n const totalDays = lastMonthDays.length + datesArray.length + nextMonthDays.length;\n\n if (fixedWeeks && totalDays < 42) {\n const extraDays = 42 - totalDays;\n\n let startFrom = nextMonthDays[nextMonthDays.length - 1];\n\n if (!startFrom) startFrom = endOfMonth(dateObj);\n\n const extraDaysArray = Array.from({ length: extraDays }, (_, i) => {\n const incr = i + 1;\n return startFrom.add({ days: incr });\n });\n nextMonthDays.push(...extraDaysArray);\n }\n\n const allDays = lastMonthDays.concat(datesArray, nextMonthDays);\n\n const weeks = chunk(allDays, 7);\n\n return {\n value: dateObj,\n dates: allDays,\n weeks: weeks\n };\n}\n\ntype SetMonthProps = CreateMonthProps & {\n numberOfMonths: number | undefined;\n currentMonths?: Month<DateValue>[];\n};\n\nexport function createMonths(props: SetMonthProps) {\n const { numberOfMonths, dateObj, ...monthProps } = props;\n\n const months: Month<DateValue>[] = [];\n\n if (!numberOfMonths || numberOfMonths === 1) {\n months.push(\n createMonth({\n ...monthProps,\n dateObj\n })\n );\n return months;\n }\n\n months.push(\n createMonth({\n ...monthProps,\n dateObj\n })\n );\n\n // Create all the months, starting with the current month\n for (let i = 1; i < numberOfMonths; i++) {\n const nextMonth = dateObj.add({ months: i });\n months.push(\n createMonth({\n ...monthProps,\n dateObj: nextMonth\n })\n );\n }\n\n return months;\n}\n\n/**\n * Returns the locale-specific week number\n */\nexport function getWeekNumber(date: DateValue, locale: string = 'en-US', firstDayOfWeek?: DayOfWeek): number {\n const firstDayOfYear = new CalendarDate(date.year, 1, 1);\n\n const firstDayOfYearWeekday = getDayOfWeek(firstDayOfYear, locale, firstDayOfWeek);\n\n const firstWeekStart = firstDayOfYear.subtract({ days: firstDayOfYearWeekday });\n\n // If date is before the first week start It belongs to the last week of the previous year\n if (date.compare(firstWeekStart) < 0) {\n const prevYearDate = new CalendarDate(date.year - 1, 12, 31);\n return getWeekNumber(prevYearDate, locale, firstDayOfWeek);\n }\n\n // `getDaysBetween` is exclusive of both ends, so extend the end by a day to count the\n // full span from `firstWeekStart` through `date` (otherwise every 7-day boundary is\n // under-counted by one and the week number lags).\n const days = getDaysBetween(firstWeekStart, date.add({ days: 1 }));\n\n // Week number is days divided by 7 plus 1\n return Math.floor(days.length / 7) + 1;\n}\n","import { DateFormatter, type DateValue, getLocalTimeZone, today } from '@internationalized/date';\nimport { hasTime, isZonedDateTime, toDate } from './comparators';\nimport { HourCycle } from './types';\n\nconst defaultPartOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n};\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string;\n}\n\n/**\n * Constructing a `DateFormatter` (which wraps `Intl.DateTimeFormat`) is by far the most\n * expensive operation here, and `createContent` formats every segment on each keystroke.\n * Reuse instances keyed by locale + options — the set of distinct combinations is tiny and\n * the instances are immutable.\n */\nconst formatterCache = new Map<string, DateFormatter>();\n\nfunction getDateFormatter(locale: string, options: DateFormatterOptions): DateFormatter {\n const key = `${locale}|${JSON.stringify(options)}`;\n let formatter = formatterCache.get(key);\n if (!formatter) {\n formatter = new DateFormatter(locale, options);\n formatterCache.set(key, formatter);\n }\n return formatter;\n}\n\nexport type Formatter = {\n getLocale: () => string;\n setLocale: (newLocale: string) => void;\n custom: (date: Date, options: DateFormatterOptions) => string;\n selectedDate: (date: DateValue, includeTime?: boolean) => string;\n dayOfWeek: (date: Date, length?: DateFormatterOptions['weekday']) => string;\n fullMonthAndYear: (date: Date, options?: DateFormatterOptions) => string;\n fullMonth: (date: Date, options?: DateFormatterOptions) => string;\n fullYear: (date: Date, options?: DateFormatterOptions) => string;\n dayPeriod: (date: Date) => string;\n part: (dateObj: DateValue, type: Intl.DateTimeFormatPartTypes, options?: DateFormatterOptions) => string;\n toParts: (date: DateValue, options?: DateFormatterOptions) => Intl.DateTimeFormatPart[];\n getMonths: () => { label: string; value: number }[];\n};\n\n/**\n * Creates a wrapper around the `DateFormatter`, which is\n * an improved version of the {@link Intl.DateTimeFormat} API,\n * that is used internally by the various date builders to\n * easily format dates in a consistent way.\n *\n * @see [DateFormatter](https://react-spectrum.adobe.com/internationalized/date/DateFormatter.html)\n */\nexport function createFormatter(initialLocale: string, opts: DateFormatterOptions = {}): Formatter {\n let locale = initialLocale;\n\n function setLocale(newLocale: string) {\n locale = newLocale;\n }\n\n function getLocale() {\n return locale;\n }\n\n function custom(date: Date, options: DateFormatterOptions) {\n return getDateFormatter(locale, { ...opts, ...options }).format(date);\n }\n\n function selectedDate(date: DateValue, includeTime = true) {\n if (hasTime(date) && includeTime) {\n return custom(toDate(date), {\n dateStyle: 'long',\n timeStyle: 'long'\n });\n } else {\n return custom(toDate(date), {\n dateStyle: 'long'\n });\n }\n }\n\n function fullMonthAndYear(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, month: 'long', year: 'numeric', ...options }).format(date);\n }\n\n function fullMonth(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, month: 'long', ...options }).format(date);\n }\n\n function fullYear(date: Date, options: DateFormatterOptions = {}) {\n return getDateFormatter(locale, { ...opts, year: 'numeric', ...options }).format(date);\n }\n\n function toParts(date: DateValue, options?: DateFormatterOptions) {\n if (isZonedDateTime(date)) {\n return getDateFormatter(locale, {\n ...opts,\n ...options,\n timeZone: date.timeZone\n }).formatToParts(toDate(date));\n } else {\n return getDateFormatter(locale, { ...opts, ...options }).formatToParts(toDate(date));\n }\n }\n\n function dayOfWeek(date: Date, length: DateFormatterOptions['weekday'] = 'narrow') {\n return getDateFormatter(locale, { ...opts, weekday: length }).format(date);\n }\n\n function dayPeriod(date: Date, hourCycle: HourCycle | undefined = undefined) {\n const parts = getDateFormatter(locale, {\n ...opts,\n hour: 'numeric',\n minute: 'numeric',\n hourCycle: hourCycle === 24 ? 'h23' : undefined\n }).formatToParts(date);\n const value = parts.find((p) => p.type === 'dayPeriod')?.value;\n // Day period can be \"AM\"/\"PM\" or \"a.m.\"/\"p.m.\" in some locales\n if (value === 'PM' || value === 'p.m.') {\n return 'PM';\n }\n return 'AM';\n }\n\n function part(dateObj: DateValue, type: Intl.DateTimeFormatPartTypes, options: Intl.DateTimeFormatOptions = {}) {\n const opts = { ...defaultPartOptions, ...options };\n const parts = toParts(dateObj, opts);\n const part = parts.find((p) => p.type === type);\n return part ? part.value : '';\n }\n\n function getMonths() {\n const defaultDate = today(getLocalTimeZone());\n const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n return months.map((item) => ({ label: fullMonth(toDate(defaultDate.set({ month: item }))), value: item }));\n }\n\n return {\n setLocale,\n getLocale,\n fullMonth,\n fullYear,\n fullMonthAndYear,\n toParts,\n custom,\n part,\n dayPeriod,\n selectedDate,\n dayOfWeek,\n getMonths\n };\n}\n","/*\n * Implementation ported from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/builders/date-field/_internal/helpers.ts\n */\n\nimport type { DateSegmentPart, EditableSegmentPart, SegmentPart, TimeSegmentPart } from './types';\n\nexport const DATE_SEGMENT_PARTS = ['day', 'month', 'year'] as const;\nexport const TIME_SEGMENT_PARTS = ['hour', 'minute', 'second', 'dayPeriod'] as const;\nexport const NON_EDITABLE_SEGMENT_PARTS = ['literal', 'timeZoneName'] as const;\nexport const EDITABLE_SEGMENT_PARTS = [...DATE_SEGMENT_PARTS, ...TIME_SEGMENT_PARTS] as const;\nexport const EDITABLE_TIME_SEGMENT_PARTS = [...TIME_SEGMENT_PARTS] as const;\nexport const ALL_SEGMENT_PARTS = [...EDITABLE_SEGMENT_PARTS, ...NON_EDITABLE_SEGMENT_PARTS] as const;\nexport const ALL_EXCEPT_LITERAL_PARTS = ALL_SEGMENT_PARTS.filter((part) => part !== 'literal');\n\nexport function isDateSegmentPart(part: unknown): part is DateSegmentPart {\n return DATE_SEGMENT_PARTS.includes(part as DateSegmentPart);\n}\n\nexport function isTimeSegmentPart(part: unknown): part is TimeSegmentPart {\n return TIME_SEGMENT_PARTS.includes(part as TimeSegmentPart);\n}\n\nexport function isSegmentPart(part: string): part is EditableSegmentPart {\n return EDITABLE_SEGMENT_PARTS.includes(part as EditableSegmentPart);\n}\n\nexport function isAnySegmentPart(part: unknown): part is SegmentPart {\n return ALL_SEGMENT_PARTS.includes(part as EditableSegmentPart);\n}\n","/*\n * Implementation ported from from from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/internal/helpers/date/placeholders.ts\n */\n\n// prettier-ignore\nconst supportedLocales = [\n 'ach','af','am','an','ar','ast','az','be','bg','bn','br','bs',\n 'ca','cak','ckb','cs','cy','da','de','dsb','el','en','eo','es',\n 'et','eu','fa','ff','fi','fr','fy','ga','gd','gl','he','hr',\n 'hsb','hu','ia','id','it','ja','ka','kk','kn','ko','lb','lo',\n 'lt','lv','meh','ml','ms','nl','nn','no','oc','pl','pt','rm',\n 'ro','ru','sc','scn','sk','sl','sr','sv','szl','tg','th','tr',\n 'uk','zh-CN','zh-TW',\n] as const;\n\nconst placeholderFields = ['year', 'month', 'day'] as const;\n\ntype SupportedLocale = (typeof supportedLocales)[number];\ntype PlaceholderField = (typeof placeholderFields)[number];\nexport type PlaceholderMap = Record<SupportedLocale, Record<PlaceholderField, string>>;\n\nconst placeholders: PlaceholderMap = {\n ach: { year: 'mwaka', month: 'dwe', day: 'nino' },\n af: { year: 'jjjj', month: 'mm', day: 'dd' },\n am: { year: 'ዓዓዓዓ', month: 'ሚሜ', day: 'ቀቀ' },\n an: { year: 'aaaa', month: 'mm', day: 'dd' },\n ar: { year: 'سنة', month: 'شهر', day: 'يوم' },\n ast: { year: 'aaaa', month: 'mm', day: 'dd' },\n az: { year: 'iiii', month: 'aa', day: 'gg' },\n be: { year: 'гггг', month: 'мм', day: 'дд' },\n bg: { year: 'гггг', month: 'мм', day: 'дд' },\n bn: { year: 'yyyy', month: 'মিমি', day: 'dd' },\n br: { year: 'bbbb', month: 'mm', day: 'dd' },\n bs: { year: 'gggg', month: 'mm', day: 'dd' },\n ca: { year: 'aaaa', month: 'mm', day: 'dd' },\n cak: { year: 'jjjj', month: 'ii', day: \"q'q'\" },\n ckb: { year: 'ساڵ', month: 'مانگ', day: 'ڕۆژ' },\n cs: { year: 'rrrr', month: 'mm', day: 'dd' },\n cy: { year: 'bbbb', month: 'mm', day: 'dd' },\n da: { year: 'åååå', month: 'mm', day: 'dd' },\n de: { year: 'jjjj', month: 'mm', day: 'tt' },\n dsb: { year: 'llll', month: 'mm', day: 'źź' },\n el: { year: 'εεεε', month: 'μμ', day: 'ηη' },\n en: { year: 'yyyy', month: 'mm', day: 'dd' },\n eo: { year: 'jjjj', month: 'mm', day: 'tt' },\n es: { year: 'aaaa', month: 'mm', day: 'dd' },\n et: { year: 'aaaa', month: 'kk', day: 'pp' },\n eu: { year: 'uuuu', month: 'hh', day: 'ee' },\n fa: { year: 'سال', month: 'ماه', day: 'روز' },\n ff: { year: 'hhhh', month: 'll', day: 'ññ' },\n fi: { year: 'vvvv', month: 'kk', day: 'pp' },\n fr: { year: 'aaaa', month: 'mm', day: 'jj' },\n fy: { year: 'jjjj', month: 'mm', day: 'dd' },\n ga: { year: 'bbbb', month: 'mm', day: 'll' },\n gd: { year: 'bbbb', month: 'mm', day: 'll' },\n gl: { year: 'aaaa', month: 'mm', day: 'dd' },\n he: { year: 'שנה', month: 'חודש', day: 'יום' },\n hr: { year: 'gggg', month: 'mm', day: 'dd' },\n hsb: { year: 'llll', month: 'mm', day: 'dd' },\n hu: { year: 'éééé', month: 'hh', day: 'nn' },\n ia: { year: 'aaaa', month: 'mm', day: 'dd' },\n id: { year: 'tttt', month: 'bb', day: 'hh' },\n it: { year: 'aaaa', month: 'mm', day: 'gg' },\n ja: { year: ' 年 ', month: '月', day: '日' },\n ka: { year: 'წწწწ', month: 'თთ', day: 'რრ' },\n kk: { year: 'жжжж', month: 'аа', day: 'кк' },\n kn: { year: 'ವವವವ', month: 'ಮಿಮೀ', day: 'ದಿದಿ' },\n ko: { year: '연도', month: '월', day: '일' },\n lb: { year: 'jjjj', month: 'mm', day: 'dd' },\n lo: { year: 'ປປປປ', month: 'ດດ', day: 'ວວ' },\n lt: { year: 'mmmm', month: 'mm', day: 'dd' },\n lv: { year: 'gggg', month: 'mm', day: 'dd' },\n meh: { year: 'aaaa', month: 'mm', day: 'dd' },\n ml: { year: 'വർഷം', month: 'മാസം', day: 'തീയതി' },\n ms: { year: 'tttt', month: 'mm', day: 'hh' },\n nl: { year: 'jjjj', month: 'mm', day: 'dd' },\n nn: { year: 'åååå', month: 'mm', day: 'dd' },\n no: { year: 'åååå', month: 'mm', day: 'dd' },\n oc: { year: 'aaaa', month: 'mm', day: 'jj' },\n pl: { year: 'rrrr', month: 'mm', day: 'dd' },\n pt: { year: 'aaaa', month: 'mm', day: 'dd' },\n rm: { year: 'oooo', month: 'mm', day: 'dd' },\n ro: { year: 'aaaa', month: 'll', day: 'zz' },\n ru: { year: 'гггг', month: 'мм', day: 'дд' },\n sc: { year: 'aaaa', month: 'mm', day: 'dd' },\n scn: { year: 'aaaa', month: 'mm', day: 'jj' },\n sk: { year: 'rrrr', month: 'mm', day: 'dd' },\n sl: { year: 'llll', month: 'mm', day: 'dd' },\n sr: { year: 'гггг', month: 'мм', day: 'дд' },\n sv: { year: 'åååå', month: 'mm', day: 'dd' },\n szl: { year: 'rrrr', month: 'mm', day: 'dd' },\n tg: { year: 'сссс', month: 'мм', day: 'рр' },\n th: { year: 'ปปปป', month: 'ดด', day: 'วว' },\n tr: { year: 'yyyy', month: 'aa', day: 'gg' },\n uk: { year: 'рррр', month: 'мм', day: 'дд' },\n 'zh-CN': { year: '年', month: '月', day: '日' },\n 'zh-TW': { year: '年', month: '月', day: '日' }\n};\n\nfunction getPlaceholderObj(locale: SupportedLocale | (string & {})) {\n if (!isSupportedLocale(locale)) {\n const localeLanguage = getLocaleLanguage(locale);\n if (!isSupportedLocale(localeLanguage)) {\n return placeholders.en;\n } else {\n return placeholders[localeLanguage];\n }\n } else {\n return placeholders[locale];\n }\n}\n\ntype Field = 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod';\n\nexport function getPlaceholder(field: Field, value: string, locale: SupportedLocale | (string & {})) {\n if (isPlaceholderField(field)) return getPlaceholderObj(locale)[field];\n if (isDefaultField(field)) return value;\n if (isTimeField(field)) return '––';\n return '';\n}\n\nfunction isSupportedLocale(locale: string): locale is SupportedLocale {\n return supportedLocales.includes(locale as SupportedLocale);\n}\n\nfunction isPlaceholderField(field: unknown): field is PlaceholderField {\n return placeholderFields.includes(field as PlaceholderField);\n}\n\nfunction isTimeField(field: unknown): field is 'hour' | 'minute' | 'second' {\n return field === 'hour' || field === 'minute' || field === 'second';\n}\n\nfunction isDefaultField(field: unknown): field is 'era' | 'dayPeriod' {\n return field === 'era' || field === 'dayPeriod';\n}\n\nfunction getLocaleLanguage(locale: string) {\n if (Intl.Locale) {\n return new Intl.Locale(locale).language;\n }\n return locale.split('-')[0];\n}\n","import { Granularity } from './comparators';\nimport { DateStep, HourCycle } from './types';\n\nexport function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue: boolean = false) {\n const opts: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n timeZoneName: 'short',\n hourCycle: normalizeHourCycle(hourCycle),\n hour12: normalizeHour12(hourCycle)\n };\n if (isTimeValue) {\n delete opts.year;\n delete opts.month;\n delete opts.day;\n }\n\n if (granularity === 'day') {\n delete opts.second;\n delete opts.hour;\n delete opts.minute;\n delete opts.timeZoneName;\n }\n if (granularity === 'hour') {\n delete opts.minute;\n delete opts.second;\n }\n\n if (granularity === 'minute') delete opts.second;\n\n return opts;\n}\n\nexport function normalizeDateStep(step?: DateStep): DateStep {\n return {\n year: step?.year ?? 1,\n month: step?.month ?? 1,\n day: step?.day ?? 1,\n hour: step?.hour ?? 1,\n minute: step?.minute ?? 1,\n second: step?.second ?? 1,\n millisecond: step?.millisecond ?? 1\n };\n}\n\nexport function handleCalendarInitialFocus(calendar: HTMLElement) {\n const selectedDay = calendar.querySelector<HTMLElement>('[data-selected]');\n if (selectedDay) return selectedDay.focus();\n\n const today = calendar.querySelector<HTMLElement>('[data-today]');\n if (today) return today.focus();\n\n const firstDay = calendar.querySelector<HTMLElement>('[data-rdx-calendar-day]');\n if (firstDay) return firstDay.focus();\n}\n\nexport function normalizeHourCycle(hourCycle: HourCycle) {\n if (hourCycle === 24) return 'h23';\n if (hourCycle === 12) return 'h11';\n return undefined;\n}\n\nexport function normalizeHour12(hourCycle: HourCycle) {\n if (hourCycle === 24) return false;\n if (hourCycle === 12) return true;\n return undefined;\n}\n","import { InputSignal } from '@angular/core';\nimport { DateFields, DateValue } from '@internationalized/date';\nimport { Granularity, isZonedDateTime, TIME_GRANULARITIES, toDate } from './comparators';\nimport { Formatter } from './formatter';\nimport {\n DATE_SEGMENT_PARTS,\n EDITABLE_SEGMENT_PARTS,\n isDateSegmentPart,\n isSegmentPart,\n TIME_SEGMENT_PARTS\n} from './parts';\nimport { getPlaceholder } from './placeholders';\nimport { DateSegmentPart, HourCycle, SegmentContentObj, SegmentPart, SegmentValueObj, TimeSegmentPart } from './types';\nimport { getOptsByGranularity, normalizeHourCycle } from './utils';\n\ntype SyncDateSegmentValuesProps = {\n value: DateValue;\n formatter: Formatter;\n};\n\ntype SyncTimeSegmentValuesProps = {\n value: DateValue;\n formatter: Formatter;\n};\n\nexport function syncTimeSegmentValues(props: SyncTimeSegmentValuesProps) {\n return Object.fromEntries(\n TIME_SEGMENT_PARTS.map((part) => {\n if (part === 'dayPeriod') return [part, props.formatter.dayPeriod(toDate(props.value))];\n return [part, props.value[part as keyof DateValue]];\n })\n ) as SegmentValueObj;\n}\n\nexport function initializeSegmentValues(granularity: Granularity, isTimeValue = false): SegmentValueObj {\n const initialParts = EDITABLE_SEGMENT_PARTS.map((part) => {\n if (part === 'dayPeriod') return [part, 'AM'];\n\n return [part, null];\n }).filter(([key]) => {\n if (key === 'literal' || key === null) return false;\n // A time-only field has no date segments, so they must not be seeded — otherwise they\n // stay null forever and block committing the value (every segment must be filled).\n if (isTimeValue && isDateSegmentPart(key)) return false;\n if (granularity === 'minute' && key === 'second') return false;\n if (granularity === 'hour' && (key === 'second' || key === 'minute')) return false;\n if (granularity === 'day') return !TIME_GRANULARITIES.includes(key as Granularity) && key !== 'dayPeriod';\n else return true;\n });\n\n return Object.fromEntries(initialParts);\n}\n\ntype SharedContentProps = {\n granularity: Granularity;\n dateRef: DateValue;\n formatter: Formatter;\n hideTimeZone: boolean;\n hourCycle: HourCycle;\n isTimeValue?: boolean;\n};\n\ntype CreateContentObjProps = SharedContentProps & {\n segmentValues: SegmentValueObj;\n locale: InputSignal<string>;\n};\n\ntype CreateContentArrProps = SharedContentProps & {\n contentObj: SegmentContentObj;\n};\n\nexport function syncSegmentValues(props: SyncDateSegmentValuesProps) {\n const { formatter } = props;\n\n const dateValues = DATE_SEGMENT_PARTS.map((part) => {\n return [part, props.value[part]];\n });\n if ('hour' in props.value) {\n const timeValues = syncTimeSegmentValues({ value: props.value, formatter });\n\n return { ...Object.fromEntries(dateValues), ...timeValues } as SegmentValueObj;\n }\n\n return Object.fromEntries(dateValues) as SegmentValueObj;\n}\n\nfunction createContentObj(props: CreateContentObjProps) {\n const { segmentValues, formatter, locale } = props;\n function getPartContent(part: DateSegmentPart | TimeSegmentPart) {\n if ('hour' in segmentValues) {\n const value = segmentValues[part];\n if (value !== null) {\n if (part === 'day') {\n return formatter.part(\n props.dateRef.set({\n [part as keyof DateFields]: value,\n /**\n * Edge case for the day field:\n *\n * 1. If the month is filled,\n * we need to ensure that the day snaps to the maximum value of that month.\n * 2. If the month is not filled,\n * we default to the month with the maximum number of days (here just using January, 31 days),\n * so that user can input any possible day.\n */\n month: segmentValues.month ?? 1\n }),\n part,\n { hourCycle: normalizeHourCycle(props.hourCycle) }\n );\n }\n return formatter.part(props.dateRef.set({ [part]: value }), part, {\n hourCycle: normalizeHourCycle(props.hourCycle)\n });\n } else {\n return getPlaceholder(part, '', locale());\n }\n } else {\n if (isDateSegmentPart(part)) {\n const value = segmentValues[part];\n if (value !== null) {\n if (part === 'day') {\n return formatter.part(\n props.dateRef.set({\n [part]: value,\n // Same logic as above for the day field\n month: segmentValues.month ?? 1\n }),\n part\n );\n }\n\n return formatter.part(props.dateRef.set({ [part]: value }), part);\n } else {\n return getPlaceholder(part, '', locale());\n }\n }\n return '';\n }\n }\n\n const content = Object.keys(segmentValues).reduce((obj, part) => {\n if (!isSegmentPart(part)) return obj;\n if ('hour' in segmentValues && part === 'dayPeriod') {\n const value = segmentValues[part];\n\n if (value !== null) obj[part] = value;\n else obj[part] = getPlaceholder(part, 'AM', locale());\n } else {\n obj[part] = getPartContent(part);\n }\n\n return obj;\n }, {} as SegmentContentObj);\n\n return content;\n}\n\nfunction createContentArr(props: CreateContentArrProps) {\n const { granularity, formatter, contentObj, hideTimeZone, hourCycle, isTimeValue } = props;\n const parts = formatter.toParts(props.dateRef, getOptsByGranularity(granularity, hourCycle, isTimeValue));\n\n const segmentContentArr = parts\n .map((part) => {\n const defaultParts = ['literal', 'timeZoneName', null];\n\n if (defaultParts.includes(part.type) || !isSegmentPart(part.type)) {\n return {\n part: part.type,\n value: part.value\n };\n }\n\n return {\n part: part.type,\n value: contentObj[part.type]\n };\n })\n .filter((segment): segment is { part: SegmentPart; value: string } => {\n if (segment.part === null || segment.value === null) return false;\n if (segment.part === 'timeZoneName' && (!isZonedDateTime(props.dateRef) || hideTimeZone)) return false;\n\n return true;\n });\n\n return segmentContentArr;\n}\n\ntype CreateContentProps = CreateContentObjProps;\n\nexport function createContent(props: CreateContentProps) {\n const contentObj = createContentObj(props);\n\n const contentArr = createContentArr({\n contentObj,\n ...props\n });\n\n return {\n obj: contentObj,\n arr: contentArr\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 SPACE_CODE = 'Space';\n","import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BACKSPACE, ENTER, SPACE } from '../kbd-constants';\n\nexport function isSegmentNavigationKey(key: string) {\n if (key === ARROW_RIGHT || key === ARROW_LEFT) return true;\n return false;\n}\n\nexport function isNumberString(value: string) {\n if (Number.isNaN(Number.parseInt(value))) return false;\n return true;\n}\n\nexport function isAcceptableSegmentKey(key: string) {\n const acceptableSegmentKeys = [\n ENTER,\n ARROW_UP,\n ARROW_DOWN,\n ARROW_LEFT,\n ARROW_RIGHT,\n BACKSPACE,\n SPACE,\n 'a',\n 'A',\n 'p',\n 'P'\n ];\n if (acceptableSegmentKeys.includes(key)) return true;\n if (isNumberString(key)) return true;\n return false;\n}\n\nexport function getSegmentElements(parentElement: HTMLElement): Element[] {\n return Array.from(parentElement.querySelectorAll('[data-rdx-date-field-segment]')).filter(\n (item) => item.getAttribute('data-rdx-date-field-segment') !== 'literal'\n );\n}\n","/*\n * Implementation ported from https://github.com/melt-ui/melt-ui/blob/develop/src/lib/internal/helpers/date/types.ts\n */\n\nimport type { DateValue } from '@internationalized/date';\nimport { DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS } from './parts';\n\nexport type DateMatcher = (date: DateValue) => boolean;\n\nexport type DateStep = {\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n millisecond?: number;\n};\n\nexport type DateRange = {\n start: DateValue | undefined;\n end: DateValue | undefined;\n};\n\nexport type HourCycle = 12 | 24 | undefined;\n\nexport type Month<T> = {\n /**\n * A `DateValue` used to represent the month. Since days\n * from the previous and next months may be included in the\n * calendar grid, we need a source of truth for the value\n * the grid is representing.\n */\n value: DateValue;\n\n /**\n * An array of (rows) arrays representing the weeks in the calendar.\n * Each sub-array represents a week, and contains the dates for each\n * day in that week. This structure is useful for rendering the calendar\n * grid using a table, where each row represents a week and each cell\n * represents a day.\n */\n weeks: T[][];\n\n /**\n * An array of (cells) all the dates in the current month, including dates from\n * the previous and next months that are used to fill out the calendar grid.\n * This array is useful for rendering the calendar grid in a customizable way,\n * as it provides all the dates that should be displayed in the grid in a flat\n * array.\n */\n dates: T[];\n};\n\nexport type DateSegmentPart = (typeof DATE_SEGMENT_PARTS)[number];\nexport type TimeSegmentPart = (typeof TIME_SEGMENT_PARTS)[number];\nexport type EditableSegmentPart = (typeof EDITABLE_SEGMENT_PARTS)[number];\nexport type NonEditableSegmentPart = (typeof NON_EDITABLE_SEGMENT_PARTS)[number];\nexport type SegmentPart = EditableSegmentPart | NonEditableSegmentPart;\n\nexport type AnyExceptLiteral = Exclude<SegmentPart, 'literal'>;\n\nexport type DayPeriod = 'AM' | 'PM' | null;\nexport type DateSegmentObj = {\n [K in DateSegmentPart]: number | null;\n};\n\nexport type TimeSegmentObj = {\n [K in TimeSegmentPart]: K extends 'dayPeriod' ? DayPeriod : number | null;\n};\nexport type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj;\nexport type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj;\nexport type SegmentContentObj = Record<EditableSegmentPart, string>;\n","// https://github.com/unovue/reka-ui/blob/v2/packages/core/src/shared/date/useDateField.ts\n\nimport { computed, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { CalendarDateTime, CycleTimeOptions, DateFields, DateValue, TimeFields } from '@internationalized/date';\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BACKSPACE, SHIFT, TAB } from '../kbd-constants';\nimport { getDaysInMonth, toDate } from './comparators';\nimport { Formatter } from './formatter';\nimport { isAcceptableSegmentKey, isNumberString, isSegmentNavigationKey } from './segment';\nimport { AnyExceptLiteral, DateAndTimeSegmentObj, DateStep, HourCycle, SegmentPart, SegmentValueObj } from './types';\n\n/** Convert a canonical 24-hour value (0-23) to its 12-hour clock equivalent (1-12). */\nfunction to12Hour(hour: number): number {\n const h = hour % 12;\n return h === 0 ? 12 : h;\n}\n\n/** Combine a 12-hour clock value (1-12) with a day period into a canonical 24-hour value (0-23). */\nfunction to24Hour(hour: number, period: 'AM' | 'PM'): number {\n const h = hour % 12;\n return period === 'PM' ? h + 12 : h;\n}\n\n/** The day period a canonical 24-hour value belongs to. */\nfunction dayPeriodForHour(hour: number): 'AM' | 'PM' {\n return hour >= 12 ? 'PM' : 'AM';\n}\n\ntype MinuteSecondIncrementProps = {\n e: KeyboardEvent;\n part: keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n};\n\ntype DateTimeValueIncrementation = {\n e: KeyboardEvent;\n part: keyof Omit<DateFields, 'era'> | keyof TimeFields;\n dateRef: DateValue;\n prevValue: number | null;\n hourCycle?: HourCycle;\n};\n\nexport type UseDateFieldProps = {\n hasLeftFocus: WritableSignal<boolean>;\n lastKeyZero: WritableSignal<boolean>;\n placeholder: ModelSignal<DateValue> | WritableSignal<DateValue>;\n hourCycle: HourCycle;\n formatter: Formatter;\n segmentValues: WritableSignal<SegmentValueObj>;\n step: Signal<DateStep>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n part: SegmentPart;\n modelValue: ModelSignal<DateValue | undefined> | WritableSignal<DateValue | undefined>;\n focusNext: () => void;\n};\n\ntype SegmentAttrProps = {\n disabled: boolean;\n segmentValues: SegmentValueObj;\n hourCycle: HourCycle;\n placeholder: DateValue;\n formatter: Formatter;\n};\n\nfunction commonSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: 'spinbutton',\n contenteditable: true,\n tabindex: props.disabled ? undefined : 0,\n spellcheck: false,\n inputmode: 'numeric',\n autocorrect: 'off',\n enterkeyhint: 'next',\n style: 'caret-color: transparent;'\n };\n}\n\ntype NumericSegmentConfig = {\n field: 'day' | 'month' | 'year' | 'hour' | 'minute' | 'second';\n label: string;\n valueMin: number;\n valueMax: number | ((date: DateValue) => number);\n valueText?: (date: DateValue) => string;\n /** Time parts only exist on date-time values; bail out when the segment is absent. */\n timePart?: boolean;\n};\n\n/**\n * Shared spinbutton attributes for the numeric segments (day/month/year/hour/minute/second).\n * Each segment differs only in its field, bounds, label and optional value-text formatting.\n */\nfunction numericSegmentAttrs(props: SegmentAttrProps, config: NumericSegmentConfig) {\n const { segmentValues, placeholder } = props;\n const { field } = config;\n\n if (config.timePart && (!(field in segmentValues) || !(field in placeholder))) return {};\n\n const value = (segmentValues as Record<string, number | null>)[field];\n const isEmpty = value == null;\n const date = value != null ? placeholder.set({ [field]: value } as Partial<DateFields & TimeFields>) : placeholder;\n const valueNow = (date as unknown as Record<string, number>)[field];\n const valueMax = typeof config.valueMax === 'function' ? config.valueMax(date) : config.valueMax;\n const valueText = isEmpty ? 'Empty' : (config.valueText?.(date) ?? `${valueNow}`);\n\n return {\n ...commonSegmentAttrs(props),\n 'aria-label': config.label,\n 'aria-valuemin': config.valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText,\n 'data-placeholder': isEmpty ? '' : undefined\n };\n}\n\nfunction daySegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'day',\n label: 'day,',\n valueMin: 1,\n valueMax: (date) => getDaysInMonth(date)\n });\n}\n\nfunction monthSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'month',\n label: 'month, ',\n valueMin: 1,\n valueMax: 12,\n valueText: (date) => `${date.month} - ${props.formatter.fullMonth(toDate(date))}`\n });\n}\n\nfunction yearSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, { field: 'year', label: 'year, ', valueMin: 1, valueMax: 9999 });\n}\n\nfunction hourSegmentAttrs(props: SegmentAttrProps) {\n const is12h = props.hourCycle === 12;\n return numericSegmentAttrs(props, {\n field: 'hour',\n label: 'hour, ',\n valueMin: is12h ? 1 : 0,\n valueMax: is12h ? 12 : 23,\n valueText: (date) =>\n `${(date as CalendarDateTime).hour} ${(props.segmentValues as DateAndTimeSegmentObj).dayPeriod ?? ''}`,\n timePart: true\n });\n}\n\nfunction minuteSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'minute',\n label: 'minute, ',\n valueMin: 0,\n valueMax: 59,\n timePart: true\n });\n}\n\nfunction secondSegmentAttrs(props: SegmentAttrProps) {\n return numericSegmentAttrs(props, {\n field: 'second',\n label: 'second, ',\n valueMin: 0,\n valueMax: 59,\n timePart: true\n });\n}\n\nfunction dayPeriodSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues } = props;\n if (!('dayPeriod' in segmentValues)) return {};\n\n const valueMin = 0;\n const valueMax = 12;\n const valueNow =\n segmentValues.hour != null ? (segmentValues.hour > 12 ? segmentValues.hour - 12 : segmentValues.hour) : 0;\n const valueText = segmentValues.dayPeriod ?? 'AM';\n\n return {\n ...commonSegmentAttrs(props),\n inputmode: 'text',\n 'aria-label': 'AM/PM',\n 'aria-valuemin': valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText\n };\n}\n\nfunction literalSegmentAttrs(_props: SegmentAttrProps) {\n return {\n 'aria-hidden': true,\n 'data-segment': 'literal'\n };\n}\n\nfunction timeZoneSegmentAttrs(props: SegmentAttrProps) {\n return {\n role: 'textbox',\n 'aria-label': 'timezone, ',\n 'data-readonly': true,\n 'data-segment': 'timeZoneName',\n tabindex: props.disabled ? undefined : 0,\n style: 'caret-color: transparent;'\n };\n}\n\nfunction eraSegmentAttrs(props: SegmentAttrProps) {\n const { segmentValues, placeholder } = props;\n\n const valueMin = 0;\n const valueMax = 0;\n const valueNow = 0;\n const valueText = 'era' in segmentValues ? segmentValues.era : placeholder.era;\n\n return {\n ...commonSegmentAttrs(props),\n 'aria-label': 'era',\n 'aria-valuemin': valueMin,\n 'aria-valuemax': valueMax,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': valueText\n };\n}\n\nexport const segmentBuilders = {\n day: {\n attrs: daySegmentAttrs\n },\n month: {\n attrs: monthSegmentAttrs\n },\n year: {\n attrs: yearSegmentAttrs\n },\n hour: {\n attrs: hourSegmentAttrs\n },\n minute: {\n attrs: minuteSegmentAttrs\n },\n second: {\n attrs: secondSegmentAttrs\n },\n dayPeriod: {\n attrs: dayPeriodSegmentAttrs\n },\n literal: {\n attrs: literalSegmentAttrs\n },\n timeZoneName: {\n attrs: timeZoneSegmentAttrs\n },\n era: {\n attrs: eraSegmentAttrs\n }\n};\n\nexport function useDateField(props: UseDateFieldProps) {\n function handleSegmentClick(e: MouseEvent) {\n const disabled = props.disabled();\n if (disabled) e.preventDefault();\n }\n\n function deleteValue(prevValue: number | null) {\n props.hasLeftFocus.set(false);\n\n if (prevValue === null) return prevValue;\n\n const str = prevValue.toString();\n if (str.length === 1) {\n props.modelValue.set(undefined);\n return null;\n }\n\n return Number.parseInt(str.slice(0, -1));\n }\n\n function dateTimeValueIncrementation({\n e,\n part,\n dateRef,\n prevValue,\n hourCycle\n }: DateTimeValueIncrementation): number {\n const step = props.step()[part] ?? 1;\n const sign = e.key === ARROW_UP ? step : -step;\n\n if (prevValue === null) return dateRef[part as keyof Omit<DateFields, 'era'>];\n\n if (part === 'hour' && 'hour' in dateRef) {\n const cycleArgs: [keyof DateFields | keyof TimeFields, number, CycleTimeOptions?] = [\n part,\n sign,\n { hourCycle }\n ];\n return dateRef.set({ [part as keyof DateValue]: prevValue }).cycle(...cycleArgs)[part];\n }\n\n const cycleArgs: [keyof DateFields, number] = [part as keyof DateFields, sign];\n if (part === 'day' && props.segmentValues().month !== null)\n return dateRef\n .set({ [part as keyof DateValue]: prevValue, month: props.segmentValues().month! })\n .cycle(...cycleArgs)[part as keyof Omit<DateFields, 'era'>];\n\n return dateRef.set({ [part as keyof DateValue]: prevValue }).cycle(...cycleArgs)[\n part as keyof Omit<DateFields, 'era'>\n ];\n }\n\n /**\n * Shared two-digit entry state machine for the numeric segments (day, month, hour,\n * minute, second). Types one digit into `prev`, deciding the new value and whether focus\n * should advance to the next segment.\n *\n * @param emptyZero what a leading `0` produces on an empty segment — `0` for time parts\n * (midnight/`:00` are valid), `null` for day/month (no zeroth day/month).\n * @param moveOnOverflow also advance focus when the two-digit total exceeds `max`\n * (day/month behavior; time parts only advance on `num > maxStart`).\n */\n function updateNumberSegment(\n num: number,\n prev: number | null,\n max: number,\n { emptyZero = true, moveOnOverflow = false }: { emptyZero?: boolean; moveOnOverflow?: boolean } = {}\n ): { value: number | null; moveToNext: boolean } {\n let moveToNext = false;\n const maxStart = Math.floor(max / 10);\n\n // If the user has left the segment, reset `prev` so typing restarts the segment.\n if (props.hasLeftFocus()) {\n props.hasLeftFocus.set(false);\n prev = null;\n }\n\n if (prev === null) {\n // A leading 0 is tracked so the next digit can advance to the next segment.\n if (num === 0) {\n props.lastKeyZero.set(true);\n return { value: emptyZero ? 0 : null, moveToNext };\n }\n // If the last key was 0, or the first digit can't start a valid two-digit number\n // (> the max start digit), advance to the next segment.\n if (props.lastKeyZero() || num > maxStart) {\n moveToNext = true;\n }\n props.lastKeyZero.set(false);\n return { value: num, moveToNext };\n }\n\n // Either the segment already holds two digits, or appending this digit overflows `max`:\n // reset the segment as if backspaced and then typed.\n const digits = prev.toString().length;\n const total = Number.parseInt(prev.toString() + num.toString());\n\n if (digits === 2 || total > max) {\n if (num > maxStart || (moveOnOverflow && total > max)) {\n moveToNext = true;\n }\n return { value: num, moveToNext };\n }\n\n moveToNext = true;\n return { value: total, moveToNext };\n }\n\n function updateDayOrMonth(max: number, num: number, prev: number | null) {\n return updateNumberSegment(num, prev, max, { emptyZero: false, moveOnOverflow: true });\n }\n\n function updateYear(num: number, prev: number | null) {\n let moveToNext = false;\n\n /**\n * If the user has left the segment, we want to reset the\n * `prev` value so that we can start the segment over again\n * when the user types a number.\n */\n // probably not implement, kind of weird\n if (props.hasLeftFocus()) {\n props.hasLeftFocus.set(false);\n prev = null;\n }\n\n if (prev === null) return { value: num === 0 ? 1 : num, moveToNext };\n\n const str = prev.toString() + num.toString();\n\n if (str.length > 4) return { value: num === 0 ? 1 : num, moveToNext };\n\n if (str.length === 4) moveToNext = true;\n\n const int = Number.parseInt(str);\n return { value: int, moveToNext };\n }\n\n function updateHour(num: number, prev: number | null, max: number) {\n return updateNumberSegment(num, prev, max);\n }\n\n function updateMinuteOrSecond(num: number, prev: number | null) {\n return updateNumberSegment(num, prev, 59);\n }\n\n function minuteSecondIncrementation({ e, part, dateRef, prevValue }: MinuteSecondIncrementProps): number {\n const step = props.step()[part] ?? 1;\n const sign = e.key === ARROW_UP ? step : -step;\n const min = 0;\n const max = 59;\n\n if (prevValue === null) return sign > 0 ? min : max;\n\n const cycleArgs: [keyof TimeFields, number] = [part, sign];\n return (dateRef as CalendarDateTime).set({ [part]: prevValue }).cycle(...cycleArgs)[part];\n }\n\n const attributes = computed(\n () =>\n segmentBuilders[props.part]?.attrs({\n disabled: props.disabled(),\n placeholder: props.placeholder(),\n hourCycle: props.hourCycle,\n segmentValues: props.segmentValues(),\n formatter: props.formatter\n }) ?? {}\n );\n\n function handleMonthSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().month;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n month: dateTimeValueIncrementation({\n e,\n part: 'month',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateDayOrMonth(12, num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, month: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, month: deleteValue(prevValue) }));\n }\n }\n\n function handleDaySegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().day;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n day: dateTimeValueIncrementation({\n e,\n part: 'day',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const segmentMonthValue = props.segmentValues().month;\n\n const daysInMonth = segmentMonthValue\n ? getDaysInMonth(props.placeholder().set({ month: segmentMonthValue }))\n : getDaysInMonth(props.placeholder());\n\n const { value, moveToNext } = updateDayOrMonth(daysInMonth, num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, day: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, day: deleteValue(prevValue) }));\n }\n }\n\n function handleYearSegmentKeydown(e: KeyboardEvent) {\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;\n\n const prevValue = props.segmentValues().year;\n\n if (e.key === ARROW_DOWN || e.key === ARROW_UP) {\n props.segmentValues.update((prev) => ({\n ...prev,\n year: dateTimeValueIncrementation({\n e,\n part: 'year',\n dateRef: props.placeholder(),\n prevValue\n })\n }));\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const { value, moveToNext } = updateYear(num, prevValue);\n\n props.segmentValues.update((prev) => ({ ...prev, year: value }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, year: deleteValue(prevValue) }));\n }\n }\n\n function handleHourSegmentKeydown(e: KeyboardEvent) {\n const dateRef = props.placeholder();\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n if (\n !isAcceptableSegmentKey(e.key) ||\n isSegmentNavigationKey(e.key) ||\n !('hour' in dateRef) ||\n !('hour' in values)\n )\n return;\n\n const prevValue = values.hour;\n\n const hourCycle = props.hourCycle;\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n props.segmentValues.update((prev) => ({\n ...prev,\n hour: dateTimeValueIncrementation({\n e,\n part: 'hour',\n dateRef: props.placeholder(),\n prevValue,\n hourCycle\n })\n }));\n\n // Keep the day period in sync with the (just-updated) 24-hour value.\n const updatedHour = (props.segmentValues() as DateAndTimeSegmentObj).hour;\n if ('dayPeriod' in props.segmentValues() && updatedHour != null) {\n props.segmentValues.update((prev) => ({ ...prev, dayPeriod: dayPeriodForHour(updatedHour) }));\n }\n\n return;\n }\n\n if (isNumberString(e.key)) {\n const num = Number.parseInt(e.key);\n const is12h = hourCycle === 12;\n const period: 'AM' | 'PM' = (values.dayPeriod as 'AM' | 'PM') ?? 'AM';\n\n // Run the two-digit entry machine in the user-visible clock space (1-12 in 12h\n // mode, 0-23 otherwise), then store the canonical 24-hour value. The day period\n // is owned by its own segment, so typing the hour must not flip it.\n const prevDisplay = prevValue === null ? null : is12h ? to12Hour(prevValue) : prevValue;\n const { value, moveToNext } = updateHour(num, prevDisplay, is12h ? 12 : 23);\n const hour = value === null ? null : is12h ? to24Hour(value, period) : value;\n\n props.segmentValues.update((prev) => ({ ...prev, hour }));\n\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, hour: deleteValue(prevValue) }));\n }\n }\n\n // Minute and second segments behave identically; only the field differs.\n function handleMinuteOrSecondSegmentKeydown(e: KeyboardEvent, part: 'minute' | 'second') {\n const dateRef = props.placeholder();\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key) || !(part in dateRef) || !(part in values))\n return;\n\n const prevValue = values[part];\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n const next = minuteSecondIncrementation({ e, part, dateRef: props.placeholder(), prevValue });\n props.segmentValues.update((prev) => ({ ...prev, [part]: next }));\n }\n\n if (isNumberString(e.key)) {\n const { value, moveToNext } = updateMinuteOrSecond(Number.parseInt(e.key), prevValue);\n props.segmentValues.update((prev) => ({ ...prev, [part]: value }));\n if (moveToNext) props.focusNext();\n }\n\n if (e.key === BACKSPACE) {\n props.hasLeftFocus.set(false);\n props.segmentValues.update((prev) => ({ ...prev, [part]: deleteValue(prevValue) }));\n }\n }\n\n function handleDayPeriodSegmentKeydown(e: KeyboardEvent) {\n if (\n ((!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) && e.key !== 'a' && e.key !== 'p') ||\n !('hour' in props.placeholder()) ||\n !('dayPeriod' in props.segmentValues())\n )\n return;\n\n const values = props.segmentValues() as DateAndTimeSegmentObj;\n\n const setPeriod = (period: 'AM' | 'PM') => {\n if (values.dayPeriod === period) return;\n // Re-anchor the canonical 24-hour value to the new period without ever leaving\n // range; keep it null while the hour segment is still empty.\n const hour = values.hour == null ? null : to24Hour(to12Hour(values.hour), period);\n props.segmentValues.update((prev) => ({ ...prev, dayPeriod: period, hour }));\n };\n\n if (e.key === ARROW_UP || e.key === ARROW_DOWN) {\n setPeriod(values.dayPeriod === 'AM' ? 'PM' : 'AM');\n return;\n }\n\n if (['a', 'A'].includes(e.key)) {\n setPeriod('AM');\n return;\n }\n\n if (['p', 'P'].includes(e.key)) {\n setPeriod('PM');\n }\n }\n\n function handleSegmentKeydown(e: KeyboardEvent) {\n const disabled = props.disabled();\n const readonly = props.readonly();\n\n if (e.key !== TAB) e.preventDefault();\n\n if (disabled || readonly) return;\n\n const segmentKeydownHandlers = {\n month: handleMonthSegmentKeydown,\n day: handleDaySegmentKeydown,\n year: handleYearSegmentKeydown,\n hour: handleHourSegmentKeydown,\n minute: (e: KeyboardEvent) => handleMinuteOrSecondSegmentKeydown(e, 'minute'),\n second: (e: KeyboardEvent) => handleMinuteOrSecondSegmentKeydown(e, 'second'),\n dayPeriod: handleDayPeriodSegmentKeydown,\n timeZoneName: () => {}\n } as const;\n\n segmentKeydownHandlers[props.part as keyof typeof segmentKeydownHandlers](e);\n\n if (\n ![ARROW_LEFT, ARROW_RIGHT].includes(e.key) &&\n e.key !== TAB &&\n e.key !== SHIFT &&\n isAcceptableSegmentKey(e.key)\n ) {\n if (Object.values(props.segmentValues()).every((item) => item !== null)) {\n const updateObject = { ...(props.segmentValues() as Record<AnyExceptLiteral, number>) };\n\n let dateRef = props.placeholder().copy();\n\n Object.keys(updateObject).forEach((part) => {\n const value = updateObject[part as AnyExceptLiteral];\n dateRef = dateRef.set({ [part]: value });\n });\n\n props.modelValue.set(dateRef.copy());\n }\n }\n }\n\n return {\n handleSegmentClick,\n handleSegmentKeydown,\n attributes\n };\n}\n","export function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEvent extends Event>(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent<infer D> ? D : never)\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, {\n bubbles: false,\n cancelable: true,\n detail\n });\n if (handler) target.addEventListener(name, handler, { once: true });\n\n target.dispatchEvent(event);\n}\n","import { APP_ID, inject, Injectable } from '@angular/core';\n\n/**\n * Per-prefix counters, kept module-global so generated IDs stay deterministic within a run.\n * Determinism keeps server and client renders in sync, which matters for hydration.\n */\nconst counters = new Map<string, number>();\n\n/**\n * Generates unique, SSR-stable IDs for DOM nodes.\n *\n * IDs are deterministic per prefix (a monotonic counter) so the server and the client produce the\n * same sequence and hydration does not mismatch. The application's `APP_ID` is folded into the\n * prefix so multiple Angular apps on one page don't collide; the default `ng` app id is omitted to\n * keep IDs short for the common single-app case.\n *\n * Prefer the {@link injectId} hook at call sites; inject this service directly only when you need to\n * generate IDs lazily outside an injection context.\n */\n@Injectable({ providedIn: 'root' })\nexport class RdxIdGenerator {\n private readonly appId = inject(APP_ID);\n\n /** Generates a unique ID with the given prefix. */\n getId(prefix: string): string {\n const key = this.appId === 'ng' ? prefix : prefix + this.appId;\n const next = counters.get(key) ?? 0;\n counters.set(key, next + 1);\n\n return `${key}${next}`;\n }\n}\n\n/**\n * Returns a unique, SSR-stable ID for the given prefix — the Angular counterpart of React's\n * `useId`. Must be called in an injection context (e.g. a field initializer or constructor).\n *\n * @example\n * readonly contentId = injectId('rdx-dialog-content-');\n */\nexport function injectId(prefix: string): string {\n return inject(RdxIdGenerator).getId(prefix);\n}\n","/** Narrows to `null | undefined`. */\nexport function isNullish(value: any): value is null | undefined {\n return value === null || value === undefined;\n}\n\n/**\n * Structural equality for the value shapes a primitive can hold: primitives (incl. `NaN`), arrays,\n * plain objects, and the common built-ins `Date`, `RegExp`, `Map`, and `Set`. Reference cycles are\n * handled. Other opaque objects (e.g. class instances with no own enumerable properties) fall back\n * to per-key comparison and so only match when they expose equal enumerable state.\n */\nexport function isEqual(a: any, b: any): boolean {\n return equals(a, b, new WeakMap());\n}\n\nfunction equals(a: any, b: any, seen: WeakMap<object, unknown>): boolean {\n if (a === b) {\n return true;\n }\n\n // NaN is the one primitive that is not reference-equal to itself.\n if (typeof a === 'number' && typeof b === 'number') {\n return Number.isNaN(a) && Number.isNaN(b);\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n return false;\n }\n\n // Different prototypes (Date vs plain object, class A vs class B, …) are never structurally equal.\n if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) {\n return false;\n }\n\n // Break reference cycles: if this exact pair is already being compared on the current path,\n // the structure has matched so far — treat it as equal. Cleared on ascent so sibling branches\n // start fresh.\n if (seen.get(a) === b) {\n return true;\n }\n seen.set(a, b);\n\n try {\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (Array.isArray(a)) {\n return a.length === b.length && a.every((item: unknown, index: number) => equals(item, b[index], seen));\n }\n\n if (a instanceof Map) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const [key, value] of a) {\n if (!b.has(key) || !equals(value, b.get(key), seen)) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a instanceof Set) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const value of a) {\n if (!b.has(value)) {\n return false;\n }\n }\n\n return true;\n }\n\n const keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n\n return keys.every((key) => Object.prototype.hasOwnProperty.call(b, key) && equals(a[key], b[key], seen));\n } finally {\n seen.delete(a);\n }\n}\n","import { isEqual, isNullish } from './predicates';\n\n/**\n * A comparator for list-item values, aligned with Base UI's `isItemEqualToValue` naming.\n *\n * - a **function** `(a, b) => boolean` — full control over equality;\n * - a **string** — an object key whose values are compared with {@link isEqual} (Reka-style `by`);\n * - omitted — structural deep equality via {@link isEqual}.\n */\nexport type ItemValueComparator<T = unknown> = ((a: T, b: T) => boolean) | string;\n\n/**\n * Converts an item value to the string shown to the user.\n *\n * Strings pass through unchanged; `null`/`undefined` become an empty string; everything else is\n * coerced with `String()`. Primitives that hold object values (e.g. combobox) typically pass their\n * own `itemToStringLabel` to render a field off the object instead.\n */\nexport function itemToStringLabel(value: unknown): string {\n if (typeof value === 'string') {\n return value;\n }\n if (isNullish(value)) {\n return '';\n }\n return String(value);\n}\n\n/**\n * Converts an item value to the string used for form serialization. Defaults to the same rules as\n * {@link itemToStringLabel}; kept as a separate export so a primitive can diverge label vs. value.\n */\nexport function itemToStringValue(value: unknown): string {\n return itemToStringLabel(value);\n}\n\n/**\n * Compares two item values for equality using an optional {@link ItemValueComparator}.\n *\n * @example\n * isItemEqualToValue({ id: 1 }, { id: 1 }, 'id'); // true — compares the `id` key\n * isItemEqualToValue({ id: 1 }, { id: 1 }); // true — deep equality fallback\n */\nexport function isItemEqualToValue<T>(a: T, b: T, comparator?: ItemValueComparator<T>): boolean {\n if (typeof comparator === 'function') {\n return comparator(a, b);\n }\n\n if (typeof comparator === 'string') {\n if (isNullish(a) || isNullish(b)) {\n return a === b;\n }\n return isEqual((a as Record<string, unknown>)[comparator], (b as Record<string, unknown>)[comparator]);\n }\n\n return isEqual(a, b);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\nexport type AriaLivePoliteness = 'off' | 'polite' | 'assertive';\n\n/**\n * Announces messages to screen readers through an `aria-live` region, without moving focus.\n *\n * Own replacement for CDK's `LiveAnnouncer` — lazily appends a visually hidden live region to\n * the document body and writes messages into it. No-op on the server.\n */\n@Injectable({ providedIn: 'root' })\nexport class RdxLiveAnnouncer {\n private readonly document = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private liveElement: HTMLElement | null = null;\n private previousTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n clearTimeout(this.previousTimeout);\n this.liveElement?.remove();\n this.liveElement = null;\n });\n }\n\n /**\n * Announces a message to screen readers.\n *\n * @param message The message to announce.\n * @param politeness The politeness of the announcer element (defaults to `'polite'`).\n * @param duration If provided, the message is cleared after this many milliseconds.\n */\n announce(message: string, politeness: AriaLivePoliteness = 'polite', duration?: number): void {\n if (!this.isBrowser) {\n return;\n }\n\n const liveElement = this.getLiveElement();\n\n clearTimeout(this.previousTimeout);\n\n liveElement.setAttribute('aria-live', politeness);\n\n // Clear the live element first, then set the message after a tick so that screen\n // readers reliably pick up the change even when the text is identical.\n liveElement.textContent = '';\n this.previousTimeout = setTimeout(() => {\n liveElement.textContent = message;\n\n if (typeof duration === 'number') {\n this.previousTimeout = setTimeout(() => (liveElement.textContent = ''), duration);\n }\n });\n }\n\n /** Clears the current announcement. */\n clear(): void {\n if (this.liveElement) {\n this.liveElement.textContent = '';\n }\n }\n\n private getLiveElement(): HTMLElement {\n if (this.liveElement) {\n return this.liveElement;\n }\n\n const element = this.document.createElement('div');\n element.classList.add('rdx-live-announcer');\n element.setAttribute('aria-atomic', 'true');\n element.setAttribute('aria-live', 'polite');\n\n // Visually hide the region while keeping it available to assistive technology.\n element.style.position = 'absolute';\n element.style.width = '1px';\n element.style.height = '1px';\n element.style.margin = '-1px';\n element.style.padding = '0';\n element.style.border = '0';\n element.style.overflow = 'hidden';\n element.style.clip = 'rect(0 0 0 0)';\n element.style.clipPath = 'inset(100%)';\n element.style.whiteSpace = 'nowrap';\n\n this.document.body.appendChild(element);\n this.liveElement = element;\n\n return element;\n }\n}\n","import { forwardRef, InjectionToken, Provider, Type } from '@angular/core';\n\n/**\n * Creates an Angular provider that binds the given token to the existing instance\n * of the specified class. This is especially useful when you want multiple\n * tokens (or interfaces) to resolve to the same directive/component instance.\n *\n * @template T - The type associated with the injection token.\n * @param token - The InjectionToken or abstract type you want to provide.\n * @param type - The class type whose existing instance will be used for this token.\n * @returns A Provider configuration object for Angular's DI system.\n *\n * @example\n *\n * @Directive({\n * providers: [\n * provideToken(RdxFooToken, RdxFooDirective),\n * provideValueAccessor(RdxFooDirective)\n * ]\n * })\n * export class RdxFooDirective {}\n */\nexport function provideToken<T>(token: InjectionToken<T>, type: Type<unknown>): Provider {\n return {\n provide: token,\n useExisting: forwardRef(() => type)\n };\n}\n","export interface RdxCancelableChangeEventDetails<Reason extends string = string> {\n reason: Reason;\n event: Event;\n trigger: HTMLElement | undefined;\n cancel: () => void;\n isCanceled: () => boolean;\n preventUnmountOnClose: () => void;\n}\n\nexport interface RdxCancelableChangeEventTransaction<Reason extends string = string> {\n eventDetails: RdxCancelableChangeEventDetails<Reason>;\n shouldPreventUnmountOnClose: () => boolean;\n}\n\nexport function createCancelableChangeEventDetails<Reason extends string>(\n reason: Reason,\n event: Event,\n trigger?: HTMLElement\n): RdxCancelableChangeEventTransaction<Reason> {\n let canceled = false;\n let preventUnmountOnClose = false;\n\n return {\n eventDetails: {\n reason,\n event,\n trigger,\n cancel: () => {\n canceled = true;\n },\n isCanceled: () => canceled,\n preventUnmountOnClose: () => {\n preventUnmountOnClose = true;\n }\n },\n shouldPreventUnmountOnClose: () => preventUnmountOnClose\n };\n}\n","/**\n * The typed event map for the **shared tree-level coordination channel** on {@link RdxFloatingTree}.\n * Neutral by design — it ships no events initially. Each capability (hover-close, virtual focus, menu\n * coordination, list navigation) **augments** this interface via module augmentation rather than\n * emitting untyped strings:\n *\n * ```ts\n * declare module '@radix-ng/primitives/core' {\n * interface RdxFloatingEventMap {\n * virtualfocus: { id: string; element: HTMLElement | null };\n * }\n * }\n * ```\n *\n * **`openchange` belongs here only per-popup, not per-tree.** Base UI emits `openchange` on the\n * per-popup `FloatingRootStore.events` (`FloatingRootStore.ts:121`), not on the shared\n * `FloatingTreeStore.events`. For open-state changes, use {@link RdxFloatingRootContextEventMap} on\n * the popup's {@link RdxFloatingRootContext.events}, not this tree-level channel.\n */\n// Intentionally empty: an augmentation seed. Capabilities add keys via `declare module` augmentation,\n// which only works on an `interface` — so this must stay an interface and starts with no members.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RdxFloatingEventMap {}\n\n/**\n * The typed event map for the **per-popup events channel** on {@link RdxFloatingRootContext} —\n * the Angular counterpart of Base UI's `FloatingRootStore.events` (`FloatingRootStore.ts:121`).\n * Unlike the tree channel (one per coordinating root shared by all nested popups), this channel\n * lives **on the root context** so each popup has its own scoped emitter with no cross-popup bleed.\n */\nexport interface RdxFloatingRootContextEventMap {\n /** The popup's open-state changed. `reason` mirrors Base UI open-change reason strings. */\n openchange: { open: boolean; reason?: string; event?: Event };\n}\n\n/**\n * Neutral typed event channel — the Angular counterpart of Base UI's `createEventEmitter()`, typed\n * over `M` (a {@link RdxFloatingEventMap} sub-type for tree-level or a\n * {@link RdxFloatingRootContextEventMap} sub-type for per-popup).\n */\nexport interface RdxFloatingEvents<M extends object = RdxFloatingEventMap> {\n emit<K extends keyof M>(event: K, data: M[K]): void;\n on<K extends keyof M>(event: K, listener: (data: M[K]) => void): void;\n off<K extends keyof M>(event: K, listener: (data: M[K]) => void): void;\n}\n\n/**\n * Creates an {@link RdxFloatingEvents} emitter backed by `Map<event, Set<listener>>`, mirroring Base\n * UI's implementation: synchronous dispatch, set-deduplicated listeners, no replay.\n *\n * **Snapshot dispatch:** `emit()` snapshots the listener set before iterating so that a listener\n * calling `on()`/`off()` during dispatch does not cause skip/revisit issues.\n */\nexport function createFloatingEvents<M extends object = RdxFloatingEventMap>(): RdxFloatingEvents<M> {\n const listeners = new Map<string, Set<(data: never) => void>>();\n\n return {\n emit(event, data) {\n const set = listeners.get(event as string);\n if (!set) return;\n // Snapshot avoids mutation-during-dispatch (on()/off() in a listener).\n for (const listener of [...set]) {\n listener(data as never);\n }\n },\n on(event, listener) {\n let set = listeners.get(event as string);\n if (!set) {\n set = new Set();\n listeners.set(event as string, set);\n }\n set.add(listener as (data: never) => void);\n },\n off(event, listener) {\n listeners.get(event as string)?.delete(listener as (data: never) => void);\n }\n };\n}\n","import { computed, InjectionToken, Provider, signal, Signal } from '@angular/core';\nimport { rdxDevError } from '../dev/diagnostics';\nimport type { RdxFloatingNode, RdxFloatingTree } from './floating-tree';\n\nconst DOCS = 'utils/floating-tree';\n\n/** The three lifecycle phases of a {@link RdxFloatingRegistrationContext} (see {@link RegistrationState}). */\nexport type RdxFloatingRegistrationStatus = 'pending' | 'detached' | 'registered';\n\n/**\n * The handle's lifecycle as a **discriminated union** — three states a nullable payload would conflate:\n *\n * - **`pending`** — the directive's `effect()` has not resolved yet (the initial state, and the\n * transient window between an `onCleanup` and the next re-resolution). A child observing a `pending`\n * parent must **wait** — its own effect re-runs reactively when the parent's `status` flips — and must\n * **not** treat the parent as absent and fall back to the ambient tree / become a root.\n * - **`detached`** — the directive resolved and deliberately has **no node** (node-optional: no tree was\n * available, e.g. a standalone `rdxDismissableLayer`). A child treats a `detached` parent as absent\n * (logical parent `null`).\n * - **`registered`** — joined `tree` as `node`. The only state carrying a payload, and the only one\n * where `node`/`tree` read non-null; `node.tree === tree` holds because both are set together.\n *\n * The `pending` vs `detached` split is the whole point: \"still resolving\" and \"resolved, no node\" must\n * be distinguishable, or a child races and transiently mis-registers as a root in the wrong tree.\n */\ntype RegistrationState =\n | { readonly status: 'pending' }\n | { readonly status: 'detached' }\n | { readonly status: 'registered'; readonly tree: RdxFloatingTree; readonly node: RdxFloatingNode };\n\n/**\n * The **read-only projection** of a registration handle — what a **descendant** injects (it reads its\n * nearest ancestor's handle to resolve its logical parent, ADR 0015 §1). It deliberately exposes only\n * the reactive reads (`status` / `tree` / `node`) and **not** the writers (`register` / `markDetached` /\n * `clear`), which belong solely to the directive that owns the handle: a descendant must never be able\n * to clear or re-point its parent's registration. The {@link RDX_FLOATING_REGISTRATION} token is typed\n * as this reader, so the ergonomic, cast-free injection path is read-only; the owning directive uses the\n * concrete {@link RdxFloatingRegistrationContext} type (the writer) for its own handle.\n */\nexport interface RdxFloatingRegistrationReader {\n readonly status: Signal<RdxFloatingRegistrationStatus>;\n readonly tree: Signal<RdxFloatingTree | null>;\n readonly node: Signal<RdxFloatingNode | null>;\n}\n\n/**\n * A **stable DI handle** created at injector formation time and filled in at runtime once the\n * registration directive resolves its `externalTree` / `parentOverride` inputs.\n *\n * **Why a handle, not direct token replacement.** Angular injectors are sealed at creation — a\n * directive that resolves its tree from a runtime `externalTree` input cannot change what\n * `RDX_FLOATING_TREE` resolves to for its subtree afterwards. The handle is the object that _is_\n * provided at creation; its internal state signal changes at runtime. Descendants inject the handle\n * (with `skipSelf: true`) and read `parentReg.tree()` / `parentReg.node()` reactively — they never\n * depend on tokens being swapped post-construction.\n *\n * **Atomicity.** `tree` and `node` are **not** separate `WritableSignal`s — independent `.set()`\n * calls would create intermediate states where `node.tree !== tree`. Instead there is **one** private\n * {@link RegistrationState} signal; `register(tree, node)` sets the `registered` payload after asserting\n * `node.tree === tree`, `markDetached()` records \"resolved, no node\", and `clear()` reverts to\n * `pending`. The `tree`/`node`/`status` reads are `computed()` over that one signal, so they can never\n * disagree.\n *\n * **Registration directive usage pattern:**\n *\n * ```ts\n * @Directive({ providers: [provideFloatingRegistration()] })\n * class SomeFloatingDirective {\n * // Own handle — the WRITER side. Inject the concrete type so register()/markDetached()/clear() are\n * // available; this is the only place that writes this handle.\n * private readonly selfReg = inject(RdxFloatingRegistrationContext);\n * // Parent handle — the READER side (token is reader-typed). A descendant can read status/tree/node\n * // but cannot mutate the parent's registration.\n * private readonly parentReg = inject(RDX_FLOATING_REGISTRATION, { optional: true, skipSelf: true });\n * private readonly ambientTree = inject(RDX_FLOATING_TREE, { optional: true });\n *\n * constructor() {\n * effect((onCleanup) => {\n * const override = this.parentOverride(); // { kind: 'inherit' | 'root' | 'node' }\n *\n * // ONLY an `inherit` node depends on the DI parent, so only it waits on a `pending` parent (a\n * // `pending` parent is NOT \"no parent\"; reading status() subscribes us, so we re-run when it\n * // flips). `root` / `node` overrides are independent of the DI ancestor and register NOW —\n * // waiting on the DI parent would wrongly stall them, or strand them if that parent is destroyed.\n * if (override.kind === 'inherit' && this.parentReg?.status() === 'pending') return;\n *\n * // Logical parent from the override (DI parent only for `inherit`; a `detached` parent reads\n * // null → this node becomes a root in its tree).\n * const parentNode =\n * override.kind === 'node' ? override.parent\n * : override.kind === 'root' ? null\n * : (this.parentReg?.node() ?? null); // 'inherit'\n *\n * // Tree selection (resolveFloatingTree's logic; inject() is illegal inside effect()). A `node`\n * // override must join its parent's tree.\n * const externalTree = this.externalTreeInput(); // input() signal\n * const resolvedTree =\n * (override.kind === 'node' ? override.parent.tree : undefined) ??\n * externalTree ?? this.parentReg?.tree() ?? this.ambientTree;\n * if (!resolvedTree) {\n * this.selfReg.markDetached(); // node-optional: resolved, but no tree → no node\n * return;\n * }\n *\n * const node = resolvedTree.register({ id: ..., parent: parentNode, context: ... });\n * this.selfReg.register(resolvedTree, node);\n *\n * onCleanup(() => {\n * resolvedTree.unregister(node);\n * this.selfReg.clear(); // transient: back to 'pending' until the effect re-resolves\n * });\n * });\n * }\n * }\n * ```\n */\nexport class RdxFloatingRegistrationContext implements RdxFloatingRegistrationReader {\n private readonly _state = signal<RegistrationState>({ status: 'pending' });\n\n /**\n * Lifecycle phase: `pending` (resolving — children must wait), `detached` (resolved, node-optional),\n * or `registered`. A `computed()` over the one internal state signal. See {@link RegistrationState}.\n */\n readonly status: Signal<RdxFloatingRegistrationStatus> = computed(() => this._state().status);\n\n /**\n * The tree this directive joined, or `null` unless `status() === 'registered'`. A `computed()`\n * derived from the internal state — always consistent with {@link node} and {@link status}.\n */\n readonly tree: Signal<RdxFloatingTree | null> = computed(() => {\n const state = this._state();\n return state.status === 'registered' ? state.tree : null;\n });\n\n /**\n * The node this directive registered, or `null` unless `status() === 'registered'`. A `computed()`\n * derived from the internal state — always consistent with {@link tree}\n * (`node.tree === tree` is invariant in the `registered` state).\n */\n readonly node: Signal<RdxFloatingNode | null> = computed(() => {\n const state = this._state();\n return state.status === 'registered' ? state.node : null;\n });\n\n /**\n * Atomically records the resolved tree and the registered node (`status → 'registered'`). Asserts\n * `node.tree === tree` so no state where `tree` and `node` point to different stores can exist.\n * Called by the directive inside `effect()` after `tree.register(…)` succeeds.\n */\n register(tree: RdxFloatingTree, node: RdxFloatingNode): void {\n if (node.tree !== tree) {\n rdxDevError(\n 'floating/registration-mismatch',\n `register(tree, node): node.tree must equal tree. ` + `Node \"${node.id}\" belongs to a different tree.`,\n DOCS\n );\n }\n this._state.set({ status: 'registered', tree, node });\n }\n\n /**\n * Records that the directive **resolved but has no node** (`status → 'detached'`): node-optional —\n * no tree was available (e.g. a standalone `rdxDismissableLayer`). Distinct from `pending`: a child\n * treats a `detached` parent as absent (inherits `null`), whereas it must **wait** on a `pending` one.\n */\n markDetached(): void {\n this._state.set({ status: 'detached' });\n }\n\n /**\n * Reverts to `pending` (the `onCleanup` counterpart of {@link register} / {@link markDetached}).\n * Called after `tree.unregister(node)` so the handle re-enters the \"resolving\" phase until the\n * directive's effect re-runs; `tree`/`node` read `null` again.\n */\n clear(): void {\n this._state.set({ status: 'pending' });\n }\n}\n\n/**\n * DI token for the nearest ancestor's registration handle, **typed as the read-only\n * {@link RdxFloatingRegistrationReader}**. A descendant injects it with `{ optional: true, skipSelf:\n * true }` to read its parent's `status` / `tree` / `node` — and, because the token is reader-typed,\n * **cannot** call the parent's writers (`register` / `markDetached` / `clear`) without a deliberate\n * cast. The owning directive writes through its own handle, which it injects by the concrete\n * {@link RdxFloatingRegistrationContext} type instead (see {@link provideFloatingRegistration}).\n */\nexport const RDX_FLOATING_REGISTRATION = new InjectionToken<RdxFloatingRegistrationReader>('RdxFloatingRegistration');\n\n/**\n * Seals a fresh registration handle into this directive's injector at creation time. Returns **two**\n * providers backed by **one** instance: the concrete {@link RdxFloatingRegistrationContext} (the\n * writer, injected by the owning directive) and a reader-typed {@link RDX_FLOATING_REGISTRATION} alias\n * (`useExisting`) that descendants inject. Splitting writer from reader is what stops a descendant from\n * mutating its parent's registration. Call this in a directive's `providers` array; the directive then\n * calls `selfReg.register(tree, node)` / `markDetached()` / `clear()` on its own (writer) handle.\n */\nexport function provideFloatingRegistration(): Provider[] {\n return [\n { provide: RdxFloatingRegistrationContext, useFactory: () => new RdxFloatingRegistrationContext() },\n { provide: RDX_FLOATING_REGISTRATION, useExisting: RdxFloatingRegistrationContext }\n ];\n}\n","import { isDevMode } from '@angular/core';\nimport { rdxDevError } from '../dev/diagnostics';\nimport { createFloatingEvents, RdxFloatingEvents } from './floating-events';\nimport { RdxFloatingRootContext } from './floating-root-context';\n\n/** Module-private mutable state for {@link RdxFloatingNode}, reachable only by {@link RdxFloatingTree}. */\ninterface RdxFloatingNodeInternals {\n parent: RdxFloatingNode | null;\n context: RdxFloatingRootContext | null;\n}\n\n/** Not exported — the only handle to a node's mutable state, so consumers cannot bypass the tree. */\nconst nodeInternals = new WeakMap<RdxFloatingNode, RdxFloatingNodeInternals>();\n\n/**\n * Module-private construction key. The {@link RdxFloatingNode} constructor requires it, and its type is\n * a non-exported `unique symbol`, so consumers can neither name it (compile error) nor produce it\n * (runtime guard) — a node can only be created through {@link RdxFloatingTree.register}, never a loose\n * `new RdxFloatingNode(...)` that would exist outside `tree.all`.\n */\nconst NODE_CONSTRUCT_KEY = Symbol('RdxFloatingNode');\n\n/**\n * A neutral node in the shared floating tree — the Angular counterpart of Base UI's `FloatingNode`\n * (`{ id, parentId, context? }`). It is deliberately **lightweight**: tree membership only. The\n * popup's `open` state, trigger registry, and elements live on the separate {@link\n * RdxFloatingRootContext}, exactly as Base UI splits `FloatingNode` from `FloatingRootStore`.\n *\n * `parent` and `context` are exposed **read-only**; they are mutated **only** through {@link\n * RdxFloatingTree.setParent} / {@link RdxFloatingTree.setContext} (which enforce the cycle and\n * owner-`Document` invariants). The backing state is held in a module-private `WeakMap`, so a consumer\n * cannot reach around the tree with `node.parent = …` / `node.context = …`.\n *\n * `context` may be `null` (a contextless intermediate node). Open-ness is read from the context — there\n * is no `open` on the node — and tree traversal's `onlyOpen` filter reads `node.context?.open()`,\n * mirroring Base UI's `getNodeChildren` filtering on `child.context?.open`. Presence (`mounted`) is\n * implicit: a node is mounted **iff** it is registered in the tree.\n */\nexport class RdxFloatingNode {\n /** Which tree (store) this node belongs to — Base UI's `externalTree`. */\n readonly tree: RdxFloatingTree;\n\n /** @internal — constructed only by {@link RdxFloatingTree.register} (guarded by a module-private key). */\n constructor(\n construct: typeof NODE_CONSTRUCT_KEY,\n readonly id: string,\n tree: RdxFloatingTree,\n parent: RdxFloatingNode | null,\n context: RdxFloatingRootContext | null\n ) {\n if (construct !== NODE_CONSTRUCT_KEY) {\n rdxDevError(\n 'floating/direct-node-construction',\n 'RdxFloatingNode is created only by RdxFloatingTree.register().',\n DOCS\n );\n }\n this.tree = tree;\n nodeInternals.set(this, { parent, context });\n }\n\n /** Resolved **logical** parent (DI-derived). Reassign via {@link RdxFloatingTree.setParent}. */\n get parent(): RdxFloatingNode | null {\n return nodeInternals.get(this)!.parent;\n }\n\n /** The per-popup root context/store. `null` for a contextless node. Reassign via `tree.setContext`. */\n get context(): RdxFloatingRootContext | null {\n return nodeInternals.get(this)!.context;\n }\n}\n\n/**\n * Discriminated parent-assignment override (ADR 0015 §1). A nullable optional would collapse\n * `undefined`/`null` in Angular signals, so \"no override\" (`inherit`) and \"explicit independent root\"\n * (`root`) must be **distinct** values — they must not both reduce to `parent == null`.\n */\nexport type RdxFloatingParentOverride =\n | { kind: 'inherit' } // default: resolve from the nearest DI floating context\n | { kind: 'root' } // independent root: ignore DI ancestry, node.parent = null\n | { kind: 'node'; parent: RdxFloatingNode }; // explicit parent (detached injector-subtree composition)\n\n/** Initialization for {@link RdxFloatingTree.register}. The caller resolves `inherit` before calling. */\nexport interface RdxFloatingNodeInit {\n id: string;\n /** Already-resolved logical parent (`null` for a root). */\n parent: RdxFloatingNode | null;\n /** The per-popup root context. `null` for a contextless intermediate node. */\n context: RdxFloatingRootContext | null;\n}\n\nconst DOCS = 'utils/floating-tree';\n\n/** A node's open-state — read from its context (no `open` on the node itself). */\nfunction nodeIsOpen(node: RdxFloatingNode): boolean {\n return node.context?.open() ?? false;\n}\n\n/**\n * The shared floating tree (node store) — the Angular counterpart of Base UI's `FloatingTreeStore`.\n *\n * It owns a flat set of {@link RdxFloatingNode | nodes} linked by `parent`, an adjacency index for\n * O(1) child lookup, and a neutral typed {@link RdxFloatingEvents | event channel}. It owns **neither**\n * trigger registries **nor** `open` state — those live per-popup on each {@link RdxFloatingRootContext}\n * (Base UI keeps them on the root store, not the tree store). Dismissal (ADR 0015) and the focus\n * manager (ADR 0017) read the **same** nodes, traversal, and events; neither owns the tree.\n *\n * Ancestry is **logical** (DI-derived), not DOM-derived, so portal relocation never changes ownership\n * (ADR 0015 §1). Independent roots are **not** coordinated against each other (Base UI parity): the\n * tree only answers questions *within* itself.\n *\n * **Performance:** `isRegistered()` is O(1) via `nodeSet`; `directChildren()` is O(1) via the\n * `childrenOf` adjacency map; `ancestors()` is O(depth); `children()` is O(n) total.\n */\nexport class RdxFloatingTree {\n /**\n * Neutral typed event channel (hover-close, virtual focus, menu coordination, list nav). Private to\n * this tree, which is scoped-by-default (one per coordinating root via `provideFloatingTree()`), so\n * events never leak across unrelated popups — matching Base UI's per-`FloatingTree` events.\n */\n readonly events: RdxFloatingEvents = createFloatingEvents();\n\n /** O(1) membership test and snapshot for `all`. */\n private readonly nodeSet = new Set<RdxFloatingNode>();\n\n /**\n * Adjacency index: maps each node (or `null` for root nodes) to its direct children in\n * registration order. Maintained in sync by `register`, `unregister`, and `setParent`.\n * Eliminates the O(n) `filter` per node in recursive traversal. Invariant: only **non-empty**\n * arrays are stored — an entry is pruned the moment its last child leaves, so a key never\n * outlives its node (see `removeFromChildrenOf`).\n */\n private readonly childrenOf = new Map<RdxFloatingNode | null, RdxFloatingNode[]>();\n\n /** Registers a new node. `init.parent` must already be resolved (DI layer handles `inherit`). */\n register(init: RdxFloatingNodeInit): RdxFloatingNode {\n // Structural integrity — ALWAYS (a foreign/unregistered parent corrupts the tree, not just dev misuse).\n this.assertRegisterableParent(init.parent);\n if (isDevMode()) {\n // Validate the new context against the nearest context-bearing ancestor (through any\n // contextless intermediates). A fresh node has no descendants yet. (dev-only — cheap check\n // of correct usage, not a structural invariant.)\n this.assertContextDocument(init.context, this.nearestContext(init.parent));\n }\n\n const node = new RdxFloatingNode(NODE_CONSTRUCT_KEY, init.id, this, init.parent, init.context);\n this.nodeSet.add(node);\n this.addToChildrenOf(init.parent, node);\n return node;\n }\n\n /** Removes a node from the tree. Children are **not** removed — they keep their `parent` reference. */\n unregister(node: RdxFloatingNode): void {\n if (isDevMode()) {\n this.assertOwnedNode(node);\n }\n this.nodeSet.delete(node);\n this.removeFromChildrenOf(node.parent, node);\n // `childrenOf.get(node)` (this node's OWN child list) is intentionally NOT cleared here while\n // it still has registered children: those orphans keep their `parent` ref and must be able to\n // remove themselves later. The key is pruned automatically once the last orphan unregisters\n // (removeFromChildrenOf deletes empty lists), so the node is not retained. Orphans are never\n // reached by traversal meanwhile, since isRegistered(node) = false.\n }\n\n /**\n * Associates / re-associates / clears a node's root context after registration (Base UI attaches\n * the context once the floating element resolves). Validates the new context's owner-`Document`\n * against the nearest context-bearing **ancestor** (through contextless intermediates) **and**\n * every context-bearing **descendant**, so a contextless intermediate can never bridge two\n * documents. Allows the `null → context → null` lifecycle.\n */\n setContext(node: RdxFloatingNode, context: RdxFloatingRootContext | null): void {\n // Structural integrity — ALWAYS (mutating a foreign node corrupts another tree).\n this.assertOwnedNode(node);\n if (isDevMode() && context !== null) {\n // dev-only: expensive ancestry/subtree document validation.\n this.assertContextDocument(context, this.nearestContext(node.parent));\n for (const dc of this.descendantContexts(node)) {\n this.assertContextDocument(context, dc);\n }\n }\n\n nodeInternals.get(node)!.context = context;\n }\n\n /** Reparents an existing node (detached composition / explicit `node` override), with cycle guard. */\n setParent(node: RdxFloatingNode, parent: RdxFloatingNode | null): void {\n // Structural integrity — ALWAYS (a foreign node, or a foreign/unregistered parent, corrupts the tree).\n this.assertOwnedNode(node);\n this.assertRegisterableParent(parent);\n\n // No-op reparent: the parent is unchanged, so there is nothing to do — and crucially we must\n // NOT fall through, because removeFromChildrenOf + addToChildrenOf would move `node` to the\n // END of its sibling list, silently changing traversal/focus order (Base UI keeps node order\n // stable). The guards above still run, so a foreign/unregistered node is rejected first.\n if (node.parent === parent) {\n return;\n }\n\n // The cycle check is ALSO structural — a cycle would make traversal (children / ancestors /\n // nearestContext) recurse/loop forever — so it runs in production too. Walk the\n // prospective parent chain (stopping at an unregistered node, like `ancestors`); reaching `node`\n // means an ancestry cycle. O(depth).\n for (let ancestor = parent; ancestor !== null && this.nodeSet.has(ancestor); ancestor = ancestor.parent) {\n if (ancestor === node) {\n rdxDevError(\n 'floating/parent-cycle',\n `Reparenting node \"${node.id}\" under \"${parent?.id}\" creates an ancestry cycle.`,\n DOCS\n );\n }\n }\n\n if (isDevMode()) {\n // dev-only: validate the WHOLE subtree against the new ancestry.\n this.assertSubtreeDocuments(node, parent);\n }\n\n const oldParent = node.parent; // capture before updating internals\n nodeInternals.get(node)!.parent = parent;\n this.removeFromChildrenOf(oldParent, node);\n this.addToChildrenOf(parent, node);\n }\n\n /**\n * Direct + transitive children, in registration order. The `onlyOpen` filter (default `true`)\n * filters the **result** by each node's `context?.open()` lifecycle but **never** aborts recursion\n * at a closed node, so a keep-mounted/closed parent never hides an open grandchild (Base UI\n * `getNodeChildren`, ADR 0015 §1 traversal contract).\n *\n * Dismissal children queries pass `onlyOpen: true` (the `hasBlockingChild` pattern in the\n * capability). The focus manager's focus-return check passes `onlyOpen: false` explicitly (Base UI\n * `FloatingFocusManager.tsx:842`) — so focus inside a closed-but-mounted descendant still counts as\n * \"inside the tree\". Always pass `onlyOpen` explicitly for non-dismissal paths; do not inherit the\n * default.\n */\n children(node: RdxFloatingNode, options: { onlyOpen?: boolean } = {}): RdxFloatingNode[] {\n if (isDevMode()) {\n this.assertOwnedNode(node);\n }\n const onlyOpen = options.onlyOpen ?? true;\n const result: RdxFloatingNode[] = [];\n\n const collect = (parent: RdxFloatingNode): void => {\n for (const candidate of this.directChildren(parent)) {\n if (!onlyOpen || nodeIsOpen(candidate)) {\n result.push(candidate);\n }\n // Recurse regardless of the candidate's open-ness (never abort at a closed node).\n collect(candidate);\n }\n };\n\n collect(node);\n return result;\n }\n\n /**\n * Logical ancestors of `node`, nearest first (Base UI `getNodeAncestors`). The walk **stops at an\n * unregistered node**: Base UI resolves ancestry by `parentId` lookup in the live nodes array, so\n * unregistering a parent breaks the chain (a removed middle node truncates ancestry — its children\n * keep the raw `parent` identity but it no longer appears as an ancestor). This avoids a \"ghost\"\n * ancestor lingering in DI-ownership / document / dismissal/focus traversal when Angular destroys a\n * parent before its child.\n */\n ancestors(node: RdxFloatingNode): RdxFloatingNode[] {\n if (isDevMode()) {\n this.assertOwnedNode(node);\n }\n const result: RdxFloatingNode[] = [];\n for (let current = node.parent; current !== null && this.nodeSet.has(current); current = current.parent) {\n result.push(current);\n }\n return result;\n }\n\n /** Snapshot of all registered nodes (debugging / diagnostics). Registration order is preserved. */\n get all(): readonly RdxFloatingNode[] {\n return [...this.nodeSet];\n }\n\n // ─── Private adjacency helpers ───────────────────────────────────────────\n\n /** Direct children of `parent` in registration order. O(1) via the adjacency map. */\n private directChildren(parent: RdxFloatingNode): RdxFloatingNode[] {\n return this.childrenOf.get(parent) ?? [];\n }\n\n private addToChildrenOf(parent: RdxFloatingNode | null, node: RdxFloatingNode): void {\n let children = this.childrenOf.get(parent);\n if (!children) {\n children = [];\n this.childrenOf.set(parent, children);\n }\n children.push(node);\n }\n\n private removeFromChildrenOf(parent: RdxFloatingNode | null, node: RdxFloatingNode): void {\n const children = this.childrenOf.get(parent);\n if (!children) return;\n const idx = children.indexOf(node);\n if (idx !== -1) children.splice(idx, 1);\n // Prune the now-empty list so its `parent` key (a STRONG ref to a node) is released. Without\n // this an unregistered node that ever had a child lingers as a map key forever — retaining the\n // node → context → floating/reference DOM elements (a leak that grows on every nested\n // mount/unmount). `childrenOf` therefore only ever holds non-empty arrays.\n if (children.length === 0) {\n this.childrenOf.delete(parent);\n }\n }\n\n // ─── Private traversal helpers ───────────────────────────────────────────\n\n /**\n * Nearest context-bearing node walking up from `node` (inclusive), skipping contextless ancestors.\n * Stops at an unregistered node (same ghost-ancestry rule as {@link ancestors}).\n */\n private nearestContext(node: RdxFloatingNode | null): RdxFloatingRootContext | null {\n for (let current = node; current !== null && this.nodeSet.has(current); current = current.parent) {\n if (current.context !== null) {\n return current.context;\n }\n }\n return null;\n }\n\n /** All contexts among `node`'s transitive descendants (skips `node` itself). */\n private descendantContexts(node: RdxFloatingNode): RdxFloatingRootContext[] {\n return this.children(node, { onlyOpen: false })\n .map((descendant) => descendant.context)\n .filter((context): context is RdxFloatingRootContext => context !== null);\n }\n\n /**\n * Dev-only: validates every context in `node`'s subtree (node + transitive descendants) against\n * the nearest context-bearing ancestor walking up from `newParent`. Shared between `setParent`\n * (moves a subtree under a new parent) to keep the document-consistency rule in one place.\n */\n private assertSubtreeDocuments(node: RdxFloatingNode, newParent: RdxFloatingNode | null): void {\n const ancestorCtx = this.nearestContext(newParent);\n this.assertContextDocument(node.context, ancestorCtx);\n for (const dc of this.descendantContexts(node)) {\n this.assertContextDocument(dc, ancestorCtx);\n }\n }\n\n // ─── Private invariant guards ─────────────────────────────────────────────\n\n /** Whether `node` is currently registered in this tree. O(1). */\n private isRegistered(node: RdxFloatingNode): boolean {\n return this.nodeSet.has(node);\n }\n\n /**\n * Guards that `node` actually belongs to **this** tree and is still registered — so a tree can\n * never mutate/traverse a node owned by another tree (which would leave `node.tree` pointing\n * elsewhere while its ancestry leads here) or one that was already unregistered.\n */\n private assertOwnedNode(node: RdxFloatingNode): void {\n if (node.tree !== this || !this.nodeSet.has(node)) {\n rdxDevError(\n 'floating/foreign-node',\n 'This node does not belong to this tree (or was already unregistered).',\n DOCS\n );\n }\n }\n\n /** A parent (when given) must belong to this tree **and** still be registered. */\n private assertRegisterableParent(parent: RdxFloatingNode | null): void {\n if (parent !== null) {\n if (parent.tree !== this) {\n rdxDevError('floating/cross-tree-parent', 'A floating node parent must belong to the same tree.', DOCS);\n }\n if (!this.nodeSet.has(parent)) {\n rdxDevError(\n 'floating/unregistered-parent',\n 'A floating node parent must be currently registered in the tree.',\n DOCS\n );\n }\n }\n }\n\n /** Owner-`Document` consistency between a node's context and a related (ancestor/descendant) context. */\n private assertContextDocument(\n context: RdxFloatingRootContext | null,\n relatedContext: RdxFloatingRootContext | null\n ): void {\n if (context !== null && relatedContext !== null && context.ownerDocument !== relatedContext.ownerDocument) {\n rdxDevError(\n 'floating/cross-document-parent',\n 'A floating node must share the same ownerDocument as its ancestry/subtree.',\n DOCS\n );\n }\n }\n}\n","import { inject, InjectionToken, Provider } from '@angular/core';\nimport { RdxFloatingRootContext } from './floating-root-context';\nimport { RdxFloatingTree } from './floating-tree';\n\n/**\n * The nearest shared {@link RdxFloatingTree}. **Scoped-by-default, sharing explicit** — strict Base UI\n * parity: Base UI creates a `FloatingTree` only at the **coordination boundary** (e.g. a top-level Menu\n * renders `<FloatingTree>`, a nested submenu does **not** — it inherits the parent's store,\n * `MenuRoot.tsx:533`). There is deliberately **no** application-root provider, so the token resolves only\n * under a root that opts in with {@link provideFloatingTree}; elsewhere injecting it optionally yields\n * `null` and the primitive is its own independent root (`parent === null`).\n */\nexport const RDX_FLOATING_TREE = new InjectionToken<RdxFloatingTree>('RdxFloatingTree');\n\n/**\n * Provides a {@link RdxFloatingTree} for a subtree — the Angular `FloatingTree` analogue. **Inherit-or-\n * create:** it returns the **nearest ancestor tree** if one is already provided above, and creates a new\n * one **only at the top coordination boundary**. This is what makes it safe for a nesting-capable root\n * (Menu/Menubar/Context Menu/nested Dialog) to put it in `providers` unconditionally — a **nested**\n * instance inherits the parent's tree (so its node parents correctly), while the **top** instance starts\n * the store. (An always-new tree on a nested root would split ancestry / throw `cross-tree-parent`.)\n *\n * **Tree selection is separate from parent assignment** (Base UI: `tree = externalTree ?? contextTree`,\n * `parentId = nearest FloatingNodeContext`). This helper + {@link resolveFloatingTree} own tree\n * selection. Parent assignment is resolved at runtime via the `RdxFloatingRegistrationContext` handle\n * (`parentReg.node()` in `effect()`). In particular `{ kind: 'root' }` is **not** tree isolation — it\n * sets `parent = null` **within the same tree**. A genuinely separate tree is supplied explicitly via\n * `resolveFloatingTree(externalTree)`.\n */\nexport function provideFloatingTree(): Provider {\n return {\n provide: RDX_FLOATING_TREE,\n useFactory: () => inject(RDX_FLOATING_TREE, { optional: true, skipSelf: true }) ?? new RdxFloatingTree()\n };\n}\n\n/**\n * Resolves **which tree** a node joins — the tree-selection contract, the Angular counterpart of Base\n * UI's `externalTree ?? contextTree` (`FloatingTree.tsx:25`). An explicit `externalTree` wins,\n * otherwise the nearest injected {@link RDX_FLOATING_TREE} (or `null` → the capability runs\n * **node-optional**). Parent assignment is separate — resolved reactively via\n * `parentReg.node()` from the {@link RDX_FLOATING_REGISTRATION} handle, not via a token.\n *\n * For a **detached** node registered with an explicit `{ kind: 'node', parent }` override from a sibling\n * injector, the nearest injected tree may be absent or a *different* tree than `parent.tree` — so the\n * caller **must** pass `externalTree = override.parent.tree` here, so the node joins its parent's tree (the\n * cross-tree invariant then holds). Must be called in an injection context when `externalTree` is omitted.\n */\nexport function resolveFloatingTree(externalTree?: RdxFloatingTree | null): RdxFloatingTree | null {\n return externalTree ?? inject(RDX_FLOATING_TREE, { optional: true });\n}\n\n/**\n * The shared per-popup {@link RdxFloatingRootContext} — the Angular counterpart of Base UI's\n * `FloatingRootContext`, created by `useFloatingRootContext` at the **primitive root** and **received**\n * by `useDismiss` / `FloatingFocusManager` (they never create their own). Mirroring that: a primitive\n * root (Dialog/Popover/Menu/…) creates **one** context and provides it here; the dismissal capability\n * (ADR 0015) and the focus manager (ADR 0017) read the **same** context, so `open`, `triggers`, and the\n * elements are never split across mechanisms.\n *\n * Optional: a **standalone** `rdxDismissableLayer` (no enclosing primitive root) has none, and\n * {@link injectFloatingRootContext} creates a fallback for that case only.\n */\nexport const RDX_FLOATING_ROOT_CONTEXT = new InjectionToken<RdxFloatingRootContext>('RdxFloatingRootContext');\n\n/** Provides the shared {@link RdxFloatingRootContext} for a primitive root's subtree. */\nexport function provideFloatingRootContext(factory: () => RdxFloatingRootContext): Provider {\n return { provide: RDX_FLOATING_ROOT_CONTEXT, useFactory: factory };\n}\n\n/**\n * Returns the shared {@link RdxFloatingRootContext} provided by an enclosing primitive root, or creates\n * a **standalone fallback** via `fallback()` when none is provided (a bare `rdxDismissableLayer`). Must be\n * called in an injection context.\n */\nexport function injectFloatingRootContext(fallback: () => RdxFloatingRootContext): RdxFloatingRootContext {\n return inject(RDX_FLOATING_ROOT_CONTEXT, { optional: true }) ?? fallback();\n}\n","import { Directive, effect, inject, input, Signal } from '@angular/core';\nimport { injectId } from '../id-generator';\nimport {\n provideFloatingRegistration,\n RDX_FLOATING_REGISTRATION,\n RdxFloatingRegistrationContext\n} from './floating-registration';\nimport { RdxFloatingNode, RdxFloatingParentOverride, RdxFloatingTree } from './floating-tree';\nimport { RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_TREE } from './provide-floating-tree';\n\n/**\n * Registers a {@link RdxFloatingNode} into the shared {@link RdxFloatingTree} for its DI subtree and\n * propagates the registration handle to descendants — the reusable Angular counterpart of mounting a\n * Base UI `<FloatingNode>` (ADR 0015 §1, Phase 1). It is the **single** place that runs the handle\n * pattern; the dismissal capability (ADR 0015) and the focus manager (ADR 0017) **consume** the node /\n * context / tree it registers, they do not re-implement registration.\n *\n * **What it owns vs. what it reads.** It provides its own {@link RdxFloatingRegistrationContext} (so\n * descendants resolve it with `skipSelf`) and registers/unregisters a node reactively. It does **not**\n * create the tree or the root context — a coordination-boundary primitive root supplies those\n * (`provideFloatingTree()` inherit-or-create + `provideFloatingRootContext()`); this directive injects\n * them. With **no** enclosing tree it runs **node-optional** (`status() === 'detached'`, `node() ===\n * null`), reading its context directly — the standalone `rdxDismissableLayer` case.\n *\n * **Resolution (per {@link RdxFloatingParentOverride}).** Only an `inherit` node depends on the DI\n * parent, so only it waits on a `pending` parent; `root` / `node` overrides are independent and register\n * immediately. The node carries the injected {@link RDX_FLOATING_ROOT_CONTEXT} (or `null` for a\n * contextless intermediate). All teardown (re-resolution **and** destroy) unregisters the node and\n * reverts the handle.\n */\n@Directive({\n selector: '[rdxFloatingNode]',\n exportAs: 'rdxFloatingNode',\n providers: [provideFloatingRegistration()]\n})\nexport class RdxFloatingNodeRegistration {\n /** Explicit tree for detached sibling composition — Base UI's `externalTree`. */\n readonly externalTree = input<RdxFloatingTree | null>(null);\n /** How this node's logical parent is resolved. Defaults to `inherit` (nearest DI ancestor). */\n readonly parentOverride = input<RdxFloatingParentOverride>({ kind: 'inherit' });\n\n /** Own handle — the WRITER side (concrete class); this directive is the only writer. */\n private readonly selfReg = inject(RdxFloatingRegistrationContext);\n /** Nearest ancestor handle — the READER side (reader-typed token), or `null` at the top. */\n private readonly parentReg = inject(RDX_FLOATING_REGISTRATION, { optional: true, skipSelf: true });\n /** The enclosing tree, if a coordination boundary provided one (else node-optional). */\n private readonly ambientTree = inject(RDX_FLOATING_TREE, { optional: true });\n /** This node's per-popup context, or `null` for a contextless intermediate node. */\n private readonly rootContext = inject(RDX_FLOATING_ROOT_CONTEXT, { optional: true });\n private readonly nodeId = injectId('rdx-floating-node-');\n\n /** This directive's node once registered (`null` while `pending` / `detached`). */\n readonly node: Signal<RdxFloatingNode | null> = this.selfReg.node;\n /** Lifecycle phase of this directive's registration (`pending` | `detached` | `registered`). */\n readonly status = this.selfReg.status;\n /** The tree this node joined (`null` until `registered`). */\n readonly tree: Signal<RdxFloatingTree | null> = this.selfReg.tree;\n\n constructor() {\n effect((onCleanup) => {\n const override = this.parentOverride();\n\n // Only `inherit` depends on the DI parent → only it waits on a `pending` parent (reading\n // status() subscribes us, so we re-run when the parent resolves). `root` / `node` overrides\n // are independent of the DI ancestor and register immediately.\n if (override.kind === 'inherit' && this.parentReg?.status() === 'pending') {\n return;\n }\n\n // Logical parent: explicit for `node`, `null` for `root`, the DI parent for `inherit`\n // (a `detached` parent reads `null` → this node becomes a root within its tree).\n const parentNode =\n override.kind === 'node'\n ? override.parent\n : override.kind === 'root'\n ? null\n : (this.parentReg?.node() ?? null);\n\n // Tree selection (resolveFloatingTree's logic, replicated because inject() is illegal inside\n // effect()): a `node` override must join its parent's tree.\n const resolvedTree =\n (override.kind === 'node' ? override.parent.tree : null) ??\n this.externalTree() ??\n this.parentReg?.tree() ??\n this.ambientTree;\n\n if (!resolvedTree) {\n this.selfReg.markDetached(); // node-optional: resolved, but no tree → no node\n return;\n }\n\n const node = resolvedTree.register({\n id: this.nodeId,\n parent: parentNode,\n context: this.rootContext\n });\n this.selfReg.register(resolvedTree, node);\n\n onCleanup(() => {\n resolvedTree.unregister(node);\n this.selfReg.clear(); // transient: back to `pending` until the effect re-resolves\n });\n });\n }\n}\n","/**\n * Per-popup store of active **trigger** elements — the Angular counterpart of Base UI's\n * `triggerElements` (`PopupTriggerMap`) on each `FloatingRootStore`. One registry lives on each\n * {@link RdxFloatingRootContext} (NOT on the shared tree, and NOT on the node — the context can exist\n * without a node, e.g. the node-optional Navigation Menu case). Scoping it per-context is what keeps\n * one independent popup's trigger from counting as inside-content for an unrelated popup.\n *\n * Within its context it is read by **both** the dismissal engine (ADR 0015 — outside-press / focus-out\n * containment) and the focus manager (ADR 0017 — inside-element checks), so the two never drift into\n * different inside-element sets (ADR 0015 §1 pillar 3, §2). A trigger is plain inside-content: it has\n * **no** floating node and **no** parent — only its membership is stored here.\n *\n * Matching mirrors Base UI's `isTargetInsideEnabledTrigger`: a target counts when it is exactly a\n * registered element ({@link hasElement}) **or** a descendant of one ({@link hasMatchingElement}).\n * Membership is by **reference** (`Set.has` / `Node.contains`), so it stays correct **cross-realm** for\n * elements from another `Window` / iframe — where `target instanceof Element` against the local realm\n * would wrongly return `false`.\n */\nexport class RdxTriggerRegistry {\n private readonly elements = new Set<Element>();\n\n /** Registers `element` as a trigger. Idempotent. */\n add(element: Element): void {\n this.elements.add(element);\n }\n\n /** Removes `element` from the registry. */\n delete(element: Element): void {\n this.elements.delete(element);\n }\n\n /**\n * Exact membership — Base UI `triggerElements.hasElement(target)`. Uses reference identity\n * (`Set.has`), **not** `instanceof Element`, so a trigger from another realm/iframe still matches.\n */\n hasElement(target: EventTarget | Node | null): boolean {\n return target !== null && this.elements.has(target as Element);\n }\n\n /**\n * Ancestor match — Base UI `hasMatchingElement((t) => contains(t, target))`: `true` when any\n * registered trigger contains `target`. Catches a press/focus landing on a child of the trigger.\n */\n hasMatchingElement(target: Node | null): boolean {\n if (!target) {\n return false;\n }\n for (const element of this.elements) {\n if (element.contains(target)) {\n return true;\n }\n }\n return false;\n }\n\n /** `true` when `target` is a registered trigger or lives inside one. */\n contains(target: EventTarget | Node | null): boolean {\n if (this.hasElement(target)) {\n return true;\n }\n // `hasMatchingElement` calls `Node.contains()`, which requires a real `Node`. An `EventTarget`\n // that is not a `Node` (e.g. `window`, a `MediaQueryList`) reaches here from a DOM event target\n // and would make `contains()` throw — so duck-type `nodeType` and skip the ancestor match\n // otherwise (a non-`Node` can never be a descendant of a registered element anyway).\n return this.hasMatchingElement(isNode(target) ? target : null);\n }\n}\n\n/** Narrows an `EventTarget` to `Node` by duck-typing `nodeType` (cross-realm-safe; no `instanceof`). */\nfunction isNode(target: EventTarget | Node | null): target is Node {\n return target !== null && typeof (target as Node).nodeType === 'number';\n}\n","import { isDevMode } from '@angular/core';\nimport { rdxDevError } from '../dev/diagnostics';\nimport { createFloatingEvents, RdxFloatingEvents, RdxFloatingRootContextEventMap } from './floating-events';\nimport { RdxTriggerRegistry } from './trigger-registry';\n\nconst DOCS = 'utils/floating-tree';\n\n/** Initialization for a {@link RdxFloatingRootContext}. */\nexport interface RdxFloatingRootContextInit {\n ownerDocument: Document;\n /** Popup open-state lifecycle. Defaults to `() => false`. */\n open?: () => boolean;\n floatingElement?: HTMLElement | null;\n referenceElement?: Element | null;\n}\n\n/**\n * The per-popup **root context / store** — the Angular counterpart of Base UI's `FloatingRootStore`\n * (`FloatingRootContext`). It is a **separate entity from {@link RdxFloatingNode}** (which is only\n * `id` + `parent` + a context ref), mirroring Base UI: the node carries tree membership, the root\n * context carries the popup's `open`, elements, and trigger registry.\n *\n * Crucially it can exist **without** a node — the `getEmptyRootContext()` analog ({@link\n * createFloatingRootContext}) — which is what lets a **node-optional** capability (Navigation Menu,\n * ADR 0015 §1 / ADR 0017 #12) still read `open()`, `triggers`, and the elements while its tree node is\n * temporarily absent. A dismissal/focus capability therefore references a root context **mandatorily**\n * and a node **optionally**.\n *\n * `floatingElement` / `referenceElement` are exposed read-only and mutated **only** through the\n * validated setters, so a consumer cannot bypass the owner-`Document` invariant with a raw assignment.\n */\nexport class RdxFloatingRootContext {\n readonly ownerDocument: Document;\n /** Neutral popup open-state lifecycle (singular). Tree traversal's `onlyOpen` filter reads this. */\n readonly open: () => boolean;\n /** Per-popup trigger registry (Base UI `triggerElements`), read by both dismissal and focus. */\n readonly triggers = new RdxTriggerRegistry();\n /**\n * Per-popup typed event channel (Base UI `FloatingRootStore.events`). Scoped to this popup,\n * so open-change events carry no cross-popup bleed. Use `events.emit('openchange', …)` when\n * the popup's `open` state changes; dismissal / focus manager subscribe here, not on the tree.\n */\n readonly events: RdxFloatingEvents<RdxFloatingRootContextEventMap> =\n createFloatingEvents<RdxFloatingRootContextEventMap>();\n\n private floatingElementRef: HTMLElement | null = null;\n private referenceElementRef: Element | null = null;\n private readonly floatingElementsRef = new Set<Element>();\n\n constructor(init: RdxFloatingRootContextInit) {\n this.ownerDocument = init.ownerDocument;\n this.open = init.open ?? (() => false);\n if (init.floatingElement !== undefined) {\n this.setFloatingElement(init.floatingElement);\n }\n if (init.referenceElement !== undefined) {\n this.setReferenceElement(init.referenceElement);\n }\n }\n\n /** The floating (popup) element, once it renders. `null` while mounted-but-not-yet-rendered. */\n get floatingElement(): HTMLElement | null {\n return this.floatingElementRef;\n }\n\n /** The reference (anchor / trigger) element the popup is positioned against. */\n get referenceElement(): Element | null {\n return this.referenceElementRef;\n }\n\n /**\n * **All** of this layer's own root elements — the popup plus any extra roots a primitive owns (e.g.\n * a Dialog backdrop relocated as a separate body sibling). This is DOM-footprint bookkeeping for\n * primitive-specific checks; `markOthers` keep-sets are intentionally narrower and do not include\n * sibling roots such as backdrops. Distinct from {@link floatingElement} (the single popup, used for\n * press / focus containment).\n */\n get floatingElements(): ReadonlySet<Element> {\n return this.floatingElementsRef;\n }\n\n /** Assigns the floating (popup) element, validating it shares this context's `ownerDocument`. */\n setFloatingElement(element: HTMLElement | null): void {\n this.assertSameDocument(element);\n if (this.floatingElementRef) {\n this.floatingElementsRef.delete(this.floatingElementRef);\n }\n this.floatingElementRef = element;\n if (element) {\n this.floatingElementsRef.add(element);\n }\n }\n\n /** Registers an additional owned root element (e.g. a backdrop) into {@link floatingElements}. */\n addFloatingElement(element: Element): void {\n this.assertSameDocument(element);\n this.floatingElementsRef.add(element);\n }\n\n /** Removes a previously {@link addFloatingElement | added} owned root element. */\n removeFloatingElement(element: Element): void {\n this.floatingElementsRef.delete(element);\n }\n\n /** Assigns the reference element, validating it shares this context's `ownerDocument`. */\n setReferenceElement(element: Element | null): void {\n this.assertSameDocument(element);\n this.referenceElementRef = element;\n }\n\n private assertSameDocument(element: Element | null): void {\n if (isDevMode() && element !== null && element.ownerDocument !== this.ownerDocument) {\n rdxDevError(\n 'floating/cross-document-element',\n \"A floating element must share its root context's ownerDocument.\",\n DOCS\n );\n }\n }\n}\n\n/**\n * Creates a standalone {@link RdxFloatingRootContext} **without** a tree node — the Angular counterpart\n * of Base UI's `getEmptyRootContext()`. Use it for a node-optional capability that needs a root context\n * before (or without) registering a floating node.\n */\nexport function createFloatingRootContext(init: RdxFloatingRootContextInit): RdxFloatingRootContext {\n return new RdxFloatingRootContext(init);\n}\n","import { DestroyRef, effect, Injector } from '@angular/core';\n\n/** Default marker attribute on the imperatively-created internal backdrop element. */\nexport const RDX_INTERNAL_BACKDROP_ATTR = 'data-rdx-internal-backdrop';\n\n/** Base UI's clip-path that cuts a rectangular hole at `rect` out of a full-viewport element. */\nfunction cutoutClipPath(rect: DOMRect): string {\n return (\n `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,` +\n `${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,` +\n `${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`\n );\n}\n\nexport interface RdxInternalBackdropOptions {\n /** Whether the backdrop should exist (modal && reason-appropriate). Reactive — read in an effect. */\n shouldRender: () => boolean;\n /** Whether the popup is open. Reactive — drives `inert` during the closed-but-mounted exit window. */\n isOpen: () => boolean;\n /**\n * The element to keep interactive through a clip-path \"cutout\" (e.g. the trigger, so a toggle-close\n * click still reaches it), or `null` for a full backdrop. Read once when the backdrop is created.\n */\n cutout?: () => Element | null;\n /** Marker attribute applied to the backdrop. Defaults to {@link RDX_INTERNAL_BACKDROP_ATTR}. */\n marker?: string;\n /** Let pointer/wheel events pass through the backdrop while keeping it mounted for lifecycle parity. */\n passThrough?: () => boolean;\n}\n\n/**\n * Renders Base UI's **internal backdrop** for a modal floating popup: a full-viewport element that\n * intercepts background pointer events (so the page behind the popup is non-interactive) **and** is\n * itself the outside-press target — clicking it lets the dismissal capability close the popup. This is\n * why a plain `inert` pass on outside elements is not enough: an inert element dispatches no pointer\n * event, so the popup could never close on an outside click. An optional clip-path cutout keeps the\n * trigger (or another region) clickable.\n *\n * Inserted as a **sibling before the positioner** — a sibling, not a child: a `position: fixed` element\n * inside a transformed positioner would be clipped to the positioner's box, not the viewport. The\n * positioner's own stacking (its `z-index`) keeps the popup above the backdrop.\n *\n * Call from the positioner directive inside `afterNextRender` (so the structural portal has already\n * relocated the positioner into its container).\n */\nexport function setupInternalBackdrop(\n positioner: HTMLElement,\n injector: Injector,\n options: RdxInternalBackdropOptions\n): void {\n const ownerDocument = positioner.ownerDocument;\n const marker = options.marker ?? RDX_INTERNAL_BACKDROP_ATTR;\n let backdrop: HTMLElement | null = null;\n\n const remove = (): void => {\n backdrop?.remove();\n backdrop = null;\n };\n\n const ref = effect(\n () => {\n const open = options.isOpen();\n const render = options.shouldRender();\n\n if (render && !backdrop) {\n backdrop = ownerDocument.createElement('div');\n backdrop.setAttribute('role', 'presentation');\n backdrop.setAttribute(marker, '');\n backdrop.style.position = 'fixed';\n backdrop.style.inset = '0px';\n backdrop.style.userSelect = 'none';\n backdrop.style.webkitUserSelect = 'none';\n\n const cutout = options.cutout?.() ?? null;\n if (cutout) {\n backdrop.style.clipPath = cutoutClipPath(cutout.getBoundingClientRect());\n }\n\n positioner.parentElement?.insertBefore(backdrop, positioner);\n } else if (!render) {\n remove();\n }\n\n if (backdrop) {\n backdrop.style.pointerEvents = options.passThrough?.() ? 'none' : '';\n\n // Clickable (the outside-press target) while open; inert during the closed-but-mounted\n // exit window so a stray click on the fading backdrop can't fire.\n if (open) {\n backdrop.removeAttribute('inert');\n } else {\n backdrop.setAttribute('inert', '');\n }\n }\n },\n { injector }\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n ref.destroy();\n remove();\n });\n}\n","import { DOCUMENT, inject } from '@angular/core';\n\nexport function injectDocument(): Document {\n return inject(DOCUMENT);\n}\n","import { afterNextRender, DestroyRef, ElementRef, Injector, signal } from '@angular/core';\n\nexport function elementSize({ elementRef, injector }: { elementRef: ElementRef<HTMLElement>; injector: Injector }) {\n const destroyRef = injector.get(DestroyRef);\n const result = signal({\n width: elementRef.nativeElement.offsetWidth,\n height: elementRef.nativeElement.offsetHeight\n });\n\n afterNextRender(\n () => {\n const resizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n let width: number;\n let height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n width = elementRef.nativeElement.offsetWidth;\n height = elementRef.nativeElement.offsetHeight;\n }\n\n result.set({ width, height });\n });\n\n destroyRef.onDestroy(() => resizeObserver.disconnect());\n },\n { injector: injector }\n );\n\n return result.asReadonly();\n}\n","/**\n * The deepest active element, descending into open shadow roots. Pass a specific `root`\n * (`Document` or `ShadowRoot`) to read focus in that document — defaults to the global `document`\n * (backward compatible). A focus scope passes its host's `ownerDocument` so it stays correct across\n * iframes / multi-document environments.\n */\nexport function getActiveElement(root: DocumentOrShadowRoot = document): Element | null {\n let activeElement = root.activeElement;\n if (activeElement == null) {\n return null;\n }\n\n while (\n activeElement != null &&\n activeElement.shadowRoot != null &&\n activeElement.shadowRoot.activeElement != null\n ) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n","import { effect, EffectRef, ElementRef, Injector, Signal } from '@angular/core';\n\n/**\n * Creates a resize observer effect for element\n *\n * @param options Configuration options\n * @param options.injector Angular injector\n * @param options.element Signal returning the element to observe\n * @param options.onResize Callback when element is resized\n * @returns EffectRef that can be destroyed when needed\n */\nexport function resizeEffect(options: {\n injector: Injector;\n element: Signal<ElementRef | HTMLElement | null | undefined>;\n onResize: ResizeObserverCallback;\n}): EffectRef {\n return effect(\n (onCleanup) => {\n const elementOrRef = options.element();\n if (!elementOrRef) return;\n\n // Extract native element from ElementRef or use directly if it's HTMLElement\n const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n\n const resizeObserver = new ResizeObserver(options.onResize);\n resizeObserver.observe(element);\n\n onCleanup(() => resizeObserver.disconnect());\n },\n { injector: options.injector }\n );\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { computed, DestroyRef, effect, inject, PLATFORM_ID, signal, Signal } from '@angular/core';\n\n/** Marker attribute set on `<html>` while scroll is locked (a strategy-independent test/CSS hook). */\nexport const RDX_SCROLL_LOCKED_ATTR = 'data-rdx-scroll-locked';\n\n// ── Small DOM / platform helpers (inlined — we deliberately do NOT depend on `@floating-ui/utils`) ──\n\n/**\n * Floating UI's `isOverflowElement`: whether `element` is itself a scroll container (its computed\n * overflow is anything other than `visible`). Used to decide whether `<html>` or `<body>` is the page\n * scroller — a site may set `overflow-y: scroll` on `<html>` (as Storybook does), in which case a lock\n * on `<body>` alone has no effect.\n */\nfunction isOverflowElement(element: Element): boolean {\n const win = element.ownerDocument.defaultView;\n if (!win) {\n return false;\n }\n const { overflow, overflowX, overflowY, display } = win.getComputedStyle(element);\n return (\n /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&\n !['inline', 'contents'].includes(display)\n );\n}\n\n/**\n * WebKit (Safari / any iOS browser) UA check — needs the `Safari` token and excludes desktop Blink\n * (Chrome / Edge / Android), so jsdom (`AppleWebKit … jsdom`, no `Safari`) is correctly **not** WebKit.\n * Mirrors the same helper in the dismissal capability; only WebKit needs the pinch-zoom bail-out.\n */\nfunction isWebKit(win: Window): boolean {\n const ua = win.navigator.userAgent;\n return /AppleWebKit/i.test(ua) && /Safari/i.test(ua) && !/Chrome|Chromium|Edg|Android/i.test(ua);\n}\n\n/** iOS / iPadOS detection (iPadOS 13+ reports as Mac, so also accept touch-capable `MacIntel`). */\nfunction isIOS(win: Window): boolean {\n const nav = win.navigator;\n return /iP(ad|hone|od)/.test(nav.userAgent) || (nav.platform === 'MacIntel' && nav.maxTouchPoints > 1);\n}\n\n/** Whether the document currently has **inset** (space-consuming) scrollbars rather than overlay ones. */\nfunction hasInsetScrollbars(doc: Document): boolean {\n const win = doc.defaultView;\n return win ? win.innerWidth - doc.documentElement.clientWidth > 0 : false;\n}\n\n/**\n * Feature-detects `scrollbar-gutter: stable` by measuring whether toggling overflow shifts the scroller's\n * box. When supported, the lock can reserve the gutter with `scrollbar-gutter: stable` instead of the\n * `body { position: relative; width: calc(...) }` compensation. Restores everything it touches.\n */\nfunction supportsStableScrollbarGutter(doc: Document): boolean {\n const win = doc.defaultView;\n if (!win || typeof CSS === 'undefined' || !CSS.supports || !CSS.supports('scrollbar-gutter', 'stable')) {\n return false;\n }\n const html = doc.documentElement;\n const scrollContainer = isOverflowElement(html) ? html : doc.body;\n\n const originalOverflowY = scrollContainer.style.overflowY;\n const originalGutter = html.style.scrollbarGutter;\n\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n\n scrollContainer.style.overflowY = originalOverflowY;\n html.style.scrollbarGutter = originalGutter;\n\n return before === after;\n}\n\n// ── The two Base UI locking strategies (each returns its own restore callback) ──\n\n/**\n * Overlay-scrollbar strategy (iOS, or any document without inset scrollbars): scrollbars float over the\n * content and take no layout space, so a plain `overflow: hidden` on the scroller suffices — no gutter\n * compensation, no scroll-position juggling needed.\n */\nfunction preventScrollOverlayScrollbars(doc: Document): () => void {\n const html = doc.documentElement;\n const elementToLock = isOverflowElement(html) ? html : doc.body;\n const original = {\n overflowX: elementToLock.style.overflowX,\n overflowY: elementToLock.style.overflowY\n };\n\n elementToLock.style.overflowX = 'hidden';\n elementToLock.style.overflowY = 'hidden';\n\n return () => {\n elementToLock.style.overflowX = original.overflowX;\n elementToLock.style.overflowY = original.overflowY;\n };\n}\n\n/**\n * Inset-scrollbar strategy (desktop with space-consuming scrollbars). Faithful port of Base UI's\n * `preventScrollInsetScrollbars`: preserves the scroll position by parking it on `<body>` (made\n * `position: relative` with a viewport-sized box), reserves the scrollbar gutter (via\n * `scrollbar-gutter: stable` when supported, else a `width/height: calc(...)` compensation) so nothing\n * shifts, bails out entirely during a Safari pinch-zoom, and re-locks on resize. All snapshot state is\n * **closure-local** (not module-global as in Base UI), so concurrent locks in different documents never\n * clobber each other's saved styles.\n */\nfunction preventScrollInsetScrollbars(doc: Document): () => void {\n const html = doc.documentElement;\n const body = doc.body;\n const win = doc.defaultView;\n if (!win) {\n return () => {};\n }\n\n // Pinch-zoom in Safari causes a shift — just don't lock while zoomed.\n if (isWebKit(win) && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n let originalHtmlStyles: Partial<CSSStyleDeclaration> = {};\n let originalBodyStyles: Partial<CSSStyleDeclaration> = {};\n let originalHtmlScrollBehavior = '';\n let resizeFrame = 0;\n\n const lockScroll = (): void => {\n // ─── DOM reads ───\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const hasBothEdges = (htmlStyles.scrollbarGutter || '').includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Scrollbar size (negative in Firefox, so clamp). Compensated below so nothing shifts.\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n const marginY = (parseFloat(bodyStyles.marginTop) || 0) + (parseFloat(bodyStyles.marginBottom) || 0);\n const marginX = (parseFloat(bodyStyles.marginLeft) || 0) + (parseFloat(bodyStyles.marginRight) || 0);\n const elementToLock = isOverflowElement(html) ? html : body;\n\n updateGutterOnly = supportsStableScrollbarGutter(doc);\n\n // ─── DOM writes (do not read the DOM past here) ───\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n // Set the long-hands (not the `overflow` short-hand) so the snapshot — which captures\n // `overflowY`/`overflowX` — restores symmetrically (a short-hand here would leave a stale\n // `overflow` declaration when only the long-hands are reset).\n overflowY: 'hidden',\n overflowX: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.style.scrollBehavior = 'unset';\n };\n\n const cleanup = (): void => {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n };\n\n const handleResize = (): void => {\n cleanup();\n resizeFrame = win.requestAnimationFrame(lockScroll);\n };\n\n lockScroll();\n win.addEventListener('resize', handleResize);\n\n return () => {\n if (resizeFrame) {\n win.cancelAnimationFrame(resizeFrame);\n }\n cleanup();\n win.removeEventListener('resize', handleResize);\n };\n}\n\n/**\n * Per-`Document` scroll-lock owner — the Angular counterpart of Base UI's `ScrollLocker`, but with **all**\n * mutable state on the instance (Base UI keeps the style snapshots at module scope, which is unsafe across\n * documents). Ref-counts concurrent locks so nested / sibling overlays compose: the first lock applies a\n * strategy, the last release restores it. Keyed per `Document` (the {@link lockers} WeakMap) so an iframe's\n * lock never corrupts the parent document's saved styles.\n */\nclass ScrollLocker {\n private lockCount = 0;\n private restore: (() => void) | null = null;\n\n constructor(private readonly doc: Document) {}\n\n /** Increments the lock count, applying the lock on the `0 → 1` edge. Returns this lock's release. */\n acquire(): () => void {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.lock();\n }\n return this.release;\n }\n\n private readonly release = (): void => {\n if (this.lockCount === 0) {\n return;\n }\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.restore();\n this.restore = null;\n }\n };\n\n private lock(): void {\n const html = this.doc.documentElement;\n const win = this.doc.defaultView;\n const htmlOverflowY = win ? win.getComputedStyle(html).overflowY : '';\n\n // If the site author already hid overflow on `<html>`, respect it and apply no strategy.\n if (htmlOverflowY === 'hidden' || htmlOverflowY === 'clip') {\n this.restore = () => undefined;\n } else {\n const hasOverlayScrollbars = (win ? isIOS(win) : false) || !hasInsetScrollbars(this.doc);\n const strategyRestore = hasOverlayScrollbars\n ? preventScrollOverlayScrollbars(this.doc)\n : preventScrollInsetScrollbars(this.doc);\n this.restore = strategyRestore;\n }\n\n // Strategy-independent marker (set even when respecting author overflow, so the lock is observable).\n html.setAttribute(RDX_SCROLL_LOCKED_ATTR, '');\n const strategyRestore = this.restore;\n this.restore = () => {\n strategyRestore();\n html.removeAttribute(RDX_SCROLL_LOCKED_ATTR);\n };\n }\n}\n\nconst lockers = new WeakMap<Document, ScrollLocker>();\n\nfunction getLocker(doc: Document): ScrollLocker {\n let locker = lockers.get(doc);\n if (!locker) {\n locker = new ScrollLocker(doc);\n lockers.set(doc, locker);\n }\n return locker;\n}\n\nexport interface RdxScrollLockOptions {\n /** Element whose owner document should be locked. Defaults to Angular's injected DOCUMENT. */\n referenceElement?: () => Element | null;\n}\n\n/**\n * Locks page scrolling while `active()` is `true`, restoring the original state when it becomes `false`\n * or the calling context is destroyed.\n *\n * This is the full Base UI `useScrollLock` behavioral set (ADR 0016 §1): it picks the **overlay** strategy\n * (plain `overflow: hidden`) for iOS / overlay-scrollbar documents and the **inset** strategy for desktop\n * scrollbars — the latter preserves the scroll position, reserves the scrollbar gutter (no content shift),\n * bails out during a Safari pinch-zoom, and re-locks on resize. Locks compose across all callers in the\n * same document via a shared per-`Document` ref count, and state is isolated per `Document` (iframe-safe).\n * No-op on the server. Must be called in an injection context.\n */\nexport function useScrollLock(active: Signal<boolean>, options: RdxScrollLockOptions = {}): void {\n const injectedDocument = inject(DOCUMENT);\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n let release: (() => void) | null = null;\n let releaseDocument: Document | null = null;\n\n const releaseCurrent = (): void => {\n release?.();\n release = null;\n releaseDocument = null;\n };\n\n effect(() => {\n if (!isBrowser) {\n return;\n }\n const document = options.referenceElement?.()?.ownerDocument ?? injectedDocument;\n if (active()) {\n if (!release || releaseDocument !== document) {\n releaseCurrent();\n release = getLocker(document).acquire();\n releaseDocument = document;\n }\n } else if (release) {\n releaseCurrent();\n }\n });\n\n // Only register the DOM unlock on the browser — on the server `release` is never set.\n if (isBrowser) {\n inject(DestroyRef).onDestroy(releaseCurrent);\n }\n}\n\n/**\n * A touch-opened anchored popup leaves up to this much total horizontal gutter and is still treated as\n * effectively full-width (Base UI `VIEWPORT_WIDTH_TOLERANCE_PX`): common ~10px side padding still locks,\n * since that leaves too little outside space for a reliable swipe-to-dismiss.\n */\nconst VIEWPORT_WIDTH_TOLERANCE_PX = 20;\n\n/** Options for {@link useAnchoredScrollLock}. */\nexport interface RdxAnchoredScrollLockOptions {\n /** Whether the popup was opened by **touch** — the near-fullscreen gate applies only then. */\n touchOpen: () => boolean;\n /** The popup / positioner element whose width decides the touch gate (measured vs the viewport). */\n element: () => HTMLElement | null;\n}\n\n/**\n * Scroll lock for an **anchored** popup (Base UI `useAnchoredPopupScrollLock`, ADR 0016 §3). For a\n * non-touch open it behaves exactly like {@link useScrollLock} (locks while `enabled()`). For a **touch**\n * open it locks **only** when the popup is effectively viewport-width (`popupWidth >= viewportWidth -\n * 20px`) — otherwise the page stays scrollable so the user can swipe outside to dismiss the popup. The\n * width is measured off `element()`; reading `offsetWidth` forces layout, so it is accurate even before\n * the popup is positioned (visibility does not affect layout). Must be called in an injection context.\n */\nexport function useAnchoredScrollLock(enabled: Signal<boolean>, options: RdxAnchoredScrollLockOptions): void {\n const touchOpenShouldLock = signal(false);\n\n effect(() => {\n const element = options.element();\n if (!enabled() || !options.touchOpen() || !element) {\n touchOpenShouldLock.set(false);\n return;\n }\n const viewportWidth = element.ownerDocument.documentElement.clientWidth;\n const popupWidth = element.offsetWidth;\n touchOpenShouldLock.set(\n viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX\n );\n });\n\n useScrollLock(\n computed(() => enabled() && (!options.touchOpen() || touchOpenShouldLock())),\n {\n referenceElement: options.element\n }\n );\n}\n","// made by https://reka-ui.com/\n\nimport { Direction } from '../types';\n\ntype ArrowKeyOptions = 'horizontal' | 'vertical' | 'both';\n\ninterface ArrowNavigationOptions {\n /**\n * The arrow key options to allow navigation\n *\n * @defaultValue \"both\"\n */\n arrowKeyOptions?: ArrowKeyOptions;\n\n /**\n * The attribute name to find the collection items in the parent element.\n *\n * @defaultValue \"data-rdx-collection-item\"\n */\n attributeName?: string;\n\n /**\n * The parent element where contains all the collection items, this will collect every item to be used when nav\n * It will be ignored if attributeName is provided\n *\n * @defaultValue []\n */\n itemsArray?: HTMLElement[];\n\n /**\n * Allow loop navigation. If false, it will stop at the first and last element\n *\n * @defaultValue true\n */\n loop?: boolean;\n\n /**\n * The orientation of the collection\n *\n * @defaultValue \"ltr\"\n */\n dir?: Direction;\n\n /**\n * Prevent the scroll when navigating. This happens when the direction of the\n * key matches the scroll direction of any ancestor scrollable elements.\n *\n * @defaultValue true\n */\n preventScroll?: boolean;\n\n /**\n * By default all currentElement would trigger navigation. If `true`, currentElement nodeName in the ignore list will return null\n *\n * @defaultValue false\n */\n enableIgnoredElement?: boolean;\n\n /**\n * Focus the element after navigation\n *\n * @defaultValue false\n */\n focus?: boolean;\n}\n\nconst ignoredElement = ['INPUT', 'TEXTAREA'];\n\n/**\n * Allow arrow navigation for every html element with data-rdx-collection-item tag\n *\n * @param e Keyboard event\n * @param currentElement Event initiator element or any element that wants to handle the navigation\n * @param parentElement Parent element where contains all the collection items, this will collect every item to be used when nav\n * @param options further options\n * @returns the navigated html element or null if none\n */\nexport function useArrowNavigation(\n e: KeyboardEvent,\n currentElement: HTMLElement,\n parentElement: HTMLElement | undefined,\n options: ArrowNavigationOptions = {}\n): HTMLElement | null {\n if (!currentElement || (options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)))\n return null;\n\n const {\n arrowKeyOptions = 'both',\n attributeName = '[data-rdx-collection-item]',\n itemsArray = [],\n loop = true,\n dir = 'ltr',\n preventScroll = true,\n focus = false\n } = options;\n\n const [right, left, up, down, home, end] = [\n e.key === 'ArrowRight',\n e.key === 'ArrowLeft',\n e.key === 'ArrowUp',\n e.key === 'ArrowDown',\n e.key === 'Home',\n e.key === 'End'\n ];\n const goingVertical = up || down;\n const goingHorizontal = right || left;\n if (\n !home &&\n !end &&\n ((!goingVertical && !goingHorizontal) ||\n (arrowKeyOptions === 'vertical' && goingHorizontal) ||\n (arrowKeyOptions === 'horizontal' && goingVertical))\n ) {\n return null;\n }\n\n const allCollectionItems: HTMLElement[] = parentElement\n ? Array.from(parentElement.querySelectorAll(attributeName))\n : itemsArray;\n\n if (!allCollectionItems.length) return null;\n\n if (preventScroll) e.preventDefault();\n\n let item: HTMLElement | null = null;\n\n if (goingHorizontal || goingVertical) {\n const goForward = goingVertical ? down : dir === 'ltr' ? right : left;\n item = findNextFocusableElement(allCollectionItems, currentElement, {\n goForward,\n loop\n });\n } else if (home) {\n item = allCollectionItems.length ? allCollectionItems[0] : null;\n } else if (end) {\n item = allCollectionItems.length ? allCollectionItems[allCollectionItems.length - 1] : null;\n }\n\n if (focus) item?.focus();\n\n return item;\n}\n\ninterface FindNextFocusableElementOptions {\n /**\n * Whether to search forwards or backwards.\n */\n goForward: boolean;\n /**\n * Whether to allow looping the search. If false, it will stop at the first/last element.\n *\n * @default true\n */\n loop?: boolean;\n}\n\n/**\n * Recursive function to find the next focusable element to avoid disabled elements\n *\n * @param elements Elements to navigate\n * @param currentElement Current active element\n * @param options\n * @param iterations\n * @returns next focusable element\n */\nfunction findNextFocusableElement(\n elements: HTMLElement[],\n currentElement: HTMLElement,\n options: FindNextFocusableElementOptions,\n iterations = elements.length\n): HTMLElement | null {\n if (--iterations === 0) return null;\n\n const index = elements.indexOf(currentElement);\n const newIndex = options.goForward ? index + 1 : index - 1;\n\n if (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null;\n\n const adjustedNewIndex = (newIndex + elements.length) % elements.length;\n const candidate = elements[adjustedNewIndex];\n if (!candidate) return null;\n\n const isDisabled = candidate.hasAttribute('disabled') && candidate.getAttribute('disabled') !== 'false';\n if (isDisabled) {\n return findNextFocusableElement(elements, candidate, options, iterations);\n }\n return candidate;\n}\n","/**\n * Locale-aware string matching backed by `Intl.Collator`, mirroring Base UI's `useFilter`.\n *\n * The collator defaults to `sensitivity: 'base'`, so matching is both case-insensitive and\n * diacritic-insensitive (`\"Äpfel\"` matches `\"ap\"`, `\"résumé\"` matches `\"resume\"`). Pass `locale`\n * and/or any `Intl.Collator` options to override.\n */\nexport interface UseFilterOptions extends Intl.CollatorOptions {\n /** Locale(s) for the collator. Defaults to the runtime's default locale. */\n locale?: Intl.LocalesArgument;\n}\n\n/** Predicates returned by {@link useFilter}. An empty `query` always matches. */\nexport interface FilterPredicates {\n /** Whether `text` contains `query`. */\n contains: (text: string, query: string) => boolean;\n /** Whether `text` starts with `query`. */\n startsWith: (text: string, query: string) => boolean;\n /** Whether `text` ends with `query`. */\n endsWith: (text: string, query: string) => boolean;\n}\n\n/**\n * Creates locale-aware `contains` / `startsWith` / `endsWith` predicates.\n *\n * Matching uses `Intl.Collator` with `sensitivity: 'base'` and `usage: 'search'` by default, so\n * comparisons ignore case and diacritics. An empty (or whitespace-only) `query` matches everything,\n * which is the natural \"no filter applied\" state for a combobox.\n *\n * @example\n * const { contains } = useFilter();\n * contains('Äpfel', 'ap'); // true\n */\nexport function useFilter(options?: UseFilterOptions): FilterPredicates {\n const { locale, ...collatorOptions } = options ?? {};\n const collator = new Intl.Collator(locale, {\n usage: 'search',\n sensitivity: 'base',\n ...collatorOptions\n });\n\n // `Intl.Collator` only compares whole strings, so we scan every substring window of `text`\n // the same length as `query` and treat a collator match as a hit. This keeps the locale rules\n // (case/diacritic folding) consistent with `===`-style equality the collator provides.\n const matchesAt = (text: string, query: string, start: number): boolean =>\n collator.compare(text.slice(start, start + query.length), query) === 0;\n\n const isEmpty = (query: string): boolean => query.length === 0;\n\n return {\n contains(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n for (let i = 0; i + query.length <= text.length; i++) {\n if (matchesAt(text, query, i)) {\n return true;\n }\n }\n return false;\n },\n startsWith(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n return query.length <= text.length && matchesAt(text, query, 0);\n },\n endsWith(text, query) {\n if (isEmpty(query)) {\n return true;\n }\n return query.length <= text.length && matchesAt(text, query, text.length - query.length);\n }\n };\n}\n","import { effect, signal, type Signal, type WritableSignal } from '@angular/core';\n\ntype Side = 'top' | 'right' | 'bottom' | 'left';\n\nconst graceAreaContainers = new WeakMap<HTMLElement, HTMLElement>();\n\nfunction createSignalEvent<T = void>() {\n const handlers = new Set<(value: T) => void>();\n\n return {\n on(callback: (value: T) => void): () => void {\n handlers.add(callback);\n return () => handlers.delete(callback);\n },\n emitVoid(): void {\n handlers.forEach((handler) => handler(undefined as unknown as T));\n }\n };\n}\n\n/**\n * Keeps hover content open while the pointer crosses the gap between a trigger and a popup.\n */\nexport function useGraceArea(\n triggerEl: Signal<HTMLElement | null | undefined>,\n containerEl: Signal<HTMLElement | null | undefined>,\n resetMs = 300\n) {\n const isPointerInTransit: WritableSignal<boolean> = signal(false);\n const pointerExit = createSignalEvent<void>();\n\n let pointerGraceArea: Polygon | null = null;\n let resetTimer: number | null = null;\n\n function armInTransitAutoReset() {\n if (resetTimer !== null) window.clearTimeout(resetTimer);\n resetTimer = window.setTimeout(() => {\n isPointerInTransit.set(false);\n resetTimer = null;\n }, resetMs);\n }\n\n function clearGraceArea() {\n pointerGraceArea = null;\n isPointerInTransit.set(false);\n\n if (resetTimer !== null) {\n window.clearTimeout(resetTimer);\n resetTimer = null;\n }\n }\n\n function createGraceArea(event: PointerEvent, hoverTarget: HTMLElement) {\n const currentTarget = event.currentTarget as HTMLElement;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n pointerGraceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n isPointerInTransit.set(true);\n armInTransitAutoReset();\n }\n\n function trackPointerGrace(event: PointerEvent) {\n if (!pointerGraceArea || !(event.target instanceof HTMLElement)) return;\n\n const trigger = triggerEl();\n const container = containerEl();\n if (!trigger || !container) return;\n\n const target = event.target;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const enteredContainer = target.closest<HTMLElement>('[data-grace-area-container]');\n const nestedTrigger = enteredContainer ? graceAreaContainers.get(enteredContainer) : undefined;\n const hasEnteredTarget =\n trigger.contains(target) ||\n container.contains(target) ||\n (nestedTrigger ? container.contains(nestedTrigger) : false);\n const isOutsideGrace = !isPointInPolygon(pointerPosition, pointerGraceArea);\n const isAnotherGraceAreaTrigger = !!target.closest('[data-grace-area-trigger]');\n\n if (hasEnteredTarget) {\n clearGraceArea();\n } else if (isOutsideGrace || isAnotherGraceAreaTrigger) {\n clearGraceArea();\n pointerExit.emitVoid();\n }\n }\n\n effect((onCleanup) => {\n const trigger = triggerEl();\n const container = containerEl();\n const onTriggerLeave = (event: PointerEvent) => {\n if (container) createGraceArea(event, container);\n };\n const onContainerLeave = (event: PointerEvent) => {\n if (trigger) createGraceArea(event, trigger);\n };\n\n onCleanup(() => {\n const doc = trigger?.ownerDocument;\n trigger?.removeEventListener('pointerleave', onTriggerLeave as EventListener);\n container?.removeEventListener('pointerleave', onContainerLeave as EventListener);\n doc?.removeEventListener('pointermove', trackPointerGrace as EventListener);\n trigger?.removeAttribute('data-grace-area-trigger');\n container?.removeAttribute('data-grace-area-container');\n\n if (container && graceAreaContainers.get(container) === trigger) {\n graceAreaContainers.delete(container);\n }\n\n clearGraceArea();\n });\n\n if (!trigger || !container) return;\n\n trigger.setAttribute('data-grace-area-trigger', '');\n container.setAttribute('data-grace-area-container', '');\n graceAreaContainers.set(container, trigger);\n\n trigger.addEventListener('pointerleave', onTriggerLeave as EventListener, { passive: true });\n container.addEventListener('pointerleave', onContainerLeave as EventListener, { passive: true });\n trigger.ownerDocument.addEventListener('pointermove', trackPointerGrace as EventListener, { passive: true });\n });\n\n return {\n isPointerInTransit: isPointerInTransit.asReadonly(),\n onPointerExit: pointerExit.on\n };\n}\n\ninterface Point {\n x: number;\n y: number;\n}\n\ntype Polygon = Point[];\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect): Side {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n const min = Math.min(top, bottom, right, left);\n\n if (!Number.isFinite(min)) {\n return 'bottom';\n }\n\n switch (min) {\n case left:\n return 'left';\n case right:\n return 'right';\n case top:\n return 'top';\n case bottom:\n return 'bottom';\n default:\n throw new Error('unreachable');\n }\n}\n\nfunction getPaddedExitPoints(exitPoint: Point, exitSide: Side, padding = 5) {\n const points: Point[] = [];\n\n switch (exitSide) {\n case 'top':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'bottom':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case 'left':\n points.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'right':\n points.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n\n return points;\n}\n\nfunction getPointsFromRect(rect: DOMRect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom }\n ];\n}\n\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\nfunction getHull<PointType extends Point>(points: Readonly<Array<PointType>>): Array<PointType> {\n const sortedPoints: Array<PointType> = points.slice();\n sortedPoints.sort((a, b) => a.x - b.x || a.y - b.y);\n return getHullPresorted(sortedPoints);\n}\n\nfunction getHullPresorted<PointType extends Point>(points: Readonly<Array<PointType>>): Array<PointType> {\n if (points.length <= 1) return points.slice();\n\n const upper: Array<PointType> = [];\n for (const point of points) {\n while (upper.length >= 2) {\n const q = upper[upper.length - 1];\n const r = upper[upper.length - 2];\n if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x)) upper.pop();\n else break;\n }\n upper.push(point);\n }\n upper.pop();\n\n const lower: Array<PointType> = [];\n for (let index = points.length - 1; index >= 0; index--) {\n const point = points[index];\n while (lower.length >= 2) {\n const q = lower[lower.length - 1];\n const r = lower[lower.length - 2];\n if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x)) lower.pop();\n else break;\n }\n lower.push(point);\n }\n lower.pop();\n\n if (upper.length === 1 && lower.length === 1 && upper[0].x === lower[0].x && upper[0].y === lower[0].y) {\n return upper;\n }\n\n return upper.concat(lower);\n}\n","import { computed, effect, Injector, Signal, signal, untracked } from '@angular/core';\n\n/** Options for {@link useListHighlight}. */\nexport interface UseListHighlightOptions<T> {\n /** All items in DOM order (e.g. a collection provider's `items()`). */\n items: Signal<readonly T[]>;\n /**\n * Whether an item can be highlighted — must return `false` for hidden (filtered-out) and\n * disabled items. Navigation and self-healing both consult this.\n */\n isNavigable: (item: T) => boolean;\n /** Resolves the item's element id, exposed as {@link ListHighlight.activeId} for `aria-activedescendant`. */\n getId: (item: T) => string | undefined;\n /** Whether navigation wraps at the boundaries. Defaults to `true`. */\n loop?: Signal<boolean>;\n /** Injector to bind the self-healing effect to when not called in an injection context. */\n injector?: Injector;\n}\n\n/** Highlight-model navigation API returned by {@link useListHighlight}. */\nexport interface ListHighlight<T> {\n /** The currently highlighted item, or `null`. DOM focus is never moved by this state. */\n readonly highlightedItem: Signal<T | null>;\n /** The highlighted item's element id, or `undefined`. Bind to `aria-activedescendant`. */\n readonly activeId: Signal<string | undefined>;\n /** Highlight the first navigable item. */\n first(): void;\n /** Highlight the last navigable item. */\n last(): void;\n /** Highlight the next navigable item (wraps when `loop`). */\n next(): void;\n /** Highlight the previous navigable item (wraps when `loop`). */\n previous(): void;\n /** Highlight a specific item (ignored if not navigable); pass `null` to clear. */\n set(item: T | null): void;\n /** Clear the highlight. */\n clear(): void;\n}\n\n/**\n * Highlight-model list navigation over a set of items, decoupled from DOM focus.\n *\n * Unlike roving `tabindex`, the highlight is pure state: callers move it with the keyboard while DOM\n * focus stays on a single controlling element (e.g. a combobox `<input>`), which exposes\n * {@link ListHighlight.activeId} as `aria-activedescendant`. Navigation only ever lands on items for\n * which `isNavigable` returns `true`, so hidden (filtered-out) and disabled items are skipped. A\n * self-healing effect clears the highlight if its item stops being navigable or leaves the list, so\n * `activeId` never references a detached or hidden element.\n *\n * Must be called in an injection context, or given an `injector`.\n */\nexport function useListHighlight<T>(options: UseListHighlightOptions<T>): ListHighlight<T> {\n const { items, isNavigable, getId, loop, injector } = options;\n\n const highlighted = signal<T | null>(null);\n\n const navigable = computed(() => items().filter((item) => isNavigable(item)));\n\n const activeId = computed(() => {\n const item = highlighted();\n return item === null ? undefined : getId(item);\n });\n\n const setIfNavigable = (item: T | null): void => {\n if (item === null || isNavigable(item)) {\n highlighted.set(item);\n }\n };\n\n const step = (direction: 1 | -1): void => {\n const list = navigable();\n if (list.length === 0) {\n highlighted.set(null);\n return;\n }\n\n const current = highlighted();\n const currentIndex = current === null ? -1 : list.indexOf(current);\n\n // No valid anchor → enter from the appropriate end.\n if (currentIndex === -1) {\n highlighted.set(direction === 1 ? list[0] : list[list.length - 1]);\n return;\n }\n\n let nextIndex = currentIndex + direction;\n const shouldLoop = loop ? loop() : true;\n\n if (nextIndex < 0) {\n nextIndex = shouldLoop ? list.length - 1 : 0;\n } else if (nextIndex >= list.length) {\n nextIndex = shouldLoop ? 0 : list.length - 1;\n }\n\n highlighted.set(list[nextIndex]);\n };\n\n // Self-heal: drop a highlight that is no longer navigable (filtered out, disabled, destroyed).\n effect(\n () => {\n const list = navigable();\n const current = untracked(highlighted);\n if (current !== null && !list.includes(current)) {\n highlighted.set(null);\n }\n },\n injector ? { injector } : undefined\n );\n\n return {\n highlightedItem: highlighted.asReadonly(),\n activeId,\n first() {\n const list = navigable();\n highlighted.set(list.length > 0 ? list[0] : null);\n },\n last() {\n const list = navigable();\n highlighted.set(list.length > 0 ? list[list.length - 1] : null);\n },\n next() {\n step(1);\n },\n previous() {\n step(-1);\n },\n set: setIfNavigable,\n clear() {\n highlighted.set(null);\n }\n };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { assertInInjectionContext, DestroyRef, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nexport interface RdxPointerDragHandlers {\n /** Whether a press may begin a drag (e.g. enabled, not on an opt-out element, at a scroll edge). */\n canStart: (event: PointerEvent) => boolean;\n /** A drag actually began (the pointer moved past the start threshold). */\n onStart: (event: PointerEvent) => void;\n /** Pointer moved during a drag. Return `false` to end the gesture early (treated as not committed). */\n onMove: (event: PointerEvent) => void | boolean;\n /** The drag ended. `committed` is true only for a normal `pointerup`, false for cancel/lost-capture/early-stop. */\n onEnd: (event: PointerEvent, committed: boolean) => void;\n}\n\n/** Pointer travel (px) before a press becomes a drag — below this a press stays a click/tap. */\nconst DRAG_THRESHOLD = 4;\n\n/**\n * Shared pointer-drag lifecycle for gesture primitives (drawer swipe, toast swipe, etc.).\n *\n * A press only becomes a drag once the pointer moves past {@link DRAG_THRESHOLD}; until then it is a\n * plain tap, so clicks on buttons inside the element keep working (the gesture never captures the\n * pointer for a tap). Once dragging, the pointer is captured so a drag that leaves the element still\n * completes, and `lostpointercapture` / `pointercancel` count as a non-committed end — a swallowed\n * `pointerup` (native context menu, OS gesture, tab switch) can never wedge the gesture. Only the\n * primary pointer is tracked, so a second finger can't start a parallel gesture. No-op outside the\n * browser, keeping SSR safe.\n *\n * `onEnd` is NOT called if the host is destroyed mid-drag — callers that pair `onStart`/`onEnd`\n * (e.g. to pause/resume timers) should balance that case in their own `DestroyRef` cleanup.\n *\n * Must be called from an injection context (a directive/component constructor).\n */\nexport function usePointerDrag(handlers: RdxPointerDragHandlers): void {\n assertInInjectionContext(usePointerDrag);\n\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return;\n }\n\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n let pointerId: number | null = null;\n let downEvent: PointerEvent | null = null;\n let dragging = false;\n\n const removeWindowListeners = () => {\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n window.removeEventListener('pointercancel', onPointerUp);\n };\n\n const reset = (event: PointerEvent, committed: boolean) => {\n if (pointerId === null) {\n return;\n }\n\n const wasDragging = dragging;\n\n try {\n host.releasePointerCapture?.(pointerId);\n } catch {\n // Capture may already be gone (e.g. on lostpointercapture); ignore.\n }\n\n pointerId = null;\n downEvent = null;\n dragging = false;\n removeWindowListeners();\n\n // A press that never crossed the threshold was a tap — leave the click untouched.\n if (wasDragging) {\n handlers.onEnd(event, committed);\n }\n };\n\n function onPointerMove(event: PointerEvent) {\n if (event.pointerId !== pointerId || !downEvent) {\n return;\n }\n\n if (!dragging) {\n const dx = event.clientX - downEvent.clientX;\n const dy = event.clientY - downEvent.clientY;\n\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD) {\n return;\n }\n\n dragging = true;\n\n try {\n host.setPointerCapture?.(pointerId);\n } catch {\n // Not all environments support pointer capture; the window listeners still drive the gesture.\n }\n\n handlers.onStart(downEvent);\n }\n\n if (handlers.onMove(event) === false) {\n reset(event, false);\n }\n }\n\n function onPointerUp(event: PointerEvent) {\n if (event.pointerId !== pointerId) {\n return;\n }\n\n reset(event, event.type === 'pointerup');\n }\n\n const onLostCapture = (event: PointerEvent) => {\n if (event.pointerId === pointerId) {\n reset(event, false);\n }\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (pointerId !== null || !event.isPrimary || event.button !== 0 || !handlers.canStart(event)) {\n return;\n }\n\n pointerId = event.pointerId;\n downEvent = event;\n dragging = false;\n\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n window.addEventListener('pointercancel', onPointerUp);\n };\n\n host.addEventListener('pointerdown', onPointerDown);\n host.addEventListener('lostpointercapture', onLostCapture as EventListener);\n\n inject(DestroyRef).onDestroy(() => {\n host.removeEventListener('pointerdown', onPointerDown);\n host.removeEventListener('lostpointercapture', onLostCapture as EventListener);\n removeWindowListeners();\n });\n}\n","import { afterNextRender, DestroyRef, inject, Injector, signal, Signal } from '@angular/core';\n\n/**\n * Lifecycle phase of an open/close transition.\n *\n * - `'starting'` — the part has just mounted/opened; the enter animation is about to run.\n * - `'ending'` — the part is closing; the exit animation is running.\n * - `undefined` — settled (no transition in progress).\n */\nexport type RdxTransitionStatus = 'starting' | 'ending' | undefined;\n\n/**\n * Grace period (ms) added to an element's declared transition duration before the\n * safety-net timer force-completes a transition. Only matters when the real\n * `animationend`/`transitionend` never arrives (interrupted, replaced without a\n * cancel event, reduced motion, …).\n */\nconst TRANSITION_FALLBACK_BUFFER = 50;\n\nexport interface RdxTransitionStatusRef {\n /** Reactive transition phase, intended for `data-starting-style` / `data-ending-style` bindings. */\n readonly status: Signal<RdxTransitionStatus>;\n /**\n * Registers the element whose CSS transition/animation duration determines when the close\n * transition is considered complete. Returns a cleanup that unregisters it.\n */\n registerElement: (element: HTMLElement) => () => void;\n /** Drives a new transition for the given open state. Cancels any in-flight transition. */\n start: (open: boolean) => void;\n}\n\n/**\n * Shared open/close transition state machine used by overlay primitives (dialog, popover, …).\n *\n * On `start(open)` it flips `status` to `'starting'`/`'ending'`, then — after the next render and\n * (for opening) one animation frame — clears it and waits for the registered element's running CSS\n * animations/transitions to finish (via the Web Animations API) before invoking `onComplete(open)`.\n * Completing on the real `animationend` rather than a duration timer keeps it from firing a frame\n * late. A duration-based timer remains as a safety net, and if no element is registered or it has no\n * animation (also SSR / jsdom, where computed durations are `0`) completion is synchronous.\n *\n * Must be called in an injection context (uses {@link Injector} and {@link DestroyRef}).\n */\nexport function useTransitionStatus(onComplete: (open: boolean) => void): RdxTransitionStatusRef {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n const status = signal<RdxTransitionStatus>(undefined);\n\n let element: HTMLElement | undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let frame: number | undefined;\n let version = 0;\n\n const clearTimers = () => {\n if (frame !== undefined) {\n cancelAnimationFrame(frame);\n frame = undefined;\n }\n\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const complete = (open: boolean, currentVersion: number) => {\n if (currentVersion !== version) {\n return;\n }\n\n clearTimers();\n status.set(undefined);\n\n if (!destroyRef.destroyed) {\n onComplete(open);\n }\n };\n\n const waitForTransition = (open: boolean, currentVersion: number) => {\n const node = element;\n const duration = node ? getMaxTransitionDuration(node) : 0;\n\n // Nothing animating (also the SSR / jsdom path, where computed durations are\n // 0): settle synchronously, exactly as before.\n if (!node || duration === 0) {\n complete(open, currentVersion);\n return;\n }\n\n // Prefer the Web Animations API so completion lands on the real\n // `animationend` / `transitionend` instead of a timer that can fire a frame\n // late — that lateness is what let a closing collapsible flash back to its\n // natural size before `hidden` was applied.\n const animations = typeof node.getAnimations === 'function' ? node.getAnimations() : [];\n\n // Safety net: if an animation never settles (interrupted, replaced without a\n // cancel event, reduced motion, or simply not exposed by the engine yet)\n // still complete shortly after the declared duration.\n timer = setTimeout(() => complete(open, currentVersion), duration + TRANSITION_FALLBACK_BUFFER);\n\n if (animations.length === 0) {\n return;\n }\n\n // A cancelled animation rejects `finished`; swallow it so reopening (which\n // cancels the in-flight animation) still resolves and settles.\n void Promise.all(animations.map((animation) => animation.finished.catch(() => undefined))).then(() =>\n complete(open, currentVersion)\n );\n };\n\n destroyRef.onDestroy(clearTimers);\n\n return {\n status: status.asReadonly(),\n registerElement: (registered: HTMLElement) => {\n element = registered;\n\n return () => {\n if (element === registered) {\n element = undefined;\n }\n };\n },\n start: (open: boolean) => {\n const currentVersion = ++version;\n clearTimers();\n status.set(open ? 'starting' : 'ending');\n\n afterNextRender(\n () => {\n if (destroyRef.destroyed || currentVersion !== version) {\n return;\n }\n\n if (open) {\n frame = requestAnimationFrame(() => {\n frame = undefined;\n\n if (destroyRef.destroyed || currentVersion !== version) {\n return;\n }\n\n status.set(undefined);\n waitForTransition(open, currentVersion);\n });\n } else {\n waitForTransition(open, currentVersion);\n }\n },\n { injector }\n );\n }\n };\n}\n\n/** Longest of an element's CSS transition / animation durations (including delays), in milliseconds. */\nexport function getMaxTransitionDuration(element: HTMLElement): number {\n const styles = getComputedStyle(element);\n\n return Math.max(\n getMaxCssDuration(styles.transitionDuration, styles.transitionDelay),\n getMaxCssDuration(styles.animationDuration, styles.animationDelay)\n );\n}\n\nfunction getMaxCssDuration(durations: string, delays: string): number {\n const parsedDurations = durations.split(',').map(parseCssTime);\n const parsedDelays = delays.split(',').map(parseCssTime);\n\n return parsedDurations.reduce(\n (max, duration, index) => Math.max(max, duration + parsedDelays[index % parsedDelays.length]),\n 0\n );\n}\n\nfunction parseCssTime(value: string): number {\n const trimmed = value.trim();\n const parsed = Number.parseFloat(trimmed);\n\n if (!Number.isFinite(parsed)) {\n return 0;\n }\n\n return trimmed.endsWith('ms') ? parsed : parsed * 1000;\n}\n","// https://ngxtension.netlify.app/utilities/signals/explicit-effect/\n\nimport { CreateEffectOptions, EffectCleanupRegisterFn, EffectRef, effect, untracked } from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * Extend the regular set of effect options\n */\ndeclare interface CreateExplicitEffectOptions extends CreateEffectOptions {\n /**\n * Option that allows the computation not to execute immediately, but only run on first change.\n */\n defer?: boolean;\n}\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n *\n * @example\n * ```typescript\n * import { watch } from 'radix-ng/primitives/core';\n *\n * const count = signal(0);\n * const state = signal('idle');\n *\n * watch([count, state], ([count, state], cleanup) => {\n * console.log('count updated', count, state);\n *\n * cleanup(() => {\n * console.log('cleanup');\n * });\n * });\n * ```\n *\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function watch<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateExplicitEffectOptions | undefined\n): EffectRef {\n let defer = options && options.defer;\n return effect((onCleanup) => {\n const depValues = deps.map((s) => s());\n untracked(() => {\n if (!defer) {\n fn(depValues as any, onCleanup);\n }\n defer = false;\n });\n }, options);\n}\n","export enum RdxPositionSide {\n Top = 'top',\n Right = 'right',\n Bottom = 'bottom',\n Left = 'left'\n}\n\nexport enum RdxPositionAlign {\n Start = 'start',\n Center = 'center',\n End = 'end'\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DOCS","DOCUMENT"],"mappings":";;;;;;AAGA;;;;;;;;;AASG;AACG,SAAU,oBAAoB,CAAI,IAAa,EAAA;IACjD,OAAO;AACH,QAAA,OAAO,EAAE,iBAAiB;AAC1B,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;AACnC,QAAA,KAAK,EAAE;KACV;AACL;;ACdA;;;AAGG;MAKU,uBAAuB,CAAA;AAJpC,IAAA,WAAA,GAAA;AAKI;;;AAGG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK,CAAI,SAAS,kFAAI,KAAK,EAAE,OAAO,EAAA,CAAG;AAE7D;;;;AAIG;AACM,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAwB,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,eAAA,EAAA,8BAAA,EAAA,CAAA,EACvD,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,gBAAgB,EAAA,CAC7B;QAEO,IAAA,CAAA,WAAW,GAAG,MAAM,EAAK;QAEjB,IAAA,CAAA,MAAM,GAAG,YAAY,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