@ninetailed/experience.js-react 4.3.0-beta.6 → 4.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,10 +1,9 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import React, { createContext, useContext, useState, useRef, useEffect, useMemo, forwardRef, createElement as createElement$1, useCallback } from 'react';
3
- import { makeExperienceSelectMiddleware, selectHasExperienceVariants, selectActiveExperiments, selectExperience, selectExperienceVariant, Ninetailed, selectVariant } from '@ninetailed/experience.js';
4
- import { isForwardRef } from 'react-is';
5
- import { logger, isBrowser } from '@ninetailed/experience.js-shared';
6
- import { isEqual, debounce as debounce$1, get as get$1 } from 'radash';
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import React, { createContext, useContext, useEffect, useState, useRef, useMemo, createElement as createElement$1, useCallback } from 'react';
3
+ import { selectDistribution, makeExperienceSelectMiddleware, selectHasExperienceVariants, selectActiveExperiments, selectExperience, selectExperienceVariant, Ninetailed, selectVariant } from '@ninetailed/experience.js';
7
4
  import { useInView } from 'react-intersection-observer';
5
+ import { isBrowser, logger, isExperienceSticky, selectActiveExperimentIds } from '@ninetailed/experience.js-shared';
6
+ import { isEqual, debounce as debounce$1, get as get$1 } from 'radash';
8
7
 
9
8
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
9
 
@@ -13,7 +12,7 @@ var check = function (it) {
13
12
  };
14
13
 
15
14
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
16
- var global$c =
15
+ var global$d =
17
16
  // eslint-disable-next-line es/no-global-this -- safe
18
17
  check(typeof globalThis == 'object' && globalThis) ||
19
18
  check(typeof window == 'object' && window) ||
@@ -95,30 +94,30 @@ var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
95
94
  };
96
95
  };
97
96
 
98
- var uncurryThis$9 = functionUncurryThis;
97
+ var uncurryThis$a = functionUncurryThis;
99
98
 
100
- var toString$1 = uncurryThis$9({}.toString);
101
- var stringSlice = uncurryThis$9(''.slice);
99
+ var toString$3 = uncurryThis$a({}.toString);
100
+ var stringSlice$1 = uncurryThis$a(''.slice);
102
101
 
103
- var classofRaw = function (it) {
104
- return stringSlice(toString$1(it), 8, -1);
102
+ var classofRaw$1 = function (it) {
103
+ return stringSlice$1(toString$3(it), 8, -1);
105
104
  };
106
105
 
107
- var uncurryThis$8 = functionUncurryThis;
106
+ var uncurryThis$9 = functionUncurryThis;
108
107
  var fails$9 = fails$c;
109
- var classof$1 = classofRaw;
108
+ var classof$3 = classofRaw$1;
110
109
 
111
- var $Object$3 = Object;
112
- var split = uncurryThis$8(''.split);
110
+ var $Object$4 = Object;
111
+ var split = uncurryThis$9(''.split);
113
112
 
114
113
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
115
114
  var indexedObject = fails$9(function () {
116
115
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
117
116
  // eslint-disable-next-line no-prototype-builtins -- safe
118
- return !$Object$3('z').propertyIsEnumerable(0);
117
+ return !$Object$4('z').propertyIsEnumerable(0);
119
118
  }) ? function (it) {
120
- return classof$1(it) == 'String' ? split(it, '') : $Object$3(it);
121
- } : $Object$3;
119
+ return classof$3(it) == 'String' ? split(it, '') : $Object$4(it);
120
+ } : $Object$4;
122
121
 
123
122
  // we can't use just `it == null` since of `document.all` special case
124
123
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
@@ -161,47 +160,47 @@ var documentAll$1 = $documentAll$1.all;
161
160
 
162
161
  // `IsCallable` abstract operation
163
162
  // https://tc39.es/ecma262/#sec-iscallable
164
- var isCallable$e = $documentAll$1.IS_HTMLDDA ? function (argument) {
163
+ var isCallable$g = $documentAll$1.IS_HTMLDDA ? function (argument) {
165
164
  return typeof argument == 'function' || argument === documentAll$1;
166
165
  } : function (argument) {
167
166
  return typeof argument == 'function';
168
167
  };
169
168
 
170
- var isCallable$d = isCallable$e;
169
+ var isCallable$f = isCallable$g;
171
170
  var $documentAll = documentAll_1;
172
171
 
173
172
  var documentAll = $documentAll.all;
174
173
 
175
174
  var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
176
- return typeof it == 'object' ? it !== null : isCallable$d(it) || it === documentAll;
175
+ return typeof it == 'object' ? it !== null : isCallable$f(it) || it === documentAll;
177
176
  } : function (it) {
178
- return typeof it == 'object' ? it !== null : isCallable$d(it);
177
+ return typeof it == 'object' ? it !== null : isCallable$f(it);
179
178
  };
180
179
 
181
- var global$b = global$c;
182
- var isCallable$c = isCallable$e;
180
+ var global$c = global$d;
181
+ var isCallable$e = isCallable$g;
183
182
 
184
183
  var aFunction = function (argument) {
185
- return isCallable$c(argument) ? argument : undefined;
184
+ return isCallable$e(argument) ? argument : undefined;
186
185
  };
187
186
 
188
187
  var getBuiltIn$4 = function (namespace, method) {
189
- return arguments.length < 2 ? aFunction(global$b[namespace]) : global$b[namespace] && global$b[namespace][method];
188
+ return arguments.length < 2 ? aFunction(global$c[namespace]) : global$c[namespace] && global$c[namespace][method];
190
189
  };
191
190
 
192
- var uncurryThis$7 = functionUncurryThis;
191
+ var uncurryThis$8 = functionUncurryThis;
193
192
 
194
- var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
193
+ var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
195
194
 
196
195
  var getBuiltIn$3 = getBuiltIn$4;
197
196
 
198
197
  var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
199
198
 
200
- var global$a = global$c;
199
+ var global$b = global$d;
201
200
  var userAgent = engineUserAgent;
202
201
 
203
- var process = global$a.process;
204
- var Deno = global$a.Deno;
202
+ var process = global$b.process;
203
+ var Deno = global$b.Deno;
205
204
  var versions = process && process.versions || Deno && Deno.version;
206
205
  var v8 = versions && versions.v8;
207
206
  var match, version;
@@ -242,44 +241,44 @@ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(func
242
241
 
243
242
  /* eslint-disable es/no-symbol -- required for testing */
244
243
 
245
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
244
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
246
245
 
247
- var useSymbolAsUid = NATIVE_SYMBOL$1
246
+ var useSymbolAsUid = NATIVE_SYMBOL$2
248
247
  && !Symbol.sham
249
248
  && typeof Symbol.iterator == 'symbol';
250
249
 
251
250
  var getBuiltIn$2 = getBuiltIn$4;
252
- var isCallable$b = isCallable$e;
253
- var isPrototypeOf = objectIsPrototypeOf;
251
+ var isCallable$d = isCallable$g;
252
+ var isPrototypeOf$1 = objectIsPrototypeOf;
254
253
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
255
254
 
256
- var $Object$2 = Object;
255
+ var $Object$3 = Object;
257
256
 
258
257
  var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
259
258
  return typeof it == 'symbol';
260
259
  } : function (it) {
261
260
  var $Symbol = getBuiltIn$2('Symbol');
262
- return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
261
+ return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
263
262
  };
264
263
 
265
- var $String$2 = String;
264
+ var $String$3 = String;
266
265
 
267
266
  var tryToString$1 = function (argument) {
268
267
  try {
269
- return $String$2(argument);
268
+ return $String$3(argument);
270
269
  } catch (error) {
271
270
  return 'Object';
272
271
  }
273
272
  };
274
273
 
275
- var isCallable$a = isCallable$e;
274
+ var isCallable$c = isCallable$g;
276
275
  var tryToString = tryToString$1;
277
276
 
278
277
  var $TypeError$6 = TypeError;
279
278
 
280
279
  // `Assert: IsCallable(argument) is true`
281
280
  var aCallable$2 = function (argument) {
282
- if (isCallable$a(argument)) return argument;
281
+ if (isCallable$c(argument)) return argument;
283
282
  throw $TypeError$6(tryToString(argument) + ' is not a function');
284
283
  };
285
284
 
@@ -294,7 +293,7 @@ var getMethod$1 = function (V, P) {
294
293
  };
295
294
 
296
295
  var call$4 = functionCall;
297
- var isCallable$9 = isCallable$e;
296
+ var isCallable$b = isCallable$g;
298
297
  var isObject$5 = isObject$6;
299
298
 
300
299
  var $TypeError$5 = TypeError;
