react-instantsearch 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ui/SearchBox.js +6 -2
- package/dist/cjs/ui/SortBy.js +2 -1
- package/dist/cjs/widgets/Stats.js +29 -1
- package/dist/es/ui/SearchBox.js +6 -2
- package/dist/es/ui/SortBy.js +2 -1
- package/dist/es/widgets/Stats.js +29 -1
- package/dist/umd/ReactInstantSearch.js +551 -356
- package/dist/umd/ReactInstantSearch.js.map +1 -1
- package/dist/umd/ReactInstantSearch.min.js +1 -1
- package/dist/umd/ReactInstantSearch.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
var React__default = 'default' in React ? React['default'] : React;
|
|
9
9
|
|
|
10
|
-
var version = '7.
|
|
10
|
+
var version = '7.4.0';
|
|
11
11
|
|
|
12
12
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
13
13
|
//
|
|
@@ -7506,6 +7506,55 @@
|
|
|
7506
7506
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
7507
7507
|
}, _typeof$6(obj);
|
|
7508
7508
|
}
|
|
7509
|
+
function _slicedToArray$3(arr, i) {
|
|
7510
|
+
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$3();
|
|
7511
|
+
}
|
|
7512
|
+
function _nonIterableRest$3() {
|
|
7513
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7514
|
+
}
|
|
7515
|
+
function _unsupportedIterableToArray$3(o, minLen) {
|
|
7516
|
+
if (!o) return;
|
|
7517
|
+
if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
|
7518
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
7519
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
7520
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
7521
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
|
7522
|
+
}
|
|
7523
|
+
function _arrayLikeToArray$3(arr, len) {
|
|
7524
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
7525
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
7526
|
+
return arr2;
|
|
7527
|
+
}
|
|
7528
|
+
function _iterableToArrayLimit$3(arr, i) {
|
|
7529
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7530
|
+
if (null != _i) {
|
|
7531
|
+
var _s,
|
|
7532
|
+
_e,
|
|
7533
|
+
_x,
|
|
7534
|
+
_r,
|
|
7535
|
+
_arr = [],
|
|
7536
|
+
_n = !0,
|
|
7537
|
+
_d = !1;
|
|
7538
|
+
try {
|
|
7539
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
7540
|
+
if (Object(_i) !== _i) return;
|
|
7541
|
+
_n = !1;
|
|
7542
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
7543
|
+
} catch (err) {
|
|
7544
|
+
_d = !0, _e = err;
|
|
7545
|
+
} finally {
|
|
7546
|
+
try {
|
|
7547
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
7548
|
+
} finally {
|
|
7549
|
+
if (_d) throw _e;
|
|
7550
|
+
}
|
|
7551
|
+
}
|
|
7552
|
+
return _arr;
|
|
7553
|
+
}
|
|
7554
|
+
}
|
|
7555
|
+
function _arrayWithHoles$3(arr) {
|
|
7556
|
+
if (Array.isArray(arr)) return arr;
|
|
7557
|
+
}
|
|
7509
7558
|
function ownKeys$5(object, enumerableOnly) {
|
|
7510
7559
|
var keys = Object.keys(object);
|
|
7511
7560
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -7555,8 +7604,6 @@
|
|
|
7555
7604
|
}
|
|
7556
7605
|
return (hint === "string" ? String : Number)(input);
|
|
7557
7606
|
}
|
|
7558
|
-
// @ts-nocheck (types to be fixed during actual implementation)
|
|
7559
|
-
|
|
7560
7607
|
function hydrateSearchClient(client, results) {
|
|
7561
7608
|
if (!results) {
|
|
7562
7609
|
return;
|
|
@@ -7566,9 +7613,22 @@
|
|
|
7566
7613
|
// - Algoliasearch API Client < v4 with cache disabled
|
|
7567
7614
|
// - Third party clients (detected by the `addAlgoliaAgent` function missing)
|
|
7568
7615
|
|
|
7569
|
-
if ((!
|
|
7616
|
+
if ((!('transporter' in client) || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {
|
|
7570
7617
|
return;
|
|
7571
7618
|
}
|
|
7619
|
+
var cachedRequest = Object.keys(results).map(function (key) {
|
|
7620
|
+
return results[key].results.map(function (result) {
|
|
7621
|
+
return {
|
|
7622
|
+
indexName: result.index,
|
|
7623
|
+
// We normalize the params received from the server as they can
|
|
7624
|
+
// be serialized differently depending on the engine.
|
|
7625
|
+
params: serializeQueryParameters(deserializeQueryParameters(result.params))
|
|
7626
|
+
};
|
|
7627
|
+
});
|
|
7628
|
+
});
|
|
7629
|
+
var cachedResults = Object.keys(results).reduce(function (acc, key) {
|
|
7630
|
+
return acc.concat(results[key].results);
|
|
7631
|
+
}, []);
|
|
7572
7632
|
|
|
7573
7633
|
// Algoliasearch API Client >= v4
|
|
7574
7634
|
// To hydrate the client we need to populate the cache with the data from
|
|
@@ -7577,9 +7637,10 @@
|
|
|
7577
7637
|
// for us to compute the key the same way as `algoliasearch-client` we need
|
|
7578
7638
|
// to populate it on a custom key and override the `search` method to
|
|
7579
7639
|
// search on it first.
|
|
7580
|
-
if (
|
|
7640
|
+
if ('transporter' in client && !client._cacheHydrated) {
|
|
7581
7641
|
client._cacheHydrated = true;
|
|
7582
7642
|
var baseMethod = client.search;
|
|
7643
|
+
// @ts-ignore wanting type checks for v3 on this would make this too complex
|
|
7583
7644
|
client.search = function (requests) {
|
|
7584
7645
|
for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
7585
7646
|
methodArgs[_key - 1] = arguments[_key];
|
|
@@ -7596,22 +7657,11 @@
|
|
|
7596
7657
|
return baseMethod.apply(void 0, [requests].concat(methodArgs));
|
|
7597
7658
|
});
|
|
7598
7659
|
};
|
|
7599
|
-
|
|
7600
|
-
// Populate the cache with the data from the server
|
|
7601
7660
|
client.transporter.responsesCache.set({
|
|
7602
7661
|
method: 'search',
|
|
7603
|
-
args:
|
|
7604
|
-
return acc.concat(results[key].results.map(function (request) {
|
|
7605
|
-
return {
|
|
7606
|
-
indexName: request.index,
|
|
7607
|
-
params: request.params
|
|
7608
|
-
};
|
|
7609
|
-
}));
|
|
7610
|
-
}, [])]
|
|
7662
|
+
args: cachedRequest
|
|
7611
7663
|
}, {
|
|
7612
|
-
results:
|
|
7613
|
-
return acc.concat(results[key].results);
|
|
7614
|
-
}, [])
|
|
7664
|
+
results: cachedResults
|
|
7615
7665
|
});
|
|
7616
7666
|
}
|
|
7617
7667
|
|
|
@@ -7621,24 +7671,27 @@
|
|
|
7621
7671
|
// a single-index result. You can find more information about the
|
|
7622
7672
|
// computation of the key inside the client (see link below).
|
|
7623
7673
|
// https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240
|
|
7624
|
-
if (!client
|
|
7674
|
+
if (!('transporter' in client)) {
|
|
7625
7675
|
var cacheKey = "/1/indexes/*/queries_body_".concat(JSON.stringify({
|
|
7626
|
-
requests:
|
|
7627
|
-
return acc.concat(results[key].rawResults.map(function (request) {
|
|
7628
|
-
return {
|
|
7629
|
-
indexName: request.index,
|
|
7630
|
-
params: request.params
|
|
7631
|
-
};
|
|
7632
|
-
}));
|
|
7633
|
-
}, [])
|
|
7676
|
+
requests: cachedRequest
|
|
7634
7677
|
}));
|
|
7635
7678
|
client.cache = _objectSpread$5(_objectSpread$5({}, client.cache), {}, _defineProperty$5({}, cacheKey, JSON.stringify({
|
|
7636
|
-
results: Object.keys(results).
|
|
7637
|
-
return
|
|
7638
|
-
}
|
|
7679
|
+
results: Object.keys(results).map(function (key) {
|
|
7680
|
+
return results[key].results;
|
|
7681
|
+
})
|
|
7639
7682
|
})));
|
|
7640
7683
|
}
|
|
7641
7684
|
}
|
|
7685
|
+
function deserializeQueryParameters(parameters) {
|
|
7686
|
+
return parameters.split('&').reduce(function (acc, parameter) {
|
|
7687
|
+
var _parameter$split = parameter.split('='),
|
|
7688
|
+
_parameter$split2 = _slicedToArray$3(_parameter$split, 2),
|
|
7689
|
+
key = _parameter$split2[0],
|
|
7690
|
+
value = _parameter$split2[1];
|
|
7691
|
+
acc[key] = value ? decodeURIComponent(value) : '';
|
|
7692
|
+
return acc;
|
|
7693
|
+
}, {});
|
|
7694
|
+
}
|
|
7642
7695
|
|
|
7643
7696
|
// This function is copied from the algoliasearch v4 API Client. If modified,
|
|
7644
7697
|
// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.
|
|
@@ -7902,26 +7955,26 @@
|
|
|
7902
7955
|
};
|
|
7903
7956
|
|
|
7904
7957
|
function _toConsumableArray(arr) {
|
|
7905
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$
|
|
7958
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread();
|
|
7906
7959
|
}
|
|
7907
7960
|
function _nonIterableSpread() {
|
|
7908
7961
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7909
7962
|
}
|
|
7910
|
-
function _unsupportedIterableToArray$
|
|
7963
|
+
function _unsupportedIterableToArray$4(o, minLen) {
|
|
7911
7964
|
if (!o) return;
|
|
7912
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
7965
|
+
if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
|
|
7913
7966
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
7914
7967
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
7915
7968
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
7916
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
7969
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
|
|
7917
7970
|
}
|
|
7918
7971
|
function _iterableToArray(iter) {
|
|
7919
7972
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
7920
7973
|
}
|
|
7921
7974
|
function _arrayWithoutHoles(arr) {
|
|
7922
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
7975
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$4(arr);
|
|
7923
7976
|
}
|
|
7924
|
-
function _arrayLikeToArray$
|
|
7977
|
+
function _arrayLikeToArray$4(arr, len) {
|
|
7925
7978
|
if (len == null || len > arr.length) len = arr.length;
|
|
7926
7979
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
7927
7980
|
return arr2;
|
|
@@ -8440,26 +8493,26 @@
|
|
|
8440
8493
|
return React.useContext(InstantSearchServerContext);
|
|
8441
8494
|
}
|
|
8442
8495
|
|
|
8443
|
-
function _slicedToArray$
|
|
8444
|
-
return _arrayWithHoles$
|
|
8496
|
+
function _slicedToArray$4(arr, i) {
|
|
8497
|
+
return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i) || _unsupportedIterableToArray$5(arr, i) || _nonIterableRest$4();
|
|
8445
8498
|
}
|
|
8446
|
-
function _nonIterableRest$
|
|
8499
|
+
function _nonIterableRest$4() {
|
|
8447
8500
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8448
8501
|
}
|
|
8449
|
-
function _unsupportedIterableToArray$
|
|
8502
|
+
function _unsupportedIterableToArray$5(o, minLen) {
|
|
8450
8503
|
if (!o) return;
|
|
8451
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
8504
|
+
if (typeof o === "string") return _arrayLikeToArray$5(o, minLen);
|
|
8452
8505
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8453
8506
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
8454
8507
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
8455
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
8508
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen);
|
|
8456
8509
|
}
|
|
8457
|
-
function _arrayLikeToArray$
|
|
8510
|
+
function _arrayLikeToArray$5(arr, len) {
|
|
8458
8511
|
if (len == null || len > arr.length) len = arr.length;
|
|
8459
8512
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
8460
8513
|
return arr2;
|
|
8461
8514
|
}
|
|
8462
|
-
function _iterableToArrayLimit$
|
|
8515
|
+
function _iterableToArrayLimit$4(arr, i) {
|
|
8463
8516
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
8464
8517
|
if (null != _i) {
|
|
8465
8518
|
var _s,
|
|
@@ -8486,14 +8539,14 @@
|
|
|
8486
8539
|
return _arr;
|
|
8487
8540
|
}
|
|
8488
8541
|
}
|
|
8489
|
-
function _arrayWithHoles$
|
|
8542
|
+
function _arrayWithHoles$4(arr) {
|
|
8490
8543
|
if (Array.isArray(arr)) return arr;
|
|
8491
8544
|
}
|
|
8492
8545
|
function useStableValue(value) {
|
|
8493
8546
|
var _useState = React.useState(function () {
|
|
8494
8547
|
return value;
|
|
8495
8548
|
}),
|
|
8496
|
-
_useState2 = _slicedToArray$
|
|
8549
|
+
_useState2 = _slicedToArray$4(_useState, 2),
|
|
8497
8550
|
stableValue = _useState2[0],
|
|
8498
8551
|
setStableValue = _useState2[1];
|
|
8499
8552
|
if (!dequal(stableValue, value)) {
|
|
@@ -8613,26 +8666,26 @@
|
|
|
8613
8666
|
}
|
|
8614
8667
|
var _excluded$1 = ["instantSearchInstance", "widgetParams"],
|
|
8615
8668
|
_excluded2 = ["widgetParams"];
|
|
8616
|
-
function _slicedToArray$
|
|
8617
|
-
return _arrayWithHoles$
|
|
8669
|
+
function _slicedToArray$5(arr, i) {
|
|
8670
|
+
return _arrayWithHoles$5(arr) || _iterableToArrayLimit$5(arr, i) || _unsupportedIterableToArray$6(arr, i) || _nonIterableRest$5();
|
|
8618
8671
|
}
|
|
8619
|
-
function _nonIterableRest$
|
|
8672
|
+
function _nonIterableRest$5() {
|
|
8620
8673
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8621
8674
|
}
|
|
8622
|
-
function _unsupportedIterableToArray$
|
|
8675
|
+
function _unsupportedIterableToArray$6(o, minLen) {
|
|
8623
8676
|
if (!o) return;
|
|
8624
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
8677
|
+
if (typeof o === "string") return _arrayLikeToArray$6(o, minLen);
|
|
8625
8678
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8626
8679
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
8627
8680
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
8628
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
8681
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen);
|
|
8629
8682
|
}
|
|
8630
|
-
function _arrayLikeToArray$
|
|
8683
|
+
function _arrayLikeToArray$6(arr, len) {
|
|
8631
8684
|
if (len == null || len > arr.length) len = arr.length;
|
|
8632
8685
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
8633
8686
|
return arr2;
|
|
8634
8687
|
}
|
|
8635
|
-
function _iterableToArrayLimit$
|
|
8688
|
+
function _iterableToArrayLimit$5(arr, i) {
|
|
8636
8689
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
8637
8690
|
if (null != _i) {
|
|
8638
8691
|
var _s,
|
|
@@ -8659,7 +8712,7 @@
|
|
|
8659
8712
|
return _arr;
|
|
8660
8713
|
}
|
|
8661
8714
|
}
|
|
8662
|
-
function _arrayWithHoles$
|
|
8715
|
+
function _arrayWithHoles$5(arr) {
|
|
8663
8716
|
if (Array.isArray(arr)) return arr;
|
|
8664
8717
|
}
|
|
8665
8718
|
function ownKeys$a(object, enumerableOnly) {
|
|
@@ -8833,7 +8886,7 @@
|
|
|
8833
8886
|
}
|
|
8834
8887
|
return {};
|
|
8835
8888
|
}),
|
|
8836
|
-
_useState2 = _slicedToArray$
|
|
8889
|
+
_useState2 = _slicedToArray$5(_useState, 2),
|
|
8837
8890
|
state = _useState2[0],
|
|
8838
8891
|
setState = _useState2[1];
|
|
8839
8892
|
useWidget({
|
|
@@ -8939,8 +8992,8 @@
|
|
|
8939
8992
|
}))) {
|
|
8940
8993
|
throw new Error(withUsage$1('The `widgets` option expects an array of widgets.'));
|
|
8941
8994
|
}
|
|
8942
|
-
if (!
|
|
8943
|
-
throw new Error(withUsage$1("The `facets` option only accepts
|
|
8995
|
+
if (!Array.isArray(facets)) {
|
|
8996
|
+
throw new Error(withUsage$1("The `facets` option only accepts an array of facets, you passed ".concat(JSON.stringify(facets))));
|
|
8944
8997
|
}
|
|
8945
8998
|
var localWidgets = new Map();
|
|
8946
8999
|
return {
|
|
@@ -9018,7 +9071,6 @@
|
|
|
9018
9071
|
unmountFn();
|
|
9019
9072
|
},
|
|
9020
9073
|
getWidgetSearchParameters: function getWidgetSearchParameters(state) {
|
|
9021
|
-
// broadening the scope of facets to avoid conflict between never and *
|
|
9022
9074
|
return facets.reduce(function (acc, curr) {
|
|
9023
9075
|
return acc.addFacet(curr);
|
|
9024
9076
|
}, state.setQueryParameters({
|
|
@@ -9265,26 +9317,26 @@
|
|
|
9265
9317
|
return (hint === "string" ? String : Number)(input);
|
|
9266
9318
|
}
|
|
9267
9319
|
function _toConsumableArray$1(arr) {
|
|
9268
|
-
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$
|
|
9320
|
+
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$7(arr) || _nonIterableSpread$1();
|
|
9269
9321
|
}
|
|
9270
9322
|
function _nonIterableSpread$1() {
|
|
9271
9323
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9272
9324
|
}
|
|
9273
|
-
function _unsupportedIterableToArray$
|
|
9325
|
+
function _unsupportedIterableToArray$7(o, minLen) {
|
|
9274
9326
|
if (!o) return;
|
|
9275
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
9327
|
+
if (typeof o === "string") return _arrayLikeToArray$7(o, minLen);
|
|
9276
9328
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
9277
9329
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
9278
9330
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
9279
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
9331
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen);
|
|
9280
9332
|
}
|
|
9281
9333
|
function _iterableToArray$1(iter) {
|
|
9282
9334
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
9283
9335
|
}
|
|
9284
9336
|
function _arrayWithoutHoles$1(arr) {
|
|
9285
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
9337
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$7(arr);
|
|
9286
9338
|
}
|
|
9287
|
-
function _arrayLikeToArray$
|
|
9339
|
+
function _arrayLikeToArray$7(arr, len) {
|
|
9288
9340
|
if (len == null || len > arr.length) len = arr.length;
|
|
9289
9341
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
9290
9342
|
return arr2;
|
|
@@ -9786,26 +9838,26 @@
|
|
|
9786
9838
|
instantSearchInstance.renderState = _objectSpread$d(_objectSpread$d({}, instantSearchInstance.renderState), {}, _defineProperty$d({}, parentIndexName, _objectSpread$d(_objectSpread$d({}, instantSearchInstance.renderState[parentIndexName]), renderState)));
|
|
9787
9839
|
}
|
|
9788
9840
|
|
|
9789
|
-
function _slicedToArray$
|
|
9790
|
-
return _arrayWithHoles$
|
|
9841
|
+
function _slicedToArray$6(arr, i) {
|
|
9842
|
+
return _arrayWithHoles$6(arr) || _iterableToArrayLimit$6(arr, i) || _unsupportedIterableToArray$8(arr, i) || _nonIterableRest$6();
|
|
9791
9843
|
}
|
|
9792
|
-
function _nonIterableRest$
|
|
9844
|
+
function _nonIterableRest$6() {
|
|
9793
9845
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9794
9846
|
}
|
|
9795
|
-
function _unsupportedIterableToArray$
|
|
9847
|
+
function _unsupportedIterableToArray$8(o, minLen) {
|
|
9796
9848
|
if (!o) return;
|
|
9797
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
9849
|
+
if (typeof o === "string") return _arrayLikeToArray$8(o, minLen);
|
|
9798
9850
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
9799
9851
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
9800
9852
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
9801
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
9853
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$8(o, minLen);
|
|
9802
9854
|
}
|
|
9803
|
-
function _arrayLikeToArray$
|
|
9855
|
+
function _arrayLikeToArray$8(arr, len) {
|
|
9804
9856
|
if (len == null || len > arr.length) len = arr.length;
|
|
9805
9857
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
9806
9858
|
return arr2;
|
|
9807
9859
|
}
|
|
9808
|
-
function _iterableToArrayLimit$
|
|
9860
|
+
function _iterableToArrayLimit$6(arr, i) {
|
|
9809
9861
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
9810
9862
|
if (null != _i) {
|
|
9811
9863
|
var _s,
|
|
@@ -9832,7 +9884,7 @@
|
|
|
9832
9884
|
return _arr;
|
|
9833
9885
|
}
|
|
9834
9886
|
}
|
|
9835
|
-
function _arrayWithHoles$
|
|
9887
|
+
function _arrayWithHoles$6(arr) {
|
|
9836
9888
|
if (Array.isArray(arr)) return arr;
|
|
9837
9889
|
}
|
|
9838
9890
|
|
|
@@ -9844,7 +9896,7 @@
|
|
|
9844
9896
|
var _useReducer = React.useReducer(function (x) {
|
|
9845
9897
|
return x + 1;
|
|
9846
9898
|
}, 0),
|
|
9847
|
-
_useReducer2 = _slicedToArray$
|
|
9899
|
+
_useReducer2 = _slicedToArray$6(_useReducer, 2),
|
|
9848
9900
|
forceUpdate = _useReducer2[1];
|
|
9849
9901
|
return forceUpdate;
|
|
9850
9902
|
}
|
|
@@ -10153,13 +10205,13 @@
|
|
|
10153
10205
|
}
|
|
10154
10206
|
return (hint === "string" ? String : Number)(input);
|
|
10155
10207
|
}
|
|
10156
|
-
function _slicedToArray$
|
|
10157
|
-
return _arrayWithHoles$
|
|
10208
|
+
function _slicedToArray$7(arr, i) {
|
|
10209
|
+
return _arrayWithHoles$7(arr) || _iterableToArrayLimit$7(arr, i) || _unsupportedIterableToArray$9(arr, i) || _nonIterableRest$7();
|
|
10158
10210
|
}
|
|
10159
|
-
function _nonIterableRest$
|
|
10211
|
+
function _nonIterableRest$7() {
|
|
10160
10212
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10161
10213
|
}
|
|
10162
|
-
function _iterableToArrayLimit$
|
|
10214
|
+
function _iterableToArrayLimit$7(arr, i) {
|
|
10163
10215
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
10164
10216
|
if (null != _i) {
|
|
10165
10217
|
var _s,
|
|
@@ -10186,30 +10238,30 @@
|
|
|
10186
10238
|
return _arr;
|
|
10187
10239
|
}
|
|
10188
10240
|
}
|
|
10189
|
-
function _arrayWithHoles$
|
|
10241
|
+
function _arrayWithHoles$7(arr) {
|
|
10190
10242
|
if (Array.isArray(arr)) return arr;
|
|
10191
10243
|
}
|
|
10192
10244
|
function _toConsumableArray$2(arr) {
|
|
10193
|
-
return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$
|
|
10245
|
+
return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$9(arr) || _nonIterableSpread$2();
|
|
10194
10246
|
}
|
|
10195
10247
|
function _nonIterableSpread$2() {
|
|
10196
10248
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10197
10249
|
}
|
|
10198
|
-
function _unsupportedIterableToArray$
|
|
10250
|
+
function _unsupportedIterableToArray$9(o, minLen) {
|
|
10199
10251
|
if (!o) return;
|
|
10200
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
10252
|
+
if (typeof o === "string") return _arrayLikeToArray$9(o, minLen);
|
|
10201
10253
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
10202
10254
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
10203
10255
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
10204
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
10256
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$9(o, minLen);
|
|
10205
10257
|
}
|
|
10206
10258
|
function _iterableToArray$2(iter) {
|
|
10207
10259
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
10208
10260
|
}
|
|
10209
10261
|
function _arrayWithoutHoles$2(arr) {
|
|
10210
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
10262
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$9(arr);
|
|
10211
10263
|
}
|
|
10212
|
-
function _arrayLikeToArray$
|
|
10264
|
+
function _arrayLikeToArray$9(arr, len) {
|
|
10213
10265
|
if (len == null || len > arr.length) len = arr.length;
|
|
10214
10266
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
10215
10267
|
return arr2;
|
|
@@ -10265,7 +10317,7 @@
|
|
|
10265
10317
|
});
|
|
10266
10318
|
instantSearchInstance.unuse.apply(instantSearchInstance, _toConsumableArray$2(existingInsightsMiddlewares));
|
|
10267
10319
|
var _getAppIdAndApiKey = getAppIdAndApiKey(instantSearchInstance.client),
|
|
10268
|
-
_getAppIdAndApiKey2 = _slicedToArray$
|
|
10320
|
+
_getAppIdAndApiKey2 = _slicedToArray$7(_getAppIdAndApiKey, 2),
|
|
10269
10321
|
appId = _getAppIdAndApiKey2[0],
|
|
10270
10322
|
apiKey = _getAppIdAndApiKey2[1];
|
|
10271
10323
|
var queuedUserToken = undefined;
|
|
@@ -10282,11 +10334,11 @@
|
|
|
10282
10334
|
// we still want to read the token from the queue.
|
|
10283
10335
|
// Otherwise, the first search call will be fired without the token.
|
|
10284
10336
|
var _ref3 = find$1(insightsClient.queue.slice().reverse(), function (_ref5) {
|
|
10285
|
-
var _ref6 = _slicedToArray$
|
|
10337
|
+
var _ref6 = _slicedToArray$7(_ref5, 1),
|
|
10286
10338
|
method = _ref6[0];
|
|
10287
10339
|
return method === 'setUserToken';
|
|
10288
10340
|
}) || [];
|
|
10289
|
-
var _ref4 = _slicedToArray$
|
|
10341
|
+
var _ref4 = _slicedToArray$7(_ref3, 2);
|
|
10290
10342
|
queuedUserToken = _ref4[1];
|
|
10291
10343
|
}
|
|
10292
10344
|
insightsClient('getUserToken', null, function (_error, userToken) {
|
|
@@ -10440,7 +10492,7 @@
|
|
|
10440
10492
|
*/
|
|
10441
10493
|
function isModernInsightsClient(client) {
|
|
10442
10494
|
var _split$map = (client.version || '').split('.').map(Number),
|
|
10443
|
-
_split$map2 = _slicedToArray$
|
|
10495
|
+
_split$map2 = _slicedToArray$7(_split$map, 2),
|
|
10444
10496
|
major = _split$map2[0],
|
|
10445
10497
|
minor = _split$map2[1];
|
|
10446
10498
|
|
|
@@ -12068,7 +12120,7 @@
|
|
|
12068
12120
|
};
|
|
12069
12121
|
}
|
|
12070
12122
|
|
|
12071
|
-
var version$3 = '4.
|
|
12123
|
+
var version$3 = '4.61.0';
|
|
12072
12124
|
|
|
12073
12125
|
function _typeof$o(obj) {
|
|
12074
12126
|
"@babel/helpers - typeof";
|
|
@@ -13207,6 +13259,34 @@
|
|
|
13207
13259
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
13208
13260
|
}, _typeof$r(obj);
|
|
13209
13261
|
}
|
|
13262
|
+
var _excluded$8 = ["hierarchicalMenu"];
|
|
13263
|
+
function _objectWithoutProperties$8(source, excluded) {
|
|
13264
|
+
if (source == null) return {};
|
|
13265
|
+
var target = _objectWithoutPropertiesLoose$9(source, excluded);
|
|
13266
|
+
var key, i;
|
|
13267
|
+
if (Object.getOwnPropertySymbols) {
|
|
13268
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
13269
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
13270
|
+
key = sourceSymbolKeys[i];
|
|
13271
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
13272
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
13273
|
+
target[key] = source[key];
|
|
13274
|
+
}
|
|
13275
|
+
}
|
|
13276
|
+
return target;
|
|
13277
|
+
}
|
|
13278
|
+
function _objectWithoutPropertiesLoose$9(source, excluded) {
|
|
13279
|
+
if (source == null) return {};
|
|
13280
|
+
var target = {};
|
|
13281
|
+
var sourceKeys = Object.keys(source);
|
|
13282
|
+
var key, i;
|
|
13283
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
13284
|
+
key = sourceKeys[i];
|
|
13285
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
13286
|
+
target[key] = source[key];
|
|
13287
|
+
}
|
|
13288
|
+
return target;
|
|
13289
|
+
}
|
|
13210
13290
|
function ownKeys$l(object, enumerableOnly) {
|
|
13211
13291
|
var keys = Object.keys(object);
|
|
13212
13292
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -13256,26 +13336,26 @@
|
|
|
13256
13336
|
}
|
|
13257
13337
|
return (hint === "string" ? String : Number)(input);
|
|
13258
13338
|
}
|
|
13259
|
-
function _slicedToArray$
|
|
13260
|
-
return _arrayWithHoles$
|
|
13339
|
+
function _slicedToArray$8(arr, i) {
|
|
13340
|
+
return _arrayWithHoles$8(arr) || _iterableToArrayLimit$8(arr, i) || _unsupportedIterableToArray$a(arr, i) || _nonIterableRest$8();
|
|
13261
13341
|
}
|
|
13262
|
-
function _nonIterableRest$
|
|
13342
|
+
function _nonIterableRest$8() {
|
|
13263
13343
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
13264
13344
|
}
|
|
13265
|
-
function _unsupportedIterableToArray$
|
|
13345
|
+
function _unsupportedIterableToArray$a(o, minLen) {
|
|
13266
13346
|
if (!o) return;
|
|
13267
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
13347
|
+
if (typeof o === "string") return _arrayLikeToArray$a(o, minLen);
|
|
13268
13348
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
13269
13349
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
13270
13350
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
13271
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
13351
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$a(o, minLen);
|
|
13272
13352
|
}
|
|
13273
|
-
function _arrayLikeToArray$
|
|
13353
|
+
function _arrayLikeToArray$a(arr, len) {
|
|
13274
13354
|
if (len == null || len > arr.length) len = arr.length;
|
|
13275
13355
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13276
13356
|
return arr2;
|
|
13277
13357
|
}
|
|
13278
|
-
function _iterableToArrayLimit$
|
|
13358
|
+
function _iterableToArrayLimit$8(arr, i) {
|
|
13279
13359
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
13280
13360
|
if (null != _i) {
|
|
13281
13361
|
var _s,
|
|
@@ -13302,7 +13382,7 @@
|
|
|
13302
13382
|
return _arr;
|
|
13303
13383
|
}
|
|
13304
13384
|
}
|
|
13305
|
-
function _arrayWithHoles$
|
|
13385
|
+
function _arrayWithHoles$8(arr) {
|
|
13306
13386
|
if (Array.isArray(arr)) return arr;
|
|
13307
13387
|
}
|
|
13308
13388
|
var withUsage$4 = createDocumentationMessageGenerator({
|
|
@@ -13327,7 +13407,7 @@
|
|
|
13327
13407
|
if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {
|
|
13328
13408
|
throw new Error(withUsage$4('The `attributes` option expects an array of strings.'));
|
|
13329
13409
|
}
|
|
13330
|
-
var _attributes = _slicedToArray$
|
|
13410
|
+
var _attributes = _slicedToArray$8(attributes, 1),
|
|
13331
13411
|
hierarchicalFacetName = _attributes[0];
|
|
13332
13412
|
function getRefinedState(state, facetValue) {
|
|
13333
13413
|
if (!facetValue) {
|
|
@@ -13373,7 +13453,7 @@
|
|
|
13373
13453
|
if (!results || state.hierarchicalFacets.length === 0) {
|
|
13374
13454
|
return [];
|
|
13375
13455
|
}
|
|
13376
|
-
var _state$hierarchicalFa = _slicedToArray$
|
|
13456
|
+
var _state$hierarchicalFa = _slicedToArray$8(state.hierarchicalFacets, 1),
|
|
13377
13457
|
facetName = _state$hierarchicalFa[0].name;
|
|
13378
13458
|
var facetValues = results.getFacetValues(facetName, {});
|
|
13379
13459
|
var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];
|
|
@@ -13409,12 +13489,9 @@
|
|
|
13409
13489
|
getWidgetUiState: function getWidgetUiState(uiState, _ref3) {
|
|
13410
13490
|
var searchParameters = _ref3.searchParameters;
|
|
13411
13491
|
var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);
|
|
13412
|
-
|
|
13413
|
-
return uiState;
|
|
13414
|
-
}
|
|
13415
|
-
return _objectSpread$l(_objectSpread$l({}, uiState), {}, {
|
|
13492
|
+
return removeEmptyRefinementsFromUiState(_objectSpread$l(_objectSpread$l({}, uiState), {}, {
|
|
13416
13493
|
hierarchicalMenu: _objectSpread$l(_objectSpread$l({}, uiState.hierarchicalMenu), {}, _defineProperty$m({}, hierarchicalFacetName, path))
|
|
13417
|
-
});
|
|
13494
|
+
}));
|
|
13418
13495
|
},
|
|
13419
13496
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref4) {
|
|
13420
13497
|
var uiState = _ref4.uiState;
|
|
@@ -13463,6 +13540,19 @@
|
|
|
13463
13540
|
};
|
|
13464
13541
|
});
|
|
13465
13542
|
}
|
|
13543
|
+
function removeEmptyRefinementsFromUiState(indexUiState) {
|
|
13544
|
+
var hierarchicalMenu = indexUiState.hierarchicalMenu,
|
|
13545
|
+
indexUiStateBase = _objectWithoutProperties$8(indexUiState, _excluded$8);
|
|
13546
|
+
if (!hierarchicalMenu) {
|
|
13547
|
+
return indexUiState;
|
|
13548
|
+
}
|
|
13549
|
+
var connectorUiState = Object.keys(hierarchicalMenu).reduce(function (acc, key) {
|
|
13550
|
+
return _objectSpread$l(_objectSpread$l({}, acc), hierarchicalMenu[key].length > 0 ? _defineProperty$m({}, key, hierarchicalMenu[key]) : {});
|
|
13551
|
+
}, {});
|
|
13552
|
+
return _objectSpread$l(_objectSpread$l({}, indexUiStateBase), Object.keys(connectorUiState).length > 0 ? {
|
|
13553
|
+
hierarchicalMenu: connectorUiState
|
|
13554
|
+
} : {});
|
|
13555
|
+
}
|
|
13466
13556
|
|
|
13467
13557
|
function useBreadcrumb(props, additionalWidgetProperties) {
|
|
13468
13558
|
return useConnector(connectBreadcrumb, props, additionalWidgetProperties);
|
|
@@ -13478,26 +13568,26 @@
|
|
|
13478
13568
|
}, _typeof$s(obj);
|
|
13479
13569
|
}
|
|
13480
13570
|
function _toConsumableArray$3(arr) {
|
|
13481
|
-
return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$
|
|
13571
|
+
return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$b(arr) || _nonIterableSpread$3();
|
|
13482
13572
|
}
|
|
13483
13573
|
function _nonIterableSpread$3() {
|
|
13484
13574
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
13485
13575
|
}
|
|
13486
|
-
function _unsupportedIterableToArray$
|
|
13576
|
+
function _unsupportedIterableToArray$b(o, minLen) {
|
|
13487
13577
|
if (!o) return;
|
|
13488
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
13578
|
+
if (typeof o === "string") return _arrayLikeToArray$b(o, minLen);
|
|
13489
13579
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
13490
13580
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
13491
13581
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
13492
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
13582
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$b(o, minLen);
|
|
13493
13583
|
}
|
|
13494
13584
|
function _iterableToArray$3(iter) {
|
|
13495
13585
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
13496
13586
|
}
|
|
13497
13587
|
function _arrayWithoutHoles$3(arr) {
|
|
13498
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
13588
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$b(arr);
|
|
13499
13589
|
}
|
|
13500
|
-
function _arrayLikeToArray$
|
|
13590
|
+
function _arrayLikeToArray$b(arr, len) {
|
|
13501
13591
|
if (len == null || len > arr.length) len = arr.length;
|
|
13502
13592
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13503
13593
|
return arr2;
|
|
@@ -13698,26 +13788,26 @@
|
|
|
13698
13788
|
}, _typeof$t(obj);
|
|
13699
13789
|
}
|
|
13700
13790
|
function _toConsumableArray$4(arr) {
|
|
13701
|
-
return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$
|
|
13791
|
+
return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$c(arr) || _nonIterableSpread$4();
|
|
13702
13792
|
}
|
|
13703
13793
|
function _nonIterableSpread$4() {
|
|
13704
13794
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
13705
13795
|
}
|
|
13706
|
-
function _unsupportedIterableToArray$
|
|
13796
|
+
function _unsupportedIterableToArray$c(o, minLen) {
|
|
13707
13797
|
if (!o) return;
|
|
13708
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
13798
|
+
if (typeof o === "string") return _arrayLikeToArray$c(o, minLen);
|
|
13709
13799
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
13710
13800
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
13711
13801
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
13712
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
13802
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen);
|
|
13713
13803
|
}
|
|
13714
13804
|
function _iterableToArray$4(iter) {
|
|
13715
13805
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
13716
13806
|
}
|
|
13717
13807
|
function _arrayWithoutHoles$4(arr) {
|
|
13718
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
13808
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$c(arr);
|
|
13719
13809
|
}
|
|
13720
|
-
function _arrayLikeToArray$
|
|
13810
|
+
function _arrayLikeToArray$c(arr, len) {
|
|
13721
13811
|
if (len == null || len > arr.length) len = arr.length;
|
|
13722
13812
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13723
13813
|
return arr2;
|
|
@@ -14226,7 +14316,8 @@
|
|
|
14226
14316
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
14227
14317
|
}, _typeof$v(obj);
|
|
14228
14318
|
}
|
|
14229
|
-
var _excluded$
|
|
14319
|
+
var _excluded$9 = ["name", "escapedValue", "data", "path"],
|
|
14320
|
+
_excluded2$1 = ["hierarchicalMenu"];
|
|
14230
14321
|
function ownKeys$p(object, enumerableOnly) {
|
|
14231
14322
|
var keys = Object.keys(object);
|
|
14232
14323
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -14276,9 +14367,9 @@
|
|
|
14276
14367
|
}
|
|
14277
14368
|
return (hint === "string" ? String : Number)(input);
|
|
14278
14369
|
}
|
|
14279
|
-
function _objectWithoutProperties$
|
|
14370
|
+
function _objectWithoutProperties$9(source, excluded) {
|
|
14280
14371
|
if (source == null) return {};
|
|
14281
|
-
var target = _objectWithoutPropertiesLoose$
|
|
14372
|
+
var target = _objectWithoutPropertiesLoose$a(source, excluded);
|
|
14282
14373
|
var key, i;
|
|
14283
14374
|
if (Object.getOwnPropertySymbols) {
|
|
14284
14375
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -14291,7 +14382,7 @@
|
|
|
14291
14382
|
}
|
|
14292
14383
|
return target;
|
|
14293
14384
|
}
|
|
14294
|
-
function _objectWithoutPropertiesLoose$
|
|
14385
|
+
function _objectWithoutPropertiesLoose$a(source, excluded) {
|
|
14295
14386
|
if (source == null) return {};
|
|
14296
14387
|
var target = {};
|
|
14297
14388
|
var sourceKeys = Object.keys(source);
|
|
@@ -14303,26 +14394,26 @@
|
|
|
14303
14394
|
}
|
|
14304
14395
|
return target;
|
|
14305
14396
|
}
|
|
14306
|
-
function _slicedToArray$
|
|
14307
|
-
return _arrayWithHoles$
|
|
14397
|
+
function _slicedToArray$9(arr, i) {
|
|
14398
|
+
return _arrayWithHoles$9(arr) || _iterableToArrayLimit$9(arr, i) || _unsupportedIterableToArray$d(arr, i) || _nonIterableRest$9();
|
|
14308
14399
|
}
|
|
14309
|
-
function _nonIterableRest$
|
|
14400
|
+
function _nonIterableRest$9() {
|
|
14310
14401
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14311
14402
|
}
|
|
14312
|
-
function _unsupportedIterableToArray$
|
|
14403
|
+
function _unsupportedIterableToArray$d(o, minLen) {
|
|
14313
14404
|
if (!o) return;
|
|
14314
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
14405
|
+
if (typeof o === "string") return _arrayLikeToArray$d(o, minLen);
|
|
14315
14406
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
14316
14407
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
14317
14408
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
14318
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
14409
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$d(o, minLen);
|
|
14319
14410
|
}
|
|
14320
|
-
function _arrayLikeToArray$
|
|
14411
|
+
function _arrayLikeToArray$d(arr, len) {
|
|
14321
14412
|
if (len == null || len > arr.length) len = arr.length;
|
|
14322
14413
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
14323
14414
|
return arr2;
|
|
14324
14415
|
}
|
|
14325
|
-
function _iterableToArrayLimit$
|
|
14416
|
+
function _iterableToArrayLimit$9(arr, i) {
|
|
14326
14417
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
14327
14418
|
if (null != _i) {
|
|
14328
14419
|
var _s,
|
|
@@ -14349,7 +14440,7 @@
|
|
|
14349
14440
|
return _arr;
|
|
14350
14441
|
}
|
|
14351
14442
|
}
|
|
14352
|
-
function _arrayWithHoles$
|
|
14443
|
+
function _arrayWithHoles$9(arr) {
|
|
14353
14444
|
if (Array.isArray(arr)) return arr;
|
|
14354
14445
|
}
|
|
14355
14446
|
var withUsage$8 = createDocumentationMessageGenerator({
|
|
@@ -14403,7 +14494,7 @@
|
|
|
14403
14494
|
// we need to provide a hierarchicalFacet name for the search state
|
|
14404
14495
|
// so that we can always map $hierarchicalFacetName => real attributes
|
|
14405
14496
|
// we use the first attribute name
|
|
14406
|
-
var _attributes = _slicedToArray$
|
|
14497
|
+
var _attributes = _slicedToArray$9(attributes, 1),
|
|
14407
14498
|
hierarchicalFacetName = _attributes[0];
|
|
14408
14499
|
var sendEvent;
|
|
14409
14500
|
|
|
@@ -14430,7 +14521,7 @@
|
|
|
14430
14521
|
value = _ref2.escapedValue,
|
|
14431
14522
|
data = _ref2.data,
|
|
14432
14523
|
path = _ref2.path,
|
|
14433
|
-
subValue = _objectWithoutProperties$
|
|
14524
|
+
subValue = _objectWithoutProperties$9(_ref2, _excluded$9);
|
|
14434
14525
|
var item = _objectSpread$p(_objectSpread$p({}, subValue), {}, {
|
|
14435
14526
|
value: value,
|
|
14436
14527
|
label: label,
|
|
@@ -14537,12 +14628,9 @@
|
|
|
14537
14628
|
getWidgetUiState: function getWidgetUiState(uiState, _ref5) {
|
|
14538
14629
|
var searchParameters = _ref5.searchParameters;
|
|
14539
14630
|
var path = searchParameters.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);
|
|
14540
|
-
|
|
14541
|
-
return uiState;
|
|
14542
|
-
}
|
|
14543
|
-
return _objectSpread$p(_objectSpread$p({}, uiState), {}, {
|
|
14631
|
+
return removeEmptyRefinementsFromUiState$1(_objectSpread$p(_objectSpread$p({}, uiState), {}, {
|
|
14544
14632
|
hierarchicalMenu: _objectSpread$p(_objectSpread$p({}, uiState.hierarchicalMenu), {}, _defineProperty$q({}, hierarchicalFacetName, path))
|
|
14545
|
-
});
|
|
14633
|
+
}));
|
|
14546
14634
|
},
|
|
14547
14635
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
|
|
14548
14636
|
var uiState = _ref6.uiState;
|
|
@@ -14573,6 +14661,19 @@
|
|
|
14573
14661
|
};
|
|
14574
14662
|
};
|
|
14575
14663
|
};
|
|
14664
|
+
function removeEmptyRefinementsFromUiState$1(indexUiState) {
|
|
14665
|
+
var hierarchicalMenu = indexUiState.hierarchicalMenu,
|
|
14666
|
+
indexUiStateBase = _objectWithoutProperties$9(indexUiState, _excluded2$1);
|
|
14667
|
+
if (!hierarchicalMenu) {
|
|
14668
|
+
return indexUiState;
|
|
14669
|
+
}
|
|
14670
|
+
var connectorUiState = Object.keys(hierarchicalMenu).reduce(function (acc, key) {
|
|
14671
|
+
return _objectSpread$p(_objectSpread$p({}, acc), hierarchicalMenu[key].length > 0 ? _defineProperty$q({}, key, hierarchicalMenu[key]) : {});
|
|
14672
|
+
}, {});
|
|
14673
|
+
return _objectSpread$p(_objectSpread$p({}, indexUiStateBase), Object.keys(connectorUiState).length > 0 ? {
|
|
14674
|
+
hierarchicalMenu: connectorUiState
|
|
14675
|
+
} : {});
|
|
14676
|
+
}
|
|
14576
14677
|
|
|
14577
14678
|
function useHierarchicalMenu(props, additionalWidgetProperties) {
|
|
14578
14679
|
return useConnector(connectHierarchicalMenu, props, additionalWidgetProperties);
|
|
@@ -14749,26 +14850,26 @@
|
|
|
14749
14850
|
}, _typeof$x(obj);
|
|
14750
14851
|
}
|
|
14751
14852
|
function _toConsumableArray$5(arr) {
|
|
14752
|
-
return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$
|
|
14853
|
+
return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$e(arr) || _nonIterableSpread$5();
|
|
14753
14854
|
}
|
|
14754
14855
|
function _nonIterableSpread$5() {
|
|
14755
14856
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14756
14857
|
}
|
|
14757
|
-
function _unsupportedIterableToArray$
|
|
14858
|
+
function _unsupportedIterableToArray$e(o, minLen) {
|
|
14758
14859
|
if (!o) return;
|
|
14759
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
14860
|
+
if (typeof o === "string") return _arrayLikeToArray$e(o, minLen);
|
|
14760
14861
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
14761
14862
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
14762
14863
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
14763
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
14864
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$e(o, minLen);
|
|
14764
14865
|
}
|
|
14765
14866
|
function _iterableToArray$5(iter) {
|
|
14766
14867
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14767
14868
|
}
|
|
14768
14869
|
function _arrayWithoutHoles$5(arr) {
|
|
14769
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
14870
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$e(arr);
|
|
14770
14871
|
}
|
|
14771
|
-
function _arrayLikeToArray$
|
|
14872
|
+
function _arrayLikeToArray$e(arr, len) {
|
|
14772
14873
|
if (len == null || len > arr.length) len = arr.length;
|
|
14773
14874
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
14774
14875
|
return arr2;
|
|
@@ -14970,8 +15071,8 @@
|
|
|
14970
15071
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
14971
15072
|
}, _typeof$y(obj);
|
|
14972
15073
|
}
|
|
14973
|
-
var _excluded$
|
|
14974
|
-
_excluded2$
|
|
15074
|
+
var _excluded$a = ["page"],
|
|
15075
|
+
_excluded2$2 = ["clickAnalytics", "userToken"];
|
|
14975
15076
|
function ownKeys$s(object, enumerableOnly) {
|
|
14976
15077
|
var keys = Object.keys(object);
|
|
14977
15078
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -15022,33 +15123,33 @@
|
|
|
15022
15123
|
return (hint === "string" ? String : Number)(input);
|
|
15023
15124
|
}
|
|
15024
15125
|
function _toConsumableArray$6(arr) {
|
|
15025
|
-
return _arrayWithoutHoles$6(arr) || _iterableToArray$6(arr) || _unsupportedIterableToArray$
|
|
15126
|
+
return _arrayWithoutHoles$6(arr) || _iterableToArray$6(arr) || _unsupportedIterableToArray$f(arr) || _nonIterableSpread$6();
|
|
15026
15127
|
}
|
|
15027
15128
|
function _nonIterableSpread$6() {
|
|
15028
15129
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15029
15130
|
}
|
|
15030
|
-
function _unsupportedIterableToArray$
|
|
15131
|
+
function _unsupportedIterableToArray$f(o, minLen) {
|
|
15031
15132
|
if (!o) return;
|
|
15032
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
15133
|
+
if (typeof o === "string") return _arrayLikeToArray$f(o, minLen);
|
|
15033
15134
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
15034
15135
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
15035
15136
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
15036
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
15137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$f(o, minLen);
|
|
15037
15138
|
}
|
|
15038
15139
|
function _iterableToArray$6(iter) {
|
|
15039
15140
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
15040
15141
|
}
|
|
15041
15142
|
function _arrayWithoutHoles$6(arr) {
|
|
15042
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
15143
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$f(arr);
|
|
15043
15144
|
}
|
|
15044
|
-
function _arrayLikeToArray$
|
|
15145
|
+
function _arrayLikeToArray$f(arr, len) {
|
|
15045
15146
|
if (len == null || len > arr.length) len = arr.length;
|
|
15046
15147
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
15047
15148
|
return arr2;
|
|
15048
15149
|
}
|
|
15049
|
-
function _objectWithoutProperties$
|
|
15150
|
+
function _objectWithoutProperties$a(source, excluded) {
|
|
15050
15151
|
if (source == null) return {};
|
|
15051
|
-
var target = _objectWithoutPropertiesLoose$
|
|
15152
|
+
var target = _objectWithoutPropertiesLoose$b(source, excluded);
|
|
15052
15153
|
var key, i;
|
|
15053
15154
|
if (Object.getOwnPropertySymbols) {
|
|
15054
15155
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -15061,7 +15162,7 @@
|
|
|
15061
15162
|
}
|
|
15062
15163
|
return target;
|
|
15063
15164
|
}
|
|
15064
|
-
function _objectWithoutPropertiesLoose$
|
|
15165
|
+
function _objectWithoutPropertiesLoose$b(source, excluded) {
|
|
15065
15166
|
if (source == null) return {};
|
|
15066
15167
|
var target = {};
|
|
15067
15168
|
var sourceKeys = Object.keys(source);
|
|
@@ -15080,14 +15181,14 @@
|
|
|
15080
15181
|
function getStateWithoutPage(state) {
|
|
15081
15182
|
var _ref = state || {},
|
|
15082
15183
|
page = _ref.page,
|
|
15083
|
-
rest = _objectWithoutProperties$
|
|
15184
|
+
rest = _objectWithoutProperties$a(_ref, _excluded$a);
|
|
15084
15185
|
return rest;
|
|
15085
15186
|
}
|
|
15086
15187
|
function normalizeState(state) {
|
|
15087
15188
|
var _ref2 = state || {},
|
|
15088
15189
|
clickAnalytics = _ref2.clickAnalytics,
|
|
15089
15190
|
userToken = _ref2.userToken,
|
|
15090
|
-
rest = _objectWithoutProperties$
|
|
15191
|
+
rest = _objectWithoutProperties$a(_ref2, _excluded2$2);
|
|
15091
15192
|
return rest;
|
|
15092
15193
|
}
|
|
15093
15194
|
function getInMemoryCache() {
|
|
@@ -15320,7 +15421,8 @@
|
|
|
15320
15421
|
return useConnector(connectInfiniteHits, props, additionalWidgetProperties);
|
|
15321
15422
|
}
|
|
15322
15423
|
|
|
15323
|
-
var _excluded$
|
|
15424
|
+
var _excluded$b = ["name", "escapedValue", "path"],
|
|
15425
|
+
_excluded2$3 = ["menu"];
|
|
15324
15426
|
function _typeof$z(obj) {
|
|
15325
15427
|
"@babel/helpers - typeof";
|
|
15326
15428
|
|
|
@@ -15330,9 +15432,9 @@
|
|
|
15330
15432
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
15331
15433
|
}, _typeof$z(obj);
|
|
15332
15434
|
}
|
|
15333
|
-
function _objectWithoutProperties$
|
|
15435
|
+
function _objectWithoutProperties$b(source, excluded) {
|
|
15334
15436
|
if (source == null) return {};
|
|
15335
|
-
var target = _objectWithoutPropertiesLoose$
|
|
15437
|
+
var target = _objectWithoutPropertiesLoose$c(source, excluded);
|
|
15336
15438
|
var key, i;
|
|
15337
15439
|
if (Object.getOwnPropertySymbols) {
|
|
15338
15440
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -15345,7 +15447,7 @@
|
|
|
15345
15447
|
}
|
|
15346
15448
|
return target;
|
|
15347
15449
|
}
|
|
15348
|
-
function _objectWithoutPropertiesLoose$
|
|
15450
|
+
function _objectWithoutPropertiesLoose$c(source, excluded) {
|
|
15349
15451
|
if (source == null) return {};
|
|
15350
15452
|
var target = {};
|
|
15351
15453
|
var sourceKeys = Object.keys(source);
|
|
@@ -15357,26 +15459,26 @@
|
|
|
15357
15459
|
}
|
|
15358
15460
|
return target;
|
|
15359
15461
|
}
|
|
15360
|
-
function _slicedToArray$
|
|
15361
|
-
return _arrayWithHoles$
|
|
15462
|
+
function _slicedToArray$a(arr, i) {
|
|
15463
|
+
return _arrayWithHoles$a(arr) || _iterableToArrayLimit$a(arr, i) || _unsupportedIterableToArray$g(arr, i) || _nonIterableRest$a();
|
|
15362
15464
|
}
|
|
15363
|
-
function _nonIterableRest$
|
|
15465
|
+
function _nonIterableRest$a() {
|
|
15364
15466
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15365
15467
|
}
|
|
15366
|
-
function _unsupportedIterableToArray$
|
|
15468
|
+
function _unsupportedIterableToArray$g(o, minLen) {
|
|
15367
15469
|
if (!o) return;
|
|
15368
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
15470
|
+
if (typeof o === "string") return _arrayLikeToArray$g(o, minLen);
|
|
15369
15471
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
15370
15472
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
15371
15473
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
15372
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
15474
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$g(o, minLen);
|
|
15373
15475
|
}
|
|
15374
|
-
function _arrayLikeToArray$
|
|
15476
|
+
function _arrayLikeToArray$g(arr, len) {
|
|
15375
15477
|
if (len == null || len > arr.length) len = arr.length;
|
|
15376
15478
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
15377
15479
|
return arr2;
|
|
15378
15480
|
}
|
|
15379
|
-
function _iterableToArrayLimit$
|
|
15481
|
+
function _iterableToArrayLimit$a(arr, i) {
|
|
15380
15482
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
15381
15483
|
if (null != _i) {
|
|
15382
15484
|
var _s,
|
|
@@ -15403,7 +15505,7 @@
|
|
|
15403
15505
|
return _arr;
|
|
15404
15506
|
}
|
|
15405
15507
|
}
|
|
15406
|
-
function _arrayWithHoles$
|
|
15508
|
+
function _arrayWithHoles$a(arr) {
|
|
15407
15509
|
if (Array.isArray(arr)) return arr;
|
|
15408
15510
|
}
|
|
15409
15511
|
function ownKeys$t(object, enumerableOnly) {
|
|
@@ -15566,7 +15668,7 @@
|
|
|
15566
15668
|
if (!_refine) {
|
|
15567
15669
|
_refine = function _refine(facetValue) {
|
|
15568
15670
|
var _helper$getHierarchic = helper.getHierarchicalFacetBreadcrumb(attribute),
|
|
15569
|
-
_helper$getHierarchic2 = _slicedToArray$
|
|
15671
|
+
_helper$getHierarchic2 = _slicedToArray$a(_helper$getHierarchic, 1),
|
|
15570
15672
|
refinedItem = _helper$getHierarchic2[0];
|
|
15571
15673
|
sendEvent('click:internal', facetValue ? facetValue : refinedItem);
|
|
15572
15674
|
helper.toggleFacetRefinement(attribute, facetValue ? facetValue : refinedItem).search();
|
|
@@ -15586,7 +15688,7 @@
|
|
|
15586
15688
|
var label = _ref3.name,
|
|
15587
15689
|
value = _ref3.escapedValue,
|
|
15588
15690
|
path = _ref3.path,
|
|
15589
|
-
item = _objectWithoutProperties$
|
|
15691
|
+
item = _objectWithoutProperties$b(_ref3, _excluded$b);
|
|
15590
15692
|
return _objectSpread$t(_objectSpread$t({}, item), {}, {
|
|
15591
15693
|
label: label,
|
|
15592
15694
|
value: value
|
|
@@ -15610,14 +15712,11 @@
|
|
|
15610
15712
|
getWidgetUiState: function getWidgetUiState(uiState, _ref4) {
|
|
15611
15713
|
var searchParameters = _ref4.searchParameters;
|
|
15612
15714
|
var _searchParameters$get = searchParameters.getHierarchicalFacetBreadcrumb(attribute),
|
|
15613
|
-
_searchParameters$get2 = _slicedToArray$
|
|
15715
|
+
_searchParameters$get2 = _slicedToArray$a(_searchParameters$get, 1),
|
|
15614
15716
|
value = _searchParameters$get2[0];
|
|
15615
|
-
|
|
15616
|
-
return uiState;
|
|
15617
|
-
}
|
|
15618
|
-
return _objectSpread$t(_objectSpread$t({}, uiState), {}, {
|
|
15717
|
+
return removeEmptyRefinementsFromUiState$2(_objectSpread$t(_objectSpread$t({}, uiState), {}, {
|
|
15619
15718
|
menu: _objectSpread$t(_objectSpread$t({}, uiState.menu), {}, _defineProperty$u({}, attribute, value))
|
|
15620
|
-
});
|
|
15719
|
+
}));
|
|
15621
15720
|
},
|
|
15622
15721
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {
|
|
15623
15722
|
var uiState = _ref5.uiState;
|
|
@@ -15642,11 +15741,26 @@
|
|
|
15642
15741
|
};
|
|
15643
15742
|
};
|
|
15644
15743
|
};
|
|
15744
|
+
function removeEmptyRefinementsFromUiState$2(indexUiState) {
|
|
15745
|
+
var menu = indexUiState.menu,
|
|
15746
|
+
indexUiStateBase = _objectWithoutProperties$b(indexUiState, _excluded2$3);
|
|
15747
|
+
if (!menu) {
|
|
15748
|
+
return indexUiState;
|
|
15749
|
+
}
|
|
15750
|
+
var connectorUiState = Object.keys(menu).reduce(function (acc, key) {
|
|
15751
|
+
var _menu$key;
|
|
15752
|
+
return _objectSpread$t(_objectSpread$t({}, acc), ((_menu$key = menu[key]) === null || _menu$key === void 0 ? void 0 : _menu$key.length) > 0 ? _defineProperty$u({}, key, menu[key]) : {});
|
|
15753
|
+
}, {});
|
|
15754
|
+
return _objectSpread$t(_objectSpread$t({}, indexUiStateBase), Object.keys(connectorUiState).length > 0 ? {
|
|
15755
|
+
menu: connectorUiState
|
|
15756
|
+
} : {});
|
|
15757
|
+
}
|
|
15645
15758
|
|
|
15646
15759
|
function useMenu(props, additionalWidgetProperties) {
|
|
15647
15760
|
return useConnector(connectMenu, props, additionalWidgetProperties);
|
|
15648
15761
|
}
|
|
15649
15762
|
|
|
15763
|
+
var _excluded$c = ["numericMenu"];
|
|
15650
15764
|
function _typeof$A(obj) {
|
|
15651
15765
|
"@babel/helpers - typeof";
|
|
15652
15766
|
|
|
@@ -15656,10 +15770,37 @@
|
|
|
15656
15770
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
15657
15771
|
}, _typeof$A(obj);
|
|
15658
15772
|
}
|
|
15773
|
+
function _objectWithoutProperties$c(source, excluded) {
|
|
15774
|
+
if (source == null) return {};
|
|
15775
|
+
var target = _objectWithoutPropertiesLoose$d(source, excluded);
|
|
15776
|
+
var key, i;
|
|
15777
|
+
if (Object.getOwnPropertySymbols) {
|
|
15778
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
15779
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
15780
|
+
key = sourceSymbolKeys[i];
|
|
15781
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
15782
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
15783
|
+
target[key] = source[key];
|
|
15784
|
+
}
|
|
15785
|
+
}
|
|
15786
|
+
return target;
|
|
15787
|
+
}
|
|
15788
|
+
function _objectWithoutPropertiesLoose$d(source, excluded) {
|
|
15789
|
+
if (source == null) return {};
|
|
15790
|
+
var target = {};
|
|
15791
|
+
var sourceKeys = Object.keys(source);
|
|
15792
|
+
var key, i;
|
|
15793
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
15794
|
+
key = sourceKeys[i];
|
|
15795
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
15796
|
+
target[key] = source[key];
|
|
15797
|
+
}
|
|
15798
|
+
return target;
|
|
15799
|
+
}
|
|
15659
15800
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
15660
15801
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
15661
15802
|
if (!it) {
|
|
15662
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray$
|
|
15803
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$h(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
15663
15804
|
if (it) o = it;
|
|
15664
15805
|
var i = 0;
|
|
15665
15806
|
var F = function F() {};
|
|
@@ -15707,26 +15848,26 @@
|
|
|
15707
15848
|
}
|
|
15708
15849
|
};
|
|
15709
15850
|
}
|
|
15710
|
-
function _slicedToArray$
|
|
15711
|
-
return _arrayWithHoles$
|
|
15851
|
+
function _slicedToArray$b(arr, i) {
|
|
15852
|
+
return _arrayWithHoles$b(arr) || _iterableToArrayLimit$b(arr, i) || _unsupportedIterableToArray$h(arr, i) || _nonIterableRest$b();
|
|
15712
15853
|
}
|
|
15713
|
-
function _nonIterableRest$
|
|
15854
|
+
function _nonIterableRest$b() {
|
|
15714
15855
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15715
15856
|
}
|
|
15716
|
-
function _unsupportedIterableToArray$
|
|
15857
|
+
function _unsupportedIterableToArray$h(o, minLen) {
|
|
15717
15858
|
if (!o) return;
|
|
15718
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
15859
|
+
if (typeof o === "string") return _arrayLikeToArray$h(o, minLen);
|
|
15719
15860
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
15720
15861
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
15721
15862
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
15722
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
15863
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$h(o, minLen);
|
|
15723
15864
|
}
|
|
15724
|
-
function _arrayLikeToArray$
|
|
15865
|
+
function _arrayLikeToArray$h(arr, len) {
|
|
15725
15866
|
if (len == null || len > arr.length) len = arr.length;
|
|
15726
15867
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
15727
15868
|
return arr2;
|
|
15728
15869
|
}
|
|
15729
|
-
function _iterableToArrayLimit$
|
|
15870
|
+
function _iterableToArrayLimit$b(arr, i) {
|
|
15730
15871
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
15731
15872
|
if (null != _i) {
|
|
15732
15873
|
var _s,
|
|
@@ -15753,7 +15894,7 @@
|
|
|
15753
15894
|
return _arr;
|
|
15754
15895
|
}
|
|
15755
15896
|
}
|
|
15756
|
-
function _arrayWithHoles$
|
|
15897
|
+
function _arrayWithHoles$b(arr) {
|
|
15757
15898
|
if (Array.isArray(arr)) return arr;
|
|
15758
15899
|
}
|
|
15759
15900
|
function ownKeys$u(object, enumerableOnly) {
|
|
@@ -15888,12 +16029,9 @@
|
|
|
15888
16029
|
}
|
|
15889
16030
|
var min = values['>='] && values['>='][0] || '';
|
|
15890
16031
|
var max = values['<='] && values['<='][0] || '';
|
|
15891
|
-
|
|
15892
|
-
return uiState;
|
|
15893
|
-
}
|
|
15894
|
-
return _objectSpread$u(_objectSpread$u({}, uiState), {}, {
|
|
16032
|
+
return removeEmptyRefinementsFromUiState$3(_objectSpread$u(_objectSpread$u({}, uiState), {}, {
|
|
15895
16033
|
numericMenu: _objectSpread$u(_objectSpread$u({}, uiState.numericMenu), {}, _defineProperty$v({}, attribute, "".concat(min, ":").concat(max)))
|
|
15896
|
-
});
|
|
16034
|
+
}));
|
|
15897
16035
|
},
|
|
15898
16036
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
|
|
15899
16037
|
var uiState = _ref6.uiState;
|
|
@@ -15909,7 +16047,7 @@
|
|
|
15909
16047
|
return withoutRefinements.addNumericRefinement(attribute, '=', Number(value));
|
|
15910
16048
|
}
|
|
15911
16049
|
var _value$split$map = value.split(':').map(parseFloat),
|
|
15912
|
-
_value$split$map2 = _slicedToArray$
|
|
16050
|
+
_value$split$map2 = _slicedToArray$b(_value$split$map, 2),
|
|
15913
16051
|
min = _value$split$map2[0],
|
|
15914
16052
|
max = _value$split$map2[1];
|
|
15915
16053
|
var withMinRefinement = isFiniteNumber(min) ? withoutRefinements.addNumericRefinement(attribute, '>=', min) : withoutRefinements;
|
|
@@ -16055,6 +16193,19 @@
|
|
|
16055
16193
|
function hasNumericRefinement(currentRefinements, operator, value) {
|
|
16056
16194
|
return currentRefinements[operator] !== undefined && currentRefinements[operator].includes(value);
|
|
16057
16195
|
}
|
|
16196
|
+
function removeEmptyRefinementsFromUiState$3(indexUiState) {
|
|
16197
|
+
var numericMenu = indexUiState.numericMenu,
|
|
16198
|
+
indexUiStateBase = _objectWithoutProperties$c(indexUiState, _excluded$c);
|
|
16199
|
+
if (!numericMenu) {
|
|
16200
|
+
return indexUiState;
|
|
16201
|
+
}
|
|
16202
|
+
var connectorUiState = Object.keys(numericMenu).reduce(function (acc, key) {
|
|
16203
|
+
return _objectSpread$u(_objectSpread$u({}, acc), numericMenu[key] !== ':' ? _defineProperty$v({}, key, numericMenu[key]) : {});
|
|
16204
|
+
}, {});
|
|
16205
|
+
return _objectSpread$u(_objectSpread$u({}, indexUiStateBase), Object.keys(connectorUiState).length > 0 ? {
|
|
16206
|
+
numericMenu: connectorUiState
|
|
16207
|
+
} : {});
|
|
16208
|
+
}
|
|
16058
16209
|
|
|
16059
16210
|
function useNumericMenu(props, additionalWidgetProperties) {
|
|
16060
16211
|
return useConnector(connectNumericMenu, props, additionalWidgetProperties);
|
|
@@ -16428,26 +16579,26 @@
|
|
|
16428
16579
|
return (hint === "string" ? String : Number)(input);
|
|
16429
16580
|
}
|
|
16430
16581
|
function _toConsumableArray$7(arr) {
|
|
16431
|
-
return _arrayWithoutHoles$7(arr) || _iterableToArray$7(arr) || _unsupportedIterableToArray$
|
|
16582
|
+
return _arrayWithoutHoles$7(arr) || _iterableToArray$7(arr) || _unsupportedIterableToArray$i(arr) || _nonIterableSpread$7();
|
|
16432
16583
|
}
|
|
16433
16584
|
function _nonIterableSpread$7() {
|
|
16434
16585
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16435
16586
|
}
|
|
16436
|
-
function _unsupportedIterableToArray$
|
|
16587
|
+
function _unsupportedIterableToArray$i(o, minLen) {
|
|
16437
16588
|
if (!o) return;
|
|
16438
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
16589
|
+
if (typeof o === "string") return _arrayLikeToArray$i(o, minLen);
|
|
16439
16590
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
16440
16591
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
16441
16592
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
16442
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
16593
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$i(o, minLen);
|
|
16443
16594
|
}
|
|
16444
16595
|
function _iterableToArray$7(iter) {
|
|
16445
16596
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
16446
16597
|
}
|
|
16447
16598
|
function _arrayWithoutHoles$7(arr) {
|
|
16448
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
16599
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$i(arr);
|
|
16449
16600
|
}
|
|
16450
|
-
function _arrayLikeToArray$
|
|
16601
|
+
function _arrayLikeToArray$i(arr, len) {
|
|
16451
16602
|
if (len == null || len > arr.length) len = arr.length;
|
|
16452
16603
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
16453
16604
|
return arr2;
|
|
@@ -16665,26 +16816,26 @@
|
|
|
16665
16816
|
}
|
|
16666
16817
|
return (hint === "string" ? String : Number)(input);
|
|
16667
16818
|
}
|
|
16668
|
-
function _slicedToArray$
|
|
16669
|
-
return _arrayWithHoles$
|
|
16819
|
+
function _slicedToArray$c(arr, i) {
|
|
16820
|
+
return _arrayWithHoles$c(arr) || _iterableToArrayLimit$c(arr, i) || _unsupportedIterableToArray$j(arr, i) || _nonIterableRest$c();
|
|
16670
16821
|
}
|
|
16671
|
-
function _nonIterableRest$
|
|
16822
|
+
function _nonIterableRest$c() {
|
|
16672
16823
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16673
16824
|
}
|
|
16674
|
-
function _unsupportedIterableToArray$
|
|
16825
|
+
function _unsupportedIterableToArray$j(o, minLen) {
|
|
16675
16826
|
if (!o) return;
|
|
16676
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
16827
|
+
if (typeof o === "string") return _arrayLikeToArray$j(o, minLen);
|
|
16677
16828
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
16678
16829
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
16679
16830
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
16680
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
16831
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$j(o, minLen);
|
|
16681
16832
|
}
|
|
16682
|
-
function _arrayLikeToArray$
|
|
16833
|
+
function _arrayLikeToArray$j(arr, len) {
|
|
16683
16834
|
if (len == null || len > arr.length) len = arr.length;
|
|
16684
16835
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
16685
16836
|
return arr2;
|
|
16686
16837
|
}
|
|
16687
|
-
function _iterableToArrayLimit$
|
|
16838
|
+
function _iterableToArrayLimit$c(arr, i) {
|
|
16688
16839
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
16689
16840
|
if (null != _i) {
|
|
16690
16841
|
var _s,
|
|
@@ -16711,7 +16862,7 @@
|
|
|
16711
16862
|
return _arr;
|
|
16712
16863
|
}
|
|
16713
16864
|
}
|
|
16714
|
-
function _arrayWithHoles$
|
|
16865
|
+
function _arrayWithHoles$c(arr) {
|
|
16715
16866
|
if (Array.isArray(arr)) return arr;
|
|
16716
16867
|
}
|
|
16717
16868
|
var withUsage$g = createDocumentationMessageGenerator({
|
|
@@ -16778,10 +16929,10 @@
|
|
|
16778
16929
|
var currentRangeMin = currentRange.min,
|
|
16779
16930
|
currentRangeMax = currentRange.max;
|
|
16780
16931
|
var _ref3 = resolvedState.getNumericRefinement(attribute, '>=') || [],
|
|
16781
|
-
_ref4 = _slicedToArray$
|
|
16932
|
+
_ref4 = _slicedToArray$c(_ref3, 1),
|
|
16782
16933
|
min = _ref4[0];
|
|
16783
16934
|
var _ref5 = resolvedState.getNumericRefinement(attribute, '<=') || [],
|
|
16784
|
-
_ref6 = _slicedToArray$
|
|
16935
|
+
_ref6 = _slicedToArray$c(_ref5, 1),
|
|
16785
16936
|
max = _ref6[0];
|
|
16786
16937
|
var isResetMin = nextMin === undefined || nextMin === '';
|
|
16787
16938
|
var isResetMax = nextMax === undefined || nextMax === '';
|
|
@@ -16861,10 +17012,10 @@
|
|
|
16861
17012
|
}
|
|
16862
17013
|
function _getCurrentRefinement(helper) {
|
|
16863
17014
|
var _ref7 = helper.getNumericRefinement(attribute, '>=') || [],
|
|
16864
|
-
_ref8 = _slicedToArray$
|
|
17015
|
+
_ref8 = _slicedToArray$c(_ref7, 1),
|
|
16865
17016
|
minValue = _ref8[0];
|
|
16866
17017
|
var _ref9 = helper.getNumericRefinement(attribute, '<=') || [],
|
|
16867
|
-
_ref10 = _slicedToArray$
|
|
17018
|
+
_ref10 = _slicedToArray$c(_ref9, 1),
|
|
16868
17019
|
maxValue = _ref10[0];
|
|
16869
17020
|
var min = isFiniteNumber(minValue) ? minValue : -Infinity;
|
|
16870
17021
|
var max = isFiniteNumber(maxValue) ? maxValue : Infinity;
|
|
@@ -16873,7 +17024,7 @@
|
|
|
16873
17024
|
function _refine(helper, currentRange) {
|
|
16874
17025
|
return function () {
|
|
16875
17026
|
var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],
|
|
16876
|
-
_ref12 = _slicedToArray$
|
|
17027
|
+
_ref12 = _slicedToArray$c(_ref11, 2),
|
|
16877
17028
|
nextMin = _ref12[0],
|
|
16878
17029
|
nextMax = _ref12[1];
|
|
16879
17030
|
var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);
|
|
@@ -16972,7 +17123,7 @@
|
|
|
16972
17123
|
return widgetSearchParameters;
|
|
16973
17124
|
}
|
|
16974
17125
|
var _value$split$map = value.split(':').map(parseFloat),
|
|
16975
|
-
_value$split$map2 = _slicedToArray$
|
|
17126
|
+
_value$split$map2 = _slicedToArray$c(_value$split$map, 2),
|
|
16976
17127
|
lowerBound = _value$split$map2[0],
|
|
16977
17128
|
upperBound = _value$split$map2[1];
|
|
16978
17129
|
if (isFiniteNumber(lowerBound) && (!isFiniteNumber(minBound) || minBound < lowerBound)) {
|
|
@@ -17002,8 +17153,9 @@
|
|
|
17002
17153
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
17003
17154
|
}, _typeof$F(obj);
|
|
17004
17155
|
}
|
|
17005
|
-
var _excluded$
|
|
17006
|
-
_excluded2$
|
|
17156
|
+
var _excluded$d = ["name", "escapedValue"],
|
|
17157
|
+
_excluded2$4 = ["escapedValue", "value"],
|
|
17158
|
+
_excluded3 = ["refinementList"];
|
|
17007
17159
|
function ownKeys$y(object, enumerableOnly) {
|
|
17008
17160
|
var keys = Object.keys(object);
|
|
17009
17161
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -17053,9 +17205,9 @@
|
|
|
17053
17205
|
}
|
|
17054
17206
|
return (hint === "string" ? String : Number)(input);
|
|
17055
17207
|
}
|
|
17056
|
-
function _objectWithoutProperties$
|
|
17208
|
+
function _objectWithoutProperties$d(source, excluded) {
|
|
17057
17209
|
if (source == null) return {};
|
|
17058
|
-
var target = _objectWithoutPropertiesLoose$
|
|
17210
|
+
var target = _objectWithoutPropertiesLoose$e(source, excluded);
|
|
17059
17211
|
var key, i;
|
|
17060
17212
|
if (Object.getOwnPropertySymbols) {
|
|
17061
17213
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -17068,7 +17220,7 @@
|
|
|
17068
17220
|
}
|
|
17069
17221
|
return target;
|
|
17070
17222
|
}
|
|
17071
|
-
function _objectWithoutPropertiesLoose$
|
|
17223
|
+
function _objectWithoutPropertiesLoose$e(source, excluded) {
|
|
17072
17224
|
if (source == null) return {};
|
|
17073
17225
|
var target = {};
|
|
17074
17226
|
var sourceKeys = Object.keys(source);
|
|
@@ -17131,7 +17283,7 @@
|
|
|
17131
17283
|
var formatItems = function formatItems(_ref2) {
|
|
17132
17284
|
var label = _ref2.name,
|
|
17133
17285
|
value = _ref2.escapedValue,
|
|
17134
|
-
item = _objectWithoutProperties$
|
|
17286
|
+
item = _objectWithoutProperties$d(_ref2, _excluded$d);
|
|
17135
17287
|
return _objectSpread$y(_objectSpread$y({}, item), {}, {
|
|
17136
17288
|
value: value,
|
|
17137
17289
|
label: label,
|
|
@@ -17188,7 +17340,7 @@
|
|
|
17188
17340
|
var normalizedFacetValues = transformItems(facetValues.map(function (_ref3) {
|
|
17189
17341
|
var escapedValue = _ref3.escapedValue,
|
|
17190
17342
|
value = _ref3.value,
|
|
17191
|
-
item = _objectWithoutProperties$
|
|
17343
|
+
item = _objectWithoutProperties$d(_ref3, _excluded2$4);
|
|
17192
17344
|
return _objectSpread$y(_objectSpread$y({}, item), {}, {
|
|
17193
17345
|
value: escapedValue,
|
|
17194
17346
|
label: value
|
|
@@ -17314,12 +17466,9 @@
|
|
|
17314
17466
|
getWidgetUiState: function getWidgetUiState(uiState, _ref5) {
|
|
17315
17467
|
var searchParameters = _ref5.searchParameters;
|
|
17316
17468
|
var values = operator === 'or' ? searchParameters.getDisjunctiveRefinements(attribute) : searchParameters.getConjunctiveRefinements(attribute);
|
|
17317
|
-
|
|
17318
|
-
return uiState;
|
|
17319
|
-
}
|
|
17320
|
-
return _objectSpread$y(_objectSpread$y({}, uiState), {}, {
|
|
17469
|
+
return removeEmptyRefinementsFromUiState$4(_objectSpread$y(_objectSpread$y({}, uiState), {}, {
|
|
17321
17470
|
refinementList: _objectSpread$y(_objectSpread$y({}, uiState.refinementList), {}, _defineProperty$A({}, attribute, values))
|
|
17322
|
-
});
|
|
17471
|
+
}));
|
|
17323
17472
|
},
|
|
17324
17473
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
|
|
17325
17474
|
var uiState = _ref6.uiState;
|
|
@@ -17347,6 +17496,19 @@
|
|
|
17347
17496
|
};
|
|
17348
17497
|
};
|
|
17349
17498
|
};
|
|
17499
|
+
function removeEmptyRefinementsFromUiState$4(indexUiState) {
|
|
17500
|
+
var refinementList = indexUiState.refinementList,
|
|
17501
|
+
indexUiStateBase = _objectWithoutProperties$d(indexUiState, _excluded3);
|
|
17502
|
+
if (!refinementList) {
|
|
17503
|
+
return indexUiState;
|
|
17504
|
+
}
|
|
17505
|
+
var connectorUiState = Object.keys(refinementList).reduce(function (acc, key) {
|
|
17506
|
+
return _objectSpread$y(_objectSpread$y({}, acc), refinementList[key].length > 0 ? _defineProperty$A({}, key, refinementList[key]) : {});
|
|
17507
|
+
}, {});
|
|
17508
|
+
return _objectSpread$y(_objectSpread$y({}, indexUiStateBase), Object.keys(connectorUiState).length > 0 ? {
|
|
17509
|
+
refinementList: connectorUiState
|
|
17510
|
+
} : {});
|
|
17511
|
+
}
|
|
17350
17512
|
|
|
17351
17513
|
function useRefinementList(props, additionalWidgetProperties) {
|
|
17352
17514
|
return useConnector(connectRefinementList, props, additionalWidgetProperties);
|
|
@@ -17855,26 +18017,26 @@
|
|
|
17855
18017
|
}
|
|
17856
18018
|
return (hint === "string" ? String : Number)(input);
|
|
17857
18019
|
}
|
|
17858
|
-
function _slicedToArray$
|
|
17859
|
-
return _arrayWithHoles$
|
|
18020
|
+
function _slicedToArray$d(arr, i) {
|
|
18021
|
+
return _arrayWithHoles$d(arr) || _iterableToArrayLimit$d(arr, i) || _unsupportedIterableToArray$k(arr, i) || _nonIterableRest$d();
|
|
17860
18022
|
}
|
|
17861
|
-
function _nonIterableRest$
|
|
18023
|
+
function _nonIterableRest$d() {
|
|
17862
18024
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17863
18025
|
}
|
|
17864
|
-
function _unsupportedIterableToArray$
|
|
18026
|
+
function _unsupportedIterableToArray$k(o, minLen) {
|
|
17865
18027
|
if (!o) return;
|
|
17866
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
18028
|
+
if (typeof o === "string") return _arrayLikeToArray$k(o, minLen);
|
|
17867
18029
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
17868
18030
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
17869
18031
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
17870
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
18032
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$k(o, minLen);
|
|
17871
18033
|
}
|
|
17872
|
-
function _arrayLikeToArray$
|
|
18034
|
+
function _arrayLikeToArray$k(arr, len) {
|
|
17873
18035
|
if (len == null || len > arr.length) len = arr.length;
|
|
17874
18036
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
17875
18037
|
return arr2;
|
|
17876
18038
|
}
|
|
17877
|
-
function _iterableToArrayLimit$
|
|
18039
|
+
function _iterableToArrayLimit$d(arr, i) {
|
|
17878
18040
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
17879
18041
|
if (null != _i) {
|
|
17880
18042
|
var _s,
|
|
@@ -17901,7 +18063,7 @@
|
|
|
17901
18063
|
return _arr;
|
|
17902
18064
|
}
|
|
17903
18065
|
}
|
|
17904
|
-
function _arrayWithHoles$
|
|
18066
|
+
function _arrayWithHoles$d(arr) {
|
|
17905
18067
|
if (Array.isArray(arr)) return arr;
|
|
17906
18068
|
}
|
|
17907
18069
|
var withUsage$l = createDocumentationMessageGenerator({
|
|
@@ -17926,7 +18088,7 @@
|
|
|
17926
18088
|
_args$ = args[2],
|
|
17927
18089
|
eventName = _args$ === void 0 ? 'Filter Applied' : _args$;
|
|
17928
18090
|
var _args$0$split = args[0].split(':'),
|
|
17929
|
-
_args$0$split2 = _slicedToArray$
|
|
18091
|
+
_args$0$split2 = _slicedToArray$d(_args$0$split, 2),
|
|
17930
18092
|
eventType = _args$0$split2[0],
|
|
17931
18093
|
eventModifier = _args$0$split2[1];
|
|
17932
18094
|
if (eventType !== 'click' || on === undefined) {
|
|
@@ -18203,26 +18365,26 @@
|
|
|
18203
18365
|
return useConnector(connectToggleRefinement, props, additionalWidgetProperties);
|
|
18204
18366
|
}
|
|
18205
18367
|
|
|
18206
|
-
function _slicedToArray$
|
|
18207
|
-
return _arrayWithHoles$
|
|
18368
|
+
function _slicedToArray$e(arr, i) {
|
|
18369
|
+
return _arrayWithHoles$e(arr) || _iterableToArrayLimit$e(arr, i) || _unsupportedIterableToArray$l(arr, i) || _nonIterableRest$e();
|
|
18208
18370
|
}
|
|
18209
|
-
function _nonIterableRest$
|
|
18371
|
+
function _nonIterableRest$e() {
|
|
18210
18372
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
18211
18373
|
}
|
|
18212
|
-
function _unsupportedIterableToArray$
|
|
18374
|
+
function _unsupportedIterableToArray$l(o, minLen) {
|
|
18213
18375
|
if (!o) return;
|
|
18214
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
18376
|
+
if (typeof o === "string") return _arrayLikeToArray$l(o, minLen);
|
|
18215
18377
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
18216
18378
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
18217
18379
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
18218
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
18380
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$l(o, minLen);
|
|
18219
18381
|
}
|
|
18220
|
-
function _arrayLikeToArray$
|
|
18382
|
+
function _arrayLikeToArray$l(arr, len) {
|
|
18221
18383
|
if (len == null || len > arr.length) len = arr.length;
|
|
18222
18384
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
18223
18385
|
return arr2;
|
|
18224
18386
|
}
|
|
18225
|
-
function _iterableToArrayLimit$
|
|
18387
|
+
function _iterableToArrayLimit$e(arr, i) {
|
|
18226
18388
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
18227
18389
|
if (null != _i) {
|
|
18228
18390
|
var _s,
|
|
@@ -18249,7 +18411,7 @@
|
|
|
18249
18411
|
return _arr;
|
|
18250
18412
|
}
|
|
18251
18413
|
}
|
|
18252
|
-
function _arrayWithHoles$
|
|
18414
|
+
function _arrayWithHoles$e(arr) {
|
|
18253
18415
|
if (Array.isArray(arr)) return arr;
|
|
18254
18416
|
}
|
|
18255
18417
|
function useSearchResults() {
|
|
@@ -18258,7 +18420,7 @@
|
|
|
18258
18420
|
var _useState = React.useState(function () {
|
|
18259
18421
|
return getIndexSearchResults(searchIndex);
|
|
18260
18422
|
}),
|
|
18261
|
-
_useState2 = _slicedToArray$
|
|
18423
|
+
_useState2 = _slicedToArray$e(_useState, 2),
|
|
18262
18424
|
searchResults = _useState2[0],
|
|
18263
18425
|
setSearchResults = _useState2[1];
|
|
18264
18426
|
React.useEffect(function () {
|
|
@@ -18283,26 +18445,26 @@
|
|
|
18283
18445
|
return searchResults;
|
|
18284
18446
|
}
|
|
18285
18447
|
|
|
18286
|
-
function _slicedToArray$
|
|
18287
|
-
return _arrayWithHoles$
|
|
18448
|
+
function _slicedToArray$f(arr, i) {
|
|
18449
|
+
return _arrayWithHoles$f(arr) || _iterableToArrayLimit$f(arr, i) || _unsupportedIterableToArray$m(arr, i) || _nonIterableRest$f();
|
|
18288
18450
|
}
|
|
18289
|
-
function _nonIterableRest$
|
|
18451
|
+
function _nonIterableRest$f() {
|
|
18290
18452
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
18291
18453
|
}
|
|
18292
|
-
function _unsupportedIterableToArray$
|
|
18454
|
+
function _unsupportedIterableToArray$m(o, minLen) {
|
|
18293
18455
|
if (!o) return;
|
|
18294
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
18456
|
+
if (typeof o === "string") return _arrayLikeToArray$m(o, minLen);
|
|
18295
18457
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
18296
18458
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
18297
18459
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
18298
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
18460
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$m(o, minLen);
|
|
18299
18461
|
}
|
|
18300
|
-
function _arrayLikeToArray$
|
|
18462
|
+
function _arrayLikeToArray$m(arr, len) {
|
|
18301
18463
|
if (len == null || len > arr.length) len = arr.length;
|
|
18302
18464
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
18303
18465
|
return arr2;
|
|
18304
18466
|
}
|
|
18305
|
-
function _iterableToArrayLimit$
|
|
18467
|
+
function _iterableToArrayLimit$f(arr, i) {
|
|
18306
18468
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
18307
18469
|
if (null != _i) {
|
|
18308
18470
|
var _s,
|
|
@@ -18329,7 +18491,7 @@
|
|
|
18329
18491
|
return _arr;
|
|
18330
18492
|
}
|
|
18331
18493
|
}
|
|
18332
|
-
function _arrayWithHoles$
|
|
18494
|
+
function _arrayWithHoles$f(arr) {
|
|
18333
18495
|
if (Array.isArray(arr)) return arr;
|
|
18334
18496
|
}
|
|
18335
18497
|
function useSearchState() {
|
|
@@ -18339,14 +18501,14 @@
|
|
|
18339
18501
|
var _useState = React.useState(function () {
|
|
18340
18502
|
return search.getUiState();
|
|
18341
18503
|
}),
|
|
18342
|
-
_useState2 = _slicedToArray$
|
|
18504
|
+
_useState2 = _slicedToArray$f(_useState, 2),
|
|
18343
18505
|
uiState = _useState2[0],
|
|
18344
18506
|
setLocalUiState = _useState2[1];
|
|
18345
18507
|
var indexUiState = uiState[indexId];
|
|
18346
18508
|
var _useState3 = React.useState(function () {
|
|
18347
18509
|
return search.renderState;
|
|
18348
18510
|
}),
|
|
18349
|
-
_useState4 = _slicedToArray$
|
|
18511
|
+
_useState4 = _slicedToArray$f(_useState3, 2),
|
|
18350
18512
|
renderState = _useState4[0],
|
|
18351
18513
|
setRenderState = _useState4[1];
|
|
18352
18514
|
var indexRenderState = renderState[indexId] || {};
|
|
@@ -18648,7 +18810,7 @@
|
|
|
18648
18810
|
});
|
|
18649
18811
|
}
|
|
18650
18812
|
|
|
18651
|
-
function _iterableToArrayLimit$
|
|
18813
|
+
function _iterableToArrayLimit$g(arr, i) {
|
|
18652
18814
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
18653
18815
|
if (null != _i) {
|
|
18654
18816
|
var _s,
|
|
@@ -18724,7 +18886,7 @@
|
|
|
18724
18886
|
};
|
|
18725
18887
|
return _extends$1.apply(this, arguments);
|
|
18726
18888
|
}
|
|
18727
|
-
function _objectWithoutPropertiesLoose$
|
|
18889
|
+
function _objectWithoutPropertiesLoose$f(source, excluded) {
|
|
18728
18890
|
if (source == null) return {};
|
|
18729
18891
|
var target = {};
|
|
18730
18892
|
var sourceKeys = Object.keys(source);
|
|
@@ -18736,9 +18898,9 @@
|
|
|
18736
18898
|
}
|
|
18737
18899
|
return target;
|
|
18738
18900
|
}
|
|
18739
|
-
function _objectWithoutProperties$
|
|
18901
|
+
function _objectWithoutProperties$e(source, excluded) {
|
|
18740
18902
|
if (source == null) return {};
|
|
18741
|
-
var target = _objectWithoutPropertiesLoose$
|
|
18903
|
+
var target = _objectWithoutPropertiesLoose$f(source, excluded);
|
|
18742
18904
|
var key, i;
|
|
18743
18905
|
if (Object.getOwnPropertySymbols) {
|
|
18744
18906
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -18751,26 +18913,26 @@
|
|
|
18751
18913
|
}
|
|
18752
18914
|
return target;
|
|
18753
18915
|
}
|
|
18754
|
-
function _slicedToArray$
|
|
18755
|
-
return _arrayWithHoles$
|
|
18916
|
+
function _slicedToArray$g(arr, i) {
|
|
18917
|
+
return _arrayWithHoles$g(arr) || _iterableToArrayLimit$g(arr, i) || _unsupportedIterableToArray$n(arr, i) || _nonIterableRest$g();
|
|
18756
18918
|
}
|
|
18757
|
-
function _arrayWithHoles$
|
|
18919
|
+
function _arrayWithHoles$g(arr) {
|
|
18758
18920
|
if (Array.isArray(arr)) return arr;
|
|
18759
18921
|
}
|
|
18760
|
-
function _unsupportedIterableToArray$
|
|
18922
|
+
function _unsupportedIterableToArray$n(o, minLen) {
|
|
18761
18923
|
if (!o) return;
|
|
18762
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
18924
|
+
if (typeof o === "string") return _arrayLikeToArray$n(o, minLen);
|
|
18763
18925
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
18764
18926
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
18765
18927
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
18766
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
18928
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$n(o, minLen);
|
|
18767
18929
|
}
|
|
18768
|
-
function _arrayLikeToArray$
|
|
18930
|
+
function _arrayLikeToArray$n(arr, len) {
|
|
18769
18931
|
if (len == null || len > arr.length) len = arr.length;
|
|
18770
18932
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
18771
18933
|
return arr2;
|
|
18772
18934
|
}
|
|
18773
|
-
function _nonIterableRest$
|
|
18935
|
+
function _nonIterableRest$g() {
|
|
18774
18936
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
18775
18937
|
}
|
|
18776
18938
|
function _toPrimitive$G(input, hint) {
|
|
@@ -18800,7 +18962,7 @@
|
|
|
18800
18962
|
return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
|
|
18801
18963
|
}
|
|
18802
18964
|
|
|
18803
|
-
var _excluded$
|
|
18965
|
+
var _excluded$e = ["classNames", "items", "hasItems", "createURL", "onNavigate", "separator", "translations"];
|
|
18804
18966
|
function Breadcrumb(_ref) {
|
|
18805
18967
|
var _ref$classNames = _ref.classNames,
|
|
18806
18968
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -18812,7 +18974,7 @@
|
|
|
18812
18974
|
_ref$separator = _ref.separator,
|
|
18813
18975
|
separator = _ref$separator === void 0 ? '>' : _ref$separator,
|
|
18814
18976
|
translations = _ref.translations,
|
|
18815
|
-
props = _objectWithoutProperties$
|
|
18977
|
+
props = _objectWithoutProperties$e(_ref, _excluded$e);
|
|
18816
18978
|
var handleClick = function handleClick(value) {
|
|
18817
18979
|
return function (event) {
|
|
18818
18980
|
if (!isModifierClick(event)) {
|
|
@@ -18847,14 +19009,14 @@
|
|
|
18847
19009
|
})));
|
|
18848
19010
|
}
|
|
18849
19011
|
|
|
18850
|
-
var _excluded$
|
|
19012
|
+
var _excluded$f = ["attributes", "rootPath", "separator", "transformItems", "translations"];
|
|
18851
19013
|
function Breadcrumb$1(_ref) {
|
|
18852
19014
|
var attributes = _ref.attributes,
|
|
18853
19015
|
rootPath = _ref.rootPath,
|
|
18854
19016
|
separator = _ref.separator,
|
|
18855
19017
|
transformItems = _ref.transformItems,
|
|
18856
19018
|
translations = _ref.translations,
|
|
18857
|
-
props = _objectWithoutProperties$
|
|
19019
|
+
props = _objectWithoutProperties$e(_ref, _excluded$f);
|
|
18858
19020
|
var _useBreadcrumb = useBreadcrumb({
|
|
18859
19021
|
attributes: attributes,
|
|
18860
19022
|
rootPath: rootPath,
|
|
@@ -18878,7 +19040,7 @@
|
|
|
18878
19040
|
return /*#__PURE__*/React__default.createElement(Breadcrumb, _extends$1({}, props, uiProps));
|
|
18879
19041
|
}
|
|
18880
19042
|
|
|
18881
|
-
var _excluded$
|
|
19043
|
+
var _excluded$g = ["classNames", "disabled", "onClick", "translations"];
|
|
18882
19044
|
function ClearRefinements(_ref) {
|
|
18883
19045
|
var _ref$classNames = _ref.classNames,
|
|
18884
19046
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -18887,7 +19049,7 @@
|
|
|
18887
19049
|
_ref$onClick = _ref.onClick,
|
|
18888
19050
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
18889
19051
|
translations = _ref.translations,
|
|
18890
|
-
props = _objectWithoutProperties$
|
|
19052
|
+
props = _objectWithoutProperties$e(_ref, _excluded$g);
|
|
18891
19053
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
18892
19054
|
className: cx('ais-ClearRefinements', classNames.root, props.className)
|
|
18893
19055
|
}), /*#__PURE__*/React__default.createElement("button", {
|
|
@@ -18897,13 +19059,13 @@
|
|
|
18897
19059
|
}, translations.resetButtonText));
|
|
18898
19060
|
}
|
|
18899
19061
|
|
|
18900
|
-
var _excluded$
|
|
19062
|
+
var _excluded$h = ["includedAttributes", "excludedAttributes", "transformItems", "translations"];
|
|
18901
19063
|
function ClearRefinements$1(_ref) {
|
|
18902
19064
|
var includedAttributes = _ref.includedAttributes,
|
|
18903
19065
|
excludedAttributes = _ref.excludedAttributes,
|
|
18904
19066
|
transformItems = _ref.transformItems,
|
|
18905
19067
|
translations = _ref.translations,
|
|
18906
|
-
props = _objectWithoutProperties$
|
|
19068
|
+
props = _objectWithoutProperties$e(_ref, _excluded$h);
|
|
18907
19069
|
var _useClearRefinements = useClearRefinements({
|
|
18908
19070
|
includedAttributes: includedAttributes,
|
|
18909
19071
|
excludedAttributes: excludedAttributes,
|
|
@@ -18927,7 +19089,7 @@
|
|
|
18927
19089
|
return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);
|
|
18928
19090
|
}
|
|
18929
19091
|
|
|
18930
|
-
var _excluded$
|
|
19092
|
+
var _excluded$i = ["classNames", "items", "hasRefinements"];
|
|
18931
19093
|
function CurrentRefinements(_ref) {
|
|
18932
19094
|
var _ref$classNames = _ref.classNames,
|
|
18933
19095
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -18935,7 +19097,7 @@
|
|
|
18935
19097
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
18936
19098
|
_ref$hasRefinements = _ref.hasRefinements,
|
|
18937
19099
|
hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
|
|
18938
|
-
props = _objectWithoutProperties$
|
|
19100
|
+
props = _objectWithoutProperties$e(_ref, _excluded$i);
|
|
18939
19101
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
18940
19102
|
className: cx('ais-CurrentRefinements', classNames.root, !hasRefinements && cx('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
|
|
18941
19103
|
}), /*#__PURE__*/React__default.createElement("ul", {
|
|
@@ -18967,12 +19129,12 @@
|
|
|
18967
19129
|
})));
|
|
18968
19130
|
}
|
|
18969
19131
|
|
|
18970
|
-
var _excluded$
|
|
19132
|
+
var _excluded$j = ["includedAttributes", "excludedAttributes", "transformItems"];
|
|
18971
19133
|
function CurrentRefinements$1(_ref) {
|
|
18972
19134
|
var includedAttributes = _ref.includedAttributes,
|
|
18973
19135
|
excludedAttributes = _ref.excludedAttributes,
|
|
18974
19136
|
transformItems = _ref.transformItems,
|
|
18975
|
-
props = _objectWithoutProperties$
|
|
19137
|
+
props = _objectWithoutProperties$e(_ref, _excluded$j);
|
|
18976
19138
|
var _useCurrentRefinement = useCurrentRefinements({
|
|
18977
19139
|
includedAttributes: includedAttributes,
|
|
18978
19140
|
excludedAttributes: excludedAttributes,
|
|
@@ -18989,17 +19151,17 @@
|
|
|
18989
19151
|
return /*#__PURE__*/React__default.createElement(CurrentRefinements, _extends$1({}, props, uiProps));
|
|
18990
19152
|
}
|
|
18991
19153
|
|
|
18992
|
-
var _excluded$
|
|
19154
|
+
var _excluded$k = ["isShowingMore", "translations"];
|
|
18993
19155
|
function ShowMoreButton(_ref) {
|
|
18994
19156
|
var isShowingMore = _ref.isShowingMore,
|
|
18995
19157
|
translations = _ref.translations,
|
|
18996
|
-
props = _objectWithoutProperties$
|
|
19158
|
+
props = _objectWithoutProperties$e(_ref, _excluded$k);
|
|
18997
19159
|
return /*#__PURE__*/React__default.createElement("button", props, translations.showMoreButtonText({
|
|
18998
19160
|
isShowingMore: isShowingMore
|
|
18999
19161
|
}));
|
|
19000
19162
|
}
|
|
19001
19163
|
|
|
19002
|
-
var _excluded$
|
|
19164
|
+
var _excluded$l = ["classNames", "items", "hasItems", "onNavigate", "createURL", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "translations"];
|
|
19003
19165
|
function HierarchicalList(_ref) {
|
|
19004
19166
|
var className = _ref.className,
|
|
19005
19167
|
_ref$classNames = _ref.classNames,
|
|
@@ -19051,7 +19213,7 @@
|
|
|
19051
19213
|
onToggleShowMore = _ref2.onToggleShowMore,
|
|
19052
19214
|
isShowingMore = _ref2.isShowingMore,
|
|
19053
19215
|
translations = _ref2.translations,
|
|
19054
|
-
props = _objectWithoutProperties$
|
|
19216
|
+
props = _objectWithoutProperties$e(_ref2, _excluded$l);
|
|
19055
19217
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19056
19218
|
className: cx('ais-HierarchicalMenu', classNames.root, !hasItems && cx('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
19057
19219
|
}), /*#__PURE__*/React__default.createElement(HierarchicalList, {
|
|
@@ -19068,7 +19230,7 @@
|
|
|
19068
19230
|
}));
|
|
19069
19231
|
}
|
|
19070
19232
|
|
|
19071
|
-
var _excluded$
|
|
19233
|
+
var _excluded$m = ["attributes", "limit", "rootPath", "separator", "showMore", "showMoreLimit", "showParentLevel", "sortBy", "transformItems", "translations"];
|
|
19072
19234
|
function HierarchicalMenu$1(_ref) {
|
|
19073
19235
|
var attributes = _ref.attributes,
|
|
19074
19236
|
limit = _ref.limit,
|
|
@@ -19080,7 +19242,7 @@
|
|
|
19080
19242
|
sortBy = _ref.sortBy,
|
|
19081
19243
|
transformItems = _ref.transformItems,
|
|
19082
19244
|
translations = _ref.translations,
|
|
19083
|
-
props = _objectWithoutProperties$
|
|
19245
|
+
props = _objectWithoutProperties$e(_ref, _excluded$m);
|
|
19084
19246
|
var _useHierarchicalMenu = useHierarchicalMenu({
|
|
19085
19247
|
attributes: attributes,
|
|
19086
19248
|
limit: limit,
|
|
@@ -19120,7 +19282,7 @@
|
|
|
19120
19282
|
}));
|
|
19121
19283
|
}
|
|
19122
19284
|
|
|
19123
|
-
var _excluded$
|
|
19285
|
+
var _excluded$n = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
19124
19286
|
function HighlightPart(_ref) {
|
|
19125
19287
|
var classNames = _ref.classNames,
|
|
19126
19288
|
children = _ref.children,
|
|
@@ -19142,7 +19304,7 @@
|
|
|
19142
19304
|
separator = _ref2$separator === void 0 ? ', ' : _ref2$separator,
|
|
19143
19305
|
className = _ref2.className,
|
|
19144
19306
|
classNames = _ref2.classNames,
|
|
19145
|
-
props = _objectWithoutProperties$
|
|
19307
|
+
props = _objectWithoutProperties$e(_ref2, _excluded$n);
|
|
19146
19308
|
return /*#__PURE__*/React__default.createElement("span", _extends$1({}, props, {
|
|
19147
19309
|
className: cx(classNames.root, className)
|
|
19148
19310
|
}), parts.map(function (part, partIndex) {
|
|
@@ -19163,11 +19325,11 @@
|
|
|
19163
19325
|
}));
|
|
19164
19326
|
}
|
|
19165
19327
|
|
|
19166
|
-
var _excluded$
|
|
19328
|
+
var _excluded$o = ["classNames"];
|
|
19167
19329
|
function Highlight(_ref) {
|
|
19168
19330
|
var _ref$classNames = _ref.classNames,
|
|
19169
19331
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19170
|
-
props = _objectWithoutProperties$
|
|
19332
|
+
props = _objectWithoutProperties$e(_ref, _excluded$o);
|
|
19171
19333
|
return /*#__PURE__*/React__default.createElement(InternalHighlight, _extends$1({
|
|
19172
19334
|
classNames: {
|
|
19173
19335
|
root: cx('ais-Highlight', classNames.root),
|
|
@@ -19178,14 +19340,14 @@
|
|
|
19178
19340
|
}, props));
|
|
19179
19341
|
}
|
|
19180
19342
|
|
|
19181
|
-
var _excluded$
|
|
19343
|
+
var _excluded$p = ["hit", "attribute", "highlightedTagName", "nonHighlightedTagName", "separator"];
|
|
19182
19344
|
function Highlight$1(_ref) {
|
|
19183
19345
|
var hit = _ref.hit,
|
|
19184
19346
|
attribute = _ref.attribute,
|
|
19185
19347
|
highlightedTagName = _ref.highlightedTagName,
|
|
19186
19348
|
nonHighlightedTagName = _ref.nonHighlightedTagName,
|
|
19187
19349
|
separator = _ref.separator,
|
|
19188
|
-
props = _objectWithoutProperties$
|
|
19350
|
+
props = _objectWithoutProperties$e(_ref, _excluded$p);
|
|
19189
19351
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
19190
19352
|
var properties = Array.isArray(property) ? property : [property];
|
|
19191
19353
|
var parts = properties.map(function (singleValue) {
|
|
@@ -19199,7 +19361,7 @@
|
|
|
19199
19361
|
}));
|
|
19200
19362
|
}
|
|
19201
19363
|
|
|
19202
|
-
var _excluded$
|
|
19364
|
+
var _excluded$q = ["hits", "sendEvent", "hitComponent", "classNames"];
|
|
19203
19365
|
function DefaultHitComponent(_ref) {
|
|
19204
19366
|
var hit = _ref.hit;
|
|
19205
19367
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -19215,7 +19377,7 @@
|
|
|
19215
19377
|
HitComponent = _ref2$hitComponent === void 0 ? DefaultHitComponent : _ref2$hitComponent,
|
|
19216
19378
|
_ref2$classNames = _ref2.classNames,
|
|
19217
19379
|
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
19218
|
-
props = _objectWithoutProperties$
|
|
19380
|
+
props = _objectWithoutProperties$e(_ref2, _excluded$q);
|
|
19219
19381
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19220
19382
|
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
19221
19383
|
}), /*#__PURE__*/React__default.createElement("ol", {
|
|
@@ -19237,11 +19399,11 @@
|
|
|
19237
19399
|
})));
|
|
19238
19400
|
}
|
|
19239
19401
|
|
|
19240
|
-
var _excluded$
|
|
19402
|
+
var _excluded$r = ["escapeHTML", "transformItems"];
|
|
19241
19403
|
function Hits$1(_ref) {
|
|
19242
19404
|
var escapeHTML = _ref.escapeHTML,
|
|
19243
19405
|
transformItems = _ref.transformItems,
|
|
19244
|
-
props = _objectWithoutProperties$
|
|
19406
|
+
props = _objectWithoutProperties$e(_ref, _excluded$r);
|
|
19245
19407
|
var _useHits = useHits({
|
|
19246
19408
|
escapeHTML: escapeHTML,
|
|
19247
19409
|
transformItems: transformItems
|
|
@@ -19257,14 +19419,14 @@
|
|
|
19257
19419
|
return /*#__PURE__*/React__default.createElement(Hits, _extends$1({}, props, uiProps));
|
|
19258
19420
|
}
|
|
19259
19421
|
|
|
19260
|
-
var _excluded$
|
|
19422
|
+
var _excluded$s = ["items", "onChange", "currentValue", "classNames"];
|
|
19261
19423
|
function HitsPerPage(_ref) {
|
|
19262
19424
|
var items = _ref.items,
|
|
19263
19425
|
_onChange = _ref.onChange,
|
|
19264
19426
|
currentValue = _ref.currentValue,
|
|
19265
19427
|
_ref$classNames = _ref.classNames,
|
|
19266
19428
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19267
|
-
props = _objectWithoutProperties$
|
|
19429
|
+
props = _objectWithoutProperties$e(_ref, _excluded$s);
|
|
19268
19430
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19269
19431
|
className: cx('ais-HitsPerPage', classNames.root, props.className)
|
|
19270
19432
|
}), /*#__PURE__*/React__default.createElement("select", {
|
|
@@ -19282,11 +19444,11 @@
|
|
|
19282
19444
|
})));
|
|
19283
19445
|
}
|
|
19284
19446
|
|
|
19285
|
-
var _excluded$
|
|
19447
|
+
var _excluded$t = ["items", "transformItems"];
|
|
19286
19448
|
function HitsPerPage$1(_ref) {
|
|
19287
19449
|
var userItems = _ref.items,
|
|
19288
19450
|
transformItems = _ref.transformItems,
|
|
19289
|
-
props = _objectWithoutProperties$
|
|
19451
|
+
props = _objectWithoutProperties$e(_ref, _excluded$t);
|
|
19290
19452
|
var _useHitsPerPage = useHitsPerPage({
|
|
19291
19453
|
items: userItems,
|
|
19292
19454
|
transformItems: transformItems
|
|
@@ -19310,7 +19472,7 @@
|
|
|
19310
19472
|
return /*#__PURE__*/React__default.createElement(HitsPerPage, _extends$1({}, props, uiProps));
|
|
19311
19473
|
}
|
|
19312
19474
|
|
|
19313
|
-
var _excluded$
|
|
19475
|
+
var _excluded$u = ["hitComponent", "hits", "sendEvent", "isFirstPage", "isLastPage", "onShowPrevious", "onShowMore", "classNames", "translations"];
|
|
19314
19476
|
function DefaultHitComponent$1(_ref) {
|
|
19315
19477
|
var hit = _ref.hit;
|
|
19316
19478
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -19331,7 +19493,7 @@
|
|
|
19331
19493
|
_ref2$classNames = _ref2.classNames,
|
|
19332
19494
|
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
19333
19495
|
translations = _ref2.translations,
|
|
19334
|
-
props = _objectWithoutProperties$
|
|
19496
|
+
props = _objectWithoutProperties$e(_ref2, _excluded$u);
|
|
19335
19497
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19336
19498
|
className: cx('ais-InfiniteHits', classNames.root, hits.length === 0 && cx('ais-InfiniteHits--empty', classNames.emptyRoot), props.className)
|
|
19337
19499
|
}), onShowPrevious && /*#__PURE__*/React__default.createElement("button", {
|
|
@@ -19361,7 +19523,7 @@
|
|
|
19361
19523
|
}, translations.showMoreButtonText));
|
|
19362
19524
|
}
|
|
19363
19525
|
|
|
19364
|
-
var _excluded$
|
|
19526
|
+
var _excluded$v = ["showPrevious", "cache", "escapeHTML", "showPrevious", "transformItems", "translations"];
|
|
19365
19527
|
function InfiniteHits$1(_ref) {
|
|
19366
19528
|
var _ref$showPrevious = _ref.showPrevious,
|
|
19367
19529
|
shouldShowPrevious = _ref$showPrevious === void 0 ? true : _ref$showPrevious,
|
|
@@ -19370,7 +19532,7 @@
|
|
|
19370
19532
|
userShowPrevious = _ref.showPrevious,
|
|
19371
19533
|
transformItems = _ref.transformItems,
|
|
19372
19534
|
translations = _ref.translations,
|
|
19373
|
-
props = _objectWithoutProperties$
|
|
19535
|
+
props = _objectWithoutProperties$e(_ref, _excluded$v);
|
|
19374
19536
|
var _useInfiniteHits = useInfiniteHits({
|
|
19375
19537
|
cache: cache,
|
|
19376
19538
|
escapeHTML: escapeHTML,
|
|
@@ -19400,7 +19562,7 @@
|
|
|
19400
19562
|
return /*#__PURE__*/React__default.createElement(InfiniteHits, _extends$1({}, props, uiProps));
|
|
19401
19563
|
}
|
|
19402
19564
|
|
|
19403
|
-
var _excluded$
|
|
19565
|
+
var _excluded$w = ["items", "classNames", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "createURL", "onRefine", "translations"];
|
|
19404
19566
|
function Menu(_ref) {
|
|
19405
19567
|
var items = _ref.items,
|
|
19406
19568
|
_ref$classNames = _ref.classNames,
|
|
@@ -19412,7 +19574,7 @@
|
|
|
19412
19574
|
createURL = _ref.createURL,
|
|
19413
19575
|
onRefine = _ref.onRefine,
|
|
19414
19576
|
translations = _ref.translations,
|
|
19415
|
-
props = _objectWithoutProperties$
|
|
19577
|
+
props = _objectWithoutProperties$e(_ref, _excluded$w);
|
|
19416
19578
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19417
19579
|
className: cx('ais-Menu', classNames.root, items.length === 0 && cx('ais-Menu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
19418
19580
|
}), /*#__PURE__*/React__default.createElement("ul", {
|
|
@@ -19442,7 +19604,7 @@
|
|
|
19442
19604
|
}));
|
|
19443
19605
|
}
|
|
19444
19606
|
|
|
19445
|
-
var _excluded$
|
|
19607
|
+
var _excluded$x = ["attribute", "limit", "showMore", "showMoreLimit", "sortBy", "transformItems", "translations"];
|
|
19446
19608
|
function Menu$1(_ref) {
|
|
19447
19609
|
var attribute = _ref.attribute,
|
|
19448
19610
|
limit = _ref.limit,
|
|
@@ -19451,7 +19613,7 @@
|
|
|
19451
19613
|
sortBy = _ref.sortBy,
|
|
19452
19614
|
transformItems = _ref.transformItems,
|
|
19453
19615
|
translations = _ref.translations,
|
|
19454
|
-
props = _objectWithoutProperties$
|
|
19616
|
+
props = _objectWithoutProperties$e(_ref, _excluded$x);
|
|
19455
19617
|
var _useMenu = useMenu({
|
|
19456
19618
|
attribute: attribute,
|
|
19457
19619
|
limit: limit,
|
|
@@ -19488,8 +19650,8 @@
|
|
|
19488
19650
|
}));
|
|
19489
19651
|
}
|
|
19490
19652
|
|
|
19491
|
-
var _excluded$
|
|
19492
|
-
_excluded2$
|
|
19653
|
+
var _excluded$y = ["pages", "currentPage", "nbPages", "isFirstPage", "isLastPage", "showFirst", "showPrevious", "showNext", "showLast", "createURL", "onNavigate", "translations", "classNames"],
|
|
19654
|
+
_excluded2$5 = ["isDisabled", "className", "classNames", "href", "onClick"];
|
|
19493
19655
|
function Pagination(_ref) {
|
|
19494
19656
|
var pages = _ref.pages,
|
|
19495
19657
|
currentPage = _ref.currentPage,
|
|
@@ -19509,7 +19671,7 @@
|
|
|
19509
19671
|
translations = _ref.translations,
|
|
19510
19672
|
_ref$classNames = _ref.classNames,
|
|
19511
19673
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19512
|
-
props = _objectWithoutProperties$
|
|
19674
|
+
props = _objectWithoutProperties$e(_ref, _excluded$y);
|
|
19513
19675
|
var firstPageIndex = 0;
|
|
19514
19676
|
var previousPageIndex = currentPage - 1;
|
|
19515
19677
|
var nextPageIndex = currentPage + 1;
|
|
@@ -19580,7 +19742,7 @@
|
|
|
19580
19742
|
classNames = _ref2.classNames,
|
|
19581
19743
|
href = _ref2.href,
|
|
19582
19744
|
_onClick = _ref2.onClick,
|
|
19583
|
-
props = _objectWithoutProperties$
|
|
19745
|
+
props = _objectWithoutProperties$e(_ref2, _excluded2$5);
|
|
19584
19746
|
if (isDisabled) {
|
|
19585
19747
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
19586
19748
|
className: cx('ais-Pagination-item', classNames.item, 'ais-Pagination-item--disabled', classNames.disabledItem, className)
|
|
@@ -19603,7 +19765,7 @@
|
|
|
19603
19765
|
}, props)));
|
|
19604
19766
|
}
|
|
19605
19767
|
|
|
19606
|
-
var _excluded$
|
|
19768
|
+
var _excluded$z = ["showFirst", "showPrevious", "showNext", "showLast", "padding", "totalPages", "translations"];
|
|
19607
19769
|
function Pagination$1(_ref) {
|
|
19608
19770
|
var showFirst = _ref.showFirst,
|
|
19609
19771
|
showPrevious = _ref.showPrevious,
|
|
@@ -19612,7 +19774,7 @@
|
|
|
19612
19774
|
padding = _ref.padding,
|
|
19613
19775
|
totalPages = _ref.totalPages,
|
|
19614
19776
|
translations = _ref.translations,
|
|
19615
|
-
props = _objectWithoutProperties$
|
|
19777
|
+
props = _objectWithoutProperties$e(_ref, _excluded$z);
|
|
19616
19778
|
var _usePagination = usePagination({
|
|
19617
19779
|
padding: padding,
|
|
19618
19780
|
totalPages: totalPages
|
|
@@ -19661,14 +19823,14 @@
|
|
|
19661
19823
|
}));
|
|
19662
19824
|
}
|
|
19663
19825
|
|
|
19664
|
-
var _excluded$
|
|
19826
|
+
var _excluded$A = ["classNames", "url", "theme"];
|
|
19665
19827
|
function PoweredBy(_ref) {
|
|
19666
19828
|
var _ref$classNames = _ref.classNames,
|
|
19667
19829
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19668
19830
|
url = _ref.url,
|
|
19669
19831
|
_ref$theme = _ref.theme,
|
|
19670
19832
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
19671
|
-
props = _objectWithoutProperties$
|
|
19833
|
+
props = _objectWithoutProperties$e(_ref, _excluded$A);
|
|
19672
19834
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19673
19835
|
className: cx('ais-PoweredBy', theme === 'dark' ? cx('ais-PoweredBy--dark', classNames.dark) : cx('ais-PoweredBy--light', classNames.light), classNames.root, props.className)
|
|
19674
19836
|
}), /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -19698,7 +19860,7 @@
|
|
|
19698
19860
|
return /*#__PURE__*/React__default.createElement(PoweredBy, _extends$1({}, props, uiProps));
|
|
19699
19861
|
}
|
|
19700
19862
|
|
|
19701
|
-
var _excluded$
|
|
19863
|
+
var _excluded$B = ["classNames", "range", "start", "step", "disabled", "onSubmit", "translations"];
|
|
19702
19864
|
// if the default value is undefined, React considers the component uncontrolled initially, which we don't want 0 or NaN as the default value
|
|
19703
19865
|
var unsetNumberInputValue = '';
|
|
19704
19866
|
|
|
@@ -19715,7 +19877,7 @@
|
|
|
19715
19877
|
_ref$range = _ref.range,
|
|
19716
19878
|
min = _ref$range.min,
|
|
19717
19879
|
max = _ref$range.max,
|
|
19718
|
-
_ref$start = _slicedToArray$
|
|
19880
|
+
_ref$start = _slicedToArray$g(_ref.start, 2),
|
|
19719
19881
|
minValue = _ref$start[0],
|
|
19720
19882
|
maxValue = _ref$start[1],
|
|
19721
19883
|
_ref$step = _ref.step,
|
|
@@ -19723,20 +19885,20 @@
|
|
|
19723
19885
|
disabled = _ref.disabled,
|
|
19724
19886
|
_onSubmit = _ref.onSubmit,
|
|
19725
19887
|
translations = _ref.translations,
|
|
19726
|
-
props = _objectWithoutProperties$
|
|
19888
|
+
props = _objectWithoutProperties$e(_ref, _excluded$B);
|
|
19727
19889
|
var values = {
|
|
19728
19890
|
min: minValue !== -Infinity && minValue !== min ? minValue : unsetNumberInputValue,
|
|
19729
19891
|
max: maxValue !== Infinity && maxValue !== max ? maxValue : unsetNumberInputValue
|
|
19730
19892
|
};
|
|
19731
19893
|
var _useState = React.useState(values),
|
|
19732
|
-
_useState2 = _slicedToArray$
|
|
19894
|
+
_useState2 = _slicedToArray$g(_useState, 2),
|
|
19733
19895
|
prevValues = _useState2[0],
|
|
19734
19896
|
setPrevValues = _useState2[1];
|
|
19735
19897
|
var _useState3 = React.useState({
|
|
19736
19898
|
from: (_values$min = values.min) === null || _values$min === void 0 ? void 0 : _values$min.toString(),
|
|
19737
19899
|
to: (_values$max = values.max) === null || _values$max === void 0 ? void 0 : _values$max.toString()
|
|
19738
19900
|
}),
|
|
19739
|
-
_useState4 = _slicedToArray$
|
|
19901
|
+
_useState4 = _slicedToArray$g(_useState3, 2),
|
|
19740
19902
|
_useState4$ = _useState4[0],
|
|
19741
19903
|
from = _useState4$.from,
|
|
19742
19904
|
to = _useState4$.to,
|
|
@@ -19803,14 +19965,14 @@
|
|
|
19803
19965
|
}, translations.submitButtonText)));
|
|
19804
19966
|
}
|
|
19805
19967
|
|
|
19806
|
-
var _excluded$
|
|
19968
|
+
var _excluded$C = ["attribute", "min", "max", "precision", "translations"];
|
|
19807
19969
|
function RangeInput$1(_ref) {
|
|
19808
19970
|
var attribute = _ref.attribute,
|
|
19809
19971
|
min = _ref.min,
|
|
19810
19972
|
max = _ref.max,
|
|
19811
19973
|
precision = _ref.precision,
|
|
19812
19974
|
translations = _ref.translations,
|
|
19813
|
-
props = _objectWithoutProperties$
|
|
19975
|
+
props = _objectWithoutProperties$e(_ref, _excluded$C);
|
|
19814
19976
|
var _useRange = useRange({
|
|
19815
19977
|
attribute: attribute,
|
|
19816
19978
|
min: min,
|
|
@@ -19838,7 +20000,7 @@
|
|
|
19838
20000
|
return /*#__PURE__*/React__default.createElement(RangeInput, _extends$1({}, props, uiProps));
|
|
19839
20001
|
}
|
|
19840
20002
|
|
|
19841
|
-
var _excluded$
|
|
20003
|
+
var _excluded$D = ["canRefine", "items", "onRefine", "query", "searchBox", "noResults", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "className", "classNames", "translations"];
|
|
19842
20004
|
function RefinementList$1(_ref) {
|
|
19843
20005
|
var canRefine = _ref.canRefine,
|
|
19844
20006
|
items = _ref.items,
|
|
@@ -19854,7 +20016,7 @@
|
|
|
19854
20016
|
_ref$classNames = _ref.classNames,
|
|
19855
20017
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19856
20018
|
translations = _ref.translations,
|
|
19857
|
-
props = _objectWithoutProperties$
|
|
20019
|
+
props = _objectWithoutProperties$e(_ref, _excluded$D);
|
|
19858
20020
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19859
20021
|
className: cx('ais-RefinementList', classNames.root, !canRefine && cx('ais-RefinementList--noRefinement', classNames.noRefinementRoot), className)
|
|
19860
20022
|
}), searchBox && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -19893,7 +20055,7 @@
|
|
|
19893
20055
|
}));
|
|
19894
20056
|
}
|
|
19895
20057
|
|
|
19896
|
-
var _excluded$
|
|
20058
|
+
var _excluded$E = ["formRef", "inputRef", "isSearchStalled", "onChange", "onReset", "onSubmit", "placeholder", "value", "autoFocus", "resetIconComponent", "submitIconComponent", "loadingIconComponent", "classNames", "translations"];
|
|
19897
20059
|
var _ref2 = /*#__PURE__*/React__default.createElement("path", {
|
|
19898
20060
|
d: "M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
|
|
19899
20061
|
});
|
|
@@ -19944,6 +20106,7 @@
|
|
|
19944
20106
|
function DefaultLoadingIcon(_ref5) {
|
|
19945
20107
|
var classNames = _ref5.classNames;
|
|
19946
20108
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20109
|
+
"aria-label": "Results are loading",
|
|
19947
20110
|
width: "16",
|
|
19948
20111
|
height: "16",
|
|
19949
20112
|
viewBox: "0 0 38 38",
|
|
@@ -19959,7 +20122,8 @@
|
|
|
19959
20122
|
onChange = _ref7.onChange,
|
|
19960
20123
|
onReset = _ref7.onReset,
|
|
19961
20124
|
onSubmit = _ref7.onSubmit,
|
|
19962
|
-
placeholder = _ref7.placeholder,
|
|
20125
|
+
_ref7$placeholder = _ref7.placeholder,
|
|
20126
|
+
placeholder = _ref7$placeholder === void 0 ? '' : _ref7$placeholder,
|
|
19963
20127
|
value = _ref7.value,
|
|
19964
20128
|
autoFocus = _ref7.autoFocus,
|
|
19965
20129
|
_ref7$resetIconCompon = _ref7.resetIconComponent,
|
|
@@ -19971,7 +20135,7 @@
|
|
|
19971
20135
|
_ref7$classNames = _ref7.classNames,
|
|
19972
20136
|
classNames = _ref7$classNames === void 0 ? {} : _ref7$classNames,
|
|
19973
20137
|
translations = _ref7.translations,
|
|
19974
|
-
props = _objectWithoutProperties$
|
|
20138
|
+
props = _objectWithoutProperties$e(_ref7, _excluded$E);
|
|
19975
20139
|
function handleSubmit(event) {
|
|
19976
20140
|
event.preventDefault();
|
|
19977
20141
|
event.stopPropagation();
|
|
@@ -19998,10 +20162,12 @@
|
|
|
19998
20162
|
className: cx('ais-SearchBox-form', classNames.form),
|
|
19999
20163
|
noValidate: true,
|
|
20000
20164
|
onSubmit: handleSubmit,
|
|
20001
|
-
onReset: handleReset
|
|
20165
|
+
onReset: handleReset,
|
|
20166
|
+
role: "search"
|
|
20002
20167
|
}, /*#__PURE__*/React__default.createElement("input", {
|
|
20003
20168
|
ref: inputRef,
|
|
20004
20169
|
className: cx('ais-SearchBox-input', classNames.input),
|
|
20170
|
+
"aria-label": "Search",
|
|
20005
20171
|
autoComplete: "off",
|
|
20006
20172
|
autoCorrect: "off",
|
|
20007
20173
|
autoCapitalize: "off",
|
|
@@ -20035,7 +20201,7 @@
|
|
|
20035
20201
|
}))));
|
|
20036
20202
|
}
|
|
20037
20203
|
|
|
20038
|
-
var _excluded$
|
|
20204
|
+
var _excluded$F = ["searchable", "searchablePlaceholder", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
20039
20205
|
function RefinementList$2(_ref) {
|
|
20040
20206
|
var searchable = _ref.searchable,
|
|
20041
20207
|
searchablePlaceholder = _ref.searchablePlaceholder,
|
|
@@ -20048,7 +20214,7 @@
|
|
|
20048
20214
|
escapeFacetValues = _ref.escapeFacetValues,
|
|
20049
20215
|
transformItems = _ref.transformItems,
|
|
20050
20216
|
translations = _ref.translations,
|
|
20051
|
-
props = _objectWithoutProperties$
|
|
20217
|
+
props = _objectWithoutProperties$e(_ref, _excluded$F);
|
|
20052
20218
|
var _useRefinementList = useRefinementList({
|
|
20053
20219
|
attribute: attribute,
|
|
20054
20220
|
operator: operator,
|
|
@@ -20070,7 +20236,7 @@
|
|
|
20070
20236
|
searchForItems = _useRefinementList.searchForItems,
|
|
20071
20237
|
toggleShowMore = _useRefinementList.toggleShowMore;
|
|
20072
20238
|
var _useState = React.useState(''),
|
|
20073
|
-
_useState2 = _slicedToArray$
|
|
20239
|
+
_useState2 = _slicedToArray$g(_useState, 2),
|
|
20074
20240
|
inputValue = _useState2[0],
|
|
20075
20241
|
setInputValue = _useState2[1];
|
|
20076
20242
|
var inputRef = React.useRef(null);
|
|
@@ -20133,13 +20299,13 @@
|
|
|
20133
20299
|
}));
|
|
20134
20300
|
}
|
|
20135
20301
|
|
|
20136
|
-
var _excluded$
|
|
20302
|
+
var _excluded$G = ["queryHook", "searchAsYouType", "translations"];
|
|
20137
20303
|
function SearchBox$1(_ref) {
|
|
20138
20304
|
var queryHook = _ref.queryHook,
|
|
20139
20305
|
_ref$searchAsYouType = _ref.searchAsYouType,
|
|
20140
20306
|
searchAsYouType = _ref$searchAsYouType === void 0 ? true : _ref$searchAsYouType,
|
|
20141
20307
|
translations = _ref.translations,
|
|
20142
|
-
props = _objectWithoutProperties$
|
|
20308
|
+
props = _objectWithoutProperties$e(_ref, _excluded$G);
|
|
20143
20309
|
var _useSearchBox = useSearchBox({
|
|
20144
20310
|
queryHook: queryHook
|
|
20145
20311
|
}, {
|
|
@@ -20149,7 +20315,7 @@
|
|
|
20149
20315
|
refine = _useSearchBox.refine,
|
|
20150
20316
|
isSearchStalled = _useSearchBox.isSearchStalled;
|
|
20151
20317
|
var _useState = React.useState(query),
|
|
20152
|
-
_useState2 = _slicedToArray$
|
|
20318
|
+
_useState2 = _slicedToArray$g(_useState, 2),
|
|
20153
20319
|
inputValue = _useState2[0],
|
|
20154
20320
|
setInputValue = _useState2[1];
|
|
20155
20321
|
var inputRef = React.useRef(null);
|
|
@@ -20199,11 +20365,11 @@
|
|
|
20199
20365
|
return /*#__PURE__*/React__default.createElement(SearchBox, _extends$1({}, props, uiProps));
|
|
20200
20366
|
}
|
|
20201
20367
|
|
|
20202
|
-
var _excluded$
|
|
20368
|
+
var _excluded$H = ["classNames"];
|
|
20203
20369
|
function Snippet(_ref) {
|
|
20204
20370
|
var _ref$classNames = _ref.classNames,
|
|
20205
20371
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
20206
|
-
props = _objectWithoutProperties$
|
|
20372
|
+
props = _objectWithoutProperties$e(_ref, _excluded$H);
|
|
20207
20373
|
return /*#__PURE__*/React__default.createElement(InternalHighlight, _extends$1({
|
|
20208
20374
|
classNames: {
|
|
20209
20375
|
root: cx('ais-Snippet', classNames.root),
|
|
@@ -20214,14 +20380,14 @@
|
|
|
20214
20380
|
}, props));
|
|
20215
20381
|
}
|
|
20216
20382
|
|
|
20217
|
-
var _excluded$
|
|
20383
|
+
var _excluded$I = ["hit", "attribute", "highlightedTagName", "nonHighlightedTagName", "separator"];
|
|
20218
20384
|
function Snippet$1(_ref) {
|
|
20219
20385
|
var hit = _ref.hit,
|
|
20220
20386
|
attribute = _ref.attribute,
|
|
20221
20387
|
highlightedTagName = _ref.highlightedTagName,
|
|
20222
20388
|
nonHighlightedTagName = _ref.nonHighlightedTagName,
|
|
20223
20389
|
separator = _ref.separator,
|
|
20224
|
-
props = _objectWithoutProperties$
|
|
20390
|
+
props = _objectWithoutProperties$e(_ref, _excluded$I);
|
|
20225
20391
|
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
20226
20392
|
var properties = Array.isArray(property) ? property : [property];
|
|
20227
20393
|
var parts = properties.map(function (singleValue) {
|
|
@@ -20235,7 +20401,7 @@
|
|
|
20235
20401
|
}));
|
|
20236
20402
|
}
|
|
20237
20403
|
|
|
20238
|
-
var _excluded$
|
|
20404
|
+
var _excluded$J = ["items", "value", "onChange", "classNames"];
|
|
20239
20405
|
function SortBy(_ref) {
|
|
20240
20406
|
var items = _ref.items,
|
|
20241
20407
|
value = _ref.value,
|
|
@@ -20243,7 +20409,7 @@
|
|
|
20243
20409
|
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
20244
20410
|
_ref$classNames = _ref.classNames,
|
|
20245
20411
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
20246
|
-
props = _objectWithoutProperties$
|
|
20412
|
+
props = _objectWithoutProperties$e(_ref, _excluded$J);
|
|
20247
20413
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
20248
20414
|
className: cx('ais-SortBy', classNames.root, props.className)
|
|
20249
20415
|
}), /*#__PURE__*/React__default.createElement("select", {
|
|
@@ -20251,7 +20417,8 @@
|
|
|
20251
20417
|
onChange: function onChange(event) {
|
|
20252
20418
|
return _onChange(event.target.value);
|
|
20253
20419
|
},
|
|
20254
|
-
value: value
|
|
20420
|
+
value: value,
|
|
20421
|
+
"aria-label": "Sort results by"
|
|
20255
20422
|
}, items.map(function (item) {
|
|
20256
20423
|
return /*#__PURE__*/React__default.createElement("option", {
|
|
20257
20424
|
className: cx('ais-SortBy-option', classNames.option),
|
|
@@ -20261,11 +20428,11 @@
|
|
|
20261
20428
|
})));
|
|
20262
20429
|
}
|
|
20263
20430
|
|
|
20264
|
-
var _excluded$
|
|
20431
|
+
var _excluded$K = ["items", "transformItems"];
|
|
20265
20432
|
function SortBy$1(_ref) {
|
|
20266
20433
|
var items = _ref.items,
|
|
20267
20434
|
transformItems = _ref.transformItems,
|
|
20268
|
-
props = _objectWithoutProperties$
|
|
20435
|
+
props = _objectWithoutProperties$e(_ref, _excluded$K);
|
|
20269
20436
|
var _useSortBy = useSortBy({
|
|
20270
20437
|
items: items,
|
|
20271
20438
|
transformItems: transformItems
|
|
@@ -20283,7 +20450,7 @@
|
|
|
20283
20450
|
return /*#__PURE__*/React__default.createElement(SortBy, _extends$1({}, props, uiProps));
|
|
20284
20451
|
}
|
|
20285
20452
|
|
|
20286
|
-
var _excluded$
|
|
20453
|
+
var _excluded$L = ["classNames", "nbHits", "processingTimeMS", "nbSortedHits", "areHitsSorted", "translations"];
|
|
20287
20454
|
function Stats(_ref) {
|
|
20288
20455
|
var _ref$classNames = _ref.classNames,
|
|
20289
20456
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -20292,7 +20459,7 @@
|
|
|
20292
20459
|
nbSortedHits = _ref.nbSortedHits,
|
|
20293
20460
|
areHitsSorted = _ref.areHitsSorted,
|
|
20294
20461
|
translations = _ref.translations,
|
|
20295
|
-
props = _objectWithoutProperties$
|
|
20462
|
+
props = _objectWithoutProperties$e(_ref, _excluded$L);
|
|
20296
20463
|
var translationOptions = {
|
|
20297
20464
|
nbHits: nbHits,
|
|
20298
20465
|
processingTimeMS: processingTimeMS,
|
|
@@ -20306,10 +20473,10 @@
|
|
|
20306
20473
|
}, translations.rootElementText(translationOptions)));
|
|
20307
20474
|
}
|
|
20308
20475
|
|
|
20309
|
-
var _excluded$
|
|
20476
|
+
var _excluded$M = ["translations"];
|
|
20310
20477
|
function Stats$1(_ref) {
|
|
20311
20478
|
var translations = _ref.translations,
|
|
20312
|
-
props = _objectWithoutProperties$
|
|
20479
|
+
props = _objectWithoutProperties$e(_ref, _excluded$M);
|
|
20313
20480
|
var _useStats = useStats(undefined, {
|
|
20314
20481
|
$$widgetType: 'ais.stats'
|
|
20315
20482
|
}),
|
|
@@ -20324,21 +20491,49 @@
|
|
|
20324
20491
|
areHitsSorted: areHitsSorted,
|
|
20325
20492
|
translations: _objectSpread2({
|
|
20326
20493
|
rootElementText: function rootElementText(options) {
|
|
20327
|
-
return
|
|
20494
|
+
return "".concat(options.areHitsSorted ? getSortedResultsSentence(options) : getResultsSentence(options), " found in ").concat(options.processingTimeMS.toLocaleString(), "ms");
|
|
20328
20495
|
}
|
|
20329
20496
|
}, translations)
|
|
20330
20497
|
};
|
|
20331
20498
|
return /*#__PURE__*/React__default.createElement(Stats, _extends$1({}, props, uiProps));
|
|
20332
20499
|
}
|
|
20500
|
+
function getSortedResultsSentence(_ref2) {
|
|
20501
|
+
var nbHits = _ref2.nbHits,
|
|
20502
|
+
nbSortedHits = _ref2.nbSortedHits;
|
|
20503
|
+
var suffix = "sorted out of ".concat(nbHits.toLocaleString());
|
|
20504
|
+
if (nbSortedHits === 0) {
|
|
20505
|
+
return "No relevant results ".concat(suffix);
|
|
20506
|
+
}
|
|
20507
|
+
if (nbSortedHits === 1) {
|
|
20508
|
+
return "1 relevant result ".concat(suffix);
|
|
20509
|
+
}
|
|
20510
|
+
if (nbSortedHits > 1) {
|
|
20511
|
+
return "".concat((nbSortedHits || 0).toLocaleString(), " relevant results ").concat(suffix);
|
|
20512
|
+
}
|
|
20513
|
+
return '';
|
|
20514
|
+
}
|
|
20515
|
+
function getResultsSentence(_ref3) {
|
|
20516
|
+
var nbHits = _ref3.nbHits;
|
|
20517
|
+
if (nbHits === 0) {
|
|
20518
|
+
return 'No results';
|
|
20519
|
+
}
|
|
20520
|
+
if (nbHits === 1) {
|
|
20521
|
+
return '1 result';
|
|
20522
|
+
}
|
|
20523
|
+
if (nbHits > 1) {
|
|
20524
|
+
return "".concat(nbHits.toLocaleString(), " results");
|
|
20525
|
+
}
|
|
20526
|
+
return '';
|
|
20527
|
+
}
|
|
20333
20528
|
|
|
20334
|
-
var _excluded$
|
|
20529
|
+
var _excluded$N = ["classNames", "checked", "onChange", "label"];
|
|
20335
20530
|
function ToggleRefinement(_ref) {
|
|
20336
20531
|
var _ref$classNames = _ref.classNames,
|
|
20337
20532
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
20338
20533
|
checked = _ref.checked,
|
|
20339
20534
|
_onChange = _ref.onChange,
|
|
20340
20535
|
label = _ref.label,
|
|
20341
|
-
props = _objectWithoutProperties$
|
|
20536
|
+
props = _objectWithoutProperties$e(_ref, _excluded$N);
|
|
20342
20537
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
20343
20538
|
className: cx('ais-ToggleRefinement', classNames.root, props.className)
|
|
20344
20539
|
}), /*#__PURE__*/React__default.createElement("label", {
|
|
@@ -20355,12 +20550,12 @@
|
|
|
20355
20550
|
}, label)));
|
|
20356
20551
|
}
|
|
20357
20552
|
|
|
20358
|
-
var _excluded$
|
|
20553
|
+
var _excluded$O = ["attribute", "on", "off"];
|
|
20359
20554
|
function ToggleRefinement$1(_ref) {
|
|
20360
20555
|
var attribute = _ref.attribute,
|
|
20361
20556
|
on = _ref.on,
|
|
20362
20557
|
off = _ref.off,
|
|
20363
|
-
props = _objectWithoutProperties$
|
|
20558
|
+
props = _objectWithoutProperties$e(_ref, _excluded$O);
|
|
20364
20559
|
var _useToggleRefinement = useToggleRefinement({
|
|
20365
20560
|
attribute: attribute,
|
|
20366
20561
|
on: on,
|