import { Component, Input, TemplateRef } from '@angular/core';
import { of, pipe } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/cdk/scrolling";
import * as i3 from "./virtual-scroll-window.directive";
export class VirtualScrollerWrapperComponent {
    constructor() {
        this.filterPipe = pipe(tap());
        this.trackByFn = (i, item) => {
            return item.id;
        };
    }
    apply() {
        this.items$ = of(this.items).pipe(src => this.filterPipe(src), map(item => item));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: VirtualScrollerWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: VirtualScrollerWrapperComponent, selector: "c8y-virtual-scroller-wrapper", inputs: { items: "items", itemHeight: "itemHeight", containerHeight: "containerHeight", template: "template", filterPipe: "filterPipe", strategy: "strategy", trackByFn: "trackByFn" }, ngImport: i0, template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n    <ng-container *ngSwitchCase=\"'window'\">\n      <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n        <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n          <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n        </div>\n      </cdk-virtual-scroll-viewport>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'fixed'\">\n      <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n        <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n          <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n        </div>\n      </cdk-virtual-scroll-viewport>\n    </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i3.VirtualScrollWindowDirective, selector: "cdk-virtual-scroll-viewport[windowVirtualScrollStrategy]", inputs: ["itemSizePx", "minBufferPx", "maxBufferPx", "offsetSizePx"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: VirtualScrollerWrapperComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-virtual-scroller-wrapper', template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n    <ng-container *ngSwitchCase=\"'window'\">\n      <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n        <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n          <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n        </div>\n      </cdk-virtual-scroll-viewport>\n    </ng-container>\n\n    <ng-container *ngSwitchCase=\"'fixed'\">\n      <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n        <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n          <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n        </div>\n      </cdk-virtual-scroll-viewport>\n    </ng-container>\n</ng-container>\n" }]
        }], propDecorators: { items: [{
                type: Input
            }], itemHeight: [{
                type: Input
            }], containerHeight: [{
                type: Input
            }], template: [{
                type: Input
            }], filterPipe: [{
                type: Input
            }], strategy: [{
                type: Input
            }], trackByFn: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlydHVhbC1zY3JvbGxlci13cmFwcGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2NvcmUvY29tbW9uL3ZpcnR1YWwtc2Nyb2xsL3ZpcnR1YWwtc2Nyb2xsZXItd3JhcHBlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9jb3JlL2NvbW1vbi92aXJ0dWFsLXNjcm9sbC92aXJ0dWFsLXNjcm9sbGVyLXdyYXBwZXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzlELE9BQU8sRUFBYyxFQUFFLEVBQUUsSUFBSSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzVDLE9BQU8sRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7Ozs7O0FBTTFDLE1BQU0sT0FBTywrQkFBK0I7SUFKNUM7UUFZVyxlQUFVLEdBQ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