text: import { EventEmitter, Component, Renderer2, ElementRef, ChangeDetectorRef, Output, ViewChild, ViewChildren, HostListener, Injectable, ɵɵdefineInjectable, Directive, ViewContainerRef, Input, NgModule } from '@angular/core';
  import { isBs3, Utils } from 'ngx-bootstrap/utils';
  import { PositioningService } from 'ngx-bootstrap/positioning';
  import { trigger, state, style, transition, animate } from '@angular/animations';
  import { NgControl } from '@angular/forms';
  import { isObservable, from } from 'rxjs';
  import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
  import { debounceTime, tap, switchMap, mergeMap, filter, toArray } from 'rxjs/operators';
  import { CommonModule } from '@angular/common';
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /* tslint:disable */
  /** @type {?} */
  import * as ɵngcc0 from '@angular/core';
  import * as ɵngcc1 from 'ngx-bootstrap/positioning';
  import * as ɵngcc2 from '@angular/common';
  import * as ɵngcc3 from 'ngx-bootstrap/component-loader';
  import * as ɵngcc4 from '@angular/forms';
  
  const _c0 = ["ulElement"];
  const _c1 = ["liElements"];
  function TypeaheadContainerComponent_ng_template_0_Template(rf, ctx) { }
  function TypeaheadContainerComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵelement(0, "span", 4);
  } if (rf & 2) {
      const match_r7 = ctx.match;
      const query_r8 = ctx.query;
      const ctx_r2 = ɵngcc0.ɵɵnextContext();
      ɵngcc0.ɵɵproperty("innerHtml", ctx_r2.highlight(match_r7, query_r8), ɵngcc0.ɵɵsanitizeHtml);
  } }
  function TypeaheadContainerComponent_ng_template_3_ng_template_2_li_0_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵelementStart(0, "li", 10, 11);
      ɵngcc0.ɵɵtext(2);
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      const match_r11 = ɵngcc0.ɵɵnextContext().$implicit;
      ɵngcc0.ɵɵadvance(2);
      ɵngcc0.ɵɵtextInterpolate(match_r11);
  } }
  function TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_ng_template_3_Template(rf, ctx) { }
  const _c2 = function (a0, a1, a2, a3) { return { item: a0, index: a1, match: a2, query: a3 }; };
  function TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_Template(rf, ctx) { if (rf & 1) {
      const _r21 = ɵngcc0.ɵɵgetCurrentView();
      ɵngcc0.ɵɵelementStart(0, "li", 12, 11);
      ɵngcc0.ɵɵlistener("mouseenter", function TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_Template_li_mouseenter_0_listener() { ɵngcc0.ɵɵrestoreView(_r21); const match_r11 = ɵngcc0.ɵɵnextContext().$implicit; const ctx_r19 = ɵngcc0.ɵɵnextContext(2); return ctx_r19.selectActive(match_r11); });
      ɵngcc0.ɵɵelementStart(2, "a", 13);
      ɵngcc0.ɵɵlistener("click", function TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_Template_a_click_2_listener($event) { ɵngcc0.ɵɵrestoreView(_r21); const match_r11 = ɵngcc0.ɵɵnextContext().$implicit; const ctx_r22 = ɵngcc0.ɵɵnextContext(2); return ctx_r22.selectMatch(match_r11, $event); });
      ɵngcc0.ɵɵtemplate(3, TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_ng_template_3_Template, 0, 0, "ng-template", 0);
      ɵngcc0.ɵɵelementEnd();
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      const ctx_r24 = ɵngcc0.ɵɵnextContext();
      const match_r11 = ctx_r24.$implicit;
      const i_r12 = ctx_r24.index;
      const ctx_r14 = ɵngcc0.ɵɵnextContext(2);
      const _r1 = ɵngcc0.ɵɵreference(2);
      ɵngcc0.ɵɵclassProp("active", ctx_r14.isActive(match_r11));
      ɵngcc0.ɵɵproperty("id", ctx_r14.popupId + "-" + i_r12)("@typeaheadAnimation", ctx_r14.animationState);
      ɵngcc0.ɵɵadvance(3);
      ɵngcc0.ɵɵproperty("ngTemplateOutlet", ctx_r14.itemTemplate || _r1)("ngTemplateOutletContext", ɵngcc0.ɵɵpureFunction4(6, _c2, match_r11.item, i_r12, match_r11, ctx_r14.query));
  } }
  function TypeaheadContainerComponent_ng_template_3_ng_template_2_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵtemplate(0, TypeaheadContainerComponent_ng_template_3_ng_template_2_li_0_Template, 3, 1, "li", 8);
      ɵngcc0.ɵɵtemplate(1, TypeaheadContainerComponent_ng_template_3_ng_template_2_li_1_Template, 4, 11, "li", 9);
  } if (rf & 2) {
      const match_r11 = ctx.$implicit;
      ɵngcc0.ɵɵproperty("ngIf", match_r11.isHeader());
      ɵngcc0.ɵɵadvance(1);
      ɵngcc0.ɵɵproperty("ngIf", !match_r11.isHeader());
  } }
  function TypeaheadContainerComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵelementStart(0, "ul", 5, 6);
      ɵngcc0.ɵɵtemplate(2, TypeaheadContainerComponent_ng_template_3_ng_template_2_Template, 2, 2, "ng-template", 7);
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      const ctx_r4 = ɵngcc0.ɵɵnextContext();
      ɵngcc0.ɵɵstyleProp("overflow-y", ctx_r4.needScrollbar ? "scroll" : "auto")("height", ctx_r4.needScrollbar ? ctx_r4.guiHeight : "auto");
      ɵngcc0.ɵɵadvance(2);
      ɵngcc0.ɵɵproperty("ngForOf", ctx_r4.matches);
  } }
  function TypeaheadContainerComponent_ng_template_5_ng_template_0_h6_0_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵelementStart(0, "h6", 10);
      ɵngcc0.ɵɵtext(1);
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      const match_r26 = ɵngcc0.ɵɵnextContext().$implicit;
      ɵngcc0.ɵɵadvance(1);
      ɵngcc0.ɵɵtextInterpolate(match_r26);
  } }
  function TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_ng_template_2_Template(rf, ctx) { }
  function TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_Template(rf, ctx) { if (rf & 1) {
      const _r35 = ɵngcc0.ɵɵgetCurrentView();
      ɵngcc0.ɵɵelementStart(0, "button", 15, 11);
      ɵngcc0.ɵɵlistener("click", function TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_Template_button_click_0_listener($event) { ɵngcc0.ɵɵrestoreView(_r35); const match_r26 = ɵngcc0.ɵɵnextContext().$implicit; const ctx_r33 = ɵngcc0.ɵɵnextContext(2); return ctx_r33.selectMatch(match_r26, $event); })("mouseenter", function TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_Template_button_mouseenter_0_listener() { ɵngcc0.ɵɵrestoreView(_r35); const match_r26 = ɵngcc0.ɵɵnextContext().$implicit; const ctx_r36 = ɵngcc0.ɵɵnextContext(2); return ctx_r36.selectActive(match_r26); });
      ɵngcc0.ɵɵtemplate(2, TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_ng_template_2_Template, 0, 0, "ng-template", 0);
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      const ctx_r38 = ɵngcc0.ɵɵnextContext();
      const match_r26 = ctx_r38.$implicit;
      const i_r27 = ctx_r38.index;
      const ctx_r29 = ɵngcc0.ɵɵnextContext(2);
      const _r1 = ɵngcc0.ɵɵreference(2);
      ɵngcc0.ɵɵclassProp("active", ctx_r29.isActive(match_r26));
      ɵngcc0.ɵɵproperty("id", ctx_r29.popupId + "-" + i_r27)("@typeaheadAnimation", ctx_r29.animationState);
      ɵngcc0.ɵɵadvance(2);
      ɵngcc0.ɵɵproperty("ngTemplateOutlet", ctx_r29.itemTemplate || _r1)("ngTemplateOutletContext", ɵngcc0.ɵɵpureFunction4(6, _c2, match_r26.item, i_r27, match_r26, ctx_r29.query));
  } }
  function TypeaheadContainerComponent_ng_template_5_ng_template_0_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵtemplate(0, TypeaheadContainerComponent_ng_template_5_ng_template_0_h6_0_Template, 2, 1, "h6", 8);
      ɵngcc0.ɵɵtemplate(1, TypeaheadContainerComponent_ng_template_5_ng_template_0_ng_template_1_Template, 3, 11, "ng-template", 14);
  } if (rf & 2) {
      const match_r26 = ctx.$implicit;
      ɵngcc0.ɵɵproperty("ngIf", match_r26.isHeader());
      ɵngcc0.ɵɵadvance(1);
      ɵngcc0.ɵɵproperty("ngIf", !match_r26.isHeader());
  } }
  function TypeaheadContainerComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵtemplate(0, TypeaheadContainerComponent_ng_template_5_ng_template_0_Template, 2, 2, "ng-template", 7);
  } if (rf & 2) {
      const ctx_r6 = ɵngcc0.ɵɵnextContext();
      ɵngcc0.ɵɵproperty("ngForOf", ctx_r6.matches);
  } }
  const _c3 = function (a0, a1, a2, a3) { return { matches: a0, itemTemplate: a1, query: a2, $implicit: a3 }; };
  const latinMap = {
      'Á': 'A',
      'Ă': 'A',
      'Ắ': 'A',
      'Ặ': 'A',
      'Ằ': 'A',
      'Ẳ': 'A',
      'Ẵ': 'A',
      'Ǎ': 'A',
      'Â': 'A',
      'Ấ': 'A',
      'Ậ': 'A',
      'Ầ': 'A',
      'Ẩ': 'A',
      'Ẫ': 'A',
      'Ä': 'A',
      'Ǟ': 'A',
      'Ȧ': 'A',
      'Ǡ': 'A',
      'Ạ': 'A',
      'Ȁ': 'A',
      'À': 'A',
      'Ả': 'A',
      'Ȃ': 'A',
      'Ā': 'A',
      'Ą': 'A',
      'Å': 'A',
      'Ǻ': 'A',
      'Ḁ': 'A',
      'Ⱥ': 'A',
      'Ã': 'A',
      'Ꜳ': 'AA',
      'Æ': 'AE',
      'Ǽ': 'AE',
      'Ǣ': 'AE',
      'Ꜵ': 'AO',
      'Ꜷ': 'AU',
      'Ꜹ': 'AV',
      'Ꜻ': 'AV',
      'Ꜽ': 'AY',
      'Ḃ': 'B',
      'Ḅ': 'B',
      'Ɓ': 'B',
      'Ḇ': 'B',
      'Ƀ': 'B',
      'Ƃ': 'B',
      'Ć': 'C',
      'Č': 'C',
      'Ç': 'C',
      'Ḉ': 'C',
      'Ĉ': 'C',
      'Ċ': 'C',
      'Ƈ': 'C',
      'Ȼ': 'C',
      'Ď': 'D',
      'Ḑ': 'D',
      'Ḓ': 'D',
      'Ḋ': 'D',
      'Ḍ': 'D',
      'Ɗ': 'D',
      'Ḏ': 'D',
      'ǲ': 'D',
      'ǅ': 'D',
      'Đ': 'D',
      'Ƌ': 'D',
      'Ǳ': 'DZ',
      'Ǆ': 'DZ',
      'É': 'E',
      'Ĕ': 'E',
      'Ě': 'E',
      'Ȩ': 'E',
      'Ḝ': 'E',
      'Ê': 'E',
      'Ế': 'E',
      'Ệ': 'E',
      'Ề': 'E',
      'Ể': 'E',
      'Ễ': 'E',
      'Ḙ': 'E',
      'Ë': 'E',
      'Ė': 'E',
      'Ẹ': 'E',
      'Ȅ': 'E',
      'È': 'E',
      'Ẻ': 'E',
      'Ȇ': 'E',
      'Ē': 'E',
      'Ḗ': 'E',
      'Ḕ': 'E',
      'Ę': 'E',
      'Ɇ': 'E',
      'Ẽ': 'E',
      'Ḛ': 'E',
      'Ꝫ': 'ET',
      'Ḟ': 'F',
      'Ƒ': 'F',
      'Ǵ': 'G',
      'Ğ': 'G',
      'Ǧ': 'G',
      'Ģ': 'G',
      'Ĝ': 'G',
      'Ġ': 'G',
      'Ɠ': 'G',
      'Ḡ': 'G',
      'Ǥ': 'G',
      'Ḫ': 'H',
      'Ȟ': 'H',
      'Ḩ': 'H',
      'Ĥ': 'H',
      'Ⱨ': 'H',
      'Ḧ': 'H',
      'Ḣ': 'H',
      'Ḥ': 'H',
      'Ħ': 'H',
      'Í': 'I',
      'Ĭ': 'I',
      'Ǐ': 'I',
      'Î': 'I',
      'Ï': 'I',
      'Ḯ': 'I',
      'İ': 'I',
      'Ị': 'I',
      'Ȉ': 'I',
      'Ì': 'I',
      'Ỉ': 'I',
      'Ȋ': 'I',
      'Ī': 'I',
      'Į': 'I',
      'Ɨ': 'I',
      'Ĩ': 'I',
      'Ḭ': 'I',
      'Ꝺ': 'D',
      'Ꝼ': 'F',
      'Ᵹ': 'G',
      'Ꞃ': 'R',
      'Ꞅ': 'S',
      'Ꞇ': 'T',
      'Ꝭ': 'IS',
      'Ĵ': 'J',
      'Ɉ': 'J',
      'Ḱ': 'K',
      'Ǩ': 'K',
      'Ķ': 'K',
      'Ⱪ': 'K',
      'Ꝃ': 'K',
      'Ḳ': 'K',
      'Ƙ': 'K',
      'Ḵ': 'K',
      'Ꝁ': 'K',
      'Ꝅ': 'K',
      'Ĺ': 'L',
      'Ƚ': 'L',
      'Ľ': 'L',
      'Ļ': 'L',
      'Ḽ': 'L',
      'Ḷ': 'L',
      'Ḹ': 'L',
      'Ⱡ': 'L',
      'Ꝉ': 'L',
      'Ḻ': 'L',
      'Ŀ': 'L',
      'Ɫ': 'L',
      'ǈ': 'L',
      'Ł': 'L',
      'Ǉ': 'LJ',
      'Ḿ': 'M',
      'Ṁ': 'M',
      'Ṃ': 'M',
      'Ɱ': 'M',
      'Ń': 'N',
      'Ň': 'N',
      'Ņ': 'N',
      'Ṋ': 'N',
      'Ṅ': 'N',
      'Ṇ': 'N',
      'Ǹ': 'N',
      'Ɲ': 'N',
      'Ṉ': 'N',
      'Ƞ': 'N',
      'ǋ': 'N',
      'Ñ': 'N',
      'Ǌ': 'NJ',
      'Ó': 'O',
      'Ŏ': 'O',
      'Ǒ': 'O',
      'Ô': 'O',
      'Ố': 'O',
      'Ộ': 'O',
      'Ồ': 'O',
      'Ổ': 'O',
      'Ỗ': 'O',
      'Ö': 'O',
      'Ȫ': 'O',
      'Ȯ': 'O',
      'Ȱ': 'O',
      'Ọ': 'O',
      'Ő': 'O',
      'Ȍ': 'O',
      'Ò': 'O',
      'Ỏ': 'O',
      'Ơ': 'O',
      'Ớ': 'O',
      'Ợ': 'O',
      'Ờ': 'O',
      'Ở': 'O',
      'Ỡ': 'O',
      'Ȏ': 'O',
      'Ꝋ': 'O',
      'Ꝍ': 'O',
      'Ō': 'O',
      'Ṓ': 'O',
      'Ṑ': 'O',
      'Ɵ': 'O',
      'Ǫ': 'O',
      'Ǭ': 'O',
      'Ø': 'O',
      'Ǿ': 'O',
      'Õ': 'O',
      'Ṍ': 'O',
      'Ṏ': 'O',
      'Ȭ': 'O',
      'Ƣ': 'OI',
      'Ꝏ': 'OO',
      'Ɛ': 'E',
      'Ɔ': 'O',
      'Ȣ': 'OU',
      'Ṕ': 'P',
      'Ṗ': 'P',
      'Ꝓ': 'P',
      'Ƥ': 'P',
      'Ꝕ': 'P',
      'Ᵽ': 'P',
      'Ꝑ': 'P',
      'Ꝙ': 'Q',
      'Ꝗ': 'Q',
      'Ŕ': 'R',
      'Ř': 'R',
      'Ŗ': 'R',
      'Ṙ': 'R',
      'Ṛ': 'R',
      'Ṝ': 'R',
      'Ȑ': 'R',
      'Ȓ': 'R',
      'Ṟ': 'R',
      'Ɍ': 'R',
      'Ɽ': 'R',
      'Ꜿ': 'C',
      'Ǝ': 'E',
      'Ś': 'S',
      'Ṥ': 'S',
      'Š': 'S',
      'Ṧ': 'S',
      'Ş': 'S',
      'Ŝ': 'S',
      'Ș': 'S',
      'Ṡ': 'S',
      'Ṣ': 'S',
      'Ṩ': 'S',
      'Ť': 'T',
      'Ţ': 'T',
      'Ṱ': 'T',
      'Ț': 'T',
      'Ⱦ': 'T',
      'Ṫ': 'T',
      'Ṭ': 'T',
      'Ƭ': 'T',
      'Ṯ': 'T',
      'Ʈ': 'T',
      'Ŧ': 'T',
      'Ɐ': 'A',
      'Ꞁ': 'L',
      'Ɯ': 'M',
      'Ʌ': 'V',
      'Ꜩ': 'TZ',
      'Ú': 'U',
      'Ŭ': 'U',
      'Ǔ': 'U',
      'Û': 'U',
      'Ṷ': 'U',
      'Ü': 'U',
      'Ǘ': 'U',
      'Ǚ': 'U',
      'Ǜ': 'U',
      'Ǖ': 'U',
      'Ṳ': 'U',
      'Ụ': 'U',
      'Ű': 'U',
      'Ȕ': 'U',
      'Ù': 'U',
      'Ủ': 'U',
      'Ư': 'U',
      'Ứ': 'U',
      'Ự': 'U',
      'Ừ': 'U',
      'Ử': 'U',
      'Ữ': 'U',
      'Ȗ': 'U',
      'Ū': 'U',
      'Ṻ': 'U',
      'Ų': 'U',
      'Ů': 'U',
      'Ũ': 'U',
      'Ṹ': 'U',
      'Ṵ': 'U',
      'Ꝟ': 'V',
      'Ṿ': 'V',
      'Ʋ': 'V',
      'Ṽ': 'V',
      'Ꝡ': 'VY',
      'Ẃ': 'W',
      'Ŵ': 'W',
      'Ẅ': 'W',
      'Ẇ': 'W',
      'Ẉ': 'W',
      'Ẁ': 'W',
      'Ⱳ': 'W',
      'Ẍ': 'X',
      'Ẋ': 'X',
      'Ý': 'Y',
      'Ŷ': 'Y',
      'Ÿ': 'Y',
      'Ẏ': 'Y',
      'Ỵ': 'Y',
      'Ỳ': 'Y',
      'Ƴ': 'Y',
      'Ỷ': 'Y',
      'Ỿ': 'Y',
      'Ȳ': 'Y',
      'Ɏ': 'Y',
      'Ỹ': 'Y',
      'Ź': 'Z',
      'Ž': 'Z',
      'Ẑ': 'Z',
      'Ⱬ': 'Z',
      'Ż': 'Z',
      'Ẓ': 'Z',
      'Ȥ': 'Z',
      'Ẕ': 'Z',
      'Ƶ': 'Z',
      'Ĳ': 'IJ',
      'Œ': 'OE',
      'ᴀ': 'A',
      'ᴁ': 'AE',
      'ʙ': 'B',
      'ᴃ': 'B',
      'ᴄ': 'C',
      'ᴅ': 'D',
      'ᴇ': 'E',
      'ꜰ': 'F',
      'ɢ': 'G',
      'ʛ': 'G',
      'ʜ': 'H',
      'ɪ': 'I',
      'ʁ': 'R',
      'ᴊ': 'J',
      'ᴋ': 'K',
      'ʟ': 'L',
      'ᴌ': 'L',
      'ᴍ': 'M',
      'ɴ': 'N',
      'ᴏ': 'O',
      'ɶ': 'OE',
      'ᴐ': 'O',
      'ᴕ': 'OU',
      'ᴘ': 'P',
      'ʀ': 'R',
      'ᴎ': 'N',
      'ᴙ': 'R',
      'ꜱ': 'S',
      'ᴛ': 'T',
      'ⱻ': 'E',
      'ᴚ': 'R',
      'ᴜ': 'U',
      'ᴠ': 'V',
      'ᴡ': 'W',
      'ʏ': 'Y',
      'ᴢ': 'Z',
      'á': 'a',
      'ă': 'a',
      'ắ': 'a',
      'ặ': 'a',
      'ằ': 'a',
      'ẳ': 'a',
      'ẵ': 'a',
      'ǎ': 'a',
      'â': 'a',
      'ấ': 'a',
      'ậ': 'a',
      'ầ': 'a',
      'ẩ': 'a',
      'ẫ': 'a',
      'ä': 'a',
      'ǟ': 'a',
      'ȧ': 'a',
      'ǡ': 'a',
      'ạ': 'a',
      'ȁ': 'a',
      'à': 'a',
      'ả': 'a',
      'ȃ': 'a',
      'ā': 'a',
      'ą': 'a',
      'ᶏ': 'a',
      'ẚ': 'a',
      'å': 'a',
      'ǻ': 'a',
      'ḁ': 'a',
      'ⱥ': 'a',
      'ã': 'a',
      'ꜳ': 'aa',
      'æ': 'ae',
      'ǽ': 'ae',
      'ǣ': 'ae',
      'ꜵ': 'ao',
      'ꜷ': 'au',
      'ꜹ': 'av',
      'ꜻ': 'av',
      'ꜽ': 'ay',
      'ḃ': 'b',
      'ḅ': 'b',
      'ɓ': 'b',
      'ḇ': 'b',
      'ᵬ': 'b',
      'ᶀ': 'b',
      'ƀ': 'b',
      'ƃ': 'b',
      'ɵ': 'o',
      'ć': 'c',
      'č': 'c',
      'ç': 'c',
      'ḉ': 'c',
      'ĉ': 'c',
      'ɕ': 'c',
      'ċ': 'c',
      'ƈ': 'c',
      'ȼ': 'c',
      'ď': 'd',
      'ḑ': 'd',
      'ḓ': 'd',
      'ȡ': 'd',
      'ḋ': 'd',
      'ḍ': 'd',
      'ɗ': 'd',
      'ᶑ': 'd',
      'ḏ': 'd',
      'ᵭ': 'd',
      'ᶁ': 'd',
      'đ': 'd',
      'ɖ': 'd',
      'ƌ': 'd',
      'ı': 'i',
      'ȷ': 'j',
      'ɟ': 'j',
      'ʄ': 'j',
      'ǳ': 'dz',
      'ǆ': 'dz',
      'é': 'e',
      'ĕ': 'e',
      'ě': 'e',
      'ȩ': 'e',
      'ḝ': 'e',
      'ê': 'e',
      'ế': 'e',
      'ệ': 'e',
      'ề': 'e',
      'ể': 'e',
      'ễ': 'e',
      'ḙ': 'e',
      'ë': 'e',
      'ė': 'e',
      'ẹ': 'e',
      'ȅ': 'e',
      'è': 'e',
      'ẻ': 'e',
      'ȇ': 'e',
      'ē': 'e',
      'ḗ': 'e',
      'ḕ': 'e',
      'ⱸ': 'e',
      'ę': 'e',
      'ᶒ': 'e',
      'ɇ': 'e',
      'ẽ': 'e',
      'ḛ': 'e',
      'ꝫ': 'et',
      'ḟ': 'f',
      'ƒ': 'f',
      'ᵮ': 'f',
      'ᶂ': 'f',
      'ǵ': 'g',
      'ğ': 'g',
      'ǧ': 'g',
      'ģ': 'g',
      'ĝ': 'g',
      'ġ': 'g',
      'ɠ': 'g',
      'ḡ': 'g',
      'ᶃ': 'g',
      'ǥ': 'g',
      'ḫ': 'h',
      'ȟ': 'h',
      'ḩ': 'h',
      'ĥ': 'h',
      'ⱨ': 'h',
      'ḧ': 'h',
      'ḣ': 'h',
      'ḥ': 'h',
      'ɦ': 'h',
      'ẖ': 'h',
      'ħ': 'h',
      'ƕ': 'hv',
      'í': 'i',
      'ĭ': 'i',
      'ǐ': 'i',
      'î': 'i',
      'ï': 'i',
      'ḯ': 'i',
      'ị': 'i',
      'ȉ': 'i',
      'ì': 'i',
      'ỉ': 'i',
      'ȋ': 'i',
      'ī': 'i',
      'į': 'i',
      'ᶖ': 'i',
      'ɨ': 'i',
      'ĩ': 'i',
      'ḭ': 'i',
      'ꝺ': 'd',
      'ꝼ': 'f',
      'ᵹ': 'g',
      'ꞃ': 'r',
      'ꞅ': 's',
      'ꞇ': 't',
      'ꝭ': 'is',
      'ǰ': 'j',
      'ĵ': 'j',
      'ʝ': 'j',
      'ɉ': 'j',
      'ḱ': 'k',
      'ǩ': 'k',
      'ķ': 'k',
      'ⱪ': 'k',
      'ꝃ': 'k',
      'ḳ': 'k',
      'ƙ': 'k',
      'ḵ': 'k',
      'ᶄ': 'k',
      'ꝁ': 'k',
      'ꝅ': 'k',
      'ĺ': 'l',
      'ƚ': 'l',
      'ɬ': 'l',
      'ľ': 'l',
      'ļ': 'l',
      'ḽ': 'l',
      'ȴ': 'l',
      'ḷ': 'l',
      'ḹ': 'l',
      'ⱡ': 'l',
      'ꝉ': 'l',
      'ḻ': 'l',
      'ŀ': 'l',
      'ɫ': 'l',
      'ᶅ': 'l',
      'ɭ': 'l',
      'ł': 'l',
      'ǉ': 'lj',
      'ſ': 's',
      'ẜ': 's',
      'ẛ': 's',
      'ẝ': 's',
      'ḿ': 'm',
      'ṁ': 'm',
      'ṃ': 'm',
      'ɱ': 'm',
      'ᵯ': 'm',
      'ᶆ': 'm',
      'ń': 'n',
      'ň': 'n',
      'ņ': 'n',
      'ṋ': 'n',
      'ȵ': 'n',
      'ṅ': 'n',
      'ṇ': 'n',
      'ǹ': 'n',
      'ɲ': 'n',
      'ṉ': 'n',
      'ƞ': 'n',
      'ᵰ': 'n',
      'ᶇ': 'n',
      'ɳ': 'n',
      'ñ': 'n',
      'ǌ': 'nj',
      'ó': 'o',
      'ŏ': 'o',
      'ǒ': 'o',
      'ô': 'o',
      'ố': 'o',
      'ộ': 'o',
      'ồ': 'o',
      'ổ': 'o',
      'ỗ': 'o',
      'ö': 'o',
      'ȫ': 'o',
      'ȯ': 'o',
      'ȱ': 'o',
      'ọ': 'o',
      'ő': 'o',
      'ȍ': 'o',
      'ò': 'o',
      'ỏ': 'o',
      'ơ': 'o',
      'ớ': 'o',
      'ợ': 'o',
      'ờ': 'o',
      'ở': 'o',
      'ỡ': 'o',
      'ȏ': 'o',
      'ꝋ': 'o',
      'ꝍ': 'o',
      'ⱺ': 'o',
      'ō': 'o',
      'ṓ': 'o',
      'ṑ': 'o',
      'ǫ': 'o',
      'ǭ': 'o',
      'ø': 'o',
      'ǿ': 'o',
      'õ': 'o',
      'ṍ': 'o',
      'ṏ': 'o',
      'ȭ': 'o',
      'ƣ': 'oi',
      'ꝏ': 'oo',
      'ɛ': 'e',
      'ᶓ': 'e',
      'ɔ': 'o',
      'ᶗ': 'o',
      'ȣ': 'ou',
      'ṕ': 'p',
      'ṗ': 'p',
      'ꝓ': 'p',
      'ƥ': 'p',
      'ᵱ': 'p',
      'ᶈ': 'p',
      'ꝕ': 'p',
      'ᵽ': 'p',
      'ꝑ': 'p',
      'ꝙ': 'q',
      'ʠ': 'q',
      'ɋ': 'q',
      'ꝗ': 'q',
      'ŕ': 'r',
      'ř': 'r',
      'ŗ': 'r',
      'ṙ': 'r',
      'ṛ': 'r',
      'ṝ': 'r',
      'ȑ': 'r',
      'ɾ': 'r',
      'ᵳ': 'r',
      'ȓ': 'r',
      'ṟ': 'r',
      'ɼ': 'r',
      'ᵲ': 'r',
      'ᶉ': 'r',
      'ɍ': 'r',
      'ɽ': 'r',
      'ↄ': 'c',
      'ꜿ': 'c',
      'ɘ': 'e',
      'ɿ': 'r',
      'ś': 's',
      'ṥ': 's',
      'š': 's',
      'ṧ': 's',
      'ş': 's',
      'ŝ': 's',
      'ș': 's',
      'ṡ': 's',
      'ṣ': 's',
      'ṩ': 's',
      'ʂ': 's',
      'ᵴ': 's',
      'ᶊ': 's',
      'ȿ': 's',
      'ɡ': 'g',
      'ᴑ': 'o',
      'ᴓ': 'o',
      'ᴝ': 'u',
      'ť': 't',
      'ţ': 't',
      'ṱ': 't',
      'ț': 't',
      'ȶ': 't',
      'ẗ': 't',
      'ⱦ': 't',
      'ṫ': 't',
      'ṭ': 't',
      'ƭ': 't',
      'ṯ': 't',
      'ᵵ': 't',
      'ƫ': 't',
      'ʈ': 't',
      'ŧ': 't',
      'ᵺ': 'th',
      'ɐ': 'a',
      'ᴂ': 'ae',
      'ǝ': 'e',
      'ᵷ': 'g',
      'ɥ': 'h',
      'ʮ': 'h',
      'ʯ': 'h',
      'ᴉ': 'i',
      'ʞ': 'k',
      'ꞁ': 'l',
      'ɯ': 'm',
      'ɰ': 'm',
      'ᴔ': 'oe',
      'ɹ': 'r',
      'ɻ': 'r',
      'ɺ': 'r',
      'ⱹ': 'r',
      'ʇ': 't',
      'ʌ': 'v',
      'ʍ': 'w',
      'ʎ': 'y',
      'ꜩ': 'tz',
      'ú': 'u',
      'ŭ': 'u',
      'ǔ': 'u',
      'û': 'u',
      'ṷ': 'u',
      'ü': 'u',
      'ǘ': 'u',
      'ǚ': 'u',
      'ǜ': 'u',
      'ǖ': 'u',
      'ṳ': 'u',
      'ụ': 'u',
      'ű': 'u',
      'ȕ': 'u',
      'ù': 'u',
      'ủ': 'u',
      'ư': 'u',
      'ứ': 'u',
      'ự': 'u',
      'ừ': 'u',
      'ử': 'u',
      'ữ': 'u',
      'ȗ': 'u',
      'ū': 'u',
      'ṻ': 'u',
      'ų': 'u',
      'ᶙ': 'u',
      'ů': 'u',
      'ũ': 'u',
      'ṹ': 'u',
      'ṵ': 'u',
      'ᵫ': 'ue',
      'ꝸ': 'um',
      'ⱴ': 'v',
      'ꝟ': 'v',
      'ṿ': 'v',
      'ʋ': 'v',
      'ᶌ': 'v',
      'ⱱ': 'v',
      'ṽ': 'v',
      'ꝡ': 'vy',
      'ẃ': 'w',
      'ŵ': 'w',
      'ẅ': 'w',
      'ẇ': 'w',
      'ẉ': 'w',
      'ẁ': 'w',
      'ⱳ': 'w',
      'ẘ': 'w',
      'ẍ': 'x',
      'ẋ': 'x',
      'ᶍ': 'x',
      'ý': 'y',
      'ŷ': 'y',
      'ÿ': 'y',
      'ẏ': 'y',
      'ỵ': 'y',
      'ỳ': 'y',
      'ƴ': 'y',
      'ỷ': 'y',
      'ỿ': 'y',
      'ȳ': 'y',
      'ẙ': 'y',
      'ɏ': 'y',
      'ỹ': 'y',
      'ź': 'z',
      'ž': 'z',
      'ẑ': 'z',
      'ʑ': 'z',
      'ⱬ': 'z',
      'ż': 'z',
      'ẓ': 'z',
      'ȥ': 'z',
      'ẕ': 'z',
      'ᵶ': 'z',
      'ᶎ': 'z',
      'ʐ': 'z',
      'ƶ': 'z',
      'ɀ': 'z',
      'ﬀ': 'ff',
      'ﬃ': 'ffi',
      'ﬄ': 'ffl',
      'ﬁ': 'fi',
      'ﬂ': 'fl',
      'ĳ': 'ij',
      'œ': 'oe',
      'ﬆ': 'st',
      'ₐ': 'a',
      'ₑ': 'e',
      'ᵢ': 'i',
      'ⱼ': 'j',
      'ₒ': 'o',
      'ᵣ': 'r',
      'ᵤ': 'u',
      'ᵥ': 'v',
      'ₓ': 'x'
  };
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class TypeaheadOptions {
      /**
       * @param {?} options
       */
      constructor(options) {
          Object.assign(this, options);
      }
  }
  if (false) {
      /** @type {?} */
      TypeaheadOptions.prototype.placement;
      /** @type {?} */
      TypeaheadOptions.prototype.animation;
      /** @type {?} */
      TypeaheadOptions.prototype.typeaheadRef;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class TypeaheadMatch {
      // tslint:disable-next-line:no-any
      /**
       * @param {?} item
       * @param {?=} value
       * @param {?=} header
       */
      constructor(item, value = item, header = false) {
          this.item = item;
          this.value = value;
          this.header = header;
      }
      /**
       * @return {?}
       */
      isHeader() {
          return this.header;
      }
      /**
       * @return {?}
       */
      toString() {
          return this.value;
      }
  }
  if (false) {
      /** @type {?} */
      TypeaheadMatch.prototype.value;
      /** @type {?} */
      TypeaheadMatch.prototype.item;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadMatch.prototype.header;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class TypeaheadOrder {
  }
  if (false) {
      /**
       * field for sorting
       * @type {?}
       */
      TypeaheadOrder.prototype.field;
      /**
       * ordering direction, could be 'asc' or 'desc'
       * @type {?}
       */
      TypeaheadOrder.prototype.direction;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /**
   * @param {?} str
   * @return {?}
   */
  function latinize(str) {
      if (!str) {
          return '';
      }
      return str.replace(/[^A-Za-z0-9\[\] ]/g, (/**
       * @param {?} a
       * @return {?}
       */
      function (a) {
          return latinMap[a] || a;
      }));
  }
  /**
   * @param {?} queryToEscape
   * @return {?}
   */
  function escapeRegexp(queryToEscape) {
      // Regex: capture the whole query string and replace it with the string
      // that will be used to match the results, for example if the capture is
      // 'a' the result will be \a
      return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
  }
  /* tslint:disable */
  /**
   * @param {?} str
   * @param {?=} wordRegexDelimiters
   * @param {?=} phraseRegexDelimiters
   * @param {?=} delimitersForMultipleSearch
   * @return {?}
   */
  function tokenize(str, wordRegexDelimiters = ' ', phraseRegexDelimiters = '', delimitersForMultipleSearch) {
      /** @type {?} */
      let result = [];
      if (!delimitersForMultipleSearch) {
          result = tokenizeWordsAndPhrases(str, wordRegexDelimiters, phraseRegexDelimiters);
      }
      else {
          /** @type {?} */
          const multipleSearchRegexStr = `([${delimitersForMultipleSearch}]+)`;
          /** @type {?} */
          const delimitedTokens = str.split(new RegExp(multipleSearchRegexStr, 'g'));
          /** @type {?} */
          const lastToken = delimitedTokens[delimitedTokens.length - 1];
          if (lastToken > '') {
              if (wordRegexDelimiters && phraseRegexDelimiters) {
                  result = tokenizeWordsAndPhrases(lastToken, wordRegexDelimiters, phraseRegexDelimiters);
              }
              else {
                  result.push(lastToken);
              }
          }
      }
      return result;
  }
  /**
   * @param {?} str
   * @param {?} wordRegexDelimiters
   * @param {?} phraseRegexDelimiters
   * @return {?}
   */
  function tokenizeWordsAndPhrases(str, wordRegexDelimiters, phraseRegexDelimiters) {
      /** @type {?} */
      const result = [];
      /* tslint:enable */
      /** @type {?} */
      const regexStr = `(?:[${phraseRegexDelimiters}])([^${phraseRegexDelimiters}]+)` +
          `(?:[${phraseRegexDelimiters}])|([^${wordRegexDelimiters}]+)`;
      /** @type {?} */
      const preTokenized = str.split(new RegExp(regexStr, 'g'));
      /** @type {?} */
      const preTokenizedLength = preTokenized.length;
      /** @type {?} */
      let token;
      /** @type {?} */
      const replacePhraseDelimiters = new RegExp(`[${phraseRegexDelimiters}]+`, 'g');
      for (let i = 0; i < preTokenizedLength; i += 1) {
          token = preTokenized[i];
          if (token && token.length && token !== wordRegexDelimiters) {
              result.push(token.replace(replacePhraseDelimiters, ''));
          }
      }
      return result;
  }
  // tslint:disable-next-line:no-any
  /**
   * @param {?} object
   * @param {?} option
   * @return {?}
   */
  function getValueFromObject(object, option) {
      if (!option || typeof object !== 'object') {
          return object.toString();
      }
      if (option.endsWith('()')) {
          /** @type {?} */
          const functionName = option.slice(0, option.length - 2);
          return object[functionName]().toString();
      }
      /** @type {?} */
      const properties = option
          .replace(/\[(\w+)\]/g, '.$1')
          .replace(/^\./, '');
      /** @type {?} */
      const propertiesArray = properties.split('.');
      for (const property of propertiesArray) {
          if (property in object) {
              // tslint:disable-next-line
              object = object[property];
          }
      }
      if (!object) {
          return '';
      }
      return object.toString();
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /** @type {?} */
  const TYPEAHEAD_ANIMATION_TIMING = '220ms cubic-bezier(0, 0, 0.2, 1)';
  /** @type {?} */
  const typeaheadAnimation = trigger('typeaheadAnimation', [
      state('animated-down', style({ height: '*', overflow: 'hidden' })),
      transition('* => animated-down', [
          style({ height: 0, overflow: 'hidden' }),
          animate(TYPEAHEAD_ANIMATION_TIMING)
      ]),
      state('animated-up', style({ height: '*', overflow: 'hidden' })),
      transition('* => animated-up', [
          style({ height: '*', overflow: 'hidden' }),
          animate(TYPEAHEAD_ANIMATION_TIMING)
      ]),
      transition('* => unanimated', animate('0s'))
  ]);
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /** @type {?} */
  let nextWindowId = 0;
  class TypeaheadContainerComponent {
      /**
       * @param {?} positionService
       * @param {?} renderer
       * @param {?} element
       * @param {?} changeDetectorRef
       */
      constructor(positionService, renderer, element, changeDetectorRef) {
          this.positionService = positionService;
          this.renderer = renderer;
          this.element = element;
          this.changeDetectorRef = changeDetectorRef;
          // tslint:disable-next-line: no-output-rename
          this.activeChangeEvent = new EventEmitter();
          this.isFocused = false;
          this.height = 0;
          this.popupId = `ngb-typeahead-${nextWindowId++}`;
          this._matches = [];
          this.isScrolledIntoView = (/**
           * @param {?} elem
           * @return {?}
           */
          function (elem) {
              /** @type {?} */
              const containerViewTop = this.ulElement.nativeElement.scrollTop;
              /** @type {?} */
              const containerViewBottom = containerViewTop + Number(this.ulElement.nativeElement.offsetHeight);
              /** @type {?} */
              const elemTop = elem.offsetTop;
              /** @type {?} */
              const elemBottom = elemTop + elem.offsetHeight;
              return ((elemBottom <= containerViewBottom) && (elemTop >= containerViewTop));
          });
          this.renderer.setAttribute(this.element.nativeElement, 'id', this.popupId);
          this.positionServiceSubscription = this.positionService.event$.subscribe((/**
           * @return {?}
           */
          () => {
              if (this.isAnimated) {
                  this.animationState = this.isTopPosition ? 'animated-up' : 'animated-down';
                  this.changeDetectorRef.detectChanges();
                  return;
              }
              this.animationState = 'unanimated';
              this.changeDetectorRef.detectChanges();
          }));
      }
      /**
       * @return {?}
       */
      get isBs4() {
          return !isBs3();
      }
      /**
       * @return {?}
       */
      get typeaheadTemplateMethods() {
          /* tslint:disable:no-this-assignment */
          /** @type {?} */
          const _that = this;
          return {
              selectMatch: this.selectMatch.bind(_that),
              selectActive: this.selectActive.bind(_that),
              isActive: this.isActive.bind(_that)
          };
      }
      /**
       * @return {?}
       */
      get active() {
          return this._active;
      }
      /**
       * @param {?} active
       * @return {?}
       */
      set active(active) {
          this._active = active;
          this.activeChanged();
      }
      /**
       * @return {?}
       */
      get matches() {
          return this._matches;
      }
      /**
       * @param {?} value
       * @return {?}
       */
      set matches(value) {
          this.positionService.setOptions({
              modifiers: { flip: { enabled: this.adaptivePosition } },
              allowedPositions: ['top', 'bottom']
          });
          this._matches = value;
          this.needScrollbar = this.typeaheadScrollable && this.typeaheadOptionsInScrollableView < this.matches.length;
          if (this.typeaheadScrollable) {
              setTimeout((/**
               * @return {?}
               */
              () => {
                  this.setScrollableMode();
              }));
          }
          if (this.typeaheadIsFirstItemActive && this._matches.length > 0) {
              this.active = this._matches[0];
              if (this._active.isHeader()) {
                  this.nextActiveMatch();
              }
          }
          if (this._active && !this.typeaheadIsFirstItemActive) {
              /** @type {?} */
              const concurrency = this._matches.find((/**
               * @param {?} match
               * @return {?}
               */
              match => match.value === this._active.value));
              if (concurrency) {
                  this.selectActive(concurrency);
                  return;
              }
              this.active = null;
          }
      }
      /**
       * @return {?}
       */
      get isTopPosition() {
          return this.element.nativeElement.classList.contains('top');
      }
      // tslint:disable-next-line:no-any
      /**
       * @return {?}
       */
      get optionsListTemplate() {
          return this.parent ? this.parent.optionsListTemplate : undefined;
      }
      /**
       * @return {?}
       */
      get isAnimated() {
          return this.parent ? this.parent.isAnimated : false;
      }
      /**
       * @return {?}
       */
      get adaptivePosition() {
          return this.parent ? this.parent.adaptivePosition : false;
      }
      /**
       * @return {?}
       */
      get typeaheadScrollable() {
          return this.parent ? this.parent.typeaheadScrollable : false;
      }
      /**
       * @return {?}
       */
      get typeaheadOptionsInScrollableView() {
          return this.parent ? this.parent.typeaheadOptionsInScrollableView : 5;
      }
      /**
       * @return {?}
       */
      get typeaheadIsFirstItemActive() {
          return this.parent ? this.parent.typeaheadIsFirstItemActive : true;
      }
      // tslint:disable-next-line:no-any
      /**
       * @return {?}
       */
      get itemTemplate() {
          return this.parent ? this.parent.typeaheadItemTemplate : undefined;
      }
      /**
       * @param {?=} isActiveItemChanged
       * @return {?}
       */
      selectActiveMatch(isActiveItemChanged) {
          if (this._active && this.parent.typeaheadSelectFirstItem) {
              this.selectMatch(this._active);
          }
          if (!this.parent.typeaheadSelectFirstItem && isActiveItemChanged) {
              this.selectMatch(this._active);
          }
      }
      /**
       * @return {?}
       */
      activeChanged() {
          /** @type {?} */
          const index = this.matches.indexOf(this._active);
          this.activeChangeEvent.emit(`${this.popupId}-${index}`);
      }
      /**
       * @return {?}
       */
      prevActiveMatch() {
          /** @type {?} */
          const index = this.matches.indexOf(this._active);
          this.active = this.matches[index - 1 < 0 ? this.matches.length - 1 : index - 1];
          if (this._active.isHeader()) {
              this.prevActiveMatch();
          }
          if (this.typeaheadScrollable) {
              this.scrollPrevious(index);
          }
      }
      /**
       * @return {?}
       */
      nextActiveMatch() {
          /** @type {?} */
          const index = this.matches.indexOf(this._active);
          this.active = this.matches[index + 1 > this.matches.length - 1 ? 0 : index + 1];
          if (this._active.isHeader()) {
              this.nextActiveMatch();
          }
          if (this.typeaheadScrollable) {
              this.scrollNext(index);
          }
      }
      /**
       * @param {?} value
       * @return {?}
       */
      selectActive(value) {
          this.isFocused = true;
          this.active = value;
      }
      /**
       * @param {?} match
       * @param {?} query
       * @return {?}
       */
      highlight(match, query) {
          /** @type {?} */
          let itemStr = match.value;
          /** @type {?} */
          let itemStrHelper = (this.parent && this.parent.typeaheadLatinize
              ? latinize(itemStr)
              : itemStr).toLowerCase();
          /** @type {?} */
          let startIdx;
          /** @type {?} */
          let tokenLen;
          // Replaces the capture string with the same string inside of a "strong" tag
          if (typeof query === 'object') {
              /** @type {?} */
              const queryLen = query.length;
              for (let i = 0; i < queryLen; i += 1) {
                  // query[i] is already latinized and lower case
                  startIdx = itemStrHelper.indexOf(query[i]);
                  tokenLen = query[i].length;
                  if (startIdx >= 0 && tokenLen > 0) {
                      itemStr =
                          `${itemStr.substring(0, startIdx)}<strong>${itemStr.substring(startIdx, startIdx + tokenLen)}</strong>` +
                              `${itemStr.substring(startIdx + tokenLen)}`;
                      itemStrHelper =
                          `${itemStrHelper.substring(0, startIdx)}        ${' '.repeat(tokenLen)}         ` +
                              `${itemStrHelper.substring(startIdx + tokenLen)}`;
                  }
              }
          }
          else if (query) {
              // query is already latinized and lower case
              startIdx = itemStrHelper.indexOf(query);
              tokenLen = query.length;
              if (startIdx >= 0 && tokenLen > 0) {
                  itemStr =
                      `${itemStr.substring(0, startIdx)}<strong>${itemStr.substring(startIdx, startIdx + tokenLen)}</strong>` +
                          `${itemStr.substring(startIdx + tokenLen)}`;
              }
          }
          return itemStr;
      }
      /**
       * @return {?}
       */
      focusLost() {
          this.isFocused = false;
      }
      /**
       * @param {?} value
       * @return {?}
       */
      isActive(value) {
          return this.active === value;
      }
      /**
       * @param {?} value
       * @param {?=} e
       * @return {?}
       */
      selectMatch(value, e = void 0) {
          if (e) {
              e.stopPropagation();
              e.preventDefault();
          }
          this.parent.changeModel(value);
          setTimeout((/**
           * @return {?}
           */
          () => this.parent.typeaheadOnSelect.emit(value)), 0);
          return false;
      }
      /**
       * @return {?}
       */
      setScrollableMode() {
          if (!this.ulElement) {
              this.ulElement = this.element;
          }
          if (this.liElements.first) {
              /** @type {?} */
              const ulStyles = Utils.getStyles(this.ulElement.nativeElement);
              /** @type {?} */
              const liStyles = Utils.getStyles(this.liElements.first.nativeElement);
              /** @type {?} */
              const ulPaddingBottom = parseFloat((ulStyles['padding-bottom'] ? ulStyles['padding-bottom'] : '')
                  .replace('px', ''));
              /** @type {?} */
              const ulPaddingTop = parseFloat((ulStyles['padding-top'] ? ulStyles['padding-top'] : '0')
                  .replace('px', ''));
              /** @type {?} */
              const optionHeight = parseFloat((liStyles.height ? liStyles.height : '0')
                  .replace('px', ''));
              /** @type {?} */
              const height = this.typeaheadOptionsInScrollableView * optionHeight;
              this.guiHeight = `${height + ulPaddingTop + ulPaddingBottom}px`;
          }
          this.renderer.setStyle(this.element.nativeElement, 'visibility', 'visible');
      }
      /**
       * @param {?} index
       * @return {?}
       */
      scrollPrevious(index) {
          if (index === 0) {
              this.scrollToBottom();
              return;
          }
          if (this.liElements) {
              /** @type {?} */
              const liElement = this.liElements.toArray()[index - 1];
              if (liElement && !this.isScrolledIntoView(liElement.nativeElement)) {
                  this.ulElement.nativeElement.scrollTop = liElement.nativeElement.offsetTop;
              }
          }
      }
      /**
       * @param {?} index
       * @return {?}
       */
      scrollNext(index) {
          if (index + 1 > this.matches.length - 1) {
              this.scrollToTop();
              return;
          }
          if (this.liElements) {
              /** @type {?} */
              const liElement = this.liElements.toArray()[index + 1];
              if (liElement && !this.isScrolledIntoView(liElement.nativeElement)) {
                  this.ulElement.nativeElement.scrollTop =
                      liElement.nativeElement.offsetTop -
                          Number(this.ulElement.nativeElement.offsetHeight) +
                          Number(liElement.nativeElement.offsetHeight);
              }
          }
      }
      /**
       * @return {?}
       */
      ngOnDestroy() {
          this.positionServiceSubscription.unsubscribe();
      }
      /**
       * @private
       * @return {?}
       */
      scrollToBottom() {
          this.ulElement.nativeElement.scrollTop = this.ulElement.nativeElement.scrollHeight;
      }
      /**
       * @private
       * @return {?}
       */
      scrollToTop() {
          this.ulElement.nativeElement.scrollTop = 0;
      }
  }
  TypeaheadContainerComponent.ɵfac = function TypeaheadContainerComponent_Factory(t) { return new (t || TypeaheadContainerComponent)(ɵngcc0.ɵɵdirectiveInject(ɵngcc1.PositioningService), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.Renderer2), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef)); };
  TypeaheadContainerComponent.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: TypeaheadContainerComponent, selectors: [["typeahead-container"]], viewQuery: function TypeaheadContainerComponent_Query(rf, ctx) { if (rf & 1) {
          ɵngcc0.ɵɵviewQuery(_c0, 1);
          ɵngcc0.ɵɵviewQuery(_c1, 1);
      } if (rf & 2) {
          let _t;
          ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.ulElement = _t.first);
          ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.liElements = _t);
      } }, hostAttrs: [1, "dropdown", "open", "bottom", 2, "position", "absolute", "display", "block"], hostVars: 9, hostBindings: function TypeaheadContainerComponent_HostBindings(rf, ctx) { if (rf & 1) {
          ɵngcc0.ɵɵlistener("mouseleave", function TypeaheadContainerComponent_mouseleave_HostBindingHandler() { return ctx.focusLost(); })("blur", function TypeaheadContainerComponent_blur_HostBindingHandler() { return ctx.focusLost(); });
      } if (rf & 2) {
          ɵngcc0.ɵɵattribute("role", ctx.isBs4 ? "listbox" : null);
          ɵngcc0.ɵɵstyleProp("height", ctx.isBs4 && ctx.needScrollbar ? ctx.guiHeight : "auto")("visibility", "inherit");
          ɵngcc0.ɵɵclassProp("dropdown-menu", ctx.isBs4)("dropup", ctx.dropup);
      } }, outputs: { activeChangeEvent: "activeChange" }, decls: 7, vars: 7, consts: [[3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["bsItemTemplate", ""], ["bs3Template", ""], ["bs4Template", ""], [3, "innerHtml"], ["role", "listbox", 1, "dropdown-menu"], ["ulElement", ""], ["ngFor", "", 3, "ngForOf"], ["class", "dropdown-header", 4, "ngIf"], ["role", "option", 3, "id", "active", "mouseenter", 4, "ngIf"], [1, "dropdown-header"], ["liElements", ""], ["role", "option", 3, "id", "mouseenter"], ["href", "#", "tabindex", "-1", 3, "click"], [3, "ngIf"], ["role", "option", 1, "dropdown-item", 3, "id", "click", "mouseenter"]], template: function TypeaheadContainerComponent_Template(rf, ctx) { if (rf & 1) {
          ɵngcc0.ɵɵtemplate(0, TypeaheadContainerComponent_ng_template_0_Template, 0, 0, "ng-template", 0);
          ɵngcc0.ɵɵtemplate(1, TypeaheadContainerComponent_ng_template_1_Template, 1, 1, "ng-template", null, 1, ɵngcc0.ɵɵtemplateRefExtractor);
          ɵngcc0.ɵɵtemplate(3, TypeaheadContainerComponent_ng_template_3_Template, 3, 5, "ng-template", null, 2, ɵngcc0.ɵɵtemplateRefExtractor);
          ɵngcc0.ɵɵtemplate(5, TypeaheadContainerComponent_ng_template_5_Template, 1, 1, "ng-template", null, 3, ɵngcc0.ɵɵtemplateRefExtractor);
      } if (rf & 2) {
          const _r1 = ɵngcc0.ɵɵreference(2);
          const _r3 = ɵngcc0.ɵɵreference(4);
          const _r5 = ɵngcc0.ɵɵreference(6);
          ɵngcc0.ɵɵproperty("ngTemplateOutlet", ctx.optionsListTemplate || (ctx.isBs4 ? _r5 : _r3))("ngTemplateOutletContext", ɵngcc0.ɵɵpureFunction4(2, _c3, ctx.matches, ctx.itemTemplate || _r1, ctx.query, ctx.typeaheadTemplateMethods));
      } }, directives: [ɵngcc2.NgTemplateOutlet, ɵngcc2.NgForOf, ɵngcc2.NgIf], styles: [".dropdown[_nghost-%COMP%] {\n      z-index: 1000;\n    }\n\n    .dropdown-menu[_nghost-%COMP%], .dropdown-menu[_ngcontent-%COMP%] {\n      overflow-y: auto;\n      height: 100px;\n    }"], data: { animation: [typeaheadAnimation] } });
  /** @nocollapse */
  TypeaheadContainerComponent.ctorParameters = () => [
      { type: PositioningService },
      { type: Renderer2 },
      { type: ElementRef },
      { type: ChangeDetectorRef }
  ];
  TypeaheadContainerComponent.propDecorators = {
      activeChangeEvent: [{ type: Output, args: ['activeChange',] }],
      ulElement: [{ type: ViewChild, args: ['ulElement', { static: false },] }],
      liElements: [{ type: ViewChildren, args: ['liElements',] }],
      focusLost: [{ type: HostListener, args: ['mouseleave',] }, { type: HostListener, args: ['blur',] }]
  };
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TypeaheadContainerComponent, [{
          type: Component,
          args: [{
                  selector: 'typeahead-container',
                  template: "<!-- inject options list template -->\n<ng-template [ngTemplateOutlet]=\"optionsListTemplate || (isBs4 ? bs4Template : bs3Template)\"\n             [ngTemplateOutletContext]=\"{\n               matches: matches,\n               itemTemplate: itemTemplate || bsItemTemplate,\n               query: query,\n               $implicit: typeaheadTemplateMethods\n             }\">\n</ng-template>\n\n<!-- default options item template -->\n<ng-template #bsItemTemplate let-match=\"match\" let-query=\"query\">\n  <span [innerHtml]=\"highlight(match, query)\"></span>\n</ng-template>\n\n<!-- Bootstrap 3 options list template -->\n<ng-template #bs3Template>\n  <ul class=\"dropdown-menu\"\n      #ulElement\n      role=\"listbox\"\n      [style.overflow-y]=\"needScrollbar ? 'scroll': 'auto'\"\n      [style.height]=\"needScrollbar ? guiHeight: 'auto'\">\n    <ng-template ngFor let-match let-i=\"index\" [ngForOf]=\"matches\">\n      <li #liElements *ngIf=\"match.isHeader()\" class=\"dropdown-header\">{{ match }}</li>\n      <li #liElements\n          *ngIf=\"!match.isHeader()\"\n          [id]=\"popupId + '-' + i\"\n          role=\"option\"\n          [@typeaheadAnimation]=\"animationState\"\n          [class.active]=\"isActive(match)\"\n          (mouseenter)=\"selectActive(match)\">\n\n        <a href=\"#\" (click)=\"selectMatch(match, $event)\" tabindex=\"-1\">\n          <ng-template [ngTemplateOutlet]=\"itemTemplate || bsItemTemplate\"\n                       [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n          </ng-template>\n        </a>\n      </li>\n    </ng-template>\n  </ul>\n</ng-template>\n\n<!-- Bootstrap 4 options list template -->\n<ng-template #bs4Template>\n  <ng-template ngFor let-match let-i=\"index\" [ngForOf]=\"matches\">\n    <h6 *ngIf=\"match.isHeader()\" class=\"dropdown-header\">{{ match }}</h6>\n    <ng-template [ngIf]=\"!match.isHeader()\">\n      <button #liElements\n              [id]=\"popupId + '-' + i\"\n              role=\"option\"\n              [@typeaheadAnimation]=\"animationState\"\n              class=\"dropdown-item\"\n              (click)=\"selectMatch(match, $event)\"\n              (mouseenter)=\"selectActive(match)\"\n              [class.active]=\"isActive(match)\">\n        <ng-template [ngTemplateOutlet]=\"itemTemplate || bsItemTemplate\"\n                     [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n        </ng-template>\n      </button>\n    </ng-template>\n  </ng-template>\n</ng-template>\n",
                  host: {
                      class: 'dropdown open bottom',
                      '[class.dropdown-menu]': 'isBs4',
                      '[style.height]': `isBs4 && needScrollbar ? guiHeight: 'auto'`,
                      '[style.visibility]': `'inherit'`,
                      '[class.dropup]': 'dropup',
                      style: 'position: absolute;display: block;',
                      '[attr.role]': `isBs4 ? 'listbox' : null `
                  },
                  animations: [typeaheadAnimation],
                  styles: [`
      :host.dropdown {
        z-index: 1000;
      }
  
      :host.dropdown-menu, .dropdown-menu {
        overflow-y: auto;
        height: 100px;
      }
    `]
              }]
      }], function () { return [{ type: ɵngcc1.PositioningService }, { type: ɵngcc0.Renderer2 }, { type: ɵngcc0.ElementRef }, { type: ɵngcc0.ChangeDetectorRef }]; }, { activeChangeEvent: [{
              type: Output,
              args: ['activeChange']
          }], 
      /**
       * @return {?}
       */
      focusLost: [{
              type: HostListener,
              args: ['mouseleave']
          }, {
              type: HostListener,
              args: ['blur']
          }], ulElement: [{
              type: ViewChild,
              args: ['ulElement', { static: false }]
          }], liElements: [{
              type: ViewChildren,
              args: ['liElements']
          }] }); })();
  if (false) {
      /** @type {?} */
      TypeaheadContainerComponent.prototype.activeChangeEvent;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.parent;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.query;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.isFocused;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.top;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.left;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.display;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.placement;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.dropup;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.guiHeight;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.needScrollbar;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.animationState;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.positionServiceSubscription;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.height;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.popupId;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadContainerComponent.prototype._active;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadContainerComponent.prototype._matches;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.ulElement;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.liElements;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.isScrolledIntoView;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.positionService;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.renderer;
      /** @type {?} */
      TypeaheadContainerComponent.prototype.element;
      /**
       * @type {?}
       * @private
       */
      TypeaheadContainerComponent.prototype.changeDetectorRef;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /**
   * Default values provider for typeahead
   */
  class TypeaheadConfig {
      constructor() {
          /**
           * sets use adaptive position
           */
          this.adaptivePosition = false;
          /**
           * turn on/off animation
           */
          this.isAnimated = false;
          /**
           * used to hide results on blur
           */
          this.hideResultsOnBlur = true;
          /**
           * if true, typeahead will cancel async request on blur
           */
          this.cancelRequestOnFocusLost = false;
          /**
           * used to choose the first item in typeahead container
           */
          this.selectFirstItem = true;
          /**
           * used to active/inactive the first item in typeahead container
           */
          this.isFirstItemActive = true;
          /**
           * used to choose set minimal no of characters that needs to
           * be entered before typeahead kicks-in
           */
          this.minLength = 1;
      }
  }
  TypeaheadConfig.ɵfac = function TypeaheadConfig_Factory(t) { return new (t || TypeaheadConfig)(); };
  /** @nocollapse */ TypeaheadConfig.ɵprov = ɵɵdefineInjectable({ factory: function TypeaheadConfig_Factory() { return new TypeaheadConfig(); }, token: TypeaheadConfig, providedIn: "root" });
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TypeaheadConfig, [{
          type: Injectable,
          args: [{
                  providedIn: 'root'
              }]
      }], function () { return []; }, null); })();
  if (false) {
      /**
       * sets use adaptive position
       * @type {?}
       */
      TypeaheadConfig.prototype.adaptivePosition;
      /**
       * turn on/off animation
       * @type {?}
       */
      TypeaheadConfig.prototype.isAnimated;
      /**
       * used to hide results on blur
       * @type {?}
       */
      TypeaheadConfig.prototype.hideResultsOnBlur;
      /**
       * if true, typeahead will cancel async request on blur
       * @type {?}
       */
      TypeaheadConfig.prototype.cancelRequestOnFocusLost;
      /**
       * used to choose the first item in typeahead container
       * @type {?}
       */
      TypeaheadConfig.prototype.selectFirstItem;
      /**
       * used to active/inactive the first item in typeahead container
       * @type {?}
       */
      TypeaheadConfig.prototype.isFirstItemActive;
      /**
       * used to choose set minimal no of characters that needs to
       * be entered before typeahead kicks-in
       * @type {?}
       */
      TypeaheadConfig.prototype.minLength;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class TypeaheadDirective {
      /**
       * @param {?} cis
       * @param {?} config
       * @param {?} changeDetection
       * @param {?} element
       * @param {?} ngControl
       * @param {?} renderer
       * @param {?} viewContainerRef
       */
      constructor(cis, config, changeDetection, element, ngControl, renderer, viewContainerRef) {
          this.changeDetection = changeDetection;
          this.element = element;
          this.ngControl = ngControl;
          this.renderer = renderer;
          /**
           * minimal no of characters that needs to be entered before
           * typeahead kicks-in. When set to 0, typeahead shows on focus with full
           * list of options (limited as normal by typeaheadOptionsLimit)
           */
          this.typeaheadMinLength = void 0;
          /**
           * turn on/off animation
           */
          this.isAnimated = false;
          /**
           * should be used only in case of typeahead attribute is Observable of array.
           * If true - loading of options will be async, otherwise - sync.
           * true make sense if options array is large.
           */
          this.typeaheadAsync = void 0;
          /**
           * match latin symbols.
           * If true the word súper would match super and vice versa.
           */
          this.typeaheadLatinize = true;
          /**
           * Can be use to search words by inserting a single white space between each characters
           *  for example 'C a l i f o r n i a' will match 'California'.
           */
          this.typeaheadSingleWords = true;
          /**
           * should be used only in case typeaheadSingleWords attribute is true.
           * Sets the word delimiter to break words. Defaults to space.
           */
          this.typeaheadWordDelimiters = ' ';
          /**
           * Can be used to conduct a search of multiple items and have suggestion not for the
           * whole value of the input but for the value that comes after a delimiter provided via
           * typeaheadMultipleSearchDelimiters attribute. This option can only be used together with
           * typeaheadSingleWords option if typeaheadWordDelimiters and typeaheadPhraseDelimiters
           * are different from typeaheadMultipleSearchDelimiters to avoid conflict in determining
           * when to delimit multiple searches and when a single word.
           */
          this.typeaheadMultipleSearch = void 0;
          /**
           * should be used only in case typeaheadMultipleSearch attribute is true.
           * Sets the multiple search delimiter to know when to start a new search. Defaults to comma.
           * If space needs to be used, then explicitly set typeaheadWordDelimiters to something else than space
           * because space is used by default OR set typeaheadSingleWords attribute to false if you don't need
           * to use it together with multiple search.
           */
          this.typeaheadMultipleSearchDelimiters = ',';
          /**
           * should be used only in case typeaheadSingleWords attribute is true.
           * Sets the word delimiter to match exact phrase.
           * Defaults to simple and double quotes.
           */
          this.typeaheadPhraseDelimiters = '\'"';
          /**
           * specifies if typeahead is scrollable
           */
          this.typeaheadScrollable = false;
          /**
           * specifies number of options to show in scroll view
           */
          this.typeaheadOptionsInScrollableView = 5;
          /**
           * fired when an options list was opened and the user clicked Tab
           * If a value equal true, it will be chosen first or active item in the list
           * If value equal false, it will be chosen an active item in the list or nothing
           */
          this.typeaheadSelectFirstItem = true;
          /**
           * makes active first item in a list
           */
          this.typeaheadIsFirstItemActive = true;
          /**
           * fired when 'busy' state of this component was changed,
           * fired on async mode only, returns boolean
           */
          this.typeaheadLoading = new EventEmitter();
          /**
           * fired on every key event and returns true
           * in case of matches are not detected
           */
          this.typeaheadNoResults = new EventEmitter();
          /**
           * fired when option was selected, return object with data of this option
           */
          this.typeaheadOnSelect = new EventEmitter();
          /**
           * fired when blur event occurs. returns the active item
           */
          this.typeaheadOnBlur = new EventEmitter();
          /**
           * This attribute indicates that the dropdown should be opened upwards
           */
          this.dropup = false;
          this.isOpen = false;
          this.list = 'list';
          this.isActiveItemChanged = false;
          this.isFocused = false;
          this.cancelRequestOnFocusLost = false;
          // tslint:disable-next-line:no-any
          this.keyUpEventEmitter = new EventEmitter();
          this._matches = [];
          this.placement = 'bottom left';
          this._subscriptions = [];
          this._typeahead = cis.createLoader(element, viewContainerRef, renderer)
              .provide({ provide: TypeaheadConfig, useValue: config });
          Object.assign(this, {
              typeaheadHideResultsOnBlur: config.hideResultsOnBlur,
              cancelRequestOnFocusLost: config.cancelRequestOnFocusLost,
              typeaheadSelectFirstItem: config.selectFirstItem,
              typeaheadIsFirstItemActive: config.isFirstItemActive,
              typeaheadMinLength: config.minLength,
              adaptivePosition: config.adaptivePosition,
              isAnimated: config.isAnimated
          });
      }
      /**
       * @return {?}
       */
      ngOnInit() {
          this.typeaheadOptionsLimit = this.typeaheadOptionsLimit || 20;
          this.typeaheadMinLength =
              this.typeaheadMinLength === void 0 ? 1 : this.typeaheadMinLength;
          this.typeaheadWaitMs = this.typeaheadWaitMs || 0;
          // async should be false in case of array
          if (this.typeaheadAsync === undefined && !(isObservable(this.typeahead))) {
              this.typeaheadAsync = false;
          }
          if (isObservable(this.typeahead)) {
              this.typeaheadAsync = true;
          }
          if (this.typeaheadAsync) {
              this.asyncActions();
          }
          else {
              this.syncActions();
          }
          this.checkDelimitersConflict();
      }
      /**
       * @param {?} e
       * @return {?}
       */
      // tslint:disable-next-line:no-any
      onInput(e) {
          // For `<input>`s, use the `value` property. For others that don't have a
          // `value` (such as `<span contenteditable="true">`), use either
          // `textContent` or `innerText` (depending on which one is supported, i.e.
          // Firefox or IE).
          /** @type {?} */
          const value = e.target.value !== undefined
              ? e.target.value
              : e.target.textContent !== undefined
                  ? e.target.textContent
                  : e.target.innerText;
          if (value != null && value.trim().length >= this.typeaheadMinLength) {
              this.typeaheadLoading.emit(true);
              this.keyUpEventEmitter.emit(e.target.value);
          }
          else {
              this.typeaheadLoading.emit(false);
              this.typeaheadNoResults.emit(false);
              this.hide();
          }
      }
      /**
       * @param {?} event
       * @return {?}
       */
      onChange(event) {
          if (this._container) {
              // esc
              /* tslint:disable-next-line: deprecation */
              if (event.keyCode === 27 || event.key === 'Escape') {
                  this.hide();
                  return;
              }
              // up
              /* tslint:disable-next-line: deprecation */
              if (event.keyCode === 38 || event.key === 'ArrowUp') {
                  this.isActiveItemChanged = true;
                  this._container.prevActiveMatch();
                  return;
              }
              // down
              /* tslint:disable-next-line: deprecation */
              if (event.keyCode === 40 || event.key === 'ArrowDown') {
                  this.isActiveItemChanged = true;
                  this._container.nextActiveMatch();
                  return;
              }
              // enter
              /* tslint:disable-next-line: deprecation */
              if (event.keyCode === 13 || event.key === 'Enter') {
                  this._container.selectActiveMatch();
                  return;
              }
          }
      }
      /**
       * @return {?}
       */
      onFocus() {
          this.isFocused = true;
          // add setTimeout to fix issue #5251
          // to get and emit updated value if it's changed on focus
          setTimeout((/**
           * @return {?}
           */
          () => {
              if (this.typeaheadMinLength === 0) {
                  this.typeaheadLoading.emit(true);
                  this.keyUpEventEmitter.emit(this.element.nativeElement.value || '');
              }
          }), 0);
      }
      /**
       * @return {?}
       */
      onBlur() {
          this.isFocused = false;
          if (this._container && !this._container.isFocused) {
              this.typeaheadOnBlur.emit(this._container.active);
          }
          if (!this.container && this._matches.length === 0) {
              this.typeaheadOnBlur.emit(new TypeaheadMatch(this.element.nativeElement.value, this.element.nativeElement.value, false));
          }
      }
      /**
       * @param {?} event
       * @return {?}
       */
      onKeydown(event) {
          // no container - no problems
          if (!this._container) {
              return;
          }
          /* tslint:disable-next-line: deprecation */
          if (event.keyCode === 9 || event.key === 'Tab') {
              this.onBlur();
          }
          /* tslint:disable-next-line: deprecation */
          if (event.keyCode === 9 || event.key === 'Tab' || event.keyCode === 13 || event.key === 'Enter') {
              event.preventDefault();
              if (this.typeaheadSelectFirstItem) {
                  this._container.selectActiveMatch();
                  return;
              }
              if (!this.typeaheadSelectFirstItem) {
                  this._container.selectActiveMatch(this.isActiveItemChanged);
                  this.isActiveItemChanged = false;
                  this.hide();
              }
          }
      }
      /**
       * @param {?} match
       * @return {?}
       */
      changeModel(match) {
          /** @type {?} */
          let valueStr;
          if (this.typeaheadMultipleSearch) {
              /** @type {?} */
              const tokens = this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));
              this._allEnteredValue = tokens.slice(0, tokens.length - 1).concat(match.value).join('');
              valueStr = this._allEnteredValue;
          }
          else {
              valueStr = match.value;
          }
          this.ngControl.viewToModelUpdate(valueStr);
          (this.ngControl.control).setValue(valueStr);
          this.changeDetection.markForCheck();
          this.hide();
      }
      /**
       * @return {?}
       */
      get matches() {
          return this._matches;
      }
      /**
       * @return {?}
       */
      show() {
          this._typeahead
              .attach(TypeaheadContainerComponent)
              .to(this.container)
              .position({ attachment: `${this.dropup ? 'top' : 'bottom'} left` })
              .show({
              typeaheadRef: this,
              placement: this.placement,
              animation: false,
              dropup: this.dropup
          });
          this._outsideClickListener = this.renderer.listen('document', 'click', (/**
           * @param {?} e
           * @return {?}
           */
          (e) => {
              if (this.typeaheadMinLength === 0 && this.element.nativeElement.contains(e.target)) {
                  return undefined;
              }
              if (!this.typeaheadHideResultsOnBlur || this.element.nativeElement.contains(e.target)) {
                  return undefined;
              }
              this.onOutsideClick();
          }));
          this._container = this._typeahead.instance;
          this._container.parent = this;
          // This improves the speed as it won't have to be done for each list item
          /** @type {?} */
          const normalizedQuery = (this.typeaheadLatinize
              ? latinize(this.ngControl.control.value)
              : this.ngControl.control.value)
              .toString()
              .toLowerCase();
          this._container.query = this.tokenizeQuery(normalizedQuery);
          this._container.matches = this._matches;
          this.element.nativeElement.focus();
          this._container.activeChangeEvent.subscribe((/**
           * @param {?} activeId
           * @return {?}
           */
          (activeId) => {
              this.activeDescendant = activeId;
              this.changeDetection.markForCheck();
          }));
          this.isOpen = true;
      }
      /**
       * @return {?}
       */
      hide() {
          if (this._typeahead.isShown) {
              this._typeahead.hide();
              this._outsideClickListener();
              this._container = null;
              this.isOpen = false;
              this.changeDetection.markForCheck();
          }
      }
      /**
       * @return {?}
       */
      onOutsideClick() {
          if (this._container && !this._container.isFocused) {
              this.hide();
          }
      }
      /**
       * @return {?}
       */
      ngOnDestroy() {
          // clean up subscriptions
          for (const sub of this._subscriptions) {
              sub.unsubscribe();
          }
          this._typeahead.dispose();
      }
      /**
       * @protected
       * @return {?}
       */
      asyncActions() {
          this._subscriptions.push(this.keyUpEventEmitter
              .pipe(debounceTime(this.typeaheadWaitMs), tap((/**
           * @param {?} value
           * @return {?}
           */
          value => {
              this._allEnteredValue = value;
          })), switchMap((/**
           * @return {?}
           */
          () => this.typeahead)))
              .subscribe((/**
           * @param {?} matches
           * @return {?}
           */
          (matches) => {
              this.finalizeAsyncCall(matches);
          })));
      }
      /**
       * @protected
       * @return {?}
       */
      syncActions() {
          this._subscriptions.push(this.keyUpEventEmitter
              .pipe(debounceTime(this.typeaheadWaitMs), mergeMap((/**
           * @param {?} value
           * @return {?}
           */
          (value) => {
              this._allEnteredValue = value;
              /** @type {?} */
              const normalizedQuery = this.normalizeQuery(value);
              return from(this.typeahead)
                  .pipe(filter((/**
               * @param {?} option
               * @return {?}
               */
              (option) => {
                  return option && this.testMatch(this.normalizeOption(option), normalizedQuery);
              })), toArray());
          })))
              .subscribe((/**
           * @param {?} matches
           * @return {?}
           */
          (matches) => {
              this.finalizeAsyncCall(matches);
          })));
      }
      /**
       * @protected
       * @param {?} option
       * @return {?}
       */
      normalizeOption(option) {
          /** @type {?} */
          const optionValue = getValueFromObject(option, this.typeaheadOptionField);
          /** @type {?} */
          const normalizedOption = this.typeaheadLatinize
              ? latinize(optionValue)
              : optionValue;
          return normalizedOption.toLowerCase();
      }
      /**
       * @protected
       * @param {?} currentQuery
       * @return {?}
       */
      tokenizeQuery(currentQuery) {
          /** @type {?} */
          let query = currentQuery;
          if (this.typeaheadMultipleSearch && this.typeaheadSingleWords) {
              if (!this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`, this.typeaheadMultipleSearchDelimiters)) {
                  // single words and multiple search delimiters are different, can be used together
                  query = tokenize((/** @type {?} */ (query)), this.typeaheadWordDelimiters, this.typeaheadPhraseDelimiters, this.typeaheadMultipleSearchDelimiters);
              }
          }
          else if (this.typeaheadSingleWords) {
              query = tokenize((/** @type {?} */ (query)), this.typeaheadWordDelimiters, this.typeaheadPhraseDelimiters);
          }
          else {
              // multiple searches
              query = tokenize((/** @type {?} */ (query)), null, null, this.typeaheadMultipleSearchDelimiters);
          }
          return query;
      }
      /**
       * @protected
       * @param {?} value
       * @return {?}
       */
      normalizeQuery(value) {
          // If singleWords, break model here to not be doing extra work on each iteration
          /** @type {?} */
          let normalizedQuery = (this.typeaheadLatinize
              ? latinize(value)
              : value)
              .toString()
              .toLowerCase();
          normalizedQuery = this.tokenizeQuery(normalizedQuery);
          return normalizedQuery;
      }
      /**
       * @protected
       * @param {?} match
       * @param {?} test
       * @return {?}
       */
      testMatch(match, test) {
          /** @type {?} */
          let spaceLength;
          if (typeof test === 'object') {
              spaceLength = test.length;
              for (let i = 0; i < spaceLength; i += 1) {
                  if (test[i].length > 0 && match.indexOf(test[i]) < 0) {
                      return false;
                  }
              }
              return true;
          }
          return match.indexOf(test) >= 0;
      }
      /**
       * @protected
       * @param {?} matches
       * @return {?}
       */
      finalizeAsyncCall(matches) {
          this.prepareMatches(matches || []);
          this.typeaheadLoading.emit(false);
          this.typeaheadNoResults.emit(!this.hasMatches());
          if (!this.hasMatches()) {
              this.hide();
              return;
          }
          if (!this.isFocused && this.cancelRequestOnFocusLost) {
              return;
          }
          if (this._container) {
              // fix: remove usage of ngControl internals
              /** @type {?} */
              const _controlValue = (this.typeaheadLatinize
                  ? latinize(this.ngControl.control.value)
                  : this.ngControl.control.value) || '';
              // This improves the speed as it won't have to be done for each list item
              /** @type {?} */
              const normalizedQuery = _controlValue.toString().toLowerCase();
              this._container.query = this.tokenizeQuery(normalizedQuery);
              this._container.matches = this._matches;
          }
          else {
              this.show();
          }
      }
      /**
       * @protected
       * @param {?} options
       * @return {?}
       */
      prepareMatches(options) {
          /** @type {?} */
          const limited = options.slice(0, this.typeaheadOptionsLimit);
          /** @type {?} */
          const sorted = !this.typeaheadOrderBy ? limited : this.orderMatches(limited);
          if (this.typeaheadGroupField) {
              /** @type {?} */
              let matches = [];
              // extract all group names
              /** @type {?} */
              const groups = sorted
                  .map((/**
               * @param {?} option
               * @return {?}
               */
              (option) => getValueFromObject(option, this.typeaheadGroupField)))
                  .filter((/**
               * @param {?} v
               * @param {?} i
               * @param {?} a
               * @return {?}
               */
              (v, i, a) => a.indexOf(v) === i));
              groups.forEach((/**
               * @param {?} group
               * @return {?}
               */
              (group) => {
                  // add group header to array of matches
                  matches.push(new TypeaheadMatch(group, group, true));
                  // add each item of group to array of matches
                  matches = matches.concat(sorted
                      .filter((/**
                   * @param {?} option
                   * @return {?}
                   */
                  (option) => getValueFromObject(option, this.typeaheadGroupField) === group))
                      .map((/**
                   * @param {?} option
                   * @return {?}
                   */
                  (option) => new TypeaheadMatch(option, getValueFromObject(option, this.typeaheadOptionField)))));
              }));
              this._matches = matches;
          }
          else {
              this._matches = sorted.map((
              // tslint:disable-next-line:no-any
              /**
               * @param {?} option
               * @return {?}
               */
              (option) => new TypeaheadMatch(option, getValueFromObject(option, this.typeaheadOptionField))));
          }
      }
      /**
       * @protected
       * @param {?} options
       * @return {?}
       */
      orderMatches(options) {
          if (!options.length) {
              return options;
          }
          if (this.typeaheadOrderBy !== null
              && this.typeaheadOrderBy !== undefined
              && typeof this.typeaheadOrderBy === 'object'
              && Object.keys(this.typeaheadOrderBy).length === 0) {
              // tslint:disable-next-line:no-console
              console.error('Field and direction properties for typeaheadOrderBy have to be set according to documentation!');
              return options;
          }
          const { field, direction } = this.typeaheadOrderBy;
          if (!direction || !(direction === 'asc' || direction === 'desc')) {
              // tslint:disable-next-line:no-console
              console.error('typeaheadOrderBy direction has to equal "asc" or "desc". Please follow the documentation.');
              return options;
          }
          if (typeof options[0] === 'string') {
              return direction === 'asc' ? options.sort() : options.sort().reverse();
          }
          if (!field || typeof field !== 'string') {
              // tslint:disable-next-line:no-console
              console.error('typeaheadOrderBy field has to set according to the documentation.');
              return options;
          }
          return options.sort((/**
           * @param {?} a
           * @param {?} b
           * @return {?}
           */
          (a, b) => {
              /** @type {?} */
              const stringA = getValueFromObject(a, field);
              /** @type {?} */
              const stringB = getValueFromObject(b, field);
              if (stringA < stringB) {
                  return direction === 'asc' ? -1 : 1;
              }
              if (stringA > stringB) {
                  return direction === 'asc' ? 1 : -1;
              }
              return 0;
          }));
      }
      /**
       * @protected
       * @return {?}
       */
      hasMatches() {
          return this._matches.length > 0;
      }
      /**
       * @protected
       * @return {?}
       */
      checkDelimitersConflict() {
          if (this.typeaheadMultipleSearch && this.typeaheadSingleWords
              && (this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`, this.typeaheadMultipleSearchDelimiters))) {
              throw new Error(`Delimiters used in typeaheadMultipleSearchDelimiters must be different
            from delimiters used in typeaheadWordDelimiters (current value: ${this.typeaheadWordDelimiters}) and
            typeaheadPhraseDelimiters (current value: ${this.typeaheadPhraseDelimiters}).
            Please refer to the documentation`);
          }
      }
      /**
       * @protected
       * @param {?} str1
       * @param {?} str2
       * @return {?}
       */
      haveCommonCharacters(str1, str2) {
          for (let i = 0; i < str1.length; i++) {
              if (str1.charAt(i).indexOf(str2) > -1) {
                  return true;
              }
          }
          return false;
      }
  }
  TypeaheadDirective.ɵfac = function TypeaheadDirective_Factory(t) { return new (t || TypeaheadDirective)(ɵngcc0.ɵɵdirectiveInject(ɵngcc3.ComponentLoaderFactory), ɵngcc0.ɵɵdirectiveInject(TypeaheadConfig), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc4.NgControl), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.Renderer2), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ViewContainerRef)); };
  TypeaheadDirective.ɵdir = ɵngcc0.ɵɵdefineDirective({ type: TypeaheadDirective, selectors: [["", "typeahead", ""]], hostVars: 4, hostBindings: function TypeaheadDirective_HostBindings(rf, ctx) { if (rf & 1) {
          ɵngcc0.ɵɵlistener("input", function TypeaheadDirective_input_HostBindingHandler($event) { return ctx.onInput($event); })("keyup", function TypeaheadDirective_keyup_HostBindingHandler($event) { return ctx.onChange($event); })("click", function TypeaheadDirective_click_HostBindingHandler() { return ctx.onFocus(); })("focus", function TypeaheadDirective_focus_HostBindingHandler() { return ctx.onFocus(); })("blur", function TypeaheadDirective_blur_HostBindingHandler() { return ctx.onBlur(); })("keydown", function TypeaheadDirective_keydown_HostBindingHandler($event) { return ctx.onKeydown($event); });
      } if (rf & 2) {
          ɵngcc0.ɵɵattribute("aria-activedescendant", ctx.activeDescendant)("aria-owns", ctx.isOpen ? ctx._container.popupId : null)("aria-expanded", ctx.isOpen)("aria-autocomplete", ctx.list);
      } }, inputs: { isAnimated: "isAnimated", typeaheadLatinize: "typeaheadLatinize", typeaheadSingleWords: "typeaheadSingleWords", typeaheadWordDelimiters: "typeaheadWordDelimiters", typeaheadMultipleSearchDelimiters: "typeaheadMultipleSearchDelimiters", typeaheadPhraseDelimiters: "typeaheadPhraseDelimiters", typeaheadScrollable: "typeaheadScrollable", typeaheadOptionsInScrollableView: "typeaheadOptionsInScrollableView", typeaheadSelectFirstItem: "typeaheadSelectFirstItem", typeaheadIsFirstItemActive: "typeaheadIsFirstItemActive", dropup: "dropup", typeaheadOptionsLimit: "typeaheadOptionsLimit", typeaheadMinLength: "typeaheadMinLength", typeaheadWaitMs: "typeaheadWaitMs", typeaheadAsync: "typeaheadAsync", typeahead: "typeahead", adaptivePosition: "adaptivePosition", typeaheadOptionField: "typeaheadOptionField", typeaheadGroupField: "typeaheadGroupField", typeaheadOrderBy: "typeaheadOrderBy", typeaheadMultipleSearch: "typeaheadMultipleSearch", typeaheadItemTemplate: "typeaheadItemTemplate", optionsListTemplate: "optionsListTemplate", typeaheadHideResultsOnBlur: "typeaheadHideResultsOnBlur", container: "container" }, outputs: { typeaheadLoading: "typeaheadLoading", typeaheadNoResults: "typeaheadNoResults", typeaheadOnSelect: "typeaheadOnSelect", typeaheadOnBlur: "typeaheadOnBlur" }, exportAs: ["bs-typeahead"] });
  /** @nocollapse */
  TypeaheadDirective.ctorParameters = () => [
      { type: ComponentLoaderFactory },
      { type: TypeaheadConfig },
      { type: ChangeDetectorRef },
      { type: ElementRef },
      { type: NgControl },
      { type: Renderer2 },
      { type: ViewContainerRef }
  ];
  TypeaheadDirective.propDecorators = {
      typeahead: [{ type: Input }],
      typeaheadMinLength: [{ type: Input }],
      adaptivePosition: [{ type: Input }],
      isAnimated: [{ type: Input }],
      typeaheadWaitMs: [{ type: Input }],
      typeaheadOptionsLimit: [{ type: Input }],
      typeaheadOptionField: [{ type: Input }],
      typeaheadGroupField: [{ type: Input }],
      typeaheadOrderBy: [{ type: Input }],
      typeaheadAsync: [{ type: Input }],
      typeaheadLatinize: [{ type: Input }],
      typeaheadSingleWords: [{ type: Input }],
      typeaheadWordDelimiters: [{ type: Input }],
      typeaheadMultipleSearch: [{ type: Input }],
      typeaheadMultipleSearchDelimiters: [{ type: Input }],
      typeaheadPhraseDelimiters: [{ type: Input }],
      typeaheadItemTemplate: [{ type: Input }],
      optionsListTemplate: [{ type: Input }],
      typeaheadScrollable: [{ type: Input }],
      typeaheadOptionsInScrollableView: [{ type: Input }],
      typeaheadHideResultsOnBlur: [{ type: Input }],
      typeaheadSelectFirstItem: [{ type: Input }],
      typeaheadIsFirstItemActive: [{ type: Input }],
      typeaheadLoading: [{ type: Output }],
      typeaheadNoResults: [{ type: Output }],
      typeaheadOnSelect: [{ type: Output }],
      typeaheadOnBlur: [{ type: Output }],
      container: [{ type: Input }],
      dropup: [{ type: Input }],
      onInput: [{ type: HostListener, args: ['input', ['$event'],] }],
      onChange: [{ type: HostListener, args: ['keyup', ['$event'],] }],
      onFocus: [{ type: HostListener, args: ['click',] }, { type: HostListener, args: ['focus',] }],
      onBlur: [{ type: HostListener, args: ['blur',] }],
      onKeydown: [{ type: HostListener, args: ['keydown', ['$event'],] }]
  };
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TypeaheadDirective, [{
          type: Directive,
          args: [{
                  selector: '[typeahead]',
                  exportAs: 'bs-typeahead',
                  host: {
                      '[attr.aria-activedescendant]': 'activeDescendant',
                      '[attr.aria-owns]': 'isOpen ? this._container.popupId : null',
                      '[attr.aria-expanded]': 'isOpen',
                      '[attr.aria-autocomplete]': 'list'
                  }
              }]
      }], function () { return [{ type: ɵngcc3.ComponentLoaderFactory }, { type: TypeaheadConfig }, { type: ɵngcc0.ChangeDetectorRef }, { type: ɵngcc0.ElementRef }, { type: ɵngcc4.NgControl }, { type: ɵngcc0.Renderer2 }, { type: ɵngcc0.ViewContainerRef }]; }, { isAnimated: [{
              type: Input
          }], typeaheadLatinize: [{
              type: Input
          }], typeaheadSingleWords: [{
              type: Input
          }], typeaheadWordDelimiters: [{
              type: Input
          }], typeaheadMultipleSearchDelimiters: [{
              type: Input
          }], typeaheadPhraseDelimiters: [{
              type: Input
          }], typeaheadScrollable: [{
              type: Input
          }], typeaheadOptionsInScrollableView: [{
              type: Input
          }], typeaheadSelectFirstItem: [{
              type: Input
          }], typeaheadIsFirstItemActive: [{
              type: Input
          }], typeaheadLoading: [{
              type: Output
          }], typeaheadNoResults: [{
              type: Output
          }], typeaheadOnSelect: [{
              type: Output
          }], typeaheadOnBlur: [{
              type: Output
          }], dropup: [{
              type: Input
          }], typeaheadOptionsLimit: [{
              type: Input
          }], typeaheadMinLength: [{
              type: Input
          }], typeaheadWaitMs: [{
              type: Input
          }], typeaheadAsync: [{
              type: Input
          }], 
      /**
       * @param {?} e
       * @return {?}
       */
      // tslint:disable-next-line:no-any
      onInput: [{
              type: HostListener,
              args: ['input', ['$event']]
          }], 
      /**
       * @param {?} event
       * @return {?}
       */
      onChange: [{
              type: HostListener,
              args: ['keyup', ['$event']]
          }], 
      /**
       * @return {?}
       */
      onFocus: [{
              type: HostListener,
              args: ['click']
          }, {
              type: HostListener,
              args: ['focus']
          }], 
      /**
       * @return {?}
       */
      onBlur: [{
              type: HostListener,
              args: ['blur']
          }], 
      /**
       * @param {?} event
       * @return {?}
       */
      onKeydown: [{
              type: HostListener,
              args: ['keydown', ['$event']]
          }], typeahead: [{
              type: Input
          }], adaptivePosition: [{
              type: Input
          }], typeaheadOptionField: [{
              type: Input
          }], typeaheadGroupField: [{
              type: Input
          }], typeaheadOrderBy: [{
              type: Input
          }], typeaheadMultipleSearch: [{
              type: Input
          }], typeaheadItemTemplate: [{
              type: Input
          }], optionsListTemplate: [{
              type: Input
          }], typeaheadHideResultsOnBlur: [{
              type: Input
          }], container: [{
              type: Input
          }] }); })();
  if (false) {
      /**
       * options source, can be Array of strings, objects or
       * an Observable for external matching process
       * @type {?}
       */
      TypeaheadDirective.prototype.typeahead;
      /**
       * minimal no of characters that needs to be entered before
       * typeahead kicks-in. When set to 0, typeahead shows on focus with full
       * list of options (limited as normal by typeaheadOptionsLimit)
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadMinLength;
      /**
       * sets use adaptive position
       * @type {?}
       */
      TypeaheadDirective.prototype.adaptivePosition;
      /**
       * turn on/off animation
       * @type {?}
       */
      TypeaheadDirective.prototype.isAnimated;
      /**
       * minimal wait time after last character typed before typeahead kicks-in
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadWaitMs;
      /**
       * maximum length of options items list. The default value is 20
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOptionsLimit;
      /**
       * when options source is an array of objects, the name of field
       * that contains the options value, we use array item as option in case
       * of this field is missing. Supports nested properties and methods.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOptionField;
      /**
       * when options source is an array of objects, the name of field that
       * contains the group value, matches are grouped by this field when set.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadGroupField;
      /**
       * Used to specify a custom order of matches. When options source is an array of objects
       * a field for sorting has to be set up. In case of options source is an array of string,
       * a field for sorting is absent. The ordering direction could be changed to ascending or descending.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOrderBy;
      /**
       * should be used only in case of typeahead attribute is Observable of array.
       * If true - loading of options will be async, otherwise - sync.
       * true make sense if options array is large.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadAsync;
      /**
       * match latin symbols.
       * If true the word súper would match super and vice versa.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadLatinize;
      /**
       * Can be use to search words by inserting a single white space between each characters
       *  for example 'C a l i f o r n i a' will match 'California'.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadSingleWords;
      /**
       * should be used only in case typeaheadSingleWords attribute is true.
       * Sets the word delimiter to break words. Defaults to space.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadWordDelimiters;
      /**
       * Can be used to conduct a search of multiple items and have suggestion not for the
       * whole value of the input but for the value that comes after a delimiter provided via
       * typeaheadMultipleSearchDelimiters attribute. This option can only be used together with
       * typeaheadSingleWords option if typeaheadWordDelimiters and typeaheadPhraseDelimiters
       * are different from typeaheadMultipleSearchDelimiters to avoid conflict in determining
       * when to delimit multiple searches and when a single word.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadMultipleSearch;
      /**
       * should be used only in case typeaheadMultipleSearch attribute is true.
       * Sets the multiple search delimiter to know when to start a new search. Defaults to comma.
       * If space needs to be used, then explicitly set typeaheadWordDelimiters to something else than space
       * because space is used by default OR set typeaheadSingleWords attribute to false if you don't need
       * to use it together with multiple search.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadMultipleSearchDelimiters;
      /**
       * should be used only in case typeaheadSingleWords attribute is true.
       * Sets the word delimiter to match exact phrase.
       * Defaults to simple and double quotes.
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadPhraseDelimiters;
      /**
       * used to specify a custom item template.
       * Template variables exposed are called item and index;
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadItemTemplate;
      /**
       * used to specify a custom options list template.
       * Template variables: matches, itemTemplate, query
       * @type {?}
       */
      TypeaheadDirective.prototype.optionsListTemplate;
      /**
       * specifies if typeahead is scrollable
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadScrollable;
      /**
       * specifies number of options to show in scroll view
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOptionsInScrollableView;
      /**
       * used to hide result on blur
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadHideResultsOnBlur;
      /**
       * fired when an options list was opened and the user clicked Tab
       * If a value equal true, it will be chosen first or active item in the list
       * If value equal false, it will be chosen an active item in the list or nothing
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadSelectFirstItem;
      /**
       * makes active first item in a list
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadIsFirstItemActive;
      /**
       * fired when 'busy' state of this component was changed,
       * fired on async mode only, returns boolean
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadLoading;
      /**
       * fired on every key event and returns true
       * in case of matches are not detected
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadNoResults;
      /**
       * fired when option was selected, return object with data of this option
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOnSelect;
      /**
       * fired when blur event occurs. returns the active item
       * @type {?}
       */
      TypeaheadDirective.prototype.typeaheadOnBlur;
      /**
       * A selector specifying the element the typeahead should be appended to.
       * @type {?}
       */
      TypeaheadDirective.prototype.container;
      /**
       * This attribute indicates that the dropdown should be opened upwards
       * @type {?}
       */
      TypeaheadDirective.prototype.dropup;
      /**
       * if false don't focus the input element the typeahead directive is associated with on selection
       * @type {?}
       */
      TypeaheadDirective.prototype.activeDescendant;
      /** @type {?} */
      TypeaheadDirective.prototype.isOpen;
      /** @type {?} */
      TypeaheadDirective.prototype.list;
      /** @type {?} */
      TypeaheadDirective.prototype._container;
      /** @type {?} */
      TypeaheadDirective.prototype.isActiveItemChanged;
      /** @type {?} */
      TypeaheadDirective.prototype.isFocused;
      /** @type {?} */
      TypeaheadDirective.prototype.cancelRequestOnFocusLost;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadDirective.prototype.keyUpEventEmitter;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadDirective.prototype._matches;
      /**
       * @type {?}
       * @protected
       */
      TypeaheadDirective.prototype.placement;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype._typeahead;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype._subscriptions;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype._outsideClickListener;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype._allEnteredValue;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype.changeDetection;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype.element;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype.ngControl;
      /**
       * @type {?}
       * @private
       */
      TypeaheadDirective.prototype.renderer;
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class TypeaheadModule {
      /**
       * @return {?}
       */
      static forRoot() {
          return {
              ngModule: TypeaheadModule,
              providers: [ComponentLoaderFactory, PositioningService]
          };
      }
  }
  TypeaheadModule.ɵfac = function TypeaheadModule_Factory(t) { return new (t || TypeaheadModule)(); };
  TypeaheadModule.ɵmod = ɵngcc0.ɵɵdefineNgModule({ type: TypeaheadModule });
  TypeaheadModule.ɵinj = ɵngcc0.ɵɵdefineInjector({ imports: [[CommonModule]] });
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(TypeaheadModule, { declarations: function () { return [TypeaheadContainerComponent, TypeaheadDirective]; }, imports: function () { return [CommonModule]; }, exports: function () { return [TypeaheadContainerComponent, TypeaheadDirective]; } }); })();
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TypeaheadModule, [{
          type: NgModule,
          args: [{
                  imports: [CommonModule],
                  declarations: [TypeaheadContainerComponent, TypeaheadDirective],
                  exports: [TypeaheadContainerComponent, TypeaheadDirective],
                  entryComponents: [TypeaheadContainerComponent]
              }]
      }], null, null); })();
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  
  export { TypeaheadConfig, TypeaheadContainerComponent, TypeaheadDirective, TypeaheadMatch, TypeaheadModule, TypeaheadOptions, TypeaheadOrder, escapeRegexp, getValueFromObject, latinMap, latinize, tokenize, typeaheadAnimation as ɵa };
  
  //# sourceMappingURL=ngx-bootstrap-typeahead.js.map