@oliasoft-open-source/react-ui-library 5.6.5-beta-7 → 5.6.5

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
@@ -1,4 +1,4 @@
1
- import React, { Fragment, cloneElement, createContext, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useTransition } from "react";
1
+ import React, { Fragment, createContext, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useTransition } from "react";
2
2
  import cx from "classnames";
3
3
  import { ReactSVG } from "react-svg";
4
4
  import { TbAlertTriangle, TbArrowDown, TbArrowLeft, TbArrowRight, TbArrowUp, TbArrowsDiagonal, TbArrowsMaximize, TbArrowsMinimize, TbArrowsMove, TbArrowsSplit, TbBell, TbBold, TbBolt, TbBook2, TbBuildingSkyscraper, TbCamera, TbChartBar, TbChartLine, TbChartPie2, TbCheck, TbChevronDown, TbChevronLeft, TbChevronRight, TbChevronUp, TbChevronsLeft, TbChevronsRight, TbCircle, TbCircleCheck, TbCircleX, TbClipboard, TbClock, TbCode, TbCopy, TbCornerDownRight, TbDeviceFloppy, TbDeviceLaptop, TbDotsVertical, TbDownload, TbDroplet, TbExclamationMark, TbExternalLink, TbEye, TbEyeOff, TbFile, TbFilter, TbFilterOff, TbFocusCentered, TbFolder, TbFolderSearch, TbGauge, TbGitFork, TbGripVertical, TbHelp, TbInfoCircle, TbItalic, TbKey, TbLayoutColumns, TbLayoutRows, TbLink, TbLinkOff, TbList, TbListNumbers, TbLoader2, TbLock, TbLockOpen, TbMapPin, TbMessageCircle, TbMinus, TbMoon, TbMovie, TbNote, TbPencil, TbPlayerPause, TbPlayerPlay, TbPlayerSkipBack, TbPlayerSkipForward, TbPlayerStop, TbPlayerTrackNext, TbPlayerTrackPrev, TbPlus, TbQuestionMark, TbRefresh, TbReload, TbRotate, TbRowInsertBottom, TbRowInsertTop, TbRuler3, TbScale, TbSearch, TbServer, TbSettings, TbSortAscending, TbSortDescending, TbStar, TbSun, TbTable, TbTarget, TbTrash, TbUpload, TbUser, TbUsers, TbX } from "react-icons/tb";
@@ -15,13 +15,13 @@ import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue,
15
15
  import { FixedSizeList } from "react-window";
16
16
  import { SortableContext, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
17
17
  import { CSS } from "@dnd-kit/utilities";
18
- import Papa from "papaparse";
19
18
  import RcSlider from "rc-slider";
20
19
  import memoizeOne from "memoize-one";
21
20
  import isEqual$1 from "react-fast-compare";
22
21
  import { DndContext, DragOverlay, closestCenter } from "@dnd-kit/core";
23
22
  import { useVirtualizer } from "@tanstack/react-virtual";
24
23
  import { SimplifyAP } from "simplify-ts";
24
+ import Papa from "papaparse";
25
25
  import { Slide, ToastContainer as Toaster, toast as toast$1 } from "react-toastify";
26
26
  import { isNullOrUndefined } from "remirror";
27
27
  import { BoldExtension, BulletListExtension, CodeExtension, ItalicExtension, MarkdownExtension, OrderedListExtension, PlaceholderExtension } from "remirror/extensions";
@@ -214,23 +214,23 @@ const NamedIcon = ({ icon: e }) => {
214
214
  case "": return null;
215
215
  default: return /* @__PURE__ */ jsx(TbCircle, {});
216
216
  }
217
- }, Icon = ({ icon: e, onClick: t, clickable: n = !1, color: r, size: i, testId: o }) => {
218
- let s = useContext(DisabledContext), l = {
217
+ }, Icon = ({ icon: e, onClick: t, clickable: n = !1, color: r, size: a, testId: o }) => {
218
+ let c = useContext(DisabledContext), l = {
219
219
  color: r,
220
220
  fill: r,
221
- fontSize: i || "inherit",
222
- width: i || "auto",
223
- height: i || "auto"
221
+ fontSize: a || "inherit",
222
+ width: a || "auto",
223
+ height: a || "auto"
224
224
  };
225
225
  return /* @__PURE__ */ jsx("div", {
226
- className: cx(icon_module_default.wrapper, (n || t) && !s ? icon_module_default.clickable : ""),
226
+ className: cx(icon_module_default.wrapper, (n || t) && !c ? icon_module_default.clickable : ""),
227
227
  style: l,
228
- onClick: (e) => t && !s ? t(e) : void 0,
228
+ onClick: (e) => t && !c ? t(e) : void 0,
229
229
  "data-testid": o,
230
230
  children: isValidElement(e) ? e : typeof e == "string" && (e.includes(".svg") || e.includes("image/svg")) ? /* @__PURE__ */ jsx(ReactSVG, {
231
231
  className: icon_module_default.customSvg,
232
232
  beforeInjection: (e) => {
233
- i && (e.setAttribute("width", String(i)), e.setAttribute("height", String(i)));
233
+ a && (e.setAttribute("width", String(a)), e.setAttribute("height", String(a)));
234
234
  },
235
235
  src: e
236
236
  }) : typeof e == "string" && (e.includes(".png") || e.includes("image/png")) ? /* @__PURE__ */ jsx("img", {
@@ -325,7 +325,7 @@ const TooltipLayer = ({ text: e = "", error: t = !1, warning: n = !1, maxWidth:
325
325
  ...s,
326
326
  size: 6
327
327
  })]
328
- }), Tooltip = ({ children: e, text: t = "", error: n = !1, placement: r = "top-center", possiblePlacements: i = [
328
+ }), Tooltip = ({ children: e, text: t = "", error: n = !1, placement: r = "top-center", possiblePlacements: a = [
329
329
  "top-center",
330
330
  "left-center",
331
331
  "bottom-center",
@@ -341,7 +341,7 @@ const TooltipLayer = ({ text: e = "", error: t = !1, warning: n = !1, maxWidth:
341
341
  auto: !0,
342
342
  triggerOffset: l,
343
343
  placement: r,
344
- possiblePlacements: i,
344
+ possiblePlacements: a,
345
345
  onParentClose: v
346
346
  });
347
347
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [y && b(/* @__PURE__ */ jsx(TooltipLayer, {
@@ -385,15 +385,15 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
385
385
  maxWidth: i,
386
386
  children: /* @__PURE__ */ jsx(Icon, { icon: n })
387
387
  })
388
- }), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: s = "", disabled: u = !1, small: d = !1, onChange: f, testId: p, value: h, helpText: g, onClickHelp: v }) => {
389
- let y = useContext(DisabledContext), b = g || v, x = u || y, S = useRef(null);
388
+ }), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: l = "", disabled: u = !1, small: d = !1, onChange: f, testId: m, value: h, helpText: _, onClickHelp: v, textTransform: y = TextTransform.CAPITALIZE }) => {
389
+ let b = useContext(DisabledContext), x = _ || v, S = u || b, C = useRef(null);
390
390
  return useEffect(() => {
391
- S.current && (S.current.indeterminate = a);
391
+ C.current && (C.current.indeterminate = a);
392
392
  }, [a]), /* @__PURE__ */ jsxs("div", {
393
- className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable, x && check_box_module_default.disabled, d && check_box_module_default.small, !s && check_box_module_default.noLabel),
393
+ className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable, S && check_box_module_default.disabled, d && check_box_module_default.small, !l && check_box_module_default.noLabel),
394
394
  "data-ix": t,
395
395
  onClick: (e) => {
396
- if (!x) {
396
+ if (!S) {
397
397
  let t = e.target;
398
398
  t.name = o, t.checked = !i, f({
399
399
  ...e,
@@ -404,29 +404,30 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
404
404
  });
405
405
  }
406
406
  },
407
- "data-testid": p,
407
+ "data-testid": m,
408
408
  children: [
409
409
  /* @__PURE__ */ jsx("input", {
410
- ref: S,
410
+ ref: C,
411
411
  type: "checkbox",
412
412
  tabIndex: r,
413
413
  checked: i,
414
414
  name: o,
415
415
  onChange: () => {},
416
- disabled: x,
416
+ disabled: S,
417
417
  "data-indeterminate": a
418
418
  }),
419
419
  /* @__PURE__ */ jsxs("label", {
420
420
  htmlFor: o,
421
+ style: { textTransform: y },
421
422
  children: [/* @__PURE__ */ jsx("span", {
422
423
  className: check_box_module_default.checkmark,
423
424
  children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
424
- }), s]
425
+ }), l]
425
426
  }),
426
- b && /* @__PURE__ */ jsx("div", {
427
+ x && /* @__PURE__ */ jsx("div", {
427
428
  className: check_box_module_default.helpIconEnabled,
428
429
  onClick: v,
429
- children: /* @__PURE__ */ jsx(HelpIcon, { text: g })
430
+ children: /* @__PURE__ */ jsx(HelpIcon, { text: _ })
430
431
  })
431
432
  ]
432
433
  });
@@ -526,7 +527,7 @@ var ButtonTooltipWrapper = ({ children: e, tooltip: t = null }) => t ? /* @__PUR
526
527
  display: "inline-flex",
527
528
  children: e
528
529
  }) : /* @__PURE__ */ jsx(Fragment$1, { children: e });
529
- const Button = ({ active: e = !1, basic: t = !1, colored: n = !1, disabled: r = !1, ignoreDisabledContext: i = !1, groupOrder: a, icon: o = null, label: s = "", loading: l = !1, name: u, pill: d = !1, round: f = !1, small: p = !1, styles: m = "", width: h = "", title: g = "", type: v = ButtonType.BUTTON, onClick: y = () => {}, error: b, warning: x, testId: S, tooltip: C, inverted: w = !1, component: T = "button", url: E, tabIndex: D }) => {
530
+ const Button = ({ active: e = !1, basic: t = !1, colored: n = !1, disabled: r = !1, ignoreDisabledContext: i = !1, groupOrder: a, icon: o = null, label: c = "", loading: l = !1, name: u, pill: d = !1, round: f = !1, small: p = !1, styles: m = "", width: h = "", title: _ = "", type: v = ButtonType.BUTTON, onClick: y = () => {}, error: b, warning: x, testId: S, tooltip: C, inverted: w = !1, component: T = "button", url: E, tabIndex: D }) => {
530
531
  let O = useContext(DisabledContext), k = (() => {
531
532
  if (n) switch (n) {
532
533
  case Color.DANGER:
@@ -549,11 +550,11 @@ const Button = ({ active: e = !1, basic: t = !1, colored: n = !1, disabled: r =
549
550
  tooltip: C,
550
551
  children: /* @__PURE__ */ jsxs(T, {
551
552
  type: v === ButtonType.SUBMIT ? ButtonType.SUBMIT : ButtonType.BUTTON,
552
- className: cx(button_module_default.button, e ? button_module_default.active : "", t ? button_module_default.basic : "", k, j ? button_module_default.disabled : "", (o || l) && !s ? button_module_default.iconOnly : "", w ? button_module_default.inverted : "", A, d ? button_module_default.pill : "", f ? button_module_default.round : "", p ? button_module_default.small : "", m),
553
+ className: cx(button_module_default.button, e ? button_module_default.active : "", t ? button_module_default.basic : "", k, j ? button_module_default.disabled : "", (o || l) && !c ? button_module_default.iconOnly : "", w ? button_module_default.inverted : "", A, d ? button_module_default.pill : "", f ? button_module_default.round : "", p ? button_module_default.small : "", m),
553
554
  disabled: j,
554
555
  name: u ?? "",
555
556
  onClick: y,
556
- ...g ? { title: g } : {},
557
+ ..._ ? { title: _ } : {},
557
558
  style: { width: h },
558
559
  "data-error": b || null,
559
560
  "data-warning": x || null,
@@ -574,7 +575,7 @@ const Button = ({ active: e = !1, basic: t = !1, colored: n = !1, disabled: r =
574
575
  colored: t
575
576
  })
576
577
  }),
577
- s
578
+ c
578
579
  ]
579
580
  })
580
581
  });
@@ -624,7 +625,7 @@ const Heading$3 = ({ label: e, onClick: t, icon: n, testId: r }) => /* @__PURE__
624
625
  onClick: t,
625
626
  children: /* @__PURE__ */ jsx(Icon, { icon: n })
626
627
  })]
