vendor/assets/javascripts/algolia/v3/algoliasearch.angular.min.js in algoliasearch-rails-1.12.0 vs vendor/assets/javascripts/algolia/v3/algoliasearch.angular.min.js in algoliasearch-rails-1.12.1

- old
+ new

@@ -1,37 +1,75 @@ -/*! algoliasearch 3.0.3 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ -(function(l){var m;"undefined"!==typeof window?m=window:"undefined"!==typeof self&&(m=self);m.ALGOLIA_MIGRATION_LAYER=l()})(function(){return function m(n,k,e){function h(a,c){if(!k[a]){if(!n[a]){var d="function"==typeof require&&require;if(!c&&d)return d(a,!0);if(g)return g(a,!0);d=Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d;}d=k[a]={exports:{}};n[a][0].call(d.exports,function(c){var d=n[a][1][c];return h(d?d:c)},d,d.exports,m,n,k,e)}return k[a].exports}for(var g="function"== -typeof require&&require,a=0;a<e.length;a++)h(e[a]);return h}({1:[function(m,n,k){function e(a,b){for(var c in b)a.setAttribute(c,b[c])}function h(a,b){a.onload=function(){this.onerror=this.onload=null;b(null,a)};a.onerror=function(){this.onerror=this.onload=null;b(Error("Failed to load "+this.src),a)}}function g(a,b){a.onreadystatechange=function(){if("complete"==this.readyState||"loaded"==this.readyState)this.onreadystatechange=null,b(null,a)}}n.exports=function(a,b,c){var d=document.head||document.getElementsByTagName("head")[0], -f=document.createElement("script");"function"===typeof b&&(c=b,b={});b=b||{};c=c||function(){};f.type=b.type||"text/javascript";f.charset=b.charset||"utf8";f.async="async"in b?!!b.async:!0;f.src=a;b.attrs&&e(f,b.attrs);b.text&&(f.text=""+b.text);("onload"in f?h:g)(f,c);f.onload||h(f,c);d.appendChild(f)}},{}],2:[function(m,n,k){n.exports=function(e){e=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+e.replace(".","\\.")+"(?:\\.min)?\\.js$");for(var h=document.getElementsByTagName("script"), -g=!1,a=0,b=h.length;a<b;a++)if(h[a].src&&e.test(h[a].src)){g=!0;break}return g}},{}],3:[function(m,n,k){(function(e){function h(h){return function(){var a="AlgoliaSearch: loaded V2 script using "+h;e.console&&e.console.log&&e.console.log(a)}}n.exports=function(g){var a=m(1);g="//cdn.jsdelivr.net/algoliasearch/2/"+g+".min.js";e.console&&(e.console.warn?e.console.warn("-- 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 --"): -e.console.log&&e.console.log("-- 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 --")); -try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true\x3c/script>"),!0===e.ALGOLIA_SUPPORTS_DOCWRITE?(document.write('<script src="'+g+'">\x3c/script>'),h("document.write")()):a(g,h("DOMElement"))}catch(b){a(g,h("DOMElement"))}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{1:1}],4:[function(m,n,k){(function(e){n.exports=function(){e.AlgoliaSearch=function(){throw Error("-- 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 --"); -};e.AlgoliaSearchHelper=function(){throw Error("-- 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 --");};AlgoliaExplainResults=function(){throw Error("-- 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 --"); -}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],5:[function(m,n,k){n=m(2);k=m(3);m=m(4);n("algoliasearch.angular")?k("algoliasearch.angular"):m()},{2:2,3:3,4:4}]},{},[5])(5)}); -(function e$$0(m,n,k){function e(a,b){if(!n[a]){if(!m[a]){var c="function"==typeof require&&require;if(!b&&c)return c(a,!0);if(h)return h(a,!0);c=Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c;}c=n[a]={exports:{}};m[a][0].call(c.exports,function(b){var c=m[a][1][b];return e(c?c:b)},c,c.exports,e$$0,m,n,k)}return n[a].exports}for(var h="function"==typeof require&&require,g=0;g<k.length;g++)e(k[g]);return e})({1:[function(l,m,n){function k(){if(!g){g=!0;for(var a,b=h.length;b;){a= -h;h=[];for(var c=-1;++c<b;)a[c]();b=h.length}g=!1}}function e(){}l=m.exports={};var h=[],g=!1;l.nextTick=function(a){h.push(a);g||setTimeout(k,0)};l.title="browser";l.browser=!0;l.env={};l.argv=[];l.version="";l.versions={};l.on=e;l.addListener=e;l.once=e;l.off=e;l.removeListener=e;l.removeAllListeners=e;l.emit=e;l.binding=function(a){throw Error("process.binding is not supported");};l.cwd=function(){return"/"};l.chdir=function(a){throw Error("process.chdir is not supported");};l.umask=function(){return 0}}, -{}],2:[function(l,m,n){(function(k){function e(a,b,c,d){if(!a)throw Error("Please provide an application ID. Usage: algoliasearch(applicationID, apiKey, opts)");if(!b)throw Error("Please provide an API key. Usage: algoliasearch(applicationID, apiKey, opts)");c=c||{};void 0===c.timeout&&(c.timeout=2E3);void 0===c.protocol&&(c.protocol=document&&document.location.protocol||"http:");void 0===c.hosts&&(c.hosts=[]);void 0===c.tld&&(c.tld="net");/:$/.test(c.protocol)||(c.protocol+=":");0===c.hosts.length&& -(c.hosts=g([a+"-1.algolia."+c.tld,a+"-2.algolia."+c.tld,a+"-3.algolia."+c.tld]),c.hosts.unshift(a+"-dsn.algolia."+c.tld));c.hosts=h(c.hosts,function(a){return c.protocol+"//"+a});this.applicationID=a;this.apiKey=b;this.hosts=c.hosts;this.currentHostIndex=0;this.requestTimeout=c.timeout;this.extraHeaders=[];this.cache={};this._request=d}function h(a,b){for(var c=[],d=0;d<a.length;++d)c.push(b(a[d],d));return c}function g(a){for(var b=a.length,c,d;0!==b;)d=Math.floor(Math.random()*b),--b,c=a[b],a[b]= -a[d],a[d]=c;return a}m.exports=e;e.prototype={deleteIndex:function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(a),callback:b})},moveIndex:function(a,b,c){b={operation:"move",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:b,callback:c})},copyIndex:function(a,b,c){b={operation:"copy",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:b, -callback:c})},getLogs:function(a,b,c){if(0===arguments.length||"function"===typeof a)c=a,a=0,b=10;else if(1===arguments.length||"function"===typeof b)c=b,b=10;return this._jsonRequest({method:"GET",url:"/1/logs?offset="+a+"&length="+b,callback:c})},listIndexes:function(a,b){var c="";void 0===a||"function"===typeof a?b=a:c="?page="+a;return this._jsonRequest({method:"GET",url:"/1/indexes"+c,callback:b})},initIndex:function(a){return new this.Index(this,a)},listUserKeys:function(a){return this._jsonRequest({method:"GET", -url:"/1/keys",callback:a})},getUserKeyACL:function(a,b){return this._jsonRequest({method:"GET",url:"/1/keys/"+a,callback:b})},deleteUserKey:function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+a,callback:b})},addUserKey:function(a,b){return this.addUserKeyWithValidity(a,{validity:0,maxQueriesPerIPPerHour:0,maxHitsPerQuery:0},b)},addUserKeyWithValidity:function(a,b,c){var d={};d.acl=a;d.validity=b.validity;d.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour;d.maxHitsPerQuery=b.maxHitsPerQuery; -return this._jsonRequest({method:"POST",url:"/1/keys",body:d,callback:c})},setSecurityTags:function(a){if("[object Array]"===Object.prototype.toString.call(a)){for(var b=[],c=0;c<a.length;++c)if("[object Array]"===Object.prototype.toString.call(a[c])){for(var d=[],f=0;f<a[c].length;++f)d.push(a[c][f]);b.push("("+d.join(",")+")")}else b.push(a[c]);a=b.join(",")}this.tagFilters=a},setUserToken:function(a){this.userToken=a},startQueriesBatch:function(){this.batch=[]},addQueryInBatch:function(a,b,c){b= -"query="+encodeURIComponent(b);this._isUndefined(c)||null===c||(b=this._getSearchParams(c,b));this.batch.push({indexName:a,params:b})},clearCache:function(){this.cache={}},sendQueriesBatch:function(a){for(var b={requests:[]},c=0;c<this.batch.length;++c)b.requests.push(this.batch[c]);return this._sendQueriesBatch(b,a)},setRequestTimeout:function(a){a&&(this.requestTimeout=parseInt(a,10))},Index:function(a,b){this.indexName=b;this.as=a;this.typeAheadValueOption=this.typeAheadArgs=null;this.cache={}}, -setExtraHeader:function(a,b){this.extraHeaders.push({key:a,value:b})},_sendQueriesBatch:function(a,b){return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:a,fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var b="",d=0;d<a.requests.length;++d)var f="/1/indexes/"+encodeURIComponent(a.requests[d].indexName)+"?"+a.requests[d].params,b=b+(d+"="+encodeURIComponent(f)+"&");return b}()}},callback:b})},_jsonRequest:function(a){function b(h,g){function m(){f.currentHostIndex= -++f.currentHostIndex%f.hosts.length;e+=1;g.timeout=f.requestTimeout*(e+1);return b(h,g)}if(c&&void 0!==c[d])return f._request.resolve(c[d]);if(e>=f.hosts.length){if(!a.fallback||h===f._request.fallback)return f._request.reject(Error("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue."));e=0;g.method=a.fallback.method;g.url=a.fallback.url;g.body=a.fallback.body;g.timeout=f.requestTimeout*(e+1);f.currentHostIndex=0;f.forceFallback=!0;return b(f._request.fallback, -g)}var k=g.url,k=k+((-1===k.indexOf("?")?"?":"&")+"X-Algolia-API-Key="+f.apiKey),k=k+("&X-Algolia-Application-Id="+f.applicationID);f.userToken&&(k+="&X-Algolia-UserToken="+encodeURIComponent(f.userToken));f.tagFilters&&(k+="&X-Algolia-TagFilters="+encodeURIComponent(f.tagFilters));for(var l=0;l<f.extraHeaders.length;++l)k+="&"+f.extraHeaders[l].key+"="+f.extraHeaders[l].value;return h(f.hosts[f.currentHostIndex]+k,{body:g.body,method:g.method,timeout:g.timeout}).then(function(a){if(a instanceof Error)return m(); -var b=a&&a.body&&a.body.message&&a.body.status||a.statusCode||a&&a.body&&200,e=200===b||201===b,b=!e&&4!==Math.floor(b/100)&&1!==Math.floor(b/100);e&&c&&(c[d]=a.body);return e?a.body:b?m():f._request.reject(Error(a.body&&a.body.message||"Unknown error"))},function(){f.forceFallback?(f.currentHostIndex=++f.currentHostIndex%f.hosts.length,e+=1):e=f.hosts.length;return b(h,g)})}var c=a.cache,d=a.url,f=this,e=0;void 0!==a.body&&(d+="_body_"+JSON.stringify(a.body));var h=f.forceFallback&&a.fallback,g= -h?a.fallback:a,h=b(h?f._request.fallback:f._request,{url:g.url,method:g.method,body:g.body,timeout:f.requestTimeout*(e+1)});if(a.callback)h.then(function(b){k.nextTick(function(){a.callback(null,b)})},function(b){k.nextTick(function(){a.callback(b)})});else return h},_getSearchParams:function(a,b){if(this._isUndefined(a)||null===a)return b;for(var c in a)null!==c&&a.hasOwnProperty(c)&&(b+=""===b?"":"&",b+=c+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[c])?JSON.stringify(a[c]): -a[c]));return b},_isUndefined:function(a){return void 0===a}};e.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;return this.as._jsonRequest({method:void 0!==b?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+(void 0!==b?"/"+encodeURIComponent(b):""),body:a,callback:c})},addObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"addObject",body:a[d]}); -return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},getObject:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="";if(void 0!==b)for(var d="?attributes=",f=0;f<b.length;++f)0!==f&&(d+=","),d+=b[f];return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a)+d,callback:c})},partialUpdateObject:function(a,b){return this.as._jsonRequest({method:"POST", -url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID)+"/partial",body:a,callback:b})},partialUpdateObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"partialUpdateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},saveObject:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+ -"/"+encodeURIComponent(a.objectID),body:a,callback:b})},saveObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"updateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},deleteObject:function(a,b){if("function"===typeof a||"string"!==typeof a&&"number"!==typeof a){var c=Error("Cannot delete an object without an objectID");b=a;return"function"=== -typeof b?b(c):this.as._request.reject(c)}return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a),callback:b})},search:function(a,b,c){if(0===arguments.length||"function"===typeof a)c=a,a="";else if(1===arguments.length||"function"===typeof b)c=b,b=void 0;if("object"===typeof a&&null!==a)b=a,a=void 0;else if(void 0===a||null===a)a="";var d="";void 0!==a&&(d+="query="+encodeURIComponent(a));void 0!==b&&(d=this.as._getSearchParams(b, -d));return this._search(d,c)},browse:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="?page="+a;this.as._isUndefined(b)||(d+="&hitsPerPage="+b);return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse"+d,callback:c})},ttAdapter:function(a){var b=this;return function(c,d){b.search(c,a,function(a,b){a?d(a):d(b.hits)})}},waitTask:function(a,b){var c=this,d=this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(c.indexName)+ -"/task/"+a}).then(function(d){if("published"!==d.status)return(new c.as._request.delay(100)).then(function(){return c.waitTask(a,b)});if(b)k.nextTick(function(){b(null,d)});else return d},function(a){if(b)k.nextTick(function(){b(a)});else return a});if(!b)return d},clearIndex:function(a){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/clear",callback:a})},getSettings:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+ -"/settings",callback:a})},setSettings:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",body:a,callback:b})},listUserKeys:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",callback:a})},getUserKeyACL:function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,callback:b})},deleteUserKey:function(a,b){return this.as._jsonRequest({method:"DELETE", -url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,callback:b})},addUserKey:function(a,b){var c={};c.acl=a;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:c,callback:b})},addUserKeyWithValidity:function(a,b,c){var d={};d.acl=a;d.validity=b.validity;d.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour;d.maxHitsPerQuery=b.maxHitsPerQuery;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+ -"/keys",body:d,callback:c})},_search:function(a,b){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:a},fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:a}},callback:b})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,l(1))},{1:1}],3:[function(l,m,n){(function(k){var e=l(5),h=l(4);k.angular.module("algoliasearch",[]).service("algolia",["$http", -"$q","$timeout",function(g,a,b){function c(c,d){return a(function(e,h){var k,l=null;void 0!==d.body&&(l=JSON.stringify(d.body));var m=a(function(a){b(function(){k=!0;a("test");e(Error("Timeout - Could not connect to endpoint "+c))},d.timeout)});g({url:c,method:d.method,data:l,cache:!1,timeout:m}).then(function(a){e({statusCode:a.status,body:a.data})},function(a){k||(0===a.status?h(Error("Network error")):e({body:a.data,statusCode:a.status}))})})}c.fallback=function(b,c){return a(function(a,d){h(b, -c,function(b,c){b?d(b):a(c)})})};c.reject=function(b){return a.reject(b)};c.resolve=function(b){return a.when(b)};c.delay=function(c){return a(function(a){b(a,c)})};var d=e(c);return{Client:function(a,b,c){return d(a,b,c)}}}])}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{4:4,5:5}],4:[function(l,m,n){m.exports=function(e,h,g){function a(){r||m||(r=!0,l||(c(),g(Error("Failed to load JSONP script"))))}function b(){"loaded"!==this.readyState&& -"complete"!==this.readyState||a()}function c(){clearTimeout(t);p.onload=null;p.onreadystatechange=null;p.onerror=null;n.removeChild(p);try{delete window[q],delete window[q+"_loaded"]}catch(a){window[q]=null,window[q+"_loaded"]=null}}function d(){m=!0;c();g(Error("Timeout - Could not connect to endpoint "+e))}function f(){r||m||(c(),g(Error("Failed to load JSONP script")))}if("GET"!==h.method)g(Error("Method "+h.method+" "+e+" is not supported by JSONP."));else{var l=!1,m=!1;k+=1;var n=document.getElementsByTagName("head")[0], -p=document.createElement("script"),q="algoliaJSONP_"+k,r=!1;window[q]=function(a){try{delete window[q]}catch(b){window[q]=void 0}m||(l=!0,c(),g(null,{body:a}))};e+="&callback="+q;h.body&&h.body.params&&(e+="&"+h.body.params);var t=setTimeout(d,h.timeout);p.onreadystatechange=b;p.onload=a;p.onerror=f;p.async=!0;p.defer=!0;p.src=e;n.appendChild(p)}};var k=0},{}],5:[function(l,m,n){m.exports=function(k){function e(e,g,a){return new (l(2))(e,g,a,k)}e.version="3.0.3";return e}},{2:2}]},{},[3]); +/*! algoliasearch 3.3.0 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ +(function(g){var l;"undefined"!==typeof window?l=window:"undefined"!==typeof self&&(l=self);l.ALGOLIA_MIGRATION_LAYER=g()})(function(){return function l(e,h,c){function b(f,p){if(!h[f]){if(!e[f]){var n="function"==typeof require&&require;if(!p&&n)return n(f,!0);if(k)return k(f,!0);n=Error("Cannot find module '"+f+"'");throw n.code="MODULE_NOT_FOUND",n;}n=h[f]={exports:{}};e[f][0].call(n.exports,function(c){var k=e[f][1][c];return b(k?k:c)},n,n.exports,l,e,h,c)}return h[f].exports}for(var k="function"== +typeof require&&require,f=0;f<c.length;f++)b(c[f]);return b}({1:[function(l,e,h){function c(f,b){for(var c in b)f.setAttribute(c,b[c])}function b(f,b){f.onload=function(){this.onerror=this.onload=null;b(null,f)};f.onerror=function(){this.onerror=this.onload=null;b(Error("Failed to load "+this.src),f)}}function k(f,b){f.onreadystatechange=function(){if("complete"==this.readyState||"loaded"==this.readyState)this.onreadystatechange=null,b(null,f)}}e.exports=function(f,e,p){var n=document.head||document.getElementsByTagName("head")[0], +h=document.createElement("script");"function"===typeof e&&(p=e,e={});e=e||{};p=p||function(){};h.type=e.type||"text/javascript";h.charset=e.charset||"utf8";h.async="async"in e?!!e.async:!0;h.src=f;e.attrs&&c(h,e.attrs);e.text&&(h.text=""+e.text);("onload"in h?b:k)(h,p);h.onload||b(h,p);n.appendChild(h)}},{}],2:[function(l,e,h){e.exports=function(c){c=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+c.replace(".","\\.")+"(?:\\.min)?\\.js$");for(var b=document.getElementsByTagName("script"), +k=!1,f=0,e=b.length;f<e;f++)if(b[f].src&&c.test(b[f].src)){k=!0;break}return k}},{}],3:[function(l,e,h){(function(c){function b(b){return function(){var f="AlgoliaSearch: loaded V2 script using "+b;c.console&&c.console.log&&c.console.log(f)}}e.exports=function(k){var f=l(1);k="//cdn.jsdelivr.net/algoliasearch/2/"+k+".min.js";c.console&&(c.console.warn?c.console.warn("-- 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 --"): +c.console.log&&c.console.log("-- 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 --")); +try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true\x3c/script>"),!0===c.ALGOLIA_SUPPORTS_DOCWRITE?(document.write('<script src="'+k+'">\x3c/script>'),b("document.write")()):f(k,b("DOMElement"))}catch(e){f(k,b("DOMElement"))}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{1:1}],4:[function(l,e,h){(function(c){e.exports=function(){c.AlgoliaSearch=function(){throw Error("-- 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 --"); +};c.AlgoliaSearchHelper=function(){throw Error("-- 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 --");};AlgoliaExplainResults=function(){throw Error("-- 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 --"); +}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],5:[function(l,e,h){e=l(2);h=l(3);l=l(4);e("algoliasearch.angular")?h("algoliasearch.angular"):l()},{2:2,3:3,4:4}]},{},[5])(5)}); +(function e$$0(l,e,h){function c(f,k){if(!e[f]){if(!l[f]){var p="function"==typeof require&&require;if(!k&&p)return p(f,!0);if(b)return b(f,!0);p=Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p;}p=e[f]={exports:{}};l[f][0].call(p.exports,function(b){var k=l[f][1][b];return c(k?k:b)},p,p.exports,e$$0,l,e,h)}return e[f].exports}for(var b="function"==typeof require&&require,k=0;k<h.length;k++)c(h[k]);return c})({1:[function(g,l,e){function h(){if(!k){k=!0;for(var f,c=b.length;c;){f= +b;b=[];for(var e=-1;++e<c;)f[e]();c=b.length}k=!1}}function c(){}g=l.exports={};var b=[],k=!1;g.nextTick=function(f){b.push(f);k||setTimeout(h,0)};g.title="browser";g.browser=!0;g.env={};g.argv=[];g.version="";g.versions={};g.on=c;g.addListener=c;g.once=c;g.off=c;g.removeListener=c;g.removeAllListeners=c;g.emit=c;g.binding=function(f){throw Error("process.binding is not supported");};g.cwd=function(){return"/"};g.chdir=function(f){throw Error("process.chdir is not supported");};g.umask=function(){return 0}}, +{}],2:[function(g,l,e){l.exports=function(c,b,k,f){k=k||"=";var e={};if("string"!==typeof c||0===c.length)return e;var p=/\+/g;c=c.split(b||"&");b=1E3;f&&"number"===typeof f.maxKeys&&(b=f.maxKeys);f=c.length;0<b&&f>b&&(f=b);for(b=0;b<f;++b){var n=c[b].replace(p,"%20"),g=n.indexOf(k),l;0<=g?(l=n.substr(0,g),n=n.substr(g+1)):(l=n,n="");l=decodeURIComponent(l);n=decodeURIComponent(n);Object.prototype.hasOwnProperty.call(e,l)?h(e[l])?e[l].push(n):e[l]=[e[l],n]:e[l]=n}return e};var h=Array.isArray||function(c){return"[object Array]"=== +Object.prototype.toString.call(c)}},{}],3:[function(g,l,e){function h(f,b){if(f.map)return f.map(b);for(var c=[],k=0;k<f.length;k++)c.push(b(f[k],k));return c}var c=function(f){switch(typeof f){case "string":return f;case "boolean":return f?"true":"false";case "number":return isFinite(f)?f:"";default:return""}};l.exports=function(f,e,p,g){e=e||"&";p=p||"=";null===f&&(f=void 0);return"object"===typeof f?h(k(f),function(k){var g=encodeURIComponent(c(k))+p;return b(f[k])?h(f[k],function(a){return g+ +encodeURIComponent(c(a))}).join(e):g+encodeURIComponent(c(f[k]))}).join(e):g?encodeURIComponent(c(g))+p+encodeURIComponent(c(f)):""};var b=Array.isArray||function(f){return"[object Array]"===Object.prototype.toString.call(f)},k=Object.keys||function(f){var b=[],c;for(c in f)Object.prototype.hasOwnProperty.call(f,c)&&b.push(c);return b}},{}],4:[function(g,l,e){e.decode=e.parse=g(2);e.encode=e.stringify=g(3)},{2:2,3:3}],5:[function(g,l,e){function h(){var b;try{b=c.debug}catch(f){}return b}e=l.exports= +g(6);e.log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)};e.formatArgs=function(){var b=arguments,f=this.useColors;b[0]=(f?"%c":"")+this.namespace+(f?" %c":" ")+b[0]+(f?"%c ":" ")+"+"+e.humanize(this.diff);if(!f)return b;var f="color: "+this.color,b=[b[0],f,"color: inherit"].concat(Array.prototype.slice.call(b,1)),c=0,g=0;b[0].replace(/%[a-z%]/g,function(b){"%%"!==b&&(c++,"%c"===b&&(g=c))});b.splice(g,0,f);return b};e.save=function(b){try{null== +b?c.removeItem("debug"):c.debug=b}catch(f){}};e.load=h;e.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)};var c;if("undefined"!==typeof chrome&&"undefined"!==typeof chrome.storage)c=chrome.storage.local;else a:{try{c=window.localStorage;break a}catch(b){}c=void 0}e.colors="lightseagreen forestgreen goldenrod dodgerblue darkorchid crimson".split(" "); +e.formatters.j=function(b){return JSON.stringify(b)};e.enable(h())},{6:6}],6:[function(g,l,e){e=l.exports=function(b){function k(){}function f(){var b=+new Date;f.diff=b-(c||b);f.prev=c;c=f.curr=b;null==f.useColors&&(f.useColors=e.useColors());null==f.color&&f.useColors&&(f.color=e.colors[h++%e.colors.length]);var k=Array.prototype.slice.call(arguments);k[0]=e.coerce(k[0]);"string"!==typeof k[0]&&(k=["%o"].concat(k));var g=0;k[0]=k[0].replace(/%([a-z%])/g,function(b,a){if("%%"===b)return b;g++;var d= +e.formatters[a];"function"===typeof d&&(b=d.call(f,k[g]),k.splice(g,1),g--);return b});"function"===typeof e.formatArgs&&(k=e.formatArgs.apply(f,k));(f.log||e.log||console.log.bind(console)).apply(f,k)}k.enabled=!1;f.enabled=!0;var g=e.enabled(b)?f:k;g.namespace=b;return g};e.coerce=function(b){return b instanceof Error?b.stack||b.message:b};e.disable=function(){e.enable("")};e.enable=function(b){e.save(b);for(var c=(b||"").split(/[\s,]+/),f=c.length,g=0;g<f;g++)c[g]&&(b=c[g].replace(/\*/g,".*?"), +"-"===b[0]?e.skips.push(new RegExp("^"+b.substr(1)+"$")):e.names.push(new RegExp("^"+b+"$")))};e.enabled=function(b){var c,f;c=0;for(f=e.skips.length;c<f;c++)if(e.skips[c].test(b))return!1;c=0;for(f=e.names.length;c<f;c++)if(e.names[c].test(b))return!0;return!1};e.humanize=g(7);e.names=[];e.skips=[];e.formatters={};var h=0,c},{7:7}],7:[function(g,l,e){function h(b){if(b=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(b)){var c= +parseFloat(b[1]);switch((b[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return 315576E5*c;case "days":case "day":case "d":return 864E5*c;case "hours":case "hour":case "hrs":case "hr":case "h":return 36E5*c;case "minutes":case "minute":case "mins":case "min":case "m":return 6E4*c;case "seconds":case "second":case "secs":case "sec":case "s":return 1E3*c;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return c}}}function c(b,c,f){if(!(b<c))return b< +1.5*c?Math.floor(b/c)+" "+f:Math.ceil(b/c)+" "+f+"s"}l.exports=function(b,e){e=e||{};return"string"==typeof b?h(b):e.long?c(b,864E5,"day")||c(b,36E5,"hour")||c(b,6E4,"minute")||c(b,1E3,"second")||b+" ms":864E5<=b?Math.round(b/864E5)+"d":36E5<=b?Math.round(b/36E5)+"h":6E4<=b?Math.round(b/6E4)+"m":1E3<=b?Math.round(b/1E3)+"s":b+"ms"}},{}],8:[function(g,l,e){(function(e,c){(function(){function b(a){return"function"===typeof a}function g(){return function(){e.nextTick(n)}}function f(){var a=0,d=new I(n), +m=document.createTextNode("");d.observe(m,{characterData:!0});return function(){m.data=a=++a%2}}function v(){var a=new MessageChannel;a.port1.onmessage=n;return function(){a.port2.postMessage(0)}}function p(){return function(){setTimeout(n,1)}}function n(){for(var a=0;a<z;a+=2)(0,A[a])(A[a+1]),A[a]=void 0,A[a+1]=void 0;z=0}function r(){}function w(a,d,m,b){try{a.call(d,m,b)}catch(c){return c}}function a(a,d,b){B(function(a){var c=!1,f=w(b,d,function(b){c||(c=!0,d!==b?m(a,b):u(a,b))},function(d){c|| +(c=!0,t(a,d))},"Settle: "+(a._label||" unknown promise"));!c&&f&&(c=!0,t(a,f))},a)}function d(a,d){1===d._state?u(a,d._result):2===a._state?t(a,d._result):C(d,void 0,function(d){m(a,d)},function(d){t(a,d)})}function m(m,c){if(m===c)t(m,new TypeError("You cannot resolve a promise with itself"));else if("function"===typeof c||"object"===typeof c&&null!==c)if(c.constructor===m.constructor)d(m,c);else{var f;try{f=c.then}catch(e){D.error=e,f=D}f===D?t(m,D.error):void 0===f?u(m,c):b(f)?a(m,c,f):u(m,c)}else u(m, +c)}function q(a){a._onerror&&a._onerror(a._result);F(a)}function u(a,d){void 0===a._state&&(a._result=d,a._state=1,0!==a._subscribers.length&&B(F,a))}function t(a,d){void 0===a._state&&(a._state=2,a._result=d,B(q,a))}function C(a,d,m,b){var c=a._subscribers,f=c.length;a._onerror=null;c[f]=d;c[f+1]=m;c[f+2]=b;0===f&&a._state&&B(F,a)}function F(a){var d=a._subscribers,m=a._state;if(0!==d.length){for(var b,c,f=a._result,e=0;e<d.length;e+=3)b=d[e],c=d[e+m],b?J(m,b,c,f):c(f);a._subscribers.length=0}}function K(){this.error= +null}function J(a,d,c,f){var e=b(c),q,g,k,h;if(e){try{q=c(f)}catch(l){G.error=l,q=G}q===G?(h=!0,g=q.error,q=null):k=!0;if(d===q){t(d,new TypeError("A promises callback cannot return that same promise."));return}}else q=f,k=!0;void 0===d._state&&(e&&k?m(d,q):h?t(d,g):1===a?u(d,q):2===a&&t(d,q))}function N(a,d){try{d(function(d){m(a,d)},function(d){t(a,d)})}catch(b){t(a,b)}}function x(a,d,m,b){this._instanceConstructor=a;this.promise=new a(r,b);this._abortOnReject=m;this._validateInput(d)?(this._input= +d,this._remaining=this.length=d.length,this._init(),0===this.length?u(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&u(this.promise,this._result))):t(this.promise,this._validationError())}function y(a){this._id=O++;this._result=this._state=void 0;this._subscribers=[];if(r!==a){if(!b(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof y))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); +N(this,a)}}var L=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},z=0,B=function(a,d){A[z]=a;A[z+1]=d;z+=2;2===z&&M()},E="undefined"!==typeof window?window:{},I=E.MutationObserver||E.WebKitMutationObserver,E="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel,A=Array(1E3),M;M="undefined"!==typeof e&&"[object process]"==={}.toString.call(e)?g():I?f():E?v():p();var D=new K,G=new K;x.prototype._validateInput= +function(a){return L(a)};x.prototype._validationError=function(){return Error("Array Methods must be provided an Array")};x.prototype._init=function(){this._result=Array(this.length)};x.prototype._enumerate=function(){for(var a=this.length,d=this.promise,m=this._input,b=0;void 0===d._state&&b<a;b++)this._eachEntry(m[b],b)};x.prototype._eachEntry=function(a,d){var m=this._instanceConstructor;"object"===typeof a&&null!==a?a.constructor===m&&void 0!==a._state?(a._onerror=null,this._settledAt(a._state, +d,a._result)):this._willSettleAt(m.resolve(a),d):(this._remaining--,this._result[d]=this._makeResult(1,d,a))};x.prototype._settledAt=function(a,d,m){var b=this.promise;void 0===b._state&&(this._remaining--,this._abortOnReject&&2===a?t(b,m):this._result[d]=this._makeResult(a,d,m));0===this._remaining&&u(b,this._result)};x.prototype._makeResult=function(a,d,m){return m};x.prototype._willSettleAt=function(a,d){var m=this;C(a,void 0,function(a){m._settledAt(1,d,a)},function(a){m._settledAt(2,d,a)})}; +var O=0;y.all=function(a,d){return(new x(this,a,!0,d)).promise};y.race=function(a,d){function b(a){m(f,a)}function c(a){t(f,a)}var f=new this(r,d);if(!L(a))return t(f,new TypeError("You must pass an array to race.")),f;for(var e=a.length,q=0;void 0===f._state&&q<e;q++)C(this.resolve(a[q]),void 0,b,c);return f};y.resolve=function(a,d){if(a&&"object"===typeof a&&a.constructor===this)return a;var b=new this(r,d);m(b,a);return b};y.reject=function(a,d){var m=new this(r,d);t(m,a);return m};y.prototype= +{constructor:y,then:function(a,d){var m=this._state;if(1===m&&!a||2===m&&!d)return this;var b=new this.constructor(r),c=this._result;if(m){var f=arguments[m-1];B(function(){J(m,b,f,c)})}else C(this,b,a,d);return b},"catch":function(a){return this.then(null,a)}};var H={Promise:y,polyfill:function(){var a;a="undefined"!==typeof c?c:"undefined"!==typeof window&&window.document?window:self;"Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var d; +new a.Promise(function(a){d=a});return b(d)}()||(a.Promise=y)}};"function"===typeof define&&define.amd?define(function(){return H}):"undefined"!==typeof l&&l.exports?l.exports=H:"undefined"!==typeof this&&(this.ES6Promise=H)}).call(this)}).call(this,g(1),"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{1:1}],9:[function(g,l,e){var h=Object.prototype.hasOwnProperty,c=Object.prototype.toString,b=g(10),k=function(b){if(!b||"[object Object]"!== +c.call(b))return!1;var e=h.call(b,"constructor"),g=b.constructor&&b.constructor.prototype&&h.call(b.constructor.prototype,"isPrototypeOf");if(b.constructor&&!e&&!g)return!1;for(var k in b);return void 0===k||h.call(b,k)};l.exports=function v(){var c,e,g,h,a,d=arguments[0],m=1,q=arguments.length,u=!1;if("boolean"===typeof d)u=d,d=arguments[1]||{},m=2;else if("object"!==typeof d&&"function"!==typeof d||null==d)d={};for(;m<q;++m)if(c=arguments[m],null!=c)for(e in c)g=d[e],h=c[e],d!==h&&(u&&h&&(k(h)|| +(a=b(h)))?(a?(a=!1,g=g&&b(g)?g:[]):g=g&&k(g)?g:{},d[e]=v(u,g,h)):void 0!==h&&(d[e]=h));return d}},{10:10}],10:[function(g,l,e){l.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],11:[function(g,l,e){var h=Object.prototype.hasOwnProperty,c=Object.prototype.toString;l.exports=function(b,e,f){if("[object Function]"!==c.call(e))throw new TypeError("iterator must be a function");var g=b.length;if(g===+g)for(var l=0;l<g;l++)e.call(f,b[l],l,b);else for(l in b)h.call(b, +l)&&e.call(f,b[l],l,b)}},{}],12:[function(g,l,e){l.exports="function"===typeof Object.create?function(e,c){e.super_=c;e.prototype=Object.create(c.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,c){e.super_=c;var b=function(){};b.prototype=c.prototype;e.prototype=new b;e.prototype.constructor=e}},{}],13:[function(g,l,e){(function(e){function c(a,d,m){var c=g(9);if(!a)throw Error("algoliasearch: Please provide an application ID. Usage: algoliasearch(applicationID, apiKey, opts)"); +if(!d)throw Error("algoliasearch: Please provide an API key. Usage: algoliasearch(applicationID, apiKey, opts)");this.applicationID=a;this.apiKey=d;a=[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};m=m||{};d=m.protocol||"https:";var f=void 0===m.timeout?2E3:m.timeout;/:$/.test(d)||(d+=":");if("http:"!==m.protocol&&"https:"!==m.protocol)throw Error("algoliasearch: protocol must be `http:` or `https:` (was `"+ +m.protocol+"`)");m.hosts?(this.hosts.read=c([],m.hosts),this.hosts.write=c([],m.hosts)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(a),this.hosts.write=[this.applicationID+".algolia.net"].concat(a));this.hosts.read=b(this.hosts.read,k(d));this.hosts.write=b(this.hosts.write,k(d));this.requestTimeout=f;this.extraHeaders=[];this.cache={};this._ua=m._ua;this._useCache=void 0===m._useCache?!0:m._useCache;this._setTimeout=m._setTimeout;r("init done, %j",this)}function b(a,d){for(var m= +[],b=0;b<a.length;++b)m.push(d(a[b],b));return m}function k(a){return function(d){return a+"//"+d.toLowerCase()}}function f(){throw Error("algoliasearch: Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com");}function v(a,d){var b=a.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+a+"` was replaced by `"+d+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+b}function p(a,d){d(a,0)}function n(a,d){var b= +!1;return function(){b||(console.log(d),b=!0);return a.apply(this,arguments)}}l.exports=c;"development"===e.env.NODE_ENV&&g(5).enable("algoliasearch*");var r=g(5)("algoliasearch"),w=g(11);c.prototype={deleteIndex:function(a,d){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(a),hostType:"write",callback:d})},moveIndex:function(a,d,b){d={operation:"move",destination:d};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:d, +hostType:"write",callback:b})},copyIndex:function(a,d,b){d={operation:"copy",destination:d};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:d,hostType:"write",callback:b})},getLogs:function(a,d,b){if(0===arguments.length||"function"===typeof a)b=a,a=0,d=10;else if(1===arguments.length||"function"===typeof d)b=d,d=10;return this._jsonRequest({method:"GET",url:"/1/logs?offset="+a+"&length="+d,hostType:"read",callback:b})},listIndexes:function(a,d){var b= +"";void 0===a||"function"===typeof a?d=a:b="?page="+a;return this._jsonRequest({method:"GET",url:"/1/indexes"+b,hostType:"read",callback:d})},initIndex:function(a){return new this.Index(this,a)},listUserKeys:function(a){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:a})},getUserKeyACL:function(a,d){return this._jsonRequest({method:"GET",url:"/1/keys/"+a,hostType:"read",callback:d})},deleteUserKey:function(a,d){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+ +a,hostType:"write",callback:d})},addUserKey:function(a,d,b){if(1===arguments.length||"function"===typeof d)b=d,d=null;var c={acl:a};d&&(c.validity=d.validity,c.maxQueriesPerIPPerHour=d.maxQueriesPerIPPerHour,c.maxHitsPerQuery=d.maxHitsPerQuery,c.indexes=d.indexes);return this._jsonRequest({method:"POST",url:"/1/keys",body:c,hostType:"write",callback:b})},addUserKeyWithValidity:n(function(a,d,b){return this.addUserKey(a,d,b)},v("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(a, +d,b,c){if(2===arguments.length||"function"===typeof b)c=b,b=null;var f={acl:d};b&&(f.validity=b.validity,f.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour,f.maxHitsPerQuery=b.maxHitsPerQuery,f.indexes=b.indexes);return this._jsonRequest({method:"PUT",url:"/1/keys/"+a,body:f,hostType:"write",callback:c})},setSecurityTags:function(a){if("[object Array]"===Object.prototype.toString.call(a)){for(var d=[],b=0;b<a.length;++b)if("[object Array]"===Object.prototype.toString.call(a[b])){for(var c=[],f=0;f< +a[b].length;++f)c.push(a[b][f]);d.push("("+c.join(",")+")")}else d.push(a[b]);a=d.join(",")}this.securityTags=a},setUserToken:function(a){this.userToken=a},startQueriesBatch:n(function(){this._batch=[]},v("client.startQueriesBatch()","client.search()")),addQueryInBatch:n(function(a,d,b){this._batch.push({indexName:a,query:d,params:b})},v("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:n(function(a){return this.search(this._batch,a)},v("client.sendQueriesBatch()", +"client.search()")),setRequestTimeout:function(a){a&&(this.requestTimeout=parseInt(a,10))},search:function(a,d){var c=this,f={requests:b(a,function(a){var d="";void 0!==a.query&&(d+="query="+encodeURIComponent(a.query));return{indexName:a.indexName,params:c._getSearchParams(a.params,d)}})};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:f,hostType:"read",callback:d})},destroy:f,enableRateLimitForward:f,disableRateLimitForward:f,useSecuredAPIKey:f,disableSecuredAPIKey:f, +generateSecuredApiKey:f,Index:function(a,d){this.indexName=d;this.as=a;this.typeAheadValueOption=this.typeAheadArgs=null;this.cache={}},setExtraHeader:function(a,d){this.extraHeaders.push({name:a.toLowerCase(),value:d})},_sendQueriesBatch:function(a,d){return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:a,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var d="",b=0;b<a.requests.length;++b)var c="/1/indexes/"+encodeURIComponent(a.requests[b].indexName)+ +"?"+a.requests[b].params,d=d+(b+"="+encodeURIComponent(c)+"&");return d}()}},callback:d})},_jsonRequest:function(a){function d(g,h){function p(){e.hostIndex[a.hostType]=++e.hostIndex[a.hostType]%e.hosts[a.hostType].length;k+=1;h.timeout=e.requestTimeout*(k+1);return d(g,h)}var n;e._useCache&&(n=a.url);e._useCache&&c&&(n+="_body_"+h.body);if(e._useCache&&f&&void 0!==f[n])return b("serving response from cache"),e._promise.resolve(f[n]);if(k>=e.hosts[a.hostType].length){if(!a.fallback||!e._request.fallback|| +l)return e._promise.reject(Error("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue."));k=0;h.method=a.fallback.method;h.url=a.fallback.url;h.jsonBody=a.fallback.body;h.jsonBody&&(h.body=JSON.stringify(a.fallback.body));h.timeout=e.requestTimeout*(k+1);e.hostIndex[a.hostType]=0;l=e.useFallback=!0;return d(e._request.fallback,h)}return g.call(e,e.hosts[a.hostType][e.hostIndex[a.hostType]]+h.url,{body:c,jsonBody:a.body,method:h.method,headers:e._computeRequestHeaders(), +timeout:h.timeout,debug:b}).then(function(a){if(a instanceof Error)return b("error: %s",a.message),p();b("received response: %j",a);var d=a&&a.body&&a.body.message&&a.body.status||a.statusCode||a&&a.body&&200,c=200===d||201===d,d=!c&&4!==Math.floor(d/100)&&1!==Math.floor(d/100);e._useCache&&c&&f&&(f[n]=a.body);return c?a.body:d?p():e._promise.reject(Error(a.body&&a.body.message||"Unknown error"))},function(c){b("error: %s, stack: %s",c.message,c.stack);e.useFallback?(e.hostIndex[a.hostType]=++e.hostIndex[a.hostType]% +e.hosts[a.hostType].length,k+=1):k=e.hosts[a.hostType].length;return d(g,h)})}var b=g(5)("algoliasearch:"+a.url),c,f=a.cache,e=this,k=0,l=!1;void 0!==a.body&&(c=JSON.stringify(a.body));b("request start");var h=e.useFallback&&a.fallback,n=h?a.fallback:a,h=d(h?e._request.fallback:e._request,{url:n.url,method:n.method,body:c,jsonBody:a.body,timeout:e.requestTimeout*(k+1)});if(a.callback)h.then(function(d){p(function(){a.callback(null,d)},e._setTimeout||setTimeout)},function(d){p(function(){a.callback(d)}, +e._setTimeout||setTimeout)});else return h},_getSearchParams:function(a,d){if(this._isUndefined(a)||null===a)return d;for(var b in a)null!==b&&a.hasOwnProperty(b)&&(d+=""===d?"":"&",d+=b+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[b])?JSON.stringify(a[b]):a[b]));return d},_isUndefined:function(a){return void 0===a},_computeRequestHeaders:function(){var a={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-user-agent":this._ua};this.userToken&& +(a["x-algolia-usertoken"]=this.userToken);this.securityTags&&(a["x-algolia-tagfilters"]=this.securityTags);this.extraHeaders&&w(this.extraHeaders,function(d){a[d.name]=d.value});return a}};c.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(a,d,b){if(1===arguments.length||"function"===typeof d)b=d,d=void 0;return this.as._jsonRequest({method:void 0!==d?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+(void 0!==d?"/"+encodeURIComponent(d):""),body:a, +hostType:"write",callback:b})},addObjects:function(a,d){for(var b={requests:[]},c=0;c<a.length;++c)b.requests.push({action:"addObject",body:a[c]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:b,hostType:"write",callback:d})},getObject:function(a,d,b){if(1===arguments.length||"function"===typeof d)b=d,d=void 0;var c="";if(void 0!==d)for(var c="?attributes=",f=0;f<d.length;++f)0!==f&&(c+=","),c+=d[f];return this.as._jsonRequest({method:"GET", +url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a)+c,hostType:"read",callback:b})},getObjects:function(a,d){var c=this,f={requests:b(a,function(a){return{indexName:c.indexName,objectID:a}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:f,callback:d})},partialUpdateObject:function(a,d){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID)+"/partial", +body:a,hostType:"write",callback:d})},partialUpdateObjects:function(a,d){for(var b={requests:[]},c=0;c<a.length;++c)b.requests.push({action:"partialUpdateObject",objectID:a[c].objectID,body:a[c]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:b,hostType:"write",callback:d})},saveObject:function(a,d){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID),body:a, +hostType:"write",callback:d})},saveObjects:function(a,d){for(var b={requests:[]},c=0;c<a.length;++c)b.requests.push({action:"updateObject",objectID:a[c].objectID,body:a[c]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:b,hostType:"write",callback:d})},deleteObject:function(a,d){if("function"===typeof a||"string"!==typeof a&&"number"!==typeof a){var b=Error("Cannot delete an object without an objectID");d=a;return"function"===typeof d? +d(b):this.as._promise.reject(b)}return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a),hostType:"write",callback:d})},deleteObjects:function(a,d){var c={requests:b(a,function(a){return{action:"deleteObject",objectID:a,body:{objectID:a}}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,hostType:"write",callback:d})},deleteByQuery:function(a,d,c){function f(a){return g.waitTask(a.taskID)} +function e(){return g.deleteByQuery(a,d)}var g=this,k=g.as;if(1===arguments.length||"function"===typeof d)c=d,d={};d.attributesToRetrieve="objectID";d.hitsPerPage=1E3;this.clearCache();var h=this.search(a,d).then(function(a){if(0===a.nbHits)return a;a=b(a.hits,function(a){return a.objectID});return g.deleteObjects(a).then(f).then(e)});if(!c)return h;h.then(function(){p(function(){c(null)},k._setTimeout||setTimeout)},function(a){p(function(){c(a)},k._setTimeout||setTimeout)})},search:function(a,d, +b){if("function"===typeof a&&"object"===typeof d||"object"===typeof b)throw Error("algoliasearch: index.search usage is index.search(query, params, cb)");if(0===arguments.length||"function"===typeof a)b=a,a="";else if(1===arguments.length||"function"===typeof d)b=d,d=void 0;if("object"===typeof a&&null!==a)d=a,a=void 0;else if(void 0===a||null===a)a="";var c="";void 0!==a&&(c+="query="+encodeURIComponent(a));void 0!==d&&(c=this.as._getSearchParams(d,c));return this._search(c,b)},browse:function(a, +d,b){if(1===arguments.length||"function"===typeof d)b=d,d=void 0;var c="?page="+a;this.as._isUndefined(d)||(c+="&hitsPerPage="+d);return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse"+c,hostType:"read",callback:b})},ttAdapter:function(a){var b=this;return function(c,f){b.search(c,a,function(a,b){a?f(a):f(b.hits)})}},waitTask:function(a,b){var c=this,f=c.as,e=this.as._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(c.indexName)+ +"/task/"+a}).then(function(b){return"published"!==b.status?c.as._promise.delay(100).then(function(){return c.waitTask(a)}):b});if(!b)return e;e.then(function(a){p(function(){b(null,a)},f._setTimeout||setTimeout)},function(a){p(function(){b(a)},f._setTimeout||setTimeout)})},clearIndex:function(a){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/clear",hostType:"write",callback:a})},getSettings:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+ +encodeURIComponent(this.indexName)+"/settings",hostType:"read",callback:a})},setSettings:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",hostType:"write",body:a,callback:b})},listUserKeys:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",hostType:"read",callback:a})},getUserKeyACL:function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+ +"/keys/"+a,hostType:"read",callback:b})},deleteUserKey:function(a,b){return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,hostType:"write",callback:b})},addUserKey:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=null;var f={acl:a};b&&(f.validity=b.validity,f.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour,f.maxHitsPerQuery=b.maxHitsPerQuery);return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+ +"/keys",body:f,hostType:"write",callback:c})},addUserKeyWithValidity:n(function(a,b,c){return this.addUserKey(a,b,c)},v("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(a,b,c,f){if(2===arguments.length||"function"===typeof c)f=c,c=null;var e={acl:b};c&&(e.validity=c.validity,e.maxQueriesPerIPPerHour=c.maxQueriesPerIPPerHour,e.maxHitsPerQuery=c.maxHitsPerQuery);return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,body:e, +hostType:"write",callback:f})},_search:function(a,b){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:a},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:a}},callback:b})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,g(1))},{1:1,11:11,5:5,9:9}],14:[function(g,l,e){l.exports=function(c,b,e){function f(){b.debug("JSONP: success"); +u||a||(u=!0,w||(b.debug("JSONP: Fail. Script loaded but did not call the callback"),l(),e(Error("Failed to load JSONP script"))))}function g(){"loaded"!==this.readyState&&"complete"!==this.readyState||f()}function l(){clearTimeout(t);m.onload=null;m.onreadystatechange=null;m.onerror=null;d.removeChild(m);try{delete window[q],delete window[q+"_loaded"]}catch(a){window[q]=null,window[q+"_loaded"]=null}}function n(){b.debug("JSONP: Script timeout");a=!0;l();e(Error("Timeout - Could not connect to endpoint "+ +c))}function r(){b.debug("JSONP: Script error");u||a||(l(),e(Error("Failed to load JSONP script")))}if("GET"!==b.method)e(Error("Method "+b.method+" "+c+" is not supported by JSONP."));else{b.debug("JSONP: start");var w=!1,a=!1;h+=1;var d=document.getElementsByTagName("head")[0],m=document.createElement("script"),q="algoliaJSONP_"+h,u=!1;window[q]=function(b){try{delete window[q]}catch(d){window[q]=void 0}a||(w=!0,l(),e(null,{body:b}))};c+="&callback="+q;b.jsonBody&&b.jsonBody.params&&(c+="&"+b.jsonBody.params); +var t=setTimeout(n,b.timeout);m.onreadystatechange=g;m.onload=f;m.onerror=r;m.async=!0;m.defer=!0;m.src=c;d.appendChild(m)}};var h=0},{}],15:[function(g,l,e){(function(e){var c=g(12),b=g(13),k=g(18),f=g(14);window.algoliasearch=g(16);e.angular.module("algoliasearch",[]).service("algolia",["$http","$q","$timeout",function(e,h,l){function r(a,b,c){var f=g(9),e=g(17);c=f(!0,{},c)||{};void 0===c.protocol&&(c.protocol=e());c._ua=r.ua;return new w(a,b,c)}function w(){b.apply(this,arguments)}r.version=g(19); +r.ua="Algolia for AngularJS "+r.version;c(w,b);w.prototype._request=function(a,b){return h(function(c,f){var g,t=b.body;a=k(a,b.headers);var r=h(function(f){l(function(){g=!0;f("test");c(Error("Timeout - Could not connect to endpoint "+a))},b.timeout)});e({url:a,method:b.method,data:t,cache:!1,timeout:r}).then(function(a){c({statusCode:a.status,body:a.data})},function(a){g||(0===a.status?f(Error("Network error")):c({body:a.data,statusCode:a.status}))})})};w.prototype._request.fallback=function(a, +b){a=k(a,b.headers);return h(function(c,e){f(a,b,function(a,b){a?e(a):c(b)})})};w.prototype._promise={reject:function(a){return h.reject(a)},resolve:function(a){return h.when(a)},delay:function(a){return h(function(b){l(b,a)})}};return{Client:function(a,b,c){return r(a,b,c)},ua:r.ua,version:r.version}}])}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{12:12,13:13,14:14,16:16,17:17,18:18,19:19,9:9}],16:[function(g,l,e){(function(e){function c(a, +f,e){var h=g(9),k=g(17);e=h(!0,{},e)||{};void 0===e.protocol&&(e.protocol=k());e._ua=c.ua;return new b(a,f,e)}function b(){v.apply(this,arguments)}l.exports=c;var k=g(12),f=e.Promise||g(8).Promise,v=g(13),p=g(18),n=g(14);c.version=g(19);c.ua="Algolia for vanilla JavaScript "+c.version;var r="XDomainRequest"in window,w="withCredentials"in new XMLHttpRequest,a="timeout"in new XMLHttpRequest;k(b,v);b.prototype._request=function(b,c){return new f(function(e,f){function g(){if(!x){a||clearTimeout(v);var b= +null;try{b=JSON.parse(n.responseText)}catch(c){}e({body:b,statusCode:n.status})}}function h(b){x||(a||clearTimeout(v),f(Error("Could not connect to host, error was:"+b)))}function k(){a||(x=!0,n.abort());e(Error("Timeout - Could not connect to endpoint "+b))}if(w||r){b=p(b,c.headers);var l=c.body,n=w?new XMLHttpRequest:new XDomainRequest,v,x;n instanceof XMLHttpRequest?n.open(c.method,b,!0):n.open(c.method,b);w&&l&&"GET"!==c.method&&n.setRequestHeader("content-type","application/x-www-form-urlencoded"); +n.onprogress=function(){};n.onload=g;n.onerror=h;a?(n.timeout=c.timeout,n.ontimeout=k):v=setTimeout(k,c.timeout);n.send(l)}else f(Error("CORS not supported"))})};b.prototype._request.fallback=function(a,b){a=p(a,b.headers);return new f(function(c,e){n(a,b,function(a,b){a?e(a):c(b)})})};b.prototype._promise={reject:function(a){return f.reject(a)},resolve:function(a){return f.resolve(a)},delay:function(a){return new f(function(b){setTimeout(b,a)})}}}).call(this,"undefined"!==typeof global?global:"undefined"!== +typeof self?self:"undefined"!==typeof window?window:{})},{12:12,13:13,14:14,17:17,18:18,19:19,8:8,9:9}],17:[function(g,l,e){(function(e){l.exports=function(){var c=e.document.location.protocol;"http:"!==c&&"https:"!==c&&(c="http:");return c}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],18:[function(g,l,e){l.exports=function(c,b){c=/\?/.test(c)?c+"&":c+"?";return c+h.encode(b)};var h=g(4)},{4:4}],19:[function(g,l,e){l.exports= +"3.3.0"},{}]},{},[15]);