@@ -303,32 +302,32 @@ var $TypeError$5 = TypeError;
303
302
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
304
303
  var ordinaryToPrimitive$1 = function (input, pref) {
305
304
  var fn, val;
306
- if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
307
- if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
308
- if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
305
+ if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
306
+ if (isCallable$b(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
307
+ if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
309
308
  throw $TypeError$5("Can't convert object to primitive value");
310
309
  };
311
310
 
312
311
  var shared$3 = {exports: {}};
313
312
 
314
- var global$9 = global$c;
313
+ var global$a = global$d;
315
314
 
316
315
  // eslint-disable-next-line es/no-object-defineproperty -- safe
317
- var defineProperty$5 = Object.defineProperty;
316
+ var defineProperty$6 = Object.defineProperty;
318
317
 
319
318
  var defineGlobalProperty$3 = function (key, value) {
320
319
  try {
321
- defineProperty$5(global$9, key, { value: value, configurable: true, writable: true });
320
+ defineProperty$6(global$a, key, { value: value, configurable: true, writable: true });
322
321
  } catch (error) {
323
- global$9[key] = value;
322
+ global$a[key] = value;
324
323
  } return value;
325
324
  };
326
325
 
327
- var global$8 = global$c;
326
+ var global$9 = global$d;
328
327
  var defineGlobalProperty$2 = defineGlobalProperty$3;
329
328
 
330
329
  var SHARED = '__core-js_shared__';
331
- var store$3 = global$8[SHARED] || defineGlobalProperty$2(SHARED, {});
330
+ var store$3 = global$9[SHARED] || defineGlobalProperty$2(SHARED, {});
332
331
 
333
332
  var sharedStore = store$3;
334
333
 
@@ -346,18 +345,18 @@ var store$2 = sharedStore;
346
345
 
347
346
  var requireObjectCoercible = requireObjectCoercible$2;
348
347
 
349
- var $Object$1 = Object;
348
+ var $Object$2 = Object;
350
349
 
351
350
  // `ToObject` abstract operation
352
351
  // https://tc39.es/ecma262/#sec-toobject
353
352
  var toObject$4 = function (argument) {
354
- return $Object$1(requireObjectCoercible(argument));
353
+ return $Object$2(requireObjectCoercible(argument));
355
354
  };
356
355
 
357
- var uncurryThis$6 = functionUncurryThis;
356
+ var uncurryThis$7 = functionUncurryThis;
358
357
  var toObject$3 = toObject$4;
359
358
 
360
- var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
359
+ var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
361
360
 
362
361
  // `HasOwnProperty` abstract operation
363
362
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -366,32 +365,32 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
366
365
  return hasOwnProperty(toObject$3(it), key);
367
366
  };
368
367
 
369
- var uncurryThis$5 = functionUncurryThis;
368
+ var uncurryThis$6 = functionUncurryThis;
370
369
 
371
370
  var id = 0;
372
371
  var postfix = Math.random();
373
- var toString = uncurryThis$5(1.0.toString);
372
+ var toString$2 = uncurryThis$6(1.0.toString);
374
373
 
375
374
  var uid$2 = function (key) {
376
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
375
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
377
376
  };
378
377
 
379
- var global$7 = global$c;
378
+ var global$8 = global$d;
380
379
  var shared$2 = shared$3.exports;
381
- var hasOwn$8 = hasOwnProperty_1;
380
+ var hasOwn$9 = hasOwnProperty_1;
382
381
  var uid$1 = uid$2;
383
- var NATIVE_SYMBOL = symbolConstructorDetection;
382
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
384
383
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
385
384
 
386
385
  var WellKnownSymbolsStore = shared$2('wks');
387
- var Symbol$1 = global$7.Symbol;
386
+ var Symbol$1 = global$8.Symbol;
388
387
  var symbolFor = Symbol$1 && Symbol$1['for'];
389
388
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
390
389
 
391
- var wellKnownSymbol$6 = function (name) {
392
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
390
+ var wellKnownSymbol$8 = function (name) {
391
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
393
392
  var description = 'Symbol.' + name;
394
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
393
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
395
394
  WellKnownSymbolsStore[name] = Symbol$1[name];
396
395
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
397
396
  WellKnownSymbolsStore[name] = symbolFor(description);
@@ -406,10 +405,10 @@ var isObject$4 = isObject$6;
406
405
  var isSymbol$1 = isSymbol$2;
407
406
  var getMethod = getMethod$1;
408
407
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
409
- var wellKnownSymbol$5 = wellKnownSymbol$6;
408
+ var wellKnownSymbol$7 = wellKnownSymbol$8;
410
409
 
411
410
  var $TypeError$4 = TypeError;
412
- var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
411
+ var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
413
412
 
414
413
  // `ToPrimitive` abstract operation
415
414
  // https://tc39.es/ecma262/#sec-toprimitive
@@ -437,10 +436,10 @@ var toPropertyKey$2 = function (argument) {
437
436
  return isSymbol(key) ? key : key + '';
438
437
  };
439
438
 
440
- var global$6 = global$c;
439
+ var global$7 = global$d;
441
440
  var isObject$3 = isObject$6;
442
441
 
443
- var document$1 = global$6.document;
442
+ var document$1 = global$7.document;
444
443
  // typeof document.createElement is 'object' in old IE
445
444
  var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
446
445
 
@@ -448,25 +447,25 @@ var documentCreateElement$2 = function (it) {
448
447
  return EXISTS$1 ? document$1.createElement(it) : {};
449
448
  };
450
449
 
451
- var DESCRIPTORS$9 = descriptors;
450
+ var DESCRIPTORS$a = descriptors;
452
451
  var fails$7 = fails$c;
453
452
  var createElement = documentCreateElement$2;
454
453
 
455
454
  // Thanks to IE8 for its funny defineProperty
456
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$7(function () {
455
+ var ie8DomDefine = !DESCRIPTORS$a && !fails$7(function () {
457
456
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
458
457
  return Object.defineProperty(createElement('div'), 'a', {
459
458
  get: function () { return 7; }
460
459
  }).a != 7;
461
460
  });
462
461
 
463
- var DESCRIPTORS$8 = descriptors;
462
+ var DESCRIPTORS$9 = descriptors;
464
463
  var call$2 = functionCall;
465
464
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
466
465
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
467
466
  var toIndexedObject$4 = toIndexedObject$5;
468
467
  var toPropertyKey$1 = toPropertyKey$2;
469
- var hasOwn$7 = hasOwnProperty_1;
468
+ var hasOwn$8 = hasOwnProperty_1;
470
469
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
471
470
 
472
471
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -474,23 +473,23 @@ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
474
473
 
475
474
  // `Object.getOwnPropertyDescriptor` method
476
475
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
477
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
476
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
478
477
  O = toIndexedObject$4(O);
479
478
  P = toPropertyKey$1(P);
480
479
  if (IE8_DOM_DEFINE$1) try {
481
480
  return $getOwnPropertyDescriptor$1(O, P);
482
481
  } catch (error) { /* empty */ }
483
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
482
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
484
483
  };
485
484
 
486
485
  var objectDefineProperty = {};
487
486
 
488
- var DESCRIPTORS$7 = descriptors;
487
+ var DESCRIPTORS$8 = descriptors;
489
488
  var fails$6 = fails$c;
490
489
 
491
490
  // V8 ~ Chrome 36-
492
491
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
493
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$6(function () {
492
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$6(function () {
494
493
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
495
494
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
496
495
  value: 42,
@@ -500,16 +499,16 @@ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$6(function () {
500
499
 
501
500
  var isObject$2 = isObject$6;
502
501
 
503
- var $String$1 = String;
502
+ var $String$2 = String;
504
503
  var $TypeError$3 = TypeError;
505
504
 
506
505
  // `Assert: Type(argument) is Object`
507
506
  var anObject$5 = function (argument) {
508
507
  if (isObject$2(argument)) return argument;
509
- throw $TypeError$3($String$1(argument) + ' is not an object');
508
+ throw $TypeError$3($String$2(argument) + ' is not an object');
510
509
  };
511
510
 
512
- var DESCRIPTORS$6 = descriptors;
511
+ var DESCRIPTORS$7 = descriptors;
513
512
  var IE8_DOM_DEFINE = ie8DomDefine;
514
513
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
515
514
  var anObject$4 = anObject$5;
@@ -526,7 +525,7 @@ var WRITABLE = 'writable';
526
525
 
527
526
  // `Object.defineProperty` method
528
527
  // https://tc39.es/ecma262/#sec-object.defineproperty
529
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
528
+ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
530
529
  anObject$4(O);
531
530
  P = toPropertyKey(P);
532
531
  anObject$4(Attributes);
@@ -553,11 +552,11 @@ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
553
552
  return O;
554
553
  };
555
554
 
556
- var DESCRIPTORS$5 = descriptors;
555
+ var DESCRIPTORS$6 = descriptors;
557
556
  var definePropertyModule$3 = objectDefineProperty;
558
557
  var createPropertyDescriptor$1 = createPropertyDescriptor$3;
559
558
 
560
- var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value) {
559
+ var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
561
560
  return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
562
561
  } : function (object, key, value) {
563
562
  object[key] = value;
@@ -566,17 +565,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
566
565
 
567
566
  var makeBuiltIn$2 = {exports: {}};
568
567
 
569
- var DESCRIPTORS$4 = descriptors;
570
- var hasOwn$6 = hasOwnProperty_1;
568
+ var DESCRIPTORS$5 = descriptors;
569
+ var hasOwn$7 = hasOwnProperty_1;
571
570
 
572
571
  var FunctionPrototype = Function.prototype;
573
572
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
574
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
573
+ var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
575
574
 
576
- var EXISTS = hasOwn$6(FunctionPrototype, 'name');
575
+ var EXISTS = hasOwn$7(FunctionPrototype, 'name');
577
576
  // additional protection from minified / mangled / dropped function names
578
577
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
579
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
578
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
580
579
 
581
580
  var functionName = {
582
581
  EXISTS: EXISTS,
@@ -584,14 +583,14 @@ var functionName = {
584
583
  CONFIGURABLE: CONFIGURABLE
585
584
  };
586
585
 
587
- var uncurryThis$4 = functionUncurryThis;
588
- var isCallable$8 = isCallable$e;
586
+ var uncurryThis$5 = functionUncurryThis;
587
+ var isCallable$a = isCallable$g;
589
588
  var store$1 = sharedStore;
590
589
 
591
- var functionToString = uncurryThis$4(Function.toString);
590
+ var functionToString = uncurryThis$5(Function.toString);
592
591
 
593
592
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
594
- if (!isCallable$8(store$1.inspectSource)) {
593
+ if (!isCallable$a(store$1.inspectSource)) {
595
594
  store$1.inspectSource = function (it) {
596
595
  return functionToString(it);
597
596
  };
@@ -599,12 +598,12 @@ if (!isCallable$8(store$1.inspectSource)) {
599
598
 
600
599
  var inspectSource$1 = store$1.inspectSource;
601
600
 
602
- var global$5 = global$c;
603
- var isCallable$7 = isCallable$e;
601
+ var global$6 = global$d;
602
+ var isCallable$9 = isCallable$g;
604
603
 
605
- var WeakMap$1 = global$5.WeakMap;
604
+ var WeakMap$1 = global$6.WeakMap;
606
605
 
607
- var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
606
+ var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
608
607
 
609
608
  var shared$1 = shared$3.exports;
610
609
  var uid = uid$2;
@@ -618,17 +617,17 @@ var sharedKey$3 = function (key) {
618
617
  var hiddenKeys$4 = {};
619
618
 
620
619
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
621
- var global$4 = global$c;
620
+ var global$5 = global$d;
622
621
  var isObject$1 = isObject$6;
623
622
  var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
624
- var hasOwn$5 = hasOwnProperty_1;
623
+ var hasOwn$6 = hasOwnProperty_1;
625
624
  var shared = sharedStore;
626
625
  var sharedKey$2 = sharedKey$3;
627
626
  var hiddenKeys$3 = hiddenKeys$4;
628
627
 
629
628
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
630
- var TypeError$1 = global$4.TypeError;
631
- var WeakMap = global$4.WeakMap;
629
+ var TypeError$1 = global$5.TypeError;
630
+ var WeakMap = global$5.WeakMap;
632
631
  var set, get, has;
633
632
 
634
633
  var enforce = function (it) {
@@ -667,16 +666,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
667
666
  var STATE = sharedKey$2('state');
668
667
  hiddenKeys$3[STATE] = true;
669
668
  set = function (it, metadata) {
670
- if (hasOwn$5(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
669
+ if (hasOwn$6(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
671
670
  metadata.facade = it;
672
671
  createNonEnumerableProperty$3(it, STATE, metadata);
673
672
  return metadata;
674
673
  };
675
674
  get = function (it) {
676
- return hasOwn$5(it, STATE) ? it[STATE] : {};
675
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
677
676
  };
678
677
  has = function (it) {
679
- return hasOwn$5(it, STATE);
678
+ return hasOwn$6(it, STATE);
680
679
  };
681
680
  }
682
681
 
@@ -689,9 +688,9 @@ var internalState = {
689
688
  };
690
689
 
691
690
  var fails$5 = fails$c;
692
- var isCallable$6 = isCallable$e;
693
- var hasOwn$4 = hasOwnProperty_1;
694
- var DESCRIPTORS$3 = descriptors;
691
+ var isCallable$8 = isCallable$g;
692
+ var hasOwn$5 = hasOwnProperty_1;
693
+ var DESCRIPTORS$4 = descriptors;
695
694
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
696
695
  var inspectSource = inspectSource$1;
697
696
  var InternalStateModule$1 = internalState;
@@ -699,10 +698,10 @@ var InternalStateModule$1 = internalState;
699
698
  var enforceInternalState = InternalStateModule$1.enforce;
700
699
  var getInternalState$1 = InternalStateModule$1.get;
701
700
  // eslint-disable-next-line es/no-object-defineproperty -- safe
702
- var defineProperty$4 = Object.defineProperty;
701
+ var defineProperty$5 = Object.defineProperty;
703
702
 
704
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$5(function () {
705
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
703
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$5(function () {
704
+ return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
706
705
  });
707
706
 
708
707
  var TEMPLATE = String(String).split('String');
@@ -713,21 +712,21 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
713
712
  }
714
713
  if (options && options.getter) name = 'get ' + name;
715
714
  if (options && options.setter) name = 'set ' + name;
716
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
717
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
715
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
716
+ if (DESCRIPTORS$4) defineProperty$5(value, 'name', { value: name, configurable: true });
718
717
  else value.name = name;
719
718
  }
720
- if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
721
- defineProperty$4(value, 'length', { value: options.arity });
719
+ if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
720
+ defineProperty$5(value, 'length', { value: options.arity });
722
721
  }
723
722
  try {
724
- if (options && hasOwn$4(options, 'constructor') && options.constructor) {
725
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
723
+ if (options && hasOwn$5(options, 'constructor') && options.constructor) {
724
+ if (DESCRIPTORS$4) defineProperty$5(value, 'prototype', { writable: false });
726
725
  // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
727
726
  } else if (value.prototype) value.prototype = undefined;
728
727
  } catch (error) { /* empty */ }
729
728
  var state = enforceInternalState(value);
730
- if (!hasOwn$4(state, 'source')) {
729
+ if (!hasOwn$5(state, 'source')) {
731
730
  state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
732
731
  } return value;
733
732
  };
@@ -735,10 +734,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
735
734
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
736
735
  // eslint-disable-next-line no-extend-native -- required
737
736
  Function.prototype.toString = makeBuiltIn$1(function toString() {
738
- return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
737
+ return isCallable$8(this) && getInternalState$1(this).source || inspectSource(this);
739
738
  }, 'toString');
740
739
 
741
- var isCallable$5 = isCallable$e;
740
+ var isCallable$7 = isCallable$g;
742
741
  var definePropertyModule$2 = objectDefineProperty;
743
742
  var makeBuiltIn = makeBuiltIn$2.exports;
744
743
  var defineGlobalProperty$1 = defineGlobalProperty$3;
@@ -747,7 +746,7 @@ var defineBuiltIn$3 = function (O, key, value, options) {
747
746
  if (!options) options = {};
748
747
  var simple = options.enumerable;
749
748
  var name = options.name !== undefined ? options.name : key;
750
- if (isCallable$5(value)) makeBuiltIn(value, name, options);
749
+ if (isCallable$7(value)) makeBuiltIn(value, name, options);
751
750
  if (options.global) {
752
751
  if (simple) O[key] = value;
753
752
  else defineGlobalProperty$1(key, value);
@@ -853,22 +852,22 @@ var arrayIncludes = {
853
852
  indexOf: createMethod$1(false)
854
853
  };
855
854
 
856
- var uncurryThis$3 = functionUncurryThis;
857
- var hasOwn$3 = hasOwnProperty_1;
855
+ var uncurryThis$4 = functionUncurryThis;
856
+ var hasOwn$4 = hasOwnProperty_1;
858
857
  var toIndexedObject$2 = toIndexedObject$5;
859
858
  var indexOf = arrayIncludes.indexOf;
860
859
  var hiddenKeys$2 = hiddenKeys$4;
861
860
 
862
- var push = uncurryThis$3([].push);
861
+ var push = uncurryThis$4([].push);
863
862
 
864
863
  var objectKeysInternal = function (object, names) {
865
864
  var O = toIndexedObject$2(object);
866
865
  var i = 0;
867
866
  var result = [];
868
867
  var key;
869
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
868
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
870
869
  // Don't enum bug & hidden keys
871
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
870
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
872
871
  ~indexOf(result, key) || push(result, key);
873
872
  }
874
873
  return result;
@@ -903,12 +902,12 @@ var objectGetOwnPropertySymbols = {};
903
902
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
904
903
 
905
904
  var getBuiltIn$1 = getBuiltIn$4;
906
- var uncurryThis$2 = functionUncurryThis;
905
+ var uncurryThis$3 = functionUncurryThis;
907
906
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
908
907
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
909
908
  var anObject$3 = anObject$5;
910
909
 
911
- var concat$1 = uncurryThis$2([].concat);
910
+ var concat$1 = uncurryThis$3([].concat);
912
911
 
913
912
  // all object keys, includes non-enumerable and symbols
914
913
  var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -917,25 +916,25 @@ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
917
916
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
918
917
  };
919
918
 
920
- var hasOwn$2 = hasOwnProperty_1;
919
+ var hasOwn$3 = hasOwnProperty_1;
921
920
  var ownKeys = ownKeys$1;
922
921
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
923
922
  var definePropertyModule$1 = objectDefineProperty;
924
923
 
925
- var copyConstructorProperties$1 = function (target, source, exceptions) {
924
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
926
925
  var keys = ownKeys(source);
927
926
  var defineProperty = definePropertyModule$1.f;
928
927
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
929
928
  for (var i = 0; i < keys.length; i++) {
930
929
  var key = keys[i];
931
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
930
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
932
931
  defineProperty(target, key, getOwnPropertyDescriptor(source, key));
933
932
  }
934
933
  }
935
934
  };
936
935
 
937
936
  var fails$4 = fails$c;
938
- var isCallable$4 = isCallable$e;
937
+ var isCallable$6 = isCallable$g;
939
938
 
940
939
  var replacement = /#|\.prototype\./;
941
940
 
@@ -943,7 +942,7 @@ var isForced$1 = function (feature, detection) {
943
942
  var value = data[normalize(feature)];
944
943
  return value == POLYFILL ? true
945
944
  : value == NATIVE ? false
946
- : isCallable$4(detection) ? fails$4(detection)
945
+ : isCallable$6(detection) ? fails$4(detection)
947
946
  : !!detection;
948
947
  };
949
948
 
@@ -957,12 +956,12 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
957
956
 
958
957
  var isForced_1 = isForced$1;
959
958
 
960
- var global$3 = global$c;
959
+ var global$4 = global$d;
961
960
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
962
961
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
963
962
  var defineBuiltIn$2 = defineBuiltIn$3;
964
963
  var defineGlobalProperty = defineGlobalProperty$3;
965
- var copyConstructorProperties = copyConstructorProperties$1;
964
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
966
965
  var isForced = isForced_1;
967
966
 
968
967
  /*
@@ -986,11 +985,11 @@ var _export = function (options, source) {
986
985
  var STATIC = options.stat;
987
986
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
988
987
  if (GLOBAL) {
989
- target = global$3;
988
+ target = global$4;
990
989
  } else if (STATIC) {
991
- target = global$3[TARGET] || defineGlobalProperty(TARGET, {});
990
+ target = global$4[TARGET] || defineGlobalProperty(TARGET, {});
992
991
  } else {
993
- target = (global$3[TARGET] || {}).prototype;
992
+ target = (global$4[TARGET] || {}).prototype;
994
993
  }
995
994
  if (target) for (key in source) {
996
995
  sourceProperty = source[key];
@@ -1002,7 +1001,7 @@ var _export = function (options, source) {
1002
1001
  // contained in target
1003
1002
  if (!FORCED && targetProperty !== undefined) {
1004
1003
  if (typeof sourceProperty == typeof targetProperty) continue;
1005
- copyConstructorProperties(sourceProperty, targetProperty);
1004
+ copyConstructorProperties$1(sourceProperty, targetProperty);
1006
1005
  }
1007
1006
  // add a flag to not completely full polyfills
1008
1007
  if (options.sham || (targetProperty && targetProperty.sham)) {
@@ -1022,8 +1021,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1022
1021
  return internalObjectKeys(O, enumBugKeys$1);
1023
1022
  };
1024
1023
 
1025
- var DESCRIPTORS$2 = descriptors;
1026
- var uncurryThis$1 = functionUncurryThis;
1024
+ var DESCRIPTORS$3 = descriptors;
1025
+ var uncurryThis$2 = functionUncurryThis;
1027
1026
  var call$1 = functionCall;
1028
1027
  var fails$3 = fails$c;
1029
1028
  var objectKeys$1 = objectKeys$2;
@@ -1035,17 +1034,17 @@ var IndexedObject$1 = indexedObject;
1035
1034
  // eslint-disable-next-line es/no-object-assign -- safe
1036
1035
  var $assign = Object.assign;
1037
1036
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1038
- var defineProperty$3 = Object.defineProperty;
1039
- var concat = uncurryThis$1([].concat);
1037
+ var defineProperty$4 = Object.defineProperty;
1038
+ var concat = uncurryThis$2([].concat);
1040
1039
 
1041
1040
  // `Object.assign` method
1042
1041
  // https://tc39.es/ecma262/#sec-object.assign
1043
1042
  var objectAssign = !$assign || fails$3(function () {
1044
1043
  // should have correct order of operations (Edge bug)
1045
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1044
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1046
1045
  enumerable: true,
1047
1046
  get: function () {
1048
- defineProperty$3(this, 'b', {
1047
+ defineProperty$4(this, 'b', {
1049
1048
  value: 3,
1050
1049
  enumerable: false
1051
1050
  });
@@ -1074,18 +1073,18 @@ var objectAssign = !$assign || fails$3(function () {
1074
1073
  var key;
1075
1074
  while (length > j) {
1076
1075
  key = keys[j++];
1077
- if (!DESCRIPTORS$2 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1076
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1078
1077
  }
1079
1078
  } return T;
1080
1079
  } : $assign;
1081
1080
 
1082
- var $$2 = _export;
1081
+ var $$3 = _export;
1083
1082
  var assign = objectAssign;
1084
1083
 
1085
1084
  // `Object.assign` method
1086
1085
  // https://tc39.es/ecma262/#sec-object.assign
1087
1086
  // eslint-disable-next-line es/no-object-assign -- required for testing
1088
- $$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1087
+ $$3({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1089
1088
  assign: assign
1090
1089
  });
1091
1090
 
@@ -1093,7 +1092,7 @@ const NinetailedContext = /*#__PURE__*/createContext(undefined);
1093
1092
 
1094
1093
  var objectDefineProperties = {};
1095
1094
 
1096
- var DESCRIPTORS$1 = descriptors;
1095
+ var DESCRIPTORS$2 = descriptors;
1097
1096
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1098
1097
  var definePropertyModule = objectDefineProperty;
1099
1098
  var anObject$2 = anObject$5;
@@ -1103,7 +1102,7 @@ var objectKeys = objectKeys$2;
1103
1102
  // `Object.defineProperties` method
1104
1103
  // https://tc39.es/ecma262/#sec-object.defineproperties
1105
1104
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1106
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1105
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1107
1106
  anObject$2(O);
1108
1107
  var props = toIndexedObject$1(Properties);
1109
1108
  var keys = objectKeys(Properties);
@@ -1203,17 +1202,17 @@ var objectCreate = Object.create || function create(O, Properties) {
1203
1202
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1204
1203
  };
1205
1204
 
1206
- var wellKnownSymbol$4 = wellKnownSymbol$6;
1205
+ var wellKnownSymbol$6 = wellKnownSymbol$8;
1207
1206
  var create$1 = objectCreate;
1208
- var defineProperty$2 = objectDefineProperty.f;
1207
+ var defineProperty$3 = objectDefineProperty.f;
1209
1208
 
1210
- var UNSCOPABLES = wellKnownSymbol$4('unscopables');
1209
+ var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1211
1210
  var ArrayPrototype = Array.prototype;
1212
1211
 
1213
1212
  // Array.prototype[@@unscopables]
1214
1213
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1215
1214
  if (ArrayPrototype[UNSCOPABLES] == undefined) {
1216
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1215
+ defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1217
1216
  configurable: true,
1218
1217
  value: create$1(null)
1219
1218
  });
@@ -1235,36 +1234,36 @@ var correctPrototypeGetter = !fails$2(function () {
1235
1234
  return Object.getPrototypeOf(new F()) !== F.prototype;
1236
1235
  });
1237
1236
 
1238
- var hasOwn$1 = hasOwnProperty_1;
1239
- var isCallable$3 = isCallable$e;
1237
+ var hasOwn$2 = hasOwnProperty_1;
1238
+ var isCallable$5 = isCallable$g;
1240
1239
  var toObject$1 = toObject$4;
1241
1240
  var sharedKey = sharedKey$3;
1242
1241
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1243
1242
 
1244
1243
  var IE_PROTO = sharedKey('IE_PROTO');
1245
- var $Object = Object;
1246
- var ObjectPrototype = $Object.prototype;
1244
+ var $Object$1 = Object;
1245
+ var ObjectPrototype = $Object$1.prototype;
1247
1246
 
1248
1247
  // `Object.getPrototypeOf` method
1249
1248
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1250
1249
  // eslint-disable-next-line es/no-object-getprototypeof -- safe
1251
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1250
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1252
1251
  var object = toObject$1(O);
1253
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1252
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1254
1253
  var constructor = object.constructor;
1255
- if (isCallable$3(constructor) && object instanceof constructor) {
1254
+ if (isCallable$5(constructor) && object instanceof constructor) {
1256
1255
  return constructor.prototype;
1257
- } return object instanceof $Object ? ObjectPrototype : null;
1256
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1258
1257
  };
1259
1258
 
1260
1259
  var fails$1 = fails$c;
1261
- var isCallable$2 = isCallable$e;
1260
+ var isCallable$4 = isCallable$g;
1262
1261
  var isObject = isObject$6;
1263
1262
  var getPrototypeOf$1 = objectGetPrototypeOf;
1264
1263
  var defineBuiltIn$1 = defineBuiltIn$3;
1265
- var wellKnownSymbol$3 = wellKnownSymbol$6;
1264
+ var wellKnownSymbol$5 = wellKnownSymbol$8;
1266
1265
 
1267
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
1266
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1268
1267
  var BUGGY_SAFARI_ITERATORS$1 = false;
1269
1268
 
1270
1269
  // `%IteratorPrototype%` object
@@ -1292,7 +1291,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1292
1291
 
1293
1292
  // `%IteratorPrototype%[@@iterator]()` method
1294
1293
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1295
- if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
1294
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1296
1295
  defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
1297
1296
  return this;
1298
1297
  });
@@ -1303,16 +1302,16 @@ var iteratorsCore = {
1303
1302
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1304
1303
  };
1305
1304
 
1306
- var defineProperty$1 = objectDefineProperty.f;
1307
- var hasOwn = hasOwnProperty_1;
1308
- var wellKnownSymbol$2 = wellKnownSymbol$6;
1305
+ var defineProperty$2 = objectDefineProperty.f;
1306
+ var hasOwn$1 = hasOwnProperty_1;
1307
+ var wellKnownSymbol$4 = wellKnownSymbol$8;
1309
1308
 
1310
- var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1309
+ var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1311
1310
 
1312
1311
  var setToStringTag$2 = function (target, TAG, STATIC) {
1313
1312
  if (target && !STATIC) target = target.prototype;
1314
- if (target && !hasOwn(target, TO_STRING_TAG$1)) {
1315
- defineProperty$1(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
1313
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1314
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1316
1315
  }
1317
1316
  };
1318
1317
 
@@ -1332,19 +1331,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1332
1331
  return IteratorConstructor;
1333
1332
  };
1334
1333
 
1335
- var isCallable$1 = isCallable$e;
1334
+ var isCallable$3 = isCallable$g;
1336
1335
 
1337
- var $String = String;
1336
+ var $String$1 = String;
1338
1337
  var $TypeError$1 = TypeError;
1339
1338
 
1340
1339
  var aPossiblePrototype$1 = function (argument) {
1341
- if (typeof argument == 'object' || isCallable$1(argument)) return argument;
1342
- throw $TypeError$1("Can't set " + $String(argument) + ' as a prototype');
1340
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1341
+ throw $TypeError$1("Can't set " + $String$1(argument) + ' as a prototype');
1343
1342
  };
1344
1343
 
1345
1344
  /* eslint-disable no-proto -- safe */
1346
1345
 
1347
- var uncurryThis = functionUncurryThis;
1346
+ var uncurryThis$1 = functionUncurryThis;
1348
1347
  var anObject = anObject$5;
1349
1348
  var aPossiblePrototype = aPossiblePrototype$1;
1350
1349
 
@@ -1358,7 +1357,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1358
1357
  var setter;
1359
1358
  try {
1360
1359
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1361
- setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1360
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1362
1361
  setter(test, []);
1363
1362
  CORRECT_SETTER = test instanceof Array;
1364
1363
  } catch (error) { /* empty */ }
@@ -1371,17 +1370,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1371
1370
  };
1372
1371
  }() : undefined);
1373
1372
 
1374
- var $$1 = _export;
1373
+ var $$2 = _export;
1375
1374
  var call = functionCall;
1376
1375
  var FunctionName = functionName;
1377
- var isCallable = isCallable$e;
1376
+ var isCallable$2 = isCallable$g;
1378
1377
  var createIteratorConstructor = iteratorCreateConstructor;
1379
1378
  var getPrototypeOf = objectGetPrototypeOf;
1380
1379
  var setPrototypeOf = objectSetPrototypeOf;
1381
1380
  var setToStringTag = setToStringTag$2;
1382
1381
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1383
1382
  var defineBuiltIn = defineBuiltIn$3;
1384
- var wellKnownSymbol$1 = wellKnownSymbol$6;
1383
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
1385
1384
  var Iterators$1 = iterators;
1386
1385
  var IteratorsCore = iteratorsCore;
1387
1386
 
@@ -1389,7 +1388,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1389
1388
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1390
1389
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1391
1390
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1392
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
1391
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1393
1392
  var KEYS = 'keys';
1394
1393
  var VALUES = 'values';
1395
1394
  var ENTRIES = 'entries';
@@ -1426,7 +1425,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1426
1425
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1427
1426
  if (setPrototypeOf) {
1428
1427
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1429
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1428
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1430
1429
  defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1431
1430
  }
1432
1431
  }
@@ -1456,7 +1455,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1456
1455
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1457
1456
  defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1458
1457
  }
1459
- } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1458
+ } else $$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1460
1459
  }
1461
1460
 
1462
1461
  // define iterator
@@ -1478,10 +1477,10 @@ var toIndexedObject = toIndexedObject$5;
1478
1477
  var addToUnscopables = addToUnscopables$1;
1479
1478
  var Iterators = iterators;
1480
1479
  var InternalStateModule = internalState;
1481
- var defineProperty = objectDefineProperty.f;
1480
+ var defineProperty$1 = objectDefineProperty.f;
1482
1481
  var defineIterator = iteratorDefine;
1483
1482
  var createIterResultObject = createIterResultObject$1;
1484
- var DESCRIPTORS = descriptors;
1483
+ var DESCRIPTORS$1 = descriptors;
1485
1484
 
1486
1485
  var ARRAY_ITERATOR = 'Array Iterator';
1487
1486
  var setInternalState = InternalStateModule.set;
@@ -1531,8 +1530,8 @@ addToUnscopables('values');
1531
1530
  addToUnscopables('entries');
1532
1531
 
1533
1532
  // V8 ~ Chrome 45- bug
1534
- if (DESCRIPTORS && values.name !== 'values') try {
1535
- defineProperty(values, 'name', { value: 'values' });
1533
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1534
+ defineProperty$1(values, 'name', { value: 'values' });
1536
1535
  } catch (error) { /* empty */ }
1537
1536
 
1538
1537
  // iterable DOM collections
@@ -1579,15 +1578,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
1579
1578
 
1580
1579
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1581
1580
 
1582
- var global$2 = global$c;
1581
+ var global$3 = global$d;
1583
1582
  var DOMIterables = domIterables;
1584
1583
  var DOMTokenListPrototype = domTokenListPrototype;
1585
1584
  var ArrayIteratorMethods = es_array_iterator;
1586
1585
  var createNonEnumerableProperty = createNonEnumerableProperty$4;
1587
- var wellKnownSymbol = wellKnownSymbol$6;
1586
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
1588
1587
 
1589
- var ITERATOR = wellKnownSymbol('iterator');
1590
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1588
+ var ITERATOR = wellKnownSymbol$2('iterator');
1589
+ var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1591
1590
  var ArrayValues = ArrayIteratorMethods.values;
1592
1591
 
1593
1592
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
@@ -1598,8 +1597,8 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1598
1597
  } catch (error) {
1599
1598
  CollectionPrototype[ITERATOR] = ArrayValues;
1600
1599
  }
1601
- if (!CollectionPrototype[TO_STRING_TAG]) {
1602
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
1600
+ if (!CollectionPrototype[TO_STRING_TAG$2]) {
1601
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1603
1602
  }
1604
1603
  if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1605
1604
  // some Chrome versions have non-configurable methods on DOMTokenList
@@ -1613,7 +1612,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1613
1612
  };
1614
1613
 
1615
1614
  for (var COLLECTION_NAME in DOMIterables) {
1616
- handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
1615
+ handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
1617
1616
  }
1618
1617
 
1619
1618
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
@@ -1655,6 +1654,159 @@ function __awaiter(thisArg, _arguments, P, generator) {
1655
1654
  });
1656
1655
  }
1657
1656
 
1657
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
1658
+
1659
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1660
+ var test = {};
1661
+
1662
+ test[TO_STRING_TAG$1] = 'z';
1663
+
1664
+ var toStringTagSupport = String(test) === '[object z]';
1665
+
1666
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1667
+ var isCallable$1 = isCallable$g;
1668
+ var classofRaw = classofRaw$1;
1669
+ var wellKnownSymbol = wellKnownSymbol$8;
1670
+
1671
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1672
+ var $Object = Object;
1673
+
1674
+ // ES3 wrong here
1675
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1676
+
1677
+ // fallback for IE11 Script Access Denied error
1678
+ var tryGet = function (it, key) {
1679
+ try {
1680
+ return it[key];
1681
+ } catch (error) { /* empty */ }
1682
+ };
1683
+
1684
+ // getting tag from ES6+ `Object.prototype.toString`
1685
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1686
+ var O, tag, result;
1687
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1688
+ // @@toStringTag case
1689
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1690
+ // builtinTag case
1691
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1692
+ // ES3 arguments fallback
1693
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1694
+ };
1695
+
1696
+ var classof$1 = classof$2;
1697
+
1698
+ var $String = String;
1699
+
1700
+ var toString$1 = function (argument) {
1701
+ if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1702
+ return $String(argument);
1703
+ };
1704
+
1705
+ var $$1 = _export;
1706
+ var DESCRIPTORS = descriptors;
1707
+ var global$2 = global$d;
1708
+ var uncurryThis = functionUncurryThis;
1709
+ var hasOwn = hasOwnProperty_1;
1710
+ var isCallable = isCallable$g;
1711
+ var isPrototypeOf = objectIsPrototypeOf;
1712
+ var toString = toString$1;
1713
+ var defineProperty = objectDefineProperty.f;
1714
+ var copyConstructorProperties = copyConstructorProperties$2;
1715
+
1716
+ var NativeSymbol = global$2.Symbol;
1717
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1718
+
1719
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
1720
+ // Safari 12 bug
1721
+ NativeSymbol().description !== undefined
1722
+ )) {
1723
+ var EmptyStringDescriptionStore = {};
1724
+ // wrap Symbol constructor for correct work with undefined description
1725
+ var SymbolWrapper = function Symbol() {
1726
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
1727
+ var result = isPrototypeOf(SymbolPrototype, this)
1728
+ ? new NativeSymbol(description)
1729
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1730
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
1731
+ if (description === '') EmptyStringDescriptionStore[result] = true;
1732
+ return result;
1733
+ };
1734
+
1735
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
1736
+ SymbolWrapper.prototype = SymbolPrototype;
1737
+ SymbolPrototype.constructor = SymbolWrapper;
1738
+
1739
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1740
+ var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
1741
+ var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
1742
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
1743
+ var replace = uncurryThis(''.replace);
1744
+ var stringSlice = uncurryThis(''.slice);
1745
+
1746
+ defineProperty(SymbolPrototype, 'description', {
1747
+ configurable: true,
1748
+ get: function description() {
1749
+ var symbol = thisSymbolValue(this);
1750
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
1751
+ var string = symbolDescriptiveString(symbol);
1752
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
1753
+ return desc === '' ? undefined : desc;
1754
+ }
1755
+ });
1756
+
1757
+ $$1({ global: true, constructor: true, forced: true }, {
1758
+ Symbol: SymbolWrapper
1759
+ });
1760
+ }
1761
+
1762
+ const useNinetailed = () => {
1763
+ const ninetailed = useContext(NinetailedContext);
1764
+ if (ninetailed === undefined) {
1765
+ throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
1766
+ }
1767
+ return ninetailed;
1768
+ };
1769
+
1770
+ const TrackExperience = ({
1771
+ children,
1772
+ experience,
1773
+ variant,
1774
+ profile
1775
+ }) => {
1776
+ const ninetailed = useNinetailed();
1777
+ const {
1778
+ ref,
1779
+ inView
1780
+ } = useInView({
1781
+ triggerOnce: true
1782
+ });
1783
+ useEffect(() => {
1784
+ if (isBrowser() && inView) {
1785
+ const distribution = selectDistribution({
1786
+ experience,
1787
+ profile
1788
+ });
1789
+ ninetailed.trackHasSeenExperience({
1790
+ experience: {
1791
+ id: experience.id,
1792
+ type: experience.type,
1793
+ name: experience.name || '',
1794
+ description: experience.description || ''
1795
+ },
1796
+ audience: experience.audience,
1797
+ selectedVariant: variant,
1798
+ selectedVariantIndex: distribution.index
1799
+ });
1800
+ }
1801
+ }, [inView]);
1802
+ return jsxs(Fragment, {
1803
+ children: [jsx("div", {
1804
+ ref: ref,
1805
+ id: "nt-experience-handle"
1806
+ }), children]
1807
+ });
1808
+ };
1809
+
1658
1810
  var aCallable = aCallable$2;
1659
1811
  var toObject = toObject$4;
1660
1812
  var IndexedObject = indexedObject;
@@ -1708,8 +1860,8 @@ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1708
1860
  });
