/*! For license information please see search.js.LICENSE.txt */
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=5)}([function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(8),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},,,,function(t,e,n){t.exports=n(6)},function(t,e,n){$(document).ready((function(){if(window.algolia){var t=n(7),e=n(10);n(11);var r=t(window.algolia.app_id,window.algolia.app_key).initIndex("litstack"),o={suggestion:e.compile($("#search_suggestion_template").html()),empty:e.compile($("#search_empty_template").html()),footer:e.compile($("#search_footer_template").html())},i=$("#dd-search"),s=$("#docs .content");i.blur((function(){$(this).val("")}));var a=[];a.push({source:function(t,e){r.search(t,{hitsPerPage:5,facetFilters:["version:"+window.version],highlightPreTag:"<em>",highlightPostTag:"</em>",clickAnalytics:!0},(function(t,n){if(t)throw t;e(n.hits)}))},templates:{suggestion:o.suggestion.render.bind(o.suggestion),empty:o.empty.render.bind(o.empty),footer:o.footer.render.bind(o.footer)}});var u=i.typeahead({hint:!1},a),c="";u.on("typeahead:selected",(function(t,e){window.location.href=e.url.replace(/^.*\/\/[^\/]+/,"")})),u.on("keyup",(function(t){c=$(this).typeahead("val"),""===$(this).val()&&c.length==$(this).typeahead("val")?(s.css("opacity","1"),i.closest("#search-wrapper").removeClass("not-empty")):(s.css("opacity","0.1"),i.closest("#search-wrapper").addClass("not-empty")),27===t.keyCode&&s.css("opacity","1")})),u.on("typeahead:closed",(function(){s.css("opacity","1")})),u.on("typeahead:closed",(function(t){if($(t.target).is(":focus"))return!1}))}}))},function(t,e,n){(function(n,r){var o,i,s,a,u;function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"undefined"!=typeof window?a=window:"undefined"!=typeof self&&(a=self),a.ALGOLIA_MIGRATION_LAYER=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){var n=e[s][1][t];return o(n||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=!1,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){function r(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function o(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}e.exports=function(t,e,n){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},s.type=e.type||"text/javascript",s.charset=e.charset||"utf8",s.async=!("async"in e)||!!e.async,s.src=t,e.attrs&&function(t,e){for(var n in e)t.setAttribute(n,e[n])}(s,e.attrs),e.text&&(s.text=""+e.text),("onload"in s?r:o)(s,n),s.onload||r(s,n),i.appendChild(s)}},{}],2:[function(t,e,n){"use strict";e.exports=function(t){for(var e=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+t.replace(".","\\.")+"(?:\\.min)?\\.js$"),n=document.getElementsByTagName("script"),r=!1,o=0,i=n.length;o<i;o++)if(n[o].src&&e.test(n[o].src)){r=!0;break}return r}},{}],3:[function(t,e,n){"use strict";function r(t){return function(){var e="AlgoliaSearch: loaded V2 script using "+t;window.console&&window.console.log&&window.console.log(e)}}e.exports=function(e){var n=t(1),o="//cdn.jsdelivr.net/algoliasearch/2/"+e+".min.js",i="-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch  `latest` warning --";window.console&&(window.console.warn?window.console.warn(i):window.console.log&&window.console.log(i));try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true<\/script>"),!0===window.ALGOLIA_SUPPORTS_DOCWRITE?(document.write('<script src="'+o+'"><\/script>'),r("document.write")()):n(o,r("DOMElement"))}catch(t){n(o,r("DOMElement"))}}},{1:1}],4:[function(t,e,n){"use strict";e.exports=function(){var t="-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --";window.AlgoliaSearch=function(){throw new Error(t)},window.AlgoliaSearchHelper=function(){throw new Error(t)},window.AlgoliaExplainResults=function(){throw new Error(t)}}},{}],5:[function(t,e,n){"use strict";var r,o,i,s;r="algoliasearch",o=t(2),i=t(3),s=t(4),o(r)?i(r):s()},{2:2,3:3,4:4}]},{},[5])(5),u=function(){return function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){var n=e[s][1][t];return o(n||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=!1,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(t){return"function"==typeof t}function i(t){return"object"===c(t)&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,n,r,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(s(n=this._events[t]))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,a=new Array(r-1),u=1;u<r;u++)a[u-1]=arguments[u];n.apply(this,a)}else if(i(n)){for(r=arguments.length,a=new Array(r-1),u=1;u<r;u++)a[u-1]=arguments[u];for(r=(c=n.slice()).length,u=0;u<r;u++)c[u].apply(this,a)}return!0},r.prototype.addListener=function(t,e){var n;if(!o(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,o(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!o(e))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var n,r,s,a;if(!o(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(n=this._events[t]).length,r=-1,n===e||o(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(o(n=this._events[t]))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?o(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){return t._events&&t._events[e]?o(t._events[e])?1:t._events[e].length:0}},{}],2:[function(t,e,n){var r,o=e.exports={},i=[],s=!1,a=-1;function u(){s=!1,r.length?i=r.concat(i):a=-1,i.length&&c()}function c(){if(!s){var t=setTimeout(u);s=!0;for(var e=i.length;e;){for(r=i,i=[];++a<e;)r[a].run();a=-1,e=i.length}r=null,s=!1,clearTimeout(t)}}function l(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];i.push(new l(t,e)),1!==i.length||s||setTimeout(c,0)},l.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],3:[function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,n,i){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var h,f,p,d,m=t[l].replace(a,"%20"),y=m.indexOf(n);y>=0?(h=m.substr(0,y),f=m.substr(y+1)):(h=m,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),r(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){"use strict";var r=function(t){switch(c(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"===c(t)?i(s(t),(function(s){var a=encodeURIComponent(r(s))+n;return o(t[s])?i(t[s],(function(t){return a+encodeURIComponent(r(t))})).join(e):a+encodeURIComponent(r(t[s]))})).join(e):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var s=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},{}],5:[function(t,e,n){"use strict";n.decode=n.parse=t(3),n.encode=n.stringify=t(4)},{3:3,4:4}],6:[function(t,e,n){function r(){var t;try{t=n.storage.debug}catch(t){}return t}(n=e.exports=t(7)).log=function(){return"object"===("undefined"==typeof console?"undefined":c(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},n.formatArgs=function(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),!e)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var o=0,i=0;return t[0].replace(/%[a-z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,r),t},n.save=function(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}},n.load=r,n.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){return JSON.stringify(t)},n.enable(r())},{7:7}],7:[function(t,e,n){(n=e.exports=function(t){function e(){}function o(){var t=o,e=+new Date,s=e-(r||e);t.diff=s,t.prev=r,t.curr=e,r=e,null==t.useColors&&(t.useColors=n.useColors()),null==t.color&&t.useColors&&(t.color=i());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var u=0;a[0]=a[0].replace(/%([a-z%])/g,(function(e,r){if("%%"===e)return e;u++;var o=n.formatters[r];if("function"==typeof o){var i=a[u];e=o.call(t,i),a.splice(u,1),u--}return e})),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(t,a));var c=o.log||n.log||console.log.bind(console);c.apply(t,a)}e.enabled=!1,o.enabled=!0;var s=n.enabled(t)?o:e;return s.namespace=t,s}).coerce=function(t){return t instanceof Error?t.stack||t.message:t},n.disable=function(){n.enable("")},n.enable=function(t){n.save(t);for(var e=(t||"").split(/[\s,]+/),r=e.length,o=0;o<r;o++)e[o]&&("-"===(t=e[o].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))},n.enabled=function(t){var e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1},n.humanize=t(8),n.names=[],n.skips=[],n.formatters={};var r,o=0;function i(){return n.colors[o++%n.colors.length]}},{8:8}],8:[function(t,e,n){var r=1e3,o=6e4,i=60*o,s=24*i;function a(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}e.exports=function(t,e){return e=e||{},"string"==typeof t?function(t){if(!((t=""+t).length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"days":case"day":case"d":return n*s;case"hours":case"hour":case"hrs":case"hr":case"h":return n*i;case"minutes":case"minute":case"mins":case"min":case"m":return n*o;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}(t):e.long?a(n=t,s,"day")||a(n,i,"hour")||a(n,o,"minute")||a(n,r,"second")||n+" ms":function(t){return t>=s?Math.round(t/s)+"d":t>=i?Math.round(t/i)+"h":t>=o?Math.round(t/o)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);var n}},{}],9:[function(t,e,o){(function(n,o){(function(){"use strict";function i(t){return"function"==typeof t}var s,a,u=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},l=0,h=function(t,e){S[l]=t,S[l+1]=e,2===(l+=2)&&(a?a(k):v())},f="undefined"!=typeof window?window:void 0,p=f||{},d=p.MutationObserver||p.WebKitMutationObserver,m=void 0!==n&&"[object process]"==={}.toString.call(n),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function g(){return function(){setTimeout(k,1)}}var v,b,w,_,x,j,T,S=new Array(1e3);function k(){for(var t=0;t<l;t+=2)(0,S[t])(S[t+1]),S[t]=void 0,S[t+1]=void 0;l=0}function A(){}m?(j=n.nextTick,T=n.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(T)&&"0"===T[1]&&"10"===T[2]&&(j=r),v=function(){j(k)}):d?(w=0,_=new d(k),x=document.createTextNode(""),_.observe(x,{characterData:!0}),v=function(){x.data=w=++w%2}):y?((b=new MessageChannel).port1.onmessage=k,v=function(){b.port2.postMessage(0)}):v=void 0===f&&"function"==typeof t?function(){try{var e=t("vertx");return s=e.runOnLoop||e.runOnContext,function(){s(k)}}catch(t){return g()}}():g();var I=new L;function C(t,e){if(e.constructor===t.constructor)!function(t,e){1===e._state?R(t,e._result):2===e._state?P(t,e._result):q(e,void 0,(function(e){O(t,e)}),(function(e){P(t,e)}))}(t,e);else{var n=function(t){try{return t.then}catch(t){return I.error=t,I}}(e);n===I?P(t,I.error):void 0===n?R(t,e):i(n)?function(t,e,n){h((function(t){var r=!1,o=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?O(t,n):R(t,n))}),(function(e){r||(r=!0,P(t,e))}),t._label);!r&&o&&(r=!0,P(t,o))}),t)}(t,e,n):R(t,e)}}function O(t,e){var n;t===e?P(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=e)||"object"===c(n)&&null!==n?C(t,e):R(t,e)}function E(t){t._onerror&&t._onerror(t._result),U(t)}function R(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&h(U,t))}function P(t,e){void 0===t._state&&(t._state=2,t._result=e,h(E,t))}function q(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+1]=n,o[i+2]=r,0===i&&t._state&&h(U,t)}function U(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,o,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?D(n,r,o,i):o(i);t._subscribers.length=0}}function L(){this.error=null}var N=new L;function D(t,e,n,r){var o,s,a,u,c=i(n);if(c){if((o=function(t,e){try{return t(e)}catch(t){return N.error=t,N}}(n,r))===N?(u=!0,s=o.error,o=null):a=!0,e===o)return void P(e,new TypeError("A promises callback cannot return that same promise."))}else o=r,a=!0;void 0!==e._state||(c&&a?O(e,o):u?P(e,s):1===t?R(e,o):2===t&&P(e,o))}function $(t,e){this._instanceConstructor=t,this.promise=new t(A),this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&R(this.promise,this._result))):P(this.promise,this._validationError())}$.prototype._validateInput=function(t){return u(t)},$.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},$.prototype._init=function(){this._result=new Array(this.length)};var F=$;$.prototype._enumerate=function(){for(var t=this.length,e=this.promise,n=this._input,r=0;void 0===e._state&&r<t;r++)this._eachEntry(n[r],r)},$.prototype._eachEntry=function(t,e){var n,r=this._instanceConstructor;"object"===c(n=t)&&null!==n?t.constructor===r&&void 0!==t._state?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(r.resolve(t),e):(this._remaining--,this._result[e]=t)},$.prototype._settledAt=function(t,e,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===t?P(r,n):this._result[e]=n),0===this._remaining&&R(r,this._result)},$.prototype._willSettleAt=function(t,e){var n=this;q(t,void 0,(function(t){n._settledAt(1,e,t)}),(function(t){n._settledAt(2,e,t)}))};var K=function(t){return new F(this,t).promise},H=function(t){var e=new this(A);if(!u(t))return P(e,new TypeError("You must pass an array to race.")),e;var n=t.length;function r(t){O(e,t)}function o(t){P(e,t)}for(var i=0;void 0===e._state&&i<n;i++)q(this.resolve(t[i]),void 0,r,o);return e},M=function(t){if(t&&"object"===c(t)&&t.constructor===this)return t;var e=new this(A);return O(e,t),e},B=function(t){var e=new this(A);return P(e,t),e},V=0,z=Q;function Q(t){this._id=V++,this._state=void 0,this._result=void 0,this._subscribers=[],A!==t&&(i(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof Q||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(t,e){try{e((function(e){O(t,e)}),(function(e){P(t,e)}))}catch(e){P(t,e)}}(this,t))}Q.all=K,Q.race=H,Q.resolve=M,Q.reject=B,Q._setScheduler=function(t){a=t},Q._setAsap=function(t){h=t},Q._asap=h,Q.prototype={constructor:Q,then:function(t,e){var n=this,r=n._state;if(1===r&&!t||2===r&&!e)return this;var o=new this.constructor(A),i=n._result;if(r){var s=arguments[r-1];h((function(){D(r,o,s,i)}))}else q(n,o,t,e);return o},catch:function(t){return this.then(null,t)}};var J=function(){var t;if(void 0!==o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;e&&"[object Promise]"===Object.prototype.toString.call(e.resolve())&&!e.cast||(t.Promise=z)},G={Promise:z,polyfill:J};void 0!==e&&e.exports?e.exports=G:void 0!==this&&(this.ES6Promise=G),J()}).call(this)}).call(this,t(2),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],10:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],11:[function(t,e,n){var r=t(14),o=t(18),i=t(30)(r,o);e.exports=i},{14:14,18:18,30:30}],12:[function(t,e,n){var r=Math.max;e.exports=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,o=-1,i=r(n.length-e,0),s=Array(i);++o<i;)s[o]=n[e+o];switch(e){case 0:return t.call(this,s);case 1:return t.call(this,n[0],s);case 2:return t.call(this,n[0],n[1],s)}var a=Array(e+1);for(o=-1;++o<e;)a[o]=n[o];return a[e]=s,t.apply(this,a)}}},{}],13:[function(t,e,n){e.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},{}],14:[function(t,e,n){e.exports=function(t,e){for(var n=-1,r=t.length;++n<r&&!1!==e(t[n],n,t););return t}},{}],15:[function(t,e,n){var r=t(17),o=t(55);e.exports=function(t,e){return null==e?t:r(e,o(e),t)}},{17:17,55:55}],16:[function(t,e,n){var r=t(13),o=t(14),i=t(15),s=t(21),a=t(33),u=t(34),c=t(35),l=t(47),h=t(37),f=t(50),p={};p["[object Arguments]"]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object Boolean]"]=p["[object Date]"]=p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Number]"]=p["[object Object]"]=p["[object RegExp]"]=p["[object String]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p["[object Error]"]=p["[object Function]"]=p["[object Map]"]=p["[object Set]"]=p["[object WeakMap]"]=!1;var d=Object.prototype.toString;e.exports=function t(e,n,m,y,g,v,b){var w;if(m&&(w=g?m(e,y,g):m(e)),void 0!==w)return w;if(!f(e))return e;var _=l(e);if(_){if(w=a(e),!n)return r(e,w)}else{var x=d.call(e),j="[object Function]"==x;if("[object Object]"!=x&&"[object Arguments]"!=x&&(!j||g))return p[x]?u(e,x,n):g?e:{};if(h(e))return g?e:{};if(w=c(j?{}:e),!n)return i(w,e)}v||(v=[]),b||(b=[]);for(var T=v.length;T--;)if(v[T]==e)return b[T];return v.push(e),b.push(w),(_?o:s)(e,(function(r,o){w[o]=t(r,n,m,o,e,v,b)})),w}},{13:13,14:14,15:15,21:21,33:33,34:34,35:35,37:37,47:47,50:50}],17:[function(t,e,n){e.exports=function(t,e,n){n||(n={});for(var r=-1,o=e.length;++r<o;){var i=e[r];n[i]=t[i]}return n}},{}],18:[function(t,e,n){var r=t(21),o=t(28)(r);e.exports=o},{21:21,28:28}],19:[function(t,e,n){var r=t(29)();e.exports=r},{29:29}],20:[function(t,e,n){var r=t(19),o=t(56);e.exports=function(t,e){return r(t,e,o)}},{19:19,56:56}],21:[function(t,e,n){var r=t(19),o=t(55);e.exports=function(t,e){return r(t,e,o)}},{19:19,55:55}],22:[function(t,e,n){var r=t(14),o=t(23),i=t(47),s=t(36),a=t(50),u=t(41),c=t(53),l=t(55);e.exports=function t(e,n,h,f,p){if(!a(e))return e;var d=s(n)&&(i(n)||c(n)),m=d?void 0:l(n);return r(m||n,(function(r,i){if(m&&(r=n[i=r]),u(r))f||(f=[]),p||(p=[]),o(e,n,i,t,h,f,p);else{var s=e[i],a=h?h(s,r,i,e,n):void 0,c=void 0===a;c&&(a=r),void 0===a&&(!d||i in e)||!c&&(a==a?a===s:s!=s)||(e[i]=a)}})),e}},{14:14,23:23,36:36,41:41,47:47,50:50,53:53,55:55}],23:[function(t,e,n){var r=t(13),o=t(46),i=t(47),s=t(36),a=t(51),u=t(53),c=t(54);e.exports=function(t,e,n,l,h,f,p){for(var d=f.length,m=e[n];d--;)if(f[d]==m)return void(t[n]=p[d]);var y=t[n],g=h?h(y,m,n,t,e):void 0,v=void 0===g;v&&(g=m,s(m)&&(i(m)||u(m))?g=i(y)?y:s(y)?r(y):[]:a(m)||o(m)?g=o(y)?c(y):a(y)?y:{}:v=!1),f.push(m),p.push(g),v?t[n]=l(g,m,h,f,p):(g==g?g!==y:y==y)&&(t[n]=g)}},{13:13,36:36,46:46,47:47,51:51,53:53,54:54}],24:[function(t,e,n){var r=t(43);e.exports=function(t){return function(e){return null==e?void 0:r(e)[t]}}},{43:43}],25:[function(t,e,n){var r=t(59);e.exports=function(t,e,n){if("function"!=typeof t)return r;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)};case 5:return function(n,r,o,i,s){return t.call(e,n,r,o,i,s)}}return function(){return t.apply(e,arguments)}}},{59:59}],26:[function(t,e,r){(function(t){var n=t.ArrayBuffer,r=t.Uint8Array;e.exports=function(t){var e=new n(t.byteLength);return new r(e).set(new r(t)),e}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(t,e,n){var r=t(25),o=t(39),i=t(12);e.exports=function(t){return i((function(e,n){var i=-1,s=null==e?0:n.length,a=s>2?n[s-2]:void 0,u=s>2?n[2]:void 0,c=s>1?n[s-1]:void 0;for("function"==typeof a?(a=r(a,c,5),s-=2):s-=(a="function"==typeof c?c:void 0)?1:0,u&&o(n[0],n[1],u)&&(a=s<3?void 0:a,s=1);++i<s;){var l=n[i];l&&t(e,l,a)}return e}))}},{12:12,25:25,39:39}],28:[function(t,e,n){var r=t(31),o=t(40),i=t(43);e.exports=function(t,e){return function(n,s){var a=n?r(n):0;if(!o(a))return t(n,s);for(var u=e?a:-1,c=i(n);(e?u--:++u<a)&&!1!==s(c[u],u,c););return n}}},{31:31,40:40,43:43}],29:[function(t,e,n){var r=t(43);e.exports=function(t){return function(e,n,o){for(var i=r(e),s=o(e),a=s.length,u=t?a:-1;t?u--:++u<a;){var c=s[u];if(!1===n(i[c],c,i))break}return e}}},{43:43}],30:[function(t,e,n){var r=t(25),o=t(47);e.exports=function(t,e){return function(n,i,s){return"function"==typeof i&&void 0===s&&o(n)?t(n,i):e(n,r(i,s,3))}}},{25:25,47:47}],31:[function(t,e,n){var r=t(24)("length");e.exports=r},{24:24}],32:[function(t,e,n){var r=t(49);e.exports=function(t,e){var n=null==t?void 0:t[e];return r(n)?n:void 0}},{49:49}],33:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&r.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},{}],34:[function(t,e,r){(function(n){var r=t(26),o=/\w*$/,i=n.Uint8Array,s={};s["[object Float32Array]"]=n.Float32Array,s["[object Float64Array]"]=n.Float64Array,s["[object Int8Array]"]=n.Int8Array,s["[object Int16Array]"]=n.Int16Array,s["[object Int32Array]"]=n.Int32Array,s["[object Uint8Array]"]=i,s["[object Uint8ClampedArray]"]=n.Uint8ClampedArray,s["[object Uint16Array]"]=n.Uint16Array,s["[object Uint32Array]"]=n.Uint32Array,e.exports=function(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":i instanceof i&&(i=s[e]);var a=t.buffer;return new i(n?r(a):a,t.byteOffset,t.length);case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":var u=new i(t.source,o.exec(t));u.lastIndex=t.lastIndex}return u}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{26:26}],35:[function(t,e,n){e.exports=function(t){var e=t.constructor;return"function"==typeof e&&e instanceof e||(e=Object),new e}},{}],36:[function(t,e,n){var r=t(31),o=t(40);e.exports=function(t){return null!=t&&o(r(t))}},{31:31,40:40}],37:[function(t,e,n){var r=function(){try{Object({toString:0}+"")}catch(t){return function(){return!1}}return function(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}}();e.exports=r},{}],38:[function(t,e,n){var r=/^\d+$/;e.exports=function(t,e){return e=null==e?9007199254740991:e,(t="number"==typeof t||r.test(t)?+t:-1)>-1&&t%1==0&&t<e}},{}],39:[function(t,e,n){var r=t(36),o=t(38),i=t(50);e.exports=function(t,e,n){if(!i(n))return!1;var s=c(e);if("number"==s?r(n)&&o(e,n.length):"string"==s&&e in n){var a=n[e];return t==t?t===a:a!=a}return!1}},{36:36,38:38,50:50}],40:[function(t,e,n){e.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},{}],41:[function(t,e,n){e.exports=function(t){return!!t&&"object"==c(t)}},{}],42:[function(t,e,n){var r=t(46),o=t(47),i=t(38),s=t(40),a=t(52),u=t(56),c=Object.prototype.hasOwnProperty;e.exports=function(t){for(var e=u(t),n=e.length,l=n&&t.length,h=!!l&&s(l)&&(o(t)||r(t)||a(t)),f=-1,p=[];++f<n;){var d=e[f];(h&&i(d,l)||c.call(t,d))&&p.push(d)}return p}},{38:38,40:40,46:46,47:47,52:52,56:56}],43:[function(t,e,n){var r=t(50),o=t(52),i=t(58);e.exports=function(t){if(i.unindexedChars&&o(t)){for(var e=-1,n=t.length,s=Object(t);++e<n;)s[e]=t.charAt(e);return s}return r(t)?t:Object(t)}},{50:50,52:52,58:58}],44:[function(t,e,n){var r=t(16),o=t(25),i=t(39);e.exports=function(t,e,n,s){return e&&"boolean"!=typeof e&&i(t,e,n)?e=!1:"function"==typeof e&&(s=n,n=e,e=!1),"function"==typeof n?r(t,e,o(n,s,1)):r(t,e)}},{16:16,25:25,39:39}],45:[function(t,e,n){var r=t(16),o=t(25);e.exports=function(t,e,n){return"function"==typeof e?r(t,!0,o(e,n,1)):r(t,!0)}},{16:16,25:25}],46:[function(t,e,n){var r=t(36),o=t(41),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable;e.exports=function(t){return o(t)&&r(t)&&s.call(t,"callee")&&!a.call(t,"callee")}},{36:36,41:41}],47:[function(t,e,n){var r=t(32),o=t(40),i=t(41),s=Object.prototype.toString,a=r(Array,"isArray")||function(t){return i(t)&&o(t.length)&&"[object Array]"==s.call(t)};e.exports=a},{32:32,40:40,41:41}],48:[function(t,e,n){var r=t(50),o=Object.prototype.toString;e.exports=function(t){return r(t)&&"[object Function]"==o.call(t)}},{50:50}],49:[function(t,e,n){var r=t(48),o=t(37),i=t(41),s=/^\[object .+?Constructor\]$/,a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,l=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(t){return null!=t&&(r(t)?l.test(u.call(t)):i(t)&&(o(t)?l:s).test(t))}},{37:37,41:41,48:48}],50:[function(t,e,n){e.exports=function(t){var e=c(t);return!!t&&("object"==e||"function"==e)}},{}],51:[function(t,e,n){var r=t(20),o=t(46),i=t(37),s=t(41),a=t(58),u=Object.prototype,c=u.hasOwnProperty,l=u.toString;e.exports=function(t){var e,n;return!(!s(t)||"[object Object]"!=l.call(t)||i(t)||o(t)||!(c.call(t,"constructor")||"function"!=typeof(e=t.constructor)||e instanceof e))&&(a.ownLast?(r(t,(function(t,e,r){return n=c.call(r,e),!1})),!1!==n):(r(t,(function(t,e){n=e})),void 0===n||c.call(t,n)))}},{20:20,37:37,41:41,46:46,58:58}],52:[function(t,e,n){var r=t(41),o=Object.prototype.toString;e.exports=function(t){return"string"==typeof t||r(t)&&"[object String]"==o.call(t)}},{41:41}],53:[function(t,e,n){var r=t(40),o=t(41),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1;var s=Object.prototype.toString;e.exports=function(t){return o(t)&&r(t.length)&&!!i[s.call(t)]}},{40:40,41:41}],54:[function(t,e,n){var r=t(17),o=t(56);e.exports=function(t){return r(t,o(t))}},{17:17,56:56}],55:[function(t,e,n){var r=t(32),o=t(36),i=t(50),s=t(42),a=t(58),u=r(Object,"keys"),c=u?function(t){var e=null==t?void 0:t.constructor;return"function"==typeof e&&e.prototype===t||("function"==typeof t?a.enumPrototypes:o(t))?s(t):i(t)?u(t):[]}:s;e.exports=c},{32:32,36:36,42:42,50:50,58:58}],56:[function(t,e,n){var r=t(14),o=t(46),i=t(47),s=t(48),a=t(38),u=t(40),c=t(50),l=t(52),h=t(58),f=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],p=Error.prototype,d=Object.prototype,m=String.prototype,y=d.hasOwnProperty,g=d.toString,v={};v["[object Array]"]=v["[object Date]"]=v["[object Number]"]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},v["[object Boolean]"]=v["[object String]"]={constructor:!0,toString:!0,valueOf:!0},v["[object Error]"]=v["[object Function]"]=v["[object RegExp]"]={constructor:!0,toString:!0},v["[object Object]"]={constructor:!0},r(f,(function(t){for(var e in v)if(y.call(v,e)){var n=v[e];n[t]=y.call(n,t)}})),e.exports=function(t){if(null==t)return[];c(t)||(t=Object(t));var e=t.length;e=e&&u(e)&&(i(t)||o(t)||l(t))&&e||0;for(var n=t.constructor,r=-1,b=s(n)&&n.prototype||d,w=b===t,_=Array(e),x=e>0,j=h.enumErrorProps&&(t===p||t instanceof Error),T=h.enumPrototypes&&s(t);++r<e;)_[r]=r+"";for(var S in t)T&&"prototype"==S||j&&("message"==S||"name"==S)||x&&a(S,e)||"constructor"==S&&(w||!y.call(t,S))||_.push(S);if(h.nonEnumShadows&&t!==d){var k=t===m?"[object String]":t===p?"[object Error]":g.call(t),A=v[k]||v["[object Object]"];for("[object Object]"==k&&(b=d),e=f.length;e--;){var I=A[S=f[e]];w&&I||!(I?y.call(t,S):t[S]!==b[S])||_.push(S)}}return _}},{14:14,38:38,40:40,46:46,47:47,48:48,50:50,52:52,58:58}],57:[function(t,e,n){var r=t(22),o=t(27)(r);e.exports=o},{22:22,27:27}],58:[function(t,e,n){var r=Array.prototype,o=Error.prototype,i=Object.prototype.propertyIsEnumerable,s=r.splice,a={};!function(t){var e=function(){this.x=1},n={0:1,length:1},r=[];for(var u in e.prototype={valueOf:1,y:1},new e)r.push(u);a.enumErrorProps=i.call(o,"message")||i.call(o,"name"),a.enumPrototypes=i.call(e,"prototype"),a.nonEnumShadows=!/valueOf/.test(r),a.ownLast="x"!=r[0],a.spliceObjects=(s.call(n,0,1),!n[0]),a.unindexedChars="x"[0]+Object("x")[0]!="xx"}(),e.exports=a},{}],59:[function(t,e,n){e.exports=function(t){return t}},{}],60:[function(t,e,n){(function(n){"use strict";e.exports=o;var r=t(66);function o(e,n,o){var a=t(6)("algoliasearch"),u=t(44),c=t(47),l="Usage: algoliasearch(applicationID, apiKey, opts)";if(!e)throw new r.AlgoliaSearchError("Please provide an application ID. "+l);if(!n)throw new r.AlgoliaSearchError("Please provide an API key. "+l);this.applicationID=e,this.apiKey=n;var h=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]},this.hostIndex={read:0,write:0};var f=(o=o||{}).protocol||"https:",p=void 0===o.timeout?2e3:o.timeout;if(/:$/.test(f)||(f+=":"),"http:"!==o.protocol&&"https:"!==o.protocol)throw new r.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+o.protocol+"`)");o.hosts?c(o.hosts)?(this.hosts.read=u(o.hosts),this.hosts.write=u(o.hosts)):(this.hosts.read=u(o.hosts.read),this.hosts.write=u(o.hosts.write)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(h),this.hosts.write=[this.applicationID+".algolia.net"].concat(h)),this.hosts.read=i(this.hosts.read,s(f)),this.hosts.write=i(this.hosts.write,s(f)),this.requestTimeout=p,this.extraHeaders=[],this.cache={},this._ua=o._ua,this._useCache=void 0===o._useCache||o._useCache,this._setTimeout=o._setTimeout,a("init done, %j",this)}function i(t,e){for(var n=[],r=0;r<t.length;++r)n.push(e(t[r],r));return n}function s(t){return function(e){return t+"//"+e.toLowerCase()}}function a(){throw new r.AlgoliaSearchError("Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com")}function u(t,e){var n=t.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+t+"` was replaced by `"+e+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+n}function l(t,e){e(t,0)}function h(t,e){var n=!1;return function(){return n||(console.log(e),n=!0),t.apply(this,arguments)}}function f(t){if(void 0===Array.prototype.toJSON)return JSON.stringify(t);var e=Array.prototype.toJSON;delete Array.prototype.toJSON;var n=JSON.stringify(t);return Array.prototype.toJSON=e,n}o.prototype={deleteIndex:function(t,e){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(t),hostType:"write",callback:e})},moveIndex:function(t,e,n){var r={operation:"move",destination:e};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t)+"/operation",body:r,hostType:"write",callback:n})},copyIndex:function(t,e,n){var r={operation:"copy",destination:e};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t)+"/operation",body:r,hostType:"write",callback:n})},getLogs:function(t,e,n){return 0===arguments.length||"function"==typeof t?(n=t,t=0,e=10):1!==arguments.length&&"function"!=typeof e||(n=e,e=10),this._jsonRequest({method:"GET",url:"/1/logs?offset="+t+"&length="+e,hostType:"read",callback:n})},listIndexes:function(t,e){var n="";return void 0===t||"function"==typeof t?e=t:n="?page="+t,this._jsonRequest({method:"GET",url:"/1/indexes"+n,hostType:"read",callback:e})},initIndex:function(t){return new this.Index(this,t)},listUserKeys:function(t){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:t})},getUserKeyACL:function(t,e){return this._jsonRequest({method:"GET",url:"/1/keys/"+t,hostType:"read",callback:e})},deleteUserKey:function(t,e){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+t,hostType:"write",callback:e})},addUserKey:function(t,e,n){1!==arguments.length&&"function"!=typeof e||(n=e,e=null);var r={acl:t};return e&&(r.validity=e.validity,r.maxQueriesPerIPPerHour=e.maxQueriesPerIPPerHour,r.maxHitsPerQuery=e.maxHitsPerQuery,r.indexes=e.indexes,r.description=e.description,e.queryParameters&&(r.queryParameters=this._getSearchParams(e.queryParameters,"")),r.referers=e.referers),this._jsonRequest({method:"POST",url:"/1/keys",body:r,hostType:"write",callback:n})},addUserKeyWithValidity:h((function(t,e,n){return this.addUserKey(t,e,n)}),u("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(t,e,n,r){2!==arguments.length&&"function"!=typeof n||(r=n,n=null);var o={acl:e};return n&&(o.validity=n.validity,o.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,o.maxHitsPerQuery=n.maxHitsPerQuery,o.indexes=n.indexes,o.description=n.description,n.queryParameters&&(o.queryParameters=this._getSearchParams(n.queryParameters,"")),o.referers=n.referers),this._jsonRequest({method:"PUT",url:"/1/keys/"+t,body:o,hostType:"write",callback:r})},setSecurityTags:function(t){if("[object Array]"===Object.prototype.toString.call(t)){for(var e=[],n=0;n<t.length;++n)if("[object Array]"===Object.prototype.toString.call(t[n])){for(var r=[],o=0;o<t[n].length;++o)r.push(t[n][o]);e.push("("+r.join(",")+")")}else e.push(t[n]);t=e.join(",")}this.securityTags=t},setUserToken:function(t){this.userToken=t},startQueriesBatch:h((function(){this._batch=[]}),u("client.startQueriesBatch()","client.search()")),addQueryInBatch:h((function(t,e,n){this._batch.push({indexName:t,query:e,params:n})}),u("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:h((function(t){return this.search(this._batch,t)}),u("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(t){t&&(this.requestTimeout=parseInt(t,10))},search:function(t,e){var n=this,r={requests:i(t,(function(t){var e="";return void 0!==t.query&&(e+="query="+encodeURIComponent(t.query)),{indexName:t.indexName,params:n._getSearchParams(t.params,e)}}))};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:r,hostType:"read",callback:e})},batch:function(t,e){return this._jsonRequest({method:"POST",url:"/1/indexes/*/batch",body:{requests:t},hostType:"write",callback:e})},destroy:a,enableRateLimitForward:a,disableRateLimitForward:a,useSecuredAPIKey:a,disableSecuredAPIKey:a,generateSecuredApiKey:a,Index:function(t,e){this.indexName=e,this.as=t,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}},setExtraHeader:function(t,e){this.extraHeaders.push({name:t.toLowerCase(),value:e})},_sendQueriesBatch:function(t,e){return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:t,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var e="",n=0;n<t.requests.length;++n){var r="/1/indexes/"+encodeURIComponent(t.requests[n].indexName)+"?"+t.requests[n].params;e+=n+"="+encodeURIComponent(r)+"&"}return e}()}},callback:e})},_jsonRequest:function(e){var o,i=t(6)("algoliasearch:"+e.url),s=e.cache,a=this,u=0,c=!1;void 0!==e.body&&(o=f(e.body)),i("request start");var h=a.useFallback&&e.fallback,p=h?e.fallback:e,d=function t(l,h){var p;if(a._useCache&&(p=e.url),a._useCache&&o&&(p+="_body_"+h.body),a._useCache&&s&&void 0!==s[p])return i("serving response from cache"),a._promise.resolve(JSON.parse(f(s[p])));if(u>=a.hosts[e.hostType].length||a.useFallback&&!c)return e.fallback&&a._request.fallback&&!c?(i("switching to fallback"),u=0,h.method=e.fallback.method,h.url=e.fallback.url,h.jsonBody=e.fallback.body,h.jsonBody&&(h.body=f(h.jsonBody)),h.timeout=a.requestTimeout*(u+1),a.hostIndex[e.hostType]=0,c=!0,t(a._request.fallback,h)):(i("could not get any response"),a._promise.reject(new r.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+a.applicationID)));var d=a.hosts[e.hostType][a.hostIndex[e.hostType]]+h.url,m={body:o,jsonBody:e.body,method:h.method,headers:a._computeRequestHeaders(),timeout:h.timeout,debug:i};return i("method: %s, url: %s, headers: %j, timeout: %d",m.method,d,m.headers,m.timeout),l===a._request.fallback&&i("using fallback"),l.call(a,d,m).then((function(t){var e=t&&t.body&&t.body.message&&t.body.status||t.statusCode||t&&t.body&&200;i("received response: statusCode: %s, computed statusCode: %d, headers: %j",t.statusCode,e,t.headers),n.env.DEBUG&&-1!==n.env.DEBUG.indexOf("debugBody")&&i("body: %j",t.body);var o=200===e||201===e,c=!o&&4!==Math.floor(e/100)&&1!==Math.floor(e/100);if(a._useCache&&o&&s&&(s[p]=t.body),o)return t.body;if(c)return u+=1,y();var l=new r.AlgoliaSearchError(t.body&&t.body.message);return a._promise.reject(l)}),(function(n){return i("error: %s, stack: %s",n.message,n.stack),n instanceof r.AlgoliaSearchError||(n=new r.Unknown(n&&n.message,n)),u+=1,n instanceof r.Unknown||n instanceof r.UnparsableJSON||!l.fallback&&n instanceof r.Network||u>=a.hosts[e.hostType].length&&(c||!e.fallback||!a._request.fallback)?a._promise.reject(n):(a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,n instanceof r.RequestTimeout?y():(a._request.fallback&&!a.useFallback&&(a.useFallback=!0),t(l,h)))}));function y(){return a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,h.timeout=a.requestTimeout*(u+1),t(l,h)}}(h?a._request.fallback:a._request,{url:p.url,method:p.method,body:o,jsonBody:e.body,timeout:a.requestTimeout*(u+1)});if(!e.callback)return d;d.then((function(t){l((function(){e.callback(null,t)}),a._setTimeout||setTimeout)}),(function(t){l((function(){e.callback(t)}),a._setTimeout||setTimeout)}))},_getSearchParams:function(t,e){if(this._isUndefined(t)||null===t)return e;for(var n in t)null!==n&&void 0!==t[n]&&t.hasOwnProperty(n)&&(e+=""===e?"":"&",e+=n+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(t[n])?f(t[n]):t[n]));return e},_isUndefined:function(t){return void 0===t},_computeRequestHeaders:function(){var e=t(11),n={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-algolia-agent":this._ua};return this.userToken&&(n["x-algolia-usertoken"]=this.userToken),this.securityTags&&(n["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&e(this.extraHeaders,(function(t){n[t.name]=t.value})),n}},o.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(t,e,n){var r=this;return 1!==arguments.length&&"function"!=typeof e||(n=e,e=void 0),this.as._jsonRequest({method:void 0!==e?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(r.indexName)+(void 0!==e?"/"+encodeURIComponent(e):""),body:t,hostType:"write",callback:n})},addObjects:function(t,e){for(var n={requests:[]},r=0;r<t.length;++r){var o={action:"addObject",body:t[r]};n.requests.push(o)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:n,hostType:"write",callback:e})},getObject:function(t,e,n){var r=this;1!==arguments.length&&"function"!=typeof e||(n=e,e=void 0);var o="";if(void 0!==e){o="?attributes=";for(var i=0;i<e.length;++i)0!==i&&(o+=","),o+=e[i]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(t)+o,hostType:"read",callback:n})},getObjects:function(t,e,n){var r=this;1!==arguments.length&&"function"!=typeof e||(n=e,e=void 0);var o={requests:i(t,(function(t){var n={indexName:r.indexName,objectID:t};return e&&(n.attributesToRetrieve=e.join(",")),n}))};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:o,callback:n})},partialUpdateObject:function(t,e){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(t.objectID)+"/partial",body:t,hostType:"write",callback:e})},partialUpdateObjects:function(t,e){for(var n={requests:[]},r=0;r<t.length;++r){var o={action:"partialUpdateObject",objectID:t[r].objectID,body:t[r]};n.requests.push(o)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:n,hostType:"write",callback:e})},saveObject:function(t,e){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(t.objectID),body:t,hostType:"write",callback:e})},saveObjects:function(t,e){for(var n={requests:[]},r=0;r<t.length;++r){var o={action:"updateObject",objectID:t[r].objectID,body:t[r]};n.requests.push(o)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:n,hostType:"write",callback:e})},deleteObject:function(t,e){if("function"==typeof t||"string"!=typeof t&&"number"!=typeof t){var n=new r.AlgoliaSearchError("Cannot delete an object without an objectID");return"function"==typeof(e=t)?e(n):this.as._promise.reject(n)}return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(t),hostType:"write",callback:e})},deleteObjects:function(t,e){var n={requests:i(t,(function(t){return{action:"deleteObject",objectID:t,body:{objectID:t}}}))};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:n,hostType:"write",callback:e})},deleteByQuery:function(t,e,n){var r=this,o=r.as;1!==arguments.length&&"function"!=typeof e||(n=e,e={}),e.attributesToRetrieve="objectID",e.hitsPerPage=1e3,this.clearCache();var s=this.search(t,e).then(a);function a(t){if(0===t.nbHits)return t;var e=i(t.hits,(function(t){return t.objectID}));return r.deleteObjects(e).then(u).then(c)}function u(t){return r.waitTask(t.taskID)}function c(){return r.deleteByQuery(t,e)}if(!n)return s;function h(){l((function(){n(null)}),o._setTimeout||setTimeout)}function f(t){l((function(){n(t)}),o._setTimeout||setTimeout)}s.then(h,f)},search:function(t,e,n){if("function"==typeof t&&"object"===c(e)||"object"===c(n))throw new r.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof t?(n=t,t=""):1!==arguments.length&&"function"!=typeof e||(n=e,e=void 0),"object"===c(t)&&null!==t?(e=t,t=void 0):null==t&&(t="");var o="";return void 0!==t&&(o+="query="+encodeURIComponent(t)),void 0!==e&&(o=this.as._getSearchParams(e,o)),this._search(o,n)},browse:function(e,n,r){var o,i,s=t(57),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(o=0,r=arguments[0],e=void 0):"number"==typeof arguments[0]?(o=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],i=void 0),e=void 0,n=void 0):"object"===c(arguments[0])?("function"==typeof arguments[1]&&(r=arguments[1]),n=arguments[0],e=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],n=void 0),n=s({},n||{},{page:o,hitsPerPage:i,query:e});var u=this.as._getSearchParams(n,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+u,hostType:"read",callback:r})},browseFrom:function(t,e){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(t),hostType:"read",callback:e})},browseAll:function(e,n){"object"===c(e)&&(n=e,e=void 0);var r=t(57),o=new(t(61)),i=this.as,s=this,a=i._getSearchParams(r({},n||{},{query:e}),"");function u(t){var e;o._stopped||(e=void 0!==t?"cursor="+encodeURIComponent(t):a,i._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(s.indexName)+"/browse?"+e,hostType:"read",callback:l}))}function l(t,e){o._stopped||(t?o._error(t):(o._result(e),void 0!==e.cursor?u(e.cursor):o._end()))}return u(),o},ttAdapter:function(t){var e=this;return function(n,r,o){var i;i="function"==typeof o?o:r,e.search(n,t,(function(t,e){i(t||e.hits)}))}},waitTask:function(t,e){var n=0,r=this,o=r.as,i=function e(){return o._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/task/"+t}).then((function(t){var r=100*++n*n;return r>5e3&&(r=5e3),"published"!==t.status?o._promise.delay(r).then(e):t}))}();if(!e)return i;i.then((function(t){l((function(){e(null,t)}),o._setTimeout||setTimeout)}),(function(t){l((function(){e(t)}),o._setTimeout||setTimeout)}))},clearIndex:function(t){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/clear",hostType:"write",callback:t})},getSettings:function(t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",hostType:"read",callback:t})},setSettings:function(t,e){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",hostType:"write",body:t,callback:e})},listUserKeys:function(t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",hostType:"read",callback:t})},getUserKeyACL:function(t,e){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,hostType:"read",callback:e})},deleteUserKey:function(t,e){return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,hostType:"write",callback:e})},addUserKey:function(t,e,n){1!==arguments.length&&"function"!=typeof e||(n=e,e=null);var r={acl:t};return e&&(r.validity=e.validity,r.maxQueriesPerIPPerHour=e.maxQueriesPerIPPerHour,r.maxHitsPerQuery=e.maxHitsPerQuery,r.description=e.description,e.queryParameters&&(r.queryParameters=this.as._getSearchParams(e.queryParameters,"")),r.referers=e.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:r,hostType:"write",callback:n})},addUserKeyWithValidity:h((function(t,e,n){return this.addUserKey(t,e,n)}),u("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(t,e,n,r){2!==arguments.length&&"function"!=typeof n||(r=n,n=null);var o={acl:e};return n&&(o.validity=n.validity,o.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,o.maxHitsPerQuery=n.maxHitsPerQuery,o.description=n.description,n.queryParameters&&(o.queryParameters=this.as._getSearchParams(n.queryParameters,"")),o.referers=n.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:o,hostType:"write",callback:r})},_search:function(t,e){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:t},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:t}},callback:e})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,t(2))},{11:11,2:2,44:44,47:47,57:57,6:6,61:61,66:66}],61:[function(t,e,n){"use strict";function r(){}e.exports=r,t(10)(r,t(1).EventEmitter),r.prototype.stop=function(){this._stopped=!0,this._clean()},r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(t){this.emit("error",t),this._clean()},r.prototype._result=function(t){this.emit("result",t)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{1:1,10:10}],62:[function(t,e,n){"use strict";e.exports=c;var r=t(10),o=window.Promise||t(9).Promise,i=t(60),s=t(66),a=t(64),u=t(65);function c(e,n,r){var o=t(45),i=t(63);return void 0===(r=o(r||{})).protocol&&(r.protocol=i()),r._ua=r._ua||c.ua,new p(e,n,r)}c.version=t(67),c.ua="Algolia for vanilla JavaScript "+c.version,window.__algolia={debug:t(6),algoliasearch:c},window;var l="XDomainRequest"in window,h="withCredentials"in new XMLHttpRequest,f="timeout"in new XMLHttpRequest;function p(){i.apply(this,arguments)}r(p,i),p.prototype._request=function(t,e){return new o((function(n,r){if(h||l){t=a(t,e.headers);var o,i,u=e.body,c=h?new XMLHttpRequest:new XDomainRequest;c instanceof XMLHttpRequest?c.open(e.method,t,!0):c.open(e.method,t),h&&(u&&("POST"===e.method?c.setRequestHeader("content-type","application/x-www-form-urlencoded"):c.setRequestHeader("content-type","application/json")),c.setRequestHeader("accept","application/json")),c.onprogress=function(){},c.onload=function(){if(!i){var t;f||clearTimeout(o);try{t={body:JSON.parse(c.responseText),statusCode:c.status,headers:c.getAllResponseHeaders&&c.getAllResponseHeaders()||{}}}catch(e){t=new s.UnparsableJSON({more:c.responseText})}t instanceof s.UnparsableJSON?r(t):n(t)}},c.onerror=function(t){i||(f||clearTimeout(o),r(new s.Network({more:t})))},f?(c.timeout=e.timeout,c.ontimeout=p):o=setTimeout(p,e.timeout),c.send(u)}else r(new s.Network("CORS not supported"));function p(){f||(i=!0,c.abort()),r(new s.RequestTimeout)}}))},p.prototype._request.fallback=function(t,e){return t=a(t,e.headers),new o((function(n,r){u(t,e,(function(t,e){t?r(t):n(e)}))}))},p.prototype._promise={reject:function(t){return o.reject(t)},resolve:function(t){return o.resolve(t)},delay:function(t){return new o((function(e){setTimeout(e,t)}))}}},{10:10,45:45,6:6,60:60,63:63,64:64,65:65,66:66,67:67,9:9}],63:[function(t,e,n){"use strict";e.exports=function(){var t=window.document.location.protocol;return"http:"!==t&&"https:"!==t&&(t="http:"),t}},{}],64:[function(t,e,n){"use strict";e.exports=function(t,e){return/\?/.test(t)?t+="&":t+="?",t+r.encode(e)};var r=t(5)},{5:5}],65:[function(t,e,n){"use strict";e.exports=function(t,e,n){if("GET"===e.method){e.debug("JSONP: start");var i=!1,s=!1;o+=1;var a=document.getElementsByTagName("head")[0],u=document.createElement("script"),c="algoliaJSONP_"+o,l=!1;window[c]=function(t){try{delete window[c]}catch(t){window[c]=void 0}s||(i=!0,p(),n(null,{body:t}))},t+="&callback="+c,e.jsonBody&&e.jsonBody.params&&(t+="&"+e.jsonBody.params);var h=setTimeout((function(){e.debug("JSONP: Script timeout"),s=!0,p(),n(new r.RequestTimeout)}),e.timeout);u.onreadystatechange=function(){"loaded"!==this.readyState&&"complete"!==this.readyState||f()},u.onload=f,u.onerror=function(){e.debug("JSONP: Script error"),l||s||(p(),n(new r.JSONPScriptError))},u.async=!0,u.defer=!0,u.src=t,a.appendChild(u)}else n(new Error("Method "+e.method+" "+t+" is not supported by JSONP."));function f(){e.debug("JSONP: success"),l||s||(l=!0,i||(e.debug("JSONP: Fail. Script loaded but did not call the callback"),p(),n(new r.JSONPScriptFail)))}function p(){clearTimeout(h),u.onload=null,u.onreadystatechange=null,u.onerror=null,a.removeChild(u);try{delete window[c],delete window[c+"_loaded"]}catch(t){window[c]=null,window[c+"_loaded"]=null}}};var r=t(66),o=0},{66:66}],66:[function(t,e,n){"use strict";var r=t(10);function o(e,n){var r=t(11),o=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):o.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name=this.constructor.name,this.message=e||"Unknown error",n&&r(n,(function(t,e){o[e]=t}))}function i(t,e){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(e),o.apply(this,n),this.name="AlgoliaSearch"+t+"Error"}return r(n,o),n}r(o,Error),e.exports={AlgoliaSearchError:o,UnparsableJSON:i("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:i("RequestTimeout","Request timedout before getting a response"),Network:i("Network","Network issue, see err.more for details"),JSONPScriptFail:i("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:i("Unknown","Unknown error occured")}},{10:10,11:11}],67:[function(t,e,n){e.exports="3.7.7"},{}]},{},[62])(62)},"object"===c(e)&&void 0!==t?t.exports=u():(i=[],void 0===(s="function"==typeof(o=u)?o.apply(e,i):o)||(t.exports=s))}).call(this,n(0),n(1).setImmediate)},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,s,a,u=1,c={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){i.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(o=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var o={callback:t,args:e};return c[u]=o,r(u),u++},f.clearImmediate=p}function p(t){delete c[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=c[t];if(e){l=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(0),n(9))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){function e(t,e,n){var o;return e&&"object"==r(e)&&(void 0!==e[t]?o=e[t]:n&&e.get&&"function"==typeof e.get&&(o=e.get(t))),o}function n(t){return String(null==t?"":t)}t.Template=function(t,e,n,r){t=t||{},this.r=t.code||this.r,this.c=n,this.options=r||{},this.text=e||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(){return""},v:function(t){return t=n(t),c.test(t)?t.replace(o,"&amp;").replace(i,"&lt;").replace(s,"&gt;").replace(a,"&#39;").replace(u,"&quot;"):t},t:n,render:function(t,e,n){return this.ri([t],e||{},n)},ri:function(t,e,n){return this.r(t,e,n)},ep:function(t,e){var n=this.partials[t],r=e[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[t].base=r,n.subs){for(key in e.stackText||(e.stackText={}),n.subs)e.stackText[key]||(e.stackText[key]=void 0!==this.activeSub&&e.stackText[this.activeSub]?e.stackText[this.activeSub]:this.text);r=function(t,e,n,r,o,i){function s(){}function a(){}s.prototype=t,a.prototype=t.subs;var u,c=new s;for(u in c.subs=new a,c.subsText={},c.buf="",r=r||{},c.stackSubs=r,c.subsText=i,e)r[u]||(r[u]=e[u]);for(u in r)c.subs[u]=r[u];for(u in o=o||{},c.stackPartials=o,n)o[u]||(o[u]=n[u]);for(u in o)c.partials[u]=o[u];return c}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,e.stackText)}return this.partials[t].instance=r,r},rp:function(t,e,n,r){var o=this.ep(t,n);return o?o.ri(e,n,r):""},rs:function(t,e,n){var r=t[t.length-1];if(l(r))for(var o=0;o<r.length;o++)t.push(r[o]),n(t,e,this),t.pop();else n(t,e,this)},s:function(t,e,n,o,i,s,a){var u;return(!l(t)||0!==t.length)&&("function"==typeof t&&(t=this.ms(t,e,n,o,i,s,a)),u=!!t,!o&&u&&e&&e.push("object"==r(t)?t:e[e.length-1]),u)},d:function(t,n,r,o){var i,s=t.split("."),a=this.f(s[0],n,r,o),u=this.options.modelGet,c=null;if("."===t&&l(n[n.length-2]))a=n[n.length-1];else for(var h=1;h<s.length;h++)void 0!==(i=e(s[h],a,u))?(c=a,a=i):a="";return!(o&&!a)&&(o||"function"!=typeof a||(n.push(c),a=this.mv(a,n,r),n.pop()),a)},f:function(t,n,r,o){for(var i=!1,s=!1,a=this.options.modelGet,u=n.length-1;u>=0;u--)if(void 0!==(i=e(t,n[u],a))){s=!0;break}return s?(o||"function"!=typeof i||(i=this.mv(i,n,r)),i):!o&&""},ls:function(t,e,r,o,i){var s=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(n(t.call(e,o)),e,r)),this.options.delimiters=s,!1},ct:function(t,e,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(e,n)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,e,n,r,o,i,s){var a,u=e[e.length-1],c=t.call(u);return"function"==typeof c?!!r||(a=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,n,a.substring(o,i),s)):c},mv:function(t,e,r){var o=e[e.length-1],i=t.call(o);return"function"==typeof i?this.ct(n(i.call(o)),o,r):i},sub:function(t,e,n,r){var o=this.subs[t];o&&(this.activeSub=t,o(e,n,this,r),this.activeSub=!1)}};var o=/&/g,i=/</g,s=/>/g,a=/\'/g,u=/\"/g,c=/[&<>\"\']/,l=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}(e),function(t){function e(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function n(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function r(t,e,n){if(e.charAt(n)!=t.charAt(0))return!1;for(var r=1,o=t.length;o>r;r++)if(e.charAt(n+r)!=t.charAt(r))return!1;return!0}function o(e,n,r,a){var u,c=[],l=null,h=null;for(u=r[r.length-1];e.length>0;){if(h=e.shift(),u&&"<"==u.tag&&!(h.tag in w))throw new Error("Illegal content in < super tag.");if(t.tags[h.tag]<=t.tags.$||i(h,a))r.push(h),h.nodes=o(e,h.tag,r,a);else{if("/"==h.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+h.n);if(l=r.pop(),h.n!=l.n&&!s(h.n,l.n,a))throw new Error("Nesting error: "+l.n+" vs. "+h.n);return l.end=h.i,c}"\n"==h.tag&&(h.last=0==e.length||"\n"==e[0].tag)}c.push(h)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return c}function i(t,e){for(var n=0,r=e.length;r>n;n++)if(e[n].o==t.n)return t.tag="#",!0}function s(t,e,n){for(var r=0,o=n.length;o>r;r++)if(n[r].c==t&&n[r].o==e)return!0}function a(t){var e=[];for(var n in t.partials)e.push('"'+u(n)+'":{name:"'+u(t.partials[n].name)+'", '+a(t.partials[n])+"}");return"partials: {"+e.join(",")+"}, subs: "+function(t){var e=[];for(var n in t)e.push('"'+u(n)+'": function(c,p,t,i) {'+t[n]+"}");return"{ "+e.join(",")+" }"}(t.subs)}function u(t){return t.replace(g,"\\\\").replace(d,'\\"').replace(m,"\\n").replace(y,"\\r").replace(v,"\\u2028").replace(b,"\\u2029")}function c(t){return~t.indexOf(".")?"d":"f"}function l(t,e){var n="<"+(e.prefix||"")+t.n+_++;return e.partials[n]={name:t.n,partials:{}},e.code+='t.b(t.rp("'+u(n)+'",c,p,"'+(t.indent||"")+'"));',n}function h(t,e){e.code+="t.b(t.t(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'}function f(t){return"t.b("+t+");"}var p=/\S/,d=/\"/g,m=/\n/g,y=/\r/g,g=/\\/g,v=/\u2028/,b=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(o,i){function s(){m.length>0&&(y.push({tag:"_t",text:new String(m)}),m="")}function a(){for(var e=!0,n=b;n<y.length;n++)if(!(e=t.tags[y[n].tag]<t.tags._v||"_t"==y[n].tag&&null===y[n].text.match(p)))return!1;return e}function u(t,e){if(s(),t&&a())for(var n,r=b;r<y.length;r++)y[r].text&&((n=y[r+1])&&">"==n.tag&&(n.indent=y[r].text.toString()),y.splice(r,1));else e||y.push({tag:"\n"});g=!1,b=y.length}function c(t,e){var r="="+_,o=t.indexOf(r,e),i=n(t.substring(t.indexOf("=",e)+1,o)).split(" ");return w=i[0],_=i[i.length-1],o+r.length-1}var l=o.length,h=0,f=null,d=null,m="",y=[],g=!1,v=0,b=0,w="{{",_="}}";for(i&&(i=i.split(" "),w=i[0],_=i[1]),v=0;l>v;v++)0==h?r(w,o,v)?(--v,s(),h=1):"\n"==o.charAt(v)?u(g):m+=o.charAt(v):1==h?(v+=w.length-1,"="==(f=(d=t.tags[o.charAt(v+1)])?o.charAt(v+1):"_v")?(v=c(o,v),h=0):(d&&v++,h=2),g=v):r(_,o,v)?(y.push({tag:f,n:n(m),otag:w,ctag:_,i:"/"==f?g-w.length:v+_.length}),m="",v+=_.length-1,h=0,"{"==f&&("}}"==_?v++:e(y[y.length-1]))):m+=o.charAt(v);return u(g,!0),y};var w={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(e){return"{code: function (c,p,i) { "+t.wrapMain(e.code)+" },"+a(e)+"}"};var _=0;t.generate=function(e,n,r){_=0;var o={code:"",subs:{},partials:{}};return t.walk(e,o),r.asString?this.stringify(o,n,r):this.makeTemplate(o,n,r)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,e,n){var r=this.makePartials(t);return r.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(r,e,this,n)},t.makePartials=function(t){var e,n={subs:{},partials:t.partials,name:t.name};for(e in n.partials)n.partials[e]=this.makePartials(n.partials[e]);for(e in t.subs)n.subs[e]=new Function("c","p","t","i",t.subs[e]);return n},t.codegen={"#":function(e,n){n.code+="if(t.s(t."+c(e.n)+'("'+u(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(e.nodes,n),n.code+="});c.pop();}"},"^":function(e,n){n.code+="if(!t.s(t."+c(e.n)+'("'+u(e.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(e.nodes,n),n.code+="};"},">":l,"<":function(e,n){var r={partials:{},code:"",subs:{},inPartial:!0};t.walk(e.nodes,r);var o=n.partials[l(e,n)];o.subs=r.subs,o.partials=r.partials},$:function(e,n){var r={subs:{},code:"",partials:n.partials,prefix:e.n};t.walk(e.nodes,r),n.subs[e.n]=r.code,n.inPartial||(n.code+='t.sub("'+u(e.n)+'",c,p,i);')},"\n":function(t,e){e.code+=f('"\\n"'+(t.last?"":" + i"))},_v:function(t,e){e.code+="t.b(t.v(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'},_t:function(t,e){e.code+=f('"'+u(t.text)+'"')},"{":h,"&":h},t.walk=function(e,n){for(var r,o=0,i=e.length;i>o;o++)(r=t.codegen[e[o].tag])&&r(e[o],n);return n},t.parse=function(t,e,n){return o(t,0,[],(n=n||{}).sectionTags||[])},t.cache={},t.cacheKey=function(t,e){return[t,!!e.asString,!!e.disableLambda,e.delimiters,!!e.modelGet].join("||")},t.compile=function(e,n){n=n||{};var r=t.cacheKey(e,n),o=this.cache[r];if(o){var i=o.partials;for(var s in i)delete i[s].instance;return o}return o=this.generate(this.parse(this.scan(e,n.delimiters),e,n),e,n),this.cache[r]=o}}(e)},function(t,e,n){(function(t){!function(e){var n=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},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:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(t){return void 0===t},toStr:function(t){return n.isUndefined(t)||null===t?"":t+""},bind:e.proxy,each:function(t,n){e.each(t,(function(t,e){return n(e,t)}))},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,(function(e,o){if(!(r=n.call(null,o,e,t)))return!1})),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,(function(e,o){if(r=n.call(null,o,e,t))return!1})),!!r):r},mixin:e.extend,getUniqueId:(t=0,function(){return t++}),templatify:function(t){return e.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var r,o;return function(){var i,s,a=this,u=arguments;return i=function(){r=null,n||(o=t.apply(a,u))},s=n&&!r,clearTimeout(r),r=setTimeout(i,e),s&&(o=t.apply(a,u)),o}},throttle:function(t,e){var n,r,o,i,s,a;return s=0,a=function(){s=new Date,o=null,i=t.apply(n,r)},function(){var u=new Date,c=e-(u-s);return n=this,r=arguments,c<=0?(clearTimeout(o),o=null,s=u,i=t.apply(n,r)):o||(o=setTimeout(a,c)),i}},noop:function(){}};var t}(),r=function(){"use strict";return{nonword:e,whitespace:t,obj:{nonword:r(e),whitespace:r(t)}};function t(t){return(t=n.toStr(t))?t.split(/\s+/):[]}function e(t){return(t=n.toStr(t))?t.split(/\W+/):[]}function r(t){return function(){var e=[].slice.call(arguments,0);return function(r){var o=[];return n.each(e,(function(e){o=o.concat(t(n.toStr(r[e])))})),o}}}}(),o=function(){"use strict";function t(t){this.maxSize=n.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function o(t,e){this.key=t,this.val=e,this.prev=this.next=null}return n.mixin(t.prototype,{set:function(t,e){var n,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new o(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new r}}),n.mixin(r.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}(),i=function(){"use strict";var t,e;try{(t=window.localStorage).setItem("~~~","!"),t.removeItem("~~~")}catch(e){t=null}function r(t){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+n.escapeRegExChars(this.prefix))}return e=t&&window.JSON?{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},get:function(e){return this.isExpired(e)&&this.remove(e),s(t.getItem(this._prefix(e)))},set:function(e,r,s){return n.isNumber(s)?t.setItem(this._ttlKey(e),i(o()+s)):t.removeItem(this._ttlKey(e)),t.setItem(this._prefix(e),i(r))},remove:function(e){return t.removeItem(this._ttlKey(e)),t.removeItem(this._prefix(e)),this},clear:function(){var e,n,r=[],o=t.length;for(e=0;e<o;e++)(n=t.key(e)).match(this.keyMatcher)&&r.push(n.replace(this.keyMatcher,""));for(e=r.length;e--;)this.remove(r[e]);return this},isExpired:function(e){var r=s(t.getItem(this._ttlKey(e)));return!!(n.isNumber(r)&&o()>r)}}:{get:n.noop,set:n.noop,remove:n.noop,clear:n.noop,isExpired:n.noop},n.mixin(r.prototype,e),r;function o(){return(new Date).getTime()}function i(t){return JSON.stringify(n.isUndefined(t)?null:t)}function s(t){return JSON.parse(t)}}(),s=function(){"use strict";var t=0,r={},i=6,s=new o(10);function a(t){var r;t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?(r=t.transport,function(t,o){var i=e.Deferred();return r(t,o,(function(t){n.defer((function(){i.resolve(t)}))}),(function(t){n.defer((function(){i.reject(t)}))})),i}):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=!1===t.cache?new o(0):s}return a.setMaxPendingRequests=function(t){i=t},a.resetCache=function(){s.reset()},n.mixin(a.prototype,{_get:function(e,n,o){var s,a=this;function u(t){o&&o(null,t),a._cache.set(e,t)}function c(){o&&o(!0)}function l(){t--,delete r[e],a.onDeckRequestArgs&&(a._get.apply(a,a.onDeckRequestArgs),a.onDeckRequestArgs=null)}this.cancelled||e!==this.lastUrl||((s=r[e])?s.done(u).fail(c):t<i?(t++,r[e]=this._send(e,n).done(u).fail(c).always(l)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(t,e,r){var o;return n.isFunction(e)&&(r=e,e={}),this.cancelled=!1,this.lastUrl=t,(o=this._cache.get(t))?n.defer((function(){r&&r(null,o)})):this._get(t,e,r),!!o},cancel:function(){this.cancelled=!0}}),a}(),a=function(){"use strict";function t(t){(t=t||{}).datumTokenizer&&t.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}return n.mixin(t.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var e=this;t=n.isArray(t)?t:[t],n.each(t,(function(t){var o,i;o=e.datums.push(t)-1,i=r(e.datumTokenizer(t)),n.each(i,(function(t){var n,r,i;for(n=e.trie,r=t.split("");i=r.shift();)(n=n.children[i]||(n.children[i]={ids:[],children:{}})).ids.push(o)}))}))},get:function(t){var e,o,i=this;return e=r(this.queryTokenizer(t)),n.each(e,(function(t){var e,n,r,s;if(o&&0===o.length)return!1;for(e=i.trie,n=t.split("");e&&(r=n.shift());)e=e.children[r];if(!e||0!==n.length)return o=[],!1;s=e.ids.slice(0),o=o?function(t,e){var n=0,r=0,o=[];t=t.sort(a),e=e.sort(a);var i=t.length,s=e.length;for(;n<i&&r<s;)t[n]<e[r]?n++:(t[n]>e[r]||(o.push(t[n]),n++),r++);return o;function a(t,e){return t-e}}(o,s):s})),o?n.map(function(t){for(var e={},n=[],r=0,o=t.length;r<o;r++)e[t[r]]||(e[t[r]]=!0,n.push(t[r]));return n}(o),(function(t){return i.datums[t]})):[]},reset:function(){this.datums=[],this.trie={ids:[],children:{}}},serialize:function(){return{datums:this.datums,trie:this.trie}}}),t;function r(t){return t=n.filter(t,(function(t){return!!t})),t=n.map(t,(function(t){return t.toLowerCase()}))}}(),u=function(){"use strict";return{local:function(t){return t.local||null},prefetch:function(t){var r,o;o={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(r=t.prefetch||null)&&(r=n.isString(r)?{url:r}:r,(r=n.mixin(o,r)).thumbprint="0.10.5"+r.thumbprint,r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",!r.url&&e.error("prefetch requires url to be set"));return r},remote:function(t){var r,o;o={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(r=t.remote||null)&&(r=n.isString(r)?{url:r}:r,(r=n.mixin(o,r)).rateLimiter=/^throttle$/i.test(r.rateLimitBy)?(i=r.rateLimitWait,function(t){return n.throttle(t,i)}):function(t){return function(e){return n.debounce(e,t)}}(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,!r.url&&e.error("remote requires url to be set"));var i;return r}}}();!function(t){"use strict";var o,c;function l(t){var r;t&&(t.local||t.prefetch||t.remote)||e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=(r=t.sorter,n.isFunction(r)?function(t){return t.sort(r)}:function(t){return t}),this.dupDetector=t.dupDetector||h,this.local=u.local(t),this.prefetch=u.prefetch(t),this.remote=u.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new a({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new i(this.cacheKey):null}return o=t.Bloodhound,c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},t.Bloodhound=l,l.noConflict=function(){return t.Bloodhound=o,l},l.tokenizers=r,n.mixin(l.prototype,{_loadPrefetch:function(t){var n,r,o=this;return(n=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(n),r=e.Deferred().resolve()):r=e.ajax(t.url,t.ajax).done((function(e){o.clear(),o.add(t.filter?t.filter(e):e),o._saveToStorage(o.index.serialize(),t.thumbprint,t.ttl)})),r},_getFromRemote:function(t,e){var n,r,o=this;if(this.transport)return t=t||"",r=encodeURIComponent(t),n=this.remote.replace?this.remote.replace(this.remote.url,t):this.remote.url.replace(this.remote.wildcard,r),this.transport.get(n,this.remote.ajax,(function(t,n){e(t?[]:o.remote.filter?o.remote.filter(n):n)}))},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(t,e,n){this.storage&&(this.storage.set(c.data,t,n),this.storage.set(c.protocol,location.protocol,n),this.storage.set(c.thumbprint,e,n))},_readFromStorage:function(t){var e,n={};return this.storage&&(n.data=this.storage.get(c.data),n.protocol=this.storage.get(c.protocol),n.thumbprint=this.storage.get(c.thumbprint)),e=n.thumbprint!==t||n.protocol!==location.protocol,n.data&&!e?n.data:null},_initialize:function(){var t,r=this,o=this.local;return t=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),o&&t.done((function(){r.add(n.isFunction(o)?o():o)})),this.transport=this.remote?new s(this.remote):null,this.initPromise=t.promise()},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){this.index.add(t)},get:function(t,e){var r=this,o=[],i=!1;o=this.index.get(t),(o=this.sorter(o).slice(0,this.limit)).length<this.limit?i=this._getFromRemote(t,(function(t){var i=o.slice(0);n.each(t,(function(t){return!n.some(i,(function(e){return r.dupDetector(t,e)}))&&i.push(t),i.length<r.limit})),e&&e(r.sorter(i))})):this._cancelLastRemoteRequest(),i||(o.length>0||!this.transport)&&e&&e(o)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&s.resetCache()},ttAdapter:function(){return n.bind(this.get,this)}}),l;function h(){return!1}}(this);var c={wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'},l=function(){"use strict";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"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return n.isMsie()&&n.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),n.isMsie()&&n.isMsie()<=7&&n.mixin(t.input,{marginTop:"-1px"}),t}(),h=function(){"use strict";function t(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}return n.mixin(t.prototype,{trigger:function(t){var e=[].slice.call(arguments,1);this.$el.trigger("typeahead:"+t,e)}}),t}(),f=function(){"use strict";var e=/\s+/,n=function(){var e;e=window.setImmediate?function(e){t((function(){e()}))}:function(t){setTimeout((function(){t()}),0)};return e}();return{onSync:function(t,e,n){return r.call(this,"sync",t,e,n)},onAsync:function(t,e,n){return r.call(this,"async",t,e,n)},off:function(t){var n;if(!this._callbacks)return this;t=t.split(e);for(;n=t.shift();)delete this._callbacks[n];return this},trigger:function(t){var r,i,s,a,u;if(!this._callbacks)return this;t=t.split(e),s=[].slice.call(arguments,1);for(;(r=t.shift())&&(i=this._callbacks[r]);)a=o(i.sync,this,[r].concat(s)),u=o(i.async,this,[r].concat(s)),a()&&n(u);return this}};function r(t,n,r,o){var i;if(!r)return this;for(n=n.split(e),r=o?function(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}(r,o):r,this._callbacks=this._callbacks||{};i=n.shift();)this._callbacks[i]=this._callbacks[i]||{sync:[],async:[]},this._callbacks[i][t].push(r);return this}function o(t,e,n){return function(){for(var r,o=0,i=t.length;!r&&o<i;o+=1)r=!1===t[o].apply(e,n);return!r}}}(),p=function(t){"use strict";var e={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(r){var o;(r=n.mixin({},e,r)).node&&r.pattern&&(r.pattern=n.isArray(r.pattern)?r.pattern:[r.pattern],o=function(t,e,r){for(var o,i=[],s=0,a=t.length;s<a;s++)i.push(n.escapeRegExChars(t[s]));return o=r?"\\b("+i.join("|")+")\\b":"("+i.join("|")+")",e?new RegExp(o):new RegExp(o,"i")}(r.pattern,r.caseSensitive,r.wordsOnly),function t(e,n){for(var r,o=0;o<e.childNodes.length;o++)3===(r=e.childNodes[o]).nodeType?o+=n(r)?1:0:t(r,n)}(r.node,(function(e){var n,i,s;(n=o.exec(e.data))&&(s=t.createElement(r.tagName),r.className&&(s.className=r.className),(i=e.splitText(n.index)).splitText(n[0].length),s.appendChild(i.cloneNode(!0)),e.parentNode.replaceChild(s,i));return!!n})))}}(window.document),d=function(){"use strict";var t;function r(r){var o,i,s,a,u,c=this;(r=r||{}).input||e.error("input is missing"),o=n.bind(this._onBlur,this),i=n.bind(this._onFocus,this),s=n.bind(this._onKeydown,this),a=n.bind(this._onInput,this),this.$hint=e(r.hint),this.$input=e(r.input).on("blur.tt",o).on("focus.tt",i).on("keydown.tt",s),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=n.noop),n.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(e){t[e.which||e.keyCode]||n.defer(n.bind(c._onInput,c,e))})):this.$input.on("input.tt",a),this.query=this.$input.val(),this.$overflowHelper=(u=this.$input,e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:u.css("font-family"),fontSize:u.css("font-size"),fontStyle:u.css("font-style"),fontVariant:u.css("font-variant"),fontWeight:u.css("font-weight"),wordSpacing:u.css("word-spacing"),letterSpacing:u.css("letter-spacing"),textIndent:u.css("text-indent"),textRendering:u.css("text-rendering"),textTransform:u.css("text-transform")}).insertAfter(u))}return t={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},r.normalizeQuery=function(t){return(t||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},n.mixin(r.prototype,f,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var n=t[e.which||e.keyCode];this._managePreventDefault(n,e),n&&this._shouldTrigger(n,e)&&this.trigger(n+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(t,e){var n,r,i;switch(t){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!o(e);break;case"up":case"down":n=!o(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!o(e);break;default:n=!0}return n},_checkInputValue:function(){var t,e,n,o,i;t=this.getInputValue(),o=t,i=this.query,n=!!(e=r.normalizeQuery(o)===r.normalizeQuery(i))&&this.query.length!==t.length,this.query=t,e?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(t){this.query=t},getInputValue:function(){return this.$input.val()},setInputValue:function(t,e){this.$input.val(t),e?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&n&&!this.hasOverflow())&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,e,r;return t=this.$input.val().length,e=this.$input[0].selectionStart,n.isNumber(e)?e===t:!document.selection||((r=document.selection.createRange()).moveStart("character",-t),t===r.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),r;function o(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),m=function(){"use strict";function t(t){var r,o,i,s;(t=t||{}).templates=t.templates||{},t.source||e.error("missing source"),t.name&&(r=t.name,!/^[_a-zA-Z0-9-]+$/.test(r))&&e.error("invalid dataset name: "+t.name),this.query=null,this.highlight=!!t.highlight,this.name=t.name||n.getUniqueId(),this.source=t.source,this.displayFn=(o=(o=t.display||t.displayKey)||"value",n.isFunction(o)?o:function(t){return t[o]}),this.templates=(i=t.templates,s=this.displayFn,{empty:i.empty&&n.templatify(i.empty),header:i.header&&n.templatify(i.header),footer:i.footer&&n.templatify(i.footer),suggestion:i.suggestion||function(t){return"<p>"+s(t)+"</p>"}}),this.$el=e(c.dataset.replace("%CLASS%",this.name))}return t.extractDatasetName=function(t){return e(t).data("ttDataset")},t.extractValue=function(t){return e(t).data("ttValue")},t.extractDatum=function(t){return e(t).data("ttDatum")},n.mixin(t.prototype,f,{_render:function(t,r){if(this.$el){var o,i,s,a=this;this.$el.empty(),!(o=r&&r.length)&&this.templates.empty?this.$el.html(a.templates.empty({query:t,isEmpty:!0})).prepend(a.templates.header?u():null).append(a.templates.footer?h():null):o&&this.$el.html((i=e(c.suggestions).css(l.suggestions),s=n.map(r,(function(t){var n;return(n=e(c.suggestion).append(a.templates.suggestion(t)).data("ttDataset",a.name).data("ttValue",a.displayFn(t)).data("ttDatum",t)).children().each((function(){e(this).css(l.suggestionChild)})),n})),i.append.apply(i,s),a.highlight&&p({className:"tt-highlight",node:i[0],pattern:t}),i)).prepend(a.templates.header?u():null).append(a.templates.footer?h():null),this.trigger("rendered")}function u(){return a.templates.header({query:t,isEmpty:!o})}function h(){return a.templates.footer({query:t,isEmpty:!o})}},getRoot:function(){return this.$el},update:function(t){var e=this;this.query=t,this.canceled=!1,this.source(t,(function(n){e.canceled||t!==e.query||e._render(t,n)}))},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),t}(),y=function(){"use strict";function t(t){var o,i,s,a=this;(t=t||{}).menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=n.map(t.datasets,r),o=n.bind(this._onSuggestionClick,this),i=n.bind(this._onSuggestionMouseEnter,this),s=n.bind(this._onSuggestionMouseLeave,this),this.$menu=e(t.menu).on("click.tt",".tt-suggestion",o).on("mouseenter.tt",".tt-suggestion",i).on("mouseleave.tt",".tt-suggestion",s),n.each(this.datasets,(function(t){a.$menu.append(t.getRoot()),t.onSync("rendered",a._onRendered,a)}))}return n.mixin(t.prototype,f,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",e(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor(),this._setCursor(e(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){this.isEmpty=n.every(this.datasets,(function(t){return t.isEmpty()})),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(t,e){t.first().addClass("tt-cursor"),!e&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(t){var e,n,r,o;this.isOpen&&(n=this._getCursor(),e=this._getSuggestions(),this._removeCursor(),-1!==(r=((r=e.index(n)+t)+1)%(e.length+1)-1)?(r<-1&&(r=e.length-1),this._setCursor(o=e.eq(r)),this._ensureVisible(o)):this.trigger("cursorRemoved"))},_ensureVisible:function(t){var e,n,r,o;n=(e=t.position().top)+t.outerHeight(!0),r=this.$menu.scrollTop(),o=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),e<0?this.$menu.scrollTop(r+e):o<n&&this.$menu.scrollTop(r+(n-o))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(t){this.$menu.css("ltr"===t?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(t){var e=null;return t.length&&(e={raw:m.extractDatum(t),value:m.extractValue(t),datasetName:m.extractDatasetName(t)}),e},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(t){n.each(this.datasets,(function(e){e.update(t)}))},empty:function(){n.each(this.datasets,(function(t){t.clear()})),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){this.$menu.off(".tt"),this.$menu=null,n.each(this.datasets,(function(t){t.destroy()}))}}),t;function r(t){return new m(t)}}(),g=function(){"use strict";function t(t){var r,o,i;(t=t||{}).input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!t.autoselect,this.minLength=n.isNumber(t.minLength)?t.minLength:1,this.$node=function(t,n){var r,o,i,s;r=e(t),o=e(c.wrapper).css(l.wrapper),i=e(c.dropdown).css(l.dropdown),(s=r.clone().css(l.hint).css((a=r,{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}))).val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),r.data("ttAttrs",{dir:r.attr("dir"),autocomplete:r.attr("autocomplete"),spellcheck:r.attr("spellcheck"),style:r.attr("style")}),r.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(n?l.input:l.inputWithNoHint);var a;try{!r.attr("dir")&&r.attr("dir","auto")}catch(t){}return r.wrap(o).parent().prepend(n?s:null).append(i)}(t.input,t.withHint),r=this.$node.find(".tt-dropdown-menu"),o=this.$node.find(".tt-input"),i=this.$node.find(".tt-hint"),o.on("blur.tt",(function(t){var e,i,s;e=document.activeElement,i=r.is(e),s=r.has(e).length>0,n.isMsie()&&(i||s)&&(t.preventDefault(),t.stopImmediatePropagation(),n.defer((function(){o.focus()})))})),r.on("mousedown.tt",(function(t){t.preventDefault()})),this.eventBus=t.eventBus||new h({el:o}),this.dropdown=new y({menu:r,datasets:t.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new d({input:o,hint:i}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}return n.mixin(t.prototype,{_onSuggestionClicked:function(t,e){var n;(n=this.dropdown.getDatumForSuggestion(e))&&this._select(n)},_onCursorMoved:function(){var t=this.dropdown.getDatumForCursor();this.input.setInputValue(t.value,!0),this.eventBus.trigger("cursorchanged",t.raw,t.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(t,e){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),e.preventDefault()):this.autoselect&&r&&(this._select(r),e.preventDefault())},_onTabKeyed:function(t,e){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),e.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(t,e){this.input.clearHintIfInvalid(),e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var t;this.dir!==(t=this.input.getLanguageDirection())&&(this.dir=t,this.$node.css("direction",t),this.dropdown.setLanguageDirection(t))},_updateHint:function(){var t,e,r,o,i;(t=this.dropdown.getDatumForTopSuggestion())&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(e=this.input.getInputValue(),r=d.normalizeQuery(e),o=n.escapeRegExChars(r),(i=new RegExp("^(?:"+o+")(.+$)","i").exec(t.value))?this.input.setHint(e+i[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(t){var e,n,r,o;e=this.input.getHint(),n=this.input.getQuery(),r=t||this.input.isCursorAtEnd(),e&&n!==e&&r&&((o=this.dropdown.getDatumForTopSuggestion())&&this.input.setInputValue(o.value),this.eventBus.trigger("autocompleted",o.raw,o.datasetName))},_select:function(t){this.input.setQuery(t.value),this.input.setInputValue(t.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",t.raw,t.datasetName),this.dropdown.close(),n.defer(n.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(t){t=n.toStr(t),this.isActivated?this.input.setInputValue(t):(this.input.setQuery(t),this.input.setInputValue(t,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){var t,e;this.input.destroy(),this.dropdown.destroy(),t=this.$node,e=t.find(".tt-input"),n.each(e.data("ttAttrs"),(function(t,r){n.isUndefined(t)?e.removeAttr(r):e.attr(r,t)})),e.detach().removeData("ttAttrs").removeClass("tt-input").insertAfter(t),t.remove(),this.$node=null}}),t}();!function(){"use strict";var t,r;t=e.fn.typeahead,r={initialize:function(t,r){return r=n.isArray(r)?r:[].slice.call(arguments,1),t=t||{},this.each(o);function o(){var o,i=e(this);n.each(r,(function(e){e.highlight=!!t.highlight})),o=new g({input:i,eventBus:new h({el:i}),withHint:!!n.isUndefined(t.hint)||!!t.hint,minLength:t.minLength,autoselect:t.autoselect,datasets:r}),i.data("ttTypeahead",o)}},open:function(){return this.each((function(){var t,n=e(this);(t=n.data("ttTypeahead"))&&t.open()}))},close:function(){return this.each((function(){var t,n=e(this);(t=n.data("ttTypeahead"))&&t.close()}))},val:function(t){return arguments.length?this.each(n):r(this.first());function n(){var n;(n=e(this).data("ttTypeahead"))&&n.setVal(t)}function r(t){var e,n;return(e=t.data("ttTypeahead"))&&(n=e.getVal()),n}},destroy:function(){return this.each((function(){var t,n=e(this);(t=n.data("ttTypeahead"))&&(t.destroy(),n.removeData("ttTypeahead"))}))}},e.fn.typeahead=function(t){var n;return r[t]&&"initialize"!==t?(n=this.filter((function(){return!!e(this).data("ttTypeahead")})),r[t].apply(n,[].slice.call(arguments,1))):r.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=t,this}}()}(window.jQuery)}).call(this,n(1).setImmediate)}]);