From 9897b5fbd4642b54a4ec6b93e1866946a13a9587 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Fri, 9 Mar 2018 18:11:24 +0100 Subject: [PATCH] webui: Removed unused JS causing issues with typeahead (#8307) * webui: Removed unused JS causing issues with typeahead * updated reference url for typeahead --- Makefile | 3 - doc/General/Acknowledgement.md | 2 +- html/js/librenms.js | 12 - html/js/typeahead.bundle.min.js | 9 +- lib/typeahead/.gitignore | 16 - lib/typeahead/.jshintrc | 16 - lib/typeahead/.travis.yml | 34 - lib/typeahead/Gruntfile.js | 328 --- lib/typeahead/bower.json | 16 - lib/typeahead/changelog.md | 171 -- lib/typeahead/composer.json | 17 - lib/typeahead/contributing.md | 120 - lib/typeahead/dist/bloodhound.js | 928 ------- lib/typeahead/dist/bloodhound.min.js | 7 - lib/typeahead/dist/typeahead.bundle.js | 2465 ----------------- lib/typeahead/dist/typeahead.bundle.min.js | 8 - lib/typeahead/dist/typeahead.jquery.js | 1542 ----------- lib/typeahead/dist/typeahead.jquery.min.js | 7 - lib/typeahead/doc/bloodhound.md | 284 -- lib/typeahead/doc/jquery_typeahead.md | 288 -- lib/typeahead/doc/migration/0.10.0.md | 234 -- lib/typeahead/karma.conf.js | 50 - lib/typeahead/license | 19 - lib/typeahead/package.json | 71 - lib/typeahead/readme.md | 135 - lib/typeahead/src/bloodhound/bloodhound.js | 199 -- lib/typeahead/src/bloodhound/lru_cache.js | 101 - .../src/bloodhound/options_parser.js | 197 -- .../src/bloodhound/persistent_storage.js | 147 - lib/typeahead/src/bloodhound/prefetch.js | 91 - lib/typeahead/src/bloodhound/remote.js | 59 - lib/typeahead/src/bloodhound/search_index.js | 194 -- lib/typeahead/src/bloodhound/tokenizers.js | 44 - lib/typeahead/src/bloodhound/transport.js | 130 - lib/typeahead/src/bloodhound/version.js | 7 - lib/typeahead/src/common/utils.js | 164 -- lib/typeahead/src/typeahead/dataset.js | 330 --- lib/typeahead/src/typeahead/default_menu.js | 75 - lib/typeahead/src/typeahead/event_bus.js | 78 - lib/typeahead/src/typeahead/event_emitter.js | 119 - lib/typeahead/src/typeahead/highlight.js | 84 - lib/typeahead/src/typeahead/input.js | 339 --- lib/typeahead/src/typeahead/menu.js | 219 -- lib/typeahead/src/typeahead/plugin.js | 291 -- lib/typeahead/src/typeahead/typeahead.js | 438 --- lib/typeahead/src/typeahead/www.js | 113 - .../test/bloodhound/bloodhound_spec.js | 350 --- .../test/bloodhound/lru_cache_spec.js | 43 - .../test/bloodhound/options_parser_spec.js | 194 -- .../bloodhound/persistent_storage_spec.js | 194 -- .../test/bloodhound/prefetch_spec.js | 182 -- lib/typeahead/test/bloodhound/remote_spec.js | 73 - .../test/bloodhound/search_index_spec.js | 79 - .../test/bloodhound/tokenizers_spec.js | 74 - .../test/bloodhound/transport_spec.js | 175 -- lib/typeahead/test/ci | 12 - lib/typeahead/test/fixtures/ajax_responses.js | 19 - lib/typeahead/test/fixtures/data.js | 128 - lib/typeahead/test/fixtures/html.js | 13 - lib/typeahead/test/helpers/typeahead_mocks.js | 78 - lib/typeahead/test/integration/test.html | 108 - lib/typeahead/test/integration/test.js | 395 --- lib/typeahead/test/playground.html | 346 --- lib/typeahead/test/typeahead/dataset_spec.js | 496 ---- .../test/typeahead/default_results_spec.js | 103 - .../test/typeahead/event_bus_spec.js | 42 - .../test/typeahead/event_emitter_spec.js | 111 - .../test/typeahead/highlight_spec.js | 117 - lib/typeahead/test/typeahead/input_spec.js | 538 ---- lib/typeahead/test/typeahead/menu_spec.js | 339 --- lib/typeahead/test/typeahead/plugin_spec.js | 205 -- .../test/typeahead/typeahead_spec.js | 1412 ---------- 72 files changed, 9 insertions(+), 16018 deletions(-) mode change 120000 => 100644 html/js/typeahead.bundle.min.js delete mode 100644 lib/typeahead/.gitignore delete mode 100644 lib/typeahead/.jshintrc delete mode 100644 lib/typeahead/.travis.yml delete mode 100644 lib/typeahead/Gruntfile.js delete mode 100644 lib/typeahead/bower.json delete mode 100644 lib/typeahead/changelog.md delete mode 100644 lib/typeahead/composer.json delete mode 100644 lib/typeahead/contributing.md delete mode 100644 lib/typeahead/dist/bloodhound.js delete mode 100644 lib/typeahead/dist/bloodhound.min.js delete mode 100644 lib/typeahead/dist/typeahead.bundle.js delete mode 100644 lib/typeahead/dist/typeahead.bundle.min.js delete mode 100644 lib/typeahead/dist/typeahead.jquery.js delete mode 100644 lib/typeahead/dist/typeahead.jquery.min.js delete mode 100644 lib/typeahead/doc/bloodhound.md delete mode 100644 lib/typeahead/doc/jquery_typeahead.md delete mode 100644 lib/typeahead/doc/migration/0.10.0.md delete mode 100644 lib/typeahead/karma.conf.js delete mode 100644 lib/typeahead/license delete mode 100644 lib/typeahead/package.json delete mode 100644 lib/typeahead/readme.md delete mode 100644 lib/typeahead/src/bloodhound/bloodhound.js delete mode 100644 lib/typeahead/src/bloodhound/lru_cache.js delete mode 100644 lib/typeahead/src/bloodhound/options_parser.js delete mode 100644 lib/typeahead/src/bloodhound/persistent_storage.js delete mode 100644 lib/typeahead/src/bloodhound/prefetch.js delete mode 100644 lib/typeahead/src/bloodhound/remote.js delete mode 100644 lib/typeahead/src/bloodhound/search_index.js delete mode 100644 lib/typeahead/src/bloodhound/tokenizers.js delete mode 100644 lib/typeahead/src/bloodhound/transport.js delete mode 100644 lib/typeahead/src/bloodhound/version.js delete mode 100644 lib/typeahead/src/common/utils.js delete mode 100644 lib/typeahead/src/typeahead/dataset.js delete mode 100644 lib/typeahead/src/typeahead/default_menu.js delete mode 100644 lib/typeahead/src/typeahead/event_bus.js delete mode 100644 lib/typeahead/src/typeahead/event_emitter.js delete mode 100644 lib/typeahead/src/typeahead/highlight.js delete mode 100644 lib/typeahead/src/typeahead/input.js delete mode 100644 lib/typeahead/src/typeahead/menu.js delete mode 100644 lib/typeahead/src/typeahead/plugin.js delete mode 100644 lib/typeahead/src/typeahead/typeahead.js delete mode 100644 lib/typeahead/src/typeahead/www.js delete mode 100644 lib/typeahead/test/bloodhound/bloodhound_spec.js delete mode 100644 lib/typeahead/test/bloodhound/lru_cache_spec.js delete mode 100644 lib/typeahead/test/bloodhound/options_parser_spec.js delete mode 100644 lib/typeahead/test/bloodhound/persistent_storage_spec.js delete mode 100644 lib/typeahead/test/bloodhound/prefetch_spec.js delete mode 100644 lib/typeahead/test/bloodhound/remote_spec.js delete mode 100644 lib/typeahead/test/bloodhound/search_index_spec.js delete mode 100644 lib/typeahead/test/bloodhound/tokenizers_spec.js delete mode 100644 lib/typeahead/test/bloodhound/transport_spec.js delete mode 100755 lib/typeahead/test/ci delete mode 100644 lib/typeahead/test/fixtures/ajax_responses.js delete mode 100644 lib/typeahead/test/fixtures/data.js delete mode 100644 lib/typeahead/test/fixtures/html.js delete mode 100644 lib/typeahead/test/helpers/typeahead_mocks.js delete mode 100644 lib/typeahead/test/integration/test.html delete mode 100644 lib/typeahead/test/integration/test.js delete mode 100644 lib/typeahead/test/playground.html delete mode 100644 lib/typeahead/test/typeahead/dataset_spec.js delete mode 100644 lib/typeahead/test/typeahead/default_results_spec.js delete mode 100644 lib/typeahead/test/typeahead/event_bus_spec.js delete mode 100644 lib/typeahead/test/typeahead/event_emitter_spec.js delete mode 100644 lib/typeahead/test/typeahead/highlight_spec.js delete mode 100644 lib/typeahead/test/typeahead/input_spec.js delete mode 100644 lib/typeahead/test/typeahead/menu_spec.js delete mode 100644 lib/typeahead/test/typeahead/plugin_spec.js delete mode 100644 lib/typeahead/test/typeahead/typeahead_spec.js diff --git a/Makefile b/Makefile index b3dec74ed6..ac356541d5 100644 --- a/Makefile +++ b/Makefile @@ -38,9 +38,6 @@ datetime-subtree: font-awesome: $(GIT_SUBTREE) --prefix=lib/Font-Awesome https://github.com/FortAwesome/Font-Awesome.git master -typeahead: - $(GIT_SUBTREE) --prefix=lib/typeahead https://github.com/corejavascript/typeahead.js.git master - gridster: $(GIT_SUBTREE) --prefix=lib/gridster https://github.com/dsmorse/gridster.js.git master diff --git a/doc/General/Acknowledgement.md b/doc/General/Acknowledgement.md index 73887148e5..200bcef861 100644 --- a/doc/General/Acknowledgement.md +++ b/doc/General/Acknowledgement.md @@ -9,7 +9,7 @@ We list below what we make use of including the license compliance. - [Font Awesome](http://fontawesome.io/icons/): MIT License - [Jquery Bootgrid](http://www.jquery-bootgrid.com/): MIT License - [Pace](https://github.com/HubSpot/pace): Open License - - [Twitter typeahead](http://twitter.github.io/typeahead.js/): Open License + - [Twitter typeahead](https://github.com/corejavascript/typeahead.js): Open License - [Vis](http://visjs.org/): MIT / Apache 2.0 - [TCPDF](http://www.tcpdf.org): LGPLv3 - [Bootstrap 3 Datepicker](http://eonasdan.github.io/bootstrap-datetimepicker/): MIT diff --git a/html/js/librenms.js b/html/js/librenms.js index 826fe1c604..5ee021e7cf 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -269,15 +269,3 @@ $(document).ready(function() { } }); }); - -$(document).ajaxComplete(function(){ - if($('.alert-status').length !== 0) { - $('.alert-status').each(function() { - if ($(this).parent().height() < 27) { - $(this).height('27px'); - } else { - $(this).height($(this).parent().height()); - } - }) - } -}); diff --git a/html/js/typeahead.bundle.min.js b/html/js/typeahead.bundle.min.js deleted file mode 120000 index e5d09b0474..0000000000 --- a/html/js/typeahead.bundle.min.js +++ /dev/null @@ -1 +0,0 @@ -../../lib/typeahead/dist/typeahead.bundle.min.js \ No newline at end of file diff --git a/html/js/typeahead.bundle.min.js b/html/js/typeahead.bundle.min.js new file mode 100644 index 0000000000..2d688c7b87 --- /dev/null +++ b/html/js/typeahead.bundle.min.js @@ -0,0 +1,8 @@ +/*! + * typeahead.js 1.2.0 + * https://github.com/twitter/typeahead.js + * Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT + */ + +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(a.jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){if(!(d=c.call(null,e,a,b)))return!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){if(d=c.call(null,e,a,b))return!1}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,j<=0?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},guid:function(){function a(a){var b=(Math.random().toString(16)+"000000000").substr(2,8);return a?"-"+b.substr(0,4)+"-"+b.substr(4,4):b}return"tt-"+a()+a(!0)+a(!0)+a()},noop:function(){}}}(),c="1.2.0",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){a=b.toStr(a);var c=[],d="";return b.each(a.split(""),function(a){a.match(/\s+/)?d="":(c.push(d+a),d+=a)}),c}function e(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,ngram:d,obj:{nonword:e(c),whitespace:e(a),ngram:e(d)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];if(b)return this.list.moveToFront(b),b.val},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;bc)}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.maxPendingRequests=a.maxPendingRequests||6,this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):g}var d=0,f={},g=new e(10);return c.setMaxPendingRequests=function(a){this.maxPendingRequests=a},c.resetCache=function(){g.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),j._cache.set(h,a)}function e(){b(!0)}function g(){d--,delete f[h],j.onDeckRequestArgs&&(j._get.apply(j,j.onDeckRequestArgs),j.onDeckRequestArgs=null)}var h,i,j=this;h=this._fingerprint(a),this.cancelled||h!==this.lastReq||((i=f[h])?i.done(c).fail(e):db[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length&&!j.matchAnyQueryToken)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];if(b&&0===c.length)f=b[i].slice(0),e=e?g(e,f):f;else if(!j.matchAnyQueryToken)return e=[],!1}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.indexResponse=a.indexResponse,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport,maxPendingRequests:a.maxPendingRequests})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,matchAnyQueryToken:!1,sufficient:5,indexRemote:!1,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.indexRemote=a.indexRemote,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),g.indexRemote&&g.add(c),d(c)}var f,g=this;return c=c||b.noop,d=d||b.noop,f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length',menu:'
'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={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:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={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 a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e=a.Event(d+b);return this.$el.trigger.call(this.$el,e,c||[]),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&e