From c17973ccfb56f4520bc12e053b55a4b51291b7aa Mon Sep 17 00:00:00 2001 From: Raymond Rutjes Date: Tue, 22 Nov 2016 14:12:40 +0100 Subject: [PATCH] Update deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: #428 diff --git a/assets/js/algoliasearch/algoliasearch.jquery.js b/assets/js/algoliasearch/algoliasearch.jquery.js index f44f614..877e5de 100644 --- a/assets/js/algoliasearch/algoliasearch.jquery.js +++ b/assets/js/algoliasearch/algoliasearch.jquery.js @@ -1,4 +1,4 @@ -/*! algoliasearch 3.18.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ +/*! algoliasearch 3.19.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ (function(f){var g;if(typeof window!=='undefined'){g=window}else if(typeof self!=='undefined'){g=self}g.ALGOLIA_MIGRATION_LAYER=f()})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function _short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function _long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} - -},{}],2:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -512,7 +381,8 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],3:[function(require,module,exports){ +},{}],2:[function(require,module,exports){ +(function (process){ /** * This is the web browser implementation of `debug()`. @@ -520,7 +390,7 @@ process.umask = function() { return 0; }; * Expose `debug()` as the module. */ -exports = module.exports = require(4); +exports = module.exports = require(3); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -554,7 +424,8 @@ exports.colors = [ function useColors() { // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) || // is firebug? http://stackoverflow.com/a/398120/376773 (window.console && (console.firebug || (console.exception && console.table))) || // is firefox >= v31? @@ -656,6 +527,12 @@ function load() { try { r = exports.storage.debug; } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if ('env' in (typeof process === 'undefined' ? {} : process)) { + r = process.env.DEBUG; + } + return r; } @@ -682,7 +559,8 @@ function localstorage(){ } catch (e) {} } -},{"4":4}],4:[function(require,module,exports){ +}).call(this,require(1)) +},{"1":1,"3":3}],3:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -691,12 +569,12 @@ function localstorage(){ * Expose `debug()` as the module. */ -exports = module.exports = debug; +exports = module.exports = debug.debug = debug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = require(1); +exports.humanize = require(4); /** * The currently active debug mode names, and names to skip. @@ -768,7 +646,10 @@ function debug(namespace) { if (null == self.useColors) self.useColors = exports.useColors(); if (null == self.color && self.useColors) self.color = selectColor(); - var args = Array.prototype.slice.call(arguments); + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } args[0] = exports.coerce(args[0]); @@ -795,9 +676,9 @@ function debug(namespace) { return match; }); - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } + // apply env-specific formatting + args = exports.formatArgs.apply(self, args); + var logFn = enabled.log || exports.log || console.log.bind(console); logFn.apply(self, args); } @@ -826,7 +707,7 @@ function enable(namespaces) { for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); + namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { @@ -881,7 +762,158 @@ function coerce(val) { return val; } -},{"1":1}],5:[function(require,module,exports){ +},{"4":4}],4:[function(require,module,exports){ +/** + * Helpers. + */ + +var s = 1000 +var m = s * 60 +var h = m * 60 +var d = h * 24 +var y = d * 365.25 + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {} + var type = typeof val + if (type === 'string' && val.length > 0) { + return parse(val) + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? + fmtLong(val) : + fmtShort(val) + } + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) +} + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str) + if (str.length > 10000) { + return + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) + if (!match) { + return + } + var n = parseFloat(match[1]) + var type = (match[2] || 'ms').toLowerCase() + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y + case 'days': + case 'day': + case 'd': + return n * d + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n + default: + return undefined + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd' + } + if (ms >= h) { + return Math.round(ms / h) + 'h' + } + if (ms >= m) { + return Math.round(ms / m) + 'm' + } + if (ms >= s) { + return Math.round(ms / s) + 's' + } + return ms + 'ms' +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms' +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name + } + return Math.ceil(ms / n) + ' ' + name + 's' +} + +},{}],5:[function(require,module,exports){ (function (process,global){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. @@ -1843,8 +1875,8 @@ function coerce(val) { }).call(this); -}).call(this,require(2),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"2":2}],6:[function(require,module,exports){ +}).call(this,require(1),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"1":1}],6:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -2218,6 +2250,167 @@ module.exports = Array.isArray || function (arr) { }; },{}],11:[function(require,module,exports){ +'use strict'; + +// modified from https://github.com/es-shims/es5-shim +var has = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var slice = Array.prototype.slice; +var isArgs = require(12); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); +var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); +var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' +]; +var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; +}; +var excludedKeys = { + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true +}; +var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; +}()); +var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } +}; + +var keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; +}; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + return (Object.keys(arguments) || '').length === 2; + }(1, 2)); + if (!keysWorksWithArguments) { + var originalKeys = Object.keys; + Object.keys = function keys(object) { + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } else { + return originalKeys(object); + } + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; +}; + +module.exports = keysShim; + +},{"12":12}],12:[function(require,module,exports){ +'use strict'; + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; + +},{}],13:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -2304,15 +2497,15 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],12:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ module.exports = AlgoliaSearch; -var Index = require(14); -var deprecate = require(25); -var deprecatedMessage = require(26); -var AlgoliaSearchCore = require(13); +var Index = require(16); +var deprecate = require(27); +var deprecatedMessage = require(28); +var AlgoliaSearchCore = require(15); var inherits = require(9); -var errors = require(27); +var errors = require(29); function AlgoliaSearch() { AlgoliaSearchCore.apply(this, arguments); @@ -2393,7 +2586,7 @@ AlgoliaSearch.prototype.copyIndex = function(srcIndexName, dstIndexName, callbac * content: the server answer that contains the task ID */ AlgoliaSearch.prototype.getLogs = function(offset, length, callback) { - var clone = require(24); + var clone = require(26); var params = {}; if (typeof offset === 'object') { // getLogs(params) @@ -2764,12 +2957,12 @@ function notImplemented() { throw new errors.AlgoliaSearchError(message); } -},{"10":10,"13":13,"14":14,"24":24,"25":25,"26":26,"27":27,"9":9}],13:[function(require,module,exports){ +},{"10":10,"15":15,"16":16,"26":26,"27":27,"28":28,"29":29,"9":9}],15:[function(require,module,exports){ module.exports = AlgoliaSearchCore; -var errors = require(27); -var exitPromise = require(28); -var IndexCore = require(16); +var errors = require(29); +var exitPromise = require(30); +var IndexCore = require(18); // We will always put the API KEY in the JSON body in case of too long API KEY var MAX_API_KEY_LENGTH = 500; @@ -2800,11 +2993,11 @@ var MAX_API_KEY_LENGTH = 500; * If you provide them, you will less benefit from our HA implementation */ function AlgoliaSearchCore(applicationID, apiKey, opts) { - var debug = require(3)('algoliasearch'); + var debug = require(2)('algoliasearch'); - var clone = require(24); + var clone = require(26); var isArray = require(10); - var map = require(29); + var map = require(31); var usage = 'Usage: algoliasearch(applicationID, apiKey, opts)'; @@ -2916,7 +3109,7 @@ AlgoliaSearchCore.prototype.addAlgoliaAgent = function(algoliaAgent) { * Wrapper that try all hosts to maximize the quality of service */ AlgoliaSearchCore.prototype._jsonRequest = function(initialOpts) { - var requestDebug = require(3)('algoliasearch:' + initialOpts.url); + var requestDebug = require(2)('algoliasearch:' + initialOpts.url); var body; var cache = initialOpts.cache; @@ -3246,7 +3439,7 @@ AlgoliaSearchCore.prototype._computeRequestHeaders = function(withAPIKey) { */ AlgoliaSearchCore.prototype.search = function(queries, opts, callback) { var isArray = require(10); - var map = require(29); + var map = require(31); var usage = 'Usage: client.search(arrayOfQueries[, callback])'; @@ -3431,13 +3624,13 @@ function removeCredentials(headers) { return newHeaders; } -},{"10":10,"16":16,"24":24,"27":27,"28":28,"29":29,"3":3,"7":7}],14:[function(require,module,exports){ +},{"10":10,"18":18,"2":2,"26":26,"29":29,"30":30,"31":31,"7":7}],16:[function(require,module,exports){ var inherits = require(9); -var IndexCore = require(16); -var deprecate = require(25); -var deprecatedMessage = require(26); -var exitPromise = require(28); -var errors = require(27); +var IndexCore = require(18); +var deprecate = require(27); +var deprecatedMessage = require(28); +var exitPromise = require(30); +var errors = require(29); module.exports = Index; @@ -3675,7 +3868,7 @@ Index.prototype.deleteObject = function(objectID, callback) { */ Index.prototype.deleteObjects = function(objectIDs, callback) { var isArray = require(10); - var map = require(29); + var map = require(31); var usage = 'Usage: index.deleteObjects(arrayOfObjectIDs[, callback])'; @@ -3714,8 +3907,8 @@ Index.prototype.deleteObjects = function(objectIDs, callback) { * error: null or Error('message') */ Index.prototype.deleteByQuery = function(query, params, callback) { - var clone = require(24); - var map = require(29); + var clone = require(26); + var map = require(31); var indexObj = this; var client = indexObj.as; @@ -3825,9 +4018,9 @@ Index.prototype.browseAll = function(query, queryParameters) { query = undefined; } - var merge = require(30); + var merge = require(32); - var IndexBrowser = require(15); + var IndexBrowser = require(17); var browser = new IndexBrowser(); var client = this.as; @@ -4408,7 +4601,7 @@ Index.prototype.updateUserKey = function(key, acls, params, callback) { }); }; -},{"10":10,"15":15,"16":16,"24":24,"25":25,"26":26,"27":27,"28":28,"29":29,"30":30,"9":9}],15:[function(require,module,exports){ +},{"10":10,"17":17,"18":18,"26":26,"27":27,"28":28,"29":29,"30":30,"31":31,"32":32,"9":9}],17:[function(require,module,exports){ 'use strict'; // This is the object returned by the `index.browseAll()` method @@ -4449,8 +4642,8 @@ IndexBrowser.prototype._clean = function() { this.removeAllListeners('result'); }; -},{"6":6,"9":9}],16:[function(require,module,exports){ -var buildSearchMethod = require(23); +},{"6":6,"9":9}],18:[function(require,module,exports){ +var buildSearchMethod = require(25); module.exports = IndexCore; @@ -4602,7 +4795,7 @@ IndexCore.prototype.similarSearch = buildSearchMethod('similarQuery'); * @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation} */ IndexCore.prototype.browse = function(query, queryParameters, callback) { - var merge = require(30); + var merge = require(32); var indexObj = this; @@ -4682,6 +4875,43 @@ IndexCore.prototype.browseFrom = function(cursor, callback) { }); }; +/* +* Search in facets +* https://www.algolia.com/doc/rest-api/search#search-in-a-facet +* +* @param {string} params.facetName Facet name, name of the attribute to search for values in. +* Must be declared as a facet +* @param {string} params.facetQuery Query for the facet search +* @param {string} [params.*] Any search parameter of Algolia, +* see https://www.algolia.com/doc/api-client/javascript/search#search-parameters +* Pagination is not supported. The page and hitsPerPage parameters will be ignored. +* @param callback (optional) +*/ +IndexCore.prototype.searchFacet = function(params, callback) { + var clone = require(26); + var omit = require(33); + var usage = 'Usage: index.searchFacet({facetName, facetQuery, ...params}[, callback])'; + + if (params.facetName === undefined || params.facetQuery === undefined) { + throw new Error(usage); + } + + var facetName = params.facetName; + var filteredParams = omit(clone(params), function(keyName) { + return keyName === 'facetName'; + }); + var searchParameters = this.as._getSearchParams(filteredParams, ''); + + return this.as._jsonRequest({ + method: 'POST', + url: '/1/indexes/' + + encodeURIComponent(this.indexName) + '/facets/' + encodeURIComponent(facetName) + '/query', + hostType: 'read', + body: {params: searchParameters}, + callback: callback + }); +}; + IndexCore.prototype._search = function(params, url, callback) { return this.as._jsonRequest({ cache: this.cache, @@ -4741,7 +4971,7 @@ IndexCore.prototype.getObject = function(objectID, attrs, callback) { */ IndexCore.prototype.getObjects = function(objectIDs, attributesToRetrieve, callback) { var isArray = require(10); - var map = require(29); + var map = require(31); var usage = 'Usage: index.getObjects(arrayOfObjectIDs[, callback])'; @@ -4785,7 +5015,7 @@ IndexCore.prototype.indexName = null; IndexCore.prototype.typeAheadArgs = null; IndexCore.prototype.typeAheadValueOption = null; -},{"10":10,"23":23,"29":29,"30":30}],17:[function(require,module,exports){ +},{"10":10,"25":25,"26":26,"31":31,"32":32,"33":33}],19:[function(require,module,exports){ (function (process){ 'use strict'; @@ -4795,23 +5025,23 @@ IndexCore.prototype.typeAheadValueOption = null; var inherits = require(9); -var AlgoliaSearch = require(12); -var errors = require(27); -var inlineHeaders = require(21); -var jsonpRequest = require(22); -var places = require(31); +var AlgoliaSearch = require(14); +var errors = require(29); +var inlineHeaders = require(23); +var jsonpRequest = require(24); +var places = require(34); // expose original algoliasearch fn in window -window.algoliasearch = require(18); +window.algoliasearch = require(20); if (process.env.NODE_ENV === 'debug') { - require(3).enable('algoliasearch*'); + require(2).enable('algoliasearch*'); } function algoliasearch(applicationID, apiKey, opts) { - var cloneDeep = require(24); + var cloneDeep = require(26); - var getDocumentProtocol = require(20); + var getDocumentProtocol = require(22); opts = cloneDeep(opts || {}); @@ -4824,14 +5054,14 @@ function algoliasearch(applicationID, apiKey, opts) { return new AlgoliaSearchJQuery(applicationID, apiKey, opts); } -algoliasearch.version = require(32); +algoliasearch.version = require(35); algoliasearch.ua = 'Algolia for jQuery ' + algoliasearch.version; algoliasearch.initPlaces = places(algoliasearch); // we expose into window no matter how we are used, this will allow // us to easily debug any website running algolia window.__algolia = { - debug: require(3), + debug: require(2), algoliasearch: algoliasearch }; @@ -4938,16 +5168,16 @@ AlgoliaSearchJQuery.prototype._promise = { } }; -}).call(this,require(2)) -},{"12":12,"18":18,"2":2,"20":20,"21":21,"22":22,"24":24,"27":27,"3":3,"31":31,"32":32,"9":9}],18:[function(require,module,exports){ +}).call(this,require(1)) +},{"1":1,"14":14,"2":2,"20":20,"22":22,"23":23,"24":24,"26":26,"29":29,"34":34,"35":35,"9":9}],20:[function(require,module,exports){ 'use strict'; -var AlgoliaSearch = require(12); -var createAlgoliasearch = require(19); +var AlgoliaSearch = require(14); +var createAlgoliasearch = require(21); module.exports = createAlgoliasearch(AlgoliaSearch); -},{"12":12,"19":19}],19:[function(require,module,exports){ +},{"14":14,"21":21}],21:[function(require,module,exports){ (function (process){ 'use strict'; @@ -4959,20 +5189,20 @@ var Promise = global.Promise || require(5).Promise; // using XMLHttpRequest, XDomainRequest and JSONP as fallback module.exports = function createAlgoliasearch(AlgoliaSearch, uaSuffix) { var inherits = require(9); - var errors = require(27); - var inlineHeaders = require(21); - var jsonpRequest = require(22); - var places = require(31); + var errors = require(29); + var inlineHeaders = require(23); + var jsonpRequest = require(24); + var places = require(34); uaSuffix = uaSuffix || ''; if (process.env.NODE_ENV === 'debug') { - require(3).enable('algoliasearch*'); + require(2).enable('algoliasearch*'); } function algoliasearch(applicationID, apiKey, opts) { - var cloneDeep = require(24); + var cloneDeep = require(26); - var getDocumentProtocol = require(20); + var getDocumentProtocol = require(22); opts = cloneDeep(opts || {}); @@ -4985,14 +5215,14 @@ module.exports = function createAlgoliasearch(AlgoliaSearch, uaSuffix) { return new AlgoliaSearchBrowser(applicationID, apiKey, opts); } - algoliasearch.version = require(32); + algoliasearch.version = require(35); algoliasearch.ua = 'Algolia for vanilla JavaScript ' + uaSuffix + algoliasearch.version; algoliasearch.initPlaces = places(algoliasearch); // we expose into window no matter how we are used, this will allow // us to easily debug any website running algolia global.__algolia = { - debug: require(3), + debug: require(2), algoliasearch: algoliasearch }; @@ -5169,8 +5399,8 @@ module.exports = function createAlgoliasearch(AlgoliaSearch, uaSuffix) { return algoliasearch; }; -}).call(this,require(2)) -},{"2":2,"20":20,"21":21,"22":22,"24":24,"27":27,"3":3,"31":31,"32":32,"5":5,"8":8,"9":9}],20:[function(require,module,exports){ +}).call(this,require(1)) +},{"1":1,"2":2,"22":22,"23":23,"24":24,"26":26,"29":29,"34":34,"35":35,"5":5,"8":8,"9":9}],22:[function(require,module,exports){ 'use strict'; module.exports = getDocumentProtocol; @@ -5186,12 +5416,12 @@ function getDocumentProtocol() { return protocol; } -},{}],21:[function(require,module,exports){ +},{}],23:[function(require,module,exports){ 'use strict'; module.exports = inlineHeaders; -var encode = require(11); +var encode = require(13); function inlineHeaders(url, headers) { if (/\?/.test(url)) { @@ -5203,12 +5433,12 @@ function inlineHeaders(url, headers) { return url + encode(headers); } -},{"11":11}],22:[function(require,module,exports){ +},{"13":13}],24:[function(require,module,exports){ 'use strict'; module.exports = jsonpRequest; -var errors = require(27); +var errors = require(29); var JSONPCounter = 0; @@ -5330,10 +5560,10 @@ function jsonpRequest(url, opts, cb) { } } -},{"27":27}],23:[function(require,module,exports){ +},{"29":29}],25:[function(require,module,exports){ module.exports = buildSearchMethod; -var errors = require(27); +var errors = require(29); function buildSearchMethod(queryParam, url) { return function search(query, args, callback) { @@ -5378,12 +5608,12 @@ function buildSearchMethod(queryParam, url) { }; } -},{"27":27}],24:[function(require,module,exports){ +},{"29":29}],26:[function(require,module,exports){ module.exports = function clone(obj) { return JSON.parse(JSON.stringify(obj)); }; -},{}],25:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ module.exports = function deprecate(fn, message) { var warned = false; @@ -5400,7 +5630,7 @@ module.exports = function deprecate(fn, message) { return deprecated; }; -},{}],26:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ module.exports = function deprecatedMessage(previousUsage, newUsage) { var githubAnchorLink = previousUsage.toLowerCase() .replace('.', '') @@ -5410,7 +5640,7 @@ module.exports = function deprecatedMessage(previousUsage, newUsage) { '`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#' + githubAnchorLink; }; -},{}],27:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ 'use strict'; // This file hosts our error definitions @@ -5490,7 +5720,7 @@ module.exports = { ) }; -},{"7":7,"9":9}],28:[function(require,module,exports){ +},{"7":7,"9":9}],30:[function(require,module,exports){ // Parse cloud does not supports setTimeout // We do not store a setTimeout reference in the client everytime // We only fallback to a fake setTimeout when not available @@ -5499,7 +5729,7 @@ module.exports = function exitPromise(fn, _setTimeout) { _setTimeout(fn, 0); }; -},{}],29:[function(require,module,exports){ +},{}],31:[function(require,module,exports){ var foreach = require(7); module.exports = function map(arr, fn) { @@ -5510,7 +5740,7 @@ module.exports = function map(arr, fn) { return newArr; }; -},{"7":7}],30:[function(require,module,exports){ +},{"7":7}],32:[function(require,module,exports){ var foreach = require(7); module.exports = function merge(destination/* , sources */) { @@ -5531,14 +5761,30 @@ module.exports = function merge(destination/* , sources */) { return destination; }; -},{"7":7}],31:[function(require,module,exports){ +},{"7":7}],33:[function(require,module,exports){ +module.exports = function omit(obj, test) { + var keys = require(11); + var foreach = require(7); + + var filtered = {}; + + foreach(keys(obj), function doFilter(keyName) { + if (test(keyName) !== true) { + filtered[keyName] = obj[keyName]; + } + }); + + return filtered; +}; + +},{"11":11,"7":7}],34:[function(require,module,exports){ module.exports = createPlacesClient; -var buildSearchMethod = require(23); +var buildSearchMethod = require(25); function createPlacesClient(algoliasearch) { return function places(appID, apiKey, opts) { - var cloneDeep = require(24); + var cloneDeep = require(26); opts = opts && cloneDeep(opts) || {}; opts.hosts = opts.hosts || [ @@ -5562,9 +5808,9 @@ function createPlacesClient(algoliasearch) { }; } -},{"23":23,"24":24}],32:[function(require,module,exports){ +},{"25":25,"26":26}],35:[function(require,module,exports){ 'use strict'; -module.exports = '3.18.1'; +module.exports = '3.19.1'; -},{}]},{},[17]); +},{}]},{},[19]); diff --git a/assets/js/algoliasearch/algoliasearch.jquery.min.js b/assets/js/algoliasearch/algoliasearch.jquery.min.js index e222164..d09f96a 100644 --- a/assets/js/algoliasearch/algoliasearch.jquery.min.js +++ b/assets/js/algoliasearch/algoliasearch.jquery.min.js @@ -1,3 +1,3 @@ -/*! algoliasearch 3.18.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ -!function(e){var t;"undefined"!=typeof window?t=window:"undefined"!=typeof self&&(t=self),t.ALGOLIA_MIGRATION_LAYER=e()}(function(){return function e(t,o,r){function n(i,a){if(!o[i]){if(!t[i]){var c="function"==typeof require&&require;if(!a&&c)return c(i,!0);if(s)return s(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var l=o[i]={exports:{}};t[i][0].call(l.exports,function(e){var o=t[i][1][e];return n(o?o:e)},l,l.exports,e,t,o,r)}return o[i].exports}for(var s="function"==typeof require&&require,i=0;iwindow.ALGOLIA_SUPPORTS_DOCWRITE = true"),window.ALGOLIA_SUPPORTS_DOCWRITE===!0?(document.write(''),n("document.write")()):o(r,n("DOMElement"))}catch(i){o(r,n("DOMElement"))}}function n(e){return function(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}t.exports=r},{1:1}],4:[function(e,t,o){"use strict";function r(){var e="-- 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(e)},window.AlgoliaSearchHelper=function(){throw new Error(e)},window.AlgoliaExplainResults=function(){throw new Error(e)}}t.exports=r},{}],5:[function(e,t,o){"use strict";function r(t){var o=e(2),r=e(3),n=e(4);o(t)?r(t):n()}r("algoliasearch.jquery")},{2:2,3:3,4:4}]},{},[5])(5)}),function e(t,o,r){function n(i,a){if(!o[i]){if(!t[i]){var c="function"==typeof require&&require;if(!a&&c)return c(i,!0);if(s)return s(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var l=o[i]={exports:{}};t[i][0].call(l.exports,function(e){var o=t[i][1][e];return n(o?o:e)},l,l.exports,e,t,o,r)}return o[i].exports}for(var s="function"==typeof require&&require,i=0;i1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var o=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return o*p;case"days":case"day":case"d":return o*l;case"hours":case"hour":case"hrs":case"hr":case"h":return o*u;case"minutes":case"minute":case"mins":case"min":case"m":return o*c;case"seconds":case"second":case"secs":case"sec":case"s":return o*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,u,"hour")||i(e,c,"minute")||i(e,a,"second")||e+" ms"}function i(e,t,o){if(!(e1)for(var o=1;o=31}function n(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+o.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(s=n))}),e.splice(s,0,r),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(e){try{null==e?o.storage.removeItem("debug"):o.storage.debug=e}catch(t){}}function a(){var e;try{e=o.storage.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}o=t.exports=e(4),o.log=s,o.formatArgs=n,o.save=i,o.load=a,o.useColors=r,o.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){return JSON.stringify(e)},o.enable(a())},{4:4}],4:[function(e,t,o){function r(){return o.colors[l++%o.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,s=t-(u||t);e.diff=s,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=o.useColors()),null==e.color&&e.useColors&&(e.color=r());var i=Array.prototype.slice.call(arguments);i[0]=o.coerce(i[0]),"string"!=typeof i[0]&&(i=["%o"].concat(i));var a=0;i[0]=i[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var n=o.formatters[r];if("function"==typeof n){var s=i[a];t=n.call(e,s),i.splice(a,1),a--}return t}),"function"==typeof o.formatArgs&&(i=o.formatArgs.apply(e,i));var c=n.log||o.log||console.log.bind(console);c.apply(e,i)}t.enabled=!1,n.enabled=!0;var s=o.enabled(e)?n:t;return s.namespace=e,s}function s(e){o.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,n=0;n0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function o(){this.removeListener(e,o),r||(r=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var r=!1;return o.listener=t,this.on(e,o),this},r.prototype.removeListener=function(e,t){var o,r,s,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=this._events[e],s=o.length,r=-1,o===t||n(o.listener)&&o.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(o)){for(a=s;a-- >0;)if(o[a]===t||o[a].listener&&o[a].listener===t){r=a;break}if(r<0)return this;1===o.length?(o.length=0,delete this._events[e]):o.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,o;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[e],n(o))this.removeListener(e,o);else if(o)for(;o.length;)this.removeListener(e,o[o.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],7:[function(e,t,o){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(e,t,o){if("[object Function]"!==n.call(t))throw new TypeError("iterator must be a function");var s=e.length;if(s===+s)for(var i=0;i=d.hosts[t.hostType].length&&(f||!y)?(e.debugData=m,d._promise.reject(e)):e instanceof c.RequestTimeout?b():g()}function g(){return i("retrying request"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,o(e,u)}function b(){return i("retrying request with higher timeout"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,u.timeout=d.requestTimeout*(h+1),o(e,u)}var w,_=new Date;if(d._useCache&&(w=t.url),d._useCache&&r&&(w+="_body_"+u.body),d._useCache&&l&&void 0!==l[w])return i("serving response from cache"),d._promise.resolve(JSON.parse(l[w]));if(h>=d.hosts[t.hostType].length)return!y||f?(i("could not get any response"),d._promise.reject(new c.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+d.applicationID,{debugData:m}))):(i("switching to fallback"),h=0,u.method=t.fallback.method,u.url=t.fallback.url,u.jsonBody=t.fallback.body,u.jsonBody&&(u.body=s(u.jsonBody)),n=d._computeRequestHeaders(),u.timeout=d.requestTimeout*(h+1),d.hostIndex[t.hostType]=0,f=!0,o(d._request.fallback,u));var x=d.hosts[t.hostType][d.hostIndex[t.hostType]],T=x+u.url,j={body:u.body,jsonBody:u.jsonBody,method:u.method,headers:n,timeout:u.timeout,debug:i};return i("method: %s, url: %s, headers: %j, timeout: %d",j.method,T,j.headers,j.timeout),e===d._request.fallback&&i("using fallback"),e.call(d,T,j).then(p,v)}var r,n,i=e(3)("algoliasearch:"+t.url),l=t.cache,d=this,h=0,f=!1,y=d._useFallback&&d._request.fallback&&t.fallback;this.apiKey.length>p&&void 0!==t.body&&(void 0!==t.body.params||void 0!==t.body.requests)?(t.body.apiKey=this.apiKey,n=this._computeRequestHeaders(!1)):n=this._computeRequestHeaders(),void 0!==t.body&&(r=s(t.body)),i("request start");var m=[],v=o(d._request,{url:t.url,method:t.method,body:r,jsonBody:t.body,timeout:d.requestTimeout*(h+1)});return t.callback?void v.then(function(e){u(function(){t.callback(null,e)},d._setTimeout||setTimeout)},function(e){u(function(){t.callback(e)},d._setTimeout||setTimeout)}):v},r.prototype._getSearchParams=function(e,t){if(void 0===e||null===e)return t;for(var o in e)null!==o&&void 0!==e[o]&&e.hasOwnProperty(o)&&(t+=""===t?"":"&",t+=o+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[o])?s(e[o]):e[o]));return t},r.prototype._computeRequestHeaders=function(t){var o=e(7),r={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return t!==!1&&(r["x-algolia-api-key"]=this.apiKey),this.userToken&&(r["x-algolia-usertoken"]=this.userToken),this.securityTags&&(r["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&o(this.extraHeaders,function(e){r[e.name]=e.value}),r},r.prototype.search=function(t,o,r){var n=e(10),s=e(29),i="Usage: client.search(arrayOfQueries[, callback])";if(!n(t))throw new Error(i);"function"==typeof o?(r=o,o={}):void 0===o&&(o={});var a=this,c={requests:s(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})},u=s(c.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&"),l="/1/indexes/*/queries";return void 0!==o.strategy&&(l+="?strategy="+o.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:l,body:c,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:u}},callback:r})},r.prototype.setSecurityTags=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],o=0;oi&&(t=i),"published"!==e.status?l._promise.delay(t).then(o):e})}function r(e){c(function(){t(null,e)},l._setTimeout||setTimeout)}function n(e){c(function(){t(e)},l._setTimeout||setTimeout)}var s=100,i=5e3,a=0,u=this,l=u.as,p=o();return t?void p.then(r,n):p},r.prototype.clearIndex=function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},r.prototype.getSettings=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings?getVersion=2",hostType:"read",callback:e})},r.prototype.searchSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/search",body:e,hostType:"read",callback:t})},r.prototype.saveSynonym=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e.objectID)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),body:e,hostType:"write",callback:o})},r.prototype.getSynonym=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e),hostType:"read",callback:t})},r.prototype.deleteSynonym=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),hostType:"write",callback:o})},r.prototype.clearSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/clear?forwardToSlaves="+(e.forwardToSlaves?"true":"false"),hostType:"write",callback:t})},r.prototype.batchSynonyms=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/batch?forwardToSlaves="+(t.forwardToSlaves?"true":"false")+"&replaceExistingSynonyms="+(t.replaceExistingSynonyms?"true":"false"),hostType:"write",body:e,callback:o})},r.prototype.setSettings=function(e,t,o){1!==arguments.length&&"function"!=typeof t||(o=t,t={});var r=t.forwardToSlaves||!1,n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings?forwardToSlaves="+(r?"true":"false"),hostType:"write",body:e,callback:o})},r.prototype.listUserKeys=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},r.prototype.getUserKeyACL=function(e,t){var o=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"read",callback:t})},r.prototype.deleteUserKey=function(e,t){var o=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"write",callback:t})},r.prototype.addUserKey=function(t,o,r){var n=e(10),s="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!n(t))throw new Error(s);1!==arguments.length&&"function"!=typeof o||(r=o,o=null);var i={acl:t};return o&&(i.validity=o.validity,i.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,i.maxHitsPerQuery=o.maxHitsPerQuery,i.description=o.description,o.queryParameters&&(i.queryParameters=this.as._getSearchParams(o.queryParameters,"")),i.referers=o.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:i,hostType:"write",callback:r})},r.prototype.addUserKeyWithValidity=i(function(e,t,o){return this.addUserKey(e,t,o)},a("index.addUserKeyWithValidity()","index.addUserKey()")),r.prototype.updateUserKey=function(t,o,r,n){var s=e(10),i="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!s(o))throw new Error(i);2!==arguments.length&&"function"!=typeof r||(n=r,r=null);var a={acl:o};return r&&(a.validity=r.validity,a.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,a.maxHitsPerQuery=r.maxHitsPerQuery,a.description=r.description,r.queryParameters&&(a.queryParameters=this.as._getSearchParams(r.queryParameters,"")),a.referers=r.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:a,hostType:"write",callback:n})}},{10:10,15:15,16:16,24:24,25:25,26:26,27:27,28:28,29:29,30:30,9:9}],15:[function(e,t,o){"use strict";function r(){}t.exports=r;var n=e(9),s=e(6).EventEmitter;n(r,s),r.prototype.stop=function(){this._stopped=!0,this._clean()},r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(e){this.emit("error",e),this._clean()},r.prototype._result=function(e){this.emit("result",e)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{6:6,9:9}],16:[function(e,t,o){function r(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var n=e(23);t.exports=r,r.prototype.clearCache=function(){this.cache={}},r.prototype.search=n("query"),r.prototype.similarSearch=n("similarQuery"),r.prototype.browse=function(t,o,r){var n,s,i=e(30),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(n=0,r=arguments[0],t=void 0):"number"==typeof arguments[0]?(n=arguments[0],"number"==typeof arguments[1]?s=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],s=void 0),t=void 0,o=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),o=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],o=void 0),o=i({},o||{},{page:n,hitsPerPage:s,query:t});var c=this.as._getSearchParams(o,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+c,hostType:"read",callback:r})},r.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},r.prototype._search=function(e,t,o){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:o})},r.prototype.getObject=function(e,t,o){var r=this;1!==arguments.length&&"function"!=typeof t||(o=t,t=void 0);var n="";if(void 0!==t){n="?attributes=";for(var s=0;s was loaded but did not call our provided callback"),JSONPScriptError:n("JSONPScriptError",""),window.ALGOLIA_SUPPORTS_DOCWRITE===!0?(document.write(''),n("document.write")()):r(o,n("DOMElement"))}catch(s){r(o,n("DOMElement"))}}function n(e){return function(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}t.exports=o},{1:1}],4:[function(e,t,r){"use strict";function o(){var e="-- 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(e)},window.AlgoliaSearchHelper=function(){throw new Error(e)},window.AlgoliaExplainResults=function(){throw new Error(e)}}t.exports=o},{}],5:[function(e,t,r){"use strict";function o(t){var r=e(2),o=e(3),n=e(4);r(t)?o(t):n()}o("algoliasearch.jquery")},{2:2,3:3,4:4}]},{},[5])(5)}),function e(t,r,o){function n(s,a){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,o)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s1)for(var r=1;r=31}function i(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return e;var o="color: "+this.color;e=[e[0],o,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,o),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(t){}}function c(){var e;try{e=r.storage.debug}catch(t){}return"env"in("undefined"==typeof o?{}:o)&&(e=o.env.DEBUG),e}function u(){try{return window.localStorage}catch(e){}}r=t.exports=e(3),r.log=s,r.formatArgs=i,r.save=a,r.load=c,r.useColors=n,r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){return JSON.stringify(e)},r.enable(c())}).call(this,e(1))},{1:1,3:3}],3:[function(e,t,r){function o(){return r.colors[l++%r.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,i=t-(u||t);e.diff=i,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=r.useColors()),null==e.color&&e.useColors&&(e.color=o());for(var s=new Array(arguments.length),a=0;a1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*u;case"minutes":case"minute":case"mins":case"min":case"m":return r*c;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function i(e){return s(e,l,"day")||s(e,u,"hour")||s(e,c,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,r){if(!(e0)return o(e);if("number"===r&&isNaN(e)===!1)return t["long"]?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],5:[function(e,t,r){(function(r,o){(function(){"use strict";function n(e){return"function"==typeof e||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function s(e){V=e}function a(e){z=e}function c(){return function(){r.nextTick(h)}}function u(){return function(){G(h)}}function l(){var e=0,t=new te(h),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function p(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(h,1)}}function h(){for(var e=0;e0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},o.prototype.removeListener=function(e,t){var r,o,i,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(a=i;a-- >0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=a;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},o.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},o.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},o.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},o.listenerCount=function(e,t){return e.listenerCount(t)}},{}],7:[function(e,t,r){var o=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(e,t,r){if("[object Function]"!==n.call(t))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var s=0;s0&&!o.call(e,0))for(var h=0;h0)for(var y=0;y=0&&"[object Function]"===o.call(e.callee)),r}},{}],13:[function(e,t,r){"use strict";function o(e,t){if(e.map)return e.map(t);for(var r=[],o=0;o=d.hosts[t.hostType].length&&(f||!y)?(e.debugData=m,d._promise.reject(e)):e instanceof c.RequestTimeout?b():g()}function g(){return s("retrying request"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,r(e,u)}function b(){return s("retrying request with higher timeout"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,u.timeout=d.requestTimeout*(h+1),r(e,u)}var w,_=new Date;if(d._useCache&&(w=t.url),d._useCache&&o&&(w+="_body_"+u.body),d._useCache&&l&&void 0!==l[w])return s("serving response from cache"),d._promise.resolve(JSON.parse(l[w]));if(h>=d.hosts[t.hostType].length)return!y||f?(s("could not get any response"),d._promise.reject(new c.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+d.applicationID,{debugData:m}))):(s("switching to fallback"),h=0,u.method=t.fallback.method,u.url=t.fallback.url,u.jsonBody=t.fallback.body,u.jsonBody&&(u.body=i(u.jsonBody)),n=d._computeRequestHeaders(),u.timeout=d.requestTimeout*(h+1),d.hostIndex[t.hostType]=0,f=!0,r(d._request.fallback,u));var x=d.hosts[t.hostType][d.hostIndex[t.hostType]],T=x+u.url,j={body:u.body,jsonBody:u.jsonBody,method:u.method,headers:n,timeout:u.timeout, +debug:s};return s("method: %s, url: %s, headers: %j, timeout: %d",j.method,T,j.headers,j.timeout),e===d._request.fallback&&s("using fallback"),e.call(d,T,j).then(p,v)}var o,n,s=e(2)("algoliasearch:"+t.url),l=t.cache,d=this,h=0,f=!1,y=d._useFallback&&d._request.fallback&&t.fallback;this.apiKey.length>p&&void 0!==t.body&&(void 0!==t.body.params||void 0!==t.body.requests)?(t.body.apiKey=this.apiKey,n=this._computeRequestHeaders(!1)):n=this._computeRequestHeaders(),void 0!==t.body&&(o=i(t.body)),s("request start");var m=[],v=r(d._request,{url:t.url,method:t.method,body:o,jsonBody:t.body,timeout:d.requestTimeout*(h+1)});return t.callback?void v.then(function(e){u(function(){t.callback(null,e)},d._setTimeout||setTimeout)},function(e){u(function(){t.callback(e)},d._setTimeout||setTimeout)}):v},o.prototype._getSearchParams=function(e,t){if(void 0===e||null===e)return t;for(var r in e)null!==r&&void 0!==e[r]&&e.hasOwnProperty(r)&&(t+=""===t?"":"&",t+=r+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[r])?i(e[r]):e[r]));return t},o.prototype._computeRequestHeaders=function(t){var r=e(7),o={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return t!==!1&&(o["x-algolia-api-key"]=this.apiKey),this.userToken&&(o["x-algolia-usertoken"]=this.userToken),this.securityTags&&(o["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&r(this.extraHeaders,function(e){o[e.name]=e.value}),o},o.prototype.search=function(t,r,o){var n=e(10),i=e(31),s="Usage: client.search(arrayOfQueries[, callback])";if(!n(t))throw new Error(s);"function"==typeof r?(o=r,r={}):void 0===r&&(r={});var a=this,c={requests:i(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})},u=i(c.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&"),l="/1/indexes/*/queries";return void 0!==r.strategy&&(l+="?strategy="+r.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:l,body:c,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:u}},callback:o})},o.prototype.setSecurityTags=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],r=0;rs&&(t=s),"published"!==e.status?l._promise.delay(t).then(r):e})}function o(e){c(function(){t(null,e)},l._setTimeout||setTimeout)}function n(e){c(function(){t(e)},l._setTimeout||setTimeout)}var i=100,s=5e3,a=0,u=this,l=u.as,p=r();return t?void p.then(o,n):p},o.prototype.clearIndex=function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},o.prototype.getSettings=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings?getVersion=2",hostType:"read",callback:e})},o.prototype.searchSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/search",body:e,hostType:"read",callback:t})},o.prototype.saveSynonym=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e.objectID)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),body:e,hostType:"write",callback:r})},o.prototype.getSynonym=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e),hostType:"read",callback:t})},o.prototype.deleteSynonym=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),hostType:"write",callback:r})},o.prototype.clearSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/clear?forwardToSlaves="+(e.forwardToSlaves?"true":"false"),hostType:"write",callback:t})},o.prototype.batchSynonyms=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/batch?forwardToSlaves="+(t.forwardToSlaves?"true":"false")+"&replaceExistingSynonyms="+(t.replaceExistingSynonyms?"true":"false"),hostType:"write",body:e,callback:r})},o.prototype.setSettings=function(e,t,r){1!==arguments.length&&"function"!=typeof t||(r=t,t={});var o=t.forwardToSlaves||!1,n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings?forwardToSlaves="+(o?"true":"false"),hostType:"write",body:e,callback:r})},o.prototype.listUserKeys=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},o.prototype.getUserKeyACL=function(e,t){var r=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"read",callback:t})},o.prototype.deleteUserKey=function(e,t){var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"write",callback:t})},o.prototype.addUserKey=function(t,r,o){var n=e(10),i="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!n(t))throw new Error(i);1!==arguments.length&&"function"!=typeof r||(o=r,r=null);var s={acl:t};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.description=r.description,r.queryParameters&&(s.queryParameters=this.as._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:s,hostType:"write",callback:o})},o.prototype.addUserKeyWithValidity=s(function(e,t,r){return this.addUserKey(e,t,r)},a("index.addUserKeyWithValidity()","index.addUserKey()")),o.prototype.updateUserKey=function(t,r,o,n){var i=e(10),s="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!i(r))throw new Error(s);2!==arguments.length&&"function"!=typeof o||(n=o,o=null);var a={acl:r};return o&&(a.validity=o.validity,a.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,a.maxHitsPerQuery=o.maxHitsPerQuery,a.description=o.description,o.queryParameters&&(a.queryParameters=this.as._getSearchParams(o.queryParameters,"")),a.referers=o.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:a,hostType:"write",callback:n})}},{10:10,17:17,18:18,26:26,27:27,28:28,29:29,30:30,31:31,32:32,9:9}],17:[function(e,t,r){"use strict";function o(){}t.exports=o;var n=e(9),i=e(6).EventEmitter;n(o,i),o.prototype.stop=function(){this._stopped=!0,this._clean()},o.prototype._end=function(){this.emit("end"),this._clean()},o.prototype._error=function(e){this.emit("error",e),this._clean()},o.prototype._result=function(e){this.emit("result",e)},o.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{6:6,9:9}],18:[function(e,t,r){function o(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var n=e(25);t.exports=o,o.prototype.clearCache=function(){this.cache={}},o.prototype.search=n("query"),o.prototype.similarSearch=n("similarQuery"),o.prototype.browse=function(t,r,o){var n,i,s=e(32),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(n=0,o=arguments[0],t=void 0):"number"==typeof arguments[0]?(n=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(o=arguments[1],i=void 0),t=void 0,r=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(o=arguments[1]),r=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(o=arguments[1],r=void 0),r=s({},r||{},{page:n,hitsPerPage:i,query:t});var c=this.as._getSearchParams(r,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+c,hostType:"read",callback:o})},o.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},o.prototype.searchFacet=function(t,r){var o=e(26),n=e(33),i="Usage: index.searchFacet({facetName, facetQuery, ...params}[, callback])";if(void 0===t.facetName||void 0===t.facetQuery)throw new Error(i);var s=t.facetName,a=n(o(t),function(e){return"facetName"===e}),c=this.as._getSearchParams(a,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/facets/"+encodeURIComponent(s)+"/query",hostType:"read",body:{params:c},callback:r})},o.prototype._search=function(e,t,r){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:r})},o.prototype.getObject=function(e,t,r){var o=this;1!==arguments.length&&"function"!=typeof t||(r=t,t=void 0);var n="";if(void 0!==t){n="?attributes=";for(var i=0;i was loaded but did not call our provided callback"),JSONPScriptError:n("JSONPScriptError",""),window.ALGOLIA_SUPPORTS_DOCWRITE===!0?(document.write(''),n("document.write")()):o(r,n("DOMElement"))}catch(i){o(r,n("DOMElement"))}}function n(e){return function(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}t.exports=r},{1:1}],4:[function(e,t,o){"use strict";function r(){var e="-- 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(e)},window.AlgoliaSearchHelper=function(){throw new Error(e)},window.AlgoliaExplainResults=function(){throw new Error(e)}}t.exports=r},{}],5:[function(e,t,o){"use strict";function r(t){var o=e(2),r=e(3),n=e(4);o(t)?r(t):n()}r("algoliasearch.jquery")},{2:2,3:3,4:4}]},{},[5])(5)}),function e(t,o,r){function n(i,a){if(!o[i]){if(!t[i]){var c="function"==typeof require&&require;if(!a&&c)return c(i,!0);if(s)return s(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var l=o[i]={exports:{}};t[i][0].call(l.exports,function(e){var o=t[i][1][e];return n(o?o:e)},l,l.exports,e,t,o,r)}return o[i].exports}for(var s="function"==typeof require&&require,i=0;i1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var o=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return o*p;case"days":case"day":case"d":return o*l;case"hours":case"hour":case"hrs":case"hr":case"h":return o*u;case"minutes":case"minute":case"mins":case"min":case"m":return o*c;case"seconds":case"second":case"secs":case"sec":case"s":return o*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,u,"hour")||i(e,c,"minute")||i(e,a,"second")||e+" ms"}function i(e,t,o){if(!(e1)for(var o=1;o=31}function n(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+o.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(s=n))}),e.splice(s,0,r),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(e){try{null==e?o.storage.removeItem("debug"):o.storage.debug=e}catch(t){}}function a(){var e;try{e=o.storage.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}o=t.exports=e(4),o.log=s,o.formatArgs=n,o.save=i,o.load=a,o.useColors=r,o.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){return JSON.stringify(e)},o.enable(a())},{4:4}],4:[function(e,t,o){function r(){return o.colors[l++%o.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,s=t-(u||t);e.diff=s,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=o.useColors()),null==e.color&&e.useColors&&(e.color=r());var i=Array.prototype.slice.call(arguments);i[0]=o.coerce(i[0]),"string"!=typeof i[0]&&(i=["%o"].concat(i));var a=0;i[0]=i[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var n=o.formatters[r];if("function"==typeof n){var s=i[a];t=n.call(e,s),i.splice(a,1),a--}return t}),"function"==typeof o.formatArgs&&(i=o.formatArgs.apply(e,i));var c=n.log||o.log||console.log.bind(console);c.apply(e,i)}t.enabled=!1,n.enabled=!0;var s=o.enabled(e)?n:t;return s.namespace=e,s}function s(e){o.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,n=0;n0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function o(){this.removeListener(e,o),r||(r=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var r=!1;return o.listener=t,this.on(e,o),this},r.prototype.removeListener=function(e,t){var o,r,s,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=this._events[e],s=o.length,r=-1,o===t||n(o.listener)&&o.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(o)){for(a=s;a-- >0;)if(o[a]===t||o[a].listener&&o[a].listener===t){r=a;break}if(r<0)return this;1===o.length?(o.length=0,delete this._events[e]):o.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,o;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[e],n(o))this.removeListener(e,o);else if(o)for(;o.length;)this.removeListener(e,o[o.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],7:[function(e,t,o){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(e,t,o){if("[object Function]"!==n.call(t))throw new TypeError("iterator must be a function");var s=e.length;if(s===+s)for(var i=0;i=d.hosts[t.hostType].length&&(f||!y)?(e.debugData=m,d._promise.reject(e)):e instanceof c.RequestTimeout?b():g()}function g(){return i("retrying request"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,o(e,u)}function b(){return i("retrying request with higher timeout"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,u.timeout=d.requestTimeout*(h+1),o(e,u)}var w,_=new Date;if(d._useCache&&(w=t.url),d._useCache&&r&&(w+="_body_"+u.body),d._useCache&&l&&void 0!==l[w])return i("serving response from cache"),d._promise.resolve(JSON.parse(l[w]));if(h>=d.hosts[t.hostType].length)return!y||f?(i("could not get any response"),d._promise.reject(new c.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+d.applicationID,{debugData:m}))):(i("switching to fallback"),h=0,u.method=t.fallback.method,u.url=t.fallback.url,u.jsonBody=t.fallback.body,u.jsonBody&&(u.body=s(u.jsonBody)),n=d._computeRequestHeaders(),u.timeout=d.requestTimeout*(h+1),d.hostIndex[t.hostType]=0,f=!0,o(d._request.fallback,u));var x=d.hosts[t.hostType][d.hostIndex[t.hostType]],T=x+u.url,j={body:u.body,jsonBody:u.jsonBody,method:u.method,headers:n,timeout:u.timeout,debug:i};return i("method: %s, url: %s, headers: %j, timeout: %d",j.method,T,j.headers,j.timeout),e===d._request.fallback&&i("using fallback"),e.call(d,T,j).then(p,v)}var r,n,i=e(3)("algoliasearch:"+t.url),l=t.cache,d=this,h=0,f=!1,y=d._useFallback&&d._request.fallback&&t.fallback;this.apiKey.length>p&&void 0!==t.body&&(void 0!==t.body.params||void 0!==t.body.requests)?(t.body.apiKey=this.apiKey,n=this._computeRequestHeaders(!1)):n=this._computeRequestHeaders(),void 0!==t.body&&(r=s(t.body)),i("request start");var m=[],v=o(d._request,{url:t.url,method:t.method,body:r,jsonBody:t.body,timeout:d.requestTimeout*(h+1)});return t.callback?void v.then(function(e){u(function(){t.callback(null,e)},d._setTimeout||setTimeout)},function(e){u(function(){t.callback(e)},d._setTimeout||setTimeout)}):v},r.prototype._getSearchParams=function(e,t){if(void 0===e||null===e)return t;for(var o in e)null!==o&&void 0!==e[o]&&e.hasOwnProperty(o)&&(t+=""===t?"":"&",t+=o+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[o])?s(e[o]):e[o]));return t},r.prototype._computeRequestHeaders=function(t){var o=e(7),r={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return t!==!1&&(r["x-algolia-api-key"]=this.apiKey),this.userToken&&(r["x-algolia-usertoken"]=this.userToken),this.securityTags&&(r["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&o(this.extraHeaders,function(e){r[e.name]=e.value}),r},r.prototype.search=function(t,o,r){var n=e(10),s=e(29),i="Usage: client.search(arrayOfQueries[, callback])";if(!n(t))throw new Error(i);"function"==typeof o?(r=o,o={}):void 0===o&&(o={});var a=this,c={requests:s(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})},u=s(c.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&"),l="/1/indexes/*/queries";return void 0!==o.strategy&&(l+="?strategy="+o.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:l,body:c,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:u}},callback:r})},r.prototype.setSecurityTags=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],o=0;oi&&(t=i),"published"!==e.status?l._promise.delay(t).then(o):e})}function r(e){c(function(){t(null,e)},l._setTimeout||setTimeout)}function n(e){c(function(){t(e)},l._setTimeout||setTimeout)}var s=100,i=5e3,a=0,u=this,l=u.as,p=o();return t?void p.then(r,n):p},r.prototype.clearIndex=function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},r.prototype.getSettings=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings?getVersion=2",hostType:"read",callback:e})},r.prototype.searchSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/search",body:e,hostType:"read",callback:t})},r.prototype.saveSynonym=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e.objectID)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),body:e,hostType:"write",callback:o})},r.prototype.getSynonym=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e),hostType:"read",callback:t})},r.prototype.deleteSynonym=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),hostType:"write",callback:o})},r.prototype.clearSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/clear?forwardToSlaves="+(e.forwardToSlaves?"true":"false"),hostType:"write",callback:t})},r.prototype.batchSynonyms=function(e,t,o){return"function"==typeof t?(o=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/batch?forwardToSlaves="+(t.forwardToSlaves?"true":"false")+"&replaceExistingSynonyms="+(t.replaceExistingSynonyms?"true":"false"),hostType:"write",body:e,callback:o})},r.prototype.setSettings=function(e,t,o){1!==arguments.length&&"function"!=typeof t||(o=t,t={});var r=t.forwardToSlaves||!1,n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings?forwardToSlaves="+(r?"true":"false"),hostType:"write",body:e,callback:o})},r.prototype.listUserKeys=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},r.prototype.getUserKeyACL=function(e,t){var o=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"read",callback:t})},r.prototype.deleteUserKey=function(e,t){var o=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"write",callback:t})},r.prototype.addUserKey=function(t,o,r){var n=e(10),s="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!n(t))throw new Error(s);1!==arguments.length&&"function"!=typeof o||(r=o,o=null);var i={acl:t};return o&&(i.validity=o.validity,i.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,i.maxHitsPerQuery=o.maxHitsPerQuery,i.description=o.description,o.queryParameters&&(i.queryParameters=this.as._getSearchParams(o.queryParameters,"")),i.referers=o.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:i,hostType:"write",callback:r})},r.prototype.addUserKeyWithValidity=i(function(e,t,o){return this.addUserKey(e,t,o)},a("index.addUserKeyWithValidity()","index.addUserKey()")),r.prototype.updateUserKey=function(t,o,r,n){var s=e(10),i="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!s(o))throw new Error(i);2!==arguments.length&&"function"!=typeof r||(n=r,r=null);var a={acl:o};return r&&(a.validity=r.validity,a.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,a.maxHitsPerQuery=r.maxHitsPerQuery,a.description=r.description,r.queryParameters&&(a.queryParameters=this.as._getSearchParams(r.queryParameters,"")),a.referers=r.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:a,hostType:"write",callback:n})}},{10:10,15:15,16:16,24:24,25:25,26:26,27:27,28:28,29:29,30:30,9:9}],15:[function(e,t,o){"use strict";function r(){}t.exports=r;var n=e(9),s=e(6).EventEmitter;n(r,s),r.prototype.stop=function(){this._stopped=!0,this._clean()},r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(e){this.emit("error",e),this._clean()},r.prototype._result=function(e){this.emit("result",e)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{6:6,9:9}],16:[function(e,t,o){function r(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var n=e(23);t.exports=r,r.prototype.clearCache=function(){this.cache={}},r.prototype.search=n("query"),r.prototype.similarSearch=n("similarQuery"),r.prototype.browse=function(t,o,r){var n,s,i=e(30),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(n=0,r=arguments[0],t=void 0):"number"==typeof arguments[0]?(n=arguments[0],"number"==typeof arguments[1]?s=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],s=void 0),t=void 0,o=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),o=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],o=void 0),o=i({},o||{},{page:n,hitsPerPage:s,query:t});var c=this.as._getSearchParams(o,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+c,hostType:"read",callback:r})},r.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},r.prototype._search=function(e,t,o){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:o})},r.prototype.getObject=function(e,t,o){var r=this;1!==arguments.length&&"function"!=typeof t||(o=t,t=void 0);var n="";if(void 0!==t){n="?attributes=";for(var s=0;s was loaded but did not call our provided callback"),JSONPScriptError:n("JSONPScriptError",""),window.ALGOLIA_SUPPORTS_DOCWRITE===!0?(document.write(''),n("document.write")()):r(o,n("DOMElement"))}catch(s){r(o,n("DOMElement"))}}function n(e){return function(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}t.exports=o},{1:1}],4:[function(e,t,r){"use strict";function o(){var e="-- 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(e)},window.AlgoliaSearchHelper=function(){throw new Error(e)},window.AlgoliaExplainResults=function(){throw new Error(e)}}t.exports=o},{}],5:[function(e,t,r){"use strict";function o(t){var r=e(2),o=e(3),n=e(4);r(t)?o(t):n()}o("algoliasearch.jquery")},{2:2,3:3,4:4}]},{},[5])(5)}),function e(t,r,o){function n(s,a){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,o)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s1)for(var r=1;r=31}function i(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return e;var o="color: "+this.color;e=[e[0],o,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,o),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(t){}}function c(){var e;try{e=r.storage.debug}catch(t){}return"env"in("undefined"==typeof o?{}:o)&&(e=o.env.DEBUG),e}function u(){try{return window.localStorage}catch(e){}}r=t.exports=e(3),r.log=s,r.formatArgs=i,r.save=a,r.load=c,r.useColors=n,r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){return JSON.stringify(e)},r.enable(c())}).call(this,e(1))},{1:1,3:3}],3:[function(e,t,r){function o(){return r.colors[l++%r.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,i=t-(u||t);e.diff=i,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=r.useColors()),null==e.color&&e.useColors&&(e.color=o());for(var s=new Array(arguments.length),a=0;a1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*u;case"minutes":case"minute":case"mins":case"min":case"m":return r*c;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function i(e){return s(e,l,"day")||s(e,u,"hour")||s(e,c,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,r){if(!(e0)return o(e);if("number"===r&&isNaN(e)===!1)return t["long"]?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],5:[function(e,t,r){(function(r,o){(function(){"use strict";function n(e){return"function"==typeof e||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function s(e){V=e}function a(e){z=e}function c(){return function(){r.nextTick(h)}}function u(){return function(){G(h)}}function l(){var e=0,t=new te(h),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function p(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(h,1)}}function h(){for(var e=0;e0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},o.prototype.removeListener=function(e,t){var r,o,i,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(a=i;a-- >0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=a;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},o.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},o.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},o.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},o.listenerCount=function(e,t){return e.listenerCount(t)}},{}],7:[function(e,t,r){var o=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(e,t,r){if("[object Function]"!==n.call(t))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var s=0;s0&&!o.call(e,0))for(var h=0;h0)for(var y=0;y=0&&"[object Function]"===o.call(e.callee)),r}},{}],13:[function(e,t,r){"use strict";function o(e,t){if(e.map)return e.map(t);for(var r=[],o=0;o=d.hosts[t.hostType].length&&(f||!y)?(e.debugData=m,d._promise.reject(e)):e instanceof c.RequestTimeout?b():g()}function g(){return s("retrying request"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,r(e,u)}function b(){return s("retrying request with higher timeout"),d.hostIndex[t.hostType]=(d.hostIndex[t.hostType]+1)%d.hosts[t.hostType].length,u.timeout=d.requestTimeout*(h+1),r(e,u)}var w,_=new Date;if(d._useCache&&(w=t.url),d._useCache&&o&&(w+="_body_"+u.body),d._useCache&&l&&void 0!==l[w])return s("serving response from cache"),d._promise.resolve(JSON.parse(l[w]));if(h>=d.hosts[t.hostType].length)return!y||f?(s("could not get any response"),d._promise.reject(new c.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+d.applicationID,{debugData:m}))):(s("switching to fallback"),h=0,u.method=t.fallback.method,u.url=t.fallback.url,u.jsonBody=t.fallback.body,u.jsonBody&&(u.body=i(u.jsonBody)),n=d._computeRequestHeaders(),u.timeout=d.requestTimeout*(h+1),d.hostIndex[t.hostType]=0,f=!0,r(d._request.fallback,u));var x=d.hosts[t.hostType][d.hostIndex[t.hostType]],T=x+u.url,j={body:u.body,jsonBody:u.jsonBody,method:u.method,headers:n,timeout:u.timeout, +debug:s};return s("method: %s, url: %s, headers: %j, timeout: %d",j.method,T,j.headers,j.timeout),e===d._request.fallback&&s("using fallback"),e.call(d,T,j).then(p,v)}var o,n,s=e(2)("algoliasearch:"+t.url),l=t.cache,d=this,h=0,f=!1,y=d._useFallback&&d._request.fallback&&t.fallback;this.apiKey.length>p&&void 0!==t.body&&(void 0!==t.body.params||void 0!==t.body.requests)?(t.body.apiKey=this.apiKey,n=this._computeRequestHeaders(!1)):n=this._computeRequestHeaders(),void 0!==t.body&&(o=i(t.body)),s("request start");var m=[],v=r(d._request,{url:t.url,method:t.method,body:o,jsonBody:t.body,timeout:d.requestTimeout*(h+1)});return t.callback?void v.then(function(e){u(function(){t.callback(null,e)},d._setTimeout||setTimeout)},function(e){u(function(){t.callback(e)},d._setTimeout||setTimeout)}):v},o.prototype._getSearchParams=function(e,t){if(void 0===e||null===e)return t;for(var r in e)null!==r&&void 0!==e[r]&&e.hasOwnProperty(r)&&(t+=""===t?"":"&",t+=r+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[r])?i(e[r]):e[r]));return t},o.prototype._computeRequestHeaders=function(t){var r=e(7),o={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return t!==!1&&(o["x-algolia-api-key"]=this.apiKey),this.userToken&&(o["x-algolia-usertoken"]=this.userToken),this.securityTags&&(o["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&r(this.extraHeaders,function(e){o[e.name]=e.value}),o},o.prototype.search=function(t,r,o){var n=e(10),i=e(31),s="Usage: client.search(arrayOfQueries[, callback])";if(!n(t))throw new Error(s);"function"==typeof r?(o=r,r={}):void 0===r&&(r={});var a=this,c={requests:i(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})},u=i(c.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&"),l="/1/indexes/*/queries";return void 0!==r.strategy&&(l+="?strategy="+r.strategy),this._jsonRequest({cache:this.cache,method:"POST",url:l,body:c,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:u}},callback:o})},o.prototype.setSecurityTags=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],r=0;rs&&(t=s),"published"!==e.status?l._promise.delay(t).then(r):e})}function o(e){c(function(){t(null,e)},l._setTimeout||setTimeout)}function n(e){c(function(){t(e)},l._setTimeout||setTimeout)}var i=100,s=5e3,a=0,u=this,l=u.as,p=r();return t?void p.then(o,n):p},o.prototype.clearIndex=function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},o.prototype.getSettings=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings?getVersion=2",hostType:"read",callback:e})},o.prototype.searchSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/search",body:e,hostType:"read",callback:t})},o.prototype.saveSynonym=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e.objectID)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),body:e,hostType:"write",callback:r})},o.prototype.getSynonym=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e),hostType:"read",callback:t})},o.prototype.deleteSynonym=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/"+encodeURIComponent(e)+"?forwardToSlaves="+(t.forwardToSlaves?"true":"false"),hostType:"write",callback:r})},o.prototype.clearSynonyms=function(e,t){return"function"==typeof e?(t=e,e={}):void 0===e&&(e={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/clear?forwardToSlaves="+(e.forwardToSlaves?"true":"false"),hostType:"write",callback:t})},o.prototype.batchSynonyms=function(e,t,r){return"function"==typeof t?(r=t,t={}):void 0===t&&(t={}),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/synonyms/batch?forwardToSlaves="+(t.forwardToSlaves?"true":"false")+"&replaceExistingSynonyms="+(t.replaceExistingSynonyms?"true":"false"),hostType:"write",body:e,callback:r})},o.prototype.setSettings=function(e,t,r){1!==arguments.length&&"function"!=typeof t||(r=t,t={});var o=t.forwardToSlaves||!1,n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings?forwardToSlaves="+(o?"true":"false"),hostType:"write",body:e,callback:r})},o.prototype.listUserKeys=function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},o.prototype.getUserKeyACL=function(e,t){var r=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"read",callback:t})},o.prototype.deleteUserKey=function(e,t){var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"write",callback:t})},o.prototype.addUserKey=function(t,r,o){var n=e(10),i="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!n(t))throw new Error(i);1!==arguments.length&&"function"!=typeof r||(o=r,r=null);var s={acl:t};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.description=r.description,r.queryParameters&&(s.queryParameters=this.as._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:s,hostType:"write",callback:o})},o.prototype.addUserKeyWithValidity=s(function(e,t,r){return this.addUserKey(e,t,r)},a("index.addUserKeyWithValidity()","index.addUserKey()")),o.prototype.updateUserKey=function(t,r,o,n){var i=e(10),s="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!i(r))throw new Error(s);2!==arguments.length&&"function"!=typeof o||(n=o,o=null);var a={acl:r};return o&&(a.validity=o.validity,a.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,a.maxHitsPerQuery=o.maxHitsPerQuery,a.description=o.description,o.queryParameters&&(a.queryParameters=this.as._getSearchParams(o.queryParameters,"")),a.referers=o.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:a,hostType:"write",callback:n})}},{10:10,17:17,18:18,26:26,27:27,28:28,29:29,30:30,31:31,32:32,9:9}],17:[function(e,t,r){"use strict";function o(){}t.exports=o;var n=e(9),i=e(6).EventEmitter;n(o,i),o.prototype.stop=function(){this._stopped=!0,this._clean()},o.prototype._end=function(){this.emit("end"),this._clean()},o.prototype._error=function(e){this.emit("error",e),this._clean()},o.prototype._result=function(e){this.emit("result",e)},o.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{6:6,9:9}],18:[function(e,t,r){function o(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}}var n=e(25);t.exports=o,o.prototype.clearCache=function(){this.cache={}},o.prototype.search=n("query"),o.prototype.similarSearch=n("similarQuery"),o.prototype.browse=function(t,r,o){var n,i,s=e(32),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(n=0,o=arguments[0],t=void 0):"number"==typeof arguments[0]?(n=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(o=arguments[1],i=void 0),t=void 0,r=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(o=arguments[1]),r=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(o=arguments[1],r=void 0),r=s({},r||{},{page:n,hitsPerPage:i,query:t});var c=this.as._getSearchParams(r,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+c,hostType:"read",callback:o})},o.prototype.browseFrom=function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},o.prototype.searchFacet=function(t,r){var o=e(26),n=e(33),i="Usage: index.searchFacet({facetName, facetQuery, ...params}[, callback])";if(void 0===t.facetName||void 0===t.facetQuery)throw new Error(i);var s=t.facetName,a=n(o(t),function(e){return"facetName"===e}),c=this.as._getSearchParams(a,"");return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/facets/"+encodeURIComponent(s)+"/query",hostType:"read",body:{params:c},callback:r})},o.prototype._search=function(e,t,r){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:r})},o.prototype.getObject=function(e,t,r){var o=this;1!==arguments.length&&"function"!=typeof t||(r=t,t=void 0);var n="";if(void 0!==t){n="?attributes=";for(var i=0;i was loaded but did not call our provided callback"),JSONPScriptError:n("JSONPScriptError","