@true-engineering/true-react-common-ui-kit 1.8.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/Input/Input.styles.d.ts +1 -0
  2. package/dist/components/Select/Select.d.ts +12 -3
  3. package/dist/components/Select/Select.styles.d.ts +10 -0
  4. package/dist/components/Select/SelectList/SelectList.d.ts +6 -4
  5. package/dist/components/Select/SelectList/SelectList.styles.d.ts +5 -0
  6. package/dist/components/Select/SelectListItem/SelectListItem.d.ts +14 -0
  7. package/dist/components/Select/SelectListItem/SelectListItem.styles.d.ts +2 -0
  8. package/dist/components/Select/constants.d.ts +2 -0
  9. package/dist/components/Select/helpers.d.ts +4 -1
  10. package/dist/components/Select/index.d.ts +1 -0
  11. package/dist/components/Select/types.d.ts +1 -0
  12. package/dist/helpers/utils.d.ts +3 -1
  13. package/dist/true-react-common-ui-kit.js +1133 -217
  14. package/dist/true-react-common-ui-kit.js.map +1 -1
  15. package/dist/true-react-common-ui-kit.umd.cjs +1105 -188
  16. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  17. package/package.json +3 -3
  18. package/src/components/Button/Button.tsx +1 -1
  19. package/src/components/FiltersPane/FilterSelect/locales.ts +1 -1
  20. package/src/components/FiltersPane/locales.ts +1 -1
  21. package/src/components/Input/Input.styles.ts +2 -0
  22. package/src/components/Input/Input.tsx +4 -1
  23. package/src/components/MultiSelectList/locales.ts +1 -1
  24. package/src/components/Select/MultiSelect.stories.tsx +262 -0
  25. package/src/components/Select/Select.styles.ts +13 -0
  26. package/src/components/Select/Select.tsx +218 -117
  27. package/src/components/Select/SelectList/SelectList.styles.ts +6 -2
  28. package/src/components/Select/SelectList/SelectList.tsx +64 -39
  29. package/src/components/Select/SelectListItem/SelectListItem.styles.ts +14 -0
  30. package/src/components/Select/SelectListItem/SelectListItem.tsx +73 -0
  31. package/src/components/Select/constants.ts +2 -0
  32. package/src/components/Select/helpers.ts +16 -8
  33. package/src/components/Select/index.ts +1 -0
  34. package/src/components/Select/types.ts +1 -0
  35. package/src/helpers/utils.ts +33 -2
  36. package/src/hooks/use-theme.ts +1 -1
  37. package/src/hooks/use-tweak-styles.ts +1 -1
