text: /*!
   * bootstra-suggest -  v2.0.1 (https://github.com/lodev09/bootstrap-suggest#readme)
   * Copyright 2013-2019 Jovanni Lo (lodev09@gmail.com)
   * Licensed under MIT (https://github.com/lodev09/bootstrap-suggest/blob/master/LICENSE)
   */
  
  !function(l){"use strict";var a=function(t,e,i){this.$element=l(t),this.$items=void 0,this.options=l.extend(!0,{},l.fn.suggest.defaults,i,this.$element.data(),this.$element.data("options")),this.key=e,this.isShown=!1,this.query="",this._queryPos=[],this._keyPos=-1,this.$dropdown=l("<div />",{class:"dropdown suggest "+this.options.dropdownClass,html:l("<div />",{class:"dropdown-menu",role:"menu"}),"data-key":this.key}),this.load()};a.prototype={__setListener:function(){return this.$element.on("suggest.show",l.proxy(this.options.onshow,this)).on("suggest.select",l.proxy(this.options.onselect,this)).on("suggest.lookup",l.proxy(this.options.onlookup,this)).on("keyup",l.proxy(this.__keyup,this)),this},__getCaretPos:function(t){var h=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],d=!(null==window.mozInnerScreenX);return function(t,e,i){var o=document.createElement("div");o.id="input-textarea-caret-position-mirror-div",document.body.appendChild(o);var s=o.style,n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;s.whiteSpace="pre-wrap","INPUT"!==t.nodeName&&(s.wordWrap="break-word"),s.position="absolute",s.visibility="hidden",l.each(h,function(t,e){s[e]=n[e]}),d?(s.width=parseInt(n.width)-2+"px",t.scrollHeight>parseInt(n.height)&&(s.overflowY="scroll")):s.overflow="hidden",o.textContent=t.value.substring(0,e),"INPUT"===t.nodeName&&(o.textContent=o.textContent.replace(/\s/g," "));var r=document.createElement("span");r.textContent=t.value.substring(e)||".",o.appendChild(r);var a={top:r.offsetTop+parseInt(n.borderTopWidth),left:r.offsetLeft+parseInt(n.borderLeftWidth)};return document.body.removeChild(o),a}(this.$element.get(0),t)},__keyup:function(t){switch(t.keyCode){case 27:return void this.hide();case 13:return!0}if(-1===l.inArray(t.keyCode,[38,40,37,39,17,18,9,16,20,91,93,36,35,45,33,34,144,112,113,114,115,116,117,118,119,120,121,122,123,145,19]))for(var e=this.$element,i=e.val(),o=this.__getSelection(e.get(0)).start,s=o;0<=s;s--){var n=l.trim(i.substring(s-1,s));if(!n){this.hide();break}if(n===this.key&&""==l.trim(i.substring(s-2,s-1))){this.query=i.substring(s,o),this._queryPos=[s,o],this._keyPos=s,this.lookup(this.query);break}}},__getVisibleItems:function(){return this.$items?this.$items.not(".d-none"):l()},__build:function(){var t=this.$dropdown,e=this,i=function(t){e.hide()};t.on("click","a.dropdown-item",function(t){t.preventDefault(),e.__select(l(this).index()),e.$element.focus()}).on("mouseover","a.dropdown-item",function(t){e.$element.off("blur",i)}).on("mouseout","a.dropdown-item",function(t){e.$element.on("blur",i)}),this.$element.before(t).on("blur",i).on("keydown",function(t){var o;if(e.isShown)switch(t.keyCode){case 13:return(o=e.__getVisibleItems()).each(function(t){l(this).is(".active")&&e.__select(l(this).index())}),!1;case 40:return(o=e.__getVisibleItems()).last().is(".active")||o.each(function(t){var e=l(this),i=o.eq(t+1);if(e.is(".active"))return i.is(".d-none")||(e.removeClass("active"),i.addClass("active")),!1}),!1;case 38:return(o=e.__getVisibleItems()).first().is(".active")||o.each(function(t){var e=l(this),i=o.eq(t-1);if(e.is(".active"))return i.is(".d-none")||(e.removeClass("active"),i.addClass("active")),!1}),!1}})},__mapItem:function(t){var e={text:"",value:""};return!(this.options.map&&!(t=this.options.map(t)))&&(t instanceof Object?(e.text=t.text||"",e.value=t.value||""):(e.text=t,e.value=t),l("<a />",{class:"dropdown-item","data-value":e.value,href:"#",html:e.text}))},__select:function(t){var e=this.$element,i=e.get(0),o=e.val(),s=this.get(t),n=this._keyPos+s.value.length+1;if(e.val(o.slice(0,this._keyPos)+s.value+" "+o.slice(this.__getSelection(i).start)),i.setSelectionRange)i.setSelectionRange(n,n);else if(i.createTextRange){var r=i.createTextRange();r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select()}e.trigger(l.extend({type:"suggest.select"},this),s),this.hide()},__getSelection:function(t){return t.focus(),{start:t.selectionStart,end:t.selectionEnd}},__buildItems:function(t){var e=this.$dropdown.find(".dropdown-menu");if(e.empty(),t&&t instanceof Array)for(var i in t){var o=this.__mapItem(t[i]);o&&e.append(o)}return e.find("a.dropdown-item")},__lookup:function(t,e){e.eq(0).addClass("active");this.$element.trigger(l.extend({type:"suggest.lookup"},this),[t,e]),e&&e.length?this.show():this.hide()},__filterData:function(i,t){var o=this.options;return this.$items.addClass("d-none"),this.$items.filter(function(t){if(""===i)return t<o.filter.limit;var e=l(this).text();return o.filter.casesensitive||(e=e.toLowerCase(),i=i.toLowerCase()),-1!=e.indexOf(i)}).slice(0,o.filter.limit).removeClass("d-none active"),this.__getVisibleItems()},get:function(t){if(this.$items){var e=this.$items.eq(t);return{text:e.text(),value:e.attr("data-value"),index:t,$element:e}}},lookup:function(e){this.options;var t,i=this,o=function(t){-1!==i._keyPos&&(i.$items||(i.$items=i.__buildItems(t)),i.__lookup(e,i.__filterData(e,t)))};(t="function"==typeof this.options.data?(this.$items=void 0,this.options.data(e,o)):this.options.data)&&"function"==typeof t.promise?t.done(o):t&&o.call(this,t)},load:function(){this.__setListener(),this.__build()},hide:function(){this.$dropdown.find(".dropdown-menu").removeClass("show"),this.isShown=!1,this.$items&&this.$items.removeClass("active"),this._keyPos=-1},show:function(){var t,e=this.$element,i=this.$dropdown.find(".dropdown-menu"),o=e.get(0),s=this.options,n={top:"auto",bottom:"auto",left:"auto",right:"auto"};if(!this.isShown){if(i.addClass("show"),!1!==s.position){if(t=this.__getCaretPos(this._keyPos),"string"==typeof s.position)switch(s.position){case"bottom":n.top=e.outerHeight()-parseFloat(i.css("margin-top")),n.left=0,n.right=0;break;case"top":n.top=-(i.outerHeight(!0)+parseFloat(i.css("margin-top"))),n.left=0,n.right=0;break;case"caret":n.top=t.top-o.scrollTop,n.left=t.left-o.scrollLeft}else n=l.extend(n,"function"==typeof s.position?s.position(o,t):s.position);i.css(n)}this.isShown=!0,e.trigger(l.extend({type:"suggest.show"},this))}}};var t=l.fn.suggest;l.fn.suggest=function(e){var s=arguments[1],n=arguments[2],r=function(o,t){var s={};return l.each(t,function(t,e){var i=t.toString().charAt(0);s[i]=new a(o,i,"object"==typeof e&&e)}),s};return this.each(function(){var t=l(this),i=t.data("suggest"),o={};if("string"==typeof e)if(1==e.length){if(s)if("string"==typeof s){if(e in i&&void 0!==i[e][s])return i[e][s].call(i[e],n);console.error(e+" is not a suggest")}else o[e]=l.isArray(s)||"function"==typeof s?{data:s}:s,i&&e in i?i[e].options=l.extend({},i[e].options,o[e]):i=l.extend(i,r(this,o)),t.data("suggest",i)}else console.error("you're not initializing suggest properly. arg1 should have length == 1");else i?i&&(l.each(e,function(t,e){t in i==!1?o[t]=e:i[t].options=l.extend({},i[t].options,e)}),t.data("suggest",l.extend(i,r(this,o)))):t.data("suggest",r(this,e))})},l.fn.suggest.defaults={data:[],map:void 0,filter:{casesensitive:!1,limit:5},dropdownClass:"",position:"caret",onshow:function(t){},onselect:function(t,e){},onlookup:function(t,e){}},l.fn.suggest.Constructor=a,l.fn.suggest.noConflict=function(){return l.fn.suggest=t,this}}(jQuery);