@oliasoft-open-source/react-ui-library 4.18.6 → 4.18.7-beta-1

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, Component as Component$1, memo, cloneElement as cloneElement$1, PureComponent, useImperativeHandle } from "react";
14
+ import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback, createElement, forwardRef, useMemo, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, memo as memo$1, cloneElement as cloneElement$1, PureComponent, useImperativeHandle } from "react";
15
15
  import * as PropTypes from "prop-types";
16
16
  import PropTypes__default from "prop-types";
17
- import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
18
- import { noop as noop$2, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$1, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isEqual as isEqual$3 } from "lodash";
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";
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$1 = function(d2, b2) {
226
- extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
225
+ var extendStatics = function(d2, b2) {
226
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
227
227
  d3.__proto__ = b3;
228
228
  } || function(d3, b3) {
229
229
  for (var p in b3) if (Object.prototype.hasOwnProperty.call(b3, p)) d3[p] = b3[p];
230
230
  };
231
- return extendStatics$1(d2, b2);
231
+ return extendStatics(d2, b2);
232
232
  };
233
- function __extends$1(d2, b2) {
233
+ function __extends(d2, b2) {
234
234
  if (typeof b2 !== "function" && b2 !== null)
235
235
  throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
236
- extendStatics$1(d2, b2);
236
+ extendStatics(d2, b2);
237
237
  function __() {
238
238
  this.constructor = d2;
239
239
  }
240
240
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
241
241
  }
242
- var __assign$4 = function() {
243
- __assign$4 = Object.assign || function __assign2(t) {
242
+ var __assign$3 = function() {
243
+ __assign$3 = Object.assign || function __assign2(t) {
244
244
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
245
245
  s = arguments[i];
246
246
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
247
247
  }
248
248
  return t;
249
249
  };
250
- return __assign$4.apply(this, arguments);
250
+ return __assign$3.apply(this, arguments);
251
251
  };
252
252
  function __rest$1(s, e2) {
253
253
  var t = {};
@@ -883,15 +883,15 @@ var DefaultContext = {
883
883
  attr: void 0
884
884
  };
885
885
  var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
886
- var __assign$3 = function() {
887
- __assign$3 = Object.assign || function(t) {
886
+ var __assign$2 = function() {
887
+ __assign$2 = Object.assign || function(t) {
888
888
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
889
889
  s = arguments[i];
890
890
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
891
891
  }
892
892
  return t;
893
893
  };
894
- return __assign$3.apply(this, arguments);
894
+ return __assign$2.apply(this, arguments);
895
895
  };
896
896
  var __rest = function(s, e2) {
897
897
  var t = {};
@@ -903,15 +903,15 @@ var __rest = function(s, e2) {
903
903
  };
904
904
  function Tree2Element(tree2) {
905
905
  return tree2 && tree2.map(function(node2, i) {
906
- return React__default.createElement(node2.tag, __assign$3({
906
+ return React__default.createElement(node2.tag, __assign$2({
907
907
  key: i
908
908
  }, node2.attr), Tree2Element(node2.child));
909
909
  });
910
910
  }
911
911
  function GenIcon(data) {
912
912
  return function(props) {
913
- return React__default.createElement(IconBase, __assign$3({
914
- attr: __assign$3({}, data.attr)
913
+ return React__default.createElement(IconBase, __assign$2({
914
+ attr: __assign$2({}, data.attr)
915
915
  }, props), Tree2Element(data.child));
916
916
  };
917
917
  }
@@ -922,13 +922,13 @@ function IconBase(props) {
922
922
  var className;
923
923
  if (conf.className) className = conf.className;
924
924
  if (props.className) className = (className ? className + " " : "") + props.className;
925
- return React__default.createElement("svg", __assign$3({
925
+ return React__default.createElement("svg", __assign$2({
926
926
  stroke: "currentColor",
927
927
  fill: "currentColor",
928
928
  strokeWidth: "0"
929
929
  }, conf.attr, attr, svgProps, {
930
930
  className,
931
- style: __assign$3(__assign$3({
931
+ style: __assign$2(__assign$2({
932
932
  color: props.color || conf.color
933
933
  }, conf.style), props.style),
934
934
  height: computedSize,
@@ -1808,7 +1808,7 @@ var requestAnimationFrame$1 = function() {
1808
1808
  };
1809
1809
  }();
1810
1810
  var trailingTimeout = 2;
1811
- function throttle$2(callback, delay) {
1811
+ function throttle$1(callback, delay) {
1812
1812
  var leadingCall = false, trailingCall = false, lastCallTime = 0;
1813
1813
  function resolvePending() {
1814
1814
  if (leadingCall) {
@@ -1850,7 +1850,7 @@ var ResizeObserverController$1 = (
1850
1850
  this.mutationsObserver_ = null;
1851
1851
  this.observers_ = [];
1852
1852
  this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1853
- this.refresh = throttle$2(this.refresh.bind(this), REFRESH_DELAY);
1853
+ this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
1854
1854
  }
1855
1855
  ResizeObserverController2.prototype.addObserver = function(observer) {
1856
1856
  if (!~this.observers_.indexOf(observer)) {
@@ -2354,7 +2354,7 @@ function useEventSubscriptions() {
2354
2354
  };
2355
2355
  }, []);
2356
2356
  }
2357
- var useIsomorphicLayoutEffect$5 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2357
+ var useIsomorphicLayoutEffect$6 = typeof window !== "undefined" ? useLayoutEffect$1 : useEffect;
2358
2358
  function useLastState(currentState, enabled) {
2359
2359
  var lastState = useRef(currentState);
2360
2360
  if (!enabled) {
@@ -2602,7 +2602,7 @@ function useTrackElements(_ref) {
2602
2602
  resetWhenReferenceChangedWhileTracking(previousTrigger, trigger2);
2603
2603
  }, [get3, set2, resetWhenReferenceChangedWhileTracking, getScrollContainers]));
2604
2604
  var triggerOptionParent = triggerOption == null ? void 0 : triggerOption.getParent == null ? void 0 : triggerOption.getParent();
2605
- useIsomorphicLayoutEffect$5(function() {
2605
+ useIsomorphicLayoutEffect$6(function() {
2606
2606
  if (!triggerOptionParent) {
2607
2607
  return;
2608
2608
  }
@@ -2612,7 +2612,7 @@ function useTrackElements(_ref) {
2612
2612
  });
2613
2613
  });
2614
2614
  }, [triggerOptionParent, set2, getScrollContainers]);
2615
- useIsomorphicLayoutEffect$5(function() {
2615
+ useIsomorphicLayoutEffect$6(function() {
2616
2616
  if (enabled) {
2617
2617
  if (!hasEventSubscriptions()) {
2618
2618
  addEventListeners();
@@ -2624,7 +2624,7 @@ function useTrackElements(_ref) {
2624
2624
  }
2625
2625
  };
2626
2626
  }, [enabled, hasEventSubscriptions, addEventListeners, removeAllEventSubscriptions]);
2627
- useIsomorphicLayoutEffect$5(function() {
2627
+ useIsomorphicLayoutEffect$6(function() {
2628
2628
  if (enabled) {
2629
2629
  handleChange();
2630
2630
  }
@@ -4188,34 +4188,34 @@ const styles$N = {
4188
4188
  actionComponentContainer,
4189
4189
  active: active$7
4190
4190
  };
4191
- const wrapper$4 = "_wrapper_8cxhw_1";
4192
- const layer$1 = "_layer_8cxhw_5";
4193
- const layerContainer$1 = "_layerContainer_8cxhw_8";
4194
- const nested = "_nested_8cxhw_24";
4195
- const fileInput$1 = "_fileInput_8cxhw_36";
4196
- const trigger$2 = "_trigger_8cxhw_41";
4197
- const middleAlignedInline = "_middleAlignedInline_8cxhw_50";
4198
- const heading$5 = "_heading_8cxhw_56";
4199
- const headingIcon = "_headingIcon_8cxhw_62";
4200
- const option$1 = "_option_8cxhw_74";
4201
- const active$6 = "_active_8cxhw_93";
4202
- const selected$1 = "_selected_8cxhw_98";
4203
- const optionContent$1 = "_optionContent_8cxhw_105";
4204
- const inline$4 = "_inline_8cxhw_109";
4205
- const icon$4 = "_icon_8cxhw_114";
4206
- const check$1 = "_check_8cxhw_115";
4207
- const text$3 = "_text_8cxhw_141";
4208
- const label$a = "_label_8cxhw_146";
4209
- const description = "_description_8cxhw_157";
4210
- const arrow$1 = "_arrow_8cxhw_161";
4211
- const divider$1 = "_divider_8cxhw_165";
4212
- const deprecatedSemanticIcon = "_deprecatedSemanticIcon_8cxhw_169";
4213
- const disabled$8 = "_disabled_8cxhw_173";
4214
- const buttonLabel = "_buttonLabel_8cxhw_178";
4215
- const buttonCaret = "_buttonCaret_8cxhw_184";
4216
- const component = "_component_8cxhw_188";
4217
- const right$7 = "_right_8cxhw_194";
4218
- const actions$1 = "_actions_8cxhw_199";
4191
+ const wrapper$4 = "_wrapper_nnkvb_1";
4192
+ const layer$1 = "_layer_nnkvb_5";
4193
+ const layerContainer$1 = "_layerContainer_nnkvb_8";
4194
+ const nested = "_nested_nnkvb_24";
4195
+ const fileInput$1 = "_fileInput_nnkvb_36";
4196
+ const trigger$2 = "_trigger_nnkvb_41";
4197
+ const middleAlignedInline = "_middleAlignedInline_nnkvb_50";
4198
+ const heading$5 = "_heading_nnkvb_56";
4199
+ const headingIcon = "_headingIcon_nnkvb_62";
4200
+ const option$1 = "_option_nnkvb_74";
4201
+ const disabled$8 = "_disabled_nnkvb_79";
4202
+ const active$6 = "_active_nnkvb_96";
4203
+ const selected$1 = "_selected_nnkvb_101";
4204
+ const optionContent$1 = "_optionContent_nnkvb_108";
4205
+ const inline$4 = "_inline_nnkvb_112";
4206
+ const icon$4 = "_icon_nnkvb_117";
4207
+ const check$1 = "_check_nnkvb_118";
4208
+ const text$3 = "_text_nnkvb_144";
4209
+ const label$a = "_label_nnkvb_149";
4210
+ const description = "_description_nnkvb_160";
4211
+ const arrow$1 = "_arrow_nnkvb_164";
4212
+ const divider$1 = "_divider_nnkvb_168";
4213
+ const deprecatedSemanticIcon = "_deprecatedSemanticIcon_nnkvb_172";
4214
+ const buttonLabel = "_buttonLabel_nnkvb_180";
4215
+ const buttonCaret = "_buttonCaret_nnkvb_186";
4216
+ const component = "_component_nnkvb_190";
4217
+ const right$7 = "_right_nnkvb_196";
4218
+ const actions$1 = "_actions_nnkvb_201";
4219
4219
  const styles$M = {
4220
4220
  wrapper: wrapper$4,
4221
4221
  layer: layer$1,
@@ -4227,6 +4227,7 @@ const styles$M = {
4227
4227
  heading: heading$5,
4228
4228
  headingIcon,
4229
4229
  option: option$1,
4230
+ disabled: disabled$8,
4230
4231
  active: active$6,
4231
4232
  selected: selected$1,
4232
4233
  optionContent: optionContent$1,
@@ -4239,7 +4240,6 @@ const styles$M = {
4239
4240
  arrow: arrow$1,
4240
4241
  divider: divider$1,
4241
4242
  deprecatedSemanticIcon,
4242
- disabled: disabled$8,
4243
4243
  buttonLabel,
4244
4244
  buttonCaret,
4245
4245
  component,
@@ -5307,15 +5307,15 @@ const Card = ({
5307
5307
  }
5308
5308
  );
5309
5309
  };
5310
- var __assign$2 = function() {
5311
- __assign$2 = Object.assign || function __assign2(t) {
5310
+ var __assign$1 = function() {
5311
+ __assign$1 = Object.assign || function __assign2(t) {
5312
5312
  for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
5313
5313
  s = arguments[i];
5314
5314
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5315
5315
  }
5316
5316
  return t;
5317
5317
  };
5318
- return __assign$2.apply(this, arguments);
5318
+ return __assign$1.apply(this, arguments);
5319
5319
  };
5320
5320
  function __spreadArray$1(to2, from3, pack) {
5321
5321
  if (pack || arguments.length === 2) for (var i = 0, l = from3.length, ar2; i < l; i++) {
@@ -6148,7 +6148,7 @@ var Ie = function(e2) {
6148
6148
  function e2(e3, n2, o) {
6149
6149
  void 0 === e3 && (e3 = C), void 0 === n2 && (n2 = {});
6150
6150
  var r2 = this;
6151
- 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() {
6151
+ 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
6152
  return function(e4) {
6153
6153
  for (var t = e4.getTag(), n3 = t.length, o2 = "", r3 = function(n4) {
6154
6154
  var r4 = function(e5) {
@@ -6171,7 +6171,7 @@ var Ie = function(e2) {
6171
6171
  }, e2.prototype.rehydrate = function() {
6172
6172
  !this.server && S && _e(this);
6173
6173
  }, e2.prototype.reconstructWithOptions = function(n2, o) {
6174
- return void 0 === o && (o = true), new e2(__assign$2(__assign$2({}, this.options), n2), this.gs, o && this.names || void 0);
6174
+ return void 0 === o && (o = true), new e2(__assign$1(__assign$1({}, this.options), n2), this.gs, o && this.names || void 0);
6175
6175
  }, e2.prototype.allocateGSInstance = function(e3) {
6176
6176
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
6177
6177
  }, e2.prototype.getTag = function() {
@@ -6344,9 +6344,9 @@ function it$1(e2, r2, s) {
6344
6344
  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;
6345
6345
  "production" !== process.env.NODE_ENV && useDebugValue(d3);
6346
6346
  var v2 = I(r4, f3, c3) || C, g3 = function(e5, n2, o) {
6347
- for (var r5, s3 = __assign$2(__assign$2({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6347
+ for (var r5, s3 = __assign$1(__assign$1({}, n2), { className: void 0, theme: o }), i3 = 0; i3 < e5.length; i3 += 1) {
6348
6348
  var a4 = re(r5 = e5[i3]) ? r5(s3) : r5;
6349
- 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];
6349
+ 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
6350
  }
6351
6351
  return n2.className && (s3.className = ie$2(s3.className, n2.className)), s3;
6352
6352
  }(i2, r4, v2), S3 = g3.as || h2, w3 = {};
@@ -6402,9 +6402,9 @@ function ut(n2, o, r2) {
6402
6402
  return n2(o, r2, lt$1.apply(void 0, __spreadArray$1([t], s2, false)));
6403
6403
  };
6404
6404
  return s.attrs = function(e2) {
6405
- return ut(n2, o, __assign$2(__assign$2({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6405
+ return ut(n2, o, __assign$1(__assign$1({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
6406
6406
  }, s.withConfig = function(e2) {
6407
- return ut(n2, o, __assign$2(__assign$2({}, r2), e2));
6407
+ return ut(n2, o, __assign$1(__assign$1({}, r2), e2));
6408
6408
  }, s;
6409
6409
  }
6410
6410
  var pt$1 = function(e2) {
@@ -9499,383 +9499,48 @@ const InputGroupAddon = ({
9499
9499
  })();
9500
9500
  return /* @__PURE__ */ jsx("span", { className: cx$2(styles$v.addon, order2, small2 ? styles$v.small : ""), children });
9501
9501
  };
9502
- /*! *****************************************************************************
9503
- Copyright (c) Microsoft Corporation. All rights reserved.
9504
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
9505
- this file except in compliance with the License. You may obtain a copy of the
9506
- License at http://www.apache.org/licenses/LICENSE-2.0
9507
-
9508
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9509
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9510
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
9511
- MERCHANTABLITY OR NON-INFRINGEMENT.
9512
-
9513
- See the Apache Version 2.0 License for specific language governing permissions
9514
- and limitations under the License.
9515
- ***************************************************************************** */
9516
- var extendStatics = function(d2, b2) {
9517
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
9518
- d3.__proto__ = b3;
9519
- } || function(d3, b3) {
9520
- for (var p in b3) if (b3.hasOwnProperty(p)) d3[p] = b3[p];
9521
- };
9522
- return extendStatics(d2, b2);
9523
- };
9524
- function __extends(d2, b2) {
9525
- extendStatics(d2, b2);
9526
- function __() {
9527
- this.constructor = d2;
9528
- }
9529
- d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
9530
- }
9531
- var __assign$1 = function() {
9532
- __assign$1 = Object.assign || function __assign2(t) {
9533
- for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
9534
- s = arguments[i];
9535
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9536
- }
9537
- return t;
9538
- };
9539
- return __assign$1.apply(this, arguments);
9540
- };
9541
- function throttle$1(delay, noTrailing, callback, debounceMode) {
9542
- var timeoutID;
9543
- var cancelled = false;
9544
- var lastExec = 0;
9545
- function clearExistingTimeout() {
9546
- if (timeoutID) {
9547
- clearTimeout(timeoutID);
9548
- }
9549
- }
9550
- function cancel() {
9551
- clearExistingTimeout();
9552
- cancelled = true;
9553
- }
9554
- if (typeof noTrailing !== "boolean") {
9555
- debounceMode = callback;
9556
- callback = noTrailing;
9557
- noTrailing = void 0;
9558
- }
9559
- function wrapper2() {
9560
- var self2 = this;
9561
- var elapsed = Date.now() - lastExec;
9562
- var args = arguments;
9563
- if (cancelled) {
9564
- return;
9565
- }
9566
- function exec() {
9567
- lastExec = Date.now();
9568
- callback.apply(self2, args);
9569
- }
9570
- function clear() {
9571
- timeoutID = void 0;
9572
- }
9573
- if (debounceMode && !timeoutID) {
9574
- exec();
9575
- }
9576
- clearExistingTimeout();
9577
- if (debounceMode === void 0 && elapsed > delay) {
9578
- exec();
9579
- } else if (noTrailing !== true) {
9580
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
9581
- }
9582
- }
9583
- wrapper2.cancel = cancel;
9584
- return wrapper2;
9585
- }
9586
- var ThresholdUnits = {
9587
- Pixel: "Pixel",
9588
- Percent: "Percent"
9589
- };
9590
- var defaultThreshold$1 = {
9591
- unit: ThresholdUnits.Percent,
9592
- value: 0.8
9593
- };
9594
- function parseThreshold(scrollThreshold) {
9595
- if (typeof scrollThreshold === "number") {
9596
- return {
9597
- unit: ThresholdUnits.Percent,
9598
- value: scrollThreshold * 100
9599
- };
9600
- }
9601
- if (typeof scrollThreshold === "string") {
9602
- if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
9603
- return {
9604
- unit: ThresholdUnits.Pixel,
9605
- value: parseFloat(scrollThreshold)
9606
- };
9607
- }
9608
- if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
9609
- return {
9610
- unit: ThresholdUnits.Percent,
9611
- value: parseFloat(scrollThreshold)
9612
- };
9613
- }
9614
- console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
9615
- return defaultThreshold$1;
9616
- }
9617
- console.warn("scrollThreshold should be string or number");
9618
- return defaultThreshold$1;
9619
- }
9620
- var InfiniteScroll = (
9621
- /** @class */
9622
- function(_super) {
9623
- __extends(InfiniteScroll2, _super);
9624
- function InfiniteScroll2(props) {
9625
- var _this = _super.call(this, props) || this;
9626
- _this.lastScrollTop = 0;
9627
- _this.actionTriggered = false;
9628
- _this.startY = 0;
9629
- _this.currentY = 0;
9630
- _this.dragging = false;
9631
- _this.maxPullDownDistance = 0;
9632
- _this.getScrollableTarget = function() {
9633
- if (_this.props.scrollableTarget instanceof HTMLElement)
9634
- return _this.props.scrollableTarget;
9635
- if (typeof _this.props.scrollableTarget === "string") {
9636
- return document.getElementById(_this.props.scrollableTarget);
9637
- }
9638
- if (_this.props.scrollableTarget === null) {
9639
- 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 ");
9640
- }
9641
- return null;
9642
- };
9643
- _this.onStart = function(evt) {
9644
- if (_this.lastScrollTop)
9645
- return;
9646
- _this.dragging = true;
9647
- if (evt instanceof MouseEvent) {
9648
- _this.startY = evt.pageY;
9649
- } else if (evt instanceof TouchEvent) {
9650
- _this.startY = evt.touches[0].pageY;
9651
- }
9652
- _this.currentY = _this.startY;
9653
- if (_this._infScroll) {
9654
- _this._infScroll.style.willChange = "transform";
9655
- _this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
9656
- }
9657
- };
9658
- _this.onMove = function(evt) {
9659
- if (!_this.dragging)
9660
- return;
9661
- if (evt instanceof MouseEvent) {
9662
- _this.currentY = evt.pageY;
9663
- } else if (evt instanceof TouchEvent) {
9664
- _this.currentY = evt.touches[0].pageY;
9665
- }
9666
- if (_this.currentY < _this.startY)
9667
- return;
9668
- if (_this.currentY - _this.startY >= Number(_this.props.pullDownToRefreshThreshold)) {
9669
- _this.setState({
9670
- pullToRefreshThresholdBreached: true
9671
- });
9672
- }
9673
- if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
9674
- return;
9675
- if (_this._infScroll) {
9676
- _this._infScroll.style.overflow = "visible";
9677
- _this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY - _this.startY) + "px, 0px)";
9678
- }
9679
- };
9680
- _this.onEnd = function() {
9681
- _this.startY = 0;
9682
- _this.currentY = 0;
9683
- _this.dragging = false;
9684
- if (_this.state.pullToRefreshThresholdBreached) {
9685
- _this.props.refreshFunction && _this.props.refreshFunction();
9686
- _this.setState({
9687
- pullToRefreshThresholdBreached: false
9688
- });
9689
- }
9690
- requestAnimationFrame(function() {
9691
- if (_this._infScroll) {
9692
- _this._infScroll.style.overflow = "auto";
9693
- _this._infScroll.style.transform = "none";
9694
- _this._infScroll.style.willChange = "unset";
9695
- }
9696
- });
9697
- };
9698
- _this.onScrollListener = function(event) {
9699
- if (typeof _this.props.onScroll === "function") {
9700
- setTimeout(function() {
9701
- return _this.props.onScroll && _this.props.onScroll(event);
9702
- }, 0);
9703
- }
9704
- var target = _this.props.height || _this._scrollableNode ? event.target : document.documentElement.scrollTop ? document.documentElement : document.body;
9705
- if (_this.actionTriggered)
9706
- return;
9707
- var atBottom = _this.props.inverse ? _this.isElementAtTop(target, _this.props.scrollThreshold) : _this.isElementAtBottom(target, _this.props.scrollThreshold);
9708
- if (atBottom && _this.props.hasMore) {
9709
- _this.actionTriggered = true;
9710
- _this.setState({ showLoader: true });
9711
- _this.props.next && _this.props.next();
9712
- }
9713
- _this.lastScrollTop = target.scrollTop;
9714
- };
9715
- _this.state = {
9716
- showLoader: false,
9717
- pullToRefreshThresholdBreached: false,
9718
- prevDataLength: props.dataLength
9719
- };
9720
- _this.throttledOnScrollListener = throttle$1(150, _this.onScrollListener).bind(_this);
9721
- _this.onStart = _this.onStart.bind(_this);
9722
- _this.onMove = _this.onMove.bind(_this);
9723
- _this.onEnd = _this.onEnd.bind(_this);
9724
- return _this;
9725
- }
9726
- InfiniteScroll2.prototype.componentDidMount = function() {
9727
- if (typeof this.props.dataLength === "undefined") {
9728
- throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');
9729
- }
9730
- this._scrollableNode = this.getScrollableTarget();
9731
- this.el = this.props.height ? this._infScroll : this._scrollableNode || window;
9732
- if (this.el) {
9733
- this.el.addEventListener("scroll", this.throttledOnScrollListener);
9734
- }
9735
- if (typeof this.props.initialScrollY === "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY) {
9736
- this.el.scrollTo(0, this.props.initialScrollY);
9737
- }
9738
- if (this.props.pullDownToRefresh && this.el) {
9739
- this.el.addEventListener("touchstart", this.onStart);
9740
- this.el.addEventListener("touchmove", this.onMove);
9741
- this.el.addEventListener("touchend", this.onEnd);
9742
- this.el.addEventListener("mousedown", this.onStart);
9743
- this.el.addEventListener("mousemove", this.onMove);
9744
- this.el.addEventListener("mouseup", this.onEnd);
9745
- this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0;
9746
- this.forceUpdate();
9747
- if (typeof this.props.refreshFunction !== "function") {
9748
- throw new Error(`Mandatory prop "refreshFunction" missing.
9749
- Pull Down To Refresh functionality will not work
9750
- as expected. Check README.md for usage'`);
9751
- }
9752
- }
9753
- };
9754
- InfiniteScroll2.prototype.componentWillUnmount = function() {
9755
- if (this.el) {
9756
- this.el.removeEventListener("scroll", this.throttledOnScrollListener);
9757
- if (this.props.pullDownToRefresh) {
9758
- this.el.removeEventListener("touchstart", this.onStart);
9759
- this.el.removeEventListener("touchmove", this.onMove);
9760
- this.el.removeEventListener("touchend", this.onEnd);
9761
- this.el.removeEventListener("mousedown", this.onStart);
9762
- this.el.removeEventListener("mousemove", this.onMove);
9763
- this.el.removeEventListener("mouseup", this.onEnd);
9764
- }
9765
- }
9766
- };
9767
- InfiniteScroll2.prototype.componentDidUpdate = function(prevProps) {
9768
- if (this.props.dataLength === prevProps.dataLength)
9769
- return;
9770
- this.actionTriggered = false;
9771
- this.setState({
9772
- showLoader: false
9773
- });
9774
- };
9775
- InfiniteScroll2.getDerivedStateFromProps = function(nextProps, prevState) {
9776
- var dataLengthChanged = nextProps.dataLength !== prevState.prevDataLength;
9777
- if (dataLengthChanged) {
9778
- return __assign$1(__assign$1({}, prevState), { prevDataLength: nextProps.dataLength });
9779
- }
9780
- return null;
9781
- };
9782
- InfiniteScroll2.prototype.isElementAtTop = function(target, scrollThreshold) {
9783
- if (scrollThreshold === void 0) {
9784
- scrollThreshold = 0.8;
9785
- }
9786
- var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9787
- var threshold = parseThreshold(scrollThreshold);
9788
- if (threshold.unit === ThresholdUnits.Pixel) {
9789
- return target.scrollTop <= threshold.value + clientHeight - target.scrollHeight + 1;
9790
- }
9791
- return target.scrollTop <= threshold.value / 100 + clientHeight - target.scrollHeight + 1;
9792
- };
9793
- InfiniteScroll2.prototype.isElementAtBottom = function(target, scrollThreshold) {
9794
- if (scrollThreshold === void 0) {
9795
- scrollThreshold = 0.8;
9796
- }
9797
- var clientHeight = target === document.body || target === document.documentElement ? window.screen.availHeight : target.clientHeight;
9798
- var threshold = parseThreshold(scrollThreshold);
9799
- if (threshold.unit === ThresholdUnits.Pixel) {
9800
- return target.scrollTop + clientHeight >= target.scrollHeight - threshold.value;
9801
- }
9802
- return target.scrollTop + clientHeight >= threshold.value / 100 * target.scrollHeight;
9803
- };
9804
- InfiniteScroll2.prototype.render = function() {
9805
- var _this = this;
9806
- var style = __assign$1({ height: this.props.height || "auto", overflow: "auto", WebkitOverflowScrolling: "touch" }, this.props.style);
9807
- var hasChildren2 = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length);
9808
- var outerDivStyle = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
9809
- return React__default.createElement(
9810
- "div",
9811
- { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
9812
- React__default.createElement(
9813
- "div",
9814
- { className: "infinite-scroll-component " + (this.props.className || ""), ref: function(infScroll) {
9815
- return _this._infScroll = infScroll;
9816
- }, style },
9817
- this.props.pullDownToRefresh && React__default.createElement(
9818
- "div",
9819
- { style: { position: "relative" }, ref: function(pullDown) {
9820
- return _this._pullDown = pullDown;
9821
- } },
9822
- React__default.createElement("div", { style: {
9823
- position: "absolute",
9824
- left: 0,
9825
- right: 0,
9826
- top: -1 * this.maxPullDownDistance
9827
- } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)
9828
- ),
9829
- this.props.children,
9830
- !this.state.showLoader && !hasChildren2 && this.props.hasMore && this.props.loader,
9831
- this.state.showLoader && this.props.hasMore && this.props.loader,
9832
- !this.props.hasMore && this.props.endMessage
9833
- )
9834
- );
9835
- };
9836
- return InfiniteScroll2;
9837
- }(Component$1)
9838
- );
9839
- const inputInTable$8 = "_inputInTable_7sjlf_1";
9840
- const inputHover$8 = "_inputHover_7sjlf_13";
9841
- const inputFocus$8 = "_inputFocus_7sjlf_18";
9842
- const inputError$8 = "_inputError_7sjlf_25";
9843
- const inputWarning$8 = "_inputWarning_7sjlf_26";
9844
- const inputDisabled$8 = "_inputDisabled_7sjlf_61";
9845
- const hideScrollbars$8 = "_hideScrollbars_7sjlf_67";
9846
- const header$1 = "_header_7sjlf_77";
9847
- const headerTitle = "_headerTitle_7sjlf_77";
9848
- const heading$3 = "_heading_7sjlf_78";
9849
- const itemHeader = "_itemHeader_7sjlf_78";
9850
- const narrow = "_narrow_7sjlf_81";
9851
- const stickyHeader = "_stickyHeader_7sjlf_85";
9852
- const title$3 = "_title_7sjlf_96";
9853
- const name = "_name_7sjlf_102";
9854
- const iconTooltipMargin = "_iconTooltipMargin_7sjlf_105";
9855
- const bold = "_bold_7sjlf_108";
9856
- const toggleNarrow = "_toggleNarrow_7sjlf_117";
9857
- const drag$1 = "_drag_7sjlf_135";
9858
- const dragOverlay$1 = "_dragOverlay_7sjlf_156";
9859
- const list$1 = "_list_7sjlf_161";
9860
- const bordered$1 = "_bordered_7sjlf_165";
9861
- const item$4 = "_item_7sjlf_78";
9862
- const action = "_action_7sjlf_198";
9863
- const active$3 = "_active_7sjlf_201";
9864
- const indented = "_indented_7sjlf_208";
9865
- const disabled$5 = "_disabled_7sjlf_221";
9866
- const label$6 = "_label_7sjlf_232";
9867
- const details$2 = "_details_7sjlf_243";
9868
- const metadata = "_metadata_7sjlf_244";
9869
- const itemContent = "_itemContent_7sjlf_252";
9870
- const indentIcon = "_indentIcon_7sjlf_259";
9871
- const expandIcon = "_expandIcon_7sjlf_264";
9872
- const expanded = "_expanded_7sjlf_271";
9873
- const right$4 = "_right_7sjlf_274";
9874
- const actions = "_actions_7sjlf_282";
9875
- const scrollableList = "_scrollableList_7sjlf_287";
9876
- const infiniteScrollContainer = "_infiniteScrollContainer_7sjlf_292";
9877
- const hideScrollbar = "_hideScrollbar_7sjlf_67";
9878
- const noPointerEvents = "_noPointerEvents_7sjlf_309";
9502
+ const inputInTable$8 = "_inputInTable_1wss1_1";
9503
+ const inputHover$8 = "_inputHover_1wss1_13";
9504
+ const inputFocus$8 = "_inputFocus_1wss1_18";
9505
+ const inputError$8 = "_inputError_1wss1_25";
9506
+ const inputWarning$8 = "_inputWarning_1wss1_26";
9507
+ const inputDisabled$8 = "_inputDisabled_1wss1_61";
9508
+ const hideScrollbars$8 = "_hideScrollbars_1wss1_67";
9509
+ const list$1 = "_list_1wss1_77";
9510
+ const bordered$1 = "_bordered_1wss1_83";
9511
+ const virtualRow = "_virtualRow_1wss1_87";
9512
+ const item$4 = "_item_1wss1_87";
9513
+ const header$1 = "_header_1wss1_90";
9514
+ const headerTitle = "_headerTitle_1wss1_90";
9515
+ const heading$3 = "_heading_1wss1_91";
9516
+ const itemHeader = "_itemHeader_1wss1_91";
9517
+ const narrow = "_narrow_1wss1_94";
9518
+ const stickyHeader = "_stickyHeader_1wss1_98";
9519
+ const title$3 = "_title_1wss1_109";
9520
+ const name = "_name_1wss1_115";
9521
+ const iconTooltipMargin = "_iconTooltipMargin_1wss1_119";
9522
+ const bold = "_bold_1wss1_122";
9523
+ const toggleNarrow = "_toggleNarrow_1wss1_133";
9524
+ const drag$1 = "_drag_1wss1_151";
9525
+ const dragOverlay$1 = "_dragOverlay_1wss1_172";
9526
+ const listContent = "_listContent_1wss1_177";
9527
+ const action = "_action_1wss1_202";
9528
+ const active$3 = "_active_1wss1_205";
9529
+ const indented = "_indented_1wss1_212";
9530
+ const disabled$5 = "_disabled_1wss1_225";
9531
+ const label$6 = "_label_1wss1_236";
9532
+ const details$2 = "_details_1wss1_247";
9533
+ const metadata = "_metadata_1wss1_248";
9534
+ const itemContent = "_itemContent_1wss1_256";
9535
+ const indentIcon = "_indentIcon_1wss1_263";
9536
+ const expandIcon = "_expandIcon_1wss1_268";
9537
+ const expanded = "_expanded_1wss1_275";
9538
+ const right$4 = "_right_1wss1_278";
9539
+ const actions = "_actions_1wss1_286";
9540
+ const scrollableList = "_scrollableList_1wss1_291";
9541
+ const hideScrollbar = "_hideScrollbar_1wss1_67";
9542
+ const noPointerEvents = "_noPointerEvents_1wss1_305";
9543
+ const virtualRows = "_virtualRows_1wss1_308";
9879
9544
  const listStyles = {
9880
9545
  inputInTable: inputInTable$8,
9881
9546
  inputHover: inputHover$8,
@@ -9884,6 +9549,10 @@ const listStyles = {
9884
9549
  inputWarning: inputWarning$8,
9885
9550
  inputDisabled: inputDisabled$8,
9886
9551
  hideScrollbars: hideScrollbars$8,
9552
+ list: list$1,
9553
+ bordered: bordered$1,
9554
+ virtualRow,
9555
+ item: item$4,
9887
9556
  header: header$1,
9888
9557
  headerTitle,
9889
9558
  heading: heading$3,
@@ -9897,9 +9566,7 @@ const listStyles = {
9897
9566
  toggleNarrow,
9898
9567
  drag: drag$1,
9899
9568
  dragOverlay: dragOverlay$1,
9900
- list: list$1,
9901
- bordered: bordered$1,
9902
- item: item$4,
9569
+ listContent,
9903
9570
  action,
9904
9571
  active: active$3,
9905
9572
  indented,
@@ -9914,9 +9581,9 @@ const listStyles = {
9914
9581
  right: right$4,
9915
9582
  actions,
9916
9583
  scrollableList,
9917
- infiniteScrollContainer,
9918
9584
  hideScrollbar,
9919
- noPointerEvents
9585
+ noPointerEvents,
9586
+ virtualRows
9920
9587
  };
9921
9588
  const ToggleNarrow = ({
9922
9589
  toggleNarrow: toggleNarrow2,
@@ -10020,10 +9687,10 @@ function getOwnerDocument(target) {
10020
9687
  }
10021
9688
  return document;
10022
9689
  }
10023
- const useIsomorphicLayoutEffect$4 = canUseDOM ? useLayoutEffect$1 : useEffect;
9690
+ const useIsomorphicLayoutEffect$5 = canUseDOM ? useLayoutEffect$1 : useEffect;
10024
9691
  function useEvent$1(handler) {
10025
9692
  const handlerRef = useRef(handler);
10026
- useIsomorphicLayoutEffect$4(() => {
9693
+ useIsomorphicLayoutEffect$5(() => {
10027
9694
  handlerRef.current = handler;
10028
9695
  });
10029
9696
  return useCallback(function() {
@@ -10051,7 +9718,7 @@ function useLatestValue(value, dependencies) {
10051
9718
  dependencies = [value];
10052
9719
  }
10053
9720
  const valueRef = useRef(value);
10054
- useIsomorphicLayoutEffect$4(() => {
9721
+ useIsomorphicLayoutEffect$5(() => {
10055
9722
  if (valueRef.current !== value) {
10056
9723
  valueRef.current = value;
10057
9724
  }
@@ -10141,9 +9808,9 @@ function isTouchEvent$2(event) {
10141
9808
  return false;
10142
9809
  }
10143
9810
  const {
10144
- TouchEvent: TouchEvent2
9811
+ TouchEvent
10145
9812
  } = getWindow(event.target);
10146
- return TouchEvent2 && event instanceof TouchEvent2;
9813
+ return TouchEvent && event instanceof TouchEvent;
10147
9814
  }
10148
9815
  function getEventCoordinates(event) {
10149
9816
  if (isTouchEvent$2(event)) {
@@ -11963,7 +11630,7 @@ function useRect(element, measure, fallbackRect) {
11963
11630
  const resizeObserver = useResizeObserver({
11964
11631
  callback: measureRect
11965
11632
  });
11966
- useIsomorphicLayoutEffect$4(() => {
11633
+ useIsomorphicLayoutEffect$5(() => {
11967
11634
  measureRect();
11968
11635
  if (element) {
11969
11636
  resizeObserver == null ? void 0 : resizeObserver.observe(element);
@@ -12146,7 +11813,7 @@ function useRects(elements, measure) {
12146
11813
  if (elements.length > 0 && rects === defaultValue$2) {
12147
11814
  measureRects();
12148
11815
  }
12149
- useIsomorphicLayoutEffect$4(() => {
11816
+ useIsomorphicLayoutEffect$5(() => {
12150
11817
  if (elements.length) {
12151
11818
  elements.forEach((element) => resizeObserver == null ? void 0 : resizeObserver.observe(element));
12152
11819
  } else {
@@ -12517,7 +12184,7 @@ function useLayoutShiftScrollCompensation(_ref) {
12517
12184
  x: config,
12518
12185
  y: config
12519
12186
  } : config;
12520
- useIsomorphicLayoutEffect$4(() => {
12187
+ useIsomorphicLayoutEffect$5(() => {
12521
12188
  const disabled2 = !x2 && !y2;
12522
12189
  if (disabled2 || !activeNode) {
12523
12190
  initialized.current = false;
@@ -12561,7 +12228,7 @@ var Status;
12561
12228
  Status2[Status2["Initializing"] = 1] = "Initializing";
12562
12229
  Status2[Status2["Initialized"] = 2] = "Initialized";
12563
12230
  })(Status || (Status = {}));
12564
- const DndContext$1 = /* @__PURE__ */ memo(function DndContext(_ref) {
12231
+ const DndContext$1 = /* @__PURE__ */ memo$1(function DndContext(_ref) {
12565
12232
  var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;
12566
12233
  let {
12567
12234
  id: id2,
@@ -12839,7 +12506,7 @@ const DndContext$1 = /* @__PURE__ */ memo(function DndContext(_ref) {
12839
12506
  }, [draggableNodes, instantiateSensor]);
12840
12507
  const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
12841
12508
  useSensorSetup(sensors);
12842
- useIsomorphicLayoutEffect$4(() => {
12509
+ useIsomorphicLayoutEffect$5(() => {
12843
12510
  if (activeNodeRect && status === Status.Initializing) {
12844
12511
  setStatus(Status.Initialized);
12845
12512
  }
@@ -12923,7 +12590,7 @@ const DndContext$1 = /* @__PURE__ */ memo(function DndContext(_ref) {
12923
12590
  // eslint-disable-next-line react-hooks/exhaustive-deps
12924
12591
  [overId]
12925
12592
  );
12926
- useIsomorphicLayoutEffect$4(() => {
12593
+ useIsomorphicLayoutEffect$5(() => {
12927
12594
  sensorContext.current = {
12928
12595
  activatorEvent,
12929
12596
  active: active2,
@@ -13050,7 +12717,7 @@ function useDraggable(_ref) {
13050
12717
  const [activatorNode, setActivatorNodeRef] = useNodeRef();
13051
12718
  const listeners = useSyntheticListeners(activators, id2);
13052
12719
  const dataRef = useLatestValue(data);
13053
- useIsomorphicLayoutEffect$4(
12720
+ useIsomorphicLayoutEffect$5(
13054
12721
  () => {
13055
12722
  draggableNodes.set(id2, {
13056
12723
  id: id2,
@@ -13170,7 +12837,7 @@ function useDroppable(_ref) {
13170
12837
  resizeObserverConnected.current = false;
13171
12838
  resizeObserver.observe(nodeRef.current);
13172
12839
  }, [nodeRef, resizeObserver]);
13173
- useIsomorphicLayoutEffect$4(
12840
+ useIsomorphicLayoutEffect$5(
13174
12841
  () => {
13175
12842
  dispatch({
13176
12843
  type: Action.RegisterDroppable,
@@ -13223,7 +12890,7 @@ function AnimationManager(_ref) {
13223
12890
  if (!children && !clonedChildren && previousChildren) {
13224
12891
  setClonedChildren(previousChildren);
13225
12892
  }
13226
- useIsomorphicLayoutEffect$4(() => {
12893
+ useIsomorphicLayoutEffect$5(() => {
13227
12894
  if (!element) {
13228
12895
  return;
13229
12896
  }
@@ -13723,7 +13390,7 @@ function SortableContext(_ref) {
13723
13390
  const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
13724
13391
  const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
13725
13392
  const disabled2 = normalizeDisabled(disabledProp);
13726
- useIsomorphicLayoutEffect$4(() => {
13393
+ useIsomorphicLayoutEffect$5(() => {
13727
13394
  if (itemsHaveChanged && isDragging) {
13728
13395
  measureDroppableContainers(items);
13729
13396
  }
@@ -13804,7 +13471,7 @@ function useDerivedTransform(_ref) {
13804
13471
  } = _ref;
13805
13472
  const [derivedTransform, setDerivedtransform] = useState(null);
13806
13473
  const previousIndex = useRef(index2);
13807
- useIsomorphicLayoutEffect$4(() => {
13474
+ useIsomorphicLayoutEffect$5(() => {
13808
13475
  if (!disabled2 && index2 !== previousIndex.current && node2.current) {
13809
13476
  const initial = rect.current;
13810
13477
  if (initial) {
@@ -14199,72 +13866,6 @@ const ListRow = forwardRef(
14199
13866
  return isSubheading ? /* @__PURE__ */ jsx(ListSubheading, { ref: listRowRefs, item: item2, index: index2 }, index2) : draggable ? listElementWithDrag(index2, item2) : listElement(index2, item2);
14200
13867
  }
14201
13868
  );
14202
- const loader = "_loader_477i5_1";
14203
- const fullViewPortSize = "_fullViewPortSize_477i5_7";
14204
- const cover = "_cover_477i5_14";
14205
- const dimmer = "_dimmer_477i5_21";
14206
- const content$2 = "_content_477i5_44";
14207
- const text$1 = "_text_477i5_49";
14208
- const details$1 = "_details_477i5_53";
14209
- const styles$u = {
14210
- loader,
14211
- fullViewPortSize,
14212
- cover,
14213
- dimmer,
14214
- content: content$2,
14215
- text: text$1,
14216
- details: details$1
14217
- };
14218
- const Loader = ({
14219
- width: width2,
14220
- height: height2,
14221
- text: text2 = "",
14222
- details: details2 = "",
14223
- fullViewPortSize: fullViewPortSize2 = false,
14224
- cover: cover2 = false,
14225
- children = null,
14226
- theme = Theme.DARK,
14227
- testId = null
14228
- }) => {
14229
- const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14230
- const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14231
- return /* @__PURE__ */ jsx(
14232
- "div",
14233
- {
14234
- className: cx$2(styles$u.loader, cover2 ? styles$u.cover : "", {
14235
- [styles$u.fullViewPortSize]: fullViewPortSize2
14236
- }),
14237
- style: { width: width2, height: height2 },
14238
- "data-testid": testId,
14239
- children: /* @__PURE__ */ jsx("div", { className: styles$u.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14240
- "div",
14241
- {
14242
- className: styles$u.content,
14243
- "data-testid": testId && `${testId}-content`,
14244
- children: [
14245
- children,
14246
- text2 && /* @__PURE__ */ jsx(
14247
- "div",
14248
- {
14249
- className: styles$u.text,
14250
- "data-testid": testId && `${testId}-text`,
14251
- children: text2
14252
- }
14253
- ),
14254
- details2 && /* @__PURE__ */ jsx(
14255
- "div",
14256
- {
14257
- className: styles$u.details,
14258
- "data-testid": testId && `${testId}-details`,
14259
- children: details2
14260
- }
14261
- )
14262
- ]
14263
- }
14264
- ) })
14265
- }
14266
- );
14267
- };
14268
13869
  const ListDragWrapper = ({
14269
13870
  children,
14270
13871
  draggable,
@@ -14272,22 +13873,18 @@ const ListDragWrapper = ({
14272
13873
  onListReorder
14273
13874
  }) => {
14274
13875
  const [dragIndex, setDragIndex] = useState(null);
14275
- if (!draggable) {
14276
- return children;
14277
- }
14278
13876
  const handleDragStart2 = (event) => {
14279
13877
  setDragIndex(event.active.id);
14280
13878
  };
14281
13879
  const handleDragEnd = (event) => {
14282
- var _a2, _b, _c, _d, _e2, _f, _g, _h;
14283
13880
  setDragIndex(null);
14284
13881
  const { active: active2, over } = event;
14285
- const from3 = (_b = (_a2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _a2.current) == null ? void 0 : _b.sortable.index;
14286
- const to2 = (_d = (_c = over == null ? void 0 : over.data) == null ? void 0 : _c.current) == null ? void 0 : _d.sortable.index;
14287
- if (from3 !== to2) {
13882
+ const from3 = active2 == null ? void 0 : active2.id;
13883
+ const to2 = over == null ? void 0 : over.id;
13884
+ if (to2 !== void 0 && from3 !== to2) {
14288
13885
  onListReorder({
14289
- from: (_f = (_e2 = active2 == null ? void 0 : active2.data) == null ? void 0 : _e2.current) == null ? void 0 : _f.sortable.index,
14290
- to: (_h = (_g = over == null ? void 0 : over.data) == null ? void 0 : _g.current) == null ? void 0 : _h.sortable.index
13886
+ from: Number(from3),
13887
+ to: Number(to2)
14291
13888
  });
14292
13889
  }
14293
13890
  };
@@ -14295,6 +13892,9 @@ const ListDragWrapper = ({
14295
13892
  () => list2.items.map((_2, index2) => index2.toString()),
14296
13893
  [list2.items]
14297
13894
  );
13895
+ if (!draggable) {
13896
+ return children;
13897
+ }
14298
13898
  return /* @__PURE__ */ jsxs(
14299
13899
  DndContext$1,
14300
13900
  {
@@ -14318,6 +13918,858 @@ const ListDragWrapper = ({
14318
13918
  }
14319
13919
  );
14320
13920
  };
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 + size2) {
14480
+ align = "end";
14481
+ }
14482
+ }
14483
+ if (align === "end") {
14484
+ toOffset -= size2;
14485
+ }
14486
+ const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
14487
+ const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
14488
+ const maxOffset = scrollSize - size2;
14489
+ return Math.max(Math.min(maxOffset, toOffset), 0);
14490
+ };
14491
+ this.getOffsetForIndex = (index2, align = "auto") => {
14492
+ index2 = Math.max(0, Math.min(index2, this.options.count - 1));
14493
+ const item2 = this.measurementsCache[index2];
14494
+ if (!item2) {
14495
+ return void 0;
14496
+ }
14497
+ const size2 = this.getSize();
14498
+ const scrollOffset = this.getScrollOffset();
14499
+ if (align === "auto") {
14500
+ if (item2.end >= scrollOffset + size2 - this.options.scrollPaddingEnd) {
14501
+ align = "end";
14502
+ } else if (item2.start <= scrollOffset + this.options.scrollPaddingStart) {
14503
+ align = "start";
14504
+ } else {
14505
+ return [scrollOffset, align];
14506
+ }
14507
+ }
14508
+ const centerOffset = item2.start - this.options.scrollPaddingStart + (item2.size - size2) / 2;
14509
+ switch (align) {
14510
+ case "center":
14511
+ return [this.getOffsetForAlignment(centerOffset, align), align];
14512
+ case "end":
14513
+ return [
14514
+ this.getOffsetForAlignment(
14515
+ item2.end + this.options.scrollPaddingEnd,
14516
+ align
14517
+ ),
14518
+ align
14519
+ ];
14520
+ default:
14521
+ return [
14522
+ this.getOffsetForAlignment(
14523
+ item2.start - this.options.scrollPaddingStart,
14524
+ align
14525
+ ),
14526
+ align
14527
+ ];
14528
+ }
14529
+ };
14530
+ this.isDynamicMode = () => this.elementsCache.size > 0;
14531
+ this.cancelScrollToIndex = () => {
14532
+ if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
14533
+ this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
14534
+ this.scrollToIndexTimeoutId = null;
14535
+ }
14536
+ };
14537
+ this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
14538
+ this.cancelScrollToIndex();
14539
+ if (behavior === "smooth" && this.isDynamicMode()) {
14540
+ console.warn(
14541
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
14542
+ );
14543
+ }
14544
+ this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
14545
+ adjustments: void 0,
14546
+ behavior
14547
+ });
14548
+ };
14549
+ this.scrollToIndex = (index2, { align: initialAlign = "auto", behavior } = {}) => {
14550
+ index2 = Math.max(0, Math.min(index2, this.options.count - 1));
14551
+ this.cancelScrollToIndex();
14552
+ if (behavior === "smooth" && this.isDynamicMode()) {
14553
+ console.warn(
14554
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
14555
+ );
14556
+ }
14557
+ const offsetAndAlign = this.getOffsetForIndex(index2, initialAlign);
14558
+ if (!offsetAndAlign) return;
14559
+ const [offset, align] = offsetAndAlign;
14560
+ this._scrollToOffset(offset, { adjustments: void 0, behavior });
14561
+ if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
14562
+ this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
14563
+ this.scrollToIndexTimeoutId = null;
14564
+ const elementInDOM = this.elementsCache.has(
14565
+ this.options.getItemKey(index2)
14566
+ );
14567
+ if (elementInDOM) {
14568
+ const [latestOffset] = notUndefined(
14569
+ this.getOffsetForIndex(index2, align)
14570
+ );
14571
+ if (!approxEqual(latestOffset, this.getScrollOffset())) {
14572
+ this.scrollToIndex(index2, { align, behavior });
14573
+ }
14574
+ } else {
14575
+ this.scrollToIndex(index2, { align, behavior });
14576
+ }
14577
+ });
14578
+ }
14579
+ };
14580
+ this.scrollBy = (delta, { behavior } = {}) => {
14581
+ this.cancelScrollToIndex();
14582
+ if (behavior === "smooth" && this.isDynamicMode()) {
14583
+ console.warn(
14584
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
14585
+ );
14586
+ }
14587
+ this._scrollToOffset(this.getScrollOffset() + delta, {
14588
+ adjustments: void 0,
14589
+ behavior
14590
+ });
14591
+ };
14592
+ this.getTotalSize = () => {
14593
+ var _a2;
14594
+ const measurements = this.getMeasurements();
14595
+ let end;
14596
+ if (measurements.length === 0) {
14597
+ end = this.options.paddingStart;
14598
+ } else {
14599
+ end = this.options.lanes === 1 ? ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0 : Math.max(
14600
+ ...measurements.slice(-this.options.lanes).map((m2) => m2.end)
14601
+ );
14602
+ }
14603
+ return Math.max(
14604
+ end - this.options.scrollMargin + this.options.paddingEnd,
14605
+ 0
14606
+ );
14607
+ };
14608
+ this._scrollToOffset = (offset, {
14609
+ adjustments,
14610
+ behavior
14611
+ }) => {
14612
+ this.options.scrollToFn(offset, { behavior, adjustments }, this);
14613
+ };
14614
+ this.measure = () => {
14615
+ this.itemSizeCache = /* @__PURE__ */ new Map();
14616
+ this.notify(false);
14617
+ };
14618
+ this.setOptions(opts);
14619
+ }
14620
+ }
14621
+ const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
14622
+ while (low <= high) {
14623
+ const middle = (low + high) / 2 | 0;
14624
+ const currentValue = getCurrentValue(middle);
14625
+ if (currentValue < value) {
14626
+ low = middle + 1;
14627
+ } else if (currentValue > value) {
14628
+ high = middle - 1;
14629
+ } else {
14630
+ return middle;
14631
+ }
14632
+ }
14633
+ if (low > 0) {
14634
+ return low - 1;
14635
+ } else {
14636
+ return 0;
14637
+ }
14638
+ };
14639
+ function calculateRange({
14640
+ measurements,
14641
+ outerSize,
14642
+ scrollOffset
14643
+ }) {
14644
+ const count = measurements.length - 1;
14645
+ const getOffset2 = (index2) => measurements[index2].start;
14646
+ const startIndex = findNearestBinarySearch(0, count, getOffset2, scrollOffset);
14647
+ let endIndex = startIndex;
14648
+ while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
14649
+ endIndex++;
14650
+ }
14651
+ return { startIndex, endIndex };
14652
+ }
14653
+ const useIsomorphicLayoutEffect$4 = typeof document !== "undefined" ? React$4.useLayoutEffect : React$4.useEffect;
14654
+ function useVirtualizerBase(options) {
14655
+ const rerender = React$4.useReducer(() => ({}), {})[1];
14656
+ const resolvedOptions = {
14657
+ ...options,
14658
+ onChange: (instance2, sync2) => {
14659
+ var _a2;
14660
+ if (sync2) {
14661
+ flushSync$1(rerender);
14662
+ } else {
14663
+ rerender();
14664
+ }
14665
+ (_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync2);
14666
+ }
14667
+ };
14668
+ const [instance] = React$4.useState(
14669
+ () => new Virtualizer(resolvedOptions)
14670
+ );
14671
+ instance.setOptions(resolvedOptions);
14672
+ useIsomorphicLayoutEffect$4(() => {
14673
+ return instance._didMount();
14674
+ }, []);
14675
+ useIsomorphicLayoutEffect$4(() => {
14676
+ return instance._willUpdate();
14677
+ });
14678
+ return instance;
14679
+ }
14680
+ function useVirtualizer(options) {
14681
+ return useVirtualizerBase({
14682
+ observeElementRect,
14683
+ observeElementOffset,
14684
+ scrollToFn: elementScroll,
14685
+ ...options
14686
+ });
14687
+ }
14688
+ const ListVirtualScrollWrapper = ({
14689
+ items,
14690
+ scrollDetails,
14691
+ children
14692
+ }) => {
14693
+ const {
14694
+ scrollable,
14695
+ hideScrollbar: hideScrollbar2,
14696
+ triggerScrollToActiveItem,
14697
+ infiniteScroll
14698
+ } = scrollDetails;
14699
+ const listContainerRef = useRef(null);
14700
+ const estimateItemHeight = () => {
14701
+ const LINE_HEIGHT = 20;
14702
+ const PADDING2 = 8;
14703
+ const BORDER_WIDTH = 1;
14704
+ let height2 = LINE_HEIGHT + PADDING2 * 2 + BORDER_WIDTH;
14705
+ if (items.length > 0) {
14706
+ const item2 = items[items.length - 1];
14707
+ if (item2.details) height2 += LINE_HEIGHT;
14708
+ if (item2.metadata) height2 += LINE_HEIGHT;
14709
+ }
14710
+ return height2;
14711
+ };
14712
+ const virtualizer = useVirtualizer({
14713
+ count: items.length,
14714
+ getScrollElement: () => listContainerRef.current,
14715
+ estimateSize: useCallback(estimateItemHeight, []),
14716
+ overscan: 5
14717
+ });
14718
+ const findFirstActiveItemIndex = (items2) => items2.findIndex((item2) => item2.active === true);
14719
+ const setScrollToActiveItem = (activeItemIndex) => {
14720
+ if (activeItemIndex >= 0) {
14721
+ virtualizer.scrollToIndex(activeItemIndex, {
14722
+ align: "center",
14723
+ behavior: "smooth"
14724
+ });
14725
+ }
14726
+ };
14727
+ useEffect(() => {
14728
+ if (triggerScrollToActiveItem) {
14729
+ const activeItemIndex = findFirstActiveItemIndex(items);
14730
+ setScrollToActiveItem(activeItemIndex);
14731
+ }
14732
+ }, [triggerScrollToActiveItem]);
14733
+ return /* @__PURE__ */ jsx(
14734
+ "div",
14735
+ {
14736
+ className: cx$2(
14737
+ listStyles.listContent,
14738
+ scrollable || infiniteScroll ? listStyles.scrollableList : "",
14739
+ hideScrollbar2 ? listStyles.hideScrollbar : ""
14740
+ ),
14741
+ ref: listContainerRef,
14742
+ children: /* @__PURE__ */ jsx(
14743
+ "div",
14744
+ {
14745
+ className: listStyles.virtualRows,
14746
+ style: {
14747
+ height: `${virtualizer.getTotalSize()}px`
14748
+ },
14749
+ children: children({ virtualizer })
14750
+ }
14751
+ )
14752
+ }
14753
+ );
14754
+ };
14755
+ const ListScrollWrapper = ({
14756
+ items,
14757
+ scrollDetails,
14758
+ children
14759
+ }) => {
14760
+ const { scrollable, hideScrollbar: hideScrollbar2, infiniteScroll } = scrollDetails;
14761
+ return infiniteScroll ? /* @__PURE__ */ jsx(ListVirtualScrollWrapper, { items, scrollDetails, children: ({ virtualizer }) => children({ virtualizer }) }) : /* @__PURE__ */ jsx(
14762
+ "div",
14763
+ {
14764
+ className: cx$2(
14765
+ listStyles.listContent,
14766
+ scrollable ? listStyles.scrollableList : "",
14767
+ hideScrollbar2 ? listStyles.hideScrollbar : ""
14768
+ ),
14769
+ children: /* @__PURE__ */ jsx("div", { className: listStyles.virtualRows, children: children({}) })
14770
+ }
14771
+ );
14772
+ };
14321
14773
  const List = ({
14322
14774
  list: list2,
14323
14775
  bordered: bordered2 = false,
@@ -14339,80 +14791,21 @@ const List = ({
14339
14791
  scrollable: false,
14340
14792
  hideScrollbar: false,
14341
14793
  triggerScrollToActiveItem: false,
14342
- infiniteScroll: false,
14343
- limit: 10,
14344
- infiniteScrollTarget: void 0
14794
+ infiniteScroll: false
14345
14795
  }
14346
14796
  }) => {
14347
- const {
14348
- scrollable,
14349
- hideScrollbar: hideScrollbar2,
14350
- triggerScrollToActiveItem,
14351
- infiniteScroll,
14352
- infiniteScrollTarget
14353
- } = scrollDetails;
14354
- const listHeadingRef = useRef(null);
14355
- const listRowRefs = useRef([]);
14356
- const listContainerRef = useRef(null);
14357
- const MIN_ITEM_HEIGHT = 44;
14358
- const pageSize = infiniteScroll ? Math.ceil(window.innerHeight / MIN_ITEM_HEIGHT) : list2.items.length;
14359
- const [numVisibleRows, setNumVisibleRows] = useState(pageSize);
14360
- const [hasMore, setHasMore] = useState(numVisibleRows < (list2 == null ? void 0 : list2.items.length));
14361
- useEffect(() => {
14362
- listRowRefs.current = listRowRefs.current.slice(0, list2.items.length);
14363
- }, [list2.items.length]);
14364
- const loadMoreItems = () => {
14365
- if (numVisibleRows >= list2.items.length) {
14366
- setHasMore(false);
14367
- return;
14368
- }
14369
- const newVisibleRows = pageSize + numVisibleRows;
14370
- setNumVisibleRows(newVisibleRows);
14371
- };
14372
- const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);
14373
- const setScrollToActiveItem = (activeItemIndex) => {
14374
- if (!listContainerRef.current || !listHeadingRef.current) return;
14375
- const itemBorderLength = 1;
14376
- if (triggerScrollToActiveItem && activeItemIndex >= 0) {
14377
- const itemOffsets = listRowRefs.current.reduce((acc, val, index2) => {
14378
- if (index2 < activeItemIndex) {
14379
- return acc + val.clientHeight + itemBorderLength;
14380
- }
14381
- return acc;
14382
- }, 0);
14383
- const centerOffset = listContainerRef.current.clientHeight / 2 - listRowRefs.current[activeItemIndex].clientHeight / 2;
14384
- const scrollOffset = itemOffsets - centerOffset;
14385
- if (stickyHeader2) {
14386
- const headingOffset2 = listHeadingRef.current.clientHeight / 2;
14387
- listContainerRef.current.scrollTop = scrollOffset + headingOffset2;
14388
- }
14389
- const headingOffset = listHeadingRef.current.clientHeight;
14390
- listContainerRef.current.scrollTop = scrollOffset + headingOffset;
14391
- }
14392
- };
14393
- useEffect(() => {
14394
- if (triggerScrollToActiveItem) {
14395
- const activeItemIndex = findFirstActiveItemIndex(list2 == null ? void 0 : list2.items);
14396
- setScrollToActiveItem(activeItemIndex);
14397
- }
14398
- }, [
14399
- listContainerRef.current,
14400
- listHeadingRef.current,
14401
- triggerScrollToActiveItem
14402
- ]);
14403
- return /* @__PURE__ */ jsx(
14797
+ return /* @__PURE__ */ jsxs(
14404
14798
  "div",
14405
14799
  {
14406
14800
  className: cx$2(
14801
+ listStyles.list,
14407
14802
  narrow2 ? listStyles.narrow : "",
14408
- scrollable ? listStyles.scrollableList : "",
14409
- hideScrollbar2 ? listStyles.hideScrollbar : ""
14803
+ bordered2 ? listStyles.bordered : ""
14410
14804
  ),
14411
14805
  "data-testid": testId,
14412
- id: "scrollableDiv",
14413
14806
  style: { height: height2, marginBottom },
14414
- ref: listContainerRef,
14415
- children: /* @__PURE__ */ jsxs(Card, { bordered: bordered2, padding: false, children: [
14807
+ id: "scrollableDiv",
14808
+ children: [
14416
14809
  !noHeader && /* @__PURE__ */ jsx(
14417
14810
  ListHeading,
14418
14811
  {
@@ -14420,53 +14813,115 @@ const List = ({
14420
14813
  actions: list2.actions,
14421
14814
  toggleNarrow: toggleNarrow2,
14422
14815
  onToggleNarrow,
14423
- stickyHeader: stickyHeader2,
14424
- ref: listHeadingRef
14816
+ stickyHeader: stickyHeader2
14425
14817
  }
14426
14818
  ),
14427
- /* @__PURE__ */ jsx("div", { className: cx$2(listStyles.list, bordered2 ? listStyles.bordered : ""), children: /* @__PURE__ */ jsx(
14819
+ /* @__PURE__ */ jsx(
14428
14820
  ListDragWrapper,
14429
14821
  {
14430
14822
  draggable,
14431
14823
  list: list2,
14432
14824
  onListReorder,
14433
- children: infiniteScroll ? /* @__PURE__ */ jsx(
14434
- InfiniteScroll,
14825
+ children: /* @__PURE__ */ jsx(ListScrollWrapper, { items: list2.items, scrollDetails, children: ({ virtualizer }) => virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
14826
+ "div",
14435
14827
  {
14436
- dataLength: numVisibleRows,
14437
- next: loadMoreItems,
14438
- hasMore,
14439
- scrollableTarget: infiniteScrollTarget || "scrollableDiv",
14440
- loader: /* @__PURE__ */ jsx(Loader, {}),
14441
- className: listStyles.infiniteScrollContainer,
14442
- children: list2.items.slice(0, numVisibleRows).map((item2, index2) => /* @__PURE__ */ jsx(
14828
+ "data-index": virtualRow2.index,
14829
+ className: listStyles.virtualRow,
14830
+ style: {
14831
+ transform: `translateY(${virtualRow2.start}px)`
14832
+ },
14833
+ ref: virtualizer.measureElement,
14834
+ children: /* @__PURE__ */ jsx(
14443
14835
  ListRow,
14444
14836
  {
14445
- index: index2,
14837
+ index: virtualRow2.index,
14446
14838
  draggable,
14447
- item: item2,
14839
+ item: list2.items[virtualRow2.index],
14448
14840
  expanding,
14449
- invokeEditOnRowClick,
14450
- ref: listRowRefs
14451
- },
14452
- index2
14453
- ))
14454
- }
14455
- ) : list2.items.map((item2, index2) => /* @__PURE__ */ jsx(
14841
+ invokeEditOnRowClick
14842
+ }
14843
+ )
14844
+ },
14845
+ virtualRow2.key
14846
+ )) : list2.items.map((row2, index2) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
14456
14847
  ListRow,
14457
14848
  {
14458
14849
  index: index2,
14459
14850
  draggable,
14460
- item: item2,
14851
+ item: row2,
14461
14852
  expanding,
14462
- invokeEditOnRowClick,
14463
- ref: listRowRefs
14464
- },
14465
- index2
14466
- ))
14853
+ invokeEditOnRowClick
14854
+ }
14855
+ ) }, index2)) })
14467
14856
  }
14468
- ) })
14469
- ] })
14857
+ )
14858
+ ]
14859
+ }
14860
+ );
14861
+ };
14862
+ const loader = "_loader_477i5_1";
14863
+ const fullViewPortSize = "_fullViewPortSize_477i5_7";
14864
+ const cover = "_cover_477i5_14";
14865
+ const dimmer = "_dimmer_477i5_21";
14866
+ const content$2 = "_content_477i5_44";
14867
+ const text$1 = "_text_477i5_49";
14868
+ const details$1 = "_details_477i5_53";
14869
+ const styles$u = {
14870
+ loader,
14871
+ fullViewPortSize,
14872
+ cover,
14873
+ dimmer,
14874
+ content: content$2,
14875
+ text: text$1,
14876
+ details: details$1
14877
+ };
14878
+ const Loader = ({
14879
+ width: width2,
14880
+ height: height2,
14881
+ text: text2 = "",
14882
+ details: details2 = "",
14883
+ fullViewPortSize: fullViewPortSize2 = false,
14884
+ cover: cover2 = false,
14885
+ children = null,
14886
+ theme = Theme.DARK,
14887
+ testId = null
14888
+ }) => {
14889
+ const color2 = theme === Theme.DARK ? Theme.WHITE : Theme.INHERIT;
14890
+ const background2 = theme === "white" ? "var(--color-background-raised)" : theme === "light" ? "var(--color-background)" : "black";
14891
+ return /* @__PURE__ */ jsx(
14892
+ "div",
14893
+ {
14894
+ className: cx$2(styles$u.loader, cover2 ? styles$u.cover : "", {
14895
+ [styles$u.fullViewPortSize]: fullViewPortSize2
14896
+ }),
14897
+ style: { width: width2, height: height2 },
14898
+ "data-testid": testId,
14899
+ children: /* @__PURE__ */ jsx("div", { className: styles$u.dimmer, style: { background: background2, color: color2 }, children: /* @__PURE__ */ jsxs(
14900
+ "div",
14901
+ {
14902
+ className: styles$u.content,
14903
+ "data-testid": testId && `${testId}-content`,
14904
+ children: [
14905
+ children,
14906
+ text2 && /* @__PURE__ */ jsx(
14907
+ "div",
14908
+ {
14909
+ className: styles$u.text,
14910
+ "data-testid": testId && `${testId}-text`,
14911
+ children: text2
14912
+ }
14913
+ ),
14914
+ details2 && /* @__PURE__ */ jsx(
14915
+ "div",
14916
+ {
14917
+ className: styles$u.details,
14918
+ "data-testid": testId && `${testId}-details`,
14919
+ children: details2
14920
+ }
14921
+ )
14922
+ ]
14923
+ }
14924
+ ) })
14470
14925
  }
14471
14926
  );
14472
14927
  };
@@ -15239,7 +15694,7 @@ const useFontsReady = () => {
15239
15694
  const getWidth = () => window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
15240
15695
  const useWindowWidth = () => {
15241
15696
  const [width2, setWidth] = useState(getWidth());
15242
- const resizeListener = debounce$2(() => setWidth(getWidth()), 150);
15697
+ const resizeListener = debounce$3(() => setWidth(getWidth()), 150);
15243
15698
  useEffect(() => {
15244
15699
  window.addEventListener("resize", resizeListener);
15245
15700
  return () => {
@@ -48000,7 +48455,7 @@ const styles$e = {
48000
48455
  active: active$2,
48001
48456
  icon: icon$1
48002
48457
  };
48003
- const TooltipIcon = memo(
48458
+ const TooltipIcon = memo$1(
48004
48459
  ({ isOpen: isOpen2, label: label2, icon: icon2, invalid }) => {
48005
48460
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
48006
48461
  /* @__PURE__ */ jsx(
@@ -48075,7 +48530,7 @@ const Sections = ({
48075
48530
  )
48076
48531
  ] }, i)) });
48077
48532
  };
48078
- const SideBar = memo(
48533
+ const SideBar = memo$1(
48079
48534
  ({
48080
48535
  options,
48081
48536
  startOpen = false,
@@ -50701,19 +51156,19 @@ const Spacer = ({
50701
51156
  }
50702
51157
  }
50703
51158
  );
50704
- const inputInTable$2 = "_inputInTable_xzacf_1";
50705
- const inputHover$2 = "_inputHover_xzacf_13";
50706
- const inputFocus$2 = "_inputFocus_xzacf_18";
50707
- const inputError$2 = "_inputError_xzacf_25";
50708
- const inputWarning$2 = "_inputWarning_xzacf_26";
50709
- const inputDisabled$2 = "_inputDisabled_xzacf_61";
50710
- const hideScrollbars$2 = "_hideScrollbars_xzacf_67";
50711
- const wrapper = "_wrapper_xzacf_85";
50712
- const bordered = "_bordered_xzacf_93";
50713
- const scroll = "_scroll_xzacf_98";
50714
- const table = "_table_xzacf_108";
50715
- const dragOverlay = "_dragOverlay_xzacf_145";
50716
- const striped = "_striped_xzacf_194";
51159
+ const inputInTable$2 = "_inputInTable_xkoxm_1";
51160
+ const inputHover$2 = "_inputHover_xkoxm_13";
51161
+ const inputFocus$2 = "_inputFocus_xkoxm_18";
51162
+ const inputError$2 = "_inputError_xkoxm_25";
51163
+ const inputWarning$2 = "_inputWarning_xkoxm_26";
51164
+ const inputDisabled$2 = "_inputDisabled_xkoxm_61";
51165
+ const hideScrollbars$2 = "_hideScrollbars_xkoxm_67";
51166
+ const wrapper = "_wrapper_xkoxm_85";
51167
+ const bordered = "_bordered_xkoxm_93";
51168
+ const scroll = "_scroll_xkoxm_98";
51169
+ const table = "_table_xkoxm_109";
51170
+ const dragOverlay = "_dragOverlay_xkoxm_145";
51171
+ const striped = "_striped_xkoxm_194";
50717
51172
  const styles$c = {
50718
51173
  inputInTable: inputInTable$2,
50719
51174
  inputHover: inputHover$2,
@@ -50819,43 +51274,14 @@ const hasActions = (rows) => rows.reduce(
50819
51274
  const hasRowActions = (rows, headers) => {
50820
51275
  return hasActions(headers) > 0 || hasActions(rows) > 0;
50821
51276
  };
50822
- const TableScrollWrapper = ({
50823
- table: table2,
50824
- children
50825
- }) => {
50826
- const { rows, infiniteScroll } = table2;
50827
- const pageSize = Math.ceil(window.innerHeight / 30);
50828
- const [visibleRows, setVisibleRows] = infiniteScroll ? useState(pageSize) : [rows.length, null];
50829
- const [hasMore, setHasMore] = infiniteScroll ? useState(visibleRows < rows.length) : [false, null];
50830
- const loadMoreItems = () => {
50831
- if (visibleRows >= rows.length && setHasMore) {
50832
- setHasMore(false);
50833
- return;
50834
- }
50835
- if (setVisibleRows) {
50836
- setVisibleRows(visibleRows + pageSize);
50837
- }
50838
- };
50839
- return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$c.scroll, children: infiniteScroll ? /* @__PURE__ */ jsx(
50840
- InfiniteScroll,
50841
- {
50842
- dataLength: Math.min(rows.length, visibleRows + pageSize),
50843
- next: loadMoreItems,
50844
- hasMore,
50845
- scrollableTarget: "scrollWrapper",
50846
- style: { overflow: "initial" },
50847
- loader: null,
50848
- children: children({ visibleRows })
50849
- }
50850
- ) : children({ visibleRows }) });
50851
- };
50852
- const clickableRow = "_clickableRow_10f34_1";
50853
- const hoverableRow = "_hoverableRow_10f34_4";
50854
- const rowActive = "_rowActive_10f34_4";
50855
- const expandableRow = "_expandableRow_10f34_8";
50856
- const flush = "_flush_10f34_8";
50857
- const dragIconCell = "_dragIconCell_10f34_34";
50858
- const dragIcon = "_dragIcon_10f34_34";
51277
+ const clickableRow = "_clickableRow_kqvtd_1";
51278
+ const hoverableRow = "_hoverableRow_kqvtd_4";
51279
+ const rowActive = "_rowActive_kqvtd_4";
51280
+ const expandableRow = "_expandableRow_kqvtd_8";
51281
+ const flush = "_flush_kqvtd_8";
51282
+ const dragIconCell = "_dragIconCell_kqvtd_34";
51283
+ const dragIcon = "_dragIcon_kqvtd_34";
51284
+ const dragIconDisabled = "_dragIconDisabled_kqvtd_55";
50859
51285
  const styles$9 = {
50860
51286
  clickableRow,
50861
51287
  hoverableRow,
@@ -50863,7 +51289,8 @@ const styles$9 = {
50863
51289
  expandableRow,
50864
51290
  flush,
50865
51291
  dragIconCell,
50866
- dragIcon
51292
+ dragIcon,
51293
+ dragIconDisabled
50867
51294
  };
50868
51295
  const ExpandedContentRow = ({
50869
51296
  colSpan,
@@ -51560,6 +51987,8 @@ const Row = ({
51560
51987
  hasRowActions: hasRowActions2,
51561
51988
  draggableTable = false,
51562
51989
  columnWidths,
51990
+ dropDisabled = false,
51991
+ height: height2,
51563
51992
  testId
51564
51993
  //TODO: add testId
51565
51994
  }) => {
@@ -51616,7 +52045,8 @@ const Row = ({
51616
52045
  animateLayoutChanges: () => false
51617
52046
  });
51618
52047
  const style = {
51619
- transform: CSS.Translate.toString(transform),
52048
+ transform: !dropDisabled ? CSS.Translate.toString(transform) : void 0,
52049
+ height: height2,
51620
52050
  transition,
51621
52051
  opacity: isDragging ? 0 : void 0
51622
52052
  };
@@ -51624,7 +52054,18 @@ const Row = ({
51624
52054
  if (row2.noDrag) {
51625
52055
  return /* @__PURE__ */ jsx("td", { "aria-labelledby": "unique-label-id" });
51626
52056
  }
51627
- return /* @__PURE__ */ jsx("td", { className: styles$9.dragIconCell, children: /* @__PURE__ */ jsx("div", { className: styles$9.dragIcon, ...attributes, ...listeners, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG }) }) });
52057
+ return /* @__PURE__ */ jsx("td", { className: styles$9.dragIconCell, children: /* @__PURE__ */ jsx(
52058
+ "div",
52059
+ {
52060
+ className: cx$2(
52061
+ styles$9.dragIcon,
52062
+ dropDisabled ? styles$9.dragIconDisabled : ""
52063
+ ),
52064
+ ...attributes,
52065
+ ...listeners,
52066
+ children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
52067
+ }
52068
+ ) });
51628
52069
  };
51629
52070
  return isHeader ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
51630
52071
  /* @__PURE__ */ jsxs(
@@ -51674,6 +52115,8 @@ const Row = ({
51674
52115
  ),
51675
52116
  "data-error": error2 || null,
51676
52117
  "data-warning": warning2 || null,
52118
+ "data-index": rowIndex,
52119
+ "data-even": rowIndex % 2 === 0,
51677
52120
  style,
51678
52121
  children: [
51679
52122
  draggableTable ? getDragItem() : null,
@@ -51703,11 +52146,13 @@ const TableDragWrapper = (props) => {
51703
52146
  draggable,
51704
52147
  onListReorder = () => {
51705
52148
  },
52149
+ canListReorder = () => true,
51706
52150
  rowActions,
51707
52151
  rows = [],
51708
52152
  tbodyRef
51709
52153
  } = props;
51710
52154
  const [dragIndex, setDragIndex] = useState(null);
52155
+ const [dropDisabled, setDropDisabled] = useState(false);
51711
52156
  const itemIds = useMemo(
51712
52157
  () => rows.map((_2, index2) => index2.toString()),
51713
52158
  [rows]
@@ -51717,34 +52162,53 @@ const TableDragWrapper = (props) => {
51717
52162
  };
51718
52163
  const handleDragEnd = (event) => {
51719
52164
  setDragIndex(null);
52165
+ setDropDisabled(false);
51720
52166
  const { active: active2, over } = event;
51721
- if (!active2 || !over) return;
51722
- if (active2.id !== over.id) {
51723
- onListReorder({
51724
- from: Number(active2.id),
51725
- to: Number(over.id)
51726
- });
52167
+ if (!active2 || !over || active2.id === over.id) {
52168
+ return;
51727
52169
  }
52170
+ const from3 = Number(active2.id);
52171
+ const to2 = Number(over == null ? void 0 : over.id);
52172
+ if (!canListReorder({ from: from3, to: to2 })) {
52173
+ return;
52174
+ }
52175
+ onListReorder({ from: from3, to: to2 });
52176
+ };
52177
+ const handleDragOver = (event) => {
52178
+ const { active: active2, over } = event;
52179
+ const from3 = Number(active2.id);
52180
+ const to2 = Number(over == null ? void 0 : over.id);
52181
+ const disabled2 = from3 !== to2 && !canListReorder({ from: from3, to: to2 });
52182
+ setDropDisabled(disabled2);
51728
52183
  };
51729
52184
  const getCalculatedWidths = () => {
51730
- if (!(tbodyRef == null ? void 0 : tbodyRef.current)) return [];
52185
+ if (!(tbodyRef == null ? void 0 : tbodyRef.current)) {
52186
+ return [];
52187
+ }
51731
52188
  const rows2 = tbodyRef.current.querySelectorAll("tr");
51732
52189
  const activeRow = rows2[Number(dragIndex)];
51733
52190
  const cells = activeRow == null ? void 0 : activeRow.querySelectorAll("td");
51734
- if (!cells) return [];
51735
- const widths = Array.from(cells).map((cell2) => `${cell2.offsetWidth}px`);
52191
+ if (!cells) {
52192
+ return [];
52193
+ }
52194
+ const widths = Array.from(cells).map(
52195
+ (cell2) => `${cell2.getBoundingClientRect().width}px`
52196
+ );
51736
52197
  widths.shift();
51737
52198
  return widths;
51738
52199
  };
51739
- if (!draggable) return children;
52200
+ if (!draggable) {
52201
+ return children({});
52202
+ }
51740
52203
  return /* @__PURE__ */ jsxs(
51741
52204
  DndContext$1,
51742
52205
  {
51743
52206
  collisionDetection: closestCenter,
51744
52207
  onDragStart: handleDragStart2,
51745
52208
  onDragEnd: handleDragEnd,
52209
+ onDragOver: handleDragOver,
51746
52210
  children: [
51747
- /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children }),
52211
+ /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children: children({ dropDisabled }) }),
51748
52212
  !!dragIndex && createPortal(
51749
52213
  /* @__PURE__ */ jsx(DragOverlay, { dropAnimation: null, children: /* @__PURE__ */ jsx("table", { className: cx$2(styles$c.table, styles$c.dragOverlay), children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(
51750
52214
  Row,
@@ -51756,7 +52220,8 @@ const TableDragWrapper = (props) => {
51756
52220
  colSpan,
51757
52221
  hasRowActions: rowActions,
51758
52222
  columnAlignment,
51759
- draggableTable: draggable
52223
+ draggableTable: draggable,
52224
+ dropDisabled
51760
52225
  }
51761
52226
  ) }) }) }),
51762
52227
  document.body
@@ -51765,10 +52230,52 @@ const TableDragWrapper = (props) => {
51765
52230
  }
51766
52231
  );
51767
52232
  };
52233
+ const TableVirtualScrollWrapper = ({
52234
+ table: table2,
52235
+ theadRef,
52236
+ children
52237
+ }) => {
52238
+ var _a2;
52239
+ const containerRef = useRef(null);
52240
+ const MIN_ITEM_HEIGHT = 30;
52241
+ const BORDER_WIDTH = 1;
52242
+ const virtualizer = useVirtualizer({
52243
+ count: ((_a2 = table2.rows) == null ? void 0 : _a2.length) ?? 0,
52244
+ getScrollElement: () => containerRef.current,
52245
+ estimateSize: () => MIN_ITEM_HEIGHT + BORDER_WIDTH,
52246
+ overscan: 10
52247
+ });
52248
+ const getVirtualTableStyle = () => {
52249
+ var _a3;
52250
+ const theadHeight = ((_a3 = theadRef.current) == null ? void 0 : _a3.clientHeight) ?? 0;
52251
+ const totalHeight = virtualizer.getTotalSize() + theadHeight;
52252
+ const items = virtualizer.getVirtualItems();
52253
+ const paddingTop = items.length > 0 ? items[0].start : 0;
52254
+ const paddingBottom = items.length > 0 ? virtualizer.getTotalSize() - items[items.length - 1].end : 0;
52255
+ return {
52256
+ "--virtualPaddingTop": paddingTop + "px",
52257
+ "--virtualPaddingBottom": paddingBottom + "px",
52258
+ height: totalHeight
52259
+ };
52260
+ };
52261
+ return /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$c.scroll, ref: containerRef, children: children({ virtualizer, tableStyle: getVirtualTableStyle() }) });
52262
+ };
52263
+ const TableScrollWrapper = ({
52264
+ table: table2,
52265
+ theadRef,
52266
+ children
52267
+ }) => {
52268
+ const { infiniteScroll = false } = table2;
52269
+ return infiniteScroll ? /* @__PURE__ */ jsx(TableVirtualScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => children({ virtualizer, tableStyle }) }) : /* @__PURE__ */ jsx("div", { id: "scrollWrapper", className: styles$c.scroll, children: children({}) });
52270
+ };
51768
52271
  const Table = (props) => {
51769
52272
  var _a2, _b, _c, _d, _e2, _f, _g;
51770
- const { onListReorder = () => {
51771
- }, table: propTable } = props;
52273
+ const {
52274
+ onListReorder = () => {
52275
+ },
52276
+ canListReorder = () => true,
52277
+ table: propTable
52278
+ } = props;
51772
52279
  const {
51773
52280
  columnWidths,
51774
52281
  footer: footer2,
@@ -51787,6 +52294,7 @@ const Table = (props) => {
51787
52294
  maxHeight,
51788
52295
  fixedWidth: width2
51789
52296
  } = propTable;
52297
+ const theadRef = useRef(null);
51790
52298
  const tbodyRef = useRef(null);
51791
52299
  const headers = get$2(props, "table.headers", []);
51792
52300
  const columnCount = getColumnCount(propRows, headers);
@@ -51848,7 +52356,7 @@ const Table = (props) => {
51848
52356
  testId: testId && `${testId}-title`
51849
52357
  }
51850
52358
  ),
51851
- /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, children: ({ visibleRows }) => /* @__PURE__ */ jsx(
52359
+ /* @__PURE__ */ jsx(
51852
52360
  TableDragWrapper,
51853
52361
  {
51854
52362
  colSpan,
@@ -51859,13 +52367,15 @@ const Table = (props) => {
51859
52367
  rowActions,
51860
52368
  rows,
51861
52369
  tbodyRef,
51862
- children: /* @__PURE__ */ jsxs(
52370
+ canListReorder,
52371
+ children: ({ dropDisabled }) => /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => /* @__PURE__ */ jsxs(
51863
52372
  "table",
51864
52373
  {
51865
52374
  className: cx$2(styles$c.table, striped2 ? styles$c.striped : ""),
51866
52375
  "data-testid": testId,
52376
+ style: tableStyle,
51867
52377
  children: [
51868
- /* @__PURE__ */ jsx("thead", { children: headers.map((row2, rowIndex) => {
52378
+ /* @__PURE__ */ jsx("thead", { ref: theadRef, children: headers.map((row2, rowIndex) => {
51869
52379
  return /* @__PURE__ */ jsx(
51870
52380
  Row,
51871
52381
  {
@@ -51883,25 +52393,41 @@ const Table = (props) => {
51883
52393
  `0_${rowIndex}`
51884
52394
  );
51885
52395
  }) }),
51886
- /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: rows.slice(0, visibleRows).map((row2, rowIndex) => /* @__PURE__ */ jsx(
52396
+ /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
51887
52397
  Row,
51888
52398
  {
51889
- rowIndex,
52399
+ rowIndex: virtualRow2.index,
52400
+ row: rows[virtualRow2.index],
52401
+ columnCount,
52402
+ columnWidths,
52403
+ colSpan,
52404
+ hasRowActions: rowActions,
52405
+ columnAlignment,
52406
+ draggableTable: draggable,
52407
+ height: virtualRow2.size,
52408
+ dropDisabled
52409
+ },
52410
+ `1_${virtualRow2.index}`
52411
+ )) : rows.map((row2, index2) => /* @__PURE__ */ jsx(
52412
+ Row,
52413
+ {
52414
+ rowIndex: index2,
51890
52415
  row: row2,
51891
52416
  columnCount,
51892
52417
  columnWidths,
51893
52418
  colSpan,
51894
52419
  hasRowActions: rowActions,
51895
52420
  columnAlignment,
51896
- draggableTable: draggable
52421
+ draggableTable: draggable,
52422
+ dropDisabled
51897
52423
  },
51898
- `1_${rowIndex}`
52424
+ `1_${index2}`
51899
52425
  )) })
51900
52426
  ]
51901
52427
  }
51902
- )
52428
+ ) })
51903
52429
  }
51904
- ) }),
52430
+ ),
51905
52431
  footer2 && /* @__PURE__ */ jsx(
51906
52432
  Footer,
51907
52433
  {
@@ -55013,7 +55539,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
55013
55539
  }
55014
55540
  let refCount = 0;
55015
55541
  const INSTANCE_SYM = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
55016
- var DndProvider = /* @__PURE__ */ memo(function DndProvider2(_param) {
55542
+ var DndProvider = /* @__PURE__ */ memo$1(function DndProvider2(_param) {
55017
55543
  var { children } = _param, props = _objectWithoutProperties(_param, [
55018
55544
  "children"
55019
55545
  ]);
@@ -57374,7 +57900,7 @@ function useFeatures(props, visualElement2, preloadedFeatures) {
57374
57900
  var name_1 = featureNames[i];
57375
57901
  var _a2 = featureDefinitions[name_1], isEnabled = _a2.isEnabled, Component2 = _a2.Component;
57376
57902
  if (isEnabled(props) && Component2) {
57377
- features.push(React$4.createElement(Component2, __assign$4({ key: name_1 }, props, { visualElement: visualElement2 })));
57903
+ features.push(React$4.createElement(Component2, __assign$3({ key: name_1 }, props, { visualElement: visualElement2 })));
57378
57904
  }
57379
57905
  }
57380
57906
  return features;
@@ -57615,7 +58141,7 @@ function useProjection(projectionId, _a2, visualElement2, ProjectionNodeConstruc
57615
58141
  var VisualElementHandler = (
57616
58142
  /** @class */
57617
58143
  function(_super) {
57618
- __extends$1(VisualElementHandler2, _super);
58144
+ __extends(VisualElementHandler2, _super);
57619
58145
  function VisualElementHandler2() {
57620
58146
  return _super !== null && _super.apply(this, arguments) || this;
57621
58147
  }
@@ -57641,20 +58167,20 @@ function createMotionComponent(_a2) {
57641
58167
  preloadedFeatures && loadFeatures(preloadedFeatures);
57642
58168
  function MotionComponent(props, externalRef) {
57643
58169
  var layoutId = useLayoutId(props);
57644
- props = __assign$4(__assign$4({}, props), { layoutId });
58170
+ props = __assign$3(__assign$3({}, props), { layoutId });
57645
58171
  var config = useContext(MotionConfigContext);
57646
58172
  var features = null;
57647
58173
  var context2 = useCreateMotionContext(props);
57648
58174
  var projectionId = config.isStatic ? void 0 : useProjectionId();
57649
58175
  var visualState = useVisualState(props, config.isStatic);
57650
58176
  if (!config.isStatic && isBrowser) {
57651
- context2.visualElement = useVisualElement(Component2, visualState, __assign$4(__assign$4({}, config), props), createVisualElement);
58177
+ context2.visualElement = useVisualElement(Component2, visualState, __assign$3(__assign$3({}, config), props), createVisualElement);
57652
58178
  useProjection(projectionId, props, context2.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
57653
58179
  features = useFeatures(props, context2.visualElement, preloadedFeatures);
57654
58180
  }
57655
58181
  return React$4.createElement(
57656
58182
  VisualElementHandler,
57657
- { visualElement: context2.visualElement, props: __assign$4(__assign$4({}, config), props) },
58183
+ { visualElement: context2.visualElement, props: __assign$3(__assign$3({}, config), props) },
57658
58184
  features,
57659
58185
  React$4.createElement(MotionContext.Provider, { value: context2 }, useRender(Component2, props, projectionId, useMotionRef(visualState, context2.visualElement, externalRef), visualState, config.isStatic, context2.visualElement))
57660
58186
  );
@@ -57980,7 +58506,7 @@ const filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v
57980
58506
  const functions = v2.match(functionRegex);
57981
58507
  return functions ? functions.map(applyDefaultFilter).join(" ") : v2;
57982
58508
  } });
57983
- var int = __assign$4(__assign$4({}, number), { transform: Math.round });
58509
+ var int = __assign$3(__assign$3({}, number), { transform: Math.round });
57984
58510
  var numberValueTypes = {
57985
58511
  // Border props
57986
58512
  borderWidth: px,
@@ -58110,7 +58636,7 @@ function useInitialMotionValues(_a2, visualState, isStatic) {
58110
58636
  var state = createHtmlRenderState();
58111
58637
  buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);
58112
58638
  var vars = state.vars, style = state.style;
58113
- return __assign$4(__assign$4({}, vars), style);
58639
+ return __assign$3(__assign$3({}, vars), style);
58114
58640
  }, [visualState]);
58115
58641
  }
58116
58642
  function useStyle(props, visualState, isStatic) {
@@ -58268,18 +58794,18 @@ function buildSVGAttrs(state, _a2, options, transformTemplate) {
58268
58794
  }
58269
58795
  }
58270
58796
  var createSvgRenderState = function() {
58271
- return __assign$4(__assign$4({}, createHtmlRenderState()), { attrs: {} });
58797
+ return __assign$3(__assign$3({}, createHtmlRenderState()), { attrs: {} });
58272
58798
  };
58273
58799
  function useSVGProps(props, visualState) {
58274
58800
  var visualProps = useMemo(function() {
58275
58801
  var state = createSvgRenderState();
58276
58802
  buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate);
58277
- return __assign$4(__assign$4({}, state.attrs), { style: __assign$4({}, state.style) });
58803
+ return __assign$3(__assign$3({}, state.attrs), { style: __assign$3({}, state.style) });
58278
58804
  }, [visualState]);
58279
58805
  if (props.style) {
58280
58806
  var rawStyles = {};
58281
58807
  copyRawValuesOnly(rawStyles, props.style, props);
58282
- visualProps.style = __assign$4(__assign$4({}, rawStyles), visualProps.style);
58808
+ visualProps.style = __assign$3(__assign$3({}, rawStyles), visualProps.style);
58283
58809
  }
58284
58810
  return visualProps;
58285
58811
  }
@@ -58292,7 +58818,7 @@ function createUseRender(forwardMotionProps) {
58292
58818
  var useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
58293
58819
  var visualProps = useVisualProps(props, latestValues, isStatic);
58294
58820
  var filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
58295
- var elementProps = __assign$4(__assign$4(__assign$4({}, filteredProps), visualProps), { ref });
58821
+ var elementProps = __assign$3(__assign$3(__assign$3({}, filteredProps), visualProps), { ref });
58296
58822
  if (projectionId) {
58297
58823
  elementProps["data-projection-id"] = projectionId;
58298
58824
  }
@@ -58469,7 +58995,7 @@ var htmlMotionConfig = {
58469
58995
  function createDomMotionConfig(Component2, _a2, preloadedFeatures, createVisualElement, projectionNodeConstructor) {
58470
58996
  var _b = _a2.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
58471
58997
  var baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
58472
- return __assign$4(__assign$4({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58998
+ return __assign$3(__assign$3({}, baseConfig), { preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement, projectionNodeConstructor, Component: Component2 });
58473
58999
  }
58474
59000
  var AnimationType;
58475
59001
  (function(AnimationType2) {
@@ -59556,7 +60082,7 @@ function initIntersectionObserver(_a2) {
59556
60082
  var rootObservers = observers.get(lookupRoot);
59557
60083
  var key2 = JSON.stringify(options);
59558
60084
  if (!rootObservers[key2]) {
59559
- rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$4({ root: root2 }, options));
60085
+ rootObservers[key2] = new IntersectionObserver(fireAllObserverCallbacks, __assign$3({ root: root2 }, options));
59560
60086
  }
59561
60087
  return rootObservers[key2];
59562
60088
  }
@@ -59774,9 +60300,9 @@ var getDefaultTransition = function(valueKey, to2) {
59774
60300
  } else {
59775
60301
  transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default;
59776
60302
  }
59777
- return __assign$4({ to: to2 }, transitionFactory(to2));
60303
+ return __assign$3({ to: to2 }, transitionFactory(to2));
59778
60304
  };
59779
- var defaultValueTypes = __assign$4(__assign$4({}, numberValueTypes), {
60305
+ var defaultValueTypes = __assign$3(__assign$3({}, numberValueTypes), {
59780
60306
  // Color props
59781
60307
  color,
59782
60308
  backgroundColor: color,
@@ -59818,7 +60344,7 @@ function isTransitionDefined(_a2) {
59818
60344
  var legacyRepeatWarning = false;
59819
60345
  function convertTransitionToAnimationOptions(_a2) {
59820
60346
  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"]);
59821
- var options = __assign$4({}, transition);
60347
+ var options = __assign$3({}, transition);
59822
60348
  if (times)
59823
60349
  options["offset"] = times;
59824
60350
  if (transition.duration)
@@ -59865,9 +60391,9 @@ function getPopmotionAnimationOptions(transition, options, key2) {
59865
60391
  }
59866
60392
  hydrateKeyframes(options);
59867
60393
  if (!isTransitionDefined(transition)) {
59868
- transition = __assign$4(__assign$4({}, transition), getDefaultTransition(key2, options.to));
60394
+ transition = __assign$3(__assign$3({}, transition), getDefaultTransition(key2, options.to));
59869
60395
  }
59870
- return __assign$4(__assign$4({}, options), convertTransitionToAnimationOptions(transition));
60396
+ return __assign$3(__assign$3({}, options), convertTransitionToAnimationOptions(transition));
59871
60397
  }
59872
60398
  function getAnimation(key2, value, target, transition, onComplete) {
59873
60399
  var _a2;
@@ -59893,7 +60419,7 @@ function getAnimation(key2, value, target, transition, onComplete) {
59893
60419
  return value.set(v2);
59894
60420
  }
59895
60421
  };
59896
- 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) {
60422
+ 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) {
59897
60423
  var _a3;
59898
60424
  options.onUpdate(v2);
59899
60425
  (_a3 = valueTransition.onUpdate) === null || _a3 === void 0 ? void 0 : _a3.call(valueTransition, v2);
@@ -60146,7 +60672,7 @@ function setTarget(visualElement2, definition) {
60146
60672
  var _a2 = resolved ? visualElement2.makeTargetAnimatable(resolved, false) : {}, _b = _a2.transitionEnd, transitionEnd = _b === void 0 ? {} : _b;
60147
60673
  _a2.transition;
60148
60674
  var target = __rest$1(_a2, ["transitionEnd", "transition"]);
60149
- target = __assign$4(__assign$4({}, target), transitionEnd);
60675
+ target = __assign$3(__assign$3({}, target), transitionEnd);
60150
60676
  for (var key2 in target) {
60151
60677
  var value = resolveFinalValueInKeyframes(target[key2]);
60152
60678
  setMotionValue(visualElement2, key2, value);
@@ -60264,9 +60790,9 @@ function animateTarget(visualElement2, definition, _a2) {
60264
60790
  if (!value || valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key2)) {
60265
60791
  continue;
60266
60792
  }
60267
- var valueTransition = __assign$4({ delay }, transition);
60793
+ var valueTransition = __assign$3({ delay }, transition);
60268
60794
  if (visualElement2.shouldReduceMotion && isTransformProp(key2)) {
60269
- valueTransition = __assign$4(__assign$4({}, valueTransition), { type: false, delay: 0 });
60795
+ valueTransition = __assign$3(__assign$3({}, valueTransition), { type: false, delay: 0 });
60270
60796
  }
60271
60797
  var animation = startAnimation(key2, value, valueTarget, valueTransition);
60272
60798
  animations2.push(animation);
@@ -60299,7 +60825,7 @@ function animateChildren(visualElement2, variant, delayChildren, staggerChildren
60299
60825
  return maxStaggerDuration - i * staggerChildren;
60300
60826
  };
60301
60827
  Array.from(visualElement2.variantChildren).sort(sortByTreeOrder).forEach(function(child, i) {
60302
- animations2.push(animateVariant(child, variant, __assign$4(__assign$4({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60828
+ animations2.push(animateVariant(child, variant, __assign$3(__assign$3({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function() {
60303
60829
  return child.notifyAnimationComplete(variant);
60304
60830
  }));
60305
60831
  });
@@ -60343,7 +60869,7 @@ function createAnimationState(visualElement2) {
60343
60869
  if (resolved) {
60344
60870
  resolved.transition;
60345
60871
  var transitionEnd = resolved.transitionEnd, target = __rest$1(resolved, ["transition", "transitionEnd"]);
60346
- acc = __assign$4(__assign$4(__assign$4({}, acc), target), transitionEnd);
60872
+ acc = __assign$3(__assign$3(__assign$3({}, acc), target), transitionEnd);
60347
60873
  }
60348
60874
  return acc;
60349
60875
  };
@@ -60373,7 +60899,7 @@ function createAnimationState(visualElement2) {
60373
60899
  if (isInherited && isInitialRender && visualElement2.manuallyAnimateOnMount) {
60374
60900
  isInherited = false;
60375
60901
  }
60376
- typeState.protectedKeys = __assign$4({}, encounteredKeys);
60902
+ typeState.protectedKeys = __assign$3({}, encounteredKeys);
60377
60903
  if (
60378
60904
  // If it isn't active and hasn't *just* been set as inactive
60379
60905
  !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
@@ -60391,7 +60917,7 @@ function createAnimationState(visualElement2) {
60391
60917
  if (activeDelta === false)
60392
60918
  resolvedValues = {};
60393
60919
  var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
60394
- var allKeys = __assign$4(__assign$4({}, prevResolvedValues), resolvedValues);
60920
+ var allKeys = __assign$3(__assign$3({}, prevResolvedValues), resolvedValues);
60395
60921
  var markToAnimate = function(key3) {
60396
60922
  shouldAnimateType = true;
60397
60923
  removedKeys.delete(key3);
@@ -60423,7 +60949,7 @@ function createAnimationState(visualElement2) {
60423
60949
  typeState.prevProp = prop;
60424
60950
  typeState.prevResolvedValues = resolvedValues;
60425
60951
  if (typeState.isActive) {
60426
- encounteredKeys = __assign$4(__assign$4({}, encounteredKeys), resolvedValues);
60952
+ encounteredKeys = __assign$3(__assign$3({}, encounteredKeys), resolvedValues);
60427
60953
  }
60428
60954
  if (isInitialRender && visualElement2.blockInitialAnimation) {
60429
60955
  shouldAnimateType = false;
@@ -60432,7 +60958,7 @@ function createAnimationState(visualElement2) {
60432
60958
  animations2.push.apply(animations2, __spreadArray$2([], __read(definitionList.map(function(animation) {
60433
60959
  return {
60434
60960
  animation,
60435
- options: __assign$4({ type }, options)
60961
+ options: __assign$3({ type }, options)
60436
60962
  };
60437
60963
  })), false));
60438
60964
  }
@@ -60440,7 +60966,7 @@ function createAnimationState(visualElement2) {
60440
60966
  for (var i = 0; i < numAnimationTypes; i++) {
60441
60967
  _loop_1(i);
60442
60968
  }
60443
- allAnimatedKeys = __assign$4({}, encounteredKeys);
60969
+ allAnimatedKeys = __assign$3({}, encounteredKeys);
60444
60970
  if (removedKeys.size) {
60445
60971
  var fallbackAnimation_1 = {};
60446
60972
  removedKeys.forEach(function(key2) {
@@ -60548,7 +61074,7 @@ var PanSession = (
60548
61074
  return;
60549
61075
  var point2 = info3.point;
60550
61076
  var timestamp2 = getFrameData().timestamp;
60551
- _this.history.push(__assign$4(__assign$4({}, point2), { timestamp: timestamp2 }));
61077
+ _this.history.push(__assign$3(__assign$3({}, point2), { timestamp: timestamp2 }));
60552
61078
  var _a3 = _this.handlers, onStart = _a3.onStart, onMove = _a3.onMove;
60553
61079
  if (!isPanStarted) {
60554
61080
  onStart && onStart(_this.lastMoveEvent, info3);
@@ -60582,7 +61108,7 @@ var PanSession = (
60582
61108
  var initialInfo = transformPoint(info2, this.transformPagePoint);
60583
61109
  var point = initialInfo.point;
60584
61110
  var timestamp = getFrameData().timestamp;
60585
- this.history = [__assign$4(__assign$4({}, point), { timestamp })];
61111
+ this.history = [__assign$3(__assign$3({}, point), { timestamp })];
60586
61112
  var onSessionStart = handlers2.onSessionStart;
60587
61113
  onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
60588
61114
  this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
@@ -61103,7 +61629,7 @@ var VisualElementDragControls = (
61103
61629
  transition = { min: 0, max: 0 };
61104
61630
  var bounceStiffness = dragElastic ? 200 : 1e6;
61105
61631
  var bounceDamping = dragElastic ? 40 : 1e7;
61106
- var inertia2 = __assign$4(__assign$4({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61632
+ var inertia2 = __assign$3(__assign$3({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness, bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
61107
61633
  return _this.startAxisValueAnimation(axis, inertia2);
61108
61634
  });
61109
61635
  return Promise.all(momentumAnimations).then(onDragTransitionEnd);
@@ -61214,7 +61740,7 @@ var VisualElementDragControls = (
61214
61740
  VisualElementDragControls2.prototype.getProps = function() {
61215
61741
  var props = this.visualElement.getProps();
61216
61742
  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;
61217
- return __assign$4(__assign$4({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61743
+ return __assign$3(__assign$3({}, props), { drag: drag2, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum });
61218
61744
  };
61219
61745
  return VisualElementDragControls2;
61220
61746
  }()
@@ -61371,7 +61897,7 @@ var visualElement = function(_a2) {
61371
61897
  var values2 = /* @__PURE__ */ new Map();
61372
61898
  var valueSubscriptions = /* @__PURE__ */ new Map();
61373
61899
  var prevMotionValues = {};
61374
- var baseTarget = __assign$4({}, latestValues);
61900
+ var baseTarget = __assign$3({}, latestValues);
61375
61901
  var removeFromVariantTree;
61376
61902
  function render2() {
61377
61903
  if (!instance || !isMounted)
@@ -61405,7 +61931,7 @@ var visualElement = function(_a2) {
61405
61931
  }
61406
61932
  var isControllingVariants = checkIfControllingVariants(props);
61407
61933
  var isVariantNode = checkIfVariantNode(props);
61408
- var element = __assign$4(__assign$4({
61934
+ var element = __assign$3(__assign$3({
61409
61935
  treeType,
61410
61936
  /**
61411
61937
  * This is a mirror of the internal instance prop, which keeps
@@ -61770,7 +62296,7 @@ function resolveCSSVariables(visualElement2, _a2, transitionEnd) {
61770
62296
  if (!(element instanceof Element))
61771
62297
  return { target, transitionEnd };
61772
62298
  if (transitionEnd) {
61773
- transitionEnd = __assign$4({}, transitionEnd);
62299
+ transitionEnd = __assign$3({}, transitionEnd);
61774
62300
  }
61775
62301
  visualElement2.forEachValue(function(value) {
61776
62302
  var current2 = value.get();
@@ -61925,8 +62451,8 @@ var checkAndConvertChangedValueTypes = function(visualElement2, target, origin,
61925
62451
  if (transitionEnd === void 0) {
61926
62452
  transitionEnd = {};
61927
62453
  }
61928
- target = __assign$4({}, target);
61929
- transitionEnd = __assign$4({}, transitionEnd);
62454
+ target = __assign$3({}, target);
62455
+ transitionEnd = __assign$3({}, transitionEnd);
61930
62456
  var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
61931
62457
  var removedTransformValues = [];
61932
62458
  var hasAttemptedToRemoveTransformValues = false;
@@ -62079,7 +62605,7 @@ var htmlConfig = {
62079
62605
  transitionEnd = parsed.transitionEnd;
62080
62606
  target = parsed.target;
62081
62607
  }
62082
- return __assign$4({ transition, transitionEnd }, target);
62608
+ return __assign$3({ transition, transitionEnd }, target);
62083
62609
  },
62084
62610
  scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1,
62085
62611
  build: function(element, renderState, latestValues, options, props) {
@@ -62091,7 +62617,7 @@ var htmlConfig = {
62091
62617
  render: renderHTML
62092
62618
  };
62093
62619
  var htmlVisualElement = visualElement(htmlConfig);
62094
- var svgVisualElement = visualElement(__assign$4(__assign$4({}, htmlConfig), { getBaseTarget: function(props, key2) {
62620
+ var svgVisualElement = visualElement(__assign$3(__assign$3({}, htmlConfig), { getBaseTarget: function(props, key2) {
62095
62621
  return props[key2];
62096
62622
  }, readValueFromInstance: function(domElement, key2) {
62097
62623
  var _a2;
@@ -62169,7 +62695,7 @@ var correctBoxShadow = {
62169
62695
  var MeasureLayoutWithContext = (
62170
62696
  /** @class */
62171
62697
  function(_super) {
62172
- __extends$1(MeasureLayoutWithContext2, _super);
62698
+ __extends(MeasureLayoutWithContext2, _super);
62173
62699
  function MeasureLayoutWithContext2() {
62174
62700
  return _super !== null && _super.apply(this, arguments) || this;
62175
62701
  }
@@ -62188,7 +62714,7 @@ var MeasureLayoutWithContext = (
62188
62714
  projection.addEventListener("animationComplete", function() {
62189
62715
  _this.safeToRemove();
62190
62716
  });
62191
- projection.setOptions(__assign$4(__assign$4({}, projection.options), { onExitComplete: function() {
62717
+ projection.setOptions(__assign$3(__assign$3({}, projection.options), { onExitComplete: function() {
62192
62718
  return _this.safeToRemove();
62193
62719
  } }));
62194
62720
  }
@@ -62253,10 +62779,10 @@ var MeasureLayoutWithContext = (
62253
62779
  function MeasureLayout(props) {
62254
62780
  var _a2 = __read(usePresence(), 2), isPresent = _a2[0], safeToRemove = _a2[1];
62255
62781
  var layoutGroup = useContext(LayoutGroupContext);
62256
- return React__default.createElement(MeasureLayoutWithContext, __assign$4({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62782
+ return React__default.createElement(MeasureLayoutWithContext, __assign$3({}, props, { layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }));
62257
62783
  }
62258
62784
  var defaultScaleCorrectors = {
62259
- borderRadius: __assign$4(__assign$4({}, correctBorderRadius), { applyTo: [
62785
+ borderRadius: __assign$3(__assign$3({}, correctBorderRadius), { applyTo: [
62260
62786
  "borderTopLeftRadius",
62261
62787
  "borderTopRightRadius",
62262
62788
  "borderBottomLeftRadius",
@@ -62679,7 +63205,7 @@ function createProjectionNode(_a2) {
62679
63205
  _this.resumingFrom.resumingFrom = void 0;
62680
63206
  }
62681
63207
  _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
62682
- var animationOptions = __assign$4(__assign$4({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
63208
+ var animationOptions = __assign$3(__assign$3({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete });
62683
63209
  if (visualElement2.shouldReduceMotion) {
62684
63210
  animationOptions.delay = 0;
62685
63211
  animationOptions.type = false;
@@ -62933,7 +63459,7 @@ function createProjectionNode(_a2) {
62933
63459
  };
62934
63460
  ProjectionNode.prototype.setOptions = function(options) {
62935
63461
  var _a3;
62936
- this.options = __assign$4(__assign$4(__assign$4({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
63462
+ this.options = __assign$3(__assign$3(__assign$3({}, this.options), options), { crossfade: (_a3 = options.crossfade) !== null && _a3 !== void 0 ? _a3 : true });
62937
63463
  };
62938
63464
  ProjectionNode.prototype.clearMeasurements = function() {
62939
63465
  this.scroll = void 0;
@@ -63051,7 +63577,7 @@ function createProjectionNode(_a2) {
63051
63577
  }
63052
63578
  var snapshot = this.snapshot;
63053
63579
  var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};
63054
- var mixedValues = __assign$4({}, this.latestValues);
63580
+ var mixedValues = __assign$3({}, this.latestValues);
63055
63581
  var targetDelta = createDelta();
63056
63582
  this.relativeTarget = this.relativeTargetOrigin = void 0;
63057
63583
  this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
@@ -63094,7 +63620,7 @@ function createProjectionNode(_a2) {
63094
63620
  }
63095
63621
  this.pendingAnimation = sync.update(function() {
63096
63622
  globalProjectionState.hasAnimatedSinceResize = true;
63097
- _this.currentAnimation = animate(0, animationTarget, __assign$4(__assign$4({}, options), { onUpdate: function(latest) {
63623
+ _this.currentAnimation = animate(0, animationTarget, __assign$3(__assign$3({}, options), { onUpdate: function(latest) {
63098
63624
  var _a4;
63099
63625
  _this.mixTargetDelta(latest);
63100
63626
  (_a4 = options.onUpdate) === null || _a4 === void 0 ? void 0 : _a4.call(options, latest);
@@ -63462,7 +63988,7 @@ var HTMLProjectionNode = createProjectionNode({
63462
63988
  return Boolean(window.getComputedStyle(instance).position === "fixed");
63463
63989
  }
63464
63990
  });
63465
- var featureBundle = __assign$4(__assign$4(__assign$4(__assign$4({}, animations), gestureAnimations), drag), layoutFeatures);
63991
+ var featureBundle = __assign$3(__assign$3(__assign$3(__assign$3({}, animations), gestureAnimations), drag), layoutFeatures);
63466
63992
  var motion = /* @__PURE__ */ createMotionProxy(function(Component2, config) {
63467
63993
  return createDomMotionConfig(Component2, config, featureBundle, createDomVisualElement, HTMLProjectionNode);
63468
63994
  });
@@ -66136,32 +66662,27 @@ const UnitInput = ({
66136
66662
  className: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? cx$2(styles$1.predefinedMenuActive) : "",
66137
66663
  children: /* @__PURE__ */ jsxs(InputGroup, { small: small2, width: width2, children: [
66138
66664
  predefinedOptions && /* @__PURE__ */ jsx(
66139
- Tooltip,
66665
+ Menu,
66140
66666
  {
66141
- text: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption == null ? void 0 : foundPredefinedMenuOption.label : "",
66142
- children: /* @__PURE__ */ jsx(
66143
- Menu,
66144
- {
66145
- maxHeight: 380,
66146
- groupOrder: "first",
66147
- testId: testId && `${testId}-predefined-menu`,
66148
- disabled: disabled2,
66149
- menu: {
66150
- colored: true,
66151
- trigger: "Component",
66152
- component: /* @__PURE__ */ jsx(
66153
- Button$1,
66154
- {
66155
- groupOrder: "first",
66156
- active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
66157
- icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink"
66158
- }
66159
- ),
66160
- small: small2,
66161
- sections: sectionsPredefinedMenu
66667
+ maxHeight: 380,
66668
+ groupOrder: "first",
66669
+ testId: testId && `${testId}-predefined-menu`,
66670
+ disabled: disabled2,
66671
+ menu: {
66672
+ colored: true,
66673
+ trigger: "Component",
66674
+ component: /* @__PURE__ */ jsx(
66675
+ Button$1,
66676
+ {
66677
+ groupOrder: "first",
66678
+ active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
66679
+ icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink"
66162
66680
  }
66163
- }
66164
- )
66681
+ ),
66682
+ small: small2,
66683
+ sections: sectionsPredefinedMenu
66684
+ },
66685
+ tooltip: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption == null ? void 0 : foundPredefinedMenuOption.label : ""
66165
66686
  }
66166
66687
  ),
66167
66688
  /* @__PURE__ */ jsx("div", { className: styles$1.inputWrapper, children: /* @__PURE__ */ jsx(
@@ -66248,10 +66769,11 @@ const convertVisibleRows = ({
66248
66769
  cells: headerRow.cells.map((headerCell) => {
66249
66770
  var _a2;
66250
66771
  if (headerCell.type === CellType.AUTO_UNIT) {
66251
- const { testId, unitKey } = headerCell;
66772
+ const { testId, unitKey, disabled: disabled2 = false } = headerCell;
66252
66773
  return {
66253
66774
  value: selectedUnits[unitKey],
66254
66775
  type: CellType.SELECT,
66776
+ disabled: disabled2,
66255
66777
  searchable: false,
66256
66778
  options: (_a2 = getUnitsForQuantity(unitKey)) == null ? void 0 : _a2.map((unit2) => ({
66257
66779
  label: label$b(unit2),
@@ -66558,8 +67080,8 @@ const SettingField = ({
66558
67080
  ] }, index2));
66559
67081
  };
66560
67082
  const options = [
66561
- { label: "All users", value: "all_users" },
66562
- { label: "Admin only", value: "superusers_admin" }
67083
+ { label: "All users", value: false },
67084
+ { label: "Admin only", value: true }
66563
67085
  ];
66564
67086
  return /* @__PURE__ */ jsxs("div", { className: styles.settingField, children: [
66565
67087
  /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", wrap: false, children: [
@@ -66573,9 +67095,7 @@ const SettingField = ({
66573
67095
  options,
66574
67096
  value: selectedOption,
66575
67097
  disabled: disabled2,
66576
- onChange: handleSelectChange ? (e2) => handleSelectChange(
66577
- e2.target.value
66578
- ) : void 0,
67098
+ onChange: handleSelectChange || void 0,
66579
67099
  "aria-label": "Select user type",
66580
67100
  width: "auto"
66581
67101
  }