@thecb/components 6.0.0-beta.9 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -6137,6 +6137,8 @@ var checkDeniedCards = function checkDeniedCards(name) {
6137
6137
  */
6138
6138
 
6139
6139
  var screenReaderOnlyStyle = "\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n";
6140
+ var inputPlaceholderTextStyle = "\n ::-webkit-input-placeholder {\n color: ".concat(CHARADE_GREY, ";\n }\n ::-moz-placeholder {\n color: ").concat(CHARADE_GREY, ";\n }\n ::-ms-placeholder {\n color: ").concat(CHARADE_GREY, ";\n }\n ::placeholder {\n color: ").concat(CHARADE_GREY, ";\n }\n");
6141
+ var inputDisabledStyle = "\n color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;\n";
6140
6142
 
6141
6143
  var general = /*#__PURE__*/Object.freeze({
6142
6144
  __proto__: null,
@@ -6149,7 +6151,9 @@ var general = /*#__PURE__*/Object.freeze({
6149
6151
  checkCardBrand: checkCardBrand,
6150
6152
  displayCardBrand: displayCardBrand,
6151
6153
  checkDeniedCards: checkDeniedCards,
6152
- screenReaderOnlyStyle: screenReaderOnlyStyle
6154
+ screenReaderOnlyStyle: screenReaderOnlyStyle,
6155
+ inputPlaceholderTextStyle: inputPlaceholderTextStyle,
6156
+ inputDisabledStyle: inputDisabledStyle
6153
6157
  });
6154
6158
 
6155
6159
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children"];
@@ -6301,7 +6305,7 @@ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxS
6301
6305
  completely off screen (only for users of screen readers)
6302
6306
  */
6303
6307
 
6304
- var Box = function Box(_ref) {
6308
+ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
6305
6309
  var _ref$padding = _ref.padding,
6306
6310
  padding = _ref$padding === void 0 ? "16px" : _ref$padding,
6307
6311
  _ref$borderSize = _ref.borderSize,
@@ -6371,9 +6375,10 @@ var Box = function Box(_ref) {
6371
6375
  onMouseLeave: onMouseLeave,
6372
6376
  onFocus: onFocus,
6373
6377
  onBlur: onBlur,
6374
- onTouchEnd: onTouchEnd
6375
- }, rest), safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
6376
- };
6378
+ onTouchEnd: onTouchEnd,
6379
+ ref: ref
6380
+ }, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
6381
+ });
6377
6382
 
6378
6383
  var CenterWrapper = styled.div.withConfig({
6379
6384
  displayName: "Centerstyled__CenterWrapper",
@@ -19390,6 +19395,1254 @@ var DropdownIcon = function DropdownIcon() {
19390
19395
  })))));
19391
19396
  };
19392
19397
 
