@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/browser/esm/{ByeL_BZuJ2kl8gtf.mjs → 0IBZhOJaVmzJxuTv.mjs} +1 -1
  2. package/browser/esm/2nRxqrNYbmEn8fS8.mjs +386 -0
  3. package/browser/esm/{fb126BNj3F8URR19.mjs → 7fVZXXuonYb6Z7FU.mjs} +3 -3
  4. package/browser/esm/BAzhmMX4Fk_qnUTp.mjs +414 -0
  5. package/browser/esm/BGL3x0W74D7qZXlf.mjs +318 -0
  6. package/browser/esm/BHGr2gsFofTdAFxq.mjs +515 -0
  7. package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BKhcJI-G15D3kGap.mjs} +4 -4
  8. package/browser/esm/BNbub9weuqm3mcoF.mjs +335 -0
  9. package/browser/esm/BSv9MVJaz1DVEffm.mjs +975 -0
  10. package/browser/esm/BWfLpYmd3cSgJ0C6.mjs +141 -0
  11. package/browser/esm/BZqwbIE8qzjSOYcJ.mjs +582 -0
  12. package/browser/esm/BZy9xUrYpAtnKeji.mjs +1288 -0
  13. package/browser/esm/{CIu1bjPJe_x31Oww.mjs → BnkwC5rsg9LZyhoP.mjs} +3 -3
  14. package/browser/esm/BpJsBv413cNQpyg0.mjs +319 -0
  15. package/browser/esm/BpVrgbVISiTDyFR3.mjs +197 -0
  16. package/browser/esm/BsngRDhvVYGVBJeK.mjs +1546 -0
  17. package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → C29TKq47CbXs652l.mjs} +2 -2
  18. package/browser/esm/{CEvZe2cZK-voZTif.mjs → C8p2iMad_NNCwGI_.mjs} +5 -5
  19. package/browser/esm/CBzXksWnb-1gGEWZ.mjs +212 -0
  20. package/browser/esm/{IQLeaAbtGTipUsOD.mjs → CFIAWgpU3UyepLBn.mjs} +25 -24
  21. package/browser/esm/CJD4jF4m9cBGHzr_.mjs +31 -0
  22. package/browser/esm/{CjznclrKqJRi7u9O.mjs → CMc7G7cevxzPGxr9.mjs} +2 -2
  23. package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → CYtULLhY9M2m3DeH.mjs} +1 -1
  24. package/browser/esm/CeF35ZeFP28Do5Zx.mjs +1379 -0
  25. package/browser/esm/{xKiLJKiLxto8SayF.mjs → CjYKDxU4EP2Kf_vo.mjs} +2 -2
  26. package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → Cq82lvdjyBvlJ8xJ.mjs} +19 -17
  27. package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → CuRxFAO42JkQvMEx.mjs} +1 -1
  28. package/browser/esm/Cvk2yY90hpgXWMAt.mjs +103 -0
  29. package/browser/esm/D0slJycx3nq53qmf.mjs +14 -0
  30. package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → D2jzliMwAo2ENpfi.mjs} +1 -1
  31. package/browser/esm/D5Fn0Hqllwv5HY6i.mjs +7581 -0
  32. package/browser/esm/D5N4nGaZsXtrHAOh.mjs +831 -0
  33. package/browser/esm/D7AqPfyhMiuda5l5.mjs +412 -0
  34. package/browser/esm/DHZA48ZMCETvHmeP.mjs +161 -0
  35. package/browser/esm/DX2_vf7WX6uRLaOZ.mjs +94 -0
  36. package/browser/esm/DaxpbAF1ShkT7hNU.mjs +490 -0
  37. package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → Db3oHfXiRtcH015t.mjs} +162 -156
  38. package/browser/esm/Dt47Huh1l3C4_5_w.mjs +87 -0
  39. package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → DtPt0phL7m56YfHZ.mjs} +1 -1
  40. package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → DtTDaXmnWUoG4VBO.mjs} +2 -2
  41. package/browser/esm/{DHY19rkSiiRZxShC.mjs → DuuyN4-7K6_io2Py.mjs} +3 -3
  42. package/browser/esm/{yZxC4qUENOlMhVUH.mjs → NeGeLF3gbGMZyV6E.mjs} +1 -1
  43. package/browser/esm/PY3Br5Bo_TxcCnCU.mjs +252 -0
  44. package/browser/esm/WIhvQtBkGiw-oFUs.mjs +2566 -0
  45. package/browser/esm/WgIvwAENeO8LANax.mjs +437 -0
  46. package/browser/esm/{DBtc4lku0uHVcqWn.mjs → Yjq3p_7eVGFw2Jod.mjs} +3 -3
  47. package/browser/esm/index.mjs +1053 -192
  48. package/browser/esm/jFRFCWlkD7Dsrhkh.mjs +236 -0
  49. package/browser/esm/lKXEDVt2ow1NlWJj.mjs +392 -0
  50. package/browser/esm/{Blaj2R5hYxtLAW__.mjs → oC0OwOddhOD0OoCJ.mjs} +6 -6
  51. package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → tIKqpsA0vNXH9EgU.mjs} +1 -1
  52. package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → u84rSnESjxqB6gay.mjs} +1 -1
  53. package/licenses/dependencies.txt +94 -94
  54. package/node/esm/{BcwMb6CyVfvEwbHn.mjs → B8Ls4Eh1k8-Yiry_.mjs} +1 -1
  55. package/node/esm/{CKu1AtRgyltyEdEN.mjs → B9X3n8MglL4OitAV.mjs} +1 -1
  56. package/node/esm/{ETK6T6G0SIcFXDe5.mjs → BBGoyqs2L_ccSH1e.mjs} +40 -40
  57. package/node/esm/BLv99aovW4R3C5PE.mjs +515 -0
  58. package/node/esm/BUGU_5lUtnCRlp3n.mjs +519 -0
  59. package/node/esm/BalROFG_oa9PFs9Q.mjs +141 -0
  60. package/node/esm/{ah3CUg4-VmNstGk_.mjs → BqVxnA1mo52ubjdf.mjs} +2 -2
  61. package/node/esm/C3FCh9xju2SccUIE.mjs +1283 -0
  62. package/node/esm/{Bb1sLMqXWKjdve23.mjs → C4F6WY8M4nkLyxdb.mjs} +2 -2
  63. package/node/esm/CKWeipCqqpLnLE5e.mjs +391 -0
  64. package/node/esm/CTnVNfz4eqFnM92M.mjs +212 -0
  65. package/node/esm/Cfi_ly8fBDZZdiZT.mjs +72 -0
  66. package/node/esm/CgKa6JuyJ1tTodev.mjs +1703 -0
  67. package/node/esm/{cqzp431iNSLWictb.mjs → Cq53M7bAUSXMNq1f.mjs} +22 -22
  68. package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → Cr8AYWUoU-XVt0hu.mjs} +1 -1
  69. package/node/esm/CyuOE595I2e-U4cG.mjs +236 -0
  70. package/node/esm/D72CupF9mfy2D1Xa.mjs +94 -0
  71. package/node/esm/{DNSjK5DAH3M14Qbc.mjs → DGDHFK8okuVbRCe5.mjs} +1 -1
  72. package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DJFkALt4XrwkMbnU.mjs} +163 -157
  73. package/node/esm/DJpwI8PlKBI2rk0r.mjs +319 -0
  74. package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DQaGPUYbgL4Y5YZW.mjs} +32 -30
  75. package/node/esm/{D9rzScOA9pEYFrtz.mjs → DsNYnq4NtYBxPmeA.mjs} +20 -20
  76. package/node/esm/DygDgOpa9sJ6YFVS.mjs +385 -0
  77. package/node/esm/Dz0Hg87UcJ-awwiI.mjs +489 -0
  78. package/node/esm/M7YxvRPGCuxuk9aK.mjs +142 -0
  79. package/node/esm/QNjtpX8rIpqGGLEJ.mjs +1379 -0
  80. package/node/esm/{B_jRGdwGFkudwmL-.mjs → ZzvsynJTCSuChYS-.mjs} +1 -1
  81. package/node/esm/{ci8d-mF1H9wnYzix.mjs → di_8-pXh90j4BO4j.mjs} +1 -1
  82. package/node/esm/dm8dmEaTIqfmgyeL.mjs +412 -0
  83. package/node/esm/{D6oQL8knsPpgdXuk.mjs → fmya3XQnTGyQisvT.mjs} +2 -2
  84. package/node/esm/gPYAb_A0T5ZwcQ1E.mjs +318 -0
  85. package/node/esm/index.mjs +8915 -13417
  86. package/node/esm/wB8xMpyJ_NvE16yG.mjs +975 -0
  87. package/node/esm/zGAcd4Jr7wkvXDBS.mjs +197 -0
  88. package/package.json +9 -9
  89. package/resources/locales/de/groups.cmd.json +4 -0
  90. package/resources/locales/de/ui.msg.json +100 -1
  91. package/resources/locales/en/groups.cmd.json +4 -0
  92. package/resources/locales/en/ui.msg.json +100 -1
  93. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
  94. package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
  95. package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
  96. package/types/src/anomalies/index.d.ts +3 -0
  97. package/types/src/border/BorderPopupButton.d.ts +1 -1
  98. package/types/src/border/BorderTemplateIcon.d.ts +6 -1
  99. package/types/src/chart/ChartFormatPanel.d.ts +20 -0
  100. package/types/src/chart/ChartPlugin.d.ts +6 -0
  101. package/types/src/chart/index.d.ts +3 -0
  102. package/types/src/color/ColorPopupButton.d.ts +1 -1
  103. package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
  104. package/types/src/command/DocThemeCommandButton.d.ts +1 -1
  105. package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
  106. package/types/src/command/FontSizeCommandButton.d.ts +1 -1
  107. package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
  108. package/types/src/command/LanguageCommandButton.d.ts +1 -1
  109. package/types/src/command/LocaleCommandButton.d.ts +1 -1
  110. package/types/src/command/index.d.ts +1 -0
  111. package/types/src/comments/CommentCard.d.ts +2 -2
  112. package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +1 -1
  113. package/types/src/conditions/ConditionEditor.d.ts +1 -1
  114. package/types/src/conditions/OperatorAndParamEditor.d.ts +1 -1
  115. package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
  116. package/types/src/conditions/useFormulaOption.d.ts +2 -2
  117. package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
  118. package/types/src/fill/PatternPopupButton.d.ts +1 -1
  119. package/types/src/format/BorderPreview.d.ts +11 -4
  120. package/types/src/format/useFormatSelection.d.ts +4 -4
  121. package/types/src/formulaBar/IFormulaBar.d.ts +4 -2
  122. package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
  123. package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
  124. package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
  125. package/types/src/index.d.ts +15 -6
  126. package/types/src/itemsPanel/ItemsPanel.d.ts +5 -0
  127. package/types/src/named/NamedDetailsPanel.d.ts +2 -2
  128. package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
  129. package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
  130. package/types/src/protection/index.d.ts +1 -1
  131. package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
  132. package/types/src/statusBar/PendingStatus.d.ts +19 -0
  133. package/types/src/statusBar/index.d.ts +1 -0
  134. package/types/src/studio/StudioProps.d.ts +10 -10
  135. package/types/src/template/TemplatePanel.d.ts +5 -1
  136. package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
  137. package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
  138. package/types/src/workbook/DefaultRenderers.d.ts +31 -19
  139. package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
  140. package/types/src/workbook/WorkbookElement.d.ts +5 -4
  141. package/types/src/workbook/WorkbookStrip.d.ts +8 -7
  142. package/types/src/workbook/index.d.ts +1 -1
  143. package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
  144. package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
  145. package/browser/esm/CtEFHbzYNvYjDYvi.mjs +0 -236
  146. package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
  147. package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
  148. package/node/esm/BYVLi0md4AYuDsB_.mjs +0 -236
  149. package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
  150. package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
