import { ElementRef, Directive, InjectionToken, forwardRef, ViewContainerRef, NgZone, ChangeDetectorRef, Inject, Optional, Input, EventEmitter, ViewChild, TemplateRef, ContentChildren, Output, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { Subscription, Subject, defer, merge, of } from 'rxjs';
import { take, switchMap, filter, map, tap, delay } from 'rxjs/operators';
import { Directionality } from '@angular/cdk/bidi';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { ESCAPE, ENTER, UP_ARROW, DOWN_ARROW, TAB } from '@angular/cdk/keycodes';
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { ViewportRuler } from '@angular/cdk/scrolling';
import { DOCUMENT, CommonModule } from '@angular/common';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NtOptionSelectionChange, fromOutsideElementClick, NtOptionComponent, NT_OPTION_PARENT_COMPONENT, NtOptionModule } from '@ng-tangram/components/core';
import { BOTTOM_LEFT, TOP_LEFT } from '@ng-tangram/components/overlay';
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let NtAutocompleteOriginDirective = class NtAutocompleteOriginDirective {
    constructor(elementRef) {
        this.elementRef = elementRef;
    }
};
NtAutocompleteOriginDirective.ctorParameters = () => [
    { type: ElementRef }
];
NtAutocompleteOriginDirective = __decorate([
    Directive({
        selector: '[ntAutocompleteOrigin]',
        exportAs: 'ntAutocompleteOrigin',
    })
], NtAutocompleteOriginDirective);

