instantsearch.js 4.68.1 → 4.70.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/cjs/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js +93 -0
- package/cjs/connectors/index.js +28 -0
- package/cjs/connectors/looking-similar/connectLookingSimilar.js +94 -0
- package/cjs/connectors/related-products/connectRelatedProducts.js +94 -0
- package/cjs/connectors/trending-items/connectTrendingItems.js +90 -0
- package/cjs/lib/InstantSearch.js +10 -1
- package/cjs/lib/server.js +28 -9
- package/cjs/lib/utils/addWidgetId.js +17 -0
- package/cjs/lib/utils/hydrateRecommendCache.js +23 -0
- package/cjs/lib/utils/hydrateSearchClient.js +7 -3
- package/cjs/lib/utils/index.js +22 -0
- package/cjs/lib/utils/render-args.js +3 -3
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/frequently-bought-together/frequently-bought-together.js +120 -0
- package/cjs/widgets/index/index.js +89 -20
- package/cjs/widgets/index.js +28 -0
- package/cjs/widgets/looking-similar/looking-similar.js +122 -0
- package/cjs/widgets/related-products/related-products.js +122 -0
- package/cjs/widgets/trending-items/trending-items.js +126 -0
- package/dist/instantsearch.development.d.ts +411 -12
- package/dist/instantsearch.development.js +1702 -265
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +411 -12
- package/dist/instantsearch.production.min.d.ts +411 -12
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.d.ts +45 -0
- package/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js +86 -0
- package/es/connectors/index.d.ts +4 -0
- package/es/connectors/index.js +5 -1
- package/es/connectors/looking-similar/connectLookingSimilar.d.ts +49 -0
- package/es/connectors/looking-similar/connectLookingSimilar.js +87 -0
- package/es/connectors/related-products/connectRelatedProducts.d.ts +49 -0
- package/es/connectors/related-products/connectRelatedProducts.js +87 -0
- package/es/connectors/trending-items/connectTrendingItems.d.ts +57 -0
- package/es/connectors/trending-items/connectTrendingItems.js +83 -0
- package/es/lib/InstantSearch.d.ts +2 -0
- package/es/lib/InstantSearch.js +11 -2
- package/es/lib/server.d.ts +1 -1
- package/es/lib/server.js +28 -9
- package/es/lib/templating/renderTemplate.d.ts +1 -1
- package/es/lib/utils/addWidgetId.d.ts +3 -0
- package/es/lib/utils/addWidgetId.js +10 -0
- package/es/lib/utils/hydrateRecommendCache.d.ts +3 -0
- package/es/lib/utils/hydrateRecommendCache.js +17 -0
- package/es/lib/utils/hydrateSearchClient.js +7 -3
- package/es/lib/utils/index.d.ts +2 -0
- package/es/lib/utils/index.js +2 -0
- package/es/lib/utils/render-args.d.ts +3 -3
- package/es/lib/utils/render-args.js +3 -3
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/types/results.d.ts +7 -3
- package/es/types/templates.d.ts +1 -1
- package/es/types/widget.d.ts +16 -9
- package/es/widgets/frequently-bought-together/frequently-bought-together.d.ts +41 -0
- package/es/widgets/frequently-bought-together/frequently-bought-together.js +112 -0
- package/es/widgets/index/index.d.ts +2 -1
- package/es/widgets/index/index.js +89 -20
- package/es/widgets/index.d.ts +4 -0
- package/es/widgets/index.js +5 -1
- package/es/widgets/looking-similar/looking-similar.d.ts +41 -0
- package/es/widgets/looking-similar/looking-similar.js +114 -0
- package/es/widgets/related-products/related-products.d.ts +41 -0
- package/es/widgets/related-products/related-products.js +114 -0
- package/es/widgets/trending-items/trending-items.d.ts +41 -0
- package/es/widgets/trending-items/trending-items.js +118 -0
- package/package.json +7 -7
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.
|
|
1
|
+
/*! InstantSearch.js 4.70.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
5
5
|
(global = global || self, global.instantsearch = factory());
|
|
6
6
|
}(this, (function () { 'use strict';
|
|
7
7
|
|
|
8
|
+
var id = 0;
|
|
9
|
+
function addWidgetId(widget) {
|
|
10
|
+
if (widget.dependsOn !== 'recommend') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
widget.$$id = id++;
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
function capitalize(text) {
|
|
9
17
|
return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);
|
|
10
18
|
}
|
|
@@ -1411,6 +1419,18 @@
|
|
|
1411
1419
|
});
|
|
1412
1420
|
}
|
|
1413
1421
|
|
|
1422
|
+
function hydrateRecommendCache(helper, initialResults) {
|
|
1423
|
+
var recommendCache = Object.keys(initialResults).reduce(function (acc, indexName) {
|
|
1424
|
+
var initialResult = initialResults[indexName];
|
|
1425
|
+
if (initialResult.recommendResults) {
|
|
1426
|
+
// @MAJOR: Use `Object.assign` instead of spread operator
|
|
1427
|
+
return _objectSpread2(_objectSpread2({}, acc), initialResult.recommendResults.results);
|
|
1428
|
+
}
|
|
1429
|
+
return acc;
|
|
1430
|
+
}, {});
|
|
1431
|
+
helper._recommendCache = recommendCache;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1414
1434
|
function hydrateSearchClient(client, results) {
|
|
1415
1435
|
if (!results) {
|
|
1416
1436
|
return;
|
|
@@ -1428,16 +1448,20 @@
|
|
|
1428
1448
|
state = _results$key.state,
|
|
1429
1449
|
requestParams = _results$key.requestParams,
|
|
1430
1450
|
serverResults = _results$key.results;
|
|
1431
|
-
return serverResults.map(function (result) {
|
|
1451
|
+
return serverResults && state ? serverResults.map(function (result) {
|
|
1432
1452
|
return _objectSpread2({
|
|
1433
1453
|
indexName: state.index || result.index
|
|
1434
1454
|
}, requestParams || result.params ? {
|
|
1435
1455
|
params: serializeQueryParameters(requestParams || deserializeQueryParameters(result.params))
|
|
1436
1456
|
} : {});
|
|
1437
|
-
});
|
|
1457
|
+
}) : [];
|
|
1438
1458
|
});
|
|
1439
1459
|
var cachedResults = Object.keys(results).reduce(function (acc, key) {
|
|
1440
|
-
|
|
1460
|
+
var res = results[key].results;
|
|
1461
|
+
if (!res) {
|
|
1462
|
+
return acc;
|
|
1463
|
+
}
|
|
1464
|
+
return acc.concat(res);
|
|
1441
1465
|
}, []);
|
|
1442
1466
|
|
|
1443
1467
|
// Algoliasearch API Client >= v4
|
|
@@ -1743,8 +1767,8 @@
|
|
|
1743
1767
|
error: instantSearchInstance.error
|
|
1744
1768
|
};
|
|
1745
1769
|
}
|
|
1746
|
-
function createRenderArgs(instantSearchInstance, parent) {
|
|
1747
|
-
var results = parent.
|
|
1770
|
+
function createRenderArgs(instantSearchInstance, parent, widget) {
|
|
1771
|
+
var results = parent.getResultsForWidget(widget);
|
|
1748
1772
|
var helper = parent.getHelper();
|
|
1749
1773
|
return {
|
|
1750
1774
|
helper: helper,
|
|
@@ -1752,7 +1776,7 @@
|
|
|
1752
1776
|
instantSearchInstance: instantSearchInstance,
|
|
1753
1777
|
results: results,
|
|
1754
1778
|
scopedResults: parent.getScopedResults(),
|
|
1755
|
-
state: results ? results._state : helper.state,
|
|
1779
|
+
state: results && '_state' in results ? results._state : helper.state,
|
|
1756
1780
|
renderState: instantSearchInstance.renderState,
|
|
1757
1781
|
templatesConfig: instantSearchInstance.templatesConfig,
|
|
1758
1782
|
createURL: parent.createURL,
|
|
@@ -4528,6 +4552,86 @@
|
|
|
4528
4552
|
}
|
|
4529
4553
|
|
|
4530
4554
|
var withUsage$d = createDocumentationMessageGenerator({
|
|
4555
|
+
name: 'related-products',
|
|
4556
|
+
connector: true
|
|
4557
|
+
});
|
|
4558
|
+
var connectRelatedProducts = function connectRelatedProducts(renderFn) {
|
|
4559
|
+
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
4560
|
+
checkRendering(renderFn, withUsage$d());
|
|
4561
|
+
return function relatedProducts(widgetParams) {
|
|
4562
|
+
var _ref = widgetParams || {},
|
|
4563
|
+
_ref$escapeHTML = _ref.escapeHTML,
|
|
4564
|
+
escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,
|
|
4565
|
+
objectIDs = _ref.objectIDs,
|
|
4566
|
+
limit = _ref.limit,
|
|
4567
|
+
threshold = _ref.threshold,
|
|
4568
|
+
fallbackParameters = _ref.fallbackParameters,
|
|
4569
|
+
queryParameters = _ref.queryParameters,
|
|
4570
|
+
_ref$transformItems = _ref.transformItems,
|
|
4571
|
+
transformItems = _ref$transformItems === void 0 ? function (items) {
|
|
4572
|
+
return items;
|
|
4573
|
+
} : _ref$transformItems;
|
|
4574
|
+
if (!objectIDs || objectIDs.length === 0) {
|
|
4575
|
+
throw new Error(withUsage$d('The `objectIDs` option is required.'));
|
|
4576
|
+
}
|
|
4577
|
+
return {
|
|
4578
|
+
dependsOn: 'recommend',
|
|
4579
|
+
$$type: 'ais.relatedProducts',
|
|
4580
|
+
init: function init(initOptions) {
|
|
4581
|
+
renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {
|
|
4582
|
+
instantSearchInstance: initOptions.instantSearchInstance
|
|
4583
|
+
}), true);
|
|
4584
|
+
},
|
|
4585
|
+
render: function render(renderOptions) {
|
|
4586
|
+
var renderState = this.getWidgetRenderState(renderOptions);
|
|
4587
|
+
renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {
|
|
4588
|
+
instantSearchInstance: renderOptions.instantSearchInstance
|
|
4589
|
+
}), false);
|
|
4590
|
+
},
|
|
4591
|
+
getRenderState: function getRenderState(renderState) {
|
|
4592
|
+
return renderState;
|
|
4593
|
+
},
|
|
4594
|
+
getWidgetRenderState: function getWidgetRenderState(_ref2) {
|
|
4595
|
+
var results = _ref2.results;
|
|
4596
|
+
if (results === null || results === undefined) {
|
|
4597
|
+
return {
|
|
4598
|
+
items: [],
|
|
4599
|
+
widgetParams: widgetParams
|
|
4600
|
+
};
|
|
4601
|
+
}
|
|
4602
|
+
if (escapeHTML && results.hits.length > 0) {
|
|
4603
|
+
results.hits = escapeHits(results.hits);
|
|
4604
|
+
}
|
|
4605
|
+
return {
|
|
4606
|
+
items: transformItems(results.hits, {
|
|
4607
|
+
results: results
|
|
4608
|
+
}),
|
|
4609
|
+
widgetParams: widgetParams
|
|
4610
|
+
};
|
|
4611
|
+
},
|
|
4612
|
+
dispose: function dispose(_ref3) {
|
|
4613
|
+
var recommendState = _ref3.recommendState;
|
|
4614
|
+
unmountFn();
|
|
4615
|
+
return recommendState.removeParams(this.$$id);
|
|
4616
|
+
},
|
|
4617
|
+
getWidgetParameters: function getWidgetParameters(state) {
|
|
4618
|
+
var _this = this;
|
|
4619
|
+
return objectIDs.reduce(function (acc, objectID) {
|
|
4620
|
+
return acc.addRelatedProducts({
|
|
4621
|
+
objectID: objectID,
|
|
4622
|
+
maxRecommendations: limit,
|
|
4623
|
+
threshold: threshold,
|
|
4624
|
+
fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
4625
|
+
queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
4626
|
+
$$id: _this.$$id
|
|
4627
|
+
});
|
|
4628
|
+
}, state.removeParams(this.$$id));
|
|
4629
|
+
}
|
|
4630
|
+
};
|
|
4631
|
+
};
|
|
4632
|
+
};
|
|
4633
|
+
|
|
4634
|
+
var withUsage$e = createDocumentationMessageGenerator({
|
|
4531
4635
|
name: 'search-box',
|
|
4532
4636
|
connector: true
|
|
4533
4637
|
});
|
|
@@ -4553,7 +4657,7 @@
|
|
|
4553
4657
|
*/
|
|
4554
4658
|
var connectSearchBox = function connectSearchBox(renderFn) {
|
|
4555
4659
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
4556
|
-
checkRendering(renderFn, withUsage$
|
|
4660
|
+
checkRendering(renderFn, withUsage$e());
|
|
4557
4661
|
return function (widgetParams) {
|
|
4558
4662
|
var _ref = widgetParams || {},
|
|
4559
4663
|
_ref$queryHook = _ref.queryHook,
|
|
@@ -4624,7 +4728,7 @@
|
|
|
4624
4728
|
};
|
|
4625
4729
|
};
|
|
4626
4730
|
|
|
4627
|
-
var withUsage$
|
|
4731
|
+
var withUsage$f = createDocumentationMessageGenerator({
|
|
4628
4732
|
name: 'sort-by',
|
|
4629
4733
|
connector: true
|
|
4630
4734
|
});
|
|
@@ -4637,7 +4741,7 @@
|
|
|
4637
4741
|
|
|
4638
4742
|
var connectSortBy = function connectSortBy(renderFn) {
|
|
4639
4743
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
4640
|
-
checkRendering(renderFn, withUsage$
|
|
4744
|
+
checkRendering(renderFn, withUsage$f());
|
|
4641
4745
|
var connectorState = {};
|
|
4642
4746
|
return function (widgetParams) {
|
|
4643
4747
|
var _ref = widgetParams || {},
|
|
@@ -4647,7 +4751,7 @@
|
|
|
4647
4751
|
return x;
|
|
4648
4752
|
} : _ref$transformItems;
|
|
4649
4753
|
if (!Array.isArray(items)) {
|
|
4650
|
-
throw new Error(withUsage$
|
|
4754
|
+
throw new Error(withUsage$f('The `items` option expects an array of objects.'));
|
|
4651
4755
|
}
|
|
4652
4756
|
return {
|
|
4653
4757
|
$$type: 'ais.sortBy',
|
|
@@ -4719,7 +4823,7 @@
|
|
|
4719
4823
|
};
|
|
4720
4824
|
};
|
|
4721
4825
|
|
|
4722
|
-
var withUsage$
|
|
4826
|
+
var withUsage$g = createDocumentationMessageGenerator({
|
|
4723
4827
|
name: 'rating-menu',
|
|
4724
4828
|
connector: true
|
|
4725
4829
|
});
|
|
@@ -4776,7 +4880,7 @@
|
|
|
4776
4880
|
*/
|
|
4777
4881
|
var connectRatingMenu = function connectRatingMenu(renderFn) {
|
|
4778
4882
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
4779
|
-
checkRendering(renderFn, withUsage$
|
|
4883
|
+
checkRendering(renderFn, withUsage$g());
|
|
4780
4884
|
return function (widgetParams) {
|
|
4781
4885
|
var _ref2 = widgetParams || {},
|
|
4782
4886
|
attribute = _ref2.attribute,
|
|
@@ -4784,7 +4888,7 @@
|
|
|
4784
4888
|
max = _ref2$max === void 0 ? 5 : _ref2$max;
|
|
4785
4889
|
var sendEvent;
|
|
4786
4890
|
if (!attribute) {
|
|
4787
|
-
throw new Error(withUsage$
|
|
4891
|
+
throw new Error(withUsage$g('The `attribute` option is required.'));
|
|
4788
4892
|
}
|
|
4789
4893
|
var _getRefinedStar = function getRefinedStar(state) {
|
|
4790
4894
|
var _values$;
|
|
@@ -4991,7 +5095,7 @@
|
|
|
4991
5095
|
return indexUiState;
|
|
4992
5096
|
}
|
|
4993
5097
|
|
|
4994
|
-
var withUsage$
|
|
5098
|
+
var withUsage$h = createDocumentationMessageGenerator({
|
|
4995
5099
|
name: 'stats',
|
|
4996
5100
|
connector: true
|
|
4997
5101
|
});
|
|
@@ -5003,7 +5107,7 @@
|
|
|
5003
5107
|
|
|
5004
5108
|
var connectStats = function connectStats(renderFn) {
|
|
5005
5109
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5006
|
-
checkRendering(renderFn, withUsage$
|
|
5110
|
+
checkRendering(renderFn, withUsage$h());
|
|
5007
5111
|
return function (widgetParams) {
|
|
5008
5112
|
return {
|
|
5009
5113
|
$$type: 'ais.stats',
|
|
@@ -5059,7 +5163,7 @@
|
|
|
5059
5163
|
};
|
|
5060
5164
|
};
|
|
5061
5165
|
|
|
5062
|
-
var withUsage$
|
|
5166
|
+
var withUsage$i = createDocumentationMessageGenerator({
|
|
5063
5167
|
name: 'toggle-refinement',
|
|
5064
5168
|
connector: true
|
|
5065
5169
|
});
|
|
@@ -5119,7 +5223,7 @@
|
|
|
5119
5223
|
*/
|
|
5120
5224
|
var connectToggleRefinement = function connectToggleRefinement(renderFn) {
|
|
5121
5225
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5122
|
-
checkRendering(renderFn, withUsage$
|
|
5226
|
+
checkRendering(renderFn, withUsage$i());
|
|
5123
5227
|
return function (widgetParams) {
|
|
5124
5228
|
var _ref2 = widgetParams || {},
|
|
5125
5229
|
attribute = _ref2.attribute,
|
|
@@ -5127,7 +5231,7 @@
|
|
|
5127
5231
|
userOn = _ref2$on === void 0 ? true : _ref2$on,
|
|
5128
5232
|
userOff = _ref2.off;
|
|
5129
5233
|
if (!attribute) {
|
|
5130
|
-
throw new Error(withUsage$
|
|
5234
|
+
throw new Error(withUsage$i('The `attribute` option is required.'));
|
|
5131
5235
|
}
|
|
5132
5236
|
var hasAnOffValue = userOff !== undefined;
|
|
5133
5237
|
// even though facet values can be numbers and boolean,
|
|
@@ -5355,13 +5459,89 @@
|
|
|
5355
5459
|
};
|
|
5356
5460
|
};
|
|
5357
5461
|
|
|
5358
|
-
var withUsage$
|
|
5462
|
+
var withUsage$j = createDocumentationMessageGenerator({
|
|
5463
|
+
name: 'trending-items',
|
|
5464
|
+
connector: true
|
|
5465
|
+
});
|
|
5466
|
+
var connectTrendingItems = function connectTrendingItems(renderFn) {
|
|
5467
|
+
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5468
|
+
checkRendering(renderFn, withUsage$j());
|
|
5469
|
+
return function trendingItems(widgetParams) {
|
|
5470
|
+
var _ref = widgetParams || {},
|
|
5471
|
+
facetName = _ref.facetName,
|
|
5472
|
+
facetValue = _ref.facetValue,
|
|
5473
|
+
limit = _ref.limit,
|
|
5474
|
+
threshold = _ref.threshold,
|
|
5475
|
+
fallbackParameters = _ref.fallbackParameters,
|
|
5476
|
+
queryParameters = _ref.queryParameters,
|
|
5477
|
+
_ref$escapeHTML = _ref.escapeHTML,
|
|
5478
|
+
escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,
|
|
5479
|
+
_ref$transformItems = _ref.transformItems,
|
|
5480
|
+
transformItems = _ref$transformItems === void 0 ? function (items) {
|
|
5481
|
+
return items;
|
|
5482
|
+
} : _ref$transformItems;
|
|
5483
|
+
return {
|
|
5484
|
+
dependsOn: 'recommend',
|
|
5485
|
+
$$type: 'ais.trendingItems',
|
|
5486
|
+
init: function init(initOptions) {
|
|
5487
|
+
renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {
|
|
5488
|
+
instantSearchInstance: initOptions.instantSearchInstance
|
|
5489
|
+
}), true);
|
|
5490
|
+
},
|
|
5491
|
+
render: function render(renderOptions) {
|
|
5492
|
+
var renderState = this.getWidgetRenderState(renderOptions);
|
|
5493
|
+
renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {
|
|
5494
|
+
instantSearchInstance: renderOptions.instantSearchInstance
|
|
5495
|
+
}), false);
|
|
5496
|
+
},
|
|
5497
|
+
getRenderState: function getRenderState(renderState) {
|
|
5498
|
+
return renderState;
|
|
5499
|
+
},
|
|
5500
|
+
getWidgetRenderState: function getWidgetRenderState(_ref2) {
|
|
5501
|
+
var results = _ref2.results;
|
|
5502
|
+
if (results === null || results === undefined) {
|
|
5503
|
+
return {
|
|
5504
|
+
items: [],
|
|
5505
|
+
widgetParams: widgetParams
|
|
5506
|
+
};
|
|
5507
|
+
}
|
|
5508
|
+
if (escapeHTML && results.hits.length > 0) {
|
|
5509
|
+
results.hits = escapeHits(results.hits);
|
|
5510
|
+
}
|
|
5511
|
+
return {
|
|
5512
|
+
items: transformItems(results.hits, {
|
|
5513
|
+
results: results
|
|
5514
|
+
}),
|
|
5515
|
+
widgetParams: widgetParams
|
|
5516
|
+
};
|
|
5517
|
+
},
|
|
5518
|
+
dispose: function dispose(_ref3) {
|
|
5519
|
+
var recommendState = _ref3.recommendState;
|
|
5520
|
+
unmountFn();
|
|
5521
|
+
return recommendState.removeParams(this.$$id);
|
|
5522
|
+
},
|
|
5523
|
+
getWidgetParameters: function getWidgetParameters(state) {
|
|
5524
|
+
return state.removeParams(this.$$id).addTrendingItems({
|
|
5525
|
+
facetName: facetName,
|
|
5526
|
+
facetValue: facetValue,
|
|
5527
|
+
maxRecommendations: limit,
|
|
5528
|
+
threshold: threshold,
|
|
5529
|
+
fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
5530
|
+
queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
5531
|
+
$$id: this.$$id
|
|
5532
|
+
});
|
|
5533
|
+
}
|
|
5534
|
+
};
|
|
5535
|
+
};
|
|
5536
|
+
};
|
|
5537
|
+
|
|
5538
|
+
var withUsage$k = createDocumentationMessageGenerator({
|
|
5359
5539
|
name: 'breadcrumb',
|
|
5360
5540
|
connector: true
|
|
5361
5541
|
});
|
|
5362
5542
|
var connectBreadcrumb = function connectBreadcrumb(renderFn) {
|
|
5363
5543
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5364
|
-
checkRendering(renderFn, withUsage$
|
|
5544
|
+
checkRendering(renderFn, withUsage$k());
|
|
5365
5545
|
var connectorState = {};
|
|
5366
5546
|
return function (widgetParams) {
|
|
5367
5547
|
var _ref = widgetParams || {},
|
|
@@ -5375,7 +5555,7 @@
|
|
|
5375
5555
|
return items;
|
|
5376
5556
|
} : _ref$transformItems;
|
|
5377
5557
|
if (!attributes || !Array.isArray(attributes) || attributes.length === 0) {
|
|
5378
|
-
throw new Error(withUsage$
|
|
5558
|
+
throw new Error(withUsage$k('The `attributes` option expects an array of strings.'));
|
|
5379
5559
|
}
|
|
5380
5560
|
var _attributes = _slicedToArray(attributes, 1),
|
|
5381
5561
|
hierarchicalFacetName = _attributes[0];
|
|
@@ -5525,7 +5705,7 @@
|
|
|
5525
5705
|
return indexUiState;
|
|
5526
5706
|
}
|
|
5527
5707
|
|
|
5528
|
-
var withUsage$
|
|
5708
|
+
var withUsage$l = createDocumentationMessageGenerator({
|
|
5529
5709
|
name: 'geo-search',
|
|
5530
5710
|
connector: true
|
|
5531
5711
|
});
|
|
@@ -5551,7 +5731,7 @@
|
|
|
5551
5731
|
*/
|
|
5552
5732
|
var connectGeoSearch = function connectGeoSearch(renderFn) {
|
|
5553
5733
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5554
|
-
checkRendering(renderFn, withUsage$
|
|
5734
|
+
checkRendering(renderFn, withUsage$l());
|
|
5555
5735
|
return function (widgetParams) {
|
|
5556
5736
|
var _ref = widgetParams || {},
|
|
5557
5737
|
_ref$enableRefineOnMa = _ref.enableRefineOnMapMove,
|
|
@@ -5723,7 +5903,7 @@
|
|
|
5723
5903
|
};
|
|
5724
5904
|
};
|
|
5725
5905
|
|
|
5726
|
-
var withUsage$
|
|
5906
|
+
var withUsage$m = createDocumentationMessageGenerator({
|
|
5727
5907
|
name: 'powered-by',
|
|
5728
5908
|
connector: true
|
|
5729
5909
|
});
|
|
@@ -5733,7 +5913,7 @@
|
|
|
5733
5913
|
*/
|
|
5734
5914
|
var connectPoweredBy = function connectPoweredBy(renderFn) {
|
|
5735
5915
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
5736
|
-
checkRendering(renderFn, withUsage$
|
|
5916
|
+
checkRendering(renderFn, withUsage$m());
|
|
5737
5917
|
var defaultUrl = 'https://www.algolia.com/?' + 'utm_source=instantsearch.js&' + 'utm_medium=website&' + "utm_content=".concat(safelyRunOnBrowser(function (_ref) {
|
|
5738
5918
|
var _window$location;
|
|
5739
5919
|
var window = _ref.window;
|
|
@@ -6297,15 +6477,8 @@
|
|
|
6297
6477
|
|
|
6298
6478
|
addParams: function (params) {
|
|
6299
6479
|
var newParams = this.params.slice();
|
|
6300
|
-
var existingParamsIndex = this.params.findIndex(function (currentParams) {
|
|
6301
|
-
return currentParams.$$id === params.$$id;
|
|
6302
|
-
});
|
|
6303
6480
|
|
|
6304
|
-
|
|
6305
|
-
newParams.splice(existingParamsIndex, 1, params);
|
|
6306
|
-
} else {
|
|
6307
|
-
newParams.push(params);
|
|
6308
|
-
}
|
|
6481
|
+
newParams.push(params);
|
|
6309
6482
|
|
|
6310
6483
|
return new RecommendParameters({ params: newParams });
|
|
6311
6484
|
},
|
|
@@ -6348,18 +6521,50 @@
|
|
|
6348
6521
|
);
|
|
6349
6522
|
},
|
|
6350
6523
|
|
|
6351
|
-
_buildQueries: function (indexName) {
|
|
6352
|
-
return this.params
|
|
6353
|
-
|
|
6354
|
-
|
|
6524
|
+
_buildQueries: function (indexName, cache) {
|
|
6525
|
+
return this.params
|
|
6526
|
+
.filter(function (params) {
|
|
6527
|
+
return cache[params.$$id] === undefined;
|
|
6528
|
+
})
|
|
6529
|
+
.map(function (params) {
|
|
6530
|
+
var query = Object.assign({}, params, { indexName: indexName });
|
|
6531
|
+
delete query.$$id;
|
|
6355
6532
|
|
|
6356
|
-
|
|
6357
|
-
|
|
6533
|
+
return query;
|
|
6534
|
+
});
|
|
6358
6535
|
},
|
|
6359
6536
|
};
|
|
6360
6537
|
|
|
6361
6538
|
var RecommendParameters_1 = RecommendParameters;
|
|
6362
6539
|
|
|
6540
|
+
/**
|
|
6541
|
+
* Constructor for SearchResults
|
|
6542
|
+
* @class
|
|
6543
|
+
* @classdesc SearchResults contains the results of a query to Algolia using the
|
|
6544
|
+
* {@link AlgoliaSearchHelper}.
|
|
6545
|
+
* @param {RecommendParameters} state state that led to the response
|
|
6546
|
+
* @param {Record<string,RecommendResultItem>} results the results from algolia client
|
|
6547
|
+
**/
|
|
6548
|
+
function RecommendResults(state, results) {
|
|
6549
|
+
this._state = state;
|
|
6550
|
+
this._rawResults = {};
|
|
6551
|
+
|
|
6552
|
+
// eslint-disable-next-line consistent-this
|
|
6553
|
+
var self = this;
|
|
6554
|
+
|
|
6555
|
+
state.params.forEach(function (param) {
|
|
6556
|
+
var id = param.$$id;
|
|
6557
|
+
self[id] = results[id];
|
|
6558
|
+
self._rawResults[id] = results[id];
|
|
6559
|
+
});
|
|
6560
|
+
}
|
|
6561
|
+
|
|
6562
|
+
RecommendResults.prototype = {
|
|
6563
|
+
constructor: RecommendResults,
|
|
6564
|
+
};
|
|
6565
|
+
|
|
6566
|
+
var RecommendResults_1 = RecommendResults;
|
|
6567
|
+
|
|
6363
6568
|
function sortObject(obj) {
|
|
6364
6569
|
return Object.keys(obj)
|
|
6365
6570
|
.sort()
|
|
@@ -10207,7 +10412,66 @@
|
|
|
10207
10412
|
|
|
10208
10413
|
var SearchResults_1 = SearchResults;
|
|
10209
10414
|
|
|
10210
|
-
|
|
10415
|
+
// @MAJOR: remove this function and use Array.prototype.flat
|
|
10416
|
+
var flat = function flat(arr) {
|
|
10417
|
+
return arr.reduce(function (acc, val) {
|
|
10418
|
+
return acc.concat(val);
|
|
10419
|
+
}, []);
|
|
10420
|
+
};
|
|
10421
|
+
|
|
10422
|
+
function getAverageIndices(indexTracker, nrOfObjs) {
|
|
10423
|
+
var avgIndices = [];
|
|
10424
|
+
|
|
10425
|
+
Object.keys(indexTracker).forEach(function (key) {
|
|
10426
|
+
if (indexTracker[key].count < 2) {
|
|
10427
|
+
indexTracker[key].indexSum += 100;
|
|
10428
|
+
}
|
|
10429
|
+
avgIndices.push({
|
|
10430
|
+
objectID: key,
|
|
10431
|
+
avgOfIndices: indexTracker[key].indexSum / nrOfObjs,
|
|
10432
|
+
});
|
|
10433
|
+
});
|
|
10434
|
+
|
|
10435
|
+
return avgIndices.sort(function (a, b) {
|
|
10436
|
+
return a.avgOfIndices > b.avgOfIndices ? 1 : -1;
|
|
10437
|
+
});
|
|
10438
|
+
}
|
|
10439
|
+
|
|
10440
|
+
function sortAndMergeRecommendations(results) {
|
|
10441
|
+
var indexTracker = {};
|
|
10442
|
+
|
|
10443
|
+
results.forEach(function (hits) {
|
|
10444
|
+
hits.forEach(function (hit, index) {
|
|
10445
|
+
if (!indexTracker[hit.objectID]) {
|
|
10446
|
+
indexTracker[hit.objectID] = { indexSum: index, count: 1 };
|
|
10447
|
+
} else {
|
|
10448
|
+
indexTracker[hit.objectID] = {
|
|
10449
|
+
indexSum: indexTracker[hit.objectID].indexSum + index,
|
|
10450
|
+
count: indexTracker[hit.objectID].count + 1,
|
|
10451
|
+
};
|
|
10452
|
+
}
|
|
10453
|
+
});
|
|
10454
|
+
});
|
|
10455
|
+
|
|
10456
|
+
var sortedAverageIndices = getAverageIndices(indexTracker, results.length);
|
|
10457
|
+
|
|
10458
|
+
var finalOrder = sortedAverageIndices.reduce(function (
|
|
10459
|
+
orderedHits,
|
|
10460
|
+
avgIndexRef
|
|
10461
|
+
) {
|
|
10462
|
+
var result = find$1(flat(results), function (hit) {
|
|
10463
|
+
return hit.objectID === avgIndexRef.objectID;
|
|
10464
|
+
});
|
|
10465
|
+
return result ? orderedHits.concat(result) : orderedHits;
|
|
10466
|
+
},
|
|
10467
|
+
[]);
|
|
10468
|
+
|
|
10469
|
+
return finalOrder;
|
|
10470
|
+
}
|
|
10471
|
+
|
|
10472
|
+
var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
|
|
10473
|
+
|
|
10474
|
+
var version = '3.21.0';
|
|
10211
10475
|
|
|
10212
10476
|
var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
|
|
10213
10477
|
|
|
@@ -10220,6 +10484,8 @@
|
|
|
10220
10484
|
|
|
10221
10485
|
|
|
10222
10486
|
|
|
10487
|
+
|
|
10488
|
+
|
|
10223
10489
|
/**
|
|
10224
10490
|
* Event triggered when a parameter is set or updated
|
|
10225
10491
|
* @event AlgoliaSearchHelper#event:change
|
|
@@ -10346,6 +10612,7 @@
|
|
|
10346
10612
|
this._currentNbQueries = 0;
|
|
10347
10613
|
this._currentNbRecommendQueries = 0;
|
|
10348
10614
|
this._searchResultsOptions = searchResultsOptions;
|
|
10615
|
+
this._recommendCache = {};
|
|
10349
10616
|
}
|
|
10350
10617
|
|
|
10351
10618
|
inherits_1(AlgoliaSearchHelper, events);
|
|
@@ -11134,7 +11401,7 @@
|
|
|
11134
11401
|
/**
|
|
11135
11402
|
* Removes a "frequently bought together" recommendation query.
|
|
11136
11403
|
*
|
|
11137
|
-
* @param {
|
|
11404
|
+
* @param {number} id identifier of the recommendation widget
|
|
11138
11405
|
* @returns {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
11139
11406
|
* @fires change
|
|
11140
11407
|
* @chainable
|
|
@@ -11150,7 +11417,7 @@
|
|
|
11150
11417
|
/**
|
|
11151
11418
|
* Removes a "related products" recommendation query.
|
|
11152
11419
|
*
|
|
11153
|
-
* @param {
|
|
11420
|
+
* @param {number} id identifier of the recommendation widget
|
|
11154
11421
|
* @returns {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
11155
11422
|
* @fires change
|
|
11156
11423
|
* @chainable
|
|
@@ -11166,7 +11433,7 @@
|
|
|
11166
11433
|
/**
|
|
11167
11434
|
* Removes a "trending items" recommendation query.
|
|
11168
11435
|
*
|
|
11169
|
-
* @param {
|
|
11436
|
+
* @param {number} id identifier of the recommendation widget
|
|
11170
11437
|
* @returns {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
11171
11438
|
* @fires change
|
|
11172
11439
|
* @chainable
|
|
@@ -11182,7 +11449,7 @@
|
|
|
11182
11449
|
/**
|
|
11183
11450
|
* Removes a "trending facets" recommendation query.
|
|
11184
11451
|
*
|
|
11185
|
-
* @param {
|
|
11452
|
+
* @param {number} id identifier of the recommendation widget
|
|
11186
11453
|
* @returns {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
11187
11454
|
* @fires change
|
|
11188
11455
|
* @chainable
|
|
@@ -11198,7 +11465,7 @@
|
|
|
11198
11465
|
/**
|
|
11199
11466
|
* Removes a "looking similar" recommendation query.
|
|
11200
11467
|
*
|
|
11201
|
-
* @param {
|
|
11468
|
+
* @param {number} id identifier of the recommendation widget
|
|
11202
11469
|
* @returns {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
11203
11470
|
* @fires change
|
|
11204
11471
|
* @chainable
|
|
@@ -11783,6 +12050,9 @@
|
|
|
11783
12050
|
var recommendState = this.recommendState;
|
|
11784
12051
|
var index = this.getIndex();
|
|
11785
12052
|
var states = [{ state: recommendState, index: index, helper: this }];
|
|
12053
|
+
var ids = recommendState.params.map(function (param) {
|
|
12054
|
+
return param.$$id;
|
|
12055
|
+
});
|
|
11786
12056
|
|
|
11787
12057
|
this.emit('fetch', {
|
|
11788
12058
|
recommend: {
|
|
@@ -11791,6 +12061,8 @@
|
|
|
11791
12061
|
},
|
|
11792
12062
|
});
|
|
11793
12063
|
|
|
12064
|
+
var cache = this._recommendCache;
|
|
12065
|
+
|
|
11794
12066
|
var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {
|
|
11795
12067
|
var derivedIndex = derivedHelper.getModifiedState(searchState).index;
|
|
11796
12068
|
if (!derivedIndex) {
|
|
@@ -11809,6 +12081,13 @@
|
|
|
11809
12081
|
helper: derivedHelper,
|
|
11810
12082
|
});
|
|
11811
12083
|
|
|
12084
|
+
ids = Array.prototype.concat.apply(
|
|
12085
|
+
ids,
|
|
12086
|
+
derivedState.params.map(function (param) {
|
|
12087
|
+
return param.$$id;
|
|
12088
|
+
})
|
|
12089
|
+
);
|
|
12090
|
+
|
|
11812
12091
|
derivedHelper.emit('fetch', {
|
|
11813
12092
|
recommend: {
|
|
11814
12093
|
state: derivedState,
|
|
@@ -11816,11 +12095,11 @@
|
|
|
11816
12095
|
},
|
|
11817
12096
|
});
|
|
11818
12097
|
|
|
11819
|
-
return derivedState._buildQueries(derivedIndex);
|
|
12098
|
+
return derivedState._buildQueries(derivedIndex, cache);
|
|
11820
12099
|
});
|
|
11821
12100
|
|
|
11822
12101
|
var queries = Array.prototype.concat.apply(
|
|
11823
|
-
this.recommendState._buildQueries(index),
|
|
12102
|
+
this.recommendState._buildQueries(index, cache),
|
|
11824
12103
|
derivedQueries
|
|
11825
12104
|
);
|
|
11826
12105
|
|
|
@@ -11834,7 +12113,7 @@
|
|
|
11834
12113
|
) {
|
|
11835
12114
|
// eslint-disable-next-line no-console
|
|
11836
12115
|
console.warn(
|
|
11837
|
-
'Please update algoliasearch/lite to the latest version in order to use
|
|
12116
|
+
'Please update algoliasearch/lite to the latest version in order to use recommend widgets.'
|
|
11838
12117
|
);
|
|
11839
12118
|
return;
|
|
11840
12119
|
}
|
|
@@ -11845,7 +12124,7 @@
|
|
|
11845
12124
|
try {
|
|
11846
12125
|
this.client
|
|
11847
12126
|
.getRecommendations(queries)
|
|
11848
|
-
.then(this._dispatchRecommendResponse.bind(this, queryId, states))
|
|
12127
|
+
.then(this._dispatchRecommendResponse.bind(this, queryId, states, ids))
|
|
11849
12128
|
.catch(this._dispatchRecommendError.bind(this, queryId));
|
|
11850
12129
|
} catch (error) {
|
|
11851
12130
|
// If we reach this part, we're in an internal error state
|
|
@@ -11919,6 +12198,7 @@
|
|
|
11919
12198
|
AlgoliaSearchHelper.prototype._dispatchRecommendResponse = function (
|
|
11920
12199
|
queryId,
|
|
11921
12200
|
states,
|
|
12201
|
+
ids,
|
|
11922
12202
|
content
|
|
11923
12203
|
) {
|
|
11924
12204
|
// @TODO remove the number of outdated queries discarded instead of just one
|
|
@@ -11934,7 +12214,39 @@
|
|
|
11934
12214
|
|
|
11935
12215
|
if (this._currentNbRecommendQueries === 0) this.emit('recommendQueueEmpty');
|
|
11936
12216
|
|
|
11937
|
-
var
|
|
12217
|
+
var cache = this._recommendCache;
|
|
12218
|
+
|
|
12219
|
+
var idsMap = {};
|
|
12220
|
+
ids
|
|
12221
|
+
.filter(function (id) {
|
|
12222
|
+
return cache[id] === undefined;
|
|
12223
|
+
})
|
|
12224
|
+
.forEach(function (id, index) {
|
|
12225
|
+
if (!idsMap[id]) idsMap[id] = [];
|
|
12226
|
+
|
|
12227
|
+
idsMap[id].push(index);
|
|
12228
|
+
});
|
|
12229
|
+
|
|
12230
|
+
Object.keys(idsMap).forEach(function (id) {
|
|
12231
|
+
var indices = idsMap[id];
|
|
12232
|
+
var firstResult = content.results[indices[0]];
|
|
12233
|
+
if (indices.length === 1) {
|
|
12234
|
+
cache[id] = firstResult;
|
|
12235
|
+
return;
|
|
12236
|
+
}
|
|
12237
|
+
cache[id] = Object.assign({}, firstResult, {
|
|
12238
|
+
hits: sortAndMergeRecommendations_1(
|
|
12239
|
+
indices.map(function (idx) {
|
|
12240
|
+
return content.results[idx].hits;
|
|
12241
|
+
})
|
|
12242
|
+
),
|
|
12243
|
+
});
|
|
12244
|
+
});
|
|
12245
|
+
|
|
12246
|
+
var results = {};
|
|
12247
|
+
ids.forEach(function (id) {
|
|
12248
|
+
results[id] = cache[id];
|
|
12249
|
+
});
|
|
11938
12250
|
|
|
11939
12251
|
states.forEach(function (s) {
|
|
11940
12252
|
var state = s.state;
|
|
@@ -11950,7 +12262,7 @@
|
|
|
11950
12262
|
return;
|
|
11951
12263
|
}
|
|
11952
12264
|
|
|
11953
|
-
helper.lastRecommendResults = results;
|
|
12265
|
+
helper.lastRecommendResults = new RecommendResults_1(state, results);
|
|
11954
12266
|
|
|
11955
12267
|
// eslint-disable-next-line no-warning-comments
|
|
11956
12268
|
// TODO: emit "result" event when events for Recommend are implemented
|
|
@@ -12236,13 +12548,20 @@
|
|
|
12236
12548
|
*/
|
|
12237
12549
|
algoliasearchHelper.SearchResults = SearchResults_1;
|
|
12238
12550
|
|
|
12551
|
+
/**
|
|
12552
|
+
* Constructor for the object containing the results for Recommend.
|
|
12553
|
+
* @member module:algoliasearchHelper.RecommendResults
|
|
12554
|
+
* @type {RecommendResults}
|
|
12555
|
+
*/
|
|
12556
|
+
algoliasearchHelper.RecommendResults = RecommendResults_1;
|
|
12557
|
+
|
|
12239
12558
|
var algoliasearchHelper_1 = algoliasearchHelper;
|
|
12240
12559
|
|
|
12241
12560
|
/**
|
|
12242
12561
|
* Refine the given search parameters.
|
|
12243
12562
|
*/
|
|
12244
12563
|
|
|
12245
|
-
var withUsage$
|
|
12564
|
+
var withUsage$n = createDocumentationMessageGenerator({
|
|
12246
12565
|
name: 'configure',
|
|
12247
12566
|
connector: true
|
|
12248
12567
|
});
|
|
@@ -12259,7 +12578,7 @@
|
|
|
12259
12578
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
12260
12579
|
return function (widgetParams) {
|
|
12261
12580
|
if (!widgetParams || !isPlainObject(widgetParams.searchParameters)) {
|
|
12262
|
-
throw new Error(withUsage$
|
|
12581
|
+
throw new Error(withUsage$n('The `searchParameters` option expects an object.'));
|
|
12263
12582
|
}
|
|
12264
12583
|
var connectorState = {};
|
|
12265
12584
|
function refine(helper) {
|
|
@@ -12328,7 +12647,7 @@
|
|
|
12328
12647
|
};
|
|
12329
12648
|
};
|
|
12330
12649
|
|
|
12331
|
-
var withUsage$
|
|
12650
|
+
var withUsage$o = createDocumentationMessageGenerator({
|
|
12332
12651
|
name: 'configure-related-items',
|
|
12333
12652
|
connector: true
|
|
12334
12653
|
});
|
|
@@ -12348,10 +12667,10 @@
|
|
|
12348
12667
|
return x;
|
|
12349
12668
|
} : _ref2$transformSearch;
|
|
12350
12669
|
if (!hit) {
|
|
12351
|
-
throw new Error(withUsage$
|
|
12670
|
+
throw new Error(withUsage$o('The `hit` option is required.'));
|
|
12352
12671
|
}
|
|
12353
12672
|
if (!matchingPatterns) {
|
|
12354
|
-
throw new Error(withUsage$
|
|
12673
|
+
throw new Error(withUsage$o('The `matchingPatterns` option is required.'));
|
|
12355
12674
|
}
|
|
12356
12675
|
var optionalFilters = Object.keys(matchingPatterns).reduce(function (acc, attributeName) {
|
|
12357
12676
|
var attribute = matchingPatterns[attributeName];
|
|
@@ -12390,13 +12709,13 @@
|
|
|
12390
12709
|
};
|
|
12391
12710
|
};
|
|
12392
12711
|
|
|
12393
|
-
var withUsage$
|
|
12712
|
+
var withUsage$p = createDocumentationMessageGenerator({
|
|
12394
12713
|
name: 'autocomplete',
|
|
12395
12714
|
connector: true
|
|
12396
12715
|
});
|
|
12397
12716
|
var connectAutocomplete = function connectAutocomplete(renderFn) {
|
|
12398
12717
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
12399
|
-
checkRendering(renderFn, withUsage$
|
|
12718
|
+
checkRendering(renderFn, withUsage$p());
|
|
12400
12719
|
return function (widgetParams) {
|
|
12401
12720
|
var _ref = widgetParams || {},
|
|
12402
12721
|
_ref$escapeHTML = _ref.escapeHTML,
|
|
@@ -12503,7 +12822,7 @@
|
|
|
12503
12822
|
};
|
|
12504
12823
|
};
|
|
12505
12824
|
|
|
12506
|
-
var withUsage$
|
|
12825
|
+
var withUsage$q = createDocumentationMessageGenerator({
|
|
12507
12826
|
name: 'query-rules',
|
|
12508
12827
|
connector: true
|
|
12509
12828
|
});
|
|
@@ -12561,7 +12880,7 @@
|
|
|
12561
12880
|
}
|
|
12562
12881
|
var connectQueryRules = function connectQueryRules(_render) {
|
|
12563
12882
|
var unmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
12564
|
-
checkRendering(_render, withUsage$
|
|
12883
|
+
checkRendering(_render, withUsage$q());
|
|
12565
12884
|
return function (widgetParams) {
|
|
12566
12885
|
var _ref2 = widgetParams || {},
|
|
12567
12886
|
_ref2$trackedFilters = _ref2.trackedFilters,
|
|
@@ -12576,7 +12895,7 @@
|
|
|
12576
12895
|
} : _ref2$transformItems;
|
|
12577
12896
|
Object.keys(trackedFilters).forEach(function (facetName) {
|
|
12578
12897
|
if (typeof trackedFilters[facetName] !== 'function') {
|
|
12579
|
-
throw new Error(withUsage$
|
|
12898
|
+
throw new Error(withUsage$q("'The \"".concat(facetName, "\" filter value in the `trackedFilters` option expects a function.")));
|
|
12580
12899
|
}
|
|
12581
12900
|
});
|
|
12582
12901
|
var hasTrackedFilters = Object.keys(trackedFilters).length > 0;
|
|
@@ -12769,13 +13088,13 @@
|
|
|
12769
13088
|
};
|
|
12770
13089
|
};
|
|
12771
13090
|
|
|
12772
|
-
var withUsage$
|
|
13091
|
+
var withUsage$r = createDocumentationMessageGenerator({
|
|
12773
13092
|
name: 'voice-search',
|
|
12774
13093
|
connector: true
|
|
12775
13094
|
});
|
|
12776
13095
|
var connectVoiceSearch = function connectVoiceSearch(renderFn) {
|
|
12777
13096
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
12778
|
-
checkRendering(renderFn, withUsage$
|
|
13097
|
+
checkRendering(renderFn, withUsage$r());
|
|
12779
13098
|
return function (widgetParams) {
|
|
12780
13099
|
var _widgetParams$searchA = widgetParams.searchAsYouSpeak,
|
|
12781
13100
|
searchAsYouSpeak = _widgetParams$searchA === void 0 ? false : _widgetParams$searchA,
|
|
@@ -12967,44 +13286,207 @@
|
|
|
12967
13286
|
};
|
|
12968
13287
|
};
|
|
12969
13288
|
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
var
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13289
|
+
var withUsage$s = createDocumentationMessageGenerator({
|
|
13290
|
+
name: 'frequently-bought-together',
|
|
13291
|
+
connector: true
|
|
13292
|
+
});
|
|
13293
|
+
var connectFrequentlyBoughtTogether = function connectFrequentlyBoughtTogether(renderFn) {
|
|
13294
|
+
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
13295
|
+
checkRendering(renderFn, withUsage$s());
|
|
13296
|
+
return function (widgetParams) {
|
|
13297
|
+
var _ref = widgetParams || {},
|
|
13298
|
+
_ref$escapeHTML = _ref.escapeHTML,
|
|
13299
|
+
escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,
|
|
13300
|
+
_ref$transformItems = _ref.transformItems,
|
|
13301
|
+
transformItems = _ref$transformItems === void 0 ? function (items) {
|
|
13302
|
+
return items;
|
|
13303
|
+
} : _ref$transformItems,
|
|
13304
|
+
objectIDs = _ref.objectIDs,
|
|
13305
|
+
limit = _ref.limit,
|
|
13306
|
+
threshold = _ref.threshold,
|
|
13307
|
+
queryParameters = _ref.queryParameters;
|
|
13308
|
+
if (!objectIDs || objectIDs.length === 0) {
|
|
13309
|
+
throw new Error(withUsage$s('The `objectIDs` option is required.'));
|
|
13310
|
+
}
|
|
13311
|
+
return {
|
|
13312
|
+
dependsOn: 'recommend',
|
|
13313
|
+
$$type: 'ais.frequentlyBoughtTogether',
|
|
13314
|
+
init: function init(initOptions) {
|
|
13315
|
+
renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {
|
|
13316
|
+
instantSearchInstance: initOptions.instantSearchInstance
|
|
13317
|
+
}), true);
|
|
13318
|
+
},
|
|
13319
|
+
render: function render(renderOptions) {
|
|
13320
|
+
var renderState = this.getWidgetRenderState(renderOptions);
|
|
13321
|
+
renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {
|
|
13322
|
+
instantSearchInstance: renderOptions.instantSearchInstance
|
|
13323
|
+
}), false);
|
|
13324
|
+
},
|
|
13325
|
+
getRenderState: function getRenderState(renderState) {
|
|
13326
|
+
return renderState;
|
|
13327
|
+
},
|
|
13328
|
+
getWidgetRenderState: function getWidgetRenderState(_ref2) {
|
|
13329
|
+
var results = _ref2.results;
|
|
13330
|
+
if (results === null || results === undefined) {
|
|
13331
|
+
return {
|
|
13332
|
+
items: [],
|
|
13333
|
+
widgetParams: widgetParams
|
|
13334
|
+
};
|
|
13335
|
+
}
|
|
13336
|
+
if (escapeHTML && results.hits.length > 0) {
|
|
13337
|
+
results.hits = escapeHits(results.hits);
|
|
13338
|
+
}
|
|
13339
|
+
var transformedItems = transformItems(results.hits, {
|
|
13340
|
+
results: results
|
|
13341
|
+
});
|
|
13342
|
+
return {
|
|
13343
|
+
items: transformedItems,
|
|
13344
|
+
widgetParams: widgetParams
|
|
13345
|
+
};
|
|
13346
|
+
},
|
|
13347
|
+
dispose: function dispose(_ref3) {
|
|
13348
|
+
var recommendState = _ref3.recommendState;
|
|
13349
|
+
unmountFn();
|
|
13350
|
+
return recommendState.removeParams(this.$$id);
|
|
13351
|
+
},
|
|
13352
|
+
getWidgetParameters: function getWidgetParameters(state) {
|
|
13353
|
+
var _this = this;
|
|
13354
|
+
return objectIDs.reduce(function (acc, objectID) {
|
|
13355
|
+
return acc.addFrequentlyBoughtTogether({
|
|
13356
|
+
objectID: objectID,
|
|
13357
|
+
threshold: threshold,
|
|
13358
|
+
maxRecommendations: limit,
|
|
13359
|
+
queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
13360
|
+
$$id: _this.$$id
|
|
13361
|
+
});
|
|
13362
|
+
}, state.removeParams(this.$$id));
|
|
13363
|
+
}
|
|
13364
|
+
};
|
|
13365
|
+
};
|
|
13366
|
+
};
|
|
13367
|
+
|
|
13368
|
+
var withUsage$t = createDocumentationMessageGenerator({
|
|
13369
|
+
name: 'looking-similar',
|
|
13370
|
+
connector: true
|
|
13371
|
+
});
|
|
13372
|
+
var connectLookingSimilar = function connectLookingSimilar(renderFn) {
|
|
13373
|
+
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
13374
|
+
checkRendering(renderFn, withUsage$t());
|
|
13375
|
+
return function LookingSimilar(widgetParams) {
|
|
13376
|
+
var _ref = widgetParams || {},
|
|
13377
|
+
_ref$escapeHTML = _ref.escapeHTML,
|
|
13378
|
+
escapeHTML = _ref$escapeHTML === void 0 ? true : _ref$escapeHTML,
|
|
13379
|
+
objectIDs = _ref.objectIDs,
|
|
13380
|
+
limit = _ref.limit,
|
|
13381
|
+
threshold = _ref.threshold,
|
|
13382
|
+
fallbackParameters = _ref.fallbackParameters,
|
|
13383
|
+
queryParameters = _ref.queryParameters,
|
|
13384
|
+
_ref$transformItems = _ref.transformItems,
|
|
13385
|
+
transformItems = _ref$transformItems === void 0 ? function (items) {
|
|
13386
|
+
return items;
|
|
13387
|
+
} : _ref$transformItems;
|
|
13388
|
+
if (!objectIDs || objectIDs.length === 0) {
|
|
13389
|
+
throw new Error(withUsage$t('The `objectIDs` option is required.'));
|
|
13390
|
+
}
|
|
13391
|
+
return {
|
|
13392
|
+
dependsOn: 'recommend',
|
|
13393
|
+
$$type: 'ais.lookingSimilar',
|
|
13394
|
+
init: function init(initOptions) {
|
|
13395
|
+
renderFn(_objectSpread2(_objectSpread2({}, this.getWidgetRenderState(initOptions)), {}, {
|
|
13396
|
+
instantSearchInstance: initOptions.instantSearchInstance
|
|
13397
|
+
}), true);
|
|
13398
|
+
},
|
|
13399
|
+
render: function render(renderOptions) {
|
|
13400
|
+
var renderState = this.getWidgetRenderState(renderOptions);
|
|
13401
|
+
renderFn(_objectSpread2(_objectSpread2({}, renderState), {}, {
|
|
13402
|
+
instantSearchInstance: renderOptions.instantSearchInstance
|
|
13403
|
+
}), false);
|
|
13404
|
+
},
|
|
13405
|
+
getRenderState: function getRenderState(renderState) {
|
|
13406
|
+
return renderState;
|
|
13407
|
+
},
|
|
13408
|
+
getWidgetRenderState: function getWidgetRenderState(_ref2) {
|
|
13409
|
+
var results = _ref2.results;
|
|
13410
|
+
if (results === null || results === undefined) {
|
|
13411
|
+
return {
|
|
13412
|
+
items: [],
|
|
13413
|
+
widgetParams: widgetParams
|
|
13414
|
+
};
|
|
13415
|
+
}
|
|
13416
|
+
if (escapeHTML && results.hits.length > 0) {
|
|
13417
|
+
results.hits = escapeHits(results.hits);
|
|
13418
|
+
}
|
|
13419
|
+
return {
|
|
13420
|
+
items: transformItems(results.hits, {
|
|
13421
|
+
results: results
|
|
13422
|
+
}),
|
|
13423
|
+
widgetParams: widgetParams
|
|
13424
|
+
};
|
|
13425
|
+
},
|
|
13426
|
+
dispose: function dispose(_ref3) {
|
|
13427
|
+
var recommendState = _ref3.recommendState;
|
|
13428
|
+
unmountFn();
|
|
13429
|
+
return recommendState.removeParams(this.$$id);
|
|
13430
|
+
},
|
|
13431
|
+
getWidgetParameters: function getWidgetParameters(state) {
|
|
13432
|
+
var _this = this;
|
|
13433
|
+
return objectIDs.reduce(function (acc, objectID) {
|
|
13434
|
+
return acc.addLookingSimilar({
|
|
13435
|
+
objectID: objectID,
|
|
13436
|
+
maxRecommendations: limit,
|
|
13437
|
+
threshold: threshold,
|
|
13438
|
+
fallbackParameters: _objectSpread2(_objectSpread2({}, fallbackParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
13439
|
+
queryParameters: _objectSpread2(_objectSpread2({}, queryParameters), escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
13440
|
+
$$id: _this.$$id
|
|
13441
|
+
});
|
|
13442
|
+
}, state.removeParams(this.$$id));
|
|
13443
|
+
}
|
|
13444
|
+
};
|
|
13445
|
+
};
|
|
13446
|
+
};
|
|
13447
|
+
|
|
13448
|
+
/** @deprecated answers is no longer supported */
|
|
13449
|
+
var EXPERIMENTAL_connectAnswers = deprecate(connectAnswers, 'answers is no longer supported');
|
|
13450
|
+
|
|
13451
|
+
/** @deprecated use connectDynamicWidgets */
|
|
13452
|
+
var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');
|
|
13453
|
+
|
|
13454
|
+
var connectors = /*#__PURE__*/Object.freeze({
|
|
13455
|
+
__proto__: null,
|
|
13456
|
+
EXPERIMENTAL_connectAnswers: EXPERIMENTAL_connectAnswers,
|
|
13457
|
+
EXPERIMENTAL_connectDynamicWidgets: EXPERIMENTAL_connectDynamicWidgets,
|
|
13458
|
+
connectDynamicWidgets: connectDynamicWidgets,
|
|
13459
|
+
connectClearRefinements: connectClearRefinements,
|
|
13460
|
+
connectCurrentRefinements: connectCurrentRefinements,
|
|
13461
|
+
connectHierarchicalMenu: connectHierarchicalMenu,
|
|
13462
|
+
connectHits: connectHits,
|
|
13463
|
+
connectHitsWithInsights: connectHitsWithInsights,
|
|
13464
|
+
connectHitsPerPage: connectHitsPerPage,
|
|
13465
|
+
connectInfiniteHits: connectInfiniteHits,
|
|
13466
|
+
connectInfiniteHitsWithInsights: connectInfiniteHitsWithInsights,
|
|
13467
|
+
connectMenu: connectMenu,
|
|
13468
|
+
connectNumericMenu: connectNumericMenu,
|
|
13469
|
+
connectPagination: connectPagination,
|
|
13470
|
+
connectRange: connectRange,
|
|
13471
|
+
connectRefinementList: connectRefinementList,
|
|
13472
|
+
connectRelatedProducts: connectRelatedProducts,
|
|
13473
|
+
connectSearchBox: connectSearchBox,
|
|
13474
|
+
connectSortBy: connectSortBy,
|
|
13475
|
+
connectRatingMenu: connectRatingMenu,
|
|
13476
|
+
connectStats: connectStats,
|
|
13477
|
+
connectToggleRefinement: connectToggleRefinement,
|
|
13478
|
+
connectTrendingItems: connectTrendingItems,
|
|
13479
|
+
connectBreadcrumb: connectBreadcrumb,
|
|
13480
|
+
connectGeoSearch: connectGeoSearch,
|
|
13481
|
+
connectPoweredBy: connectPoweredBy,
|
|
13482
|
+
connectConfigure: connectConfigure,
|
|
13003
13483
|
EXPERIMENTAL_connectConfigureRelatedItems: connectConfigureRelatedItems,
|
|
13004
13484
|
connectAutocomplete: connectAutocomplete,
|
|
13005
13485
|
connectQueryRules: connectQueryRules,
|
|
13006
13486
|
connectVoiceSearch: connectVoiceSearch,
|
|
13007
|
-
connectRelevantSort: connectRelevantSort
|
|
13487
|
+
connectRelevantSort: connectRelevantSort,
|
|
13488
|
+
connectFrequentlyBoughtTogether: connectFrequentlyBoughtTogether,
|
|
13489
|
+
connectLookingSimilar: connectLookingSimilar
|
|
13008
13490
|
});
|
|
13009
13491
|
|
|
13010
13492
|
var NAMESPACE = 'ais';
|
|
@@ -14819,7 +15301,7 @@
|
|
|
14819
15301
|
|
|
14820
15302
|
var _excluded$7 = ["initialSearchParameters"],
|
|
14821
15303
|
_excluded2$2 = ["initialRecommendParameters"];
|
|
14822
|
-
var withUsage$
|
|
15304
|
+
var withUsage$u = createDocumentationMessageGenerator({
|
|
14823
15305
|
name: 'index-widget'
|
|
14824
15306
|
});
|
|
14825
15307
|
/**
|
|
@@ -14914,7 +15396,7 @@
|
|
|
14914
15396
|
}
|
|
14915
15397
|
var index = function index(widgetParams) {
|
|
14916
15398
|
if (widgetParams === undefined || widgetParams.indexName === undefined) {
|
|
14917
|
-
throw new Error(withUsage$
|
|
15399
|
+
throw new Error(withUsage$u('The `indexName` option is required.'));
|
|
14918
15400
|
}
|
|
14919
15401
|
var indexName = widgetParams.indexName,
|
|
14920
15402
|
_widgetParams$indexId = widgetParams.indexId,
|
|
@@ -14926,6 +15408,8 @@
|
|
|
14926
15408
|
var helper = null;
|
|
14927
15409
|
var derivedHelper = null;
|
|
14928
15410
|
var lastValidSearchParameters = null;
|
|
15411
|
+
var hasRecommendWidget = false;
|
|
15412
|
+
var hasSearchWidget = false;
|
|
14929
15413
|
return {
|
|
14930
15414
|
$$type: 'ais.index',
|
|
14931
15415
|
$$widgetType: 'ais.index',
|
|
@@ -14950,6 +15434,16 @@
|
|
|
14950
15434
|
derivedHelper.lastResults._state = helper.state;
|
|
14951
15435
|
return derivedHelper.lastResults;
|
|
14952
15436
|
},
|
|
15437
|
+
getResultsForWidget: function getResultsForWidget(widget) {
|
|
15438
|
+
var _helper;
|
|
15439
|
+
if (widget.dependsOn !== 'recommend' || isIndexWidget(widget) || widget.$$id === undefined) {
|
|
15440
|
+
return this.getResults();
|
|
15441
|
+
}
|
|
15442
|
+
if (!((_helper = helper) !== null && _helper !== void 0 && _helper.lastRecommendResults)) {
|
|
15443
|
+
return null;
|
|
15444
|
+
}
|
|
15445
|
+
return helper.lastRecommendResults[widget.$$id];
|
|
15446
|
+
},
|
|
14953
15447
|
getPreviousState: function getPreviousState() {
|
|
14954
15448
|
return lastValidSearchParameters;
|
|
14955
15449
|
},
|
|
@@ -14987,13 +15481,28 @@
|
|
|
14987
15481
|
addWidgets: function addWidgets(widgets) {
|
|
14988
15482
|
var _this = this;
|
|
14989
15483
|
if (!Array.isArray(widgets)) {
|
|
14990
|
-
throw new Error(withUsage$
|
|
15484
|
+
throw new Error(withUsage$u('The `addWidgets` method expects an array of widgets.'));
|
|
14991
15485
|
}
|
|
14992
15486
|
if (widgets.some(function (widget) {
|
|
14993
15487
|
return typeof widget.init !== 'function' && typeof widget.render !== 'function';
|
|
14994
15488
|
})) {
|
|
14995
|
-
throw new Error(withUsage$
|
|
15489
|
+
throw new Error(withUsage$u('The widget definition expects a `render` and/or an `init` method.'));
|
|
14996
15490
|
}
|
|
15491
|
+
widgets.forEach(function (widget) {
|
|
15492
|
+
if (isIndexWidget(widget)) {
|
|
15493
|
+
return;
|
|
15494
|
+
}
|
|
15495
|
+
if (localInstantSearchInstance && widget.dependsOn === 'recommend') {
|
|
15496
|
+
localInstantSearchInstance._hasRecommendWidget = true;
|
|
15497
|
+
} else if (localInstantSearchInstance) {
|
|
15498
|
+
localInstantSearchInstance._hasSearchWidget = true;
|
|
15499
|
+
} else if (widget.dependsOn === 'recommend') {
|
|
15500
|
+
hasRecommendWidget = true;
|
|
15501
|
+
} else {
|
|
15502
|
+
hasSearchWidget = true;
|
|
15503
|
+
}
|
|
15504
|
+
addWidgetId(widget);
|
|
15505
|
+
});
|
|
14997
15506
|
localWidgets = localWidgets.concat(widgets);
|
|
14998
15507
|
if (localInstantSearchInstance && Boolean(widgets.length)) {
|
|
14999
15508
|
privateHelperSetState(helper, {
|
|
@@ -15033,26 +15542,51 @@
|
|
|
15033
15542
|
removeWidgets: function removeWidgets(widgets) {
|
|
15034
15543
|
var _this2 = this;
|
|
15035
15544
|
if (!Array.isArray(widgets)) {
|
|
15036
|
-
throw new Error(withUsage$
|
|
15545
|
+
throw new Error(withUsage$u('The `removeWidgets` method expects an array of widgets.'));
|
|
15037
15546
|
}
|
|
15038
15547
|
if (widgets.some(function (widget) {
|
|
15039
15548
|
return typeof widget.dispose !== 'function';
|
|
15040
15549
|
})) {
|
|
15041
|
-
throw new Error(withUsage$
|
|
15550
|
+
throw new Error(withUsage$u('The widget definition expects a `dispose` method.'));
|
|
15042
15551
|
}
|
|
15043
15552
|
localWidgets = localWidgets.filter(function (widget) {
|
|
15044
15553
|
return widgets.indexOf(widget) === -1;
|
|
15045
15554
|
});
|
|
15555
|
+
localWidgets.forEach(function (widget) {
|
|
15556
|
+
if (isIndexWidget(widget)) {
|
|
15557
|
+
return;
|
|
15558
|
+
}
|
|
15559
|
+
if (localInstantSearchInstance && widget.dependsOn === 'recommend') {
|
|
15560
|
+
localInstantSearchInstance._hasRecommendWidget = true;
|
|
15561
|
+
} else if (localInstantSearchInstance) {
|
|
15562
|
+
localInstantSearchInstance._hasSearchWidget = true;
|
|
15563
|
+
} else if (widget.dependsOn === 'recommend') {
|
|
15564
|
+
hasRecommendWidget = true;
|
|
15565
|
+
} else {
|
|
15566
|
+
hasSearchWidget = true;
|
|
15567
|
+
}
|
|
15568
|
+
});
|
|
15046
15569
|
if (localInstantSearchInstance && Boolean(widgets.length)) {
|
|
15047
|
-
var
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15570
|
+
var _widgets$reduce = widgets.reduce(function (states, widget) {
|
|
15571
|
+
// the `dispose` method exists at this point we already assert it
|
|
15572
|
+
var next = widget.dispose({
|
|
15573
|
+
helper: helper,
|
|
15574
|
+
state: states.cleanedSearchState,
|
|
15575
|
+
recommendState: states.cleanedRecommendState,
|
|
15576
|
+
parent: _this2
|
|
15577
|
+
});
|
|
15578
|
+
if (next instanceof algoliasearchHelper_1.RecommendParameters) {
|
|
15579
|
+
states.cleanedRecommendState = next;
|
|
15580
|
+
} else if (next) {
|
|
15581
|
+
states.cleanedSearchState = next;
|
|
15582
|
+
}
|
|
15583
|
+
return states;
|
|
15584
|
+
}, {
|
|
15585
|
+
cleanedSearchState: helper.state,
|
|
15586
|
+
cleanedRecommendState: helper.recommendState
|
|
15587
|
+
}),
|
|
15588
|
+
cleanedSearchState = _widgets$reduce.cleanedSearchState,
|
|
15589
|
+
cleanedRecommendState = _widgets$reduce.cleanedRecommendState;
|
|
15056
15590
|
var newState = localInstantSearchInstance.future.preserveSharedStateOnUnmount ? getLocalWidgetsSearchParameters(localWidgets, {
|
|
15057
15591
|
uiState: localUiState,
|
|
15058
15592
|
initialSearchParameters: new algoliasearchHelper_1.SearchParameters({
|
|
@@ -15060,16 +15594,17 @@
|
|
|
15060
15594
|
})
|
|
15061
15595
|
}) : getLocalWidgetsSearchParameters(localWidgets, {
|
|
15062
15596
|
uiState: getLocalWidgetsUiState(localWidgets, {
|
|
15063
|
-
searchParameters:
|
|
15597
|
+
searchParameters: cleanedSearchState,
|
|
15064
15598
|
helper: helper
|
|
15065
15599
|
}),
|
|
15066
|
-
initialSearchParameters:
|
|
15600
|
+
initialSearchParameters: cleanedSearchState
|
|
15067
15601
|
});
|
|
15068
15602
|
localUiState = getLocalWidgetsUiState(localWidgets, {
|
|
15069
15603
|
searchParameters: newState,
|
|
15070
15604
|
helper: helper
|
|
15071
15605
|
});
|
|
15072
15606
|
helper.setState(newState);
|
|
15607
|
+
helper.recommendState = cleanedRecommendState;
|
|
15073
15608
|
if (localWidgets.length) {
|
|
15074
15609
|
localInstantSearchInstance.scheduleSearch();
|
|
15075
15610
|
}
|
|
@@ -15145,13 +15680,20 @@
|
|
|
15145
15680
|
return _this3.getHelper().recommendState;
|
|
15146
15681
|
});
|
|
15147
15682
|
var indexInitialResults = (_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : _instantSearchInstanc[this.getIndexId()];
|
|
15148
|
-
if (indexInitialResults) {
|
|
15683
|
+
if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.results) {
|
|
15149
15684
|
// We restore the shape of the results provided to the instance to respect
|
|
15150
15685
|
// the helper's structure.
|
|
15151
15686
|
var results = new algoliasearchHelper_1.SearchResults(new algoliasearchHelper_1.SearchParameters(indexInitialResults.state), indexInitialResults.results);
|
|
15152
15687
|
derivedHelper.lastResults = results;
|
|
15153
15688
|
helper.lastResults = results;
|
|
15154
15689
|
}
|
|
15690
|
+
if (indexInitialResults !== null && indexInitialResults !== void 0 && indexInitialResults.recommendResults) {
|
|
15691
|
+
var recommendResults = new algoliasearchHelper_1.RecommendResults(new algoliasearchHelper_1.RecommendParameters({
|
|
15692
|
+
params: indexInitialResults.recommendResults.params
|
|
15693
|
+
}), indexInitialResults.recommendResults.results);
|
|
15694
|
+
derivedHelper.lastRecommendResults = recommendResults;
|
|
15695
|
+
helper.lastRecommendResults = recommendResults;
|
|
15696
|
+
}
|
|
15155
15697
|
|
|
15156
15698
|
// Subscribe to the Helper state changes for the page before widgets
|
|
15157
15699
|
// are initialized. This behavior mimics the original one of the Helper.
|
|
@@ -15255,9 +15797,16 @@
|
|
|
15255
15797
|
// schedule a render that will render the results injected on the helper.
|
|
15256
15798
|
instantSearchInstance.scheduleRender();
|
|
15257
15799
|
}
|
|
15800
|
+
if (hasRecommendWidget) {
|
|
15801
|
+
instantSearchInstance._hasRecommendWidget = true;
|
|
15802
|
+
}
|
|
15803
|
+
if (hasSearchWidget) {
|
|
15804
|
+
instantSearchInstance._hasSearchWidget = true;
|
|
15805
|
+
}
|
|
15258
15806
|
},
|
|
15259
15807
|
render: function render(_ref6) {
|
|
15260
|
-
var
|
|
15808
|
+
var _derivedHelper2,
|
|
15809
|
+
_this4 = this;
|
|
15261
15810
|
var instantSearchInstance = _ref6.instantSearchInstance;
|
|
15262
15811
|
// we can't attach a listener to the error event of search, as the error
|
|
15263
15812
|
// then would no longer be thrown for global handlers.
|
|
@@ -15267,7 +15816,7 @@
|
|
|
15267
15816
|
|
|
15268
15817
|
// We only render index widgets if there are no results.
|
|
15269
15818
|
// This makes sure `render` is never called with `results` being `null`.
|
|
15270
|
-
var widgetsToRender = this.getResults() ? localWidgets : localWidgets.filter(isIndexWidget);
|
|
15819
|
+
var widgetsToRender = this.getResults() || (_derivedHelper2 = derivedHelper) !== null && _derivedHelper2 !== void 0 && _derivedHelper2.lastRecommendResults ? localWidgets : localWidgets.filter(isIndexWidget);
|
|
15271
15820
|
widgetsToRender = widgetsToRender.filter(function (widget) {
|
|
15272
15821
|
if (!widget.shouldRender) {
|
|
15273
15822
|
return true;
|
|
@@ -15278,7 +15827,7 @@
|
|
|
15278
15827
|
});
|
|
15279
15828
|
widgetsToRender.forEach(function (widget) {
|
|
15280
15829
|
if (widget.getRenderState) {
|
|
15281
|
-
var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, createRenderArgs(instantSearchInstance, _this4));
|
|
15830
|
+
var renderState = widget.getRenderState(instantSearchInstance.renderState[_this4.getIndexId()] || {}, createRenderArgs(instantSearchInstance, _this4, widget));
|
|
15282
15831
|
storeRenderState({
|
|
15283
15832
|
renderState: renderState,
|
|
15284
15833
|
instantSearchInstance: instantSearchInstance,
|
|
@@ -15295,14 +15844,14 @@
|
|
|
15295
15844
|
// not have results yet.
|
|
15296
15845
|
|
|
15297
15846
|
if (widget.render) {
|
|
15298
|
-
widget.render(createRenderArgs(instantSearchInstance, _this4));
|
|
15847
|
+
widget.render(createRenderArgs(instantSearchInstance, _this4, widget));
|
|
15299
15848
|
}
|
|
15300
15849
|
});
|
|
15301
15850
|
},
|
|
15302
15851
|
dispose: function dispose() {
|
|
15303
15852
|
var _this5 = this,
|
|
15304
|
-
|
|
15305
|
-
|
|
15853
|
+
_helper2,
|
|
15854
|
+
_derivedHelper3;
|
|
15306
15855
|
localWidgets.forEach(function (widget) {
|
|
15307
15856
|
if (widget.dispose && helper) {
|
|
15308
15857
|
// The dispose function is always called once the instance is started
|
|
@@ -15314,15 +15863,16 @@
|
|
|
15314
15863
|
widget.dispose({
|
|
15315
15864
|
helper: helper,
|
|
15316
15865
|
state: helper.state,
|
|
15866
|
+
recommendState: helper.recommendState,
|
|
15317
15867
|
parent: _this5
|
|
15318
15868
|
});
|
|
15319
15869
|
}
|
|
15320
15870
|
});
|
|
15321
15871
|
localInstantSearchInstance = null;
|
|
15322
15872
|
localParent = null;
|
|
15323
|
-
(
|
|
15873
|
+
(_helper2 = helper) === null || _helper2 === void 0 ? void 0 : _helper2.removeAllListeners();
|
|
15324
15874
|
helper = null;
|
|
15325
|
-
(
|
|
15875
|
+
(_derivedHelper3 = derivedHelper) === null || _derivedHelper3 === void 0 ? void 0 : _derivedHelper3.detach();
|
|
15326
15876
|
derivedHelper = null;
|
|
15327
15877
|
},
|
|
15328
15878
|
getWidgetUiState: function getWidgetUiState(uiState) {
|
|
@@ -15428,9 +15978,9 @@
|
|
|
15428
15978
|
};
|
|
15429
15979
|
}
|
|
15430
15980
|
|
|
15431
|
-
var version$1 = '4.
|
|
15981
|
+
var version$1 = '4.70.0';
|
|
15432
15982
|
|
|
15433
|
-
var withUsage$
|
|
15983
|
+
var withUsage$v = createDocumentationMessageGenerator({
|
|
15434
15984
|
name: 'instantsearch'
|
|
15435
15985
|
});
|
|
15436
15986
|
function defaultCreateURL() {
|
|
@@ -15481,6 +16031,8 @@
|
|
|
15481
16031
|
_defineProperty(_assertThisInitialized(_this), "_createURL", void 0);
|
|
15482
16032
|
_defineProperty(_assertThisInitialized(_this), "_searchFunction", void 0);
|
|
15483
16033
|
_defineProperty(_assertThisInitialized(_this), "_mainHelperSearch", void 0);
|
|
16034
|
+
_defineProperty(_assertThisInitialized(_this), "_hasSearchWidget", false);
|
|
16035
|
+
_defineProperty(_assertThisInitialized(_this), "_hasRecommendWidget", false);
|
|
15484
16036
|
_defineProperty(_assertThisInitialized(_this), "_insights", void 0);
|
|
15485
16037
|
_defineProperty(_assertThisInitialized(_this), "middleware", []);
|
|
15486
16038
|
_defineProperty(_assertThisInitialized(_this), "sendEventToInsights", void 0);
|
|
@@ -15545,7 +16097,7 @@
|
|
|
15545
16097
|
_options$future = options.future,
|
|
15546
16098
|
future = _options$future === void 0 ? _objectSpread2(_objectSpread2({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;
|
|
15547
16099
|
if (searchClient === null) {
|
|
15548
|
-
throw new Error(withUsage$
|
|
16100
|
+
throw new Error(withUsage$v('The `searchClient` option is required.'));
|
|
15549
16101
|
}
|
|
15550
16102
|
if (typeof searchClient.search !== 'function') {
|
|
15551
16103
|
throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");
|
|
@@ -15555,7 +16107,7 @@
|
|
|
15555
16107
|
}
|
|
15556
16108
|
_warning(insightsClient === null, "`insightsClient` property has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\n\nFor more information, visit https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/js/") ;
|
|
15557
16109
|
if (insightsClient && typeof insightsClient !== 'function') {
|
|
15558
|
-
throw new Error(withUsage$
|
|
16110
|
+
throw new Error(withUsage$v('The `insightsClient` option should be a function.'));
|
|
15559
16111
|
}
|
|
15560
16112
|
_warning(!options.searchParameters, "The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\n\nYou can replace it with the `configure` widget:\n\n```\nsearch.addWidgets([\n configure(".concat(JSON.stringify(options.searchParameters, null, 2), ")\n]);\n```\n\nSee ").concat(createDocumentationLink({
|
|
15561
16113
|
name: 'configure'
|
|
@@ -15716,12 +16268,12 @@
|
|
|
15716
16268
|
key: "addWidgets",
|
|
15717
16269
|
value: function addWidgets(widgets) {
|
|
15718
16270
|
if (!Array.isArray(widgets)) {
|
|
15719
|
-
throw new Error(withUsage$
|
|
16271
|
+
throw new Error(withUsage$v('The `addWidgets` method expects an array of widgets. Please use `addWidget`.'));
|
|
15720
16272
|
}
|
|
15721
16273
|
if (widgets.some(function (widget) {
|
|
15722
16274
|
return typeof widget.init !== 'function' && typeof widget.render !== 'function';
|
|
15723
16275
|
})) {
|
|
15724
|
-
throw new Error(withUsage$
|
|
16276
|
+
throw new Error(withUsage$v('The widget definition expects a `render` and/or an `init` method.'));
|
|
15725
16277
|
}
|
|
15726
16278
|
this.mainIndex.addWidgets(widgets);
|
|
15727
16279
|
return this;
|
|
@@ -15751,12 +16303,12 @@
|
|
|
15751
16303
|
key: "removeWidgets",
|
|
15752
16304
|
value: function removeWidgets(widgets) {
|
|
15753
16305
|
if (!Array.isArray(widgets)) {
|
|
15754
|
-
throw new Error(withUsage$
|
|
16306
|
+
throw new Error(withUsage$v('The `removeWidgets` method expects an array of widgets. Please use `removeWidget`.'));
|
|
15755
16307
|
}
|
|
15756
16308
|
if (widgets.some(function (widget) {
|
|
15757
16309
|
return typeof widget.dispose !== 'function';
|
|
15758
16310
|
})) {
|
|
15759
|
-
throw new Error(withUsage$
|
|
16311
|
+
throw new Error(withUsage$v('The widget definition expects a `dispose` method.'));
|
|
15760
16312
|
}
|
|
15761
16313
|
this.mainIndex.removeWidgets(widgets);
|
|
15762
16314
|
return this;
|
|
@@ -15771,7 +16323,7 @@
|
|
|
15771
16323
|
value: function start() {
|
|
15772
16324
|
var _this3 = this;
|
|
15773
16325
|
if (this.started) {
|
|
15774
|
-
throw new Error(withUsage$
|
|
16326
|
+
throw new Error(withUsage$v('The `start` method has already been called once.'));
|
|
15775
16327
|
}
|
|
15776
16328
|
|
|
15777
16329
|
// This Helper is used for the queries, we don't care about its state. The
|
|
@@ -15791,7 +16343,13 @@
|
|
|
15791
16343
|
// under the hood, we have a different implementation. It should be
|
|
15792
16344
|
// completely transparent for the rest of the codebase. Only this module
|
|
15793
16345
|
// is impacted.
|
|
15794
|
-
|
|
16346
|
+
if (_this3._hasSearchWidget) {
|
|
16347
|
+
mainHelper.searchOnlyWithDerivedHelpers();
|
|
16348
|
+
}
|
|
16349
|
+
if (_this3._hasRecommendWidget) {
|
|
16350
|
+
mainHelper.recommend();
|
|
16351
|
+
}
|
|
16352
|
+
return mainHelper;
|
|
15795
16353
|
};
|
|
15796
16354
|
if (this._searchFunction) {
|
|
15797
16355
|
// this client isn't used to actually search, but required for the helper
|
|
@@ -15858,6 +16416,7 @@
|
|
|
15858
16416
|
});
|
|
15859
16417
|
if (this._initialResults) {
|
|
15860
16418
|
hydrateSearchClient(this.client, this._initialResults);
|
|
16419
|
+
hydrateRecommendCache(this.mainHelper, this._initialResults);
|
|
15861
16420
|
var originalScheduleSearch = this.scheduleSearch;
|
|
15862
16421
|
// We don't schedule a first search when initial results are provided
|
|
15863
16422
|
// because we already have the results to render. This skips the initial
|
|
@@ -15968,7 +16527,7 @@
|
|
|
15968
16527
|
var _this5 = this;
|
|
15969
16528
|
var callOnStateChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
15970
16529
|
if (!this.mainHelper) {
|
|
15971
|
-
throw new Error(withUsage$
|
|
16530
|
+
throw new Error(withUsage$v('The `start` method needs to be called before `setUiState`.'));
|
|
15972
16531
|
}
|
|
15973
16532
|
|
|
15974
16533
|
// We refresh the index UI state to update the local UI state that the
|
|
@@ -16004,7 +16563,7 @@
|
|
|
16004
16563
|
value: function createURL() {
|
|
16005
16564
|
var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16006
16565
|
if (!this.started) {
|
|
16007
|
-
throw new Error(withUsage$
|
|
16566
|
+
throw new Error(withUsage$v('The `start` method needs to be called before `createURL`.'));
|
|
16008
16567
|
}
|
|
16009
16568
|
return this._createURL(nextState);
|
|
16010
16569
|
}
|
|
@@ -16012,7 +16571,7 @@
|
|
|
16012
16571
|
key: "refresh",
|
|
16013
16572
|
value: function refresh() {
|
|
16014
16573
|
if (!this.mainHelper) {
|
|
16015
|
-
throw new Error(withUsage$
|
|
16574
|
+
throw new Error(withUsage$v('The `start` method needs to be called before `refresh`.'));
|
|
16016
16575
|
}
|
|
16017
16576
|
this.mainHelper.clearCache().search();
|
|
16018
16577
|
}
|
|
@@ -16092,6 +16651,70 @@
|
|
|
16092
16651
|
|
|
16093
16652
|
var _extends$1 = unwrapExports(_extends_1);
|
|
16094
16653
|
|
|
16654
|
+
var _typeof_1 = createCommonjsModule(function (module) {
|
|
16655
|
+
function _typeof(obj) {
|
|
16656
|
+
"@babel/helpers - typeof";
|
|
16657
|
+
|
|
16658
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
16659
|
+
return typeof obj;
|
|
16660
|
+
} : function (obj) {
|
|
16661
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
16662
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
16663
|
+
}
|
|
16664
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16665
|
+
});
|
|
16666
|
+
|
|
16667
|
+
unwrapExports(_typeof_1);
|
|
16668
|
+
|
|
16669
|
+
var toPrimitive = createCommonjsModule(function (module) {
|
|
16670
|
+
var _typeof = _typeof_1["default"];
|
|
16671
|
+
function _toPrimitive(input, hint) {
|
|
16672
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
16673
|
+
var prim = input[Symbol.toPrimitive];
|
|
16674
|
+
if (prim !== undefined) {
|
|
16675
|
+
var res = prim.call(input, hint || "default");
|
|
16676
|
+
if (_typeof(res) !== "object") return res;
|
|
16677
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16678
|
+
}
|
|
16679
|
+
return (hint === "string" ? String : Number)(input);
|
|
16680
|
+
}
|
|
16681
|
+
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16682
|
+
});
|
|
16683
|
+
|
|
16684
|
+
unwrapExports(toPrimitive);
|
|
16685
|
+
|
|
16686
|
+
var toPropertyKey = createCommonjsModule(function (module) {
|
|
16687
|
+
var _typeof = _typeof_1["default"];
|
|
16688
|
+
|
|
16689
|
+
function _toPropertyKey(arg) {
|
|
16690
|
+
var key = toPrimitive(arg, "string");
|
|
16691
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
16692
|
+
}
|
|
16693
|
+
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16694
|
+
});
|
|
16695
|
+
|
|
16696
|
+
unwrapExports(toPropertyKey);
|
|
16697
|
+
|
|
16698
|
+
var defineProperty = createCommonjsModule(function (module) {
|
|
16699
|
+
function _defineProperty(obj, key, value) {
|
|
16700
|
+
key = toPropertyKey(key);
|
|
16701
|
+
if (key in obj) {
|
|
16702
|
+
Object.defineProperty(obj, key, {
|
|
16703
|
+
value: value,
|
|
16704
|
+
enumerable: true,
|
|
16705
|
+
configurable: true,
|
|
16706
|
+
writable: true
|
|
16707
|
+
});
|
|
16708
|
+
} else {
|
|
16709
|
+
obj[key] = value;
|
|
16710
|
+
}
|
|
16711
|
+
return obj;
|
|
16712
|
+
}
|
|
16713
|
+
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16714
|
+
});
|
|
16715
|
+
|
|
16716
|
+
var _defineProperty$1 = unwrapExports(defineProperty);
|
|
16717
|
+
|
|
16095
16718
|
var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
|
|
16096
16719
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
16097
16720
|
if (source == null) return {};
|
|
@@ -16143,45 +16766,192 @@
|
|
|
16143
16766
|
}, []).filter(Boolean).join(' ');
|
|
16144
16767
|
}
|
|
16145
16768
|
|
|
16146
|
-
|
|
16147
|
-
|
|
16769
|
+
function createDefaultEmptyComponent(_ref) {
|
|
16770
|
+
var createElement = _ref.createElement,
|
|
16771
|
+
Fragment = _ref.Fragment;
|
|
16772
|
+
var _ref2 = createElement(Fragment, null, "No results");
|
|
16773
|
+
return function DefaultEmpty() {
|
|
16774
|
+
return _ref2;
|
|
16775
|
+
};
|
|
16776
|
+
}
|
|
16777
|
+
|
|
16778
|
+
function createDefaultHeaderComponent(_ref) {
|
|
16148
16779
|
var createElement = _ref.createElement;
|
|
16149
|
-
return function
|
|
16150
|
-
var classNames =
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16780
|
+
return function DefaultHeader(userProps) {
|
|
16781
|
+
var _userProps$classNames = userProps.classNames,
|
|
16782
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
16783
|
+
items = userProps.items,
|
|
16784
|
+
translations = userProps.translations;
|
|
16785
|
+
if (!items || items.length < 1) {
|
|
16786
|
+
return null;
|
|
16787
|
+
}
|
|
16788
|
+
if (!translations.title) {
|
|
16789
|
+
return null;
|
|
16790
|
+
}
|
|
16791
|
+
return createElement("h3", {
|
|
16792
|
+
className: classNames.title
|
|
16793
|
+
}, translations.title);
|
|
16159
16794
|
};
|
|
16160
16795
|
}
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
Fragment
|
|
16167
|
-
}
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
_userProps$separator = userProps.separator,
|
|
16175
|
-
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
16176
|
-
className = userProps.className,
|
|
16177
|
-
_userProps$classNames = userProps.classNames,
|
|
16796
|
+
|
|
16797
|
+
function createDefaultItemComponent(_ref) {
|
|
16798
|
+
var createElement = _ref.createElement,
|
|
16799
|
+
Fragment = _ref.Fragment;
|
|
16800
|
+
return function DefaultItem(userProps) {
|
|
16801
|
+
return createElement(Fragment, null, JSON.stringify(userProps.item, null, 2));
|
|
16802
|
+
};
|
|
16803
|
+
}
|
|
16804
|
+
|
|
16805
|
+
function createListViewComponent(_ref) {
|
|
16806
|
+
var createElement = _ref.createElement;
|
|
16807
|
+
return function ListView(userProps) {
|
|
16808
|
+
var _userProps$classNames = userProps.classNames,
|
|
16178
16809
|
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16810
|
+
ItemComponent = userProps.itemComponent,
|
|
16811
|
+
items = userProps.items,
|
|
16812
|
+
sendEvent = userProps.sendEvent;
|
|
16813
|
+
return createElement("div", {
|
|
16814
|
+
className: classNames.container
|
|
16815
|
+
}, createElement("ol", {
|
|
16816
|
+
className: classNames.list
|
|
16817
|
+
}, items.map(function (item) {
|
|
16818
|
+
return createElement("li", {
|
|
16819
|
+
key: item.objectID,
|
|
16820
|
+
className: classNames.item,
|
|
16821
|
+
onClick: sendEvent,
|
|
16822
|
+
onAuxClick: sendEvent
|
|
16823
|
+
}, createElement(ItemComponent, {
|
|
16824
|
+
item: item
|
|
16825
|
+
}));
|
|
16826
|
+
})));
|
|
16827
|
+
};
|
|
16828
|
+
}
|
|
16829
|
+
|
|
16830
|
+
var _excluded$9 = ["classNames", "emptyComponent", "headerComponent", "itemComponent", "view", "items", "status", "translations", "sendEvent"];
|
|
16831
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
16832
|
+
var keys = Object.keys(object);
|
|
16833
|
+
if (Object.getOwnPropertySymbols) {
|
|
16834
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
16835
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
16836
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
16837
|
+
})), keys.push.apply(keys, symbols);
|
|
16838
|
+
}
|
|
16839
|
+
return keys;
|
|
16840
|
+
}
|
|
16841
|
+
function _objectSpread(target) {
|
|
16842
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
16843
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16844
|
+
i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
16845
|
+
_defineProperty$1(target, key, source[key]);
|
|
16846
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
|
16847
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
16848
|
+
});
|
|
16849
|
+
}
|
|
16850
|
+
return target;
|
|
16851
|
+
}
|
|
16852
|
+
function createFrequentlyBoughtTogetherComponent(_ref) {
|
|
16853
|
+
var createElement = _ref.createElement,
|
|
16854
|
+
Fragment = _ref.Fragment;
|
|
16855
|
+
return function FrequentlyBoughtTogether(userProps) {
|
|
16856
|
+
var _userProps$classNames = userProps.classNames,
|
|
16857
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
16858
|
+
_userProps$emptyCompo = userProps.emptyComponent,
|
|
16859
|
+
EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({
|
|
16860
|
+
createElement: createElement,
|
|
16861
|
+
Fragment: Fragment
|
|
16862
|
+
}) : _userProps$emptyCompo,
|
|
16863
|
+
_userProps$headerComp = userProps.headerComponent,
|
|
16864
|
+
HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({
|
|
16865
|
+
createElement: createElement,
|
|
16866
|
+
Fragment: Fragment
|
|
16867
|
+
}) : _userProps$headerComp,
|
|
16868
|
+
_userProps$itemCompon = userProps.itemComponent,
|
|
16869
|
+
ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({
|
|
16870
|
+
createElement: createElement,
|
|
16871
|
+
Fragment: Fragment
|
|
16872
|
+
}) : _userProps$itemCompon,
|
|
16873
|
+
_userProps$view = userProps.view,
|
|
16874
|
+
View = _userProps$view === void 0 ? createListViewComponent({
|
|
16875
|
+
createElement: createElement,
|
|
16876
|
+
Fragment: Fragment
|
|
16877
|
+
}) : _userProps$view,
|
|
16878
|
+
items = userProps.items,
|
|
16879
|
+
status = userProps.status,
|
|
16880
|
+
userTranslations = userProps.translations,
|
|
16881
|
+
sendEvent = userProps.sendEvent,
|
|
16882
|
+
props = _objectWithoutProperties$1(userProps, _excluded$9);
|
|
16883
|
+
var translations = _objectSpread({
|
|
16884
|
+
title: 'Frequently bought together',
|
|
16885
|
+
sliderLabel: 'Frequently bought together products'
|
|
16886
|
+
}, userTranslations);
|
|
16887
|
+
var cssClasses = {
|
|
16888
|
+
root: cx('ais-FrequentlyBoughtTogether', classNames.root),
|
|
16889
|
+
emptyRoot: cx('ais-FrequentlyBoughtTogether', classNames.root, 'ais-FrequentlyBoughtTogether--empty', classNames.emptyRoot, props.className),
|
|
16890
|
+
title: cx('ais-FrequentlyBoughtTogether-title', classNames.title),
|
|
16891
|
+
container: cx('ais-FrequentlyBoughtTogether-container', classNames.container),
|
|
16892
|
+
list: cx('ais-FrequentlyBoughtTogether-list', classNames.list),
|
|
16893
|
+
item: cx('ais-FrequentlyBoughtTogether-item', classNames.item)
|
|
16894
|
+
};
|
|
16895
|
+
if (items.length === 0 && status === 'idle') {
|
|
16896
|
+
return createElement("section", _extends$1({}, props, {
|
|
16897
|
+
className: cssClasses.emptyRoot
|
|
16898
|
+
}), createElement(EmptyComponent, null));
|
|
16899
|
+
}
|
|
16900
|
+
return createElement("section", _extends$1({}, props, {
|
|
16901
|
+
className: cssClasses.root
|
|
16902
|
+
}), createElement(HeaderComponent, {
|
|
16903
|
+
classNames: cssClasses,
|
|
16904
|
+
items: items,
|
|
16905
|
+
translations: translations
|
|
16906
|
+
}), createElement(View, {
|
|
16907
|
+
classNames: cssClasses,
|
|
16908
|
+
translations: translations,
|
|
16909
|
+
itemComponent: ItemComponent,
|
|
16910
|
+
items: items,
|
|
16911
|
+
sendEvent: sendEvent
|
|
16912
|
+
}));
|
|
16913
|
+
};
|
|
16914
|
+
}
|
|
16915
|
+
|
|
16916
|
+
var _excluded$a = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
16917
|
+
function createHighlightPartComponent(_ref) {
|
|
16918
|
+
var createElement = _ref.createElement;
|
|
16919
|
+
return function HighlightPart(_ref2) {
|
|
16920
|
+
var classNames = _ref2.classNames,
|
|
16921
|
+
children = _ref2.children,
|
|
16922
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
16923
|
+
isHighlighted = _ref2.isHighlighted,
|
|
16924
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
16925
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
16926
|
+
return createElement(TagName, {
|
|
16927
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
16928
|
+
}, children);
|
|
16929
|
+
};
|
|
16930
|
+
}
|
|
16931
|
+
function createHighlightComponent(_ref3) {
|
|
16932
|
+
var createElement = _ref3.createElement,
|
|
16933
|
+
Fragment = _ref3.Fragment;
|
|
16934
|
+
var HighlightPart = createHighlightPartComponent({
|
|
16935
|
+
createElement: createElement,
|
|
16936
|
+
Fragment: Fragment
|
|
16937
|
+
});
|
|
16938
|
+
return function Highlight(userProps) {
|
|
16939
|
+
var parts = userProps.parts,
|
|
16940
|
+
_userProps$highlighte = userProps.highlightedTagName,
|
|
16941
|
+
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
16942
|
+
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
16943
|
+
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
16944
|
+
_userProps$separator = userProps.separator,
|
|
16945
|
+
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
16946
|
+
className = userProps.className,
|
|
16947
|
+
_userProps$classNames = userProps.classNames,
|
|
16948
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
16949
|
+
props = _objectWithoutProperties$1(userProps, _excluded$a);
|
|
16950
|
+
return createElement("span", _extends$1({}, props, {
|
|
16951
|
+
className: cx(classNames.root, className)
|
|
16952
|
+
}), parts.map(function (part, partIndex) {
|
|
16953
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
16954
|
+
return createElement(Fragment, {
|
|
16185
16955
|
key: partIndex
|
|
16186
16956
|
}, part.map(function (subPart, subPartIndex) {
|
|
16187
16957
|
return createElement(HighlightPart, {
|
|
@@ -16198,14 +16968,13 @@
|
|
|
16198
16968
|
};
|
|
16199
16969
|
}
|
|
16200
16970
|
|
|
16201
|
-
var _excluded$
|
|
16971
|
+
var _excluded$b = ["classNames", "hits", "itemComponent", "sendEvent", "emptyComponent", "banner", "bannerComponent"];
|
|
16202
16972
|
|
|
16203
16973
|
// Should be imported from a shared package in the future
|
|
16204
16974
|
|
|
16205
16975
|
function createDefaultBannerComponent(_ref) {
|
|
16206
16976
|
var createElement = _ref.createElement;
|
|
16207
16977
|
return function DefaultBanner(_ref2) {
|
|
16208
|
-
var _banner$link;
|
|
16209
16978
|
var classNames = _ref2.classNames,
|
|
16210
16979
|
banner = _ref2.banner;
|
|
16211
16980
|
if (!banner.image.urls[0].url) {
|
|
@@ -16213,7 +16982,7 @@
|
|
|
16213
16982
|
}
|
|
16214
16983
|
return createElement("aside", {
|
|
16215
16984
|
className: cx('ais-Hits-banner', classNames.bannerRoot)
|
|
16216
|
-
},
|
|
16985
|
+
}, banner.link ? createElement("a", {
|
|
16217
16986
|
className: cx('ais-Hits-banner-link', classNames.bannerLink),
|
|
16218
16987
|
href: banner.link.url,
|
|
16219
16988
|
target: banner.link.target
|
|
@@ -16244,7 +17013,7 @@
|
|
|
16244
17013
|
EmptyComponent = userProps.emptyComponent,
|
|
16245
17014
|
banner = userProps.banner,
|
|
16246
17015
|
BannerComponent = userProps.bannerComponent,
|
|
16247
|
-
props = _objectWithoutProperties$1(userProps, _excluded$
|
|
17016
|
+
props = _objectWithoutProperties$1(userProps, _excluded$b);
|
|
16248
17017
|
return createElement("div", _extends$1({}, props, {
|
|
16249
17018
|
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
16250
17019
|
}), banner && (BannerComponent ? createElement(BannerComponent, {
|
|
@@ -16272,6 +17041,264 @@
|
|
|
16272
17041
|
};
|
|
16273
17042
|
}
|
|
16274
17043
|
|
|
17044
|
+
var _excluded$c = ["classNames", "emptyComponent", "headerComponent", "itemComponent", "view", "items", "status", "translations", "sendEvent"];
|
|
17045
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
17046
|
+
var keys = Object.keys(object);
|
|
17047
|
+
if (Object.getOwnPropertySymbols) {
|
|
17048
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
17049
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
17050
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
17051
|
+
})), keys.push.apply(keys, symbols);
|
|
17052
|
+
}
|
|
17053
|
+
return keys;
|
|
17054
|
+
}
|
|
17055
|
+
function _objectSpread$1(target) {
|
|
17056
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17057
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
17058
|
+
i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
|
|
17059
|
+
_defineProperty$1(target, key, source[key]);
|
|
17060
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
|
|
17061
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
17062
|
+
});
|
|
17063
|
+
}
|
|
17064
|
+
return target;
|
|
17065
|
+
}
|
|
17066
|
+
function createRelatedProductsComponent(_ref) {
|
|
17067
|
+
var createElement = _ref.createElement,
|
|
17068
|
+
Fragment = _ref.Fragment;
|
|
17069
|
+
return function RelatedProducts(userProps) {
|
|
17070
|
+
var _userProps$classNames = userProps.classNames,
|
|
17071
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
17072
|
+
_userProps$emptyCompo = userProps.emptyComponent,
|
|
17073
|
+
EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({
|
|
17074
|
+
createElement: createElement,
|
|
17075
|
+
Fragment: Fragment
|
|
17076
|
+
}) : _userProps$emptyCompo,
|
|
17077
|
+
_userProps$headerComp = userProps.headerComponent,
|
|
17078
|
+
HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({
|
|
17079
|
+
createElement: createElement,
|
|
17080
|
+
Fragment: Fragment
|
|
17081
|
+
}) : _userProps$headerComp,
|
|
17082
|
+
_userProps$itemCompon = userProps.itemComponent,
|
|
17083
|
+
ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({
|
|
17084
|
+
createElement: createElement,
|
|
17085
|
+
Fragment: Fragment
|
|
17086
|
+
}) : _userProps$itemCompon,
|
|
17087
|
+
_userProps$view = userProps.view,
|
|
17088
|
+
View = _userProps$view === void 0 ? createListViewComponent({
|
|
17089
|
+
createElement: createElement,
|
|
17090
|
+
Fragment: Fragment
|
|
17091
|
+
}) : _userProps$view,
|
|
17092
|
+
items = userProps.items,
|
|
17093
|
+
status = userProps.status,
|
|
17094
|
+
userTranslations = userProps.translations,
|
|
17095
|
+
sendEvent = userProps.sendEvent,
|
|
17096
|
+
props = _objectWithoutProperties$1(userProps, _excluded$c);
|
|
17097
|
+
var translations = _objectSpread$1({
|
|
17098
|
+
title: 'Related products',
|
|
17099
|
+
sliderLabel: 'Related products'
|
|
17100
|
+
}, userTranslations);
|
|
17101
|
+
var cssClasses = {
|
|
17102
|
+
root: cx('ais-RelatedProducts', classNames.root),
|
|
17103
|
+
emptyRoot: cx('ais-RelatedProducts', classNames.root, 'ais-RelatedProducts--empty', classNames.emptyRoot, props.className),
|
|
17104
|
+
title: cx('ais-RelatedProducts-title', classNames.title),
|
|
17105
|
+
container: cx('ais-RelatedProducts-container', classNames.container),
|
|
17106
|
+
list: cx('ais-RelatedProducts-list', classNames.list),
|
|
17107
|
+
item: cx('ais-RelatedProducts-item', classNames.item)
|
|
17108
|
+
};
|
|
17109
|
+
if (items.length === 0 && status === 'idle') {
|
|
17110
|
+
return createElement("section", _extends$1({}, props, {
|
|
17111
|
+
className: cssClasses.emptyRoot
|
|
17112
|
+
}), createElement(EmptyComponent, null));
|
|
17113
|
+
}
|
|
17114
|
+
return createElement("section", _extends$1({}, props, {
|
|
17115
|
+
className: cssClasses.root
|
|
17116
|
+
}), createElement(HeaderComponent, {
|
|
17117
|
+
classNames: cssClasses,
|
|
17118
|
+
items: items,
|
|
17119
|
+
translations: translations
|
|
17120
|
+
}), createElement(View, {
|
|
17121
|
+
classNames: cssClasses,
|
|
17122
|
+
translations: translations,
|
|
17123
|
+
itemComponent: ItemComponent,
|
|
17124
|
+
items: items,
|
|
17125
|
+
sendEvent: sendEvent
|
|
17126
|
+
}));
|
|
17127
|
+
};
|
|
17128
|
+
}
|
|
17129
|
+
|
|
17130
|
+
var _excluded$d = ["classNames", "emptyComponent", "headerComponent", "itemComponent", "view", "items", "status", "translations", "sendEvent"];
|
|
17131
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
17132
|
+
var keys = Object.keys(object);
|
|
17133
|
+
if (Object.getOwnPropertySymbols) {
|
|
17134
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
17135
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
17136
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
17137
|
+
})), keys.push.apply(keys, symbols);
|
|
17138
|
+
}
|
|
17139
|
+
return keys;
|
|
17140
|
+
}
|
|
17141
|
+
function _objectSpread$2(target) {
|
|
17142
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17143
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
17144
|
+
i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) {
|
|
17145
|
+
_defineProperty$1(target, key, source[key]);
|
|
17146
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) {
|
|
17147
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
17148
|
+
});
|
|
17149
|
+
}
|
|
17150
|
+
return target;
|
|
17151
|
+
}
|
|
17152
|
+
function createTrendingItemsComponent(_ref) {
|
|
17153
|
+
var createElement = _ref.createElement,
|
|
17154
|
+
Fragment = _ref.Fragment;
|
|
17155
|
+
return function TrendingItems(userProps) {
|
|
17156
|
+
var _userProps$classNames = userProps.classNames,
|
|
17157
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
17158
|
+
_userProps$emptyCompo = userProps.emptyComponent,
|
|
17159
|
+
EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({
|
|
17160
|
+
createElement: createElement,
|
|
17161
|
+
Fragment: Fragment
|
|
17162
|
+
}) : _userProps$emptyCompo,
|
|
17163
|
+
_userProps$headerComp = userProps.headerComponent,
|
|
17164
|
+
HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({
|
|
17165
|
+
createElement: createElement,
|
|
17166
|
+
Fragment: Fragment
|
|
17167
|
+
}) : _userProps$headerComp,
|
|
17168
|
+
_userProps$itemCompon = userProps.itemComponent,
|
|
17169
|
+
ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({
|
|
17170
|
+
createElement: createElement,
|
|
17171
|
+
Fragment: Fragment
|
|
17172
|
+
}) : _userProps$itemCompon,
|
|
17173
|
+
_userProps$view = userProps.view,
|
|
17174
|
+
View = _userProps$view === void 0 ? createListViewComponent({
|
|
17175
|
+
createElement: createElement,
|
|
17176
|
+
Fragment: Fragment
|
|
17177
|
+
}) : _userProps$view,
|
|
17178
|
+
items = userProps.items,
|
|
17179
|
+
status = userProps.status,
|
|
17180
|
+
userTranslations = userProps.translations,
|
|
17181
|
+
sendEvent = userProps.sendEvent,
|
|
17182
|
+
props = _objectWithoutProperties$1(userProps, _excluded$d);
|
|
17183
|
+
var translations = _objectSpread$2({
|
|
17184
|
+
title: 'Trending items',
|
|
17185
|
+
sliderLabel: 'Trending items'
|
|
17186
|
+
}, userTranslations);
|
|
17187
|
+
var cssClasses = {
|
|
17188
|
+
root: cx('ais-TrendingItems', classNames.root),
|
|
17189
|
+
emptyRoot: cx('ais-TrendingItems', classNames.root, 'ais-TrendingItems--empty', classNames.emptyRoot, props.className),
|
|
17190
|
+
title: cx('ais-TrendingItems-title', classNames.title),
|
|
17191
|
+
container: cx('ais-TrendingItems-container', classNames.container),
|
|
17192
|
+
list: cx('ais-TrendingItems-list', classNames.list),
|
|
17193
|
+
item: cx('ais-TrendingItems-item', classNames.item)
|
|
17194
|
+
};
|
|
17195
|
+
if (items.length === 0 && status === 'idle') {
|
|
17196
|
+
return createElement("section", _extends$1({}, props, {
|
|
17197
|
+
className: cssClasses.emptyRoot
|
|
17198
|
+
}), createElement(EmptyComponent, null));
|
|
17199
|
+
}
|
|
17200
|
+
return createElement("section", _extends$1({}, props, {
|
|
17201
|
+
className: cssClasses.root
|
|
17202
|
+
}), createElement(HeaderComponent, {
|
|
17203
|
+
classNames: cssClasses,
|
|
17204
|
+
items: items,
|
|
17205
|
+
translations: translations
|
|
17206
|
+
}), createElement(View, {
|
|
17207
|
+
classNames: cssClasses,
|
|
17208
|
+
translations: translations,
|
|
17209
|
+
itemComponent: ItemComponent,
|
|
17210
|
+
items: items,
|
|
17211
|
+
sendEvent: sendEvent
|
|
17212
|
+
}));
|
|
17213
|
+
};
|
|
17214
|
+
}
|
|
17215
|
+
|
|
17216
|
+
var _excluded$e = ["classNames", "emptyComponent", "headerComponent", "itemComponent", "view", "items", "status", "translations", "sendEvent"];
|
|
17217
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
17218
|
+
var keys = Object.keys(object);
|
|
17219
|
+
if (Object.getOwnPropertySymbols) {
|
|
17220
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
17221
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
17222
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
17223
|
+
})), keys.push.apply(keys, symbols);
|
|
17224
|
+
}
|
|
17225
|
+
return keys;
|
|
17226
|
+
}
|
|
17227
|
+
function _objectSpread$3(target) {
|
|
17228
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17229
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
17230
|
+
i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) {
|
|
17231
|
+
_defineProperty$1(target, key, source[key]);
|
|
17232
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) {
|
|
17233
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
17234
|
+
});
|
|
17235
|
+
}
|
|
17236
|
+
return target;
|
|
17237
|
+
}
|
|
17238
|
+
function createLookingSimilarComponent(_ref) {
|
|
17239
|
+
var createElement = _ref.createElement,
|
|
17240
|
+
Fragment = _ref.Fragment;
|
|
17241
|
+
return function LookingSimilar(userProps) {
|
|
17242
|
+
var _userProps$classNames = userProps.classNames,
|
|
17243
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
17244
|
+
_userProps$emptyCompo = userProps.emptyComponent,
|
|
17245
|
+
EmptyComponent = _userProps$emptyCompo === void 0 ? createDefaultEmptyComponent({
|
|
17246
|
+
createElement: createElement,
|
|
17247
|
+
Fragment: Fragment
|
|
17248
|
+
}) : _userProps$emptyCompo,
|
|
17249
|
+
_userProps$headerComp = userProps.headerComponent,
|
|
17250
|
+
HeaderComponent = _userProps$headerComp === void 0 ? createDefaultHeaderComponent({
|
|
17251
|
+
createElement: createElement,
|
|
17252
|
+
Fragment: Fragment
|
|
17253
|
+
}) : _userProps$headerComp,
|
|
17254
|
+
_userProps$itemCompon = userProps.itemComponent,
|
|
17255
|
+
ItemComponent = _userProps$itemCompon === void 0 ? createDefaultItemComponent({
|
|
17256
|
+
createElement: createElement,
|
|
17257
|
+
Fragment: Fragment
|
|
17258
|
+
}) : _userProps$itemCompon,
|
|
17259
|
+
_userProps$view = userProps.view,
|
|
17260
|
+
View = _userProps$view === void 0 ? createListViewComponent({
|
|
17261
|
+
createElement: createElement,
|
|
17262
|
+
Fragment: Fragment
|
|
17263
|
+
}) : _userProps$view,
|
|
17264
|
+
items = userProps.items,
|
|
17265
|
+
status = userProps.status,
|
|
17266
|
+
userTranslations = userProps.translations,
|
|
17267
|
+
sendEvent = userProps.sendEvent,
|
|
17268
|
+
props = _objectWithoutProperties$1(userProps, _excluded$e);
|
|
17269
|
+
var translations = _objectSpread$3({
|
|
17270
|
+
title: 'Looking similar',
|
|
17271
|
+
sliderLabel: 'Looking similar'
|
|
17272
|
+
}, userTranslations);
|
|
17273
|
+
var cssClasses = {
|
|
17274
|
+
root: cx('ais-LookingSimilar', classNames.root),
|
|
17275
|
+
emptyRoot: cx('ais-LookingSimilar', classNames.root, 'ais-LookingSimilar--empty', classNames.emptyRoot, props.className),
|
|
17276
|
+
title: cx('ais-LookingSimilar-title', classNames.title),
|
|
17277
|
+
container: cx('ais-LookingSimilar-container', classNames.container),
|
|
17278
|
+
list: cx('ais-LookingSimilar-list', classNames.list),
|
|
17279
|
+
item: cx('ais-LookingSimilar-item', classNames.item)
|
|
17280
|
+
};
|
|
17281
|
+
if (items.length === 0 && status === 'idle') {
|
|
17282
|
+
return createElement("section", _extends$1({}, props, {
|
|
17283
|
+
className: cssClasses.emptyRoot
|
|
17284
|
+
}), createElement(EmptyComponent, null));
|
|
17285
|
+
}
|
|
17286
|
+
return createElement("section", _extends$1({}, props, {
|
|
17287
|
+
className: cssClasses.root
|
|
17288
|
+
}), createElement(HeaderComponent, {
|
|
17289
|
+
classNames: cssClasses,
|
|
17290
|
+
items: items,
|
|
17291
|
+
translations: translations
|
|
17292
|
+
}), createElement(View, {
|
|
17293
|
+
classNames: cssClasses,
|
|
17294
|
+
translations: translations,
|
|
17295
|
+
itemComponent: ItemComponent,
|
|
17296
|
+
items: items,
|
|
17297
|
+
sendEvent: sendEvent
|
|
17298
|
+
}));
|
|
17299
|
+
};
|
|
17300
|
+
}
|
|
17301
|
+
|
|
16275
17302
|
function prepareTemplates(
|
|
16276
17303
|
// can not use = {} here, since the template could have different constraints
|
|
16277
17304
|
defaultTemplates) {
|
|
@@ -17088,11 +18115,11 @@
|
|
|
17088
18115
|
Fragment: p
|
|
17089
18116
|
});
|
|
17090
18117
|
|
|
17091
|
-
var _excluded$
|
|
18118
|
+
var _excluded$f = ["classNames"];
|
|
17092
18119
|
function Highlight(_ref) {
|
|
17093
18120
|
var _ref$classNames = _ref.classNames,
|
|
17094
18121
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17095
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18122
|
+
props = _objectWithoutProperties(_ref, _excluded$f);
|
|
17096
18123
|
return h(InternalHighlight, _extends({
|
|
17097
18124
|
classNames: {
|
|
17098
18125
|
root: cx('ais-Highlight', classNames.root),
|
|
@@ -17103,12 +18130,12 @@
|
|
|
17103
18130
|
}, props));
|
|
17104
18131
|
}
|
|
17105
18132
|
|
|
17106
|
-
var _excluded$
|
|
18133
|
+
var _excluded$g = ["hit", "attribute", "cssClasses"];
|
|
17107
18134
|
function Highlight$1(_ref) {
|
|
17108
18135
|
var hit = _ref.hit,
|
|
17109
18136
|
attribute = _ref.attribute,
|
|
17110
18137
|
cssClasses = _ref.cssClasses,
|
|
17111
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18138
|
+
props = _objectWithoutProperties(_ref, _excluded$g);
|
|
17112
18139
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
17113
18140
|
var properties = toArray(property);
|
|
17114
18141
|
_warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
@@ -17122,11 +18149,11 @@
|
|
|
17122
18149
|
}));
|
|
17123
18150
|
}
|
|
17124
18151
|
|
|
17125
|
-
var _excluded$
|
|
18152
|
+
var _excluded$h = ["classNames"];
|
|
17126
18153
|
function ReverseHighlight(_ref) {
|
|
17127
18154
|
var _ref$classNames = _ref.classNames,
|
|
17128
18155
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17129
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18156
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
17130
18157
|
return h(InternalHighlight, _extends({
|
|
17131
18158
|
classNames: {
|
|
17132
18159
|
root: cx('ais-ReverseHighlight', classNames.root),
|
|
@@ -17137,13 +18164,13 @@
|
|
|
17137
18164
|
}, props));
|
|
17138
18165
|
}
|
|
17139
18166
|
|
|
17140
|
-
var _excluded$
|
|
18167
|
+
var _excluded$i = ["hit", "attribute", "cssClasses"],
|
|
17141
18168
|
_excluded2$3 = ["isHighlighted"];
|
|
17142
18169
|
function ReverseHighlight$1(_ref) {
|
|
17143
18170
|
var hit = _ref.hit,
|
|
17144
18171
|
attribute = _ref.attribute,
|
|
17145
18172
|
cssClasses = _ref.cssClasses,
|
|
17146
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18173
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
17147
18174
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
17148
18175
|
var properties = toArray(property);
|
|
17149
18176
|
_warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
@@ -17163,11 +18190,11 @@
|
|
|
17163
18190
|
}));
|
|
17164
18191
|
}
|
|
17165
18192
|
|
|
17166
|
-
var _excluded$
|
|
18193
|
+
var _excluded$j = ["classNames"];
|
|
17167
18194
|
function ReverseSnippet(_ref) {
|
|
17168
18195
|
var _ref$classNames = _ref.classNames,
|
|
17169
18196
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17170
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18197
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
17171
18198
|
return h(InternalHighlight, _extends({
|
|
17172
18199
|
classNames: {
|
|
17173
18200
|
root: cx('ais-ReverseSnippet', classNames.root),
|
|
@@ -17178,13 +18205,13 @@
|
|
|
17178
18205
|
}, props));
|
|
17179
18206
|
}
|
|
17180
18207
|
|
|
17181
|
-
var _excluded$
|
|
18208
|
+
var _excluded$k = ["hit", "attribute", "cssClasses"],
|
|
17182
18209
|
_excluded2$4 = ["isHighlighted"];
|
|
17183
18210
|
function ReverseSnippet$1(_ref) {
|
|
17184
18211
|
var hit = _ref.hit,
|
|
17185
18212
|
attribute = _ref.attribute,
|
|
17186
18213
|
cssClasses = _ref.cssClasses,
|
|
17187
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18214
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
17188
18215
|
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
17189
18216
|
var properties = toArray(property);
|
|
17190
18217
|
_warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
@@ -17204,11 +18231,11 @@
|
|
|
17204
18231
|
}));
|
|
17205
18232
|
}
|
|
17206
18233
|
|
|
17207
|
-
var _excluded$
|
|
18234
|
+
var _excluded$l = ["classNames"];
|
|
17208
18235
|
function Snippet(_ref) {
|
|
17209
18236
|
var _ref$classNames = _ref.classNames,
|
|
17210
18237
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17211
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18238
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
17212
18239
|
return h(InternalHighlight, _extends({
|
|
17213
18240
|
classNames: {
|
|
17214
18241
|
root: cx('ais-Snippet', classNames.root),
|
|
@@ -17219,12 +18246,12 @@
|
|
|
17219
18246
|
}, props));
|
|
17220
18247
|
}
|
|
17221
18248
|
|
|
17222
|
-
var _excluded$
|
|
18249
|
+
var _excluded$m = ["hit", "attribute", "cssClasses"];
|
|
17223
18250
|
function Snippet$1(_ref) {
|
|
17224
18251
|
var hit = _ref.hit,
|
|
17225
18252
|
attribute = _ref.attribute,
|
|
17226
18253
|
cssClasses = _ref.cssClasses,
|
|
17227
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18254
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
17228
18255
|
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
17229
18256
|
var properties = toArray(property);
|
|
17230
18257
|
_warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
@@ -17468,7 +18495,7 @@
|
|
|
17468
18495
|
}
|
|
17469
18496
|
};
|
|
17470
18497
|
|
|
17471
|
-
var withUsage$
|
|
18498
|
+
var withUsage$w = createDocumentationMessageGenerator({
|
|
17472
18499
|
name: 'answers'
|
|
17473
18500
|
});
|
|
17474
18501
|
var suit$4 = component('Answers');
|
|
@@ -17515,7 +18542,7 @@
|
|
|
17515
18542
|
_ref3$cssClasses = _ref3.cssClasses,
|
|
17516
18543
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;
|
|
17517
18544
|
if (!container) {
|
|
17518
|
-
throw new Error(withUsage$
|
|
18545
|
+
throw new Error(withUsage$w('The `container` option is required.'));
|
|
17519
18546
|
}
|
|
17520
18547
|
var containerNode = getContainerNode(container);
|
|
17521
18548
|
var cssClasses = {
|
|
@@ -17559,8 +18586,8 @@
|
|
|
17559
18586
|
};
|
|
17560
18587
|
var answers = deprecate(answersWidget, 'The answers widget is deprecated and will be removed in InstantSearch.js 5.0');
|
|
17561
18588
|
|
|
17562
|
-
var _excluded$
|
|
17563
|
-
var withUsage$
|
|
18589
|
+
var _excluded$n = ["container", "widgets", "fallbackWidget"];
|
|
18590
|
+
var withUsage$x = createDocumentationMessageGenerator({
|
|
17564
18591
|
name: 'dynamic-widgets'
|
|
17565
18592
|
});
|
|
17566
18593
|
var suit$5 = component('DynamicWidgets');
|
|
@@ -17577,14 +18604,14 @@
|
|
|
17577
18604
|
containerSelector = _ref.container,
|
|
17578
18605
|
widgets = _ref.widgets,
|
|
17579
18606
|
fallbackWidget = _ref.fallbackWidget,
|
|
17580
|
-
otherWidgetParams = _objectWithoutProperties(_ref, _excluded$
|
|
18607
|
+
otherWidgetParams = _objectWithoutProperties(_ref, _excluded$n);
|
|
17581
18608
|
if (!containerSelector) {
|
|
17582
|
-
throw new Error(withUsage$
|
|
18609
|
+
throw new Error(withUsage$x('The `container` option is required.'));
|
|
17583
18610
|
}
|
|
17584
18611
|
if (!(widgets && Array.isArray(widgets) && widgets.every(function (widget) {
|
|
17585
18612
|
return typeof widget === 'function';
|
|
17586
18613
|
}))) {
|
|
17587
|
-
throw new Error(withUsage$
|
|
18614
|
+
throw new Error(withUsage$x('The `widgets` option expects an array of callbacks.'));
|
|
17588
18615
|
}
|
|
17589
18616
|
var userContainer = getContainerNode(containerSelector);
|
|
17590
18617
|
var rootContainer = document.createElement('div');
|
|
@@ -17633,7 +18660,7 @@
|
|
|
17633
18660
|
});
|
|
17634
18661
|
};
|
|
17635
18662
|
|
|
17636
|
-
var withUsage$
|
|
18663
|
+
var withUsage$y = createDocumentationMessageGenerator({
|
|
17637
18664
|
name: 'analytics'
|
|
17638
18665
|
});
|
|
17639
18666
|
// @major this widget will be removed from the next major version.
|
|
@@ -17649,7 +18676,7 @@
|
|
|
17649
18676
|
_ref$pushPagination = _ref.pushPagination,
|
|
17650
18677
|
pushPagination = _ref$pushPagination === void 0 ? false : _ref$pushPagination;
|
|
17651
18678
|
if (!pushFunction) {
|
|
17652
|
-
throw new Error(withUsage$
|
|
18679
|
+
throw new Error(withUsage$y('The `pushFunction` option is required.'));
|
|
17653
18680
|
}
|
|
17654
18681
|
_warning(false, "`analytics` widget has been deprecated. It is still supported in 4.x releases, but not further. It is replaced by the `insights` middleware.\n\nFor the migration, visit https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#analytics-widget") ;
|
|
17655
18682
|
var cachedState = null;
|
|
@@ -17835,7 +18862,7 @@
|
|
|
17835
18862
|
}
|
|
17836
18863
|
};
|
|
17837
18864
|
|
|
17838
|
-
var withUsage$
|
|
18865
|
+
var withUsage$z = createDocumentationMessageGenerator({
|
|
17839
18866
|
name: 'breadcrumb'
|
|
17840
18867
|
});
|
|
17841
18868
|
var suit$6 = component('Breadcrumb');
|
|
@@ -17880,7 +18907,7 @@
|
|
|
17880
18907
|
_ref3$cssClasses = _ref3.cssClasses,
|
|
17881
18908
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;
|
|
17882
18909
|
if (!container) {
|
|
17883
|
-
throw new Error(withUsage$
|
|
18910
|
+
throw new Error(withUsage$z('The `container` option is required.'));
|
|
17884
18911
|
}
|
|
17885
18912
|
var containerNode = getContainerNode(container);
|
|
17886
18913
|
var cssClasses = {
|
|
@@ -17951,7 +18978,7 @@
|
|
|
17951
18978
|
}
|
|
17952
18979
|
};
|
|
17953
18980
|
|
|
17954
|
-
var withUsage$
|
|
18981
|
+
var withUsage$A = createDocumentationMessageGenerator({
|
|
17955
18982
|
name: 'clear-refinements'
|
|
17956
18983
|
});
|
|
17957
18984
|
var suit$7 = component('ClearRefinements');
|
|
@@ -17991,7 +19018,7 @@
|
|
|
17991
19018
|
_ref3$cssClasses = _ref3.cssClasses,
|
|
17992
19019
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;
|
|
17993
19020
|
if (!container) {
|
|
17994
|
-
throw new Error(withUsage$
|
|
19021
|
+
throw new Error(withUsage$A('The `container` option is required.'));
|
|
17995
19022
|
}
|
|
17996
19023
|
var containerNode = getContainerNode(container);
|
|
17997
19024
|
var cssClasses = {
|
|
@@ -18085,7 +19112,7 @@
|
|
|
18085
19112
|
})));
|
|
18086
19113
|
};
|
|
18087
19114
|
|
|
18088
|
-
var withUsage$
|
|
19115
|
+
var withUsage$B = createDocumentationMessageGenerator({
|
|
18089
19116
|
name: 'current-refinements'
|
|
18090
19117
|
});
|
|
18091
19118
|
var suit$8 = component('CurrentRefinements');
|
|
@@ -18114,7 +19141,7 @@
|
|
|
18114
19141
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,
|
|
18115
19142
|
transformItems = _ref3.transformItems;
|
|
18116
19143
|
if (!container) {
|
|
18117
|
-
throw new Error(withUsage$
|
|
19144
|
+
throw new Error(withUsage$B('The `container` option is required.'));
|
|
18118
19145
|
}
|
|
18119
19146
|
var containerNode = getContainerNode(container);
|
|
18120
19147
|
var cssClasses = {
|
|
@@ -18551,10 +19578,10 @@
|
|
|
18551
19578
|
}), container.querySelector(".".concat(cssClasses.tree)));
|
|
18552
19579
|
};
|
|
18553
19580
|
|
|
18554
|
-
var _excluded$
|
|
19581
|
+
var _excluded$o = ["initialZoom", "initialPosition", "templates", "cssClasses", "builtInMarker", "customHTMLMarker", "enableRefine", "enableClearMapRefinement", "enableRefineControl", "container", "googleReference"],
|
|
18555
19582
|
_excluded2$5 = ["item"],
|
|
18556
19583
|
_excluded3 = ["item"];
|
|
18557
|
-
var withUsage$
|
|
19584
|
+
var withUsage$C = createDocumentationMessageGenerator({
|
|
18558
19585
|
name: 'geo-search'
|
|
18559
19586
|
});
|
|
18560
19587
|
var suit$9 = component('GeoSearch');
|
|
@@ -18595,7 +19622,7 @@
|
|
|
18595
19622
|
enableRefineControl = _ref$enableRefineCont === void 0 ? true : _ref$enableRefineCont,
|
|
18596
19623
|
container = _ref.container,
|
|
18597
19624
|
googleReference = _ref.googleReference,
|
|
18598
|
-
otherWidgetParams = _objectWithoutProperties(_ref, _excluded$
|
|
19625
|
+
otherWidgetParams = _objectWithoutProperties(_ref, _excluded$o);
|
|
18599
19626
|
var defaultBuiltInMarker = {
|
|
18600
19627
|
createOptions: function createOptions() {
|
|
18601
19628
|
return {};
|
|
@@ -18609,10 +19636,10 @@
|
|
|
18609
19636
|
events: {}
|
|
18610
19637
|
};
|
|
18611
19638
|
if (!container) {
|
|
18612
|
-
throw new Error(withUsage$
|
|
19639
|
+
throw new Error(withUsage$C('The `container` option is required.'));
|
|
18613
19640
|
}
|
|
18614
19641
|
if (!googleReference) {
|
|
18615
|
-
throw new Error(withUsage$
|
|
19642
|
+
throw new Error(withUsage$C('The `googleReference` option is required.'));
|
|
18616
19643
|
}
|
|
18617
19644
|
var containerNode = getContainerNode(container);
|
|
18618
19645
|
var cssClasses = {
|
|
@@ -18932,7 +19959,7 @@
|
|
|
18932
19959
|
})), subItems);
|
|
18933
19960
|
}
|
|
18934
19961
|
|
|
18935
|
-
var _excluded$
|
|
19962
|
+
var _excluded$p = ["root"];
|
|
18936
19963
|
|
|
18937
19964
|
// CSS types
|
|
18938
19965
|
|
|
@@ -18959,7 +19986,7 @@
|
|
|
18959
19986
|
if (isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0) {
|
|
18960
19987
|
var _this$props$cssClasse = _this.props.cssClasses,
|
|
18961
19988
|
root = _this$props$cssClasse.root,
|
|
18962
|
-
cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded$
|
|
19989
|
+
cssClasses = _objectWithoutProperties(_this$props$cssClasse, _excluded$p);
|
|
18963
19990
|
subItems = h(RefinementList, _extends({}, _this.props, {
|
|
18964
19991
|
// We want to keep `root` required for external usage but not for the
|
|
18965
19992
|
// sub items.
|
|
@@ -19156,7 +20183,7 @@
|
|
|
19156
20183
|
}
|
|
19157
20184
|
};
|
|
19158
20185
|
|
|
19159
|
-
var withUsage$
|
|
20186
|
+
var withUsage$D = createDocumentationMessageGenerator({
|
|
19160
20187
|
name: 'hierarchical-menu'
|
|
19161
20188
|
});
|
|
19162
20189
|
var suit$a = component('HierarchicalMenu');
|
|
@@ -19266,7 +20293,7 @@
|
|
|
19266
20293
|
_ref3$cssClasses = _ref3.cssClasses,
|
|
19267
20294
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses;
|
|
19268
20295
|
if (!container) {
|
|
19269
|
-
throw new Error(withUsage$
|
|
20296
|
+
throw new Error(withUsage$D('The `container` option is required.'));
|
|
19270
20297
|
}
|
|
19271
20298
|
var containerNode = getContainerNode(container);
|
|
19272
20299
|
var cssClasses = {
|
|
@@ -19347,8 +20374,8 @@
|
|
|
19347
20374
|
}
|
|
19348
20375
|
};
|
|
19349
20376
|
|
|
19350
|
-
var _excluded$
|
|
19351
|
-
var withUsage$
|
|
20377
|
+
var _excluded$q = ["hit", "index"];
|
|
20378
|
+
var withUsage$E = createDocumentationMessageGenerator({
|
|
19352
20379
|
name: 'hits'
|
|
19353
20380
|
});
|
|
19354
20381
|
var Hits = createHitsComponent({
|
|
@@ -19395,7 +20422,7 @@
|
|
|
19395
20422
|
var itemComponent = function itemComponent(_ref4) {
|
|
19396
20423
|
var hit = _ref4.hit,
|
|
19397
20424
|
index = _ref4.index,
|
|
19398
|
-
rootProps = _objectWithoutProperties(_ref4, _excluded$
|
|
20425
|
+
rootProps = _objectWithoutProperties(_ref4, _excluded$q);
|
|
19399
20426
|
return h(Template, _extends({}, renderState.templateProps, {
|
|
19400
20427
|
templateKey: "item",
|
|
19401
20428
|
rootTagName: "li",
|
|
@@ -19447,7 +20474,7 @@
|
|
|
19447
20474
|
_ref5$cssClasses = _ref5.cssClasses,
|
|
19448
20475
|
cssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses;
|
|
19449
20476
|
if (!container) {
|
|
19450
|
-
throw new Error(withUsage$
|
|
20477
|
+
throw new Error(withUsage$E('The `container` option is required.'));
|
|
19451
20478
|
}
|
|
19452
20479
|
var containerNode = getContainerNode(container);
|
|
19453
20480
|
var specializedRenderer = renderer$6({
|
|
@@ -19489,7 +20516,7 @@
|
|
|
19489
20516
|
}));
|
|
19490
20517
|
}
|
|
19491
20518
|
|
|
19492
|
-
var withUsage$
|
|
20519
|
+
var withUsage$F = createDocumentationMessageGenerator({
|
|
19493
20520
|
name: 'hits-per-page'
|
|
19494
20521
|
});
|
|
19495
20522
|
var suit$b = component('HitsPerPage');
|
|
@@ -19525,7 +20552,7 @@
|
|
|
19525
20552
|
userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,
|
|
19526
20553
|
transformItems = _ref5.transformItems;
|
|
19527
20554
|
if (!container) {
|
|
19528
|
-
throw new Error(withUsage$
|
|
20555
|
+
throw new Error(withUsage$F('The `container` option is required.'));
|
|
19529
20556
|
}
|
|
19530
20557
|
var containerNode = getContainerNode(container);
|
|
19531
20558
|
var cssClasses = {
|
|
@@ -19642,7 +20669,7 @@
|
|
|
19642
20669
|
}
|
|
19643
20670
|
};
|
|
19644
20671
|
|
|
19645
|
-
var withUsage$
|
|
20672
|
+
var withUsage$G = createDocumentationMessageGenerator({
|
|
19646
20673
|
name: 'infinite-hits'
|
|
19647
20674
|
});
|
|
19648
20675
|
var suit$c = component('InfiniteHits');
|
|
@@ -19699,7 +20726,7 @@
|
|
|
19699
20726
|
showPrevious = _ref3.showPrevious,
|
|
19700
20727
|
cache = _ref3.cache;
|
|
19701
20728
|
if (!container) {
|
|
19702
|
-
throw new Error(withUsage$
|
|
20729
|
+
throw new Error(withUsage$G('The `container` option is required.'));
|
|
19703
20730
|
}
|
|
19704
20731
|
var containerNode = getContainerNode(container);
|
|
19705
20732
|
var cssClasses = {
|
|
@@ -19769,7 +20796,7 @@
|
|
|
19769
20796
|
}
|
|
19770
20797
|
};
|
|
19771
20798
|
|
|
19772
|
-
var withUsage$
|
|
20799
|
+
var withUsage$H = createDocumentationMessageGenerator({
|
|
19773
20800
|
name: 'menu'
|
|
19774
20801
|
});
|
|
19775
20802
|
var suit$d = component('Menu');
|
|
@@ -19827,7 +20854,7 @@
|
|
|
19827
20854
|
templates = _ref3$templates === void 0 ? {} : _ref3$templates,
|
|
19828
20855
|
transformItems = _ref3.transformItems;
|
|
19829
20856
|
if (!container) {
|
|
19830
|
-
throw new Error(withUsage$
|
|
20857
|
+
throw new Error(withUsage$H('The `container` option is required.'));
|
|
19831
20858
|
}
|
|
19832
20859
|
var containerNode = getContainerNode(container);
|
|
19833
20860
|
var cssClasses = {
|
|
@@ -19935,7 +20962,7 @@
|
|
|
19935
20962
|
}
|
|
19936
20963
|
};
|
|
19937
20964
|
|
|
19938
|
-
var withUsage$
|
|
20965
|
+
var withUsage$I = createDocumentationMessageGenerator({
|
|
19939
20966
|
name: 'menu-select'
|
|
19940
20967
|
});
|
|
19941
20968
|
var suit$e = component('MenuSelect');
|
|
@@ -19978,7 +21005,7 @@
|
|
|
19978
21005
|
templates = _ref3$templates === void 0 ? {} : _ref3$templates,
|
|
19979
21006
|
transformItems = _ref3.transformItems;
|
|
19980
21007
|
if (!container) {
|
|
19981
|
-
throw new Error(withUsage$
|
|
21008
|
+
throw new Error(withUsage$I('The `container` option is required.'));
|
|
19982
21009
|
}
|
|
19983
21010
|
var containerNode = getContainerNode(container);
|
|
19984
21011
|
var cssClasses = {
|
|
@@ -20031,7 +21058,7 @@
|
|
|
20031
21058
|
}
|
|
20032
21059
|
};
|
|
20033
21060
|
|
|
20034
|
-
var withUsage$
|
|
21061
|
+
var withUsage$J = createDocumentationMessageGenerator({
|
|
20035
21062
|
name: 'numeric-menu'
|
|
20036
21063
|
});
|
|
20037
21064
|
var suit$f = component('NumericMenu');
|
|
@@ -20075,7 +21102,7 @@
|
|
|
20075
21102
|
templates = _ref3$templates === void 0 ? {} : _ref3$templates,
|
|
20076
21103
|
transformItems = _ref3.transformItems;
|
|
20077
21104
|
if (!container) {
|
|
20078
|
-
throw new Error(withUsage$
|
|
21105
|
+
throw new Error(withUsage$J('The `container` option is required.'));
|
|
20079
21106
|
}
|
|
20080
21107
|
var containerNode = getContainerNode(container);
|
|
20081
21108
|
var cssClasses = {
|
|
@@ -20236,7 +21263,7 @@
|
|
|
20236
21263
|
}
|
|
20237
21264
|
|
|
20238
21265
|
var suit$g = component('Pagination');
|
|
20239
|
-
var withUsage$
|
|
21266
|
+
var withUsage$K = createDocumentationMessageGenerator({
|
|
20240
21267
|
name: 'pagination'
|
|
20241
21268
|
});
|
|
20242
21269
|
var defaultTemplates$a = {
|
|
@@ -20318,7 +21345,7 @@
|
|
|
20318
21345
|
_ref4$scrollTo = _ref4.scrollTo,
|
|
20319
21346
|
userScrollTo = _ref4$scrollTo === void 0 ? 'body' : _ref4$scrollTo;
|
|
20320
21347
|
if (!container) {
|
|
20321
|
-
throw new Error(withUsage$
|
|
21348
|
+
throw new Error(withUsage$K('The `container` option is required.'));
|
|
20322
21349
|
}
|
|
20323
21350
|
var containerNode = getContainerNode(container);
|
|
20324
21351
|
var scrollTo = userScrollTo === true ? 'body' : userScrollTo;
|
|
@@ -20453,7 +21480,7 @@
|
|
|
20453
21480
|
}));
|
|
20454
21481
|
}
|
|
20455
21482
|
|
|
20456
|
-
var withUsage$
|
|
21483
|
+
var withUsage$L = createDocumentationMessageGenerator({
|
|
20457
21484
|
name: 'panel'
|
|
20458
21485
|
});
|
|
20459
21486
|
var suit$h = component('Panel');
|
|
@@ -20530,7 +21557,7 @@
|
|
|
20530
21557
|
return function (widgetFactory) {
|
|
20531
21558
|
return function (widgetParams) {
|
|
20532
21559
|
if (!(widgetParams && widgetParams.container)) {
|
|
20533
|
-
throw new Error(withUsage$
|
|
21560
|
+
throw new Error(withUsage$L("The `container` option is required in the widget within the panel."));
|
|
20534
21561
|
}
|
|
20535
21562
|
var containerNode = getContainerNode(widgetParams.container);
|
|
20536
21563
|
var defaultTemplates = {
|
|
@@ -20604,7 +21631,7 @@
|
|
|
20604
21631
|
};
|
|
20605
21632
|
};
|
|
20606
21633
|
|
|
20607
|
-
var _excluded$
|
|
21634
|
+
var _excluded$r = ["placesReference", "defaultPosition"],
|
|
20608
21635
|
_excluded2$6 = ["places"];
|
|
20609
21636
|
|
|
20610
21637
|
/* Places.js is an optional dependency, no error should be reported if the package is missing */
|
|
@@ -20620,7 +21647,7 @@
|
|
|
20620
21647
|
placesReference = _ref.placesReference,
|
|
20621
21648
|
_ref$defaultPosition = _ref.defaultPosition,
|
|
20622
21649
|
defaultPosition = _ref$defaultPosition === void 0 ? [] : _ref$defaultPosition,
|
|
20623
|
-
placesOptions = _objectWithoutProperties(_ref, _excluded$
|
|
21650
|
+
placesOptions = _objectWithoutProperties(_ref, _excluded$r);
|
|
20624
21651
|
if (typeof placesReference !== 'function') {
|
|
20625
21652
|
throw new Error('The `placesReference` option requires a valid Places.js reference.');
|
|
20626
21653
|
}
|
|
@@ -20733,7 +21760,7 @@
|
|
|
20733
21760
|
};
|
|
20734
21761
|
|
|
20735
21762
|
var suit$i = component('PoweredBy');
|
|
20736
|
-
var withUsage$
|
|
21763
|
+
var withUsage$M = createDocumentationMessageGenerator({
|
|
20737
21764
|
name: 'powered-by'
|
|
20738
21765
|
});
|
|
20739
21766
|
var renderer$e = function renderer(_ref) {
|
|
@@ -20762,7 +21789,7 @@
|
|
|
20762
21789
|
_ref3$theme = _ref3.theme,
|
|
20763
21790
|
theme = _ref3$theme === void 0 ? 'light' : _ref3$theme;
|
|
20764
21791
|
if (!container) {
|
|
20765
|
-
throw new Error(withUsage$
|
|
21792
|
+
throw new Error(withUsage$M('The `container` option is required.'));
|
|
20766
21793
|
}
|
|
20767
21794
|
var containerNode = getContainerNode(container);
|
|
20768
21795
|
var cssClasses = {
|
|
@@ -20790,13 +21817,13 @@
|
|
|
20790
21817
|
});
|
|
20791
21818
|
};
|
|
20792
21819
|
|
|
20793
|
-
var withUsage$
|
|
21820
|
+
var withUsage$N = createDocumentationMessageGenerator({
|
|
20794
21821
|
name: 'query-rule-context'
|
|
20795
21822
|
});
|
|
20796
21823
|
var queryRuleContext = function queryRuleContext() {
|
|
20797
21824
|
var widgetParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20798
21825
|
if (!widgetParams.trackedFilters) {
|
|
20799
|
-
throw new Error(withUsage$
|
|
21826
|
+
throw new Error(withUsage$N('The `trackedFilters` option is required.'));
|
|
20800
21827
|
}
|
|
20801
21828
|
return _objectSpread2(_objectSpread2({}, connectQueryRules(noop)(widgetParams)), {}, {
|
|
20802
21829
|
$$widgetType: 'ais.queryRuleContext'
|
|
@@ -20825,7 +21852,7 @@
|
|
|
20825
21852
|
return JSON.stringify(items, null, 2);
|
|
20826
21853
|
}
|
|
20827
21854
|
};
|
|
20828
|
-
var withUsage$
|
|
21855
|
+
var withUsage$O = createDocumentationMessageGenerator({
|
|
20829
21856
|
name: 'query-rule-custom-data'
|
|
20830
21857
|
});
|
|
20831
21858
|
var suit$j = component('QueryRuleCustomData');
|
|
@@ -20854,7 +21881,7 @@
|
|
|
20854
21881
|
return items;
|
|
20855
21882
|
} : _ref4$transformItems;
|
|
20856
21883
|
if (!container) {
|
|
20857
|
-
throw new Error(withUsage$
|
|
21884
|
+
throw new Error(withUsage$O('The `container` option is required.'));
|
|
20858
21885
|
}
|
|
20859
21886
|
var cssClasses = {
|
|
20860
21887
|
root: cx(suit$j(), userCssClasses.root)
|
|
@@ -20877,6 +21904,107 @@
|
|
|
20877
21904
|
});
|
|
20878
21905
|
};
|
|
20879
21906
|
|
|
21907
|
+
var withUsage$P = createDocumentationMessageGenerator({
|
|
21908
|
+
name: 'related-products'
|
|
21909
|
+
});
|
|
21910
|
+
var RelatedProducts = createRelatedProductsComponent({
|
|
21911
|
+
createElement: h,
|
|
21912
|
+
Fragment: p
|
|
21913
|
+
});
|
|
21914
|
+
function createRenderer(_ref) {
|
|
21915
|
+
var renderState = _ref.renderState,
|
|
21916
|
+
cssClasses = _ref.cssClasses,
|
|
21917
|
+
containerNode = _ref.containerNode,
|
|
21918
|
+
templates = _ref.templates;
|
|
21919
|
+
return function renderer(_ref2, isFirstRendering) {
|
|
21920
|
+
var items = _ref2.items,
|
|
21921
|
+
results = _ref2.results,
|
|
21922
|
+
instantSearchInstance = _ref2.instantSearchInstance;
|
|
21923
|
+
if (isFirstRendering) {
|
|
21924
|
+
renderState.templateProps = prepareTemplateProps({
|
|
21925
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
21926
|
+
defaultTemplates: {},
|
|
21927
|
+
templatesConfig: instantSearchInstance.templatesConfig,
|
|
21928
|
+
templates: templates
|
|
21929
|
+
});
|
|
21930
|
+
return;
|
|
21931
|
+
}
|
|
21932
|
+
var headerComponent = templates.header ? function (data) {
|
|
21933
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
21934
|
+
templateKey: "header",
|
|
21935
|
+
rootTagName: "fragment",
|
|
21936
|
+
data: {
|
|
21937
|
+
cssClasses: data.classNames,
|
|
21938
|
+
items: data.items
|
|
21939
|
+
}
|
|
21940
|
+
}));
|
|
21941
|
+
} : undefined;
|
|
21942
|
+
var itemComponent = templates.item ? function (_ref3) {
|
|
21943
|
+
var item = _ref3.item;
|
|
21944
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
21945
|
+
templateKey: "item",
|
|
21946
|
+
rootTagName: "fragment",
|
|
21947
|
+
data: item
|
|
21948
|
+
}));
|
|
21949
|
+
} : undefined;
|
|
21950
|
+
var emptyComponent = templates.empty ? function () {
|
|
21951
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
21952
|
+
templateKey: "empty",
|
|
21953
|
+
rootTagName: "fragment",
|
|
21954
|
+
data: results
|
|
21955
|
+
}));
|
|
21956
|
+
} : undefined;
|
|
21957
|
+
P(h(RelatedProducts, {
|
|
21958
|
+
items: items,
|
|
21959
|
+
sendEvent: function sendEvent() {},
|
|
21960
|
+
classNames: cssClasses,
|
|
21961
|
+
headerComponent: headerComponent,
|
|
21962
|
+
itemComponent: itemComponent,
|
|
21963
|
+
emptyComponent: emptyComponent,
|
|
21964
|
+
status: instantSearchInstance.status
|
|
21965
|
+
}), containerNode);
|
|
21966
|
+
};
|
|
21967
|
+
}
|
|
21968
|
+
var relatedProducts = function relatedProducts(widgetParams) {
|
|
21969
|
+
var _ref4 = widgetParams || {},
|
|
21970
|
+
container = _ref4.container,
|
|
21971
|
+
objectIDs = _ref4.objectIDs,
|
|
21972
|
+
limit = _ref4.limit,
|
|
21973
|
+
queryParameters = _ref4.queryParameters,
|
|
21974
|
+
fallbackParameters = _ref4.fallbackParameters,
|
|
21975
|
+
threshold = _ref4.threshold,
|
|
21976
|
+
escapeHTML = _ref4.escapeHTML,
|
|
21977
|
+
transformItems = _ref4.transformItems,
|
|
21978
|
+
_ref4$templates = _ref4.templates,
|
|
21979
|
+
templates = _ref4$templates === void 0 ? {} : _ref4$templates,
|
|
21980
|
+
_ref4$cssClasses = _ref4.cssClasses,
|
|
21981
|
+
cssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses;
|
|
21982
|
+
if (!container) {
|
|
21983
|
+
throw new Error(withUsage$P('The `container` option is required.'));
|
|
21984
|
+
}
|
|
21985
|
+
var containerNode = getContainerNode(container);
|
|
21986
|
+
var specializedRenderer = createRenderer({
|
|
21987
|
+
containerNode: containerNode,
|
|
21988
|
+
cssClasses: cssClasses,
|
|
21989
|
+
renderState: {},
|
|
21990
|
+
templates: templates
|
|
21991
|
+
});
|
|
21992
|
+
var makeWidget = connectRelatedProducts(specializedRenderer, function () {
|
|
21993
|
+
return P(null, containerNode);
|
|
21994
|
+
});
|
|
21995
|
+
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21996
|
+
objectIDs: objectIDs,
|
|
21997
|
+
limit: limit,
|
|
21998
|
+
queryParameters: queryParameters,
|
|
21999
|
+
fallbackParameters: fallbackParameters,
|
|
22000
|
+
threshold: threshold,
|
|
22001
|
+
escapeHTML: escapeHTML,
|
|
22002
|
+
transformItems: transformItems
|
|
22003
|
+
})), {}, {
|
|
22004
|
+
$$widgetType: 'ais.relatedProducts'
|
|
22005
|
+
});
|
|
22006
|
+
};
|
|
22007
|
+
|
|
20880
22008
|
// Strips leading `0` from a positive number value
|
|
20881
22009
|
function stripLeadingZeroFromInput(value) {
|
|
20882
22010
|
return value.replace(/^(0+)\d/, function (part) {
|
|
@@ -20987,7 +22115,7 @@
|
|
|
20987
22115
|
return RangeInput;
|
|
20988
22116
|
}(d);
|
|
20989
22117
|
|
|
20990
|
-
var withUsage$
|
|
22118
|
+
var withUsage$Q = createDocumentationMessageGenerator({
|
|
20991
22119
|
name: 'range-input'
|
|
20992
22120
|
});
|
|
20993
22121
|
var suit$k = component('RangeInput');
|
|
@@ -21052,7 +22180,7 @@
|
|
|
21052
22180
|
_ref3$templates = _ref3.templates,
|
|
21053
22181
|
templates = _ref3$templates === void 0 ? {} : _ref3$templates;
|
|
21054
22182
|
if (!container) {
|
|
21055
|
-
throw new Error(withUsage$
|
|
22183
|
+
throw new Error(withUsage$Q('The `container` option is required.'));
|
|
21056
22184
|
}
|
|
21057
22185
|
var containerNode = getContainerNode(container);
|
|
21058
22186
|
var cssClasses = {
|
|
@@ -21775,7 +22903,7 @@
|
|
|
21775
22903
|
return Slider;
|
|
21776
22904
|
}(d);
|
|
21777
22905
|
|
|
21778
|
-
var withUsage$
|
|
22906
|
+
var withUsage$R = createDocumentationMessageGenerator({
|
|
21779
22907
|
name: 'range-slider'
|
|
21780
22908
|
});
|
|
21781
22909
|
var suit$l = component('RangeSlider');
|
|
@@ -21844,7 +22972,7 @@
|
|
|
21844
22972
|
_ref3$tooltips = _ref3.tooltips,
|
|
21845
22973
|
tooltips = _ref3$tooltips === void 0 ? true : _ref3$tooltips;
|
|
21846
22974
|
if (!container) {
|
|
21847
|
-
throw new Error(withUsage$
|
|
22975
|
+
throw new Error(withUsage$R('The `container` option is required.'));
|
|
21848
22976
|
}
|
|
21849
22977
|
var containerNode = getContainerNode(container);
|
|
21850
22978
|
var cssClasses = {
|
|
@@ -21923,7 +23051,7 @@
|
|
|
21923
23051
|
}
|
|
21924
23052
|
};
|
|
21925
23053
|
|
|
21926
|
-
var withUsage$
|
|
23054
|
+
var withUsage$S = createDocumentationMessageGenerator({
|
|
21927
23055
|
name: 'rating-menu'
|
|
21928
23056
|
});
|
|
21929
23057
|
var suit$m = component('RatingMenu');
|
|
@@ -22011,7 +23139,7 @@
|
|
|
22011
23139
|
_ref5$templates = _ref5.templates,
|
|
22012
23140
|
templates = _ref5$templates === void 0 ? {} : _ref5$templates;
|
|
22013
23141
|
if (!container) {
|
|
22014
|
-
throw new Error(withUsage$
|
|
23142
|
+
throw new Error(withUsage$S('The `container` option is required.'));
|
|
22015
23143
|
}
|
|
22016
23144
|
var containerNode = getContainerNode(container);
|
|
22017
23145
|
var cssClasses = {
|
|
@@ -22171,7 +23299,7 @@
|
|
|
22171
23299
|
}
|
|
22172
23300
|
};
|
|
22173
23301
|
|
|
22174
|
-
var withUsage$
|
|
23302
|
+
var withUsage$T = createDocumentationMessageGenerator({
|
|
22175
23303
|
name: 'refinement-list'
|
|
22176
23304
|
});
|
|
22177
23305
|
var suit$n = component('RefinementList');
|
|
@@ -22271,7 +23399,7 @@
|
|
|
22271
23399
|
templates = _ref3$templates === void 0 ? {} : _ref3$templates,
|
|
22272
23400
|
transformItems = _ref3.transformItems;
|
|
22273
23401
|
if (!container) {
|
|
22274
|
-
throw new Error(withUsage$
|
|
23402
|
+
throw new Error(withUsage$T('The `container` option is required.'));
|
|
22275
23403
|
}
|
|
22276
23404
|
var escapeFacetValues = searchable ? Boolean(searchableEscapeFacetValues) : false;
|
|
22277
23405
|
var containerNode = getContainerNode(container);
|
|
@@ -22422,7 +23550,7 @@
|
|
|
22422
23550
|
}
|
|
22423
23551
|
};
|
|
22424
23552
|
|
|
22425
|
-
var withUsage$
|
|
23553
|
+
var withUsage$U = createDocumentationMessageGenerator({
|
|
22426
23554
|
name: 'relevant-sort'
|
|
22427
23555
|
});
|
|
22428
23556
|
var suit$o = component('RelevantSort');
|
|
@@ -22450,7 +23578,7 @@
|
|
|
22450
23578
|
_widgetParams$cssClas = widgetParams.cssClasses,
|
|
22451
23579
|
userCssClasses = _widgetParams$cssClas === void 0 ? {} : _widgetParams$cssClas;
|
|
22452
23580
|
if (!container) {
|
|
22453
|
-
throw new Error(withUsage$
|
|
23581
|
+
throw new Error(withUsage$U('The `container` option is required.'));
|
|
22454
23582
|
}
|
|
22455
23583
|
var containerNode = getContainerNode(container);
|
|
22456
23584
|
var cssClasses = {
|
|
@@ -22477,7 +23605,7 @@
|
|
|
22477
23605
|
});
|
|
22478
23606
|
};
|
|
22479
23607
|
|
|
22480
|
-
var withUsage$
|
|
23608
|
+
var withUsage$V = createDocumentationMessageGenerator({
|
|
22481
23609
|
name: 'search-box'
|
|
22482
23610
|
});
|
|
22483
23611
|
var suit$p = component('SearchBox');
|
|
@@ -22545,7 +23673,7 @@
|
|
|
22545
23673
|
_ref3$templates = _ref3.templates,
|
|
22546
23674
|
userTemplates = _ref3$templates === void 0 ? {} : _ref3$templates;
|
|
22547
23675
|
if (!container) {
|
|
22548
|
-
throw new Error(withUsage$
|
|
23676
|
+
throw new Error(withUsage$V('The `container` option is required.'));
|
|
22549
23677
|
}
|
|
22550
23678
|
var containerNode = getContainerNode(container);
|
|
22551
23679
|
var cssClasses = {
|
|
@@ -22598,7 +23726,7 @@
|
|
|
22598
23726
|
});
|
|
22599
23727
|
};
|
|
22600
23728
|
|
|
22601
|
-
var withUsage$
|
|
23729
|
+
var withUsage$W = createDocumentationMessageGenerator({
|
|
22602
23730
|
name: 'sort-by'
|
|
22603
23731
|
});
|
|
22604
23732
|
var suit$q = component('SortBy');
|
|
@@ -22636,7 +23764,7 @@
|
|
|
22636
23764
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,
|
|
22637
23765
|
transformItems = _ref3.transformItems;
|
|
22638
23766
|
if (!container) {
|
|
22639
|
-
throw new Error(withUsage$
|
|
23767
|
+
throw new Error(withUsage$W('The `container` option is required.'));
|
|
22640
23768
|
}
|
|
22641
23769
|
var containerNode = getContainerNode(container);
|
|
22642
23770
|
var cssClasses = {
|
|
@@ -22664,13 +23792,13 @@
|
|
|
22664
23792
|
});
|
|
22665
23793
|
};
|
|
22666
23794
|
|
|
22667
|
-
var _excluded$
|
|
23795
|
+
var _excluded$s = ["nbHits", "nbSortedHits", "cssClasses", "templateProps"];
|
|
22668
23796
|
var Stats = function Stats(_ref) {
|
|
22669
23797
|
var nbHits = _ref.nbHits,
|
|
22670
23798
|
nbSortedHits = _ref.nbSortedHits,
|
|
22671
23799
|
cssClasses = _ref.cssClasses,
|
|
22672
23800
|
templateProps = _ref.templateProps,
|
|
22673
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
23801
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
22674
23802
|
return h("div", {
|
|
22675
23803
|
className: cx(cssClasses.root)
|
|
22676
23804
|
}, h(Template, _extends({}, templateProps, {
|
|
@@ -22693,7 +23821,7 @@
|
|
|
22693
23821
|
})));
|
|
22694
23822
|
};
|
|
22695
23823
|
|
|
22696
|
-
var withUsage$
|
|
23824
|
+
var withUsage$X = createDocumentationMessageGenerator({
|
|
22697
23825
|
name: 'stats'
|
|
22698
23826
|
});
|
|
22699
23827
|
var suit$r = component('Stats');
|
|
@@ -22788,7 +23916,7 @@
|
|
|
22788
23916
|
_ref5$templates = _ref5.templates,
|
|
22789
23917
|
templates = _ref5$templates === void 0 ? {} : _ref5$templates;
|
|
22790
23918
|
if (!container) {
|
|
22791
|
-
throw new Error(withUsage$
|
|
23919
|
+
throw new Error(withUsage$X('The `container` option is required.'));
|
|
22792
23920
|
}
|
|
22793
23921
|
var containerNode = getContainerNode(container);
|
|
22794
23922
|
var cssClasses = {
|
|
@@ -22846,7 +23974,7 @@
|
|
|
22846
23974
|
}
|
|
22847
23975
|
};
|
|
22848
23976
|
|
|
22849
|
-
var withUsage$
|
|
23977
|
+
var withUsage$Y = createDocumentationMessageGenerator({
|
|
22850
23978
|
name: 'toggle-refinement'
|
|
22851
23979
|
});
|
|
22852
23980
|
var suit$s = component('ToggleRefinement');
|
|
@@ -22899,7 +24027,7 @@
|
|
|
22899
24027
|
on = _ref3$on === void 0 ? true : _ref3$on,
|
|
22900
24028
|
off = _ref3.off;
|
|
22901
24029
|
if (!container) {
|
|
22902
|
-
throw new Error(withUsage$
|
|
24030
|
+
throw new Error(withUsage$Y('The `container` option is required.'));
|
|
22903
24031
|
}
|
|
22904
24032
|
var containerNode = getContainerNode(container);
|
|
22905
24033
|
var cssClasses = {
|
|
@@ -22932,6 +24060,111 @@
|
|
|
22932
24060
|
});
|
|
22933
24061
|
};
|
|
22934
24062
|
|
|
24063
|
+
var withUsage$Z = createDocumentationMessageGenerator({
|
|
24064
|
+
name: 'trending-items'
|
|
24065
|
+
});
|
|
24066
|
+
var TrendingItems = createTrendingItemsComponent({
|
|
24067
|
+
createElement: h,
|
|
24068
|
+
Fragment: p
|
|
24069
|
+
});
|
|
24070
|
+
function createRenderer$1(_ref) {
|
|
24071
|
+
var renderState = _ref.renderState,
|
|
24072
|
+
cssClasses = _ref.cssClasses,
|
|
24073
|
+
containerNode = _ref.containerNode,
|
|
24074
|
+
templates = _ref.templates;
|
|
24075
|
+
return function renderer(_ref2, isFirstRendering) {
|
|
24076
|
+
var items = _ref2.items,
|
|
24077
|
+
results = _ref2.results,
|
|
24078
|
+
instantSearchInstance = _ref2.instantSearchInstance;
|
|
24079
|
+
if (isFirstRendering) {
|
|
24080
|
+
renderState.templateProps = prepareTemplateProps({
|
|
24081
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
24082
|
+
defaultTemplates: {},
|
|
24083
|
+
templatesConfig: instantSearchInstance.templatesConfig,
|
|
24084
|
+
templates: templates
|
|
24085
|
+
});
|
|
24086
|
+
return;
|
|
24087
|
+
}
|
|
24088
|
+
var headerComponent = templates.header ? function (data) {
|
|
24089
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24090
|
+
templateKey: "header",
|
|
24091
|
+
rootTagName: "fragment",
|
|
24092
|
+
data: {
|
|
24093
|
+
cssClasses: data.classNames,
|
|
24094
|
+
items: data.items
|
|
24095
|
+
}
|
|
24096
|
+
}));
|
|
24097
|
+
} : undefined;
|
|
24098
|
+
var itemComponent = templates.item ? function (_ref3) {
|
|
24099
|
+
var item = _ref3.item;
|
|
24100
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24101
|
+
templateKey: "item",
|
|
24102
|
+
rootTagName: "fragment",
|
|
24103
|
+
data: item
|
|
24104
|
+
}));
|
|
24105
|
+
} : undefined;
|
|
24106
|
+
var emptyComponent = templates.empty ? function () {
|
|
24107
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24108
|
+
templateKey: "empty",
|
|
24109
|
+
rootTagName: "fragment",
|
|
24110
|
+
data: results
|
|
24111
|
+
}));
|
|
24112
|
+
} : undefined;
|
|
24113
|
+
P(h(TrendingItems, {
|
|
24114
|
+
items: items,
|
|
24115
|
+
sendEvent: function sendEvent() {},
|
|
24116
|
+
classNames: cssClasses,
|
|
24117
|
+
headerComponent: headerComponent,
|
|
24118
|
+
itemComponent: itemComponent,
|
|
24119
|
+
emptyComponent: emptyComponent,
|
|
24120
|
+
status: instantSearchInstance.status
|
|
24121
|
+
}), containerNode);
|
|
24122
|
+
};
|
|
24123
|
+
}
|
|
24124
|
+
var trendingItems = function trendingItems(widgetParams) {
|
|
24125
|
+
var _ref4 = widgetParams || {},
|
|
24126
|
+
container = _ref4.container,
|
|
24127
|
+
facetName = _ref4.facetName,
|
|
24128
|
+
facetValue = _ref4.facetValue,
|
|
24129
|
+
limit = _ref4.limit,
|
|
24130
|
+
queryParameters = _ref4.queryParameters,
|
|
24131
|
+
fallbackParameters = _ref4.fallbackParameters,
|
|
24132
|
+
threshold = _ref4.threshold,
|
|
24133
|
+
escapeHTML = _ref4.escapeHTML,
|
|
24134
|
+
transformItems = _ref4.transformItems,
|
|
24135
|
+
_ref4$templates = _ref4.templates,
|
|
24136
|
+
templates = _ref4$templates === void 0 ? {} : _ref4$templates,
|
|
24137
|
+
_ref4$cssClasses = _ref4.cssClasses,
|
|
24138
|
+
cssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses;
|
|
24139
|
+
if (!container) {
|
|
24140
|
+
throw new Error(withUsage$Z('The `container` option is required.'));
|
|
24141
|
+
}
|
|
24142
|
+
var containerNode = getContainerNode(container);
|
|
24143
|
+
var specializedRenderer = createRenderer$1({
|
|
24144
|
+
containerNode: containerNode,
|
|
24145
|
+
cssClasses: cssClasses,
|
|
24146
|
+
renderState: {},
|
|
24147
|
+
templates: templates
|
|
24148
|
+
});
|
|
24149
|
+
var makeWidget = connectTrendingItems(specializedRenderer, function () {
|
|
24150
|
+
return P(null, containerNode);
|
|
24151
|
+
});
|
|
24152
|
+
var facetParameters = facetName && facetValue ? {
|
|
24153
|
+
facetName: facetName,
|
|
24154
|
+
facetValue: facetValue
|
|
24155
|
+
} : {};
|
|
24156
|
+
return _objectSpread2(_objectSpread2({}, makeWidget(_objectSpread2(_objectSpread2({}, facetParameters), {}, {
|
|
24157
|
+
limit: limit,
|
|
24158
|
+
queryParameters: queryParameters,
|
|
24159
|
+
fallbackParameters: fallbackParameters,
|
|
24160
|
+
threshold: threshold,
|
|
24161
|
+
escapeHTML: escapeHTML,
|
|
24162
|
+
transformItems: transformItems
|
|
24163
|
+
}))), {}, {
|
|
24164
|
+
$$widgetType: 'ais.trendingItems'
|
|
24165
|
+
});
|
|
24166
|
+
};
|
|
24167
|
+
|
|
22935
24168
|
var VoiceSearch = function VoiceSearch(_ref) {
|
|
22936
24169
|
var cssClasses = _ref.cssClasses,
|
|
22937
24170
|
isBrowserSupported = _ref.isBrowserSupported,
|
|
@@ -23066,7 +24299,7 @@
|
|
|
23066
24299
|
}
|
|
23067
24300
|
};
|
|
23068
24301
|
|
|
23069
|
-
var withUsage$
|
|
24302
|
+
var withUsage$_ = createDocumentationMessageGenerator({
|
|
23070
24303
|
name: 'voice-search'
|
|
23071
24304
|
});
|
|
23072
24305
|
var suit$t = component('VoiceSearch');
|
|
@@ -23102,7 +24335,7 @@
|
|
|
23102
24335
|
additionalQueryParameters = _ref3.additionalQueryParameters,
|
|
23103
24336
|
createVoiceSearchHelper = _ref3.createVoiceSearchHelper;
|
|
23104
24337
|
if (!container) {
|
|
23105
|
-
throw new Error(withUsage$
|
|
24338
|
+
throw new Error(withUsage$_('The `container` option is required.'));
|
|
23106
24339
|
}
|
|
23107
24340
|
var containerNode = getContainerNode(container);
|
|
23108
24341
|
var cssClasses = {
|
|
@@ -23136,6 +24369,206 @@
|
|
|
23136
24369
|
});
|
|
23137
24370
|
};
|
|
23138
24371
|
|
|
24372
|
+
var withUsage$$ = createDocumentationMessageGenerator({
|
|
24373
|
+
name: 'frequently-bought-together'
|
|
24374
|
+
});
|
|
24375
|
+
var FrequentlyBoughtTogether = createFrequentlyBoughtTogetherComponent({
|
|
24376
|
+
createElement: h,
|
|
24377
|
+
Fragment: p
|
|
24378
|
+
});
|
|
24379
|
+
var renderer$q = function renderer(_ref) {
|
|
24380
|
+
var renderState = _ref.renderState,
|
|
24381
|
+
cssClasses = _ref.cssClasses,
|
|
24382
|
+
containerNode = _ref.containerNode,
|
|
24383
|
+
templates = _ref.templates;
|
|
24384
|
+
return function (_ref2, isFirstRendering) {
|
|
24385
|
+
var items = _ref2.items,
|
|
24386
|
+
results = _ref2.results,
|
|
24387
|
+
instantSearchInstance = _ref2.instantSearchInstance;
|
|
24388
|
+
if (isFirstRendering) {
|
|
24389
|
+
renderState.templateProps = prepareTemplateProps({
|
|
24390
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
24391
|
+
defaultTemplates: {},
|
|
24392
|
+
templatesConfig: instantSearchInstance.templatesConfig,
|
|
24393
|
+
templates: templates
|
|
24394
|
+
});
|
|
24395
|
+
return;
|
|
24396
|
+
}
|
|
24397
|
+
var headerComponent = templates.header ? function (data) {
|
|
24398
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24399
|
+
templateKey: "header",
|
|
24400
|
+
rootTagName: "fragment",
|
|
24401
|
+
data: {
|
|
24402
|
+
cssClasses: data.classNames,
|
|
24403
|
+
items: data.items
|
|
24404
|
+
}
|
|
24405
|
+
}));
|
|
24406
|
+
} : undefined;
|
|
24407
|
+
var itemComponent = templates.item ? function (_ref3) {
|
|
24408
|
+
var item = _ref3.item;
|
|
24409
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24410
|
+
templateKey: "item",
|
|
24411
|
+
rootTagName: "fragment",
|
|
24412
|
+
data: item
|
|
24413
|
+
}));
|
|
24414
|
+
} : undefined;
|
|
24415
|
+
var emptyComponent = templates.empty ? function () {
|
|
24416
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24417
|
+
templateKey: "empty",
|
|
24418
|
+
rootTagName: "fragment",
|
|
24419
|
+
data: results
|
|
24420
|
+
}));
|
|
24421
|
+
} : undefined;
|
|
24422
|
+
P(h(FrequentlyBoughtTogether, {
|
|
24423
|
+
items: items,
|
|
24424
|
+
headerComponent: headerComponent,
|
|
24425
|
+
itemComponent: itemComponent,
|
|
24426
|
+
sendEvent: function sendEvent() {},
|
|
24427
|
+
classNames: cssClasses,
|
|
24428
|
+
emptyComponent: emptyComponent,
|
|
24429
|
+
status: instantSearchInstance.status
|
|
24430
|
+
}), containerNode);
|
|
24431
|
+
};
|
|
24432
|
+
};
|
|
24433
|
+
var frequentlyBoughtTogether = function frequentlyBoughtTogether(widgetParams) {
|
|
24434
|
+
var _ref4 = widgetParams || {},
|
|
24435
|
+
container = _ref4.container,
|
|
24436
|
+
objectIDs = _ref4.objectIDs,
|
|
24437
|
+
limit = _ref4.limit,
|
|
24438
|
+
queryParameters = _ref4.queryParameters,
|
|
24439
|
+
threshold = _ref4.threshold,
|
|
24440
|
+
escapeHTML = _ref4.escapeHTML,
|
|
24441
|
+
transformItems = _ref4.transformItems,
|
|
24442
|
+
_ref4$templates = _ref4.templates,
|
|
24443
|
+
templates = _ref4$templates === void 0 ? {} : _ref4$templates,
|
|
24444
|
+
_ref4$cssClasses = _ref4.cssClasses,
|
|
24445
|
+
cssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses;
|
|
24446
|
+
if (!container) {
|
|
24447
|
+
throw new Error(withUsage$$('The `container` option is required.'));
|
|
24448
|
+
}
|
|
24449
|
+
var containerNode = getContainerNode(container);
|
|
24450
|
+
var specializedRenderer = renderer$q({
|
|
24451
|
+
containerNode: containerNode,
|
|
24452
|
+
cssClasses: cssClasses,
|
|
24453
|
+
renderState: {},
|
|
24454
|
+
templates: templates
|
|
24455
|
+
});
|
|
24456
|
+
var makeWidget = connectFrequentlyBoughtTogether(specializedRenderer, function () {
|
|
24457
|
+
return P(null, containerNode);
|
|
24458
|
+
});
|
|
24459
|
+
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
24460
|
+
objectIDs: objectIDs,
|
|
24461
|
+
limit: limit,
|
|
24462
|
+
queryParameters: queryParameters,
|
|
24463
|
+
threshold: threshold,
|
|
24464
|
+
escapeHTML: escapeHTML,
|
|
24465
|
+
transformItems: transformItems
|
|
24466
|
+
})), {}, {
|
|
24467
|
+
$$widgetType: 'ais.frequentlyBoughtTogether'
|
|
24468
|
+
});
|
|
24469
|
+
};
|
|
24470
|
+
|
|
24471
|
+
var withUsage$10 = createDocumentationMessageGenerator({
|
|
24472
|
+
name: 'looking-similar'
|
|
24473
|
+
});
|
|
24474
|
+
var LookingSimilar = createLookingSimilarComponent({
|
|
24475
|
+
createElement: h,
|
|
24476
|
+
Fragment: p
|
|
24477
|
+
});
|
|
24478
|
+
var renderer$r = function renderer(_ref) {
|
|
24479
|
+
var renderState = _ref.renderState,
|
|
24480
|
+
cssClasses = _ref.cssClasses,
|
|
24481
|
+
containerNode = _ref.containerNode,
|
|
24482
|
+
templates = _ref.templates;
|
|
24483
|
+
return function (_ref2, isFirstRendering) {
|
|
24484
|
+
var items = _ref2.items,
|
|
24485
|
+
results = _ref2.results,
|
|
24486
|
+
instantSearchInstance = _ref2.instantSearchInstance;
|
|
24487
|
+
if (isFirstRendering) {
|
|
24488
|
+
renderState.templateProps = prepareTemplateProps({
|
|
24489
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
24490
|
+
defaultTemplates: {},
|
|
24491
|
+
templatesConfig: instantSearchInstance.templatesConfig,
|
|
24492
|
+
templates: templates
|
|
24493
|
+
});
|
|
24494
|
+
return;
|
|
24495
|
+
}
|
|
24496
|
+
var headerComponent = templates.header ? function (data) {
|
|
24497
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24498
|
+
templateKey: "header",
|
|
24499
|
+
rootTagName: "fragment",
|
|
24500
|
+
data: {
|
|
24501
|
+
cssClasses: data.classNames,
|
|
24502
|
+
items: data.items
|
|
24503
|
+
}
|
|
24504
|
+
}));
|
|
24505
|
+
} : undefined;
|
|
24506
|
+
var itemComponent = templates.item ? function (_ref3) {
|
|
24507
|
+
var item = _ref3.item;
|
|
24508
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24509
|
+
templateKey: "item",
|
|
24510
|
+
rootTagName: "fragment",
|
|
24511
|
+
data: item
|
|
24512
|
+
}));
|
|
24513
|
+
} : undefined;
|
|
24514
|
+
var emptyComponent = templates.empty ? function () {
|
|
24515
|
+
return h(Template, _extends({}, renderState.templateProps, {
|
|
24516
|
+
templateKey: "empty",
|
|
24517
|
+
rootTagName: "fragment",
|
|
24518
|
+
data: results
|
|
24519
|
+
}));
|
|
24520
|
+
} : undefined;
|
|
24521
|
+
P(h(LookingSimilar, {
|
|
24522
|
+
items: items,
|
|
24523
|
+
headerComponent: headerComponent,
|
|
24524
|
+
itemComponent: itemComponent,
|
|
24525
|
+
sendEvent: function sendEvent() {},
|
|
24526
|
+
classNames: cssClasses,
|
|
24527
|
+
emptyComponent: emptyComponent,
|
|
24528
|
+
status: instantSearchInstance.status
|
|
24529
|
+
}), containerNode);
|
|
24530
|
+
};
|
|
24531
|
+
};
|
|
24532
|
+
var lookingSimilar = function lookingSimilar(widgetParams) {
|
|
24533
|
+
var _ref4 = widgetParams || {},
|
|
24534
|
+
container = _ref4.container,
|
|
24535
|
+
objectIDs = _ref4.objectIDs,
|
|
24536
|
+
limit = _ref4.limit,
|
|
24537
|
+
queryParameters = _ref4.queryParameters,
|
|
24538
|
+
fallbackParameters = _ref4.fallbackParameters,
|
|
24539
|
+
threshold = _ref4.threshold,
|
|
24540
|
+
escapeHTML = _ref4.escapeHTML,
|
|
24541
|
+
transformItems = _ref4.transformItems,
|
|
24542
|
+
_ref4$templates = _ref4.templates,
|
|
24543
|
+
templates = _ref4$templates === void 0 ? {} : _ref4$templates,
|
|
24544
|
+
_ref4$cssClasses = _ref4.cssClasses,
|
|
24545
|
+
cssClasses = _ref4$cssClasses === void 0 ? {} : _ref4$cssClasses;
|
|
24546
|
+
if (!container) {
|
|
24547
|
+
throw new Error(withUsage$10('The `container` option is required.'));
|
|
24548
|
+
}
|
|
24549
|
+
var containerNode = getContainerNode(container);
|
|
24550
|
+
var specializedRenderer = renderer$r({
|
|
24551
|
+
containerNode: containerNode,
|
|
24552
|
+
cssClasses: cssClasses,
|
|
24553
|
+
renderState: {},
|
|
24554
|
+
templates: templates
|
|
24555
|
+
});
|
|
24556
|
+
var makeWidget = connectLookingSimilar(specializedRenderer, function () {
|
|
24557
|
+
return P(null, containerNode);
|
|
24558
|
+
});
|
|
24559
|
+
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
24560
|
+
objectIDs: objectIDs,
|
|
24561
|
+
limit: limit,
|
|
24562
|
+
queryParameters: queryParameters,
|
|
24563
|
+
fallbackParameters: fallbackParameters,
|
|
24564
|
+
threshold: threshold,
|
|
24565
|
+
escapeHTML: escapeHTML,
|
|
24566
|
+
transformItems: transformItems
|
|
24567
|
+
})), {}, {
|
|
24568
|
+
$$widgetType: 'ais.lookingSimilar'
|
|
24569
|
+
});
|
|
24570
|
+
};
|
|
24571
|
+
|
|
23139
24572
|
/** @deprecated answers is no longer supported */
|
|
23140
24573
|
var EXPERIMENTAL_answers = deprecate(answers, 'answers is no longer supported');
|
|
23141
24574
|
|
|
@@ -23168,6 +24601,7 @@
|
|
|
23168
24601
|
poweredBy: poweredBy,
|
|
23169
24602
|
queryRuleContext: queryRuleContext,
|
|
23170
24603
|
queryRuleCustomData: queryRuleCustomData,
|
|
24604
|
+
relatedProducts: relatedProducts,
|
|
23171
24605
|
rangeInput: rangeInput,
|
|
23172
24606
|
rangeSlider: rangeSlider,
|
|
23173
24607
|
ratingMenu: ratingMenu,
|
|
@@ -23177,7 +24611,10 @@
|
|
|
23177
24611
|
sortBy: sortBy,
|
|
23178
24612
|
stats: stats,
|
|
23179
24613
|
toggleRefinement: toggleRefinement,
|
|
23180
|
-
|
|
24614
|
+
trendingItems: trendingItems,
|
|
24615
|
+
voiceSearch: voiceSearch,
|
|
24616
|
+
frequentlyBoughtTogether: frequentlyBoughtTogether,
|
|
24617
|
+
lookingSimilar: lookingSimilar
|
|
23181
24618
|
});
|
|
23182
24619
|
|
|
23183
24620
|
/**
|