@@ -0,0 +1,1546 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { t as e } from "./u84rSnESjxqB6gay.mjs";
8
+ import { n as t } from "./7fVZXXuonYb6Z7FU.mjs";
9
+ import { n } from "./D0slJycx3nq53qmf.mjs";
10
+ import { Condition as r, FormulaError as i, FormulaText as a, ICondition as o, ScalarType as s, getLocaleProfile as c } from "@sheetxl/sdk";
11
+ import { ValueChecklist as l, useWorksheet as u } from "@sheetxl/react";
12
+ import { DynamicIcon as d, KeyCodes as f, RenderSlot as p, useCallbackRef as m, useLanguage as h, useMeasure as g, useTranslator as _ } from "@sheetxl/utils-react";
13
+ import v, { createContext as y, forwardRef as b, memo as x, useCallback as S, useContext as C, useEffect as w, useMemo as T, useRef as E, useState as D } from "react";
14
+ import { ExhibitIconButton as O, ExhibitPopupIconButton as k } from "@sheetxl/utils-mui";
15
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
16
+ import { Box as N, Checkbox as P, Divider as F, FormControl as I, FormControlLabel as ee, FormHelperText as L, InputLabel as R, ListSubheader as z, MenuItem as B, MenuList as V, Select as H, TextField as U, ToggleButton as te, ToggleButtonGroup as W, Typography as ne } from "@mui/material";
17
+ import { messageKey as G } from "@sheetxl/utils";
18
+ import { ListSearch as K, PickList as re, filterByText as ie } from "@sheetxl/grid-react";
19
+ var ae = x((e) => {
20
+ let { value: t = null, selectors: n, onChange: r, title: i, allowNull: a = !1, readOnly: o = !1, extras: s, extraValue: c = null, ...l } = e, u = _(), f = i ?? u("condition.selectorTitle"), p = n.map((e) => ({
21
+ value: e.getName(),
22
+ title: e.getTitle?.() ?? e.getName()
23
+ })).map((e) => j(B, {
24
+ value: e.value,
25
+ children: e.title
26
+ }, e.value)), m = (s ?? []).map((e) => j(B, {
27
+ value: e.value,
28
+ children: e.title
29
+ }, `extra:${e.value}`)), h = { backgroundColor: "background.paper" };
30
+ return o && (h = {
31
+ ...h,
32
+ "& .MuiSelect-icon": { display: "none" },
33
+ "& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
34
+ }), M(I, {
35
+ size: "small",
36
+ ...l,
37
+ children: [j(R, { children: f }), M(H, {
38
+ value: c ?? t?.getName() ?? "null",
39
+ label: f,
40
+ readOnly: o,
41
+ IconComponent: (e) => j(d, {
42
+ iconKey: "ExpandMore",
43
+ ...e
44
+ }),
45
+ onChange: (e) => {
46
+ let t = e.target.value;
47
+ if (s?.some((e) => e.value === t)) return void r(null, t);
48
+ let i = t === "null" ? null : n.find((e) => e.getName() === t) ?? null;
49
+ r(i);
50
+ },
51
+ sx: h,
52
+ children: [
53
+ a && j(B, {
54
+ value: "null",
55
+ children: u("condition.anySelector")
56
+ }),
57
+ p,
58
+ m
59
+ ]
60
+ })]
61
+ });
62
+ });
63
+ ae.displayName = "SelectorSelect";
64
+ var q = 0, J = /* @__PURE__ */ new WeakMap(), oe = (e) => {
65
+ let t = J.get(e);
66
+ return t || (t = "__ci_" + ++q, J.set(e, t)), t;
67
+ }, se = (e, t) => {
68
+ let n = J.get(e);
69
+ n && J.set(t, n);
70
+ }, ce = Object.freeze([o.BuiltInOperatorNames.Icon, o.BuiltInOperatorNames.Color]), le = /* @__PURE__ */ new Set([
71
+ o.BuiltInOperatorNames.TextContains,
72
+ o.BuiltInOperatorNames.TextStartsWith,
73
+ o.BuiltInOperatorNames.TextEndsWith,
74
+ o.BuiltInOperatorNames.TextEmail,
75
+ o.BuiltInOperatorNames.TextIsUrl
76
+ ]), ue = /* @__PURE__ */ new WeakSet(), Y = /* @__PURE__ */ new WeakMap(), de = (e, t) => (Y.set(e, t), e), fe = (e) => (t, n) => {
77
+ let r = Number(ue.has(n)) - Number(ue.has(t));
78
+ if (r !== 0) return r;
79
+ let i = Y.has(t), a = Y.has(n);
80
+ return i || a ? Number(a) - Number(i) : (t.getTitle?.() ?? "").localeCompare(n.getTitle?.() ?? "", e);
81
+ }, pe = (e, t, n, i = ce) => {
82
+ let a = t ?? Object.values(r.BuiltInOperators), s = e?.getSelectType() ?? null, c = e?.getName() === o.BuiltInSelectorNames.Display;
83
+ return a.filter((t) => {
84
+ if (i.includes(t.getName())) return !1;
85
+ if (!e) return !0;
86
+ if (c && le.has(t.getName())) return !1;
87
+ let n = t.getAcceptsTypes?.();
88
+ return !n || n.includes(s);
89
+ }).sort(fe(n));
90
+ }, me = (e, t, n, r) => {
91
+ let i = fe(r), a = /* @__PURE__ */ new Map();
92
+ for (let t of e) {
93
+ let e = Y.get(t);
94
+ if (e === void 0) continue;
95
+ let n = a.get(e);
96
+ n ? n.push(t) : a.set(e, [t]);
97
+ }
98
+ let o = e.filter((e) => !e.isCombinator?.() && !Y.has(e)).sort(i), s = e.filter((e) => e.isCombinator?.()).sort(i), c = [];
99
+ for (let [e, n] of a) c.push(j(z, {
100
+ disableSticky: !0,
101
+ sx: he,
102
+ children: e
103
+ }, `__header:${e}`)), n.forEach((e) => c.push(t(e)));
104
+ return a.size > 0 && o.length > 0 && c.push(j(F, {}, "__divider:grouped")), o.length > 0 && (c.push(j(z, {
105
+ disableSticky: !0,
106
+ sx: he,
107
+ children: n("condition.groupBasic")
108
+ }, "__header:leaf")), o.forEach((e) => c.push(t(e)))), o.length > 0 && s.length > 0 && c.push(j(F, {}, "__divider")), s.length > 0 && (c.push(j(z, {
109
+ disableSticky: !0,
110
+ sx: he,
111
+ children: n("condition.groupCombine")
112
+ }, "__header:combinator")), s.forEach((e) => c.push(t(e)))), c;
113
+ }, X = (e, t, n = null, r) => {
114
+ if (!e.isCombinator?.()) return e.createDefaultParam?.(n ?? void 0, r) ?? null;
115
+ let i = t.find((e) => !e.isCombinator?.()) ?? null, a = i ? {
116
+ operator: i.getName(),
117
+ param: i.createDefaultParam?.(n ?? void 0) ?? null
118
+ } : null;
119
+ return e.getName() === "not" ? a : a ? [a] : [];
120
+ }, he = {
121
+ userSelect: "none",
122
+ lineHeight: "2",
123
+ fontSize: "0.75rem",
124
+ fontWeight: 600,
125
+ color: "text.secondary",
126
+ paddingLeft: 1,
127
+ paddingRight: 1
128
+ }, ge = { pl: 2 }, _e = x(b((e, t) => {
129
+ let { icon: n, tooltip: r, label: i, darkMode: a, propsPanel: o, value: s, operators: c, onChange: l, title: u, readOnly: p = !1, ...m } = e, g = _(), v = h();
130
+ u ?? g("condition.operatorTitle");
131
+ let y = n || j(d, { iconKey: "Add" }), b = E(l);
132
+ b.current = l;
133
+ let x = {
134
+ renderPopupPanel: S((e) => {
135
+ let { closeFloatAll: t } = e, n = me(c, (e) => j(B, {
136
+ sx: ge,
137
+ value: e.getName(),
138
+ onClick: () => {
139
+ t?.(), b.current(e);
140
+ },
141
+ children: e.getTitle?.()
142
+ }, e.getName()), g, v);
143
+ return j("div", {
144
+ style: {
145
+ minWidth: 200,
146
+ paddingTop: "8px",
147
+ paddingBottom: "8px",
148
+ ...o?.style
149
+ },
150
+ ...o,
151
+ onKeyDown: (e) => {
152
+ e.which === f.Enter && t?.();
153
+ },
154
+ children: j(V, {
155
+ disablePadding: !0,
156
+ children: n
157
+ })
158
+ });
159
+ }, [
160
+ c,
161
+ g,
162
+ v
163
+ ]),
164
+ tooltip: r || i || "When",
165
+ label: i,
166
+ disabled: p,
167
+ icon: y,
168
+ ...m
169
+ };
170
+ return j(k, {
171
+ ref: t,
172
+ ...x
173
+ });
174
+ })), ve = x((e) => {
175
+ let { value: t, operators: n, onChange: r, title: i, readOnly: a = !1, ...o } = e, s = _(), c = h(), l = i ?? s("condition.operatorTitle"), u = /* @__PURE__ */ new Map();
176
+ n.forEach((e) => {
177
+ u.set(e.getName(), e);
178
+ });
179
+ let f = me(n, (e) => j(B, {
180
+ value: e.getName(),
181
+ sx: ge,
182
+ children: e.getTitle?.()
183
+ }, e.getName()), s, c);
184
+ return M(I, {
185
+ size: "small",
186
+ ...o,
187
+ children: [j(R, { children: l }), j(H, {
188
+ value: t?.getName() ?? "null",
189
+ label: l,
190
+ readOnly: a,
191
+ IconComponent: (e) => j(d, {
192
+ iconKey: "ExpandMore",
193
+ ...e
194
+ }),
195
+ onChange: (e) => {
196
+ let t = e.target.value, n = t === "null" ? null : u.get(t) ?? null;
197
+ r(n);
198
+ },
199
+ sx: a ? {
200
+ "& .MuiSelect-icon": { display: "none" },
201
+ "& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
202
+ } : void 0,
203
+ children: f
204
+ })]
205
+ });
206
+ });
207
+ ve.displayName = "OperatorSelect";
208
+ var ye = x((e) => {
209
+ let { operator: t, inputs: n, onOptionChange: i, operators: a, selector: o, getItems: s, propsChecklist: c, ignoreBlank: l, readOnly: u, ...d } = e, f = _(), p = t.getName() === "not", m = p ? null : t.getName() === "and" ? f("condition.and") : f("condition.or"), h = (e) => e.selector ? r.Selectors.get(e.selector) ?? o : o, g = p ? f("condition.not") : m;
210
+ return j(N, {
211
+ sx: {
212
+ display: "flex",
213
+ flexDirection: "column",
214
+ gap: .5,
215
+ pl: 1,
216
+ borderLeft: 2,
217
+ borderColor: "divider"
218
+ },
219
+ ...d,
220
+ children: n.map((e, t) => j(v.Fragment, { children: j(Je, {
221
+ operatorTitle: t > 0 ? g ?? "" : "",
222
+ operatorParam: e,
223
+ onOperatorParamChange: (e) => ((e, t) => {
224
+ let r = n.slice(), a = n[e], o = {
225
+ operator: t.operator,
226
+ param: t.param
227
+ };
228
+ a?.selector && (o.selector = a.selector), se(n[e], o), r[e] = o, i(r);
229
+ })(t, e),
230
+ onRemove: () => ((e) => {
231
+ let t = n.filter((t, n) => n !== e);
232
+ i(t);
233
+ })(t),
234
+ operators: a,
235
+ selector: h(e),
236
+ onSelectorChange: (e) => ((e, t) => {
237
+ let r = n.slice(), { selector: a, ...o } = n[e], s = t ? {
238
+ ...o,
239
+ selector: t
240
+ } : o;
241
+ se(n[e], s), r[e] = s, i(r);
242
+ })(t, e),
243
+ getItems: s,
244
+ propsChecklist: c,
245
+ ignoreBlank: l,
246
+ readOnly: u,
247
+ required: p
248
+ }) }, oe(e)))
249
+ });
250
+ });
251
+ ye.displayName = "CombinatorOption";
252
+ var be = x((e) => {
253
+ let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = _();
254
+ return j(U, {
255
+ size: "small",
256
+ type: "text",
257
+ placeholder: a("condition.enterText"),
258
+ value: t ?? "",
259
+ onChange: (e) => n(String(e.target.value)),
260
+ disabled: r,
261
+ ...i,
262
+ slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
263
+ });
264
+ });
265
+ be.displayName = "StringOption";
266
+ var xe = x((e) => {
267
+ let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = _();
268
+ return j(U, {
269
+ size: "small",
270
+ type: "number",
271
+ placeholder: a("condition.enterNumber"),
272
+ value: "" + (t ?? ""),
273
+ onChange: (e) => n(Number(e.target.value)),
274
+ disabled: r,
275
+ ...i,
276
+ slotProps: { input: { sx: { backgroundColor: "background.paper" } } }
277
+ });
278
+ });
279
+ xe.displayName = "NumberOption";
280
+ var Se = y(null), Ce = (e) => {
281
+ let { rowIndex: t, colIndex: n } = e.getSelectedCell().getCoords();
282
+ return {
283
+ rowIndex: t,
284
+ colIndex: n
285
+ };
286
+ }, we = (e, t) => {
287
+ let n = ((e) => {
288
+ let t = e?.getCoords();
289
+ if (!t || t.length === 0) return null;
290
+ let n = t[0].rowStart, r = t[0].colStart;
291
+ for (let e = 1; e < t.length; e++) n = Math.min(n, t[e].rowStart), r = Math.min(r, t[e].colStart);
292
+ return {
293
+ rowIndex: n,
294
+ colIndex: r
295
+ };
296
+ })(t?.getRanges() ?? null);
297
+ if (!e || !n) return null;
298
+ let { rowIndex: r, colIndex: i } = Ce(e);
299
+ return r === n.rowIndex && i === n.colIndex ? null : {
300
+ active: {
301
+ rowIndex: r,
302
+ colIndex: i
303
+ },
304
+ anchor: n
305
+ };
306
+ }, Te = () => {
307
+ let e = u(), t = C(Se), n = E(null), r = e ? Ce(e) : null, i = e?.getName() ?? null, a = T(() => r && i ? {
308
+ ...r,
309
+ scope: i
310
+ } : void 0, [
311
+ i,
312
+ r?.rowIndex,
313
+ r?.colIndex
314
+ ]);
315
+ return T(() => ({
316
+ home: a,
317
+ display: (r) => {
318
+ let i = n.current;
319
+ if (i && i.stored === r.getExpression()) return i.text;
320
+ let a = we(e, t);
321
+ if (a) try {
322
+ let t = e.createFormula(r.getExpression(), a.anchor).shift(a.active);
323
+ if (t) return t.getExpression({ target: "display" });
324
+ } catch {}
325
+ return r.getExpression({ target: "display" });
326
+ },
327
+ compile: (r) => {
328
+ let i = we(e, t), a = null;
329
+ try {
330
+ a = e?.createFormula(r, i?.active, { target: "display" }) ?? null, a && i && (a = a.shift(i.anchor));
331
+ } catch {
332
+ a = null;
333
+ }
334
+ return n.current = a ? {
335
+ stored: a.getExpression(),
336
+ text: r
337
+ } : null, a ?? r;
338
+ }
339
+ }), [
340
+ e,
341
+ t,
342
+ a
343
+ ]);
344
+ }, Ee = (e, t) => !!t && typeof e == "string" && !e.startsWith("="), De = (e, t, n, r) => e == null ? "" : e.isIFormula ? "=" + t.display(e) : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : i.isError(e) ? e.getLabel() : r && typeof e == "number" ? ((e, t, n) => {
345
+ if (!e || t < 0) return String(t);
346
+ let r = t >= 1, i = !Number.isInteger(t), a;
347
+ return a = n !== "time" || r ? i ? r ? "Short DateTime" : "Long Time" : "Short Date" : "Long Time", e.createCell({
348
+ value: t,
349
+ style: { numberFormat: a }
350
+ }).getText();
351
+ })(n, e, r) : String(e), Oe = (e, t, n, r) => {
352
+ if (e.length === 0) return null;
353
+ if (e.startsWith("=")) {
354
+ let n = t.compile(e.substring(1));
355
+ return typeof n == "string" ? e : n;
356
+ }
357
+ let i = e.trim();
358
+ if (i.length === 0) return e;
359
+ if (r) return ((e, t) => {
360
+ if (!e) return null;
361
+ let n = e.createCell({ value: t }, void 0, { textParser: !0 });
362
+ return n.getType() === s.Number ? n.getValue() : null;
363
+ })(n, i) ?? e;
364
+ let a = Number(i);
365
+ return Number.isFinite(a) ? a : e;
366
+ }, ke = (e, t, n, r) => {
367
+ let i = Oe(e, t, n, r);
368
+ if ((!i?.isIFormula || i.isValid()) && !Ee(i, r)) return i;
369
+ }, Z = x((e) => {
370
+ let { option: r, onOptionChange: i, literal: a, readOnly: o, ...s } = e, c = _(), l = u(), d = Te(), f = E(null), p = E(null), [m, h] = D(!1), g = () => p.current === null || ke(p.current, d, l, a) !== void 0;
371
+ return n(() => {
372
+ let e = f.current;
373
+ return !e?.error && (p.current !== null && e?.commit(), g() ? !Ee(r, a) : (h(!0), !1));
374
+ }), j(t, {
375
+ size: "small",
376
+ home: d.home,
377
+ value: De(r, d, l, a),
378
+ apiRef: f,
379
+ onChangeText: (e) => {
380
+ h(!1), p.current = e;
381
+ let t = ke(e, d, l, a);
382
+ t !== void 0 && i(t);
383
+ },
384
+ onDone: () => {
385
+ g() ? p.current = null : h(!0);
386
+ },
387
+ validationError: m || Ee(r, a) ? G("condition.invalidDateTime") : null,
388
+ placeholder: c("condition.enterValueOrFormula"),
389
+ disabled: o,
390
+ fullWidth: !0,
391
+ equals: "literal",
392
+ pickAs: "absolute",
393
+ label: null,
394
+ showError: !1,
395
+ helperText: null,
396
+ ...s
397
+ });
398
+ });
399
+ Z.displayName = "ScalarOption";
400
+ var Ae = x((e) => {
401
+ let { option: t, onOptionChange: n, readOnly: r } = e, i = _();
402
+ return M(W, {
403
+ exclusive: !0,
404
+ size: "small",
405
+ value: t ?? !0,
406
+ onChange: (e, t) => {
407
+ t !== null && n(t);
408
+ },
409
+ sx: {
410
+ my: 0,
411
+ py: 0,
412
+ backgroundColor: "background.paper"
413
+ },
414
+ disabled: r,
415
+ children: [j(te, {
416
+ value: !0,
417
+ children: i("condition.true")
418
+ }), j(te, {
419
+ value: !1,
420
+ children: i("condition.false")
421
+ })]
422
+ });
423
+ });
424
+ Ae.displayName = "BooleanOption";
425
+ var je = {}, Me = x((t) => {
426
+ let { option: n, onOptionChange: r, className: i, readOnly: a, ...s } = t, c = _(), l = n?.type ?? o.AverageType.Above, u = n?.stdDevs ?? "", f = { backgroundColor: "background.paper" };
427
+ return a && (f = {
428
+ ...f,
429
+ "& .MuiSelect-icon": { display: "none" },
430
+ "& .MuiOutlinedInput-notchedOutline": { borderColor: "action.disabled" }
431
+ }), M(N, {
432
+ className: e(i, je.option),
433
+ ...s,
434
+ sx: {
435
+ display: "flex",
436
+ flexDirection: "row",
437
+ gap: .25,
438
+ ...s?.sx
439
+ },
440
+ children: [j(I, {
441
+ sx: { flex: .5 },
442
+ size: "small",
443
+ children: M(H, {
444
+ value: l,
445
+ sx: f,
446
+ IconComponent: (e) => j(d, {
447
+ iconKey: "ExpandMore",
448
+ ...e
449
+ }),
450
+ disabled: a,
451
+ onChange: (e) => r({
452
+ ...n,
453
+ type: e.target.value
454
+ }),
455
+ children: [j(B, {
456
+ value: o.AverageType.Above,
457
+ children: c("condition.above")
458
+ }), j(B, {
459
+ value: o.AverageType.Below,
460
+ children: c("condition.below")
461
+ })]
462
+ })
463
+ }), j(U, {
464
+ size: "small",
465
+ placeholder: c("condition.stdDevs"),
466
+ value: u,
467
+ onChange: (e) => {
468
+ let t = Number(e.target.value) || "", i = { ...n };
469
+ typeof t == "number" ? i.stdDevs = t : delete i.stdDevs, r(i);
470
+ },
471
+ sx: { flex: .5 },
472
+ disabled: a,
473
+ slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
474
+ type: "number"
475
+ })]
476
+ });
477
+ });
478
+ Me.displayName = "AverageOption";
479
+ var Ne = x((e) => {
480
+ let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = function(e, t) {
481
+ let n = (e) => new Intl.DateTimeFormat(t, { month: "long" }).format(new Date(2e3, e, 1));
482
+ return [
483
+ {
484
+ header: e("condition.period.day"),
485
+ options: [
486
+ {
487
+ value: o.TimePeriodType.Today,
488
+ label: e("condition.period.today")
489
+ },
490
+ {
491
+ value: o.TimePeriodType.Yesterday,
492
+ label: e("condition.period.yesterday")
493
+ },
494
+ {
495
+ value: o.TimePeriodType.Tomorrow,
496
+ label: e("condition.period.tomorrow")
497
+ }
498
+ ]
499
+ },
500
+ {
501
+ header: e("condition.period.week"),
502
+ options: [
503
+ {
504
+ value: o.TimePeriodType.ThisWeek,
505
+ label: e("condition.period.thisWeek")
506
+ },
507
+ {
508
+ value: o.TimePeriodType.LastWeek,
509
+ label: e("condition.period.lastWeek")
510
+ },
511
+ {
512
+ value: o.TimePeriodType.NextWeek,
513
+ label: e("condition.period.nextWeek")
514
+ }
515
+ ]
516
+ },
517
+ {
518
+ header: e("condition.period.month"),
519
+ options: [
520
+ {
521
+ value: o.TimePeriodType.ThisMonth,
522
+ label: e("condition.period.thisMonth")
523
+ },
524
+ {
525
+ value: o.TimePeriodType.LastMonth,
526
+ label: e("condition.period.lastMonth")
527
+ },
528
+ {
529
+ value: o.TimePeriodType.NextMonth,
530
+ label: e("condition.period.nextMonth")
531
+ }
532
+ ]
533
+ },
534
+ {
535
+ header: e("condition.period.year"),
536
+ options: [{
537
+ value: o.TimePeriodType.YearToDate,
538
+ label: e("condition.period.yearToDate")
539
+ }, {
540
+ value: o.TimePeriodType.LastYear,
541
+ label: e("condition.period.lastYear")
542
+ }]
543
+ },
544
+ {
545
+ header: e("condition.period.byMonth"),
546
+ options: [
547
+ {
548
+ value: o.TimePeriodType.M1,
549
+ label: n(0)
550
+ },
551
+ {
552
+ value: o.TimePeriodType.M2,
553
+ label: n(1)
554
+ },
555
+ {
556
+ value: o.TimePeriodType.M3,
557
+ label: n(2)
558
+ },
559
+ {
560
+ value: o.TimePeriodType.M4,
561
+ label: n(3)
562
+ },
563
+ {
564
+ value: o.TimePeriodType.M5,
565
+ label: n(4)
566
+ },
567
+ {
568
+ value: o.TimePeriodType.M6,
569
+ label: n(5)
570
+ },
571
+ {
572
+ value: o.TimePeriodType.M7,
573
+ label: n(6)
574
+ },
575
+ {
576
+ value: o.TimePeriodType.M8,
577
+ label: n(7)
578
+ },
579
+ {
580
+ value: o.TimePeriodType.M9,
581
+ label: n(8)
582
+ },
583
+ {
584
+ value: o.TimePeriodType.M10,
585
+ label: n(9)
586
+ },
587
+ {
588
+ value: o.TimePeriodType.M11,
589
+ label: n(10)
590
+ },
591
+ {
592
+ value: o.TimePeriodType.M12,
593
+ label: n(11)
594
+ }
595
+ ]
596
+ },
597
+ {
598
+ header: e("condition.period.byQuarter"),
599
+ options: [
600
+ {
601
+ value: o.TimePeriodType.ThisQuarter,
602
+ label: e("condition.period.thisQuarter")
603
+ },
604
+ {
605
+ value: o.TimePeriodType.LastQuarter,
606
+ label: e("condition.period.lastQuarter")
607
+ },
608
+ {
609
+ value: o.TimePeriodType.NextQuarter,
610
+ label: e("condition.period.nextQuarter")
611
+ },
612
+ {
613
+ value: o.TimePeriodType.Q1,
614
+ label: e("condition.period.q1")
615
+ },
616
+ {
617
+ value: o.TimePeriodType.Q2,
618
+ label: e("condition.period.q2")
619
+ },
620
+ {
621
+ value: o.TimePeriodType.Q3,
622
+ label: e("condition.period.q3")
623
+ },
624
+ {
625
+ value: o.TimePeriodType.Q4,
626
+ label: e("condition.period.q4")
627
+ }
628
+ ]
629
+ }
630
+ ];
631
+ }(_(), h()), s = t?.type ?? o.TimePeriodType.Today;
632
+ return j(N, {
633
+ ...i,
634
+ sx: {
635
+ display: "flex",
636
+ flexDirection: "column",
637
+ gap: 2,
638
+ ...i?.sx
639
+ },
640
+ children: j(I, {
641
+ size: "small",
642
+ children: j(H, {
643
+ value: s,
644
+ sx: { backgroundColor: "background.paper" },
645
+ IconComponent: (e) => j(d, {
646
+ iconKey: "ExpandMore",
647
+ ...e
648
+ }),
649
+ onChange: (e) => n({
650
+ ...t,
651
+ type: e.target.value
652
+ }),
653
+ disabled: r,
654
+ children: a.map((e, t) => {
655
+ let n = [];
656
+ return t > 0 && n.push(j(F, {}, `divider-${t}`)), n.push(j(z, {
657
+ sx: he,
658
+ children: e.header
659
+ }, `header-${t}`)), e.options.map((e) => n.push(j(B, {
660
+ sx: ge,
661
+ value: e.value,
662
+ children: e.label
663
+ }, e.value))), n;
664
+ })
665
+ })
666
+ })
667
+ });
668
+ });
669
+ Ne.displayName = "TimePeriodOption";
670
+ var Pe = x((e) => {
671
+ let { option: t, onOptionChange: n, readOnly: r, ...i } = e, a = _(), o = t?.top ?? !0, s = t?.limit ?? 10, c = t?.percent ?? !1;
672
+ return M(N, {
673
+ ...i,
674
+ sx: {
675
+ display: "flex",
676
+ flexDirection: "row",
677
+ gap: .25,
678
+ ...i?.sx
679
+ },
680
+ children: [
681
+ j(I, {
682
+ size: "small",
683
+ sx: { flex: 1 },
684
+ children: M(H, {
685
+ value: o ? "top" : "bottom",
686
+ sx: { backgroundColor: "background.paper" },
687
+ IconComponent: (e) => j(d, {
688
+ iconKey: "ExpandMore",
689
+ ...e
690
+ }),
691
+ onChange: (e) => n({
692
+ ...t,
693
+ top: e.target.value === "top"
694
+ }),
695
+ disabled: r,
696
+ children: [j(B, {
697
+ value: "top",
698
+ children: a("condition.top")
699
+ }), j(B, {
700
+ value: "bottom",
701
+ children: a("condition.bottom")
702
+ })]
703
+ })
704
+ }),
705
+ j(U, {
706
+ size: "small",
707
+ placeholder: "10",
708
+ value: s,
709
+ onChange: (e) => {
710
+ let r = parseFloat(e.target.value) || 10;
711
+ n({
712
+ ...t,
713
+ limit: r
714
+ });
715
+ },
716
+ disabled: r,
717
+ type: "number",
718
+ slotProps: { input: { sx: { backgroundColor: "background.paper" } } },
719
+ sx: { flex: .6 }
720
+ }),
721
+ j(I, {
722
+ size: "small",
723
+ sx: { flex: 1 },
724
+ children: M(H, {
725
+ value: c ? "percent" : "items",
726
+ sx: { backgroundColor: "background.paper" },
727
+ IconComponent: (e) => j(d, {
728
+ iconKey: "ExpandMore",
729
+ ...e
730
+ }),
731
+ onChange: (e) => n({
732
+ ...t,
733
+ percent: e.target.value === "percent"
734
+ }),
735
+ disabled: r,
736
+ children: [j(B, {
737
+ value: "items",
738
+ children: a("condition.items")
739
+ }), j(B, {
740
+ value: "percent",
741
+ children: a("condition.percent")
742
+ })]
743
+ })
744
+ })
745
+ ]
746
+ });
747
+ });
748
+ Pe.displayName = "TopNOption";
749
+ var Fe = x((e) => {
750
+ let { option: t, onOptionChange: n, selector: r, readOnly: i, ...a } = e, s = _(), c = ((e) => {
751
+ switch (e?.getName()) {
752
+ case o.BuiltInSelectorNames.Date: return "date";
753
+ case o.BuiltInSelectorNames.Time: return "time";
754
+ case o.BuiltInSelectorNames.DateTime: return "dateTime";
755
+ default: return;
756
+ }
757
+ })(r);
758
+ return M(N, {
759
+ ...a,
760
+ sx: {
761
+ display: "flex",
762
+ flexDirection: "row",
763
+ gap: .25,
764
+ ...a?.sx
765
+ },
766
+ children: [j(Z, {
767
+ option: t?.from ?? null,
768
+ literal: c,
769
+ placeholder: s("condition.from"),
770
+ onOptionChange: (e) => {
771
+ n({
772
+ ...t,
773
+ from: e
774
+ });
775
+ },
776
+ readOnly: i,
777
+ sx: {
778
+ flex: .6,
779
+ minWidth: 0
780
+ }
781
+ }), j(Z, {
782
+ option: t?.to ?? null,
783
+ literal: c,
784
+ placeholder: s("condition.to"),
785
+ onOptionChange: (e) => {
786
+ n({
787
+ ...t,
788
+ to: e
789
+ });
790
+ },
791
+ readOnly: i,
792
+ sx: {
793
+ flex: .6,
794
+ minWidth: 0
795
+ }
796
+ })]
797
+ });
798
+ });
799
+ Fe.displayName = "BetweenOption";
800
+ var Ie = x((e) => {
801
+ let { option: r, onOptionChange: i, readOnly: a, ...o } = e, s = _(), c = Te(), l = E(null), u = r?.isIFormula ? c.display(r) : r ?? "";
802
+ return n(() => !l.current?.error), j(t, {
803
+ size: "small",
804
+ home: c.home,
805
+ value: u,
806
+ apiRef: l,
807
+ onChangeText: (e) => {
808
+ let t = e.trim();
809
+ if (t.length === 0) return void i("");
810
+ if (!t.startsWith("=")) return;
811
+ let n = t.substring(1);
812
+ i(n.trim().length > 0 ? c.compile(n) : "");
813
+ },
814
+ placeholder: s("condition.enterFormula"),
815
+ disabled: a,
816
+ fullWidth: !0,
817
+ equals: "required",
818
+ label: null,
819
+ showError: !1,
820
+ helperText: null,
821
+ ...o
822
+ });
823
+ });
824
+ Ie.displayName = "ExpressionOption";
825
+ var Le = "\0blank", Re = (e) => typeof e == "string" ? "s:" + e.toLowerCase() : typeof e + ":" + String(e), ze = (e, t) => t ? e.text : Re(e.value), Be = (e) => {
826
+ let t = e?.[0]?.runs;
827
+ return t && t.length > 0 ? t[t.length - 1].max : -1;
828
+ }, Ve = (e, t, n) => {
829
+ let r = e.items, i = (e) => t.has(ze(r[e], n)), { groups: a, leafItems: o } = ((e, t, n) => {
830
+ let r = [], i = [];
831
+ if (!t || t.length === 0) return {
832
+ groups: r,
833
+ leafItems: i
834
+ };
835
+ let a = (e, o, s) => {
836
+ let c = t[e].runs;
837
+ for (let l = 0; l < c.length; l++) {
838
+ let u = c[l];
839
+ if (u.max < o) continue;
840
+ if (u.min > s) break;
841
+ let d = !1, f = !0;
842
+ for (let e = u.min; e <= u.max; e++) n(e) ? d = !0 : f = !1;
843
+ if (f && u.value) r.push(u.value);
844
+ else if (d && e + 1 < t.length) a(e + 1, u.min, u.max);
845
+ else if (d) for (let e = u.min; e <= u.max; e++) n(e) && i.push(e);
846
+ }
847
+ };
848
+ return a(0, 0, Be(t)), {
849
+ groups: r,
850
+ leafItems: i
851
+ };
852
+ })(0, e.dates, i), s = [], c = (e) => {
853
+ s.push(n ? r[e].text : r[e].value);
854
+ };
855
+ for (let e = 0; e < o.length; e++) c(o[e]);
856
+ for (let t = Be(e.dates) + 1; t < r.length; t++) i(t) && c(t);
857
+ let l = { items: s };
858
+ return a.length > 0 && (l.dateGroups = a), e.hasBlanks && t.has(Le) && (l.blank = !0), l;
859
+ }, He = o.BuiltInSelectorNames.Display, Ue = x((e) => {
860
+ let { onOptionChange: t, getItems: n, selector: r, onSelectorChange: i, ignoreBlank: a = !1, readOnly: o, sx: s, propsChecklist: c } = e, { onWholeChange: u, ...d } = c ?? {}, f = _(), p = r?.getName() === He, [m, h] = D(null), [g, v] = D(() => /* @__PURE__ */ new Set()), y = E(null), b = E(t);
861
+ b.current = t;
862
+ let x = E(u);
863
+ x.current = u, w(() => {
864
+ let e = !0;
865
+ return n({ selector: p ? He : null }).then((t) => {
866
+ if (!e) return;
867
+ let n = y.current;
868
+ y.current = null;
869
+ let r = /* @__PURE__ */ new Set();
870
+ for (let e of t.items) (n ? n.values.has(Re(e.value)) || n.texts.has(e.text) : e.checked) && r.add(ze(e, p));
871
+ t.hasBlanks && (n ? n.blank : t.blanksChecked) && r.add(Le), h(t), v(r);
872
+ }), () => {
873
+ e = !1;
874
+ };
875
+ }, [n, p]), w(() => {
876
+ if (!m) return;
877
+ b.current(Ve(m, g, p));
878
+ let e = !m.truncated;
879
+ for (let t = 0; e && t < m.items.length; t++) e = g.has(ze(m.items[t], p));
880
+ let t = !m.hasBlanks || a || g.has(Le);
881
+ x.current?.(e, t);
882
+ }, [
883
+ m,
884
+ g,
885
+ p,
886
+ a
887
+ ]);
888
+ let C = T(() => {
889
+ if (!m) return [];
890
+ let e = ((e, t, n) => {
891
+ let r = /* @__PURE__ */ new Map();
892
+ for (let t of e) {
893
+ let e = t.text.trim();
894
+ r.set(e, (r.get(e) ?? 0) + 1);
895
+ }
896
+ return e.map((e) => {
897
+ if (!t && typeof (i = e.value) == "string" && i.length > 0 && /^ +$/.test(i)) return n("checklist.spaces", { count: e.value.length });
898
+ var i;
899
+ let a = e.text, o = a.trim();
900
+ return a === o || (r.get(o) ?? 0) < 2 ? a : a.replace(/^ +| +$/g, (e) => "␣".repeat(e.length));
901
+ });
902
+ })(m.items, p, f), t = m.items.map((t, n) => ({
903
+ text: e[n],
904
+ value: t.value,
905
+ count: t.count,
906
+ key: ze(t, p)
907
+ }));
908
+ return m.hasBlanks && !a && t.push({
909
+ text: f("checklist.blank"),
910
+ value: null,
911
+ key: Le,
912
+ blank: !0
913
+ }), t;
914
+ }, [
915
+ m,
916
+ p,
917
+ a,
918
+ f
919
+ ]), O = S((e, t) => {
920
+ o || v((n) => {
921
+ let r = new Set(n);
922
+ for (let n of e) t ? r.add(n) : r.delete(n);
923
+ return r;
924
+ });
925
+ }, [o]), k = S((e) => {
926
+ if (o || !m || !i || e === p) return;
927
+ let t = {
928
+ values: /* @__PURE__ */ new Set(),
929
+ texts: /* @__PURE__ */ new Set(),
930
+ blank: g.has(Le)
931
+ };
932
+ for (let e of m.items) g.has(ze(e, p)) && (t.values.add(Re(e.value)), t.texts.add(e.text));
933
+ y.current = t, i(e ? He : null);
934
+ }, [
935
+ o,
936
+ m,
937
+ g,
938
+ p,
939
+ i
940
+ ]);
941
+ return j(N, {
942
+ sx: {
943
+ display: "flex",
944
+ flexDirection: "column",
945
+ minWidth: 0,
946
+ typography: "body2",
947
+ ...s
948
+ },
949
+ children: j(l, {
950
+ items: C,
951
+ dates: m?.dates,
952
+ checked: g,
953
+ onCheckedChange: O,
954
+ byDisplay: p,
955
+ onByDisplayChange: i ? k : void 0,
956
+ truncated: m?.truncated ?? !1,
957
+ style: {
958
+ minHeight: 220,
959
+ maxHeight: 260
960
+ },
961
+ ...d
962
+ })
963
+ });
964
+ });
965
+ Ue.displayName = "SnapshotMembership";
966
+ var We = (e) => e == null ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : String(e), Ge = x((e) => {
967
+ let { option: n, onOptionChange: r, ignoreBlank: i = !1, readOnly: o, sx: s, propsChecklist: l } = e, d = _(), f = u(), p = C(Se), m = Te(), h = c(f?.getWorkbook()?.getLocale() ?? "en").listSeparator, g = n?.items, v = n?.source, y = n?.additions, b = n?.subtractions, x = n?.blank, O = v != null && v !== "", k = T(() => {
968
+ let e = [];
969
+ if (Array.isArray(g)) for (let t = 0; t < g.length; t++) {
970
+ let n = We(g[t]);
971
+ n.length > 0 && e.push(n);
972
+ }
973
+ if (y) for (let t = 0; t < y.length; t++) e.push(y[t]);
974
+ return e;
975
+ }, [g, y]), [A, P] = D(null), F = E(0);
976
+ w(() => {
977
+ if (!p?.getListItemsAt || !f) return void P(null);
978
+ let e = ++F.current, { rowIndex: t, colIndex: n } = Ce(f);
979
+ p.getListItemsAt(t, n).then((t) => {
980
+ e === F.current && P(t);
981
+ }, () => {
982
+ e === F.current && P([]);
983
+ });
984
+ }, [
985
+ p,
986
+ f,
987
+ g,
988
+ v,
989
+ y,
990
+ b,
991
+ x
992
+ ]);
993
+ let I = T(() => {
994
+ let e = [];
995
+ if (A) {
996
+ for (let t = 0; t < A.length; t++) {
997
+ let n = A[t];
998
+ n.value === null ? i || e.push({ text: d("checklist.blank") }) : e.push({ text: n.text });
999
+ }
1000
+ return e;
1001
+ }
1002
+ for (let t = 0; t < k.length; t++) e.push({ text: k[t] });
1003
+ return x && !i && e.push({ text: d("checklist.blank") }), e;
1004
+ }, [
1005
+ A,
1006
+ k,
1007
+ x,
1008
+ i,
1009
+ d
1010
+ ]), [ee, R] = D(null), [z, B] = D(null), V = S((e) => {
1011
+ let { source: t, items: i, additions: o, subtractions: s, ...c } = n ?? {}, l = e.trim();
1012
+ if (l.startsWith("=")) {
1013
+ let e = l.substring(1).trim();
1014
+ if (e.length === 0) return void R(null);
1015
+ let t = m.compile(e), n = typeof t == "string" ? t : t.getExpression();
1016
+ typeof t != "string" && ((e) => {
1017
+ let t = e;
1018
+ for (; t?.type === "paren" && t.inputs?.length === 1;) t = t.inputs[0];
1019
+ return t?.type === "list" || t?.type === "paren" && (t.inputs?.length ?? 0) > 1;
1020
+ })(a.parse(n)) ? R(G("condition.listSourceOneRange")) : (R(null), r({
1021
+ ...c,
1022
+ source: n
1023
+ }));
1024
+ return;
1025
+ }
1026
+ let u = l.length === 0 ? [] : l.split(h).map((e) => e.trim()).filter((e) => e.length > 0);
1027
+ u.some((e) => e.includes(",")) ? R(G("condition.listItemHasComma")) : (R(null), r(u.length > 0 ? {
1028
+ ...c,
1029
+ additions: u
1030
+ } : c));
1031
+ }, [
1032
+ n,
1033
+ r,
1034
+ m,
1035
+ h
1036
+ ]), H = T(() => O ? "=" + (v.isIFormula ? m.display(v) : v) : k.join(h + " "), [
1037
+ O,
1038
+ v,
1039
+ m,
1040
+ k,
1041
+ h
1042
+ ]), U = z ?? ee, { viewport: te, itemHeight: W } = l ?? {}, ae = W ?? 24, [q, J] = D(""), oe = T(() => q ? ie(I, q) : I, [I, q]);
1043
+ return M(N, {
1044
+ sx: {
1045
+ display: "flex",
1046
+ flexDirection: "column",
1047
+ minWidth: 0,
1048
+ gap: 1,
1049
+ typography: "body2",
1050
+ ...s
1051
+ },
1052
+ children: [
1053
+ j(t, {
1054
+ size: "small",
1055
+ home: m.home,
1056
+ value: H,
1057
+ onChangeText: V,
1058
+ label: null,
1059
+ placeholder: d("condition.enterListSource"),
1060
+ disabled: o,
1061
+ fullWidth: !0,
1062
+ equals: "literal",
1063
+ pickAs: "absolute",
1064
+ allowMulti: !1,
1065
+ validationError: ee,
1066
+ onChangeError: B,
1067
+ showError: !1,
1068
+ helperText: null
1069
+ }),
1070
+ U && j(L, {
1071
+ error: !0,
1072
+ sx: { mt: -.5 },
1073
+ children: d(U)
1074
+ }),
1075
+ M(N, {
1076
+ className: "list-preview",
1077
+ sx: {
1078
+ display: "flex",
1079
+ flexDirection: "column",
1080
+ gap: .5,
1081
+ minWidth: 0
1082
+ },
1083
+ children: [j(K, {
1084
+ value: q,
1085
+ onChange: J,
1086
+ placeholder: d("condition.listPreviewSearch"),
1087
+ clearLabel: d("condition.listPreviewClearSearch"),
1088
+ trailing: j(N, {
1089
+ component: "span",
1090
+ className: "list-preview-count",
1091
+ sx: {
1092
+ flex: "0 0 auto",
1093
+ fontSize: 12,
1094
+ opacity: .75,
1095
+ whiteSpace: "nowrap"
1096
+ },
1097
+ children: q ? d("checklist.countFiltered", {
1098
+ checked: oe.length,
1099
+ total: I.length
1100
+ }) : d("condition.listItems", { count: I.length })
1101
+ })
1102
+ }), j(N, {
1103
+ sx: {
1104
+ display: "flex",
1105
+ flexDirection: "column",
1106
+ border: "1px solid var(--sxl-color-base-300, light-dark(rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.16)))",
1107
+ borderRadius: "4px",
1108
+ overflow: "hidden",
1109
+ minWidth: 0,
1110
+ height: 6 * ae + 2
1111
+ },
1112
+ children: oe.length === 0 ? j(ne, {
1113
+ variant: "body2",
1114
+ color: "text.disabled",
1115
+ sx: {
1116
+ flex: 1,
1117
+ display: "flex",
1118
+ alignItems: "center",
1119
+ justifyContent: "center",
1120
+ px: 1
1121
+ },
1122
+ children: d(q ? "condition.listPreviewNoMatch" : "condition.listPreviewEmpty")
1123
+ }) : j(re, {
1124
+ items: oe,
1125
+ itemHeight: W,
1126
+ viewport: te,
1127
+ visibleRows: 6,
1128
+ style: { minWidth: "100%" }
1129
+ })
1130
+ })]
1131
+ })
1132
+ ]
1133
+ });
1134
+ });
1135
+ Ge.displayName = "AuthoredMembership";
1136
+ var Ke = x((e) => {
1137
+ let t = e.getItems;
1138
+ return t ? j(Ue, {
1139
+ ...e,
1140
+ getItems: t
1141
+ }) : j(Ge, { ...e });
1142
+ });
1143
+ Ke.displayName = "MembershipOption";
1144
+ var Q = o.BuiltInOperatorNames, qe = /* @__PURE__ */ new Set([
1145
+ Q.EqualTo,
1146
+ Q.GreaterThan,
1147
+ Q.GreaterThanEqualTo,
1148
+ Q.LessThan,
1149
+ Q.LessThanEqualTo,
1150
+ Q.After,
1151
+ Q.AfterEqualTo,
1152
+ Q.Before,
1153
+ Q.BeforeEqualTo
1154
+ ]), Je = x((e) => {
1155
+ let { operatorParam: t, onOperatorParamChange: n, onRemove: r, renderRemove: i, operators: a, selector: s, onSelectorChange: c, getItems: l, propsChecklist: u, ignoreBlank: f, operatorTitle: h, operatorFixed: v = !1, readOnly: y, required: b, ...x } = e, S = _(), C = h ?? S("condition.when"), w = t?.operator ?? null, E = () => y || b || i === null ? null : i ? j(p, {
1156
+ render: i,
1157
+ props: {
1158
+ onClick: r,
1159
+ operator: w,
1160
+ readOnly: y
1161
+ }
1162
+ }) : j(O, {
1163
+ icon: j(d, { iconKey: "Close" }),
1164
+ onClick: r
1165
+ }), D = a.find((e) => e.getName() === w) ?? null, k = t?.param ?? null, P = !!D?.isCombinator?.(), F = w === o.BuiltInOperatorNames.InSet, [I, { width: ee }] = g(), L = T(() => !D || P ? null : D.getParamType?.(s ?? void 0) ?? null, [
1166
+ D,
1167
+ P,
1168
+ s
1169
+ ]), R = v || !P && !F && ee > 360, z = m((e) => {
1170
+ n({
1171
+ operator: w,
1172
+ param: e
1173
+ });
1174
+ }, [n, w]), B = T(() => {
1175
+ if (!D || P) return null;
1176
+ let e = {
1177
+ sx: {
1178
+ flex: v ? 1 : .6,
1179
+ minWidth: 0
1180
+ },
1181
+ option: k,
1182
+ onOptionChange: z
1183
+ };
1184
+ if (F) return j(Ke, {
1185
+ ...e,
1186
+ getItems: l,
1187
+ selector: s,
1188
+ onSelectorChange: c,
1189
+ readOnly: y,
1190
+ propsChecklist: u,
1191
+ ignoreBlank: f
1192
+ });
1193
+ if (!L) return null;
1194
+ let t = !!w && qe.has(w);
1195
+ return L === o.BuiltInSelectorNames.Number || L === o.BuiltInSelectorNames.TextLength ? j(t ? Z : xe, { ...e }) : L === o.BuiltInSelectorNames.Whole ? t ? j(Z, { ...e }) : j(xe, {
1196
+ ...e,
1197
+ placeholder: S("condition.enterWholeNumber"),
1198
+ slotProps: { htmlInput: {
1199
+ step: 1,
1200
+ onKeyDown: (e) => {
1201
+ [
1202
+ ".",
1203
+ ",",
1204
+ "e",
1205
+ "E"
1206
+ ].includes(e.key) && e.preventDefault();
1207
+ },
1208
+ onPaste: (e) => {
1209
+ /^-?\d+$/.test(e.clipboardData.getData("text")) || e.preventDefault();
1210
+ }
1211
+ } }
1212
+ }) : L === o.BuiltInSelectorNames.Text || L === o.BuiltInSelectorNames.Display ? j(t ? Z : be, { ...e }) : L === o.BuiltInSelectorNames.DateTime ? j(Z, {
1213
+ ...e,
1214
+ literal: "dateTime"
1215
+ }) : L === o.BuiltInSelectorNames.Date ? j(Z, {
1216
+ ...e,
1217
+ literal: "date"
1218
+ }) : L === o.BuiltInSelectorNames.Time ? j(Z, {
1219
+ ...e,
1220
+ literal: "time"
1221
+ }) : L === o.BuiltInSelectorNames.Logical ? j(Ae, { ...e }) : L === o.BuiltInOperatorNames.Average ? j(Me, { ...e }) : L === o.BuiltInOperatorNames.TimePeriod ? j(Ne, { ...e }) : L === o.BuiltInOperatorNames.TopN ? j(Pe, { ...e }) : L === o.BuiltInOperatorNames.Between ? j(Fe, {
1222
+ ...e,
1223
+ selector: s
1224
+ }) : L === o.BuiltInOperatorNames.Expression ? j(Ie, { ...e }) : null;
1225
+ }, [
1226
+ D,
1227
+ P,
1228
+ F,
1229
+ l,
1230
+ u,
1231
+ f,
1232
+ y,
1233
+ L,
1234
+ k,
1235
+ s,
1236
+ c,
1237
+ v,
1238
+ S
1239
+ ]), V = T(() => P && k ? Array.isArray(k) ? k : [k] : [], [P, k]), H = P && D?.getName() === "not", U = (e) => {
1240
+ if (!e || e === D) return;
1241
+ let t = !!e.isCombinator?.(), r;
1242
+ if (t && P) r = e.getName() === "not" ? V[0] ?? X(e, a, s) : V.length > 0 ? V : X(e, a, s);
1243
+ else {
1244
+ let n = D?.getParamType?.(s ?? void 0) ?? null, i = e.getParamType?.(s ?? void 0) ?? null;
1245
+ r = t || P || !i || i !== n ? X(e, a, s) : k;
1246
+ }
1247
+ n({
1248
+ operator: e?.getName() ?? null,
1249
+ param: r
1250
+ });
1251
+ };
1252
+ return j(N, {
1253
+ ref: I,
1254
+ sx: {
1255
+ display: "flex",
1256
+ flexDirection: "column",
1257
+ gap: .5,
1258
+ backgroundColor: "background.paper",
1259
+ border: 1,
1260
+ borderColor: "divider",
1261
+ borderRadius: 1,
1262
+ p: 1
1263
+ },
1264
+ ...x,
1265
+ children: R ? M(N, {
1266
+ sx: {
1267
+ display: "flex",
1268
+ flexDirection: "row",
1269
+ alignItems: "center",
1270
+ gap: .5
1271
+ },
1272
+ children: [
1273
+ v ? null : j(ve, {
1274
+ title: C,
1275
+ sx: { flex: .4 },
1276
+ value: D,
1277
+ operators: a,
1278
+ onChange: U,
1279
+ readOnly: y
1280
+ }),
1281
+ B,
1282
+ E()
1283
+ ]
1284
+ }) : M(A, { children: [M(N, {
1285
+ sx: {
1286
+ display: "flex",
1287
+ flexDirection: "row",
1288
+ alignItems: "center",
1289
+ gap: .5
1290
+ },
1291
+ children: [
1292
+ j(ve, {
1293
+ title: C,
1294
+ sx: { flex: 1 },
1295
+ value: D,
1296
+ operators: a,
1297
+ onChange: U,
1298
+ readOnly: y
1299
+ }),
1300
+ P && !H && !y && j(_e, {
1301
+ label: D?.getTitle?.(),
1302
+ icon: j(d, { iconKey: "Add" }),
1303
+ operators: a,
1304
+ value: null,
1305
+ onChange: (e) => {
1306
+ if (!e) return;
1307
+ let t = X(e, a, s), r = [...V, {
1308
+ operator: e?.getName() ?? null,
1309
+ param: t
1310
+ }];
1311
+ n({
1312
+ operator: w,
1313
+ param: r
1314
+ });
1315
+ }
1316
+ }),
1317
+ E()
1318
+ ]
1319
+ }), P ? j(ye, {
1320
+ operator: D,
1321
+ inputs: V,
1322
+ onOptionChange: (e) => {
1323
+ n({
1324
+ operator: w,
1325
+ param: H ? e[0] ?? null : e
1326
+ });
1327
+ },
1328
+ operators: a,
1329
+ selector: s,
1330
+ getItems: l,
1331
+ propsChecklist: u,
1332
+ ignoreBlank: f,
1333
+ readOnly: y
1334
+ }) : B] })
1335
+ });
1336
+ });
1337
+ Je.displayName = "OperatorAndParamEditor";
1338
+ var Ye = {
1339
+ backgroundColor: "action.hover",
1340
+ border: 1,
1341
+ borderColor: "divider",
1342
+ borderRadius: 1
1343
+ }, $ = "formula", Xe = x((e) => {
1344
+ let { condition: t, onConditionChange: n, showIncludeBlanks: i = !0, qualifiers: a, selectorTitle: s, readOnly: c, operators: l, selectors: u, ranges: d, getItems: f, propsChecklist: p, showSelector: m = !0, operatorTitle: g, renderRemove: v, sx: y, ...b } = e, x = _(), S = h(), [C, O] = D(() => t?.getSelector() ?? null), [k, A] = D(() => t?.getOperator() ? {
1345
+ operator: t.getOperator().getName(),
1346
+ param: t.getParam()
1347
+ } : null), [F, I] = D(() => t?.isIncludeBlanks() ?? !1);
1348
+ w(() => {
1349
+ if (!t) return O(null), void A(null);
1350
+ let e = t.getOperator(), n = t.getSelector() ?? null;
1351
+ O(n), A(e ? {
1352
+ operator: e.getName(),
1353
+ param: t.getParam()
1354
+ } : null), I(t.isIncludeBlanks());
1355
+ }, [t]);
1356
+ let L = T(() => (u ?? Object.values(r.BuiltInSelectors)).slice().sort((e, t) => (e.getTitle?.() ?? "").localeCompare(t.getTitle?.() ?? "", S)), [u, S]), R = T(() => l ?? Object.values(r.BuiltInOperators), [l]), z = T(() => R.find((e) => e.getName() === o.BuiltInOperatorNames.Expression) ?? null, [R]), B = m && !!z, V = B && k?.operator === o.BuiltInOperatorNames.Expression, H = T(() => {
1357
+ if (l) return null;
1358
+ let e = R.find((e) => e.getName() === o.BuiltInOperatorNames.InSet);
1359
+ return e ? (t = Object.create(e), ue.add(t), t) : null;
1360
+ var t;
1361
+ }, [R, l]), U = T(() => {
1362
+ let e = pe(m ? C : null, R, S, l ? [] : void 0);
1363
+ if (f) {
1364
+ let t = R.find((e) => e.getName() === o.BuiltInOperatorNames.InSet);
1365
+ t && !e.includes(t) && e.unshift(t);
1366
+ }
1367
+ if (H && !C) {
1368
+ let t = e.findIndex((e) => e.getName() === o.BuiltInOperatorNames.InSet);
1369
+ t >= 0 && e.splice(t, 1, H);
1370
+ }
1371
+ return e;
1372
+ }, [
1373
+ C,
1374
+ R,
1375
+ S,
1376
+ l,
1377
+ f,
1378
+ m,
1379
+ H
1380
+ ]), te = T(() => B ? U.filter((e) => e.getName() !== o.BuiltInOperatorNames.Expression) : U, [U, B]), W = E(/* @__PURE__ */ new Map()), ne = (e) => e?.getName() ?? "", G = E(null), K = E(!1);
1381
+ w(() => {
1382
+ if (!K.current) return;
1383
+ K.current = !1;
1384
+ let e = Array.from(G.current?.querySelectorAll("input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"hidden\"]):not([tabindex=\"-1\"]), textarea") ?? []).find((e) => !e.disabled && !e.readOnly && e.getAttribute("aria-hidden") !== "true");
1385
+ e && (e.focus(), e.select());
1386
+ }, [C, k]);
1387
+ let re = (e) => {
1388
+ let t = R.find((t) => t.getName() === e.operator) ?? null, r = m || !C || !t || ((e, t) => {
1389
+ if (!e) return !0;
1390
+ let n = t.getName();
1391
+ if (n === o.BuiltInOperatorNames.Blank) return !0;
1392
+ if (e.getName() === o.BuiltInSelectorNames.Display && le.has(n)) return !1;
1393
+ let r = t.getAcceptsTypes?.();
1394
+ return !r || r.includes(e.getSelectType() ?? null);
1395
+ })(C, t) ? C : null;
1396
+ r !== C && O(r), A(e), n?.({
1397
+ selector: r,
1398
+ ...e,
1399
+ includeBlanks: F
1400
+ });
1401
+ };
1402
+ return M(N, {
1403
+ sx: [{
1404
+ display: "flex",
1405
+ flexDirection: "column",
1406
+ gap: 1
1407
+ }, ...Array.isArray(y) ? y : [y]],
1408
+ ...b,
1409
+ children: [
1410
+ m ? j(ae, {
1411
+ title: s,
1412
+ selectors: L,
1413
+ value: C,
1414
+ onChange: (e, t) => {
1415
+ if (k && W.current.set(V ? $ : ne(C), k), t === $ && z) {
1416
+ let e = W.current.get($) ?? {
1417
+ operator: z.getName(),
1418
+ param: z.createDefaultParam?.() ?? ""
1419
+ };
1420
+ O(null), A(e), K.current = !0, n?.({
1421
+ selector: null,
1422
+ ...e,
1423
+ includeBlanks: F
1424
+ });
1425
+ return;
1426
+ }
1427
+ let r = ((e) => {
1428
+ let { from: t, to: n, current: r, remembered: i, operators: a, context: o } = e, s = pe(n, a), c = (e) => e && s.find((t) => t.getName() === e) || null;
1429
+ if (i && c(i.operator)) return i;
1430
+ let l = c(r?.operator);
1431
+ if (r && l) {
1432
+ let e = (l.getParamType?.(t ?? void 0) ?? null) !== (l.getParamType?.(n ?? void 0) ?? null);
1433
+ return l.isCombinator?.() || e ? {
1434
+ operator: r.operator,
1435
+ param: X(l, s, n)
1436
+ } : r;
1437
+ }
1438
+ let u = n?.getDefaultCondition?.(o) ?? null, d = c(u?.operator);
1439
+ return u && d ? {
1440
+ operator: u.operator,
1441
+ param: u.param === void 0 ? X(d, s, n) : u.param
1442
+ } : null;
1443
+ })({
1444
+ from: C,
1445
+ to: e,
1446
+ current: V ? null : k,
1447
+ remembered: W.current.get(ne(e)) ?? null,
1448
+ operators: R,
1449
+ context: { ranges: d }
1450
+ });
1451
+ O(e), A(r), K.current = !0, n?.({
1452
+ selector: e,
1453
+ ...r ?? {
1454
+ operator: null,
1455
+ param: null
1456
+ },
1457
+ includeBlanks: F
1458
+ });
1459
+ },
1460
+ allowNull: !0,
1461
+ readOnly: c,
1462
+ extras: B ? [{
1463
+ value: $,
1464
+ title: z.getTitle?.() ?? $
1465
+ }] : void 0,
1466
+ extraValue: V ? $ : null
1467
+ }) : null,
1468
+ k ? j(N, {
1469
+ ref: G,
1470
+ sx: { display: "contents" },
1471
+ children: j(Je, {
1472
+ operatorParam: k,
1473
+ onOperatorParamChange: re,
1474
+ onRemove: () => {
1475
+ A(null), n?.({
1476
+ selector: C,
1477
+ operator: null,
1478
+ param: null,
1479
+ includeBlanks: F
1480
+ });
1481
+ },
1482
+ renderRemove: v,
1483
+ operatorTitle: g,
1484
+ operators: V ? U : te,
1485
+ operatorFixed: V,
1486
+ selector: C,
1487
+ onSelectorChange: (e) => {
1488
+ let t = e ? L.find((t) => t.getName() === e) ?? r.Selectors.get(e) ?? null : null;
1489
+ O(t), n?.({
1490
+ selector: t,
1491
+ ...k,
1492
+ includeBlanks: F
1493
+ });
1494
+ },
1495
+ getItems: f,
1496
+ propsChecklist: p,
1497
+ ignoreBlank: F,
1498
+ readOnly: c
1499
+ })
1500
+ }) : !c && j(N, {
1501
+ sx: { display: "flex" },
1502
+ children: j(_e, {
1503
+ label: g ?? x("condition.when"),
1504
+ operators: te,
1505
+ value: null,
1506
+ onChange: (e) => {
1507
+ e && (K.current = !0, re({
1508
+ operator: e?.getName() ?? null,
1509
+ param: X(e, U, C, f ? void 0 : { ranges: d })
1510
+ }));
1511
+ },
1512
+ readOnly: c
1513
+ })
1514
+ }),
1515
+ i || a ? M(N, {
1516
+ className: "condition-qualifiers",
1517
+ sx: {
1518
+ display: "flex",
1519
+ flexWrap: "wrap",
1520
+ alignItems: "center",
1521
+ columnGap: 2
1522
+ },
1523
+ children: [i ? j(ee, {
1524
+ className: "include-blanks",
1525
+ control: j(P, {
1526
+ size: "small",
1527
+ checked: F,
1528
+ onChange: (e) => {
1529
+ t = e.target.checked, I(t), n?.({
1530
+ selector: C,
1531
+ ...k,
1532
+ includeBlanks: t
1533
+ });
1534
+ return;
1535
+ var t;
1536
+ }
1537
+ }),
1538
+ disabled: c,
1539
+ label: x("condition.ignoreBlank")
1540
+ }) : null, a]
1541
+ }) : null
1542
+ ]
1543
+ });
1544
+ });
1545
+ Xe.displayName = "ConditionEditor";
1546
+ export { Te as a, fe as c, Se as i, de as l, Ye as n, ce as o, Ke as r, X as s, Xe as t };