@ai-ecoverse/slicc-spectrum 1.21.0 → 1.22.0

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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/@spectrum-web-components/reactive-controllers/src/ElementResolution.ts", "../node_modules/@spectrum-web-components/shared/src/reparent-children.ts", "../node_modules/@spectrum-web-components/overlay/src/overlay-timer.ts", "../node_modules/@spectrum-web-components/overlay/src/AbstractOverlay.ts", "../node_modules/@spectrum-web-components/overlay/src/events.ts", "../node_modules/@spectrum-web-components/overlay/src/VirtualTrigger.ts", "../node_modules/@spectrum-web-components/overlay/src/OverlayNoPopover.ts", "../node_modules/@spectrum-web-components/overlay/src/OverlayPopover.ts", "../node_modules/@spectrum-web-components/overlay/src/OverlayStack.ts", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../node_modules/@spectrum-web-components/overlay/src/PlacementController.ts", "../node_modules/@spectrum-web-components/overlay/src/InteractionController.ts", "../node_modules/@spectrum-web-components/overlay/src/LongpressController.ts", "../node_modules/@spectrum-web-components/overlay/src/overlay.css.ts", "../node_modules/@spectrum-web-components/overlay/src/ClickController.ts", "../node_modules/@spectrum-web-components/overlay/src/HoverController.ts", "../node_modules/@spectrum-web-components/overlay/src/strategies.ts", "../node_modules/@spectrum-web-components/overlay/src/Overlay.ts"],
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nexport const elementResolverUpdatedSymbol = Symbol('element resolver updated');\n\nexport class ElementResolutionController implements ReactiveController {\n get element(): HTMLElement | null {\n return this._element;\n }\n\n set element(element: HTMLElement | null) {\n if (element === this.element) {\n return;\n }\n const previous = this.element;\n this._element = element;\n // requestUpdate leveraging the exported Symbol() so that the\n // changes can be easily tracked in the host element.\n this.host.requestUpdate(elementResolverUpdatedSymbol, previous);\n }\n\n private _element: HTMLElement | null = null;\n\n private host!: ReactiveElement;\n\n private observer!: MutationObserver;\n\n get selector(): string {\n return this._selector;\n }\n\n set selector(selector: string) {\n if (selector === this.selector) {\n return;\n }\n this.releaseElement();\n this._selector = selector;\n this.resolveElement();\n }\n\n private _selector = '';\n\n get selectorAsId(): string {\n return this.selector.slice(1);\n }\n\n get selectorIsId(): boolean {\n return !!this.selector && this.selector.startsWith('#');\n }\n\n constructor(\n host: ReactiveElement,\n { selector }: { selector: string } = { selector: '' }\n ) {\n this.host = host;\n this.selector = selector;\n this.observer = new MutationObserver(this.mutationCallback);\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n protected mutationCallback: MutationCallback = (mutationList) => {\n let needsResolution = false;\n mutationList.forEach((mutation) => {\n if (needsResolution) {\n return;\n }\n if (mutation.type === 'childList') {\n const currentElementRemoved =\n this.element && [...mutation.removedNodes].includes(this.element);\n const matchingElementAdded =\n !!this.selector &&\n ([...mutation.addedNodes] as HTMLElement[]).some(\n this.elementIsSelected\n );\n needsResolution =\n needsResolution || currentElementRemoved || matchingElementAdded;\n }\n if (mutation.type === 'attributes') {\n const attributeChangedOnCurrentElement =\n mutation.target === this.element;\n const attributeChangedOnMatchingElement =\n !!this.selector &&\n this.elementIsSelected(mutation.target as HTMLElement);\n needsResolution =\n needsResolution ||\n attributeChangedOnCurrentElement ||\n attributeChangedOnMatchingElement;\n }\n });\n if (needsResolution) {\n this.resolveElement();\n }\n };\n\n public hostConnected(): void {\n this.resolveElement();\n this.observer.observe(this.host.getRootNode(), {\n subtree: true,\n childList: true,\n attributes: true,\n });\n }\n\n public hostDisconnected(): void {\n this.releaseElement();\n this.observer.disconnect();\n }\n\n private resolveElement(): void {\n if (!this.selector) {\n this.releaseElement();\n return;\n }\n\n const parent = this.host.getRootNode() as ShadowRoot;\n this.element = this.selectorIsId\n ? (parent.getElementById(this.selectorAsId) as HTMLElement)\n : (parent.querySelector(this.selector) as HTMLElement);\n }\n\n private releaseElement(): void {\n this.element = null;\n }\n\n private elementIsSelected = (el: HTMLElement): boolean => {\n return this.selectorIsId\n ? el?.id === this.selectorAsId\n : el?.matches?.(this.selector);\n };\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nfunction restoreChildren<T extends Element>(\n placeholderItems: Comment[],\n srcElements: T[],\n cleanupCallbacks: ((el: T) => void)[] = []\n): T[] {\n for (let index = 0; index < srcElements.length; ++index) {\n const srcElement = srcElements[index];\n const placeholderItem = placeholderItems[index];\n const parentElement =\n placeholderItem.parentElement || placeholderItem.getRootNode();\n if (cleanupCallbacks[index]) {\n cleanupCallbacks[index](srcElement);\n }\n if (parentElement && parentElement !== placeholderItem) {\n parentElement.replaceChild(srcElement, placeholderItem);\n }\n delete placeholderItems[index];\n }\n return srcElements;\n}\n\nexport const reparentChildren = <T extends Element>(\n srcElements: T[],\n destination: Element,\n {\n position,\n prepareCallback,\n }: {\n position: InsertPosition;\n prepareCallback?: (el: T) => ((el: T) => void) | void;\n } = { position: 'beforeend' }\n): (() => T[]) => {\n let { length } = srcElements;\n if (length === 0) {\n return () => srcElements;\n }\n\n let step = 1;\n let index = 0;\n\n if (position === 'afterbegin' || position === 'afterend') {\n step = -1;\n index = length - 1;\n }\n\n const placeholderItems = new Array<Comment>(length);\n const cleanupCallbacks = new Array<(el: T) => void>(length);\n const placeholderTemplate: Comment = document.createComment(\n 'placeholder for reparented element'\n );\n\n do {\n const srcElement = srcElements[index];\n if (prepareCallback) {\n cleanupCallbacks[index] = prepareCallback(srcElement) as (el: T) => void;\n }\n placeholderItems[index] = placeholderTemplate.cloneNode() as Comment;\n\n const parentElement = srcElement.parentElement || srcElement.getRootNode();\n if (parentElement && parentElement !== srcElement) {\n parentElement.replaceChild(placeholderItems[index], srcElement);\n }\n destination.insertAdjacentElement(position, srcElement);\n\n index += step;\n } while (--length > 0);\n\n return function (): T[] {\n return restoreChildren<T>(placeholderItems, srcElements, cleanupCallbacks);\n };\n};\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nconst DEFAULT_WARMUP = 1000;\nconst DEFAULT_COOLDOWN = 1000;\n\n/**\n * A timer to help with implementation of warnup/cooldown behavior as described here:\n * https://spectrum.adobe.com/page/tooltip/#Immediate-or-delayed-appearance\n */\nexport class OverlayTimer {\n private warmUpDelay = DEFAULT_WARMUP;\n private coolDownDelay = DEFAULT_COOLDOWN;\n\n private isWarm = false;\n private cooldownTimeout?: number;\n\n private component?: HTMLElement;\n private timeout = 0;\n private promise?: Promise<boolean>;\n private resolve?: (cancelled: boolean) => void;\n\n constructor(options: { warmUpDelay?: number; coolDownDelay?: number } = {}) {\n Object.assign(this, options);\n }\n\n public async openTimer(component: HTMLElement): Promise<boolean> {\n this.cancelCooldownTimer();\n\n if (!this.component || component !== this.component) {\n if (this.component) {\n this.close(this.component);\n this.cancelCooldownTimer();\n }\n this.component = component;\n\n if (this.isWarm) {\n return false;\n }\n\n this.promise = new Promise((resolve) => {\n this.resolve = resolve;\n this.timeout = window.setTimeout(() => {\n if (this.resolve) {\n this.resolve(false);\n this.isWarm = true;\n }\n }, this.warmUpDelay);\n });\n return this.promise;\n } else if (this.promise) {\n return this.promise;\n /* c8 ignore next 4 */\n } else {\n // This should never happen\n throw new Error('Inconsistent state');\n }\n }\n\n public close(component: HTMLElement): void {\n if (this.component && this.component === component) {\n this.resetCooldownTimer();\n if (this.timeout > 0) {\n clearTimeout(this.timeout);\n this.timeout = 0;\n }\n if (this.resolve) {\n this.resolve(true);\n delete this.resolve;\n }\n delete this.promise;\n delete this.component;\n }\n }\n\n private resetCooldownTimer(): void {\n if (this.isWarm) {\n if (this.cooldownTimeout) {\n window.clearTimeout(this.cooldownTimeout);\n }\n this.cooldownTimeout = window.setTimeout(() => {\n this.isWarm = false;\n delete this.cooldownTimeout;\n }, this.coolDownDelay);\n }\n }\n\n private cancelCooldownTimer(): void {\n if (this.cooldownTimeout) {\n window.clearTimeout(this.cooldownTimeout);\n }\n delete this.cooldownTimeout;\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { SpectrumElement } from '@spectrum-web-components/base';\nimport type { ElementResolutionController } from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\nimport type { Overlay } from './Overlay.js';\nimport { OverlayTimer } from './overlay-timer.js';\nimport type {\n OpenableElement,\n OverlayOptions,\n OverlayOptionsV1,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteractionsV1,\n} from './overlay-types.js';\nimport type { PlacementController } from './PlacementController.js';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\n\nexport const overlayTimer = new OverlayTimer();\n\nexport const noop = (): void => {\n return;\n};\n\n/**\n * Apply a \"transitionend\" listener to an element that may not transition but\n * guarantee the callback will be fired either way.\n *\n * @param el {HTMLElement} - Target of the \"transition\" listeners.\n * @param action {Function} - Method to trigger the \"transition\".\n * @param cb {Function} - Callback to trigger when the \"transition\" has ended.\n */\nexport const guaranteedAllTransitionend = (\n el: HTMLElement,\n action: () => void,\n cb: () => void\n): void => {\n const abortController = new AbortController();\n const runningTransitions = new Map<string, number>();\n const cleanup = (): void => {\n abortController.abort();\n cb();\n };\n let guarantee2: number;\n let guarantee3: number;\n // WebKit fires `transitionrun` a little earlier, the multiple guarantees here\n // allow WebKit to be caught, but doesn't remove the animation listener until\n // after it would have fired in Chromium.\n const guarantee1 = requestAnimationFrame(() => {\n guarantee2 = requestAnimationFrame(() => {\n guarantee3 = requestAnimationFrame(() => {\n cleanup();\n });\n });\n });\n const handleTransitionend = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) - 1\n );\n if (!runningTransitions.get(event.propertyName)) {\n runningTransitions.delete(event.propertyName);\n }\n if (runningTransitions.size === 0) {\n cleanup();\n }\n };\n const handleTransitionrun = (event: TransitionEvent): void => {\n if (event.target !== el) {\n return;\n }\n if (!runningTransitions.has(event.propertyName)) {\n runningTransitions.set(event.propertyName, 0);\n }\n runningTransitions.set(\n event.propertyName,\n (runningTransitions.get(event.propertyName) as number) + 1\n );\n cancelAnimationFrame(guarantee1);\n cancelAnimationFrame(guarantee2);\n cancelAnimationFrame(guarantee3);\n };\n el.addEventListener('transitionrun', handleTransitionrun, {\n signal: abortController.signal,\n });\n el.addEventListener('transitionend', handleTransitionend, {\n signal: abortController.signal,\n });\n el.addEventListener('transitioncancel', handleTransitionend, {\n signal: abortController.signal,\n });\n action();\n};\n\nexport function nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\n/**\n * Abstract Overlay base class so that property tyings and imperative API\n * interfaces can be held separate from the actual class definition.\n */\nexport class AbstractOverlay extends SpectrumElement {\n protected async applyFocus(\n _targetOpenState: boolean,\n _focusEl: HTMLElement | null\n ): Promise<void> {\n return;\n }\n /* c8 ignore next 6 */\n get delayed(): boolean {\n return false;\n }\n set delayed(_delayed: boolean) {\n return;\n }\n dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n /* c8 ignore next 6 */\n get disabled(): boolean {\n return false;\n }\n set disabled(_disabled: boolean) {\n return;\n }\n dispose = noop;\n protected get elementResolver(): ElementResolutionController {\n return this._elementResolver;\n }\n protected set elementResolver(controller) {\n this._elementResolver = controller;\n }\n protected _elementResolver!: ElementResolutionController;\n /* c8 ignore next 3 */\n protected async ensureOnDOM(_targetOpenState: boolean): Promise<void> {\n return;\n }\n elements!: OpenableElement[];\n /* c8 ignore next 5 */\n protected async makeTransition(\n _targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n return null;\n }\n protected async manageDelay(_targetOpenState: boolean): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected async managePopoverOpen(): Promise<void> {\n return;\n }\n /* c8 ignore next 3 */\n protected managePosition(): void {\n return;\n }\n protected offset: number | [number, number] = 0;\n /* c8 ignore next 6 */\n get open(): boolean {\n return false;\n }\n set open(_open: boolean) {\n return;\n }\n placement?: Placement;\n protected get placementController(): PlacementController {\n return this._placementController;\n }\n protected set placementController(controller) {\n this._placementController = controller;\n }\n protected _placementController!: PlacementController;\n receivesFocus!: 'true' | 'false' | 'auto';\n protected requestSlottable(): void {}\n protected returnFocus(): void {\n return;\n }\n /* c8 ignore next 6 */\n get state(): OverlayState {\n return 'closed';\n }\n set state(_state: OverlayState) {\n return;\n }\n protected _state!: OverlayState;\n triggerElement!: HTMLElement | VirtualTrigger | null;\n type!: OverlayTypes;\n willPreventClose = false;\n /* c8 ignore next 3 */\n public manuallyKeepOpen(): void {\n return;\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n // @todo remove this long standing legacy API\n\n /**\n * Overloaded imperative API entry point that allows for both the pre-0.37.0\n * argument signature as well as the post-0.37.0 signature. This allows for\n * consumers to continue to leverage it as they had been in previous releases\n * while also surfacing the more feature-rich API that has been made available.\n */\n public static async open(\n trigger: HTMLElement,\n interaction: TriggerInteractionsV1,\n content: HTMLElement,\n optionsV1: OverlayOptionsV1\n ): Promise<() => void>;\n public static async open(\n content: HTMLElement,\n options?: OverlayOptions\n ): Promise<Overlay>;\n public static async open(\n triggerOrContent: HTMLElement,\n interactionOrOptions: TriggerInteractionsV1 | OverlayOptions | undefined,\n content?: HTMLElement,\n optionsV1?: OverlayOptionsV1\n ): Promise<Overlay | (() => void)> {\n /* eslint-disable import/no-extraneous-dependencies */\n await import('@spectrum-web-components/overlay/sp-overlay.js');\n const v2 = arguments.length === 2;\n const overlayContent = content || triggerOrContent;\n // Use the `this` from the `static` method context rather than a\n // specific imported constructor to prevent opening a circular dependency.\n const overlay = new this() as Overlay;\n let restored = false;\n overlay.dispose = () => {\n overlay.addEventListener('sp-closed', () => {\n if (!restored) {\n restoreContent();\n restored = true;\n }\n requestAnimationFrame(() => {\n overlay.remove();\n });\n });\n overlay.open = false;\n overlay.dispose = noop;\n };\n\n /**\n * Since content must exist in an <sp-overlay>, we need a way to get it there.\n * The best & most-direct way is to declaratively use an <sp-overlay> element,\n * but for imperative users, we'll reparent content into an overlay that we've created for them.\n **/\n const restoreContent = reparentChildren([overlayContent], overlay, {\n position: 'beforeend',\n prepareCallback: (el) => {\n // Ensure that content to be overlaid is no longer targetted to a specific `slot`.\n // This allow for it to be visible in the overlaid context.\n const slot = el.slot;\n el.removeAttribute('slot');\n return () => {\n el.slot = slot;\n };\n },\n });\n\n const v1 = !v2 && overlayContent && optionsV1;\n if (v1) {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n overlay,\n `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n }\n const trigger = triggerOrContent;\n const interaction = interactionOrOptions;\n const options = optionsV1;\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n trigger: options.virtualTrigger || trigger,\n type:\n interaction === 'modal'\n ? 'modal'\n : interaction === 'hover'\n ? 'hint'\n : 'auto',\n });\n trigger.insertAdjacentElement('afterend', overlay);\n await overlay.updateComplete;\n overlay.open = true;\n return overlay.dispose;\n }\n\n const options = interactionOrOptions as OverlayOptions;\n overlay.append(overlayContent);\n AbstractOverlay.applyOptions(overlay, {\n ...options,\n delayed: options.delayed || overlayContent.hasAttribute('delayed'),\n });\n overlay.updateComplete.then(() => {\n // Do we want to \"open\" this path, or leave that to the consumer?\n overlay.open = true;\n });\n return overlay;\n }\n\n static applyOptions(overlay: AbstractOverlay, options: OverlayOptions): void {\n overlay.delayed = !!options.delayed;\n overlay.receivesFocus = options.receivesFocus ?? 'auto';\n overlay.triggerElement = options.trigger || null;\n overlay.type = options.type || 'modal';\n overlay.offset = options.offset ?? 0;\n overlay.placement = options.placement;\n overlay.willPreventClose = !!options.notImmediatelyClosable;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { TriggerInteractions } from './overlay-types.js';\n\nexport class BeforetoggleClosedEvent extends Event {\n currentState = 'open';\n newState = 'closed';\n constructor() {\n super('beforetoggle', {\n bubbles: false,\n composed: false,\n });\n }\n}\n\nexport class BeforetoggleOpenEvent extends Event {\n currentState = 'closed';\n newState = 'open';\n constructor() {\n super('beforetoggle', {\n bubbles: false,\n composed: false,\n });\n }\n}\n\nexport class OverlayStateEvent extends Event {\n detail!: {\n interaction: string;\n reason?: 'external-click';\n };\n\n constructor(\n type: string,\n public overlay: HTMLElement,\n {\n publish,\n interaction,\n reason,\n }: {\n publish?: boolean;\n interaction: TriggerInteractions;\n reason?: 'external-click';\n }\n ) {\n super(type, {\n bubbles: publish,\n composed: publish,\n });\n this.detail = {\n interaction,\n reason,\n };\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { AbstractOverlay } from './AbstractOverlay.js';\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n AbstractOverlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n /* c8 ignore next 3 */\n toJSON() {\n return;\n },\n };\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type { SpectrumElement } from '@spectrum-web-components/base';\nimport { userFocusableSelector } from '@spectrum-web-components/shared';\nimport {\n firstFocusableIn,\n firstFocusableSlottedIn,\n} from '@spectrum-web-components/shared/src/first-focusable-in.js';\n\nimport type { AbstractOverlay } from './AbstractOverlay.js';\nimport {\n guaranteedAllTransitionend,\n nextFrame,\n overlayTimer,\n} from './AbstractOverlay.js';\nimport {\n BeforetoggleClosedEvent,\n BeforetoggleOpenEvent,\n OverlayStateEvent,\n} from './events.js';\nimport { Constructor, OpenableElement } from './overlay-types.js';\nimport { VirtualTrigger } from './VirtualTrigger.js';\n\nexport function OverlayNoPopover<T extends Constructor<AbstractOverlay>>(\n constructor: T\n): T & Constructor<SpectrumElement> {\n class OverlayWithNoPopover extends constructor {\n protected override async managePopoverOpen(): Promise<void> {\n await this.managePosition();\n }\n\n protected override async manageDelay(\n targetOpenState: boolean\n ): Promise<void> {\n if (targetOpenState === false || targetOpenState !== this.open) {\n overlayTimer.close(this);\n return;\n }\n if (this.delayed) {\n const cancelled = await overlayTimer.openTimer(this);\n if (cancelled) {\n this.open = !targetOpenState;\n }\n }\n }\n\n protected override async ensureOnDOM(\n _targetOpenState: boolean\n ): Promise<void> {\n // force the browser to paint\n /** @todo investigate why this is needed and if there is a better way to do this or remove it entirely */\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n document.body.offsetHeight;\n }\n\n protected override async makeTransition(\n targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n if (this.open !== targetOpenState) {\n return null;\n }\n let focusEl = null as HTMLElement | null;\n const start = (el: OpenableElement, index: number) => (): void => {\n if (targetOpenState !== this.open) {\n return;\n }\n el.open = targetOpenState;\n if (index === 0) {\n const event = targetOpenState\n ? BeforetoggleOpenEvent\n : BeforetoggleClosedEvent;\n this.dispatchEvent(new event());\n }\n if (targetOpenState !== true) {\n return;\n }\n if (el.matches(userFocusableSelector)) {\n focusEl = el;\n }\n focusEl = focusEl || firstFocusableIn(el);\n if (focusEl) {\n return;\n }\n const childSlots = el.querySelectorAll('slot');\n childSlots.forEach((slot) => {\n if (!focusEl) {\n focusEl = firstFocusableSlottedIn(slot);\n }\n });\n };\n const finish =\n (el: OpenableElement, index: number) => async (): Promise<void> => {\n if (this.open !== targetOpenState) {\n return;\n }\n const eventName = targetOpenState ? 'sp-opened' : 'sp-closed';\n el.dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n })\n );\n if (index > 0) {\n return;\n }\n const hasVirtualTrigger =\n this.triggerElement instanceof VirtualTrigger;\n this.dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: hasVirtualTrigger,\n })\n );\n if (this.triggerElement && !hasVirtualTrigger) {\n (this.triggerElement as HTMLElement).dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: true,\n })\n );\n }\n this.state = targetOpenState ? 'opened' : 'closed';\n this.returnFocus();\n // Ensure layout and paint are done and the Overlay is still closed before removing the slottable request.\n await nextFrame();\n await nextFrame();\n if (targetOpenState === this.open && targetOpenState === false) {\n this.requestSlottable();\n }\n };\n this.elements.forEach((el, index) => {\n guaranteedAllTransitionend(el, start(el, index), finish(el, index));\n });\n return focusEl;\n }\n }\n return OverlayWithNoPopover;\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type { SpectrumElement } from '@spectrum-web-components/base';\nimport { userFocusableSelector } from '@spectrum-web-components/shared';\nimport {\n firstFocusableIn,\n firstFocusableSlottedIn,\n} from '@spectrum-web-components/shared/src/first-focusable-in.js';\n\nimport type { AbstractOverlay } from './AbstractOverlay.js';\nimport {\n guaranteedAllTransitionend,\n nextFrame,\n overlayTimer,\n} from './AbstractOverlay.js';\nimport {\n BeforetoggleClosedEvent,\n BeforetoggleOpenEvent,\n OverlayStateEvent,\n} from './events.js';\nimport { Constructor, OpenableElement } from './overlay-types.js';\nimport { VirtualTrigger } from './VirtualTrigger.js';\n\nconst supportsOverlayAuto = CSS.supports('(overlay: auto)');\n\n/**\n *\n * @param el - The element to check if it is open.\n * @returns True if the element is open, false otherwise.\n *\n * @todo Why does this need try/catches? Can't we just use the matches() method directly?\n * ```ts\n * return el.matches(':popover-open') || el.matches(':open')\n * ```\n */\nfunction isOpen(el: HTMLElement): boolean {\n let popoverOpen = false;\n try {\n popoverOpen = el.matches(':popover-open');\n // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars\n } catch (error) {}\n let open = false;\n try {\n open = el.matches(':open');\n // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars\n } catch (error) {}\n return popoverOpen || open;\n}\n\nexport function OverlayPopover<T extends Constructor<AbstractOverlay>>(\n constructor: T\n): T & Constructor<SpectrumElement> {\n class OverlayWithPopover extends constructor {\n protected override async manageDelay(\n targetOpenState: boolean\n ): Promise<void> {\n if (targetOpenState === false || targetOpenState !== this.open) {\n overlayTimer.close(this);\n return;\n }\n if (this.delayed) {\n const cancelled = await overlayTimer.openTimer(this);\n if (cancelled) {\n this.open = !targetOpenState;\n }\n }\n }\n\n /**\n * A popover should be hidden _after_ it is no longer on top-layer because\n * the position metrics will have changed from when it was originally positioned.\n */\n private async shouldHidePopover(targetOpenState: boolean): Promise<void> {\n if (targetOpenState && this.open !== targetOpenState) {\n return;\n }\n const update = async ({\n newState,\n }: { newState?: string } = {}): Promise<void> => {\n if (newState === 'open') {\n return;\n }\n // When in a parent Overlay, this Overlay may need to position itself\n // while closing in due to the parent _also_ closing which means the\n // location can no longer rely on \"top layer over transform\" math.\n await this.placementController.resetOverlayPosition();\n };\n if (!isOpen(this.dialogEl)) {\n // The means the Overlay was closed from the outside, it is already off of top-layer\n // so we need to position it in regards to this new state.\n update();\n return;\n }\n // `toggle` is an async event, so it's possible for this handler to run a frame late\n this.dialogEl.addEventListener('toggle', update as EventListener, {\n once: true,\n });\n }\n\n /**\n *\n * @param targetOpenState - The target open state of the overlay.\n * @returns True if the popover should be shown, false otherwise.\n *\n * @todo Why does this need try/catches? Can't we just use the matches() method directly?\n */\n private shouldShowPopover(targetOpenState: boolean): void {\n let popoverOpen = false;\n try {\n popoverOpen = this.dialogEl.matches(':popover-open');\n // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars\n } catch (error) {}\n let open = false;\n try {\n open = this.dialogEl.matches(':open');\n // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars\n } catch (error) {}\n if (\n targetOpenState &&\n this.open === targetOpenState &&\n !popoverOpen &&\n !open &&\n this.isConnected\n ) {\n this.dialogEl.showPopover();\n this.managePosition();\n }\n }\n\n protected override async ensureOnDOM(\n targetOpenState: boolean\n ): Promise<void> {\n if (!supportsOverlayAuto) {\n await this.shouldHidePopover(targetOpenState);\n }\n this.shouldShowPopover(targetOpenState);\n await nextFrame();\n }\n\n protected override async makeTransition(\n targetOpenState: boolean\n ): Promise<HTMLElement | null> {\n if (this.open !== targetOpenState) {\n return null;\n }\n let focusEl = null as HTMLElement | null;\n const start = (el: OpenableElement, index: number) => (): void => {\n el.open = targetOpenState;\n if (index === 0) {\n const event = targetOpenState\n ? BeforetoggleOpenEvent\n : BeforetoggleClosedEvent;\n this.dispatchEvent(new event());\n }\n if (!targetOpenState) {\n return;\n }\n if (el.matches(userFocusableSelector)) {\n focusEl = el;\n }\n focusEl = focusEl || firstFocusableIn(el);\n if (focusEl) {\n return;\n }\n const childSlots = el.querySelectorAll('slot');\n childSlots.forEach((slot) => {\n if (!focusEl) {\n focusEl = firstFocusableSlottedIn(slot);\n }\n });\n };\n const finish =\n (el: OpenableElement, index: number) => async (): Promise<void> => {\n if (this.open !== targetOpenState) {\n return;\n }\n const eventName = targetOpenState ? 'sp-opened' : 'sp-closed';\n if (index > 0) {\n el.dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: false,\n })\n );\n return;\n }\n const reportChange = async (): Promise<void> => {\n if (this.open !== targetOpenState) {\n return;\n }\n await nextFrame();\n const hasVirtualTrigger =\n this.triggerElement instanceof VirtualTrigger;\n this.dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: hasVirtualTrigger,\n })\n );\n el.dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: false,\n })\n );\n if (this.triggerElement && !hasVirtualTrigger) {\n (this.triggerElement as HTMLElement).dispatchEvent(\n new OverlayStateEvent(eventName, this, {\n interaction: this.type,\n publish: true,\n })\n );\n }\n this.state = targetOpenState ? 'opened' : 'closed';\n this.returnFocus();\n // Ensure layout and paint are done and the Overlay is still closed before removing the slottable request.\n await nextFrame();\n await nextFrame();\n if (targetOpenState === this.open && targetOpenState === false) {\n this.requestSlottable();\n }\n };\n if (this.open !== targetOpenState) {\n return;\n }\n const open = isOpen(this.dialogEl);\n if (targetOpenState !== true && open && this.isConnected) {\n this.dialogEl.addEventListener(\n 'beforetoggle',\n () => {\n reportChange();\n },\n { once: true }\n );\n this.dialogEl.hidePopover();\n } else {\n reportChange();\n }\n };\n this.elements.forEach((el, index) => {\n guaranteedAllTransitionend(el, start(el, index), finish(el, index));\n });\n return focusEl;\n }\n }\n return OverlayWithPopover;\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Overlay } from './Overlay.js';\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private lastOverlay?: Overlay;\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n private originalBodyOverflow = '';\n\n private bodyScrollBlocked = false;\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown, {\n capture: true,\n });\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('click', this.handleClick, {\n capture: true,\n });\n this.document.addEventListener('keydown', this.handleKeydown);\n this.document.addEventListener('scroll', this.handleScroll, {\n capture: true,\n });\n }\n\n private handleScroll = (event: Event): void => {\n // Only handle document/body level scrolls\n // Skip any component scrolls\n if (\n event.target !== document &&\n event.target !== document.documentElement &&\n event.target !== document.body\n ) {\n return;\n }\n // Update positions of all open overlays\n this.stack.forEach((overlay) => {\n if (overlay.open) {\n // Don't close pickers on document scroll\n if (\n overlay.type === 'auto' &&\n overlay.triggerElement instanceof HTMLElement &&\n overlay.triggerElement.closest('sp-picker, sp-action-menu')\n ) {\n event.stopPropagation();\n }\n // Update the overlay's position by dispatching the update event\n document.dispatchEvent(\n new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n });\n };\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n\n this.manageBodyScroll();\n }\n\n /**\n * Manage body scroll blocking based on modal/page overlays\n */\n private manageBodyScroll(): void {\n const shouldBlock = this.stack.some(\n (overlay) => overlay.type === 'modal' || overlay.type === 'page'\n );\n if (shouldBlock && !this.bodyScrollBlocked) {\n this.originalBodyOverflow = document.body.style.overflow || '';\n document.body.style.overflow = 'hidden';\n this.bodyScrollBlocked = true;\n } else if (!shouldBlock && this.bodyScrollBlocked) {\n document.body.style.overflow = this.originalBodyOverflow;\n this.bodyScrollBlocked = false;\n }\n }\n\n /**\n * Get all open modal/page overlays from the stack.\n * Cached to avoid repeated filtering.\n */\n private getModalOverlays(): Overlay[] {\n return this.stack.filter(\n (overlay) =>\n overlay.open && (overlay.type === 'modal' || overlay.type === 'page')\n );\n }\n\n /**\n * Check if an event path intersects with any modal overlay dialog.\n * This is the core logic for determining if a click/pointer event is inside a modal.\n *\n * @param eventPath {EventTarget[]} The composed path from the event\n * @param modalOverlays {Overlay[]} The modal overlays to check against\n * @returns {boolean} True if the event is inside any modal overlay\n */\n private isEventInsideModal(\n eventPath: EventTarget[],\n modalOverlays: Overlay[]\n ): boolean {\n for (const overlay of modalOverlays) {\n // Check if overlay element itself is in the path\n if (eventPath.includes(overlay)) {\n return true;\n }\n\n const dialogEl = overlay.dialogEl;\n if (!dialogEl) {\n continue;\n }\n\n // Check if dialog element is in the path\n if (eventPath.includes(dialogEl)) {\n return true;\n }\n\n // Check if any element in the path is contained by dialog\n for (const element of eventPath) {\n if (element instanceof Node && dialogEl.contains(element)) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Cache the `pointerdownTarget` for later testing and prevent clicks outside page overlays\n *\n * @param event {PointerEvent}\n */\n handlePointerdown = (event: Event): void => {\n if (!this.stack.length) {\n return;\n }\n\n const pointerPath = event.composedPath();\n\n // For page overlays only: block clicks outside (no light dismiss)\n // Modal overlays have light dismiss handled by handlePointerup\n const pageOverlays = this.stack.filter((o) => o.open && o.type === 'page');\n if (\n pageOverlays.length > 0 &&\n !this.isEventInsideModal(pointerPath, pageOverlays)\n ) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n\n this.pointerdownPath = pointerPath;\n this.lastOverlay = this.stack[this.stack.length - 1];\n };\n\n /**\n * Prevent clicks outside modal overlays from reaching external elements.\n * This replicates the behavior of dialog.showModal() which was removed\n * in favor of showPopover() for performance reasons.\n *\n * @param event {MouseEvent}\n */\n handleClick = (event: MouseEvent): void => {\n if (!this.stack.length) {\n return;\n }\n\n const modalOverlays = this.getModalOverlays();\n if (!modalOverlays.length) {\n return;\n }\n\n // Only block clicks for page overlays, not modal overlays.\n // Modal overlays use popover=\"manual\" for stacking and have light dismiss.\n const pageOverlays = modalOverlays.filter((o) => o.type === 'page');\n if (!pageOverlays.length) {\n return;\n }\n\n // Check if the click is inside any page overlay dialog\n const clickPath = event.composedPath();\n if (!this.isEventInsideModal(clickPath, pageOverlays)) {\n // If click is outside all page overlays, prevent it from reaching the target\n // This replicates the behavior that showModal() provided automatically\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n */\n handlePointerup = (): void => {\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n // Ensure that this value is cleared even if the work in this method goes undone.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n if (!this.stack.length) {\n return;\n }\n if (!composedPath?.length) {\n return;\n }\n const lastOverlay = this.lastOverlay;\n this.lastOverlay = undefined;\n\n const lastIndex = this.stack.length - 1;\n\n // Avoid the cost of event.composedPath() unless we actually have a modal/page\n // overlay open. composedPath() walks and allocates the full event path and can\n // be surprisingly expensive in hot paths.\n const hasModalOrPageOverlay = this.stack.some(\n (overlay) =>\n overlay.open && (overlay.type === 'modal' || overlay.type === 'page')\n );\n if (hasModalOrPageOverlay) {\n const clickedBackdrop = composedPath.some(\n (el) =>\n el instanceof HTMLDivElement &&\n el.classList.contains('modal-backdrop')\n );\n if (clickedBackdrop) {\n const topOverlay = this.stack[this.stack.length - 1];\n // Only modal overlays close on backdrop click.\n // Page overlays are blocking and should not be light-dismissable.\n if (topOverlay?.type === 'modal') {\n this.closeOverlay(topOverlay);\n }\n return;\n }\n }\n const nonAncestorOverlays = this.stack.filter((overlay, i) => {\n const inStack = composedPath.find(\n (el) =>\n // The Overlay is in the stack\n el === overlay ||\n // The Overlay trigger is in the stack and the Overlay is a \"hint\"\n (el === overlay?.triggerElement && 'hint' === overlay?.type) ||\n // The last Overlay in the stack is not the last Overlay at `pointerdown` time and has a\n // `triggerInteraction` of \"longpress\", meaning it was opened by this poitner interaction\n (i === lastIndex &&\n overlay !== lastOverlay &&\n overlay.triggerInteraction === 'longpress')\n );\n return (\n !inStack &&\n !overlay.shouldPreventClose() &&\n overlay.type !== 'manual' &&\n // Don't close if this overlay is modal and not on top of the overlay stack.\n !(overlay.type === 'modal' && lastOverlay !== overlay)\n );\n }) as Overlay[];\n nonAncestorOverlays.reverse();\n nonAncestorOverlays.forEach((overlay) => {\n this.closeOverlay(overlay);\n let parentToClose = overlay.parentOverlayToForceClose;\n while (parentToClose) {\n this.closeOverlay(parentToClose);\n parentToClose = parentToClose.parentOverlayToForceClose;\n }\n });\n };\n\n handleBeforetoggle = (event: Event): void => {\n const { target, newState: open } = event as Event & {\n newState: string;\n };\n if (open === 'open') {\n return;\n }\n this.closeOverlay(target as Overlay);\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code !== 'Escape') {\n return;\n }\n if (!this.stack.length) {\n return;\n }\n const last = this.stack[this.stack.length - 1];\n if (last?.type === 'hint') {\n // Close hint/tooltip overlays on \"Escape\" key and prevent further handling of the event.\n event.preventDefault();\n event.stopPropagation();\n this.closeOverlay(last);\n return;\n }\n if (last?.type === 'page') {\n event.preventDefault();\n return;\n }\n if (last?.type === 'manual') {\n // Manual overlays should close on \"Escape\" key, but not when losing focus or interacting with other parts of the page.\n this.closeOverlay(last);\n return;\n }\n if (last?.type === 'modal') {\n // Modal overlays use popover=\"manual\" to allow stacking multiple modals.\n // Handle Escape explicitly to close only the topmost modal.\n this.closeOverlay(last);\n return;\n }\n if (supportsPopover) {\n return;\n }\n if (!last) {\n return;\n }\n this.closeOverlay(last);\n };\n\n /**\n * Get an array of Overlays that all share the same trigger element.\n *\n * @param triggerElement {HTMLELement}\n * @returns {Overlay[]}\n */\n overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[] {\n return this.stack.filter(\n (overlay) => overlay.triggerElement === triggerElement\n );\n }\n\n /**\n * When overlays are added manage the open state of exisiting overlays appropriately:\n * - 'modal': should close other non-'modal' and non-'manual' overlays\n * - 'page': should close other non-'modal' and non-'manual' overlays\n * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays\n * - 'manual': shouldn't close other overlays\n * - 'hint': shouldn't close other overlays and give way to all other overlays on a trigger\n */\n add(overlay: Overlay): void {\n if (this.stack.includes(overlay)) {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n this.stack.push(overlay);\n }\n return;\n }\n if (\n overlay.type === 'auto' ||\n overlay.type === 'modal' ||\n overlay.type === 'page'\n ) {\n // manage closing open overlays\n const queryPathEventName = 'sp-overlay-query-path';\n const queryPathEvent = new Event(queryPathEventName, {\n composed: true,\n bubbles: true,\n });\n overlay.addEventListener(\n queryPathEventName,\n (event: Event) => {\n const path = event.composedPath();\n this.stack.forEach((overlayEl) => {\n const inPath = path.find((el) => el === overlayEl);\n if (\n !inPath &&\n overlayEl.type !== 'manual' &&\n overlayEl.type !== 'modal'\n ) {\n this.closeOverlay(overlayEl);\n }\n });\n },\n { once: true }\n );\n overlay.dispatchEvent(queryPathEvent);\n } else if (overlay.type === 'hint') {\n const hasPrevious = this.stack.some((overlayEl) => {\n return (\n overlayEl.type !== 'manual' &&\n overlayEl.triggerElement &&\n overlayEl.triggerElement === overlay.triggerElement\n );\n });\n if (hasPrevious) {\n overlay.open = false;\n return;\n }\n this.stack.forEach((overlayEl) => {\n if (overlayEl.type === 'hint') {\n this.closeOverlay(overlayEl);\n }\n });\n }\n requestAnimationFrame(() => {\n this.stack.push(overlay);\n overlay.addEventListener('beforetoggle', this.handleBeforetoggle, {\n once: true,\n });\n this.manageBodyScroll();\n });\n }\n\n remove(overlay: Overlay): void {\n this.closeOverlay(overlay);\n }\n}\n\nexport const overlayStack = new OverlayStack();\n", "/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nconst yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);\nfunction getSideAxis(placement) {\n return yAxisSides.has(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n", "function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nconst invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);\n}\nconst tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);\nfunction isTableElement(element) {\n return tableElements.has(getNodeName(element));\n}\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (_e) {\n return false;\n }\n });\n}\nconst transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];\nconst willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];\nconst containValues = ['paint', 'layout', 'strict', 'content'];\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nconst lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);\nfunction isLastTraversableNode(node) {\n return lastTraversableNodeNames.has(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n", "import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nconst absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n Placement,\n shift,\n size,\n} from '@floating-ui/dom';\n\nimport type {\n ReactiveController,\n ReactiveElement,\n} from '@spectrum-web-components/base';\nimport { isWebKit } from '@spectrum-web-components/shared';\n\nimport type { Overlay } from './Overlay.js';\nimport type { OpenableElement } from './overlay-types.js';\nimport type { VirtualTrigger } from './VirtualTrigger.js';\n\ntype OverlayOptionsV1 = {\n abortPromise?: Promise<boolean>;\n delayed?: boolean;\n offset?: number | [number, number]; // supporting multi-axis\n placement: Placement;\n notImmediatelyClosable?: boolean; // rename or place behind other API options\n receivesFocus?: 'auto';\n root?: HTMLElement;\n tipPadding?: number;\n trigger: HTMLElement | VirtualTrigger;\n type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';\n};\n\n/**\n * Rounds a number by the device pixel ratio (DPR).\n *\n * @param {number} [num] - The number to round.\n * @returns {number} The rounded number.\n */\nfunction roundByDPR(num?: number): number {\n if (typeof num === 'undefined') {\n return 0;\n }\n const dpr = window.devicePixelRatio || 1;\n return Math.round(num * dpr) / dpr;\n}\n\n// Minimum distance required between the overlay and the edge of the container.\n// See: https://spectrum.adobe.com/page/popover/#Container-padding\nconst REQUIRED_DISTANCE_TO_EDGE = 8;\n// Minimum height for the overlay.\n// See: https://github.com/adobe/spectrum-web-components/issues/910\nconst MIN_OVERLAY_HEIGHT = 100;\n\n/**\n * Gets fallback placements for the overlay based on the initial placement.\n *\n * @param {Placement} placement - The initial placement of the overlay.\n * @returns {Placement[]} An array of fallback placements.\n */\nconst getFallbackPlacements = (placement: Placement): Placement[] => {\n const fallbacks: Record<Placement, Placement[]> = {\n left: ['right', 'bottom', 'top'],\n 'left-start': ['right-start', 'bottom', 'top'],\n 'left-end': ['right-end', 'bottom', 'top'],\n right: ['left', 'bottom', 'top'],\n 'right-start': ['left-start', 'bottom', 'top'],\n 'right-end': ['left-end', 'bottom', 'top'],\n top: ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left', 'right'],\n 'top-end': ['bottom-end', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left', 'right'],\n 'bottom-end': ['top-end', 'left', 'right'],\n };\n return fallbacks[placement] ?? [placement];\n};\n\n/**\n * Symbol used to indicate that the placement has been updated.\n */\nexport const placementUpdatedSymbol = Symbol('placement updated');\n\n/**\n * Controller for managing the placement of an overlay.\n *\n * This class implements the ReactiveController interface and provides methods\n * for managing the positioning and constraints of an overlay element.\n */\nexport class PlacementController implements ReactiveController {\n /**\n * Function to clean up resources when the controller is no longer needed.\n *\n * @private\n */\n private cleanup?: () => void;\n\n /**\n * Initial height of the overlay.\n *\n * @type {number}\n */\n initialHeight?: number;\n\n /**\n * Indicates whether the overlay is constrained by available space.\n *\n * @type {boolean}\n */\n isConstrained?: boolean;\n\n /**\n * The host element that uses this controller.\n *\n * @private\n * @type {ReactiveElement & { elements: OpenableElement[] }}\n */\n private host!: ReactiveElement & { elements: OpenableElement[] };\n\n /**\n * Options for configuring the overlay placement.\n *\n * @private\n * @type {OverlayOptionsV1}\n */\n private options!: OverlayOptionsV1;\n\n /**\n * A WeakMap to store the original placements of overlay elements.\n *\n * @private\n * @type {WeakMap<HTMLElement, Placement>}\n */\n private originalPlacements = new WeakMap<HTMLElement, Placement>();\n\n /**\n * The target element for the overlay.\n *\n * @private\n * @type {HTMLElement}\n */\n private target!: HTMLElement;\n\n /**\n * Incremented whenever the active placement session ends (`cleanup`) or a\n * new session begins, so async `computePlacement` runs that started under an\n * older session do not write styles after teardown or across stacked\n * `placeOverlay` calls.\n *\n * @private\n */\n private placementGeneration = 0;\n\n /**\n * Creates an instance of the PlacementController.\n *\n * @param {ReactiveElement & { elements: OpenableElement[] }} host - The host element that uses this controller.\n */\n constructor(host: ReactiveElement & { elements: OpenableElement[] }) {\n this.host = host;\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n /**\n * Places the overlay relative to the target element.\n *\n * This method sets up the necessary configurations and event listeners to manage the\n * positioning and constraints of the overlay element.\n *\n * @param {HTMLElement} [target=this.target] - The target element for the overlay.\n * @param {OverlayOptionsV1} [options=this.options] - The options for configuring the overlay placement.\n * @returns {Promise<void>} A promise that resolves when the overlay has been placed.\n */\n public async placeOverlay(\n target: HTMLElement = this.target,\n options: OverlayOptionsV1 = this.options\n ): Promise<void> {\n // If `placeOverlay` runs twice before `hostUpdated` clears the prior\n // session (rapid open, programmatic toggles), tear down the previous\n // listeners first so `visualViewport` handlers and pending rAFs cannot\n // leak.\n this.cleanup?.();\n this.cleanup = undefined;\n\n // Set the target and options for the overlay.\n this.target = target;\n this.options = options;\n if (!target || !options) {\n return;\n }\n\n // Set up auto-update for ancestor resize events.\n const cleanupAncestorResize = autoUpdate(\n options.trigger,\n target,\n this.closeForAncestorUpdate,\n {\n ancestorResize: false,\n elementResize: false,\n layoutShift: false,\n }\n );\n\n // Set up auto-update for element resize events.\n const cleanupElementResize = autoUpdate(\n options.trigger,\n target,\n this.updatePlacement,\n {\n ancestorScroll: false,\n }\n );\n\n // Recompute placement when the visual viewport diverges from the layout\n // viewport (URL bar showing/hiding, pinch-zoom, virtual keyboard, host-app\n // bottom sheets, etc.). Floating UI's `autoUpdate` does not observe\n // `window.visualViewport`, so without this an open overlay can drift away\n // from its trigger on WebKit (iOS Safari, WKWebView, and desktop Safari\n // when pinch-zoomed) until the next resize. See `computePlacement` for the\n // corresponding offset compensation.\n //\n // Listeners are passive (we never `preventDefault` in `updatePlacement`)\n // and rAF-coalesced so a burst of `resize`/`scroll` events during a URL\n // bar collapse or pinch gesture compresses to one Floating UI compute per\n // frame.\n const visualViewport = window.visualViewport;\n let visualViewportRafId = 0;\n let visualViewportPlacementCancelled = false;\n const onVisualViewportChange = (): void => {\n if (visualViewportPlacementCancelled || visualViewportRafId) {\n return;\n }\n visualViewportRafId = requestAnimationFrame(() => {\n visualViewportRafId = 0;\n if (visualViewportPlacementCancelled) {\n return;\n }\n this.updatePlacement();\n });\n };\n if (visualViewport && isWebKit()) {\n visualViewport.addEventListener('resize', onVisualViewportChange, {\n passive: true,\n });\n visualViewport.addEventListener('scroll', onVisualViewportChange, {\n passive: true,\n });\n }\n\n // Define the cleanup function to remove event listeners and reset placements.\n this.cleanup = () => {\n this.placementGeneration += 1;\n // Invalidate any `visualViewport` rAF callback scheduled before this\n // cleanup runs, so `updatePlacement` cannot start after teardown.\n visualViewportPlacementCancelled = true;\n this.host.elements?.forEach((element) => {\n element.addEventListener(\n 'sp-closed',\n () => {\n const placement = this.originalPlacements.get(element);\n\n if (placement) {\n element.setAttribute('placement', placement);\n }\n\n this.originalPlacements.delete(element);\n },\n { once: true }\n );\n });\n cleanupAncestorResize();\n cleanupElementResize();\n if (visualViewport && isWebKit()) {\n visualViewport.removeEventListener('resize', onVisualViewportChange);\n visualViewport.removeEventListener('scroll', onVisualViewportChange);\n if (visualViewportRafId) {\n cancelAnimationFrame(visualViewportRafId);\n visualViewportRafId = 0;\n }\n }\n };\n }\n\n /**\n * Flag to allow or disallow placement updates.\n *\n * @type {boolean}\n */\n public allowPlacementUpdate = false;\n\n /**\n * Closes the overlay if an ancestor element is updated.\n *\n * This method checks if placement updates are allowed and if the overlay type is not 'modal'.\n * If these conditions are met and a cleanup function is defined, it dispatches a 'close' event\n * on the target element to close the overlay.\n */\n closeForAncestorUpdate = (): void => {\n if (\n !this.allowPlacementUpdate &&\n this.options.type !== 'modal' &&\n this.cleanup\n ) {\n // Dispatch a 'close' event to close the overlay.\n this.target.dispatchEvent(new Event('close', { bubbles: true }));\n }\n\n // Reset the flag to disallow placement updates.\n this.allowPlacementUpdate = false;\n };\n\n /**\n * Updates the placement of the overlay.\n *\n * This method calls the computePlacement method to recalculate the overlay's position.\n *\n * @private\n */\n private updatePlacement = (): void => {\n this.computePlacement();\n };\n\n /**\n * Computes the placement of the overlay relative to the target element.\n *\n * This method calculates the necessary positioning and constraints for the overlay element\n * using various middleware functions. It updates the overlay's style and attributes based\n * on the computed position.\n *\n * @returns {Promise<void>} A promise that resolves when the placement has been computed.\n */\n async computePlacement(): Promise<void> {\n const { options, target } = this;\n\n const genAtStart = this.placementGeneration;\n const placementStillValid = (): boolean =>\n (this.host as Overlay).open &&\n this.placementGeneration === genAtStart &&\n !!this.target &&\n this.target === target;\n\n // Wait for document fonts to be ready before computing placement.\n await (document.fonts ? document.fonts.ready : Promise.resolve());\n if (!placementStillValid()) {\n return;\n }\n\n if (isWebKit()) {\n // Computing placement requires a frame for layout stability in WebKit\n await new Promise((resolve) => requestAnimationFrame(resolve));\n }\n if (!placementStillValid()) {\n return;\n }\n\n // Determine the flip middleware based on the type of trigger element.\n const flipMiddleware = !(options.trigger instanceof HTMLElement)\n ? flip({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n fallbackPlacements: getFallbackPlacements(options.placement),\n })\n : flip();\n\n // Extract main axis and cross axis offsets from options.\n const [mainAxis = 0, crossAxis = 0] = Array.isArray(options?.offset)\n ? options.offset\n : [options.offset, 0];\n\n // Find the tip element within the host elements.\n const tipElement = this.host.elements.find(\n (el) => el.tipElement\n )?.tipElement;\n\n // Define middleware functions for positioning and constraints.\n const middleware = [\n offset({\n mainAxis,\n crossAxis,\n }),\n shift({ padding: REQUIRED_DISTANCE_TO_EDGE }),\n flipMiddleware,\n size({\n padding: REQUIRED_DISTANCE_TO_EDGE,\n apply: ({ availableWidth, availableHeight, rects: { floating } }) => {\n const maxHeight = Math.max(\n MIN_OVERLAY_HEIGHT,\n Math.floor(availableHeight)\n );\n const actualHeight = floating.height;\n this.initialHeight = !this.isConstrained // && !this.virtualTrigger\n ? actualHeight\n : this.initialHeight || actualHeight;\n this.isConstrained =\n actualHeight < this.initialHeight || maxHeight <= actualHeight;\n const appliedHeight = this.isConstrained ? `${maxHeight}px` : '';\n Object.assign(target.style, {\n maxWidth: `${Math.floor(availableWidth)}px`,\n maxHeight: appliedHeight,\n });\n },\n }),\n ...(tipElement\n ? [\n arrow({\n element: tipElement,\n padding: options.tipPadding || REQUIRED_DISTANCE_TO_EDGE,\n }),\n ]\n : []),\n ];\n\n // Compute the position of the overlay using the defined middleware.\n const { x, y, placement, middlewareData } = await computePosition(\n options.trigger,\n target,\n {\n placement: options.placement,\n middleware,\n strategy: 'fixed',\n }\n );\n if (!placementStillValid()) {\n return;\n }\n\n // On iOS WebKit (Safari and WKWebView hosts such as the Adobe Express\n // iOS app) the layout viewport and the visual viewport can diverge by\n // tens of pixels \u2014 for example when the URL bar is showing, when the\n // page is pinch-zoomed, when the virtual keyboard is open, or when a\n // native bottom sheet is overlaid. Floating UI computes `(x, y)` from\n // `getBoundingClientRect()`, which is in layout-viewport coordinates,\n // but the overlay is rendered in the top layer via the native popover\n // API and therefore painted relative to the visual viewport. Without\n // this compensation the overlay lands `visualViewport.offsetTop` px\n // below (and `offsetLeft` px to the side of) its trigger on iOS while\n // appearing correct on every other browser.\n let translateX = x;\n let translateY = y;\n const visualViewport = window.visualViewport;\n if (visualViewport && isWebKit()) {\n translateX -= visualViewport.offsetLeft;\n translateY -= visualViewport.offsetTop;\n }\n\n // Update the overlay's style with the computed position.\n if (!placementStillValid()) {\n return;\n }\n Object.assign(target.style, {\n top: '0px',\n left: '0px',\n translate: `${roundByDPR(translateX)}px ${roundByDPR(translateY)}px`,\n });\n\n // Set the 'actual-placement' attribute on the target element.\n target.setAttribute('actual-placement', placement);\n\n // Update the placement attribute for each host element.\n this.host.elements?.forEach((element) => {\n if (!this.originalPlacements.has(element)) {\n this.originalPlacements.set(\n element,\n element.getAttribute('placement') as Placement\n );\n }\n element.setAttribute('placement', placement);\n });\n\n // Update the tip element's style with the computed arrow position.\n if (!placementStillValid()) {\n return;\n }\n if (tipElement && middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(tipElement.style, {\n top:\n placement.startsWith('right') || placement.startsWith('left')\n ? '0px'\n : '',\n left:\n placement.startsWith('bottom') || placement.startsWith('top')\n ? '0px'\n : '',\n translate: `${roundByDPR(arrowX)}px ${roundByDPR(arrowY)}px`,\n });\n }\n }\n\n /**\n * Clears the overlay's position styles.\n *\n * This method removes the max-height and max-width styles from the target element,\n * and resets the initial height and constrained state of the overlay.\n */\n public clearOverlayPosition(): void {\n if (!this.target) {\n return;\n }\n // Remove max-height and max-width styles from the target element.\n this.target.style.removeProperty('max-height');\n this.target.style.removeProperty('max-width');\n // Reset the initial height and constrained state.\n this.initialHeight = undefined;\n this.isConstrained = false;\n }\n\n /**\n * Resets the overlay's position.\n *\n * This method clears the overlay's position, forces a reflow, and recomputes the placement.\n */\n public resetOverlayPosition = (): void => {\n if (!this.target || !this.options) {\n return;\n }\n // Clear the overlay's position.\n this.clearOverlayPosition();\n\n // Force a reflow.\n /** @todo investigate why this is needed and if there is a better way to do this or remove it entirely */\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this.host.offsetHeight;\n // Recompute the placement.\n this.computePlacement();\n };\n\n /**\n * Lifecycle method called when the host element is connected to the DOM.\n *\n * This method sets up an event listener to reset the overlay's position when the 'sp-update-overlays' event is dispatched.\n */\n hostConnected(): void {\n document.addEventListener('sp-update-overlays', this.resetOverlayPosition);\n }\n\n /**\n * Lifecycle method called when the host element is updated.\n *\n * This method cleans up resources if the overlay is not open.\n */\n hostUpdated(): void {\n if (!(this.host as Overlay).open) {\n // Clean up resources if the overlay is not open.\n this.cleanup?.();\n this.cleanup = undefined;\n }\n }\n\n /**\n * Lifecycle method called when the host element is disconnected from the DOM.\n *\n * This method removes the event listener and cleans up resources.\n */\n hostDisconnected(): void {\n // Clean up resources.\n this.cleanup?.();\n this.cleanup = undefined;\n // Remove the event listener.\n document.removeEventListener(\n 'sp-update-overlays',\n this.resetOverlayPosition\n );\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController } from '@spectrum-web-components/base';\n\nimport { AbstractOverlay } from './AbstractOverlay.js';\n\nexport enum InteractionTypes {\n click = 'click',\n hover = 'hover',\n longpress = 'longpress',\n}\n\nexport const lastInteractionType = Symbol('lastInteractionType');\n\nexport type ControllerOptions = {\n overlay?: AbstractOverlay;\n handleOverlayReady?: (overlay: AbstractOverlay) => void;\n isPersistent?: boolean;\n};\n\ntype InteractionTarget = HTMLElement & {\n [lastInteractionType]?: InteractionTypes;\n};\n\nexport class InteractionController implements ReactiveController {\n abortController!: AbortController;\n\n get activelyOpening(): boolean {\n return false;\n }\n\n private handleOverlayReady?: (overlay: AbstractOverlay) => void;\n\n // Holds optimistic open state when an Overlay is not yet present\n private isLazilyOpen = false;\n\n public get open(): boolean {\n return this.overlay?.open ?? this.isLazilyOpen;\n }\n\n /**\n * Set `open` against the associated Overlay lazily.\n */\n public set open(open: boolean) {\n if (open === this.open) {\n return;\n }\n this.isLazilyOpen = open;\n if (this.overlay) {\n // If there already is an Overlay, apply the value of `open` directly.\n this.overlay.open = open;\n this.target[lastInteractionType] = this.type;\n return;\n }\n if (!open) {\n // When `open` moves to `false` and there is not yet an Overlay,\n // assume that no Overlay and a closed Overlay are the same and return early.\n return;\n }\n // When there is no Overlay and `open` is moving to `true`, lazily import/create\n // an Overlay and apply that state to it.\n customElements.whenDefined('sp-overlay').then(async (): Promise<void> => {\n const { Overlay } = await import('./Overlay.js');\n this.overlay = new Overlay();\n this.overlay.open = true;\n this.target[lastInteractionType] = this.type;\n });\n\n /* eslint-disable import/no-extraneous-dependencies */\n import('@spectrum-web-components/overlay/sp-overlay.js');\n }\n\n public get overlay(): AbstractOverlay | undefined {\n return this._overlay;\n }\n\n public set overlay(overlay: AbstractOverlay | undefined) {\n if (!overlay) {\n return;\n }\n if (this._overlay === overlay) {\n return;\n }\n if (this._overlay) {\n this._overlay.removeController(this);\n }\n this._overlay = overlay;\n overlay.addController(this);\n this.initOverlay();\n this.prepareDescription(this.target);\n this.handleOverlayReady?.(overlay);\n }\n\n private _overlay?: AbstractOverlay;\n\n /**\n * Clears the overlay reference and properly cleans up the controller registration.\n * This is useful when the overlay needs to be recreated, such as when using\n * Lit's cache() directive with overlay triggers.\n */\n public clearOverlay(): void {\n if (this._overlay) {\n this._overlay.removeController(this);\n }\n this._overlay = undefined;\n }\n\n protected isPersistent = false;\n\n type!: InteractionTypes;\n\n constructor(\n public target: InteractionTarget,\n { overlay, isPersistent, handleOverlayReady }: ControllerOptions\n ) {\n this.isPersistent = !!isPersistent;\n this.handleOverlayReady = handleOverlayReady;\n if (this.isPersistent) {\n this.init();\n }\n this.overlay = overlay;\n }\n\n prepareDescription(_: HTMLElement): void {}\n\n releaseDescription(): void {}\n\n shouldCompleteOpen(): void {}\n\n /* c8 ignore next 3 */\n init(): void {\n // Abstract init() method.\n }\n\n /* c8 ignore next 3 */\n initOverlay(): void {\n // Abstract initOverlay() method.\n }\n\n abort(): void {\n this.releaseDescription();\n this.abortController?.abort();\n }\n\n hostConnected(): void {\n this.init();\n }\n\n hostDisconnected(): void {\n if (!this.isPersistent) {\n this.abort();\n }\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.js';\nimport {\n isAndroid,\n isIOS,\n} from '@spectrum-web-components/shared/src/platform.js';\nimport { randomID } from '@spectrum-web-components/shared/src/random-id.js';\n\nimport { noop } from './AbstractOverlay.js';\nimport {\n InteractionController,\n InteractionTypes,\n} from './InteractionController.js';\nimport type { Overlay } from './Overlay.js';\n\nconst LONGPRESS_DURATION = 300;\nexport const LONGPRESS_INSTRUCTIONS = {\n touch: 'Double tap and long press for additional options',\n keyboard: 'Press Space or Alt+Down Arrow for additional options',\n mouse: 'Click and hold for additional options',\n};\n\ntype LongpressEvent = {\n source: 'pointer' | 'keyboard';\n};\n\nexport class LongpressController extends InteractionController {\n override type = InteractionTypes.longpress;\n\n override get activelyOpening(): boolean {\n return (\n this.longpressState === 'opening' || this.longpressState === 'pressed'\n );\n }\n\n protected longpressState: null | 'potential' | 'opening' | 'pressed' = null;\n\n override releaseDescription = noop;\n\n private timeout!: ReturnType<typeof setTimeout>;\n\n handleLongpress(): void {\n this.open = true;\n this.longpressState =\n this.longpressState === 'potential' ? 'opening' : 'pressed';\n }\n\n handlePointerdown(event: PointerEvent): void {\n if (!this.target) {\n return;\n }\n if (event.button !== 0) {\n return;\n }\n this.longpressState = 'potential';\n document.addEventListener('pointerup', this.handlePointerup);\n document.addEventListener('pointercancel', this.handlePointerup);\n // Only dispatch longpress event if the trigger element isn't doing it for us.\n const triggerHandlesLongpress = 'holdAffordance' in this.target;\n if (triggerHandlesLongpress) {\n return;\n }\n this.timeout = setTimeout(() => {\n if (!this.target) {\n return;\n }\n this.target.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'pointer',\n },\n })\n );\n }, LONGPRESS_DURATION);\n }\n\n private handlePointerup = (): void => {\n clearTimeout(this.timeout);\n if (!this.target) {\n return;\n }\n // When triggered by the pointer, the last of `opened`\n // or `pointerup` should move the `longpressState` to\n // `null` so that the earlier event can void the \"light\n // dismiss\" and keep the Overlay open.\n this.longpressState = this.overlay?.state === 'opening' ? 'pressed' : null;\n document.removeEventListener('pointerup', this.handlePointerup);\n document.removeEventListener('pointercancel', this.handlePointerup);\n };\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code, altKey } = event;\n if (altKey && code === 'ArrowDown') {\n event.stopImmediatePropagation();\n }\n }\n\n private handleKeyup(event: KeyboardEvent): void {\n const { code, altKey } = event;\n if (code === 'Space' || (altKey && code === 'ArrowDown')) {\n if (!this.target) {\n return;\n }\n event.stopPropagation();\n this.target.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'keyboard',\n },\n })\n );\n setTimeout(() => {\n this.longpressState = null;\n });\n }\n }\n\n override prepareDescription(trigger: HTMLElement): void {\n if (\n // do not reapply until target is recycled\n this.releaseDescription !== noop ||\n // require \"longpress content\" to apply relationship\n !this.overlay ||\n !this.overlay.elements.length\n ) {\n return;\n }\n // When describeTrigger is 'none', do not set aria-describedby on the trigger (visual hint only).\n const overlay = this.overlay as Overlay;\n if (overlay.describeTrigger === 'none') {\n return;\n }\n\n const longpressDescription = document.createElement('div');\n longpressDescription.id = `longpress-describedby-descriptor-${randomID()}`;\n const messageType = isIOS() || isAndroid() ? 'touch' : 'keyboard';\n longpressDescription.textContent = LONGPRESS_INSTRUCTIONS[messageType];\n longpressDescription.slot = 'longpress-describedby-descriptor';\n const triggerParent = trigger.getRootNode() as HTMLElement;\n const overlayParent = this.overlay.getRootNode() as HTMLElement;\n // Manage the placement of the helper element in an accessible place with\n // the lowest chance of negatively affecting the layout of the page.\n if (triggerParent === overlayParent) {\n // Trigger and Overlay in same DOM tree...\n // Append helper element to Overlay.\n this.overlay.append(longpressDescription);\n } else {\n // If Trigger in <body>, hide helper\n longpressDescription.hidden = !('host' in triggerParent);\n // Trigger and Overlay in different DOM tree, Trigger in shadow tree...\n // Insert helper element after Trigger.\n trigger.insertAdjacentElement('afterend', longpressDescription);\n }\n\n const releaseDescription = conditionAttributeWithId(\n trigger,\n 'aria-describedby',\n [longpressDescription.id]\n );\n this.releaseDescription = () => {\n releaseDescription();\n longpressDescription.remove();\n this.releaseDescription = noop;\n };\n }\n\n override shouldCompleteOpen(): void {\n // When triggered by the pointer, the last of `opened`\n // or `pointerup` should move the `longpressState` to\n // `null` so that the earlier event can void the \"light\n // dismiss\" and keep the Overlay open.\n this.longpressState =\n this.longpressState === 'pressed' ? null : this.longpressState;\n }\n\n override init(): void {\n // Clean up listeners if they've already been bound\n this.abortController?.abort();\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.target.addEventListener('longpress', () => this.handleLongpress(), {\n signal,\n });\n this.target.addEventListener(\n 'pointerdown',\n (event: PointerEvent) => this.handlePointerdown(event),\n { signal }\n );\n\n this.prepareDescription(this.target);\n if (\n (this.target as HTMLElement & { holdAffordance: boolean }).holdAffordance\n ) {\n // Only bind keyboard events when the trigger element isn't doing it for us.\n return;\n }\n this.target.addEventListener(\n 'keydown',\n (event: KeyboardEvent) => this.handleKeydown(event),\n { signal }\n );\n this.target.addEventListener(\n 'keyup',\n (event: KeyboardEvent) => this.handleKeyup(event),\n { signal }\n );\n }\n}\n", "import { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:\"\";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}.modal-backdrop{z-index:999998;pointer-events:auto;background:0 0;position:fixed;inset:0}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}\n`;\nexport default styles;", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n InteractionController,\n InteractionTypes,\n} from './InteractionController.js';\n\nexport class ClickController extends InteractionController {\n override type = InteractionTypes.click;\n\n /**\n * An overlay with a `click` interaction should not close on click `triggerElement`.\n * When a click is initiated (`pointerdown`), apply `preventNextToggle` when the\n * overlay is `open` to prevent from toggling the overlay when the click event\n * propagates later in the interaction.\n */\n private preventNextToggle = false;\n\n handleClick(): void {\n if (!this.preventNextToggle) {\n this.open = !this.open;\n }\n this.preventNextToggle = false;\n }\n\n handlePointerdown(): void {\n this.preventNextToggle = this.open;\n }\n\n override init(): void {\n // Clean up listeners if they've already been bound\n this.abortController?.abort();\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.target.addEventListener('click', () => this.handleClick(), {\n signal,\n });\n this.target.addEventListener(\n 'pointerdown',\n () => this.handlePointerdown(),\n { signal }\n );\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.js';\nimport { randomID } from '@spectrum-web-components/shared/src/random-id.js';\n\nimport { noop } from './AbstractOverlay.js';\nimport {\n InteractionController,\n InteractionTypes,\n lastInteractionType,\n} from './InteractionController.js';\nimport type { Overlay } from './Overlay.js';\n\nexport class HoverController extends InteractionController {\n override type = InteractionTypes.hover;\n\n private elementIds: string[] = [];\n\n private targetFocused = false;\n\n private hoverTimeout?: ReturnType<typeof setTimeout>;\n\n private hovering = false;\n\n private overlayFocused = false;\n\n handleKeyup(event: KeyboardEvent): void {\n if (event.code === 'Tab') {\n this.open = true;\n } else if (event.code === 'Escape') {\n if (this.open) {\n event.preventDefault();\n event.stopPropagation();\n this.open = false;\n // Return focus to trigger element\n if (this.target) {\n this.target.focus();\n }\n }\n }\n }\n\n handleTargetFocusin(): void {\n if (!this.target.matches(':focus-visible')) {\n return;\n }\n\n // Don't open hover overlay if the last interaction was a click.\n // This prevents hover from opening when focus returns to trigger\n // after closing a modal overlay via Escape key.\n // Previously this check was WebKit-only, but Chromium also needs it\n // because it reports :focus-visible=true for programmatic focus after keyboard events.\n if (this.target[lastInteractionType] === InteractionTypes.click) {\n return;\n }\n\n this.open = true;\n this.targetFocused = true;\n }\n\n handleTargetFocusout(): void {\n this.targetFocused = false;\n // Don't close immediately if pointer is over the content\n if (this.hovering) {\n return;\n }\n // Use delay to allow focus to move into overlay content\n this.doFocusleave();\n }\n\n private clearCloseTimeout(): void {\n if (this.hoverTimeout) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = undefined;\n }\n }\n\n handleTargetPointerenter(): void {\n this.clearCloseTimeout();\n if (this.overlay?.disabled) {\n return;\n }\n this.open = true;\n this.hovering = true;\n }\n\n handleTargetPointerleave(): void {\n this.doPointerleave();\n }\n\n // set a timeout once the pointer enters and the overlay is shown\n // give the user time to enter the overlay\n handleHostPointerenter(): void {\n this.clearCloseTimeout();\n }\n\n handleHostPointerleave(): void {\n this.doPointerleave();\n }\n\n handleOverlayFocusin(): void {\n this.overlayFocused = true;\n // Clear any pending close timeout when focus enters overlay\n this.clearCloseTimeout();\n }\n\n handleOverlayFocusout(): void {\n this.overlayFocused = false;\n // Don't close immediately if pointer is over the content or trigger has focus\n if (this.hovering) {\n return;\n }\n if (this.targetFocused && this.target.matches(':focus-visible')) {\n return;\n }\n // Use delay before closing\n this.doFocusleave();\n }\n\n override prepareDescription(): void {\n // require \"content\" to apply relationship\n if (!this.overlay || !this.overlay.elements.length) {\n return;\n }\n // When describeTrigger is 'none', do not set aria-describedby on the trigger (visual hint only).\n const overlay = this.overlay as Overlay;\n if (overlay.describeTrigger === 'none') {\n return;\n }\n\n const triggerRoot = this.target.getRootNode();\n const contentRoot = this.overlay.elements[0].getRootNode();\n const overlayRoot = this.overlay.getRootNode();\n if (triggerRoot === overlayRoot) {\n this.prepareOverlayRelativeDescription();\n } else if (triggerRoot === contentRoot) {\n this.prepareContentRelativeDescription();\n }\n }\n\n private prepareOverlayRelativeDescription(): void {\n if (!this.overlay) {\n return;\n }\n const releaseDescription = conditionAttributeWithId(\n this.target,\n 'aria-describedby',\n [this.overlay.id]\n );\n this.releaseDescription = () => {\n releaseDescription();\n this.releaseDescription = noop;\n };\n }\n\n private prepareContentRelativeDescription(): void {\n if (!this.overlay) {\n return;\n }\n const overlay = this.overlay; // Capture for closure\n const elementIds: string[] = [];\n const appliedIds = overlay.elements.map((el) => {\n elementIds.push(el.id);\n if (!el.id) {\n el.id = `${overlay.tagName.toLowerCase()}-helper-${randomID()}`;\n }\n return el.id;\n });\n this.elementIds = elementIds;\n const releaseDescription = conditionAttributeWithId(\n this.target,\n 'aria-describedby',\n appliedIds\n );\n this.releaseDescription = () => {\n releaseDescription();\n overlay.elements.map((el, index) => {\n el.id = this.elementIds[index];\n });\n this.releaseDescription = noop;\n };\n }\n\n private scheduleClose(): void {\n this.hoverTimeout = setTimeout(() => {\n this.open = false;\n }, 300);\n }\n\n private doPointerleave(): void {\n this.hovering = false;\n const triggerElement = this.target as HTMLElement;\n if (this.targetFocused && triggerElement.matches(':focus-visible')) {\n return;\n }\n // Don't close if focus is within overlay content\n if (this.overlayFocused) {\n return;\n }\n\n this.scheduleClose();\n }\n\n private doFocusleave(): void {\n // Clear any existing timeout\n this.clearCloseTimeout();\n\n // Use same delay as pointer interactions for consistency\n if (!this.targetFocused && !this.overlayFocused && !this.hovering) {\n this.scheduleClose();\n }\n }\n\n override init(): void {\n // Clean up listeners if they've already been bound\n this.abortController?.abort();\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.target.addEventListener('keyup', (event) => this.handleKeyup(event), {\n signal,\n });\n this.target.addEventListener('focusin', () => this.handleTargetFocusin(), {\n signal,\n });\n this.target.addEventListener(\n 'focusout',\n () => this.handleTargetFocusout(),\n { signal }\n );\n this.target.addEventListener(\n 'pointerenter',\n () => this.handleTargetPointerenter(),\n { signal }\n );\n this.target.addEventListener(\n 'pointerleave',\n () => this.handleTargetPointerleave(),\n { signal }\n );\n if (this.overlay) {\n this.initOverlay();\n }\n }\n\n override initOverlay(): void {\n if (!this.abortController || !this.overlay) {\n return;\n }\n const { signal } = this.abortController;\n this.overlay.addEventListener(\n 'pointerenter',\n () => this.handleHostPointerenter(),\n { signal }\n );\n this.overlay.addEventListener(\n 'pointerleave',\n () => this.handleHostPointerleave(),\n { signal }\n );\n this.overlay.addEventListener(\n 'focusin',\n () => this.handleOverlayFocusin(),\n { signal }\n );\n this.overlay.addEventListener(\n 'focusout',\n () => this.handleOverlayFocusout(),\n { signal }\n );\n this.overlay.addEventListener('keyup', (event) => this.handleKeyup(event), {\n signal,\n });\n }\n}\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { ClickController } from './ClickController.js';\nimport { HoverController } from './HoverController.js';\nimport { LongpressController } from './LongpressController.js';\n\nexport const strategies = {\n click: ClickController,\n longpress: LongpressController,\n hover: HoverController,\n};\n", "/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n html,\n nothing,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport {\n ifDefined,\n StyleInfo,\n styleMap,\n} from '@spectrum-web-components/base/src/directives.js';\nimport {\n ElementResolutionController,\n elementResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/ElementResolution.js';\nimport { randomID } from '@spectrum-web-components/shared/src/random-id.js';\n\nimport { AbstractOverlay, nextFrame } from './AbstractOverlay.js';\nimport type { ClickController } from './ClickController.js';\nimport type { HoverController } from './HoverController.js';\nimport type { LongpressController } from './LongpressController.js';\nimport type {\n OpenableElement,\n OverlayState,\n OverlayTypes,\n Placement,\n TriggerInteraction,\n} from './overlay-types.js';\nimport { OverlayNoPopover } from './OverlayNoPopover.js';\nimport { OverlayPopover } from './OverlayPopover.js';\nimport { overlayStack } from './OverlayStack.js';\nimport { PlacementController } from './PlacementController.js';\nimport { VirtualTrigger } from './VirtualTrigger.js';\nexport { LONGPRESS_INSTRUCTIONS } from './LongpressController.js';\nimport { FocusTrap } from 'focus-trap';\n\nimport styles from './overlay.css.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from './slottable-request-event.js';\nimport { strategies } from './strategies.js';\n\nconst browserSupportsPopover = 'showPopover' in document.createElement('div');\n\n// Start the base class and add the popover or no-popover functionality\nlet ComputedOverlayBase = OverlayPopover(AbstractOverlay);\nif (!browserSupportsPopover) {\n ComputedOverlayBase = OverlayNoPopover(AbstractOverlay);\n}\n\n/**\n * @element sp-overlay\n *\n * @slot default - The content that will be displayed in the overlay\n *\n * @fires sp-opened - announces that an overlay has completed any entry animations\n * @fires sp-closed - announce that an overlay has completed any exit animations\n * @fires slottable-request - requests to add or remove slottable content\n *\n * @attr {string} placement - The placement of the overlay relative to the trigger\n * @attr {number} offset - The distance between the overlay and the trigger\n * @attr {boolean} disabled - Whether the overlay trigger is disabled\n * @attr {string} receives-focus - How focus should be handled ('true'|'false'|'auto')\n * @attr {boolean} delayed - Whether the overlay should wait for a warm-up period before opening\n * @attr {boolean} open - Whether the overlay is currently open\n * @attr {boolean} allow-outside-click - DEPRECATED: Whether clicks outside the overlay should close it (not recommended for accessibility)\n */\nexport class Overlay extends ComputedOverlayBase {\n static override styles = [styles];\n\n /**\n * An Overlay that is `delayed` will wait until a warm-up period of 1000ms\n * has completed before opening. Once the warm-up period has completed, all\n * subsequent Overlays will open immediately. When no Overlays are opened,\n * a cool-down period of 1000ms will begin. Once the cool-down has completed,\n * the next Overlay to be opened will be subject to the warm-up period if\n * provided that option.\n *\n * This behavior helps to manage the performance and user experience by\n * preventing multiple overlays from opening simultaneously and ensuring\n * a smooth transition between opening and closing overlays.\n *\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n override get delayed(): boolean {\n const lastElement = this.elements[this.elements.length - 1];\n return lastElement?.hasAttribute('delayed') || this._delayed;\n }\n\n override set delayed(delayed: boolean) {\n this._delayed = delayed;\n }\n\n private _delayed = false;\n\n /**\n * A reference to the dialog element within the overlay.\n * This element is expected to have `showPopover` and `hidePopover` methods.\n */\n @query('.dialog')\n override dialogEl!: HTMLDialogElement & {\n showPopover(): void;\n hidePopover(): void;\n };\n\n /**\n * Indicates whether the overlay is currently functional or not.\n *\n * When set to `true`, the overlay is disabled, and any active strategy is aborted.\n * The overlay will also close if it is currently open. When set to `false`, the\n * overlay will re-bind events and re-open if it was previously open.\n *\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n override get disabled(): boolean {\n return this._disabled;\n }\n\n override set disabled(disabled: boolean) {\n this._disabled = disabled;\n if (disabled) {\n // Abort any active strategy and close the overlay if it is currently open\n this.strategy?.abort();\n this.wasOpen = this.open;\n this.open = false;\n } else {\n // Re-bind events and re-open the overlay if it was previously open\n this.bindEvents();\n this.open = this.open || this.wasOpen;\n this.wasOpen = false;\n }\n }\n\n private _disabled = false;\n\n /**\n * A query to gather all elements slotted into the default slot, excluding elements\n * with the slot name \"longpress-describedby-descriptor\".\n */\n @queryAssignedElements({\n flatten: true,\n selector: ':not([slot=\"longpress-describedby-descriptor\"], slot)',\n })\n override elements!: OpenableElement[];\n\n /**\n * A reference to the parent overlay that should be force-closed, if any.\n */\n public parentOverlayToForceClose?: Overlay;\n\n /**\n * Determines if the overlay has a non-virtual trigger element.\n *\n * @returns {boolean} `true` if the trigger element is not a virtual trigger, otherwise `false`.\n */\n private get hasNonVirtualTrigger(): boolean {\n return (\n !!this.triggerElement && !(this.triggerElement instanceof VirtualTrigger)\n );\n }\n\n /**\n * The `offset` property accepts either a single number to define the offset of the\n * Overlay along the main axis from the trigger, or a 2-tuple to define the offset\n * along both the main axis and the cross axis. This option has no effect when there\n * is no trigger element.\n *\n * @type {number | [number, number]}\n * @default 0\n */\n @property({ type: Number })\n override offset: number | [number, number] = 0;\n\n /**\n * Provides an instance of the `PlacementController` for managing the positioning\n * of the overlay relative to its trigger element.\n *\n * If the `PlacementController` instance does not already exist, it is created and\n * assigned to the `_placementController` property.\n *\n * @protected\n * @returns {PlacementController} The `PlacementController` instance.\n */\n protected override get placementController(): PlacementController {\n if (!this._placementController) {\n this._placementController = new PlacementController(this);\n }\n return this._placementController;\n }\n\n /**\n * Indicates whether the Overlay is projected onto the \"top layer\" or not.\n *\n * When set to `true`, the overlay is open and visible. When set to `false`, the overlay is closed and hidden.\n *\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n override get open(): boolean {\n return this._open;\n }\n\n override set open(open: boolean) {\n // Don't respond if the overlay is disabled.\n if (open && this.disabled) {\n return;\n }\n\n // Don't respond if the state is not changing.\n if (open === this.open) {\n return;\n }\n\n // Don't respond if the overlay is in the shadow state during a longpress.\n // The shadow state occurs when the first \"click\" would normally close the popover.\n if (this.strategy?.activelyOpening && !open) {\n return;\n }\n\n // Update the internal _open property.\n this._open = open;\n\n // Increment the open count if the overlay is opening.\n if (this.open) {\n Overlay.openCount += 1;\n }\n\n // Request an update to re-render the component if necessary.\n this.requestUpdate('open', !this.open);\n\n // Request slottable content if the overlay is opening.\n if (this.open) {\n this.requestSlottable();\n }\n }\n\n private _open = false;\n\n /**\n * Tracks the number of overlays that have been opened.\n *\n * This static property is used to manage the stacking context of multiple overlays.\n *\n * @type {number}\n * @default 1\n */\n static openCount = 1;\n\n /**\n * Instruct the Overlay where to place itself in relationship to the trigger element.\n *\n * @type {\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\"}\n */\n @property()\n override placement?: Placement;\n\n /**\n * The state in which the last `request-slottable` event was dispatched.\n *\n * This property ensures that overlays do not dispatch the same state twice in a row.\n *\n * @type {boolean}\n * @default false\n */\n private lastRequestSlottableState = false;\n\n /**\n * Whether to pass focus to the overlay once opened, or\n * to the appropriate value based on the \"type\" of the overlay\n * when set to `\"auto\"`.\n *\n * @type {'true' | 'false' | 'auto'}\n * @default 'auto'\n */\n @property({ attribute: 'receives-focus' })\n override receivesFocus: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * @deprecated This property will be removed in a future version.\n * We do not recommend using this property for accessibility reasons.\n * It allows clicks outside the overlay to close it, which can cause\n * unexpected behavior and accessibility issues.\n *\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, attribute: 'allow-outside-click' })\n allowOutsideClick = false;\n\n /**\n * A reference to the slot element within the overlay.\n *\n * This element is used to manage the content slotted into the overlay.\n *\n * @type {HTMLSlotElement}\n */\n @query('slot')\n slotEl!: HTMLSlotElement;\n\n /**\n * The current state of the overlay.\n *\n * This property reflects the current state of the overlay, such as 'opened' or 'closed'.\n * When the state changes, it triggers the appropriate actions and updates the component.\n *\n * @type {OverlayState}\n * @default 'closed'\n */\n @state()\n override get state(): OverlayState {\n return this._state;\n }\n\n override set state(state) {\n // Do not respond if the state is not changing.\n if (state === this.state) {\n return;\n }\n\n const oldState = this.state;\n\n this._state = state;\n\n // Complete the opening strategy if the state is 'opened' or 'closed'.\n if (this.state === 'opened' || this.state === 'closed') {\n this.strategy?.shouldCompleteOpen();\n }\n\n // Request an update to re-render the component if necessary.\n this.requestUpdate('state', oldState);\n }\n\n override _state: OverlayState = 'closed';\n\n /**\n * The interaction strategy for opening the overlay.\n * This can be a ClickController, HoverController, or LongpressController.\n */\n public strategy?: ClickController | HoverController | LongpressController;\n\n /**\n * The padding around the tip of the overlay.\n * This property defines the padding around the tip of the overlay, which can be used to adjust its positioning.\n *\n * @type {number}\n */\n @property({ type: Number, attribute: 'tip-padding' })\n tipPadding?: number;\n\n /**\n * An optional ID reference for the trigger element combined with the optional\n * interaction (click | hover | longpress) by which the overlay should open.\n * The format is `trigger@interaction`, e.g., `trigger@click` opens the overlay\n * when an element with the ID \"trigger\" is clicked.\n *\n * @type {string}\n */\n @property()\n trigger?: string;\n\n /**\n * An element reference for the trigger element that the overlay should relate to.\n * This property is not reflected as an attribute.\n *\n * @type {HTMLElement | VirtualTrigger | null}\n */\n @property({ attribute: false })\n override triggerElement: HTMLElement | VirtualTrigger | null = null;\n\n /**\n * The specific interaction to listen for on the `triggerElement` to open the overlay.\n * This property is not reflected as an attribute.\n *\n * @type {TriggerInteraction}\n */\n @property({ attribute: false })\n triggerInteraction?: TriggerInteraction;\n\n /**\n * When set to `'none'`, the overlay will not set `aria-describedby` on the\n * trigger when open, so the trigger is not described by the overlay content.\n * Use for hint overlays whose content duplicates the trigger (e.g. truncated\n * value tooltips) to avoid double announcement by screen readers.\n *\n * @internal\n * @type {\"auto\" | \"none\"}\n * @default \"auto\"\n */\n @property({ attribute: false })\n describeTrigger: 'auto' | 'none' = 'auto';\n\n /**\n * Configures the open/close heuristics of the Overlay.\n *\n * @type {\"auto\" | \"hint\" | \"manual\" | \"modal\" | \"page\"}\n * @default \"auto\"\n */\n @property()\n override type: OverlayTypes = 'auto';\n\n /**\n * Tracks whether the overlay was previously open.\n * This is used to restore the open state when re-enabling the overlay.\n *\n * @type {boolean}\n * @default false\n */\n protected wasOpen = false;\n\n /**\n * Focus trap to keep focus within the dialog\n *\n * @private\n */\n private _focusTrap: FocusTrap | null = null;\n\n /**\n * Provides an instance of the `ElementResolutionController` for managing the element\n * that the overlay should be associated with. If the instance does not already exist,\n * it is created and assigned to the `_elementResolver` property.\n *\n * @protected\n * @returns {ElementResolutionController} The `ElementResolutionController` instance.\n */\n protected override get elementResolver(): ElementResolutionController {\n if (!this._elementResolver) {\n this._elementResolver = new ElementResolutionController(this);\n }\n\n return this._elementResolver;\n }\n\n /**\n * Determines the value for the popover attribute based on the overlay type.\n *\n * @private\n * @returns {'auto' | 'manual' | undefined} The popover value or undefined if not applicable.\n */\n private get popoverValue(): 'auto' | 'manual' | undefined {\n const hasPopoverAttribute = 'popover' in this;\n\n if (!hasPopoverAttribute) {\n return undefined;\n }\n\n switch (this.type) {\n case 'modal':\n // Use 'manual' to allow multiple modal overlays to be visible simultaneously.\n // The browser's 'auto' popover only allows one at a time (light dismiss closes others).\n // This restores the stacking behavior that existed when using showModal().\n // The OverlayStack handles Escape key closing for modal overlays.\n return 'manual';\n case 'page':\n return 'manual';\n case 'hint':\n return 'manual';\n default:\n return this.type;\n }\n }\n\n /**\n * Determines if the overlay requires positioning based on its type and state.\n *\n * @protected\n * @returns {boolean} True if the overlay requires positioning, otherwise false.\n */\n protected get requiresPositioning(): boolean {\n // Do not position \"page\" overlays as they should block the entire UI.\n if (this.type === 'page' || !this.open) {\n return false;\n }\n\n // Do not position content without a trigger element, as there is nothing to position it relative to.\n // Do not automatically position content unless it is a \"hint\".\n if (!this.triggerElement || (!this.placement && this.type !== 'hint')) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Determines if the overlay needs a modal backdrop to block external clicks.\n * Only page overlays need the backdrop since they don't have light dismiss.\n * Modal overlays use popover=\"manual\" for stacking and handle light dismiss\n * via handlePointerup in OverlayStack.\n */\n protected get needsModalBackdrop(): boolean {\n return this.open && (this.type === 'modal' || this.type === 'page');\n }\n\n /**\n * Manages the positioning of the overlay relative to its trigger element.\n *\n * This method calculates the necessary parameters for positioning the overlay,\n * such as offset, placement, and tip padding, and then delegates the actual\n * positioning to the `PlacementController`.\n *\n * @protected\n * @override\n */\n protected override managePosition(): void {\n // Do not proceed if positioning is not required or the overlay is not open.\n if (!this.requiresPositioning || !this.open) {\n return;\n }\n\n const offset = this.offset || 0;\n\n const trigger = this.triggerElement as HTMLElement;\n\n const placement = (this.placement as Placement) || 'right';\n\n const tipPadding = this.tipPadding;\n\n this.placementController.placeOverlay(this.dialogEl, {\n offset,\n placement,\n tipPadding,\n trigger,\n type: this.type,\n });\n }\n\n /**\n * Manages the process of opening the popover.\n *\n * This method handles the necessary steps to open the popover, including managing delays,\n * ensuring the popover is in the DOM, making transitions, and applying focus.\n *\n * @protected\n * @override\n * @returns {Promise<void>} A promise that resolves when the popover has been fully opened.\n */\n protected override async managePopoverOpen(): Promise<void> {\n // Call the base class method to handle any initial setup.\n super.managePopoverOpen();\n\n const targetOpenState = this.open;\n\n // Ensure the open state has not changed before proceeding.\n if (this.open !== targetOpenState) {\n return;\n }\n\n // Manage any delays before opening the popover.\n await this.manageDelay(targetOpenState);\n\n if (this.open !== targetOpenState) {\n return;\n }\n\n // Only wait for next frame if `longpress` is the trigger.\n // In Safari, awaiting nextFrame here causes layout issues\n // when rendering trays inside modals, so we skip it otherwise.\n if (this.triggerInteraction === 'longpress') {\n await nextFrame();\n }\n\n // Ensure the popover is in the DOM before proceeding.\n await this.ensureOnDOM(targetOpenState);\n\n if (this.open !== targetOpenState) {\n return;\n }\n\n // Make any necessary transitions for opening the popover.\n const focusEl = await this.makeTransition(targetOpenState);\n\n if (this.open !== targetOpenState) {\n return;\n }\n if (targetOpenState) {\n const focusTrap = await import('focus-trap');\n // When `receives-focus=\"false\"`, pass `initialFocus: false` so the trap\n // still captures Tab but does not move focus on activation. Without this,\n // focus-trap would move focus before `applyFocus` runs, bypassing the\n // `receivesFocus === 'false'` guard there.\n const initialFocus =\n this.receivesFocus === 'false' ? false : focusEl || undefined;\n this._focusTrap = focusTrap.createFocusTrap(this.dialogEl, {\n initialFocus,\n tabbableOptions: {\n getShadowRoot: true,\n },\n fallbackFocus: () => {\n // set tabIndex to -1 allow the focus-trap to still be applied\n this.dialogEl.setAttribute('tabIndex', '-1');\n return this.dialogEl;\n },\n // disable escape key capture to close the overlay, the focus-trap library captures it otherwise\n escapeDeactivates: false,\n allowOutsideClick: this.allowOutsideClick,\n });\n\n if (this.type === 'modal' || this.type === 'page') {\n this._focusTrap.activate();\n }\n }\n // Apply focus to the appropriate element after opening the popover.\n await this.applyFocus(targetOpenState, focusEl);\n }\n\n /**\n * Applies focus to the appropriate element after the popover has been opened.\n *\n * This method handles the focus management for the overlay, ensuring that the correct\n * element receives focus based on the overlay's type and state.\n *\n * @protected\n * @override\n * @param {boolean} targetOpenState - The target open state of the overlay.\n * @param {HTMLElement | null} focusEl - The element to focus after opening the popover.\n * @returns {Promise<void>} A promise that resolves when the focus has been applied.\n */\n protected override async applyFocus(\n targetOpenState: boolean,\n focusEl: HTMLElement | null\n ): Promise<void> {\n // Do not move focus when explicitly told not to or when the overlay is a \"hint\".\n if (this.receivesFocus === 'false' || this.type === 'hint') {\n return;\n }\n\n // Wait for the next two animation frames to ensure the DOM is updated.\n await nextFrame();\n await nextFrame();\n\n // If the open state has changed during the delay, do not proceed.\n if (targetOpenState === this.open && !this.open) {\n // If the overlay is closing and the trigger element is still focused, return focus to the trigger element.\n if (\n this.hasNonVirtualTrigger &&\n this.contains((this.getRootNode() as Document).activeElement)\n ) {\n (this.triggerElement as HTMLElement).focus();\n }\n return;\n }\n\n // Apply focus to the specified focus element.\n focusEl?.focus();\n }\n\n /**\n * Returns focus to the trigger element if the overlay is closed.\n *\n * This method ensures that focus is returned to the trigger element when the overlay is closed,\n * unless the overlay is of type \"hint\" or the focus is already outside the overlay.\n *\n * @protected\n * @override\n */\n protected override returnFocus(): void {\n // Do not proceed if the overlay is open or if the overlay type is \"hint\".\n if (this.open || this.type === 'hint') {\n return;\n }\n\n /**\n * Retrieves the ancestors of the currently focused element.\n *\n * @returns {HTMLElement[]} An array of ancestor elements.\n */\n const getAncestors = (): HTMLElement[] => {\n const ancestors: HTMLElement[] = [];\n\n // eslint-disable-next-line swc/document-active-element\n let currentNode = document.activeElement;\n\n // Traverse the shadow DOM to find the active element.\n while (currentNode?.shadowRoot?.activeElement) {\n currentNode = currentNode.shadowRoot.activeElement;\n }\n\n // Traverse the DOM tree to collect ancestor elements.\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor;\n }\n return ancestors;\n };\n\n // Check if focus should be returned to the trigger element.\n if (\n this.receivesFocus !== 'false' &&\n !!(this.triggerElement as HTMLElement)?.focus &&\n (this.contains((this.getRootNode() as Document).activeElement) ||\n getAncestors().includes(this) ||\n // eslint-disable-next-line swc/document-active-element\n document.activeElement === document.body)\n ) {\n // Return focus to the trigger element.\n (this.triggerElement as HTMLElement).focus();\n }\n }\n\n /**\n * Tracks the specific element targeted by the most recent `pointerdown` that\n * originated from within this overlay's own composed subtree. A click on\n * non-focusable overlay content (e.g. plain text) can resolve focus onto a\n * focusable ancestor shared by the trigger and the overlay (e.g. an ancestor with\n * `tabindex`), which otherwise looks identical to focus leaving the overlay\n * entirely once it reaches `closeOnFocusOut`.\n *\n * This is only meaningful for a `focusout` caused by that same `pointerdown`, and\n * only when the resulting `relatedTarget` is an ancestor of the recorded target\n * (i.e. exactly the relationship the browser creates by resolving focus to the\n * nearest focusable ancestor of a non-focusable click target) \u2014 an interaction\n * that explicitly redirects focus elsewhere is not masked. Browsers apply the\n * default focus-change behavior of `pointerdown`/`mousedown` (and so any resulting\n * `focusout`) before dispatching the matching `pointerup`/`pointercancel` of the\n * same gesture, so clearing the record on either of those events prevents a\n * `pointerdown` that causes no focus change at all (e.g. clicking already-focused\n * content) from being read later by an unrelated focus change, such as a\n * subsequent keyboard `Tab`.\n */\n private lastPointerdownTarget: EventTarget | null = null;\n\n private trackPointerdownOrigin = (event: PointerEvent): void => {\n const path = event.composedPath();\n this.lastPointerdownTarget = path.includes(this) ? path[0] : null;\n };\n\n private clearPointerdownOrigin = (): void => {\n this.lastPointerdownTarget = null;\n };\n\n /**\n * Determines whether `ancestorCandidate` is `descendant` itself or a\n * shadow-including ancestor of it. `composedPath()` is only available on an\n * actual event, so this dispatches a throwaway event directly on `descendant` and\n * reads its composed path, the same technique the overlay's containment check\n * already relies on to stay correct across shadow DOM boundaries.\n *\n * @private\n */\n private isShadowIncludingAncestor(\n descendant: EventTarget,\n ancestorCandidate: EventTarget\n ): boolean {\n const relationEvent = new Event('overlay-relation-query', {\n bubbles: true,\n composed: true,\n });\n let isAncestor = false;\n descendant.addEventListener(\n relationEvent.type,\n (event: Event) => {\n isAncestor = event.composedPath().includes(ancestorCandidate);\n },\n { once: true }\n );\n descendant.dispatchEvent(relationEvent);\n return isAncestor;\n }\n\n /**\n * Handles the focus out event to close the overlay if the focus moves outside of it.\n *\n * This method ensures that the overlay is closed when the focus moves to an element\n * outside of the overlay, unless the focus is moved to a related element.\n *\n * @private\n * @param {FocusEvent} event - The focus out event.\n */\n private closeOnFocusOut = (event: FocusEvent): void => {\n // Consume the record immediately so a stale value from an earlier click cannot\n // affect a later, unrelated focus change (e.g. a keyboard Tab away).\n const pointerdownTarget = this.lastPointerdownTarget;\n this.lastPointerdownTarget = null;\n\n // If the related target (newly focused element) is not known, do nothing.\n if (!event.relatedTarget) {\n return;\n }\n\n // The pointerdown that caused this focus change targeted an element within the\n // overlay, and focus resolved onto an ancestor of that same element. Treat focus\n // as remaining within the overlay's interaction, even though `relatedTarget`\n // itself sits outside the overlay in the DOM.\n if (\n pointerdownTarget &&\n this.isShadowIncludingAncestor(pointerdownTarget, event.relatedTarget)\n ) {\n return;\n }\n\n // Only close if focus moves outside the overlay and its children.\n if (!this.isShadowIncludingAncestor(event.relatedTarget, this)) {\n this.open = false;\n }\n };\n\n private closeOnCancelEvent = (): void => {\n this.open = false;\n };\n\n /**\n * Manages the process of opening or closing the overlay.\n *\n * This method handles the necessary steps to open or close the overlay, including updating the state,\n * managing the overlay stack, and handling focus events.\n *\n * @protected\n * @param {boolean} oldOpen - The previous open state of the overlay.\n * @returns {Promise<void>} A promise that resolves when the overlay has been fully managed.\n */\n protected async manageOpen(oldOpen: boolean): Promise<void> {\n // Prevent entering the manage workflow if the overlay is not connected to the DOM.\n // The `.showPopover()` event will error on content that is not connected to the DOM.\n if (!this.isConnected && this.open) {\n return;\n }\n\n // Wait for the component to finish updating if it has not already done so.\n if (!this.hasUpdated) {\n await this.updateComplete;\n }\n\n if (this.open) {\n // Add the overlay to the overlay stack.\n overlayStack.add(this);\n\n if (this.willPreventClose) {\n // Add an event listener to handle the pointerup event and toggle the 'not-immediately-closable' class.\n document.addEventListener(\n 'pointerup',\n () => {\n this.dialogEl.classList.toggle('not-immediately-closable', false);\n this.willPreventClose = false;\n },\n { once: true }\n );\n this.dialogEl.classList.toggle('not-immediately-closable', true);\n }\n } else {\n if (oldOpen) {\n this._focusTrap?.deactivate();\n this._focusTrap = null;\n // Dispose of the overlay if it was previously open.\n this.dispose();\n }\n\n // Remove the overlay from the overlay stack.\n overlayStack.remove(this);\n }\n\n // Update the state of the overlay based on the open property.\n if (this.open && this.state !== 'opened') {\n this.state = 'opening';\n } else if (!this.open && this.state !== 'closed') {\n this.state = 'closing';\n }\n\n this.managePopoverOpen();\n\n const listenerRoot = this.getRootNode() as Document;\n // Handle focus events for auto type overlays.\n if (this.type === 'auto') {\n if (this.open) {\n listenerRoot.addEventListener(\n 'pointerdown',\n this.trackPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.addEventListener(\n 'pointerup',\n this.clearPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.addEventListener(\n 'pointercancel',\n this.clearPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.addEventListener('focusout', this.closeOnFocusOut, {\n capture: true,\n });\n } else {\n listenerRoot.removeEventListener(\n 'pointerdown',\n this.trackPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.removeEventListener(\n 'pointerup',\n this.clearPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.removeEventListener(\n 'pointercancel',\n this.clearPointerdownOrigin,\n { capture: true }\n );\n listenerRoot.removeEventListener('focusout', this.closeOnFocusOut, {\n capture: true,\n });\n // Defensively clear any pending record in case the overlay tore down\n // between a `pointerdown` and its matching `pointerup`/`pointercancel`,\n // so a stale value can't leak into the next time this instance opens.\n this.lastPointerdownTarget = null;\n }\n }\n\n // Handle cancel events for modal and page type overlays.\n if (this.type === 'modal' || this.type === 'page') {\n if (this.open) {\n listenerRoot.addEventListener('cancel', this.closeOnCancelEvent, {\n capture: true,\n });\n } else {\n listenerRoot.removeEventListener('cancel', this.closeOnCancelEvent, {\n capture: true,\n });\n }\n }\n }\n\n /**\n * Binds event handling strategies to the overlay based on the specified trigger interaction.\n *\n * This method sets up the appropriate event handling strategy for the overlay, ensuring that\n * it responds correctly to user interactions such as clicks, hovers, or long presses.\n *\n * @protected\n */\n protected bindEvents(): void {\n // Abort any existing strategy to ensure a clean setup.\n this.strategy?.abort();\n this.strategy = undefined;\n\n // Return early if there is no non-virtual trigger element.\n if (!this.hasNonVirtualTrigger) {\n return;\n }\n\n // Return early if no trigger interaction is specified.\n if (!this.triggerInteraction) {\n return;\n }\n\n // Set up a new event handling strategy based on the specified trigger interaction.\n this.strategy = new strategies[this.triggerInteraction](\n this.triggerElement as HTMLElement,\n {\n overlay: this,\n }\n );\n }\n\n /**\n * Handles the `beforetoggle` event to manage the overlay's state.\n *\n * This method checks the new state of the event and calls `handleBrowserClose`\n * if the new state is not 'open'.\n *\n * @protected\n * @param {Event & { newState: string }} event - The `beforetoggle` event with the new state.\n */\n protected handleBeforetoggle(event: Event & { newState: string }): void {\n if (event.newState !== 'open') {\n this.handleBrowserClose(event);\n }\n }\n\n /**\n * Handles the browser's close event to manage the overlay's state.\n *\n * This method stops the propagation of the event and closes the overlay if it is not\n * actively opening. If the overlay is actively opening, it calls `manuallyKeepOpen`.\n *\n * @protected\n * @param {Event} event - The browser's close event.\n */\n protected handleBrowserClose(event: Event): void {\n event.stopPropagation();\n if (!this.strategy?.activelyOpening) {\n this.open = false;\n return;\n }\n this.manuallyKeepOpen();\n }\n\n /**\n * Manually keeps the overlay open.\n *\n * This method sets the overlay to open, allows placement updates, and manages the open state.\n *\n * @public\n * @override\n */\n public override manuallyKeepOpen(): void {\n this.open = true;\n this.placementController.allowPlacementUpdate = true;\n this.manageOpen(false);\n }\n\n /**\n * Handles the `slotchange` event to manage the overlay's state.\n *\n * This method checks if there are any elements in the slot. If there are no elements,\n * it releases the description from the strategy. If there are elements and the trigger\n * is non-virtual, it prepares the description for the trigger element.\n *\n * @protected\n */\n protected handleSlotchange(): void {\n if (!this.elements.length) {\n // Release the description if there are no elements in the slot.\n this.strategy?.releaseDescription();\n } else if (this.hasNonVirtualTrigger) {\n // Prepare the description for the trigger element if it is non-virtual.\n this.strategy?.prepareDescription(this.triggerElement as HTMLElement);\n }\n }\n\n /**\n * Handles the 'close' event to update the 'open' property.\n *\n * @private\n */\n private handleClose(): void {\n this.open = false;\n }\n\n /**\n * Determines whether the overlay should prevent closing.\n *\n * This method checks the `willPreventClose` flag and resets it to `false`.\n * It returns the value of the `willPreventClose` flag.\n *\n * @public\n * @returns {boolean} `true` if the overlay should prevent closing, otherwise `false`.\n */\n public shouldPreventClose(): boolean {\n const shouldPreventClose = this.willPreventClose;\n this.willPreventClose = false;\n return shouldPreventClose;\n }\n\n /**\n * Requests slottable content for the overlay.\n *\n * This method dispatches a `SlottableRequestEvent` to request or remove slottable content\n * based on the current open state of the overlay. It ensures that the same state is not\n * dispatched twice in a row.\n *\n * @protected\n * @override\n */\n protected override requestSlottable(): void {\n // Do not dispatch the same state twice in a row.\n if (this.lastRequestSlottableState === this.open) {\n return;\n }\n\n // Force the browser to paint if the overlay is closing.\n if (!this.open) {\n /** @todo investigate why this is needed and if there is a better way to do this or remove it entirely */\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n document.body.offsetHeight;\n }\n\n /**\n * @ignore\n */\n // Dispatch a custom event to request or remove slottable content based on the open state.\n this.dispatchEvent(\n new SlottableRequestEvent(\n 'overlay-content',\n this.open ? {} : removeSlottableRequest\n )\n );\n\n // Update the last request slottable state.\n this.lastRequestSlottableState = this.open;\n }\n\n /**\n * Lifecycle method called before the component updates.\n *\n * This method handles various tasks before the component updates, such as setting an ID,\n * managing the open state, resolving the trigger element, and binding events.\n *\n * @override\n * @param {PropertyValues} changes - The properties that have changed.\n */\n override willUpdate(changes: PropertyValues): void {\n // Ensure the component has an ID attribute.\n if (!this.hasAttribute('id')) {\n this.setAttribute('id', `${this.tagName.toLowerCase()}-${randomID()}`);\n }\n\n // Warn about deprecated allowOutsideClick property\n if (changes.has('allowOutsideClick') && this.allowOutsideClick) {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `The \"allow-outside-click\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. We do not recommend using this attribute for accessibility reasons. It allows clicks outside the overlay to close it, which can cause unexpected behavior and accessibility issues.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/overlay/',\n { level: 'deprecation' }\n );\n } else {\n // Fallback for testing environments or when SWC is not available\n console.warn(\n `[${this.localName}] The \"allow-outside-click\" attribute has been deprecated and will be removed in a future release. We do not recommend using this attribute for accessibility reasons. It allows clicks outside the overlay to close it, which can cause unexpected behavior and accessibility issues.`\n );\n }\n }\n\n // Manage the open state if the 'open' property has changed.\n if (changes.has('open') && (this.hasUpdated || this.open)) {\n this.manageOpen(changes.get('open'));\n }\n\n // Resolve the trigger element if the 'trigger' property has changed.\n if (changes.has('trigger')) {\n const [id, interaction] = this.trigger?.split('@') || [];\n this.elementResolver.selector = id ? `#${id}` : '';\n this.triggerInteraction = interaction as\n | 'click'\n | 'longpress'\n | 'hover'\n | undefined;\n }\n\n // Initialize oldTrigger to track the previous trigger element.\n let oldTrigger: HTMLElement | false | undefined = false;\n\n // Check if the element resolver has been updated.\n if (changes.has(elementResolverUpdatedSymbol)) {\n // Store the current trigger element.\n oldTrigger = this.triggerElement as HTMLElement;\n // Update the trigger element from the element resolver.\n this.triggerElement = this.elementResolver.element;\n }\n\n // Check if the 'triggerElement' property has changed.\n if (changes.has('triggerElement')) {\n // Store the old trigger element.\n oldTrigger = changes.get('triggerElement');\n }\n\n // If the trigger element has changed, bind the new events.\n if (oldTrigger !== false) {\n this.bindEvents();\n }\n }\n\n /**\n * Lifecycle method called after the component updates.\n *\n * This method handles various tasks after the component updates, such as updating the placement\n * attribute, resetting the overlay position, and clearing the overlay position based on the state.\n *\n * @override\n * @param {PropertyValues} changes - The properties that have changed.\n */\n protected override updated(changes: PropertyValues): void {\n // Call the base class method to handle any initial setup.\n super.updated(changes);\n\n // Check if the 'placement' property has changed.\n if (changes.has('placement')) {\n if (this.placement) {\n // Set the 'actual-placement' attribute on the dialog element.\n this.dialogEl.setAttribute('actual-placement', this.placement);\n } else {\n // Remove the 'actual-placement' attribute from the dialog element.\n this.dialogEl.removeAttribute('actual-placement');\n }\n\n // If the overlay is open and the 'placement' property has changed, reset the overlay position.\n if (this.open && typeof changes.get('placement') !== 'undefined') {\n this.placementController.resetOverlayPosition();\n }\n }\n\n // Check if the 'state' property has changed and the overlay is closed.\n if (\n changes.has('state') &&\n this.state === 'closed' &&\n typeof changes.get('state') !== 'undefined'\n ) {\n // Clear the overlay position.\n this.placementController.clearOverlayPosition();\n }\n }\n\n /**\n * Renders the content of the overlay.\n *\n * This method returns a template result containing a slot element. The slot element\n * listens for the `slotchange` event to manage the overlay's state.\n *\n * @protected\n * @returns {TemplateResult} The template result containing the slot element.\n */\n protected renderContent(): TemplateResult {\n return html`\n <slot @slotchange=${this.handleSlotchange}></slot>\n `;\n }\n\n /**\n * Generates a style map for the dialog element.\n *\n * This method returns an object containing CSS custom properties for the dialog element.\n * The `--swc-overlay-open-count` custom property is set to the current open count of overlays.\n *\n * @private\n * @returns {StyleInfo} The style map for the dialog element.\n */\n private get dialogStyleMap(): StyleInfo {\n return {\n '--swc-overlay-open-count': Overlay.openCount.toString(),\n };\n }\n\n /**\n * Renders the popover element for the overlay.\n *\n * This method returns a template result containing a div element styled as a popover.\n * The popover element includes various attributes and event listeners to manage the overlay's state and behavior.\n *\n * @protected\n * @returns {TemplateResult} The template result containing the popover element.\n */\n protected renderPopover(): TemplateResult {\n /**\n * The `--swc-overlay-open-count` custom property is applied to mimic the single stack\n * nature of the top layer in browsers that do not yet support it.\n *\n * The value should always represent the total number of overlays that have ever been opened.\n * This value will be added to the `--swc-overlay-z-index-base` custom property, which can be\n * provided by a consuming developer. By default, `--swc-overlay-z-index-base` is set to 1000\n * to ensure that the overlay stacks above most other elements during fallback delivery.\n */\n return html`\n ${this.needsModalBackdrop\n ? html`\n <div class=\"modal-backdrop\"></div>\n `\n : nothing}\n <div\n class=\"dialog\"\n part=\"dialog\"\n role=${ifDefined(\n this.type === 'modal' || this.type === 'page' ? 'dialog' : undefined\n )}\n aria-modal=${ifDefined(\n this.type === 'modal' || this.type === 'page' ? 'true' : undefined\n )}\n placement=${ifDefined(\n this.requiresPositioning ? this.placement || 'right' : undefined\n )}\n popover=${ifDefined(this.popoverValue)}\n style=${styleMap(this.dialogStyleMap)}\n @beforetoggle=${this.handleBeforetoggle}\n @close=${this.handleBrowserClose}\n ?is-visible=${this.state !== 'closed'}\n >\n ${this.renderContent()}\n </div>\n `;\n }\n\n /**\n * Renders the overlay component.\n *\n * This method returns a template result containing either a dialog or popover element\n * based on the overlay type. It also includes a slot for longpress descriptors.\n *\n * @override\n * @returns {TemplateResult} The template result containing the overlay content.\n */\n public override render(): TemplateResult {\n return html`\n ${this.renderPopover()}\n <slot name=\"longpress-describedby-descriptor\"></slot>\n `;\n }\n\n /**\n * Lifecycle method called when the component is added to the DOM.\n *\n * This method sets up event listeners and binds events if the component has already updated.\n *\n * @override\n */\n override connectedCallback(): void {\n super.connectedCallback();\n\n // Add an event listener to handle the 'close' event and update the 'open' property.\n this.addEventListener('close', this.handleClose);\n\n // Bind events if the component has already updated.\n if (this.hasUpdated) {\n this.bindEvents();\n }\n }\n\n /**\n * Lifecycle method called when the component is removed from the DOM.\n *\n * This method releases the description from the strategy and updates the 'open' property.\n *\n * @override\n */\n override disconnectedCallback(): void {\n // Release the description from the strategy.\n this.strategy?.releaseDescription();\n // Update the 'open' property to false.\n this.open = false;\n this.removeEventListener('close', this.handleClose);\n super.disconnectedCallback();\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;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,GAaAkD,GAAA,CADCC,EAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAtUnBnD,EAuUX,WAAA,mBAAA,CAAA,GASSkD,GAAA,CADRC,EAAS,CAAA,GA/UCnD,EAgVF,WAAA,QAAA,CAAA;AAhVJ,IAAM,UAANA;",
6
+ "names": ["host", "selector", "mutationList", "needsResolution", "mutation", "currentElementRemoved", "matchingElementAdded", "attributeChangedOnCurrentElement", "attributeChangedOnMatchingElement", "el", "_a", "element", "previous", "parent", "restoreChildren", "placeholderItems", "srcElements", "cleanupCallbacks", "index", "srcElement", "placeholderItem", "parentElement", "destination", "position", "prepareCallback", "length", "step", "placeholderTemplate", "options", "component", "resolve", "OverlayTimer", "el", "action", "cb", "abortController", "runningTransitions", "cleanup", "guarantee2", "guarantee3", "guarantee1", "handleTransitionend", "event", "handleTransitionrun", "res", "SpectrumElement", "_targetOpenState", "_focusEl", "_delayed", "_disabled", "controller", "_open", "_state", "overlayUpdateEvent", "triggerOrContent", "interactionOrOptions", "content", "optionsV1", "v2", "overlayContent", "overlay", "restored", "restoreContent", "reparentChildren", "slot", "trigger", "interaction", "options", "_a", "_b", "type", "overlay", "publish", "interaction", "reason", "x", "y", "AbstractOverlay", "constructor", "OverlayWithNoPopover", "targetOpenState", "overlayTimer", "_targetOpenState", "focusEl", "start", "el", "index", "event", "BeforetoggleOpenEvent", "BeforetoggleClosedEvent", "userFocusableSelector", "firstFocusableIn", "slot", "firstFocusableSlottedIn", "finish", "eventName", "OverlayStateEvent", "hasVirtualTrigger", "VirtualTrigger", "nextFrame", "guaranteedAllTransitionend", "supportsOverlayAuto", "isOpen", "el", "popoverOpen", "error", "open", "constructor", "OverlayWithPopover", "targetOpenState", "overlayTimer", "update", "newState", "nextFrame", "focusEl", "start", "index", "event", "BeforetoggleOpenEvent", "BeforetoggleClosedEvent", "userFocusableSelector", "firstFocusableIn", "slot", "firstFocusableSlottedIn", "finish", "eventName", "OverlayStateEvent", "reportChange", "hasVirtualTrigger", "VirtualTrigger", "guaranteedAllTransitionend", "supportsPopover", "OverlayStack", "event", "overlay", "pointerPath", "pageOverlays", "o", "modalOverlays", "clickPath", "composedPath", "lastOverlay", "lastIndex", "el", "topOverlay", "nonAncestorOverlays", "i", "parentToClose", "target", "open", "last", "overlayIndex", "shouldBlock", "eventPath", "dialogEl", "element", "triggerElement", "queryPathEventName", "queryPathEvent", "path", "overlayEl", "getComputedStyle", "isWebKit", "getComputedStyle", "y", "isWebKit", "b", "offset", "shift", "flip", "size", "arrow", "computePosition", "roundByDPR", "num", "dpr", "REQUIRED_DISTANCE_TO_EDGE", "MIN_OVERLAY_HEIGHT", "getFallbackPlacements", "placement", "_a", "host", "target", "options", "_a", "cleanupAncestorResize", "autoUpdate", "cleanupElementResize", "visualViewport", "visualViewportRafId", "visualViewportPlacementCancelled", "onVisualViewportChange", "isWebKit", "element", "placement", "_b", "genAtStart", "placementStillValid", "resolve", "flipMiddleware", "flip", "REQUIRED_DISTANCE_TO_EDGE", "getFallbackPlacements", "mainAxis", "crossAxis", "tipElement", "el", "middleware", "offset", "shift", "size", "availableWidth", "availableHeight", "floating", "maxHeight", "MIN_OVERLAY_HEIGHT", "actualHeight", "appliedHeight", "arrow", "x", "y", "middlewareData", "computePosition", "translateX", "translateY", "roundByDPR", "arrowX", "arrowY", "InteractionTypes", "target", "overlay", "isPersistent", "handleOverlayReady", "_a", "_b", "open", "Overlay", "_", "LONGPRESS_DURATION", "InteractionController", "InteractionTypes", "noop", "_a", "event", "code", "altKey", "trigger", "longpressDescription", "randomID", "messageType", "isIOS", "isAndroid", "triggerParent", "overlayParent", "releaseDescription", "conditionAttributeWithId", "signal", "styles", "css", "InteractionController", "InteractionTypes", "_a", "signal", "InteractionController", "InteractionTypes", "event", "lastInteractionType", "_a", "triggerRoot", "contentRoot", "overlayRoot", "releaseDescription", "conditionAttributeWithId", "noop", "overlay", "elementIds", "appliedIds", "el", "randomID", "index", "triggerElement", "signal", "ClickController", "LongpressController", "HoverController", "browserSupportsPopover", "ComputedOverlayBase", "OverlayPopover", "AbstractOverlay", "OverlayNoPopover", "_Overlay", "event", "path", "pointerdownTarget", "lastElement", "delayed", "disabled", "_a", "VirtualTrigger", "PlacementController", "open", "state", "oldState", "ElementResolutionController", "offset", "trigger", "placement", "tipPadding", "targetOpenState", "nextFrame", "focusEl", "focusTrap", "initialFocus", "getAncestors", "_b", "ancestors", "currentNode", "ancestor", "descendant", "ancestorCandidate", "relationEvent", "isAncestor", "oldOpen", "overlayStack", "listenerRoot", "strategies", "shouldPreventClose", "SlottableRequestEvent", "removeSlottableRequest", "changes", "randomID", "id", "interaction", "oldTrigger", "elementResolverUpdatedSymbol", "html", "nothing", "ifDefined", "styleMap", "styles", "__decorateClass", "property", "query", "queryAssignedElements"]
7
+ }