@ninetailed/experience.js 3.0.1-beta.4 → 3.0.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +4343 -0
- package/{index.esm.js → index.js} +1605 -1564
- package/lib/Ninetailed.d.ts +14 -60
- package/lib/analytics/constants.d.ts +2 -0
- package/lib/analytics/get-analytics-plugin.d.ts +8 -12
- package/lib/analytics/index.d.ts +1 -0
- package/lib/experience/isExperienceMatch.d.ts +3 -3
- package/lib/experience/selectActiveExperiments.d.ts +2 -2
- package/lib/experience/selectBaselineWithVariants.d.ts +2 -2
- package/lib/experience/selectDistribution.d.ts +4 -4
- package/lib/experience/selectEligibleExperiences.d.ts +5 -5
- package/lib/experience/selectExperience.d.ts +5 -5
- package/lib/experience/selectHasVariants.d.ts +2 -2
- package/lib/experience/selectVariant.d.ts +4 -4
- package/lib/experience/selectVariants.d.ts +2 -2
- package/lib/experience/types/Baseline.d.ts +2 -3
- package/lib/experience/types/BaselineWithVariants.d.ts +5 -4
- package/lib/experience/types/ExperienceConfiguration.d.ts +3 -2
- package/lib/experience/types/Reference.d.ts +3 -0
- package/lib/experience/types/VariantRef.d.ts +4 -0
- package/lib/experience/types/index.d.ts +2 -1
- package/lib/experience/utils.d.ts +2 -2
- package/lib/types.d.ts +37 -1
- package/package.json +10 -13
- package/index.umd.js +0 -4253
- package/lib/experience/types/Variant.d.ts +0 -4
package/index.umd.js
DELETED
|
@@ -1,4253 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash/unionBy'), require('@ninetailed/experience.js-shared'), require('analytics'), require('lodash/flatten'), require('lodash/find'), require('lodash/includes'), require('lodash/pickBy'), require('murmurhash-js')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash/unionBy', '@ninetailed/experience.js-shared', 'analytics', 'lodash/flatten', 'lodash/find', 'lodash/includes', 'lodash/pickBy', 'murmurhash-js'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Javascript = {}, global.unionBy, global.experience_jsShared, global.Analytics, global.flatten, global.find, global.includes, global.pickBy, global.murmurhashJs));
|
|
5
|
-
})(this, (function (exports, unionBy, experience_jsShared, Analytics, flatten, find, includes, pickBy, murmurhashJs) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var unionBy__default = /*#__PURE__*/_interopDefaultLegacy(unionBy);
|
|
10
|
-
var Analytics__default = /*#__PURE__*/_interopDefaultLegacy(Analytics);
|
|
11
|
-
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
12
|
-
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
13
|
-
var includes__default = /*#__PURE__*/_interopDefaultLegacy(includes);
|
|
14
|
-
var pickBy__default = /*#__PURE__*/_interopDefaultLegacy(pickBy);
|
|
15
|
-
|
|
16
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17
|
-
|
|
18
|
-
var check = function (it) {
|
|
19
|
-
return it && it.Math == Math && it;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
23
|
-
var global$I =
|
|
24
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
25
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
26
|
-
check(typeof window == 'object' && window) ||
|
|
27
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
28
|
-
check(typeof self == 'object' && self) ||
|
|
29
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
30
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
31
|
-
(function () { return this; })() || Function('return this')();
|
|
32
|
-
|
|
33
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
34
|
-
|
|
35
|
-
var fails$i = function (exec) {
|
|
36
|
-
try {
|
|
37
|
-
return !!exec();
|
|
38
|
-
} catch (error) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var fails$h = fails$i;
|
|
44
|
-
|
|
45
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
46
|
-
var descriptors = !fails$h(function () {
|
|
47
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
48
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var fails$g = fails$i;
|
|
52
|
-
|
|
53
|
-
var functionBindNative = !fails$g(function () {
|
|
54
|
-
var test = (function () { /* empty */ }).bind();
|
|
55
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
56
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var NATIVE_BIND$3 = functionBindNative;
|
|
60
|
-
|
|
61
|
-
var call$e = Function.prototype.call;
|
|
62
|
-
|
|
63
|
-
var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
|
|
64
|
-
return call$e.apply(call$e, arguments);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var objectPropertyIsEnumerable = {};
|
|
68
|
-
|
|
69
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
70
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
71
|
-
var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
|
|
72
|
-
|
|
73
|
-
// Nashorn ~ JDK8 bug
|
|
74
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$3 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
75
|
-
|
|
76
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
77
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
78
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
79
|
-
var descriptor = getOwnPropertyDescriptor$3(this, V);
|
|
80
|
-
return !!descriptor && descriptor.enumerable;
|
|
81
|
-
} : $propertyIsEnumerable;
|
|
82
|
-
|
|
83
|
-
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
84
|
-
return {
|
|
85
|
-
enumerable: !(bitmap & 1),
|
|
86
|
-
configurable: !(bitmap & 2),
|
|
87
|
-
writable: !(bitmap & 4),
|
|
88
|
-
value: value
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
var NATIVE_BIND$2 = functionBindNative;
|
|
93
|
-
|
|
94
|
-
var FunctionPrototype$2 = Function.prototype;
|
|
95
|
-
var bind$5 = FunctionPrototype$2.bind;
|
|
96
|
-
var call$d = FunctionPrototype$2.call;
|
|
97
|
-
var uncurryThis$o = NATIVE_BIND$2 && bind$5.bind(call$d, call$d);
|
|
98
|
-
|
|
99
|
-
var functionUncurryThis = NATIVE_BIND$2 ? function (fn) {
|
|
100
|
-
return fn && uncurryThis$o(fn);
|
|
101
|
-
} : function (fn) {
|
|
102
|
-
return fn && function () {
|
|
103
|
-
return call$d.apply(fn, arguments);
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
var uncurryThis$n = functionUncurryThis;
|
|
108
|
-
|
|
109
|
-
var toString$a = uncurryThis$n({}.toString);
|
|
110
|
-
var stringSlice$6 = uncurryThis$n(''.slice);
|
|
111
|
-
|
|
112
|
-
var classofRaw$1 = function (it) {
|
|
113
|
-
return stringSlice$6(toString$a(it), 8, -1);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var global$H = global$I;
|
|
117
|
-
var uncurryThis$m = functionUncurryThis;
|
|
118
|
-
var fails$f = fails$i;
|
|
119
|
-
var classof$7 = classofRaw$1;
|
|
120
|
-
|
|
121
|
-
var Object$4 = global$H.Object;
|
|
122
|
-
var split = uncurryThis$m(''.split);
|
|
123
|
-
|
|
124
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
125
|
-
var indexedObject = fails$f(function () {
|
|
126
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
127
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
128
|
-
return !Object$4('z').propertyIsEnumerable(0);
|
|
129
|
-
}) ? function (it) {
|
|
130
|
-
return classof$7(it) == 'String' ? split(it, '') : Object$4(it);
|
|
131
|
-
} : Object$4;
|
|
132
|
-
|
|
133
|
-
var global$G = global$I;
|
|
134
|
-
|
|
135
|
-
var TypeError$h = global$G.TypeError;
|
|
136
|
-
|
|
137
|
-
// `RequireObjectCoercible` abstract operation
|
|
138
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
139
|
-
var requireObjectCoercible$8 = function (it) {
|
|
140
|
-
if (it == undefined) throw TypeError$h("Can't call method on " + it);
|
|
141
|
-
return it;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
145
|
-
var IndexedObject$2 = indexedObject;
|
|
146
|
-
var requireObjectCoercible$7 = requireObjectCoercible$8;
|
|
147
|
-
|
|
148
|
-
var toIndexedObject$4 = function (it) {
|
|
149
|
-
return IndexedObject$2(requireObjectCoercible$7(it));
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
// `IsCallable` abstract operation
|
|
153
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
154
|
-
var isCallable$g = function (argument) {
|
|
155
|
-
return typeof argument == 'function';
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
var isCallable$f = isCallable$g;
|
|
159
|
-
|
|
160
|
-
var isObject$8 = function (it) {
|
|
161
|
-
return typeof it == 'object' ? it !== null : isCallable$f(it);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
var global$F = global$I;
|
|
165
|
-
var isCallable$e = isCallable$g;
|
|
166
|
-
|
|
167
|
-
var aFunction = function (argument) {
|
|
168
|
-
return isCallable$e(argument) ? argument : undefined;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
var getBuiltIn$7 = function (namespace, method) {
|
|
172
|
-
return arguments.length < 2 ? aFunction(global$F[namespace]) : global$F[namespace] && global$F[namespace][method];
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
var uncurryThis$l = functionUncurryThis;
|
|
176
|
-
|
|
177
|
-
var objectIsPrototypeOf = uncurryThis$l({}.isPrototypeOf);
|
|
178
|
-
|
|
179
|
-
var getBuiltIn$6 = getBuiltIn$7;
|
|
180
|
-
|
|
181
|
-
var engineUserAgent = getBuiltIn$6('navigator', 'userAgent') || '';
|
|
182
|
-
|
|
183
|
-
var global$E = global$I;
|
|
184
|
-
var userAgent$3 = engineUserAgent;
|
|
185
|
-
|
|
186
|
-
var process$3 = global$E.process;
|
|
187
|
-
var Deno = global$E.Deno;
|
|
188
|
-
var versions = process$3 && process$3.versions || Deno && Deno.version;
|
|
189
|
-
var v8 = versions && versions.v8;
|
|
190
|
-
var match, version;
|
|
191
|
-
|
|
192
|
-
if (v8) {
|
|
193
|
-
match = v8.split('.');
|
|
194
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
195
|
-
// but their correct versions are not interesting for us
|
|
196
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
200
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
201
|
-
if (!version && userAgent$3) {
|
|
202
|
-
match = userAgent$3.match(/Edge\/(\d+)/);
|
|
203
|
-
if (!match || match[1] >= 74) {
|
|
204
|
-
match = userAgent$3.match(/Chrome\/(\d+)/);
|
|
205
|
-
if (match) version = +match[1];
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
var engineV8Version = version;
|
|
210
|
-
|
|
211
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
212
|
-
|
|
213
|
-
var V8_VERSION$1 = engineV8Version;
|
|
214
|
-
var fails$e = fails$i;
|
|
215
|
-
|
|
216
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
217
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$e(function () {
|
|
218
|
-
var symbol = Symbol();
|
|
219
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
220
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
221
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
222
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
223
|
-
!Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
227
|
-
|
|
228
|
-
var NATIVE_SYMBOL$1 = nativeSymbol;
|
|
229
|
-
|
|
230
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
231
|
-
&& !Symbol.sham
|
|
232
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
233
|
-
|
|
234
|
-
var global$D = global$I;
|
|
235
|
-
var getBuiltIn$5 = getBuiltIn$7;
|
|
236
|
-
var isCallable$d = isCallable$g;
|
|
237
|
-
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
238
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
239
|
-
|
|
240
|
-
var Object$3 = global$D.Object;
|
|
241
|
-
|
|
242
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
243
|
-
return typeof it == 'symbol';
|
|
244
|
-
} : function (it) {
|
|
245
|
-
var $Symbol = getBuiltIn$5('Symbol');
|
|
246
|
-
return isCallable$d($Symbol) && isPrototypeOf$2($Symbol.prototype, Object$3(it));
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
var global$C = global$I;
|
|
250
|
-
|
|
251
|
-
var String$5 = global$C.String;
|
|
252
|
-
|
|
253
|
-
var tryToString$4 = function (argument) {
|
|
254
|
-
try {
|
|
255
|
-
return String$5(argument);
|
|
256
|
-
} catch (error) {
|
|
257
|
-
return 'Object';
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
var global$B = global$I;
|
|
262
|
-
var isCallable$c = isCallable$g;
|
|
263
|
-
var tryToString$3 = tryToString$4;
|
|
264
|
-
|
|
265
|
-
var TypeError$g = global$B.TypeError;
|
|
266
|
-
|
|
267
|
-
// `Assert: IsCallable(argument) is true`
|
|
268
|
-
var aCallable$6 = function (argument) {
|
|
269
|
-
if (isCallable$c(argument)) return argument;
|
|
270
|
-
throw TypeError$g(tryToString$3(argument) + ' is not a function');
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
var aCallable$5 = aCallable$6;
|
|
274
|
-
|
|
275
|
-
// `GetMethod` abstract operation
|
|
276
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
277
|
-
var getMethod$5 = function (V, P) {
|
|
278
|
-
var func = V[P];
|
|
279
|
-
return func == null ? undefined : aCallable$5(func);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var global$A = global$I;
|
|
283
|
-
var call$c = functionCall;
|
|
284
|
-
var isCallable$b = isCallable$g;
|
|
285
|
-
var isObject$7 = isObject$8;
|
|
286
|
-
|
|
287
|
-
var TypeError$f = global$A.TypeError;
|
|
288
|
-
|
|
289
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
290
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
291
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
292
|
-
var fn, val;
|
|
293
|
-
if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
|
|
294
|
-
if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$c(fn, input))) return val;
|
|
295
|
-
if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
|
|
296
|
-
throw TypeError$f("Can't convert object to primitive value");
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
var shared$4 = {exports: {}};
|
|
300
|
-
|
|
301
|
-
var global$z = global$I;
|
|
302
|
-
|
|
303
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
304
|
-
var defineProperty$2 = Object.defineProperty;
|
|
305
|
-
|
|
306
|
-
var setGlobal$3 = function (key, value) {
|
|
307
|
-
try {
|
|
308
|
-
defineProperty$2(global$z, key, { value: value, configurable: true, writable: true });
|
|
309
|
-
} catch (error) {
|
|
310
|
-
global$z[key] = value;
|
|
311
|
-
} return value;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
var global$y = global$I;
|
|
315
|
-
var setGlobal$2 = setGlobal$3;
|
|
316
|
-
|
|
317
|
-
var SHARED = '__core-js_shared__';
|
|
318
|
-
var store$3 = global$y[SHARED] || setGlobal$2(SHARED, {});
|
|
319
|
-
|
|
320
|
-
var sharedStore = store$3;
|
|
321
|
-
|
|
322
|
-
var store$2 = sharedStore;
|
|
323
|
-
|
|
324
|
-
(shared$4.exports = function (key, value) {
|
|
325
|
-
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
326
|
-
})('versions', []).push({
|
|
327
|
-
version: '3.21.1',
|
|
328
|
-
mode: 'global',
|
|
329
|
-
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
330
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
|
|
331
|
-
source: 'https://github.com/zloirock/core-js'
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
var global$x = global$I;
|
|
335
|
-
var requireObjectCoercible$6 = requireObjectCoercible$8;
|
|
336
|
-
|
|
337
|
-
var Object$2 = global$x.Object;
|
|
338
|
-
|
|
339
|
-
// `ToObject` abstract operation
|
|
340
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
341
|
-
var toObject$4 = function (argument) {
|
|
342
|
-
return Object$2(requireObjectCoercible$6(argument));
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
var uncurryThis$k = functionUncurryThis;
|
|
346
|
-
var toObject$3 = toObject$4;
|
|
347
|
-
|
|
348
|
-
var hasOwnProperty = uncurryThis$k({}.hasOwnProperty);
|
|
349
|
-
|
|
350
|
-
// `HasOwnProperty` abstract operation
|
|
351
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
352
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
353
|
-
return hasOwnProperty(toObject$3(it), key);
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
var uncurryThis$j = functionUncurryThis;
|
|
357
|
-
|
|
358
|
-
var id = 0;
|
|
359
|
-
var postfix = Math.random();
|
|
360
|
-
var toString$9 = uncurryThis$j(1.0.toString);
|
|
361
|
-
|
|
362
|
-
var uid$2 = function (key) {
|
|
363
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$9(++id + postfix, 36);
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
var global$w = global$I;
|
|
367
|
-
var shared$3 = shared$4.exports;
|
|
368
|
-
var hasOwn$8 = hasOwnProperty_1;
|
|
369
|
-
var uid$1 = uid$2;
|
|
370
|
-
var NATIVE_SYMBOL = nativeSymbol;
|
|
371
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
372
|
-
|
|
373
|
-
var WellKnownSymbolsStore = shared$3('wks');
|
|
374
|
-
var Symbol$2 = global$w.Symbol;
|
|
375
|
-
var symbolFor = Symbol$2 && Symbol$2['for'];
|
|
376
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
|
|
377
|
-
|
|
378
|
-
var wellKnownSymbol$e = function (name) {
|
|
379
|
-
if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
380
|
-
var description = 'Symbol.' + name;
|
|
381
|
-
if (NATIVE_SYMBOL && hasOwn$8(Symbol$2, name)) {
|
|
382
|
-
WellKnownSymbolsStore[name] = Symbol$2[name];
|
|
383
|
-
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
384
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
385
|
-
} else {
|
|
386
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
387
|
-
}
|
|
388
|
-
} return WellKnownSymbolsStore[name];
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
var global$v = global$I;
|
|
392
|
-
var call$b = functionCall;
|
|
393
|
-
var isObject$6 = isObject$8;
|
|
394
|
-
var isSymbol$1 = isSymbol$2;
|
|
395
|
-
var getMethod$4 = getMethod$5;
|
|
396
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
397
|
-
var wellKnownSymbol$d = wellKnownSymbol$e;
|
|
398
|
-
|
|
399
|
-
var TypeError$e = global$v.TypeError;
|
|
400
|
-
var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
|
|
401
|
-
|
|
402
|
-
// `ToPrimitive` abstract operation
|
|
403
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
404
|
-
var toPrimitive$1 = function (input, pref) {
|
|
405
|
-
if (!isObject$6(input) || isSymbol$1(input)) return input;
|
|
406
|
-
var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
|
|
407
|
-
var result;
|
|
408
|
-
if (exoticToPrim) {
|
|
409
|
-
if (pref === undefined) pref = 'default';
|
|
410
|
-
result = call$b(exoticToPrim, input, pref);
|
|
411
|
-
if (!isObject$6(result) || isSymbol$1(result)) return result;
|
|
412
|
-
throw TypeError$e("Can't convert object to primitive value");
|
|
413
|
-
}
|
|
414
|
-
if (pref === undefined) pref = 'number';
|
|
415
|
-
return ordinaryToPrimitive(input, pref);
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
var toPrimitive = toPrimitive$1;
|
|
419
|
-
var isSymbol = isSymbol$2;
|
|
420
|
-
|
|
421
|
-
// `ToPropertyKey` abstract operation
|
|
422
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
423
|
-
var toPropertyKey$3 = function (argument) {
|
|
424
|
-
var key = toPrimitive(argument, 'string');
|
|
425
|
-
return isSymbol(key) ? key : key + '';
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
var global$u = global$I;
|
|
429
|
-
var isObject$5 = isObject$8;
|
|
430
|
-
|
|
431
|
-
var document$3 = global$u.document;
|
|
432
|
-
// typeof document.createElement is 'object' in old IE
|
|
433
|
-
var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
|
|
434
|
-
|
|
435
|
-
var documentCreateElement$1 = function (it) {
|
|
436
|
-
return EXISTS$1 ? document$3.createElement(it) : {};
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
var DESCRIPTORS$8 = descriptors;
|
|
440
|
-
var fails$d = fails$i;
|
|
441
|
-
var createElement$1 = documentCreateElement$1;
|
|
442
|
-
|
|
443
|
-
// Thanks to IE8 for its funny defineProperty
|
|
444
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$d(function () {
|
|
445
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
446
|
-
return Object.defineProperty(createElement$1('div'), 'a', {
|
|
447
|
-
get: function () { return 7; }
|
|
448
|
-
}).a != 7;
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
var DESCRIPTORS$7 = descriptors;
|
|
452
|
-
var call$a = functionCall;
|
|
453
|
-
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
454
|
-
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
|
455
|
-
var toIndexedObject$3 = toIndexedObject$4;
|
|
456
|
-
var toPropertyKey$2 = toPropertyKey$3;
|
|
457
|
-
var hasOwn$7 = hasOwnProperty_1;
|
|
458
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
459
|
-
|
|
460
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
461
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
462
|
-
|
|
463
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
464
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
465
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
466
|
-
O = toIndexedObject$3(O);
|
|
467
|
-
P = toPropertyKey$2(P);
|
|
468
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
469
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
470
|
-
} catch (error) { /* empty */ }
|
|
471
|
-
if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
var objectDefineProperty = {};
|
|
475
|
-
|
|
476
|
-
var DESCRIPTORS$6 = descriptors;
|
|
477
|
-
var fails$c = fails$i;
|
|
478
|
-
|
|
479
|
-
// V8 ~ Chrome 36-
|
|
480
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
481
|
-
var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$c(function () {
|
|
482
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
483
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
484
|
-
value: 42,
|
|
485
|
-
writable: false
|
|
486
|
-
}).prototype != 42;
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
var global$t = global$I;
|
|
490
|
-
var isObject$4 = isObject$8;
|
|
491
|
-
|
|
492
|
-
var String$4 = global$t.String;
|
|
493
|
-
var TypeError$d = global$t.TypeError;
|
|
494
|
-
|
|
495
|
-
// `Assert: Type(argument) is Object`
|
|
496
|
-
var anObject$e = function (argument) {
|
|
497
|
-
if (isObject$4(argument)) return argument;
|
|
498
|
-
throw TypeError$d(String$4(argument) + ' is not an object');
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
var global$s = global$I;
|
|
502
|
-
var DESCRIPTORS$5 = descriptors;
|
|
503
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
504
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
505
|
-
var anObject$d = anObject$e;
|
|
506
|
-
var toPropertyKey$1 = toPropertyKey$3;
|
|
507
|
-
|
|
508
|
-
var TypeError$c = global$s.TypeError;
|
|
509
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
510
|
-
var $defineProperty = Object.defineProperty;
|
|
511
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
512
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
513
|
-
var ENUMERABLE = 'enumerable';
|
|
514
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
515
|
-
var WRITABLE = 'writable';
|
|
516
|
-
|
|
517
|
-
// `Object.defineProperty` method
|
|
518
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
519
|
-
objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
520
|
-
anObject$d(O);
|
|
521
|
-
P = toPropertyKey$1(P);
|
|
522
|
-
anObject$d(Attributes);
|
|
523
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
524
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
525
|
-
if (current && current[WRITABLE]) {
|
|
526
|
-
O[P] = Attributes.value;
|
|
527
|
-
Attributes = {
|
|
528
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
529
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
530
|
-
writable: false
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
} return $defineProperty(O, P, Attributes);
|
|
534
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
535
|
-
anObject$d(O);
|
|
536
|
-
P = toPropertyKey$1(P);
|
|
537
|
-
anObject$d(Attributes);
|
|
538
|
-
if (IE8_DOM_DEFINE) try {
|
|
539
|
-
return $defineProperty(O, P, Attributes);
|
|
540
|
-
} catch (error) { /* empty */ }
|
|
541
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError$c('Accessors not supported');
|
|
542
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
543
|
-
return O;
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
var DESCRIPTORS$4 = descriptors;
|
|
547
|
-
var definePropertyModule$4 = objectDefineProperty;
|
|
548
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
549
|
-
|
|
550
|
-
var createNonEnumerableProperty$4 = DESCRIPTORS$4 ? function (object, key, value) {
|
|
551
|
-
return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
|
|
552
|
-
} : function (object, key, value) {
|
|
553
|
-
object[key] = value;
|
|
554
|
-
return object;
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
var redefine$4 = {exports: {}};
|
|
558
|
-
|
|
559
|
-
var uncurryThis$i = functionUncurryThis;
|
|
560
|
-
var isCallable$a = isCallable$g;
|
|
561
|
-
var store$1 = sharedStore;
|
|
562
|
-
|
|
563
|
-
var functionToString = uncurryThis$i(Function.toString);
|
|
564
|
-
|
|
565
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
566
|
-
if (!isCallable$a(store$1.inspectSource)) {
|
|
567
|
-
store$1.inspectSource = function (it) {
|
|
568
|
-
return functionToString(it);
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
var inspectSource$4 = store$1.inspectSource;
|
|
573
|
-
|
|
574
|
-
var global$r = global$I;
|
|
575
|
-
var isCallable$9 = isCallable$g;
|
|
576
|
-
var inspectSource$3 = inspectSource$4;
|
|
577
|
-
|
|
578
|
-
var WeakMap$1 = global$r.WeakMap;
|
|
579
|
-
|
|
580
|
-
var nativeWeakMap = isCallable$9(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
|
|
581
|
-
|
|
582
|
-
var shared$2 = shared$4.exports;
|
|
583
|
-
var uid = uid$2;
|
|
584
|
-
|
|
585
|
-
var keys = shared$2('keys');
|
|
586
|
-
|
|
587
|
-
var sharedKey$2 = function (key) {
|
|
588
|
-
return keys[key] || (keys[key] = uid(key));
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
var hiddenKeys$4 = {};
|
|
592
|
-
|
|
593
|
-
var NATIVE_WEAK_MAP = nativeWeakMap;
|
|
594
|
-
var global$q = global$I;
|
|
595
|
-
var uncurryThis$h = functionUncurryThis;
|
|
596
|
-
var isObject$3 = isObject$8;
|
|
597
|
-
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
598
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
599
|
-
var shared$1 = sharedStore;
|
|
600
|
-
var sharedKey$1 = sharedKey$2;
|
|
601
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
602
|
-
|
|
603
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
604
|
-
var TypeError$b = global$q.TypeError;
|
|
605
|
-
var WeakMap = global$q.WeakMap;
|
|
606
|
-
var set$1, get, has;
|
|
607
|
-
|
|
608
|
-
var enforce = function (it) {
|
|
609
|
-
return has(it) ? get(it) : set$1(it, {});
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
var getterFor = function (TYPE) {
|
|
613
|
-
return function (it) {
|
|
614
|
-
var state;
|
|
615
|
-
if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
|
|
616
|
-
throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
|
|
617
|
-
} return state;
|
|
618
|
-
};
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
622
|
-
var store = shared$1.state || (shared$1.state = new WeakMap());
|
|
623
|
-
var wmget = uncurryThis$h(store.get);
|
|
624
|
-
var wmhas = uncurryThis$h(store.has);
|
|
625
|
-
var wmset = uncurryThis$h(store.set);
|
|
626
|
-
set$1 = function (it, metadata) {
|
|
627
|
-
if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
|
|
628
|
-
metadata.facade = it;
|
|
629
|
-
wmset(store, it, metadata);
|
|
630
|
-
return metadata;
|
|
631
|
-
};
|
|
632
|
-
get = function (it) {
|
|
633
|
-
return wmget(store, it) || {};
|
|
634
|
-
};
|
|
635
|
-
has = function (it) {
|
|
636
|
-
return wmhas(store, it);
|
|
637
|
-
};
|
|
638
|
-
} else {
|
|
639
|
-
var STATE = sharedKey$1('state');
|
|
640
|
-
hiddenKeys$3[STATE] = true;
|
|
641
|
-
set$1 = function (it, metadata) {
|
|
642
|
-
if (hasOwn$6(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
|
|
643
|
-
metadata.facade = it;
|
|
644
|
-
createNonEnumerableProperty$3(it, STATE, metadata);
|
|
645
|
-
return metadata;
|
|
646
|
-
};
|
|
647
|
-
get = function (it) {
|
|
648
|
-
return hasOwn$6(it, STATE) ? it[STATE] : {};
|
|
649
|
-
};
|
|
650
|
-
has = function (it) {
|
|
651
|
-
return hasOwn$6(it, STATE);
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
var internalState = {
|
|
656
|
-
set: set$1,
|
|
657
|
-
get: get,
|
|
658
|
-
has: has,
|
|
659
|
-
enforce: enforce,
|
|
660
|
-
getterFor: getterFor
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
var DESCRIPTORS$3 = descriptors;
|
|
664
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
665
|
-
|
|
666
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
667
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
668
|
-
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
|
669
|
-
|
|
670
|
-
var EXISTS = hasOwn$5(FunctionPrototype$1, 'name');
|
|
671
|
-
// additional protection from minified / mangled / dropped function names
|
|
672
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
673
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
674
|
-
|
|
675
|
-
var functionName = {
|
|
676
|
-
EXISTS: EXISTS,
|
|
677
|
-
PROPER: PROPER,
|
|
678
|
-
CONFIGURABLE: CONFIGURABLE
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
var global$p = global$I;
|
|
682
|
-
var isCallable$8 = isCallable$g;
|
|
683
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
684
|
-
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
685
|
-
var setGlobal$1 = setGlobal$3;
|
|
686
|
-
var inspectSource$2 = inspectSource$4;
|
|
687
|
-
var InternalStateModule$1 = internalState;
|
|
688
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
689
|
-
|
|
690
|
-
var getInternalState$2 = InternalStateModule$1.get;
|
|
691
|
-
var enforceInternalState = InternalStateModule$1.enforce;
|
|
692
|
-
var TEMPLATE = String(String).split('String');
|
|
693
|
-
|
|
694
|
-
(redefine$4.exports = function (O, key, value, options) {
|
|
695
|
-
var unsafe = options ? !!options.unsafe : false;
|
|
696
|
-
var simple = options ? !!options.enumerable : false;
|
|
697
|
-
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
698
|
-
var name = options && options.name !== undefined ? options.name : key;
|
|
699
|
-
var state;
|
|
700
|
-
if (isCallable$8(value)) {
|
|
701
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
702
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
703
|
-
}
|
|
704
|
-
if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
705
|
-
createNonEnumerableProperty$2(value, 'name', name);
|
|
706
|
-
}
|
|
707
|
-
state = enforceInternalState(value);
|
|
708
|
-
if (!state.source) {
|
|
709
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
if (O === global$p) {
|
|
713
|
-
if (simple) O[key] = value;
|
|
714
|
-
else setGlobal$1(key, value);
|
|
715
|
-
return;
|
|
716
|
-
} else if (!unsafe) {
|
|
717
|
-
delete O[key];
|
|
718
|
-
} else if (!noTargetGet && O[key]) {
|
|
719
|
-
simple = true;
|
|
720
|
-
}
|
|
721
|
-
if (simple) O[key] = value;
|
|
722
|
-
else createNonEnumerableProperty$2(O, key, value);
|
|
723
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
724
|
-
})(Function.prototype, 'toString', function toString() {
|
|
725
|
-
return isCallable$8(this) && getInternalState$2(this).source || inspectSource$2(this);
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
var objectGetOwnPropertyNames = {};
|
|
729
|
-
|
|
730
|
-
var ceil = Math.ceil;
|
|
731
|
-
var floor$1 = Math.floor;
|
|
732
|
-
|
|
733
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
734
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
735
|
-
var toIntegerOrInfinity$4 = function (argument) {
|
|
736
|
-
var number = +argument;
|
|
737
|
-
// eslint-disable-next-line no-self-compare -- safe
|
|
738
|
-
return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
|
|
739
|
-
};
|
|
740
|
-
|
|
741
|
-
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
|
742
|
-
|
|
743
|
-
var max$2 = Math.max;
|
|
744
|
-
var min$4 = Math.min;
|
|
745
|
-
|
|
746
|
-
// Helper for a popular repeating case of the spec:
|
|
747
|
-
// Let integer be ? ToInteger(index).
|
|
748
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
749
|
-
var toAbsoluteIndex$2 = function (index, length) {
|
|
750
|
-
var integer = toIntegerOrInfinity$3(index);
|
|
751
|
-
return integer < 0 ? max$2(integer + length, 0) : min$4(integer, length);
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
|
755
|
-
|
|
756
|
-
var min$3 = Math.min;
|
|
757
|
-
|
|
758
|
-
// `ToLength` abstract operation
|
|
759
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
760
|
-
var toLength$4 = function (argument) {
|
|
761
|
-
return argument > 0 ? min$3(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
var toLength$3 = toLength$4;
|
|
765
|
-
|
|
766
|
-
// `LengthOfArrayLike` abstract operation
|
|
767
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
768
|
-
var lengthOfArrayLike$4 = function (obj) {
|
|
769
|
-
return toLength$3(obj.length);
|
|
770
|
-
};
|
|
771
|
-
|
|
772
|
-
var toIndexedObject$2 = toIndexedObject$4;
|
|
773
|
-
var toAbsoluteIndex$1 = toAbsoluteIndex$2;
|
|
774
|
-
var lengthOfArrayLike$3 = lengthOfArrayLike$4;
|
|
775
|
-
|
|
776
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
777
|
-
var createMethod$3 = function (IS_INCLUDES) {
|
|
778
|
-
return function ($this, el, fromIndex) {
|
|
779
|
-
var O = toIndexedObject$2($this);
|
|
780
|
-
var length = lengthOfArrayLike$3(O);
|
|
781
|
-
var index = toAbsoluteIndex$1(fromIndex, length);
|
|
782
|
-
var value;
|
|
783
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
784
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
785
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
786
|
-
value = O[index++];
|
|
787
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
788
|
-
if (value != value) return true;
|
|
789
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
790
|
-
} else for (;length > index; index++) {
|
|
791
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
792
|
-
} return !IS_INCLUDES && -1;
|
|
793
|
-
};
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
var arrayIncludes = {
|
|
797
|
-
// `Array.prototype.includes` method
|
|
798
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
799
|
-
includes: createMethod$3(true),
|
|
800
|
-
// `Array.prototype.indexOf` method
|
|
801
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
802
|
-
indexOf: createMethod$3(false)
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
var uncurryThis$g = functionUncurryThis;
|
|
806
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
807
|
-
var toIndexedObject$1 = toIndexedObject$4;
|
|
808
|
-
var indexOf$1 = arrayIncludes.indexOf;
|
|
809
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
810
|
-
|
|
811
|
-
var push$2 = uncurryThis$g([].push);
|
|
812
|
-
|
|
813
|
-
var objectKeysInternal = function (object, names) {
|
|
814
|
-
var O = toIndexedObject$1(object);
|
|
815
|
-
var i = 0;
|
|
816
|
-
var result = [];
|
|
817
|
-
var key;
|
|
818
|
-
for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$2(result, key);
|
|
819
|
-
// Don't enum bug & hidden keys
|
|
820
|
-
while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
|
|
821
|
-
~indexOf$1(result, key) || push$2(result, key);
|
|
822
|
-
}
|
|
823
|
-
return result;
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
// IE8- don't enum bug keys
|
|
827
|
-
var enumBugKeys$3 = [
|
|
828
|
-
'constructor',
|
|
829
|
-
'hasOwnProperty',
|
|
830
|
-
'isPrototypeOf',
|
|
831
|
-
'propertyIsEnumerable',
|
|
832
|
-
'toLocaleString',
|
|
833
|
-
'toString',
|
|
834
|
-
'valueOf'
|
|
835
|
-
];
|
|
836
|
-
|
|
837
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
838
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
839
|
-
|
|
840
|
-
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
841
|
-
|
|
842
|
-
// `Object.getOwnPropertyNames` method
|
|
843
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
844
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
845
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
846
|
-
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
var objectGetOwnPropertySymbols = {};
|
|
850
|
-
|
|
851
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
852
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
853
|
-
|
|
854
|
-
var getBuiltIn$4 = getBuiltIn$7;
|
|
855
|
-
var uncurryThis$f = functionUncurryThis;
|
|
856
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
857
|
-
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
858
|
-
var anObject$c = anObject$e;
|
|
859
|
-
|
|
860
|
-
var concat$2 = uncurryThis$f([].concat);
|
|
861
|
-
|
|
862
|
-
// all object keys, includes non-enumerable and symbols
|
|
863
|
-
var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
864
|
-
var keys = getOwnPropertyNamesModule.f(anObject$c(it));
|
|
865
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
866
|
-
return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
870
|
-
var ownKeys = ownKeys$1;
|
|
871
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
872
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
873
|
-
|
|
874
|
-
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
875
|
-
var keys = ownKeys(source);
|
|
876
|
-
var defineProperty = definePropertyModule$3.f;
|
|
877
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
878
|
-
for (var i = 0; i < keys.length; i++) {
|
|
879
|
-
var key = keys[i];
|
|
880
|
-
if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
|
|
881
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
var fails$b = fails$i;
|
|
887
|
-
var isCallable$7 = isCallable$g;
|
|
888
|
-
|
|
889
|
-
var replacement = /#|\.prototype\./;
|
|
890
|
-
|
|
891
|
-
var isForced$2 = function (feature, detection) {
|
|
892
|
-
var value = data[normalize$1(feature)];
|
|
893
|
-
return value == POLYFILL ? true
|
|
894
|
-
: value == NATIVE ? false
|
|
895
|
-
: isCallable$7(detection) ? fails$b(detection)
|
|
896
|
-
: !!detection;
|
|
897
|
-
};
|
|
898
|
-
|
|
899
|
-
var normalize$1 = isForced$2.normalize = function (string) {
|
|
900
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
901
|
-
};
|
|
902
|
-
|
|
903
|
-
var data = isForced$2.data = {};
|
|
904
|
-
var NATIVE = isForced$2.NATIVE = 'N';
|
|
905
|
-
var POLYFILL = isForced$2.POLYFILL = 'P';
|
|
906
|
-
|
|
907
|
-
var isForced_1 = isForced$2;
|
|
908
|
-
|
|
909
|
-
var global$o = global$I;
|
|
910
|
-
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
|
|
911
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
|
|
912
|
-
var redefine$3 = redefine$4.exports;
|
|
913
|
-
var setGlobal = setGlobal$3;
|
|
914
|
-
var copyConstructorProperties = copyConstructorProperties$1;
|
|
915
|
-
var isForced$1 = isForced_1;
|
|
916
|
-
|
|
917
|
-
/*
|
|
918
|
-
options.target - name of the target object
|
|
919
|
-
options.global - target is the global object
|
|
920
|
-
options.stat - export as static methods of target
|
|
921
|
-
options.proto - export as prototype methods of target
|
|
922
|
-
options.real - real prototype method for the `pure` version
|
|
923
|
-
options.forced - export even if the native feature is available
|
|
924
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
925
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
926
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
927
|
-
options.sham - add a flag to not completely full polyfills
|
|
928
|
-
options.enumerable - export as enumerable property
|
|
929
|
-
options.noTargetGet - prevent calling a getter on target
|
|
930
|
-
options.name - the .name of the function if it does not match the key
|
|
931
|
-
*/
|
|
932
|
-
var _export = function (options, source) {
|
|
933
|
-
var TARGET = options.target;
|
|
934
|
-
var GLOBAL = options.global;
|
|
935
|
-
var STATIC = options.stat;
|
|
936
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
937
|
-
if (GLOBAL) {
|
|
938
|
-
target = global$o;
|
|
939
|
-
} else if (STATIC) {
|
|
940
|
-
target = global$o[TARGET] || setGlobal(TARGET, {});
|
|
941
|
-
} else {
|
|
942
|
-
target = (global$o[TARGET] || {}).prototype;
|
|
943
|
-
}
|
|
944
|
-
if (target) for (key in source) {
|
|
945
|
-
sourceProperty = source[key];
|
|
946
|
-
if (options.noTargetGet) {
|
|
947
|
-
descriptor = getOwnPropertyDescriptor$2(target, key);
|
|
948
|
-
targetProperty = descriptor && descriptor.value;
|
|
949
|
-
} else targetProperty = target[key];
|
|
950
|
-
FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
951
|
-
// contained in target
|
|
952
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
953
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
954
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
955
|
-
}
|
|
956
|
-
// add a flag to not completely full polyfills
|
|
957
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
958
|
-
createNonEnumerableProperty$1(sourceProperty, 'sham', true);
|
|
959
|
-
}
|
|
960
|
-
// extend global
|
|
961
|
-
redefine$3(target, key, sourceProperty, options);
|
|
962
|
-
}
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
var global$n = global$I;
|
|
966
|
-
|
|
967
|
-
var nativePromiseConstructor = global$n.Promise;
|
|
968
|
-
|
|
969
|
-
var redefine$2 = redefine$4.exports;
|
|
970
|
-
|
|
971
|
-
var redefineAll$1 = function (target, src, options) {
|
|
972
|
-
for (var key in src) redefine$2(target, key, src[key], options);
|
|
973
|
-
return target;
|
|
974
|
-
};
|
|
975
|
-
|
|
976
|
-
var global$m = global$I;
|
|
977
|
-
var isCallable$6 = isCallable$g;
|
|
978
|
-
|
|
979
|
-
var String$3 = global$m.String;
|
|
980
|
-
var TypeError$a = global$m.TypeError;
|
|
981
|
-
|
|
982
|
-
var aPossiblePrototype$1 = function (argument) {
|
|
983
|
-
if (typeof argument == 'object' || isCallable$6(argument)) return argument;
|
|
984
|
-
throw TypeError$a("Can't set " + String$3(argument) + ' as a prototype');
|
|
985
|
-
};
|
|
986
|
-
|
|
987
|
-
/* eslint-disable no-proto -- safe */
|
|
988
|
-
|
|
989
|
-
var uncurryThis$e = functionUncurryThis;
|
|
990
|
-
var anObject$b = anObject$e;
|
|
991
|
-
var aPossiblePrototype = aPossiblePrototype$1;
|
|
992
|
-
|
|
993
|
-
// `Object.setPrototypeOf` method
|
|
994
|
-
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
995
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
996
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
997
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
998
|
-
var CORRECT_SETTER = false;
|
|
999
|
-
var test = {};
|
|
1000
|
-
var setter;
|
|
1001
|
-
try {
|
|
1002
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1003
|
-
setter = uncurryThis$e(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1004
|
-
setter(test, []);
|
|
1005
|
-
CORRECT_SETTER = test instanceof Array;
|
|
1006
|
-
} catch (error) { /* empty */ }
|
|
1007
|
-
return function setPrototypeOf(O, proto) {
|
|
1008
|
-
anObject$b(O);
|
|
1009
|
-
aPossiblePrototype(proto);
|
|
1010
|
-
if (CORRECT_SETTER) setter(O, proto);
|
|
1011
|
-
else O.__proto__ = proto;
|
|
1012
|
-
return O;
|
|
1013
|
-
};
|
|
1014
|
-
}() : undefined);
|
|
1015
|
-
|
|
1016
|
-
var defineProperty$1 = objectDefineProperty.f;
|
|
1017
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
1018
|
-
var wellKnownSymbol$c = wellKnownSymbol$e;
|
|
1019
|
-
|
|
1020
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$c('toStringTag');
|
|
1021
|
-
|
|
1022
|
-
var setToStringTag$1 = function (target, TAG, STATIC) {
|
|
1023
|
-
if (target && !STATIC) target = target.prototype;
|
|
1024
|
-
if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
|
|
1025
|
-
defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
var getBuiltIn$3 = getBuiltIn$7;
|
|
1030
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
1031
|
-
var wellKnownSymbol$b = wellKnownSymbol$e;
|
|
1032
|
-
var DESCRIPTORS$2 = descriptors;
|
|
1033
|
-
|
|
1034
|
-
var SPECIES$3 = wellKnownSymbol$b('species');
|
|
1035
|
-
|
|
1036
|
-
var setSpecies$1 = function (CONSTRUCTOR_NAME) {
|
|
1037
|
-
var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
|
|
1038
|
-
var defineProperty = definePropertyModule$2.f;
|
|
1039
|
-
|
|
1040
|
-
if (DESCRIPTORS$2 && Constructor && !Constructor[SPECIES$3]) {
|
|
1041
|
-
defineProperty(Constructor, SPECIES$3, {
|
|
1042
|
-
configurable: true,
|
|
1043
|
-
get: function () { return this; }
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
|
|
1048
|
-
var global$l = global$I;
|
|
1049
|
-
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
1050
|
-
|
|
1051
|
-
var TypeError$9 = global$l.TypeError;
|
|
1052
|
-
|
|
1053
|
-
var anInstance$1 = function (it, Prototype) {
|
|
1054
|
-
if (isPrototypeOf$1(Prototype, it)) return it;
|
|
1055
|
-
throw TypeError$9('Incorrect invocation');
|
|
1056
|
-
};
|
|
1057
|
-
|
|
1058
|
-
var uncurryThis$d = functionUncurryThis;
|
|
1059
|
-
var aCallable$4 = aCallable$6;
|
|
1060
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
1061
|
-
|
|
1062
|
-
var bind$4 = uncurryThis$d(uncurryThis$d.bind);
|
|
1063
|
-
|
|
1064
|
-
// optional / simple context binding
|
|
1065
|
-
var functionBindContext = function (fn, that) {
|
|
1066
|
-
aCallable$4(fn);
|
|
1067
|
-
return that === undefined ? fn : NATIVE_BIND$1 ? bind$4(fn, that) : function (/* ...args */) {
|
|
1068
|
-
return fn.apply(that, arguments);
|
|
1069
|
-
};
|
|
1070
|
-
};
|
|
1071
|
-
|
|
1072
|
-
var iterators = {};
|
|
1073
|
-
|
|
1074
|
-
var wellKnownSymbol$a = wellKnownSymbol$e;
|
|
1075
|
-
var Iterators$1 = iterators;
|
|
1076
|
-
|
|
1077
|
-
var ITERATOR$3 = wellKnownSymbol$a('iterator');
|
|
1078
|
-
var ArrayPrototype = Array.prototype;
|
|
1079
|
-
|
|
1080
|
-
// check on default Array iterator
|
|
1081
|
-
var isArrayIteratorMethod$1 = function (it) {
|
|
1082
|
-
return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
var wellKnownSymbol$9 = wellKnownSymbol$e;
|
|
1086
|
-
|
|
1087
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
|
|
1088
|
-
var test = {};
|
|
1089
|
-
|
|
1090
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1091
|
-
|
|
1092
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1093
|
-
|
|
1094
|
-
var global$k = global$I;
|
|
1095
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1096
|
-
var isCallable$5 = isCallable$g;
|
|
1097
|
-
var classofRaw = classofRaw$1;
|
|
1098
|
-
var wellKnownSymbol$8 = wellKnownSymbol$e;
|
|
1099
|
-
|
|
1100
|
-
var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
|
|
1101
|
-
var Object$1 = global$k.Object;
|
|
1102
|
-
|
|
1103
|
-
// ES3 wrong here
|
|
1104
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1105
|
-
|
|
1106
|
-
// fallback for IE11 Script Access Denied error
|
|
1107
|
-
var tryGet = function (it, key) {
|
|
1108
|
-
try {
|
|
1109
|
-
return it[key];
|
|
1110
|
-
} catch (error) { /* empty */ }
|
|
1111
|
-
};
|
|
1112
|
-
|
|
1113
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1114
|
-
var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1115
|
-
var O, tag, result;
|
|
1116
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1117
|
-
// @@toStringTag case
|
|
1118
|
-
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1119
|
-
// builtinTag case
|
|
1120
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1121
|
-
// ES3 arguments fallback
|
|
1122
|
-
: (result = classofRaw(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
|
|
1123
|
-
};
|
|
1124
|
-
|
|
1125
|
-
var classof$5 = classof$6;
|
|
1126
|
-
var getMethod$3 = getMethod$5;
|
|
1127
|
-
var Iterators = iterators;
|
|
1128
|
-
var wellKnownSymbol$7 = wellKnownSymbol$e;
|
|
1129
|
-
|
|
1130
|
-
var ITERATOR$2 = wellKnownSymbol$7('iterator');
|
|
1131
|
-
|
|
1132
|
-
var getIteratorMethod$2 = function (it) {
|
|
1133
|
-
if (it != undefined) return getMethod$3(it, ITERATOR$2)
|
|
1134
|
-
|| getMethod$3(it, '@@iterator')
|
|
1135
|
-
|| Iterators[classof$5(it)];
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
var global$j = global$I;
|
|
1139
|
-
var call$9 = functionCall;
|
|
1140
|
-
var aCallable$3 = aCallable$6;
|
|
1141
|
-
var anObject$a = anObject$e;
|
|
1142
|
-
var tryToString$2 = tryToString$4;
|
|
1143
|
-
var getIteratorMethod$1 = getIteratorMethod$2;
|
|
1144
|
-
|
|
1145
|
-
var TypeError$8 = global$j.TypeError;
|
|
1146
|
-
|
|
1147
|
-
var getIterator$1 = function (argument, usingIterator) {
|
|
1148
|
-
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
|
|
1149
|
-
if (aCallable$3(iteratorMethod)) return anObject$a(call$9(iteratorMethod, argument));
|
|
1150
|
-
throw TypeError$8(tryToString$2(argument) + ' is not iterable');
|
|
1151
|
-
};
|
|
1152
|
-
|
|
1153
|
-
var call$8 = functionCall;
|
|
1154
|
-
var anObject$9 = anObject$e;
|
|
1155
|
-
var getMethod$2 = getMethod$5;
|
|
1156
|
-
|
|
1157
|
-
var iteratorClose$1 = function (iterator, kind, value) {
|
|
1158
|
-
var innerResult, innerError;
|
|
1159
|
-
anObject$9(iterator);
|
|
1160
|
-
try {
|
|
1161
|
-
innerResult = getMethod$2(iterator, 'return');
|
|
1162
|
-
if (!innerResult) {
|
|
1163
|
-
if (kind === 'throw') throw value;
|
|
1164
|
-
return value;
|
|
1165
|
-
}
|
|
1166
|
-
innerResult = call$8(innerResult, iterator);
|
|
1167
|
-
} catch (error) {
|
|
1168
|
-
innerError = true;
|
|
1169
|
-
innerResult = error;
|
|
1170
|
-
}
|
|
1171
|
-
if (kind === 'throw') throw value;
|
|
1172
|
-
if (innerError) throw innerResult;
|
|
1173
|
-
anObject$9(innerResult);
|
|
1174
|
-
return value;
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
var global$i = global$I;
|
|
1178
|
-
var bind$3 = functionBindContext;
|
|
1179
|
-
var call$7 = functionCall;
|
|
1180
|
-
var anObject$8 = anObject$e;
|
|
1181
|
-
var tryToString$1 = tryToString$4;
|
|
1182
|
-
var isArrayIteratorMethod = isArrayIteratorMethod$1;
|
|
1183
|
-
var lengthOfArrayLike$2 = lengthOfArrayLike$4;
|
|
1184
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
1185
|
-
var getIterator = getIterator$1;
|
|
1186
|
-
var getIteratorMethod = getIteratorMethod$2;
|
|
1187
|
-
var iteratorClose = iteratorClose$1;
|
|
1188
|
-
|
|
1189
|
-
var TypeError$7 = global$i.TypeError;
|
|
1190
|
-
|
|
1191
|
-
var Result = function (stopped, result) {
|
|
1192
|
-
this.stopped = stopped;
|
|
1193
|
-
this.result = result;
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
var ResultPrototype = Result.prototype;
|
|
1197
|
-
|
|
1198
|
-
var iterate$1 = function (iterable, unboundFunction, options) {
|
|
1199
|
-
var that = options && options.that;
|
|
1200
|
-
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
1201
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
1202
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
1203
|
-
var fn = bind$3(unboundFunction, that);
|
|
1204
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
1205
|
-
|
|
1206
|
-
var stop = function (condition) {
|
|
1207
|
-
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
1208
|
-
return new Result(true, condition);
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
var callFn = function (value) {
|
|
1212
|
-
if (AS_ENTRIES) {
|
|
1213
|
-
anObject$8(value);
|
|
1214
|
-
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
1215
|
-
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
1216
|
-
};
|
|
1217
|
-
|
|
1218
|
-
if (IS_ITERATOR) {
|
|
1219
|
-
iterator = iterable;
|
|
1220
|
-
} else {
|
|
1221
|
-
iterFn = getIteratorMethod(iterable);
|
|
1222
|
-
if (!iterFn) throw TypeError$7(tryToString$1(iterable) + ' is not iterable');
|
|
1223
|
-
// optimisation for array iterators
|
|
1224
|
-
if (isArrayIteratorMethod(iterFn)) {
|
|
1225
|
-
for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
|
|
1226
|
-
result = callFn(iterable[index]);
|
|
1227
|
-
if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
1228
|
-
} return new Result(false);
|
|
1229
|
-
}
|
|
1230
|
-
iterator = getIterator(iterable, iterFn);
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
next = iterator.next;
|
|
1234
|
-
while (!(step = call$7(next, iterator)).done) {
|
|
1235
|
-
try {
|
|
1236
|
-
result = callFn(step.value);
|
|
1237
|
-
} catch (error) {
|
|
1238
|
-
iteratorClose(iterator, 'throw', error);
|
|
1239
|
-
}
|
|
1240
|
-
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
1241
|
-
} return new Result(false);
|
|
1242
|
-
};
|
|
1243
|
-
|
|
1244
|
-
var wellKnownSymbol$6 = wellKnownSymbol$e;
|
|
1245
|
-
|
|
1246
|
-
var ITERATOR$1 = wellKnownSymbol$6('iterator');
|
|
1247
|
-
var SAFE_CLOSING = false;
|
|
1248
|
-
|
|
1249
|
-
try {
|
|
1250
|
-
var called = 0;
|
|
1251
|
-
var iteratorWithReturn = {
|
|
1252
|
-
next: function () {
|
|
1253
|
-
return { done: !!called++ };
|
|
1254
|
-
},
|
|
1255
|
-
'return': function () {
|
|
1256
|
-
SAFE_CLOSING = true;
|
|
1257
|
-
}
|
|
1258
|
-
};
|
|
1259
|
-
iteratorWithReturn[ITERATOR$1] = function () {
|
|
1260
|
-
return this;
|
|
1261
|
-
};
|
|
1262
|
-
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
1263
|
-
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
1264
|
-
} catch (error) { /* empty */ }
|
|
1265
|
-
|
|
1266
|
-
var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
|
|
1267
|
-
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
1268
|
-
var ITERATION_SUPPORT = false;
|
|
1269
|
-
try {
|
|
1270
|
-
var object = {};
|
|
1271
|
-
object[ITERATOR$1] = function () {
|
|
1272
|
-
return {
|
|
1273
|
-
next: function () {
|
|
1274
|
-
return { done: ITERATION_SUPPORT = true };
|
|
1275
|
-
}
|
|
1276
|
-
};
|
|
1277
|
-
};
|
|
1278
|
-
exec(object);
|
|
1279
|
-
} catch (error) { /* empty */ }
|
|
1280
|
-
return ITERATION_SUPPORT;
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
var uncurryThis$c = functionUncurryThis;
|
|
1284
|
-
var fails$a = fails$i;
|
|
1285
|
-
var isCallable$4 = isCallable$g;
|
|
1286
|
-
var classof$4 = classof$6;
|
|
1287
|
-
var getBuiltIn$2 = getBuiltIn$7;
|
|
1288
|
-
var inspectSource$1 = inspectSource$4;
|
|
1289
|
-
|
|
1290
|
-
var noop = function () { /* empty */ };
|
|
1291
|
-
var empty = [];
|
|
1292
|
-
var construct = getBuiltIn$2('Reflect', 'construct');
|
|
1293
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1294
|
-
var exec$3 = uncurryThis$c(constructorRegExp.exec);
|
|
1295
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
1296
|
-
|
|
1297
|
-
var isConstructorModern = function isConstructor(argument) {
|
|
1298
|
-
if (!isCallable$4(argument)) return false;
|
|
1299
|
-
try {
|
|
1300
|
-
construct(noop, empty, argument);
|
|
1301
|
-
return true;
|
|
1302
|
-
} catch (error) {
|
|
1303
|
-
return false;
|
|
1304
|
-
}
|
|
1305
|
-
};
|
|
1306
|
-
|
|
1307
|
-
var isConstructorLegacy = function isConstructor(argument) {
|
|
1308
|
-
if (!isCallable$4(argument)) return false;
|
|
1309
|
-
switch (classof$4(argument)) {
|
|
1310
|
-
case 'AsyncFunction':
|
|
1311
|
-
case 'GeneratorFunction':
|
|
1312
|
-
case 'AsyncGeneratorFunction': return false;
|
|
1313
|
-
}
|
|
1314
|
-
try {
|
|
1315
|
-
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1316
|
-
// `Function#toString` throws on some built-it function in some legacy engines
|
|
1317
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
1318
|
-
return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource$1(argument));
|
|
1319
|
-
} catch (error) {
|
|
1320
|
-
return true;
|
|
1321
|
-
}
|
|
1322
|
-
};
|
|
1323
|
-
|
|
1324
|
-
isConstructorLegacy.sham = true;
|
|
1325
|
-
|
|
1326
|
-
// `IsConstructor` abstract operation
|
|
1327
|
-
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1328
|
-
var isConstructor$1 = !construct || fails$a(function () {
|
|
1329
|
-
var called;
|
|
1330
|
-
return isConstructorModern(isConstructorModern.call)
|
|
1331
|
-
|| !isConstructorModern(Object)
|
|
1332
|
-
|| !isConstructorModern(function () { called = true; })
|
|
1333
|
-
|| called;
|
|
1334
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
1335
|
-
|
|
1336
|
-
var global$h = global$I;
|
|
1337
|
-
var isConstructor = isConstructor$1;
|
|
1338
|
-
var tryToString = tryToString$4;
|
|
1339
|
-
|
|
1340
|
-
var TypeError$6 = global$h.TypeError;
|
|
1341
|
-
|
|
1342
|
-
// `Assert: IsConstructor(argument) is true`
|
|
1343
|
-
var aConstructor$1 = function (argument) {
|
|
1344
|
-
if (isConstructor(argument)) return argument;
|
|
1345
|
-
throw TypeError$6(tryToString(argument) + ' is not a constructor');
|
|
1346
|
-
};
|
|
1347
|
-
|
|
1348
|
-
var anObject$7 = anObject$e;
|
|
1349
|
-
var aConstructor = aConstructor$1;
|
|
1350
|
-
var wellKnownSymbol$5 = wellKnownSymbol$e;
|
|
1351
|
-
|
|
1352
|
-
var SPECIES$2 = wellKnownSymbol$5('species');
|
|
1353
|
-
|
|
1354
|
-
// `SpeciesConstructor` abstract operation
|
|
1355
|
-
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
1356
|
-
var speciesConstructor$2 = function (O, defaultConstructor) {
|
|
1357
|
-
var C = anObject$7(O).constructor;
|
|
1358
|
-
var S;
|
|
1359
|
-
return C === undefined || (S = anObject$7(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
|
-
var NATIVE_BIND = functionBindNative;
|
|
1363
|
-
|
|
1364
|
-
var FunctionPrototype = Function.prototype;
|
|
1365
|
-
var apply$3 = FunctionPrototype.apply;
|
|
1366
|
-
var call$6 = FunctionPrototype.call;
|
|
1367
|
-
|
|
1368
|
-
// eslint-disable-next-line es/no-reflect -- safe
|
|
1369
|
-
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$6.bind(apply$3) : function () {
|
|
1370
|
-
return call$6.apply(apply$3, arguments);
|
|
1371
|
-
});
|
|
1372
|
-
|
|
1373
|
-
var getBuiltIn$1 = getBuiltIn$7;
|
|
1374
|
-
|
|
1375
|
-
var html$2 = getBuiltIn$1('document', 'documentElement');
|
|
1376
|
-
|
|
1377
|
-
var uncurryThis$b = functionUncurryThis;
|
|
1378
|
-
|
|
1379
|
-
var arraySlice$2 = uncurryThis$b([].slice);
|
|
1380
|
-
|
|
1381
|
-
var global$g = global$I;
|
|
1382
|
-
|
|
1383
|
-
var TypeError$5 = global$g.TypeError;
|
|
1384
|
-
|
|
1385
|
-
var validateArgumentsLength$1 = function (passed, required) {
|
|
1386
|
-
if (passed < required) throw TypeError$5('Not enough arguments');
|
|
1387
|
-
return passed;
|
|
1388
|
-
};
|
|
1389
|
-
|
|
1390
|
-
var userAgent$2 = engineUserAgent;
|
|
1391
|
-
|
|
1392
|
-
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
|
|
1393
|
-
|
|
1394
|
-
var classof$3 = classofRaw$1;
|
|
1395
|
-
var global$f = global$I;
|
|
1396
|
-
|
|
1397
|
-
var engineIsNode = classof$3(global$f.process) == 'process';
|
|
1398
|
-
|
|
1399
|
-
var global$e = global$I;
|
|
1400
|
-
var apply$2 = functionApply;
|
|
1401
|
-
var bind$2 = functionBindContext;
|
|
1402
|
-
var isCallable$3 = isCallable$g;
|
|
1403
|
-
var hasOwn = hasOwnProperty_1;
|
|
1404
|
-
var fails$9 = fails$i;
|
|
1405
|
-
var html$1 = html$2;
|
|
1406
|
-
var arraySlice$1 = arraySlice$2;
|
|
1407
|
-
var createElement = documentCreateElement$1;
|
|
1408
|
-
var validateArgumentsLength = validateArgumentsLength$1;
|
|
1409
|
-
var IS_IOS$1 = engineIsIos;
|
|
1410
|
-
var IS_NODE$3 = engineIsNode;
|
|
1411
|
-
|
|
1412
|
-
var set = global$e.setImmediate;
|
|
1413
|
-
var clear = global$e.clearImmediate;
|
|
1414
|
-
var process$2 = global$e.process;
|
|
1415
|
-
var Dispatch = global$e.Dispatch;
|
|
1416
|
-
var Function$1 = global$e.Function;
|
|
1417
|
-
var MessageChannel = global$e.MessageChannel;
|
|
1418
|
-
var String$2 = global$e.String;
|
|
1419
|
-
var counter = 0;
|
|
1420
|
-
var queue$1 = {};
|
|
1421
|
-
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
1422
|
-
var location, defer, channel, port;
|
|
1423
|
-
|
|
1424
|
-
try {
|
|
1425
|
-
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
1426
|
-
location = global$e.location;
|
|
1427
|
-
} catch (error) { /* empty */ }
|
|
1428
|
-
|
|
1429
|
-
var run = function (id) {
|
|
1430
|
-
if (hasOwn(queue$1, id)) {
|
|
1431
|
-
var fn = queue$1[id];
|
|
1432
|
-
delete queue$1[id];
|
|
1433
|
-
fn();
|
|
1434
|
-
}
|
|
1435
|
-
};
|
|
1436
|
-
|
|
1437
|
-
var runner = function (id) {
|
|
1438
|
-
return function () {
|
|
1439
|
-
run(id);
|
|
1440
|
-
};
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
var listener = function (event) {
|
|
1444
|
-
run(event.data);
|
|
1445
|
-
};
|
|
1446
|
-
|
|
1447
|
-
var post = function (id) {
|
|
1448
|
-
// old engines have not location.origin
|
|
1449
|
-
global$e.postMessage(String$2(id), location.protocol + '//' + location.host);
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
1453
|
-
if (!set || !clear) {
|
|
1454
|
-
set = function setImmediate(handler) {
|
|
1455
|
-
validateArgumentsLength(arguments.length, 1);
|
|
1456
|
-
var fn = isCallable$3(handler) ? handler : Function$1(handler);
|
|
1457
|
-
var args = arraySlice$1(arguments, 1);
|
|
1458
|
-
queue$1[++counter] = function () {
|
|
1459
|
-
apply$2(fn, undefined, args);
|
|
1460
|
-
};
|
|
1461
|
-
defer(counter);
|
|
1462
|
-
return counter;
|
|
1463
|
-
};
|
|
1464
|
-
clear = function clearImmediate(id) {
|
|
1465
|
-
delete queue$1[id];
|
|
1466
|
-
};
|
|
1467
|
-
// Node.js 0.8-
|
|
1468
|
-
if (IS_NODE$3) {
|
|
1469
|
-
defer = function (id) {
|
|
1470
|
-
process$2.nextTick(runner(id));
|
|
1471
|
-
};
|
|
1472
|
-
// Sphere (JS game engine) Dispatch API
|
|
1473
|
-
} else if (Dispatch && Dispatch.now) {
|
|
1474
|
-
defer = function (id) {
|
|
1475
|
-
Dispatch.now(runner(id));
|
|
1476
|
-
};
|
|
1477
|
-
// Browsers with MessageChannel, includes WebWorkers
|
|
1478
|
-
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
1479
|
-
} else if (MessageChannel && !IS_IOS$1) {
|
|
1480
|
-
channel = new MessageChannel();
|
|
1481
|
-
port = channel.port2;
|
|
1482
|
-
channel.port1.onmessage = listener;
|
|
1483
|
-
defer = bind$2(port.postMessage, port);
|
|
1484
|
-
// Browsers with postMessage, skip WebWorkers
|
|
1485
|
-
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
1486
|
-
} else if (
|
|
1487
|
-
global$e.addEventListener &&
|
|
1488
|
-
isCallable$3(global$e.postMessage) &&
|
|
1489
|
-
!global$e.importScripts &&
|
|
1490
|
-
location && location.protocol !== 'file:' &&
|
|
1491
|
-
!fails$9(post)
|
|
1492
|
-
) {
|
|
1493
|
-
defer = post;
|
|
1494
|
-
global$e.addEventListener('message', listener, false);
|
|
1495
|
-
// IE8-
|
|
1496
|
-
} else if (ONREADYSTATECHANGE in createElement('script')) {
|
|
1497
|
-
defer = function (id) {
|
|
1498
|
-
html$1.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
|
1499
|
-
html$1.removeChild(this);
|
|
1500
|
-
run(id);
|
|
1501
|
-
};
|
|
1502
|
-
};
|
|
1503
|
-
// Rest old browsers
|
|
1504
|
-
} else {
|
|
1505
|
-
defer = function (id) {
|
|
1506
|
-
setTimeout(runner(id), 0);
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
var task$1 = {
|
|
1512
|
-
set: set,
|
|
1513
|
-
clear: clear
|
|
1514
|
-
};
|
|
1515
|
-
|
|
1516
|
-
var userAgent$1 = engineUserAgent;
|
|
1517
|
-
var global$d = global$I;
|
|
1518
|
-
|
|
1519
|
-
var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$d.Pebble !== undefined;
|
|
1520
|
-
|
|
1521
|
-
var userAgent = engineUserAgent;
|
|
1522
|
-
|
|
1523
|
-
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
|
|
1524
|
-
|
|
1525
|
-
var global$c = global$I;
|
|
1526
|
-
var bind$1 = functionBindContext;
|
|
1527
|
-
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
1528
|
-
var macrotask = task$1.set;
|
|
1529
|
-
var IS_IOS = engineIsIos;
|
|
1530
|
-
var IS_IOS_PEBBLE = engineIsIosPebble;
|
|
1531
|
-
var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
|
|
1532
|
-
var IS_NODE$2 = engineIsNode;
|
|
1533
|
-
|
|
1534
|
-
var MutationObserver = global$c.MutationObserver || global$c.WebKitMutationObserver;
|
|
1535
|
-
var document$2 = global$c.document;
|
|
1536
|
-
var process$1 = global$c.process;
|
|
1537
|
-
var Promise$1 = global$c.Promise;
|
|
1538
|
-
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
1539
|
-
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$1(global$c, 'queueMicrotask');
|
|
1540
|
-
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
1541
|
-
|
|
1542
|
-
var flush, head, last, notify$1, toggle, node, promise, then;
|
|
1543
|
-
|
|
1544
|
-
// modern engines have queueMicrotask method
|
|
1545
|
-
if (!queueMicrotask) {
|
|
1546
|
-
flush = function () {
|
|
1547
|
-
var parent, fn;
|
|
1548
|
-
if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
|
|
1549
|
-
while (head) {
|
|
1550
|
-
fn = head.fn;
|
|
1551
|
-
head = head.next;
|
|
1552
|
-
try {
|
|
1553
|
-
fn();
|
|
1554
|
-
} catch (error) {
|
|
1555
|
-
if (head) notify$1();
|
|
1556
|
-
else last = undefined;
|
|
1557
|
-
throw error;
|
|
1558
|
-
}
|
|
1559
|
-
} last = undefined;
|
|
1560
|
-
if (parent) parent.enter();
|
|
1561
|
-
};
|
|
1562
|
-
|
|
1563
|
-
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
1564
|
-
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
1565
|
-
if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
|
1566
|
-
toggle = true;
|
|
1567
|
-
node = document$2.createTextNode('');
|
|
1568
|
-
new MutationObserver(flush).observe(node, { characterData: true });
|
|
1569
|
-
notify$1 = function () {
|
|
1570
|
-
node.data = toggle = !toggle;
|
|
1571
|
-
};
|
|
1572
|
-
// environments with maybe non-completely correct, but existent Promise
|
|
1573
|
-
} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
|
1574
|
-
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
1575
|
-
promise = Promise$1.resolve(undefined);
|
|
1576
|
-
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
1577
|
-
promise.constructor = Promise$1;
|
|
1578
|
-
then = bind$1(promise.then, promise);
|
|
1579
|
-
notify$1 = function () {
|
|
1580
|
-
then(flush);
|
|
1581
|
-
};
|
|
1582
|
-
// Node.js without promises
|
|
1583
|
-
} else if (IS_NODE$2) {
|
|
1584
|
-
notify$1 = function () {
|
|
1585
|
-
process$1.nextTick(flush);
|
|
1586
|
-
};
|
|
1587
|
-
// for other environments - macrotask based on:
|
|
1588
|
-
// - setImmediate
|
|
1589
|
-
// - MessageChannel
|
|
1590
|
-
// - window.postMessag
|
|
1591
|
-
// - onreadystatechange
|
|
1592
|
-
// - setTimeout
|
|
1593
|
-
} else {
|
|
1594
|
-
// strange IE + webpack dev server bug - use .bind(global)
|
|
1595
|
-
macrotask = bind$1(macrotask, global$c);
|
|
1596
|
-
notify$1 = function () {
|
|
1597
|
-
macrotask(flush);
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
var microtask$1 = queueMicrotask || function (fn) {
|
|
1603
|
-
var task = { fn: fn, next: undefined };
|
|
1604
|
-
if (last) last.next = task;
|
|
1605
|
-
if (!head) {
|
|
1606
|
-
head = task;
|
|
1607
|
-
notify$1();
|
|
1608
|
-
} last = task;
|
|
1609
|
-
};
|
|
1610
|
-
|
|
1611
|
-
var newPromiseCapability$2 = {};
|
|
1612
|
-
|
|
1613
|
-
var aCallable$2 = aCallable$6;
|
|
1614
|
-
|
|
1615
|
-
var PromiseCapability = function (C) {
|
|
1616
|
-
var resolve, reject;
|
|
1617
|
-
this.promise = new C(function ($$resolve, $$reject) {
|
|
1618
|
-
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
1619
|
-
resolve = $$resolve;
|
|
1620
|
-
reject = $$reject;
|
|
1621
|
-
});
|
|
1622
|
-
this.resolve = aCallable$2(resolve);
|
|
1623
|
-
this.reject = aCallable$2(reject);
|
|
1624
|
-
};
|
|
1625
|
-
|
|
1626
|
-
// `NewPromiseCapability` abstract operation
|
|
1627
|
-
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
1628
|
-
newPromiseCapability$2.f = function (C) {
|
|
1629
|
-
return new PromiseCapability(C);
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1632
|
-
var anObject$6 = anObject$e;
|
|
1633
|
-
var isObject$2 = isObject$8;
|
|
1634
|
-
var newPromiseCapability$1 = newPromiseCapability$2;
|
|
1635
|
-
|
|
1636
|
-
var promiseResolve$1 = function (C, x) {
|
|
1637
|
-
anObject$6(C);
|
|
1638
|
-
if (isObject$2(x) && x.constructor === C) return x;
|
|
1639
|
-
var promiseCapability = newPromiseCapability$1.f(C);
|
|
1640
|
-
var resolve = promiseCapability.resolve;
|
|
1641
|
-
resolve(x);
|
|
1642
|
-
return promiseCapability.promise;
|
|
1643
|
-
};
|
|
1644
|
-
|
|
1645
|
-
var global$b = global$I;
|
|
1646
|
-
|
|
1647
|
-
var hostReportErrors$1 = function (a, b) {
|
|
1648
|
-
var console = global$b.console;
|
|
1649
|
-
if (console && console.error) {
|
|
1650
|
-
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
var perform$1 = function (exec) {
|
|
1655
|
-
try {
|
|
1656
|
-
return { error: false, value: exec() };
|
|
1657
|
-
} catch (error) {
|
|
1658
|
-
return { error: true, value: error };
|
|
1659
|
-
}
|
|
1660
|
-
};
|
|
1661
|
-
|
|
1662
|
-
var Queue$1 = function () {
|
|
1663
|
-
this.head = null;
|
|
1664
|
-
this.tail = null;
|
|
1665
|
-
};
|
|
1666
|
-
|
|
1667
|
-
Queue$1.prototype = {
|
|
1668
|
-
add: function (item) {
|
|
1669
|
-
var entry = { item: item, next: null };
|
|
1670
|
-
if (this.head) this.tail.next = entry;
|
|
1671
|
-
else this.head = entry;
|
|
1672
|
-
this.tail = entry;
|
|
1673
|
-
},
|
|
1674
|
-
get: function () {
|
|
1675
|
-
var entry = this.head;
|
|
1676
|
-
if (entry) {
|
|
1677
|
-
this.head = entry.next;
|
|
1678
|
-
if (this.tail === entry) this.tail = null;
|
|
1679
|
-
return entry.item;
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
var queue = Queue$1;
|
|
1685
|
-
|
|
1686
|
-
var engineIsBrowser = typeof window == 'object';
|
|
1687
|
-
|
|
1688
|
-
var $$6 = _export;
|
|
1689
|
-
var global$a = global$I;
|
|
1690
|
-
var getBuiltIn = getBuiltIn$7;
|
|
1691
|
-
var call$5 = functionCall;
|
|
1692
|
-
var NativePromise = nativePromiseConstructor;
|
|
1693
|
-
var redefine$1 = redefine$4.exports;
|
|
1694
|
-
var redefineAll = redefineAll$1;
|
|
1695
|
-
var setPrototypeOf = objectSetPrototypeOf;
|
|
1696
|
-
var setToStringTag = setToStringTag$1;
|
|
1697
|
-
var setSpecies = setSpecies$1;
|
|
1698
|
-
var aCallable$1 = aCallable$6;
|
|
1699
|
-
var isCallable$2 = isCallable$g;
|
|
1700
|
-
var isObject$1 = isObject$8;
|
|
1701
|
-
var anInstance = anInstance$1;
|
|
1702
|
-
var inspectSource = inspectSource$4;
|
|
1703
|
-
var iterate = iterate$1;
|
|
1704
|
-
var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
|
|
1705
|
-
var speciesConstructor$1 = speciesConstructor$2;
|
|
1706
|
-
var task = task$1.set;
|
|
1707
|
-
var microtask = microtask$1;
|
|
1708
|
-
var promiseResolve = promiseResolve$1;
|
|
1709
|
-
var hostReportErrors = hostReportErrors$1;
|
|
1710
|
-
var newPromiseCapabilityModule = newPromiseCapability$2;
|
|
1711
|
-
var perform = perform$1;
|
|
1712
|
-
var Queue = queue;
|
|
1713
|
-
var InternalStateModule = internalState;
|
|
1714
|
-
var isForced = isForced_1;
|
|
1715
|
-
var wellKnownSymbol$4 = wellKnownSymbol$e;
|
|
1716
|
-
var IS_BROWSER = engineIsBrowser;
|
|
1717
|
-
var IS_NODE$1 = engineIsNode;
|
|
1718
|
-
var V8_VERSION = engineV8Version;
|
|
1719
|
-
|
|
1720
|
-
var SPECIES$1 = wellKnownSymbol$4('species');
|
|
1721
|
-
var PROMISE = 'Promise';
|
|
1722
|
-
|
|
1723
|
-
var getInternalState$1 = InternalStateModule.getterFor(PROMISE);
|
|
1724
|
-
var setInternalState = InternalStateModule.set;
|
|
1725
|
-
var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
|
1726
|
-
var NativePromisePrototype = NativePromise && NativePromise.prototype;
|
|
1727
|
-
var PromiseConstructor = NativePromise;
|
|
1728
|
-
var PromisePrototype = NativePromisePrototype;
|
|
1729
|
-
var TypeError$4 = global$a.TypeError;
|
|
1730
|
-
var document$1 = global$a.document;
|
|
1731
|
-
var process = global$a.process;
|
|
1732
|
-
var newPromiseCapability = newPromiseCapabilityModule.f;
|
|
1733
|
-
var newGenericPromiseCapability = newPromiseCapability;
|
|
1734
|
-
|
|
1735
|
-
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$a.dispatchEvent);
|
|
1736
|
-
var NATIVE_REJECTION_EVENT = isCallable$2(global$a.PromiseRejectionEvent);
|
|
1737
|
-
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
1738
|
-
var REJECTION_HANDLED = 'rejectionhandled';
|
|
1739
|
-
var PENDING = 0;
|
|
1740
|
-
var FULFILLED = 1;
|
|
1741
|
-
var REJECTED = 2;
|
|
1742
|
-
var HANDLED = 1;
|
|
1743
|
-
var UNHANDLED = 2;
|
|
1744
|
-
var SUBCLASSING = false;
|
|
1745
|
-
|
|
1746
|
-
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
1747
|
-
|
|
1748
|
-
var FORCED$1 = isForced(PROMISE, function () {
|
|
1749
|
-
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
|
|
1750
|
-
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
|
|
1751
|
-
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
1752
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
1753
|
-
// We can't detect it synchronously, so just check versions
|
|
1754
|
-
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
|
1755
|
-
// We can't use @@species feature detection in V8 since it causes
|
|
1756
|
-
// deoptimization and performance degradation
|
|
1757
|
-
// https://github.com/zloirock/core-js/issues/679
|
|
1758
|
-
if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
|
1759
|
-
// Detect correctness of subclassing with @@species support
|
|
1760
|
-
var promise = new PromiseConstructor(function (resolve) { resolve(1); });
|
|
1761
|
-
var FakePromise = function (exec) {
|
|
1762
|
-
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
1763
|
-
};
|
|
1764
|
-
var constructor = promise.constructor = {};
|
|
1765
|
-
constructor[SPECIES$1] = FakePromise;
|
|
1766
|
-
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
1767
|
-
if (!SUBCLASSING) return true;
|
|
1768
|
-
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
1769
|
-
return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
|
|
1770
|
-
});
|
|
1771
|
-
|
|
1772
|
-
var INCORRECT_ITERATION = FORCED$1 || !checkCorrectnessOfIteration(function (iterable) {
|
|
1773
|
-
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
|
|
1774
|
-
});
|
|
1775
|
-
|
|
1776
|
-
// helpers
|
|
1777
|
-
var isThenable = function (it) {
|
|
1778
|
-
var then;
|
|
1779
|
-
return isObject$1(it) && isCallable$2(then = it.then) ? then : false;
|
|
1780
|
-
};
|
|
1781
|
-
|
|
1782
|
-
var callReaction = function (reaction, state) {
|
|
1783
|
-
var value = state.value;
|
|
1784
|
-
var ok = state.state == FULFILLED;
|
|
1785
|
-
var handler = ok ? reaction.ok : reaction.fail;
|
|
1786
|
-
var resolve = reaction.resolve;
|
|
1787
|
-
var reject = reaction.reject;
|
|
1788
|
-
var domain = reaction.domain;
|
|
1789
|
-
var result, then, exited;
|
|
1790
|
-
try {
|
|
1791
|
-
if (handler) {
|
|
1792
|
-
if (!ok) {
|
|
1793
|
-
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
1794
|
-
state.rejection = HANDLED;
|
|
1795
|
-
}
|
|
1796
|
-
if (handler === true) result = value;
|
|
1797
|
-
else {
|
|
1798
|
-
if (domain) domain.enter();
|
|
1799
|
-
result = handler(value); // can throw
|
|
1800
|
-
if (domain) {
|
|
1801
|
-
domain.exit();
|
|
1802
|
-
exited = true;
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
if (result === reaction.promise) {
|
|
1806
|
-
reject(TypeError$4('Promise-chain cycle'));
|
|
1807
|
-
} else if (then = isThenable(result)) {
|
|
1808
|
-
call$5(then, result, resolve, reject);
|
|
1809
|
-
} else resolve(result);
|
|
1810
|
-
} else reject(value);
|
|
1811
|
-
} catch (error) {
|
|
1812
|
-
if (domain && !exited) domain.exit();
|
|
1813
|
-
reject(error);
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
|
|
1817
|
-
var notify = function (state, isReject) {
|
|
1818
|
-
if (state.notified) return;
|
|
1819
|
-
state.notified = true;
|
|
1820
|
-
microtask(function () {
|
|
1821
|
-
var reactions = state.reactions;
|
|
1822
|
-
var reaction;
|
|
1823
|
-
while (reaction = reactions.get()) {
|
|
1824
|
-
callReaction(reaction, state);
|
|
1825
|
-
}
|
|
1826
|
-
state.notified = false;
|
|
1827
|
-
if (isReject && !state.rejection) onUnhandled(state);
|
|
1828
|
-
});
|
|
1829
|
-
};
|
|
1830
|
-
|
|
1831
|
-
var dispatchEvent = function (name, promise, reason) {
|
|
1832
|
-
var event, handler;
|
|
1833
|
-
if (DISPATCH_EVENT) {
|
|
1834
|
-
event = document$1.createEvent('Event');
|
|
1835
|
-
event.promise = promise;
|
|
1836
|
-
event.reason = reason;
|
|
1837
|
-
event.initEvent(name, false, true);
|
|
1838
|
-
global$a.dispatchEvent(event);
|
|
1839
|
-
} else event = { promise: promise, reason: reason };
|
|
1840
|
-
if (!NATIVE_REJECTION_EVENT && (handler = global$a['on' + name])) handler(event);
|
|
1841
|
-
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
|
1842
|
-
};
|
|
1843
|
-
|
|
1844
|
-
var onUnhandled = function (state) {
|
|
1845
|
-
call$5(task, global$a, function () {
|
|
1846
|
-
var promise = state.facade;
|
|
1847
|
-
var value = state.value;
|
|
1848
|
-
var IS_UNHANDLED = isUnhandled(state);
|
|
1849
|
-
var result;
|
|
1850
|
-
if (IS_UNHANDLED) {
|
|
1851
|
-
result = perform(function () {
|
|
1852
|
-
if (IS_NODE$1) {
|
|
1853
|
-
process.emit('unhandledRejection', value, promise);
|
|
1854
|
-
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
|
1855
|
-
});
|
|
1856
|
-
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
|
1857
|
-
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
|
|
1858
|
-
if (result.error) throw result.value;
|
|
1859
|
-
}
|
|
1860
|
-
});
|
|
1861
|
-
};
|
|
1862
|
-
|
|
1863
|
-
var isUnhandled = function (state) {
|
|
1864
|
-
return state.rejection !== HANDLED && !state.parent;
|
|
1865
|
-
};
|
|
1866
|
-
|
|
1867
|
-
var onHandleUnhandled = function (state) {
|
|
1868
|
-
call$5(task, global$a, function () {
|
|
1869
|
-
var promise = state.facade;
|
|
1870
|
-
if (IS_NODE$1) {
|
|
1871
|
-
process.emit('rejectionHandled', promise);
|
|
1872
|
-
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
|
1873
|
-
});
|
|
1874
|
-
};
|
|
1875
|
-
|
|
1876
|
-
var bind = function (fn, state, unwrap) {
|
|
1877
|
-
return function (value) {
|
|
1878
|
-
fn(state, value, unwrap);
|
|
1879
|
-
};
|
|
1880
|
-
};
|
|
1881
|
-
|
|
1882
|
-
var internalReject = function (state, value, unwrap) {
|
|
1883
|
-
if (state.done) return;
|
|
1884
|
-
state.done = true;
|
|
1885
|
-
if (unwrap) state = unwrap;
|
|
1886
|
-
state.value = value;
|
|
1887
|
-
state.state = REJECTED;
|
|
1888
|
-
notify(state, true);
|
|
1889
|
-
};
|
|
1890
|
-
|
|
1891
|
-
var internalResolve = function (state, value, unwrap) {
|
|
1892
|
-
if (state.done) return;
|
|
1893
|
-
state.done = true;
|
|
1894
|
-
if (unwrap) state = unwrap;
|
|
1895
|
-
try {
|
|
1896
|
-
if (state.facade === value) throw TypeError$4("Promise can't be resolved itself");
|
|
1897
|
-
var then = isThenable(value);
|
|
1898
|
-
if (then) {
|
|
1899
|
-
microtask(function () {
|
|
1900
|
-
var wrapper = { done: false };
|
|
1901
|
-
try {
|
|
1902
|
-
call$5(then, value,
|
|
1903
|
-
bind(internalResolve, wrapper, state),
|
|
1904
|
-
bind(internalReject, wrapper, state)
|
|
1905
|
-
);
|
|
1906
|
-
} catch (error) {
|
|
1907
|
-
internalReject(wrapper, error, state);
|
|
1908
|
-
}
|
|
1909
|
-
});
|
|
1910
|
-
} else {
|
|
1911
|
-
state.value = value;
|
|
1912
|
-
state.state = FULFILLED;
|
|
1913
|
-
notify(state, false);
|
|
1914
|
-
}
|
|
1915
|
-
} catch (error) {
|
|
1916
|
-
internalReject({ done: false }, error, state);
|
|
1917
|
-
}
|
|
1918
|
-
};
|
|
1919
|
-
|
|
1920
|
-
// constructor polyfill
|
|
1921
|
-
if (FORCED$1) {
|
|
1922
|
-
// 25.4.3.1 Promise(executor)
|
|
1923
|
-
PromiseConstructor = function Promise(executor) {
|
|
1924
|
-
anInstance(this, PromisePrototype);
|
|
1925
|
-
aCallable$1(executor);
|
|
1926
|
-
call$5(Internal, this);
|
|
1927
|
-
var state = getInternalState$1(this);
|
|
1928
|
-
try {
|
|
1929
|
-
executor(bind(internalResolve, state), bind(internalReject, state));
|
|
1930
|
-
} catch (error) {
|
|
1931
|
-
internalReject(state, error);
|
|
1932
|
-
}
|
|
1933
|
-
};
|
|
1934
|
-
PromisePrototype = PromiseConstructor.prototype;
|
|
1935
|
-
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1936
|
-
Internal = function Promise(executor) {
|
|
1937
|
-
setInternalState(this, {
|
|
1938
|
-
type: PROMISE,
|
|
1939
|
-
done: false,
|
|
1940
|
-
notified: false,
|
|
1941
|
-
parent: false,
|
|
1942
|
-
reactions: new Queue(),
|
|
1943
|
-
rejection: false,
|
|
1944
|
-
state: PENDING,
|
|
1945
|
-
value: undefined
|
|
1946
|
-
});
|
|
1947
|
-
};
|
|
1948
|
-
Internal.prototype = redefineAll(PromisePrototype, {
|
|
1949
|
-
// `Promise.prototype.then` method
|
|
1950
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
1951
|
-
// eslint-disable-next-line unicorn/no-thenable -- safe
|
|
1952
|
-
then: function then(onFulfilled, onRejected) {
|
|
1953
|
-
var state = getInternalPromiseState(this);
|
|
1954
|
-
var reaction = newPromiseCapability(speciesConstructor$1(this, PromiseConstructor));
|
|
1955
|
-
state.parent = true;
|
|
1956
|
-
reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
|
|
1957
|
-
reaction.fail = isCallable$2(onRejected) && onRejected;
|
|
1958
|
-
reaction.domain = IS_NODE$1 ? process.domain : undefined;
|
|
1959
|
-
if (state.state == PENDING) state.reactions.add(reaction);
|
|
1960
|
-
else microtask(function () {
|
|
1961
|
-
callReaction(reaction, state);
|
|
1962
|
-
});
|
|
1963
|
-
return reaction.promise;
|
|
1964
|
-
},
|
|
1965
|
-
// `Promise.prototype.catch` method
|
|
1966
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.catch
|
|
1967
|
-
'catch': function (onRejected) {
|
|
1968
|
-
return this.then(undefined, onRejected);
|
|
1969
|
-
}
|
|
1970
|
-
});
|
|
1971
|
-
OwnPromiseCapability = function () {
|
|
1972
|
-
var promise = new Internal();
|
|
1973
|
-
var state = getInternalState$1(promise);
|
|
1974
|
-
this.promise = promise;
|
|
1975
|
-
this.resolve = bind(internalResolve, state);
|
|
1976
|
-
this.reject = bind(internalReject, state);
|
|
1977
|
-
};
|
|
1978
|
-
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
|
1979
|
-
return C === PromiseConstructor || C === PromiseWrapper
|
|
1980
|
-
? new OwnPromiseCapability(C)
|
|
1981
|
-
: newGenericPromiseCapability(C);
|
|
1982
|
-
};
|
|
1983
|
-
|
|
1984
|
-
if (isCallable$2(NativePromise) && NativePromisePrototype !== Object.prototype) {
|
|
1985
|
-
nativeThen = NativePromisePrototype.then;
|
|
1986
|
-
|
|
1987
|
-
if (!SUBCLASSING) {
|
|
1988
|
-
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
1989
|
-
redefine$1(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
1990
|
-
var that = this;
|
|
1991
|
-
return new PromiseConstructor(function (resolve, reject) {
|
|
1992
|
-
call$5(nativeThen, that, resolve, reject);
|
|
1993
|
-
}).then(onFulfilled, onRejected);
|
|
1994
|
-
// https://github.com/zloirock/core-js/issues/640
|
|
1995
|
-
}, { unsafe: true });
|
|
1996
|
-
|
|
1997
|
-
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
1998
|
-
redefine$1(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
// make `.constructor === Promise` work for native promise-based APIs
|
|
2002
|
-
try {
|
|
2003
|
-
delete NativePromisePrototype.constructor;
|
|
2004
|
-
} catch (error) { /* empty */ }
|
|
2005
|
-
|
|
2006
|
-
// make `instanceof Promise` work for native promise-based APIs
|
|
2007
|
-
if (setPrototypeOf) {
|
|
2008
|
-
setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
$$6({ global: true, wrap: true, forced: FORCED$1 }, {
|
|
2014
|
-
Promise: PromiseConstructor
|
|
2015
|
-
});
|
|
2016
|
-
|
|
2017
|
-
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
2018
|
-
setSpecies(PROMISE);
|
|
2019
|
-
|
|
2020
|
-
PromiseWrapper = getBuiltIn(PROMISE);
|
|
2021
|
-
|
|
2022
|
-
// statics
|
|
2023
|
-
$$6({ target: PROMISE, stat: true, forced: FORCED$1 }, {
|
|
2024
|
-
// `Promise.reject` method
|
|
2025
|
-
// https://tc39.es/ecma262/#sec-promise.reject
|
|
2026
|
-
reject: function reject(r) {
|
|
2027
|
-
var capability = newPromiseCapability(this);
|
|
2028
|
-
call$5(capability.reject, undefined, r);
|
|
2029
|
-
return capability.promise;
|
|
2030
|
-
}
|
|
2031
|
-
});
|
|
2032
|
-
|
|
2033
|
-
$$6({ target: PROMISE, stat: true, forced: FORCED$1 }, {
|
|
2034
|
-
// `Promise.resolve` method
|
|
2035
|
-
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
2036
|
-
resolve: function resolve(x) {
|
|
2037
|
-
return promiseResolve(this, x);
|
|
2038
|
-
}
|
|
2039
|
-
});
|
|
2040
|
-
|
|
2041
|
-
$$6({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
|
2042
|
-
// `Promise.all` method
|
|
2043
|
-
// https://tc39.es/ecma262/#sec-promise.all
|
|
2044
|
-
all: function all(iterable) {
|
|
2045
|
-
var C = this;
|
|
2046
|
-
var capability = newPromiseCapability(C);
|
|
2047
|
-
var resolve = capability.resolve;
|
|
2048
|
-
var reject = capability.reject;
|
|
2049
|
-
var result = perform(function () {
|
|
2050
|
-
var $promiseResolve = aCallable$1(C.resolve);
|
|
2051
|
-
var values = [];
|
|
2052
|
-
var counter = 0;
|
|
2053
|
-
var remaining = 1;
|
|
2054
|
-
iterate(iterable, function (promise) {
|
|
2055
|
-
var index = counter++;
|
|
2056
|
-
var alreadyCalled = false;
|
|
2057
|
-
remaining++;
|
|
2058
|
-
call$5($promiseResolve, C, promise).then(function (value) {
|
|
2059
|
-
if (alreadyCalled) return;
|
|
2060
|
-
alreadyCalled = true;
|
|
2061
|
-
values[index] = value;
|
|
2062
|
-
--remaining || resolve(values);
|
|
2063
|
-
}, reject);
|
|
2064
|
-
});
|
|
2065
|
-
--remaining || resolve(values);
|
|
2066
|
-
});
|
|
2067
|
-
if (result.error) reject(result.value);
|
|
2068
|
-
return capability.promise;
|
|
2069
|
-
},
|
|
2070
|
-
// `Promise.race` method
|
|
2071
|
-
// https://tc39.es/ecma262/#sec-promise.race
|
|
2072
|
-
race: function race(iterable) {
|
|
2073
|
-
var C = this;
|
|
2074
|
-
var capability = newPromiseCapability(C);
|
|
2075
|
-
var reject = capability.reject;
|
|
2076
|
-
var result = perform(function () {
|
|
2077
|
-
var $promiseResolve = aCallable$1(C.resolve);
|
|
2078
|
-
iterate(iterable, function (promise) {
|
|
2079
|
-
call$5($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
2080
|
-
});
|
|
2081
|
-
});
|
|
2082
|
-
if (result.error) reject(result.value);
|
|
2083
|
-
return capability.promise;
|
|
2084
|
-
}
|
|
2085
|
-
});
|
|
2086
|
-
|
|
2087
|
-
var internalObjectKeys = objectKeysInternal;
|
|
2088
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
2089
|
-
|
|
2090
|
-
// `Object.keys` method
|
|
2091
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
2092
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
2093
|
-
var objectKeys$2 = Object.keys || function keys(O) {
|
|
2094
|
-
return internalObjectKeys(O, enumBugKeys$1);
|
|
2095
|
-
};
|
|
2096
|
-
|
|
2097
|
-
var DESCRIPTORS$1 = descriptors;
|
|
2098
|
-
var uncurryThis$a = functionUncurryThis;
|
|
2099
|
-
var call$4 = functionCall;
|
|
2100
|
-
var fails$8 = fails$i;
|
|
2101
|
-
var objectKeys$1 = objectKeys$2;
|
|
2102
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
2103
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
2104
|
-
var toObject$2 = toObject$4;
|
|
2105
|
-
var IndexedObject$1 = indexedObject;
|
|
2106
|
-
|
|
2107
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
2108
|
-
var $assign = Object.assign;
|
|
2109
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
2110
|
-
var defineProperty = Object.defineProperty;
|
|
2111
|
-
var concat$1 = uncurryThis$a([].concat);
|
|
2112
|
-
|
|
2113
|
-
// `Object.assign` method
|
|
2114
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
2115
|
-
var objectAssign = !$assign || fails$8(function () {
|
|
2116
|
-
// should have correct order of operations (Edge bug)
|
|
2117
|
-
if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
2118
|
-
enumerable: true,
|
|
2119
|
-
get: function () {
|
|
2120
|
-
defineProperty(this, 'b', {
|
|
2121
|
-
value: 3,
|
|
2122
|
-
enumerable: false
|
|
2123
|
-
});
|
|
2124
|
-
}
|
|
2125
|
-
}), { b: 2 })).b !== 1) return true;
|
|
2126
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
|
2127
|
-
var A = {};
|
|
2128
|
-
var B = {};
|
|
2129
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
2130
|
-
var symbol = Symbol();
|
|
2131
|
-
var alphabet = 'abcdefghijklmnopqrst';
|
|
2132
|
-
A[symbol] = 7;
|
|
2133
|
-
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
2134
|
-
return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
|
|
2135
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
2136
|
-
var T = toObject$2(target);
|
|
2137
|
-
var argumentsLength = arguments.length;
|
|
2138
|
-
var index = 1;
|
|
2139
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
2140
|
-
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
2141
|
-
while (argumentsLength > index) {
|
|
2142
|
-
var S = IndexedObject$1(arguments[index++]);
|
|
2143
|
-
var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
|
|
2144
|
-
var length = keys.length;
|
|
2145
|
-
var j = 0;
|
|
2146
|
-
var key;
|
|
2147
|
-
while (length > j) {
|
|
2148
|
-
key = keys[j++];
|
|
2149
|
-
if (!DESCRIPTORS$1 || call$4(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
2150
|
-
}
|
|
2151
|
-
} return T;
|
|
2152
|
-
} : $assign;
|
|
2153
|
-
|
|
2154
|
-
var $$5 = _export;
|
|
2155
|
-
var assign = objectAssign;
|
|
2156
|
-
|
|
2157
|
-
// `Object.assign` method
|
|
2158
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
2159
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
2160
|
-
$$5({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
|
2161
|
-
assign: assign
|
|
2162
|
-
});
|
|
2163
|
-
|
|
2164
|
-
var isObject = isObject$8;
|
|
2165
|
-
var classof$2 = classofRaw$1;
|
|
2166
|
-
var wellKnownSymbol$3 = wellKnownSymbol$e;
|
|
2167
|
-
|
|
2168
|
-
var MATCH$1 = wellKnownSymbol$3('match');
|
|
2169
|
-
|
|
2170
|
-
// `IsRegExp` abstract operation
|
|
2171
|
-
// https://tc39.es/ecma262/#sec-isregexp
|
|
2172
|
-
var isRegexp = function (it) {
|
|
2173
|
-
var isRegExp;
|
|
2174
|
-
return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$2(it) == 'RegExp');
|
|
2175
|
-
};
|
|
2176
|
-
|
|
2177
|
-
var global$9 = global$I;
|
|
2178
|
-
var isRegExp$1 = isRegexp;
|
|
2179
|
-
|
|
2180
|
-
var TypeError$3 = global$9.TypeError;
|
|
2181
|
-
|
|
2182
|
-
var notARegexp = function (it) {
|
|
2183
|
-
if (isRegExp$1(it)) {
|
|
2184
|
-
throw TypeError$3("The method doesn't accept regular expressions");
|
|
2185
|
-
} return it;
|
|
2186
|
-
};
|
|
2187
|
-
|
|
2188
|
-
var global$8 = global$I;
|
|
2189
|
-
var classof$1 = classof$6;
|
|
2190
|
-
|
|
2191
|
-
var String$1 = global$8.String;
|
|
2192
|
-
|
|
2193
|
-
var toString$8 = function (argument) {
|
|
2194
|
-
if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
2195
|
-
return String$1(argument);
|
|
2196
|
-
};
|
|
2197
|
-
|
|
2198
|
-
var wellKnownSymbol$2 = wellKnownSymbol$e;
|
|
2199
|
-
|
|
2200
|
-
var MATCH = wellKnownSymbol$2('match');
|
|
2201
|
-
|
|
2202
|
-
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
2203
|
-
var regexp = /./;
|
|
2204
|
-
try {
|
|
2205
|
-
'/./'[METHOD_NAME](regexp);
|
|
2206
|
-
} catch (error1) {
|
|
2207
|
-
try {
|
|
2208
|
-
regexp[MATCH] = false;
|
|
2209
|
-
return '/./'[METHOD_NAME](regexp);
|
|
2210
|
-
} catch (error2) { /* empty */ }
|
|
2211
|
-
} return false;
|
|
2212
|
-
};
|
|
2213
|
-
|
|
2214
|
-
var $$4 = _export;
|
|
2215
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
2216
|
-
var notARegExp$1 = notARegexp;
|
|
2217
|
-
var requireObjectCoercible$5 = requireObjectCoercible$8;
|
|
2218
|
-
var toString$7 = toString$8;
|
|
2219
|
-
var correctIsRegExpLogic$1 = correctIsRegexpLogic;
|
|
2220
|
-
|
|
2221
|
-
var stringIndexOf$1 = uncurryThis$9(''.indexOf);
|
|
2222
|
-
|
|
2223
|
-
// `String.prototype.includes` method
|
|
2224
|
-
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
2225
|
-
$$4({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
|
|
2226
|
-
includes: function includes(searchString /* , position = 0 */) {
|
|
2227
|
-
return !!~stringIndexOf$1(
|
|
2228
|
-
toString$7(requireObjectCoercible$5(this)),
|
|
2229
|
-
toString$7(notARegExp$1(searchString)),
|
|
2230
|
-
arguments.length > 1 ? arguments[1] : undefined
|
|
2231
|
-
);
|
|
2232
|
-
}
|
|
2233
|
-
});
|
|
2234
|
-
|
|
2235
|
-
/*! *****************************************************************************
|
|
2236
|
-
Copyright (c) Microsoft Corporation.
|
|
2237
|
-
|
|
2238
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2239
|
-
purpose with or without fee is hereby granted.
|
|
2240
|
-
|
|
2241
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2242
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2243
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2244
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2245
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2246
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2247
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2248
|
-
***************************************************************************** */
|
|
2249
|
-
|
|
2250
|
-
var __assign = function() {
|
|
2251
|
-
__assign = Object.assign || function __assign(t) {
|
|
2252
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2253
|
-
s = arguments[i];
|
|
2254
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2255
|
-
}
|
|
2256
|
-
return t;
|
|
2257
|
-
};
|
|
2258
|
-
return __assign.apply(this, arguments);
|
|
2259
|
-
};
|
|
2260
|
-
|
|
2261
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2262
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2263
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2264
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2265
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2266
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2267
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2268
|
-
});
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
function __generator(thisArg, body) {
|
|
2272
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
2273
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
2274
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
2275
|
-
function step(op) {
|
|
2276
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
2277
|
-
while (_) try {
|
|
2278
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
2279
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
2280
|
-
switch (op[0]) {
|
|
2281
|
-
case 0: case 1: t = op; break;
|
|
2282
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
2283
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
2284
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
2285
|
-
default:
|
|
2286
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
2287
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
2288
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
2289
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
2290
|
-
if (t[2]) _.ops.pop();
|
|
2291
|
-
_.trys.pop(); continue;
|
|
2292
|
-
}
|
|
2293
|
-
op = body.call(thisArg, _);
|
|
2294
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
2295
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
function __spreadArray(to, from, pack) {
|
|
2300
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2301
|
-
if (ar || !(i in from)) {
|
|
2302
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2303
|
-
ar[i] = from[i];
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2307
|
-
}
|
|
2308
|
-
|
|
2309
|
-
var buildClientLocale = function buildClientLocale() {
|
|
2310
|
-
return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language;
|
|
2311
|
-
};
|
|
2312
|
-
|
|
2313
|
-
var buildClientNinetailedRequestContext = function buildClientNinetailedRequestContext() {
|
|
2314
|
-
return {
|
|
2315
|
-
url: window.location.href,
|
|
2316
|
-
referrer: document.referrer,
|
|
2317
|
-
locale: buildClientLocale(),
|
|
2318
|
-
userAgent: navigator.userAgent,
|
|
2319
|
-
document: {
|
|
2320
|
-
title: document.title
|
|
2321
|
-
}
|
|
2322
|
-
};
|
|
2323
|
-
};
|
|
2324
|
-
|
|
2325
|
-
/**
|
|
2326
|
-
* Similar to _.throttle but waits for the promise to resolve. There is no
|
|
2327
|
-
* wait time because you can simply await `Promise.timeout` inside `fn`
|
|
2328
|
-
* to wait some time before the next call.
|
|
2329
|
-
*/
|
|
2330
|
-
|
|
2331
|
-
function asyncThrottle(fn) {
|
|
2332
|
-
var _this = this;
|
|
2333
|
-
|
|
2334
|
-
var runningPromise;
|
|
2335
|
-
var queuedPromise;
|
|
2336
|
-
var nextArgs;
|
|
2337
|
-
return function (args) {
|
|
2338
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
2339
|
-
return __generator(this, function (_a) {
|
|
2340
|
-
if (runningPromise) {
|
|
2341
|
-
nextArgs = args;
|
|
2342
|
-
|
|
2343
|
-
if (queuedPromise) {
|
|
2344
|
-
return [2
|
|
2345
|
-
/*return*/
|
|
2346
|
-
, queuedPromise];
|
|
2347
|
-
} else {
|
|
2348
|
-
queuedPromise = runningPromise.then(function () {
|
|
2349
|
-
queuedPromise = undefined;
|
|
2350
|
-
runningPromise = fn(nextArgs);
|
|
2351
|
-
return runningPromise;
|
|
2352
|
-
});
|
|
2353
|
-
return [2
|
|
2354
|
-
/*return*/
|
|
2355
|
-
, queuedPromise];
|
|
2356
|
-
}
|
|
2357
|
-
} else {
|
|
2358
|
-
runningPromise = fn(args);
|
|
2359
|
-
return [2
|
|
2360
|
-
/*return*/
|
|
2361
|
-
, runningPromise];
|
|
2362
|
-
}
|
|
2363
|
-
});
|
|
2364
|
-
});
|
|
2365
|
-
};
|
|
2366
|
-
}
|
|
2367
|
-
|
|
2368
|
-
var LEGACY_ANONYMOUS_ID = '__anon_id';
|
|
2369
|
-
var ANONYMOUS_ID = '__nt_anonymous_id__';
|
|
2370
|
-
var DEBUG_FLAG = '__nt_debug__';
|
|
2371
|
-
var PROFILE_FALLBACK_CACHE = '__nt_profile__';
|
|
2372
|
-
|
|
2373
|
-
var NINETAILED_TRACKER_EVENTS = {
|
|
2374
|
-
/**
|
|
2375
|
-
* `profile` - Fires when the profile is returned by the cdp API.
|
|
2376
|
-
*/
|
|
2377
|
-
profile: 'profile'
|
|
2378
|
-
};
|
|
2379
|
-
var PLUGIN_NAME = 'ninetailed';
|
|
2380
|
-
|
|
2381
|
-
var delay = function delay(ms) {
|
|
2382
|
-
return new Promise(function (resolve) {
|
|
2383
|
-
return setTimeout(resolve, ms);
|
|
2384
|
-
});
|
|
2385
|
-
};
|
|
2386
|
-
|
|
2387
|
-
var emptyProfile = {
|
|
2388
|
-
id: '',
|
|
2389
|
-
random: 0,
|
|
2390
|
-
audiences: [],
|
|
2391
|
-
traits: {},
|
|
2392
|
-
location: {}
|
|
2393
|
-
};
|
|
2394
|
-
var ninetailedPlugin = function ninetailedPlugin(_a) {
|
|
2395
|
-
var clientId = _a.clientId,
|
|
2396
|
-
environment = _a.environment;
|
|
2397
|
-
_a.preview;
|
|
2398
|
-
var url = _a.url,
|
|
2399
|
-
profile = _a.profile;
|
|
2400
|
-
_a.locale;
|
|
2401
|
-
var apiClient = new experience_jsShared.NinetailedApiClient({
|
|
2402
|
-
clientId: clientId,
|
|
2403
|
-
environment: environment,
|
|
2404
|
-
url: url
|
|
2405
|
-
});
|
|
2406
|
-
var queue = [];
|
|
2407
|
-
|
|
2408
|
-
var flush = function flush(instance) {
|
|
2409
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2410
|
-
var events, anonymousId, profile_1, error_1, fallbackProfile;
|
|
2411
|
-
return __generator(this, function (_a) {
|
|
2412
|
-
switch (_a.label) {
|
|
2413
|
-
case 0:
|
|
2414
|
-
events = Object.assign([], queue);
|
|
2415
|
-
experience_jsShared.logger.info('Start flushing events.');
|
|
2416
|
-
queue = [];
|
|
2417
|
-
|
|
2418
|
-
if (!events.length) {
|
|
2419
|
-
return [2
|
|
2420
|
-
/*return*/
|
|
2421
|
-
];
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
_a.label = 1;
|
|
2425
|
-
|
|
2426
|
-
case 1:
|
|
2427
|
-
_a.trys.push([1, 3,, 4]);
|
|
2428
|
-
|
|
2429
|
-
anonymousId = instance.storage.getItem(ANONYMOUS_ID);
|
|
2430
|
-
return [4
|
|
2431
|
-
/*yield*/
|
|
2432
|
-
, apiClient.upsertProfile(events, anonymousId)];
|
|
2433
|
-
|
|
2434
|
-
case 2:
|
|
2435
|
-
profile_1 = _a.sent();
|
|
2436
|
-
instance.storage.setItem(ANONYMOUS_ID, profile_1.id);
|
|
2437
|
-
instance.storage.setItem(PROFILE_FALLBACK_CACHE, profile_1);
|
|
2438
|
-
experience_jsShared.logger.debug('Profile from api: ', profile_1);
|
|
2439
|
-
instance.dispatch({
|
|
2440
|
-
type: NINETAILED_TRACKER_EVENTS.profile,
|
|
2441
|
-
profile: profile_1
|
|
2442
|
-
});
|
|
2443
|
-
return [3
|
|
2444
|
-
/*break*/
|
|
2445
|
-
, 4];
|
|
2446
|
-
|
|
2447
|
-
case 3:
|
|
2448
|
-
error_1 = _a.sent();
|
|
2449
|
-
experience_jsShared.logger.debug('An error occurred during flushing the events: ', error_1);
|
|
2450
|
-
fallbackProfile = instance.storage.getItem(PROFILE_FALLBACK_CACHE) || emptyProfile;
|
|
2451
|
-
instance.dispatch({
|
|
2452
|
-
type: NINETAILED_TRACKER_EVENTS.profile,
|
|
2453
|
-
profile: fallbackProfile
|
|
2454
|
-
});
|
|
2455
|
-
return [3
|
|
2456
|
-
/*break*/
|
|
2457
|
-
, 4];
|
|
2458
|
-
|
|
2459
|
-
case 4:
|
|
2460
|
-
// This is necessary to make sure that the cache is updated before the next flush is performed
|
|
2461
|
-
return [4
|
|
2462
|
-
/*yield*/
|
|
2463
|
-
, delay(20)];
|
|
2464
|
-
|
|
2465
|
-
case 5:
|
|
2466
|
-
// This is necessary to make sure that the cache is updated before the next flush is performed
|
|
2467
|
-
_a.sent();
|
|
2468
|
-
|
|
2469
|
-
return [2
|
|
2470
|
-
/*return*/
|
|
2471
|
-
];
|
|
2472
|
-
}
|
|
2473
|
-
});
|
|
2474
|
-
});
|
|
2475
|
-
};
|
|
2476
|
-
|
|
2477
|
-
var throttledFlush = asyncThrottle(flush);
|
|
2478
|
-
|
|
2479
|
-
var enqueueEvent = function enqueueEvent(event, instance) {
|
|
2480
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2481
|
-
return __generator(this, function (_a) {
|
|
2482
|
-
queue = unionBy__default["default"]([event], queue, 'messageId');
|
|
2483
|
-
throttledFlush(instance);
|
|
2484
|
-
return [2
|
|
2485
|
-
/*return*/
|
|
2486
|
-
];
|
|
2487
|
-
});
|
|
2488
|
-
});
|
|
2489
|
-
};
|
|
2490
|
-
|
|
2491
|
-
return {
|
|
2492
|
-
name: 'ninetailed',
|
|
2493
|
-
config: {},
|
|
2494
|
-
initialize: function (_a) {
|
|
2495
|
-
var instance = _a.instance;
|
|
2496
|
-
|
|
2497
|
-
if (instance.storage.getItem(DEBUG_FLAG)) {
|
|
2498
|
-
experience_jsShared.logger.addSink(new experience_jsShared.ConsoleLogSink());
|
|
2499
|
-
experience_jsShared.logger.info('Ninetailed Debug Mode is enabled.');
|
|
2500
|
-
} // legacy support for the old anonymousId
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
var legacyAnonymousId = instance.storage.getItem(LEGACY_ANONYMOUS_ID);
|
|
2504
|
-
|
|
2505
|
-
if (legacyAnonymousId) {
|
|
2506
|
-
experience_jsShared.logger.debug('Found legacy anonymousId, migrating to new one.', legacyAnonymousId);
|
|
2507
|
-
instance.storage.setItem(ANONYMOUS_ID, legacyAnonymousId);
|
|
2508
|
-
instance.storage.removeItem(LEGACY_ANONYMOUS_ID);
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
if (profile) {
|
|
2512
|
-
instance.storage.setItem(ANONYMOUS_ID, profile.id);
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
experience_jsShared.logger.debug('Ninetailed Core plugin initialized.');
|
|
2516
|
-
},
|
|
2517
|
-
page: function (_a) {
|
|
2518
|
-
var payload = _a.payload,
|
|
2519
|
-
instance = _a.instance;
|
|
2520
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2521
|
-
var ctx;
|
|
2522
|
-
return __generator(this, function (_b) {
|
|
2523
|
-
switch (_b.label) {
|
|
2524
|
-
case 0:
|
|
2525
|
-
experience_jsShared.logger.info('Sending Page event.');
|
|
2526
|
-
ctx = buildClientNinetailedRequestContext();
|
|
2527
|
-
return [4
|
|
2528
|
-
/*yield*/
|
|
2529
|
-
, enqueueEvent(experience_jsShared.buildPageEvent({
|
|
2530
|
-
messageId: payload.meta.rid,
|
|
2531
|
-
timestamp: payload.meta.ts,
|
|
2532
|
-
properties: payload.properties,
|
|
2533
|
-
ctx: ctx
|
|
2534
|
-
}), instance)];
|
|
2535
|
-
|
|
2536
|
-
case 1:
|
|
2537
|
-
_b.sent();
|
|
2538
|
-
|
|
2539
|
-
return [2
|
|
2540
|
-
/*return*/
|
|
2541
|
-
];
|
|
2542
|
-
}
|
|
2543
|
-
});
|
|
2544
|
-
});
|
|
2545
|
-
},
|
|
2546
|
-
track: function (_a) {
|
|
2547
|
-
var payload = _a.payload,
|
|
2548
|
-
instance = _a.instance;
|
|
2549
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2550
|
-
var ctx;
|
|
2551
|
-
return __generator(this, function (_b) {
|
|
2552
|
-
switch (_b.label) {
|
|
2553
|
-
case 0:
|
|
2554
|
-
experience_jsShared.logger.info('Sending Track event.');
|
|
2555
|
-
ctx = buildClientNinetailedRequestContext();
|
|
2556
|
-
return [4
|
|
2557
|
-
/*yield*/
|
|
2558
|
-
, enqueueEvent(experience_jsShared.buildTrackEvent({
|
|
2559
|
-
messageId: payload.meta.rid,
|
|
2560
|
-
timestamp: payload.meta.ts,
|
|
2561
|
-
event: payload.event,
|
|
2562
|
-
properties: payload.properties,
|
|
2563
|
-
ctx: ctx
|
|
2564
|
-
}), instance)];
|
|
2565
|
-
|
|
2566
|
-
case 1:
|
|
2567
|
-
_b.sent();
|
|
2568
|
-
|
|
2569
|
-
return [2
|
|
2570
|
-
/*return*/
|
|
2571
|
-
];
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
});
|
|
2575
|
-
},
|
|
2576
|
-
identify: function (_a) {
|
|
2577
|
-
var payload = _a.payload,
|
|
2578
|
-
instance = _a.instance;
|
|
2579
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2580
|
-
var ctx;
|
|
2581
|
-
return __generator(this, function (_b) {
|
|
2582
|
-
switch (_b.label) {
|
|
2583
|
-
case 0:
|
|
2584
|
-
experience_jsShared.logger.info('Sending Identify event.');
|
|
2585
|
-
ctx = buildClientNinetailedRequestContext();
|
|
2586
|
-
return [4
|
|
2587
|
-
/*yield*/
|
|
2588
|
-
, enqueueEvent(experience_jsShared.buildIdentifyEvent({
|
|
2589
|
-
// doing this here as the anonymous id is set to late from init
|
|
2590
|
-
messageId: payload.meta.rid,
|
|
2591
|
-
timestamp: payload.meta.ts,
|
|
2592
|
-
traits: payload.traits,
|
|
2593
|
-
userId: payload.userId,
|
|
2594
|
-
ctx: ctx
|
|
2595
|
-
}), instance)];
|
|
2596
|
-
|
|
2597
|
-
case 1:
|
|
2598
|
-
_b.sent();
|
|
2599
|
-
|
|
2600
|
-
return [2
|
|
2601
|
-
/*return*/
|
|
2602
|
-
];
|
|
2603
|
-
}
|
|
2604
|
-
});
|
|
2605
|
-
});
|
|
2606
|
-
},
|
|
2607
|
-
setItemStart: function (_a) {
|
|
2608
|
-
var abort = _a.abort,
|
|
2609
|
-
payload = _a.payload;
|
|
2610
|
-
|
|
2611
|
-
if (![ANONYMOUS_ID, DEBUG_FLAG, PROFILE_FALLBACK_CACHE].includes(payload.key)) {
|
|
2612
|
-
return abort();
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
return payload;
|
|
2616
|
-
},
|
|
2617
|
-
methods: {
|
|
2618
|
-
reset: function () {
|
|
2619
|
-
var args = [];
|
|
2620
|
-
|
|
2621
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2622
|
-
args[_i] = arguments[_i];
|
|
2623
|
-
}
|
|
2624
|
-
|
|
2625
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2626
|
-
var instance;
|
|
2627
|
-
return __generator(this, function (_a) {
|
|
2628
|
-
switch (_a.label) {
|
|
2629
|
-
case 0:
|
|
2630
|
-
instance = args[args.length - 1];
|
|
2631
|
-
return [4
|
|
2632
|
-
/*yield*/
|
|
2633
|
-
, instance.storage.removeItem(ANONYMOUS_ID)];
|
|
2634
|
-
|
|
2635
|
-
case 1:
|
|
2636
|
-
_a.sent();
|
|
2637
|
-
|
|
2638
|
-
instance.dispatch({
|
|
2639
|
-
type: NINETAILED_TRACKER_EVENTS.profile,
|
|
2640
|
-
profile: emptyProfile
|
|
2641
|
-
});
|
|
2642
|
-
return [4
|
|
2643
|
-
/*yield*/
|
|
2644
|
-
, delay(10)];
|
|
2645
|
-
|
|
2646
|
-
case 2:
|
|
2647
|
-
_a.sent();
|
|
2648
|
-
|
|
2649
|
-
return [2
|
|
2650
|
-
/*return*/
|
|
2651
|
-
];
|
|
2652
|
-
}
|
|
2653
|
-
});
|
|
2654
|
-
});
|
|
2655
|
-
},
|
|
2656
|
-
debug: function () {
|
|
2657
|
-
var args = [];
|
|
2658
|
-
|
|
2659
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2660
|
-
args[_i] = arguments[_i];
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2664
|
-
var enabled, instance, consoleLogSink;
|
|
2665
|
-
return __generator(this, function (_a) {
|
|
2666
|
-
switch (_a.label) {
|
|
2667
|
-
case 0:
|
|
2668
|
-
enabled = args[0];
|
|
2669
|
-
instance = args[args.length - 1];
|
|
2670
|
-
consoleLogSink = new experience_jsShared.ConsoleLogSink();
|
|
2671
|
-
if (!enabled) return [3
|
|
2672
|
-
/*break*/
|
|
2673
|
-
, 2];
|
|
2674
|
-
return [4
|
|
2675
|
-
/*yield*/
|
|
2676
|
-
, instance.storage.setItem(DEBUG_FLAG, true)];
|
|
2677
|
-
|
|
2678
|
-
case 1:
|
|
2679
|
-
_a.sent();
|
|
2680
|
-
|
|
2681
|
-
experience_jsShared.logger.addSink(consoleLogSink);
|
|
2682
|
-
experience_jsShared.logger.info('Debug mode enabled.');
|
|
2683
|
-
return [3
|
|
2684
|
-
/*break*/
|
|
2685
|
-
, 4];
|
|
2686
|
-
|
|
2687
|
-
case 2:
|
|
2688
|
-
return [4
|
|
2689
|
-
/*yield*/
|
|
2690
|
-
, instance.storage.removeItem(DEBUG_FLAG)];
|
|
2691
|
-
|
|
2692
|
-
case 3:
|
|
2693
|
-
_a.sent();
|
|
2694
|
-
|
|
2695
|
-
experience_jsShared.logger.info('Debug mode disabled.');
|
|
2696
|
-
experience_jsShared.logger.removeSink(consoleLogSink.name);
|
|
2697
|
-
_a.label = 4;
|
|
2698
|
-
|
|
2699
|
-
case 4:
|
|
2700
|
-
return [2
|
|
2701
|
-
/*return*/
|
|
2702
|
-
];
|
|
2703
|
-
}
|
|
2704
|
-
});
|
|
2705
|
-
});
|
|
2706
|
-
}
|
|
2707
|
-
}
|
|
2708
|
-
};
|
|
2709
|
-
};
|
|
2710
|
-
|
|
2711
|
-
var Ninetailed =
|
|
2712
|
-
/** @class */
|
|
2713
|
-
function () {
|
|
2714
|
-
function Ninetailed(_a, _b) {
|
|
2715
|
-
var _this = this;
|
|
2716
|
-
|
|
2717
|
-
var clientId = _a.clientId,
|
|
2718
|
-
environment = _a.environment,
|
|
2719
|
-
preview = _a.preview;
|
|
2720
|
-
|
|
2721
|
-
var _c = _b === void 0 ? {} : _b,
|
|
2722
|
-
plugins = _c.plugins,
|
|
2723
|
-
url = _c.url,
|
|
2724
|
-
profile = _c.profile,
|
|
2725
|
-
locale = _c.locale,
|
|
2726
|
-
requestTimeout = _c.requestTimeout,
|
|
2727
|
-
onLog = _c.onLog,
|
|
2728
|
-
onError = _c.onError;
|
|
2729
|
-
|
|
2730
|
-
this.isInitialized = false;
|
|
2731
|
-
|
|
2732
|
-
this.page = function (data, options) {
|
|
2733
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
2734
|
-
return __generator(this, function (_a) {
|
|
2735
|
-
switch (_a.label) {
|
|
2736
|
-
case 0:
|
|
2737
|
-
return [4
|
|
2738
|
-
/*yield*/
|
|
2739
|
-
, this.waitUntilInitialized()];
|
|
2740
|
-
|
|
2741
|
-
case 1:
|
|
2742
|
-
_a.sent();
|
|
2743
|
-
|
|
2744
|
-
return [2
|
|
2745
|
-
/*return*/
|
|
2746
|
-
, this.instance.page(data, this.buildOptions(options))];
|
|
2747
|
-
}
|
|
2748
|
-
});
|
|
2749
|
-
});
|
|
2750
|
-
};
|
|
2751
|
-
|
|
2752
|
-
this.track = function (event, payload, options) {
|
|
2753
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
2754
|
-
return __generator(this, function (_a) {
|
|
2755
|
-
switch (_a.label) {
|
|
2756
|
-
case 0:
|
|
2757
|
-
return [4
|
|
2758
|
-
/*yield*/
|
|
2759
|
-
, this.waitUntilInitialized()];
|
|
2760
|
-
|
|
2761
|
-
case 1:
|
|
2762
|
-
_a.sent();
|
|
2763
|
-
|
|
2764
|
-
return [2
|
|
2765
|
-
/*return*/
|
|
2766
|
-
, this.instance.track(event, payload, this.buildOptions(options))];
|
|
2767
|
-
}
|
|
2768
|
-
});
|
|
2769
|
-
});
|
|
2770
|
-
};
|
|
2771
|
-
|
|
2772
|
-
this.trackHasSeenComponent = function (payload) {
|
|
2773
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
2774
|
-
return __generator(this, function (_a) {
|
|
2775
|
-
return [2
|
|
2776
|
-
/*return*/
|
|
2777
|
-
, this.track('hasSeenComponent', payload, {
|
|
2778
|
-
plugins: {
|
|
2779
|
-
all: true,
|
|
2780
|
-
ninetailed: false
|
|
2781
|
-
}
|
|
2782
|
-
})];
|
|
2783
|
-
});
|
|
2784
|
-
});
|
|
2785
|
-
};
|
|
2786
|
-
|
|
2787
|
-
this.trackExperience = function (payload) {
|
|
2788
|
-
return _this.track('nt_experience', payload, {
|
|
2789
|
-
plugins: {
|
|
2790
|
-
all: true,
|
|
2791
|
-
ninetailed: false
|
|
2792
|
-
}
|
|
2793
|
-
});
|
|
2794
|
-
};
|
|
2795
|
-
|
|
2796
|
-
this.identify = function (uid, traits, options) {
|
|
2797
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
2798
|
-
return __generator(this, function (_a) {
|
|
2799
|
-
switch (_a.label) {
|
|
2800
|
-
case 0:
|
|
2801
|
-
return [4
|
|
2802
|
-
/*yield*/
|
|
2803
|
-
, this.waitUntilInitialized()];
|
|
2804
|
-
|
|
2805
|
-
case 1:
|
|
2806
|
-
_a.sent();
|
|
2807
|
-
/*console.log("Identify triggered");*/
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
return [2
|
|
2811
|
-
/*return*/
|
|
2812
|
-
, this.instance.identify(uid, traits, this.buildOptions(options))];
|
|
2813
|
-
}
|
|
2814
|
-
});
|
|
2815
|
-
});
|
|
2816
|
-
};
|
|
2817
|
-
|
|
2818
|
-
this.reset = function () {
|
|
2819
|
-
_this.onIsInitialized(function () {
|
|
2820
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2821
|
-
// @ts-ignore
|
|
2822
|
-
_this.instance.plugins[PLUGIN_NAME].reset();
|
|
2823
|
-
});
|
|
2824
|
-
};
|
|
2825
|
-
|
|
2826
|
-
this.debug = function (enabled) {
|
|
2827
|
-
_this.onIsInitialized(function () {
|
|
2828
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2829
|
-
// @ts-ignore
|
|
2830
|
-
_this.instance.plugins[PLUGIN_NAME].debug(enabled);
|
|
2831
|
-
});
|
|
2832
|
-
};
|
|
2833
|
-
|
|
2834
|
-
this.onProfileChange = function (cb) {
|
|
2835
|
-
cb(_this.profileState);
|
|
2836
|
-
return _this.instance.on(NINETAILED_TRACKER_EVENTS.profile, function (_a) {
|
|
2837
|
-
var payload = _a.payload;
|
|
2838
|
-
cb(__assign(__assign({}, _this._profileState), {
|
|
2839
|
-
status: 'success',
|
|
2840
|
-
profile: payload.profile,
|
|
2841
|
-
error: null
|
|
2842
|
-
}));
|
|
2843
|
-
});
|
|
2844
|
-
};
|
|
2845
|
-
|
|
2846
|
-
this.onIsInitialized = function (onIsInitialized) {
|
|
2847
|
-
if (typeof onIsInitialized === 'function') {
|
|
2848
|
-
if (_this.isInitialized) {
|
|
2849
|
-
onIsInitialized();
|
|
2850
|
-
} else {
|
|
2851
|
-
var detachOnReadyListener_1 = _this.instance.on('ready', function () {
|
|
2852
|
-
onIsInitialized();
|
|
2853
|
-
detachOnReadyListener_1();
|
|
2854
|
-
});
|
|
2855
|
-
}
|
|
2856
|
-
}
|
|
2857
|
-
};
|
|
2858
|
-
|
|
2859
|
-
this.waitUntilInitialized = function () {
|
|
2860
|
-
return new Promise(function (resolve) {
|
|
2861
|
-
_this.onIsInitialized(resolve);
|
|
2862
|
-
});
|
|
2863
|
-
};
|
|
2864
|
-
|
|
2865
|
-
this.plugins = flatten__default["default"](plugins || []);
|
|
2866
|
-
|
|
2867
|
-
if (profile) {
|
|
2868
|
-
this._profileState = {
|
|
2869
|
-
status: 'success',
|
|
2870
|
-
profile: profile,
|
|
2871
|
-
error: null,
|
|
2872
|
-
from: 'hydrated'
|
|
2873
|
-
};
|
|
2874
|
-
} else {
|
|
2875
|
-
this._profileState = {
|
|
2876
|
-
status: 'loading',
|
|
2877
|
-
profile: null,
|
|
2878
|
-
error: null,
|
|
2879
|
-
from: 'api'
|
|
2880
|
-
};
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
if (typeof onLog === 'function') {
|
|
2884
|
-
experience_jsShared.logger.addSink(new experience_jsShared.OnLogLogSink(onLog));
|
|
2885
|
-
}
|
|
2886
|
-
|
|
2887
|
-
if (typeof onError === 'function') {
|
|
2888
|
-
experience_jsShared.logger.addSink(new experience_jsShared.OnErrorLogSink(onError));
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
this.logger = experience_jsShared.logger;
|
|
2892
|
-
this.instance = Analytics__default["default"]({
|
|
2893
|
-
app: 'ninetailed',
|
|
2894
|
-
plugins: __spreadArray(__spreadArray([], this.plugins, true), [ninetailedPlugin({
|
|
2895
|
-
clientId: clientId,
|
|
2896
|
-
environment: environment,
|
|
2897
|
-
url: url,
|
|
2898
|
-
profile: profile,
|
|
2899
|
-
locale: locale,
|
|
2900
|
-
requestTimeout: requestTimeout,
|
|
2901
|
-
preview: preview
|
|
2902
|
-
})], false)
|
|
2903
|
-
});
|
|
2904
|
-
var detachOnReadyListener = this.instance.on('ready', function () {
|
|
2905
|
-
_this.isInitialized = true;
|
|
2906
|
-
experience_jsShared.logger.info('Ninetailed Experience.js SDK is completely initialized.');
|
|
2907
|
-
detachOnReadyListener();
|
|
2908
|
-
}); // put in private method
|
|
2909
|
-
|
|
2910
|
-
this.onProfileChange(function (profileState) {
|
|
2911
|
-
_this._profileState = profileState;
|
|
2912
|
-
});
|
|
2913
|
-
this.registerWindowHandlers();
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
Object.defineProperty(Ninetailed.prototype, "profileState", {
|
|
2917
|
-
get: function () {
|
|
2918
|
-
return this._profileState;
|
|
2919
|
-
},
|
|
2920
|
-
enumerable: false,
|
|
2921
|
-
configurable: true
|
|
2922
|
-
});
|
|
2923
|
-
|
|
2924
|
-
Ninetailed.prototype.buildOptions = function (options) {
|
|
2925
|
-
if (options === void 0) {
|
|
2926
|
-
options = {};
|
|
2927
|
-
}
|
|
2928
|
-
|
|
2929
|
-
return __assign({}, options);
|
|
2930
|
-
};
|
|
2931
|
-
|
|
2932
|
-
Ninetailed.prototype.registerWindowHandlers = function () {
|
|
2933
|
-
if (typeof window !== 'undefined') {
|
|
2934
|
-
window.ninetailed = Object.assign({}, window.ninetailed, {
|
|
2935
|
-
page: this.page.bind(this),
|
|
2936
|
-
track: this.track.bind(this),
|
|
2937
|
-
trackHasSeenComponent: this.trackHasSeenComponent.bind(this),
|
|
2938
|
-
identify: this.identify.bind(this),
|
|
2939
|
-
reset: this.reset.bind(this),
|
|
2940
|
-
debug: this.debug.bind(this)
|
|
2941
|
-
});
|
|
2942
|
-
}
|
|
2943
|
-
};
|
|
2944
|
-
|
|
2945
|
-
return Ninetailed;
|
|
2946
|
-
}();
|
|
2947
|
-
|
|
2948
|
-
var selectVariant$1 = function selectVariant(baseline, variants, _a, options) {
|
|
2949
|
-
var status = _a.status,
|
|
2950
|
-
profile = _a.profile,
|
|
2951
|
-
error = _a.error;
|
|
2952
|
-
|
|
2953
|
-
if (options === void 0) {
|
|
2954
|
-
options = {
|
|
2955
|
-
holdout: -1
|
|
2956
|
-
};
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
if (status === 'loading') {
|
|
2960
|
-
return {
|
|
2961
|
-
loading: true,
|
|
2962
|
-
variant: __assign(__assign({}, baseline), {
|
|
2963
|
-
id: 'baseline',
|
|
2964
|
-
audience: {
|
|
2965
|
-
id: 'baseline'
|
|
2966
|
-
}
|
|
2967
|
-
}),
|
|
2968
|
-
audience: {
|
|
2969
|
-
id: 'baseline'
|
|
2970
|
-
},
|
|
2971
|
-
isPersonalized: false,
|
|
2972
|
-
error: null
|
|
2973
|
-
};
|
|
2974
|
-
}
|
|
2975
|
-
|
|
2976
|
-
if (status === 'error') {
|
|
2977
|
-
return {
|
|
2978
|
-
loading: false,
|
|
2979
|
-
variant: __assign(__assign({}, baseline), {
|
|
2980
|
-
id: 'baseline',
|
|
2981
|
-
audience: {
|
|
2982
|
-
id: 'baseline'
|
|
2983
|
-
}
|
|
2984
|
-
}),
|
|
2985
|
-
audience: {
|
|
2986
|
-
id: 'baseline'
|
|
2987
|
-
},
|
|
2988
|
-
isPersonalized: false,
|
|
2989
|
-
error: error
|
|
2990
|
-
};
|
|
2991
|
-
}
|
|
2992
|
-
|
|
2993
|
-
var variant = find__default["default"](variants, function (variant) {
|
|
2994
|
-
var _a;
|
|
2995
|
-
|
|
2996
|
-
return includes__default["default"](profile === null || profile === void 0 ? void 0 : profile.audiences, (_a = variant.audience) === null || _a === void 0 ? void 0 : _a.id);
|
|
2997
|
-
});
|
|
2998
|
-
|
|
2999
|
-
if (variant) {
|
|
3000
|
-
// @ts-ignore
|
|
3001
|
-
if ((options === null || options === void 0 ? void 0 : options.holdout) || -1 > (profile === null || profile === void 0 ? void 0 : profile.random)) {
|
|
3002
|
-
return {
|
|
3003
|
-
loading: false,
|
|
3004
|
-
variant: __assign(__assign({}, baseline), {
|
|
3005
|
-
audience: {
|
|
3006
|
-
id: 'baseline'
|
|
3007
|
-
}
|
|
3008
|
-
}),
|
|
3009
|
-
audience: __assign(__assign({}, variant.audience), {
|
|
3010
|
-
id: variant.audience.id
|
|
3011
|
-
}),
|
|
3012
|
-
isPersonalized: false,
|
|
3013
|
-
error: null
|
|
3014
|
-
};
|
|
3015
|
-
}
|
|
3016
|
-
|
|
3017
|
-
return {
|
|
3018
|
-
loading: false,
|
|
3019
|
-
variant: variant,
|
|
3020
|
-
audience: __assign(__assign({}, variant.audience), {
|
|
3021
|
-
id: variant.audience.id
|
|
3022
|
-
}),
|
|
3023
|
-
isPersonalized: true,
|
|
3024
|
-
error: null
|
|
3025
|
-
};
|
|
3026
|
-
}
|
|
3027
|
-
/**
|
|
3028
|
-
* There was no matching audience found.
|
|
3029
|
-
*/
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
return {
|
|
3033
|
-
loading: false,
|
|
3034
|
-
variant: __assign(__assign({}, baseline), {
|
|
3035
|
-
id: 'baseline',
|
|
3036
|
-
audience: {
|
|
3037
|
-
id: 'baseline'
|
|
3038
|
-
}
|
|
3039
|
-
}),
|
|
3040
|
-
audience: {
|
|
3041
|
-
id: 'baseline'
|
|
3042
|
-
},
|
|
3043
|
-
isPersonalized: false,
|
|
3044
|
-
error: null
|
|
3045
|
-
};
|
|
3046
|
-
};
|
|
3047
|
-
|
|
3048
|
-
var EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
3049
|
-
|
|
3050
|
-
var selectBaselineWithVariants = function selectBaselineWithVariants(experience, baseline) {
|
|
3051
|
-
var _a;
|
|
3052
|
-
|
|
3053
|
-
return (_a = experience.components.find(function (baselineWithVariants) {
|
|
3054
|
-
return baselineWithVariants.baseline.id === baseline.id;
|
|
3055
|
-
})) !== null && _a !== void 0 ? _a : null;
|
|
3056
|
-
};
|
|
3057
|
-
|
|
3058
|
-
var selectVariants = function selectVariants(experience, baseline) {
|
|
3059
|
-
var baselineWithVariants = selectBaselineWithVariants(experience, baseline);
|
|
3060
|
-
|
|
3061
|
-
if (!baselineWithVariants) {
|
|
3062
|
-
return [];
|
|
3063
|
-
}
|
|
3064
|
-
|
|
3065
|
-
return baselineWithVariants.variants;
|
|
3066
|
-
};
|
|
3067
|
-
|
|
3068
|
-
var selectHasVariants = function selectHasVariants(experience, baseline) {
|
|
3069
|
-
var variants = selectVariants(experience, baseline);
|
|
3070
|
-
return variants.length > 0;
|
|
3071
|
-
};
|
|
3072
|
-
|
|
3073
|
-
var $$3 = _export;
|
|
3074
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
3075
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
3076
|
-
var toLength$2 = toLength$4;
|
|
3077
|
-
var toString$6 = toString$8;
|
|
3078
|
-
var notARegExp = notARegexp;
|
|
3079
|
-
var requireObjectCoercible$4 = requireObjectCoercible$8;
|
|
3080
|
-
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
3081
|
-
|
|
3082
|
-
// eslint-disable-next-line es/no-string-prototype-startswith -- safe
|
|
3083
|
-
var un$StartsWith = uncurryThis$8(''.startsWith);
|
|
3084
|
-
var stringSlice$5 = uncurryThis$8(''.slice);
|
|
3085
|
-
var min$2 = Math.min;
|
|
3086
|
-
|
|
3087
|
-
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
|
3088
|
-
// https://github.com/zloirock/core-js/pull/702
|
|
3089
|
-
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
3090
|
-
var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
|
|
3091
|
-
return descriptor && !descriptor.writable;
|
|
3092
|
-
}();
|
|
3093
|
-
|
|
3094
|
-
// `String.prototype.startsWith` method
|
|
3095
|
-
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
3096
|
-
$$3({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
3097
|
-
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
3098
|
-
var that = toString$6(requireObjectCoercible$4(this));
|
|
3099
|
-
notARegExp(searchString);
|
|
3100
|
-
var index = toLength$2(min$2(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
3101
|
-
var search = toString$6(searchString);
|
|
3102
|
-
return un$StartsWith
|
|
3103
|
-
? un$StartsWith(that, search, index)
|
|
3104
|
-
: stringSlice$5(that, index, index + search.length) === search;
|
|
3105
|
-
}
|
|
3106
|
-
});
|
|
3107
|
-
|
|
3108
|
-
var anObject$5 = anObject$e;
|
|
3109
|
-
|
|
3110
|
-
// `RegExp.prototype.flags` getter implementation
|
|
3111
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
3112
|
-
var regexpFlags$1 = function () {
|
|
3113
|
-
var that = anObject$5(this);
|
|
3114
|
-
var result = '';
|
|
3115
|
-
if (that.global) result += 'g';
|
|
3116
|
-
if (that.ignoreCase) result += 'i';
|
|
3117
|
-
if (that.multiline) result += 'm';
|
|
3118
|
-
if (that.dotAll) result += 's';
|
|
3119
|
-
if (that.unicode) result += 'u';
|
|
3120
|
-
if (that.sticky) result += 'y';
|
|
3121
|
-
return result;
|
|
3122
|
-
};
|
|
3123
|
-
|
|
3124
|
-
var fails$7 = fails$i;
|
|
3125
|
-
var global$7 = global$I;
|
|
3126
|
-
|
|
3127
|
-
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
3128
|
-
var $RegExp$2 = global$7.RegExp;
|
|
3129
|
-
|
|
3130
|
-
var UNSUPPORTED_Y$2 = fails$7(function () {
|
|
3131
|
-
var re = $RegExp$2('a', 'y');
|
|
3132
|
-
re.lastIndex = 2;
|
|
3133
|
-
return re.exec('abcd') != null;
|
|
3134
|
-
});
|
|
3135
|
-
|
|
3136
|
-
// UC Browser bug
|
|
3137
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
3138
|
-
var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$7(function () {
|
|
3139
|
-
return !$RegExp$2('a', 'y').sticky;
|
|
3140
|
-
});
|
|
3141
|
-
|
|
3142
|
-
var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$7(function () {
|
|
3143
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
3144
|
-
var re = $RegExp$2('^r', 'gy');
|
|
3145
|
-
re.lastIndex = 2;
|
|
3146
|
-
return re.exec('str') != null;
|
|
3147
|
-
});
|
|
3148
|
-
|
|
3149
|
-
var regexpStickyHelpers = {
|
|
3150
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
3151
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
3152
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$2
|
|
3153
|
-
};
|
|
3154
|
-
|
|
3155
|
-
var objectDefineProperties = {};
|
|
3156
|
-
|
|
3157
|
-
var DESCRIPTORS = descriptors;
|
|
3158
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
3159
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
3160
|
-
var anObject$4 = anObject$e;
|
|
3161
|
-
var toIndexedObject = toIndexedObject$4;
|
|
3162
|
-
var objectKeys = objectKeys$2;
|
|
3163
|
-
|
|
3164
|
-
// `Object.defineProperties` method
|
|
3165
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
3166
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
3167
|
-
objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
3168
|
-
anObject$4(O);
|
|
3169
|
-
var props = toIndexedObject(Properties);
|
|
3170
|
-
var keys = objectKeys(Properties);
|
|
3171
|
-
var length = keys.length;
|
|
3172
|
-
var index = 0;
|
|
3173
|
-
var key;
|
|
3174
|
-
while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
|
|
3175
|
-
return O;
|
|
3176
|
-
};
|
|
3177
|
-
|
|
3178
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
3179
|
-
|
|
3180
|
-
var anObject$3 = anObject$e;
|
|
3181
|
-
var definePropertiesModule = objectDefineProperties;
|
|
3182
|
-
var enumBugKeys = enumBugKeys$3;
|
|
3183
|
-
var hiddenKeys = hiddenKeys$4;
|
|
3184
|
-
var html = html$2;
|
|
3185
|
-
var documentCreateElement = documentCreateElement$1;
|
|
3186
|
-
var sharedKey = sharedKey$2;
|
|
3187
|
-
|
|
3188
|
-
var GT = '>';
|
|
3189
|
-
var LT = '<';
|
|
3190
|
-
var PROTOTYPE = 'prototype';
|
|
3191
|
-
var SCRIPT = 'script';
|
|
3192
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
3193
|
-
|
|
3194
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
3195
|
-
|
|
3196
|
-
var scriptTag = function (content) {
|
|
3197
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
3198
|
-
};
|
|
3199
|
-
|
|
3200
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
3201
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
3202
|
-
activeXDocument.write(scriptTag(''));
|
|
3203
|
-
activeXDocument.close();
|
|
3204
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
3205
|
-
activeXDocument = null; // avoid memory leak
|
|
3206
|
-
return temp;
|
|
3207
|
-
};
|
|
3208
|
-
|
|
3209
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
3210
|
-
var NullProtoObjectViaIFrame = function () {
|
|
3211
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
3212
|
-
var iframe = documentCreateElement('iframe');
|
|
3213
|
-
var JS = 'java' + SCRIPT + ':';
|
|
3214
|
-
var iframeDocument;
|
|
3215
|
-
iframe.style.display = 'none';
|
|
3216
|
-
html.appendChild(iframe);
|
|
3217
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
3218
|
-
iframe.src = String(JS);
|
|
3219
|
-
iframeDocument = iframe.contentWindow.document;
|
|
3220
|
-
iframeDocument.open();
|
|
3221
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
3222
|
-
iframeDocument.close();
|
|
3223
|
-
return iframeDocument.F;
|
|
3224
|
-
};
|
|
3225
|
-
|
|
3226
|
-
// Check for document.domain and active x support
|
|
3227
|
-
// No need to use active x approach when document.domain is not set
|
|
3228
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
3229
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
3230
|
-
// avoid IE GC bug
|
|
3231
|
-
var activeXDocument;
|
|
3232
|
-
var NullProtoObject = function () {
|
|
3233
|
-
try {
|
|
3234
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
3235
|
-
} catch (error) { /* ignore */ }
|
|
3236
|
-
NullProtoObject = typeof document != 'undefined'
|
|
3237
|
-
? document.domain && activeXDocument
|
|
3238
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
3239
|
-
: NullProtoObjectViaIFrame()
|
|
3240
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
3241
|
-
var length = enumBugKeys.length;
|
|
3242
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
3243
|
-
return NullProtoObject();
|
|
3244
|
-
};
|
|
3245
|
-
|
|
3246
|
-
hiddenKeys[IE_PROTO] = true;
|
|
3247
|
-
|
|
3248
|
-
// `Object.create` method
|
|
3249
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
3250
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
3251
|
-
var result;
|
|
3252
|
-
if (O !== null) {
|
|
3253
|
-
EmptyConstructor[PROTOTYPE] = anObject$3(O);
|
|
3254
|
-
result = new EmptyConstructor();
|
|
3255
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
3256
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
3257
|
-
result[IE_PROTO] = O;
|
|
3258
|
-
} else result = NullProtoObject();
|
|
3259
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
3260
|
-
};
|
|
3261
|
-
|
|
3262
|
-
var fails$6 = fails$i;
|
|
3263
|
-
var global$6 = global$I;
|
|
3264
|
-
|
|
3265
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
3266
|
-
var $RegExp$1 = global$6.RegExp;
|
|
3267
|
-
|
|
3268
|
-
var regexpUnsupportedDotAll = fails$6(function () {
|
|
3269
|
-
var re = $RegExp$1('.', 's');
|
|
3270
|
-
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
3271
|
-
});
|
|
3272
|
-
|
|
3273
|
-
var fails$5 = fails$i;
|
|
3274
|
-
var global$5 = global$I;
|
|
3275
|
-
|
|
3276
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
3277
|
-
var $RegExp = global$5.RegExp;
|
|
3278
|
-
|
|
3279
|
-
var regexpUnsupportedNcg = fails$5(function () {
|
|
3280
|
-
var re = $RegExp('(?<a>b)', 'g');
|
|
3281
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
3282
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
3283
|
-
});
|
|
3284
|
-
|
|
3285
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
3286
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
3287
|
-
var call$3 = functionCall;
|
|
3288
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
3289
|
-
var toString$5 = toString$8;
|
|
3290
|
-
var regexpFlags = regexpFlags$1;
|
|
3291
|
-
var stickyHelpers$1 = regexpStickyHelpers;
|
|
3292
|
-
var shared = shared$4.exports;
|
|
3293
|
-
var create = objectCreate;
|
|
3294
|
-
var getInternalState = internalState.get;
|
|
3295
|
-
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
3296
|
-
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
3297
|
-
|
|
3298
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
3299
|
-
var nativeExec = RegExp.prototype.exec;
|
|
3300
|
-
var patchedExec = nativeExec;
|
|
3301
|
-
var charAt$3 = uncurryThis$7(''.charAt);
|
|
3302
|
-
var indexOf = uncurryThis$7(''.indexOf);
|
|
3303
|
-
var replace$2 = uncurryThis$7(''.replace);
|
|
3304
|
-
var stringSlice$4 = uncurryThis$7(''.slice);
|
|
3305
|
-
|
|
3306
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
3307
|
-
var re1 = /a/;
|
|
3308
|
-
var re2 = /b*/g;
|
|
3309
|
-
call$3(nativeExec, re1, 'a');
|
|
3310
|
-
call$3(nativeExec, re2, 'a');
|
|
3311
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
3312
|
-
})();
|
|
3313
|
-
|
|
3314
|
-
var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
|
|
3315
|
-
|
|
3316
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
3317
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
3318
|
-
|
|
3319
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
3320
|
-
|
|
3321
|
-
if (PATCH) {
|
|
3322
|
-
patchedExec = function exec(string) {
|
|
3323
|
-
var re = this;
|
|
3324
|
-
var state = getInternalState(re);
|
|
3325
|
-
var str = toString$5(string);
|
|
3326
|
-
var raw = state.raw;
|
|
3327
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
3328
|
-
|
|
3329
|
-
if (raw) {
|
|
3330
|
-
raw.lastIndex = re.lastIndex;
|
|
3331
|
-
result = call$3(patchedExec, raw, str);
|
|
3332
|
-
re.lastIndex = raw.lastIndex;
|
|
3333
|
-
return result;
|
|
3334
|
-
}
|
|
3335
|
-
|
|
3336
|
-
var groups = state.groups;
|
|
3337
|
-
var sticky = UNSUPPORTED_Y$1 && re.sticky;
|
|
3338
|
-
var flags = call$3(regexpFlags, re);
|
|
3339
|
-
var source = re.source;
|
|
3340
|
-
var charsAdded = 0;
|
|
3341
|
-
var strCopy = str;
|
|
3342
|
-
|
|
3343
|
-
if (sticky) {
|
|
3344
|
-
flags = replace$2(flags, 'y', '');
|
|
3345
|
-
if (indexOf(flags, 'g') === -1) {
|
|
3346
|
-
flags += 'g';
|
|
3347
|
-
}
|
|
3348
|
-
|
|
3349
|
-
strCopy = stringSlice$4(str, re.lastIndex);
|
|
3350
|
-
// Support anchored sticky behavior.
|
|
3351
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
|
|
3352
|
-
source = '(?: ' + source + ')';
|
|
3353
|
-
strCopy = ' ' + strCopy;
|
|
3354
|
-
charsAdded++;
|
|
3355
|
-
}
|
|
3356
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
3357
|
-
// simulate the 'y' flag.
|
|
3358
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
3359
|
-
}
|
|
3360
|
-
|
|
3361
|
-
if (NPCG_INCLUDED) {
|
|
3362
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
3363
|
-
}
|
|
3364
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
3365
|
-
|
|
3366
|
-
match = call$3(nativeExec, sticky ? reCopy : re, strCopy);
|
|
3367
|
-
|
|
3368
|
-
if (sticky) {
|
|
3369
|
-
if (match) {
|
|
3370
|
-
match.input = stringSlice$4(match.input, charsAdded);
|
|
3371
|
-
match[0] = stringSlice$4(match[0], charsAdded);
|
|
3372
|
-
match.index = re.lastIndex;
|
|
3373
|
-
re.lastIndex += match[0].length;
|
|
3374
|
-
} else re.lastIndex = 0;
|
|
3375
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
3376
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
3377
|
-
}
|
|
3378
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
3379
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
3380
|
-
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
3381
|
-
call$3(nativeReplace, match[0], reCopy, function () {
|
|
3382
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
3383
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
3384
|
-
}
|
|
3385
|
-
});
|
|
3386
|
-
}
|
|
3387
|
-
|
|
3388
|
-
if (match && groups) {
|
|
3389
|
-
match.groups = object = create(null);
|
|
3390
|
-
for (i = 0; i < groups.length; i++) {
|
|
3391
|
-
group = groups[i];
|
|
3392
|
-
object[group[0]] = match[group[1]];
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
|
-
|
|
3396
|
-
return match;
|
|
3397
|
-
};
|
|
3398
|
-
}
|
|
3399
|
-
|
|
3400
|
-
var regexpExec$3 = patchedExec;
|
|
3401
|
-
|
|
3402
|
-
var $$2 = _export;
|
|
3403
|
-
var exec$2 = regexpExec$3;
|
|
3404
|
-
|
|
3405
|
-
// `RegExp.prototype.exec` method
|
|
3406
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
3407
|
-
$$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
|
|
3408
|
-
exec: exec$2
|
|
3409
|
-
});
|
|
3410
|
-
|
|
3411
|
-
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
3412
|
-
|
|
3413
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
3414
|
-
var redefine = redefine$4.exports;
|
|
3415
|
-
var regexpExec$2 = regexpExec$3;
|
|
3416
|
-
var fails$4 = fails$i;
|
|
3417
|
-
var wellKnownSymbol$1 = wellKnownSymbol$e;
|
|
3418
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$4;
|
|
3419
|
-
|
|
3420
|
-
var SPECIES = wellKnownSymbol$1('species');
|
|
3421
|
-
var RegExpPrototype = RegExp.prototype;
|
|
3422
|
-
|
|
3423
|
-
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
3424
|
-
var SYMBOL = wellKnownSymbol$1(KEY);
|
|
3425
|
-
|
|
3426
|
-
var DELEGATES_TO_SYMBOL = !fails$4(function () {
|
|
3427
|
-
// String methods call symbol-named RegEp methods
|
|
3428
|
-
var O = {};
|
|
3429
|
-
O[SYMBOL] = function () { return 7; };
|
|
3430
|
-
return ''[KEY](O) != 7;
|
|
3431
|
-
});
|
|
3432
|
-
|
|
3433
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$4(function () {
|
|
3434
|
-
// Symbol-named RegExp methods call .exec
|
|
3435
|
-
var execCalled = false;
|
|
3436
|
-
var re = /a/;
|
|
3437
|
-
|
|
3438
|
-
if (KEY === 'split') {
|
|
3439
|
-
// We can't use real regex here since it causes deoptimization
|
|
3440
|
-
// and serious performance degradation in V8
|
|
3441
|
-
// https://github.com/zloirock/core-js/issues/306
|
|
3442
|
-
re = {};
|
|
3443
|
-
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
3444
|
-
// a new one. We need to return the patched regex when creating the new one.
|
|
3445
|
-
re.constructor = {};
|
|
3446
|
-
re.constructor[SPECIES] = function () { return re; };
|
|
3447
|
-
re.flags = '';
|
|
3448
|
-
re[SYMBOL] = /./[SYMBOL];
|
|
3449
|
-
}
|
|
3450
|
-
|
|
3451
|
-
re.exec = function () { execCalled = true; return null; };
|
|
3452
|
-
|
|
3453
|
-
re[SYMBOL]('');
|
|
3454
|
-
return !execCalled;
|
|
3455
|
-
});
|
|
3456
|
-
|
|
3457
|
-
if (
|
|
3458
|
-
!DELEGATES_TO_SYMBOL ||
|
|
3459
|
-
!DELEGATES_TO_EXEC ||
|
|
3460
|
-
FORCED
|
|
3461
|
-
) {
|
|
3462
|
-
var uncurriedNativeRegExpMethod = uncurryThis$6(/./[SYMBOL]);
|
|
3463
|
-
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
3464
|
-
var uncurriedNativeMethod = uncurryThis$6(nativeMethod);
|
|
3465
|
-
var $exec = regexp.exec;
|
|
3466
|
-
if ($exec === regexpExec$2 || $exec === RegExpPrototype.exec) {
|
|
3467
|
-
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
3468
|
-
// The native String method already delegates to @@method (this
|
|
3469
|
-
// polyfilled function), leasing to infinite recursion.
|
|
3470
|
-
// We avoid it by directly calling the native @@method method.
|
|
3471
|
-
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
3472
|
-
}
|
|
3473
|
-
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
3474
|
-
}
|
|
3475
|
-
return { done: false };
|
|
3476
|
-
});
|
|
3477
|
-
|
|
3478
|
-
redefine(String.prototype, KEY, methods[0]);
|
|
3479
|
-
redefine(RegExpPrototype, SYMBOL, methods[1]);
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
|
-
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
3483
|
-
};
|
|
3484
|
-
|
|
3485
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
3486
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
|
3487
|
-
var toString$4 = toString$8;
|
|
3488
|
-
var requireObjectCoercible$3 = requireObjectCoercible$8;
|
|
3489
|
-
|
|
3490
|
-
var charAt$2 = uncurryThis$5(''.charAt);
|
|
3491
|
-
var charCodeAt = uncurryThis$5(''.charCodeAt);
|
|
3492
|
-
var stringSlice$3 = uncurryThis$5(''.slice);
|
|
3493
|
-
|
|
3494
|
-
var createMethod$2 = function (CONVERT_TO_STRING) {
|
|
3495
|
-
return function ($this, pos) {
|
|
3496
|
-
var S = toString$4(requireObjectCoercible$3($this));
|
|
3497
|
-
var position = toIntegerOrInfinity$1(pos);
|
|
3498
|
-
var size = S.length;
|
|
3499
|
-
var first, second;
|
|
3500
|
-
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
3501
|
-
first = charCodeAt(S, position);
|
|
3502
|
-
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
3503
|
-
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
3504
|
-
? CONVERT_TO_STRING
|
|
3505
|
-
? charAt$2(S, position)
|
|
3506
|
-
: first
|
|
3507
|
-
: CONVERT_TO_STRING
|
|
3508
|
-
? stringSlice$3(S, position, position + 2)
|
|
3509
|
-
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
3510
|
-
};
|
|
3511
|
-
};
|
|
3512
|
-
|
|
3513
|
-
var stringMultibyte = {
|
|
3514
|
-
// `String.prototype.codePointAt` method
|
|
3515
|
-
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
3516
|
-
codeAt: createMethod$2(false),
|
|
3517
|
-
// `String.prototype.at` method
|
|
3518
|
-
// https://github.com/mathiasbynens/String.prototype.at
|
|
3519
|
-
charAt: createMethod$2(true)
|
|
3520
|
-
};
|
|
3521
|
-
|
|
3522
|
-
var charAt$1 = stringMultibyte.charAt;
|
|
3523
|
-
|
|
3524
|
-
// `AdvanceStringIndex` abstract operation
|
|
3525
|
-
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
3526
|
-
var advanceStringIndex$2 = function (S, index, unicode) {
|
|
3527
|
-
return index + (unicode ? charAt$1(S, index).length : 1);
|
|
3528
|
-
};
|
|
3529
|
-
|
|
3530
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
3531
|
-
var toObject$1 = toObject$4;
|
|
3532
|
-
|
|
3533
|
-
var floor = Math.floor;
|
|
3534
|
-
var charAt = uncurryThis$4(''.charAt);
|
|
3535
|
-
var replace$1 = uncurryThis$4(''.replace);
|
|
3536
|
-
var stringSlice$2 = uncurryThis$4(''.slice);
|
|
3537
|
-
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
3538
|
-
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
3539
|
-
|
|
3540
|
-
// `GetSubstitution` abstract operation
|
|
3541
|
-
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
3542
|
-
var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
3543
|
-
var tailPos = position + matched.length;
|
|
3544
|
-
var m = captures.length;
|
|
3545
|
-
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
3546
|
-
if (namedCaptures !== undefined) {
|
|
3547
|
-
namedCaptures = toObject$1(namedCaptures);
|
|
3548
|
-
symbols = SUBSTITUTION_SYMBOLS;
|
|
3549
|
-
}
|
|
3550
|
-
return replace$1(replacement, symbols, function (match, ch) {
|
|
3551
|
-
var capture;
|
|
3552
|
-
switch (charAt(ch, 0)) {
|
|
3553
|
-
case '$': return '$';
|
|
3554
|
-
case '&': return matched;
|
|
3555
|
-
case '`': return stringSlice$2(str, 0, position);
|
|
3556
|
-
case "'": return stringSlice$2(str, tailPos);
|
|
3557
|
-
case '<':
|
|
3558
|
-
capture = namedCaptures[stringSlice$2(ch, 1, -1)];
|
|
3559
|
-
break;
|
|
3560
|
-
default: // \d\d?
|
|
3561
|
-
var n = +ch;
|
|
3562
|
-
if (n === 0) return match;
|
|
3563
|
-
if (n > m) {
|
|
3564
|
-
var f = floor(n / 10);
|
|
3565
|
-
if (f === 0) return match;
|
|
3566
|
-
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
|
3567
|
-
return match;
|
|
3568
|
-
}
|
|
3569
|
-
capture = captures[n - 1];
|
|
3570
|
-
}
|
|
3571
|
-
return capture === undefined ? '' : capture;
|
|
3572
|
-
});
|
|
3573
|
-
};
|
|
3574
|
-
|
|
3575
|
-
var global$4 = global$I;
|
|
3576
|
-
var call$2 = functionCall;
|
|
3577
|
-
var anObject$2 = anObject$e;
|
|
3578
|
-
var isCallable$1 = isCallable$g;
|
|
3579
|
-
var classof = classofRaw$1;
|
|
3580
|
-
var regexpExec$1 = regexpExec$3;
|
|
3581
|
-
|
|
3582
|
-
var TypeError$2 = global$4.TypeError;
|
|
3583
|
-
|
|
3584
|
-
// `RegExpExec` abstract operation
|
|
3585
|
-
// https://tc39.es/ecma262/#sec-regexpexec
|
|
3586
|
-
var regexpExecAbstract = function (R, S) {
|
|
3587
|
-
var exec = R.exec;
|
|
3588
|
-
if (isCallable$1(exec)) {
|
|
3589
|
-
var result = call$2(exec, R, S);
|
|
3590
|
-
if (result !== null) anObject$2(result);
|
|
3591
|
-
return result;
|
|
3592
|
-
}
|
|
3593
|
-
if (classof(R) === 'RegExp') return call$2(regexpExec$1, R, S);
|
|
3594
|
-
throw TypeError$2('RegExp#exec called on incompatible receiver');
|
|
3595
|
-
};
|
|
3596
|
-
|
|
3597
|
-
var apply$1 = functionApply;
|
|
3598
|
-
var call$1 = functionCall;
|
|
3599
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
3600
|
-
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
|
3601
|
-
var fails$3 = fails$i;
|
|
3602
|
-
var anObject$1 = anObject$e;
|
|
3603
|
-
var isCallable = isCallable$g;
|
|
3604
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
|
3605
|
-
var toLength$1 = toLength$4;
|
|
3606
|
-
var toString$3 = toString$8;
|
|
3607
|
-
var requireObjectCoercible$2 = requireObjectCoercible$8;
|
|
3608
|
-
var advanceStringIndex$1 = advanceStringIndex$2;
|
|
3609
|
-
var getMethod$1 = getMethod$5;
|
|
3610
|
-
var getSubstitution = getSubstitution$1;
|
|
3611
|
-
var regExpExec = regexpExecAbstract;
|
|
3612
|
-
var wellKnownSymbol = wellKnownSymbol$e;
|
|
3613
|
-
|
|
3614
|
-
var REPLACE = wellKnownSymbol('replace');
|
|
3615
|
-
var max$1 = Math.max;
|
|
3616
|
-
var min$1 = Math.min;
|
|
3617
|
-
var concat = uncurryThis$3([].concat);
|
|
3618
|
-
var push$1 = uncurryThis$3([].push);
|
|
3619
|
-
var stringIndexOf = uncurryThis$3(''.indexOf);
|
|
3620
|
-
var stringSlice$1 = uncurryThis$3(''.slice);
|
|
3621
|
-
|
|
3622
|
-
var maybeToString = function (it) {
|
|
3623
|
-
return it === undefined ? it : String(it);
|
|
3624
|
-
};
|
|
3625
|
-
|
|
3626
|
-
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
3627
|
-
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
3628
|
-
var REPLACE_KEEPS_$0 = (function () {
|
|
3629
|
-
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
3630
|
-
return 'a'.replace(/./, '$0') === '$0';
|
|
3631
|
-
})();
|
|
3632
|
-
|
|
3633
|
-
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
3634
|
-
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
3635
|
-
if (/./[REPLACE]) {
|
|
3636
|
-
return /./[REPLACE]('a', '$0') === '';
|
|
3637
|
-
}
|
|
3638
|
-
return false;
|
|
3639
|
-
})();
|
|
3640
|
-
|
|
3641
|
-
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$3(function () {
|
|
3642
|
-
var re = /./;
|
|
3643
|
-
re.exec = function () {
|
|
3644
|
-
var result = [];
|
|
3645
|
-
result.groups = { a: '7' };
|
|
3646
|
-
return result;
|
|
3647
|
-
};
|
|
3648
|
-
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
3649
|
-
return ''.replace(re, '$<a>') !== '7';
|
|
3650
|
-
});
|
|
3651
|
-
|
|
3652
|
-
// @@replace logic
|
|
3653
|
-
fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCallNative) {
|
|
3654
|
-
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
3655
|
-
|
|
3656
|
-
return [
|
|
3657
|
-
// `String.prototype.replace` method
|
|
3658
|
-
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
3659
|
-
function replace(searchValue, replaceValue) {
|
|
3660
|
-
var O = requireObjectCoercible$2(this);
|
|
3661
|
-
var replacer = searchValue == undefined ? undefined : getMethod$1(searchValue, REPLACE);
|
|
3662
|
-
return replacer
|
|
3663
|
-
? call$1(replacer, searchValue, O, replaceValue)
|
|
3664
|
-
: call$1(nativeReplace, toString$3(O), searchValue, replaceValue);
|
|
3665
|
-
},
|
|
3666
|
-
// `RegExp.prototype[@@replace]` method
|
|
3667
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
3668
|
-
function (string, replaceValue) {
|
|
3669
|
-
var rx = anObject$1(this);
|
|
3670
|
-
var S = toString$3(string);
|
|
3671
|
-
|
|
3672
|
-
if (
|
|
3673
|
-
typeof replaceValue == 'string' &&
|
|
3674
|
-
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
3675
|
-
stringIndexOf(replaceValue, '$<') === -1
|
|
3676
|
-
) {
|
|
3677
|
-
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
3678
|
-
if (res.done) return res.value;
|
|
3679
|
-
}
|
|
3680
|
-
|
|
3681
|
-
var functionalReplace = isCallable(replaceValue);
|
|
3682
|
-
if (!functionalReplace) replaceValue = toString$3(replaceValue);
|
|
3683
|
-
|
|
3684
|
-
var global = rx.global;
|
|
3685
|
-
if (global) {
|
|
3686
|
-
var fullUnicode = rx.unicode;
|
|
3687
|
-
rx.lastIndex = 0;
|
|
3688
|
-
}
|
|
3689
|
-
var results = [];
|
|
3690
|
-
while (true) {
|
|
3691
|
-
var result = regExpExec(rx, S);
|
|
3692
|
-
if (result === null) break;
|
|
3693
|
-
|
|
3694
|
-
push$1(results, result);
|
|
3695
|
-
if (!global) break;
|
|
3696
|
-
|
|
3697
|
-
var matchStr = toString$3(result[0]);
|
|
3698
|
-
if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
var accumulatedResult = '';
|
|
3702
|
-
var nextSourcePosition = 0;
|
|
3703
|
-
for (var i = 0; i < results.length; i++) {
|
|
3704
|
-
result = results[i];
|
|
3705
|
-
|
|
3706
|
-
var matched = toString$3(result[0]);
|
|
3707
|
-
var position = max$1(min$1(toIntegerOrInfinity(result.index), S.length), 0);
|
|
3708
|
-
var captures = [];
|
|
3709
|
-
// NOTE: This is equivalent to
|
|
3710
|
-
// captures = result.slice(1).map(maybeToString)
|
|
3711
|
-
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
3712
|
-
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
3713
|
-
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
3714
|
-
for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
|
|
3715
|
-
var namedCaptures = result.groups;
|
|
3716
|
-
if (functionalReplace) {
|
|
3717
|
-
var replacerArgs = concat([matched], captures, position, S);
|
|
3718
|
-
if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
|
|
3719
|
-
var replacement = toString$3(apply$1(replaceValue, undefined, replacerArgs));
|
|
3720
|
-
} else {
|
|
3721
|
-
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
3722
|
-
}
|
|
3723
|
-
if (position >= nextSourcePosition) {
|
|
3724
|
-
accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
|
|
3725
|
-
nextSourcePosition = position + matched.length;
|
|
3726
|
-
}
|
|
3727
|
-
}
|
|
3728
|
-
return accumulatedResult + stringSlice$1(S, nextSourcePosition);
|
|
3729
|
-
}
|
|
3730
|
-
];
|
|
3731
|
-
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
3732
|
-
|
|
3733
|
-
var selectActiveExperiments = function selectActiveExperiments(experiments, profile) {
|
|
3734
|
-
var experimentTraits = pickBy__default["default"](profile.traits, function (value, key) {
|
|
3735
|
-
return key.startsWith(EXPERIENCE_TRAIT_PREFIX) && value === true;
|
|
3736
|
-
});
|
|
3737
|
-
var experimentTraitsIds = Object.keys(experimentTraits).map(function (id) {
|
|
3738
|
-
return id.replace(EXPERIENCE_TRAIT_PREFIX, '');
|
|
3739
|
-
}); // a experiment is active when the use has it set as a true value on the traits and the experiment config is still active
|
|
3740
|
-
|
|
3741
|
-
var activeExperiments = experiments.filter(function (experiment) {
|
|
3742
|
-
return includes__default["default"](experimentTraitsIds, experiment.id);
|
|
3743
|
-
});
|
|
3744
|
-
return activeExperiments;
|
|
3745
|
-
};
|
|
3746
|
-
|
|
3747
|
-
/**
|
|
3748
|
-
* We can use any personalization as eligible experience
|
|
3749
|
-
* When going for an experiment we can only select a active experiment when 1 or more experiments are active
|
|
3750
|
-
* If the profile is not in any active experiments, we can select any expermiment
|
|
3751
|
-
*/
|
|
3752
|
-
|
|
3753
|
-
var selectEligibleExperiences = function selectEligibleExperiences(_a) {
|
|
3754
|
-
var experiences = _a.experiences,
|
|
3755
|
-
activeExperiments = _a.activeExperiments;
|
|
3756
|
-
return experiences.filter(function (experience) {
|
|
3757
|
-
return experience.type === 'nt_personalization' || activeExperiments.length === 0 || find__default["default"](activeExperiments, {
|
|
3758
|
-
id: experience.id
|
|
3759
|
-
});
|
|
3760
|
-
});
|
|
3761
|
-
};
|
|
3762
|
-
|
|
3763
|
-
var LOWER_BOUND = 0;
|
|
3764
|
-
var UPPER_BOUND = 4294967295;
|
|
3765
|
-
|
|
3766
|
-
var normalize = function normalize(val, min, max) {
|
|
3767
|
-
return (val - min) / (max - min);
|
|
3768
|
-
};
|
|
3769
|
-
|
|
3770
|
-
var getRandom = function getRandom(text) {
|
|
3771
|
-
var hash = murmurhashJs.murmur3(text, 0);
|
|
3772
|
-
var random = normalize(hash, LOWER_BOUND, UPPER_BOUND);
|
|
3773
|
-
return random;
|
|
3774
|
-
};
|
|
3775
|
-
|
|
3776
|
-
var getTrafficRandom = function getTrafficRandom(profile, experience) {
|
|
3777
|
-
return getRandom("traffic-".concat(experience.id, "-").concat(profile.id));
|
|
3778
|
-
};
|
|
3779
|
-
var getDistributionRandom = function getDistributionRandom(profile, experience) {
|
|
3780
|
-
return getRandom("distribution-".concat(experience.id, "-").concat(profile.id));
|
|
3781
|
-
};
|
|
3782
|
-
|
|
3783
|
-
var isExperienceMatch = function isExperienceMatch(_a) {
|
|
3784
|
-
var experience = _a.experience,
|
|
3785
|
-
activeExperiments = _a.activeExperiments,
|
|
3786
|
-
profile = _a.profile;
|
|
3787
|
-
var trafficRandom = getTrafficRandom(profile, experience);
|
|
3788
|
-
experience_jsShared.logger.info("The traffic random factor for experience ".concat(experience.id, " is ").concat(trafficRandom, ". It's traffic allocation is set to ").concat(experience.trafficAllocation, "."));
|
|
3789
|
-
var isInTrafficRange = experience.trafficAllocation > trafficRandom;
|
|
3790
|
-
var matchesAudience = !experience.audience || includes__default["default"](profile.audiences, experience.audience.id);
|
|
3791
|
-
var hasActiveExperiment = !!find__default["default"](activeExperiments, {
|
|
3792
|
-
id: experience.id
|
|
3793
|
-
});
|
|
3794
|
-
experience_jsShared.logger.info("Is the profile in traffic allocation range? ".concat(isInTrafficRange ? 'yes' : 'no', ".\n\n Does the profile match the audience of the experience? ").concat(matchesAudience ? 'yes' : 'no', ".\n\n Is there an active experiment for this profile? ").concat(hasActiveExperiment ? 'yes' : 'no', "."));
|
|
3795
|
-
return isInTrafficRange && (matchesAudience || // if the expriment is active already then it's selectible without further contraints to be fullfilled
|
|
3796
|
-
hasActiveExperiment);
|
|
3797
|
-
};
|
|
3798
|
-
|
|
3799
|
-
var selectExperience = function selectExperience(_a) {
|
|
3800
|
-
var experiences = _a.experiences,
|
|
3801
|
-
activeExperiments = _a.activeExperiments,
|
|
3802
|
-
profile = _a.profile;
|
|
3803
|
-
var eligibleExperiences = selectEligibleExperiences({
|
|
3804
|
-
experiences: experiences,
|
|
3805
|
-
activeExperiments: activeExperiments
|
|
3806
|
-
});
|
|
3807
|
-
var selectedExperience = eligibleExperiences.find(function (experience) {
|
|
3808
|
-
return isExperienceMatch({
|
|
3809
|
-
experience: experience,
|
|
3810
|
-
activeExperiments: activeExperiments,
|
|
3811
|
-
profile: profile
|
|
3812
|
-
});
|
|
3813
|
-
});
|
|
3814
|
-
return selectedExperience !== null && selectedExperience !== void 0 ? selectedExperience : null;
|
|
3815
|
-
};
|
|
3816
|
-
|
|
3817
|
-
var selectDistribution = function selectDistribution(_a) {
|
|
3818
|
-
var experience = _a.experience,
|
|
3819
|
-
profile = _a.profile;
|
|
3820
|
-
var distributionRandom = getDistributionRandom(profile, experience);
|
|
3821
|
-
experience_jsShared.logger.log("The distribution random factor for experience ".concat(experience.id, " is ").concat(distributionRandom, ". It's distribution is set to ").concat(JSON.stringify(experience.distribution, null, 2), "."));
|
|
3822
|
-
var distribution = find__default["default"](experience.distribution, function (_a) {
|
|
3823
|
-
var start = _a.start,
|
|
3824
|
-
end = _a.end;
|
|
3825
|
-
return distributionRandom >= start && distributionRandom <= end;
|
|
3826
|
-
} // this overlaps on one value for each boundary but we just find the first match
|
|
3827
|
-
);
|
|
3828
|
-
|
|
3829
|
-
if (!distribution) {
|
|
3830
|
-
// This should never happen. If it happens then the distribution is not configured correctly. So we just return the baseline.
|
|
3831
|
-
return {
|
|
3832
|
-
index: 0,
|
|
3833
|
-
start: 0,
|
|
3834
|
-
end: 1
|
|
3835
|
-
};
|
|
3836
|
-
}
|
|
3837
|
-
|
|
3838
|
-
return distribution;
|
|
3839
|
-
};
|
|
3840
|
-
|
|
3841
|
-
var selectVariant = function selectVariant(_a) {
|
|
3842
|
-
var baseline = _a.baseline,
|
|
3843
|
-
experience = _a.experience,
|
|
3844
|
-
profile = _a.profile;
|
|
3845
|
-
var variants = selectVariants(experience, baseline);
|
|
3846
|
-
|
|
3847
|
-
if (!variants.length) {
|
|
3848
|
-
return null;
|
|
3849
|
-
}
|
|
3850
|
-
|
|
3851
|
-
var distribution = selectDistribution({
|
|
3852
|
-
experience: experience,
|
|
3853
|
-
profile: profile
|
|
3854
|
-
});
|
|
3855
|
-
|
|
3856
|
-
if (!distribution) {
|
|
3857
|
-
return null;
|
|
3858
|
-
}
|
|
3859
|
-
|
|
3860
|
-
if (distribution.index === 0) {
|
|
3861
|
-
return __assign(__assign({}, baseline), {
|
|
3862
|
-
hidden: false
|
|
3863
|
-
});
|
|
3864
|
-
}
|
|
3865
|
-
|
|
3866
|
-
var correctedVariantIndex = distribution.index - 1;
|
|
3867
|
-
|
|
3868
|
-
if (variants.length <= correctedVariantIndex) {
|
|
3869
|
-
console.warn("A distribution for a variant was selected but it's metadata could not be found.");
|
|
3870
|
-
return null;
|
|
3871
|
-
}
|
|
3872
|
-
|
|
3873
|
-
var variant = variants[correctedVariantIndex];
|
|
3874
|
-
|
|
3875
|
-
if (!variant) {
|
|
3876
|
-
console.warn("A distribution for a variant was selected but it's metadata could not be found.");
|
|
3877
|
-
return null;
|
|
3878
|
-
}
|
|
3879
|
-
|
|
3880
|
-
return variant;
|
|
3881
|
-
};
|
|
3882
|
-
|
|
3883
|
-
var global$3 = global$I;
|
|
3884
|
-
var aCallable = aCallable$6;
|
|
3885
|
-
var toObject = toObject$4;
|
|
3886
|
-
var IndexedObject = indexedObject;
|
|
3887
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$4;
|
|
3888
|
-
|
|
3889
|
-
var TypeError$1 = global$3.TypeError;
|
|
3890
|
-
|
|
3891
|
-
// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
3892
|
-
var createMethod$1 = function (IS_RIGHT) {
|
|
3893
|
-
return function (that, callbackfn, argumentsLength, memo) {
|
|
3894
|
-
aCallable(callbackfn);
|
|
3895
|
-
var O = toObject(that);
|
|
3896
|
-
var self = IndexedObject(O);
|
|
3897
|
-
var length = lengthOfArrayLike$1(O);
|
|
3898
|
-
var index = IS_RIGHT ? length - 1 : 0;
|
|
3899
|
-
var i = IS_RIGHT ? -1 : 1;
|
|
3900
|
-
if (argumentsLength < 2) while (true) {
|
|
3901
|
-
if (index in self) {
|
|
3902
|
-
memo = self[index];
|
|
3903
|
-
index += i;
|
|
3904
|
-
break;
|
|
3905
|
-
}
|
|
3906
|
-
index += i;
|
|
3907
|
-
if (IS_RIGHT ? index < 0 : length <= index) {
|
|
3908
|
-
throw TypeError$1('Reduce of empty array with no initial value');
|
|
3909
|
-
}
|
|
3910
|
-
}
|
|
3911
|
-
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
|
3912
|
-
memo = callbackfn(memo, self[index], index, O);
|
|
3913
|
-
}
|
|
3914
|
-
return memo;
|
|
3915
|
-
};
|
|
3916
|
-
};
|
|
3917
|
-
|
|
3918
|
-
var arrayReduce = {
|
|
3919
|
-
// `Array.prototype.reduce` method
|
|
3920
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
3921
|
-
left: createMethod$1(false),
|
|
3922
|
-
// `Array.prototype.reduceRight` method
|
|
3923
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
|
3924
|
-
right: createMethod$1(true)
|
|
3925
|
-
};
|
|
3926
|
-
|
|
3927
|
-
var fails$2 = fails$i;
|
|
3928
|
-
|
|
3929
|
-
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
3930
|
-
var method = [][METHOD_NAME];
|
|
3931
|
-
return !!method && fails$2(function () {
|
|
3932
|
-
// eslint-disable-next-line no-useless-call -- required for testing
|
|
3933
|
-
method.call(null, argument || function () { return 1; }, 1);
|
|
3934
|
-
});
|
|
3935
|
-
};
|
|
3936
|
-
|
|
3937
|
-
var $$1 = _export;
|
|
3938
|
-
var $reduce = arrayReduce.left;
|
|
3939
|
-
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
3940
|
-
var CHROME_VERSION = engineV8Version;
|
|
3941
|
-
var IS_NODE = engineIsNode;
|
|
3942
|
-
|
|
3943
|
-
var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
|
3944
|
-
// Chrome 80-82 has a critical bug
|
|
3945
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
|
3946
|
-
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
3947
|
-
|
|
3948
|
-
// `Array.prototype.reduce` method
|
|
3949
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
3950
|
-
$$1({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
|
3951
|
-
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
3952
|
-
var length = arguments.length;
|
|
3953
|
-
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
3954
|
-
}
|
|
3955
|
-
});
|
|
3956
|
-
|
|
3957
|
-
var toPropertyKey = toPropertyKey$3;
|
|
3958
|
-
var definePropertyModule = objectDefineProperty;
|
|
3959
|
-
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
3960
|
-
|
|
3961
|
-
var createProperty$1 = function (object, key, value) {
|
|
3962
|
-
var propertyKey = toPropertyKey(key);
|
|
3963
|
-
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
3964
|
-
else object[propertyKey] = value;
|
|
3965
|
-
};
|
|
3966
|
-
|
|
3967
|
-
var global$2 = global$I;
|
|
3968
|
-
var toAbsoluteIndex = toAbsoluteIndex$2;
|
|
3969
|
-
var lengthOfArrayLike = lengthOfArrayLike$4;
|
|
3970
|
-
var createProperty = createProperty$1;
|
|
3971
|
-
|
|
3972
|
-
var Array$1 = global$2.Array;
|
|
3973
|
-
var max = Math.max;
|
|
3974
|
-
|
|
3975
|
-
var arraySliceSimple = function (O, start, end) {
|
|
3976
|
-
var length = lengthOfArrayLike(O);
|
|
3977
|
-
var k = toAbsoluteIndex(start, length);
|
|
3978
|
-
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
3979
|
-
var result = Array$1(max(fin - k, 0));
|
|
3980
|
-
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
3981
|
-
result.length = n;
|
|
3982
|
-
return result;
|
|
3983
|
-
};
|
|
3984
|
-
|
|
3985
|
-
var apply = functionApply;
|
|
3986
|
-
var call = functionCall;
|
|
3987
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
3988
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
3989
|
-
var isRegExp = isRegexp;
|
|
3990
|
-
var anObject = anObject$e;
|
|
3991
|
-
var requireObjectCoercible$1 = requireObjectCoercible$8;
|
|
3992
|
-
var speciesConstructor = speciesConstructor$2;
|
|
3993
|
-
var advanceStringIndex = advanceStringIndex$2;
|
|
3994
|
-
var toLength = toLength$4;
|
|
3995
|
-
var toString$2 = toString$8;
|
|
3996
|
-
var getMethod = getMethod$5;
|
|
3997
|
-
var arraySlice = arraySliceSimple;
|
|
3998
|
-
var callRegExpExec = regexpExecAbstract;
|
|
3999
|
-
var regexpExec = regexpExec$3;
|
|
4000
|
-
var stickyHelpers = regexpStickyHelpers;
|
|
4001
|
-
var fails$1 = fails$i;
|
|
4002
|
-
|
|
4003
|
-
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
|
4004
|
-
var MAX_UINT32 = 0xFFFFFFFF;
|
|
4005
|
-
var min = Math.min;
|
|
4006
|
-
var $push = [].push;
|
|
4007
|
-
var exec$1 = uncurryThis$2(/./.exec);
|
|
4008
|
-
var push = uncurryThis$2($push);
|
|
4009
|
-
var stringSlice = uncurryThis$2(''.slice);
|
|
4010
|
-
|
|
4011
|
-
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
4012
|
-
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
4013
|
-
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$1(function () {
|
|
4014
|
-
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
4015
|
-
var re = /(?:)/;
|
|
4016
|
-
var originalExec = re.exec;
|
|
4017
|
-
re.exec = function () { return originalExec.apply(this, arguments); };
|
|
4018
|
-
var result = 'ab'.split(re);
|
|
4019
|
-
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
|
4020
|
-
});
|
|
4021
|
-
|
|
4022
|
-
// @@split logic
|
|
4023
|
-
fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
|
|
4024
|
-
var internalSplit;
|
|
4025
|
-
if (
|
|
4026
|
-
'abbc'.split(/(b)*/)[1] == 'c' ||
|
|
4027
|
-
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
4028
|
-
'test'.split(/(?:)/, -1).length != 4 ||
|
|
4029
|
-
'ab'.split(/(?:ab)*/).length != 2 ||
|
|
4030
|
-
'.'.split(/(.?)(.?)/).length != 4 ||
|
|
4031
|
-
// eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
|
|
4032
|
-
'.'.split(/()()/).length > 1 ||
|
|
4033
|
-
''.split(/.?/).length
|
|
4034
|
-
) {
|
|
4035
|
-
// based on es5-shim implementation, need to rework it
|
|
4036
|
-
internalSplit = function (separator, limit) {
|
|
4037
|
-
var string = toString$2(requireObjectCoercible$1(this));
|
|
4038
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
4039
|
-
if (lim === 0) return [];
|
|
4040
|
-
if (separator === undefined) return [string];
|
|
4041
|
-
// If `separator` is not a regex, use native split
|
|
4042
|
-
if (!isRegExp(separator)) {
|
|
4043
|
-
return call(nativeSplit, string, separator, lim);
|
|
4044
|
-
}
|
|
4045
|
-
var output = [];
|
|
4046
|
-
var flags = (separator.ignoreCase ? 'i' : '') +
|
|
4047
|
-
(separator.multiline ? 'm' : '') +
|
|
4048
|
-
(separator.unicode ? 'u' : '') +
|
|
4049
|
-
(separator.sticky ? 'y' : '');
|
|
4050
|
-
var lastLastIndex = 0;
|
|
4051
|
-
// Make `global` and avoid `lastIndex` issues by working with a copy
|
|
4052
|
-
var separatorCopy = new RegExp(separator.source, flags + 'g');
|
|
4053
|
-
var match, lastIndex, lastLength;
|
|
4054
|
-
while (match = call(regexpExec, separatorCopy, string)) {
|
|
4055
|
-
lastIndex = separatorCopy.lastIndex;
|
|
4056
|
-
if (lastIndex > lastLastIndex) {
|
|
4057
|
-
push(output, stringSlice(string, lastLastIndex, match.index));
|
|
4058
|
-
if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));
|
|
4059
|
-
lastLength = match[0].length;
|
|
4060
|
-
lastLastIndex = lastIndex;
|
|
4061
|
-
if (output.length >= lim) break;
|
|
4062
|
-
}
|
|
4063
|
-
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
|
|
4064
|
-
}
|
|
4065
|
-
if (lastLastIndex === string.length) {
|
|
4066
|
-
if (lastLength || !exec$1(separatorCopy, '')) push(output, '');
|
|
4067
|
-
} else push(output, stringSlice(string, lastLastIndex));
|
|
4068
|
-
return output.length > lim ? arraySlice(output, 0, lim) : output;
|
|
4069
|
-
};
|
|
4070
|
-
// Chakra, V8
|
|
4071
|
-
} else if ('0'.split(undefined, 0).length) {
|
|
4072
|
-
internalSplit = function (separator, limit) {
|
|
4073
|
-
return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
|
|
4074
|
-
};
|
|
4075
|
-
} else internalSplit = nativeSplit;
|
|
4076
|
-
|
|
4077
|
-
return [
|
|
4078
|
-
// `String.prototype.split` method
|
|
4079
|
-
// https://tc39.es/ecma262/#sec-string.prototype.split
|
|
4080
|
-
function split(separator, limit) {
|
|
4081
|
-
var O = requireObjectCoercible$1(this);
|
|
4082
|
-
var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
|
|
4083
|
-
return splitter
|
|
4084
|
-
? call(splitter, separator, O, limit)
|
|
4085
|
-
: call(internalSplit, toString$2(O), separator, limit);
|
|
4086
|
-
},
|
|
4087
|
-
// `RegExp.prototype[@@split]` method
|
|
4088
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
|
|
4089
|
-
//
|
|
4090
|
-
// NOTE: This cannot be properly polyfilled in engines that don't support
|
|
4091
|
-
// the 'y' flag.
|
|
4092
|
-
function (string, limit) {
|
|
4093
|
-
var rx = anObject(this);
|
|
4094
|
-
var S = toString$2(string);
|
|
4095
|
-
var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
|
4096
|
-
|
|
4097
|
-
if (res.done) return res.value;
|
|
4098
|
-
|
|
4099
|
-
var C = speciesConstructor(rx, RegExp);
|
|
4100
|
-
|
|
4101
|
-
var unicodeMatching = rx.unicode;
|
|
4102
|
-
var flags = (rx.ignoreCase ? 'i' : '') +
|
|
4103
|
-
(rx.multiline ? 'm' : '') +
|
|
4104
|
-
(rx.unicode ? 'u' : '') +
|
|
4105
|
-
(UNSUPPORTED_Y ? 'g' : 'y');
|
|
4106
|
-
|
|
4107
|
-
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
|
4108
|
-
// simulate the 'y' flag.
|
|
4109
|
-
var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
|
|
4110
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
4111
|
-
if (lim === 0) return [];
|
|
4112
|
-
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
|
|
4113
|
-
var p = 0;
|
|
4114
|
-
var q = 0;
|
|
4115
|
-
var A = [];
|
|
4116
|
-
while (q < S.length) {
|
|
4117
|
-
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
|
4118
|
-
var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
|
|
4119
|
-
var e;
|
|
4120
|
-
if (
|
|
4121
|
-
z === null ||
|
|
4122
|
-
(e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
|
4123
|
-
) {
|
|
4124
|
-
q = advanceStringIndex(S, q, unicodeMatching);
|
|
4125
|
-
} else {
|
|
4126
|
-
push(A, stringSlice(S, p, q));
|
|
4127
|
-
if (A.length === lim) return A;
|
|
4128
|
-
for (var i = 1; i <= z.length - 1; i++) {
|
|
4129
|
-
push(A, z[i]);
|
|
4130
|
-
if (A.length === lim) return A;
|
|
4131
|
-
}
|
|
4132
|
-
q = p = e;
|
|
4133
|
-
}
|
|
4134
|
-
}
|
|
4135
|
-
push(A, stringSlice(S, p));
|
|
4136
|
-
return A;
|
|
4137
|
-
}
|
|
4138
|
-
];
|
|
4139
|
-
}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
4140
|
-
|
|
4141
|
-
// a string of all valid unicode whitespaces
|
|
4142
|
-
var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
4143
|
-
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
4144
|
-
|
|
4145
|
-
var uncurryThis$1 = functionUncurryThis;
|
|
4146
|
-
var requireObjectCoercible = requireObjectCoercible$8;
|
|
4147
|
-
var toString$1 = toString$8;
|
|
4148
|
-
var whitespaces$1 = whitespaces$2;
|
|
4149
|
-
|
|
4150
|
-
var replace = uncurryThis$1(''.replace);
|
|
4151
|
-
var whitespace = '[' + whitespaces$1 + ']';
|
|
4152
|
-
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
4153
|
-
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
4154
|
-
|
|
4155
|
-
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
4156
|
-
var createMethod = function (TYPE) {
|
|
4157
|
-
return function ($this) {
|
|
4158
|
-
var string = toString$1(requireObjectCoercible($this));
|
|
4159
|
-
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
4160
|
-
if (TYPE & 2) string = replace(string, rtrim, '');
|
|
4161
|
-
return string;
|
|
4162
|
-
};
|
|
4163
|
-
};
|
|
4164
|
-
|
|
4165
|
-
var stringTrim = {
|
|
4166
|
-
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
4167
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
4168
|
-
start: createMethod(1),
|
|
4169
|
-
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
4170
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
4171
|
-
end: createMethod(2),
|
|
4172
|
-
// `String.prototype.trim` method
|
|
4173
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
4174
|
-
trim: createMethod(3)
|
|
4175
|
-
};
|
|
4176
|
-
|
|
4177
|
-
var global$1 = global$I;
|
|
4178
|
-
var fails = fails$i;
|
|
4179
|
-
var uncurryThis = functionUncurryThis;
|
|
4180
|
-
var toString = toString$8;
|
|
4181
|
-
var trim = stringTrim.trim;
|
|
4182
|
-
var whitespaces = whitespaces$2;
|
|
4183
|
-
|
|
4184
|
-
var $parseInt$1 = global$1.parseInt;
|
|
4185
|
-
var Symbol$1 = global$1.Symbol;
|
|
4186
|
-
var ITERATOR = Symbol$1 && Symbol$1.iterator;
|
|
4187
|
-
var hex = /^[+-]?0x/i;
|
|
4188
|
-
var exec = uncurryThis(hex.exec);
|
|
4189
|
-
var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
4190
|
-
// MS Edge 18- broken with boxed symbols
|
|
4191
|
-
|| (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
|
|
4192
|
-
|
|
4193
|
-
// `parseInt` method
|
|
4194
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
4195
|
-
var numberParseInt = FORCED ? function parseInt(string, radix) {
|
|
4196
|
-
var S = trim(toString(string));
|
|
4197
|
-
return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
|
|
4198
|
-
} : $parseInt$1;
|
|
4199
|
-
|
|
4200
|
-
var $ = _export;
|
|
4201
|
-
var $parseInt = numberParseInt;
|
|
4202
|
-
|
|
4203
|
-
// `parseInt` method
|
|
4204
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
4205
|
-
$({ global: true, forced: parseInt != $parseInt }, {
|
|
4206
|
-
parseInt: $parseInt
|
|
4207
|
-
});
|
|
4208
|
-
|
|
4209
|
-
var decodeExperienceVariantsMap = function decodeExperienceVariantsMap(encodedExperienceVariantsMap) {
|
|
4210
|
-
return encodedExperienceVariantsMap.split(',').map(function (experienceIdWithVariant) {
|
|
4211
|
-
var _a = experienceIdWithVariant.split('='),
|
|
4212
|
-
experienceId = _a[0],
|
|
4213
|
-
_variantIndex = _a[1];
|
|
4214
|
-
|
|
4215
|
-
var variantIndex = parseInt(_variantIndex);
|
|
4216
|
-
|
|
4217
|
-
if (!experienceId || !variantIndex) {
|
|
4218
|
-
return null;
|
|
4219
|
-
}
|
|
4220
|
-
|
|
4221
|
-
return {
|
|
4222
|
-
experienceId: experienceId,
|
|
4223
|
-
variantIndex: variantIndex
|
|
4224
|
-
};
|
|
4225
|
-
}).filter(function (x) {
|
|
4226
|
-
return !!x;
|
|
4227
|
-
}).reduce(function (acc, curr) {
|
|
4228
|
-
var _a;
|
|
4229
|
-
|
|
4230
|
-
return __assign(__assign({}, acc), (_a = {}, _a[curr.experienceId] = curr.variantIndex, _a));
|
|
4231
|
-
}, {});
|
|
4232
|
-
};
|
|
4233
|
-
|
|
4234
|
-
exports.EXPERIENCE_TRAIT_PREFIX = EXPERIENCE_TRAIT_PREFIX;
|
|
4235
|
-
exports.NINETAILED_TRACKER_EVENTS = NINETAILED_TRACKER_EVENTS;
|
|
4236
|
-
exports.Ninetailed = Ninetailed;
|
|
4237
|
-
exports.PLUGIN_NAME = PLUGIN_NAME;
|
|
4238
|
-
exports.decodeExperienceVariantsMap = decodeExperienceVariantsMap;
|
|
4239
|
-
exports.isExperienceMatch = isExperienceMatch;
|
|
4240
|
-
exports.ninetailedPlugin = ninetailedPlugin;
|
|
4241
|
-
exports.selectActiveExperiments = selectActiveExperiments;
|
|
4242
|
-
exports.selectDistribution = selectDistribution;
|
|
4243
|
-
exports.selectEligibleExperiences = selectEligibleExperiences;
|
|
4244
|
-
exports.selectExperience = selectExperience;
|
|
4245
|
-
exports.selectExperienceBaselineWithVariants = selectBaselineWithVariants;
|
|
4246
|
-
exports.selectExperienceVariant = selectVariant;
|
|
4247
|
-
exports.selectExperienceVariants = selectVariants;
|
|
4248
|
-
exports.selectHasExperienceVariants = selectHasVariants;
|
|
4249
|
-
exports.selectVariant = selectVariant$1;
|
|
4250
|
-
|
|
4251
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4252
|
-
|
|
4253
|
-
}));
|