@extend-ai/react-xlsx 0.22.0 → 0.22.1

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 (46) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-JOOWCDHK.js → chunk-CMI5MIZZ.js} +84 -102
  3. package/dist/chunk-CMI5MIZZ.js.map +1 -0
  4. package/dist/{chunk-OMKR4PZY.js → chunk-EDOXAWRE.js} +5 -3
  5. package/dist/chunk-EDOXAWRE.js.map +1 -0
  6. package/dist/{chunk-BVRJGSYM.cjs → chunk-J43N64B5.cjs} +5 -3
  7. package/dist/chunk-J43N64B5.cjs.map +1 -0
  8. package/dist/{chunk-FM2VAXTV.js → chunk-QSOAAYBJ.js} +5 -3
  9. package/dist/chunk-QSOAAYBJ.js.map +1 -0
  10. package/dist/{chunk-6N6KJKR5.cjs → chunk-WNFIRTYB.cjs} +5 -3
  11. package/dist/chunk-WNFIRTYB.cjs.map +1 -0
  12. package/dist/{chunk-BBF4GKSB.cjs → chunk-YCMFDK3C.cjs} +200 -218
  13. package/dist/chunk-YCMFDK3C.cjs.map +1 -0
  14. package/dist/duke-sheets-provenance.json +4 -4
  15. package/dist/duke_sheets_wasm_bg.wasm +0 -0
  16. package/dist/index.cjs +108 -109
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.js +15 -16
  19. package/dist/index.js.map +1 -1
  20. package/dist/internal.cjs +3 -3
  21. package/dist/internal.d.cts +1 -1
  22. package/dist/internal.d.ts +1 -1
  23. package/dist/internal.js +2 -2
  24. package/dist/vanilla.cjs +3 -3
  25. package/dist/vanilla.d.cts +2 -2
  26. package/dist/vanilla.d.ts +2 -2
  27. package/dist/vanilla.js +2 -2
  28. package/dist/{workbook-runtime-NUTDPW3M.js → workbook-runtime-4GBESX74.js} +2 -2
  29. package/dist/{workbook-runtime-N63M5KMU.cjs → workbook-runtime-ITKMDWLO.cjs} +33 -33
  30. package/dist/{workbook-runtime-N63M5KMU.cjs.map → workbook-runtime-ITKMDWLO.cjs.map} +1 -1
  31. package/dist/{workbook-runtime-UIWE4FQ7.js → workbook-runtime-MVU32DIU.js} +2 -2
  32. package/dist/{workbook-runtime-CXEHXA7S.cjs → workbook-runtime-PHL746NC.cjs} +35 -35
  33. package/dist/{workbook-runtime-CXEHXA7S.cjs.map → workbook-runtime-PHL746NC.cjs.map} +1 -1
  34. package/dist/xlsx-worker.js +4 -2
  35. package/dist/xlsx-worker.js.map +1 -1
  36. package/package.json +2 -2
  37. package/dist/chunk-6N6KJKR5.cjs.map +0 -1
  38. package/dist/chunk-BBF4GKSB.cjs.map +0 -1
  39. package/dist/chunk-BVRJGSYM.cjs.map +0 -1
  40. package/dist/chunk-FM2VAXTV.js.map +0 -1
  41. package/dist/chunk-JOOWCDHK.js.map +0 -1
  42. package/dist/chunk-OMKR4PZY.js.map +0 -1
  43. package/dist/{internal-Ba92VZGf.d.cts → internal-DVsk7L2M.d.cts} +31 -31
  44. package/dist/{internal-Ba92VZGf.d.ts → internal-DVsk7L2M.d.ts} +31 -31
  45. /package/dist/{workbook-runtime-NUTDPW3M.js.map → workbook-runtime-4GBESX74.js.map} +0 -0
  46. /package/dist/{workbook-runtime-UIWE4FQ7.js.map → workbook-runtime-MVU32DIU.js.map} +0 -0
@@ -43,7 +43,7 @@
43
43
 
44
44
 
45
45
 
46
- var _chunkBVRJGSYMcjs = require('./chunk-BVRJGSYM.cjs');
46
+ var _chunkJ43N64B5cjs = require('./chunk-J43N64B5.cjs');
47
47
 
48
48
 
49
49
 
@@ -201,7 +201,7 @@ function getFormulaReferences(value, sheetName) {
201
201
  const end = index + match[0].length;
202
202
  const previous = value[index - 1];
203
203
  const next = value[end];
204
- const parsed = _chunkBVRJGSYMcjs.parseXlsxRange.call(void 0, match[0].replace(/\s*:\s*/g, ":"));
204
+ const parsed = _chunkJ43N64B5cjs.parseXlsxRange.call(void 0, match[0].replace(/\s*:\s*/g, ":"));
205
205
  if (parsed && !NAME_CHARACTER.test(previous) && previous !== "]" && previous !== "!" && previous !== ":" && (!next || !NAME_CHARACTER.test(next) && !/[!\[]/.test(next)) && !/^\s*\(/.test(value.slice(end))) {
206
206
  const { range } = parsed;
207
207
  const key = `${(_nullishCoalesce(parsed.sheetName, () => ( sheetName))).toLowerCase()}:${range.start.row},${range.start.col}:${range.end.row},${range.end.col}`;
@@ -238,7 +238,7 @@ function coerceUserEnteredValue(value, locale = "en-US", source = "edit") {
238
238
  const trimmed = value.trim();
239
239
  if (!trimmed) return value;
240
240
  if (/^(true|false)$/i.test(trimmed)) return trimmed.toLowerCase() === "true";
241
- const localized = _chunkBVRJGSYMcjs.parseLocaleNumber.call(void 0, trimmed, locale);
241
+ const localized = _chunkJ43N64B5cjs.parseLocaleNumber.call(void 0, trimmed, locale);
242
242
  if (localized !== void 0) return localized;
243
243
  if (/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(trimmed)) {
244
244
  const number = Number(trimmed);
@@ -434,11 +434,11 @@ var XlsxWorkerClient = (_class = class {
434
434
  const workerBuffer = cloneArrayBufferForTransfer(buffer);
435
435
  return this.request({
436
436
  id: 0,
437
- payload: { ...this.loadPayload, buffer: workerBuffer, wasmSource: await _chunkBVRJGSYMcjs.getConfiguredWorkerWasmSource.call(void 0, ) },
437
+ payload: { ...this.loadPayload, buffer: workerBuffer, wasmSource: await _chunkJ43N64B5cjs.getConfiguredWorkerWasmSource.call(void 0, ) },
438
438
  type: "load"
439
439
  }, [workerBuffer]);
440
440
  }, () => this.loadOnMainThread());
441
- _chunkBVRJGSYMcjs.restoreWorkerImageBlobs.call(void 0, result.imageAssets, result.imageBlobs);
441
+ _chunkJ43N64B5cjs.restoreWorkerImageBlobs.call(void 0, result.imageAssets, result.imageBlobs);
442
442
  delete result.imageBlobs;
443
443
  for (const [key, value] of result.columnFontMeasurements) columnFontMeasurements.set(key, value);
444
444
  while (columnFontMeasurements.size > 256) columnFontMeasurements.delete(columnFontMeasurements.keys().next().value);
@@ -477,7 +477,7 @@ var XlsxWorkerClient = (_class = class {
477
477
  }
478
478
  async getMainRuntime() {
479
479
  if (this.disposed) throw createAbortError();
480
- this.mainRuntime ??= Promise.resolve().then(() => _interopRequireWildcard(require("./workbook-runtime-CXEHXA7S.cjs"))).then(({ createWorkbookRuntime }) => createWorkbookRuntime());
480
+ this.mainRuntime ??= Promise.resolve().then(() => _interopRequireWildcard(require("./workbook-runtime-PHL746NC.cjs"))).then(({ createWorkbookRuntime }) => createWorkbookRuntime());
481
481
  const runtime = await this.mainRuntime;
482
482
  if (this.disposed) {
483
483
  runtime.dispose();
@@ -655,17 +655,17 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
655
655
  for (let index = 0; index < workbook.sheetCount; index += 1) {
656
656
  const worksheet = workbook.getSheet(index);
657
657
  const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess', _56 => _56[index]]), () => ( null));
658
- const mergeMetadata = _chunkBVRJGSYMcjs.resolveWorksheetMergeMetadata.call(void 0, worksheet);
658
+ const mergeMetadata = _chunkJ43N64B5cjs.resolveWorksheetMergeMetadata.call(void 0, worksheet);
659
659
  const effectiveSheetState = {
660
660
  ...sheetState,
661
661
  ...mergeMetadata
662
662
  };
663
- const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _57 => _57.defaultColWidthPx]), () => ( _chunkBVRJGSYMcjs.resolveWorksheetDefaultColumnWidthPixels.call(void 0,
663
+ const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _57 => _57.defaultColWidthPx]), () => ( _chunkJ43N64B5cjs.resolveWorksheetDefaultColumnWidthPixels.call(void 0,
664
664
  worksheet,
665
665
  _optionalChain([sheetState, 'optionalAccess', _58 => _58.columnWidthCharacterWidthPx]),
666
666
  DEFAULT_COL_WIDTH
667
667
  )));
668
- const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _59 => _59.defaultRowHeightPx]), () => ( _chunkBVRJGSYMcjs.resolveWorksheetDefaultRowHeightPixels.call(void 0,
668
+ const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _59 => _59.defaultRowHeightPx]), () => ( _chunkJ43N64B5cjs.resolveWorksheetDefaultRowHeightPixels.call(void 0,
669
669
  worksheet,
670
670
  DEFAULT_ROW_HEIGHT
671
671
  )));
@@ -676,7 +676,7 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
676
676
  const resolveColumnWidthPx = (col) => {
677
677
  const width = worksheet.getColumnWidth(col);
678
678
  if (width !== void 0 && width !== null) {
679
- return _chunkBVRJGSYMcjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([sheetState, 'optionalAccess', _60 => _60.columnWidthCharacterWidthPx]));
679
+ return _chunkJ43N64B5cjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([sheetState, 'optionalAccess', _60 => _60.columnWidthCharacterWidthPx]));
680
680
  }
681
681
  return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _61 => _61.colWidthOverridesPx, 'optionalAccess', _62 => _62[col]]), () => ( defaultColWidthPx));
682
682
  };
@@ -796,8 +796,8 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
796
796
  maxHorizontalMergeEndCol: mergeMetadata.maxHorizontalMergeEndCol,
797
797
  maxVerticalMergeEndRow: mergeMetadata.maxVerticalMergeEndRow,
798
798
  mergedRanges: mergeMetadata.mergedRanges,
799
- hiddenCols: _chunkBVRJGSYMcjs.resolveWorksheetHiddenCols.call(void 0, worksheet, maxCol),
800
- hiddenRows: _chunkBVRJGSYMcjs.resolveWorksheetHiddenRows.call(void 0, worksheet, maxRow),
799
+ hiddenCols: _chunkJ43N64B5cjs.resolveWorksheetHiddenCols.call(void 0, worksheet, maxCol),
800
+ hiddenRows: _chunkJ43N64B5cjs.resolveWorksheetHiddenRows.call(void 0, worksheet, maxRow),
801
801
  minUsedCol: minCol,
802
802
  minUsedRow: minRow,
803
803
  maxUsedCol: maxCol,
