!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@angular/common/http"),require("rxjs/operators"),require("ts-keycode-enum"),require("@ng-bootstrap/ng-bootstrap"),require("@angular/forms"),require("angular2-uuid"),require("@ng-select/ng-select"),require("@angular/common"),require("ngx-input-autosize"),require("ngx-mask"),require("@angular/platform-browser/animations"),require("@angular/material/autocomplete"),require("@angular/material/form-field"),require("@angular/material/input")):"function"==typeof define&&define.amd?define("ngx-advanced-searchbox",["exports","@angular/core","rxjs","@angular/common/http","rxjs/operators","ts-keycode-enum","@ng-bootstrap/ng-bootstrap","@angular/forms","angular2-uuid","@ng-select/ng-select","@angular/common","ngx-input-autosize","ngx-mask","@angular/platform-browser/animations","@angular/material/autocomplete","@angular/material/form-field","@angular/material/input"],t):t(e["ngx-advanced-searchbox"]={},e.ng.core,e.rxjs,e.ng.common.http,e.rxjs.operators,e.tsKeycodeEnum,e.ngBootstrap,e.ng.forms,e.angular2Uuid,e.ngSelect,e.ng.common,e.ngxInputAutosize,e.ngxMask,e.ng.platformBrowser.animations,e.ng.material.autocomplete,e.ng.material["form-field"],e.ng.material.input)}(this,function(e,r,a,t,l,u,n,p,i,o,s,c,d,f,h,m,v){"use strict";var g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e,t){function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function y(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var M=function(){function e(){}return e.decorators=[{type:r.Directive,args:[{selector:"[asTemplate]"}]}],e}(),C=function(){function e(e){var n=this;this._http=e,this._navigation=new a.ReplaySubject(2),this.customDomainsFormatter={},this.customDomainsModelFormatter={},this.customSuggestionsFormatter={},this.formatModelValue={},this.formatModelViewValue={},this.customSuggestionsStaticFn={},this.customSuggestionsAsyncFn={},this.customDomainsStaticFn={},this.customDomainsAsyncFn={},this.domainsAsyncSubject=new a.Subject,this.suggestionsFormatter=function(e){return n.customSuggestionsFormatter[e.model]?n.customSuggestionsFormatter[e.model]:function(e){return"object"==typeof e?e.label:e}},this.domainsFormatter=function(e,t){return n.customDomainsFormatter[e.model]?n.customDomainsFormatter[e.model](e,t):"object"==typeof t?e.bindLabel?t[e.bindLabel]:t.label:t},this.domainsModelFormatter=function(e,t){return n.customDomainsModelFormatter[e.model]?n.customDomainsModelFormatter[e.model](e,t):"object"==typeof t?e.bindLabel?t[e.bindLabel]:t.label:t}}return e.prototype.suggestionsStaticFn=function(e,t,n){return this.customSuggestionsStaticFn[t.model]?this.customSuggestionsStaticFn[t.model](e,t,n):e.pipe(l.map(function(t){var e={response:n,term:t};return""===t||(e.response=n.filter(function(e){return-1<e.toString().indexOf(t.toLowerCase())}).slice(0,10)),e}))},e.prototype.suggestionsAsyncFn=function(e,t,n){var o=this;return this.customSuggestionsAsyncFn[t.model]?this.customSuggestionsAsyncFn[t.model](e,t,n):e.pipe(l.switchMap(function(n){return o._http.get(t.suggestions,{params:{q:n}}).pipe(l.catchError(function(){return[]}),l.map(function(e){var t={response:[],term:""};return t.response=e.items.map(function(e){return{label:e.login}}),t.term=n,t}))}))},e.prototype.domainsStaticFn=function(e,n,t){return this.customDomainsStaticFn[n.model]?this.customDomainsStaticFn[n.model](e,n,t):e.pipe(l.map(function(t){var e={response:n.domains,term:t};return""===t||(e.response=n.domains.filter(function(e){return e[n.bindLabel]?-1<e[n.bindLabel].toString().toLowerCase().indexOf(t.toLowerCase()):-1<e.toString().indexOf(t.toLowerCase())}).slice(0,10)),e}))},e.prototype.domainsAsyncFn=function(e,t,n){var o=this;return this.customDomainsAsyncFn[t.model]?this.customDomainsAsyncFn[t.model](e,t,n):e.pipe(l.switchMap(function(e){return o._http.get(t.domains,{params:{q:e}})}),l.catchError(function(){return[]}),l.map(function(e){return e.items.map(function(e){return{label:e.login}})}))},Object.defineProperty(e.prototype,"navigation",{get:function(){return this.historyNavigation=this._navigation.pipe(l.take(2)),this._navigation},set:function(e){this._navigation=e},enumerable:!0,configurable:!0}),e.decorators=[{type:r.Injectable}],e.ctorParameters=function(){return[{type:t.HttpClient}]},e}(),b=function(){function e(){}return e.getCurrentCaretPosition=function(e){if(!e)return 0;try{if("number"==typeof e.selectionStart)return"backward"===e.selectionDirection?e.selectionStart:e.selectionEnd;if(document.selection){e.focus();var t=document.selection.createRange(),n=document.selection.createRange().text.length;return t.moveStart("character",-e.value.length),t.text.length-n}}catch(o){}return 0},e.setCaretPosition=function(e,t){var n;if(e)try{e.setSelectionRange?(e.focus(),e.setSelectionRange(t,t)):e.createTextRange&&(e.focus(),(n=e.createTextRange()).move("character",t),n.select())}catch(o){}},e.getterSetterModelTree=function(e,t,n){if(0===t.length)return e;var o=t[0];if(!e[o]){if(!n)return!1;if(1===t.length)return e[o]=n,e[o];e[o]={}}return t.shift(),this.getterSetterModelTree(e[o],t,n)},e}(),x={eq:"=",lt:"<",le:"≤",ne:"≠",gt:">",ge:"≥",startsWith:"[...",endsWith:"...]",contains:"[...]"},S=function(){function e(e,t,n,o,i){this.element=e,this.typeahead=t,this._renderer=n,this._http=o,this._config=i,this.searchBoxControl=new p.FormControl,this.editNext=new r.EventEmitter,this.editPrev=new r.EventEmitter,this.onChangeViewModel=new r.EventEmitter,this.openOnLoad=!0,this.viewModel=[],this.searchBox="",this.focusInput$=new a.Subject,this.filtersControllers={},this.focusIndex=0,this.afterViewInitFilters$=new a.Subject,this.formatter=function(e){return e.label}}return Object.defineProperty(e.prototype,"template",{get:function(){return this._template},set:function(e){e.map(function(e){var t=i.UUID.UUID();return Object.assign({_templateUuid:t},e)}),this._template=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"form",{get:function(){return this._form||(this._form=new p.FormGroup({})),this._form},set:function(e){this._form=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validators",{get:function(){return this._validators||(this._validators={}),this._validators},set:function(e){this._validators=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operators",{get:function(){return this._operators||(this._operators=x),Object.assign({},x,this._operators)},set:function(e){this._operators=e},enumerable:!0,configurable:!0}),e.prototype.filterSearchBox=function(){var i=this;return this.template.filter(function(o){return 0===i.viewModel.filter(function(e){if(e.model===o.model&&e.value&&e.value.op&&!e.value.value)return!1;var t=e.multiple;if(t&&"*"!==t){var n=b.getterSetterModelTree(i.model,e.model.split("."));return e.model===o.model&&n&&e.multiple<=n.length}return e.model===o.model&&!e.multiple}).length})},e.prototype.trackByFn=function(e,t){return t.uuid},e.prototype.displayAutocompleteFn=function(e){return e?e.label:undefined},e.prototype.ngOnInit=function(){var n=this;this.searchboxInputClick$=a.fromEvent(this.searchboxInput.nativeElement,"click").pipe(l.map(function(e){return e.preventDefault(),e.stopPropagation(),e})),this.searchBoxFunc=this.searchBoxControl.valueChanges.pipe(l.startWith(""),l.merge(this.searchboxInputClick$),l.merge(this.focusInput$),l.debounceTime(50),l.distinctUntilChanged(),l.map(function(t){return(t instanceof MouseEvent||t===undefined)&&(t=n.searchBox),n.filterSearchBox().filter(function(e){return-1<e.label.toLowerCase().indexOf(t.toLowerCase())}).slice(0,10)})),this._renderer.setProperty(this.searchboxInput.nativeElement,"value",""),this._config.navigation.next({controller:null,from:null}),this._config.navigation.next({controller:this,from:"searchbox"}),this.editPrev.pipe(l.filter(function(e){return!e.viewModel})).subscribe(function(e){n.viewModel[n.viewModel.length-1]&&n.prevFilterControllerFromSearchbox(n.viewModel[n.viewModel.length-1])&&n.prevFilterControllerFromSearchbox(n.viewModel[n.viewModel.length-1]).onFocus("prev")})},e.prototype.ngOnChanges=function(e){var t=this;e.template&&e.template.firstChange&&this.openOnLoad&&setTimeout(function(){t.focusInput$.next(),t.searchboxInput.nativeElement.focus()}),e.template&&e.template.currentValue&&this.createViewFilterFromModel(this.model),e.model&&e.model.currentValue&&(this.createViewFilterFromModel(this.model),this.populateForm())},e.prototype.populateForm=function(){try{for(var e=y(this.viewModel),t=e.next();!t.done;t=e.next()){var n=t.value;this.validators[n.model]?this.form.addControl(n.model+"_"+n.uuid,new p.FormControl(n.value?n.value:"",this.validators[n.model])):this.form.addControl(n.model+"_"+n.uuid,new p.FormControl(n.value?n.value:""))}}catch(r){o={error:r}}finally{try{t&&!t.done&&(i=e["return"])&&i.call(e)}finally{if(o)throw o.error}}var o,i},e.prototype.removeFormControls=function(){for(var e in this.form.controls)this.form.removeControl(e)},e.prototype.findTemplate=function(t,n){return this.template.filter(function(e){return e[t]===n})[0]},e.prototype.keydown=function(e,t,n){void 0===n&&(n={});var o={viewModel:t,options:n};if(n.blackList||(n.blackList=[]),-1!==[u.Key.Backspace,u.Key.Tab,u.Key.Enter,u.Key.LeftArrow,u.Key.RightArrow].indexOf(e.which)){var i=b.getCurrentCaretPosition(e.target);e.which===u.Key.Backspace&&n.blackList.indexOf("Backspace")<0?0===i&&(e.preventDefault(),this.editPrev.emit(o)):e.which===u.Key.Tab&&n.blackList.indexOf("Tab")<0?e.shiftKey?(e.preventDefault(),b.setCaretPosition(e.target,e.target.value.length),this.editPrev.emit(o)):(e.preventDefault(),b.setCaretPosition(e.target,e.target.value.length),this.editNext.emit(o)):e.which===u.Key.Enter&&n.blackList.indexOf("Enter")<0?(b.setCaretPosition(e.target,e.target.value.length),this.editNext.emit(o)):e.which===u.Key.LeftArrow&&n.blackList.indexOf("LeftArrow")<0?0===i&&(b.setCaretPosition(e.target,e.target.value.length),this.editPrev.emit(o)):e.which===u.Key.RightArrow&&n.blackList.indexOf("RightArrow")<0&&i===e.target.value.length&&(b.setCaretPosition(e.target,e.target.value.length),this.editNext.emit(o))}},e.prototype.addFilter=function(e){var t=this,n=this.createViewFilter(e.option.value);e.option.deselect(),this.searchBoxControl.setValue(""),this.afterViewInitFilters$.pipe(l.filter(function(e){return e.uuid===n.uuid}),l.first()).subscribe(function(e){t.getFilterController(n).onFocus("next")})},e.prototype.createViewFilter=function(e,t){var n=i.UUID.UUID(),o=Object.assign({uuid:n},this.findTemplate("model",e.model),{value:t});return this._config.formatModelViewValue[e.model]&&(o=Object.assign({uuid:n},this.findTemplate("model",e.model))),t&&(o.value=t,this._config.formatModelViewValue[e.model]&&(o.value=this._config.formatModelViewValue[e.model](t,e))),this.viewModel.push(o),this.searchBoxControl.setValue(""),this.validators[o.model]?this.form.addControl(o.model+"_"+o.uuid,new p.FormControl(o.value?o.value:"",this.validators[o.model])):this.form.addControl(o.model+"_"+o.uuid,new p.FormControl(o.value?o.value:"")),this.onChangeViewModel.emit(this.viewModel),o},e.prototype.createViewFilterFromModel=function(e){this.removeFormControls(),this.viewModel=[];try{for(var t=y(this.template),n=t.next();!n.done;n=t.next()){var o=n.value,i=b.getterSetterModelTree(e,o.model.split("."));if(i)if(Array.isArray(i))try{for(var r=y(i),a=r.next();!a.done;a=r.next()){var s=a.value;this.createViewFilter(o,s)}}catch(d){p={error:d}}finally{try{a&&!a.done&&(c=r["return"])&&c.call(r)}finally{if(p)throw p.error}}else this.createViewFilter(o,i)}}catch(f){l={error:f}}finally{try{n&&!n.done&&(u=t["return"])&&u.call(t)}finally{if(l)throw l.error}}var l,u,p,c},e.prototype.addFilterController=function(e,t){this.filtersControllers[e]=t},e.prototype.removeFilterController=function(e){delete this.filtersControllers[e]},e.prototype.nextFilterController=function(e){var t=this.viewModel.indexOf(e);if(0<=t&&t+1<this.viewModel.length){var n=this.viewModel[t+1];return this._config.navigation.next({controller:this.filtersControllers[this.viewModel[t].uuid],from:"next"}),this.filtersControllers[n.uuid]}return this._config.navigation.next({controller:this,from:"searchbox"}),this},e.prototype.prevFilterController=function(e){var t=this.viewModel.indexOf(e);if(0<t){var n=this.viewModel[t-1];return this._config.navigation.next({controller:this.filtersControllers[this.viewModel[t].uuid],from:"prev"}),this.filtersControllers[n.uuid]}return this._config.navigation.next({controller:this,from:"searchbox"}),this},e.prototype.prevFilterControllerFromSearchbox=function(e){return this.filtersControllers[e.uuid]},e.prototype.getFilterController=function(e){return this.filtersControllers[e.uuid]},e.prototype.removeViewModel=function(e){var t=this.viewModel.indexOf(e);t!==undefined&&-1<t&&(this.viewModel.splice(t,1),this.form.removeControl(e.model+"_"+e.uuid)),this.onChangeViewModel.emit(this.viewModel)},e.prototype.removeAll=function(){this.viewModel=[],this.model={}},e.prototype.onFocus=function(e){this.searchboxInput.nativeElement.focus()},e.decorators=[{type:r.Component,args:[{selector:"advanced-searchbox",template:'\n    <div [formGroup]="form">\n        <ng-template #rt let-r="result" let-t="term">\n            {{ r.label}}\n        </ng-template>\n        <ng-container *ngFor="let filter of viewModel; trackBy: trackByFn;" >\n            <ng-container [ngSwitch]="filter.type" >\n                <as-input *ngSwitchCase="\'INPUT\'" [viewModel]="filter" class="as-filter" [formControl]="form.get([filter.model+\'_\'+filter.uuid])" ></as-input>\n                <as-input-operators *ngSwitchCase="\'OPERATORS\'" [viewModel]="filter" class="as-filter" [formControl]="form.get([filter.model+\'_\'+filter.uuid])" ></as-input-operators>\n                <ng-container *ngTemplateOutlet="externalTemplate; context: {$implicit: filter}"></ng-container>\n            </ng-container>\n        </ng-container>\n        \n        <input type="text" id="searchBootstrap" class="form-control form-control-sm" #searchbox autosize (keydown)="keydown($event)" (focus)="focusInput$.next()" placeholder="Cerca" aria-label="Number" [formControl]="searchBoxControl" [matAutocomplete]="auto">\n        <mat-autocomplete #auto="matAutocomplete" (optionSelected)="addFilter($event)" [displayWith]="displayAutocompleteFn" panelWidth="500">\n            <mat-option *ngFor="let option of searchBoxFunc | async" [value]="option">\n                {{option.label}}\n            </mat-option>\n        </mat-autocomplete>\n    </div>\n    ',providers:[n.NgbTypeaheadConfig]}]}],e.ctorParameters=function(){return[{type:r.ElementRef},{type:n.NgbTypeaheadConfig},{type:r.Renderer2},{type:t.HttpClient},{type:C}]},e.propDecorators={editNext:[{type:r.Output,args:["editNext"]}],editPrev:[{type:r.Output,args:["editPrev"]}],onChangeViewModel:[{type:r.Output,args:["onChangeViewModel"]}],externalTemplate:[{type:r.ContentChild,args:[M,{read:r.TemplateRef}]}],searchboxInput:[{type:r.ViewChild,args:["searchbox"]}],searchboxModel:[{type:r.ViewChild,args:["searchboxModel"]}],typeaheadController:[{type:r.ViewChild,args:[n.NgbTypeahead]}],openOnLoad:[{type:r.Input,args:["openOnLoad"]}],template:[{type:r.Input}],model:[{type:r.Input}],form:[{type:r.Input}],validators:[{type:r.Input}],operators:[{type:r.Input}]},e}(),_="OPERATORS",E=function(){function e(e,t,n,o,i){this.advancedSearchBox=e,this._renderer=t,this._el=n,this._http=o,this._config=i,this._onChange=function(e){},this._isFirstDocClick=!0,this.focusInput$=new a.Subject}return e.prototype.writeValue=function(e){this._onChange(e)},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){},e.prototype.ngAfterViewInit=function(){this.advancedSearchBox.afterViewInitFilters$.next(this.viewModel),this.maxWidthInput()},e.prototype.ngOnInit=function(){this.advancedSearchBox.addFilterController(this.viewModel.uuid,this),this.inputClickUnsubscribe$_=a.fromEvent(this._el.nativeElement,"click").pipe(l.map(function(e){return e.preventDefault(),e.stopPropagation(),e})).subscribe(function(){})},e.prototype.ngOnDestroy=function(){this.advancedSearchBox.removeFilterController(this.viewModel.uuid),this.inputClickUnsubscribe$_.unsubscribe()},e.prototype.onFocus=function(e){var t=this;setTimeout(function(){t.focusInput()},0)},e.prototype.onBlur=function(){},e.prototype.remove=function(){this.advancedSearchBox.removeViewModel(this.viewModel),this.viewToModel()},e.prototype.removeEmpty=function(e){var t,n,o=!0;try{for(var i=y(e),r=i.next();!r.done;r=i.next()){var a=r.value;if(a||!1===a){o=!1;break}}}catch(s){t={error:s}}finally{try{r&&!r.done&&(n=i["return"])&&n.call(i)}finally{if(t)throw t.error}}return this.advancedSearchBox.form.controls[this.viewModel.model+"_"+this.viewModel.uuid]&&"INVALID"===this.advancedSearchBox.form.controls[this.viewModel.model+"_"+this.viewModel.uuid].status?(this.remove(),!0):!!o&&(this.remove(),!0)},e.prototype.getKeys=function(e){return Object.keys(e)},e.prototype.viewToModel=function(){var e,t,n={};try{for(var o=y(this.advancedSearchBox.viewModel),i=o.next();!i.done;i=o.next()){var r=i.value,a=r.value;this._config.formatModelValue[r.model]&&(a=this._config.formatModelValue[r.model](r.value)),r.multiple?b.getterSetterModelTree(n,r.model.split("."),[]).push(a):b.getterSetterModelTree(n,r.model.split("."),a)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(t=o["return"])&&t.call(o)}finally{if(e)throw e.error}}for(var s in this.advancedSearchBox.model)this.advancedSearchBox.model.hasOwnProperty(s)&&delete this.advancedSearchBox.model[s];Object.assign(this.advancedSearchBox.model,n),this.maxWidthInput()},e.prototype.clickout=function(e){this._isFirstDocClick||this._el.nativeElement.contains(e.target)||(this.advancedSearchBox.getFilterController(this.viewModel).onBlur(),this.viewToModel()),this._isFirstDocClick=!1},e.prototype.resize=function(e){this.maxWidthInput()},e.prototype.onSelectDomains=function(e){this.viewModel.type===_?(this._config.domainsFormatter(this.viewModel,this.viewModel.value.value)!==this._config.domainsFormatter(this.viewModel,e),this.viewModel.value.value=e):(this._config.domainsFormatter(this.viewModel,this.viewModel.value)!==this._config.domainsFormatter(this.viewModel,e),this.viewModel.value=e),this.advancedSearchBox.nextFilterController(this.viewModel).onFocus("next"),this.viewToModel(),this._onChange(this.viewModel.value)},e.prototype.onSelectSuggestions=function(e){var t;this.viewModel.type===_?(t=this._config.suggestionsFormatter(this.viewModel)(this.viewModel.value.value)!==this._config.suggestionsFormatter(this.viewModel)(e.item),this.viewModel.value.value=e.item):(t=this._config.suggestionsFormatter(this.viewModel)(this.viewModel.value)!==this._config.suggestionsFormatter(this.viewModel)(e.item),this.viewModel.value=e.item),t&&this.advancedSearchBox.nextFilterController(this.viewModel).onFocus("next"),this.viewToModel(),this.inputComponent.typeaheadController._userInput=this.inputComponent.suggestionsFormatter(e.item),this._onChange(this.viewModel.value)},e.prototype.focusInput=function(){this.inputComponent.inputRef.nativeElement&&this.inputComponent.inputRef.nativeElement.focus(),this.inputComponent.inputRef instanceof n.NgbTypeahead&&this.inputComponent.inputRef._elementRef.nativeElement.focus(),this.inputComponent.inputRef instanceof o.NgSelectComponent&&(this.inputComponent.inputRef.open(),this.inputComponent.focusInput$.next(undefined))},e.prototype.blurInput=function(){this.inputComponent.inputRef instanceof n.NgbTypeahead&&this.inputComponent.inputRef.dismissPopup(),this.inputComponent.inputRef instanceof o.NgSelectComponent&&this.inputComponent.inputRef.close(),this.operatorsDropDownDir instanceof n.NgbDropdown&&this.operatorsDropDownDir.close()},e.prototype.maxWidthInput=function(){var e=this.advancedSearchBox.element.nativeElement.clientWidth-30-(this._el.nativeElement.clientWidth-this.inputComponent._element.nativeElement.clientWidth);this.inputComponent.inputRef.nativeElement&&(this.inputComponent.inputRef.nativeElement.style.maxWidth=e+"px"),this.inputComponent.inputRef instanceof n.NgbTypeahead&&(this.inputComponent.inputRef._elementRef.nativeElement.style.maxWidth=e+"px"),this.inputComponent.inputRef instanceof o.NgSelectComponent&&(this.inputComponent.inputElementRef.nativeElement.style.maxWidth=e+"px")},e.propDecorators={viewModel:[{type:r.Input}],operatorsDropDownDir:[{type:r.ViewChild,args:[n.NgbDropdown]}],buttonToggleEr:[{type:r.ViewChild,args:["buttonToggle"]}],inputComponent:[{type:r.ViewChild,args:["inputComponent"]}],clickout:[{type:r.HostListener,args:["document:click",["$event"]]}],resize:[{type:r.HostListener,args:["window:resize",["$event"]]}]},e}(),F={SIMPLE:"SIMPLE",SIMPLE_MASK:"SIMPLE_MASK",SUGGESTIONS:"SUGGESTIONS",DOMAINS:"DOMAINS"},D=function(s){function e(e,t,n,o,i,r){var a=s.call(this,e,t,n,o,i)||this;return a.advancedSearchBox=e,a.renderer=t,a.el=n,a._http=o,a._config=i,a.resolver=r,a.operatorsList=[],a.operatorsEnum=a.advancedSearchBox.operators,a}return w(e,s),e.prototype.ngOnChanges=function(e){e.viewModel&&(this.operatorsList=e.viewModel.currentValue.operators)},e.prototype.ngOnInit=function(){var t=this;s.prototype.ngOnInit.call(this),this.viewModel.value||(this.viewModel.value={op:this.operatorsList[0]}),this.advancedSearchBox.editNext.pipe(l.filter(function(e){return e.viewModel&&e.viewModel.uuid===t.viewModel.uuid})).subscribe(function(e){e.options.id&&"buttonDropDown"===e.options.id?(t.operatorsDropDownDir.close(),t.focusInput(),t.focusInput$.next()):(t.advancedSearchBox.nextFilterController(e.viewModel).onFocus("next"),t.onBlur())}),this.advancedSearchBox.editPrev.pipe(l.filter(function(e){return e.viewModel&&e.viewModel.uuid===t.viewModel.uuid})).subscribe(function(e){e.options.id&&"buttonDropDown"===e.options.id?(t.advancedSearchBox.prevFilterController(e.viewModel).onFocus("prev"),t.operatorsDropDownDir.close(),t.buttonToggleEr.nativeElement.blur(),t.onBlur()):(t.blurInput(),t.operatorsDropDownDir.open(),t.buttonToggleEr.nativeElement.focus())}),this.advancedSearchBox.searchboxInputClick$.subscribe(function(e){t.operatorsDropDownDir.close()}),this.viewModel.suggestions||this.viewModel.domains||(this.viewModel.mask?this.inputType=F.SIMPLE_MASK:this.inputType=F.SIMPLE),this.viewModel.suggestions&&(this.inputType=F.SUGGESTIONS),this.viewModel.domains&&(this.inputType=F.DOMAINS)},e.prototype.onBlur=function(){this.operatorsDropDownDir.close(),this._onChange(this.viewModel.value.value),this.removeEmpty([this.viewModel.value.value]),this.blurInput()},e.prototype.onFocus=function(e){var t=this;"prev"===e?this.focusInput():setTimeout(function(){t.buttonToggleEr.nativeElement.focus(),t.operatorsDropDownDir.open()})},e.prototype.onChange=function(){this._onChange(this.viewModel.value.value),this.viewToModel()},e.prototype.onChangeOperators=function(e,t){var n={viewModel:this.viewModel,options:{id:"buttonDropDown"}};if(this._onChange(this.viewModel.value.value),e instanceof KeyboardEvent)switch(e.which){case u.Key.Enter:e.preventDefault(),this.viewModel.value.op=t,this.advancedSearchBox.editNext.next(n),this.viewModel.value.value&&this.viewToModel()}e instanceof MouseEvent&&(e.preventDefault(),e.stopPropagation(),this.viewModel.value.op=t,this.advancedSearchBox.editNext.next(n),this.viewModel.value.value&&this.viewToModel())},e.prototype.onSelectDomains=function(e){this.viewModel.value.value=e;var t={viewModel:this.viewModel,options:{}};this.advancedSearchBox.editNext.next(t),this._onChange(this.viewModel.value.value),this.viewToModel()},e.decorators=[{type:r.Component,args:[{selector:"as-input-operators",template:'\n    <div class="input-group input-group-sm">\n        <span class="input-group-prepend">\n            <div class="btn-group">\n                <span class="btn btn-sm btn-outline-primary notClickable">{{viewModel.label}}</span>\n                <div ngbDropdown class="btn-group" appDropdownNavigation>\n                    <button class="btn btn-sm btn-outline-primary noRadius" type="button" ngbDropdownToggle #buttonToggle \n                    (keydown)="advancedSearchBox.keydown($event, viewModel, {id:\'buttonDropDown\'})">{{viewModel.value.op ? operatorsEnum[viewModel.value.op] : \'..\'}}</button>\n                    <div class="dropdown-menu" ngbDropdownMenu>\n                        <a class="dropdown-item" (focus)="viewModel.value.op = operator" *ngFor="let operator of operatorsList" \n                        (click)="onChangeOperators($event, operator)" (keydown)="onChangeOperators($event, operator)" href="javascript:void(0)">\n                            {{operatorsEnum[operator]}}\n                        </a>\n                    </div>\n                </div>\n            </div>\n        </span>\n        <ng-container [ngSwitch]="inputType">\n            <as-simple-input-with-operators *ngSwitchCase="\'SIMPLE\'" #inputComponent ></as-simple-input-with-operators>\n            <as-simple-input-with-operators-mask *ngSwitchCase="\'SIMPLE_MASK\'" #inputComponent ></as-simple-input-with-operators-mask>\n            <as-suggestions-input-with-operators *ngSwitchCase="\'SUGGESTIONS\'" #inputComponent ></as-suggestions-input-with-operators>\n            <as-domains-input-with-operators *ngSwitchCase="\'DOMAINS\'" #inputComponent (change)="onChange()"></as-domains-input-with-operators>\n        </ng-container>\n        <span class="input-group-append">\n            <button class="btn btn-outline-primary" type="button" (click)="remove()">X</button>\n        </span>\n    </div>\n    ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:S},{type:r.Renderer2},{type:r.ElementRef},{type:t.HttpClient},{type:C},{type:r.ComponentFactoryResolver}]},e}(E),I={Domains:0,Suggestions:1};I[I.Domains]="Domains",I[I.Suggestions]="Suggestions";var R=function(){function e(e,t,n,o){var i=this;this.advancedSearchBox=e,this._http=t,this._config=n,this._element=o,this.itemsDomain=[],this.domainsAsyncSubject=new a.Subject,this.change=new r.EventEmitter,this._onChange=function(e){},this.focusInput$=new a.Subject,this.domainsResults$=new a.ReplaySubject(1),this.suggestionsResults$=new a.ReplaySubject(1),this.suggestionsFormatter=this._config.suggestionsFormatter,this.domainsFormatter=this._config.domainsFormatter,this.domainTypeahead=new r.EventEmitter,this.suggestionsFunc=function(e){return e.pipe(l.merge(i.searchboxInputClick$),l.merge(i.focusInput$),l.distinctUntilChanged(),l.map(function(e){return(e instanceof MouseEvent||e===undefined)&&(e=i.inputRef._elementRef.nativeElement.value||""),e}),a.pipe(function(e){return i.filter.viewModel.suggestions?"string"==typeof i.filter.viewModel.suggestions||""===i.filter.viewModel.suggestions?e.pipe(function(e){return i._config.suggestionsAsyncFn(e,i.filter.viewModel,i.filter.viewModel.suggestions)}).pipe(l.tap(function(e){i.suggestionsResults$.next({viewModel:i.filter.viewModel,response:e})})).pipe(i.filterNotDuplicateSuggestions()):e.pipe(function(e){return i._config.suggestionsStaticFn(e,i.filter.viewModel,i.filter.viewModel.suggestions)}).pipe(l.tap(function(e){i.suggestionsResults$.next({viewModel:i.filter.viewModel,response:e})})).pipe(i.filterNotDuplicateSuggestions()):e}))}}return e.prototype.writeValue=function(e){this._onChange(e)},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){},e.prototype.ngOnInit=function(){var t=this;this.searchboxInputClick$=a.fromEvent(this.inputElementRef.nativeElement,"click").pipe(l.map(function(e){return e.preventDefault(),e.stopPropagation(),e})),this.typeaheadController&&(this.typeaheadController._userInput=""),this.filter.focusInput$=this.focusInput$,this.filter.viewModel.domains&&this.domainTypeahead.pipe(l.merge(this.searchboxInputClick$),l.merge(this.focusInput$),l.map(function(e){return(e instanceof MouseEvent||!e)&&(e=t.inputRef._value&&t.inputRef._value[t.inputRef.bindLabel]||""),e}),l.filter(function(e){return t.filter.viewModel.domains})).pipe(function(e){return"string"==typeof t.filter.viewModel.domains||""===t.filter.viewModel.domains?e.pipe(function(e){return t._config.domainsAsyncFn(e,t.filter.viewModel,t.advancedSearchBox.model)}).pipe(l.tap(function(e){t.domainsResults$.next({viewModel:t.filter.viewModel,response:e.response})})).pipe(t.filterNotDuplicateDomains()):e.pipe(function(e){return t._config.domainsStaticFn(e,t.filter.viewModel,t.advancedSearchBox.model)}).pipe(l.tap(function(e){t.domainsResults$.next({viewModel:t.filter.viewModel,response:e})})).pipe(t.filterNotDuplicateDomains())}).subscribe(function(e){"object"==typeof e&&(t.itemsDomain=e)})},e.prototype._filterNotDuplicate=function(i){var r=this;return l.map(function(e){var t=e.response,n=e.term,o=b.getterSetterModelTree(r.advancedSearchBox.model,r.filter.viewModel.model.split("."))||[];return t.filter(function(t){return 0===o.filter(function(e){return!!e&&(i===I.Domains?(r._config.formatModelViewValue[r.filter.viewModel.model]&&(e=r._config.formatModelViewValue[r.filter.viewModel.model](e,r.filter.viewModel)),r._config.domainsFormatter(r.filter.viewModel,e)===r._config.domainsModelFormatter(r.filter.viewModel,t)&&r._config.domainsFormatter(r.filter.viewModel,e).toLowerCase()!==n.toLowerCase()):e===r._config.suggestionsFormatter(r.filter.viewModel)(t)&&r._config.suggestionsFormatter(r.filter.viewModel)(e).toLowerCase()!==n.toLowerCase())}).length})})},e.prototype.filterNotDuplicateDomains=function(){return this._filterNotDuplicate(I.Domains)},e.prototype.filterNotDuplicateSuggestions=function(){return this._filterNotDuplicate(I.Suggestions)},e.propDecorators={inputRef:[{type:r.ViewChild,args:["inputRef"]}],inputElementRef:[{type:r.ViewChild,args:["inputRef",{read:r.ElementRef}]}],typeaheadController:[{type:r.ViewChild,args:[n.NgbTypeahead]}],ngModel:[{type:r.ViewChild,args:[p.NgModel]}],change:[{type:r.Output,args:["change"]}]},e}(),V=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-simple-input-with-operators",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value.value"\n            (change)="filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event,filter.viewModel)" \n            autosize \n            [placeholder]="filter.viewModel.label"\n            #inputRef\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:D}]},e}(R),O=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-suggestions-input-with-operators",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value.value"\n            (change)="filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event, filter.viewModel)"\n            (selectItem)="filter.onSelectSuggestions($event)"\n            autosize \n            [autosizeProp]="filter.viewModel.bindLabel"\n            [placeholder]="filter.viewModel.label"\n            [ngbTypeahead]="suggestionsFunc"\n            [inputFormatter]="suggestionsFormatter(filter.viewModel)"\n            [resultFormatter]="suggestionsFormatter(filter.viewModel)"\n            #inputRef\n            editable="false"\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:D}]},e.propDecorators={inputRef:[{type:r.ViewChild,args:[n.NgbTypeahead]}]},e}(R),A=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r._filterValue="",r}return w(e,a),Object.defineProperty(e.prototype,"filterValue",{get:function(){return this._filterValue},set:function(e){this._filterValue=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;a.prototype.ngOnInit.call(this),this.ngControl.valueChanges.subscribe(function(e){""===e||e===undefined||null===e||(t.filter.viewModel.bindLabel?t.filterValue=e[t.filter.viewModel.bindLabel]:t.filterValue=e)})},e.prototype.ngDoCheck=function(){this.typeahead.filterValue&&(this.filterValue=this.typeahead.filterValue)},e.prototype.ngAfterViewChecked=function(){this.inputElementRef.nativeElement.style.width="calc("+this.inputAutosize.nativeElement.style.width+" + 50px)"},e.prototype.onClear=function(){this._filterValue=null,this.focusInput$.next(undefined),this.filter.remove()},e.prototype.onRemove=function(e){this.focusInput$.next(undefined),this.inputRef.open(),this.filter.removeEmpty([this.filter.viewModel.value])},e.prototype.onChange=function(e){var t=this;setTimeout(function(){""===e||e===undefined||null===e?(t.focusInput$.next(undefined),t.inputRef.open(),t.filter.removeEmpty([t.filter.viewModel.value])):(t.filter.viewModel.bindLabel?t._filterValue=e[t.filter.viewModel.bindLabel]:t._filterValue=e,t.filter.viewModel.bindValue?t.filter.onSelectDomains(e[t.filter.viewModel.bindValue]):t.filter.onSelectDomains(e)),t._onChange(e),t.change.emit(e)},0)},e.decorators=[{type:r.Component,args:[{selector:"as-domains-input-with-operators",template:'\n    <ng-select \n        appendTo="body"\n        [bindLabel]="filter.viewModel.bindLabel"\n        [bindValue]="filter.viewModel.bindValue"\n        (focus)="filter.focusInput$.next()"\n        (keydown)="advancedSearchBox.keydown($event, filter.viewModel)"\n        #inputRef\n        [placeholder]="filter.viewModel.label"\n        [typeahead]="domainTypeahead"\n        [items]="itemsDomain"\n        (change)="onChange($event)"\n        (clear)="onClear()"\n        (remove)="onRemove($event)"\n        [(ngModel)]="filter.viewModel.value.value">\n    </ng-select>\n    <input autosize #inputAutosize type="text" [(ngModel)]="filterValue" [hidden]="true" />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        ng-select{\n            height:100%;\n            min-width:200px;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:D}]},e.propDecorators={typeahead:[{type:r.ViewChild,args:[o.NgSelectComponent]}],inputAutosize:[{type:r.ViewChild,args:["inputAutosize",{read:r.ElementRef}]}],ngControl:[{type:r.ViewChild,args:["inputRef",{read:p.NgControl}]}]},e}(R),k={SIMPLE:"SIMPLE",SIMPLE_MASK:"SIMPLE_MASK",SUGGESTIONS:"SUGGESTIONS",DOMAINS:"DOMAINS"},N=function(s){function e(e,t,n,o,i,r){var a=s.call(this,e,t,n,o,i)||this;return a.advancedSearchBox=e,a._renderer=t,a._el=n,a._http=o,a._config=i,a.resolver=r,a}return w(e,s),e.prototype.ngOnInit=function(){var t=this;s.prototype.ngOnInit.call(this),this.advancedSearchBox.editNext.pipe(l.filter(function(e){return e.viewModel&&e.viewModel.uuid===t.viewModel.uuid})).subscribe(function(e){t.advancedSearchBox.nextFilterController(e.viewModel).onFocus("next"),t.onBlur()}),this.advancedSearchBox.editPrev.pipe(l.filter(function(e){return e.viewModel&&e.viewModel.uuid===t.viewModel.uuid})).subscribe(function(e){t.advancedSearchBox.prevFilterController(e.viewModel).onFocus("prev"),t.onBlur()}),this.viewModel.suggestions||this.viewModel.domains||(this.viewModel.mask?this.inputType=k.SIMPLE_MASK:this.inputType=k.SIMPLE),this.viewModel.suggestions&&(this.inputType=k.SUGGESTIONS),this.viewModel.domains&&(this.inputType=k.DOMAINS)},e.prototype.onBlur=function(){this._onChange(this.viewModel.value),this.removeEmpty([this.viewModel.value]),this.blurInput()},e.prototype.onChange=function(){this._onChange(this.viewModel.value),this.viewToModel()},e.decorators=[{type:r.Component,args:[{selector:"as-input",template:'\n    <div class="input-group input-group-sm">\n        <span class="input-group-prepend">\n            <span class="btn btn-outline-primary notClickable">{{viewModel.label}}</span>\n        </span>\n        <ng-container [ngSwitch]="inputType">\n            <as-simple-input *ngSwitchCase="\'SIMPLE\'" #inputComponent ></as-simple-input>\n            <as-simple-input-mask *ngSwitchCase="\'SIMPLE_MASK\'" #inputComponent ></as-simple-input-mask>\n            <as-suggestions-input *ngSwitchCase="\'SUGGESTIONS\'" #inputComponent ></as-suggestions-input>\n            <as-domains-input *ngSwitchCase="\'DOMAINS\'" #inputComponent (change)="onChange()"></as-domains-input>\n        </ng-container>\n        <span class="input-group-append">\n            <button class="btn btn-outline-primary" type="button" (click)="remove()">X</button>\n        </span>\n    </div>\n    ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0},n.NgbTypeaheadConfig]}]}],e.ctorParameters=function(){return[{type:S},{type:r.Renderer2},{type:r.ElementRef},{type:t.HttpClient},{type:C},{type:r.ComponentFactoryResolver}]},e}(E),T=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-simple-input",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value"\n            (change)="filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event, filter.viewModel)" \n            autosize \n            [placeholder]="filter.viewModel.label"\n            #inputRef\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:N}]},e}(R),B=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-suggestions-input",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value"\n            (change)="filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event, filter.viewModel)"\n            (selectItem)="filter.onSelectSuggestions($event)"\n            autosize \n            [autosizeProp]="filter.viewModel.bindLabel"\n            [placeholder]="filter.viewModel.label"\n            [ngbTypeahead]="suggestionsFunc"\n            [inputFormatter]="suggestionsFormatter(filter.viewModel)"\n            [resultFormatter]="suggestionsFormatter(filter.viewModel)"\n            #inputRef\n            editable="false"\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:N}]},e.propDecorators={inputRef:[{type:r.ViewChild,args:[n.NgbTypeahead]}]},e}(R),L=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r._filterValue="",r}return w(e,a),Object.defineProperty(e.prototype,"filterValue",{get:function(){return this._filterValue},set:function(e){this._filterValue=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;a.prototype.ngOnInit.call(this),this.ngControl.valueChanges.subscribe(function(e){""===e||e===undefined||null===e||(t.filter.viewModel.bindLabel?t.filterValue=e[t.filter.viewModel.bindLabel]:t.filterValue=e)})},e.prototype.ngDoCheck=function(){this.typeahead.filterValue&&(this._filterValue=this.typeahead.filterValue)},e.prototype.ngAfterViewChecked=function(){this.inputElementRef.nativeElement.style.width="calc("+this.inputAutosize.nativeElement.style.width+" + 50px)"},e.prototype.onClear=function(){this._filterValue=null,this.focusInput$.next(undefined),this.filter.remove()},e.prototype.onChange=function(e){var t=this;setTimeout(function(){""===e||e===undefined||null===e?(t.focusInput$.next(undefined),t.inputRef.open(),t.filter.removeEmpty([t.filter.viewModel.value])):(t.filter.viewModel.bindLabel?t._filterValue=e[t.filter.viewModel.bindLabel]:t._filterValue=e,t.filter.viewModel.bindValue?t.filter.onSelectDomains(e[t.filter.viewModel.bindValue]):t.filter.onSelectDomains(e)),t._onChange(e),t.change.emit(e)},0)},e.decorators=[{type:r.Component,args:[{selector:"as-domains-input",template:'\n    <ng-select \n        appendTo="body"\n        [bindLabel]="filter.viewModel.bindLabel"\n        [bindValue]="filter.viewModel.bindValue"\n        (focus)="filter.focusInput$.next()"\n        (keydown)="advancedSearchBox.keydown($event,filter.viewModel)" \n        #inputRef\n        [placeholder]="filter.viewModel.label"\n        [typeahead]="domainTypeahead"\n        [items]="itemsDomain"\n        (change)="onChange($event)"\n        (clear)="onClear()"\n        [(ngModel)]="filter.viewModel.value"\n        >\n    </ng-select>\n    <input autosize #inputAutosize type="text" [(ngModel)]="filterValue" [hidden]="true" />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        ng-select{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:N}]},e.propDecorators={typeahead:[{type:r.ViewChild,args:[o.NgSelectComponent]}],inputAutosize:[{type:r.ViewChild,args:["inputAutosize",{read:r.ElementRef}]}],ngControl:[{type:r.ViewChild,args:["inputRef",{read:p.NgControl}]}]},e}(R),P=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-simple-input-with-operators-mask",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value.value"\n            (change)="_onChange(this.filter.viewModel.value);filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event,filter.viewModel)" \n            autosize \n            [placeholder]="filter.viewModel.label"\n            [mask]="filter.viewModel.mask.mask"\n            [specialCharacters]="filter.viewModel.mask.specialCharacters"\n            [patterns]="filter.viewModel.mask.patterns"\n            [dropSpecialCharacters]="filter.viewModel.mask.dropSpecialCharacters"\n            [clearIfNotMatch]="filter.viewModel.mask.clearIfNotMatch"\n            #inputRef\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:D}]},e}(R),$=function(a){function e(e,t,n,o,i){var r=a.call(this,e,t,n,o)||this;return r.advancedSearchBox=e,r._http=t,r._config=n,r._element=o,r.filter=i,r}return w(e,a),e.decorators=[{type:r.Component,args:[{selector:"as-simple-input-mask",template:'<input type="text"\n            [(ngModel)]="filter.viewModel.value"\n            (change)="filter.onChange()"\n            (focus)="filter.focusInput$.next()"\n            (keydown)="advancedSearchBox.keydown($event, filter.viewModel)" \n            autosize \n            [placeholder]="filter.viewModel.label"\n            [mask]="filter.viewModel.mask.mask"\n            [specialCharacters]="filter.viewModel.mask.specialCharacters"\n            [patterns]="filter.viewModel.mask.patterns"\n            [dropSpecialCharacters]="filter.viewModel.mask.dropSpecialCharacters"\n            [clearIfNotMatch]="filter.viewModel.mask.clearIfNotMatch"\n            #inputRef\n            />',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0}],styles:["\n        input{\n            height:100%;\n        }\n    "]}]}],e.ctorParameters=function(){return[{type:S},{type:t.HttpClient},{type:C},{type:r.ElementRef},{type:N}]},e}(R),j={ArrowUp:38,ArrowDown:40};j[j.ArrowUp]="ArrowUp",j[j.ArrowDown]="ArrowDown";var U={Up:0,Down:1};U[U.Up]="Up",U[U.Down]="Down";var G=function(){function e(e){this.dropdown=e}return e.prototype.getTypeDrop=function(){return-1!==this.dropdown._menu.placement.search("^top")?U.Up:U.Down},e.prototype.getActiveElmIndex=function(e){var t,n,o=0,i=this.getTypeDrop()===U.Up?e.length:-1;try{for(var r=y(e),a=r.next();!a.done;a=r.next()){a.value===document.activeElement&&(i=o),o++}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return i},e.prototype.keyboardEvent=function(e){if(-1===[j.ArrowDown,j.ArrowUp].indexOf(e.which))return!0;this.dropdown.isOpen()||this.dropdown.open();var t=this.dropdown._menu._elementRef.nativeElement.children,n=this.getActiveElmIndex(t);switch(e.which){case j.ArrowDown:n>=t.length-1&&this.getTypeDrop()===U.Down&&(n=-1),n++;break;case j.ArrowUp:n<=0&&this.getTypeDrop()!==U.Down&&(n=t.length),n--}n>=t.length&&(n=t.length-1),n<0&&(n=0);var o=t[n];return!o||(o.focus(),!1)},e.decorators=[{type:r.Directive,args:[{selector:"[appDropdownNavigation]"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:r.Inject,args:[r.forwardRef(function(){return n.NgbDropdown})]}]}]},e.propDecorators={keyboardEvent:[{type:r.HostListener,args:["keydown",["$event"]]}]},e}(),z=function(){function e(){}return e.decorators=[{type:r.NgModule,args:[{declarations:[G],imports:[n.NgbDropdownModule,s.CommonModule,p.FormsModule],exports:[G]}]}],e}(),K={},q=d.initialConfig,W=d._configFactory,H=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[C]}},e.decorators=[{type:r.NgModule,args:[{declarations:[S,N,D,M,T,$,L,B,A,O,V,P],imports:[n.NgbDropdownModule.forRoot(),n.NgbTypeaheadModule.forRoot(),d.NgxMaskModule,o.NgSelectModule,s.CommonModule,p.FormsModule,z,c.AutosizeInputModule,t.HttpClientModule,p.ReactiveFormsModule,f.NoopAnimationsModule,h.MatAutocompleteModule,m.MatFormFieldModule,v.MatInputModule],exports:[S,N,M,D],entryComponents:[T,$,L,B,V,A,P,O],providers:[{provide:d.NEW_CONFIG,useValue:K},{provide:d.INITIAL_CONFIG,useValue:q},{provide:d.config,useFactory:W,deps:[d.INITIAL_CONFIG,d.NEW_CONFIG]}]}]}],e}();e.OperatorsEnum=x,e.AsComponent=S,e.AsBoxModule=H,e.AsConfigService=C,e.AsBoxFilterAbstract=E,e.TypesInputEnum=k,e.AsInputComponent=N,e.TypesInputWithOperatorsEnum=F,e.AsInputWithOperatorsComponent=D,e.ɵa=M,e.ɵl=G,e.ɵk=z,e.ɵe=L,e.ɵg=A,e.ɵc=R,e.ɵb=T,e.ɵd=$,e.ɵi=V,e.ɵj=P,e.ɵf=B,e.ɵh=O,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-advanced-searchbox.umd.min.js.map