UNPKG

@ng-bootstrap/ng-bootstrap

Version:
1 lines 40.1 kB
{"version":3,"file":"ng-bootstrap-ng-bootstrap-scrollspy.mjs","sources":["../../../src/scrollspy/scrollspy.utils.ts","../../../src/scrollspy/scrollspy-config.ts","../../../src/scrollspy/scrollspy.service.ts","../../../src/scrollspy/scrollspy.ts","../../../src/scrollspy/scrollspy.module.ts","../../../src/scrollspy/ng-bootstrap-ng-bootstrap-scrollspy.ts"],"sourcesContent":["import { NgbScrollSpyOptions, NgbScrollSpyProcessChanges, NgbScrollSpyService } from './scrollspy.service';\nimport { isString } from './_ngb-ngbootstrap-utilities.mjs';\n\nexport function toFragmentElement(container: Element | null, id?: string | HTMLElement | null): HTMLElement | null {\n\tif (!container || id == null) {\n\t\treturn null;\n\t}\n\treturn isString(id) ? container.querySelector(`#${CSS.escape(id)}`) : id;\n}\n\nfunction getOrderedFragments(container: Element, fragments: Set<Element>): Element[] {\n\tconst selector = [...fragments].map(({ id }) => `#${CSS.escape(id)}`).join(',');\n\treturn Array.from(container.querySelectorAll(selector));\n}\n\nexport const defaultProcessChanges: NgbScrollSpyProcessChanges = (\n\tstate: {\n\t\tentries: IntersectionObserverEntry[];\n\t\trootElement: HTMLElement;\n\t\tfragments: Set<Element>;\n\t\tscrollSpy: NgbScrollSpyService;\n\t\toptions: NgbScrollSpyOptions;\n\t},\n\tchangeActive: (active: string) => void,\n\tctx: {\n\t\tinitialized: boolean;\n\t\tgapFragment: Element | null;\n\t\tvisibleFragments: Set<Element>;\n\t},\n) => {\n\tconst { rootElement, fragments, scrollSpy, options, entries } = state;\n\tconst orderedFragments = getOrderedFragments(rootElement, fragments);\n\n\tif (!ctx.initialized) {\n\t\tctx.initialized = true;\n\t\tctx.gapFragment = null;\n\t\tctx.visibleFragments = new Set<Element>();\n\n\t\t// special case when one of the fragments was pre-selected\n\t\tconst preSelectedFragment = toFragmentElement(rootElement, options?.initialFragment);\n\t\tif (preSelectedFragment) {\n\t\t\tscrollSpy.scrollTo(preSelectedFragment);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tfor (const entry of entries) {\n\t\tconst { isIntersecting, target: fragment } = entry;\n\n\t\t// 1. an entry became visible\n\t\tif (isIntersecting) {\n\t\t\t// if we were in-between two elements, we have to clear it up\n\t\t\tif (ctx.gapFragment) {\n\t\t\t\tctx.visibleFragments.delete(ctx.gapFragment);\n\t\t\t\tctx.gapFragment = null;\n\t\t\t}\n\n\t\t\tctx.visibleFragments.add(fragment);\n\t\t}\n\n\t\t// 2. an entry became invisible\n\t\telse {\n\t\t\tctx.visibleFragments.delete(fragment);\n\n\t\t\t// nothing is visible anymore, but something just was actually\n\t\t\tif (ctx.visibleFragments.size === 0 && scrollSpy.active !== '') {\n\t\t\t\t// 2.1 scrolling down - keeping the same element\n\t\t\t\tif (entry.boundingClientRect.top < entry.rootBounds!.top) {\n\t\t\t\t\tctx.gapFragment = fragment;\n\t\t\t\t\tctx.visibleFragments.add(ctx.gapFragment);\n\t\t\t\t}\n\t\t\t\t// 2.2 scrolling up - getting the previous element\n\t\t\t\telse {\n\t\t\t\t\t// scrolling up and no more fragments above\n\t\t\t\t\tif (fragment === orderedFragments[0]) {\n\t\t\t\t\t\tctx.gapFragment = null;\n\t\t\t\t\t\tctx.visibleFragments.clear();\n\t\t\t\t\t\tchangeActive('');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// getting previous fragment\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst fragmentIndex = orderedFragments.indexOf(fragment);\n\t\t\t\t\t\tctx.gapFragment = orderedFragments[fragmentIndex - 1] || null;\n\t\t\t\t\t\tif (ctx.gapFragment) {\n\t\t\t\t\t\t\tctx.visibleFragments.add(ctx.gapFragment);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// getting the first visible element in the DOM order of the fragments\n\tfor (const fragment of orderedFragments) {\n\t\tif (ctx.visibleFragments.has(fragment)) {\n\t\t\tchangeActive(fragment.id);\n\t\t\tbreak;\n\t\t}\n\t}\n};\n","import { Injectable } from '@angular/core';\nimport { NgbScrollSpyProcessChanges } from './scrollspy.service';\nimport { defaultProcessChanges } from './scrollspy.utils';\n\n/**\n * A configuration service for the [`NgbScrollSpyService`](#/components/scrollspy/api#NgbScrollSpyService).\n *\n * You can inject this service, typically in your root component, and customize the values of its properties in\n * order to provide default values for all scrollspies used in the application.\n *\n * @since 15.1.0\n */\n@Injectable({ providedIn: 'root' })\nexport class NgbScrollSpyConfig {\n\tscrollBehavior: 'auto' | 'smooth' = 'smooth';\n\tprocessChanges: NgbScrollSpyProcessChanges = defaultProcessChanges;\n}\n","import { ChangeDetectorRef, inject, Injectable, NgZone, OnDestroy, PLATFORM_ID, DOCUMENT } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { NgbScrollSpyRef } from './scrollspy';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { NgbScrollSpyConfig } from './scrollspy-config';\nimport { isPlatformBrowser } from '@angular/common';\nimport { toFragmentElement } from './scrollspy.utils';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nconst MATCH_THRESHOLD = 3;\n\nexport type NgbScrollSpyProcessChanges = (\n\tstate: {\n\t\tentries: IntersectionObserverEntry[];\n\t\trootElement: HTMLElement;\n\t\tfragments: Set<Element>;\n\t\tscrollSpy: NgbScrollSpyService;\n\t\toptions: NgbScrollSpyOptions;\n\t},\n\tchangeActive: (active: string) => void,\n\tcontext: object,\n) => void;\n\n/**\n * Options passed to the `NgbScrollSpyService.start()` method for scrollspy initialization.\n *\n * It contains a subset of the `IntersectionObserverInit` options, as well additional optional properties\n * like `changeDetectorRef` or `fragments`\n *\n * @since 15.1.0\n */\nexport interface NgbScrollSpyOptions extends Pick<IntersectionObserverInit, 'root' | 'rootMargin' | 'threshold'> {\n\t/**\n\t * An optional reference to the change detector, that should be marked for check when active fragment changes.\n\t * If it is not provided, the service will try to get it from the DI. Ex. when using the `ngbScrollSpy` directive,\n\t * it will mark for check the directive's host component.\n\t *\n\t * `.markForCheck()` will be called on the change detector when the active fragment changes.\n\t */\n\tchangeDetectorRef?: ChangeDetectorRef;\n\n\t/**\n\t * An optional initial fragment to scroll to when the service starts.\n\t */\n\tinitialFragment?: string | HTMLElement;\n\n\t/**\n\t * An optional list of fragments to observe when the service starts.\n\t * You can alternatively use `.addFragment()` to add fragments.\n\t */\n\tfragments?: (string | HTMLElement)[];\n\n\t/**\n\t * An optional function that is called when the `IntersectionObserver` detects a change.\n\t * It is used to determine if currently active fragment should be changed.\n\t *\n\t * You can override this function to provide your own scrollspy logic.\n\t * It provides:\n\t * - a scrollspy `state` (observer entries, root element, fragments, scrollSpy instance, etc.)\n\t * - a `changeActive` function that should be called with the new active fragment\n\t * - a `context` that is persisted between calls\n\t */\n\tprocessChanges?: NgbScrollSpyProcessChanges;\n\n\t/**\n\t * An optional `IntersectionObserver` root element. If not provided, the document element will be used.\n\t */\n\troot?: HTMLElement;\n\n\t/**\n\t * An optional `IntersectionObserver` margin for the root element.\n\t */\n\trootMargin?: string;\n\n\t/**\n\t * An optional default scroll behavior to use when using the `.scrollTo()` method.\n\t */\n\tscrollBehavior?: 'auto' | 'smooth';\n\n\t/**\n\t * An optional `IntersectionObserver` threshold.\n\t */\n\tthreshold?: number | number[];\n}\n\n/**\n * Scroll options passed to the `.scrollTo()` method.\n * An extension of the standard `ScrollOptions` interface.\n *\n * @since 15.1.0\n */\nexport interface NgbScrollToOptions extends ScrollOptions {\n\t/**\n\t * Scroll behavior as defined in the `ScrollOptions` interface.\n\t */\n\tbehavior?: 'auto' | 'smooth';\n}\n\n/**\n * A scrollspy service that allows tracking of elements scrolling in and out of view.\n *\n * It can be instantiated manually, or automatically by the `ngbScrollSpy` directive.\n *\n * @since 15.1.0\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class NgbScrollSpyService implements NgbScrollSpyRef, OnDestroy {\n\tprivate _observer: IntersectionObserver | null = null;\n\n\tprivate _containerElement: HTMLElement | null = null;\n\tprivate _fragments = new Set<Element>();\n\tprivate _preRegisteredFragments = new Set<string | HTMLElement>();\n\n\tprivate _active$ = new Subject<string>();\n\tprivate _distinctActive$ = this._active$.pipe(distinctUntilChanged());\n\tprivate _active = '';\n\n\tprivate _config = inject(NgbScrollSpyConfig);\n\tprivate _document = inject(DOCUMENT);\n\tprivate _platformId = inject(PLATFORM_ID);\n\tprivate _scrollBehavior = this._config.scrollBehavior;\n\tprivate _diChangeDetectorRef = inject(ChangeDetectorRef, { optional: true });\n\tprivate _changeDetectorRef = this._diChangeDetectorRef;\n\tprivate _zone = inject(NgZone);\n\n\tconstructor() {\n\t\tthis._distinctActive$.pipe(takeUntilDestroyed()).subscribe((active) => {\n\t\t\tthis._active = active;\n\t\t\tthis._changeDetectorRef?.markForCheck();\n\t\t});\n\t}\n\n\t/**\n\t * Getter for the currently active fragment id. Returns empty string if none.\n\t */\n\tget active(): string {\n\t\treturn this._active;\n\t}\n\n\t/**\n\t * An observable emitting the currently active fragment. Emits empty string if none.\n\t */\n\tget active$(): Observable<string> {\n\t\treturn this._distinctActive$;\n\t}\n\n\t/**\n\t * Starts the scrollspy service and observes specified fragments.\n\t *\n\t * You can specify a list of options to pass, like the root element, initial fragment, scroll behavior, etc.\n\t * See the [`NgbScrollSpyOptions`](#/components/scrollspy/api#NgbScrollSpyOptions) interface for more details.\n\t */\n\tstart(options?: NgbScrollSpyOptions) {\n\t\tif (isPlatformBrowser(this._platformId)) {\n\t\t\tthis._cleanup();\n\n\t\t\tconst { root, rootMargin, scrollBehavior, threshold, fragments, changeDetectorRef, processChanges } = {\n\t\t\t\t...options,\n\t\t\t};\n\t\t\tthis._containerElement = root ?? this._document.documentElement;\n\t\t\tthis._changeDetectorRef = changeDetectorRef ?? this._diChangeDetectorRef;\n\t\t\tthis._scrollBehavior = scrollBehavior ?? this._config.scrollBehavior;\n\t\t\tconst processChangesFn = processChanges ?? this._config.processChanges;\n\n\t\t\tconst context = {};\n\t\t\tthis._observer = new IntersectionObserver(\n\t\t\t\t(entries) =>\n\t\t\t\t\tprocessChangesFn(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tentries,\n\t\t\t\t\t\t\trootElement: this._containerElement!,\n\t\t\t\t\t\t\tfragments: this._fragments,\n\t\t\t\t\t\t\tscrollSpy: this,\n\t\t\t\t\t\t\toptions: { ...options },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(active: string) => this._active$.next(active),\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\troot: root ?? this._document,\n\t\t\t\t\t...(rootMargin && { rootMargin }),\n\t\t\t\t\t...(threshold && { threshold }),\n\t\t\t\t},\n\t\t\t);\n\n\t\t\t// merging fragments added before starting and the ones passed as options\n\t\t\tfor (const element of [...this._preRegisteredFragments, ...(fragments ?? [])]) {\n\t\t\t\tthis.observe(element);\n\t\t\t}\n\n\t\t\tthis._preRegisteredFragments.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Stops the service and unobserves all fragments.\n\t */\n\tstop() {\n\t\tthis._cleanup();\n\t\tthis._active$.next('');\n\t}\n\n\t/**\n\t * Scrolls to a fragment, it must be known to the service and contained in the root element.\n\t * An id or an element reference can be passed.\n\t *\n\t * [`NgbScrollToOptions`](#/components/scrollspy/api#NgbScrollToOptions) can be passed.\n\t */\n\tscrollTo(fragment: string | HTMLElement, options?: NgbScrollToOptions) {\n\t\tconst { behavior } = { behavior: this._scrollBehavior, ...options };\n\n\t\tif (this._containerElement) {\n\t\t\tconst fragmentElement = toFragmentElement(this._containerElement, fragment);\n\n\t\t\tif (fragmentElement) {\n\t\t\t\tconst heightPx = fragmentElement.offsetTop - this._containerElement.offsetTop;\n\n\t\t\t\tthis._containerElement.scrollTo({ top: heightPx, behavior });\n\n\t\t\t\tlet lastOffset = this._containerElement.scrollTop;\n\t\t\t\tlet matchCounter = 0;\n\n\t\t\t\t// we should update the active section only after scrolling is finished\n\t\t\t\t// and there is no clean way to do it at the moment\n\t\t\t\tconst containerElement = this._containerElement;\n\t\t\t\tthis._zone.runOutsideAngular(() => {\n\t\t\t\t\tconst updateActiveWhenScrollingIsFinished = () => {\n\t\t\t\t\t\tconst sameOffsetAsLastTime = lastOffset === containerElement.scrollTop;\n\n\t\t\t\t\t\tif (sameOffsetAsLastTime) {\n\t\t\t\t\t\t\tmatchCounter++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmatchCounter = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!sameOffsetAsLastTime || (sameOffsetAsLastTime && matchCounter < MATCH_THRESHOLD)) {\n\t\t\t\t\t\t\tlastOffset = containerElement.scrollTop;\n\n\t\t\t\t\t\t\trequestAnimationFrame(updateActiveWhenScrollingIsFinished);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._zone.run(() => this._active$.next(fragmentElement.id));\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\trequestAnimationFrame(updateActiveWhenScrollingIsFinished);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Adds a fragment to observe. It must be contained in the root element.\n\t * An id or an element reference can be passed.\n\t */\n\tobserve(fragment: string | HTMLElement) {\n\t\tif (!this._observer) {\n\t\t\tthis._preRegisteredFragments.add(fragment);\n\t\t\treturn;\n\t\t}\n\n\t\tconst fragmentElement = toFragmentElement(this._containerElement, fragment);\n\n\t\tif (fragmentElement && !this._fragments.has(fragmentElement)) {\n\t\t\tthis._fragments.add(fragmentElement);\n\t\t\tthis._observer.observe(fragmentElement);\n\t\t}\n\t}\n\n\t/**\n\t * Unobserves a fragment.\n\t * An id or an element reference can be passed.\n\t */\n\tunobserve(fragment: string | HTMLElement) {\n\t\tif (!this._observer) {\n\t\t\tthis._preRegisteredFragments.delete(fragment);\n\t\t\treturn;\n\t\t}\n\n\t\tconst fragmentElement = toFragmentElement(this._containerElement, fragment);\n\n\t\tif (fragmentElement) {\n\t\t\tthis._fragments.delete(fragmentElement);\n\n\t\t\t// we're removing and re-adding all current fragments to recompute active one\n\t\t\tthis._observer.disconnect();\n\n\t\t\tfor (const fragment of this._fragments) {\n\t\t\t\tthis._observer.observe(fragment);\n\t\t\t}\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis._cleanup();\n\t}\n\n\tprivate _cleanup() {\n\t\tthis._fragments.clear();\n\t\tthis._observer?.disconnect();\n\t\tthis._changeDetectorRef = this._diChangeDetectorRef;\n\t\tthis._scrollBehavior = this._config.scrollBehavior;\n\t\tthis._observer = null;\n\t\tthis._containerElement = null;\n\t}\n}\n","import {\n\tAfterViewInit,\n\tChangeDetectorRef,\n\tContentChildren,\n\tDestroyRef,\n\tDirective,\n\tElementRef,\n\tinject,\n\tInput,\n\tOnInit,\n\tOutput,\n\tQueryList,\n} from '@angular/core';\nimport { NgbScrollSpyProcessChanges, NgbScrollSpyService, NgbScrollToOptions } from './scrollspy.service';\nimport { Observable } from 'rxjs';\nimport { isString } from './_ngb-ngbootstrap-utilities.mjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n/**\n * Common interface for the scroll spy API.\n *\n * @internal\n */\nexport interface NgbScrollSpyRef {\n\tget active(): string;\n\tget active$(): Observable<string>;\n\tscrollTo(fragment: string | HTMLElement, options?: NgbScrollToOptions): void;\n}\n\n/**\n * A helper directive to that links menu items and fragments together.\n *\n * It will automatically add the `.active` class to the menu item when the associated fragment becomes active.\n *\n * @since 15.1.0\n */\n@Directive({\n\tselector: '[ngbScrollSpyItem]',\n\texportAs: 'ngbScrollSpyItem',\n\thost: {\n\t\t'[class.active]': 'isActive()',\n\t\t'(click)': 'scrollTo();',\n\t},\n})\nexport class NgbScrollSpyItem implements OnInit {\n\tprivate _changeDetector = inject(ChangeDetectorRef);\n\tprivate _scrollSpyMenu = inject(NgbScrollSpyMenu, { optional: true });\n\tprivate _scrollSpyAPI: NgbScrollSpyRef = this._scrollSpyMenu ?? inject(NgbScrollSpyService);\n\tprivate _destroyRef = inject(DestroyRef);\n\n\tprivate _isActive = false;\n\n\t/**\n\t * References the scroll spy directive, the id of the associated fragment and the parent menu item.\n\t *\n\t * Can be used like:\n\t * - `ngbScrollSpyItem=\"fragmentId\"`\n\t * - `[ngbScrollSpyItem]=\"scrollSpy\" fragment=\"fragmentId\"\n\t * - `[ngbScrollSpyItem]=\"[scrollSpy, 'fragmentId']\"` parent=\"parentId\"`\n\t * - `[ngbScrollSpyItem]=\"[scrollSpy, 'fragmentId', 'parentId']\"`\n\t *\n\t * As well as together with `[fragment]` and `[parent]` inputs.\n\t */\n\t@Input('ngbScrollSpyItem') set data(data: NgbScrollSpy | string | [NgbScrollSpy, string, string?]) {\n\t\tif (Array.isArray(data)) {\n\t\t\tthis._scrollSpyAPI = data[0];\n\t\t\tthis.fragment = data[1];\n\t\t\tthis.parent ??= data[2];\n\t\t} else if (data instanceof NgbScrollSpy) {\n\t\t\tthis._scrollSpyAPI = data;\n\t\t} else if (isString(data)) {\n\t\t\tthis.fragment = data;\n\t\t}\n\t}\n\n\t/**\n\t * The id of the associated fragment.\n\t */\n\t@Input() fragment: string;\n\n\t/**\n\t * The id of the parent scroll spy menu item.\n\t */\n\t@Input() parent: string | undefined;\n\n\tngOnInit(): void {\n\t\t// if it is not a part of a bigger menu, it should handle activation itself\n\t\tif (!this._scrollSpyMenu) {\n\t\t\tthis._scrollSpyAPI.active$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((active: string) => {\n\t\t\t\tif (active === this.fragment) {\n\t\t\t\t\tthis._activate();\n\t\t\t\t} else {\n\t\t\t\t\tthis._deactivate();\n\t\t\t\t}\n\t\t\t\tthis._changeDetector.markForCheck();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\t_activate(): void {\n\t\tthis._isActive = true;\n\t\tif (this._scrollSpyMenu) {\n\t\t\tthis._scrollSpyMenu.getItem(this.parent ?? '')?._activate();\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\t_deactivate(): void {\n\t\tthis._isActive = false;\n\t\tif (this._scrollSpyMenu) {\n\t\t\tthis._scrollSpyMenu.getItem(this.parent ?? '')?._deactivate();\n\t\t}\n\t}\n\n\t/**\n\t * Returns `true`, if the associated fragment is active.\n\t */\n\tisActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\t/**\n\t * Scrolls to the associated fragment.\n\t */\n\tscrollTo(options?: NgbScrollToOptions): void {\n\t\tthis._scrollSpyAPI.scrollTo(this.fragment, options);\n\t}\n}\n\n/**\n * An optional scroll spy menu directive to build hierarchical menus\n * and simplify the [`NgbScrollSpyItem`](#/components/scrollspy/api#NgbScrollSpyItem) configuration.\n *\n * @since 15.1.0\n */\n@Directive({\n\tselector: '[ngbScrollSpyMenu]',\n})\nexport class NgbScrollSpyMenu implements NgbScrollSpyRef, AfterViewInit {\n\tprivate _scrollSpyRef: NgbScrollSpyRef = inject(NgbScrollSpyService);\n\tprivate _destroyRef = inject(DestroyRef);\n\tprivate _map = new Map<string, NgbScrollSpyItem>();\n\tprivate _lastActiveItem: NgbScrollSpyItem | null = null;\n\n\t@ContentChildren(NgbScrollSpyItem, { descendants: true }) private _items: QueryList<NgbScrollSpyItem>;\n\n\t@Input('ngbScrollSpyMenu') set scrollSpy(scrollSpy: NgbScrollSpy) {\n\t\tthis._scrollSpyRef = scrollSpy;\n\t}\n\n\tget active(): string {\n\t\treturn this._scrollSpyRef.active;\n\t}\n\tget active$(): Observable<string> {\n\t\treturn this._scrollSpyRef.active$;\n\t}\n\tscrollTo(fragment: string, options?: NgbScrollToOptions): void {\n\t\tthis._scrollSpyRef.scrollTo(fragment, options);\n\t}\n\n\tgetItem(id: string): NgbScrollSpyItem | undefined {\n\t\treturn this._map.get(id);\n\t}\n\n\tngAfterViewInit() {\n\t\tthis._items.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this._rebuildMap());\n\t\tthis._rebuildMap();\n\n\t\tthis._scrollSpyRef.active$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((activeId) => {\n\t\t\tthis._lastActiveItem?._deactivate();\n\t\t\tconst item = this._map.get(activeId);\n\t\t\tif (item) {\n\t\t\t\titem._activate();\n\t\t\t\tthis._lastActiveItem = item;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _rebuildMap() {\n\t\tthis._map.clear();\n\t\tfor (let item of this._items) {\n\t\t\tthis._map.set(item.fragment, item);\n\t\t}\n\t}\n}\n\n/**\n * A directive to put on a scrollable container.\n *\n * It will instantiate a [`NgbScrollSpyService`](#/components/scrollspy/api#NgbScrollSpyService).\n *\n * @since 15.1.0\n */\n@Directive({\n\tselector: '[ngbScrollSpy]',\n\texportAs: 'ngbScrollSpy',\n\thost: {\n\t\ttabindex: '0',\n\t\tstyle: 'overflow-y: auto',\n\t},\n\tproviders: [NgbScrollSpyService],\n})\nexport class NgbScrollSpy implements NgbScrollSpyRef, AfterViewInit {\n\tstatic ngAcceptInputType_scrollBehavior: string;\n\n\tprivate _initialFragment: string | null = null;\n\tprivate _service = inject(NgbScrollSpyService);\n\tprivate _nativeElement = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n\t/**\n\t * A function that is called when the `IntersectionObserver` detects a change.\n\t *\n\t * See [`NgbScrollSpyOptions`](#/components/scrollspy/api#NgbScrollSpyOptions) for more details.\n\t */\n\t@Input() processChanges: NgbScrollSpyProcessChanges;\n\n\t/**\n\t * An `IntersectionObserver` root margin.\n\t */\n\t@Input() rootMargin: string;\n\n\t/**\n\t * The scroll behavior for the `.scrollTo()` method.\n\t */\n\t@Input() scrollBehavior: 'auto' | 'smooth';\n\n\t/**\n\t * An `IntersectionObserver` threshold.\n\t */\n\t@Input() threshold: number | number[];\n\n\t@Input() set active(fragment: string) {\n\t\tthis._initialFragment = fragment;\n\t\tthis.scrollTo(fragment);\n\t}\n\n\t/**\n\t * An event raised when the active section changes.\n\t *\n\t * Payload is the id of the new active section, empty string if none.\n\t */\n\t@Output() activeChange = this._service.active$;\n\n\t/**\n\t * Getter/setter for the currently active fragment id.\n\t */\n\tget active(): string {\n\t\treturn this._service.active;\n\t}\n\n\t/**\n\t * Returns an observable that emits currently active section id.\n\t */\n\tget active$(): Observable<string> {\n\t\treturn this._service.active$;\n\t}\n\n\tngAfterViewInit(): void {\n\t\tthis._service.start({\n\t\t\tprocessChanges: this.processChanges,\n\t\t\troot: this._nativeElement,\n\t\t\trootMargin: this.rootMargin,\n\t\t\tthreshold: this.threshold,\n\t\t\t...(this._initialFragment && { initialFragment: this._initialFragment }),\n\t\t});\n\t}\n\n\t/**\n\t * @internal\n\t */\n\t_registerFragment(fragment: NgbScrollSpyFragment): void {\n\t\tthis._service.observe(fragment.id);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\t_unregisterFragment(fragment: NgbScrollSpyFragment): void {\n\t\tthis._service.unobserve(fragment.id);\n\t}\n\n\t/**\n\t * Scrolls to a fragment that is identified by the `ngbScrollSpyFragment` directive.\n\t * An id or an element reference can be passed.\n\t */\n\tscrollTo(fragment: string | HTMLElement, options?: NgbScrollToOptions): void {\n\t\tthis._service.scrollTo(fragment, {\n\t\t\t...(this.scrollBehavior && { behavior: this.scrollBehavior }),\n\t\t\t...options,\n\t\t});\n\t}\n}\n\n/**\n * A directive to put on a fragment observed inside a scrollspy container.\n *\n * @since 15.1.0\n */\n@Directive({\n\tselector: '[ngbScrollSpyFragment]',\n\thost: {\n\t\t'[id]': 'id',\n\t},\n})\nexport class NgbScrollSpyFragment implements AfterViewInit {\n\tprivate _destroyRef = inject(DestroyRef);\n\tprivate _scrollSpy = inject(NgbScrollSpy);\n\n\t/**\n\t * The unique id of the fragment.\n\t * It must be a string unique to the document, as it will be set as the id of the element.\n\t */\n\t@Input('ngbScrollSpyFragment') id: string;\n\n\tngAfterViewInit() {\n\t\tthis._scrollSpy._registerFragment(this);\n\t\tthis._destroyRef.onDestroy(() => this._scrollSpy._unregisterFragment(this));\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { NgbScrollSpy, NgbScrollSpyFragment, NgbScrollSpyItem, NgbScrollSpyMenu } from './scrollspy';\n\nexport { NgbScrollSpy, NgbScrollSpyItem, NgbScrollSpyFragment, NgbScrollSpyMenu } from './scrollspy';\nexport { NgbScrollSpyConfig } from './scrollspy-config';\nexport { NgbScrollSpyService, NgbScrollSpyProcessChanges } from './scrollspy.service';\n\n@NgModule({\n\timports: [NgbScrollSpy, NgbScrollSpyItem, NgbScrollSpyFragment, NgbScrollSpyMenu],\n\texports: [NgbScrollSpy, NgbScrollSpyItem, NgbScrollSpyFragment, NgbScrollSpyMenu],\n})\nexport class NgbScrollSpyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAGM,SAAU,iBAAiB,CAAC,SAAyB,EAAE,EAAgC,EAAA;AAC5F,IAAA,IAAI,CAAC,SAAS,IAAI,EAAE,IAAI,IAAI,EAAE;AAC7B,QAAA,OAAO,IAAI;IACZ;IACA,OAAO,QAAQ,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,aAAa,CAAC,CAAA,CAAA,EAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA,CAAE,CAAC,GAAG,EAAE;AACzE;AAEA,SAAS,mBAAmB,CAAC,SAAkB,EAAE,SAAuB,EAAA;AACvE,IAAA,MAAM,QAAQ,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAA,CAAA,EAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA,CAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/E,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACxD;AAEO,MAAM,qBAAqB,GAA+B,CAChE,KAMC,EACD,YAAsC,EACtC,GAIC,KACE;AACH,IAAA,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAA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