@alma/widgets 2.7.0 → 2.8.3

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.
@@ -38,13 +38,21 @@ var functionUncurryThis = functionBindNative ? function (fn) {
38
38
  };
39
39
 
40
40
  var ceil = Math.ceil;
41
- var floor = Math.floor; // `ToIntegerOrInfinity` abstract operation
41
+ var floor = Math.floor; // `Math.trunc` method
42
+ // https://tc39.es/ecma262/#sec-math.trunc
43
+ // eslint-disable-next-line es-x/no-math-trunc -- safe
44
+
45
+ var mathTrunc = Math.trunc || function trunc(x) {
46
+ var n = +x;
47
+ return (n > 0 ? floor : ceil)(n);
48
+ };
49
+
42
50
  // https://tc39.es/ecma262/#sec-tointegerorinfinity
43
51
 
44
52
  var toIntegerOrInfinity = function (argument) {
45
- var number = +argument; // eslint-disable-next-line no-self-compare -- safe
53
+ var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check
46
54
 
47
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
55
+ return number !== number || number === 0 ? 0 : mathTrunc(number);
48
56
  };
49
57
 
50
58
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -77,7 +85,7 @@ function () {
77
85
 
78
86
  var defineProperty = Object.defineProperty;
79
87
 
80
- var setGlobal = function (key, value) {
88
+ var defineGlobalProperty = function (key, value) {
81
89
  try {
82
90
  defineProperty(global_1, key, {
83
91
  value: value,
@@ -92,34 +100,34 @@ var setGlobal = function (key, value) {
92
100
  };
93
101
 
94
102
  var SHARED = '__core-js_shared__';
95
- var store = global_1[SHARED] || setGlobal(SHARED, {});
103
+ var store = global_1[SHARED] || defineGlobalProperty(SHARED, {});
96
104
  var sharedStore = store;
97
105
 
98
106
  var shared = createCommonjsModule(function (module) {
99
107
  (module.exports = function (key, value) {
100
108
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
101
109
  })('versions', []).push({
102
- version: '3.22.1',
110
+ version: '3.22.8',
103
111
  mode: 'global',
104
112
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
105
- license: 'https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE',
113
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE',
106
114
  source: 'https://github.com/zloirock/core-js'
107
115
  });
108
116
  });
109
117
 
110
- var TypeError$1 = global_1.TypeError; // `RequireObjectCoercible` abstract operation
118
+ var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation
111
119
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
112
120
 
113
121
  var requireObjectCoercible = function (it) {
114
- if (it == undefined) throw TypeError$1("Can't call method on " + it);
122
+ if (it == undefined) throw $TypeError("Can't call method on " + it);
115
123
  return it;
116
124
  };
117
125
 
118
- var Object$1 = global_1.Object; // `ToObject` abstract operation
126
+ var $Object = Object; // `ToObject` abstract operation
119
127
  // https://tc39.es/ecma262/#sec-toobject
120
128
 
121
129
  var toObject = function (argument) {
122
- return Object$1(requireObjectCoercible(argument));
130
+ return $Object(requireObjectCoercible(argument));
123
131
  };
124
132
 
125
133
  var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
@@ -229,7 +237,7 @@ var classofRaw = function (it) {
229
237
  };
230
238
 
231
239
  var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
232
- var Object$2 = global_1.Object; // ES3 wrong here
240
+ var $Object$1 = Object; // ES3 wrong here
233
241
 
234
242
  var CORRECT_ARGUMENTS = classofRaw(function () {
235
243
  return arguments;
@@ -247,16 +255,16 @@ var tryGet = function (it, key) {
247
255
  var classof = toStringTagSupport ? classofRaw : function (it) {
248
256
  var O, tag, result;
249
257
  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
258
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag // builtinTag case
251
259
  : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
252
260
  : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
253
261
  };
254
262
 
255
- var String$1 = global_1.String;
263
+ var $String = String;
256
264
 
257
265
  var toString_1 = function (argument) {
258
266
  if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
259
- return String$1(argument);
267
+ return $String(argument);
260
268
  };
261
269
 
262
270
  var charAt = functionUncurryThis(''.charAt);
@@ -339,12 +347,12 @@ var v8PrototypeDefineBug = descriptors && fails(function () {
339
347
  }).prototype != 42;
340
348
  });
341
349
 
342
- var String$2 = global_1.String;
343
- var TypeError$2 = global_1.TypeError; // `Assert: Type(argument) is Object`
350
+ var $String$1 = String;
351
+ var $TypeError$1 = TypeError; // `Assert: Type(argument) is Object`
344
352
 
345
353
  var anObject = function (argument) {
346
354
  if (isObject(argument)) return argument;
347
- throw TypeError$2(String$2(argument) + ' is not an object');
355
+ throw $TypeError$1($String$1(argument) + ' is not an object');
348
356
  };
349
357
 
350
358
  var call$1 = Function.prototype.call;
@@ -354,29 +362,29 @@ var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
354
362
 
355
363
  var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
356
364
 
357
- var Object$3 = global_1.Object;
365
+ var $Object$2 = Object;
358
366
  var isSymbol = useSymbolAsUid ? function (it) {
359
367
  return typeof it == 'symbol';
360
368
  } : function (it) {
361
369
  var $Symbol = getBuiltIn('Symbol');
362
- return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
370
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$2(it));
363
371
  };
364
372
 
365
- var String$3 = global_1.String;
373
+ var $String$2 = String;
366
374
 
367
375
  var tryToString = function (argument) {
368
376
  try {
369
- return String$3(argument);
377
+ return $String$2(argument);
370
378
  } catch (error) {
371
379
  return 'Object';
372
380
  }
373
381
  };
374
382
 
375
- var TypeError$3 = global_1.TypeError; // `Assert: IsCallable(argument) is true`
383
+ var $TypeError$2 = TypeError; // `Assert: IsCallable(argument) is true`
376
384
 
377
385
  var aCallable = function (argument) {
378
386
  if (isCallable(argument)) return argument;
379
- throw TypeError$3(tryToString(argument) + ' is not a function');
387
+ throw $TypeError$2(tryToString(argument) + ' is not a function');
380
388
  };
381
389
 
382
390
  // https://tc39.es/ecma262/#sec-getmethod
@@ -386,7 +394,7 @@ var getMethod = function (V, P) {
386
394
  return func == null ? undefined : aCallable(func);
387
395
  };
388
396
 
389
- var TypeError$4 = global_1.TypeError; // `OrdinaryToPrimitive` abstract operation
397
+ var $TypeError$3 = TypeError; // `OrdinaryToPrimitive` abstract operation
390
398
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
391
399
 
392
400
  var ordinaryToPrimitive = function (input, pref) {
@@ -394,10 +402,10 @@ var ordinaryToPrimitive = function (input, pref) {
394
402
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
395
403
  if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
396
404
  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");
405
+ throw $TypeError$3("Can't convert object to primitive value");
398
406
  };
399
407
 
400
- var TypeError$5 = global_1.TypeError;
408
+ var $TypeError$4 = TypeError;
401
409
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation
402
410
  // https://tc39.es/ecma262/#sec-toprimitive
403
411
 
@@ -410,7 +418,7 @@ var toPrimitive = function (input, pref) {
410
418
  if (pref === undefined) pref = 'default';
411
419
  result = functionCall(exoticToPrim, input, pref);
412
420
  if (!isObject(result) || isSymbol(result)) return result;
413
- throw TypeError$5("Can't convert object to primitive value");
421
+ throw $TypeError$4("Can't convert object to primitive value");
414
422
  }
415
423
 
416
424
  if (pref === undefined) pref = 'number';
@@ -424,7 +432,7 @@ var toPropertyKey = function (argument) {
424
432
  return isSymbol(key) ? key : key + '';
425
433
  };
426
434
 
427
- var TypeError$6 = global_1.TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
435
+ var $TypeError$5 = TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
428
436
 
429
437
  var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
430
438
 
@@ -462,7 +470,7 @@ var f = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attri
462
470
  } catch (error) {
463
471
  /* empty */
464
472
  }
465
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
473
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$5('Accessors not supported');
466
474
  if ('value' in Attributes) O[P] = Attributes.value;
467
475
  return O;
468
476
  };
@@ -495,7 +503,7 @@ var sharedKey = function (key) {
495
503
  var hiddenKeys = {};
496
504
 
497
505
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
498
- var TypeError$7 = global_1.TypeError;
506
+ var TypeError$1 = global_1.TypeError;
499
507
  var WeakMap$1 = global_1.WeakMap;
500
508
  var set, get, has;
501
509
 
@@ -508,7 +516,7 @@ var getterFor = function (TYPE) {
508
516
  var state;
509
517
 
510
518
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
511
- throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
519
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
512
520
  }
513
521
 
514
522
  return state;
@@ -522,7 +530,7 @@ if (nativeWeakMap || sharedStore.state) {
522
530
  var wmset = functionUncurryThis(store$1.set);
523
531
 
524
532
  set = function (it, metadata) {
525
- if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
533
+ if (wmhas(store$1, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
526
534
  metadata.facade = it;
527
535
  wmset(store$1, it, metadata);
528
536
  return metadata;
@@ -540,7 +548,7 @@ if (nativeWeakMap || sharedStore.state) {
540
548
  hiddenKeys[STATE] = true;
541
549
 
542
550
  set = function (it, metadata) {
543
- if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
551
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
544
552
  metadata.facade = it;
545
553
  createNonEnumerableProperty(it, STATE, metadata);
546
554
  return metadata;
@@ -580,16 +588,16 @@ var objectPropertyIsEnumerable = {
580
588
  f: f$1
581
589
  };
582
590
 
583
- var Object$4 = global_1.Object;
591
+ var $Object$3 = Object;
584
592
  var split = functionUncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
585
593
 
586
594
  var indexedObject = fails(function () {
587
595
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
588
596
  // eslint-disable-next-line no-prototype-builtins -- safe
589
- return !Object$4('z').propertyIsEnumerable(0);
597
+ return !$Object$3('z').propertyIsEnumerable(0);
590
598
  }) ? function (it) {
591
- return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
592
- } : Object$4;
599
+ return classofRaw(it) == 'String' ? split(it, '') : $Object$3(it);
600
+ } : $Object$3;
593
601
 
594
602
  var toIndexedObject = function (it) {
595
603
  return indexedObject(requireObjectCoercible(it));
@@ -628,49 +636,84 @@ var functionName = {
628
636
  CONFIGURABLE: CONFIGURABLE$1
629
637
  };
630
638
 
631
- var redefine = createCommonjsModule(function (module) {
639
+ var makeBuiltIn_1 = createCommonjsModule(function (module) {
632
640
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
633
- var getInternalState = internalState.get;
634
641
  var enforceInternalState = internalState.enforce;
642
+ var getInternalState = internalState.get; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
643
+
644
+ var defineProperty = Object.defineProperty;
645
+ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
646
+ return defineProperty(function () {
647
+ /* empty */
648
+ }, 'length', {
649
+ value: 8
650
+ }).length !== 8;
651
+ });
635
652
  var TEMPLATE = String(String).split('String');
636
- (module.exports = function (O, key, value, options) {
637
- var unsafe = options ? !!options.unsafe : false;
638
- var simple = options ? !!options.enumerable : false;
639
- var noTargetGet = options ? !!options.noTargetGet : false;
640
- var name = options && options.name !== undefined ? options.name : key;
641
- var state;
642
653
 
643
- if (isCallable(value)) {
644
- if (String(name).slice(0, 7) === 'Symbol(') {
645
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
646
- }
654
+ var makeBuiltIn = module.exports = function (value, name, options) {
655
+ if (String(name).slice(0, 7) === 'Symbol(') {
656
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
657
+ }
647
658
 
648
- if (!hasOwnProperty_1(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
649
- createNonEnumerableProperty(value, 'name', name);
650
- }
659
+ if (options && options.getter) name = 'get ' + name;
660
+ if (options && options.setter) name = 'set ' + name;
651
661
 
652
- state = enforceInternalState(value);
662
+ if (!hasOwnProperty_1(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
663
+ defineProperty(value, 'name', {
664
+ value: name,
665
+ configurable: true
666
+ });
667
+ }
653
668
 
654
- if (!state.source) {
655
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
656
- }
669
+ if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
670
+ defineProperty(value, 'length', {
671
+ value: options.arity
672
+ });
673
+ }
674
+
675
+ try {
676
+ if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
677
+ if (descriptors) defineProperty(value, 'prototype', {
678
+ writable: false
679
+ }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
680
+ } else if (value.prototype) value.prototype = undefined;
681
+ } catch (error) {
682
+ /* empty */
657
683
  }
658
684
 
659
- if (O === global_1) {
660
- if (simple) O[key] = value;else setGlobal(key, value);
661
- return;
662
- } else if (!unsafe) {
663
- delete O[key];
664
- } else if (!noTargetGet && O[key]) {
665
- simple = true;
685
+ var state = enforceInternalState(value);
686
+
687
+ if (!hasOwnProperty_1(state, 'source')) {
688
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
666
689
  }
667
690
 
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
669
- })(Function.prototype, 'toString', function toString() {
691
+ return value;
692
+ }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
693
+ // eslint-disable-next-line no-extend-native -- required
694
+
695
+
696
+ Function.prototype.toString = makeBuiltIn(function toString() {
670
697
  return isCallable(this) && getInternalState(this).source || inspectSource(this);
671
- });
698
+ }, 'toString');
672
699
  });
673
700
 
701
+ var defineBuiltIn = function (O, key, value, options) {
702
+ if (!options) options = {};
703
+ var simple = options.enumerable;
704
+ var name = options.name !== undefined ? options.name : key;
705
+ if (isCallable(value)) makeBuiltIn_1(value, name, options);
706
+
707
+ if (options.global) {
708
+ if (simple) O[key] = value;else defineGlobalProperty(key, value);
709
+ } else {
710
+ if (!options.unsafe) delete O[key];else if (O[key]) simple = true;
711
+ if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value);
712
+ }
713
+
714
+ return O;
715
+ };
716
+
674
717
  var max = Math.max;
675
718
  var min = Math.min; // Helper for a popular repeating case of the spec:
676
719
  // Let integer be ? ToInteger(index).
@@ -802,19 +845,19 @@ var isForced_1 = isForced;
802
845
 
803
846
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
804
847
  /*
805
- options.target - name of the target object
806
- options.global - target is the global object
807
- options.stat - export as static methods of target
808
- options.proto - export as prototype methods of target
809
- options.real - real prototype method for the `pure` version
810
- options.forced - export even if the native feature is available
811
- options.bind - bind methods to the target, required for the `pure` version
812
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
813
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
814
- options.sham - add a flag to not completely full polyfills
815
- options.enumerable - export as enumerable property
816
- options.noTargetGet - prevent calling a getter on target
817
- options.name - the .name of the function if it does not match the key
848
+ options.target - name of the target object
849
+ options.global - target is the global object
850
+ options.stat - export as static methods of target
851
+ options.proto - export as prototype methods of target
852
+ options.real - real prototype method for the `pure` version
853
+ options.forced - export even if the native feature is available
854
+ options.bind - bind methods to the target, required for the `pure` version
855
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
856
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
857
+ options.sham - add a flag to not completely full polyfills
858
+ options.enumerable - export as enumerable property
859
+ options.dontCallGetSet - prevent calling a getter on target
860
+ options.name - the .name of the function if it does not match the key
818
861
  */
819
862
 
820
863
  var _export = function (options, source) {
@@ -826,7 +869,7 @@ var _export = function (options, source) {
826
869
  if (GLOBAL) {
827
870
  target = global_1;
828
871
  } else if (STATIC) {
829
- target = global_1[TARGET] || setGlobal(TARGET, {});
872
+ target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
830
873
  } else {
831
874
  target = (global_1[TARGET] || {}).prototype;
832
875
  }
@@ -834,7 +877,7 @@ var _export = function (options, source) {
834
877
  if (target) for (key in source) {
835
878
  sourceProperty = source[key];
836
879
 
837
- if (options.noTargetGet) {
880
+ if (options.dontCallGetSet) {
838
881
  descriptor = getOwnPropertyDescriptor$1(target, key);
839
882
  targetProperty = descriptor && descriptor.value;
840
883
  } else targetProperty = target[key];
@@ -849,10 +892,9 @@ var _export = function (options, source) {
849
892
 
850
893
  if (options.sham || targetProperty && targetProperty.sham) {
851
894
  createNonEnumerableProperty(sourceProperty, 'sham', true);
852
- } // extend global
853
-
895
+ }
854
896
 
855
- redefine(target, key, sourceProperty, options);
897
+ defineBuiltIn(target, key, sourceProperty, options);
856
898
  }
857
899
  };
858
900
 
@@ -980,11 +1022,12 @@ var correctPrototypeGetter = !fails(function () {
980
1022
  });
981
1023
 
982
1024
  var IE_PROTO$1 = sharedKey('IE_PROTO');
983
- var Object$5 = global_1.Object;
984
- var ObjectPrototype = Object$5.prototype; // `Object.getPrototypeOf` method
1025
+ var $Object$4 = Object;
1026
+ var ObjectPrototype = $Object$4.prototype; // `Object.getPrototypeOf` method
985
1027
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1028
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- safe
986
1029
 
987
- var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
1030
+ var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
988
1031
  var object = toObject(O);
989
1032
  if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
990
1033
  var constructor = object.constructor;
@@ -993,7 +1036,7 @@ var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : fu
993
1036
  return constructor.prototype;
994
1037
  }
995
1038
 
996
- return object instanceof Object$5 ? ObjectPrototype : null;
1039
+ return object instanceof $Object$4 ? ObjectPrototype : null;
997
1040
  };
998
1041
 
999
1042
  var ITERATOR = wellKnownSymbol('iterator');
@@ -1021,7 +1064,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; // `%IteratorPrototype%[@@it
1021
1064
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1022
1065
 
1023
1066
  if (!isCallable(IteratorPrototype[ITERATOR])) {
1024
- redefine(IteratorPrototype, ITERATOR, function () {
1067
+ defineBuiltIn(IteratorPrototype, ITERATOR, function () {
1025
1068
  return this;
1026
1069
  });
1027
1070
  }
@@ -1063,12 +1106,12 @@ var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUME
1063
1106
  return IteratorConstructor;
1064
1107
  };
1065
1108
 
1066
- var String$4 = global_1.String;
1067
- var TypeError$8 = global_1.TypeError;
1109
+ var $String$3 = String;
1110
+ var $TypeError$6 = TypeError;
1068
1111
 
1069
1112
  var aPossiblePrototype = function (argument) {
1070
1113
  if (typeof argument == 'object' || isCallable(argument)) return argument;
1071
- throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
1114
+ throw $TypeError$6("Can't set " + $String$3(argument) + ' as a prototype');
1072
1115
  };
1073
1116
 
1074
1117
  /* eslint-disable no-proto -- safe */
@@ -1157,7 +1200,7 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1157
1200
  if (objectSetPrototypeOf) {
1158
1201
  objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
1159
1202
  } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1160
- redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1203
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1161
1204
  }
1162
1205
  } // Set @@toStringTag to native iterators
1163
1206
 
@@ -1188,7 +1231,7 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1188
1231
  };
1189
1232
  if (FORCED) for (KEY in methods) {
1190
1233
  if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1191
- redefine(IterablePrototype, KEY, methods[KEY]);
1234
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1192
1235
  }
1193
1236
  } else _export({
1194
1237
  target: NAME,
@@ -1199,7 +1242,7 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1199
1242
 
1200
1243
 
1201
1244
  if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1202
- redefine(IterablePrototype, ITERATOR$1, defaultIterator, {
1245
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, {
1203
1246
  name: DEFAULT
1204
1247
  });
1205
1248
  }
@@ -1350,15 +1393,15 @@ var getIteratorMethod = function (it) {
1350
1393
  if (it != undefined) return getMethod(it, ITERATOR$3) || getMethod(it, '@@iterator') || iterators[classof(it)];
1351
1394
  };
1352
1395
 
1353
- var TypeError$9 = global_1.TypeError;
1396
+ var $TypeError$7 = TypeError;
1354
1397
 
1355
1398
  var getIterator = function (argument, usingIterator) {
1356
1399
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1357
1400
  if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1358
- throw TypeError$9(tryToString(argument) + ' is not iterable');
1401
+ throw $TypeError$7(tryToString(argument) + ' is not iterable');
1359
1402
  };
1360
1403
 
1361
- var Array$1 = global_1.Array; // `Array.from` method implementation
1404
+ var $Array = Array; // `Array.from` method implementation
1362
1405
  // https://tc39.es/ecma262/#sec-array.from
1363
1406
 
1364
1407
  var arrayFrom = function from(arrayLike
@@ -1374,7 +1417,7 @@ var arrayFrom = function from(arrayLike
1374
1417
  var index = 0;
1375
1418
  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
1376
1419
 
1377
- if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
1420
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
1378
1421
  iterator = getIterator(O, iteratorMethod);
1379
1422
  next = iterator.next;
1380
1423
  result = IS_CONSTRUCTOR ? new this() : [];
@@ -1385,7 +1428,7 @@ var arrayFrom = function from(arrayLike
1385
1428
  }
1386
1429
  } else {
1387
1430
  length = lengthOfArrayLike(O);
1388
- result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
1431
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
1389
1432
 
1390
1433
  for (; length > index; index++) {
1391
1434
  value = mapping ? mapfn(O[index], index) : O[index];
@@ -1819,8 +1862,8 @@ var messagesDE = {
1819
1862
  "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
1820
1863
  "eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1821
1864
  "eligibility-modal.total": "Insgesamt",
1822
- "installments.today": "Heutzutage",
1823
- "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
1865
+ "installments.today": "Heute",
1866
+ "payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
1824
1867
  "payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
1825
1868
  "payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
1826
1869
  "payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
@@ -1862,7 +1905,7 @@ var messagesES = {
1862
1905
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
1863
1906
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
1864
1907
  "eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
1865
- "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
1908
+ "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tu tarjeta, a través de Alma.",
1866
1909
  "eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1867
1910
  "eligibility-modal.total": "Total",
1868
1911
  "installments.today": "Hoy",
@@ -1908,8 +1951,8 @@ var messagesIT = {
1908
1951
  "eligibility-modal.credit-cost": "Di cui commissioni",
1909
1952
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1910
1953
  "eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
1911
- "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
1912
- "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1954
+ "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con Alma, senza interessi.",
1955
+ "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> o posticipa il pagamento con Alma, senza interessi.",
1913
1956
  "eligibility-modal.total": "Totale",
1914
1957
  "installments.today": "Oggi",
1915
1958
  "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
@@ -1950,9 +1993,6 @@ const getTranslationsByLocale = locale => {
1950
1993
  case Locale.fr:
1951
1994
  return messagesFR;
1952
1995
 
1953
- case Locale.en:
1954
- return messagesEN;
1955
-
1956
1996
  case Locale.es:
1957
1997
  return messagesES;
1958
1998
 
@@ -1967,6 +2007,7 @@ const getTranslationsByLocale = locale => {
1967
2007
  case Locale['nl-NL']:
1968
2008
  return messagesNL;
1969
2009
 
2010
+ case Locale.en:
1970
2011
  default:
1971
2012
  return messagesEN;
1972
2013
  }
@@ -1982,7 +2023,7 @@ const Provider = ({
1982
2023
  }, children);
1983
2024
 
1984
2025
  function _extends() {
1985
- _extends = Object.assign || function (target) {
2026
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
1986
2027
  for (var i = 1; i < arguments.length; i++) {
1987
2028
  var source = arguments[i];
1988
2029
 
@@ -1995,7 +2036,6 @@ function _extends() {
1995
2036
 
1996
2037
  return target;
1997
2038
  };
1998
-
1999
2039
  return _extends.apply(this, arguments);
2000
2040
  }
2001
2041
 
@@ -2172,6 +2212,7 @@ const ControlledModal = _ref => {
2172
2212
  } = _ref,
2173
2213
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
2174
2214
 
2215
+ /* istanbul ignore next */
2175
2216
  Modal.setAppElement('body');
2176
2217
  return /*#__PURE__*/React.createElement(Modal, Object.assign({
2177
2218
  className: cx(s$1.modal, className),
@@ -2574,9 +2615,12 @@ var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
2574
2615
  const Cards = ({
2575
2616
  cards
2576
2617
  }) => {
2618
+ // We transform to a Set and back to avoid duplicate values (ex : amex, amex)
2619
+ const uniqueCards = Array.from(new Set(cards));
2577
2620
  return /*#__PURE__*/React.createElement("div", {
2621
+ "data-testid": "card-logos",
2578
2622
  className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
2579
- }, cards.map(card => /*#__PURE__*/React.createElement("div", {
2623
+ }, uniqueCards.map(card => /*#__PURE__*/React.createElement("div", {
2580
2624
  key: card,
2581
2625
  className: s$4.card,
2582
2626
  "data-testid": `card-logo-${card}`
@@ -2626,11 +2670,20 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2626
2670
  }
2627
2671
  }))));
2628
2672
 
2673
+ var COLORS;
2674
+
2675
+ (function (COLORS) {
2676
+ COLORS["ALMA"] = "#FF414D";
2677
+ COLORS["MONOCHROME"] = "#00425D";
2678
+ })(COLORS || (COLORS = {}));
2679
+
2629
2680
  function LogoIcon({
2630
- color = '#00425D',
2631
- underlineColor = '#00425D',
2632
- className
2681
+ className,
2682
+ color = COLORS.MONOCHROME,
2683
+ monochrome = true,
2684
+ underlineColor
2633
2685
  }) {
2686
+ const defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
2634
2687
  return /*#__PURE__*/React.createElement("svg", {
2635
2688
  className: className,
2636
2689
  width: "35",
@@ -2654,7 +2707,7 @@ function LogoIcon({
2654
2707
  y: "20",
2655
2708
  width: "40",
2656
2709
  height: "3",
2657
- fill: underlineColor
2710
+ fill: underlineColor || defaultUnderlineColor
2658
2711
  }));
2659
2712
  }
2660
2713
 
@@ -2874,19 +2927,20 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
2874
2927
  activeOption: prefix$1 + '-active-option'
2875
2928
  };
2876
2929
 
2877
- var s$c = {"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"};
2930
+ var s$c = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","polychrome":"_2icEF","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
2878
2931
 
2879
2932
  const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2880
2933
  const DEFAULT_TRANSITION_TIME = 5500;
2881
2934
 
2882
2935
  const PaymentPlanWidget = ({
2883
- purchaseAmount,
2884
2936
  apiData,
2885
2937
  configPlans,
2886
- transitionDelay,
2887
2938
  hideIfNotEligible,
2939
+ monochrome,
2940
+ purchaseAmount,
2888
2941
  suggestedPaymentPlan,
2889
- cards
2942
+ cards,
2943
+ transitionDelay
2890
2944
  }) => {
2891
2945
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2892
2946
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
@@ -2977,16 +3031,19 @@ const PaymentPlanWidget = ({
2977
3031
  }, /*#__PURE__*/React.createElement("div", {
2978
3032
  className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2979
3033
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2980
- className: s$c.logo
3034
+ className: s$c.logo,
3035
+ monochrome: monochrome
2981
3036
  }), /*#__PURE__*/React.createElement("div", {
2982
3037
  className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2983
3038
  }, eligibilityPlans.map((eligibilityPlan, key) => {
3039
+ const isCurrent = key === current;
2984
3040
  return /*#__PURE__*/React.createElement("div", {
2985
3041
  key: key,
2986
3042
  onMouseEnter: () => onHover(key),
2987
3043
  onMouseOut: onLeave,
2988
3044
  className: cx(s$c.plan, {
2989
- [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
3045
+ [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: isCurrent,
3046
+ [s$c.polychrome]: !monochrome && isCurrent,
2990
3047
  [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
2991
3048
  })
2992
3049
  }, paymentPlanShorthandName(eligibilityPlan));
@@ -3022,6 +3079,7 @@ class WidgetsController {
3022
3079
  plans,
3023
3080
  transitionDelay,
3024
3081
  hideIfNotEligible,
3082
+ monochrome = true,
3025
3083
  suggestedPaymentPlan,
3026
3084
  locale = Locale.en,
3027
3085
  cards
@@ -3031,13 +3089,14 @@ class WidgetsController {
3031
3089
  render( /*#__PURE__*/React.createElement(Provider, {
3032
3090
  locale: locale
3033
3091
  }, /*#__PURE__*/React.createElement(PaymentPlanWidget, {
3034
- purchaseAmount: purchaseAmount,
3035
3092
  apiData: this.apiData,
3036
3093
  configPlans: plans,
3037
- transitionDelay: transitionDelay,
3038
3094
  hideIfNotEligible: hideIfNotEligible,
3095
+ monochrome: monochrome,
3096
+ purchaseAmount: purchaseAmount,
3039
3097
  suggestedPaymentPlan: suggestedPaymentPlan,
3040
- cards: cards
3098
+ cards: cards,
3099
+ transitionDelay: transitionDelay
3041
3100
  })), document.querySelector(container));
3042
3101
  }
3043
3102
  }