mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
248 KiB
1 lines
248 KiB
{"version":3,"file":"_overlay-module-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/block-scroll-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/scroll-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/close-scroll-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/noop-scroll-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/position/scroll-clip.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/reposition-scroll-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/scroll/scroll-strategy-options.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay-config.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/position/connected-position.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/dispatchers/base-overlay-dispatcher.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/dispatchers/overlay-keyboard-dispatcher.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/dispatchers/overlay-outside-click-dispatcher.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay-container.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/backdrop-ref.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay-ref.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/position/flexible-connected-position-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/position/global-position-strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/position/overlay-position-builder.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay-directives.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/overlay/overlay-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DOCUMENT, Injector} from '@angular/core';\nimport {ScrollStrategy} from './scroll-strategy';\nimport {ViewportRuler} from '../../scrolling';\nimport {coerceCssPixelValue} from '../../coercion';\nimport {supportsScrollBehavior} from '../../platform';\n\nconst scrollBehaviorSupported = supportsScrollBehavior();\n\n/**\n * Creates a scroll strategy that prevents the user from scrolling while the overlay is open.\n * @param injector Injector used to resolve dependencies of the scroll strategy.\n * @param config Configuration options for the scroll strategy.\n */\nexport function createBlockScrollStrategy(injector: Injector): BlockScrollStrategy {\n return new BlockScrollStrategy(injector.get(ViewportRuler), injector.get(DOCUMENT));\n}\n\n/**\n * Strategy that will prevent the user from scrolling while the overlay is visible.\n */\nexport class BlockScrollStrategy implements ScrollStrategy {\n private _previousHTMLStyles = {top: '', left: ''};\n private _previousScrollPosition: {top: number; left: number} | undefined;\n private _isEnabled = false;\n private _document: Document;\n\n constructor(\n private _viewportRuler: ViewportRuler,\n document: any,\n ) {\n this._document = document;\n }\n\n /** Attaches this scroll strategy to an overlay. */\n attach() {}\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this._canBeEnabled()) {\n const root = this._document.documentElement!;\n\n this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this._previousHTMLStyles.left = root.style.left || '';\n this._previousHTMLStyles.top = root.style.top || '';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);\n root.classList.add('cdk-global-scrollblock');\n this._isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement!;\n const body = this._document.body!;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this._isEnabled = false;\n\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n\n window.scroll(this._previousScrollPosition!.left, this._previousScrollPosition!.top);\n\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n\n private _canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this._document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {\n return false;\n }\n\n const rootElement = this._document.documentElement;\n const viewport = this._viewportRuler.getViewportSize();\n return rootElement.scrollHeight > viewport.height || rootElement.scrollWidth > viewport.width;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Describes a strategy that will be used by an overlay to handle scroll events while it is open.\n */\nexport interface ScrollStrategy {\n /** Enable this scroll strategy (called when the attached overlay is attached to a portal). */\n enable: () => void;\n\n /** Disable this scroll strategy (called when the attached overlay is detached from a portal). */\n disable: () => void;\n\n /** Attaches this `ScrollStrategy` to an overlay. */\n attach: (overlayRef: OverlayRef) => void;\n\n /** Detaches the scroll strategy from the current overlay. */\n detach?: () => void;\n}\n\n/**\n * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.\n */\nexport function getMatScrollStrategyAlreadyAttachedError(): Error {\n return Error(`Scroll strategy has already been attached.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {Injector, NgZone} from '@angular/core';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {Subscription} from 'rxjs';\nimport {ScrollDispatcher, ViewportRuler} from '../../scrolling';\nimport {filter} from 'rxjs/operators';\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Config options for the CloseScrollStrategy.\n */\nexport interface CloseScrollStrategyConfig {\n /** Amount of pixels the user has to scroll before the overlay is closed. */\n threshold?: number;\n}\n\n/**\n * Creates a scroll strategy that closes the overlay when the user starts to scroll.\n * @param injector Injector used to resolve dependencies of the scroll strategy.\n * @param config Configuration options for the scroll strategy.\n */\nexport function createCloseScrollStrategy(\n injector: Injector,\n config?: CloseScrollStrategyConfig,\n): CloseScrollStrategy {\n return new CloseScrollStrategy(\n injector.get(ScrollDispatcher),\n injector.get(NgZone),\n injector.get(ViewportRuler),\n config,\n );\n}\n\n/**\n * Strategy that will close the overlay as soon as the user starts scrolling.\n */\nexport class CloseScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription | null = null;\n private _overlayRef!: OverlayRef;\n private _initialScrollPosition!: number;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _config?: CloseScrollStrategyConfig,\n ) {}\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables the closing of the attached overlay on scroll. */\n enable() {\n if (this._scrollSubscription) {\n return;\n }\n\n const stream = this._scrollDispatcher.scrolled(0).pipe(\n filter(scrollable => {\n return (\n !scrollable ||\n !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement)\n );\n }),\n );\n\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config!.threshold!) {\n this._detach();\n } else {\n this._overlayRef.updatePosition();\n }\n });\n } else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }\n\n /** Disables the closing the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = null!;\n }\n\n /** Detaches the overlay ref and disables the scroll strategy. */\n private _detach = () => {\n this.disable();\n\n if (this._overlayRef.hasAttached()) {\n this._ngZone.run(() => this._overlayRef.detach());\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ScrollStrategy} from './scroll-strategy';\n\n/** Creates a scroll strategy that does nothing. */\nexport function createNoopScrollStrategy(): NoopScrollStrategy {\n return new NoopScrollStrategy();\n}\n\n/** Scroll strategy that doesn't do anything. */\nexport class NoopScrollStrategy implements ScrollStrategy {\n /** Does nothing, as this scroll strategy is a no-op. */\n enable() {}\n /** Does nothing, as this scroll strategy is a no-op. */\n disable() {}\n /** Does nothing, as this scroll strategy is a no-op. */\n attach() {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n// TODO(jelbourn): move this to live with the rest of the scrolling code\n// TODO(jelbourn): someday replace this with IntersectionObservers\n\n/** Equivalent of `DOMRect` without some of the properties we don't care about. */\ntype Dimensions = Omit<DOMRect, 'x' | 'y' | 'toJSON'>;\n\n/**\n * Gets whether an element is scrolled outside of view by any of its parent scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is scrolled out of view\n * @docs-private\n */\nexport function isElementScrolledOutsideView(element: Dimensions, scrollContainers: Dimensions[]) {\n return scrollContainers.some(containerBounds => {\n const outsideAbove = element.bottom < containerBounds.top;\n const outsideBelow = element.top > containerBounds.bottom;\n const outsideLeft = element.right < containerBounds.left;\n const outsideRight = element.left > containerBounds.right;\n\n return outsideAbove || outsideBelow || outsideLeft || outsideRight;\n });\n}\n\n/**\n * Gets whether an element is clipped by any of its scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is clipped\n * @docs-private\n */\nexport function isElementClippedByScrolling(element: Dimensions, scrollContainers: Dimensions[]) {\n return scrollContainers.some(scrollContainerRect => {\n const clippedAbove = element.top < scrollContainerRect.top;\n const clippedBelow = element.bottom > scrollContainerRect.bottom;\n const clippedLeft = element.left < scrollContainerRect.left;\n const clippedRight = element.right > scrollContainerRect.right;\n\n return clippedAbove || clippedBelow || clippedLeft || clippedRight;\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector, NgZone} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {ScrollDispatcher, ViewportRuler} from '../../scrolling';\nimport {isElementScrolledOutsideView} from '../position/scroll-clip';\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Config options for the RepositionScrollStrategy.\n */\nexport interface RepositionScrollStrategyConfig {\n /** Time in milliseconds to throttle the scroll events. */\n scrollThrottle?: number;\n\n /** Whether to close the overlay once the user has scrolled away completely. */\n autoClose?: boolean;\n}\n\n/**\n * Creates a scroll strategy that updates the overlay's position when the user scrolls.\n * @param injector Injector used to resolve dependencies of the scroll strategy.\n * @param config Configuration options for the scroll strategy.\n */\nexport function createRepositionScrollStrategy(\n injector: Injector,\n config?: RepositionScrollStrategyConfig,\n): RepositionScrollStrategy {\n return new RepositionScrollStrategy(\n injector.get(ScrollDispatcher),\n injector.get(ViewportRuler),\n injector.get(NgZone),\n config,\n );\n}\n\n/**\n * Strategy that will update the element position as the user is scrolling.\n */\nexport class RepositionScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription | null = null;\n private _overlayRef!: OverlayRef;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _viewportRuler: ViewportRuler,\n private _ngZone: NgZone,\n private _config?: RepositionScrollStrategyConfig,\n ) {}\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables repositioning of the attached overlay on scroll. */\n enable() {\n if (!this._scrollSubscription) {\n const throttle = this._config ? this._config.scrollThrottle : 0;\n\n this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {\n this._overlayRef.updatePosition();\n\n // TODO(crisbeto): make `close` on by default once all components can handle it.\n if (this._config && this._config.autoClose) {\n const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();\n const {width, height} = this._viewportRuler.getViewportSize();\n\n // TODO(crisbeto): include all ancestor scroll containers here once\n // we have a way of exposing the trigger element to the scroll strategy.\n const parentRects = [{width, height, bottom: height, right: width, top: 0, left: 0}];\n\n if (isElementScrolledOutsideView(overlayRect, parentRects)) {\n this.disable();\n this._ngZone.run(() => this._overlayRef.detach());\n }\n }\n });\n }\n }\n\n /** Disables repositioning of the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = null!;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, Injector, inject} from '@angular/core';\nimport {createBlockScrollStrategy} from './block-scroll-strategy';\nimport {CloseScrollStrategyConfig, createCloseScrollStrategy} from './close-scroll-strategy';\nimport {NoopScrollStrategy} from './noop-scroll-strategy';\nimport {\n createRepositionScrollStrategy,\n RepositionScrollStrategyConfig,\n} from './reposition-scroll-strategy';\n\n/**\n * Options for how an overlay will handle scrolling.\n *\n * Users can provide a custom value for `ScrollStrategyOptions` to replace the default\n * behaviors. This class primarily acts as a factory for ScrollStrategy instances.\n */\n@Injectable({providedIn: 'root'})\nexport class ScrollStrategyOptions {\n private _injector = inject(Injector);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /** Do nothing on scroll. */\n noop = () => new NoopScrollStrategy();\n\n /**\n * Close the overlay as soon as the user scrolls.\n * @param config Configuration to be used inside the scroll strategy.\n */\n close = (config?: CloseScrollStrategyConfig) => createCloseScrollStrategy(this._injector, config);\n\n /** Block scrolling. */\n block = () => createBlockScrollStrategy(this._injector);\n\n /**\n * Update the overlay's position on scroll.\n * @param config Configuration to be used inside the scroll strategy.\n * Allows debouncing the reposition calls.\n */\n reposition = (config?: RepositionScrollStrategyConfig) =>\n createRepositionScrollStrategy(this._injector, config);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {PositionStrategy} from './position/position-strategy';\nimport {Direction, Directionality} from '../bidi';\nimport {ScrollStrategy, NoopScrollStrategy} from './scroll/index';\n\n/** Initial configuration used when creating an overlay. */\nexport class OverlayConfig {\n /** Strategy with which to position the overlay. */\n positionStrategy?: PositionStrategy;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n scrollStrategy?: ScrollStrategy = new NoopScrollStrategy();\n\n /** Custom class to add to the overlay pane. */\n panelClass?: string | string[] = '';\n\n /** Whether the overlay has a backdrop. */\n hasBackdrop?: boolean = false;\n\n /** Custom class to add to the backdrop */\n backdropClass?: string | string[] = 'cdk-overlay-dark-backdrop';\n\n /** Whether to disable any built-in animations. */\n disableAnimations?: boolean;\n\n /** The width of the overlay panel. If a number is provided, pixel units are assumed. */\n width?: number | string;\n\n /** The height of the overlay panel. If a number is provided, pixel units are assumed. */\n height?: number | string;\n\n /** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */\n minWidth?: number | string;\n\n /** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */\n minHeight?: number | string;\n\n /** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */\n maxWidth?: number | string;\n\n /** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */\n maxHeight?: number | string;\n\n /**\n * Direction of the text in the overlay panel. If a `Directionality` instance\n * is passed in, the overlay will handle changes to its value automatically.\n */\n direction?: Direction | Directionality;\n\n /**\n * Whether the overlay should be disposed of when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n disposeOnNavigation?: boolean = false;\n\n /**\n * Whether the overlay should be rendered as a native popover element,\n * rather than placing it inside of the overlay container.\n */\n usePopover?: boolean;\n\n constructor(config?: OverlayConfig) {\n if (config) {\n // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,\n // loses the array generic type in the `for of`. But we *also* have to use `Array` because\n // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`\n const configKeys = Object.keys(config) as Iterable<keyof OverlayConfig> &\n (keyof OverlayConfig)[];\n for (const key of configKeys) {\n if (config[key] !== undefined) {\n // TypeScript, as of version 3.5, sees the left-hand-side of this expression\n // as \"I don't know *which* key this is, so the only valid value is the intersection\n // of all the possible values.\" In this case, that happens to be `undefined`. TypeScript\n // is not smart enough to see that the right-hand-side is actually an access of the same\n // exact type with the same exact key, meaning that the value type must be identical.\n // So we use `any` to work around this.\n this[key] = config[key] as any;\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Horizontal dimension of a connection point on the perimeter of the origin or overlay element. */\nexport type HorizontalConnectionPos = 'start' | 'center' | 'end';\n\n/** Vertical dimension of a connection point on the perimeter of the origin or overlay element. */\nexport type VerticalConnectionPos = 'top' | 'center' | 'bottom';\n\n/** The distance between the overlay element and the viewport. */\nexport type ViewportMargin = number | {top?: number; bottom?: number; start?: number; end?: number};\n\n/** A connection point on the origin element. */\nexport interface OriginConnectionPosition {\n originX: HorizontalConnectionPos;\n originY: VerticalConnectionPos;\n}\n\n/** A connection point on the overlay element. */\nexport interface OverlayConnectionPosition {\n overlayX: HorizontalConnectionPos;\n overlayY: VerticalConnectionPos;\n}\n\n/** The points of the origin element and the overlay element to connect. */\nexport class ConnectionPositionPair {\n /** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */\n originX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */\n originY: VerticalConnectionPos;\n /** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */\n overlayX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */\n overlayY: VerticalConnectionPos;\n\n constructor(\n origin: OriginConnectionPosition,\n overlay: OverlayConnectionPosition,\n /** Offset along the X axis. */\n public offsetX?: number,\n /** Offset along the Y axis. */\n public offsetY?: number,\n /** Class(es) to be applied to the panel while this position is active. */\n public panelClass?: string | string[],\n ) {\n this.originX = origin.originX;\n this.originY = origin.originY;\n this.overlayX = overlay.overlayX;\n this.overlayY = overlay.overlayY;\n }\n}\n\n/**\n * Set of properties regarding the position of the origin and overlay relative to the viewport\n * with respect to the containing Scrollable elements.\n *\n * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the\n * bounds of any one of the strategy's Scrollable's bounding client rectangle.\n *\n * The overlay and origin are outside view if there is no overlap between their bounding client\n * rectangle and any one of the strategy's Scrollable's bounding client rectangle.\n *\n * ----------- -----------\n * | outside | | clipped |\n * | view | --------------------------\n * | | | | | |\n * ---------- | ----------- |\n * -------------------------- | |\n * | | | Scrollable |\n * | | | |\n * | | --------------------------\n * | Scrollable |\n * | |\n * --------------------------\n *\n * @docs-private\n */\nexport class ScrollingVisibility {\n isOriginClipped: boolean = false;\n isOriginOutsideView: boolean = false;\n isOverlayClipped: boolean = false;\n isOverlayOutsideView: boolean = false;\n}\n\n/** The change event emitted by the strategy when a fallback position is used. */\nexport class ConnectedOverlayPositionChange {\n constructor(\n /** The position used as a result of this change. */\n public connectionPair: ConnectionPositionPair,\n /** @docs-private */\n public scrollableViewProperties: ScrollingVisibility,\n ) {}\n}\n\n/**\n * Validates whether a vertical position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateVerticalPosition(property: string, value: VerticalConnectionPos) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(\n `ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"top\", \"bottom\" or \"center\".`,\n );\n }\n}\n\n/**\n * Validates whether a horizontal position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateHorizontalPosition(property: string, value: HorizontalConnectionPos) {\n if (value !== 'start' && value !== 'end' && value !== 'center') {\n throw Error(\n `ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"start\", \"end\" or \"center\".`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, OnDestroy, inject, DOCUMENT} from '@angular/core';\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Service for dispatching events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport abstract class BaseOverlayDispatcher implements OnDestroy {\n /** Currently attached overlays in the order they were attached. */\n _attachedOverlays: OverlayRef[] = [];\n\n protected _document = inject(DOCUMENT);\n protected _isAttached = false;\n\n constructor(...args: unknown[]);\n\n constructor() {}\n\n ngOnDestroy(): void {\n this.detach();\n }\n\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef: OverlayRef): void {\n // Ensure that we don't get the same overlay multiple times.\n this.remove(overlayRef);\n this._attachedOverlays.push(overlayRef);\n }\n\n /** Remove an overlay from the list of attached overlay refs. */\n remove(overlayRef: OverlayRef): void {\n const index = this._attachedOverlays.indexOf(overlayRef);\n\n if (index > -1) {\n this._attachedOverlays.splice(index, 1);\n }\n\n // Remove the global listener once there are no more overlays.\n if (this._attachedOverlays.length === 0) {\n this.detach();\n }\n }\n\n /** Detaches the global event listener. */\n protected abstract detach(): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, NgZone, RendererFactory2, inject} from '@angular/core';\nimport {BaseOverlayDispatcher} from './base-overlay-dispatcher';\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Service for dispatching keyboard events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {\n private _ngZone = inject(NgZone);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n private _cleanupKeydown: (() => void) | undefined;\n\n /** Add a new overlay to the list of attached overlay refs. */\n override add(overlayRef: OverlayRef): void {\n super.add(overlayRef);\n\n // Lazily start dispatcher once first overlay is added\n if (!this._isAttached) {\n this._ngZone.runOutsideAngular(() => {\n this._cleanupKeydown = this._renderer.listen('body', 'keydown', this._keydownListener);\n });\n\n this._isAttached = true;\n }\n }\n\n /** Detaches the global keyboard event listener. */\n protected detach() {\n if (this._isAttached) {\n this._cleanupKeydown?.();\n this._isAttached = false;\n }\n }\n\n /** Keyboard event listener that will be attached to the body. */\n private _keydownListener = (event: KeyboardEvent) => {\n const overlays = this._attachedOverlays;\n\n for (let i = overlays.length - 1; i > -1; i--) {\n // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.\n // We want to target the most recent overlay, rather than trying to match where the event came\n // from, because some components might open an overlay, but keep focus on a trigger element\n // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,\n // because we don't want overlays that don't handle keyboard events to block the ones below\n // them that do.\n if (overlays[i]._keydownEvents.observers.length > 0) {\n this._ngZone.run(() => overlays[i]._keydownEvents.next(event));\n break;\n }\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, NgZone, RendererFactory2, inject} from '@angular/core';\nimport {Platform, _getEventTarget} from '../../platform';\nimport {BaseOverlayDispatcher} from './base-overlay-dispatcher';\nimport type {OverlayRef} from '../overlay-ref';\n\n/**\n * Service for dispatching mouse click events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {\n private _platform = inject(Platform);\n private _ngZone = inject(NgZone);\n private _renderer = inject(RendererFactory2).createRenderer(null, null);\n\n private _cursorOriginalValue!: string;\n private _cursorStyleIsSet = false;\n private _pointerDownEventTarget: HTMLElement | null = null;\n private _cleanups: (() => void)[] | undefined;\n\n /** Add a new overlay to the list of attached overlay refs. */\n override add(overlayRef: OverlayRef): void {\n super.add(overlayRef);\n\n // Safari on iOS does not generate click events for non-interactive\n // elements. However, we want to receive a click for any element outside\n // the overlay. We can force a \"clickable\" state by setting\n // `cursor: pointer` on the document body. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile\n // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html\n if (!this._isAttached) {\n const body = this._document.body;\n const eventOptions = {capture: true};\n const renderer = this._renderer;\n\n this._cleanups = this._ngZone.runOutsideAngular(() => [\n renderer.listen(body, 'pointerdown', this._pointerDownListener, eventOptions),\n renderer.listen(body, 'click', this._clickListener, eventOptions),\n renderer.listen(body, 'auxclick', this._clickListener, eventOptions),\n renderer.listen(body, 'contextmenu', this._clickListener, eventOptions),\n ]);\n\n // click event is not fired on iOS. To make element \"clickable\" we are\n // setting the cursor to pointer\n if (this._platform.IOS && !this._cursorStyleIsSet) {\n this._cursorOriginalValue = body.style.cursor;\n body.style.cursor = 'pointer';\n this._cursorStyleIsSet = true;\n }\n\n this._isAttached = true;\n }\n }\n\n /** Detaches the global keyboard event listener. */\n protected detach() {\n if (this._isAttached) {\n this._cleanups?.forEach(cleanup => cleanup());\n this._cleanups = undefined;\n if (this._platform.IOS && this._cursorStyleIsSet) {\n this._document.body.style.cursor = this._cursorOriginalValue;\n this._cursorStyleIsSet = false;\n }\n this._isAttached = false;\n }\n }\n\n /** Store pointerdown event target to track origin of click. */\n private _pointerDownListener = (event: PointerEvent) => {\n this._pointerDownEventTarget = _getEventTarget<HTMLElement>(event);\n };\n\n /** Click event listener that will be attached to the body propagate phase. */\n private _clickListener = (event: MouseEvent) => {\n const target = _getEventTarget<HTMLElement>(event);\n // In case of a click event, we want to check the origin of the click\n // (e.g. in case where a user starts a click inside the overlay and\n // releases the click outside of it).\n // This is done by using the event target of the preceding pointerdown event.\n // Every click event caused by a pointer device has a preceding pointerdown\n // event, unless the click was programmatically triggered (e.g. in a unit test).\n const origin =\n event.type === 'click' && this._pointerDownEventTarget\n ? this._pointerDownEventTarget\n : target;\n // Reset the stored pointerdown event target, to avoid having it interfere\n // in subsequent events.\n this._pointerDownEventTarget = null;\n\n // We copy the array because the original may be modified asynchronously if the\n // outsidePointerEvents listener decides to detach overlays resulting in index errors inside\n // the for loop.\n const overlays = this._attachedOverlays.slice();\n\n // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.\n // We want to target all overlays for which the click could be considered as outside click.\n // As soon as we reach an overlay for which the click is not outside click we break off\n // the loop.\n for (let i = overlays.length - 1; i > -1; i--) {\n const overlayRef = overlays[i];\n if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {\n continue;\n }\n\n // If it's a click inside the overlay, just break - we should do nothing\n // If it's an outside click (both origin and target of the click) dispatch the mouse event,\n // and proceed with the next overlay\n if (\n containsPierceShadowDom(overlayRef.overlayElement, target) ||\n containsPierceShadowDom(overlayRef.overlayElement, origin)\n ) {\n break;\n }\n\n const outsidePointerEvents = overlayRef._outsidePointerEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => outsidePointerEvents.next(event));\n } else {\n outsidePointerEvents.next(event);\n }\n }\n };\n}\n\n/** Version of `Element.contains` that transcends shadow DOM boundaries. */\nfunction containsPierceShadowDom(parent: HTMLElement, child: HTMLElement | null): boolean {\n const supportsShadowRoot = typeof ShadowRoot !== 'undefined' && ShadowRoot;\n let current: Node | null = child;\n\n while (current) {\n if (current === parent) {\n return true;\n }\n\n current =\n supportsShadowRoot && current instanceof ShadowRoot ? current.host : current.parentNode;\n }\n\n return false;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Injectable,\n OnDestroy,\n Component,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n inject,\n DOCUMENT,\n} from '@angular/core';\nimport {_CdkPrivateStyleLoader} from '../private';\nimport {Platform, _isTestEnvironment} from '../platform';\n\n@Component({\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrl: 'overlay-structure.css',\n host: {'cdk-overlay-style-loader': ''},\n})\nexport class _CdkOverlayStyleLoader {}\n\n/** Container inside which all overlays will render. */\n@Injectable({providedIn: 'root'})\nexport class OverlayContainer implements OnDestroy {\n protected _platform = inject(Platform);\n\n protected _containerElement: HTMLElement | undefined;\n protected _document = inject(DOCUMENT);\n protected _styleLoader = inject(_CdkPrivateStyleLoader);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n ngOnDestroy() {\n this._containerElement?.remove();\n }\n\n /**\n * This method returns the overlay container element. It will lazily\n * create the element the first time it is called to facilitate using\n * the container in non-browser environments.\n * @returns the container element\n */\n getContainerElement(): HTMLElement {\n this._loadStyles();\n\n if (!this._containerElement) {\n this._createContainer();\n }\n\n return this._containerElement!;\n }\n\n /**\n * Create the overlay container element, which is simply a div\n * with the 'cdk-overlay-container' class on the document body.\n */\n protected _createContainer(): void {\n const containerClass = 'cdk-overlay-container';\n\n // TODO(crisbeto): remove the testing check once we have an overlay testing\n // module or Angular starts tearing down the testing `NgModule`. See:\n // https://github.com/angular/angular/issues/18831\n if (this._platform.isBrowser || _isTestEnvironment()) {\n const oppositePlatformContainers = this._document.querySelectorAll(\n `.${containerClass}[platform=\"server\"], ` + `.${containerClass}[platform=\"test\"]`,\n );\n\n // Remove any old containers from the opposite platform.\n // This can happen when transitioning from the server to the client.\n for (let i = 0; i < oppositePlatformContainers.length; i++) {\n oppositePlatformContainers[i].remove();\n }\n }\n\n const container = this._document.createElement('div');\n container.classList.add(containerClass);\n\n // A long time ago we kept adding new overlay containers whenever a new app was instantiated,\n // but at some point we added logic which clears the duplicate ones in order to avoid leaks.\n // The new logic was a little too aggressive since it was breaking some legitimate use cases.\n // To mitigate the problem we made it so that only containers from a different platform are\n // cleared, but the side-effect was that people started depending on the overly-aggressive\n // logic to clean up their tests for them. Until we can introduce an overlay-specific testing\n // module which does the cleanup, we try to detect that we're in a test environment and we\n // always clear the container. See #17006.\n // TODO(crisbeto): remove the test environment check once we have an overlay testing module.\n if (_isTestEnvironment()) {\n container.setAttribute('platform', 'test');\n } else if (!this._platform.isBrowser) {\n container.setAttribute('platform', 'server');\n }\n\n this._document.body.appendChild(container);\n this._containerElement = container;\n }\n\n /** Loads the structural styles necessary for the overlay to work. */\n protected _loadStyles(): void {\n this._styleLoader.load(_CdkOverlayStyleLoader);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgZone, Renderer2} from '@angular/core';\n\n/** Encapsulates the logic for attaching and detaching a backdrop. */\nexport class BackdropRef {\n readonly element: HTMLElement;\n private _cleanupClick: (() => void) | undefined;\n private _cleanupTransitionEnd: (() => void) | undefined;\n private _fallbackTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor(\n document: Document,\n private _renderer: Renderer2,\n private _ngZone: NgZone,\n onClick: (event: MouseEvent) => void,\n ) {\n this.element = document.createElement('div');\n this.element.classList.add('cdk-overlay-backdrop');\n this._cleanupClick = _renderer.listen(this.element, 'click', onClick);\n }\n\n detach() {\n this._ngZone.runOutsideAngular(() => {\n const element = this.element;\n clearTimeout(this._fallbackTimeout);\n this._cleanupTransitionEnd?.();\n this._cleanupTransitionEnd = this._renderer.listen(element, 'transitionend', this.dispose);\n this._fallbackTimeout = setTimeout(this.dispose, 500);\n\n // If the backdrop doesn't have a transition, the `transitionend` event won't fire.\n // In this case we make it unclickable and we try to remove it after a delay.\n element.style.pointerEvents = 'none';\n element.classList.remove('cdk-overlay-backdrop-showing');\n });\n }\n\n dispose = () => {\n clearTimeout(this._fallbackTimeout);\n this._cleanupClick?.();\n this._cleanupTransitionEnd?.();\n this._cleanupClick = this._cleanupTransitionEnd = this._fallbackTimeout = undefined;\n this.element.remove();\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {\n AfterRenderRef,\n ComponentRef,\n EmbeddedViewRef,\n EnvironmentInjector,\n NgZone,\n Renderer2,\n afterNextRender,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, SubscriptionLike} from 'rxjs';\nimport {Direction, Directionality} from '../bidi';\nimport {coerceArray, coerceCssPixelValue} from '../coercion';\nimport {ComponentPortal, Portal, PortalOutlet, TemplatePortal} from '../portal';\nimport {BackdropRef} from './backdrop-ref';\nimport {OverlayKeyboardDispatcher} from './dispatchers/overlay-keyboard-dispatcher';\nimport {OverlayOutsideClickDispatcher} from './dispatchers/overlay-outside-click-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {PositionStrategy} from './position/position-strategy';\nimport {ScrollStrategy} from './scroll';\n\n/** An object where all of its properties cannot be written. */\nexport type ImmutableObject<T> = {\n readonly [P in keyof T]: T[P];\n};\n\n/** Checks if a value is an element. */\nexport function isElement(value: any): value is Element {\n return value && (value as Element).nodeType === 1;\n}\n\n/**\n * Reference to an overlay that has been created with the Overlay service.\n * Used to manipulate or dispose of said overlay.\n */\nexport class OverlayRef implements PortalOutlet {\n private readonly _backdropClick = new Subject<MouseEvent>();\n private readonly _attachments = new Subject<void>();\n private readonly _detachments = new Subject<void>();\n private _positionStrategy: PositionStrategy | undefined;\n private _scrollStrategy: ScrollStrategy | undefined;\n private _locationChanges: SubscriptionLike = Subscription.EMPTY;\n private _backdropRef: BackdropRef | null = null;\n private _detachContentMutationObserver: MutationObserver | undefined;\n private _detachContentAfterRenderRef: AfterRenderRef | undefined;\n private _disposed = false;\n\n /**\n * Reference to the parent of the `_host` at the time it was detached. Used to restore\n * the `_host` to its original position in the DOM when it gets re-attached.\n */\n private _previousHostParent!: HTMLElement;\n\n /** Stream of keydown events dispatched to this overlay. */\n readonly _keydownEvents = new Subject<KeyboardEvent>();\n\n /** Stream of mouse outside events dispatched to this overlay. */\n readonly _outsidePointerEvents = new Subject<MouseEvent>();\n\n /** Reference to the currently-running `afterNextRender` call. */\n private _afterNextRenderRef: AfterRenderRef | undefined;\n\n constructor(\n private _portalOutlet: PortalOutlet,\n private _host: HTMLElement,\n private _pane: HTMLElement,\n private _config: ImmutableObject<OverlayConfig>,\n private _ngZone: NgZone,\n private _keyboardDispatcher: OverlayKeyboardDispatcher,\n private _document: Document,\n private _location: Location,\n private _outsideClickDispatcher: OverlayOutsideClickDispatcher,\n private _animationsDisabled = false,\n private _injector: EnvironmentInjector,\n private _renderer: Renderer2,\n ) {\n if (_config.scrollStrategy) {\n this._scrollStrategy = _config.scrollStrategy;\n this._scrollStrategy.attach(this);\n }\n\n this._positionStrategy = _config.positionStrategy;\n }\n\n /** The overlay's HTML element */\n get overlayElement(): HTMLElement {\n return this._pane;\n }\n\n /** The overlay's backdrop HTML element. */\n get backdropElement(): HTMLElement | null {\n return this._backdropRef?.element || null;\n }\n\n /**\n * Wrapper around the panel element. Can be used for advanced\n * positioning where a wrapper with specific styling is\n * required around the overlay pane.\n */\n get hostElement(): HTMLElement {\n return this._host;\n }\n\n attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;\n attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;\n attach(portal: any): any;\n\n /**\n * Attaches content, given via a Portal, to the overlay.\n * If the overlay is configured to have a backdrop, it will be created.\n *\n * @param portal Portal instance to which to attach the overlay.\n * @returns The portal attachment result.\n */\n attach(portal: Portal<any>): any {\n if (this._disposed) {\n return null;\n }\n\n // Insert the host into the DOM before attaching the portal, otherwise\n // the animations module will skip animations on repeat attachments.\n this._attachHost();\n\n const attachResult = this._portalOutlet.attach(portal);\n this._positionStrategy?.attach(this);\n this._updateStackingOrder();\n this._updateElementSize();\n this._updateElementDirection();\n\n if (this._scrollStrategy) {\n this._scrollStrategy.enable();\n }\n\n // We need to clean this up ourselves, because we're passing in an\n // `EnvironmentInjector` below which won't ever be destroyed.\n // Otherwise it causes some callbacks to be retained (see #29696).\n this._afterNextRenderRef?.destroy();\n\n // Update the position once the overlay is fully rendered before attempting to position it,\n // as the position may depend on the size of the rendered content.\n this._afterNextRenderRef = afterNextRender(\n () => {\n // The overlay could've been detached before the callback executed.\n if (this.hasAttached()) {\n this.updatePosition();\n }\n },\n {injector: this._injector},\n );\n\n // Enable pointer events for the overlay pane element.\n this._togglePointerEvents(true);\n\n if (this._config.hasBackdrop) {\n this._attachBackdrop();\n }\n\n if (this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, true);\n }\n\n // Only emit the `attachments` event once all other setup is done.\n this._attachments.next();\n this._completeDetachContent();\n\n // Track this overlay by the keyboard dispatcher\n this._keyboardDispatcher.add(this);\n\n if (this._config.disposeOnNavigation) {\n this._locationChanges = this._location.subscribe(() => this.dispose());\n }\n\n this._outsideClickDispatcher.add(this);\n\n // TODO(crisbeto): the null check is here, because the portal outlet returns `any`.\n // We should be guaranteed for the result to be `ComponentRef | EmbeddedViewRef`, but\n // `instanceof EmbeddedViewRef` doesn't appear to work at the moment.\n if (typeof attachResult?.onDestroy === 'function') {\n // In most cases we control the portal and we know when it is being detached so that\n // we can finish the disposal process. The exception is if the user passes in a custom\n // `ViewContainerRef` that isn't destroyed through the overlay API. Note that we use\n // `detach` here instead of `dispose`, because we don't know if the user intends to\n // reattach the overlay at a later point. It also has the advantage of waiting for animations.\n attachResult.onDestroy(() => {\n if (this.hasAttached()) {\n // We have to delay the `detach` call, because detaching immediately prevents\n // other destroy hooks from running. This is likely a framework bug similar to\n // https://github.com/angular/angular/issues/46119\n this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));\n }\n });\n }\n\n return attachResult;\n }\n\n /**\n * Detaches an overlay from a portal.\n * @returns The portal detachment result.\n */\n detach(): any {\n if (!this.hasAttached()) {\n return;\n }\n\n this.detachBackdrop();\n\n // When the overlay is detached, the pane element should disable pointer events.\n // This is necessary because otherwise the pane element will cover the page and disable\n // pointer events therefore. Depends on the position strategy and the applied pane boundaries.\n this._togglePointerEvents(false);\n\n if (this._positionStrategy && this._positionStrategy.detach) {\n this._positionStrategy.detach();\n }\n\n if (this._scrollStrategy) {\n this._scrollStrategy.disable();\n }\n\n const detachmentResult = this._portalOutlet.detach();\n\n // Only emit after everything is detached.\n this._detachments.next();\n this._completeDetachContent();\n\n // Remove this overlay from keyboard dispatcher tracking.\n this._keyboardDispatcher.remove(this);\n\n // Keeping the host element in the DOM can cause scroll jank, because it still gets\n // rendered, even though it's transparent and unclickable which is why we remove it.\n this._detachContentWhenEmpty();\n this._locationChanges.unsubscribe();\n this._outsideClickDispatcher.remove(this);\n return detachmentResult;\n }\n\n /** Cleans up the overlay from the DOM. */\n dispose(): void {\n if (this._disposed) {\n return;\n }\n\n const isAttached = this.hasAttached();\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._disposeScrollStrategy();\n this._backdropRef?.dispose();\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n this._outsideClickDispatcher.remove(this);\n this._host?.remove();\n this._afterNextRenderRef?.destroy();\n this._previousHostParent = this._pane = this._host = this._backdropRef = null!;\n\n if (isAttached) {\n this._detachments.next();\n }\n\n this._detachments.complete();\n this._completeDetachContent();\n this._disposed = true;\n }\n\n /** Whether the overlay has attached content. */\n hasAttached(): boolean {\n return this._portalOutlet.hasAttached();\n }\n\n /** Gets an observable that emits when the backdrop has been clicked. */\n backdropClick(): Observable<MouseEvent> {\n return this._backdropClick;\n }\n\n /** Gets an observable that emits when the overlay has been attached. */\n attachments(): Observable<void> {\n return this._attachments;\n }\n\n /** Gets an observable that emits when the overlay has been detached. */\n detachments(): Observable<void> {\n return this._detachments;\n }\n\n /** Gets an observable of keydown events targeted to this overlay. */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._keydownEvents;\n }\n\n /** Gets an observable of pointer events targeted outside this overlay. */\n outsidePointerEvents(): Observable<MouseEvent> {\n return this._outsidePointerEvents;\n }\n\n /** Gets the current overlay configuration, which is immutable. */\n getConfig(): OverlayConfig {\n return this._config;\n }\n\n /** Updates the position of the overlay based on the position strategy. */\n updatePosition(): void {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }\n\n /** Switches to a new position strategy and updates the overlay position. */\n updatePositionStrategy(strategy: PositionStrategy): void {\n if (strategy === this._positionStrategy) {\n return;\n }\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._positionStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n this.updatePosition();\n }\n }\n\n /** Update the size properties of the overlay. */\n updateSize(sizeConfig: OverlaySizeConfig): void {\n this._config = {...this._config, ...sizeConfig};\n this._updateElementSize();\n }\n\n /** Sets the LTR/RTL direction for the overlay. */\n setDirection(dir: Direction | Directionality): void {\n this._config = {...this._config, direction: dir};\n this._updateElementDirection();\n }\n\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }\n\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }\n\n /**\n * Returns the layout direction of the overlay panel.\n */\n getDirection(): Direction {\n const direction = this._config.direction;\n\n if (!direction) {\n return 'ltr';\n }\n\n return typeof direction === 'string' ? direction : direction.value;\n }\n\n /** Switches to a new scroll strategy. */\n updateScrollStrategy(strategy: ScrollStrategy): void {\n if (strategy === this._scrollStrategy) {\n return;\n }\n\n this._disposeScrollStrategy();\n this._scrollStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n strategy.enable();\n }\n }\n\n /** Updates the text direction of the overlay panel. */\n private _updateElementDirection() {\n this._host.setAttribute('dir', this.getDirection());\n }\n\n /** Updates the size of the overlay element based on the overlay config. */\n private _updateElementSize() {\n if (!this._pane) {\n return;\n }\n\n const style = this._pane.style;\n\n style.width = coerceCssPixelValue(this._config.width);\n style.height = coerceCssPixelValue(this._config.height);\n style.minWidth = coerceCssPixelValue(this._config.minWidth);\n style.minHeight = coerceCssPixelValue(this._config.minHeight);\n style.maxWidth = coerceCssPixelValue(this._config.maxWidth);\n style.maxHeight = coerceCssPixelValue(this._config.maxHeight);\n }\n\n /** Toggles the pointer events for the overlay pane element. */\n private _togglePointerEvents(enablePointer: boolean) {\n this._pane.style.pointerEvents = enablePointer ? '' : 'none';\n }\n\n private _attachHost() {\n if (!this._host.parentElement) {\n const customInsertionPoint = this._config.usePopover\n ? this._positionStrategy?.getPopoverInsertionPoint?.()\n : null;\n\n if (isElement(customInsertionPoint)) {\n customInsertionPoint.after(this._host);\n } else if (customInsertionPoint?.type === 'parent') {\n customInsertionPoint.element.appendChild(this._host);\n } else {\n this._previousHostParent?.appendChild(this._host);\n }\n }\n\n if (this._config.usePopover) {\n // We need the try/catch because the browser will throw if the\n // host or any of the parents are outside the DOM. Also note\n // the string access which is there for compatibility with Closure.\n try {\n this._host['showPopover']();\n } catch {}\n }\n }\n\n /** Attaches a backdrop for this overlay. */\n private _attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n\n this._backdropRef?.dispose();\n this._backdropRef = new BackdropRef(this._document, this._renderer, this._ngZone, event => {\n this._backdropClick.next(event);\n });\n\n if (this._animationsDisabled) {\n this._backdropRef.element.classList.add('cdk-overlay-backdrop-noop-animation');\n }\n\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropRef.element, this._config.backdropClass, true);\n }\n\n if (this._config.usePopover) {\n // When using popovers, the backdrop needs to be inside the popover.\n this._host.prepend(this._backdropRef.element);\n } else {\n // Insert the backdrop before the pane in the DOM order,\n // in order to handle stacked overlays properly.\n this._host.parentElement!.insertBefore(this._backdropRef.element, this._host);\n }\n\n // Add class to fade-in the backdrop after one frame.\n if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this._backdropRef?.element.classList.add(showingClass));\n });\n } else {\n this._backdropRef.element.classList.add(showingClass);\n }\n }\n\n /**\n * Updates the stacking order of the element, moving it to the top if necessary.\n * This is required in cases where one overlay was detached, while another one,\n * that should be behind it, was destroyed. The next time both of them are opened,\n * the stacking will be wrong, because the detached element's pane will still be\n * in its original DOM position.\n */\n private _updateStackingOrder() {\n if (!this._config.usePopover && this._host.nextSibling) {\n this._host.parentNode!.appendChild(this._host);\n }\n }\n\n /** Detaches the backdrop (if any) associated with the overlay. */\n detachBackdrop(): void {\n if (this._animationsDisabled) {\n this._backdropRef?.dispose();\n this._backdropRef = null;\n } else {\n this._backdropRef?.detach();\n }\n }\n\n /** Toggles a single CSS class or an array of classes on an element. */\n private _toggleClasses(element: HTMLElement, cssClasses: string | string[], isAdd: boolean) {\n const classes = coerceArray(cssClasses || []).filter(c => !!c);\n\n if (classes.length) {\n isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);\n }\n }\n\n /** Detaches the overlay once the content finishes animating and is removed from the DOM. */\n private _detachContentWhenEmpty() {\n let rethrow = false;\n // Attempt to detach on the next render.\n try {\n this._detachContentAfterRenderRef = afterNextRender(\n () => {\n // Rethrow if we encounter an actual error detaching.\n rethrow = true;\n this._detachContent();\n },\n {\n injector: this._injector,\n },\n );\n } catch (e) {\n if (rethrow) {\n throw e;\n }\n // afterNextRender throws if the EnvironmentInjector is has already been destroyed.\n // This may happen in tests that don't properly flush all async work.\n // In order to avoid breaking those tests, we just detach immediately in this case.\n this._detachContent();\n }\n // Otherwise wait until the content finishes animating out and detach.\n if (globalThis.MutationObserver && this._pane) {\n this._detachContentMutationObserver ||= new globalThis.MutationObserver(() => {\n this._detachContent();\n });\n this._detachContentMutationObserver.observe(this._pane, {childList: true});\n }\n }\n\n private _detachContent() {\n // Needs a couple of checks for the pane and host, because\n // they may have been removed by the time the zone stabilizes.\n if (!this._pane || !this._host || this._pane.children.length === 0) {\n if (this._pane && this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, false);\n }\n\n if (this._host && this._host.parentElement) {\n this._previousHostParent = this._host.parentElement;\n this._host.remove();\n }\n\n this._completeDetachContent();\n }\n }\n\n private _completeDetachContent() {\n this._detachContentAfterRenderRef?.destroy();\n this._detachContentAfterRenderRef = undefined;\n this._detachContentMutationObserver?.disconnect();\n }\n\n /** Disposes of a scroll strategy. */\n private _disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n scrollStrategy?.disable();\n scrollStrategy?.detach?.();\n }\n}\n\n/** Size properties for an overlay. */\nexport interface OverlaySizeConfig {\n width?: number | string;\n height?: number | string;\n minWidth?: number | string;\n minHeight?: number | string;\n maxWidth?: number | string;\n maxHeight?: number | string;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {PositionStrategy} from './position-strategy';\nimport {DOCUMENT, ElementRef, Injector} from '@angular/core';\nimport {ViewportRuler, CdkScrollable, ViewportScrollPosition} from '../../scrolling';\nimport {\n ConnectedOverlayPositionChange,\n ConnectionPositionPair,\n ScrollingVisibility,\n validateHorizontalPosition,\n validateVerticalPosition,\n ViewportMargin,\n} from './connected-position';\nimport {Observable, Subscription, Subject} from 'rxjs';\nimport {isElementScrolledOutsideView, isElementClippedByScrolling} from './scroll-clip';\nimport {coerceCssPixelValue, coerceArray} from '../../coercion';\nimport {Platform} from '../../platform';\nimport {OverlayContainer} from '../overlay-container';\nimport {isElement, OverlayRef} from '../overlay-ref';\n\n// TODO: refactor clipping detection into a separate thing (part of scrolling module)\n// TODO: doesn't handle both flexible width and height when it has to scroll along both axis.\n\n/** Class to be added to the overlay bounding box. */\nconst boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */\nexport type FlexibleConnectedPositionStrategyOrigin =\n | ElementRef\n | Element\n | (Point & {\n width?: number;\n height?: number;\n });\n\n/** Equivalent of `DOMRect` without some of the properties we don't care about. */\ntype Dimensions = Omit<DOMRect, 'x' | 'y' | 'toJSON'>;\n\n/**\n * Creates a flexible position strategy.\n * @param injector Injector used to resolve dependnecies for the position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\nexport function createFlexibleConnectedPositionStrategy(\n injector: Injector,\n origin: FlexibleConnectedPositionStrategyOrigin,\n): FlexibleConnectedPositionStrategy {\n return new FlexibleConnectedPositionStrategy(\n origin,\n injector.get(ViewportRuler),\n injector.get(DOCUMENT),\n injector.get(Platform),\n injector.get(OverlayContainer),\n );\n}\n\n/** Supported locations in the DOM for connected overlays. */\nexport type FlexibleOverlayPopoverLocation =\n | 'global'\n | 'inline'\n | {type: 'parent'; element: Element};\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * implicit position relative some origin element. The relative position is defined in terms of\n * a point on the origin element that is connected to a point on the overlay element. For example,\n * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner\n * of the overlay.\n */\nexport class FlexibleConnectedPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef!: OverlayRef;\n\n /** Whether we're performing the very first positioning of the overlay. */\n private _isInitialRender = false;\n\n /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */\n private _lastBoundingBoxSize = {width: 0, height: 0};\n\n /** Whether the overlay was pushed in a previous positioning. */\n private _isPushed = false;\n\n /** Whether the overlay can be pushed on-screen on the initial open. */\n private _canPush = true;\n\n /** Whether the overlay can grow via flexible width/height after the initial open. */\n private _growAfterOpen = false;\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n private _hasFlexibleDimensions = true;\n\n /** Whether the overlay position is locked. */\n private _positionLocked = false;\n\n /** Cached origin dimensions */\n private _originRect!: Dimensions;\n\n /** Cached overlay dimensions */\n private _overlayRect!: Dimensions;\n\n /** Cached viewport dimensions */\n private _viewportRect!: Dimensions;\n\n /** Cached container dimensions */\n private _containerRect!: Dimensions;\n\n /** Amount of space that must be maintained between the overlay and the right edge of the viewport. */\n private _viewportMargin: ViewportMargin = 0;\n\n /** The Scrollable containers used to check scrollable view properties on position change. */\n private _scrollables: CdkScrollable[] = [];\n\n /** Ordered list of preferred positions, from most to least desirable. */\n _preferredPositions: ConnectionPositionPair[] = [];\n\n /** The origin element against which the overlay will be positioned. */\n _origin!: FlexibleConnectedPositionStrategyOrigin;\n\n /** The overlay pane element. */\n private _pane!: HTMLElement;\n\n /** Whether the strategy has been disposed of already. */\n private _isDisposed = false;\n\n /**\n * Parent element for the overlay panel used to constrain the overlay panel's size to fit\n * within the viewport.\n */\n private _boundingBox: HTMLElement | null = null;\n\n /** The last position to have been calculated as the best fit position. */\n private _lastPosition: ConnectedPosition | null = null;\n\n /** The last calculated scroll visibility. Only tracked */\n private _lastScrollVisibility: ScrollingVisibility | null = null;\n\n /** Subject that emits whenever the position changes. */\n private readonly _positionChanges = new Subject<ConnectedOverlayPositionChange>();\n\n /** Subscription to viewport size changes. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /** Default offset for the overlay along the x axis. */\n private _offsetX = 0;\n\n /** Default offset for the overlay along the y axis. */\n private _offsetY = 0;\n\n /** Selector to be used when finding the elements on which to set the transform origin. */\n private _transformOriginSelector!: string;\n\n /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */\n private _appliedPanelClasses: string[] = [];\n\n /** Amount by which the overlay was pushed in each axis during the last time it was positioned. */\n private _previousPushAmount: {x: number; y: number} | null = null;\n\n /** Configures where in the DOM to insert the overlay when popovers are enabled. */\n private _popoverLocation: FlexibleOverlayPopoverLocation = 'global';\n\n /** Observable sequence of position changes. */\n positionChanges: Observable<ConnectedOverlayPositionChange> = this._positionChanges;\n\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions(): ConnectionPositionPair[] {\n return this._preferredPositions;\n }\n\n constructor(\n connectedTo: FlexibleConnectedPositionStrategyOrigin,\n private _viewportRuler: ViewportRuler,\n private _document: Document,\n private _platform: Platform,\n private _overlayContainer: OverlayContainer,\n ) {\n this.setOrigin(connectedTo);\n }\n\n /** Attaches this position strategy to an overlay. */\n attach(overlayRef: OverlayRef): void {\n if (\n this._overlayRef &&\n overlayRef !== this._overlayRef &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw Error('This position strategy is already attached to an overlay');\n }\n\n this._validatePositions();\n\n overlayRef.hostElement.classList.add(boundingBoxClass);\n\n this._overlayRef = overlayRef;\n this._boundingBox = overlayRef.hostElement;\n this._pane = overlayRef.overlayElement;\n this._isDisposed = false;\n this._isInitialRender = true;\n this._lastPosition = null;\n this._resizeSubscription.unsubscribe();\n this._resizeSubscription = this._viewportRuler.change().subscribe(() => {\n // When the window is resized, we want to trigger the next reposition as if it\n // was an initial render, in order for the strategy to pick a new optimal position,\n // otherwise position locking will cause it to stay at the old one.\n this._isInitialRender = true;\n this.apply();\n });\n }\n\n /**\n * Updates the position of the overlay element, using whichever preferred position relative\n * to the origin best fits on-screen.\n *\n * The selection of a position goes as follows:\n * - If any positions fit completely within the viewport as-is,\n * choose the first position that does so.\n * - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,\n * choose the position with the greatest available size modified by the positions' weight.\n * - If pushing is enabled, take the position that went off-screen the least and push it\n * on-screen.\n * - If none of the previous criteria were met, use the position that goes off-screen the least.\n * @docs-private\n */\n apply(): void {\n // We shouldn't do anything if the strategy was disposed or we're on the server.\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n\n // If the position has been applied already (e.g. when the overlay was opened) and the\n // consumer opted into locking in the position, re-use the old position, in order to\n // prevent the overlay from jumping around.\n if (!this._isInitialRender && this._positionLocked && this._lastPosition) {\n this.reapplyLastPosition();\n return;\n }\n\n this._clearPanelClasses();\n this._resetOverlayElementStyles();\n this._resetBoundingBoxStyles();\n\n // We need the bounding rects for the origin, the overlay and the container to determine how to position\n // the overlay relative to the origin.\n // We use the viewport rect to determine whether a position would go off-screen.\n this._viewportRect = this._getNarrowedViewportRect();\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._containerRect = this._getContainerRect();\n\n const originRect = this._originRect;\n const overlayRect = this._overlayRect;\n const viewportRect = this._viewportRect;\n const containerRect = this._containerRect;\n\n // Positions where the overlay will fit with flexible dimensions.\n const flexibleFits: FlexibleFit[] = [];\n\n // Fallback if none of the preferred positions fit within the viewport.\n let fallback: FallbackPosition | undefined;\n\n // Go through each of the preferred positions looking for a good fit.\n // If a good fit is found, it will be applied immediately.\n for (let pos of this._preferredPositions) {\n // Get the exact (x, y) coordinate for the point-of-origin on the origin element.\n let originPoint = this._getOriginPoint(originRect, containerRect, pos);\n\n // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the\n // overlay in this position. We use the top-left corner for calculations and later translate\n // this into an appropriate (top, left, bottom, right) style.\n let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);\n\n // Calculate how well the overlay would fit into the viewport with this point.\n let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);\n\n // If the overlay, without any further work, fits into the viewport, use this position.\n if (overlayFit.isCompletelyWithinViewport) {\n this._isPushed = false;\n this._applyPosition(pos, originPoint);\n return;\n }\n\n // If the overlay has flexible dimensions, we can use this position\n // so long as there's enough space for the minimum dimensions.\n if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {\n // Save positions where the overlay will fit with flexible dimensions. We will use these\n // if none of the positions fit *without* flexible dimensions.\n flexibleFits.push({\n position: pos,\n origin: originPoint,\n overlayRect,\n boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos),\n });\n\n continue;\n }\n\n // If the current preferred position does not fit on the screen, remember the position\n // if it has more visible area on-screen than we've seen and move onto the next preferred\n // position.\n if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {\n fallback = {overlayFit, overlayPoint, originPoint, position: pos, overlayRect};\n }\n }\n\n // If there are any positions where the overlay would fit with flexible dimensions, choose the\n // one that has the greatest area available modified by the position's weight\n if (flexibleFits.length) {\n let bestFit: FlexibleFit | null = null;\n let bestScore = -1;\n for (const fit of flexibleFits) {\n const score =\n fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);\n if (score > bestScore) {\n bestScore = score;\n bestFit = fit;\n }\n }\n\n this._isPushed = false;\n this._applyPosition(bestFit!.position, bestFit!.origin);\n return;\n }\n\n // When none of the preferred positions fit within the viewport, take the position\n // that went off-screen the least and attempt to push it on-screen.\n if (this._canPush) {\n // TODO(jelbourn): after pushing, the opening \"direction\" of the overlay might not make sense.\n this._isPushed = true;\n this._applyPosition(fallback!.position, fallback!.originPoint);\n return;\n }\n\n // All options for getting the overlay within the viewport have been exhausted, so go with the\n // position that went off-screen the least.\n this._applyPosition(fallback!.position, fallback!.originPoint);\n }\n\n detach(): void {\n this._clearPanelClasses();\n this._lastPosition = null;\n this._previousPushAmount = null;\n this._resizeSubscription.unsubscribe();\n }\n\n /** Cleanup after the element gets destroyed. */\n dispose(): void {\n if (this._isDisposed) {\n return;\n }\n\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null!;\n this._isDisposed = true;\n }\n\n /**\n * This re-aligns the overlay element with the trigger in its last calculated position,\n * even if a position higher in the \"preferred positions\" list would now fit. This\n * allows one to re-align the panel without changing the orientation of the panel.\n */\n reapplyLastPosition(): void {\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n\n const lastPosition = this._lastPosition;\n\n if (lastPosition) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n this._containerRect = this._getContainerRect();\n this._applyPosition(\n lastPosition,\n this._getOriginPoint(this._originRect, this._containerRect, lastPosition),\n );\n } else {\n this.apply();\n }\n }\n\n /**\n * Sets the list of Scrollable containers that host the origin element so that\n * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every\n * Scrollable must be an ancestor element of the strategy's origin element.\n */\n withScrollableContainers(scrollables: CdkScrollable[]): this {\n this._scrollables = scrollables;\n return this;\n }\n\n /**\n * Adds new preferred positions.\n * @param positions List of positions options for this overlay.\n */\n withPositions(positions: ConnectedPosition[]): this {\n this._preferredPositions = positions;\n\n // If the last calculated position object isn't part of the positions anymore, clear\n // it in order to avoid it being picked up if the consumer tries to re-apply.\n if (positions.indexOf(this._lastPosition!) === -1) {\n this._lastPosition = null;\n }\n\n this._validatePositions();\n\n return this;\n }\n\n /**\n * Sets a minimum distance the overlay may be positioned from the bottom edge of the viewport.\n * @param margin Required margin between the overlay and the viewport.\n * It can be a number to be applied to all directions, or an object to supply different values for each direction.\n */\n withViewportMargin(margin: ViewportMargin): this {\n this._viewportMargin = margin;\n return this;\n }\n\n /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */\n withFlexibleDimensions(flexibleDimensions = true): this {\n this._hasFlexibleDimensions = flexibleDimensions;\n return this;\n }\n\n /** Sets whether the overlay can grow after the initial open via flexible width/height. */\n withGrowAfterOpen(growAfterOpen = true): this {\n this._growAfterOpen = growAfterOpen;\n return this;\n }\n\n /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */\n withPush(canPush = true): this {\n this._canPush = canPush;\n return this;\n }\n\n /**\n * Sets whether the overlay's position should be locked in after it is positioned\n * initially. When an overlay is locked in, it won't attempt to reposition itself\n * when the position is re-applied (e.g. when the user scrolls away).\n * @param isLocked Whether the overlay should locked in.\n */\n withLockedPosition(isLocked = true): this {\n this._positionLocked = isLocked;\n return this;\n }\n\n /**\n * Sets the origin, relative to which to position the overlay.\n * Using an element origin is useful for building components that need to be positioned\n * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be\n * used for cases like contextual menus which open relative to the user's pointer.\n * @param origin Reference to the new origin.\n */\n setOrigin(origin: FlexibleConnectedPositionStrategyOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the x-axis.\n * @param offset New offset in the X axis.\n */\n withDefaultOffsetX(offset: number): this {\n this._offsetX = offset;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the y-axis.\n * @param offset New offset in the Y axis.\n */\n withDefaultOffsetY(offset: number): this {\n this._offsetY = offset;\n return this;\n }\n\n /**\n * Configures that the position strategy should set a `transform-origin` on some elements\n * inside the overlay, depending on the current position that is being applied. This is\n * useful for the cases where the origin of an animation can change depending on the\n * alignment of the overlay.\n * @param selector CSS selector that will be used to find the target\n * elements onto which to set the transform origin.\n */\n withTransformOriginOn(selector: string): this {\n this._transformOriginSelector = selector;\n return this;\n }\n\n /**\n * Determines where in the DOM the overlay will be rendered when popover mode is enabled.\n * @param location Configures the location in the DOM. Supports the following values:\n * - `global` - The default which inserts the overlay inside the overlay container.\n * - `inline` - Inserts the overlay next to the trigger.\n * - {type: 'parent', element: element} - Inserts the overlay to a child of a custom parent\n * element.\n */\n withPopoverLocation(location: FlexibleOverlayPopoverLocation): this {\n this._popoverLocation = location;\n return this;\n }\n\n /** @docs-private */\n getPopoverInsertionPoint(): Element | null | {type: 'parent'; element: Element} {\n if (this._popoverLocation === 'global') {\n return null;\n } else if (this._popoverLocation !== 'inline') {\n return this._popoverLocation;\n }\n\n if (this._origin instanceof ElementRef) {\n return this._origin.nativeElement;\n } else if (isElement(this._origin)) {\n return this._origin;\n } else {\n return null;\n }\n }\n\n /**\n * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.\n */\n private _getOriginPoint(\n originRect: Dimensions,\n containerRect: Dimensions,\n pos: ConnectedPosition,\n ): Point {\n let x: number;\n if (pos.originX == 'center') {\n // Note: when centering we should always use the `left`\n // offset, otherwise the position will be wrong in RTL.\n x = originRect.left + originRect.width / 2;\n } else {\n const startX = this._isRtl() ? originRect.right : originRect.left;\n const endX = this._isRtl() ? originRect.left : originRect.right;\n x = pos.originX == 'start' ? startX : endX;\n }\n\n // When zooming in Safari the container rectangle contains negative values for the position\n // and we need to re-add them to the calculated coordinates.\n if (containerRect.left < 0) {\n x -= containerRect.left;\n }\n\n let y: number;\n if (pos.originY == 'center') {\n y = originRect.top + originRect.height / 2;\n } else {\n y = pos.originY == 'top' ? originRect.top : originRect.bottom;\n }\n\n // Normally the containerRect's top value would be zero, however when the overlay is attached to an input\n // (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle\n // of the screen and to make space for the virtual keyboard. We need to account for this offset,\n // otherwise our positioning will be thrown off.\n // Additionally, when zooming in Safari this fixes the vertical position.\n if (containerRect.top < 0) {\n y -= containerRect.top;\n }\n\n return {x, y};\n }\n\n /**\n * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and\n * origin point to which the overlay should be connected.\n */\n private _getOverlayPoint(\n originPoint: Point,\n overlayRect: Dimensions,\n pos: ConnectedPosition,\n ): Point {\n // Calculate the (overlayStartX, overlayStartY), the start of the\n // potential overlay position relative to the origin point.\n let overlayStartX: number;\n if (pos.overlayX == 'center') {\n overlayStartX = -overlayRect.width / 2;\n } else if (pos.overlayX === 'start') {\n overlayStartX = this._isRtl() ? -overlayRect.width : 0;\n } else {\n overlayStartX = this._isRtl() ? 0 : -overlayRect.width;\n }\n\n let overlayStartY: number;\n if (pos.overlayY == 'center') {\n overlayStartY = -overlayRect.height / 2;\n } else {\n overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;\n }\n\n // The (x, y) coordinates of the overlay.\n return {\n x: originPoint.x + overlayStartX,\n y: originPoint.y + overlayStartY,\n };\n }\n\n /** Gets how well an overlay at the given point will fit within the viewport. */\n private _getOverlayFit(\n point: Point,\n rawOverlayRect: Dimensions,\n viewport: Dimensions,\n position: ConnectedPosition,\n ): OverlayFit {\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n let {x, y} = point;\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n // Account for the offsets since they could push the overlay out of the viewport.\n if (offsetX) {\n x += offsetX;\n }\n\n if (offsetY) {\n y += offsetY;\n }\n\n // How much the overlay would overflow at this position, on each side.\n let leftOverflow = 0 - x;\n let rightOverflow = x + overlay.width - viewport.width;\n let topOverflow = 0 - y;\n let bottomOverflow = y + overlay.height - viewport.height;\n\n // Visible parts of the element on each axis.\n let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);\n let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);\n let visibleArea = visibleWidth * visibleHeight;\n\n return {\n visibleArea,\n isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,\n fitsInViewportVertically: visibleHeight === overlay.height,\n fitsInViewportHorizontally: visibleWidth == overlay.width,\n };\n }\n\n /**\n * Whether the overlay can fit within the viewport when it may resize either its width or height.\n * @param fit How well the overlay fits in the viewport at some position.\n * @param point The (x, y) coordinates of the overlay at some position.\n * @param viewport The geometry of the viewport.\n */\n private _canFitWithFlexibleDimensions(fit: OverlayFit, point: Point, viewport: Dimensions) {\n if (this._hasFlexibleDimensions) {\n const availableHeight = viewport.bottom - point.y;\n const availableWidth = viewport.right - point.x;\n const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);\n const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);\n\n const verticalFit =\n fit.fitsInViewportVertically || (minHeight != null && minHeight <= availableHeight);\n const horizontalFit =\n fit.fitsInViewportHorizontally || (minWidth != null && minWidth <= availableWidth);\n\n return verticalFit && horizontalFit;\n }\n return false;\n }\n\n /**\n * Gets the point at which the overlay can be \"pushed\" on-screen. If the overlay is larger than\n * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the\n * right and bottom).\n *\n * @param start Starting point from which the overlay is pushed.\n * @param rawOverlayRect Dimensions of the overlay.\n * @param scrollPosition Current viewport scroll position.\n * @returns The point at which to position the overlay after pushing. This is effectively a new\n * originPoint.\n */\n private _pushOverlayOnScreen(\n start: Point,\n rawOverlayRect: Dimensions,\n scrollPosition: ViewportScrollPosition,\n ): Point {\n // If the position is locked and we've pushed the overlay already, reuse the previous push\n // amount, rather than pushing it again. If we were to continue pushing, the element would\n // remain in the viewport, which goes against the expectations when position locking is enabled.\n if (this._previousPushAmount && this._positionLocked) {\n return {\n x: start.x + this._previousPushAmount.x,\n y: start.y + this._previousPushAmount.y,\n };\n }\n\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n const viewport = this._viewportRect;\n\n // Determine how much the overlay goes outside the viewport on each\n // side, which we'll use to decide which direction to push it.\n const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);\n const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);\n const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);\n const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);\n\n // Amount by which to push the overlay in each axis such that it remains on-screen.\n let pushX = 0;\n let pushY = 0;\n\n // If the overlay fits completely within the bounds of the viewport, push it from whichever\n // direction is goes off-screen. Otherwise, push the top-left corner such that its in the\n // viewport and allow for the trailing end of the overlay to go out of bounds.\n if (overlay.width <= viewport.width) {\n pushX = overflowLeft || -overflowRight;\n } else {\n pushX =\n start.x < this._getViewportMarginStart()\n ? viewport.left - scrollPosition.left - start.x\n : 0;\n }\n\n if (overlay.height <= viewport.height) {\n pushY = overflowTop || -overflowBottom;\n } else {\n pushY =\n start.y < this._getViewportMarginTop() ? viewport.top - scrollPosition.top - start.y : 0;\n }\n\n this._previousPushAmount = {x: pushX, y: pushY};\n\n return {\n x: start.x + pushX,\n y: start.y + pushY,\n };\n }\n\n /**\n * Applies a computed position to the overlay and emits a position change.\n * @param position The position preference\n * @param originPoint The point on the origin element where the overlay is connected.\n */\n private _applyPosition(position: ConnectedPosition, originPoint: Point) {\n this._setTransformOrigin(position);\n this._setOverlayElementStyles(originPoint, position);\n this._setBoundingBoxStyles(originPoint, position);\n\n if (position.panelClass) {\n this._addPanelClasses(position.panelClass);\n }\n\n // Notify that the position has been changed along with its change properties.\n // We only emit if we've got any subscriptions, because the scroll visibility\n // calculations can be somewhat expensive.\n if (this._positionChanges.observers.length) {\n const scrollVisibility = this._getScrollVisibility();\n\n // We're recalculating on scroll, but we only want to emit if anything\n // changed since downstream code might be hitting the `NgZone`.\n if (\n position !== this._lastPosition ||\n !this._lastScrollVisibility ||\n !compareScrollVisibility(this._lastScrollVisibility, scrollVisibility)\n ) {\n const changeEvent = new ConnectedOverlayPositionChange(position, scrollVisibility);\n this._positionChanges.next(changeEvent);\n }\n\n this._lastScrollVisibility = scrollVisibility;\n }\n\n // Save the last connected position in case the position needs to be re-calculated.\n this._lastPosition = position;\n this._isInitialRender = false;\n }\n\n /** Sets the transform origin based on the configured selector and the passed-in position. */\n private _setTransformOrigin(position: ConnectedPosition) {\n if (!this._transformOriginSelector) {\n return;\n }\n\n const elements: NodeListOf<HTMLElement> = this._boundingBox!.querySelectorAll(\n this._transformOriginSelector,\n );\n let xOrigin: 'left' | 'right' | 'center';\n let yOrigin: 'top' | 'bottom' | 'center' = position.overlayY;\n\n if (position.overlayX === 'center') {\n xOrigin = 'center';\n } else if (this._isRtl()) {\n xOrigin = position.overlayX === 'start' ? 'right' : 'left';\n } else {\n xOrigin = position.overlayX === 'start' ? 'left' : 'right';\n }\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\n }\n }\n\n /**\n * Gets the position and size of the overlay's sizing container.\n *\n * This method does no measuring and applies no styles so that we can cheaply compute the\n * bounds for all positions and choose the best fit based on these results.\n */\n private _calculateBoundingBoxRect(origin: Point, position: ConnectedPosition): BoundingBoxRect {\n const viewport = this._viewportRect;\n const isRtl = this._isRtl();\n let height: number, top: number, bottom: number;\n\n if (position.overlayY === 'top') {\n // Overlay is opening \"downward\" and thus is bound by the bottom viewport edge.\n top = origin.y;\n height = viewport.height - top + this._getViewportMarginBottom();\n } else if (position.overlayY === 'bottom') {\n // Overlay is opening \"upward\" and thus is bound by the top viewport edge. We need to add\n // the viewport margin back in, because the viewport rect is narrowed down to remove the\n // margin, whereas the `origin` position is calculated based on its `DOMRect`.\n bottom =\n viewport.height - origin.y + this._getViewportMarginTop() + this._getViewportMarginBottom();\n height = viewport.height - bottom + this._getViewportMarginTop();\n } else {\n // If neither top nor bottom, it means that the overlay is vertically centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.bottom - origin.y` and\n // `origin.y - viewport.top`.\n const smallestDistanceToViewportEdge = Math.min(\n viewport.bottom - origin.y + viewport.top,\n origin.y,\n );\n\n const previousHeight = this._lastBoundingBoxSize.height;\n\n height = smallestDistanceToViewportEdge * 2;\n top = origin.y - smallestDistanceToViewportEdge;\n\n if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {\n top = origin.y - previousHeight / 2;\n }\n }\n\n // The overlay is opening 'right-ward' (the content flows to the right).\n const isBoundedByRightViewportEdge =\n (position.overlayX === 'start' && !isRtl) || (position.overlayX === 'end' && isRtl);\n\n // The overlay is opening 'left-ward' (the content flows to the left).\n const isBoundedByLeftViewportEdge =\n (position.overlayX === 'end' && !isRtl) || (position.overlayX === 'start' && isRtl);\n\n let width: number, left: number, right: number;\n\n if (isBoundedByLeftViewportEdge) {\n right =\n viewport.width - origin.x + this._getViewportMarginStart() + this._getViewportMarginEnd();\n width = origin.x - this._getViewportMarginStart();\n } else if (isBoundedByRightViewportEdge) {\n left = origin.x;\n width = viewport.right - origin.x - this._getViewportMarginEnd();\n } else {\n // If neither start nor end, it means that the overlay is horizontally centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.right - origin.x` and\n // `origin.x - viewport.left`.\n const smallestDistanceToViewportEdge = Math.min(\n viewport.right - origin.x + viewport.left,\n origin.x,\n );\n const previousWidth = this._lastBoundingBoxSize.width;\n\n width = smallestDistanceToViewportEdge * 2;\n left = origin.x - smallestDistanceToViewportEdge;\n\n if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {\n left = origin.x - previousWidth / 2;\n }\n }\n\n return {top: top!, left: left!, bottom: bottom!, right: right!, width, height};\n }\n\n /**\n * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the\n * origin's connection point and stretches to the bounds of the viewport.\n *\n * @param origin The point on the origin element where the overlay is connected.\n * @param position The position preference\n */\n private _setBoundingBoxStyles(origin: Point, position: ConnectedPosition): void {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\n\n // It's weird if the overlay *grows* while scrolling, so we take the last size into account\n // when applying a new size.\n if (!this._isInitialRender && !this._growAfterOpen) {\n boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);\n boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);\n }\n\n const styles = {} as CSSStyleDeclaration;\n\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = 'auto';\n styles.maxHeight = styles.maxWidth = '';\n styles.width = styles.height = '100%';\n } else {\n const maxHeight = this._overlayRef.getConfig().maxHeight;\n const maxWidth = this._overlayRef.getConfig().maxWidth;\n\n styles.width = coerceCssPixelValue(boundingBoxRect.width);\n styles.height = coerceCssPixelValue(boundingBoxRect.height);\n styles.top = coerceCssPixelValue(boundingBoxRect.top) || 'auto';\n styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom) || 'auto';\n styles.left = coerceCssPixelValue(boundingBoxRect.left) || 'auto';\n styles.right = coerceCssPixelValue(boundingBoxRect.right) || 'auto';\n\n // Push the pane content towards the proper direction.\n if (position.overlayX === 'center') {\n styles.alignItems = 'center';\n } else {\n styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';\n }\n\n if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n } else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n\n if (maxHeight) {\n styles.maxHeight = coerceCssPixelValue(maxHeight);\n }\n\n if (maxWidth) {\n styles.maxWidth = coerceCssPixelValue(maxWidth);\n }\n }\n\n this._lastBoundingBoxSize = boundingBoxRect;\n\n extendStyles(this._boundingBox!.style, styles);\n }\n\n /** Resets the styles for the bounding box so that a new positioning can be computed. */\n private _resetBoundingBoxStyles() {\n extendStyles(this._boundingBox!.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n /** Resets the styles for the overlay pane so that a new positioning can be computed. */\n private _resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: '',\n } as CSSStyleDeclaration);\n }\n\n /** Sets positioning styles to the overlay element. */\n private _setOverlayElementStyles(originPoint: Point, position: ConnectedPosition): void {\n const styles = {} as CSSStyleDeclaration;\n const hasExactPosition = this._hasExactPosition();\n const hasFlexibleDimensions = this._hasFlexibleDimensions;\n const config = this._overlayRef.getConfig();\n\n if (hasExactPosition) {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));\n extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));\n } else {\n styles.position = 'static';\n }\n\n // Use a transform to apply the offsets. We do this because the `center` positions rely on\n // being in the normal flex flow and setting a `top` / `left` at all will completely throw\n // off the position. We also can't use margins, because they won't have an effect in some\n // cases where the element doesn't have anything to \"push off of\". Finally, this works\n // better both with flexible and non-flexible positioning.\n let transformString = '';\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n if (offsetX) {\n transformString += `translateX(${offsetX}px) `;\n }\n\n if (offsetY) {\n transformString += `translateY(${offsetY}px)`;\n }\n\n styles.transform = transformString.trim();\n\n // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because\n // we need these values to both be set to \"100%\" for the automatic flexible sizing to work.\n // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.\n // Note that this doesn't apply when we have an exact position, in which case we do want to\n // apply them because they'll be cleared from the bounding box.\n if (config.maxHeight) {\n if (hasExactPosition) {\n styles.maxHeight = coerceCssPixelValue(config.maxHeight);\n } else if (hasFlexibleDimensions) {\n styles.maxHeight = '';\n }\n }\n\n if (config.maxWidth) {\n if (hasExactPosition) {\n styles.maxWidth = coerceCssPixelValue(config.maxWidth);\n } else if (hasFlexibleDimensions) {\n styles.maxWidth = '';\n }\n }\n\n extendStyles(this._pane.style, styles);\n }\n\n /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayY(\n position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition,\n ) {\n // Reset any existing styles. This is necessary in case the\n // preferred position has changed since the last `apply`.\n let styles = {top: '', bottom: ''} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n // We want to set either `top` or `bottom` based on whether the overlay wants to appear\n // above or below the origin and the direction in which the element will expand.\n if (position.overlayY === 'bottom') {\n // When using `bottom`, we adjust the y position such that it is the distance\n // from the bottom of the viewport rather than the top.\n const documentHeight = this._document.documentElement!.clientHeight;\n styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;\n } else {\n styles.top = coerceCssPixelValue(overlayPoint.y);\n }\n\n return styles;\n }\n\n /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayX(\n position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition,\n ) {\n // Reset any existing styles. This is necessary in case the preferred position has\n // changed since the last `apply`.\n let styles = {left: '', right: ''} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n // We want to set either `left` or `right` based on whether the overlay wants to appear \"before\"\n // or \"after\" the origin, which determines the direction in which the element will expand.\n // For the horizontal axis, the meaning of \"before\" and \"after\" change based on whether the\n // page is in RTL or LTR.\n let horizontalStyleProperty: 'left' | 'right';\n\n if (this._isRtl()) {\n horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';\n } else {\n horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';\n }\n\n // When we're setting `right`, we adjust the x position such that it is the distance\n // from the right edge of the viewport rather than the left edge.\n if (horizontalStyleProperty === 'right') {\n const documentWidth = this._document.documentElement!.clientWidth;\n styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;\n } else {\n styles.left = coerceCssPixelValue(overlayPoint.x);\n }\n\n return styles;\n }\n\n /**\n * Gets the view properties of the trigger and overlay, including whether they are clipped\n * or completely outside the view of any of the strategy's scrollables.\n */\n private _getScrollVisibility(): ScrollingVisibility {\n // Note: needs fresh rects since the position could've changed.\n const originBounds = this._getOriginRect();\n const overlayBounds = this._pane.getBoundingClientRect();\n\n // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers\n // every time, we should be able to use the scrollTop of the containers if the size of those\n // containers hasn't changed.\n const scrollContainerBounds = this._scrollables.map(scrollable => {\n return scrollable.getElementRef().nativeElement.getBoundingClientRect();\n });\n\n return {\n isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),\n isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),\n isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),\n isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),\n };\n }\n\n /** Subtracts the amount that an element is overflowing on an axis from its length. */\n private _subtractOverflows(length: number, ...overflows: number[]): number {\n return overflows.reduce((currentValue: number, currentOverflow: number) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }\n\n /** Narrows the given viewport rect by the current _viewportMargin. */\n private _getNarrowedViewportRect(): Dimensions {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement!.clientWidth;\n const height = this._document.documentElement!.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n return {\n top: scrollPosition.top + this._getViewportMarginTop(),\n left: scrollPosition.left + this._getViewportMarginStart(),\n right: scrollPosition.left + width - this._getViewportMarginEnd(),\n bottom: scrollPosition.top + height - this._getViewportMarginBottom(),\n width: width - this._getViewportMarginStart() - this._getViewportMarginEnd(),\n height: height - this._getViewportMarginTop() - this._getViewportMarginBottom(),\n };\n }\n\n /** Whether the we're dealing with an RTL context */\n private _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n\n /** Determines whether the overlay uses exact or flexible positioning. */\n private _hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }\n\n /** Retrieves the offset of a position along the x or y axis. */\n private _getOffset(position: ConnectedPosition, axis: 'x' | 'y') {\n if (axis === 'x') {\n // We don't do something like `position['offset' + axis]` in\n // order to avoid breaking minifiers that rename properties.\n return position.offsetX == null ? this._offsetX : position.offsetX;\n }\n\n return position.offsetY == null ? this._offsetY : position.offsetY;\n }\n\n /** Validates that the current position match the expected values. */\n private _validatePositions(): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\n }\n\n // TODO(crisbeto): remove these once Angular's template type\n // checking is advanced enough to catch these cases.\n this._preferredPositions.forEach(pair => {\n validateHorizontalPosition('originX', pair.originX);\n validateVerticalPosition('originY', pair.originY);\n validateHorizontalPosition('overlayX', pair.overlayX);\n validateVerticalPosition('overlayY', pair.overlayY);\n });\n }\n }\n\n /** Adds a single CSS class or an array of classes on the overlay panel. */\n private _addPanelClasses(cssClasses: string | string[]) {\n if (this._pane) {\n coerceArray(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelClasses.push(cssClass);\n this._pane.classList.add(cssClass);\n }\n });\n }\n }\n\n /** Clears the classes that the position strategy has applied from the overlay panel. */\n private _clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }\n\n /**\n * Returns either the _viewportMargin directly (if it is a number) or its 'start' value.\n * @private\n */\n private _getViewportMarginStart(): number {\n if (typeof this._viewportMargin === 'number') return this._viewportMargin;\n return this._viewportMargin?.start ?? 0;\n }\n\n /**\n * Returns either the _viewportMargin directly (if it is a number) or its 'end' value.\n * @private\n */\n private _getViewportMarginEnd(): number {\n if (typeof this._viewportMargin === 'number') return this._viewportMargin;\n return this._viewportMargin?.end ?? 0;\n }\n\n /**\n * Returns either the _viewportMargin directly (if it is a number) or its 'top' value.\n * @private\n */\n private _getViewportMarginTop(): number {\n if (typeof this._viewportMargin === 'number') return this._viewportMargin;\n return this._viewportMargin?.top ?? 0;\n }\n\n /**\n * Returns either the _viewportMargin directly (if it is a number) or its 'bottom' value.\n * @private\n */\n private _getViewportMarginBottom(): number {\n if (typeof this._viewportMargin === 'number') return this._viewportMargin;\n return this._viewportMargin?.bottom ?? 0;\n }\n\n /** Returns the DOMRect of the current origin. */\n private _getOriginRect(): Dimensions {\n const origin = this._origin;\n\n if (origin instanceof ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n\n const width = origin.width || 0;\n const height = origin.height || 0;\n\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width,\n };\n }\n\n /** Gets the dimensions of the overlay container. */\n private _getContainerRect(): Dimensions {\n // We have some CSS that hides the overlay container when it's empty. This can happen\n // when a popover-based overlay is open and it hasn't been inserted into the overlay\n // container. If that's the case, make the container temporarily visible so that we\n // can measure it. This information is used to work around some issues in Safari.\n const isInlinePopover =\n this._overlayRef.getConfig().usePopover && this._popoverLocation !== 'global';\n const element = this._overlayContainer.getContainerElement();\n\n if (isInlinePopover) {\n element.style.display = 'block';\n }\n\n const dimensions = element.getBoundingClientRect();\n\n if (isInlinePopover) {\n element.style.display = '';\n }\n\n return dimensions;\n }\n}\n\n/** A simple (x, y) coordinate. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/** Record of measurements for how an overlay (at a given position) fits into the viewport. */\ninterface OverlayFit {\n /** Whether the overlay fits completely in the viewport. */\n isCompletelyWithinViewport: boolean;\n\n /** Whether the overlay fits in the viewport on the y-axis. */\n fitsInViewportVertically: boolean;\n\n /** Whether the overlay fits in the viewport on the x-axis. */\n fitsInViewportHorizontally: boolean;\n\n /** The total visible area (in px^2) of the overlay inside the viewport. */\n visibleArea: number;\n}\n\n/** Record of the measurements determining whether an overlay will fit in a specific position. */\ninterface FallbackPosition {\n position: ConnectedPosition;\n originPoint: Point;\n overlayPoint: Point;\n overlayFit: OverlayFit;\n overlayRect: Dimensions;\n}\n\n/** Position and size of the overlay sizing wrapper for a specific position. */\ninterface BoundingBoxRect {\n top: number;\n left: number;\n bottom: number;\n right: number;\n height: number;\n width: number;\n}\n\n/** Record of measures determining how well a given position will fit with flexible dimensions. */\ninterface FlexibleFit {\n position: ConnectedPosition;\n origin: Point;\n overlayRect: Dimensions;\n boundingBoxRect: BoundingBoxRect;\n}\n\n/** A connected position as specified by the user. */\nexport interface ConnectedPosition {\n originX: 'start' | 'center' | 'end';\n originY: 'top' | 'center' | 'bottom';\n\n overlayX: 'start' | 'center' | 'end';\n overlayY: 'top' | 'center' | 'bottom';\n\n weight?: number;\n offsetX?: number;\n offsetY?: number;\n panelClass?: string | string[];\n}\n\n/** Shallow-extends a stylesheet object with another stylesheet object. */\nfunction extendStyles(\n destination: CSSStyleDeclaration,\n source: CSSStyleDeclaration,\n): CSSStyleDeclaration {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n\n return destination;\n}\n\n/**\n * Extracts the pixel value as a number from a value, if it's a number\n * or a CSS pixel string (e.g. `1337px`). Otherwise returns null.\n */\nfunction getPixelValue(input: number | string | null | undefined): number | null {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return !units || units === 'px' ? parseFloat(value) : null;\n }\n\n return input || null;\n}\n\n/**\n * Gets a version of an element's bounding `DOMRect` where all the values are rounded down to\n * the nearest pixel. This allows us to account for the cases where there may be sub-pixel\n * deviations in the `DOMRect` returned by the browser (e.g. when zoomed in with a percentage\n * size, see #21350).\n */\nfunction getRoundedBoundingClientRect(clientRect: Dimensions): Dimensions {\n return {\n top: Math.floor(clientRect.top),\n right: Math.floor(clientRect.right),\n bottom: Math.floor(clientRect.bottom),\n left: Math.floor(clientRect.left),\n width: Math.floor(clientRect.width),\n height: Math.floor(clientRect.height),\n };\n}\n\n/** Returns whether two `ScrollingVisibility` objects are identical. */\nfunction compareScrollVisibility(a: ScrollingVisibility, b: ScrollingVisibility): boolean {\n if (a === b) {\n return true;\n }\n\n return (\n a.isOriginClipped === b.isOriginClipped &&\n a.isOriginOutsideView === b.isOriginOutsideView &&\n a.isOverlayClipped === b.isOverlayClipped &&\n a.isOverlayOutsideView === b.isOverlayOutsideView\n );\n}\n\nexport const STANDARD_DROPDOWN_BELOW_POSITIONS: ConnectedPosition[] = [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'},\n];\n\nexport const STANDARD_DROPDOWN_ADJACENT_POSITIONS: ConnectedPosition[] = [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector} from '@angular/core';\nimport {OverlayRef} from '../overlay-ref';\nimport {PositionStrategy} from './position-strategy';\n\n/** Class to be added to the overlay pane wrapper. */\nconst wrapperClass = 'cdk-global-overlay-wrapper';\n\n/**\n * Creates a global position strategy.\n * @param injector Injector used to resolve dependencies for the strategy.\n */\nexport function createGlobalPositionStrategy(_injector: Injector): GlobalPositionStrategy {\n return new GlobalPositionStrategy();\n}\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * explicit position relative to the browser's viewport. We use flexbox, instead of\n * transforms, in order to avoid issues with subpixel rendering which can cause the\n * element to become blurry.\n */\nexport class GlobalPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef!: OverlayRef;\n private _cssPosition = 'static';\n private _topOffset = '';\n private _bottomOffset = '';\n private _alignItems = '';\n private _xPosition = '';\n private _xOffset = '';\n private _width = '';\n private _height = '';\n private _isDisposed = false;\n\n attach(overlayRef: OverlayRef): void {\n const config = overlayRef.getConfig();\n\n this._overlayRef = overlayRef;\n\n if (this._width && !config.width) {\n overlayRef.updateSize({width: this._width});\n }\n\n if (this._height && !config.height) {\n overlayRef.updateSize({height: this._height});\n }\n\n overlayRef.hostElement.classList.add(wrapperClass);\n this._isDisposed = false;\n }\n\n /**\n * Sets the top position of the overlay. Clears any previously set vertical position.\n * @param value New top offset.\n */\n top(value: string = ''): this {\n this._bottomOffset = '';\n this._topOffset = value;\n this._alignItems = 'flex-start';\n return this;\n }\n\n /**\n * Sets the left position of the overlay. Clears any previously set horizontal position.\n * @param value New left offset.\n */\n left(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'left';\n return this;\n }\n\n /**\n * Sets the bottom position of the overlay. Clears any previously set vertical position.\n * @param value New bottom offset.\n */\n bottom(value: string = ''): this {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }\n\n /**\n * Sets the right position of the overlay. Clears any previously set horizontal position.\n * @param value New right offset.\n */\n right(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'right';\n return this;\n }\n\n /**\n * Sets the overlay to the start of the viewport, depending on the overlay direction.\n * This will be to the left in LTR layouts and to the right in RTL.\n * @param offset Offset from the edge of the screen.\n */\n start(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'start';\n return this;\n }\n\n /**\n * Sets the overlay to the end of the viewport, depending on the overlay direction.\n * This will be to the right in LTR layouts and to the left in RTL.\n * @param offset Offset from the edge of the screen.\n */\n end(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'end';\n return this;\n }\n\n /**\n * Sets the overlay width and clears any previously set width.\n * @param value New width for the overlay\n * @deprecated Pass the `width` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n width(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({width: value});\n } else {\n this._width = value;\n }\n\n return this;\n }\n\n /**\n * Sets the overlay height and clears any previously set height.\n * @param value New height for the overlay\n * @deprecated Pass the `height` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n height(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({height: value});\n } else {\n this._height = value;\n }\n\n return this;\n }\n\n /**\n * Centers the overlay horizontally with an optional offset.\n * Clears any previously set horizontal position.\n *\n * @param offset Overlay offset from the horizontal center.\n */\n centerHorizontally(offset: string = ''): this {\n this.left(offset);\n this._xPosition = 'center';\n return this;\n }\n\n /**\n * Centers the overlay vertically with an optional offset.\n * Clears any previously set vertical position.\n *\n * @param offset Overlay offset from the vertical center.\n */\n centerVertically(offset: string = ''): this {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }\n\n /**\n * Apply the position to the element.\n * @docs-private\n */\n apply(): void {\n // Since the overlay ref applies the strategy asynchronously, it could\n // have been disposed before it ends up being applied. If that is the\n // case, we shouldn't do anything.\n if (!this._overlayRef || !this._overlayRef.hasAttached()) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parentStyles = this._overlayRef.hostElement.style;\n const config = this._overlayRef.getConfig();\n const {width, height, maxWidth, maxHeight} = config;\n const shouldBeFlushHorizontally =\n (width === '100%' || width === '100vw') &&\n (!maxWidth || maxWidth === '100%' || maxWidth === '100vw');\n const shouldBeFlushVertically =\n (height === '100%' || height === '100vh') &&\n (!maxHeight || maxHeight === '100%' || maxHeight === '100vh');\n const xPosition = this._xPosition;\n const xOffset = this._xOffset;\n const isRtl = this._overlayRef.getConfig().direction === 'rtl';\n let marginLeft = '';\n let marginRight = '';\n let justifyContent = '';\n\n if (shouldBeFlushHorizontally) {\n justifyContent = 'flex-start';\n } else if (xPosition === 'center') {\n justifyContent = 'center';\n\n if (isRtl) {\n marginRight = xOffset;\n } else {\n marginLeft = xOffset;\n }\n } else if (isRtl) {\n if (xPosition === 'left' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginLeft = xOffset;\n } else if (xPosition === 'right' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginRight = xOffset;\n }\n } else if (xPosition === 'left' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginLeft = xOffset;\n } else if (xPosition === 'right' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginRight = xOffset;\n }\n\n styles.position = this._cssPosition;\n styles.marginLeft = shouldBeFlushHorizontally ? '0' : marginLeft;\n styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset;\n styles.marginBottom = this._bottomOffset;\n styles.marginRight = shouldBeFlushHorizontally ? '0' : marginRight;\n parentStyles.justifyContent = justifyContent;\n parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems;\n }\n\n /**\n * Cleans up the DOM changes from the position strategy.\n * @docs-private\n */\n dispose(): void {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent =\n parentStyles.alignItems =\n styles.marginTop =\n styles.marginBottom =\n styles.marginLeft =\n styles.marginRight =\n styles.position =\n '';\n\n this._overlayRef = null!;\n this._isDisposed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, Injector, inject} from '@angular/core';\nimport {\n createFlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategyOrigin,\n} from './flexible-connected-position-strategy';\nimport {createGlobalPositionStrategy, GlobalPositionStrategy} from './global-position-strategy';\n\n/** Builder for overlay position strategy. */\n@Injectable({providedIn: 'root'})\nexport class OverlayPositionBuilder {\n private _injector = inject(Injector);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Creates a global position strategy.\n */\n global(): GlobalPositionStrategy {\n return createGlobalPositionStrategy(this._injector);\n }\n\n /**\n * Creates a flexible position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\n flexibleConnectedTo(\n origin: FlexibleConnectedPositionStrategyOrigin,\n ): FlexibleConnectedPositionStrategy {\n return createFlexibleConnectedPositionStrategy(this._injector, origin);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directionality} from '../bidi';\nimport {DomPortalOutlet} from '../portal';\nimport {Location} from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n NgZone,\n ANIMATION_MODULE_TYPE,\n EnvironmentInjector,\n inject,\n RendererFactory2,\n DOCUMENT,\n Renderer2,\n InjectionToken,\n} from '@angular/core';\nimport {_IdGenerator} from '../a11y';\nimport {_CdkPrivateStyleLoader} from '../private';\nimport {OverlayKeyboardDispatcher} from './dispatchers/overlay-keyboard-dispatcher';\nimport {OverlayOutsideClickDispatcher} from './dispatchers/overlay-outside-click-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {_CdkOverlayStyleLoader, OverlayContainer} from './overlay-container';\nimport {isElement, OverlayRef} from './overlay-ref';\nimport {OverlayPositionBuilder} from './position/overlay-position-builder';\nimport {ScrollStrategyOptions} from './scroll/index';\n\n/** Object used to configure the default options for overlays. */\nexport interface OverlayDefaultConfig {\n usePopover?: boolean;\n}\n\n/** Injection token used to configure the default options for CDK overlays. */\nexport const OVERLAY_DEFAULT_CONFIG = new InjectionToken<OverlayDefaultConfig>(\n 'OVERLAY_DEFAULT_CONFIG',\n);\n\n/**\n * Creates an overlay.\n * @param injector Injector to use when resolving the overlay's dependencies.\n * @param config Configuration applied to the overlay.\n * @returns Reference to the created overlay.\n */\nexport function createOverlayRef(injector: Injector, config?: OverlayConfig): OverlayRef {\n // This is done in the overlay container as well, but we have it here\n // since it's common to mock out the overlay container in tests.\n injector.get(_CdkPrivateStyleLoader).load(_CdkOverlayStyleLoader);\n\n const overlayContainer = injector.get(OverlayContainer);\n const doc = injector.get(DOCUMENT);\n const idGenerator = injector.get(_IdGenerator);\n const appRef = injector.get(ApplicationRef);\n const directionality = injector.get(Directionality);\n const renderer =\n injector.get(Renderer2, null, {optional: true}) ||\n injector.get(RendererFactory2).createRenderer(null, null);\n\n const overlayConfig = new OverlayConfig(config);\n const defaultUsePopover =\n injector.get(OVERLAY_DEFAULT_CONFIG, null, {optional: true})?.usePopover ?? true;\n\n overlayConfig.direction = overlayConfig.direction || directionality.value;\n\n if (!('showPopover' in doc.body)) {\n overlayConfig.usePopover = false;\n } else {\n overlayConfig.usePopover = config?.usePopover ?? defaultUsePopover;\n }\n\n const pane = doc.createElement('div');\n const host = doc.createElement('div');\n pane.id = idGenerator.getId('cdk-overlay-');\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n\n if (overlayConfig.usePopover) {\n host.setAttribute('popover', 'manual');\n host.classList.add('cdk-overlay-popover');\n }\n\n const customInsertionPoint = overlayConfig.usePopover\n ? overlayConfig.positionStrategy?.getPopoverInsertionPoint?.()\n : null;\n\n if (isElement(customInsertionPoint)) {\n customInsertionPoint.after(host);\n } else if (customInsertionPoint?.type === 'parent') {\n customInsertionPoint.element.appendChild(host);\n } else {\n overlayContainer.getContainerElement().appendChild(host);\n }\n\n return new OverlayRef(\n new DomPortalOutlet(pane, appRef, injector),\n host,\n pane,\n overlayConfig,\n injector.get(NgZone),\n injector.get(OverlayKeyboardDispatcher),\n doc,\n injector.get(Location),\n injector.get(OverlayOutsideClickDispatcher),\n config?.disableAnimations ??\n injector.get(ANIMATION_MODULE_TYPE, null, {optional: true}) === 'NoopAnimations',\n injector.get(EnvironmentInjector),\n renderer,\n );\n}\n\n/**\n * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be\n * used as a low-level building block for other components. Dialogs, tooltips, menus,\n * selects, etc. can all be built using overlays. The service should primarily be used by authors\n * of re-usable components rather than developers building end-user applications.\n *\n * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.\n */\n@Injectable({providedIn: 'root'})\nexport class Overlay {\n scrollStrategies = inject(ScrollStrategyOptions);\n private _positionBuilder = inject(OverlayPositionBuilder);\n private _injector = inject(Injector);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Creates an overlay.\n * @param config Configuration applied to the overlay.\n * @returns Reference to the created overlay.\n */\n create(config?: OverlayConfig): OverlayRef {\n return createOverlayRef(this._injector, config);\n }\n\n /**\n * Gets a position builder that can be used, via fluent API,\n * to construct and configure a position strategy.\n * @returns An overlay position builder.\n */\n position(): OverlayPositionBuilder {\n return this._positionBuilder;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Direction, Directionality} from '../bidi';\nimport {ESCAPE, hasModifierKey} from '../keycodes';\nimport {TemplatePortal} from '../portal';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n InjectionToken,\n Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {_getEventTarget} from '../platform';\nimport {Subscription} from 'rxjs';\nimport {takeWhile} from 'rxjs/operators';\nimport {createOverlayRef, OVERLAY_DEFAULT_CONFIG} from './overlay';\nimport {OverlayConfig} from './overlay-config';\nimport {OverlayRef} from './overlay-ref';\nimport {ConnectedOverlayPositionChange, ViewportMargin} from './position/connected-position';\nimport {\n ConnectedPosition,\n createFlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategyOrigin,\n FlexibleOverlayPopoverLocation,\n} from './position/flexible-connected-position-strategy';\nimport {createRepositionScrollStrategy, ScrollStrategy} from './scroll/index';\n\n/** Default set of positions for the overlay. Follows the behavior of a dropdown. */\nconst defaultPositionList: ConnectedPosition[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n },\n];\n\n/** Injection token that determines the scroll handling while the connected overlay is open. */\nexport const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'cdk-connected-overlay-scroll-strategy',\n {\n providedIn: 'root',\n factory: () => {\n const injector = inject(Injector);\n return () => createRepositionScrollStrategy(injector);\n },\n },\n);\n\n/**\n * Directive applied to an element to make it usable as an origin for an Overlay using a\n * ConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',\n exportAs: 'cdkOverlayOrigin',\n})\nexport class CdkOverlayOrigin {\n elementRef = inject(ElementRef);\n\n constructor(...args: unknown[]);\n constructor() {}\n}\n\n/**\n * Injection token that can be used to configure the\n * default options for the `CdkConnectedOverlay` directive.\n */\nexport const CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG = new InjectionToken<CdkConnectedOverlayConfig>(\n 'cdk-connected-overlay-default-config',\n);\n\n/** Object used to configure the `CdkConnectedOverlay` directive. */\nexport interface CdkConnectedOverlayConfig {\n origin?: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin;\n positions?: ConnectedPosition[];\n positionStrategy?: FlexibleConnectedPositionStrategy;\n offsetX?: number;\n offsetY?: number;\n width?: number | string;\n height?: number | string;\n minWidth?: number | string;\n minHeight?: number | string;\n backdropClass?: string | string[];\n panelClass?: string | string[];\n viewportMargin?: ViewportMargin;\n scrollStrategy?: ScrollStrategy;\n disableClose?: boolean;\n transformOriginSelector?: string;\n hasBackdrop?: boolean;\n lockPosition?: boolean;\n flexibleDimensions?: boolean;\n growAfterOpen?: boolean;\n push?: boolean;\n disposeOnNavigation?: boolean;\n usePopover?: FlexibleOverlayPopoverLocation | null;\n matchWidth?: boolean;\n}\n\n/**\n * Directive to facilitate declarative creation of an\n * Overlay using a FlexibleConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',\n exportAs: 'cdkConnectedOverlay',\n})\nexport class CdkConnectedOverlay implements OnDestroy, OnChanges {\n private _dir = inject(Directionality, {optional: true});\n private _injector = inject(Injector);\n\n private _overlayRef: OverlayRef | undefined;\n private _templatePortal: TemplatePortal;\n private _backdropSubscription = Subscription.EMPTY;\n private _attachSubscription = Subscription.EMPTY;\n private _detachSubscription = Subscription.EMPTY;\n private _positionSubscription = Subscription.EMPTY;\n private _offsetX: number | undefined;\n private _offsetY: number | undefined;\n private _position: FlexibleConnectedPositionStrategy | undefined;\n private _scrollStrategyFactory = inject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY);\n private _ngZone = inject(NgZone);\n\n /** Origin for the connected overlay. */\n @Input('cdkConnectedOverlayOrigin')\n origin!: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin;\n\n /** Registered connected position pairs. */\n @Input('cdkConnectedOverlayPositions') positions!: ConnectedPosition[];\n\n /**\n * This input overrides the positions input if specified. It lets users pass\n * in arbitrary positioning strategies.\n */\n @Input('cdkConnectedOverlayPositionStrategy')\n positionStrategy!: FlexibleConnectedPositionStrategy;\n\n /** The offset in pixels for the overlay connection point on the x-axis */\n @Input('cdkConnectedOverlayOffsetX')\n get offsetX(): number {\n return this._offsetX!;\n }\n set offsetX(offsetX: number) {\n this._offsetX = offsetX;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The offset in pixels for the overlay connection point on the y-axis */\n @Input('cdkConnectedOverlayOffsetY')\n get offsetY() {\n return this._offsetY!;\n }\n set offsetY(offsetY: number) {\n this._offsetY = offsetY;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The width of the overlay panel. */\n @Input('cdkConnectedOverlayWidth') width!: number | string;\n\n /** The height of the overlay panel. */\n @Input('cdkConnectedOverlayHeight') height!: number | string;\n\n /** The min width of the overlay panel. */\n @Input('cdkConnectedOverlayMinWidth') minWidth!: number | string;\n\n /** The min height of the overlay panel. */\n @Input('cdkConnectedOverlayMinHeight') minHeight!: number | string;\n\n /** The custom class to be set on the backdrop element. */\n @Input('cdkConnectedOverlayBackdropClass') backdropClass!: string | string[];\n\n /** The custom class to add to the overlay pane element. */\n @Input('cdkConnectedOverlayPanelClass') panelClass!: string | string[];\n\n /** Margin between the overlay and the viewport edges. */\n @Input('cdkConnectedOverlayViewportMargin') viewportMargin: ViewportMargin = 0;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n @Input('cdkConnectedOverlayScrollStrategy') scrollStrategy: ScrollStrategy;\n\n /** Whether the overlay is open. */\n @Input('cdkConnectedOverlayOpen') open: boolean = false;\n\n /** Whether the overlay can be closed by user interaction. */\n @Input('cdkConnectedOverlayDisableClose') disableClose: boolean = false;\n\n /** CSS selector which to set the transform origin. */\n @Input('cdkConnectedOverlayTransformOriginOn') transformOriginSelector!: string;\n\n /** Whether or not the overlay should attach a backdrop. */\n @Input({alias: 'cdkConnectedOverlayHasBackdrop', transform: booleanAttribute})\n hasBackdrop: boolean = false;\n\n /** Whether or not the overlay should be locked when scrolling. */\n @Input({alias: 'cdkConnectedOverlayLockPosition', transform: booleanAttribute})\n lockPosition: boolean = false;\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n @Input({alias: 'cdkConnectedOverlayFlexibleDimensions', transform: booleanAttribute})\n flexibleDimensions: boolean = false;\n\n /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */\n @Input({alias: 'cdkConnectedOverlayGrowAfterOpen', transform: booleanAttribute})\n growAfterOpen: boolean = false;\n\n /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */\n @Input({alias: 'cdkConnectedOverlayPush', transform: booleanAttribute}) push: boolean = false;\n\n /** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */\n @Input({alias: 'cdkConnectedOverlayDisposeOnNavigation', transform: booleanAttribute})\n disposeOnNavigation: boolean = false;\n\n /** Whether the connected overlay should be rendered inside a popover element or the overlay container. */\n @Input({alias: 'cdkConnectedOverlayUsePopover'})\n usePopover: FlexibleOverlayPopoverLocation | null;\n\n /** Whether the overlay should match the trigger's width. */\n @Input({alias: 'cdkConnectedOverlayMatchWidth', transform: booleanAttribute})\n matchWidth: boolean = false;\n\n /** Shorthand for setting multiple overlay options at once. */\n @Input('cdkConnectedOverlay')\n set _config(value: string | CdkConnectedOverlayConfig) {\n if (typeof value !== 'string') {\n this._assignConfig(value);\n }\n }\n\n /** Event emitted when the backdrop is clicked. */\n @Output() readonly backdropClick = new EventEmitter<MouseEvent>();\n\n /** Event emitted when the position has changed. */\n @Output() readonly positionChange = new EventEmitter<ConnectedOverlayPositionChange>();\n\n /** Event emitted when the overlay has been attached. */\n @Output() readonly attach = new EventEmitter<void>();\n\n /** Event emitted when the overlay has been detached. */\n @Output() readonly detach = new EventEmitter<void>();\n\n /** Emits when there are keyboard events that are targeted at the overlay. */\n @Output() readonly overlayKeydown = new EventEmitter<KeyboardEvent>();\n\n /** Emits when there are mouse outside click events that are targeted at the overlay. */\n @Output() readonly overlayOutsideClick = new EventEmitter<MouseEvent>();\n\n constructor(...args: unknown[]);\n\n // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.\n\n constructor() {\n const templateRef = inject<TemplateRef<any>>(TemplateRef);\n const viewContainerRef = inject(ViewContainerRef);\n const defaultConfig = inject(CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG, {optional: true});\n const globalConfig = inject(OVERLAY_DEFAULT_CONFIG, {optional: true});\n\n this.usePopover = globalConfig?.usePopover === false ? null : 'global';\n this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);\n this.scrollStrategy = this._scrollStrategyFactory();\n\n if (defaultConfig) {\n this._assignConfig(defaultConfig);\n }\n }\n\n /** The associated overlay reference. */\n get overlayRef(): OverlayRef {\n return this._overlayRef!;\n }\n\n /** The element's layout direction. */\n get dir(): Direction {\n return this._dir ? this._dir.value : 'ltr';\n }\n\n ngOnDestroy() {\n this._attachSubscription.unsubscribe();\n this._detachSubscription.unsubscribe();\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n this._overlayRef?.dispose();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this._position) {\n this._updatePositionStrategy(this._position);\n this._overlayRef?.updateSize({\n width: this._getWidth(),\n minWidth: this.minWidth,\n height: this.height,\n minHeight: this.minHeight,\n });\n\n if (changes['origin'] && this.open) {\n this._position.apply();\n }\n }\n\n if (changes['open']) {\n this.open ? this.attachOverlay() : this.detachOverlay();\n }\n }\n\n /** Creates an overlay */\n private _createOverlay() {\n if (!this.positions || !this.positions.length) {\n this.positions = defaultPositionList;\n }\n\n const overlayRef = (this._overlayRef = createOverlayRef(this._injector, this._buildConfig()));\n this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());\n this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());\n overlayRef.keydownEvents().subscribe((event: KeyboardEvent) => {\n this.overlayKeydown.next(event);\n\n if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {\n event.preventDefault();\n this.detachOverlay();\n }\n });\n\n this._overlayRef.outsidePointerEvents().subscribe((event: MouseEvent) => {\n const origin = this._getOriginElement();\n const target = _getEventTarget(event) as Element | null;\n\n if (!origin || (origin !== target && !origin.contains(target))) {\n this.overlayOutsideClick.next(event);\n }\n });\n }\n\n /** Builds the overlay config based on the directive's inputs */\n private _buildConfig(): OverlayConfig {\n const positionStrategy = (this._position =\n this.positionStrategy || this._createPositionStrategy());\n const overlayConfig = new OverlayConfig({\n direction: this._dir || 'ltr',\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n hasBackdrop: this.hasBackdrop,\n disposeOnNavigation: this.disposeOnNavigation,\n usePopover: !!this.usePopover,\n });\n\n if (this.height || this.height === 0) {\n overlayConfig.height = this.height;\n }\n\n if (this.minWidth || this.minWidth === 0) {\n overlayConfig.minWidth = this.minWidth;\n }\n\n if (this.minHeight || this.minHeight === 0) {\n overlayConfig.minHeight = this.minHeight;\n }\n\n if (this.backdropClass) {\n overlayConfig.backdropClass = this.backdropClass;\n }\n\n if (this.panelClass) {\n overlayConfig.panelClass = this.panelClass;\n }\n\n return overlayConfig;\n }\n\n /** Updates the state of a position strategy, based on the values of the directive inputs. */\n private _updatePositionStrategy(positionStrategy: FlexibleConnectedPositionStrategy) {\n const positions: ConnectedPosition[] = this.positions.map(currentPosition => ({\n originX: currentPosition.originX,\n originY: currentPosition.originY,\n overlayX: currentPosition.overlayX,\n overlayY: currentPosition.overlayY,\n offsetX: currentPosition.offsetX || this.offsetX,\n offsetY: currentPosition.offsetY || this.offsetY,\n panelClass: currentPosition.panelClass || undefined,\n }));\n\n return positionStrategy\n .setOrigin(this._getOrigin())\n .withPositions(positions)\n .withFlexibleDimensions(this.flexibleDimensions)\n .withPush(this.push)\n .withGrowAfterOpen(this.growAfterOpen)\n .withViewportMargin(this.viewportMargin)\n .withLockedPosition(this.lockPosition)\n .withTransformOriginOn(this.transformOriginSelector)\n .withPopoverLocation(this.usePopover === null ? 'global' : this.usePopover);\n }\n\n /** Returns the position strategy of the overlay to be set on the overlay config */\n private _createPositionStrategy(): FlexibleConnectedPositionStrategy {\n const strategy = createFlexibleConnectedPositionStrategy(this._injector, this._getOrigin());\n this._updatePositionStrategy(strategy);\n return strategy;\n }\n\n private _getOrigin(): FlexibleConnectedPositionStrategyOrigin {\n if (this.origin instanceof CdkOverlayOrigin) {\n return this.origin.elementRef;\n } else {\n return this.origin;\n }\n }\n\n private _getOriginElement(): Element | null {\n if (this.origin instanceof CdkOverlayOrigin) {\n return this.origin.elementRef.nativeElement;\n }\n\n if (this.origin instanceof ElementRef) {\n return this.origin.nativeElement;\n }\n\n if (typeof Element !== 'undefined' && this.origin instanceof Element) {\n return this.origin;\n }\n\n return null;\n }\n\n private _getWidth() {\n if (this.width) {\n return this.width;\n }\n\n // Null check `getBoundingClientRect` in case this is called during SSR.\n return this.matchWidth ? this._getOriginElement()?.getBoundingClientRect?.().width : undefined;\n }\n\n /** Attaches the overlay. */\n attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n }\n\n const ref = this._overlayRef!;\n\n // Update the overlay size, in case the directive's inputs have changed\n ref.getConfig().hasBackdrop = this.hasBackdrop;\n ref.updateSize({width: this._getWidth()});\n\n if (!ref.hasAttached()) {\n ref.attach(this._templatePortal);\n }\n\n if (this.hasBackdrop) {\n this._backdropSubscription = ref\n .backdropClick()\n .subscribe(event => this.backdropClick.emit(event));\n } else {\n this._backdropSubscription.unsubscribe();\n }\n\n this._positionSubscription.unsubscribe();\n\n // Only subscribe to `positionChanges` if requested, because putting\n // together all the information for it can be expensive.\n if (this.positionChange.observers.length > 0) {\n this._positionSubscription = this._position!.positionChanges.pipe(\n takeWhile(() => this.positionChange.observers.length > 0),\n ).subscribe(position => {\n this._ngZone.run(() => this.positionChange.emit(position));\n\n if (this.positionChange.observers.length === 0) {\n this._positionSubscription.unsubscribe();\n }\n });\n }\n\n this.open = true;\n }\n\n /** Detaches the overlay. */\n detachOverlay() {\n this._overlayRef?.detach();\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n this.open = false;\n }\n\n private _assignConfig(config: CdkConnectedOverlayConfig) {\n this.origin = config.origin ?? this.origin;\n this.positions = config.positions ?? this.positions;\n this.positionStrategy = config.positionStrategy ?? this.positionStrategy;\n this.offsetX = config.offsetX ?? this.offsetX;\n this.offsetY = config.offsetY ?? this.offsetY;\n this.width = config.width ?? this.width;\n this.height = config.height ?? this.height;\n this.minWidth = config.minWidth ?? this.minWidth;\n this.minHeight = config.minHeight ?? this.minHeight;\n this.backdropClass = config.backdropClass ?? this.backdropClass;\n this.panelClass = config.panelClass ?? this.panelClass;\n this.viewportMargin = config.viewportMargin ?? this.viewportMargin;\n this.scrollStrategy = config.scrollStrategy ?? this.scrollStrategy;\n this.disableClose = config.disableClose ?? this.disableClose;\n this.transformOriginSelector = config.transformOriginSelector ?? this.transformOriginSelector;\n this.hasBackdrop = config.hasBackdrop ?? this.hasBackdrop;\n this.lockPosition = config.lockPosition ?? this.lockPosition;\n this.flexibleDimensions = config.flexibleDimensions ?? this.flexibleDimensions;\n this.growAfterOpen = config.growAfterOpen ?? this.growAfterOpen;\n this.push = config.push ?? this.push;\n this.disposeOnNavigation = config.disposeOnNavigation ?? this.disposeOnNavigation;\n this.usePopover = config.usePopover ?? this.usePopover;\n this.matchWidth = config.matchWidth ?? this.matchWidth;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BidiModule} from '../bidi';\nimport {PortalModule} from '../portal';\nimport {ScrollingModule} from '../scrolling';\nimport {NgModule} from '@angular/core';\nimport {Overlay} from './overlay';\nimport {CdkConnectedOverlay, CdkOverlayOrigin} from './overlay-directives';\n\n@NgModule({\n imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],\n exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],\n providers: [Overlay],\n})\nexport class OverlayModule {}\n\n// Re-export needed by the Angular compiler.\n// See: https://github.com/angular/components/issues/30663.\n// Note: These exports need to be stable and shouldn't be renamed unnecessarily because\n// consuming libraries might have references to them in their own partial compilation output.\nexport {\n CdkScrollableModule as ɵɵCdkScrollableModule,\n CdkFixedSizeVirtualScroll as ɵɵCdkFixedSizeVirtualScroll,\n CdkVirtualForOf as ɵɵCdkVirtualForOf,\n CdkVirtualScrollViewport as ɵɵCdkVirtualScrollViewport,\n CdkVirtualScrollableWindow as ɵɵCdkVirtualScrollableWindow,\n CdkVirtualScrollableElement as ɵɵCdkVirtualScrollableElement,\n} from '../scrolling';\nexport {Dir as ɵɵDir} from '../bidi';\n"],"names":["scrollBehaviorSupported","supportsScrollBehavior","createBlockScrollStrategy","injector","BlockScrollStrategy","get","ViewportRuler","DOCUMENT","_viewportRuler","_previousHTMLStyles","top","left","_previousScrollPosition","_isEnabled","_document","constructor","document","attach","enable","_canBeEnabled","root","documentElement","getViewportScrollPosition","style","coerceCssPixelValue","classList","add","disable","html","body","htmlStyle","bodyStyle","previousHtmlScrollBehavior","scrollBehavior","previousBodyScrollBehavior","remove","window","scroll","contains","rootElement","viewport","getViewportSize","scrollHeight","height","scrollWidth","width","getMatScrollStrategyAlreadyAttachedError","Error","createCloseScrollStrategy","config","CloseScrollStrategy","ScrollDispatcher","NgZone","_scrollDispatcher","_ngZone","_config","_scrollSubscription","_overlayRef","_initialScrollPosition","overlayRef","ngDevMode","stream","scrolled","pipe","filter","scrollable","overlayElement","getElementRef","nativeElement","threshold","subscribe","scrollPosition","Math","abs","_detach","updatePosition","unsubscribe","detach","hasAttached","run","createNoopScrollStrategy","NoopScrollStrategy","isElementScrolledOutsideView","element","scrollContainers","some","containerBounds","outsideAbove","bottom","outsideBelow","outsideLeft","right","outsideRight","isElementClippedByScrolling","scrollContainerRect","clippedAbove","clippedBelow","clippedLeft","clippedRight","createRepositionScrollStrategy","RepositionScrollStrategy","throttle","scrollThrottle","autoClose","overlayRect","getBoundingClientRect","parentRects","ScrollStrategyOptions","_injector","inject","Injector","noop","close","block","reposition","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn","OverlayConfig","positionStrategy","scrollStrategy","panelClass","hasBackdrop","backdropClass","disableAnimations","minWidth","minHeight","maxWidth","maxHeight","direction","disposeOnNavigation","usePopover","configKeys","Object","keys","key","undefined","ConnectionPositionPair","offsetX","offsetY","originX","originY","overlayX","overlayY","origin","overlay","ScrollingVisibility","isOriginClipped","isOriginOutsideView","isOverlayClipped","isOverlayOutsideView","ConnectedOverlayPositionChange","connectionPair","scrollableViewProperties","validateVerticalPosition","property","value","validateHorizontalPosition","BaseOverlayDispatcher","_attachedOverlays","_isAttached","ngOnDestroy","push","index","indexOf","splice","length","OverlayKeyboardDispatcher","_renderer","RendererFactory2","createRenderer","_cleanupKeydown","runOutsideAngular","listen","_keydownListener","event","overlays","i","_keydownEvents","observers","next","OverlayOutsideClickDispatcher","_platform","Platform","_cursorOriginalValue","_cursorStyleIsSet","_pointerDownEventTarget","_cleanups","eventOptions","capture","renderer","_pointerDownListener","_clickListener","IOS","cursor","forEach","cleanup","_getEventTarget","slice","_outsidePointerEvents","containsPierceShadowDom","outsidePointerEvents","parent","child","supportsShadowRoot","ShadowRoot","current","host","parentNode","_CdkOverlayStyleLoader","Component","ɵcmp","ɵɵngDeclareComponent","isInline","styles","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","args","template","OverlayContainer","_containerElement","_styleLoader","_CdkPrivateStyleLoader","getContainerElement","_loadStyles","_createContainer","containerClass","isBrowser","_isTestEnvironment","oppositePlatformContainers","querySelectorAll","container","createElement","setAttribute","appendChild","load","BackdropRef","_cleanupClick","_cleanupTransitionEnd","_fallbackTimeout","onClick","clearTimeout","dispose","setTimeout","pointerEvents","isElement","nodeType","OverlayRef","_portalOutlet","_host","_pane","_keyboardDispatcher","_location","_outsideClickDispatcher","_animationsDisabled","_backdropClick","Subject","_attachments","_detachments","_positionStrategy","_scrollStrategy","_locationChanges","Subscription","EMPTY","_backdropRef","_detachContentMutationObserver","_detachContentAfterRenderRef","_disposed","_previousHostParent","_afterNextRenderRef","backdropElement","hostElement","portal","_attachHost","attachResult","_updateStackingOrder","_updateElementSize","_updateElementDirection","destroy","afterNextRender","_togglePointerEvents","_attachBackdrop","_toggleClasses","_completeDetachContent","onDestroy","Promise","resolve","then","detachBackdrop","detachmentResult","_detachContentWhenEmpty","isAttached","_disposeScrollStrategy","complete","backdropClick","attachments","detachments","keydownEvents","getConfig","apply","updatePositionStrategy","strategy","updateSize","sizeConfig","setDirection","dir","addPanelClass","classes","removePanelClass","getDirection","updateScrollStrategy","enablePointer","parentElement","customInsertionPoint","getPopoverInsertionPoint","after","showingClass","prepend","insertBefore","requestAnimationFrame","nextSibling","cssClasses","isAdd","coerceArray","c","rethrow","_detachContent","e","globalThis","MutationObserver","observe","childList","children","disconnect","boundingBoxClass","cssUnitPattern","createFlexibleConnectedPositionStrategy","FlexibleConnectedPositionStrategy","_overlayContainer","_isInitialRender","_lastBoundingBoxSize","_isPushed","_canPush","_growAfterOpen","_hasFlexibleDimensions","_positionLocked","_originRect","_overlayRect","_viewportRect","_containerRect","_viewportMargin","_scrollables","_preferredPositions","_origin","_isDisposed","_boundingBox","_lastPosition","_lastScrollVisibility","_positionChanges","_resizeSubscription","_offsetX","_offsetY","_transformOriginSelector","_appliedPanelClasses","_previousPushAmount","_popoverLocation","positionChanges","positions","connectedTo","setOrigin","_validatePositions","change","reapplyLastPosition","_clearPanelClasses","_resetOverlayElementStyles","_resetBoundingBoxStyles","_getNarrowedViewportRect","_getOriginRect","_getContainerRect","originRect","viewportRect","containerRect","flexibleFits","fallback","pos","originPoint","_getOriginPoint","overlayPoint","_getOverlayPoint","overlayFit","_getOverlayFit","isCompletelyWithinViewport","_applyPosition","_canFitWithFlexibleDimensions","position","boundingBoxRect","_calculateBoundingBoxRect","visibleArea","bestFit","bestScore","fit","score","weight","extendStyles","alignItems","justifyContent","lastPosition","withScrollableContainers","scrollables","withPositions","withViewportMargin","margin","withFlexibleDimensions","flexibleDimensions","withGrowAfterOpen","growAfterOpen","withPush","canPush","withLockedPosition","isLocked","withDefaultOffsetX","offset","withDefaultOffsetY","withTransformOriginOn","selector","withPopoverLocation","location","ElementRef","x","startX","_isRtl","endX","y","overlayStartX","overlayStartY","point","rawOverlayRect","getRoundedBoundingClientRect","_getOffset","leftOverflow","rightOverflow","topOverflow","bottomOverflow","visibleWidth","_subtractOverflows","visibleHeight","fitsInViewportVertically","fitsInViewportHorizontally","availableHeight","availableWidth","getPixelValue","verticalFit","horizontalFit","_pushOverlayOnScreen","start","overflowRight","max","overflowBottom","overflowTop","overflowLeft","pushX","pushY","_getViewportMarginStart","_getViewportMarginTop","_setTransformOrigin","_setOverlayElementStyles","_setBoundingBoxStyles","_addPanelClasses","scrollVisibility","_getScrollVisibility","compareScrollVisibility","changeEvent","elements","xOrigin","yOrigin","transformOrigin","isRtl","_getViewportMarginBottom","smallestDistanceToViewportEdge","min","previousHeight","isBoundedByRightViewportEdge","isBoundedByLeftViewportEdge","_getViewportMarginEnd","previousWidth","_hasExactPosition","transform","hasExactPosition","hasFlexibleDimensions","_getExactOverlayY","_getExactOverlayX","transformString","trim","documentHeight","clientHeight","horizontalStyleProperty","documentWidth","clientWidth","originBounds","overlayBounds","scrollContainerBounds","map","overflows","reduce","currentValue","currentOverflow","axis","pair","cssClass","end","Element","isInlinePopover","display","dimensions","destination","source","hasOwnProperty","input","units","split","parseFloat","clientRect","floor","a","b","STANDARD_DROPDOWN_BELOW_POSITIONS","STANDARD_DROPDOWN_ADJACENT_POSITIONS","wrapperClass","createGlobalPositionStrategy","GlobalPositionStrategy","_cssPosition","_topOffset","_bottomOffset","_alignItems","_xPosition","_xOffset","_width","_height","centerHorizontally","centerVertically","parentStyles","shouldBeFlushHorizontally","shouldBeFlushVertically","xPosition","xOffset","marginLeft","marginRight","marginTop","marginBottom","OverlayPositionBuilder","global","flexibleConnectedTo","OVERLAY_DEFAULT_CONFIG","InjectionToken","createOverlayRef","overlayContainer","doc","idGenerator","_IdGenerator","appRef","ApplicationRef","directionality","Directionality","Renderer2","optional","overlayConfig","defaultUsePopover","pane","id","getId","DomPortalOutlet","Location","ANIMATION_MODULE_TYPE","EnvironmentInjector","Overlay","scrollStrategies","_positionBuilder","create","defaultPositionList","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY","factory","CdkOverlayOrigin","elementRef","Directive","isStandalone","exportAs","CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG","CdkConnectedOverlay","_dir","_templatePortal","_backdropSubscription","_attachSubscription","_detachSubscription","_positionSubscription","_position","_scrollStrategyFactory","_updatePositionStrategy","viewportMargin","open","disableClose","transformOriginSelector","lockPosition","matchWidth","_assignConfig","EventEmitter","positionChange","overlayKeydown","overlayOutsideClick","templateRef","TemplateRef","viewContainerRef","ViewContainerRef","defaultConfig","globalConfig","TemplatePortal","ngOnChanges","changes","_getWidth","attachOverlay","detachOverlay","_createOverlay","_buildConfig","emit","keyCode","ESCAPE","hasModifierKey","preventDefault","_getOriginElement","_createPositionStrategy","currentPosition","_getOrigin","ref","takeWhile","ɵdir","ɵɵngDeclareDirective","inputs","booleanAttribute","outputs","usesOnChanges","Input","alias","Output","OverlayModule","NgModule","ɵmod","ɵɵngDeclareNgModule","imports","BidiModule","PortalModule","ScrollingModule","exports","providers"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,uBAAuB,GAAGC,sBAAsB,EAAE;AAOlD,SAAUC,yBAAyBA,CAACC,QAAkB,EAAA;AAC1D,EAAA,OAAO,IAAIC,mBAAmB,CAACD,QAAQ,CAACE,GAAG,CAACC,aAAa,CAAC,EAAEH,QAAQ,CAACE,GAAG,CAACE,QAAQ,CAAC,CAAC;AACrF;MAKaH,mBAAmB,CAAA;EAOpBI,cAAA;AANFC,EAAAA,mBAAmB,GAAG;AAACC,IAAAA,GAAG,EAAE,E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