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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/LICENSE.md +17 -7
  2. package/browser/esm/{DT71hr6qq9QMKf7Q.mjs → 2dGXbxSvPxpMpoQB.mjs} +2 -2
  3. package/browser/esm/AKfq7wiKunwYv5Co.mjs +87 -0
  4. package/browser/esm/{C--IZ8To0PhVLhoX.mjs → B16SyYhTCohin7vO.mjs} +4 -4
  5. package/browser/esm/B4qh8uSPezvUgs_C.mjs +414 -0
  6. package/browser/esm/BGR0Hv_mjOPfYxiD.mjs +975 -0
  7. package/browser/esm/{ipftNUxAU0HR-0YP.mjs → BVbTWo0j5ttMcIWs.mjs} +3 -3
  8. package/browser/esm/BctMjTuii_LaWmHJ.mjs +119 -0
  9. package/browser/esm/{DiKCs9R7e4MgyayQ.mjs → Bf-pwjpYBKNwL4f8.mjs} +4 -4
  10. package/browser/esm/Bh7XfTPJIFjaL6fa.mjs +13 -0
  11. package/browser/esm/BjH_mK6445rm6PL1.mjs +94 -0
  12. package/browser/esm/BqJSEK805PP8lILC.mjs +197 -0
  13. package/browser/esm/BrIWEn7tabhEreBm.mjs +973 -0
  14. package/browser/esm/{BscaD3SzYM6ysjgy.mjs → BsFK55lPALVUu31_.mjs} +5 -5
  15. package/browser/esm/{BdkeyaHAtiNa6jqW.mjs → C0PinnqWu_JwK9l_.mjs} +33 -31
  16. package/browser/esm/C1KcphZVjVAE638t.mjs +415 -0
  17. package/browser/esm/{80XYmJwiiFLBmpH2.mjs → C3V7EwPHHPx9aEkE.mjs} +47 -48
  18. package/browser/esm/CCAPeyEqlStPrh6B.mjs +294 -0
  19. package/browser/esm/{BNYKPFICOYt2VRsP.mjs → CF2Az5oBVjAigMRt.mjs} +2 -2
  20. package/browser/esm/CIqEqDyl8JZRMblX.mjs +225 -0
  21. package/browser/esm/CJERhz_1u40JkHfH.mjs +235 -0
  22. package/browser/esm/CNtF9Fix0G6BEVEl.mjs +424 -0
  23. package/browser/esm/{a5G-3nVFn86pvt8H.mjs → CWP52da2iNOs3Qtz.mjs} +82 -94
  24. package/browser/esm/CWpF_0HjYiRiddX6.mjs +31 -0
  25. package/browser/esm/CbedwfwBLBaagGD-.mjs +360 -0
  26. package/browser/esm/{ffz9LGAgGiWQQav9.mjs → Cc9tcBSYzJIv-dZw.mjs} +156 -109
  27. package/browser/esm/CcPLziOAdWTbG7xx.mjs +141 -0
  28. package/browser/esm/CdRnGw_9tvkn9d9o.mjs +335 -0
  29. package/browser/esm/{BXQPMQyxdiYwawjE.mjs → CgLDSZ8XvBqAB-Y2.mjs} +20 -18
  30. package/browser/esm/CgZLR7ijzsUoawf8.mjs +1281 -0
  31. package/browser/esm/Cn6OsV-MbO0rIM-o.mjs +442 -0
  32. package/browser/esm/{CHLqCxo3afOV1Otw.mjs → CnDnNU6GGzM05K8w.mjs} +4 -4
  33. package/browser/esm/CnVHQ6i6a8VCMsn1.mjs +106 -0
  34. package/browser/esm/D06He-Tw4moPdM5f.mjs +103 -0
  35. package/browser/esm/D9lQwTAJ9RO60ovS.mjs +72 -0
  36. package/browser/esm/{Cykd-NaZAtHJlQmQ.mjs → D9xw1YuRJUjPMaqA.mjs} +2 -2
  37. package/browser/esm/DBr6lCvWLLwnzSGy.mjs +386 -0
  38. package/browser/esm/DEdHwT-2JZO9HyZN.mjs +14 -0
  39. package/browser/esm/DH4SdW-02-I8082_.mjs +14 -0
  40. package/browser/esm/DHbnrUh5rdi62fgO.mjs +516 -0
  41. package/browser/esm/DJRKcOT0Xv-1r0OP.mjs +161 -0
  42. package/browser/esm/DPycoTH_4RNdK2hu.mjs +252 -0
  43. package/browser/esm/{BIZX_0jxF9Fmaxuy.mjs → DXQTN_6-MvPivCrz.mjs} +8 -6
  44. package/browser/esm/DaNVYYZLCql8_n0i.mjs +831 -0
  45. package/browser/esm/Dakiv-oEU8ty2ILI.mjs +77 -0
  46. package/browser/esm/DfCd-MxLjE3gZ5jl.mjs +392 -0
  47. package/browser/esm/DhZqt49Ue-lveZv3.mjs +2692 -0
  48. package/browser/esm/DkxgFV6jJb6pO6lM.mjs +490 -0
  49. package/browser/esm/{DpdMtsE7oOAIJqFo.mjs → QKDgV7kur90Bzexo.mjs} +14 -13
  50. package/browser/esm/R8q92QTpUT-sB4Nq.mjs +8547 -0
  51. package/browser/esm/RaV_j7qhH97TUb6P.mjs +1550 -0
  52. package/browser/esm/S-MJsifSUY334In9.mjs +8 -0
  53. package/browser/esm/UW74C3TpyGhFEOFO.mjs +267 -0
  54. package/browser/esm/W-jkQJTDojDSK93k.mjs +242 -0
  55. package/browser/esm/czz-Du13p5saoAex.mjs +318 -0
  56. package/browser/esm/{CawSvjLj4-2Qqyef.mjs → ilgUW6eI60262DJU.mjs} +2 -2
  57. package/browser/esm/index.mjs +1910 -289
  58. package/browser/esm/kbx_7Y2kVGMGIWtW.mjs +633 -0
  59. package/browser/esm/vCWRBUPIH8HXlYjO.mjs +94 -0
  60. package/browser/esm/w0DasqEtSJvoQVk2.mjs +517 -0
  61. package/browser/esm/w5dY32V2IxkbDBsT.mjs +225 -0
  62. package/licenses/dependencies.txt +106 -359
  63. package/node/esm/7GlVS1uyKRUAAjw9.mjs +1831 -0
  64. package/node/esm/B0mjDApnDOWo9UGr.mjs +412 -0
  65. package/node/esm/B19kx8jtLWU7WYCa.mjs +142 -0
  66. package/node/esm/BAFf7hg6qgFyQDW8.mjs +73 -0
  67. package/node/esm/BDdBcx7cNTM1hIXu.mjs +972 -0
  68. package/node/esm/BGBolrjPvNncjS1h.mjs +94 -0
  69. package/node/esm/BI3dFg_vx1Vgxgps.mjs +516 -0
  70. package/node/esm/BO19LMEPFqVsK1xu.mjs +267 -0
  71. package/node/esm/{b05_u9WnJaVGO0nq.mjs → BSrtVTtNqcTg8QKK.mjs} +2 -2
  72. package/node/esm/BcLccq7CvZiJXCDZ.mjs +319 -0
  73. package/node/esm/BeZ1ZY1UJepW8u1f.mjs +118 -0
  74. package/node/esm/BkLwJxkD4pyrume5.mjs +425 -0
  75. package/node/esm/{CTtj1NR0IrcN8PTy.mjs → Bl_AT6xOKzBqc3PT.mjs} +10 -10
  76. package/node/esm/{Defb5qpSal98J5ay.mjs → Bqah1dCUEhmRmY3c.mjs} +2 -2
  77. package/node/esm/Bv5awmbwVUdl4rma.mjs +106 -0
  78. package/node/esm/C3mSFWiCu7iONlk6.mjs +638 -0
  79. package/node/esm/CAJhvJU0gj93fPWl.mjs +141 -0
  80. package/node/esm/CJobW3iRAQ5vHeQr.mjs +14 -0
  81. package/node/esm/{Dyd7va4aqC1jIzAk.mjs → CSJTM9SCqIDkHlpm.mjs} +21 -21
  82. package/node/esm/CUnv4ewRTvuP0si8.mjs +1276 -0
  83. package/node/esm/CWnezGEPuX9UeJ8E.mjs +385 -0
  84. package/node/esm/{BHuZQ-LJ2GgDLYSz.mjs → CarjiReyjevcMdlI.mjs} +190 -141
  85. package/node/esm/CoG2fq6dYCvhC5yu.mjs +224 -0
  86. package/node/esm/Cpegk2BA6FOrOkZ0.mjs +77 -0
  87. package/node/esm/Cq1V2i0dRTWnoU1K.mjs +94 -0
  88. package/node/esm/{9k03YHFiw-wlUS8d.mjs → CyPtKWjud-Y-Pvq8.mjs} +2 -2
  89. package/node/esm/DEVN1ZPedFq8Bnui.mjs +197 -0
  90. package/node/esm/{BkoorcOtOEh_Y7ck.mjs → DFUPAGKlHT2-8dyC.mjs} +33 -31
  91. package/node/esm/DMxfzW-UQdMaV-Gx.mjs +975 -0
  92. package/node/esm/DWbMD1KaT8mlCUfO.mjs +519 -0
  93. package/node/esm/{DHHgNbakbpNnu0oW.mjs → DffuRwJI_5oVtzZb.mjs} +23 -23
  94. package/node/esm/Dg9rTwnydI2UVmGG.mjs +242 -0
  95. package/node/esm/{D4KDk-w7Khu7LrSi.mjs → DmQMejdH1-aYq99z.mjs} +70 -71
  96. package/node/esm/{BiHw3x2LPWT-kK8G.mjs → DvSoGqy_51YQZzYM.mjs} +84 -96
  97. package/node/esm/DzTvKGqU1I9m-_qd.mjs +391 -0
  98. package/node/esm/{CNkqJbFlITxBA0t4.mjs → PKRuDgaA8RrsqSNn.mjs} +29 -29
  99. package/node/esm/{C5g2gBoUk3-cn94h.mjs → POUGgaN5BmOnEPPl.mjs} +2 -2
  100. package/node/esm/WqxW6Up5_6oeJrSr.mjs +489 -0
  101. package/node/esm/ehyFZGpXZSmR7Q7-.mjs +294 -0
  102. package/node/esm/index.mjs +9717 -8954
  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,1831 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.0
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: MIT
6
+ */
7
+ import { AnomaliesPlugin as e, CommentsPlugin as t, DocumentTitle as o, ExternalLinksPlugin as r, FormatPlugin as n, FormulaField as a, InputField as i, NamedPlugin as s, ProtectionPlugin as l, SlicerPlugin as c, TablePlugin as d, WorkbookElement as p, createStudioThemeCSS as u, defaultRenderFormulaBar as m, defaultRenderPivotMenu as g, defaultRenderStatusBar as h, defaultRenderToolbar as f, defaultRenderWorkbookError as k, defaultRenderWorkbookLoading as b, registerStudioCommandCatalogs as y, registerStudioCommandGroups as w, t as x, tokensToMuiOptions as v, u as C } from "./index.mjs";
8
+ import { CommandRootProvider as D, DefaultTaskPaneRegistry as S, LogoNoPaddingIcon as T, PivotTablePane as E, SHAPE_ICON_PACK as W, TaskPaneArea as F, TaskPaneKey as P, TaskPaneProvider as A, ThemeRootStyles as I, ThemeStateDefaults as N, ThemeStateKey as R, WorkbookIO as j, WorkbookProvider as O, createEditable as M, registerMovablePane as $, useDocThemes as L, useModelSync as B, useReferenceModeStore as K, useResolvedWorkbook as _, useTaskPaneArea as z, useWorkbookEncrypted as H, useWorkbookName as V, useWorkbookSaveState as U } from "@sheetxl/react";
9
+ import { Command as G, DefaultCommandButtonRegistry as q, DefaultIconService as X, DynamicIcon as Y, LanguageStateKey as Z, NotifierType as J, ReactErrorBoundary as Q, ReactNotifierProvider as ee, ReactUtils as te, RenderSlot as oe, ScrollUtils as re, SplitPane as ne, ThemeStyle as ae, UncaughtErrorBoundary as ie, createBusyHandle as se, useCallbackRef as le, useFullscreen as ce, useImperativeElement as de, useKeyboardResize as pe, useLanguage as ue, useMeasure as me, useNotifier as ge, usePersistentState as he, useResolvedThemeMode as fe, useTranslator as ke } from "@sheetxl/utils-react";
10
+ import be, { Fragment as ye, forwardRef as we, isValidElement as xe, memo as ve, useCallback as Ce, useEffect as De, useMemo as Se, useRef as Te, useState as Ee } from "react";
11
+ import { AnimatedLoadingPanel as We, AnimatedTraversingEllipsisIcon as Fe, CommandGroup as Pe, ExhibitDivider as Ae, ExhibitFloatProvider as Ie, ExhibitMenuItem as Ne, ExhibitTooltip as Re, ModalProvider as je, SelectedIcon as Oe, SimpleTooltip as Me, StackTrace as $e, createExhibitTheme as Le, hideLoadingPanel as Be, lazyModal as Ke, lazyPanel as _e, showLoadingPanel as ze, useInputDialog as He, useLazyWindow as Ve, useModal as Ue, useOptionsDialog as Ge } from "@sheetxl/utils-mui";
12
+ import { Fragment as qe, jsx as Xe, jsxs as Ye } from "react/jsx-runtime";
13
+ import { Box as Ze, Card as Je, CardActions as Qe, Collapse as et, CssBaseline as tt, DialogTitle as ot, IconButton as rt, Paper as nt, SvgIcon as at, Tab as it, Tabs as st, ThemeProvider as lt, Typography as ct, alpha as dt, useMediaQuery as pt, useTheme as ut } from "@mui/material";
14
+ import { CommonUtils as mt, DOMUtils as gt, DefaultLanguagePackService as ht, ErrorUtils as ft, ExpectedError as kt, PartialError as bt, defineLazyModule as yt, formatMessage as wt, messageKey as xt, t as vt } from "@sheetxl/utils";
15
+ import Ct from "clsx";
16
+ import { mergeRefs as Dt, useMergeRefs as St } from "react-merge-refs";
17
+ import { SnackbarContent as Tt, SnackbarProvider as Et, useSnackbar as Wt } from "notistack";
18
+ var Ft = Object.defineProperty, Pt = (e, t) => {
19
+ let o = {};
20
+ for (var r in e) Ft(o, r, {
21
+ get: e[r],
22
+ enumerable: !0
23
+ });
24
+ return t || Ft(o, Symbol.toStringTag, { value: "Module" }), o;
25
+ }, At = _e(yt("studio:conditionalFormatDetailsTaskPane", () => import("./CUnv4ewRTvuP0si8.mjs"), { select: (e) => ({ default: e.ConditionalFormatDetailsTaskPane }) }).load), It = ["lines"], Nt = /^[A-Za-z_\\][\w.\\]*$/, Rt = /^\$?[A-Za-z]{1,3}\$?\d+$/, jt = (e) => {
26
+ const t = e?.getReferences() ?? null;
27
+ if (!e || !t || 1 !== t.getCount()) return null;
28
+ const o = e.getExpression().trim();
29
+ return Nt.test(o) && !Rt.test(o) ? o : t;
30
+ }, Ot = {
31
+ card: "_card_h0jnt_7",
32
+ actionRoot: "_actionRoot_h0jnt_11",
33
+ icons: "_icons_h0jnt_16",
34
+ expand: "_expand_h0jnt_22",
35
+ expandOpen: "_expandOpen_h0jnt_29",
36
+ stackTraceContainer: "_stackTraceContainer_h0jnt_33",
37
+ paper: "_paper_h0jnt_37",
38
+ checkIcon: "_checkIcon_h0jnt_42",
39
+ button: "_button_h0jnt_47"
40
+ }, Mt = ve(we((e, t) => {
41
+ const { id: o, message: r, iconVariant: n, error: a, hideIconVariant: i, ...s } = e, l = ke(), { closeSnackbar: c } = Wt(), [d, p] = Ee(!1), u = a ? ft.collectErrorChain(a, !0)?.[0]?.error : void 0, m = u && !(u instanceof kt), g = Ce(() => {
42
+ p((e) => !e);
43
+ }, []), h = Ce(() => {
44
+ c(o);
45
+ }, [o, c]);
46
+ let f = u?.message;
47
+ return !f && xe(r) && (f = r), f || "string" != typeof r || (f = r), f || (f = `Unknown Error: ${r}`), Xe(Tt, {
48
+ ref: t,
49
+ className: Ct(Ot.root, "error-snackbar"),
50
+ children: Ye(Je, {
51
+ className: Ot.card,
52
+ style: {
53
+ backgroundColor: "var(--sxl-color-error)",
54
+ color: "var(--sxl-color-error-content)",
55
+ border: "1px solid var(--sxl-color-error)"
56
+ },
57
+ children: [Ye(Qe, {
58
+ className: Ot.actionRoot,
59
+ children: [
60
+ i ? null : n?.error,
61
+ Xe(ct, {
62
+ variant: "body2",
63
+ component: "div",
64
+ className: Ot.typography,
65
+ children: f
66
+ }),
67
+ Xe("div", { style: { flex: "1 1 auto" } }),
68
+ Ye("div", {
69
+ className: Ot.icons,
70
+ children: [m ? Xe(rt, {
71
+ "aria-label": l("toast.showMore"),
72
+ size: "small",
73
+ className: Ct(Ot.expand, { [Ot.expandOpen]: d }),
74
+ onClick: g,
75
+ children: Xe(Y, { iconKey: "ExpandMore" })
76
+ }) : null, Xe(rt, {
77
+ size: "small",
78
+ className: Ot.expand,
79
+ onClick: h,
80
+ children: Xe(Y, {
81
+ iconKey: "Close",
82
+ style: { transform: "scale(0.8)" }
83
+ })
84
+ })]
85
+ })
86
+ ]
87
+ }), m ? Xe(et, {
88
+ in: d,
89
+ timeout: "auto",
90
+ children: Xe("div", {
91
+ className: Ot.stackTraceContainer,
92
+ style: {
93
+ backgroundColor: "color-mix(in srgb, var(--sxl-color-error) 90%, var(--sxl-color-base-100))",
94
+ borderTop: "1px solid var(--sxl-color-error)"
95
+ },
96
+ children: Xe($e, {
97
+ error: a,
98
+ hideLineNumbers: !0
99
+ })
100
+ })
101
+ }) : null]
102
+ })
103
+ });
104
+ }));
105
+ Mt.displayName = "ToastError";
106
+ var $t = () => {
107
+ const e = ke();
108
+ return Xe(Re, {
109
+ label: "SheetXL",
110
+ description: e("logo.description"),
111
+ children: Xe(Ze, {
112
+ component: "a",
113
+ href: "https://www.sheetxl.com",
114
+ target: "_blank",
115
+ rel: "noopener noreferrer",
116
+ sx: {
117
+ display: "inline-flex",
118
+ width: "24px",
119
+ height: "24px",
120
+ marginBottom: "4px",
121
+ marginLeft: "6px",
122
+ cursor: "pointer"
123
+ },
124
+ children: Xe(T, { style: {
125
+ width: "24px",
126
+ height: "24px"
127
+ } })
128
+ })
129
+ });
130
+ }, Lt = Xe($t, {}), Bt = ve(we((e, t) => {
131
+ const { workbook: o, className: r, logo: n = Lt, mainElement: a, startElement: i, endElement: s, ...l } = e, [c, { width: d }] = me(), p = d < 530, u = Te(null), m = St([
132
+ u,
133
+ c,
134
+ t
135
+ ]);
136
+ return Xe(Ze, {
137
+ ...l,
138
+ ref: m,
139
+ className: r,
140
+ children: f({
141
+ isCompact: p,
142
+ wrapperSelect: (e) => Ye(Ze, {
143
+ sx: {
144
+ display: "grid",
145
+ gridTemplateColumns: "1fr auto 1fr",
146
+ flex: "1",
147
+ alignItems: "stretch",
148
+ gap: (e) => e.spacing(1),
149
+ paddingLeft: (e) => e.spacing(1),
150
+ paddingRight: (e) => e.spacing(1)
151
+ },
152
+ children: [
153
+ Ye(Ze, {
154
+ sx: {
155
+ display: "flex",
156
+ flexDirection: "row",
157
+ alignItems: "center",
158
+ justifyContent: "start",
159
+ gap: (e) => e.spacing(.5)
160
+ },
161
+ children: [n, Ye(Ze, {
162
+ sx: {
163
+ display: "flex",
164
+ flexDirection: "row",
165
+ alignItems: "center",
166
+ gap: (e) => e.spacing(.25)
167
+ },
168
+ children: [i, e]
169
+ })]
170
+ }),
171
+ Xe(Ze, {
172
+ sx: {
173
+ display: "flex",
174
+ flexDirection: "row",
175
+ minWidth: 0,
176
+ overflow: "hidden",
177
+ alignItems: "center",
178
+ justifyContent: "center"
179
+ },
180
+ children: a
181
+ }),
182
+ Xe(Ze, {
183
+ sx: {
184
+ display: "flex",
185
+ alignItems: "center",
186
+ justifyContent: "end"
187
+ },
188
+ children: s
189
+ })
190
+ ]
191
+ })
192
+ })
193
+ });
194
+ }));
195
+ Bt.displayName = "StudioToolbar";
196
+ var Kt = (e, t) => {
197
+ const o = new URL(window.location.pathname, window.location.origin);
198
+ e && o.searchParams.set("source", e), e && t && o.searchParams.set("title", t), window.open(o.toString(), "sheetxl-" + mt.uuidV4(), "popup=true");
199
+ };
200
+ function _t(e, t) {
201
+ const { workbook: o, setWorkbook: r, workbookTitle: n = "export", isDirty: a, notifier: i, refSave: s } = t;
202
+ let l = !1;
203
+ const c = async (e = null, t = null, o = null) => {
204
+ const r = [], n = {
205
+ source: e && "string" != typeof e ? e : null,
206
+ typedCreateWorkbookOptions: t ?? void 0,
207
+ onPassword: async ({ origin: e, validate: t }) => {
208
+ const o = await i.showInput({
209
+ title: vt("dialog.password.title"),
210
+ description: vt("dialog.password.open.description", { name: e.getName() ?? "" }),
211
+ inputType: "password",
212
+ options: [{
213
+ id: "Open",
214
+ label: () => vt("dialog.open")
215
+ }, "Cancel"],
216
+ defaultOption: "Open",
217
+ onValidateInput: async (e, o) => void 0 === o ? { valid: !0 } : e ? await t(e) ? { valid: !0 } : {
218
+ valid: !1,
219
+ message: vt("dialog.password.open.retry")
220
+ } : {
221
+ valid: !1,
222
+ message: vt("dialog.password.open.required")
223
+ }
224
+ });
225
+ return "Open" === o?.option ? o.input ?? null : null;
226
+ },
227
+ progress: { onWarning: (e) => {
228
+ r.push(e);
229
+ } }
230
+ };
231
+ let a;
232
+ o && (n.progress.onStart = o);
233
+ let s = -5;
234
+ return j.read({
235
+ ...n,
236
+ progress: {
237
+ async onStart(e, t) {
238
+ await n?.progress?.onStart?.(e, t), a = await i?.showBusy?.(vt("workbook.opening", { name: e?.getName() ?? "" })), t && a?.setProgress?.(0, t);
239
+ },
240
+ onProgress(e, t) {
241
+ if (!t) return;
242
+ const o = Math.min(100, Math.round(e / t * 100));
243
+ if (o >= 100) {
244
+ if (100 === s) return;
245
+ s = 100, a?.setProgress?.(e, t);
246
+ return;
247
+ }
248
+ o - s < 5 || (s = o, a?.setProgress?.(e, t));
249
+ },
250
+ onComplete() {
251
+ a?.(), r.length > 0 && (i.showMessage(vt("workbook.importWarnings")), console.warn("Import warnings:\n" + r.join("\n")));
252
+ },
253
+ onWarning(e, t) {
254
+ n?.progress?.onWarning?.(e, t);
255
+ }
256
+ }
257
+ });
258
+ }, d = async (e, t, o = !1, r) => {
259
+ let a;
260
+ const s = {
261
+ format: t?.key,
262
+ progress: {
263
+ async onStart(e) {
264
+ a = await i?.showBusy?.(vt("workbook.saving", { name: e?.getName() ?? "" }));
265
+ },
266
+ onComplete() {
267
+ a?.();
268
+ }
269
+ },
270
+ onWarnings: r ?? (async ({ warnings: e, origin: t, canCancel: o }) => {
271
+ a?.(), console.warn(`Not written to '${t.getName()}':\n${e.map((e) => ` ${e.message}`).join("\n")}`);
272
+ const r = vt("dialog.writeWarnings.title"), n = t.getFormat(), s = (n ? (await j.getWriteFormats({ search: n }))[0] : void 0)?.description ?? n ?? "", l = vt("dialog.writeWarnings.keep");
273
+ return o ? "Save" === await i.showOptions({
274
+ title: r,
275
+ type: J.Warning,
276
+ description: `${vt("dialog.writeWarnings.confirm", { format: s })}\n\n${l}`,
277
+ options: [{
278
+ id: "Save",
279
+ label: () => vt("dialog.save")
280
+ }, "Cancel"],
281
+ defaultOption: "Cancel"
282
+ }) && (a = await i?.showBusy?.(vt("workbook.saving", { name: t?.getName() ?? "" })), !0) : (i.showOptions({
283
+ title: r,
284
+ type: J.Warning,
285
+ description: `${vt("dialog.writeWarnings.saved", { format: s })}\n\n${l}`,
286
+ options: ["Ok"]
287
+ }), !0);
288
+ })
289
+ };
290
+ let l;
291
+ if (o) {
292
+ const o = e.getOrigin(), r = t?.exts?.[0] ?? (o.getExtension() || "sxl"), a = `${n || o.getName() || vt("workbook.defaultName")}.${r}`;
293
+ l = await j.writeAs(e, a, {
294
+ ...s,
295
+ prompt: !0
296
+ });
297
+ } else l = await j.write(e, void 0, s);
298
+ return l;
299
+ };
300
+ let p = null;
301
+ return e.updateCommand("newWorkbook", { callback: async (e) => {
302
+ const t = j.canRead() && !a();
303
+ e?.source ? t && p ? await p({
304
+ url: e.source,
305
+ title: e.title
306
+ }) : Kt(e.source, e.title) : t ? r({}) : Kt();
307
+ } }), e.updateCommand("closeWorkbook", { callback: async () => {
308
+ a() && "Close" !== await i.showOptions({
309
+ title: vt("dialog.confirm.title"),
310
+ description: vt("dialog.unsavedChanges"),
311
+ options: [{
312
+ id: "Close",
313
+ label: () => vt("dialog.close")
314
+ }, "Cancel"],
315
+ defaultOption: "Cancel"
316
+ }) || window.close();
317
+ } }), (async () => {
318
+ const t = await j.getWriteFormats();
319
+ if (l) return;
320
+ const n = j.canWrite(), u = j.canRead();
321
+ if (n) {
322
+ const r = (e) => {
323
+ const r = e ? t.find((t) => t.key === e) : void 0;
324
+ d(o, r, !0).catch((e) => i.showError(e));
325
+ };
326
+ e.updateCommand("saveWorkbook", { callback: () => {
327
+ d(o, void 0, !1).catch((e) => i.showError(e));
328
+ } }), s && (s.current = (e) => d(o, void 0, !1, e?.onWarnings)), e.updateCommand("saveWorkbookAs", { callback: (e) => {
329
+ r(e);
330
+ } });
331
+ for (const o of t) {
332
+ const t = o.key;
333
+ e.updateCommand(`saveWorkbookAs${t}`, {
334
+ label: () => vt("command.saveAsFormat.label", { format: o.description }),
335
+ groupLabels: {
336
+ workbook: () => vt("command.saveAsFormat.workbook", { format: o.description }),
337
+ saveWorkbookOptions: () => vt("command.saveAsFormat.compact", { format: o.description })
338
+ },
339
+ tags: o.tags,
340
+ description: () => vt("command.saveAsFormat", { format: o.description }),
341
+ icon: "CSV" === t ? "FileDownloadAsCSV" : "Excel" === t ? "FileDownloadAsExcel" : "FileDownloadAsSheet",
342
+ callback: () => {
343
+ r(t);
344
+ }
345
+ });
346
+ }
347
+ }
348
+ const m = async (e = null) => {
349
+ const t = { csv: {
350
+ date1904: o.getRuntime().isDate1904(),
351
+ ...o.options
352
+ } };
353
+ try {
354
+ let r = "";
355
+ const n = async (e) => {
356
+ r = e?.getName() ?? "";
357
+ }, a = await c(e, t, n);
358
+ if (!a) return;
359
+ const i = a.getWorksheets().getItems();
360
+ await o.doBatch(async () => {
361
+ for (let e = 0; e < i.length; e++) {
362
+ const t = i[e], n = 1 === i.length ? r : t.getName(), a = o.findValidSheetName(n);
363
+ await o.getWorksheets().add({
364
+ name: a,
365
+ autoSelect: e === i.length - 1
366
+ }).getEntireRange().copyFrom(t.getEntireRange());
367
+ }
368
+ }, xt("op.importData")), a.close();
369
+ } catch (e) {
370
+ i.showError(e);
371
+ }
372
+ };
373
+ if (e.updateCommand("insertDataFromFile", {
374
+ tags: ["noTransaction", "noRepeat"],
375
+ callback: async (e = null) => {
376
+ let t = e;
377
+ if (t || j.canRead() || (t = await (async () => {
378
+ const e = await j.getReadFormats(), t = [...new Set(e.flatMap((e) => e.exts))].map((e) => `.${e}`);
379
+ return gt.openFileDialog(t.length ? t.join(",") : "*.*");
380
+ })(), t)) return m(t);
381
+ }
382
+ }), e.updateCommand("insertDataFromURL", {
383
+ tags: ["noTransaction", "noRepeat"],
384
+ callback: async (e) => {
385
+ if (!e) {
386
+ const t = await i.showInput({
387
+ title: vt("dialog.importFromWeb.title"),
388
+ description: vt("dialog.importFromWeb.description"),
389
+ inputLabel: vt("dialog.webAddress.inputLabel"),
390
+ initialValue: "https://www.sheetxl.com/docs/examples/loan-calculator.xlsx",
391
+ propsInput: { style: { minWidth: "440px" } },
392
+ options: [{
393
+ id: "Import",
394
+ label: () => vt("dialog.import")
395
+ }]
396
+ });
397
+ if ("Import" !== t.option) return;
398
+ e = t.input;
399
+ }
400
+ if (e) try {
401
+ const t = await fetch(e);
402
+ if (!t.ok) throw new Error(`Could not fetch '${e}' (${t.status} ${t.statusText}).`);
403
+ const o = await t.blob(), r = decodeURIComponent(e.split("/").pop()?.split("?")[0] || "") || "import.xlsx";
404
+ await m(new File([o], r, { type: o.type }));
405
+ } catch (e) {
406
+ i.showError(e);
407
+ }
408
+ }
409
+ }), u) {
410
+ const t = async () => !a() || "Open" === await i.showOptions({
411
+ title: vt("dialog.confirm.title"),
412
+ description: vt("dialog.unsavedChanges"),
413
+ options: [{
414
+ id: "Open",
415
+ label: () => vt("dialog.open")
416
+ }, "Cancel"],
417
+ defaultOption: "Cancel"
418
+ }), n = async (e = null) => {
419
+ const t = { csv: {
420
+ date1904: o.getRuntime().isDate1904(),
421
+ ...o.options
422
+ } };
423
+ try {
424
+ const o = await c(e, t);
425
+ if (!o) return;
426
+ r(o);
427
+ } catch (e) {
428
+ i.showError(e);
429
+ }
430
+ };
431
+ e.updateCommand("openWorkbook", { callback: async (e = null) => {
432
+ await t() && await n(e);
433
+ } }), p = async (e) => {
434
+ let o = "string" == typeof e ? e : e?.url;
435
+ const r = "string" == typeof e ? void 0 : e?.title;
436
+ if (!o) {
437
+ const e = await i.showInput({
438
+ title: vt("dialog.openFromWeb.title"),
439
+ description: vt("dialog.openFromWeb.description"),
440
+ inputLabel: vt("dialog.webAddress.inputLabel"),
441
+ initialValue: "https://www.sheetxl.com/docs/examples/loan-calculator.xlsx",
442
+ propsInput: { style: { minWidth: "440px" } },
443
+ options: [{
444
+ id: "Open",
445
+ label: () => vt("dialog.open")
446
+ }]
447
+ });
448
+ if ("Open" !== e.option) return;
449
+ o = e.input;
450
+ }
451
+ if (o && await t()) try {
452
+ const e = await fetch(o);
453
+ if (!e.ok) throw new Error(`Could not fetch '${o}' (${e.status} ${e.statusText}).`);
454
+ const t = await e.blob(), a = decodeURIComponent(o.split("/").pop()?.split("?")[0] || "") || "workbook.xlsx", i = a.match(/\.[^/.]+$/)?.[0] ?? "", s = r ? `${r}${i}` : a;
455
+ await n(new File([t], s, { type: t.type }));
456
+ } catch (e) {
457
+ i.showError(e);
458
+ }
459
+ }, e.updateCommand("openWorkbookFromUrl", { callback: p });
460
+ }
461
+ })(), () => {
462
+ l = !0, s && (s.current = null);
463
+ };
464
+ }
465
+ var zt = Ke(yt("studio:shortcutKeysDialog", () => import("./CarjiReyjevcMdlI.mjs")).load);
466
+ y(), x();
467
+ var Ht = /* @__PURE__ */ new Set(["ui"]), Vt = (e) => {
468
+ const t = (e) => {
469
+ if ("function" != typeof e) return e;
470
+ try {
471
+ return e();
472
+ } catch {
473
+ return;
474
+ }
475
+ }, o = (e, o) => {
476
+ const r = t(e);
477
+ return "string" == typeof r ? wt(r, o, ht.getActive()) : void 0;
478
+ }, r = [];
479
+ for (const n of e.names()) if (!Ht.has(n)) for (const a of e.keys(n)) {
480
+ const i = e.resolveDefinition(n, a);
481
+ r.push({
482
+ groupKey: n,
483
+ command: {
484
+ getLabel: () => o(i?.label, i?.params) ?? a,
485
+ getIcon: () => t(i?.icon),
486
+ getDescription: () => o(i?.description, i?.params) ?? "",
487
+ getShortcut: () => t(i?.shortcut) ?? null,
488
+ getScope: () => n,
489
+ getScopeLabel: () => G.DefaultCommandCatalogService.getScopeLabel(n)
490
+ }
491
+ });
492
+ }
493
+ return { getAllCommands: () => r };
494
+ }, Ut = (e) => {
495
+ const { children: t, workbook: o, setWorkbook: r, workbookTitle: n, isDirty: a, refSave: i, fullscreenTarget: s } = e, l = G.useCommandScope(), c = ge(), { showModal: d } = Ue(), p = ke(), u = Te(a);
496
+ u.current = a;
497
+ const m = le(() => {
498
+ const e = l?.getRoot().getRegistry();
499
+ if (!e) return;
500
+ const t = d(zt, {
501
+ title: p("dialog.shortcutKeys.title"),
502
+ commands: Vt(e),
503
+ onDone: () => t.hide(),
504
+ onLoadError: (e) => {
505
+ t.destroy(), c.showError(e);
506
+ }
507
+ });
508
+ }, [l, d]);
509
+ De(() => {
510
+ if (!l) return;
511
+ const e = l.getRoot().contribution();
512
+ return function(e, t) {
513
+ const o = () => t.showShortcuts();
514
+ e.updateCommand("showKeyboardShortcuts", { callback: o }), e.updateCommand("help", { callback: o });
515
+ for (const [t, o] of Object.entries({
516
+ gotoUrlGithub: "https://github.com/sheetxl/sheetxl",
517
+ gotoUrlDiscord: "https://discord.gg/NTKdwUgK9p",
518
+ gotoUrlDocumentation: "https://www.sheetxl.com/docs",
519
+ gotoUrlIssue: "https://github.com/sheetxl/sheetxl/issues"
520
+ })) e.updateCommand(t, { callback: () => {
521
+ window?.open(o);
522
+ } });
523
+ }(e, { showShortcuts: m }), () => e.remove();
524
+ }, [l, m]);
525
+ const g = pt("(prefers-color-scheme: dark)"), { themeMode: h } = fe(), [f, k] = he(R.Mode, N[R.Mode]), [b, y] = he(R.DarkGrid, N[R.DarkGrid]), [w, x] = he(R.DarkImages, N[R.DarkImages]);
526
+ De(() => {
527
+ if (!l) return;
528
+ const e = l.getRoot().contribution();
529
+ return function(e, t) {
530
+ e.updateCommand("themeMode", {
531
+ state: t.mode ?? null,
532
+ params: { dark: t.isDark },
533
+ icon: t.isDark ? "DarkMode" : "LightMode",
534
+ callback: () => t.setMode(t.isDark ? "light" : "dark")
535
+ }), e.updateCommand("defaultThemeMode", {
536
+ state: !t.mode,
537
+ icon: t.systemDefaultDark ? "SystemDefaultDarkMode" : "SystemDefaultLightMode",
538
+ callback: () => t.setMode(null)
539
+ }), e.updateCommand("enableDarkGrid", {
540
+ state: t.enableDarkGrid,
541
+ callback: () => t.setEnableDarkGrid((e) => !e)
542
+ }), e.updateCommand("enableDarkImages", {
543
+ state: t.enableDarkImages,
544
+ callback: () => t.setEnableDarkImages((e) => !e)
545
+ });
546
+ }(e, {
547
+ mode: f,
548
+ setMode: k,
549
+ isDark: "dark" === f || !f && "dark" === h,
550
+ systemDefaultDark: g,
551
+ enableDarkGrid: b,
552
+ setEnableDarkGrid: y,
553
+ enableDarkImages: w,
554
+ setEnableDarkImages: x
555
+ }), () => e.remove();
556
+ }, [
557
+ l,
558
+ f,
559
+ h,
560
+ g,
561
+ b,
562
+ w,
563
+ k,
564
+ y,
565
+ x
566
+ ]);
567
+ const [v, C] = he(Z.Active, null), [D, S] = Ee(() => ht.getActive());
568
+ De(() => ht.addChangeListener(S), []), De(() => {
569
+ v && v !== ht.getActive() && ht.setActive(v);
570
+ }, [v]), De(() => {
571
+ if (!l) return;
572
+ const e = l.getRoot().contribution();
573
+ return function(e, t) {
574
+ e.updateCommand("language", {
575
+ state: t.active,
576
+ callback: (e) => {
577
+ e && t.setActive(e);
578
+ }
579
+ });
580
+ }(e, {
581
+ active: D,
582
+ setActive: (e) => {
583
+ C(e);
584
+ }
585
+ }), () => e.remove();
586
+ }, [
587
+ l,
588
+ D,
589
+ C
590
+ ]);
591
+ const T = Se(() => ({ current: s ?? null }), [s]), { isFullscreenAvailable: E, isFullscreenEnabled: W, toggleFullscreen: F } = ce({ target: T });
592
+ De(() => {
593
+ if (!l) return;
594
+ const e = l.getRoot().contribution();
595
+ return function(e, t) {
596
+ e.updateCommand("fullScreenToggle", {
597
+ state: t.isFullscreenEnabled,
598
+ disabledReasons: t.isFullscreenAvailable ? [] : [xt("reason.fullscreenUnavailable")],
599
+ icon: t.isFullscreenEnabled ? "FullScreenOff" : "FullScreen",
600
+ callback: () => {
601
+ t.toggleFullscreen();
602
+ }
603
+ });
604
+ }(e, {
605
+ isFullscreenAvailable: E,
606
+ isFullscreenEnabled: W,
607
+ toggleFullscreen: F
608
+ }), () => e.remove();
609
+ }, [
610
+ l,
611
+ E,
612
+ W,
613
+ F
614
+ ]);
615
+ const A = z(!0);
616
+ return De(() => {
617
+ if (!l) return;
618
+ const e = l.getRoot().contribution();
619
+ return function(e, t) {
620
+ e.updateCommand("protectWorkbook", {
621
+ tags: ["noTransaction", "noRepeat"],
622
+ callback: () => {
623
+ t(P.Protection, { args: { tab: "workbook" } });
624
+ }
625
+ });
626
+ }(e, (e, t) => A.activate(e, t)), () => e.remove();
627
+ }, [l, A]), De(() => {
628
+ if (!l || !o) return;
629
+ const e = l.getRoot().contribution(), t = _t(e, {
630
+ workbook: o,
631
+ setWorkbook: r,
632
+ workbookTitle: n ?? void 0,
633
+ isDirty: () => u.current?.() ?? !1,
634
+ notifier: c,
635
+ refSave: i
636
+ });
637
+ return () => {
638
+ t(), e.remove();
639
+ };
640
+ }, [
641
+ l,
642
+ o,
643
+ r,
644
+ n,
645
+ c,
646
+ i
647
+ ]), t;
648
+ };
649
+ Ut.displayName = "StudioCommandProvider";
650
+ var Gt = ({ renderWorkbook: e }) => {
651
+ const t = G.useCommandResolver(), o = Te(null), r = ke(), [n, a] = Ee(null), i = Ce((e) => {
652
+ const o = e.dataTransfer;
653
+ if (t && o) {
654
+ if ("dragenter" === e.type || "dragover" === e.type) {
655
+ const e = o.types, t = o.items;
656
+ let r = !1;
657
+ for (let e = 0; e < t.length; e++) if (t[e].type.startsWith("image/")) {
658
+ r = !0;
659
+ break;
660
+ }
661
+ r ? a("insertImage") : e.includes("Files") && t.length > 0 ? a("open") : (o.effectAllowed = "none", o.dropEffect = "none");
662
+ } else if ("dragleave" === e.type) {
663
+ const t = e.relatedTarget;
664
+ t && e.currentTarget.contains(t) || a(null);
665
+ }
666
+ e.preventDefault();
667
+ }
668
+ }, [t]), s = le((e) => {
669
+ e.preventDefault();
670
+ const r = n;
671
+ if (a(null), r && t && (e.stopPropagation(), e.dataTransfer.files && e.dataTransfer.files.length > 0)) {
672
+ const r = e.dataTransfer.files[0];
673
+ if (!r) return;
674
+ if (r?.type?.startsWith("image/")) {
675
+ const n = o.current?.getSheetElement()?.getGridSurface().getPaneFromClient(e.clientX, e.clientY);
676
+ if (!n) return;
677
+ const a = n.getPanePointFromPointer(e.clientX, e.clientY);
678
+ if (!a) return;
679
+ const i = n.toAbsoluteBounds({
680
+ x: a.x ?? 0,
681
+ y: a.y ?? 0,
682
+ width: 0,
683
+ height: 0
684
+ });
685
+ t.execute("insertImageFromFile", {
686
+ file: r,
687
+ options: { bounds: {
688
+ x: i.x,
689
+ y: i.y
690
+ } }
691
+ });
692
+ } else {
693
+ if (!j.canRead()) return;
694
+ const o = e.dataTransfer.items?.[0], n = "undefined" != typeof window && window.isSecureContext ? o?.getAsFileSystemHandle?.() : void 0;
695
+ n ? n.then((e) => t.execute("openWorkbook", "file" === e?.kind ? e : r)).catch(() => t.execute("openWorkbook", r)) : t.execute("openWorkbook", r);
696
+ }
697
+ }
698
+ }, [t, n]), l = Se(() => {
699
+ if (!n) return null;
700
+ const e = "insertImage" === n;
701
+ return Xe(Ze, {
702
+ className: "drop-overlay",
703
+ sx: {
704
+ position: "absolute",
705
+ inset: 0,
706
+ zIndex: 1,
707
+ boxSizing: "border-box",
708
+ pointerEvents: "none",
709
+ display: "flex",
710
+ justifyContent: "center",
711
+ alignItems: "center",
712
+ backgroundColor: (e) => dt(e.palette.primary.main, .46),
713
+ outline: (e) => `2px dashed ${e.palette.primary.main}`,
714
+ outlineOffset: "-6px",
715
+ borderRadius: 2
716
+ },
717
+ children: Ye(nt, {
718
+ elevation: 6,
719
+ sx: {
720
+ display: "flex",
721
+ alignItems: "center",
722
+ gap: 1.5,
723
+ px: 3,
724
+ py: 2,
725
+ borderRadius: 2,
726
+ color: "text.primary",
727
+ "& .drop-overlay-icon": { color: "primary.main" }
728
+ },
729
+ children: [Xe(Y, {
730
+ iconKey: e ? "InsertImage" : "FileOpen",
731
+ className: "drop-overlay-icon",
732
+ size: 32
733
+ }), Xe(ct, {
734
+ variant: "h6",
735
+ component: "span",
736
+ children: r(e ? "drop.insertImage" : "drop.open")
737
+ })]
738
+ })
739
+ });
740
+ }, [n, r]);
741
+ return Ye(qe, { children: [e({
742
+ ref: o,
743
+ onDragStart: (e) => {
744
+ if (e.target.src) {
745
+ const t = new Image();
746
+ t.src = e.target.src, e.dataTransfer.setDragImage(t, 1, 1);
747
+ }
748
+ },
749
+ onDragEnter: i,
750
+ onDragLeave: i,
751
+ onDragOver: i,
752
+ onDrop: s
753
+ }), l] });
754
+ }, qt = ve((e) => {
755
+ const { workbook: t, setWorkbook: o, refDocumentTitle: r, titleWorkbook: n, setWorkbookTitle: a, isDirty: i, initialCommandAnchor: s, renderWorkbook: l, refSave: c, host: d } = e;
756
+ return Xe(D, {
757
+ initialAnchor: s,
758
+ children: Xe(Ut, {
759
+ workbook: t,
760
+ setWorkbook: o,
761
+ workbookTitle: n,
762
+ isDirty: i,
763
+ refSave: c,
764
+ fullscreenTarget: d,
765
+ children: Xe(Gt, { renderWorkbook: l })
766
+ })
767
+ });
768
+ });
769
+ qt.displayName = "CommandsWrapper";
770
+ var Xt = {
771
+ sort: yt("studio:sortDialog", () => import("./PKRuDgaA8RrsqSNn.mjs")).load,
772
+ hyperlink: yt("studio:hyperlinkDialog", () => import("./Dg9rTwnydI2UVmGG.mjs")).load,
773
+ find: yt("studio:findReplaceWindow", () => import("./DmQMejdH1-aYq99z.mjs")).load,
774
+ tableNew: yt("studio:tableNewDialog", () => import("./DffuRwJI_5oVtzZb.mjs")).load,
775
+ pivotTableNew: yt("studio:pivotTableNewDialog", () => import("./BeZ1ZY1UJepW8u1f.mjs")).load,
776
+ sparklineNew: yt("studio:sparklineNewDialog", () => import("./Cq1V2i0dRTWnoU1K.mjs")).load,
777
+ sparklineEdit: yt("studio:sparklineEditDialog", () => import("./CJobW3iRAQ5vHeQr.mjs")).load,
778
+ namedDetails: yt("studio:namedReferenceDialog", () => import("./Bqah1dCUEhmRmY3c.mjs")).load,
779
+ insertFunction: yt("studio:insertFunctionDialog", () => import("./CSJTM9SCqIDkHlpm.mjs")).load,
780
+ resizeHeader: yt("studio:resizeHeaderDialog", () => import("./POUGgaN5BmOnEPPl.mjs")).load,
781
+ outlineSettings: yt("studio:outlineSettingsDialog", () => import("./BSrtVTtNqcTg8QKK.mjs")).load,
782
+ fillSeries: yt("studio:fillSeriesDialog", () => import("./CyPtKWjud-Y-Pvq8.mjs")).load,
783
+ workbookStatistics: yt("studio:workbookStatisticsDialog", () => import("./DFUPAGKlHT2-8dyC.mjs")).load,
784
+ password: yt("studio:passwordDialog", () => import("./BGBolrjPvNncjS1h.mjs")).load,
785
+ pivotValueSettings: yt("studio:pivotValueSettingsDialog", () => import("./ehyFZGpXZSmR7Q7-.mjs")).load
786
+ }, Yt = ["find"], Zt = ve((e) => {
787
+ const { children: t } = e, o = Wt(), r = o ? o.enqueueSnackbar : () => {}, n = o ? o.closeSnackbar : () => {}, a = Te(/* @__PURE__ */ new Set()), i = Te(null), s = Te(null), [l, c] = Ee({
788
+ label: null,
789
+ progress: null
790
+ }), d = ke(), p = mt.EmptyObject, u = Ve(p), m = Ge(p), g = He(p), h = Te(!1);
791
+ De(() => {
792
+ if (h.current) return;
793
+ h.current = !0;
794
+ const e = window, t = e.requestIdleCallback ?? ((e) => setTimeout(e, 500)), o = e.cancelIdleCallback ?? clearTimeout, r = t(() => {
795
+ for (const e of Yt) u(e, Xt[e], { prewarm: !0 }).catch(() => {});
796
+ });
797
+ return () => o(r);
798
+ }, []);
799
+ const f = Te(/* @__PURE__ */ new Set()), k = Se(() => {
800
+ const e = (e, t) => {
801
+ if (t?.onceKey) {
802
+ if (f.current.has(t.onceKey)) return;
803
+ const e = new Set(f.current);
804
+ e.add(t.onceKey), f.current = e;
805
+ }
806
+ const o = {
807
+ variant: t?.type ?? J.Info,
808
+ anchorOrigin: {
809
+ vertical: "top",
810
+ horizontal: "center"
811
+ },
812
+ preventDuplicate: t?.preventDuplicate,
813
+ persist: t?.persist ?? t?.type === J.Error,
814
+ action: (e) => Xe(rt, {
815
+ onClick: () => n(e),
816
+ children: Xe(Y, { iconKey: "Cancel" })
817
+ })
818
+ };
819
+ t?.enqueueProps && Object.assign(o, t.enqueueProps), e || console.log("message is 'null'", t), r(e ?? "Alert", o);
820
+ };
821
+ return {
822
+ showMessage: e,
823
+ showBusy: (e, t) => {
824
+ const o = Symbol("busy");
825
+ a.current.add(o), s.current = e, null != e && "string" != typeof e && c((t) => t.label === e ? t : {
826
+ ...t,
827
+ label: e
828
+ });
829
+ const r = se(() => {
830
+ a.current.delete(o) && (a.current.size > 0 || (Be(i.current), s.current = null, c((e) => null === e.label && null === e.progress ? e : {
831
+ label: null,
832
+ progress: null
833
+ })));
834
+ }, (e, t) => {
835
+ const o = t && t > 0 && null != e ? Math.max(0, Math.min(1, e / t)) : null;
836
+ c((e) => e.progress === o ? e : {
837
+ ...e,
838
+ progress: o
839
+ });
840
+ }, (e) => {
841
+ s.current = e, "string" == typeof e ? ze(i.current, e) : c((t) => ({
842
+ ...t,
843
+ label: e
844
+ }));
845
+ }), n = ze(i.current, "string" == typeof e ? e : void 0);
846
+ return n ? n.then(() => r) : r;
847
+ },
848
+ showWindow: (e, t) => {
849
+ const o = t;
850
+ return t = {
851
+ ...t,
852
+ onKeyDown: (e) => {
853
+ e.isDefaultPrevented() || e.isPropagationStopped() || o?.onKeyDown?.(e);
854
+ }
855
+ }, u(e, Xt[e], t);
856
+ },
857
+ showOptions: m,
858
+ showInput: g,
859
+ showError: (t) => {
860
+ let o, r = J.Error, n = d("error.unknown");
861
+ "string" == typeof t ? n = t : t instanceof Error && (o = t, t.message && (n = d(t.message))), t instanceof bt && (r = J.Info), e(n, {
862
+ type: r,
863
+ enqueueProps: { error: o }
864
+ });
865
+ }
866
+ };
867
+ }, [d]), b = Se(() => Xe(We, {
868
+ ref: i,
869
+ autoStart: !1,
870
+ icon: Xe(Fe, { sx: {
871
+ transform: "scale(0.7)",
872
+ marginLeft: "-6px"
873
+ } }),
874
+ panel: !0,
875
+ label: l.label ?? ("string" == typeof s.current ? s.current : void 0),
876
+ progress: l.progress,
877
+ sx: {
878
+ position: "absolute",
879
+ left: "0",
880
+ top: "0",
881
+ width: "100%",
882
+ height: "100%",
883
+ zIndex: "9999",
884
+ pointerEvents: "none"
885
+ }
886
+ }), [l.label, l.progress]);
887
+ return Ye(ee, {
888
+ notifier: k,
889
+ children: [b, t]
890
+ });
891
+ });
892
+ Zt.displayName = "StudioNotifierProvider";
893
+ var Jt = "var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))", Qt = ve(we((e, t) => {
894
+ const { children: o, title: r, taskPanes: n, onSelect: a, selected: i, registry: s = S, style: l, iconsOnly: c, side: d = "right", className: p, ...u } = e, m = "right" !== d, g = ue(), h = Se(() => n.map((t) => {
895
+ const o = s.getRegisteredTaskPane(t);
896
+ if (!o) return null;
897
+ let r = o.getIcon?.();
898
+ "string" == typeof r && (r = Xe(Y, { iconKey: r }));
899
+ const n = t === i, a = r ? Xe(Ze, {
900
+ sx: {
901
+ display: "inline-block",
902
+ transform: m ? "rotate(-90deg)" : "rotate(90deg)",
903
+ transformOrigin: "center",
904
+ color: (e) => e.palette.text.secondary
905
+ },
906
+ children: r
907
+ }) : null, l = !r || !c && n, d = Xe(Ze, {
908
+ sx: {
909
+ display: "grid",
910
+ gridTemplateColumns: l ? "1fr" : "0fr",
911
+ opacity: l ? 1 : 0,
912
+ transition: (e) => e.transitions.create(["grid-template-columns", "opacity"], { duration: e.transitions.duration.short })
913
+ },
914
+ children: Xe(Ze, {
915
+ sx: {
916
+ overflow: "hidden",
917
+ minWidth: 0,
918
+ minHeight: 0
919
+ },
920
+ children: Xe(ct, {
921
+ component: "div",
922
+ sx: {
923
+ textTransform: "none",
924
+ whiteSpace: "nowrap",
925
+ transform: m ? "rotate(180deg)" : void 0,
926
+ padding: "4px 0px",
927
+ color: (e) => n ? e.palette.primary.main : e.palette.text.secondary
928
+ },
929
+ children: o.getTitle()
930
+ })
931
+ })
932
+ });
933
+ return Xe(it, {
934
+ value: t,
935
+ label: Xe(Me, {
936
+ disableInteractive: !0,
937
+ title: o.getTitle() ?? "",
938
+ placement: "left-start",
939
+ children: Ye(Ze, {
940
+ sx: {
941
+ padding: "0px 0px",
942
+ writingMode: m ? "vertical-lr" : "vertical-rl",
943
+ textOrientation: "mixed",
944
+ display: "flex",
945
+ alignItems: "center",
946
+ justifyContent: "space-between",
947
+ minWidth: "0px",
948
+ color: (e) => e.palette.text.secondary
949
+ },
950
+ children: [m ? d : a, m ? a : d]
951
+ })
952
+ }),
953
+ sx: {
954
+ padding: "4px 4px",
955
+ minWidth: "0px",
956
+ minHeight: "0px",
957
+ borderRadius: "4px"
958
+ },
959
+ className: Ct("taskpane-strip-item", { "Mui-selected": n }),
960
+ onClick: () => e.onSelect(t)
961
+ }, t);
962
+ }), [
963
+ n,
964
+ i,
965
+ a,
966
+ s,
967
+ m,
968
+ c,
969
+ g
970
+ ]), f = de(t, () => ({ isTaskPaneStrip: () => !0 }), []), k = Se(() => Ct("taskpane-strip", p), [p]);
971
+ return Xe(Ze, {
972
+ ref: f,
973
+ className: k,
974
+ sx: {
975
+ paddingLeft: m ? void 0 : "2px",
976
+ paddingRight: m ? "2px" : void 0,
977
+ paddingTop: "4px",
978
+ ...l
979
+ },
980
+ ...u,
981
+ children: Xe(st, {
982
+ orientation: "vertical",
983
+ variant: "scrollable",
984
+ value: i,
985
+ onChange: (e, t) => {
986
+ a(t);
987
+ },
988
+ slotProps: {
989
+ list: { sx: { gap: "2px" } },
990
+ indicator: { sx: {
991
+ left: m ? void 0 : "0px",
992
+ right: m ? void 0 : "unset",
993
+ bottom: m ? "0px" : void 0
994
+ } }
995
+ },
996
+ children: h
997
+ })
998
+ });
999
+ })), eo = (e) => {
1000
+ const { title: t, icon: o, onClose: r, readOnly: n, focused: a, ...i } = e, s = Te(null), l = ke();
1001
+ return Xe(ot, {
1002
+ className: Ct({ "Mui-selected": a }),
1003
+ sx: {
1004
+ display: "flex",
1005
+ flex: "1 1 %0",
1006
+ color: (e) => e.palette.text.secondary,
1007
+ boxSizing: "border-box",
1008
+ padding: "0 0",
1009
+ transitionProperty: "opacity",
1010
+ transitionDuration: (e) => `${e.transitions.duration.shortest}ms`,
1011
+ opacity: .7,
1012
+ "&.Mui-selected": {
1013
+ opacity: 1,
1014
+ transitionDuration: (e) => e.transitions.duration.shortest / 2 + "ms"
1015
+ },
1016
+ backgroundColor: (e) => dt(e.palette.action.hover, .03),
1017
+ borderBottom: `solid ${Jt} 1px`
1018
+ },
1019
+ ...i,
1020
+ children: Ye(Ze, {
1021
+ sx: {
1022
+ display: "flex",
1023
+ flex: "1 1 10%",
1024
+ flexDirection: "row",
1025
+ alignItems: "center",
1026
+ marginTop: (e) => e.spacing(.25),
1027
+ marginBottom: (e) => e.spacing(.25),
1028
+ marginLeft: (e) => e.spacing(1),
1029
+ marginRight: (e) => e.spacing(1)
1030
+ },
1031
+ children: [Xe(Ze, {
1032
+ sx: {
1033
+ flex: "1 1 100%",
1034
+ paddingLeft: (e) => e.spacing(1)
1035
+ },
1036
+ children: t
1037
+ }), Xe(Re, {
1038
+ label: l("taskPane.close"),
1039
+ children: Xe(rt, {
1040
+ "aria-label": "close",
1041
+ sx: { color: (e) => e.palette.text.icon ?? e.palette.action.active },
1042
+ touchRippleRef: s,
1043
+ onPointerDown: (e) => {
1044
+ s.current?.start(e, { center: !1 }), e.stopPropagation(), e.preventDefault();
1045
+ },
1046
+ onPointerUp: () => {
1047
+ r();
1048
+ },
1049
+ children: Xe(Y, { iconKey: "Close" })
1050
+ })
1051
+ })]
1052
+ })
1053
+ });
1054
+ }, to = we((e, t) => {
1055
+ const { model: o, side: r, ...n } = e, a = ut(), i = `solid ${Jt} 1px`, s = `${a.shape.borderRadius ?? 4}px`, l = `${a.spacing?.(.5) ?? 4}px`;
1056
+ return Xe(F, {
1057
+ model: o,
1058
+ ref: t,
1059
+ propsFrame: { style: {
1060
+ border: i,
1061
+ borderRadius: s,
1062
+ marginBottom: l
1063
+ } },
1064
+ alwaysShowStrip: !0,
1065
+ componentTitle: eo,
1066
+ componentStrip: Qt,
1067
+ side: r,
1068
+ ...e,
1069
+ onOpen: () => {
1070
+ e?.onOpen?.();
1071
+ },
1072
+ onClose: () => {
1073
+ e?.onClose?.();
1074
+ },
1075
+ ...n
1076
+ });
1077
+ }), oo = "_styled-resizer_li52w_3", ro = {}, no = {
1078
+ flex: "1 1 100%",
1079
+ display: "flex",
1080
+ boxSizing: "border-box"
1081
+ }, ao = ve(we((e, t) => {
1082
+ const { mainElement: o, sidebarElement: r, position: n, persistKey: a, onPositionChange: i, className: s, style: l, taskSide: c = "right", ...d } = e, [p, u] = he(a ?? null, ro), m = ut(), [g, { width: h }] = me(), f = h > 530 || 0 === h, k = Te(null);
1083
+ let b, y, w = null, x = 4, v = 13;
1084
+ f ? w = "m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991" : (w = "M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991", x = 13, v = 4);
1085
+ let C, D = o, S = r;
1086
+ const T = "right" !== c, E = f ? "row" : "column", W = T && S ? "before" : "after", F = `${E}:${W}`, P = a ? p[F] : void 0, A = null != P ? `${P}%` : ((e, t) => {
1087
+ if (null == e) return "40%";
1088
+ if ("number" == typeof e || "string" == typeof e) return e;
1089
+ const o = e[t];
1090
+ return null != o ? `${o}%` : "40%";
1091
+ })(n, F), I = a || i ? (e) => {
1092
+ a && u((t) => ({
1093
+ ...t,
1094
+ [F]: e.percent
1095
+ })), i?.(e, {
1096
+ orientation: E,
1097
+ side: W,
1098
+ key: F
1099
+ });
1100
+ } : void 0;
1101
+ T && S ? (D = r, S = o, y = { style: {
1102
+ flexDirection: "column",
1103
+ boxSizing: "border-box",
1104
+ paddingRight: "2px"
1105
+ } }, b = {}, C = {
1106
+ fixedPane: "before",
1107
+ position: A,
1108
+ minBefore: f ? "280px" : "120px",
1109
+ splitDirection: f ? "row" : "column"
1110
+ }) : (b = { style: {
1111
+ flexDirection: "column",
1112
+ marginRight: r ? void 0 : "6px"
1113
+ } }, y = { style: {
1114
+ marginLeft: f ? "0px" : "4px",
1115
+ marginRight: f ? "8px" : "4px"
1116
+ } }, C = {
1117
+ fixedPane: "after",
1118
+ position: A,
1119
+ minAfter: f ? "280px" : "120px",
1120
+ splitDirection: f ? "row" : "column"
1121
+ });
1122
+ const N = St([
1123
+ k,
1124
+ g,
1125
+ t
1126
+ ]);
1127
+ return Xe(ne, {
1128
+ ref: N,
1129
+ className: s,
1130
+ style: l ? {
1131
+ ...no,
1132
+ ...l
1133
+ } : no,
1134
+ ...d,
1135
+ ...C,
1136
+ onPositionChange: I,
1137
+ propsResizer: {
1138
+ className: Ct("styled-resizer", oo),
1139
+ style: {
1140
+ minWidth: f ? "7px" : void 0,
1141
+ minHeight: f ? void 0 : "6px",
1142
+ maskImage: `url("data:image/svg+xml,%3Csvg width='${x}' height='${v}' viewBox='0 0 ${x} ${v}' version='1.1' fill='${m.palette.text.icon ?? m.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${w}' /%3E%3C/svg%3E%0A")`,
1143
+ maskRepeat: "no-repeat",
1144
+ maskPosition: T ? f ? "center center" : "bottom center" : f ? "left center" : "top center"
1145
+ }
1146
+ },
1147
+ elementBefore: D,
1148
+ propsPaneBefore: b,
1149
+ elementAfter: S,
1150
+ propsPaneAfter: y
1151
+ });
1152
+ }));
1153
+ ao.displayName = "StudioSplitPane";
1154
+ var io = () => Xe("div", { style: {
1155
+ flex: "none",
1156
+ height: 0,
1157
+ borderTop: "solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px"
1158
+ } }), so = (e, t) => {
1159
+ const o = (e) => Xe(be.Fragment, { children: t[e] }, e);
1160
+ if ("bottom" === e) {
1161
+ const e = t.statusBar && t.formulaBar ? Xe(io, {}, "divider") : null;
1162
+ return [
1163
+ o("toolbar"),
1164
+ o("main"),
1165
+ o("statusBar"),
1166
+ e,
1167
+ o("formulaBar")
1168
+ ];
1169
+ }
1170
+ return [
1171
+ o("toolbar"),
1172
+ o("formulaBar"),
1173
+ o("main"),
1174
+ o("statusBar")
1175
+ ];
1176
+ }, lo = (e) => {
1177
+ const { groups: t } = e;
1178
+ return Xe(Ze, {
1179
+ role: "menu",
1180
+ sx: {
1181
+ paddingTop: "4px",
1182
+ paddingBottom: "4px"
1183
+ },
1184
+ children: t.map((e, t) => Ye(ye, { children: [t > 0 ? Xe(Ae, { orientation: "horizontal" }) : null, e.map((e) => Xe(Ne, {
1185
+ role: void 0 === e.checked ? "menuitem" : "menuitemradio",
1186
+ "aria-checked": e.checked,
1187
+ disabled: e.disabled,
1188
+ selected: e.checked,
1189
+ icon: e.checked ? Xe(Oe, {}) : void 0,
1190
+ onClick: e.run,
1191
+ children: e.label
1192
+ }, e.key))] }, t))
1193
+ });
1194
+ }, co = (e) => Xe(lo, { ...e }), po = (e) => {
1195
+ const { pivot: t, name: o, source: r, onError: n } = e, s = ke(), l = t.getWorksheet(), c = l.getProtection().isLocked(), d = Se(() => ({ scope: l.getName() }), [l]), p = le((e, o) => {
1196
+ "accept" === o.reason && e !== t.getName() && t.setName(e).catch(n);
1197
+ }, [t, n]), u = le((e) => {
1198
+ if (0 === e.length || e.length > 255) throw new kt(s("error.pivotTable.nameInvalid"));
1199
+ const o = l.getPivotTables().getByName(e);
1200
+ if (o && o.getName() !== t.getName()) throw new kt(s("error.pivotTable.nameExists"));
1201
+ }, [
1202
+ l,
1203
+ t,
1204
+ s
1205
+ ]), m = le((e, o) => {
1206
+ if ("accept" !== o.reason) return;
1207
+ const r = jt(e);
1208
+ r && t.setSource("string" == typeof r ? r : r.at(0)).catch(n);
1209
+ }, [t, n]);
1210
+ return Ye(Ze, {
1211
+ className: "sxl-pivot-table-header",
1212
+ sx: {
1213
+ display: "flex",
1214
+ flexDirection: "column",
1215
+ rowGap: (e) => e.spacing(1),
1216
+ paddingTop: (e) => e.spacing(1)
1217
+ },
1218
+ children: [Xe(i, {
1219
+ formName: "name",
1220
+ value: o,
1221
+ changeOn: "done",
1222
+ onDone: p,
1223
+ onValidate: u,
1224
+ disabled: c
1225
+ }), Xe(a, {
1226
+ grammar: "reference",
1227
+ formName: "source",
1228
+ label: s("pivotTableNew.source"),
1229
+ value: r,
1230
+ allowMulti: !1,
1231
+ home: d,
1232
+ pickAs: "absolute",
1233
+ changeOn: "done",
1234
+ onDone: m,
1235
+ disabled: c || null === r
1236
+ })]
1237
+ });
1238
+ }, uo = (e) => Xe(po, { ...e }), mo = (e) => Xe(E, {
1239
+ renderMenu: co,
1240
+ renderFilter: g,
1241
+ renderHeader: uo,
1242
+ ...e
1243
+ }), go = _e(yt("studio:dataValidationDetailsTaskPane", () => import("./B0mjDApnDOWo9UGr.mjs"), { select: (e) => ({ default: e.DataValidationDetailsTaskPane }) }).load), ho = Pt({
1244
+ EagerStudio: () => yo,
1245
+ default: () => yo
1246
+ });
1247
+ d(), S.registerTaskPane({
1248
+ key: P.PivotTable,
1249
+ component: mo
1250
+ }, !0), (() => {
1251
+ q.register({
1252
+ key: "changeShapeGallery",
1253
+ contributions: { shapeToolbar: {
1254
+ order: -1,
1255
+ divider: "after"
1256
+ } },
1257
+ render: (e) => Xe(C, {
1258
+ ...e,
1259
+ commandKey: "changeShape",
1260
+ excludeCategories: It
1261
+ })
1262
+ }, !0);
1263
+ $("shape", () => import("./BAFf7hg6qgFyQDW8.mjs").then((e) => e.ShapeFormatPanel));
1264
+ })(), $("chart", () => import("./BI3dFg_vx1Vgxgps.mjs").then((e) => e.ChartFormatPanel)), (() => {
1265
+ const e = G.DefaultCommandButtonRegistry, t = [];
1266
+ t.push(e.register({
1267
+ key: "changePictureOptions",
1268
+ defaultKey: "changePictureFromFile",
1269
+ members: ["changePictureFromFile", "changePictureFromURL"],
1270
+ contributions: { pictureToolbar: { order: -3 } }
1271
+ }, !0)), t.push(e.register({
1272
+ key: "pictureHyperlinkOptions",
1273
+ defaultKey: "updatePictureHyperlink",
1274
+ members: [
1275
+ "updatePictureHyperlink",
1276
+ "openPictureHyperlink",
1277
+ "deletePictureHyperlink"
1278
+ ],
1279
+ contributions: { pictureToolbar: { order: -2 } }
1280
+ }, !0)), t.push(e.register({
1281
+ key: "cropAspectOptions",
1282
+ members: [
1283
+ "cropAspect1x1",
1284
+ "-",
1285
+ "cropAspect2x3",
1286
+ "cropAspect3x4",
1287
+ "cropAspect3x5",
1288
+ "cropAspect4x5",
1289
+ "-",
1290
+ "cropAspect3x2",
1291
+ "cropAspect4x3",
1292
+ "cropAspect5x3",
1293
+ "cropAspect5x4",
1294
+ "cropAspect16x9",
1295
+ "cropAspect16x10"
1296
+ ]
1297
+ }, !0)), t.push(e.register({
1298
+ key: "cropOptions",
1299
+ members: [
1300
+ {
1301
+ key: "cropToShapeGallery",
1302
+ render: (e) => Xe(C, {
1303
+ ...e,
1304
+ commandKey: "cropToShape",
1305
+ excludeCategories: It
1306
+ })
1307
+ },
1308
+ "cropAspectOptions",
1309
+ "-",
1310
+ "cropFill",
1311
+ "cropFit"
1312
+ ],
1313
+ contributions: { pictureToolbar: {
1314
+ order: -1,
1315
+ divider: "after"
1316
+ } }
1317
+ }, !0));
1318
+ })(), c(), S.registerTaskPane({
1319
+ key: P.DataValidation,
1320
+ component: go
1321
+ }, !0), S.registerTaskPane({
1322
+ key: P.ConditionalFormat,
1323
+ component: At
1324
+ }, !0), l(), s(), r(), t(), e(), n(), w();
1325
+ var fo = () => {
1326
+ let e, t;
1327
+ const o = new Promise((o, r) => {
1328
+ e = o, t = r;
1329
+ }), r = {
1330
+ promise: o,
1331
+ settled: !1,
1332
+ resolve: (t) => {
1333
+ r.settled = !0, e(t);
1334
+ },
1335
+ reject: (e) => {
1336
+ r.settled = !0, t(e);
1337
+ }
1338
+ };
1339
+ return o.catch(() => {}), r;
1340
+ }, ko = (e, t) => {
1341
+ if (!e) return {};
1342
+ const { colorSchemes: o, ...r } = e, n = o?.[t ? "dark" : "light"];
1343
+ return n && "object" == typeof n ? mt.deepMerge(r, n) : r;
1344
+ }, bo = "taskPanePosition", yo = ve(we((e, t) => {
1345
+ const { host: r, scopeClass: n, square: a, elevation: i, variant: s, onWorkbookLoad: l, onRenderSettled: c, prefetch: d, onDocumentError: g, renderDocumentError: f = k, propsDocumentError: y, propsTaskPaneArea: w, renderTaskPaneArea: x = wo, taskPaneSide: C = "right", onKeyDown: D, workbook: S, onWorkbookChange: T, logo: E, topLeft: F, topRight: P, muiTheme: $, tokens: z, cssBaseline: q, autoFocus: J = !1, title: ee, onDirtyChange: ne, propsDocumentTitle: se, renderDocumentLoading: ce = b, propsDocumentLoading: ue, propsWorkbook: me, showFormulaBar: ge, propsFormulaBar: ke, renderFormulaBar: be, formulaBarPlacement: ye, virtualKeyboard: we = "float", editable: xe, showStatusBar: ve, propsStatusBar: We, renderStatusBar: Fe, propsToolbar: Ae, renderToolbar: Ne } = e, Re = Te(null), Oe = Te(null), Me = Te(null), $e = le(() => {
1346
+ Me.current?.getNamedCollectionEditorElement?.()?.focus?.();
1347
+ }, []), Be = ((e, t = "undefined" == typeof window ? "mouse" : te.detectIt().primaryInput) => "top" === e || "bottom" === e ? e : "touch" === t ? "bottom" : "top")(ye), Ke = "bottom" === Be ? we : "none", { inset: _e, offsetTop: ze } = pe("resize" === Ke), He = le(g ?? (() => {}), [g]), Ve = le(ne ?? (() => {}), [ne]), Ue = se?.placeHolder, [Ge] = he(R.Mode, N[R.Mode]), { themeMode: qe } = fe({ mode: Ge ?? void 0 }), [Je] = he(Z.Active, null), Qe = Te(Je);
1348
+ Qe.current = Je;
1349
+ const et = Se(() => ({
1350
+ light: Le(!1, mt.deepMerge(ko($, !1), v(z?.light?.app))),
1351
+ dark: Le(!0, mt.deepMerge(ko($, !0), v(z?.dark?.app)))
1352
+ }), [$, z]), ot = "dark" === qe, rt = Se(() => u(et.light, et.dark, `.${n}`, z), [
1353
+ et,
1354
+ n,
1355
+ z
1356
+ ]), it = L(), [st, ct] = Ee(() => S ?? null);
1357
+ De(() => {
1358
+ ct(S ?? null);
1359
+ }, [S]);
1360
+ const [dt, pt] = Ee(0), ut = Te(null);
1361
+ ut.current || (ut.current = fo());
1362
+ const gt = _(st, {
1363
+ io: j,
1364
+ defaultTheme: it.getDefaultTheme(),
1365
+ reloadKey: dt
1366
+ }), ft = "loaded" === gt.status ? gt.workbook : null, kt = Se(() => "error" === gt.status ? {
1367
+ status: "error",
1368
+ error: gt.error
1369
+ } : "loaded" === gt.status ? {
1370
+ status: "loaded",
1371
+ workbook: gt.workbook
1372
+ } : { status: "loading" }, [gt]);
1373
+ De(() => {
1374
+ ut.current.settled && (ut.current = fo());
1375
+ }, [st, dt]), De(() => {
1376
+ if ("loaded" === kt.status) {
1377
+ const e = ut.current, t = kt.workbook;
1378
+ t.whenFontsReady().then(() => e.resolve(t), () => e.resolve(t));
1379
+ } else "error" === kt.status && (He?.(kt.error), ut.current.reject(kt.error));
1380
+ }, [kt]);
1381
+ const [bt, yt] = Ee(null);
1382
+ ft && !bt && yt(ft);
1383
+ const wt = ft && bt && ft !== bt ? ft : null, xt = Te(wt);
1384
+ xt.current = wt;
1385
+ const vt = Te(bt);
1386
+ vt.current = bt;
1387
+ const Ct = Te([]), St = Ce((e) => {
1388
+ const t = vt.current;
1389
+ t && Ct.current.push(t), ct(e);
1390
+ }, []);
1391
+ De(() => {
1392
+ const e = Ct.current;
1393
+ if (0 !== e.length) {
1394
+ Ct.current = e.filter((e) => e === bt);
1395
+ for (let t = 0; t < e.length; t++) {
1396
+ const o = e[t];
1397
+ if (o !== bt) try {
1398
+ o.close();
1399
+ } catch (e) {
1400
+ console.warn("Unable to close the replaced workbook", e);
1401
+ }
1402
+ }
1403
+ }
1404
+ }, [bt]);
1405
+ const Tt = xe ? null : bt, Wt = K(), Ft = Se(() => {
1406
+ const e = Tt?.getSelectedWorksheet() ?? Tt?.getWorksheets().getItems({ visibility: "veryHidden" })[0];
1407
+ return e ? M(e, { referenceMode: Wt }) : null;
1408
+ }, [Tt, Wt]), Pt = xe ?? Ft, At = Te(Pt);
1409
+ At.current = Pt, De(() => {
1410
+ if (!Pt) return;
1411
+ let e = Pt.getSession();
1412
+ return Pt.subscribe(() => {
1413
+ const t = e;
1414
+ if (e = Pt.getSession(), !t || e) return;
1415
+ if ("formula-bar" !== t.getActiveEditorId()) return;
1416
+ const o = Me.current;
1417
+ (o?.isFocusWithin?.() ?? o?.contains?.(document.activeElement)) && Re.current?.focus();
1418
+ });
1419
+ }, [Pt]);
1420
+ const It = V(bt), { isDirty: Nt, saveState: Rt } = U(bt, j), jt = H(bt), Ot = Te(Rt), $t = Te(null);
1421
+ Ot.current = Rt;
1422
+ const Lt = Ce(() => Ot.current?.isDirty() ?? !1, []), Kt = Te(kt);
1423
+ Kt.current = kt;
1424
+ const [_t, zt] = Ee(null), Ht = ee ?? se?.title, [Vt, Ut] = Ee(null);
1425
+ De(() => {
1426
+ Ut(null);
1427
+ }, [bt]);
1428
+ const Gt = Ht ?? Vt ?? It ?? "";
1429
+ De(() => {
1430
+ Ve?.(Nt);
1431
+ }, [Nt]);
1432
+ const Xt = le(T ?? (() => {}), [T]);
1433
+ De(() => {
1434
+ Xt?.(ft);
1435
+ }, [ft]);
1436
+ const Yt = Te(ft);
1437
+ Yt.current = ft, B(bt, "onViewChange");
1438
+ const Jt = Se(() => Xe(Pe, {
1439
+ groupKey: "helpOptions",
1440
+ disableHover: !0,
1441
+ sx: { padding: "0" },
1442
+ propsButton: { sx: { maxHeight: "22px" } }
1443
+ }), []), [Qt, eo] = Ee(null), to = Ce((e) => {
1444
+ eo(e);
1445
+ }, []);
1446
+ De(() => {
1447
+ X.prefetch([X.getActive(), W]).catch((e) => {
1448
+ console.warn("Icons could not be loaded:", e);
1449
+ });
1450
+ }, []);
1451
+ const oo = Te(null);
1452
+ oo.current || (oo.current = fo());
1453
+ const ro = Te(null), no = Ce(() => ro.current?.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? oo.current.promise, []), io = le(async (e) => {
1454
+ const t = Qe.current;
1455
+ t && t !== ht.getActive() && await ht.setActive(t), await G.DefaultCommandCatalogService.prefetch(t ?? void 0), zt(e), ro.current = e.source, oo.current.settled || oo.current.resolve(e.source.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? null), l?.(e);
1456
+ }, []), lo = Te(null), co = Ce((e) => {
1457
+ let t = null, r = {
1458
+ readOnly: !0,
1459
+ ...se
1460
+ };
1461
+ return se?.hidden || (t = Xe(o, {
1462
+ ...r,
1463
+ style: {
1464
+ maxWidth: "100%",
1465
+ ...se?.style
1466
+ },
1467
+ workbook: e.workbook ?? Re.current,
1468
+ ref: lo,
1469
+ title: Gt,
1470
+ modified: Nt,
1471
+ encrypted: jt,
1472
+ placeHolder: Ue,
1473
+ onTitleChange: (e) => {
1474
+ Ut(e), se?.onTitleChange?.(e);
1475
+ }
1476
+ })), Xe(Bt, {
1477
+ ...e,
1478
+ logo: E,
1479
+ mainElement: t,
1480
+ startElement: F,
1481
+ endElement: P
1482
+ });
1483
+ }, [
1484
+ E,
1485
+ Gt,
1486
+ Nt,
1487
+ jt,
1488
+ se,
1489
+ F,
1490
+ P
1491
+ ]);
1492
+ De(() => {
1493
+ const e = Re.current;
1494
+ if (!e) return;
1495
+ const t = (t) => {
1496
+ (t.ctrlKey || t.metaKey || "native" !== re.getWheelOwner(t, e)) && t.preventDefault();
1497
+ };
1498
+ return e.addEventListener("wheel", t, { passive: !1 }), () => {
1499
+ e.removeEventListener("wheel", t);
1500
+ };
1501
+ }, [_t]);
1502
+ const [po, uo] = Ee(null);
1503
+ De(() => {
1504
+ uo(_t?.source?.getCommandScope?.() ?? null);
1505
+ }, [_t]);
1506
+ const mo = Se(() => ({
1507
+ "& .SnackbarContainer-root": { position: "absolute !important" },
1508
+ "& .notistack-SnackbarContainer > div": { maxWidth: "min(100%, 720px)" },
1509
+ "& .notistack-Snackbar": { minWidth: "unset" },
1510
+ "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1511
+ "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1512
+ "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1513
+ "& .notistack-MuiContent *": { fontFamily: (e) => e.typography.fontFamily },
1514
+ "& #notistack-snackbar": {
1515
+ maxWidth: "560px",
1516
+ whiteSpace: "pre-wrap"
1517
+ },
1518
+ "*": { userSelect: "none" }
1519
+ }), []), [go, ho] = Ee(null), [, yo] = he(null, !1);
1520
+ De(() => {
1521
+ yo(null != go);
1522
+ }, [go, yo]);
1523
+ const xo = Ce((e) => x({
1524
+ model: bt,
1525
+ side: C,
1526
+ ...e,
1527
+ ...w
1528
+ }), [
1529
+ bt,
1530
+ C,
1531
+ w
1532
+ ]), vo = Te(r);
1533
+ vo.current = r, de(t, () => ({
1534
+ isStudioElement: () => !0,
1535
+ save: (e) => {
1536
+ const t = $t.current;
1537
+ return t ? t(e) : Promise.reject(/* @__PURE__ */ new Error("The studio cannot save: no workbook, or the backing store cannot write."));
1538
+ },
1539
+ getWorkbookElement: () => Re.current,
1540
+ getWorkbook: () => Yt.current ?? null,
1541
+ isDirty: () => Ot.current?.isDirty() ?? !1,
1542
+ getEditable: () => At.current,
1543
+ getFormulaBarElement: () => Me.current ?? null,
1544
+ focus: () => Re.current?.focus(),
1545
+ whenReady: () => (ut.current || (ut.current = fo()), ut.current.promise),
1546
+ getWorkbookState: () => Kt.current,
1547
+ retry: () => pt((e) => e + 1)
1548
+ }), [], r);
1549
+ const Co = Te(!1), Do = le(async (e, t) => {
1550
+ t === xt.current && (Co.current = vo.current?.contains(document.activeElement) ?? !0, yt(t), await io(e), c?.(e));
1551
+ }, []);
1552
+ De(() => {
1553
+ Co.current && (Co.current = !1, Re.current?.focus());
1554
+ }, [bt]);
1555
+ const So = Ce((e) => {
1556
+ const { ref: t, ...o } = e, r = ot ? et.dark : et.light, n = "error" === kt.status && f ? Xe(oe, {
1557
+ render: f,
1558
+ props: {
1559
+ ...y,
1560
+ style: {
1561
+ width: "100%",
1562
+ height: "100%",
1563
+ ...y?.style
1564
+ },
1565
+ error: kt.error
1566
+ }
1567
+ }) : null;
1568
+ if (n && !bt) return Xe(nt, {
1569
+ style: {
1570
+ width: "100%",
1571
+ height: "100%",
1572
+ position: "absolute",
1573
+ display: "flex",
1574
+ alignItems: "stretch",
1575
+ justifyContent: "stretch"
1576
+ },
1577
+ children: n
1578
+ });
1579
+ let l = null;
1580
+ if (bt) {
1581
+ const e = bt, n = e.getView(), a = ge ?? n?.isShowFormulaBar(), i = ve ?? n?.isShowStatusBar(), s = _t?.source ?? Re.current, u = Xe(oe, {
1582
+ render: void 0 === Ne ? co : Ne,
1583
+ props: {
1584
+ workbook: s,
1585
+ ...Ae
1586
+ }
1587
+ }), g = "bottom" === Be, f = a ? Xe(oe, {
1588
+ render: void 0 === be ? m : be,
1589
+ props: {
1590
+ ref: Me,
1591
+ style: {
1592
+ marginTop: r.spacing(g ? .5 : .25),
1593
+ marginLeft: r.spacing(1),
1594
+ marginRight: r.spacing(1),
1595
+ marginBottom: r.spacing(g ? .5 : .75)
1596
+ },
1597
+ workbook: e,
1598
+ editable: Pt ?? void 0,
1599
+ placement: Be,
1600
+ floatOnKeyboard: "float" === Ke,
1601
+ ...ke,
1602
+ propsNamedCollectionEditor: {
1603
+ restoreFocus: (e) => s?.focus(e),
1604
+ ...ke?.propsNamedCollectionEditor
1605
+ }
1606
+ }
1607
+ }) : null, k = i ? Xe(oe, {
1608
+ render: void 0 === Fe ? h : Fe,
1609
+ props: {
1610
+ childrenEnd: Jt,
1611
+ ...We
1612
+ }
1613
+ }) : null, b = (e, r) => Xe(p, {
1614
+ ...me,
1615
+ tabIndex: 0,
1616
+ autoFocus: !r && J,
1617
+ workbook: e,
1618
+ editable: r ? void 0 : Pt ?? void 0,
1619
+ focusNameBox: r ? void 0 : $e,
1620
+ prefetch: !r && d,
1621
+ ref: r ? Oe : Dt([t, Re]),
1622
+ onWorkbookLoad: r ? void 0 : io,
1623
+ onRenderSettled: r ? (t) => {
1624
+ Do(t, e);
1625
+ } : c,
1626
+ onKeyDown: (e) => {
1627
+ D?.(e);
1628
+ },
1629
+ propsWorkbookLoading: ue,
1630
+ renderWorkbookLoading: null,
1631
+ style: r ? {
1632
+ ...me?.style,
1633
+ position: "absolute",
1634
+ inset: 0,
1635
+ visibility: "hidden"
1636
+ } : {
1637
+ flex: "1 1 100%",
1638
+ minHeight: 0,
1639
+ ...me?.style
1640
+ },
1641
+ onContextMenu: (e) => e.preventDefault(),
1642
+ ...r ? null : o
1643
+ }, e.getId());
1644
+ l = Xe("div", {
1645
+ style: {
1646
+ display: "flex",
1647
+ flexDirection: "column",
1648
+ flex: "1 1 100%",
1649
+ minWidth: 0,
1650
+ minHeight: 0
1651
+ },
1652
+ children: so(Be, {
1653
+ toolbar: u,
1654
+ formulaBar: f,
1655
+ statusBar: k,
1656
+ main: Xe(ao, {
1657
+ taskSide: C,
1658
+ persistKey: bo,
1659
+ sidebarElement: go ? Xe(G.CommandScopeProvider, {
1660
+ scope: po,
1661
+ children: go
1662
+ }) : void 0,
1663
+ mainElement: Ye("div", {
1664
+ style: {
1665
+ position: "relative",
1666
+ display: "flex",
1667
+ flexDirection: "column",
1668
+ flex: "1 1 100%",
1669
+ minWidth: 0,
1670
+ minHeight: 0
1671
+ },
1672
+ children: [[b(bt, !1), wt ? b(wt, !0) : null], Xe(Ze, {
1673
+ ref: to,
1674
+ sx: {
1675
+ position: "absolute",
1676
+ top: "10%",
1677
+ left: 0,
1678
+ right: 0,
1679
+ bottom: 0,
1680
+ pointerEvents: "none",
1681
+ "& > :first-of-type": { position: "relative" }
1682
+ }
1683
+ })]
1684
+ })
1685
+ })
1686
+ })
1687
+ });
1688
+ }
1689
+ const u = !_t && ce ? Xe(oe, {
1690
+ render: ce,
1691
+ props: { ...ue }
1692
+ }) : null;
1693
+ return Ye(nt, {
1694
+ sx: mo,
1695
+ style: {
1696
+ width: "100%",
1697
+ height: _e ? `calc(100% - ${_e}px)` : "100%",
1698
+ transform: ze ? `translateY(${ze}px)` : void 0,
1699
+ position: "absolute",
1700
+ display: "flex",
1701
+ alignItems: "stretch",
1702
+ justifyContent: "stretch",
1703
+ backgroundColor: "var(--sxl-color-base-200)"
1704
+ },
1705
+ className: "eager-studio",
1706
+ square: a,
1707
+ elevation: i,
1708
+ variant: s,
1709
+ children: [
1710
+ l,
1711
+ n ? Xe(nt, {
1712
+ style: {
1713
+ position: "absolute",
1714
+ inset: 0,
1715
+ display: "flex",
1716
+ alignItems: "stretch",
1717
+ justifyContent: "stretch"
1718
+ },
1719
+ children: n
1720
+ }) : null,
1721
+ u ? Xe("div", {
1722
+ style: {
1723
+ position: "absolute",
1724
+ inset: 0,
1725
+ display: "flex",
1726
+ alignItems: "center",
1727
+ justifyContent: "center",
1728
+ background: `var(--sxl-color-base-100, ${ot ? "#121212" : "#fff"})`
1729
+ },
1730
+ children: u
1731
+ }) : null
1732
+ ]
1733
+ });
1734
+ }, [
1735
+ kt,
1736
+ bt,
1737
+ wt,
1738
+ _t,
1739
+ Gt,
1740
+ ce,
1741
+ ue,
1742
+ me,
1743
+ a,
1744
+ i,
1745
+ s,
1746
+ Jt,
1747
+ f,
1748
+ y,
1749
+ co,
1750
+ mo,
1751
+ go,
1752
+ C,
1753
+ po,
1754
+ ge,
1755
+ ke,
1756
+ be,
1757
+ Be,
1758
+ Pt,
1759
+ ve,
1760
+ We,
1761
+ Fe,
1762
+ Ae,
1763
+ Ne,
1764
+ Ke,
1765
+ _e,
1766
+ ze,
1767
+ et,
1768
+ ot
1769
+ ]);
1770
+ let To = Xe(Et, {
1771
+ maxSnack: 3,
1772
+ domRoot: Qt ?? void 0,
1773
+ anchorOrigin: {
1774
+ vertical: "bottom",
1775
+ horizontal: "right"
1776
+ },
1777
+ autoHideDuration: 3500,
1778
+ onClose: (e, t, o) => {
1779
+ Re.current?.focus();
1780
+ },
1781
+ Components: { error: Mt },
1782
+ iconVariant: {
1783
+ success: Xe(at, {
1784
+ style: { marginRight: "8px" },
1785
+ children: Xe("path", { d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" })
1786
+ }),
1787
+ error: Xe(Y, {
1788
+ iconKey: "ErrorAlert",
1789
+ style: { marginRight: "8px" }
1790
+ })
1791
+ },
1792
+ children: Xe(O, {
1793
+ workbook: bt,
1794
+ children: Xe(A, {
1795
+ renderArea: xo,
1796
+ onUpdateArea: (e) => {
1797
+ ho(e);
1798
+ },
1799
+ children: Xe(je, { children: Xe(Zt, { children: Xe(ie, { children: Xe(Q, { children: Xe(qt, {
1800
+ workbook: bt,
1801
+ initialCommandAnchor: no,
1802
+ renderWorkbook: So,
1803
+ setWorkbook: St,
1804
+ titleWorkbook: Gt,
1805
+ setWorkbookTitle: Ut,
1806
+ refDocumentTitle: lo,
1807
+ isDirty: Lt,
1808
+ refSave: $t,
1809
+ host: r
1810
+ }) }) }) }) })
1811
+ })
1812
+ })
1813
+ });
1814
+ return To = Ye(lt, {
1815
+ theme: ot ? et.dark : et.light,
1816
+ children: [
1817
+ q ? Xe(tt, {}) : null,
1818
+ Xe(ae, { css: rt }),
1819
+ Xe(I, { scopeClass: n }),
1820
+ Xe(Ie, {
1821
+ themeScopeClass: n,
1822
+ themeSurface: "app",
1823
+ themeMode: qe,
1824
+ children: To
1825
+ })
1826
+ ]
1827
+ }), To;
1828
+ }));
1829
+ yo.displayName = "EagerStudio";
1830
+ var wo = (e) => Xe(to, { ...e });
1831
+ export { yo as EagerStudio, yo as default, jt as n, ho as t };