19398
+ var check = function (it) {
19399
+ return it && it.Math == Math && it;
19400
+ };
19401
+
19402
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
19403
+ var global_1 =
19404
+ // eslint-disable-next-line es-x/no-global-this -- safe
19405
+ check(typeof globalThis == 'object' && globalThis) ||
19406
+ check(typeof window == 'object' && window) ||
19407
+ // eslint-disable-next-line no-restricted-globals -- safe
19408
+ check(typeof self == 'object' && self) ||
19409
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19410
+ // eslint-disable-next-line no-new-func -- fallback
19411
+ (function () { return this; })() || Function('return this')();
19412
+
19413
+ var fails = function (exec) {
19414
+ try {
19415
+ return !!exec();
19416
+ } catch (error) {
19417
+ return true;
19418
+ }
19419
+ };
19420
+
19421
+ // Detect IE8's incomplete defineProperty implementation
19422
+ var descriptors = !fails(function () {
19423
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
19424
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
19425
+ });
19426
+
19427
+ var functionBindNative = !fails(function () {
19428
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
19429
+ var test = (function () { /* empty */ }).bind();
19430
+ // eslint-disable-next-line no-prototype-builtins -- safe
19431
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
19432
+ });
19433
+
19434
+ var call = Function.prototype.call;
19435
+
19436
+ var functionCall = functionBindNative ? call.bind(call) : function () {
19437
+ return call.apply(call, arguments);
19438
+ };
19439
+
19440
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
19441
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
19442
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
19443
+
19444
+ // Nashorn ~ JDK8 bug
19445
+ var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
19446
+
19447
+ // `Object.prototype.propertyIsEnumerable` method implementation
19448
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
19449
+ var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
19450
+ var descriptor = getOwnPropertyDescriptor(this, V);
19451
+ return !!descriptor && descriptor.enumerable;
19452
+ } : $propertyIsEnumerable;
19453
+
19454
+ var objectPropertyIsEnumerable = {
19455
+ f: f
19456
+ };
19457
+
19458
+ var createPropertyDescriptor = function (bitmap, value) {
19459
+ return {
19460
+ enumerable: !(bitmap & 1),
19461
+ configurable: !(bitmap & 2),
19462
+ writable: !(bitmap & 4),
19463
+ value: value
19464
+ };
19465
+ };
19466
+
19467
+ var FunctionPrototype = Function.prototype;
19468
+ var bind$1 = FunctionPrototype.bind;
19469
+ var call$1 = FunctionPrototype.call;
19470
+ var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
19471
+
19472
+ var functionUncurryThis = functionBindNative ? function (fn) {
19473
+ return fn && uncurryThis(fn);
19474
+ } : function (fn) {
19475
+ return fn && function () {
19476
+ return call$1.apply(fn, arguments);
19477
+ };
19478
+ };
19479
+
19480
+ var toString$2 = functionUncurryThis({}.toString);
19481
+ var stringSlice = functionUncurryThis(''.slice);
19482
+
19483
+ var classofRaw = function (it) {
19484
+ return stringSlice(toString$2(it), 8, -1);
19485
+ };
19486
+
19487
+ var Object$1 = global_1.Object;
19488
+ var split = functionUncurryThis(''.split);
19489
+
19490
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
19491
+ var indexedObject = fails(function () {
19492
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
19493
+ // eslint-disable-next-line no-prototype-builtins -- safe
19494
+ return !Object$1('z').propertyIsEnumerable(0);
19495
+ }) ? function (it) {
19496
+ return classofRaw(it) == 'String' ? split(it, '') : Object$1(it);
19497
+ } : Object$1;
19498
+
19499
+ var TypeError$1 = global_1.TypeError;
19500
+
19501
+ // `RequireObjectCoercible` abstract operation
19502
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
19503
+ var requireObjectCoercible = function (it) {
19504
+ if (it == undefined) throw TypeError$1("Can't call method on " + it);
19505
+ return it;
19506
+ };
19507
+
19508
+ // toObject with fallback for non-array-like ES3 strings
19509
+
19510
+
19511
+
19512
+ var toIndexedObject = function (it) {
19513
+ return indexedObject(requireObjectCoercible(it));
19514
+ };
19515
+
19516
+ // `IsCallable` abstract operation
19517
+ // https://tc39.es/ecma262/#sec-iscallable
19518
+ var isCallable = function (argument) {
19519
+ return typeof argument == 'function';
19520
+ };
19521
+
19522
+ var isObject = function (it) {
19523
+ return typeof it == 'object' ? it !== null : isCallable(it);
19524
+ };
19525
+
19526
+ var aFunction = function (argument) {
19527
+ return isCallable(argument) ? argument : undefined;
19528
+ };
19529
+
19530
+ var getBuiltIn = function (namespace, method) {
19531
+ return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
19532
+ };
19533
+
19534
+ var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
19535
+
19536
+ var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
19537
+
19538
+ var process$1 = global_1.process;
19539
+ var Deno = global_1.Deno;
19540
+ var versions = process$1 && process$1.versions || Deno && Deno.version;
19541
+ var v8 = versions && versions.v8;
19542
+ var match, version;
19543
+
19544
+ if (v8) {
19545
+ match = v8.split('.');
19546
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
19547
+ // but their correct versions are not interesting for us
19548
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
19549
+ }
19550
+
19551
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
19552
+ // so check `userAgent` even if `.v8` exists, but 0
19553
+ if (!version && engineUserAgent) {
19554
+ match = engineUserAgent.match(/Edge\/(\d+)/);
19555
+ if (!match || match[1] >= 74) {
19556
+ match = engineUserAgent.match(/Chrome\/(\d+)/);
19557
+ if (match) version = +match[1];
19558
+ }
19559
+ }
19560
+
19561
+ var engineV8Version = version;
19562
+
19563
+ /* eslint-disable es-x/no-symbol -- required for testing */
19564
+
19565
+
19566
+
19567
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
19568
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
19569
+ var symbol = Symbol();
19570
+ // Chrome 38 Symbol has incorrect toString conversion
19571
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
19572
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
19573
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
19574
+ !Symbol.sham && engineV8Version && engineV8Version < 41;
19575
+ });
19576
+
19577
+ /* eslint-disable es-x/no-symbol -- required for testing */
19578
+
19579
+
19580
+ var useSymbolAsUid = nativeSymbol
19581
+ && !Symbol.sham
19582
+ && typeof Symbol.iterator == 'symbol';
19583
+
19584
+ var Object$2 = global_1.Object;
19585
+
19586
+ var isSymbol = useSymbolAsUid ? function (it) {
19587
+ return typeof it == 'symbol';
19588
+ } : function (it) {
19589
+ var $Symbol = getBuiltIn('Symbol');
19590
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$2(it));
19591
+ };
19592
+
19593
+ var String$1 = global_1.String;
19594
+
19595
+ var tryToString = function (argument) {
19596
+ try {
19597
+ return String$1(argument);
19598
+ } catch (error) {
19599
+ return 'Object';
19600
+ }
19601
+ };
19602
+
19603
+ var TypeError$2 = global_1.TypeError;
19604
+
19605
+ // `Assert: IsCallable(argument) is true`
19606
+ var aCallable = function (argument) {
19607
+ if (isCallable(argument)) return argument;
19608
+ throw TypeError$2(tryToString(argument) + ' is not a function');
19609
+ };
19610
+
19611
+ // `GetMethod` abstract operation
19612
+ // https://tc39.es/ecma262/#sec-getmethod
19613
+ var getMethod = function (V, P) {
19614
+ var func = V[P];
19615
+ return func == null ? undefined : aCallable(func);
19616
+ };
19617
+
19618
+ var TypeError$3 = global_1.TypeError;
19619
+
19620
+ // `OrdinaryToPrimitive` abstract operation
19621
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
19622
+ var ordinaryToPrimitive = function (input, pref) {
19623
+ var fn, val;
19624
+ if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
19625
+ if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
19626
+ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
19627
+ throw TypeError$3("Can't convert object to primitive value");
19628
+ };
19629
+
19630
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
19631
+ var defineProperty = Object.defineProperty;
19632
+
19633
+ var setGlobal = function (key, value) {
19634
+ try {
19635
+ defineProperty(global_1, key, { value: value, configurable: true, writable: true });
19636
+ } catch (error) {
19637
+ global_1[key] = value;
19638
+ } return value;
19639
+ };
19640
+
19641
+ var SHARED = '__core-js_shared__';
19642
+ var store = global_1[SHARED] || setGlobal(SHARED, {});
19643
+
19644
+ var sharedStore = store;
19645
+
19646
+ var shared = createCommonjsModule(function (module) {
19647
+ (module.exports = function (key, value) {
19648
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
19649
+ })('versions', []).push({
19650
+ version: '3.22.5',
19651
+ mode: 'global',
19652
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
19653
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
19654
+ source: 'https://github.com/zloirock/core-js'
19655
+ });
19656
+ });
19657
+
19658
+ var Object$3 = global_1.Object;
19659
+
19660
+ // `ToObject` abstract operation
19661
+ // https://tc39.es/ecma262/#sec-toobject
19662
+ var toObject = function (argument) {
19663
+ return Object$3(requireObjectCoercible(argument));
19664
+ };
19665
+
19666
+ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
19667
+
19668
+ // `HasOwnProperty` abstract operation
19669
+ // https://tc39.es/ecma262/#sec-hasownproperty
19670
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
19671
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
19672
+ return hasOwnProperty(toObject(it), key);
19673
+ };
19674
+
19675
+ var id = 0;
19676
+ var postfix = Math.random();
19677
+ var toString$3 = functionUncurryThis(1.0.toString);
19678
+
19679
+ var uid = function (key) {
19680
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
19681
+ };
19682
+
19683
+ var WellKnownSymbolsStore = shared('wks');
19684
+ var Symbol$1 = global_1.Symbol;
19685
+ var symbolFor = Symbol$1 && Symbol$1['for'];
19686
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
19687
+
19688
+ var wellKnownSymbol = function (name) {
19689
+ if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
19690
+ var description = 'Symbol.' + name;
19691
+ if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
19692
+ WellKnownSymbolsStore[name] = Symbol$1[name];
19693
+ } else if (useSymbolAsUid && symbolFor) {
19694
+ WellKnownSymbolsStore[name] = symbolFor(description);
19695
+ } else {
19696
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
19697
+ }
19698
+ } return WellKnownSymbolsStore[name];
19699
+ };
19700
+
19701
+ var TypeError$4 = global_1.TypeError;
19702
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
19703
+
19704
+ // `ToPrimitive` abstract operation
19705
+ // https://tc39.es/ecma262/#sec-toprimitive
19706
+ var toPrimitive = function (input, pref) {
19707
+ if (!isObject(input) || isSymbol(input)) return input;
19708
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
19709
+ var result;
19710
+ if (exoticToPrim) {
19711
+ if (pref === undefined) pref = 'default';
19712
+ result = functionCall(exoticToPrim, input, pref);
19713
+ if (!isObject(result) || isSymbol(result)) return result;
19714
+ throw TypeError$4("Can't convert object to primitive value");
19715
+ }
19716
+ if (pref === undefined) pref = 'number';
19717
+ return ordinaryToPrimitive(input, pref);
19718
+ };
19719
+
19720
+ // `ToPropertyKey` abstract operation
19721
+ // https://tc39.es/ecma262/#sec-topropertykey
19722
+ var toPropertyKey = function (argument) {
19723
+ var key = toPrimitive(argument, 'string');
19724
+ return isSymbol(key) ? key : key + '';
19725
+ };
19726
+
19727
+ var document$1 = global_1.document;
19728
+ // typeof document.createElement is 'object' in old IE
19729
+ var EXISTS = isObject(document$1) && isObject(document$1.createElement);
19730
+
19731
+ var documentCreateElement = function (it) {
19732
+ return EXISTS ? document$1.createElement(it) : {};
19733
+ };
19734
+
19735
+ // Thanks to IE8 for its funny defineProperty
19736
+ var ie8DomDefine = !descriptors && !fails(function () {
19737
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
19738
+ return Object.defineProperty(documentCreateElement('div'), 'a', {
19739
+ get: function () { return 7; }
19740
+ }).a != 7;
19741
+ });
19742
+
19743
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
19744
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
19745
+
19746
+ // `Object.getOwnPropertyDescriptor` method
19747
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19748
+ var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
19749
+ O = toIndexedObject(O);
19750
+ P = toPropertyKey(P);
19751
+ if (ie8DomDefine) try {
19752
+ return $getOwnPropertyDescriptor(O, P);
19753
+ } catch (error) { /* empty */ }
19754
+ if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
19755
+ };
19756
+
19757
+ var objectGetOwnPropertyDescriptor = {
19758
+ f: f$1
19759
+ };
19760
+
19761
+ // V8 ~ Chrome 36-
19762
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
19763
+ var v8PrototypeDefineBug = descriptors && fails(function () {
19764
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
19765
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
19766
+ value: 42,
19767
+ writable: false
19768
+ }).prototype != 42;
19769
+ });
19770
+
19771
+ var String$2 = global_1.String;
19772
+ var TypeError$5 = global_1.TypeError;
19773
+
19774
+ // `Assert: Type(argument) is Object`
19775
+ var anObject = function (argument) {
19776
+ if (isObject(argument)) return argument;
19777
+ throw TypeError$5(String$2(argument) + ' is not an object');
19778
+ };
19779
+
19780
+ var TypeError$6 = global_1.TypeError;
19781
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
19782
+ var $defineProperty = Object.defineProperty;
19783
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
19784
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
19785
+ var ENUMERABLE = 'enumerable';
19786
+ var CONFIGURABLE = 'configurable';
19787
+ var WRITABLE = 'writable';
19788
+
19789
+ // `Object.defineProperty` method
19790
+ // https://tc39.es/ecma262/#sec-object.defineproperty
19791
+ var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
19792
+ anObject(O);
19793
+ P = toPropertyKey(P);
19794
+ anObject(Attributes);
19795
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
19796
+ var current = $getOwnPropertyDescriptor$1(O, P);
19797
+ if (current && current[WRITABLE]) {
19798
+ O[P] = Attributes.value;
19799
+ Attributes = {
19800
+ configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
19801
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
19802
+ writable: false
19803
+ };
19804
+ }
19805
+ } return $defineProperty(O, P, Attributes);
19806
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
19807
+ anObject(O);
19808
+ P = toPropertyKey(P);
19809
+ anObject(Attributes);
19810
+ if (ie8DomDefine) try {
19811
+ return $defineProperty(O, P, Attributes);
19812
+ } catch (error) { /* empty */ }
19813
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
19814
+ if ('value' in Attributes) O[P] = Attributes.value;
19815
+ return O;
19816
+ };
19817
+
19818
+ var objectDefineProperty = {
19819
+ f: f$2
19820
+ };
19821
+
19822
+ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
19823
+ return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
19824
+ } : function (object, key, value) {
19825
+ object[key] = value;
19826
+ return object;
19827
+ };
19828
+
19829
+ var FunctionPrototype$1 = Function.prototype;
19830
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
19831
+ var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
19832
+
19833
+ var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
19834
+ // additional protection from minified / mangled / dropped function names
19835
+ var PROPER = EXISTS$1 && (function something() { /* empty */ }).name === 'something';
19836
+ var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
19837
+
19838
+ var functionName = {
19839
+ EXISTS: EXISTS$1,
19840
+ PROPER: PROPER,
19841
+ CONFIGURABLE: CONFIGURABLE$1
19842
+ };
19843
+
19844
+ var functionToString = functionUncurryThis(Function.toString);
19845
+
19846
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
19847
+ if (!isCallable(sharedStore.inspectSource)) {
19848
+ sharedStore.inspectSource = function (it) {
19849
+ return functionToString(it);
19850
+ };
19851
+ }
19852
+
19853
+ var inspectSource = sharedStore.inspectSource;
19854
+
19855
+ var WeakMap$1 = global_1.WeakMap;
19856
+
19857
+ var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
19858
+
19859
+ var keys$1 = shared('keys');
19860
+
19861
+ var sharedKey = function (key) {
19862
+ return keys$1[key] || (keys$1[key] = uid(key));
19863
+ };
19864
+
19865
+ var hiddenKeys = {};
19866
+
19867
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
19868
+ var TypeError$7 = global_1.TypeError;
19869
+ var WeakMap$2 = global_1.WeakMap;
19870
+ var set, get, has;
19871
+
19872
+ var enforce = function (it) {
19873
+ return has(it) ? get(it) : set(it, {});
19874
+ };
19875
+
19876
+ var getterFor = function (TYPE) {
19877
+ return function (it) {
19878
+ var state;
19879
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
19880
+ throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
19881
+ } return state;
19882
+ };
19883
+ };
19884
+
19885
+ if (nativeWeakMap || sharedStore.state) {
19886
+ var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
19887
+ var wmget = functionUncurryThis(store$1.get);
19888
+ var wmhas = functionUncurryThis(store$1.has);
19889
+ var wmset = functionUncurryThis(store$1.set);
19890
+ set = function (it, metadata) {
19891
+ if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
19892
+ metadata.facade = it;
19893
+ wmset(store$1, it, metadata);
19894
+ return metadata;
19895
+ };
19896
+ get = function (it) {
19897
+ return wmget(store$1, it) || {};
19898
+ };
19899
+ has = function (it) {
19900
+ return wmhas(store$1, it);
19901
+ };
19902
+ } else {
19903
+ var STATE = sharedKey('state');
19904
+ hiddenKeys[STATE] = true;
19905
+ set = function (it, metadata) {
19906
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
19907
+ metadata.facade = it;
19908
+ createNonEnumerableProperty(it, STATE, metadata);
19909
+ return metadata;
19910
+ };
19911
+ get = function (it) {
19912
+ return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
19913
+ };
19914
+ has = function (it) {
19915
+ return hasOwnProperty_1(it, STATE);
19916
+ };
19917
+ }
19918
+
19919
+ var internalState = {
19920
+ set: set,
19921
+ get: get,
19922
+ has: has,
19923
+ enforce: enforce,
19924
+ getterFor: getterFor
19925
+ };
19926
+
19927
+ var makeBuiltIn_1 = createCommonjsModule(function (module) {
19928
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
19929
+
19930
+
19931
+
19932
+ var enforceInternalState = internalState.enforce;
19933
+ var getInternalState = internalState.get;
19934
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
19935
+ var defineProperty = Object.defineProperty;
19936
+
19937
+ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
19938
+ return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
19939
+ });
19940
+
19941
+ var TEMPLATE = String(String).split('String');
19942
+
19943
+ var makeBuiltIn = module.exports = function (value, name, options) {
19944
+ if (String(name).slice(0, 7) === 'Symbol(') {
19945
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
19946
+ }
19947
+ if (options && options.getter) name = 'get ' + name;
19948
+ if (options && options.setter) name = 'set ' + name;
19949
+ if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
19950
+ defineProperty(value, 'name', { value: name, configurable: true });
19951
+ }
19952
+ if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
19953
+ defineProperty(value, 'length', { value: options.arity });
19954
+ }
19955
+ if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
19956
+ if (descriptors) try {
19957
+ defineProperty(value, 'prototype', { writable: false });
19958
+ } catch (error) { /* empty */ }
19959
+ } else value.prototype = undefined;
19960
+ var state = enforceInternalState(value);
19961
+ if (!hasOwnProperty_1(state, 'source')) {
19962
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
19963
+ } return value;
19964
+ };
19965
+
19966
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
19967
+ // eslint-disable-next-line no-extend-native -- required
19968
+ Function.prototype.toString = makeBuiltIn(function toString() {
19969
+ return isCallable(this) && getInternalState(this).source || inspectSource(this);
19970
+ }, 'toString');
19971
+ });
19972
+
19973
+ var defineBuiltIn = function (O, key, value, options) {
19974
+ var unsafe = options ? !!options.unsafe : false;
19975
+ var simple = options ? !!options.enumerable : false;
19976
+ var noTargetGet = options ? !!options.noTargetGet : false;
19977
+ var name = options && options.name !== undefined ? options.name : key;
19978
+ if (isCallable(value)) makeBuiltIn_1(value, name, options);
19979
+ if (O === global_1) {
19980
+ if (simple) O[key] = value;
19981
+ else setGlobal(key, value);
19982
+ return O;
19983
+ } else if (!unsafe) {
19984
+ delete O[key];
19985
+ } else if (!noTargetGet && O[key]) {
19986
+ simple = true;
19987
+ }
19988
+ if (simple) O[key] = value;
19989
+ else createNonEnumerableProperty(O, key, value);
19990
+ return O;
19991
+ };
19992
+
19993
+ var ceil = Math.ceil;
19994
+ var floor = Math.floor;
19995
+
19996
+ // `ToIntegerOrInfinity` abstract operation
19997
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
19998
+ var toIntegerOrInfinity = function (argument) {
19999
+ var number = +argument;
20000
+ // eslint-disable-next-line no-self-compare -- safe
20001
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
20002
+ };
20003
+
20004
+ var max = Math.max;
20005
+ var min = Math.min;
20006
+
20007
+ // Helper for a popular repeating case of the spec:
20008
+ // Let integer be ? ToInteger(index).
20009
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
20010
+ var toAbsoluteIndex = function (index, length) {
20011
+ var integer = toIntegerOrInfinity(index);
20012
+ return integer < 0 ? max(integer + length, 0) : min(integer, length);
20013
+ };
20014
+
20015
+ var min$1 = Math.min;
20016
+
20017
+ // `ToLength` abstract operation
20018
+ // https://tc39.es/ecma262/#sec-tolength
20019
+ var toLength = function (argument) {
20020
+ return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
20021
+ };
20022
+
20023
+ // `LengthOfArrayLike` abstract operation
20024
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
20025
+ var lengthOfArrayLike = function (obj) {
20026
+ return toLength(obj.length);
20027
+ };
20028
+
20029
+ // `Array.prototype.{ indexOf, includes }` methods implementation
20030
+ var createMethod = function (IS_INCLUDES) {
20031
+ return function ($this, el, fromIndex) {
20032
+ var O = toIndexedObject($this);
20033
+ var length = lengthOfArrayLike(O);
20034
+ var index = toAbsoluteIndex(fromIndex, length);
20035
+ var value;
20036
+ // Array#includes uses SameValueZero equality algorithm
20037
+ // eslint-disable-next-line no-self-compare -- NaN check
20038
+ if (IS_INCLUDES && el != el) while (length > index) {
20039
+ value = O[index++];
20040
+ // eslint-disable-next-line no-self-compare -- NaN check
20041
+ if (value != value) return true;
20042
+ // Array#indexOf ignores holes, Array#includes - not
20043
+ } else for (;length > index; index++) {
20044
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
20045
+ } return !IS_INCLUDES && -1;
20046
+ };
20047
+ };
20048
+
20049
+ var arrayIncludes = {
20050
+ // `Array.prototype.includes` method
20051
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
20052
+ includes: createMethod(true),
20053
+ // `Array.prototype.indexOf` method
20054
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
20055
+ indexOf: createMethod(false)
20056
+ };
20057
+
20058
+ var indexOf = arrayIncludes.indexOf;
20059
+
20060
+
20061
+ var push = functionUncurryThis([].push);
20062
+
20063
+ var objectKeysInternal = function (object, names) {
20064
+ var O = toIndexedObject(object);
20065
+ var i = 0;
20066
+ var result = [];
20067
+ var key;
20068
+ for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key);
20069
+ // Don't enum bug & hidden keys
20070
+ while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
20071
+ ~indexOf(result, key) || push(result, key);
20072
+ }
20073
+ return result;
20074
+ };
20075
+
20076
+ // IE8- don't enum bug keys
20077
+ var enumBugKeys = [
20078
+ 'constructor',
20079
+ 'hasOwnProperty',
20080
+ 'isPrototypeOf',
20081
+ 'propertyIsEnumerable',
20082
+ 'toLocaleString',
20083
+ 'toString',
20084
+ 'valueOf'
20085
+ ];
20086
+
20087
+ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
20088
+
20089
+ // `Object.getOwnPropertyNames` method
20090
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
20091
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
20092
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
20093
+ return objectKeysInternal(O, hiddenKeys$1);
20094
+ };
20095
+
20096
+ var objectGetOwnPropertyNames = {
20097
+ f: f$3
20098
+ };
20099
+
20100
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
20101
+ var f$4 = Object.getOwnPropertySymbols;
20102
+
20103
+ var objectGetOwnPropertySymbols = {
20104
+ f: f$4
20105
+ };
20106
+
20107
+ var concat = functionUncurryThis([].concat);
20108
+
20109
+ // all object keys, includes non-enumerable and symbols
20110
+ var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
20111
+ var keys = objectGetOwnPropertyNames.f(anObject(it));
20112
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
20113
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
20114
+ };
20115
+
20116
+ var copyConstructorProperties = function (target, source, exceptions) {
20117
+ var keys = ownKeys$1(source);
20118
+ var defineProperty = objectDefineProperty.f;
20119
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
20120
+ for (var i = 0; i < keys.length; i++) {
20121
+ var key = keys[i];
20122
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
20123
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
20124
+ }
20125
+ }
20126
+ };
20127
+
20128
+ var replacement = /#|\.prototype\./;
20129
+
20130
+ var isForced = function (feature, detection) {
20131
+ var value = data[normalize(feature)];
20132
+ return value == POLYFILL ? true
20133
+ : value == NATIVE ? false
20134
+ : isCallable(detection) ? fails(detection)
20135
+ : !!detection;
20136
+ };
20137
+
20138
+ var normalize = isForced.normalize = function (string) {
20139
+ return String(string).replace(replacement, '.').toLowerCase();
20140
+ };
20141
+
20142
+ var data = isForced.data = {};
20143
+ var NATIVE = isForced.NATIVE = 'N';
20144
+ var POLYFILL = isForced.POLYFILL = 'P';
20145
+
20146
+ var isForced_1 = isForced;
20147
+
20148
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
20149
+
20150
+
20151
+
20152
+
20153
+
20154
+
20155
+ /*
20156
+ options.target - name of the target object
20157
+ options.global - target is the global object
20158
+ options.stat - export as static methods of target
20159
+ options.proto - export as prototype methods of target
20160
+ options.real - real prototype method for the `pure` version
20161
+ options.forced - export even if the native feature is available
20162
+ options.bind - bind methods to the target, required for the `pure` version
20163
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
20164
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
20165
+ options.sham - add a flag to not completely full polyfills
20166
+ options.enumerable - export as enumerable property
20167
+ options.noTargetGet - prevent calling a getter on target
20168
+ options.name - the .name of the function if it does not match the key
20169
+ */
20170
+ var _export = function (options, source) {
20171
+ var TARGET = options.target;
20172
+ var GLOBAL = options.global;
20173
+ var STATIC = options.stat;
20174
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
20175
+ if (GLOBAL) {
20176
+ target = global_1;
20177
+ } else if (STATIC) {
20178
+ target = global_1[TARGET] || setGlobal(TARGET, {});
20179
+ } else {
20180
+ target = (global_1[TARGET] || {}).prototype;
20181
+ }
20182
+ if (target) for (key in source) {
20183
+ sourceProperty = source[key];
20184
+ if (options.noTargetGet) {
20185
+ descriptor = getOwnPropertyDescriptor$1(target, key);
20186
+ targetProperty = descriptor && descriptor.value;
20187
+ } else targetProperty = target[key];
20188
+ FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
20189
+ // contained in target
20190
+ if (!FORCED && targetProperty !== undefined) {
20191
+ if (typeof sourceProperty == typeof targetProperty) continue;
20192
+ copyConstructorProperties(sourceProperty, targetProperty);
20193
+ }
20194
+ // add a flag to not completely full polyfills
20195
+ if (options.sham || (targetProperty && targetProperty.sham)) {
20196
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
20197
+ }
20198
+ defineBuiltIn(target, key, sourceProperty, options);
20199
+ }
20200
+ };
20201
+
20202
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
20203
+ var test$1 = {};
20204
+
20205
+ test$1[TO_STRING_TAG] = 'z';
20206
+
20207
+ var toStringTagSupport = String(test$1) === '[object z]';
20208
+
20209
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
20210
+ var Object$4 = global_1.Object;
20211
+
20212
+ // ES3 wrong here
20213
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
20214
+
20215
+ // fallback for IE11 Script Access Denied error
20216
+ var tryGet = function (it, key) {
20217
+ try {
20218
+ return it[key];
20219
+ } catch (error) { /* empty */ }
20220
+ };
20221
+
20222
+ // getting tag from ES6+ `Object.prototype.toString`
20223
+ var classof = toStringTagSupport ? classofRaw : function (it) {
20224
+ var O, tag, result;
20225
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
20226
+ // @@toStringTag case
20227
+ : typeof (tag = tryGet(O = Object$4(it), TO_STRING_TAG$1)) == 'string' ? tag
20228
+ // builtinTag case
20229
+ : CORRECT_ARGUMENTS ? classofRaw(O)
20230
+ // ES3 arguments fallback
20231
+ : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
20232
+ };
20233
+
20234
+ var String$3 = global_1.String;
20235
+
20236
+ var toString_1 = function (argument) {
20237
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
20238
+ return String$3(argument);
20239
+ };
20240
+
20241
+ var charAt = functionUncurryThis(''.charAt);
20242
+
20243
+ var FORCED = fails(function () {
20244
+ // eslint-disable-next-line es-x/no-array-string-prototype-at -- safe
20245
+ return '𠮷'.at(-2) !== '\uD842';
20246
+ });
20247
+
20248
+ // `String.prototype.at` method
20249
+ // https://github.com/tc39/proposal-relative-indexing-method
20250
+ _export({ target: 'String', proto: true, forced: FORCED }, {
20251
+ at: function at(index) {
20252
+ var S = toString_1(requireObjectCoercible(this));
20253
+ var len = S.length;
20254
+ var relativeIndex = toIntegerOrInfinity(index);
20255
+ var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
20256
+ return (k < 0 || k >= len) ? undefined : charAt(S, k);
20257
+ }
20258
+ });
20259
+
20260
+ // `Object.keys` method
20261
+ // https://tc39.es/ecma262/#sec-object.keys
20262
+ // eslint-disable-next-line es-x/no-object-keys -- safe
20263
+ var objectKeys = Object.keys || function keys(O) {
20264
+ return objectKeysInternal(O, enumBugKeys);
20265
+ };
20266
+
20267
+ // `Object.defineProperties` method
20268
+ // https://tc39.es/ecma262/#sec-object.defineproperties
20269
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
20270
+ var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
20271
+ anObject(O);
20272
+ var props = toIndexedObject(Properties);
20273
+ var keys = objectKeys(Properties);
20274
+ var length = keys.length;
20275
+ var index = 0;
20276
+ var key;
20277
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
20278
+ return O;
20279
+ };
20280
+
20281
+ var objectDefineProperties = {
20282
+ f: f$5
20283
+ };
20284
+
20285
+ var html = getBuiltIn('document', 'documentElement');
20286
+
20287
+ /* global ActiveXObject -- old IE, WSH */
20288
+
20289
+
20290
+
20291
+
20292
+
20293
+
20294
+
20295
+
20296
+ var GT = '>';
20297
+ var LT = '<';
20298
+ var PROTOTYPE = 'prototype';
20299
+ var SCRIPT = 'script';
20300
+ var IE_PROTO = sharedKey('IE_PROTO');
20301
+
20302
+ var EmptyConstructor = function () { /* empty */ };
20303
+
20304
+ var scriptTag = function (content) {
20305
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
20306
+ };
20307
+
20308
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
20309
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
20310
+ activeXDocument.write(scriptTag(''));
20311
+ activeXDocument.close();
20312
+ var temp = activeXDocument.parentWindow.Object;
20313
+ activeXDocument = null; // avoid memory leak
20314
+ return temp;
20315
+ };
20316
+
20317
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
20318
+ var NullProtoObjectViaIFrame = function () {
20319
+ // Thrash, waste and sodomy: IE GC bug
20320
+ var iframe = documentCreateElement('iframe');
20321
+ var JS = 'java' + SCRIPT + ':';
20322
+ var iframeDocument;
20323
+ iframe.style.display = 'none';
20324
+ html.appendChild(iframe);
20325
+ // https://github.com/zloirock/core-js/issues/475
20326
+ iframe.src = String(JS);
20327
+ iframeDocument = iframe.contentWindow.document;
20328
+ iframeDocument.open();
20329
+ iframeDocument.write(scriptTag('document.F=Object'));
20330
+ iframeDocument.close();
20331
+ return iframeDocument.F;
20332
+ };
20333
+
20334
+ // Check for document.domain and active x support
20335
+ // No need to use active x approach when document.domain is not set
20336
+ // see https://github.com/es-shims/es5-shim/issues/150
20337
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
20338
+ // avoid IE GC bug
20339
+ var activeXDocument;
20340
+ var NullProtoObject = function () {
20341
+ try {
20342
+ activeXDocument = new ActiveXObject('htmlfile');
20343
+ } catch (error) { /* ignore */ }
20344
+ NullProtoObject = typeof document != 'undefined'
20345
+ ? document.domain && activeXDocument
20346
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
20347
+ : NullProtoObjectViaIFrame()
20348
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
20349
+ var length = enumBugKeys.length;
20350
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
20351
+ return NullProtoObject();
20352
+ };
20353
+
20354
+ hiddenKeys[IE_PROTO] = true;
20355
+
20356
+ // `Object.create` method
20357
+ // https://tc39.es/ecma262/#sec-object.create
20358
+ // eslint-disable-next-line es-x/no-object-create -- safe
20359
+ var objectCreate = Object.create || function create(O, Properties) {
20360
+ var result;
20361
+ if (O !== null) {
20362
+ EmptyConstructor[PROTOTYPE] = anObject(O);
20363
+ result = new EmptyConstructor();
20364
+ EmptyConstructor[PROTOTYPE] = null;
20365
+ // add "__proto__" for Object.getPrototypeOf polyfill
20366
+ result[IE_PROTO] = O;
20367
+ } else result = NullProtoObject();
20368
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
20369
+ };
20370
+
20371
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
20372
+ var ArrayPrototype = Array.prototype;
20373
+
20374
+ // Array.prototype[@@unscopables]
20375
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
20376
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
20377
+ objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
20378
+ configurable: true,
20379
+ value: objectCreate(null)
20380
+ });
20381
+ }
20382
+
20383
+ // add a key to Array.prototype[@@unscopables]
20384
+ var addToUnscopables = function (key) {
20385
+ ArrayPrototype[UNSCOPABLES][key] = true;
20386
+ };
20387
+
20388
+ // `Array.prototype.at` method
20389
+ // https://github.com/tc39/proposal-relative-indexing-method
20390
+ _export({ target: 'Array', proto: true }, {
20391
+ at: function at(index) {
20392
+ var O = toObject(this);
20393
+ var len = lengthOfArrayLike(O);
20394
+ var relativeIndex = toIntegerOrInfinity(index);
20395
+ var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
20396
+ return (k < 0 || k >= len) ? undefined : O[k];
20397
+ }
20398
+ });
20399
+
20400
+ addToUnscopables('at');
20401
+
20402
+ // eslint-disable-next-line es-x/no-typed-arrays -- safe
20403
+ var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
20404
+
20405
+ var correctPrototypeGetter = !fails(function () {
20406
+ function F() { /* empty */ }
20407
+ F.prototype.constructor = null;
20408
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
20409
+ return Object.getPrototypeOf(new F()) !== F.prototype;
20410
+ });
20411
+
20412
+ var IE_PROTO$1 = sharedKey('IE_PROTO');
20413
+ var Object$5 = global_1.Object;
20414
+ var ObjectPrototype = Object$5.prototype;
20415
+
20416
+ // `Object.getPrototypeOf` method
20417
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
20418
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
20419
+ var object = toObject(O);
20420
+ if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
20421
+ var constructor = object.constructor;
20422
+ if (isCallable(constructor) && object instanceof constructor) {
20423
+ return constructor.prototype;
20424
+ } return object instanceof Object$5 ? ObjectPrototype : null;
20425
+ };
20426
+
20427
+ var String$4 = global_1.String;
20428
+ var TypeError$8 = global_1.TypeError;
20429
+
20430
+ var aPossiblePrototype = function (argument) {
20431
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
20432
+ throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
20433
+ };
20434
+
20435
+ /* eslint-disable no-proto -- safe */
20436
+
20437
+
20438
+
20439
+
20440
+ // `Object.setPrototypeOf` method
20441
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
20442
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
20443
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
20444
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
20445
+ var CORRECT_SETTER = false;
20446
+ var test = {};
20447
+ var setter;
20448
+ try {
20449
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
20450
+ setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
20451
+ setter(test, []);
20452
+ CORRECT_SETTER = test instanceof Array;
20453
+ } catch (error) { /* empty */ }
20454
+ return function setPrototypeOf(O, proto) {
20455
+ anObject(O);
20456
+ aPossiblePrototype(proto);
20457
+ if (CORRECT_SETTER) setter(O, proto);
20458
+ else O.__proto__ = proto;
20459
+ return O;
20460
+ };
20461
+ }() : undefined);
20462
+
20463
+ var defineProperty$1 = objectDefineProperty.f;
20464
+
20465
+
20466
+
20467
+
20468
+
20469
+
20470
+ var Int8Array = global_1.Int8Array;
20471
+ var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
20472
+ var Uint8ClampedArray = global_1.Uint8ClampedArray;
20473
+ var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
20474
+ var TypedArray = Int8Array && objectGetPrototypeOf(Int8Array);
20475
+ var TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
20476
+ var ObjectPrototype$1 = Object.prototype;
20477
+ var TypeError$9 = global_1.TypeError;
20478
+
20479
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
20480
+ var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
20481
+ var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');
20482
+ // Fixing native typed arrays in Opera Presto crashes the browser, see #595
20483
+ var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
20484
+ var TYPED_ARRAY_TAG_REQUIRED = false;
20485
+ var NAME, Constructor, Prototype;
20486
+
20487
+ var TypedArrayConstructorsList = {
20488
+ Int8Array: 1,
20489
+ Uint8Array: 1,
20490
+ Uint8ClampedArray: 1,
20491
+ Int16Array: 2,
20492
+ Uint16Array: 2,
20493
+ Int32Array: 4,
20494
+ Uint32Array: 4,
20495
+ Float32Array: 4,
20496
+ Float64Array: 8
20497
+ };
20498
+
20499
+ var BigIntArrayConstructorsList = {
20500
+ BigInt64Array: 8,
20501
+ BigUint64Array: 8
20502
+ };
20503
+
20504
+ var isView = function isView(it) {
20505
+ if (!isObject(it)) return false;
20506
+ var klass = classof(it);
20507
+ return klass === 'DataView'
20508
+ || hasOwnProperty_1(TypedArrayConstructorsList, klass)
20509
+ || hasOwnProperty_1(BigIntArrayConstructorsList, klass);
20510
+ };
20511
+
20512
+ var isTypedArray = function (it) {
20513
+ if (!isObject(it)) return false;
20514
+ var klass = classof(it);
20515
+ return hasOwnProperty_1(TypedArrayConstructorsList, klass)
20516
+ || hasOwnProperty_1(BigIntArrayConstructorsList, klass);
20517
+ };
20518
+
20519
+ var aTypedArray = function (it) {
20520
+ if (isTypedArray(it)) return it;
20521
+ throw TypeError$9('Target is not a typed array');
20522
+ };
20523
+
20524
+ var aTypedArrayConstructor = function (C) {
20525
+ if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
20526
+ throw TypeError$9(tryToString(C) + ' is not a typed array constructor');
20527
+ };
20528
+
20529
+ var exportTypedArrayMethod = function (KEY, property, forced, options) {
20530
+ if (!descriptors) return;
20531
+ if (forced) for (var ARRAY in TypedArrayConstructorsList) {
20532
+ var TypedArrayConstructor = global_1[ARRAY];
20533
+ if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor.prototype, KEY)) try {
20534
+ delete TypedArrayConstructor.prototype[KEY];
20535
+ } catch (error) {
20536
+ // old WebKit bug - some methods are non-configurable
20537
+ try {
20538
+ TypedArrayConstructor.prototype[KEY] = property;
20539
+ } catch (error2) { /* empty */ }
20540
+ }
20541
+ }
20542
+ if (!TypedArrayPrototype[KEY] || forced) {
20543
+ defineBuiltIn(TypedArrayPrototype, KEY, forced ? property
20544
+ : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
20545
+ }
20546
+ };
20547
+
20548
+ var exportTypedArrayStaticMethod = function (KEY, property, forced) {
20549
+ var ARRAY, TypedArrayConstructor;
20550
+ if (!descriptors) return;
20551
+ if (objectSetPrototypeOf) {
20552
+ if (forced) for (ARRAY in TypedArrayConstructorsList) {
20553
+ TypedArrayConstructor = global_1[ARRAY];
20554
+ if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor, KEY)) try {
20555
+ delete TypedArrayConstructor[KEY];
20556
+ } catch (error) { /* empty */ }
20557
+ }
20558
+ if (!TypedArray[KEY] || forced) {
20559
+ // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
20560
+ try {
20561
+ return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
20562
+ } catch (error) { /* empty */ }
20563
+ } else return;
20564
+ }
20565
+ for (ARRAY in TypedArrayConstructorsList) {
20566
+ TypedArrayConstructor = global_1[ARRAY];
20567
+ if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
20568
+ defineBuiltIn(TypedArrayConstructor, KEY, property);
20569
+ }
20570
+ }
20571
+ };
20572
+
20573
+ for (NAME in TypedArrayConstructorsList) {
20574
+ Constructor = global_1[NAME];
20575
+ Prototype = Constructor && Constructor.prototype;
20576
+ if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
20577
+ else NATIVE_ARRAY_BUFFER_VIEWS = false;
20578
+ }
20579
+
20580
+ for (NAME in BigIntArrayConstructorsList) {
20581
+ Constructor = global_1[NAME];
20582
+ Prototype = Constructor && Constructor.prototype;
20583
+ if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
20584
+ }
20585
+
20586
+ // WebKit bug - typed arrays constructors prototype is Object.prototype
20587
+ if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
20588
+ // eslint-disable-next-line no-shadow -- safe
20589
+ TypedArray = function TypedArray() {
20590
+ throw TypeError$9('Incorrect invocation');
20591
+ };
20592
+ if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
20593
+ if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
20594
+ }
20595
+ }
20596
+
20597
+ if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype$1) {
20598
+ TypedArrayPrototype = TypedArray.prototype;
20599
+ if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
20600
+ if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME].prototype, TypedArrayPrototype);
20601
+ }
20602
+ }
20603
+
20604
+ // WebKit bug - one more object in Uint8ClampedArray prototype chain
20605
+ if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
20606
+ objectSetPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
20607
+ }
20608
+
20609
+ if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
20610
+ TYPED_ARRAY_TAG_REQUIRED = true;
20611
+ defineProperty$1(TypedArrayPrototype, TO_STRING_TAG$2, { get: function () {
20612
+ return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
20613
+ } });
20614
+ for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
20615
+ createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
20616
+ }
20617
+ }
20618
+
20619
+ var arrayBufferViewCore = {
20620
+ NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
20621
+ TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
20622
+ TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
20623
+ aTypedArray: aTypedArray,
20624
+ aTypedArrayConstructor: aTypedArrayConstructor,
20625
+ exportTypedArrayMethod: exportTypedArrayMethod,
20626
+ exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
20627
+ isView: isView,
20628
+ isTypedArray: isTypedArray,
20629
+ TypedArray: TypedArray,
20630
+ TypedArrayPrototype: TypedArrayPrototype
20631
+ };
20632
+
20633
+ var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
20634
+ var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
20635
+
20636
+ // `%TypedArray%.prototype.at` method
20637
+ // https://github.com/tc39/proposal-relative-indexing-method
20638
+ exportTypedArrayMethod$1('at', function at(index) {
20639
+ var O = aTypedArray$1(this);
20640
+ var len = lengthOfArrayLike(O);
20641
+ var relativeIndex = toIntegerOrInfinity(index);
20642
+ var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
20643
+ return (k < 0 || k >= len) ? undefined : O[k];
20644
+ });
20645
+
19393
20646
  var selectedColor = "".concat(MATISSE_BLUE);