var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
const NT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken('nt-autocomplete-scroll-strategy');
function NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay) {
    return () => overlay.scrollStrategies.reposition();
}
const NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {
    provide: NT_AUTOCOMPLETE_SCROLL_STRATEGY,
    deps: [Overlay],
    useFactory: NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY,
};
const MAT_AUTOCOMPLETE_VALUE_ACCESSOR = {
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => NtAutocompleteTriggerDirective),
    multi: true
};
function getMatAutocompleteMissingPanelError() {
    return Error('Attempting to open an undefined instance of `mat-autocomplete`. ' +
        'Make sure that the id passed to the `matAutocomplete` is correct and that ' +
        'you\'re attempting to open it after the ngAfterContentInit hook.');
}
let NtAutocompleteTriggerDirective = class NtAutocompleteTriggerDirective {
    constructor(_element, _overlay, _viewContainerRef, _zone, _changeDetectorRef, scrollStrategy, _dir, _document, _viewportRuler) {
        this._element = _element;
        this._overlay = _overlay;
        this._viewContainerRef = _viewContainerRef;
        this._zone = _zone;
        this._changeDetectorRef = _changeDetectorRef;
        this._dir = _dir;
        this._document = _document;
        this._viewportRuler = _viewportRuler;
        this._componentDestroyed = false;
        this._autocompleteDisabled = false;
        this._manuallyFloatingLabel = false;
        this._viewportSubscription = Subscription.EMPTY;
        this._canOpenOnNextFocus = true;
        this._closeKeyEventStream = new Subject();
        this._windowBlurHandler = () => {
            this._canOpenOnNextFocus =
                this._document.activeElement !== this._element.nativeElement || this.panelOpen;
        };
        this._onChange = () => { };
        this._onTouched = () => { };
        this.position = 'auto';
        this.autocompleteAttribute = 'off';
        this._overlayAttached = false;
        this.optionSelections = defer(() => {
            if (this.autocomplete && this.autocomplete.options) {
                return merge(...this.autocomplete.options.map(option => option.selectionChange));
            }
            return this._zone.onStable
                .asObservable()
                .pipe(take(1), switchMap(() => this.optionSelections));
        });
        this._scrollStrategy = scrollStrategy;
    }
    get autocompleteDisabled() { return this._autocompleteDisabled; }
    set autocompleteDisabled(value) {
        this._autocompleteDisabled = coerceBooleanProperty(value);
    }
    ngAfterViewInit() {
        const window = this._getWindow();
        if (typeof window !== 'undefined') {
            this._zone.runOutsideAngular(() => {
                window.addEventListener('blur', this._windowBlurHandler);
            });
        }
    }
    ngOnChanges(changes) {
        if (changes['position'] && this._positionStrategy) {
            this._setStrategyPositions(this._positionStrategy);
            if (this.panelOpen) {
                this._overlayRef.updatePosition();
            }
        }
    }
    ngOnDestroy() {
        const window = this._getWindow();
        if (typeof window !== 'undefined') {
            window.removeEventListener('blur', this._windowBlurHandler);
        }
        this._viewportSubscription.unsubscribe();
        this._componentDestroyed = true;
        this._destroyPanel();
        this._closeKeyEventStream.complete();
    }
    get panelOpen() {
        return this._overlayAttached && this.autocomplete.showPanel;
    }
    openPanel() {
        this._attachOverlay();
    }
    closePanel() {
        this._resetLabel();
        if (!this._overlayAttached) {
            return;
        }
        if (this.panelOpen) {
            this.autocomplete.closed.emit();
        }
        this.autocomplete._isOpen = this._overlayAttached = false;
        if (this._overlayRef && this._overlayRef.hasAttached()) {
            this._overlayRef.detach();
            this._closingActionsSubscription.unsubscribe();
        }
        if (!this._componentDestroyed) {
            this._changeDetectorRef.detectChanges();
        }
    }
    updatePosition() {
        if (this._overlayAttached) {
            this._overlayRef.updatePosition();
        }
    }
    get panelClosingActions() {
        return merge(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)), this._closeKeyEventStream, this._getOutsideClickStream(), this._overlayRef ?
            this._overlayRef.detachments().pipe(filter(() => this._overlayAttached)) :
            of()).pipe(map(event => event instanceof NtOptionSelectionChange ? event : null));
    }
    get activeOption() {
        if (this.autocomplete && this.autocomplete._keyManager) {
            return this.autocomplete._keyManager.activeItem;
        }
        return null;
    }
    writeValue(value) {
        Promise.resolve(null).then(() => this._setTriggerValue(value));
    }
    registerOnChange(fn) {
        this._onChange = fn;
    }
    registerOnTouched(fn) {
        this._onTouched = fn;
    }
    setDisabledState(isDisabled) {
        this._element.nativeElement.disabled = isDisabled;
    }
    _handleKeydown(event) {
        const keyCode = event.keyCode;
        if (keyCode === ESCAPE) {
            event.preventDefault();
        }
        if (this.activeOption && keyCode === ENTER && this.panelOpen) {
            this.activeOption.selectViaInteraction();
            this._resetActiveItem();
            event.preventDefault();
        }
        else if (this.autocomplete) {
            const prevActiveItem = this.autocomplete._keyManager.activeItem;
            const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
            if (this.panelOpen || keyCode === TAB) {
                this.autocomplete._keyManager.onKeydown(event);
            }
            else if (isArrowKey && this._canOpen()) {
                this.openPanel();
            }
            if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {
                this._scrollToOption();
            }
        }
    }
    _handleInput(event) {
        let target = event.target;
        let value = target.value;
        if (target.type === 'number') {
            value = value === '' ? null : parseFloat(value);
        }
        if (this._previousValue !== value) {
            this._previousValue = value;
            this._onChange(value);
            if (this._canOpen() && this._document.activeElement === event.target) {
                this.openPanel();
            }
        }
    }
    _handleFocus() {
        if (!this._canOpenOnNextFocus) {
            this._canOpenOnNextFocus = true;
        }
        else if (this._canOpen()) {
            this._previousValue = this._element.nativeElement.value;
            this._attachOverlay();
        }
    }
    _getOutsideClickStream() {
        return fromOutsideElementClick([
            this._element.nativeElement,
            this.autocomplete.panel.nativeElement
        ], this._document);
    }
    _resetLabel() {
        if (this._manuallyFloatingLabel) {
            this._manuallyFloatingLabel = false;
        }
    }
    _scrollToOption() {
        const activeOption = this.autocomplete._keyManager.activeItem || this.autocomplete.options.first;
        if (!activeOption) {
            return;
        }
        const panelElement = this.autocomplete.panel.nativeElement;
        const panelScrollTop = panelElement.scrollTop;
        const panelScrollBottom = panelScrollTop + panelElement.offsetHeight;
        if (panelScrollBottom === 0) {
            panelElement.scrollTop = activeOption.getOffsetTop();
        }
        else if (activeOption.getOffsetTop() < panelScrollTop) {
            panelElement.scrollTop = activeOption.getOffsetTop();
        }
        else if (activeOption.getOffsetTop() + activeOption.getOffsetHeight() >= panelScrollBottom) {
            const scrollOffset = panelElement.offsetHeight - activeOption.getOffsetHeight();
            panelElement.scrollTop = activeOption.getOffsetTop() - scrollOffset;
        }
    }
    _subscribeToClosingActions() {
        const firstStable = this._zone.onStable.asObservable().pipe(take(1));
        const optionChanges = this.autocomplete.options.changes.pipe(tap(() => this._positionStrategy.reapplyLastPosition()), delay(0));
        return merge(firstStable, optionChanges)
            .pipe(switchMap(() => {
            const wasOpen = this.panelOpen;
            this._resetActiveItem();
            this.autocomplete._setVisibility();
            if (this.panelOpen) {
                this._overlayRef.updatePosition();
                if (wasOpen !== this.panelOpen) {
                    this.autocomplete.opened.emit();
                }
            }
            return this.panelClosingActions;
        }), take(1))
            .subscribe(event => this._setValueAndClose(event));
    }
    _destroyPanel() {
        if (this._overlayRef) {
            this.closePanel();
            this._overlayRef.dispose();
            this._overlayRef = null;
        }
    }
    _setTriggerValue(value) {
        const toDisplay = this.autocomplete && this.autocomplete.displayWith ?
            this.autocomplete.displayWith(value) :
            value;
        const inputValue = toDisplay != null ? toDisplay : '';
        this._element.nativeElement.value = inputValue;
        this._previousValue = inputValue;
    }
    _setValueAndClose(event) {
        if (event && event.source) {
            this._clearPreviousSelectedOption();
            this._setTriggerValue(event.source.value);
            this._onChange(event.source.value);
            this._element.nativeElement.focus();
            this.autocomplete._emitSelectEvent(event.source);
        }
        this.closePanel();
    }
    _clearPreviousSelectedOption() {
        this.autocomplete.options.forEach(option => {
            if (option.selected) {
                option.deselect();
            }
        });
    }
    _attachOverlay() {
        if (!this.autocomplete) {
            throw getMatAutocompleteMissingPanelError();
        }
        let overlayRef = this._overlayRef;
        if (!overlayRef) {
            this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef);
            overlayRef = this._overlay.create(this._getOverlayConfig());
            this._overlayRef = overlayRef;
            overlayRef.keydownEvents().subscribe(event => {
                if (event.keyCode === ESCAPE || (event.keyCode === UP_ARROW && event.altKey)) {
                    this._resetActiveItem();
                    this._closeKeyEventStream.next();
                    event.stopPropagation();
                    event.preventDefault();
                }
            });
            if (this._viewportRuler) {
                this._viewportSubscription = this._viewportRuler.change().subscribe(() => {
                    if (this.panelOpen && overlayRef) {
                        overlayRef.updateSize({ width: this._getPanelWidth() });
                    }
                });
            }
        }
        else {
            this._positionStrategy.setOrigin(this._getConnectedElement());
            overlayRef.updateSize({ width: this._getPanelWidth() });
        }
        if (overlayRef && !overlayRef.hasAttached()) {
            overlayRef.attach(this._portal);
            this._closingActionsSubscription = this._subscribeToClosingActions();
        }
        const wasOpen = this.panelOpen;
        this.autocomplete._setVisibility();
        this.autocomplete._isOpen = this._overlayAttached = true;
        if (this.panelOpen && wasOpen !== this.panelOpen) {
            this.autocomplete.opened.emit();
        }
    }
    _getOverlayConfig() {
        return new OverlayConfig({
            positionStrategy: this._getOverlayPosition(),
            scrollStrategy: this._scrollStrategy(),
            width: this._getPanelWidth(),
            direction: this._dir
        });
    }
    _getOverlayPosition() {
        const strategy = this._overlay.position()
            .flexibleConnectedTo(this._getConnectedElement())
            .withFlexibleDimensions(false)
            .withPush(false);
        this._setStrategyPositions(strategy);
        this._positionStrategy = strategy;
        return strategy;
    }
    _setStrategyPositions(positionStrategy) {
        const belowPositions = [BOTTOM_LEFT, TOP_LEFT];
        const abovePositions = [TOP_LEFT, BOTTOM_LEFT];
        let positions;
        if (this.position === 'above') {
            positions = abovePositions;
        }
        else if (this.position === 'below') {
            positions = belowPositions;
        }
        else {
            positions = [...belowPositions, ...abovePositions];
        }
        positionStrategy.withPositions(positions);
    }
    _getConnectedElement() {
        if (this.connectedTo) {
            return this.connectedTo.elementRef;
        }
        return this._element;
    }
    _getPanelWidth() {
        return this.autocomplete.panelWidth || this._getHostWidth();
    }
    _getHostWidth() {
        return this._getConnectedElement().nativeElement.getBoundingClientRect().width;
    }
    _resetActiveItem() {
        this.autocomplete._keyManager.setActiveItem(this.autocomplete.autoActiveFirstOption ? 0 : -1);
    }
    _canOpen() {
        const element = this._element.nativeElement;
        return !element.readOnly && !element.disabled && !this._autocompleteDisabled;
    }
    _getWindow() {
        var _a;
        return ((_a = this._document) === null || _a === void 0 ? void 0 : _a.defaultView) || window;
    }
};
NtAutocompleteTriggerDirective.ctorParameters = () => [
    { type: ElementRef },
    { type: Overlay },
    { type: ViewContainerRef },
    { type: NgZone },
    { type: ChangeDetectorRef },
    { type: undefined, decorators: [{ type: Inject, args: [NT_AUTOCOMPLETE_SCROLL_STRATEGY,] }] },
    { type: Directionality, decorators: [{ type: Optional }] },
    { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
    { type: ViewportRuler }
];
__decorate$1([
    Input('ntAutocomplete')
], NtAutocompleteTriggerDirective.prototype, "autocomplete", void 0);
__decorate$1([
    Input('ntAutocompleteConnectedTo')
], NtAutocompleteTriggerDirective.prototype, "connectedTo", void 0);
__decorate$1([
    Input('ntAutocompletePosition')
], NtAutocompleteTriggerDirective.prototype, "position", void 0);
__decorate$1([
    Input('autocomplete')
], NtAutocompleteTriggerDirective.prototype, "autocompleteAttribute", void 0);
__decorate$1([
    Input('ntAutocompleteDisabled')
], NtAutocompleteTriggerDirective.prototype, "autocompleteDisabled", null);
NtAutocompleteTriggerDirective = __decorate$1([
    Directive({
        selector: 'input[ntAutocomplete], textarea[ntAutocomplete]',
        host: {
            'class': 'nt-autocomplete-trigger',
            '(focusin)': '_handleFocus()',
            '(blur)': '_onTouched()',
            '(input)': '_handleInput($event)',
            '(keydown)': '_handleKeydown($event)',
        },
        exportAs: 'ntAutocompleteTrigger',
        providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR]
    }),
    __param(5, Inject(NT_AUTOCOMPLETE_SCROLL_STRATEGY)),
    __param(6, Optional()),
    __param(7, Optional()), __param(7, Inject(DOCUMENT))
], NtAutocompleteTriggerDirective);