@@ -1,6 +1,6 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("hex-to-rgba"), require("react-jss"), require("lodash"), require("react-input-mask"), require("react-datepicker"), require("date-fns"), require("react-overlays"), require("scroll-into-view-if-needed"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "hex-to-rgba", "react-jss", "lodash", "react-input-mask", "react-datepicker", "date-fns", "react-overlays", "scroll-into-view-if-needed", "ts-debounce", "country-flag-icons", "react-remove-scroll"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TrueReactKitUiKit = {}, global.React, global.reactTransitionGroup, global.clsx, global.hexToRgba, global.reactJss, global.lodash, global.InputMask, global.ReactDatepicker, global.dateFns, global.reactOverlays, global.scrollIntoViewIfNeeded, global.tsDebounce, global.countryFlagIcons, global.reactRemoveScroll));
3
- })(this, function(exports2, React, reactTransitionGroup, clsx, hexToRgba, reactJss, lodash, InputMask, ReactDatepicker, dateFns, reactOverlays, scrollIntoViewIfNeeded, tsDebounce, countryFlagIcons, reactRemoveScroll) {
1
+ (function(global2, factory) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("hex-to-rgba"), require("react-jss"), require("react-input-mask"), require("react-datepicker"), require("date-fns"), require("react-overlays"), require("scroll-into-view-if-needed"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "hex-to-rgba", "react-jss", "react-input-mask", "react-datepicker", "date-fns", "react-overlays", "scroll-into-view-if-needed", "ts-debounce", "country-flag-icons", "react-remove-scroll"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.TrueReactKitUiKit = {}, global2.React, global2.reactTransitionGroup, global2.clsx, global2.hexToRgba, global2.reactJss, global2.InputMask, global2.ReactDatepicker, global2.dateFns, global2.reactOverlays, global2.scrollIntoViewIfNeeded, global2.tsDebounce, global2.countryFlagIcons, global2.reactRemoveScroll));
3
+ })(this, function(exports2, React, reactTransitionGroup, clsx, hexToRgba, reactJss, InputMask, ReactDatepicker, dateFns, reactOverlays, scrollIntoViewIfNeeded, tsDebounce, countryFlagIcons, reactRemoveScroll) {
4
4
  "use strict";
5
5
  var colors = {
6
6
  FONT_MAIN: "#222a37",
@@ -617,7 +617,7 @@
617
617
  }
618
618
  return "";
619
619
  }
620
- var hasOwnProperty = Object.prototype.hasOwnProperty;
620
+ var hasOwnProperty2 = Object.prototype.hasOwnProperty;
621
621
  var loggedTypeFailures = {};
622
622
  var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
623
623
  function setCurrentlyValidatingElement(element) {
@@ -633,7 +633,7 @@
633
633
  }
634
634
  function checkPropTypes(typeSpecs, values, location, componentName, element) {
635
635
  {
636
- var has = Function.call.bind(hasOwnProperty);
636
+ var has = Function.call.bind(hasOwnProperty2);
637
637
  for (var typeSpecName in typeSpecs) {
638
638
  if (has(typeSpecs, typeSpecName)) {
639
639
  var error$1 = void 0;
@@ -663,7 +663,7 @@
663
663
  }
664
664
  }
665
665
  var isArrayImpl = Array.isArray;
666
- function isArray(a) {
666
+ function isArray2(a) {
667
667
  return isArrayImpl(a);
668
668
  }
669
669
  function typeName(value) {
@@ -709,7 +709,7 @@
709
709
  }
710
710
  function hasValidRef(config) {
711
711
  {
712
- if (hasOwnProperty.call(config, "ref")) {
712
+ if (hasOwnProperty2.call(config, "ref")) {
713
713
  var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
714
714
  if (getter && getter.isReactWarning) {
715
715
  return false;
@@ -720,7 +720,7 @@
720
720
  }
721
721
  function hasValidKey(config) {
722
722
  {
723
- if (hasOwnProperty.call(config, "key")) {
723
+ if (hasOwnProperty2.call(config, "key")) {
724
724
  var getter = Object.getOwnPropertyDescriptor(config, "key").get;
725
725
  if (getter && getter.isReactWarning) {
726
726
  return false;
@@ -832,7 +832,7 @@
832
832
  warnIfStringRefCannotBeAutoConverted(config, self2);
833
833
  }
834
834
  for (propName in config) {
835
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
835
+ if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
836
836
  props[propName] = config[propName];
837
837
  }
838
838
  }
@@ -937,7 +937,7 @@
937
937
  if (typeof node !== "object") {
938
938
  return;
939
939
  }
940
- if (isArray(node)) {
940
+ if (isArray2(node)) {
941
941
  for (var i = 0; i < node.length; i++) {
942
942
  var child = node[i];
943
943
  if (isValidElement(child)) {
@@ -1029,7 +1029,7 @@
1029
1029
  var typeString;
1030
1030
  if (type === null) {
1031
1031
  typeString = "null";
1032
- } else if (isArray(type)) {
1032
+ } else if (isArray2(type)) {
1033
1033
  typeString = "array";
1034
1034
  } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
1035
1035
  typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
@@ -1047,7 +1047,7 @@
1047
1047
  var children = props.children;
1048
1048
  if (children !== void 0) {
1049
1049
  if (isStaticChildren) {
1050
- if (isArray(children)) {
1050
+ if (isArray2(children)) {
1051
1051
  for (var i = 0; i < children.length; i++) {
1052
1052
  validateChildKeys(children[i], type);
1053
1053
  }
@@ -1111,11 +1111,11 @@
1111
1111
  if (Array.isArray(arr))
1112
1112
  return arr;
1113
1113
  }
1114
- function _array_without_holes$6(arr) {
1114
+ function _array_without_holes$7(arr) {
1115
1115
  if (Array.isArray(arr))
1116
1116
  return _array_like_to_array$q(arr);
1117
1117
  }
1118
- function _iterable_to_array$6(iter) {
1118
+ function _iterable_to_array$7(iter) {
1119
1119
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1120
1120
  return Array.from(iter);
1121
1121
  }
@@ -1150,14 +1150,14 @@
1150
1150
  function _non_iterable_rest$o() {
1151
1151
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1152
1152
  }
1153
- function _non_iterable_spread$6() {
1153
+ function _non_iterable_spread$7() {
1154
1154
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1155
1155
  }
1156
1156
  function _sliced_to_array$o(arr, i) {
1157
1157
  return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$o();
1158
1158
  }
1159
- function _to_consumable_array$6(arr) {
1160
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$6();
1159
+ function _to_consumable_array$7(arr) {
1160
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$7();
1161
1161
  }
1162
1162
  function _unsupported_iterable_to_array$q(o, minLen) {
1163
1163
  if (!o)
@@ -1195,7 +1195,7 @@
1195
1195
  };
1196
1196
  var _element_parentNode;
1197
1197
  var getParentNode$1 = function(element) {
1198
- return element.nodeName === "HTML" ? element : (_element_parentNode = element.parentNode) !== null && _element_parentNode !== void 0 ? _element_parentNode : element.host;
1198
+ return element.nodeName === "HTML" || element === document ? element : (_element_parentNode = element.parentNode) !== null && _element_parentNode !== void 0 ? _element_parentNode : element.host;
1199
1199
  };
1200
1200
  var getStyleComputedProperty = function(element) {
1201
1201
  return element.nodeType !== 1 ? {} : getComputedStyle(element, null);
@@ -1292,6 +1292,9 @@
1292
1292
  var isNotEmpty = function(val) {
1293
1293
  return typeof val === "string" ? val.trim() !== "" : val !== null && val !== void 0;
1294
1294
  };
1295
+ var isStringNotEmpty = function(value) {
1296
+ return (value !== null && value !== void 0 ? value : "").trim() !== "";
1297
+ };
1295
1298
  var trimStringToMaxLength = function(val, maxLength) {
1296
1299
  return val.length > maxLength ? val.slice(0, maxLength) : val;
1297
1300
  };
@@ -1309,7 +1312,7 @@
1309
1312
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1310
1313
  args[_key] = arguments[_key];
1311
1314
  }
1312
- var testId = getTestId.apply(void 0, _to_consumable_array$6(args));
1315
+ var testId = getTestId.apply(void 0, _to_consumable_array$7(args));
1313
1316
  return isNotEmpty(testId) ? {
1314
1317
  "data-testid": testId
1315
1318
  } : void 0;
@@ -1337,6 +1340,21 @@
1337
1340
  tabIndex: -1
1338
1341
  };
1339
1342
  };
1343
+ var createFilter = function(getter) {
1344
+ return function(items, query) {
1345
+ return items.filter(function(item) {
1346
+ var possibleValues = getter(item).reduce(function(acc, cur) {
1347
+ return _to_consumable_array$7(acc).concat(_to_consumable_array$7(isStringNotEmpty(cur) ? [
1348
+ cur === null || cur === void 0 ? void 0 : cur.toLowerCase()
1349
+ ] : []));
1350
+ }, []);
1351
+ var queryString = query.toLowerCase().trim();
1352
+ return possibleValues.some(function(v) {
1353
+ return v === null || v === void 0 ? void 0 : v.includes(queryString);
1354
+ });
1355
+ });
1356
+ };
1357
+ };
1340
1358
  var minWidthModifier = {
1341
1359
  name: "minWidth",
1342
1360
  enabled: true,
@@ -1360,19 +1378,19 @@
1360
1378
  arr2[i] = arr[i];
1361
1379
  return arr2;
1362
1380
  }
1363
- function _array_without_holes$5(arr) {
1381
+ function _array_without_holes$6(arr) {
1364
1382
  if (Array.isArray(arr))
1365
1383
  return _array_like_to_array$p(arr);
1366
1384
  }
1367
- function _iterable_to_array$5(iter) {
1385
+ function _iterable_to_array$6(iter) {
1368
1386
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1369
1387
  return Array.from(iter);
1370
1388
  }
1371
- function _non_iterable_spread$5() {
1389
+ function _non_iterable_spread$6() {
1372
1390
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1373
1391
  }
1374
- function _to_consumable_array$5(arr) {
1375
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$5();
1392
+ function _to_consumable_array$6(arr) {
1393
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$6();
1376
1394
  }
1377
1395
  function _unsupported_iterable_to_array$p(o, minLen) {
1378
1396
  if (!o)
@@ -1412,7 +1430,7 @@
1412
1430
  var possibleValues = [
1413
1431
  country.countryRu,
1414
1432
  country.countryEn
1415
- ].concat(_to_consumable_array$5(country.countryRu.split(" ")), _to_consumable_array$5(country.countryEn.split(" ")), [
1433
+ ].concat(_to_consumable_array$6(country.countryRu.split(" ")), _to_consumable_array$6(country.countryEn.split(" ")), [
1416
1434
  country.dialCode
1417
1435
  ]).map(function(part) {
1418
1436
  return part.toLowerCase();
@@ -1530,6 +1548,746 @@
1530
1548
  ignoreClassName
1531
1549
  ]);
1532
1550
  }
1551
+ function listCacheClear() {
1552
+ this.__data__ = [];
1553
+ this.size = 0;
1554
+ }
1555
+ function eq(value, other) {
1556
+ return value === other || value !== value && other !== other;
1557
+ }
1558
+ function assocIndexOf(array, key) {
1559
+ var length = array.length;
1560
+ while (length--) {
1561
+ if (eq(array[length][0], key)) {
1562
+ return length;
1563
+ }
1564
+ }
1565
+ return -1;
1566
+ }
1567
+ var arrayProto = Array.prototype;
1568
+ var splice = arrayProto.splice;
1569
+ function listCacheDelete(key) {
1570
+ var data = this.__data__, index = assocIndexOf(data, key);
1571
+ if (index < 0) {
1572
+ return false;
1573
+ }
1574
+ var lastIndex = data.length - 1;
1575
+ if (index == lastIndex) {
1576
+ data.pop();
1577
+ } else {
1578
+ splice.call(data, index, 1);
1579
+ }
1580
+ --this.size;
1581
+ return true;
1582
+ }
1583
+ function listCacheGet(key) {
1584
+ var data = this.__data__, index = assocIndexOf(data, key);
1585
+ return index < 0 ? void 0 : data[index][1];
1586
+ }
1587
+ function listCacheHas(key) {
1588
+ return assocIndexOf(this.__data__, key) > -1;
1589
+ }
1590
+ function listCacheSet(key, value) {
1591
+ var data = this.__data__, index = assocIndexOf(data, key);
1592
+ if (index < 0) {
1593
+ ++this.size;
1594
+ data.push([key, value]);
1595
+ } else {
1596
+ data[index][1] = value;
1597
+ }
1598
+ return this;
1599
+ }
1600
+ function ListCache(entries) {
1601
+ var index = -1, length = entries == null ? 0 : entries.length;
1602
+ this.clear();
1603
+ while (++index < length) {
1604
+ var entry = entries[index];
1605
+ this.set(entry[0], entry[1]);
1606
+ }
1607
+ }
1608
+ ListCache.prototype.clear = listCacheClear;
1609
+ ListCache.prototype["delete"] = listCacheDelete;
1610
+ ListCache.prototype.get = listCacheGet;
1611
+ ListCache.prototype.has = listCacheHas;
1612
+ ListCache.prototype.set = listCacheSet;
1613
+ function stackClear() {
1614
+ this.__data__ = new ListCache();
1615
+ this.size = 0;
1616
+ }
1617
+ function stackDelete(key) {
1618
+ var data = this.__data__, result = data["delete"](key);
1619
+ this.size = data.size;
1620
+ return result;
1621
+ }
1622
+ function stackGet(key) {
1623
+ return this.__data__.get(key);
1624
+ }
1625
+ function stackHas(key) {
1626
+ return this.__data__.has(key);
1627
+ }
1628
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
1629
+ const freeGlobal$1 = freeGlobal;
1630
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
1631
+ var root = freeGlobal$1 || freeSelf || Function("return this")();
1632
+ const root$1 = root;
1633
+ var Symbol$1 = root$1.Symbol;
1634
+ const Symbol$2 = Symbol$1;
1635
+ var objectProto$a = Object.prototype;
1636
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
1637
+ var nativeObjectToString$1 = objectProto$a.toString;
1638
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
1639
+ function getRawTag(value) {
1640
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
1641
+ try {
1642
+ value[symToStringTag$1] = void 0;
1643
+ var unmasked = true;
1644
+ } catch (e) {
1645
+ }
1646
+ var result = nativeObjectToString$1.call(value);
1647
+ if (unmasked) {
1648
+ if (isOwn) {
1649
+ value[symToStringTag$1] = tag;
1650
+ } else {
1651
+ delete value[symToStringTag$1];
1652
+ }
1653
+ }
1654
+ return result;
1655
+ }
1656
+ var objectProto$9 = Object.prototype;
1657
+ var nativeObjectToString = objectProto$9.toString;
1658
+ function objectToString(value) {
1659
+ return nativeObjectToString.call(value);
1660
+ }
1661
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
1662
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
1663
+ function baseGetTag(value) {
1664
+ if (value == null) {
1665
+ return value === void 0 ? undefinedTag : nullTag;
1666
+ }
1667
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1668
+ }
1669
+ function isObject(value) {
1670
+ var type = typeof value;
1671
+ return value != null && (type == "object" || type == "function");
1672
+ }
1673
+ var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
1674
+ function isFunction(value) {
1675
+ if (!isObject(value)) {
1676
+ return false;
1677
+ }
1678
+ var tag = baseGetTag(value);
1679
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
1680
+ }
1681
+ var coreJsData = root$1["__core-js_shared__"];
1682
+ const coreJsData$1 = coreJsData;
1683
+ var maskSrcKey = function() {
1684
+ var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
1685
+ return uid ? "Symbol(src)_1." + uid : "";
1686
+ }();
1687
+ function isMasked(func) {
1688
+ return !!maskSrcKey && maskSrcKey in func;
1689
+ }
1690
+ var funcProto$2 = Function.prototype;
1691
+ var funcToString$2 = funcProto$2.toString;
1692
+ function toSource(func) {
1693
+ if (func != null) {
1694
+ try {
1695
+ return funcToString$2.call(func);
1696
+ } catch (e) {
1697
+ }
1698
+ try {
1699
+ return func + "";
1700
+ } catch (e) {
1701
+ }
1702
+ }
1703
+ return "";
1704
+ }
1705
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1706
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1707
+ var funcProto$1 = Function.prototype, objectProto$8 = Object.prototype;
1708
+ var funcToString$1 = funcProto$1.toString;
1709
+ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
1710
+ var reIsNative = RegExp(
1711
+ "^" + funcToString$1.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1712
+ );
1713
+ function baseIsNative(value) {
1714
+ if (!isObject(value) || isMasked(value)) {
1715
+ return false;
1716
+ }
1717
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1718
+ return pattern.test(toSource(value));
1719
+ }
1720
+ function getValue(object, key) {
1721
+ return object == null ? void 0 : object[key];
1722
+ }
1723
+ function getNative(object, key) {
1724
+ var value = getValue(object, key);
1725
+ return baseIsNative(value) ? value : void 0;
1726
+ }
1727
+ var Map$1 = getNative(root$1, "Map");
1728
+ const Map$2 = Map$1;
1729
+ var nativeCreate = getNative(Object, "create");
1730
+ const nativeCreate$1 = nativeCreate;
1731
+ function hashClear() {
1732
+ this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
1733
+ this.size = 0;
1734
+ }
1735
+ function hashDelete(key) {
1736
+ var result = this.has(key) && delete this.__data__[key];
1737
+ this.size -= result ? 1 : 0;
1738
+ return result;
1739
+ }
1740
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
1741
+ var objectProto$7 = Object.prototype;
1742
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
1743
+ function hashGet(key) {
1744
+ var data = this.__data__;
1745
+ if (nativeCreate$1) {
1746
+ var result = data[key];
1747
+ return result === HASH_UNDEFINED$1 ? void 0 : result;
1748
+ }
1749
+ return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
1750
+ }
1751
+ var objectProto$6 = Object.prototype;
1752
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
1753
+ function hashHas(key) {
1754
+ var data = this.__data__;
1755
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
1756
+ }
1757
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1758
+ function hashSet(key, value) {
1759
+ var data = this.__data__;
1760
+ this.size += this.has(key) ? 0 : 1;
1761
+ data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED : value;
1762
+ return this;
1763
+ }
1764
+ function Hash(entries) {
1765
+ var index = -1, length = entries == null ? 0 : entries.length;
1766
+ this.clear();
1767
+ while (++index < length) {
1768
+ var entry = entries[index];
1769
+ this.set(entry[0], entry[1]);
1770
+ }
1771
+ }
1772
+ Hash.prototype.clear = hashClear;
1773
+ Hash.prototype["delete"] = hashDelete;
1774
+ Hash.prototype.get = hashGet;
1775
+ Hash.prototype.has = hashHas;
1776
+ Hash.prototype.set = hashSet;
1777
+ function mapCacheClear() {
1778
+ this.size = 0;
1779
+ this.__data__ = {
1780
+ "hash": new Hash(),
1781
+ "map": new (Map$2 || ListCache)(),
1782
+ "string": new Hash()
1783
+ };
1784
+ }
1785
+ function isKeyable(value) {
1786
+ var type = typeof value;
1787
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1788
+ }
1789
+ function getMapData(map, key) {
1790
+ var data = map.__data__;
1791
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1792
+ }
1793
+ function mapCacheDelete(key) {
1794
+ var result = getMapData(this, key)["delete"](key);
1795
+ this.size -= result ? 1 : 0;
1796
+ return result;
1797
+ }
1798
+ function mapCacheGet(key) {
1799
+ return getMapData(this, key).get(key);
1800
+ }
1801
+ function mapCacheHas(key) {
1802
+ return getMapData(this, key).has(key);
1803
+ }
1804
+ function mapCacheSet(key, value) {
1805
+ var data = getMapData(this, key), size = data.size;
1806
+ data.set(key, value);
1807
+ this.size += data.size == size ? 0 : 1;
1808
+ return this;
1809
+ }
1810
+ function MapCache(entries) {
1811
+ var index = -1, length = entries == null ? 0 : entries.length;
1812
+ this.clear();
1813
+ while (++index < length) {
1814
+ var entry = entries[index];
1815
+ this.set(entry[0], entry[1]);
1816
+ }
1817
+ }
1818
+ MapCache.prototype.clear = mapCacheClear;
1819
+ MapCache.prototype["delete"] = mapCacheDelete;
1820
+ MapCache.prototype.get = mapCacheGet;
1821
+ MapCache.prototype.has = mapCacheHas;
1822
+ MapCache.prototype.set = mapCacheSet;
1823
+ var LARGE_ARRAY_SIZE = 200;
1824
+ function stackSet(key, value) {
1825
+ var data = this.__data__;
1826
+ if (data instanceof ListCache) {
1827
+ var pairs = data.__data__;
1828
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
1829
+ pairs.push([key, value]);
1830
+ this.size = ++data.size;
1831
+ return this;
1832
+ }
1833
+ data = this.__data__ = new MapCache(pairs);
1834
+ }
1835
+ data.set(key, value);
1836
+ this.size = data.size;
1837
+ return this;
1838
+ }
1839
+ function Stack(entries) {
1840
+ var data = this.__data__ = new ListCache(entries);
1841
+ this.size = data.size;
1842
+ }
1843
+ Stack.prototype.clear = stackClear;
1844
+ Stack.prototype["delete"] = stackDelete;
1845
+ Stack.prototype.get = stackGet;
1846
+ Stack.prototype.has = stackHas;
1847
+ Stack.prototype.set = stackSet;
1848
+ var defineProperty = function() {
1849
+ try {
1850
+ var func = getNative(Object, "defineProperty");
1851
+ func({}, "", {});
1852
+ return func;
1853
+ } catch (e) {
1854
+ }
1855
+ }();
1856
+ const defineProperty$1 = defineProperty;
1857
+ function baseAssignValue(object, key, value) {
1858
+ if (key == "__proto__" && defineProperty$1) {
1859
+ defineProperty$1(object, key, {
1860
+ "configurable": true,
1861
+ "enumerable": true,
1862
+ "value": value,
1863
+ "writable": true
1864
+ });
1865
+ } else {
1866
+ object[key] = value;
1867
+ }
1868
+ }
1869
+ function assignMergeValue(object, key, value) {
1870
+ if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
1871
+ baseAssignValue(object, key, value);
1872
+ }
1873
+ }
1874
+ function createBaseFor(fromRight) {
1875
+ return function(object, iteratee, keysFunc) {
1876
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
1877
+ while (length--) {
1878
+ var key = props[fromRight ? length : ++index];
1879
+ if (iteratee(iterable[key], key, iterable) === false) {
1880
+ break;
1881
+ }
1882
+ }
1883
+ return object;
1884
+ };
1885
+ }
1886
+ var baseFor = createBaseFor();
1887
+ const baseFor$1 = baseFor;
1888
+ var freeExports$2 = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
1889
+ var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
1890
+ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
1891
+ var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
1892
+ function cloneBuffer(buffer, isDeep) {
1893
+ if (isDeep) {
1894
+ return buffer.slice();
1895
+ }
1896
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1897
+ buffer.copy(result);
1898
+ return result;
1899
+ }
1900
+ var Uint8Array = root$1.Uint8Array;
1901
+ const Uint8Array$1 = Uint8Array;
1902
+ function cloneArrayBuffer(arrayBuffer) {
1903
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1904
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1905
+ return result;
1906
+ }
1907
+ function cloneTypedArray(typedArray, isDeep) {
1908
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1909
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1910
+ }
1911
+ function copyArray(source, array) {
1912
+ var index = -1, length = source.length;
1913
+ array || (array = Array(length));
1914
+ while (++index < length) {
1915
+ array[index] = source[index];
1916
+ }
1917
+ return array;
1918
+ }
1919
+ var objectCreate = Object.create;
1920
+ var baseCreate = function() {
1921
+ function object() {
1922
+ }
1923
+ return function(proto) {
1924
+ if (!isObject(proto)) {
1925
+ return {};
1926
+ }
1927
+ if (objectCreate) {
1928
+ return objectCreate(proto);
1929
+ }
1930
+ object.prototype = proto;
1931
+ var result = new object();
1932
+ object.prototype = void 0;
1933
+ return result;
1934
+ };
1935
+ }();
1936
+ const baseCreate$1 = baseCreate;
1937
+ function overArg(func, transform) {
1938
+ return function(arg) {
1939
+ return func(transform(arg));
1940
+ };
1941
+ }
1942
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
1943
+ const getPrototype$1 = getPrototype;
1944
+ var objectProto$5 = Object.prototype;
1945
+ function isPrototype(value) {
1946
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$5;
1947
+ return value === proto;
1948
+ }
1949
+ function initCloneObject(object) {
1950
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
1951
+ }
1952
+ function isObjectLike(value) {
1953
+ return value != null && typeof value == "object";
1954
+ }
1955
+ var argsTag$1 = "[object Arguments]";
1956
+ function baseIsArguments(value) {
1957
+ return isObjectLike(value) && baseGetTag(value) == argsTag$1;
1958
+ }
1959
+ var objectProto$4 = Object.prototype;
1960
+ var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
1961
+ var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
1962
+ var isArguments = baseIsArguments(function() {
1963
+ return arguments;
1964
+ }()) ? baseIsArguments : function(value) {
1965
+ return isObjectLike(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1966
+ };
1967
+ const isArguments$1 = isArguments;
1968
+ var isArray = Array.isArray;
1969
+ const isArray$1 = isArray;
1970
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1971
+ function isLength(value) {
1972
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
1973
+ }
1974
+ function isArrayLike(value) {
1975
+ return value != null && isLength(value.length) && !isFunction(value);
1976
+ }
1977
+ function isArrayLikeObject(value) {
1978
+ return isObjectLike(value) && isArrayLike(value);
1979
+ }
1980
+ function stubFalse() {
1981
+ return false;
1982
+ }
1983
+ var freeExports$1 = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
1984
+ var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
1985
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
1986
+ var Buffer = moduleExports$1 ? root$1.Buffer : void 0;
1987
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
1988
+ var isBuffer = nativeIsBuffer || stubFalse;
1989
+ const isBuffer$1 = isBuffer;
1990
+ var objectTag$1 = "[object Object]";
1991
+ var funcProto = Function.prototype, objectProto$3 = Object.prototype;
1992
+ var funcToString = funcProto.toString;
1993
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
1994
+ var objectCtorString = funcToString.call(Object);
1995
+ function isPlainObject(value) {
1996
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag$1) {
1997
+ return false;
1998
+ }
1999
+ var proto = getPrototype$1(value);
2000
+ if (proto === null) {
2001
+ return true;
2002
+ }
2003
+ var Ctor = hasOwnProperty$3.call(proto, "constructor") && proto.constructor;
2004
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
2005
+ }
2006
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
2007
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
2008
+ var typedArrayTags = {};
2009
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
2010
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
2011
+ function baseIsTypedArray(value) {
2012
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2013
+ }
2014
+ function baseUnary(func) {
2015
+ return function(value) {
2016
+ return func(value);
2017
+ };
2018
+ }
2019
+ var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
2020
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
2021
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2022
+ var freeProcess = moduleExports && freeGlobal$1.process;
2023
+ var nodeUtil = function() {
2024
+ try {
2025
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
2026
+ if (types) {
2027
+ return types;
2028
+ }
2029
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
2030
+ } catch (e) {
2031
+ }
2032
+ }();
2033
+ const nodeUtil$1 = nodeUtil;
2034
+ var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
2035
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2036
+ const isTypedArray$1 = isTypedArray;
2037
+ function safeGet(object, key) {
2038
+ if (key === "constructor" && typeof object[key] === "function") {
2039
+ return;
2040
+ }
2041
+ if (key == "__proto__") {
2042
+ return;
2043
+ }
2044
+ return object[key];
2045
+ }
2046
+ var objectProto$2 = Object.prototype;
2047
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2048
+ function assignValue(object, key, value) {
2049
+ var objValue = object[key];
2050
+ if (!(hasOwnProperty$2.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
2051
+ baseAssignValue(object, key, value);
2052
+ }
2053
+ }
2054
+ function copyObject(source, props, object, customizer) {
2055
+ var isNew = !object;
2056
+ object || (object = {});
2057
+ var index = -1, length = props.length;
2058
+ while (++index < length) {
2059
+ var key = props[index];
2060
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
2061
+ if (newValue === void 0) {
2062
+ newValue = source[key];
2063
+ }
2064
+ if (isNew) {
2065
+ baseAssignValue(object, key, newValue);
2066
+ } else {
2067
+ assignValue(object, key, newValue);
2068
+ }
2069
+ }
2070
+ return object;
2071
+ }
2072
+ function baseTimes(n, iteratee) {
2073
+ var index = -1, result = Array(n);
2074
+ while (++index < n) {
2075
+ result[index] = iteratee(index);
2076
+ }
2077
+ return result;
2078
+ }
2079
+ var MAX_SAFE_INTEGER = 9007199254740991;
2080
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2081
+ function isIndex(value, length) {
2082
+ var type = typeof value;
2083
+ length = length == null ? MAX_SAFE_INTEGER : length;
2084
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2085
+ }
2086
+ var objectProto$1 = Object.prototype;
2087
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2088
+ function arrayLikeKeys(value, inherited) {
2089
+ var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
2090
+ for (var key in value) {
2091
+ if ((inherited || hasOwnProperty$1.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2092
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2093
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2094
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2095
+ isIndex(key, length)))) {
2096
+ result.push(key);
2097
+ }
2098
+ }
2099
+ return result;
2100
+ }
2101
+ function nativeKeysIn(object) {
2102
+ var result = [];
2103
+ if (object != null) {
2104
+ for (var key in Object(object)) {
2105
+ result.push(key);
2106
+ }
2107
+ }
2108
+ return result;
2109
+ }
2110
+ var objectProto = Object.prototype;
2111
+ var hasOwnProperty = objectProto.hasOwnProperty;
2112
+ function baseKeysIn(object) {
2113
+ if (!isObject(object)) {
2114
+ return nativeKeysIn(object);
2115
+ }
2116
+ var isProto = isPrototype(object), result = [];
2117
+ for (var key in object) {
2118
+ if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
2119
+ result.push(key);
2120
+ }
2121
+ }
2122
+ return result;
2123
+ }
2124
+ function keysIn(object) {
2125
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
2126
+ }
2127
+ function toPlainObject(value) {
2128
+ return copyObject(value, keysIn(value));
2129
+ }
2130
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
2131
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
2132
+ if (stacked) {
2133
+ assignMergeValue(object, key, stacked);
2134
+ return;
2135
+ }
2136
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
2137
+ var isCommon = newValue === void 0;
2138
+ if (isCommon) {
2139
+ var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue);
2140
+ newValue = srcValue;
2141
+ if (isArr || isBuff || isTyped) {
2142
+ if (isArray$1(objValue)) {
2143
+ newValue = objValue;
2144
+ } else if (isArrayLikeObject(objValue)) {
2145
+ newValue = copyArray(objValue);
2146
+ } else if (isBuff) {
2147
+ isCommon = false;
2148
+ newValue = cloneBuffer(srcValue, true);
2149
+ } else if (isTyped) {
2150
+ isCommon = false;
2151
+ newValue = cloneTypedArray(srcValue, true);
2152
+ } else {
2153
+ newValue = [];
2154
+ }
2155
+ } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) {
2156
+ newValue = objValue;
2157
+ if (isArguments$1(objValue)) {
2158
+ newValue = toPlainObject(objValue);
2159
+ } else if (!isObject(objValue) || isFunction(objValue)) {
2160
+ newValue = initCloneObject(srcValue);
2161
+ }
2162
+ } else {
2163
+ isCommon = false;
2164
+ }
2165
+ }
2166
+ if (isCommon) {
2167
+ stack.set(srcValue, newValue);
2168
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
2169
+ stack["delete"](srcValue);
2170
+ }
2171
+ assignMergeValue(object, key, newValue);
2172
+ }
2173
+ function baseMerge(object, source, srcIndex, customizer, stack) {
2174
+ if (object === source) {
2175
+ return;
2176
+ }
2177
+ baseFor$1(source, function(srcValue, key) {
2178
+ stack || (stack = new Stack());
2179
+ if (isObject(srcValue)) {
2180
+ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
2181
+ } else {
2182
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
2183
+ if (newValue === void 0) {
2184
+ newValue = srcValue;
2185
+ }
2186
+ assignMergeValue(object, key, newValue);
2187
+ }
2188
+ }, keysIn);
2189
+ }
2190
+ function identity(value) {
2191
+ return value;
2192
+ }
2193
+ function apply(func, thisArg, args) {
2194
+ switch (args.length) {
2195
+ case 0:
2196
+ return func.call(thisArg);
2197
+ case 1:
2198
+ return func.call(thisArg, args[0]);
2199
+ case 2:
2200
+ return func.call(thisArg, args[0], args[1]);
2201
+ case 3:
2202
+ return func.call(thisArg, args[0], args[1], args[2]);
2203
+ }
2204
+ return func.apply(thisArg, args);
2205
+ }
2206
+ var nativeMax = Math.max;
2207
+ function overRest(func, start2, transform) {
2208
+ start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
2209
+ return function() {
2210
+ var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length);
2211
+ while (++index < length) {
2212
+ array[index] = args[start2 + index];
2213
+ }
2214
+ index = -1;
2215
+ var otherArgs = Array(start2 + 1);
2216
+ while (++index < start2) {
2217
+ otherArgs[index] = args[index];
2218
+ }
2219
+ otherArgs[start2] = transform(array);
2220
+ return apply(func, this, otherArgs);
2221
+ };
2222
+ }
2223
+ function constant(value) {
2224
+ return function() {
2225
+ return value;
2226
+ };
2227
+ }
2228
+ var baseSetToString = !defineProperty$1 ? identity : function(func, string) {
2229
+ return defineProperty$1(func, "toString", {
2230
+ "configurable": true,
2231
+ "enumerable": false,
2232
+ "value": constant(string),
2233
+ "writable": true
2234
+ });
2235
+ };
2236
+ const baseSetToString$1 = baseSetToString;
2237
+ var HOT_COUNT = 800, HOT_SPAN = 16;
2238
+ var nativeNow = Date.now;
2239
+ function shortOut(func) {
2240
+ var count = 0, lastCalled = 0;
2241
+ return function() {
2242
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
2243
+ lastCalled = stamp;
2244
+ if (remaining > 0) {
2245
+ if (++count >= HOT_COUNT) {
2246
+ return arguments[0];
2247
+ }
2248
+ } else {
2249
+ count = 0;
2250
+ }
2251
+ return func.apply(void 0, arguments);
2252
+ };
2253
+ }
2254
+ var setToString = shortOut(baseSetToString$1);
2255
+ const setToString$1 = setToString;
2256
+ function baseRest(func, start2) {
2257
+ return setToString$1(overRest(func, start2, identity), func + "");
2258
+ }
2259
+ function isIterateeCall(value, index, object) {
2260
+ if (!isObject(object)) {
2261
+ return false;
2262
+ }
2263
+ var type = typeof index;
2264
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
2265
+ return eq(object[index], value);
2266
+ }
2267
+ return false;
2268
+ }
2269
+ function createAssigner(assigner) {
2270
+ return baseRest(function(object, sources) {
2271
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
2272
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
2273
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
2274
+ customizer = length < 3 ? void 0 : customizer;
2275
+ length = 1;
2276
+ }
2277
+ object = Object(object);
2278
+ while (++index < length) {
2279
+ var source = sources[index];
2280
+ if (source) {
2281
+ assigner(object, source, index, customizer);
2282
+ }
2283
+ }
2284
+ return object;
2285
+ });
2286
+ }
2287
+ var merge = createAssigner(function(object, source, srcIndex) {
2288
+ baseMerge(object, source, srcIndex);
2289
+ });
2290
+ const merge$1 = merge;
1533
2291
  var ThemeContext = React.createContext({
1534
2292
  theme: commonTheme
1535
2293
  });
@@ -1538,7 +2296,7 @@
1538
2296
  var components = theme.components;
1539
2297
  var _components_componentName;
1540
2298
  var newStyles = React.useMemo(function() {
1541
- return lodash.merge({}, styles2, (_components_componentName = components === null || components === void 0 ? void 0 : components[componentName]) !== null && _components_componentName !== void 0 ? _components_componentName : {}, tweakStyles);
2299
+ return merge$1({}, styles2, (_components_componentName = components === null || components === void 0 ? void 0 : components[componentName]) !== null && _components_componentName !== void 0 ? _components_componentName : {}, tweakStyles);
1542
2300
  }, [
1543
2301
  styles2,
1544
2302
  components === null || components === void 0 ? void 0 : components[componentName],
@@ -3152,11 +3910,11 @@
3152
3910
  arr2[i] = arr[i];
3153
3911
  return arr2;
3154
3912
  }
3155
- function _array_without_holes$4(arr) {
3913
+ function _array_without_holes$5(arr) {
3156
3914
  if (Array.isArray(arr))
3157
3915
  return _array_like_to_array$o(arr);
3158
3916
  }
3159
- function _define_property$O(obj, key, value) {
3917
+ function _define_property$P(obj, key, value) {
3160
3918
  if (key in obj) {
3161
3919
  Object.defineProperty(obj, key, {
3162
3920
  value,
@@ -3169,11 +3927,11 @@
3169
3927
  }
3170
3928
  return obj;
3171
3929
  }
3172
- function _iterable_to_array$4(iter) {
3930
+ function _iterable_to_array$5(iter) {
3173
3931
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
3174
3932
  return Array.from(iter);
3175
3933
  }
3176
- function _non_iterable_spread$4() {
3934
+ function _non_iterable_spread$5() {
3177
3935
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3178
3936
  }
3179
3937
  function _object_spread$N(target) {
@@ -3186,13 +3944,13 @@
3186
3944
  }));
3187
3945
  }
3188
3946
  ownKeys2.forEach(function(key) {
3189
- _define_property$O(target, key, source[key]);
3947
+ _define_property$P(target, key, source[key]);
3190
3948
  });
3191
3949
  }
3192
3950
  return target;
3193
3951
  }
3194
- function _to_consumable_array$4(arr) {
3195
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$o(arr) || _non_iterable_spread$4();
3952
+ function _to_consumable_array$5(arr) {
3953
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$o(arr) || _non_iterable_spread$5();
3196
3954
  }
3197
3955
  function _unsupported_iterable_to_array$o(o, minLen) {
3198
3956
  if (!o)
@@ -3228,7 +3986,7 @@
3228
3986
  popperData = usePopper(referenceElement, dropdownElement, {
3229
3987
  enabled: isOpen,
3230
3988
  placement,
3231
- modifiers: _to_consumable_array$4(shouldRenderInBody ? [
3989
+ modifiers: _to_consumable_array$5(shouldRenderInBody ? [
3232
3990
  minWidthModifier
3233
3991
  ] : []).concat([
3234
3992
  {
@@ -3251,7 +4009,7 @@
3251
4009
  ]
3252
4010
  }, flipOptions)
3253
4011
  }
3254
- ], _to_consumable_array$4(modifiers))
4012
+ ], _to_consumable_array$5(modifiers))
3255
4013
  });
3256
4014
  }
3257
4015
  React.useEffect(function() {
@@ -3264,7 +4022,7 @@
3264
4022
  var useTweakStyles = function() {
3265
4023
  var componentStyles = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, tweakStyles = arguments.length > 1 ? arguments[1] : void 0, className = arguments.length > 2 ? arguments[2] : void 0;
3266
4024
  return React.useMemo(function() {
3267
- return lodash.merge({}, componentStyles[className], tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles[className]);
4025
+ return merge$1({}, componentStyles[className], tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles[className]);
3268
4026
  }, [
3269
4027
  tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles[className]
3270
4028
  ]);
@@ -4111,7 +4869,7 @@
4111
4869
  ]
4112
4870
  }
4113
4871
  });
4114
- function _define_property$N(obj, key, value) {
4872
+ function _define_property$O(obj, key, value) {
4115
4873
  if (key in obj) {
4116
4874
  Object.defineProperty(obj, key, {
4117
4875
  value,
@@ -4134,7 +4892,7 @@
4134
4892
  }));
4135
4893
  }
4136
4894
  ownKeys2.forEach(function(key) {
4137
- _define_property$N(target, key, source[key]);
4895
+ _define_property$O(target, key, source[key]);
4138
4896
  });
4139
4897
  }
4140
4898
  return target;
@@ -4261,7 +5019,7 @@
4261
5019
  var complexIcons = {
4262
5020
  avatar: avatarGreen
4263
5021
  };
4264
- function _define_property$M(obj, key, value) {
5022
+ function _define_property$N(obj, key, value) {
4265
5023
  if (key in obj) {
4266
5024
  Object.defineProperty(obj, key, {
4267
5025
  value,
@@ -4284,7 +5042,7 @@
4284
5042
  }));
4285
5043
  }
4286
5044
  ownKeys2.forEach(function(key) {
4287
- _define_property$M(target, key, source[key]);
5045
+ _define_property$N(target, key, source[key]);
4288
5046
  });
4289
5047
  }
4290
5048
  return target;
@@ -4308,7 +5066,7 @@
4308
5066
  alignItems: "center"
4309
5067
  }
4310
5068
  };
4311
- function _define_property$L(obj, key, value) {
5069
+ function _define_property$M(obj, key, value) {
4312
5070
  if (key in obj) {
4313
5071
  Object.defineProperty(obj, key, {
4314
5072
  value,
@@ -4331,7 +5089,7 @@
4331
5089
  }));
4332
5090
  }
4333
5091
  ownKeys2.forEach(function(key) {
4334
- _define_property$L(target, key, source[key]);
5092
+ _define_property$M(target, key, source[key]);
4335
5093
  });
4336
5094
  }
4337
5095
  return target;
@@ -4422,7 +5180,7 @@
4422
5180
  },
4423
5181
  content: {}
4424
5182
  };
4425
- function _define_property$K(obj, key, value) {
5183
+ function _define_property$L(obj, key, value) {
4426
5184
  if (key in obj) {
4427
5185
  Object.defineProperty(obj, key, {
4428
5186
  value,
@@ -4445,7 +5203,7 @@
4445
5203
  }));
4446
5204
  }
4447
5205
  ownKeys2.forEach(function(key) {
4448
- _define_property$K(target, key, source[key]);
5206
+ _define_property$L(target, key, source[key]);
4449
5207
  });
4450
5208
  }
4451
5209
  return target;
@@ -4493,7 +5251,7 @@
4493
5251
  className: classes.spacer
4494
5252
  }),
4495
5253
  /* @__PURE__ */ jsxs("div", _object_spread_props$A(_object_spread$J({
4496
- className: clsx(classes.item, (_obj = {}, _define_property$K(_obj, classes.disabledItem, item.disabled), _define_property$K(_obj, classes.withIconGap, item.withIconGap), _obj))
5254
+ className: clsx(classes.item, (_obj = {}, _define_property$L(_obj, classes.disabledItem, item.disabled), _define_property$L(_obj, classes.withIconGap, item.withIconGap), _obj))
4497
5255
  }, addDataTestId((_item_testId = item.testId) !== null && _item_testId !== void 0 ? _item_testId : getTestId(testId, "item-".concat(idx))), item.disabled && addDataAttributes({
4498
5256
  disabled: item.disabled
4499
5257
  })), {
@@ -4521,7 +5279,7 @@
4521
5279
  })
4522
5280
  }));
4523
5281
  };
4524
- function _define_property$J(obj, key, value) {
5282
+ function _define_property$K(obj, key, value) {
4525
5283
  if (key in obj) {
4526
5284
  Object.defineProperty(obj, key, {
4527
5285
  value,
@@ -4544,7 +5302,7 @@
4544
5302
  }));
4545
5303
  }
4546
5304
  ownKeys2.forEach(function(key) {
4547
- _define_property$J(target, key, source[key]);
5305
+ _define_property$K(target, key, source[key]);
4548
5306
  });
4549
5307
  }
4550
5308
  return target;
@@ -4628,7 +5386,7 @@
4628
5386
  if (Array.isArray(arr))
4629
5387
  return arr;
4630
5388
  }
4631
- function _define_property$I(obj, key, value) {
5389
+ function _define_property$J(obj, key, value) {
4632
5390
  if (key in obj) {
4633
5391
  Object.defineProperty(obj, key, {
4634
5392
  value,
@@ -4682,7 +5440,7 @@
4682
5440
  }));
4683
5441
  }
4684
5442
  ownKeys2.forEach(function(key) {
4685
- _define_property$I(target, key, source[key]);
5443
+ _define_property$J(target, key, source[key]);
4686
5444
  });
4687
5445
  }
4688
5446
  return target;
@@ -4823,7 +5581,7 @@
4823
5581
  width: "100%"
4824
5582
  }
4825
5583
  };
4826
- function _define_property$H(obj, key, value) {
5584
+ function _define_property$I(obj, key, value) {
4827
5585
  if (key in obj) {
4828
5586
  Object.defineProperty(obj, key, {
4829
5587
  value,
@@ -4846,7 +5604,7 @@
4846
5604
  }));
4847
5605
  }
4848
5606
  ownKeys2.forEach(function(key) {
4849
- _define_property$H(target, key, source[key]);
5607
+ _define_property$I(target, key, source[key]);
4850
5608
  });
4851
5609
  }
4852
5610
  return target;
@@ -5040,7 +5798,7 @@
5040
5798
  },
5041
5799
  tweakPreloaderComponent: {}
5042
5800
  };
5043
- function _define_property$G(obj, key, value) {
5801
+ function _define_property$H(obj, key, value) {
5044
5802
  if (key in obj) {
5045
5803
  Object.defineProperty(obj, key, {
5046
5804
  value,
@@ -5063,7 +5821,7 @@
5063
5821
  }));
5064
5822
  }
5065
5823
  ownKeys2.forEach(function(key) {
5066
- _define_property$G(target, key, source[key]);
5824
+ _define_property$H(target, key, source[key]);
5067
5825
  });
5068
5826
  }
5069
5827
  return target;
@@ -5097,7 +5855,7 @@
5097
5855
  var _useTheme = useTheme("ThemedPreloader", styles$E, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5098
5856
  var preloaderComponentStyles = useTweakStyles(componentStyles, tweakStyles, "tweakPreloaderComponent");
5099
5857
  return /* @__PURE__ */ jsx("div", _object_spread_props$w(_object_spread$F({
5100
- className: clsx(classes.root, classes[type], _define_property$G({}, classes.currentColor, useCurrentColor))
5858
+ className: clsx(classes.root, classes[type], _define_property$H({}, classes.currentColor, useCurrentColor))
5101
5859
  }, addDataAttributes(data)), {
5102
5860
  children: type === "dots" ? /* @__PURE__ */ jsx(DotsPreloader, {
5103
5861
  tweakStyles: preloaderComponentStyles
@@ -5277,7 +6035,7 @@
5277
6035
  }
5278
6036
  }
5279
6037
  };
5280
- function _define_property$F(obj, key, value) {
6038
+ function _define_property$G(obj, key, value) {
5281
6039
  if (key in obj) {
5282
6040
  Object.defineProperty(obj, key, {
5283
6041
  value,
@@ -5300,7 +6058,7 @@
5300
6058
  }));
5301
6059
  }
5302
6060
  ownKeys2.forEach(function(key) {
5303
- _define_property$F(target, key, source[key]);
6061
+ _define_property$G(target, key, source[key]);
5304
6062
  });
5305
6063
  }
5306
6064
  return target;
@@ -5342,7 +6100,7 @@
5342
6100
  var _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "l" : _param_size, _param_view = param.view, view = _param_view === void 0 ? "primary" : _param_view, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? false : _param_isFullWidth, _param_isInline = param.isInline, isInline = _param_isInline === void 0 ? false : _param_isInline, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_shouldSkipTabNavigation = param.shouldSkipTabNavigation, shouldSkipTabNavigation = _param_shouldSkipTabNavigation === void 0 ? false : _param_shouldSkipTabNavigation, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, icon = param.icon, _param_iconPosition = param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "left" : _param_iconPosition, _param_preloaderType = param.preloaderType, preloaderType = _param_preloaderType === void 0 ? "dots" : _param_preloaderType, onClick = param.onClick, onMouseDown = param.onMouseDown;
5343
6101
  var _useTheme = useTheme("Button", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5344
6102
  var tweakPreloaderStyles = React.useMemo(function() {
5345
- return lodash.merge({}, size === "s" || size === "m" ? dotsPreloaderStyles : void 0, componentStyles.tweakPreloader, tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader);
6103
+ return merge$1({}, size === "s" || size === "m" ? dotsPreloaderStyles : void 0, componentStyles.tweakPreloader, tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader);
5346
6104
  }, [
5347
6105
  tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader,
5348
6106
  size
@@ -5353,7 +6111,7 @@
5353
6111
  var _obj, _obj1;
5354
6112
  return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
5355
6113
  type,
5356
- className: clsx(classes.root, classes[size], classes[view], (_obj = {}, _define_property$F(_obj, classes.disabled, isDisabled), _define_property$F(_obj, classes.fullWidth, isFullWidth), _define_property$F(_obj, classes.inline, isInline), _define_property$F(_obj, classes.active, isActive), _define_property$F(_obj, classes.loading, isLoading), _define_property$F(_obj, classes.onlyIcon, hasIcon && !hasChildren), _obj)),
6114
+ className: clsx(classes.root, classes[size], classes[view], (_obj = {}, _define_property$G(_obj, classes.disabled, isDisabled), _define_property$G(_obj, classes.fullWidth, isFullWidth), _define_property$G(_obj, classes.inline, isInline), _define_property$G(_obj, classes.active, isActive), _define_property$G(_obj, classes.loading, isLoading), _define_property$G(_obj, classes.onlyIcon, hasIcon && !hasChildren), _obj)),
5357
6115
  tabIndex: shouldSkipTabNavigation ? -1 : void 0,
5358
6116
  disabled: hasNoAction,
5359
6117
  onClick: !hasNoAction ? onClick : void 0,
@@ -5361,7 +6119,7 @@
5361
6119
  }, addDataTestId(testId), addDataAttributes(data)), {
5362
6120
  children: [
5363
6121
  /* @__PURE__ */ jsxs("span", {
5364
- className: clsx(classes.content, (_obj1 = {}, _define_property$F(_obj1, classes.iconFromRight, hasChildren && hasIcon && iconPosition === "right"), _define_property$F(_obj1, classes.iconFromLeft, hasChildren && hasIcon && iconPosition === "left"), _obj1)),
6122
+ className: clsx(classes.content, (_obj1 = {}, _define_property$G(_obj1, classes.iconFromRight, hasChildren && hasIcon && iconPosition === "right"), _define_property$G(_obj1, classes.iconFromLeft, hasChildren && hasIcon && iconPosition === "left"), _obj1)),
5365
6123
  children: [
5366
6124
  hasIcon && /* @__PURE__ */ jsx("span", {
5367
6125
  className: classes.icon,
@@ -5453,7 +6211,7 @@
5453
6211
  if (Array.isArray(arr))
5454
6212
  return arr;
5455
6213
  }
5456
- function _define_property$E(obj, key, value) {
6214
+ function _define_property$F(obj, key, value) {
5457
6215
  if (key in obj) {
5458
6216
  Object.defineProperty(obj, key, {
5459
6217
  value,
@@ -5507,7 +6265,7 @@
5507
6265
  }));
5508
6266
  }
5509
6267
  ownKeys2.forEach(function(key) {
5510
- _define_property$E(target, key, source[key]);
6268
+ _define_property$F(target, key, source[key]);
5511
6269
  });
5512
6270
  }
5513
6271
  return target;
@@ -5576,7 +6334,7 @@
5576
6334
  ]);
5577
6335
  var _obj;
5578
6336
  return /* @__PURE__ */ jsxs("label", _object_spread_props$u(_object_spread$D({
5579
- className: clsx(classes.root, (_obj = {}, _define_property$E(_obj, classes.disabled, isDisabled), _define_property$E(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
6337
+ className: clsx(classes.root, (_obj = {}, _define_property$F(_obj, classes.disabled, isDisabled), _define_property$F(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
5580
6338
  }, addDataTestId(testId), addDataAttributes(data)), {
5581
6339
  children: [
5582
6340
  /* @__PURE__ */ jsx("input", _object_spread$D({
@@ -5627,7 +6385,7 @@
5627
6385
  }
5628
6386
  }
5629
6387
  };
5630
- function _define_property$D(obj, key, value) {
6388
+ function _define_property$E(obj, key, value) {
5631
6389
  if (key in obj) {
5632
6390
  Object.defineProperty(obj, key, {
5633
6391
  value,
@@ -5650,7 +6408,7 @@
5650
6408
  }));
5651
6409
  }
5652
6410
  ownKeys2.forEach(function(key) {
5653
- _define_property$D(target, key, source[key]);
6411
+ _define_property$E(target, key, source[key]);
5654
6412
  });
5655
6413
  }
5656
6414
  return target;
@@ -5825,7 +6583,7 @@
5825
6583
  },
5826
6584
  root: {}
5827
6585
  };
5828
- function _define_property$C(obj, key, value) {
6586
+ function _define_property$D(obj, key, value) {
5829
6587
  if (key in obj) {
5830
6588
  Object.defineProperty(obj, key, {
5831
6589
  value,
@@ -5848,7 +6606,7 @@
5848
6606
  }));
5849
6607
  }
5850
6608
  ownKeys2.forEach(function(key) {
5851
- _define_property$C(target, key, source[key]);
6609
+ _define_property$D(target, key, source[key]);
5852
6610
  });
5853
6611
  }
5854
6612
  return target;
@@ -6133,6 +6891,7 @@
6133
6891
  paddingLeft: 13
6134
6892
  },
6135
6893
  loading: {},
6894
+ withUnits: {},
6136
6895
  tweakPreloader: {}
6137
6896
  };
6138
6897
  var renderIcon = function(icon) {
@@ -6180,7 +6939,7 @@
6180
6939
  });
6181
6940
  };
6182
6941
  }
6183
- function _define_property$B(obj, key, value) {
6942
+ function _define_property$C(obj, key, value) {
6184
6943
  if (key in obj) {
6185
6944
  Object.defineProperty(obj, key, {
6186
6945
  value,
@@ -6234,7 +6993,7 @@
6234
6993
  }));
6235
6994
  }
6236
6995
  ownKeys2.forEach(function(key) {
6237
- _define_property$B(target, key, source[key]);
6996
+ _define_property$C(target, key, source[key]);
6238
6997
  });
6239
6998
  }
6240
6999
  return target;
@@ -6429,9 +7188,10 @@
6429
7188
  var hasUnits = units !== void 0 && units !== "";
6430
7189
  var hasLabel = isNotEmpty(label);
6431
7190
  var hasPlaceholder = (!hasLabel || hasFocus && !isReadonly) && isNotEmpty(placeholder);
7191
+ var shouldShowUnits = (hasValue || isFocused && !hasPlaceholder) && hasUnits;
6432
7192
  var _obj;
6433
7193
  var props = _object_spread$A({
6434
- className: clsx(classes.input, (_obj = {}, _define_property$B(_obj, classes.withFloatingLabel, hasFloatingLabel && hasLabel), _define_property$B(_obj, classes.withIcons, hasControls), _define_property$B(_obj, classes.withControls, hasControls), _define_property$B(_obj, classes.floatingLabelWithoutPadding, hasFloatingLabel && hasLabel && border === "bottom"), _obj)),
7194
+ className: clsx(classes.input, (_obj = {}, _define_property$C(_obj, classes.withFloatingLabel, hasFloatingLabel && hasLabel), _define_property$C(_obj, classes.withIcons, hasControls), _define_property$C(_obj, classes.withControls, hasControls), _define_property$C(_obj, classes.withUnits, shouldShowUnits), _define_property$C(_obj, classes.floatingLabelWithoutPadding, hasFloatingLabel && hasLabel && border === "bottom"), _obj)),
6435
7195
  onFocus: handleFocus,
6436
7196
  onBlur: handleBlur,
6437
7197
  onChange: handleChange,
@@ -6454,7 +7214,7 @@
6454
7214
  className: classes.root,
6455
7215
  children: [
6456
7216
  /* @__PURE__ */ jsxs("div", _object_spread_props$s(_object_spread$A({
6457
- className: clsx(classes.inputWrapper, (_obj1 = {}, _define_property$B(_obj1, classes.required, isRequired && !hasRequiredLabel), _define_property$B(_obj1, classes.invalid, isInvalid), _define_property$B(_obj1, classes.focused, hasFocus), _define_property$B(_obj1, classes.disabled, isDisabled), _define_property$B(_obj1, classes.autosize, isAutoSizeable), _obj1), inlineStyle !== void 0 && classes[inlineStyle], border !== void 0 && classes["border-".concat(border)]),
7217
+ className: clsx(classes.inputWrapper, (_obj1 = {}, _define_property$C(_obj1, classes.required, isRequired && !hasRequiredLabel), _define_property$C(_obj1, classes.invalid, isInvalid), _define_property$C(_obj1, classes.focused, hasFocus), _define_property$C(_obj1, classes.disabled, isDisabled), _define_property$C(_obj1, classes.autosize, isAutoSizeable), _obj1), inlineStyle !== void 0 && classes[inlineStyle], border !== void 0 && classes["border-".concat(border)]),
6458
7218
  "data-value": isAutoSizeable ? value : void 0
6459
7219
  }, addDataAttributes(data)), {
6460
7220
  children: [
@@ -6468,12 +7228,12 @@
6468
7228
  beforeMaskedStateChange
6469
7229
  }, props)),
6470
7230
  hasLabel && /* @__PURE__ */ jsx("span", {
6471
- className: clsx(classes.label, (_obj2 = {}, _define_property$B(_obj2, classes.invalidLabel, isInvalid), _define_property$B(_obj2, classes.requiredLabel, hasRequiredLabel && !isRequired), _define_property$B(_obj2, classes.activeLabel, hasFocus && !isReadonly || hasValue), _define_property$B(_obj2, classes.floating, hasFloatingLabel), // Обсуждаемо, сделал так, потому что не хочется создавать новую пропсу, на каждый чих в стилях
6472
- _define_property$B(_obj2, classes.floatingWithoutPadding, hasFloatingLabel && border === "bottom"), _obj2)),
7231
+ className: clsx(classes.label, (_obj2 = {}, _define_property$C(_obj2, classes.invalidLabel, isInvalid), _define_property$C(_obj2, classes.requiredLabel, hasRequiredLabel && !isRequired), _define_property$C(_obj2, classes.activeLabel, hasFocus && !isReadonly || hasValue), _define_property$C(_obj2, classes.floating, hasFloatingLabel), // Обсуждаемо, сделал так, потому что не хочется создавать новую пропсу, на каждый чих в стилях
7232
+ _define_property$C(_obj2, classes.floatingWithoutPadding, hasFloatingLabel && border === "bottom"), _obj2)),
6473
7233
  children: label
6474
7234
  }),
6475
- (hasValue || isFocused && !hasPlaceholder) && hasUnits && /* @__PURE__ */ jsxs("div", {
6476
- className: clsx(classes.unitsWrapper, _define_property$B({}, classes.withFloatingLabel, hasFloatingLabel && hasLabel)),
7235
+ shouldShowUnits && /* @__PURE__ */ jsxs("div", {
7236
+ className: clsx(classes.unitsWrapper, _define_property$C({}, classes.withFloatingLabel, hasFloatingLabel && hasLabel)),
6477
7237
  children: [
6478
7238
  /* @__PURE__ */ jsx("span", {
6479
7239
  className: classes.fakeValue,
@@ -6505,7 +7265,7 @@
6505
7265
  })
6506
7266
  }),
6507
7267
  iconType !== void 0 && /* @__PURE__ */ jsx("div", {
6508
- className: clsx(classes.inputIcon, _define_property$B({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
7268
+ className: clsx(classes.inputIcon, _define_property$C({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
6509
7269
  onClick: !isDisabled ? onIconClick : void 0,
6510
7270
  children: renderIcon(iconType)
6511
7271
  })
@@ -6533,7 +7293,7 @@
6533
7293
  },
6534
7294
  tweakInput: {}
6535
7295
  };
6536
- function _define_property$A(obj, key, value) {
7296
+ function _define_property$B(obj, key, value) {
6537
7297
  if (key in obj) {
6538
7298
  Object.defineProperty(obj, key, {
6539
7299
  value,
@@ -6556,7 +7316,7 @@
6556
7316
  }));
6557
7317
  }
6558
7318
  ownKeys2.forEach(function(key) {
6559
- _define_property$A(target, key, source[key]);
7319
+ _define_property$B(target, key, source[key]);
6560
7320
  });
6561
7321
  }
6562
7322
  return target;
@@ -6710,7 +7470,7 @@
6710
7470
  _defineProperties(Constructor, staticProps);
6711
7471
  return Constructor;
6712
7472
  }
6713
- function _define_property$z(obj, key, value) {
7473
+ function _define_property$A(obj, key, value) {
6714
7474
  if (key in obj) {
6715
7475
  Object.defineProperty(obj, key, {
6716
7476
  value,
@@ -6753,7 +7513,7 @@
6753
7513
  }));
6754
7514
  }
6755
7515
  ownKeys2.forEach(function(key) {
6756
- _define_property$z(target, key, source[key]);
7516
+ _define_property$A(target, key, source[key]);
6757
7517
  });
6758
7518
  }
6759
7519
  return target;
@@ -6851,8 +7611,8 @@
6851
7611
  _class_call_check(this, ScrollIntoViewIfNeeded2);
6852
7612
  var _this;
6853
7613
  _this = _super.apply(this, arguments);
6854
- _define_property$z(_assert_this_initialized(_this), "node", React.createRef());
6855
- _define_property$z(_assert_this_initialized(_this), "handleScrollIntoViewIfNeeded", function() {
7614
+ _define_property$A(_assert_this_initialized(_this), "node", React.createRef());
7615
+ _define_property$A(_assert_this_initialized(_this), "handleScrollIntoViewIfNeeded", function() {
6856
7616
  var options = _this.props.options;
6857
7617
  var _this_node = _this.node, node = _this_node.current;
6858
7618
  if (node) {
@@ -6902,8 +7662,8 @@
6902
7662
  ]);
6903
7663
  return ScrollIntoViewIfNeeded2;
6904
7664
  }(React.PureComponent);
6905
- _define_property$z(ScrollIntoViewIfNeeded, "defaultProps", ScrollIntoViewIfNeededDefaultProps);
6906
- function _define_property$y(obj, key, value) {
7665
+ _define_property$A(ScrollIntoViewIfNeeded, "defaultProps", ScrollIntoViewIfNeededDefaultProps);
7666
+ function _define_property$z(obj, key, value) {
6907
7667
  if (key in obj) {
6908
7668
  Object.defineProperty(obj, key, {
6909
7669
  value,
@@ -6926,7 +7686,7 @@
6926
7686
  }));
6927
7687
  }
6928
7688
  ownKeys2.forEach(function(key) {
6929
- _define_property$y(target, key, source[key]);
7689
+ _define_property$z(target, key, source[key]);
6930
7690
  });
6931
7691
  }
6932
7692
  return target;
@@ -6977,6 +7737,9 @@
6977
7737
  boxSizing: "border-box",
6978
7738
  fontSize: 14
6979
7739
  },
7740
+ cellWithCheckbox: {
7741
+ padding: 0
7742
+ },
6980
7743
  noMatchesLabel: {
6981
7744
  pointerEvents: "none"
6982
7745
  },
@@ -6991,7 +7754,17 @@
6991
7754
  },
6992
7755
  defaultCell: {}
6993
7756
  };
6994
- function _define_property$x(obj, key, value) {
7757
+ var checkboxStyles = {
7758
+ root: {
7759
+ padding: CELL_PADDING,
7760
+ width: "100%"
7761
+ },
7762
+ input: {
7763
+ // иначе будет фокуситься и энтер будет вызывать изменение нескольких опций
7764
+ display: "none"
7765
+ }
7766
+ };
7767
+ function _define_property$y(obj, key, value) {
6995
7768
  if (key in obj) {
6996
7769
  Object.defineProperty(obj, key, {
6997
7770
  value,
@@ -7014,7 +7787,7 @@
7014
7787
  }));
7015
7788
  }
7016
7789
  ownKeys2.forEach(function(key) {
7017
- _define_property$x(target, key, source[key]);
7790
+ _define_property$y(target, key, source[key]);
7018
7791
  });
7019
7792
  }
7020
7793
  return target;
@@ -7043,15 +7816,67 @@
7043
7816
  }
7044
7817
  return target;
7045
7818
  }
7046
- var DEFAULT_OPTION_INDEX = -1;
7819
+ var SelectListItem = function(param) {
7820
+ var classes = param.classes, index = param.index, isSemiChecked = param.isSemiChecked, isDisabled = param.isDisabled, isActive = param.isActive, children = param.children, isFocused = param.isFocused, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox;
7821
+ var isMultiSelect = isNotEmpty(onToggleCheckbox);
7822
+ var _obj;
7823
+ return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
7824
+ active: isFocused,
7825
+ options: {
7826
+ block: "nearest"
7827
+ },
7828
+ className: clsx(classes.cell, (_obj = {}, _define_property$y(_obj, classes.cellWithCheckbox, isMultiSelect), _define_property$y(_obj, classes.focused, isFocused), _define_property$y(_obj, classes.active, isActive && !isMultiSelect), _define_property$y(_obj, classes.disabled, isDisabled), _obj))
7829
+ }, addDataAttributes({
7830
+ disabled: isDisabled,
7831
+ active: isActive,
7832
+ focused: isFocused
7833
+ })), {
7834
+ onClick: !isDisabled && !isMultiSelect ? function(event) {
7835
+ return onOptionSelect(index, event);
7836
+ } : void 0,
7837
+ children: isMultiSelect ? /* @__PURE__ */ jsx(Checkbox, {
7838
+ value: index,
7839
+ isChecked: isActive || isSemiChecked,
7840
+ isSemiChecked,
7841
+ isDisabled,
7842
+ tweakStyles: checkboxStyles,
7843
+ onSelect: function(v) {
7844
+ return onToggleCheckbox(index, v.isSelected);
7845
+ },
7846
+ children
7847
+ }) : children
7848
+ }));
7849
+ };
7850
+ var DEFAULT_OPTION_INDEX = -2;
7851
+ var ALL_OPTION_INDEX = -1;
7852
+ function _define_property$x(obj, key, value) {
7853
+ if (key in obj) {
7854
+ Object.defineProperty(obj, key, {
7855
+ value,
7856
+ enumerable: true,
7857
+ configurable: true,
7858
+ writable: true
7859
+ });
7860
+ } else {
7861
+ obj[key] = value;
7862
+ }
7863
+ return obj;
7864
+ }
7047
7865
  function SelectList(param) {
7048
- var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, customListHeader = param.customListHeader, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
7866
+ var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, customListHeader = param.customListHeader, isOptionDisabled = param.isOptionDisabled, allOptionsLabel = param.allOptionsLabel, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox, convertValueToString = param.convertValueToString, _param_convertValueToReactNode = param.convertValueToReactNode, convertValueToReactNode = _param_convertValueToReactNode === void 0 ? convertValueToString : _param_convertValueToReactNode, convertValueToId = param.convertValueToId;
7049
7867
  var classes = useTheme("SelectList", styles$v, tweakStyles).classes;
7050
- var activeValueId = isNotEmpty(activeValue) ? convertValueToId(activeValue) : void 0;
7051
- var isActiveOption = function(item) {
7052
- return convertValueToId(item) === activeValueId;
7053
- };
7054
- var convertFunction = convertValueToReactNode !== null && convertValueToReactNode !== void 0 ? convertValueToReactNode : convertValueToString;
7868
+ var isMultiSelect = isNotEmpty(onToggleCheckbox);
7869
+ var multiSelectValue = activeValue;
7870
+ var _multiSelectValue_length;
7871
+ var selectedOptionsCount = (_multiSelectValue_length = multiSelectValue === null || multiSelectValue === void 0 ? void 0 : multiSelectValue.length) !== null && _multiSelectValue_length !== void 0 ? _multiSelectValue_length : 0;
7872
+ var _multiSelectValue_map;
7873
+ var activeOptionsIdMap = React.useMemo(function() {
7874
+ return isMultiSelect ? (_multiSelectValue_map = multiSelectValue === null || multiSelectValue === void 0 ? void 0 : multiSelectValue.map(convertValueToId)) !== null && _multiSelectValue_map !== void 0 ? _multiSelectValue_map : [] : [];
7875
+ }, [
7876
+ isMultiSelect,
7877
+ multiSelectValue,
7878
+ convertValueToId
7879
+ ]);
7055
7880
  var optionsDisableMap = React.useMemo(function() {
7056
7881
  return options.map(function(o) {
7057
7882
  return isOptionDisabled(o);
@@ -7062,15 +7887,18 @@
7062
7887
  ]);
7063
7888
  var listOptions = React.useMemo(function() {
7064
7889
  return options.map(function(opt, i) {
7065
- return convertFunction(opt, optionsDisableMap[i]);
7890
+ return convertValueToReactNode(opt, optionsDisableMap[i]);
7066
7891
  });
7067
7892
  }, [
7068
7893
  options,
7069
- convertFunction,
7894
+ convertValueToReactNode,
7070
7895
  optionsDisableMap
7071
7896
  ]);
7897
+ var isActiveOption = function(item) {
7898
+ return isMultiSelect ? activeOptionsIdMap.includes(convertValueToId(item)) : isNotEmpty(activeValue) && convertValueToId(activeValue) === convertValueToId(item);
7899
+ };
7072
7900
  return /* @__PURE__ */ jsxs(ScrollIntoViewIfNeeded, {
7073
- active: shouldScrollToList,
7901
+ active: shouldScrollToList && !isMultiSelect,
7074
7902
  className: clsx(classes.root, _define_property$x({}, classes.withListHeader, isNotEmpty(customListHeader))),
7075
7903
  children: [
7076
7904
  isNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
@@ -7085,39 +7913,42 @@
7085
7913
  children: loadingLabel
7086
7914
  }) : /* @__PURE__ */ jsxs(Fragment, {
7087
7915
  children: [
7088
- defaultOptionLabel !== void 0 && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
7916
+ isNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
7089
7917
  active: focusedIndex === DEFAULT_OPTION_INDEX,
7090
7918
  options: {
7091
7919
  block: "nearest"
7092
7920
  },
7093
7921
  className: clsx(classes.cell, classes.defaultCell, focusedIndex === DEFAULT_OPTION_INDEX && classes.focused),
7094
7922
  onClick: function(event) {
7095
- return onOptionClick(DEFAULT_OPTION_INDEX, event);
7923
+ return onOptionSelect(DEFAULT_OPTION_INDEX, event);
7096
7924
  },
7097
7925
  children: defaultOptionLabel
7098
7926
  }),
7927
+ isNotEmpty(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
7928
+ classes,
7929
+ index: ALL_OPTION_INDEX,
7930
+ isSemiChecked: selectedOptionsCount > 0 && selectedOptionsCount < options.length,
7931
+ isActive: selectedOptionsCount === options.length,
7932
+ isFocused: focusedIndex === ALL_OPTION_INDEX,
7933
+ onOptionSelect,
7934
+ onToggleCheckbox,
7935
+ children: allOptionsLabel
7936
+ }),
7099
7937
  listOptions.map(function(opt, i) {
7100
7938
  var optionValue = options[i];
7101
- var isFocused = i === focusedIndex;
7939
+ var isFocused = focusedIndex === i;
7102
7940
  var isActive = isActiveOption(optionValue);
7103
7941
  var isDisabled = optionsDisableMap[i];
7104
- var _obj;
7105
- return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
7106
- active: isFocused,
7107
- options: {
7108
- block: "nearest"
7109
- },
7110
- className: clsx(classes.cell, (_obj = {}, _define_property$x(_obj, classes.focused, isFocused), _define_property$x(_obj, classes.active, isActive), _define_property$x(_obj, classes.disabled, isDisabled), _obj))
7111
- }, addDataAttributes({
7112
- disabled: isDisabled,
7113
- active: isActive,
7114
- focused: isFocused
7115
- })), {
7116
- onClick: !isDisabled ? function(event) {
7117
- return onOptionClick(i, event);
7118
- } : void 0,
7942
+ return /* @__PURE__ */ jsx(SelectListItem, {
7943
+ classes,
7944
+ index: i,
7945
+ isDisabled,
7946
+ isActive,
7947
+ isFocused,
7948
+ onOptionSelect,
7949
+ onToggleCheckbox,
7119
7950
  children: opt
7120
- }), i);
7951
+ }, i);
7121
7952
  }),
7122
7953
  listOptions.length === 0 && /* @__PURE__ */ jsx("div", {
7123
7954
  className: clsx(classes.cell, classes.noMatchesLabel),
@@ -7139,10 +7970,13 @@
7139
7970
  var defaultCompareFunction = function(v1, v2) {
7140
7971
  return v1 === v2;
7141
7972
  };
7142
- var getActiveValueIndex = function(options, value, convertFunc) {
7143
- return isNotEmpty(value) ? options.findIndex(function(o) {
7144
- return convertFunc(o) === convertFunc(value);
7145
- }) : -1;
7973
+ var getDefaultConvertToIdFunction = function(convertValueToString) {
7974
+ return function(value) {
7975
+ return isNotEmpty(value === null || value === void 0 ? void 0 : value.id) ? String(value.id) : convertValueToString(value);
7976
+ };
7977
+ };
7978
+ var isMultiSelectValue = function(props, _value) {
7979
+ return props.isMultiSelect === true;
7146
7980
  };
7147
7981
  var styles$u = {
7148
7982
  root: {
@@ -7192,6 +8026,21 @@
7192
8026
  input: {
7193
8027
  paddingRight: 32
7194
8028
  },
8029
+ withUnits: {
8030
+ paddingRight: 8
8031
+ },
8032
+ unitsWrapper: {
8033
+ position: "unset",
8034
+ padding: [
8035
+ 0,
8036
+ 32,
8037
+ 0,
8038
+ 0
8039
+ ]
8040
+ },
8041
+ fakeValue: {
8042
+ display: "none"
8043
+ },
7195
8044
  disabled: {
7196
8045
  "& $input": {
7197
8046
  cursor: "default"
@@ -7376,6 +8225,10 @@
7376
8225
  if (Array.isArray(arr))
7377
8226
  return arr;
7378
8227
  }
8228
+ function _array_without_holes$4(arr) {
8229
+ if (Array.isArray(arr))
8230
+ return _array_like_to_array$j(arr);
8231
+ }
7379
8232
  function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
7380
8233
  try {
7381
8234
  var info = gen[key](arg);
@@ -7418,6 +8271,10 @@
7418
8271
  }
7419
8272
  return obj;
7420
8273
  }
8274
+ function _iterable_to_array$4(iter) {
8275
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
8276
+ return Array.from(iter);
8277
+ }
7421
8278
  function _iterable_to_array_limit$j(arr, i) {
7422
8279
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7423
8280
  if (_i == null)
@@ -7449,6 +8306,9 @@
7449
8306
  function _non_iterable_rest$j() {
7450
8307
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7451
8308
  }
8309
+ function _non_iterable_spread$4() {
8310
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8311
+ }
7452
8312
  function _object_spread$u(target) {
7453
8313
  for (var i = 1; i < arguments.length; i++) {
7454
8314
  var source = arguments[i] != null ? arguments[i] : {};
@@ -7523,6 +8383,9 @@
7523
8383
  function _sliced_to_array$j(arr, i) {
7524
8384
  return _array_with_holes$j(arr) || _iterable_to_array_limit$j(arr, i) || _unsupported_iterable_to_array$j(arr, i) || _non_iterable_rest$j();
7525
8385
  }
8386
+ function _to_consumable_array$4(arr) {
8387
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$j(arr) || _non_iterable_spread$4();
8388
+ }
7526
8389
  function _unsupported_iterable_to_array$j(o, minLen) {
7527
8390
  if (!o)
7528
8391
  return;
@@ -7638,11 +8501,12 @@
7638
8501
  };
7639
8502
  }
7640
8503
  };
7641
- function Select(_param) {
7642
- var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isReadonly = _param.isReadonly, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, searchInput = _param.searchInput, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$5(_param, [
8504
+ function Select(props) {
8505
+ var options = props.options, value = props.value, defaultOptionLabel = props.defaultOptionLabel, allOptionsLabel = props.allOptionsLabel, _props_debounceTime = props.debounceTime, debounceTime = _props_debounceTime === void 0 ? 400 : _props_debounceTime, _props_optionsMode = props.optionsMode, optionsMode = _props_optionsMode === void 0 ? "normal" : _props_optionsMode, noMatchesLabel = props.noMatchesLabel, loadingLabel = props.loadingLabel, tweakStyles = props.tweakStyles, testId = props.testId, isReadonly = props.isReadonly, isDisabled = props.isDisabled, dropdownOptions = props.dropdownOptions, _props_minSymbolsCountToOpenList = props.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _props_minSymbolsCountToOpenList === void 0 ? 0 : _props_minSymbolsCountToOpenList, _props_dropdownIcon = props.dropdownIcon, dropdownIcon = _props_dropdownIcon === void 0 ? "chevron-down" : _props_dropdownIcon, _props_shouldScrollToList = props.shouldScrollToList, shouldScrollToList = _props_shouldScrollToList === void 0 ? true : _props_shouldScrollToList, searchInput = props.searchInput, units = props.units, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onType = props.onType, onOpen = props.onOpen, _props_isOptionDisabled = props.isOptionDisabled, isOptionDisabled = _props_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _props_isOptionDisabled, _props_compareValuesOnChange = props.compareValuesOnChange, compareValuesOnChange = _props_compareValuesOnChange === void 0 ? defaultCompareFunction : _props_compareValuesOnChange, _props_convertValueToString = props.convertValueToString, convertValueToString = _props_convertValueToString === void 0 ? defaultConvertFunction$2 : _props_convertValueToString, convertValueToId = props.convertValueToId, convertValueToReactNode = props.convertValueToReactNode, optionsFilter = props.optionsFilter, inputProps = _object_without_properties$5(props, [
7643
8506
  "options",
7644
8507
  "value",
7645
8508
  "defaultOptionLabel",
8509
+ "allOptionsLabel",
7646
8510
  "debounceTime",
7647
8511
  "optionsMode",
7648
8512
  "noMatchesLabel",
@@ -7656,6 +8520,7 @@
7656
8520
  "dropdownIcon",
7657
8521
  "shouldScrollToList",
7658
8522
  "searchInput",
8523
+ "units",
7659
8524
  "onChange",
7660
8525
  "onFocus",
7661
8526
  "onBlur",
@@ -7672,8 +8537,8 @@
7672
8537
  var isMounted = useIsMounted();
7673
8538
  var _useState = _sliced_to_array$j(React.useState(false), 2), isListOpen = _useState[0], setIsListOpen = _useState[1];
7674
8539
  var _useState1 = _sliced_to_array$j(React.useState(false), 2), areOptionsLoading = _useState1[0], setAreOptionsLoading = _useState1[1];
7675
- var hasDefaultOption = defaultOptionLabel !== void 0;
7676
- var _useState2 = _sliced_to_array$j(React.useState(-1), 2), focusedListCellIndex = _useState2[0], setFocusedListCellIndex = _useState2[1];
8540
+ var hasDefaultOption = isStringNotEmpty(defaultOptionLabel);
8541
+ var _useState2 = _sliced_to_array$j(React.useState(DEFAULT_OPTION_INDEX), 2), focusedListCellIndex = _useState2[0], setFocusedListCellIndex = _useState2[1];
7677
8542
  var _useState3 = _sliced_to_array$j(React.useState(""), 2), searchValue = _useState3[0], setSearchValue = _useState3[1];
7678
8543
  var _useState4 = _sliced_to_array$j(React.useState(true), 2), shouldShowDefaultOption = _useState4[0], setShouldShowDefaultOption = _useState4[1];
7679
8544
  var inputWrapper = React.useRef(null);
@@ -7681,31 +8546,50 @@
7681
8546
  var input = React.useRef(null);
7682
8547
  var shouldRenderSearchInputInList = (searchInput === null || searchInput === void 0 ? void 0 : searchInput.shouldRenderInList) === true;
7683
8548
  var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
7684
- var stringValue = isNotEmpty(value) ? convertValueToString(value) : void 0;
8549
+ var isMultiSelect = isMultiSelectValue(props);
8550
+ var strValue = isMultiSelect ? value === null || value === void 0 ? void 0 : value[0] : value;
8551
+ var shouldShowAllOption = isMultiSelect && isNotEmpty(allOptionsLabel) && searchValue === "";
7685
8552
  var filteredOptions = React.useMemo(function() {
7686
8553
  if (optionsMode !== "search") {
7687
8554
  return options;
7688
8555
  }
7689
- if (isNotEmpty(optionsFilter)) {
7690
- return optionsFilter(options, searchValue);
7691
- }
7692
- var lowerCaseValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
7693
- return options.filter(function(option) {
7694
- var convertedOption = convertValueToString(option);
7695
- return convertedOption !== void 0 && convertedOption.toLowerCase().includes(lowerCaseValue);
8556
+ var _convertValueToString;
8557
+ var filter = optionsFilter !== null && optionsFilter !== void 0 ? optionsFilter : createFilter(function(option) {
8558
+ return [
8559
+ (_convertValueToString = convertValueToString(option)) !== null && _convertValueToString !== void 0 ? _convertValueToString : ""
8560
+ ];
7696
8561
  });
8562
+ return filter(options, searchValue);
7697
8563
  }, [
7698
- optionsMode,
7699
8564
  optionsFilter,
7700
8565
  options,
7701
8566
  convertValueToString,
7702
- searchValue
8567
+ searchValue,
8568
+ optionsMode
7703
8569
  ]);
7704
- React.useEffect(function() {
7705
- setFocusedListCellIndex(getActiveValueIndex(filteredOptions, value, convertValueToString));
8570
+ var optionsIndexesForNavigation = React.useMemo(function() {
8571
+ var result = [];
8572
+ if (shouldShowDefaultOption && hasDefaultOption) {
8573
+ result.push(DEFAULT_OPTION_INDEX);
8574
+ }
8575
+ if (shouldShowAllOption) {
8576
+ result.push(ALL_OPTION_INDEX);
8577
+ }
8578
+ return result.concat(filteredOptions.reduce(function(acc, cur, i) {
8579
+ if (!isOptionDisabled(cur)) {
8580
+ acc.push(i);
8581
+ }
8582
+ return acc;
8583
+ }, []));
7706
8584
  }, [
7707
- filteredOptions,
7708
- value,
8585
+ filteredOptions
8586
+ ]);
8587
+ var stringValue = isNotEmpty(strValue) ? convertValueToString(strValue) : void 0;
8588
+ var showedStringValue = isMultiSelect && (value === null || value === void 0 ? void 0 : value.length) === filteredOptions.length && isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
8589
+ var convertToId = React.useCallback(function(v) {
8590
+ return (convertValueToId !== null && convertValueToId !== void 0 ? convertValueToId : getDefaultConvertToIdFunction(convertValueToString))(v);
8591
+ }, [
8592
+ convertValueToId,
7709
8593
  convertValueToString
7710
8594
  ]);
7711
8595
  var handleListClose = React.useCallback(function(event) {
@@ -7742,11 +8626,9 @@
7742
8626
  }
7743
8627
  };
7744
8628
  var handleOnChange = React.useCallback(function(newValue) {
7745
- var areValuesEqual = compareValuesOnChange(value, newValue);
7746
- if (areValuesEqual) {
7747
- return;
8629
+ if (!compareValuesOnChange(value, newValue)) {
8630
+ onChange(newValue);
7748
8631
  }
7749
- onChange(newValue);
7750
8632
  }, [
7751
8633
  value,
7752
8634
  compareValuesOnChange,
@@ -7754,7 +8636,7 @@
7754
8636
  ]);
7755
8637
  var handleOptionSelect = React.useCallback(function(index, event) {
7756
8638
  var _input_current;
7757
- handleOnChange(index === -1 ? void 0 : filteredOptions[index]);
8639
+ handleOnChange(index === DEFAULT_OPTION_INDEX ? void 0 : filteredOptions[index]);
7758
8640
  handleListClose(event);
7759
8641
  (_input_current = input.current) === null || _input_current === void 0 ? void 0 : _input_current.blur();
7760
8642
  }, [
@@ -7762,6 +8644,36 @@
7762
8644
  handleListClose,
7763
8645
  filteredOptions
7764
8646
  ]);
8647
+ var handleToggleOptionCheckbox = React.useCallback(function(index, isSelected) {
8648
+ if (!isMultiSelect) {
8649
+ return;
8650
+ }
8651
+ if (index === DEFAULT_OPTION_INDEX || index === ALL_OPTION_INDEX && !isSelected) {
8652
+ handleOnChange(void 0);
8653
+ return;
8654
+ }
8655
+ if (index === ALL_OPTION_INDEX && isSelected) {
8656
+ handleOnChange(options);
8657
+ return;
8658
+ }
8659
+ var option = filteredOptions[index];
8660
+ handleOnChange(isSelected ? (
8661
+ // Добавляем
8662
+ _to_consumable_array$4(value !== null && value !== void 0 ? value : []).concat([
8663
+ option
8664
+ ])
8665
+ ) : (
8666
+ // Убираем
8667
+ value === null || value === void 0 ? void 0 : value.filter(function(o) {
8668
+ return convertToId(o) !== convertToId(option);
8669
+ })
8670
+ ));
8671
+ }, [
8672
+ handleOnChange,
8673
+ filteredOptions,
8674
+ isMultiSelect,
8675
+ value
8676
+ ]);
7765
8677
  var handleOnType = React.useCallback(function() {
7766
8678
  var _ref2 = _async_to_generator$4(function(v) {
7767
8679
  return __generator$4(this, function(_state) {
@@ -7821,47 +8733,43 @@
7821
8733
  return;
7822
8734
  }
7823
8735
  event.stopPropagation();
8736
+ var curIndexInNavigation = optionsIndexesForNavigation.findIndex(function(index) {
8737
+ return index === focusedListCellIndex;
8738
+ });
7824
8739
  switch (event.code) {
7825
8740
  case "Enter":
7826
8741
  case "NumpadEnter": {
7827
- var indexToClick = focusedListCellIndex;
7828
- if (indexToClick === -1 && filteredOptions.length === 1) {
7829
- indexToClick = 0;
8742
+ var indexToSelect = focusedListCellIndex;
8743
+ if (indexToSelect === DEFAULT_OPTION_INDEX && filteredOptions.length === 1) {
8744
+ indexToSelect = 0;
8745
+ }
8746
+ if (isMultiSelect) {
8747
+ var isThisValueAlreadySelected;
8748
+ if (indexToSelect === ALL_OPTION_INDEX) {
8749
+ isThisValueAlreadySelected = (value === null || value === void 0 ? void 0 : value.length) === options.length;
8750
+ } else {
8751
+ var valueIdToSelect = convertToId(filteredOptions[indexToSelect]);
8752
+ var _value_some;
8753
+ isThisValueAlreadySelected = (_value_some = value === null || value === void 0 ? void 0 : value.some(function(opt) {
8754
+ return convertToId(opt) === valueIdToSelect;
8755
+ })) !== null && _value_some !== void 0 ? _value_some : false;
8756
+ }
8757
+ handleToggleOptionCheckbox(indexToSelect, !isThisValueAlreadySelected);
8758
+ } else {
8759
+ handleOptionSelect(indexToSelect, event);
7830
8760
  }
7831
- handleOptionSelect(indexToClick, event);
7832
8761
  break;
7833
8762
  }
7834
8763
  case "ArrowDown": {
7835
8764
  event.preventDefault();
7836
- var newIndex = focusedListCellIndex !== null && focusedListCellIndex !== void 0 ? focusedListCellIndex : -1;
7837
- for (var i = newIndex; i < newIndex + filteredOptions.length; i++) {
7838
- var targetIndex = (i + 1) % filteredOptions.length;
7839
- if (shouldShowDefaultOption && hasDefaultOption && newIndex > -1 && targetIndex === 0) {
7840
- newIndex = -1;
7841
- break;
7842
- }
7843
- if (!isOptionDisabled(filteredOptions[targetIndex])) {
7844
- newIndex = targetIndex;
7845
- break;
7846
- }
7847
- }
7848
- setFocusedListCellIndex(newIndex);
8765
+ var targetIndexInNavigation = (curIndexInNavigation + 1) % optionsIndexesForNavigation.length;
8766
+ setFocusedListCellIndex(optionsIndexesForNavigation[targetIndexInNavigation]);
7849
8767
  break;
7850
8768
  }
7851
8769
  case "ArrowUp": {
7852
8770
  event.preventDefault();
7853
- var newIndex1 = (focusedListCellIndex !== null && focusedListCellIndex !== void 0 ? focusedListCellIndex : -1) === -1 ? 0 : focusedListCellIndex;
7854
- for (var i1 = newIndex1; i1 > newIndex1 - filteredOptions.length; i1--) {
7855
- var targetIndex1 = (i1 > 0 ? i1 : filteredOptions.length + i1) - 1;
7856
- if (shouldShowDefaultOption && hasDefaultOption && focusedListCellIndex !== -1 && targetIndex1 === filteredOptions.length - 1) {
7857
- setFocusedListCellIndex(-1);
7858
- break;
7859
- }
7860
- if (!isOptionDisabled(filteredOptions[targetIndex1])) {
7861
- setFocusedListCellIndex(targetIndex1);
7862
- break;
7863
- }
7864
- }
8771
+ var targetIndexInNavigation1 = (curIndexInNavigation - 1 + optionsIndexesForNavigation.length) % optionsIndexesForNavigation.length;
8772
+ setFocusedListCellIndex(optionsIndexesForNavigation[targetIndexInNavigation1]);
7865
8773
  break;
7866
8774
  }
7867
8775
  }
@@ -7890,7 +8798,7 @@
7890
8798
  );
7891
8799
  var hasReadonlyInput = isReadonly || optionsMode === "normal" || shouldRenderSearchInputInList;
7892
8800
  var tweakInputStyles = React.useMemo(function() {
7893
- return lodash.merge({}, componentStyles.tweakInput, _object_spread$u({}, hasReadonlyInput && {
8801
+ return merge$1({}, componentStyles.tweakInput, _object_spread$u({}, hasReadonlyInput && {
7894
8802
  input: {
7895
8803
  cursor: "pointer"
7896
8804
  }
@@ -7913,12 +8821,16 @@
7913
8821
  ]
7914
8822
  });
7915
8823
  React.useEffect(function() {
7916
- if (isOpen && onOpen !== void 0) {
7917
- onOpen();
8824
+ var val = isMultiSelect ? value === null || value === void 0 ? void 0 : value[0] : value;
8825
+ var _optionsIndexesForNavigation_find;
8826
+ setFocusedListCellIndex((_optionsIndexesForNavigation_find = optionsIndexesForNavigation.find(function(index) {
8827
+ return filteredOptions[index] === val;
8828
+ })) !== null && _optionsIndexesForNavigation_find !== void 0 ? _optionsIndexesForNavigation_find : optionsIndexesForNavigation[0]);
8829
+ if (isOpen) {
8830
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
7918
8831
  }
7919
8832
  }, [
7920
- isOpen,
7921
- onOpen
8833
+ isOpen
7922
8834
  ]);
7923
8835
  var _obj;
7924
8836
  var listEl = /* @__PURE__ */ jsx("div", _object_spread_props$o(_object_spread$u({
@@ -7930,6 +8842,7 @@
7930
8842
  children: isOpen && /* @__PURE__ */ jsx(SelectList, {
7931
8843
  options: filteredOptions,
7932
8844
  defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption ? defaultOptionLabel : void 0,
8845
+ allOptionsLabel: shouldShowAllOption ? allOptionsLabel : void 0,
7933
8846
  customListHeader: hasSearchInputInList ? /* @__PURE__ */ jsx(SearchInput, _object_spread$u({
7934
8847
  value: searchValue,
7935
8848
  onChange: handleInputChange,
@@ -7947,8 +8860,9 @@
7947
8860
  isOptionDisabled,
7948
8861
  convertValueToString,
7949
8862
  convertValueToReactNode,
7950
- convertValueToId,
7951
- onOptionClick: handleOptionSelect
8863
+ convertValueToId: convertToId,
8864
+ onOptionSelect: handleOptionSelect,
8865
+ onToggleCheckbox: isMultiSelect ? handleToggleOptionCheckbox : void 0
7952
8866
  })
7953
8867
  }));
7954
8868
  return /* @__PURE__ */ jsxs("div", {
@@ -7961,7 +8875,7 @@
7961
8875
  ref: inputWrapper,
7962
8876
  children: [
7963
8877
  /* @__PURE__ */ jsx(Input, _object_spread$u({
7964
- value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : stringValue,
8878
+ value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : showedStringValue,
7965
8879
  onChange: handleInputChange,
7966
8880
  isActive: isListOpen,
7967
8881
  isReadonly: hasReadonlyInput,
@@ -7971,7 +8885,8 @@
7971
8885
  ref: input,
7972
8886
  isLoading: areOptionsLoading,
7973
8887
  tweakStyles: tweakInputStyles,
7974
- testId
8888
+ testId,
8889
+ units: isMultiSelect && isNotEmpty(value) && value.length > 1 && value.length !== options.length ? "(+".concat(value.length - 1, ")") : units
7975
8890
  }, inputProps)),
7976
8891
  /* @__PURE__ */ jsx("div", {
7977
8892
  onMouseDown: function(event) {
@@ -8808,7 +9723,7 @@
8808
9723
  var DEFAULT_LOCALE$2 = "en";
8809
9724
  var getLocale$2 = function() {
8810
9725
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_LOCALE$2, custom = arguments.length > 1 ? arguments[1] : void 0, custom2 = arguments.length > 2 ? arguments[2] : void 0;
8811
- return lodash.merge({}, SelectLocales[key], custom, custom2);
9726
+ return merge$1({}, SelectLocales[key], custom, custom2);
8812
9727
  };
8813
9728
  function _define_property$s(obj, key, value) {
8814
9729
  if (key in obj) {
@@ -9708,7 +10623,7 @@
9708
10623
  var DEFAULT_LOCALE$1 = "en";
9709
10624
  var getLocale$1 = function() {
9710
10625
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_LOCALE$1, custom = arguments.length > 1 ? arguments[1] : void 0, custom2 = arguments.length > 2 ? arguments[2] : void 0;
9711
- return lodash.merge({}, FilterLocales[key], custom, custom2);
10626
+ return merge$1({}, FilterLocales[key], custom, custom2);
9712
10627
  };
9713
10628
  var FILTER_HEIGHT = 36;
9714
10629
  var styles$o = {
@@ -10872,7 +11787,7 @@
10872
11787
  var DEFAULT_LOCALE = "en";
10873
11788
  var getLocale = function() {
10874
11789
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_LOCALE, custom = arguments.length > 1 ? arguments[1] : void 0, custom2 = arguments.length > 2 ? arguments[2] : void 0;
10875
- return lodash.merge({}, MultiSelectLocales[key], custom, custom2);
11790
+ return merge$1({}, MultiSelectLocales[key], custom, custom2);
10876
11791
  };
10877
11792
  function _define_property$n(obj, key, value) {
10878
11793
  if (key in obj) {
@@ -26565,7 +27480,7 @@
26565
27480
  var TextWithTooltip = function(param) {
26566
27481
  var children = param.children, tooltipText = param.tooltipText, _param_tooltipPosition = param.tooltipPosition, tooltipPosition = _param_tooltipPosition === void 0 ? "top" : _param_tooltipPosition, _param_tooltipView = param.tooltipView, tooltipView = _param_tooltipView === void 0 ? "tooltip" : _param_tooltipView, tooltipType = param.tooltipType, _param_tooltipModifiers = param.tooltipModifiers, tooltipModifiers = _param_tooltipModifiers === void 0 ? [] : _param_tooltipModifiers, tooltipOffsetOptions = param.tooltipOffsetOptions, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_shouldRenderInBody = param.shouldRenderInBody, shouldRenderInBody = _param_shouldRenderInBody === void 0 ? true : _param_shouldRenderInBody, _param_mouseEventType = param.mouseEventType, mouseEventType = _param_mouseEventType === void 0 ? "hover" : _param_mouseEventType, hoverDelay = param.hoverDelay, data = param.data, tweakStyles = param.tweakStyles;
26567
27482
  var _useTheme = useTheme("TextWithTooltip", styles$2, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
26568
- var root = React.useRef(null);
27483
+ var root2 = React.useRef(null);
26569
27484
  var tooltip = React.useRef(null);
26570
27485
  var _useState = _sliced_to_array(React.useState(false), 2), isTooltipVisible = _useState[0], setIsTooltipVisible = _useState[1];
26571
27486
  var _useState1 = _sliced_to_array(React.useState(), 2), tooltipTimeout = _useState1[0], setTooltipTimeout = _useState1[1];
@@ -26591,7 +27506,7 @@
26591
27506
  return clearTimeout(tooltipTimeout);
26592
27507
  };
26593
27508
  }, []);
26594
- var _usePopper = usePopper(root.current, tooltip.current, {
27509
+ var _usePopper = usePopper(root2.current, tooltip.current, {
26595
27510
  enabled: isTooltipVisible,
26596
27511
  placement: tooltipPosition,
26597
27512
  modifiers: [
@@ -26610,7 +27525,7 @@
26610
27525
  if (mouseEventType === "click") {
26611
27526
  setIsTooltipVisible(false);
26612
27527
  }
26613
- }, root);
27528
+ }, root2);
26614
27529
  var props = mouseEventType === "click" ? {
26615
27530
  onClick: function() {
26616
27531
  return setIsTooltipVisible(true);
@@ -26624,10 +27539,10 @@
26624
27539
  return /* @__PURE__ */ jsxs("div", _object_spread_props$2(_object_spread$2({
26625
27540
  className: clsx(classes.root, mouseEventType === "click" && shouldShowTooltip && classes.clickable)
26626
27541
  }, shouldShowTooltip ? props : void 0, addDataAttributes(data)), {
26627
- ref: root,
27542
+ ref: root2,
26628
27543
  children: [
26629
27544
  shouldShowTooltip && /* @__PURE__ */ jsx(reactOverlays.Portal, {
26630
- container: shouldRenderInBody ? document.body : root.current,
27545
+ container: shouldRenderInBody ? document.body : root2.current,
26631
27546
  children: /* @__PURE__ */ jsx("div", _object_spread_props$2(_object_spread$2({
26632
27547
  className: classes.tooltip,
26633
27548
  style: popperStyles.popper
@@ -27149,6 +28064,7 @@
27149
28064
  exports2.checkElementParentsClassNames = checkElementParentsClassNames;
27150
28065
  exports2.checkSearchStringInCountry = checkSearchStringInCountry;
27151
28066
  exports2.commonTheme = commonTheme;
28067
+ exports2.createFilter = createFilter;
27152
28068
  exports2.defaultConvertFunction = defaultConvertFunction$1;
27153
28069
  exports2.findCountryByCode = findCountryByCode;
27154
28070
  exports2.findCountryIndexByCode = findCountryIndexByCode;
@@ -27173,6 +28089,7 @@
27173
28089
  exports2.isInt = isInt;
27174
28090
  exports2.isNotEmpty = isNotEmpty;
27175
28091
  exports2.isSpaceChar = isSpaceChar;
28092
+ exports2.isStringNotEmpty = isStringNotEmpty;
27176
28093
  exports2.minWidthModifier = minWidthModifier;
27177
28094
  exports2.phoneInfo = phoneInfo;
27178
28095
  exports2.removeStringFormat = removeStringFormat;