!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/animations"),require("primeng/inputtext"),require("primeng/button"),require("primeng/ripple"),require("primeng/api"),require("primeng/dom"),require("primeng/utils"),require("@angular/forms")):"function"==typeof define&&define.amd?define("primeng/autocomplete",["exports","@angular/core","@angular/common","@angular/animations","primeng/inputtext","primeng/button","primeng/ripple","primeng/api","primeng/dom","primeng/utils","@angular/forms"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).primeng=t.primeng||{},t.primeng.autocomplete={}),t.ng.core,t.ng.common,t.ng.animations,t.primeng.inputtext,t.primeng.button,t.primeng.ripple,t.primeng.api,t.primeng.dom,t.primeng.utils,t.ng.forms)}(this,(function(t,e,i,n,o,l,s,a,p,r,u){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */Object.create;function h(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,l=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=l.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return s}function c(){for(var t=[],e=0;e=this.minLength?this.timeout=setTimeout((function(){e.search(t,i)}),this.delay):(this.suggestions=null,this.hide()),this.updateFilledState(),this.inputKeyDown=!1}},t.prototype.onInputClick=function(t){this.documentClickListener&&(this.inputClick=!0)},t.prototype.search=function(t,e){null!=e&&(this.loading=!0,this.completeMethod.emit({originalEvent:t,query:e}))},t.prototype.selectItem=function(t,e){void 0===e&&(e=!0),this.forceSelectionUpdateModelTimeout&&(clearTimeout(this.forceSelectionUpdateModelTimeout),this.forceSelectionUpdateModelTimeout=null),this.multiple?(this.multiInputEL.nativeElement.value="",this.value=this.value||[],this.isSelected(t)&&this.unique||(this.value=c(this.value,[t]),this.onModelChange(this.value))):(this.inputEL.nativeElement.value=this.field?r.ObjectUtils.resolveFieldData(t,this.field)||"":t,this.value=t,this.onModelChange(this.value)),this.onSelect.emit(t),this.updateFilledState(),e&&(this.itemClicked=!0,this.focusInput())},t.prototype.show=function(){if(this.multiInputEL||this.inputEL){var t=this.multiple?this.multiInputEL.nativeElement.ownerDocument.activeElement==this.multiInputEL.nativeElement:this.inputEL.nativeElement.ownerDocument.activeElement==this.inputEL.nativeElement;!this.overlayVisible&&t&&(this.overlayVisible=!0)}},t.prototype.onOverlayAnimationStart=function(t){switch(t.toState){case"visible":this.overlay=t.element,this.appendOverlay(),this.autoZIndex&&(this.overlay.style.zIndex=String(this.baseZIndex+ ++p.DomHandler.zindex)),this.alignOverlay(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.onShow.emit(t);break;case"void":this.onOverlayHide()}},t.prototype.onOverlayAnimationDone=function(t){"void"===t.toState&&(this._suggestions=null)},t.prototype.appendOverlay=function(){this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.overlay):p.DomHandler.appendChild(this.overlay,this.appendTo),this.overlay.style.minWidth||(this.overlay.style.minWidth=p.DomHandler.getWidth(this.el.nativeElement.children[0])+"px"))},t.prototype.resolveFieldData=function(t){return this.field?r.ObjectUtils.resolveFieldData(t,this.field):t},t.prototype.restoreOverlayAppend=function(){this.overlay&&this.appendTo&&this.el.nativeElement.appendChild(this.overlay)},t.prototype.alignOverlay=function(){this.appendTo?p.DomHandler.absolutePosition(this.overlay,this.multiple?this.multiContainerEL.nativeElement:this.inputEL.nativeElement):p.DomHandler.relativePosition(this.overlay,this.multiple?this.multiContainerEL.nativeElement:this.inputEL.nativeElement)},t.prototype.hide=function(){this.overlayVisible=!1,this.cd.markForCheck()},t.prototype.handleDropdownClick=function(t){if(this.overlayVisible)this.hide();else{this.focusInput();var e=this.multiple?this.multiInputEL.nativeElement.value:this.inputEL.nativeElement.value;"blank"===this.dropdownMode?this.search(t,""):"current"===this.dropdownMode&&this.search(t,e),this.onDropdownClick.emit({originalEvent:t,query:e})}},t.prototype.focusInput=function(){this.multiple?this.multiInputEL.nativeElement.focus():this.inputEL.nativeElement.focus()},t.prototype.removeItem=function(t){var e=p.DomHandler.index(t),i=this.value[e];this.value=this.value.filter((function(t,i){return i!=e})),this.onModelChange(this.value),this.updateFilledState(),this.onUnselect.emit(i)},t.prototype.onKeydown=function(t){if(this.overlayVisible){var e=this.findOptionIndex(this.highlightOption);switch(t.which){case 40:if(-1!=e){var i=e+1;i!=this.suggestions.length&&(this.highlightOption=this.suggestions[i],this.highlightOptionChanged=!0)}else this.highlightOption=this.suggestions[0];t.preventDefault();break;case 38:if(e>0){var n=e-1;this.highlightOption=this.suggestions[n],this.highlightOptionChanged=!0}t.preventDefault();break;case 13:this.highlightOption&&(this.selectItem(this.highlightOption),this.hide()),t.preventDefault();break;case 27:this.hide(),t.preventDefault();break;case 9:this.highlightOption&&this.selectItem(this.highlightOption),this.hide()}}else 40===t.which&&this.suggestions&&this.search(t,t.target.value);if(this.multiple)switch(t.which){case 8:if(this.value&&this.value.length&&!this.multiInputEL.nativeElement.value){this.value=c(this.value);var o=this.value.pop();this.onModelChange(this.value),this.updateFilledState(),this.onUnselect.emit(o)}}this.inputKeyDown=!0},t.prototype.onKeyup=function(t){this.onKeyUp.emit(t)},t.prototype.onInputFocus=function(t){if(!this.itemClicked&&this.completeOnFocus){var e=this.multiple?this.multiInputEL.nativeElement.value:this.inputEL.nativeElement.value;this.search(t,e)}this.focus=!0,this.onFocus.emit(t),this.itemClicked=!1},t.prototype.onInputBlur=function(t){this.focus=!1,this.onModelTouched(),this.onBlur.emit(t)},t.prototype.onInputChange=function(t){var e,i,n=this;if(this.forceSelection){var o=!1,l=t.target.value.trim();if(this.suggestions){var s=function(t){var e=a.field?r.ObjectUtils.resolveFieldData(t,a.field):t;if(e&&l===e.trim())return o=!0,a.forceSelectionUpdateModelTimeout=setTimeout((function(){n.selectItem(t,!1)}),250),"break"},a=this;try{for(var p=h(this.suggestions),u=p.next();!u.done;u=p.next()){if("break"===s(u.value))break}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=p.return)&&i.call(p)}finally{if(e)throw e.error}}}o||(this.multiple?this.multiInputEL.nativeElement.value="":(this.value=null,this.inputEL.nativeElement.value=""),this.onClear.emit(t),this.onModelChange(this.value))}},t.prototype.onInputPaste=function(t){this.onKeydown(t)},t.prototype.isSelected=function(t){var e=!1;if(this.value&&this.value.length)for(var i=0;i\n \n \n
\n
    \n
  • \n {{resolveFieldData(option)}}\n \n
  • \n
  • {{emptyMessage}}
  • \n
