@alma/widgets 2.3.3 → 2.5.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.
Files changed (36) hide show
  1. package/dist/raw/widgets.js +878 -467
  2. package/dist/raw/widgets.js.map +1 -1
  3. package/dist/raw/widgets.m.js +878 -467
  4. package/dist/raw/widgets.m.js.map +1 -1
  5. package/dist/raw/widgets.modern.js +876 -464
  6. package/dist/raw/widgets.modern.js.map +1 -1
  7. package/dist/raw/widgets.umd.js +1308 -845
  8. package/dist/raw/widgets.umd.js.map +1 -1
  9. package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +3 -1
  10. package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +3 -1
  11. package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +18 -0
  12. package/dist/types/Widgets/EligibilityModal/components/Title/index.d.ts +3 -1
  13. package/dist/types/Widgets/PaymentPlans/classNames.const.d.ts +13 -0
  14. package/dist/types/test/fixtures.d.ts +41 -0
  15. package/dist/types/types.d.ts +7 -1
  16. package/dist/widgets.js +1 -1
  17. package/dist/widgets.js.map +1 -1
  18. package/dist/widgets.m.js +1 -1
  19. package/dist/widgets.m.js.map +1 -1
  20. package/dist/widgets.modern.js +1 -1
  21. package/dist/widgets.modern.js.map +1 -1
  22. package/dist/widgets.umd.js +1 -1
  23. package/dist/widgets.umd.js.map +1 -1
  24. package/package.json +7 -13
  25. package/CHANGELOG.md +0 -256
  26. package/dist/types/Widgets/EligibilityModal/ModalContainer.test.d.ts +0 -1
  27. package/dist/types/Widgets/EligibilityModal/modal.test.d.ts +0 -1
  28. package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +0 -1
  29. package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +0 -1
  30. package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +0 -1
  31. package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +0 -1
  32. package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +0 -1
  33. package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +0 -1
  34. package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +0 -1
  35. package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +0 -1
  36. package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +0 -1
@@ -7,40 +7,44 @@ import noScroll from 'no-scroll';
7
7
  import { useMediaQuery } from 'react-responsive';
8
8
  import { secondsToMilliseconds, isToday } from 'date-fns';
9
9
 
