@oliasoft-open-source/react-ui-library 4.18.0-beta-13 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11,11 +11,11 @@ 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, memo as memo$1, 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, Component as Component$1, memo, 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, flushSync as flushSync$1, 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";
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
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";
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) {
@@ -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 = function(d2, b2) {
226
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
225
+ var extendStatics$1 = function(d2, b2) {
226
+ extendStatics$1 = 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(d2, b2);
231
+ return extendStatics$1(d2, b2);
232
232
  };
233
- function __extends(d2, b2) {
233
+ function __extends$1(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(d2, b2);
236
+ extendStatics$1(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$3 = function() {
243
- __assign$3 = Object.assign || function __assign2(t) {
242
+ var __assign$4 = function() {
243
+ __assign$4 = 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$3.apply(this, arguments);
250
+ return __assign$4.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$2 = function() {
887
- __assign$2 = Object.assign || function(t) {
886
+ var __assign$3 = function() {
887
+ __assign$3 = 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$2.apply(this, arguments);
894
+ return __assign$3.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$2({
906
+ return React__default.createElement(node2.tag, __assign$3({
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$2({
914
- attr: __assign$2({}, data.attr)
913
+ return React__default.createElement(IconBase, __assign$3({
914
+ attr: __assign$3({}, 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$2({
925
+ return React__default.createElement("svg", __assign$3({
926
926
  stroke: "currentColor",
927
927
  fill: "currentColor",
928
928
  strokeWidth: "0"
929
929
  }, conf.attr, attr, svgProps, {
930
930
  className,
931
- style: __assign$2(__assign$2({
931
+ style: __assign$3(__assign$3({
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$1(callback, delay) {
1811
+ function throttle$2(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$1(this.refresh.bind(this), REFRESH_DELAY);
1853
+ this.refresh = throttle$2(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$6 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2357
+ var useIsomorphicLayoutEffect$5 = 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$6(function() {
2605
+ useIsomorphicLayoutEffect$5(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$6(function() {
2615
+ useIsomorphicLayoutEffect$5(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$6(function() {
2627
+ useIsomorphicLayoutEffect$5(function() {
2628
2628
  if (enabled) {
2629
2629
  handleChange();
2630
2630
  }
@@ -5308,15 +5308,15 @@ const Card = ({
5308
5308
  }
5309
5309
  );
5310
5310
  };
5311
- var __assign$1 = function() {
5312
- __assign$1 = Object.assign || function __assign2(t) {
5311
+ var __assign$2 = function() {
5312
+ __assign$2 = Object.assign || function __assign2(t) {
5313
5313
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
5314
5314
  s = arguments[i];
5315
5315
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5316
5316
  }
5317
5317
  return t;
5318
5318
  };
5319
- return __assign$1.apply(this, arguments);
5319
+ return __assign$2.apply(this, arguments);
5320
5320
  };
5321
5321
  function __spreadArray$1(to2, from3, pack) {
5322
5322
  if (pack || arguments.length === 2) for (var i = 0, l = from3.length, ar2; i < l; i++) {
@@ -6149,7 +6149,7 @@ var Ie = function(e2) {
6149
6149
  function e2(e3, n2, o) {
6150
6150
  void 0 === e3 && (e3 = C), void 0 === n2 && (n2 = {});
6151
6151
  var r2 = this;
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() {
6152
+ 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() {
6153
6153
  return function(e4) {
6154
6154
  for (var t = e4.getTag(), n3 = t.length, o2 = "", r3 = function(n4) {
6155
6155
  var r4 = function(e5) {
@@ -6172,7 +6172,7 @@ var Ie = function(e2) {
6172
6172
  }, e2.prototype.rehydrate = function() {
6173
6173
  !this.server && S && _e(this);
6174
6174
  }, e2.prototype.reconstructWithOptions = function(n2, o) {
6175
- return void 0 === o && (o = true), new e2(__assign$1(__assign$1({}, this.options), n2), this.gs, o && this.names || void 0);
6175
+ return void 0 === o && (o = true), new e2(__assign$2(__assign$2({}, this.options), n2), this.gs, o && this.names || void 0);
6176
6176
  }, e2.prototype.allocateGSInstance = function(e3) {
6177
6177
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
6178
6178
  }, e2.prototype.getTag = function() {
@@ -6345,9 +6345,9 @@ function it$1(e2, r2, s) {
6345
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;
6346
6346
  "production" !== process.env.NODE_ENV && useDebugValue(d3);
6347
6347
  var v2 = I(r4, f3, c3) || C, g3 = function(e5, n2, o) {
6348
- for (var r5, s3 = __assign$1(__assign$1({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6348
+ for (var r5, s3 = __assign$2(__assign$2({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6349
6349
  var a4 = re(r5 = e5[i3]) ? r5(s3) : r5;
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];
6350
+ 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];
6351
6351
  }
6352
6352
  return n2.className && (s3.className = ie$2(s3.className, n2.className)), s3;
6353
6353
  }(i2, r4, v2), S3 = g3.as || h2, w3 = {};
@@ -6403,9 +6403,9 @@ function ut(n2, o, r2) {
6403
6403
  return n2(o, r2, lt$1.apply(void 0, __spreadArray$1([t], s2, false)));
6404
6404
  };
6405
6405
  return s.attrs = function(e2) {
6406
- return ut(n2, o, __assign$1(__assign$1({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6406
+ return ut(n2, o, __assign$2(__assign$2({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6407
6407
  }, s.withConfig = function(e2) {
6408
- return ut(n2, o, __assign$1(__assign$1({}, r2), e2));
6408
+ return ut(n2, o, __assign$2(__assign$2({}, r2), e2));
6409
6409
  }, s;
6410
6410
  }
6411
6411
  var pt$1 = function(e2) {
@@ -9501,47 +9501,383 @@ const InputGroupAddon = ({
9501
9501
  })();
9502
9502
  return /* @__PURE__ */ jsx("span", { className: cx$2(styles$u.addon, order2, small2 ? styles$u.small : ""), children });
9503
9503
  };
9504
- const inputInTable$8 = "_inputInTable_4cdnv_1";
9505
- const inputHover$8 = "_inputHover_4cdnv_13";
9506
- const inputFocus$8 = "_inputFocus_4cdnv_18";
9507
- const inputError$8 = "_inputError_4cdnv_25";
9508
- const inputWarning$8 = "_inputWarning_4cdnv_26";
9509
- const inputDisabled$8 = "_inputDisabled_4cdnv_61";
9510
- const hideScrollbars$8 = "_hideScrollbars_4cdnv_67";
9511
- const list$1 = "_list_4cdnv_77";
9512
- const bordered$1 = "_bordered_4cdnv_83";
9513
- const virtualRow = "_virtualRow_4cdnv_87";
9514
- const item$4 = "_item_4cdnv_87";
9515
- const header$1 = "_header_4cdnv_90";
9516
- const headerTitle = "_headerTitle_4cdnv_90";
9517
- const heading$3 = "_heading_4cdnv_91";
9518
- const itemHeader = "_itemHeader_4cdnv_91";
9519
- const narrow = "_narrow_4cdnv_94";
9520
- const stickyHeader = "_stickyHeader_4cdnv_98";
9521
- const title$3 = "_title_4cdnv_109";
9522
- const name = "_name_4cdnv_115";
9523
- const iconTooltipMargin = "_iconTooltipMargin_4cdnv_119";
9524
- const bold = "_bold_4cdnv_122";
9525
- const toggleNarrow = "_toggleNarrow_4cdnv_133";
9526
- const drag$1 = "_drag_4cdnv_151";
9527
- const dragOverlay$1 = "_dragOverlay_4cdnv_172";
9528
- const listContent = "_listContent_4cdnv_177";
9529
- const action = "_action_4cdnv_204";
9530
- const active$3 = "_active_4cdnv_207";
9531
- const indented = "_indented_4cdnv_214";
9532
- const disabled$5 = "_disabled_4cdnv_227";
9533
- const label$6 = "_label_4cdnv_238";
9534
- const details$2 = "_details_4cdnv_249";
9535
- const metadata = "_metadata_4cdnv_250";
9536
- const itemContent = "_itemContent_4cdnv_258";
9537
- const indentIcon = "_indentIcon_4cdnv_265";
9538
- const expandIcon = "_expandIcon_4cdnv_270";
9539
- const expanded = "_expanded_4cdnv_277";
9540
- const right$4 = "_right_4cdnv_280";
9541
- const actions = "_actions_4cdnv_288";
9542
- const hideScrollbar = "_hideScrollbar_4cdnv_67";
9543
- const noPointerEvents = "_noPointerEvents_4cdnv_303";
9544
- const virtualRows = "_virtualRows_4cdnv_306";
9504
+ /*! *****************************************************************************
9505
+ Copyright (c) Microsoft Corporation. All rights reserved.
9506
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
9507
+ this file except in compliance with the License. You may obtain a copy of the
9508
+ License at http://www.apache.org/licenses/LICENSE-2.0
9509
+
9510
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9511
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9512
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
9513
+ MERCHANTABLITY OR NON-INFRINGEMENT.
9514
+
9515
+ See the Apache Version 2.0 License for specific language governing permissions
9516
+ and limitations under the License.
9517
+ ***************************************************************************** */
9518
+ var extendStatics = function(d2, b2) {
9519
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
9520
+ d3.__proto__ = b3;
9521
+ } || function(d3, b3) {
9522
+ for (var p in b3) if (b3.hasOwnProperty(p)) d3[p] = b3[p];
9523
+ };
9524
+ return extendStatics(d2, b2);
9525
+ };
9526
+ function __extends(d2, b2) {
9527
+ extendStatics(d2, b2);
9528
+ function __() {
9529
+ this.constructor = d2;
9530
+ }
9531
+ d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
9532
+ }
9533
+ var __assign$1 = function() {
9534
+ __assign$1 = Object.assign || function __assign2(t) {
9535
+ for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
9536
+ s = arguments[i];
9537
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9538
+ }
9539
+ return t;
9540
+ };
9541
+ return __assign$1.apply(this, arguments);
9542
+ };
9543
+ function throttle$1(delay, noTrailing, callback, debounceMode) {
9544
+ var timeoutID;
9545
+ var cancelled = false;
9546
+ var lastExec = 0;
9547
+ function clearExistingTimeout() {
9548
+ if (timeoutID) {
9549
+ clearTimeout(timeoutID);
9550
+ }
9551
+ }
9552
+ function cancel() {
9553
+ clearExistingTimeout();
9554
+ cancelled = true;
9555
+ }
9556
+ if (typeof noTrailing !== "boolean") {
9557
+ debounceMode = callback;
9558
+ callback = noTrailing;
9559
+ noTrailing = void 0;
9560
+ }
9561
+ function wrapper2() {
9562
+ var self2 = this;
9563
+ var elapsed = Date.now() - lastExec;
9564
+ var args = arguments;
9565
+ if (cancelled) {
9566
+ return;
9567
+ }
9568
+ function exec() {
9569
+ lastExec = Date.now();
9570
+ callback.apply(self2, args);
9571
+ }
9572
+ function clear() {
9573
+ timeoutID = void 0;
9574
+ }
9575
+ if (debounceMode && !timeoutID) {
9576
+ exec();
9577
+ }
9578
+ clearExistingTimeout();
9579
+ if (debounceMode === void 0 && elapsed > delay) {
9580
+ exec();
9581
+ } else if (noTrailing !== true) {
9582
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
9583
+ }
9584
+ }
9585
+ wrapper2.cancel = cancel;
9586
+ return wrapper2;
9587
+ }
9588
+ var ThresholdUnits = {
9589
+ Pixel: "Pixel",
9590
+ Percent: "Percent"
9591
+ };
9592
+ var defaultThreshold$1 = {
9593
+ unit: ThresholdUnits.Percent,
9594
+ value: 0.8
9595
+ };
9596
+ function parseThreshold(scrollThreshold) {
9597
+ if (typeof scrollThreshold === "number") {
9598
+ return {
9599
+ unit: ThresholdUnits.Percent,
9600
+ value: scrollThreshold * 100
9601
+ };
9602
+ }
9603
+ if (typeof scrollThreshold === "string") {
9604
+ if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
9605
+ return {
9606
+ unit: ThresholdUnits.Pixel,
9607
+ value: parseFloat(scrollThreshold)
9608
+ };
9609
+ }
9610
+ if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
9611
+ return {
9612
+ unit: ThresholdUnits.Percent,
9613
+ value: parseFloat(scrollThreshold)
9614
+ };
9615
+ }
9616
+ console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
9617
+ return defaultThreshold$1;
9618
+ }
9619
+ console.warn("scrollThreshold should be string or number");
9620
+ return defaultThreshold$1;
9621
+ }
9622
+ var InfiniteScroll = (
9623
+ /** @class */
9624
+ function(_super) {
9625
+ __extends(InfiniteScroll2, _super);
9626
+ function InfiniteScroll2(props) {
9627
+ var _this = _super.call(this, props) || this;
9628
+ _this.lastScrollTop = 0;
9629
+ _this.actionTriggered = false;
9630
+ _this.startY = 0;
9631
+ _this.currentY = 0;
9632
+ _this.dragging = false;
9633
+ _this.maxPullDownDistance = 0;
9634
+ _this.getScrollableTarget = function() {
9635
+ if (_this.props.scrollableTarget instanceof HTMLElement)
9636
+ return _this.props.scrollableTarget;
9637
+ if (typeof _this.props.scrollableTarget === "string") {
9638
+ return document.getElementById(_this.props.scrollableTarget);
9639
+ }
9640
+ if (_this.props.scrollableTarget === null) {
9641
+ 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 ");
9642
+ }
9643
+ return null;
9644
+ };
9645
+ _this.onStart = function(evt) {
9646
+ if (_this.lastScrollTop)
9647
+ return;
9648
+ _this.dragging = true;
9649
+ if (evt instanceof MouseEvent) {
9650
+ _this.startY = evt.pageY;
9651
+ } else if (evt instanceof TouchEvent) {
9652
+ _this.startY = evt.touches[0].pageY;
9653
+ }
9654
+ _this.currentY = _this.startY;
9655
+ if (_this._infScroll) {
9656
+ _this._infScroll.style.willChange = "transform";
9657
+ _this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
9658
+ }
9659
+ };
9660
+ _this.onMove = function(evt) {
9661
+ if (!_this.dragging)
9662
+ return;
9663
+ if (evt instanceof MouseEvent) {
9664
+ _this.currentY = evt.pageY;
9665
+ } else if (evt instanceof TouchEvent) {
9666
+ _this.currentY = evt.touches[0].pageY;
9667
+ }
9668
+ if (_this.currentY < _this.startY)
9669
+ return;
9670
+ if (_this.currentY - _this.startY >= Number(_this.props.pullDownToRefreshThreshold)) {
9671
+ _this.setState({
9672
+ pullToRefreshThresholdBreached: true
9673
+ });
9674
+ }
9675
+ if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
9676
+ return;
9677
+ if (_this._infScroll) {
9678
+ _this._infScroll.style.overflow = "visible";
9679
+ _this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY - _this.startY) + "px, 0px)";
9680
+ }
9681
+ };
9682
+ _this.onEnd = function() {
9683
+ _this.startY = 0;
9684
+ _this.currentY = 0;
9685
+ _this.dragging = false;
9686
+ if (_this.state.pullToRefreshThresholdBreached) {
9687
+ _this.props.refreshFunction && _this.props.refreshFunction();
9688
+ _this.setState({
9689
+ pullToRefreshThresholdBreached: false
9690
+ });
9691
+ }
9692
+ requestAnimationFrame(function() {
9693
+ if (_this._infScroll) {
9694
+ _this._infScroll.style.overflow = "auto";
9695
+ _this._infScroll.style.transform = "none";
9696
+ _this._infScroll.style.willChange = "unset";
9697
+ }
9698
+ });
9699
+ };
9700
+ _this.onScrollListener = function(event) {
9701
+ if (typeof _this.props.onScroll === "function") {
9702
+ setTimeout(function() {
9703
+ return _this.props.onScroll && _this.props.onScroll(event);
9704
+ }, 0);
9705
+ }
9706
+ var target = _this.props.height || _this._scrollableNode ? event.target : document.documentElement.scrollTop ? document.documentElement : document.body;
9707
+ if (_this.actionTriggered)
9708
+ return;
9709
+ var atBottom = _this.props.inverse ? _this.isElementAtTop(target, _this.props.scrollThreshold) : _this.isElementAtBottom(target, _this.props.scrollThreshold);
9710
+ if (atBottom && _this.props.hasMore) {
9711
+ _this.actionTriggered = true;
9712
+ _this.setState({ showLoader: true });
9713
+ _this.props.next && _this.props.next();
9714
+ }
9715
+ _this.lastScrollTop = target.scrollTop;
9716
+ };
9717
+ _this.state = {
9718
+ showLoader: false,
9719
+ pullToRefreshThresholdBreached: false,
9720
+ prevDataLength: props.dataLength
9721
+ };
9722
+ _this.throttledOnScrollListener = throttle$1(150, _this.onScrollListener).bind(_this);
9723
+ _this.onStart = _this.onStart.bind(_this);
9724
+ _this.onMove = _this.onMove.bind(_this);
9725
+ _this.onEnd = _this.onEnd.bind(_this);
9726
+ return _this;
9727
+ }
9728
+ InfiniteScroll2.prototype.componentDidMount = function() {
9729
+ if (typeof this.props.dataLength === "undefined") {
9730
+ throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');
9731
+ }
9732
+ this._scrollableNode = this.getScrollableTarget();
9733
+ this.el = this.props.height ? this._infScroll : this._scrollableNode || window;
9734
+ if (this.el) {
9735
+ this.el.addEventListener("scroll", this.throttledOnScrollListener);
9736
+ }
9737
+ if (typeof this.props.initialScrollY === "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY) {
9738
+ this.el.scrollTo(0, this.props.initialScrollY);
9739
+ }
9740
+ if (this.props.pullDownToRefresh && this.el) {
9741
+ this.el.addEventListener("touchstart", this.onStart);
9742
+ this.el.addEventListener("touchmove", this.onMove);
9743
+ this.el.addEventListener("touchend", this.onEnd);
9744
+ this.el.addEventListener("mousedown", this.onStart);
9745
+ this.el.addEventListener("mousemove", this.onMove);
9746
+ this.el.addEventListener("mouseup", this.onEnd);
9747
+ this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0;
9748
+ this.forceUpdate();
9749
+ if (typeof this.props.refreshFunction !== "function") {
9750
+ throw new Error(`Mandatory prop "refreshFunction" missing.
9751
+ Pull Down To Refresh functionality will not work
9752
+ as expected. Check README.md for usage'`);
9753
+ }
9754
+ }
9755
+ };
9756
+ InfiniteScroll2.prototype.componentWillUnmount = function() {
9757
+ if (this.el) {
9758
+ this.el.removeEventListener("scroll", this.throttledOnScrollListener);
9759
+ if (this.props.pullDownToRefresh) {
9760
+ this.el.removeEventListener("touchstart", this.onStart);
9761
+ this.el.removeEventListener("touchmove", this.onMove);
9762
+ this.el.removeEventListener("touchend", this.onEnd);
9763
+ this.el.removeEventListener("mousedown", this.onStart);
9764
+ this.el.removeEventListener("mousemove", this.onMove);
9765
+ this.el.removeEventListener("mouseup", this.onEnd);
9766
+ }
9767
+ }
9768
+ };
9769
+ InfiniteScroll2.prototype.componentDidUpdate = function(prevProps) {
9770
+ if (this.props.dataLength === prevProps.dataLength)
9771
+ return;
9772
+ this.actionTriggered = false;
9773
+ this.setState({
9774
+ showLoader: false
9775
+ });
9776
+ };
9777
+ InfiniteScroll2.getDerivedStateFromProps = function(nextProps, prevState) {
9778
+ var dataLengthChanged = nextProps.dataLength !== prevState.prevDataLength;
9779
+ if (dataLengthChanged) {
9780
+ return __assign$1(__assign$1({}, prevState), { prevDataLength: nextProps.dataLength });
9781
+ }
9782
+ return null;
9783
+ };
9784
+ InfiniteScroll2.prototype.isElementAtTop = function(target, scrollThreshold) {
9785
+ if (scrollThreshold === void 0) {
9786
+ scrollThreshold = 0.8;
9787
+ }
9788
+ var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9789
+ var threshold = parseThreshold(scrollThreshold);
9790
+ if (threshold.unit === ThresholdUnits.Pixel) {
9791
+ return target.scrollTop <= threshold.value + clientHeight - target.scrollHeight + 1;
9792
+ }
9793
+ return target.scrollTop <= threshold.value / 100 + clientHeight - target.scrollHeight + 1;
9794
+ };
9795
+ InfiniteScroll2.prototype.isElementAtBottom = function(target, scrollThreshold) {
9796
+ if (scrollThreshold === void 0) {
9797
+ scrollThreshold = 0.8;
9798
+ }
9799
+ var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9800
+ var threshold = parseThreshold(scrollThreshold);
9801
+ if (threshold.unit === ThresholdUnits.Pixel) {
9802
+ return target.scrollTop + clientHeight >= target.scrollHeight - threshold.value;
9803
+ }
9804
+ return target.scrollTop + clientHeight >= threshold.value / 100 * target.scrollHeight;
9805
+ };
9806
+ InfiniteScroll2.prototype.render = function() {
9807
+ var _this = this;
9808
+ var style = __assign$1({ height: this.props.height || "auto", overflow: "auto", WebkitOverflowScrolling: "touch" }, this.props.style);
9809
+ var hasChildren2 = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length);
9810
+ var outerDivStyle = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
9811
+ return React__default.createElement(
9812
+ "div",
9813
+ { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
9814
+ React__default.createElement(
9815
+ "div",
9816
+ { className: "infinite-scroll-component " + (this.props.className || ""), ref: function(infScroll) {
9817
+ return _this._infScroll = infScroll;
9818
+ }, style },
9819
+ this.props.pullDownToRefresh && React__default.createElement(
9820
+ "div",
9821
+ { style: { position: "relative" }, ref: function(pullDown) {
9822
+ return _this._pullDown = pullDown;
9823
+ } },
9824
+ React__default.createElement("div", { style: {
9825
+ position: "absolute",
9826
+ left: 0,
9827
+ right: 0,
9828
+ top: -1 * this.maxPullDownDistance
9829
+ } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)
9830
+ ),
9831
+ this.props.children,
9832
+ !this.state.showLoader && !hasChildren2 && this.props.hasMore && this.props.loader,
9833
+ this.state.showLoader && this.props.hasMore && this.props.loader,
9834
+ !this.props.hasMore && this.props.endMessage
9835
+ )
9836
+ );
9837
+ };
9838
+ return InfiniteScroll2;
9839
+ }(Component$1)
9840
+ );
9841
+ const inputInTable$8 = "_inputInTable_7sjlf_1";
9842
+ const inputHover$8 = "_inputHover_7sjlf_13";
9843
+ const inputFocus$8 = "_inputFocus_7sjlf_18";
9844
+ const inputError$8 = "_inputError_7sjlf_25";
9845
+ const inputWarning$8 = "_inputWarning_7sjlf_26";
9846
+ const inputDisabled$8 = "_inputDisabled_7sjlf_61";
9847
+ const hideScrollbars$8 = "_hideScrollbars_7sjlf_67";
9848
+ const header$1 = "_header_7sjlf_77";
9849
+ const headerTitle = "_headerTitle_7sjlf_77";
9850
+ const heading$3 = "_heading_7sjlf_78";
9851
+ const itemHeader = "_itemHeader_7sjlf_78";
9852
+ const narrow = "_narrow_7sjlf_81";
9853
+ const stickyHeader = "_stickyHeader_7sjlf_85";
9854
+ const title$3 = "_title_7sjlf_96";
9855
+ const name = "_name_7sjlf_102";
9856
+ const iconTooltipMargin = "_iconTooltipMargin_7sjlf_105";
9857
+ const bold = "_bold_7sjlf_108";
9858
+ const toggleNarrow = "_toggleNarrow_7sjlf_117";
9859
+ const drag$1 = "_drag_7sjlf_135";
9860
+ const dragOverlay$1 = "_dragOverlay_7sjlf_156";
9861
+ const list$1 = "_list_7sjlf_161";
9862
+ const bordered$1 = "_bordered_7sjlf_165";
9863
+ const item$4 = "_item_7sjlf_78";
9864
+ const action = "_action_7sjlf_198";
9865
+ const active$3 = "_active_7sjlf_201";
9866
+ const indented = "_indented_7sjlf_208";
9867
+ const disabled$5 = "_disabled_7sjlf_221";
9868
+ const label$6 = "_label_7sjlf_232";
9869
+ const details$2 = "_details_7sjlf_243";
9870
+ const metadata = "_metadata_7sjlf_244";
9871
+ const itemContent = "_itemContent_7sjlf_252";
9872
+ const indentIcon = "_indentIcon_7sjlf_259";
9873
+ const expandIcon = "_expandIcon_7sjlf_264";
9874
+ const expanded = "_expanded_7sjlf_271";
9875
+ const right$4 = "_right_7sjlf_274";
9876
+ const actions = "_actions_7sjlf_282";
9877
+ const scrollableList = "_scrollableList_7sjlf_287";
9878
+ const infiniteScrollContainer = "_infiniteScrollContainer_7sjlf_292";
9879
+ const hideScrollbar = "_hideScrollbar_7sjlf_67";
9880
+ const noPointerEvents = "_noPointerEvents_7sjlf_309";
9545
9881
  const listStyles = {
9546
9882
  inputInTable: inputInTable$8,
9547
9883
  inputHover: inputHover$8,
@@ -9550,10 +9886,6 @@ const listStyles = {
9550
9886
  inputWarning: inputWarning$8,
9551
9887
  inputDisabled: inputDisabled$8,
9552
9888
  hideScrollbars: hideScrollbars$8,
9553
- list: list$1,
9554
- bordered: bordered$1,
9555
- virtualRow,
9556
- item: item$4,
9557
9889
  header: header$1,
9558
9890
  headerTitle,
9559
9891
  heading: heading$3,
@@ -9567,7 +9899,9 @@ const listStyles = {
9567
9899
  toggleNarrow,
9568
9900
  drag: drag$1,
9569
9901
  dragOverlay: dragOverlay$1,
9570
- listContent,
9902
+ list: list$1,
9903
+ bordered: bordered$1,
9904
+ item: item$4,
9571
9905
  action,
9572
9906
  active: active$3,
9573
9907
  indented,
@@ -9581,9 +9915,10 @@ const listStyles = {
9581
9915
  expanded,
9582
9916
  right: right$4,
9583
9917
  actions,
9918
+ scrollableList,
9919
+ infiniteScrollContainer,
9584
9920
  hideScrollbar,
9585
- noPointerEvents,
9586
- virtualRows
9921
+ noPointerEvents
9587
9922
  };
9588
9923
  const ToggleNarrow = ({
9589
9924
  toggleNarrow: toggleNarrow2,
@@ -9687,10 +10022,10 @@ function getOwnerDocument(target) {
9687
10022
  }
9688
10023
  return document;
9689
10024
  }
9690
- const useIsomorphicLayoutEffect$5 = canUseDOM ? useLayoutEffect$1 : useEffect;
10025
+ const useIsomorphicLayoutEffect$4 = canUseDOM ? useLayoutEffect$1 : useEffect;
9691
10026
  function useEvent$1(handler) {
9692
10027
  const handlerRef = useRef(handler);
9693
- useIsomorphicLayoutEffect$5(() => {
10028
+ useIsomorphicLayoutEffect$4(() => {
9694
10029
  handlerRef.current = handler;
9695
10030
  });
9696
10031
  return useCallback(function() {
@@ -9718,7 +10053,7 @@ function useLatestValue(value, dependencies) {
9718
10053
  dependencies = [value];
9719
10054
  }
9720
10055
  const valueRef = useRef(value);
9721
- useIsomorphicLayoutEffect$5(() => {
10056
+ useIsomorphicLayoutEffect$4(() => {
9722
10057
  if (valueRef.current !== value) {
9723
10058
  valueRef.current = value;
9724
10059
  }
@@ -9808,9 +10143,9 @@ function isTouchEvent$2(event) {
9808
10143
  return false;
9809
10144
  }
9810
10145
  const {
9811
- TouchEvent
10146
+ TouchEvent: TouchEvent2
9812
10147
  } = getWindow(event.target);
9813
- return TouchEvent && event instanceof TouchEvent;
10148
+ return TouchEvent2 && event instanceof TouchEvent2;
9814
10149
  }
9815
10150
  function getEventCoordinates(event) {
9816
10151
  if (isTouchEvent$2(event)) {
@@ -11630,7 +11965,7 @@ function useRect(element, measure, fallbackRect) {
11630
11965
  const resizeObserver = useResizeObserver({
11631
11966
  callback: measureRect
11632
11967
  });
11633
- useIsomorphicLayoutEffect$5(() => {
11968
+ useIsomorphicLayoutEffect$4(() => {
11634
11969
  measureRect();
11635
11970
  if (element) {
11636
11971
  resizeObserver == null ? void 0 : resizeObserver.observe(element);
@@ -11813,7 +12148,7 @@ function useRects(elements, measure) {
11813
12148
  if (elements.length > 0 && rects === defaultValue$2) {
11814
12149
  measureRects();
11815
12150
  }
11816
- useIsomorphicLayoutEffect$5(() => {
12151
+ useIsomorphicLayoutEffect$4(() => {
11817
12152
  if (elements.length) {
11818
12153
  elements.forEach((element) => resizeObserver == null ? void 0 : resizeObserver.observe(element));
11819
12154
  } else {
@@ -12184,7 +12519,7 @@ function useLayoutShiftScrollCompensation(_ref) {
12184
12519
  x: config,
12185
12520
  y: config
12186
12521
  } : config;
12187
- useIsomorphicLayoutEffect$5(() => {
12522
+ useIsomorphicLayoutEffect$4(() => {
12188
12523
  const disabled2 = !x2 && !y2;
12189
12524
  if (disabled2 || !activeNode) {
12190
12525
  initialized.current = false;
@@ -12228,7 +12563,7 @@ var Status;
12228
12563
  Status2[Status2["Initializing"] = 1] = "Initializing";
12229
12564
  Status2[Status2["Initialized"] = 2] = "Initialized";
12230
12565
  })(Status || (Status = {}));
12231
- const DndContext$1 = /* @__PURE__ */ memo$1(function DndContext(_ref) {
12566
+ const DndContext$1 = /* @__PURE__ */ memo(function DndContext(_ref) {
12232
12567
  var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;
12233
12568
  let {
12234
12569
  id: id2,
@@ -12506,7 +12841,7 @@ const DndContext$1 = /* @__PURE__ */ memo$1(function DndContext(_ref) {
12506
12841
  }, [draggableNodes, instantiateSensor]);
12507
12842
  const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
12508
12843
  useSensorSetup(sensors);
12509
- useIsomorphicLayoutEffect$5(() => {
12844
+ useIsomorphicLayoutEffect$4(() => {
12510
12845
  if (activeNodeRect && status === Status.Initializing) {
12511
12846
  setStatus(Status.Initialized);
12512
12847
  }
@@ -12590,7 +12925,7 @@ const DndContext$1 = /* @__PURE__ */ memo$1(function DndContext(_ref) {
12590
12925
  // eslint-disable-next-line react-hooks/exhaustive-deps
12591
12926
  [overId]
12592
12927
  );
12593
- useIsomorphicLayoutEffect$5(() => {
12928
+ useIsomorphicLayoutEffect$4(() => {
12594
12929
  sensorContext.current = {
12595
12930
  activatorEvent,
12596
12931
  active: active2,
@@ -12717,7 +13052,7 @@ function useDraggable(_ref) {
12717
13052
  const [activatorNode, setActivatorNodeRef] = useNodeRef();
12718
13053
  const listeners = useSyntheticListeners(activators, id2);
12719
13054
  const dataRef = useLatestValue(data);
12720
- useIsomorphicLayoutEffect$5(
13055
+ useIsomorphicLayoutEffect$4(
12721
13056
  () => {
12722
13057
  draggableNodes.set(id2, {
12723
13058
  id: id2,
@@ -12837,7 +13172,7 @@ function useDroppable(_ref) {
12837
13172
  resizeObserverConnected.current = false;
12838
13173
  resizeObserver.observe(nodeRef.current);
12839
13174
  }, [nodeRef, resizeObserver]);
12840
- useIsomorphicLayoutEffect$5(
13175
+ useIsomorphicLayoutEffect$4(
12841
13176
  () => {
12842
13177
  dispatch({
12843
13178
  type: Action.RegisterDroppable,
@@ -12890,7 +13225,7 @@ function AnimationManager(_ref) {
12890
13225
  if (!children && !clonedChildren && previousChildren) {
12891
13226
  setClonedChildren(previousChildren);
12892
13227
  }
12893
- useIsomorphicLayoutEffect$5(() => {
13228
+ useIsomorphicLayoutEffect$4(() => {
12894
13229
  if (!element) {
12895
13230
  return;
12896
13231
  }
@@ -13390,7 +13725,7 @@ function SortableContext(_ref) {
13390
13725
  const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
13391
13726
  const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
13392
13727
  const disabled2 = normalizeDisabled(disabledProp);
13393
- useIsomorphicLayoutEffect$5(() => {
13728
+ useIsomorphicLayoutEffect$4(() => {
13394
13729
  if (itemsHaveChanged && isDragging) {
13395
13730
  measureDroppableContainers(items);
13396
13731
  }
@@ -13471,7 +13806,7 @@ function useDerivedTransform(_ref) {
13471
13806
  } = _ref;
13472
13807
  const [derivedTransform, setDerivedtransform] = useState(null);
13473
13808
  const previousIndex = useRef(index2);
13474
- useIsomorphicLayoutEffect$5(() => {
13809
+ useIsomorphicLayoutEffect$4(() => {
13475
13810
  if (!disabled2 && index2 !== previousIndex.current && node2.current) {
13476
13811
  const initial = rect.current;
13477
13812
  if (initial) {
@@ -13866,6 +14201,72 @@ const ListRow = forwardRef(
13866
14201
  return isSubheading ? /* @__PURE__ */ jsx(ListSubheading, { ref: listRowRefs, item: item2, index: index2 }, index2) : draggable ? listElementWithDrag(index2, item2) : listElement(index2, item2);
13867
14202
  }
13868
14203
  );
14204
+ const loader = "_loader_477i5_1";
14205
+ const fullViewPortSize = "_fullViewPortSize_477i5_7";
14206
+ const cover = "_cover_477i5_14";
14207
+ const dimmer = "_dimmer_477i5_21";
14208
+ const content$2 = "_content_477i5_44";
14209
+ const text$1 = "_text_477i5_49";
14210
+ const details$1 = "_details_477i5_53";
14211
+ const styles$t = {
14212
+ loader,
14213
+ fullViewPortSize,
14214
+ cover,
14215
+ dimmer,
14216
+ content: content$2,
14217
+ text: text$1,
14218
+ details: details$1
14219
+ };
14220
+ const Loader = ({
14221
+ width: width2,
14222
+ height: height2,
14223
+ text: text2 = "",
14224
+ details: details2 = "",
14225
+ fullViewPortSize: fullViewPortSize2 = false,
14226
+ cover: cover2 = false,
14227
+ children = null,
14228
+ theme = Theme.DARK,
14229
+ testId = null
14230
+ }) => {
14231
+ const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14232
+ const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14233
+ return /* @__PURE__ */ jsx(
14234
+ "div",
14235
+ {
14236
+ className: cx$2(styles$t.loader, cover2 ? styles$t.cover : "", {
14237
+ [styles$t.fullViewPortSize]: fullViewPortSize2
14238
+ }),
14239
+ style: { width: width2, height: height2 },
14240
+ "data-testid": testId,
14241
+ children: /* @__PURE__ */ jsx("div", { className: styles$t.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14242
+ "div",
14243
+ {
14244
+ className: styles$t.content,
14245
+ "data-testid": testId && `${testId}-content`,
14246
+ children: [
14247
+ children,
14248
+ text2 && /* @__PURE__ */ jsx(
14249
+ "div",
14250
+ {
14251
+ className: styles$t.text,
14252
+ "data-testid": testId && `${testId}-text`,
14253
+ children: text2
14254
+ }
14255
+ ),
14256
+ details2 && /* @__PURE__ */ jsx(
14257
+ "div",
14258
+ {
14259
+ className: styles$t.details,
14260
+ "data-testid": testId && `${testId}-details`,
14261
+ children: details2
14262
+ }
14263
+ )
14264
+ ]
14265
+ }
14266
+ ) })
14267
+ }
14268
+ );
14269
+ };
13869
14270
  const ListDragWrapper = ({
13870
14271
  children,
13871
14272
  draggable,
@@ -13880,14 +14281,15 @@ const ListDragWrapper = ({
13880
14281
  setDragIndex(event.active.id);
13881
14282
  };
13882
14283
  const handleDragEnd = (event) => {
14284
+ var _a2, _b, _c, _d, _e2, _f, _g, _h;
13883
14285
  setDragIndex(null);
13884
14286
  const { active: active2, over } = event;
13885
- const from3 = active2 == null ? void 0 : active2.id;
13886
- const to2 = over == null ? void 0 : over.id;
14287
+ const from3 = (_b = (_a2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _a2.current) == null ? void 0 : _b.sortable.index;
14288
+ const to2 = (_d = (_c = over == null ? void 0 : over.data) == null ? void 0 : _c.current) == null ? void 0 : _d.sortable.index;
13887
14289
  if (from3 !== to2) {
13888
14290
  onListReorder({
13889
- from: Number(from3),
13890
- to: Number(to2)
14291
+ from: (_f = (_e2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _e2.current) == null ? void 0 : _f.sortable.index,
14292
+ to: (_h = (_g = over == null ? void 0 : over.data) == null ? void 0 : _g.current) == null ? void 0 : _h.sortable.index
13891
14293
  });
13892
14294
  }
13893
14295
  };
@@ -13918,818 +14320,6 @@ const ListDragWrapper = ({
13918
14320
  }
13919
14321
  );
13920
14322
  };
13921
- function memo(getDeps, fn, opts) {
13922
- let deps = opts.initialDeps ?? [];
13923
- let result;
13924
- return () => {
13925
- var _a2, _b, _c, _d;
13926
- let depTime;
13927
- if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
13928
- const newDeps = getDeps();
13929
- const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index2) => deps[index2] !== dep);
13930
- if (!depsChanged) {
13931
- return result;
13932
- }
13933
- deps = newDeps;
13934
- let resultTime;
13935
- if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
13936
- result = fn(...newDeps);
13937
- if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
13938
- const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
13939
- const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
13940
- const resultFpsPercentage = resultEndTime / 16;
13941
- const pad = (str, num) => {
13942
- str = String(str);
13943
- while (str.length < num) {
13944
- str = " " + str;
13945
- }
13946
- return str;
13947
- };
13948
- console.info(
13949
- `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
13950
- `
13951
- font-size: .6rem;
13952
- font-weight: bold;
13953
- color: hsl(${Math.max(
13954
- 0,
13955
- Math.min(120 - 120 * resultFpsPercentage, 120)
13956
- )}deg 100% 31%);`,
13957
- opts == null ? void 0 : opts.key
13958
- );
13959
- }
13960
- (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
13961
- return result;
13962
- };
13963
- }
13964
- function notUndefined(value, msg2) {
13965
- if (value === void 0) {
13966
- throw new Error(`Unexpected undefined${""}`);
13967
- } else {
13968
- return value;
13969
- }
13970
- }
13971
- const approxEqual = (a2, b2) => Math.abs(a2 - b2) < 1;
13972
- const debounce$2 = (targetWindow, fn, ms2) => {
13973
- let timeoutId;
13974
- return function(...args) {
13975
- targetWindow.clearTimeout(timeoutId);
13976
- timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms2);
13977
- };
13978
- };
13979
- const defaultKeyExtractor = (index2) => index2;
13980
- const defaultRangeExtractor = (range2) => {
13981
- const start = Math.max(range2.startIndex - range2.overscan, 0);
13982
- const end = Math.min(range2.endIndex + range2.overscan, range2.count - 1);
13983
- const arr = [];
13984
- for (let i = start; i <= end; i++) {
13985
- arr.push(i);
13986
- }
13987
- return arr;
13988
- };
13989
- const observeElementRect = (instance, cb2) => {
13990
- const element = instance.scrollElement;
13991
- if (!element) {
13992
- return;
13993
- }
13994
- const targetWindow = instance.targetWindow;
13995
- if (!targetWindow) {
13996
- return;
13997
- }
13998
- const handler = (rect) => {
13999
- const { width: width2, height: height2 } = rect;
14000
- cb2({ width: Math.round(width2), height: Math.round(height2) });
14001
- };
14002
- handler(element.getBoundingClientRect());
14003
- if (!targetWindow.ResizeObserver) {
14004
- return () => {
14005
- };
14006
- }
14007
- const observer = new targetWindow.ResizeObserver((entries2) => {
14008
- const entry = entries2[0];
14009
- if (entry == null ? void 0 : entry.borderBoxSize) {
14010
- const box = entry.borderBoxSize[0];
14011
- if (box) {
14012
- handler({ width: box.inlineSize, height: box.blockSize });
14013
- return;
14014
- }
14015
- }
14016
- handler(element.getBoundingClientRect());
14017
- });
14018
- observer.observe(element, { box: "border-box" });
14019
- return () => {
14020
- observer.unobserve(element);
14021
- };
14022
- };
14023
- const addEventListenerOptions = {
14024
- passive: true
14025
- };
14026
- const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
14027
- const observeElementOffset = (instance, cb2) => {
14028
- const element = instance.scrollElement;
14029
- if (!element) {
14030
- return;
14031
- }
14032
- const targetWindow = instance.targetWindow;
14033
- if (!targetWindow) {
14034
- return;
14035
- }
14036
- let offset = 0;
14037
- const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce$2(
14038
- targetWindow,
14039
- () => {
14040
- cb2(offset, false);
14041
- },
14042
- instance.options.isScrollingResetDelay
14043
- );
14044
- const createHandler = (isScrolling) => () => {
14045
- const { horizontal, isRtl } = instance.options;
14046
- offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"];
14047
- fallback();
14048
- cb2(offset, isScrolling);
14049
- };
14050
- const handler = createHandler(true);
14051
- const endHandler = createHandler(false);
14052
- endHandler();
14053
- element.addEventListener("scroll", handler, addEventListenerOptions);
14054
- element.addEventListener("scrollend", endHandler, addEventListenerOptions);
14055
- return () => {
14056
- element.removeEventListener("scroll", handler);
14057
- element.removeEventListener("scrollend", endHandler);
14058
- };
14059
- };
14060
- const measureElement = (element, entry, instance) => {
14061
- if (entry == null ? void 0 : entry.borderBoxSize) {
14062
- const box = entry.borderBoxSize[0];
14063
- if (box) {
14064
- const size2 = Math.round(
14065
- box[instance.options.horizontal ? "inlineSize" : "blockSize"]
14066
- );
14067
- return size2;
14068
- }
14069
- }
14070
- return Math.round(
14071
- element.getBoundingClientRect()[instance.options.horizontal ? "width" : "height"]
14072
- );
14073
- };
14074
- const elementScroll = (offset, {
14075
- adjustments = 0,
14076
- behavior
14077
- }, instance) => {
14078
- var _a2, _b;
14079
- const toOffset = offset + adjustments;
14080
- (_b = (_a2 = instance.scrollElement) == null ? void 0 : _a2.scrollTo) == null ? void 0 : _b.call(_a2, {
14081
- [instance.options.horizontal ? "left" : "top"]: toOffset,
14082
- behavior
14083
- });
14084
- };
14085
- class Virtualizer {
14086
- constructor(opts) {
14087
- this.unsubs = [];
14088
- this.scrollElement = null;
14089
- this.targetWindow = null;
14090
- this.isScrolling = false;
14091
- this.scrollToIndexTimeoutId = null;
14092
- this.measurementsCache = [];
14093
- this.itemSizeCache = /* @__PURE__ */ new Map();
14094
- this.pendingMeasuredCacheIndexes = [];
14095
- this.scrollRect = null;
14096
- this.scrollOffset = null;
14097
- this.scrollDirection = null;
14098
- this.scrollAdjustments = 0;
14099
- this.elementsCache = /* @__PURE__ */ new Map();
14100
- this.observer = /* @__PURE__ */ (() => {
14101
- let _ro = null;
14102
- const get3 = () => {
14103
- if (_ro) {
14104
- return _ro;
14105
- }
14106
- if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
14107
- return null;
14108
- }
14109
- return _ro = new this.targetWindow.ResizeObserver((entries2) => {
14110
- entries2.forEach((entry) => {
14111
- this._measureElement(entry.target, entry);
14112
- });
14113
- });
14114
- };
14115
- return {
14116
- disconnect: () => {
14117
- var _a2;
14118
- (_a2 = get3()) == null ? void 0 : _a2.disconnect();
14119
- _ro = null;
14120
- },
14121
- observe: (target) => {
14122
- var _a2;
14123
- return (_a2 = get3()) == null ? void 0 : _a2.observe(target, { box: "border-box" });
14124
- },
14125
- unobserve: (target) => {
14126
- var _a2;
14127
- return (_a2 = get3()) == null ? void 0 : _a2.unobserve(target);
14128
- }
14129
- };
14130
- })();
14131
- this.range = null;
14132
- this.setOptions = (opts2) => {
14133
- Object.entries(opts2).forEach(([key2, value]) => {
14134
- if (typeof value === "undefined") delete opts2[key2];
14135
- });
14136
- this.options = {
14137
- debug: false,
14138
- initialOffset: 0,
14139
- overscan: 1,
14140
- paddingStart: 0,
14141
- paddingEnd: 0,
14142
- scrollPaddingStart: 0,
14143
- scrollPaddingEnd: 0,
14144
- horizontal: false,
14145
- getItemKey: defaultKeyExtractor,
14146
- rangeExtractor: defaultRangeExtractor,
14147
- onChange: () => {
14148
- },
14149
- measureElement,
14150
- initialRect: { width: 0, height: 0 },
14151
- scrollMargin: 0,
14152
- gap: 0,
14153
- indexAttribute: "data-index",
14154
- initialMeasurementsCache: [],
14155
- lanes: 1,
14156
- isScrollingResetDelay: 150,
14157
- enabled: true,
14158
- isRtl: false,
14159
- useScrollendEvent: true,
14160
- ...opts2
14161
- };
14162
- };
14163
- this.notify = (sync2) => {
14164
- var _a2, _b;
14165
- (_b = (_a2 = this.options).onChange) == null ? void 0 : _b.call(_a2, this, sync2);
14166
- };
14167
- this.maybeNotify = memo(
14168
- () => {
14169
- this.calculateRange();
14170
- return [
14171
- this.isScrolling,
14172
- this.range ? this.range.startIndex : null,
14173
- this.range ? this.range.endIndex : null
14174
- ];
14175
- },
14176
- (isScrolling) => {
14177
- this.notify(isScrolling);
14178
- },
14179
- {
14180
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
14181
- debug: () => this.options.debug,
14182
- initialDeps: [
14183
- this.isScrolling,
14184
- this.range ? this.range.startIndex : null,
14185
- this.range ? this.range.endIndex : null
14186
- ]
14187
- }
14188
- );
14189
- this.cleanup = () => {
14190
- this.unsubs.filter(Boolean).forEach((d2) => d2());
14191
- this.unsubs = [];
14192
- this.observer.disconnect();
14193
- this.scrollElement = null;
14194
- this.targetWindow = null;
14195
- };
14196
- this._didMount = () => {
14197
- return () => {
14198
- this.cleanup();
14199
- };
14200
- };
14201
- this._willUpdate = () => {
14202
- var _a2;
14203
- const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
14204
- if (this.scrollElement !== scrollElement) {
14205
- this.cleanup();
14206
- if (!scrollElement) {
14207
- this.maybeNotify();
14208
- return;
14209
- }
14210
- this.scrollElement = scrollElement;
14211
- if (this.scrollElement && "ownerDocument" in this.scrollElement) {
14212
- this.targetWindow = this.scrollElement.ownerDocument.defaultView;
14213
- } else {
14214
- this.targetWindow = ((_a2 = this.scrollElement) == null ? void 0 : _a2.window) ?? null;
14215
- }
14216
- this.elementsCache.forEach((cached) => {
14217
- this.observer.observe(cached);
14218
- });
14219
- this._scrollToOffset(this.getScrollOffset(), {
14220
- adjustments: void 0,
14221
- behavior: void 0
14222
- });
14223
- this.unsubs.push(
14224
- this.options.observeElementRect(this, (rect) => {
14225
- this.scrollRect = rect;
14226
- this.maybeNotify();
14227
- })
14228
- );
14229
- this.unsubs.push(
14230
- this.options.observeElementOffset(this, (offset, isScrolling) => {
14231
- this.scrollAdjustments = 0;
14232
- this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
14233
- this.scrollOffset = offset;
14234
- this.isScrolling = isScrolling;
14235
- this.maybeNotify();
14236
- })
14237
- );
14238
- }
14239
- };
14240
- this.getSize = () => {
14241
- if (!this.options.enabled) {
14242
- this.scrollRect = null;
14243
- return 0;
14244
- }
14245
- this.scrollRect = this.scrollRect ?? this.options.initialRect;
14246
- return this.scrollRect[this.options.horizontal ? "width" : "height"];
14247
- };
14248
- this.getScrollOffset = () => {
14249
- if (!this.options.enabled) {
14250
- this.scrollOffset = null;
14251
- return 0;
14252
- }
14253
- this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
14254
- return this.scrollOffset;
14255
- };
14256
- this.getFurthestMeasurement = (measurements, index2) => {
14257
- const furthestMeasurementsFound = /* @__PURE__ */ new Map();
14258
- const furthestMeasurements = /* @__PURE__ */ new Map();
14259
- for (let m2 = index2 - 1; m2 >= 0; m2--) {
14260
- const measurement = measurements[m2];
14261
- if (furthestMeasurementsFound.has(measurement.lane)) {
14262
- continue;
14263
- }
14264
- const previousFurthestMeasurement = furthestMeasurements.get(
14265
- measurement.lane
14266
- );
14267
- if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
14268
- furthestMeasurements.set(measurement.lane, measurement);
14269
- } else if (measurement.end < previousFurthestMeasurement.end) {
14270
- furthestMeasurementsFound.set(measurement.lane, true);
14271
- }
14272
- if (furthestMeasurementsFound.size === this.options.lanes) {
14273
- break;
14274
- }
14275
- }
14276
- return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a2, b2) => {
14277
- if (a2.end === b2.end) {
14278
- return a2.index - b2.index;
14279
- }
14280
- return a2.end - b2.end;
14281
- })[0] : void 0;
14282
- };
14283
- this.getMeasurementOptions = memo(
14284
- () => [
14285
- this.options.count,
14286
- this.options.paddingStart,
14287
- this.options.scrollMargin,
14288
- this.options.getItemKey,
14289
- this.options.enabled
14290
- ],
14291
- (count, paddingStart, scrollMargin, getItemKey, enabled) => {
14292
- this.pendingMeasuredCacheIndexes = [];
14293
- return {
14294
- count,
14295
- paddingStart,
14296
- scrollMargin,
14297
- getItemKey,
14298
- enabled
14299
- };
14300
- },
14301
- {
14302
- key: false
14303
- }
14304
- );
14305
- this.getMeasurements = memo(
14306
- () => [this.getMeasurementOptions(), this.itemSizeCache],
14307
- ({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
14308
- if (!enabled) {
14309
- this.measurementsCache = [];
14310
- this.itemSizeCache.clear();
14311
- return [];
14312
- }
14313
- if (this.measurementsCache.length === 0) {
14314
- this.measurementsCache = this.options.initialMeasurementsCache;
14315
- this.measurementsCache.forEach((item2) => {
14316
- this.itemSizeCache.set(item2.key, item2.size);
14317
- });
14318
- }
14319
- const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
14320
- this.pendingMeasuredCacheIndexes = [];
14321
- const measurements = this.measurementsCache.slice(0, min);
14322
- for (let i = min; i < count; i++) {
14323
- const key2 = getItemKey(i);
14324
- const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
14325
- const start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
14326
- const measuredSize = itemSizeCache.get(key2);
14327
- const size2 = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
14328
- const end = start + size2;
14329
- const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
14330
- measurements[i] = {
14331
- index: i,
14332
- start,
14333
- size: size2,
14334
- end,
14335
- key: key2,
14336
- lane
14337
- };
14338
- }
14339
- this.measurementsCache = measurements;
14340
- return measurements;
14341
- },
14342
- {
14343
- key: process.env.NODE_ENV !== "production" && "getMeasurements",
14344
- debug: () => this.options.debug
14345
- }
14346
- );
14347
- this.calculateRange = memo(
14348
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
14349
- (measurements, outerSize, scrollOffset) => {
14350
- return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
14351
- measurements,
14352
- outerSize,
14353
- scrollOffset
14354
- }) : null;
14355
- },
14356
- {
14357
- key: process.env.NODE_ENV !== "production" && "calculateRange",
14358
- debug: () => this.options.debug
14359
- }
14360
- );
14361
- this.getIndexes = memo(
14362
- () => [
14363
- this.options.rangeExtractor,
14364
- this.calculateRange(),
14365
- this.options.overscan,
14366
- this.options.count
14367
- ],
14368
- (rangeExtractor, range2, overscan, count) => {
14369
- return range2 === null ? [] : rangeExtractor({
14370
- startIndex: range2.startIndex,
14371
- endIndex: range2.endIndex,
14372
- overscan,
14373
- count
14374
- });
14375
- },
14376
- {
14377
- key: process.env.NODE_ENV !== "production" && "getIndexes",
14378
- debug: () => this.options.debug
14379
- }
14380
- );
14381
- this.indexFromElement = (node2) => {
14382
- const attributeName = this.options.indexAttribute;
14383
- const indexStr = node2.getAttribute(attributeName);
14384
- if (!indexStr) {
14385
- console.warn(
14386
- `Missing attribute name '${attributeName}={index}' on measured element.`
14387
- );
14388
- return -1;
14389
- }
14390
- return parseInt(indexStr, 10);
14391
- };
14392
- this._measureElement = (node2, entry) => {
14393
- const index2 = this.indexFromElement(node2);
14394
- const item2 = this.measurementsCache[index2];
14395
- if (!item2) {
14396
- return;
14397
- }
14398
- const key2 = item2.key;
14399
- const prevNode = this.elementsCache.get(key2);
14400
- if (prevNode !== node2) {
14401
- if (prevNode) {
14402
- this.observer.unobserve(prevNode);
14403
- }
14404
- this.observer.observe(node2);
14405
- this.elementsCache.set(key2, node2);
14406
- }
14407
- if (node2.isConnected) {
14408
- this.resizeItem(index2, this.options.measureElement(node2, entry, this));
14409
- }
14410
- };
14411
- this.resizeItem = (index2, size2) => {
14412
- const item2 = this.measurementsCache[index2];
14413
- if (!item2) {
14414
- return;
14415
- }
14416
- const itemSize = this.itemSizeCache.get(item2.key) ?? item2.size;
14417
- const delta = size2 - itemSize;
14418
- if (delta !== 0) {
14419
- if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item2, delta, this) : item2.start < this.getScrollOffset() + this.scrollAdjustments) {
14420
- if (process.env.NODE_ENV !== "production" && this.options.debug) {
14421
- console.info("correction", delta);
14422
- }
14423
- this._scrollToOffset(this.getScrollOffset(), {
14424
- adjustments: this.scrollAdjustments += delta,
14425
- behavior: void 0
14426
- });
14427
- }
14428
- this.pendingMeasuredCacheIndexes.push(item2.index);
14429
- this.itemSizeCache = new Map(this.itemSizeCache.set(item2.key, size2));
14430
- this.notify(false);
14431
- }
14432
- };
14433
- this.measureElement = (node2) => {
14434
- if (!node2) {
14435
- this.elementsCache.forEach((cached, key2) => {
14436
- if (!cached.isConnected) {
14437
- this.observer.unobserve(cached);
14438
- this.elementsCache.delete(key2);
14439
- }
14440
- });
14441
- return;
14442
- }
14443
- this._measureElement(node2, void 0);
14444
- };
14445
- this.getVirtualItems = memo(
14446
- () => [this.getIndexes(), this.getMeasurements()],
14447
- (indexes, measurements) => {
14448
- const virtualItems = [];
14449
- for (let k2 = 0, len = indexes.length; k2 < len; k2++) {
14450
- const i = indexes[k2];
14451
- const measurement = measurements[i];
14452
- virtualItems.push(measurement);
14453
- }
14454
- return virtualItems;
14455
- },
14456
- {
14457
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
14458
- debug: () => this.options.debug
14459
- }
14460
- );
14461
- this.getVirtualItemForOffset = (offset) => {
14462
- const measurements = this.getMeasurements();
14463
- if (measurements.length === 0) {
14464
- return void 0;
14465
- }
14466
- return notUndefined(
14467
- measurements[findNearestBinarySearch(
14468
- 0,
14469
- measurements.length - 1,
14470
- (index2) => notUndefined(measurements[index2]).start,
14471
- offset
14472
- )]
14473
- );
14474
- };
14475
- this.getOffsetForAlignment = (toOffset, align) => {
14476
- const size2 = this.getSize();
14477
- const scrollOffset = this.getScrollOffset();
14478
- if (align === "auto") {
14479
- if (toOffset <= scrollOffset) {
14480
- align = "start";
14481
- } else if (toOffset >= scrollOffset + size2) {
14482
- align = "end";
14483
- } else {
14484
- align = "start";
14485
- }
14486
- }
14487
- if (align === "start") {
14488
- toOffset = toOffset;
14489
- } else if (align === "end") {
14490
- toOffset = toOffset - size2;
14491
- } else if (align === "center") {
14492
- toOffset = toOffset - size2 / 2;
14493
- }
14494
- const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
14495
- const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
14496
- const maxOffset = scrollSize - size2;
14497
- return Math.max(Math.min(maxOffset, toOffset), 0);
14498
- };
14499
- this.getOffsetForIndex = (index2, align = "auto") => {
14500
- index2 = Math.max(0, Math.min(index2, this.options.count - 1));
14501
- const item2 = this.measurementsCache[index2];
14502
- if (!item2) {
14503
- return void 0;
14504
- }
14505
- const size2 = this.getSize();
14506
- const scrollOffset = this.getScrollOffset();
14507
- if (align === "auto") {
14508
- if (item2.end >= scrollOffset + size2 - this.options.scrollPaddingEnd) {
14509
- align = "end";
14510
- } else if (item2.start <= scrollOffset + this.options.scrollPaddingStart) {
14511
- align = "start";
14512
- } else {
14513
- return [scrollOffset, align];
14514
- }
14515
- }
14516
- const toOffset = align === "end" ? item2.end + this.options.scrollPaddingEnd : item2.start - this.options.scrollPaddingStart;
14517
- return [this.getOffsetForAlignment(toOffset, align), align];
14518
- };
14519
- this.isDynamicMode = () => this.elementsCache.size > 0;
14520
- this.cancelScrollToIndex = () => {
14521
- if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
14522
- this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
14523
- this.scrollToIndexTimeoutId = null;
14524
- }
14525
- };
14526
- this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
14527
- this.cancelScrollToIndex();
14528
- if (behavior === "smooth" && this.isDynamicMode()) {
14529
- console.warn(
14530
- "The `smooth` scroll behavior is not fully supported with dynamic size."
14531
- );
14532
- }
14533
- this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
14534
- adjustments: void 0,
14535
- behavior
14536
- });
14537
- };
14538
- this.scrollToIndex = (index2, { align: initialAlign = "auto", behavior } = {}) => {
14539
- index2 = Math.max(0, Math.min(index2, this.options.count - 1));
14540
- this.cancelScrollToIndex();
14541
- if (behavior === "smooth" && this.isDynamicMode()) {
14542
- console.warn(
14543
- "The `smooth` scroll behavior is not fully supported with dynamic size."
14544
- );
14545
- }
14546
- const offsetAndAlign = this.getOffsetForIndex(index2, initialAlign);
14547
- if (!offsetAndAlign) return;
14548
- const [offset, align] = offsetAndAlign;
14549
- this._scrollToOffset(offset, { adjustments: void 0, behavior });
14550
- if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
14551
- this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
14552
- this.scrollToIndexTimeoutId = null;
14553
- const elementInDOM = this.elementsCache.has(
14554
- this.options.getItemKey(index2)
14555
- );
14556
- if (elementInDOM) {
14557
- const [latestOffset] = notUndefined(
14558
- this.getOffsetForIndex(index2, align)
14559
- );
14560
- if (!approxEqual(latestOffset, this.getScrollOffset())) {
14561
- this.scrollToIndex(index2, { align, behavior });
14562
- }
14563
- } else {
14564
- this.scrollToIndex(index2, { align, behavior });
14565
- }
14566
- });
14567
- }
14568
- };
14569
- this.scrollBy = (delta, { behavior } = {}) => {
14570
- this.cancelScrollToIndex();
14571
- if (behavior === "smooth" && this.isDynamicMode()) {
14572
- console.warn(
14573
- "The `smooth` scroll behavior is not fully supported with dynamic size."
14574
- );
14575
- }
14576
- this._scrollToOffset(this.getScrollOffset() + delta, {
14577
- adjustments: void 0,
14578
- behavior
14579
- });
14580
- };
14581
- this.getTotalSize = () => {
14582
- var _a2;
14583
- const measurements = this.getMeasurements();
14584
- let end;
14585
- if (measurements.length === 0) {
14586
- end = this.options.paddingStart;
14587
- } else {
14588
- end = this.options.lanes === 1 ? ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0 : Math.max(
14589
- ...measurements.slice(-this.options.lanes).map((m2) => m2.end)
14590
- );
14591
- }
14592
- return Math.max(
14593
- end - this.options.scrollMargin + this.options.paddingEnd,
14594
- 0
14595
- );
14596
- };
14597
- this._scrollToOffset = (offset, {
14598
- adjustments,
14599
- behavior
14600
- }) => {
14601
- this.options.scrollToFn(offset, { behavior, adjustments }, this);
14602
- };
14603
- this.measure = () => {
14604
- this.itemSizeCache = /* @__PURE__ */ new Map();
14605
- this.notify(false);
14606
- };
14607
- this.setOptions(opts);
14608
- }
14609
- }
14610
- const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
14611
- while (low <= high) {
14612
- const middle = (low + high) / 2 | 0;
14613
- const currentValue = getCurrentValue(middle);
14614
- if (currentValue < value) {
14615
- low = middle + 1;
14616
- } else if (currentValue > value) {
14617
- high = middle - 1;
14618
- } else {
14619
- return middle;
14620
- }
14621
- }
14622
- if (low > 0) {
14623
- return low - 1;
14624
- } else {
14625
- return 0;
14626
- }
14627
- };
14628
- function calculateRange({
14629
- measurements,
14630
- outerSize,
14631
- scrollOffset
14632
- }) {
14633
- const count = measurements.length - 1;
14634
- const getOffset2 = (index2) => measurements[index2].start;
14635
- const startIndex = findNearestBinarySearch(0, count, getOffset2, scrollOffset);
14636
- let endIndex = startIndex;
14637
- while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
14638
- endIndex++;
14639
- }
14640
- return { startIndex, endIndex };
14641
- }
14642
- const useIsomorphicLayoutEffect$4 = typeof document !== "undefined" ? React$4.useLayoutEffect : React$4.useEffect;
14643
- function useVirtualizerBase(options) {
14644
- const rerender = React$4.useReducer(() => ({}), {})[1];
14645
- const resolvedOptions = {
14646
- ...options,
14647
- onChange: (instance2, sync2) => {
14648
- var _a2;
14649
- if (sync2) {
14650
- flushSync$1(rerender);
14651
- } else {
14652
- rerender();
14653
- }
14654
- (_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync2);
14655
- }
14656
- };
14657
- const [instance] = React$4.useState(
14658
- () => new Virtualizer(resolvedOptions)
14659
- );
14660
- instance.setOptions(resolvedOptions);
14661
- React$4.useEffect(() => {
14662
- return instance._didMount();
14663
- }, []);
14664
- useIsomorphicLayoutEffect$4(() => {
14665
- return instance._willUpdate();
14666
- });
14667
- return instance;
14668
- }
14669
- function useVirtualizer(options) {
14670
- return useVirtualizerBase({
14671
- observeElementRect,
14672
- observeElementOffset,
14673
- scrollToFn: elementScroll,
14674
- ...options
14675
- });
14676
- }
14677
- const ListScrollWrapper = ({
14678
- items,
14679
- scrollDetails,
14680
- children
14681
- }) => {
14682
- const { hideScrollbar: hideScrollbar2, triggerScrollToActiveItem } = scrollDetails;
14683
- const listContainerRef = useRef(null);
14684
- const estimateItemHeight = () => {
14685
- let height2 = 37;
14686
- if (items.length > 0) {
14687
- const item2 = items[items.length - 1];
14688
- if (item2.details) height2 += 20;
14689
- if (item2.metadata) height2 += 20;
14690
- }
14691
- return height2;
14692
- };
14693
- const virtualizer = useVirtualizer({
14694
- count: items.length,
14695
- getScrollElement: () => listContainerRef.current,
14696
- estimateSize: useCallback(estimateItemHeight, []),
14697
- overscan: 5
14698
- });
14699
- const findFirstActiveItemIndex = (items2) => items2.findIndex((item2) => item2.active === true);
14700
- const setScrollToActiveItem = (activeItemIndex) => {
14701
- if (activeItemIndex >= 0) {
14702
- virtualizer.scrollToIndex(activeItemIndex, {
14703
- align: "center",
14704
- behavior: "smooth"
14705
- });
14706
- }
14707
- };
14708
- useEffect(() => {
14709
- if (triggerScrollToActiveItem) {
14710
- const activeItemIndex = findFirstActiveItemIndex(items);
14711
- setScrollToActiveItem(activeItemIndex);
14712
- }
14713
- }, [triggerScrollToActiveItem]);
14714
- return /* @__PURE__ */ jsx(
14715
- "div",
14716
- {
14717
- className: cx$2(
14718
- listStyles.listContent,
14719
- hideScrollbar2 ? listStyles.hideScrollbar : ""
14720
- ),
14721
- ref: listContainerRef,
14722
- children: /* @__PURE__ */ jsx(
14723
- "div",
14724
- {
14725
- className: listStyles.virtualRows,
14726
- style: { height: `${virtualizer.getTotalSize()}px` },
14727
- children: children({ virtualizer })
14728
- }
14729
- )
14730
- }
14731
- );
14732
- };
14733
14323
  const List = ({
14734
14324
  list: list2,
14735
14325
  bordered: bordered2 = false,
@@ -14748,22 +14338,83 @@ const List = ({
14748
14338
  height: height2,
14749
14339
  testId,
14750
14340
  scrollDetails = {
14341
+ scrollable: false,
14751
14342
  hideScrollbar: false,
14752
- triggerScrollToActiveItem: false
14343
+ triggerScrollToActiveItem: false,
14344
+ infiniteScroll: false,
14345
+ limit: 10,
14346
+ infiniteScrollTarget: void 0
14753
14347
  }
14754
14348
  }) => {
14755
- return /* @__PURE__ */ jsxs(
14349
+ const {
14350
+ scrollable,
14351
+ hideScrollbar: hideScrollbar2,
14352
+ triggerScrollToActiveItem,
14353
+ infiniteScroll,
14354
+ infiniteScrollTarget
14355
+ } = scrollDetails;
14356
+ const listHeadingRef = useRef(null);
14357
+ const listRowRefs = useRef([]);
14358
+ const listContainerRef = useRef(null);
14359
+ const MIN_ITEM_HEIGHT = 44;
14360
+ const pageSize = infiniteScroll ? Math.ceil(window.innerHeight / MIN_ITEM_HEIGHT) : list2.items.length;
14361
+ const [numVisibleRows, setNumVisibleRows] = useState(pageSize);
14362
+ const [hasMore, setHasMore] = useState(numVisibleRows < (list2 == null ? void 0 : list2.items.length));
14363
+ useEffect(() => {
14364
+ listRowRefs.current = listRowRefs.current.slice(0, list2.items.length);
14365
+ }, [list2.items.length]);
14366
+ const loadMoreItems = () => {
14367
+ if (numVisibleRows >= list2.items.length) {
14368
+ setHasMore(false);
14369
+ return;
14370
+ }
14371
+ const newVisibleRows = pageSize + numVisibleRows;
14372
+ setNumVisibleRows(newVisibleRows);
14373
+ };
14374
+ const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);
14375
+ const setScrollToActiveItem = (activeItemIndex) => {
14376
+ if (!listContainerRef.current || !listHeadingRef.current) return;
14377
+ const itemBorderLength = 1;
14378
+ if (triggerScrollToActiveItem && activeItemIndex >= 0) {
14379
+ const itemOffsets = listRowRefs.current.reduce((acc, val, index2) => {
14380
+ if (index2 < activeItemIndex) {
14381
+ return acc + val.clientHeight + itemBorderLength;
14382
+ }
14383
+ return acc;
14384
+ }, 0);
14385
+ const centerOffset = listContainerRef.current.clientHeight / 2 - listRowRefs.current[activeItemIndex].clientHeight / 2;
14386
+ const scrollOffset = itemOffsets - centerOffset;
14387
+ if (stickyHeader2) {
14388
+ const headingOffset2 = listHeadingRef.current.clientHeight / 2;
14389
+ listContainerRef.current.scrollTop = scrollOffset + headingOffset2;
14390
+ }
14391
+ const headingOffset = listHeadingRef.current.clientHeight;
14392
+ listContainerRef.current.scrollTop = scrollOffset + headingOffset;
14393
+ }
14394
+ };
14395
+ useEffect(() => {
14396
+ if (triggerScrollToActiveItem) {
14397
+ const activeItemIndex = findFirstActiveItemIndex(list2 == null ? void 0 : list2.items);
14398
+ setScrollToActiveItem(activeItemIndex);
14399
+ }
14400
+ }, [
14401
+ listContainerRef.current,
14402
+ listHeadingRef.current,
14403
+ triggerScrollToActiveItem
14404
+ ]);
14405
+ return /* @__PURE__ */ jsx(
14756
14406
  "div",
14757
14407
  {
14758
14408
  className: cx$2(
14759
- listStyles.list,
14760
14409
  narrow2 ? listStyles.narrow : "",
14761
- bordered2 ? listStyles.bordered : ""
14410
+ scrollable ? listStyles.scrollableList : "",
14411
+ hideScrollbar2 ? listStyles.hideScrollbar : ""
14762
14412
  ),
14763
14413
  "data-testid": testId,
14764
- style: { height: height2, marginBottom },
14765
14414
  id: "scrollableDiv",
14766
- children: [
14415
+ style: { height: height2, marginBottom },
14416
+ ref: listContainerRef,
14417
+ children: /* @__PURE__ */ jsxs(Card, { bordered: bordered2, padding: false, children: [
14767
14418
  !noHeader && /* @__PURE__ */ jsx(
14768
14419
  ListHeading,
14769
14420
  {
@@ -14771,106 +14422,53 @@ const List = ({
14771
14422
  actions: list2.actions,
14772
14423
  toggleNarrow: toggleNarrow2,
14773
14424
  onToggleNarrow,
14774
- stickyHeader: stickyHeader2
14425
+ stickyHeader: stickyHeader2,
14426
+ ref: listHeadingRef
14775
14427
  }
14776
14428
  ),
14777
- /* @__PURE__ */ jsx(
14429
+ /* @__PURE__ */ jsx("div", { className: cx$2(listStyles.list, bordered2 ? listStyles.bordered : ""), children: /* @__PURE__ */ jsx(
14778
14430
  ListDragWrapper,
14779
14431
  {
14780
14432
  draggable,
14781
14433
  list: list2,
14782
14434
  onListReorder,
14783
- children: /* @__PURE__ */ jsx(ListScrollWrapper, { items: list2.items, scrollDetails, children: ({ virtualizer }) => virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
14784
- "div",
14435
+ children: infiniteScroll ? /* @__PURE__ */ jsx(
14436
+ InfiniteScroll,
14785
14437
  {
14786
- "data-index": virtualRow2.index,
14787
- className: listStyles.virtualRow,
14788
- style: {
14789
- transform: `translateY(${virtualRow2.start}px)`
14790
- },
14791
- ref: virtualizer.measureElement,
14792
- children: /* @__PURE__ */ jsx(
14438
+ dataLength: numVisibleRows,
14439
+ next: loadMoreItems,
14440
+ hasMore,
14441
+ scrollableTarget: infiniteScrollTarget || "scrollableDiv",
14442
+ loader: /* @__PURE__ */ jsx(Loader, {}),
14443
+ className: listStyles.infiniteScrollContainer,
14444
+ children: list2.items.slice(0, numVisibleRows).map((item2, index2) => /* @__PURE__ */ jsx(
14793
14445
  ListRow,
14794
14446
  {
14795
- index: virtualRow2.index,
14447
+ index: index2,
14796
14448
  draggable,
14797
- item: list2.items[virtualRow2.index],
14449
+ item: item2,
14798
14450
  expanding,
14799
- invokeEditOnRowClick
14800
- }
14801
- )
14802
- },
14803
- virtualRow2.key
14804
- )) })
14805
- }
14806
- )
14807
- ]
14808
- }
14809
- );
14810
- };
14811
- const loader = "_loader_477i5_1";
14812
- const fullViewPortSize = "_fullViewPortSize_477i5_7";
14813
- const cover = "_cover_477i5_14";
14814
- const dimmer = "_dimmer_477i5_21";
14815
- const content$2 = "_content_477i5_44";
14816
- const text$1 = "_text_477i5_49";
14817
- const details$1 = "_details_477i5_53";
14818
- const styles$t = {
14819
- loader,
14820
- fullViewPortSize,
14821
- cover,
14822
- dimmer,
14823
- content: content$2,
14824
- text: text$1,
14825
- details: details$1
14826
- };
14827
- const Loader = ({
14828
- width: width2,
14829
- height: height2,
14830
- text: text2 = "",
14831
- details: details2 = "",
14832
- fullViewPortSize: fullViewPortSize2 = false,
14833
- cover: cover2 = false,
14834
- children = null,
14835
- theme = Theme.DARK,
14836
- testId = null
14837
- }) => {
14838
- const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14839
- const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14840
- return /* @__PURE__ */ jsx(
14841
- "div",
14842
- {
14843
- className: cx$2(styles$t.loader, cover2 ? styles$t.cover : "", {
14844
- [styles$t.fullViewPortSize]: fullViewPortSize2
14845
- }),
14846
- style: { width: width2, height: height2 },
14847
- "data-testid": testId,
14848
- children: /* @__PURE__ */ jsx("div", { className: styles$t.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14849
- "div",
14850
- {
14851
- className: styles$t.content,
14852
- "data-testid": testId && `${testId}-content`,
14853
- children: [
14854
- children,
14855
- text2 && /* @__PURE__ */ jsx(
14856
- "div",
14857
- {
14858
- className: styles$t.text,
14859
- "data-testid": testId && `${testId}-text`,
14860
- children: text2
14451
+ invokeEditOnRowClick,
14452
+ ref: listRowRefs
14453
+ },
14454
+ index2
14455
+ ))
14861
14456
  }
14862
- ),
14863
- details2 && /* @__PURE__ */ jsx(
14864
- "div",
14457
+ ) : list2.items.map((item2, index2) => /* @__PURE__ */ jsx(
14458
+ ListRow,
14865
14459
  {
14866
- className: styles$t.details,
14867
- "data-testid": testId && `${testId}-details`,
14868
- children: details2
14869
- }
14870
- )
14871
- ]
14872
- }
14873
- ) })
14460
+ index: index2,
14461
+ draggable,
14462
+ item: item2,
14463
+ expanding,
14464
+ invokeEditOnRowClick,
14465
+ ref: listRowRefs
14466
+ },
14467
+ index2
14468
+ ))
14469
+ }
14470
+ ) })
14471
+ ] })
14874
14472
  }
14875
14473
  );
14876
14474
  };
@@ -15644,7 +15242,7 @@ const useFontsReady = () => {
15644
15242
  const getWidth = () => window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
15645
15243
  const useWindowWidth = () => {
15646
15244
  const [width2, setWidth] = useState(getWidth());
15647
- const resizeListener = debounce$3(() => setWidth(getWidth()), 150);
15245
+ const resizeListener = debounce$2(() => setWidth(getWidth()), 150);
15648
15246
  useEffect(() => {
15649
15247
  window.addEventListener("resize", resizeListener);
15650
15248
  return () => {
@@ -48406,7 +48004,7 @@ const styles$d = {
48406
48004
  active: active$2,
48407
48005
  icon: icon$1
48408
48006
  };
48409
- const TooltipIcon = memo$1(
48007
+ const TooltipIcon = memo(
48410
48008
  ({ isOpen: isOpen2, label: label2, icon: icon2, invalid }) => {
48411
48009
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
48412
48010
  /* @__PURE__ */ jsx(
@@ -48481,7 +48079,7 @@ const Sections = ({
48481
48079
  )
48482
48080
  ] }, i)) });
48483
48081
  };
48484
- const SideBar = memo$1(
48082
+ const SideBar = memo(
48485
48083
  ({
48486
48084
  options,
48487
48085
  startOpen = false,
@@ -51107,19 +50705,19 @@ const Spacer = ({
51107
50705
  }
51108
50706
  }
51109
50707
  );
51110
- const inputInTable$2 = "_inputInTable_xkoxm_1";
51111
- const inputHover$2 = "_inputHover_xkoxm_13";
51112
- const inputFocus$2 = "_inputFocus_xkoxm_18";
51113
- const inputError$2 = "_inputError_xkoxm_25";
51114
- const inputWarning$2 = "_inputWarning_xkoxm_26";
51115
- const inputDisabled$2 = "_inputDisabled_xkoxm_61";
51116
- const hideScrollbars$2 = "_hideScrollbars_xkoxm_67";
51117
- const wrapper = "_wrapper_xkoxm_85";
51118
- const bordered = "_bordered_xkoxm_93";
51119
- const scroll = "_scroll_xkoxm_98";
51120
- const table = "_table_xkoxm_109";
51121
- const dragOverlay = "_dragOverlay_xkoxm_145";
51122
- const striped = "_striped_xkoxm_194";
50708
+ const inputInTable$2 = "_inputInTable_xzacf_1";
50709
+ const inputHover$2 = "_inputHover_xzacf_13";
50710
+ const inputFocus$2 = "_inputFocus_xzacf_18";
50711
+ const inputError$2 = "_inputError_xzacf_25";
50712
+ const inputWarning$2 = "_inputWarning_xzacf_26";
50713
+ const inputDisabled$2 = "_inputDisabled_xzacf_61";
50714
+ const hideScrollbars$2 = "_hideScrollbars_xzacf_67";
50715
+ const wrapper = "_wrapper_xzacf_85";
50716
+ const bordered = "_bordered_xzacf_93";
50717
+ const scroll = "_scroll_xzacf_98";
50718
+ const table = "_table_xzacf_108";
50719
+ const dragOverlay = "_dragOverlay_xzacf_145";
50720
+ const striped = "_striped_xzacf_194";
51123
50721
  const styles$b = {
51124
50722
  inputInTable: inputInTable$2,
51125
50723
  inputHover: inputHover$2,
@@ -51225,6 +50823,36 @@ const hasActions = (rows) => rows.reduce(
51225
50823
  const hasRowActions = (rows, headers) => {
51226
50824
  return hasActions(headers) > 0 || hasActions(rows) > 0;
51227
50825
  };
50826
+ const TableScrollWrapper = ({
50827
+ table: table2,
50828
+ children
50829
+ }) => {
50830
+ const { rows, infiniteScroll } = table2;
50831
+ const pageSize = Math.ceil(window.innerHeight / 30);
50832
+ const [visibleRows, setVisibleRows] = infiniteScroll ? useState(pageSize) : [rows.length, null];
50833
+ const [hasMore, setHasMore] = infiniteScroll ? useState(visibleRows < rows.length) : [false, null];
50834
+ const loadMoreItems = () => {
50835
+ if (visibleRows >= rows.length && setHasMore) {
50836
+ setHasMore(false);
50837
+ return;
50838
+ }
50839
+ if (setVisibleRows) {
50840
+ setVisibleRows(visibleRows + pageSize);
50841
+ }
50842
+ };
50843
+ return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, children: infiniteScroll ? /* @__PURE__ */ jsx(
50844
+ InfiniteScroll,
50845
+ {
50846
+ dataLength: Math.min(rows.length, visibleRows + pageSize),
50847
+ next: loadMoreItems,
50848
+ hasMore,
50849
+ scrollableTarget: "scrollWrapper",
50850
+ style: { overflow: "initial" },
50851
+ loader: null,
50852
+ children: children({ visibleRows })
50853
+ }
50854
+ ) : children({ visibleRows }) });
50855
+ };
51228
50856
  const clickableRow = "_clickableRow_10f34_1";
51229
50857
  const hoverableRow = "_hoverableRow_10f34_4";
51230
50858
  const rowActive = "_rowActive_10f34_4";
@@ -51938,7 +51566,6 @@ const Row = ({
51938
51566
  hasRowActions: hasRowActions2,
51939
51567
  draggableTable = false,
51940
51568
  columnWidths,
51941
- height: height2,
51942
51569
  testId
51943
51570
  //TODO: add testId
51944
51571
  }) => {
@@ -51995,8 +51622,7 @@ const Row = ({
51995
51622
  animateLayoutChanges: () => false
51996
51623
  });
51997
51624
  const style = {
51998
- height: height2,
51999
- transform: CSS.Transform.toString(transform),
51625
+ transform: CSS.Translate.toString(transform),
52000
51626
  transition,
52001
51627
  opacity: isDragging ? 0 : void 0
52002
51628
  };
@@ -52054,8 +51680,6 @@ const Row = ({
52054
51680
  ),
52055
51681
  "data-error": error2 || null,
52056
51682
  "data-warning": warning2 || null,
52057
- "data-index": rowIndex,
52058
- "data-even": rowIndex % 2 === 0,
52059
51683
  style,
52060
51684
  children: [
52061
51685
  draggableTable ? getDragItem() : null,
@@ -52147,36 +51771,6 @@ const TableDragWrapper = (props) => {
52147
51771
  }
52148
51772
  );
52149
51773
  };
52150
- const TableScrollWrapper = ({
52151
- table: table2,
52152
- theadRef,
52153
- children
52154
- }) => {
52155
- var _a2, _b;
52156
- const { infiniteScroll = false } = table2;
52157
- if (!infiniteScroll) {
52158
- return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, children: children({}) });
52159
- }
52160
- const containerRef = useRef(null);
52161
- const MIN_ITEM_HEIGHT = 31;
52162
- const virtualizer = useVirtualizer({
52163
- count: ((_a2 = table2.rows) == null ? void 0 : _a2.length) ?? 0,
52164
- getScrollElement: () => containerRef.current,
52165
- estimateSize: () => MIN_ITEM_HEIGHT,
52166
- overscan: 10
52167
- });
52168
- const theadHeight = ((_b = theadRef.current) == null ? void 0 : _b.clientHeight) ?? 0;
52169
- const totalHeight = virtualizer.getTotalSize() + theadHeight;
52170
- const items = virtualizer.getVirtualItems();
52171
- const paddingTop = items.length > 0 ? items[0].start : 0;
52172
- const paddingBottom = items.length > 0 ? virtualizer.getTotalSize() - items[items.length - 1].end : 0;
52173
- const tableStyle = {
52174
- "--virtualPaddingTop": paddingTop + "px",
52175
- "--virtualPaddingBottom": paddingBottom + "px",
52176
- height: totalHeight
52177
- };
52178
- return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$b.scroll, ref: containerRef, children: children({ virtualizer, tableStyle }) });
52179
- };
52180
51774
  const Table = (props) => {
52181
51775
  var _a2, _b, _c, _d, _e2, _f, _g;
52182
51776
  const { onListReorder = () => {
@@ -52199,7 +51793,6 @@ const Table = (props) => {
52199
51793
  maxHeight,
52200
51794
  fixedWidth: width2
52201
51795
  } = propTable;
52202
- const theadRef = useRef(null);
52203
51796
  const tbodyRef = useRef(null);
52204
51797
  const headers = get$2(props, "table.headers", []);
52205
51798
  const columnCount = getColumnCount(propRows, headers);
@@ -52261,7 +51854,7 @@ const Table = (props) => {
52261
51854
  testId: testId && `${testId}-title`
52262
51855
  }
52263
51856
  ),
52264
- /* @__PURE__ */ jsx(
51857
+ /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, children: ({ visibleRows }) => /* @__PURE__ */ jsx(
52265
51858
  TableDragWrapper,
52266
51859
  {
52267
51860
  colSpan,
@@ -52272,66 +51865,49 @@ const Table = (props) => {
52272
51865
  rowActions,
52273
51866
  rows,
52274
51867
  tbodyRef,
52275
- children: /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => {
52276
- return /* @__PURE__ */ jsxs(
52277
- "table",
52278
- {
52279
- className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
52280
- "data-testid": testId,
52281
- style: tableStyle,
52282
- children: [
52283
- /* @__PURE__ */ jsx("thead", { ref: theadRef, children: headers.map((row2, rowIndex) => {
52284
- return /* @__PURE__ */ jsx(
52285
- Row,
52286
- {
52287
- rowIndex,
52288
- isHeader: true,
52289
- row: row2,
52290
- columnCount,
52291
- columnWidths,
52292
- colSpan,
52293
- hasRowActions: rowActions,
52294
- columnAlignment,
52295
- columnHeaderAlignments,
52296
- draggableTable: draggable
52297
- },
52298
- `0_${rowIndex}`
52299
- );
52300
- }) }),
52301
- /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
52302
- Row,
52303
- {
52304
- rowIndex: virtualRow2.index,
52305
- row: rows[virtualRow2.index],
52306
- columnCount,
52307
- columnWidths,
52308
- colSpan,
52309
- hasRowActions: rowActions,
52310
- columnAlignment,
52311
- draggableTable: draggable,
52312
- height: virtualRow2.size
52313
- },
52314
- `1_${virtualRow2.index}`
52315
- )) : rows.map((row2, index2) => /* @__PURE__ */ jsx(
51868
+ children: /* @__PURE__ */ jsxs(
51869
+ "table",
51870
+ {
51871
+ className: cx$2(styles$b.table, striped2 ? styles$b.striped : ""),
51872
+ "data-testid": testId,
51873
+ children: [
51874
+ /* @__PURE__ */ jsx("thead", { children: headers.map((row2, rowIndex) => {
51875
+ return /* @__PURE__ */ jsx(
52316
51876
  Row,
52317
51877
  {
52318
- rowIndex: index2,
51878
+ rowIndex,
51879
+ isHeader: true,
52319
51880
  row: row2,
52320
51881
  columnCount,
52321
51882
  columnWidths,
52322
51883
  colSpan,
52323
51884
  hasRowActions: rowActions,
52324
51885
  columnAlignment,
51886
+ columnHeaderAlignments,
52325
51887
  draggableTable: draggable
52326
51888
  },
52327
- `1_${index2}`
52328
- )) })
52329
- ]
52330
- }
52331
- );
52332
- } })
51889
+ `0_${rowIndex}`
51890
+ );
51891
+ }) }),
51892
+ /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: rows.slice(0, visibleRows).map((row2, rowIndex) => /* @__PURE__ */ jsx(
51893
+ Row,
51894
+ {
51895
+ rowIndex,
51896
+ row: row2,
51897
+ columnCount,
51898
+ columnWidths,
51899
+ colSpan,
51900
+ hasRowActions: rowActions,
51901
+ columnAlignment,
51902
+ draggableTable: draggable
51903
+ },
51904
+ `1_${rowIndex}`
51905
+ )) })
51906
+ ]
51907
+ }
51908
+ )
52333
51909
  }
52334
- ),
51910
+ ) }),
52335
51911
  footer2 && /* @__PURE__ */ jsx(
52336
51912
  Footer,
52337
51913
  {
@@ -55444,7 +55020,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
55444
55020
  }
55445
55021
  let refCount = 0;
55446
55022
  const INSTANCE_SYM = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
55447
- var DndProvider = /* @__PURE__ */ memo$1(function DndProvider2(_param) {
55023
+ var DndProvider = /* @__PURE__ */ memo(function DndProvider2(_param) {
55448
55024
  var { children } = _param, props = _objectWithoutProperties(_param, [
55449
55025
  "children"
55450
55026
  ]);
@@ -57805,7 +57381,7 @@ function useFeatures(props, visualElement2, preloadedFeatures) {
57805
57381
  var name_1 = featureNames[i];
57806
57382
  var _a2 = featureDefinitions[name_1], isEnabled = _a2.isEnabled, Component2 = _a2.Component;
57807
57383
  if (isEnabled(props) && Component2) {
57808
- features.push(React$4.createElement(Component2, __assign$3({ key: name_1 }, props, { visualElement: visualElement2 })));
57384
+ features.push(React$4.createElement(Component2, __assign$4({ key: name_1 }, props, { visualElement: visualElement2 })));
57809
57385
  }
57810
57386
  }
57811
57387
  return features;
@@ -58046,7 +57622,7 @@ function useProjection(projectionId, _a2, visualElement2, ProjectionNodeConstruc
58046
57622
  var VisualElementHandler = (
58047
57623
  /** @class */
58048
57624
  function(_super) {
58049
- __extends(VisualElementHandler2, _super);
57625
+ __extends$1(VisualElementHandler2, _super);
58050
57626
  function VisualElementHandler2() {
58051
57627
  return _super !== null && _super.apply(this, arguments) || this;
58052
57628
  }
@@ -58072,20 +57648,20 @@ function createMotionComponent(_a2) {
58072
57648
  preloadedFeatures && loadFeatures(preloadedFeatures);
58073
57649
  function MotionComponent(props, externalRef) {
58074
57650
  var layoutId = useLayoutId(props);
58075
- props = __assign$3(__assign$3({}, props), { layoutId });
57651
+ props = __assign$4(__assign$4({}, props), { layoutId });
58076
57652
  var config = useContext(MotionConfigContext);
58077
57653
  var features = null;
58078
57654
  var context2 = useCreateMotionContext(props);
58079
57655
  var projectionId = config.isStatic ? void 0 : useProjectionId();
58080
57656
  var visualState = useVisualState(props, config.isStatic);
58081
57657
  if (!config.isStatic && isBrowser) {
58082
- context2.visualElement = useVisualElement(Component2, visualState, __assign$3(__assign$3({}, config), props), createVisualElement);
57658
+ context2.visualElement = useVisualElement(Component2, visualState, __assign$4(__assign$4({}, config), props), createVisualElement);
58083
57659
  useProjection(projectionId, props, context2.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
58084
57660
  features = useFeatures(props, context2.visualElement, preloadedFeatures);
58085
57661
  }
58086
57662
  return React$4.createElement(
58087
57663
  VisualElementHandler,
58088
- { visualElement: context2.visualElement, props: __assign$3(__assign$3({}, config), props) },
57664
+ { visualElement: context2.visualElement, props: __assign$4(__assign$4({}, config), props) },
58089
57665
  features,
58090
57666
  React$4.createElement(MotionContext.Provider, { value: context2 }, useRender(Component2, props, projectionId, useMotionRef(visualState, context2.visualElement, externalRef), visualState, config.isStatic, context2.visualElement))
58091
57667
  );
@@ -58411,7 +57987,7 @@ const filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v
58411
57987
  const functions = v2.match(functionRegex);
58412
57988
  return functions ? functions.map(applyDefaultFilter).join(" ") : v2;
58413
57989
  } });
58414
- var int = __assign$3(__assign$3({}, number), { transform: Math.round });
57990
+ var int = __assign$4(__assign$4({}, number), { transform: Math.round });
58415
57991
  var numberValueTypes = {
58416
57992
  // Border props
58417
57993
  borderWidth: px,
@@ -58541,7 +58117,7 @@ function useInitialMotionValues(_a2, visualState, isStatic) {
58541
58117
  var state = createHtmlRenderState();
58542
58118
  buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);
58543
58119
  var vars = state.vars, style = state.style;
58544
- return __assign$3(__assign$3({}, vars), style);
58120
+ return __assign$4(__assign$4({}, vars), style);
58545
58121
  }, [visualState]);
58546
58122
  }
58547
58123
  function useStyle(props, visualState, isStatic) {
@@ -58699,18 +58275,18 @@ function buildSVGAttrs(state, _a2, options, transformTemplate) {
58699
58275
  }
58700
58276
  }
58701
58277
  var createSvgRenderState = function() {
58702
- return __assign$3(__assign$3({}, createHtmlRenderState()), { attrs: {} });
58278
+ return __assign$4(__assign$4({}, createHtmlRenderState()), { attrs: {} });
58703
58279
  };
58704
58280
  function useSVGProps(props, visualState) {
58705
58281
  var visualProps = useMemo(function() {
58706
58282
  var state = createSvgRenderState();
58707
58283
  buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate);
58708
- return __assign$3(__assign$3({}, state.attrs), { style: __assign$3({}, state.style) });
58284
+ return __assign$4(__assign$4({}, state.attrs), { style: __assign$4({}, state.style) });
58709
58285
  }, [visualState]);
58710
58286
  if (props.style) {
58711
58287
  var rawStyles = {};
58712
58288
  copyRawValuesOnly(rawStyles, props.style, props);
58713
- visualProps.style = __assign$3(__assign$3({}, rawStyles), visualProps.style);
58289
+ visualProps.style = __assign$4(__assign$4({}, rawStyles), visualProps.style);
58714
58290
  }
58715
58291
  return visualProps;
58716
58292
  }
@@ -58723,7 +58299,7 @@ function createUseRender(forwardMotionProps) {
58723
58299
  var useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
58724
58300
  var visualProps = useVisualProps(props, latestValues, isStatic);
58725
58301
  var filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
58726
- var elementProps = __assign$3(__assign$3(__assign$3({}, filteredProps), visualProps), { ref });
58302
+ var elementProps = __assign$4(__assign$4(__assign$4({}, filteredProps), visualProps), { ref });
58727
58303
  if (projectionId) {
58728
58304
  elementProps["data-projection-id"] = projectionId;
58729
58305
  }
@@ -58900,7 +58476,7 @@ var htmlMotionConfig = {
58900
58476
  function createDomMotionConfig(Component2, _a2, preloadedFeatures, createVisualElement, projectionNodeConstructor) {
58901
58477
  var _b = _a2.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
58902
58478
  var baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
58903
- return __assign$3(__assign$3({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58479
+ return __assign$4(__assign$4({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58904
58480
  }
58905
58481
  var AnimationType;
58906
58482
  (function(AnimationType2) {
@@ -59987,7 +59563,7 @@ function initIntersectionObserver(_a2) {
59987
59563
  var rootObservers = observers.get(lookupRoot);
59988
59564
  var key2 = JSON.stringify(options);
59989
59565
  if (!rootObservers[key2]) {
59990
- rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$3({ root: root2 }, options));
59566
+ rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$4({ root: root2 }, options));
59991
59567
  }
59992
59568
  return rootObservers[key2];
59993
59569
  }
@@ -60205,9 +59781,9 @@ var getDefaultTransition = function(valueKey, to2) {
60205
59781
  } else {
60206
59782
  transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default;
60207
59783
  }
60208
- return __assign$3({ to: to2 }, transitionFactory(to2));
59784
+ return __assign$4({ to: to2 }, transitionFactory(to2));
60209
59785
  };
60210
- var defaultValueTypes = __assign$3(__assign$3({}, numberValueTypes), {
59786
+ var defaultValueTypes = __assign$4(__assign$4({}, numberValueTypes), {
60211
59787
  // Color props
60212
59788
  color,
60213
59789
  backgroundColor: color,
@@ -60249,7 +59825,7 @@ function isTransitionDefined(_a2) {
60249
59825
  var legacyRepeatWarning = false;
60250
59826
  function convertTransitionToAnimationOptions(_a2) {
60251
59827
  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"]);
60252
- var options = __assign$3({}, transition);
59828
+ var options = __assign$4({}, transition);
60253
59829
  if (times)
60254
59830
  options["offset"] = times;
60255
59831
  if (transition.duration)
@@ -60296,9 +59872,9 @@ function getPopmotionAnimationOptions(transition, options, key2) {
60296
59872
  }
60297
59873
  hydrateKeyframes(options);
60298
59874
  if (!isTransitionDefined(transition)) {
60299
- transition = __assign$3(__assign$3({}, transition), getDefaultTransition(key2, options.to));
59875
+ transition = __assign$4(__assign$4({}, transition), getDefaultTransition(key2, options.to));
60300
59876
  }
60301
- return __assign$3(__assign$3({}, options), convertTransitionToAnimationOptions(transition));
59877
+ return __assign$4(__assign$4({}, options), convertTransitionToAnimationOptions(transition));
60302
59878
  }
60303
59879
  function getAnimation(key2, value, target, transition, onComplete) {
60304
59880
  var _a2;
@@ -60324,7 +59900,7 @@ function getAnimation(key2, value, target, transition, onComplete) {
60324
59900
  return value.set(v2);
60325
59901
  }
60326
59902
  };
60327
- 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) {
59903
+ 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) {
60328
59904
  var _a3;
60329
59905
  options.onUpdate(v2);
60330
59906
  (_a3 = valueTransition.onUpdate) === null || _a3 === void 0 ? void 0 : _a3.call(valueTransition, v2);
@@ -60577,7 +60153,7 @@ function setTarget(visualElement2, definition) {
60577
60153
  var _a2 = resolved ? visualElement2.makeTargetAnimatable(resolved, false) : {}, _b = _a2.transitionEnd, transitionEnd = _b === void 0 ? {} : _b;
60578
60154
  _a2.transition;
60579
60155
  var target = __rest$1(_a2, ["transitionEnd", "transition"]);
60580
- target = __assign$3(__assign$3({}, target), transitionEnd);
60156
+ target = __assign$4(__assign$4({}, target), transitionEnd);
60581
60157
  for (var key2 in target) {
60582
60158
  var value = resolveFinalValueInKeyframes(target[key2]);
60583
60159
  setMotionValue(visualElement2, key2, value);
@@ -60695,9 +60271,9 @@ function animateTarget(visualElement2, definition, _a2) {
60695
60271
  if (!value || valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key2)) {
60696
60272
  continue;
60697
60273
  }
60698
- var valueTransition = __assign$3({ delay }, transition);
60274
+ var valueTransition = __assign$4({ delay }, transition);
60699
60275
  if (visualElement2.shouldReduceMotion && isTransformProp(key2)) {
60700
- valueTransition = __assign$3(__assign$3({}, valueTransition), { type: false, delay: 0 });
60276
+ valueTransition = __assign$4(__assign$4({}, valueTransition), { type: false, delay: 0 });
60701
60277
  }
60702
60278
  var animation = startAnimation(key2, value, valueTarget, valueTransition);
60703
60279
  animations2.push(animation);
@@ -60730,7 +60306,7 @@ function animateChildren(visualElement2, variant, delayChildren, staggerChildren
60730
60306
  return maxStaggerDuration - i * staggerChildren;
60731
60307
  };
60732
60308
  Array.from(visualElement2.variantChildren).sort(sortByTreeOrder).forEach(function(child, i) {
60733
- animations2.push(animateVariant(child, variant, __assign$3(__assign$3({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60309
+ animations2.push(animateVariant(child, variant, __assign$4(__assign$4({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60734
60310
  return child.notifyAnimationComplete(variant);
60735
60311
  }));
60736
60312
  });
@@ -60774,7 +60350,7 @@ function createAnimationState(visualElement2) {
60774
60350
  if (resolved) {
60775
60351
  resolved.transition;
60776
60352
  var transitionEnd = resolved.transitionEnd, target = __rest$1(resolved, ["transition", "transitionEnd"]);
60777
- acc = __assign$3(__assign$3(__assign$3({}, acc), target), transitionEnd);
60353
+ acc = __assign$4(__assign$4(__assign$4({}, acc), target), transitionEnd);
60778
60354
  }
60779
60355
  return acc;
60780
60356
  };
@@ -60804,7 +60380,7 @@ function createAnimationState(visualElement2) {
60804
60380
  if (isInherited && isInitialRender && visualElement2.manuallyAnimateOnMount) {
60805
60381
  isInherited = false;
60806
60382
  }
60807
- typeState.protectedKeys = __assign$3({}, encounteredKeys);
60383
+ typeState.protectedKeys = __assign$4({}, encounteredKeys);
60808
60384
  if (
60809
60385
  // If it isn't active and hasn't *just* been set as inactive
60810
60386
  !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
@@ -60822,7 +60398,7 @@ function createAnimationState(visualElement2) {
60822
60398
  if (activeDelta === false)
60823
60399
  resolvedValues = {};
60824
60400
  var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
60825
- var allKeys = __assign$3(__assign$3({}, prevResolvedValues), resolvedValues);
60401
+ var allKeys = __assign$4(__assign$4({}, prevResolvedValues), resolvedValues);
60826
60402
  var markToAnimate = function(key3) {
60827
60403
  shouldAnimateType = true;
60828
60404
  removedKeys.delete(key3);
@@ -60854,7 +60430,7 @@ function createAnimationState(visualElement2) {
60854
60430
  typeState.prevProp = prop;
60855
60431
  typeState.prevResolvedValues = resolvedValues;
60856
60432
  if (typeState.isActive) {
60857
- encounteredKeys = __assign$3(__assign$3({}, encounteredKeys), resolvedValues);
60433
+ encounteredKeys = __assign$4(__assign$4({}, encounteredKeys), resolvedValues);
60858
60434
  }
60859
60435
  if (isInitialRender && visualElement2.blockInitialAnimation) {
60860
60436
  shouldAnimateType = false;
@@ -60863,7 +60439,7 @@ function createAnimationState(visualElement2) {
60863
60439
  animations2.push.apply(animations2, __spreadArray$2([], __read(definitionList.map(function(animation) {
60864
60440
  return {
60865
60441
  animation,
60866
- options: __assign$3({ type }, options)
60442
+ options: __assign$4({ type }, options)
60867
60443
  };
60868
60444
  })), false));
60869
60445
  }
@@ -60871,7 +60447,7 @@ function createAnimationState(visualElement2) {
60871
60447
  for (var i = 0; i < numAnimationTypes; i++) {
60872
60448
  _loop_1(i);
60873
60449
  }
60874
- allAnimatedKeys = __assign$3({}, encounteredKeys);
60450
+ allAnimatedKeys = __assign$4({}, encounteredKeys);
60875
60451
  if (removedKeys.size) {
60876
60452
  var fallbackAnimation_1 = {};
60877
60453
  removedKeys.forEach(function(key2) {
@@ -60979,7 +60555,7 @@ var PanSession = (
60979
60555
  return;
60980
60556
  var point2 = info3.point;
60981
60557
  var timestamp2 = getFrameData().timestamp;
60982
- _this.history.push(__assign$3(__assign$3({}, point2), { timestamp: timestamp2 }));
60558
+ _this.history.push(__assign$4(__assign$4({}, point2), { timestamp: timestamp2 }));
60983
60559
  var _a3 = _this.handlers, onStart = _a3.onStart, onMove = _a3.onMove;
60984
60560
  if (!isPanStarted) {
60985
60561
  onStart && onStart(_this.lastMoveEvent, info3);
@@ -61013,7 +60589,7 @@ var PanSession = (
61013
60589
  var initialInfo = transformPoint(info2, this.transformPagePoint);
61014
60590
  var point = initialInfo.point;
61015
60591
  var timestamp = getFrameData().timestamp;
61016
- this.history = [__assign$3(__assign$3({}, point), { timestamp })];
60592
+ this.history = [__assign$4(__assign$4({}, point), { timestamp })];
61017
60593
  var onSessionStart = handlers2.onSessionStart;
61018
60594
  onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
61019
60595
  this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
@@ -61534,7 +61110,7 @@ var VisualElementDragControls = (
61534
61110
  transition = { min: 0, max: 0 };
61535
61111
  var bounceStiffness = dragElastic ? 200 : 1e6;
61536
61112
  var bounceDamping = dragElastic ? 40 : 1e7;
61537
- var inertia2 = __assign$3(__assign$3({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61113
+ var inertia2 = __assign$4(__assign$4({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61538
61114
  return _this.startAxisValueAnimation(axis, inertia2);
61539
61115
  });
61540
61116
  return Promise.all(momentumAnimations).then(onDragTransitionEnd);
@@ -61645,7 +61221,7 @@ var VisualElementDragControls = (
61645
61221
  VisualElementDragControls2.prototype.getProps = function() {
61646
61222
  var props = this.visualElement.getProps();
61647
61223
  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;
61648
- return __assign$3(__assign$3({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61224
+ return __assign$4(__assign$4({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61649
61225
  };
61650
61226
  return VisualElementDragControls2;
61651
61227
  }()
@@ -61802,7 +61378,7 @@ var visualElement = function(_a2) {
61802
61378
  var values2 = /* @__PURE__ */ new Map();
61803
61379
  var valueSubscriptions = /* @__PURE__ */ new Map();
61804
61380
  var prevMotionValues = {};
61805
- var baseTarget = __assign$3({}, latestValues);
61381
+ var baseTarget = __assign$4({}, latestValues);
61806
61382
  var removeFromVariantTree;
61807
61383
  function render2() {
61808
61384
  if (!instance || !isMounted)
@@ -61836,7 +61412,7 @@ var visualElement = function(_a2) {
61836
61412
  }
61837
61413
  var isControllingVariants = checkIfControllingVariants(props);
61838
61414
  var isVariantNode = checkIfVariantNode(props);
61839
- var element = __assign$3(__assign$3({
61415
+ var element = __assign$4(__assign$4({
61840
61416
  treeType,
61841
61417
  /**
61842
61418
  * This is a mirror of the internal instance prop, which keeps
@@ -62201,7 +61777,7 @@ function resolveCSSVariables(visualElement2, _a2, transitionEnd) {
62201
61777
  if (!(element instanceof Element))
62202
61778
  return { target, transitionEnd };
62203
61779
  if (transitionEnd) {
62204
- transitionEnd = __assign$3({}, transitionEnd);
61780
+ transitionEnd = __assign$4({}, transitionEnd);
62205
61781
  }
62206
61782
  visualElement2.forEachValue(function(value) {
62207
61783
  var current2 = value.get();
@@ -62356,8 +61932,8 @@ var checkAndConvertChangedValueTypes = function(visualElement2, target, origin,
62356
61932
  if (transitionEnd === void 0) {
62357
61933
  transitionEnd = {};
62358
61934
  }
62359
- target = __assign$3({}, target);
62360
- transitionEnd = __assign$3({}, transitionEnd);
61935
+ target = __assign$4({}, target);
61936
+ transitionEnd = __assign$4({}, transitionEnd);
62361
61937
  var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
62362
61938
  var removedTransformValues = [];
62363
61939
  var hasAttemptedToRemoveTransformValues = false;
@@ -62510,7 +62086,7 @@ var htmlConfig = {
62510
62086
  transitionEnd = parsed.transitionEnd;
62511
62087
  target = parsed.target;
62512
62088
  }
62513
- return __assign$3({ transition, transitionEnd }, target);
62089
+ return __assign$4({ transition, transitionEnd }, target);
62514
62090
  },
62515
62091
  scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1,
62516
62092
  build: function(element, renderState, latestValues, options, props) {
@@ -62522,7 +62098,7 @@ var htmlConfig = {
62522
62098
  render: renderHTML
62523
62099
  };
62524
62100
  var htmlVisualElement = visualElement(htmlConfig);
62525
- var svgVisualElement = visualElement(__assign$3(__assign$3({}, htmlConfig), { getBaseTarget: function(props, key2) {
62101
+ var svgVisualElement = visualElement(__assign$4(__assign$4({}, htmlConfig), { getBaseTarget: function(props, key2) {
62526
62102
  return props[key2];
62527
62103
  }, readValueFromInstance: function(domElement, key2) {
62528
62104
  var _a2;
@@ -62600,7 +62176,7 @@ var correctBoxShadow = {
62600
62176
  var MeasureLayoutWithContext = (
62601
62177
  /** @class */
62602
62178
  function(_super) {
62603
- __extends(MeasureLayoutWithContext2, _super);
62179
+ __extends$1(MeasureLayoutWithContext2, _super);
62604
62180
  function MeasureLayoutWithContext2() {
62605
62181
  return _super !== null && _super.apply(this, arguments) || this;
62606
62182
  }
@@ -62619,7 +62195,7 @@ var MeasureLayoutWithContext = (
62619
62195
  projection.addEventListener("animationComplete", function() {
62620
62196
  _this.safeToRemove();
62621
62197
  });
62622
- projection.setOptions(__assign$3(__assign$3({}, projection.options), { onExitComplete: function() {
62198
+ projection.setOptions(__assign$4(__assign$4({}, projection.options), { onExitComplete: function() {
62623
62199
  return _this.safeToRemove();
62624
62200
  } }));
62625
62201
  }
@@ -62684,10 +62260,10 @@ var MeasureLayoutWithContext = (
62684
62260
  function MeasureLayout(props) {
62685
62261
  var _a2 = __read(usePresence(), 2), isPresent = _a2[0], safeToRemove = _a2[1];
62686
62262
  var layoutGroup = useContext(LayoutGroupContext);
62687
- return React__default.createElement(MeasureLayoutWithContext, __assign$3({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62263
+ return React__default.createElement(MeasureLayoutWithContext, __assign$4({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62688
62264
  }
62689
62265
  var defaultScaleCorrectors = {
62690
- borderRadius: __assign$3(__assign$3({}, correctBorderRadius), { applyTo: [
62266
+ borderRadius: __assign$4(__assign$4({}, correctBorderRadius), { applyTo: [
62691
62267
  "borderTopLeftRadius",
62692
62268
  "borderTopRightRadius",
62693
62269
  "borderBottomLeftRadius",
@@ -63110,7 +62686,7 @@ function createProjectionNode(_a2) {
63110
62686
  _this.resumingFrom.resumingFrom = void 0;
63111
62687
  }
63112
62688
  _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
63113
- var animationOptions = __assign$3(__assign$3({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
62689
+ var animationOptions = __assign$4(__assign$4({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
63114
62690
  if (visualElement2.shouldReduceMotion) {
63115
62691
  animationOptions.delay = 0;
63116
62692
  animationOptions.type = false;
@@ -63364,7 +62940,7 @@ function createProjectionNode(_a2) {
63364
62940
  };
63365
62941
  ProjectionNode.prototype.setOptions = function(options) {
63366
62942
  var _a3;
63367
- this.options = __assign$3(__assign$3(__assign$3({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
62943
+ this.options = __assign$4(__assign$4(__assign$4({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
63368
62944
  };
63369
62945
  ProjectionNode.prototype.clearMeasurements = function() {
63370
62946
  this.scroll = void 0;
@@ -63482,7 +63058,7 @@ function createProjectionNode(_a2) {
63482
63058
  }
63483
63059
  var snapshot = this.snapshot;
63484
63060
  var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};
63485
- var mixedValues = __assign$3({}, this.latestValues);
63061
+ var mixedValues = __assign$4({}, this.latestValues);
63486
63062
  var targetDelta = createDelta();
63487
63063
  this.relativeTarget = this.relativeTargetOrigin = void 0;
63488
63064
  this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
@@ -63525,7 +63101,7 @@ function createProjectionNode(_a2) {
63525
63101
  }
63526
63102
  this.pendingAnimation = sync.update(function() {
63527
63103
  globalProjectionState.hasAnimatedSinceResize = true;
63528
- _this.currentAnimation = animate(0, animationTarget, __assign$3(__assign$3({}, options), { onUpdate: function(latest) {
63104
+ _this.currentAnimation = animate(0, animationTarget, __assign$4(__assign$4({}, options), { onUpdate: function(latest) {
63529
63105
  var _a4;
63530
63106
  _this.mixTargetDelta(latest);
63531
63107
  (_a4 = options.onUpdate) === null || _a4 === void 0 ? void 0 : _a4.call(options, latest);
@@ -63893,7 +63469,7 @@ var HTMLProjectionNode = createProjectionNode({
63893
63469
  return Boolean(window.getComputedStyle(instance).position === "fixed");
63894
63470
  }
63895
63471
  });
63896
- var featureBundle = __assign$3(__assign$3(__assign$3(__assign$3({}, animations), gestureAnimations), drag), layoutFeatures);
63472
+ var featureBundle = __assign$4(__assign$4(__assign$4(__assign$4({}, animations), gestureAnimations), drag), layoutFeatures);
63897
63473
  var motion = /* @__PURE__ */ createMotionProxy(function(Component2, config) {
63898
63474
  return createDomMotionConfig(Component2, config, featureBundle, createDomVisualElement, HTMLProjectionNode);
63899
63475
  });
@@ -66969,6 +66545,41 @@ const SmartUploadModal = ({
66969
66545
  }
66970
66546
  ) });
66971
66547
  };
66548
+ const SettingField = ({
66549
+ helpText,
66550
+ active: active2 = true,
66551
+ children,
66552
+ noPermission = false,
66553
+ selectedOption,
66554
+ handleSelectChange
66555
+ }) => {
66556
+ const options = [
66557
+ { label: "All users", value: "all_users" },
66558
+ { label: "Admin only", value: "superusers_admin" }
66559
+ ];
66560
+ return /* @__PURE__ */ jsxs("div", { children: [
66561
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
66562
+ children,
66563
+ !noPermission && /* @__PURE__ */ jsx(
66564
+ Select,
66565
+ {
66566
+ small: true,
66567
+ searchable: false,
66568
+ name: "userType",
66569
+ options,
66570
+ value: selectedOption,
66571
+ disabled: !active2,
66572
+ onChange: handleSelectChange ? (e2) => handleSelectChange(
66573
+ e2.target.value
66574
+ ) : void 0,
66575
+ "aria-label": "Select user type",
66576
+ width: "auto"
66577
+ }
66578
+ )
66579
+ ] }),
66580
+ /* @__PURE__ */ jsx(Text, { muted: true, children: helpText })
66581
+ ] });
66582
+ };
66972
66583
  export {
66973
66584
  Accordion,
66974
66585
  AccordionWithDefaultToggle,
@@ -67032,6 +66643,7 @@ export {
67032
66643
  RichTextInput,
67033
66644
  Row$1 as Row,
67034
66645
  Select,
66646
+ SettingField,
67035
66647
  SideBar,
67036
66648
  Slider,
67037
66649
  SmartUploadModal,