1709
1861
  };
1710
1862
 
1711
- var classof = classofRaw;
1712
- var global$1 = global$c;
1863
+ var classof = classofRaw$1;
1864
+ var global$1 = global$d;
1713
1865
 
1714
1866
  var engineIsNode = classof(global$1.process) == 'process';
1715
1867
 
@@ -1733,14 +1885,6 @@ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
1733
1885
  }
1734
1886
  });
1735
1887
 
1736
- const useNinetailed = () => {
1737
- const ninetailed = useContext(NinetailedContext);
1738
- if (ninetailed === undefined) {
1739
- throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
1740
- }
1741
- return ninetailed;
1742
- };
1743
-
1744
1888
  const useProfile = () => {
1745
1889
  const ninetailed = useNinetailed();
1746
1890
  const [profileState, setProfileState] = useState(ninetailed.profileState);
@@ -1777,23 +1921,6 @@ const useProfile = () => {
1777
1921
  });
1778
1922
  };
1779
1923
 
1780
- const ExperimentsContext = /*#__PURE__*/createContext(undefined);
1781
-
1782
- const useExperimentsContext = () => {
1783
- const context = useContext(ExperimentsContext);
1784
- if (context === undefined) {
1785
- throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
1786
- }
1787
- return context;
1788
- };
1789
-
1790
- const useExperiments = () => {
1791
- const context = useExperimentsContext();
1792
- return {
1793
- experiments: context.experiments
1794
- };
1795
- };
1796
-
1797
1924
  const useExperienceSelectionMiddleware = ({
1798
1925
  experiences,
1799
1926
  baseline,
@@ -1828,9 +1955,6 @@ const useExperience = ({
1828
1955
  experiences
1829
1956
  }) => {
1830
1957
  const profileState = useProfile();
1831
- const {
1832
- experiments
1833
- } = useExperiments();
1834
1958
  const hasVariants = experiences.map(experience => selectHasExperienceVariants(experience, baseline)).reduce((acc, curr) => acc || curr, false);
1835
1959
  const {
1836
1960
  status,
@@ -1844,26 +1968,21 @@ const useExperience = ({
1844
1968
  const overrideResult = _a => {
1845
1969
  var {
1846
1970
  experience: originalExperience,
1847
- variant: originalVariant,
1848
- variantIndex: originalVariantIndex
1971
+ variant: originalVariant
1849
1972
  } = _a,
1850
- other = __rest(_a, ["experience", "variant", "variantIndex"]);
1973
+ other = __rest(_a, ["experience", "variant"]);
1851
1974
  const {
1852
1975
  experience,
1853
- variant,
1854
- variantIndex
1976
+ variant
1855
1977
  } = experienceSelectionMiddleware({
1856
1978
  experience: originalExperience,
1857
- variant: originalVariant,
1858
- variantIndex: originalVariantIndex
1979
+ variant: originalVariant
1859
1980
  });
1860
1981
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1861
1982
  // @ts-ignore
1862
1983
  return Object.assign(Object.assign({}, other), {
1863
- audience: (experience === null || experience === void 0 ? void 0 : experience.audience) ? experience.audience : null,
1864
1984
  experience,
1865
- variant,
1866
- variantIndex
1985
+ variant
1867
1986
  });
1868
1987
  };
1869
1988
  const baseReturn = Object.assign(Object.assign({}, profileState), {
@@ -1872,8 +1991,7 @@ const useExperience = ({
1872
1991
  });
1873
1992
  const emptyReturn = Object.assign(Object.assign({}, baseReturn), {
1874
1993
  experience: null,
1875
- variant: baseline,
1876
- variantIndex: 0,
1994
+ variant: null,
1877
1995
  audience: null,
1878
1996
  isPersonalized: false,
1879
1997
  profile: null
@@ -1893,7 +2011,7 @@ const useExperience = ({
1893
2011
  // @ts-ignore
1894
2012
  return overrideResult(emptyReturn);
1895
2013
  }
1896
- const activeExperiments = selectActiveExperiments(experiments, profile);
2014
+ const activeExperiments = selectActiveExperiments(experiences, profile);
1897
2015
  const experience = selectExperience({
1898
2016
  experiences,
1899
2017
  activeExperiments,
@@ -1906,62 +2024,36 @@ const useExperience = ({
1906
2024
  profile
1907
2025
  }));
1908
2026
  }
1909
- const {
1910
- variant,
1911
- index
1912
- } = selectExperienceVariant({
2027
+ const audience = experience.audience;
2028
+ const variant = selectExperienceVariant({
1913
2029
  baseline,
1914
2030
  experience,
1915
2031
  profile
1916
2032
  });
2033
+ if (!variant) {
2034
+ return overrideResult(Object.assign(Object.assign({}, baseReturn), {
2035
+ status: 'success',
2036
+ loading: false,
2037
+ error: null,
2038
+ experience,
2039
+ variant: null,
2040
+ audience: audience ? audience : null,
2041
+ profile,
2042
+ isPersonalized: false
2043
+ }));
2044
+ }
1917
2045
  return overrideResult(Object.assign(Object.assign({}, baseReturn), {
1918
2046
  status: 'success',
1919
2047
  loading: false,
1920
2048
  error: null,
1921
2049
  experience,
1922
2050
  variant,
1923
- variantIndex: index,
1924
- audience: experience.audience ? experience.audience : null,
2051
+ audience: audience ? audience : null,
1925
2052
  profile,
1926
2053
  isPersonalized: true
1927
2054
  }));
1928
2055
  };
1929
2056
 
1930
- const useJoinExperiment = () => {
1931
- const context = useExperimentsContext();
1932
- return context.joinExperiment;
1933
- };
1934
-
1935
- const ComponentMarker = /*#__PURE__*/forwardRef((_, ref) => {
1936
- const {
1937
- logger
1938
- } = useNinetailed();
1939
- const markerRef = useRef(null);
1940
- useEffect(() => {
1941
- // TODO: Create a better message
1942
- logger.debug('Using fallback mechanism to select component.');
1943
- }, [logger]);
1944
- useEffect(() => {
1945
- if (markerRef.current) {
1946
- const nextSibling = markerRef.current.nextSibling;
1947
- if (ref) {
1948
- if (typeof ref === 'function') {
1949
- ref(nextSibling);
1950
- } else {
1951
- ref.current = nextSibling;
1952
- }
1953
- }
1954
- }
1955
- }, []);
1956
- return jsx("div", {
1957
- className: "nt-cmp-marker",
1958
- style: {
1959
- display: 'none !important'
1960
- },
1961
- ref: markerRef
1962
- });
1963
- });
1964
-
1965
2057
  const DefaultExperienceLoadingComponent = _a => {
1966
2058
  var {
1967
2059
  component: Component,
@@ -2015,17 +2107,12 @@ const Experience = _a => {
2015
2107
  passthroughProps
2016
2108
  } = _a,
2017
2109
  baseline = __rest(_a, ["experiences", "component", "loadingComponent", "passthroughProps"]);
2018
- const {
2019
- observeElement,
2020
- unobserveElement
2021
- } = useNinetailed();
2022
2110
  // TODO we actually could hook into the experience hook here with the plugins
2023
2111
  const {
2024
2112
  status,
2025
2113
  hasVariants,
2026
2114
  experience,
2027
2115
  variant,
2028
- variantIndex,
2029
2116
  audience,
2030
2117
  isPersonalized,
2031
2118
  profile
@@ -2033,47 +2120,30 @@ const Experience = _a => {
2033
2120
  baseline,
2034
2121
  experiences
2035
2122
  });
2036
- const joinExperiment = useJoinExperiment();
2037
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2038
- // @ts-ignore
2039
- const isComponentForwardRef = isForwardRef(jsx(Component, {}));
2040
- const componentRef = useRef(null);
2041
- useEffect(() => {
2042
- if (status === 'success' && experience && profile) {
2043
- joinExperiment({
2044
- experiences,
2045
- experiment: experience,
2046
- profile
2047
- });
2048
- }
2049
- }, [status, experience, profile]);
2050
- useEffect(() => {
2051
- const componentElement = componentRef.current;
2052
- if (componentElement) {
2053
- observeElement({
2054
- element: componentElement,
2055
- experience,
2056
- audience,
2057
- variant,
2058
- variantIndex
2059
- });
2060
- }
2061
- return () => {
2062
- if (componentElement) {
2063
- unobserveElement(componentElement);
2064
- }
2065
- };
2066
- }, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience]);
2123
+ // const joinExperiment = useJoinExperiment();
2124
+ // useEffect(() => {
2125
+ // if (
2126
+ // status === 'success' &&
2127
+ // experience &&
2128
+ // experience.type === 'nt_experiment' &&
2129
+ // variant &&
2130
+ // profile
2131
+ // ) {
2132
+ // joinExperiment({
2133
+ // experiences,
2134
+ // experiment: experience,
2135
+ // variant: {
2136
+ // ...variant,
2137
+ // hidden: 'hidden' in variant ? variant.hidden : false,
2138
+ // },
2139
+ // profile,
2140
+ // });
2141
+ // }
2142
+ // }, [status, experience, variant, profile]);
2067
2143
  if (!hasVariants) {
2068
- return jsxs(Fragment, {
2069
- children: [!isComponentForwardRef && jsx(ComponentMarker, {
2070
- ref: componentRef
2071
- }, `marker-no-variants-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`), /*#__PURE__*/createElement$1(Component, Object.assign({}, passthroughProps, baseline, {
2072
- key: baseline.id
2073
- }, isComponentForwardRef ? {
2074
- ref: componentRef
2075
- } : {}))]
2076
- });
2144
+ return /*#__PURE__*/createElement$1(Component, Object.assign({}, passthroughProps, baseline, {
2145
+ key: baseline.id
2146
+ }));
2077
2147
  }
2078
2148
  if (status === 'loading') {
2079
2149
  return /*#__PURE__*/createElement$1(LoadingComponent, Object.assign({}, baseline, {
@@ -2083,27 +2153,50 @@ const Experience = _a => {
2083
2153
  component: Component
2084
2154
  }));
2085
2155
  }
2086
- const isVariantHidden = 'hidden' in variant && variant.hidden;
2087
- if (isVariantHidden) {
2088
- return jsx(ComponentMarker, {
2089
- ref: componentRef
2090
- }, `marker-hidden-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`);
2156
+ if (!experience) {
2157
+ return jsx(Component, Object.assign({}, passthroughProps, baseline, {
2158
+ ninetailed: {
2159
+ isPersonalized: false,
2160
+ audience: {
2161
+ id: 'baseline'
2162
+ }
2163
+ }
2164
+ }));
2091
2165
  }
2092
- return jsxs(Fragment, {
2093
- children: [!isComponentForwardRef && jsx(ComponentMarker, {
2094
- ref: componentRef
2095
- }, `marker-${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`), /*#__PURE__*/createElement$1(Component, Object.assign({}, Object.assign(Object.assign({}, passthroughProps), variant), {
2096
- key: `${(experience === null || experience === void 0 ? void 0 : experience.id) || 'baseline'}-${variant.id}`,
2166
+ if (!variant) {
2167
+ return jsx(TrackExperience, Object.assign({
2168
+ experience: experience,
2169
+ variant: baseline,
2170
+ // the profile is definitely defined, otherwise there wouldn't be an experience selected
2171
+ profile: profile
2172
+ }, {
2173
+ children: jsx(Component, Object.assign({}, passthroughProps, baseline, {
2174
+ ninetailed: {
2175
+ isPersonalized: false,
2176
+ audience: {
2177
+ id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2178
+ }
2179
+ }
2180
+ }))
2181
+ }), baseline.id);
2182
+ }
2183
+ const isVariantHidden = 'hidden' in variant && variant.hidden;
2184
+ return jsx(TrackExperience, Object.assign({
2185
+ experience: experience,
2186
+ variant: variant,
2187
+ // the profile is definitely defined, otherwise there wouldn't be an experience selected
2188
+ profile: profile
2189
+ }, {
2190
+ children: !isVariantHidden ? /*#__PURE__*/createElement$1(Component, Object.assign({}, Object.assign(Object.assign({}, passthroughProps), variant), {
2191
+ key: `${experience.id}-${variant.id}`,
2097
2192
  ninetailed: {
2098
2193
  isPersonalized,
2099
2194
  audience: {
2100
2195
  id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
2101
2196
  }
2102
2197
  }
2103
- }, isComponentForwardRef ? {
2104
- ref: componentRef
2105
- } : {}))]
2106
- });
2198
+ })) : null
2199
+ }));
2107
2200
  };
2108
2201
 
2109
2202
  const ESRContext = /*#__PURE__*/React.createContext(undefined);
@@ -2191,6 +2284,8 @@ const ESRLoadingComponent = _a => {
2191
2284
  }));
2192
2285
  };
2193
2286
 
2287
+ const ExperimentsContext = /*#__PURE__*/createContext(undefined);
2288
+
2194
2289
  const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
2195
2290
 
2196
2291
  const debounce = (fn, wait) => {
@@ -2206,15 +2301,13 @@ const debounce = (fn, wait) => {
2206
2301
  debouncedFn();
2207
2302
  };
2208
2303
  };
2209
- const useProvideJoinExperiment = ({
2210
- experiments,
2211
- maximumActiveExperiments: _maximumActiveExperiments = 1
2212
- }) => {
2304
+ // TODO: the majority of this code should be moved to the experience.js javascript package
2305
+ const useProvideJoinExperiment = _ => {
2213
2306
  const {
2214
2307
  identify
2215
2308
  } = useNinetailed();
2216
2309
  const joinExperimentIdentify = debounce(args => {
2217
- const traits = args.slice(0, _maximumActiveExperiments).reduce((traits, [experimentJoinTraits]) => {
2310
+ const traits = args.reduce((traits, [experimentJoinTraits]) => {
2218
2311
  return Object.assign(Object.assign({}, experimentJoinTraits), traits);
2219
2312
  }, {});
2220
2313
  identify('', traits);
@@ -2222,6 +2315,7 @@ const useProvideJoinExperiment = ({
2222
2315
  return useCallback(data => __awaiter(void 0, void 0, void 0, function* () {
2223
2316
  const {
2224
2317
  experiment,
2318
+ variant,
2225
2319
  profile
2226
2320
  } = data;
2227
2321
  const isExperiment = experiment.type === 'nt_experiment';
@@ -2229,17 +2323,17 @@ const useProvideJoinExperiment = ({
2229
2323
  logger.warn(`The experience ${experiment.id}, which you tried to join, is not an experiment.`);
2230
2324
  return;
2231
2325
  }
2232
- const activeExperiments = selectActiveExperiments(experiments, profile);
2233
- if (activeExperiments.length >= _maximumActiveExperiments) {
2234
- logger.warn(`The maximum number of active experiments (${_maximumActiveExperiments}) has been reached.`);
2326
+ if (!isExperienceSticky(experiment)) {
2327
+ logger.debug("Won't add experiment to traits, as it's not sticky.");
2235
2328
  return;
2236
2329
  }
2237
- if (activeExperiments.some(activeExperiment => activeExperiment.id === experiment.id)) {
2330
+ const activeExperimentIds = selectActiveExperimentIds(profile);
2331
+ if (activeExperimentIds.some(activeExperimentId => activeExperimentId === experiment.id)) {
2238
2332
  logger.debug(`The user is already part of experiment ${experiment.id}. Won't join again.`);
2239
2333
  return;
2240
2334
  }
2241
2335
  joinExperimentIdentify({
2242
- [`${EXPERIENCE_TRAIT_PREFIX}${experiment.id}`]: true
2336
+ [`${EXPERIENCE_TRAIT_PREFIX}${experiment.id}`]: variant.hidden ? 'hidden' : variant.id
2243
2337
  });
2244
2338
  logger.debug(`Sent event to join experiment ${experiment.id}.`);
2245
2339
  }), []);
@@ -2250,10 +2344,7 @@ const ExperimentsProvider = ({
2250
2344
  maximumActiveExperiments: _maximumActiveExperiments = 1,
2251
2345
  children
2252
2346
  }) => {
2253
- const joinExperiment = useProvideJoinExperiment({
2254
- experiments,
2255
- maximumActiveExperiments: _maximumActiveExperiments
2256
- });
2347
+ const joinExperiment = useProvideJoinExperiment();
2257
2348
  return jsx(ExperimentsContext.Provider, Object.assign({
2258
2349
  value: {
2259
2350
  experiments,
@@ -2264,42 +2355,71 @@ const ExperimentsProvider = ({
2264
2355
  }));
2265
2356
  };
2266
2357
 
2267
- const NinetailedProvider = ({
2268
- children,
2269
- clientId,
2270
- experiments: _experiments = [],
2271
- maximumActiveExperiments,
2272
- environment,
2273
- preview,
2274
- url,
2275
- profile,
2276
- locale,
2277
- requestTimeout,
2278
- plugins: _plugins = [],
2279
- onLog,
2280
- onError,
2281
- componentViewTrackingThreshold
2282
- }) => {
2283
- const ninetailed = useMemo(() => new Ninetailed({
2284
- clientId,
2285
- environment,
2286
- preview
2287
- }, {
2288
- url,
2289
- plugins: _plugins,
2290
- profile,
2291
- locale,
2292
- requestTimeout,
2293
- onLog,
2294
- onError,
2295
- componentViewTrackingThreshold
2296
- }), []);
2358
+ const useExperimentsContext = () => {
2359
+ const context = useContext(ExperimentsContext);
2360
+ if (context === undefined) {
2361
+ throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
2362
+ }
2363
+ return context;
2364
+ };
2365
+
2366
+ /**
2367
+ * @deprecated
2368
+ *
2369
+ * This will get removed in v5 of the SDK.
2370
+ */
2371
+ const useExperiments = () => {
2372
+ const context = useExperimentsContext();
2373
+ return {
2374
+ experiments: context.experiments
2375
+ };
2376
+ };
2377
+
2378
+ const useJoinExperiment = () => {
2379
+ const context = useExperimentsContext();
2380
+ return context.joinExperiment;
2381
+ };
2382
+
2383
+ const NinetailedProvider = props => {
2384
+ const ninetailed = useMemo(() => {
2385
+ if ('ninetailed' in props) {
2386
+ return props.ninetailed;
2387
+ }
2388
+ const {
2389
+ clientId,
2390
+ environment,
2391
+ preview,
2392
+ url,
2393
+ profile,
2394
+ locale,
2395
+ requestTimeout,
2396
+ plugins = [],
2397
+ onLog,
2398
+ onError
2399
+ } = props;
2400
+ return new Ninetailed({
2401
+ clientId,
2402
+ environment,
2403
+ preview
2404
+ }, {
2405
+ url,
2406
+ plugins,
2407
+ profile,
2408
+ locale,
2409
+ requestTimeout,
2410
+ onLog,
2411
+ onError
2412
+ });
2413
+ }, []);
2414
+ const {
2415
+ children
2416
+ } = props;
2297
2417
  return jsx(NinetailedContext.Provider, Object.assign({
2298
2418
  value: ninetailed
2299
2419
  }, {
2300
2420
  children: jsx(ExperimentsProvider, Object.assign({
2301
- experiments: _experiments,
2302
- maximumActiveExperiments: maximumActiveExperiments
2421
+ experiments: [],
2422
+ maximumActiveExperiments: 10000
2303
2423
  }, {
2304
2424
  children: children
2305
2425
  }))
@@ -2431,4 +2551,4 @@ const MergeTag = ({
2431
2551
  });
2432
2552
  };
2433
2553
 
2434
- export { DefaultExperienceLoadingComponent, ESRLoadingComponent, ESRProvider, Experience, ExperimentsProvider, MergeTag, NinetailedProvider, Personalize, TrackHasSeenComponent, useExperience, useExperiments, useJoinExperiment, useNinetailed, usePersonalize, useProfile };
2554
+ export { DefaultExperienceLoadingComponent, ESRLoadingComponent, ESRProvider, Experience, ExperimentsProvider, MergeTag, NinetailedProvider, Personalize, TrackExperience, TrackHasSeenComponent, useExperience, useExperiments, useJoinExperiment, useNinetailed, usePersonalize, useProfile };