10
- var ceil = Math.ceil;
11
- var floor = Math.floor; // `ToInteger` abstract operation
12
- // https://tc39.github.io/ecma262/#sec-tointeger
13
-
14
- var toInteger = function (argument) {
15
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
10
+ var fails = function (exec) {
11
+ try {
12
+ return !!exec();
13
+ } catch (error) {
14
+ return true;
15
+ }
16
16
  };
17
17
 
18
- // `RequireObjectCoercible` abstract operation
19
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
20
- var requireObjectCoercible = function (it) {
21
- if (it == undefined) throw TypeError("Can't call method on " + it);
22
- return it;
23
- };
18
+ var functionBindNative = !fails(function () {
19
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
20
+ var test = function () {
21
+ /* empty */
22
+ }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
24
23
 
25
- var createMethod = function (CONVERT_TO_STRING) {
26
- return function ($this, pos) {
27
- var S = String(requireObjectCoercible($this));
28
- var position = toInteger(pos);
29
- var size = S.length;
30
- var first, second;
31
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
32
- first = S.charCodeAt(position);
33
- return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
24
+
25
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
26
+ });
27
+
28
+ var FunctionPrototype = Function.prototype;
29
+ var bind = FunctionPrototype.bind;
30
+ var call = FunctionPrototype.call;
31
+ var uncurryThis = functionBindNative && bind.bind(call, call);
32
+ var functionUncurryThis = functionBindNative ? function (fn) {
33
+ return fn && uncurryThis(fn);
34
+ } : function (fn) {
35
+ return fn && function () {
36
+ return call.apply(fn, arguments);
34
37
  };
35
38
  };
36
39
 
37
- var stringMultibyte = {
38
- // `String.prototype.codePointAt` method
39
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
40
- codeAt: createMethod(false),
41
- // `String.prototype.at` method
42
- // https://github.com/mathiasbynens/String.prototype.at
43
- charAt: createMethod(true)
40
+ var ceil = Math.ceil;
41
+ var floor = Math.floor; // `ToIntegerOrInfinity` abstract operation
42
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
43
+
44
+ var toIntegerOrInfinity = function (argument) {
45
+ var number = +argument; // eslint-disable-next-line no-self-compare -- safe
46
+
47
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
44
48
  };
45
49
 
46
50
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -64,21 +68,241 @@ var check = function (it) {
64
68
  }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
65
69
 
66
70
 
67
- var global_1 = // eslint-disable-next-line no-undef
68
- check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func
71
+ var global_1 = // eslint-disable-next-line es-x/no-global-this -- safe
72
+ check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
73
+ check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
69
74
  function () {
70
75
  return this;
71
76
  }() || Function('return this')();
72
77
 
73
- var fails = function (exec) {
78
+ var defineProperty = Object.defineProperty;
79
+
80
+ var setGlobal = function (key, value) {
74
81
  try {
75
- return !!exec();
82
+ defineProperty(global_1, key, {
83
+ value: value,
84
+ configurable: true,
85
+ writable: true
86
+ });
76
87
  } catch (error) {
77
- return true;
88
+ global_1[key] = value;
89
+ }
90
+
91
+ return value;
92
+ };
93
+
94
+ var SHARED = '__core-js_shared__';
95
+ var store = global_1[SHARED] || setGlobal(SHARED, {});
96
+ var sharedStore = store;
97
+
98
+ var shared = createCommonjsModule(function (module) {
99
+ (module.exports = function (key, value) {
100
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
101
+ })('versions', []).push({
102
+ version: '3.22.1',
103
+ mode: 'global',
104
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
105
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE',
106
+ source: 'https://github.com/zloirock/core-js'
107
+ });
108
+ });
109
+
110
+ var TypeError$1 = global_1.TypeError; // `RequireObjectCoercible` abstract operation
111
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
112
+
113
+ var requireObjectCoercible = function (it) {
114
+ if (it == undefined) throw TypeError$1("Can't call method on " + it);
115
+ return it;
116
+ };
117
+
118
+ var Object$1 = global_1.Object; // `ToObject` abstract operation
119
+ // https://tc39.es/ecma262/#sec-toobject
120
+
121
+ var toObject = function (argument) {
122
+ return Object$1(requireObjectCoercible(argument));
123
+ };
124
+
125
+ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
126
+ // https://tc39.es/ecma262/#sec-hasownproperty
127
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
128
+
129
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
130
+ return hasOwnProperty(toObject(it), key);
131
+ };
132
+
133
+ var id = 0;
134
+ var postfix = Math.random();
135
+ var toString = functionUncurryThis(1.0.toString);
136
+
137
+ var uid = function (key) {
138
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
139
+ };
140
+
141
+ // `IsCallable` abstract operation
142
+ // https://tc39.es/ecma262/#sec-iscallable
143
+ var isCallable = function (argument) {
144
+ return typeof argument == 'function';
145
+ };
146
+
147
+ var aFunction = function (argument) {
148
+ return isCallable(argument) ? argument : undefined;
149
+ };
150
+
151
+ var getBuiltIn = function (namespace, method) {
152
+ return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
153
+ };
154
+
155
+ var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
156
+
157
+ var process = global_1.process;
158
+ var Deno = global_1.Deno;
159
+ var versions = process && process.versions || Deno && Deno.version;
160
+ var v8 = versions && versions.v8;
161
+ var match, version;
162
+
163
+ if (v8) {
164
+ match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
165
+ // but their correct versions are not interesting for us
166
+
167
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
168
+ } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
169
+ // so check `userAgent` even if `.v8` exists, but 0
170
+
171
+
172
+ if (!version && engineUserAgent) {
173
+ match = engineUserAgent.match(/Edge\/(\d+)/);
174
+
175
+ if (!match || match[1] >= 74) {
176
+ match = engineUserAgent.match(/Chrome\/(\d+)/);
177
+ if (match) version = +match[1];
178
+ }
179
+ }
180
+
181
+ var engineV8Version = version;
182
+
183
+ /* eslint-disable es-x/no-symbol -- required for testing */
184
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
185
+
186
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
187
+ var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
188
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
189
+
190
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
191
+ !Symbol.sham && engineV8Version && engineV8Version < 41;
192
+ });
193
+
194
+ /* eslint-disable es-x/no-symbol -- required for testing */
195
+
196
+ var useSymbolAsUid = nativeSymbol && !Symbol.sham && typeof Symbol.iterator == 'symbol';
197
+
198
+ var WellKnownSymbolsStore = shared('wks');
199
+ var Symbol$1 = global_1.Symbol;
200
+ var symbolFor = Symbol$1 && Symbol$1['for'];
201
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
202
+
203
+ var wellKnownSymbol = function (name) {
204
+ if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
205
+ var description = 'Symbol.' + name;
206
+
207
+ if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
208
+ WellKnownSymbolsStore[name] = Symbol$1[name];
209
+ } else if (useSymbolAsUid && symbolFor) {
210
+ WellKnownSymbolsStore[name] = symbolFor(description);
211
+ } else {
212
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
213
+ }
214
+ }
215
+
216
+ return WellKnownSymbolsStore[name];
217
+ };
218
+
219
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
220
+ var test = {};
221
+ test[TO_STRING_TAG] = 'z';
222
+ var toStringTagSupport = String(test) === '[object z]';
223
+
224
+ var toString$1 = functionUncurryThis({}.toString);
225
+ var stringSlice = functionUncurryThis(''.slice);
226
+
227
+ var classofRaw = function (it) {
228
+ return stringSlice(toString$1(it), 8, -1);
229
+ };
230
+
231
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
232
+ var Object$2 = global_1.Object; // ES3 wrong here
233
+
234
+ var CORRECT_ARGUMENTS = classofRaw(function () {
235
+ return arguments;
236
+ }()) == 'Arguments'; // fallback for IE11 Script Access Denied error
237
+
238
+ var tryGet = function (it, key) {
239
+ try {
240
+ return it[key];
241
+ } catch (error) {
242
+ /* empty */
78
243
  }
244
+ }; // getting tag from ES6+ `Object.prototype.toString`
245
+
246
+
247
+ var classof = toStringTagSupport ? classofRaw : function (it) {
248
+ var O, tag, result;
249
+ return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
250
+ : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$1)) == 'string' ? tag // builtinTag case
251
+ : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
252
+ : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
253
+ };
254
+
255
+ var String$1 = global_1.String;
256
+
257
+ var toString_1 = function (argument) {
258
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
259
+ return String$1(argument);
260
+ };
261
+
262
+ var charAt = functionUncurryThis(''.charAt);
263
+ var charCodeAt = functionUncurryThis(''.charCodeAt);
264
+ var stringSlice$1 = functionUncurryThis(''.slice);
265
+
266
+ var createMethod = function (CONVERT_TO_STRING) {
267
+ return function ($this, pos) {
268
+ var S = toString_1(requireObjectCoercible($this));
269
+ var position = toIntegerOrInfinity(pos);
270
+ var size = S.length;
271
+ var first, second;
272
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
273
+ first = charCodeAt(S, position);
274
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice$1(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
275
+ };
276
+ };
277
+
278
+ var stringMultibyte = {
279
+ // `String.prototype.codePointAt` method
280
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
281
+ codeAt: createMethod(false),
282
+ // `String.prototype.at` method
283
+ // https://github.com/mathiasbynens/String.prototype.at
284
+ charAt: createMethod(true)
285
+ };
286
+
287
+ var functionToString = functionUncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
288
+
289
+ if (!isCallable(sharedStore.inspectSource)) {
290
+ sharedStore.inspectSource = function (it) {
291
+ return functionToString(it);
292
+ };
293
+ }
294
+
295
+ var inspectSource = sharedStore.inspectSource;
296
+
297
+ var WeakMap = global_1.WeakMap;
298
+ var nativeWeakMap = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
299
+
300
+ var isObject = function (it) {
301
+ return typeof it == 'object' ? it !== null : isCallable(it);
79
302
  };
80
303
 
81
304
  var descriptors = !fails(function () {
305
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
82
306
  return Object.defineProperty({}, 1, {
83
307
  get: function () {
84
308
  return 7;
@@ -86,10 +310,6 @@ var descriptors = !fails(function () {
86
310
  })[1] != 7;
87
311
  });
88
312
 
89
- var isObject = function (it) {
90
- return typeof it === 'object' ? it !== null : typeof it === 'function';
91
- };
92
-
93
313
  var document$1 = global_1.document; // typeof document.createElement is 'object' in old IE
94
314
 
95
315
  var EXISTS = isObject(document$1) && isObject(document$1.createElement);
@@ -99,6 +319,7 @@ var documentCreateElement = function (it) {
99
319
  };
100
320
 
101
321
  var ie8DomDefine = !descriptors && !fails(function () {
322
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
102
323
  return Object.defineProperty(documentCreateElement('div'), 'a', {
103
324
  get: function () {
104
325
  return 7;
@@ -106,40 +327,142 @@ var ie8DomDefine = !descriptors && !fails(function () {
106
327
  }).a != 7;
107
328
  });
108
329
 
109
- var anObject = function (it) {
110
- if (!isObject(it)) {
111
- throw TypeError(String(it) + ' is not an object');
330
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
331
+
332
+ var v8PrototypeDefineBug = descriptors && fails(function () {
333
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
334
+ return Object.defineProperty(function () {
335
+ /* empty */
336
+ }, 'prototype', {
337
+ value: 42,
338
+ writable: false
339
+ }).prototype != 42;
340
+ });
341
+
342
+ var String$2 = global_1.String;
343
+ var TypeError$2 = global_1.TypeError; // `Assert: Type(argument) is Object`
344
+
345
+ var anObject = function (argument) {
346
+ if (isObject(argument)) return argument;
347
+ throw TypeError$2(String$2(argument) + ' is not an object');
348
+ };
349
+
350
+ var call$1 = Function.prototype.call;
351
+ var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
352
+ return call$1.apply(call$1, arguments);
353
+ };
354
+
355
+ var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
356
+
357
+ var Object$3 = global_1.Object;
358
+ var isSymbol = useSymbolAsUid ? function (it) {
359
+ return typeof it == 'symbol';
360
+ } : function (it) {
361
+ var $Symbol = getBuiltIn('Symbol');
362
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
363
+ };
364
+
365
+ var String$3 = global_1.String;
366
+
367
+ var tryToString = function (argument) {
368
+ try {
369
+ return String$3(argument);
370
+ } catch (error) {
371
+ return 'Object';
112
372
  }
373
+ };
113
374
 
114
- return it;
375
+ var TypeError$3 = global_1.TypeError; // `Assert: IsCallable(argument) is true`
376
+
377
+ var aCallable = function (argument) {
378
+ if (isCallable(argument)) return argument;
379
+ throw TypeError$3(tryToString(argument) + ' is not a function');
380
+ };
381
+
382
+ // https://tc39.es/ecma262/#sec-getmethod
383
+
384
+ var getMethod = function (V, P) {
385
+ var func = V[P];
386
+ return func == null ? undefined : aCallable(func);
115
387
  };
116
388
 
117
- // https://tc39.github.io/ecma262/#sec-toprimitive
118
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
119
- // and the second argument - flag - preferred type is a string
389
+ var TypeError$4 = global_1.TypeError; // `OrdinaryToPrimitive` abstract operation
390
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
120
391
 
121
- var toPrimitive = function (input, PREFERRED_STRING) {
122
- if (!isObject(input)) return input;
392
+ var ordinaryToPrimitive = function (input, pref) {
123
393
  var fn, val;
124
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
125
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
126
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
127
- throw TypeError("Can't convert object to primitive value");
394
+ if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
395
+ if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
396
+ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
397
+ throw TypeError$4("Can't convert object to primitive value");
128
398
  };
129
399
 
130
- var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method
131
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
400
+ var TypeError$5 = global_1.TypeError;
401
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation
402
+ // https://tc39.es/ecma262/#sec-toprimitive
132
403
 
133
- var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
404
+ var toPrimitive = function (input, pref) {
405
+ if (!isObject(input) || isSymbol(input)) return input;
406
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
407
+ var result;
408
+
409
+ if (exoticToPrim) {
410
+ if (pref === undefined) pref = 'default';
411
+ result = functionCall(exoticToPrim, input, pref);
412
+ if (!isObject(result) || isSymbol(result)) return result;
413
+ throw TypeError$5("Can't convert object to primitive value");
414
+ }
415
+
416
+ if (pref === undefined) pref = 'number';
417
+ return ordinaryToPrimitive(input, pref);
418
+ };
419
+
420
+ // https://tc39.es/ecma262/#sec-topropertykey
421
+
422
+ var toPropertyKey = function (argument) {
423
+ var key = toPrimitive(argument, 'string');
424
+ return isSymbol(key) ? key : key + '';
425
+ };
426
+
427
+ var TypeError$6 = global_1.TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
428
+
429
+ var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
430
+
431
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
432
+ var ENUMERABLE = 'enumerable';
433
+ var CONFIGURABLE = 'configurable';
434
+ var WRITABLE = 'writable'; // `Object.defineProperty` method
435
+ // https://tc39.es/ecma262/#sec-object.defineproperty
436
+
437
+ var f = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
438
+ anObject(O);
439
+ P = toPropertyKey(P);
440
+ anObject(Attributes);
441
+
442
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
443
+ var current = $getOwnPropertyDescriptor(O, P);
444
+
445
+ if (current && current[WRITABLE]) {
446
+ O[P] = Attributes.value;
447
+ Attributes = {
448
+ configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
449
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
450
+ writable: false
451
+ };
452
+ }
453
+ }
454
+
455
+ return $defineProperty(O, P, Attributes);
456
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
134
457
  anObject(O);
135
- P = toPrimitive(P, true);
458
+ P = toPropertyKey(P);
136
459
  anObject(Attributes);
137
460
  if (ie8DomDefine) try {
138
- return nativeDefineProperty(O, P, Attributes);
461
+ return $defineProperty(O, P, Attributes);
139
462
  } catch (error) {
140
463
  /* empty */
141
464
  }
142
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
465
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
143
466
  if ('value' in Attributes) O[P] = Attributes.value;
144
467
  return O;
145
468
  };
@@ -163,56 +486,6 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
163
486
  return object;
164
487
  };
165
488
 
166
- var setGlobal = function (key, value) {
167
- try {
168
- createNonEnumerableProperty(global_1, key, value);
169
- } catch (error) {
170
- global_1[key] = value;
171
- }
172
-
173
- return value;
174
- };
175
-
176
- var SHARED = '__core-js_shared__';
177
- var store = global_1[SHARED] || setGlobal(SHARED, {});
178
- var sharedStore = store;
179
-
180
- var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
181
-
182
- if (typeof sharedStore.inspectSource != 'function') {
183
- sharedStore.inspectSource = function (it) {
184
- return functionToString.call(it);
185
- };
186
- }
187
-
188
- var inspectSource = sharedStore.inspectSource;
189
-
190
- var WeakMap = global_1.WeakMap;
191
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
192
-
193
- var hasOwnProperty = {}.hasOwnProperty;
194
-
195
- var has = function (it, key) {
196
- return hasOwnProperty.call(it, key);
197
- };
198
-
199
- var shared = createCommonjsModule(function (module) {
200
- (module.exports = function (key, value) {
201
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
202
- })('versions', []).push({
203
- version: '3.8.1',
204
- mode: 'global',
205
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
206
- });
207
- });
208
-
209
- var id = 0;
210
- var postfix = Math.random();
211
-
212
- var uid = function (key) {
213
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
214
- };
215
-
216
489
  var keys = shared('keys');
217
490
 
218
491
  var sharedKey = function (key) {
@@ -221,11 +494,13 @@ var sharedKey = function (key) {
221
494
 
222
495
  var hiddenKeys = {};
223
496
 
497
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
498
+ var TypeError$7 = global_1.TypeError;
224
499
  var WeakMap$1 = global_1.WeakMap;
225
- var set, get, has$1;
500
+ var set, get, has;
226
501
 
227
502
  var enforce = function (it) {
228
- return has$1(it) ? get(it) : set(it, {});
503
+ return has(it) ? get(it) : set(it, {});
229
504
  };
230
505
 
231
506
  var getterFor = function (TYPE) {
@@ -233,113 +508,128 @@ var getterFor = function (TYPE) {
233
508
  var state;
234
509
 
235
510
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
236
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
511
+ throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
237
512
  }
238
513
 
239
514
  return state;
240
515
  };
241
516
  };
242
517
 
243
- if (nativeWeakMap) {
518
+ if (nativeWeakMap || sharedStore.state) {
244
519
  var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
245
- var wmget = store$1.get;
246
- var wmhas = store$1.has;
247
- var wmset = store$1.set;
520
+ var wmget = functionUncurryThis(store$1.get);
521
+ var wmhas = functionUncurryThis(store$1.has);
522
+ var wmset = functionUncurryThis(store$1.set);
248
523
 
249
524
  set = function (it, metadata) {
525
+ if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
250
526
  metadata.facade = it;
251
- wmset.call(store$1, it, metadata);
527
+ wmset(store$1, it, metadata);
252
528
  return metadata;
253
529
  };
254
530
 
255
531
  get = function (it) {
256
- return wmget.call(store$1, it) || {};
532
+ return wmget(store$1, it) || {};
257
533
  };
258
534
 
259
- has$1 = function (it) {
260
- return wmhas.call(store$1, it);
535
+ has = function (it) {
536
+ return wmhas(store$1, it);
261
537
  };
262
538
  } else {
263
539
  var STATE = sharedKey('state');
264
540
  hiddenKeys[STATE] = true;
265
541
 
266
542
  set = function (it, metadata) {
543
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
267
544
  metadata.facade = it;
268
545
  createNonEnumerableProperty(it, STATE, metadata);
269
546
  return metadata;
270
547
  };
271
548
 
272
549
  get = function (it) {
273
- return has(it, STATE) ? it[STATE] : {};
550
+ return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
274
551
  };
275
552
 
276
- has$1 = function (it) {
277
- return has(it, STATE);
553
+ has = function (it) {
554
+ return hasOwnProperty_1(it, STATE);
278
555
  };
279
556
  }
280
557
 
281
558
  var internalState = {
282
559
  set: set,
283
560
  get: get,
284
- has: has$1,
561
+ has: has,
285
562
  enforce: enforce,
286
563
  getterFor: getterFor
287
564
  };
288
565
 
289
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
566
+ var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
567
+
290
568
  var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
291
569
 
292
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({
570
+ var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
293
571
  1: 2
294
572
  }, 1); // `Object.prototype.propertyIsEnumerable` method implementation
295
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
573
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
296
574
 
297
575
  var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
298
576
  var descriptor = getOwnPropertyDescriptor(this, V);
299
577
  return !!descriptor && descriptor.enumerable;
300
- } : nativePropertyIsEnumerable;
578
+ } : $propertyIsEnumerable;
301
579
  var objectPropertyIsEnumerable = {
302
580
  f: f$1
303
581
  };
304
582
 
305
- var toString = {}.toString;
306
-
307
- var classofRaw = function (it) {
308
- return toString.call(it).slice(8, -1);
309
- };
310
-
311
- var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings
583
+ var Object$4 = global_1.Object;
584
+ var split = functionUncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
312
585
 
313
586
  var indexedObject = fails(function () {
314
587
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
315
- // eslint-disable-next-line no-prototype-builtins
316
- return !Object('z').propertyIsEnumerable(0);
588
+ // eslint-disable-next-line no-prototype-builtins -- safe
589
+ return !Object$4('z').propertyIsEnumerable(0);
317
590
  }) ? function (it) {
318
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
319
- } : Object;
591
+ return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
592
+ } : Object$4;
320
593
 
321
594
  var toIndexedObject = function (it) {
322
595
  return indexedObject(requireObjectCoercible(it));
323
596
  };
324
597
 
325
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
326
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
598
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
599
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
327
600
 
328
- var f$2 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
601
+ var f$2 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
329
602
  O = toIndexedObject(O);
330
- P = toPrimitive(P, true);
603
+ P = toPropertyKey(P);
331
604
  if (ie8DomDefine) try {
332
- return nativeGetOwnPropertyDescriptor(O, P);
605
+ return $getOwnPropertyDescriptor$1(O, P);
333
606
  } catch (error) {
334
607
  /* empty */
335
608
  }
336
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
609
+ if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
337
610
  };
338
611
  var objectGetOwnPropertyDescriptor = {
339
612
  f: f$2
340
613
  };
341
614
 
615
+ var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
616
+
617
+ var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
618
+ var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names
619
+
620
+ var PROPER = EXISTS$1 && function something() {
621
+ /* empty */
622
+ }.name === 'something';
623
+
624
+ var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable);
625
+ var functionName = {
626
+ EXISTS: EXISTS$1,
627
+ PROPER: PROPER,
628
+ CONFIGURABLE: CONFIGURABLE$1
629
+ };
630
+
342
631
  var redefine = createCommonjsModule(function (module) {
632
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
343
633
  var getInternalState = internalState.get;
344
634
  var enforceInternalState = internalState.enforce;
345
635
  var TEMPLATE = String(String).split('String');
@@ -347,17 +637,22 @@ var redefine = createCommonjsModule(function (module) {
347
637
  var unsafe = options ? !!options.unsafe : false;
348
638
  var simple = options ? !!options.enumerable : false;
349
639
  var noTargetGet = options ? !!options.noTargetGet : false;
640
+ var name = options && options.name !== undefined ? options.name : key;
350
641
  var state;
351
642
 
352
- if (typeof value == 'function') {
353
- if (typeof key == 'string' && !has(value, 'name')) {
354
- createNonEnumerableProperty(value, 'name', key);
643
+ if (isCallable(value)) {
644
+ if (String(name).slice(0, 7) === 'Symbol(') {
645
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
646
+ }
647
+
648
+ if (!hasOwnProperty_1(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
649
+ createNonEnumerableProperty(value, 'name', name);
355
650
  }
356
651
 
357
652
  state = enforceInternalState(value);
358
653
 
359
654
  if (!state.source) {
360
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
655
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
361
656
  }
362
657
  }
363
658
 
@@ -372,47 +667,43 @@ var redefine = createCommonjsModule(function (module) {
372
667
 
373
668
  if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
374
669
  })(Function.prototype, 'toString', function toString() {
375
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
670
+ return isCallable(this) && getInternalState(this).source || inspectSource(this);
376
671
  });
377
672
  });
378
673
 
379
- var path = global_1;
380
-
381
- var aFunction = function (variable) {
382
- return typeof variable == 'function' ? variable : undefined;
383
- };
674
+ var max = Math.max;
675
+ var min = Math.min; // Helper for a popular repeating case of the spec:
676
+ // Let integer be ? ToInteger(index).
677
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
384
678
 
385
- var getBuiltIn = function (namespace, method) {
386
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace]) : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
679
+ var toAbsoluteIndex = function (index, length) {
680
+ var integer = toIntegerOrInfinity(index);
681
+ return integer < 0 ? max(integer + length, 0) : min(integer, length);
387
682
  };
388
683
 
389
- var min = Math.min; // `ToLength` abstract operation
390
- // https://tc39.github.io/ecma262/#sec-tolength
684
+ var min$1 = Math.min; // `ToLength` abstract operation
685
+ // https://tc39.es/ecma262/#sec-tolength
391
686
 
392
687
  var toLength = function (argument) {
393
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
688
+ return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
394
689
  };
395
690
 
396
- var max = Math.max;
397
- var min$1 = Math.min; // Helper for a popular repeating case of the spec:
398
- // Let integer be ? ToInteger(index).
399
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
691
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
400
692
 
401
- var toAbsoluteIndex = function (index, length) {
402
- var integer = toInteger(index);
403
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
693
+ var lengthOfArrayLike = function (obj) {
694
+ return toLength(obj.length);
404
695
  };
405
696
 
406
697
  var createMethod$1 = function (IS_INCLUDES) {
407
698
  return function ($this, el, fromIndex) {
408
699
  var O = toIndexedObject($this);
409
- var length = toLength(O.length);
700
+ var length = lengthOfArrayLike(O);
410
701
  var index = toAbsoluteIndex(fromIndex, length);
411
702
  var value; // Array#includes uses SameValueZero equality algorithm
412
- // eslint-disable-next-line no-self-compare
703
+ // eslint-disable-next-line no-self-compare -- NaN check
413
704
 
414
705
  if (IS_INCLUDES && el != el) while (length > index) {
415
- value = O[index++]; // eslint-disable-next-line no-self-compare
706
+ value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
416
707
 
417
708
  if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
418
709
  } else for (; length > index; index++) {
@@ -424,14 +715,15 @@ var createMethod$1 = function (IS_INCLUDES) {
424
715
 
425
716
  var arrayIncludes = {
426
717
  // `Array.prototype.includes` method
427
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
718
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
428
719
  includes: createMethod$1(true),
429
720
  // `Array.prototype.indexOf` method
430
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
721
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
431
722
  indexOf: createMethod$1(false)
432
723
  };
433
724
 
434
725
  var indexOf = arrayIncludes.indexOf;
726
+ var push = functionUncurryThis([].push);
435
727
 
436
728
  var objectKeysInternal = function (object, names) {
437
729
  var O = toIndexedObject(object);
@@ -439,11 +731,11 @@ var objectKeysInternal = function (object, names) {
439
731
  var result = [];
440
732
  var key;
441
733
 
442
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys
734
+ for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key); // Don't enum bug & hidden keys
443
735
 
444
736
 
445
- while (names.length > i) if (has(O, key = names[i++])) {
446
- ~indexOf(result, key) || result.push(key);
737
+ while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
738
+ ~indexOf(result, key) || push(result, key);
447
739
  }
448
740
 
449
741
  return result;
@@ -453,7 +745,8 @@ var objectKeysInternal = function (object, names) {
453
745
  var enumBugKeys = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
454
746
 
455
747
  var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
456
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
748
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
749
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
457
750
 
458
751
  var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
459
752
  return objectKeysInternal(O, hiddenKeys$1);
@@ -463,25 +756,31 @@ var objectGetOwnPropertyNames = {
463
756
  f: f$3
464
757
  };
465
758
 
759
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
466
760
  var f$4 = Object.getOwnPropertySymbols;
467
761
  var objectGetOwnPropertySymbols = {
468
762
  f: f$4
469
763
  };
470
764
 
765
+ var concat = functionUncurryThis([].concat); // all object keys, includes non-enumerable and symbols
766
+
471
767
  var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
472
768
  var keys = objectGetOwnPropertyNames.f(anObject(it));
473
769
  var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
474
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
770
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
475
771
  };
476
772
 
477
- var copyConstructorProperties = function (target, source) {
773
+ var copyConstructorProperties = function (target, source, exceptions) {
478
774
  var keys = ownKeys(source);
479
775
  var defineProperty = objectDefineProperty.f;
480
776
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
481
777
 
482
778
  for (var i = 0; i < keys.length; i++) {
483
779
  var key = keys[i];
484
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
780
+
781
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
782
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
783
+ }
485
784
  }
486
785
  };
487
786
 
@@ -489,7 +788,7 @@ var replacement = /#|\.prototype\./;
489
788
 
490
789
  var isForced = function (feature, detection) {
491
790
  var value = data[normalize(feature)];
492
- return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection;
791
+ return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
493
792
  };
494
793
 
495
794
  var normalize = isForced.normalize = function (string) {
@@ -515,6 +814,7 @@ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
515
814
  options.sham - add a flag to not completely full polyfills
516
815
  options.enumerable - export as enumerable property
517
816
  options.noTargetGet - prevent calling a getter on target
817
+ options.name - the .name of the function if it does not match the key
518
818
  */
519
819
 
520
820
  var _export = function (options, source) {
@@ -542,7 +842,7 @@ var _export = function (options, source) {
542
842
  FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target
543
843
 
544
844
  if (!FORCED && targetProperty !== undefined) {
545
- if (typeof sourceProperty === typeof targetProperty) continue;
845
+ if (typeof sourceProperty == typeof targetProperty) continue;
546
846
  copyConstructorProperties(sourceProperty, targetProperty);
547
847
  } // add a flag to not completely full polyfills
548
848
 
@@ -556,116 +856,41 @@ var _export = function (options, source) {
556
856
  }
557
857
  };
558
858
 
559
- // https://tc39.github.io/ecma262/#sec-toobject
560
-
561
- var toObject = function (argument) {
562
- return Object(requireObjectCoercible(argument));
563
- };
564
-
565
- var correctPrototypeGetter = !fails(function () {
566
- function F() {
567
- /* empty */
568
- }
569
-
570
- F.prototype.constructor = null;
571
- return Object.getPrototypeOf(new F()) !== F.prototype;
572
- });
573
-
574
- var IE_PROTO = sharedKey('IE_PROTO');
575
- var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method
576
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
577
-
578
- var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
579
- O = toObject(O);
580
- if (has(O, IE_PROTO)) return O[IE_PROTO];
581
-
582
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
583
- return O.constructor.prototype;
584
- }
585
-
586
- return O instanceof Object ? ObjectPrototype : null;
587
- };
588
-
589
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
590
- // Chrome 38 Symbol has incorrect toString conversion
591
- // eslint-disable-next-line no-undef
592
- return !String(Symbol());
593
- });
594
-
595
- var useSymbolAsUid = nativeSymbol // eslint-disable-next-line no-undef
596
- && !Symbol.sham // eslint-disable-next-line no-undef
597
- && typeof Symbol.iterator == 'symbol';
598
-
599
- var WellKnownSymbolsStore = shared('wks');
600
- var Symbol$1 = global_1.Symbol;
601
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
602
-
603
- var wellKnownSymbol = function (name) {
604
- if (!has(WellKnownSymbolsStore, name)) {
605
- if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
606
- }
607
-
608
- return WellKnownSymbolsStore[name];
609
- };
610
-
611
- var ITERATOR = wellKnownSymbol('iterator');
612
- var BUGGY_SAFARI_ITERATORS = false;
613
-
614
- var returnThis = function () {
615
- return this;
616
- }; // `%IteratorPrototype%` object
617
- // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
618
-
619
-
620
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
621
-
622
- if ([].keys) {
623
- arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
624
-
625
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
626
- PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
627
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
628
- }
629
- }
630
-
631
- if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
632
-
633
- if ( !has(IteratorPrototype, ITERATOR)) {
634
- createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
635
- }
636
-
637
- var iteratorsCore = {
638
- IteratorPrototype: IteratorPrototype,
639
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
640
- };
641
-
642
- // https://tc39.github.io/ecma262/#sec-object.keys
859
+ // https://tc39.es/ecma262/#sec-object.keys
860
+ // eslint-disable-next-line es-x/no-object-keys -- safe
643
861
 
644
862
  var objectKeys = Object.keys || function keys(O) {
645
863
  return objectKeysInternal(O, enumBugKeys);
646
864
  };
647
865
 
648
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
866
+ // https://tc39.es/ecma262/#sec-object.defineproperties
867
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
649
868
 
650
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
869
+ var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
651
870
  anObject(O);
871
+ var props = toIndexedObject(Properties);
652
872
  var keys = objectKeys(Properties);
653
873
  var length = keys.length;
654
874
  var index = 0;
655
875
  var key;
656
876
 
657
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
877
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
658
878
 
659
879
  return O;
660
880
  };
881
+ var objectDefineProperties = {
882
+ f: f$5
883
+ };
661
884
 
662
885
  var html = getBuiltIn('document', 'documentElement');
663
886
 
887
+ /* global ActiveXObject -- old IE, WSH */
888
+
664
889
  var GT = '>';
665
890
  var LT = '<';
666
891
  var PROTOTYPE = 'prototype';
667
892
  var SCRIPT = 'script';
668
- var IE_PROTO$1 = sharedKey('IE_PROTO');
893
+ var IE_PROTO = sharedKey('IE_PROTO');
669
894
 
670
895
  var EmptyConstructor = function () {
671
896
  /* empty */
@@ -711,13 +936,14 @@ var activeXDocument;
711
936
 
712
937
  var NullProtoObject = function () {
713
938
  try {
714
- /* global ActiveXObject */
715
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
939
+ activeXDocument = new ActiveXObject('htmlfile');
716
940
  } catch (error) {
717
941
  /* ignore */
718
942
  }
719
943
 
720
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
944
+ NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE
945
+ : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH
946
+
721
947
  var length = enumBugKeys.length;
722
948
 
723
949
  while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
@@ -725,8 +951,9 @@ var NullProtoObject = function () {
725
951
  return NullProtoObject();
726
952
  };
727
953
 
728
- hiddenKeys[IE_PROTO$1] = true; // `Object.create` method
729
- // https://tc39.github.io/ecma262/#sec-object.create
954
+ hiddenKeys[IE_PROTO] = true; // `Object.create` method
955
+ // https://tc39.es/ecma262/#sec-object.create
956
+ // eslint-disable-next-line es-x/no-object-create -- safe
730
957
 
731
958
  var objectCreate = Object.create || function create(O, Properties) {
732
959
  var result;
@@ -736,18 +963,82 @@ var objectCreate = Object.create || function create(O, Properties) {
736
963
  result = new EmptyConstructor();
737
964
  EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill
738
965
 
739
- result[IE_PROTO$1] = O;
966
+ result[IE_PROTO] = O;
740
967
  } else result = NullProtoObject();
741
968
 
742
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
969
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
743
970
  };
744
971
 
745
- var defineProperty = objectDefineProperty.f;
746
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
972
+ var correctPrototypeGetter = !fails(function () {
973
+ function F() {
974
+ /* empty */
975
+ }
976
+
977
+ F.prototype.constructor = null; // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
978
+
979
+ return Object.getPrototypeOf(new F()) !== F.prototype;
980
+ });
981
+
982
+ var IE_PROTO$1 = sharedKey('IE_PROTO');
983
+ var Object$5 = global_1.Object;
984
+ var ObjectPrototype = Object$5.prototype; // `Object.getPrototypeOf` method
985
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
986
+
987
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
988
+ var object = toObject(O);
989
+ if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
990
+ var constructor = object.constructor;
991
+
992
+ if (isCallable(constructor) && object instanceof constructor) {
993
+ return constructor.prototype;
994
+ }
995
+
996
+ return object instanceof Object$5 ? ObjectPrototype : null;
997
+ };
998
+
999
+ var ITERATOR = wellKnownSymbol('iterator');
1000
+ var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object
1001
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1002
+
1003
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
1004
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1005
+
1006
+ if ([].keys) {
1007
+ arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
1008
+
1009
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
1010
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
1011
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
1012
+ }
1013
+ }
1014
+
1015
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
1016
+ var test = {}; // FF44- legacy iterators case
1017
+
1018
+ return IteratorPrototype[ITERATOR].call(test) !== test;
1019
+ });
1020
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; // `%IteratorPrototype%[@@iterator]()` method
1021
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1022
+
1023
+ if (!isCallable(IteratorPrototype[ITERATOR])) {
1024
+ redefine(IteratorPrototype, ITERATOR, function () {
1025
+ return this;
1026
+ });
1027
+ }
1028
+
1029
+ var iteratorsCore = {
1030
+ IteratorPrototype: IteratorPrototype,
1031
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
1032
+ };
1033
+
1034
+ var defineProperty$1 = objectDefineProperty.f;
1035
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
747
1036
 
748
- var setToStringTag = function (it, TAG, STATIC) {
749
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
750
- defineProperty(it, TO_STRING_TAG, {
1037
+ var setToStringTag = function (target, TAG, STATIC) {
1038
+ if (target && !STATIC) target = target.prototype;
1039
+
1040
+ if (target && !hasOwnProperty_1(target, TO_STRING_TAG$2)) {
1041
+ defineProperty$1(target, TO_STRING_TAG$2, {
751
1042
  configurable: true,
752
1043
  value: TAG
753
1044
  });
@@ -758,32 +1049,33 @@ var iterators = {};
758
1049
 
759
1050
  var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
760
1051
 
761
- var returnThis$1 = function () {
1052
+ var returnThis = function () {
762
1053
  return this;
763
1054
  };
764
1055
 
765
- var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
1056
+ var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
766
1057
  var TO_STRING_TAG = NAME + ' Iterator';
767
1058
  IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, {
768
- next: createPropertyDescriptor(1, next)
1059
+ next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next)
769
1060
  });
770
1061
  setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
771
- iterators[TO_STRING_TAG] = returnThis$1;
1062
+ iterators[TO_STRING_TAG] = returnThis;
772
1063
  return IteratorConstructor;
773
1064
  };
774
1065
 
775
- var aPossiblePrototype = function (it) {
776
- if (!isObject(it) && it !== null) {
777
- throw TypeError("Can't set " + String(it) + ' as a prototype');
778
- }
1066
+ var String$4 = global_1.String;
1067
+ var TypeError$8 = global_1.TypeError;
779
1068
 
780
- return it;
1069
+ var aPossiblePrototype = function (argument) {
1070
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
1071
+ throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
781
1072
  };
782
1073
 
783
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
1074
+ /* eslint-disable no-proto -- safe */
1075
+ // `Object.setPrototypeOf` method
1076
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
784
1077
  // Works with __proto__ only. Old v8 can't work with null proto objects.
785
-
786
- /* eslint-disable no-proto */
1078
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
787
1079
 
788
1080
  var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
789
1081
  var CORRECT_SETTER = false;
@@ -791,8 +1083,9 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
791
1083
  var setter;
792
1084
 
793
1085
  try {
794
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
795
- setter.call(test, []);
1086
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1087
+ setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1088
+ setter(test, []);
796
1089
  CORRECT_SETTER = test instanceof Array;
797
1090
  } catch (error) {
798
1091
  /* empty */
@@ -801,11 +1094,13 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
801
1094
  return function setPrototypeOf(O, proto) {
802
1095
  anObject(O);
803
1096
  aPossiblePrototype(proto);
804
- if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
1097
+ if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
805
1098
  return O;
806
1099
  };
807
1100
  }() : undefined);
808
1101
 
1102
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1103
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
809
1104
  var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
810
1105
  var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
811
1106
  var ITERATOR$1 = wellKnownSymbol('iterator');
@@ -813,7 +1108,7 @@ var KEYS = 'keys';
813
1108
  var VALUES = 'values';
814
1109
  var ENTRIES = 'entries';
815
1110
 
816
- var returnThis$2 = function () {
1111
+ var returnThis$1 = function () {
817
1112
  return this;
818
1113
  };
819
1114
 
@@ -857,35 +1152,33 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
857
1152
  if (anyNativeIterator) {
858
1153
  CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
859
1154
 
860
- if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
1155
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
861
1156
  if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
862
1157
  if (objectSetPrototypeOf) {
863
1158
  objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
864
- } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
865
- createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$2);
1159
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1160
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
866
1161
  }
867
1162
  } // Set @@toStringTag to native iterators
868
1163
 
869
1164
 
870
1165
  setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
871
1166
  }
872
- } // fix Array#{values, @@iterator}.name in V8 / FF
873
-
1167
+ } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
874
1168
 
875
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
876
- INCORRECT_VALUES_NAME = true;
877
-
878
- defaultIterator = function values() {
879
- return nativeIterator.call(this);
880
- };
881
- } // define iterator
882
1169
 
1170
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1171
+ if ( CONFIGURABLE_FUNCTION_NAME) {
1172
+ createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
1173
+ } else {
1174
+ INCORRECT_VALUES_NAME = true;
883
1175
 
884
- if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
885
- createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
886
- }
1176
+ defaultIterator = function values() {
1177
+ return functionCall(nativeIterator, this);
1178
+ };
1179
+ }
1180
+ } // export additional methods
887
1181
 
888
- iterators[NAME] = defaultIterator; // export additional methods
889
1182
 
890
1183
  if (DEFAULT) {
891
1184
  methods = {
@@ -902,24 +1195,32 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
902
1195
  proto: true,
903
1196
  forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME
904
1197
  }, methods);
1198
+ } // define iterator
1199
+
1200
+
1201
+ if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1202
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, {
1203
+ name: DEFAULT
1204
+ });
905
1205
  }
906
1206
 
1207
+ iterators[NAME] = defaultIterator;
907
1208
  return methods;
908
1209
  };
909
1210
 
910
- var charAt = stringMultibyte.charAt;
1211
+ var charAt$1 = stringMultibyte.charAt;
911
1212
  var STRING_ITERATOR = 'String Iterator';
912
1213
  var setInternalState = internalState.set;
913
1214
  var getInternalState = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method
914
- // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
1215
+ // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
915
1216
 
916
1217
  defineIterator(String, 'String', function (iterated) {
917
1218
  setInternalState(this, {
918
1219
  type: STRING_ITERATOR,
919
- string: String(iterated),
1220
+ string: toString_1(iterated),
920
1221
  index: 0
921
1222
  }); // `%StringIteratorPrototype%.next` method
922
- // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
1223
+ // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
923
1224
  }, function next() {
924
1225
  var state = getInternalState(this);
925
1226
  var string = state.string;
@@ -929,7 +1230,7 @@ defineIterator(String, 'String', function (iterated) {
929
1230
  value: undefined,
930
1231
  done: true
931
1232
  };
932
- point = charAt(string, index);
1233
+ point = charAt$1(string, index);
933
1234
  state.index += point.length;
934
1235
  return {
935
1236
  value: point,
@@ -937,61 +1238,46 @@ defineIterator(String, 'String', function (iterated) {
937
1238
  };
938
1239
  });
939
1240
 
940
- var aFunction$1 = function (it) {
941
- if (typeof it != 'function') {
942
- throw TypeError(String(it) + ' is not a function');
943
- }
1241
+ var bind$1 = functionUncurryThis(functionUncurryThis.bind); // optional / simple context binding
944
1242
 
945
- return it;
1243
+ var functionBindContext = function (fn, that) {
1244
+ aCallable(fn);
1245
+ return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function
1246
+ /* ...args */
1247
+ () {
1248
+ return fn.apply(that, arguments);
1249
+ };
946
1250
  };
947
1251
 
948
- var functionBindContext = function (fn, that, length) {
949
- aFunction$1(fn);
950
- if (that === undefined) return fn;
951
-
952
- switch (length) {
953
- case 0:
954
- return function () {
955
- return fn.call(that);
956
- };
1252
+ var iteratorClose = function (iterator, kind, value) {
1253
+ var innerResult, innerError;
1254
+ anObject(iterator);
957
1255
 
958
- case 1:
959
- return function (a) {
960
- return fn.call(that, a);
961
- };
1256
+ try {
1257
+ innerResult = getMethod(iterator, 'return');
962
1258
 
963
- case 2:
964
- return function (a, b) {
965
- return fn.call(that, a, b);
966
- };
1259
+ if (!innerResult) {
1260
+ if (kind === 'throw') throw value;
1261
+ return value;
1262
+ }
967
1263
 
968
- case 3:
969
- return function (a, b, c) {
970
- return fn.call(that, a, b, c);
971
- };
1264
+ innerResult = functionCall(innerResult, iterator);
1265
+ } catch (error) {
1266
+ innerError = true;
1267
+ innerResult = error;
972
1268
  }
973
1269
 
974
- return function ()
975
- /* ...args */
976
- {
977
- return fn.apply(that, arguments);
978
- };
979
- };
980
-
981
- var iteratorClose = function (iterator) {
982
- var returnMethod = iterator['return'];
983
-
984
- if (returnMethod !== undefined) {
985
- return anObject(returnMethod.call(iterator)).value;
986
- }
1270
+ if (kind === 'throw') throw value;
1271
+ if (innerError) throw innerResult;
1272
+ anObject(innerResult);
1273
+ return value;
987
1274
  };
988
1275
 
989
1276
  var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
990
1277
  try {
991
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion)
1278
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
992
1279
  } catch (error) {
993
- iteratorClose(iterator);
994
- throw error;
1280
+ iteratorClose(iterator, 'throw', error);
995
1281
  }
996
1282
  };
997
1283
 
@@ -1002,73 +1288,104 @@ var isArrayIteratorMethod = function (it) {
1002
1288
  return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
1003
1289
  };
1004
1290
 
1005
- var createProperty = function (object, key, value) {
1006
- var propertyKey = toPrimitive(key);
1007
- if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
1291
+ var noop = function () {
1292
+ /* empty */
1008
1293
  };
1009
1294
 
1010
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1011
- var test = {};
1012
- test[TO_STRING_TAG$1] = 'z';
1013
- var toStringTagSupport = String(test) === '[object z]';
1295
+ var empty = [];
1296
+ var construct = getBuiltIn('Reflect', 'construct');
1297
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1298
+ var exec = functionUncurryThis(constructorRegExp.exec);
1299
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1014
1300
 
1015
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); // ES3 wrong here
1301
+ var isConstructorModern = function isConstructor(argument) {
1302
+ if (!isCallable(argument)) return false;
1016
1303
 
1017
- var CORRECT_ARGUMENTS = classofRaw(function () {
1018
- return arguments;
1019
- }()) == 'Arguments'; // fallback for IE11 Script Access Denied error
1304
+ try {
1305
+ construct(noop, empty, argument);
1306
+ return true;
1307
+ } catch (error) {
1308
+ return false;
1309
+ }
1310
+ };
1311
+
1312
+ var isConstructorLegacy = function isConstructor(argument) {
1313
+ if (!isCallable(argument)) return false;
1314
+
1315
+ switch (classof(argument)) {
1316
+ case 'AsyncFunction':
1317
+ case 'GeneratorFunction':
1318
+ case 'AsyncGeneratorFunction':
1319
+ return false;
1320
+ }
1020
1321
 
1021
- var tryGet = function (it, key) {
1022
1322
  try {
1023
- return it[key];
1323
+ // we can't check .prototype since constructors produced by .bind haven't it
1324
+ // `Function#toString` throws on some built-it function in some legacy engines
1325
+ // (for example, `DOMQuad` and similar in FF41-)
1326
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1024
1327
  } catch (error) {
1025
- /* empty */
1328
+ return true;
1026
1329
  }
1027
- }; // getting tag from ES6+ `Object.prototype.toString`
1330
+ };
1028
1331
 
1332
+ isConstructorLegacy.sham = true; // `IsConstructor` abstract operation
1333
+ // https://tc39.es/ecma262/#sec-isconstructor
1029
1334
 
1030
- var classof = toStringTagSupport ? classofRaw : function (it) {
1031
- var O, tag, result;
1032
- return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
1033
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag // builtinTag case
1034
- : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
1035
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1335
+ var isConstructor = !construct || fails(function () {
1336
+ var called;
1337
+ return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {
1338
+ called = true;
1339
+ }) || called;
1340
+ }) ? isConstructorLegacy : isConstructorModern;
1341
+
1342
+ var createProperty = function (object, key, value) {
1343
+ var propertyKey = toPropertyKey(key);
1344
+ if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
1036
1345
  };
1037
1346
 
1038
1347
  var ITERATOR$3 = wellKnownSymbol('iterator');
1039
1348
 
1040
1349
  var getIteratorMethod = function (it) {
1041
- if (it != undefined) return it[ITERATOR$3] || it['@@iterator'] || iterators[classof(it)];
1350
+ if (it != undefined) return getMethod(it, ITERATOR$3) || getMethod(it, '@@iterator') || iterators[classof(it)];
1042
1351
  };
1043
1352
 
1044
- // https://tc39.github.io/ecma262/#sec-array.from
1353
+ var TypeError$9 = global_1.TypeError;
1354
+
1355
+ var getIterator = function (argument, usingIterator) {
1356
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1357
+ if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1358
+ throw TypeError$9(tryToString(argument) + ' is not iterable');
1359
+ };
1045
1360
 
1361
+ var Array$1 = global_1.Array; // `Array.from` method implementation
1362
+ // https://tc39.es/ecma262/#sec-array.from
1046
1363
 
1047
1364
  var arrayFrom = function from(arrayLike
1048
1365
  /* , mapfn = undefined, thisArg = undefined */
1049
1366
  ) {
1050
1367
  var O = toObject(arrayLike);
1051
- var C = typeof this == 'function' ? this : Array;
1368
+ var IS_CONSTRUCTOR = isConstructor(this);
1052
1369
  var argumentsLength = arguments.length;
1053
1370
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1054
1371
  var mapping = mapfn !== undefined;
1372
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1055
1373
  var iteratorMethod = getIteratorMethod(O);
1056
1374
  var index = 0;
1057
- var length, result, step, iterator, next, value;
1058
- if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case
1375
+ var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case
1059
1376
 
1060
- if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
1061
- iterator = iteratorMethod.call(O);
1377
+ if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
1378
+ iterator = getIterator(O, iteratorMethod);
1062
1379
  next = iterator.next;
1063
- result = new C();
1380
+ result = IS_CONSTRUCTOR ? new this() : [];
1064
1381
 
1065
- for (; !(step = next.call(iterator)).done; index++) {
1382
+ for (; !(step = functionCall(next, iterator)).done; index++) {
1066
1383
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1067
1384
  createProperty(result, index, value);
1068
1385
  }
1069
1386
  } else {
1070
- length = toLength(O.length);
1071
- result = new C(length);
1387
+ length = lengthOfArrayLike(O);
1388
+ result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
1072
1389
 
1073
1390
  for (; length > index; index++) {
1074
1391
  value = mapping ? mapfn(O[index], index) : O[index];
@@ -1098,7 +1415,7 @@ try {
1098
1415
 
1099
1416
  iteratorWithReturn[ITERATOR$4] = function () {
1100
1417
  return this;
1101
- }; // eslint-disable-next-line no-throw-literal
1418
+ }; // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
1102
1419
 
1103
1420
 
1104
1421
  Array.from(iteratorWithReturn, function () {
@@ -1134,9 +1451,10 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1134
1451
  };
1135
1452
 
1136
1453
  var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
1454
+ // eslint-disable-next-line es-x/no-array-from -- required for testing
1137
1455
  Array.from(iterable);
1138
1456
  }); // `Array.from` method
1139
- // https://tc39.github.io/ecma262/#sec-array.from
1457
+ // https://tc39.es/ecma262/#sec-array.from
1140
1458
 
1141
1459
  _export({
1142
1460
  target: 'Array',
@@ -1517,8 +1835,9 @@ var messagesDE = {
1517
1835
  "eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1518
1836
  "eligibility-modal.credit-cost": "Davon Kreditkosten",
1519
1837
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1520
- "eligibility-modal.no-eligibility": "Ups, die Simulation scheint nicht funktioniert zu haben.",
1521
- "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1838
+ "eligibility-modal.no-eligibility": "Ups, die Simulation hat anscheinend nicht funktioniert.",
1839
+ "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
1840
+ "eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1522
1841
  "eligibility-modal.total": "Insgesamt",
1523
1842
  "installments.today": "Heutzutage",
1524
1843
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1540,7 +1859,8 @@ var messagesEN = {
1540
1859
  "eligibility-modal.credit-cost": "Of which cost of credit",
1541
1860
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1542
1861
  "eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
1543
- "eligibility-modal.title": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
1862
+ "eligibility-modal.title": "<highlighted>Pay in installments</highlighted> by credit card with Alma.",
1863
+ "eligibility-modal.title-deferred": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
1544
1864
  "eligibility-modal.total": "Total",
1545
1865
  "installments.today": "Today",
1546
1866
  "payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
@@ -1562,7 +1882,8 @@ var messagesES = {
1562
1882
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
1563
1883
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
1564
1884
  "eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
1565
- "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1885
+ "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
1886
+ "eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1566
1887
  "eligibility-modal.total": "Total",
1567
1888
  "installments.today": "Hoy",
1568
1889
  "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
@@ -1583,8 +1904,9 @@ var messagesFR = {
1583
1904
  "eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
1584
1905
  "eligibility-modal.credit-cost": "Dont coût du crédit",
1585
1906
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1586
- "eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'aie pas fonctionné.",
1587
- "eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
1907
+ "eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
1908
+ "eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
1909
+ "eligibility-modal.title-deferred": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
1588
1910
  "eligibility-modal.total": "Total",
1589
1911
  "installments.today": "Aujourd'hui",
1590
1912
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1606,7 +1928,8 @@ var messagesIT = {
1606
1928
  "eligibility-modal.credit-cost": "Di cui commissioni",
1607
1929
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1608
1930
  "eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
1609
- "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1931
+ "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
1932
+ "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1610
1933
  "eligibility-modal.total": "Totale",
1611
1934
  "installments.today": "Oggi",
1612
1935
  "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
@@ -1628,7 +1951,8 @@ var messagesNL = {
1628
1951
  "eligibility-modal.credit-cost": "Waarvan kosten van krediet",
1629
1952
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1630
1953
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
1631
- "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1954
+ "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
1955
+ "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1632
1956
  "eligibility-modal.total": "Totaal",
1633
1957
  "installments.today": "Tegenwoordig",
1634
1958
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1731,16 +2055,34 @@ var fetchFromApi = function fetchFromApi(url, data, headers) {
1731
2055
  }
1732
2056
  };
1733
2057
 
2058
+ var isPlanEligible = function isPlanEligible(plan, configPlan) {
2059
+ if (!plan.eligible) {
2060
+ return false;
2061
+ }
2062
+
2063
+ return configPlan ? plan.purchase_amount >= (configPlan == null ? void 0 : configPlan.minAmount) && plan.purchase_amount <= (configPlan == null ? void 0 : configPlan.maxAmount) : false;
2064
+ };
2065
+
2066
+ var getPaymentPlanBoundaries = function getPaymentPlanBoundaries(plan, configPlan) {
2067
+ var _plan$constraints;
2068
+
2069
+ // When the plan is not eligible, the purchase amount constraints is given from the merchant config
2070
+ var purchaseAmountConstraints = (_plan$constraints = plan.constraints) == null ? void 0 : _plan$constraints.purchase_amount;
2071
+
2072
+ if (purchaseAmountConstraints && configPlan) {
2073
+ return {
2074
+ minAmount: Math.max(configPlan.minAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.minimum),
2075
+ maxAmount: Math.min(configPlan.maxAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.maximum)
2076
+ };
2077
+ }
2078
+
2079
+ return configPlan != null ? configPlan : {};
2080
+ };
2081
+
1734
2082
  var filterELigibility = function filterELigibility(eligibilities, configPlans) {
1735
2083
  // Remove p1x
1736
2084
  var filteredEligibilityPlans = eligibilities.filter(function (plan) {
1737
2085
  return !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0);
1738
- }) // Keeps the plans that have a payment_plan property
1739
- .filter(function (plan) {
1740
- return plan.payment_plan;
1741
- }) // Remove plans that have a reasons property
1742
- .filter(function (plan) {
1743
- return !plan.reasons;
1744
2086
  }); // If no configPlans was provided, return eligibility response
1745
2087
 
1746
2088
  if (!configPlans) {
@@ -1756,10 +2098,8 @@ var filterELigibility = function filterELigibility(eligibilities, configPlans) {
1756
2098
  return plan.installments_count === configPlan.installmentsCount && eligibilityDeferredDays === configPlanDeferredDays;
1757
2099
  });
1758
2100
  return _extends({}, plan, {
1759
- eligible: relatedConfigPlan ? plan.purchase_amount >= (relatedConfigPlan == null ? void 0 : relatedConfigPlan.minAmount) && plan.purchase_amount <= (relatedConfigPlan == null ? void 0 : relatedConfigPlan.maxAmount) : false,
1760
- minAmount: relatedConfigPlan == null ? void 0 : relatedConfigPlan.minAmount,
1761
- maxAmount: relatedConfigPlan == null ? void 0 : relatedConfigPlan.maxAmount
1762
- });
2101
+ eligible: isPlanEligible(plan, relatedConfigPlan)
2102
+ }, getPaymentPlanBoundaries(plan, relatedConfigPlan));
1763
2103
  });
1764
2104
  };
1765
2105
 
@@ -1833,6 +2173,31 @@ function CrossIcon(_ref) {
1833
2173
  }));
1834
2174
  }
1835
2175
 
2176
+ /**
2177
+ * Prefix classes to avoid name collisions.
2178
+ */
2179
+ var prefix = 'alma-eligibility-modal';
2180
+ /**
2181
+ * Class names for the **eligibility modale** widget.
2182
+ * Those classes are intended to be used by the **merchant developer**.
2183
+ */
2184
+
2185
+ var STATIC_CUSTOMISATION_CLASSES = {
2186
+ leftSide: prefix + '-left-side',
2187
+ rightSide: prefix + '-right-side',
2188
+ title: prefix + '-title',
2189
+ info: prefix + '-info',
2190
+ infoMessage: prefix + '-info-message',
2191
+ eligibilityOptions: prefix + '-eligibility-options',
2192
+ activeOption: prefix + '-active-option',
2193
+ closeButton: prefix + '-close-button',
2194
+ scheduleDetails: prefix + '-schedule-details',
2195
+ scheduleTotal: prefix + '-schedule-total',
2196
+ scheduleCredit: prefix + '-schedule-credit'
2197
+ };
2198
+
2199
+ var _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
2200
+
1836
2201
  var ControlledModal = function ControlledModal(_ref) {
1837
2202
  var _cx;
1838
2203
 
@@ -1843,7 +2208,7 @@ var ControlledModal = function ControlledModal(_ref) {
1843
2208
  contentClassName = _ref.contentClassName,
1844
2209
  _ref$scrollable = _ref.scrollable,
1845
2210
  scrollable = _ref$scrollable === void 0 ? false : _ref$scrollable,
1846
- props = _objectWithoutPropertiesLoose(_ref, ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"]);
2211
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
1847
2212
 
1848
2213
  Modal.setAppElement('body');
1849
2214
  return /*#__PURE__*/React.createElement(Modal, Object.assign({
@@ -1863,7 +2228,7 @@ var ControlledModal = function ControlledModal(_ref) {
1863
2228
  className: s$1.header
1864
2229
  }, /*#__PURE__*/React.createElement("button", {
1865
2230
  onClick: onClose,
1866
- className: s$1.closeButton,
2231
+ className: cx(s$1.closeButton, STATIC_CUSTOMISATION_CLASSES.closeButton),
1867
2232
  "data-testid": "modal-close-button"
1868
2233
  }, /*#__PURE__*/React.createElement(CrossIcon, null))), /*#__PURE__*/React.createElement("div", {
1869
2234
  className: cx(s$1.content, contentClassName, (_cx = {}, _cx[s$1.contentScrollable] = scrollable, _cx))
@@ -1888,6 +2253,20 @@ var paymentPlanShorthandName = function paymentPlanShorthandName(payment) {
1888
2253
  return installmentsCount + "x";
1889
2254
  }
1890
2255
  };
2256
+
2257
+ var withNoFee = function withNoFee(payment) {
2258
+ var _payment$payment_plan;
2259
+
2260
+ if ((_payment$payment_plan = payment.payment_plan) != null && _payment$payment_plan.every(function (plan) {
2261
+ return plan.customer_fee === 0 && plan.customer_interest === 0;
2262
+ })) {
2263
+ return /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(FormattedMessage, {
2264
+ id: "payment-plan-strings.no-fee",
2265
+ defaultMessage: '(sans frais)'
2266
+ }));
2267
+ }
2268
+ };
2269
+
1891
2270
  var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1892
2271
  var deferred_days = payment.deferred_days,
1893
2272
  deferred_months = payment.deferred_months,
@@ -1897,20 +2276,10 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1897
2276
  _payment$minAmount = payment.minAmount,
1898
2277
  minAmount = _payment$minAmount === void 0 ? 0 : _payment$minAmount,
1899
2278
  _payment$maxAmount = payment.maxAmount,
1900
- maxAmount = _payment$maxAmount === void 0 ? 0 : _payment$maxAmount;
2279
+ maxAmount = _payment$maxAmount === void 0 ? 0 : _payment$maxAmount,
2280
+ payment_plan = payment.payment_plan;
1901
2281
  var deferredDaysCount = deferred_days + deferred_months * 30;
1902
2282
 
1903
- var withNoFee = function withNoFee() {
1904
- if (payment.payment_plan.every(function (plan) {
1905
- return plan.customer_fee === 0 && plan.customer_interest === 0;
1906
- })) {
1907
- return /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(FormattedMessage, {
1908
- id: "payment-plan-strings.no-fee",
1909
- defaultMessage: '(sans frais)'
1910
- }));
1911
- }
1912
- };
1913
-
1914
2283
  if (!eligible) {
1915
2284
  return purchaseAmount > maxAmount ? /*#__PURE__*/React.createElement(FormattedMessage, {
1916
2285
  id: "payment-plan-strings.ineligible-greater-than-max",
@@ -1933,27 +2302,32 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1933
2302
  })
1934
2303
  }
1935
2304
  });
2305
+ } else if (!payment_plan) {
2306
+ /* This error should never happen. We added this condition to avoid a typescript warning on
2307
+ payment_plan possibly undefined. As far as we know, it only happens when the plan is not
2308
+ eligible, which is checked above. */
2309
+ throw Error("No payment plan provided for payment in " + installmentsCount + " installments. Please contact us if you see this error.");
1936
2310
  } else if (deferredDaysCount !== 0 && installmentsCount === 1) {
1937
2311
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
1938
2312
  id: "payment-plan-strings.deferred",
1939
2313
  defaultMessage: "{totalAmount} \xE0 payer le {dueDate}",
1940
2314
  values: {
1941
2315
  totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
1942
- value: priceFromCents(payment.payment_plan[0].total_amount),
2316
+ value: priceFromCents(payment_plan[0].total_amount),
1943
2317
  style: "currency",
1944
2318
  currency: "EUR"
1945
2319
  }),
1946
2320
  dueDate: /*#__PURE__*/React.createElement(FormattedDate, {
1947
- value: secondsToMilliseconds(payment.payment_plan[0].due_date),
2321
+ value: secondsToMilliseconds(payment_plan[0].due_date),
1948
2322
  day: "numeric",
1949
2323
  month: "long",
1950
2324
  year: "numeric"
1951
2325
  })
1952
2326
  }
1953
- }), withNoFee());
2327
+ }), withNoFee(payment));
1954
2328
  } else if (installmentsCount > 0) {
1955
- var areInstallmentsOfSameAmount = payment.payment_plan.every(function (installment, index) {
1956
- return index === 0 || installment.total_amount === payment.payment_plan[0].total_amount;
2329
+ var areInstallmentsOfSameAmount = payment_plan == null ? void 0 : payment_plan.every(function (installment, index) {
2330
+ return index === 0 || installment.total_amount === payment_plan[0].total_amount;
1957
2331
  });
1958
2332
 
1959
2333
  if (areInstallmentsOfSameAmount) {
@@ -1962,13 +2336,13 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1962
2336
  defaultMessage: "{installmentsCount} x {totalAmount}",
1963
2337
  values: {
1964
2338
  totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
1965
- value: priceFromCents(payment.payment_plan[0].total_amount),
2339
+ value: priceFromCents(payment_plan[0].total_amount),
1966
2340
  style: "currency",
1967
2341
  currency: "EUR"
1968
2342
  }),
1969
2343
  installmentsCount: installmentsCount
1970
2344
  }
1971
- }), withNoFee());
2345
+ }), withNoFee(payment));
1972
2346
  }