var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param$1 = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var NtAutocompleteComponent_1;
let _uniqueIdCounter = 0;
class NtAutocompleteSelectedEvent {
    constructor(source, option) {
        this.source = source;
        this.option = option;
    }
}
const NT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('nt-autocomplete-default-options', {
    providedIn: 'root',
    factory: NT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY,
});
function NT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
    return { autoActiveFirstOption: false };
}
let NtAutocompleteComponent = NtAutocompleteComponent_1 = class NtAutocompleteComponent {
    constructor(_changeDetectorRef, _elementRef, defaults) {
        this._changeDetectorRef = _changeDetectorRef;
        this._elementRef = _elementRef;
        this._activeOptionChanges = Subscription.EMPTY;
        this.showPanel = false;
        this._isOpen = false;
        this.displayWith = null;
        this.optionSelected = new EventEmitter();
        this.opened = new EventEmitter();
        this.closed = new EventEmitter();
        this.optionActivated = new EventEmitter();
        this._classList = {};
        this.id = `nt-autocomplete-${_uniqueIdCounter++}`;
        this._autoActiveFirstOption = !!defaults.autoActiveFirstOption;
    }
    get isOpen() { return this._isOpen && this.showPanel; }
    get autoActiveFirstOption() { return this._autoActiveFirstOption; }
    set autoActiveFirstOption(value) {
        this._autoActiveFirstOption = coerceBooleanProperty(value);
    }
    set classList(value) {
        if (value && value.length) {
            this._classList = value.split(' ').reduce((classList, className) => {
                classList[className.trim()] = true;
                return classList;
            }, {});
        }
        else {
            this._classList = {};
        }
        this._setVisibilityClasses(this._classList);
        this._elementRef.nativeElement.className = '';
    }
    ngAfterContentInit() {
        this._keyManager = new ActiveDescendantKeyManager(this.options).withWrap();
        this._activeOptionChanges = this._keyManager.change.subscribe(index => {
            this.optionActivated.emit({ source: this, option: this.options.toArray()[index] || null });
        });
        this._setVisibility();
    }
    ngOnDestroy() {
        this._activeOptionChanges.unsubscribe();
    }
    _setScrollTop(scrollTop) {
        if (this.panel) {
            this.panel.nativeElement.scrollTop = scrollTop;
        }
    }
    _getScrollTop() {
        return this.panel ? this.panel.nativeElement.scrollTop : 0;
    }
    _setVisibility() {
        this.showPanel = !!this.options.length;
        this._setVisibilityClasses(this._classList);
        this._changeDetectorRef.markForCheck();
    }
    _emitSelectEvent(option) {
        const event = new NtAutocompleteSelectedEvent(this, option);
        this.optionSelected.emit(event);
    }
    _setVisibilityClasses(classList) {
        classList['mat-autocomplete-visible'] = this.showPanel;
        classList['mat-autocomplete-hidden'] = !this.showPanel;
    }
};
NtAutocompleteComponent.ctorParameters = () => [
    { type: ChangeDetectorRef },
    { type: ElementRef },
    { type: undefined, decorators: [{ type: Inject, args: [NT_AUTOCOMPLETE_DEFAULT_OPTIONS,] }] }
];
__decorate$2([
    ViewChild(TemplateRef, { static: true })
], NtAutocompleteComponent.prototype, "template", void 0);
__decorate$2([
    ViewChild('panel')
], NtAutocompleteComponent.prototype, "panel", void 0);
__decorate$2([
    ContentChildren(NtOptionComponent, { descendants: true })
], NtAutocompleteComponent.prototype, "options", void 0);
__decorate$2([
    Input()
], NtAutocompleteComponent.prototype, "displayWith", void 0);
__decorate$2([
    Input()
], NtAutocompleteComponent.prototype, "autoActiveFirstOption", null);
__decorate$2([
    Input()
], NtAutocompleteComponent.prototype, "panelWidth", void 0);
__decorate$2([
    Output()
], NtAutocompleteComponent.prototype, "optionSelected", void 0);
__decorate$2([
    Output()
], NtAutocompleteComponent.prototype, "opened", void 0);
__decorate$2([
    Output()
], NtAutocompleteComponent.prototype, "closed", void 0);
__decorate$2([
    Output()
], NtAutocompleteComponent.prototype, "optionActivated", void 0);
__decorate$2([
    Input('class')
], NtAutocompleteComponent.prototype, "classList", null);
NtAutocompleteComponent = NtAutocompleteComponent_1 = __decorate$2([
    Component({
        selector: 'nt-autocomplete',
        template: "<!--\n<nt-overlay\n  overlayClass=\"nt-autocomplete-overlay\"\n  [origin]=\"origin\"\n  [positionPairs]=\"_positionPairs\"\n  (afterOpen)=\"_afterOpen($event)\"\n  (afterClosed)=\"_afterClosed($event)\"\n  (beforeOpen)=\"_beforeOpen($event)\"\n  (beforeClosed)=\"_beforeClosed($event)\"\n  (positionChange)=\"_positionChange($event)\"\n  (keydownEvents)=\"_handleKeydown($event)\">\n  <div #paneElement\n      class=\"nt-select-pane\"\n      [class.folded]=\"state === 'folded'\"\n      [style.width.px]=\"width\">\n    <ng-content select=\"nt-option\"></ng-content>\n    <div class=\"filter-empty\" [hidden]=\"!optionEmpty\">\n      {{ filterNotFound }}\n    </div>\n  </div>\n</nt-overlay> -->\n<ng-template>\n  <div class=\"nt-autocomplete-panel\" role=\"listbox\" [id]=\"id\" [ngClass]=\"_classList\" #panel>\n    <ng-content></ng-content>\n  </div>\n</ng-template>\n",
        encapsulation: ViewEncapsulation.None,
        changeDetection: ChangeDetectionStrategy.OnPush,
        exportAs: 'ntAutocomplete',
        host: {
            'class': 'nt-autocomplete'
        },
        providers: [
            { provide: NT_OPTION_PARENT_COMPONENT, useExisting: NtAutocompleteComponent_1 }
        ]
    }),
    __param$1(2, Inject(NT_AUTOCOMPLETE_DEFAULT_OPTIONS))
], NtAutocompleteComponent);

var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let NtAutocompleteModule = class NtAutocompleteModule {
};
NtAutocompleteModule = __decorate$3([
    NgModule({
        imports: [
            CommonModule,
            NtOptionModule
        ],
        exports: [
            NtAutocompleteComponent,
            NtAutocompleteTriggerDirective,
            NtAutocompleteOriginDirective,
            NtOptionModule
        ],
        declarations: [
            NtAutocompleteComponent,
            NtAutocompleteTriggerDirective,
            NtAutocompleteOriginDirective
        ],
        providers: [NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER]
    })
], NtAutocompleteModule);

export { MAT_AUTOCOMPLETE_VALUE_ACCESSOR, NT_AUTOCOMPLETE_DEFAULT_OPTIONS, NT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, NT_AUTOCOMPLETE_SCROLL_STRATEGY, NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, NT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, NtAutocompleteComponent, NtAutocompleteModule, NtAutocompleteOriginDirective, NtAutocompleteSelectedEvent, NtAutocompleteTriggerDirective, getMatAutocompleteMissingPanelError };
//# sourceMappingURL=autocomplete.js.map