@@ -1051,7 +1051,7 @@ function formControlInputFromDukeControl(control3) {
1051
1051
  function xlsxFormControlInputToDukeDrawing(input) {
1052
1052
  return {
1053
1053
  altText: input.altText,
1054
- anchor: _chunkBVRJGSYMcjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, input.anchor, input.editAs),
1054
+ anchor: _chunkJ43N64B5cjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, input.anchor, input.editAs),
1055
1055
  formControl: {
1056
1056
  kind: xlsxFormControlKindToDukeKind(input.kind),
1057
1057
  macroName: input.macroName,
@@ -1091,9 +1091,9 @@ function formControlLinkTouchesPivot(workbook, pivots, sourceSheetIndex, kind) {
1091
1091
  if (sheetIndex < 0) return false;
1092
1092
  address2 = address2.slice(separator + 1);
1093
1093
  }
1094
- const parsed = _chunkBVRJGSYMcjs.parseXlsxRange.call(void 0, address2);
1094
+ const parsed = _chunkJ43N64B5cjs.parseXlsxRange.call(void 0, address2);
1095
1095
  if (_optionalChain([parsed, 'optionalAccess', _102 => _102.kind]) === "cells" && !parsed.sheetName && parsed.range.start.row === parsed.range.end.row && parsed.range.start.col === parsed.range.end.col) {
1096
- return Boolean(_chunkBVRJGSYMcjs.findIntersectingPivot.call(void 0, pivots, sheetNames[sheetIndex], parsed.range));
1096
+ return Boolean(_chunkJ43N64B5cjs.findIntersectingPivot.call(void 0, pivots, sheetNames[sheetIndex], parsed.range));
1097
1097
  }
1098
1098
  const matching = names.filter((name) => name.name.toLowerCase() === address2.toLowerCase());
1099
1099
  const named = _nullishCoalesce(matching.find((name) => name.sheetIndex === sheetIndex), () => ( matching.find((name) => name.sheetIndex == null)));
@@ -1539,7 +1539,7 @@ function useXlsxViewerController(options) {
1539
1539
  releaseXmlRecordsRef.current = null;
1540
1540
  for (const url of retainedObjectUrlsRef.current) URL.revokeObjectURL(url);
1541
1541
  retainedObjectUrlsRef.current.clear();
1542
- _chunkBVRJGSYMcjs.revokeWorkbookImageAssets.call(void 0, imageAssetsRef.current);
1542
+ _chunkJ43N64B5cjs.revokeWorkbookImageAssets.call(void 0, imageAssetsRef.current);
1543
1543
  imageAssetsRef.current = null;
1544
1544
  sheetOriginsRef.current = [];
1545
1545
  setFormControlsByWorkbookSheetIndex([]);
@@ -1579,7 +1579,7 @@ function useXlsxViewerController(options) {
1579
1579
  if (!targetWorkbook || !imageAssetsRef.current) {
1580
1580
  return chartAssetsRef.current;
1581
1581
  }
1582
- const assets = _chunkBVRJGSYMcjs.loadWorkbookChartAssets.call(void 0,
1582
+ const assets = _chunkJ43N64B5cjs.loadWorkbookChartAssets.call(void 0,
1583
1583
  targetWorkbook,
1584
1584
  imageAssetsRef.current,
1585
1585
  buildVisibleSheetIndexMap(targetSheets),
@@ -1589,14 +1589,14 @@ function useXlsxViewerController(options) {
1589
1589
  return assets;
1590
1590
  }, [showHiddenSheets]);
1591
1591
  const loadPreparedWorkbook = _chunkR3FQM7V3cjs.q.call(void 0, async (buffer, isCurrent = () => true) => {
1592
- const defaultFonts = _chunkBVRJGSYMcjs.loadSpreadsheetFonts.call(void 0, ["Calibri", "Arial"]);
1592
+ const defaultFonts = _chunkJ43N64B5cjs.loadSpreadsheetFonts.call(void 0, ["Calibri", "Arial"]);
1593
1593
  const forced = shouldForceReadOnlyForBuffer(buffer.byteLength);
1594
1594
  const editable = !requestedReadOnly && !forced;
1595
1595
  const snapshot = await getWorkerClient().loadWorkbook(buffer, skipXmlParsing, showHiddenSheets, editable || !useWorker);
1596
1596
  if (!isCurrent()) return;
1597
- await Promise.all([defaultFonts, _chunkBVRJGSYMcjs.loadSpreadsheetFonts.call(void 0, snapshot.fontFamilies)]);
1597
+ await Promise.all([defaultFonts, _chunkJ43N64B5cjs.loadSpreadsheetFonts.call(void 0, snapshot.fontFamilies)]);
1598
1598
  if (!isCurrent()) return;
1599
- const nextWorkbook = snapshot.workbookSnapshot ? (await _chunkBVRJGSYMcjs.getSheetsWasmModule.call(void 0, )).Workbook.fromSnapshot(snapshot.workbookSnapshot) : null;
1599
+ const nextWorkbook = snapshot.workbookSnapshot ? (await _chunkJ43N64B5cjs.getSheetsWasmModule.call(void 0, )).Workbook.fromSnapshot(snapshot.workbookSnapshot) : null;
1600
1600
  if (!isCurrent()) {
1601
1601
  _optionalChain([nextWorkbook, 'optionalAccess', _130 => _130.free, 'call', _131 => _131()]);
1602
1602
  return;
@@ -1617,9 +1617,9 @@ function useXlsxViewerController(options) {
1617
1617
  setIsLoading(false);
1618
1618
  }, [getWorkerClient, requestedReadOnly, setChartAssets, setImageAssets, shouldForceReadOnlyForBuffer, showHiddenSheets, skipXmlParsing, useWorker]);
1619
1619
  const refreshWorkbookState = _chunkR3FQM7V3cjs.q.call(void 0, (targetWorkbook) => {
1620
- setPivotTables(_chunkBVRJGSYMcjs.readPivotTables.call(void 0, targetWorkbook));
1620
+ setPivotTables(_chunkJ43N64B5cjs.readPivotTables.call(void 0, targetWorkbook));
1621
1621
  const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _134 => _134.current, 'optionalAccess', _135 => _135.formControlsByWorkbookSheetIndex]), () => ( []));
1622
- const nextFormControls = _chunkBVRJGSYMcjs.refreshWorkbookFormControls.call(void 0,
1622
+ const nextFormControls = _chunkJ43N64B5cjs.refreshWorkbookFormControls.call(void 0,
1623
1623
  targetWorkbook,
1624
1624
  currentFormControls,
1625
1625
  _optionalChain([imageAssetsRef, 'access', _136 => _136.current, 'optionalAccess', _137 => _137.themePalette])
@@ -1639,7 +1639,7 @@ function useXlsxViewerController(options) {
1639
1639
  );
1640
1640
  setSheets(nextSheets);
1641
1641
  setChartAssets(
1642
- _chunkBVRJGSYMcjs.loadWorkbookChartAssets.call(void 0,
1642
+ _chunkJ43N64B5cjs.loadWorkbookChartAssets.call(void 0,
1643
1643
  targetWorkbook,
1644
1644
  imageAssetsRef.current,
1645
1645
  buildVisibleSheetIndexMap(nextSheets),
@@ -1655,7 +1655,7 @@ function useXlsxViewerController(options) {
1655
1655
  chartDisplayFallbackCleanupRef.current = null;
1656
1656
  for (const url of retainedObjectUrlsRef.current) URL.revokeObjectURL(url);
1657
1657
  retainedObjectUrlsRef.current.clear();
1658
- _chunkBVRJGSYMcjs.revokeWorkbookImageAssets.call(void 0, imageAssetsRef.current);
1658
+ _chunkJ43N64B5cjs.revokeWorkbookImageAssets.call(void 0, imageAssetsRef.current);
1659
1659
  disposeWorkerClient();
1660
1660
  }, [disposeWorkerClient]);
1661
1661
  _chunkR3FQM7V3cjs.h.call(void 0, () => {
@@ -1836,7 +1836,7 @@ function useXlsxViewerController(options) {
1836
1836
  const nextHighlights = [];
1837
1837
  let firstSheetIndex = activeSheetIndex;
1838
1838
  for (const reference of inputs) {
1839
- const parsed = _chunkBVRJGSYMcjs.parseXlsxRange.call(void 0, reference);
1839
+ const parsed = _chunkJ43N64B5cjs.parseXlsxRange.call(void 0, reference);
1840
1840
  if (!parsed) {
1841
1841
  return false;
1842
1842
  }
@@ -1930,7 +1930,7 @@ function useXlsxViewerController(options) {
1930
1930
  if (!shouldAutoCalculate) {
1931
1931
  return;
1932
1932
  }
1933
- const result = _chunkBVRJGSYMcjs.tryRecalculate.call(void 0, targetWorkbook);
1933
+ const result = _chunkJ43N64B5cjs.tryRecalculate.call(void 0, targetWorkbook);
1934
1934
  if (!result.calculated) {
1935
1935
  setShouldAutoCalculate(false);
1936
1936
  }
@@ -2162,12 +2162,12 @@ function useXlsxViewerController(options) {
2162
2162
  const width = worksheet.getColumnWidth(col);
2163
2163
  const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _181 => _181.showGridLines]), () => ( true));
2164
2164
  if (width !== void 0 && width !== null) {
2165
- return _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
2166
- _chunkBVRJGSYMcjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([sheetState, 'optionalAccess', _182 => _182.columnWidthCharacterWidthPx])),
2165
+ return _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
2166
+ _chunkJ43N64B5cjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([sheetState, 'optionalAccess', _182 => _182.columnWidthCharacterWidthPx])),
2167
2167
  showGridLines
2168
2168
  );
2169
2169
  }
2170
- return _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
2170
+ return _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
2171
2171
  _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _183 => _183.colWidthOverridesPx, 'optionalAccess', _184 => _184[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _185 => _185.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH)),
2172
2172
  showGridLines
2173
2173
  );
@@ -2177,9 +2177,9 @@ function useXlsxViewerController(options) {
2177
2177
  const height = worksheet.getRowHeight(row3);
2178
2178
  const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _192 => _192.showGridLines]), () => ( true));
2179
2179
  if (height !== void 0 && height !== null) {
2180
- return _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, _chunkBVRJGSYMcjs.resolveSheetRowHeightPixels.call(void 0, height), showGridLines);
2180
+ return _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, _chunkJ43N64B5cjs.resolveSheetRowHeightPixels.call(void 0, height), showGridLines);
2181
2181
  }
2182
- return _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
2182
+ return _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
2183
2183
  _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _193 => _193.rowHeightOverridesPx, 'optionalAccess', _194 => _194[row3]]), () => ( _optionalChain([sheetState, 'optionalAccess', _195 => _195.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT)),
2184
2184
  showGridLines
2185
2185
  );
@@ -2199,7 +2199,7 @@ function useXlsxViewerController(options) {
2199
2199
  const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _198 => _198.cachedFormulaValues, 'optionalAccess', _199 => _199[cellAddressToA1(cell)]]) : void 0;
2200
2200
  const formatted = worksheet.getFormattedValueAt(cell.row, cell.col);
2201
2201
  if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
2202
- return _chunkBVRJGSYMcjs.localizeCellNumber.call(void 0, worksheet, cell.row, cell.col, decodeHtmlEntities(formatted), locale);
2202
+ return _chunkJ43N64B5cjs.localizeCellNumber.call(void 0, worksheet, cell.row, cell.col, decodeHtmlEntities(formatted), locale);
2203
2203
  }
2204
2204
  const calculated = worksheet.getCalculatedValueAt(cell.row, cell.col);
