@algolia/autocomplete-js 1.5.0 → 1.5.1

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.
@@ -1,11 +1,11 @@
1
- /*! @algolia/autocomplete-js 1.5.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-js 1.5.1 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@algolia/autocomplete-js'] = {}));
6
- }(this, (function (exports) { 'use strict';
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/autocomplete-js"] = {}));
6
+ })(this, (function (exports) { 'use strict';
7
7
 
8
- function ownKeys(object, enumerableOnly) {
8
+ function ownKeys$g(object, enumerableOnly) {
9
9
  var keys = Object.keys(object);
10
10
 
11
11
  if (Object.getOwnPropertySymbols) {
@@ -28,13 +28,13 @@
28
28
  var source = arguments[i] != null ? arguments[i] : {};
29
29
 
30
30
  if (i % 2) {
31
- ownKeys(Object(source), true).forEach(function (key) {
32
- _defineProperty(target, key, source[key]);
31
+ ownKeys$g(Object(source), true).forEach(function (key) {
32
+ _defineProperty$g(target, key, source[key]);
33
33
  });
34
34
  } else if (Object.getOwnPropertyDescriptors) {
35
35
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
36
36
  } else {
37
- ownKeys(Object(source)).forEach(function (key) {
37
+ ownKeys$g(Object(source)).forEach(function (key) {
38
38
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
39
39
  });
40
40
  }
@@ -43,23 +43,23 @@
43
43
  return target;
44
44
  }
45
45
 
46
- function _typeof(obj) {
46
+ function _typeof$3(obj) {
47
47
  "@babel/helpers - typeof";
48
48
 
49
49
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
50
- _typeof = function (obj) {
50
+ _typeof$3 = function (obj) {
51
51
  return typeof obj;
52
52
  };
53
53
  } else {
54
- _typeof = function (obj) {
54
+ _typeof$3 = function (obj) {
55
55
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
56
56
  };
57
57
  }
58
58
 
59
- return _typeof(obj);
59
+ return _typeof$3(obj);
60
60
  }
61
61
 
62
- function _defineProperty(obj, key, value) {
62
+ function _defineProperty$g(obj, key, value) {
63
63
  if (key in obj) {
64
64
  Object.defineProperty(obj, key, {
65
65
  value: value,
@@ -92,7 +92,7 @@
92
92
  return _extends.apply(this, arguments);
93
93
  }
94
94
 
95
- function _objectWithoutPropertiesLoose(source, excluded) {
95
+ function _objectWithoutPropertiesLoose$4(source, excluded) {
96
96
  if (source == null) return {};
97
97
  var target = {};
98
98
  var sourceKeys = Object.keys(source);
@@ -107,10 +107,10 @@
107
107
  return target;
108
108
  }
109
109
 
110
- function _objectWithoutProperties(source, excluded) {
110
+ function _objectWithoutProperties$4(source, excluded) {
111
111
  if (source == null) return {};
112
112
 
113
- var target = _objectWithoutPropertiesLoose(source, excluded);
113
+ var target = _objectWithoutPropertiesLoose$4(source, excluded);
114
114
 
115
115
  var key, i;
116
116
 
@@ -128,28 +128,28 @@
128
128
  return target;
129
129
  }
130
130
 
131
- function _toConsumableArray(arr) {
132
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
131
+ function _toConsumableArray$5(arr) {
132
+ return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$6(arr) || _nonIterableSpread$5();
133
133
  }
134
134
 
135
- function _arrayWithoutHoles(arr) {
136
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
135
+ function _arrayWithoutHoles$5(arr) {
136
+ if (Array.isArray(arr)) return _arrayLikeToArray$6(arr);
137
137
  }
138
138
 
139
- function _iterableToArray(iter) {
139
+ function _iterableToArray$5(iter) {
140
140
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
141
141
  }
142
142
 
143
- function _unsupportedIterableToArray(o, minLen) {
143
+ function _unsupportedIterableToArray$6(o, minLen) {
144
144
  if (!o) return;
145
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
145
+ if (typeof o === "string") return _arrayLikeToArray$6(o, minLen);
146
146
  var n = Object.prototype.toString.call(o).slice(8, -1);
147
147
  if (n === "Object" && o.constructor) n = o.constructor.name;
148
148
  if (n === "Map" || n === "Set") return Array.from(o);
149
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
149
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen);
150
150
  }
151
151
 
152
- function _arrayLikeToArray(arr, len) {
152
+ function _arrayLikeToArray$6(arr, len) {
153
153
  if (len == null || len > arr.length) len = arr.length;
154
154
 
155
155
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
@@ -157,7 +157,7 @@
157
157
  return arr2;
158
158
  }
159
159
 
160
- function _nonIterableSpread() {
160
+ function _nonIterableSpread$5() {
161
161
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
162
162
  }
163
163
 
@@ -185,23 +185,23 @@
185
185
  }
186
186
 
187
187
  function _slicedToArray(arr, i) {
188
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
188
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$5(arr, i) || _nonIterableRest();
189
189
  }
190
190
 
191
191
  function _nonIterableRest() {
192
192
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
193
193
  }
194
194
 
195
- function _unsupportedIterableToArray$1(o, minLen) {
195
+ function _unsupportedIterableToArray$5(o, minLen) {
196
196
  if (!o) return;
197
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
197
+ if (typeof o === "string") return _arrayLikeToArray$5(o, minLen);
198
198
  var n = Object.prototype.toString.call(o).slice(8, -1);
199
199
  if (n === "Object" && o.constructor) n = o.constructor.name;
200
200
  if (n === "Map" || n === "Set") return Array.from(o);
201
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
201
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen);
202
202
  }
203
203
 
204
- function _arrayLikeToArray$1(arr, len) {
204
+ function _arrayLikeToArray$5(arr, len) {
205
205
  if (len == null || len > arr.length) len = arr.length;
206
206
 
207
207
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -245,20 +245,20 @@
245
245
  if (Array.isArray(arr)) return arr;
246
246
  }
247
247
 
248
- function _typeof$1(obj) {
248
+ function _typeof$2(obj) {
249
249
  "@babel/helpers - typeof";
250
250
 
251
251
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
252
- _typeof$1 = function _typeof(obj) {
252
+ _typeof$2 = function _typeof(obj) {
253
253
  return typeof obj;
254
254
  };
255
255
  } else {
256
- _typeof$1 = function _typeof(obj) {
256
+ _typeof$2 = function _typeof(obj) {
257
257
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
258
258
  };
259
259
  }
260
260
 
261
- return _typeof$1(obj);
261
+ return _typeof$2(obj);
262
262
  }
263
263
  /**
264
264
  * Decycles objects with circular references.
@@ -269,7 +269,7 @@
269
269
  function decycle(obj) {
270
270
  var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
271
271
 
272
- if ( !obj || _typeof$1(obj) !== 'object') {
272
+ if (!obj || _typeof$2(obj) !== 'object') {
273
273
  return obj;
274
274
  }
275
275
 
@@ -335,9 +335,9 @@
335
335
 
336
336
  var noop = function noop() {};
337
337
 
338
- var version = '1.5.0';
338
+ var version = '1.5.1';
339
339
 
340
- var userAgents = [{
340
+ var userAgents$1 = [{
341
341
  segment: 'autocomplete-core',
342
342
  version: version
343
343
  }];
@@ -367,10 +367,10 @@
367
367
  }
368
368
 
369
369
  function checkOptions(options) {
370
- "development" !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0 ;
370
+ "development" !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0 ;
371
371
  }
372
372
 
373
- function ownKeys$1(object, enumerableOnly) {
373
+ function ownKeys$f(object, enumerableOnly) {
374
374
  var keys = Object.keys(object);
375
375
 
376
376
  if (Object.getOwnPropertySymbols) {
@@ -388,18 +388,18 @@
388
388
  return keys;
389
389
  }
390
390
 
391
- function _objectSpread(target) {
391
+ function _objectSpread$f(target) {
392
392
  for (var i = 1; i < arguments.length; i++) {
393
393
  var source = arguments[i] != null ? arguments[i] : {};
394
394
 
395
395
  if (i % 2) {
396
- ownKeys$1(Object(source), true).forEach(function (key) {
397
- _defineProperty$1(target, key, source[key]);
396
+ ownKeys$f(Object(source), true).forEach(function (key) {
397
+ _defineProperty$f(target, key, source[key]);
398
398
  });
399
399
  } else if (Object.getOwnPropertyDescriptors) {
400
400
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
401
401
  } else {
402
- ownKeys$1(Object(source)).forEach(function (key) {
402
+ ownKeys$f(Object(source)).forEach(function (key) {
403
403
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
404
404
  });
405
405
  }
@@ -408,7 +408,7 @@
408
408
  return target;
409
409
  }
410
410
 
411
- function _defineProperty$1(obj, key, value) {
411
+ function _defineProperty$f(obj, key, value) {
412
412
  if (key in obj) {
413
413
  Object.defineProperty(obj, key, {
414
414
  value: value,
@@ -430,7 +430,7 @@
430
430
  return state;
431
431
  },
432
432
  dispatch: function dispatch(action, payload) {
433
- var prevState = _objectSpread({}, state);
433
+ var prevState = _objectSpread$f({}, state);
434
434
 
435
435
  state = reducer(state, {
436
436
  type: action,
@@ -441,11 +441,12 @@
441
441
  state: state,
442
442
  prevState: prevState
443
443
  });
444
- }
444
+ },
445
+ shouldSkipPendingUpdate: false
445
446
  };
446
447
  }
447
448
 
448
- function ownKeys$2(object, enumerableOnly) {
449
+ function ownKeys$e(object, enumerableOnly) {
449
450
  var keys = Object.keys(object);
450
451
 
451
452
  if (Object.getOwnPropertySymbols) {
@@ -463,18 +464,18 @@
463
464
  return keys;
464
465
  }
465
466
 
466
- function _objectSpread$1(target) {
467
+ function _objectSpread$e(target) {
467
468
  for (var i = 1; i < arguments.length; i++) {
468
469
  var source = arguments[i] != null ? arguments[i] : {};
469
470
 
470
471
  if (i % 2) {
471
- ownKeys$2(Object(source), true).forEach(function (key) {
472
- _defineProperty$2(target, key, source[key]);
472
+ ownKeys$e(Object(source), true).forEach(function (key) {
473
+ _defineProperty$e(target, key, source[key]);
473
474
  });
474
475
  } else if (Object.getOwnPropertyDescriptors) {
475
476
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
476
477
  } else {
477
- ownKeys$2(Object(source)).forEach(function (key) {
478
+ ownKeys$e(Object(source)).forEach(function (key) {
478
479
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
479
480
  });
480
481
  }
@@ -483,7 +484,7 @@
483
484
  return target;
484
485
  }
485
486
 
486
- function _defineProperty$2(obj, key, value) {
487
+ function _defineProperty$e(obj, key, value) {
487
488
  if (key in obj) {
488
489
  Object.defineProperty(obj, key, {
489
490
  value: value,
@@ -511,11 +512,11 @@
511
512
  var setCollections = function setCollections(rawValue) {
512
513
  var baseItemId = 0;
513
514
  var value = rawValue.map(function (collection) {
514
- return _objectSpread$1(_objectSpread$1({}, collection), {}, {
515
+ return _objectSpread$e(_objectSpread$e({}, collection), {}, {
515
516
  // We flatten the stored items to support calling `getAlgoliaResults`
516
517
  // from the source itself.
517
518
  items: flatten(collection.items).map(function (item) {
518
- return _objectSpread$1(_objectSpread$1({}, item), {}, {
519
+ return _objectSpread$e(_objectSpread$e({}, item), {}, {
519
520
  __autocomplete_id: baseItemId++
520
521
  });
521
522
  })
@@ -556,8 +557,11 @@
556
557
  var basePromiseId = -1;
557
558
  var latestResolvedId = -1;
558
559
  var latestResolvedValue = undefined;
559
- return function runConcurrentSafePromise(promise) {
560
+ var runningPromisesCount = 0;
561
+
562
+ function runConcurrentSafePromise(promise) {
560
563
  basePromiseId++;
564
+ runningPromisesCount++;
561
565
  var currentPromiseId = basePromiseId;
562
566
  return Promise.resolve(promise).then(function (x) {
563
567
  // The promise might take too long to resolve and get outdated. This would
@@ -580,8 +584,16 @@
580
584
  latestResolvedId = currentPromiseId;
581
585
  latestResolvedValue = x;
582
586
  return x;
587
+ }).finally(function () {
588
+ return runningPromisesCount--;
583
589
  });
590
+ }
591
+
592
+ runConcurrentSafePromise.isRunning = function () {
593
+ return runningPromisesCount > 0;
584
594
  };
595
+
596
+ return runConcurrentSafePromise;
585
597
  }
586
598
 
587
599
  /**
@@ -618,7 +630,7 @@
618
630
  return numericIndex;
619
631
  }
620
632
 
621
- function ownKeys$3(object, enumerableOnly) {
633
+ function ownKeys$d(object, enumerableOnly) {
622
634
  var keys = Object.keys(object);
623
635
 
624
636
  if (Object.getOwnPropertySymbols) {
@@ -636,18 +648,18 @@
636
648
  return keys;
637
649
  }
638
650
 
639
- function _objectSpread$2(target) {
651
+ function _objectSpread$d(target) {
640
652
  for (var i = 1; i < arguments.length; i++) {
641
653
  var source = arguments[i] != null ? arguments[i] : {};
642
654
 
643
655
  if (i % 2) {
644
- ownKeys$3(Object(source), true).forEach(function (key) {
645
- _defineProperty$3(target, key, source[key]);
656
+ ownKeys$d(Object(source), true).forEach(function (key) {
657
+ _defineProperty$d(target, key, source[key]);
646
658
  });
647
659
  } else if (Object.getOwnPropertyDescriptors) {
648
660
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
649
661
  } else {
650
- ownKeys$3(Object(source)).forEach(function (key) {
662
+ ownKeys$d(Object(source)).forEach(function (key) {
651
663
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
652
664
  });
653
665
  }
@@ -656,7 +668,7 @@
656
668
  return target;
657
669
  }
658
670
 
659
- function _defineProperty$3(obj, key, value) {
671
+ function _defineProperty$d(obj, key, value) {
660
672
  if (key in obj) {
661
673
  Object.defineProperty(obj, key, {
662
674
  value: value,
@@ -671,26 +683,26 @@
671
683
  return obj;
672
684
  }
673
685
 
674
- function _typeof$2(obj) {
686
+ function _typeof$1(obj) {
675
687
  "@babel/helpers - typeof";
676
688
 
677
689
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
678
- _typeof$2 = function _typeof(obj) {
690
+ _typeof$1 = function _typeof(obj) {
679
691
  return typeof obj;
680
692
  };
681
693
  } else {
682
- _typeof$2 = function _typeof(obj) {
694
+ _typeof$1 = function _typeof(obj) {
683
695
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
684
696
  };
685
697
  }
686
698
 
687
- return _typeof$2(obj);
699
+ return _typeof$1(obj);
688
700
  }
689
701
  function getNormalizedSources(getSources, params) {
690
702
  var seenSourceIds = [];
691
703
  return Promise.resolve(getSources(params)).then(function (sources) {
692
704
  invariant(Array.isArray(sources), function () {
693
- return "The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(_typeof$2(sources)), ":\n\n").concat(JSON.stringify(decycle(sources), null, 2));
705
+ return "The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(_typeof$1(sources)), ":\n\n").concat(JSON.stringify(decycle(sources), null, 2));
694
706
  });
695
707
  return Promise.all(sources // We allow `undefined` and `false` sources to allow users to use
696
708
  // `Boolean(query) && source` (=> `false`).
@@ -706,7 +718,7 @@
706
718
 
707
719
  seenSourceIds.push(source.sourceId);
708
720
 
709
- var normalizedSource = _objectSpread$2({
721
+ var normalizedSource = _objectSpread$d({
710
722
  getItemInputValue: function getItemInputValue(_ref) {
711
723
  var state = _ref.state;
712
724
  return state.query;
@@ -816,7 +828,7 @@
816
828
  return parent === child || parent.contains(child);
817
829
  }
818
830
 
819
- function ownKeys$4(object, enumerableOnly) {
831
+ function ownKeys$c(object, enumerableOnly) {
820
832
  var keys = Object.keys(object);
821
833
 
822
834
  if (Object.getOwnPropertySymbols) {
@@ -834,18 +846,18 @@
834
846
  return keys;
835
847
  }
836
848
 
837
- function _objectSpread$3(target) {
849
+ function _objectSpread$c(target) {
838
850
  for (var i = 1; i < arguments.length; i++) {
839
851
  var source = arguments[i] != null ? arguments[i] : {};
840
852
 
841
853
  if (i % 2) {
842
- ownKeys$4(Object(source), true).forEach(function (key) {
843
- _defineProperty$4(target, key, source[key]);
854
+ ownKeys$c(Object(source), true).forEach(function (key) {
855
+ _defineProperty$c(target, key, source[key]);
844
856
  });
845
857
  } else if (Object.getOwnPropertyDescriptors) {
846
858
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
847
859
  } else {
848
- ownKeys$4(Object(source)).forEach(function (key) {
860
+ ownKeys$c(Object(source)).forEach(function (key) {
849
861
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
850
862
  });
851
863
  }
@@ -854,7 +866,7 @@
854
866
  return target;
855
867
  }
856
868
 
857
- function _defineProperty$4(obj, key, value) {
869
+ function _defineProperty$c(obj, key, value) {
858
870
  if (key in obj) {
859
871
  Object.defineProperty(obj, key, {
860
872
  value: value,
@@ -873,10 +885,10 @@
873
885
  var results = rawResults.map(function (result) {
874
886
  var _hits;
875
887
 
876
- return _objectSpread$3(_objectSpread$3({}, result), {}, {
888
+ return _objectSpread$c(_objectSpread$c({}, result), {}, {
877
889
  hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) {
878
890
  // Bring support for the Insights plugin.
879
- return _objectSpread$3(_objectSpread$3({}, hit), {}, {
891
+ return _objectSpread$c(_objectSpread$c({}, hit), {}, {
880
892
  __autocomplete_indexName: result.index,
881
893
  __autocomplete_queryID: result.queryID
882
894
  });
@@ -907,32 +919,32 @@
907
919
  };
908
920
  }
909
921
 
910
- function _toConsumableArray$1(arr) {
911
- return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$1();
922
+ function _toConsumableArray$4(arr) {
923
+ return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread$4();
912
924
  }
913
925
 
914
- function _nonIterableSpread$1() {
926
+ function _nonIterableSpread$4() {
915
927
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
916
928
  }
917
929
 
918
- function _unsupportedIterableToArray$2(o, minLen) {
930
+ function _unsupportedIterableToArray$4(o, minLen) {
919
931
  if (!o) return;
920
- if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
932
+ if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
921
933
  var n = Object.prototype.toString.call(o).slice(8, -1);
922
934
  if (n === "Object" && o.constructor) n = o.constructor.name;
923
935
  if (n === "Map" || n === "Set") return Array.from(o);
924
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
936
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
925
937
  }
926
938
 
927
- function _iterableToArray$1(iter) {
939
+ function _iterableToArray$4(iter) {
928
940
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
929
941
  }
930
942
 
931
- function _arrayWithoutHoles$1(arr) {
932
- if (Array.isArray(arr)) return _arrayLikeToArray$2(arr);
943
+ function _arrayWithoutHoles$4(arr) {
944
+ if (Array.isArray(arr)) return _arrayLikeToArray$4(arr);
933
945
  }
934
946
 
935
- function _arrayLikeToArray$2(arr, len) {
947
+ function _arrayLikeToArray$4(arr, len) {
936
948
  if (len == null || len > arr.length) len = arr.length;
937
949
 
938
950
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -942,7 +954,7 @@
942
954
  return arr2;
943
955
  }
944
956
 
945
- function ownKeys$5(object, enumerableOnly) {
957
+ function ownKeys$b(object, enumerableOnly) {
946
958
  var keys = Object.keys(object);
947
959
 
948
960
  if (Object.getOwnPropertySymbols) {
@@ -960,18 +972,18 @@
960
972
  return keys;
961
973
  }
962
974
 
963
- function _objectSpread$4(target) {
975
+ function _objectSpread$b(target) {
964
976
  for (var i = 1; i < arguments.length; i++) {
965
977
  var source = arguments[i] != null ? arguments[i] : {};
966
978
 
967
979
  if (i % 2) {
968
- ownKeys$5(Object(source), true).forEach(function (key) {
969
- _defineProperty$5(target, key, source[key]);
980
+ ownKeys$b(Object(source), true).forEach(function (key) {
981
+ _defineProperty$b(target, key, source[key]);
970
982
  });
971
983
  } else if (Object.getOwnPropertyDescriptors) {
972
984
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
973
985
  } else {
974
- ownKeys$5(Object(source)).forEach(function (key) {
986
+ ownKeys$b(Object(source)).forEach(function (key) {
975
987
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
976
988
  });
977
989
  }
@@ -980,7 +992,7 @@
980
992
  return target;
981
993
  }
982
994
 
983
- function _defineProperty$5(obj, key, value) {
995
+ function _defineProperty$b(obj, key, value) {
984
996
  if (key in obj) {
985
997
  Object.defineProperty(obj, key, {
986
998
  value: value,
@@ -1003,7 +1015,7 @@
1003
1015
  /* eslint-enable no-restricted-globals */
