LocalCDN-Firefox-Chrome-Brave/resources/algoliasearch/4.8.3/algoliasearch.min.jsm

2 lines
29 KiB
JavaScript
Raw Normal View History

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).algoliasearch=t()}(this,function(){"use strict";function t(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function g(n){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?t(Object(a),!0).forEach(function(e){var t,r;t=n,e=a[r=e],r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))})}return n}function d(e,t){if(null==e)return{};var r,n=function(e,t){if(null==e)return{};for(var r,n={},a=Object.keys(e),o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,a=!1,o=void 0;try{for(var u,s=e[Symbol.iterator]();!(n=(u=s.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw o}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function v(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e){var o=0<arguments.length&&void 0!==e?e:{serializable:!0},u={};return{get:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},e=JSON.stringify(e);if(e in u)return Promise.resolve(o.serializable?JSON.parse(u[e]):u[e]);var n=t(),a=r&&r.miss||function(){return Promise.resolve()};return n.then(function(e){return a(e)}).then(function(){return n})},set:function(e,t){return u[JSON.stringify(e)]=o.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete:function(e){return delete u[JSON.stringify(e)],Promise.resolve()},clear:function(){return u={},Promise.resolve()}}}function h(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===P.WithinHeaders?n:{}},queryParameters:function(){return e===P.WithinQueryParameters?n:{}}}}function s(r){var n=0;return r(function t(){return n++,new Promise(function(e){setTimeout(function(){e(r(t))},Math.min(100*n,1e3))})})}function m(e,t){var r=1<arguments.length&&void 0!==t?t:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(t){return m(e.then(function(e){return Promise.all([r(e,t),e])}).then(function(e){return e[1]}))}})}function y(t,r){return r&&Object.keys(r).forEach(function(e){t[e]=r[e](t)}),t}function b(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var a=0;return e.replace(/%s/g,function(){return encodeURIComponent(r[a++])})}var P={WithinQueryParameters:0,WithinHeaders:1};function O(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach(function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])}),{data:0<Object.entries(n).length?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var w={Read:1,Write:2,Any:3},a=1,j=2,I=3;function x(e,t){t=1<arguments.length&&void 0!==t?t:a;return g(g({},e),{},{status:t,lastUpdate:Date.now()})}function q(e){return"string"==typeof e?{pro