\n
\n \n ',animations:[n.trigger("overlayAnimation",[n.transition(":enter",[n.style({opacity:0,transform:"scaleY(0.8)"}),n.animate("{{showTransitionParams}}")]),n.transition(":leave",[n.animate("{{hideTransitionParams}}",n.style({opacity:0}))])])],host:{"[class.p-inputwrapper-filled]":"filled","[class.p-inputwrapper-focus]":"focus && !disabled"},providers:[m],changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,styles:[".p-autocomplete{display:-ms-inline-flexbox;display:inline-flex;position:relative}.p-autocomplete-loader{margin-top:-.5rem;position:absolute;top:50%}.p-autocomplete-dd .p-autocomplete-input{-ms-flex:1 1 auto;flex:1 1 auto;width:1%}.p-autocomplete-dd .p-autocomplete-input,.p-autocomplete-dd .p-autocomplete-multiple-container{border-bottom-right-radius:0;border-top-right-radius:0}.p-autocomplete-dd .p-autocomplete-dropdown{border-bottom-left-radius:0;border-top-left-radius:0}.p-autocomplete .p-autocomplete-panel{min-width:100%}.p-autocomplete-panel{overflow:auto;position:absolute}.p-autocomplete-items{list-style-type:none;margin:0;padding:0}.p-autocomplete-item{cursor:pointer;overflow:hidden;position:relative;white-space:nowrap}.p-autocomplete-multiple-container{-ms-flex-align:center;align-items:center;cursor:text;display:-ms-flexbox;display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0}.p-autocomplete-token{-ms-flex:0 0 auto;-ms-flex-align:center;align-items:center;cursor:default;display:-ms-inline-flexbox;display:inline-flex;flex:0 0 auto}.p-autocomplete-token-icon{cursor:pointer}.p-autocomplete-input-token{-ms-flex:1 1 auto;display:-ms-inline-flexbox;display:inline-flex;flex:1 1 auto}.p-autocomplete-input-token input{background-color:rgba(0,0,0,0);border:0;border-radius:0;box-shadow:none;margin:0;outline:0 none;padding:0;width:100%}.p-fluid .p-autocomplete{display:-ms-flexbox;display:flex}.p-fluid .p-autocomplete-dd .p-autocomplete-input{width:1%}"]}]}],y.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:e.ChangeDetectorRef},{type:e.IterableDiffers}]},y.propDecorators={minLength:[{type:e.Input}],delay:[{type:e.Input}],style:[{type:e.Input}],panelStyle:[{type:e.Input}],styleClass:[{type:e.Input}],panelStyleClass:[{type:e.Input}],inputStyle:[{type:e.Input}],inputId:[{type:e.Input}],inputStyleClass:[{type:e.Input}],placeholder:[{type:e.Input}],readonly:[{type:e.Input}],disabled:[{type:e.Input}],maxlength:[{type:e.Input}],name:[{type:e.Input}],required:[{type:e.Input}],size:[{type:e.Input}],appendTo:[{type:e.Input}],autoHighlight:[{type:e.Input}],forceSelection:[{type:e.Input}],type:[{type:e.Input}],autoZIndex:[{type:e.Input}],baseZIndex:[{type:e.Input}],ariaLabel:[{type:e.Input}],ariaLabelledBy:[{type:e.Input}],dropdownIcon:[{type:e.Input}],unique:[{type:e.Input}],completeOnFocus:[{type:e.Input}],completeMethod:[{type:e.Output}],onSelect:[{type:e.Output}],onUnselect:[{type:e.Output}],onFocus:[{type:e.Output}],onBlur:[{type:e.Output}],onDropdownClick:[{type:e.Output}],onClear:[{type:e.Output}],onKeyUp:[{type:e.Output}],onShow:[{type:e.Output}],onHide:[{type:e.Output}],field:[{type:e.Input}],scrollHeight:[{type:e.Input}],dropdown:[{type:e.Input}],dropdownMode:[{type:e.Input}],multiple:[{type:e.Input}],tabindex:[{type:e.Input}],dataKey:[{type:e.Input}],emptyMessage:[{type:e.Input}],showTransitionOptions:[{type:e.Input}],hideTransitionOptions:[{type:e.Input}],autofocus:[{type:e.Input}],autocomplete:[{type:e.Input}],containerEL:[{type:e.ViewChild,args:["container"]}],inputEL:[{type:e.ViewChild,args:["in"]}],multiInputEL:[{type:e.ViewChild,args:["multiIn"]}],multiContainerEL:[{type:e.ViewChild,args:["multiContainer"]}],dropdownButton:[{type:e.ViewChild,args:["ddBtn"]}],templates:[{type:e.ContentChildren,args:[a.PrimeTemplate]}],suggestions:[{type:e.Input}]};var g=function(){};g.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,o.InputTextModule,l.ButtonModule,a.SharedModule,s.RippleModule],exports:[y,a.SharedModule],declarations:[y]}]}],t.AUTOCOMPLETE_VALUE_ACCESSOR=m,t.AutoComplete=y,t.AutoCompleteModule=g,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-autocomplete.umd.min.js.map