19394
20647
  var hoverColor$3 = "".concat(HOVER_LIGHT_BLUE);
19395
20648
  var fallbackValues$e = {
@@ -19400,24 +20653,24 @@ var fallbackValues$e = {
19400
20653
  var IconWrapper = styled.div.withConfig({
19401
20654
  displayName: "Dropdown__IconWrapper",
19402
20655
  componentId: "sc-pn6m0h-0"
19403
- })(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ""], function (_ref) {
20656
+ })(["position:absolute;display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ";top:20px;right:12px;"], function (_ref) {
19404
20657
  var open = _ref.open;
19405
20658
  return open ? "transform: rotate(-180deg)" : "";
19406
20659
  });
19407
20660
  var DropdownContentWrapper = styled.div.withConfig({
19408
20661
  displayName: "Dropdown__DropdownContentWrapper",
19409
20662
  componentId: "sc-pn6m0h-1"
19410
- })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}"], GREY_CHATEAU, WHITE, function (_ref2) {
20663
+ })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
19411
20664
  var widthFitOptions = _ref2.widthFitOptions;
19412
20665
  return widthFitOptions ? "fit-content" : "100%";
19413
20666
  }, function (_ref3) {
19414
20667
  var maxHeight = _ref3.maxHeight;
19415
20668
  return maxHeight || "400px";
19416
20669
  });
