@sheetxl/studio-mui 0.8.0-beta.9 → 1.0.2

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