@oliasoft-open-source/react-ui-library 4.17.0-beta-1 → 4.17.0-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11,12 +11,12 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
11
11
  var _docChanged, _ignoreNextExit, _suggesters, _next, _prev, _handlerMatches, _ignored, _removed, _lastChangeFromAppend, _a;
12
12
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
13
13
  import * as React$4 from "react";
14
- import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback, createElement, forwardRef, useMemo, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, Component as Component$1, memo, cloneElement as cloneElement$1, PureComponent, useImperativeHandle } from "react";
14
+ import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback, createElement, forwardRef, useMemo, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, memo as memo$1, cloneElement as cloneElement$1, PureComponent, useImperativeHandle } from "react";
15
15
  import * as PropTypes from "prop-types";
16
16
  import PropTypes__default from "prop-types";
17
- import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
18
- import { noop as noop$2, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$1, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isEqual as isEqual$3 } from "lodash";
19
- import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, validateNumber, cleanNumStr, stripLeadingZeros, roundToFixed, roundByMagnitude, unitFromQuantity, getUnit, KNOWN_UNITS, ALT_UNITS, isValueWithUnit, getValue, withUnit, convertSamePrecision, convertAndGetValue, split as split$1, label as label$b, isValidNum, getAltUnitsListByQuantity, altUnitsList, withPrettyUnitLabel, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
17
+ import ReactDOM, { createPortal, flushSync as flushSync$1, unstable_batchedUpdates, render } from "react-dom";
18
+ import { noop as noop$2, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$1, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$3, isObject as isObject$5, isEqual as isEqual$3 } from "lodash";
19
+ import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, validateNumber, cleanNumStr, stripLeadingZeros, roundToFixed, roundByMagnitude, unitFromQuantity, getUnit, KNOWN_UNITS, ALT_UNITS, isValueWithUnit, getValue, withUnit, convertSamePrecision, convertAndGetValue, split as split$1, label as label$b, isValidNum, getAltUnitsListByQuantity, altUnitsList, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
20
20
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
21
21
  function getDefaultExportFromCjs(x2) {
22
22
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -222,32 +222,32 @@ function _setPrototypeOf$3(t, e2) {
222
222
  function _inheritsLoose$3(t, o) {
223
223
  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$3(t, o);
224
224
  }
225
- var extendStatics$1 = function(d2, b2) {
226
- extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
225
+ var extendStatics = function(d2, b2) {
226
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
227
227
  d3.__proto__ = b3;
228
228
  } || function(d3, b3) {
229
229
  for (var p in b3) if (Object.prototype.hasOwnProperty.call(b3, p)) d3[p] = b3[p];
230
230
  };
231
- return extendStatics$1(d2, b2);
231
+ return extendStatics(d2, b2);
232
232
  };
233
- function __extends$1(d2, b2) {
233
+ function __extends(d2, b2) {
234
234
  if (typeof b2 !== "function" && b2 !== null)
235
235
  throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
236
- extendStatics$1(d2, b2);
236
+ extendStatics(d2, b2);
237
237
  function __() {
238
238
  this.constructor = d2;
239
239
  }
240
240
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
241
241
  }
242
- var __assign$4 = function() {
243
- __assign$4 = Object.assign || function __assign2(t) {
242
+ var __assign$3 = function() {
243
+ __assign$3 = Object.assign || function __assign2(t) {
244
244
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
245
245
  s = arguments[i];
246
246
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
247
247
  }
248
248
  return t;
249
249
  };
250
- return __assign$4.apply(this, arguments);
250
+ return __assign$3.apply(this, arguments);
251
251
  };
252
252
  function __rest$1(s, e2) {
253
253
  var t = {};
@@ -883,15 +883,15 @@ var DefaultContext = {
883
883
  attr: void 0
884
884
  };
885
885
  var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
886
- var __assign$3 = function() {
887
- __assign$3 = Object.assign || function(t) {
886
+ var __assign$2 = function() {
887
+ __assign$2 = Object.assign || function(t) {
888
888
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
889
889
  s = arguments[i];
890
890
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
891
891
  }
892
892
  return t;
893
893
  };
894
- return __assign$3.apply(this, arguments);
894
+ return __assign$2.apply(this, arguments);
895
895
  };
896
896
  var __rest = function(s, e2) {
897
897
  var t = {};
@@ -903,15 +903,15 @@ var __rest = function(s, e2) {
903
903
  };
904
904
  function Tree2Element(tree2) {
905
905
  return tree2 && tree2.map(function(node2, i) {
906
- return React__default.createElement(node2.tag, __assign$3({
906
+ return React__default.createElement(node2.tag, __assign$2({
907
907
  key: i
908
908
  }, node2.attr), Tree2Element(node2.child));
909
909
  });
910
910
  }
911
911
  function GenIcon(data) {
912
912
  return function(props) {
913
- return React__default.createElement(IconBase, __assign$3({
914
- attr: __assign$3({}, data.attr)
913
+ return React__default.createElement(IconBase, __assign$2({
914
+ attr: __assign$2({}, data.attr)
915
915
  }, props), Tree2Element(data.child));
916
916
  };
917
917
  }
@@ -922,13 +922,13 @@ function IconBase(props) {
922
922
  var className;
923
923
  if (conf.className) className = conf.className;
924
924
  if (props.className) className = (className ? className + " " : "") + props.className;
925
- return React__default.createElement("svg", __assign$3({
925
+ return React__default.createElement("svg", __assign$2({
926
926
  stroke: "currentColor",
927
927
  fill: "currentColor",
928
928
  strokeWidth: "0"
929
929
  }, conf.attr, attr, svgProps, {
930
930
  className,
931
- style: __assign$3(__assign$3({
931
+ style: __assign$2(__assign$2({
932
932
  color: props.color || conf.color
933
933
  }, conf.style), props.style),
934
934
  height: computedSize,
@@ -1808,7 +1808,7 @@ var requestAnimationFrame$1 = function() {
1808
1808
  };
1809
1809
  }();
1810
1810
  var trailingTimeout = 2;
1811
- function throttle$2(callback, delay) {
1811
+ function throttle$1(callback, delay) {
1812
1812
  var leadingCall = false, trailingCall = false, lastCallTime = 0;
1813
1813
  function resolvePending() {
1814
1814
  if (leadingCall) {
@@ -1850,7 +1850,7 @@ var ResizeObserverController$1 = (
1850
1850
  this.mutationsObserver_ = null;
1851
1851
  this.observers_ = [];
1852
1852
  this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1853
- this.refresh = throttle$2(this.refresh.bind(this), REFRESH_DELAY);
1853
+ this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
1854
1854
  }
1855
1855
  ResizeObserverController2.prototype.addObserver = function(observer) {
1856
1856
  if (!~this.observers_.indexOf(observer)) {
@@ -2354,7 +2354,7 @@ function useEventSubscriptions() {
2354
2354
  };
2355
2355
  }, []);
2356
2356
  }
2357
- var useIsomorphicLayoutEffect$5 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2357
+ var useIsomorphicLayoutEffect$6 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2358
2358
  function useLastState(currentState, enabled) {
2359
2359
  var lastState = useRef(currentState);
2360
2360
  if (!enabled) {
@@ -2602,7 +2602,7 @@ function useTrackElements(_ref) {
2602
2602
  resetWhenReferenceChangedWhileTracking(previousTrigger, trigger2);
2603
2603
  }, [get3, set2, resetWhenReferenceChangedWhileTracking, getScrollContainers]));
2604
2604
  var triggerOptionParent = triggerOption == null ? void 0 : triggerOption.getParent == null ? void 0 : triggerOption.getParent();
2605
- useIsomorphicLayoutEffect$5(function() {
2605
+ useIsomorphicLayoutEffect$6(function() {
2606
2606
  if (!triggerOptionParent) {
2607
2607
  return;
2608
2608
  }
@@ -2612,7 +2612,7 @@ function useTrackElements(_ref) {
2612
2612
  });
2613
2613
  });
2614
2614
  }, [triggerOptionParent, set2, getScrollContainers]);
2615
- useIsomorphicLayoutEffect$5(function() {
2615
+ useIsomorphicLayoutEffect$6(function() {
2616
2616
  if (enabled) {
2617
2617
  if (!hasEventSubscriptions()) {
2618
2618
  addEventListeners();
@@ -2624,7 +2624,7 @@ function useTrackElements(_ref) {
2624
2624
  }
2625
2625
  };
2626
2626
  }, [enabled, hasEventSubscriptions, addEventListeners, removeAllEventSubscriptions]);
2627
- useIsomorphicLayoutEffect$5(function() {
2627
+ useIsomorphicLayoutEffect$6(function() {
2628
2628
  if (enabled) {
2629
2629
  handleChange();
2630
2630
  }
@@ -4078,6 +4078,7 @@ const Button$1 = ({
4078
4078
  basic: basic2 = false,
4079
4079
  colored: colored2 = false,
4080
4080
  disabled: disabled2 = false,
4081
+ ignoreDisabledContext = false,
4081
4082
  groupOrder = null,
4082
4083
  icon: icon2 = null,
4083
4084
  label: label2 = "",
@@ -4133,6 +4134,7 @@ const Button$1 = ({
4133
4134
  }
4134
4135
  return "";
4135
4136
  })();
4137
+ const isDisabled = disabled2 || disabledContext && !ignoreDisabledContext;
4136
4138
  return /* @__PURE__ */ jsx(ButtonTooltipWrapper, { tooltip: tooltip2, children: /* @__PURE__ */ jsxs(
4137
4139
  Component2,
4138
4140
  {
@@ -4142,7 +4144,7 @@ const Button$1 = ({
4142
4144
  active2 ? buttonStyles.active : "",
4143
4145
  basic2 ? buttonStyles.basic : "",
4144
4146
  color2,
4145
- disabled2 || disabledContext ? buttonStyles.disabled : "",
4147
+ isDisabled ? buttonStyles.disabled : "",
4146
4148
  (icon2 || loading) && !label2 ? buttonStyles.iconOnly : "",
4147
4149
  inverted2 ? buttonStyles.inverted : "",
4148
4150
  order2,
@@ -4151,7 +4153,7 @@ const Button$1 = ({
4151
4153
  small2 ? buttonStyles.small : "",
4152
4154
  styles2
4153
4155
  ),
4154
- disabled: disabled2 || disabledContext,
4156
+ disabled: isDisabled,
4155
4157
  name: name2 ?? "",
4156
4158
  onClick,
4157
4159
  ...title2 ? { title: title2 } : {},
@@ -5306,15 +5308,15 @@ const Card = ({
5306
5308
  }
5307
5309
  );
5308
5310
  };
5309
- var __assign$2 = function() {
5310
- __assign$2 = Object.assign || function __assign2(t) {
5311
+ var __assign$1 = function() {
5312
+ __assign$1 = Object.assign || function __assign2(t) {
5311
5313
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
5312
5314
  s = arguments[i];
5313
5315
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5314
5316
  }
5315
5317
  return t;
5316
5318
  };
5317
- return __assign$2.apply(this, arguments);
5319
+ return __assign$1.apply(this, arguments);
5318
5320
  };
5319
5321
  function __spreadArray$1(to2, from3, pack) {
5320
5322
  if (pack || arguments.length === 2) for (var i = 0, l = from3.length, ar2; i < l; i++) {
@@ -6147,7 +6149,7 @@ var Ie = function(e2) {
6147
6149
  function e2(e3, n2, o) {
6148
6150
  void 0 === e3 && (e3 = C), void 0 === n2 && (n2 = {});
6149
6151
  var r2 = this;
6150
- this.options = __assign$2(__assign$2({}, Te), e3), this.gs = n2, this.names = new Map(o), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
6152
+ this.options = __assign$1(__assign$1({}, Te), e3), this.gs = n2, this.names = new Map(o), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
6151
6153
  return function(e4) {
6152
6154
  for (var t = e4.getTag(), n3 = t.length, o2 = "", r3 = function(n4) {
6153
6155
  var r4 = function(e5) {
@@ -6170,7 +6172,7 @@ var Ie = function(e2) {
6170
6172
  }, e2.prototype.rehydrate = function() {
6171
6173
  !this.server && S && _e(this);
6172
6174
  }, e2.prototype.reconstructWithOptions = function(n2, o) {
6173
- return void 0 === o && (o = true), new e2(__assign$2(__assign$2({}, this.options), n2), this.gs, o && this.names || void 0);
6175
+ return void 0 === o && (o = true), new e2(__assign$1(__assign$1({}, this.options), n2), this.gs, o && this.names || void 0);
6174
6176
  }, e2.prototype.allocateGSInstance = function(e3) {
6175
6177
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
6176
6178
  }, e2.prototype.getTag = function() {
@@ -6343,9 +6345,9 @@ function it$1(e2, r2, s) {
6343
6345
  var i2 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p2 = e4.foldedComponentIds, d3 = e4.styledComponentId, h2 = e4.target, f3 = React__default.useContext(et$1), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
6344
6346
  "production" !== process.env.NODE_ENV && useDebugValue(d3);
6345
6347
  var v2 = I(r4, f3, c3) || C, g3 = function(e5, n2, o) {
6346
- for (var r5, s3 = __assign$2(__assign$2({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6348
+ for (var r5, s3 = __assign$1(__assign$1({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6347
6349
  var a4 = re(r5 = e5[i3]) ? r5(s3) : r5;
6348
- for (var c4 in a4) s3[c4] = "className" === c4 ? ie$2(s3[c4], a4[c4]) : "style" === c4 ? __assign$2(__assign$2({}, s3[c4]), a4[c4]) : a4[c4];
6350
+ for (var c4 in a4) s3[c4] = "className" === c4 ? ie$2(s3[c4], a4[c4]) : "style" === c4 ? __assign$1(__assign$1({}, s3[c4]), a4[c4]) : a4[c4];
6349
6351
  }
6350
6352
  return n2.className && (s3.className = ie$2(s3.className, n2.className)), s3;
6351
6353
  }(i2, r4, v2), S3 = g3.as || h2, w3 = {};
@@ -6401,9 +6403,9 @@ function ut(n2, o, r2) {
6401
6403
  return n2(o, r2, lt$1.apply(void 0, __spreadArray$1([t], s2, false)));
6402
6404
  };
6403
6405
  return s.attrs = function(e2) {
6404
- return ut(n2, o, __assign$2(__assign$2({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6406
+ return ut(n2, o, __assign$1(__assign$1({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6405
6407
  }, s.withConfig = function(e2) {
6406
- return ut(n2, o, __assign$2(__assign$2({}, r2), e2));
6408
+ return ut(n2, o, __assign$1(__assign$1({}, r2), e2));
6407
6409
  }, s;
6408
6410
  }
6409
6411
  var pt$1 = function(e2) {
@@ -6688,7 +6690,8 @@ const Dialog = ({ dialog: dialog2 }) => {
6688
6690
  small: true,
6689
6691
  colored: "muted",
6690
6692
  onClick: onClose,
6691
- testId: testId && `${testId}-dismiss`
6693
+ testId: testId && `${testId}-dismiss`,
6694
+ ignoreDisabledContext: true
6692
6695
  }
6693
6696
  ) }) : null
6694
6697
  ] }),
@@ -9498,383 +9501,803 @@ const InputGroupAddon = ({
9498
9501
  })();
9499
9502
  return /* @__PURE__ */ jsx("span", { className: cx$2(styles$u.addon, order2, small2 ? styles$u.small : ""), children });
9500
9503
  };
9501
- /*! *****************************************************************************
9502
- Copyright (c) Microsoft Corporation. All rights reserved.
9503
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
9504
- this file except in compliance with the License. You may obtain a copy of the
9505
- License at http://www.apache.org/licenses/LICENSE-2.0
9506
-
9507
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9508
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9509
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
9510
- MERCHANTABLITY OR NON-INFRINGEMENT.
9511
-
9512
- See the Apache Version 2.0 License for specific language governing permissions
9513
- and limitations under the License.
9514
- ***************************************************************************** */
9515
- var extendStatics = function(d2, b2) {
9516
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
9517
- d3.__proto__ = b3;
9518
- } || function(d3, b3) {
9519
- for (var p in b3) if (b3.hasOwnProperty(p)) d3[p] = b3[p];
9504
+ function memo(getDeps, fn, opts) {
9505
+ let deps = opts.initialDeps ?? [];
9506
+ let result;
9507
+ return () => {
9508
+ var _a2, _b, _c, _d;
9509
+ let depTime;
9510
+ if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
9511
+ const newDeps = getDeps();
9512
+ const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index2) => deps[index2] !== dep);
9513
+ if (!depsChanged) {
9514
+ return result;
9515
+ }
9516
+ deps = newDeps;
9517
+ let resultTime;
9518
+ if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
9519
+ result = fn(...newDeps);
9520
+ if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
9521
+ const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
9522
+ const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
9523
+ const resultFpsPercentage = resultEndTime / 16;
9524
+ const pad = (str, num) => {
9525
+ str = String(str);
9526
+ while (str.length < num) {
9527
+ str = " " + str;
9528
+ }
9529
+ return str;
9530
+ };
9531
+ console.info(
9532
+ `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
9533
+ `
9534
+ font-size: .6rem;
9535
+ font-weight: bold;
9536
+ color: hsl(${Math.max(
9537
+ 0,
9538
+ Math.min(120 - 120 * resultFpsPercentage, 120)
9539
+ )}deg 100% 31%);`,
9540
+ opts == null ? void 0 : opts.key
9541
+ );
9542
+ }
9543
+ (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
9544
+ return result;
9520
9545
  };
9521
- return extendStatics(d2, b2);
9522
- };
9523
- function __extends(d2, b2) {
9524
- extendStatics(d2, b2);
9525
- function __() {
9526
- this.constructor = d2;
9546
+ }
9547
+ function notUndefined(value, msg2) {
9548
+ if (value === void 0) {
9549
+ throw new Error(`Unexpected undefined${""}`);
9550
+ } else {
9551
+ return value;
9527
9552
  }
9528
- d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
9529
9553
  }
9530
- var __assign$1 = function() {
9531
- __assign$1 = Object.assign || function __assign2(t) {
9532
- for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
9533
- s = arguments[i];
9534
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9535
- }
9536
- return t;
9554
+ const approxEqual = (a2, b2) => Math.abs(a2 - b2) < 1;
9555
+ const debounce$2 = (targetWindow, fn, ms2) => {
9556
+ let timeoutId;
9557
+ return function(...args) {
9558
+ targetWindow.clearTimeout(timeoutId);
9559
+ timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms2);
9537
9560
  };
9538
- return __assign$1.apply(this, arguments);
9539
9561
  };
9540
- function throttle$1(delay, noTrailing, callback, debounceMode) {
9541
- var timeoutID;
9542
- var cancelled = false;
9543
- var lastExec = 0;
9544
- function clearExistingTimeout() {
9545
- if (timeoutID) {
9546
- clearTimeout(timeoutID);
9547
- }
9562
+ const defaultKeyExtractor = (index2) => index2;
9563
+ const defaultRangeExtractor = (range2) => {
9564
+ const start = Math.max(range2.startIndex - range2.overscan, 0);
9565
+ const end = Math.min(range2.endIndex + range2.overscan, range2.count - 1);
9566
+ const arr = [];
9567
+ for (let i = start; i <= end; i++) {
9568
+ arr.push(i);
9548
9569
  }
9549
- function cancel() {
9550
- clearExistingTimeout();
9551
- cancelled = true;
9570
+ return arr;
9571
+ };
9572
+ const observeElementRect = (instance, cb2) => {
9573
+ const element = instance.scrollElement;
9574
+ if (!element) {
9575
+ return;
9552
9576
  }
9553
- if (typeof noTrailing !== "boolean") {
9554
- debounceMode = callback;
9555
- callback = noTrailing;
9556
- noTrailing = void 0;
9577
+ const targetWindow = instance.targetWindow;
9578
+ if (!targetWindow) {
9579
+ return;
9557
9580
  }
9558
- function wrapper2() {
9559
- var self2 = this;
9560
- var elapsed = Date.now() - lastExec;
9561
- var args = arguments;
9562
- if (cancelled) {
9563
- return;
9564
- }
9565
- function exec() {
9566
- lastExec = Date.now();
9567
- callback.apply(self2, args);
9568
- }
9569
- function clear() {
9570
- timeoutID = void 0;
9571
- }
9572
- if (debounceMode && !timeoutID) {
9573
- exec();
9581
+ const handler = (rect) => {
9582
+ const { width: width2, height: height2 } = rect;
9583
+ cb2({ width: Math.round(width2), height: Math.round(height2) });
9584
+ };
9585
+ handler(element.getBoundingClientRect());
9586
+ if (!targetWindow.ResizeObserver) {
9587
+ return () => {
9588
+ };
9589
+ }
9590
+ const observer = new targetWindow.ResizeObserver((entries2) => {
9591
+ const entry = entries2[0];
9592
+ if (entry == null ? void 0 : entry.borderBoxSize) {
9593
+ const box = entry.borderBoxSize[0];
9594
+ if (box) {
9595
+ handler({ width: box.inlineSize, height: box.blockSize });
9596
+ return;
9597
+ }
9574
9598
  }
9575
- clearExistingTimeout();
9576
- if (debounceMode === void 0 && elapsed > delay) {
9577
- exec();
9578
- } else if (noTrailing !== true) {
9579
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
9599
+ handler(element.getBoundingClientRect());
9600
+ });
9601
+ observer.observe(element, { box: "border-box" });
9602
+ return () => {
9603
+ observer.unobserve(element);
9604
+ };
9605
+ };
9606
+ const addEventListenerOptions = {
9607
+ passive: true
9608
+ };
9609
+ const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
9610
+ const observeElementOffset = (instance, cb2) => {
9611
+ const element = instance.scrollElement;
9612
+ if (!element) {
9613
+ return;
9614
+ }
9615
+ const targetWindow = instance.targetWindow;
9616
+ if (!targetWindow) {
9617
+ return;
9618
+ }
9619
+ let offset = 0;
9620
+ const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce$2(
9621
+ targetWindow,
9622
+ () => {
9623
+ cb2(offset, false);
9624
+ },
9625
+ instance.options.isScrollingResetDelay
9626
+ );
9627
+ const createHandler = (isScrolling) => () => {
9628
+ const { horizontal, isRtl } = instance.options;
9629
+ offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"];
9630
+ fallback();
9631
+ cb2(offset, isScrolling);
9632
+ };
9633
+ const handler = createHandler(true);
9634
+ const endHandler = createHandler(false);
9635
+ endHandler();
9636
+ element.addEventListener("scroll", handler, addEventListenerOptions);
9637
+ element.addEventListener("scrollend", endHandler, addEventListenerOptions);
9638
+ return () => {
9639
+ element.removeEventListener("scroll", handler);
9640
+ element.removeEventListener("scrollend", endHandler);
9641
+ };
9642
+ };
9643
+ const measureElement = (element, entry, instance) => {
9644
+ if (entry == null ? void 0 : entry.borderBoxSize) {
9645
+ const box = entry.borderBoxSize[0];
9646
+ if (box) {
9647
+ const size2 = Math.round(
9648
+ box[instance.options.horizontal ? "inlineSize" : "blockSize"]
9649
+ );
9650
+ return size2;
9580
9651
  }
9581
9652
  }
9582
- wrapper2.cancel = cancel;
9583
- return wrapper2;
9584
- }
9585
- var ThresholdUnits = {
9586
- Pixel: "Pixel",
9587
- Percent: "Percent"
9653
+ return Math.round(
9654
+ element.getBoundingClientRect()[instance.options.horizontal ? "width" : "height"]
9655
+ );
9588
9656
  };
9589
- var defaultThreshold$1 = {
9590
- unit: ThresholdUnits.Percent,
9591
- value: 0.8
9657
+ const elementScroll = (offset, {
9658
+ adjustments = 0,
9659
+ behavior
9660
+ }, instance) => {
9661
+ var _a2, _b;
9662
+ const toOffset = offset + adjustments;
9663
+ (_b = (_a2 = instance.scrollElement) == null ? void 0 : _a2.scrollTo) == null ? void 0 : _b.call(_a2, {
9664
+ [instance.options.horizontal ? "left" : "top"]: toOffset,
9665
+ behavior
9666
+ });
9592
9667
  };
9593
- function parseThreshold(scrollThreshold) {
9594
- if (typeof scrollThreshold === "number") {
9595
- return {
9596
- unit: ThresholdUnits.Percent,
9597
- value: scrollThreshold * 100
9598
- };
9599
- }
9600
- if (typeof scrollThreshold === "string") {
9601
- if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
9602
- return {
9603
- unit: ThresholdUnits.Pixel,
9604
- value: parseFloat(scrollThreshold)
9668
+ class Virtualizer {
9669
+ constructor(opts) {
9670
+ this.unsubs = [];
9671
+ this.scrollElement = null;
9672
+ this.targetWindow = null;
9673
+ this.isScrolling = false;
9674
+ this.scrollToIndexTimeoutId = null;
9675
+ this.measurementsCache = [];
9676
+ this.itemSizeCache = /* @__PURE__ */ new Map();
9677
+ this.pendingMeasuredCacheIndexes = [];
9678
+ this.scrollRect = null;
9679
+ this.scrollOffset = null;
9680
+ this.scrollDirection = null;
9681
+ this.scrollAdjustments = 0;
9682
+ this.elementsCache = /* @__PURE__ */ new Map();
9683
+ this.observer = /* @__PURE__ */ (() => {
9684
+ let _ro = null;
9685
+ const get3 = () => {
9686
+ if (_ro) {
9687
+ return _ro;
9688
+ }
9689
+ if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
9690
+ return null;
9691
+ }
9692
+ return _ro = new this.targetWindow.ResizeObserver((entries2) => {
9693
+ entries2.forEach((entry) => {
9694
+ this._measureElement(entry.target, entry);
9695
+ });
9696
+ });
9605
9697
  };
9606
- }
9607
- if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
9608
9698
  return {
9609
- unit: ThresholdUnits.Percent,
9610
- value: parseFloat(scrollThreshold)
9611
- };
9612
- }
9613
- console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
9614
- return defaultThreshold$1;
9615
- }
9616
- console.warn("scrollThreshold should be string or number");
9617
- return defaultThreshold$1;
9618
- }
9619
- var InfiniteScroll = (
9620
- /** @class */
9621
- function(_super) {
9622
- __extends(InfiniteScroll2, _super);
9623
- function InfiniteScroll2(props) {
9624
- var _this = _super.call(this, props) || this;
9625
- _this.lastScrollTop = 0;
9626
- _this.actionTriggered = false;
9627
- _this.startY = 0;
9628
- _this.currentY = 0;
9629
- _this.dragging = false;
9630
- _this.maxPullDownDistance = 0;
9631
- _this.getScrollableTarget = function() {
9632
- if (_this.props.scrollableTarget instanceof HTMLElement)
9633
- return _this.props.scrollableTarget;
9634
- if (typeof _this.props.scrollableTarget === "string") {
9635
- return document.getElementById(_this.props.scrollableTarget);
9636
- }
9637
- if (_this.props.scrollableTarget === null) {
9638
- console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n ");
9699
+ disconnect: () => {
9700
+ var _a2;
9701
+ (_a2 = get3()) == null ? void 0 : _a2.disconnect();
9702
+ _ro = null;
9703
+ },
9704
+ observe: (target) => {
9705
+ var _a2;
9706
+ return (_a2 = get3()) == null ? void 0 : _a2.observe(target, { box: "border-box" });
9707
+ },
9708
+ unobserve: (target) => {
9709
+ var _a2;
9710
+ return (_a2 = get3()) == null ? void 0 : _a2.unobserve(target);
9639
9711
  }
9640
- return null;
9641
9712
  };
9642
- _this.onStart = function(evt) {
9643
- if (_this.lastScrollTop)
9713
+ })();
9714
+ this.range = null;
9715
+ this.setOptions = (opts2) => {
9716
+ Object.entries(opts2).forEach(([key2, value]) => {
9717
+ if (typeof value === "undefined") delete opts2[key2];
9718
+ });
9719
+ this.options = {
9720
+ debug: false,
9721
+ initialOffset: 0,
9722
+ overscan: 1,
9723
+ paddingStart: 0,
9724
+ paddingEnd: 0,
9725
+ scrollPaddingStart: 0,
9726
+ scrollPaddingEnd: 0,
9727
+ horizontal: false,
9728
+ getItemKey: defaultKeyExtractor,
9729
+ rangeExtractor: defaultRangeExtractor,
9730
+ onChange: () => {
9731
+ },
9732
+ measureElement,
9733
+ initialRect: { width: 0, height: 0 },
9734
+ scrollMargin: 0,
9735
+ gap: 0,
9736
+ indexAttribute: "data-index",
9737
+ initialMeasurementsCache: [],
9738
+ lanes: 1,
9739
+ isScrollingResetDelay: 150,
9740
+ enabled: true,
9741
+ isRtl: false,
9742
+ useScrollendEvent: true,
9743
+ ...opts2
9744
+ };
9745
+ };
9746
+ this.notify = (sync2) => {
9747
+ var _a2, _b;
9748
+ (_b = (_a2 = this.options).onChange) == null ? void 0 : _b.call(_a2, this, sync2);
9749
+ };
9750
+ this.maybeNotify = memo(
9751
+ () => {
9752
+ this.calculateRange();
9753
+ return [
9754
+ this.isScrolling,
9755
+ this.range ? this.range.startIndex : null,
9756
+ this.range ? this.range.endIndex : null
9757
+ ];
9758
+ },
9759
+ (isScrolling) => {
9760
+ this.notify(isScrolling);
9761
+ },
9762
+ {
9763
+ key: process.env.NODE_ENV !== "production" && "maybeNotify",
9764
+ debug: () => this.options.debug,
9765
+ initialDeps: [
9766
+ this.isScrolling,
9767
+ this.range ? this.range.startIndex : null,
9768
+ this.range ? this.range.endIndex : null
9769
+ ]
9770
+ }
9771
+ );
9772
+ this.cleanup = () => {
9773
+ this.unsubs.filter(Boolean).forEach((d2) => d2());
9774
+ this.unsubs = [];
9775
+ this.observer.disconnect();
9776
+ this.scrollElement = null;
9777
+ this.targetWindow = null;
9778
+ };
9779
+ this._didMount = () => {
9780
+ return () => {
9781
+ this.cleanup();
9782
+ };
9783
+ };
9784
+ this._willUpdate = () => {
9785
+ var _a2;
9786
+ const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
9787
+ if (this.scrollElement !== scrollElement) {
9788
+ this.cleanup();
9789
+ if (!scrollElement) {
9790
+ this.maybeNotify();
9644
9791
  return;
9645
- _this.dragging = true;
9646
- if (evt instanceof MouseEvent) {
9647
- _this.startY = evt.pageY;
9648
- } else if (evt instanceof TouchEvent) {
9649
- _this.startY = evt.touches[0].pageY;
9650
9792
  }
9651
- _this.currentY = _this.startY;
9652
- if (_this._infScroll) {
9653
- _this._infScroll.style.willChange = "transform";
9654
- _this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
9793
+ this.scrollElement = scrollElement;
9794
+ if (this.scrollElement && "ownerDocument" in this.scrollElement) {
9795
+ this.targetWindow = this.scrollElement.ownerDocument.defaultView;
9796
+ } else {
9797
+ this.targetWindow = ((_a2 = this.scrollElement) == null ? void 0 : _a2.window) ?? null;
9655
9798
  }
9656
- };
9657
- _this.onMove = function(evt) {
9658
- if (!_this.dragging)
9659
- return;
9660
- if (evt instanceof MouseEvent) {
9661
- _this.currentY = evt.pageY;
9662
- } else if (evt instanceof TouchEvent) {
9663
- _this.currentY = evt.touches[0].pageY;
9799
+ this.elementsCache.forEach((cached) => {
9800
+ this.observer.observe(cached);
9801
+ });
9802
+ this._scrollToOffset(this.getScrollOffset(), {
9803
+ adjustments: void 0,
9804
+ behavior: void 0
9805
+ });
9806
+ this.unsubs.push(
9807
+ this.options.observeElementRect(this, (rect) => {
9808
+ this.scrollRect = rect;
9809
+ this.maybeNotify();
9810
+ })
9811
+ );
9812
+ this.unsubs.push(
9813
+ this.options.observeElementOffset(this, (offset, isScrolling) => {
9814
+ this.scrollAdjustments = 0;
9815
+ this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
9816
+ this.scrollOffset = offset;
9817
+ this.isScrolling = isScrolling;
9818
+ this.maybeNotify();
9819
+ })
9820
+ );
9821
+ }
9822
+ };
9823
+ this.getSize = () => {
9824
+ if (!this.options.enabled) {
9825
+ this.scrollRect = null;
9826
+ return 0;
9827
+ }
9828
+ this.scrollRect = this.scrollRect ?? this.options.initialRect;
9829
+ return this.scrollRect[this.options.horizontal ? "width" : "height"];
9830
+ };
9831
+ this.getScrollOffset = () => {
9832
+ if (!this.options.enabled) {
9833
+ this.scrollOffset = null;
9834
+ return 0;
9835
+ }
9836
+ this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
9837
+ return this.scrollOffset;
9838
+ };
9839
+ this.getFurthestMeasurement = (measurements, index2) => {
9840
+ const furthestMeasurementsFound = /* @__PURE__ */ new Map();
9841
+ const furthestMeasurements = /* @__PURE__ */ new Map();
9842
+ for (let m2 = index2 - 1; m2 >= 0; m2--) {
9843
+ const measurement = measurements[m2];
9844
+ if (furthestMeasurementsFound.has(measurement.lane)) {
9845
+ continue;
9664
9846
  }
9665
- if (_this.currentY < _this.startY)
9666
- return;
9667
- if (_this.currentY - _this.startY >= Number(_this.props.pullDownToRefreshThreshold)) {
9668
- _this.setState({
9669
- pullToRefreshThresholdBreached: true
9670
- });
9847
+ const previousFurthestMeasurement = furthestMeasurements.get(
9848
+ measurement.lane
9849
+ );
9850
+ if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
9851
+ furthestMeasurements.set(measurement.lane, measurement);
9852
+ } else if (measurement.end < previousFurthestMeasurement.end) {
9853
+ furthestMeasurementsFound.set(measurement.lane, true);
9671
9854
  }
9672
- if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
9673
- return;
9674
- if (_this._infScroll) {
9675
- _this._infScroll.style.overflow = "visible";
9676
- _this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY - _this.startY) + "px, 0px)";
9855
+ if (furthestMeasurementsFound.size === this.options.lanes) {
9856
+ break;
9677
9857
  }
9678
- };
9679
- _this.onEnd = function() {
9680
- _this.startY = 0;
9681
- _this.currentY = 0;
9682
- _this.dragging = false;
9683
- if (_this.state.pullToRefreshThresholdBreached) {
9684
- _this.props.refreshFunction && _this.props.refreshFunction();
9685
- _this.setState({
9686
- pullToRefreshThresholdBreached: false
9687
- });
9858
+ }
9859
+ return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a2, b2) => {
9860
+ if (a2.end === b2.end) {
9861
+ return a2.index - b2.index;
9688
9862
  }
9689
- requestAnimationFrame(function() {
9690
- if (_this._infScroll) {
9691
- _this._infScroll.style.overflow = "auto";
9692
- _this._infScroll.style.transform = "none";
9693
- _this._infScroll.style.willChange = "unset";
9694
- }
9695
- });
9696
- };
9697
- _this.onScrollListener = function(event) {
9698
- if (typeof _this.props.onScroll === "function") {
9699
- setTimeout(function() {
9700
- return _this.props.onScroll && _this.props.onScroll(event);
9701
- }, 0);
9863
+ return a2.end - b2.end;
9864
+ })[0] : void 0;
9865
+ };
9866
+ this.getMeasurementOptions = memo(
9867
+ () => [
9868
+ this.options.count,
9869
+ this.options.paddingStart,
9870
+ this.options.scrollMargin,
9871
+ this.options.getItemKey,
9872
+ this.options.enabled
9873
+ ],
9874
+ (count, paddingStart, scrollMargin, getItemKey, enabled) => {
9875
+ this.pendingMeasuredCacheIndexes = [];
9876
+ return {
9877
+ count,
9878
+ paddingStart,
9879
+ scrollMargin,
9880
+ getItemKey,
9881
+ enabled
9882
+ };
9883
+ },
9884
+ {
9885
+ key: false
9886
+ }
9887
+ );
9888
+ this.getMeasurements = memo(
9889
+ () => [this.getMeasurementOptions(), this.itemSizeCache],
9890
+ ({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
9891
+ if (!enabled) {
9892
+ this.measurementsCache = [];
9893
+ this.itemSizeCache.clear();
9894
+ return [];
9895
+ }
9896
+ if (this.measurementsCache.length === 0) {
9897
+ this.measurementsCache = this.options.initialMeasurementsCache;
9898
+ this.measurementsCache.forEach((item2) => {
9899
+ this.itemSizeCache.set(item2.key, item2.size);
9900
+ });
9702
9901
  }
9703
- var target = _this.props.height || _this._scrollableNode ? event.target : document.documentElement.scrollTop ? document.documentElement : document.body;
9704
- if (_this.actionTriggered)
9705
- return;
9706
- var atBottom = _this.props.inverse ? _this.isElementAtTop(target, _this.props.scrollThreshold) : _this.isElementAtBottom(target, _this.props.scrollThreshold);
9707
- if (atBottom && _this.props.hasMore) {
9708
- _this.actionTriggered = true;
9709
- _this.setState({ showLoader: true });
9710
- _this.props.next && _this.props.next();
9902
+ const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
9903
+ this.pendingMeasuredCacheIndexes = [];
9904
+ const measurements = this.measurementsCache.slice(0, min);
9905
+ for (let i = min; i < count; i++) {
9906
+ const key2 = getItemKey(i);
9907
+ const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
9908
+ const start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
9909
+ const measuredSize = itemSizeCache.get(key2);
9910
+ const size2 = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
9911
+ const end = start + size2;
9912
+ const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
9913
+ measurements[i] = {
9914
+ index: i,
9915
+ start,
9916
+ size: size2,
9917
+ end,
9918
+ key: key2,
9919
+ lane
9920
+ };
9711
9921
  }
9712
- _this.lastScrollTop = target.scrollTop;
9713
- };
9714
- _this.state = {
9715
- showLoader: false,
9716
- pullToRefreshThresholdBreached: false,
9717
- prevDataLength: props.dataLength
9718
- };
9719
- _this.throttledOnScrollListener = throttle$1(150, _this.onScrollListener).bind(_this);
9720
- _this.onStart = _this.onStart.bind(_this);
9721
- _this.onMove = _this.onMove.bind(_this);
9722
- _this.onEnd = _this.onEnd.bind(_this);
9723
- return _this;
9724
- }
9725
- InfiniteScroll2.prototype.componentDidMount = function() {
9726
- if (typeof this.props.dataLength === "undefined") {
9727
- throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');
9728
- }
9729
- this._scrollableNode = this.getScrollableTarget();
9730
- this.el = this.props.height ? this._infScroll : this._scrollableNode || window;
9731
- if (this.el) {
9732
- this.el.addEventListener("scroll", this.throttledOnScrollListener);
9733
- }
9734
- if (typeof this.props.initialScrollY === "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY) {
9735
- this.el.scrollTo(0, this.props.initialScrollY);
9736
- }
9737
- if (this.props.pullDownToRefresh && this.el) {
9738
- this.el.addEventListener("touchstart", this.onStart);
9739
- this.el.addEventListener("touchmove", this.onMove);
9740
- this.el.addEventListener("touchend", this.onEnd);
9741
- this.el.addEventListener("mousedown", this.onStart);
9742
- this.el.addEventListener("mousemove", this.onMove);
9743
- this.el.addEventListener("mouseup", this.onEnd);
9744
- this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0;
9745
- this.forceUpdate();
9746
- if (typeof this.props.refreshFunction !== "function") {
9747
- throw new Error(`Mandatory prop "refreshFunction" missing.
9748
- Pull Down To Refresh functionality will not work
9749
- as expected. Check README.md for usage'`);
9922
+ this.measurementsCache = measurements;
9923
+ return measurements;
9924
+ },
9925
+ {
9926
+ key: process.env.NODE_ENV !== "production" && "getMeasurements",
9927
+ debug: () => this.options.debug
9928
+ }
9929
+ );
9930
+ this.calculateRange = memo(
9931
+ () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
9932
+ (measurements, outerSize, scrollOffset) => {
9933
+ return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
9934
+ measurements,
9935
+ outerSize,
9936
+ scrollOffset
9937
+ }) : null;
9938
+ },
9939
+ {
9940
+ key: process.env.NODE_ENV !== "production" && "calculateRange",
9941
+ debug: () => this.options.debug
9942
+ }
9943
+ );
9944
+ this.getIndexes = memo(
9945
+ () => [
9946
+ this.options.rangeExtractor,
9947
+ this.calculateRange(),
9948
+ this.options.overscan,
9949
+ this.options.count
9950
+ ],
9951
+ (rangeExtractor, range2, overscan, count) => {
9952
+ return range2 === null ? [] : rangeExtractor({
9953
+ startIndex: range2.startIndex,
9954
+ endIndex: range2.endIndex,
9955
+ overscan,
9956
+ count
9957
+ });
9958
+ },
9959
+ {
9960
+ key: process.env.NODE_ENV !== "production" && "getIndexes",
9961
+ debug: () => this.options.debug
9962
+ }
9963
+ );
9964
+ this.indexFromElement = (node2) => {
9965
+ const attributeName = this.options.indexAttribute;
9966
+ const indexStr = node2.getAttribute(attributeName);
9967
+ if (!indexStr) {
9968
+ console.warn(
9969
+ `Missing attribute name '${attributeName}={index}' on measured element.`
9970
+ );
9971
+ return -1;
9972
+ }
9973
+ return parseInt(indexStr, 10);
9974
+ };
9975
+ this._measureElement = (node2, entry) => {
9976
+ const index2 = this.indexFromElement(node2);
9977
+ const item2 = this.measurementsCache[index2];
9978
+ if (!item2) {
9979
+ return;
9980
+ }
9981
+ const key2 = item2.key;
9982
+ const prevNode = this.elementsCache.get(key2);
9983
+ if (prevNode !== node2) {
9984
+ if (prevNode) {
9985
+ this.observer.unobserve(prevNode);
9750
9986
  }
9987
+ this.observer.observe(node2);
9988
+ this.elementsCache.set(key2, node2);
9989
+ }
9990
+ if (node2.isConnected) {
9991
+ this.resizeItem(index2, this.options.measureElement(node2, entry, this));
9751
9992
  }
9752
9993
  };
9753
- InfiniteScroll2.prototype.componentWillUnmount = function() {
9754
- if (this.el) {
9755
- this.el.removeEventListener("scroll", this.throttledOnScrollListener);
9756
- if (this.props.pullDownToRefresh) {
9757
- this.el.removeEventListener("touchstart", this.onStart);
9758
- this.el.removeEventListener("touchmove", this.onMove);
9759
- this.el.removeEventListener("touchend", this.onEnd);
9760
- this.el.removeEventListener("mousedown", this.onStart);
9761
- this.el.removeEventListener("mousemove", this.onMove);
9762
- this.el.removeEventListener("mouseup", this.onEnd);
9994
+ this.resizeItem = (index2, size2) => {
9995
+ const item2 = this.measurementsCache[index2];
9996
+ if (!item2) {
9997
+ return;
9998
+ }
9999
+ const itemSize = this.itemSizeCache.get(item2.key) ?? item2.size;
10000
+ const delta = size2 - itemSize;
10001
+ if (delta !== 0) {
10002
+ if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item2, delta, this) : item2.start < this.getScrollOffset() + this.scrollAdjustments) {
10003
+ if (process.env.NODE_ENV !== "production" && this.options.debug) {
10004
+ console.info("correction", delta);
10005
+ }
10006
+ this._scrollToOffset(this.getScrollOffset(), {
10007
+ adjustments: this.scrollAdjustments += delta,
10008
+ behavior: void 0
10009
+ });
9763
10010
  }
10011
+ this.pendingMeasuredCacheIndexes.push(item2.index);
10012
+ this.itemSizeCache = new Map(this.itemSizeCache.set(item2.key, size2));
10013
+ this.notify(false);
9764
10014
  }
9765
10015
  };
9766
- InfiniteScroll2.prototype.componentDidUpdate = function(prevProps) {
9767
- if (this.props.dataLength === prevProps.dataLength)
10016
+ this.measureElement = (node2) => {
10017
+ if (!node2) {
10018
+ this.elementsCache.forEach((cached, key2) => {
10019
+ if (!cached.isConnected) {
10020
+ this.observer.unobserve(cached);
10021
+ this.elementsCache.delete(key2);
10022
+ }
10023
+ });
9768
10024
  return;
9769
- this.actionTriggered = false;
9770
- this.setState({
9771
- showLoader: false
9772
- });
10025
+ }
10026
+ this._measureElement(node2, void 0);
10027
+ };
10028
+ this.getVirtualItems = memo(
10029
+ () => [this.getIndexes(), this.getMeasurements()],
10030
+ (indexes, measurements) => {
10031
+ const virtualItems = [];
10032
+ for (let k2 = 0, len = indexes.length; k2 < len; k2++) {
10033
+ const i = indexes[k2];
10034
+ const measurement = measurements[i];
10035
+ virtualItems.push(measurement);
10036
+ }
10037
+ return virtualItems;
10038
+ },
10039
+ {
10040
+ key: process.env.NODE_ENV !== "production" && "getVirtualItems",
10041
+ debug: () => this.options.debug
10042
+ }
10043
+ );
10044
+ this.getVirtualItemForOffset = (offset) => {
10045
+ const measurements = this.getMeasurements();
10046
+ if (measurements.length === 0) {
10047
+ return void 0;
10048
+ }
10049
+ return notUndefined(
10050
+ measurements[findNearestBinarySearch(
10051
+ 0,
10052
+ measurements.length - 1,
10053
+ (index2) => notUndefined(measurements[index2]).start,
10054
+ offset
10055
+ )]
10056
+ );
9773
10057
  };
9774
- InfiniteScroll2.getDerivedStateFromProps = function(nextProps, prevState) {
9775
- var dataLengthChanged = nextProps.dataLength !== prevState.prevDataLength;
9776
- if (dataLengthChanged) {
9777
- return __assign$1(__assign$1({}, prevState), { prevDataLength: nextProps.dataLength });
10058
+ this.getOffsetForAlignment = (toOffset, align) => {
10059
+ const size2 = this.getSize();
10060
+ const scrollOffset = this.getScrollOffset();
10061
+ if (align === "auto") {
10062
+ if (toOffset <= scrollOffset) {
10063
+ align = "start";
10064
+ } else if (toOffset >= scrollOffset + size2) {
10065
+ align = "end";
10066
+ } else {
10067
+ align = "start";
10068
+ }
9778
10069
  }
9779
- return null;
10070
+ if (align === "start") {
10071
+ toOffset = toOffset;
10072
+ } else if (align === "end") {
10073
+ toOffset = toOffset - size2;
10074
+ } else if (align === "center") {
10075
+ toOffset = toOffset - size2 / 2;
10076
+ }
10077
+ const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
10078
+ const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
10079
+ const maxOffset = scrollSize - size2;
10080
+ return Math.max(Math.min(maxOffset, toOffset), 0);
9780
10081
  };
9781
- InfiniteScroll2.prototype.isElementAtTop = function(target, scrollThreshold) {
9782
- if (scrollThreshold === void 0) {
9783
- scrollThreshold = 0.8;
10082
+ this.getOffsetForIndex = (index2, align = "auto") => {
10083
+ index2 = Math.max(0, Math.min(index2, this.options.count - 1));
10084
+ const item2 = this.measurementsCache[index2];
10085
+ if (!item2) {
10086
+ return void 0;
9784
10087
  }
9785
- var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9786
- var threshold = parseThreshold(scrollThreshold);
9787
- if (threshold.unit === ThresholdUnits.Pixel) {
9788
- return target.scrollTop <= threshold.value + clientHeight - target.scrollHeight + 1;
10088
+ const size2 = this.getSize();
10089
+ const scrollOffset = this.getScrollOffset();
10090
+ if (align === "auto") {
10091
+ if (item2.end >= scrollOffset + size2 - this.options.scrollPaddingEnd) {
10092
+ align = "end";
10093
+ } else if (item2.start <= scrollOffset + this.options.scrollPaddingStart) {
10094
+ align = "start";
10095
+ } else {
10096
+ return [scrollOffset, align];
10097
+ }
9789
10098
  }
9790
- return target.scrollTop <= threshold.value / 100 + clientHeight - target.scrollHeight + 1;
10099
+ const toOffset = align === "end" ? item2.end + this.options.scrollPaddingEnd : item2.start - this.options.scrollPaddingStart;
10100
+ return [this.getOffsetForAlignment(toOffset, align), align];
9791
10101
  };
9792
- InfiniteScroll2.prototype.isElementAtBottom = function(target, scrollThreshold) {
9793
- if (scrollThreshold === void 0) {
9794
- scrollThreshold = 0.8;
10102
+ this.isDynamicMode = () => this.elementsCache.size > 0;
10103
+ this.cancelScrollToIndex = () => {
10104
+ if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
10105
+ this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
10106
+ this.scrollToIndexTimeoutId = null;
9795
10107
  }
9796
- var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9797
- var threshold = parseThreshold(scrollThreshold);
9798
- if (threshold.unit === ThresholdUnits.Pixel) {
9799
- return target.scrollTop + clientHeight >= target.scrollHeight - threshold.value;
10108
+ };
10109
+ this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
10110
+ this.cancelScrollToIndex();
10111
+ if (behavior === "smooth" && this.isDynamicMode()) {
10112
+ console.warn(
10113
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
10114
+ );
9800
10115
  }
9801
- return target.scrollTop + clientHeight >= threshold.value / 100 * target.scrollHeight;
10116
+ this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
10117
+ adjustments: void 0,
10118
+ behavior
10119
+ });
9802
10120
  };
9803
- InfiniteScroll2.prototype.render = function() {
9804
- var _this = this;
9805
- var style = __assign$1({ height: this.props.height || "auto", overflow: "auto", WebkitOverflowScrolling: "touch" }, this.props.style);
9806
- var hasChildren2 = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length);
9807
- var outerDivStyle = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
9808
- return React__default.createElement(
9809
- "div",
9810
- { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
9811
- React__default.createElement(
9812
- "div",
9813
- { className: "infinite-scroll-component " + (this.props.className || ""), ref: function(infScroll) {
9814
- return _this._infScroll = infScroll;
9815
- }, style },
9816
- this.props.pullDownToRefresh && React__default.createElement(
9817
- "div",
9818
- { style: { position: "relative" }, ref: function(pullDown) {
9819
- return _this._pullDown = pullDown;
9820
- } },
9821
- React__default.createElement("div", { style: {
9822
- position: "absolute",
9823
- left: 0,
9824
- right: 0,
9825
- top: -1 * this.maxPullDownDistance
9826
- } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)
9827
- ),
9828
- this.props.children,
9829
- !this.state.showLoader && !hasChildren2 && this.props.hasMore && this.props.loader,
9830
- this.state.showLoader && this.props.hasMore && this.props.loader,
9831
- !this.props.hasMore && this.props.endMessage
9832
- )
10121
+ this.scrollToIndex = (index2, { align: initialAlign = "auto", behavior } = {}) => {
10122
+ index2 = Math.max(0, Math.min(index2, this.options.count - 1));
10123
+ this.cancelScrollToIndex();
10124
+ if (behavior === "smooth" && this.isDynamicMode()) {
10125
+ console.warn(
10126
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
10127
+ );
10128
+ }
10129
+ const offsetAndAlign = this.getOffsetForIndex(index2, initialAlign);
10130
+ if (!offsetAndAlign) return;
10131
+ const [offset, align] = offsetAndAlign;
10132
+ this._scrollToOffset(offset, { adjustments: void 0, behavior });
10133
+ if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
10134
+ this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
10135
+ this.scrollToIndexTimeoutId = null;
10136
+ const elementInDOM = this.elementsCache.has(
10137
+ this.options.getItemKey(index2)
10138
+ );
10139
+ if (elementInDOM) {
10140
+ const [latestOffset] = notUndefined(
10141
+ this.getOffsetForIndex(index2, align)
10142
+ );
10143
+ if (!approxEqual(latestOffset, this.getScrollOffset())) {
10144
+ this.scrollToIndex(index2, { align, behavior });
10145
+ }
10146
+ } else {
10147
+ this.scrollToIndex(index2, { align, behavior });
10148
+ }
10149
+ });
10150
+ }
10151
+ };
10152
+ this.scrollBy = (delta, { behavior } = {}) => {
10153
+ this.cancelScrollToIndex();
10154
+ if (behavior === "smooth" && this.isDynamicMode()) {
10155
+ console.warn(
10156
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
10157
+ );
10158
+ }
10159
+ this._scrollToOffset(this.getScrollOffset() + delta, {
10160
+ adjustments: void 0,
10161
+ behavior
10162
+ });
10163
+ };
10164
+ this.getTotalSize = () => {
10165
+ var _a2;
10166
+ const measurements = this.getMeasurements();
10167
+ let end;
10168
+ if (measurements.length === 0) {
10169
+ end = this.options.paddingStart;
10170
+ } else {
10171
+ end = this.options.lanes === 1 ? ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0 : Math.max(
10172
+ ...measurements.slice(-this.options.lanes).map((m2) => m2.end)
10173
+ );
10174
+ }
10175
+ return Math.max(
10176
+ end - this.options.scrollMargin + this.options.paddingEnd,
10177
+ 0
9833
10178
  );
9834
10179
  };
9835
- return InfiniteScroll2;
9836
- }(Component$1)
9837
- );
9838
- const inputInTable$8 = "_inputInTable_7sjlf_1";
9839
- const inputHover$8 = "_inputHover_7sjlf_13";
9840
- const inputFocus$8 = "_inputFocus_7sjlf_18";
9841
- const inputError$8 = "_inputError_7sjlf_25";
9842
- const inputWarning$8 = "_inputWarning_7sjlf_26";
9843
- const inputDisabled$8 = "_inputDisabled_7sjlf_61";
9844
- const hideScrollbars$8 = "_hideScrollbars_7sjlf_67";
9845
- const header$1 = "_header_7sjlf_77";
9846
- const headerTitle = "_headerTitle_7sjlf_77";
9847
- const heading$3 = "_heading_7sjlf_78";
9848
- const itemHeader = "_itemHeader_7sjlf_78";
9849
- const narrow = "_narrow_7sjlf_81";
9850
- const stickyHeader = "_stickyHeader_7sjlf_85";
9851
- const title$3 = "_title_7sjlf_96";
9852
- const name = "_name_7sjlf_102";
9853
- const iconTooltipMargin = "_iconTooltipMargin_7sjlf_105";
9854
- const bold = "_bold_7sjlf_108";
9855
- const toggleNarrow = "_toggleNarrow_7sjlf_117";
9856
- const drag$1 = "_drag_7sjlf_135";
9857
- const dragOverlay$1 = "_dragOverlay_7sjlf_156";
9858
- const list$1 = "_list_7sjlf_161";
9859
- const bordered$1 = "_bordered_7sjlf_165";
9860
- const item$4 = "_item_7sjlf_78";
9861
- const action = "_action_7sjlf_198";
9862
- const active$3 = "_active_7sjlf_201";
9863
- const indented = "_indented_7sjlf_208";
9864
- const disabled$5 = "_disabled_7sjlf_221";
9865
- const label$6 = "_label_7sjlf_232";
9866
- const details$2 = "_details_7sjlf_243";
9867
- const metadata = "_metadata_7sjlf_244";
9868
- const itemContent = "_itemContent_7sjlf_252";
9869
- const indentIcon = "_indentIcon_7sjlf_259";
9870
- const expandIcon = "_expandIcon_7sjlf_264";
9871
- const expanded = "_expanded_7sjlf_271";
9872
- const right$4 = "_right_7sjlf_274";
9873
- const actions = "_actions_7sjlf_282";
9874
- const scrollableList = "_scrollableList_7sjlf_287";
9875
- const infiniteScrollContainer = "_infiniteScrollContainer_7sjlf_292";
9876
- const hideScrollbar = "_hideScrollbar_7sjlf_67";
9877
- const noPointerEvents = "_noPointerEvents_7sjlf_309";
10180
+ this._scrollToOffset = (offset, {
10181
+ adjustments,
10182
+ behavior
10183
+ }) => {
10184
+ this.options.scrollToFn(offset, { behavior, adjustments }, this);
10185
+ };
10186
+ this.measure = () => {
10187
+ this.itemSizeCache = /* @__PURE__ */ new Map();
10188
+ this.notify(false);
10189
+ };
10190
+ this.setOptions(opts);
10191
+ }
10192
+ }
10193
+ const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
10194
+ while (low <= high) {
10195
+ const middle = (low + high) / 2 | 0;
10196
+ const currentValue = getCurrentValue(middle);
10197
+ if (currentValue < value) {
10198
+ low = middle + 1;
10199
+ } else if (currentValue > value) {
10200
+ high = middle - 1;
10201
+ } else {
10202
+ return middle;
10203
+ }
10204
+ }
10205
+ if (low > 0) {
10206
+ return low - 1;
10207
+ } else {
10208
+ return 0;
10209
+ }
10210
+ };
10211
+ function calculateRange({
10212
+ measurements,
10213
+ outerSize,
10214
+ scrollOffset
10215
+ }) {
10216
+ const count = measurements.length - 1;
10217
+ const getOffset2 = (index2) => measurements[index2].start;
10218
+ const startIndex = findNearestBinarySearch(0, count, getOffset2, scrollOffset);
10219
+ let endIndex = startIndex;
10220
+ while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
10221
+ endIndex++;
10222
+ }
10223
+ return { startIndex, endIndex };
10224
+ }
10225
+ const useIsomorphicLayoutEffect$5 = typeof document !== "undefined" ? React$4.useLayoutEffect : React$4.useEffect;
10226
+ function useVirtualizerBase(options) {
10227
+ const rerender = React$4.useReducer(() => ({}), {})[1];
10228
+ const resolvedOptions = {
10229
+ ...options,
10230
+ onChange: (instance2, sync2) => {
10231
+ var _a2;
10232
+ if (sync2) {
10233
+ flushSync$1(rerender);
10234
+ } else {
10235
+ rerender();
10236
+ }
10237
+ (_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync2);
10238
+ }
10239
+ };
10240
+ const [instance] = React$4.useState(
10241
+ () => new Virtualizer(resolvedOptions)
10242
+ );
10243
+ instance.setOptions(resolvedOptions);
10244
+ React$4.useEffect(() => {
10245
+ return instance._didMount();
10246
+ }, []);
10247
+ useIsomorphicLayoutEffect$5(() => {
10248
+ return instance._willUpdate();
10249
+ });
10250
+ return instance;
10251
+ }
10252
+ function useVirtualizer(options) {
10253
+ return useVirtualizerBase({
10254
+ observeElementRect,
10255
+ observeElementOffset,
10256
+ scrollToFn: elementScroll,
10257
+ ...options
10258
+ });
10259
+ }
10260
+ const inputInTable$8 = "_inputInTable_snjei_1";
10261
+ const inputHover$8 = "_inputHover_snjei_13";
10262
+ const inputFocus$8 = "_inputFocus_snjei_18";
10263
+ const inputError$8 = "_inputError_snjei_25";
10264
+ const inputWarning$8 = "_inputWarning_snjei_26";
10265
+ const inputDisabled$8 = "_inputDisabled_snjei_61";
10266
+ const hideScrollbars$8 = "_hideScrollbars_snjei_67";
10267
+ const list$1 = "_list_snjei_77";
10268
+ const bordered$1 = "_bordered_snjei_83";
10269
+ const virtualRow = "_virtualRow_snjei_87";
10270
+ const item$4 = "_item_snjei_87";
10271
+ const header$1 = "_header_snjei_90";
10272
+ const headerTitle = "_headerTitle_snjei_90";
10273
+ const heading$3 = "_heading_snjei_91";
10274
+ const itemHeader = "_itemHeader_snjei_91";
10275
+ const narrow = "_narrow_snjei_94";
10276
+ const stickyHeader = "_stickyHeader_snjei_98";
10277
+ const title$3 = "_title_snjei_109";
10278
+ const name = "_name_snjei_115";
10279
+ const iconTooltipMargin = "_iconTooltipMargin_snjei_118";
10280
+ const bold = "_bold_snjei_121";
10281
+ const toggleNarrow = "_toggleNarrow_snjei_132";
10282
+ const drag$1 = "_drag_snjei_150";
10283
+ const dragOverlay$1 = "_dragOverlay_snjei_171";
10284
+ const listContent = "_listContent_snjei_176";
10285
+ const action = "_action_snjei_203";
10286
+ const active$3 = "_active_snjei_206";
10287
+ const indented = "_indented_snjei_213";
10288
+ const disabled$5 = "_disabled_snjei_226";
10289
+ const label$6 = "_label_snjei_237";
10290
+ const details$2 = "_details_snjei_248";
10291
+ const metadata = "_metadata_snjei_249";
10292
+ const itemContent = "_itemContent_snjei_257";
10293
+ const indentIcon = "_indentIcon_snjei_264";
10294
+ const expandIcon = "_expandIcon_snjei_269";
10295
+ const expanded = "_expanded_snjei_276";
10296
+ const right$4 = "_right_snjei_279";
10297
+ const actions = "_actions_snjei_287";
10298
+ const hideScrollbar = "_hideScrollbar_snjei_67";
10299
+ const noPointerEvents = "_noPointerEvents_snjei_302";
10300
+ const virtualRows = "_virtualRows_snjei_305";
9878
10301
  const listStyles = {
9879
10302
  inputInTable: inputInTable$8,
9880
10303
  inputHover: inputHover$8,
@@ -9883,6 +10306,10 @@ const listStyles = {
9883
10306
  inputWarning: inputWarning$8,
9884
10307
  inputDisabled: inputDisabled$8,
9885
10308
  hideScrollbars: hideScrollbars$8,
10309
+ list: list$1,
10310
+ bordered: bordered$1,
10311
+ virtualRow,
10312
+ item: item$4,
9886
10313
  header: header$1,
9887
10314
  headerTitle,
9888
10315
  heading: heading$3,
@@ -9896,9 +10323,7 @@ const listStyles = {
9896
10323
  toggleNarrow,
9897
10324
  drag: drag$1,
9898
10325
  dragOverlay: dragOverlay$1,
9899
- list: list$1,
9900
- bordered: bordered$1,
9901
- item: item$4,
10326
+ listContent,
9902
10327
  action,
9903
10328
  active: active$3,
9904
10329
  indented,
@@ -9912,10 +10337,9 @@ const listStyles = {
9912
10337
  expanded,
9913
10338
  right: right$4,
9914
10339
  actions,
9915
- scrollableList,
9916
- infiniteScrollContainer,
9917
10340
  hideScrollbar,
9918
- noPointerEvents
10341
+ noPointerEvents,
10342
+ virtualRows
9919
10343
  };
9920
10344
  const ToggleNarrow = ({
9921
10345
  toggleNarrow: toggleNarrow2,
@@ -10140,9 +10564,9 @@ function isTouchEvent$2(event) {
10140
10564
  return false;
10141
10565
  }
10142
10566
  const {
10143
- TouchEvent: TouchEvent2
10567
+ TouchEvent
10144
10568
  } = getWindow(event.target);
10145
- return TouchEvent2 && event instanceof TouchEvent2;
10569
+ return TouchEvent && event instanceof TouchEvent;
10146
10570
  }
10147
10571
  function getEventCoordinates(event) {
10148
10572
  if (isTouchEvent$2(event)) {
@@ -12560,7 +12984,7 @@ var Status;
12560
12984
  Status2[Status2["Initializing"] = 1] = "Initializing";
12561
12985
  Status2[Status2["Initialized"] = 2] = "Initialized";
12562
12986
  })(Status || (Status = {}));
12563
- const DndContext$1 = /* @__PURE__ */ memo(function DndContext(_ref) {
12987
+ const DndContext$1 = /* @__PURE__ */ memo$1(function DndContext(_ref) {
12564
12988
  var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;
12565
12989
  let {
12566
12990
  id: id2,
@@ -14198,72 +14622,6 @@ const ListRow = forwardRef(
14198
14622
  return isSubheading ? /* @__PURE__ */ jsx(ListSubheading, { ref: listRowRefs, item: item2, index: index2 }, index2) : draggable ? listElementWithDrag(index2, item2) : listElement(index2, item2);
14199
14623
  }
14200
14624
  );
14201
- const loader = "_loader_477i5_1";
14202
- const fullViewPortSize = "_fullViewPortSize_477i5_7";
14203
- const cover = "_cover_477i5_14";
14204
- const dimmer = "_dimmer_477i5_21";
14205
- const content$2 = "_content_477i5_44";
14206
- const text$1 = "_text_477i5_49";
14207
- const details$1 = "_details_477i5_53";
14208
- const styles$t = {
14209
- loader,
14210
- fullViewPortSize,
14211
- cover,
14212
- dimmer,
14213
- content: content$2,
14214
- text: text$1,
14215
- details: details$1
14216
- };
14217
- const Loader = ({
14218
- width: width2,
14219
- height: height2,
14220
- text: text2 = "",
14221
- details: details2 = "",
14222
- fullViewPortSize: fullViewPortSize2 = false,
14223
- cover: cover2 = false,
14224
- children = null,
14225
- theme = Theme.DARK,
14226
- testId = null
14227
- }) => {
14228
- const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14229
- const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14230
- return /* @__PURE__ */ jsx(
14231
- "div",
14232
- {
14233
- className: cx$2(styles$t.loader, cover2 ? styles$t.cover : "", {
14234
- [styles$t.fullViewPortSize]: fullViewPortSize2
14235
- }),
14236
- style: { width: width2, height: height2 },
14237
- "data-testid": testId,
14238
- children: /* @__PURE__ */ jsx("div", { className: styles$t.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14239
- "div",
14240
- {
14241
- className: styles$t.content,
14242
- "data-testid": testId && `${testId}-content`,
14243
- children: [
14244
- children,
14245
- text2 && /* @__PURE__ */ jsx(
14246
- "div",
14247
- {
14248
- className: styles$t.text,
14249
- "data-testid": testId && `${testId}-text`,
14250
- children: text2
14251
- }
14252
- ),
14253
- details2 && /* @__PURE__ */ jsx(
14254
- "div",
14255
- {
14256
- className: styles$t.details,
14257
- "data-testid": testId && `${testId}-details`,
14258
- children: details2
14259
- }
14260
- )
14261
- ]
14262
- }
14263
- ) })
14264
- }
14265
- );
14266
- };
14267
14625
  const ListDragWrapper = ({
14268
14626
  children,
14269
14627
  draggable,
@@ -14278,15 +14636,14 @@ const ListDragWrapper = ({
14278
14636
  setDragIndex(event.active.id);
14279
14637
  };
14280
14638
  const handleDragEnd = (event) => {
14281
- var _a2, _b, _c, _d, _e2, _f, _g, _h;
14282
14639
  setDragIndex(null);
14283
14640
  const { active: active2, over } = event;
14284
- const from3 = (_b = (_a2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _a2.current) == null ? void 0 : _b.sortable.index;
14285
- const to2 = (_d = (_c = over == null ? void 0 : over.data) == null ? void 0 : _c.current) == null ? void 0 : _d.sortable.index;
14641
+ const from3 = active2 == null ? void 0 : active2.id;
14642
+ const to2 = over == null ? void 0 : over.id;
14286
14643
  if (from3 !== to2) {
14287
14644
  onListReorder({
14288
- from: (_f = (_e2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _e2.current) == null ? void 0 : _f.sortable.index,
14289
- to: (_h = (_g = over == null ? void 0 : over.data) == null ? void 0 : _g.current) == null ? void 0 : _h.sortable.index
14645
+ from: Number(from3),
14646
+ to: Number(to2)
14290
14647
  });
14291
14648
  }
14292
14649
  };
@@ -14335,58 +14692,26 @@ const List = ({
14335
14692
  height: height2,
14336
14693
  testId,
14337
14694
  scrollDetails = {
14338
- scrollable: false,
14339
14695
  hideScrollbar: false,
14340
- triggerScrollToActiveItem: false,
14341
- infiniteScroll: false,
14342
- limit: 10,
14343
- infiniteScrollTarget: void 0
14696
+ triggerScrollToActiveItem: false
14344
14697
  }
14345
14698
  }) => {
14346
- const {
14347
- scrollable,
14348
- hideScrollbar: hideScrollbar2,
14349
- triggerScrollToActiveItem,
14350
- infiniteScroll,
14351
- infiniteScrollTarget
14352
- } = scrollDetails;
14353
- const listHeadingRef = useRef(null);
14354
- const listRowRefs = useRef([]);
14699
+ const { hideScrollbar: hideScrollbar2, triggerScrollToActiveItem } = scrollDetails;
14355
14700
  const listContainerRef = useRef(null);
14356
- const MIN_ITEM_HEIGHT = 44;
14357
- const pageSize = infiniteScroll ? Math.ceil(window.innerHeight / MIN_ITEM_HEIGHT) : list2.items.length;
14358
- const [numVisibleRows, setNumVisibleRows] = useState(pageSize);
14359
- const [hasMore, setHasMore] = useState(numVisibleRows < (list2 == null ? void 0 : list2.items.length));
14360
- useEffect(() => {
14361
- listRowRefs.current = listRowRefs.current.slice(0, list2.items.length);
14362
- }, [list2.items.length]);
14363
- const loadMoreItems = () => {
14364
- if (numVisibleRows >= list2.items.length) {
14365
- setHasMore(false);
14366
- return;
14367
- }
14368
- const newVisibleRows = pageSize + numVisibleRows;
14369
- setNumVisibleRows(newVisibleRows);
14370
- };
14701
+ const MIN_ITEM_HEIGHT = 37;
14702
+ const virtualizer = useVirtualizer({
14703
+ count: list2.items.length,
14704
+ getScrollElement: () => listContainerRef.current,
14705
+ estimateSize: () => MIN_ITEM_HEIGHT,
14706
+ overscan: 5
14707
+ });
14371
14708
  const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);
14372
14709
  const setScrollToActiveItem = (activeItemIndex) => {
14373
- if (!listContainerRef.current || !listHeadingRef.current) return;
14374
- const itemBorderLength = 1;
14375
- if (triggerScrollToActiveItem && activeItemIndex >= 0) {
14376
- const itemOffsets = listRowRefs.current.reduce((acc, val, index2) => {
14377
- if (index2 < activeItemIndex) {
14378
- return acc + val.clientHeight + itemBorderLength;
14379
- }
14380
- return acc;
14381
- }, 0);
14382
- const centerOffset = listContainerRef.current.clientHeight / 2 - listRowRefs.current[activeItemIndex].clientHeight / 2;
14383
- const scrollOffset = itemOffsets - centerOffset;
14384
- if (stickyHeader2) {
14385
- const headingOffset2 = listHeadingRef.current.clientHeight / 2;
14386
- listContainerRef.current.scrollTop = scrollOffset + headingOffset2;
14387
- }
14388
- const headingOffset = listHeadingRef.current.clientHeight;
14389
- listContainerRef.current.scrollTop = scrollOffset + headingOffset;
14710
+ if (activeItemIndex >= 0) {
14711
+ virtualizer.scrollToIndex(activeItemIndex, {
14712
+ align: "center",
14713
+ behavior: "smooth"
14714
+ });
14390
14715
  }
14391
14716
  };
14392
14717
  useEffect(() => {
@@ -14394,24 +14719,18 @@ const List = ({
14394
14719
  const activeItemIndex = findFirstActiveItemIndex(list2 == null ? void 0 : list2.items);
14395
14720
  setScrollToActiveItem(activeItemIndex);
14396
14721
  }
14397
- }, [
14398
- listContainerRef.current,
14399
- listHeadingRef.current,
14400
- triggerScrollToActiveItem
14401
- ]);
14402
- return /* @__PURE__ */ jsx(
14722
+ }, [triggerScrollToActiveItem]);
14723
+ return /* @__PURE__ */ jsxs(
14403
14724
  "div",
14404
14725
  {
14405
14726
  className: cx$2(
14727
+ listStyles.list,
14406
14728
  narrow2 ? listStyles.narrow : "",
14407
- scrollable ? listStyles.scrollableList : "",
14408
- hideScrollbar2 ? listStyles.hideScrollbar : ""
14729
+ bordered2 ? listStyles.bordered : ""
14409
14730
  ),
14410
14731
  "data-testid": testId,
14411
- id: "scrollableDiv",
14412
14732
  style: { height: height2, marginBottom },
14413
- ref: listContainerRef,
14414
- children: /* @__PURE__ */ jsxs(Card, { bordered: bordered2, padding: false, children: [
14733
+ children: [
14415
14734
  !noHeader && /* @__PURE__ */ jsx(
14416
14735
  ListHeading,
14417
14736
  {
@@ -14419,53 +14738,123 @@ const List = ({
14419
14738
  actions: list2.actions,
14420
14739
  toggleNarrow: toggleNarrow2,
14421
14740
  onToggleNarrow,
14422
- stickyHeader: stickyHeader2,
14423
- ref: listHeadingRef
14741
+ stickyHeader: stickyHeader2
14424
14742
  }
14425
14743
  ),
14426
- /* @__PURE__ */ jsx("div", { className: cx$2(listStyles.list, bordered2 ? listStyles.bordered : ""), children: /* @__PURE__ */ jsx(
14744
+ /* @__PURE__ */ jsx(
14427
14745
  ListDragWrapper,
14428
14746
  {
14429
14747
  draggable,
14430
14748
  list: list2,
14431
14749
  onListReorder,
14432
- children: infiniteScroll ? /* @__PURE__ */ jsx(
14433
- InfiniteScroll,
14750
+ children: /* @__PURE__ */ jsx(
14751
+ "div",
14434
14752
  {
14435
- dataLength: numVisibleRows,
14436
- next: loadMoreItems,
14437
- hasMore,
14438
- scrollableTarget: infiniteScrollTarget || "scrollableDiv",
14439
- loader: /* @__PURE__ */ jsx(Loader, {}),
14440
- className: listStyles.infiniteScrollContainer,
14441
- children: list2.items.slice(0, numVisibleRows).map((item2, index2) => /* @__PURE__ */ jsx(
14442
- ListRow,
14753
+ className: cx$2(
14754
+ listStyles.listContent,
14755
+ hideScrollbar2 ? listStyles.hideScrollbar : ""
14756
+ ),
14757
+ ref: listContainerRef,
14758
+ children: /* @__PURE__ */ jsx(
14759
+ "div",
14443
14760
  {
14444
- index: index2,
14445
- draggable,
14446
- item: item2,
14447
- expanding,
14448
- invokeEditOnRowClick,
14449
- ref: listRowRefs
14450
- },
14451
- index2
14452
- ))
14761
+ className: listStyles.virtualRows,
14762
+ style: { height: `${virtualizer.getTotalSize()}px` },
14763
+ children: virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
14764
+ "div",
14765
+ {
14766
+ "data-index": virtualRow2.index,
14767
+ className: listStyles.virtualRow,
14768
+ style: {
14769
+ transform: `translateY(${virtualRow2.start}px)`
14770
+ },
14771
+ ref: virtualizer.measureElement,
14772
+ children: /* @__PURE__ */ jsx(
14773
+ ListRow,
14774
+ {
14775
+ index: virtualRow2.index,
14776
+ draggable,
14777
+ item: list2.items[virtualRow2.index],
14778
+ expanding,
14779
+ invokeEditOnRowClick
14780
+ }
14781
+ )
14782
+ },
14783
+ virtualRow2.key
14784
+ ))
14785
+ }
14786
+ )
14453
14787
  }
14454
- ) : list2.items.map((item2, index2) => /* @__PURE__ */ jsx(
14455
- ListRow,
14456
- {
14457
- index: index2,
14458
- draggable,
14459
- item: item2,
14460
- expanding,
14461
- invokeEditOnRowClick,
14462
- ref: listRowRefs
14463
- },
14464
- index2
14465
- ))
14788
+ )
14466
14789
  }
14467
- ) })
14468
- ] })
14790
+ )
14791
+ ]
14792
+ }
14793
+ );
14794
+ };
14795
+ const loader = "_loader_477i5_1";
14796
+ const fullViewPortSize = "_fullViewPortSize_477i5_7";
14797
+ const cover = "_cover_477i5_14";
14798
+ const dimmer = "_dimmer_477i5_21";
14799
+ const content$2 = "_content_477i5_44";
14800
+ const text$1 = "_text_477i5_49";
14801
+ const details$1 = "_details_477i5_53";
14802
+ const styles$t = {
14803
+ loader,
14804
+ fullViewPortSize,
14805
+ cover,
14806
+ dimmer,
14807
+ content: content$2,
14808
+ text: text$1,
14809
+ details: details$1
14810
+ };
14811
+ const Loader = ({
14812
+ width: width2,
14813
+ height: height2,
14814
+ text: text2 = "",
14815
+ details: details2 = "",
14816
+ fullViewPortSize: fullViewPortSize2 = false,
14817
+ cover: cover2 = false,
14818
+ children = null,
14819
+ theme = Theme.DARK,
14820
+ testId = null
14821
+ }) => {
14822
+ const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14823
+ const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14824
+ return /* @__PURE__ */ jsx(
14825
+ "div",
14826
+ {
14827
+ className: cx$2(styles$t.loader, cover2 ? styles$t.cover : "", {
14828
+ [styles$t.fullViewPortSize]: fullViewPortSize2
14829
+ }),
14830
+ style: { width: width2, height: height2 },
14831
+ "data-testid": testId,
14832
+ children: /* @__PURE__ */ jsx("div", { className: styles$t.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14833
+ "div",
14834
+ {
14835
+ className: styles$t.content,
14836
+ "data-testid": testId && `${testId}-content`,
14837
+ children: [
14838
+ children,
14839
+ text2 && /* @__PURE__ */ jsx(
14840
+ "div",
14841
+ {
14842
+ className: styles$t.text,
14843
+ "data-testid": testId && `${testId}-text`,
14844
+ children: text2
14845
+ }
14846
+ ),
14847
+ details2 && /* @__PURE__ */ jsx(
14848
+ "div",
14849
+ {
14850
+ className: styles$t.details,
14851
+ "data-testid": testId && `${testId}-details`,
14852
+ children: details2
14853
+ }
14854
+ )
14855
+ ]
14856
+ }
14857
+ ) })
14469
14858
  }
14470
14859
  );
14471
14860
  };
@@ -15239,7 +15628,7 @@ const useFontsReady = () => {
15239
15628
  const getWidth = () => window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
15240
15629
  const useWindowWidth = () => {
15241
15630
  const [width2, setWidth] = useState(getWidth());
15242
- const resizeListener = debounce$2(() => setWidth(getWidth()), 150);
15631
+ const resizeListener = debounce$3(() => setWidth(getWidth()), 150);
15243
15632
  useEffect(() => {
15244
15633
  window.addEventListener("resize", resizeListener);
15245
15634
  return () => {
@@ -48001,7 +48390,7 @@ const styles$d = {
48001
48390
  active: active$2,
48002
48391
  icon: icon$1
48003
48392
  };
48004
- const TooltipIcon = memo(
48393
+ const TooltipIcon = memo$1(
48005
48394
  ({ isOpen: isOpen2, label: label2, icon: icon2, invalid }) => {
48006
48395
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
48007
48396
  /* @__PURE__ */ jsx(
@@ -48076,7 +48465,7 @@ const Sections = ({
48076
48465
  )
48077
48466
  ] }, i)) });
48078
48467
  };
48079
- const SideBar = memo(
48468
+ const SideBar = memo$1(
48080
48469
  ({
48081
48470
  options,
48082
48471
  startOpen = false,
@@ -50702,19 +51091,19 @@ const Spacer = ({
50702
51091
  }
50703
51092
  }
50704
51093
  );
50705
- const inputInTable$2 = "_inputInTable_xzacf_1";
50706
- const inputHover$2 = "_inputHover_xzacf_13";
50707
- const inputFocus$2 = "_inputFocus_xzacf_18";
50708
- const inputError$2 = "_inputError_xzacf_25";
50709
- const inputWarning$2 = "_inputWarning_xzacf_26";
50710
- const inputDisabled$2 = "_inputDisabled_xzacf_61";
50711
- const hideScrollbars$2 = "_hideScrollbars_xzacf_67";
50712
- const wrapper = "_wrapper_xzacf_85";
50713
- const bordered = "_bordered_xzacf_93";
50714
- const scroll = "_scroll_xzacf_98";
50715
- const table = "_table_xzacf_108";
50716
- const dragOverlay = "_dragOverlay_xzacf_145";
50717
- const striped = "_striped_xzacf_194";
51094
+ const inputInTable$2 = "_inputInTable_xkoxm_1";
51095
+ const inputHover$2 = "_inputHover_xkoxm_13";
51096
+ const inputFocus$2 = "_inputFocus_xkoxm_18";
51097
+ const inputError$2 = "_inputError_xkoxm_25";
51098
+ const inputWarning$2 = "_inputWarning_xkoxm_26";
51099
+ const inputDisabled$2 = "_inputDisabled_xkoxm_61";
51100
+ const hideScrollbars$2 = "_hideScrollbars_xkoxm_67";
51101
+ const wrapper = "_wrapper_xkoxm_85";
51102
+ const bordered = "_bordered_xkoxm_93";
51103
+ const scroll = "_scroll_xkoxm_98";
51104
+ const table = "_table_xkoxm_109";
51105
+ const dragOverlay = "_dragOverlay_xkoxm_145";
51106
+ const striped = "_striped_xkoxm_194";
50718
51107
  const styles$b = {
50719
51108
  inputInTable: inputInTable$2,
50720
51109
  inputHover: inputHover$2,
@@ -50820,36 +51209,6 @@ const hasActions = (rows) => rows.reduce(
50820
51209
  const hasRowActions = (rows, headers) => {
50821
51210
  return hasActions(headers) > 0 || hasActions(rows) > 0;
50822
51211
  };
50823
- const TableScrollWrapper = ({
50824
- table: table2,
50825
- children
50826
- }) => {
50827
- const { rows, infiniteScroll } = table2;
50828
- const pageSize = Math.ceil(window.innerHeight / 30);
50829
- const [visibleRows, setVisibleRows] = infiniteScroll ? useState(pageSize) : [rows.length, null];
50830
- const [hasMore, setHasMore] = infiniteScroll ? useState(visibleRows < rows.length) : [false, null];
50831
- const loadMoreItems = () => {
50832
- if (visibleRows >= rows.length && setHasMore) {
50833
- setHasMore(false);
50834
- return;
50835
- }
50836
- if (setVisibleRows) {
50837
- setVisibleRows(visibleRows + pageSize);
50838
- }
50839
- };
50840
- return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, children: infiniteScroll ? /* @__PURE__ */ jsx(
50841
- InfiniteScroll,
50842
- {
50843
- dataLength: Math.min(rows.length, visibleRows + pageSize),
50844
- next: loadMoreItems,
50845
- hasMore,
50846
- scrollableTarget: "scrollWrapper",
50847
- style: { overflow: "initial" },
50848
- loader: null,
50849
- children: children({ visibleRows })
50850
- }
50851
- ) : children({ visibleRows }) });
50852
- };
50853
51212
  const clickableRow = "_clickableRow_10f34_1";
50854
51213
  const hoverableRow = "_hoverableRow_10f34_4";
50855
51214
  const rowActive = "_rowActive_10f34_4";
@@ -51619,7 +51978,7 @@ const Row = ({
51619
51978
  animateLayoutChanges: () => false
51620
51979
  });
51621
51980
  const style = {
51622
- transform: CSS.Translate.toString(transform),
51981
+ transform: CSS.Transform.toString(transform),
51623
51982
  transition,
51624
51983
  opacity: isDragging ? 0 : void 0
51625
51984
  };
@@ -51677,6 +52036,8 @@ const Row = ({
51677
52036
  ),
51678
52037
  "data-error": error2 || null,
51679
52038
  "data-warning": warning2 || null,
52039
+ "data-index": rowIndex,
52040
+ "data-even": rowIndex % 2 === 0,
51680
52041
  style,
51681
52042
  children: [
51682
52043
  draggableTable ? getDragItem() : null,
@@ -51768,6 +52129,34 @@ const TableDragWrapper = (props) => {
51768
52129
  }
51769
52130
  );
51770
52131
  };
52132
+ const TableScrollWrapper = ({
52133
+ table: table2,
52134
+ theadRef,
52135
+ children
52136
+ }) => {
52137
+ var _a2, _b;
52138
+ if (!table2.infiniteScroll) {
52139
+ return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, children: /* @__PURE__ */ jsx("div", { className: styles$b.virtualRows, children: children({}) }) });
52140
+ }
52141
+ const containerRef = useRef(null);
52142
+ const MIN_ITEM_HEIGHT = 31;
52143
+ const virtualizer = useVirtualizer({
52144
+ count: ((_a2 = table2.rows) == null ? void 0 : _a2.length) ?? 0,
52145
+ getScrollElement: () => containerRef.current,
52146
+ estimateSize: () => MIN_ITEM_HEIGHT,
52147
+ overscan: 10
52148
+ });
52149
+ const theadHeight = ((_b = theadRef.current) == null ? void 0 : _b.clientHeight) ?? 0;
52150
+ const totalHeight = virtualizer.getTotalSize() + theadHeight;
52151
+ const items = virtualizer.getVirtualItems();
52152
+ const paddingTop = items.length > 0 ? items[0].start : 0;
52153
+ const paddingBottom = items.length > 0 ? virtualizer.getTotalSize() - items[items.length - 1].end : 0;
52154
+ const tableStyle = {
52155
+ "--virtualPaddingTop": paddingTop + "px",
52156
+ "--virtualPaddingBottom": paddingBottom + "px"
52157
+ };
52158
+ return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, ref: containerRef, children: /* @__PURE__ */ jsx("div", { className: styles$b.virtualRows, style: { height: totalHeight }, children: children({ virtualizer, tableStyle }) }) });
52159
+ };
51771
52160
  const Table = (props) => {
51772
52161
  var _a2, _b, _c, _d, _e2, _f, _g;
51773
52162
  const { onListReorder = () => {
@@ -51790,6 +52179,7 @@ const Table = (props) => {
51790
52179
  maxHeight,
51791
52180
  fixedWidth: width2
51792
52181
  } = propTable;
52182
+ const theadRef = useRef(null);
51793
52183
  const tbodyRef = useRef(null);
51794
52184
  const headers = get$2(props, "table.headers", []);
51795
52185
  const columnCount = getColumnCount(propRows, headers);
@@ -51851,7 +52241,7 @@ const Table = (props) => {
51851
52241
  testId: testId && `${testId}-title`
51852
52242
  }
51853
52243
  ),
51854
- /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, children: ({ visibleRows }) => /* @__PURE__ */ jsx(
52244
+ /* @__PURE__ */ jsx(
51855
52245
  TableDragWrapper,
51856
52246
  {
51857
52247
  colSpan,
@@ -51862,49 +52252,65 @@ const Table = (props) => {
51862
52252
  rowActions,
51863
52253
  rows,
51864
52254
  tbodyRef,
51865
- children: /* @__PURE__ */ jsxs(
51866
- "table",
51867
- {
51868
- className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
51869
- "data-testid": testId,
51870
- children: [
51871
- /* @__PURE__ */ jsx("thead", { children: headers.map((row2, rowIndex) => {
51872
- return /* @__PURE__ */ jsx(
52255
+ children: /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => {
52256
+ return /* @__PURE__ */ jsxs(
52257
+ "table",
52258
+ {
52259
+ className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
52260
+ "data-testid": testId,
52261
+ style: tableStyle,
52262
+ children: [
52263
+ /* @__PURE__ */ jsx("thead", { ref: theadRef, children: headers.map((row2, rowIndex) => {
52264
+ return /* @__PURE__ */ jsx(
52265
+ Row,
52266
+ {
52267
+ rowIndex,
52268
+ isHeader: true,
52269
+ row: row2,
52270
+ columnCount,
52271
+ columnWidths,
52272
+ colSpan,
52273
+ hasRowActions: rowActions,
52274
+ columnAlignment,
52275
+ columnHeaderAlignments,
52276
+ draggableTable: draggable
52277
+ },
52278
+ `0_${rowIndex}`
52279
+ );
52280
+ }) }),
52281
+ /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
52282
+ Row,
52283
+ {
52284
+ rowIndex: virtualRow2.index,
52285
+ row: rows[virtualRow2.index],
52286
+ columnCount,
52287
+ columnWidths,
52288
+ colSpan,
52289
+ hasRowActions: rowActions,
52290
+ columnAlignment,
52291
+ draggableTable: draggable
52292
+ },
52293
+ `1_${virtualRow2.index}`
52294
+ )) : rows.map((row2, index2) => /* @__PURE__ */ jsx(
51873
52295
  Row,
51874
52296
  {
51875
- rowIndex,
51876
- isHeader: true,
52297
+ rowIndex: index2,
51877
52298
  row: row2,
51878
52299
  columnCount,
51879
52300
  columnWidths,
51880
52301
  colSpan,
51881
52302
  hasRowActions: rowActions,
51882
52303
  columnAlignment,
51883
- columnHeaderAlignments,
51884
52304
  draggableTable: draggable
51885
52305
  },
51886
- `0_${rowIndex}`
51887
- );
51888
- }) }),
51889
- /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: rows.slice(0, visibleRows).map((row2, rowIndex) => /* @__PURE__ */ jsx(
51890
- Row,
51891
- {
51892
- rowIndex,
51893
- row: row2,
51894
- columnCount,
51895
- columnWidths,
51896
- colSpan,
51897
- hasRowActions: rowActions,
51898
- columnAlignment,
51899
- draggableTable: draggable
51900
- },
51901
- `1_${rowIndex}`
51902
- )) })
51903
- ]
51904
- }
51905
- )
52306
+ `1_${index2}`
52307
+ )) })
52308
+ ]
52309
+ }
52310
+ );
52311
+ } })
51906
52312
  }
51907
- ) }),
52313
+ ),
51908
52314
  footer2 && /* @__PURE__ */ jsx(
51909
52315
  Footer,
51910
52316
  {
@@ -55017,7 +55423,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
55017
55423
  }
55018
55424
  let refCount = 0;
55019
55425
  const INSTANCE_SYM = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
55020
- var DndProvider = /* @__PURE__ */ memo(function DndProvider2(_param) {
55426
+ var DndProvider = /* @__PURE__ */ memo$1(function DndProvider2(_param) {
55021
55427
  var { children } = _param, props = _objectWithoutProperties(_param, [
55022
55428
  "children"
55023
55429
  ]);
@@ -57378,7 +57784,7 @@ function useFeatures(props, visualElement2, preloadedFeatures) {
57378
57784
  var name_1 = featureNames[i];
57379
57785
  var _a2 = featureDefinitions[name_1], isEnabled = _a2.isEnabled, Component2 = _a2.Component;
57380
57786
  if (isEnabled(props) && Component2) {
57381
- features.push(React$4.createElement(Component2, __assign$4({ key: name_1 }, props, { visualElement: visualElement2 })));
57787
+ features.push(React$4.createElement(Component2, __assign$3({ key: name_1 }, props, { visualElement: visualElement2 })));
57382
57788
  }
57383
57789
  }
57384
57790
  return features;
@@ -57619,7 +58025,7 @@ function useProjection(projectionId, _a2, visualElement2, ProjectionNodeConstruc
57619
58025
  var VisualElementHandler = (
57620
58026
  /** @class */
57621
58027
  function(_super) {
57622
- __extends$1(VisualElementHandler2, _super);
58028
+ __extends(VisualElementHandler2, _super);
57623
58029
  function VisualElementHandler2() {
57624
58030
  return _super !== null && _super.apply(this, arguments) || this;
57625
58031
  }
@@ -57645,20 +58051,20 @@ function createMotionComponent(_a2) {
57645
58051
  preloadedFeatures && loadFeatures(preloadedFeatures);
57646
58052
  function MotionComponent(props, externalRef) {
57647
58053
  var layoutId = useLayoutId(props);
57648
- props = __assign$4(__assign$4({}, props), { layoutId });
58054
+ props = __assign$3(__assign$3({}, props), { layoutId });
57649
58055
  var config = useContext(MotionConfigContext);
57650
58056
  var features = null;
57651
58057
  var context2 = useCreateMotionContext(props);
57652
58058
  var projectionId = config.isStatic ? void 0 : useProjectionId();
57653
58059
  var visualState = useVisualState(props, config.isStatic);
57654
58060
  if (!config.isStatic && isBrowser) {
57655
- context2.visualElement = useVisualElement(Component2, visualState, __assign$4(__assign$4({}, config), props), createVisualElement);
58061
+ context2.visualElement = useVisualElement(Component2, visualState, __assign$3(__assign$3({}, config), props), createVisualElement);
57656
58062
  useProjection(projectionId, props, context2.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
57657
58063
  features = useFeatures(props, context2.visualElement, preloadedFeatures);
57658
58064
  }
57659
58065
  return React$4.createElement(
57660
58066
  VisualElementHandler,
57661
- { visualElement: context2.visualElement, props: __assign$4(__assign$4({}, config), props) },
58067
+ { visualElement: context2.visualElement, props: __assign$3(__assign$3({}, config), props) },
57662
58068
  features,
57663
58069
  React$4.createElement(MotionContext.Provider, { value: context2 }, useRender(Component2, props, projectionId, useMotionRef(visualState, context2.visualElement, externalRef), visualState, config.isStatic, context2.visualElement))
57664
58070
  );
@@ -57984,7 +58390,7 @@ const filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v
57984
58390
  const functions = v2.match(functionRegex);
57985
58391
  return functions ? functions.map(applyDefaultFilter).join(" ") : v2;
57986
58392
  } });
57987
- var int = __assign$4(__assign$4({}, number), { transform: Math.round });
58393
+ var int = __assign$3(__assign$3({}, number), { transform: Math.round });
57988
58394
  var numberValueTypes = {
57989
58395
  // Border props
57990
58396
  borderWidth: px,
@@ -58114,7 +58520,7 @@ function useInitialMotionValues(_a2, visualState, isStatic) {
58114
58520
  var state = createHtmlRenderState();
58115
58521
  buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);
58116
58522
  var vars = state.vars, style = state.style;
58117
- return __assign$4(__assign$4({}, vars), style);
58523
+ return __assign$3(__assign$3({}, vars), style);
58118
58524
  }, [visualState]);
58119
58525
  }
58120
58526
  function useStyle(props, visualState, isStatic) {
@@ -58272,18 +58678,18 @@ function buildSVGAttrs(state, _a2, options, transformTemplate) {
58272
58678
  }
58273
58679
  }
58274
58680
  var createSvgRenderState = function() {
58275
- return __assign$4(__assign$4({}, createHtmlRenderState()), { attrs: {} });
58681
+ return __assign$3(__assign$3({}, createHtmlRenderState()), { attrs: {} });
58276
58682
  };
58277
58683
  function useSVGProps(props, visualState) {
58278
58684
  var visualProps = useMemo(function() {
58279
58685
  var state = createSvgRenderState();
58280
58686
  buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate);
58281
- return __assign$4(__assign$4({}, state.attrs), { style: __assign$4({}, state.style) });
58687
+ return __assign$3(__assign$3({}, state.attrs), { style: __assign$3({}, state.style) });
58282
58688
  }, [visualState]);
58283
58689
  if (props.style) {
58284
58690
  var rawStyles = {};
58285
58691
  copyRawValuesOnly(rawStyles, props.style, props);
58286
- visualProps.style = __assign$4(__assign$4({}, rawStyles), visualProps.style);
58692
+ visualProps.style = __assign$3(__assign$3({}, rawStyles), visualProps.style);
58287
58693
  }
58288
58694
  return visualProps;
58289
58695
  }
@@ -58296,7 +58702,7 @@ function createUseRender(forwardMotionProps) {
58296
58702
  var useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
58297
58703
  var visualProps = useVisualProps(props, latestValues, isStatic);
58298
58704
  var filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
58299
- var elementProps = __assign$4(__assign$4(__assign$4({}, filteredProps), visualProps), { ref });
58705
+ var elementProps = __assign$3(__assign$3(__assign$3({}, filteredProps), visualProps), { ref });
58300
58706
  if (projectionId) {
58301
58707
  elementProps["data-projection-id"] = projectionId;
58302
58708
  }
@@ -58473,7 +58879,7 @@ var htmlMotionConfig = {
58473
58879
  function createDomMotionConfig(Component2, _a2, preloadedFeatures, createVisualElement, projectionNodeConstructor) {
58474
58880
  var _b = _a2.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
58475
58881
  var baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
58476
- return __assign$4(__assign$4({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58882
+ return __assign$3(__assign$3({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58477
58883
  }
58478
58884
  var AnimationType;
58479
58885
  (function(AnimationType2) {
@@ -59560,7 +59966,7 @@ function initIntersectionObserver(_a2) {
59560
59966
  var rootObservers = observers.get(lookupRoot);
59561
59967
  var key2 = JSON.stringify(options);
59562
59968
  if (!rootObservers[key2]) {
59563
- rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$4({ root: root2 }, options));
59969
+ rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$3({ root: root2 }, options));
59564
59970
  }
59565
59971
  return rootObservers[key2];
59566
59972
  }
@@ -59778,9 +60184,9 @@ var getDefaultTransition = function(valueKey, to2) {
59778
60184
  } else {
59779
60185
  transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default;
59780
60186
  }
59781
- return __assign$4({ to: to2 }, transitionFactory(to2));
60187
+ return __assign$3({ to: to2 }, transitionFactory(to2));
59782
60188
  };
59783
- var defaultValueTypes = __assign$4(__assign$4({}, numberValueTypes), {
60189
+ var defaultValueTypes = __assign$3(__assign$3({}, numberValueTypes), {
59784
60190
  // Color props
59785
60191
  color,
59786
60192
  backgroundColor: color,
@@ -59822,7 +60228,7 @@ function isTransitionDefined(_a2) {
59822
60228
  var legacyRepeatWarning = false;
59823
60229
  function convertTransitionToAnimationOptions(_a2) {
59824
60230
  var ease = _a2.ease, times = _a2.times, yoyo = _a2.yoyo, flip = _a2.flip, loop = _a2.loop, transition = __rest$1(_a2, ["ease", "times", "yoyo", "flip", "loop"]);
59825
- var options = __assign$4({}, transition);
60231
+ var options = __assign$3({}, transition);
59826
60232
  if (times)
59827
60233
  options["offset"] = times;
59828
60234
  if (transition.duration)
@@ -59869,9 +60275,9 @@ function getPopmotionAnimationOptions(transition, options, key2) {
59869
60275
  }
59870
60276
  hydrateKeyframes(options);
59871
60277
  if (!isTransitionDefined(transition)) {
59872
- transition = __assign$4(__assign$4({}, transition), getDefaultTransition(key2, options.to));
60278
+ transition = __assign$3(__assign$3({}, transition), getDefaultTransition(key2, options.to));
59873
60279
  }
59874
- return __assign$4(__assign$4({}, options), convertTransitionToAnimationOptions(transition));
60280
+ return __assign$3(__assign$3({}, options), convertTransitionToAnimationOptions(transition));
59875
60281
  }
59876
60282
  function getAnimation(key2, value, target, transition, onComplete) {
59877
60283
  var _a2;
@@ -59897,7 +60303,7 @@ function getAnimation(key2, value, target, transition, onComplete) {
59897
60303
  return value.set(v2);
59898
60304
  }
59899
60305
  };
59900
- return valueTransition.type === "inertia" || valueTransition.type === "decay" ? inertia(__assign$4(__assign$4({}, options), valueTransition)) : animate$1(__assign$4(__assign$4({}, getPopmotionAnimationOptions(valueTransition, options, key2)), { onUpdate: function(v2) {
60306
+ return valueTransition.type === "inertia" || valueTransition.type === "decay" ? inertia(__assign$3(__assign$3({}, options), valueTransition)) : animate$1(__assign$3(__assign$3({}, getPopmotionAnimationOptions(valueTransition, options, key2)), { onUpdate: function(v2) {
59901
60307
  var _a3;
59902
60308
  options.onUpdate(v2);
59903
60309
  (_a3 = valueTransition.onUpdate) === null || _a3 === void 0 ? void 0 : _a3.call(valueTransition, v2);
@@ -60150,7 +60556,7 @@ function setTarget(visualElement2, definition) {
60150
60556
  var _a2 = resolved ? visualElement2.makeTargetAnimatable(resolved, false) : {}, _b = _a2.transitionEnd, transitionEnd = _b === void 0 ? {} : _b;
60151
60557
  _a2.transition;
60152
60558
  var target = __rest$1(_a2, ["transitionEnd", "transition"]);
60153
- target = __assign$4(__assign$4({}, target), transitionEnd);
60559
+ target = __assign$3(__assign$3({}, target), transitionEnd);
60154
60560
  for (var key2 in target) {
60155
60561
  var value = resolveFinalValueInKeyframes(target[key2]);
60156
60562
  setMotionValue(visualElement2, key2, value);
@@ -60268,9 +60674,9 @@ function animateTarget(visualElement2, definition, _a2) {
60268
60674
  if (!value || valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key2)) {
60269
60675
  continue;
60270
60676
  }
60271
- var valueTransition = __assign$4({ delay }, transition);
60677
+ var valueTransition = __assign$3({ delay }, transition);
60272
60678
  if (visualElement2.shouldReduceMotion && isTransformProp(key2)) {
60273
- valueTransition = __assign$4(__assign$4({}, valueTransition), { type: false, delay: 0 });
60679
+ valueTransition = __assign$3(__assign$3({}, valueTransition), { type: false, delay: 0 });
60274
60680
  }
60275
60681
  var animation = startAnimation(key2, value, valueTarget, valueTransition);
60276
60682
  animations2.push(animation);
@@ -60303,7 +60709,7 @@ function animateChildren(visualElement2, variant, delayChildren, staggerChildren
60303
60709
  return maxStaggerDuration - i * staggerChildren;
60304
60710
  };
60305
60711
  Array.from(visualElement2.variantChildren).sort(sortByTreeOrder).forEach(function(child, i) {
60306
- animations2.push(animateVariant(child, variant, __assign$4(__assign$4({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60712
+ animations2.push(animateVariant(child, variant, __assign$3(__assign$3({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60307
60713
  return child.notifyAnimationComplete(variant);
60308
60714
  }));
60309
60715
  });
@@ -60347,7 +60753,7 @@ function createAnimationState(visualElement2) {
60347
60753
  if (resolved) {
60348
60754
  resolved.transition;
60349
60755
  var transitionEnd = resolved.transitionEnd, target = __rest$1(resolved, ["transition", "transitionEnd"]);
60350
- acc = __assign$4(__assign$4(__assign$4({}, acc), target), transitionEnd);
60756
+ acc = __assign$3(__assign$3(__assign$3({}, acc), target), transitionEnd);
60351
60757
  }
60352
60758
  return acc;
60353
60759
  };
@@ -60377,7 +60783,7 @@ function createAnimationState(visualElement2) {
60377
60783
  if (isInherited && isInitialRender && visualElement2.manuallyAnimateOnMount) {
60378
60784
  isInherited = false;
60379
60785
  }
60380
- typeState.protectedKeys = __assign$4({}, encounteredKeys);
60786
+ typeState.protectedKeys = __assign$3({}, encounteredKeys);
60381
60787
  if (
60382
60788
  // If it isn't active and hasn't *just* been set as inactive
60383
60789
  !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
@@ -60395,7 +60801,7 @@ function createAnimationState(visualElement2) {
60395
60801
  if (activeDelta === false)
60396
60802
  resolvedValues = {};
60397
60803
  var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
60398
- var allKeys = __assign$4(__assign$4({}, prevResolvedValues), resolvedValues);
60804
+ var allKeys = __assign$3(__assign$3({}, prevResolvedValues), resolvedValues);
60399
60805
  var markToAnimate = function(key3) {
60400
60806
  shouldAnimateType = true;
60401
60807
  removedKeys.delete(key3);
@@ -60427,7 +60833,7 @@ function createAnimationState(visualElement2) {
60427
60833
  typeState.prevProp = prop;
60428
60834
  typeState.prevResolvedValues = resolvedValues;
60429
60835
  if (typeState.isActive) {
60430
- encounteredKeys = __assign$4(__assign$4({}, encounteredKeys), resolvedValues);
60836
+ encounteredKeys = __assign$3(__assign$3({}, encounteredKeys), resolvedValues);
60431
60837
  }
60432
60838
  if (isInitialRender && visualElement2.blockInitialAnimation) {
60433
60839
  shouldAnimateType = false;
@@ -60436,7 +60842,7 @@ function createAnimationState(visualElement2) {
60436
60842
  animations2.push.apply(animations2, __spreadArray$2([], __read(definitionList.map(function(animation) {
60437
60843
  return {
60438
60844
  animation,
60439
- options: __assign$4({ type }, options)
60845
+ options: __assign$3({ type }, options)
60440
60846
  };
60441
60847
  })), false));
60442
60848
  }
@@ -60444,7 +60850,7 @@ function createAnimationState(visualElement2) {
60444
60850
  for (var i = 0; i < numAnimationTypes; i++) {
60445
60851
  _loop_1(i);
60446
60852
  }
60447
- allAnimatedKeys = __assign$4({}, encounteredKeys);
60853
+ allAnimatedKeys = __assign$3({}, encounteredKeys);
60448
60854
  if (removedKeys.size) {
60449
60855
  var fallbackAnimation_1 = {};
60450
60856
  removedKeys.forEach(function(key2) {
@@ -60552,7 +60958,7 @@ var PanSession = (
60552
60958
  return;
60553
60959
  var point2 = info3.point;
60554
60960
  var timestamp2 = getFrameData().timestamp;
60555
- _this.history.push(__assign$4(__assign$4({}, point2), { timestamp: timestamp2 }));
60961
+ _this.history.push(__assign$3(__assign$3({}, point2), { timestamp: timestamp2 }));
60556
60962
  var _a3 = _this.handlers, onStart = _a3.onStart, onMove = _a3.onMove;
60557
60963
  if (!isPanStarted) {
60558
60964
  onStart && onStart(_this.lastMoveEvent, info3);
@@ -60586,7 +60992,7 @@ var PanSession = (
60586
60992
  var initialInfo = transformPoint(info2, this.transformPagePoint);
60587
60993
  var point = initialInfo.point;
60588
60994
  var timestamp = getFrameData().timestamp;
60589
- this.history = [__assign$4(__assign$4({}, point), { timestamp })];
60995
+ this.history = [__assign$3(__assign$3({}, point), { timestamp })];
60590
60996
  var onSessionStart = handlers2.onSessionStart;
60591
60997
  onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
60592
60998
  this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
@@ -61107,7 +61513,7 @@ var VisualElementDragControls = (
61107
61513
  transition = { min: 0, max: 0 };
61108
61514
  var bounceStiffness = dragElastic ? 200 : 1e6;
61109
61515
  var bounceDamping = dragElastic ? 40 : 1e7;
61110
- var inertia2 = __assign$4(__assign$4({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61516
+ var inertia2 = __assign$3(__assign$3({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61111
61517
  return _this.startAxisValueAnimation(axis, inertia2);
61112
61518
  });
61113
61519
  return Promise.all(momentumAnimations).then(onDragTransitionEnd);
@@ -61218,7 +61624,7 @@ var VisualElementDragControls = (
61218
61624
  VisualElementDragControls2.prototype.getProps = function() {
61219
61625
  var props = this.visualElement.getProps();
61220
61626
  var _a2 = props.drag, drag2 = _a2 === void 0 ? false : _a2, _b = props.dragDirectionLock, dragDirectionLock = _b === void 0 ? false : _b, _c = props.dragPropagation, dragPropagation = _c === void 0 ? false : _c, _d = props.dragConstraints, dragConstraints = _d === void 0 ? false : _d, _e2 = props.dragElastic, dragElastic = _e2 === void 0 ? defaultElastic : _e2, _f = props.dragMomentum, dragMomentum = _f === void 0 ? true : _f;
61221
- return __assign$4(__assign$4({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61627
+ return __assign$3(__assign$3({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61222
61628
  };
61223
61629
  return VisualElementDragControls2;
61224
61630
  }()
@@ -61375,7 +61781,7 @@ var visualElement = function(_a2) {
61375
61781
  var values2 = /* @__PURE__ */ new Map();
61376
61782
  var valueSubscriptions = /* @__PURE__ */ new Map();
61377
61783
  var prevMotionValues = {};
61378
- var baseTarget = __assign$4({}, latestValues);
61784
+ var baseTarget = __assign$3({}, latestValues);
61379
61785
  var removeFromVariantTree;
61380
61786
  function render2() {
61381
61787
  if (!instance || !isMounted)
@@ -61409,7 +61815,7 @@ var visualElement = function(_a2) {
61409
61815
  }
61410
61816
  var isControllingVariants = checkIfControllingVariants(props);
61411
61817
  var isVariantNode = checkIfVariantNode(props);
61412
- var element = __assign$4(__assign$4({
61818
+ var element = __assign$3(__assign$3({
61413
61819
  treeType,
61414
61820
  /**
61415
61821
  * This is a mirror of the internal instance prop, which keeps
@@ -61774,7 +62180,7 @@ function resolveCSSVariables(visualElement2, _a2, transitionEnd) {
61774
62180
  if (!(element instanceof Element))
61775
62181
  return { target, transitionEnd };
61776
62182
  if (transitionEnd) {
61777
- transitionEnd = __assign$4({}, transitionEnd);
62183
+ transitionEnd = __assign$3({}, transitionEnd);
61778
62184
  }
61779
62185
  visualElement2.forEachValue(function(value) {
61780
62186
  var current2 = value.get();
@@ -61929,8 +62335,8 @@ var checkAndConvertChangedValueTypes = function(visualElement2, target, origin,
61929
62335
  if (transitionEnd === void 0) {
61930
62336
  transitionEnd = {};
61931
62337
  }
61932
- target = __assign$4({}, target);
61933
- transitionEnd = __assign$4({}, transitionEnd);
62338
+ target = __assign$3({}, target);
62339
+ transitionEnd = __assign$3({}, transitionEnd);
61934
62340
  var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
61935
62341
  var removedTransformValues = [];
61936
62342
  var hasAttemptedToRemoveTransformValues = false;
@@ -62083,7 +62489,7 @@ var htmlConfig = {
62083
62489
  transitionEnd = parsed.transitionEnd;
62084
62490
  target = parsed.target;
62085
62491
  }
62086
- return __assign$4({ transition, transitionEnd }, target);
62492
+ return __assign$3({ transition, transitionEnd }, target);
62087
62493
  },
62088
62494
  scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1,
62089
62495
  build: function(element, renderState, latestValues, options, props) {
@@ -62095,7 +62501,7 @@ var htmlConfig = {
62095
62501
  render: renderHTML
62096
62502
  };
62097
62503
  var htmlVisualElement = visualElement(htmlConfig);
62098
- var svgVisualElement = visualElement(__assign$4(__assign$4({}, htmlConfig), { getBaseTarget: function(props, key2) {
62504
+ var svgVisualElement = visualElement(__assign$3(__assign$3({}, htmlConfig), { getBaseTarget: function(props, key2) {
62099
62505
  return props[key2];
62100
62506
  }, readValueFromInstance: function(domElement, key2) {
62101
62507
  var _a2;
@@ -62173,7 +62579,7 @@ var correctBoxShadow = {
62173
62579
  var MeasureLayoutWithContext = (
62174
62580
  /** @class */
62175
62581
  function(_super) {
62176
- __extends$1(MeasureLayoutWithContext2, _super);
62582
+ __extends(MeasureLayoutWithContext2, _super);
62177
62583
  function MeasureLayoutWithContext2() {
62178
62584
  return _super !== null && _super.apply(this, arguments) || this;
62179
62585
  }
@@ -62192,7 +62598,7 @@ var MeasureLayoutWithContext = (
62192
62598
  projection.addEventListener("animationComplete", function() {
62193
62599
  _this.safeToRemove();
62194
62600
  });
62195
- projection.setOptions(__assign$4(__assign$4({}, projection.options), { onExitComplete: function() {
62601
+ projection.setOptions(__assign$3(__assign$3({}, projection.options), { onExitComplete: function() {
62196
62602
  return _this.safeToRemove();
62197
62603
  } }));
62198
62604
  }
@@ -62257,10 +62663,10 @@ var MeasureLayoutWithContext = (
62257
62663
  function MeasureLayout(props) {
62258
62664
  var _a2 = __read(usePresence(), 2), isPresent = _a2[0], safeToRemove = _a2[1];
62259
62665
  var layoutGroup = useContext(LayoutGroupContext);
62260
- return React__default.createElement(MeasureLayoutWithContext, __assign$4({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62666
+ return React__default.createElement(MeasureLayoutWithContext, __assign$3({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62261
62667
  }
62262
62668
  var defaultScaleCorrectors = {
62263
- borderRadius: __assign$4(__assign$4({}, correctBorderRadius), { applyTo: [
62669
+ borderRadius: __assign$3(__assign$3({}, correctBorderRadius), { applyTo: [
62264
62670
  "borderTopLeftRadius",
62265
62671
  "borderTopRightRadius",
62266
62672
  "borderBottomLeftRadius",
@@ -62683,7 +63089,7 @@ function createProjectionNode(_a2) {
62683
63089
  _this.resumingFrom.resumingFrom = void 0;
62684
63090
  }
62685
63091
  _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
62686
- var animationOptions = __assign$4(__assign$4({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
63092
+ var animationOptions = __assign$3(__assign$3({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
62687
63093
  if (visualElement2.shouldReduceMotion) {
62688
63094
  animationOptions.delay = 0;
62689
63095
  animationOptions.type = false;
@@ -62937,7 +63343,7 @@ function createProjectionNode(_a2) {
62937
63343
  };
62938
63344
  ProjectionNode.prototype.setOptions = function(options) {
62939
63345
  var _a3;
62940
- this.options = __assign$4(__assign$4(__assign$4({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
63346
+ this.options = __assign$3(__assign$3(__assign$3({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
62941
63347
  };
62942
63348
  ProjectionNode.prototype.clearMeasurements = function() {
62943
63349
  this.scroll = void 0;
@@ -63055,7 +63461,7 @@ function createProjectionNode(_a2) {
63055
63461
  }
63056
63462
  var snapshot = this.snapshot;
63057
63463
  var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};
63058
- var mixedValues = __assign$4({}, this.latestValues);
63464
+ var mixedValues = __assign$3({}, this.latestValues);
63059
63465
  var targetDelta = createDelta();
63060
63466
  this.relativeTarget = this.relativeTargetOrigin = void 0;
63061
63467
  this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
@@ -63098,7 +63504,7 @@ function createProjectionNode(_a2) {
63098
63504
  }
63099
63505
  this.pendingAnimation = sync.update(function() {
63100
63506
  globalProjectionState.hasAnimatedSinceResize = true;
63101
- _this.currentAnimation = animate(0, animationTarget, __assign$4(__assign$4({}, options), { onUpdate: function(latest) {
63507
+ _this.currentAnimation = animate(0, animationTarget, __assign$3(__assign$3({}, options), { onUpdate: function(latest) {
63102
63508
  var _a4;
63103
63509
  _this.mixTargetDelta(latest);
63104
63510
  (_a4 = options.onUpdate) === null || _a4 === void 0 ? void 0 : _a4.call(options, latest);
@@ -63466,7 +63872,7 @@ var HTMLProjectionNode = createProjectionNode({
63466
63872
  return Boolean(window.getComputedStyle(instance).position === "fixed");
63467
63873
  }
63468
63874
  });
63469
- var featureBundle = __assign$4(__assign$4(__assign$4(__assign$4({}, animations), gestureAnimations), drag), layoutFeatures);
63875
+ var featureBundle = __assign$3(__assign$3(__assign$3(__assign$3({}, animations), gestureAnimations), drag), layoutFeatures);
63470
63876
  var motion = /* @__PURE__ */ createMotionProxy(function(Component2, config) {
63471
63877
  return createDomMotionConfig(Component2, config, featureBundle, createDomVisualElement, HTMLProjectionNode);
63472
63878
  });
@@ -65772,10 +66178,6 @@ const checkConversion = ({
65772
66178
  if (!availableUnits.includes(toUnit)) {
65773
66179
  return false;
65774
66180
  }
65775
- const valueUnit = getUnit(String(value));
65776
- if (valueUnit && !availableUnits.includes(valueUnit)) {
65777
- return false;
65778
- }
65779
66181
  return true;
65780
66182
  };
65781
66183
  const convertUnit = ({
@@ -65828,14 +66230,6 @@ const safeConvertValue = ({
65828
66230
  }) => {
65829
66231
  const rawValue = getValue(value);
65830
66232
  const isInvalidInput = isWrongValue(rawValue);
65831
- const shouldConvert = checkConversion({
65832
- value,
65833
- unitkey,
65834
- toUnit
65835
- });
65836
- if (!shouldConvert) {
65837
- return { value: rawValue };
65838
- }
65839
66233
  if (isValueWithUnknownUnit(value)) {
65840
66234
  return { value: rawValue };
65841
66235
  }
@@ -66057,22 +66451,6 @@ const UnitInput = ({
66057
66451
  const createPredefinedOption = (el2) => {
66058
66452
  const elementValue = (el2 == null ? void 0 : el2.value) ? el2.value : "";
66059
66453
  const [value2 = "", unit2 = ""] = isValueWithUnit(elementValue) ? split$1(elementValue) : [elementValue];
66060
- let description2 = withPrettyUnitLabel(elementValue);
66061
- const shouldConvert = checkConversion({
66062
- value: elementValue,
66063
- unitkey,
66064
- toUnit: unit2
66065
- });
66066
- if (shouldConvert) {
66067
- const { value: value3 = "" } = safeConvertValue({
66068
- value: elementValue,
66069
- toUnit: preferredUnit,
66070
- unitkey,
66071
- defaultFromUnit: unit2,
66072
- doNotConvertValue: noConversion
66073
- });
66074
- description2 = withPrettyUnitLabel(withUnit(value3, preferredUnit));
66075
- }
66076
66454
  return {
66077
66455
  type: MenuType.OPTION,
66078
66456
  inline: true,
@@ -66094,7 +66472,7 @@ const UnitInput = ({
66094
66472
  /* @__PURE__ */ jsx(Text, { children: el2.label }),
66095
66473
  /* @__PURE__ */ jsx(Spacer, { width: "20px", height: "0" })
66096
66474
  ] }),
66097
- description: description2,
66475
+ description: isValueWithUnit(elementValue) ? `${value2} ${unit2}` : elementValue,
66098
66476
  selected: foundPredefinedMenuOption === el2 && predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED
66099
66477
  };
66100
66478
  };