2205
2205
  if (formula && cachedFormulaValue !== void 0 && calculated.is_error) {
@@ -2260,7 +2260,7 @@ function useXlsxViewerController(options) {
2260
2260
  ];
2261
2261
  const fill = _optionalChain([rawStyle, 'optionalAccess', _200 => _200.fill]);
2262
2262
  if (fill) {
2263
- const fillStyle = _chunkBVRJGSYMcjs.resolveWorkbookFillStyle.call(void 0, fill, _optionalChain([activeSheet, 'optionalAccess', _201 => _201.themePalette]));
2263
+ const fillStyle = _chunkJ43N64B5cjs.resolveWorkbookFillStyle.call(void 0, fill, _optionalChain([activeSheet, 'optionalAccess', _201 => _201.themePalette]));
2264
2264
  if (fillStyle.backgroundColor && fillStyle.backgroundColor.toLowerCase() !== "#ffffff") {
2265
2265
  cellStyles.push(`background-color:${fillStyle.backgroundColor}`);
2266
2266
  }
@@ -2282,7 +2282,7 @@ function useXlsxViewerController(options) {
2282
2282
  if (font.strikethrough) {
2283
2283
  cellStyles.push("text-decoration:line-through");
2284
2284
  }
2285
- const fontColor = _chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, font.color, _optionalChain([activeSheet, 'optionalAccess', _203 => _203.themePalette]));
2285
+ const fontColor = _chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, font.color, _optionalChain([activeSheet, 'optionalAccess', _203 => _203.themePalette]));
2286
2286
  if (fontColor) {
2287
2287
  cellStyles.push(`color:${fontColor}`);
2288
2288
  }
@@ -2380,7 +2380,7 @@ function useXlsxViewerController(options) {
2380
2380
  () => getCellFormula(deferredMetadataCell),
2381
2381
  [deferredMetadataCell, getCellFormula, revision, workerCellSnapshotRevision]
2382
2382
  );
2383
- const getChartSeriesFormula = _chunkR3FQM7V3cjs.q.call(void 0, (chartId, seriesIndex) => _chunkBVRJGSYMcjs.buildChartSeriesFormula.call(void 0, getChartById(chartId), seriesIndex), [getChartById]);
2383
+ const getChartSeriesFormula = _chunkR3FQM7V3cjs.q.call(void 0, (chartId, seriesIndex) => _chunkJ43N64B5cjs.buildChartSeriesFormula.call(void 0, getChartById(chartId), seriesIndex), [getChartById]);
2384
2384
  const selectedChartFormula = _chunkR3FQM7V3cjs.T.call(void 0, () => {
2385
2385
  if (!selectedChartElement || selectedChartElement.kind === "chart" || selectedChartElement.kind === "legend" || selectedChartElement.seriesIndex < 0) {
2386
2386
  return null;
@@ -2438,7 +2438,7 @@ function useXlsxViewerController(options) {
2438
2438
  };
2439
2439
  }, [getActiveWorksheet]);
2440
2440
  const restoreHistoryEntry = _chunkR3FQM7V3cjs.q.call(void 0, async (entry) => {
2441
- const wasmModule = await _chunkBVRJGSYMcjs.getSheetsWasmModule.call(void 0, );
2441
+ const wasmModule = await _chunkJ43N64B5cjs.getSheetsWasmModule.call(void 0, );
2442
2442
  const nextWorkbook = wasmModule.Workbook.fromSnapshot(entry.bytes);
2443
2443
  const nextImageAssets = entry.assets ? structuredClone(entry.assets) : null;
2444
2444
  const nextSheets = buildSheetList(
@@ -2457,8 +2457,8 @@ function useXlsxViewerController(options) {
2457
2457
  sheetOriginsRef.current = structuredClone(entry.origins);
2458
2458
  setWorkbook(nextWorkbook);
2459
2459
  setSheets(nextSheets);
2460
- setPivotTables(_chunkBVRJGSYMcjs.readPivotTables.call(void 0, nextWorkbook));
2461
- const nextChartAssets = _chunkBVRJGSYMcjs.loadWorkbookChartAssets.call(void 0, nextWorkbook, nextImageAssets, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets);
2460
+ setPivotTables(_chunkJ43N64B5cjs.readPivotTables.call(void 0, nextWorkbook));
2461
+ const nextChartAssets = _chunkJ43N64B5cjs.loadWorkbookChartAssets.call(void 0, nextWorkbook, nextImageAssets, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets);
2462
2462
  setChartAssets(nextChartAssets);
2463
2463
  setActiveSheetIndexState(nextSheetIndex);
2464
2464
  const nextTabIndex = nextChartAssets.tabs.findIndex((tab) => tab.kind === "sheet" && tab.sheetIndex === nextSheetIndex);
@@ -2529,17 +2529,17 @@ function useXlsxViewerController(options) {
2529
2529
  }, [createHistoryEntry]);
2530
2530
  const getPivotSourceFields = _chunkR3FQM7V3cjs.q.call(void 0, (source) => {
2531
2531
  if (!workbook) throw new Error("Load an editable workbook to inspect a pivot source.");
2532
- return _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, workbook).getPivotSourceFields(source);
2532
+ return _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, workbook).getPivotSourceFields(source);
2533
2533
  }, [workbook]);
2534
- const getPivotTableAtCell = _chunkR3FQM7V3cjs.q.call(void 0, (cell, sheetName = _optionalChain([activeSheet, 'optionalAccess', _223 => _223.name])) => _chunkBVRJGSYMcjs.findIntersectingPivot.call(void 0, pivotTables, sheetName, { start: cell, end: cell }), [_optionalChain([activeSheet, 'optionalAccess', _224 => _224.name]), pivotTables]);
2534
+ const getPivotTableAtCell = _chunkR3FQM7V3cjs.q.call(void 0, (cell, sheetName = _optionalChain([activeSheet, 'optionalAccess', _223 => _223.name])) => _chunkJ43N64B5cjs.findIntersectingPivot.call(void 0, pivotTables, sheetName, { start: cell, end: cell }), [_optionalChain([activeSheet, 'optionalAccess', _224 => _224.name]), pivotTables]);
2535
2535
  _chunkR3FQM7V3cjs.h.call(void 0, () => {
2536
2536
  const insidePivot = activeCell && !selectedChartId && !selectedImageId && getPivotTableAtCell(activeCell);
2537
2537
  setPivotFieldListVisibleState(Boolean(pivotFieldListRequestedRef.current && insidePivot));
2538
2538
  }, [_optionalChain([activeCell, 'optionalAccess', _225 => _225.row]), _optionalChain([activeCell, 'optionalAccess', _226 => _226.col]), _optionalChain([activeSheet, 'optionalAccess', _227 => _227.name]), getPivotTableAtCell, selectedChartId, selectedImageId]);
2539
- const intersectsPivot = _chunkR3FQM7V3cjs.q.call(void 0, (range) => Boolean(_chunkBVRJGSYMcjs.findIntersectingPivot.call(void 0, pivotTables, _optionalChain([activeSheet, 'optionalAccess', _228 => _228.name]), range)), [_optionalChain([activeSheet, 'optionalAccess', _229 => _229.name]), pivotTables]);
2539
+ const intersectsPivot = _chunkR3FQM7V3cjs.q.call(void 0, (range) => Boolean(_chunkJ43N64B5cjs.findIntersectingPivot.call(void 0, pivotTables, _optionalChain([activeSheet, 'optionalAccess', _228 => _228.name]), range)), [_optionalChain([activeSheet, 'optionalAccess', _229 => _229.name]), pivotTables]);
2540
2540
  const calculateForPivotMutation = _chunkR3FQM7V3cjs.q.call(void 0, (target, preserveSavedValues = true) => {
2541
2541
  const snapshot = preserveSavedValues ? target.exportSnapshot() : null;
2542
- const result = _chunkBVRJGSYMcjs.safeCalculate.call(void 0, target, snapshot ? { reparse: () => target.constructor.fromSnapshot(snapshot) } : {});
2542
+ const result = _chunkJ43N64B5cjs.safeCalculate.call(void 0, target, snapshot ? { reparse: () => target.constructor.fromSnapshot(snapshot) } : {});
2543
2543
  if (!result.calculated) {
2544
2544
  if (result.workbook !== target) result.workbook.free();
2545
2545
  throw new Error("The workbook formulas could not be recalculated safely. The pivot table and existing values have been kept.");
@@ -2572,10 +2572,10 @@ function useXlsxViewerController(options) {
2572
2572
  return result;
2573
2573
  }, [calculateForPivotMutation, createHistoryEntry, readOnly, refreshWorkbookState, workbook]);
2574
2574
  const upsertPivotTable = _chunkR3FQM7V3cjs.q.call(void 0, (input) => {
2575
- return commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).upsertPivotTable(input));
2575
+ return commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).upsertPivotTable(input));
2576
2576
  }, [commitPivotMutation]);
2577
- const refreshPivotTable = _chunkR3FQM7V3cjs.q.call(void 0, (id) => commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).refreshPivotTable(id), true), [commitPivotMutation]);
2578
- const createPivotChart = _chunkR3FQM7V3cjs.q.call(void 0, (id, options2 = {}) => commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).createPivotChart(id, { ...options2, workbookName: `${fileStem(displayFileName)}.xlsx` }), false), [commitPivotMutation, displayFileName]);
2577
+ const refreshPivotTable = _chunkR3FQM7V3cjs.q.call(void 0, (id) => commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).refreshPivotTable(id), true), [commitPivotMutation]);
2578
+ const createPivotChart = _chunkR3FQM7V3cjs.q.call(void 0, (id, options2 = {}) => commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).createPivotChart(id, { ...options2, workbookName: `${fileStem(displayFileName)}.xlsx` }), false), [commitPivotMutation, displayFileName]);
2579
2579
  const togglePivotGroup = _chunkR3FQM7V3cjs.q.call(void 0, (id, toggle) => {
2580
2580
  const pivot = pivotTables.find((item) => item.id === id);
2581
2581
  if (!pivot) throw new Error("The pivot table no longer exists.");
@@ -2589,7 +2589,7 @@ function useXlsxViewerController(options) {
2589
2589
  }, [pivotTables, upsertPivotTable]);
2590
2590
  const removePivotTable = _chunkR3FQM7V3cjs.q.call(void 0, (id) => {
2591
2591
  if (!pivotTables.some((pivot) => pivot.id === id)) return false;
2592
- return commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).removePivotTable(id));
2592
+ return commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).removePivotTable(id));
2593
2593
  }, [commitPivotMutation, pivotTables]);
2594
2594
  const refreshAllPivotTables = _chunkR3FQM7V3cjs.q.call(void 0, () => {
2595
2595
  if (readOnly) throw new Error("Enable editing to refresh pivot tables.");
@@ -2599,7 +2599,7 @@ function useXlsxViewerController(options) {
2599
2599
  const next = workbook.constructor.fromSnapshot(workbook.exportSnapshot());
2600
2600
  try {
2601
2601
  calculateForPivotMutation(next);
2602
- const engine = _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, next);
2602
+ const engine = _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, next);
2603
2603
  for (const pivot of engine.pivotTables) {
2604
2604
  engine.refreshPivotTable(pivot.id);
2605
2605
  calculateForPivotMutation(next, false);
@@ -2616,16 +2616,16 @@ function useXlsxViewerController(options) {
2616
2616
  for (const sheet of _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _233 => _233.current, 'optionalAccess', _234 => _234.sheetStatesByWorkbookSheetIndex]), () => ( []))) if (sheet) sheet.cachedFormulaValues = {};
2617
2617
  setWorkbook(next);
2618
2618
  refreshWorkbookState(next);
2619
- return _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, next).pivotTables;
2619
+ return _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, next).pivotTables;
2620
2620
  }, [calculateForPivotMutation, createHistoryEntry, pivotTables.length, readOnly, refreshWorkbookState, workbook]);
2621
2621
  const pivotDrillDown = _chunkR3FQM7V3cjs.q.call(void 0, (id, row3, col) => {
2622
2622
  if (!workbook) throw new Error("Load an editable workbook to inspect pivot details.");
2623
- return _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, workbook).pivotDrillDown(id, row3, col);
2623
+ return _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, workbook).pivotDrillDown(id, row3, col);
2624
2624
  }, [workbook]);
2625
2625
  const showPivotDetails = _chunkR3FQM7V3cjs.q.call(void 0, (id, row3, col) => {
2626
2626
  if (readOnly) throw new Error("Enable editing to create a details worksheet.");
2627
2627
  if (!workbook) throw new Error("Load a workbook before inspecting pivot details.");
2628
- const details = _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, workbook).pivotDrillDown(id, row3, col);
2628
+ const details = _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, workbook).pivotDrillDown(id, row3, col);
2629
2629
  if (!details.rows.length) throw new Error("This pivot cell has no source records to display.");
2630
2630
  const before = createHistoryEntry();
2631
2631
  const next = workbook.constructor.fromSnapshot(workbook.exportSnapshot());
