System.register(["./p-48e53d14.system.js"],function(e){"use strict";var t,n,i;return{setters:[function(e){t=e.r;n=e.c;i=e.h}],execute:function(){var u=function(){function e(e){t(this,e);this.dense=false;this.change=n(this,"change",7)}e.prototype.componentDidLoad=function(){this.watchValue()};e.prototype.componentWillLoad=function(){this.watchValue()};e.prototype.watchValue=function(){if(this.value){this.value.label=this.value.label?this.value.label:this.value.value}else{this.value={value:null,label:null}}};e.prototype.selectSuggestion=function(e){this.menuElement.close();if(this.suggestions){var t={value:e,label:this.suggestions.get(e)};this.value=Object.assign({},t)}this.change.emit(this.value)};e.prototype.execAutocomplete=function(e){var t=this;this.value.label=e.target.value;this.autocomplete(e.target.value).then(function(e){return t.suggestions=e});this.menuElement.open()};e.prototype.emptyField=function(){if(!this.textElement.value){this.value=null;this.change.emit(this.value)}};e.prototype.render=function(){var e=this;return[i("materials-text-field",{"trailing-icon":this.trailingIcon,dense:this.dense,label:this.label,value:this.value.label,onInput:function(t){return e.execAutocomplete(t)},onChange:function(t){t.stopPropagation();t.preventDefault();e.change.emit()}}),i("materials-menu",{ref:function(t){return e.menuElement=t}},this.suggestions?Array.from(this.suggestions.keys()).map(function(t){return i("materials-list-item",{onClick:function(){return e.selectSuggestion(t)}},e.suggestions.get(t))}):null)]};Object.defineProperty(e,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:true,configurable:true});Object.defineProperty(e,"style",{get:function(){return":host{display:block}"},enumerable:true,configurable:true});return e}();e("materials_autocomplete",u)}}});