dbfdg var TypeAhead=function(e,t){var i=this;return i.element=e,i.candidates=t||[],i.list=new TypeAheadList(i),this.minLength=3,i.limit=5,i.query="",i.selected=null,i.list.draw(),i.element.addEventListener("keyup",function(e){i.handleKeyUp.call(i,e.keyCode)},!1),i.element.addEventListener("keydown",function(e){i.handleKeyDown.call(i,e.keyCode)&&e.preventDefault()}),i.element.addEventListener("focus",function(){i.handleFocus.call(i)}),i.element.addEventListener("blur",function(){i.handleBlur.call(i)}),i};TypeAhead.prototype.handleKeyUp=function(e){if(13!==e&&38!==e&&40!==e){if(this.query=this.filter(this.element.value),this.list.clear(),this.query.length"+t+""})};var TypeAheadList=function(e){var t=this;return t.typeAhead=e,t.items=[],t.active=0,t.element=document.createElement("ul"),e.element.parentNode.insertBefore(t.element,e.element.nextSibling),t};TypeAheadList.prototype.show=function(){this.element.style.display="block"},TypeAheadList.prototype.hide=function(){this.element.style.display="none"},TypeAheadList.prototype.add=function(e){this.items.push(e)},TypeAheadList.prototype.clear=function(){this.items=[],this.active=0},TypeAheadList.prototype.isEmpty=function(){return 0===this.element.children.length},TypeAheadList.prototype.draw=function(){if(this.element.innerHTML="",0===this.items.length)return void this.hide();for(var e=0;e