@@ -2693,7 +2693,7 @@ function useXlsxViewerController(options) {
2693
2693
  if (currentInput.kind !== "formControl" || !currentControl.anchor) {
2694
2694
  return false;
2695
2695
  }
2696
- const nextAnchor = patch.anchor ? _chunkBVRJGSYMcjs.xlsxAnchorToDukeDrawingAnchor.call(void 0,
2696
+ const nextAnchor = patch.anchor ? _chunkJ43N64B5cjs.xlsxAnchorToDukeDrawingAnchor.call(void 0,
2697
2697
  patch.anchor,
2698
2698
  _nullishCoalesce(patch.editAs, () => ( (currentControl.anchor.type === "twoCell" ? currentControl.anchor.editAs : void 0)))
2699
2699
  ) : patch.editAs !== void 0 && currentControl.anchor.type === "twoCell" ? { ...currentControl.anchor, editAs: patch.editAs } : currentControl.anchor;
@@ -2931,7 +2931,7 @@ function useXlsxViewerController(options) {
2931
2931
  if (!workbook) {
2932
2932
  return;
2933
2933
  }
2934
- const result = _chunkBVRJGSYMcjs.tryRecalculate.call(void 0, workbook);
2934
+ const result = _chunkJ43N64B5cjs.tryRecalculate.call(void 0, workbook);
2935
2935
  if (result.calculated) {
2936
2936
  refreshWorkbookState(workbook);
2937
2937
  return;
@@ -2942,7 +2942,7 @@ function useXlsxViewerController(options) {
2942
2942
  if (!activeSheet) {
2943
2943
  return;
2944
2944
  }
2945
- const contentSizePx = activeSheet.officeLayout ? sizePx : _chunkBVRJGSYMcjs.resolveContentSheetAxisPixels.call(void 0, sizePx, activeSheet.showGridLines);
2945
+ const contentSizePx = activeSheet.officeLayout ? sizePx : _chunkJ43N64B5cjs.resolveContentSheetAxisPixels.call(void 0, sizePx, activeSheet.showGridLines);
2946
2946
  const targetWorkbookSheetIndex = activeSheet.workbookSheetIndex;
2947
2947
  setSheets((currentSheets) => currentSheets.map((sheet) => {
2948
2948
  if (sheet.workbookSheetIndex !== targetWorkbookSheetIndex) {
@@ -2996,7 +2996,7 @@ function useXlsxViewerController(options) {
2996
2996
  const worksheet = workbook.getSheet(activeSheet.workbookSheetIndex);
2997
2997
  worksheet.setColumnWidth(
2998
2998
  col,
2999
- activeSheet.officeLayout ? _chunkBVRJGSYMcjs.pxToOfficeColumnWidth.call(void 0, widthPx, activeSheet.officeLayout.columnDigitWidthPt) : _chunkBVRJGSYMcjs.pxToSheetColumnWidth.call(void 0, _chunkBVRJGSYMcjs.resolveContentSheetAxisPixels.call(void 0, widthPx, activeSheet.showGridLines))
2999
+ activeSheet.officeLayout ? _chunkJ43N64B5cjs.pxToOfficeColumnWidth.call(void 0, widthPx, activeSheet.officeLayout.columnDigitWidthPt) : _chunkJ43N64B5cjs.pxToSheetColumnWidth.call(void 0, _chunkJ43N64B5cjs.resolveContentSheetAxisPixels.call(void 0, widthPx, activeSheet.showGridLines))
3000
3000
  );
3001
3001
  refreshWorkbookState(workbook);
3002
3002
  }, [
@@ -3024,7 +3024,7 @@ function useXlsxViewerController(options) {
3024
3024
  const worksheet = workbook.getSheet(activeSheet.workbookSheetIndex);
3025
3025
  worksheet.setRowHeight(
3026
3026
  row3,
3027
- activeSheet.officeLayout ? Math.max(heightPx, MIN_ROW_HEIGHT_PX) * (3 / 4) : pxToSheetRowHeight(_chunkBVRJGSYMcjs.resolveContentSheetAxisPixels.call(void 0, heightPx, activeSheet.showGridLines))
3027
+ activeSheet.officeLayout ? Math.max(heightPx, MIN_ROW_HEIGHT_PX) * (3 / 4) : pxToSheetRowHeight(_chunkJ43N64B5cjs.resolveContentSheetAxisPixels.call(void 0, heightPx, activeSheet.showGridLines))
3028
3028
  );
3029
3029
  refreshWorkbookState(workbook);
3030
3030
  }, [
@@ -3098,21 +3098,21 @@ function useXlsxViewerController(options) {
3098
3098
  if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
3099
3099
  return;
3100
3100
  }
3101
- const nextAnchor = _chunkBVRJGSYMcjs.rectToImageAnchor.call(void 0, rect, currentChart.anchor, {
3101
+ const nextAnchor = _chunkJ43N64B5cjs.rectToImageAnchor.call(void 0, rect, currentChart.anchor, {
3102
3102
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
3103
3103
  contentOffsetTop: GRID_HEADER_HEIGHT,
3104
3104
  getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _264 => _264.columnWidths, 'access', _265 => _265[col]]), () => ( getColumnWidthPx(worksheet, col))),
3105
3105
  getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _266 => _266.rowHeights, 'access', _267 => _267[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3106
3106
  });
3107
3107
  if (_optionalChain([currentChart, 'access', _268 => _268.raw, 'optionalAccess', _269 => _269.pivotSource]) && currentChart.name) {
3108
- commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).updatePivotChart(worksheet.name, currentChart.name, {
3109
- anchor: _chunkBVRJGSYMcjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, nextAnchor)
3108
+ commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).updatePivotChart(worksheet.name, currentChart.name, {
3109
+ anchor: _chunkJ43N64B5cjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, nextAnchor)
3110
3110
  }), false);
3111
3111
  return;
3112
3112
  }
3113
3113
  if (!imageAssetsRef.current || !hydratedChartAssets) return;
3114
3114
  recordHistoryBeforeMutation();
3115
- const didUpdateAnchor = _chunkBVRJGSYMcjs.updateWorkbookChartAnchor.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
3115
+ const didUpdateAnchor = _chunkJ43N64B5cjs.updateWorkbookChartAnchor.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
3116
3116
  console.info("[react-xlsx debug] updateWorkbookChartAnchor", { didUpdateAnchor, nextAnchor });
3117
3117
  hydratedChartAssets.chartsByWorkbookSheetIndex = hydratedChartAssets.chartsByWorkbookSheetIndex.map((sheetCharts) => sheetCharts.map((chart) => chart.id === id ? { ...chart, anchor: nextAnchor } : chart));
3118
3118
  setChartsByWorkbookSheetIndex((current) => current.map((sheetCharts) => sheetCharts.map((chart) => chart.id === id ? { ...chart, anchor: nextAnchor } : chart)));
@@ -3138,14 +3138,14 @@ function useXlsxViewerController(options) {
3138
3138
  if (!currentImage || currentImage.editable === false || currentImage.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
3139
3139
  return;
3140
3140
  }
3141
- const nextAnchor = _chunkBVRJGSYMcjs.rectToImageAnchor.call(void 0, rect, currentImage.anchor, {
3141
+ const nextAnchor = _chunkJ43N64B5cjs.rectToImageAnchor.call(void 0, rect, currentImage.anchor, {
3142
3142
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
3143
3143
  contentOffsetTop: GRID_HEADER_HEIGHT,
3144
3144
  getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _270 => _270.columnWidths, 'access', _271 => _271[col]]), () => ( getColumnWidthPx(worksheet, col))),
3145
3145
  getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _272 => _272.rowHeights, 'access', _273 => _273[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3146
3146
  });
3147
3147
  recordHistoryBeforeMutation();
3148
- if (!_chunkBVRJGSYMcjs.updateWorkbookImageAnchor.call(void 0, imageAssetsRef.current, id, nextAnchor)) {
3148
+ if (!_chunkJ43N64B5cjs.updateWorkbookImageAnchor.call(void 0, imageAssetsRef.current, id, nextAnchor)) {
3149
3149
  return;
3150
3150
  }
3151
3151
  setImagesByWorkbookSheetIndex([...imageAssetsRef.current.imagesByWorkbookSheetIndex]);
@@ -3238,7 +3238,7 @@ function useXlsxViewerController(options) {
3238
3238
  return;
3239
3239
  }
3240
3240
  const currentRect = resolveAnchoredObjectRect(currentChart.anchor, worksheet);
3241
- setChartRect(id, _chunkBVRJGSYMcjs.resizeImageRect.call(void 0, currentRect, handle, deltaX, deltaY, 48));
3241
+ setChartRect(id, _chunkJ43N64B5cjs.resizeImageRect.call(void 0, currentRect, handle, deltaX, deltaY, 48));
3242
3242
  }, [getActiveWorksheet, getChartById, resolveAnchoredObjectRect, setChartRect]);
3243
3243
  const resizeImageBy = _chunkR3FQM7V3cjs.q.call(void 0, (id, handle, deltaX, deltaY) => {
3244
3244
  const currentImage = getImageById(id);
@@ -3266,7 +3266,7 @@ function useXlsxViewerController(options) {
3266
3266
  1,
3267
3267
  GRID_HEADER_HEIGHT + resolveAxisSum(currentImage.anchor.to.row, (row3) => getRowHeightPx(worksheet, row3)) + currentImage.anchor.to.rowOffsetEmu / 9525 - top
3268
3268
  ) : currentImage.anchor.sizeEmu.cy / 9525;
3269
- const nextRect = _chunkBVRJGSYMcjs.resizeImageRect.call(void 0, { height, left, top, width }, handle, deltaX, deltaY);
3269
+ const nextRect = _chunkJ43N64B5cjs.resizeImageRect.call(void 0, { height, left, top, width }, handle, deltaX, deltaY);
3270
3270
  setImageRect(id, nextRect);
3271
3271
  }, [getActiveWorksheet, getColumnWidthPx, getImageById, getRowHeightPx, setImageRect]);
3272
3272
  const updateChart = _chunkR3FQM7V3cjs.q.call(void 0, (id, patch) => {
@@ -3281,24 +3281,24 @@ function useXlsxViewerController(options) {
3281
3281
  throw new Error("Change PivotChart data through the pivot table field settings.");
3282
3282
  }
3283
3283
  const sheetName = workbook.getSheet(currentChart.workbookSheetIndex).name;
3284
- commitPivotMutation((target) => _chunkBVRJGSYMcjs.pivotWorkbook.call(void 0, target).updatePivotChart(sheetName, currentChart.name, {
3284
+ commitPivotMutation((target) => _chunkJ43N64B5cjs.pivotWorkbook.call(void 0, target).updatePivotChart(sheetName, currentChart.name, {
3285
3285
  title: patch.title,
3286
3286
  chartType: patch.chartType,
3287
- anchor: patch.anchor ? _chunkBVRJGSYMcjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, patch.anchor) : void 0
3287
+ anchor: patch.anchor ? _chunkJ43N64B5cjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, patch.anchor) : void 0
3288
3288
  }), false);
3289
3289
  return;
3290
3290
  }
3291
3291
  recordHistoryBeforeMutation();
3292
3292
  if (patch.anchor && imageAssetsRef.current && hydratedChartAssets) {
3293
- _chunkBVRJGSYMcjs.updateWorkbookChartAnchor.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, patch.anchor);
3293
+ _chunkJ43N64B5cjs.updateWorkbookChartAnchor.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, patch.anchor);
3294
3294
  }
3295
3295
  if (imageAssetsRef.current && hydratedChartAssets) {
3296
- _chunkBVRJGSYMcjs.updateWorkbookChartDefinition.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, patch);
3296
+ _chunkJ43N64B5cjs.updateWorkbookChartDefinition.call(void 0, imageAssetsRef.current, hydratedChartAssets, id, patch);
3297
3297
  }
3298
3298
  setChartsByWorkbookSheetIndex((current) => current.map((sheetCharts) => sheetCharts.map((chart) => {
3299
3299
  if (chart.id !== id) return chart;
3300
3300
  const nextChart = { ...chart, ...patch, renderSource: _nullishCoalesce(patch.renderSource, () => ( chart.renderSource)) };
3301
- return imageAssetsRef.current ? _chunkBVRJGSYMcjs.refreshChartRenderSource.call(void 0, nextChart, imageAssetsRef.current, workbook) : nextChart;
3301
+ return imageAssetsRef.current ? _chunkJ43N64B5cjs.refreshChartRenderSource.call(void 0, nextChart, imageAssetsRef.current, workbook) : nextChart;
3302
3302
  })));
3303
3303
  setRevision((current) => current + 1);
3304
3304
  }, [commitPivotMutation, ensureChartAssetsHydrated, getChartById, readOnly, recordHistoryBeforeMutation, sheets, workbook]);
@@ -3310,7 +3310,7 @@ function useXlsxViewerController(options) {
3310
3310
  if (!chart || chart.editable === false || _optionalChain([chart, 'access', _276 => _276.raw, 'optionalAccess', _277 => _277.pivotSource])) {
3311
3311
  return false;
3312
3312
  }
3313
- const nextChart = _chunkBVRJGSYMcjs.applyChartSeriesFormula.call(void 0, chart, seriesIndex, formula, workbook);
3313
+ const nextChart = _chunkJ43N64B5cjs.applyChartSeriesFormula.call(void 0, chart, seriesIndex, formula, workbook);
3314
3314
  if (!nextChart) {
3315
3315
  return false;
3316
3316
  }
@@ -3619,7 +3619,7 @@ function useXlsxViewerController(options) {
3619
3619
  return;
3620
3620
  }
3621
3621
  if (intersectsPivot(selection)) return;
3622
- const mergedRanges = _chunkBVRJGSYMcjs.resolveWorksheetMergeMetadata.call(void 0, worksheet).mergedRanges;
3622
+ const mergedRanges = _chunkJ43N64B5cjs.resolveWorksheetMergeMetadata.call(void 0, worksheet).mergedRanges;
3623
3623
  const range = expandHighlightedRange(normalizeRange(selection), mergedRanges);
3624
3624
  const isSingleCell = range.start.row === range.end.row && range.start.col === range.end.col;
3625
3625
  if (isSingleCell && mode !== "center" || mode === "across" && range.start.col === range.end.col) {
@@ -3656,7 +3656,7 @@ function useXlsxViewerController(options) {
3656
3656
  }
3657
3657
  const range = normalizeRange(selection);
3658
3658
  if (intersectsPivot(selection)) return;
3659
- const mergedRanges = _chunkBVRJGSYMcjs.resolveWorksheetMergeMetadata.call(void 0, worksheet).mergedRanges.filter((merged) => rangesIntersect(range, merged));
3659
+ const mergedRanges = _chunkJ43N64B5cjs.resolveWorksheetMergeMetadata.call(void 0, worksheet).mergedRanges.filter((merged) => rangesIntersect(range, merged));
3660
3660
  if (mergedRanges.length === 0) return;
3661
3661
  recordHistoryBeforeMutation();
3662
3662
  for (const merged of mergedRanges) {
@@ -3697,7 +3697,7 @@ function useXlsxViewerController(options) {
3697
3697
  showHiddenSheets
3698
3698
  );
3699
3699
  setSheets(nextSheets);
3700
- const nextChartAssets = imageAssetsRef.current ? _chunkBVRJGSYMcjs.loadWorkbookChartAssets.call(void 0, workbook, imageAssetsRef.current, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets) : null;
3700
+ const nextChartAssets = imageAssetsRef.current ? _chunkJ43N64B5cjs.loadWorkbookChartAssets.call(void 0, workbook, imageAssetsRef.current, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets) : null;
3701
3701
  if (imageAssetsRef.current) {
3702
3702
  setChartAssets(nextChartAssets);
3703
3703
  }
@@ -3715,7 +3715,7 @@ function useXlsxViewerController(options) {
3715
3715
  }
3716
3716
  recordHistoryBeforeMutation();
3717
3717
  workbook.removeSheet(activeSheet.workbookSheetIndex);
3718
- setPivotTables(_chunkBVRJGSYMcjs.readPivotTables.call(void 0, workbook));
3718
+ setPivotTables(_chunkJ43N64B5cjs.readPivotTables.call(void 0, workbook));
3719
3719
  sheetOriginsRef.current = sheetOriginsRef.current.filter((_2, index) => index !== activeSheet.workbookSheetIndex);
3720
3720
  setFormControlsByWorkbookSheetIndex((current) => current.filter((_2, index) => index !== activeSheet.workbookSheetIndex));
3721
3721
  setImagesByWorkbookSheetIndex((current) => current.filter((_2, index) => index !== activeSheet.workbookSheetIndex));
@@ -3739,7 +3739,7 @@ function useXlsxViewerController(options) {
3739
3739
  );
3740
3740
  setSheets(nextSheets);
3741
3741
  if (imageAssetsRef.current) {
3742
- setChartAssets(_chunkBVRJGSYMcjs.loadWorkbookChartAssets.call(void 0, workbook, imageAssetsRef.current, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets));
3742
+ setChartAssets(_chunkJ43N64B5cjs.loadWorkbookChartAssets.call(void 0, workbook, imageAssetsRef.current, buildVisibleSheetIndexMap(nextSheets), showHiddenSheets));
3743
3743
  }
3744
3744
  setActiveSheetIndexState((current) => Math.max(0, Math.min(current, nextSheets.length - 1)));
3745
3745
  setRevision((current) => current + 1);
@@ -6552,17 +6552,19 @@ var menuStyles = `
6552
6552
  background: var(--xlsx-context-menu-background);
6553
6553
  color: var(--xlsx-context-menu-color);
6554
6554
  border: 1px solid var(--xlsx-context-menu-border);
6555
- border-radius: 8px;
6556
- padding: 5px;
6555
+ border-radius: var(--xlsx-menu-radius, 8px);
6556
+ padding: var(--xlsx-menu-padding, 5px);
6557
6557
  min-width: min(220px, calc(100vw - 16px));
6558
6558
  font: 13px/1.4 system-ui, sans-serif;
6559
6559
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
6560
6560
  }
6561
6561
  :where(.react-xlsx-context-menu-item) {
6562
6562
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
6563
- width: 100%; border: 0; border-radius: 4px; padding: 7px 10px;
6563
+ width: 100%; border: 0; border-radius: max(0px, calc(var(--xlsx-menu-radius, 8px) - var(--xlsx-menu-padding, 5px)));
6564
+ padding: 7px 10px;
6564
6565
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
6565
6566
  }
6567
+ :where(.react-xlsx-context-menu-item[aria-pressed="true"]) { background: var(--xlsx-menu-active, var(--xlsx-context-menu-hover)); }
6566
6568
  :where(.react-xlsx-context-menu-item:focus-visible),
6567
6569
  :where(.react-xlsx-context-menu-item:hover:not(:disabled)) {
6568
6570
  background: var(--xlsx-context-menu-hover); outline: none;
@@ -6572,6 +6574,16 @@ var menuStyles = `
6572
6574
  :where(.react-xlsx-context-menu-shortcut) { font-size: 11px; color: var(--xlsx-context-menu-muted); }
6573
6575
  :where(.react-xlsx-context-menu-separator) { height: 1px; margin: 4px; background: var(--xlsx-context-menu-border); }
6574
6576
  `;
6577
+ function resolveMenuPaletteStyle(palette) {
6578
+ return {
6579
+ "--xlsx-context-menu-background": palette.surface,
6580
+ "--xlsx-context-menu-color": palette.text,
6581
+ "--xlsx-context-menu-border": palette.border,
6582
+ "--xlsx-context-menu-hover": palette.mutedSurface,
6583
+ "--xlsx-context-menu-muted": palette.mutedText,
6584
+ "--xlsx-context-menu-danger": palette.danger
6585
+ };
6586
+ }
6575
6587
  function XlsxContextMenu({
6576
6588
  context,
6577
6589
  position,
@@ -6599,7 +6611,7 @@ function XlsxContextMenu({
6599
6611
  const table = controller.tables.find(({ start, end }) => context.cell.row >= start.row && context.cell.row <= end.row && context.cell.col >= start.col && context.cell.col <= end.col);
6600
6612
  const range = expandHighlightedRange(context.selection, _nullishCoalesce(_optionalChain([controller, 'access', _357 => _357.activeSheet, 'optionalAccess', _358 => _358.mergedRanges]), () => ( [])));
6601
6613
  const multiple = range.start.row !== range.end.row || range.start.col !== range.end.col;
6602
- const touchesPivot = Boolean(_chunkBVRJGSYMcjs.findIntersectingPivot.call(void 0, controller.pivotTables, _optionalChain([controller, 'access', _359 => _359.activeSheet, 'optionalAccess', _360 => _360.name]), range));
6614
+ const touchesPivot = Boolean(_chunkJ43N64B5cjs.findIntersectingPivot.call(void 0, controller.pivotTables, _optionalChain([controller, 'access', _359 => _359.activeSheet, 'optionalAccess', _360 => _360.name]), range));
6603
6615
  const pivot = controller.getPivotTableAtCell(context.cell);
6604
6616
  const actions = [
6605
6617
  ...pivot ? [{ id: "togglePivotFieldList", label: controller.pivotFieldListVisible ? messages.hidePivotFieldList : messages.showPivotFieldList, checked: controller.pivotFieldListVisible }] : [],
@@ -6839,12 +6851,7 @@ function XlsxContextMenu({
6839
6851
  ref: rootRef,
6840
6852
  role: "menu",
6841
6853
  style: {
6842
- "--xlsx-context-menu-background": palette.surface,
6843
- "--xlsx-context-menu-color": palette.text,
6844
- "--xlsx-context-menu-border": palette.border,
6845
- "--xlsx-context-menu-hover": palette.mutedSurface,
6846
- "--xlsx-context-menu-muted": palette.mutedText,
6847
- "--xlsx-context-menu-danger": palette.danger,
6854
+ ...resolveMenuPaletteStyle(palette),
6848
6855
  ...contextMenuStyle,
6849
6856
  position: "fixed",
6850
6857
  left: location.x,
@@ -7469,7 +7476,7 @@ function usePivotTableEditor(viewer, options = {}) {
7469
7476
  const focus = (pivot) => {
7470
7477
  const sheetIndex = viewer.sheets.findIndex((sheet) => sheet.name.toLowerCase() === pivot.target.sheet.toLowerCase());
7471
7478
  if (sheetIndex >= 0) viewer.setActiveSheetIndex(sheetIndex);
7472
- const parsed = _chunkBVRJGSYMcjs.parseXlsxRange.call(void 0, pivot.outputRange || pivot.target.cell);
7479
+ const parsed = _chunkJ43N64B5cjs.parseXlsxRange.call(void 0, pivot.outputRange || pivot.target.cell);
7473
7480
  if (parsed) setPendingFocus({ sheet: pivot.target.sheet, ...parsed.range.start });
7474
7481
  };
7475
7482
  const select = (id) => run(() => {
@@ -8930,13 +8937,15 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
8930
8937
  }
8931
8938
  return null;
8932
8939
  }
8940
+ var DATA_BAR_INSET = 2;
8941
+ var DATA_BAR_GRADIENT_TINT = 0.85;
8933
8942
  function resolveCanvasDataBarFill(context, left, top, width, _height, dataBar) {
8934
8943
  if (dataBar.gradient === false) {
8935
8944
  return dataBar.color;
8936
8945
  }
8937
8946
  const gradient = context.createLinearGradient(left, top, left + width, top);
8938
- gradient.addColorStop(0, lightenColor(dataBar.color, 0.28));
8939
- gradient.addColorStop(1, dataBar.color);
8947
+ gradient.addColorStop(0, dataBar.color);
8948
+ gradient.addColorStop(1, lightenColor(dataBar.color, DATA_BAR_GRADIENT_TINT));
8940
8949
  return gradient;
8941
8950
  }
8942
8951
  function drawCanvasConditionalIcon(context, icon, centerX, centerY, size) {
@@ -9335,7 +9344,7 @@ function resolveAnchoredRect(anchor, visibleRows, visibleCols, rowHeights, colWi
9335
9344
  _optionalChain([options, 'optionalAccess', _570 => _570.colIndexByActual]),
9336
9345
  _optionalChain([options, 'optionalAccess', _571 => _571.colPrefixSums]),
9337
9346
  _optionalChain([options, 'optionalAccess', _572 => _572.actualColPrefixSums])
9338
- ) + _chunkBVRJGSYMcjs.emuToPixels.call(void 0, colOffsetEmu) * anchorZoomFactor;
9347
+ ) + _chunkJ43N64B5cjs.emuToPixels.call(void 0, colOffsetEmu) * anchorZoomFactor;
9339
9348
  const resolveMarkerTop = (row3, rowOffsetEmu) => headerHeight + resolveAxisStartOffset(
9340
9349
  row3,
9341
9350
  visibleRows,
@@ -9343,21 +9352,21 @@ function resolveAnchoredRect(anchor, visibleRows, visibleCols, rowHeights, colWi
9343
9352
  _optionalChain([options, 'optionalAccess', _573 => _573.rowIndexByActual]),
9344
9353
  _optionalChain([options, 'optionalAccess', _574 => _574.rowPrefixSums]),
9345
9354
  _optionalChain([options, 'optionalAccess', _575 => _575.actualRowPrefixSums])
9346
- ) + _chunkBVRJGSYMcjs.emuToPixels.call(void 0, rowOffsetEmu) * anchorZoomFactor;
9355
+ ) + _chunkJ43N64B5cjs.emuToPixels.call(void 0, rowOffsetEmu) * anchorZoomFactor;
9347
9356
  if (anchor.kind === "absolute") {
9348
9357
  return {
9349
- height: Math.max(1, _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.sizeEmu.cy) * anchorZoomFactor),
9350
- left: rowHeaderWidth + _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.positionEmu.x) * anchorZoomFactor,
9351
- top: headerHeight + _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.positionEmu.y) * anchorZoomFactor,
9352
- width: Math.max(1, _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.sizeEmu.cx) * anchorZoomFactor)
9358
+ height: Math.max(1, _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.sizeEmu.cy) * anchorZoomFactor),
9359
+ left: rowHeaderWidth + _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.positionEmu.x) * anchorZoomFactor,
9360
+ top: headerHeight + _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.positionEmu.y) * anchorZoomFactor,
9361
+ width: Math.max(1, _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.sizeEmu.cx) * anchorZoomFactor)
9353
9362
  };
9354
9363
  }
9355
9364
  if (anchor.kind === "one-cell") {
9356
9365
  return {
9357
- height: Math.max(1, _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.sizeEmu.cy) * anchorZoomFactor),
9366
+ height: Math.max(1, _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.sizeEmu.cy) * anchorZoomFactor),
9358
9367
  left: resolveMarkerLeft(anchor.from.col, anchor.from.colOffsetEmu),
9359
9368
  top: resolveMarkerTop(anchor.from.row, anchor.from.rowOffsetEmu),
9360
- width: Math.max(1, _chunkBVRJGSYMcjs.emuToPixels.call(void 0, anchor.sizeEmu.cx) * anchorZoomFactor)
9369
+ width: Math.max(1, _chunkJ43N64B5cjs.emuToPixels.call(void 0, anchor.sizeEmu.cx) * anchorZoomFactor)
9361
9370
  };
9362
9371
  }
9363
9372
  const left = resolveMarkerLeft(anchor.from.col, anchor.from.colOffsetEmu);
@@ -10548,7 +10557,7 @@ function decodeHtmlEntities2(value) {
10548
10557
  return value.replace(/&quot;/g, '"').replace(/&#34;/g, '"').replace(/&apos;/g, "'").replace(/&#39;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
10549
10558
  }
10550
10559
  function mapBorder2(edge, themePalette) {
10551
- const color = _nullishCoalesce(_chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, edge.color, themePalette), () => ( "#000"));
10560
+ const color = _nullishCoalesce(_chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, edge.color, themePalette), () => ( "#000"));
10552
10561
  const widthMap = {
10553
10562
  dashed: "1px",
10554
10563
  dotted: "1px",
@@ -10773,7 +10782,7 @@ function buildCellStyle(style, palette, themePalette, options) {
10773
10782
  let resolvedFillColor = null;
10774
10783
  let hasExplicitFill = false;
10775
10784
  if (fill) {
10776
- const fillStyle = _chunkBVRJGSYMcjs.resolveWorkbookFillStyle.call(void 0, fill, themePalette);
10785
+ const fillStyle = _chunkJ43N64B5cjs.resolveWorkbookFillStyle.call(void 0, fill, themePalette);
10777
10786
  if (fillStyle.backgroundColor || fillStyle.backgroundImage) {
10778
10787
  hasExplicitFill = true;
10779
10788
  resolvedFillColor = fillStyle.backgroundColor;
@@ -10801,7 +10810,7 @@ function buildCellStyle(style, palette, themePalette, options) {
10801
10810
  if (font.strikethrough) {
10802
10811
  css.textDecoration = `${_nullishCoalesce(css.textDecoration, () => ( ""))} line-through`.trim();
10803
10812
  }
10804
- const fontColor = _chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, font.color, themePalette);
10813
+ const fontColor = _chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, font.color, themePalette);
10805
10814
  if (fontColor) {
10806
10815
  resolvedFontColor = fontColor;
10807
10816
  css.color = fontColor;
@@ -10944,7 +10953,7 @@ function getCellDisplayValue(worksheet, row3, col, activeSheet, locale = "en-US"
10944
10953
  const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _633 => _633.cachedFormulaValues, 'optionalAccess', _634 => _634[cellAddressToA12({ row: row3, col })]]) : void 0;
10945
10954
  const formatted = worksheet.getFormattedValueAt(row3, col);
10946
10955
  if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
10947
- return _chunkBVRJGSYMcjs.localizeCellNumber.call(void 0, worksheet, row3, col, decodeHtmlEntities2(formatted), locale);
10956
+ return _chunkJ43N64B5cjs.localizeCellNumber.call(void 0, worksheet, row3, col, decodeHtmlEntities2(formatted), locale);
10948
10957
  }
10949
10958
  const cellValue = worksheet.getCalculatedValueAt(row3, col);
10950
10959
  if (formula && cachedFormulaValue !== void 0 && cellValue.is_error) {
@@ -11597,59 +11606,10 @@ function DefaultTableHeaderMenu({
11597
11606
  sortDescending
11598
11607
  }) {
11599
11608
  const messages = _chunkR3FQM7V3cjs.useXlsxMessages.call(void 0, );
11600
- return /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
11601
- "div",
11602
- {
11603
- style: {
11604
- backgroundColor: "var(--xlsx-menu-surface)",
11605
- border: "1px solid var(--xlsx-menu-border)",
11606
- borderRadius: 10,
11607
- boxShadow: "0 10px 30px rgba(0, 0, 0, 0.16)",
11608
- display: "grid",
11609
- gap: 4,
11610
- minWidth: 160,
11611
- padding: 6
11612
- },
11613
- children: [
11614
- /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
11615
- "button",
11616
- {
11617
- onClick: sortAscending,
11618
- style: {
11619
- background: direction === "ascending" ? "var(--xlsx-menu-active)" : "transparent",
11620
- border: "none",
11621
- borderRadius: 8,
11622
- color: "inherit",
11623
- cursor: "pointer",
11624
- fontSize: 12,
11625
- padding: "8px 10px",
11626
- textAlign: "left"
11627
- },
11628
- type: "button",
11629
- children: messages.sortAscending
11630
- }
11631
- ),
11632
- /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
11633
- "button",
11634
- {
11635
- onClick: sortDescending,
11636
- style: {
11637
- background: direction === "descending" ? "var(--xlsx-menu-active)" : "transparent",
11638
- border: "none",
11639
- borderRadius: 8,
11640
- color: "inherit",
11641
- cursor: "pointer",
11642
- fontSize: 12,
11643
- padding: "8px 10px",
11644
- textAlign: "left"
11645
- },
11646
- type: "button",
11647
- children: messages.sortDescending
11648
- }
11649
- )
11650
- ]
11651
- }
11652
- );
11609
+ return /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0, _chunkR3FQM7V3cjs.S, { children: [
11610
+ /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0, "button", { "aria-pressed": direction === "ascending", className: "react-xlsx-context-menu-item", onClick: sortAscending, type: "button", children: messages.sortAscending }),
11611
+ /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0, "button", { "aria-pressed": direction === "descending", className: "react-xlsx-context-menu-item", onClick: sortDescending, type: "button", children: messages.sortDescending })
11612
+ ] });
11653
11613
  }
11654
11614
  function resolveTableHeaderTriggerStyle(palette, zoomFactor) {
11655
11615
  return {
@@ -12230,7 +12190,7 @@ function resolveRichCellRuns(raw, value, base, theme, zoom) {
12230
12190
  if (typeof font.size === "number" && font.size > 0) style.fontSize = font.size * (4 / 3) * zoom;
12231
12191
  if (typeof font.bold === "boolean") style.fontWeight = font.bold ? "bold" : "normal";
12232
12192
  if (typeof font.italic === "boolean") style.fontStyle = font.italic ? "italic" : "normal";
12233
- const color = _chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, font.color, theme);
12193
+ const color = _chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, font.color, theme);
12234
12194
  if (color) style.color = color;
12235
12195
  const decorations = new Set(String(_nullishCoalesce(base.textDecoration, () => ( ""))).split(/\s+/).filter(Boolean));
12236
12196
  if (font.underline != null) {
@@ -12937,23 +12897,23 @@ function resolveConditionalDataBarForCell(row3, col, worksheet, sheet, metricsCa
12937
12897
  if (minValue === null || maxValue === null) {
12938
12898
  return null;
12939
12899
  }
12940
- const minLength = Number.isFinite(_nullishCoalesce(matchingRule.minLength, () => ( Number.NaN))) ? _nullishCoalesce(matchingRule.minLength, () => ( 0)) : 0;
12941
- const maxLength = Number.isFinite(_nullishCoalesce(matchingRule.maxLength, () => ( Number.NaN))) ? _nullishCoalesce(matchingRule.maxLength, () => ( 100)) : 100;
12900
+ const minLength = Number.isFinite(_nullishCoalesce(matchingRule.minLength, () => ( Number.NaN))) ? _nullishCoalesce(matchingRule.minLength, () => ( 10)) : 10;
12901
+ const maxLength = Number.isFinite(_nullishCoalesce(matchingRule.maxLength, () => ( Number.NaN))) ? _nullishCoalesce(matchingRule.maxLength, () => ( 90)) : 90;
12942
12902
  const span = maxValue - minValue;
12943
12903
  const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
12944
12904
  const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
12945
- const color = _chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, matchingRule.color, _optionalChain([sheet, 'optionalAccess', _707 => _707.themePalette]));
12905
+ const color = _chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, matchingRule.color, _optionalChain([sheet, 'optionalAccess', _707 => _707.themePalette]));
12946
12906
  if (!color || widthPercent <= 0) {
12947
12907
  return null;
12948
12908
  }
12949
12909
  return {
12950
- axisColor: _nullishCoalesce(_chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _708 => _708.themePalette])), () => ( void 0)),
12910
+ axisColor: _nullishCoalesce(_chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _708 => _708.themePalette])), () => ( void 0)),
12951
12911
  border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
12952
- borderColor: _nullishCoalesce(_chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _709 => _709.themePalette])), () => ( void 0)),
12912
+ borderColor: _nullishCoalesce(_chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _709 => _709.themePalette])), () => ( void 0)),
12953
12913
  color,
12954
12914
  gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
12955
- negativeBorderColor: _nullishCoalesce(_chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _710 => _710.themePalette])), () => ( void 0)),
12956
- negativeFillColor: _nullishCoalesce(_chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _711 => _711.themePalette])), () => ( void 0)),
12915
+ negativeBorderColor: _nullishCoalesce(_chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _710 => _710.themePalette])), () => ( void 0)),
12916
+ negativeFillColor: _nullishCoalesce(_chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _711 => _711.themePalette])), () => ( void 0)),
12957
12917
  widthPercent
12958
12918
  };
12959
12919
  }
@@ -12986,7 +12946,7 @@ function resolveConditionalColorScaleForCell(row3, col, worksheet, sheet, metric
12986
12946
  });
12987
12947
  metricsCache.set(cacheKey, ruleValues);
12988
12948
  }
12989
- const colors = matchingRule.colors.map((color) => _chunkBVRJGSYMcjs.resolveWorkbookColor.call(void 0, color, _optionalChain([sheet, 'optionalAccess', _713 => _713.themePalette]))).filter((color) => typeof color === "string");
12949
+ const colors = matchingRule.colors.map((color) => _chunkJ43N64B5cjs.resolveWorkbookColor.call(void 0, color, _optionalChain([sheet, 'optionalAccess', _713 => _713.themePalette]))).filter((color) => typeof color === "string");
12990
12950
  const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
12991
12951
  if (colors.length < 2 || thresholds.length < 2) {
12992
12952
  return null;
@@ -13391,22 +13351,19 @@ function GridRow({
13391
13351
  "aria-hidden": "true",
13392
13352
  style: {
13393
13353
  alignItems: "center",
13394
- bottom: 4 * zoomFactor,
13395
13354
  display: "flex",
13396
- left: 4 * zoomFactor,
13355
+ inset: DATA_BAR_INSET * zoomFactor,
13397
13356
  pointerEvents: "none",
13398
13357
  position: "absolute",
13399
- right: 4 * zoomFactor,
13400
- top: 4 * zoomFactor,
13401
13358
  zIndex: 0
13402
13359
  },
13403
13360
  children: /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
13404
13361
  "div",
13405
13362
  {
13406
13363
  style: {
13407
- background: cellData.conditionalDataBar.gradient === false ? cellData.conditionalDataBar.color : `linear-gradient(90deg, ${lightenColor(cellData.conditionalDataBar.color, 0.28)} 0%, ${cellData.conditionalDataBar.color} 100%)`,
13364
+ background: cellData.conditionalDataBar.gradient === false ? cellData.conditionalDataBar.color : `linear-gradient(90deg, ${cellData.conditionalDataBar.color} 0%, ${lightenColor(cellData.conditionalDataBar.color, DATA_BAR_GRADIENT_TINT)} 100%)`,
13408
13365
  border: cellData.conditionalDataBar.border !== false && cellData.conditionalDataBar.borderColor ? `1px solid ${cellData.conditionalDataBar.borderColor}` : "none",
13409
- borderRadius: 2,
13366
+ boxSizing: "border-box",
13410
13367
  height: "100%",
13411
13368
  opacity: 1,
13412
13369
  width: `${cellData.conditionalDataBar.widthPercent}%`
@@ -14351,13 +14308,13 @@ function XlsxGrid({
14351
14308
  const override = _optionalChain([activeSheet, 'optionalAccess', _781 => _781.colWidthOverridesPx, 'access', _782 => _782[index]]);
14352
14309
  if (override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _783 => _783.sourcePx])) return override;
14353
14310
  const width = _optionalChain([worksheet, 'optionalAccess', _784 => _784.getColumnWidth, 'call', _785 => _785(index)]);
14354
- return width !== void 0 && width !== null ? _chunkBVRJGSYMcjs.resolveOfficeColumnWidthPixels.call(void 0, width, office.columnDigitWidthPt) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _786 => _786.sizePx]), () => ( office.defaultColumnPx));
14311
+ return width !== void 0 && width !== null ? _chunkJ43N64B5cjs.resolveOfficeColumnWidthPixels.call(void 0, width, office.columnDigitWidthPt) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _786 => _786.sizePx]), () => ( office.defaultColumnPx));
14355
14312
  });
14356
14313
  }
14357
14314
  const widths = new Array(displayColLimit).fill(0);
14358
14315
  const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _787 => _787.showGridLines]), () => ( true));
14359
14316
  const fallbackWidth = Math.max(
14360
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _788 => _788.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)), showGridLines),
14317
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _788 => _788.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)), showGridLines),
14361
14318
  DEFAULT_COL_WIDTH2 / 2
14362
14319
  );
14363
14320
  if (worksheet) {
@@ -14368,8 +14325,8 @@ function XlsxGrid({
14368
14325
  const width = worksheet.getColumnWidth(col);
14369
14326
  if (width !== void 0 && width !== null) {
14370
14327
  widths[col] = Math.max(
14371
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
14372
- _chunkBVRJGSYMcjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([activeSheet, 'optionalAccess', _789 => _789.columnWidthCharacterWidthPx])),
14328
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
14329
+ _chunkJ43N64B5cjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([activeSheet, 'optionalAccess', _789 => _789.columnWidthCharacterWidthPx])),
14373
14330
  showGridLines
14374
14331
  ),
14375
14332
  DEFAULT_COL_WIDTH2 / 2
@@ -14377,7 +14334,7 @@ function XlsxGrid({
14377
14334
  continue;
14378
14335
  }
14379
14336
  widths[col] = Math.max(
14380
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
14337
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
14381
14338
  _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _790 => _790.colWidthOverridesPx, 'access', _791 => _791[col]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _792 => _792.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
14382
14339
  showGridLines
14383
14340
  ),
@@ -14394,7 +14351,7 @@ function XlsxGrid({
14394
14351
  continue;
14395
14352
  }
14396
14353
  widths[col] = Math.max(
14397
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
14354
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
14398
14355
  _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _795 => _795.colWidthOverridesPx, 'access', _796 => _796[col]]), () => ( precomputedWidths[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _797 => _797.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
14399
14356
  showGridLines
14400
14357
  ),
@@ -14403,7 +14360,7 @@ function XlsxGrid({
14403
14360
  }
14404
14361
  for (let col = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _798 => _798.maxUsedCol]), () => ( -1))) + 1); col < displayColLimit; col += 1) {
14405
14362
  const overrideWidth = _optionalChain([activeSheet, 'optionalAccess', _799 => _799.colWidthOverridesPx, 'access', _800 => _800[col]]);
14406
- widths[col] = overrideWidth === void 0 ? fallbackWidth : Math.max(_chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, overrideWidth, showGridLines), DEFAULT_COL_WIDTH2 / 2);
14363
+ widths[col] = overrideWidth === void 0 ? fallbackWidth : Math.max(_chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, overrideWidth, showGridLines), DEFAULT_COL_WIDTH2 / 2);
14407
14364
  }
14408
14365
  return widths;
14409
14366
  },
@@ -14438,7 +14395,7 @@ function XlsxGrid({
14438
14395
  const heights = new Array(displayRowLimit).fill(0);
14439
14396
  const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _815 => _815.showGridLines]), () => ( true));
14440
14397
  const fallbackHeight = Math.max(
14441
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _816 => _816.defaultRowHeightPx]), () => ( DEFAULT_ROW_HEIGHT2)), showGridLines),
14398
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _816 => _816.defaultRowHeightPx]), () => ( DEFAULT_ROW_HEIGHT2)), showGridLines),
14442
14399
  DEFAULT_ROW_HEIGHT2 / 1.5
14443
14400
  );
14444
14401
  if (worksheet) {
@@ -14449,7 +14406,7 @@ function XlsxGrid({
14449
14406
  const height = worksheet.getRowHeight(row3);
14450
14407
  if (height !== void 0 && height !== null) {
14451
14408
  heights[row3] = Math.max(
14452
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, _chunkBVRJGSYMcjs.resolveSheetRowHeightPixels.call(void 0, height), showGridLines),
14409
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, _chunkJ43N64B5cjs.resolveSheetRowHeightPixels.call(void 0, height), showGridLines),
14453
14410
  DEFAULT_ROW_HEIGHT2 / 1.5
14454
14411
  );
14455
14412
  continue;
@@ -14461,7 +14418,7 @@ function XlsxGrid({
14461
14418
  if (worksheet.isColumnHidden(col) || worksheet.isMergedSecondary(row3, col)) {
14462
14419
  continue;
14463
14420
  }
14464
- const cellValue = _chunkBVRJGSYMcjs.localizeCellNumber.call(void 0, worksheet, row3, col, worksheet.getFormattedValueAt(row3, col), locale);
14421
+ const cellValue = _chunkJ43N64B5cjs.localizeCellNumber.call(void 0, worksheet, row3, col, worksheet.getFormattedValueAt(row3, col), locale);
14465
14422
  if (!cellValue) {
14466
14423
  continue;
14467
14424
  }
@@ -14486,13 +14443,13 @@ function XlsxGrid({
14486
14443
  }
14487
14444
  if (estimatedAutoHeight > 0) {
14488
14445
  heights[row3] = Math.max(
14489
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, Math.ceil(estimatedAutoHeight), showGridLines),
14446
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, Math.ceil(estimatedAutoHeight), showGridLines),
14490
14447
  fallbackHeight
14491
14448
  );
14492
14449
  continue;
14493
14450
  }
14494
14451
  heights[row3] = Math.max(
14495
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
14452
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
14496
14453
  _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _822 => _822.rowHeightOverridesPx, 'access', _823 => _823[row3]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _824 => _824.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
14497
14454
  showGridLines
14498
14455
  ),
@@ -14509,7 +14466,7 @@ function XlsxGrid({
14509
14466
  continue;
14510
14467
  }
14511
14468
  heights[row3] = Math.max(
14512
- _chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0,
14469
+ _chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0,
14513
14470
  _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _827 => _827.rowHeightOverridesPx, 'access', _828 => _828[row3]]), () => ( precomputedHeights[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _829 => _829.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
14514
14471
  showGridLines
14515
14472
  ),
@@ -14518,7 +14475,7 @@ function XlsxGrid({
14518
14475
  }
14519
14476
  for (let row3 = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _830 => _830.maxUsedRow]), () => ( -1))) + 1); row3 < displayRowLimit; row3 += 1) {
14520
14477
  const overrideHeight = _optionalChain([activeSheet, 'optionalAccess', _831 => _831.rowHeightOverridesPx, 'access', _832 => _832[row3]]);
14521
- heights[row3] = overrideHeight === void 0 ? fallbackHeight : Math.max(_chunkBVRJGSYMcjs.resolveRenderedSheetAxisPixels.call(void 0, overrideHeight, showGridLines), DEFAULT_ROW_HEIGHT2 / 1.5);
14478
+ heights[row3] = overrideHeight === void 0 ? fallbackHeight : Math.max(_chunkJ43N64B5cjs.resolveRenderedSheetAxisPixels.call(void 0, overrideHeight, showGridLines), DEFAULT_ROW_HEIGHT2 / 1.5);
14522
14479
  }
14523
14480
  return heights;
14524
14481
  },
@@ -15792,7 +15749,7 @@ function XlsxGrid({
15792
15749
  includeStyles: true,
15793
15750
  useFormattedValues: true
15794
15751
  });
15795
- _chunkBVRJGSYMcjs.localizeRows.call(void 0, worksheet, rows, locale);
15752
+ _chunkJ43N64B5cjs.localizeRows.call(void 0, worksheet, rows, locale);
15796
15753
  return buildWorksheetBatchWindow(rows, _nullishCoalesce(activeSheet, () => ( null)), viewportRequest.startRow, viewportRequest.endRow);
15797
15754
  } catch (e13) {
15798
15755
  return null;
@@ -16048,7 +16005,7 @@ function XlsxGrid({
16048
16005
  rowSpan: _optionalChain([merge, 'optionalAccess', _952 => _952.rowSpan]),
16049
16006
  sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
16050
16007
  style: scaleCssProperties(buildCellStyle(finalResolvedStyle, palette, _optionalChain([activeSheet, 'optionalAccess', _953 => _953.themePalette]), {
16051
- generalAlignment: worksheet ? _chunkBVRJGSYMcjs.getCellGeneralAlignment.call(void 0, worksheet, row3, col) : _optionalChain([batchedCell, 'optionalAccess', _954 => _954.generalAlignment]),
16008
+ generalAlignment: worksheet ? _chunkJ43N64B5cjs.getCellGeneralAlignment.call(void 0, worksheet, row3, col) : _optionalChain([batchedCell, 'optionalAccess', _954 => _954.generalAlignment]),
16052
16009
  showGridLines: _optionalChain([activeSheet, 'optionalAccess', _955 => _955.showGridLines])
16053
16010
  }), zoomFactor),
16054
16011
  usesGeneralAlignment: !_optionalChain([alignment, 'optionalAccess', _956 => _956.horizontal]) || alignment.horizontal === "general",
@@ -16240,10 +16197,10 @@ function XlsxGrid({
16240
16197
  let requiredCols = 0;
16241
16198
  for (const { highlight, range } of highlightedCellRanges) {
16242
16199
  if (highlight.kind !== "columns") {
16243
- requiredRows = Math.max(requiredRows, Math.min(_chunkBVRJGSYMcjs.XLSX_MAX_ROWS, range.end.row + OPEN_GRID_ROW_PADDING + 1));
16200
+ requiredRows = Math.max(requiredRows, Math.min(_chunkJ43N64B5cjs.XLSX_MAX_ROWS, range.end.row + OPEN_GRID_ROW_PADDING + 1));
16244
16201
  }
16245
16202
  if (highlight.kind !== "rows") {
16246
- requiredCols = Math.max(requiredCols, Math.min(_chunkBVRJGSYMcjs.XLSX_MAX_COLUMNS, range.end.col + OPEN_GRID_COL_PADDING + 1));
16203
+ requiredCols = Math.max(requiredCols, Math.min(_chunkJ43N64B5cjs.XLSX_MAX_COLUMNS, range.end.col + OPEN_GRID_COL_PADDING + 1));
16247
16204
  }
16248
16205
  }
16249
16206
  setDisplayRowLimit((current) => Math.max(current, requiredRows));
@@ -16783,7 +16740,7 @@ function XlsxGrid({
16783
16740
  if (cell) {
16784
16741
  return {
16785
16742
  column,
16786
- left: cell.offsetLeft + cell.offsetWidth - 170,
16743
+ right: cell.offsetLeft + cell.offsetWidth,
16787
16744
  table,
16788
16745
  top: cell.offsetTop + cell.offsetHeight - 2
16789
16746
  };
@@ -16794,11 +16751,29 @@ function XlsxGrid({
16794
16751
  }
16795
16752
  return {
16796
16753
  column,
16797
- left: rect.left + rect.width - 170,
16754
+ right: rect.left + rect.width,
16798
16755
  table,
16799
16756
  top: rect.top + rect.height - 2
16800
16757
  };
16801
16758
  }, [effectiveTables, openTableMenu, resolveCellDisplayRect]);
16759
+ _chunkR3FQM7V3cjs._.call(void 0, () => {
16760
+ const menu = tableMenuRef.current;
16761
+ const scroller = scrollRef.current;
16762
+ if (!openTableMenuState || !menu || !scroller || renderTableHeaderMenu) {
16763
+ return;
16764
+ }
16765
+ const updatePosition = () => {
16766
+ const margin = 4 * zoomFactor;
16767
+ const minLeft = scroller.scrollLeft + displayRowHeaderWidth + margin;
16768
+ const maxLeft = scroller.scrollLeft + scroller.clientWidth - margin - menu.offsetWidth;
16769
+ menu.style.left = `${Math.max(minLeft, Math.min(openTableMenuState.right - menu.offsetWidth, maxLeft))}px`;
16770
+ };
16771
+ updatePosition();
16772
+ const observer = new ResizeObserver(updatePosition);
16773
+ observer.observe(menu);
16774
+ observer.observe(scroller);
16775
+ return () => observer.disconnect();
16776
+ }, [contextMenuClassName, contextMenuStyle, displayRowHeaderWidth, openTableMenuState, renderTableHeaderMenu, zoomFactor]);
16802
16777
  const applyHeaderSelection = _chunkR3FQM7V3cjs.q.call(void 0, (range) => {
16803
16778
  if (experimentalCanvas) {
16804
16779
  return;
@@ -18510,10 +18485,11 @@ function XlsxGrid({
18510
18485
  paneContext.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
18511
18486
  paneContext.fillRect(localRect.left, localRect.top, localRect.width, localRect.height);
18512
18487
  if (cellData.conditionalDataBar) {
18513
- const barLeft = localRect.left + 4 * zoomFactor;
18514
- const barTop = localRect.top + 4 * zoomFactor;
18515
- const barWidth = Math.max(0, (localRect.width - 8 * zoomFactor) * (cellData.conditionalDataBar.widthPercent / 100));
18516
- const barHeight = Math.max(0, localRect.height - 8 * zoomFactor);
18488
+ const barInset = DATA_BAR_INSET * zoomFactor;
18489
+ const barLeft = localRect.left + barInset;
18490
+ const barTop = localRect.top + barInset;
18491
+ const barWidth = Math.max(0, (localRect.width - barInset * 2) * (cellData.conditionalDataBar.widthPercent / 100));
18492
+ const barHeight = Math.max(0, localRect.height - barInset * 2);
18517
18493
  if (barWidth > 0 && barHeight > 0) {
18518
18494
  paneContext.fillStyle = resolveCanvasDataBarFill(
18519
18495
  paneContext,
@@ -19309,10 +19285,10 @@ function XlsxGrid({
19309
19285
  children: charts.length > 0 ? charts.map((chart) => {
19310
19286
  const sourceSize = chart.anchor.kind !== "two-cell" ? chart.anchor.sizeEmu : void 0;
19311
19287
  const chartsheetRect = {
19312
- height: _optionalChain([sourceSize, 'optionalAccess', _1104 => _1104.cy]) ? _chunkBVRJGSYMcjs.emuToPixels.call(void 0, sourceSize.cy) : 320,
19288
+ height: _optionalChain([sourceSize, 'optionalAccess', _1104 => _1104.cy]) ? _chunkJ43N64B5cjs.emuToPixels.call(void 0, sourceSize.cy) : 320,
19313
19289
  left: 0,
19314
19290
  top: 0,
19315
- width: _optionalChain([sourceSize, 'optionalAccess', _1105 => _1105.cx]) ? _chunkBVRJGSYMcjs.emuToPixels.call(void 0, sourceSize.cx) : 640
19291
+ width: _optionalChain([sourceSize, 'optionalAccess', _1105 => _1105.cx]) ? _chunkJ43N64B5cjs.emuToPixels.call(void 0, sourceSize.cx) : 640
19316
19292
  };
19317
19293
  return /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0, "div", { style: {
19318
19294
  minHeight: sourceSize ? void 0 : 320,
@@ -20605,7 +20581,7 @@ function XlsxGrid({
20605
20581
  ...interaction.baseRect,
20606
20582
  left: interaction.baseRect.left + deltaX,
20607
20583
  top: interaction.baseRect.top + deltaY
20608
- } : _chunkBVRJGSYMcjs.resizeImageRect.call(void 0, interaction.baseRect, interaction.handle, deltaX, deltaY, displayImageMinSize),
20584
+ } : _chunkJ43N64B5cjs.resizeImageRect.call(void 0, interaction.baseRect, interaction.handle, deltaX, deltaY, displayImageMinSize),
20609
20585
  {
20610
20586
  contentOffsetLeft: displayRowHeaderWidth,
20611
20587
  contentOffsetTop: displayHeaderHeight,
@@ -20685,7 +20661,7 @@ function XlsxGrid({
20685
20661
  ...interaction.baseRect,
20686
20662
  left: interaction.baseRect.left + deltaX,
20687
20663
  top: interaction.baseRect.top + deltaY
20688
- } : _chunkBVRJGSYMcjs.resizeImageRect.call(void 0, interaction.baseRect, interaction.handle, deltaX, deltaY, 48 * zoomFactor),
20664
+ } : _chunkJ43N64B5cjs.resizeImageRect.call(void 0, interaction.baseRect, interaction.handle, deltaX, deltaY, 48 * zoomFactor),
20689
20665
  {
20690
20666
  contentOffsetLeft: displayRowHeaderWidth,
20691
20667
  contentOffsetTop: displayHeaderHeight,
@@ -21188,7 +21164,7 @@ function XlsxGrid({
21188
21164
  )
21189
21165
  ] : []);
21190
21166
  const activePivotHighlight = controller.pivotFieldListVisible && activeCell ? controller.getPivotTableAtCell(activeCell) : null;
21191
- const pivotHighlightNodes = (activePivotHighlight ? _chunkBVRJGSYMcjs.pivotFieldHighlightRanges.call(void 0, activePivotHighlight) : []).flatMap((range, index) => {
21167
+ const pivotHighlightNodes = (activePivotHighlight ? _chunkJ43N64B5cjs.pivotFieldHighlightRanges.call(void 0, activePivotHighlight) : []).flatMap((range, index) => {
21192
21168
  const rows = getHighlightAxisExtent(visibleRows, rowPrefixSums, range.start.row, range.end.row);
21193
21169
  const cols = getHighlightAxisExtent(visibleCols, colPrefixSums, range.start.col, range.end.col);
21194
21170
  if (!rows || !cols) return [];
@@ -21966,33 +21942,39 @@ function XlsxGrid({
21966
21942
  !renderTableHeaderMenu && openTableMenuState ? /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
21967
21943
  "div",
21968
21944
  {
21945
+ className: ["react-xlsx-context-menu", contextMenuClassName].filter(Boolean).join(" "),
21969
21946
  ref: tableMenuRef,
21970
21947
  style: {
21971
- color: palette.text,
21972
- left: Math.max(displayRowHeaderWidth + 4 * zoomFactor, openTableMenuState.left),
21948
+ ...resolveMenuPaletteStyle(palette),
21949
+ ...contextMenuStyle,
21950
+ boxSizing: "border-box",
21951
+ left: openTableMenuState.right,
21973
21952
  position: "absolute",
21974
21953
  top: openTableMenuState.top,
21975
21954
  zIndex: 50
21976
21955
  },
21977
- children: /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
21978
- DefaultTableHeaderMenu,
21979
- {
21980
- cell: { col: openTableMenuState.column.index + openTableMenuState.table.start.col, row: openTableMenuState.table.start.row },
21981
- column: openTableMenuState.column,
21982
- direction: sortState && sortState.tableName === openTableMenuState.table.name && sortState.columnIndex === openTableMenuState.column.index ? sortState.direction : null,
21983
- sortAscending: () => {
21984
- sortTable(openTableMenuState.table.name, openTableMenuState.column.index, "ascending");
21985
- setOpenTableMenu(null);
21986
- },
21987
- sortDescending: () => {
21988
- sortTable(openTableMenuState.table.name, openTableMenuState.column.index, "descending");
21989
- setOpenTableMenu(null);
21990
- },
21991
- table: openTableMenuState.table,
21992
- triggerIcon: "\u25BE",
21993
- triggerProps: { type: "button" }
21994
- }
21995
- )
21956
+ children: [
21957
+ /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0, "style", { children: menuStyles }),
21958
+ /* @__PURE__ */ _chunkR3FQM7V3cjs.u.call(void 0,
21959
+ DefaultTableHeaderMenu,
21960
+ {
21961
+ cell: { col: openTableMenuState.column.index + openTableMenuState.table.start.col, row: openTableMenuState.table.start.row },
21962
+ column: openTableMenuState.column,
21963
+ direction: sortState && sortState.tableName === openTableMenuState.table.name && sortState.columnIndex === openTableMenuState.column.index ? sortState.direction : null,
21964
+ sortAscending: () => {
21965
+ sortTable(openTableMenuState.table.name, openTableMenuState.column.index, "ascending");
21966
+ setOpenTableMenu(null);
21967
+ },
21968
+ sortDescending: () => {
21969
+ sortTable(openTableMenuState.table.name, openTableMenuState.column.index, "descending");
21970
+ setOpenTableMenu(null);
21971
+ },
21972
+ table: openTableMenuState.table,
21973
+ triggerIcon: "\u25BE",
21974
+ triggerProps: { type: "button" }
21975
+ }
21976
+ )
21977
+ ]
21996
21978
  }
21997
21979
  ) : null
21998
21980
  ]
@@ -22449,4 +22431,4 @@ function __createContentRoot(container) {
22449
22431
 
22450
22432
 
22451
22433
  exports.formatBinaryBytes = formatBinaryBytes; exports.XlsxFileSizeLimitExceededError = XlsxFileSizeLimitExceededError; exports.XlsxViewer = XlsxViewer2; exports.createXlsxViewer = createXlsxViewer; exports.__createControlledViewer = __createControlledViewer; exports.__createContentNode = __createContentNode; exports.__createContentRoot = __createContentRoot;
22452
- //# sourceMappingURL=chunk-BBF4GKSB.cjs.map
22434
+ //# sourceMappingURL=chunk-YCMFDK3C.cjs.map