627
- }), Divider$1 = () => /* @__PURE__ */ jsx("hr", { className: menu_module_default.divider }), Option$2 = ({ actions: e, label: t, url: n, onClick: r, description: i, icon: a, selected: o, closeOnOptionClick: s, close: c, disabled: l, inline: u, title: d, upload: f, uploadType: p, onChange: m = noop, testId: h, component: g = "a" }) => {
628
+ }), Divider$1 = () => /* @__PURE__ */ jsx("hr", { className: menu_module_default.divider }), Option$2 = ({ actions: e, label: t, url: n, onClick: r, description: i, icon: a, selected: o, closeOnOptionClick: s, close: c, disabled: l, inline: u, title: d, upload: f, uploadType: p, onChange: m = noop, testId: h, component: _ = "a" }) => {
628
629
  let v = (e) => {
629
630
  if (e.stopPropagation(), l) {
630
631
  e.preventDefault();
@@ -646,7 +647,7 @@ const Heading$3 = ({ label: e, onClick: t, icon: n, testId: r }) => /* @__PURE__
646
647
  m?.(n), c?.();
647
648
  }
648
649
  };
649
- return /* @__PURE__ */ jsxs(g, {
650
+ return /* @__PURE__ */ jsxs(_, {
650
651
  href: n,
651
652
  to: n,
652
653
  className: cx(menu_module_default.option, l ? menu_module_default.disabled : "", u ? menu_module_default.inline : "", o ? menu_module_default?.selected : ""),
@@ -740,13 +741,13 @@ const Section$1 = ({ section: e, closeOnOptionClick: t, close: n, tree: r, path:
740
741
  });
741
742
  default: return null;
742
743
  }
743
- }, parentPath = (e) => e.includes("[") ? e.substr(0, e.lastIndexOf("[")) : e, childPath = (e, t) => `${e}.sections[${t}]`.replace(/^\./, ""), closePath = (e) => `${e}.close`.replace(/^\./, ""), siblings = (e, t) => get(e, parentPath(t), []), registerClose = (e, t, n) => set(e, closePath(t), n), Layer$2 = ({ sections: e, isNested: t, width: n, closeOnOptionClick: r, close: i = () => {}, tree: o, path: s, maxHeight: c, showAllButton: l, testId: u }) => {
744
+ }, parentPath = (e) => e.includes("[") ? e.substr(0, e.lastIndexOf("[")) : e, childPath = (e, t) => `${e}.sections[${t}]`.replace(/^\./, ""), closePath = (e) => `${e}.close`.replace(/^\./, ""), siblings = (e, t) => get(e, parentPath(t), []), registerClose = (e, t, n) => set(e, closePath(t), n), Layer$2 = ({ sections: e, isNested: t, width: n, closeOnOptionClick: r, close: a = () => {}, tree: o, path: s, maxHeight: c, showAllButton: l, testId: u }) => {
744
745
  if (isValidElement(e)) return /* @__PURE__ */ jsx(Fragment$1, { children: e });
745
- let [d, f] = useState(!l?.visible), p = e, m = l?.additionalSections?.map((e) => ({
746
+ let [d, f] = useState(!l?.visible), p = e, h = l?.additionalSections?.map((e) => ({
746
747
  ...e,
747
748
  closeOnOptionClick: r,
748
749
  visible: !0
749
- })) ?? [], g = p.length > 4 ? [{
750
+ })) ?? [], _ = p.length > 4 ? [{
750
751
  type: MenuType.OPTION,
751
752
  label: d ? l?.showLessTitle || "Show less" : l?.showAllTitle || "Show all",
752
753
  onClick: () => f(!d),
@@ -756,7 +757,7 @@ const Section$1 = ({ section: e, closeOnOptionClick: t, close: n, tree: r, path:
756
757
  ...e,
757
758
  visible: !0,
758
759
  closeOnOptionClick: r
759
- } : e).concat(g, m).filter((e) => e?.visible) : p.map((e) => ({
760
+ } : e).concat(_, h).filter((e) => e?.visible) : p.map((e) => ({
760
761
  ...e,
761
762
  closeOnOptionClick: r
762
763
  }));
@@ -770,7 +771,7 @@ const Section$1 = ({ section: e, closeOnOptionClick: t, close: n, tree: r, path:
770
771
  children: /* @__PURE__ */ jsx("ul", { children: v.map((e, t) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Section$1, {
771
772
  section: e,
772
773
  closeOnOptionClick: e.closeOnOptionClick,
773
- close: i,
774
+ close: a,
774
775
  tree: o,
775
776
  path: childPath(s, t),
776
777
  maxHeight: c
@@ -808,7 +809,7 @@ const Badge = ({ children: e, color: t = "", title: n = null, dot: r = !1, margi
808
809
  children: n
809
810
  }), e]
810
811
  });
811
- }, Button$1 = ({ trigger: e, label: t, colored: n, small: r, width: i, disabled: a, groupOrder: o, loading: s, error: l, warning: u, active: d, tabIndex: f }) => {
812
+ }, Button$1 = ({ trigger: e, label: t, colored: n, small: r, width: i, disabled: a, groupOrder: o, loading: c, error: l, warning: u, active: d, tabIndex: f }) => {
812
813
  let p = useContext(DisabledContext), m = e === TriggerType.BUTTON ? t : e === TriggerType.DROP_DOWN_BUTTON ? /* @__PURE__ */ jsxs("span", {
813
814
  className: menu_module_default.middleAlignedInline,
814
815
  children: [/* @__PURE__ */ jsx("span", {
@@ -829,7 +830,7 @@ const Badge = ({ children: e, color: t = "", title: n = null, dot: r = !1, margi
829
830
  width: i,
830
831
  groupOrder: o,
831
832
  onClick: () => {},
832
- loading: s,
833
+ loading: c,
833
834
  disabled: a,
834
835
  error: l,
835
836
  warning: u,
@@ -943,7 +944,7 @@ var isMenuEmpty = (e) => {
943
944
  testId: d && `${d}-layer`
944
945
  })
945
946
  })), m];
946
- }, ContextMenu = ({ menu: e, width: t, disabled: n = !1, closeOnOptionClick: r = !0, closeParent: i, tree: a, path: o, groupOrder: s, testId: l }) => {
947
+ }, ContextMenu = ({ menu: e, width: t, disabled: n = !1, closeOnOptionClick: r = !0, closeParent: i, tree: a, path: o, groupOrder: c, testId: l }) => {
947
948
  let u = useContext(DisabledContext), { label: d, trigger: f, fullHeightTrigger: p, colored: m, small: h, component: g, placement: _, possiblePlacements: v = ["bottom-start", "top-start"] } = e, [y, b] = useContextMenu({
948
949
  sections: e.sections,
949
950
  width: t,
@@ -953,7 +954,7 @@ var isMenuEmpty = (e) => {
953
954
  closeParent: i,
954
955
  tree: a,
955
956
  path: o,
956
- groupOrder: s,
957
+ groupOrder: c,
957
958
  overflowContainer: !0,
958
959
  maxHeight: void 0,
959
960
  testId: l
@@ -973,11 +974,11 @@ var isMenuEmpty = (e) => {
973
974
  isNested: !0,
974
975
  component: g,
975
976
  contextMenu: !0,
976
- groupOrder: s
977
+ groupOrder: c
977
978
  }), y]
978
979
  });
979
980
  };
980
- const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badgeDot: i = !1, loading: a = !1, isNested: o = !1, closeOnOptionClick: s = !0, closeParent: l, tree: u, path: d, groupOrder: f, overflowContainer: p = !0, maxHeight: m, testId: g, open: _, setOpen: v, tooltip: y, error: b, warning: x, selected: S, tabIndex: C, active: w }) => {
981
+ const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badgeDot: i = !1, loading: a = !1, isNested: o = !1, closeOnOptionClick: c = !0, closeParent: l, tree: u, path: d, groupOrder: f, overflowContainer: p = !0, maxHeight: h, testId: g, open: _, setOpen: v, tooltip: y, error: b, warning: x, selected: S, tabIndex: C, active: w }) => {
981
982
  let T = useContext(DisabledContext), { label: E, title: D, trigger: O, fullHeightTrigger: k, colored: A, small: j, sections: M, component: N, placement: P, showAllButton: F, possiblePlacements: I = ["bottom-start", "top-start"] } = e, [L, R] = isBoolean(_) && isFunction(v) ? [_, v] : useState(!1), z = () => R(!1), B = () => R(!0), { triggerProps: V, layerProps: H, renderLayer: U } = useLayer({
982
983
  isOpen: L,
983
984
  ...placementOptions$1(P, o),
@@ -1031,11 +1032,11 @@ const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badg
1031
1032
  sections: M,
1032
1033
  isNested: o,
1033
1034
  width: t,
1034
- closeOnOptionClick: s,
1035
+ closeOnOptionClick: c,
1035
1036
  close: l || z,
1036
1037
  tree: u,
1037
1038
  path: d,
1038
- maxHeight: m,
1039
+ maxHeight: h,
1039
1040
  showAllButton: F,
1040
1041
  testId: g && `${g}-layer`
1041
1042
  })
@@ -1124,15 +1125,15 @@ var breadcrumb_module_default = {
1124
1125
  let BreadcrumbLinkType = /* @__PURE__ */ function(e) {
1125
1126
  return e.LABEL = "label", e.LINK = "link", e.CUSTOM = "custom", e;
1126
1127
  }({});
1127
- const Link$2 = ({ type: e = BreadcrumbLinkType.LABEL, label: t, url: n, onClick: r, active: i, disabled: o, element: s }) => {
1128
- let l = useContext(DisabledContext), u = e === BreadcrumbLinkType.LINK && n !== void 0, d = e === BreadcrumbLinkType.CUSTOM && isValidElement(s);
1128
+ const Link$2 = ({ type: e = BreadcrumbLinkType.LABEL, label: t, url: n, onClick: r, active: a, disabled: o, element: c }) => {
1129
+ let l = useContext(DisabledContext), u = e === BreadcrumbLinkType.LINK && n !== void 0, d = e === BreadcrumbLinkType.CUSTOM && isValidElement(c);
1129
1130
  return /* @__PURE__ */ jsx("span", {
1130
1131
  onClick: r,
1131
- className: cx(breadcrumb_module_default.labelContainer, i && breadcrumb_module_default.active, (o || l) && breadcrumb_module_default.disabled),
1132
+ className: cx(breadcrumb_module_default.labelContainer, a && breadcrumb_module_default.active, (o || l) && breadcrumb_module_default.disabled),
1132
1133
  children: u ? /* @__PURE__ */ jsx("a", {
1133
1134
  href: n,
1134
1135
  children: t
1135
- }) : d ? s : t
1136
+ }) : d ? c : t
1136
1137
  });
1137
1138
  }, Breadcrumb = ({ links: e, small: t = !1 }) => /* @__PURE__ */ jsx("div", {
1138
1139
  className: cx(breadcrumb_module_default.breadcrumb, t && breadcrumb_module_default.small),
@@ -1157,7 +1158,7 @@ var button_group_module_default = {
1157
1158
  buttonGroup: "_buttonGroup_iu2wi_11"
1158
1159
  };
1159
1160
  const ButtonGroup = (e) => {
1160
- let { basic: t = !1, items: n = [], header: r = "", onSelected: i = () => {}, small: a = !1, value: o = "", testId: s = void 0, disabled: l } = e, u = useContext(DisabledContext), d = (e, t, n, r, a) => {
1161
+ let { basic: t = !1, items: n = [], header: r = "", onSelected: i = () => {}, small: a = !1, value: o = "", testId: c = void 0, disabled: l } = e, u = useContext(DisabledContext), d = (e, t, n, r, a) => {
1161
1162
  e.preventDefault(), e.stopPropagation(), !(l || a || u) && i(t, n, r);
1162
1163
  }, f = (e, t) => t === "string" ? e : t === "object" ? e.label : t === "array" ? e[1] : null, p = (e, t) => t === "string" ? e : t === "object" ? e.value ?? "" : t === "array" ? e[0] ?? "" : "", m = (e, t, n) => t === "object" && "key" in e ? e.key : n, h = (e, t) => t === "object" ? e.hidden : !1, g = (e, t) => t === "object" ? e.icon : void 0, _ = (e, t, n) => e === "object" ? String(t) === String(o) : n === o, v = () => {
1163
1164
  if (r) return /* @__PURE__ */ jsx("label", {
@@ -1190,7 +1191,7 @@ const ButtonGroup = (e) => {
1190
1191
  });
1191
1192
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { children: [v(), /* @__PURE__ */ jsx("div", {
1192
1193
  className: button_group_module_default.buttonGroup,
1193
- "data-testid": s,
1194
+ "data-testid": c,
1194
1195
  children: y()
1195
1196
  })] }) });
1196
1197
  };
@@ -1493,16 +1494,16 @@ const DrawerResizeWrapper = ({ children: e = null, width: t = 400, right: n = !1
1493
1494
  },
1494
1495
  children: e
1495
1496
  }) : /* @__PURE__ */ jsx(Fragment$1, { children: e });
1496
- }, Drawer = ({ background: e = "var(--color-background-raised)", fixed: t = !1, open: n = !1, setOpen: r, right: i = !1, width: o = 400, closedWidth: s = 0, shadow: c = !1, top: l = 0, button: u = null, buttonAnimate: d = !0, buttonPosition: f = ButtonPosition.BOTTOM, border: p = !1, children: m = null, tabs: g, defaultTabIndex: v = 0, activeTab: y, setActiveTab: b, testId: x, onResize: S, getActiveTab: C, onClose: w, onOpen: T, maxOpenWidth: E }) => {
1497
- let D = u === !0, O = !D && isValidElement(u), [k, A] = r ? [n, r] : D || g ? useState(n) : [n, () => {}], [j, M] = useState(v), N = r ? n : k, P = r || A, F = b === void 0 ? j : y, I = b || M, L = Array.isArray(o) ? o[F || 0] : o, R = N ? L : g ? 35 : s;
1497
+ }, Drawer = ({ background: e = "var(--color-background-raised)", fixed: t = !1, open: n = !1, setOpen: r, right: a = !1, width: o = 400, closedWidth: s = 0, shadow: c = !1, top: l = 0, button: u = null, buttonAnimate: d = !0, buttonPosition: f = ButtonPosition.BOTTOM, border: p = !1, children: h = null, tabs: _, defaultTabIndex: v = 0, activeTab: y, setActiveTab: b, testId: x, onResize: S, getActiveTab: C, onClose: w, onOpen: T, maxOpenWidth: E }) => {
1498
+ let D = u === !0, O = !D && isValidElement(u), [k, A] = r ? [n, r] : D || _ ? useState(n) : [n, () => {}], [j, M] = useState(v), N = r ? n : k, P = r || A, F = b === void 0 ? j : y, I = b || M, L = Array.isArray(o) ? o[F || 0] : o, R = N ? L : _ ? 35 : s;
1498
1499
  return /* @__PURE__ */ jsx(DrawerResizeWrapper, {
1499
1500
  width: R,
1500
1501
  onResize: S,
1501
1502
  setOpen: P,
1502
- right: i,
1503
+ right: a,
1503
1504
  maxOpenWidth: E,
1504
1505
  children: /* @__PURE__ */ jsxs("div", {
1505
- className: cx(drawer_module_default.drawer, c ? drawer_module_default.shadow : "", t ? drawer_module_default.fixed : drawer_module_default.inline, i ? drawer_module_default.right : drawer_module_default.left),
1506
+ className: cx(drawer_module_default.drawer, c ? drawer_module_default.shadow : "", t ? drawer_module_default.fixed : drawer_module_default.inline, a ? drawer_module_default.right : drawer_module_default.left),
1506
1507
  style: { top: l },
1507
1508
  children: [/* @__PURE__ */ jsx("div", {
1508
1509
  className: cx(drawer_module_default.drawerContent, p && drawer_module_default.border),
@@ -1511,16 +1512,16 @@ const DrawerResizeWrapper = ({ children: e = null, width: t = 400, right: n = !1
1511
1512
  borderColor: typeof p == "string" ? p : void 0,
1512
1513
  width: R
1513
1514
  },
1514
- children: g ? /* @__PURE__ */ jsx(DrawerTabs, {
1515
+ children: _ ? /* @__PURE__ */ jsx(DrawerTabs, {
1515
1516
  width: L,
1516
1517
  testId: x,
1517
- tabs: g,
1518
+ tabs: _,
1518
1519
  open: N,
1519
1520
  activeTab: F || 0,
1520
1521
  background: e,
1521
1522
  handleTabClick: (e) => {
1522
1523
  let t = (t) => {
1523
- g && t && t(g[e]);
1524
+ _ && t && t(_[e]);
1524
1525
  };
1525
1526
  F === e && N && P ? (t(w), P(!1)) : !N && P && (t(T), P(!0), S && ((e) => {
1526
1527
  let t;
@@ -1533,21 +1534,21 @@ const DrawerResizeWrapper = ({ children: e = null, width: t = 400, right: n = !1
1533
1534
  }
1534
1535
  }) : /* @__PURE__ */ jsx("div", {
1535
1536
  style: { width: L },
1536
- children: m
1537
+ children: h
1537
1538
  })
1538
1539
  }), u && /* @__PURE__ */ jsx("span", {
1539
1540
  className: cx(drawer_module_default.toggleButton, k && (D || O && d) ? drawer_module_default.toggleButtonOpen : "", f === "top" ? drawer_module_default.top : drawer_module_default.bottom),
1540
1541
  children: O ? u : /* @__PURE__ */ jsx(Button, {
1541
1542
  onClick: P ? () => P(!N) : void 0,
1542
1543
  round: !0,
1543
- icon: i ? IconType.CHEVRON_RIGHT : IconType.CHEVRON_LEFT
1544
+ icon: a ? IconType.CHEVRON_RIGHT : IconType.CHEVRON_LEFT
1544
1545
  })
1545
1546
  })]
1546
1547
  })
1547
1548
  });
1548
1549
  };
1549
1550
  var input_group_module_default = { inputGroup: "_inputGroup_biuoa_1" }, isDOMTypeElement = (e) => isValidElement(e) && typeof e.type == "string";
1550
- const InputGroup = ({ children: n, small: r = !1, width: i = "100%" }) => {
1551
+ const InputGroup = ({ children: n, small: r = !1, width: a = "100%" }) => {
1551
1552
  let o = Array.isArray(n) ? n.filter((e) => isValidElement(e)) : [n], s = o.map((n, i) => {
1552
1553
  let a = isDOMTypeElement(n), { groupOrder: s } = a ? { groupOrder: null } : n.props, c = o.length, l = i === 0, u = i === c - 1, d = s || (!c || c === 1 ? null : l ? GroupOrder.FIRST : u ? GroupOrder.LAST : GroupOrder.MIDDLE);
1553
1554
  return a ? n : /* @__PURE__ */ jsx(Fragment, { children: React.cloneElement(n, {
@@ -1557,27 +1558,27 @@ const InputGroup = ({ children: n, small: r = !1, width: i = "100%" }) => {
1557
1558
  });
1558
1559
  return /* @__PURE__ */ jsx("div", {
1559
1560
  className: cx(input_group_module_default.inputGroup),
1560
- style: { width: i },
1561
+ style: { width: a },
1561
1562
  children: s
1562
1563
  });
1563
1564
  };
1564
1565
  var input_module_default = {
1565
- inputInTable: "_inputInTable_180g1_1",
1566
- inputHover: "_inputHover_180g1_13",
1567
- inputFocus: "_inputFocus_180g1_18",
1568
- inputError: "_inputError_180g1_25",
1569
- inputWarning: "_inputWarning_180g1_26",
1570
- inputDisabled: "_inputDisabled_180g1_61",
1571
- hideScrollbars: "_hideScrollbars_180g1_67",
1572
- input: "_input_180g1_1",
1573
- isInTable: "_isInTable_180g1_100",
1574
- small: "_small_180g1_129",
1575
- right: "_right_180g1_175",
1576
- groupOrderFirst: "_groupOrderFirst_180g1_178",
1577
- groupOrderMiddle: "_groupOrderMiddle_180g1_179",
1578
- groupOrderLast: "_groupOrderLast_180g1_180"
1566
+ inputInTable: "_inputInTable_1285q_1",
1567
+ inputHover: "_inputHover_1285q_13",
1568
+ inputFocus: "_inputFocus_1285q_18",
1569
+ inputError: "_inputError_1285q_25",
1570
+ inputWarning: "_inputWarning_1285q_26",
1571
+ inputDisabled: "_inputDisabled_1285q_61",
1572
+ hideScrollbars: "_hideScrollbars_1285q_67",
1573
+ input: "_input_1285q_1",
1574
+ isInTable: "_isInTable_1285q_100",
1575
+ small: "_small_1285q_124",
1576
+ right: "_right_1285q_170",
1577
+ groupOrderFirst: "_groupOrderFirst_1285q_173",
1578
+ groupOrderMiddle: "_groupOrderMiddle_1285q_174",
1579
+ groupOrderLast: "_groupOrderLast_1285q_175"
1579
1580
  };
1580
- const Input = forwardRef(({ error: e = null, tooltip: t = null, isInTable: n, width: r = void 0, small: i = !1, onChange: a = noop, placeholder: o = "", value: s = "", onKeyPress: l = () => {}, onFocus: u = () => {}, onBlur: d = () => {}, onPaste: f = () => {}, onKeyDown: p = () => {}, selectOnFocus: m = !0, name: h = void 0, type: g = "text", tabIndex: v = 0, disabled: y = !1, right: b = !1, warning: x = null, groupOrder: S = null, maxTooltipWidth: C = void 0, testId: w = void 0, size: T = null }, E) => {
1581
+ const Input = forwardRef(({ error: e = null, tooltip: t = null, isInTable: n, width: r = void 0, small: i = !1, onChange: a = noop, placeholder: o = "", value: c = "", onKeyPress: l = () => {}, onFocus: u = () => {}, onBlur: d = () => {}, onPaste: f = () => {}, onKeyDown: p = () => {}, selectOnFocus: m = !0, name: h = void 0, type: _ = "text", tabIndex: v = 0, disabled: y = !1, right: b = !1, warning: x = null, groupOrder: S = null, maxTooltipWidth: C = void 0, testId: w = void 0, size: T = null }, E) => {
1581
1582
  let D = useContext(DisabledContext), O = (() => {
1582
1583
  if (S) switch (S) {
1583
1584
  case GroupOrder.FIRST: return input_module_default.groupOrderFirst;
@@ -1598,10 +1599,10 @@ const Input = forwardRef(({ error: e = null, tooltip: t = null, isInTable: n, wi
1598
1599
  display: "block",
1599
1600
  children: /* @__PURE__ */ jsx("input", {
1600
1601
  ref: E,
1601
- type: g || "text",
1602
+ type: _ || "text",
1602
1603
  size: T || 20,
1603
1604
  placeholder: o ?? "",
1604
- value: s ?? "",
1605
+ value: c ?? "",
1605
1606
  onChange: a,
1606
1607
  onKeyPress: l,
1607
1608
  onKeyDown: p,
@@ -1620,8 +1621,7 @@ const Input = forwardRef(({ error: e = null, tooltip: t = null, isInTable: n, wi
1620
1621
  style: { width: k },
1621
1622
  "data-error": e || null,
1622
1623
  "data-warning": x || null,
1623
- "data-testid": w,
1624
- onDragStart: (e) => e.preventDefault()
1624
+ "data-testid": w
1625
1625
  })
1626
1626
  })
1627
1627
  });
@@ -1647,11 +1647,11 @@ var getName = (e, t) => {
1647
1647
  let n;
1648
1648
  return e ? (n = t ? `Selected - ${Object.keys(e)?.length} files` : e?.name, n || null) : null;
1649
1649
  };
1650
- const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No file selected", disabled: r = !1, file: i, accept: a, multi: o, name: s, width: l, onChange: u = noop, testId: d }) => {
1651
- let f = useContext(DisabledContext), p = useRef(null), h = getName(i, o);
1650
+ const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No file selected", disabled: r = !1, file: i, accept: a, multi: o, name: c, width: l, onChange: u = noop, testId: d }) => {
1651
+ let f = useContext(DisabledContext), m = useRef(null), h = getName(i, o);
1652
1652
  return /* @__PURE__ */ jsxs("div", {
1653
1653
  onClick: () => {
1654
- r || f || p.current?.click();
1654
+ r || f || m.current?.click();
1655
1655
  },
1656
1656
  style: { width: l },
1657
1657
  children: [/* @__PURE__ */ jsxs(InputGroup, { children: [/* @__PURE__ */ jsx(Input, {
@@ -1664,8 +1664,8 @@ const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No
1664
1664
  disabled: t || r || f,
1665
1665
  groupOrder: "last"
1666
1666
  })] }), /* @__PURE__ */ jsx("input", {
1667
- name: s,
1668
- ref: p,
1667
+ name: c,
1668
+ ref: m,
1669
1669
  className: file_input_module_default.fileInput,
1670
1670
  type: "file",
1671
1671
  accept: a,
@@ -1679,7 +1679,7 @@ const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No
1679
1679
  name: e.target.name
1680
1680
  }
1681
1681
  };
1682
- u(r), p.current && (p.current.value = "");
1682
+ u(r), m.current && (m.current.value = "");
1683
1683
  },
1684
1684
  "data-testid": d
1685
1685
  })]
@@ -1782,7 +1782,7 @@ const ProgressBar = ({ width: e = "auto", inverted: t = !1, colored: n = !0, sho
1782
1782
  })
1783
1783
  });
1784
1784
  var REQUEST_TIME = 4e4;
1785
- const SmartUploadModal = ({ visible: e, prompt: t, onCloseModal: n, onUpload: r, onComplete: i, onFailed: a, onError: o, width: s, heading: c, dialogText: u, fileInputText: d, fileInputPlaceholder: f, uploadText: p, cancelText: m, testId: g }) => {
1785
+ const SmartUploadModal = ({ visible: e, prompt: t, onCloseModal: n, onUpload: r, onComplete: i, onFailed: a, onError: o, width: s, heading: l, dialogText: u, fileInputText: d, fileInputPlaceholder: f, uploadText: p, cancelText: h, testId: g }) => {
1786
1786
  let [_, v] = useState(null), [y, b] = useState(!1), [x, S] = useState(0), C = 0, w = () => {
1787
1787
  C += 250, S(C);
1788
1788
  }, T = (e) => {
@@ -1837,7 +1837,7 @@ const SmartUploadModal = ({ visible: e, prompt: t, onCloseModal: n, onUpload: r,
1837
1837
  disabled: !_ || y,
1838
1838
  testId: `${g}-button-upload`
1839
1839
  }), /* @__PURE__ */ jsx(Button, {
1840
- label: m || "Cancel",
1840
+ label: h || "Cancel",
1841
1841
  onClick: k,
1842
1842
  testId: `${g}-button-cancel`
1843
1843
  })] });
@@ -1846,7 +1846,7 @@ const SmartUploadModal = ({ visible: e, prompt: t, onCloseModal: n, onUpload: r,
1846
1846
  centered: !0,
1847
1847
  children: /* @__PURE__ */ jsx(Dialog, { dialog: {
1848
1848
  scroll: !0,
1849
- heading: c || "Smart Upload",
1849
+ heading: l || "Smart Upload",
1850
1850
  content: A,
1851
1851
  footer: j,
1852
1852
  onClose: k,
@@ -1987,12 +1987,12 @@ var reducer$1 = (e, t) => {
1987
1987
  }
1988
1988
  };
1989
1989
  const Message = ({ message: e }) => {
1990
- let { visible: t, type: n = MessageType.INFO, icon: r, heading: i, content: a, details: o, detailsVisible: s = !1, footer: c, withDismiss: l, onClose: u, width: d, maxHeight: f } = e, [m, h] = useReducer(reducer$1, { detailsVisible: s });
1990
+ let { visible: t, type: n = MessageType.INFO, icon: r, heading: i, content: a, details: o, detailsVisible: s = !1, footer: c, withDismiss: l, onClose: u, width: d, maxHeight: p } = e, [m, h] = useReducer(reducer$1, { detailsVisible: s });
1991
1991
  return /* @__PURE__ */ jsx(Fragment$1, { children: t ? /* @__PURE__ */ jsxs("div", {
1992
1992
  className: cx(message_module_default.container, d ? message_module_default.block : null, n === MessageType.SUCCESS ? message_module_default.success : n === MessageType.WARNING ? message_module_default.warning : n === MessageType.ERROR ? message_module_default.error : message_module_default.info),
1993
1993
  style: {
1994
1994
  width: d,
1995
- maxHeight: f
1995
+ maxHeight: p
1996
1996
  },
1997
1997
  children: [
1998
1998
  /* @__PURE__ */ jsx("div", { children: r ? /* @__PURE__ */ jsx("div", {
@@ -2077,7 +2077,7 @@ var footer_module_default = {
2077
2077
  groupOrderMiddle: "_groupOrderMiddle_sl2b5_194",
2078
2078
  groupOrderLast: "_groupOrderLast_sl2b5_198"
2079
2079
  };
2080
- const NativeSelect = ({ disabled: e = !1, error: t = null, warning: n = null, tooltip: r = null, options: i, onChange: a = noop, onFocus: o = noop, onBlur: s = noop, right: l = !1, small: u = !1, tabIndex: d = 0, selectedOption: f, width: p = null, groupOrder: m, testId: h, isInTable: g = !1, clearable: v, placeholder: y, hasNonExistentValue: b, maxTooltipWidth: x, borderRadius: S }) => {
2080
+ const NativeSelect = ({ disabled: e = !1, error: t = null, warning: n = null, tooltip: r = null, options: i, onChange: a = noop, onFocus: o = noop, onBlur: c = noop, right: l = !1, small: u = !1, tabIndex: d = 0, selectedOption: f, width: p = null, groupOrder: m, testId: h, isInTable: _ = !1, clearable: v, placeholder: y, hasNonExistentValue: b, maxTooltipWidth: x, borderRadius: S }) => {
2081
2081
  let C = useContext(DisabledContext), w = f === null || f?.value === null ? "unselected" : f?.value, T = w === "unselected", E = (w === "unselected" || v ? [/* @__PURE__ */ jsx("option", {
2082
2082
  value: "unselected",
2083
2083
  disabled: !v,
@@ -2106,7 +2106,7 @@ const NativeSelect = ({ disabled: e = !1, error: t = null, warning: n = null, to
2106
2106
  enabled: r && isStringNumberOrNode(r) || t && isStringNumberOrNode(t) || n && isStringNumberOrNode(n) || !1,
2107
2107
  maxWidth: x,
2108
2108
  children: /* @__PURE__ */ jsx("select", {
2109
- className: cx(native_select_module_default.select, T ? native_select_module_default.unSelected : "", l ? native_select_module_default.right : "", u ? native_select_module_default.small : "", g ? native_select_module_default.isInTable : "", D),
2109
+ className: cx(native_select_module_default.select, T ? native_select_module_default.unSelected : "", l ? native_select_module_default.right : "", u ? native_select_module_default.small : "", _ ? native_select_module_default.isInTable : "", D),
2110
2110
  style: {
2111
2111
  width: p || "",
2112
2112
  borderRadius: S || ""
@@ -2116,7 +2116,7 @@ const NativeSelect = ({ disabled: e = !1, error: t = null, warning: n = null, to
2116
2116
  n = t === "unselected" ? { value: null } : i.find((e) => String(e.value) === String(t)) || { value: null }, a(e, n);
2117
2117
  },
2118
2118
  onFocus: o,
2119
- onBlur: s,
2119
+ onBlur: c,
2120
2120
  tabIndex: d,
2121
2121
  value: w,
2122
2122
  disabled: e || C,
@@ -2239,10 +2239,10 @@ const getWidestOptionWidth = (e, t, n, r) => {
2239
2239
  return Math.ceil(i + a);
2240
2240
  };
2241
2241
  var List$1 = FixedSizeList;
2242
- const Layer$1 = ({ listRef: e, isMulti: t, sections: n, selectedOptions: r, onSelectOption: i, focusedOptionIndex: a, width: o, small: s, firstSelectedOptionIndex: c, closeLayer: u, testId: d }) => {
2242
+ const Layer$1 = ({ listRef: e, isMulti: t, sections: n, selectedOptions: r, onSelectOption: i, focusedOptionIndex: a, width: o, small: s, firstSelectedOptionIndex: l, closeLayer: u, testId: d }) => {
2243
2243
  useEffect(() => {
2244
- c != null && e.current !== null && typeof e.current.scrollToItem == "function" && e.current.scrollToItem(c, "start");
2245
- }, [c, e]);
2244
+ l != null && e.current !== null && typeof e.current.scrollToItem == "function" && e.current.scrollToItem(l, "start");
2245
+ }, [l, e]);
2246
2246
  let f = s ? 24 : 30;
2247
2247
  return /* @__PURE__ */ jsx("div", {
2248
2248
  "data-testid": d,
@@ -2302,12 +2302,12 @@ var trigger_module_default = {
2302
2302
  detailedLabel: "_detailedLabel_7uwhv_307"
2303
2303
  };
2304
2304
  const MultiSelectedOptions = ({ selectedOptions: e, small: t, width: n, testId: r }) => {
2305
- let i = useFontsReady(), [a, o] = useState([]), [s, c] = useState([]);
2305
+ let i = useFontsReady(), [a, o] = useState([]), [s, l] = useState([]);
2306
2306
  return useEffect(() => {
2307
2307
  let r = [], a = [], s = 0;
2308
2308
  e.forEach((o, c) => {
2309
2309
  s += getMultiOptionWidth(o, t, i), c === e.length - 1 && s < n || s < n - 24 ? r.push(o) : a.push(o);
2310
- }), o(r), c(a);
2310
+ }), o(r), l(a);
2311
2311
  }, [
2312
2312
  e,
2313
2313
  i,
@@ -2361,7 +2361,7 @@ const MultiSelectedOptions = ({ selectedOptions: e, small: t, width: n, testId:
2361
2361
  "data-testid": c && `${c}-input`
2362
2362
  }) : null]
2363
2363
  });
2364
- }, Trigger = ({ selectedOptions: e, searchValue: t, searchable: n, clearable: r, onClickTrigger: i, element: a, error: o, warning: s, tooltip: c, small: l, isInTable: u, disabled: d, onChangeSearch: f, onClickDeselect: p, onClickClear: m, tabIndex: h, isOpen: g, triggerRef: v, clearAllIsFocused: y, focusedSelectedOptionIndex: b, onFocus: x, onBlur: S, groupOrder: C, maxTooltipWidth: w, placeholder: T, right: E, testId: D }) => {
2364
+ }, Trigger = ({ selectedOptions: e, searchValue: t, searchable: n, clearable: r, onClickTrigger: i, element: a, error: o, warning: s, tooltip: c, small: l, isInTable: u, disabled: d, onChangeSearch: f, onClickDeselect: p, onClickClear: m, tabIndex: h, isOpen: _, triggerRef: v, clearAllIsFocused: y, focusedSelectedOptionIndex: b, onFocus: x, onBlur: S, groupOrder: C, maxTooltipWidth: w, placeholder: T, right: E, testId: D }) => {
2365
2365
  let [O, k] = useFocus(), A = Array.isArray(e) ? e.length > 0 && e[0]?.value : e?.value, j = r && A, M = (() => {
2366
2366
  if (C) switch (C) {
2367
2367
  case GroupOrder.FIRST: return trigger_module_default.groupOrderFirst;
@@ -2381,7 +2381,7 @@ const MultiSelectedOptions = ({ selectedOptions: e, small: t, width: n, testId:
2381
2381
  } : e, P = /* @__PURE__ */ jsxs(Fragment$1, { children: [a, /* @__PURE__ */ jsxs("div", {
2382
2382
  ref: v,
2383
2383
  tabIndex: h,
2384
- className: cx(trigger_module_default.trigger, g ? trigger_module_default.isOpen : "", d ? trigger_module_default.disabled : "", l ? trigger_module_default.small : "", u ? trigger_module_default.isInTable : "", E ? trigger_module_default.right : "", M),
2384
+ className: cx(trigger_module_default.trigger, _ ? trigger_module_default.isOpen : "", d ? trigger_module_default.disabled : "", l ? trigger_module_default.small : "", u ? trigger_module_default.isInTable : "", E ? trigger_module_default.right : "", M),
2385
2385
  onClick: (e) => {
2386
2386
  e.stopPropagation(), requestAnimationFrame(() => {
2387
2387
  i(e), typeof k == "function" && k();
@@ -2532,7 +2532,7 @@ let ActionTypes = /* @__PURE__ */ function(e) {
2532
2532
  }({}), EventKey = /* @__PURE__ */ function(e) {
2533
2533
  return e.RIGHT = "ArrowRight", e.LEFT = "ArrowLeft", e.UP = "ArrowUp", e.DOWN = "ArrowDown", e.ENTER = "Enter", e.ESC = "Escape", e.TAB = "Tab", e;
2534
2534
  }({});
2535
- const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFocus: r, disabled: i, disabledContext: a, onCreate: o, onChange: c, selectedOptions: u, width: d, small: f, isFontLoaded: p, placeholder: h, firstSelectedOptionIndex: g, createAble: _, listRef: v, autoLayerWidth: y }) => {
2535
+ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFocus: r, disabled: i, disabledContext: a, onCreate: s, onChange: l, selectedOptions: u, width: d, small: f, isFontLoaded: m, placeholder: h, firstSelectedOptionIndex: g, createAble: _, listRef: v, autoLayerWidth: y }) => {
2536
2536
  let b = () => {
2537
2537
  e.isLayerOpen && t({ type: ActionTypes.CLOSE_LAYER }), r();
2538
2538
  }, x = () => t({ type: ActionTypes.OPEN_LAYER }), S = useRef(!0);
@@ -2542,21 +2542,21 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2542
2542
  options: n
2543
2543
  });
2544
2544
  }, [n]);
2545
- let C = (e, s, l) => {
2545
+ let C = (e, o, c) => {
2546
2546
  if (!(i || a)) {
2547
- if (l && l(), s) {
2548
- if (s.createAble && o) o(s.value);
2549
- else if (!s.disabled) if (Array.isArray(u)) {
2550
- let t = u.some((e) => String(e.value) === String(s.value)) ? u.filter((e) => String(e.value) !== String(s.value)) : [...u, s];
2551
- c && c(e, t);
2552
- } else c && c(e, s);
2547
+ if (c && c(), o) {
2548
+ if (o.createAble && s) s(o.value);
2549
+ else if (!o.disabled) if (Array.isArray(u)) {
2550
+ let t = u.some((e) => String(e.value) === String(o.value)) ? u.filter((e) => String(e.value) !== String(o.value)) : [...u, o];
2551
+ l && l(e, t);
2552
+ } else l && l(e, o);
2553
2553
  }
2554
2554
  t({
2555
2555
  type: ActionTypes.CLEAR_SEARCH,
2556
2556
  options: n
2557
2557
  }), r();
2558
2558
  }
2559
- }, w = useCallback(() => d ? d === "auto" ? getWidestOptionWidth(n, f, p, h) : d : "100%", [n, p]), T = useCallback((e) => y ? Math.max(getWidestOptionWidth(n, f, p, h), e?.width) : e?.width, [n, p]), { renderLayer: E, layerProps: D, triggerProps: O, triggerBounds: k } = useLayer({
2559
+ }, w = useCallback(() => d ? d === "auto" ? getWidestOptionWidth(n, f, m, h) : d : "100%", [n, m]), T = useCallback((e) => y ? Math.max(getWidestOptionWidth(n, f, m, h), e?.width) : e?.width, [n, m]), { renderLayer: E, layerProps: D, triggerProps: O, triggerBounds: k } = useLayer({
2560
2560
  isOpen: e?.isLayerOpen ?? !1,
2561
2561
  overflowContainer: !0,
2562
2562
  ...placementOptions,
@@ -2584,10 +2584,10 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2584
2584
  }, [e.isLayerOpen]);
2585
2585
  let M = (e, t) => {
2586
2586
  let n = u instanceof Array ? u.filter((e) => e.value !== t.value) : null;
2587
- c && c(e, n);
2587
+ l && l(e, n);
2588
2588
  }, N = (e) => {
2589
2589
  let t = u instanceof Array ? [] : { value: null };
2590
- c && c(e, t);
2590
+ l && l(e, t);
2591
2591
  }, P = (e) => t({
2592
2592
  type: ActionTypes.ON_CHANGE_SEARCH,
2593
2593
  options: n,
@@ -2656,7 +2656,7 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2656
2656
  triggerBounds: k
2657
2657
  };
2658
2658
  }, CustomSelect = (e) => {
2659
- let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: s, onCreate: l = null, placeholder: u = "", small: d = !1, tabIndex: f = 0, onFocus: h = () => {}, onBlur: g = () => {}, searchable: _ = !0, clearable: v = !1, maxTooltipWidth: y, closeOnOptionActionClick: b, isInTable: x = !1, groupOrder: S, firstSelectedOptionIndex: C = 0, right: w = !1, testId: T = void 0 } = e, E = useContext(DisabledContext), D = l !== null, O = useRef(null), [k, A] = useFocus(), j = useFontsReady(), [M, N] = useReducer(reducer, {
2659
+ let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: c, onCreate: l = null, placeholder: u = "", small: d = !1, tabIndex: m = 0, onFocus: h = () => {}, onBlur: g = () => {}, searchable: _ = !0, clearable: v = !1, maxTooltipWidth: y, closeOnOptionActionClick: b, isInTable: x = !1, groupOrder: S, firstSelectedOptionIndex: C = 0, right: w = !1, testId: T = void 0 } = e, E = useContext(DisabledContext), D = l !== null, O = useRef(null), [k, A] = useFocus(), j = useFontsReady(), [M, N] = useReducer(reducer, {
2660
2660
  options: o,
2661
2661
  firstSelectedOptionIndex: C
2662
2662
  }, ({ options: e }) => ({
@@ -2681,7 +2681,7 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2681
2681
  Object.values(EventKey).includes(e.key) && F(e.key, e);
2682
2682
  },
2683
2683
  children: [/* @__PURE__ */ jsx(Trigger, {
2684
- selectedOptions: s,
2684
+ selectedOptions: c,
2685
2685
  searchValue: M.searchValue,
2686
2686
  isOpen: M.isLayerOpen,
2687
2687
  focusedSelectedOptionIndex: M.triggerFocus.currentOption,
@@ -2695,7 +2695,7 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2695
2695
  isInTable: x,
2696
2696
  disabled: n || E,
2697
2697
  clearable: v,
2698
- tabIndex: f,
2698
+ tabIndex: m,
2699
2699
  onClickTrigger: R,
2700
2700
  onChangeSearch: z,
2701
2701
  onClickDeselect: B,
@@ -2714,7 +2714,7 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2714
2714
  listRef: O,
2715
2715
  isMulti: t,
2716
2716
  sections: M.visibleOptions,
2717
- selectedOptions: s,
2717
+ selectedOptions: c,
2718
2718
  onSelectOption: (e, n) => {
2719
2719
  G(e, n, t ? void 0 : W);
2720
2720
  },
@@ -2834,11 +2834,11 @@ const InputGroupAddon = ({ children: e, groupOrder: t, small: n = !1 }) => {
2834
2834
  children: e
2835
2835
  });
2836
2836
  }, Pagination = ({ pagination: e }) => {
2837
- let { rowCount: t, selectedPage: n, small: r, onSelectPage: i, rowsPerPage: a, errorMessageTemplate: o, testIds: s } = e, c = Number(a?.value) === 0, u = numberOfPages(t, a), [d, f] = useState(String(n));
2837
+ let { rowCount: t, selectedPage: n, small: r, onSelectPage: i, rowsPerPage: a, errorMessageTemplate: o, testIds: s } = e, l = Number(a?.value) === 0, u = numberOfPages(t, a), [d, f] = useState(String(n));
2838
2838
  useEffect(() => {
2839
2839
  f(String(n));
2840
2840
  }, [n]);
2841
- let { error: p } = validateSelectedPage(d, u, o), m = (e) => {
2841
+ let { error: p } = validateSelectedPage(d, u, o), h = (e) => {
2842
2842
  let { valid: t } = validateSelectedPage(e, u, o);
2843
2843
  f(e), t && e !== "" && i && i(Number(e));
2844
2844
  };
@@ -2849,7 +2849,7 @@ const InputGroupAddon = ({ children: e, groupOrder: t, small: n = !1 }) => {
2849
2849
  style: { flexShrink: 0 },
2850
2850
  children: /* @__PURE__ */ jsx(Select, {
2851
2851
  onChange: (e) => {
2852
- a.onChange && a.onChange(e), m("1");
2852
+ a.onChange && a.onChange(e), h("1");
2853
2853
  },
2854
2854
  options: a.options,
2855
2855
  native: !!a.options,
@@ -2863,16 +2863,16 @@ const InputGroupAddon = ({ children: e, groupOrder: t, small: n = !1 }) => {
2863
2863
  round: !0,
2864
2864
  basic: !0,
2865
2865
  icon: IconType.CHEVRON_DOUBLE_LEFT,
2866
- onClick: () => m("1"),
2867
- disabled: c || n === 1
2866
+ onClick: () => h("1"),
2867
+ disabled: l || n === 1
2868
2868
  }),
2869
2869
  /* @__PURE__ */ jsx(Button, {
2870
2870
  small: r,
2871
2871
  round: !0,
2872
2872
  basic: !0,
2873
2873
  icon: IconType.CHEVRON_LEFT,
2874
- onClick: () => m(String(Number(n) - 1)),
2875
- disabled: c || n === 1
2874
+ onClick: () => h(String(Number(n) - 1)),
2875
+ disabled: l || n === 1
2876
2876
  }),
2877
2877
  /* @__PURE__ */ jsxs(InputGroup, {
2878
2878
  small: r,
@@ -2881,9 +2881,9 @@ const InputGroupAddon = ({ children: e, groupOrder: t, small: n = !1 }) => {
2881
2881
  right: !0,
2882
2882
  value: d,
2883
2883
  placeholder: String(n),
2884
- onChange: (e) => m(e.target.value),
2884
+ onChange: (e) => h(e.target.value),
2885
2885
  width: "50px",
2886
- disabled: c || u <= 1,
2886
+ disabled: l || u <= 1,
2887
2887
  error: p
2888
2888
  }), /* @__PURE__ */ jsxs(InputGroupAddon, { children: ["of ", u] })]
2889
2889
  }),
@@ -2892,16 +2892,16 @@ const InputGroupAddon = ({ children: e, groupOrder: t, small: n = !1 }) => {
2892
2892
  round: !0,
2893
2893
  basic: !0,
2894
2894
  icon: IconType.CHEVRON_RIGHT,
2895
- onClick: () => m(String(Number(n) + 1)),
2896
- disabled: c || n === u
2895
+ onClick: () => h(String(Number(n) + 1)),
2896
+ disabled: l || n === u
2897
2897
  }),
2898
2898
  /* @__PURE__ */ jsx(Button, {
2899
2899
  small: r,
2900
2900
  round: !0,
2901
2901
  basic: !0,
2902
2902
  icon: IconType.CHEVRON_DOUBLE_RIGHT,
2903
- onClick: () => m(String(u)),
2904
- disabled: c || n === u,
2903
+ onClick: () => h(String(u)),
2904
+ disabled: l || n === u,
2905
2905
  testId: s?.doubleRightBtn
2906
2906
  })
2907
2907
  ]
@@ -2972,729 +2972,57 @@ const ExpandedContentRow = ({ colSpan: e, children: t, flush: n }) => /* @__PURE
2972
2972
  return r && t ? e[n] || [] : i ? e : (console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."), []);
2973
2973
  };
2974
2974
  var cell_module_default = {
2975
- inputInTable: "_inputInTable_1dumn_1",
2976
- inputHover: "_inputHover_1dumn_13",
2977
- inputFocus: "_inputFocus_1dumn_18",
2978
- inputError: "_inputError_1dumn_25",
2979
- inputWarning: "_inputWarning_1dumn_26",
2980
- inputDisabled: "_inputDisabled_1dumn_61",
2981
- hideScrollbars: "_hideScrollbars_1dumn_67",
2982
- cell: "_cell_1dumn_77",
2983
- disabledLink: "_disabledLink_1dumn_87",
2984
- inputWrapper: "_inputWrapper_1dumn_91",
2985
- numberInputWrapper: "_numberInputWrapper_1dumn_106",
2986
- breakWord: "_breakWord_1dumn_113",
2987
- inputCell: "_inputCell_1dumn_116",
2988
- sliderCell: "_sliderCell_1dumn_119",
2989
- staticCell: "_staticCell_1dumn_123",
2990
- staticCellContent: "_staticCellContent_1dumn_126",
2991
- unit: "_unit_1dumn_148",
2992
- sortingCell: "_sortingCell_1dumn_151",
2993
- sortingCellIcon: "_sortingCellIcon_1dumn_162",
2994
- icon: "_icon_1dumn_173",
2995
- checkBoxCell: "_checkBoxCell_1dumn_177",
2996
- iconCellWrapper: "_iconCellWrapper_1dumn_181",
2997
- actionsCell: "_actionsCell_1dumn_185",
2998
- rightAligned: "_rightAligned_1dumn_193",
2999
- centerAligned: "_centerAligned_1dumn_199",
3000
- leftAligned: "_leftAligned_1dumn_205",
3001
- popover: "_popover_1dumn_208",
3002
- disabledPointerEvents: "_disabledPointerEvents_1dumn_211",
3003
- selectedCell: "_selectedCell_1dumn_214"
3004
- }, asT = (e) => typeof e == "function" ? e : (e) => String(e), parseNum = (e) => Number(String(e ?? "").replace(",", ".").trim()), isNumeric = (e) => !Number.isNaN(parseNum(e)), hasAnyText = (e) => (e ?? []).some((e) => String(e ?? "").trim().length > 0 && !isNumeric(e)), isNonPlaceholderUnit = (e) => !!e && e !== "blank" && e.trim() !== "", isValidLength = (e, t, n) => e >= t - n, validateColumnLength = (e, t, n, r, i, a, o, s) => {
3005
- let c = [], l = r.filter((e) => e.optionalColumn).length, u = r.length, d = l ? `${u - l} or ${u}` : `${u}`, f = (i ? 1 : 0) + (a ? 1 : 0) + Math.max(0, s);
3006
- if (i && !isValidLength(e.length, u, l) && c.push(o("incorrectNumberOfFieldNameHeaderColumns", { expectedLengthMessage: d })), a) {
3007
- let e = r.filter((e) => Array.isArray(e.validUnits) && e.validUnits.some(isNonPlaceholderUnit)).length, n = t.filter(isNonPlaceholderUnit).length, i = r.filter((e) => e.optionalColumn || !e.validUnits || e.validUnits.includes("blank")).length;
3008
- isValidLength(n, e, i) || c.push(o("incorrectNumberOfUnitHeaderColumns", { expectedLengthMessage: d }));
3009
- }
3010
- return n.length === 0 ? c.push(o("incorrectNumberOfDataColumns", {
3011
- expectedLengthMessage: d,
3012
- dataRowStartIndex: f
3013
- })) : n.forEach((e, t) => {
3014
- isValidLength(e.length, u, l) || c.push(o("incorrectNumberOfDataColumns", {
3015
- expectedLengthMessage: d,
3016
- dataRowStartIndex: f + t
3017
- }));
3018
- }), c;
3019
- }, normalize = (e) => e.toUpperCase().replace(/\(.*?\)/g, "").replace(/[^A-Z0-9]/g, "").trim(), defaultFieldNameValidator = ({ value: e, defaultAllowedValues: t }) => {
3020
- let n = normalize(e);
3021
- return t?.some((e) => normalize(e).includes(n) || n.includes(normalize(e))) ?? !1;
3022
- }, defaultUnitsValidator = ({ value: e, defaultAllowedValues: t }) => t?.includes(e) ?? !1, validateHeadings = (e, t, n, r, i, a) => {
3023
- let o = [];
3024
- if (r) {
3025
- let r = n.map((e) => e.fieldName).filter(Boolean);
3026
- e.forEach((i, s) => {
3027
- let c = n[s];
3028
- !c || !c.fieldName || (c.fieldNameValidator ?? defaultFieldNameValidator)({
3029
- value: i,
3030
- defaultAllowedValues: r,
3031
- columnIndex: s,
3032
- fields: e,
3033
- units: t
3034
- }) || o.push(a("incorrectFieldName", {
3035
- i: s + 1,
3036
- correctName: c.fieldName || a("notExist"),
3037
- wrongName: i || a("notApplicable")
3038
- }));
3039
- });
3040
- }
3041
- if (i) {
3042
- let i = n.map((e) => e.validUnits), s = r ? 1 : 0;
3043
- t.forEach((r, c) => {
3044
- let l = n[c];
3045
- if (!l) return;
3046
- let u = l.unitsValidator ?? defaultUnitsValidator, d = i[c];
3047
- u({
3048
- value: r,
3049
- defaultAllowedValues: d,
3050
- columnIndex: c,
3051
- fields: e,
3052
- units: t
3053
- }) || o.push(a("incorrectUnitRow", {
3054
- unitRowIndex: s,
3055
- i: c + 1,
3056
- wrongUnit: r || a("notApplicable"),
3057
- correctUnit: d?.join(",") || a("notExist")
3058
- }));
3059
- });
3060
- }
3061
- return o;
3062
- }, validateValues = (e, t, n, r, i) => {
3063
- let a = [];
3064
- return e.forEach((e, o) => {
3065
- e.forEach((e, s) => {
3066
- let c = t[s];
3067
- if (!c || !c.validator) return;
3068
- let l = c.validator(e);
3069
- if (l && typeof l == "string") {
3070
- let e = r + o, t = i + s, c = n("rowColumn", {
3071
- rowIndex: e,
3072
- columnIndex: t
3073
- }) ?? `(row ${e}, column ${t})`;
3074
- a.push(`${l} ${c}`);
3075
- }
3076
- });
3077
- }), a;
3078
- };
3079
- const hasHeaders$1 = (e, t, n) => {
3080
- let r = (e) => e.replace(/,/g, "."), i = e[0] ?? [], a = e[1] ?? [], o = (e) => e.some((e) => isNaN(Number(r(e)))), s = (e) => e.some((e) => !isNaN(Number(r(e)))), c = i.some((e) => t.includes(e)), l = i.some((e) => n.includes(e)), u = a.some((e) => n.includes(e)), d = o(i), f = o(a), p = s(i), m = s(a);
3081
- return {
3082
- hasFieldNameHeader: c || d && !l && !p || d && f && !p,
3083
- hasUnitHeader: l || u || d && f && !l && !p && !m || d && f && !p && !m
3084
- };
2975
+ inputInTable: "_inputInTable_ie6ng_1",
2976
+ inputHover: "_inputHover_ie6ng_13",
2977
+ inputFocus: "_inputFocus_ie6ng_18",
2978
+ inputError: "_inputError_ie6ng_25",
2979
+ inputWarning: "_inputWarning_ie6ng_26",
2980
+ inputDisabled: "_inputDisabled_ie6ng_61",
2981
+ hideScrollbars: "_hideScrollbars_ie6ng_67",
2982
+ cell: "_cell_ie6ng_77",
2983
+ disabledLink: "_disabledLink_ie6ng_87",
2984
+ inputWrapper: "_inputWrapper_ie6ng_91",
2985
+ numberInputWrapper: "_numberInputWrapper_ie6ng_106",
2986
+ breakWord: "_breakWord_ie6ng_113",
2987
+ inputCell: "_inputCell_ie6ng_116",
2988
+ sliderCell: "_sliderCell_ie6ng_119",
2989
+ staticCell: "_staticCell_ie6ng_123",
2990
+ staticCellContent: "_staticCellContent_ie6ng_126",
2991
+ unit: "_unit_ie6ng_148",
2992
+ sortingCell: "_sortingCell_ie6ng_151",
2993
+ sortingCellIcon: "_sortingCellIcon_ie6ng_162",
2994
+ icon: "_icon_ie6ng_173",
2995
+ checkBoxCell: "_checkBoxCell_ie6ng_177",
2996
+ iconCellWrapper: "_iconCellWrapper_ie6ng_181",
2997
+ actionsCell: "_actionsCell_ie6ng_185",
2998
+ rightAligned: "_rightAligned_ie6ng_193",
2999
+ centerAligned: "_centerAligned_ie6ng_199",
3000
+ leftAligned: "_leftAligned_ie6ng_205",
3001
+ popover: "_popover_ie6ng_208",
3002
+ disabledPointerEvents: "_disabledPointerEvents_ie6ng_211"
3085
3003
  };
3086
- var getExpectedUnits = (e) => {
3087
- let t = (e) => (e ?? []).find((e) => isNonPlaceholderUnit(e)) ?? "";
3088
- return e.map((e) => isNonPlaceholderUnit(e.defaultUnit) ? e.defaultUnit : t(e.validUnits));
3089
- }, getAllowedUnitsSet = (e) => {
3090
- let t = /* @__PURE__ */ new Set();
3091
- for (let n of e) for (let e of n.validUnits ?? []) {
3092
- let n = (e ?? "").trim();
3093
- isNonPlaceholderUnit(n) && t.add(n);
3094
- }
3095
- return t;
3096
- };
3097
- const guessMissingHeaders$1 = (e = [], t = [], n = [], r = []) => {
3098
- let i = getAllowedUnitsSet(r), a = r.map((e) => e.fieldName ?? ""), o = getExpectedUnits(r), s = e.length > 0 && hasAnyText(e), c = t.length > 0 && t.every((e) => i.has(String(e ?? "").trim())), { hasFieldNameHeader: l, hasUnitHeader: u } = hasHeaders$1(n, a, Array.from(i)), d = s || l, f = c || u, p = s ? e.slice() : l ? (n[0] ?? []).slice() : a, m = c ? t.slice() : u ? (n[d ? 1 : 0] ?? []).slice() : o, h = (d ? 1 : 0) + (f ? 1 : 0), g = n.slice(h);
3099
- return {
3100
- effectiveFields: p,
3101
- effectiveUnits: m,
3102
- bodyRows: g,
3103
- hasFieldNameHeader: d,
3104
- hasUnitHeader: f
3105
- };
3106
- }, validate = ({ fields: e, units: t, rows: n, rules: r, t: i }) => {
3107
- let a = asT(i);
3108
- if (!Array.isArray(r) || r.length === 0) return {
3109
- isValid: !0,
3110
- errors: []
3111
- };
3112
- let { effectiveFields: o, effectiveUnits: s, bodyRows: c, hasFieldNameHeader: l, hasUnitHeader: u } = guessMissingHeaders$1(e, t, n, r), d = 1 + ((l ? 1 : 0) + (u ? 1 : 0)), f = validateColumnLength(o, s, c, r, l, u, a, 0);
3113
- return f.length === 0 && (f = f.concat(validateHeadings(o, s, r, l, u, a), validateValues(c, r, a, d, 1))), {
3114
- isValid: f.length === 0,
3115
- errors: f
3116
- };
3117
- }, validationRegistry = new class {
3118
- rules = /* @__PURE__ */ new Map();
3119
- register(e, t) {
3120
- this.rules.set(e, t);
3121
- }
3122
- get(e) {
3123
- return this.rules.get(e);
3124
- }
3125
- unregister(e) {
3126
- this.rules.delete(e);
3127
- }
3128
- clear() {
3129
- this.rules.clear();
3130
- }
3131
- }(), ValidationScopeContext = createContext(null), useValidationScopeId = () => useContext(ValidationScopeContext), enTranslations = {
3132
- cancel: "Cancel",
3133
- chooseFile: "Choose file",
3134
- copyDecimalComma: "Copy (decimal comma)",
3135
- copyDecimalDot: "Copy (decimal dot)",
3136
- copyToClipboard: "Copy to clipboard",
3137
- copiedToClipboard: "Copied to clipboard",
3138
- deleteAllRows: "Delete all rows",
3139
- downloadFile: "Download file",
3140
- export: "Export",
3141
- help: "Help",
3142
- import: "Import",
3143
- noFileSelected: "No file selected",
3144
- notApplicable: "N/A",
3145
- notExist: "not exist",
3146
- okay: "Okay",
3147
- uploadCapitalized: "Upload",
3148
- uploadFile: "Upload file",
3149
- pasteShortcutHint: "You can also press Ctrl+V or Command+V to paste from clipboard",
3150
- pasteFromClipboard: "Paste from clipboard",
3151
- clipboardIsEmpty: "Clipboard is empty",
3152
- clipboardReadFailed: "Unable to read data from clipboard. Check formatting or try Paste with Review.",
3153
- clipboardReadNotAllowed: "Your browser did not allow reading the clipboard. Upgrade browser or try Paste with Review.",
3154
- pasteSuccessful: "Paste successful",
3155
- pasteWithReview: "Paste with review",
3156
- pasteWithReviewRoundBrackets: "Paste (with review)",
3157
- quickPasteFromClipboard: "Quick paste from clipboard",
3158
- unableToCopyToClipboard: "Unable to copy to clipboard",
3159
- fileParsingFailed: "Failed to read or validate the file. Please check the format and try again.",
3160
- importWarning: "Large data detected: More than 500 rows have been imported. You can choose to import all or downsample for better performance.",
3161
- importLimitExceeded: "Import failed: The data exceeds the 5000-row limit. Please reduce the number of rows and try again.",
3162
- importingData: "Importing data",
3163
- incorrectFieldName: "Incorrect field name (row 0, column {{i}}: has name {{wrongName}}, but should be {{correctName}})",
3164
- incorrectNumberOfDataColumns: "Incorrect number of data columns, expected {{expectedLengthMessage}} columns in row {{dataRowStartIndex}}",
3165
- incorrectNumberOfFieldNameHeaderColumns: "Incorrect number of field name header columns, expected {{expectedLengthMessage}} columns in row 0",
3166
- incorrectNumberOfUnitHeaderColumns: "Incorrect number of unit header columns, expected {{expectedLengthMessage}} columns in row 1",
3167
- incorrectUnitRow: "Incorrect unit (row {{unitRowIndex}}, column {{i}}: has unit [{{wrongUnit}}], but should be [{{correctUnit}}])",
3168
- jsonParseFailed: "JSON parse failed",
3169
- pasteYourTableDataHereToImportIt: "Paste your table data here to import it",
3170
- rowColumn: "(row {{rowIndex}}, column {{columnIndex}})",
3171
- theValuesCanBeSeparatedByDifferentDelimiters: "The values can be separated by different delimiters",
3172
- unableToImportPleaseCorrectError: "Unable to import - {{rows}} rows have errors. Please correct input data and try again.",
3173
- unableToPrepareExportData: "Unable to prepare export – see console for details.",
3174
- validInputForPaste: "Valid input for paste.",
3175
- wrongFileFormatExpectedOneOf: "Wrong file format: expected one of",
3176
- youCanImportDataByPastingOrByMessage: "You can import data by pasting (e.g. from a spreadsheet), or by uploading a text file ( .txt or .csv ).",
3177
- commasAsDecimals: "Comma is treated as a decimal separator when it is the only separator",
3178
- deletePastedContent: "Delete pasted content",
3179
- downsampled: "Downsampled",
3180
- downsampleSuccess: "Successfully downsampled from {{from}} rows to {{to}} rows.",
3181
- downsampleTooltip: "Reduces number of data rows (decimation) using the Ramer–Douglas–Peucker algorithm.",
3182
- extraSeparators: "Two or more separators detected. Kept only last one as decimal separator, please control your import results",
3183
- noDataPastedYet: "No data pasted yet.",
3184
- semicolonSeparatedValues: "Semicolon-separated values",
3185
- tabSeparatedValues: "Tab-separated values",
3186
- examples: "Examples",
3187
- smartUpload_description: "Upload image and extract table content using a LLM",
3188
- smartUpload_smartUpload: "Smart Upload",
3189
- toUploadOrImportFromClipboardMessage: "To upload or import from clipboard please select your preferred unit in the table header and upload or paste numbers only for Depth, Inc, Azi. Follow example below"
3190
- }, interpolate = (e, t = {}) => e?.replace(/\{\{(\w+)\}\}/g, (e, n) => t?.[n] === void 0 ? "" : String(t?.[n])), useTranslationMap = (e) => useMemo(() => {
3191
- let t = Object.keys(enTranslations).reduce((t, n) => {
3192
- let r = enTranslations?.[n];
3193
- return t[n] = e?.[n] ?? r, t;
3194
- }, {});
3195
- return (e, n) => {
3196
- let r = t[e];
3197
- return n ? interpolate(r, n) : r;
3198
- };
3199
- }, [e]);
3200
- function useScopedValidate() {
3201
- let e = useValidationScopeId(), t = useTranslationMap(), n;
3202
- return {
3203
- scopeId: e,
3204
- rules: n,
3205
- validate: (r) => {
3206
- let { fields: i = [], units: a = [], rows: o, t: s = t, options: c } = r;
3207
- return n = e ? validationRegistry.get(e) : void 0, n ? validate({
3208
- fields: i,
3209
- units: a,
3210
- rows: o,
3211
- rules: n,
3212
- t: s
3213
- }) : {
3214
- isValid: !0,
3215
- errors: []
3216
- };
3217
- }
3218
- };
3219
- }
3220
- function useRegisterValidationRules(e, t) {
3221
- useEffect(() => {
3222
- if (!(!e || !t)) return validationRegistry.register(e, t), () => validationRegistry.unregister(e);
3223
- }, [e, t]);
3224
- }
3225
- var counter = 0;
3226
- function nextScopeId() {
3227
- return counter += 1, `table-${counter}`;
3228
- }
3229
- const depthRound = (e) => Math.round(e * 100) / 100, joinArray = (e) => e.join(", ").replace(/,\s*$/, ""), guessDelimiter = (e) => {
3230
- let t = e.substring(0, 200), n = (t.match(/\t/g) ?? [])?.length, r = (t.match(/;/g) ?? [])?.length;
3231
- return n === 0 && r === 0 ? "," : n > r ? " " : ";";
3232
- }, allowedMimes = [
3233
- "text/csv",
3234
- "text/plain",
3235
- "application/json",
3236
- "application/vnd.ms-excel"
3237
- ], isAllowedFileType = (e) => allowedMimes.includes(e.type), isFile = (e) => e instanceof File, isJson = (e) => e.trim().startsWith("["), isCustomJson = (e) => {
3238
- try {
3239
- return !!JSON.parse(e)?.path;
3240
- } catch {
3241
- return !1;
3242
- }
3243
- }, readFile$1 = (e) => new Promise((t, n) => {
3244
- let r = new FileReader();
3245
- r.onload = () => t(String(r.result)), r.onerror = n, r.readAsText(e);
3246
- }), replaceWithDot = (e) => e.replace(",", "."), replaceDataCommasWithDots = (e) => e.map((e) => e.map((e) => replaceWithDot(e))), hasHeaders = (e, t, n) => {
3247
- let r = (e) => e.replace(/,/g, "."), i = e[0]?.some((e) => isNaN(Number(r(e)))) ?? !1, a = e[1]?.some((e) => isNaN(Number(r(e)))) ?? !1, o = e[0]?.some((e) => t.includes(e)) ?? !1, s = e[0]?.some((e) => n.includes(e)) ?? !1, c = e[1]?.some((e) => n.includes(e)) ?? !1, l = e[0]?.some((e) => !isNaN(Number(r(e)))) ?? !1, u = e[1]?.some((e) => !isNaN(Number(r(e)))) ?? !1;
3248
- return {
3249
- hasFieldNameHeader: o || i && !s && !l || i && a && !l,
3250
- hasUnitHeader: s || c || i && a && !s && !l && !u || i && a && !l && !u
3251
- };
3252
- };
3253
- var buildHeadersFromRules = (e, t) => {
3254
- let n = e.length === t ? e : e.filter((e) => !e.optionalColumn), r = n.map((e) => e.fieldName), i = n.map((e) => e.defaultUnit ?? e.validUnits?.[0] ?? ""), a = n.map((e) => e.validUnits).filter((e) => !!e).flat();
3255
- return {
3256
- fieldHeader: r,
3257
- unitHeader: i,
3258
- allowedUnits: a
3259
- };
3260
- };
3261
- const guessMissingHeaders = (e, t) => {
3262
- let n = e.map((e) => [...e]), r = n[0]?.length ?? 0, { fieldHeader: i, unitHeader: a, allowedUnits: o } = buildHeadersFromRules(t, r), { hasFieldNameHeader: s, hasUnitHeader: c } = hasHeaders(n, i, o), l = n;
3263
- return !s && !c ? l = [
3264
- i,
3265
- a,
3266
- ...n
3267
- ] : !s && c ? l = [i, ...n] : s && !c && (l = [
3268
- n[0] ?? [],
3269
- a,
3270
- ...n.slice(1)
3271
- ]), {
3272
- matrix: l,
3273
- hasFieldNameHeader: s,
3274
- hasUnitHeader: c
3275
- };
3276
- }, mapCustomJsonToRows = (e) => {
3277
- let t = JSON.parse(e).path.map((e) => [
3278
- depthRound(e.md),
3279
- depthRound(e.inclination),
3280
- depthRound(e.gridAzimuth)
3281
- ]);
3282
- return t.unshift([
3283
- "m",
3284
- "deg",
3285
- "deg"
3286
- ]), t;
3287
- };
3288
- var basePapaConfig = {
3289
- skipEmptyLines: !0,
3290
- transform: (e) => e?.trim(),
3291
- delimiter: guessDelimiter
3292
- }, initParsedResult = () => ({
3293
- isValid: !1,
3294
- fields: [],
3295
- units: [],
3296
- rows: [],
3297
- errors: []
3298
- }), buildResultFromMatrix = (e, t) => {
3299
- let n = initParsedResult(), { matrix: r } = guessMissingHeaders(e, t.validationRules);
3300
- return n.fields = (r[0] ?? []).map((e) => e.trim()), n.units = (r[1] ?? []).map((e) => e.trim()).filter(Boolean), n.rows = r.slice(2) ?? [], n.rows = replaceDataCommasWithDots(n.rows), n.isValid = n.errors.length === 0, n;
3301
- }, parseJson = async (e, t, n) => {
3302
- let r = JSON.parse(e);
3303
- return buildResultFromMatrix(r, t);
3304
- }, parseCustomJson = async (e, t, n) => {
3305
- let r = mapCustomJsonToRows(e).map((e) => e.map(String));
3306
- return buildResultFromMatrix(r, t);
3307
- }, parseDSV = (e, t, n) => new Promise((n) => {
3308
- let { importLimit: r } = t;
3309
- Papa.parse(e, {
3310
- ...basePapaConfig,
3311
- preview: r,
3312
- complete: (e) => {
3313
- let r = e.data ?? [];
3314
- n(buildResultFromMatrix(r, t));
3315
- }
3316
- });
3317
- });
3318
- const parse = async (e, t, n) => {
3319
- let r = initParsedResult();
3320
- try {
3321
- if (isFile(e) && !isAllowedFileType(e)) return r.errors.push(`${n("wrongFileFormatExpectedOneOf")} ${joinArray(Array.from(allowedMimes))}`), r;
3322
- let i = isFile(e) ? await readFile$1(e) : String(e);
3323
- return isJson(i) ? await parseJson(i, t, n) : isCustomJson(i) ? await parseCustomJson(i, t, n) : await parseDSV(e, t, n);
3324
- } catch (e) {
3325
- return r.errors.push(e?.message ?? "Unknown parse error"), r;
3326
- }
3327
- }, unParse = (e, t, n, r) => {
3328
- let i = r?.delimiter ?? ",", a = [
3329
- e,
3330
- t,
3331
- ...n
3332
- ].filter(Boolean);
3333
- return Papa.unparse(a, {
3334
- quotes: !1,
3335
- header: !0,
3336
- delimiter: i
3337
- });
3338
- };
3339
- function useScopedParser(e = {}) {
3340
- let t = useValidationScopeId(), n = (t ? validationRegistry.get(t) : []) ?? [];
3341
- return {
3342
- scopeId: t,
3343
- rules: n,
3344
- parse: async (t, r, i) => parse(t, {
3345
- validationRules: n,
3346
- ...e,
3347
- ...i
3348
- }, r)
3349
- };
3350
- }
3351
- function useScopedParseAndValidate() {
3352
- let { parse: e, scopeId: t, rules: n } = useScopedParser(), { validate: r } = useScopedValidate();
3353
- return {
3354
- scopeId: t,
3355
- rules: n,
3356
- parseAndValidate: async (t, n) => {
3357
- let i = await e(t, n), { isValid: a, errors: o } = r({
3358
- fields: i.fields,
3359
- units: i.units,
3360
- rows: i.rows,
3361
- t: n
3362
- });
3363
- return {
3364
- ...i,
3365
- errors: [...i.errors, ...o],
3366
- isValid: a && [...i.errors, ...o].length === 0
3367
- };
3368
- }
3369
- };
3370
- }
3371
- const injectScopeIntoActions = (e, t) => {
3372
- if (!e) return e;
3373
- if (isValidElement(e)) return cloneElement(e, { __validationScopeId: t });
3374
- if (Array.isArray(e)) return e.map((e) => injectScopeIntoActions(e, t));
3375
- if (typeof e == "object") {
3376
- let r = e, i = [
3377
- "childComponent",
3378
- "component",
3379
- "render",
3380
- "element"
3381
- ], o = !1, s = { ...r };
3382
- for (let e of i) {
3383
- let i = r[e];
3384
- i && isValidElement(i) && (s[e] = cloneElement(i, { __validationScopeId: t }), o = !0);
3385
- }
3386
- for (let [e, n] of Object.entries(r)) if (Array.isArray(n)) {
3387
- let r = n.map((e) => injectScopeIntoActions(e, t));
3388
- r !== n && (s[e] = r, o = !0);
3389
- }
3390
- return o ? s : e;
3391
- }
3392
- return e;
3393
- }, withValidationScope = (e) => {
3394
- let t = forwardRef((t, n) => {
3395
- let r = useRef(nextScopeId()), i = useMemo(() => {
3396
- let e = injectScopeIntoActions(t.table?.actions, r.current);
3397
- return {
3398
- ...t.table,
3399
- actions: e
3400
- };
3401
- }, [t.table]);
3402
- return /* @__PURE__ */ jsx(ValidationScopeContext.Provider, {
3403
- value: r.current,
3404
- children: /* @__PURE__ */ jsx(e, {
3405
- ref: n,
3406
- ...t,
3407
- table: i
3408
- })
3409
- });
3410
- });
3411
- return t.displayName = `withValidationScope(${e.displayName || e.name || "Component"})`, memo(t);
3412
- }, CellSelectionContext = createContext({
3413
- selectedIndexes: void 0,
3414
- setSelectedIndexes: () => {}
3415
- }), useCellSelection = (e, t, n, r) => {
3416
- if (!e) return {
3417
- selectedIndexes: void 0,
3418
- setSelectedIndexes: () => {},
3419
- onCopy: () => {},
3420
- onPaste: () => {},
3421
- onKeyDown: () => {},
3422
- onKeyUp: () => {},
3423
- onMouseUp: () => {},
3424
- onBlur: () => {},
3425
- onMouseDown: () => {},
3426
- onMouseMove: () => {}
3427
- };
3428
- let [i, a] = useState(void 0), [o, s] = useState(void 0), [c, u] = useState(!1), { validate: d } = useScopedValidate(), f = () => {
3429
- let e = t.current?.closest("#scrollWrapper") ?? null ?? ((e) => {
3430
- let t = e;
3431
- for (; t && t !== document.body;) {
3432
- let e = getComputedStyle(t);
3433
- if ((/(auto|scroll|overlay)/.test(e.overflowY) || /(auto|scroll|overlay)/.test(e.overflow)) && t.scrollHeight > t.clientHeight) return t;
3434
- t = t.parentElement;
3435
- }
3436
- return document.scrollingElement || document.body;
3437
- })(t.current) ?? document.body;
3438
- return e !== document.body && getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
3439
- };
3440
- useEffect(() => {
3441
- let e = f(), t = () => w();
3442
- return e.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), w(), () => {
3443
- e.removeEventListener("scroll", t), window.removeEventListener("resize", t), T();
3444
- };
3445
- }, [i]);
3446
- let p = (e, n) => {
3447
- if (!t.current) return null;
3448
- let r = t.current.querySelector(`tr:nth-child(${e + 1})`);
3449
- if (!r) return null;
3450
- let i = r.querySelector(`td:nth-child(${n + 1})`);
3451
- return i ? i.querySelector("input") : null;
3452
- }, m = (e, t) => {
3453
- let n = p(e, t);
3454
- n && n.focus();
3455
- }, g = (e) => {
3456
- if (!i) return;
3457
- let t = n.slice(i.row.start, i.row.end + 1).map((e) => e.cells.slice(i.column.start, i.column.end + 1).map((e) => e.value)).map((e) => e.join(" ")).join("\n");
3458
- navigator.clipboard.writeText(t);
3459
- }, _ = (e) => {
3460
- e.preventDefault();
3461
- let t = (e?.clipboardData?.getData("text") || "")?.replace(/\r\n/g, "\n")?.replace(/\r/g, "\n"), a = (t?.endsWith("\n") ? t?.slice(0, -1)?.split("\n") : t?.split("\n"))?.filter(Boolean)?.map((e) => e?.split(" "));
3462
- if (!a?.length || !n?.length || !n?.[0]?.cells?.length) return;
3463
- let o = n?.map((e) => e?.cells?.map((e) => String(e?.value ?? ""))), s = o?.length, c = o?.[0]?.length, l = (e, t, n) => {
3464
- let r = Math.min(t?.length, Math.max(c - n, 0)), i = e ? e?.slice() : Array(c)?.fill("");
3465
- for (let e = 0; e < r; e++) i[n + e] = t[e] ?? "";
3466
- return i;
3467
- }, u, f, p;
3468
- if (i) {
3469
- let e = i?.row?.start, t = i?.column?.start, n = i?.row?.start, r = i?.row?.end, s = r - n + 1, d = o?.slice(0, n), m = o?.slice(r + 1), h = a?.length, g = Math.min(s, h), _ = Math.max(0, s - h), v = [];
3470
- for (let e = 0; e < g; e++) {
3471
- let r = o[n + e];
3472
- v.push(l(r, a[e], t));
3473
- }
3474
- let y = _ > 0 ? o?.slice(n + g, n + g + _) : [], b = [];
3475
- for (let e = g; e < h; e++) b?.push(l(void 0, a?.[e], t));
3476
- f = v?.concat(b), u = d?.concat(v)?.concat(y)?.concat(b)?.concat(m);
3477
- let x = Math.min(a?.[0]?.length, Math.max(c - t, 0));
3478
- p = {
3479
- row: {
3480
- start: e,
3481
- end: e + g - 1
3482
- },
3483
- column: {
3484
- start: t,
3485
- end: t + Math.max(x - 1, 0)
3486
- }
3487
- };
3488
- } else {
3489
- let e = s;
3490
- f = a?.map((e) => l(void 0, e, 0)), u = [...o || [], ...f || []];
3491
- let t = Math.min(a?.[0]?.length, c);
3492
- p = {
3493
- row: {
3494
- start: e,
3495
- end: e + f?.length - 1
3496
- },
3497
- column: {
3498
- start: 0,
3499
- end: 0 + Math.max(t - 1, 0)
3500
- }
3501
- };
3502
- }
3503
- let { errors: m, isValid: h } = d({ rows: u });
3504
- r?.({
3505
- allValues: u,
3506
- affectedRange: p,
3507
- insertedValues: f,
3508
- errors: m,
3509
- isValid: h
3510
- });
3511
- }, v = (e) => {
3512
- if ((e.key === "a" || e.key === "A") && (e.metaKey || e.ctrlKey)) {
3513
- n?.length && n[0]?.cells?.length && (e.preventDefault(), a({
3514
- row: {
3515
- start: 0,
3516
- end: n.length - 1
3517
- },
3518
- column: {
3519
- start: 0,
3520
- end: n[0].cells.length - 1
3521
- }
3522
- }));
3523
- return;
3524
- }
3525
- if (!n?.length || !n[0]?.cells?.length) return;
3526
- if ((e.key === "Delete" || e.key === "Backspace") && i) {
3527
- e.preventDefault();
3528
- let t = n.map((e) => e.cells.map((e) => String(e?.value ?? ""))), { row: a, column: o } = i;
3529
- for (let e = a.start; e <= a.end; e++) for (let n = o.start; n <= o.end; n++) t[e][n] = "";
3530
- let s = Array(a.end - a.start + 1).fill(null).map(() => Array(o.end - o.start + 1).fill("")), c = {
3531
- row: {
3532
- start: a.start,
3533
- end: a.end
3534
- },
3535
- column: {
3536
- start: o.start,
3537
- end: o.end
3538
- }
3539
- }, { errors: l, isValid: u } = d({ rows: t });
3540
- r?.({
3541
- allValues: t,
3542
- affectedRange: c,
3543
- insertedValues: s,
3544
- errors: l,
3545
- isValid: u
3546
- }), m(a.start, o.start);
3547
- return;
3548
- }
3549
- if (!(e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight") || !e.shiftKey) return;
3550
- e.preventDefault();
3551
- let t = (e, t, n) => Math.min(n, Math.max(t, e)), c = i ?? {
3552
- row: {
3553
- start: 0,
3554
- end: 0
3555
- },
3556
- column: {
3557
- start: 0,
3558
- end: 0
3559
- }
3560
- }, l = n.length - 1, u = n[0].cells.length - 1, f = e.key === "ArrowUp" ? {
3561
- dr: -1,
3562
- dc: 0
3563
- } : e.key === "ArrowDown" ? {
3564
- dr: 1,
3565
- dc: 0
3566
- } : e.key === "ArrowLeft" ? {
3567
- dr: 0,
3568
- dc: -1
3569
- } : {
3570
- dr: 0,
3571
- dc: 1
3572
- };
3573
- if (e.shiftKey) {
3574
- let e = o ?? {
3575
- row: c.row.start,
3576
- column: c.column.start
3577
- }, n = {
3578
- row: e.row === c.row.start ? c.row.end : c.row.start,
3579
- column: e.column === c.column.start ? c.column.end : c.column.start
3580
- }, r = {
3581
- row: t(n.row + f.dr, 0, l),
3582
- column: t(n.column + f.dc, 0, u)
3583
- }, i = {
3584
- row: {
3585
- start: Math.min(e.row, r.row),
3586
- end: Math.max(e.row, r.row)
3587
- },
3588
- column: {
3589
- start: Math.min(e.column, r.column),
3590
- end: Math.max(e.column, r.column)
3591
- }
3592
- };
3593
- o || s({
3594
- row: e.row,
3595
- column: e.column
3596
- }), a(i);
3597
- } else {
3598
- let e = {
3599
- row: c.row.end,
3600
- column: c.column.end
3601
- }, n = {
3602
- row: t(e.row + f.dr, 0, l),
3603
- column: t(e.column + f.dc, 0, u)
3604
- };
3605
- s(void 0), a({
3606
- row: {
3607
- start: n.row,
3608
- end: n.row
3609
- },
3610
- column: {
3611
- start: n.column,
3612
- end: n.column
3613
- }
3614
- }), m(n.row, n.column);
3615
- }
3616
- }, y = (e) => {
3617
- e.key === "Shift" && s(void 0);
3618
- }, b = (e, t) => {
3619
- a(o ? {
3620
- row: {
3621
- start: Math.min(e, o.row),
3622
- end: Math.max(e, o.row)
3623
- },
3624
- column: {
3625
- start: Math.min(t, o.column),
3626
- end: Math.max(t, o.column)
3627
- }
3628
- } : {
3629
- row: {
3630
- start: e,
3631
- end: e
3632
- },
3633
- column: {
3634
- start: t,
3635
- end: t
3636
- }
3637
- });
3638
- }, x = (e) => {
3639
- let t = e.target, n = Number(t.closest("td")?.dataset.rowIndex), r = Number(t.closest("td")?.dataset.columnIndex);
3640
- b(n, r), o || s({
3641
- row: n,
3642
- column: r
3643
- }), u(!0);
3644
- }, S = (e) => {
3645
- s(void 0), u(!1);
3646
- }, C = (e) => {
3647
- if (e.preventDefault(), !c) return;
3648
- let t = e.target, n = Number(t.closest("td")?.dataset.rowIndex), r = Number(t.closest("td")?.dataset.columnIndex);
3649
- b(n, r);
3650
- }, w = () => {
3651
- if (T(), !i || !t.current) return;
3652
- let { row: e, column: n } = i, r = t.current?.querySelector(`td[data-row-index="${e.start}"][data-column-index="${n.start}"]`), a = e.end === e.start && n.end === n.start ? r : t.current?.querySelector(`td[data-row-index="${e.end}"][data-column-index="${n.end}"]`);
3653
- if (!r || !a) return;
3654
- let o = f(), s = o.getBoundingClientRect(), c = r?.getBoundingClientRect(), l = a?.getBoundingClientRect(), u = Math.round(c?.left - s.left + o.scrollLeft), d = Math.round(c?.top - s.top + o.scrollTop), p = Math.round(l?.right - s.left + o.scrollLeft), m = Math.round(l?.bottom - s.top + o.scrollTop), h = document.createElement("div");
3655
- h.className = "selection-frame", h.style.position = "absolute", h.style.pointerEvents = "none", h.style.zIndex = "4", h.style.left = `${u}px`, h.style.top = `${d}px`, h.style.width = `${p - u}px`, h.style.height = `${m - d}px`, h.style.border = "1px solid var(--color-border-focus)", h.style.borderRadius = "0", o.appendChild(h);
3656
- }, T = () => {
3657
- f().querySelectorAll(".selection-frame,.drag-handle").forEach((e) => e.remove());
3658
- };
3659
- return {
3660
- selectedIndexes: i,
3661
- setSelectedIndexes: a,
3662
- onCopy: g,
3663
- onPaste: _,
3664
- onKeyDown: v,
3665
- onKeyUp: y,
3666
- onMouseDown: x,
3667
- onMouseUp: S,
3668
- onMouseMove: C,
3669
- onBlur: (e) => {
3670
- e.currentTarget.contains(e.relatedTarget) || (a(void 0), s(void 0));
3671
- }
3672
- };
3673
- }, InputCell = ({ cell: e, columnAlignment: t, testId: n, type: r }) => {
3674
- let { selectedIndexes: i } = useContext(CellSelectionContext), a = i?.row.start !== i?.row.end || i?.column.start !== i?.column.end;
3675
- return /* @__PURE__ */ jsx(Input, {
3676
- name: e.name,
3677
- value: e.value,
3678
- onChange: (t) => e.onChange?.(t),
3679
- onFocus: e.onFocus,
3680
- onBlur: e.onBlur,
3681
- onPaste: (t) => e.onPaste?.(t),
3682
- placeholder: e.placeholder,
3683
- error: e.error,
3684
- warning: e.warning,
3685
- disabled: e.disabled,
3686
- isInTable: !0,
3687
- maxTooltipWidth: e.maxTooltipWidth,
3688
- right: t === Align.RIGHT,
3689
- selectOnFocus: !a,
3690
- testId: n,
3691
- tabIndex: e.disabled ? -1 : 0,
3692
- tooltip: e.tooltip,
3693
- type: r
3694
- });
3695
- }, safeToString = (e) => String(toString(e)), roundNumberCosmetic = (e) => isScientificStringNum(e) ? e : safeToString(roundToPrecision(toNum(e), 14));
3004
+ const InputCell = ({ cell: e, columnAlignment: t, testId: n, type: r }) => /* @__PURE__ */ jsx(Input, {
3005
+ name: e.name,
3006
+ value: e.value,
3007
+ onChange: (t) => e.onChange?.(t),
3008
+ onFocus: e.onFocus,
3009
+ onBlur: e.onBlur,
3010
+ onPaste: (t) => e.onPaste?.(t),
3011
+ placeholder: e.placeholder,
3012
+ error: e.error,
3013
+ warning: e.warning,
3014
+ disabled: e.disabled,
3015
+ isInTable: !0,
3016
+ maxTooltipWidth: e.maxTooltipWidth,
3017
+ right: t === Align.RIGHT,
3018
+ selectOnFocus: e.selectOnFocus,
3019
+ testId: n,
3020
+ tabIndex: e.disabled ? -1 : 0,
3021
+ tooltip: e.tooltip,
3022
+ type: r
3023
+ }), safeToString = (e) => String(toString(e)), roundNumberCosmetic = (e) => isScientificStringNum(e) ? e : safeToString(roundToPrecision(toNum(e), 14));
3696
3024
  var getStringName$1 = (e) => e ? typeof e == "string" ? e : isArray(e) ? e[0] : e.fieldName : "";
3697
- const NumberInput = ({ name: e, placeholder: t = "", disabled: n = !1, error: r = !1, left: i = !1, small: a = !1, width: o = "100%", value: s = "", onChange: c = () => {}, onFocus: u = () => {}, onBlur: d = () => {}, selectOnFocus: f, tabIndex: p = 0, testId: g, tooltip: _ = null, warning: v = !1, validationCallback: y = () => {}, allowEmpty: b = !1, isInTable: x, groupOrder: S, enableCosmeticRounding: C = !0, enableDisplayRounding: w = !1, roundDisplayValue: T, disableInternalErrorValidationMessages: E = !1, disableValidationOnFocus: D = !1 }) => {
3025
+ const NumberInput = ({ name: e, placeholder: t = "", disabled: n = !1, error: r = !1, left: i = !1, small: a = !1, width: o = "100%", value: s = "", onChange: l = () => {}, onFocus: u = () => {}, onBlur: d = () => {}, selectOnFocus: f, tabIndex: h = 0, testId: g, tooltip: _ = null, warning: v = !1, validationCallback: y = () => {}, allowEmpty: b = !1, isInTable: x, groupOrder: S, enableCosmeticRounding: C = !0, enableDisplayRounding: w = !1, roundDisplayValue: T, disableInternalErrorValidationMessages: E = !1, disableValidationOnFocus: D = !1 }) => {
3698
3026
  let O = (e) => {
3699
3027
  let n = validateNumber(e), r = t && isEmptyNullOrUndefined(e);
3700
3028
  return [Infinity, -Infinity].includes(Number(e)) || r ? {
@@ -3734,7 +3062,7 @@ const NumberInput = ({ name: e, placeholder: t = "", disabled: n = !1, error: r
3734
3062
  name: F
3735
3063
  }
3736
3064
  };
3737
- c(t);
3065
+ l(t);
3738
3066
  }
3739
3067
  };
3740
3068
  useEffect(() => {
@@ -3772,7 +3100,7 @@ const NumberInput = ({ name: e, placeholder: t = "", disabled: n = !1, error: r
3772
3100
  isInTable: x,
3773
3101
  groupOrder: S,
3774
3102
  selectOnFocus: f,
3775
- tabIndex: p,
3103
+ tabIndex: h,
3776
3104
  tooltip: _,
3777
3105
  ref: A
3778
3106
  }, F);
@@ -3841,14 +3169,14 @@ const NumberInput = ({ name: e, placeholder: t = "", disabled: n = !1, error: r
3841
3169
  testId: n
3842
3170
  }) : null
3843
3171
  }), LinkCell = ({ cell: e, testId: t }) => {
3844
- let n = useContext(DisabledContext), { error: r, warning: i, tooltip: a, maxTooltipWidth: o } = e, s = (e) => isStringNumberOrNode(e);
3172
+ let n = useContext(DisabledContext), { error: r, warning: i, tooltip: a, maxTooltipWidth: o } = e, c = (e) => isStringNumberOrNode(e);
3845
3173
  return /* @__PURE__ */ jsx("div", {
3846
3174
  className: cell_module_default.inputWrapper,
3847
3175
  children: /* @__PURE__ */ jsx(Tooltip, {
3848
3176
  error: !!r,
3849
3177
  warning: !!i,
3850
3178
  text: a || r || i,
3851
- enabled: s(a) || s(r) || s(i) || !1,
3179
+ enabled: c(a) || c(r) || c(i) || !1,
3852
3180
  maxWidth: o,
3853
3181
  children: /* @__PURE__ */ jsx("div", {
3854
3182
  className: cell_module_default.staticCellContent,
@@ -3891,7 +3219,7 @@ var slider_module_default = {
3891
3219
  ] }),
3892
3220
  children: /* @__PURE__ */ jsx("div", { className: slider_module_default.dot })
3893
3221
  }), e), {}), isEqual$1);
3894
- const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto", value: i, min: a, max: o, step: s = 1, marks: l = [], showArrows: u = !1, showTooltip: d = !1, tooltipFormatter: f = (e) => e, disabled: p = !1, range: m = !1, small: h = !1, vertical: g = {
3222
+ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto", value: i, min: a, max: o, step: c = 1, marks: l = [], showArrows: u = !1, showTooltip: d = !1, tooltipFormatter: f = (e) => e, disabled: p = !1, range: m = !1, small: h = !1, vertical: _ = {
3895
3223
  enabled: !1,
3896
3224
  width: "100px",
3897
3225
  height: "400px"
@@ -3924,13 +3252,13 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3924
3252
  })
3925
3253
  });
3926
3254
  return /* @__PURE__ */ jsxs("div", {
3927
- className: cx(slider_module_default.container, h ? slider_module_default.small : "", g.enabled ? slider_module_default.vertical : ""),
3928
- style: g.enabled ? {
3929
- width: g.width,
3930
- height: g.height
3255
+ className: cx(slider_module_default.container, h ? slider_module_default.small : "", _.enabled ? slider_module_default.vertical : ""),
3256
+ style: _.enabled ? {
3257
+ width: _.width,
3258
+ height: _.height
3931
3259
  } : { width: n },
3932
3260
  children: [
3933
- u && (g.enabled ? /* @__PURE__ */ jsx(C, {}) : /* @__PURE__ */ jsx(S, {})),
3261
+ u && (_.enabled ? /* @__PURE__ */ jsx(C, {}) : /* @__PURE__ */ jsx(S, {})),
3934
3262
  /* @__PURE__ */ jsx(RcSlider, {
3935
3263
  range: m,
3936
3264
  allowCross: !1,
@@ -3938,11 +3266,11 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3938
3266
  value: i,
3939
3267
  max: o,
3940
3268
  min: a,
3941
- step: s,
3269
+ step: c,
3942
3270
  marks: b,
3943
3271
  onChange: (e) => x(e),
3944
3272
  disabled: p || y,
3945
- vertical: g.enabled,
3273
+ vertical: _.enabled,
3946
3274
  handleRender: (e, t) => {
3947
3275
  let n = d && t.dragging;
3948
3276
  return /* @__PURE__ */ jsxs("div", {
@@ -3959,7 +3287,7 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3959
3287
  });
3960
3288
  }
3961
3289
  }),
3962
- u && (g.enabled ? /* @__PURE__ */ jsx(S, {}) : /* @__PURE__ */ jsx(C, {})),
3290
+ u && (_.enabled ? /* @__PURE__ */ jsx(S, {}) : /* @__PURE__ */ jsx(C, {})),
3963
3291
  t && /* @__PURE__ */ jsx("label", {
3964
3292
  className: slider_module_default.label,
3965
3293
  style: { width: r },
@@ -4000,17 +3328,17 @@ var popover_module_default = {
4000
3328
  fullWidthStyleFix: "_fullWidthStyleFix_lhie5_8",
4001
3329
  dismiss: "_dismiss_lhie5_13"
4002
3330
  };
4003
- const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: s, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p }) => {
4004
- let m = useContext(DisabledContext), [g, v] = f === void 0 ? useState(!1) : [f, p], y = () => {
4005
- !u && !m && v && v(!1);
3331
+ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p }) => {
3332
+ let h = useContext(DisabledContext), [_, v] = f === void 0 ? useState(!1) : [f, p], y = () => {
3333
+ !u && !h && v && v(!1);
4006
3334
  }, b = () => {
4007
- u || m || v && v(!g);
3335
+ u || h || v && v(!_);
4008
3336
  };
4009
3337
  useEffect(() => {
4010
- (u || m) && y();
4011
- }, [u, m]);
3338
+ (u || h) && y();
3339
+ }, [u, h]);
4012
3340
  let { renderLayer: x, arrowProps: S, layerProps: C, triggerProps: w } = useLayer({
4013
- isOpen: g,
3341
+ isOpen: _,
4014
3342
  placement: r,
4015
3343
  auto: !0,
4016
3344
  triggerOffset: 6,
@@ -4021,9 +3349,9 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
4021
3349
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
4022
3350
  ref: w.ref,
4023
3351
  onClick: b,
4024
- "data-testid": s,
3352
+ "data-testid": l,
4025
3353
  children: t
4026
- }), g && x(/* @__PURE__ */ jsxs("div", {
3354
+ }), _ && x(/* @__PURE__ */ jsxs("div", {
4027
3355
  className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
4028
3356
  ...C,
4029
3357
  children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: y }) : n, o && /* @__PURE__ */ jsx("div", {
@@ -4149,37 +3477,33 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
4149
3477
  let CellType = /* @__PURE__ */ function(e) {
4150
3478
  return e.INPUT = "Input", e.NUMBER_INPUT = "NumberInput", e.SELECT = "Select", e.POPOVER = "Popover", e.SLIDER = "Slider", e.CHECKBOX = "CheckBox", e.ACTIONS = "Actions", e.AUTO_UNIT = "AutoUnit", e.UNIT = "Unit", e.STATIC = "Static", e;
4151
3479
  }({});
4152
- const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment: r = Align.LEFT, width: i, testId: a, rowIndex: o, columnIndex: s }) => {
4153
- let { selectedIndexes: l, setSelectedIndexes: u } = useContext(CellSelectionContext), d = !t && l && l.row.start <= o && o <= l.row.end && l.column.start <= s && s <= l.column.end;
3480
+ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment: r = Align.LEFT, width: i, testId: a }) => {
4154
3481
  if (!e) return null;
4155
- let { style: f, colSpan: p, rowSpan: h, width: g } = e, v = useRef(null), y = {
3482
+ let { style: o, colSpan: s, rowSpan: c, width: l } = e, u = useRef(null), d = {
4156
3483
  bodyAlignment: r,
4157
3484
  headerAlignment: n,
4158
3485
  isHeader: t
4159
- }, b = getCellAlignment(y, cell_module_default), x = getCellAlignment(y, cell_module_default, !0), S = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, C = cx(cell_module_default.cell, S, e.hasSort ? cell_module_default.sortingCell : null, b, e.breakWord ? cell_module_default.breakWord : "", d ? cell_module_default.selectedCell : ""), w = g ?? i ?? void 0, T = e.type === CellType.STATIC || !e.type, E = t && T ? TextTransform.CAPITALIZE : void 0, D = {
4160
- width: w,
4161
- minWidth: w,
4162
- textTransform: E,
4163
- ...f
3486
+ }, f = getCellAlignment(d, cell_module_default), m = getCellAlignment(d, cell_module_default, !0), h = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, _ = cx(cell_module_default.cell, h, e.hasSort ? cell_module_default.sortingCell : null, f, e.breakWord ? cell_module_default.breakWord : ""), v = l ?? i ?? void 0, y = e.type === CellType.STATIC || !e.type, b = t && y ? TextTransform.CAPITALIZE : void 0, x = {
3487
+ width: v,
3488
+ minWidth: v,
3489
+ textTransform: b,
3490
+ ...o
4164
3491
  };
4165
3492
  return /* @__PURE__ */ jsx(t ? "th" : "td", {
4166
- ref: v,
4167
- className: C,
4168
- style: D,
4169
- colSpan: p,
4170
- rowSpan: h,
4171
- "data-row-index": o,
4172
- "data-column-index": s,
4173
- "data-selected": d,
3493
+ ref: u,
3494
+ className: _,
3495
+ style: x,
3496
+ colSpan: s,
3497
+ rowSpan: c,
4174
3498
  children: /* @__PURE__ */ jsx(CellWrapper, {
4175
3499
  cell: e,
4176
- columnAlignment: x ?? Align.RIGHT,
3500
+ columnAlignment: m ?? Align.RIGHT,
4177
3501
  isHeader: t,
4178
3502
  testId: a
4179
3503
  })
4180
3504
  });
4181
3505
  }, Row$1 = ({ row: e, rowIndex: t, isHeader: n = !1, columnCount: r, colSpan: i, columnHeaderAlignments: a = [], columnAlignment: o = [], hasRowActions: s, draggableTable: c = !1, columnWidths: l, dropDisabled: u = !1, height: d, testId: f }) => {
4182
- let p = getHeaderAlignment(a, n, t), { onRowClick: m, onRowFocus: h, onRowMouseEnter: g, onRowMouseLeave: v, expandedContent: y, error: b, warning: x, active: S } = e, C = e.cells.map((e, r) => {
3506
+ let p = getHeaderAlignment(a, n, t), { onRowClick: m, onRowFocus: h, onRowMouseEnter: _, onRowMouseLeave: v, expandedContent: y, error: b, warning: x, active: S } = e, C = e.cells.map((e, r) => {
4183
3507
  let i = `${n ? 0 : 1}_${t}_${r}`;
4184
3508
  return /* @__PURE__ */ jsx(Cell, {
4185
3509
  cell: e,
@@ -4187,18 +3511,14 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4187
3511
  columnAlignment: o[r],
4188
3512
  columnHeaderAlignment: p[r],
4189
3513
  width: l ? l[r] : void 0,
4190
- testId: e.testId,
4191
- rowIndex: t,
4192
- columnIndex: r
3514
+ testId: e.testId
4193
3515
  }, i);
4194
3516
  }), w = s && /* @__PURE__ */ jsx(Cell, {
4195
3517
  cell: {
4196
3518
  type: CellType.ACTIONS,
4197
3519
  actions: e.actions
4198
3520
  },
4199
- isHeader: n,
4200
- rowIndex: t,
4201
- columnIndex: r
3521
+ isHeader: n
4202
3522
  }, r), { attributes: T, listeners: E, setNodeRef: D, transform: O, transition: k, isDragging: A } = useSortable({
4203
3523
  id: t.toString(),
4204
3524
  animateLayoutChanges: () => !1
@@ -4218,10 +3538,10 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4218
3538
  });
4219
3539
  return n ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("tr", {
4220
3540
  onClick: m,
4221
- onMouseEnter: g,
3541
+ onMouseEnter: _,
4222
3542
  onMouseLeave: v,
4223
3543
  onFocus: h,
4224
- className: cx(m ? row_module_default$1.clickableRow : null, g ? row_module_default$1.hoverableRow : null),
3544
+ className: cx(m ? row_module_default$1.clickableRow : null, _ ? row_module_default$1.hoverableRow : null),
4225
3545
  children: [
4226
3546
  c ? /* @__PURE__ */ jsx("th", {}) : null,
4227
3547
  C,
@@ -4234,10 +3554,10 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4234
3554
  }, `${t}_expanded_content`) : null] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("tr", {
4235
3555
  ref: e.noDrag ? null : D,
4236
3556
  onClick: m,
4237
- onMouseEnter: g,
3557
+ onMouseEnter: _,
4238
3558
  onMouseLeave: v,
4239
3559
  onFocus: h,
4240
- className: cx(m && !m.noStyle ? row_module_default$1.clickableRow : null, g && !g.noStyle ? row_module_default$1.hoverableRow : null, S ? row_module_default$1.rowActive : null),
3560
+ className: cx(m && !m.noStyle ? row_module_default$1.clickableRow : null, _ && !_.noStyle ? row_module_default$1.hoverableRow : null, S ? row_module_default$1.rowActive : null),
4241
3561
  "data-error": b || null,
4242
3562
  "data-warning": x || null,
4243
3563
  "data-index": t,
@@ -4254,14 +3574,14 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4254
3574
  children: y.content
4255
3575
  }, `${t}_expanded_content`) : null] });
4256
3576
  }, TableDragWrapper = (e) => {
4257
- let { children: t, colSpan: n, columnAlignment: r, columnCount: i, draggable: a, onListReorder: o = () => {}, canListReorder: s = () => !0, rowActions: c, rows: l = [], tbodyRef: u } = e, [d, p] = useState(null), [m, g] = useState(!1), v = useMemo(() => l.map((e, t) => t.toString()), [l]);
3577
+ let { children: t, colSpan: n, columnAlignment: r, columnCount: i, draggable: a, onListReorder: o = () => {}, canListReorder: s = () => !0, rowActions: c, rows: l = [], tbodyRef: u } = e, [f, p] = useState(null), [h, _] = useState(!1), v = useMemo(() => l.map((e, t) => t.toString()), [l]);
4258
3578
  return a ? /* @__PURE__ */ jsxs(DndContext, {
4259
3579
  collisionDetection: closestCenter,
4260
3580
  onDragStart: (e) => {
4261
3581
  p(e.active.id);
4262
3582
  },
4263
3583
  onDragEnd: (e) => {
4264
- p(null), g(!1);
3584
+ p(null), _(!1);
4265
3585
  let { active: t, over: n } = e;
4266
3586
  if (!t || !n || t.id === n.id) return;
4267
3587
  let r = Number(t.id), i = Number(n?.id);
@@ -4278,23 +3598,23 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4278
3598
  from: r,
4279
3599
  to: i
4280
3600
  });
4281
- g(a);
3601
+ _(a);
4282
3602
  },
4283
3603
  children: [/* @__PURE__ */ jsx(SortableContext, {
4284
3604
  items: v,
4285
3605
  strategy: verticalListSortingStrategy,
4286
- children: t({ dropDisabled: m })
4287
- }), !!d && createPortal(/* @__PURE__ */ jsx(DragOverlay, {
3606
+ children: t({ dropDisabled: h })
3607
+ }), !!f && createPortal(/* @__PURE__ */ jsx(DragOverlay, {
4288
3608
  dropAnimation: null,
4289
3609
  children: /* @__PURE__ */ jsx("table", {
4290
3610
  className: cx(table_module_default.table, table_module_default.dragOverlay),
4291
3611
  children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(Row$1, {
4292
- rowIndex: Number(d),
4293
- row: l[Number(d)],
3612
+ rowIndex: Number(f),
3613
+ row: l[Number(f)],
4294
3614
  columnCount: i,
4295
3615
  columnWidths: (() => {
4296
3616
  if (!u?.current) return [];
4297
- let e = u.current.querySelectorAll("tr")[Number(d)]?.querySelectorAll("td");
3617
+ let e = u.current.querySelectorAll("tr")[Number(f)]?.querySelectorAll("td");
4298
3618
  if (!e) return [];
4299
3619
  let t = Array.from(e).map((e) => `${e.getBoundingClientRect().width}px`);
4300
3620
  return t.shift(), t;
@@ -4303,7 +3623,7 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4303
3623
  hasRowActions: c,
4304
3624
  columnAlignment: r,
4305
3625
  draggableTable: a,
4306
- dropDisabled: m
3626
+ dropDisabled: h
4307
3627
  }) })
4308
3628
  })
4309
3629
  }), document.body)]
@@ -4345,155 +3665,135 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4345
3665
  className: table_module_default.scroll,
4346
3666
  children: n({})
4347
3667
  });
4348
- }, Table = withValidationScope((e) => {
4349
- let { onListReorder: t = () => {}, canListReorder: n = () => !0, beforeRenderRow: r, table: i, enableMultiSelect: a } = e, { columnWidths: o, footer: s, name: c, rows: l = [], actions: u, actionsRight: d, columnHeaderAlignments: f, columnAlignment: p, striped: h = !0, testId: g, draggable: v, defaultEmptyRow: y = null, onAddRow: b = null, bordered: x = !0, maxHeight: S, fixedWidth: C, onPasteApply: w, validationRules: T } = i, E = useValidationScopeId(), D = useRef(E ?? nextScopeId()).current;
4350
- useRegisterValidationRules(D, T);
4351
- let O = useRef(null), k = useRef(null), { selectedIndexes: A, setSelectedIndexes: j, onCopy: M, onPaste: N, onKeyDown: P, onKeyUp: F, onMouseUp: I, onBlur: L, onMouseDown: R, onMouseMove: z } = useCellSelection(!!a, k, e.table.rows || [], w), B = get(e, "table.headers", []), V = getColumnCount(l, B), H = hasRowActions(l, B), U = V + (H ? 1 : 0), W = s ? s?.pagination?.rowsPerPage?.value === 0 || Number(s?.pagination?.selectedPage) >= Number(s?.pagination?.rowCount) / Number(s?.pagination?.rowsPerPage?.value) : !0, G = y?.cells?.length && b && W, K = {
4352
- cells: G ? y.cells.map((e, t) => e?.type === "Input" ? {
3668
+ }, Table = (e) => {
3669
+ let { onListReorder: t = () => {}, canListReorder: n = () => !0, beforeRenderRow: r, table: i } = e, { columnWidths: a, footer: o, name: s, rows: c = [], actions: l, actionsRight: u, columnHeaderAlignments: d, columnAlignment: f, striped: m = !0, testId: h, draggable: _, defaultEmptyRow: v = null, onAddRow: y = null, bordered: b = !0, maxHeight: x, fixedWidth: S } = i, C = useRef(null), w = useRef(null), T = get(e, "table.headers", []), E = getColumnCount(c, T), D = hasRowActions(c, T), O = E + (D ? 1 : 0), k = o ? o?.pagination?.rowsPerPage?.value === 0 || Number(o?.pagination?.selectedPage) >= Number(o?.pagination?.rowCount) / Number(o?.pagination?.rowsPerPage?.value) : !0, A = v?.cells?.length && y && k, j = {
3670
+ cells: A ? v.cells.map((e, t) => e?.type === "Input" ? {
4353
3671
  ...e,
4354
3672
  onChange: (e) => {
4355
3673
  let n = e?.target?.value, r = {
4356
- ...y,
4357
- cells: y.cells.map((e, r) => ({
3674
+ ...v,
3675
+ cells: v.cells.map((e, r) => ({
4358
3676
  ...e,
4359
3677
  value: r === t ? n : e?.value
4360
3678
  }))
4361
3679
  };
4362
- b({ newRow: r });
3680
+ y({ newRow: r });
4363
3681
  }
4364
3682
  } : {
4365
3683
  ...e,
4366
3684
  disabled: !0
4367
3685
  }) : null,
4368
- testId: g ? `${g}-last-empty-row` : void 0
4369
- }, q = G ? l.concat(K) : l, J = {
3686
+ testId: h ? `${h}-last-empty-row` : void 0
3687
+ }, M = A ? c.concat(j) : c, N = {
4370
3688
  ...i,
4371
- rows: q
4372
- }, Y = cx(table_module_default.wrapper, x ? table_module_default.bordered : ""), X = {
4373
- maxHeight: S,
4374
- width: C,
4375
- display: C === "auto" ? "inline-flex" : "flex"
4376
- };
4377
- return /* @__PURE__ */ jsx(ValidationScopeContext.Provider, {
4378
- value: D,
4379
- children: /* @__PURE__ */ jsxs("div", {
4380
- className: Y,
4381
- style: X,
4382
- children: [
4383
- /* @__PURE__ */ jsx(Title$1, {
4384
- actions: u,
4385
- actionsRight: d,
4386
- name: c,
4387
- testId: g && `${g}-title`
4388
- }),
4389
- /* @__PURE__ */ jsx(TableDragWrapper, {
4390
- colSpan: U,
4391
- columnAlignment: p,
4392
- columnCount: V,
4393
- draggable: v,
4394
- onListReorder: t,
4395
- rowActions: H,
4396
- rows: q,
4397
- tbodyRef: k,
4398
- canListReorder: n,
4399
- children: ({ dropDisabled: e }) => /* @__PURE__ */ jsx(TableScrollWrapper, {
4400
- table: J,
4401
- theadRef: O,
4402
- children: ({ virtualizer: t, tableStyle: n }) => /* @__PURE__ */ jsx(CellSelectionContext.Provider, {
4403
- value: {
4404
- selectedIndexes: A,
4405
- setSelectedIndexes: j
4406
- },
4407
- children: /* @__PURE__ */ jsxs("table", {
4408
- className: cx(table_module_default.table, h ? table_module_default.striped : ""),
4409
- "data-testid": g,
4410
- "data-multiselect": !!a,
4411
- style: n,
4412
- children: [/* @__PURE__ */ jsx("thead", {
4413
- ref: O,
4414
- children: B.map((e, t) => /* @__PURE__ */ jsx(Row$1, {
4415
- rowIndex: t,
4416
- isHeader: !0,
4417
- row: e,
4418
- columnCount: V,
4419
- columnWidths: o,
4420
- colSpan: U,
4421
- hasRowActions: H,
4422
- columnAlignment: p,
4423
- columnHeaderAlignments: f,
4424
- draggableTable: v
4425
- }, `0_${t}`))
4426
- }), /* @__PURE__ */ jsx("tbody", {
4427
- ref: k,
4428
- onCopy: M,
4429
- onPaste: N,
4430
- onKeyDown: P,
4431
- onKeyUp: F,
4432
- onMouseDown: R,
4433
- onMouseUp: I,
4434
- onMouseMove: z,
4435
- onBlur: L,
4436
- children: t ? t.getVirtualItems().map((t) => {
4437
- let n = t.index, i = q[n], a = r ? r({
4438
- row: i,
4439
- rowIndex: n
4440
- }) : i;
4441
- return /* @__PURE__ */ jsx(Row$1, {
4442
- rowIndex: n,
4443
- row: a,
4444
- columnCount: V,
4445
- columnWidths: o,
4446
- colSpan: U,
4447
- hasRowActions: H,
4448
- columnAlignment: p,
4449
- draggableTable: v,
4450
- height: t.size,
4451
- dropDisabled: e
4452
- }, `1_${n}`);
4453
- }) : q.map((t, n) => {
4454
- let i = r ? r({
4455
- row: t,
4456
- rowIndex: n
4457
- }) : t;
4458
- return /* @__PURE__ */ jsx(Row$1, {
4459
- rowIndex: n,
4460
- row: i,
4461
- columnCount: V,
4462
- columnWidths: o,
4463
- colSpan: U,
4464
- hasRowActions: H,
4465
- columnAlignment: p,
4466
- draggableTable: v,
4467
- dropDisabled: e
4468
- }, `1_${n}`);
4469
- })
4470
- })]
3689
+ rows: M
3690
+ }, P = cx(table_module_default.wrapper, b ? table_module_default.bordered : "");
3691
+ return /* @__PURE__ */ jsxs("div", {
3692
+ className: P,
3693
+ style: {
3694
+ maxHeight: x,
3695
+ width: S,
3696
+ display: S === "auto" ? "inline-flex" : "flex"
3697
+ },
3698
+ children: [
3699
+ /* @__PURE__ */ jsx(Title$1, {
3700
+ actions: l,
3701
+ actionsRight: u,
3702
+ name: s,
3703
+ testId: h && `${h}-title`
3704
+ }),
3705
+ /* @__PURE__ */ jsx(TableDragWrapper, {
3706
+ colSpan: O,
3707
+ columnAlignment: f,
3708
+ columnCount: E,
3709
+ draggable: _,
3710
+ onListReorder: t,
3711
+ rowActions: D,
3712
+ rows: M,
3713
+ tbodyRef: w,
3714
+ canListReorder: n,
3715
+ children: ({ dropDisabled: e }) => /* @__PURE__ */ jsx(TableScrollWrapper, {
3716
+ table: N,
3717
+ theadRef: C,
3718
+ children: ({ virtualizer: t, tableStyle: n }) => /* @__PURE__ */ jsxs("table", {
3719
+ className: cx(table_module_default.table, m ? table_module_default.striped : ""),
3720
+ "data-testid": h,
3721
+ style: n,
3722
+ children: [/* @__PURE__ */ jsx("thead", {
3723
+ ref: C,
3724
+ children: T.map((e, t) => /* @__PURE__ */ jsx(Row$1, {
3725
+ rowIndex: t,
3726
+ isHeader: !0,
3727
+ row: e,
3728
+ columnCount: E,
3729
+ columnWidths: a,
3730
+ colSpan: O,
3731
+ hasRowActions: D,
3732
+ columnAlignment: f,
3733
+ columnHeaderAlignments: d,
3734
+ draggableTable: _
3735
+ }, `0_${t}`))
3736
+ }), /* @__PURE__ */ jsx("tbody", {
3737
+ ref: w,
3738
+ children: t ? t.getVirtualItems().map((t) => {
3739
+ let n = t.index, i = M[n], o = r ? r({
3740
+ row: i,
3741
+ rowIndex: n
3742
+ }) : i;
3743
+ return /* @__PURE__ */ jsx(Row$1, {
3744
+ rowIndex: n,
3745
+ row: o,
3746
+ columnCount: E,
3747
+ columnWidths: a,
3748
+ colSpan: O,
3749
+ hasRowActions: D,
3750
+ columnAlignment: f,
3751
+ draggableTable: _,
3752
+ height: t.size,
3753
+ dropDisabled: e
3754
+ }, `1_${n}`);
3755
+ }) : M.map((t, n) => {
3756
+ let i = r ? r({
3757
+ row: t,
3758
+ rowIndex: n
3759
+ }) : t;
3760
+ return /* @__PURE__ */ jsx(Row$1, {
3761
+ rowIndex: n,
3762
+ row: i,
3763
+ columnCount: E,
3764
+ columnWidths: a,
3765
+ colSpan: O,
3766
+ hasRowActions: D,
3767
+ columnAlignment: f,
3768
+ draggableTable: _,
3769
+ dropDisabled: e
3770
+ }, `1_${n}`);
4471
3771
  })
4472
- })
3772
+ })]
4473
3773
  })
4474
- }),
4475
- s && /* @__PURE__ */ jsx(Footer, {
4476
- pagination: s.pagination,
4477
- actions: s.actions,
4478
- content: s.content
4479
3774
  })
4480
- ]
4481
- })
3775
+ }),
3776
+ o && /* @__PURE__ */ jsx(Footer, {
3777
+ pagination: o.pagination,
3778
+ actions: o.actions,
3779
+ content: o.content
3780
+ })
3781
+ ]
4482
3782
  });
4483
- }), placeholder$1 = "blank", getUpdatedErrors = (e, t, n, r) => {
3783
+ }, placeholder$1 = "blank", getUpdatedErrors = (e, t, n, r) => {
4484
3784
  let i = `${t} → ${n}:`, a = e.filter((e) => !e.startsWith(i)), o = r ? [...a, `${i} ${r}`] : a, s = o.length === 0;
4485
3785
  return {
4486
3786
  updatedErrors: o,
4487
3787
  isValid: s
4488
3788
  };
4489
3789
  }, Table$1 = ({ validationRules: e, parsedResult: t, updateState: n, testId: r }) => {
4490
- let i = useMemo(() => t.fields.map((e) => ({ value: e })), [t.fields]), [a, o] = useState(20), [c, u] = useState(1), d = useRef([]), p = (c - 1) * a, g = a === 0 ? t.rows.length : p + a, [_, v] = useState([]), y = useCallback((r, a) => (!d.current.length && t.rows.length && (d.current = t.rows[0].map((e) => isNumericLike(e) ? "NumberInput" : "Input")), {
3790
+ let i = useMemo(() => t.fields.map((e) => ({ value: e })), [t.fields]), [a, s] = useState(20), [l, u] = useState(1), f = useRef([]), h = (l - 1) * a, g = a === 0 ? t.rows.length : h + a, [_, v] = useState([]), y = useCallback((r, a) => (!f.current.length && t.rows.length && (f.current = t.rows[0].map((e) => isNumericLike(e) ? "NumberInput" : "Input")), {
4491
3791
  cells: r.map((r, o) => {
4492
- let { columnMessage: s = {}, validator: c = () => null } = e?.[o] ?? {}, l = i?.[o]?.value, u = `${`Row ${a + 1}`} → ${l}:`, f = c(r), p = t?.errors?.find((e) => e.startsWith(u)) ?? null, m = f || p || null;
3792
+ let { columnMessage: s = {}, validator: c = () => null } = e?.[o] ?? {}, l = i?.[o]?.value, u = `${`Row ${a + 1}`} → ${l}:`, d = c(r), p = t?.errors?.find((e) => e.startsWith(u)) ?? null, m = d || p || null;
4493
3793
  return {
4494
3794
  name: l,
4495
3795
  value: r,
4496
- type: d.current[o] ?? "Input",
3796
+ type: f.current[o] ?? "Input",
4497
3797
  disableValidationOnFocus: !0,
4498
3798
  error: m,
4499
3799
  validationCallback: (e, r) => {
@@ -4578,12 +3878,12 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4578
3878
  i,
4579
3879
  x,
4580
3880
  b
4581
- ]), C = useMemo(() => _.slice(p, g), [
3881
+ ]), C = useMemo(() => _.slice(h, g), [
4582
3882
  _,
4583
- p,
3883
+ h,
4584
3884
  g
4585
3885
  ]), w = useCallback(({ rowIndex: e }) => {
4586
- let n = p + e, r = t.rows[n];
3886
+ let n = h + e, r = t.rows[n];
4587
3887
  return r ? y(r, n) : {
4588
3888
  cells: [],
4589
3889
  actions: []
@@ -4591,7 +3891,7 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4591
3891
  }, [
4592
3892
  t.rows,
4593
3893
  y,
4594
- p
3894
+ h
4595
3895
  ]);
4596
3896
  return /* @__PURE__ */ jsx(Table, {
4597
3897
  beforeRenderRow: w,
@@ -4617,10 +3917,10 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
4617
3917
  infiniteScroll: !0,
4618
3918
  footer: { pagination: {
4619
3919
  rowCount: t.rows.length,
4620
- selectedPage: c,
3920
+ selectedPage: l,
4621
3921
  rowsPerPage: {
4622
3922
  value: a,
4623
- onChange: (e) => o(Number(e?.target?.value)),
3923
+ onChange: (e) => s(Number(e?.target?.value)),
4624
3924
  options: [
4625
3925
  {
4626
3926
  label: "10 / page",
@@ -4730,7 +4030,210 @@ const Empty = ({ width: e = "auto", height: t = "auto", text: n = "No data", chi
4730
4030
  }), extraSeparators = (e) => e?.split(/;|\t|\n/)?.some((e) => {
4731
4031
  let t = e?.match(/[.,]/g);
4732
4032
  return t && t.length > 1;
4733
- }), hasOneComma = (e) => e?.split(/;|\t|\n/)?.some((e) => !e?.includes(".") && e?.match(/,/g)?.length === 1), toast = ({ id: e, message: t = {
4033
+ }), hasOneComma = (e) => e?.split(/;|\t|\n/)?.some((e) => !e?.includes(".") && e?.match(/,/g)?.length === 1);
4034
+ var isValidLength = (e, t, n) => e >= t - n, isNonPlaceholderUnit = (e) => !!e && e !== "blank" && e.trim() !== "", validateColumnLength = (e, t, n, r, i, a, o) => {
4035
+ let s = [], c = r.filter((e) => e.optionalColumn).length, l = r.length, u = c ? `${l - c} or ${l}` : `${l}`, d = i && a ? 2 : i || a ? 1 : 0;
4036
+ if (i && !isValidLength(e.length, l, c) && s.push(o("incorrectNumberOfFieldNameHeaderColumns", { expectedLengthMessage: u })), a) {
4037
+ let e = r.filter((e) => Array.isArray(e?.validUnits) && e?.validUnits?.some(isNonPlaceholderUnit)).length, n = t?.filter(isNonPlaceholderUnit)?.length, i = r?.filter((e) => e?.optionalColumn || !Array.isArray(e?.validUnits) || e.validUnits.includes("blank"))?.length;
4038
+ isValidLength(n, e, i) || s.push(o("incorrectNumberOfUnitHeaderColumns", { expectedLengthMessage: u }));
4039
+ }
4040
+ return n.length === 0 ? s.push(o("incorrectNumberOfDataColumns", {
4041
+ expectedLengthMessage: u,
4042
+ dataRowStartIndex: d
4043
+ })) : n.forEach((e, t) => {
4044
+ isValidLength(e.length, l, c) || s.push(o("incorrectNumberOfDataColumns", {
4045
+ expectedLengthMessage: u,
4046
+ dataRowStartIndex: d + t
4047
+ }));
4048
+ }), s;
4049
+ }, normalize = (e) => e.toUpperCase().replace(/\(.*?\)/g, "").replace(/[^A-Z0-9]/g, "").trim(), defaultFieldNameValidator = ({ value: e, defaultAllowedValues: t }) => {
4050
+ let n = normalize(e);
4051
+ return t?.some((e) => normalize(e).includes(n) || n.includes(normalize(e))) ?? !1;
4052
+ }, defaultUnitsValidator = ({ value: e, defaultAllowedValues: t }) => t?.includes(e) ?? !1, validateHeadings = (e, t, n, r, i, a) => {
4053
+ let o = [];
4054
+ if (r) {
4055
+ let r = n.map((e) => e.fieldName).filter(Boolean);
4056
+ e.forEach((i, s) => {
4057
+ let c = n[s];
4058
+ !c || !c?.fieldName || (n[s]?.fieldNameValidator ?? defaultFieldNameValidator)({
4059
+ value: i,
4060
+ defaultAllowedValues: r,
4061
+ columnIndex: s,
4062
+ fields: e,
4063
+ units: t
4064
+ }) || o.push(a("incorrectFieldName", {
4065
+ i: s + 1,
4066
+ correctName: n[s]?.fieldName || a("notExist"),
4067
+ wrongName: i || a("notApplicable")
4068
+ }));
4069
+ });
4070
+ }
4071
+ if (i) {
4072
+ let i = n.map((e) => e?.validUnits), s = r ? 1 : 0;
4073
+ t.forEach((r, c) => {
4074
+ let l = n[c];
4075
+ if (!l) return;
4076
+ let u = l.unitsValidator ?? defaultUnitsValidator, d = i?.[c];
4077
+ u({
4078
+ value: r,
4079
+ defaultAllowedValues: d,
4080
+ columnIndex: c,
4081
+ fields: e,
4082
+ units: t
4083
+ }) || o.push(a("incorrectUnitRow", {
4084
+ unitRowIndex: s,
4085
+ i: c + 1,
4086
+ wrongUnit: r || a("notApplicable"),
4087
+ correctUnit: d?.join(",") || a("notExist")
4088
+ }));
4089
+ });
4090
+ }
4091
+ return o;
4092
+ }, validateValues = (e, t, n) => {
4093
+ let r = [];
4094
+ return e.forEach((e, i) => {
4095
+ e.forEach((e, a) => {
4096
+ let o = t[a];
4097
+ if (!o || !o.validator) return;
4098
+ let s = o.validator(e);
4099
+ s && typeof s == "string" && r.push(`${s} ${n("rowColumn", {
4100
+ rowIndex: i + 2,
4101
+ columnIndex: a
4102
+ })}`);
4103
+ });
4104
+ }), r;
4105
+ };
4106
+ const validate = (e, t, n, r, i, a, o) => {
4107
+ let s = validateColumnLength(e, t, n, r, i, a, o);
4108
+ return s.length === 0 && (s = s.concat(validateHeadings(e, t, r, i, a, o), validateValues(n, r, o))), {
4109
+ isValid: s.length === 0,
4110
+ errors: s
4111
+ };
4112
+ }, hasHeaders = (e, t, n) => {
4113
+ let r = (e) => e.replace(/,/g, "."), i = e[0]?.some((e) => isNaN(Number(r(e)))) ?? !1, a = e[1]?.some((e) => isNaN(Number(r(e)))) ?? !1, o = e[0]?.some((e) => t.includes(e)) ?? !1, s = e[0]?.some((e) => n.includes(e)) ?? !1, c = e[1]?.some((e) => n.includes(e)) ?? !1, l = e[0]?.some((e) => !isNaN(Number(r(e)))) ?? !1, u = e[1]?.some((e) => !isNaN(Number(r(e)))) ?? !1;
4114
+ return {
4115
+ hasFieldNameHeader: o || i && !s && !l || i && a && !l,
4116
+ hasUnitHeader: s || c || i && a && !s && !l && !u || i && a && !l && !u
4117
+ };
4118
+ }, guessMissingHeaders = (e, { validationRules: t }) => {
4119
+ let n = t?.length === (e?.[0]?.length ?? 0) ? t : t?.filter((e) => !e?.optionalColumn), r = n?.map((e) => e?.fieldName), i = (e) => Array.isArray(e) && e.length ? e[0] : "", a = n?.map((e) => e?.defaultUnit ?? i(e?.validUnits)), o = n?.map((e) => e?.validUnits)?.filter((e) => !!e)?.flat(), { hasFieldNameHeader: s, hasUnitHeader: c } = hasHeaders(e, r, o);
4120
+ return s || e?.unshift(r), c || e?.splice(1, 0, a), {
4121
+ hasFieldNameHeader: s,
4122
+ hasUnitHeader: c
4123
+ };
4124
+ }, depthRound = (e) => Math.round(e * 100) / 100;
4125
+ var joinArray = (e) => e.join(", ").replace(/,\s*$/, ""), basePapaConfig = {
4126
+ skipEmptyLines: !0,
4127
+ transform: (e) => e?.trim(),
4128
+ delimiter: (e) => {
4129
+ let t = e.substring(0, 200), n = (t.match(/\t/g) ?? []).length, r = (t.match(/;/g) ?? []).length;
4130
+ return n === 0 && r === 0 ? "," : n > r ? " " : ";";
4131
+ }
4132
+ }, allowedMimes = [
4133
+ "text/csv",
4134
+ "text/plain",
4135
+ "application/json",
4136
+ "application/vnd.ms-excel"
4137
+ ], isAllowedFileType = (e) => allowedMimes.includes(e.type), isFile = (e) => e instanceof File, isJson = (e) => e.trim().startsWith("["), isCustomJson = (e) => {
4138
+ try {
4139
+ return !!JSON.parse(e)?.path;
4140
+ } catch {
4141
+ return !1;
4142
+ }
4143
+ };
4144
+ const readFile$1 = (e) => new Promise((t, n) => {
4145
+ let r = new FileReader();
4146
+ r.onload = () => t(String(r.result)), r.onerror = n, r.readAsText(e);
4147
+ });
4148
+ var parseJson = async (e, t, n) => {
4149
+ try {
4150
+ let r = JSON.parse(e);
4151
+ return onCompleteParse({
4152
+ data: r,
4153
+ errors: []
4154
+ }, t, n);
4155
+ } catch (e) {
4156
+ throw Error(`${n("jsonParseFailed")} ${e.message}`);
4157
+ }
4158
+ }, parseCustomJson = async (e, t, n) => {
4159
+ try {
4160
+ let r = JSON.parse(e).path.map((e) => [
4161
+ depthRound(e.md),
4162
+ depthRound(e.inclination),
4163
+ depthRound(e.gridAzimuth)
4164
+ ]);
4165
+ return r.unshift([
4166
+ "m",
4167
+ "deg",
4168
+ "deg"
4169
+ ]), onCompleteParse({
4170
+ data: r,
4171
+ errors: []
4172
+ }, t, n);
4173
+ } catch (e) {
4174
+ throw Error(`${n("jsonParseFailed")} ${e.message}`);
4175
+ }
4176
+ };
4177
+ const replaceWithDot = (e) => e.replace(",", "."), replaceDataCommasWithDots = (e) => e.map((e) => e.map((e) => replaceWithDot(e)));
4178
+ var parseDSV = (e, { importLimit: t,...n }, r) => new Promise((i) => {
4179
+ Papa.parse(e, {
4180
+ ...basePapaConfig,
4181
+ preview: t,
4182
+ complete: (e) => {
4183
+ let a = onCompleteParse(e, {
4184
+ importLimit: t,
4185
+ ...n
4186
+ }, r);
4187
+ a.rows = replaceDataCommasWithDots(a.rows), i(a);
4188
+ }
4189
+ });
4190
+ });
4191
+ const parse = async (e, t, n) => {
4192
+ let r = {
4193
+ isValid: !1,
4194
+ fields: [],
4195
+ units: [],
4196
+ rows: [],
4197
+ errors: []
4198
+ };
4199
+ try {
4200
+ if (isFile(e) && !isAllowedFileType(e)) return r.errors.push(`${n("wrongFileFormatExpectedOneOf")} ${joinArray(Array.from(allowedMimes))}`), r;
4201
+ let i = isFile(e) ? await readFile$1(e) : e;
4202
+ return isJson(i) ? await parseJson(i, t, n) : isCustomJson(i) ? await parseCustomJson(i, t, n) : await parseDSV(e, t, n);
4203
+ } catch (e) {
4204
+ return r.errors.push(e.message), r;
4205
+ }
4206
+ }, unParse = (e, t, n, r) => {
4207
+ let i = r?.delimiter ?? ",", a = [
4208
+ e,
4209
+ t,
4210
+ ...n
4211
+ ].filter(Boolean);
4212
+ return Papa.unparse(a, {
4213
+ quotes: !1,
4214
+ header: !0,
4215
+ delimiter: i
4216
+ });
4217
+ };
4218
+ var onCompleteParse = (e, t, n) => {
4219
+ let { data: r, errors: i } = e, a = {
4220
+ isValid: !1,
4221
+ fields: [],
4222
+ units: [],
4223
+ rows: [],
4224
+ errors: i.map((e) => e.message)
4225
+ };
4226
+ if (i.length > 0) return a;
4227
+ let { hasFieldNameHeader: o, hasUnitHeader: s } = guessMissingHeaders(r, t);
4228
+ a.fields = r[0].map((e) => e.trim()), a.units = r[1].map((e) => e.trim()).filter(Boolean), a.rows = r.slice(2);
4229
+ let { validationRules: c } = t;
4230
+ if (c.length) {
4231
+ let { isValid: e, errors: t } = validate(a.fields, a.units, a.rows, c, o, s, n);
4232
+ a.errors.push(...t), a.isValid = e && t.length === 0;
4233
+ } else a.isValid = a.errors.length === 0;
4234
+ return a;
4235
+ };
4236
+ const toast = ({ id: e, message: t = {
4734
4237
  type: MessageType.INFO,
4735
4238
  content: ""
4736
4239
  }, autoClose: n = 6e3, onClose: r }) => {
@@ -4785,13 +4288,13 @@ var toggle_module_default = {
4785
4288
  noMargin: "_noMargin_1c9wf_110",
4786
4289
  helpIconEnabled: "_helpIconEnabled_1c9wf_113"
4787
4290
  };
4788
- const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: s = !1, testId: l, helpText: u, onClickHelp: d }) => {
4789
- let f = useContext(DisabledContext), p = u || d, m = r || f;
4291
+ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: c = !1, testId: l, helpText: u, onClickHelp: d, textTransform: f = TextTransform.CAPITALIZE }) => {
4292
+ let p = useContext(DisabledContext), m = u || d, h = r || p;
4790
4293
  return /* @__PURE__ */ jsxs("div", {
4791
- className: cx(toggle_module_default.toggle, m ? toggle_module_default.disabled : null, a ? toggle_module_default.small : null, s ? toggle_module_default.noMargin : null),
4294
+ className: cx(toggle_module_default.toggle, h ? toggle_module_default.disabled : null, a ? toggle_module_default.small : null, c ? toggle_module_default.noMargin : null),
4792
4295
  style: { display: i },
4793
4296
  onClick: (t) => {
4794
- m || (t.target.name = e, t.target.checked = !n, t.target.value = !n, o(t));
4297
+ h || (t.target.name = e, t.target.checked = !n, t.target.value = !n, o(t));
4795
4298
  },
4796
4299
  "data-testid": l,
4797
4300
  children: [
@@ -4799,19 +4302,22 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4799
4302
  type: InputType.CHECKBOX,
4800
4303
  name: e,
4801
4304
  value: n?.toString(),
4802
- disabled: m,
4305
+ disabled: h,
4803
4306
  checked: n,
4804
4307
  onChange: () => {}
4805
4308
  }),
4806
- /* @__PURE__ */ jsx("label", { children: t }),
4807
- p && /* @__PURE__ */ jsx("div", {
4309
+ /* @__PURE__ */ jsx("label", {
4310
+ style: { textTransform: f },
4311
+ children: t
4312
+ }),
4313
+ m && /* @__PURE__ */ jsx("div", {
4808
4314
  className: toggle_module_default.helpIconEnabled,
4809
4315
  onClick: d,
4810
4316
  children: /* @__PURE__ */ jsx(HelpIcon, { text: u })
4811
4317
  })
4812
4318
  ]
4813
4319
  });
4814
- }, PasteWithReviewModal = ({ config: e, state: t, updateState: n, setModalVisibility: r, onCloseModal: i, readAndParseInput: a, validationRules: o = [], onCompleteImport: c = () => {}, prevalidationConfig: l, t: u, loading: d, startTransition: f, testId: p }) => {
4320
+ }, PasteWithReviewModal = ({ config: e, state: t, updateState: n, setModalVisibility: r, onCloseModal: i, readAndParseInput: a, validationRules: s = [], onCompleteImport: c = () => {}, prevalidationConfig: l, t: u, loading: d, startTransition: f, testId: h }) => {
4815
4321
  let { modalVisibility: { reviewPasteModal: g, pasteModalHelpVisible: _, helpModal: v } } = t, { warningMessage: y, actionButtonLabel: b, changeRulesAction: x, checkPrevalidationNeed: S } = l ?? {}, C = useRef(null), [w, T] = useState(!1), [E, D] = useState({
4816
4322
  pastedText: "",
4817
4323
  parsedResult: {
@@ -4832,15 +4338,15 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4832
4338
  let O = useCallback((t) => {
4833
4339
  if (t) {
4834
4340
  let t = SimplifyAP(N?.rows?.map(([e, t]) => [Number(e), Number(t)]), .001).map(([e, t]) => [e.toString(), t.toString()]), n = e.importLimit ?? 1e4, r = {
4835
- validationRules: o,
4341
+ validationRules: s,
4836
4342
  importLimit: n
4837
- }, i = N.fields.slice(0, 2), a = (N.units ?? []).slice(0, 2), s = unParse(i, a, t, r);
4343
+ }, i = N.fields.slice(0, 2), a = (N.units ?? []).slice(0, 2), o = unParse(i, a, t, r);
4838
4344
  f(() => D({
4839
4345
  parsedResult: {
4840
4346
  ...N,
4841
4347
  rows: t
4842
4348
  },
4843
- pastedText: s
4349
+ pastedText: o
4844
4350
  })), C.current = E;
4845
4351
  } else f(() => {
4846
4352
  C.current && D(C.current);
@@ -4849,7 +4355,7 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4849
4355
  }, [
4850
4356
  E,
4851
4357
  n,
4852
- o
4358
+ s
4853
4359
  ]), k = () => {
4854
4360
  D({
4855
4361
  pastedText: "",
@@ -4902,7 +4408,7 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4902
4408
  ]
4903
4409
  }),
4904
4410
  _ && /* @__PURE__ */ jsx(Help, {
4905
- validationRules: o,
4411
+ validationRules: s,
4906
4412
  t: u
4907
4413
  }),
4908
4414
  R ? /* @__PURE__ */ jsx("div", {
@@ -4935,7 +4441,7 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4935
4441
  },
4936
4442
  colored: !0,
4937
4443
  loading: d,
4938
- testId: `${p}-paste-from-clipboard-button`
4444
+ testId: `${h}-paste-from-clipboard-button`
4939
4445
  })
4940
4446
  ]
4941
4447
  })
@@ -4967,7 +4473,7 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4967
4473
  } })
4968
4474
  ]
4969
4475
  }), /* @__PURE__ */ jsx(Table$1, {
4970
- validationRules: o,
4476
+ validationRules: s,
4971
4477
  parsedResult: N,
4972
4478
  updateState: (e) => D((t) => ({
4973
4479
  ...t,
@@ -4994,7 +4500,7 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
4994
4500
  onClick: () => f(() => j()),
4995
4501
  disabled: R || !F,
4996
4502
  loading: d,
4997
- testId: `${p}-paste-with-review-modal-button-okay`
4503
+ testId: `${h}-paste-with-review-modal-button-okay`
4998
4504
  }),
4999
4505
  /* @__PURE__ */ jsx(Button, {
5000
4506
  label: u("cancel"),
@@ -5040,7 +4546,75 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5040
4546
  return;
5041
4547
  }
5042
4548
  return t;
5043
- }, [t, n]), normalizeParsedResult = (e) => {
4549
+ }, [t, n]), enTranslations = {
4550
+ cancel: "Cancel",
4551
+ chooseFile: "Choose file",
4552
+ copyDecimalComma: "Copy (decimal comma)",
4553
+ copyDecimalDot: "Copy (decimal dot)",
4554
+ copyToClipboard: "Copy to clipboard",
4555
+ copiedToClipboard: "Copied to clipboard",
4556
+ deleteAllRows: "Delete all rows",
4557
+ downloadFile: "Download file",
4558
+ export: "Export",
4559
+ help: "Help",
4560
+ import: "Import",
4561
+ noFileSelected: "No file selected",
4562
+ notApplicable: "N/A",
4563
+ notExist: "not exist",
4564
+ okay: "Okay",
4565
+ uploadCapitalized: "Upload",
4566
+ uploadFile: "Upload file",
4567
+ pasteShortcutHint: "You can also press Ctrl+V or Command+V to paste from clipboard",
4568
+ pasteFromClipboard: "Paste from clipboard",
4569
+ clipboardIsEmpty: "Clipboard is empty",
4570
+ clipboardReadFailed: "Unable to read data from clipboard. Check formatting or try Paste with Review.",
4571
+ clipboardReadNotAllowed: "Your browser did not allow reading the clipboard. Upgrade browser or try Paste with Review.",
4572
+ pasteSuccessful: "Paste successful",
4573
+ pasteWithReview: "Paste with review",
4574
+ pasteWithReviewRoundBrackets: "Paste (with review)",
4575
+ quickPasteFromClipboard: "Quick paste from clipboard",
4576
+ unableToCopyToClipboard: "Unable to copy to clipboard",
4577
+ fileParsingFailed: "Failed to read or validate the file. Please check the format and try again.",
4578
+ importWarning: "Large data detected: More than 500 rows have been imported. You can choose to import all or downsample for better performance.",
4579
+ importLimitExceeded: "Import failed: The data exceeds the 5000-row limit. Please reduce the number of rows and try again.",
4580
+ importingData: "Importing data",
4581
+ incorrectFieldName: "Incorrect field name (row 0, column {{i}}: has name {{wrongName}}, but should be {{correctName}})",
4582
+ incorrectNumberOfDataColumns: "Incorrect number of data columns, expected {{expectedLengthMessage}} columns in row {{dataRowStartIndex}}",
4583
+ incorrectNumberOfFieldNameHeaderColumns: "Incorrect number of field name header columns, expected {{expectedLengthMessage}} columns in row 0",
4584
+ incorrectNumberOfUnitHeaderColumns: "Incorrect number of unit header columns, expected {{expectedLengthMessage}} columns in row 1",
4585
+ incorrectUnitRow: "Incorrect unit (row {{unitRowIndex}}, column {{i}}: has unit [{{wrongUnit}}], but should be [{{correctUnit}}])",
4586
+ jsonParseFailed: "JSON parse failed",
4587
+ pasteYourTableDataHereToImportIt: "Paste your table data here to import it",
4588
+ rowColumn: "(row {{rowIndex}}, column {{columnIndex}})",
4589
+ theValuesCanBeSeparatedByDifferentDelimiters: "The values can be separated by different delimiters",
4590
+ unableToImportPleaseCorrectError: "Unable to import - {{rows}} rows have errors. Please correct input data and try again.",
4591
+ unableToPrepareExportData: "Unable to prepare export – see console for details.",
4592
+ validInputForPaste: "Valid input for paste.",
4593
+ wrongFileFormatExpectedOneOf: "Wrong file format: expected one of",
4594
+ youCanImportDataByPastingOrByMessage: "You can import data by pasting (e.g. from a spreadsheet), or by uploading a text file ( .txt or .csv ).",
4595
+ commasAsDecimals: "Comma is treated as a decimal separator when it is the only separator",
4596
+ deletePastedContent: "Delete pasted content",
4597
+ downsampled: "Downsampled",
4598
+ downsampleSuccess: "Successfully downsampled from {{from}} rows to {{to}} rows.",
4599
+ downsampleTooltip: "Reduces number of data rows (decimation) using the Ramer–Douglas–Peucker algorithm.",
4600
+ extraSeparators: "Two or more separators detected. Kept only last one as decimal separator, please control your import results",
4601
+ noDataPastedYet: "No data pasted yet.",
4602
+ semicolonSeparatedValues: "Semicolon-separated values",
4603
+ tabSeparatedValues: "Tab-separated values",
4604
+ examples: "Examples",
4605
+ smartUpload_description: "Upload image and extract table content using a LLM",
4606
+ smartUpload_smartUpload: "Smart Upload",
4607
+ toUploadOrImportFromClipboardMessage: "To upload or import from clipboard please select your preferred unit in the table header and upload or paste numbers only for Depth, Inc, Azi. Follow example below"
4608
+ }, interpolate = (e, t = {}) => e?.replace(/\{\{(\w+)\}\}/g, (e, n) => t?.[n] === void 0 ? "" : String(t?.[n])), useTranslationMap = (e) => useMemo(() => {
4609
+ let t = Object.keys(enTranslations).reduce((t, n) => {
4610
+ let r = enTranslations?.[n];
4611
+ return t[n] = e?.[n] ?? r, t;
4612
+ }, {});
4613
+ return (e, n) => {
4614
+ let r = t[e];
4615
+ return n ? interpolate(r, n) : r;
4616
+ };
4617
+ }, [e]), normalizeParsedResult = (e) => {
5044
4618
  let { rows: t } = e, n = Array(t.length);
5045
4619
  for (let e = 0; e < t.length; e++) {
5046
4620
  let r = t[e], i = Array(r.length);
@@ -5052,16 +4626,16 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5052
4626
  rows: n
5053
4627
  };
5054
4628
  }, useDataImportActions = ({ config: e, state: t, setState: n, smartUploadConfig: r, startTransition: i }) => {
5055
- let { exportData: a, beforeExportData: o, importLimit: c = 1e4, translations: l, onImportComplete: u = () => {}, disablePasteSuccessfulToast: d, prevalidationConfig: f, onDeleteRows: p } = e ?? {}, { parsedResult: m } = t, { checkPrevalidationNeed: h } = f ?? {}, g = useTranslationMap(l), _ = useExportData(g, a, o), { parseAndValidate: v, rules: y } = useScopedParseAndValidate(), b = useCallback((e) => {
4629
+ let { exportData: a, beforeExportData: s, importLimit: c = 1e4, validationRules: l = [], translations: u, onImportComplete: d = () => {}, disablePasteSuccessfulToast: f, prevalidationConfig: p, onDeleteRows: m } = e ?? {}, { parsedResult: h } = t, { checkPrevalidationNeed: g } = p ?? {}, _ = useTranslationMap(u), v = useExportData(_, a, s), y = useCallback((e) => {
5056
4630
  n((t) => ({
5057
4631
  ...t,
5058
4632
  ...e
5059
4633
  }));
5060
- }, [n]), x = useCallback(({ name: e, callback: n } = {}) => {
4634
+ }, [n]), b = useCallback(({ name: e, callback: n } = {}) => {
5061
4635
  let r = { ...t.modalVisibility }, i = !e, a = [];
5062
4636
  if (i) for (let e of Object.keys(r)) a.push(e), r[e] = !1;
5063
4637
  else r?.[e] && (a.push(e), r[e] = !1);
5064
- a?.length > 0 && b({
4638
+ a.length > 0 && y({
5065
4639
  modalVisibility: r,
5066
4640
  pastedText: "",
5067
4641
  parsedResult: {
@@ -5071,9 +4645,9 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5071
4645
  units: [],
5072
4646
  errors: []
5073
4647
  }
5074
- }), typeof n == "function" && a?.length > 0 && n();
5075
- }, [t.modalVisibility, b]), S = useCallback(() => {
5076
- i(() => b({
4648
+ }), typeof n == "function" && a.length > 0 && n();
4649
+ }, [t.modalVisibility, y]), x = useCallback(() => {
4650
+ i(() => y({
5077
4651
  pastedText: "",
5078
4652
  parsedResult: {
5079
4653
  isValid: !1,
@@ -5082,52 +4656,55 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5082
4656
  units: [],
5083
4657
  errors: []
5084
4658
  }
5085
- })), p && p?.("all");
5086
- }, [t.modalVisibility, b]), C = useCallback((e, n) => {
5087
- b({ modalVisibility: {
4659
+ })), m && m?.("all");
4660
+ }, [t.modalVisibility, y]), S = useCallback((e, n) => {
4661
+ y({ modalVisibility: {
5088
4662
  ...t.modalVisibility,
5089
4663
  [e]: n
5090
4664
  } });
5091
- }, [t.modalVisibility, b]), w = useCallback(async (e) => {
4665
+ }, [t.modalVisibility, y]), C = useCallback(async (e) => {
5092
4666
  let t = {
5093
- validationRules: y,
4667
+ validationRules: l,
5094
4668
  importLimit: c
5095
- }, n = await v(e, g), r = normalizeParsedResult(n);
5096
- if (h && h(m)) {
4669
+ }, n = await parse(e, t, _), r = normalizeParsedResult(n);
4670
+ if (g && g(h)) {
5097
4671
  let { fields: e, units: n, rows: a, isValid: o } = r, s = unParse(e, n ?? [], a, t);
5098
- return i(() => b({
4672
+ return i(() => y({
5099
4673
  pastedText: s,
5100
- parsedResult: m
4674
+ parsedResult: h
5101
4675
  })), r;
5102
4676
  }
5103
- return i(() => b({
4677
+ return i(() => y({
5104
4678
  pastedText: e,
5105
4679
  parsedResult: r
5106
4680
  })), r;
5107
4681
  }, [
5108
- y,
4682
+ l,
5109
4683
  c,
4684
+ _,
5110
4685
  g,
5111
4686
  h,
5112
- m,
5113
- b
5114
- ]), T = useCallback(async (e) => {
4687
+ y
4688
+ ]), w = useCallback(async (e) => {
5115
4689
  let { fromFile: t, showSuccessToast: n = !0 } = e ?? {}, r;
5116
4690
  try {
5117
4691
  if (r = t ? await t.text() : await navigator.clipboard.readText(), !r) {
5118
4692
  transitionToast({ message: {
5119
4693
  type: "Error",
5120
- content: g(t ? "fileReadOrParseFailed" : "clipboardReadNotAllowed")
4694
+ content: _(t ? "fileReadOrParseFailed" : "clipboardReadNotAllowed")
5121
4695
  } }, i);
5122
4696
  return;
5123
4697
  }
5124
- let e = await v(r, g), a = normalizeParsedResult(e);
4698
+ let e = await parse(r, {
4699
+ validationRules: l,
4700
+ importLimit: c
4701
+ }, _), a = normalizeParsedResult(e);
5125
4702
  return a?.isValid || transitionToast({ message: {
5126
4703
  type: "Error",
5127
- content: g("clipboardReadFailed")
4704
+ content: _("clipboardReadFailed")
5128
4705
  } }, i), n && transitionToast({ message: {
5129
4706
  type: "Success",
5130
- content: g("pasteSuccessful")
4707
+ content: _("pasteSuccessful")
5131
4708
  } }, i), {
5132
4709
  pastedText: r,
5133
4710
  parsedResult: a
@@ -5135,78 +4712,78 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5135
4712
  } catch (e) {
5136
4713
  transitionToast({ message: {
5137
4714
  type: "Error",
5138
- content: g(t ? "fileReadOrParseFailed" : "clipboardReadNotAllowed"),
4715
+ content: _(t ? "fileReadOrParseFailed" : "clipboardReadNotAllowed"),
5139
4716
  details: e.message
5140
4717
  } }, i);
5141
4718
  return;
5142
4719
  }
5143
- }, [y, c]), E = useCallback(async (e) => {
4720
+ }, [l, c]), T = useCallback(async (e) => {
5144
4721
  let t = e?.target?.files?.[0];
5145
4722
  if (!t) return;
5146
- let n = await t.text(), r = await w(n);
5147
- r.isValid ? (d || transitionToast({ message: {
4723
+ let n = await t.text(), r = await C(n);
4724
+ r.isValid ? (f || transitionToast({ message: {
5148
4725
  type: "Success",
5149
- content: g("pasteSuccessful")
5150
- } }, i), i(() => u(r))) : transitionToast({ message: {
4726
+ content: _("pasteSuccessful")
4727
+ } }, i), i(() => d(r))) : transitionToast({ message: {
5151
4728
  type: "Error",
5152
- content: g("fileParsingFailed")
4729
+ content: _("fileParsingFailed")
5153
4730
  } }, i);
5154
4731
  }, [
5155
- y,
4732
+ l,
5156
4733
  c,
5157
- b,
5158
- u
5159
- ]), D = useCallback(async (e = !0) => {
4734
+ y,
4735
+ d
4736
+ ]), E = useCallback(async (e = !0) => {
5160
4737
  try {
5161
4738
  let t = await navigator.clipboard.readText();
5162
4739
  if (!t) {
5163
4740
  transitionToast({ message: {
5164
4741
  type: "Error",
5165
- content: g("clipboardIsEmpty")
4742
+ content: _("clipboardIsEmpty")
5166
4743
  } }, i);
5167
4744
  return;
5168
4745
  }
5169
- let n = await w(t);
4746
+ let n = await C(t);
5170
4747
  if (!n.isValid) {
5171
4748
  transitionToast({ message: {
5172
4749
  type: "Error",
5173
- content: g("clipboardReadFailed")
4750
+ content: _("clipboardReadFailed")
5174
4751
  } }, i);
5175
4752
  return;
5176
4753
  }
5177
- d || transitionToast({ message: {
4754
+ f || transitionToast({ message: {
5178
4755
  type: "Success",
5179
- content: g("pasteSuccessful")
5180
- } }, i), e && i(() => u(n));
4756
+ content: _("pasteSuccessful")
4757
+ } }, i), e && i(() => d(n));
5181
4758
  } catch {
5182
4759
  transitionToast({ message: {
5183
4760
  type: "Error",
5184
- content: g("clipboardReadNotAllowed")
4761
+ content: _("clipboardReadNotAllowed")
5185
4762
  } }, i);
5186
4763
  }
5187
4764
  }, [
5188
- y,
4765
+ l,
5189
4766
  c,
5190
- g,
5191
- b,
5192
- u
5193
- ]), O = useCallback(async (e) => {
5194
- let t = await _();
4767
+ _,
4768
+ y,
4769
+ d
4770
+ ]), D = useCallback(async (e) => {
4771
+ let t = await v();
5195
4772
  if (!t) return;
5196
- let { fields: n = [], units: r = [], rows: a = [] } = t, o = (r ?? []).map((e) => e?.length ? e : placeholder$1).slice(0, n?.length), s = (e, t) => t === "comma" ? e.replace(/\./g, ",") : e, c = a.map((t) => t.map((t) => isNullOrUndefined(t) ? "" : s(t.toString(), e))), l = unParse(n, o, c, { delimiter: " " });
4773
+ let { fields: n = [], units: r = [], rows: a = [] } = t, o = (r ?? []).map((e) => e?.length ? e : placeholder$1).slice(0, n.length), s = (e, t) => t === "comma" ? e.replace(/\./g, ",") : e, c = a.map((t) => t.map((t) => isNullOrUndefined(t) ? "" : s(t.toString(), e))), l = unParse(n, o, c, { delimiter: " " });
5197
4774
  try {
5198
4775
  await navigator.clipboard.writeText(l), transitionToast({ message: {
5199
4776
  type: "Success",
5200
- content: g("copiedToClipboard")
4777
+ content: _("copiedToClipboard")
5201
4778
  } }, i);
5202
4779
  } catch (e) {
5203
4780
  transitionToast({ message: {
5204
4781
  type: "Error",
5205
- content: g("unableToCopyToClipboard"),
4782
+ content: _("unableToCopyToClipboard"),
5206
4783
  details: e.message
5207
4784
  } }, i);
5208
4785
  }
5209
- }, [_, g]), k = useCallback((e) => {
4786
+ }, [v, _]), O = useCallback((e) => {
5210
4787
  if (!e || e.errorMessage) {
5211
4788
  transitionToast({ message: {
5212
4789
  type: "Error",
@@ -5221,24 +4798,24 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
5221
4798
  rows: n.map((e) => Object.values(e)),
5222
4799
  errors: []
5223
4800
  };
5224
- i(() => b({ parsedResult: a })), i(() => u(a));
4801
+ i(() => y({ parsedResult: a })), i(() => d(a));
5225
4802
  let { onComplete: o } = r ?? {};
5226
- typeof o == "function" && o(a), x();
4803
+ typeof o == "function" && o(a), b();
5227
4804
  }, [
5228
- b,
5229
- u,
4805
+ y,
4806
+ d,
5230
4807
  r
5231
4808
  ]);
5232
4809
  return {
5233
- updateState: b,
5234
- closeModals: x,
5235
- setModalVisibility: C,
5236
- readAndParseInput: T,
5237
- onFileChange: E,
5238
- onClickQuickPasteFromClipBoard: D,
5239
- onClickCopyClipboard: O,
5240
- onSmartUploadResult: k,
5241
- deleteAllRows: S
4810
+ updateState: y,
4811
+ closeModals: b,
4812
+ setModalVisibility: S,
4813
+ readAndParseInput: w,
4814
+ onFileChange: T,
4815
+ onClickQuickPasteFromClipBoard: E,
4816
+ onClickCopyClipboard: D,
4817
+ onSmartUploadResult: O,
4818
+ deleteAllRows: x
5242
4819
  };
5243
4820
  }, onClickDownLoad = (e, t) => {
5244
4821
  let { fields: n, rows: r } = e, i = e.units?.map((e) => e || "blank") ?? [], a = unParse(n, i, r, { delimiter: " " }), o = new Blob([a], { type: "text/plain" }), s = document.createElement("a");
@@ -5274,167 +4851,165 @@ var initialState = {
5274
4851
  helpModal: !1
5275
4852
  }
5276
4853
  };
5277
- const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n, __validationScopeId: r }) => {
5278
- let { exportData: i, beforeExportData: a, prevalidationConfig: o, validationRules: s, title: c, translations: l, textOnly: u = !1, showImportOptions: d = !0, copyFromClipBoard: f = !0, showDeleteOptions: p = !0, showHelpOption: m = !0, modals: _ = [], dynamicOptions: v, onImportComplete: y } = e ?? {}, b = useValidationScopeId();
5279
- useRegisterValidationRules(r ?? b, s);
5280
- let [x, S] = useState(initialState), { modalVisibility: { smartUploadModal: C = !1, reviewPasteModal: w = !1, helpModal: T = !1 } } = x, { enabled: E, prompt: D = "", onClose: O, onError: k, service: A = () => Promise.resolve() } = t ?? {}, j = useTranslationMap(l), M = useExportData(j, i, a), [N, P] = useTransition(), { readAndParseInput: F, updateState: I, closeModals: L, setModalVisibility: R, onFileChange: z, onClickQuickPasteFromClipBoard: B, onClickCopyClipboard: V, onSmartUploadResult: H, deleteAllRows: U } = useDataImportActions({
4854
+ const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n }) => {
4855
+ let { exportData: r, beforeExportData: i, prevalidationConfig: a, validationRules: o, title: s, translations: c, textOnly: l = !1, showImportOptions: u = !0, copyFromClipBoard: d = !0, showDeleteOptions: f = !0, showHelpOption: p = !0, modals: g = [], dynamicOptions: _, onImportComplete: v } = e ?? {}, [y, b] = useState(initialState), { modalVisibility: { smartUploadModal: x = !1, reviewPasteModal: S = !1, helpModal: C = !1 } } = y, { enabled: w, prompt: T = "", onClose: E, onError: D, service: O = () => Promise.resolve() } = t ?? {}, k = useTranslationMap(c), A = useExportData(k, r, i), [j, M] = useTransition(), { readAndParseInput: N, updateState: P, closeModals: F, setModalVisibility: I, onFileChange: L, onClickQuickPasteFromClipBoard: R, onClickCopyClipboard: z, onSmartUploadResult: B, deleteAllRows: V } = useDataImportActions({
5281
4856
  config: e,
5282
- state: x,
5283
- setState: S,
4857
+ state: y,
4858
+ setState: b,
5284
4859
  smartUploadConfig: t,
5285
- startTransition: P
4860
+ startTransition: M
5286
4861
  }) ?? {};
5287
- useKeyboardEvent("Escape", () => L());
5288
- let W = d ? [
4862
+ useKeyboardEvent("Escape", () => F());
4863
+ let H = u ? [
5289
4864
  {
5290
4865
  type: "Option",
5291
- label: j("uploadFile"),
4866
+ label: k("uploadFile"),
5292
4867
  upload: !0,
5293
4868
  uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
5294
- onChange: z,
4869
+ onChange: L,
5295
4870
  testId: `${n}-option-upload-file`
5296
4871
  },
5297
- ...f ? [{
4872
+ ...d ? [{
5298
4873
  type: "Option",
5299
- label: j("quickPasteFromClipboard"),
5300
- onClick: B,
4874
+ label: k("quickPasteFromClipboard"),
4875
+ onClick: R,
5301
4876
  testId: `${n}-option-quick-paste-from-clipboard`
5302
4877
  }] : [],
5303
- ...f ? [{
4878
+ ...d ? [{
5304
4879
  type: "Option",
5305
- label: j("pasteWithReview"),
5306
- onClick: () => R("reviewPasteModal", !w),
4880
+ label: k("pasteWithReview"),
4881
+ onClick: () => I("reviewPasteModal", !S),
5307
4882
  testId: `${n}-paste-with-review`
5308
4883
  }] : [],
5309
- ...D && E && t ? [{
4884
+ ...T && w && t ? [{
5310
4885
  type: "Option",
5311
- label: j("smartUpload_smartUpload"),
5312
- onClick: () => R("smartUploadModal", !C),
4886
+ label: k("smartUpload_smartUpload"),
4887
+ onClick: () => I("smartUploadModal", !x),
5313
4888
  testId: `${n}-smart-upload`
5314
4889
  }] : [],
5315
- ...applyModalHandlers(v?.importOptions ?? [], x, R)
5316
- ] : [], G = [
4890
+ ...applyModalHandlers(_?.importOptions ?? [], y, I)
4891
+ ] : [], U = [
5317
4892
  {
5318
4893
  type: "Option",
5319
- label: j("downloadFile"),
4894
+ label: k("downloadFile"),
5320
4895
  onClick: async () => {
5321
- let e = await M();
5322
- e && e && onClickDownLoad(e, c);
4896
+ let e = await A();
4897
+ e && e && onClickDownLoad(e, s);
5323
4898
  }
5324
4899
  },
5325
- ...u ? [{
4900
+ ...l ? [{
5326
4901
  type: "Option",
5327
- label: j("copyToClipboard"),
5328
- onClick: () => V("dot")
4902
+ label: k("copyToClipboard"),
4903
+ onClick: () => z("dot")
5329
4904
  }] : [{
5330
4905
  type: "Menu",
5331
4906
  testId: `${n}-menu-copy-to-clipboard`,
5332
4907
  menu: {
5333
4908
  trigger: "Text",
5334
- label: j("copyToClipboard"),
4909
+ label: k("copyToClipboard"),
5335
4910
  sections: [{
5336
4911
  type: "Option",
5337
- label: j("copyDecimalDot"),
5338
- onClick: () => V("dot"),
4912
+ label: k("copyDecimalDot"),
4913
+ onClick: () => z("dot"),
5339
4914
  testId: `${n}-option-copy-decimal-dot`
5340
4915
  }, {
5341
4916
  type: "Option",
5342
- label: j("copyDecimalComma"),
5343
- onClick: () => V("comma")
4917
+ label: k("copyDecimalComma"),
4918
+ onClick: () => z("comma")
5344
4919
  }]
5345
4920
  }
5346
4921
  }],
5347
- ...applyModalHandlers(v?.exportOptions ?? [], x, R)
5348
- ], K = p ? [{
4922
+ ...applyModalHandlers(_?.exportOptions ?? [], y, I)
4923
+ ], W = f ? [{
5349
4924
  type: "Option",
5350
- label: j("deleteAllRows"),
5351
- onClick: () => U(),
4925
+ label: k("deleteAllRows"),
4926
+ onClick: () => V(),
5352
4927
  testId: `${n}-delete-all-rows`
5353
- }, ...applyModalHandlers(v?.deleteOptions ?? [], x, R)] : [], q = m ? [
4928
+ }, ...applyModalHandlers(_?.deleteOptions ?? [], y, I)] : [], G = p ? [
5354
4929
  { type: "Divider" },
5355
4930
  {
5356
4931
  type: "Option",
5357
- label: j("help"),
5358
- onClick: () => R("helpModal", !T)
4932
+ label: k("help"),
4933
+ onClick: () => I("helpModal", !C)
5359
4934
  },
5360
- ...applyModalHandlers(v?.helpOptions ?? [], x, R)
5361
- ] : [], J = [
5362
- ...W?.length ? [{
5363
- section: [...W, ...q],
4935
+ ...applyModalHandlers(_?.helpOptions ?? [], y, I)
4936
+ ] : [], K = [
4937
+ ...H.length ? [{
4938
+ section: [...H, ...G],
5364
4939
  name: "import-options",
5365
4940
  iconName: "upload",
5366
- tooltip: j("import")
4941
+ tooltip: k("import")
5367
4942
  }] : [],
5368
- ...G?.length ? [{
5369
- section: G,
4943
+ ...U.length ? [{
4944
+ section: U,
5370
4945
  name: "export-options",
5371
4946
  iconName: "download",
5372
- tooltip: j("export")
4947
+ tooltip: k("export")
5373
4948
  }] : [],
5374
- ...K?.length ? [{
5375
- section: K,
4949
+ ...W.length ? [{
4950
+ section: W,
5376
4951
  name: "delete-options",
5377
4952
  iconName: "delete",
5378
- tooltip: j("deleteAllRows")
4953
+ tooltip: k("deleteAllRows")
5379
4954
  }] : []
5380
4955
  ];
5381
4956
  return /* @__PURE__ */ jsxs("span", { children: [
5382
- N && /* @__PURE__ */ jsx(Spinner, {
4957
+ j && /* @__PURE__ */ jsx(Spinner, {
5383
4958
  small: !0,
5384
4959
  dark: !0
5385
4960
  }),
5386
- J.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
4961
+ K.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
5387
4962
  sections: e.section,
5388
4963
  iconName: e.iconName,
5389
4964
  tooltip: e.tooltip,
5390
4965
  testId: `data-${e?.name}-menu`
5391
4966
  }, t)),
5392
- w && /* @__PURE__ */ jsx(PasteWithReviewModal, {
4967
+ S && /* @__PURE__ */ jsx(PasteWithReviewModal, {
5393
4968
  config: e,
5394
- state: x,
5395
- updateState: I,
5396
- setModalVisibility: R,
5397
- readAndParseInput: F,
5398
- onCloseModal: L,
5399
- validationRules: s,
5400
- onCompleteImport: y,
5401
- prevalidationConfig: o,
5402
- t: j,
5403
- loading: N,
5404
- startTransition: P,
4969
+ state: y,
4970
+ updateState: P,
4971
+ setModalVisibility: I,
4972
+ readAndParseInput: N,
4973
+ onCloseModal: F,
4974
+ validationRules: o,
4975
+ onCompleteImport: v,
4976
+ prevalidationConfig: a,
4977
+ t: k,
4978
+ loading: j,
4979
+ startTransition: M,
5405
4980
  testId: n
5406
4981
  }),
5407
- T && /* @__PURE__ */ jsx(HelpModal, {
5408
- visible: T,
5409
- setModalVisibility: R,
5410
- validationRules: s,
5411
- t: j
5412
- }),
5413
- E && t && /* @__PURE__ */ jsx(SmartUploadModal, {
4982
+ C && /* @__PURE__ */ jsx(HelpModal, {
5414
4983
  visible: C,
5415
- prompt: D,
5416
- onUpload: A,
5417
- onCloseModal: () => L({ callback: O }),
5418
- onComplete: H,
5419
- onError: k,
5420
- heading: j("smartUpload_smartUpload"),
5421
- dialogText: j("smartUpload_description"),
5422
- fileInputText: j("chooseFile"),
5423
- fileInputPlaceholder: j("noFileSelected"),
5424
- uploadText: j("uploadCapitalized"),
5425
- cancelText: j("cancel"),
4984
+ setModalVisibility: I,
4985
+ validationRules: o,
4986
+ t: k
4987
+ }),
4988
+ w && t && /* @__PURE__ */ jsx(SmartUploadModal, {
4989
+ visible: x,
4990
+ prompt: T,
4991
+ onUpload: O,
4992
+ onCloseModal: () => F({ callback: E }),
4993
+ onComplete: B,
4994
+ onError: D,
4995
+ heading: k("smartUpload_smartUpload"),
4996
+ dialogText: k("smartUpload_description"),
4997
+ fileInputText: k("chooseFile"),
4998
+ fileInputPlaceholder: k("noFileSelected"),
4999
+ uploadText: k("uploadCapitalized"),
5000
+ cancelText: k("cancel"),
5426
5001
  testId: n
5427
5002
  }),
5428
5003
  /* @__PURE__ */ jsx(ModalsRenderer, {
5429
- modals: _,
5430
- modalVisibility: x?.modalVisibility,
5431
- onCloseModal: L,
5004
+ modals: g,
5005
+ modalVisibility: y?.modalVisibility,
5006
+ onCloseModal: F,
5432
5007
  testId: n
5433
5008
  })
5434
5009
  ] });
5435
5010
  }, FileButton = ({ file: e, accept: t, multi: n, name: r, disabled: i, onChange: a = noop,...o }) => {
5436
- let s = useContext(DisabledContext), l = useRef(null), u = () => {
5437
- i || s || l.current?.click();
5011
+ let c = useContext(DisabledContext), l = useRef(null), u = () => {
5012
+ i || c || l.current?.click();
5438
5013
  }, d = (e) => {
5439
5014
  let t = n ? e.target.files : e.target.files?.[0], r = {
5440
5015
  ...e,
@@ -5713,15 +5288,15 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5713
5288
  },
5714
5289
  children: e.content
5715
5290
  }) : null, ListSubheading = forwardRef(({ item: e, index: t }, n) => {
5716
- let r = useContext(DisabledContext), { actions: i, disabled: a, expanded: o, onClick: s, title: l, name: u, icon: d, testId: f } = e;
5291
+ let r = useContext(DisabledContext), { actions: i, disabled: a, expanded: o, onClick: c, title: l, name: u, icon: d, testId: f } = e;
5717
5292
  return /* @__PURE__ */ jsx("div", {
5718
5293
  ref: (e) => {
5719
5294
  n && "current" in n && Array.isArray(n.current) && t !== void 0 && (n.current[t] = e);
5720
5295
  },
5721
5296
  "data-testid": f ?? null,
5722
- className: cx(list_module_default.item, list_module_default.heading, a || r ? list_module_default.disabled : "", s ? list_module_default.action : ""),
5297
+ className: cx(list_module_default.item, list_module_default.heading, a || r ? list_module_default.disabled : "", c ? list_module_default.action : ""),
5723
5298
  onClick: (e) => {
5724
- s && s(e);
5299
+ c && c(e);
5725
5300
  },
5726
5301
  title: l,
5727
5302
  children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", {
@@ -5746,7 +5321,7 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5746
5321
  }) })
5747
5322
  });
5748
5323
  }), ListRow = forwardRef(({ item: e, index: t, expanding: n, invokeEditOnRowClick: r, draggable: i }, a) => {
5749
- let o = useContext(DisabledContext), s = (e, t, s, c, l, u) => {
5324
+ let o = useContext(DisabledContext), c = (e, t, s, c, l, u) => {
5750
5325
  let d = t.actions && t.actions.find((e) => e.label && String(e.label)?.toLowerCase() === "edit"), f = !!(d || t.url || t.onClick), p = t.level && t.level > 1 ? (t.level - 1) * 20 : 0, m = t.component || "a";
5751
5326
  return /* @__PURE__ */ jsx(m, {
5752
5327
  href: t.url,
@@ -5800,16 +5375,16 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5800
5375
  item: e,
5801
5376
  index: t
5802
5377
  }, t) : i ? ((e, t) => {
5803
- let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o, isDragging: c } = useSortable({
5378
+ let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o, isDragging: s } = useSortable({
5804
5379
  id: e.toString(),
5805
5380
  animateLayoutChanges: () => !1
5806
5381
  }), l = {
5807
5382
  transform: CSS.Translate.toString(a),
5808
5383
  transition: o,
5809
- opacity: c ? 0 : 1
5384
+ opacity: s ? 0 : 1
5810
5385
  };
5811
- return s(e, t, l, n, r, i);
5812
- })(t, e) : s(t, e);
5386
+ return c(e, t, l, n, r, i);
5387
+ })(t, e) : c(t, e);
5813
5388
  }), ListDragWrapper = ({ children: e, draggable: t, list: n, onListReorder: r }) => {
5814
5389
  let [i, a] = useState(null), o = (e) => {
5815
5390
  a(e.active.id);
@@ -5842,9 +5417,9 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5842
5417
  }), document.body)]
5843
5418
  }) : e;
5844
5419
  }, ListVirtualScrollWrapper = ({ items: e, scrollDetails: t, children: n }) => {
5845
- let { scrollable: r, hideScrollbar: i, triggerScrollToActiveItem: a, infiniteScroll: o } = t, c = useRef(null), u = useVirtualizer({
5420
+ let { scrollable: r, hideScrollbar: i, triggerScrollToActiveItem: a, infiniteScroll: s } = t, l = useRef(null), u = useVirtualizer({
5846
5421
  count: e.length,
5847
- getScrollElement: () => c.current,
5422
+ getScrollElement: () => l.current,
5848
5423
  estimateSize: useCallback(() => {
5849
5424
  let t = 37;
5850
5425
  if (e.length > 0) {
@@ -5866,8 +5441,8 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5866
5441
  f(t);
5867
5442
  }
5868
5443
  }, [a]), /* @__PURE__ */ jsx("div", {
5869
- className: cx(list_module_default.listContent, r || o ? list_module_default.scrollableList : "", i ? list_module_default.hideScrollbar : ""),
5870
- ref: c,
5444
+ className: cx(list_module_default.listContent, r || s ? list_module_default.scrollableList : "", i ? list_module_default.hideScrollbar : ""),
5445
+ ref: l,
5871
5446
  children: /* @__PURE__ */ jsx("div", {
5872
5447
  className: list_module_default.virtualRows,
5873
5448
  style: { height: `${u.getTotalSize()}px` },
@@ -6111,8 +5686,8 @@ var radio_button_module_default = {
6111
5686
  isInTable: "_isInTable_1fbik_106",
6112
5687
  helpIconEnabled: "_helpIconEnabled_1fbik_111"
6113
5688
  };
6114
- const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u }) => {
6115
- let d = l || u;
5689
+ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u, textTransform: d = TextTransform.CAPITALIZE }) => {
5690
+ let f = l || u;
6116
5691
  return /* @__PURE__ */ jsxs("div", {
6117
5692
  className: cx(radio_button_module_default.radio, i ? radio_button_module_default.disabled : null, a ? radio_button_module_default.small : null, s ? radio_button_module_default.noMargin : null),
6118
5693
  onClick: o,
@@ -6128,21 +5703,22 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
6128
5703
  /* @__PURE__ */ jsx("label", {
6129
5704
  "data-name": e,
6130
5705
  "data-value": n,
5706
+ style: { textTransform: d },
6131
5707
  children: t
6132
5708
  }),
6133
- d && /* @__PURE__ */ jsx("div", {
5709
+ f && /* @__PURE__ */ jsx("div", {
6134
5710
  className: radio_button_module_default.helpIconEnabled,
6135
5711
  onClick: u,
6136
5712
  children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
6137
5713
  })
6138
5714
  ]
6139
5715
  });
6140
- }, RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: s = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
6141
- let m = useContext(DisabledContext), h = f !== void 0, { simpleInputs: g, options: v, selectedOptions: y } = h ? {
5716
+ }, RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: c = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
5717
+ let m = useContext(DisabledContext), h = f !== void 0, { simpleInputs: _, options: v, selectedOptions: y } = h ? {
6142
5718
  simpleInputs: !1,
6143
5719
  options: f,
6144
5720
  selectedOptions: void 0
6145
- } : standardizeInputs(n, r), b = h || y == null ? void 0 : g ? y : y.value, x = h ? d : t;
5721
+ } : standardizeInputs(n, r), b = h || y == null ? void 0 : _ ? y : y.value, x = h ? d : t;
6146
5722
  return /* @__PURE__ */ jsxs("div", {
6147
5723
  className: cx(radio_button_module_default.wrapper, u ? radio_button_module_default.inline : null, p === "inline fields" ? radio_button_module_default.inline : null),
6148
5724
  children: [d && /* @__PURE__ */ jsx("label", {
@@ -6157,13 +5733,14 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
6157
5733
  selected: r,
6158
5734
  disabled: a || t.disabled || m,
6159
5735
  small: o,
6160
- noMargin: s,
5736
+ noMargin: c,
6161
5737
  onChange: t.disabled ? void 0 : (n) => {
6162
5738
  h ? l(n.target) : (n.target.name = e, n.target.value = t.value.toString(), n.target.label = t.label.toString(), i && i(n));
6163
5739
  },
6164
5740
  testId: t.testId,
6165
5741
  helpText: t.helpText,
6166
- onClickHelp: t.onClickHelp
5742
+ onClickHelp: t.onClickHelp,
5743
+ textTransform: t.textTransform
6167
5744
  }, n);
6168
5745
  })]
6169
5746
  });
@@ -6233,7 +5810,7 @@ var rich_text_input_module_default = {
6233
5810
  richTextInput: "_richTextInput_1fb4l_77"
6234
5811
  };
6235
5812
  const RichTextInput = forwardRef(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i }, a) => {
6236
- let o = useContext(DisabledContext), s = r || o, { manager: l, state: d, setState: f, getContext: p } = useRemirror({
5813
+ let o = useContext(DisabledContext), c = r || o, { manager: u, state: d, setState: f, getContext: p } = useRemirror({
6237
5814
  extensions: () => [
6238
5815
  new BoldExtension({}),
6239
5816
  new BulletListExtension({}),
@@ -6250,31 +5827,31 @@ const RichTextInput = forwardRef(({ placeholder: e, onChange: t, value: n, disab
6250
5827
  return useImperativeHandle(a, () => p(), [p]), /* @__PURE__ */ jsx("div", {
6251
5828
  className: rich_text_input_module_default.richTextInput,
6252
5829
  children: /* @__PURE__ */ jsxs(Remirror, {
6253
- manager: l,
5830
+ manager: u,
6254
5831
  state: d,
6255
5832
  placeholder: e,
6256
5833
  onChange: ({ helpers: e, state: n }) => {
6257
5834
  let r = e.getMarkdown(n);
6258
5835
  t && t(r), f(n);
6259
5836
  },
6260
- editable: !s,
5837
+ editable: !c,
6261
5838
  children: [/* @__PURE__ */ jsx(RichTextToolbar, {
6262
- disabled: s,
5839
+ disabled: c,
6263
5840
  toolbarComponent: i
6264
5841
  }), /* @__PURE__ */ jsx(EditorComponent, {})]
6265
5842
  })
6266
5843
  });
6267
5844
  });
6268
5845
  var row_module_default = { row: "_row_n16je_1" };
6269
- const Row = ({ alignItems: t = "initial", justifyContent: n = "initial", children: r = null, flex: i = !1, height: o = "auto", marginBottom: s = "0", marginTop: c = "0", spacing: l = "var(--padding)", wrap: u = !1, testId: d = null }) => {
5846
+ const Row = ({ alignItems: t = "initial", justifyContent: n = "initial", children: r = null, flex: a = !1, height: o = "auto", marginBottom: s = "0", marginTop: c = "0", spacing: l = "var(--padding)", wrap: u = !1, testId: d = null }) => {
6270
5847
  let f = typeof l == "number" ? `${l}px` : l, p = (r === null || r === !1 ? [] : Array.isArray(r) ? r.filter((e) => isValidElement(e)) : [r]).map((t, n) => /* @__PURE__ */ jsx(React.Fragment, { children: React.cloneElement(t, { spacing: f }) }, n));
6271
5848
  return /* @__PURE__ */ jsx("div", {
6272
5849
  className: cx(row_module_default.row),
6273
5850
  style: {
6274
5851
  alignItems: t,
6275
5852
  justifyContent: n,
6276
- flexGrow: i ? 1 : 0,
6277
- flexShrink: i ? 1 : 0,
5853
+ flexGrow: a ? 1 : 0,
5854
+ flexShrink: a ? 1 : 0,
6278
5855
  flexWrap: u ? "wrap" : "nowrap",
6279
5856
  height: o,
6280
5857
  marginLeft: `calc(${f} * -0.5)`,
@@ -6424,7 +6001,7 @@ const Label$1 = ({ label: e, url: t, hidden: n, disabled: r, active: i, onClick:
6424
6001
  }, Content$1 = ({ children: e, activeTabIndex: t, contentPadding: n }) => Array.isArray(e) ? /* @__PURE__ */ jsx("div", {
6425
6002
  className: cx(n ? tabs_module_default.contentPadding : ""),
6426
6003
  children: e.map((e, n) => t === n && e)
6427
- }) : null, Tabs = ({ name: e = void 0, options: t = null, children: n = null, value: r = void 0, onChange: i = noop, padding: a = !1, margin: o = !0, contentPadding: s = !0, onChangeTab: l, activeTabIndex: u = void 0, tabs: d = void 0, testId: f }) => {
6004
+ }) : null, Tabs = ({ name: e = void 0, options: t = null, children: n = null, value: r = void 0, onChange: i = noop, padding: a = !1, margin: o = !0, contentPadding: c = !0, onChangeTab: l, activeTabIndex: u = void 0, tabs: d = void 0, testId: f }) => {
6428
6005
  let p = useContext(DisabledContext), m = l !== void 0, h = n ? n.map((e, t) => ({
6429
6006
  value: t,
6430
6007
  url: e.props.url,
@@ -6433,11 +6010,11 @@ const Label$1 = ({ label: e, url: t, hidden: n, disabled: r, active: i, onClick:
6433
6010
  disabled: e.props.disabled || p,
6434
6011
  badge: e.props.badge,
6435
6012
  testId: e.props?.testId && `${e.props.testId}-${t}`
6436
- })) : t || d, { simpleInputs: g, options: v, selectedOptions: y } = m ? {
6013
+ })) : t || d, { simpleInputs: _, options: v, selectedOptions: y } = m ? {
6437
6014
  simpleInputs: !1,
6438
6015
  options: h,
6439
6016
  selectedOptions: void 0
6440
- } : standardizeInputs(h, r), b = m || y == null ? void 0 : g ? y : y.value, x = u === void 0 ? v?.findIndex((e) => e.value === b) : u, S = x === -1 ? 0 : x, C = (t, n, r) => {
6017
+ } : standardizeInputs(h, r), b = m || y == null ? void 0 : _ ? y : y.value, x = u === void 0 ? v?.findIndex((e) => e.value === b) : u, S = x === -1 ? 0 : x, C = (t, n, r) => {
6441
6018
  if (m) {
6442
6019
  let e = n.key || n.label || null;
6443
6020
  l(t, e);
@@ -6466,7 +6043,7 @@ const Label$1 = ({ label: e, url: t, hidden: n, disabled: r, active: i, onClick:
6466
6043
  children: v.map(w)
6467
6044
  }), /* @__PURE__ */ jsx(Content$1, {
6468
6045
  activeTabIndex: S ?? 0,
6469
- contentPadding: s,
6046
+ contentPadding: c,
6470
6047
  children: n
6471
6048
  })] }) : null;
6472
6049
  }, TextLink = ({ children: e, href: t = void 0, target: n = void 0, testId: r, onClick: i, component: a = "a" }) => /* @__PURE__ */ jsx(a, {
@@ -6492,7 +6069,7 @@ var textarea_module_default = {
6492
6069
  small: "_small_q0tl0_116",
6493
6070
  monospace: "_monospace_q0tl0_155"
6494
6071
  };
6495
- const TextArea = ({ name: e, value: t = "", placeholder: n = "", cols: r, rows: i, disabled: a = !1, onChange: o = noop, onKeyPress: s = noop, onFocus: l = noop, onBlur: u = noop, tabIndex: d = 0, error: f = null, warning: p = null, tooltip: m = null, maxTooltipWidth: h, resize: g, monospace: v = !1, testId: y }) => {
6072
+ const TextArea = ({ name: e, value: t = "", placeholder: n = "", cols: r, rows: i, disabled: a = !1, onChange: o = noop, onKeyPress: c = noop, onFocus: l = noop, onBlur: u = noop, tabIndex: d = 0, error: f = null, warning: p = null, tooltip: m = null, maxTooltipWidth: h, resize: _, monospace: v = !1, testId: y }) => {
6496
6073
  let b = useContext(DisabledContext), x = /* @__PURE__ */ jsx("textarea", {
6497
6074
  className: cx(textarea_module_default.textarea, f ? textarea_module_default.error : "", p ? textarea_module_default.warning : "", v ? textarea_module_default.monospace : ""),
6498
6075
  name: e,
@@ -6502,11 +6079,11 @@ const TextArea = ({ name: e, value: t = "", placeholder: n = "", cols: r, rows:
6502
6079
  rows: i,
6503
6080
  onChange: o,
6504
6081
  disabled: a || b,
6505
- onKeyPress: s,
6082
+ onKeyPress: c,
6506
6083
  onFocus: l,
6507
6084
  onBlur: u,
6508
6085
  tabIndex: d,
6509
- style: { resize: g },
6086
+ style: { resize: _ },
6510
6087
  "data-error": f || null,
6511
6088
  "data-warning": p || null,
6512
6089
  "data-testid": y
@@ -6586,9 +6163,9 @@ const Warning = ({ warning: e }) => /* @__PURE__ */ jsx("div", {
6586
6163
  let ElementType = /* @__PURE__ */ function(e) {
6587
6164
  return e.LINK = "Link", e.BUTTON = "Button", e.MENU = "Menu", e.COMPONENT = "Component", e;
6588
6165
  }({});
6589
- const Link = ({ label: e, url: t, icon: n, onClick: r, active: i, disabled: a, testId: o, component: s = "a" }) => {
6166
+ const Link = ({ label: e, url: t, icon: n, onClick: r, active: i, disabled: a, testId: o, component: c = "a" }) => {
6590
6167
  let l = useContext(DisabledContext);
6591
- return /* @__PURE__ */ jsxs(s, {
6168
+ return /* @__PURE__ */ jsxs(c, {
6592
6169
  className: cx(top_bar_module_default.link, i ? top_bar_module_default.active : ""),
6593
6170
  href: t || "#",
6594
6171
  to: t,
@@ -6733,16 +6310,16 @@ var tree_module_default = {
6733
6310
  placeholder: "_placeholder_15yn1_29"
6734
6311
  };
6735
6312
  const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, draggable: o, icons: s, onDrop: c }) => {
6736
- let { id: l, data: u } = t, { active: d, testId: f, onClick: p, actions: m = [] } = u, [h, g] = React.useState(!1), [v, y] = React.useState(0), b = (e) => {
6313
+ let { id: l, data: u } = t, { active: d, testId: f, onClick: p, actions: m = [] } = u, [h, _] = React.useState(!1), [v, y] = React.useState(0), b = (e) => {
6737
6314
  e.stopPropagation(), i(l);
6738
6315
  }, x = (e) => {
6739
- e.preventDefault(), e.stopPropagation(), h || (g(!0), y((/* @__PURE__ */ new Date()).getTime()));
6316
+ e.preventDefault(), e.stopPropagation(), h || (_(!0), y((/* @__PURE__ */ new Date()).getTime()));
6740
6317
  }, S = (e) => {
6741
- e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - v > 20 && g(!1);
6318
+ e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - v > 20 && _(!1);
6742
6319
  }, C = (e) => {
6743
6320
  e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - v > 200 && b(e);
6744
6321
  }, w = (e) => {
6745
- e.preventDefault(), e.stopPropagation(), g(!1), y((/* @__PURE__ */ new Date()).getTime()), c?.(e);
6322
+ e.preventDefault(), e.stopPropagation(), _(!1), y((/* @__PURE__ */ new Date()).getTime()), c?.(e);
6746
6323
  };
6747
6324
  return /* @__PURE__ */ jsx("div", {
6748
6325
  className: cx(list_module_default.item, list_module_default.action, d ? list_module_default.active : "", n > 0 ? list_module_default.indented : "", h ? list_module_default.bordered : ""),
@@ -6970,18 +6547,18 @@ var unit_input_module_default = {
6970
6547
  predefinedMenuActive: "_predefinedMenuActive_ye9w9_1",
6971
6548
  inputWrapper: "_inputWrapper_ye9w9_4"
6972
6549
  };
6973
- const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUnit: r = !1, error: i = null, left: a = !1, small: o = !1, width: s = "100%", value: c, unitkey: u = "", initUnit: d, noConversion: p = !1, onChange: m = noop, onClick: g = noop, onFocus: v = noop, onSwitchUnit: y = noop, unitTemplate: b, testId: x, warning: S = null, predefinedOptions: C, initialPredefinedOption: w = !1, shouldLinkAutomaticly: T = !0, selectedPredefinedOptionKey: E, validationCallback: D = () => ({
6550
+ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUnit: r = !1, error: i = null, left: a = !1, small: o = !1, width: s = "100%", value: l, unitkey: u = "", initUnit: f, noConversion: p = !1, onChange: h = noop, onClick: _ = noop, onFocus: v = noop, onSwitchUnit: y = noop, unitTemplate: b, testId: x, warning: S = null, predefinedOptions: C, initialPredefinedOption: w = !1, shouldLinkAutomaticly: T = !0, selectedPredefinedOptionKey: E, validationCallback: D = () => ({
6974
6551
  name: "",
6975
6552
  error: null
6976
6553
  }), disabledValidation: O = !1, allowEmpty: k = !1, convertBackToStorageUnit: A = !1, enableCosmeticRounding: j = !0, enableDisplayRounding: M = !1, roundDisplayValue: N, selectOnFocus: P, groupOrder: F, tooltip: I = null }) => {
6977
6554
  let L = useUnitContext(), R = useRunAfterUpdate();
6978
- typeof c == "number" && (c = `${c}`);
6979
- let [z = "", B = ""] = c === void 0 ? [] : split(c), V = useMemo(() => getPreferredUnit(u, b || L?.unitTemplate), [
6555
+ typeof l == "number" && (l = `${l}`);
6556
+ let [z = "", B = ""] = l === void 0 ? [] : split(l), V = useMemo(() => getPreferredUnit(u, b || L?.unitTemplate), [
6980
6557
  u,
6981
6558
  b,
6982
6559
  L?.unitTemplate
6983
- ]), H = isKnownUnit(c, V), U = d || V || B, W = usePrevious(U), { value: G } = safeConvertValue({
6984
- value: c,
6560
+ ]), H = isKnownUnit(l, V), U = f || V || B, W = usePrevious(U), { value: G } = safeConvertValue({
6561
+ value: l,
6985
6562
  toUnit: U,
6986
6563
  unitkey: u,
6987
6564
  defaultFromUnit: B,
@@ -6992,17 +6569,17 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6992
6569
  } : {
6993
6570
  value: G,
6994
6571
  unit: U
6995
- }), J = k || K?.value === void 0, [Y, X] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Xu = !!(O || n), Zu = C && C.find((e) => {
6572
+ }), wu = k || K?.value === void 0, [J, Tu] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Eu = !!(O || n), Y = C && C.find((e) => {
6996
6573
  if (!e?.value) return;
6997
6574
  if (E) return E === e.valueKey;
6998
- let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = c } = convertUnit({
6999
- value: String(c),
6575
+ let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
6576
+ value: String(l),
7000
6577
  unitkey: u,
7001
6578
  toUnit: t
7002
6579
  });
7003
6580
  return withUnit(n, t) === e.value;
7004
- }), Qu = () => {
7005
- let e = c ?? "", t = K.unit;
6581
+ }), Du = () => {
6582
+ let e = l ?? "", t = K.unit;
7006
6583
  if (checkConversion({
7007
6584
  value: e,
7008
6585
  unitkey: u,
@@ -7015,9 +6592,9 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7015
6592
  return null;
7016
6593
  }
7017
6594
  } else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
7018
- }, $u = (t) => {
6595
+ }, Ou = (t) => {
7019
6596
  let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, K?.unit || ""), s = A ? withUnit(convertAndGetValue(o, B), B) : o;
7020
- m({ target: {
6597
+ h({ target: {
7021
6598
  value: s,
7022
6599
  name: n
7023
6600
  } });
@@ -7028,7 +6605,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7028
6605
  }), R(() => {
7029
6606
  r.selectionStart = a, r.selectionEnd = a;
7030
6607
  });
7031
- }, ed = (e, t) => {
6608
+ }, ku = (e, t) => {
7032
6609
  t === K.unit || isNaN(Number(e)) || (q({
7033
6610
  value: e,
7034
6611
  unit: t
@@ -7039,16 +6616,16 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7039
6616
  let e, t = "";
7040
6617
  if (W !== U) {
7041
6618
  let { value: n } = safeConvertValue({
7042
- value: c,
6619
+ value: l,
7043
6620
  toUnit: U,
7044
6621
  unitkey: u,
7045
6622
  defaultFromUnit: B,
7046
6623
  doNotConvertValue: p
7047
6624
  });
7048
6625
  e = n, t = U;
7049
- } else if (withUnit(K.value, K.unit) !== c) {
6626
+ } else if (withUnit(K.value, K.unit) !== l) {
7050
6627
  let { value: n } = safeConvertValue({
7051
- value: c,
6628
+ value: l,
7052
6629
  toUnit: K.unit,
7053
6630
  unitkey: u,
7054
6631
  defaultFromUnit: B,
@@ -7059,15 +6636,15 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7059
6636
  e !== void 0 && q({
7060
6637
  value: e,
7061
6638
  unit: t
7062
- }), C && X(Zu && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6639
+ }), C && Tu(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
7063
6640
  }
7064
6641
  }, [
7065
6642
  U,
7066
- c,
6643
+ l,
7067
6644
  i,
7068
6645
  T
7069
6646
  ]);
7070
- let Z = Qu(), Q = label(K.unit) || K.unit || "", td = p || !Z || Z && Z.length === 1, nd = getStringName(e), $, rd = (t) => {
6647
+ let X = Du(), Z = label(K.unit) || K.unit || "", Au = p || !X || X && X.length === 1, Q = getStringName(e), $, ju = (t) => {
7071
6648
  let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
7072
6649
  if (checkConversion({
7073
6650
  value: r,
@@ -7087,7 +6664,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7087
6664
  type: MenuType.OPTION,
7088
6665
  inline: !0,
7089
6666
  onClick: () => {
7090
- validateNumber(i).valid && !n && (X(PredefinedOptionsMenuState.PREDEFINED), m({ target: {
6667
+ validateNumber(i).valid && !n && (Tu(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
7091
6668
  value: r,
7092
6669
  name: typeof e == "string" ? e : e?.fieldName || "",
7093
6670
  predefinedSelected: !0,
@@ -7099,25 +6676,25 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7099
6676
  height: "0"
7100
6677
  })] }),
7101
6678
  description: o,
7102
- selected: Zu === t && Y === PredefinedOptionsMenuState.PREDEFINED
6679
+ selected: Y === t && J === PredefinedOptionsMenuState.PREDEFINED
7103
6680
  };
7104
6681
  };
7105
6682
  if ($ = [{
7106
6683
  type: MenuType.OPTION,
7107
6684
  inline: !0,
7108
6685
  onClick: () => {
7109
- Y !== PredefinedOptionsMenuState.CUSTOM && !n && m({ target: {
6686
+ J !== PredefinedOptionsMenuState.CUSTOM && !n && h({ target: {
7110
6687
  value: withUnit(K.value, K.unit),
7111
6688
  name: typeof e == "string" ? e : e?.fieldName || ""
7112
6689
  } });
7113
6690
  },
7114
6691
  label: "Custom",
7115
- selected: Y === PredefinedOptionsMenuState.CUSTOM
6692
+ selected: J === PredefinedOptionsMenuState.CUSTOM
7116
6693
  }], C?.length) {
7117
- let e = C.map(rd);
6694
+ let e = C.map(ju);
7118
6695
  $ = [...$, ...e];
7119
6696
  }
7120
- let id = (e) => {
6697
+ let Mu = (e) => {
7121
6698
  if (isValueWithUnit(e)) {
7122
6699
  let t = getUnit(e), { value: n } = safeConvertValue({
7123
6700
  value: e,
@@ -7129,9 +6706,9 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7129
6706
  return n;
7130
6707
  }
7131
6708
  return e;
7132
- }, ad = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, od = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6709
+ }, Nu = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Pu = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
7133
6710
  return /* @__PURE__ */ jsx("div", {
7134
- className: Y === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
6711
+ className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
7135
6712
  children: /* @__PURE__ */ jsxs(InputGroup, {
7136
6713
  small: o,
7137
6714
  width: s,
@@ -7146,65 +6723,65 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7146
6723
  trigger: "Component",
7147
6724
  component: /* @__PURE__ */ jsx(Button, {
7148
6725
  groupOrder: "first",
7149
- active: Y === PredefinedOptionsMenuState.PREDEFINED,
7150
- icon: Y === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink",
6726
+ active: J === PredefinedOptionsMenuState.PREDEFINED,
6727
+ icon: J === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink",
7151
6728
  small: o
7152
6729
  }),
7153
6730
  small: o,
7154
6731
  sections: $
7155
6732
  },
7156
- tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? Zu?.label : ""
6733
+ tooltip: J === PredefinedOptionsMenuState.PREDEFINED ? Y?.label : ""
7157
6734
  }),
7158
6735
  /* @__PURE__ */ jsx("div", {
7159
6736
  className: unit_input_module_default.inputWrapper,
7160
6737
  children: /* @__PURE__ */ jsx(NumberInput, {
7161
- name: nd,
6738
+ name: Q,
7162
6739
  testId: x,
7163
6740
  disabled: n,
7164
- placeholder: id(t),
6741
+ placeholder: Mu(t),
7165
6742
  value: K.value,
7166
- onChange: $u,
6743
+ onChange: Ou,
7167
6744
  onFocus: v,
7168
6745
  error: i === null ? void 0 : i,
7169
6746
  warning: S === null ? void 0 : S,
7170
6747
  left: a,
7171
- allowEmpty: J,
7172
- validationCallback: (e, t) => D(nd, t),
6748
+ allowEmpty: wu,
6749
+ validationCallback: (e, t) => D(Q, t),
7173
6750
  enableCosmeticRounding: j,
7174
6751
  enableDisplayRounding: M,
7175
6752
  roundDisplayValue: N,
7176
- groupOrder: ad,
7177
- disableInternalErrorValidationMessages: Xu,
6753
+ groupOrder: Nu,
6754
+ disableInternalErrorValidationMessages: Eu,
7178
6755
  small: o,
7179
6756
  selectOnFocus: P,
7180
6757
  tooltip: I
7181
- }, nd)
6758
+ }, Q)
7182
6759
  }),
7183
- Q && (td || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
7184
- groupOrder: od,
6760
+ Z && (Au || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6761
+ groupOrder: Pu,
7185
6762
  small: o,
7186
- children: Q
6763
+ children: Z
7187
6764
  }) : /* @__PURE__ */ jsx(Menu, {
7188
- groupOrder: od,
6765
+ groupOrder: Pu,
7189
6766
  maxHeight: 380,
7190
6767
  disabled: r,
7191
6768
  testId: x && `${x}-menu`,
7192
6769
  tabIndex: -1,
7193
6770
  menu: {
7194
- label: Q,
6771
+ label: Z,
7195
6772
  trigger: "DropDownButton",
7196
6773
  small: o,
7197
- sections: Z.map(([e = "", t = "", n]) => {
6774
+ sections: X.map(([e = "", t = "", n]) => {
7198
6775
  let r = n || t || "", i = isValidNum(e) ? e : "";
7199
6776
  return {
7200
6777
  type: "Option",
7201
6778
  label: j ? safeRoundNumbers(i) : i,
7202
6779
  inline: !0,
7203
6780
  onClick: (n) => {
7204
- n.stopPropagation(), ed(e, t);
6781
+ n.stopPropagation(), ku(e, t);
7205
6782
  },
7206
6783
  description: r,
7207
- selected: r === Q,
6784
+ selected: r === Z,
7208
6785
  testId: `${x}-unit-${r}`
7209
6786
  };
7210
6787
  })
@@ -7317,61 +6894,60 @@ var normalizeUnits = (e) => e.reduce(({ preferredUnits: e, storageUnits: t }, {
7317
6894
  })
7318
6895
  })) : [];
7319
6896
  };
7320
- const UnitTable = ({ table: e, unitConfig: t, convertBackToStorageUnit: n = !0, enableCosmeticRounding: r = !0, enableDisplayRounding: i = !0, onListReorder: a, canListReorder: o, beforeRenderRow: c, enableMultiSelect: u = !1 }) => {
7321
- let { headers: d,...f } = e, { storageUnits: p, preferredUnits: m } = normalizeUnits(t), g = usePrevious(m), [_, v] = useState(m), y = ({ unitKey: e, value: n }) => {
7322
- v({
7323
- ..._,
6897
+ const UnitTable = ({ table: e, unitConfig: t, convertBackToStorageUnit: n = !0, enableCosmeticRounding: r = !0, enableDisplayRounding: i = !0, onListReorder: a, canListReorder: s, beforeRenderRow: l }) => {
6898
+ let { headers: u,...d } = e, { storageUnits: f, preferredUnits: p } = normalizeUnits(t), h = usePrevious(p), [g, _] = useState(p), v = ({ unitKey: e, value: n }) => {
6899
+ _({
6900
+ ...g,
7324
6901
  [e]: n
7325
6902
  });
7326
6903
  let r = t.find((t) => t.unitKey === e);
7327
6904
  r && typeof r.onChange == "function" && r.onChange({
7328
- oldUnit: _[e],
6905
+ oldUnit: g[e],
7329
6906
  newUnit: n,
7330
6907
  unitKey: e
7331
6908
  });
7332
- }, b = useCallback(({ row: e, rowIndex: t }) => {
7333
- let a = c ? c({
6909
+ }, y = useCallback(({ row: e, rowIndex: t }) => {
6910
+ let a = l ? l({
7334
6911
  row: e,
7335
6912
  rowIndex: t
7336
6913
  }) : e;
7337
6914
  return convertRow({
7338
6915
  row: a,
7339
6916
  rowIndex: t,
7340
- selectedUnits: _,
7341
- storageUnits: p,
6917
+ selectedUnits: g,
6918
+ storageUnits: f,
7342
6919
  convertBackToStorageUnit: n,
7343
6920
  enableCosmeticRounding: r,
7344
6921
  enableDisplayRounding: i
7345
6922
  });
7346
6923
  }, [
7347
- _,
7348
- p,
6924
+ g,
6925
+ f,
7349
6926
  n,
7350
6927
  r,
7351
6928
  i
7352
6929
  ]);
7353
6930
  return useEffect(() => {
7354
- isEqual(m, g) || Object.keys(m).forEach((e) => {
7355
- let t = g?.[e], n = m[e];
7356
- t !== n && y({
6931
+ isEqual(p, h) || Object.keys(p).forEach((e) => {
6932
+ let t = h?.[e], n = p[e];
6933
+ t !== n && v({
7357
6934
  unitKey: e,
7358
6935
  value: n
7359
6936
  });
7360
6937
  });
7361
6938
  }, [t]), /* @__PURE__ */ jsx(Table, {
7362
6939
  table: {
7363
- ...f,
6940
+ ...d,
7364
6941
  headers: convertHeaderRows({
7365
6942
  headers: e.headers,
7366
- selectedUnits: _,
7367
- storageUnits: p,
7368
- onChangeUnit: y
6943
+ selectedUnits: g,
6944
+ storageUnits: f,
6945
+ onChangeUnit: v
7369
6946
  })
7370
6947
  },
7371
6948
  onListReorder: a,
7372
- canListReorder: o,
7373
- beforeRenderRow: b,
7374
- enableMultiSelect: u
6949
+ canListReorder: s,
6950
+ beforeRenderRow: y
7375
6951
  });
7376
6952
  };
7377
6953
  var setting_field_module_default = { settingField: "_settingField_1x02n_1" };
@@ -7444,7 +7020,7 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
7444
7020
  }, [n]);
7445
7021
  let s = ({ target: { value: e } }) => {
7446
7022
  a(e);
7447
- }, { added: c, removed: u } = renderLinesCount(e, t), d = c + u > 3500;
7023
+ }, { added: l, removed: u } = renderLinesCount(e, t), d = l + u > 3500;
7448
7024
  return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Card, {
7449
7025
  bordered: !0,
7450
7026
  heading: /* @__PURE__ */ jsxs(Flex, {
@@ -7453,7 +7029,7 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
7453
7029
  success: !0,
7454
7030
  children: [
7455
7031
  "+",
7456
- c,
7032
+ l,
7457
7033
  " "
7458
7034
  ]
7459
7035
  }), /* @__PURE__ */ jsxs(Text, {
@@ -7490,4 +7066,4 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
7490
7066
  }
7491
7067
  });
7492
7068
  };
7493
- export { Accordion, AccordionWithDefaultToggle, Actions, Align, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
7069
+ export { Accordion, AccordionWithDefaultToggle, Actions, Align, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };