{"version":3,"sources":["node_modules/file-saver/dist/FileSaver.min.js","src/app/shared/tag-badge/tag-badge.component.ts","src/app/shared/tag-badge/tag-badge.component.html","src/app/_providers/saver.provider.ts","src/app/shared/_models/download.ts","src/app/_pipes/bytes.pipe.ts","src/app/shared/_services/download.service.ts","src/app/_services/collection-tag.service.ts","src/app/_models/metadata/person.ts","src/app/typeahead/_components/typeahead.component.ts","src/app/typeahead/_components/typeahead.component.html","src/app/shared/_services/filter-utilities.service.ts","node_modules/@angular/cdk/fesm2022/coercion.mjs","node_modules/@angular/cdk/fesm2022/platform.mjs","node_modules/@angular/cdk/fesm2022/bidi.mjs","node_modules/@angular/cdk/fesm2022/scrolling.mjs","node_modules/@angular/cdk/fesm2022/keycodes.mjs","node_modules/@angular/cdk/fesm2022/overlay.mjs","node_modules/ng-select2-component/node_modules/ngx-infinite-scroll/fesm2022/ngx-infinite-scroll.mjs","node_modules/ng-select2-component/fesm2022/ng-select2-component.mjs"],"sourcesContent":["(function (a, b) {\n if (\"function\" == typeof define && define.amd) define([], b);else if (\"undefined\" != typeof exports) b();else {\n b(), a.FileSaver = {\n exports: {}\n }.exports;\n }\n})(this, function () {\n \"use strict\";\n\n function b(a, b) {\n return \"undefined\" == typeof b ? b = {\n autoBom: !1\n } : \"object\" != typeof b && (console.warn(\"Deprecated: Expected third argument to be a object\"), b = {\n autoBom: !b\n }), b.autoBom && /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type) ? new Blob([\"\\uFEFF\", a], {\n type: a.type\n }) : a;\n }\n function c(a, b, c) {\n var d = new XMLHttpRequest();\n d.open(\"GET\", a), d.responseType = \"blob\", d.onload = function () {\n g(d.response, b, c);\n }, d.onerror = function () {\n console.error(\"could not download file\");\n }, d.send();\n }\n function d(a) {\n var b = new XMLHttpRequest();\n b.open(\"HEAD\", a, !1);\n try {\n b.send();\n } catch (a) {}\n return 200 <= b.status && 299 >= b.status;\n }\n function e(a) {\n try {\n a.dispatchEvent(new MouseEvent(\"click\"));\n } catch (c) {\n var b = document.createEvent(\"MouseEvents\");\n b.initMouseEvent(\"click\", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), a.dispatchEvent(b);\n }\n }\n var f = \"object\" == typeof window && window.window === window ? window : \"object\" == typeof self && self.self === self ? self : \"object\" == typeof global && global.global === global ? global : void 0,\n a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent),\n g = f.saveAs || (\"object\" != typeof window || window !== f ? function () {} : \"download\" in HTMLAnchorElement.prototype && !a ? function (b, g, h) {\n var i = f.URL || f.webkitURL,\n j = document.createElement(\"a\");\n g = g || b.name || \"download\", j.download = g, j.rel = \"noopener\", \"string\" == typeof b ? (j.href = b, j.origin === location.origin ? e(j) : d(j.href) ? c(b, g, h) : e(j, j.target = \"_blank\")) : (j.href = i.createObjectURL(b), setTimeout(function () {\n i.revokeObjectURL(j.href);\n }, 4E4), setTimeout(function () {\n e(j);\n }, 0));\n } : \"msSaveOrOpenBlob\" in navigator ? function (f, g, h) {\n if (g = g || f.name || \"download\", \"string\" != typeof f) navigator.msSaveOrOpenBlob(b(f, h), g);else if (d(f)) c(f, g, h);else {\n var i = document.createElement(\"a\");\n i.href = f, i.target = \"_blank\", setTimeout(function () {\n e(i);\n });\n }\n } : function (b, d, e, g) {\n if (g = g || open(\"\", \"_blank\"), g && (g.document.title = g.document.body.innerText = \"downloading...\"), \"string\" == typeof b) return c(b, d, e);\n var h = \"application/octet-stream\" === b.type,\n i = /constructor/i.test(f.HTMLElement) || f.safari,\n j = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((j || h && i || a) && \"undefined\" != typeof FileReader) {\n var k = new FileReader();\n k.onloadend = function () {\n var a = k.result;\n a = j ? a : a.replace(/^data:[^;]*;/, \"data:attachment/file;\"), g ? g.location.href = a : location = a, g = null;\n }, k.readAsDataURL(b);\n } else {\n var l = f.URL || f.webkitURL,\n m = l.createObjectURL(b);\n g ? g.location = m : location.href = m, g = null, setTimeout(function () {\n l.revokeObjectURL(m);\n }, 4E4);\n }\n });\n f.saveAs = g.saveAs = g, \"undefined\" != typeof module && (module.exports = g);\n});\n\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\r\nimport {CommonModule} from \"@angular/common\";\r\n\r\n/**\r\n * What type of cursor to apply to the tag badge\r\n */\r\nexport enum TagBadgeCursor {\r\n /**\r\n * Allows the user to select text\r\n * cursor: default\r\n */\r\n Selectable,\r\n /**\r\n * Informs the user they can click and interact with badge\r\n * cursor: pointer\r\n */\r\n Clickable,\r\n /**\r\n * Informs the user they cannot click or interact with badge\r\n * cursor: not-allowed\r\n */\r\n NotAllowed,\r\n}\r\n\r\n@Component({\r\n selector: 'app-tag-badge',\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: './tag-badge.component.html',\r\n styleUrls: ['./tag-badge.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class TagBadgeComponent {\r\n\r\n @Input() selectionMode: TagBadgeCursor = TagBadgeCursor.Selectable;\r\n @Input() fillStyle: 'filled' | 'outline' = 'outline';\r\n\r\n get TagBadgeCursor() {\r\n return TagBadgeCursor;\r\n }\r\n}\r\n","
\r\n \r\n
","import {InjectionToken} from '@angular/core'\r\nimport { saveAs } from 'file-saver';\r\n\r\nexport type Saver = (blob: Blob, filename?: string) => void\r\n\r\nexport const SAVER = new InjectionToken('saver')\r\n\r\nexport function getSaver(): Saver {\r\n return saveAs;\r\n}\r\n","import {\r\n HttpEvent,\r\n HttpEventType,\r\n HttpHeaders,\r\n HttpProgressEvent,\r\n HttpResponse\r\n } from \"@angular/common/http\";\r\n import { Observable } from \"rxjs\";\r\n import { scan } from \"rxjs/operators\";\r\n \r\n function isHttpResponse(event: HttpEvent): event is HttpResponse {\r\n return event.type === HttpEventType.Response;\r\n }\r\n \r\n function isHttpProgressEvent(\r\n event: HttpEvent\r\n ): event is HttpProgressEvent {\r\n return (\r\n event.type === HttpEventType.DownloadProgress ||\r\n event.type === HttpEventType.UploadProgress\r\n );\r\n }\r\n\r\n/**\r\n * Encapsulates an inprogress download of a Blob with progress reporting activated\r\n */ \r\nexport interface Download {\r\n content: Blob | null;\r\n progress: number;\r\n state: \"PENDING\" | \"IN_PROGRESS\" | \"DONE\";\r\n filename?: string;\r\n loaded?: number;\r\n total?: number\r\n}\r\n \r\nexport function download(saver?: (b: Blob, filename: string) => void): (source: Observable>) => Observable {\r\n return (source: Observable>) =>\r\n source.pipe(\r\n scan((previous: Download, event: HttpEvent): Download => {\r\n if (isHttpProgressEvent(event)) {\r\n return {\r\n progress: event.total\r\n ? Math.round((100 * event.loaded) / event.total)\r\n : previous.progress,\r\n state: 'IN_PROGRESS',\r\n content: null,\r\n loaded: event.loaded,\r\n total: event.total\r\n }\r\n }\r\n if (isHttpResponse(event)) {\r\n if (saver && event.body) {\r\n saver(event.body, getFilename(event.headers, ''))\r\n }\r\n return {\r\n progress: 100,\r\n state: 'DONE',\r\n content: event.body,\r\n filename: getFilename(event.headers, ''),\r\n }\r\n }\r\n return previous;\r\n },\r\n {state: 'PENDING', progress: 0, content: null}\r\n )\r\n )\r\n }\r\n\r\n\r\nfunction getFilename(headers: HttpHeaders, defaultName: string) {\r\n const tokens = (headers.get('content-disposition') || '').split(';');\r\n let filename = tokens[1].replace('filename=', '').replace(/\"/ig, '').trim(); \r\n if (filename.startsWith('download_') || filename.startsWith('kavita_download_')) {\r\n const ext = filename.substring(filename.lastIndexOf('.'), filename.length);\r\n if (defaultName !== '') {\r\n return defaultName + ext;\r\n }\r\n return filename.replace('kavita_', '').replace('download_', '');\r\n //return defaultName + ext;\r\n }\r\n return filename;\r\n }","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'bytes',\r\n standalone: true\r\n})\r\nexport class BytesPipe implements PipeTransform {\r\n\r\n /**\r\n * Format bytes as human-readable text.\r\n *\r\n * @param bytes Number of bytes.\r\n * @param si True to use metric (SI) units, aka powers of 1000. False to use\r\n * binary (IEC), aka powers of 1024.\r\n * @param dp Number of decimal places to display.\r\n *\r\n * @return Formatted string.\r\n *\r\n * Credit: https://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable-string\r\n */\r\n transform(bytes: number, si=true, dp=1): string {\r\n const thresh = si ? 1000 : 1024;\r\n\r\n if (Math.abs(bytes) < thresh) {\r\n return bytes + ' B';\r\n }\r\n\r\n const units = si\r\n ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\r\n : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\r\n let u = -1;\r\n const r = 10**dp;\r\n\r\n do {\r\n bytes /= thresh;\r\n ++u;\r\n } while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);\r\n\r\n const fixed = bytes.toFixed(dp);\r\n if ((fixed + '').endsWith('.0')) {\r\n return bytes.toFixed(0) + ' ' + units[u];\r\n }\r\n\r\n return fixed + ' ' + units[u];\r\n }\r\n\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport {DestroyRef, inject, Inject, Injectable} from '@angular/core';\r\nimport { Series } from 'src/app/_models/series';\r\nimport { environment } from 'src/environments/environment';\r\nimport { ConfirmService } from '../confirm.service';\r\nimport { Chapter } from 'src/app/_models/chapter';\r\nimport { Volume } from 'src/app/_models/volume';\r\nimport {\r\n asyncScheduler,\r\n BehaviorSubject,\r\n Observable,\r\n tap,\r\n finalize,\r\n of,\r\n filter,\r\n} from 'rxjs';\r\nimport { download, Download } from '../_models/download';\r\nimport { PageBookmark } from 'src/app/_models/readers/page-bookmark';\r\nimport {switchMap, take, takeWhile, throttleTime} from 'rxjs/operators';\r\nimport { AccountService } from 'src/app/_services/account.service';\r\nimport { BytesPipe } from 'src/app/_pipes/bytes.pipe';\r\nimport {translate} from \"@ngneat/transloco\";\r\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\r\nimport {SAVER, Saver} from \"../../_providers/saver.provider\";\r\n\r\nexport const DEBOUNCE_TIME = 100;\r\n\r\nconst bytesPipe = new BytesPipe();\r\n\r\nexport interface DownloadEvent {\r\n /**\r\n * Type of entity being downloaded\r\n */\r\n entityType: DownloadEntityType;\r\n /**\r\n * What to show user. For example, for Series, we might show series name.\r\n */\r\n subTitle: string;\r\n /**\r\n * Progress of the download itself\r\n */\r\n progress: number;\r\n}\r\n\r\n/**\r\n * Valid entity types for downloading\r\n */\r\nexport type DownloadEntityType = 'volume' | 'chapter' | 'series' | 'bookmark' | 'logs';\r\n/**\r\n * Valid entities for downloading. Undefined exclusively for logs.\r\n */\r\nexport type DownloadEntity = Series | Volume | Chapter | PageBookmark[] | undefined;\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class DownloadService {\r\n\r\n private baseUrl = environment.apiUrl;\r\n /**\r\n * Size in bytes in which to inform the user for confirmation before download starts. Defaults to 100 MB.\r\n */\r\n public SIZE_WARNING = 104_857_600;\r\n\r\n private downloadsSource: BehaviorSubject = new BehaviorSubject([]);\r\n public activeDownloads$ = this.downloadsSource.asObservable();\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly confirmService = inject(ConfirmService);\r\n private readonly accountService = inject(AccountService);\r\n private readonly httpClient = inject(HttpClient);\r\n\r\n constructor(@Inject(SAVER) private save: Saver) { }\r\n\r\n\r\n /**\r\n * Returns the entity subtitle (for the event widget) for a given entity\r\n * @param downloadEntityType\r\n * @param downloadEntity\r\n * @returns\r\n */\r\n downloadSubtitle(downloadEntityType: DownloadEntityType, downloadEntity: DownloadEntity | undefined) {\r\n switch (downloadEntityType) {\r\n case 'series':\r\n return (downloadEntity as Series).name;\r\n case 'volume':\r\n return (downloadEntity as Volume).number + '';\r\n case 'chapter':\r\n return (downloadEntity as Chapter).number;\r\n case 'bookmark':\r\n return '';\r\n case 'logs':\r\n return '';\r\n }\r\n }\r\n\r\n /**\r\n * Downloads the entity to the user's system. This handles everything around downloads. This will prompt the user based on size checks and UserPreferences.PromptForDownload.\r\n * This will perform the download at a global level, if you need a handle to the download in question, use downloadService.activeDownloads$ and perform a filter on it.\r\n * @param entityType\r\n * @param entity\r\n * @param callback Optional callback. Returns the download or undefined (if the download is complete).\r\n */\r\n download(entityType: DownloadEntityType, entity: DownloadEntity, callback?: (d: Download | undefined) => void) {\r\n let sizeCheckCall: Observable;\r\n let downloadCall: Observable;\r\n switch (entityType) {\r\n case 'series':\r\n sizeCheckCall = this.downloadSeriesSize((entity as Series).id);\r\n downloadCall = this.downloadSeries(entity as Series);\r\n break;\r\n case 'volume':\r\n sizeCheckCall = this.downloadVolumeSize((entity as Volume).id);\r\n downloadCall = this.downloadVolume(entity as Volume);\r\n break;\r\n case 'chapter':\r\n sizeCheckCall = this.downloadChapterSize((entity as Chapter).id);\r\n downloadCall = this.downloadChapter(entity as Chapter);\r\n break;\r\n case 'bookmark':\r\n sizeCheckCall = of(0);\r\n downloadCall = this.downloadBookmarks(entity as PageBookmark[]);\r\n break;\r\n case 'logs':\r\n sizeCheckCall = of(0);\r\n downloadCall = this.downloadLogs();\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n\r\n this.accountService.currentUser$.pipe(take(1), switchMap(user => {\r\n if (user && user.preferences.promptForDownloadSize) {\r\n return sizeCheckCall;\r\n }\r\n return of(0);\r\n }), switchMap(async (size) => {\r\n return await this.confirmSize(size, entityType);\r\n })\r\n ).pipe(filter(wantsToDownload => {\r\n return wantsToDownload;\r\n }), switchMap(() => {\r\n return downloadCall.pipe(\r\n tap((d) => {\r\n if (callback) callback(d);\r\n }),\r\n takeWhile((val: Download) => {\r\n return val.state != 'DONE';\r\n }),\r\n finalize(() => {\r\n if (callback) callback(undefined);\r\n }))\r\n }), takeUntilDestroyed(this.destroyRef)\r\n ).subscribe(() => {});\r\n }\r\n\r\n private downloadSeriesSize(seriesId: number) {\r\n return this.httpClient.get(this.baseUrl + 'download/series-size?seriesId=' + seriesId);\r\n }\r\n\r\n private downloadVolumeSize(volumeId: number) {\r\n return this.httpClient.get(this.baseUrl + 'download/volume-size?volumeId=' + volumeId);\r\n }\r\n\r\n private downloadChapterSize(chapterId: number) {\r\n return this.httpClient.get(this.baseUrl + 'download/chapter-size?chapterId=' + chapterId);\r\n }\r\n\r\n private downloadLogs() {\r\n const downloadType = 'logs';\r\n const subtitle = this.downloadSubtitle(downloadType, undefined);\r\n return this.httpClient.get(this.baseUrl + 'server/logs',\r\n {observe: 'events', responseType: 'blob', reportProgress: true}\r\n ).pipe(\r\n throttleTime(DEBOUNCE_TIME, asyncScheduler, { leading: true, trailing: true }),\r\n download((blob, filename) => {\r\n this.save(blob, decodeURIComponent(filename));\r\n }),\r\n tap((d) => this.updateDownloadState(d, downloadType, subtitle)),\r\n finalize(() => this.finalizeDownloadState(downloadType, subtitle))\r\n );\r\n }\r\n\r\n private downloadSeries(series: Series) {\r\n const downloadType = 'series';\r\n const subtitle = this.downloadSubtitle(downloadType, series);\r\n return this.httpClient.get(this.baseUrl + 'download/series?seriesId=' + series.id,\r\n {observe: 'events', responseType: 'blob', reportProgress: true}\r\n ).pipe(\r\n throttleTime(DEBOUNCE_TIME, asyncScheduler, { leading: true, trailing: true }),\r\n download((blob, filename) => {\r\n this.save(blob, decodeURIComponent(filename));\r\n }),\r\n tap((d) => this.updateDownloadState(d, downloadType, subtitle)),\r\n finalize(() => this.finalizeDownloadState(downloadType, subtitle))\r\n );\r\n }\r\n\r\n private finalizeDownloadState(entityType: DownloadEntityType, entitySubtitle: string) {\r\n let values = this.downloadsSource.getValue();\r\n values = values.filter(v => !(v.entityType === entityType && v.subTitle === entitySubtitle));\r\n this.downloadsSource.next(values);\r\n }\r\n\r\n private updateDownloadState(d: Download, entityType: DownloadEntityType, entitySubtitle: string) {\r\n let values = this.downloadsSource.getValue();\r\n if (d.state === 'PENDING') {\r\n const index = values.findIndex(v => v.entityType === entityType && v.subTitle === entitySubtitle);\r\n if (index >= 0) return; // Don't let us duplicate add\r\n values.push({entityType: entityType, subTitle: entitySubtitle, progress: 0});\r\n } else if (d.state === 'IN_PROGRESS') {\r\n const index = values.findIndex(v => v.entityType === entityType && v.subTitle === entitySubtitle);\r\n if (index >= 0) {\r\n values[index].progress = d.progress;\r\n }\r\n } else if (d.state === 'DONE') {\r\n values = values.filter(v => !(v.entityType === entityType && v.subTitle === entitySubtitle));\r\n }\r\n this.downloadsSource.next(values);\r\n\r\n }\r\n\r\n private downloadChapter(chapter: Chapter) {\r\n const downloadType = 'chapter';\r\n const subtitle = this.downloadSubtitle(downloadType, chapter);\r\n return this.httpClient.get(this.baseUrl + 'download/chapter?chapterId=' + chapter.id,\r\n {observe: 'events', responseType: 'blob', reportProgress: true}\r\n ).pipe(\r\n throttleTime(DEBOUNCE_TIME, asyncScheduler, { leading: true, trailing: true }),\r\n download((blob, filename) => {\r\n this.save(blob, decodeURIComponent(filename));\r\n }),\r\n tap((d) => this.updateDownloadState(d, downloadType, subtitle)),\r\n finalize(() => this.finalizeDownloadState(downloadType, subtitle))\r\n );\r\n }\r\n\r\n private downloadVolume(volume: Volume): Observable {\r\n const downloadType = 'volume';\r\n const subtitle = this.downloadSubtitle(downloadType, volume);\r\n return this.httpClient.get(this.baseUrl + 'download/volume?volumeId=' + volume.id,\r\n {observe: 'events', responseType: 'blob', reportProgress: true}\r\n ).pipe(\r\n throttleTime(DEBOUNCE_TIME, asyncScheduler, { leading: true, trailing: true }),\r\n download((blob, filename) => {\r\n this.save(blob, decodeURIComponent(filename));\r\n }),\r\n tap((d) => this.updateDownloadState(d, downloadType, subtitle)),\r\n finalize(() => this.finalizeDownloadState(downloadType, subtitle))\r\n );\r\n }\r\n\r\n private async confirmSize(size: number, entityType: DownloadEntityType) {\r\n return (size < this.SIZE_WARNING ||\r\n await this.confirmService.confirm(translate('toasts.confirm-download-size', {entityType: 'entity-type.' + entityType, size: bytesPipe.transform(size)})));\r\n }\r\n\r\n private downloadBookmarks(bookmarks: PageBookmark[]) {\r\n const downloadType = 'bookmark';\r\n const subtitle = this.downloadSubtitle(downloadType, bookmarks);\r\n\r\n return this.httpClient.post(this.baseUrl + 'download/bookmarks', {bookmarks},\r\n {observe: 'events', responseType: 'blob', reportProgress: true}\r\n ).pipe(\r\n throttleTime(DEBOUNCE_TIME, asyncScheduler, { leading: true, trailing: true }),\r\n download((blob, filename) => {\r\n this.save(blob, decodeURIComponent(filename));\r\n }),\r\n tap((d) => this.updateDownloadState(d, downloadType, subtitle)),\r\n finalize(() => this.finalizeDownloadState(downloadType, subtitle))\r\n );\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { map } from 'rxjs/operators';\r\nimport { environment } from 'src/environments/environment';\r\nimport { CollectionTag } from '../_models/collection-tag';\r\nimport { TextResonse } from '../_types/text-response';\r\nimport { ImageService } from './image.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CollectionTagService {\r\n\r\n baseUrl = environment.apiUrl;\r\n\r\n constructor(private httpClient: HttpClient, private imageService: ImageService) { }\r\n\r\n allTags() {\r\n return this.httpClient.get(this.baseUrl + 'collection/');\r\n }\r\n\r\n search(query: string) {\r\n return this.httpClient.get(this.baseUrl + 'collection/search?queryString=' + encodeURIComponent(query)).pipe(map(tags => {\r\n tags.forEach(s => s.coverImage = this.imageService.randomize(this.imageService.getCollectionCoverImage(s.id)));\r\n return tags;\r\n }));\r\n }\r\n\r\n updateTag(tag: CollectionTag) {\r\n return this.httpClient.post(this.baseUrl + 'collection/update', tag, TextResonse);\r\n }\r\n\r\n updateSeriesForTag(tag: CollectionTag, seriesIdsToRemove: Array) {\r\n return this.httpClient.post(this.baseUrl + 'collection/update-series', {tag, seriesIdsToRemove}, TextResonse);\r\n }\r\n\r\n addByMultiple(tagId: number, seriesIds: Array, tagTitle: string = '') {\r\n return this.httpClient.post(this.baseUrl + 'collection/update-for-series', {collectionTagId: tagId, collectionTagTitle: tagTitle, seriesIds}, TextResonse);\r\n }\r\n\r\n tagNameExists(name: string) {\r\n return this.httpClient.get(this.baseUrl + 'collection/name-exists?name=' + name);\r\n }\r\n\r\n deleteTag(tagId: number) {\r\n return this.httpClient.delete(this.baseUrl + 'collection?tagId=' + tagId, TextResonse);\r\n }\r\n}\r\n","export enum PersonRole {\r\n Other = 1,\r\n Artist = 2,\r\n Writer = 3,\r\n Penciller = 4,\r\n Inker = 5,\r\n Colorist = 6,\r\n Letterer = 7,\r\n CoverArtist = 8,\r\n Editor = 9,\r\n Publisher = 10,\r\n Character = 11,\r\n Translator = 12\r\n}\r\n\r\nexport interface Person {\r\n id: number;\r\n name: string;\r\n role: PersonRole;\r\n}","import { trigger, state, style, transition, animate } from '@angular/animations';\r\nimport {CommonModule, DOCUMENT} from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild, DestroyRef,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n inject,\r\n Inject,\r\n Input,\r\n OnInit,\r\n Output,\r\n Renderer2,\r\n RendererStyleFlags2,\r\n TemplateRef,\r\n ViewChild\r\n} from '@angular/core';\r\nimport {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';\r\nimport { Observable, ReplaySubject } from 'rxjs';\r\nimport { auditTime, filter, map, shareReplay, switchMap, take, tap } from 'rxjs/operators';\r\nimport { KEY_CODES } from 'src/app/shared/_services/utility.service';\r\nimport { SelectionCompareFn, TypeaheadSettings } from '../_models/typeahead-settings';\r\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\r\nimport {TagBadgeComponent} from \"../../shared/tag-badge/tag-badge.component\";\r\nimport {TranslocoDirective} from \"@ngneat/transloco\";\r\n\r\n\r\n/**\r\n * SelectionModel is used for keeping track of multiple selections. Simple interface with ability to toggle.\r\n * @param selectedState Optional state to set selectedOptions to. If not passed, defaults to false.\r\n * @param selectedOptions Optional data elements to inform the SelectionModel of. If not passed, as toggle() occur, items are tracked.\r\n * @param propAccessor Optional string that points to a unique field within the T type. Used for quickly looking up.\r\n */\r\nexport class SelectionModel {\r\n _data!: Array<{value: T, selected: boolean}>;\r\n _propAccessor: string = '';\r\n\r\n constructor(selectedState: boolean = false, selectedOptions: Array = [], propAccessor: string = '') {\r\n this._data = [];\r\n\r\n if (propAccessor != undefined || propAccessor !== '') {\r\n this._propAccessor = propAccessor;\r\n }\r\n\r\n selectedOptions.forEach(d => {\r\n this._data.push({value: d, selected: selectedState});\r\n });\r\n }\r\n\r\n /**\r\n * Will toggle if the data item is selected or not. If data option is not tracked, will add it and set state to true.\r\n * @param data Item to toggle\r\n * @param selectedState Force the state\r\n * @param compareFn An optional function to use for the lookup, else will use shallowEqual implementation\r\n */\r\n toggle(data: T, selectedState?: boolean, compareFn?: SelectionCompareFn) {\r\n let lookupMethod = this.shallowEqual;\r\n if (compareFn != undefined || compareFn != null) {\r\n lookupMethod = compareFn;\r\n }\r\n\r\n const dataItem = this._data.filter(d => lookupMethod(d.value, data));\r\n if (dataItem.length > 0) {\r\n if (selectedState != undefined) {\r\n dataItem[0].selected = selectedState;\r\n } else {\r\n dataItem[0].selected = !dataItem[0].selected;\r\n }\r\n } else {\r\n this._data.push({value: data, selected: (selectedState === undefined ? true : selectedState)});\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Is the passed item selected\r\n * @param data item to check against\r\n * @param compareFn optional method to use to perform comparisons\r\n * @returns boolean\r\n */\r\n isSelected(data: T, compareFn?: SelectionCompareFn): boolean {\r\n let lookupMethod = this.shallowEqual;\r\n if (compareFn != undefined || compareFn != null) {\r\n lookupMethod = compareFn;\r\n }\r\n\r\n const dataItem = this._data.filter(d => lookupMethod(d.value, data));\r\n\r\n if (dataItem.length > 0) {\r\n return dataItem[0].selected;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n *\r\n * @returns If some of the items are selected, but not all\r\n */\r\n hasSomeSelected(): boolean {\r\n const selectedCount = this._data.filter(d => d.selected).length;\r\n return (selectedCount !== this._data.length && selectedCount !== 0)\r\n }\r\n\r\n /**\r\n *\r\n * @returns All Selected items\r\n */\r\n selected(): Array {\r\n return this._data.filter(d => d.selected).map(d => d.value);\r\n }\r\n\r\n /**\r\n *\r\n * @returns All Non-Selected items\r\n */\r\n unselected(): Array {\r\n return this._data.filter(d => !d.selected).map(d => d.value);\r\n }\r\n\r\n /**\r\n *\r\n * @returns Last element added/tracked or undefined if nothing is tracked\r\n */\r\n peek(): T | undefined {\r\n if (this._data.length > 0) {\r\n return this._data[this._data.length - 1].value;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n shallowEqual(a: T, b: T) {\r\n\r\n for (let key in a) {\r\n if (!(key in b) || a[key] !== b[key]) {\r\n return false;\r\n }\r\n }\r\n for (let key in b) {\r\n if (!(key in a)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nconst ANIMATION_SPEED = 200;\r\n\r\n@Component({\r\n selector: 'app-typeahead',\r\n standalone: true,\r\n imports: [CommonModule, TagBadgeComponent, ReactiveFormsModule, TranslocoDirective],\r\n templateUrl: './typeahead.component.html',\r\n styleUrls: ['./typeahead.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [\r\n trigger('slideFromTop', [\r\n state('in', style({ height: '0px'})),\r\n transition('void => *', [\r\n style({ height: '100%', overflow: 'auto' }),\r\n animate(ANIMATION_SPEED)\r\n ]),\r\n transition('* => void', [\r\n animate(ANIMATION_SPEED, style({ height: '0px' })),\r\n ])\r\n ])\r\n ]\r\n})\r\nexport class TypeaheadComponent implements OnInit {\r\n /**\r\n * Settings for the typeahead\r\n */\r\n @Input({required: true}) settings!: TypeaheadSettings;\r\n /**\r\n * When true, will reset field to no selections. When false, will reset to saved data\r\n */\r\n @Input() reset: ReplaySubject = new ReplaySubject(1);\r\n /**\r\n * When a field is locked, we render custom css to indicate to the user. Does not affect functionality.\r\n */\r\n @Input() locked: boolean = false;\r\n /**\r\n * If disabled, a user will not be able to interact with the typeahead\r\n */\r\n @Input() disabled: boolean = false;\r\n /**\r\n * When triggered, will focus the input if the passed string matches the id\r\n */\r\n @Input() focus: EventEmitter | undefined;\r\n @Output() selectedData = new EventEmitter();\r\n @Output() newItemAdded = new EventEmitter();\r\n @Output() onUnlock = new EventEmitter();\r\n @Output() lockedChange = new EventEmitter();\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n\r\n @ViewChild('input') inputElem!: ElementRef;\r\n @ContentChild('optionItem') optionTemplate!: TemplateRef;\r\n @ContentChild('badgeItem') badgeTemplate!: TemplateRef;\r\n\r\n optionSelection!: SelectionModel;\r\n\r\n hasFocus = false; // Whether input has active focus\r\n focusedIndex: number = 0;\r\n showAddItem: boolean = false;\r\n filteredOptions!: Observable;\r\n isLoadingOptions: boolean = false;\r\n typeaheadControl!: FormControl;\r\n typeaheadForm!: FormGroup;\r\n\r\n constructor(private renderer2: Renderer2, @Inject(DOCUMENT) private document: Document, private readonly cdRef: ChangeDetectorRef) { }\r\n\r\n ngOnInit() {\r\n this.reset.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((resetToEmpty: boolean) => {\r\n this.clearSelections(resetToEmpty);\r\n this.init();\r\n });\r\n\r\n if (this.focus) {\r\n this.focus.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((id: string) => {\r\n if (this.settings.id !== id) return;\r\n this.onInputFocus();\r\n });\r\n }\r\n\r\n this.init();\r\n }\r\n\r\n init() {\r\n if (this.settings.compareFn === undefined && this.settings.multiple) {\r\n console.error('A compare function must be defined');\r\n return;\r\n }\r\n\r\n if (this.settings.trackByIdentityFn === undefined) {\r\n this.settings.trackByIdentityFn = (index, value) => value;\r\n }\r\n\r\n if (this.settings.hasOwnProperty('formControl') && this.settings.formControl) {\r\n this.typeaheadControl = this.settings.formControl;\r\n } else {\r\n this.typeaheadControl = new FormControl('');\r\n }\r\n this.typeaheadForm = new FormGroup({\r\n 'typeahead': this.typeaheadControl\r\n });\r\n\r\n this.filteredOptions = this.typeaheadForm.get('typeahead')!.valueChanges\r\n .pipe(\r\n // Adjust input box to grow\r\n tap((val: string) => {\r\n if (this.inputElem != null && this.inputElem.nativeElement != null) {\r\n this.renderer2.setStyle(this.inputElem.nativeElement, 'width', 15 * (val.trim().length + 1) + 'px');\r\n this.focusedIndex = 0;\r\n }\r\n }),\r\n map((val: string) => val.trim()),\r\n auditTime(this.settings.debounce),\r\n //distinctUntilChanged(), // ?!: BUG Doesn't trigger the search to run when filtered array changes\r\n filter((val: string) => {\r\n // If minimum filter characters not met, do not filter\r\n if (this.settings.minCharacters === 0) return true;\r\n\r\n if (!val || val.length < this.settings.minCharacters) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }),\r\n\r\n switchMap((val: string) => {\r\n this.isLoadingOptions = true;\r\n return this.settings.fetchFn(val.trim()).pipe(takeUntilDestroyed(this.destroyRef), map((items: any[]) => items.filter(item => this.filterSelected(item))));\r\n }),\r\n tap((filteredOptions: any[]) => {\r\n this.isLoadingOptions = false;\r\n this.focusedIndex = 0;\r\n this.cdRef.markForCheck();\r\n setTimeout(() => {\r\n this.updateShowAddItem(filteredOptions);\r\n this.updateHighlight();\r\n }, 10);\r\n setTimeout(() => this.updateHighlight(), 20);\r\n\r\n }),\r\n shareReplay(),\r\n takeUntilDestroyed(this.destroyRef)\r\n );\r\n\r\n\r\n if (this.settings.savedData) {\r\n if (this.settings.multiple) {\r\n this.optionSelection = new SelectionModel(true, this.settings.savedData);\r\n }\r\n else {\r\n const isArray = this.settings.savedData.hasOwnProperty('length');\r\n if (isArray) {\r\n this.optionSelection = new SelectionModel(true, this.settings.savedData);\r\n } else {\r\n this.optionSelection = new SelectionModel(true, [this.settings.savedData]);\r\n }\r\n }\r\n } else {\r\n this.optionSelection = new SelectionModel();\r\n }\r\n }\r\n\r\n\r\n @HostListener('body:click', ['$event'])\r\n handleDocumentClick(event: any) {\r\n // Don't close the typeahead when we select an item from it\r\n if (event.target && (event.target as HTMLElement).classList.contains('list-group-item')) {\r\n return;\r\n }\r\n this.hasFocus = false;\r\n }\r\n\r\n @HostListener('window:keydown', ['$event'])\r\n handleKeyPress(event: KeyboardEvent) {\r\n if (!this.hasFocus) { return; }\r\n if (this.disabled) return;\r\n\r\n switch(event.key) {\r\n case KEY_CODES.DOWN_ARROW:\r\n case KEY_CODES.RIGHT_ARROW:\r\n {\r\n this.focusedIndex = Math.min(this.focusedIndex + 1, this.document.querySelectorAll('.list-group-item').length - 1);\r\n this.updateHighlight();\r\n break;\r\n }\r\n case KEY_CODES.UP_ARROW:\r\n case KEY_CODES.LEFT_ARROW:\r\n {\r\n this.focusedIndex = Math.max(this.focusedIndex - 1, 0);\r\n this.updateHighlight();\r\n break;\r\n }\r\n case KEY_CODES.ENTER:\r\n {\r\n this.document.querySelectorAll('.list-group-item').forEach((item, index) => {\r\n if (item.classList.contains('active')) {\r\n this.filteredOptions.pipe(take(1)).subscribe((opts: any[]) => {\r\n // This isn't giving back the filtered array, but everything\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n (item as HTMLElement).click();\r\n this.focusedIndex = 0;\r\n });\r\n }\r\n });\r\n break;\r\n }\r\n case KEY_CODES.BACKSPACE:\r\n case KEY_CODES.DELETE:\r\n {\r\n if (this.typeaheadControl.value !== null && this.typeaheadControl.value !== undefined && this.typeaheadControl.value.trim() !== '') {\r\n break;\r\n }\r\n const selected = this.optionSelection.selected();\r\n if (selected.length > 0) {\r\n this.removeSelectedOption(selected.pop());\r\n }\r\n break;\r\n }\r\n case KEY_CODES.ESC_KEY:\r\n this.hasFocus = false;\r\n event.stopPropagation();\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n toggleSelection(opt: any): void {\r\n this.optionSelection.toggle(opt, undefined, this.settings.selectionCompareFn);\r\n this.selectedData.emit(this.optionSelection.selected());\r\n }\r\n\r\n removeSelectedOption(opt: any) {\r\n this.optionSelection.toggle(opt, undefined, this.settings.selectionCompareFn);\r\n this.selectedData.emit(this.optionSelection.selected());\r\n this.resetField();\r\n }\r\n\r\n clearSelections(untoggleAll: boolean = false) {\r\n if (this.optionSelection) {\r\n if (!untoggleAll && this.settings.savedData) {\r\n const isArray = this.settings.savedData.hasOwnProperty('length');\r\n if (isArray) {\r\n this.optionSelection = new SelectionModel(true, this.settings.savedData); // NOTE: Library-detail will break the 'x' button due to how savedData is being set to avoid state reset\r\n } else {\r\n this.optionSelection = new SelectionModel(true, [this.settings.savedData]);\r\n }\r\n this.cdRef.markForCheck();\r\n } else {\r\n this.optionSelection.selected().forEach(item => this.optionSelection.toggle(item, false));\r\n this.cdRef.markForCheck();\r\n }\r\n\r\n this.selectedData.emit(this.optionSelection.selected());\r\n this.resetField();\r\n }\r\n }\r\n\r\n handleOptionClick(opt: any) {\r\n if (this.disabled) return;\r\n if (!this.settings.multiple && this.optionSelection.selected().length > 0) {\r\n return;\r\n }\r\n\r\n this.toggleSelection(opt);\r\n\r\n this.resetField();\r\n this.onInputFocus();\r\n }\r\n\r\n addNewItem(title: string) {\r\n if (this.settings.addTransformFn == undefined || !this.settings.addIfNonExisting) {\r\n return;\r\n }\r\n const newItem = this.settings.addTransformFn(title);\r\n this.newItemAdded.emit(newItem);\r\n this.toggleSelection(newItem);\r\n\r\n this.resetField();\r\n this.onInputFocus();\r\n }\r\n\r\n /**\r\n *\r\n * @param item\r\n * @returns True if the item is NOT selected already\r\n */\r\n filterSelected(item: any) {\r\n if (this.settings.unique && this.settings.multiple) {\r\n return !this.optionSelection.isSelected(item, this.settings.selectionCompareFn);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n openDropdown() {\r\n setTimeout(() => {\r\n this.typeaheadControl.setValue(this.typeaheadControl.value);\r\n this.hasFocus = true;\r\n });\r\n }\r\n\r\n onInputFocus(event?: any) {\r\n if (event) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n if (this.disabled) return;\r\n\r\n if (!this.settings.multiple && this.optionSelection.selected().length > 0) {\r\n return;\r\n }\r\n\r\n if (this.inputElem) {\r\n // hack: To prevent multiple typeaheads from being open at once, click document then trigger the focus\r\n this.document.body.click();\r\n\r\n this.inputElem.nativeElement.focus();\r\n this.hasFocus = true;\r\n }\r\n\r\n\r\n this.openDropdown();\r\n }\r\n\r\n\r\n resetField() {\r\n if (this.inputElem && this.inputElem.nativeElement) {\r\n this.renderer2.setStyle(this.inputElem.nativeElement, 'width', 4, RendererStyleFlags2.Important);\r\n }\r\n this.typeaheadControl.setValue('');\r\n this.focusedIndex = 0;\r\n }\r\n\r\n // Updates the highlight to focus on the selected item\r\n updateHighlight() {\r\n this.document.querySelectorAll('.list-group-item').forEach((item, index) => {\r\n if (index === this.focusedIndex && !item.classList.contains('no-hover')) {\r\n // apply active class\r\n this.renderer2.addClass(item, 'active');\r\n } else {\r\n // remove active class\r\n this.renderer2.removeClass(item, 'active');\r\n }\r\n });\r\n }\r\n\r\n updateShowAddItem(options: any[]) {\r\n // ?! BUG This will still technicially allow you to add the same thing as a previously added item. (Code will just toggle it though)\r\n this.showAddItem = false;\r\n this.cdRef.markForCheck();\r\n if (!this.settings.addIfNonExisting) return;\r\n\r\n const inputText = this.typeaheadControl.value.trim();\r\n if (inputText.length < Math.max(this.settings.minCharacters, 1)) return;\r\n if (!this.typeaheadControl.dirty) return; // Do we need this?\r\n\r\n // Check if this new option will interfere with any existing ones not shown\r\n\r\n if (typeof this.settings.compareFnForAdd == 'function') {\r\n const willDuplicateExist = this.settings.compareFnForAdd(this.optionSelection.selected(), inputText);\r\n if (willDuplicateExist.length > 0) {\r\n return;\r\n }\r\n }\r\n\r\n if (typeof this.settings.compareFn == 'function') {\r\n // The problem here is that compareFn can report that duplicate will exist as it does contains not match\r\n const matches = this.settings.compareFn(options, inputText);\r\n if (matches.length > 0 && matches.includes(this.settings.addTransformFn(inputText))) {\r\n return;\r\n }\r\n }\r\n\r\n this.showAddItem = true;\r\n\r\n if (this.showAddItem) {\r\n this.hasFocus = true;\r\n }\r\n this.cdRef.markForCheck();\r\n }\r\n\r\n toggleLock(event: any) {\r\n if (this.disabled) return;\r\n this.locked = !this.locked;\r\n this.lockedChange.emit(this.locked);\r\n\r\n if (!this.locked) {\r\n this.onUnlock.emit();\r\n }\r\n }\r\n\r\n}\r\n","\r\n
\r\n
\r\n \r\n \r\n {{t('locked-field')}}\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n {{t('loading')}}\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n
\r\n
    \r\n
  • \r\n {{t('add-item', {item: typeaheadControl.value})}}\r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n {{t('no-data')}}{{this.settings.addIfNonExisting ? t('add-custom-item') : ''}}\r\n
  • \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import {Injectable} from '@angular/core';\r\nimport {ActivatedRouteSnapshot, Params, Router} from '@angular/router';\r\nimport {SortField, SortOptions} from 'src/app/_models/metadata/series-filter';\r\nimport {MetadataService} from \"../../_services/metadata.service\";\r\nimport {SeriesFilterV2} from \"../../_models/metadata/v2/series-filter-v2\";\r\nimport {FilterStatement} from \"../../_models/metadata/v2/filter-statement\";\r\nimport {FilterCombination} from \"../../_models/metadata/v2/filter-combination\";\r\nimport {FilterField} from \"../../_models/metadata/v2/filter-field\";\r\nimport {FilterComparison} from \"../../_models/metadata/v2/filter-comparison\";\r\nimport {HttpClient} from \"@angular/common/http\";\r\nimport {TextResonse} from \"../../_types/text-response\";\r\nimport {environment} from \"../../../environments/environment\";\r\nimport {map, tap} from \"rxjs/operators\";\r\nimport {of, switchMap} from \"rxjs\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class FilterUtilitiesService {\r\n\r\n private apiUrl = environment.apiUrl;\r\n\r\n constructor(private metadataService: MetadataService, private router: Router, private http: HttpClient) {}\r\n\r\n encodeFilter(filter: SeriesFilterV2 | undefined) {\r\n return this.http.post(this.apiUrl + 'filter/encode', filter, TextResonse);\r\n }\r\n\r\n decodeFilter(encodedFilter: string) {\r\n return this.http.post(this.apiUrl + 'filter/decode', {encodedFilter}).pipe(map(filter => {\r\n if (filter == null) {\r\n filter = this.metadataService.createDefaultFilterDto();\r\n filter.statements.push(this.createSeriesV2DefaultStatement());\r\n }\r\n\r\n return filter;\r\n }))\r\n }\r\n\r\n updateUrlFromFilter(filter: SeriesFilterV2 | undefined) {\r\n return this.encodeFilter(filter).pipe(tap(encodedFilter => {\r\n window.history.replaceState(window.location.href, '', window.location.href.split('?')[0]+ '?' + encodedFilter);\r\n }));\r\n }\r\n\r\n filterPresetsFromUrl(snapshot: ActivatedRouteSnapshot) {\r\n const filter = this.metadataService.createDefaultFilterDto();\r\n filter.statements.push(this.createSeriesV2DefaultStatement());\r\n if (!window.location.href.includes('?')) return of(filter);\r\n\r\n return this.decodeFilter(window.location.href.split('?')[1]);\r\n }\r\n\r\n /**\r\n * Applies and redirects to the passed page with the filter encoded\r\n * @param page\r\n * @param filter\r\n * @param comparison\r\n * @param value\r\n */\r\n applyFilter(page: Array, filter: FilterField, comparison: FilterComparison, value: string) {\r\n const dto = this.createSeriesV2Filter();\r\n dto.statements.push(this.metadataService.createDefaultFilterStatement(filter, comparison, value + ''));\r\n\r\n return this.encodeFilter(dto).pipe(switchMap(encodedFilter => {\r\n return this.router.navigateByUrl(page.join('/') + '?' + encodedFilter);\r\n }));\r\n }\r\n\r\n applyFilterWithParams(page: Array, filter: SeriesFilterV2, extraParams: Params) {\r\n return this.encodeFilter(filter).pipe(switchMap(encodedFilter => {\r\n let url = page.join('/') + '?' + encodedFilter;\r\n url += Object.keys(extraParams).map(k => `&${k}=${extraParams[k]}`).join('');\r\n\r\n return this.router.navigateByUrl(url, extraParams);\r\n }));\r\n }\r\n\r\n createSeriesV2Filter(): SeriesFilterV2 {\r\n return {\r\n combination: FilterCombination.And,\r\n statements: [],\r\n limitTo: 0,\r\n sortOptions: {\r\n isAscending: true,\r\n sortField: SortField.SortName\r\n },\r\n };\r\n }\r\n\r\n createSeriesV2DefaultStatement(): FilterStatement {\r\n return {\r\n comparison: FilterComparison.Equal,\r\n value: '',\r\n field: FilterField.SeriesName\r\n }\r\n }\r\n}\r\n","import { ElementRef } from '@angular/core';\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nfunction coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}\nfunction coerceNumberProperty(value, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nfunction _isNumberValue(value) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value)) && !isNaN(Number(value));\n}\nfunction coerceArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n/** Coerces a value to a CSS pixel value. */\nfunction coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return typeof value === 'string' ? value : `${value}px`;\n}\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nfunction coerceElement(elementOrRef) {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n\n/**\n * Coerces a value to an array of trimmed non-empty strings.\n * Any input that is not an array, `null` or `undefined` will be turned into a string\n * via `toString()` and subsequently split with the given separator.\n * `null` and `undefined` will result in an empty array.\n * This results in the following outcomes:\n * - `null` -> `[]`\n * - `[null]` -> `[\"null\"]`\n * - `[\"a\", \"b \", \" \"]` -> `[\"a\", \"b\"]`\n * - `[1, [2, 3]]` -> `[\"1\", \"2,3\"]`\n * - `[{ a: 0 }]` -> `[\"[object Object]\"]`\n * - `{ a: 0 }` -> `[\"[object\", \"Object]\"]`\n *\n * Useful for defining CSS classes or table columns.\n * @param value the value to coerce into an array of strings\n * @param separator split-separator if value isn't an array\n */\nfunction coerceStringArray(value, separator = /\\s+/) {\n const result = [];\n if (value != null) {\n const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator);\n for (const sourceValue of sourceValues) {\n const trimmedString = `${sourceValue}`.trim();\n if (trimmedString) {\n result.push(trimmedString);\n }\n }\n }\n return result;\n}\nexport { _isNumberValue, coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceElement, coerceNumberProperty, coerceStringArray };\n","import * as i0 from '@angular/core';\nimport { PLATFORM_ID, Injectable, Inject, NgModule } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator;\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;\n} catch {\n hasV8BreakIterator = false;\n}\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\nlet Platform = /*#__PURE__*/(() => {\n class Platform {\n constructor(_platformId) {\n this._platformId = _platformId;\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n this.isBrowser = this._platformId ? isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n /** Whether the current browser is Microsoft Edge. */\n this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n /** Whether the current rendering engine is Microsoft Trident. */\n this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n this.BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n this.WEBKIT = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n /** Whether the current platform is Apple iOS. */\n this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n }\n static {\n this.ɵfac = function Platform_Factory(t) {\n return new (t || Platform)(i0.ɵɵinject(PLATFORM_ID));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: Platform,\n factory: Platform.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return Platform;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet PlatformModule = /*#__PURE__*/(() => {\n class PlatformModule {\n static {\n this.ɵfac = function PlatformModule_Factory(t) {\n return new (t || PlatformModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: PlatformModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return PlatformModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes;\n/** Types of `` that *might* be supported. */\nconst candidateInputTypes = [\n// `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n// first changing it to something else:\n// The specified value \"\" does not conform to the required format.\n// The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n'color', 'button', 'checkbox', 'date', 'datetime-local', 'email', 'file', 'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'reset', 'search', 'submit', 'tel', 'text', 'time', 'url', 'week'];\n/** @returns The input types supported by this browser. */\nfunction getSupportedInputTypes() {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n return supportedInputTypes;\n}\n\n/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents;\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nfunction supportsPassiveEventListeners() {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n return supportsPassiveEvents;\n}\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nfunction normalizePassiveListenerOptions(options) {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType;\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported;\n/** Check whether the browser supports scroll behaviors. */\nfunction supportsScrollBehavior() {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction = Element.prototype.scrollTo;\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n return scrollBehaviorSupported;\n}\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nfunction getRtlScrollAxisType() {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return 0 /* RtlScrollAxisType.NORMAL */;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n rtlScrollAxisType = 0 /* RtlScrollAxisType.NORMAL */;\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? 1 /* RtlScrollAxisType.NEGATED */ : 2 /* RtlScrollAxisType.INVERTED */;\n }\n\n scrollContainer.remove();\n }\n return rtlScrollAxisType;\n}\nlet shadowDomIsSupported;\n/** Checks whether the user's browser support Shadow DOM. */\nfunction _supportsShadowDom() {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow));\n }\n return shadowDomIsSupported;\n}\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nfunction _getShadowRoot(element) {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n return null;\n}\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nfunction _getFocusedElementPierceShadowDom() {\n let activeElement = typeof document !== 'undefined' && document ? document.activeElement : null;\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n return activeElement;\n}\n/** Gets the target of an event while accounting for Shadow DOM. */\nfunction _getEventTarget(event) {\n // If an event is bound outside the Shadow DOM, the `event.target` will\n // point to the shadow root so we have to use `composedPath` instead.\n return event.composedPath ? event.composedPath()[0] : event.target;\n}\n\n/** Gets whether the code is currently running in a test environment. */\nfunction _isTestEnvironment() {\n // We can't use `declare const` because it causes conflicts inside Google with the real typings\n // for these symbols and we can't read them off the global object, because they don't appear to\n // be attached there for some runners like Jest.\n // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643)\n return (\n // @ts-ignore\n typeof __karma__ !== 'undefined' && !!__karma__ ||\n // @ts-ignore\n typeof jasmine !== 'undefined' && !!jasmine ||\n // @ts-ignore\n typeof jest !== 'undefined' && !!jest ||\n // @ts-ignore\n typeof Mocha !== 'undefined' && !!Mocha\n );\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Platform, PlatformModule, _getEventTarget, _getFocusedElementPierceShadowDom, _getShadowRoot, _isTestEnvironment, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };\n","import * as i0 from '@angular/core';\nimport { InjectionToken, inject, EventEmitter, Injectable, Optional, Inject, Directive, Output, Input, NgModule } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nconst DIR_DOCUMENT = /*#__PURE__*/new InjectionToken('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY\n});\n/** @docs-private */\nfunction DIR_DOCUMENT_FACTORY() {\n return inject(DOCUMENT);\n}\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n/** Resolves a string value to a specific direction. */\nfunction _resolveDirectionality(rawValue) {\n const value = rawValue?.toLowerCase() || '';\n if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n }\n return value === 'rtl' ? 'rtl' : 'ltr';\n}\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\nlet Directionality = /*#__PURE__*/(() => {\n class Directionality {\n constructor(_document) {\n /** The current 'ltr' or 'rtl' value. */\n this.value = 'ltr';\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n this.change = new EventEmitter();\n if (_document) {\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr');\n }\n }\n ngOnDestroy() {\n this.change.complete();\n }\n static {\n this.ɵfac = function Directionality_Factory(t) {\n return new (t || Directionality)(i0.ɵɵinject(DIR_DOCUMENT, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: Directionality,\n factory: Directionality.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return Directionality;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\nlet Dir = /*#__PURE__*/(() => {\n class Dir {\n constructor() {\n /** Normalized direction that accounts for invalid/unsupported values. */\n this._dir = 'ltr';\n /** Whether the `value` has been set to its initial value. */\n this._isInitialized = false;\n /** Event emitted when the direction changes. */\n this.change = new EventEmitter();\n }\n /** @docs-private */\n get dir() {\n return this._dir;\n }\n set dir(value) {\n const previousValue = this._dir;\n // Note: `_resolveDirectionality` resolves the language based on the browser's language,\n // whereas the browser does it based on the content of the element. Since doing so based\n // on the content can be expensive, for now we're doing the simpler matching.\n this._dir = _resolveDirectionality(value);\n this._rawDir = value;\n if (previousValue !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n }\n /** Current layout direction of the element. */\n get value() {\n return this.dir;\n }\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n ngOnDestroy() {\n this.change.complete();\n }\n static {\n this.ɵfac = function Dir_Factory(t) {\n return new (t || Dir)();\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: Dir,\n selectors: [[\"\", \"dir\", \"\"]],\n hostVars: 1,\n hostBindings: function Dir_HostBindings(rf, ctx) {\n if (rf & 2) {\n i0.ɵɵattribute(\"dir\", ctx._rawDir);\n }\n },\n inputs: {\n dir: \"dir\"\n },\n outputs: {\n change: \"dirChange\"\n },\n exportAs: [\"dir\"],\n features: [i0.ɵɵProvidersFeature([{\n provide: Directionality,\n useExisting: Dir\n }])]\n });\n }\n }\n return Dir;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet BidiModule = /*#__PURE__*/(() => {\n class BidiModule {\n static {\n this.ɵfac = function BidiModule_Factory(t) {\n return new (t || BidiModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: BidiModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return BidiModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BidiModule, DIR_DOCUMENT, Dir, Directionality };\n","import { coerceNumberProperty, coerceElement } from '@angular/cdk/coercion';\nimport * as i0 from '@angular/core';\nimport { InjectionToken, forwardRef, Directive, Input, Injectable, Optional, Inject, inject, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, ViewChild, SkipSelf, ElementRef, NgModule } from '@angular/core';\nimport { Subject, of, Observable, fromEvent, animationFrameScheduler, asapScheduler, Subscription, isObservable } from 'rxjs';\nimport { distinctUntilChanged, auditTime, filter, takeUntil, startWith, pairwise, switchMap, shareReplay } from 'rxjs/operators';\nimport * as i1 from '@angular/cdk/platform';\nimport { getRtlScrollAxisType, supportsScrollBehavior, Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport * as i2 from '@angular/cdk/bidi';\nimport { BidiModule } from '@angular/cdk/bidi';\nimport * as i2$1 from '@angular/cdk/collections';\nimport { isDataSource, ArrayDataSource, _VIEW_REPEATER_STRATEGY, _RecycleViewRepeaterStrategy } from '@angular/cdk/collections';\n\n/** The injection token used to specify the virtual scrolling strategy. */\nconst _c0 = [\"contentWrapper\"];\nconst _c1 = [\"*\"];\nconst VIRTUAL_SCROLL_STRATEGY = /*#__PURE__*/new InjectionToken('VIRTUAL_SCROLL_STRATEGY');\n\n/** Virtual scrolling strategy for lists with items of known fixed size. */\nclass FixedSizeVirtualScrollStrategy {\n /**\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n constructor(itemSize, minBufferPx, maxBufferPx) {\n this._scrolledIndexChange = new Subject();\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n this.scrolledIndexChange = this._scrolledIndexChange.pipe(distinctUntilChanged());\n /** The attached viewport. */\n this._viewport = null;\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport) {\n this._viewport = viewport;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }\n /**\n * Update the item size and buffer size.\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) {\n if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() {\n /* no-op */\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() {\n /* no-op */\n }\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index, behavior) {\n if (this._viewport) {\n this._viewport.scrollToOffset(index * this._itemSize, behavior);\n }\n }\n /** Update the viewport's total content size. */\n _updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }\n /** Update the viewport's rendered range. */\n _updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = {\n start: renderedRange.start,\n end: renderedRange.end\n };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }\n}\n/**\n * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created\n * `FixedSizeVirtualScrollStrategy` from the given directive.\n * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the\n * `FixedSizeVirtualScrollStrategy` from.\n */\nfunction _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) {\n return fixedSizeDir._scrollStrategy;\n}\n/** A virtual scroll strategy that supports fixed-size items. */\nlet CdkFixedSizeVirtualScroll = /*#__PURE__*/(() => {\n class CdkFixedSizeVirtualScroll {\n constructor() {\n this._itemSize = 20;\n this._minBufferPx = 100;\n this._maxBufferPx = 200;\n /** The scroll strategy used by this directive. */\n this._scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n /** The size of the items in the list (in pixels). */\n get itemSize() {\n return this._itemSize;\n }\n set itemSize(value) {\n this._itemSize = coerceNumberProperty(value);\n }\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n get minBufferPx() {\n return this._minBufferPx;\n }\n set minBufferPx(value) {\n this._minBufferPx = coerceNumberProperty(value);\n }\n /**\n * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.\n */\n get maxBufferPx() {\n return this._maxBufferPx;\n }\n set maxBufferPx(value) {\n this._maxBufferPx = coerceNumberProperty(value);\n }\n ngOnChanges() {\n this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n static {\n this.ɵfac = function CdkFixedSizeVirtualScroll_Factory(t) {\n return new (t || CdkFixedSizeVirtualScroll)();\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkFixedSizeVirtualScroll,\n selectors: [[\"cdk-virtual-scroll-viewport\", \"itemSize\", \"\"]],\n inputs: {\n itemSize: \"itemSize\",\n minBufferPx: \"minBufferPx\",\n maxBufferPx: \"maxBufferPx\"\n },\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkFixedSizeVirtualScroll)]\n }]), i0.ɵɵNgOnChangesFeature]\n });\n }\n }\n return CdkFixedSizeVirtualScroll;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Time in ms to throttle the scrolling events by default. */\nconst DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nlet ScrollDispatcher = /*#__PURE__*/(() => {\n class ScrollDispatcher {\n constructor(_ngZone, _platform, document) {\n this._ngZone = _ngZone;\n this._platform = _platform;\n /** Subject for notifying that a registered scrollable reference element has been scrolled. */\n this._scrolled = new Subject();\n /** Keeps track of the global `scroll` and `resize` subscriptions. */\n this._globalSubscription = null;\n /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */\n this._scrolledCount = 0;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n this.scrollContainers = new Map();\n this._document = document;\n }\n /**\n * Registers a scrollable instance with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event to its scrolled observable.\n * @param scrollable Scrollable instance to be registered.\n */\n register(scrollable) {\n if (!this.scrollContainers.has(scrollable)) {\n this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable)));\n }\n }\n /**\n * De-registers a Scrollable reference and unsubscribes from its scroll event observable.\n * @param scrollable Scrollable instance to be deregistered.\n */\n deregister(scrollable) {\n const scrollableReference = this.scrollContainers.get(scrollable);\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollContainers.delete(scrollable);\n }\n }\n /**\n * Returns an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n *\n * **Note:** in order to avoid hitting change detection for every scroll event,\n * all of the events emitted from this stream will be run outside the Angular zone.\n * If you need to update any data bindings as a result of a scroll event, you have\n * to run the callback using `NgZone.run`.\n */\n scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) {\n if (!this._platform.isBrowser) {\n return of();\n }\n return new Observable(observer => {\n if (!this._globalSubscription) {\n this._addGlobalListener();\n }\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n const subscription = auditTimeInMs > 0 ? this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer);\n this._scrolledCount++;\n return () => {\n subscription.unsubscribe();\n this._scrolledCount--;\n if (!this._scrolledCount) {\n this._removeGlobalListener();\n }\n };\n });\n }\n ngOnDestroy() {\n this._removeGlobalListener();\n this.scrollContainers.forEach((_, container) => this.deregister(container));\n this._scrolled.complete();\n }\n /**\n * Returns an observable that emits whenever any of the\n * scrollable ancestors of an element are scrolled.\n * @param elementOrElementRef Element whose ancestors to listen for.\n * @param auditTimeInMs Time to throttle the scroll events.\n */\n ancestorScrolled(elementOrElementRef, auditTimeInMs) {\n const ancestors = this.getAncestorScrollContainers(elementOrElementRef);\n return this.scrolled(auditTimeInMs).pipe(filter(target => {\n return !target || ancestors.indexOf(target) > -1;\n }));\n }\n /** Returns all registered Scrollables that contain the provided element. */\n getAncestorScrollContainers(elementOrElementRef) {\n const scrollingContainers = [];\n this.scrollContainers.forEach((_subscription, scrollable) => {\n if (this._scrollableContainsElement(scrollable, elementOrElementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n return scrollingContainers;\n }\n /** Use defaultView of injected document if available or fallback to global window reference */\n _getWindow() {\n return this._document.defaultView || window;\n }\n /** Returns true if the element is contained within the provided Scrollable. */\n _scrollableContainsElement(scrollable, elementOrElementRef) {\n let element = coerceElement(elementOrElementRef);\n let scrollableElement = scrollable.getElementRef().nativeElement;\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while (element = element.parentElement);\n return false;\n }\n /** Sets up the global scroll listeners. */\n _addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return fromEvent(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }\n /** Cleans up the global scroll listener. */\n _removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }\n static {\n this.ɵfac = function ScrollDispatcher_Factory(t) {\n return new (t || ScrollDispatcher)(i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1.Platform), i0.ɵɵinject(DOCUMENT, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ScrollDispatcher,\n factory: ScrollDispatcher.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return ScrollDispatcher;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nlet CdkScrollable = /*#__PURE__*/(() => {\n class CdkScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n this.elementRef = elementRef;\n this.scrollDispatcher = scrollDispatcher;\n this.ngZone = ngZone;\n this.dir = dir;\n this._destroyed = new Subject();\n this._elementScrolled = new Observable(observer => this.ngZone.runOutsideAngular(() => fromEvent(this.elementRef.nativeElement, 'scroll').pipe(takeUntil(this._destroyed)).subscribe(observer)));\n }\n ngOnInit() {\n this.scrollDispatcher.register(this);\n }\n ngOnDestroy() {\n this.scrollDispatcher.deregister(this);\n this._destroyed.next();\n this._destroyed.complete();\n }\n /** Returns observable that emits when a scroll event is fired on the host element. */\n elementScrolled() {\n return this._elementScrolled;\n }\n /** Gets the ElementRef for the viewport. */\n getElementRef() {\n return this.elementRef;\n }\n /**\n * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo\n * method, since browsers are not consistent about what scrollLeft means in RTL. For this method\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param options specified the offsets to scroll to.\n */\n scrollTo(options) {\n const el = this.elementRef.nativeElement;\n const isRtl = this.dir && this.dir.value == 'rtl';\n // Rewrite start & end offsets as right or left offsets.\n if (options.left == null) {\n options.left = isRtl ? options.end : options.start;\n }\n if (options.right == null) {\n options.right = isRtl ? options.start : options.end;\n }\n // Rewrite the bottom offset as a top offset.\n if (options.bottom != null) {\n options.top = el.scrollHeight - el.clientHeight - options.bottom;\n }\n // Rewrite the right offset as a left offset.\n if (isRtl && getRtlScrollAxisType() != 0 /* RtlScrollAxisType.NORMAL */) {\n if (options.left != null) {\n options.right = el.scrollWidth - el.clientWidth - options.left;\n }\n if (getRtlScrollAxisType() == 2 /* RtlScrollAxisType.INVERTED */) {\n options.left = options.right;\n } else if (getRtlScrollAxisType() == 1 /* RtlScrollAxisType.NEGATED */) {\n options.left = options.right ? -options.right : options.right;\n }\n } else {\n if (options.right != null) {\n options.left = el.scrollWidth - el.clientWidth - options.right;\n }\n }\n this._applyScrollToOptions(options);\n }\n _applyScrollToOptions(options) {\n const el = this.elementRef.nativeElement;\n if (supportsScrollBehavior()) {\n el.scrollTo(options);\n } else {\n if (options.top != null) {\n el.scrollTop = options.top;\n }\n if (options.left != null) {\n el.scrollLeft = options.left;\n }\n }\n }\n /**\n * Measures the scroll offset relative to the specified edge of the viewport. This method can be\n * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent\n * about what scrollLeft means in RTL. The values returned by this method are normalized such that\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param from The edge to measure from.\n */\n measureScrollOffset(from) {\n const LEFT = 'left';\n const RIGHT = 'right';\n const el = this.elementRef.nativeElement;\n if (from == 'top') {\n return el.scrollTop;\n }\n if (from == 'bottom') {\n return el.scrollHeight - el.clientHeight - el.scrollTop;\n }\n // Rewrite start & end as left or right offsets.\n const isRtl = this.dir && this.dir.value == 'rtl';\n if (from == 'start') {\n from = isRtl ? RIGHT : LEFT;\n } else if (from == 'end') {\n from = isRtl ? LEFT : RIGHT;\n }\n if (isRtl && getRtlScrollAxisType() == 2 /* RtlScrollAxisType.INVERTED */) {\n // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n } else {\n return el.scrollLeft;\n }\n } else if (isRtl && getRtlScrollAxisType() == 1 /* RtlScrollAxisType.NEGATED */) {\n // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft + el.scrollWidth - el.clientWidth;\n } else {\n return -el.scrollLeft;\n }\n } else {\n // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and\n // (scrollWidth - clientWidth) when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft;\n } else {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n }\n }\n static {\n this.ɵfac = function CdkScrollable_Factory(t) {\n return new (t || CdkScrollable)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(ScrollDispatcher), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i2.Directionality, 8));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkScrollable,\n selectors: [[\"\", \"cdk-scrollable\", \"\"], [\"\", \"cdkScrollable\", \"\"]],\n standalone: true\n });\n }\n }\n return CdkScrollable;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Time in ms to throttle the resize events by default. */\nconst DEFAULT_RESIZE_TIME = 20;\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * @docs-private\n */\nlet ViewportRuler = /*#__PURE__*/(() => {\n class ViewportRuler {\n constructor(_platform, ngZone, document) {\n this._platform = _platform;\n /** Stream of viewport change events. */\n this._change = new Subject();\n /** Event listener that will be used to handle the viewport change events. */\n this._changeListener = event => {\n this._change.next(event);\n };\n this._document = document;\n ngZone.runOutsideAngular(() => {\n if (_platform.isBrowser) {\n const window = this._getWindow();\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', this._changeListener);\n window.addEventListener('orientationchange', this._changeListener);\n }\n // Clear the cached position so that the viewport is re-measured next time it is required.\n // We don't need to keep track of the subscription, because it is completed on destroy.\n this.change().subscribe(() => this._viewportSize = null);\n });\n }\n ngOnDestroy() {\n if (this._platform.isBrowser) {\n const window = this._getWindow();\n window.removeEventListener('resize', this._changeListener);\n window.removeEventListener('orientationchange', this._changeListener);\n }\n this._change.complete();\n }\n /** Returns the viewport's width and height. */\n getViewportSize() {\n if (!this._viewportSize) {\n this._updateViewportSize();\n }\n const output = {\n width: this._viewportSize.width,\n height: this._viewportSize.height\n };\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null;\n }\n return output;\n }\n /** Gets a ClientRect for the viewport's bounds. */\n getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition();\n const {\n width,\n height\n } = this.getViewportSize();\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width\n };\n }\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return {\n top: 0,\n left: 0\n };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX || documentElement.scrollLeft || 0;\n return {\n top,\n left\n };\n }\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * This stream emits outside of the Angular zone.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime = DEFAULT_RESIZE_TIME) {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;\n }\n /** Use defaultView of injected document if available or fallback to global window reference */\n _getWindow() {\n return this._document.defaultView || window;\n }\n /** Updates the cached viewport size. */\n _updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ? {\n width: window.innerWidth,\n height: window.innerHeight\n } : {\n width: 0,\n height: 0\n };\n }\n static {\n this.ɵfac = function ViewportRuler_Factory(t) {\n return new (t || ViewportRuler)(i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(DOCUMENT, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ViewportRuler,\n factory: ViewportRuler.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return ViewportRuler;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nconst VIRTUAL_SCROLLABLE = /*#__PURE__*/new InjectionToken('VIRTUAL_SCROLLABLE');\n/**\n * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.\n */\nlet CdkVirtualScrollable = /*#__PURE__*/(() => {\n class CdkVirtualScrollable extends CdkScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n }\n /**\n * Measure the viewport size for the provided orientation.\n *\n * @param orientation The orientation to measure the size from.\n */\n measureViewportSize(orientation) {\n const viewportEl = this.elementRef.nativeElement;\n return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;\n }\n static {\n this.ɵfac = function CdkVirtualScrollable_Factory(t) {\n return new (t || CdkVirtualScrollable)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(ScrollDispatcher), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i2.Directionality, 8));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkVirtualScrollable,\n features: [i0.ɵɵInheritDefinitionFeature]\n });\n }\n }\n return CdkVirtualScrollable;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Checks if the given ranges are equal. */\nfunction rangesEqual(r1, r2) {\n return r1.start == r2.start && r1.end == r2.end;\n}\n/**\n * Scheduler to be used for scroll events. Needs to fall back to\n * something that doesn't rely on requestAnimationFrame on environments\n * that don't support it (e.g. server-side rendering).\n */\nconst SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;\n/** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */\nlet CdkVirtualScrollViewport = /*#__PURE__*/(() => {\n class CdkVirtualScrollViewport extends CdkVirtualScrollable {\n /** The direction the viewport scrolls. */\n get orientation() {\n return this._orientation;\n }\n set orientation(orientation) {\n if (this._orientation !== orientation) {\n this._orientation = orientation;\n this._calculateSpacerSize();\n }\n }\n constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n this.elementRef = elementRef;\n this._changeDetectorRef = _changeDetectorRef;\n this._scrollStrategy = _scrollStrategy;\n this.scrollable = scrollable;\n this._platform = inject(Platform);\n /** Emits when the viewport is detached from a CdkVirtualForOf. */\n this._detachedSubject = new Subject();\n /** Emits when the rendered range changes. */\n this._renderedRangeSubject = new Subject();\n this._orientation = 'vertical';\n /**\n * Whether rendered items should persist in the DOM after scrolling out of view. By default, items\n * will be removed.\n */\n this.appendOnly = false;\n // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll\n // strategy lazily (i.e. only if the user is actually listening to the events). We do this because\n // depending on how the strategy calculates the scrolled index, it may come at a cost to\n // performance.\n /** Emits when the index of the first element visible in the viewport changes. */\n this.scrolledIndexChange = new Observable(observer => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));\n /** A stream that emits whenever the rendered range changes. */\n this.renderedRangeStream = this._renderedRangeSubject;\n /**\n * The total size of all content (in pixels), including content that is not currently rendered.\n */\n this._totalContentSize = 0;\n /** A string representing the `style.width` property value to be used for the spacer element. */\n this._totalContentWidth = '';\n /** A string representing the `style.height` property value to be used for the spacer element. */\n this._totalContentHeight = '';\n /** The currently rendered range of indices. */\n this._renderedRange = {\n start: 0,\n end: 0\n };\n /** The length of the data bound to this viewport (in number of items). */\n this._dataLength = 0;\n /** The size of the viewport (in pixels). */\n this._viewportSize = 0;\n /** The last rendered content offset that was set. */\n this._renderedContentOffset = 0;\n /**\n * Whether the last rendered content offset was to the end of the content (and therefore needs to\n * be rewritten as an offset to the start of the content).\n */\n this._renderedContentOffsetNeedsRewrite = false;\n /** Whether there is a pending change detection cycle. */\n this._isChangeDetectionPending = false;\n /** A list of functions to run after the next change detection cycle. */\n this._runAfterChangeDetection = [];\n /** Subscription to changes in the viewport size. */\n this._viewportChanges = Subscription.EMPTY;\n if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Error: cdk-virtual-scroll-viewport requires the \"itemSize\" property to be set.');\n }\n this._viewportChanges = viewportRuler.change().subscribe(() => {\n this.checkViewportSize();\n });\n if (!this.scrollable) {\n // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable\n this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable');\n this.scrollable = this;\n }\n }\n ngOnInit() {\n // Scrolling depends on the element dimensions which we can't get during SSR.\n if (!this._platform.isBrowser) {\n return;\n }\n if (this.scrollable === this) {\n super.ngOnInit();\n }\n // It's still too early to measure the viewport at this point. Deferring with a promise allows\n // the Viewport to be rendered with the correct size before we measure. We run this outside the\n // zone to avoid causing more change detection cycles. We handle the change detection loop\n // ourselves instead.\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._measureViewportSize();\n this._scrollStrategy.attach(this);\n this.scrollable.elementScrolled().pipe(\n // Start off with a fake scroll event so we properly detect our initial position.\n startWith(null),\n // Collect multiple events into one until the next animation frame. This way if\n // there are multiple scroll events in the same frame we only need to recheck\n // our layout once.\n auditTime(0, SCROLL_SCHEDULER),\n // Usually `elementScrolled` is completed when the scrollable is destroyed, but\n // that may not be the case if a `CdkVirtualScrollableElement` is used so we have\n // to unsubscribe here just in case.\n takeUntil(this._destroyed)).subscribe(() => this._scrollStrategy.onContentScrolled());\n this._markChangeDetectionNeeded();\n }));\n }\n ngOnDestroy() {\n this.detach();\n this._scrollStrategy.detach();\n // Complete all subjects\n this._renderedRangeSubject.complete();\n this._detachedSubject.complete();\n this._viewportChanges.unsubscribe();\n super.ngOnDestroy();\n }\n /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */\n attach(forOf) {\n if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkVirtualScrollViewport is already attached.');\n }\n // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length\n // changes. Run outside the zone to avoid triggering change detection, since we're managing the\n // change detection loop ourselves.\n this.ngZone.runOutsideAngular(() => {\n this._forOf = forOf;\n this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe(data => {\n const newLength = data.length;\n if (newLength !== this._dataLength) {\n this._dataLength = newLength;\n this._scrollStrategy.onDataLengthChanged();\n }\n this._doChangeDetection();\n });\n });\n }\n /** Detaches the current `CdkVirtualForOf`. */\n detach() {\n this._forOf = null;\n this._detachedSubject.next();\n }\n /** Gets the length of the data bound to this viewport (in number of items). */\n getDataLength() {\n return this._dataLength;\n }\n /** Gets the size of the viewport (in pixels). */\n getViewportSize() {\n return this._viewportSize;\n }\n // TODO(mmalerba): This is technically out of sync with what's really rendered until a render\n // cycle happens. I'm being careful to only call it after the render cycle is complete and before\n // setting it to something else, but its error prone and should probably be split into\n // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.\n /** Get the current rendered range of items. */\n getRenderedRange() {\n return this._renderedRange;\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from];\n }\n /**\n * Sets the total size of all content (in pixels), including content that is not currently\n * rendered.\n */\n setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }\n /** Sets the currently rendered range of indices. */\n setRenderedRange(range) {\n if (!rangesEqual(this._renderedRange, range)) {\n if (this.appendOnly) {\n range = {\n start: 0,\n end: Math.max(this._renderedRange.end, range.end)\n };\n }\n this._renderedRangeSubject.next(this._renderedRange = range);\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }\n /**\n * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).\n */\n getOffsetToRenderedContentStart() {\n return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;\n }\n /**\n * Sets the offset from the start of the viewport to either the start or end of the rendered data\n * (in pixels).\n */\n setRenderedContentOffset(offset, to = 'to-start') {\n // In appendOnly, we always start from the top\n offset = this.appendOnly && to === 'to-start' ? 0 : offset;\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;\n this._renderedContentOffset = offset;\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`;\n // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n this._renderedContentOffsetNeedsRewrite = true;\n }\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n } else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }\n /**\n * Scrolls to the given offset from the start of the viewport. Please note that this is not always\n * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left\n * direction, this would be the equivalent of setting a fictional `scrollRight` property.\n * @param offset The offset to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToOffset(offset, behavior = 'auto') {\n const options = {\n behavior\n };\n if (this.orientation === 'horizontal') {\n options.start = offset;\n } else {\n options.top = offset;\n }\n this.scrollable.scrollTo(options);\n }\n /**\n * Scrolls to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToIndex(index, behavior = 'auto') {\n this._scrollStrategy.scrollToIndex(index, behavior);\n }\n /**\n * Gets the current scroll offset from the start of the scrollable (in pixels).\n * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'\n * in horizontal mode.\n */\n measureScrollOffset(from) {\n // This is to break the call cycle\n let measureScrollOffset;\n if (this.scrollable == this) {\n measureScrollOffset = _from => super.measureScrollOffset(_from);\n } else {\n measureScrollOffset = _from => this.scrollable.measureScrollOffset(_from);\n }\n return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) - this.measureViewportOffset());\n }\n /**\n * Measures the offset of the viewport from the scrolling container\n * @param from The edge to measure from.\n */\n measureViewportOffset(from) {\n let fromRect;\n const LEFT = 'left';\n const RIGHT = 'right';\n const isRtl = this.dir?.value == 'rtl';\n if (from == 'start') {\n fromRect = isRtl ? RIGHT : LEFT;\n } else if (from == 'end') {\n fromRect = isRtl ? LEFT : RIGHT;\n } else if (from) {\n fromRect = from;\n } else {\n fromRect = this.orientation === 'horizontal' ? 'left' : 'top';\n }\n const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);\n const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];\n return viewportClientRect - scrollerClientRect;\n }\n /** Measure the combined size of all of the rendered items. */\n measureRenderedContentSize() {\n const contentEl = this._contentWrapper.nativeElement;\n return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;\n }\n /**\n * Measure the total combined size of the given range. Throws if the range includes items that are\n * not rendered.\n */\n measureRangeSize(range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }\n /** Update the viewport dimensions and re-render. */\n checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }\n /** Measure the viewport size. */\n _measureViewportSize() {\n this._viewportSize = this.scrollable.measureViewportSize(this.orientation);\n }\n /** Queue up change detection to run. */\n _markChangeDetectionNeeded(runAfter) {\n if (runAfter) {\n this._runAfterChangeDetection.push(runAfter);\n }\n // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of\n // properties sequentially we only have to run `_doChangeDetection` once at the end.\n if (!this._isChangeDetectionPending) {\n this._isChangeDetectionPending = true;\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._doChangeDetection();\n }));\n }\n }\n /** Run change detection. */\n _doChangeDetection() {\n this._isChangeDetectionPending = false;\n // Apply the content transform. The transform can't be set via an Angular binding because\n // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of\n // string literals, a variable that can only be 'X' or 'Y', and user input that is run through\n // the `Number` function first to coerce it to a numeric value.\n this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;\n // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection\n // from the root, since the repeated items are content projected in. Calling `detectChanges`\n // instead does not properly check the projected content.\n this.ngZone.run(() => this._changeDetectorRef.markForCheck());\n const runAfterChangeDetection = this._runAfterChangeDetection;\n this._runAfterChangeDetection = [];\n for (const fn of runAfterChangeDetection) {\n fn();\n }\n }\n /** Calculates the `style.width` and `style.height` for the spacer element. */\n _calculateSpacerSize() {\n this._totalContentHeight = this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth = this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }\n static {\n this.ɵfac = function CdkVirtualScrollViewport_Factory(t) {\n return new (t || CdkVirtualScrollViewport)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(VIRTUAL_SCROLL_STRATEGY, 8), i0.ɵɵdirectiveInject(i2.Directionality, 8), i0.ɵɵdirectiveInject(ScrollDispatcher), i0.ɵɵdirectiveInject(ViewportRuler), i0.ɵɵdirectiveInject(VIRTUAL_SCROLLABLE, 8));\n };\n }\n static {\n this.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: CdkVirtualScrollViewport,\n selectors: [[\"cdk-virtual-scroll-viewport\"]],\n viewQuery: function CdkVirtualScrollViewport_Query(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵviewQuery(_c0, 7);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx._contentWrapper = _t.first);\n }\n },\n hostAttrs: [1, \"cdk-virtual-scroll-viewport\"],\n hostVars: 4,\n hostBindings: function CdkVirtualScrollViewport_HostBindings(rf, ctx) {\n if (rf & 2) {\n i0.ɵɵclassProp(\"cdk-virtual-scroll-orientation-horizontal\", ctx.orientation === \"horizontal\")(\"cdk-virtual-scroll-orientation-vertical\", ctx.orientation !== \"horizontal\");\n }\n },\n inputs: {\n orientation: \"orientation\",\n appendOnly: [\"appendOnly\", \"appendOnly\", booleanAttribute]\n },\n outputs: {\n scrolledIndexChange: \"scrolledIndexChange\"\n },\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: CdkScrollable,\n useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,\n deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport]\n }]), i0.ɵɵInputTransformsFeature, i0.ɵɵInheritDefinitionFeature, i0.ɵɵStandaloneFeature],\n ngContentSelectors: _c1,\n decls: 4,\n vars: 4,\n consts: [[1, \"cdk-virtual-scroll-content-wrapper\"], [\"contentWrapper\", \"\"], [1, \"cdk-virtual-scroll-spacer\"]],\n template: function CdkVirtualScrollViewport_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojectionDef();\n i0.ɵɵelementStart(0, \"div\", 0, 1);\n i0.ɵɵprojection(2);\n i0.ɵɵelementEnd();\n i0.ɵɵelement(3, \"div\", 2);\n }\n if (rf & 2) {\n i0.ɵɵadvance(3);\n i0.ɵɵstyleProp(\"width\", ctx._totalContentWidth)(\"height\", ctx._totalContentHeight);\n }\n },\n styles: [\"cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\"],\n encapsulation: 2,\n changeDetection: 0\n });\n }\n }\n return CdkVirtualScrollViewport;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Helper to extract the offset of a DOM Node in a certain direction. */\nfunction getOffset(orientation, direction, node) {\n const el = node;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n const rect = el.getBoundingClientRect();\n if (orientation === 'horizontal') {\n return direction === 'start' ? rect.left : rect.right;\n }\n return direction === 'start' ? rect.top : rect.bottom;\n}\n/**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\nlet CdkVirtualForOf = /*#__PURE__*/(() => {\n class CdkVirtualForOf {\n /** The DataSource to display. */\n get cdkVirtualForOf() {\n return this._cdkVirtualForOf;\n }\n set cdkVirtualForOf(value) {\n this._cdkVirtualForOf = value;\n if (isDataSource(value)) {\n this._dataSourceChanges.next(value);\n } else {\n // If value is an an NgIterable, convert it to an array.\n this._dataSourceChanges.next(new ArrayDataSource(isObservable(value) ? value : Array.from(value || [])));\n }\n }\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n get cdkVirtualForTrackBy() {\n return this._cdkVirtualForTrackBy;\n }\n set cdkVirtualForTrackBy(fn) {\n this._needsUpdate = true;\n this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : undefined;\n }\n /** The template used to stamp out new elements. */\n set cdkVirtualForTemplate(value) {\n if (value) {\n this._needsUpdate = true;\n this._template = value;\n }\n }\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n get cdkVirtualForTemplateCacheSize() {\n return this._viewRepeater.viewCacheSize;\n }\n set cdkVirtualForTemplateCacheSize(size) {\n this._viewRepeater.viewCacheSize = coerceNumberProperty(size);\n }\n constructor( /** The view container to add items to. */\n _viewContainerRef, /** The template to use when stamping out new items. */\n _template, /** The set of available differs. */\n _differs, /** The strategy used to render items in the virtual scroll viewport. */\n _viewRepeater, /** The virtual scrolling viewport that these items are being rendered in. */\n _viewport, ngZone) {\n this._viewContainerRef = _viewContainerRef;\n this._template = _template;\n this._differs = _differs;\n this._viewRepeater = _viewRepeater;\n this._viewport = _viewport;\n /** Emits when the rendered view of the data changes. */\n this.viewChange = new Subject();\n /** Subject that emits when a new DataSource instance is given. */\n this._dataSourceChanges = new Subject();\n /** Emits whenever the data in the current DataSource changes. */\n this.dataStream = this._dataSourceChanges.pipe(\n // Start off with null `DataSource`.\n startWith(null),\n // Bundle up the previous and current data sources so we can work with both.\n pairwise(),\n // Use `_changeDataSource` to disconnect from the previous data source and connect to the\n // new one, passing back a stream of data changes which we run through `switchMap` to give\n // us a data stream that emits the latest data from whatever the current `DataSource` is.\n switchMap(([prev, cur]) => this._changeDataSource(prev, cur)),\n // Replay the last emitted data when someone subscribes.\n shareReplay(1));\n /** The differ used to calculate changes to the data. */\n this._differ = null;\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n this._needsUpdate = false;\n this._destroyed = new Subject();\n this.dataStream.subscribe(data => {\n this._data = data;\n this._onRenderedDataChange();\n });\n this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe(range => {\n this._renderedRange = range;\n if (this.viewChange.observers.length) {\n ngZone.run(() => this.viewChange.next(this._renderedRange));\n }\n this._onRenderedDataChange();\n });\n this._viewport.attach(this);\n }\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n measureRangeSize(range, orientation) {\n if (range.start >= range.end) {\n return 0;\n }\n if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(`Error: attempted to measure an item that isn't rendered.`);\n }\n // The index into the list of rendered views for the first item in the range.\n const renderedStartIndex = range.start - this._renderedRange.start;\n // The length of the range we're measuring.\n const rangeLen = range.end - range.start;\n // Loop over all the views, find the first and land node and compute the size by subtracting\n // the top of the first node from the bottom of the last one.\n let firstNode;\n let lastNode;\n // Find the first node by starting from the beginning and going forwards.\n for (let i = 0; i < rangeLen; i++) {\n const view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n firstNode = lastNode = view.rootNodes[0];\n break;\n }\n }\n // Find the last node by starting from the end and going backwards.\n for (let i = rangeLen - 1; i > -1; i--) {\n const view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n lastNode = view.rootNodes[view.rootNodes.length - 1];\n break;\n }\n }\n return firstNode && lastNode ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode) : 0;\n }\n ngDoCheck() {\n if (this._differ && this._needsUpdate) {\n // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of\n // this list being rendered (can use simpler algorithm) vs needs update due to data actually\n // changing (need to do this diff).\n const changes = this._differ.diff(this._renderedItems);\n if (!changes) {\n this._updateContext();\n } else {\n this._applyChanges(changes);\n }\n this._needsUpdate = false;\n }\n }\n ngOnDestroy() {\n this._viewport.detach();\n this._dataSourceChanges.next(undefined);\n this._dataSourceChanges.complete();\n this.viewChange.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._viewRepeater.detach();\n }\n /** React to scroll state changes in the viewport. */\n _onRenderedDataChange() {\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n // Use a wrapper function for the `trackBy` so any new values are\n // picked up automatically without having to recreate the differ.\n this._differ = this._differs.find(this._renderedItems).create((index, item) => {\n return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item;\n });\n }\n this._needsUpdate = true;\n }\n /** Swap out one `DataSource` for another. */\n _changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : of();\n }\n /** Update the `CdkVirtualForOfContext` for all views. */\n _updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }\n /** Apply changes to the DOM. */\n _applyChanges(changes) {\n this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item);\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange(record => {\n const view = this._viewContainerRef.get(record.currentIndex);\n view.context.$implicit = record.item;\n });\n // Update the context variables on all items.\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n }\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n _updateComputedContextProperties(context) {\n context.first = context.index === 0;\n context.last = context.index === context.count - 1;\n context.even = context.index % 2 === 0;\n context.odd = !context.even;\n }\n _getEmbeddedViewArgs(record, index) {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return {\n templateRef: this._template,\n context: {\n $implicit: record.item,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false\n },\n index\n };\n }\n static {\n this.ɵfac = function CdkVirtualForOf_Factory(t) {\n return new (t || CdkVirtualForOf)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.IterableDiffers), i0.ɵɵdirectiveInject(_VIEW_REPEATER_STRATEGY), i0.ɵɵdirectiveInject(CdkVirtualScrollViewport, 4), i0.ɵɵdirectiveInject(i0.NgZone));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkVirtualForOf,\n selectors: [[\"\", \"cdkVirtualFor\", \"\", \"cdkVirtualForOf\", \"\"]],\n inputs: {\n cdkVirtualForOf: \"cdkVirtualForOf\",\n cdkVirtualForTrackBy: \"cdkVirtualForTrackBy\",\n cdkVirtualForTemplate: \"cdkVirtualForTemplate\",\n cdkVirtualForTemplateCacheSize: \"cdkVirtualForTemplateCacheSize\"\n },\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: _VIEW_REPEATER_STRATEGY,\n useClass: _RecycleViewRepeaterStrategy\n }])]\n });\n }\n }\n return CdkVirtualForOf;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Provides a virtual scrollable for the element it is attached to.\n */\nlet CdkVirtualScrollableElement = /*#__PURE__*/(() => {\n class CdkVirtualScrollableElement extends CdkVirtualScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from] - this.measureScrollOffset(from);\n }\n static {\n this.ɵfac = function CdkVirtualScrollableElement_Factory(t) {\n return new (t || CdkVirtualScrollableElement)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(ScrollDispatcher), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i2.Directionality, 8));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkVirtualScrollableElement,\n selectors: [[\"\", \"cdkVirtualScrollingElement\", \"\"]],\n hostAttrs: [1, \"cdk-virtual-scrollable\"],\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: VIRTUAL_SCROLLABLE,\n useExisting: CdkVirtualScrollableElement\n }]), i0.ɵɵInheritDefinitionFeature]\n });\n }\n }\n return CdkVirtualScrollableElement;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Provides as virtual scrollable for the global / window scrollbar.\n */\nlet CdkVirtualScrollableWindow = /*#__PURE__*/(() => {\n class CdkVirtualScrollableWindow extends CdkVirtualScrollable {\n constructor(scrollDispatcher, ngZone, dir) {\n super(new ElementRef(document.documentElement), scrollDispatcher, ngZone, dir);\n this._elementScrolled = new Observable(observer => this.ngZone.runOutsideAngular(() => fromEvent(document, 'scroll').pipe(takeUntil(this._destroyed)).subscribe(observer)));\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from];\n }\n static {\n this.ɵfac = function CdkVirtualScrollableWindow_Factory(t) {\n return new (t || CdkVirtualScrollableWindow)(i0.ɵɵdirectiveInject(ScrollDispatcher), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i2.Directionality, 8));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkVirtualScrollableWindow,\n selectors: [[\"cdk-virtual-scroll-viewport\", \"scrollWindow\", \"\"]],\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: VIRTUAL_SCROLLABLE,\n useExisting: CdkVirtualScrollableWindow\n }]), i0.ɵɵInheritDefinitionFeature]\n });\n }\n }\n return CdkVirtualScrollableWindow;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet CdkScrollableModule = /*#__PURE__*/(() => {\n class CdkScrollableModule {\n static {\n this.ɵfac = function CdkScrollableModule_Factory(t) {\n return new (t || CdkScrollableModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: CdkScrollableModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return CdkScrollableModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * @docs-primary-export\n */\nlet ScrollingModule = /*#__PURE__*/(() => {\n class ScrollingModule {\n static {\n this.ɵfac = function ScrollingModule_Factory(t) {\n return new (t || ScrollingModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: ScrollingModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n imports: [BidiModule, CdkScrollableModule, BidiModule, CdkScrollableModule]\n });\n }\n }\n return ScrollingModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { CdkFixedSizeVirtualScroll, CdkScrollable, CdkScrollableModule, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollable, CdkVirtualScrollableElement, CdkVirtualScrollableWindow, DEFAULT_RESIZE_TIME, DEFAULT_SCROLL_TIME, FixedSizeVirtualScrollStrategy, ScrollDispatcher, ScrollingModule, VIRTUAL_SCROLLABLE, VIRTUAL_SCROLL_STRATEGY, ViewportRuler, _fixedSizeVirtualScrollStrategyFactory };\n","const MAC_ENTER = 3;\nconst BACKSPACE = 8;\nconst TAB = 9;\nconst NUM_CENTER = 12;\nconst ENTER = 13;\nconst SHIFT = 16;\nconst CONTROL = 17;\nconst ALT = 18;\nconst PAUSE = 19;\nconst CAPS_LOCK = 20;\nconst ESCAPE = 27;\nconst SPACE = 32;\nconst PAGE_UP = 33;\nconst PAGE_DOWN = 34;\nconst END = 35;\nconst HOME = 36;\nconst LEFT_ARROW = 37;\nconst UP_ARROW = 38;\nconst RIGHT_ARROW = 39;\nconst DOWN_ARROW = 40;\nconst PLUS_SIGN = 43;\nconst PRINT_SCREEN = 44;\nconst INSERT = 45;\nconst DELETE = 46;\nconst ZERO = 48;\nconst ONE = 49;\nconst TWO = 50;\nconst THREE = 51;\nconst FOUR = 52;\nconst FIVE = 53;\nconst SIX = 54;\nconst SEVEN = 55;\nconst EIGHT = 56;\nconst NINE = 57;\nconst FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nconst FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nconst QUESTION_MARK = 63;\nconst AT_SIGN = 64;\nconst A = 65;\nconst B = 66;\nconst C = 67;\nconst D = 68;\nconst E = 69;\nconst F = 70;\nconst G = 71;\nconst H = 72;\nconst I = 73;\nconst J = 74;\nconst K = 75;\nconst L = 76;\nconst M = 77;\nconst N = 78;\nconst O = 79;\nconst P = 80;\nconst Q = 81;\nconst R = 82;\nconst S = 83;\nconst T = 84;\nconst U = 85;\nconst V = 86;\nconst W = 87;\nconst X = 88;\nconst Y = 89;\nconst Z = 90;\nconst META = 91; // WIN_KEY_LEFT\nconst MAC_WK_CMD_LEFT = 91;\nconst MAC_WK_CMD_RIGHT = 93;\nconst CONTEXT_MENU = 93;\nconst NUMPAD_ZERO = 96;\nconst NUMPAD_ONE = 97;\nconst NUMPAD_TWO = 98;\nconst NUMPAD_THREE = 99;\nconst NUMPAD_FOUR = 100;\nconst NUMPAD_FIVE = 101;\nconst NUMPAD_SIX = 102;\nconst NUMPAD_SEVEN = 103;\nconst NUMPAD_EIGHT = 104;\nconst NUMPAD_NINE = 105;\nconst NUMPAD_MULTIPLY = 106;\nconst NUMPAD_PLUS = 107;\nconst NUMPAD_MINUS = 109;\nconst NUMPAD_PERIOD = 110;\nconst NUMPAD_DIVIDE = 111;\nconst F1 = 112;\nconst F2 = 113;\nconst F3 = 114;\nconst F4 = 115;\nconst F5 = 116;\nconst F6 = 117;\nconst F7 = 118;\nconst F8 = 119;\nconst F9 = 120;\nconst F10 = 121;\nconst F11 = 122;\nconst F12 = 123;\nconst NUM_LOCK = 144;\nconst SCROLL_LOCK = 145;\nconst FIRST_MEDIA = 166;\nconst FF_MINUS = 173;\nconst MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nconst VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nconst VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nconst FF_MUTE = 181;\nconst FF_VOLUME_DOWN = 182;\nconst LAST_MEDIA = 183;\nconst FF_VOLUME_UP = 183;\nconst SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nconst EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nconst COMMA = 188;\nconst DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nconst PERIOD = 190;\nconst SLASH = 191;\nconst APOSTROPHE = 192;\nconst TILDE = 192;\nconst OPEN_SQUARE_BRACKET = 219;\nconst BACKSLASH = 220;\nconst CLOSE_SQUARE_BRACKET = 221;\nconst SINGLE_QUOTE = 222;\nconst MAC_META = 224;\n\n/**\n * Checks whether a modifier key is pressed.\n * @param event Event to be checked.\n */\nfunction hasModifierKey(event, ...modifiers) {\n if (modifiers.length) {\n return modifiers.some(modifier => event[modifier]);\n }\n return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { A, ALT, APOSTROPHE, AT_SIGN, B, BACKSLASH, BACKSPACE, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, D, DASH, DELETE, DOWN_ARROW, E, EIGHT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FOUR, G, H, HOME, I, INSERT, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, META, MUTE, N, NINE, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PAUSE, PERIOD, PLUS_SIGN, PRINT_SCREEN, Q, QUESTION_MARK, R, RIGHT_ARROW, S, SCROLL_LOCK, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SPACE, T, TAB, THREE, TILDE, TWO, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, W, X, Y, Z, ZERO, hasModifierKey };\n","import * as i1 from '@angular/cdk/scrolling';\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nexport { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';\nimport * as i6 from '@angular/common';\nimport { DOCUMENT } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, Directive, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';\nimport { coerceCssPixelValue, coerceArray } from '@angular/cdk/coercion';\nimport * as i1$1 from '@angular/cdk/platform';\nimport { supportsScrollBehavior, _getEventTarget, _isTestEnvironment } from '@angular/cdk/platform';\nimport { filter, take, takeUntil, takeWhile } from 'rxjs/operators';\nimport * as i5 from '@angular/cdk/bidi';\nimport { BidiModule } from '@angular/cdk/bidi';\nimport { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';\nimport { Subject, Subscription, merge } from 'rxjs';\nimport { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';\nconst scrollBehaviorSupported = /*#__PURE__*/supportsScrollBehavior();\n/**\n * Strategy that will prevent the user from scrolling while the overlay is visible.\n */\nclass BlockScrollStrategy {\n constructor(_viewportRuler, document) {\n this._viewportRuler = _viewportRuler;\n this._previousHTMLStyles = {\n top: '',\n left: ''\n };\n this._isEnabled = false;\n this._document = document;\n }\n /** Attaches this scroll strategy to an overlay. */\n attach() {}\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this._canBeEnabled()) {\n const root = this._document.documentElement;\n this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();\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 // 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 /** 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 this._isEnabled = false;\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\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 window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n _canBeEnabled() {\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 if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {\n return false;\n }\n const body = this._document.body;\n const viewport = this._viewportRuler.getViewportSize();\n return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;\n }\n}\n\n/**\n * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.\n */\nfunction getMatScrollStrategyAlreadyAttachedError() {\n return Error(`Scroll strategy has already been attached.`);\n}\n\n/**\n * Strategy that will close the overlay as soon as the user starts scrolling.\n */\nclass CloseScrollStrategy {\n constructor(_scrollDispatcher, _ngZone, _viewportRuler, _config) {\n this._scrollDispatcher = _scrollDispatcher;\n this._ngZone = _ngZone;\n this._viewportRuler = _viewportRuler;\n this._config = _config;\n this._scrollSubscription = null;\n /** Detaches the overlay ref and disables the scroll strategy. */\n this._detach = () => {\n this.disable();\n if (this._overlayRef.hasAttached()) {\n this._ngZone.run(() => this._overlayRef.detach());\n }\n };\n }\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n this._overlayRef = overlayRef;\n }\n /** Enables the closing of the attached overlay on scroll. */\n enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0).pipe(filter(scrollable => {\n return !scrollable || !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement);\n }));\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\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 /** 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 detach() {\n this.disable();\n this._overlayRef = null;\n }\n}\n\n/** Scroll strategy that doesn't do anything. */\nclass NoopScrollStrategy {\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/**\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 */\nfunction isElementScrolledOutsideView(element, scrollContainers) {\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 return outsideAbove || outsideBelow || outsideLeft || outsideRight;\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 */\nfunction isElementClippedByScrolling(element, scrollContainers) {\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 return clippedAbove || clippedBelow || clippedLeft || clippedRight;\n });\n}\n\n/**\n * Strategy that will update the element position as the user is scrolling.\n */\nclass RepositionScrollStrategy {\n constructor(_scrollDispatcher, _viewportRuler, _ngZone, _config) {\n this._scrollDispatcher = _scrollDispatcher;\n this._viewportRuler = _viewportRuler;\n this._ngZone = _ngZone;\n this._config = _config;\n this._scrollSubscription = null;\n }\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n this._overlayRef = overlayRef;\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 this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {\n this._overlayRef.updatePosition();\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 {\n width,\n height\n } = this._viewportRuler.getViewportSize();\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 = [{\n width,\n height,\n bottom: height,\n right: width,\n top: 0,\n left: 0\n }];\n if (isElementScrolledOutsideView(overlayRect, parentRects)) {\n this.disable();\n this._ngZone.run(() => this._overlayRef.detach());\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 detach() {\n this.disable();\n this._overlayRef = null;\n }\n}\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 */\nlet ScrollStrategyOptions = /*#__PURE__*/(() => {\n class ScrollStrategyOptions {\n constructor(_scrollDispatcher, _viewportRuler, _ngZone, document) {\n this._scrollDispatcher = _scrollDispatcher;\n this._viewportRuler = _viewportRuler;\n this._ngZone = _ngZone;\n /** Do nothing on scroll. */\n this.noop = () => new NoopScrollStrategy();\n /**\n * Close the overlay as soon as the user scrolls.\n * @param config Configuration to be used inside the scroll strategy.\n */\n this.close = config => new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config);\n /** Block scrolling. */\n this.block = () => new BlockScrollStrategy(this._viewportRuler, this._document);\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 this.reposition = config => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config);\n this._document = document;\n }\n static {\n this.ɵfac = function ScrollStrategyOptions_Factory(t) {\n return new (t || ScrollStrategyOptions)(i0.ɵɵinject(i1.ScrollDispatcher), i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(DOCUMENT));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ScrollStrategyOptions,\n factory: ScrollStrategyOptions.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return ScrollStrategyOptions;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Initial configuration used when creating an overlay. */\nclass OverlayConfig {\n constructor(config) {\n /** Strategy to be used when handling scroll events while the overlay is open. */\n this.scrollStrategy = new NoopScrollStrategy();\n /** Custom class to add to the overlay pane. */\n this.panelClass = '';\n /** Whether the overlay has a backdrop. */\n this.hasBackdrop = false;\n /** Custom class to add to the backdrop */\n this.backdropClass = 'cdk-overlay-dark-backdrop';\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 this.disposeOnNavigation = false;\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);\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];\n }\n }\n }\n }\n}\n\n/** The points of the origin element and the overlay element to connect. */\nclass ConnectionPositionPair {\n constructor(origin, overlay, /** Offset along the X axis. */\n offsetX, /** Offset along the Y axis. */\n offsetY, /** Class(es) to be applied to the panel while this position is active. */\n panelClass) {\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.panelClass = panelClass;\n this.originX = origin.originX;\n this.originY = origin.originY;\n this.overlayX = overlay.overlayX;\n this.overlayY = overlay.overlayY;\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 */\nclass ScrollingVisibility {}\n/** The change event emitted by the strategy when a fallback position is used. */\nclass ConnectedOverlayPositionChange {\n constructor( /** The position used as a result of this change. */\n connectionPair, /** @docs-private */\n scrollableViewProperties) {\n this.connectionPair = connectionPair;\n this.scrollableViewProperties = scrollableViewProperties;\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 */\nfunction validateVerticalPosition(property, value) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` + `Expected \"top\", \"bottom\" or \"center\".`);\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 */\nfunction validateHorizontalPosition(property, value) {\n if (value !== 'start' && value !== 'end' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` + `Expected \"start\", \"end\" or \"center\".`);\n }\n}\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 */\nlet BaseOverlayDispatcher = /*#__PURE__*/(() => {\n class BaseOverlayDispatcher {\n constructor(document) {\n /** Currently attached overlays in the order they were attached. */\n this._attachedOverlays = [];\n this._document = document;\n }\n ngOnDestroy() {\n this.detach();\n }\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n // Ensure that we don't get the same overlay multiple times.\n this.remove(overlayRef);\n this._attachedOverlays.push(overlayRef);\n }\n /** Remove an overlay from the list of attached overlay refs. */\n remove(overlayRef) {\n const index = this._attachedOverlays.indexOf(overlayRef);\n if (index > -1) {\n this._attachedOverlays.splice(index, 1);\n }\n // Remove the global listener once there are no more overlays.\n if (this._attachedOverlays.length === 0) {\n this.detach();\n }\n }\n static {\n this.ɵfac = function BaseOverlayDispatcher_Factory(t) {\n return new (t || BaseOverlayDispatcher)(i0.ɵɵinject(DOCUMENT));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: BaseOverlayDispatcher,\n factory: BaseOverlayDispatcher.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return BaseOverlayDispatcher;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\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 */\nlet OverlayKeyboardDispatcher = /*#__PURE__*/(() => {\n class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {\n constructor(document, /** @breaking-change 14.0.0 _ngZone will be required. */\n _ngZone) {\n super(document);\n this._ngZone = _ngZone;\n /** Keyboard event listener that will be attached to the body. */\n this._keydownListener = event => {\n const overlays = this._attachedOverlays;\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 const keydownEvents = overlays[i]._keydownEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => keydownEvents.next(event));\n } else {\n keydownEvents.next(event);\n }\n break;\n }\n }\n };\n }\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n super.add(overlayRef);\n // Lazily start dispatcher once first overlay is added\n if (!this._isAttached) {\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => this._document.body.addEventListener('keydown', this._keydownListener));\n } else {\n this._document.body.addEventListener('keydown', this._keydownListener);\n }\n this._isAttached = true;\n }\n }\n /** Detaches the global keyboard event listener. */\n detach() {\n if (this._isAttached) {\n this._document.body.removeEventListener('keydown', this._keydownListener);\n this._isAttached = false;\n }\n }\n static {\n this.ɵfac = function OverlayKeyboardDispatcher_Factory(t) {\n return new (t || OverlayKeyboardDispatcher)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i0.NgZone, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: OverlayKeyboardDispatcher,\n factory: OverlayKeyboardDispatcher.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return OverlayKeyboardDispatcher;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\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 */\nlet OverlayOutsideClickDispatcher = /*#__PURE__*/(() => {\n class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {\n constructor(document, _platform, /** @breaking-change 14.0.0 _ngZone will be required. */\n _ngZone) {\n super(document);\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._cursorStyleIsSet = false;\n /** Store pointerdown event target to track origin of click. */\n this._pointerDownListener = event => {\n this._pointerDownEventTarget = _getEventTarget(event);\n };\n /** Click event listener that will be attached to the body propagate phase. */\n this._clickListener = event => {\n const target = _getEventTarget(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 = event.type === 'click' && this._pointerDownEventTarget ? this._pointerDownEventTarget : target;\n // Reset the stored pointerdown event target, to avoid having it interfere\n // in subsequent events.\n this._pointerDownEventTarget = null;\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 // 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 // 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 (overlayRef.overlayElement.contains(target) || overlayRef.overlayElement.contains(origin)) {\n break;\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 /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n super.add(overlayRef);\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 /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => this._addEventListeners(body));\n } else {\n this._addEventListeners(body);\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 this._isAttached = true;\n }\n }\n /** Detaches the global keyboard event listener. */\n detach() {\n if (this._isAttached) {\n const body = this._document.body;\n body.removeEventListener('pointerdown', this._pointerDownListener, true);\n body.removeEventListener('click', this._clickListener, true);\n body.removeEventListener('auxclick', this._clickListener, true);\n body.removeEventListener('contextmenu', this._clickListener, true);\n if (this._platform.IOS && this._cursorStyleIsSet) {\n body.style.cursor = this._cursorOriginalValue;\n this._cursorStyleIsSet = false;\n }\n this._isAttached = false;\n }\n }\n _addEventListeners(body) {\n body.addEventListener('pointerdown', this._pointerDownListener, true);\n body.addEventListener('click', this._clickListener, true);\n body.addEventListener('auxclick', this._clickListener, true);\n body.addEventListener('contextmenu', this._clickListener, true);\n }\n static {\n this.ɵfac = function OverlayOutsideClickDispatcher_Factory(t) {\n return new (t || OverlayOutsideClickDispatcher)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i1$1.Platform), i0.ɵɵinject(i0.NgZone, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: OverlayOutsideClickDispatcher,\n factory: OverlayOutsideClickDispatcher.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return OverlayOutsideClickDispatcher;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Container inside which all overlays will render. */\nlet OverlayContainer = /*#__PURE__*/(() => {\n class OverlayContainer {\n constructor(document, _platform) {\n this._platform = _platform;\n this._document = document;\n }\n ngOnDestroy() {\n this._containerElement?.remove();\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() {\n if (!this._containerElement) {\n this._createContainer();\n }\n return this._containerElement;\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 _createContainer() {\n const containerClass = 'cdk-overlay-container';\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(`.${containerClass}[platform=\"server\"], ` + `.${containerClass}[platform=\"test\"]`);\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 const container = this._document.createElement('div');\n container.classList.add(containerClass);\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 this._document.body.appendChild(container);\n this._containerElement = container;\n }\n static {\n this.ɵfac = function OverlayContainer_Factory(t) {\n return new (t || OverlayContainer)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i1$1.Platform));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: OverlayContainer,\n factory: OverlayContainer.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return OverlayContainer;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\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 */\nclass OverlayRef {\n constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false) {\n this._portalOutlet = _portalOutlet;\n this._host = _host;\n this._pane = _pane;\n this._config = _config;\n this._ngZone = _ngZone;\n this._keyboardDispatcher = _keyboardDispatcher;\n this._document = _document;\n this._location = _location;\n this._outsideClickDispatcher = _outsideClickDispatcher;\n this._animationsDisabled = _animationsDisabled;\n this._backdropElement = null;\n this._backdropClick = new Subject();\n this._attachments = new Subject();\n this._detachments = new Subject();\n this._locationChanges = Subscription.EMPTY;\n this._backdropClickHandler = event => this._backdropClick.next(event);\n this._backdropTransitionendHandler = event => {\n this._disposeBackdrop(event.target);\n };\n /** Stream of keydown events dispatched to this overlay. */\n this._keydownEvents = new Subject();\n /** Stream of mouse outside events dispatched to this overlay. */\n this._outsidePointerEvents = new Subject();\n if (_config.scrollStrategy) {\n this._scrollStrategy = _config.scrollStrategy;\n this._scrollStrategy.attach(this);\n }\n this._positionStrategy = _config.positionStrategy;\n }\n /** The overlay's HTML element */\n get overlayElement() {\n return this._pane;\n }\n /** The overlay's backdrop HTML element. */\n get backdropElement() {\n return this._backdropElement;\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() {\n return this._host;\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) {\n // Insert the host into the DOM before attaching the portal, otherwise\n // the animations module will skip animations on repeat attachments.\n if (!this._host.parentElement && this._previousHostParent) {\n this._previousHostParent.appendChild(this._host);\n }\n const attachResult = this._portalOutlet.attach(portal);\n if (this._positionStrategy) {\n this._positionStrategy.attach(this);\n }\n this._updateStackingOrder();\n this._updateElementSize();\n this._updateElementDirection();\n if (this._scrollStrategy) {\n this._scrollStrategy.enable();\n }\n // Update the position once the zone is stable so that the overlay will be fully rendered\n // before attempting to position it, as the position may depend on the size of the rendered\n // content.\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\n // The overlay could've been detached before the zone has stabilized.\n if (this.hasAttached()) {\n this.updatePosition();\n }\n });\n // Enable pointer events for the overlay pane element.\n this._togglePointerEvents(true);\n if (this._config.hasBackdrop) {\n this._attachBackdrop();\n }\n if (this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, true);\n }\n // Only emit the `attachments` event once all other setup is done.\n this._attachments.next();\n // Track this overlay by the keyboard dispatcher\n this._keyboardDispatcher.add(this);\n if (this._config.disposeOnNavigation) {\n this._locationChanges = this._location.subscribe(() => this.dispose());\n }\n this._outsideClickDispatcher.add(this);\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 return attachResult;\n }\n /**\n * Detaches an overlay from a portal.\n * @returns The portal detachment result.\n */\n detach() {\n if (!this.hasAttached()) {\n return;\n }\n this.detachBackdrop();\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 if (this._positionStrategy && this._positionStrategy.detach) {\n this._positionStrategy.detach();\n }\n if (this._scrollStrategy) {\n this._scrollStrategy.disable();\n }\n const detachmentResult = this._portalOutlet.detach();\n // Only emit after everything is detached.\n this._detachments.next();\n // Remove this overlay from keyboard dispatcher tracking.\n this._keyboardDispatcher.remove(this);\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._detachContentWhenStable();\n this._locationChanges.unsubscribe();\n this._outsideClickDispatcher.remove(this);\n return detachmentResult;\n }\n /** Cleans up the overlay from the DOM. */\n dispose() {\n const isAttached = this.hasAttached();\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._disposeScrollStrategy();\n this._disposeBackdrop(this._backdropElement);\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._previousHostParent = this._pane = this._host = null;\n if (isAttached) {\n this._detachments.next();\n }\n this._detachments.complete();\n }\n /** Whether the overlay has attached content. */\n hasAttached() {\n return this._portalOutlet.hasAttached();\n }\n /** Gets an observable that emits when the backdrop has been clicked. */\n backdropClick() {\n return this._backdropClick;\n }\n /** Gets an observable that emits when the overlay has been attached. */\n attachments() {\n return this._attachments;\n }\n /** Gets an observable that emits when the overlay has been detached. */\n detachments() {\n return this._detachments;\n }\n /** Gets an observable of keydown events targeted to this overlay. */\n keydownEvents() {\n return this._keydownEvents;\n }\n /** Gets an observable of pointer events targeted outside this overlay. */\n outsidePointerEvents() {\n return this._outsidePointerEvents;\n }\n /** Gets the current overlay configuration, which is immutable. */\n getConfig() {\n return this._config;\n }\n /** Updates the position of the overlay based on the position strategy. */\n updatePosition() {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }\n /** Switches to a new position strategy and updates the overlay position. */\n updatePositionStrategy(strategy) {\n if (strategy === this._positionStrategy) {\n return;\n }\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._positionStrategy = strategy;\n if (this.hasAttached()) {\n strategy.attach(this);\n this.updatePosition();\n }\n }\n /** Update the size properties of the overlay. */\n updateSize(sizeConfig) {\n this._config = {\n ...this._config,\n ...sizeConfig\n };\n this._updateElementSize();\n }\n /** Sets the LTR/RTL direction for the overlay. */\n setDirection(dir) {\n this._config = {\n ...this._config,\n direction: dir\n };\n this._updateElementDirection();\n }\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }\n /**\n * Returns the layout direction of the overlay panel.\n */\n getDirection() {\n const direction = this._config.direction;\n if (!direction) {\n return 'ltr';\n }\n return typeof direction === 'string' ? direction : direction.value;\n }\n /** Switches to a new scroll strategy. */\n updateScrollStrategy(strategy) {\n if (strategy === this._scrollStrategy) {\n return;\n }\n this._disposeScrollStrategy();\n this._scrollStrategy = strategy;\n if (this.hasAttached()) {\n strategy.attach(this);\n strategy.enable();\n }\n }\n /** Updates the text direction of the overlay panel. */\n _updateElementDirection() {\n this._host.setAttribute('dir', this.getDirection());\n }\n /** Updates the size of the overlay element based on the overlay config. */\n _updateElementSize() {\n if (!this._pane) {\n return;\n }\n const style = this._pane.style;\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 /** Toggles the pointer events for the overlay pane element. */\n _togglePointerEvents(enablePointer) {\n this._pane.style.pointerEvents = enablePointer ? '' : 'none';\n }\n /** Attaches a backdrop for this overlay. */\n _attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n this._backdropElement = this._document.createElement('div');\n this._backdropElement.classList.add('cdk-overlay-backdrop');\n if (this._animationsDisabled) {\n this._backdropElement.classList.add('cdk-overlay-backdrop-noop-animation');\n }\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropElement, this._config.backdropClass, true);\n }\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._backdropElement, this._host);\n // Forward backdrop clicks such that the consumer of the overlay can perform whatever\n // action desired when such a click occurs (usually closing the overlay).\n this._backdropElement.addEventListener('click', this._backdropClickHandler);\n // Add class to fade-in the backdrop after one frame.\n if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n if (this._backdropElement) {\n this._backdropElement.classList.add(showingClass);\n }\n });\n });\n } else {\n this._backdropElement.classList.add(showingClass);\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 _updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }\n /** Detaches the backdrop (if any) associated with the overlay. */\n detachBackdrop() {\n const backdropToDetach = this._backdropElement;\n if (!backdropToDetach) {\n return;\n }\n if (this._animationsDisabled) {\n this._disposeBackdrop(backdropToDetach);\n return;\n }\n backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');\n this._ngZone.runOutsideAngular(() => {\n backdropToDetach.addEventListener('transitionend', this._backdropTransitionendHandler);\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 backdropToDetach.style.pointerEvents = 'none';\n // Run this outside the Angular zone because there's nothing that Angular cares about.\n // If it were to run inside the Angular zone, every test that used Overlay would have to be\n // either async or fakeAsync.\n this._backdropTimeout = this._ngZone.runOutsideAngular(() => setTimeout(() => {\n this._disposeBackdrop(backdropToDetach);\n }, 500));\n }\n /** Toggles a single CSS class or an array of classes on an element. */\n _toggleClasses(element, cssClasses, isAdd) {\n const classes = coerceArray(cssClasses || []).filter(c => !!c);\n if (classes.length) {\n isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);\n }\n }\n /** Detaches the overlay content next time the zone stabilizes. */\n _detachContentWhenStable() {\n // Normally we wouldn't have to explicitly run this outside the `NgZone`, however\n // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will\n // be patched to run inside the zone, which will throw us into an infinite loop.\n this._ngZone.runOutsideAngular(() => {\n // We can't remove the host here immediately, because the overlay pane's content\n // might still be animating. This stream helps us avoid interrupting the animation\n // by waiting for the pane to become empty.\n const subscription = this._ngZone.onStable.pipe(takeUntil(merge(this._attachments, this._detachments))).subscribe(() => {\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 if (this._host && this._host.parentElement) {\n this._previousHostParent = this._host.parentElement;\n this._host.remove();\n }\n subscription.unsubscribe();\n }\n });\n });\n }\n /** Disposes of a scroll strategy. */\n _disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n if (scrollStrategy) {\n scrollStrategy.disable();\n if (scrollStrategy.detach) {\n scrollStrategy.detach();\n }\n }\n }\n /** Removes a backdrop element from the DOM. */\n _disposeBackdrop(backdrop) {\n if (backdrop) {\n backdrop.removeEventListener('click', this._backdropClickHandler);\n backdrop.removeEventListener('transitionend', this._backdropTransitionendHandler);\n backdrop.remove();\n // It is possible that a new portal has been attached to this overlay since we started\n // removing the backdrop. If that is the case, only clear the backdrop reference if it\n // is still the same instance that we started to remove.\n if (this._backdropElement === backdrop) {\n this._backdropElement = null;\n }\n }\n if (this._backdropTimeout) {\n clearTimeout(this._backdropTimeout);\n this._backdropTimeout = undefined;\n }\n }\n}\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/** Class to be added to the overlay bounding box. */\nconst boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\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 */\nclass FlexibleConnectedPositionStrategy {\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions() {\n return this._preferredPositions;\n }\n constructor(connectedTo, _viewportRuler, _document, _platform, _overlayContainer) {\n this._viewportRuler = _viewportRuler;\n this._document = _document;\n this._platform = _platform;\n this._overlayContainer = _overlayContainer;\n /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */\n this._lastBoundingBoxSize = {\n width: 0,\n height: 0\n };\n /** Whether the overlay was pushed in a previous positioning. */\n this._isPushed = false;\n /** Whether the overlay can be pushed on-screen on the initial open. */\n this._canPush = true;\n /** Whether the overlay can grow via flexible width/height after the initial open. */\n this._growAfterOpen = false;\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n this._hasFlexibleDimensions = true;\n /** Whether the overlay position is locked. */\n this._positionLocked = false;\n /** Amount of space that must be maintained between the overlay and the edge of the viewport. */\n this._viewportMargin = 0;\n /** The Scrollable containers used to check scrollable view properties on position change. */\n this._scrollables = [];\n /** Ordered list of preferred positions, from most to least desirable. */\n this._preferredPositions = [];\n /** Subject that emits whenever the position changes. */\n this._positionChanges = new Subject();\n /** Subscription to viewport size changes. */\n this._resizeSubscription = Subscription.EMPTY;\n /** Default offset for the overlay along the x axis. */\n this._offsetX = 0;\n /** Default offset for the overlay along the y axis. */\n this._offsetY = 0;\n /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */\n this._appliedPanelClasses = [];\n /** Observable sequence of position changes. */\n this.positionChanges = this._positionChanges;\n this.setOrigin(connectedTo);\n }\n /** Attaches this position strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef && overlayRef !== this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('This position strategy is already attached to an overlay');\n }\n this._validatePositions();\n overlayRef.hostElement.classList.add(boundingBoxClass);\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 * 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() {\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 // 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 this._clearPanelClasses();\n this._resetOverlayElementStyles();\n this._resetBoundingBoxStyles();\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._overlayContainer.getContainerElement().getBoundingClientRect();\n const originRect = this._originRect;\n const overlayRect = this._overlayRect;\n const viewportRect = this._viewportRect;\n const containerRect = this._containerRect;\n // Positions where the overlay will fit with flexible dimensions.\n const flexibleFits = [];\n // Fallback if none of the preferred positions fit within the viewport.\n let fallback;\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 // 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 // Calculate how well the overlay would fit into the viewport with this point.\n let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);\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 // 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 continue;\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 = {\n overlayFit,\n overlayPoint,\n originPoint,\n position: pos,\n 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 = null;\n let bestScore = -1;\n for (const fit of flexibleFits) {\n const score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);\n if (score > bestScore) {\n bestScore = score;\n bestFit = fit;\n }\n }\n this._isPushed = false;\n this._applyPosition(bestFit.position, bestFit.origin);\n return;\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 // 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 detach() {\n this._clearPanelClasses();\n this._lastPosition = null;\n this._previousPushAmount = null;\n this._resizeSubscription.unsubscribe();\n }\n /** Cleanup after the element gets destroyed. */\n dispose() {\n if (this._isDisposed) {\n return;\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 });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\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() {\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n const lastPosition = this._lastPosition;\n if (lastPosition) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();\n const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n } else {\n this.apply();\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) {\n this._scrollables = scrollables;\n return this;\n }\n /**\n * Adds new preferred positions.\n * @param positions List of positions options for this overlay.\n */\n withPositions(positions) {\n this._preferredPositions = positions;\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 this._validatePositions();\n return this;\n }\n /**\n * Sets a minimum distance the overlay may be positioned to the edge of the viewport.\n * @param margin Required margin between the overlay and the viewport edge in pixels.\n */\n withViewportMargin(margin) {\n this._viewportMargin = margin;\n return this;\n }\n /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */\n withFlexibleDimensions(flexibleDimensions = true) {\n this._hasFlexibleDimensions = flexibleDimensions;\n return this;\n }\n /** Sets whether the overlay can grow after the initial open via flexible width/height. */\n withGrowAfterOpen(growAfterOpen = true) {\n this._growAfterOpen = growAfterOpen;\n return this;\n }\n /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */\n withPush(canPush = true) {\n this._canPush = canPush;\n return this;\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) {\n this._positionLocked = isLocked;\n return this;\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) {\n this._origin = origin;\n return this;\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) {\n this._offsetX = offset;\n return this;\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) {\n this._offsetY = offset;\n return this;\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) {\n this._transformOriginSelector = selector;\n return this;\n }\n /**\n * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.\n */\n _getOriginPoint(originRect, containerRect, pos) {\n let x;\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 // 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 let y;\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 // 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 return {\n x,\n 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 _getOverlayPoint(originPoint, overlayRect, pos) {\n // Calculate the (overlayStartX, overlayStartY), the start of the\n // potential overlay position relative to the origin point.\n let overlayStartX;\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 let overlayStartY;\n if (pos.overlayY == 'center') {\n overlayStartY = -overlayRect.height / 2;\n } else {\n overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;\n }\n // The (x, y) coordinates of the overlay.\n return {\n x: originPoint.x + overlayStartX,\n y: originPoint.y + overlayStartY\n };\n }\n /** Gets how well an overlay at the given point will fit within the viewport. */\n _getOverlayFit(point, rawOverlayRect, viewport, position) {\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n let {\n x,\n y\n } = point;\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n // Account for the offsets since they could push the overlay out of the viewport.\n if (offsetX) {\n x += offsetX;\n }\n if (offsetY) {\n y += offsetY;\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 // 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 return {\n visibleArea,\n isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,\n fitsInViewportVertically: visibleHeight === overlay.height,\n fitsInViewportHorizontally: visibleWidth == overlay.width\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 _canFitWithFlexibleDimensions(fit, point, viewport) {\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 const verticalFit = fit.fitsInViewportVertically || minHeight != null && minHeight <= availableHeight;\n const horizontalFit = fit.fitsInViewportHorizontally || minWidth != null && minWidth <= availableWidth;\n return verticalFit && horizontalFit;\n }\n return false;\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 _pushOverlayOnScreen(start, rawOverlayRect, scrollPosition) {\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 // 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 // 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 // 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 // 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 = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0;\n }\n if (overlay.height <= viewport.height) {\n pushY = overflowTop || -overflowBottom;\n } else {\n pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0;\n }\n this._previousPushAmount = {\n x: pushX,\n y: pushY\n };\n return {\n x: start.x + pushX,\n y: start.y + pushY\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 _applyPosition(position, originPoint) {\n this._setTransformOrigin(position);\n this._setOverlayElementStyles(originPoint, position);\n this._setBoundingBoxStyles(originPoint, position);\n if (position.panelClass) {\n this._addPanelClasses(position.panelClass);\n }\n // Save the last connected position in case the position needs to be re-calculated.\n this._lastPosition = position;\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 scrollableViewProperties = this._getScrollVisibility();\n const changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);\n this._positionChanges.next(changeEvent);\n }\n this._isInitialRender = false;\n }\n /** Sets the transform origin based on the configured selector and the passed-in position. */\n _setTransformOrigin(position) {\n if (!this._transformOriginSelector) {\n return;\n }\n const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);\n let xOrigin;\n let yOrigin = position.overlayY;\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 for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\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 _calculateBoundingBoxRect(origin, position) {\n const viewport = this._viewportRect;\n const isRtl = this._isRtl();\n let height, top, bottom;\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._viewportMargin;\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 `ClientRect`.\n bottom = viewport.height - origin.y + this._viewportMargin * 2;\n height = viewport.height - bottom + this._viewportMargin;\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(viewport.bottom - origin.y + viewport.top, origin.y);\n const previousHeight = this._lastBoundingBoxSize.height;\n height = smallestDistanceToViewportEdge * 2;\n top = origin.y - smallestDistanceToViewportEdge;\n if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {\n top = origin.y - previousHeight / 2;\n }\n }\n // The overlay is opening 'right-ward' (the content flows to the right).\n const isBoundedByRightViewportEdge = position.overlayX === 'start' && !isRtl || position.overlayX === 'end' && isRtl;\n // The overlay is opening 'left-ward' (the content flows to the left).\n const isBoundedByLeftViewportEdge = position.overlayX === 'end' && !isRtl || position.overlayX === 'start' && isRtl;\n let width, left, right;\n if (isBoundedByLeftViewportEdge) {\n right = viewport.width - origin.x + this._viewportMargin;\n width = origin.x - this._viewportMargin;\n } else if (isBoundedByRightViewportEdge) {\n left = origin.x;\n width = viewport.right - origin.x;\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(viewport.right - origin.x + viewport.left, origin.x);\n const previousWidth = this._lastBoundingBoxSize.width;\n width = smallestDistanceToViewportEdge * 2;\n left = origin.x - smallestDistanceToViewportEdge;\n if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {\n left = origin.x - previousWidth / 2;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width,\n 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 _setBoundingBoxStyles(origin, position) {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\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 const styles = {};\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = 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 styles.height = coerceCssPixelValue(boundingBoxRect.height);\n styles.top = coerceCssPixelValue(boundingBoxRect.top);\n styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);\n styles.width = coerceCssPixelValue(boundingBoxRect.width);\n styles.left = coerceCssPixelValue(boundingBoxRect.left);\n styles.right = coerceCssPixelValue(boundingBoxRect.right);\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 if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n } else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n if (maxHeight) {\n styles.maxHeight = coerceCssPixelValue(maxHeight);\n }\n if (maxWidth) {\n styles.maxWidth = coerceCssPixelValue(maxWidth);\n }\n }\n this._lastBoundingBoxSize = boundingBoxRect;\n extendStyles(this._boundingBox.style, styles);\n }\n /** Resets the styles for the bounding box so that a new positioning can be computed. */\n _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 });\n }\n /** Resets the styles for the overlay pane so that a new positioning can be computed. */\n _resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: ''\n });\n }\n /** Sets positioning styles to the overlay element. */\n _setOverlayElementStyles(originPoint, position) {\n const styles = {};\n const hasExactPosition = this._hasExactPosition();\n const hasFlexibleDimensions = this._hasFlexibleDimensions;\n const config = this._overlayRef.getConfig();\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 // 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 if (offsetX) {\n transformString += `translateX(${offsetX}px) `;\n }\n if (offsetY) {\n transformString += `translateY(${offsetY}px)`;\n }\n styles.transform = transformString.trim();\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 if (config.maxWidth) {\n if (hasExactPosition) {\n styles.maxWidth = coerceCssPixelValue(config.maxWidth);\n } else if (hasFlexibleDimensions) {\n styles.maxWidth = '';\n }\n }\n extendStyles(this._pane.style, styles);\n }\n /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */\n _getExactOverlayY(position, originPoint, scrollPosition) {\n // Reset any existing styles. This is necessary in case the\n // preferred position has changed since the last `apply`.\n let styles = {\n top: '',\n bottom: ''\n };\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\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 return styles;\n }\n /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */\n _getExactOverlayX(position, originPoint, scrollPosition) {\n // Reset any existing styles. This is necessary in case the preferred position has\n // changed since the last `apply`.\n let styles = {\n left: '',\n right: ''\n };\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\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;\n if (this._isRtl()) {\n horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';\n } else {\n horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';\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 return styles;\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 _getScrollVisibility() {\n // Note: needs fresh rects since the position could've changed.\n const originBounds = this._getOriginRect();\n const overlayBounds = this._pane.getBoundingClientRect();\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 return {\n isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),\n isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),\n isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),\n isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds)\n };\n }\n /** Subtracts the amount that an element is overflowing on an axis from its length. */\n _subtractOverflows(length, ...overflows) {\n return overflows.reduce((currentValue, currentOverflow) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }\n /** Narrows the given viewport rect by the current _viewportMargin. */\n _getNarrowedViewportRect() {\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 return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - 2 * this._viewportMargin,\n height: height - 2 * this._viewportMargin\n };\n }\n /** Whether the we're dealing with an RTL context */\n _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n /** Determines whether the overlay uses exact or flexible positioning. */\n _hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }\n /** Retrieves the offset of a position along the x or y axis. */\n _getOffset(position, axis) {\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 return position.offsetY == null ? this._offsetY : position.offsetY;\n }\n /** Validates that the current position match the expected values. */\n _validatePositions() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\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 /** Adds a single CSS class or an array of classes on the overlay panel. */\n _addPanelClasses(cssClasses) {\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 /** Clears the classes that the position strategy has applied from the overlay panel. */\n _clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }\n /** Returns the ClientRect of the current origin. */\n _getOriginRect() {\n const origin = this._origin;\n if (origin instanceof ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\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/** Shallow-extends a stylesheet object with another stylesheet object. */\nfunction extendStyles(destination, source) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n return destination;\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) {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return !units || units === 'px' ? parseFloat(value) : null;\n }\n return input || null;\n}\n/**\n * Gets a version of an element's bounding `ClientRect` 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 `ClientRect` returned by the browser (e.g. when zoomed in with a percentage\n * size, see #21350).\n */\nfunction getRoundedBoundingClientRect(clientRect) {\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}\nconst STANDARD_DROPDOWN_BELOW_POSITIONS = [{\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top'\n}, {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom'\n}, {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top'\n}, {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom'\n}];\nconst STANDARD_DROPDOWN_ADJACENT_POSITIONS = [{\n originX: 'end',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top'\n}, {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom'\n}, {\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'top'\n}, {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'bottom'\n}];\n\n/** Class to be added to the overlay pane wrapper. */\nconst wrapperClass = 'cdk-global-overlay-wrapper';\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 */\nclass GlobalPositionStrategy {\n constructor() {\n this._cssPosition = 'static';\n this._topOffset = '';\n this._bottomOffset = '';\n this._alignItems = '';\n this._xPosition = '';\n this._xOffset = '';\n this._width = '';\n this._height = '';\n this._isDisposed = false;\n }\n attach(overlayRef) {\n const config = overlayRef.getConfig();\n this._overlayRef = overlayRef;\n if (this._width && !config.width) {\n overlayRef.updateSize({\n width: this._width\n });\n }\n if (this._height && !config.height) {\n overlayRef.updateSize({\n height: this._height\n });\n }\n overlayRef.hostElement.classList.add(wrapperClass);\n this._isDisposed = false;\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 = '') {\n this._bottomOffset = '';\n this._topOffset = value;\n this._alignItems = 'flex-start';\n return this;\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 = '') {\n this._xOffset = value;\n this._xPosition = 'left';\n return this;\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 = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\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 = '') {\n this._xOffset = value;\n this._xPosition = 'right';\n return this;\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 = '') {\n this._xOffset = value;\n this._xPosition = 'start';\n return this;\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 = '') {\n this._xOffset = value;\n this._xPosition = 'end';\n return this;\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 = '') {\n if (this._overlayRef) {\n this._overlayRef.updateSize({\n width: value\n });\n } else {\n this._width = value;\n }\n return this;\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 = '') {\n if (this._overlayRef) {\n this._overlayRef.updateSize({\n height: value\n });\n } else {\n this._height = value;\n }\n return this;\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 = '') {\n this.left(offset);\n this._xPosition = 'center';\n return this;\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 = '') {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }\n /**\n * Apply the position to the element.\n * @docs-private\n */\n apply() {\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 const styles = this._overlayRef.overlayElement.style;\n const parentStyles = this._overlayRef.hostElement.style;\n const config = this._overlayRef.getConfig();\n const {\n width,\n height,\n maxWidth,\n maxHeight\n } = config;\n const shouldBeFlushHorizontally = (width === '100%' || width === '100vw') && (!maxWidth || maxWidth === '100%' || maxWidth === '100vw');\n const shouldBeFlushVertically = (height === '100%' || height === '100vh') && (!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 if (shouldBeFlushHorizontally) {\n justifyContent = 'flex-start';\n } else if (xPosition === 'center') {\n justifyContent = 'center';\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 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 * Cleans up the DOM changes from the position strategy.\n * @docs-private\n */\n dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop = styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n this._overlayRef = null;\n this._isDisposed = true;\n }\n}\n\n/** Builder for overlay position strategy. */\nlet OverlayPositionBuilder = /*#__PURE__*/(() => {\n class OverlayPositionBuilder {\n constructor(_viewportRuler, _document, _platform, _overlayContainer) {\n this._viewportRuler = _viewportRuler;\n this._document = _document;\n this._platform = _platform;\n this._overlayContainer = _overlayContainer;\n }\n /**\n * Creates a global position strategy.\n */\n global() {\n return new GlobalPositionStrategy();\n }\n /**\n * Creates a flexible position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\n flexibleConnectedTo(origin) {\n return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);\n }\n static {\n this.ɵfac = function OverlayPositionBuilder_Factory(t) {\n return new (t || OverlayPositionBuilder)(i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i1$1.Platform), i0.ɵɵinject(OverlayContainer));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: OverlayPositionBuilder,\n factory: OverlayPositionBuilder.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return OverlayPositionBuilder;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Next overlay unique ID. */\nlet nextUniqueId = 0;\n// Note that Overlay is *not* scoped to the app root because of the ComponentFactoryResolver\n// which needs to be different depending on where OverlayModule is imported.\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 */\nlet Overlay = /*#__PURE__*/(() => {\n class Overlay {\n constructor( /** Scrolling strategies that can be used when creating an overlay. */\n scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher, _animationsModuleType) {\n this.scrollStrategies = scrollStrategies;\n this._overlayContainer = _overlayContainer;\n this._componentFactoryResolver = _componentFactoryResolver;\n this._positionBuilder = _positionBuilder;\n this._keyboardDispatcher = _keyboardDispatcher;\n this._injector = _injector;\n this._ngZone = _ngZone;\n this._document = _document;\n this._directionality = _directionality;\n this._location = _location;\n this._outsideClickDispatcher = _outsideClickDispatcher;\n this._animationsModuleType = _animationsModuleType;\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) {\n const host = this._createHostElement();\n const pane = this._createPaneElement(host);\n const portalOutlet = this._createPortalOutlet(pane);\n const overlayConfig = new OverlayConfig(config);\n overlayConfig.direction = overlayConfig.direction || this._directionality.value;\n return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations');\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() {\n return this._positionBuilder;\n }\n /**\n * Creates the DOM element for an overlay and appends it to the overlay container.\n * @returns Newly-created pane element\n */\n _createPaneElement(host) {\n const pane = this._document.createElement('div');\n pane.id = `cdk-overlay-${nextUniqueId++}`;\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n return pane;\n }\n /**\n * Creates the host element that wraps around an overlay\n * and can be used for advanced positioning.\n * @returns Newly-create host element.\n */\n _createHostElement() {\n const host = this._document.createElement('div');\n this._overlayContainer.getContainerElement().appendChild(host);\n return host;\n }\n /**\n * Create a DomPortalOutlet into which the overlay content can be loaded.\n * @param pane The DOM element to turn into a portal outlet.\n * @returns A portal outlet for the given DOM element.\n */\n _createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(ApplicationRef);\n }\n return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }\n static {\n this.ɵfac = function Overlay_Factory(t) {\n return new (t || Overlay)(i0.ɵɵinject(ScrollStrategyOptions), i0.ɵɵinject(OverlayContainer), i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(OverlayPositionBuilder), i0.ɵɵinject(OverlayKeyboardDispatcher), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i5.Directionality), i0.ɵɵinject(i6.Location), i0.ɵɵinject(OverlayOutsideClickDispatcher), i0.ɵɵinject(ANIMATION_MODULE_TYPE, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: Overlay,\n factory: Overlay.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return Overlay;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/** Default set of positions for the overlay. Follows the behavior of a dropdown. */\nconst defaultPositionList = [{\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top'\n}, {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom'\n}, {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom'\n}, {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top'\n}];\n/** Injection token that determines the scroll handling while the connected overlay is open. */\nconst CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = /*#__PURE__*/new InjectionToken('cdk-connected-overlay-scroll-strategy');\n/**\n * Directive applied to an element to make it usable as an origin for an Overlay using a\n * ConnectedPositionStrategy.\n */\nlet CdkOverlayOrigin = /*#__PURE__*/(() => {\n class CdkOverlayOrigin {\n constructor( /** Reference to the element on which the directive is applied. */\n elementRef) {\n this.elementRef = elementRef;\n }\n static {\n this.ɵfac = function CdkOverlayOrigin_Factory(t) {\n return new (t || CdkOverlayOrigin)(i0.ɵɵdirectiveInject(i0.ElementRef));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkOverlayOrigin,\n selectors: [[\"\", \"cdk-overlay-origin\", \"\"], [\"\", \"overlay-origin\", \"\"], [\"\", \"cdkOverlayOrigin\", \"\"]],\n exportAs: [\"cdkOverlayOrigin\"],\n standalone: true\n });\n }\n }\n return CdkOverlayOrigin;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Directive to facilitate declarative creation of an\n * Overlay using a FlexibleConnectedPositionStrategy.\n */\nlet CdkConnectedOverlay = /*#__PURE__*/(() => {\n class CdkConnectedOverlay {\n /** The offset in pixels for the overlay connection point on the x-axis */\n get offsetX() {\n return this._offsetX;\n }\n set offsetX(offsetX) {\n this._offsetX = offsetX;\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n /** The offset in pixels for the overlay connection point on the y-axis */\n get offsetY() {\n return this._offsetY;\n }\n set offsetY(offsetY) {\n this._offsetY = offsetY;\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n /** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */\n get disposeOnNavigation() {\n return this._disposeOnNavigation;\n }\n set disposeOnNavigation(value) {\n this._disposeOnNavigation = value;\n }\n // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.\n constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {\n this._overlay = _overlay;\n this._dir = _dir;\n this._backdropSubscription = Subscription.EMPTY;\n this._attachSubscription = Subscription.EMPTY;\n this._detachSubscription = Subscription.EMPTY;\n this._positionSubscription = Subscription.EMPTY;\n this._disposeOnNavigation = false;\n /** Margin between the overlay and the viewport edges. */\n this.viewportMargin = 0;\n /** Whether the overlay is open. */\n this.open = false;\n /** Whether the overlay can be closed by user interaction. */\n this.disableClose = false;\n /** Whether or not the overlay should attach a backdrop. */\n this.hasBackdrop = false;\n /** Whether or not the overlay should be locked when scrolling. */\n this.lockPosition = false;\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n this.flexibleDimensions = false;\n /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */\n this.growAfterOpen = false;\n /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */\n this.push = false;\n /** Event emitted when the backdrop is clicked. */\n this.backdropClick = new EventEmitter();\n /** Event emitted when the position has changed. */\n this.positionChange = new EventEmitter();\n /** Event emitted when the overlay has been attached. */\n this.attach = new EventEmitter();\n /** Event emitted when the overlay has been detached. */\n this.detach = new EventEmitter();\n /** Emits when there are keyboard events that are targeted at the overlay. */\n this.overlayKeydown = new EventEmitter();\n /** Emits when there are mouse outside click events that are targeted at the overlay. */\n this.overlayOutsideClick = new EventEmitter();\n this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);\n this._scrollStrategyFactory = scrollStrategyFactory;\n this.scrollStrategy = this._scrollStrategyFactory();\n }\n /** The associated overlay reference. */\n get overlayRef() {\n return this._overlayRef;\n }\n /** The element's layout direction. */\n get dir() {\n return this._dir ? this._dir.value : 'ltr';\n }\n ngOnDestroy() {\n this._attachSubscription.unsubscribe();\n this._detachSubscription.unsubscribe();\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n if (this._overlayRef) {\n this._overlayRef.dispose();\n }\n }\n ngOnChanges(changes) {\n if (this._position) {\n this._updatePositionStrategy(this._position);\n this._overlayRef.updateSize({\n width: this.width,\n minWidth: this.minWidth,\n height: this.height,\n minHeight: this.minHeight\n });\n if (changes['origin'] && this.open) {\n this._position.apply();\n }\n }\n if (changes['open']) {\n this.open ? this._attachOverlay() : this._detachOverlay();\n }\n }\n /** Creates an overlay */\n _createOverlay() {\n if (!this.positions || !this.positions.length) {\n this.positions = defaultPositionList;\n }\n const overlayRef = this._overlayRef = this._overlay.create(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 => {\n this.overlayKeydown.next(event);\n if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {\n event.preventDefault();\n this._detachOverlay();\n }\n });\n this._overlayRef.outsidePointerEvents().subscribe(event => {\n this.overlayOutsideClick.next(event);\n });\n }\n /** Builds the overlay config based on the directive's inputs */\n _buildConfig() {\n const positionStrategy = this._position = this.positionStrategy || this._createPositionStrategy();\n const overlayConfig = new OverlayConfig({\n direction: this._dir,\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n hasBackdrop: this.hasBackdrop,\n disposeOnNavigation: this.disposeOnNavigation\n });\n if (this.width || this.width === 0) {\n overlayConfig.width = this.width;\n }\n if (this.height || this.height === 0) {\n overlayConfig.height = this.height;\n }\n if (this.minWidth || this.minWidth === 0) {\n overlayConfig.minWidth = this.minWidth;\n }\n if (this.minHeight || this.minHeight === 0) {\n overlayConfig.minHeight = this.minHeight;\n }\n if (this.backdropClass) {\n overlayConfig.backdropClass = this.backdropClass;\n }\n if (this.panelClass) {\n overlayConfig.panelClass = this.panelClass;\n }\n return overlayConfig;\n }\n /** Updates the state of a position strategy, based on the values of the directive inputs. */\n _updatePositionStrategy(positionStrategy) {\n const positions = 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 return positionStrategy.setOrigin(this._getFlexibleConnectedPositionStrategyOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector);\n }\n /** Returns the position strategy of the overlay to be set on the overlay config */\n _createPositionStrategy() {\n const strategy = this._overlay.position().flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());\n this._updatePositionStrategy(strategy);\n return strategy;\n }\n _getFlexibleConnectedPositionStrategyOrigin() {\n if (this.origin instanceof CdkOverlayOrigin) {\n return this.origin.elementRef;\n } else {\n return this.origin;\n }\n }\n /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */\n _attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n } else {\n // Update the overlay size, in case the directive's inputs have changed\n this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;\n }\n if (!this._overlayRef.hasAttached()) {\n this._overlayRef.attach(this._templatePortal);\n }\n if (this.hasBackdrop) {\n this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {\n this.backdropClick.emit(event);\n });\n } else {\n this._backdropSubscription.unsubscribe();\n }\n this._positionSubscription.unsubscribe();\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(takeWhile(() => this.positionChange.observers.length > 0)).subscribe(position => {\n this.positionChange.emit(position);\n if (this.positionChange.observers.length === 0) {\n this._positionSubscription.unsubscribe();\n }\n });\n }\n }\n /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */\n _detachOverlay() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n }\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n }\n static {\n this.ɵfac = function CdkConnectedOverlay_Factory(t) {\n return new (t || CdkConnectedOverlay)(i0.ɵɵdirectiveInject(Overlay), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY), i0.ɵɵdirectiveInject(i5.Directionality, 8));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CdkConnectedOverlay,\n selectors: [[\"\", \"cdk-connected-overlay\", \"\"], [\"\", \"connected-overlay\", \"\"], [\"\", \"cdkConnectedOverlay\", \"\"]],\n inputs: {\n origin: [\"cdkConnectedOverlayOrigin\", \"origin\"],\n positions: [\"cdkConnectedOverlayPositions\", \"positions\"],\n positionStrategy: [\"cdkConnectedOverlayPositionStrategy\", \"positionStrategy\"],\n offsetX: [\"cdkConnectedOverlayOffsetX\", \"offsetX\"],\n offsetY: [\"cdkConnectedOverlayOffsetY\", \"offsetY\"],\n width: [\"cdkConnectedOverlayWidth\", \"width\"],\n height: [\"cdkConnectedOverlayHeight\", \"height\"],\n minWidth: [\"cdkConnectedOverlayMinWidth\", \"minWidth\"],\n minHeight: [\"cdkConnectedOverlayMinHeight\", \"minHeight\"],\n backdropClass: [\"cdkConnectedOverlayBackdropClass\", \"backdropClass\"],\n panelClass: [\"cdkConnectedOverlayPanelClass\", \"panelClass\"],\n viewportMargin: [\"cdkConnectedOverlayViewportMargin\", \"viewportMargin\"],\n scrollStrategy: [\"cdkConnectedOverlayScrollStrategy\", \"scrollStrategy\"],\n open: [\"cdkConnectedOverlayOpen\", \"open\"],\n disableClose: [\"cdkConnectedOverlayDisableClose\", \"disableClose\"],\n transformOriginSelector: [\"cdkConnectedOverlayTransformOriginOn\", \"transformOriginSelector\"],\n hasBackdrop: [\"cdkConnectedOverlayHasBackdrop\", \"hasBackdrop\", booleanAttribute],\n lockPosition: [\"cdkConnectedOverlayLockPosition\", \"lockPosition\", booleanAttribute],\n flexibleDimensions: [\"cdkConnectedOverlayFlexibleDimensions\", \"flexibleDimensions\", booleanAttribute],\n growAfterOpen: [\"cdkConnectedOverlayGrowAfterOpen\", \"growAfterOpen\", booleanAttribute],\n push: [\"cdkConnectedOverlayPush\", \"push\", booleanAttribute],\n disposeOnNavigation: [\"cdkConnectedOverlayDisposeOnNavigation\", \"disposeOnNavigation\", booleanAttribute]\n },\n outputs: {\n backdropClick: \"backdropClick\",\n positionChange: \"positionChange\",\n attach: \"attach\",\n detach: \"detach\",\n overlayKeydown: \"overlayKeydown\",\n overlayOutsideClick: \"overlayOutsideClick\"\n },\n exportAs: [\"cdkConnectedOverlay\"],\n standalone: true,\n features: [i0.ɵɵInputTransformsFeature, i0.ɵɵNgOnChangesFeature]\n });\n }\n }\n return CdkConnectedOverlay;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/** @docs-private */\nfunction CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {\n return () => overlay.scrollStrategies.reposition();\n}\n/** @docs-private */\nconst CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {\n provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY\n};\nlet OverlayModule = /*#__PURE__*/(() => {\n class OverlayModule {\n static {\n this.ɵfac = function OverlayModule_Factory(t) {\n return new (t || OverlayModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: OverlayModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER],\n imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule]\n });\n }\n }\n return OverlayModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Alternative to OverlayContainer that supports correct displaying of overlay elements in\n * Fullscreen mode\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen\n *\n * Should be provided in the root component.\n */\nlet FullscreenOverlayContainer = /*#__PURE__*/(() => {\n class FullscreenOverlayContainer extends OverlayContainer {\n constructor(_document, platform) {\n super(_document, platform);\n }\n ngOnDestroy() {\n super.ngOnDestroy();\n if (this._fullScreenEventName && this._fullScreenListener) {\n this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);\n }\n }\n _createContainer() {\n super._createContainer();\n this._adjustParentForFullscreenChange();\n this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());\n }\n _adjustParentForFullscreenChange() {\n if (!this._containerElement) {\n return;\n }\n const fullscreenElement = this.getFullscreenElement();\n const parent = fullscreenElement || this._document.body;\n parent.appendChild(this._containerElement);\n }\n _addFullscreenChangeListener(fn) {\n const eventName = this._getEventName();\n if (eventName) {\n if (this._fullScreenListener) {\n this._document.removeEventListener(eventName, this._fullScreenListener);\n }\n this._document.addEventListener(eventName, fn);\n this._fullScreenListener = fn;\n }\n }\n _getEventName() {\n if (!this._fullScreenEventName) {\n const _document = this._document;\n if (_document.fullscreenEnabled) {\n this._fullScreenEventName = 'fullscreenchange';\n } else if (_document.webkitFullscreenEnabled) {\n this._fullScreenEventName = 'webkitfullscreenchange';\n } else if (_document.mozFullScreenEnabled) {\n this._fullScreenEventName = 'mozfullscreenchange';\n } else if (_document.msFullscreenEnabled) {\n this._fullScreenEventName = 'MSFullscreenChange';\n }\n }\n return this._fullScreenEventName;\n }\n /**\n * When the page is put into fullscreen mode, a specific element is specified.\n * Only that element and its children are visible when in fullscreen mode.\n */\n getFullscreenElement() {\n const _document = this._document;\n return _document.fullscreenElement || _document.webkitFullscreenElement || _document.mozFullScreenElement || _document.msFullscreenElement || null;\n }\n static {\n this.ɵfac = function FullscreenOverlayContainer_Factory(t) {\n return new (t || FullscreenOverlayContainer)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i1$1.Platform));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: FullscreenOverlayContainer,\n factory: FullscreenOverlayContainer.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return FullscreenOverlayContainer;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, STANDARD_DROPDOWN_ADJACENT_POSITIONS, STANDARD_DROPDOWN_BELOW_POSITIONS, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition };\n","import * as i0 from '@angular/core';\nimport { Injectable, EventEmitter, Directive, Output, Input, NgModule } from '@angular/core';\nimport { of, fromEvent } from 'rxjs';\nimport { mergeMap, map, tap, filter, throttleTime } from 'rxjs/operators';\nlet NgxInfiniteScrollService = /*#__PURE__*/(() => {\n class NgxInfiniteScrollService {\n constructor() {}\n static {\n this.ɵfac = function NgxInfiniteScrollService_Factory(t) {\n return new (t || NgxInfiniteScrollService)();\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NgxInfiniteScrollService,\n factory: NgxInfiniteScrollService.ɵfac,\n providedIn: 'root'\n });\n }\n }\n return NgxInfiniteScrollService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction resolveContainerElement(selector, scrollWindow, defaultElement, fromRoot) {\n const hasWindow = window && !!window.document && window.document.documentElement;\n let container = hasWindow && scrollWindow ? window : defaultElement;\n if (selector) {\n const containerIsString = selector && hasWindow && typeof selector === 'string';\n container = containerIsString ? findElement(selector, defaultElement.nativeElement, fromRoot) : selector;\n if (!container) {\n throw new Error('ngx-infinite-scroll {resolveContainerElement()}: selector for');\n }\n }\n return container;\n}\nfunction findElement(selector, customRoot, fromRoot) {\n const rootEl = fromRoot ? window.document : customRoot;\n return rootEl.querySelector(selector);\n}\nfunction inputPropChanged(prop) {\n return prop && !prop.firstChange;\n}\nfunction hasWindowDefined() {\n return typeof window !== 'undefined';\n}\nconst VerticalProps = {\n clientHeight: \"clientHeight\",\n offsetHeight: \"offsetHeight\",\n scrollHeight: \"scrollHeight\",\n pageYOffset: \"pageYOffset\",\n offsetTop: \"offsetTop\",\n scrollTop: \"scrollTop\",\n top: \"top\"\n};\nconst HorizontalProps = {\n clientHeight: \"clientWidth\",\n offsetHeight: \"offsetWidth\",\n scrollHeight: \"scrollWidth\",\n pageYOffset: \"pageXOffset\",\n offsetTop: \"offsetLeft\",\n scrollTop: \"scrollLeft\",\n top: \"left\"\n};\nclass AxisResolver {\n constructor(vertical = true) {\n this.vertical = vertical;\n this.propsMap = vertical ? VerticalProps : HorizontalProps;\n }\n clientHeightKey() {\n return this.propsMap.clientHeight;\n }\n offsetHeightKey() {\n return this.propsMap.offsetHeight;\n }\n scrollHeightKey() {\n return this.propsMap.scrollHeight;\n }\n pageYOffsetKey() {\n return this.propsMap.pageYOffset;\n }\n offsetTopKey() {\n return this.propsMap.offsetTop;\n }\n scrollTopKey() {\n return this.propsMap.scrollTop;\n }\n topKey() {\n return this.propsMap.top;\n }\n}\nfunction shouldTriggerEvents(alwaysCallback, shouldFireScrollEvent, isTriggeredCurrentTotal) {\n if (alwaysCallback && shouldFireScrollEvent) {\n return true;\n }\n if (!isTriggeredCurrentTotal && shouldFireScrollEvent) {\n return true;\n }\n return false;\n}\nfunction createResolver({\n windowElement,\n axis\n}) {\n return createResolverWithContainer({\n axis,\n isWindow: isElementWindow(windowElement)\n }, windowElement);\n}\nfunction createResolverWithContainer(resolver, windowElement) {\n const container = resolver.isWindow || windowElement && !windowElement.nativeElement ? windowElement : windowElement.nativeElement;\n return {\n ...resolver,\n container\n };\n}\nfunction isElementWindow(windowElement) {\n const isWindow = ['Window', 'global'].some(obj => Object.prototype.toString.call(windowElement).includes(obj));\n return isWindow;\n}\nfunction getDocumentElement(isContainerWindow, windowElement) {\n return isContainerWindow ? windowElement.document.documentElement : null;\n}\nfunction calculatePoints(element, resolver) {\n const height = extractHeightForElement(resolver);\n return resolver.isWindow ? calculatePointsForWindow(height, element, resolver) : calculatePointsForElement(height, element, resolver);\n}\nfunction calculatePointsForWindow(height, element, resolver) {\n const {\n axis,\n container,\n isWindow\n } = resolver;\n const {\n offsetHeightKey,\n clientHeightKey\n } = extractHeightPropKeys(axis);\n // scrolled until now / current y point\n const scrolled = height + getElementPageYOffset(getDocumentElement(isWindow, container), axis, isWindow);\n // total height / most bottom y point\n const nativeElementHeight = getElementHeight(element.nativeElement, isWindow, offsetHeightKey, clientHeightKey);\n const totalToScroll = getElementOffsetTop(element.nativeElement, axis, isWindow) + nativeElementHeight;\n return {\n height,\n scrolled,\n totalToScroll,\n isWindow\n };\n}\nfunction calculatePointsForElement(height, element, resolver) {\n const {\n axis,\n container\n } = resolver;\n // perhaps use container.offsetTop instead of 'scrollTop'\n const scrolled = container[axis.scrollTopKey()];\n const totalToScroll = container[axis.scrollHeightKey()];\n return {\n height,\n scrolled,\n totalToScroll,\n isWindow: false\n };\n}\nfunction extractHeightPropKeys(axis) {\n return {\n offsetHeightKey: axis.offsetHeightKey(),\n clientHeightKey: axis.clientHeightKey()\n };\n}\nfunction extractHeightForElement({\n container,\n isWindow,\n axis\n}) {\n const {\n offsetHeightKey,\n clientHeightKey\n } = extractHeightPropKeys(axis);\n return getElementHeight(container, isWindow, offsetHeightKey, clientHeightKey);\n}\nfunction getElementHeight(elem, isWindow, offsetHeightKey, clientHeightKey) {\n if (isNaN(elem[offsetHeightKey])) {\n const docElem = getDocumentElement(isWindow, elem);\n return docElem ? docElem[clientHeightKey] : 0;\n } else {\n return elem[offsetHeightKey];\n }\n}\nfunction getElementOffsetTop(elem, axis, isWindow) {\n const topKey = axis.topKey();\n // elem = elem.nativeElement;\n if (!elem.getBoundingClientRect) {\n // || elem.css('none')) {\n return;\n }\n return elem.getBoundingClientRect()[topKey] + getElementPageYOffset(elem, axis, isWindow);\n}\nfunction getElementPageYOffset(elem, axis, isWindow) {\n const pageYOffset = axis.pageYOffsetKey();\n const scrollTop = axis.scrollTopKey();\n const offsetTop = axis.offsetTopKey();\n if (isNaN(window.pageYOffset)) {\n return getDocumentElement(isWindow, elem)[scrollTop];\n } else if (elem.ownerDocument) {\n return elem.ownerDocument.defaultView[pageYOffset];\n } else {\n return elem[offsetTop];\n }\n}\nfunction shouldFireScrollEvent(container, distance = {\n down: 0,\n up: 0\n}, scrollingDown) {\n let remaining;\n let containerBreakpoint;\n if (container.totalToScroll <= 0) {\n return false;\n }\n const scrolledUntilNow = container.isWindow ? container.scrolled : container.height + container.scrolled;\n if (scrollingDown) {\n remaining = (container.totalToScroll - scrolledUntilNow) / container.totalToScroll;\n const distanceDown = distance?.down ? distance.down : 0;\n containerBreakpoint = distanceDown / 10;\n } else {\n const totalHiddenContentHeight = container.scrolled + (container.totalToScroll - scrolledUntilNow);\n remaining = container.scrolled / totalHiddenContentHeight;\n const distanceUp = distance?.up ? distance.up : 0;\n containerBreakpoint = distanceUp / 10;\n }\n const shouldFireEvent = remaining <= containerBreakpoint;\n return shouldFireEvent;\n}\nfunction isScrollingDownwards(lastScrollPosition, container) {\n return lastScrollPosition < container.scrolled;\n}\nfunction getScrollStats(lastScrollPosition, container, distance) {\n const scrollDown = isScrollingDownwards(lastScrollPosition, container);\n return {\n fire: shouldFireScrollEvent(container, distance, scrollDown),\n scrollDown\n };\n}\nfunction updateScrollPosition(position, scrollState) {\n return scrollState.lastScrollPosition = position;\n}\nfunction updateTotalToScroll(totalToScroll, scrollState) {\n if (scrollState.lastTotalToScroll !== totalToScroll) {\n scrollState.lastTotalToScroll = scrollState.totalToScroll;\n scrollState.totalToScroll = totalToScroll;\n }\n}\nfunction isSameTotalToScroll(scrollState) {\n return scrollState.totalToScroll === scrollState.lastTotalToScroll;\n}\nfunction updateTriggeredFlag(scroll, scrollState, triggered, isScrollingDown) {\n if (isScrollingDown) {\n scrollState.triggered.down = scroll;\n } else {\n scrollState.triggered.up = scroll;\n }\n}\nfunction isTriggeredScroll(totalToScroll, scrollState, isScrollingDown) {\n return isScrollingDown ? scrollState.triggered.down === totalToScroll : scrollState.triggered.up === totalToScroll;\n}\nfunction updateScrollState(scrollState, scrolledUntilNow, totalToScroll) {\n updateScrollPosition(scrolledUntilNow, scrollState);\n updateTotalToScroll(totalToScroll, scrollState);\n // const isSameTotal = isSameTotalToScroll(scrollState);\n // if (!isSameTotal) {\n // updateTriggeredFlag(scrollState, false, isScrollingDown);\n // }\n}\n\nclass ScrollState {\n constructor({\n totalToScroll\n }) {\n this.lastScrollPosition = 0;\n this.lastTotalToScroll = 0;\n this.totalToScroll = 0;\n this.triggered = {\n down: 0,\n up: 0\n };\n this.totalToScroll = totalToScroll;\n }\n updateScrollPosition(position) {\n return this.lastScrollPosition = position;\n }\n updateTotalToScroll(totalToScroll) {\n if (this.lastTotalToScroll !== totalToScroll) {\n this.lastTotalToScroll = this.totalToScroll;\n this.totalToScroll = totalToScroll;\n }\n }\n updateScroll(scrolledUntilNow, totalToScroll) {\n this.updateScrollPosition(scrolledUntilNow);\n this.updateTotalToScroll(totalToScroll);\n }\n updateTriggeredFlag(scroll, isScrollingDown) {\n if (isScrollingDown) {\n this.triggered.down = scroll;\n } else {\n this.triggered.up = scroll;\n }\n }\n isTriggeredScroll(totalToScroll, isScrollingDown) {\n return isScrollingDown ? this.triggered.down === totalToScroll : this.triggered.up === totalToScroll;\n }\n}\nfunction createScroller(config) {\n const {\n scrollContainer,\n scrollWindow,\n element,\n fromRoot\n } = config;\n const resolver = createResolver({\n axis: new AxisResolver(!config.horizontal),\n windowElement: resolveContainerElement(scrollContainer, scrollWindow, element, fromRoot)\n });\n const scrollState = new ScrollState({\n totalToScroll: calculatePoints(element, resolver)\n });\n const options = {\n container: resolver.container,\n throttle: config.throttle\n };\n const distance = {\n up: config.upDistance,\n down: config.downDistance\n };\n return attachScrollEvent(options).pipe(mergeMap(() => of(calculatePoints(element, resolver))), map(positionStats => toInfiniteScrollParams(scrollState.lastScrollPosition, positionStats, distance)), tap(({\n stats\n }) => scrollState.updateScroll(stats.scrolled, stats.totalToScroll)), filter(({\n fire,\n scrollDown,\n stats: {\n totalToScroll\n }\n }) => shouldTriggerEvents(config.alwaysCallback, fire, scrollState.isTriggeredScroll(totalToScroll, scrollDown))), tap(({\n scrollDown,\n stats: {\n totalToScroll\n }\n }) => {\n scrollState.updateTriggeredFlag(totalToScroll, scrollDown);\n }), map(toInfiniteScrollAction));\n}\nfunction attachScrollEvent(options) {\n let obs = fromEvent(options.container, 'scroll');\n // For an unknown reason calling `sampleTime()` causes trouble for many users, even with `options.throttle = 0`.\n // Let's avoid calling the function unless needed.\n // Replacing with throttleTime seems to solve the problem\n // See https://github.com/orizens/ngx-infinite-scroll/issues/198\n if (options.throttle) {\n obs = obs.pipe(throttleTime(options.throttle, undefined, {\n leading: true,\n trailing: true\n }));\n }\n return obs;\n}\nfunction toInfiniteScrollParams(lastScrollPosition, stats, distance) {\n const {\n scrollDown,\n fire\n } = getScrollStats(lastScrollPosition, stats, distance);\n return {\n scrollDown,\n fire,\n stats\n };\n}\nconst InfiniteScrollActions = {\n DOWN: '[NGX_ISE] DOWN',\n UP: '[NGX_ISE] UP'\n};\nfunction toInfiniteScrollAction(response) {\n const {\n scrollDown,\n stats: {\n scrolled: currentScrollPosition\n }\n } = response;\n return {\n type: scrollDown ? InfiniteScrollActions.DOWN : InfiniteScrollActions.UP,\n payload: {\n currentScrollPosition\n }\n };\n}\nlet InfiniteScrollDirective = /*#__PURE__*/(() => {\n class InfiniteScrollDirective {\n constructor(element, zone) {\n this.element = element;\n this.zone = zone;\n this.scrolled = new EventEmitter();\n this.scrolledUp = new EventEmitter();\n this.infiniteScrollDistance = 2;\n this.infiniteScrollUpDistance = 1.5;\n this.infiniteScrollThrottle = 150;\n this.infiniteScrollDisabled = false;\n this.infiniteScrollContainer = null;\n this.scrollWindow = true;\n this.immediateCheck = false;\n this.horizontal = false;\n this.alwaysCallback = false;\n this.fromRoot = false;\n }\n ngAfterViewInit() {\n if (!this.infiniteScrollDisabled) {\n this.setup();\n }\n }\n ngOnChanges({\n infiniteScrollContainer,\n infiniteScrollDisabled,\n infiniteScrollDistance\n }) {\n const containerChanged = inputPropChanged(infiniteScrollContainer);\n const disabledChanged = inputPropChanged(infiniteScrollDisabled);\n const distanceChanged = inputPropChanged(infiniteScrollDistance);\n const shouldSetup = !disabledChanged && !this.infiniteScrollDisabled || disabledChanged && !infiniteScrollDisabled.currentValue || distanceChanged;\n if (containerChanged || disabledChanged || distanceChanged) {\n this.destroyScroller();\n if (shouldSetup) {\n this.setup();\n }\n }\n }\n setup() {\n if (hasWindowDefined()) {\n this.zone.runOutsideAngular(() => {\n this.disposeScroller = createScroller({\n fromRoot: this.fromRoot,\n alwaysCallback: this.alwaysCallback,\n disable: this.infiniteScrollDisabled,\n downDistance: this.infiniteScrollDistance,\n element: this.element,\n horizontal: this.horizontal,\n scrollContainer: this.infiniteScrollContainer,\n scrollWindow: this.scrollWindow,\n throttle: this.infiniteScrollThrottle,\n upDistance: this.infiniteScrollUpDistance\n }).subscribe(payload => this.handleOnScroll(payload));\n });\n }\n }\n handleOnScroll({\n type,\n payload\n }) {\n const emitter = type === InfiniteScrollActions.DOWN ? this.scrolled : this.scrolledUp;\n if (hasObservers(emitter)) {\n this.zone.run(() => emitter.emit(payload));\n }\n }\n ngOnDestroy() {\n this.destroyScroller();\n }\n destroyScroller() {\n if (this.disposeScroller) {\n this.disposeScroller.unsubscribe();\n }\n }\n static {\n this.ɵfac = function InfiniteScrollDirective_Factory(t) {\n return new (t || InfiniteScrollDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.NgZone));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: InfiniteScrollDirective,\n selectors: [[\"\", \"infiniteScroll\", \"\"], [\"\", \"infinite-scroll\", \"\"], [\"\", \"data-infinite-scroll\", \"\"]],\n inputs: {\n infiniteScrollDistance: \"infiniteScrollDistance\",\n infiniteScrollUpDistance: \"infiniteScrollUpDistance\",\n infiniteScrollThrottle: \"infiniteScrollThrottle\",\n infiniteScrollDisabled: \"infiniteScrollDisabled\",\n infiniteScrollContainer: \"infiniteScrollContainer\",\n scrollWindow: \"scrollWindow\",\n immediateCheck: \"immediateCheck\",\n horizontal: \"horizontal\",\n alwaysCallback: \"alwaysCallback\",\n fromRoot: \"fromRoot\"\n },\n outputs: {\n scrolled: \"scrolled\",\n scrolledUp: \"scrolledUp\"\n },\n features: [i0.ɵɵNgOnChangesFeature]\n });\n }\n }\n return InfiniteScrollDirective;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction hasObservers(emitter) {\n // Note: The `observed` property is available only in RxJS@7.2.0, which means it's\n // not available for users running the lower version.\n return emitter.observed ?? emitter.observers.length > 0;\n}\nlet InfiniteScrollModule = /*#__PURE__*/(() => {\n class InfiniteScrollModule {\n static {\n this.ɵfac = function InfiniteScrollModule_Factory(t) {\n return new (t || InfiniteScrollModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: InfiniteScrollModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return InfiniteScrollModule;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/*\n * Public API Surface of ngx-infinite-scroll\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { InfiniteScrollDirective, InfiniteScrollModule, NgxInfiniteScrollService };\n","import * as i4 from '@angular/cdk/overlay';\nimport { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';\nimport * as i0 from '@angular/core';\nimport { EventEmitter, TemplateRef, numberAttribute, booleanAttribute, Component, Optional, Self, Attribute, Input, HostBinding, Output, ViewChild, ViewChildren, HostListener, Directive, NgModule } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport * as i1 from '@angular/cdk/scrolling';\nimport * as i2 from '@angular/forms';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport * as i3 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i5 from 'ngx-infinite-scroll';\nimport { InfiniteScrollModule } from 'ngx-infinite-scroll';\nconst _c0 = [\"selection\"];\nconst _c1 = [\"results\"];\nconst _c2 = [\"searchInput\"];\nconst _c3 = [\"dropdown\"];\nconst _c4 = [\"result\"];\nfunction Select2_span_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 14);\n }\n}\nfunction Select2_span_8_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\");\n i0.ɵɵtext(1, \"\\xA0\");\n i0.ɵɵelementEnd();\n }\n}\nfunction Select2_span_8_ng_container_2_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 19);\n }\n if (rf & 2) {\n const ctx_r13 = i0.ɵɵnextContext(3);\n i0.ɵɵproperty(\"innerHTML\", ctx_r13.select2Option.label, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_span_8_ng_container_2_ng_template_2_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_span_8_ng_container_2_ng_template_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_span_8_ng_container_2_ng_template_2_ng_container_0_Template, 1, 0, \"ng-container\", 20);\n }\n if (rf & 2) {\n const ctx_r14 = i0.ɵɵnextContext(3);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r14.getTemplate(ctx_r14.select2Option, \"option\"))(\"ngTemplateOutletContext\", ctx_r14.select2Option);\n }\n}\nfunction Select2_span_8_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Select2_span_8_ng_container_2_span_1_Template, 1, 1, \"span\", 17)(2, Select2_span_8_ng_container_2_ng_template_2_Template, 1, 2, \"ng-template\", null, 18, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const _r15 = i0.ɵɵreference(3);\n const ctx_r12 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx_r12.hasTemplate(ctx_r12.select2Option, \"option\") || ctx_r12.noLabelTemplate)(\"ngIfElse\", _r15);\n }\n}\nfunction Select2_span_8_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 15);\n i0.ɵɵtemplate(1, Select2_span_8_span_1_Template, 2, 0, \"span\", 10)(2, Select2_span_8_ng_container_2_Template, 4, 2, \"ng-container\", 10);\n i0.ɵɵelementStart(3, \"span\", 16);\n i0.ɵɵtext(4);\n i0.ɵɵelementEnd()();\n }\n if (rf & 2) {\n const ctx_r3 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"title\", (ctx_r3.select2Option == null ? null : ctx_r3.select2Option.label) || \"\");\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx_r3.select2Option);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx_r3.select2Option);\n i0.ɵɵadvance(1);\n i0.ɵɵclassProp(\"select2-selection__placeholder__option\", ctx_r3.option);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(ctx_r3.placeholder);\n }\n}\nfunction Select2_span_9_Template(rf, ctx) {\n if (rf & 1) {\n const _r18 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"span\", 21);\n i0.ɵɵlistener(\"click\", function Select2_span_9_Template_span_click_0_listener($event) {\n i0.ɵɵrestoreView(_r18);\n const ctx_r17 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r17.reset($event));\n });\n i0.ɵɵtext(1, \"\\xD7\");\n i0.ɵɵelementEnd();\n }\n}\nfunction Select2_span_10_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 22);\n }\n}\nfunction Select2_ul_11_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 16);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r19 = i0.ɵɵnextContext(2);\n i0.ɵɵclassProp(\"select2-selection__placeholder__option\", (ctx_r19.select2Options == null ? null : ctx_r19.select2Options.length) > 0);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(ctx_r19.placeholder);\n }\n}\nfunction Select2_ul_11_li_2_span_1_Template(rf, ctx) {\n if (rf & 1) {\n const _r29 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"span\", 30);\n i0.ɵɵlistener(\"click\", function Select2_ul_11_li_2_span_1_Template_span_click_0_listener($event) {\n i0.ɵɵrestoreView(_r29);\n const op_r22 = i0.ɵɵnextContext().$implicit;\n const ctx_r27 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r27.removeSelection($event, op_r22));\n });\n i0.ɵɵtext(1, \"\\xD7\");\n i0.ɵɵelementEnd();\n }\n}\nfunction Select2_ul_11_li_2_span_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 19);\n }\n if (rf & 2) {\n const op_r22 = i0.ɵɵnextContext().$implicit;\n i0.ɵɵproperty(\"innerHTML\", op_r22.label, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_ul_11_li_2_ng_template_3_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ul_11_li_2_ng_template_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_ul_11_li_2_ng_template_3_ng_container_0_Template, 1, 0, \"ng-container\", 20);\n }\n if (rf & 2) {\n const op_r22 = i0.ɵɵnextContext().$implicit;\n const ctx_r25 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r25.getTemplate(op_r22, \"option\"))(\"ngTemplateOutletContext\", op_r22);\n }\n}\nfunction Select2_ul_11_li_2_Template(rf, ctx) {\n if (rf & 1) {\n const _r34 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 27);\n i0.ɵɵlistener(\"keydown.enter\", function Select2_ul_11_li_2_Template_li_keydown_enter_0_listener($event) {\n const restoredCtx = i0.ɵɵrestoreView(_r34);\n const op_r22 = restoredCtx.$implicit;\n const ctx_r33 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r33.removeSelection($event, op_r22));\n });\n i0.ɵɵtemplate(1, Select2_ul_11_li_2_span_1_Template, 2, 0, \"span\", 28)(2, Select2_ul_11_li_2_span_2_Template, 1, 1, \"span\", 17)(3, Select2_ul_11_li_2_ng_template_3_Template, 1, 2, \"ng-template\", null, 29, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const op_r22 = ctx.$implicit;\n const _r26 = i0.ɵɵreference(4);\n const ctx_r20 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"title\", op_r22.label);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !(ctx_r20.disabled || ctx_r20.readonly));\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx_r20.hasTemplate(op_r22, \"option\") || ctx_r20.noLabelTemplate)(\"ngIfElse\", _r26);\n }\n}\nfunction Select2_ul_11_li_3_Template(rf, ctx) {\n if (rf & 1) {\n const _r36 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 31);\n i0.ɵɵlistener(\"focus\", function Select2_ul_11_li_3_Template_li_focus_0_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r35 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r35.stopEvent($event));\n })(\"blur\", function Select2_ul_11_li_3_Template_li_blur_0_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r37 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r37.stopEvent($event));\n });\n i0.ɵɵelementStart(1, \"input\", 32);\n i0.ɵɵlistener(\"click\", function Select2_ul_11_li_3_Template_input_click_1_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r38 = i0.ɵɵnextContext(2);\n ctx_r38.toggleOpenAndClose(false, true);\n return i0.ɵɵresetView(ctx_r38.stopEvent($event));\n })(\"keydown\", function Select2_ul_11_li_3_Template_input_keydown_1_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r39 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r39.keyDown($event, true));\n })(\"keyup\", function Select2_ul_11_li_3_Template_input_keyup_1_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r40 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r40.searchUpdate($event));\n })(\"change\", function Select2_ul_11_li_3_Template_input_change_1_listener($event) {\n i0.ɵɵrestoreView(_r36);\n const ctx_r41 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r41.prevChange($event));\n });\n i0.ɵɵelementEnd()();\n }\n if (rf & 2) {\n const ctx_r21 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"id\", ctx_r21.id + \"-create-field\");\n }\n}\nfunction Select2_ul_11_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"ul\", 23);\n i0.ɵɵtemplate(1, Select2_ul_11_span_1_Template, 2, 3, \"span\", 24)(2, Select2_ul_11_li_2_Template, 5, 4, \"li\", 25)(3, Select2_ul_11_li_3_Template, 2, 1, \"li\", 26);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r6 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx_r6.autoCreate);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngForOf\", ctx_r6.option)(\"ngForTrackBy\", ctx_r6.trackBy);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx_r6.autoCreate);\n }\n}\nfunction Select2_ng_container_12_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ng_container_12_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Select2_ng_container_12_ng_container_1_Template, 1, 0, \"ng-container\", 33);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n i0.ɵɵnextContext();\n const _r10 = i0.ɵɵreference(17);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngTemplateOutlet\", _r10);\n }\n}\nfunction Select2_ng_template_15_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ng_template_15_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_ng_template_15_ng_container_0_Template, 1, 0, \"ng-container\", 33);\n }\n if (rf & 2) {\n i0.ɵɵnextContext();\n const _r10 = i0.ɵɵreference(17);\n i0.ɵɵproperty(\"ngTemplateOutlet\", _r10);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_strong_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"strong\", 19);\n }\n if (rf & 2) {\n const groupOrOption_r50 = i0.ɵɵnextContext(2).$implicit;\n i0.ɵɵproperty(\"innerHTML\", groupOrOption_r50.label, i0.ɵɵsanitizeHtml);\n i0.ɵɵattribute(\"class\", \"select2-results__group\" + (groupOrOption_r50.classes ? \" \" + groupOrOption_r50.classes : \"\"));\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_ng_template_2_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_ng_template_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_ng_template_16_ng_container_9_li_1_ng_template_2_ng_container_0_Template, 1, 0, \"ng-container\", 20);\n }\n if (rf & 2) {\n const groupOrOption_r50 = i0.ɵɵnextContext(2).$implicit;\n const ctx_r55 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r55.getTemplate(groupOrOption_r50, \"group\"))(\"ngTemplateOutletContext\", groupOrOption_r50);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_li_5_div_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"div\", 56);\n }\n if (rf & 2) {\n const option_r61 = i0.ɵɵnextContext().$implicit;\n i0.ɵɵproperty(\"innerHTML\", option_r61.label, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_ng_container_0_Template, 1, 0, \"ng-container\", 20);\n }\n if (rf & 2) {\n const option_r61 = i0.ɵɵnextContext().$implicit;\n const ctx_r65 = i0.ɵɵnextContext(4);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r65.getTemplate(option_r61, \"option\"))(\"ngTemplateOutletContext\", option_r61);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_li_5_Template(rf, ctx) {\n if (rf & 1) {\n const _r71 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 52, 53);\n i0.ɵɵlistener(\"mouseenter\", function Select2_ng_template_16_ng_container_9_li_1_li_5_Template_li_mouseenter_0_listener() {\n const restoredCtx = i0.ɵɵrestoreView(_r71);\n const option_r61 = restoredCtx.$implicit;\n const ctx_r70 = i0.ɵɵnextContext(4);\n return i0.ɵɵresetView(ctx_r70.mouseenter(option_r61));\n })(\"click\", function Select2_ng_template_16_ng_container_9_li_1_li_5_Template_li_click_0_listener() {\n const restoredCtx = i0.ɵɵrestoreView(_r71);\n const option_r61 = restoredCtx.$implicit;\n const ctx_r72 = i0.ɵɵnextContext(4);\n return i0.ɵɵresetView(ctx_r72.click(option_r61));\n });\n i0.ɵɵtemplate(2, Select2_ng_template_16_ng_container_9_li_1_li_5_div_2_Template, 1, 1, \"div\", 54)(3, Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_Template, 1, 2, \"ng-template\", null, 55, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const option_r61 = ctx.$implicit;\n const j_r62 = ctx.index;\n const _r66 = i0.ɵɵreference(4);\n const i_r51 = i0.ɵɵnextContext(2).index;\n const ctx_r57 = i0.ɵɵnextContext(2);\n i0.ɵɵclassMap(ctx_r57.getOptionStyle(option_r61));\n i0.ɵɵproperty(\"id\", option_r61.id || ctx_r57.id + \"-option-\" + i_r51 + \"-\" + j_r62);\n i0.ɵɵattribute(\"aria-selected\", ctx_r57.isSelected(option_r61))(\"aria-disabled\", ctx_r57.isDisabled(option_r61));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", !ctx_r57.hasTemplate(option_r61, \"option\"))(\"ngIfElse\", _r66);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"li\", 48);\n i0.ɵɵtemplate(1, Select2_ng_template_16_ng_container_9_li_1_strong_1_Template, 1, 2, \"strong\", 17)(2, Select2_ng_template_16_ng_container_9_li_1_ng_template_2_Template, 1, 2, \"ng-template\", null, 49, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementStart(4, \"ul\", 50);\n i0.ɵɵtemplate(5, Select2_ng_template_16_ng_container_9_li_1_li_5_Template, 5, 7, \"li\", 51);\n i0.ɵɵelementEnd()();\n }\n if (rf & 2) {\n const _r56 = i0.ɵɵreference(3);\n const groupOrOption_r50 = i0.ɵɵnextContext().$implicit;\n const ctx_r52 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx_r52.hasTemplate(groupOrOption_r50, \"group\"))(\"ngIfElse\", _r56);\n i0.ɵɵadvance(4);\n i0.ɵɵproperty(\"ngForOf\", groupOrOption_r50.options)(\"ngForTrackBy\", ctx_r52.trackBy);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_2_div_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"div\", 56);\n }\n if (rf & 2) {\n const groupOrOption_r50 = i0.ɵɵnextContext(2).$implicit;\n i0.ɵɵproperty(\"innerHTML\", groupOrOption_r50.label, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_2_ng_template_3_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_2_ng_template_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Select2_ng_template_16_ng_container_9_li_2_ng_template_3_ng_container_0_Template, 1, 0, \"ng-container\", 20);\n }\n if (rf & 2) {\n const groupOrOption_r50 = i0.ɵɵnextContext(2).$implicit;\n const ctx_r77 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r77.getTemplate(groupOrOption_r50, \"option\"))(\"ngTemplateOutletContext\", groupOrOption_r50);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_li_2_Template(rf, ctx) {\n if (rf & 1) {\n const _r84 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 52, 53);\n i0.ɵɵlistener(\"mouseenter\", function Select2_ng_template_16_ng_container_9_li_2_Template_li_mouseenter_0_listener() {\n i0.ɵɵrestoreView(_r84);\n const groupOrOption_r50 = i0.ɵɵnextContext().$implicit;\n const ctx_r82 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r82.mouseenter(groupOrOption_r50));\n })(\"click\", function Select2_ng_template_16_ng_container_9_li_2_Template_li_click_0_listener() {\n i0.ɵɵrestoreView(_r84);\n const groupOrOption_r50 = i0.ɵɵnextContext().$implicit;\n const ctx_r85 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r85.click(groupOrOption_r50));\n });\n i0.ɵɵtemplate(2, Select2_ng_template_16_ng_container_9_li_2_div_2_Template, 1, 1, \"div\", 54)(3, Select2_ng_template_16_ng_container_9_li_2_ng_template_3_Template, 1, 2, \"ng-template\", null, 57, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const _r78 = i0.ɵɵreference(4);\n const ctx_r87 = i0.ɵɵnextContext();\n const groupOrOption_r50 = ctx_r87.$implicit;\n const i_r51 = ctx_r87.index;\n const ctx_r53 = i0.ɵɵnextContext(2);\n i0.ɵɵclassMap(ctx_r53.getOptionStyle(groupOrOption_r50));\n i0.ɵɵproperty(\"id\", groupOrOption_r50.id || ctx_r53.id + \"-option-\" + i_r51);\n i0.ɵɵattribute(\"aria-selected\", ctx_r53.isSelected(groupOrOption_r50))(\"aria-disabled\", ctx_r53.isDisabled(groupOrOption_r50));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", !ctx_r53.hasTemplate(groupOrOption_r50, \"option\"))(\"ngIfElse\", _r78);\n }\n}\nfunction Select2_ng_template_16_ng_container_9_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Select2_ng_template_16_ng_container_9_li_1_Template, 6, 4, \"li\", 46)(2, Select2_ng_template_16_ng_container_9_li_2_Template, 5, 7, \"li\", 47);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const groupOrOption_r50 = ctx.$implicit;\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", groupOrOption_r50.options);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !groupOrOption_r50.options);\n }\n}\nfunction Select2_ng_template_16_li_10_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"li\", 58);\n }\n if (rf & 2) {\n const ctx_r48 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"innerHTML\", ctx_r48.noResultMessage, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_ng_template_16_li_11_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"li\", 59);\n }\n if (rf & 2) {\n const ctx_r49 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"innerHTML\", ctx_r49.maxResultsMessage, i0.ɵɵsanitizeHtml);\n }\n}\nfunction Select2_ng_template_16_Template(rf, ctx) {\n if (rf & 1) {\n const _r89 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"div\", 34)(1, \"div\", 35, 36)(3, \"div\", 37)(4, \"input\", 38, 39);\n i0.ɵɵlistener(\"keydown\", function Select2_ng_template_16_Template_input_keydown_4_listener($event) {\n i0.ɵɵrestoreView(_r89);\n const ctx_r88 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r88.keyDown($event, ctx_r88.autoCreate));\n })(\"keyup\", function Select2_ng_template_16_Template_input_keyup_4_listener($event) {\n i0.ɵɵrestoreView(_r89);\n const ctx_r90 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r90.searchUpdate($event));\n })(\"change\", function Select2_ng_template_16_Template_input_change_4_listener($event) {\n i0.ɵɵrestoreView(_r89);\n const ctx_r91 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r91.prevChange($event));\n });\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(6, \"div\", 40)(7, \"ul\", 41, 42);\n i0.ɵɵlistener(\"scrolled\", function Select2_ng_template_16_Template_ul_scrolled_7_listener() {\n i0.ɵɵrestoreView(_r89);\n const ctx_r92 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r92.onScroll(\"down\"));\n })(\"scrolledUp\", function Select2_ng_template_16_Template_ul_scrolledUp_7_listener() {\n i0.ɵɵrestoreView(_r89);\n const ctx_r93 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r93.onScroll(\"up\"));\n })(\"keydown\", function Select2_ng_template_16_Template_ul_keydown_7_listener($event) {\n i0.ɵɵrestoreView(_r89);\n const ctx_r94 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r94.keyDown($event));\n });\n i0.ɵɵtemplate(9, Select2_ng_template_16_ng_container_9_Template, 3, 2, \"ng-container\", 43)(10, Select2_ng_template_16_li_10_Template, 1, 1, \"li\", 44)(11, Select2_ng_template_16_li_11_Template, 1, 1, \"li\", 45);\n i0.ɵɵelementEnd()()()();\n }\n if (rf & 2) {\n const _r46 = i0.ɵɵreference(8);\n const ctx_r9 = i0.ɵɵnextContext();\n i0.ɵɵclassProp(\"select2-container--open\", ctx_r9.isOpen)(\"select2-overlay\", ctx_r9.overlay)(\"select2-position-auto\", ctx_r9.listPosition === \"auto\");\n i0.ɵɵadvance(1);\n i0.ɵɵclassProp(\"select2-dropdown--below\", !ctx_r9.select2above)(\"select2-dropdown--above\", ctx_r9.select2above);\n i0.ɵɵadvance(2);\n i0.ɵɵclassProp(\"select2-search--hide\", ctx_r9.hideSearch());\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"id\", ctx_r9.id + \"-search-field\")(\"value\", ctx_r9.searchText);\n i0.ɵɵattribute(\"tabindex\", ctx_r9.isOpen ? ctx_r9.tabIndex : \"-1\");\n i0.ɵɵadvance(3);\n i0.ɵɵstyleProp(\"max-height\", ctx_r9.resultMaxHeight);\n i0.ɵɵproperty(\"infiniteScrollDisabled\", !ctx_r9.infiniteScroll && !ctx_r9.isOpen)(\"infiniteScrollDistance\", ctx_r9.infiniteScrollDistance)(\"infiniteScrollThrottle\", ctx_r9.infiniteScrollThrottle)(\"infiniteScrollContainer\", _r46);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngForOf\", ctx_r9.filteredData)(\"ngForTrackBy\", ctx_r9.trackBy);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !(ctx_r9.filteredData == null ? null : ctx_r9.filteredData.length) && ctx_r9.noResultMessage);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx_r9.maxResultsExceeded);\n }\n}\nconst _c5 = [[[\"select2-label\"]], [[\"select2-hint\"]]];\nconst _c6 = [\"select2-label\", \"select2-hint\"];\nconst timeout = 200;\nconst unicodePatterns = [{\n l: 'a',\n s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi\n}, {\n l: 'aa',\n s: /ꜳ/gi\n}, {\n l: 'ae',\n s: /[æǽǣ]/gi\n}, {\n l: 'ao',\n s: /ꜵ/gi\n}, {\n l: 'au',\n s: /ꜷ/gi\n}, {\n l: 'av',\n s: /[ꜹꜻ]/gi\n}, {\n l: 'ay',\n s: /ꜽ/gi\n}, {\n l: 'b',\n s: /[ⓑbḃḅḇƀƃɓ]/gi\n}, {\n l: 'c',\n s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi\n}, {\n l: 'd',\n s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi\n}, {\n l: 'dz',\n s: /[dzdž]/gi\n}, {\n l: 'e',\n s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi\n}, {\n l: 'f',\n s: /[ⓕfḟƒꝼ]/gi\n}, {\n l: 'g',\n s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi\n}, {\n l: 'h',\n s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi\n}, {\n l: 'hv',\n s: /ƕ/gi\n}, {\n l: 'i',\n s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi\n}, {\n l: 'j',\n s: /[ⓙjĵǰɉ]/gi\n}, {\n l: 'k',\n s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi\n}, {\n l: 'l',\n s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi\n}, {\n l: 'lj',\n s: /lj/gi\n}, {\n l: 'm',\n s: /[ⓜmḿṁṃɱɯ]/gi\n}, {\n l: 'n',\n s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi\n}, {\n l: 'nj',\n s: /nj/gi\n}, {\n l: 'o',\n s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi\n}, {\n l: 'oi',\n s: /ƣ/gi\n}, {\n l: 'oe',\n s: /œ/gi\n}, {\n l: 'oo',\n s: /ꝏ/gi\n}, {\n l: 'ou',\n s: /ȣ/gi\n}, {\n l: 'p',\n s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi\n}, {\n l: 'q',\n s: /[ⓠqɋꝗꝙ]/gi\n}, {\n l: 'r',\n s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi\n}, {\n l: 's',\n s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi\n}, {\n l: 't',\n s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi\n}, {\n l: 'tz',\n s: /ꜩ/gi\n}, {\n l: 'u',\n s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi\n}, {\n l: 'v',\n s: /[ⓥvṽṿʋꝟʌ]/gi\n}, {\n l: 'vy',\n s: /ꝡ/gi\n}, {\n l: 'w',\n s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi\n}, {\n l: 'x',\n s: /[ⓧxẋẍ]/gi\n}, {\n l: 'y',\n s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi\n}, {\n l: 'z',\n s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi\n}];\nconst defaultMinCountForSearch = 6;\nconst protectRegexp = new RegExp('[\\\\-\\\\[\\\\]\\\\/\\\\{\\\\}\\\\(\\\\)\\\\*\\\\+\\\\?\\\\.\\\\\\\\\\\\^\\\\$\\\\|]', 'g');\nclass Select2Utils {\n static getOptionByValue(data, value) {\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (option.value === value) {\n return option;\n }\n }\n } else if (groupOrOption.value === value) {\n return groupOrOption;\n }\n }\n }\n return undefined;\n }\n static getOptionsByValue(data, value, multiple) {\n if (multiple) {\n const values = Array.isArray(value) ? value : [];\n const result = [];\n for (const v of values) {\n const option = Select2Utils.getOptionByValue(data, v);\n if (option) {\n result.push(option);\n }\n }\n return result;\n }\n return Select2Utils.getOptionByValue(data, value);\n }\n static getFirstAvailableOption(data) {\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (!option.disabled) {\n return option.value;\n }\n }\n } else {\n const option = groupOrOption;\n if (!option.disabled) {\n return option.value;\n }\n }\n }\n }\n return null;\n }\n static valueIsNotInFilteredData(filteredData, value) {\n if (Select2Utils.isNullOrUndefined(value)) {\n return true;\n }\n for (const groupOrOption of filteredData) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (option.value === value) {\n return false;\n }\n }\n } else if (groupOrOption.value === value) {\n return false;\n }\n }\n return true;\n }\n // eslint-disable-next-line\n static getPreviousOption(filteredData, hoveringValue) {\n let findIt = Select2Utils.isNullOrUndefined(hoveringValue);\n for (let i = filteredData.length - 1; i >= 0; i--) {\n const groupOrOption = filteredData[i];\n const options = groupOrOption.options;\n if (options) {\n for (let j = options.length - 1; j >= 0; j--) {\n const option = options[j];\n if (findIt && !option.disabled && !option.hide) {\n return option;\n }\n if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n } else {\n const option = groupOrOption;\n if (findIt && !option.disabled && !option.hide) {\n return option;\n }\n if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line\n static getNextOption(filteredData, hoveringValue) {\n let findIt = Select2Utils.isNullOrUndefined(hoveringValue);\n for (const groupOrOption of filteredData) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (findIt) {\n if (!option.disabled && !option.hide) {\n return option;\n }\n } else if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n } else {\n const option = groupOrOption;\n if (findIt) {\n if (!option.disabled && !option.hide) {\n return option;\n }\n } else if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n return null;\n }\n static getReduceData(data, maxResults = 0) {\n if (maxResults > 0) {\n let counter = 0;\n const result = [];\n // debugger;\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n const group = {\n ...groupOrOption,\n options: []\n };\n result.push(group);\n for (const item of options) {\n group.options.push(item);\n counter++;\n if (counter === maxResults) {\n return {\n result,\n reduce: true\n };\n }\n }\n } else {\n result.push(groupOrOption);\n counter++;\n }\n if (counter === maxResults) {\n return {\n result,\n reduce: true\n };\n }\n }\n return {\n result,\n reduce: false\n };\n } else {\n return {\n result: data,\n reduce: false\n };\n }\n }\n static getFilteredData(data, searchText, editPattern) {\n if (searchText) {\n const result = [];\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n if (options.some(group => Select2Utils.containSearchText(group.label, searchText, editPattern))) {\n const filteredOptions = options.filter(group => Select2Utils.containSearchText(group.label, searchText, editPattern));\n result.push({\n ...groupOrOption,\n options: filteredOptions\n });\n }\n } else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {\n result.push(groupOrOption);\n }\n }\n return result;\n } else {\n return data;\n }\n }\n static getFilteredSelectedData(data, selectedOptions) {\n const result = [];\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n const filteredOptions = options.filter(group => Select2Utils.isSelected(selectedOptions, group, true) === 'false');\n if (filteredOptions.length) {\n result.push({\n ...groupOrOption,\n options: filteredOptions\n });\n }\n } else if (Select2Utils.isSelected(selectedOptions, groupOrOption, true) === 'false') {\n result.push(groupOrOption);\n }\n }\n return result;\n }\n static isSearchboxHiddex(data, minCountForSearch) {\n if (minCountForSearch === '' || minCountForSearch === undefined || minCountForSearch === null || isNaN(+minCountForSearch)) {\n minCountForSearch = defaultMinCountForSearch;\n }\n const optionCount = Select2Utils.getOptionsCount(data);\n return optionCount < +minCountForSearch;\n }\n static isSelected(options, option, multiple) {\n return multiple ? options && options.some(op => op.value === option.value) ? 'true' : 'false' : options && option.value === options.value ? 'true' : 'false';\n }\n static removeSelection(options, option) {\n for (let i = 0; i < options.length; i++) {\n if (options[i].value === option.value) {\n options.splice(i, 1);\n return;\n }\n }\n }\n static getOptionsCount(data) {\n let count = 0;\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n count += options.length;\n } else {\n count++;\n }\n }\n }\n return count;\n }\n static isNullOrUndefined(value) {\n return value === null || value === undefined;\n }\n static containSearchText(label, searchText, editPattern) {\n return searchText ? Select2Utils.formatSansUnicode(label).match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null : true;\n }\n static protectPattern(str) {\n return str.replace(protectRegexp, '\\\\$&');\n }\n static formatSansUnicode(str) {\n for (const unicodePattern of unicodePatterns) {\n str = str.replace(unicodePattern.s, unicodePattern.l);\n }\n return str;\n }\n static formatPattern(str, editPattern) {\n str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));\n if (editPattern && typeof editPattern === 'function') {\n str = editPattern(str);\n }\n return str;\n }\n}\nlet nextUniqueId = 0;\nconst displaySearchStatusList = ['default', 'hidden', 'always'];\nlet Select2 = /*#__PURE__*/(() => {\n class Select2 {\n /** data of options & optiongrps */\n set data(data) {\n this._data = data;\n this.updateFilteredData(true);\n }\n get multiple() {\n return this._multiple;\n }\n set multiple(value) {\n this._multiple = value;\n this.ngOnInit();\n }\n /** minimal data of show the search field */\n get minCountForSearch() {\n return this._minCountForSearch;\n }\n set minCountForSearch(value) {\n this._minCountForSearch = value;\n this.updateSearchBox();\n }\n /** Unique id of the element. */\n get id() {\n return this._id;\n }\n set id(value) {\n this._id = value || this._uid;\n }\n /** Whether selected items should be hidden. */\n get disabled() {\n return this._control ? this._control.disabled : this._disabled;\n }\n set disabled(value) {\n this._disabled = value;\n }\n /** The input element's value. */\n get value() {\n return this._value;\n }\n set value(value) {\n if (this.testValueChange(this._value, value)) {\n setTimeout(() => {\n this._value = value;\n this.writeValue(value);\n }, 10);\n }\n }\n /** Tab index for the select2 element. */\n get tabIndex() {\n return this.disabled ? -1 : this._tabIndex;\n }\n set tabIndex(value) {\n this._tabIndex = value;\n }\n get select2Options() {\n return this.multiple ? this.option : null;\n }\n get select2Option() {\n return this.multiple ? null : this.option;\n }\n get searchText() {\n return this.innerSearchText;\n }\n set searchText(text) {\n this.innerSearchText = text;\n }\n get ariaInvalid() {\n return this._isErrorState();\n }\n get classMaterial() {\n return this.styleMode === 'material';\n }\n get classNostyle() {\n return this.styleMode === 'noStyle';\n }\n get select2above() {\n return !this.overlay ? this.listPosition === 'above' : this._isAbobeOverlay();\n }\n get _positions() {\n return this.listPosition === 'auto' ? undefined : null;\n }\n get resultsElement() {\n return this.resultContainer?.nativeElement;\n }\n constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {\n this._viewportRuler = _viewportRuler;\n this._changeDetectorRef = _changeDetectorRef;\n this._parentForm = _parentForm;\n this._parentFormGroup = _parentFormGroup;\n this._control = _control;\n this.minCharForSearch = 0;\n this.limitSelection = 0;\n this.listPosition = 'below';\n /** use the material style */\n this.overlay = false;\n /** use the material style */\n this.styleMode = 'default';\n /** maximum results limit (0 = no limit) */\n this.maxResults = 0;\n /** message when maximum results */\n this.maxResultsMessage = 'Too many results…';\n /** infinite scroll distance */\n this.infiniteScrollDistance = 1.5;\n /** infinite scroll distance */\n this.infiniteScrollThrottle = 150;\n /** infinite scroll activated */\n this.infiniteScroll = false;\n /** auto create if not exist */\n this.autoCreate = false;\n /** no template for label selection */\n this.noLabelTemplate = false;\n /** the max height of the results container when opening the select */\n this.resultMaxHeight = '200px';\n /** Active Search event */\n this.customSearchEnabled = false;\n /** Whether the element is required. */\n this.required = false;\n /** Whether items are hidden when has. */\n this.hideSelectedItems = false;\n /** Whether the element is readonly. */\n this.readonly = false;\n /** reset with no selected value */\n this.resettable = false;\n this.update = new EventEmitter();\n this.autoCreateItem = new EventEmitter();\n this.open = new EventEmitter();\n this.close = new EventEmitter();\n this.focus = new EventEmitter();\n this.blur = new EventEmitter();\n this.search = new EventEmitter();\n this.scroll = new EventEmitter();\n this.removeOption = new EventEmitter();\n this.option = null;\n this.isOpen = false;\n /** Whether the element is focused or not. */\n this.focused = false;\n this.hoveringValue = null;\n this.innerSearchText = '';\n this._stateChanges = new Subject();\n this._disabled = false;\n this._multiple = false;\n this._uid = `select2-${nextUniqueId++}`;\n /** View -> model callback called when select has been touched */\n this._onTouched = () => {\n // do nothing\n };\n /** View -> model callback called when value changes */\n this._onChange = () => {\n // do nothing\n };\n // eslint-disable-next-line no-self-assign\n this.id = this.id;\n this._tabIndex = parseInt(tabIndex, 10) || 0;\n if (this._control) {\n this._control.valueAccessor = this;\n }\n }\n clickDetection(e) {\n if (this.isOpen && focus) {\n const target = e.target;\n if (!this.ifParentContainsClass(target, 'selection')) {\n if (!this.ifParentContainsClass(target, 'select2-dropdown')) {\n this.toggleOpenAndClose();\n }\n if (!this.ifParentContainsId(target, this._id)) {\n this.clickExit();\n }\n } else if (!this.ifParentContainsId(target, this._id)) {\n this.toggleOpenAndClose();\n this.clickExit();\n }\n }\n }\n ngOnInit() {\n this._viewportRuler.change(100).subscribe(() => {\n if (this.isOpen) {\n this.triggerRect();\n }\n });\n const option = Select2Utils.getOptionsByValue(this._data, this._control ? this._control.value : this.value, this.multiple);\n if (option !== null) {\n this.option = option;\n }\n if (!Array.isArray(option)) {\n this.hoveringValue = this.value;\n }\n this.updateSearchBox();\n }\n ngAfterViewInit() {\n this.cdkConnectedOverlay.positionChange.subscribe(posChange => {\n if (this.listPosition === 'auto' && posChange.connectionPair?.originY && this._overlayPosition !== posChange.connectionPair.originY) {\n this.triggerRect();\n this._overlayPosition = posChange.connectionPair.originY;\n this._changeDetectorRef.detectChanges();\n }\n });\n this.selectionElement = this.selection.nativeElement;\n this.triggerRect();\n }\n ngDoCheck() {\n this.updateSearchBox();\n this._dirtyCheckNativeValue();\n if (this._triggerRect) {\n if (this.overlayWidth !== this._triggerRect.width) {\n this.overlayWidth = this._triggerRect.width;\n }\n if (this._dropdownRect?.height > 0 && this.overlayHeight !== this._dropdownRect.height) {\n this.overlayHeight = this.listPosition === 'auto' ? this._dropdownRect.height : 0;\n }\n }\n }\n updateSearchBox() {\n const hidden = this.customSearchEnabled ? false : Select2Utils.isSearchboxHiddex(this._data, this._minCountForSearch);\n if (this.isSearchboxHidden !== hidden) {\n this.isSearchboxHidden = hidden;\n }\n }\n hideSearch() {\n const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1 ? this.displaySearchStatus : 'default';\n return displaySearchStatus === 'default' && this.isSearchboxHidden || displaySearchStatus === 'hidden';\n }\n getOptionStyle(option) {\n return 'select2-results__option ' + (option.hide ? 'select2-results__option--hide ' : '') + (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') + (option.classes || '');\n }\n mouseenter(option) {\n if (!option.disabled) {\n this.hoveringValue = option.value;\n }\n }\n click(option) {\n if (this.testSelection(option)) {\n this.select(option);\n }\n }\n reset(event) {\n // const test = Select2Utils.getOptionByValue(this._data, this.resetSelectedValue);\n // debugger;\n this.select(this.resetSelectedValue !== undefined ? Select2Utils.getOptionByValue(this._data, this.resetSelectedValue) ?? null : null);\n this.stopEvent(event);\n }\n prevChange(event) {\n event.stopPropagation();\n }\n stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n toggleOpenAndClose(focus = true, open, event) {\n if (this.disabled) {\n return;\n }\n this._focus(focus);\n const changeEmit = this.isOpen !== (open ?? !this.isOpen);\n this.isOpen = open ?? !this.isOpen;\n if (this.isOpen) {\n if (!this.isSearchboxHidden) {\n this.innerSearchText = '';\n this.updateFilteredData();\n this._focusSearchboxOrResultsElement(focus);\n }\n if (this.isSearchboxHidden && !changeEmit && event) {\n this.keyDown(event);\n } else {\n setTimeout(() => {\n if (this.option) {\n const option = Array.isArray(this.option) ? this.option[0] : this.option;\n this.updateScrollFromOption(option);\n } else if (this.resultsElement) {\n this.resultsElement.scrollTop = 0;\n }\n setTimeout(() => {\n this.triggerRect();\n this.cdkConnectedOverlay?.overlayRef?.updatePosition();\n }, 100);\n });\n }\n if (changeEmit) {\n this.open.emit(this);\n }\n } else if (changeEmit) {\n this.close.emit(this);\n }\n this._changeDetectorRef.markForCheck();\n }\n hasTemplate(option, defaut) {\n return this.templates instanceof TemplateRef || this.templates?.[option.templateId] instanceof TemplateRef || this.templates?.[defaut] instanceof TemplateRef;\n }\n getTemplate(option, defaut) {\n return this.hasTemplate(option, defaut) ? this.templates[option.templateId] || this.templates[defaut] || this.templates : undefined;\n }\n triggerRect() {\n this._triggerRect = this.selectionElement.getBoundingClientRect();\n this._dropdownRect = this.dropdown?.nativeElement ? this.dropdown.nativeElement.getBoundingClientRect() : undefined;\n }\n testSelection(option) {\n if (option.disabled) {\n return false;\n }\n return !this.multiple || !this.limitSelection || Array.isArray(this._value) && this._value.length < this.limitSelection;\n }\n testValueChange(value1, value2) {\n if ((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined) || value1 === value2) {\n return false;\n }\n if (this.multiple && value1?.length && value2?.length && value1.length === value2.length) {\n for (const e1 of value1) {\n const test = value2.indexOf(e1) > -1;\n if (!test) {\n return true;\n }\n }\n return false;\n }\n return true;\n }\n updateFilteredData(writeValue = false) {\n setTimeout(() => {\n let result = this._data;\n if (this.multiple && this.hideSelectedItems) {\n result = Select2Utils.getFilteredSelectedData(result, this.option);\n }\n if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {\n result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);\n }\n if (this.maxResults > 0) {\n const data = Select2Utils.getReduceData(result, +this.maxResults);\n result = data.result;\n this.maxResultsExceeded = data.reduce;\n } else {\n this.maxResultsExceeded = false;\n }\n if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {\n this.hoveringValue = Select2Utils.getFirstAvailableOption(result);\n }\n if (writeValue) {\n // refresh current selected value\n this.writeValue(this._control ? this._control.value : this.value);\n }\n this.filteredData = result;\n this._changeDetectorRef.markForCheck();\n });\n }\n clickExit() {\n this._focus(false);\n }\n ifParentContainsClass(element, cssClass) {\n return this.getParentElementByClass(element, cssClass) !== null;\n }\n ifParentContainsId(element, id) {\n return this.getParentElementById(element, id) !== null;\n }\n getParentElementByClass(element, cssClass) {\n return this.containClasses(element, cssClass.trim().split(/\\s+/)) ? element : element.parentElement ? this.getParentElementByClass(element.parentElement, cssClass) : null;\n }\n getParentElementById(element, id) {\n return element.id === id ? element : element.parentElement ? this.getParentElementById(element.parentElement, id) : null;\n }\n containClasses(element, cssClasses) {\n if (!element.classList) {\n return false;\n }\n for (const cssClass of cssClasses) {\n if (!element.classList.contains(cssClass)) {\n return false;\n }\n }\n return true;\n }\n focusin() {\n if (!this.disabled) {\n this._focus(true);\n }\n }\n focusout() {\n if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {\n this._focus(false);\n this._onTouched();\n }\n }\n select(option) {\n let value;\n if (option !== null && option !== undefined) {\n if (this.multiple) {\n const options = this.option;\n const index = options.findIndex(op => op.value === option.value);\n if (index === -1) {\n options.push(option);\n } else {\n options.splice(index, 1);\n }\n value = this.option.map(op => op.value);\n } else {\n this.option = option;\n if (this.isOpen) {\n this.isOpen = false;\n this.close.emit(this);\n this.selectionElement?.focus();\n }\n value = this.option.value;\n }\n } else {\n this.option = null;\n }\n if (this.multiple && this.hideSelectedItems) {\n this.updateFilteredData();\n }\n if (this._control) {\n this._onChange(value);\n } else {\n this._value = value;\n }\n this.update.emit({\n component: this,\n value: value,\n options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null\n });\n }\n keyDown(event, create = false) {\n if (create && this._testKey(event, ['Enter', 13])) {\n this.createAndAdd(event);\n } else if (this._testKey(event, ['ArrowDown', 40])) {\n this.moveDown();\n event.preventDefault();\n } else if (this._testKey(event, ['ArrowUp', 38])) {\n this.moveUp();\n event.preventDefault();\n } else if (this._testKey(event, ['Enter', 13])) {\n this.selectByEnter();\n event.preventDefault();\n } else if (this._testKey(event, ['Escape', 'Tab', 9, 27]) && this.isOpen) {\n this.toggleOpenAndClose();\n this._focus(false);\n }\n }\n openKey(event, create = false) {\n if (create && this._testKey(event, ['Enter', 13])) {\n this.createAndAdd(event);\n } else if (this._testKey(event, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {\n this.toggleOpenAndClose(true, true, event);\n event.preventDefault();\n } else if (this._testKey(event, ['Escape', 'Tab', 9, 27])) {\n if (this.isOpen) {\n this.toggleOpenAndClose(false);\n this._onTouched();\n event.preventDefault();\n } else {\n this._focus(false);\n }\n }\n }\n searchUpdate(e) {\n this.searchText = e.target.value;\n if (!this.customSearchEnabled) {\n this.updateFilteredData();\n } else {\n this.search.emit({\n component: this,\n value: this._value,\n search: this.searchText,\n data: this._data,\n filteredData: data => {\n this.filteredData = data;\n this._changeDetectorRef.markForCheck();\n }\n });\n }\n }\n trackBy(_index, item) {\n return item.value;\n }\n isSelected(option) {\n return Select2Utils.isSelected(this.option, option, this.multiple);\n }\n isDisabled(option) {\n return option.disabled ? 'true' : 'false';\n }\n removeSelection(e, option) {\n Select2Utils.removeSelection(this.option, option);\n if (this.multiple && this.hideSelectedItems) {\n this.updateFilteredData();\n }\n const value = this.option.map(op => op.value);\n if (this._control) {\n this._onChange(value);\n } else {\n this._value = value;\n }\n this.update.emit({\n component: this,\n value: value,\n options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null\n });\n this.removeOption.emit({\n component: this,\n value: value,\n removedOption: option\n });\n e.preventDefault();\n e.stopPropagation();\n if (this.isOpen) {\n this._focusSearchboxOrResultsElement();\n }\n }\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value) {\n this._setSelectionByValue(value);\n }\n /**\n * Saves a callback function to be invoked when the select's value\n * changes from user input. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the value changes.\n */\n registerOnChange(fn) {\n this._onChange = fn;\n }\n /**\n * Saves a callback function to be invoked when the select is blurred\n * by the user. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the component has been touched.\n */\n registerOnTouched(fn) {\n this._onTouched = fn;\n }\n /**\n * Sets whether the component should be disabled.\n * Implemented as part of ControlValueAccessor.\n * @param isDisabled\n */\n setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }\n onScroll(way) {\n this.scroll.emit({\n component: this,\n way,\n search: this.innerSearchText,\n data: this._data\n });\n }\n _isErrorState() {\n const isInvalid = this._control?.invalid;\n const isTouched = this._control?.touched;\n const isSubmitted = this._parentFormGroup?.submitted || this._parentForm?.submitted;\n return !!(isInvalid && (isTouched || isSubmitted));\n }\n addItem(value) {\n let item = Select2Utils.getOptionByValue(this._data, value);\n if (!item) {\n item = {\n value,\n label: value\n };\n this._data.push(item);\n }\n return item;\n }\n createAndAdd(e) {\n const value = e.target.value;\n if (value.trim()) {\n const item = this.addItem(value.trim());\n this.click(item);\n e.target.value = '';\n this.autoCreateItem.emit({\n value: item,\n component: this,\n options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null\n });\n }\n this.stopEvent(e);\n }\n moveUp() {\n this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));\n }\n moveDown() {\n this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));\n }\n updateScrollFromOption(option) {\n if (option) {\n this.hoveringValue = option.value;\n const domElement = this.results.find(r => r.nativeElement.innerText.trim() === option.label);\n if (domElement && this.resultsElement) {\n this.resultsElement.scrollTop = 0;\n const listClientRect = this.resultsElement.getBoundingClientRect();\n const optionClientRect = domElement.nativeElement.getBoundingClientRect();\n this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;\n }\n }\n }\n selectByEnter() {\n if (this.hoveringValue) {\n const option = Select2Utils.getOptionByValue(this._data, this.hoveringValue);\n this.select(option);\n }\n }\n _testKey(event, refs = []) {\n return this._isKey(this._getKey(event), refs);\n }\n _getKey(event) {\n let code;\n if (event.key !== undefined) {\n code = event.key;\n } else if (event['keyIdentifier'] !== undefined) {\n code = event['keyIdentifier'];\n } else if (event['keyCode'] !== undefined) {\n code = event['keyCode'];\n } else {\n event.preventDefault();\n }\n return code;\n }\n _isKey(code, refs = []) {\n return refs && refs.length > 0 ? refs.indexOf(code) !== -1 : false;\n }\n /**\n * Sets the selected option based on a value. If no option can be\n * found with the designated value, the select trigger is cleared.\n */\n _setSelectionByValue(value) {\n if (this.option || value !== undefined && value !== null) {\n const isArray = Array.isArray(value);\n if (this.multiple && value && !isArray) {\n throw new Error('Non array value.');\n } else if (this._data) {\n if (this.multiple) {\n this.option = []; // if value is null, then empty option and return\n if (isArray) {\n // value is not null. Preselect value\n const selectedValues = Select2Utils.getOptionsByValue(this._data, value, this.multiple);\n selectedValues.map(item => this.select(item));\n }\n } else {\n this.select(Select2Utils.getOptionByValue(this._data, value));\n }\n } else if (this._control) {\n this._control.viewToModelUpdate(value);\n }\n this._changeDetectorRef.markForCheck();\n }\n }\n /** Does some manual dirty checking on the native input `value` property. */\n _dirtyCheckNativeValue() {\n const newValue = this.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this._stateChanges.next();\n }\n }\n _focusSearchboxOrResultsElement(focus = true) {\n if (!this.isSearchboxHidden) {\n setTimeout(() => {\n if (this.searchInput && this.searchInput.nativeElement && focus) {\n this.searchInput.nativeElement.focus();\n }\n });\n if (this.resultsElement && focus) {\n this.resultsElement.focus();\n }\n }\n }\n _focus(state) {\n if (!state && this.focused) {\n this.focused = state;\n this.blur.emit(this);\n } else if (state && !this.focused) {\n this.focused = state;\n this.focus.emit(this);\n }\n }\n _isAbobeOverlay() {\n return this.overlay && this._overlayPosition && this.listPosition === 'auto' ? this._overlayPosition === 'top' : this.listPosition === 'above';\n }\n /** @nocollapse */\n static {\n this.ɵfac = function Select2_Factory(t) {\n return new (t || Select2)(i0.ɵɵdirectiveInject(i1.ViewportRuler), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.NgForm, 8), i0.ɵɵdirectiveInject(i2.FormGroupDirective, 8), i0.ɵɵdirectiveInject(i2.NgControl, 10), i0.ɵɵinjectAttribute('tabindex'));\n };\n }\n /** @nocollapse */\n static {\n this.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: Select2,\n selectors: [[\"select2\"]],\n viewQuery: function Select2_Query(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵviewQuery(CdkConnectedOverlay, 5);\n i0.ɵɵviewQuery(_c0, 7);\n i0.ɵɵviewQuery(_c1, 5);\n i0.ɵɵviewQuery(_c2, 5);\n i0.ɵɵviewQuery(_c3, 5);\n i0.ɵɵviewQuery(_c4, 5);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.cdkConnectedOverlay = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.selection = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.resultContainer = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.searchInput = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dropdown = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.results = _t);\n }\n },\n hostVars: 8,\n hostBindings: function Select2_HostBindings(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵlistener(\"click\", function Select2_click_HostBindingHandler($event) {\n return ctx.clickDetection($event);\n }, false, i0.ɵɵresolveDocument);\n }\n if (rf & 2) {\n i0.ɵɵhostProperty(\"id\", ctx.id);\n i0.ɵɵattribute(\"aria-invalid\", ctx.ariaInvalid);\n i0.ɵɵclassProp(\"material\", ctx.classMaterial)(\"nostyle\", ctx.classNostyle)(\"select2-above\", ctx.select2above);\n }\n },\n inputs: {\n data: \"data\",\n minCharForSearch: [\"minCharForSearch\", \"minCharForSearch\", numberAttribute],\n displaySearchStatus: \"displaySearchStatus\",\n placeholder: \"placeholder\",\n limitSelection: [\"limitSelection\", \"limitSelection\", numberAttribute],\n listPosition: \"listPosition\",\n multiple: [\"multiple\", \"multiple\", booleanAttribute],\n overlay: [\"overlay\", \"overlay\", booleanAttribute],\n styleMode: \"styleMode\",\n noResultMessage: \"noResultMessage\",\n maxResults: [\"maxResults\", \"maxResults\", numberAttribute],\n maxResultsMessage: \"maxResultsMessage\",\n infiniteScrollDistance: [\"infiniteScrollDistance\", \"infiniteScrollDistance\", numberAttribute],\n infiniteScrollThrottle: [\"infiniteScrollThrottle\", \"infiniteScrollThrottle\", numberAttribute],\n infiniteScroll: [\"infiniteScroll\", \"infiniteScroll\", booleanAttribute],\n autoCreate: [\"autoCreate\", \"autoCreate\", booleanAttribute],\n noLabelTemplate: [\"noLabelTemplate\", \"noLabelTemplate\", booleanAttribute],\n editPattern: \"editPattern\",\n templates: \"templates\",\n resultMaxHeight: \"resultMaxHeight\",\n customSearchEnabled: [\"customSearchEnabled\", \"customSearchEnabled\", booleanAttribute],\n minCountForSearch: [\"minCountForSearch\", \"minCountForSearch\", numberAttribute],\n id: \"id\",\n required: [\"required\", \"required\", booleanAttribute],\n disabled: [\"disabled\", \"disabled\", booleanAttribute],\n hideSelectedItems: [\"hideSelectedItems\", \"hideSelectedItems\", booleanAttribute],\n readonly: [\"readonly\", \"readonly\", booleanAttribute],\n value: \"value\",\n tabIndex: [\"tabIndex\", \"tabIndex\", numberAttribute],\n resettable: [\"resettable\", \"resettable\", booleanAttribute],\n resetSelectedValue: \"resetSelectedValue\"\n },\n outputs: {\n update: \"update\",\n autoCreateItem: \"autoCreateItem\",\n open: \"open\",\n close: \"close\",\n focus: \"focus\",\n blur: \"blur\",\n search: \"search\",\n scroll: \"scroll\",\n removeOption: \"removeOption\"\n },\n features: [i0.ɵɵInputTransformsFeature],\n ngContentSelectors: _c6,\n decls: 18,\n vars: 28,\n consts: [[1, \"select2-label\", 3, \"click\"], [\"class\", \"select2-required\", 4, \"ngIf\"], [1, \"select2\", \"select2-container\", \"select2-container--default\"], [\"cdkOverlayOrigin\", \"\", 1, \"selection\", 3, \"tabindex\", \"click\", \"focus\", \"blur\", \"keydown\"], [\"selection\", \"\", \"trigger\", \"cdkOverlayOrigin\"], [\"role\", \"combobox\", 1, \"select2-selection\"], [\"class\", \"select2-selection__rendered\", 3, \"title\", 4, \"ngIf\"], [\"class\", \"select2-selection__reset\", \"role\", \"presentation\", 3, \"click\", 4, \"ngIf\"], [\"class\", \"select2-selection__arrow\", \"role\", \"presentation\", 4, \"ngIf\"], [\"class\", \"select2-selection__rendered\", 4, \"ngIf\"], [4, \"ngIf\"], [1, \"select2-subscript-wrapper\"], [\"cdkConnectedOverlay\", \"\", \"cdkConnectedOverlayHasBackdrop\", \"\", \"cdkConnectedOverlayBackdropClass\", \"select2-overlay-backdrop\", 3, \"cdkConnectedOverlayOrigin\", \"cdkConnectedOverlayOpen\", \"cdkConnectedOverlayMinWidth\", \"cdkConnectedOverlayHeight\", \"cdkConnectedOverlayPositions\", \"backdropClick\"], [\"containerTemplate\", \"\"], [1, \"select2-required\"], [1, \"select2-selection__rendered\", 3, \"title\"], [1, \"select2-selection__placeholder\"], [3, \"innerHTML\", 4, \"ngIf\", \"ngIfElse\"], [\"template\", \"\"], [3, \"innerHTML\"], [4, \"ngTemplateOutlet\", \"ngTemplateOutletContext\"], [\"role\", \"presentation\", 1, \"select2-selection__reset\", 3, \"click\"], [\"role\", \"presentation\", 1, \"select2-selection__arrow\"], [1, \"select2-selection__rendered\"], [\"class\", \"select2-selection__placeholder\", 3, \"select2-selection__placeholder__option\", 4, \"ngIf\"], [\"class\", \"select2-selection__choice\", \"tabindex\", \"0\", 3, \"title\", \"keydown.enter\", 4, \"ngFor\", \"ngForOf\", \"ngForTrackBy\"], [\"class\", \"select2-selection__auto-create\", 3, \"focus\", \"blur\", 4, \"ngIf\"], [\"tabindex\", \"0\", 1, \"select2-selection__choice\", 3, \"title\", \"keydown.enter\"], [\"class\", \"select2-selection__choice__remove\", \"role\", \"presentation\", 3, \"click\", 4, \"ngIf\"], [\"templateMultiple\", \"\"], [\"role\", \"presentation\", 1, \"select2-selection__choice__remove\", 3, \"click\"], [1, \"select2-selection__auto-create\", 3, \"focus\", \"blur\"], [\"type\", \"search\", \"role\", \"textbox\", \"autocomplete\", \"off\", \"autocorrect\", \"off\", \"autocapitalize\", \"off\", \"spellcheck\", \"false\", 1, \"select2-create__field\", 3, \"id\", \"click\", \"keydown\", \"keyup\", \"change\"], [4, \"ngTemplateOutlet\"], [1, \"select2-container\", \"select2-container--default\", \"select2-container-dropdown\"], [1, \"select2-dropdown\"], [\"dropdown\", \"\"], [1, \"select2-search\", \"select2-search--dropdown\"], [\"type\", \"search\", \"role\", \"textbox\", \"autocomplete\", \"off\", \"autocorrect\", \"off\", \"autocapitalize\", \"off\", \"spellcheck\", \"false\", 1, \"select2-search__field\", 3, \"id\", \"value\", \"keydown\", \"keyup\", \"change\"], [\"searchInput\", \"\"], [1, \"select2-results\"], [\"role\", \"tree\", \"tabindex\", \"-1\", \"infiniteScroll\", \"\", 1, \"select2-results__options\", 3, \"infiniteScrollDisabled\", \"infiniteScrollDistance\", \"infiniteScrollThrottle\", \"infiniteScrollContainer\", \"scrolled\", \"scrolledUp\", \"keydown\"], [\"results\", \"\"], [4, \"ngFor\", \"ngForOf\", \"ngForTrackBy\"], [\"class\", \"select2-no-result select2-results__option\", 3, \"innerHTML\", 4, \"ngIf\"], [\"class\", \"select2-too-much-result select2-results__option\", 3, \"innerHTML\", 4, \"ngIf\"], [\"class\", \"select2-results__option\", \"role\", \"group\", 4, \"ngIf\"], [\"role\", \"treeitem\", 3, \"id\", \"class\", \"mouseenter\", \"click\", 4, \"ngIf\"], [\"role\", \"group\", 1, \"select2-results__option\"], [\"optGroup\", \"\"], [1, \"select2-results__options\", \"select2-results__options--nested\"], [\"role\", \"treeitem\", 3, \"id\", \"class\", \"mouseenter\", \"click\", 4, \"ngFor\", \"ngForOf\", \"ngForTrackBy\"], [\"role\", \"treeitem\", 3, \"id\", \"mouseenter\", \"click\"], [\"result\", \"\"], [\"class\", \"select2-label-content\", 3, \"innerHTML\", 4, \"ngIf\", \"ngIfElse\"], [\"liGroup\", \"\"], [1, \"select2-label-content\", 3, \"innerHTML\"], [\"li\", \"\"], [1, \"select2-no-result\", \"select2-results__option\", 3, \"innerHTML\"], [1, \"select2-too-much-result\", \"select2-results__option\", 3, \"innerHTML\"]],\n template: function Select2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojectionDef(_c5);\n i0.ɵɵelementStart(0, \"div\", 0);\n i0.ɵɵlistener(\"click\", function Select2_Template_div_click_0_listener() {\n return ctx.toggleOpenAndClose();\n });\n i0.ɵɵprojection(1);\n i0.ɵɵtemplate(2, Select2_span_2_Template, 1, 0, \"span\", 1);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(3, \"div\", 2)(4, \"div\", 3, 4);\n i0.ɵɵlistener(\"click\", function Select2_Template_div_click_4_listener() {\n return ctx.toggleOpenAndClose();\n })(\"focus\", function Select2_Template_div_focus_4_listener() {\n return ctx.focusin();\n })(\"blur\", function Select2_Template_div_blur_4_listener() {\n return ctx.focusout();\n })(\"keydown\", function Select2_Template_div_keydown_4_listener($event) {\n return ctx.openKey($event);\n });\n i0.ɵɵelementStart(7, \"div\", 5);\n i0.ɵɵtemplate(8, Select2_span_8_Template, 5, 6, \"span\", 6)(9, Select2_span_9_Template, 2, 0, \"span\", 7)(10, Select2_span_10_Template, 1, 0, \"span\", 8)(11, Select2_ul_11_Template, 4, 4, \"ul\", 9);\n i0.ɵɵelementEnd()();\n i0.ɵɵtemplate(12, Select2_ng_container_12_Template, 2, 1, \"ng-container\", 10);\n i0.ɵɵelementStart(13, \"div\", 11);\n i0.ɵɵprojection(14, 1);\n i0.ɵɵelementEnd()();\n i0.ɵɵtemplate(15, Select2_ng_template_15_Template, 1, 1, \"ng-template\", 12);\n i0.ɵɵlistener(\"backdropClick\", function Select2_Template_ng_template_backdropClick_15_listener() {\n return ctx.toggleOpenAndClose();\n });\n i0.ɵɵtemplate(16, Select2_ng_template_16_Template, 12, 25, \"ng-template\", null, 13, i0.ɵɵtemplateRefExtractor);\n }\n if (rf & 2) {\n const _r2 = i0.ɵɵreference(6);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx.required);\n i0.ɵɵadvance(1);\n i0.ɵɵclassProp(\"select2-container--focus\", ctx.focused)(\"select2-container--below\", !ctx.select2above)(\"select2-container--above\", ctx.select2above)(\"select2-container--open\", ctx.isOpen)(\"select2-container--disabled\", ctx.disabled);\n i0.ɵɵadvance(1);\n i0.ɵɵclassProp(\"select2-focused\", ctx.focused);\n i0.ɵɵproperty(\"tabindex\", !ctx.isOpen ? ctx.tabIndex : \"-1\");\n i0.ɵɵadvance(3);\n i0.ɵɵclassProp(\"select2-selection--multiple\", ctx.multiple)(\"select2-selection--single\", !ctx.multiple);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx.multiple);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx.multiple && ctx.resettable && ctx.resetSelectedValue !== ctx.value && ctx.select2Option && !(ctx.disabled || ctx.readonly));\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx.multiple);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx.multiple);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx.overlay);\n i0.ɵɵadvance(3);\n i0.ɵɵproperty(\"cdkConnectedOverlayOrigin\", _r2)(\"cdkConnectedOverlayOpen\", ctx.isOpen && ctx.overlay)(\"cdkConnectedOverlayMinWidth\", ctx.overlayWidth)(\"cdkConnectedOverlayHeight\", ctx.overlayHeight)(\"cdkConnectedOverlayPositions\", ctx._positions);\n }\n },\n dependencies: [i3.NgForOf, i3.NgIf, i3.NgTemplateOutlet, i4.CdkConnectedOverlay, i4.CdkOverlayOrigin, i5.InfiniteScrollDirective],\n styles: [\".select2-label[_ngcontent-%COMP%]{color:var(--select2-label-text-color, #000)}.select2-container[_ngcontent-%COMP%]{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container[_ngcontent-%COMP%] .select2-container-dropdown[_ngcontent-%COMP%]{position:absolute;width:0px;opacity:0}.select2-container[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%]{display:block;padding:var(--select2-selection-padding, 0 0 0 8px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__clear[_ngcontent-%COMP%]{position:relative}.select2-container[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%]{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:var(--select2-selection-multiple-gap, 2px 5px)}.select2-container[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%] .select2-selection__auto-create[_ngcontent-%COMP%]{flex:1 1 150px;min-width:150px;display:flex}.select2-container[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%] .select2-create__field[_ngcontent-%COMP%]{width:100%;border:0}.select2-container[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%] .select2-create__field[_ngcontent-%COMP%]:focus{border:0;outline:0}.select2-container[_ngcontent-%COMP%] .select2-search--inline[_ngcontent-%COMP%]{float:left}.select2-container[_ngcontent-%COMP%] .select2-search--inline[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container[_ngcontent-%COMP%] .select2-search--inline[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown[_ngcontent-%COMP%]{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown[_ngcontent-%COMP%] .select2-label-content[_ngcontent-%COMP%]{display:contents}.select2-results[_ngcontent-%COMP%]{display:block}.select2-results__options[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.select2-results__option[_ngcontent-%COMP%]{padding:var(--select2-option-padding, 6px);-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected][_ngcontent-%COMP%]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open[_ngcontent-%COMP%]{width:100%;opacity:1}.select2-container--open[_ngcontent-%COMP%] .select2-dropdown[_ngcontent-%COMP%]{overflow:auto;height:auto}.select2-container--open[_ngcontent-%COMP%] .select2-dropdown--above[_ngcontent-%COMP%]{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open[_ngcontent-%COMP%] .select2-dropdown--below[_ngcontent-%COMP%]{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown[_ngcontent-%COMP%]{display:block;padding:4px}.select2-search--dropdown[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide[_ngcontent-%COMP%]{display:none}.select2-close-mask[_ngcontent-%COMP%]{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required[_ngcontent-%COMP%]:before{content:\\\"*\\\";color:var(--select2-required-color, red)}.select2-hidden-accessible[_ngcontent-%COMP%]{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%]{color:var(--select2-selection-text-color, #111);line-height:var(--select2-selection-line-height, 28px)}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__clear[_ngcontent-%COMP%]{cursor:pointer;float:right;font-weight:700}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__placeholder[_ngcontent-%COMP%]{color:var(--select2-placeholder-color, #999)}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__placeholder[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__placeholder__option[_ngcontent-%COMP%]{display:none}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__reset[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__arrow[_ngcontent-%COMP%]{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__arrow[_ngcontent-%COMP%]:before{content:\\\" \\\";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__reset[_ngcontent-%COMP%]{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__clear[_ngcontent-%COMP%]{display:none}.select2-container--default.select2-container--open[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__arrow[_ngcontent-%COMP%]:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text;display:flex}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%]{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:var(--select2-selection-multiple-padding, 2px 5px);width:100%;min-height:1em;align-items:center}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{list-style:none;line-height:var(--select2-selection-choice-line-height, 20px)}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__placeholder[_ngcontent-%COMP%]{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__placeholder__option[_ngcontent-%COMP%]{display:none}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__clear[_ngcontent-%COMP%]{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__choice[_ngcontent-%COMP%]{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__choice__remove[_ngcontent-%COMP%]{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__choice__remove[_ngcontent-%COMP%]:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default[_ngcontent-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection__choice__remove[_ngcontent-%COMP%]{display:none}.select2-container--default.select2-container--open.select2-container--above[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .select2-container--default.select2-container--open.select2-container--above[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .select2-container--default.select2-container--open.select2-container--below[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default[_ngcontent-%COMP%] .select2-search--dropdown[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default[_ngcontent-%COMP%] .select2-search--inline[_ngcontent-%COMP%] .select2-search__field[_ngcontent-%COMP%]{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default[_ngcontent-%COMP%] .select2-results[_ngcontent-%COMP%] > .select2-results__options[_ngcontent-%COMP%]{overflow-y:auto}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[role=group][_ngcontent-%COMP%]{padding:0}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[aria-disabled=true][_ngcontent-%COMP%]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[aria-selected=true][_ngcontent-%COMP%]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{padding-left:1em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__group[_ngcontent-%COMP%]{padding-left:0}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{margin-left:-1em;padding-left:2em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{margin-left:-2em;padding-left:3em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{margin-left:-3em;padding-left:4em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{margin-left:-4em;padding-left:5em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%] .select2-results__option[_ngcontent-%COMP%]{margin-left:-5em;padding-left:6em}.select2-container--default[_ngcontent-%COMP%] .select2-results__option--highlighted[aria-selected][_ngcontent-%COMP%]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default[_ngcontent-%COMP%] .select2-results__option--hide[_ngcontent-%COMP%]{display:none}.select2-container--default[_ngcontent-%COMP%] .select2-results__group[_ngcontent-%COMP%]{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result[_ngcontent-%COMP%]{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result[_ngcontent-%COMP%]{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}.nostyle[_nghost-%COMP%] .select2-dropdown[_ngcontent-%COMP%]{border-color:transparent}.nostyle[_nghost-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .nostyle[_nghost-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{background:transparent;border-color:transparent}.nostyle[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-focused[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .nostyle[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%], .nostyle[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .nostyle[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{background:transparent;border-color:transparent}.material[_nghost-%COMP%]{display:inline-block;width:300px}.material[_nghost-%COMP%] > .select2-container[_ngcontent-%COMP%]{padding-bottom:1.29688em;vertical-align:inherit}.material[_nghost-%COMP%] > .select2-container[_ngcontent-%COMP%] .selection[_ngcontent-%COMP%]{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:before, .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:before{content:\\\" \\\";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:after, .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:after{content:\\\" \\\";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%], .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__rendered[_ngcontent-%COMP%]{padding-left:1px;line-height:inherit}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%] .select2-selection__placeholder[_ngcontent-%COMP%], .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%] .select2-selection__placeholder[_ngcontent-%COMP%]{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-container--open[_ngcontent-%COMP%]{left:0;bottom:1.6em}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection__placeholder__option[_ngcontent-%COMP%]{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection__arrow[_ngcontent-%COMP%]{top:20px}.material[_nghost-%COMP%] .select2-container--default.select2-container--open[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:after, .material[_nghost-%COMP%] .select2-container--default.select2-container--open[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:after, .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-focused[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:after, .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-dropdown[_ngcontent-%COMP%]{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-results__option[aria-selected=true][_ngcontent-%COMP%], .material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-results__option--highlighted[aria-selected][_ngcontent-%COMP%]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}.material[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-results__option[aria-selected=true][_ngcontent-%COMP%]{color:var(--select2-material-option-selected-text-color, #ff5722)}.material[_nghost-%COMP%] .select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .material[_nghost-%COMP%] .select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{background:transparent}.material[_nghost-%COMP%] .select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:before, .material[_nghost-%COMP%] .select2-container--default.select2-container--disabled[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}.material.ng-invalid.ng-touched[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:before, .material.ng-invalid.ng-touched[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%]:after, .material.ng-invalid.ng-touched[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:before, .material.ng-invalid.ng-touched[_nghost-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]:after{background:var(--select2-material-underline-invalid, red)}.material[_nghost-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], .material[_nghost-%COMP%]:not(.select2-container--open) .select2-focused[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{border:0}.material[_nghost-%COMP%] .select2-subscript-wrapper[_ngcontent-%COMP%]{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)} .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)} .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px} .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px} .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material[_ngcontent-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--single[_ngcontent-%COMP%], select2.material[_ngcontent-%COMP%] .select2-container--default[_ngcontent-%COMP%] .select2-selection--multiple[_ngcontent-%COMP%]{height:26px}}\"]\n });\n }\n }\n return Select2;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet Select2Hint = /*#__PURE__*/(() => {\n class Select2Hint {\n /** @nocollapse */static {\n this.ɵfac = function Select2Hint_Factory(t) {\n return new (t || Select2Hint)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: Select2Hint,\n selectors: [[\"select2-hint\"]]\n });\n }\n }\n return Select2Hint;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet Select2Label = /*#__PURE__*/(() => {\n class Select2Label {\n /** @nocollapse */static {\n this.ɵfac = function Select2Label_Factory(t) {\n return new (t || Select2Label)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: Select2Label,\n selectors: [[\"select2-label\"]]\n });\n }\n }\n return Select2Label;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet Select2Module = /*#__PURE__*/(() => {\n class Select2Module {\n /** @nocollapse */static {\n this.ɵfac = function Select2Module_Factory(t) {\n return new (t || Select2Module)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: Select2Module\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule, FormsModule, ReactiveFormsModule]\n });\n }\n }\n return Select2Module;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/*\n * Public API Surface of ng-select2-component\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Select2, Select2Hint, Select2Label, Select2Module, Select2Utils, defaultMinCountForSearch, protectRegexp, timeout, unicodePatterns };\n"],"mappings":"g7CAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,eAAC,SAAUC,EAAGC,EAAG,CACG,OAAO,QAArB,YAA+B,OAAO,IAAK,OAAO,CAAC,EAAGA,CAAC,EAA0B,OAAOH,GAAtB,IAA+BG,EAAE,GACrGA,EAAE,EAAGD,EAAE,UACI,CAAC,EAGhB,GAAGF,GAAM,UAAY,CACnB,aAEA,SAASG,EAAED,EAAGC,EAAG,CACf,OAAsB,OAAOA,EAAtB,IAA0BA,EAAI,CACnC,QAAS,EACX,EAAgB,OAAOA,GAAnB,WAAyB,QAAQ,KAAK,oDAAoD,EAAGA,EAAI,CACnG,QAAS,CAACA,CACZ,GAAIA,EAAE,SAAW,6EAA6E,KAAKD,EAAE,IAAI,EAAI,IAAI,KAAK,CAAC,SAAUA,CAAC,EAAG,CACnI,KAAMA,EAAE,IACV,CAAC,EAAIA,CACP,CACA,SAASE,EAAEF,EAAGC,EAAGC,EAAG,CAClB,IAAI,EAAI,IAAI,eACZ,EAAE,KAAK,MAAOF,CAAC,EAAG,EAAE,aAAe,OAAQ,EAAE,OAAS,UAAY,CAChEG,EAAE,EAAE,SAAUF,EAAGC,CAAC,CACpB,EAAG,EAAE,QAAU,UAAY,CACzB,QAAQ,MAAM,yBAAyB,CACzC,EAAG,EAAE,KAAK,CACZ,CACA,SAASE,EAAEJ,E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ACL,EAAG,CACD,EAAG,IACH,EAAG,mBACL,EAAG,CACD,EAAG,KACH,EAAG,QACL,EAAG,CACD,EAAG,IACH,EAAG,oCACL,EAAG,CACD,EAAG,IACH,EAAG,WACL,EAAG,CACD,EAAG,IACH,EAAG,oBACL,EAAG,CACD,EAAG,IACH,EAAG,oBACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,0BACL,EAAG,CACD,EAAG,IACH,EAAG,WACL,EAAG,CACD,EAAG,IACH,EAAG,mBACL,EAAG,CACD,EAAG,IACH,EAAG,yBACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,aACL,EAAG,CACD,EAAG,IACH,EAAG,sBACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,iDACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,eACL,EAAG,CACD,EAAG,IACH,EAAG,WACL,EAAG,CACD,EAAG,IACH,EAAG,sBACL,EAAG,CACD,EAAG,IACH,EAAG,wBACL,EAAG,CACD,EAAG,IACH,EAAG,qBACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,uCACL,EAAG,CACD,EAAG,IACH,EAAG,aACL,EAAG,CACD,EAAG,KACH,EAAG,KACL,EAAG,CACD,EAAG,IACH,EAAG,gBACL,EAAG,CACD,EAAG,IACH,EAAG,UACL,EAAG,CACD,EAAG,IACH,EAAG,qBACL,EAAG,CACD,EAAG,IACH,EAAG,mBACL,CAAC,EACKC,GAA2B,EAC3BC,GAAgB,IAAI,OAAO,sDAAuD,GAAG,EACrFC,EAAN,MAAMC,CAAa,CACjB,OAAO,iBAAiBC,EAAMC,EAAO,CACnC,GAAI,MA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C,EAi0BA,OAAOD,CACT,GAAG,EA4CH,IAAIsG,IAA8B,IAAM,CACtC,IAAMC,EAAN,MAAMA,CAAc,CAkBpB,EAhBIA,EAAK,UAAO,SAA+BC,EAAG,CAC5C,OAAO,IAAKA,GAAKD,EACnB,EAIAA,EAAK,UAAyBE,EAAiB,CAC7C,KAAMF,CACR,CAAC,EAIDA,EAAK,UAAyBG,EAAiB,CAC7C,QAAS,CAACC,GAAcC,GAAaC,GAAeC,GAAqBC,GAAsBH,GAAaE,EAAmB,CACjI,CAAC,EAhBL,IAAMR,EAANC,EAmBA,OAAOD,CACT,GAAG","names":["require_FileSaver_min","__commonJSMin","exports","module","a","b","c","g","d","f","h","i","j","e","k","l","m","TagBadgeCursor","TagBadgeComponent","constructor","selectionMode","Selectable","fillStyle","selectors","inputs","standalone","features","ɵɵStandaloneFeature","ngContentSelectors","_c1","decls","vars","consts","template","rf","ctx","ɵɵelementStart","ɵɵprojection","ɵɵelementEnd","ɵɵclassMapInterpolate1","ɵɵproperty","ɵɵpureFunction3","_c0","NotAllowed","Clickable","CommonModule","NgClass","styles","changeDetection","_TagBadgeComponent","import_file_saver","SAVER","InjectionToken","getSaver","saveAs","isHttpResponse","event","type","HttpEventType","Response","isHttpProgressEvent","DownloadProgress","UploadProgress","download","saver","source","pipe","scan","previous","progress","total","Math","round","loaded","state","content","body","getFilename","headers","filename","defaultName","get","split","replace","trim","startsWith","ext","substring","lastIndexOf","length","BytesPipe","transform","bytes","si","dp","thresh","Math","abs","units","u","r","round","length","fixed","toFixed","endsWith","pure","standalone","_BytesPipe","DEBOUNCE_TIME","bytesPipe","BytesPipe","DownloadService","constructor","save","baseUrl","environment","apiUrl","SIZE_WARNING","downloadsSource","BehaviorSubject","activeDownloads$","asObservable","destroyRef","inject","DestroyRef","confirmService","ConfirmService","accountService","AccountService","httpClient","HttpClient","downloadSubtitle","downloadEntityType","downloadEntity","name","number","download","entityType","entity","callback","sizeCheckCall","downloadCall","downloadSeriesSize","id","downloadSeries","downloadVolumeSize","downloadVolume","downloadChapterSize","downloadChapter","of","downloadBookmarks","downloadLogs","currentUser$","pipe","take","switchMap","user","preferences","promptForDownloadSize","size","__async","confirmSize","filter","wantsToDownload","tap","d","takeWhile","val","state","finalize","undefined","takeUntilDestroyed","subscribe","seriesId","get","volumeId","chapterId","downloadType","subtitle","observe","responseType","reportProgress","throttleTime","asyncScheduler","leading","trailing","blob","filename","decodeURIComponent","updateDownloadState","finalizeDownloadState","series","entitySubtitle","values","getValue","v","subTitle","next","findIndex","push","progress","index","chapter","volume","confirm","translate","transform","bookmarks","post","ɵɵinject","SAVER","factory","ɵfac","providedIn","_DownloadService","CollectionTagService","constructor","httpClient","imageService","baseUrl","environment","apiUrl","allTags","get","search","query","encodeURIComponent","pipe","map","tags","forEach","s","coverImage","randomize","getCollectionCoverImage","id","updateTag","tag","post","TextResonse","updateSeriesForTag","seriesIdsToRemove","addByMultiple","tagId","seriesIds","tagTitle","collectionTagId","collectionTagTitle","tagNameExists","name","deleteTag","delete","ɵɵinject","HttpClient","ImageService","factory","ɵfac","providedIn","_CollectionTagService","PersonRole","ɵɵelementContainerStart","ɵɵelementStart","ɵɵlistener","$event","ɵɵrestoreView","_r9","ctx_r8","ɵɵnextContext","ɵɵresetView","toggleLock","ɵɵelement","ɵɵtext","ɵɵelementEnd","ɵɵelementContainerEnd","ɵɵadvance","ɵɵtextInterpolate","t_r1","_r16","option_r11","$implicit","ctx_r14","toggleSelection","ɵɵattribute","ɵɵelementContainer","ɵɵtemplate","TypeaheadComponent_ng_container_0_app_tag_badge_5_i_2_Template","ɵɵproperty","ctx_r3","badgeTemplate","ɵɵpureFunction2","_c3","i_r12","disabled","ctx_r4","settings","id","ɵɵclassMapInterpolate1","ctx_r5","multiple","i0","_r23","clearSelections","stopPropagation","TypeaheadComponent_ng_container_0_ng_container_8_button_1_Template","selected_r20","length","_r31","ctx_r30","focusedIndex","updateHighlight","ctx_r32","addNewItem","typeaheadControl","value","ɵɵtextInterpolate1","ɵɵpureFunction1","_c4","ctx_r27","option_r34","_r37","ctx_r36","handleOptionClick","index_r35","index","ctx_r38","showAddItem","ctx_r28","optionTemplate","ɵɵtextInterpolate2","ctx_r29","addIfNonExisting","TypeaheadComponent_ng_container_0_ng_container_10_div_1_li_3_Template","TypeaheadComponent_ng_container_0_ng_container_10_div_1_li_4_Template","TypeaheadComponent_ng_container_0_ng_container_10_div_1_li_5_Template","ctx_r25","hasFocus","options_r24","trackByIdentityFn","TypeaheadComponent_ng_container_0_ng_container_10_div_1_Template","ctx_r7","TypeaheadComponent_ng_container_0_ng_container_3_Template","_r42","ctx_r41","onInputFocus","TypeaheadComponent_ng_container_0_app_tag_badge_5_Template","TypeaheadComponent_ng_container_0_input_6_Template","TypeaheadComponent_ng_container_0_div_7_Template","TypeaheadComponent_ng_container_0_ng_container_8_Template","TypeaheadComponent_ng_container_0_ng_container_10_Template","ctx_r0","typeaheadForm","ɵɵclassMapInterpolate2","locked","showLocked","_c5","optionSelection","selected","isLoadingOptions","ɵɵpipeBind1","selectedData","filteredOptions","SelectionModel","constructor","selectedState","selectedOptions","propAccessor","_propAccessor","_data","undefined","forEach","d","push","toggle","data","compareFn","lookupMethod","shallowEqual","dataItem","filter","isSelected","hasSomeSelected","selectedCount","map","unselected","peek","a","b","key","ANIMATION_SPEED","TypeaheadComponent","renderer2","document","cdRef","reset","ReplaySubject","EventEmitter","newItemAdded","onUnlock","lockedChange","destroyRef","inject","DestroyRef","ngOnInit","pipe","takeUntilDestroyed","subscribe","resetToEmpty","init","focus","console","error","hasOwnProperty","formControl","FormControl","FormGroup","get","valueChanges","tap","val","inputElem","nativeElement","setStyle","trim","auditTime","debounce","minCharacters","switchMap","fetchFn","items","item","filterSelected","markForCheck","setTimeout","updateShowAddItem","shareReplay","savedData","handleDocumentClick","event","target","classList","contains","handleKeyPress","KEY_CODES","DOWN_ARROW","RIGHT_ARROW","Math","min","querySelectorAll","UP_ARROW","LEFT_ARROW","max","ENTER","take","opts","preventDefault","click","BACKSPACE","DELETE","removeSelectedOption","pop","ESC_KEY","opt","selectionCompareFn","emit","resetField","untoggleAll","title","addTransformFn","newItem","unique","openDropdown","setValue","body","RendererStyleFlags2","Important","addClass","removeClass","options","inputText","dirty","compareFnForAdd","matches","includes","ɵɵdirectiveInject","Renderer2","DOCUMENT","ChangeDetectorRef","selectors","contentQueries","rf","ctx","dirIndex","ɵɵresolveBody","ɵɵresolveWindow","TypeaheadComponent_ng_container_0_Template","CommonModule","NgClass","NgForOf","NgIf","NgTemplateOutlet","AsyncPipe","TagBadgeComponent","ReactiveFormsModule","ɵNgNoValidate","DefaultValueAccessor","NgControlStatus","NgControlStatusGroup","FormGroupDirective","FormControlName","TranslocoDirective","styles","animation","trigger","state","style","height","transition","overflow","animate","changeDetection","_TypeaheadComponent","FilterUtilitiesService","constructor","metadataService","router","http","apiUrl","environment","encodeFilter","filter","post","TextResonse","decodeFilter","encodedFilter","pipe","map","createDefaultFilterDto","statements","push","createSeriesV2DefaultStatement","updateUrlFromFilter","tap","window","history","replaceState","location","href","split","filterPresetsFromUrl","snapshot","includes","of","applyFilter","page","comparison","value","dto","createSeriesV2Filter","createDefaultFilterStatement","switchMap","navigateByUrl","join","applyFilterWithParams","extraParams","url","Object","keys","k","combination","FilterCombination","And","limitTo","sortOptions","isAscending","sortField","SortField","SortName","FilterComparison","Equal","field","FilterField","SeriesName","ɵɵinject","MetadataService","Router","HttpClient","factory","ɵfac","providedIn","_FilterUtilitiesService","coerceNumberProperty","value","fallbackValue","_isNumberValue","coerceArray","coerceCssPixelValue","coerceElement","elementOrRef","ElementRef","hasV8BreakIterator","Platform","_Platform","_platformId","isPlatformBrowser","t","ɵɵinject","PLATFORM_ID","ɵɵdefineInjectable","supportsPassiveEvents","supportsPassiveEventListeners","normalizePassiveListenerOptions","options","scrollBehaviorSupported","supportsScrollBehavior","scrollToFunction","shadowDomIsSupported","_supportsShadowDom","head","_getShadowRoot","element","rootNode","_getEventTarget","event","_isTestEnvironment","DIR_DOCUMENT","InjectionToken","DIR_DOCUMENT_FACTORY","inject","DOCUMENT","RTL_LOCALE_PATTERN","_resolveDirectionality","rawValue","value","Directionality","_Directionality","_document","EventEmitter","bodyDir","htmlDir","t","ɵɵinject","ɵɵdefineInjectable","BidiModule","_BidiModule","t","ɵɵdefineNgModule","ɵɵdefineInjector","DEFAULT_SCROLL_TIME","ScrollDispatcher","_ScrollDispatcher","_ngZone","_platform","document","Subject","scrollable","scrollableReference","auditTimeInMs","Observable","observer","subscription","auditTime","of","_","container","elementOrElementRef","ancestors","filter","target","scrollingContainers","_subscription","element","coerceElement","scrollableElement","window","fromEvent","t","ɵɵinject","NgZone","Platform","DOCUMENT","ɵɵdefineInjectable","DEFAULT_RESIZE_TIME","ViewportRuler","_ViewportRuler","_platform","ngZone","document","Subject","event","window","output","scrollPosition","width","height","documentElement","documentRect","top","left","throttleTime","auditTime","t","ɵɵinject","Platform","NgZone","DOCUMENT","ɵɵdefineInjectable","CdkScrollableModule","_CdkScrollableModule","t","ɵɵdefineNgModule","ɵɵdefineInjector","ScrollingModule","_ScrollingModule","BidiModule","hasModifierKey","event","modifiers","modifier","scrollBehaviorSupported","supportsScrollBehavior","BlockScrollStrategy","_viewportRuler","document","root","coerceCssPixelValue","html","body","htmlStyle","bodyStyle","previousHtmlScrollBehavior","previousBodyScrollBehavior","viewport","CloseScrollStrategy","_scrollDispatcher","_ngZone","_viewportRuler","_config","overlayRef","stream","filter","scrollable","scrollPosition","NoopScrollStrategy","isElementScrolledOutsideView","element","scrollContainers","containerBounds","outsideAbove","outsideBelow","outsideLeft","outsideRight","isElementClippedByScrolling","scrollContainerRect","clippedAbove","clippedBelow","clippedLeft","clippedRight","RepositionScrollStrategy","throttle","overlayRect","width","height","ScrollStrategyOptions","_ScrollStrategyOptions","document","config","BlockScrollStrategy","t","ɵɵinject","ScrollDispatcher","ViewportRuler","NgZone","DOCUMENT","ɵɵdefineInjectable","OverlayConfig","configKeys","key","ConnectedOverlayPositionChange","connectionPair","scrollableViewProperties","BaseOverlayDispatcher","_BaseOverlayDispatcher","document","overlayRef","index","t","ɵɵinject","DOCUMENT","ɵɵdefineInjectable","OverlayKeyboardDispatcher","_OverlayKeyboardDispatcher","_ngZone","event","overlays","i","keydownEvents","NgZone","OverlayOutsideClickDispatcher","_OverlayOutsideClickDispatcher","_platform","_getEventTarget","target","origin","outsidePointerEvents","body","Platform","OverlayContainer","_OverlayContainer","containerClass","_isTestEnvironment","oppositePlatformContainers","container","OverlayRef","_portalOutlet","_host","_pane","_config","_keyboardDispatcher","_document","_location","_outsideClickDispatcher","_animationsDisabled","Subject","Subscription","portal","attachResult","take","detachmentResult","isAttached","strategy","sizeConfig","__spreadValues","dir","__spreadProps","classes","direction","style","coerceCssPixelValue","enablePointer","showingClass","backdropToDetach","element","cssClasses","isAdd","coerceArray","c","subscription","takeUntil","merge","scrollStrategy","backdrop","boundingBoxClass","cssUnitPattern","FlexibleConnectedPositionStrategy","connectedTo","_viewportRuler","_overlayContainer","originRect","overlayRect","viewportRect","containerRect","flexibleFits","fallback","pos","originPoint","overlayPoint","overlayFit","bestFit","bestScore","fit","score","extendStyles","lastPosition","scrollables","positions","margin","flexibleDimensions","growAfterOpen","canPush","isLocked","offset","selector","x","startX","endX","y","overlayStartX","overlayStartY","point","rawOverlayRect","viewport","position","overlay","getRoundedBoundingClientRect","offsetX","offsetY","leftOverflow","rightOverflow","topOverflow","bottomOverflow","visibleWidth","visibleHeight","visibleArea","availableHeight","availableWidth","minHeight","getPixelValue","minWidth","verticalFit","horizontalFit","start","scrollPosition","overflowRight","overflowBottom","overflowTop","overflowLeft","pushX","pushY","scrollableViewProperties","changeEvent","ConnectedOverlayPositionChange","elements","xOrigin","yOrigin","isRtl","height","top","bottom","smallestDistanceToViewportEdge","previousHeight","isBoundedByRightViewportEdge","isBoundedByLeftViewportEdge","width","left","right","previousWidth","boundingBoxRect","styles","maxHeight","maxWidth","hasExactPosition","hasFlexibleDimensions","config","transformString","documentHeight","horizontalStyleProperty","documentWidth","originBounds","overlayBounds","scrollContainerBounds","scrollable","isElementClippedByScrolling","isElementScrolledOutsideView","length","overflows","currentValue","currentOverflow","axis","cssClass","ElementRef","destination","source","key","input","value","units","clientRect","wrapperClass","GlobalPositionStrategy","overlayRef","config","value","offset","styles","parentStyles","width","height","maxWidth","maxHeight","shouldBeFlushHorizontally","shouldBeFlushVertically","xPosition","xOffset","isRtl","marginLeft","marginRight","justifyContent","parent","OverlayPositionBuilder","_OverlayPositionBuilder","_viewportRuler","_document","_platform","_overlayContainer","origin","FlexibleConnectedPositionStrategy","t","ɵɵinject","ViewportRuler","DOCUMENT","Platform","OverlayContainer","ɵɵdefineInjectable","nextUniqueId","Overlay","_Overlay","scrollStrategies","_componentFactoryResolver","_positionBuilder","_keyboardDispatcher","_injector","_ngZone","_directionality","_location","_outsideClickDispatcher","_animationsModuleType","host","pane","portalOutlet","overlayConfig","OverlayConfig","OverlayRef","ApplicationRef","DomPortalOutlet","ScrollStrategyOptions","ComponentFactoryResolver$1","OverlayKeyboardDispatcher","Injector","NgZone","Directionality","Location","OverlayOutsideClickDispatcher","ANIMATION_MODULE_TYPE","defaultPositionList","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY","InjectionToken","CdkOverlayOrigin","_CdkOverlayOrigin","elementRef","ɵɵdirectiveInject","ElementRef","ɵɵdefineDirective","CdkConnectedOverlay","_CdkConnectedOverlay","offsetX","offsetY","_overlay","templateRef","viewContainerRef","scrollStrategyFactory","_dir","Subscription","EventEmitter","TemplatePortal","changes","event","hasModifierKey","positionStrategy","positions","currentPosition","strategy","takeWhile","position","TemplateRef","ViewContainerRef","booleanAttribute","ɵɵInputTransformsFeature","ɵɵNgOnChangesFeature","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY","overlay","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER","OverlayModule","_OverlayModule","ɵɵdefineNgModule","ɵɵdefineInjector","BidiModule","PortalModule","ScrollingModule","resolveContainerElement","selector","scrollWindow","defaultElement","fromRoot","hasWindow","container","findElement","customRoot","inputPropChanged","prop","hasWindowDefined","VerticalProps","HorizontalProps","AxisResolver","vertical","shouldTriggerEvents","alwaysCallback","shouldFireScrollEvent","isTriggeredCurrentTotal","createResolver","windowElement","axis","createResolverWithContainer","isElementWindow","resolver","__spreadProps","__spreadValues","obj","getDocumentElement","isContainerWindow","calculatePoints","element","height","extractHeightForElement","calculatePointsForWindow","calculatePointsForElement","isWindow","offsetHeightKey","clientHeightKey","extractHeightPropKeys","scrolled","getElementPageYOffset","nativeElementHeight","getElementHeight","totalToScroll","getElementOffsetTop","elem","docElem","topKey","pageYOffset","scrollTop","offsetTop","distance","scrollingDown","remaining","containerBreakpoint","scrolledUntilNow","totalHiddenContentHeight","isScrollingDownwards","lastScrollPosition","getScrollStats","scrollDown","ScrollState","totalToScroll","position","scrolledUntilNow","scroll","isScrollingDown","createScroller","config","scrollContainer","scrollWindow","element","fromRoot","resolver","createResolver","AxisResolver","resolveContainerElement","scrollState","calculatePoints","options","distance","attachScrollEvent","mergeMap","of","map","positionStats","toInfiniteScrollParams","tap","stats","filter","fire","scrollDown","shouldTriggerEvents","toInfiniteScrollAction","obs","fromEvent","throttleTime","lastScrollPosition","getScrollStats","InfiniteScrollActions","response","currentScrollPosition","InfiniteScrollDirective","_InfiniteScrollDirective","zone","EventEmitter","infiniteScrollContainer","infiniteScrollDisabled","infiniteScrollDistance","containerChanged","inputPropChanged","disabledChanged","distanceChanged","shouldSetup","hasWindowDefined","payload","type","emitter","hasObservers","t","ɵɵdirectiveInject","ElementRef","NgZone","ɵɵdefineDirective","ɵɵNgOnChangesFeature","InfiniteScrollModule","_InfiniteScrollModule","ɵɵdefineNgModule","ɵɵdefineInjector","_c0","_c1","_c2","_c3","_c4","Select2_span_2_Template","rf","ctx","ɵɵelement","Select2_span_8_span_1_Template","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","Select2_span_8_ng_container_2_span_1_Template","ctx_r13","ɵɵnextContext","ɵɵproperty","ɵɵsanitizeHtml","Select2_span_8_ng_container_2_ng_template_2_ng_container_0_Template","ɵɵelementContainer","Select2_span_8_ng_container_2_ng_template_2_Template","ɵɵtemplate","ctx_r14","Select2_span_8_ng_container_2_Template","ɵɵelementContainerStart","ɵɵtemplateRefExtractor","ɵɵelementContainerEnd","_r15","ɵɵreference","ctx_r12","ɵɵadvance","Select2_span_8_Template","ctx_r3","ɵɵclassProp","ɵɵtextInterpolate","Select2_span_9_Template","_r18","ɵɵgetCurrentView","ɵɵlistener","$event","ɵɵrestoreView","ctx_r17","ɵɵresetView","Select2_span_10_Template","Select2_ul_11_span_1_Template","ctx_r19","Select2_ul_11_li_2_span_1_Template","_r29","op_r22","ctx_r27","Select2_ul_11_li_2_span_2_Template","Select2_ul_11_li_2_ng_template_3_ng_container_0_Template","Select2_ul_11_li_2_ng_template_3_Template","ctx_r25","Select2_ul_11_li_2_Template","_r34","ctx_r33","_r26","ctx_r20","Select2_ul_11_li_3_Template","_r36","ctx_r35","ctx_r37","ctx_r38","ctx_r39","ctx_r40","ctx_r41","ctx_r21","Select2_ul_11_Template","ctx_r6","Select2_ng_container_12_ng_container_1_Template","Select2_ng_container_12_Template","_r10","Select2_ng_template_15_ng_container_0_Template","Select2_ng_template_15_Template","Select2_ng_template_16_ng_container_9_li_1_strong_1_Template","groupOrOption_r50","ɵɵattribute","Select2_ng_template_16_ng_container_9_li_1_ng_template_2_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_1_ng_template_2_Template","ctx_r55","Select2_ng_template_16_ng_container_9_li_1_li_5_div_2_Template","option_r61","Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_Template","ctx_r65","Select2_ng_template_16_ng_container_9_li_1_li_5_Template","_r71","ctx_r70","ctx_r72","j_r62","_r66","i_r51","ctx_r57","ɵɵclassMap","Select2_ng_template_16_ng_container_9_li_1_Template","_r56","ctx_r52","Select2_ng_template_16_ng_container_9_li_2_div_2_Template","Select2_ng_template_16_ng_container_9_li_2_ng_template_3_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_2_ng_template_3_Template","ctx_r77","Select2_ng_template_16_ng_container_9_li_2_Template","_r84","ctx_r82","ctx_r85","_r78","ctx_r87","ctx_r53","Select2_ng_template_16_ng_container_9_Template","Select2_ng_template_16_li_10_Template","ctx_r48","Select2_ng_template_16_li_11_Template","ctx_r49","Select2_ng_template_16_Template","_r89","ctx_r88","ctx_r90","ctx_r91","ctx_r92","ctx_r93","ctx_r94","_r46","ctx_r9","ɵɵstyleProp","_c5","_c6","unicodePatterns","defaultMinCountForSearch","protectRegexp","Select2Utils","_Select2Utils","data","value","groupOrOption","options","option","multiple","values","result","v","filteredData","hoveringValue","findIt","j","maxResults","counter","group","__spreadProps","__spreadValues","item","searchText","editPattern","filteredOptions","selectedOptions","minCountForSearch","op","i","count","label","str","unicodePattern","nextUniqueId","displaySearchStatusList","Select2","_Select2","text","_viewportRuler","_changeDetectorRef","_parentForm","_parentFormGroup","_control","tabIndex","EventEmitter","Subject","target","posChange","hidden","displaySearchStatus","event","focus","open","changeEmit","defaut","TemplateRef","value1","value2","e1","writeValue","element","cssClass","id","cssClasses","index","create","_index","fn","isDisabled","way","isInvalid","isTouched","isSubmitted","domElement","r","listClientRect","optionClientRect","refs","code","isArray","newValue","state","t","ɵɵdirectiveInject","ViewportRuler","ChangeDetectorRef","NgForm","FormGroupDirective","NgControl","ɵɵinjectAttribute","ɵɵdefineComponent","rf","ctx","ɵɵviewQuery","CdkConnectedOverlay","_c0","_c1","_c2","_c3","_c4","_t","ɵɵqueryRefresh","ɵɵloadQuery","ɵɵlistener","$event","ɵɵresolveDocument","ɵɵhostProperty","ɵɵattribute","ɵɵclassProp","numberAttribute","booleanAttribute","ɵɵInputTransformsFeature","_c6","ɵɵprojectionDef","_c5","ɵɵelementStart","ɵɵprojection","ɵɵtemplate","Select2_span_2_Template","ɵɵelementEnd","Select2_span_8_Template","Select2_span_9_Template","Select2_span_10_Template","Select2_ul_11_Template","Select2_ng_container_12_Template","Select2_ng_template_15_Template","Select2_ng_template_16_Template","ɵɵtemplateRefExtractor","_r2","ɵɵreference","ɵɵadvance","ɵɵproperty","NgForOf","NgIf","NgTemplateOutlet","CdkOverlayOrigin","InfiniteScrollDirective","Select2Module","_Select2Module","t","ɵɵdefineNgModule","ɵɵdefineInjector","CommonModule","FormsModule","OverlayModule","ReactiveFormsModule","InfiniteScrollModule"],"x_google_ignoreList":[0,12,13,14,15,16,17,18,19]}