1004
1016
 
1005
1017
  var plugins = props.plugins || [];
1006
- return _objectSpread$4(_objectSpread$4({
1018
+ return _objectSpread$b(_objectSpread$b({
1007
1019
  debug: false,
1008
1020
  openOnFocus: false,
1009
1021
  placeholder: '',
@@ -1025,7 +1037,7 @@
1025
1037
  id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(),
1026
1038
  plugins: plugins,
1027
1039
  // The following props need to be deeply defaulted.
1028
- initialState: _objectSpread$4({
1040
+ initialState: _objectSpread$b({
1029
1041
  activeItemId: null,
1030
1042
  query: '',
1031
1043
  completion: null,
@@ -1065,7 +1077,7 @@
1065
1077
  });
1066
1078
  },
1067
1079
  getSources: function getSources(params) {
1068
- return Promise.all([].concat(_toConsumableArray$1(plugins.map(function (plugin) {
1080
+ return Promise.all([].concat(_toConsumableArray$4(plugins.map(function (plugin) {
1069
1081
  return plugin.getSources;
1070
1082
  })), [props.getSources]).filter(Boolean).map(function (getSources) {
1071
1083
  return getNormalizedSources(getSources, params);
@@ -1073,7 +1085,7 @@
1073
1085
  return flatten(nested);
1074
1086
  }).then(function (sources) {
1075
1087
  return sources.map(function (source) {
1076
- return _objectSpread$4(_objectSpread$4({}, source), {}, {
1088
+ return _objectSpread$b(_objectSpread$b({}, source), {}, {
1077
1089
  onSelect: function onSelect(params) {
1078
1090
  source.onSelect(params);
1079
1091
  pluginSubscribers.forEach(function (x) {
@@ -1094,7 +1106,7 @@
1094
1106
  });
1095
1107
  });
1096
1108
  },
1097
- navigator: _objectSpread$4({
1109
+ navigator: _objectSpread$b({
1098
1110
  navigate: function navigate(_ref3) {
1099
1111
  var itemUrl = _ref3.itemUrl;
1100
1112
  environment.location.assign(itemUrl);
@@ -1112,7 +1124,7 @@
1112
1124
  });
1113
1125
  }
1114
1126
 
1115
- function ownKeys$6(object, enumerableOnly) {
1127
+ function ownKeys$a(object, enumerableOnly) {
1116
1128
  var keys = Object.keys(object);
1117
1129
 
1118
1130
  if (Object.getOwnPropertySymbols) {
@@ -1130,18 +1142,18 @@
1130
1142
  return keys;
1131
1143
  }
1132
1144
 
1133
- function _objectSpread$5(target) {
1145
+ function _objectSpread$a(target) {
1134
1146
  for (var i = 1; i < arguments.length; i++) {
1135
1147
  var source = arguments[i] != null ? arguments[i] : {};
1136
1148
 
1137
1149
  if (i % 2) {
1138
- ownKeys$6(Object(source), true).forEach(function (key) {
1139
- _defineProperty$6(target, key, source[key]);
1150
+ ownKeys$a(Object(source), true).forEach(function (key) {
1151
+ _defineProperty$a(target, key, source[key]);
1140
1152
  });
1141
1153
  } else if (Object.getOwnPropertyDescriptors) {
1142
1154
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1143
1155
  } else {
1144
- ownKeys$6(Object(source)).forEach(function (key) {
1156
+ ownKeys$a(Object(source)).forEach(function (key) {
1145
1157
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1146
1158
  });
1147
1159
  }
@@ -1150,7 +1162,7 @@
1150
1162
  return target;
1151
1163
  }
1152
1164
 
1153
- function _defineProperty$6(obj, key, value) {
1165
+ function _defineProperty$a(obj, key, value) {
1154
1166
  if (key in obj) {
1155
1167
  Object.defineProperty(obj, key, {
1156
1168
  value: value,
@@ -1171,7 +1183,7 @@
1171
1183
  // Example: `const { recentSearchesPlugin } = sourcesBySourceId`
1172
1184
 
1173
1185
  var sourcesBySourceId = collections.reduce(function (acc, collection) {
1174
- return _objectSpread$5(_objectSpread$5({}, acc), {}, _defineProperty$6({}, collection.source.sourceId, _objectSpread$5(_objectSpread$5({}, collection.source), {}, {
1186
+ return _objectSpread$a(_objectSpread$a({}, acc), {}, _defineProperty$a({}, collection.source.sourceId, _objectSpread$a(_objectSpread$a({}, collection.source), {}, {
1175
1187
  getItems: function getItems() {
1176
1188
  // We provide the resolved items from the collection to the `reshape` prop.
1177
1189
  return flatten(collection.items);
@@ -1192,27 +1204,27 @@
1192
1204
  });
1193
1205
  }
1194
1206
 
1195
- function _typeof$3(obj) {
1207
+ function _typeof(obj) {
1196
1208
  "@babel/helpers - typeof";
1197
1209
 
1198
1210
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1199
- _typeof$3 = function _typeof(obj) {
1211
+ _typeof = function _typeof(obj) {
1200
1212
  return typeof obj;
1201
1213
  };
1202
1214
  } else {
1203
- _typeof$3 = function _typeof(obj) {
1215
+ _typeof = function _typeof(obj) {
1204
1216
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1205
1217
  };
1206
1218
  }
1207
1219
 
1208
- return _typeof$3(obj);
1220
+ return _typeof(obj);
1209
1221
  }
1210
1222
 
1211
- function _toConsumableArray$2(arr) {
1212
- return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread$2();
1223
+ function _toConsumableArray$3(arr) {
1224
+ return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread$3();
1213
1225
  }
1214
1226
 
1215
- function _nonIterableSpread$2() {
1227
+ function _nonIterableSpread$3() {
1216
1228
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1217
1229
  }
1218
1230
 
@@ -1225,11 +1237,11 @@
1225
1237
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
1226
1238
  }
1227
1239
 
1228
- function _iterableToArray$2(iter) {
1240
+ function _iterableToArray$3(iter) {
1229
1241
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1230
1242
  }
1231
1243
 
1232
- function _arrayWithoutHoles$2(arr) {
1244
+ function _arrayWithoutHoles$3(arr) {
1233
1245
  if (Array.isArray(arr)) return _arrayLikeToArray$3(arr);
1234
1246
  }
1235
1247
 
@@ -1243,7 +1255,7 @@
1243
1255
  return arr2;
1244
1256
  }
1245
1257
 
1246
- function ownKeys$7(object, enumerableOnly) {
1258
+ function ownKeys$9(object, enumerableOnly) {
1247
1259
  var keys = Object.keys(object);
1248
1260
 
1249
1261
  if (Object.getOwnPropertySymbols) {
@@ -1261,18 +1273,18 @@
1261
1273
  return keys;
1262
1274
  }
1263
1275
 
1264
- function _objectSpread$6(target) {
1276
+ function _objectSpread$9(target) {
1265
1277
  for (var i = 1; i < arguments.length; i++) {
1266
1278
  var source = arguments[i] != null ? arguments[i] : {};
1267
1279
 
1268
1280
  if (i % 2) {
1269
- ownKeys$7(Object(source), true).forEach(function (key) {
1270
- _defineProperty$7(target, key, source[key]);
1281
+ ownKeys$9(Object(source), true).forEach(function (key) {
1282
+ _defineProperty$9(target, key, source[key]);
1271
1283
  });
1272
1284
  } else if (Object.getOwnPropertyDescriptors) {
1273
1285
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1274
1286
  } else {
1275
- ownKeys$7(Object(source)).forEach(function (key) {
1287
+ ownKeys$9(Object(source)).forEach(function (key) {
1276
1288
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1277
1289
  });
1278
1290
  }
@@ -1281,7 +1293,7 @@
1281
1293
  return target;
1282
1294
  }
1283
1295
 
1284
- function _defineProperty$7(obj, key, value) {
1296
+ function _defineProperty$9(obj, key, value) {
1285
1297
  if (key in obj) {
1286
1298
  Object.defineProperty(obj, key, {
1287
1299
  value: value,
@@ -1306,7 +1318,7 @@
1306
1318
 
1307
1319
  function preResolve(itemsOrDescription, sourceId) {
1308
1320
  if (isRequesterDescription(itemsOrDescription)) {
1309
- return _objectSpread$6(_objectSpread$6({}, itemsOrDescription), {}, {
1321
+ return _objectSpread$9(_objectSpread$9({}, itemsOrDescription), {}, {
1310
1322
  requests: itemsOrDescription.queries.map(function (query) {
1311
1323
  return {
1312
1324
  query: query,
@@ -1339,7 +1351,7 @@
1339
1351
  if (container) {
1340
1352
  var _container$items;
1341
1353
 
1342
- (_container$items = container.items).push.apply(_container$items, _toConsumableArray$2(requests));
1354
+ (_container$items = container.items).push.apply(_container$items, _toConsumableArray$3(requests));
1343
1355
  } else {
1344
1356
  var request = {
1345
1357
  execute: execute,
@@ -1381,7 +1393,7 @@
1381
1393
  var transform = matches[0].transformResponse;
1382
1394
  var items = transform ? transform(mapToAlgoliaResponse(results)) : results;
1383
1395
  invariant(Array.isArray(items), function () {
1384
- return "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned type ").concat(JSON.stringify(_typeof$3(items)), ":\n\n").concat(JSON.stringify(decycle(items), null, 2), ".\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems");
1396
+ return "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned type ").concat(JSON.stringify(_typeof(items)), ":\n\n").concat(JSON.stringify(decycle(items), null, 2), ".\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems");
1385
1397
  });
1386
1398
  invariant(items.every(Boolean), "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned ").concat(JSON.stringify(undefined), ".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"));
1387
1399
  return {
@@ -1391,7 +1403,7 @@
1391
1403
  });
1392
1404
  }
1393
1405
 
1394
- var _excluded = ["event", "nextState", "props", "query", "refresh", "store"];
1406
+ var _excluded$6 = ["event", "nextState", "props", "query", "refresh", "store"];
1395
1407
 
1396
1408
  function ownKeys$8(object, enumerableOnly) {
1397
1409
  var keys = Object.keys(object);
@@ -1411,7 +1423,7 @@
1411
1423
  return keys;
1412
1424
  }
1413
1425
 
1414
- function _objectSpread$7(target) {
1426
+ function _objectSpread$8(target) {
1415
1427
  for (var i = 1; i < arguments.length; i++) {
1416
1428
  var source = arguments[i] != null ? arguments[i] : {};
1417
1429
 
@@ -1446,10 +1458,10 @@
1446
1458
  return obj;
1447
1459
  }
1448
1460
 
1449
- function _objectWithoutProperties$1(source, excluded) {
1461
+ function _objectWithoutProperties$3(source, excluded) {
1450
1462
  if (source == null) return {};
1451
1463
 
1452
- var target = _objectWithoutPropertiesLoose$1(source, excluded);
1464
+ var target = _objectWithoutPropertiesLoose$3(source, excluded);
1453
1465
 
1454
1466
  var key, i;
1455
1467
 
@@ -1467,7 +1479,7 @@
1467
1479
  return target;
1468
1480
  }
1469
1481
 
1470
- function _objectWithoutPropertiesLoose$1(source, excluded) {
1482
+ function _objectWithoutPropertiesLoose$3(source, excluded) {
1471
1483
  if (source == null) return {};
1472
1484
  var target = {};
1473
1485
  var sourceKeys = Object.keys(source);
@@ -1491,7 +1503,7 @@
1491
1503
  query = _ref.query,
1492
1504
  refresh = _ref.refresh,
1493
1505
  store = _ref.store,
1494
- setters = _objectWithoutProperties$1(_ref, _excluded);
1506
+ setters = _objectWithoutProperties$3(_ref, _excluded$6);
1495
1507
 
1496
1508
  if (lastStalledId) {
1497
1509
  props.environment.clearTimeout(lastStalledId);
@@ -1509,7 +1521,7 @@
1509
1521
  var _nextState$isOpen;
1510
1522
 
1511
1523
  var collections = store.getState().collections.map(function (collection) {
1512
- return _objectSpread$7(_objectSpread$7({}, collection), {}, {
1524
+ return _objectSpread$8(_objectSpread$8({}, collection), {}, {
1513
1525
  items: []
1514
1526
  });
1515
1527
  });
@@ -1537,13 +1549,13 @@
1537
1549
  // meaning we should only ever manipulate the state once this concurrent-safe
1538
1550
  // promise is resolved.
1539
1551
 
1540
- return runConcurrentSafePromise(props.getSources(_objectSpread$7({
1552
+ return runConcurrentSafePromise(props.getSources(_objectSpread$8({
1541
1553
  query: query,
1542
1554
  refresh: refresh,
1543
1555
  state: store.getState()
1544
1556
  }, setters)).then(function (sources) {
1545
1557
  return Promise.all(sources.map(function (source) {
1546
- return Promise.resolve(source.getItems(_objectSpread$7({
1558
+ return Promise.resolve(source.getItems(_objectSpread$8({
1547
1559
  query: query,
1548
1560
  refresh: refresh,
1549
1561
  state: store.getState()
@@ -1560,9 +1572,22 @@
1560
1572
  });
1561
1573
  });
1562
1574
  })).then(function (collections) {
1563
- var _nextState$isOpen2;
1575
+ var _nextState$isOpen2; // Parameters passed to `onInput` could be stale when the following code
1576
+ // executes, because `onInput` calls may not resolve in order.
1577
+ // If it becomes a problem we'll need to save the last passed parameters.
1578
+ // See: https://codesandbox.io/s/agitated-cookies-y290z
1579
+
1564
1580
 
1565
1581
  setStatus('idle');
1582
+
1583
+ if (store.shouldSkipPendingUpdate) {
1584
+ if (!runConcurrentSafePromise.isRunning()) {
1585
+ store.shouldSkipPendingUpdate = false;
1586
+ }
1587
+
1588
+ return;
1589
+ }
1590
+
1566
1591
  setCollections(collections);
1567
1592
  var isPanelOpen = props.shouldPanelOpen({
1568
1593
  state: store.getState()
@@ -1575,7 +1600,7 @@
1575
1600
  itemInputValue = highlightedItem.itemInputValue,
1576
1601
  itemUrl = highlightedItem.itemUrl,
1577
1602
  source = highlightedItem.source;
1578
- source.onActive(_objectSpread$7({
1603
+ source.onActive(_objectSpread$8({
1579
1604
  event: event,
1580
1605
  item: item,
1581
1606
  itemInputValue: itemInputValue,
@@ -1591,10 +1616,11 @@
1591
1616
  }
1592
1617
  });
1593
1618
  }
1619
+ onInput.isRunning = runConcurrentSafePromise.isRunning;
1594
1620
 
1595
- var _excluded$1 = ["event", "props", "refresh", "store"];
1621
+ var _excluded$5 = ["event", "props", "refresh", "store"];
1596
1622
 
1597
- function ownKeys$9(object, enumerableOnly) {
1623
+ function ownKeys$7(object, enumerableOnly) {
1598
1624
  var keys = Object.keys(object);
1599
1625
 
1600
1626
  if (Object.getOwnPropertySymbols) {
@@ -1612,18 +1638,18 @@
1612
1638
  return keys;
1613
1639
  }
1614
1640
 
1615
- function _objectSpread$8(target) {
1641
+ function _objectSpread$7(target) {
1616
1642
  for (var i = 1; i < arguments.length; i++) {
1617
1643
  var source = arguments[i] != null ? arguments[i] : {};
1618
1644
 
1619
1645
  if (i % 2) {
1620
- ownKeys$9(Object(source), true).forEach(function (key) {
1621
- _defineProperty$9(target, key, source[key]);
1646
+ ownKeys$7(Object(source), true).forEach(function (key) {
1647
+ _defineProperty$7(target, key, source[key]);
1622
1648
  });
1623
1649
  } else if (Object.getOwnPropertyDescriptors) {
1624
1650
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1625
1651
  } else {
1626
- ownKeys$9(Object(source)).forEach(function (key) {
1652
+ ownKeys$7(Object(source)).forEach(function (key) {
1627
1653
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1628
1654
  });
1629
1655
  }
@@ -1632,7 +1658,7 @@
1632
1658
  return target;
1633
1659
  }
1634
1660
 
1635
- function _defineProperty$9(obj, key, value) {
1661
+ function _defineProperty$7(obj, key, value) {
1636
1662
  if (key in obj) {
1637
1663
  Object.defineProperty(obj, key, {
1638
1664
  value: value,
@@ -1687,7 +1713,7 @@
1687
1713
  props = _ref.props,
1688
1714
  refresh = _ref.refresh,
1689
1715
  store = _ref.store,
1690
- setters = _objectWithoutProperties$2(_ref, _excluded$1);
1716
+ setters = _objectWithoutProperties$2(_ref, _excluded$5);
1691
1717
 
1692
1718
  if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
1693
1719
  // eslint-disable-next-line no-inner-declarations
@@ -1712,7 +1738,7 @@
1712
1738
  itemInputValue = highlightedItem.itemInputValue,
1713
1739
  itemUrl = highlightedItem.itemUrl,
1714
1740
  source = highlightedItem.source;
1715
- source.onActive(_objectSpread$8({
1741
+ source.onActive(_objectSpread$7({
1716
1742
  event: event,
1717
1743
  item: item,
1718
1744
  itemInputValue: itemInputValue,
@@ -1730,7 +1756,7 @@
1730
1756
  // synchronized as `onInput` returns a promise.
1731
1757
 
1732
1758
  if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) {
1733
- onInput(_objectSpread$8({
1759
+ onInput(_objectSpread$7({
1734
1760
  event: event,
1735
1761
  props: props,
1736
1762
  query: store.getState().query,
@@ -1756,7 +1782,14 @@
1756
1782
  // from removing the query right away because we first want to close the
1757
1783
  // panel.
1758
1784
  event.preventDefault();
1759
- store.dispatch(event.key, null);
1785
+ store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the
1786
+ // autocomplete. At this point, we should ignore any requests that are still
1787
+ // running and could reopen the panel once they resolve, because that would
1788
+ // result in an unsolicited UI behavior.
1789
+
1790
+ if (onInput.isRunning()) {
1791
+ store.shouldSkipPendingUpdate = true;
1792
+ }
1760
1793
  } else if (event.key === 'Enter') {
1761
1794
  // No active item, so we let the browser handle the native `onSubmit` form
1762
1795
  // event.
@@ -1778,7 +1811,7 @@
1778
1811
 
1779
1812
  if (event.metaKey || event.ctrlKey) {
1780
1813
  if (itemUrl !== undefined) {
1781
- source.onSelect(_objectSpread$8({
1814
+ source.onSelect(_objectSpread$7({
1782
1815
  event: event,
1783
1816
  item: item,
1784
1817
  itemInputValue: itemInputValue,
@@ -1795,7 +1828,7 @@
1795
1828
  }
1796
1829
  } else if (event.shiftKey) {
1797
1830
  if (itemUrl !== undefined) {
1798
- source.onSelect(_objectSpread$8({
1831
+ source.onSelect(_objectSpread$7({
1799
1832
  event: event,
1800
1833
  item: item,
1801
1834
  itemInputValue: itemInputValue,
@@ -1812,7 +1845,7 @@
1812
1845
  }
1813
1846
  } else if (event.altKey) ; else {
1814
1847
  if (itemUrl !== undefined) {
1815
- source.onSelect(_objectSpread$8({
1848
+ source.onSelect(_objectSpread$7({
1816
1849
  event: event,
1817
1850
  item: item,
1818
1851
  itemInputValue: itemInputValue,
@@ -1829,7 +1862,7 @@
1829
1862
  return;
1830
1863
  }
1831
1864
 
1832
- onInput(_objectSpread$8({
1865
+ onInput(_objectSpread$7({
1833
1866
  event: event,
1834
1867
  nextState: {
1835
1868
  isOpen: false
@@ -1839,7 +1872,7 @@
1839
1872
  refresh: refresh,
1840
1873
  store: store
1841
1874
  }, setters)).then(function () {
1842
- source.onSelect(_objectSpread$8({
1875
+ source.onSelect(_objectSpread$7({
1843
1876
  event: event,
1844
1877
  item: item,
1845
1878
  itemInputValue: itemInputValue,
@@ -1853,13 +1886,13 @@
1853
1886
  }
1854
1887
  }
1855
1888
 
1856
- var _excluded$2 = ["props", "refresh", "store"],
1889
+ var _excluded$4 = ["props", "refresh", "store"],
1857
1890
  _excluded2 = ["inputElement", "formElement", "panelElement"],
1858
1891
  _excluded3 = ["inputElement"],
1859
1892
  _excluded4 = ["inputElement", "maxLength"],
1860
1893
  _excluded5 = ["item", "source"];
1861
1894
 
1862
- function ownKeys$a(object, enumerableOnly) {
1895
+ function ownKeys$6(object, enumerableOnly) {
1863
1896
  var keys = Object.keys(object);
1864
1897
 
1865
1898
  if (Object.getOwnPropertySymbols) {
@@ -1877,18 +1910,18 @@
1877
1910
  return keys;
1878
1911
  }
1879
1912
 
1880
- function _objectSpread$9(target) {
1913
+ function _objectSpread$6(target) {
1881
1914
  for (var i = 1; i < arguments.length; i++) {
1882
1915
  var source = arguments[i] != null ? arguments[i] : {};
1883
1916
 
1884
1917
  if (i % 2) {
1885
- ownKeys$a(Object(source), true).forEach(function (key) {
1886
- _defineProperty$a(target, key, source[key]);
1918
+ ownKeys$6(Object(source), true).forEach(function (key) {
1919
+ _defineProperty$6(target, key, source[key]);
1887
1920
  });
1888
1921
  } else if (Object.getOwnPropertyDescriptors) {
1889
1922
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1890
1923
  } else {
1891
- ownKeys$a(Object(source)).forEach(function (key) {
1924
+ ownKeys$6(Object(source)).forEach(function (key) {
1892
1925
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1893
1926
  });
1894
1927
  }
@@ -1897,7 +1930,7 @@
1897
1930
  return target;
1898
1931
  }
1899
1932
 
1900
- function _defineProperty$a(obj, key, value) {
1933
+ function _defineProperty$6(obj, key, value) {
1901
1934
  if (key in obj) {
1902
1935
  Object.defineProperty(obj, key, {
1903
1936
  value: value,
@@ -1912,10 +1945,10 @@
1912
1945
  return obj;
1913
1946
  }
1914
1947
 
1915
- function _objectWithoutProperties$3(source, excluded) {
1948
+ function _objectWithoutProperties$1(source, excluded) {
1916
1949
  if (source == null) return {};
1917
1950
 
1918
- var target = _objectWithoutPropertiesLoose$3(source, excluded);
1951
+ var target = _objectWithoutPropertiesLoose$1(source, excluded);
1919
1952
 
1920
1953
  var key, i;
1921
1954
 
@@ -1933,7 +1966,7 @@
1933
1966
  return target;
1934
1967
  }
1935
1968
 
1936
- function _objectWithoutPropertiesLoose$3(source, excluded) {
1969
+ function _objectWithoutPropertiesLoose$1(source, excluded) {
1937
1970
  if (source == null) return {};
1938
1971
  var target = {};
1939
1972
  var sourceKeys = Object.keys(source);
@@ -1951,15 +1984,15 @@
1951
1984
  var props = _ref.props,
1952
1985
  refresh = _ref.refresh,
1953
1986
  store = _ref.store,
1954
- setters = _objectWithoutProperties$3(_ref, _excluded$2);
1987
+ setters = _objectWithoutProperties$1(_ref, _excluded$4);
1955
1988
 
1956
1989
  var getEnvironmentProps = function getEnvironmentProps(providedProps) {
1957
1990
  var inputElement = providedProps.inputElement,
1958
1991
  formElement = providedProps.formElement,
1959
1992
  panelElement = providedProps.panelElement,
1960
- rest = _objectWithoutProperties$3(providedProps, _excluded2);
1993
+ rest = _objectWithoutProperties$1(providedProps, _excluded2);
1961
1994
 
1962
- return _objectSpread$9({
1995
+ return _objectSpread$6({
1963
1996
  // On touch devices, we do not rely on the native `blur` event of the
1964
1997
  // input to close the panel, but rather on a custom `touchstart` event
1965
1998
  // outside of the autocomplete elements.
@@ -1968,7 +2001,15 @@
1968
2001
  // @TODO: support cases where there are multiple Autocomplete instances.
1969
2002
  // Right now, a second instance makes this computation return false.
1970
2003
  onTouchStart: function onTouchStart(event) {
1971
- if (store.getState().isOpen === false || event.target === inputElement) {
2004
+ // The `onTouchStart` event shouldn't trigger the `blur` handler when
2005
+ // it's not an interaction with Autocomplete. We detect it with the
2006
+ // following heuristics:
2007
+ // - the panel is closed AND there are no running requests
2008
+ // (no interaction with the autocomplete, no future state updates)
2009
+ // - OR the touched target is the input element (should open the panel)
2010
+ var isNotAutocompleteInteraction = store.getState().isOpen === false && !onInput.isRunning();
2011
+
2012
+ if (isNotAutocompleteInteraction || event.target === inputElement) {
1972
2013
  return;
1973
2014
  }
1974
2015
 
@@ -1977,7 +2018,14 @@
1977
2018
  });
1978
2019
 
1979
2020
  if (isTargetWithinAutocomplete === false) {
1980
- store.dispatch('blur', null);
2021
+ store.dispatch('blur', null); // If requests are still running when the user closes the panel, they
2022
+ // could reopen the panel once they resolve.
2023
+ // We want to prevent any subsequent query from reopening the panel
2024
+ // because it would result in an unsolicited UI behavior.
2025
+
2026
+ if (!props.debug && onInput.isRunning()) {
2027
+ store.shouldSkipPendingUpdate = true;
2028
+ }
1981
2029
  }
1982
2030
  },
1983
2031
  // When scrolling on touch devices (mobiles, tablets, etc.), we want to
@@ -1995,7 +2043,7 @@
1995
2043
  };
1996
2044
 
1997
2045
  var getRootProps = function getRootProps(rest) {
1998
- return _objectSpread$9({
2046
+ return _objectSpread$6({
1999
2047
  role: 'combobox',
2000
2048
  'aria-expanded': store.getState().isOpen,
2001
2049
  'aria-haspopup': 'listbox',
@@ -2005,10 +2053,10 @@
2005
2053
  };
2006
2054
 
2007
2055
  var getFormProps = function getFormProps(providedProps) {
2008
- var inputElement = providedProps.inputElement,
2009
- rest = _objectWithoutProperties$3(providedProps, _excluded3);
2056
+ providedProps.inputElement;
2057
+ var rest = _objectWithoutProperties$1(providedProps, _excluded3);
2010
2058
 
2011
- return _objectSpread$9({
2059
+ return _objectSpread$6({
2012
2060
  action: '',
2013
2061
  noValidate: true,
2014
2062
  role: 'search',
@@ -2016,7 +2064,7 @@
2016
2064
  var _providedProps$inputE;
2017
2065
 
2018
2066
  event.preventDefault();
2019
- props.onSubmit(_objectSpread$9({
2067
+ props.onSubmit(_objectSpread$6({
2020
2068
  event: event,
2021
2069
  refresh: refresh,
2022
2070
  state: store.getState()
@@ -2028,7 +2076,7 @@
2028
2076
  var _providedProps$inputE2;
2029
2077
 
2030
2078
  event.preventDefault();
2031
- props.onReset(_objectSpread$9({
2079
+ props.onReset(_objectSpread$6({
2032
2080
  event: event,
2033
2081
  refresh: refresh,
2034
2082
  state: store.getState()
@@ -2044,7 +2092,7 @@
2044
2092
  // We want to trigger a query when `openOnFocus` is true
2045
2093
  // because the panel should open with the current query.
2046
2094
  if (props.openOnFocus || Boolean(store.getState().query)) {
2047
- onInput(_objectSpread$9({
2095
+ onInput(_objectSpread$6({
2048
2096
  event: event,
2049
2097
  props: props,
2050
2098
  query: store.getState().completion || store.getState().query,
@@ -2058,14 +2106,14 @@
2058
2106
 
2059
2107
  var isTouchDevice = ('ontouchstart' in props.environment);
2060
2108
 
2061
- var _ref2 = providedProps || {},
2062
- inputElement = _ref2.inputElement,
2063
- _ref2$maxLength = _ref2.maxLength,
2109
+ var _ref2 = providedProps || {};
2110
+ _ref2.inputElement;
2111
+ var _ref2$maxLength = _ref2.maxLength,
2064
2112
  maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength,
2065
- rest = _objectWithoutProperties$3(_ref2, _excluded4);
2113
+ rest = _objectWithoutProperties$1(_ref2, _excluded4);
2066
2114
 
2067
2115
  var activeItem = getActiveItem(store.getState());
2068
- return _objectSpread$9({
2116
+ return _objectSpread$6({
2069
2117
  'aria-autocomplete': 'both',
2070
2118
  'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? "".concat(props.id, "-item-").concat(store.getState().activeItemId) : undefined,
2071
2119
  'aria-controls': store.getState().isOpen ? "".concat(props.id, "-list") : undefined,
@@ -2082,7 +2130,7 @@
2082
2130
  maxLength: maxLength,
2083
2131
  type: 'search',
2084
2132
  onChange: function onChange(event) {
2085
- onInput(_objectSpread$9({
2133
+ onInput(_objectSpread$6({
2086
2134
  event: event,
2087
2135
  props: props,
2088
2136
  query: event.currentTarget.value.slice(0, maxLength),
@@ -2091,7 +2139,7 @@
2091
2139
  }, setters));
2092
2140
  },
2093
2141
  onKeyDown: function onKeyDown$1(event) {
2094
- onKeyDown(_objectSpread$9({
2142
+ onKeyDown(_objectSpread$6({
2095
2143
  event: event,
2096
2144
  props: props,
2097
2145
  refresh: refresh,
@@ -2103,7 +2151,14 @@
2103
2151
  // We do rely on the `blur` event on touch devices.
2104
2152
  // See explanation in `onTouchStart`.
2105
2153
  if (!isTouchDevice) {
2106
- store.dispatch('blur', null);
2154
+ store.dispatch('blur', null); // If requests are still running when the user closes the panel, they
2155
+ // could reopen the panel once they resolve.
2156
+ // We want to prevent any subsequent query from reopening the panel
2157
+ // because it would result in an unsolicited UI behavior.
2158
+
2159
+ if (!props.debug && onInput.isRunning()) {
2160
+ store.shouldSkipPendingUpdate = true;
2161
+ }
2107
2162
  }
2108
2163
  },
2109
2164
  onClick: function onClick(event) {
@@ -2122,14 +2177,14 @@
2122
2177
  };
2123
2178
 
2124
2179
  var getLabelProps = function getLabelProps(rest) {
2125
- return _objectSpread$9({
2180
+ return _objectSpread$6({
2126
2181
  htmlFor: "".concat(props.id, "-input"),
2127
2182
  id: "".concat(props.id, "-label")
2128
2183
  }, rest);
2129
2184
  };
2130
2185
 
2131
2186
  var getListProps = function getListProps(rest) {
2132
- return _objectSpread$9({
2187
+ return _objectSpread$6({
2133
2188
  role: 'listbox',
2134
2189
  'aria-labelledby': "".concat(props.id, "-label"),
2135
2190
  id: "".concat(props.id, "-list")
@@ -2137,7 +2192,7 @@
2137
2192
  };
2138
2193
 
2139
2194
  var getPanelProps = function getPanelProps(rest) {
2140
- return _objectSpread$9({
2195
+ return _objectSpread$6({
2141
2196
  onMouseDown: function onMouseDown(event) {
2142
2197
  // Prevents the `activeElement` from being changed to the panel so
2143
2198
  // that the blur event is not triggered, otherwise it closes the
@@ -2153,9 +2208,9 @@
2153
2208
  var getItemProps = function getItemProps(providedProps) {
2154
2209
  var item = providedProps.item,
2155
2210
  source = providedProps.source,
2156
- rest = _objectWithoutProperties$3(providedProps, _excluded5);
2211
+ rest = _objectWithoutProperties$1(providedProps, _excluded5);
2157
2212
 
2158
- return _objectSpread$9({
2213
+ return _objectSpread$6({
2159
2214
  id: "".concat(props.id, "-item-").concat(item.__autocomplete_id),
2160
2215
  role: 'option',
2161
2216
  'aria-selected': store.getState().activeItemId === item.__autocomplete_id,
@@ -2173,7 +2228,7 @@
2173
2228
  itemUrl = activeItem.itemUrl,
2174
2229
  _source = activeItem.source;
2175
2230
 
2176
- _source.onActive(_objectSpread$9({
2231
+ _source.onActive(_objectSpread$6({
2177
2232
  event: event,
2178
2233
  item: _item,
2179
2234
  itemInputValue: itemInputValue,
@@ -2203,7 +2258,7 @@
2203
2258
  // the `activeItemId`, resulting in a UI flash, especially
2204
2259
  // noticeable on mobile.
2205
2260
 
2206
- var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread$9({
2261
+ var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread$6({
2207
2262
  event: event,
2208
2263
  nextState: {
2209
2264
  isOpen: false
@@ -2214,7 +2269,7 @@
2214
2269
  store: store
2215
2270
  }, setters));
2216
2271
  runPreCommand.then(function () {
2217
- source.onSelect(_objectSpread$9({
2272
+ source.onSelect(_objectSpread$6({
2218
2273
  event: event,
2219
2274
  item: item,
2220
2275
  itemInputValue: itemInputValue,
@@ -2240,7 +2295,7 @@
2240
2295
  };
2241
2296
  }
2242
2297
 
2243
- function ownKeys$b(object, enumerableOnly) {
2298
+ function ownKeys$5(object, enumerableOnly) {
2244
2299
  var keys = Object.keys(object);
2245
2300
 
2246
2301
  if (Object.getOwnPropertySymbols) {
@@ -2258,18 +2313,18 @@
2258
2313
  return keys;
2259
2314
  }
2260
2315
 
2261
- function _objectSpread$a(target) {
2316
+ function _objectSpread$5(target) {
2262
2317
  for (var i = 1; i < arguments.length; i++) {
2263
2318
  var source = arguments[i] != null ? arguments[i] : {};
2264
2319
 
2265
2320
  if (i % 2) {
2266
- ownKeys$b(Object(source), true).forEach(function (key) {
2267
- _defineProperty$b(target, key, source[key]);
2321
+ ownKeys$5(Object(source), true).forEach(function (key) {
2322
+ _defineProperty$5(target, key, source[key]);
2268
2323
  });
2269
2324
  } else if (Object.getOwnPropertyDescriptors) {
2270
2325
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2271
2326
  } else {
2272
- ownKeys$b(Object(source)).forEach(function (key) {
2327
+ ownKeys$5(Object(source)).forEach(function (key) {
2273
2328
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2274
2329
  });
2275
2330
  }
@@ -2278,7 +2333,7 @@
2278
2333
  return target;
2279
2334
  }
2280
2335
 
2281
- function _defineProperty$b(obj, key, value) {
2336
+ function _defineProperty$5(obj, key, value) {
2282
2337
  if (key in obj) {
2283
2338
  Object.defineProperty(obj, key, {
2284
2339
  value: value,
@@ -2298,7 +2353,7 @@
2298
2353
  var plugins = _ref.plugins,
2299
2354
  options = _ref.options;
2300
2355
  var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment;
2301
- var extraOptions = optionsKey ? _defineProperty$b({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {};
2356
+ var extraOptions = optionsKey ? _defineProperty$5({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {};
2302
2357
  return {
2303
2358
  plugins: plugins.map(function (plugin) {
2304
2359
  return {
@@ -2306,10 +2361,10 @@
2306
2361
  options: Object.keys(plugin.__autocomplete_pluginOptions || [])
2307
2362
  };
2308
2363
  }),
2309
- options: _objectSpread$a({
2364
+ options: _objectSpread$5({
2310
2365
  'autocomplete-core': Object.keys(options)
2311
2366
  }, extraOptions),
2312
- ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || [])
2367
+ ua: userAgents$1.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || [])
2313
2368
  };
2314
2369
  }
2315
2370
  function injectMetadata(_ref3) {
@@ -2342,7 +2397,7 @@
2342
2397
  return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null;
2343
2398
  }
2344
2399
 
2345
- function ownKeys$c(object, enumerableOnly) {
2400
+ function ownKeys$4(object, enumerableOnly) {
2346
2401
  var keys = Object.keys(object);
2347
2402
 
2348
2403
  if (Object.getOwnPropertySymbols) {
@@ -2360,18 +2415,18 @@
2360
2415
  return keys;
2361
2416
  }
2362
2417
 
2363
- function _objectSpread$b(target) {
2418
+ function _objectSpread$4(target) {
2364
2419
  for (var i = 1; i < arguments.length; i++) {
2365
2420
  var source = arguments[i] != null ? arguments[i] : {};
2366
2421
 
2367
2422
  if (i % 2) {
2368
- ownKeys$c(Object(source), true).forEach(function (key) {
2369
- _defineProperty$c(target, key, source[key]);
2423
+ ownKeys$4(Object(source), true).forEach(function (key) {
2424
+ _defineProperty$4(target, key, source[key]);
2370
2425
  });
2371
2426
  } else if (Object.getOwnPropertyDescriptors) {
2372
2427
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2373
2428
  } else {
2374
- ownKeys$c(Object(source)).forEach(function (key) {
2429
+ ownKeys$4(Object(source)).forEach(function (key) {
2375
2430
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2376
2431
  });
2377
2432
  }
@@ -2380,7 +2435,7 @@
2380
2435
  return target;
2381
2436
  }
2382
2437
 
2383
- function _defineProperty$c(obj, key, value) {
2438
+ function _defineProperty$4(obj, key, value) {
2384
2439
  if (key in obj) {
2385
2440
  Object.defineProperty(obj, key, {
2386
2441
  value: value,
@@ -2398,14 +2453,14 @@
2398
2453
  switch (action.type) {
2399
2454
  case 'setActiveItemId':
2400
2455
  {
2401
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2456
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2402
2457
  activeItemId: action.payload
2403
2458
  });
2404
2459
  }
2405
2460
 
2406
2461
  case 'setQuery':
2407
2462
  {
2408
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2463
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2409
2464
  query: action.payload,
2410
2465
  completion: null
2411
2466
  });
@@ -2413,39 +2468,39 @@
2413
2468
 
2414
2469
  case 'setCollections':
2415
2470
  {
2416
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2471
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2417
2472
  collections: action.payload
2418
2473
  });
2419
2474
  }
2420
2475
 
2421
2476
  case 'setIsOpen':
2422
2477
  {
2423
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2478
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2424
2479
  isOpen: action.payload
2425
2480
  });
2426
2481
  }
2427
2482
 
2428
2483
  case 'setStatus':
2429
2484
  {
2430
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2485
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2431
2486
  status: action.payload
2432
2487
  });
2433
2488
  }
2434
2489
 
2435
2490
  case 'setContext':
2436
2491
  {
2437
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2438
- context: _objectSpread$b(_objectSpread$b({}, state.context), action.payload)
2492
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2493
+ context: _objectSpread$4(_objectSpread$4({}, state.context), action.payload)
2439
2494
  });
2440
2495
  }
2441
2496
 
2442
2497
  case 'ArrowDown':
2443
2498
  {
2444
- var nextState = _objectSpread$b(_objectSpread$b({}, state), {}, {
2499
+ var nextState = _objectSpread$4(_objectSpread$4({}, state), {}, {
2445
2500
  activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)
2446
2501
  });
2447
2502
 
2448
- return _objectSpread$b(_objectSpread$b({}, nextState), {}, {
2503
+ return _objectSpread$4(_objectSpread$4({}, nextState), {}, {
2449
2504
  completion: getCompletion({
2450
2505
  state: nextState
2451
2506
  })
@@ -2454,11 +2509,11 @@
2454
2509
 
2455
2510
  case 'ArrowUp':
2456
2511
  {
2457
- var _nextState = _objectSpread$b(_objectSpread$b({}, state), {}, {
2512
+ var _nextState = _objectSpread$4(_objectSpread$4({}, state), {}, {
2458
2513
  activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)
2459
2514
  });
2460
2515
 
2461
- return _objectSpread$b(_objectSpread$b({}, _nextState), {}, {
2516
+ return _objectSpread$4(_objectSpread$4({}, _nextState), {}, {
2462
2517
  completion: getCompletion({
2463
2518
  state: _nextState
2464
2519
  })
@@ -2468,14 +2523,14 @@
2468
2523
  case 'Escape':
2469
2524
  {
2470
2525
  if (state.isOpen) {
2471
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2526
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2472
2527
  activeItemId: null,
2473
2528
  isOpen: false,
2474
2529
  completion: null
2475
2530
  });
2476
2531
  }
2477
2532
 
2478
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2533
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2479
2534
  activeItemId: null,
2480
2535
  query: '',
2481
2536
  status: 'idle',
@@ -2485,7 +2540,7 @@
2485
2540
 
2486
2541
  case 'submit':
2487
2542
  {
2488
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2543
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2489
2544
  activeItemId: null,
2490
2545
  isOpen: false,
2491
2546
  status: 'idle'
@@ -2494,7 +2549,7 @@
2494
2549
 
2495
2550
  case 'reset':
2496
2551
  {
2497
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2552
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2498
2553
  activeItemId: // Since we open the panel on reset when openOnFocus=true
2499
2554
  // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)
2500
2555
  // Since we close the panel when openOnFocus=false
@@ -2507,7 +2562,7 @@
2507
2562
 
2508
2563
  case 'focus':
2509
2564
  {
2510
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2565
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2511
2566
  activeItemId: action.props.defaultActiveItemId,
2512
2567
  isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({
2513
2568
  state: state
@@ -2521,7 +2576,7 @@
2521
2576
  return state;
2522
2577
  }
2523
2578
 
2524
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2579
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2525
2580
  isOpen: false,
2526
2581
  activeItemId: null
2527
2582
  });
@@ -2529,14 +2584,14 @@
2529
2584
 
2530
2585
  case 'mousemove':
2531
2586
  {
2532
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2587
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2533
2588
  activeItemId: action.payload
2534
2589
  });
2535
2590
  }
2536
2591
 
2537
2592
  case 'mouseleave':
2538
2593
  {
2539
- return _objectSpread$b(_objectSpread$b({}, state), {}, {
2594
+ return _objectSpread$4(_objectSpread$4({}, state), {}, {
2540
2595
  activeItemId: action.props.defaultActiveItemId
2541
2596
  });
2542
2597
  }
@@ -2547,7 +2602,7 @@
2547
2602
  }
2548
2603
  };
2549
2604
 
2550
- function ownKeys$d(object, enumerableOnly) {
2605
+ function ownKeys$3(object, enumerableOnly) {
2551
2606
  var keys = Object.keys(object);
2552
2607
 
2553
2608
  if (Object.getOwnPropertySymbols) {
@@ -2565,18 +2620,18 @@
2565
2620
  return keys;
2566
2621
  }
2567
2622
 
2568
- function _objectSpread$c(target) {
2623
+ function _objectSpread$3(target) {
2569
2624
  for (var i = 1; i < arguments.length; i++) {
2570
2625
  var source = arguments[i] != null ? arguments[i] : {};
2571
2626
 
2572
2627
  if (i % 2) {
2573
- ownKeys$d(Object(source), true).forEach(function (key) {
2574
- _defineProperty$d(target, key, source[key]);
2628
+ ownKeys$3(Object(source), true).forEach(function (key) {
2629
+ _defineProperty$3(target, key, source[key]);
2575
2630
  });
2576
2631
  } else if (Object.getOwnPropertyDescriptors) {
2577
2632
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2578
2633
  } else {
2579
- ownKeys$d(Object(source)).forEach(function (key) {
2634
+ ownKeys$3(Object(source)).forEach(function (key) {
2580
2635
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2581
2636
  });
2582
2637
  }
@@ -2585,7 +2640,7 @@
2585
2640
  return target;
2586
2641
  }
2587
2642
 
2588
- function _defineProperty$d(obj, key, value) {
2643
+ function _defineProperty$3(obj, key, value) {
2589
2644
  if (key in obj) {
2590
2645
  Object.defineProperty(obj, key, {
2591
2646
  value: value,
@@ -2607,7 +2662,7 @@
2607
2662
  var setters = getAutocompleteSetters({
2608
2663
  store: store
2609
2664
  });
2610
- var propGetters = getPropGetters(_objectSpread$c({
2665
+ var propGetters = getPropGetters(_objectSpread$3({
2611
2666
  props: props,
2612
2667
  refresh: refresh,
2613
2668
  store: store
@@ -2616,7 +2671,7 @@
2616
2671
  function onStoreStateChange(_ref) {
2617
2672
  var prevState = _ref.prevState,
2618
2673
  state = _ref.state;
2619
- props.onStateChange(_objectSpread$c({
2674
+ props.onStateChange(_objectSpread$3({
2620
2675
  prevState: prevState,
2621
2676
  state: state,
2622
2677
  refresh: refresh
@@ -2624,7 +2679,7 @@
2624
2679
  }
2625
2680
 
2626
2681
  function refresh() {
2627
- return onInput(_objectSpread$c({
2682
+ return onInput(_objectSpread$3({
2628
2683
  event: new Event('input'),
2629
2684
  nextState: {
2630
2685
  isOpen: store.getState().isOpen
@@ -2639,7 +2694,7 @@
2639
2694
  props.plugins.forEach(function (plugin) {
2640
2695
  var _plugin$subscribe;
2641
2696
 
2642
- return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread$c(_objectSpread$c({}, setters), {}, {
2697
+ return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread$3(_objectSpread$3({}, setters), {}, {
2643
2698
  refresh: refresh,
2644
2699
  onSelect: function onSelect(fn) {
2645
2700
  subscribers.push({
@@ -2660,7 +2715,7 @@
2660
2715
  }),
2661
2716
  environment: props.environment
2662
2717
  });
2663
- return _objectSpread$c(_objectSpread$c({
2718
+ return _objectSpread$3(_objectSpread$3({
2664
2719
  refresh: refresh
2665
2720
  }, propGetters), setters);
2666
2721
  }
@@ -2708,7 +2763,7 @@
2708
2763
  }
2709
2764
 
2710
2765
  var isPlainObject = function isPlainObject(value) {
2711
- return value && _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Object]';
2766
+ return value && _typeof$3(value) === 'object' && Object.prototype.toString.call(value) === '[object Object]';
2712
2767
  };
2713
2768
 
2714
2769
  function mergeDeep() {
@@ -2722,7 +2777,7 @@
2722
2777
  var currentValue = current[key];
2723
2778
 
2724
2779
  if (Array.isArray(accValue) && Array.isArray(currentValue)) {
2725
- acc[key] = accValue.concat.apply(accValue, _toConsumableArray(currentValue));
2780
+ acc[key] = accValue.concat.apply(accValue, _toConsumableArray$5(currentValue));
2726
2781
  } else if (isPlainObject(accValue) && isPlainObject(currentValue)) {
2727
2782
  acc[key] = mergeDeep(accValue, currentValue);
2728
2783
  } else {
@@ -2842,25 +2897,25 @@
2842
2897
  return function createDomElement(tagName, _ref) {
2843
2898
  var _ref$children = _ref.children,
2844
2899
  children = _ref$children === void 0 ? [] : _ref$children,
2845
- props = _objectWithoutProperties(_ref, _excluded$3);
2900
+ props = _objectWithoutProperties$4(_ref, _excluded$3);
2846
2901
 
2847
2902
  var element = environment.document.createElement(tagName);
2848
2903
  setProperties(element, props);
2849
- element.append.apply(element, _toConsumableArray(children));
2904
+ element.append.apply(element, _toConsumableArray$5(children));
2850
2905
  return element;
2851
2906
  };
2852
2907
  }
2853
2908
 
2854
- var _excluded$4 = ["autocompleteScopeApi", "environment", "classNames", "getInputProps", "getInputPropsCore", "onDetachedEscape", "state"];
2909
+ var _excluded$2 = ["autocompleteScopeApi", "environment", "classNames", "getInputProps", "getInputPropsCore", "onDetachedEscape", "state"];
2855
2910
  var Input = function Input(_ref) {
2856
2911
  var autocompleteScopeApi = _ref.autocompleteScopeApi,
2857
- environment = _ref.environment,
2858
- classNames = _ref.classNames,
2859
- getInputProps = _ref.getInputProps,
2912
+ environment = _ref.environment;
2913
+ _ref.classNames;
2914
+ var getInputProps = _ref.getInputProps,
2860
2915
  getInputPropsCore = _ref.getInputPropsCore,
2861
2916
  onDetachedEscape = _ref.onDetachedEscape,
2862
2917
  state = _ref.state,
2863
- props = _objectWithoutProperties(_ref, _excluded$4);
2918
+ props = _objectWithoutProperties$4(_ref, _excluded$2);
2864
2919
 
2865
2920
  var createDomElement = getCreateDomElement(environment);
2866
2921
  var element = createDomElement('input', props);
@@ -3134,7 +3189,7 @@
3134
3189
  };
3135
3190
  }
3136
3191
 
3137
- var n,l,u,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n);}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)));});}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h]);}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else {for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r;}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&(s===l||(d?s.localName==d:3==s.nodeType))){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u);}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n}},u=0,_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
3192
+ var n,l,u,t,r,o,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n);}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)));});}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h]);}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else {for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r;}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==y.value||_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u);}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n}},u=0,_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0;
3138
3193
 
3139
3194
  var HIGHLIGHT_PRE_TAG = '__aa-highlight__';
3140
3195
  var HIGHLIGHT_POST_TAG = '__/aa-highlight__';
@@ -3191,32 +3246,32 @@
3191
3246
  return parts.get();
3192
3247
  }
3193
3248
 
3194
- function _toConsumableArray$3(arr) {
3195
- return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread$3();
3249
+ function _toConsumableArray$2(arr) {
3250
+ return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$2();
3196
3251
  }
3197
3252
 
3198
- function _nonIterableSpread$3() {
3253
+ function _nonIterableSpread$2() {
3199
3254
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3200
3255
  }
3201
3256
 
3202
- function _unsupportedIterableToArray$4(o, minLen) {
3257
+ function _unsupportedIterableToArray$2(o, minLen) {
3203
3258
  if (!o) return;
3204
- if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
3259
+ if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
3205
3260
  var n = Object.prototype.toString.call(o).slice(8, -1);
3206
3261
  if (n === "Object" && o.constructor) n = o.constructor.name;
3207
3262
  if (n === "Map" || n === "Set") return Array.from(o);
3208
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
3263
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
3209
3264
  }
3210
3265
 
3211
- function _iterableToArray$3(iter) {
3266
+ function _iterableToArray$2(iter) {
3212
3267
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3213
3268
  }
3214
3269
 
3215
- function _arrayWithoutHoles$3(arr) {
3216
- if (Array.isArray(arr)) return _arrayLikeToArray$4(arr);
3270
+ function _arrayWithoutHoles$2(arr) {
3271
+ if (Array.isArray(arr)) return _arrayLikeToArray$2(arr);
3217
3272
  }
3218
3273
 
3219
- function _arrayLikeToArray$4(arr, len) {
3274
+ function _arrayLikeToArray$2(arr, len) {
3220
3275
  if (len == null || len > arr.length) len = arr.length;
3221
3276
 
3222
3277
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -3229,10 +3284,10 @@
3229
3284
  var hit = _ref.hit,
3230
3285
  attribute = _ref.attribute;
3231
3286
  var path = Array.isArray(attribute) ? attribute : [attribute];
3232
- var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray$3(path), ['value']));
3287
+ var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray$2(path), ['value']));
3233
3288
 
3234
3289
  if (typeof highlightedValue !== 'string') {
3235
- "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0 ;
3290
+ "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0 ;
3236
3291
  highlightedValue = getAttributeValueByPath(hit, path) || '';
3237
3292
  }
3238
3293
 
@@ -3272,7 +3327,7 @@
3272
3327
  return current.isHighlighted;
3273
3328
  }
3274
3329
 
3275
- function ownKeys$e(object, enumerableOnly) {
3330
+ function ownKeys$2(object, enumerableOnly) {
3276
3331
  var keys = Object.keys(object);
3277
3332
 
3278
3333
  if (Object.getOwnPropertySymbols) {
@@ -3290,18 +3345,18 @@
3290
3345
  return keys;
3291
3346
  }
3292
3347
 
3293
- function _objectSpread$d(target) {
3348
+ function _objectSpread$2(target) {
3294
3349
  for (var i = 1; i < arguments.length; i++) {
3295
3350
  var source = arguments[i] != null ? arguments[i] : {};
3296
3351
 
3297
3352
  if (i % 2) {
3298
- ownKeys$e(Object(source), true).forEach(function (key) {
3299
- _defineProperty$e(target, key, source[key]);
3353
+ ownKeys$2(Object(source), true).forEach(function (key) {
3354
+ _defineProperty$2(target, key, source[key]);
3300
3355
  });
3301
3356
  } else if (Object.getOwnPropertyDescriptors) {
3302
3357
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3303
3358
  } else {
3304
- ownKeys$e(Object(source)).forEach(function (key) {
3359
+ ownKeys$2(Object(source)).forEach(function (key) {
3305
3360
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3306
3361
  });
3307
3362
  }
@@ -3310,7 +3365,7 @@
3310
3365
  return target;
3311
3366
  }
3312
3367
 
3313
- function _defineProperty$e(obj, key, value) {
3368
+ function _defineProperty$2(obj, key, value) {
3314
3369
  if (key in obj) {
3315
3370
  Object.defineProperty(obj, key, {
3316
3371
  value: value,
@@ -3330,14 +3385,14 @@
3330
3385
  return part.isHighlighted;
3331
3386
  })) {
3332
3387
  return parts.map(function (part) {
3333
- return _objectSpread$d(_objectSpread$d({}, part), {}, {
3388
+ return _objectSpread$2(_objectSpread$2({}, part), {}, {
3334
3389
  isHighlighted: false
3335
3390
  });
3336
3391
  });
3337
3392
  }
3338
3393
 
3339
3394
  return parts.map(function (part, i) {
3340
- return _objectSpread$d(_objectSpread$d({}, part), {}, {
3395
+ return _objectSpread$2(_objectSpread$2({}, part), {}, {
3341
3396
  isHighlighted: !isPartHighlighted(parts, i)
3342
3397
  });
3343
3398
  });
@@ -3347,32 +3402,32 @@
3347
3402
  return reverseHighlightedParts(parseAlgoliaHitHighlight(props));
3348
3403
  }
3349
3404
 
3350
- function _toConsumableArray$4(arr) {
3351
- return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$5(arr) || _nonIterableSpread$4();
3405
+ function _toConsumableArray$1(arr) {
3406
+ return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
3352
3407
  }
3353
3408
 
3354
- function _nonIterableSpread$4() {
3409
+ function _nonIterableSpread$1() {
3355
3410
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3356
3411
  }
3357
3412
 
3358
- function _unsupportedIterableToArray$5(o, minLen) {
3413
+ function _unsupportedIterableToArray$1(o, minLen) {
3359
3414
  if (!o) return;
3360
- if (typeof o === "string") return _arrayLikeToArray$5(o, minLen);
3415
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
3361
3416
  var n = Object.prototype.toString.call(o).slice(8, -1);
3362
3417
  if (n === "Object" && o.constructor) n = o.constructor.name;
3363
3418
  if (n === "Map" || n === "Set") return Array.from(o);
3364
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen);
3419
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
3365
3420
  }
3366
3421
 
3367
- function _iterableToArray$4(iter) {
3422
+ function _iterableToArray$1(iter) {
3368
3423
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3369
3424
  }
3370
3425
 
3371
- function _arrayWithoutHoles$4(arr) {
3372
- if (Array.isArray(arr)) return _arrayLikeToArray$5(arr);
3426
+ function _arrayWithoutHoles$1(arr) {
3427
+ if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
3373
3428
  }
3374
3429
 
3375
- function _arrayLikeToArray$5(arr, len) {
3430
+ function _arrayLikeToArray$1(arr, len) {
3376
3431
  if (len == null || len > arr.length) len = arr.length;
3377
3432
 
3378
3433
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -3385,10 +3440,10 @@
3385
3440
  var hit = _ref.hit,
3386
3441
  attribute = _ref.attribute;
3387
3442
  var path = Array.isArray(attribute) ? attribute : [attribute];
3388
- var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray$4(path), ['value']));
3443
+ var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray$1(path), ['value']));
3389
3444
 
3390
3445
  if (typeof highlightedValue !== 'string') {
3391
- "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0 ;
3446
+ "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0 ;
3392
3447
  highlightedValue = getAttributeValueByPath(hit, path) || '';
3393
3448
  }
3394
3449
 
@@ -3401,7 +3456,7 @@
3401
3456
  return reverseHighlightedParts(parseAlgoliaHitSnippet(props));
3402
3457
  }
3403
3458
 
3404
- function ownKeys$f(object, enumerableOnly) {
3459
+ function ownKeys$1(object, enumerableOnly) {
3405
3460
  var keys = Object.keys(object);
3406
3461
 
3407
3462
  if (Object.getOwnPropertySymbols) {
@@ -3419,18 +3474,18 @@
3419
3474
  return keys;
3420
3475
  }
3421
3476
 
3422
- function _objectSpread$e(target) {
3477
+ function _objectSpread$1(target) {
3423
3478
  for (var i = 1; i < arguments.length; i++) {
3424
3479
  var source = arguments[i] != null ? arguments[i] : {};
3425
3480
 
3426
3481
  if (i % 2) {
3427
- ownKeys$f(Object(source), true).forEach(function (key) {
3428
- _defineProperty$f(target, key, source[key]);
3482
+ ownKeys$1(Object(source), true).forEach(function (key) {
3483
+ _defineProperty$1(target, key, source[key]);
3429
3484
  });
3430
3485
  } else if (Object.getOwnPropertyDescriptors) {
3431
3486
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3432
3487
  } else {
3433
- ownKeys$f(Object(source)).forEach(function (key) {
3488
+ ownKeys$1(Object(source)).forEach(function (key) {
3434
3489
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3435
3490
  });
3436
3491
  }
@@ -3439,7 +3494,7 @@
3439
3494
  return target;
3440
3495
  }
3441
3496
 
3442
- function _defineProperty$f(obj, key, value) {
3497
+ function _defineProperty$1(obj, key, value) {
3443
3498
  if (key in obj) {
3444
3499
  Object.defineProperty(obj, key, {
3445
3500
  value: value,
@@ -3477,16 +3532,16 @@
3477
3532
 
3478
3533
  return function createSpecifiedRequester(requesterParams) {
3479
3534
  return function requester(requestParams) {
3480
- return _objectSpread$e(_objectSpread$e({
3535
+ return _objectSpread$1(_objectSpread$1({
3481
3536
  execute: execute
3482
3537
  }, requesterParams), requestParams);
3483
3538
  };
3484
3539
  };
3485
3540
  }
3486
3541
 
3487
- var _excluded$5 = ["params"];
3542
+ var _excluded$1 = ["params"];
3488
3543
 
3489
- function ownKeys$g(object, enumerableOnly) {
3544
+ function ownKeys(object, enumerableOnly) {
3490
3545
  var keys = Object.keys(object);
3491
3546
 
3492
3547
  if (Object.getOwnPropertySymbols) {
@@ -3504,18 +3559,18 @@
3504
3559
  return keys;
3505
3560
  }
3506
3561
 
3507
- function _objectSpread$f(target) {
3562
+ function _objectSpread(target) {
3508
3563
  for (var i = 1; i < arguments.length; i++) {
3509
3564
  var source = arguments[i] != null ? arguments[i] : {};
3510
3565
 
3511
3566
  if (i % 2) {
3512
- ownKeys$g(Object(source), true).forEach(function (key) {
3513
- _defineProperty$g(target, key, source[key]);
3567
+ ownKeys(Object(source), true).forEach(function (key) {
3568
+ _defineProperty(target, key, source[key]);
3514
3569
  });
3515
3570
  } else if (Object.getOwnPropertyDescriptors) {
3516
3571
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3517
3572
  } else {
3518
- ownKeys$g(Object(source)).forEach(function (key) {
3573
+ ownKeys(Object(source)).forEach(function (key) {
3519
3574
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3520
3575
  });
3521
3576
  }
@@ -3524,7 +3579,7 @@
3524
3579
  return target;
3525
3580
  }
3526
3581
 
3527
- function _defineProperty$g(obj, key, value) {
3582
+ function _defineProperty(obj, key, value) {
3528
3583
  if (key in obj) {
3529
3584
  Object.defineProperty(obj, key, {
3530
3585
  value: value,
@@ -3539,10 +3594,10 @@
3539
3594
  return obj;
3540
3595
  }
3541
3596
 
3542
- function _objectWithoutProperties$4(source, excluded) {
3597
+ function _objectWithoutProperties(source, excluded) {
3543
3598
  if (source == null) return {};
3544
3599
 
3545
- var target = _objectWithoutPropertiesLoose$4(source, excluded);
3600
+ var target = _objectWithoutPropertiesLoose(source, excluded);
3546
3601
 
3547
3602
  var key, i;
3548
3603
 
@@ -3560,7 +3615,7 @@
3560
3615
  return target;
3561
3616
  }
3562
3617
 
3563
- function _objectWithoutPropertiesLoose$4(source, excluded) {
3618
+ function _objectWithoutPropertiesLoose(source, excluded) {
3564
3619
  if (source == null) return {};
3565
3620
  var target = {};
3566
3621
  var sourceKeys = Object.keys(source);
@@ -3575,32 +3630,32 @@
3575
3630
  return target;
3576
3631
  }
3577
3632
 
3578
- function _toConsumableArray$5(arr) {
3579
- return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$6(arr) || _nonIterableSpread$5();
3633
+ function _toConsumableArray(arr) {
3634
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
3580
3635
  }
3581
3636
 
3582
- function _nonIterableSpread$5() {
3637
+ function _nonIterableSpread() {
3583
3638
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3584
3639
  }
3585
3640
 
3586
- function _unsupportedIterableToArray$6(o, minLen) {
3641
+ function _unsupportedIterableToArray(o, minLen) {
3587
3642
  if (!o) return;
3588
- if (typeof o === "string") return _arrayLikeToArray$6(o, minLen);
3643
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
3589
3644
  var n = Object.prototype.toString.call(o).slice(8, -1);
3590
3645
  if (n === "Object" && o.constructor) n = o.constructor.name;
3591
3646
  if (n === "Map" || n === "Set") return Array.from(o);
3592
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen);
3647
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
3593
3648
  }
3594
3649
 
3595
- function _iterableToArray$5(iter) {
3650
+ function _iterableToArray(iter) {
3596
3651
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3597
3652
  }
3598
3653
 
3599
- function _arrayWithoutHoles$5(arr) {
3600
- if (Array.isArray(arr)) return _arrayLikeToArray$6(arr);
3654
+ function _arrayWithoutHoles(arr) {
3655
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
3601
3656
  }
3602
3657
 
3603
- function _arrayLikeToArray$6(arr, len) {
3658
+ function _arrayLikeToArray(arr, len) {
3604
3659
  if (len == null || len > arr.length) len = arr.length;
3605
3660
 
3606
3661
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -3613,10 +3668,10 @@
3613
3668
  var searchClient = _ref.searchClient,
3614
3669
  queries = _ref.queries,
3615
3670
  _ref$userAgents = _ref.userAgents,
3616
- userAgents$1 = _ref$userAgents === void 0 ? [] : _ref$userAgents;
3671
+ userAgents = _ref$userAgents === void 0 ? [] : _ref$userAgents;
3617
3672
 
3618
3673
  if (typeof searchClient.addAlgoliaAgent === 'function') {
3619
- var algoliaAgents = [].concat(_toConsumableArray$5(userAgents), _toConsumableArray$5(userAgents$1));
3674
+ var algoliaAgents = [].concat(_toConsumableArray(userAgents$1), _toConsumableArray(userAgents));
3620
3675
  algoliaAgents.forEach(function (_ref2) {
3621
3676
  var segment = _ref2.segment,
3622
3677
  version = _ref2.version;
@@ -3626,10 +3681,10 @@
3626
3681
 
3627
3682
  return searchClient.search(queries.map(function (searchParameters) {
3628
3683
  var params = searchParameters.params,
3629
- headers = _objectWithoutProperties$4(searchParameters, _excluded$5);
3684
+ headers = _objectWithoutProperties(searchParameters, _excluded$1);
3630
3685
 
3631
- return _objectSpread$f(_objectSpread$f({}, headers), {}, {
3632
- params: _objectSpread$f({
3686
+ return _objectSpread(_objectSpread({}, headers), {}, {
3687
+ params: _objectSpread({
3633
3688
  hitsPerPage: 5,
3634
3689
  highlightPreTag: HIGHLIGHT_PRE_TAG,
3635
3690
  highlightPostTag: HIGHLIGHT_POST_TAG
@@ -3716,7 +3771,7 @@
3716
3771
  };
3717
3772
  }
3718
3773
 
3719
- var _excluded$6 = ["classNames", "container", "getEnvironmentProps", "getFormProps", "getInputProps", "getItemProps", "getLabelProps", "getListProps", "getPanelProps", "getRootProps", "panelContainer", "panelPlacement", "render", "renderNoResults", "renderer", "detachedMediaQuery", "components", "translations"];
3774
+ var _excluded = ["classNames", "container", "getEnvironmentProps", "getFormProps", "getInputProps", "getItemProps", "getLabelProps", "getListProps", "getPanelProps", "getRootProps", "panelContainer", "panelPlacement", "render", "renderNoResults", "renderer", "detachedMediaQuery", "components", "translations"];
3720
3775
  var defaultClassNames = {
3721
3776
  clearButton: 'aa-ClearButton',
3722
3777
  detachedCancelButton: 'aa-DetachedCancelButton',
@@ -3775,7 +3830,7 @@
3775
3830
  detachedMediaQuery = options.detachedMediaQuery,
3776
3831
  components = options.components,
3777
3832
  translations = options.translations,
3778
- core = _objectWithoutProperties(options, _excluded$6);
3833
+ core = _objectWithoutProperties$4(options, _excluded);
3779
3834
  /* eslint-disable no-restricted-globals */
3780
3835
 
3781
3836
 
@@ -4042,7 +4097,7 @@
4042
4097
  }, autocompleteScopeApi), dom.panel);
4043
4098
  }
4044
4099
 
4045
- var userAgents$1 = [{
4100
+ var userAgents = [{
4046
4101
  segment: 'autocomplete-js',
4047
4102
  version: version
4048
4103
  }];
@@ -4094,7 +4149,7 @@
4094
4149
  return !hasItems && hasNoResultsTemplate || hasItems;
4095
4150
  },
4096
4151
  __autocomplete_metadata: {
4097
- userAgents: userAgents$1,
4152
+ userAgents: userAgents,
4098
4153
  options: options
4099
4154
  }
4100
4155
  }));
@@ -4182,7 +4237,7 @@
4182
4237
  setProperties(props.value.core.environment, environmentProps);
4183
4238
  return function () {
4184
4239
  setProperties(props.value.core.environment, Object.keys(environmentProps).reduce(function (acc, key) {
4185
- return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, undefined));
4240
+ return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty$g({}, key, undefined));
4186
4241
  }, {}));
4187
4242
  };
4188
4243
  });
@@ -4341,7 +4396,7 @@
4341
4396
 
4342
4397
  var createAlgoliaRequester = createRequester(function (params) {
4343
4398
  return fetchAlgoliaResults(_objectSpread2(_objectSpread2({}, params), {}, {
4344
- userAgents: userAgents$1
4399
+ userAgents: userAgents
4345
4400
  }));
4346
4401
  });
4347
4402
 
@@ -4381,5 +4436,5 @@
4381
4436
 
4382
4437
  Object.defineProperty(exports, '__esModule', { value: true });
4383
4438
 
4384
- })));
4439
+ }));
4385
4440
  //# sourceMappingURL=index.development.js.map