/*!
* typeahead.js 0.11.1 * https://github.com/twitter/typeahead.js * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT */
!function(e,n){“function”==typeof define&&define.amd?define(“bloodhound”,,function(t){return e.Bloodhound=n(t)}):“object”==typeof exports?module.exports=n(require(“jquery”)):e.Bloodhound=n(jQuery)}(this,function(h){var l=function(){“use strict”;return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(d+(.d+)?)/i)},isBlankString:function(t){return!t||/^s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[-/{}()*+?.\^$|]/g,“\$&”)},isString:function(t){return“string”==typeof t},isNumber:function(t){return“number”==typeof t},isArray:h.isArray,isFunction:h.isFunction,isObject:h.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof h},toStr:function(t){return l.isUndefined(t)||null===t?“”:t+“”},bind:h.proxy,each:function(t,n){h.each(t,function(t,e){return n(e,t)})},map:h.map,filter:h.grep,every:function(n,i){var r=!0;return n?(h.each(n,function(t,e){if(!(r=i.call(null,e,t,n)))return!1}),!!r):r},some:function(n,i){var r=!1;return n?(h.each(n,function(t,e){if(r=i.call(null,e,t,n))return!1}),!!r):r},mixin:h.extend,identity:function(t){return t},clone:function(t){return h.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return h.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(r,s,o){var u,a;return function(){function t(){u=null,o||(a=r.apply(e,n))}var e=this,n=arguments,i=o&&!u;return clearTimeout(u),u=setTimeout(t,s),i&&(a=r.apply(e,n)),a}},throttle:function(n,i){function r(){c=new Date
,u=null,a=n.apply(s,o)}var s,o,u,a,c=0;return function(){var t=new Date
,e=i-(t-c);return s=this,o=arguments,e<=0?(clearTimeout(u),u=null,c=t,a=n.apply(s,o)):u=u||setTimeout(r,e),a}},stringify:function(t){return l.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){“use strict”;return{nonword:e,whitespace:t,obj:{nonword:n(e),whitespace:n(t)}};function t(t){return(t=l.toStr(t))?t.split(/s+/):[]}function e(t){return(t=l.toStr(t))?t.split(/W+/):[]}function n(i){return function(t){return t=l.isArray(t)?t:[].slice.call(arguments,0),function(e){var n=[];return l.each(t,function(t){n=n.concat(i(l.toStr(e)))}),n}}}}(),i=function(){“use strict”;function t(t){this.maxSize=l.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=h.noop)}function e(){this.head=this.tail=null}function r(t,e){this.key=t,this.val=e,this.prev=this.next=null}return l.mixin(t.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash,this.size–),(n=this.hash)?(n.val=e,this.list.moveToFront(n)):(n=new r(t,e),this.list.add(n),this.hash=n,this.size++)},get:function(t){var e=this.hash;if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new e}}),l.mixin(e.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),e=function(){“use strict”;var s;try{(s=window.localStorage).setItem(“~~~”,“!”),s.removeItem(“~~~”)}catch(t){s=null}function t(t,e){this.prefix=.join(“”),this.ttlKey=“__ttl__”,this.keyMatcher=new RegExp(“^”+l.escapeRegExChars(this.prefix)),this.ls=e||s,this.ls||this._noop()}return l.mixin(t.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=l.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){“QuotaExceededError”===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),n(this.ls.getItem(this._prefix(t)))},set:function(t,e,n){return l.isNumber(n)?this._safeSet(this._ttlKey(t),r(i()+n)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),r(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){for(var t=function(t){var e,n,i=[],r=s.length;for(e=0;e<r;e++)(n=s.key(e)).match(t)&&i.push(n.replace(t,“”));return i}(this.keyMatcher),e=t.length;e–;)this.remove(t);return this},isExpired:function(t){var e=n(this.ls.getItem(this._ttlKey(t)));return!!(l.isNumber(e)&&i()>e)}}),t;function i(){return(new Date
).getTime()}function r(t){return JSON.stringify(l.isUndefined(t)?null:t)}function n(t){return h.parseJSON(t)}}(),r=function(){“use strict”;var u=0,a={},c=6,e=new i(10);function t(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new i(0):e}return t.setMaxPendingRequests=function(t){c=t},t.resetCache=function(){e.reset()},l.mixin(t.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+h.param(t.data||{})},_get:function(t,e){var n,i,r=this;function s(t){e(null,t),r._cache.set(n,t)}function o(){e(!0)}n=this._fingerprint(t),this.cancelled||n!==this.lastReq||((i=a)?i.done(s).fail(o):u<e?n++:(t>e||(r.push(t),n++),i++);return r}(s,r):r}),s?l.map(function(t){for(var e={},n=[],i=0,r=t.length;iDate
,u=null,a=n.apply(s,o)}var s,o,u,a,c=0;return function(){var t=new Date
,e=i-(t-c);return s=this,o=arguments,e<=0?(clearTimeout(u),u=null,c=t,a=n.apply(s,o)):u=u||setTimeout(r,e),a}},stringify:function(t){return y.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){“use strict”;var i={wrapper:“twitter-typeahead”,input:“tt-input”,hint:“tt-hint”,menu:“tt-menu”,dataset:“tt-dataset”,suggestion:“tt-suggestion”,selectable:“tt-selectable”,empty:“tt-empty”,open:“tt-open”,cursor:“tt-cursor”,highlight:“tt-highlight”};return function(t){var e,n;return n=y.mixin({},i,t),{css:(e={css:function(){var t={wrapper:{position:“relative”,display:“inline-block”},hint:{position:“absolute”,top:“0”,left:“0”,borderColor:“transparent”,boxShadow:“none”,opacity:“1”},input:{position:“relative”,verticalAlign:“top”,backgroundColor:“transparent”},inputWithNoHint:{position:“relative”,verticalAlign:“top”},menu:{position:“absolute”,top:“100%”,left:“20”,zIndex:“100”,display:“none”},ltr:{left:“0”,right:“auto”},rtl:{left:“auto”,right:“ 0”}};y.isMsie()&&y.mixin(t.input,{backgroundImage:“url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)”});return t}(),classes:n,html:function(t){return{wrapper:'<span class=“'t.wrapper
'”></span>',menu:'<div class=“'t.menu
'”></div>'}}(n),selectors:function(t){var n={};return y.each(t,function(t,e){n=“.”+t}),n}(n)}).css,html:e.html,classes:e.classes,selectors:e.selectors,mixin:function(t){y.mixin(t,e)}}}}(),v=function(){“use strict”;var n;function t(t){t&&t.el||m.error(“EventBus initialized without el”),this.$el=m(t.el)}return n={render:“rendered”,cursorchange:“cursorchanged”,select:“selected”,autocomplete:“autocompleted”},y.mixin(t.prototype,{_trigger:function(t,e){var n=m.Event(“typeahead:”+t);return(e=e||[]).unshift(n),this.$el.trigger.apply(this.$el,e),n},before:function(t){var e=[].slice.call(arguments,1);return this._trigger(“before”+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=n)&&this._trigger(e,[].slice.call(arguments,1))}}),t}(),e=function(){“use strict”;var u=/s+/,o=function(){var t;t=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)};return t}();return{onSync:function(t,e,n){return i.call(this,“sync”,t,e,n)},onAsync:function(t,e,n){return i.call(this,“async”,t,e,n)},off:function(t){var e;if(!this._callbacks)return this;t=t.split(u);for(;e=t.shift();)delete this._callbacks;return this},trigger:function(t){var e,n,i,r,s;if(!this._callbacks)return this;t=t.split(u),i=[].slice.call(arguments,1);for(;(e=t.shift())&&(n=this._callbacks);)r=a(n.sync,this,.concat(i)),s=a(n.async,this,.concat(i)),r()&&o(s);return this}};function i(t,e,n,i){var r,s,o;if(!n)return this;for(e=e.split(u),n=i?(o=i,(s=n).bind?s.bind(o):function(){s.apply(o,[].slice.call(arguments,0))}):n,this._callbacks=this._callbacks||{};r=e.shift();)this._callbacks=this._callbacks||{sync:[],async:},this._callbacks[t].push(n);return this}function a(i,r,s){return function(){for(var t,e=0,n=i.length;!t&&ee
“)(.+$)”,“i”).exec(r.val))&&this.input.setHint(s+n))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before(“active”))&&(this.active=!0,this.eventBus.trigger(“active”),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before(“idle”)&&(this.active=!1,this.close(),this.eventBus.trigger(“idle”),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before(“open”)||(this.menu.open(),this._updateHint(),this.eventBus.trigger(“open”)),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before(“close”)&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger(“close”)),!this.isOpen()},setVal:function(t){this.input.setQuery(y.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before(“select”,e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger(“select”,e.obj),this.close(),!0)},autocomplete:function(t){var e=this.input.getQuery(),n=this.menu.getSelectableData(t);return!(!(n&&e!==n.val)||this.eventBus.before(“autocomplete”,n.obj))&&(this.input.setQuery(n.val),this.eventBus.trigger(“autocomplete”,n.obj),!0)},moveCursor:function(t){var e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),i=this.menu.getSelectableData(n),r=i?i.obj:null;return!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before(“cursorchange”,r)&&(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger(“cursorchange”,r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),t;function d(n){var t=[].slice.call(arguments,1);return function(){var e=[].slice.call(arguments);y.each(t,function(t){return n.apply(n,e)})}}}();!function(){“use strict”;var t,p,e;function i(t,n){t.each(function(){var t,e=m(this);(t=e.data(p.typeahead))&&n(t,e)})}function g(t){var e=y.isJQuery(t)||y.isElement(t)?m(t).first():[];return e.length?e:null}t=m.fn.typeahead,p={www:“tt-www”,attrs:“tt-attrs”,typeahead:“tt-typeahead”},e={initialize:function(l,f){var d;return f=y.isArray(f)?f:[].slice.call(arguments,1),d=n((l=l||{}).classNames),this.each(function(){var t,e,n,i,r,s,o,u,a,c,h;y.each(f,function(t){t.highlight=!!l.highlight}),t=m(this),e=m(d.html.wrapper),n=g(l.hint),i=g(l.menu),r=!1!==l.hint&&!n,s=!1!==l.menu&&!i,r&&(n=function(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(function(t){return{backgroundAttachment:t.css(“background-attachment”),backgroundClip:t.css(“background-clip”),backgroundColor:t.css(“background-color”),backgroundImage:t.css(“background-image”),backgroundOrigin:t.css(“background-origin”),backgroundPosition:t.css(“background-position”),backgroundRepeat:t.css(“background-repeat”),backgroundSize:t.css(“background-size”)}}(t)).prop(“readonly”,!0).removeAttr(“id name placeholder required”).attr({autocomplete:“off”,spellcheck:“false”,tabindex:-1})}(t,d)),s&&(i=m(d.html.menu).css(d.css.menu)),n&&n.val(“”),t=function(t,e){t.data(p.attrs,{dir:t.attr(“dir”),autocomplete:t.attr(“autocomplete”),spellcheck:t.attr(“spellcheck”),style:t.attr(“style”)}),t.addClass(e.classes.input).attr({autocomplete:“off”,spellcheck:!1});try{t.attr(“dir”)||t.attr(“dir”,“auto”)}catch(t){}return t}(t,d),(r||s)&&(e.css(d.css.wrapper),t.css(r?d.css.input:d.css.inputWithNoHint),t.wrap(e).parent().prepend(r?n:null).append(s?i:null));h=s?w:b,o=new v({el:t}),u=new _({hint:n,input:t},d),a=new h({node:i,datasets:f},d),c=new S({input:u,menu:a,eventBus:o,minLength:l.minLength},d),t.data(p.www,d),t.data(p.typeahead,c)})},isEnabled:function(){var e;return i(this.first(),function(t){e=t.isEnabled()}),e},enable:function(){return i(this,function(t){t.enable()}),this},disable:function(){return i(this,function(t){t.disable()}),this},isActive:function(){var e;return i(this.first(),function(t){e=t.isActive()}),e},activate:function(){return i(this,function(t){t.activate()}),this},deactivate:function(){return i(this,function(t){t.deactivate()}),this},isOpen:function(){var e;return i(this.first(),function(t){e=t.isOpen()}),e},open:function(){return i(this,function(t){t.open()}),this},close:function(){return i(this,function(t){t.close()}),this},select:function(t){var e=!1,n=m(t);return i(this.first(),function(t){e=t.select(n)}),e},autocomplete:function(t){var e=!1,n=m(t);return i(this.first(),function(t){e=t.autocomplete(n)}),e},moveCursor:function(e){var n=!1;return i(this.first(),function(t){n=t.moveCursor(e)}),n},val:function(e){var n;return arguments.length?(i(this,function(t){t.setVal(e)}),this):(i(this.first(),function(t){n=t.getVal()}),n)},destroy:function(){return i(this,function(t,e){var n,i,r;i=(n=e).data(p.www),r=n.parent().filter(i.selectors.wrapper),y.each(n.data(p.attrs),function(t,e){y.isUndefined(t)?n.removeAttr(e):n.attr(e,t)}),n.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(i.classes.input),r.length&&(n.detach().insertAfter®,r.remove()),t.destroy()}),this}},m.fn.typeahead=function(t){return e?e.apply(this,[].slice.call(arguments,1)):e.initialize.apply(this,arguments)},m.fn.typeahead.noConflict=function(){return m.fn.typeahead=t,this}}()});