window.VueSuggest=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClasses},[n("input",{ref:"input",class:e.inputClasses,attrs:{placeholder:e.placeholder,required:e.required,autofocus:e.autofocus,autocomplete:"off"},domProps:{value:e.value},on:{input:function(t){e.updateValue(t.target.value)},keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.isOpen=!1},keydown:[function(t){return"button"in t||!e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?e.moveDown(t):null},function(t){return"button"in t||!e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?e.moveUp(t):null},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.settle(t):null}],blur:function(t){e.isOpen=!1}}}),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],class:e.listClasses},e._l(e.options,function(t,i){return n("li",{key:i,class:[e.itemClasses,{highlighted:i===e.highlightedPosition}],on:{mouseenter:function(t){e.highlightedPosition=i},mousedown:e.select}},[e._t("item",[e._v(e._s(e.defaultValue(t)))],{data:t})],2)}),0)])};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i._withStripped=!0;var r=function(e,t,n,i,o,r,s,u){var l,a="function"==typeof e?e.options:e;if(t&&(a.render=t,a.staticRenderFns=n,a._compiled=!0),i&&(a.functional=!0),r&&(a._scopeId="data-v-"+r),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},a._ssrRegister=l):o&&(l=u?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(a.functional){a._injectStyles=l;var c=a.render;a.render=function(e,t){return l.call(t),c(e,t)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:a}}({name:"suggest-search",props:{options:{type:Array,required:!0},value:{type:String,required:!1},wrapperClasses:{type:String,required:!1,default:"suggest-wrap"},inputClasses:{type:String,required:!1,default:"suggest-input"},listClasses:{type:String,required:!1,default:"suggest-list"},itemClasses:{type:String,required:!1,default:"suggest-item"},placeholder:{type:String,required:!1,default:"Search.."},required:{type:Boolean,required:!1,default:!1},autofocus:{type:Boolean,required:!1,default:!1}},data:function(){return{isOpen:!1,highlightedPosition:NaN,keyword:""}},methods:{defaultValue:function(e){return"string"==typeof e?e:"object"===o(e)?String(e[Object.keys(e)[0]]):""},moveDown:function(){this.isOpen&&(isNaN(this.highlightedPosition)?this.highlightedPosition=0:this.highlightedPosition=(this.highlightedPosition+1)%this.options.length)},moveUp:function(){this.isOpen&&(this.highlightedPosition=this.highlightedPosition-1<0?this.options.length-1:this.highlightedPosition-1)},select:function(){var e=this.options[this.highlightedPosition];this.isOpen=!1,this.$emit("select",e)},settle:function(){this.isOpen&&!isNaN(this.highlightedPosition)?this.select():this.$emit("search",this.value)},updateValue:function(e){this.isOpen=!!e,this.highlightedPosition=NaN,this.$emit("input",e)}}},i,[],!1,null,null,null);r.options.__file="src/Suggest.vue";t.a=r.exports},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"install",function(){return o});var i=n(0);function o(e){e.component("vue-suggest",i.a)}"undefined"!=typeof window&&window.Vue?window.Vue.use({install:o}):void 0!==e&&e.Vue.use({install:o})}.call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}]);