@sheetxl/studio-mui 0.7.16 → 0.7.18

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 (41) hide show
  1. package/browser/cjs/{Bp_Q6Q1JP7PLdn-j.cjs → 5RiYqaQlLZIP_qBr.cjs} +1 -1
  2. package/browser/cjs/{D86M0fc5XpkQp4gk.cjs → B36thAvT2Bn73SRd.cjs} +3 -3
  3. package/browser/cjs/{Cc0PDDVn8CB6mX-c.cjs → BYcSZUU4rVtQP6gK.cjs} +2 -2
  4. package/browser/cjs/{Dwamt-p0XVNIeEAM.cjs → Bn_KxW2cuEvzy2ea.cjs} +1 -1
  5. package/browser/cjs/{CLxLccZWksQgSIfb.cjs → BosWKAiiH2RyT38P.cjs} +2 -2
  6. package/browser/cjs/{DU-OFxkWz_AT01_1.cjs → BwkQARr_gDac5ZMX.cjs} +2 -2
  7. package/browser/cjs/{DDySzbOrTePwHwyS.cjs → CCOtEXhjKzsjlqt-.cjs} +1 -1
  8. package/browser/cjs/CQUHNi4y5RAGjk9Y.cjs +20 -0
  9. package/browser/cjs/{vnUEXASpUv_-qQiU.cjs → D5qbA7XihENNJu3e.cjs} +1 -1
  10. package/browser/cjs/{EG3LGz7SrtC5w5XW.cjs → DXf7MXTztXi0ktyH.cjs} +1 -1
  11. package/browser/cjs/{B4g0GjoE6uIK7JP6.cjs → RRwT9R87Ij-96WrH.cjs} +2 -2
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/{UzMSUQjwLPa1rDpq.cjs → sUwdvQP9isF3IxrK.cjs} +1 -1
  14. package/browser/esm/{Dwcmic9nRpO5U0hB.mjs → B9-uHOzvc0OiZdZo.mjs} +1 -1
  15. package/browser/esm/{Bd2P_uVYuMxp-1j_.mjs → BBypnq2tldpEjj4a.mjs} +1 -1
  16. package/browser/esm/{DXGXrNlkgS_o6inh.mjs → BV4pQ6zdlDKFhMAl.mjs} +1993 -1964
  17. package/browser/esm/{CLCBBZG_5S3teJrH.mjs → BbKZPLs_J0YGVw6O.mjs} +2 -2
  18. package/browser/esm/{BLeld8z05x61T2qL.mjs → BfE0OM9us43hl14l.mjs} +2 -2
  19. package/browser/esm/{JBRpZwaRLPhvgrsJ.mjs → Cemjc-9qrC_Qgd2H.mjs} +1 -1
  20. package/browser/esm/{BAdJwAU8SuPZ7FrN.mjs → DHbLJVM8RKQdjsZG.mjs} +1 -1
  21. package/browser/esm/{DBalbXg6qCmkXeEF.mjs → DQ8WzSK9Z30ZOw6d.mjs} +3 -3
  22. package/browser/esm/{BwxqzKtkNiYyZcdy.mjs → DZkVicEVk7-7NMP0.mjs} +1 -1
  23. package/browser/esm/{CpGMNx_0kS1OzP9s.mjs → Diqh2wFwdh7bNpp0.mjs} +1 -1
  24. package/browser/esm/{CqtLawUW8V21gwzu.mjs → DsMFVy6lxESb-TUt.mjs} +2 -2
  25. package/browser/esm/{DIl_WDqHQZFMMmhw.mjs → YPzi26qwsUv-cpd_.mjs} +2 -2
  26. package/browser/esm/index.mjs +2 -2
  27. package/licenses/dependencies.txt +139 -139
  28. package/node/esm/{B39xbyK17-A3Vu9v.mjs → 60iZVg9RWL3eutji.mjs} +1 -1
  29. package/node/esm/{DcqscFmt18Bfovt3.mjs → CJ2Phv8-N4NdkE5p.mjs} +1 -1
  30. package/node/esm/{DVjcSv3wizGrc9od.mjs → CUldcQOJwhceQsiY.mjs} +1 -1
  31. package/node/esm/{8CrVP1lyWUA4_AMS.mjs → CXB3esBTggZf3EPD.mjs} +1 -1
  32. package/node/esm/{C5GvIpYv4OTcYYon.mjs → Cn5ZMNkPwm9lxZKa.mjs} +1 -1
  33. package/node/esm/{3exh7GXawSx9oKrL.mjs → D8dHeDIBY8RBIbMi.mjs} +1 -1
  34. package/node/esm/{Dnpj8yRHCvG70LhS.mjs → DCgD4VQRnocNHKC-.mjs} +1 -1
  35. package/node/esm/{j4Mywki8bVROW07t.mjs → D_t85wvCesLiBm0m.mjs} +1 -1
  36. package/node/esm/{fzJrH1RlAEOrcfaW.mjs → PGW_u1abMjdH3vjc.mjs} +1 -1
  37. package/node/esm/index.mjs +461 -432
  38. package/node/esm/{DggVyg0G8aWEPSES.mjs → vOoUUIRETo8Af1CF.mjs} +1 -1
  39. package/package.json +8 -8
  40. package/types/index.d.ts +24 -20
  41. package/browser/cjs/Bc4L7-Qr9mrX7hf-.cjs +0 -20
@@ -1,26 +1,26 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.16
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.18
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
7
  import { Color as e, IColor as t, ITheme as o, CommonUtils as n, IBorder as a, FontUtils as r, IFont as l, NumberFormat as i, IFontCollection as s, IStyle as d, ITextFrame as c, Table as m, IFill as p, CoordUtils as u, ISheet as g, LicenseManager as h, Workbook as f, TypesUtils as x } from "@sheetxl/sdk";
8
8
  import { LicenseManager } from "@sheetxl/sdk";
9
- import { StyledStrokePath as b, StaticBorderRenderer as y, useModelListener as w, createCellEditStateFromCell as S, SheetCellEditor as k, ScriptEditor as C, DefaultTaskPaneRegistry as v, useTaskPaneArea as T, useDocThemes as R, TabStrip as P, SheetElement as D, SheetScrollbar as M, PictureEditor as F, ChartEditor as N, EmptyFrame as B, LogoNoPaddingIcon as E, TaskPaneArea as A, TaskPaneProvider as I } from "@sheetxl/react";
9
+ import { StyledStrokePath as b, StaticBorderRenderer as y, useModelListener as w, createCellEditStateFromCell as S, SheetCellEditor as k, ScriptEditor as C, DefaultTaskPaneRegistry as v, useTaskPaneArea as T, useDocThemes as R, TabStrip as P, SheetElement as D, SheetScrollbar as F, PictureEditor as M, ChartEditor as N, EmptyFrame as B, LogoNoPaddingIcon as E, TaskPaneArea as I, TaskPaneProvider as A } from "@sheetxl/react";
10
10
  import { DefaultTaskPaneRegistry, useModelListener, useRangeListener } from "@sheetxl/react";
11
11
  import { jsxs as L, Fragment as H, jsx as z } from "react/jsx-runtime";
12
- import W, { memo as $, forwardRef as O, useMemo as V, useCallback as K, isValidElement as G, useState as U, useEffect as j, Suspense as _, useRef as q, createElement as X, useReducer as Z, useImperativeHandle as Y, useLayoutEffect as Q } from "react";
12
+ import W, { memo as $, forwardRef as O, useMemo as V, useCallback as K, isValidElement as G, useState as _, useEffect as U, Suspense as j, useRef as q, createElement as X, useReducer as Z, useImperativeHandle as Y, useLayoutEffect as Q } from "react";
13
13
  import { Box as J, Typography as ee, IconButton as te, MenuItem as oe, Divider as ne, Button as ae, SvgIcon as re, Input as le, FormControlLabel as ie, Checkbox as se, FormControl as de, TextField as ce, InputAdornment as me, Slider as pe, Paper as ue, CircularProgress as ge, Select as he, Tabs as fe, Tab as xe, useMediaQuery as be, Card as ye, CardActions as we, Collapse as Se, DialogTitle as ke, CssBaseline as Ce } from "@mui/material";
14
- import { CommandButton as ve, ExhibitDivider as Te, defaultCreatePopupPanel as Re, CommandPopupButton as Pe, InputCommandButton as De, SimpleTooltip as Me, LoadingPanel as Fe, PopupButtonType as Ne, ExhibitPopupIconButton as Be, ExhibitPopupMenuItem as Ee, ExhibitMenuItem as Ae, createStrokeShadowFilter as Ie, strokeShadowFilter as Le, ExhibitTooltip as He, ExhibitIconButton as ze, CommandTooltip as We, SimpleCommandPopupButton as $e, SelectedIcon as Oe, LabelIcon as Ve, ExhibitMenuHeader as Ke, ContextMenu as Ge, ExhibitOptionButton as Ue, hexToRGB as je, useFloatStack as _e, elevateColor as qe, CommandToolbar as Xe, createScrollEdgeButton as Ze, createScrollEndButton as Ye, createScrollStartButton as Qe, scrollbarTheming as Je, StackTrace as et, useResolvedThemeMode as tt, ThemeMode as ot, useModal as nt, useLazyWindow as at, useOptionsDialog as rt, useInputDialog as lt, AnimatedTraversingEllipsisIcon as it, ErrorPanel as st, createExhibitTheme as dt, ModalProvider as ct } from "@sheetxl/utils-mui";
14
+ import { CommandButton as ve, ExhibitDivider as Te, defaultCreatePopupPanel as Re, CommandPopupButton as Pe, InputCommandButton as De, SimpleTooltip as Fe, LoadingPanel as Me, PopupButtonType as Ne, ExhibitPopupIconButton as Be, ExhibitPopupMenuItem as Ee, ExhibitMenuItem as Ie, createStrokeShadowFilter as Ae, strokeShadowFilter as Le, ExhibitTooltip as He, ExhibitIconButton as ze, CommandTooltip as We, SimpleCommandPopupButton as $e, SelectedIcon as Oe, LabelIcon as Ve, ExhibitMenuHeader as Ke, ContextMenu as Ge, ExhibitOptionButton as _e, hexToRGB as Ue, useFloatStack as je, elevateColor as qe, CommandToolbar as Xe, createScrollEdgeButton as Ze, createScrollEndButton as Ye, createScrollStartButton as Qe, scrollbarTheming as Je, StackTrace as et, useResolvedThemeMode as tt, ThemeMode as ot, useModal as nt, useLazyWindow as at, useOptionsDialog as rt, useInputDialog as lt, AnimatedTraversingEllipsisIcon as it, ErrorPanel as st, createExhibitTheme as dt, ModalProvider as ct } from "@sheetxl/utils-mui";
15
15
  import mt from "clsx";
16
- import { useCommands as pt, CommandButtonType as ut, useCallbackRef as gt, ReactUtils as ht, KeyCodes as ft, DynamicIcon as xt, useCommand as bt, useMouseDownAndHoldListener as yt, useEditMode as wt, useNotifier as St, NotifierType as kt, useImperativeElement as Ct, SplitPane as vt, RoundedTab as Tt, DefaultDynamicIconService as Rt, SimpleCommand as Pt, Command as Dt, KeyModifiers as Mt, CommandGroup as Ft, ToolTipPlacement as Nt, ScrollPane as Bt, useUndoManager as Et, DefaultReactNotifier as At, NotifierProvider as It, UncaughtErrorBoundary as Lt, ReactErrorBoundary as Ht } from "@sheetxl/utils-react";
16
+ import { useCommands as pt, CommandButtonType as ut, useCallbackRef as gt, ReactUtils as ht, KeyCodes as ft, DynamicIcon as xt, useCommand as bt, useMouseDownAndHoldListener as yt, useEditMode as wt, useNotifier as St, NotifierType as kt, useImperativeElement as Ct, SplitPane as vt, RoundedTab as Tt, DefaultDynamicIconService as Rt, SimpleCommand as Pt, Command as Dt, KeyModifiers as Ft, CommandGroup as Mt, ToolTipPlacement as Nt, ScrollPane as Bt, useUndoManager as Et, DefaultReactNotifier as It, NotifierProvider as At, UncaughtErrorBoundary as Lt, ReactErrorBoundary as Ht } from "@sheetxl/utils-react";
17
17
  import { useTheme as zt, alpha as Wt, getOverlayAlpha as $t, ThemeProvider as Ot } from "@mui/material/styles";
18
18
  import { alpha as Vt } from "@mui/system";
19
19
  import { useFormContext as Kt } from "react-hook-form";
20
20
  import { ResizableBox as Gt } from "react-resizable";
21
- import { mergeRefs as Ut } from "react-merge-refs";
22
- import { useMeasure as jt } from "react-use";
23
- import { CommonUtils as _t, ChainedError as qt, ErrorUtils as Xt, ExpectedError as Zt, PartialError as Yt, UndoManager as Qt } from "@sheetxl/utils";
21
+ import { mergeRefs as _t } from "react-merge-refs";
22
+ import { useMeasure as Ut } from "react-use";
23
+ import { CommonUtils as jt, ChainedError as qt, ErrorUtils as Xt, ExpectedError as Zt, PartialError as Yt, UndoManager as Qt } from "@sheetxl/utils";
24
24
  import { CSSTransition as Jt } from "react-transition-group";
25
25
  import { useFullscreen as eo } from "rooks";
26
26
  import { IOUtils as to } from "@sheetxl/io";