1973
2347
 
1974
2348
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -1976,18 +2350,18 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1976
2350
  defaultMessage: "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1977
2351
  values: {
1978
2352
  firstInstallmentAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
1979
- value: priceFromCents(payment.payment_plan[0].total_amount),
2353
+ value: priceFromCents(payment_plan[0].total_amount),
1980
2354
  style: "currency",
1981
2355
  currency: "EUR"
1982
2356
  }),
1983
2357
  numberOfRemainingInstallments: installmentsCount - 1,
1984
2358
  othersInstallmentAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
1985
- value: priceFromCents(payment.payment_plan[1].total_amount),
2359
+ value: priceFromCents(payment_plan[1].total_amount),
1986
2360
  style: "currency",
1987
2361
  currency: "EUR"
1988
2362
  })
1989
2363
  }
1990
- }), withNoFee());
2364
+ }), withNoFee(payment));
1991
2365
  }
1992
2366
 
1993
2367
  return /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2003,13 +2377,13 @@ var EligibilityPlansButtons = function EligibilityPlansButtons(_ref) {
2003
2377
  currentPlanIndex = _ref.currentPlanIndex,
2004
2378
  setCurrentPlanIndex = _ref.setCurrentPlanIndex;
2005
2379
  return /*#__PURE__*/React.createElement("div", {
2006
- className: s$2.buttons
2380
+ className: cx(s$2.buttons, STATIC_CUSTOMISATION_CLASSES.eligibilityOptions)
2007
2381
  }, eligibilityPlans.map(function (eligibilityPlan, index) {
2008
2382
  var _cx;
2009
2383
 
2010
2384
  return /*#__PURE__*/React.createElement("button", {
2011
2385
  key: index,
2012
- className: cx((_cx = {}, _cx[s$2.active] = index === currentPlanIndex, _cx)),
2386
+ className: cx((_cx = {}, _cx[cx(s$2.active, STATIC_CUSTOMISATION_CLASSES.activeOption)] = index === currentPlanIndex, _cx)),
2013
2387
  onClick: function onClick() {
2014
2388
  return setCurrentPlanIndex(index);
2015
2389
  }
@@ -2028,10 +2402,10 @@ var Schedule = function Schedule(_ref) {
2028
2402
  var isCredit = currentPlan && currentPlan.installments_count > 4;
2029
2403
  var intl = useIntl();
2030
2404
  return /*#__PURE__*/React.createElement("div", {
2031
- className: s$3.schedule,
2405
+ className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
2032
2406
  "data-testid": "modal-installments-element"
2033
2407
  }, /*#__PURE__*/React.createElement("div", {
2034
- className: cx(s$3.scheduleLine, s$3.total)
2408
+ className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
2035
2409
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2036
2410
  id: "eligibility-modal.total",
2037
2411
  defaultMessage: "Total"
@@ -2040,7 +2414,7 @@ var Schedule = function Schedule(_ref) {
2040
2414
  style: "currency",
2041
2415
  currency: "EUR"
2042
2416
  }))), /*#__PURE__*/React.createElement("div", {
2043
- className: cx(s$3.scheduleLine, s$3.creditCost)
2417
+ className: cx(s$3.scheduleLine, s$3.creditCost, STATIC_CUSTOMISATION_CLASSES.scheduleCredit)
2044
2418
  }, isCredit ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2045
2419
  id: "eligibility-modal.credit-cost",
2046
2420
  defaultMessage: "Dont co\xFBt du cr\xE9dit"
@@ -2093,13 +2467,15 @@ var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2093
2467
 
2094
2468
  var Info = function Info() {
2095
2469
  return /*#__PURE__*/React.createElement("div", {
2096
- className: s$4.list,
2470
+ className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
2097
2471
  "data-testid": "modal-info-element"
2098
2472
  }, /*#__PURE__*/React.createElement("div", {
2099
2473
  className: s$4.listItem
2100
2474
  }, /*#__PURE__*/React.createElement("div", {
2101
2475
  className: s$4.bullet
2102
- }, "1"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2476
+ }, "1"), /*#__PURE__*/React.createElement("div", {
2477
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2478
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
2103
2479
  id: "eligibility-modal.bullet-1",
2104
2480
  defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
2105
2481
  values: {
@@ -2111,7 +2487,9 @@ var Info = function Info() {
2111
2487
  className: s$4.listItem
2112
2488
  }, /*#__PURE__*/React.createElement("div", {
2113
2489
  className: s$4.bullet
2114
- }, "2"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2490
+ }, "2"), /*#__PURE__*/React.createElement("div", {
2491
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2492
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
2115
2493
  id: "eligibility-modal.bullet-2",
2116
2494
  defaultMessage: "Renseignez les <strong>informations</strong> demand\xE9es.",
2117
2495
  values: {
@@ -2123,7 +2501,9 @@ var Info = function Info() {
2123
2501
  className: s$4.listItem
2124
2502
  }, /*#__PURE__*/React.createElement("div", {
2125
2503
  className: s$4.bullet
2126
- }, "3"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2504
+ }, "3"), /*#__PURE__*/React.createElement("div", {
2505
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2506
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
2127
2507
  id: "eligibility-modal.bullet-3",
2128
2508
  defaultMessage: "La validation de votre paiement <strong>instantan\xE9e</strong> !",
2129
2509
  values: {
@@ -2179,32 +2559,44 @@ var Logo = function Logo() {
2179
2559
 
2180
2560
  var s$6 = {"title":"_3ERx-"};
2181
2561
 
2182
- var Title = function Title() {
2562
+ var Title = function Title(_ref) {
2563
+ var isSomePlanDeferred = _ref.isSomePlanDeferred;
2183
2564
  return /*#__PURE__*/React.createElement("div", {
2184
- className: s$6.title,
2565
+ className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
2185
2566
  "data-testid": "modal-title-element"
2186
- }, /*#__PURE__*/React.createElement(FormattedMessage, {
2187
- id: "eligibility-modal.title",
2567
+ }, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
2568
+ id: 'eligibility-modal.title-deferred',
2188
2569
  defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
2189
2570
  values: {
2190
2571
  highlighted: function highlighted() {
2191
2572
  return /*#__PURE__*/React.createElement("span", null, [].slice.call(arguments));
2192
2573
  }
2193
2574
  }
2575
+ }) : /*#__PURE__*/React.createElement(FormattedMessage, {
2576
+ id: 'eligibility-modal.title',
2577
+ defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
2578
+ values: {
2579
+ highlighted: function highlighted() {
2580
+ return /*#__PURE__*/React.createElement("span", null, [].slice.call(arguments));
2581
+ }
2582
+ }
2194
2583
  }));
2195
2584
  };
2196
2585
 
2197
2586
  var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2198
2587
 
2199
2588
  var DesktopModal = function DesktopModal(_ref) {
2200
- var children = _ref.children;
2589
+ var children = _ref.children,
2590
+ isSomePlanDeferred = _ref.isSomePlanDeferred;
2201
2591
  return /*#__PURE__*/React.createElement("div", {
2202
2592
  className: s$7.container,
2203
2593
  "data-testid": "modal-container"
2204
2594
  }, /*#__PURE__*/React.createElement("div", {
2205
- className: cx([s$7.block, s$7.left])
2206
- }, /*#__PURE__*/React.createElement(Title, null), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2207
- className: s$7.block
2595
+ className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2596
+ }, /*#__PURE__*/React.createElement(Title, {
2597
+ isSomePlanDeferred: isSomePlanDeferred
2598
+ }), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2599
+ className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2208
2600
  }, children));
2209
2601
  };
2210
2602
 
@@ -2213,11 +2605,14 @@ var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2213
2605
  var s$9 = {"container":"_2G7Ch"};
2214
2606
 
2215
2607
  var MobileModal = function MobileModal(_ref) {
2216
- var children = _ref.children;
2608
+ var children = _ref.children,
2609
+ isSomePlanDeferred = _ref.isSomePlanDeferred;
2217
2610
  return /*#__PURE__*/React.createElement("div", {
2218
2611
  className: s$9.container,
2219
2612
  "data-testid": "modal-container"
2220
- }, /*#__PURE__*/React.createElement(Title, null), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
2613
+ }, /*#__PURE__*/React.createElement(Title, {
2614
+ isSomePlanDeferred: isSomePlanDeferred
2615
+ }), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
2221
2616
  };
2222
2617
 
2223
2618
  var EligibilityModal = function EligibilityModal(_ref) {
@@ -2238,25 +2633,23 @@ var EligibilityModal = function EligibilityModal(_ref) {
2238
2633
  return plan.eligible;
2239
2634
  });
2240
2635
  var currentPlan = eligiblePlans[currentPlanIndex];
2241
- var modalProps = {
2242
- eligibilityPlans: eligiblePlans,
2243
- currentPlanIndex: currentPlanIndex,
2244
- setCurrentPlanIndex: setCurrentPlanIndex,
2245
- currentPlan: currentPlan,
2246
- status: status
2247
- };
2636
+ var isSomePlanDeferred = eligibilityPlans.some(function (plan) {
2637
+ return plan.deferred_days > 0 || plan.deferred_months > 0;
2638
+ });
2248
2639
  return /*#__PURE__*/React.createElement(ControlledModal, {
2249
2640
  onClose: onClose,
2250
2641
  ariaHideApp: false,
2251
2642
  scrollable: true,
2252
2643
  isOpen: true
2253
- }, /*#__PURE__*/React.createElement(ModalComponent, Object.assign({}, modalProps), status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
2644
+ }, /*#__PURE__*/React.createElement(ModalComponent, {
2645
+ isSomePlanDeferred: isSomePlanDeferred
2646
+ }, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
2254
2647
  className: s$8.loader
2255
2648
  }, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
2256
2649
  className: s$8.noEligibility
2257
2650
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2258
2651
  id: "eligibility-modal.no-eligibility",
2259
- defaultMessage: "Oups, il semblerait que la simulation n'aie pas fonctionn\xE9."
2652
+ defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\xE9."
2260
2653
  })), status === apiStatus.SUCCESS && eligiblePlans.length >= 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EligibilityPlansButtons, {
2261
2654
  eligibilityPlans: eligiblePlans,
2262
2655
  currentPlanIndex: currentPlanIndex,
@@ -2373,6 +2766,24 @@ var getIndexOfActivePlan = function getIndexOfActivePlan(_ref) {
2373
2766
  return 0;
2374
2767
  };
2375
2768
 
2769
+ /**
2770
+ * Prefix classes to avoid name collisions.
2771
+ */
2772
+ var prefix$1 = 'alma-payment-plans';
2773
+ /**
2774
+ * Class names for the **payment plans** widget.
2775
+ * Those classes are intended to be used by the **merchant developer**.
2776
+ */
2777
+
2778
+ var STATIC_CUSTOMISATION_CLASSES$1 = {
2779
+ container: prefix$1 + '-container',
2780
+ eligibilityLine: prefix$1 + '-eligibility-line',
2781
+ eligibilityOptions: prefix$1 + '-eligibility-options',
2782
+ notEligibleOption: prefix$1 + '-not-eligible-option',
2783
+ paymentInfo: prefix$1 + '-payment-info',
2784
+ activeOption: prefix$1 + '-active-option'
2785
+ };
2786
+
2376
2787
  var s$b = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
2377
2788
 
2378
2789
  var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
@@ -2399,7 +2810,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2399
2810
  eligibilityPlans: eligibilityPlans,
2400
2811
  suggestedPaymentPlan: suggestedPaymentPlan != null ? suggestedPaymentPlan : 0
2401
2812
  });
2402
- var isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab and remove animated transition.
2813
+ var isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab
2403
2814
 
2404
2815
  var isTransitionSpecified = transitionDelay !== undefined; // 👈 The merchant has specified a transition time
2405
2816
 
@@ -2484,14 +2895,14 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2484
2895
 
2485
2896
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2486
2897
  onClick: handleOpenModal,
2487
- className: cx(s$b.widgetButton, (_cx = {}, _cx[s$b.clickable] = eligiblePlans.length > 0, _cx[s$b.unClickable] = eligiblePlans.length === 0, _cx)),
2898
+ className: cx(s$b.widgetButton, (_cx = {}, _cx[s$b.clickable] = eligiblePlans.length > 0, _cx[s$b.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
2488
2899
  "data-testid": "widget-button"
2489
2900
  }, /*#__PURE__*/React.createElement("div", {
2490
- className: s$b.primaryContainer
2901
+ className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2491
2902
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2492
2903
  className: s$b.logo
2493
2904
  }), /*#__PURE__*/React.createElement("div", {
2494
- className: s$b.paymentPlans
2905
+ className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2495
2906
  }, eligibilityPlans.map(function (eligibilityPlan, key) {
2496
2907
  var _cx2;
2497
2908
 
@@ -2501,10 +2912,10 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2501
2912
  return onHover(key);
2502
2913
  },
2503
2914
  onMouseOut: onLeave,
2504
- className: cx(s$b.plan, (_cx2 = {}, _cx2[s$b.active] = current === key, _cx2[s$b.notEligible] = !eligibilityPlan.eligible, _cx2))
2915
+ className: cx(s$b.plan, (_cx2 = {}, _cx2[cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
2505
2916
  }, paymentPlanShorthandName(eligibilityPlan));
2506
2917
  }))), /*#__PURE__*/React.createElement("div", {
2507
- className: cx(s$b.info, (_cx3 = {}, _cx3[s$b.notEligible] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3))
2918
+ className: cx(s$b.info, (_cx3 = {}, _cx3[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
2508
2919
  }, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
2509
2920
  initialPlanIndex: getIndexWithinEligiblePlans(current),
2510
2921
  onClose: closeModal,