19417
- var DropdownItemWrapper = styled.div.withConfig({
20670
+ var DropdownItemWrapper = styled.li.withConfig({
19418
20671
  displayName: "Dropdown__DropdownItemWrapper",
19419
20672
  componentId: "sc-pn6m0h-2"
19420
- })(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
20673
+ })(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
19421
20674
  var selected = _ref4.selected,
19422
20675
  themeValues = _ref4.themeValues;
19423
20676
  return selected ? themeValues.selectedColor : WHITE;
@@ -19435,10 +20688,6 @@ var DropdownItemWrapper = styled.div.withConfig({
19435
20688
  themeValues = _ref7.themeValues;
19436
20689
  return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
19437
20690
  });
19438
- var SearchInput = styled.input.withConfig({
19439
- displayName: "Dropdown__SearchInput",
19440
- componentId: "sc-pn6m0h-3"
19441
- })(["border:none;background-color:transparent;font-size:16px;height:24px;min-width:80%;"]);
19442
20691
 
19443
20692
  var Dropdown = function Dropdown(_ref8) {
19444
20693
  var placeholder = _ref8.placeholder,
@@ -19450,7 +20699,7 @@ var Dropdown = function Dropdown(_ref8) {
19450
20699
  _ref8$disabledValues = _ref8.disabledValues,
19451
20700
  disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
19452
20701
  _ref8$onClick = _ref8.onClick,
19453
- onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
20702
+ _onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
19454
20703
  themeValues = _ref8.themeValues,
19455
20704
  maxHeight = _ref8.maxHeight,
19456
20705
  _ref8$widthFitOptions = _ref8.widthFitOptions,
@@ -19462,7 +20711,9 @@ var Dropdown = function Dropdown(_ref8) {
19462
20711
  autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
19463
20712
  ariaLabelledby = _ref8.ariaLabelledby,
19464
20713
  _ref8$autocompleteVal = _ref8.autocompleteValue,
19465
- autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal;
20714
+ autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal,
20715
+ _ref8$smoothScroll = _ref8.smoothScroll,
20716
+ smoothScroll = _ref8$smoothScroll === void 0 ? true : _ref8$smoothScroll;
19466
20717
 
19467
20718
  var _useState = useState(""),
19468
20719
  _useState2 = _slicedToArray(_useState, 2),
@@ -19489,6 +20740,21 @@ var Dropdown = function Dropdown(_ref8) {
19489
20740
  selectedRef = _useState10[0],
19490
20741
  setSelectedRef = _useState10[1];
19491
20742
 
20743
+ var _useState11 = useState(undefined),
20744
+ _useState12 = _slicedToArray(_useState11, 2),
20745
+ focusedRef = _useState12[0],
20746
+ setFocusedRef = _useState12[1];
20747
+
20748
+ var _useState13 = useState(false),
20749
+ _useState14 = _slicedToArray(_useState13, 2),
20750
+ inputChangedByAutofill = _useState14[0],
20751
+ setInputChangedByAutofill = _useState14[1];
20752
+
20753
+ var _useState15 = useState(false),
20754
+ _useState16 = _slicedToArray(_useState15, 2),
20755
+ focusedByClick = _useState16[0],
20756
+ setFocusedByClick = _useState16[1];
20757
+
19492
20758
  if (optionsState !== options) {
19493
20759
  setOptionsState(options);
19494
20760
  setOptionsChanged(true);
@@ -19499,10 +20765,10 @@ var Dropdown = function Dropdown(_ref8) {
19499
20765
  setOptionsChanged(false);
19500
20766
  }
19501
20767
 
19502
- var _useState11 = useState(null),
19503
- _useState12 = _slicedToArray(_useState11, 2),
19504
- timer = _useState12[0],
19505
- setTimer = _useState12[1];
20768
+ var _useState17 = useState(null),
20769
+ _useState18 = _slicedToArray(_useState17, 2),
20770
+ timer = _useState18[0],
20771
+ setTimer = _useState18[1];
19506
20772
 
19507
20773
  var optionRefs = useRef(_toConsumableArray(Array(options.length)).map(function () {
19508
20774
  return /*#__PURE__*/createRef();
@@ -19518,25 +20784,21 @@ var Dropdown = function Dropdown(_ref8) {
19518
20784
  };
19519
20785
 
19520
20786
  var onKeyDown = function onKeyDown(e) {
19521
- var _optionRefs$current$l, _optionRefs$current;
19522
-
19523
- console.log("key down event is", e.target);
19524
- console.log("key down event value is", e.target.value);
19525
20787
  var key = e.key,
19526
20788
  keyCode = e.keyCode;
19527
20789
  var focus = document.activeElement;
19528
- console.log("dropdown value is", value);
19529
- console.log("focus is", focus);
19530
- console.log("option refs are", optionRefs.current);
19531
20790
  var optionEl = optionRefs.current.find(function (ref) {
19532
20791
  return ref.current === focus;
19533
20792
  });
19534
- console.log("option el is", optionEl);
19535
20793
 
19536
20794
  switch (key) {
19537
20795
  case "ArrowDown":
19538
20796
  e.preventDefault();
19539
20797
 
20798
+ if (!isOpen) {
20799
+ _onClick();
20800
+ }
20801
+
19540
20802
  if (optionEl) {
19541
20803
  if (optionEl.current.nextElementSibling) {
19542
20804
  optionEl.current.nextElementSibling.focus();
@@ -19545,7 +20807,7 @@ var Dropdown = function Dropdown(_ref8) {
19545
20807
  break;
19546
20808
  }
19547
20809
  } else {
19548
- onClick();
20810
+ _onClick();
19549
20811
  }
19550
20812
 
19551
20813
  break;
@@ -19561,7 +20823,7 @@ var Dropdown = function Dropdown(_ref8) {
19561
20823
  break;
19562
20824
  }
19563
20825
  } else {
19564
- onClick();
20826
+ _onClick();
19565
20827
  }
19566
20828
 
19567
20829
  break;
@@ -19585,7 +20847,14 @@ var Dropdown = function Dropdown(_ref8) {
19585
20847
 
19586
20848
  case "End":
19587
20849
  e.preventDefault();
19588
- optionRefs.current[(_optionRefs$current$l = optionRefs === null || optionRefs === void 0 ? void 0 : (_optionRefs$current = optionRefs.current) === null || _optionRefs$current === void 0 ? void 0 : _optionRefs$current.length) !== null && _optionRefs$current$l !== void 0 ? _optionRefs$current$l : 0 - 1].current.focus();
20850
+ optionRefs.current.at(-1).current.focus();
20851
+ break;
20852
+
20853
+ case "Escape":
20854
+ if (isOpen) {
20855
+ _onClick();
20856
+ }
20857
+
19589
20858
  break;
19590
20859
  }
19591
20860
 
@@ -19595,20 +20864,40 @@ var Dropdown = function Dropdown(_ref8) {
19595
20864
  }
19596
20865
  };
19597
20866
 
20867
+ var handleItemSelection = function handleItemSelection(evt, choice, i) {
20868
+ if (disabledValues.includes(choice.value)) {
20869
+ evt.preventDefault();
20870
+ } else {
20871
+ setSelectedRef(optionRefs.current[i]);
20872
+ onSelect(choice.value);
20873
+
20874
+ if (isOpen) {
20875
+ _onClick();
20876
+ }
20877
+ }
20878
+ };
20879
+
19598
20880
  useEffect$1(function () {
19599
- console.log("option refs in isopen useffect", optionRefs);
19600
- console.log("option ref current in isopen useffect", optionRefs.current[0].current);
19601
- console.log("selected refs in isopen useffect", selectedRef);
19602
- console.log("value in isopen useffect", value);
20881
+ var selectedRefExists = selectedRef !== undefined && selectedRef.current !== null;
19603
20882
 
19604
- if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
19605
- // WAI-ARIA requires the selected option to receive focus
20883
+ if (isOpen && selectedRefExists && !focusedByClick) {
20884
+ // For keyboard users, WAI-ARIA requires the selected option to receive focus
19606
20885
  selectedRef.current.focus();
19607
- } else if (isOpen && optionRefs.current[0].current) {
20886
+ } else if (isOpen && optionRefs.current[0].current && !focusedByClick) {
19608
20887
  // If no selected option, first option receives focus
19609
20888
  optionRefs.current[0].current.focus();
19610
20889
  }
19611
20890
 
20891
+ if (isOpen && focusedByClick && selectedRefExists) {
20892
+ // To support autofill for mouse users, we maintain focus on input just scroll item into view
20893
+ selectedRef.current.scrollIntoView({
20894
+ behavior: smoothScroll ? "smooth" : "auto",
20895
+ block: "nearest",
20896
+ inline: "start"
20897
+ });
20898
+ setFocusedByClick(false);
20899
+ }
20900
+
19612
20901
  clearTimeout(timer);
19613
20902
  setInputValue("");
19614
20903
  }, [isOpen]);
@@ -19625,10 +20914,20 @@ var Dropdown = function Dropdown(_ref8) {
19625
20914
  }));
19626
20915
  }, [inputValue]);
19627
20916
  useEffect$1(function () {
19628
- if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
19629
- console.log("filtered options are", filteredOptions);
19630
- console.log("option refs are", optionRefs);
20917
+ if (
20918
+ /*
20919
+ Either user has typed a value into input that matches a non-disabled option or
20920
+ user has autofilled or pasted into input a string matching a valid option
20921
+ */
20922
+ (!isOpen || inputChangedByAutofill) && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
20923
+ setInputChangedByAutofill(false);
19631
20924
  onSelect(filteredOptions[0].value);
20925
+
20926
+ if (isOpen) {
20927
+ setTimeout(function () {
20928
+ return _onClick();
20929
+ }, 1000);
20930
+ }
19632
20931
  }
19633
20932
 
19634
20933
  if (optionRefs.current[0].current) {
@@ -19638,50 +20937,61 @@ var Dropdown = function Dropdown(_ref8) {
19638
20937
  }
19639
20938
  }, [filteredOptions]);
19640
20939
  return /*#__PURE__*/React.createElement(Box, {
19641
- onKeyDown: onKeyDown,
19642
- onClick: onClick,
19643
- padding: "12px",
19644
- width: "100%",
19645
- hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
20940
+ padding: "0",
19646
20941
  background: isOpen ? themeValues.hoverColor : WHITE,
19647
- "aria-expanded": isOpen,
19648
- role: "combobox",
20942
+ extraStyles: "position: relative;",
20943
+ minWidth: "100%",
20944
+ onClick: function onClick() {
20945
+ if (!isOpen) {
20946
+ setFocusedByClick(true);
20947
+
20948
+ _onClick();
20949
+ }
20950
+ },
20951
+ onKeyDown: onKeyDown,
20952
+ width: "100%"
20953
+ }, /*#__PURE__*/React.createElement(Box, {
20954
+ as: "input",
20955
+ "aria-multiline": "false",
20956
+ "aria-autocomplete": "list",
20957
+ "aria-controls": "".concat(ariaLabelledby, "_listbox"),
20958
+ "aria-activedescendant": "focused_option",
19649
20959
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
19650
20960
  "aria-haspopup": "listbox",
19651
20961
  "aria-labelledby": ariaLabelledby,
19652
- extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
19653
- title: hasTitles ? getSelection() : null,
19654
- dataQa: placeholder,
19655
- tabIndex: 0,
20962
+ "aria-expanded": isOpen,
20963
+ autocomplete: autocompleteValue,
20964
+ background: isOpen ? themeValues.hoverColor : WHITE,
19656
20965
  borderRadius: "2px",
19657
20966
  borderSize: "1px",
19658
- borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU
19659
- }, /*#__PURE__*/React.createElement(Stack, {
19660
- direction: "row",
19661
- bottomItem: 2,
19662
- extraStyles: "position: relative;"
19663
- }, /*#__PURE__*/React.createElement(SearchInput, {
19664
- "aria-label": getSelection(),
19665
- placeholder: getSelection(),
19666
- value: inputValue,
20967
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
20968
+ extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
20969
+ hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
20970
+ isOpen: isOpen,
20971
+ minHeight: "48px",
20972
+ minWidth: "100%",
20973
+ name: autocompleteValue,
19667
20974
  onChange: function onChange(e) {
19668
- console.log("input change event", e.target);
19669
- console.log("input change event value", e.target.value);
20975
+ // support autofill and copy/paste
20976
+ if (e.target.value !== inputValue) {
20977
+ setInputValue(e.target.value);
20978
+ setInputChangedByAutofill(true);
20979
+ }
19670
20980
  },
20981
+ padding: "12px",
20982
+ placeholder: getSelection(),
20983
+ role: "combobox",
19671
20984
  themeValues: themeValues,
19672
- role: "searchbox",
20985
+ title: hasTitles ? getSelection() : null,
19673
20986
  type: "text",
19674
- "aria-multiline": "false",
19675
- "aria-autocomplete": "list",
19676
- "aria-controls": "".concat(ariaLabelledby, "_listbox"),
19677
- "aria-activedescendant": "selected_option",
19678
- isOpen: isOpen,
19679
- tabIndex: -1,
19680
- name: autocompleteValue,
19681
- autocomplete: autocompleteValue
20987
+ tabIndex: 0,
20988
+ value: inputValue,
20989
+ width: "100%",
20990
+ dataQa: placeholder
19682
20991
  }), /*#__PURE__*/React.createElement(IconWrapper, {
19683
- open: isOpen
19684
- }, /*#__PURE__*/React.createElement(DropdownIcon, null))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
20992
+ open: isOpen,
20993
+ onClick: _onClick
20994
+ }, /*#__PURE__*/React.createElement(DropdownIcon, null)), /*#__PURE__*/React.createElement(Fragment, null, isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
19685
20995
  maxHeight: maxHeight,
19686
20996
  open: isOpen,
19687
20997
  ref: dropdownRef,
@@ -19690,23 +21000,25 @@ var Dropdown = function Dropdown(_ref8) {
19690
21000
  role: "listbox",
19691
21001
  id: "".concat(ariaLabelledby, "_listbox")
19692
21002
  }, /*#__PURE__*/React.createElement(Stack, {
19693
- childGap: "0"
21003
+ childGap: "0",
21004
+ as: "ul"
19694
21005
  }, filteredOptions.map(function (choice, i) {
19695
21006
  if (choice.value === value && selectedRef !== optionRefs.current[i]) {
19696
21007
  setSelectedRef(optionRefs.current[i]);
19697
21008
  }
19698
21009
 
19699
21010
  return /*#__PURE__*/React.createElement(DropdownItemWrapper, {
19700
- id: choice.value === value ? "selected_option" : choice.value,
21011
+ id: focusedRef === optionRefs.current[i] ? "focused_option" : choice.value,
19701
21012
  key: choice.value,
19702
21013
  ref: optionRefs.current[i],
19703
- as: "button",
19704
21014
  tabIndex: -1,
19705
- onClick: disabledValues.includes(choice.value) ? function (evt) {
19706
- return evt.preventDefault();
19707
- } : function () {
19708
- setSelectedRef(optionRefs.current[i]);
19709
- onSelect(choice.value);
21015
+ onClick: function onClick(e) {
21016
+ return handleItemSelection(e, choice, i);
21017
+ },
21018
+ onKeyDown: function onKeyDown(e) {
21019
+ if (e.keyCode === 13) {
21020
+ handleItemSelection(e, choice, i);
21021
+ }
19710
21022
  },
19711
21023
  selected: choice.value === value,
19712
21024
  "aria-selected": choice.value === value,
@@ -19714,13 +21026,16 @@ var Dropdown = function Dropdown(_ref8) {
19714
21026
  "data-qa": choice.text,
19715
21027
  themeValues: themeValues,
19716
21028
  title: hasTitles ? choice.text : null,
19717
- role: "option"
21029
+ role: "option",
21030
+ onFocus: function onFocus() {
21031
+ return setFocusedRef(optionRefs.current[i]);
21032
+ }
19718
21033
  }, /*#__PURE__*/React.createElement(Text$1, {
19719
21034
  variant: "p",
19720
21035
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
19721
21036
  extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
19722
21037
  }, choice.text));
19723
- }))) : /*#__PURE__*/React.createElement(Fragment, null));
21038
+ }))) : /*#__PURE__*/React.createElement(Fragment, null)));
19724
21039
  };
19725
21040
 
19726
21041
  var Dropdown$1 = themeComponent(Dropdown, "Dropdown", fallbackValues$e);
@@ -19822,7 +21137,9 @@ var FormSelect = function FormSelect(_ref) {
19822
21137
  themeValues = _ref.themeValues,
19823
21138
  _ref$hasTitles = _ref.hasTitles,
19824
21139
  hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
19825
- autocompleteValue = _ref.autocompleteValue;
21140
+ autocompleteValue = _ref.autocompleteValue,
21141
+ _ref$smoothScroll = _ref.smoothScroll,
21142
+ smoothScroll = _ref$smoothScroll === void 0 ? true : _ref$smoothScroll;
19826
21143
 
19827
21144
  var _useState = useState(false),
19828
21145
  _useState2 = _slicedToArray(_useState, 2),
@@ -19878,7 +21195,8 @@ var FormSelect = function FormSelect(_ref) {
19878
21195
  return setOpen(!open);
19879
21196
  },
19880
21197
  disabled: disabled,
19881
- autocompleteValue: autocompleteValue
21198
+ autocompleteValue: autocompleteValue,
21199
+ smoothScroll: smoothScroll
19882
21200
  }), /*#__PURE__*/React.createElement(Stack, {
19883
21201
  direction: "row",
19884
21202
  justify: "space-between"
@@ -33800,20 +35118,20 @@ function isPlainObject(value) {
33800
35118
  }
33801
35119
  var assign = Object.assign || function assign(target, value) {
33802
35120
  for (var key in value) {
33803
- if (has(value, key)) {
35121
+ if (has$1(value, key)) {
33804
35122
  target[key] = value[key];
33805
35123
  }
33806
35124
  }
33807
35125
 
33808
35126
  return target;
33809
35127
  };
33810
- var ownKeys$1 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
35128
+ var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
33811
35129
  function shallowCopy(base, invokeGetters) {
33812
35130
  if ( invokeGetters === void 0 ) invokeGetters = false;
33813
35131
 
33814
35132
  if (Array.isArray(base)) { return base.slice(); }
33815
35133
  var clone = Object.create(Object.getPrototypeOf(base));
33816
- ownKeys$1(base).forEach(function (key) {
35134
+ ownKeys$2(base).forEach(function (key) {
33817
35135
  if (key === DRAFT_STATE) {
33818
35136
  return; // Never copy over draft state.
33819
35137
  }
@@ -33845,14 +35163,14 @@ function each(value, cb) {
33845
35163
  if (Array.isArray(value)) {
33846
35164
  for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
33847
35165
  } else {
33848
- ownKeys$1(value).forEach(function (key) { return cb(key, value[key], value); });
35166
+ ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
33849
35167
  }
33850
35168
  }
33851
35169
  function isEnumerable(base, prop) {
33852
35170
  var desc = Object.getOwnPropertyDescriptor(base, prop);
33853
35171
  return !!desc && desc.enumerable;
33854
35172
  }
33855
- function has(thing, prop) {
35173
+ function has$1(thing, prop) {
33856
35174
  return Object.prototype.hasOwnProperty.call(thing, prop);
33857
35175
  }
33858
35176
  function is(x, y) {
@@ -33916,7 +35234,7 @@ function revoke(draft) {
33916
35234
 
33917
35235
  // but share them all instead
33918
35236
 
33919
- var descriptors = {};
35237
+ var descriptors$1 = {};
33920
35238
  function willFinalize(scope, result, isReplaced) {
33921
35239
  scope.drafts.forEach(function (draft) {
33922
35240
  draft[DRAFT_STATE].finalizing = true;
@@ -33984,7 +35302,7 @@ function peek(draft, prop) {
33984
35302
  return draft[prop];
33985
35303
  }
33986
35304
 
33987
- function get(state, prop) {
35305
+ function get$1(state, prop) {
33988
35306
  assertUnrevoked(state);
33989
35307
  var value = peek(source(state), prop);
33990
35308
  if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
@@ -34035,17 +35353,17 @@ function clonePotentialDraft(base) {
34035
35353
  }
34036
35354
 
34037
35355
  function proxyProperty(draft, prop, enumerable) {
34038
- var desc = descriptors[prop];
35356
+ var desc = descriptors$1[prop];
34039
35357
 
34040
35358
  if (desc) {
34041
35359
  desc.enumerable = enumerable;
34042
35360
  } else {
34043
- descriptors[prop] = desc = {
35361
+ descriptors$1[prop] = desc = {
34044
35362
  configurable: true,
34045
35363
  enumerable: enumerable,
34046
35364
 
34047
- get: function get$1() {
34048
- return get(this[DRAFT_STATE], prop);
35365
+ get: function get$1$1() {
35366
+ return get$1(this[DRAFT_STATE], prop);
34049
35367
  },
34050
35368
 
34051
35369
  set: function set$1$1(value) {
@@ -34091,7 +35409,7 @@ function markChangesRecursively(object) {
34091
35409
  // Look for added keys.
34092
35410
  Object.keys(draft).forEach(function (key) {
34093
35411
  // The `undefined` check is a fast path for pre-existing keys.
34094
- if (base[key] === undefined && !has(base, key)) {
35412
+ if (base[key] === undefined && !has$1(base, key)) {
34095
35413
  assigned[key] = true;
34096
35414
  markChanged(state);
34097
35415
  } else if (!assigned[key]) {
@@ -34102,7 +35420,7 @@ function markChangesRecursively(object) {
34102
35420
 
34103
35421
  Object.keys(base).forEach(function (key) {
34104
35422
  // The `undefined` check is a fast path for pre-existing keys.
34105
- if (draft[key] === undefined && !has(draft, key)) {
35423
+ if (draft[key] === undefined && !has$1(draft, key)) {
34106
35424
  assigned[key] = false;
34107
35425
  markChanged(state);
34108
35426
  }
@@ -34135,7 +35453,7 @@ function hasObjectChanges(state) {
34135
35453
  var key = keys[i];
34136
35454
  var baseValue = base[key]; // The `undefined` check is a fast path for pre-existing keys.
34137
35455
 
34138
- if (baseValue === undefined && !has(base, key)) {
35456
+ if (baseValue === undefined && !has$1(base, key)) {
34139
35457
  return true;
34140
35458
  } // Once a base key is deleted, future changes go undetected, because its
34141
35459
  // descriptor is erased. This branch detects any missed changes.
@@ -34220,7 +35538,7 @@ function createProxy$1(base, parent) {
34220
35538
  return proxy;
34221
35539
  }
34222
35540
  var objectTraps = {
34223
- get: get$1,
35541
+ get: get$1$1,
34224
35542
 
34225
35543
  has: function has(target, prop) {
34226
35544
  return prop in source$1(target);
@@ -34232,7 +35550,7 @@ var objectTraps = {
34232
35550
 
34233
35551
  set: set$1$1,
34234
35552
  deleteProperty: deleteProperty,
34235
- getOwnPropertyDescriptor: getOwnPropertyDescriptor,
35553
+ getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
34236
35554
 
34237
35555
  defineProperty: function defineProperty() {
34238
35556
  throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
@@ -34283,11 +35601,11 @@ function peek$1(draft, prop) {
34283
35601
  return desc && desc.value;
34284
35602
  }
34285
35603
 
34286
- function get$1(state, prop) {
35604
+ function get$1$1(state, prop) {
34287
35605
  if (prop === DRAFT_STATE) { return state; }
34288
35606
  var drafts = state.drafts; // Check for existing draft in unmodified state.
34289
35607
 
34290
- if (!state.modified && has(drafts, prop)) {
35608
+ if (!state.modified && has$1(drafts, prop)) {
34291
35609
  return drafts[prop];
34292
35610
  }
34293
35611
 
@@ -34340,7 +35658,7 @@ function deleteProperty(state, prop) {
34340
35658
  // the same guarantee in ES5 mode.
34341
35659
 
34342
35660
 
34343
- function getOwnPropertyDescriptor(state, prop) {
35661
+ function getOwnPropertyDescriptor$2(state, prop) {
34344
35662
  var owner = source$1(state);
34345
35663
  var desc = Reflect.getOwnPropertyDescriptor(owner, prop);
34346
35664
 
@@ -34759,7 +36077,7 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
34759
36077
  var base = state.base;
34760
36078
  var copy = state.copy;
34761
36079
  each(base, function (prop) {
34762
- if (!has(copy, prop)) { this$1$1.onDelete(state, prop); }
36080
+ if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
34763
36081
  });
34764
36082
  }
34765
36083
  }
@@ -34938,7 +36256,7 @@ const createInitialState = formConfig => {
34938
36256
  };
34939
36257
 
34940
36258
  const SET = "field/SET";
34941
- const set = fieldName => value => ({
36259
+ const set$2 = fieldName => value => ({
34942
36260
  type: SET,
34943
36261
  payload: { fieldName, value }
34944
36262
  });
@@ -35018,7 +36336,7 @@ const createMapDispatchToProps = formConfig => {
35018
36336
  const keys = Object.keys(formConfig);
35019
36337
  for (let fieldName of keys) {
35020
36338
  dispatchObj.fields[fieldName] = {
35021
- set: value => dispatch(set(fieldName)(value)),
36339
+ set: value => dispatch(set$2(fieldName)(value)),
35022
36340
  addValidator: validator => dispatch(addValidator(fieldName)(validator))
35023
36341
  };
35024
36342
  }
@@ -35942,7 +37260,10 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
35942
37260
  boxShadow: "0px 0px 4px 0px rgb(110, 114, 126)",
35943
37261
  role: "region",
35944
37262
  "aria-label": "Payment step"
35945
- }, /*#__PURE__*/React.createElement(Center, {
37263
+ }, /*#__PURE__*/React.createElement(Box, {
37264
+ srOnly: true,
37265
+ padding: "0"
37266
+ }, /*#__PURE__*/React.createElement(Text$1, null, "Current step: ".concat(tabs[highlightIndex]))), /*#__PURE__*/React.createElement(Center, {
35946
37267
  maxWidth: "76.5rem"
35947
37268
  }, /*#__PURE__*/React.createElement(Reel, {
35948
37269
  padding: "0",
@@ -37954,7 +39275,7 @@ var tabbable_1 = tabbable;
37954
39275
 
37955
39276
  var immutable = extend;
37956
39277
 
37957
- var hasOwnProperty = Object.prototype.hasOwnProperty;
39278
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
37958
39279
 
37959
39280
  function extend() {
37960
39281
  var target = {};
@@ -37963,7 +39284,7 @@ function extend() {
37963
39284
  var source = arguments[i];
37964
39285
 
37965
39286
  for (var key in source) {
37966
- if (hasOwnProperty.call(source, key)) {
39287
+ if (hasOwnProperty$1.call(source, key)) {
37967
39288
  target[key] = source[key];
37968
39289
  }
37969
39290
  }