@@ -116,7 +116,7 @@ const ro = $(O((e2, t2) => {
116
116
  }, [i2, l2]), k2 = K((e2) => {
117
117
  s2?.(e2 ? l2 : null);
118
118
  }, [s2, l2]);
119
- return z(Me, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: l2.description, placement: "bottom-start", children: z("div", { style: { width: c2 * (m2 ? 1.2 : 1) + "px", height: c2 * (m2 ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g2, children: L(fo, { selectedColor: h2, title: null, onSelectColor: S2, onPreviewColor: k2, alphaCheckSize: m2 ? 9 : void 0, darkMode: u2, ...d2, children: [z("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: w2.toRGBA(u2).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: x2 ? "1" : "0" } }), z("div", { style: { position: "absolute", width: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", height: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: w2.toRGBA(u2).toString(), borderRadius: "50%", opacity: b2 ? "1" : "0" } })] }) }) });
119
+ return z(Fe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: l2.description, placement: "bottom-start", children: z("div", { style: { width: c2 * (m2 ? 1.2 : 1) + "px", height: c2 * (m2 ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g2, children: L(fo, { selectedColor: h2, title: null, onSelectColor: S2, onPreviewColor: k2, alphaCheckSize: m2 ? 9 : void 0, darkMode: u2, ...d2, children: [z("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: w2.toRGBA(u2).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: x2 ? "1" : "0" } }), z("div", { style: { position: "absolute", width: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", height: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: w2.toRGBA(u2).toString(), borderRadius: "50%", opacity: b2 ? "1" : "0" } })] }) }) });
120
120
  }), bo = $((e2) => {
121
121
  const { title: t2, schemeColorLookup: o2, colorDefs: n2, selectedColor: a2, previewColor: r2, onSelectColorDef: l2, onPreviewColorDef: i2, style: s2 = ht.EmptyCssProperties, compareRGB: d2 = false, darkMode: c2, swatchProps: m2, ...p2 } = e2;
122
122
  let u2;
@@ -150,8 +150,8 @@ const ro = $(O((e2, t2) => {
150
150
  r2?.set(d2, s2);
151
151
  const c2 = s2.toRGBA().toString();
152
152
  l2?.set(c2, s2);
153
- }, So = W.lazy(() => import("./DVjcSv3wizGrc9od.mjs")), ko = $(O((t2, a2) => {
154
- const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop: x2, onPreviewColor: b2, onPreviewColorImmediate: y2, onSelectColor: w2, autoColor: S2, autoColorLabel: k2 = "Automatic", autoColorPosition: C2 = mo.Start, compareRGB: v2 = false, darkMode: T2 = false, ...R2 } = t2, P2 = l2 || r2, D2 = gt(b2, [b2]), M2 = gt(y2, [y2]), F2 = gt(w2, [w2]), N2 = gt(f2, [f2]), B2 = gt(x2, [x2]), [E2, A2] = U(false), I2 = zt(), W2 = V(() => s2 || e.getDefaultSchemeLookup(), [s2]), $2 = V(() => {
153
+ }, So = W.lazy(() => import("./CUldcQOJwhceQsiY.mjs")), ko = $(O((t2, a2) => {
154
+ const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop: x2, onPreviewColor: b2, onPreviewColorImmediate: y2, onSelectColor: w2, autoColor: S2, autoColorLabel: k2 = "Automatic", autoColorPosition: C2 = mo.Start, compareRGB: v2 = false, darkMode: T2 = false, ...R2 } = t2, P2 = l2 || r2, D2 = gt(b2, [b2]), F2 = gt(y2, [y2]), M2 = gt(w2, [w2]), N2 = gt(f2, [f2]), B2 = gt(x2, [x2]), [E2, I2] = _(false), A2 = zt(), W2 = V(() => s2 || e.getDefaultSchemeLookup(), [s2]), $2 = V(() => {
155
155
  const e2 = /* @__PURE__ */ new Map(), t3 = /* @__PURE__ */ new Map(), n2 = [];
156
156
  wo("Primary Background", "bg1", W2, n2, e2, t3), wo("Primary Text", "tx1", W2, n2, e2, t3), wo("Secondary Background", "bg2", W2, n2, e2, t3), wo("Secondary Text", "tx2", W2, n2, e2, t3), wo("Accent 1", "accent1", W2, n2, e2, t3), wo("Accent 2", "accent2", W2, n2, e2, t3), wo("Accent 3", "accent3", W2, n2, e2, t3), wo("Accent 4", "accent4", W2, n2, e2, t3), wo("Accent 5", "accent5", W2, n2, e2, t3), wo("Accent 6", "accent6", W2, n2, e2, t3);
157
157
  const a3 = o.buildPalette(n2, W2, e2, t3), r3 = [];
@@ -166,13 +166,13 @@ const ro = $(O((e2, t2) => {
166
166
  }
167
167
  return { primaryColors: n2, modifiedPresets: a3, standardColors: r3, recentColorsLimited: c3, mapAllPresets: e2, mapAllPresetsRGB: t3, mapRecent: l3 };
168
168
  }, [W2, i2, d2, S2]);
169
- j(() => {
169
+ U(() => {
170
170
  g2?.();
171
171
  }, []);
172
- const [O2, G2] = U(false), q2 = K(() => {
172
+ const [O2, G2] = _(false), q2 = K(() => {
173
173
  G2((e2) => !e2);
174
174
  }, []);
175
- j(() => {
175
+ U(() => {
176
176
  if (m2) G2(m2 === co.Custom);
177
177
  else if (r2) {
178
178
  let e2 = r2.toString(), t3 = $2.mapAllPresets.get(e2);
@@ -183,13 +183,13 @@ const ro = $(O((e2, t2) => {
183
183
  }, [r2, m2]);
184
184
  const X2 = K(n.debounce((e2) => {
185
185
  D2?.(e2);
186
- }, c2), [D2, c2]), [Z2, Y2] = U();
187
- j(() => {
186
+ }, c2), [D2, c2]), [Z2, Y2] = _();
187
+ U(() => {
188
188
  Y2(l2 || r2);
189
189
  }, [l2, r2]);
190
190
  const Q2 = gt((e2) => {
191
- M2 && (M2(e2), X2(e2));
192
- }, [M2]), re2 = gt((t3) => {
191
+ F2 && (F2(e2), X2(e2));
192
+ }, [F2]), re2 = gt((t3) => {
193
193
  Q2(t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs }, W2) : null);
194
194
  }, [W2]), le2 = K((e2) => {
195
195
  e2.ctrlKey && G2(true);
@@ -199,8 +199,8 @@ const ro = $(O((e2, t2) => {
199
199
  const o2 = e2.toString();
200
200
  t3 = !$2.mapAllPresets.has(o2);
201
201
  }
202
- F2?.(e2, t3);
203
- }, [F2, $2]), se2 = gt((t3) => {
202
+ M2?.(e2, t3);
203
+ }, [M2, $2]), se2 = gt((t3) => {
204
204
  const o2 = t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs }, W2) : null;
205
205
  Promise.resolve(h2?.()).then(() => {
206
206
  ie2(o2);
@@ -210,8 +210,8 @@ const ro = $(O((e2, t2) => {
210
210
  }, [W2]), ce2 = V(() => {
211
211
  if (void 0 === window.EyeDropper) return z(H, {});
212
212
  return z(te, { "aria-label": "eye dropper", size: "small", sx: { color: (e2) => e2.palette.text.icon ?? e2.palette.action.active }, onClick: async () => {
213
- A2(true), N2?.(), await new EyeDropper().open().then((t3) => {
214
- A2(false), B2?.();
213
+ I2(true), N2?.(), await new EyeDropper().open().then((t3) => {
214
+ I2(false), B2?.();
215
215
  let o2 = new e(t3.sRGBHex), n2 = o2.toString(), a3 = $2.mapAllPresets.get(n2);
216
216
  if (a3 || (n2 = o2.toRGBA().toString(), a3 = $2.mapAllPresetsRGB.get(n2)), !a3) {
217
217
  const e2 = o2.toRGBA(), t4 = 3;
@@ -223,14 +223,14 @@ const ro = $(O((e2, t2) => {
223
223
  }
224
224
  G2(!a3), Q2(a3 || o2);
225
225
  }).catch((e2) => {
226
- A2(false), "AbortError" !== e2?.name && console.error(e2);
226
+ I2(false), "AbortError" !== e2?.name && console.error(e2);
227
227
  });
228
228
  }, children: z(xt, { iconKey: "Colorize" }) });
229
229
  }, [$2, T2]), me2 = V(() => {
230
230
  if (!O2) return;
231
231
  const e2 = { opacity: O2 ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
232
- return z(_, { fallback: z("div", { style: e2, children: z(Fe, {}) }), children: z(So, { style: e2, selectedColor: P2 ? P2.toRGBA().toString() : "transparent", onColorChange: de2, disableAlpha: d2 }) });
233
- }, [O2, P2]), pe2 = V(() => ({ onClick: le2, alphaGrey: I2.palette.text.icon ?? I2.palette.action.active }), [le2, I2]), ue2 = V(() => {
232
+ return z(j, { fallback: z("div", { style: e2, children: z(Me, {}) }), children: z(So, { style: e2, selectedColor: P2 ? P2.toRGBA().toString() : "transparent", onColorChange: de2, disableAlpha: d2 }) });
233
+ }, [O2, P2]), pe2 = V(() => ({ onClick: le2, alphaGrey: A2.palette.text.icon ?? A2.palette.action.active }), [le2, A2]), ue2 = V(() => {
234
234
  if (!S2) return null;
235
235
  const e2 = { description: k2, definition: { val: S2.getVal(), adjs: S2.getAdjustments() } };
236
236
  return z(H, { children: L(oe, { sx: { display: "flex", color: (e3) => e3.palette.text.secondary }, onMouseOver: () => {
@@ -247,7 +247,7 @@ const ro = $(O((e2, t2) => {
247
247
  });
248
248
  }, children: "Done" })] })] });
249
249
  })), Co = z(xt, { iconKey: "circle.colored" }), vo = $(O((e2, t2) => {
250
- const { selectedColor: o2, quickColor: n2, icon: a2 = Co, tooltip: r2, label: l2, onPreviewColor: i2, onPreviewColorImmediate: s2, onSelectColor: d2, variant: c2 = Ne.Toolbar, panelProps: m2, shouldCloseFloatAll: p2 = true, compareRGB: u2 = false, darkMode: g2 = false, ...h2 } = e2, f2 = gt(i2, [i2]), x2 = gt(s2, [s2]), b2 = gt(d2, [d2]), [y2, w2] = U(() => {
250
+ const { selectedColor: o2, quickColor: n2, icon: a2 = Co, tooltip: r2, label: l2, onPreviewColor: i2, onPreviewColorImmediate: s2, onSelectColor: d2, variant: c2 = Ne.Toolbar, panelProps: m2, shouldCloseFloatAll: p2 = true, compareRGB: u2 = false, darkMode: g2 = false, ...h2 } = e2, f2 = gt(i2, [i2]), x2 = gt(s2, [s2]), b2 = gt(d2, [d2]), [y2, w2] = _(() => {
251
251
  }), S2 = n2 || (y2 || o2) || m2?.autoColor, k2 = q(false), C2 = K(() => {
252
252
  }, []), v2 = gt(() => {
253
253
  w2(o2);
@@ -257,14 +257,14 @@ const ro = $(O((e2, t2) => {
257
257
  k2.current || (w2(e3), x2?.(e3));
258
258
  }, [x2]), P2 = gt((e3, t3) => {
259
259
  k2.current || (w2(void 0), b2?.(e3, t3));
260
- }, [b2]), D2 = V(() => z(J, { className: "color-wrapper", sx: { lineHeight: "0", color: "inherit", "--sxl-color-active": `${S2?.toCSS(g2) ?? "transparent"}`, "& .activeColor": { fill: `${S2?.toCSS(g2) ?? "transparent"}` }, "& .style_grey": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, children: "function" == typeof a2 ? a2() : a2 }), [S2, a2, g2]), M2 = gt((e3) => {
260
+ }, [b2]), D2 = V(() => z(J, { className: "color-wrapper", sx: { lineHeight: "0", color: "inherit", "--sxl-color-active": `${S2?.toCSS(g2) ?? "transparent"}`, "& .activeColor": { fill: `${S2?.toCSS(g2) ?? "transparent"}` }, "& .style_grey": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, children: "function" == typeof a2 ? a2() : a2 }), [S2, a2, g2]), F2 = gt((e3) => {
261
261
  b2?.(n2, false);
262
- }, [b2, n2]), [F2, N2] = U(false), B2 = K((e3) => {
262
+ }, [b2, n2]), [M2, N2] = _(false), B2 = K((e3) => {
263
263
  const { closeFloat: t3, closeFloatAll: n3 } = e3;
264
264
  return z(ko, { ...m2, selectedColor: o2, previewColor: y2, onDone: p2 ? n3 : t3, onKeyDown: (e4) => {
265
265
  e4.which === ft.Enter && (p2 ? n3() : t3());
266
266
  }, onPreviewColorImmediate: R2, onPreviewColor: T2, onSelectColor: P2, onEyeDropStart: () => N2(true), onEyeDropStop: () => N2(false), compareRGB: u2, darkMode: g2 });
267
- }, [o2, y2, p2, S2, m2?.autoColor, g2]), E2 = { onQuickClick: n2 ? M2 : void 0, createPopupPanel: B2, popupProps: { popperProps: { resizeOnOverflow: false } }, onPopupOpen: v2, onPopupClose: C2, tooltip: r2 || l2 || "Color", label: l2, icon: D2, ...h2 };
267
+ }, [o2, y2, p2, S2, m2?.autoColor, g2]), E2 = { onQuickClick: n2 ? F2 : void 0, createPopupPanel: B2, popupProps: { popperProps: { resizeOnOverflow: false } }, onPopupOpen: v2, onPopupClose: C2, tooltip: r2 || l2 || "Color", label: l2, icon: D2, ...h2 };
268
268
  return c2 === Ne.Toolbar ? z(Be, { ref: t2, ...E2 }) : z(Ee, { ref: t2, ...E2 });
269
269
  })), To = 82, Ro = (e2) => {
270
270
  const { styleColor: t2, length: o2 = To, width: n2 = 1, dashArray: a2 = null, sx: r2, isDouble: l2 = false, isAngled: i2 = false, darkMode: s2 = false, ...d2 } = e2;
@@ -277,7 +277,7 @@ const ro = $(O((e2, t2) => {
277
277
  if ("None" === t4.description && !c2) continue;
278
278
  const a2 = z(Ro, { styleColor: i2, length: To, width: t4.width, darkMode: m2, dashArray: t4.pattern, isDouble: t4.description.toLowerCase().includes("double"), isAngled: t4.description.toLowerCase().includes("slant") });
279
279
  let d4 = null;
280
- d4 = n2 ? L(H, { children: [z(J, { sx: { marginRight: "6px" }, children: t4.description }), L(J, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [z("div", { style: { flex: "1 1 100%" } }), a2] })] }) : "None" === t4.description ? "None" : a2, p3.push(z(Ae, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ie(4) }, paddingLeft: "16px", background: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` }, tooltipProps: { description: n2 ? "" : t4.description }, icon: null, disabled: r2, onMouseDown: (e5) => e5.preventDefault(), onMouseUp: () => {
280
+ d4 = n2 ? L(H, { children: [z(J, { sx: { marginRight: "6px" }, children: t4.description }), L(J, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [z("div", { style: { flex: "1 1 100%" } }), a2] })] }) : "None" === t4.description ? "None" : a2, p3.push(z(Ie, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ae(4) }, paddingLeft: "16px", background: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` }, tooltipProps: { description: n2 ? "" : t4.description }, icon: null, disabled: r2, onMouseDown: (e5) => e5.preventDefault(), onMouseUp: () => {
281
281
  l3(), g2(t4.style);
282
282
  }, onKeyDown: (e5) => {
283
283
  e5.which === ft.Enter && l3();
@@ -287,11 +287,11 @@ const ro = $(O((e2, t2) => {
287
287
  }, [r2, c2, i2, s2, m2]), f2 = V(() => {
288
288
  const e3 = a.BuiltInDefinitions.get(s2);
289
289
  let t3;
290
- return t3 = "None" === e3.description ? z(J, { sx: { minWidth: `${To}px` }, children: "None" }) : z(Ro, { styleColor: i2, length: To, width: e3.width, dashArray: e3.pattern, darkMode: m2, isDouble: e3.description.toLowerCase().includes("double"), isAngled: e3.description.toLowerCase().includes("slant") }), z(J, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Ie() } }, children: t3 });
290
+ return t3 = "None" === e3.description ? z(J, { sx: { minWidth: `${To}px` }, children: "None" }) : z(Ro, { styleColor: i2, length: To, width: e3.width, dashArray: e3.pattern, darkMode: m2, isDouble: e3.description.toLowerCase().includes("double"), isAngled: e3.description.toLowerCase().includes("slant") }), z(J, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Ae() } }, children: t3 });
291
291
  }, [s2, i2]), x2 = V(() => a.BuiltInDefinitions.get(s2), [s2]), b2 = { disabled: r2, icon: f2, tooltip: "Border Style: " + x2.description, sx: { background: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, ...p2 }, createPopupPanel: h2, ...u2 };
292
292
  return o2 === Ne.Toolbar ? z(Be, { ...b2 }) : z(Ee, { ...b2 });
293
293
  })), Do = $(O((t2, o2) => {
294
- const { autoColor: n2 = null, schemeLookup: r2, autoStrokeStyle: l2 = a.StrokeStyle.Thin, disabled: i2 = false, darkMode: s2 = false, showStylingBefore: d2 = true, onSelectBorder: c2, onPreviewBorder: m2, selectedBorder: p2, createTemporaryBorder: u2, ...g2 } = t2, h2 = gt(c2, [c2]), f2 = gt(m2, [m2]), [x2, b2] = U(), [w2, S2] = U(), k2 = x2 ?? l2, C2 = w2 ?? n2, v2 = p2 || { bottom: { style: l2, color: n2?.toString() } }, T2 = gt((e2) => {
294
+ const { autoColor: n2 = null, schemeLookup: r2, autoStrokeStyle: l2 = a.StrokeStyle.Thin, disabled: i2 = false, darkMode: s2 = false, showStylingBefore: d2 = true, onSelectBorder: c2, onPreviewBorder: m2, selectedBorder: p2, createTemporaryBorder: u2, ...g2 } = t2, h2 = gt(c2, [c2]), f2 = gt(m2, [m2]), [x2, b2] = _(), [w2, S2] = _(), k2 = x2 ?? l2, C2 = w2 ?? n2, v2 = p2 || { bottom: { style: l2, color: n2?.toString() } }, T2 = gt((e2) => {
295
295
  const t3 = {}, o3 = e2 ? Object.keys(e2) : [];
296
296
  let n3 = false;
297
297
  const r3 = o3.length;
@@ -320,7 +320,7 @@ const ro = $(O((e2, t2) => {
320
320
  h2?.(e2);
321
321
  }, []), D2 = K((e2) => {
322
322
  f2?.(e2);
323
- }, []), M2 = K((t3) => {
323
+ }, []), F2 = K((t3) => {
324
324
  const { closeFloatAll: o3, floatReference: l3 } = t3, c3 = (e2, t4, n3 = "bottom", r3 = false) => {
325
325
  const l4 = R2(e2, C2 ?? null, r3 ? a.StrokeStyle.None : k2 ?? null), i3 = r3 ? R2([], C2 ?? null, k2 ?? null) : l4;
326
326
  return z(ze, { icon: T2(i3), sx: { background: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` }, tooltipProps: { label: t4, simple: true, placement: n3 }, onClick: () => {
@@ -332,11 +332,11 @@ const ro = $(O((e2, t2) => {
332
332
  S2(e2);
333
333
  }, darkMode: s2, tooltip: "Border Color", panelProps: { disableAlpha: true, autoColor: n2, schemeLookup: r2 }, disabled: i2 || k2 === a.StrokeStyle.None, parentFloat: l3, shouldCloseFloatAll: false }), z(Po, { selectedStyle: k2, onSelectStyle: b2, styleColor: C2, darkMode: s2, variant: Ne.Toolbar, parentFloat: l3 })] }) });
334
334
  return L(J, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (e2) => e2.stopPropagation(), children: [d2 ? p3 : m3, z(Te, { orientation: "horizontal" }), d2 ? m3 : p3] });
335
- }, [k2, C2, n2, r2, s2]), F2 = V(() => T2(v2), [v2, s2]);
336
- return z(Be, { ref: o2, createPopupPanel: M2, popupProps: { popperProps: { resizeOnOverflow: false } }, createTooltip: ({ children: e2 }, t3) => z(He, { label: "Borders", description: "Set the borders.", disabled: t3, children: e2 }), onQuickClick: () => {
335
+ }, [k2, C2, n2, r2, s2]), M2 = V(() => T2(v2), [v2, s2]);
336
+ return z(Be, { ref: o2, createPopupPanel: F2, popupProps: { popperProps: { resizeOnOverflow: false } }, createTooltip: ({ children: e2 }, t3) => z(He, { label: "Borders", description: "Set the borders.", disabled: t3, children: e2 }), onQuickClick: () => {
337
337
  h2?.(v2);
338
- }, quickButtonProps: { sx: {} }, disabled: i2, icon: F2, ...g2 });
339
- })), Mo = $(O((e2, t2) => {
338
+ }, quickButtonProps: { sx: {} }, disabled: i2, icon: M2, ...g2 });
339
+ })), Fo = $(O((e2, t2) => {
340
340
  const { commands: o2, command: n2, commandHook: a2, variant: r2 = ut.Toolbar, disabled: l2 = false, autoColor: i2, autoStrokeStyle: s2, schemeLookup: d2, createTemporaryBorder: c2, selectedBorder: m2, onSelectBorder: p2, darkMode: u2, icon: g2, label: h2, ...f2 } = e2, x2 = pt(o2, ["formatBorder"]), b2 = n2 ?? x2[0], y2 = b2?.context() ?? null, w2 = y2?.autoColor ?? i2, S2 = y2?.autoStyle ?? s2, k2 = m2 ?? y2?.quickBorder, C2 = u2 ?? y2?.darkMode, v2 = c2 ?? y2?.createTemporaryBorder, T2 = d2 ?? y2?.schemeLookup, R2 = gt((e3) => {
341
341
  y2?.onBorderSelect && y2.onBorderSelect(e3), p2?.(e3), b2?.execute(e3, a2);
342
342
  }, [b2, p2, a2]), P2 = K((e3, t3) => {
@@ -345,7 +345,7 @@ const ro = $(O((e2, t2) => {
345
345
  return (b2?.disabled() || l2) && (i3 = z("div", { children: i3 })), z(We, { command: b2, placement: r2 === ut.Toolbar ? "bottom-start" : "right-start", disabled: t3, ...a3, children: i3 });
346
346
  }, [b2, l2]);
347
347
  return z(Do, { ref: t2, autoColor: w2, darkMode: C2, autoStrokeStyle: S2, createTemporaryBorder: v2, schemeLookup: T2, selectedBorder: k2, onSelectBorder: R2, createTooltip: P2, disabled: l2 || !b2 || b2.disabled(), ...f2 });
348
- })), Fo = $(O((e2, t2) => {
348
+ })), Mo = $(O((e2, t2) => {
349
349
  const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = K((e3, t3) => {
350
350
  const o3 = { variant: ut.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = L(H, { children: [z(ve, { ...o3, command: t3.getCommand("mergeToggle") }), z(ve, { ...o3, command: t3.getCommand("mergeHorizontal") }), z(ve, { ...o3, command: t3.getCommand("mergeVertical") }), z(Te, { orientation: "horizontal" }), z(ve, { ...o3, command: t3.getCommand("unmerge") })] });
351
351
  return Re({ ...e3, children: l3 });
@@ -360,11 +360,11 @@ const ro = $(O((e2, t2) => {
360
360
  })), Bo = $(O((e2, t2) => z($e, { ref: t2, ...e2, popupCommandKeys: ["find", "findReplace", "goto"], scope: "find", label: "Find & Select", tooltip: "Find and replace cells or go to a specific location.", quickCommand: "find", icon: "Find" }))), Eo = $(O((e2, t2) => {
361
361
  const { command: o2, commandHook: n2, showQuickButtons: a2 = !!e2.commands, commands: i2, fontSizes: s2 = r.DefaultFontSizes, disabled: d2 = false, parentFloat: c2, icon: m2, label: p2, sx: u2, ...g2 } = e2;
362
362
  bt(o2);
363
- const h2 = () => o2?.state()?.toString() || "11", [f2, x2] = U(h2), b2 = gt(() => {
363
+ const h2 = () => o2?.state()?.toString() || "11", [f2, x2] = _(h2), b2 = gt(() => {
364
364
  const e3 = parseFloat(f2);
365
365
  isNaN(e3) ? x2(h2()) : parseFloat(h2()) !== e3 && o2.execute(e3, n2);
366
366
  }, [h2, o2, f2, n2]);
367
- j(() => {
367
+ U(() => {
368
368
  x2(h2());
369
369
  }, [o2?.state()]);
370
370
  const y2 = V(() => {
@@ -397,7 +397,7 @@ const ro = $(O((e2, t2) => {
397
397
  }, a3 = o2?.state(), r2 = [];
398
398
  for (let e4 = 0; e4 < s2.length; e4++) {
399
399
  const n3 = s2[e4] === a3;
400
- r2.push(z(Ae, { selected: n3, icon: n3 ? z(Oe, {}) : void 0, disabled: d2 || !o2 || o2.disabled(), onMouseDown: (e5) => {
400
+ r2.push(z(Ie, { selected: n3, icon: n3 ? z(Oe, {}) : void 0, disabled: d2 || !o2 || o2.disabled(), onMouseDown: (e5) => {
401
401
  0 === e5.button && e5.preventDefault();
402
402
  }, onMouseUp: (o3) => {
403
403
  0 === o3.button && t3(s2[e4]);
@@ -409,16 +409,16 @@ const ro = $(O((e2, t2) => {
409
409
  return Re({ ...e3, children: l2 });
410
410
  }, [d2, o2?.state(), n2]);
411
411
  return z(Be, { ref: t2, sx: { ...u2 }, tabIndex: -1, outlined: true, disabled: d2, parentFloat: c2, createPopupPanel: T2, createTooltip: ({ children: e3 }, t3) => z(He, { label: o2?.label(), description: o2?.description(), disabled: t3 || o2?.disabled(), children: e3 }), createQuickButton: v2, ...g2 });
412
- })), Ao = $((e2) => {
412
+ })), Io = $((e2) => {
413
413
  const { selected: t2, disabled: o2, formattedValue: n2, handleSetFormat: a2, format: r2, sx: l2, ...s2 } = e2;
414
- return z(Ae, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...l2 }, disabled: o2, selected: t2, icon: t2 ? z(Oe, {}) : void 0, onMouseDown: (e3) => {
414
+ return z(Ie, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...l2 }, disabled: o2, selected: t2, icon: t2 ? z(Oe, {}) : void 0, onMouseDown: (e3) => {
415
415
  0 === e3.button && e3.preventDefault();
416
416
  }, onMouseUp: (e3) => {
417
417
  0 === e3.button && a2(r2.numberFormat);
418
418
  }, onKeyDown: (e3) => {
419
419
  e3.keyCode !== ft.Enter && e3.keyCode !== ft.Space || a2(r2.numberFormat);
420
420
  }, ...s2, children: L(J, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [L(ee, { component: "div", children: [r2.formatType, r2.formatType === i.Type.Custom ? "…" : ""] }), z(ee, { variant: "caption", component: "div", sx: { color: (e3) => Vt(e3.palette.text.primary, 0.6), paddingTop: n2 && n2.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: n2 && n2.length > 0 ? n2 : " " })] }) });
421
- }), Io = $(O((e2, t2) => {
421
+ }), Ao = $(O((e2, t2) => {
422
422
  const { commands: o2, commandHook: n2, scope: a2, sx: r2, disabled: s2 = false, parentFloat: d2, ...c2 } = e2, m2 = pt(o2, ["formatNumberFormat"])[0], p2 = m2?.state() ? i.Styles.lookupStyle(m2?.state()).formatType : i.Type.General, u2 = V(() => {
423
423
  if (!n2) return null;
424
424
  const e3 = { ...n2 };
@@ -436,9 +436,9 @@ const ro = $(O((e2, t2) => {
436
436
  }
437
437
  "" === t4 && l2[e4].formatType === i.Type.General && (t4 = "No specific format");
438
438
  const n3 = l2[e4].formatType === p2;
439
- d3.push(z(Ao, { selected: n3, disabled: s2 || !m2 || m2.disabled(), formattedValue: t4, handleSetFormat: o3, format: l2[e4] }, l2[e4].formatType));
439
+ d3.push(z(Io, { selected: n3, disabled: s2 || !m2 || m2.disabled(), formattedValue: t4, handleSetFormat: o3, format: l2[e4] }, l2[e4].formatType));
440
440
  }
441
- const g3 = { numberFormat: "", formatType: i.Type.Custom }, h3 = p2 === i.Type.Custom, f3 = z(Ao, { selected: h3, disabled: s2 || !m2 || m2.disabled(), formattedValue: h3 ? r3.getNumberFormat().displayText : "", handleSetFormat: () => {
441
+ const g3 = { numberFormat: "", formatType: i.Type.Custom }, h3 = p2 === i.Type.Custom, f3 = z(Io, { selected: h3, disabled: s2 || !m2 || m2.disabled(), formattedValue: h3 ? r3.getNumberFormat().displayText : "", handleSetFormat: () => {
442
442
  n2?.beforeExecute?.(m2, m2?.state()), t3.getCommand("formatNumberDialog")?.execute(m2?.state()), n2?.onExecute?.(m2, m2?.state());
443
443
  }, format: g3, sx: { flex: "0", width: "100%" } }, i.Type.Custom), x2 = L(J, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e4) => e4.stopPropagation(), children: [z(ve, { command: t3.getCommand("formatNumberFormatAccountingStyle"), commandHook: u2, scope: a2 }), z(ve, { command: t3.getCommand("formatNumberFormatPercentStyle"), commandHook: u2, scope: a2 }), z(ve, { command: t3.getCommand("formatNumberFormatCommaStyle"), commandHook: u2, scope: a2 }), z(ve, { command: t3.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: u2, scope: a2 }), z(ve, { command: t3.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: u2, scope: a2 })] }), b2 = L(J, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...c2, children: [x2, z(Te, { orientation: "horizontal" }), z(J, { sx: { overflow: "auto", flex: "1 1 100%" }, children: d3 }), z(Te, { orientation: "horizontal" }), f3] });
444
444
  return Re({ ...e3, children: b2 });
@@ -486,11 +486,19 @@ const ro = $(O((e2, t2) => {
486
486
  }, [r2, n2, a2]);
487
487
  return u2 ? z(ve, { ref: t2, variant: d2, commandHook: n2, disabled: r2, command: u2, ...c2 }) : z(Pe, { ref: t2, variant: d2, quickCommand: "deleteCells", commands: o2, commandHook: n2, scope: a2, disabled: r2 || g2, tooltip: L(H, { children: [z("span", { children: "Delete cells, rows, columns or sheets from your workbook." }), z("br", {}), z("span", { children: "To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete." })] }), createPopupPanel: h2, ...c2 });
488
488
  })), $o = $(O((e2, t2) => {
489
- const { commands: o2, commandHook: n2, scope: a2, ...r2 } = e2, l2 = K((e3, o3) => {
489
+ const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = pt(o2, ["resizeRows", "autoFitRows", "resizeColumns", "autoFitColumns", "hideColumns", "hideRows", "unhideColumns", "unhideRows"]), { allDisabled: s2 } = V(() => {
490
+ let e3 = 0;
491
+ const t3 = i2.length;
492
+ for (let o3 = 0; o3 < t3; o3++) {
493
+ const t4 = i2[o3];
494
+ t4 && !t4.disabled() && e3++;
495
+ }
496
+ return { allDisabled: 0 === e3 };
497
+ }, [i2]), d2 = K((e3, o3) => {
490
498
  const a3 = { variant: ut.Menuitem, commandHook: n2, scope: "formatCells" }, r3 = { commands: o3, parentFloat: e3.floatReference, ...a3 }, l3 = L(H, { children: [z(ve, { ...a3, command: o3.getCommand("resizeRows") }), z(ve, { ...a3, command: o3.getCommand("autoFitRows") }), z(Te, { orientation: "horizontal" }), z(ve, { ...a3, command: o3.getCommand("resizeColumns") }), z(ve, { ...a3, command: o3.getCommand("autoFitColumns") }), z(Te, { orientation: "horizontal" }), z($e, { ref: t2, ...r3, popupCommandKeys: ["hideColumns", "hideRows", null, "unhideColumns", "unhideRows"], popupScope: "hideUnhide", label: "Hide & Unhide" })] });
491
499
  return Re({ ...e3, children: l3 });
492
500
  }, [n2, a2]);
493
- return z(Pe, { ref: t2, commands: o2, commandHook: n2, scope: a2, createPopupPanel: l2, icon: "CellsFormat", label: "Format Cells", tooltip: "Change row and column sizes or visibility.", ...r2 });
501
+ return z(Pe, { ref: t2, commands: o2, commandHook: n2, scope: a2, createPopupPanel: d2, disabled: r2 || s2, icon: "CellsFormat", label: "Format Cells", tooltip: "Change row and column sizes or visibility.", ...l2 });
494
502
  }));
495
503
  $o.displayName = "CellsFormatCommandButton";
496
504
  const Oo = $(O((t2, o2) => {
@@ -516,30 +524,24 @@ const Vo = $(O((e2, t2) => {
516
524
  return Re({ ...e3, children: l3 });
517
525
  }, [r2, n2]);
518
526
  return z(Pe, { ref: t2, parentFloat: l2, quickCommand: s2[0]?.key(), commands: o2, commandHook: n2, createPopupPanel: d2, label: "Gridlines", tooltip: "Configure how the lines between rows and columns in the sheet are displayed.", icon: z(Ve, { command: s2[0], scope: "view" }), ...i2 });
519
- })), Ko = $(O((e2, t2) => {
520
- const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = K((e3, t3) => {
521
- const o3 = { variant: ut.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = t3.getCommand("sortCustom"), l3 = L(H, { children: [z(ve, { ...o3, command: t3.getCommand("sortAscending") }), z(ve, { ...o3, command: t3.getCommand("sortDescending") }), a3 ? z(ve, { ...o3, command: a3 }) : null, z(Te, { orientation: "horizontal" }), z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle") }), z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear") }), z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply") })] });
522
- return Re({ ...e3, children: l3 });
523
- }, [r2, n2, a2]);
524
- return z(Pe, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Sort", tooltip: L(H, { children: [z("span", { children: "Organize your data so it's easier to analyze." }), z("br", {}), z("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: "SortFilter", ...l2 });
525
- })), Go = $(O((e2, t2) => {
527
+ })), Ko = $(O((e2, t2) => z($e, { ref: t2, ...e2, popupCommandKeys: ["sortAscending", "sortDescending", "sortCustom", null, "autoFilterToggle", "autoFilterClear", "autoFilterReapply"], scope: "sortFilter", label: "Sort & Filter", tooltip: L(H, { children: [z("span", { children: "Organize your data so it's easier to analyze." }), z("br", {}), z("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), icon: "SortFilter" }))), Go = $(O((e2, t2) => {
526
528
  const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = K((e3, t3) => {
527
529
  const o3 = { variant: ut.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = L(H, { children: [z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle") }), z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear") }), z(ve, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply") })] });
528
530
  return Re({ ...e3, children: a3 });
529
531
  }, [r2, n2, a2]);
530
532
  return z(Pe, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Filter", tooltip: L(H, { children: [z("span", { children: "Organize your data so it's easier to analyze." }), z("br", {}), z("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: "FilterToggle", ...l2 });
531
- })), Uo = $(O((e2, t2) => {
533
+ })), _o = $(O((e2, t2) => {
532
534
  const { quickCommand: o2, icon: n2, isRedo: a2 = false, nestRedo: r2 = true, undoManager: l2, scope: i2, sx: s2, disabled: d2, commands: c2, ...m2 } = e2, p2 = [o2];
533
535
  !a2 && r2 && p2.push("redo");
534
536
  const u2 = pt(c2, p2), g2 = u2[0], h2 = u2[1], f2 = l2 ?? g2?.context?.()?.undoManager;
535
537
  let x2 = d2;
536
538
  d2 || (x2 = !g2 || g2.disabled(), h2 && !h2.disabled() && (x2 = false));
537
- const [b2, y2] = U(0), w2 = K((e3, t3) => {
539
+ const [b2, y2] = _(0), w2 = K((e3, t3) => {
538
540
  let o3 = 0 === b2 ? "Cancel" : `${g2.label()} ${b2} Action${1 === b2 ? "" : "s"}`, n3 = false;
539
541
  f2 || (n3 = true), n3 || (n3 = r2 ? !f2.hasRedo() && !f2.hasUndo() : !f2.hasRedo());
540
542
  const l3 = (e4) => {
541
543
  g2.execute(e4);
542
- }, i3 = z(Ae, { sx: { display: "flex", flex: "none", alignItems: "center", justifyContent: "center", padding: n3 ? void 0 : "0 0", minWidth: "180px" }, icon: z(xt, {}), onMouseEnter: () => {
544
+ }, i3 = z(Ie, { sx: { display: "flex", flex: "none", alignItems: "center", justifyContent: "center", padding: n3 ? void 0 : "0 0", minWidth: "180px" }, icon: z(xt, {}), onMouseEnter: () => {
543
545
  y2(0);
544
546
  }, onMouseDown: (e4) => {
545
547
  0 === e4.button && e4.preventDefault();
@@ -552,7 +554,7 @@ const Vo = $(O((e2, t2) => {
552
554
  const s3 = a2 ? f2?.getRedoDescriptions() : f2?.getUndoDescriptions(), d3 = [];
553
555
  for (let e4 = 0; e4 < s3.length; e4++) {
554
556
  const t4 = s3[e4];
555
- d3.push(z(Ae, { sx: { maxWidth: "360px", display: "flex" }, disabled: x2, selected: e4 < b2, icon: z(xt, {}), onMouseEnter: () => {
557
+ d3.push(z(Ie, { sx: { maxWidth: "360px", display: "flex" }, disabled: x2, selected: e4 < b2, icon: z(xt, {}), onMouseEnter: () => {
556
558
  y2(e4 + 1);
557
559
  }, onMouseDown: (e5) => {
558
560
  0 === e5.button && e5.preventDefault();
@@ -565,7 +567,7 @@ const Vo = $(O((e2, t2) => {
565
567
  let c3 = null;
566
568
  if (!a2 && r2) {
567
569
  const o4 = { scope: "undo", commands: t3, variant: ut.Menuitem, parentFloat: e3.floatReference };
568
- c3 = [], c3.push(z(Uo, { ...o4, quickCommand: "redo", isRedo: true }, "nested:redo")), f2.hasRedo() && f2.hasUndo() && c3.push(z(Te, { orientation: "horizontal" }, "action:redo-div"));
570
+ c3 = [], c3.push(z(_o, { ...o4, quickCommand: "redo", isRedo: true }, "nested:redo")), f2.hasRedo() && f2.hasUndo() && c3.push(z(Te, { orientation: "horizontal" }, "action:redo-div"));
569
571
  }
570
572
  const m3 = L(J, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
571
573
  e3.closeFloatAll();
@@ -575,8 +577,8 @@ const Vo = $(O((e2, t2) => {
575
577
  return Re({ ...e3, children: m3 });
576
578
  }, [g2?.context(), g2?.state(), i2, f2, b2, x2]);
577
579
  return z(Pe, { ref: t2, commands: c2, quickCommand: o2, scope: i2, disabled: x2, label: g2?.label() ?? (a2 ? "Redo" : "Undo"), tooltip: z(H, { children: z("span", { children: `${g2?.label() ?? "No"} last actions.` }) }), createPopupPanel: w2, icon: n2 ?? (a2 ? "Redo" : "Undo"), selected: false, ...m2 });
578
- })), jo = s.getFontList(), _o = /* @__PURE__ */ new Map();
579
- for (let e2 = 0; e2 < jo.length; e2++) _o.set(jo[e2].fontRef.getFamily(), jo[e2]);
580
+ })), Uo = s.getFontList(), jo = /* @__PURE__ */ new Map();
581
+ for (let e2 = 0; e2 < Uo.length; e2++) jo.set(Uo[e2].fontRef.getFamily(), Uo[e2]);
580
582
  const qo = $(O((e2, t2) => {
581
583
  const { command: o2, commandHook: n2, sx: a2, disabled: r2 = false, parentFloat: i2, icon: s2, label: d2, ...c2 } = e2;
582
584
  bt(o2);
@@ -584,12 +586,12 @@ const qo = $(O((e2, t2) => {
584
586
  const t3 = (e4) => {
585
587
  o2?.execute(e4, n2);
586
588
  }, a3 = [];
587
- for (let e4 = 0; e4 < jo.length; e4++) a3.push({ key: jo[e4].fontRef.getFamily(), description: jo[e4].fontRef.getFamily() });
588
- _o.get(m2) || a3.unshift({ key: m2, description: m2 });
589
+ for (let e4 = 0; e4 < Uo.length; e4++) a3.push({ key: Uo[e4].fontRef.getFamily(), description: Uo[e4].fontRef.getFamily() });
590
+ jo.get(m2) || a3.unshift({ key: m2, description: m2 });
589
591
  const l2 = [];
590
592
  for (let e4 = 0; e4 < a3.length; e4++) {
591
593
  const n3 = a3[e4].key === m2;
592
- l2.push(z(Ae, { sx: { display: "flex", paddingTop: "4px", paddingBottom: "4px" }, selected: n3, disabled: r2 || !o2 || o2.disabled(), icon: n3 ? z(Oe, {}) : void 0, onMouseUp: (o3) => {
594
+ l2.push(z(Ie, { sx: { display: "flex", paddingTop: "4px", paddingBottom: "4px" }, selected: n3, disabled: r2 || !o2 || o2.disabled(), icon: n3 ? z(Oe, {}) : void 0, onMouseUp: (o3) => {
593
595
  0 === o3.button && t3(a3[e4].key);
594
596
  }, onMouseDown: (e5) => {
595
597
  0 === e5.button && e5.preventDefault();
@@ -692,7 +694,7 @@ const qo = $(O((e2, t2) => {
692
694
  return z(Pe, { ref: t2, createPopupPanel: b2, outlined: m2, commands: o2, createTooltip: ({ children: e3 }, t3) => z(He, { label: n2?.label(), description: n2?.description(), disabled: t3, children: e3 }), selected: false, disabled: w2, label: n2?.label(), icon: S2, ...p2 });
693
695
  })), nn = "_sheetxl-reset_11z3j_1", an = 10, rn = $(O((e2, t2) => {
694
696
  const { styles: o2, table: n2, tableStyle: a2 = n2?.getStyle() ?? o2.getDefaultTableStyle(), bodyStyle: r2, sx: l2, disabled: i2, className: s2, forceThinBorder: d2, cellHeight: c2 = an, isLive: p2 = false, ...u2 } = e2, g2 = Math.ceil(1.3 * c2), [h2, f2] = Z((e3) => e3 + 1, 0);
695
- j(() => {
697
+ U(() => {
696
698
  if (p2 && n2) return n2.addListeners({ onAnyChange: () => {
697
699
  f2();
698
700
  } });
@@ -784,8 +786,8 @@ const qo = $(O((e2, t2) => {
784
786
  n2?.({ ...o2, showColumnStripes: !o2?.showColumnStripes });
785
787
  } }), label: "Banded Columns", labelPlacement: "end" }), d2 && z(ie, { control: z(se, { checked: s2 ?? false, indeterminate: null == s2, disabled: p2 || !o2 || null == s2, onChange: () => d2(!s2) }), label: "Filter Button", labelPlacement: "end" })] }) });
786
788
  })), pn = "_range-row_akhf4_1", un = "_action-row_akhf4_15", gn = $(O((e2, t2) => {
787
- const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 = Kt(), h2 = s2 && g2 ? g2.register(s2, d2) : null, [f2, x2] = U(""), [b2, y2] = U(""), [w2, S2] = U(i2);
788
- j(() => {
789
+ const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 = Kt(), h2 = s2 && g2 ? g2.register(s2, d2) : null, [f2, x2] = _(""), [b2, y2] = _(""), [w2, S2] = _(i2);
790
+ U(() => {
789
791
  S2(i2), y2("");
790
792
  }, [i2]);
791
793
  const k2 = gt((e3) => {
@@ -811,8 +813,8 @@ const qo = $(O((e2, t2) => {
811
813
  }));
812
814
  gn.displayName = "NamedInput";
813
815
  const hn = (e2) => null === e2 ? "" : e2.toString(), fn = $(O((e2, t2) => {
814
- const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 = Kt(), g2 = o2 && u2 ? u2.register(o2, n2) : null, [h2, f2] = U(""), [x2, b2] = U(false), [y2, w2] = U(() => hn(d2));
815
- j(() => {
816
+ const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 = Kt(), g2 = o2 && u2 ? u2.register(o2, n2) : null, [h2, f2] = _(""), [x2, b2] = _(false), [y2, w2] = _(() => hn(d2));
817
+ U(() => {
816
818
  w2(hn(d2)), f2(""), o2 && u2 && u2.clearErrors(o2), b2(false);
817
819
  }, [d2]);
818
820
  const S2 = gt((e3) => {
@@ -835,7 +837,7 @@ const hn = (e2) => null === e2 ? "" : e2.toString(), fn = $(O((e2, t2) => {
835
837
  g2?.onBlur(e3);
836
838
  }, [g2]), v2 = K((e3) => {
837
839
  S2(e3.target.value), g2?.onChange(e3);
838
- }, [g2]), [T2, R2] = U(false), P2 = V(() => z(me, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: z(Ue, { disabled: true, selected: T2, onSelectToggle: (e3) => {
840
+ }, [g2]), [T2, R2] = _(false), P2 = V(() => z(me, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: z(_e, { disabled: true, selected: T2, onSelectToggle: (e3) => {
839
841
  R2(e3);
840
842
  }, label: "Select Range", icon: z(xt, { iconKey: "SelectRangeMode" }) }) }), [T2]);
841
843
  return z(de, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...i2 }, size: "small", ref: t2, className: mt("range-input", l2), ...p2, children: z(ce, { label: "Range", placeholder: "Enter Range", onBlur: C2, disabled: a2, error: !!h2, inputRef: g2?.ref, helperText: h2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, slotProps: { input: { endAdornment: P2 }, inputLabel: { shrink: true }, htmlInput: { spellCheck: false, autoComplete: "off", readOnly: a2, name: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75) } } }, value: y2 ?? "", onChange: v2, onKeyDownCapture: k2, onContextMenu: (e3) => {
@@ -854,7 +856,7 @@ const bn = (e2) => {
854
856
  }
855
857
  return z(J, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: z(J, { sx: { display: "flex", boxShadow: (e4) => e4.shadows[2] }, children: e3 }) });
856
858
  }, [t2, s2]);
857
- return z(ze, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${a2 ? e3.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (e3) => `solid ${e3.palette.text.primary} 1px !important` } }, icon: null, ...i2, children: L(J, { sx: { border: (e3) => `solid ${e3.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (e3) => a2 ? e3.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (e3) => e3.palette.text.primary } }, children: [z(J, { sx: {}, children: t2.getName() }), L(J, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [d2, z(J, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => t2.getFontScheme().getMajorFont() }, children: z(Me, { disableInteractive: true, slotProps: { popper: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } } }, title: z("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
859
+ return z(ze, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${a2 ? e3.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (e3) => `solid ${e3.palette.text.primary} 1px !important` } }, icon: null, ...i2, children: L(J, { sx: { border: (e3) => `solid ${e3.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (e3) => a2 ? e3.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (e3) => e3.palette.text.primary } }, children: [z(J, { sx: {}, children: t2.getName() }), L(J, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [d2, z(J, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => t2.getFontScheme().getMajorFont() }, children: z(Fe, { disableInteractive: true, slotProps: { popper: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } } }, title: z("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
858
860
  The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: z("div", { children: t2.getFontScheme().getMinorFont() }) }) })] })] }) });
859
861
  }, yn = $(O((e2, t2) => {
860
862
  const { themes: o2, selectedTheme: n2, onSelectTheme: a2, sx: r2, disabled: l2 = false, darkMode: i2, ...s2 } = e2, d2 = V(() => {
@@ -883,12 +885,12 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
883
885
  }, [o2, n2, a2, c2, d2]), tooltip: l2 || i2 || "Theme", label: i2, icon: p2, ...m2 };
884
886
  return s2 === Ne.Toolbar ? z(Be, { ref: t2, ...u2 }) : z(Ee, { ref: t2, ...u2 });
885
887
  })), Sn = $(O((e2, t2) => {
886
- const { sheet: o2, className: a2, debounceDelay: r2 = 220, sx: i2, ...s2 } = e2, [d2, c2] = U(() => o2.getView().getZoomScale()), [m2, p2] = U(null), u2 = q(0);
888
+ const { sheet: o2, className: a2, debounceDelay: r2 = 220, sx: i2, ...s2 } = e2, [d2, c2] = _(() => o2.getView().getZoomScale()), [m2, p2] = _(null), u2 = q(0);
887
889
  w(o2, { onViewChange: () => {
888
890
  p2(true), 0 === u2.current && c2(o2.getView().getZoomScale());
889
- } }), j(() => {
891
+ } }), U(() => {
890
892
  u2.current = 0, p2(false), c2(o2.getView().getZoomScale());
891
- }, [o2]), j(() => {
893
+ }, [o2]), U(() => {
892
894
  0 !== u2.current && n.debounce(() => {
893
895
  d2 === u2.current && (u2.current = 0, o2.getView().update({ zoomScale: d2 }));
894
896
  }, r2)();
@@ -899,7 +901,7 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
899
901
  }, [o2]), h2 = (e3) => {
900
902
  let t3 = e3;
901
903
  return e3 < 100 ? t3 = 10 / 9 * (e3 - 10) : e3 > 100 && (t3 = (e3 + 200) / 3), t3;
902
- }, f2 = h2(d2), [x2, b2] = U(null), y2 = q(null), S2 = K(() => {
904
+ }, f2 = h2(d2), [x2, b2] = _(null), y2 = q(null), S2 = K(() => {
903
905
  const e3 = x2;
904
906
  e3 && requestAnimationFrame(() => {
905
907
  y2.current?.contains(document.activeElement) && e3.focus();
@@ -915,15 +917,15 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
915
917
  0 === e3.button && e3.preventDefault();
916
918
  }, onMouseUp: (e3) => {
917
919
  0 === e3.button && S2();
918
- }, ...s2, children: [z(Me, { disableInteractive: true, title: "Zoom Out", children: z(te, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
920
+ }, ...s2, children: [z(Fe, { disableInteractive: true, title: "Zoom Out", children: z(te, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
919
921
  0 !== e3.button ? e3.preventDefault() : k2(e3);
920
- }, children: z(xt, { iconKey: "Remove" }) }) }), z(pe, { ref: y2, sx: { flex: "1 1 100%", padding: "6px 0px !important", marginRight: "2px", marginLeft: "2px", "& .MuiSlider-thumb": { height: 14, width: 6, borderRadius: 0.75, "&.Mui-focusVisible": { boxShadow: (e3) => `0px 0px 0px 3px ${je(e3.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (e3) => `0px 0px 0px 2px ${je(e3.palette.primary.main, 0.16)}` } }, "& .MuiSlider-mark": { width: "1px", height: "8px" }, "& .MuiSlider-markActive": { backgroundColor: "currentColor" }, "& .MuiSlider-thumb:not(.MuiSlider-active)": { transition: m2 ? "left 260ms ease-in" : "none" } }, valueLabelDisplay: "auto", size: "small", track: false, min: 0, step: 1, value: f2, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => p2(false), onWheel: (e3) => {
922
+ }, children: z(xt, { iconKey: "Remove" }) }) }), z(pe, { ref: y2, sx: { flex: "1 1 100%", padding: "6px 0px !important", marginRight: "2px", marginLeft: "2px", "& .MuiSlider-thumb": { height: 14, width: 6, borderRadius: 0.75, "&.Mui-focusVisible": { boxShadow: (e3) => `0px 0px 0px 3px ${Ue(e3.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (e3) => `0px 0px 0px 2px ${Ue(e3.palette.primary.main, 0.16)}` } }, "& .MuiSlider-mark": { width: "1px", height: "8px" }, "& .MuiSlider-markActive": { backgroundColor: "currentColor" }, "& .MuiSlider-thumb:not(.MuiSlider-active)": { transition: m2 ? "left 260ms ease-in" : "none" } }, valueLabelDisplay: "auto", size: "small", track: false, min: 0, step: 1, value: f2, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => p2(false), onWheel: (e3) => {
921
923
  g2(h2(n.findNextStep(o2.getView().getZoomScale(), e3.deltaY < 0, 10)));
922
924
  }, onKeyDown: (e3) => {
923
925
  e3.which === ft.Down || e3.which === ft.Right ? (g2(h2(n.findNextStep(o2.getView().getZoomScale(), true, 10))), e3.preventDefault()) : e3.which === ft.Up || e3.which === ft.Left ? (g2(h2(n.findNextStep(o2.getView().getZoomScale(), false, 10))), e3.preventDefault()) : e3.which !== ft.Enter && e3.which !== ft.Escape || S2();
924
926
  }, onChange: (e3, t3) => {
925
927
  Math.abs(t3 - 100) < 3 ? g2(100) : g2(t3);
926
- }, valueLabelFormat: (e3, t3) => `Zoom: ${Math.round(d2)}%` }), z(Me, { disableInteractive: true, title: "Zoom In", children: z(te, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
928
+ }, valueLabelFormat: (e3, t3) => `Zoom: ${Math.round(d2)}%` }), z(Fe, { disableInteractive: true, title: "Zoom In", children: z(te, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
927
929
  0 !== e3.button ? e3.preventDefault() : C2(e3);
928
930
  }, children: z(xt, { iconKey: "Add" }) }) }), L(J, { sx: { display: "flex", flexDirection: "row" }, children: [z(J, { sx: { minWidth: "8px" } }), z(ee, { noWrap: true, component: "div", onClick: () => {
929
931
  g2(100);
@@ -934,7 +936,7 @@ const kn = $(O((e2, t2) => {
934
936
  const { sx: o2, sheet: n2, gridStyle: a2, children: r2, childrenEnd: l2, ...i2 } = e2;
935
937
  Y(t2, () => ({}));
936
938
  const s2 = q(null);
937
- j(() => {
939
+ U(() => {
938
940
  const e3 = (e4) => e4.preventDefault();
939
941
  return s2.current?.addEventListener("wheel", e3, { passive: false }), () => {
940
942
  s2.current?.removeEventListener("wheel", e3);
@@ -943,12 +945,12 @@ const kn = $(O((e2, t2) => {
943
945
  const d2 = wt(), c2 = V(() => {
944
946
  const e3 = d2.getMode();
945
947
  return e3?.description ? e3.description : "Ready";
946
- }, [d2]), [m2, p2] = U(false);
948
+ }, [d2]), [m2, p2] = _(false);
947
949
  return L(J, { ref: s2, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: m2 ? "visible" : "hidden", boxShadow: `0px -1px 0px ${a2.header.edgeStrokeFill}`, ...o2 }, onMouseOver: () => p2(true), onMouseLeave: () => p2(false), ...i2, children: [r2, z("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: c2 }) }), l2 ? z(J, { sx: { display: "flex", alignItems: "center" }, children: l2 }) : null, z(Te, { style: { marginTop: "6px", marginBottom: "6px" } }), z(Sn, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: n2 })] });
948
950
  }));
949
951
  kn.displayName = "StatusBar";
950
952
  const Cn = $(O((e2, t2) => {
951
- const { disabled: o2, names: a2, workbook: r2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2, ...p2 } = e2, g2 = St(), [h2, f2] = U(null), [x2, b2] = U(() => r2.getSelectedRanges().getCoords()), [y2, S2] = U(false), { reference: k2 } = _e({ parentFloat: c2?.parentFloat }), [C2, v2] = U(() => s2 || !r2.getProtection().isStructureAllowed()), T2 = () => h2?.text ?? "", [R2, P2] = U(T2), D2 = gt(() => {
953
+ const { disabled: o2, names: a2, workbook: r2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2, ...p2 } = e2, g2 = St(), [h2, f2] = _(null), [x2, b2] = _(() => r2.getSelectedRanges().getCoords()), [y2, S2] = _(false), { reference: k2 } = je({ parentFloat: c2?.parentFloat }), [C2, v2] = _(() => s2 || !r2.getProtection().isStructureAllowed()), T2 = () => h2?.text ?? "", [R2, P2] = _(T2), D2 = gt(() => {
952
954
  if (k2?.closeAll(), !R2) {
953
955
  const e4 = T2();
954
956
  return P2(T2()), e4;
@@ -980,7 +982,7 @@ const Cn = $(O((e2, t2) => {
980
982
  P2(T2()), g2.showMessage?.(e4.message, { type: kt.Error });
981
983
  }
982
984
  return null;
983
- }, [R2, a2, k2, C2, g2]), M2 = gt(() => {
985
+ }, [R2, a2, k2, C2, g2]), F2 = gt(() => {
984
986
  if (r2.isClosed()) return;
985
987
  const e3 = [];
986
988
  for (let t4 = 0; t4 < x2.length; t4++) {
@@ -994,15 +996,15 @@ const Cn = $(O((e2, t2) => {
994
996
  }
995
997
  let o3 = null;
996
998
  o3 = t3?.length > 0 ? t3[0].getName() : r2.getSelectedSheet().getSelectedRange().toString(), f2({ text: o3 });
997
- }, [r2, x2]), [F2, N2] = U(() => a2?.getItems() ?? null);
999
+ }, [r2, x2]), [M2, N2] = _(() => a2?.getItems() ?? null);
998
1000
  w(a2, { onCollectionChange(e3) {
999
- N2(a2.getItems()), M2();
1001
+ N2(a2.getItems()), F2();
1000
1002
  }, onClose(e3) {
1001
1003
  N2([]);
1002
- } }), j(() => {
1004
+ } }), U(() => {
1003
1005
  P2(T2());
1004
1006
  }, [h2, x2]);
1005
- const [B2, E2] = U(r2?.getSelectedSheet());
1007
+ const [B2, E2] = _(r2?.getSelectedSheet());
1006
1008
  w(r2, { onProtectionChange: (e3) => {
1007
1009
  v2(s2 || !e3.getProtection().isStructureAllowed());
1008
1010
  }, onSheetsChange: (e3) => {
@@ -1010,22 +1012,22 @@ const Cn = $(O((e2, t2) => {
1010
1012
  }, onViewChange(e3) {
1011
1013
  E2(e3?.getSelectedSheet());
1012
1014
  } });
1013
- const [A2, I2] = U(null), W2 = gt(n.debounce(M2, A2 ? 320 : 0), []);
1015
+ const [I2, A2] = _(null), W2 = gt(n.debounce(F2, I2 ? 320 : 0), []);
1014
1016
  w(B2.getSelection(), { onChange: () => {
1015
1017
  b2((e3) => {
1016
1018
  const t3 = r2.getSelectedRanges().getCoords();
1017
1019
  return u.isEqualRangesArrays(t3, e3) ? e3 : t3;
1018
1020
  });
1019
1021
  }, onAdjustingChange: (e3) => {
1020
- I2(e3.getAdjusting());
1021
- } }), j(() => {
1022
- if (A2) {
1022
+ A2(e3.getAdjusting());
1023
+ } }), U(() => {
1024
+ if (I2) {
1023
1025
  const e3 = r2.getSelectedRange(), t3 = e3.getRowCount(), o3 = e3.getColumnCount();
1024
1026
  let n2 = `${t3}R x ${o3}C`;
1025
1027
  if (n2.length > 17 && (n2 = `${t3}x${o3}`), t3 > 1 || o3 > 1) return void f2({ text: n2, fontStyle: "italic", justifyContent: "center" });
1026
1028
  }
1027
1029
  f2({ text: r2.getSelectedSheet().getSelectedRange().toString() }), W2();
1028
- }, [x2, r2, A2]);
1030
+ }, [x2, r2, I2]);
1029
1031
  const $2 = q(null), O2 = K((e3) => {
1030
1032
  const { onMouseDown: t3, onMouseUp: o3, ...n2 } = e3;
1031
1033
  return z(te, { ...n2, sx: { ...n2?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: true, children: z(le, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: false, spellCheck: false, autoComplete: "off", ref: $2 }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.text.icon ?? e4.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, "::after": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", height: "1rem", fontSize: 11 * l.getDeviceScale(), fontStyle: h2?.fontStyle, paddingLeft: (e4) => e4.spacing(0.75), paddingRight: (e4) => e4.spacing(0.75), boxShadow: "none", flex: "1", color: (e4) => e4.palette.text.secondary, input: { padding: "0", height: "1rem", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary } } }, value: R2, onFocus: (e4) => {
@@ -1067,68 +1069,71 @@ const Cn = $(O((e2, t2) => {
1067
1069
  }
1068
1070
  const m3 = L(J, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...p2, children: [C2 ? null : z(ve, { ...t3, scope: "namedItem", command: c2?.commands.getCommand("addNamedReference") }), i3 && i3.length > 0 ? L(H, { children: [C2 ? null : z(Te, { orientation: "horizontal" }), z(J, { sx: { overflow: "auto", flex: "1 1 100%" }, children: i3 })] }) : null] });
1069
1071
  return Re({ ...e3, children: m3 });
1070
- }, [r2, F2, a2, h2, C2]), _2 = Ct(t2, () => ({ focus(e3) {
1072
+ }, [r2, M2, a2, h2, C2]), j2 = Ct(t2, () => ({ focus(e3) {
1071
1073
  $2.current?.focus(e3);
1072
1074
  } }), []);
1073
- return z(J, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...m2 }, ref: Ut([_2, t2]), ...p2, children: z(Be, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%" }, ...m2 }, buttonProps: { sx: { backgroundColor: (e3) => e3.palette.background.paper, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` } }, tabIndex: -1, outlined: { color: (e3) => o2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2) }, parentFloat: k2, createPopupPanel: G2, onPopupOpen: () => S2(true), onPopupClose: () => S2(false), createTooltip: ({ children: e3 }, t3) => z(He, { title: t3 || y2 ? "" : "Name Box", disabled: t3, leaveDelay: 0, sx: { opacity: t3 || y2 ? 0 : 1 }, children: e3 }), createQuickButton: O2 }) });
1075
+ return z(J, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...m2 }, ref: _t([j2, t2]), ...p2, children: z(Be, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%" }, ...m2 }, buttonProps: { sx: { backgroundColor: (e3) => e3.palette.background.paper, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` } }, tabIndex: -1, outlined: { color: (e3) => o2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2) }, parentFloat: k2, createPopupPanel: G2, onPopupOpen: () => S2(true), onPopupClose: () => S2(false), createTooltip: ({ children: e3 }, t3) => z(He, { title: t3 || y2 ? "" : "Name Box", disabled: t3, leaveDelay: 0, sx: { opacity: t3 || y2 ? 0 : 1 }, children: e3 }), createQuickButton: O2 }) });
1074
1076
  }));
1075
1077
  Cn.displayName = "NamedCollectionEditor";
1076
1078
  const vn = (e2, t2) => z(Cn, { ref: t2, ...e2 }), Tn = $(O((e2, t2) => {
1077
- const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: r2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 = vn, disabled: c2, commands: m2, ...p2 } = e2, [u2, g2] = U(n2?.getSelectedSheet());
1079
+ const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: r2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 = vn, disabled: c2, commands: m2, ...p2 } = e2, [u2, g2] = _(n2?.getSelectedSheet()), [h2, f2] = _(u2.getSelectedCell().getCoords()), [x2, b2] = _(false), y2 = c2 || x2;
1078
1080
  w(n2, { onSheetsChange: (e3) => {
1079
- g2(e3?.getSelectedSheet());
1081
+ const t3 = e3?.getSelectedSheet();
1082
+ f2(t3.getSelectedCell().getCoords()), g2(t3);
1080
1083
  }, onViewChange(e3) {
1081
- g2(e3?.getSelectedSheet());
1084
+ const t3 = e3?.getSelectedSheet();
1085
+ f2(t3.getSelectedCell().getCoords()), g2(t3);
1082
1086
  } });
1083
- const [h2, f2] = U(u2.getSelection().getCoords().cell), x2 = u2.getRange(h2).getCell(), b2 = c2 || !x2.isEditAllowed(), y2 = q(null), C2 = V(() => ({ fontSize: 11 }), []);
1087
+ const C2 = q(null), v2 = V(() => ({ fontSize: 11 }), []);
1084
1088
  w(u2.getSelection(), { onChange: () => {
1085
- f2(u2.getSelection().getCoords().cell);
1089
+ const e3 = u2.getSelectedCell();
1090
+ b2(!e3.isEditAllowed()), f2(e3.getCoords());
1086
1091
  } }), w(u2, { onProtectionChange() {
1087
- f2(u2.getSelection().getCoords().cell);
1092
+ b2(!u2.getSelectedCell().isEditAllowed());
1088
1093
  } });
1089
- const v2 = y2.current?.getLineHeight() ?? 20, [T2, R2] = U(v2), [P2, D2] = U(5), [M2, F2] = U(1), N2 = gt((e3, { size: t3 }) => {
1094
+ const T2 = C2.current?.getLineHeight() ?? 20, [R2, P2] = _(T2), [D2, F2] = _(5), [M2, N2] = _(1), B2 = gt((e3, { size: t3 }) => {
1090
1095
  e3.preventDefault(), e3.stopPropagation();
1091
- const o3 = Math.floor(t3.height / v2);
1092
- R2(o3 * v2 + 1), o3 > 1 && D2(o3);
1093
- }, [v2]), B2 = gt((e3, { size: t3 }) => {
1094
- const o3 = Math.floor(t3.height / v2);
1095
- F2(o3);
1096
- }, [v2]), E2 = wt(), A2 = E2.getMode();
1097
- let I2 = null;
1098
- "edit" === A2?.key && (I2 = A2.args?.stateAndCoords);
1099
- const W2 = V(() => {
1100
- let e3 = I2?.editState;
1101
- return e3 || (e3 = S(() => u2.getRange(h2).getCell())), z(J, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: z(k, { ref: y2, activeCoords: h2, sheet: u2, onFocus: () => {
1096
+ const o3 = Math.floor(t3.height / T2);
1097
+ P2(o3 * T2 + 1), o3 > 1 && F2(o3);
1098
+ }, [T2]), E2 = gt((e3, { size: t3 }) => {
1099
+ const o3 = Math.floor(t3.height / T2);
1100
+ N2(o3);
1101
+ }, [T2]), I2 = wt(), A2 = I2.getMode();
1102
+ let W2 = null;
1103
+ "edit" === A2?.key && (W2 = A2.args?.stateAndCoords);
1104
+ const $2 = V(() => {
1105
+ let e3 = W2?.editState;
1106
+ return e3 || (e3 = S(() => u2.getRange(h2).getCell())), z(J, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: z(k, { ref: C2, activeCoords: h2, sheet: u2, onFocus: () => {
1102
1107
  a2?.startEdit({ autoFocus: false, editMode: true, cell: h2 });
1103
- }, defaultTextStyle: C2, useRichStyling: false, disabled: b2, onChangeEdit: (e4) => {
1108
+ }, defaultTextStyle: v2, useRichStyling: false, disabled: y2, onChangeEdit: (e4) => {
1104
1109
  if (void 0 !== e4.dirty) {
1105
1110
  const t3 = { sheet: u2, coords: h2, editState: e4 };
1106
- E2.setMode((e5) => ({ ...e5, args: { ...e5?.args, stateAndCoords: t3 } }));
1111
+ I2.setMode((e5) => ({ ...e5, args: { ...e5?.args, stateAndCoords: t3 } }));
1107
1112
  }
1108
1113
  }, editState: e3, commands: m2, onCancelEdit: () => {
1109
1114
  a2?.cancelEdit(), a2?.focus();
1110
1115
  }, onSubmitEdit: () => {
1111
1116
  a2?.submitEdit(), a2?.focus();
1112
1117
  }, linesVisible: M2 }) });
1113
- }, [u2, I2, h2, M2, a2]), $2 = q(null), O2 = V(() => i2 ? d2({ names: n2.getNames(), workbook: n2, ...s2 }, $2) : null, [d2, s2, i2, u2, n2, b2]), K2 = V(() => L(ue, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2)} 1px` }, children: [z(ze, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "warning", "aria-label": "cancel-formula-edit", icon: z(xt, { iconKey: "CloseError" }), tooltipProps: { label: "Cancel", simple: true }, disabled: b2 || null === I2, onMouseDown: (e3) => {
1118
+ }, [u2, W2, h2, M2, a2]), O2 = q(null), K2 = V(() => i2 ? d2({ names: n2.getNames(), workbook: n2, ...s2 }, O2) : null, [d2, s2, i2, u2, n2, y2]), G2 = V(() => L(ue, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, border: (e3) => `solid ${y2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2)} 1px` }, children: [z(ze, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "warning", "aria-label": "cancel-formula-edit", icon: z(xt, { iconKey: "CloseError" }), tooltipProps: { label: "Cancel", simple: true }, disabled: y2 || null === W2, onMouseDown: (e3) => {
1114
1119
  0 === e3.button && e3.preventDefault();
1115
1120
  }, onClick: () => {
1116
1121
  a2.cancelEdit();
1117
- } }), z(ze, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "primary", "aria-label": "commit-formula-edit", icon: z(xt, { iconKey: "CheckSuccess" }), tooltipProps: { label: "Enter", simple: true }, disabled: b2 || null === I2, onMouseDown: (e3) => {
1122
+ } }), z(ze, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "primary", "aria-label": "commit-formula-edit", icon: z(xt, { iconKey: "CheckSuccess" }), tooltipProps: { label: "Enter", simple: true }, disabled: y2 || null === W2, onMouseDown: (e3) => {
1118
1123
  0 === e3.button && e3.preventDefault();
1119
1124
  }, onClick: () => {
1120
1125
  a2.submitEdit();
1121
1126
  } }), z(ze, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, disabled: true, "aria-label": "commit-formula-function", icon: z(xt, { iconKey: "Function", style: { transform: "scale(0.85)" } }), tooltipProps: { label: "Insert Function", simple: true }, onMouseDown: (e3) => {
1122
1127
  0 === e3.button && e3.preventDefault();
1123
- } })] }), [b2, I2]), G2 = zt(), [j2, _2] = U(false), X2 = V(() => L(J, { className: "formula-bar", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (e3) => e3.spacing(0.5), alignItems: "start" }, children: [K2, L(ue, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (e3) => e3.typography.fontFamily, fontSize: 11 * l.getDeviceScale(), alignItems: "stretch", paddingTop: "2px", paddingBottom: "2px", boxShadow: "none", borderRadius: (e3) => `${e3.shape.borderRadius}px`, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2)} 1px`, "& textarea": { color: (e3) => b2 ? `${e3.palette.text.disabled} !important` : e3.palette.text.primary }, "& .react-resizable-handle": { width: "100%", height: "8px", backgroundColor: "transparent", boxSizing: "content-box", zIndex: 1e3 }, "& .react-resizable-handle-s": { position: "absolute", bottom: "-10px", cursor: "s-resize" } }, onFocus: () => _2(true), onBlur: () => _2(false), onMouseDown: (e3) => {
1128
+ } })] }), [y2, W2]), U2 = zt(), [j2, X2] = _(false), Z2 = V(() => L(J, { className: "formula-bar", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (e3) => e3.spacing(0.5), alignItems: "start" }, children: [G2, L(ue, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (e3) => e3.typography.fontFamily, fontSize: 11 * l.getDeviceScale(), alignItems: "stretch", paddingTop: "2px", paddingBottom: "2px", boxShadow: "none", borderRadius: (e3) => `${e3.shape.borderRadius}px`, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, border: (e3) => `solid ${y2 ? e3.palette.action.disabled : Wt(e3.palette.divider, 0.2)} 1px`, "& textarea": { color: (e3) => y2 ? `${e3.palette.text.disabled} !important` : e3.palette.text.primary }, "& .react-resizable-handle": { width: "100%", height: "8px", backgroundColor: "transparent", boxSizing: "content-box", zIndex: 1e3 }, "& .react-resizable-handle-s": { position: "absolute", bottom: "-10px", cursor: "s-resize" } }, onFocus: () => X2(true), onBlur: () => X2(false), onMouseDown: (e3) => {
1124
1129
  e3.target?.classList.contains("react-resizable-handle") && e3.preventDefault();
1125
- }, children: [z(J, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignItems: "center", marginTop: "0px", paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }, children: z(Gt, { height: T2, draggableOpts: { grid: [v2, v2] }, minConstraints: [v2, v2], maxConstraints: [15 * v2, 15 * v2], onResize: B2, onResizeStop: N2, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: W2 }) }), z(ze, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, "aria-label": "toggle-expand-formula-edit", icon: z(xt, { iconKey: M2 > 1 ? "ExpandLess" : "ExpandMore" }), tooltipProps: { label: (M2 > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: true }, onMouseDown: (e3) => {
1130
+ }, children: [z(J, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignItems: "center", marginTop: "0px", paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }, children: z(Gt, { height: R2, draggableOpts: { grid: [T2, T2] }, minConstraints: [T2, T2], maxConstraints: [15 * T2, 15 * T2], onResize: E2, onResizeStop: B2, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: $2 }) }), z(ze, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, "aria-label": "toggle-expand-formula-edit", icon: z(xt, { iconKey: M2 > 1 ? "ExpandLess" : "ExpandMore" }), tooltipProps: { label: (M2 > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: true }, onMouseDown: (e3) => {
1126
1131
  0 === e3.button && e3.preventDefault();
1127
1132
  }, onClick: () => {
1128
- const e3 = M2 > 1 ? 1 : P2;
1129
- R2(e3 * v2 + 1), F2(e3);
1130
- } }), z(J, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: j2 ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (e3) => e3.palette.primary.main, borderRadius: (e3) => `${e3.shape.borderRadius}px` } })] })] }), [K2, W2, j2, M2, v2]), Z2 = V(() => O2 || X2 ? !O2 && X2 ? X2 : O2 && !X2 ? O2 : z(H, { children: z(vt, { fixedPane: "before", minBefore: "165px", minAfter: "200px", paneBeforeProps: { style: { alignItems: "flex-start" } }, paneAfterProps: { style: { overflow: "visible" } }, resizerProps: { style: { backgroundImage: `url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${G2.palette.text.icon ?? G2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-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.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-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 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center calc(((var(--icon-size, 24) - 13px + 5px) / 2))", minWidth: "18px", marginRight: "1px" } }, elementBefore: O2, elementAfter: X2 }) }) : null, [O2, X2]), Y2 = Ct(t2, () => ({ isFormulaBarElement: () => true, getNamedCollectionEditorElement: () => $2.current }), []);
1131
- return z(J, { sx: { display: "flex", flexDirection: "row", gap: (e3) => e3.spacing(0.5), ...o2 }, ref: Y2, ...p2, children: Z2 });
1133
+ const e3 = M2 > 1 ? 1 : D2;
1134
+ P2(e3 * T2 + 1), N2(e3);
1135
+ } }), z(J, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: j2 ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (e3) => e3.palette.primary.main, borderRadius: (e3) => `${e3.shape.borderRadius}px` } })] })] }), [G2, $2, j2, M2, T2]), Y2 = V(() => K2 || Z2 ? !K2 && Z2 ? Z2 : K2 && !Z2 ? K2 : z(H, { children: z(vt, { fixedPane: "before", minBefore: "165px", minAfter: "200px", paneBeforeProps: { style: { alignItems: "flex-start" } }, paneAfterProps: { style: { overflow: "visible" } }, resizerProps: { style: { backgroundImage: `url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${U2.palette.text.icon ?? U2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-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.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-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 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center calc(((var(--icon-size, 24) - 13px + 5px) / 2))", minWidth: "18px", marginRight: "1px" } }, elementBefore: K2, elementAfter: Z2 }) }) : null, [K2, Z2]), Q2 = Ct(t2, () => ({ isFormulaBarElement: () => true, getNamedCollectionEditorElement: () => O2.current }), []);
1136
+ return z(J, { sx: { display: "flex", flexDirection: "row", gap: (e3) => e3.spacing(0.5), ...o2 }, ref: Q2, ...p2, children: Y2 });
1132
1137
  }));
1133
1138
  Tn.displayName = "FormulaBar";
1134
1139
  const Rn = $(O((e2, t2) => {
@@ -1145,7 +1150,7 @@ const Pn = $(O((e2, t2) => {
1145
1150
  }));
1146
1151
  Pn.displayName = "Filters";
1147
1152
  const Dn = $(O((e2, t2) => {
1148
- const { children: o2, sheet: n2, style: a2, className: r2, value: l2, index: i2, editing: s2, editable: d2, disabled: c2, selectedIndex: m2, dragging: p2, borderColor: u2, borderWidth: g2, activeColor: h2, background: f2 = "white", tabRadius: x2 = 4, gridTheme: b2, ...y2 } = e2, [S2, k2] = U(() => !!n2 && n2.getProtection().isLocked()), [C2, v2] = U(() => n2 ? n2.getTabColor() : null);
1153
+ const { children: o2, sheet: n2, style: a2, className: r2, value: l2, index: i2, editing: s2, editable: d2, disabled: c2, selectedIndex: m2, dragging: p2, borderColor: u2, borderWidth: g2, activeColor: h2, background: f2 = "white", tabRadius: x2 = 4, gridTheme: b2, ...y2 } = e2, [S2, k2] = _(() => !!n2 && n2.getProtection().isLocked()), [C2, v2] = _(() => n2 ? n2.getTabColor() : null);
1149
1154
  w(n2, { onProtectionChange: () => {
1150
1155
  k2(n2.getProtection().isLocked());
1151
1156
  }, onTabColorChange: () => {
@@ -1159,21 +1164,21 @@ const Dn = $(O((e2, t2) => {
1159
1164
  let e3 = f2;
1160
1165
  C2 ? (D2 = C2.toBlackOrWhite().toCSS(), e3 = C2?.toCSS()) : R2 || (e3 = T2.palette.background.paper), P2 = z(J, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: R2 ? "50%" : "100%", borderRadius: "4px", border: (e4) => R2 ? `${f2} solid 1px` : `${e4.palette.divider} solid 1px`, background: R2 && C2 ? `linear-gradient(0deg, ${e3} 0%, transparent)` : e3 } });
1161
1166
  }
1162
- let M2 = null;
1163
- "string" == typeof u2 ? M2 = u2 : u2?.toCSS && (M2 = u2.toCSS());
1164
- const F2 = R2 ? z(J, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (e3) => e3.palette.primary.main } }) : null;
1165
- return z(Ot, { theme: R2 ? b2 ?? T2 : T2, children: z(J, { ref: t2, className: mt(r2), sx: { ...a2, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: R2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p2 ? "grabbing" : void 0 }, ...y2, children: z(Tt, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: x2, strokeColor: R2 ? M2 : "transparent", children: z(ae, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: R2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p2 ? "grabbing" : void 0, color: R2 ? "primary" : D2 || "text.secondary", backgroundColor: R2 ? f2 : "transparent", "&:hover:not([disabled])": { backgroundColor: R2 ? f2 : "transparent" }, "& input": { color: (e3) => `${e3.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: c2, disableRipple: s2, component: "div", children: L(H, { children: [P2, L(J, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [L(J, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: R2 ? void 0 : "1px" }, children: [o2, F2] }), S2 ? z(xt, { iconKey: "Lock", style: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : z(J, { sx: { minHeight: "22px" } })] })] }) }, l2 + ":" + i2) }) }) });
1167
+ let F2 = null;
1168
+ "string" == typeof u2 ? F2 = u2 : u2?.toCSS && (F2 = u2.toCSS());
1169
+ const M2 = R2 ? z(J, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (e3) => e3.palette.primary.main } }) : null;
1170
+ return z(Ot, { theme: R2 ? b2 ?? T2 : T2, children: z(J, { ref: t2, className: mt(r2), sx: { ...a2, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: R2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p2 ? "grabbing" : void 0 }, ...y2, children: z(Tt, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: x2, strokeColor: R2 ? F2 : "transparent", children: z(ae, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: R2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p2 ? "grabbing" : void 0, color: R2 ? "primary" : D2 || "text.secondary", backgroundColor: R2 ? f2 : "transparent", "&:hover:not([disabled])": { backgroundColor: R2 ? f2 : "transparent" }, "& input": { color: (e3) => `${e3.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: c2, disableRipple: s2, component: "div", children: L(H, { children: [P2, L(J, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [L(J, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: R2 ? void 0 : "1px" }, children: [o2, M2] }), S2 ? z(xt, { iconKey: "Lock", style: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : z(J, { sx: { minHeight: "22px" } })] })] }) }, l2 + ":" + i2) }) }) });
1166
1171
  }));
1167
1172
  Dn.displayName = "SheetTab";
1168
- const Mn = $(O((e2, t2) => {
1169
- const { workbook: o2, index: n2, commands: a2, scope: r2 = "sheet", disabled: l2, floatReference: i2, sx: s2, className: d2, tabStripRef: c2, ...m2 } = e2, [p2, u2] = U(o2?.getProtection());
1173
+ const Fn = $(O((e2, t2) => {
1174
+ const { workbook: o2, index: n2, commands: a2, scope: r2 = "sheet", disabled: l2, floatReference: i2, sx: s2, className: d2, tabStripRef: c2, ...m2 } = e2, [p2, u2] = _(o2?.getProtection());
1170
1175
  w(o2, { onProtectionChange: (e3) => {
1171
1176
  u2(e3?.getProtection());
1172
1177
  } });
1173
1178
  const g2 = V(() => ({}), []), h2 = V(() => ({ commandHook: { beforeExecute: (e3, t3) => i2.closeAll(), onExecute() {
1174
1179
  }, onError() {
1175
1180
  console.log("onError");
1176
- } }, scope: r2, commandState: n2, disabled: l2 || void 0 === n2, parentFloat: i2 }), [l2, i2]), f2 = V(() => ({ ...g2, ...h2 }), [g2, h2]), x2 = L(H, { children: [z(ve, { command: a2.getCommand("addSheet"), commandState: n2, ...f2, variant: ut.Menuitem }), z(ve, { command: a2.getCommand("deleteSheet"), ...f2, variant: ut.Menuitem }), L(Ae, { onMouseDown: (e3) => {
1181
+ } }, scope: r2, commandState: n2, disabled: l2 || void 0 === n2, parentFloat: i2 }), [l2, i2]), f2 = V(() => ({ ...g2, ...h2 }), [g2, h2]), x2 = L(H, { children: [z(ve, { command: a2.getCommand("addSheet"), commandState: n2, ...f2, variant: ut.Menuitem }), z(ve, { command: a2.getCommand("deleteSheet"), ...f2, variant: ut.Menuitem }), L(Ie, { onMouseDown: (e3) => {
1177
1182
  0 === e3.button && e3.preventDefault();
1178
1183
  }, onMouseUp: () => {
1179
1184
  Promise.resolve(i2.closeAll()).then(() => {
@@ -1182,9 +1187,9 @@ const Mn = $(O((e2, t2) => {
1182
1187
  }, disabled: l2 || !p2.isStructureAllowed(), parentFloat: i2, children: ["Rename", "sheet" !== r2 ? " Sheet" : ""] }), z(ve, { command: a2.getCommand("duplicateSheet"), ...f2, variant: ut.Menuitem }), z(ve, { command: a2?.getCommand("protectionSheetToggle"), ...f2, variant: ut.Menuitem }), z(Oo, { variant: ut.Menuitem, command: a2.getCommand("formatSheetTabColor"), icon: z(xt, { iconKey: "stroke.colored" }), panelProps: { disableAlpha: true, autoColorLabel: "No Tab Color", autoColorPosition: mo.End }, parentFloat: i2 }), z(Te, { orientation: "horizontal" }), z(ve, { command: a2.getCommand("hideSheet"), ...f2, variant: ut.Menuitem })] });
1183
1188
  return z(J, { ref: t2, className: mt("menu", d2), sx: { ...s2 }, ...m2, children: x2 });
1184
1189
  }));
1185
- Mn.displayName = "SheetTabMenu";
1186
- const Fn = $(O((e2, t2) => {
1187
- const { workbook: o2, gridStyle: n2, floatReference: a2, closeFloatAll: r2, className: l2, ...i2 } = e2, [s2, d2] = U(o2?.getSheets().getItems()), [c2, m2] = U(o2?.getProtection());
1190
+ Fn.displayName = "SheetTabMenu";
1191
+ const Mn = $(O((e2, t2) => {
1192
+ const { workbook: o2, gridStyle: n2, floatReference: a2, closeFloatAll: r2, className: l2, ...i2 } = e2, [s2, d2] = _(o2?.getSheets().getItems()), [c2, m2] = _(o2?.getProtection());
1188
1193
  w(o2, { onSheetsChange: (e3) => {
1189
1194
  d2(e3.getSheets().getItems());
1190
1195
  }, onProtectionChange: (e3) => {
@@ -1199,7 +1204,7 @@ const Fn = $(O((e2, t2) => {
1199
1204
  let u2 = null, h2 = null, f2 = p3;
1200
1205
  m3 && (f2 = m3.toCSS(), s3 || (h2 = m3.toBlackOrWhite().toCSS()), u2 = z(J, { sx: { position: "absolute", display: "flex", flexDirection: "column", top: "4px", left: "40px", right: "8px", bottom: "4px", background: s3 ? f2 : "transparent", borderRadius: "4px", border: `solid 1px ${n2.header.edgeStrokeFill}` }, children: z(J, { sx: { flex: "1 1 100%", boxSizing: "content-box", opacity: s3 || i3 === g.Visibility.Hidden ? "50%" : "100%", border: (e4) => s3 ? `${p3} solid 1.5px` : `${e4.palette.divider} solid 1px`, background: s3 && m3 ? `linear-gradient(0deg, ${f2} 0%, ${p3})` : f2, borderRadius: "4px" } }) }));
1201
1206
  let x2 = null;
1202
- d3 && (x2 = z(xt, { iconKey: "Lock" })), i3 !== g.Visibility.Visible && (x2 = z(xt, { iconKey: "VisibilityOff", style: { opacity: c2.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" })), x2 && (x2 = z(J, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: x2 })), e3.push(z(Ae, { disabled: !c2.isStructureAllowed() && i3 === g.Visibility.Hidden, sx: { color: (e4) => {
1207
+ d3 && (x2 = z(xt, { iconKey: "Lock" })), i3 !== g.Visibility.Visible && (x2 = z(xt, { iconKey: "VisibilityOff", style: { opacity: c2.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" })), x2 && (x2 = z(J, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: x2 })), e3.push(z(Ie, { disabled: !c2.isStructureAllowed() && i3 === g.Visibility.Hidden, sx: { color: (e4) => {
1203
1208
  let t4 = s3 ? e4.palette.primary.main : e4.palette.text.secondary;
1204
1209
  return h2 && (t4 = h2), i3 === g.Visibility.Hidden && (t4 = Vt(t4, e4.palette.action.disabledOpacity)), t4;
1205
1210
  }, borderLeft: (e4) => `${s3 ? e4.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", paddingTop: "4px", paddingBottom: "4px", fontWeight: s3 ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: s3 ? z(Oe, {}) : void 0, onMouseDown: (e4) => e4.preventDefault(), onMouseUp: () => {
@@ -1216,10 +1221,10 @@ const Fn = $(O((e2, t2) => {
1216
1221
  }, [o2, c2, s2, a2, n2]);
1217
1222
  return z(J, { ref: t2, className: mt("menu", l2), ...i2, children: p2 });
1218
1223
  }));
1219
- Fn.displayName = "SheetsAllMenu";
1224
+ Mn.displayName = "SheetsAllMenu";
1220
1225
  let Nn = false, Bn = false;
1221
1226
  let En = null;
1222
- const An = async (e2) => {
1227
+ const In = async (e2) => {
1223
1228
  const t2 = await h.getDetails();
1224
1229
  if (Bn || t2.isEval()) {
1225
1230
  try {
@@ -1234,7 +1239,7 @@ const An = async (e2) => {
1234
1239
  if (En !== e2 && (En = e2, !Nn)) try {
1235
1240
  Nn = true;
1236
1241
  (top ?? window).SheetXL && (await h._validate(true), h.wasPrinted() && (() => {
1237
- _t.consoleWithNoSource("%cTip: You can access the API directly in the console.\nTry\n%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c\n>%c SheetXL.moreExamples()", "color:#ffa726;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;"), Nn = true;
1242
+ jt.consoleWithNoSource("%cTip: You can access the API directly in the console.\nTry\n%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c\n>%c SheetXL.moreExamples()", "color:#ffa726;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;"), Nn = true;
1238
1243
  const e3 = document.getElementById("openEditorLink");
1239
1244
  e3 && e3.addEventListener("click", (e4) => {
1240
1245
  e4.preventDefault(), console.log("openScriptEditor called from console");
@@ -1244,7 +1249,7 @@ const An = async (e2) => {
1244
1249
  e3 instanceof DOMException || console.error(e3);
1245
1250
  }
1246
1251
  }
1247
- }, In = (e2) => {
1252
+ }, An = (e2) => {
1248
1253
  Bn = e2;
1249
1254
  }, Ln = 0.12, Hn = (e2, t2) => {
1250
1255
  const o2 = {}, n2 = (e3) => {
@@ -1257,7 +1262,7 @@ const An = async (e2) => {
1257
1262
  const l2 = t2 ?? e2, i2 = "dark" === l2.palette.mode;
1258
1263
  return o2.selection = { fill: l2.palette?.primary?.main ? Vt(l2.palette?.primary?.main, 0.1) : void 0, strokeFill: l2.palette?.primary?.main }, o2.selectionInactive = { ...o2.selection, fill: l2.palette?.divider ? Vt(l2.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, o2.selectionRemove = { ...o2.selection, fill: Vt(l2.palette.warning.light, 0.05), strokeFill: l2.palette.warning.dark }, t2 && (o2.body = n2(t2)), o2.colorShadow = Vt(l2.palette.action.active, 0.5), o2.colorGrey = l2.palette.action.active, o2.filterDarkInvert = i2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", o2;
1259
1264
  }, zn = $(O((e2, t2) => {
1260
- const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 = Ct(t2, () => ({}), []), [i2, s2] = jt(), d2 = q(null), c2 = q(null), [m2, p2] = W.useReducer((e3) => e3 + 1, 0), [u2, g2] = U(null), [h2, f2] = U(null), [x2, b2] = U(null), { reference: y2 } = _e({ parentFloat: a2, label: "overflow" });
1265
+ const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 = Ct(t2, () => ({}), []), [i2, s2] = Ut(), d2 = q(null), c2 = q(null), [m2, p2] = W.useReducer((e3) => e3 + 1, 0), [u2, g2] = _(null), [h2, f2] = _(null), [x2, b2] = _(null), { reference: y2 } = je({ parentFloat: a2, label: "overflow" });
1261
1266
  Q(() => {
1262
1267
  c2.current = { refs: [] };
1263
1268
  const e3 = [], t3 = W.Children.toArray(o2);
@@ -1313,7 +1318,7 @@ const An = async (e2) => {
1313
1318
  const n3 = z(J, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", rowGap: (e4) => e4.spacing(0.25), paddingTop: (e4) => e4.spacing(0.5), paddingBottom: (e4) => e4.spacing(0.5), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1), overflow: "hidden" }, children: t3 });
1314
1319
  return Re({ ...e3, children: n3 });
1315
1320
  }, [x2]);
1316
- return L(J, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...n2 }, ref: Ut([l2, i2, t2]), ...r2, children: [z(J, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%", alignItems: "center" }, children: h2 ?? u2 }), z(J, { className: "overflow-palette-popup-button", sx: { display: null !== x2 && 0 === x2.length ? "none" : "flex", flex: "1 1 0" }, children: z(Be, { createPopupPanel: w2, ref: d2, parentFloat: y2, createTooltip: ({ children: e3 }, t3) => z(He, { label: "More", description: "More toolbar options…", disabled: t3, children: e3 }), icon: z(xt, { iconKey: "MoreHorizontal" }) }) })] });
1321
+ return L(J, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...n2 }, ref: _t([l2, i2, t2]), ...r2, children: [z(J, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%", alignItems: "center" }, children: h2 ?? u2 }), z(J, { className: "overflow-palette-popup-button", sx: { display: null !== x2 && 0 === x2.length ? "none" : "flex", flex: "1 1 0" }, children: z(Be, { createPopupPanel: w2, ref: d2, parentFloat: y2, createTooltip: ({ children: e3 }, t3) => z(He, { label: "More", description: "More toolbar options…", disabled: t3, children: e3 }), icon: z(xt, { iconKey: "MoreHorizontal" }) }) })] });
1317
1322
  })), Wn = "https://unpkg.com/@sheetxl/scripting-templates/dist", $n = (e2) => {
1318
1323
  if (e2.metadata?.name) return e2.metadata.name;
1319
1324
  let t2 = (e2.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
@@ -1349,16 +1354,16 @@ const An = async (e2) => {
1349
1354
  const { disabled: t2, snippet: o2, description: n2, handleInsert: a2, sx: r2, ...l2 } = e2;
1350
1355
  let i2;
1351
1356
  const s2 = o2.metadata?.icon;
1352
- return i2 = z(xt, "formula" === s2 ? { iconKey: "ScriptFormula", size: Kn, style: Vn } : "macro" === s2 ? { iconKey: "ScriptMacro", size: Kn, style: Vn } : { iconKey: "ScriptAutoStart", size: Kn, style: Vn }), z(Ae, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...r2 }, disabled: t2, icon: i2, onMouseDown: (e3) => {
1357
+ return i2 = z(xt, "formula" === s2 ? { iconKey: "ScriptFormula", size: Kn, style: Vn } : "macro" === s2 ? { iconKey: "ScriptMacro", size: Kn, style: Vn } : { iconKey: "ScriptAutoStart", size: Kn, style: Vn }), z(Ie, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...r2 }, disabled: t2, icon: i2, onMouseDown: (e3) => {
1353
1358
  0 === e3.button && e3.preventDefault();
1354
1359
  }, onMouseUp: (e3) => {
1355
1360
  0 === e3.button && a2(o2);
1356
1361
  }, onKeyDown: (e3) => {
1357
1362
  e3.keyCode !== ft.Enter && e3.keyCode !== ft.Space || a2(o2);
1358
1363
  }, ...l2, children: L(J, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [z(ee, { component: "div", children: o2.metadata?.title ?? o2.path }), z(ee, { variant: "caption", component: "div", sx: { color: (e3) => Vt(e3.palette.text.secondary ?? e3.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: o2.metadata?.summary })] }) });
1359
- }), Un = $(O((e2, t2) => {
1360
- const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 = Wn, ...i2 } = e2, [s2, d2] = U([]), [c2, m2] = U(true), p2 = pt(o2, ["executeSelectedScript"]), u2 = p2[0]?.context?.();
1361
- j(() => {
1364
+ }), _n = $(O((e2, t2) => {
1365
+ const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 = Wn, ...i2 } = e2, [s2, d2] = _([]), [c2, m2] = _(true), p2 = pt(o2, ["executeSelectedScript"]), u2 = p2[0]?.context?.();
1366
+ U(() => {
1362
1367
  (async () => {
1363
1368
  try {
1364
1369
  const e3 = await On(l2);
@@ -1382,17 +1387,17 @@ const An = async (e2) => {
1382
1387
  return Re({ ...e3, children: d3 });
1383
1388
  }, [r2, n2, a2, c2, u2]);
1384
1389
  return z(Pe, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: g2, icon: "ScriptInsert", ...i2 });
1385
- })), jn = $(O((e2, t2) => {
1390
+ })), Un = $(O((e2, t2) => {
1386
1391
  const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = gt((e3) => {
1387
1392
  const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
1388
- return z(H, { children: L("div", { style: { display: "flex", flex: "1 1 100%" }, children: [z("div", { children: z(zn, { parentFloat: n2, style: {}, children: z(ve, { ...t3, command: o2?.getCommand("saveScripts") }) }) }), z("div", { style: { flex: "1 1 100%" } }), z("div", { children: z(zn, { parentFloat: n2, style: {}, children: z(Un, { ...t3, commands: o2 }) }) })] }) });
1393
+ return z(H, { children: L("div", { style: { display: "flex", flex: "1 1 100%" }, children: [z("div", { children: z(zn, { parentFloat: n2, style: {}, children: z(ve, { ...t3, command: o2?.getCommand("saveScripts") }) }) }), z("div", { style: { flex: "1 1 100%" } }), z("div", { children: z(zn, { parentFloat: n2, style: {}, children: z(_n, { ...t3, commands: o2 }) }) })] }) });
1389
1394
  }, [o2]);
1390
1395
  return z(Xe, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
1391
1396
  }));
1392
- jn.displayName = "ScriptEditorToolbar";
1393
- const _n = $(O((e2, t2) => {
1394
- const { scriptPath: o2 = Wn, onScriptSelect: n2, sx: a2 = ht.EmptyCssProperties, className: r2, buttonMinWidth: l2 = 210, buttonMinHeight: i2 = 80, gap: s2 = 12, ...d2 } = e2, [c2, m2] = U([]), [p2, u2] = U(true), [g2, h2] = U(null);
1395
- if (j(() => {
1397
+ Un.displayName = "ScriptEditorToolbar";
1398
+ const jn = $(O((e2, t2) => {
1399
+ const { scriptPath: o2 = Wn, onScriptSelect: n2, sx: a2 = ht.EmptyCssProperties, className: r2, buttonMinWidth: l2 = 210, buttonMinHeight: i2 = 80, gap: s2 = 12, ...d2 } = e2, [c2, m2] = _([]), [p2, u2] = _(true), [g2, h2] = _(null);
1400
+ if (U(() => {
1396
1401
  (async () => {
1397
1402
  const e3 = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
1398
1403
  try {
@@ -1417,10 +1422,10 @@ const _n = $(O((e2, t2) => {
1417
1422
  };
1418
1423
  return L(J, { ref: t2, className: mt(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, ...a2 }, ...d2, children: [L(J, { p: 3, className: "script-select-content", sx: { overflow: "auto", flex: "1 1 auto" }, children: [z(ee, { variant: "h6", gutterBottom: true, children: "Script Template" }), z(ee, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Choose from a template to provide a starting point to automate tasks or create user defined functions." }), z(ee, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Templates provide a foundation to customize and meet your specific needs." }), z(J, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${l2}px, 1fr))`, gap: `${s2}px`, padding: 2, paddingLeft: "0px", paddingRight: "0px" }, children: c2.map((e3, t3) => L(ae, { variant: "outlined", sx: { minWidth: l2, minHeight: i2, display: "flex", flexDirection: "column", justifyContent: "flex-start", alignItems: "flex-start", textAlign: "left", padding: 2, textTransform: "none", overflow: "hidden", ...0 === t3 && { borderStyle: "dashed", marginBottom: "8px" }, ...1 === t3 && { gridColumn: "1" } }, onClick: () => n2?.(e3), children: [L(J, { sx: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", marginBottom: 0.5 }, children: [z(ee, { variant: "subtitle2", component: "div", children: e3.metadata?.title || e3.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), x2(e3)] }), e3.metadata?.summary && z(ee, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: e3.metadata.summary })] }, `${e3.path}-${t3}`)) })] }), f2] });
1419
1424
  }));
1420
- _n.displayName = "TemplateSelectPanel";
1425
+ jn.displayName = "TemplateSelectPanel";
1421
1426
  const qn = $(O((e2, t2) => {
1422
- const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, frame: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 = zt(), [u2, g2] = U(false), h2 = q(false), [f2, x2] = U({ message: "Loading", cursor: "", dirty: false }), [b2, y2] = U(null);
1423
- j(() => {
1427
+ const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, frame: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 = zt(), [u2, g2] = _(false), h2 = q(false), [f2, x2] = _({ message: "Loading", cursor: "", dirty: false }), [b2, y2] = _(null);
1428
+ U(() => {
1424
1429
  let e3 = false;
1425
1430
  return y2(null), (async function() {
1426
1431
  if (c2 && (await c2.start(), !e3)) {
@@ -1433,21 +1438,21 @@ const qn = $(O((e2, t2) => {
1433
1438
  }, [c2]);
1434
1439
  const w2 = K((e3) => {
1435
1440
  x2((t3) => ({ ...t3, ...e3 }));
1436
- }, []), S2 = q(null), [k2, v2] = U(null), T2 = q(null), R2 = gt((e3) => {
1441
+ }, []), S2 = q(null), [k2, v2] = _(null), T2 = q(null), R2 = gt((e3) => {
1437
1442
  if (k2) return k2.focus(e3), true;
1438
1443
  if (s2) {
1439
1444
  const t3 = S2.current?.querySelectorAll?.(s2);
1440
1445
  if (t3 && t3.length > 0) return t3[0]?.focus?.(e3), true;
1441
1446
  }
1442
1447
  return S2.current?.focus?.(e3), false;
1443
- }, [k2, s2, d2]), P2 = V(() => z(Fe, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: false }), []), D2 = V(() => z(ue, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, marginLeft: (e3) => e3.spacing(0.5), marginRight: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: z(jn, { commands: r2 }) }), [p2, r2]), M2 = V(() => z(J, { className: mt("script-status-panel", "status-panel"), sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", margin: 0, borderTop: `solid 1px ${p2.palette.divider}` }, children: L("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.message }), z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.dirty ? "Unsaved" : "" }), z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.cursor })] }) }), [f2]), F2 = V(() => L(J, { className: mt("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [D2, z(J, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: z(C, { ref: S2, loadingPanel: P2, readOnly: l2, frame: i2, autoFocus: d2, commands: r2, onStatusChange: w2, darkMode: "dark" === p2.palette.mode, ...a2 }) }), M2] }), [p2, r2, D2, M2, u2, P2, l2, a2, d2, s2, i2, w2]), N2 = V(() => {
1448
+ }, [k2, s2, d2]), P2 = V(() => z(Me, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: false }), []), D2 = V(() => z(ue, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, marginLeft: (e3) => e3.spacing(0.5), marginRight: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: z(Un, { commands: r2 }) }), [p2, r2]), F2 = V(() => z(J, { className: mt("script-status-panel", "status-panel"), sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", margin: 0, borderTop: `solid 1px ${p2.palette.divider}` }, children: L("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.message }), z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.dirty ? "Unsaved" : "" }), z(ee, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.cursor })] }) }), [f2]), M2 = V(() => L(J, { className: mt("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [D2, z(J, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: z(C, { ref: S2, loadingPanel: P2, readOnly: l2, frame: i2, autoFocus: d2, commands: r2, onStatusChange: w2, darkMode: "dark" === p2.palette.mode, ...a2 }) }), F2] }), [p2, r2, D2, F2, u2, P2, l2, a2, d2, s2, i2, w2]), N2 = V(() => {
1444
1449
  let e3;
1445
- return null === b2 ? null : (null === b2.source && (e3 = z(_n, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (e4) => {
1450
+ return null === b2 ? null : (null === b2.source && (e3 = z(jn, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (e4) => {
1446
1451
  S2.current?.getEditor()?.insertSnippet(e4.content), y2({ source: e4.content ?? "" });
1447
1452
  } })), z(J, { tabIndex: 0, className: mt("script-workspace", o2), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none" }, onPointerDown: (e4) => {
1448
1453
  e4.isDefaultPrevented() || S2.current?.focus();
1449
- }, children: L(J, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [F2, e3] }) }));
1450
- }, [D2, F2, o2, b2]), B2 = Ct(t2, () => ({ isScriptWorkspaceElement: () => true, focus: (e3) => {
1454
+ }, children: L(J, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [M2, e3] }) }));
1455
+ }, [D2, M2, o2, b2]), B2 = Ct(t2, () => ({ isScriptWorkspaceElement: () => true, focus: (e3) => {
1451
1456
  R2(e3);
1452
1457
  } }), []);
1453
1458
  return z(J, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...n2 }, ref: B2, ...m2, onFocus: (e3) => {
@@ -1461,8 +1466,8 @@ const Xn = (e2, t2) => {
1461
1466
  const { model: o2, commands: n2, entryKey: a2, frame: r2, ...l2 } = e2;
1462
1467
  return z(qn, { ref: t2, readOnly: false, commands: n2, frame: r2, scripts: o2?.getScripts(), ...l2 });
1463
1468
  }, Zn = $(O((e2, t2) => {
1464
- const { commands: o2, ...n2 } = e2, a2 = pt(o2, ["executeScript", "showScriptEditor"]), [r2, l2] = U([]), [i2, s2] = U(false), d2 = a2[0]?.context?.();
1465
- j(() => {
1469
+ const { commands: o2, ...n2 } = e2, a2 = pt(o2, ["executeScript", "showScriptEditor"]), [r2, l2] = _([]), [i2, s2] = _(false), d2 = a2[0]?.context?.();
1470
+ U(() => {
1466
1471
  const e3 = d2?.getScripts();
1467
1472
  if (!e3) return;
1468
1473
  (async () => {
@@ -1487,8 +1492,8 @@ const Yn = $(O((e2, t2) => {
1487
1492
  }, [r2, s2, n2, a2]);
1488
1493
  return z(Pe, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: d2, selected: o2.getCommand(i2).state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: i2, ...l2 });
1489
1494
  })), Qn = (e2) => z(ve, { ...e2 }), Jn = $(O((e2, t2) => {
1490
- const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, [l2, i2] = U(false), s2 = pt(o2, ["executeScript", "showScriptEditor"]), d2 = s2[0]?.context?.();
1491
- j(() => {
1495
+ const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, [l2, i2] = _(false), s2 = pt(o2, ["executeScript", "showScriptEditor"]), d2 = s2[0]?.context?.();
1496
+ U(() => {
1492
1497
  const e3 = d2?.getScripts();
1493
1498
  if (!e3) return;
1494
1499
  const t3 = s2[1], o3 = async () => {
@@ -1523,10 +1528,10 @@ const Yn = $(O((e2, t2) => {
1523
1528
  i3.push(l3);
1524
1529
  }
1525
1530
  }
1526
- const d3 = z(Oo, { ...a3, command: o2.getCommand("formatFontColor"), isSplit: true, panelProps: { disableAlpha: true } }), m3 = z(Oo, { ...a3, command: o2.getCommand("formatFillColor"), isSplit: true, panelProps: { disableAlpha: true, autoColorLabel: "No Fill", autoColorPosition: mo.End } }), p2 = o2.getCommand("undo") ? z(H, { children: z(Uo, { ...a3, quickCommand: "undo" }) }) : null, u2 = o2.getCommand("find") ? z(H, { children: z(Bo, { ...a3 }) }) : null;
1531
+ const d3 = z(Oo, { ...a3, command: o2.getCommand("formatFontColor"), isSplit: true, panelProps: { disableAlpha: true } }), m3 = z(Oo, { ...a3, command: o2.getCommand("formatFillColor"), isSplit: true, panelProps: { disableAlpha: true, autoColorLabel: "No Fill", autoColorPosition: mo.End } }), p2 = o2.getCommand("undo") ? z(H, { children: z(_o, { ...a3, quickCommand: "undo" }) }) : null, u2 = o2.getCommand("find") ? z(H, { children: z(Bo, { ...a3 }) }) : null;
1527
1532
  let g2 = null;
1528
1533
  l2 && (g2 = L(H, { children: [z(Te, {}), z(Yn, { ...a3 })] }));
1529
- return L(zn, { parentFloat: n2, children: [p2, null, p2 ? z(Te, {}) : null, z(Yo, { ...a3, command: o2.getCommand("paste") }), z(ve, { ...t3, command: o2.getCommand("formatPainterToggle") }), z(fa, { ...t3, command: o2.getCommand("copy") }), z(Te, {}), z(qo, { ...a3, command: o2.getCommand("formatFontFamily") }), z(Eo, { ...a3, command: o2.getCommand("formatFontSize") }), z(ve, { ...t3, command: o2.getCommand("formatBoldToggle") }), z(ve, { ...t3, command: o2.getCommand("formatItalicToggle") }), z(Zo, { ...a3 }), z(Xo, { ...a3 }), z(Mo, { ...a3 }), m3, d3, z(Te, {}), z(ro, { ...a3 }), z(lo, { ...a3 }), z(so, { ...a3 }), z(io, { ...a3 }), z(Fo, { ...a3 }), z(Te, {}), z(Io, { ...a3 }), z(Te, {}), z(on, { command: o2.getCommand("formatCellStyle"), ...a3 }), z(Ia, { command: o2.getCommand("formatTableStyle"), ...a3 }), z(Te, {}), z(zo, { ...a3 }), z(Wo, { ...a3 }), z($o, { ...a3 }), z(Te, {}), z($a, { ...a3 }), z(Ho, { ...a3 }), z(Lo, { ...a3 }), z(Ko, { ...a3 }), u2, g2, i3] });
1534
+ return L(zn, { parentFloat: n2, children: [p2, null, p2 ? z(Te, {}) : null, z(Yo, { ...a3, command: o2.getCommand("paste") }), z(ve, { ...t3, command: o2.getCommand("formatPainterToggle") }), z(fa, { ...t3, command: o2.getCommand("copy") }), z(Te, {}), z(qo, { ...a3, command: o2.getCommand("formatFontFamily") }), z(Eo, { ...a3, command: o2.getCommand("formatFontSize") }), z(ve, { ...t3, command: o2.getCommand("formatBoldToggle") }), z(ve, { ...t3, command: o2.getCommand("formatItalicToggle") }), z(Zo, { ...a3 }), z(Xo, { ...a3 }), z(Fo, { ...a3 }), m3, d3, z(Te, {}), z(ro, { ...a3 }), z(lo, { ...a3 }), z(so, { ...a3 }), z(io, { ...a3 }), z(Mo, { ...a3 }), z(Te, {}), z(Ao, { ...a3 }), z(Te, {}), z(on, { command: o2.getCommand("formatCellStyle"), ...a3 }), z(Aa, { command: o2.getCommand("formatTableStyle"), ...a3 }), z(Te, {}), z(zo, { ...a3 }), z(Wo, { ...a3 }), z($o, { ...a3 }), z(Te, {}), z($a, { ...a3 }), z(Ho, { ...a3 }), z(Lo, { ...a3 }), z(Ko, { ...a3 }), u2, g2, i3] });
1530
1535
  }, [o2, s2, l2, c2]);
1531
1536
  return z(Xe, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: m2, ...r2 });
1532
1537
  }));
@@ -1587,16 +1592,16 @@ const oa = (e2) => z(la, { ...e2 }), na = $((e2) => {
1587
1592
  const e3 = [];
1588
1593
  for (let t3 = 0; t3 < p2.length; t3++) e3.push(W.cloneElement(p2[t3].component, { ...p2[t3].component.props, key: p2[t3].key ?? p2[t3].label }));
1589
1594
  return e3;
1590
- }, [p2]), [g2, h2] = U(0), f2 = (e3) => {
1595
+ }, [p2]), [g2, h2] = _(0), f2 = (e3) => {
1591
1596
  h2(e3);
1592
1597
  }, x2 = V(() => z(r2 ? ra : aa, { toolbars: p2, value: g2, onToolbarChange: f2, sx: a2 }), [p2, g2, a2, r2]), { sx: b2, ...y2 } = s2, w2 = z(ue, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, borderRadius: "8px", backgroundImage: `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})`, marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1), marginTop: (e3) => e3.spacing(0.5), marginBottom: (e3) => e3.spacing(0.5), ...b2 }, ...y2, children: u2[g2] });
1593
1598
  return L(J, { ref: t2, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (e3) => e3.spacing(0.5), "*": { userSelect: "none" }, ...c2 }, ...m2, children: [n2 ? n2(x2) : x2, l2 ? l2(w2) : w2] });
1594
1599
  }));
1595
1600
  la.displayName = "WorkbookToolbars";
1596
1601
  const ia = (e2) => {
1597
- const { workbook: t2, workbookElement: o2, target: n2, commands: a2, darkMode: r2, onNewWorkbook: l2 = sa } = e2, i2 = St(), [s2, d2] = U(t2?.getSelectedSheet()), [c2, m2] = U(t2?.getSheets().getItems()), p2 = gt(l2, [l2]), u2 = T(), h2 = V(() => [new Pt("activateTask", n2, { label: "Activate Task", description: "Activate Task Pane.", shortcut: { key: "F6" } }), new Pt("workbookStatistics", n2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Mt.Ctrl, Mt.Shift] } }), new Pt("workbookStatistics", n2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Mt.Ctrl, Mt.Shift] } }), new Pt("showFormat", n2, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [Mt.Ctrl, Mt.Shift] } }), new Dt("newCellStyle", n2, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later.", icon: "NewPresetStyles" }), new Dt("deleteCellStyle", n2, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new Dt("modifyCellStyle", n2, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new Pt("find", n2, { label: "Find", description: "Open the Find window.", icon: "Find", shortcut: [{ key: "F", modifiers: [Mt.Ctrl] }, { key: "F5", modifiers: [Mt.Shift] }] }), new Pt("findReplace", n2, { label: "Find & Replace", description: "Open the Find & Replace window.", icon: "FindReplace", shortcut: [{ key: "H", modifiers: [Mt.Ctrl] }, { key: "H", modifiers: [Mt.Ctrl, Mt.Alt] }] }), new Pt("goto", n2, { label: "Go To", description: "Open the 'Go To' window.", icon: "GoTo", shortcut: [{ key: "G", modifiers: [Mt.Ctrl] }] }), new Pt("workbookViewToggleExpandFormulaBar", n2, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [Mt.Ctrl, Mt.Shift] } }), new Pt("workbookViewToggleShowFormulaBar", n2, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new Pt("workbookViewToggleShowTabs", n2, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new Pt("workbookViewToggleShowStatusBar", n2, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new Pt("workbookViewToggleShowHorizontalScrollBar", n2, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new Pt("workbookViewToggleShowVerticalScrollBar", n2, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new Dt("hideSheet", n2, { label: "Hide Sheet", scopedLabels: { sheet: "Hide" }, description: "Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.", icon: "VisibilityOff" }), new Dt("deleteSheet", n2, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new Dt("addSheet", n2, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [Mt.Shift] }, { key: "F1", modifiers: [Mt.Alt, Mt.Shift] }] }), new Dt("duplicateSheet", n2, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new Dt("nextSheet", n2, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Mt.Ctrl] }] }), new Dt("previousSheet", n2, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Mt.Ctrl] }] }), new Dt("selectNextSheet", n2, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Mt.Ctrl, Mt.Shift] }] }), new Dt("selectPreviousSheet", n2, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Mt.Ctrl, Mt.Shift] }] }), new Dt("selectTheme", n2, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new Dt("selectNamed", n2, { label: (e3) => e3?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (e3) => e3?.getName() ?? "Select" }, description: "Select the item." }), new Dt("addNamedReference", n2, { label: "Define Named Reference", scopedLabels: { namedItem: "Define Name…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "InsertNamedRange" }), new Dt("editNamedReference", n2, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "NamedRangeEdit" }), new Dt("deleteNamedReference", n2, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference.", icon: "DeleteNamedRange" }), new Pt("activeNameBox", n2, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [Mt.Alt] } }), new Pt("createNamedReferenceFromSelection", n2, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [Mt.Ctrl, Mt.Shift] } }), new Pt("activeNameManager", n2, { label: "Activate Name Manager", description: "Create, edit, delete, and find all the names used in the workbook.\n\nNames can be used as a substitute for cell references.", shortcut: { key: "F3", modifiers: [Mt.Ctrl] } }), new Dt("fullScreenToggle", n2, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" }, icon: "FullScreen" }), new Dt("showScriptEditor", n2, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", icon: "ScriptRun", shortcut: [{ key: "F11", modifiers: [Mt.Alt] }] }), new Dt("executeScript", n2, { label: "Run Script", description: "Run the selected or last executed script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new Dt("executeSelectedScript", n2, { label: "Run Script", description: "Run the selected script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new Dt("saveScripts", n2, { label: "Save Script", description: "Save the current scripts.", icon: "ScriptSave" }), new Dt("maximumWorkbookToggle", n2, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [Mt.Ctrl] } }), new Dt("spellCheck", n2, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new Dt("calculateAll", n2, { label: "Calculate Now", description: "Recalculate all formulas.", icon: "Calculate", shortcut: { key: "F9" } }), new Pt("closeWorkbook", n2, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [Mt.Ctrl] } }), new Pt("newWorkbook", n2, { label: "New Workbook", description: "Create a new workbook in another tab.", icon: "FileNew" })], []), f2 = V(() => {
1602
+ const { workbook: t2, workbookElement: o2, target: n2, commands: a2, darkMode: r2, onNewWorkbook: l2 = sa } = e2, i2 = St(), [s2, d2] = _(t2?.getSelectedSheet()), [c2, m2] = _(t2?.getSheets().getItems()), p2 = gt(l2, [l2]), u2 = T(), h2 = V(() => [new Pt("activateTask", n2, { label: "Activate Task", description: "Activate Task Pane.", shortcut: { key: "F6" } }), new Pt("workbookStatistics", n2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Ft.Ctrl, Ft.Shift] } }), new Pt("workbookStatistics", n2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Ft.Ctrl, Ft.Shift] } }), new Pt("showFormat", n2, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [Ft.Ctrl, Ft.Shift] } }), new Dt("newCellStyle", n2, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later.", icon: "NewPresetStyles" }), new Dt("deleteCellStyle", n2, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new Dt("modifyCellStyle", n2, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new Pt("find", n2, { label: "Find", description: "Open the Find window.", icon: "Find", shortcut: [{ key: "F", modifiers: [Ft.Ctrl] }, { key: "F5", modifiers: [Ft.Shift] }] }), new Pt("findReplace", n2, { label: "Find & Replace", description: "Open the Find & Replace window.", icon: "FindReplace", shortcut: [{ key: "H", modifiers: [Ft.Ctrl] }, { key: "H", modifiers: [Ft.Ctrl, Ft.Alt] }] }), new Pt("goto", n2, { label: "Go To", description: "Open the 'Go To' window.", icon: "GoTo", shortcut: [{ key: "G", modifiers: [Ft.Ctrl] }] }), new Pt("workbookViewToggleExpandFormulaBar", n2, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [Ft.Ctrl, Ft.Shift] } }), new Pt("workbookViewToggleShowFormulaBar", n2, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new Pt("workbookViewToggleShowTabs", n2, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new Pt("workbookViewToggleShowStatusBar", n2, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new Pt("workbookViewToggleShowHorizontalScrollBar", n2, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new Pt("workbookViewToggleShowVerticalScrollBar", n2, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new Dt("hideSheet", n2, { label: "Hide Sheet", scopedLabels: { sheet: "Hide" }, description: "Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.", icon: "VisibilityOff" }), new Dt("deleteSheet", n2, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new Dt("addSheet", n2, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [Ft.Shift] }, { key: "F1", modifiers: [Ft.Alt, Ft.Shift] }] }), new Dt("duplicateSheet", n2, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new Dt("nextSheet", n2, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Ft.Ctrl] }] }), new Dt("previousSheet", n2, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Ft.Ctrl] }] }), new Dt("selectNextSheet", n2, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Ft.Ctrl, Ft.Shift] }] }), new Dt("selectPreviousSheet", n2, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Ft.Ctrl, Ft.Shift] }] }), new Dt("selectTheme", n2, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new Dt("selectNamed", n2, { label: (e3) => e3?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (e3) => e3?.getName() ?? "Select" }, description: "Select the item." }), new Dt("addNamedReference", n2, { label: "Define Named Reference", scopedLabels: { namedItem: "Define Name…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "InsertNamedRange" }), new Dt("editNamedReference", n2, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "NamedRangeEdit" }), new Dt("deleteNamedReference", n2, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference.", icon: "DeleteNamedRange" }), new Pt("activeNameBox", n2, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [Ft.Alt] } }), new Pt("createNamedReferenceFromSelection", n2, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [Ft.Ctrl, Ft.Shift] } }), new Pt("activeNameManager", n2, { label: "Activate Name Manager", description: "Create, edit, delete, and find all the names used in the workbook.\n\nNames can be used as a substitute for cell references.", shortcut: { key: "F3", modifiers: [Ft.Ctrl] } }), new Dt("fullScreenToggle", n2, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" }, icon: "FullScreen" }), new Dt("showScriptEditor", n2, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", icon: "ScriptRun", shortcut: [{ key: "F11", modifiers: [Ft.Alt] }] }), new Dt("executeScript", n2, { label: "Run Script", description: "Run the selected or last executed script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new Dt("executeSelectedScript", n2, { label: "Run Script", description: "Run the selected script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new Dt("saveScripts", n2, { label: "Save Script", description: "Save the current scripts.", icon: "ScriptSave" }), new Dt("maximumWorkbookToggle", n2, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [Ft.Ctrl] } }), new Dt("spellCheck", n2, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new Dt("calculateAll", n2, { label: "Calculate Now", description: "Recalculate all formulas.", icon: "Calculate", shortcut: { key: "F9" } }), new Pt("closeWorkbook", n2, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [Ft.Ctrl] } }), new Pt("newWorkbook", n2, { label: "New Workbook", description: "Create a new workbook in another tab.", icon: "FileNew" })], []), f2 = V(() => {
1598
1603
  let e3 = null;
1599
- return e3 = a2 ? a2.createChildGroup(n2, "workbook", false) : new Ft(n2, "workbook"), e3.addCommands(h2, true), e3;
1604
+ return e3 = a2 ? a2.createChildGroup(n2, "workbook", false) : new Mt(n2, "workbook"), e3.addCommands(h2, true), e3;
1600
1605
  }, [a2, h2]), x2 = wt(), b2 = W.useRef(null), y2 = gt(() => {
1601
1606
  let e3, o3 = null;
1602
1607
  const n3 = f2.getCommand("executeScript");
@@ -1659,7 +1664,7 @@ const ia = (e2) => {
1659
1664
  y2();
1660
1665
  } });
1661
1666
  const { isFullscreenAvailable: k2, isFullscreenEnabled: C2, toggleFullscreen: v2 } = eo({ target: { current: o2 ?? document.body } }), P2 = R();
1662
- j(() => {
1667
+ U(() => {
1663
1668
  f2.getCommand("selectTheme").update({ state: () => t2.getTheme(), context: () => ({ theme: t2.getTheme(), themes: P2, darkMode: r2 }) });
1664
1669
  }, [t2?.getTheme(), r2]);
1665
1670
  const D2 = gt(async function(e3, o3) {
@@ -1676,7 +1681,7 @@ const ia = (e2) => {
1676
1681
  return void i2.showError(e4);
1677
1682
  }
1678
1683
  }, [t2, i2]);
1679
- j(() => {
1684
+ U(() => {
1680
1685
  f2.getCommand("newCellStyle").updateCallback((e3) => {
1681
1686
  i2.showInput({ initialValue: (() => {
1682
1687
  let e4 = 0;
@@ -1735,7 +1740,7 @@ const ia = (e2) => {
1735
1740
  p2?.();
1736
1741
  }), f2.getCommand("executeScript").updateCallback(D2), f2.getCommand("executeSelectedScript").updateCallback(D2);
1737
1742
  }, [t2, i2]);
1738
- const M2 = gt(async (e3) => {
1743
+ const F2 = gt(async (e3) => {
1739
1744
  let o3 = 0, n3 = null, a3 = "Find & Replace";
1740
1745
  e3?.replace && !e3?.replaceOptions?.maxCount && (a3 = "Replace All");
1741
1746
  const r3 = await i2.showBusy(a3);
@@ -1755,7 +1760,7 @@ const ia = (e2) => {
1755
1760
  r3?.(), i2.showError(e4);
1756
1761
  }
1757
1762
  return o3;
1758
- }, [t2, o2]), F2 = gt((e3) => {
1763
+ }, [t2, o2]), M2 = gt((e3) => {
1759
1764
  const o3 = { selection: () => {
1760
1765
  const e4 = t2.getSelectedRanges(), o4 = e4.getCount(), n4 = new Array(o4);
1761
1766
  for (let t3 = 0; t3 < o4; t3++) {
@@ -1772,9 +1777,9 @@ const ia = (e2) => {
1772
1777
  } };
1773
1778
  return i2.showWindow("namedDetails", n3);
1774
1779
  }, [i2, t2, o2]);
1775
- return j(() => {
1780
+ return U(() => {
1776
1781
  const e3 = (e4 = false) => {
1777
- const o3 = { initialValue: { findOptions: { text: t2.getSelectedCell().toTextUnformatted(true) }, replace: e4 }, context: () => M2, onKeyDown: (e5) => {
1782
+ const o3 = { initialValue: { findOptions: { text: t2.getSelectedCell().toTextUnformatted(true) }, replace: e4 }, context: () => F2, onKeyDown: (e5) => {
1778
1783
  f2.findCommandByEvent(e5) !== f2.getCommand("find") && f2.findCommandByEvent(e5) !== f2.getCommand("findReplace") || e5.preventDefault();
1779
1784
  }, autoFocus: true, disableAutoDestroy: true };
1780
1785
  i2.showWindow("find", o3);
@@ -1808,9 +1813,9 @@ const ia = (e2) => {
1808
1813
  i2.showError(e5);
1809
1814
  }
1810
1815
  }), f2.getCommand("addNamedReference")?.updateCallback(async function(e4) {
1811
- F2(null);
1816
+ M2(null);
1812
1817
  }), f2.getCommand("editNamedReference")?.updateCallback(async function(e4) {
1813
- F2(e4);
1818
+ M2(e4);
1814
1819
  }), f2.getCommand("deleteNamedReference")?.updateCallback(async function(e4) {
1815
1820
  e4?.delete?.();
1816
1821
  }), f2.getCommand("activeNameBox")?.updateCallback(async function() {
@@ -1828,26 +1833,26 @@ const ia = (e2) => {
1828
1833
  }), f2.getCommand("workbookViewToggleShowVerticalScrollBar").update({ state: e3.isShowVerticalScrollbar() }).updateCallback(() => {
1829
1834
  e3.setShowVerticalScrollbar(!e3.isShowVerticalScrollbar());
1830
1835
  });
1831
- } }), j(() => {
1836
+ } }), U(() => {
1832
1837
  f2.getCommand("fullScreenToggle").update({ state: C2, disabled: !k2, icon: C2 ? "FullScreenOff" : "FullScreen" }).updateCallback(() => {
1833
1838
  v2();
1834
1839
  });
1835
- }, [C2, k2]), j(() => {
1840
+ }, [C2, k2]), U(() => {
1836
1841
  const e3 = t2.getProtection().isStructureAllowed();
1837
1842
  f2.getCommand("hideSheet").update({ disabled: c2.length <= 1 || !e3 }), f2.getCommand("deleteSheet").update({ disabled: c2.length <= 1 || !e3 });
1838
1843
  }, [c2, s2]), f2;
1839
1844
  }, sa = () => {
1840
1845
  window.open(window.origin.toString(), "sheetxl-" + n.uuidV4(), "popup=true");
1841
- }, da = "_sheetxl-theme_4opcr_2", ca = "_sheetxl-workbook_g5t6x_5", ma = (e2) => z(Mn, { ...e2 }), pa = (e2) => z(Fn, { ...e2 }), ua = (e2) => z(Dn, { ...e2 }), ga = $(O((e2, t2) => {
1842
- const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 = ma, sheetsAllProps: c2, renderSheetsAll: m2 = pa, sheetTabProps: p2, renderSheetTab: u2, background: g2 = "transparent", className: h2, sx: f2, borderWidth: x2, borderColor: b2, gridTheme: y2, gridStyle: S2, ...k2 } = e2, [C2, v2] = U(o2?.getSelectedSheetIndex()), [T2, R2] = U(o2?.getSheets().getItems()), [D2, M2] = U(o2?.getProtection());
1846
+ }, da = "_sheetxl-theme_4opcr_2", ca = "_sheetxl-workbook_g5t6x_5", ma = (e2) => z(Fn, { ...e2 }), pa = (e2) => z(Mn, { ...e2 }), ua = (e2) => z(Dn, { ...e2 }), ga = $(O((e2, t2) => {
1847
+ const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 = ma, sheetsAllProps: c2, renderSheetsAll: m2 = pa, sheetTabProps: p2, renderSheetTab: u2, background: g2 = "transparent", className: h2, sx: f2, borderWidth: x2, borderColor: b2, gridTheme: y2, gridStyle: S2, ...k2 } = e2, [C2, v2] = _(o2?.getSelectedSheetIndex()), [T2, R2] = _(o2?.getSheets().getItems()), [D2, F2] = _(o2?.getProtection());
1843
1848
  w(o2, { onViewChange(e3) {
1844
1849
  v2(e3?.getSelectedSheetIndex());
1845
1850
  }, onSheetsChange: (e3) => {
1846
1851
  R2(e3.getSheets().getItems());
1847
1852
  }, onProtectionChange: (e3) => {
1848
- M2(e3?.getProtection());
1853
+ F2(e3?.getProtection());
1849
1854
  } });
1850
- const F2 = i2 || !D2.isStructureAllowed(), N2 = V(() => {
1855
+ const M2 = i2 || !D2.isStructureAllowed(), N2 = V(() => {
1851
1856
  const e3 = [];
1852
1857
  for (let t3 = 0; t3 < T2.length; t3++) e3.push(T2[t3].getName());
1853
1858
  return e3;
@@ -1855,20 +1860,20 @@ const ia = (e2) => {
1855
1860
  false !== a2?.(e3) && (o2.getSheetAt(e3).select(), r2?.(e3));
1856
1861
  }, [o2, a2, r2]), E2 = K((e3, t3) => {
1857
1862
  o2.getSheetAt(e3).setName(t3), r2?.(e3);
1858
- }, [o2, r2]), A2 = K((e3, t3) => {
1863
+ }, [o2, r2]), I2 = K((e3, t3) => {
1859
1864
  o2.getSheetAt(e3).setPosition(t3), r2?.(t3);
1860
- }, [o2, r2]), I2 = gt(() => {
1865
+ }, [o2, r2]), A2 = gt(() => {
1861
1866
  if (false === a2?.(C2)) return;
1862
1867
  const e3 = C2 + 1;
1863
1868
  o2.getSheets().add({ name: void 0, autoSelect: true }), r2?.(e3);
1864
- }, [o2, a2, r2, C2]), H2 = V(() => ({ placement: "top-start" }), []), W2 = q(null), [$2, O2] = U(false), G2 = K((e3) => {
1869
+ }, [o2, a2, r2, C2]), H2 = V(() => ({ placement: "top-start" }), []), W2 = q(null), [$2, O2] = _(false), G2 = K((e3) => {
1865
1870
  const { closeFloatAll: t3, floatReference: n3 } = e3;
1866
1871
  return m2({ workbook: o2, gridStyle: S2, floatReference: n3, closeFloatAll: t3, ...c2 });
1867
- }, [m2, c2, l2, o2, S2]), { reference: _2, component: X2 } = _e({ label: "allSheet", popperProps: H2, anchor: W2.current, onOpen: () => O2(true), onClose: () => O2(false), createPopupPanel: G2 }), Z2 = q(null), [Y2, Q2] = U(null), ee2 = K((e3) => {
1872
+ }, [m2, c2, l2, o2, S2]), { reference: j2, component: X2 } = je({ label: "allSheet", popperProps: H2, anchor: W2.current, onOpen: () => O2(true), onClose: () => O2(false), createPopupPanel: G2 }), Z2 = q(null), [Y2, Q2] = _(null), ee2 = K((e3) => {
1868
1873
  const { floatReference: t3 } = e3;
1869
1874
  return d2?.({ workbook: o2, index: Y2?.index, tabStripRef: Z2.current, commands: n2, disabled: l2, floatReference: t3, ...s2 });
1870
- }, [d2, s2, l2, o2, n2, Y2]), { reference: oe2, component: ne2 } = _e({ label: "sheetTab", popperProps: H2, anchor: { getBoundingClientRect: () => new DOMRect(Y2?.left || 0, Y2?.top || 0, 0, 0) }, onClose: () => Q2(null), createPopupPanel: ee2 });
1871
- j(() => {
1875
+ }, [d2, s2, l2, o2, n2, Y2]), { reference: oe2, component: ne2 } = je({ label: "sheetTab", popperProps: H2, anchor: { getBoundingClientRect: () => new DOMRect(Y2?.left || 0, Y2?.top || 0, 0, 0) }, onClose: () => Q2(null), createPopupPanel: ee2 });
1876
+ U(() => {
1872
1877
  Y2 ? oe2.open(0) : oe2.close(0);
1873
1878
  }, [Y2]);
1874
1879
  const ae2 = K((e3, t3) => {
@@ -1883,25 +1888,25 @@ const ia = (e2) => {
1883
1888
  return (u2 ?? ua)({ sheet: t3, gridTheme: y2, onContextMenu: (t4) => {
1884
1889
  B2(e3.index), ae2(t4, e3.index);
1885
1890
  }, ...e3, ...p2 });
1886
- }, [u2, p2, o2, y2]), le2 = V(() => F2 ? null : z(Me, { disableInteractive: true, title: "New sheet", children: z(te, { disabled: l2, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (e3) => {
1891
+ }, [u2, p2, o2, y2]), le2 = V(() => M2 ? null : z(Fe, { disableInteractive: true, title: "New sheet", children: z(te, { disabled: l2, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (e3) => {
1887
1892
  0 === e3.button && e3.preventDefault();
1888
- }, onClick: () => I2(), children: z(xt, { iconKey: "AddCircle" }) }) }), [l2, F2, I2]);
1889
- return L(J, { ref: t2, className: mt(h2), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...f2 }, ...k2, children: [z(P, { ref: Z2, selectedTabIndex: C2, tabNames: N2, onSelectedTabIndexChange: B2, onTabNameChange: E2, onTabMove: A2, background: g2, borderColor: b2, borderWidth: x2, activeColor: null, disabled: l2, disableDrag: F2, createScrollStartButton: Qe, createScrollEndButton: Ye, createScrollEdgeButton: Ze, createTabButton: re2, createTabDivider: (e3) => {
1893
+ }, onClick: () => A2(), children: z(xt, { iconKey: "AddCircle" }) }) }), [l2, M2, A2]);
1894
+ return L(J, { ref: t2, className: mt(h2), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...f2 }, ...k2, children: [z(P, { ref: Z2, selectedTabIndex: C2, tabNames: N2, onSelectedTabIndexChange: B2, onTabNameChange: E2, onTabMove: I2, background: g2, borderColor: b2, borderWidth: x2, activeColor: null, disabled: l2, disableDrag: M2, createScrollStartButton: Qe, createScrollEndButton: Ye, createScrollEdgeButton: Ze, createTabButton: re2, createTabDivider: (e3) => {
1890
1895
  const { key: t3, ...o3 } = e3;
1891
1896
  return z(Te, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (e4) => Wt(e4.palette.divider, 0.25) }, ...o3 }, t3);
1892
- }, editLabelProps: { readOnly: F2, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (e3) => {
1897
+ }, editLabelProps: { readOnly: M2, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (e3) => {
1893
1898
  o2.isValidSheetNameCharacter(e3.key) || e3.preventDefault();
1894
1899
  }, onCancel: () => {
1895
1900
  r2?.(C2);
1896
- } }, children: z(Me, { disableInteractive: true, title: $2 ? "" : "List all sheets", children: z(ze, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ref: W2, dense: true, outlined: false, selected: $2, color: "primary", "aria-label": "menu", onMouseDown: (e3) => {
1901
+ } }, children: z(Fe, { disableInteractive: true, title: $2 ? "" : "List all sheets", children: z(ze, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ref: W2, dense: true, outlined: false, selected: $2, color: "primary", "aria-label": "menu", onMouseDown: (e3) => {
1897
1902
  0 === e3.button && e3.preventDefault();
1898
1903
  }, onClick: () => {
1899
- $2 ? _2.close(0) : _2.open(0);
1904
+ $2 ? j2.close(0) : j2.open(0);
1900
1905
  }, icon: z(xt, { iconKey: "Menu" }) }) }) }), z("div", { style: { borderTop: `solid ${b2} ${x2}px`, minWidth: "4px" } }), z("div", { style: { borderTop: `solid ${b2} ${x2}px`, flex: "none", display: "flex", alignItems: "center" }, children: le2 }), z("div", { style: { borderTop: `solid ${b2} ${x2}px`, flex: 1, minWidth: "24px" } }), ne2, X2] });
1901
1906
  }));
1902
1907
  ga.displayName = "WorkbookStrip";
1903
1908
  const ha = $(O((e2, t2) => {
1904
- const { workbook: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, className: i2, ...s2 } = e2, [d2, c2] = Z((e3) => e3 + 1, 0), [m2, p2] = U(o2.getSelectedSheet()), [u2, g2] = U(m2.getSelectedRanges()), [h2, f2] = U(m2.getSelectedCell());
1909
+ const { workbook: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, className: i2, ...s2 } = e2, [d2, c2] = Z((e3) => e3 + 1, 0), [m2, p2] = _(o2.getSelectedSheet()), [u2, g2] = _(m2.getSelectedRanges()), [h2, f2] = _(m2.getSelectedCell());
1905
1910
  w(o2, { onSheetsChange() {
1906
1911
  p2(o2.getSelectedSheet());
1907
1912
  } }), w(m2.getSelection(), { onChange() {
@@ -1934,8 +1939,8 @@ const ha = $(O((e2, t2) => {
1934
1939
  }));
1935
1940
  ha.displayName = "WorkbookContextMenu";
1936
1941
  const fa = $(O((e2, t2) => {
1937
- const { command: o2, ...n2 } = e2, a2 = wt(), [r2, l2] = U(false), [i2, s2] = U("info");
1938
- return j(() => {
1942
+ const { command: o2, ...n2 } = e2, a2 = wt(), [r2, l2] = _(false), [i2, s2] = _("info");
1943
+ return U(() => {
1939
1944
  const e3 = a2.getMode();
1940
1945
  l2("copy" === e3?.key || "cut" === e3?.key), s2("cut" === e3?.key ? "warn" : "accent");
1941
1946
  }, [a2]), z(ve, { ref: t2, command: o2, icon: z(xt, { iconKey: "copy.walking", sourceProps: { isWalking: r2, themedType: i2 } }), ...n2 });
@@ -1950,11 +1955,11 @@ const fa = $(O((e2, t2) => {
1950
1955
  return z(J, { ref: t2, sx: { paddingTop: "4px", paddingBottom: "4px", ...r2 }, ...i2, children: p2 });
1951
1956
  }));
1952
1957
  xa.displayName = "MovableContextMenu";
1953
- const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) => z(Rn, { ...e2 }), Sa = (e2, t2) => z(Tn, { ref: t2, ...e2 }), ka = (e2) => z(Fe, { ...e2 }), Ca = (e2, t2) => z(D, { ref: t2, ...e2 }), va = (e2) => z(kn, { ...e2 }), Ta = (e2) => z(ga, { ...e2 }), Ra = { fireOnModelChange: false }, Pa = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, Da = $(O((e2, t2) => {
1954
- const { workbook: o2, createWorkbookOptions: n2, onNewWorkbook: a2, onElementLoad: r2, autoFocus: l2 = false, sx: i2, style: s2, className: d2, onFocus: c2, onBlur: m2, onKeyDown: p2, onRepeatCommandChange: u2, commands: g2, showFormulaBar: h2, formulaBarProps: b2, renderFormulaBar: y2 = Sa, showTabs: S2, tabsProps: k2, renderTabs: C2 = Ta, showStatusBar: v2, statusBarProps: T2, renderStatusBar: P2 = va, toolbarProps: D2, renderToolbar: E2 = oa, contextMenuSx: A2, renderContextMenu: I2 = ya, renderFilterMenu: $2 = wa, renderMovableMenu: O2 = ba, renderLoadingPanel: G2 = ka, loadingPanelProps: _2, sheetProps: X2, renderSheet: Y2 = Ca, mainWrapper: te2, showHorizontalScrollbar: oe2, showVerticalScrollbar: ne2, gridTheme: ae2, headersTheme: re2, enableDarkImages: le2, ...ie2 } = e2, se2 = zt(), de2 = R(), ce2 = V(() => {
1958
+ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) => z(Rn, { ...e2 }), Sa = (e2, t2) => z(Tn, { ref: t2, ...e2 }), ka = (e2) => z(Me, { ...e2 }), Ca = (e2, t2) => z(D, { ref: t2, ...e2 }), va = (e2) => z(kn, { ...e2 }), Ta = (e2) => z(ga, { ...e2 }), Ra = { fireOnModelChange: false }, Pa = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, Da = $(O((e2, t2) => {
1959
+ const { workbook: o2, createWorkbookOptions: n2, onNewWorkbook: a2, onElementLoad: r2, autoFocus: l2 = false, sx: i2, style: s2, className: d2, onFocus: c2, onBlur: m2, onKeyDown: p2, onRepeatCommandChange: u2, commands: g2, showFormulaBar: h2, formulaBarProps: b2, renderFormulaBar: y2 = Sa, showTabs: S2, tabsProps: k2, renderTabs: C2 = Ta, showStatusBar: v2, statusBarProps: T2, renderStatusBar: P2 = va, toolbarProps: D2, renderToolbar: E2 = oa, contextMenuSx: I2, renderContextMenu: A2 = ya, renderFilterMenu: $2 = wa, renderMovableMenu: O2 = ba, renderLoadingPanel: G2 = ka, loadingPanelProps: j2, sheetProps: X2, renderSheet: Y2 = Ca, mainWrapper: te2, showHorizontalScrollbar: oe2, showVerticalScrollbar: ne2, gridTheme: ae2, headersTheme: re2, enableDarkImages: le2, ...ie2 } = e2, se2 = zt(), de2 = R(), ce2 = V(() => {
1955
1960
  const e3 = { theme: de2.getDefaultTheme(), ...n2 };
1956
1961
  return o2 ?? new f(e3);
1957
- }, [o2]), me2 = q(null), [pe2, ge2] = U(false), he2 = q(null), fe2 = V(() => z(J, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: he2 }), []), [xe2, be2] = U(false), [ye2, we2] = U(false), Se2 = K(() => {
1962
+ }, [o2]), me2 = q(null), [pe2, ge2] = _(false), he2 = q(null), fe2 = V(() => z(J, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: he2 }), []), [xe2, be2] = _(false), [ye2, we2] = _(false), Se2 = K(() => {
1958
1963
  be2(true);
1959
1964
  }, []), ke2 = q(null), Ce2 = Ct(t2, () => ({ isWorkbookElement: () => true, getWorkbook: () => ce2, getSheetElement: () => me2.current, getViewportElement: () => he2.current, getFormulaBarElement: () => ke2.current, focus() {
1960
1965
  me2 && me2.current && me2.current.focus();
@@ -1964,12 +1969,12 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
1964
1969
  (async () => {
1965
1970
  ve2.current !== r2 && (await r2?.({ source: Ce2.current }), ve2.current = r2), we2(true);
1966
1971
  })();
1967
- }, [xe2, Ce2.current]), An(Ce2.current);
1972
+ }, [xe2, Ce2.current]), In(Ce2.current);
1968
1973
  const Te2 = K((e3) => (me2.current?.submitEdit(), true), []), Re2 = K(() => {
1969
1974
  requestAnimationFrame(() => {
1970
1975
  me2?.current?.focus();
1971
1976
  });
1972
- }, []), [Pe2, De2] = U(ce2?.getSelectedSheet()), [Ne2, Be2] = U(ce2?.getProtection());
1977
+ }, []), [Pe2, De2] = _(ce2?.getSelectedSheet()), [Ne2, Be2] = _(ce2?.getProtection());
1973
1978
  w(ce2, { onSheetsChange: (e3) => {
1974
1979
  De2(e3?.getSelectedSheet());
1975
1980
  }, onViewChange(e3) {
@@ -1981,28 +1986,28 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
1981
1986
  me2.current.getSheet() !== t3 && e4(false), e4(true);
1982
1987
  }) : e4(true);
1983
1988
  }) }, Ra);
1984
- const [Ee2, Ae2] = Z((e3) => e3 + 1, 0), Ie2 = ce2?.getView();
1985
- w(Ie2, { onViewChange: (e3) => {
1986
- Ae2();
1989
+ const [Ee2, Ie2] = Z((e3) => e3 + 1, 0), Ae2 = ce2?.getView();
1990
+ w(Ae2, { onViewChange: (e3) => {
1991
+ Ie2();
1987
1992
  } });
1988
- const Le2 = ae2 ?? se2, He2 = V(() => Hn(se2, Le2), [se2, Le2]), ze2 = re2 ?? se2, We2 = V(() => Hn(se2, ze2), [se2, ze2]), [$e2, Oe2] = U(null);
1993
+ const Le2 = ae2 ?? se2, He2 = V(() => Hn(se2, Le2), [se2, Le2]), ze2 = re2 ?? se2, We2 = V(() => Hn(se2, ze2), [se2, ze2]), [$e2, Oe2] = _(null);
1989
1994
  K(() => {
1990
1995
  me2.current.focus();
1991
1996
  }, []);
1992
- const Ve2 = ia({ workbook: ce2, workbookElement: Ce2.current, target: () => me2.current, commands: g2, darkMode: He2.body.darkMode, onNewWorkbook: a2 }), Ke2 = q(null), [Ge2, Ue2] = U(false), [je2, qe2] = U(null), [Xe2, Ze2] = U(Nt.Top), [Ye2, Qe2] = U(x.EmptyBounds), et2 = K(() => {
1993
- Ue2(false), qe2(null);
1997
+ const Ve2 = ia({ workbook: ce2, workbookElement: Ce2.current, target: () => me2.current, commands: g2, darkMode: He2.body.darkMode, onNewWorkbook: a2 }), Ke2 = q(null), [Ge2, _e2] = _(false), [Ue2, qe2] = _(null), [Xe2, Ze2] = _(Nt.Top), [Ye2, Qe2] = _(x.EmptyBounds), et2 = K(() => {
1998
+ _e2(false), qe2(null);
1994
1999
  }, []), tt2 = K((e3, t3, o3 = Nt.Top) => {
1995
2000
  Qe2(e3), Ze2(o3), qe2(t3), null !== Ke2.current && setTimeout(() => {
1996
2001
  null !== Ke2.current && Ke2.current.update();
1997
- }, 160), Ue2(true);
1998
- }, []), [ot2, nt2] = U("sheet"), at2 = S2 ?? Ie2?.isShowTabs(), rt2 = oe2 ?? Ie2?.isShowHorizontalScrollbar(), lt2 = h2 ?? Ie2?.isShowFormulaBar(), it2 = v2 ?? Ie2?.isShowStatusBar(), st2 = ne2 ?? Ie2?.isShowVerticalScrollbar(), dt2 = He2?.header?.edgeStrokeFill || "rgb(171,171,171)", ct2 = V(() => it2 ? P2({ sheet: Pe2, gridStyle: He2, ...T2 }) : null, [P2, T2, it2, He2, Pe2]), pt2 = V(() => E2({ commands: Ve2, workbook: Ce2.current, ...D2 }), [Ve2, E2, D2, se2]), [ut2, { width: ht2 }] = jt(), ft2 = 0 === ht2 || ht2 > 560, xt2 = V(() => {
2002
+ }, 160), _e2(true);
2003
+ }, []), [ot2, nt2] = _("sheet"), at2 = S2 ?? Ae2?.isShowTabs(), rt2 = oe2 ?? Ae2?.isShowHorizontalScrollbar(), lt2 = h2 ?? Ae2?.isShowFormulaBar(), it2 = v2 ?? Ae2?.isShowStatusBar(), st2 = ne2 ?? Ae2?.isShowVerticalScrollbar(), dt2 = He2?.header?.edgeStrokeFill || "rgb(171,171,171)", ct2 = V(() => it2 ? P2({ sheet: Pe2, gridStyle: He2, ...T2 }) : null, [P2, T2, it2, He2, Pe2]), pt2 = V(() => E2({ commands: Ve2, workbook: Ce2.current, ...D2 }), [Ve2, E2, D2, se2]), [ut2, { width: ht2 }] = Ut(), ft2 = 0 === ht2 || ht2 > 560, xt2 = V(() => {
1999
2004
  if (!at2) return null;
2000
2005
  let e3 = C2({ background: He2.body.fill, borderWidth: 1, borderColor: dt2, gridTheme: Le2, gridStyle: He2, onBeforeUserChange: Te2, onUserChange: Re2, workbook: ce2, commands: Ve2, sheetTabProps: {}, ...k2 });
2001
2006
  return ft2 || (e3 = z("div", { style: { flex: "none", display: "flex" }, children: e3 })), e3;
2002
2007
  }, [C2, k2, se2, ce2, Le2, ft2, Ve2, at2]), bt2 = K((e3) => {
2003
2008
  const { style: t3, ...o3 } = e3;
2004
2009
  let n3 = null, a3 = null, r3 = null;
2005
- if (rt2 && (a3 = z("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${dt2} 1px`, flexDirection: "column", justifyContent: "center" }, children: z(M, { ...o3, style: { paddingLeft: "4px", paddingRight: "4px", ...t3 }, touchThumbProps: { backgroundColor: Le2.palette.background.paper, borderColor: Le2.palette.primary.main, fillColor: "grey" }, endGap: 700, sheet: Pe2, onShowTooltip: (e4) => {
2010
+ if (rt2 && (a3 = z("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${dt2} 1px`, flexDirection: "column", justifyContent: "center" }, children: z(F, { ...o3, style: { paddingLeft: "4px", paddingRight: "4px", ...t3 }, touchThumbProps: { backgroundColor: Le2.palette.background.paper, borderColor: Le2.palette.primary.main, fillColor: "grey" }, endGap: 700, sheet: Pe2, onShowTooltip: (e4) => {
2006
2011
  tt2({ x: e4.anchor.x, y: e4.anchor.y, width: 0, height: 0 }, e4.display, e4.placement);
2007
2012
  }, onCloseTooltip: () => et2() }) })), at2 && ft2 && (r3 = xt2), at2 && ft2 && !rt2 && (r3 = L(J, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [r3, z(J, { sx: { borderTop: `solid ${dt2} 1px`, flex: "1" } })] })), r3 && rt2) n3 = z(vt, { position: ce2.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: e4 }) => {
2008
2013
  ce2.getView().setTabRatio(Math.round(10 * e4));
@@ -2013,33 +2018,33 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2013
2018
  n3 = r3;
2014
2019
  }
2015
2020
  return z(J, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: n3 });
2016
- }, [Pe2, Te2, ce2, He2, Le2, Ve2, at2, rt2, it2, ft2]), [yt2, wt2] = W.useState(null), St2 = V(() => ({ placement: "right-start", ...yt2?.popperProps }), [yt2?.popperProps]), { reference: kt2, component: Tt2 } = _e({ label: "contextMenu", popperProps: St2, anchor: yt2?.anchor ?? { getBoundingClientRect: () => new DOMRect(yt2?.clientX || 0, yt2?.clientY || 0) }, onClose: () => wt2(null), createPopupPanel: yt2?.createPopupPanel });
2017
- j(() => {
2021
+ }, [Pe2, Te2, ce2, He2, Le2, Ve2, at2, rt2, it2, ft2]), [yt2, wt2] = W.useState(null), St2 = V(() => ({ placement: "right-start", ...yt2?.popperProps }), [yt2?.popperProps]), { reference: kt2, component: Tt2 } = je({ label: "contextMenu", popperProps: St2, anchor: yt2?.anchor ?? { getBoundingClientRect: () => new DOMRect(yt2?.clientX || 0, yt2?.clientY || 0) }, onClose: () => wt2(null), createPopupPanel: yt2?.createPopupPanel });
2022
+ U(() => {
2018
2023
  yt2 ? kt2.open(0) : kt2.close(0);
2019
2024
  }, [yt2]);
2020
2025
  const Rt2 = gt((e3, t3) => {
2021
2026
  if (e3?.isDefaultPrevented()) return true;
2022
2027
  e3.preventDefault(), yt2 && yt2.anchor === e3.currentTarget ? wt2(null) : wt2({ anchor: e3.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (e4) => {
2023
2028
  const { floatReference: o3 } = e4;
2024
- return $2({ filter: t3, commands: Ve2, floatReference: o3, sx: { ...A2 } });
2029
+ return $2({ filter: t3, commands: Ve2, floatReference: o3, sx: { ...I2 } });
2025
2030
  } });
2026
- }, [$2, A2, Ve2, ce2, yt2]), Dt2 = gt((e3) => {
2031
+ }, [$2, I2, Ve2, ce2, yt2]), Dt2 = gt((e3) => {
2027
2032
  if (e3.originalEvent?.isDefaultPrevented()) return true;
2028
2033
  e3.originalEvent?.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
2029
2034
  const { floatReference: t3 } = e4;
2030
- return I2({ commands: Ve2, workbook: ce2, floatReference: t3, sx: { ...A2 } });
2035
+ return A2({ commands: Ve2, workbook: ce2, floatReference: t3, sx: { ...I2 } });
2031
2036
  } });
2032
- }, [I2, A2, Ve2, ce2]), Ft2 = gt((e3, t3) => {
2037
+ }, [A2, I2, Ve2, ce2]), Mt2 = gt((e3, t3) => {
2033
2038
  if (e3?.isDefaultPrevented()) return true;
2034
2039
  e3.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
2035
2040
  const { floatReference: o3 } = e4;
2036
- return O2({ movable: t3, commands: Ve2, floatReference: o3, sx: { ...A2 } });
2041
+ return O2({ movable: t3, commands: Ve2, floatReference: o3, sx: { ...I2 } });
2037
2042
  } });
2038
- }, [O2, A2, Ve2]);
2043
+ }, [O2, I2, Ve2]);
2039
2044
  V(() => {
2040
- const e3 = [new Pt("openContextMenu", () => me2.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [Mt.Shift] }, { key: "ContextMenu" }] })];
2045
+ const e3 = [new Pt("openContextMenu", () => me2.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [Ft.Shift] }, { key: "ContextMenu" }] })];
2041
2046
  Ve2.addCommands(e3, true);
2042
- }, [Ve2]), j(() => {
2047
+ }, [Ve2]), U(() => {
2043
2048
  Ve2.getCommand("openContextMenu").updateCallback(() => {
2044
2049
  const e3 = Pe2.getSelection().getCoords().cell;
2045
2050
  me2.current?.getGridElement()?.scrollCellCoordsIntoView(e3).then((t3) => {
@@ -2052,19 +2057,19 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2052
2057
  }, [Pe2]);
2053
2058
  const Et2 = gt((e3) => {
2054
2059
  Ve2?.dispatchToFocusedCommand(e3);
2055
- }, [Ve2]), At2 = gt(() => {
2056
- An(Ce2.current);
2057
- }, [ce2, Ce2.current]), It2 = K(() => {
2060
+ }, [Ve2]), It2 = gt(() => {
2061
+ In(Ce2.current);
2062
+ }, [ce2, Ce2.current]), At2 = K(() => {
2058
2063
  nt2("sheet");
2059
2064
  }, []), Lt2 = K(() => {
2060
2065
  nt2("formulaBar");
2061
2066
  }, []), Ht2 = K((e3) => {
2062
2067
  const { style: t3, ...o3 } = e3;
2063
- return z(M, { ...o3, style: { ...t3, paddingTop: "4px", paddingBottom: "4px" }, touchThumbProps: { backgroundColor: Le2.palette.background.paper, borderColor: Le2.palette.primary.main, fillColor: "grey" }, sheet: Pe2, endGap: 700, onShowTooltip: (e4) => {
2068
+ return z(F, { ...o3, style: { ...t3, paddingTop: "4px", paddingBottom: "4px" }, touchThumbProps: { backgroundColor: Le2.palette.background.paper, borderColor: Le2.palette.primary.main, fillColor: "grey" }, sheet: Pe2, endGap: 700, onShowTooltip: (e4) => {
2064
2069
  tt2(e4.anchor, e4.display, Nt.Left);
2065
2070
  }, onCloseTooltip: () => et2() });
2066
2071
  }, [Pe2, Le2]);
2067
- j(() => {
2072
+ U(() => {
2068
2073
  l2 && me2 && me2.current && me2.current.focus();
2069
2074
  }, []);
2070
2075
  const [Ot2, Vt2] = W.useState(null), Kt2 = K((e3) => {
@@ -2081,12 +2086,12 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2081
2086
  Ve2?.getCommand("insertImageFromFile")?.execute({ file: t3, options: { bounds: { x: a3.x, y: a3.y } }, goto: { range: { ...r3 } } });
2082
2087
  } else Ve2?.getCommand("openWorkbook")?.execute(t3);
2083
2088
  }
2084
- }, [Ve2, Ot2]), Ut2 = V(() => Ot2 ? z(J, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (e3) => e3.palette.divider, color: (e3) => e3.palette.primary.dark }, children: z(ee, { variant: "h4", children: Ot2 }) }) : null, [Ot2]), _t2 = q(null), qt2 = V(() => z(Jt, { in: !ye2, nodeRef: _t2, timeout: 500, classNames: "animating", unmountOnExit: true, children: z(J, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: ye2 ? "none" : i2?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: G2({ ref: _t2, transitionDelay: "0", transparentBackground: false, sx: { opacity: ye2 ? 0 : i2?.opacity, pointerEvents: ye2 ? "none" : i2?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ..._2 } }) }) }), [ye2, G2, _2]), Xt2 = V(() => y2({ sx: { marginTop: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, workbook: ce2, sheetElement: me2.current, gridStyle: He2, onFocus: Lt2, ...b2, NamedCollectionEditorProps: { restoreFocus: (e3) => me2.current.focus(e3), ...b2?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: Ve2, ...b2?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, ke2), [y2, b2, ce2, He2, Ve2, ye2]), Zt2 = K((e3) => {
2089
+ }, [Ve2, Ot2]), _t2 = V(() => Ot2 ? z(J, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (e3) => e3.palette.divider, color: (e3) => e3.palette.primary.dark }, children: z(ee, { variant: "h4", children: Ot2 }) }) : null, [Ot2]), jt2 = q(null), qt2 = V(() => z(Jt, { in: !ye2, nodeRef: jt2, timeout: 500, classNames: "animating", unmountOnExit: true, children: z(J, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: ye2 ? "none" : i2?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: G2({ ref: jt2, transitionDelay: "0", transparentBackground: false, sx: { opacity: ye2 ? 0 : i2?.opacity, pointerEvents: ye2 ? "none" : i2?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ...j2 } }) }) }), [ye2, G2, j2]), Xt2 = V(() => y2({ sx: { marginTop: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, workbook: ce2, sheetElement: me2.current, gridStyle: He2, onFocus: Lt2, ...b2, NamedCollectionEditorProps: { restoreFocus: (e3) => me2.current.focus(e3), ...b2?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: Ve2, ...b2?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, ke2), [y2, b2, ce2, He2, Ve2, ye2]), Zt2 = K((e3) => {
2085
2090
  const { movable: t3, ...o3 } = e3, n3 = { movable: t3, onContextMenuCapture: (e4) => {
2086
- Ft2(e4, t3);
2091
+ Mt2(e4, t3);
2087
2092
  }, ...o3 }, a3 = t3.getContent().getType();
2088
2093
  let r3 = null;
2089
- if ("picture" === a3) return z(F, { loadingPanel: z(Fe, { transitionDelay: "100", style: { position: "absolute" }, sx: { border: (e4) => `solid 1px ${e4.palette.action.active}` } }), picture: t3.getContent(), description: t3.getDescription() ?? t3?.getName(), ...n3 });
2094
+ if ("picture" === a3) return z(M, { loadingPanel: z(Me, { transitionDelay: "100", style: { position: "absolute" }, sx: { border: (e4) => `solid 1px ${e4.palette.action.active}` } }), picture: t3.getContent(), description: t3.getDescription() ?? t3?.getName(), ...n3 });
2090
2095
  if ("chart" === a3) {
2091
2096
  const e4 = { ...n3, chart: t3.getContent() };
2092
2097
  return z(N, { ...e4 });
@@ -2096,7 +2101,7 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2096
2101
  r3 = z(B, { ...e4 });
2097
2102
  }
2098
2103
  return z("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: r3 }, t3.getUUID());
2099
- }, []), Yt2 = V(() => Y2({ style: Pa, onFocus: It2, gridStyle: He2, headersStyle: We2, sheet: Pe2, commands: Ve2, onSheetContextMenu: Dt2, onViewportChange: (e3) => {
2104
+ }, []), Yt2 = V(() => Y2({ style: Pa, onFocus: At2, gridStyle: He2, headersStyle: We2, sheet: Pe2, commands: Ve2, onSheetContextMenu: Dt2, onViewportChange: (e3) => {
2100
2105
  Oe2(e3);
2101
2106
  }, showScrollbars: false, viewportComponent: fe2, onRepeatCommandChange: u2, onElementLoad: Se2, onShowColumnTooltip: (e3) => {
2102
2107
  tt2(e3.anchor, e3.display, Nt.Top);
@@ -2111,9 +2116,9 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2111
2116
  me2.current?.getGridElement()?.scrollTo(e4);
2112
2117
  }, showHorizontalScrollbar: rt2 || at2, showVerticalScrollbar: st2, createHorizontalScrollbar: bt2, createVerticalScrollbar: Ht2, children: Yt2 });
2113
2118
  return ft2 || 0 === ht2 || (e3 = L(H, { children: [e3, xt2] })), te2 ? te2(e3) : e3;
2114
- }, [rt2, at2, bt2, st2, $e2, ft2, Yt2, xt2, se2, te2, Le2]), eo2 = V(() => z(Me, { arrow: true, disableInteractive: true, open: Ge2, title: z(ee, { variant: "subtitle2", component: "div", children: je2 }), placement: Xe2, slotProps: { transition: { timeout: { exit: 0 } }, popper: { popperRef: Ke2, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Ge2 ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(Ye2.x, Ye2.y, Ye2.width, Ye2.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] } }, children: z(J, {}) }), [Ge2, je2, Xe2, Ye2, Ke2]), to2 = V(() => ({ boxSizing: "border-box", background: (e3) => "dark" !== e3.palette.mode ? He2.header.fill : e3.palette.background.paper, "& *": { ...Je(se2), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${dt2} 1px` }, ...i2 }), [i2, He2]), oo2 = V(() => z(J, { sx: { marginBottom: (e3) => e3.spacing(0.75) } }), []), no2 = V(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: ye2 ? void 0 : 0, "--sxl-app-color-high-contrast": se2.palette.primary.main, "--sxl-app-color-primary": se2.palette.primary.main, "--sxl-app-color-primary-dark": se2.palette.primary.dark, "--sxl-app-color-primary-light": se2.palette.primary.light, "--sxl-app-color-info": se2.palette.info.main, "--sxl-app-color-info-dark": se2.palette.info.dark, "--sxl-app-color-info-light": se2.palette.info.light, "--sxl-app-color-secondary": se2.palette.secondary.main, "--sxl-app-color-secondary-dark": se2.palette.secondary.dark, "--sxl-app-color-secondary-light": se2.palette.secondary.light, "--sxl-app-color-success": se2.palette.success.main, "--sxl-app-color-success-dark": se2.palette.success.dark, "--sxl-app-color-success-light": se2.palette.success.light, "--sxl-app-color-warning": se2.palette.warning.main, "--sxl-app-color-warning-dark": se2.palette.warning.dark, "--sxl-app-color-warning-light": se2.palette.warning.light, "--sxl-app-color-error": se2.palette.error.main, "--sxl-app-color-error-dark": se2.palette.error.dark, "--sxl-app-color-error-light": se2.palette.error.light, "--sxl-app-color-text": se2.palette.text.primary, "--sxl-app-color-text-secondary": se2.palette.text.secondary, "--sxl-app-color-text-disabled": se2.palette.text.disabled, "--sxl-app-color-background": se2.palette.background.paper, "--sxl-app-color-button-surface": se2.palette.grey[600], "--sxl-app-color-shadow": se2.palette.action.focus, "--sxl-app-color-grey": se2.palette.grey[500], "--sxl-app-filter-dark-invert": He2.body.darkMode && le2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": He2.body.darkMode ? `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` : void 0 }), [He2, se2, ye2]), ao2 = V(() => mt(nn), []);
2119
+ }, [rt2, at2, bt2, st2, $e2, ft2, Yt2, xt2, se2, te2, Le2]), eo2 = V(() => z(Fe, { arrow: true, disableInteractive: true, open: Ge2, title: z(ee, { variant: "subtitle2", component: "div", children: Ue2 }), placement: Xe2, slotProps: { transition: { timeout: { exit: 0 } }, popper: { popperRef: Ke2, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Ge2 ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(Ye2.x, Ye2.y, Ye2.width, Ye2.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] } }, children: z(J, {}) }), [Ge2, Ue2, Xe2, Ye2, Ke2]), to2 = V(() => ({ boxSizing: "border-box", background: (e3) => "dark" !== e3.palette.mode ? He2.header.fill : e3.palette.background.paper, "& *": { ...Je(se2), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${dt2} 1px` }, ...i2 }), [i2, He2]), oo2 = V(() => z(J, { sx: { marginBottom: (e3) => e3.spacing(0.75) } }), []), no2 = V(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: ye2 ? void 0 : 0, "--sxl-app-color-high-contrast": se2.palette.primary.main, "--sxl-app-color-primary": se2.palette.primary.main, "--sxl-app-color-primary-dark": se2.palette.primary.dark, "--sxl-app-color-primary-light": se2.palette.primary.light, "--sxl-app-color-info": se2.palette.info.main, "--sxl-app-color-info-dark": se2.palette.info.dark, "--sxl-app-color-info-light": se2.palette.info.light, "--sxl-app-color-secondary": se2.palette.secondary.main, "--sxl-app-color-secondary-dark": se2.palette.secondary.dark, "--sxl-app-color-secondary-light": se2.palette.secondary.light, "--sxl-app-color-success": se2.palette.success.main, "--sxl-app-color-success-dark": se2.palette.success.dark, "--sxl-app-color-success-light": se2.palette.success.light, "--sxl-app-color-warning": se2.palette.warning.main, "--sxl-app-color-warning-dark": se2.palette.warning.dark, "--sxl-app-color-warning-light": se2.palette.warning.light, "--sxl-app-color-error": se2.palette.error.main, "--sxl-app-color-error-dark": se2.palette.error.dark, "--sxl-app-color-error-light": se2.palette.error.light, "--sxl-app-color-text": se2.palette.text.primary, "--sxl-app-color-text-secondary": se2.palette.text.secondary, "--sxl-app-color-text-disabled": se2.palette.text.disabled, "--sxl-app-color-background": se2.palette.background.paper, "--sxl-app-color-button-surface": se2.palette.grey[600], "--sxl-app-color-shadow": se2.palette.action.focus, "--sxl-app-color-grey": se2.palette.grey[500], "--sxl-app-filter-dark-invert": He2.body.darkMode && le2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": He2.body.darkMode ? `linear-gradient(${Wt("#fff", $t(5))}, ${Wt("#fff", $t(5))})` : void 0 }), [He2, se2, ye2]), ao2 = V(() => mt(nn), []);
2115
2120
  return L(ue, { className: mt("sheetxl-workbook", ca, { "Mui-focusVisible": pe2 }, da, d2), sx: to2, style: s2, square: false, ...ie2, ref: Ce2, onFocus: (e3) => {
2116
- ge2(true), At2(), c2?.(e3);
2121
+ ge2(true), It2(), c2?.(e3);
2117
2122
  }, onBlur: (e3) => {
2118
2123
  ge2(false), m2?.(e3);
2119
2124
  }, onKeyDown: (e3) => {
@@ -2123,24 +2128,24 @@ const ba = (e2) => z(xa, { ...e2 }), ya = (e2) => z(ha, { ...e2 }), wa = (e2) =>
2123
2128
  const t3 = new Image();
2124
2129
  t3.src = e3.target.src, e3.dataTransfer.setDragImage(t3, 1, 1);
2125
2130
  }
2126
- }, onDragEnter: Kt2, onDragLeave: Kt2, onDragOver: Kt2, onDrop: Gt2, children: [L("div", { className: ao2, style: no2, children: [pt2, lt2 ? Xt2 : null, oo2, Qt2, ct2, eo2, Tt2, Ut2] }), qt2] });
2131
+ }, onDragEnter: Kt2, onDragLeave: Kt2, onDragOver: Kt2, onDrop: Gt2, children: [L("div", { className: ao2, style: no2, children: [pt2, lt2 ? Xt2 : null, oo2, Qt2, ct2, eo2, Tt2, _t2] }), qt2] });
2127
2132
  }));
2128
2133
  Da.displayName = "WorkbookElement";
2129
- const Ma = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:hover)": { color: (e3) => e3.palette.text.secondary }, backgroundColor: (e3) => Wt(e3.palette.background.paper, 0.6), borderRadius: (e3) => `${e3.shape.borderRadius}px`, border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (e3) => e3.palette.background.paper }, "&:hover:not([disabled])": { border: (t3) => `solid ${e2 ? t3.palette.text?.primary : t3.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (e3) => `solid ${e3.palette.primary.main} 1px !important`, border: (e3) => `1px solid ${e3.palette?.primary?.main} !important` } }, Fa = $(O((e2, t2) => {
2130
- const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] = U(false), [p2, u2] = U(false), [g2, h2] = U(a2 ?? ""), [f2, x2] = U(""), [b2, { width: y2 }] = jt(), [w2, { width: S2 }] = jt(), [k2, C2] = U(false), v2 = q(null), T2 = q(null), R2 = Ct(t2, () => ({ requestWorkbookTitle: (e3 = null, t3) => {
2134
+ const Fa = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:hover)": { color: (e3) => e3.palette.text.secondary }, backgroundColor: (e3) => Wt(e3.palette.background.paper, 0.6), borderRadius: (e3) => `${e3.shape.borderRadius}px`, border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (e3) => e3.palette.background.paper }, "&:hover:not([disabled])": { border: (t3) => `solid ${e2 ? t3.palette.text?.primary : t3.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (e3) => `solid ${e3.palette.primary.main} 1px !important`, border: (e3) => `1px solid ${e3.palette?.primary?.main} !important` } }, Ma = $(O((e2, t2) => {
2135
+ const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] = _(false), [p2, u2] = _(false), [g2, h2] = _(a2 ?? ""), [f2, x2] = _(""), [b2, { width: y2 }] = Ut(), [w2, { width: S2 }] = Ut(), [k2, C2] = _(false), v2 = q(null), T2 = q(null), R2 = Ct(t2, () => ({ requestWorkbookTitle: (e3 = null, t3) => {
2131
2136
  T2.current = { onAccept: e3, requestReason: t3?.requestReason }, t3?.selectAll && v2.current?.select(), v2.current?.focus(t3);
2132
2137
  }, focus: (e3) => {
2133
2138
  v2.current?.focus(e3);
2134
2139
  } }), []);
2135
2140
  return Q(() => {
2136
2141
  C2(a2 !== g2), x2(a2), h2(a2);
2137
- }, [a2]), j(() => {
2138
- k2 && 0 !== y2 && _t.debounce(() => {
2142
+ }, [a2]), U(() => {
2143
+ k2 && 0 !== y2 && jt.debounce(() => {
2139
2144
  C2(false);
2140
2145
  }, 300)();
2141
- }, [k2, y2]), j(() => {
2146
+ }, [k2, y2]), U(() => {
2142
2147
  u2(g2 && !to.isValidWindowsFilename(g2));
2143
- }, [g2]), s2 ? null : z(J, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: k2 ? "0" : "1", transition: k2 ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: Ut([R2, w2, t2]), ...d2, children: z(He, { label: T2.current?.requestReason ?? "Workbook Name", children: L(J, { className: mt({ "Mui-focusVisible": c2 }), sx: { visibility: 0 === y2 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...Ma(true, i2), ...o2 }, children: [i2 ? z(ee, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: g2 !== f2 ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (e3) => p2 ? e3.palette.error.dark : void 0 }, children: a2 ?? r2 }) : z(le, { sx: { width: `${Math.min(y2 + 3, Math.max(S2, R2.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (e3) => p2 ? e3.palette.error.dark : void 0, fontStyle: g2 !== f2 ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: true, fullWidth: false, multiline: false, readOnly: i2, spellCheck: false, placeholder: r2, onFocus: (e3) => {
2148
+ }, [g2]), s2 ? null : z(J, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: k2 ? "0" : "1", transition: k2 ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: _t([R2, w2, t2]), ...d2, children: z(He, { label: T2.current?.requestReason ?? "Workbook Name", children: L(J, { className: mt({ "Mui-focusVisible": c2 }), sx: { visibility: 0 === y2 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...Fa(true, i2), ...o2 }, children: [i2 ? z(ee, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: g2 !== f2 ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (e3) => p2 ? e3.palette.error.dark : void 0 }, children: a2 ?? r2 }) : z(le, { sx: { width: `${Math.min(y2 + 3, Math.max(S2, R2.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (e3) => p2 ? e3.palette.error.dark : void 0, fontStyle: g2 !== f2 ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: true, fullWidth: false, multiline: false, readOnly: i2, spellCheck: false, placeholder: r2, onFocus: (e3) => {
2144
2149
  m2(true), e3.target?.select();
2145
2150
  }, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: v2 }, onBlur: () => {
2146
2151
  m2(false), p2 ? h2(f2) : (g2 !== f2 && (l2?.(g2), g2 && T2.current?.onAccept?.(g2, "blur")), T2.current = null);
@@ -2153,9 +2158,9 @@ const Ma = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:h
2153
2158
  }, 0)), T2.current = null, e3.stopPropagation(), e3.preventDefault());
2154
2159
  }, value: g2 }), z(J, { ref: b2, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: g2 !== f2 ? "italic" : void 0, fontFamily: (e3) => e3.typography.fontFamily, letterSpacing: "0.00938em" }, children: g2 || r2 })] }) }) });
2155
2160
  }));
2156
- Fa.displayName = "WorkbookTitle";
2161
+ Ma.displayName = "WorkbookTitle";
2157
2162
  const Na = $(O((e2, t2) => {
2158
- const { title: o2, commands: n2, className: a2, ...r2 } = e2, l2 = St(), [i2, s2] = U(false), [d2, c2] = U(false), m2 = q(null), [p2, u2] = Z((e3) => e3 + 1, 0), [g2, { width: h2 }] = jt(), f2 = pt(n2, ["editTable"])[0].context(), x2 = f2.table(), [b2, y2] = U(() => x2 ? f2.getNames().getRanges(x2.getRange()) : null), S2 = V(() => x2?.getName() ?? "", [x2]);
2163
+ const { title: o2, commands: n2, className: a2, ...r2 } = e2, l2 = St(), [i2, s2] = _(false), [d2, c2] = _(false), m2 = q(null), [p2, u2] = Z((e3) => e3 + 1, 0), [g2, { width: h2 }] = Ut(), f2 = pt(n2, ["editTable"])[0].context(), x2 = f2.table(), [b2, y2] = _(() => x2 ? f2.getNames().getRanges(x2.getRange()) : null), S2 = V(() => x2?.getName() ?? "", [x2]);
2159
2164
  w(f2.table(), { onAnchorCoordsChange(e3) {
2160
2165
  y2(f2.getNames().getRanges(e3.getRange()));
2161
2166
  }, onProtectedChange(e3) {
@@ -2169,13 +2174,13 @@ const Na = $(O((e2, t2) => {
2169
2174
  let v2 = null;
2170
2175
  return f2.table() || (v2 = z(ee, { component: "div", style: { top: "0", left: "0", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center" }, children: "No table selected" })), z(ue, { square: true, onFocus: () => s2(true), onBlur: (e3) => {
2171
2176
  m2?.current?.contains(e3.relatedTarget) || s2(false);
2172
- }, ref: Ut([m2, g2, t2]), sx: { display: "flex", flexDirection: "column", flex: "1 1 auto", width: "100%", height: "100%", overflow: "auto", paddingLeft: (e3) => e3.spacing(1.5), paddingRight: (e3) => e3.spacing(1.5), paddingTop: (e3) => e3.spacing(1.5), paddingBottom: (e3) => e3.spacing(1.5), boxSizing: "border-box" }, className: mt("sxl-table-details-panel", a2, { "sxl-has-focus": i2 }), ...r2, children: v2 || L(J, { sx: { display: "flex", flex: "1 1 auto", flexDirection: "column", transition: "opacity 60ms", opacity: f2.table() ? 1 : 0 }, children: [z(J, { sx: { containerType: "inline-size", display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingTop: (e3) => e3.spacing(2), paddingLeft: (e3) => e3.spacing(2), paddingRight: (e3) => e3.spacing(2) }, children: L(J, { className: pn, children: [z(gn, { formName: "name", defaultInput: S2, value: x2?.getName() ?? "No table", onChangeInput: k2, onValidate: (e3) => {
2177
+ }, ref: _t([m2, g2, t2]), sx: { display: "flex", flexDirection: "column", flex: "1 1 auto", width: "100%", height: "100%", overflow: "auto", paddingLeft: (e3) => e3.spacing(1.5), paddingRight: (e3) => e3.spacing(1.5), paddingTop: (e3) => e3.spacing(1.5), paddingBottom: (e3) => e3.spacing(1.5), boxSizing: "border-box" }, className: mt("sxl-table-details-panel", a2, { "sxl-has-focus": i2 }), ...r2, children: v2 || L(J, { sx: { display: "flex", flex: "1 1 auto", flexDirection: "column", transition: "opacity 60ms", opacity: f2.table() ? 1 : 0 }, children: [z(J, { sx: { containerType: "inline-size", display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingTop: (e3) => e3.spacing(2), paddingLeft: (e3) => e3.spacing(2), paddingRight: (e3) => e3.spacing(2) }, children: L(J, { className: pn, children: [z(gn, { formName: "name", defaultInput: S2, value: x2?.getName() ?? "No table", onChangeInput: k2, onValidate: (e3) => {
2173
2178
  x2 && x2.getName().toLowerCase() === e3.toLowerCase() || f2?.getNames().validateName(e3);
2174
2179
  }, disabled: x2?.isProtected() ?? true, onFocus: (e3) => {
2175
2180
  d2 || e3.target?.select(), c2(true);
2176
2181
  } }), z(fn, { formName: "range", value: b2, onChangeInput: C2, resolvedAddress: f2.getNames().getRanges.bind(f2.getNames()), disabled: x2?.isProtected() ?? true, onFocus: (e3) => {
2177
2182
  d2 || e3.target?.select(), c2(true);
2178
- } })] }) }), L(J, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", containerType: "inline-size", gap: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1) }, children: [z(Te, { orientation: "horizontal", sx: { marginTop: (e3) => e3.spacing(1.5), marginBottom: (e3) => e3.spacing(0.75) } }), z(J, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", justifyContent: "start", flexDirection: "column", marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: L("div", { style: { display: "flex", alignItems: "start", gap: "2px" }, children: [z(rn, { table: x2, styles: f2.styles(), bodyStyle: f2.bodyStyle(), cellHeight: 30, isLive: true }), z(Ia, { command: n2.getCommand("formatTableStyle"), commands: n2, disabledQuickKey: true })] }) }), z(Te, { orientation: "horizontal", sx: { marginTop: (e3) => e3.spacing(1.5), marginBottom: (e3) => e3.spacing(0.75) } }), z(mn, { disabled: x2?.isProtected(), styleOptions: x2?.getStyleOptions() ?? null, onStyleOptionsChange: (e3) => {
2183
+ } })] }) }), L(J, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", containerType: "inline-size", gap: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1) }, children: [z(Te, { orientation: "horizontal", sx: { marginTop: (e3) => e3.spacing(1.5), marginBottom: (e3) => e3.spacing(0.75) } }), z(J, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", justifyContent: "start", flexDirection: "column", marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: L("div", { style: { display: "flex", alignItems: "start", gap: "2px" }, children: [z(rn, { table: x2, styles: f2.styles(), bodyStyle: f2.bodyStyle(), cellHeight: 30, isLive: true }), z(Aa, { command: n2.getCommand("formatTableStyle"), commands: n2, disabledQuickKey: true })] }) }), z(Te, { orientation: "horizontal", sx: { marginTop: (e3) => e3.spacing(1.5), marginBottom: (e3) => e3.spacing(0.75) } }), z(mn, { disabled: x2?.isProtected(), styleOptions: x2?.getStyleOptions() ?? null, onStyleOptionsChange: (e3) => {
2179
2184
  x2.updateStyleOptions(e3);
2180
2185
  }, showHeaderRow: x2?.getShowHeaders(), onShowHeaderRowChange: (e3) => {
2181
2186
  try {
@@ -2201,7 +2206,7 @@ const Na = $(O((e2, t2) => {
2201
2206
  return z(Na, { ref: t2, commands: n2, ...l2 });
2202
2207
  }, Ea = () => {
2203
2208
  Rt.register("plugin-table", { icons: {} }), v.registerTaskPane({ key: "tableDetails", getTitle: () => "Table Details", getIcon: () => "Table", renderTaskPane: Ba }, true);
2204
- }, Aa = $((e2) => {
2209
+ }, Ia = $((e2) => {
2205
2210
  const { table: t2, tableStyle: o2, selectedTableStyleName: n2, onSelectTableStyleName: a2, styles: r2, hasContextMenu: l2 = true, bodyStyle: i2, parentFloat: s2, commands: d2, disabled: c2, commandHook: m2, useCanvasPreview: p2 = true, canvas: u2, ...g2 } = e2, h2 = K((e3) => {
2206
2211
  const t3 = { variant: ut.Menuitem, commandHook: m2, context: "table" }, n3 = L(H, { children: [z(ve, { ...t3, command: d2.getCommand("formatTableStyleClearCellStyles"), commandState: o2, disabled: c2 }), z(ve, { ...t3, style: { fontWeight: 550 }, command: d2.getCommand("formatTableStyle"), commandState: { name: o2.getName() }, disabled: c2 }), z(Te, { orientation: "horizontal" }), z(ve, { ...t3, command: d2.getCommand("setDefaultTableStyle"), commandState: o2.getName(), disabled: c2 }), z(Te, { orientation: "horizontal" }), z(ve, { ...t3, command: d2.getCommand("deleteTableStyle"), commandState: o2?.getName(), disabled: c2 || !o2 || o2.isBuiltIn() })] });
2207
2212
  return Re({ ...e3, children: z(J, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: z(J, { sx: { overflow: "auto", flex: "1 1 100%" }, children: n3 }) }) });
@@ -2213,7 +2218,7 @@ const Na = $(O((e2, t2) => {
2213
2218
  a2?.(o2?.getName());
2214
2219
  }, ...g2, children: x2 }, o2.getName());
2215
2220
  return l2 && (b2 = z(Ge, { label: t2.getStyleOptions().name, parentFloat: s2, createPopupPanel: h2, children: b2 })), b2;
2216
- }), Ia = $(O((e2, t2) => {
2221
+ }), Aa = $(O((e2, t2) => {
2217
2222
  const { commands: o2, command: n2, commandHook: a2, selectedTable: r2, onSelectTableStyleName: l2, disabled: i2 = false, bodyStyle: s2, disabledQuickKey: d2 = false, usePreviewIcon: c2 = false, ...p2 } = e2;
2218
2223
  bt(n2);
2219
2224
  const u2 = n2?.context(), g2 = u2?.styles, h2 = r2 ?? u2?.table?.();
@@ -2222,8 +2227,8 @@ const Na = $(O((e2, t2) => {
2222
2227
  const x2 = V(() => ((e3, t3) => {
2223
2228
  const o3 = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
2224
2229
  return new m({ initialAnchor: o3, styles: t3, json: { name: "PreviewTable", ref: o3, description: "PreviewTable", headerRowCount: 1, totalsRowCount: 0, styleOptions: e3 } });
2225
- })(h2?.getStyleOptions(), g2?.()), [g2?.().getDefaultTableStyle(), h2?.getStyleOptions()]), b2 = h2 ?? x2, [y2, w2] = U(b2);
2226
- j(() => {
2230
+ })(h2?.getStyleOptions(), g2?.()), [g2?.().getDefaultTableStyle(), h2?.getStyleOptions()]), b2 = h2 ?? x2, [y2, w2] = _(b2);
2231
+ U(() => {
2227
2232
  w2(b2);
2228
2233
  }, [b2]);
2229
2234
  const S2 = s2 ?? u2?.bodyStyle(), k2 = gt((e3) => {
@@ -2233,7 +2238,7 @@ const Na = $(O((e2, t2) => {
2233
2238
  C2.current || (C2.current = document.createElement("canvas"));
2234
2239
  const n3 = (e4) => {
2235
2240
  const n4 = g2().getTableStyle(e4);
2236
- return n4 ? z(Aa, { table: y2, tableStyle: n4, selectedTableStyleName: y2.getStyleOptions().name, bodyStyle: u2.bodyStyle(), commands: t3, commandHook: a2, canvas: C2.current, ...o3 }, e4) : null;
2241
+ return n4 ? z(Ia, { table: y2, tableStyle: n4, selectedTableStyleName: y2.getStyleOptions().name, bodyStyle: u2.bodyStyle(), commands: t3, commandHook: a2, canvas: C2.current, ...o3 }, e4) : null;
2237
2242
  }, r3 = (e4, t4, o4 = true) => {
2238
2243
  const a3 = [];
2239
2244
  for (let e5 = 0; e5 < t4.length; e5++) {
@@ -2312,7 +2317,7 @@ const Oa = new Map([{ key: "financial", label: "Financial", icon: "FormulaFinanc
2312
2317
  e3(t3.getSummary());
2313
2318
  });
2314
2319
  });
2315
- return z(Ae, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...d2 }, disabled: a2, tooltipProps: { label: m2, maxWidth: 1e3 }, onMouseDown: (e3) => {
2320
+ return z(Ie, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...d2 }, disabled: a2, tooltipProps: { label: m2, maxWidth: 1e3 }, onMouseDown: (e3) => {
2316
2321
  0 === e3.button && e3.preventDefault();
2317
2322
  }, onMouseUp: (e3) => {
2318
2323
  0 === e3.button && l2(o2);
@@ -2330,8 +2335,8 @@ const Oa = new Map([{ key: "financial", label: "Financial", icon: "FormulaFinanc
2330
2335
  }));
2331
2336
  Ka.displayName = "InsertFunctionCommandPopupButton";
2332
2337
  const Ga = $(O((e2, t2) => {
2333
- const { commands: o2, category: n2, commandHook: a2, ...r2 } = e2, l2 = pt(o2, ["insertFunction"]), [i2, s2] = U([]), [d2, c2] = U(false);
2334
- j(() => {
2338
+ const { commands: o2, category: n2, commandHook: a2, ...r2 } = e2, l2 = pt(o2, ["insertFunction"]), [i2, s2] = _([]), [d2, c2] = _(false);
2339
+ U(() => {
2335
2340
  (async () => {
2336
2341
  c2(true);
2337
2342
  const e3 = l2[0]?.context(), t3 = await e3.searchByCategory(n2);
@@ -2346,74 +2351,93 @@ const Ga = $(O((e2, t2) => {
2346
2351
  p2[e3] = z(Va, { command: u2, formulaFunction: t3, handleInsert: g2 }, `formula-${t3.getName()}-${e3}`);
2347
2352
  }
2348
2353
  return Re({ ...r2, children: z(J, { ref: t2, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: m2 > 0 ? z(H, { children: z(J, { sx: { overflow: "auto", flex: "1 1 100%" }, children: p2 }) }) : null }) });
2349
- })), Ua = $(O((e2, t2) => {
2354
+ })), _a = $(O((e2, t2) => {
2350
2355
  const { sx: o2, style: n2, className: a2, licenseKey: r2, renderLoadingPanel: l2, ...i2 } = e2;
2351
2356
  r2 && h.setLicenseKey(r2);
2352
2357
  const s2 = V(() => {
2353
2358
  const e3 = { transitionDelay: "160ms", transparentBackground: true };
2354
- return z(J, { sx: o2, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, children: l2?.(e3) ?? z(Fe, { ...e3 }) });
2355
- }, [o2, n2, l2]), d2 = V(() => W.lazy(async () => await Promise.resolve().then(() => dr)), []);
2356
- return z(H, { children: z(_, { fallback: s2, children: z(d2, { ...i2, className: a2, renderLoadingPanel: l2, sx: o2, style: n2, ref: t2 }) }) });
2359
+ return z(J, { sx: o2, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, children: l2?.(e3) ?? z(Me, { ...e3 }) });
2360
+ }, [o2, n2, l2]), d2 = V(() => W.lazy(async () => await Promise.resolve().then(() => ir)), []);
2361
+ return z(H, { children: z(j, { fallback: s2, children: z(d2, { ...i2, className: a2, renderLoadingPanel: l2, sx: o2, style: n2, ref: t2 }) }) });
2357
2362
  }));
2358
- Ua.displayName = "Studio";
2359
- const ja = [{ key: "SheetXL", description: "SheetXL", mimeType: ".sxl", exts: ["sxl"], handler: null, isDefault: true }, { key: "CSV", description: "Comma Delimited", mimeType: "text/csv", exts: ["csv"], handler: null }, { key: "Excel", description: "Excel Workbook", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", exts: ["xlsx", "xls", "xlsm"], handler: null }], _a = [{ key: "SheetXL", mimeType: "application/vnd.sheetxl.sheet", description: "SheetXL", ext: "sxl", handler: null, isDefault: true }, { key: "CSV", mimeType: "text/csv", description: "Comma Delimited", ext: "csv", handler: null }, { key: "Excel", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", description: "Excel Workbook", ext: "xlsx", tags: ["SheetJS Pro"], handler: null }];
2360
- class qa {
2361
- constructor(e2 = ja, t2 = _a) {
2362
- this._readFormatType = [], this._writeFormatType = [], this._readFormatType = Object.freeze([...e2]), this._writeFormatType = Object.freeze([...t2]);
2363
+ _a.displayName = "Studio";
2364
+ class Ua {
2365
+ constructor() {
2366
+ this._loadedIO = null;
2363
2367
  }
2364
- getReadFormats() {
2365
- return this._readFormatType;
2366
- }
2367
- getWriteFormats() {
2368
- return this._writeFormatType;
2369
- }
2370
- getAllReadFormatTypeAsString() {
2371
- const e2 = [], t2 = this._readFormatType;
2372
- for (let o2 = 0; o2 < t2.length; o2++) for (let n2 = 0; n2 < t2[o2].exts.length; n2++) e2.push("." + t2[o2].exts[n2]);
2373
- return e2;
2374
- }
2375
- async writeFile(e2, t2, o2) {
2376
- if (!t2 || !e2) throw new Error("Workbook model or file name must be provided.");
2368
+ async _loadIO() {
2369
+ let e2 = this._loadedIO;
2370
+ if (e2) return e2;
2377
2371
  try {
2378
- return (await import("@sheetxl/io")).WorkbookIO.writeFile(e2, t2, o2);
2372
+ e2 = (await import("@sheetxl/io")).WorkbookIO, this._loadedIO = e2;
2379
2373
  } catch (e3) {
2380
- throw new Error("Unable to load io library", { cause: e3 });
2374
+ throw e3;
2381
2375
  }
2376
+ return e2;
2377
+ }
2378
+ async getReadFormats(e2) {
2379
+ return (await this._loadIO()).getReadFormats(e2);
2380
+ }
2381
+ async getWriteFormats(e2) {
2382
+ return (await this._loadIO()).getWriteFormats(e2);
2383
+ }
2384
+ async writeArrayBuffer(e2, t2) {
2385
+ return (await this._loadIO()).writeArrayBuffer(e2, t2);
2382
2386
  }
2383
2387
  async read(e2, t2) {
2384
2388
  let o2, n2;
2385
- const a2 = await t2?.showBusy?.(`Opening${e2.name ? ` ${e2.name}` : ""}...`);
2386
2389
  try {
2387
- n2 = await import("@sheetxl/io");
2388
- } catch (e3) {
2389
- throw e3;
2390
- }
2391
- try {
2392
- return await n2.WorkbookIO.read({ ...e2, progress: { async onStart(n3) {
2390
+ n2 = await t2?.showBusy?.(`Opening${e2.name ? ` ${e2.name}` : ""}...`);
2391
+ const a2 = await this._loadIO(), r2 = await a2.read({ ...e2, progress: { async onStart(n3) {
2393
2392
  await e2?.progress?.onStart?.(n3), o2 = await t2?.showBusy?.(`Opening '${n3}'...`);
2394
2393
  } } });
2394
+ return n2?.(), o2?.(), r2;
2395
2395
  } catch (e3) {
2396
- throw a2?.(), o2?.(), e3;
2397
- } finally {
2398
- a2?.(), o2?.();
2396
+ throw n2?.(), o2?.(), e3;
2399
2397
  }
2400
2398
  }
2399
+ async writeFile(e2, t2, o2) {
2400
+ return (await this._loadIO()).writeFile(e2, t2, o2);
2401
+ }
2402
+ async registerReadFormat(e2) {
2403
+ return (await this._loadIO()).registerReadFormat(e2);
2404
+ }
2405
+ async registerWriteFormat(e2) {
2406
+ return (await this._loadIO()).registerWriteFormat(e2);
2407
+ }
2408
+ async getAllReadFormatsAsString() {
2409
+ const e2 = await this._loadIO(), t2 = await e2.getReadFormats(), o2 = [], n2 = t2.length;
2410
+ for (let e3 = 0; e3 < n2; e3++) {
2411
+ const n3 = t2[e3].exts, a2 = n3.length;
2412
+ for (let e4 = 0; e4 < a2; e4++) o2.push("." + n3[e4]);
2413
+ }
2414
+ return o2.join(", ");
2415
+ }
2401
2416
  }
2402
- const Xa = new qa(), Za = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Ya = $(O((e2, t2) => {
2403
- const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } = oo(), d2 = zt(), [c2, m2] = U(false), p2 = Xt.collectErrorChain(r2, true)?.[0]?.error, u2 = p2 && !(p2 instanceof Zt), g2 = K(() => {
2417
+ const ja = new Ua(), qa = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Xa = $(O((e2, t2) => {
2418
+ const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } = oo(), d2 = zt(), [c2, m2] = _(false), p2 = Xt.collectErrorChain(r2, true)?.[0]?.error, u2 = p2 && !(p2 instanceof Zt), g2 = K(() => {
2404
2419
  m2((e3) => !e3);
2405
2420
  }, []), h2 = K(() => {
2406
2421
  s2(o2);
2407
2422
  }, [o2, s2]);
2408
2423
  let f2 = p2?.message;
2409
- return !f2 && G(n2) && (f2 = n2), f2 || "string" != typeof n2 || (f2 = n2), f2 || (f2 = `Unknown Error: ${n2}`), z(no, { ref: t2, className: mt(Za.root, "error-snackbar"), children: L(ye, { className: Za.card, style: { backgroundColor: d2.palette.error.dark, border: `1px solid ${d2.palette.error.dark}` }, children: [L(we, { className: Za.actionRoot, children: [l2 ? null : a2?.error, z(ee, { variant: "body2", component: "div", className: Za.typography, children: f2 }), z("div", { style: { flex: "1 1 auto" } }), L("div", { className: Za.icons, children: [u2 ? z(te, { "aria-label": "Show more", size: "small", className: mt(Za.expand, { [Za.expandOpen]: c2 }), onClick: g2, children: z(xt, { iconKey: "ExpandMore" }) }) : null, z(te, { size: "small", className: Za.expand, onClick: h2, children: z(xt, { iconKey: "Close", style: { transform: "scale(0.8)" } }) })] })] }), u2 ? z(Se, { in: c2, timeout: "auto", children: z("div", { className: Za.stackTraceContainer, style: { backgroundColor: d2.palette.error.light, borderTop: `1px solid ${d2.palette.error.main}` }, children: z(et, { error: r2, hideLineNumbers: true }) }) }) : null] }) });
2424
+ return !f2 && G(n2) && (f2 = n2), f2 || "string" != typeof n2 || (f2 = n2), f2 || (f2 = `Unknown Error: ${n2}`), z(no, { ref: t2, className: mt(qa.root, "error-snackbar"), children: L(ye, { className: qa.card, style: { backgroundColor: d2.palette.error.dark, border: `1px solid ${d2.palette.error.dark}` }, children: [L(we, { className: qa.actionRoot, children: [l2 ? null : a2?.error, z(ee, { variant: "body2", component: "div", className: qa.typography, children: f2 }), z("div", { style: { flex: "1 1 auto" } }), L("div", { className: qa.icons, children: [u2 ? z(te, { "aria-label": "Show more", size: "small", className: mt(qa.expand, { [qa.expandOpen]: c2 }), onClick: g2, children: z(xt, { iconKey: "ExpandMore" }) }) : null, z(te, { size: "small", className: qa.expand, onClick: h2, children: z(xt, { iconKey: "Close", style: { transform: "scale(0.8)" } }) })] })] }), u2 ? z(Se, { in: c2, timeout: "auto", children: z("div", { className: qa.stackTraceContainer, style: { backgroundColor: d2.palette.error.light, borderTop: `1px solid ${d2.palette.error.main}` }, children: z(et, { error: r2, hideLineNumbers: true }) }) }) : null] }) });
2410
2425
  }));
2411
- Ya.displayName = "ToastError";
2412
- const Qa = $(O((e2, t2) => {
2413
- const { commands: o2, commandHook: n2, scope: a2 = "workbook", disabled: r2 = false, ...l2 } = e2, i2 = gt((e3) => {
2426
+ Xa.displayName = "ToastError";
2427
+ const Za = $(O((e2, t2) => {
2428
+ const { commands: o2, commandHook: n2, scope: a2 = "workbook", disabled: r2 = false, ...l2 } = e2, [i2, s2] = _([]);
2429
+ U(() => {
2430
+ let e3 = true;
2431
+ return ja.getWriteFormats().then((t3) => {
2432
+ e3 && s2(t3);
2433
+ }), () => {
2434
+ e3 = false;
2435
+ };
2436
+ }, []);
2437
+ const d2 = gt((e3) => {
2414
2438
  const t3 = { variant: ut.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = L(H, { children: [z(ve, { ...t3, command: o2.getCommand("newWorkbook") }), z(Te, { orientation: "horizontal" }), z(ve, { ...t3, command: o2.getCommand("openWorkbook") }), z(Pe, { ...t3, commands: o2, quickCommand: "saveWorkbook", createPopupPanel: (e4) => {
2415
2439
  const n3 = { ...t3, parentFloat: e4.floatReference, scope: "saveWorkbook" }, a3 = [];
2416
- return Xa.getWriteFormats().forEach((e5) => {
2440
+ return i2.forEach((e5) => {
2417
2441
  if (e5.isDefault) return;
2418
2442
  const t4 = e5.key, r3 = o2.getCommand(`saveWorkbookAs${t4}`);
2419
2443
  r3 ? a3.push(X(ve, { ...n3, key: t4, command: r3 })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${t4}'`);
@@ -2424,86 +2448,91 @@ const Qa = $(O((e2, t2) => {
2424
2448
  return Re({ ...e3, children: l3, onClick: (t4) => {
2425
2449
  t4.isDefaultPrevented || e3.closeFloatAll();
2426
2450
  } });
2427
- }, [r2, o2, n2, a2]), s2 = "File";
2428
- return z(Pe, { commands: o2, disabled: r2, commandHook: n2, scope: a2, label: s2, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (e3) => `calc(1.25rem + ${e3.spacing(2)}px)` } }, ...l2, createPopupPanel: i2, icon: z(Ve, { className: "label", icon: null, label: s2 }) });
2451
+ }, [r2, o2, n2, a2, i2]), c2 = "File";
2452
+ return z(Pe, { commands: o2, disabled: r2, commandHook: n2, scope: a2, label: c2, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (e3) => `calc(1.25rem + ${e3.spacing(2)}px)` } }, ...l2, createPopupPanel: d2, icon: z(Ve, { className: "label", icon: null, label: c2 }) });
2429
2453
  }));
2430
- Qa.displayName = "StandaloneFileCommandButton";
2431
- const Ja = z(He, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: z(J, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: z(E, { onClick: () => {
2454
+ Za.displayName = "StandaloneFileCommandButton";
2455
+ const Ya = z(He, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: z(J, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: z(E, { onClick: () => {
2432
2456
  window?.open("https://www.sheetxl.com", "_blank");
2433
- }, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), er = $(O((e2, t2) => {
2434
- const { commands: o2, workbook: n2, logo: a2 = Ja, mainElement: r2, showFileMenu: l2 = true, showAppearanceMenu: i2 = true, ...s2 } = e2, { reference: d2 } = _e(), [c2, { width: m2 }] = jt(), p2 = m2 < 530, u2 = l2 ? z(Qa, { commands: o2, commandHook: { beforeExecute() {
2457
+ }, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Qa = $(O((e2, t2) => {
2458
+ const { commands: o2, workbook: n2, logo: a2 = Ya, mainElement: r2, showFileMenu: l2 = true, showAppearanceMenu: i2 = true, ...s2 } = e2, { reference: d2 } = je(), [c2, { width: m2 }] = Ut(), p2 = m2 < 530, u2 = l2 ? z(Za, { commands: o2, commandHook: { beforeExecute() {
2435
2459
  d2?.closeAll();
2436
2460
  }, onError(e3, t3, o3) {
2437
2461
  } } }) : null, g2 = i2 ? z(Ha, { commands: o2, commandHook: { beforeExecute() {
2438
2462
  d2?.closeAll();
2439
2463
  }, onError(e3, t3, o3) {
2440
2464
  } } }) : null, h2 = V(() => ({ paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }), []), f2 = q(null);
2441
- return z(J, { ref: Ut([f2, c2, t2]), ...s2, children: oa({ commands: o2, renderCompact: p2, workbook: n2, selectWrapper: (e3) => L(J, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (e4) => e4.spacing(1), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1) }, children: [L(J, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e4) => e4.spacing(0.5) }, children: [a2, L(J, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e4) => e4.spacing(0.25) }, children: [u2, e3] })] }), z(J, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: r2 }), z(J, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: p2 && !g2 ? "0 0 auto" : "1 1 100%" }, children: g2 })] }), selectProps: h2, toolbarsProps: { Home: { sx: {} } } }) });
2465
+ return z(J, { ref: _t([f2, c2, t2]), ...s2, children: oa({ commands: o2, renderCompact: p2, workbook: n2, selectWrapper: (e3) => L(J, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (e4) => e4.spacing(1), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1) }, children: [L(J, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e4) => e4.spacing(0.5) }, children: [a2, L(J, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e4) => e4.spacing(0.25) }, children: [u2, e3] })] }), z(J, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: r2 }), z(J, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: p2 && !g2 ? "0 0 auto" : "1 1 100%" }, children: g2 })] }), selectProps: h2, toolbarsProps: { Home: { sx: {} } } }) });
2442
2466
  }));
2443
- er.displayName = "StudioToolbar";
2444
- const tr = $((e2) => {
2467
+ Qa.displayName = "StudioToolbar";
2468
+ const Ja = $((e2) => {
2445
2469
  const { workbook: t2, setWorkbook: o2, refWorkbookTitle: n2, titleWorkbook: a2, setWorkbookTitle: r2, titlePlaceHolder: l2, children: i2, undoManager: s2, commands: d2, importExportDisabled: c2, themeOptions: m2 } = e2, p2 = ((e3) => {
2446
2470
  const { workbook: t3, setWorkbook: o3, importExportDisabled: n3, workbookTitle: a3 = "export", setWorkbookTitle: r3, requestWorkbookTitle: l3, themeOptions: i3, undoManager: s3, commands: d3, onExecute: c3 } = e3, m3 = St(), p3 = gt(i3?.onModeChange, [i3?.onModeChange]), u3 = gt(i3?.onEnabledDarkGridChange, [i3?.onEnabledDarkGridChange]), g3 = gt(i3?.onEnabledDarkImagesChange, [i3?.onEnabledDarkImagesChange]), h2 = gt(async (e4 = null, t4 = null) => {
2447
2471
  const o4 = [];
2448
2472
  let n4, a4 = null, r4 = null;
2449
- if ("string" == typeof e4 ? r4 = e4 : a4 = e4, n4 = a4 ? e4 : await _t.openFileDialog(r4 ?? Xa.getAllReadFormatTypeAsString().join(",")), !n4) return null;
2473
+ if ("string" == typeof e4 ? r4 = e4 : a4 = e4, n4 = a4 ? e4 : await jt.openFileDialog(r4 ?? await ja.getAllReadFormatsAsString()), !n4) return null;
2450
2474
  const l4 = { source: n4, createWorkbookOptions: t4, onWarning: (e5) => {
2451
2475
  o4.push(e5);
2452
- } }, i4 = await Xa.read(l4, m3);
2476
+ } }, i4 = await ja.read(l4, m3);
2453
2477
  return o4.length > 0 && (m3.showMessage("Some elements were not able to be imported. See console for details."), console.warn("Import warnings:\n" + o4.join("\n"))), i4;
2454
2478
  }, [c3, m3, t3]), f2 = gt(async (e4, t4, o4) => {
2455
2479
  if (!t4 && l3) {
2456
- const t5 = await l3("Enter Workbook name to " + (o4.isDefault ? "Save." : `Export as ${o4.description}.`));
2457
- return null !== t5 && Xa.writeFile(t5, e4, { formatType: o4.key });
2480
+ const t5 = await l3("Enter Workbook name to " + (o4?.isDefault ? "Save." : `Export as ${o4?.description}.`));
2481
+ return null !== t5 && ja.writeFile(t5, e4, { format: o4.key });
2458
2482
  }
2459
- return Xa.writeFile(t4, e4, { formatType: o4.key });
2483
+ return ja.writeFile(t4, e4, { format: o4.key });
2460
2484
  }, [m3, t3, l3]), x2 = K(() => ({ contains: (e4) => true, focus() {
2461
- } }), []), b2 = V(() => {
2462
- const e4 = [];
2463
- n3 || (Xa.getWriteFormats().forEach((o4) => {
2464
- const n4 = o4.isDefault, r4 = { label: n4 ? "Save Workbook" : `Save Workbook as ${o4.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${o4.description}` }, tags: o4.tags, description: `Save the workbook to the desktop${n4 ? "" : ` as ${o4.description}`}.`, icon: "FileDownloadAsSheet" };
2465
- n4 && (r4.shortcut = { key: "S", modifiers: [Mt.Ctrl] }, e4.push(new Dt("saveWorkbookAs", x2, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [Mt.Shift, Mt.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
2466
- f2(t3, null, o4).catch((e5) => {
2467
- m3.showError(e5);
2468
- });
2469
- })));
2470
- const l5 = o4.key, i4 = n4 ? "saveWorkbook" : `saveWorkbookAs${l5}`;
2471
- "CSV" === l5 ? r4.icon = "FileDownloadAsCSV" : "Excel" === l5 && (r4.icon = "FileDownloadAsExcel"), e4.push(new Dt(i4, x2, r4, (e5) => {
2472
- f2(t3, e5 ?? a3, o4).catch((e6) => {
2485
+ } }), []), [b2, y2] = W.useState([]);
2486
+ U(() => {
2487
+ n3 ? y2([]) : (async () => {
2488
+ const e4 = [];
2489
+ (await ja.getWriteFormats()).forEach((o4) => {
2490
+ const n4 = o4.isDefault, r4 = { label: n4 ? "Save Workbook" : `Save Workbook as ${o4.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${o4.description}` }, tags: o4.tags, description: `Save the workbook to the desktop${n4 ? "" : ` as ${o4.description}`}.`, icon: "FileDownloadAsSheet" };
2491
+ n4 && (r4.shortcut = { key: "S", modifiers: [Ft.Ctrl] }, e4.push(new Dt("saveWorkbookAs", x2, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [Ft.Shift, Ft.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
2492
+ f2(t3, null, o4).catch((e5) => {
2493
+ m3.showError(e5);
2494
+ });
2495
+ })));
2496
+ const l4 = o4.key, i4 = n4 ? "saveWorkbook" : `saveWorkbookAs${l4}`;
2497
+ "CSV" === l4 ? r4.icon = "FileDownloadAsCSV" : "Excel" === l4 && (r4.icon = "FileDownloadAsExcel"), e4.push(new Dt(i4, x2, r4, (e5) => {
2498
+ f2(t3, e5 ?? a3, o4).catch((e6) => {
2499
+ m3.showError(e6);
2500
+ });
2501
+ }));
2502
+ }), e4.push(new Dt("openWorkbook", x2, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", icon: "FileOpen", shortcut: { key: "O", modifiers: [Ft.Ctrl] } }, async (e5 = null) => {
2503
+ const n4 = { date1904: t3.isDate1904(), ...t3.options };
2504
+ try {
2505
+ const a4 = await h2(e5, n4);
2506
+ if (!a4) return;
2507
+ const l4 = a4.title, i4 = a4.workbook, s4 = i4.getSelectedSheet();
2508
+ if ("text/csv" === a4.format.mimeType) {
2509
+ const e6 = t3.findValidSheetName(l4);
2510
+ await t3.doBatch(async () => {
2511
+ const o4 = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 };
2512
+ let n5 = s4.getUsedRange();
2513
+ if (!n5) return void m3.showMessage("The file appears to be blank.");
2514
+ n5 = n5.getUnion(o4);
2515
+ const a5 = t3.getSheets().add({ name: e6, autoSelect: true }).getRange(o4);
2516
+ await a5.copyFrom(n5);
2517
+ }, `Import CSV '${l4}'`);
2518
+ } else t3?.close(), r3?.(l4), o3(i4);
2519
+ } catch (e6) {
2473
2520
  m3.showError(e6);
2474
- });
2475
- }));
2476
- }), e4.push(new Dt("openWorkbook", x2, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", icon: "FileOpen", shortcut: { key: "O", modifiers: [Mt.Ctrl] } }, async (e5 = null) => {
2477
- const n4 = { date1904: t3.isDate1904(), ...t3.options };
2478
- try {
2479
- const a4 = await h2(e5, n4);
2480
- if (!a4) return;
2481
- const l5 = a4.title, i4 = a4.workbook, s4 = i4.getSelectedSheet();
2482
- if ("text/csv" === a4.formatType.mimeType) {
2483
- const e6 = t3.findValidSheetName(l5);
2484
- await t3.doBatch(async () => {
2485
- const o4 = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 };
2486
- let n5 = s4.getUsedRange();
2487
- if (!n5) return void m3.showMessage("The file appears to be blank.");
2488
- n5 = n5.getUnion(o4);
2489
- const a5 = t3.getSheets().add({ name: e6, autoSelect: true }).getRange(o4);
2490
- await a5.copyFrom(n5);
2491
- }, `Import CSV '${l5}'`);
2492
- } else t3?.close(), r3?.(l5), o3(i4);
2493
- } catch (e6) {
2494
- m3.showError(e6);
2495
- }
2496
- })), e4.push(new Dt("openWorkbookFromUrl", x2, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e5) {
2497
- if (!e5) {
2498
- const t4 = await m3.showInput({ title: "Open Workbook from the Web", description: "Enter the web address for the workbook to open.", inputLabel: "Address", initialValue: "https://www.sheetxl.com/examples/features-checklist.xlsx", inputProps: { style: { minWidth: "440px" } }, options: ["Open"] });
2499
- if ("Open" !== t4.option) return;
2500
- e5 = t4.input;
2501
- }
2502
- e5 && console.log("openWorkbookFromUrl", e5);
2503
- })));
2504
- let l4 = [];
2505
- return i3 && (l4 = [new Dt("themeMode", x2, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new Dt("defaultThemeMode", x2, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new Dt("enableDarkGrid", x2, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new Dt("enableDarkImages", x2, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...e4, ...l4, new Pt("help", x2, { label: "Show Help", description: "Provide Help.", icon: "Documentation", shortcut: { key: "F1" } }, () => {
2506
- }), new Pt("showKeyboardShortcuts", x2, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", icon: "Keyboard", shortcut: { key: "/", modifiers: [Mt.Ctrl] } }, () => {
2521
+ }
2522
+ })), e4.push(new Dt("openWorkbookFromUrl", x2, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e5) {
2523
+ if (!e5) {
2524
+ const t4 = await m3.showInput({ title: "Open Workbook from the Web", description: "Enter the web address for the workbook to open.", inputLabel: "Address", initialValue: "https://www.sheetxl.com/examples/features-checklist.xlsx", inputProps: { style: { minWidth: "440px" } }, options: ["Open"] });
2525
+ if ("Open" !== t4.option) return;
2526
+ e5 = t4.input;
2527
+ }
2528
+ e5 && console.log("openWorkbookFromUrl", e5);
2529
+ })), y2(e4);
2530
+ })();
2531
+ }, [n3, m3, t3, a3]);
2532
+ const w2 = V(() => {
2533
+ let e4 = [];
2534
+ return i3 && (e4 = [new Dt("themeMode", x2, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new Dt("defaultThemeMode", x2, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new Dt("enableDarkGrid", x2, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new Dt("enableDarkImages", x2, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...e4, new Pt("help", x2, { label: "Show Help", description: "Provide Help.", icon: "Documentation", shortcut: { key: "F1" } }, () => {
2535
+ }), new Pt("showKeyboardShortcuts", x2, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", icon: "Keyboard", shortcut: { key: "/", modifiers: [Ft.Ctrl] } }, () => {
2507
2536
  }), new Dt("gotoUrlGithub", x2, { label: "Github", description: "Download examples, explore source code, and leave a star.", icon: "Github" }, () => {
2508
2537
  window?.open("https://github.com/sheetxl/sheetxl");
2509
2538
  }), new Dt("gotoUrlDiscord", x2, { label: "Discord", description: "Join our community on discord.", icon: "Discord" }, () => {
@@ -2513,36 +2542,36 @@ const tr = $((e2) => {
2513
2542
  }), new Dt("gotoUrlIssue", x2, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request.", icon: "Ticket" }, () => {
2514
2543
  window?.open("https://github.com/sheetxl/sheetxl/issues");
2515
2544
  })];
2516
- }, [t3, a3, m3, n3, i3, d3, s3]), y2 = V(() => {
2545
+ }, [t3, a3, m3, n3, i3]), S2 = V(() => [...w2, ...b2], [w2, b2]), k2 = V(() => {
2517
2546
  let e4 = null;
2518
- return e4 = d3 ? d3.createChildGroup(x2, "standaloneWorkbook", false) : new Ft(x2, "standaloneWorkbook"), e4.addCommands(b2, true), e4;
2519
- }, [d3, b2]);
2520
- Et({ manager: s3, commands: y2 });
2521
- const w2 = be("(prefers-color-scheme: dark)"), { themeMode: S2 } = tt();
2522
- j(() => {
2523
- if (!i3 || !y2) return;
2524
- const e4 = "dark" === i3.mode || !i3.mode && "dark" === S2;
2525
- y2.getCommand("themeMode").update({ state: i3.mode ?? null, label: e4 ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: e4 ? "Dark Mode" : "Light Mode" }, icon: e4 ? "DarkMode" : "LightMode" }).updateCallback(() => {
2547
+ return e4 = d3 ? d3.createChildGroup(x2, "standaloneWorkbook", false) : new Mt(x2, "standaloneWorkbook"), e4.addCommands(S2, true), e4;
2548
+ }, [d3, w2, b2]);
2549
+ Et({ manager: s3, commands: k2 });
2550
+ const C2 = be("(prefers-color-scheme: dark)"), { themeMode: v2 } = tt();
2551
+ U(() => {
2552
+ if (!i3 || !k2) return;
2553
+ const e4 = "dark" === i3.mode || !i3.mode && "dark" === v2;
2554
+ k2.getCommand("themeMode").update({ state: i3.mode ?? null, label: e4 ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: e4 ? "Dark Mode" : "Light Mode" }, icon: e4 ? "DarkMode" : "LightMode" }).updateCallback(() => {
2526
2555
  p3(e4 ? ot.Light : ot.Dark);
2527
- }), y2.getCommand("defaultThemeMode").update({ state: !i3.mode, icon: w2 ? "SystemDefaultDarkMode" : "SystemDefaultLightMode" }).updateCallback(() => {
2556
+ }), k2.getCommand("defaultThemeMode").update({ state: !i3.mode, icon: C2 ? "SystemDefaultDarkMode" : "SystemDefaultLightMode" }).updateCallback(() => {
2528
2557
  p3(null);
2529
- }), y2.getCommand("enableDarkGrid").update({ state: i3.enableDarkGrid }).updateCallback(() => {
2558
+ }), k2.getCommand("enableDarkGrid").update({ state: i3.enableDarkGrid }).updateCallback(() => {
2530
2559
  u3(!i3.enableDarkGrid);
2531
- }), y2.getCommand("enableDarkImages").update({ state: i3.enableDarkImages }).updateCallback(() => {
2560
+ }), k2.getCommand("enableDarkImages").update({ state: i3.enableDarkImages }).updateCallback(() => {
2532
2561
  g3(!i3.enableDarkImages);
2533
2562
  });
2534
- }, [S2, i3, b2]);
2535
- const { showModal: k2 } = nt();
2536
- return j(() => {
2563
+ }, [v2, i3, S2]);
2564
+ const { showModal: T2 } = nt();
2565
+ return U(() => {
2537
2566
  const e4 = () => new Promise((e5, t4) => {
2538
- const o4 = W.lazy(() => import("./DggVyg0G8aWEPSES.mjs")), n4 = k2(o4, { title: "Shortcut Keys Reference", commands: y2, onDone: () => {
2567
+ const o4 = W.lazy(() => import("./vOoUUIRETo8Af1CF.mjs")), n4 = T2(o4, { title: "Shortcut Keys Reference", commands: k2, onDone: () => {
2539
2568
  n4.hide();
2540
2569
  }, slotProps: { transition: { onExited: () => {
2541
2570
  e5(true);
2542
2571
  } } } });
2543
2572
  });
2544
- y2.getCommand("showKeyboardShortcuts").updateCallback(() => e4()), y2.getCommand("help").updateCallback(() => e4());
2545
- }, [b2, y2]), y2;
2573
+ k2.getCommand("showKeyboardShortcuts").updateCallback(() => e4()), k2.getCommand("help").updateCallback(() => e4());
2574
+ }, [S2, k2]), k2;
2546
2575
  })({ workbook: t2, setWorkbook: o2, importExportDisabled: c2, workbookTitle: a2, setWorkbookTitle: r2, commands: d2, requestWorkbookTitle: (e3) => new Promise((t3) => {
2547
2576
  n2.current ? n2.current.requestWorkbookTitle((e4, o3) => {
2548
2577
  t3(e4);
@@ -2551,11 +2580,11 @@ const tr = $((e2) => {
2551
2580
  }, []) }), u2 = V(() => z(za, { commands: p2, disableHover: true, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [p2]), g2 = { commands: p2 };
2552
2581
  return t2 && (g2.statusBarProps = { childrenEnd: u2 }), i2 ? W.cloneElement(i2, g2) : null;
2553
2582
  });
2554
- tr.displayName = "CommandsWrapper";
2555
- const or = $((e2) => {
2583
+ Ja.displayName = "CommandsWrapper";
2584
+ const er = $((e2) => {
2556
2585
  const { children: t2 } = e2, o2 = oo(), n2 = o2 ? o2.enqueueSnackbar : () => {
2557
2586
  }, a2 = o2 ? o2.closeSnackbar : () => {
2558
- }, [r2, l2] = U({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), i2 = K(() => {
2587
+ }, [r2, l2] = _({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), i2 = K(() => {
2559
2588
  l2((e3) => ({ ...e3, isMounted: true }));
2560
2589
  }, []), s2 = K(() => {
2561
2590
  l2((e3) => ({ ...e3, isMounted: false }));
@@ -2583,14 +2612,14 @@ const or = $((e2) => {
2583
2612
  t4 = { ...t4, onKeyDown: (e5) => {
2584
2613
  e5.isDefaultPrevented() || e5.isPropagationStopped() || o4?.onKeyDown?.(e5);
2585
2614
  } };
2586
- return c2(e4, { sort: () => import("./B39xbyK17-A3Vu9v.mjs"), numberFormat: () => import("./8CrVP1lyWUA4_AMS.mjs"), hyperlink: () => import("./fzJrH1RlAEOrcfaW.mjs"), comments: () => import("./C5GvIpYv4OTcYYon.mjs"), find: () => import("./DcqscFmt18Bfovt3.mjs"), tableNew: () => import("./3exh7GXawSx9oKrL.mjs"), namedDetails: () => import("./Dnpj8yRHCvG70LhS.mjs"), resizeHeader: () => import("./j4Mywki8bVROW07t.mjs") }[e4], t4);
2615
+ return c2(e4, { sort: () => import("./60iZVg9RWL3eutji.mjs"), numberFormat: () => import("./CXB3esBTggZf3EPD.mjs"), hyperlink: () => import("./PGW_u1abMjdH3vjc.mjs"), comments: () => import("./Cn5ZMNkPwm9lxZKa.mjs"), find: () => import("./CJ2Phv8-N4NdkE5p.mjs"), tableNew: () => import("./D8dHeDIBY8RBIbMi.mjs"), namedDetails: () => import("./DCgD4VQRnocNHKC-.mjs"), resizeHeader: () => import("./D_t85wvCesLiBm0m.mjs") }[e4], t4);
2587
2616
  }, showOptions: m2, showInput: p2, showError: (t4) => {
2588
2617
  let o4, n3 = kt.Error, a3 = "Unknown Error";
2589
2618
  "string" == typeof t4 ? a3 = t4 : t4 instanceof Error && (o4 = t4, t4.message && (a3 = t4.message)), t4 instanceof Yt && (n3 = kt.Info), e3(a3, { type: n3, enqueueProps: { error: o4 } });
2590
- } }, o3 = new At();
2619
+ } }, o3 = new It();
2591
2620
  return o3.setOverrides(t3), o3;
2592
2621
  }, []);
2593
- j(() => {
2622
+ U(() => {
2594
2623
  r2.starting.size <= 0 || !r2.isMounted || l2((e3) => {
2595
2624
  const t3 = new Map(e3.running);
2596
2625
  e3.starting.forEach((e4, o3) => {
@@ -2606,53 +2635,53 @@ const or = $((e2) => {
2606
2635
  return { ...e3, starting: /* @__PURE__ */ new Map(), running: t3 };
2607
2636
  });
2608
2637
  }, [r2]);
2609
- const [h2, f2] = U(null);
2610
- return j(() => {
2611
- 0 !== r2.starting.size || 0 !== r2.running.size ? f2(z(Fe, { icon: z(it, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: r2.label, onMount: i2, onUnmount: s2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : f2(null);
2612
- }, [r2.starting, r2.running]), L(It, { notifier: g2, children: [h2, t2] });
2638
+ const [h2, f2] = _(null);
2639
+ return U(() => {
2640
+ 0 !== r2.starting.size || 0 !== r2.running.size ? f2(z(Me, { icon: z(it, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: r2.label, onMount: i2, onUnmount: s2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : f2(null);
2641
+ }, [r2.starting, r2.running]), L(At, { notifier: g2, children: [h2, t2] });
2613
2642
  });
2614
- or.displayName = "SnackbarWrapper";
2615
- const nr = $(O((e2, t2) => {
2643
+ er.displayName = "SnackbarWrapper";
2644
+ const tr = $(O((e2, t2) => {
2616
2645
  const { children: o2, title: n2, taskPanes: a2, onSelect: r2, selected: l2, registry: i2 = v, style: s2, iconsOnly: d2, className: c2, ...m2 } = e2, p2 = V(() => a2.map((t3) => {
2617
2646
  const o3 = i2.getRegisteredTaskPane(t3);
2618
2647
  if (!o3) return null;
2619
2648
  let n3 = o3.getIcon?.();
2620
2649
  n3 && ("string" == typeof n3 && (n3 = z(xt, { iconKey: n3 })), n3 = z("span", { style: { display: "inline-block", transform: "rotate(90deg)", transformOrigin: "center" }, children: n3 }));
2621
2650
  const a3 = t3 === l2;
2622
- return z(xe, { value: t3, label: z(Me, { disableInteractive: true, title: o3.getTitle() ?? "", placement: "left-start", children: L(J, { sx: { padding: "0px 0px", writingMode: "vertical-rl", textOrientation: "mixed", display: "flex", alignItems: "center", justifyContent: "space-between", minWidth: "0px", color: (e3) => e3.palette.text.secondary }, children: [n3 && z(J, { sx: { display: "inline-block", transformOrigin: "center", color: (e3) => e3.palette.text.secondary }, children: n3 }), d2 && n3 ? null : z(ee, { component: "div", textTransform: "none", sx: { padding: "4px 0px", color: (e3) => a3 ? e3.palette.primary.main : e3.palette.text.secondary }, children: o3.getTitle() })] }) }), sx: { padding: "4px 4px", minWidth: "0px", minHeight: "0px", borderRadius: "4px" }, className: mt("taskpane-strip-item", { "Mui-selected": a3 }), onClick: () => e2.onSelect(t3) }, t3);
2651
+ return z(xe, { value: t3, label: z(Fe, { disableInteractive: true, title: o3.getTitle() ?? "", placement: "left-start", children: L(J, { sx: { padding: "0px 0px", writingMode: "vertical-rl", textOrientation: "mixed", display: "flex", alignItems: "center", justifyContent: "space-between", minWidth: "0px", color: (e3) => e3.palette.text.secondary }, children: [n3 && z(J, { sx: { display: "inline-block", transformOrigin: "center", color: (e3) => e3.palette.text.secondary }, children: n3 }), d2 && n3 ? null : z(ee, { component: "div", textTransform: "none", sx: { padding: "4px 0px", color: (e3) => a3 ? e3.palette.primary.main : e3.palette.text.secondary }, children: o3.getTitle() })] }) }), sx: { padding: "4px 4px", minWidth: "0px", minHeight: "0px", borderRadius: "4px" }, className: mt("taskpane-strip-item", { "Mui-selected": a3 }), onClick: () => e2.onSelect(t3) }, t3);
2623
2652
  }), [a2, l2, r2, i2]), u2 = Ct(t2, () => ({ isTaskPaneStrip: () => true }), []), g2 = V(() => mt("taskpane-strip", c2), [c2]);
2624
2653
  return z(J, { ref: u2, className: g2, sx: { paddingLeft: "2px", paddingTop: "4px", ...s2 }, ...m2, children: z(fe, { orientation: "vertical", variant: "scrollable", value: l2, onChange: (e3, t3) => {
2625
2654
  r2(t3);
2626
2655
  }, slotProps: { list: { sx: { gap: "2px" } }, indicator: { sx: { left: "0px", right: "unset" } } }, children: p2 }) });
2627
- })), ar = (e2, t2) => z(nr, { ref: t2, ...e2 }), rr = W.forwardRef((e2, t2) => {
2656
+ })), or = (e2, t2) => z(tr, { ref: t2, ...e2 }), nr = W.forwardRef((e2, t2) => {
2628
2657
  const { commands: o2, model: n2, ...a2 } = e2, r2 = zt(), l2 = `solid ${Wt(r2.palette.divider, 0.2)} 1px`, i2 = `${r2.shape.borderRadius ?? 4}px`, s2 = `${r2.spacing?.(0.5) ?? 4}px`, d2 = q(null);
2629
- return z(A, { model: n2, ref: t2, frameProps: { style: { border: l2, borderRadius: i2, marginBottom: s2 } }, alwaysShowStrip: true, renderTaskPanelTitle: (e3, t3) => {
2658
+ return z(I, { model: n2, ref: t2, frameProps: { style: { border: l2, borderRadius: i2, marginBottom: s2 } }, alwaysShowStrip: true, renderTaskPanelTitle: (e3, t3) => {
2630
2659
  const { title: o3, icon: n3, onClose: a3, readOnly: r3, focused: l3, ...i3 } = e3;
2631
2660
  return z(ke, { className: mt({ "Mui-selected": l3 }), sx: { display: "flex", flex: "1 1 %0", color: (e4) => e4.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e4) => `${e4.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e4) => e4.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e4) => Wt(e4.palette.action.hover, 0.03), borderBottom: (e4) => `solid ${Wt(e4.palette.divider, 0.2)} 1px` }, ...i3, children: L(J, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e4) => e4.spacing(0.25), marginBottom: (e4) => e4.spacing(0.25), marginLeft: (e4) => e4.spacing(1), marginRight: (e4) => e4.spacing(1) }, children: [z(J, { sx: { flex: "1 1 100%", paddingLeft: (e4) => e4.spacing(1) }, children: o3 }), z(He, { label: "Close", children: z(te, { "aria-label": "close", sx: { color: (e4) => e4.palette.text.icon ?? e4.palette.action.active }, touchRippleRef: d2, onPointerDown: (e4) => {
2632
2661
  d2.current?.start(e4, { center: false }), e4.stopPropagation(), e4.preventDefault();
2633
2662
  }, onPointerUp: () => {
2634
2663
  a3();
2635
2664
  }, children: z(xt, { iconKey: "Close" }) }) })] }) });
2636
- }, renderTaskPaneStrip: ar, ...e2, onOpen: () => {
2665
+ }, renderTaskPaneStrip: or, ...e2, onOpen: () => {
2637
2666
  e2?.onOpen?.();
2638
2667
  }, onClose: () => {
2639
2668
  e2?.onClose?.();
2640
2669
  }, commands: o2, ...a2 });
2641
- }), lr = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, ir = $(O((e2, t2) => {
2642
- const { mainElement: o2, sidebarElement: n2, className: a2, style: r2, ...l2 } = e2, i2 = zt(), [s2, { width: d2 }] = jt(), c2 = d2 > 530 || 0 === d2, m2 = q(null);
2670
+ }), ar = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, rr = $(O((e2, t2) => {
2671
+ const { mainElement: o2, sidebarElement: n2, className: a2, style: r2, ...l2 } = e2, i2 = zt(), [s2, { width: d2 }] = Ut(), c2 = d2 > 530 || 0 === d2, m2 = q(null);
2643
2672
  let p2 = null, u2 = 4, g2 = 13;
2644
- return c2 ? p2 = "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" : (p2 = "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", u2 = 13, g2 = 4), z(vt, { ref: Ut([m2, s2, t2]), className: a2, style: r2 ? { ...lr, ...r2 } : lr, ...l2, fixedPane: "after", position: "40%", minAfter: c2 ? "280px" : "120px", splitDirection: c2 ? "row" : "column", resizerProps: { className: "styled-resizer", style: { minWidth: c2 ? "6px" : void 0, minHeight: c2 ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${u2}' height='${g2}' viewBox='0 0 ${u2} ${g2}' version='1.1' fill='${i2.palette.text.icon ?? i2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${p2}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: c2 ? "left center" : "top center" } }, elementBefore: o2, paneBeforeProps: { style: { flexDirection: "column", marginRight: n2 ? void 0 : "6px" } }, elementAfter: n2, paneAfterProps: { style: { marginLeft: c2 ? "0px" : "4px", marginRight: c2 ? "8px" : "4px" } } });
2673
+ return c2 ? p2 = "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" : (p2 = "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", u2 = 13, g2 = 4), z(vt, { ref: _t([m2, s2, t2]), className: a2, style: r2 ? { ...ar, ...r2 } : ar, ...l2, fixedPane: "after", position: "40%", minAfter: c2 ? "280px" : "120px", splitDirection: c2 ? "row" : "column", resizerProps: { className: "styled-resizer", style: { minWidth: c2 ? "6px" : void 0, minHeight: c2 ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${u2}' height='${g2}' viewBox='0 0 ${u2} ${g2}' version='1.1' fill='${i2.palette.text.icon ?? i2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${p2}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: c2 ? "left center" : "top center" } }, elementBefore: o2, paneBeforeProps: { style: { flexDirection: "column", marginRight: n2 ? void 0 : "6px" } }, elementAfter: n2, paneAfterProps: { style: { marginLeft: c2 ? "0px" : "4px", marginRight: c2 ? "8px" : "4px" } } });
2645
2674
  }));
2646
- ir.displayName = "StudioSplitPane", Ea(), Rt.register("plugin-scripts", { icons: {} }), v.registerTaskPane({ key: "scriptEditor", getTitle: () => "Script (Typescript)", getIcon: () => "ScriptRun", renderTaskPane: Xn }, true);
2647
- const sr = $(O((e2, t2) => {
2648
- const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 = st, onKeyDown: d2, workbook: c2, createWorkbookOptions: m2, onWorkbookChange: p2, logo: u2, importExportDisabled: g2 = false, themeOptions: h2, autoFocus: x2 = false, commands: b2, title: y2, onTitleChange: w2, titleProps: S2, renderLoadingPanel: k2, ...C2 } = e2, v2 = q(null), T2 = gt(p2, [p2]), P2 = gt(w2 ?? S2?.onTitleChange, [w2 ?? S2?.onTitleChange]), D2 = S2?.placeHolder ?? "Untitled", M2 = h2?.mode, { themeMode: F2, source: N2 } = tt({ mode: M2 }), B2 = V(() => ({ ...h2, light: dt(false, _t.deepMerge(h2?.theme ?? {}, h2?.light ?? {})), dark: dt(true, _t.deepMerge(h2?.theme ?? {}, h2?.dark ?? {})) }), [h2]), E2 = F2 === ot.Dark, [A2, H2] = U(null);
2649
- j(() => {
2675
+ rr.displayName = "StudioSplitPane", Ea(), Rt.register("plugin-scripts", { icons: {} }), v.registerTaskPane({ key: "scriptEditor", getTitle: () => "Script (Typescript)", getIcon: () => "ScriptRun", renderTaskPane: Xn }, true);
2676
+ const lr = $(O((e2, t2) => {
2677
+ const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 = st, onKeyDown: d2, workbook: c2, createWorkbookOptions: m2, onWorkbookChange: p2, logo: u2, importExportDisabled: g2 = false, themeOptions: h2, autoFocus: x2 = false, commands: b2, title: y2, onTitleChange: w2, titleProps: S2, renderLoadingPanel: k2, ...C2 } = e2, v2 = q(null), T2 = gt(p2, [p2]), P2 = gt(w2 ?? S2?.onTitleChange, [w2 ?? S2?.onTitleChange]), D2 = S2?.placeHolder ?? "Untitled", F2 = h2?.mode, { themeMode: M2, source: N2 } = tt({ mode: F2 }), B2 = V(() => ({ ...h2, light: dt(false, jt.deepMerge(h2?.theme ?? {}, h2?.light ?? {})), dark: dt(true, jt.deepMerge(h2?.theme ?? {}, h2?.dark ?? {})) }), [h2]), E2 = M2 === ot.Dark, [I2, H2] = _(null);
2678
+ U(() => {
2650
2679
  H2(i2 ?? new Qt());
2651
2680
  }, [i2]);
2652
- const [W2, $2] = U(null), [O2, G2] = U(null), _2 = R();
2681
+ const [W2, $2] = _(null), [O2, G2] = _(null), j2 = R();
2653
2682
  Q(() => {
2654
- if (!c2 || 0 === Object.keys(c2).length && !_t.isPromiseLike(c2)) {
2655
- const e3 = { theme: _2.getDefaultTheme(), ...m2 };
2683
+ if (!c2 || 0 === Object.keys(c2).length && !jt.isPromiseLike(c2)) {
2684
+ const e3 = { theme: j2.getDefaultTheme(), ...m2 };
2656
2685
  G2(new f(e3));
2657
2686
  } else G2(c2);
2658
2687
  }, [c2]), Q(() => {
@@ -2661,49 +2690,49 @@ const sr = $(O((e2, t2) => {
2661
2690
  (async () => {
2662
2691
  try {
2663
2692
  let e3, t3 = await Promise.resolve(O2);
2664
- t3 && t3.source && (t3 = await Xa.read(t3)), t3.workbook ? (te2(t3.title), e3 = t3.workbook) : e3 = t3, T2?.(e3), $2({ workbook: e3 });
2693
+ t3 && t3.source && (t3 = await ja.read(t3)), t3.workbook ? (te2(t3.title), e3 = t3.workbook) : e3 = t3, T2?.(e3), $2({ workbook: e3 });
2665
2694
  } catch (e3) {
2666
2695
  T2?.(null), $2({ error: e3 });
2667
2696
  }
2668
2697
  })();
2669
2698
  }, [O2]);
2670
- const [X2, Z2] = U(null);
2671
- j(() => {
2672
- if (!A2 || !W2) return;
2673
- A2.clear();
2699
+ const [X2, Z2] = _(null);
2700
+ U(() => {
2701
+ if (!I2 || !W2) return;
2702
+ I2.clear();
2674
2703
  const e3 = W2?.workbook?.getTransactions();
2675
2704
  if (!e3) return;
2676
2705
  return e3.addListener({ onCommitEnd: (t3) => {
2677
- t3.getDescription() ? A2.addUndoOperation({ description: t3.getDescription(), undo: () => (e3.revert(t3.getId()), X2.source?.focus(), () => {
2706
+ t3.getDescription() ? I2.addUndoOperation({ description: t3.getDescription(), undo: () => (e3.revert(t3.getId()), X2.source?.focus(), () => {
2678
2707
  e3.restore(t3.getId()), X2.source?.focus();
2679
2708
  }) }) : console.warn("commit has no description", t3);
2680
2709
  } });
2681
- }, [A2, W2, X2]);
2710
+ }, [I2, W2, X2]);
2682
2711
  const Y2 = gt((e3) => {
2683
- e3 ? A2.setRepeatableOperation({ description: e3.label(), repeat: async () => e3.execute() }) : A2.setRepeatableOperation(null);
2684
- }, [A2]), [ee2, te2] = U(y2 ?? S2?.title ?? "");
2685
- j(() => {
2712
+ e3 ? I2.setRepeatableOperation({ description: e3.label(), repeat: async () => e3.execute() }) : I2.setRepeatableOperation(null);
2713
+ }, [I2]), [ee2, te2] = _(y2 ?? S2?.title ?? "");
2714
+ U(() => {
2686
2715
  te2(y2 ?? S2?.title ?? "");
2687
- }, [y2 ?? S2?.title]), j(() => {
2716
+ }, [y2 ?? S2?.title]), U(() => {
2688
2717
  P2?.(ee2);
2689
2718
  }, [ee2]);
2690
- const [oe2, ne2] = U(null), ae2 = V(() => {
2719
+ const [oe2, ne2] = _(null), ae2 = V(() => {
2691
2720
  const e3 = () => ({ contains: (e4) => true, focus() {
2692
2721
  } });
2693
- return b2 ? b2.createChildGroup(e3, "application", false) : new Ft(e3, "application");
2722
+ return b2 ? b2.createChildGroup(e3, "application", false) : new Mt(e3, "application");
2694
2723
  }, [b2]), le2 = gt(async (e3) => {
2695
2724
  ne2(e3.source.getViewportElement()), Z2(e3), ae2.activate("sheet"), await Rt.prefetch(), r2?.(e3);
2696
2725
  }, [ae2]);
2697
- j(() => {
2726
+ U(() => {
2698
2727
  X2 && x2 && X2.source?.focus("object" == typeof x2 ? x2 : void 0);
2699
2728
  }, [X2]);
2700
2729
  const ie2 = q(null), se2 = K((e3) => {
2701
2730
  let t3 = null;
2702
- return S2?.hidden || (t3 = z(Fa, { ...S2, style: { maxWidth: "100%", ...S2?.style }, workbook: v2.current, ref: ie2, title: ee2, placeHolder: D2, onTitleChange: (e4) => {
2731
+ return S2?.hidden || (t3 = z(Ma, { ...S2, style: { maxWidth: "100%", ...S2?.style }, workbook: v2.current, ref: ie2, title: ee2, placeHolder: D2, onTitleChange: (e4) => {
2703
2732
  te2(e4);
2704
- } })), z(er, { ...e3, logo: u2, mainElement: t3, showFileMenu: !g2, showAppearanceMenu: !!(B2?.onEnabledDarkGridChange || B2?.onEnabledDarkImagesChange || B2?.onModeChange) });
2733
+ } })), z(Qa, { ...e3, logo: u2, mainElement: t3, showFileMenu: !g2, showAppearanceMenu: !!(B2?.onEnabledDarkGridChange || B2?.onEnabledDarkImagesChange || B2?.onModeChange) });
2705
2734
  }, [u2, ee2, S2, B2, g2, ae2]);
2706
- j(() => {
2735
+ U(() => {
2707
2736
  const e3 = (e4) => e4.preventDefault();
2708
2737
  return v2.current?.addEventListener("wheel", e3, { passive: false }), () => {
2709
2738
  v2.current?.removeEventListener("wheel", e3);
@@ -2711,28 +2740,28 @@ const sr = $(O((e2, t2) => {
2711
2740
  }, []);
2712
2741
  const de2 = V(() => {
2713
2742
  const e3 = { transparentBackground: true };
2714
- return z(J, { sx: n2, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...a2 }, children: k2?.(e3) ?? z(Fe, { ...e3 }) });
2715
- }, [n2, a2, k2]), ce2 = K(({ error: e3 }) => (l2?.(e3), z(s2, { sx: n2, style: a2, error: e3 ?? "Unable to display empty workbook." })), [n2, a2, l2]), me2 = V(() => ({ ...n2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (e3) => e3.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [n2]), [pe2, ue2] = U(null), ge2 = K((e3, t3) => z(rr, { ref: t3, model: O2, commands: ae2, ...e3 }), [ae2, O2]), he2 = K((e3) => z(ir, { mainElement: e3, sidebarElement: pe2 }), [pe2]), fe2 = Ut([v2, t2]), xe2 = V(() => {
2743
+ return z(J, { sx: n2, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...a2 }, children: k2?.(e3) ?? z(Me, { ...e3 }) });
2744
+ }, [n2, a2, k2]), ce2 = K(({ error: e3 }) => (l2?.(e3), z(s2, { sx: n2, style: a2, error: e3 ?? "Unable to display empty workbook." })), [n2, a2, l2]), me2 = V(() => ({ ...n2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (e3) => e3.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [n2]), [pe2, ue2] = _(null), ge2 = K((e3, t3) => z(nr, { ref: t3, model: O2, commands: ae2, ...e3 }), [ae2, O2]), he2 = K((e3) => z(rr, { mainElement: e3, sidebarElement: pe2 }), [pe2]), fe2 = _t([v2, t2]), xe2 = V(() => {
2716
2745
  if (!W2) return de2;
2717
2746
  if (W2.error || !W2.workbook) return ce2({ error: W2.error });
2718
2747
  let e3 = null, t3 = null, n3 = false;
2719
2748
  return B2 && (e3 = E2 ? B2.dark : B2.light, t3 = E2 && B2.enableDarkGrid ? B2.dark : B2.light, n3 = B2.enableDarkImages), z(Da, { sx: me2, style: a2, tabIndex: 0, autoFocus: true, workbook: W2.workbook, ref: fe2, renderToolbar: se2, onElementLoad: le2, onRepeatCommandChange: Y2, onKeyDown: (e4) => {
2720
2749
  d2?.(e4);
2721
2750
  }, renderLoadingPanel: k2, gridTheme: t3, headersTheme: e3, enableDarkImages: n3, mainWrapper: he2, className: mt(o2), onContextMenu: (e4) => e4.preventDefault(), ...C2 }, "WorkbookElement");
2722
- }, [W2, ee2, A2, de2, k2, B2, C2, se2, me2, he2]);
2751
+ }, [W2, ee2, I2, de2, k2, B2, C2, se2, me2, he2]);
2723
2752
  let be2 = z(ao, { maxSnack: 3, domRoot: oe2, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (e3, t3, o3) => {
2724
2753
  v2.current?.focus();
2725
- }, Components: { error: Ya }, iconVariant: { success: z(re, { style: { marginRight: "8px" }, children: z("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" }) }), error: z(xt, { iconKey: "ErrorAlert", style: { marginRight: "8px" } }) }, children: z(I, { createArea: ge2, onUpdateArea: (e3) => {
2754
+ }, Components: { error: Xa }, iconVariant: { success: z(re, { style: { marginRight: "8px" }, children: z("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" }) }), error: z(xt, { iconKey: "ErrorAlert", style: { marginRight: "8px" } }) }, children: z(A, { createArea: ge2, onUpdateArea: (e3) => {
2726
2755
  ue2(e3);
2727
- }, children: z(ct, { children: z(or, { children: z(Lt, { children: z(Ht, { children: z(tr, { workbook: W2?.workbook, setWorkbook: G2, importExportDisabled: g2, titlePlaceHolder: D2, titleWorkbook: ee2, setWorkbookTitle: te2, refWorkbookTitle: ie2, commands: ae2, undoManager: A2, themeOptions: B2, children: xe2 }) }) }) }) }) }) });
2756
+ }, children: z(ct, { children: z(er, { children: z(Lt, { children: z(Ht, { children: z(Ja, { workbook: W2?.workbook, setWorkbook: G2, importExportDisabled: g2, titlePlaceHolder: D2, titleWorkbook: ee2, setWorkbookTitle: te2, refWorkbookTitle: ie2, commands: ae2, undoManager: I2, themeOptions: B2, children: xe2 }) }) }) }) }) }) });
2728
2757
  return B2 && (be2 = L(Ot, { theme: E2 ? B2.dark : B2.light, children: [B2.cssBaseline ? z(Ce, {}) : null, be2] })), be2;
2729
2758
  }));
2730
- sr.displayName = "EagerStudio";
2731
- const dr = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: sr, default: sr }, Symbol.toStringTag, { value: "Module" }));
2759
+ lr.displayName = "EagerStudio";
2760
+ const ir = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: lr, default: lr }, Symbol.toStringTag, { value: "Module" }));
2732
2761
  export {
2733
2762
  Ha as AppearanceCommandButton,
2734
2763
  mo as AutoColorPosition,
2735
- Mo as BorderCommandButton,
2764
+ Fo as BorderCommandButton,
2736
2765
  Do as BorderPopupButton,
2737
2766
  Po as BorderStylePopupButton,
2738
2767
  ho as C,
@@ -2748,7 +2777,7 @@ export {
2748
2777
  vo as ColorPopupButton,
2749
2778
  DefaultTaskPaneRegistry,
2750
2779
  La as DocThemeCommandButton,
2751
- sr as EagerStudio,
2780
+ lr as EagerStudio,
2752
2781
  Ho as FillCommandButton,
2753
2782
  Rn as FilterColumnMenu,
2754
2783
  Go as FilterCommandButton,
@@ -2764,21 +2793,21 @@ export {
2764
2793
  $a as InsertFunctionSumCommandPopupButton,
2765
2794
  Wa as InsertImageCommandButton,
2766
2795
  LicenseManager,
2767
- Fo as MergeCommandButton,
2796
+ Mo as MergeCommandButton,
2768
2797
  Cn as NamedCollectionEditor,
2769
2798
  gn as NamedInput,
2770
- Io as NumberFormatCommandButton,
2799
+ Ao as NumberFormatCommandButton,
2771
2800
  Yo as PasteCommandButton,
2772
2801
  on as PresetCellStylesCommandButton,
2773
- Ia as PresetTableStylesCommandButton,
2802
+ Aa as PresetTableStylesCommandButton,
2774
2803
  fn as RangeInput,
2775
2804
  Dn as SheetTab,
2776
- Mn as SheetTabMenu,
2805
+ Fn as SheetTabMenu,
2777
2806
  Sn as SheetZoomScale,
2778
- Fn as SheetsAllMenu,
2807
+ Mn as SheetsAllMenu,
2779
2808
  Ko as SortFilterCommandButton,
2780
2809
  kn as StatusBar,
2781
- Ua as Studio,
2810
+ _a as Studio,
2782
2811
  Ro as StyledStrokeIcon,
2783
2812
  Na as TableDetailsPanel,
2784
2813
  Ba as TableDetailsTaskPane,
@@ -2793,22 +2822,22 @@ export {
2793
2822
  yn as ThemeSelectPanel,
2794
2823
  wn as ThemeSelectPopupButton,
2795
2824
  Zo as UnderlineCommandButton,
2796
- Uo as UndoRedoCommandButton,
2825
+ _o as UndoRedoCommandButton,
2797
2826
  lo as VerticalAlignCommandButton,
2798
2827
  Vo as ViewGridLinesCommandButton,
2799
2828
  Qo as ViewHeadingsCommandButton,
2800
2829
  fa as WalkingCopyCommandButton,
2801
2830
  ha as WorkbookContextMenu,
2802
2831
  Da as WorkbookElement,
2803
- Xa as WorkbookIO,
2832
+ ja as WorkbookIO,
2804
2833
  ga as WorkbookStrip,
2805
- Fa as WorkbookTitle,
2834
+ Ma as WorkbookTitle,
2806
2835
  Jo as WorkbookViewCommandButton,
2807
- qa as _WorkbookIO,
2836
+ Ua as _WorkbookIO,
2808
2837
  Hn as createGridStyleFromMUITheme,
2809
- Ua as default,
2838
+ _a as default,
2810
2839
  sa as defaultNewWorkbook,
2811
- In as setPrintExamplesOnLoad,
2840
+ An as setPrintExamplesOnLoad,
2812
2841
  useModelListener,
2813
2842
  useRangeListener,
2814
2843
  ia as useWorkbookCommands