@sheetxl/io-xlsx 0.8.0-beta.10 → 0.8.0-beta.11

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 (116) hide show
  1. package/browser/esm/{NQIuOQIleHC4NUW6.mjs → BiDqExNXiY7ykk8E.mjs} +527 -646
  2. package/browser/esm/{2EOdn2WRK5y1L58S.mjs → Bs0EzhdU8WgGfPzf.mjs} +2 -2
  3. package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
  4. package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
  5. package/browser/esm/{DXopGe8PrLWmwGaV.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
  6. package/browser/esm/{BLXcoiDAaOMjFuhw.mjs → Cv3R6fGatARKedSn.mjs} +2531 -1952
  7. package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → CzFYJPxmLyKgEKF0.mjs} +2 -2
  8. package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DICL6ecj9BdJv8aX.mjs} +47 -10
  9. package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
  10. package/browser/esm/index.mjs +2 -2
  11. package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → yveeVJ6hKDI5KDEz.mjs} +1599 -990
  12. package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
  13. package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
  14. package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
  15. package/node/esm/{CHqRP_NjPpPd7m9L.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
  16. package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
  17. package/node/esm/{nNQ7MG89sGKwkjMA.mjs → DScqM1V4wPntNP6-.mjs} +1672 -1086
  18. package/node/esm/{O5mti2R9drFOlXc7.mjs → fopiRR7OiVoEiF7B.mjs} +2 -2
  19. package/node/esm/index.mjs +64 -27
  20. package/node/esm/{CtAF486aZqYzMeLM.mjs → ipiyzn5Pfohw2afB.mjs} +1777 -1157
  21. package/package.json +3 -3
  22. package/types/src/AutoFilterRules.d.ts +8 -1
  23. package/types/src/DefinedNameAttributes.d.ts +8 -0
  24. package/types/src/ExcelCompat.d.ts +15 -3
  25. package/types/src/KnownFonts.d.ts +50 -0
  26. package/types/src/LegacyFormula.d.ts +13 -0
  27. package/types/src/PageLayoutAttributes.d.ts +8 -0
  28. package/types/src/Plugin.d.ts +12 -0
  29. package/types/src/ProtectionAttributes.d.ts +2 -2
  30. package/types/src/SheetKinds.d.ts +57 -0
  31. package/types/src/SheetViewAttributes.d.ts +4 -0
  32. package/types/src/SortExtent.d.ts +16 -0
  33. package/types/src/Types.d.ts +11 -0
  34. package/types/src/XlsxHeader.d.ts +19 -0
  35. package/types/src/chart/ChartExXml.d.ts +38 -0
  36. package/types/src/chart/ChartPartXml.d.ts +47 -0
  37. package/types/src/chart/ChartSpaceXml.d.ts +36 -0
  38. package/types/src/chart/_XmlTree.d.ts +34 -0
  39. package/types/src/chart/_chartCodecs.d.ts +10 -0
  40. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  41. package/types/src/chart/_chartExFold.d.ts +14 -0
  42. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  43. package/types/src/chart/_chartExStyle.d.ts +22 -0
  44. package/types/src/chart/_codec.d.ts +78 -0
  45. package/types/src/chart/_drawingml.d.ts +10 -0
  46. package/types/src/chart/_xml.d.ts +70 -0
  47. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  48. package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
  49. package/types/src/reader/HeaderStyles.d.ts +15 -0
  50. package/types/src/reader/IsoDateCell.d.ts +20 -0
  51. package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
  52. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  53. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
  54. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  55. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
  56. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
  57. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
  58. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  59. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  60. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  61. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +2 -0
  62. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  63. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  64. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  65. package/types/src/reader/domVisitors/index.d.ts +2 -30
  66. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
  67. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +16 -11
  68. package/types/src/utils/DrawingMLText.d.ts +2 -2
  69. package/types/src/utils/FormControls.d.ts +4 -4
  70. package/types/src/utils/SharedNames.d.ts +13 -0
  71. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  72. package/types/src/utils/VmlNoteShapes.d.ts +16 -23
  73. package/types/src/utils/VmlNoteStyle.d.ts +44 -0
  74. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  75. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  76. package/types/src/writer/builder/Types.d.ts +7 -0
  77. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  78. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  79. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  80. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  81. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  82. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  83. package/types/src/writer/emitters/SlicerEmitter.d.ts +3 -3
  84. package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
  85. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  86. package/types/src/writer/utils/AutoFilter.d.ts +1 -1
  87. package/types/src/writer/utils/DefaultRows.d.ts +38 -0
  88. package/types/src/writer/utils/DxfCollector.d.ts +11 -8
  89. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
  90. package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
  91. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  92. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  93. package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
  94. package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
  95. package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
  96. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  97. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  98. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  99. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  100. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  101. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  102. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  103. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  104. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  105. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  106. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  107. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  108. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  109. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  110. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  111. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  112. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  113. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  114. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  115. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  116. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
@@ -1,14 +1,15 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.10
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.11
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { A as e, D as t, E as n, F as r, I as i, M as a, N as o, O as s, P as c, Q as l, Qt as u, St as d, T as f, Z as p, bt as m, ct as h, h as g, j as _, k as v, lt as ee, rt as te, w as y, xt as b } from "./BLXcoiDAaOMjFuhw.mjs";
8
- import { i as x, n as ne, r as S } from "./CI_CZI5m5-KkiAK5.mjs";
9
- import { CommonUtils as C } from "@sheetxl/utils";
10
- import { AddressUtils as w, FormulaError as T, IBorders as E, ICellStyle as D, ICondition as O, IFill as k, IFont as A, IRange as re, IShape as j, ISlicerStyle as M, ITextFrame as N, ShapeStyleUtils as ie, Sort as P, Tuple as ae } from "@sheetxl/sdk";
11
- var F = class {
7
+ import { A as e, At as t, Ct as n, D as r, Dt as i, Et as a, F as o, Ht as s, I as c, It as l, L as u, Ln as d, M as f, N as p, O as m, Ot as h, P as g, Pt as ee, R as _, Rn as te, Tt as v, Ut as y, Wt as b, dn as x, et as ne, fn as S, g as re, j as C, k as ie, kn as w, r as ae, rt as oe, st as se, t as ce, tt as le, wt as T, xt as ue, yt as de, z as fe } from "./Cv3R6fGatARKedSn.mjs";
8
+ import { n as pe, r as me } from "./yveeVJ6hKDI5KDEz.mjs";
9
+ import { a as he, o as ge, r as _e } from "./CLWsOc6DO8l1G_LF.mjs";
10
+ import { CommonUtils as E } from "@sheetxl/utils";
11
+ import { AddressUtils as D, FormulaError as O, IBorders as k, ICellStyle as A, ICondition as j, IFill as M, IFont as N, IRange as ve, IShape as P, ISlicerStyle as F, ITextFrame as I, ShapeStyleUtils as ye, Sort as L, Tuple as be } from "@sheetxl/sdk";
12
+ var xe = class {
12
13
  constructor(e) {
13
14
  this.list = e;
14
15
  }
@@ -34,14 +35,14 @@ var F = class {
34
35
  [Symbol.iterator]() {
35
36
  return this.list.values();
36
37
  }
37
- }, I = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, oe = (e) => {
38
+ }, Se = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, Ce = (e) => {
38
39
  let t = parseInt(e);
39
40
  return isNaN(t) ? null : t;
40
- }, se = (e) => {
41
+ }, we = (e) => {
41
42
  let t = parseFloat(e);
42
43
  return isNaN(t) ? null : t;
43
- }, ce = /* @__PURE__ */ new Map(), L = class {
44
- constructor(e, t, n, r, i, a = null, o = C.EmptyObject) {
44
+ }, Te = /* @__PURE__ */ new Map(), R = class {
45
+ constructor(e, t, n, r, i, a = null, o = E.EmptyObject) {
45
46
  this._fileLocation = "";
46
47
  let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
47
48
  this._parent = e, this.sharedShared = t, this.currentPath = n, this.elemRoot = r, this.jsonRoot = i, e ? (this._fileLocation = e._fileLocation, this._getRef = e._getRef, this._getRefs = e._getRefs, this._serializeElement = e._serializeElement, this._readEmbeddedPart = e._readEmbeddedPart) : (a && (this._fileLocation = a), o?.getRef && (this._getRef = s), o?.getRefs && (this._getRefs = c), this._onWarning = o?.onWarning, this._addPerson = o?.addPerson, this._serializeElement = o?.serializeElement, this._readEmbeddedPart = o?.readEmbeddedPart);
@@ -53,7 +54,7 @@ var F = class {
53
54
  return this._readEmbeddedPart?.(e, this._fileLocation) ?? null;
54
55
  }
55
56
  getRelationships() {
56
- return this._getRefs?.(this._fileLocation) ?? ce;
57
+ return this._getRefs?.(this._fileLocation) ?? Te;
57
58
  }
58
59
  getPath() {
59
60
  return this.currentPath;
@@ -113,7 +114,7 @@ var F = class {
113
114
  }
114
115
  if (n = a, n.length === 0) return null;
115
116
  }
116
- return n.length === 1 ? n[0] : n.length === 0 ? null : new F(n);
117
+ return n.length === 1 ? n[0] : n.length === 0 ? null : new xe(n);
117
118
  }
118
119
  _matchesElementName(e, t) {
119
120
  return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
@@ -129,10 +130,10 @@ var F = class {
129
130
  }
130
131
  }
131
132
  getFromPath(e, t) {
132
- return C.getFromPath(e, t);
133
+ return E.getFromPath(e, t);
133
134
  }
134
135
  setToPath(e, t, n) {
135
- return C.setToPath(e, t, n);
136
+ return E.setToPath(e, t, n);
136
137
  }
137
138
  getValAttrAsString(e, t) {
138
139
  let n = this.evaluate(e, t);
@@ -153,13 +154,13 @@ var F = class {
153
154
  return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
154
155
  }
155
156
  get BOOLEAN_COPY() {
156
- return I;
157
+ return Se;
157
158
  }
158
159
  get INT_COPY() {
159
- return oe;
160
+ return Ce;
160
161
  }
161
162
  get FLOAT_COPY() {
162
- return se;
163
+ return we;
163
164
  }
164
165
  copyFromAttribute(e, t, n, r = t, i = null) {
165
166
  if (!e || !n || !e.hasAttribute(t)) return;
@@ -172,67 +173,123 @@ var F = class {
172
173
  }
173
174
  this.setToPath(n, r, a);
174
175
  }
175
- }, R = class {
176
- constructor(e) {
177
- this.jsonKey = e;
176
+ }, z = (e, t) => {
177
+ let n = [], r = e.childNodes, i = r.length;
178
+ for (let e = 0; e < i; e++) {
179
+ let i = r.item(e);
180
+ i.nodeType === 1 && i.localName === t && n.push(i);
178
181
  }
182
+ return n;
183
+ }, Ee = [
184
+ ["fillRef", "fill"],
185
+ ["lnRef", "stroke"],
186
+ ["effectRef", "effect"]
187
+ ], B = (e, t) => {
188
+ let n = new f(), r = {};
189
+ for (let [i, a] of Ee) {
190
+ let o = e.evaluate(i, t);
191
+ if (!o) continue;
192
+ let s = { index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0 }, c = n.processAdjColor(e, o);
193
+ c && (s.color = c), r[a] = s;
194
+ }
195
+ let i = e.evaluate("fontRef", t);
196
+ if (i) {
197
+ let t = { index: i.getAttribute("idx") ?? "none" }, a = n.processAdjColor(e, i);
198
+ a && (t.color = a), r.font = t;
199
+ }
200
+ return r;
201
+ }, V = class {
179
202
  visit(e, t, n) {
180
- let r = {};
181
- return n[this.jsonKey] = r, r;
203
+ if (!t) return;
204
+ let r = e.evaluate("*/cNvPr", t);
205
+ return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, r, n), e.copyFromAttribute(r, "id", n)), n;
182
206
  }
183
- }, z = class {
184
- visit(e, t, n) {
185
- let i = {};
186
- if (r(e, t, i, "grouping", "grouping"), a(e, t, i, "varyColors", "varyColors"), o(e, t, i, "gapWidth", "gapWidth", .01), o(e, t, i, "overlap", "overlap", .01), this.parseType(e, t, i), c(e, t, i, "bubbleScale", "bubbleScale"), a(e, t, i, "showNegBubbles", "showNegativeBubbleValues"), a(e, t, i, "sizeRepresents", "bubbleSizeRepresentsWidth"), c(e, t, i, "firstSliceAng", "startAngle"), c(e, t, i, "holeSize", "holeSize"), r(e, t, i, "scatterStyle", "scatterStyle"), this.parseAxisIds(e, t, i), Object.keys(i).length > 0) {
187
- let t = e.getVisitorParamsState().get("types");
188
- t || (e.warn("A chart type was read outside a chart; its types were started fresh.", { onceKey: "xlsx.chart.typesState" }), t = [], e.getVisitorParamsState().set("types", t)), t.push(i);
189
- }
190
- return i;
207
+ readNonVisualDetails(t, n, r) {
208
+ n.hasAttribute("title") && (r.title = n.getAttribute("title"));
209
+ let i = t.evaluate("hlinkClick", n);
210
+ i && (r.hyperlink = e(t, i));
211
+ let a = t.evaluate("hlinkHover", n);
212
+ a && (r.hoverHyperlink = e(t, a));
213
+ let o = t.evaluate("extLst", n), s = o ? t.serializeElement(o) : null;
214
+ s && (r.extLst = {
215
+ ...r.extLst,
216
+ nonVisual: s
217
+ });
191
218
  }
192
- parseType(e, t, n) {
193
- switch (t.localName) {
194
- case "areaChart":
195
- n.type = "area";
196
- break;
197
- case "bubbleChart":
198
- n.type = "bubble";
199
- break;
200
- case "doughnutChart":
201
- case "ofPieType":
202
- case "pieChart":
203
- n.type = "pie";
204
- break;
205
- case "lineChart":
206
- n.type = "line";
207
- break;
208
- case "scatterChart": n.type = "scatter";
209
- }
219
+ setContent(e, t) {
220
+ let n = e;
221
+ n.name !== void 0 && (t.name = n.name, delete n.name), n.description !== void 0 && (t.description = n.description, delete n.description);
222
+ for (let e of [
223
+ "title",
224
+ "hyperlink",
225
+ "hoverHyperlink",
226
+ "extLst"
227
+ ]) n[e] !== void 0 && (t.json && (t.json[e] = n[e]), delete n[e]);
228
+ e.content = t;
210
229
  }
211
- parseAxisIds(e, t, n) {
212
- let r = e.evaluate("axId", t);
213
- r && r.length !== 0 && (n.xAxisId = r.item(0).getAttribute("val"), n.yAxisId = r.item(1).getAttribute("val"));
230
+ isGroupContent(e) {
231
+ return Array.isArray(e?.members);
214
232
  }
215
- }, B = (e, t, n) => {
216
- if (!0 === e.getValAttrAsBoolean("invertIfNegative", t)) {
217
- if (e.evaluate("extLst/ext/invertSolidFillFmt", t)) {
218
- if (n.fill && n.fillNegative) {
219
- let t = e.getFromPath(n, "fill.solid.adjs");
220
- t && e.setToPath(n, "fillNegative.solid.adjs", t);
233
+ readMemberHeader(e, t, n) {
234
+ let r = {}, i = {
235
+ anchor: void 0,
236
+ content: {
237
+ type: n,
238
+ json: r
221
239
  }
222
- } else {
223
- let e = { val: "FFFFFF" }, t = {};
224
- t.solid = e, n.fillNegative = t;
225
- let r = { val: "000000" }, i = {};
226
- i.solid = r;
227
- let a = {};
228
- a.fill = i, n.strokeNegative = a;
240
+ }, a = e.evaluate("*/cNvPr", t);
241
+ if (a?.item && (a = a.item(0)), a) {
242
+ let n = a.getAttribute("name");
243
+ n !== null && (i.content.name = n);
244
+ let o = a.getAttribute("descr");
245
+ o && (i.content.description = o), e.copyFromAttribute(a, "hidden", i, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, a, r);
246
+ let s = this.readSourceId(e, t);
247
+ s !== void 0 && (r.sourceId = s);
229
248
  }
249
+ return {
250
+ movable: i,
251
+ content: r
252
+ };
230
253
  }
231
- }, V = class {
254
+ readStyleRefs(e, t, n) {
255
+ let r = e.evaluate("style", t);
256
+ if (!r) return void (n.style = null);
257
+ let i = B(e, r), a = ye.withoutDefaultStyleRefs({
258
+ ...n,
259
+ style: i
260
+ });
261
+ a && (n.style = a);
262
+ }
263
+ readLocks(e) {
264
+ let t = e?.attributes;
265
+ if (!t || t.length === 0) return;
266
+ let n = {};
267
+ for (let e = 0; e < t.length; e++) {
268
+ let r = t.item(e);
269
+ r.name.startsWith("xmlns") || (n[r.localName ?? r.name] = y(r.value));
270
+ }
271
+ return Object.keys(n).length > 0 ? n : void 0;
272
+ }
273
+ readSourceId(e, t) {
274
+ let n = e.evaluate("*/cNvPr", t);
275
+ n?.item && (n = n.item(0));
276
+ let r = n?.getAttribute?.("id"), i = r ? parseInt(r, 10) : void 0;
277
+ return i === void 0 || isNaN(i) ? void 0 : i;
278
+ }
279
+ }, De = [
280
+ ["spDef", "shape"],
281
+ ["lnDef", "line"],
282
+ ["txDef", "text"]
283
+ ], H = (e, t) => {
284
+ let n = t.getAttribute("dxfId");
285
+ if (n === null) return;
286
+ let r = parseInt(n);
287
+ return e.getVisitorParamsState().get("dxfs")?.get(r) || (e.warn(`A color filter or sort names a format that does not exist (dxfId '${n}').`), {});
288
+ }, U = (e) => e === "1" || e === "true", W = class {
232
289
  visit(e, t, n) {}
233
290
  processDataBarColor(e, t, n, r, i = "auto") {
234
291
  if (!t) return;
235
- let a = S((e) => t.getAttribute(e), i);
292
+ let a = x((e) => t.getAttribute(e), i);
236
293
  return a && (n[r] = a), n;
237
294
  }
238
295
  processFonts(e, t, n) {
@@ -248,14 +305,19 @@ var F = class {
248
305
  return n;
249
306
  }
250
307
  processFont(e, t, n) {
251
- e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style = A.Style.Italic), e.getValAttrAsBoolean("strike", t, !0) && (n.strike = !0);
252
- let i = e.evaluate("u", t);
253
- i && (n.underline = i.getAttribute("val") || A.UnderlineStyle.Single), r(e, t, n, "vertAlign", "verticalAlign"), n.verticalAlign === "superscript" ? n.verticalAlign = A.VerticalAlignment.Super : n.verticalAlign === "subscript" && (n.verticalAlign = A.VerticalAlignment.Sub), o(e, t, n, "sz", "size");
254
- let s = e.evaluate("color", t);
255
- this.processDataBarColor(e, s, n, "color"), n.color ||= "auto", r(e, t, n, "name", "family"), r(e, t, n, "rFont", "family");
256
- let l = e.evaluate("family", t);
257
- if (l) {
258
- let e = l.getAttribute("val");
308
+ e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style = N.Style.Italic), e.getValAttrAsBoolean("strike", t, !0) && (n.strike = i(!0));
309
+ let r = e.evaluate("u", t);
310
+ if (r) {
311
+ let e = r.getAttribute("val");
312
+ n.underline = h(e);
313
+ }
314
+ let s = T(e.evaluate("vertAlign", t)?.getAttribute("val"));
315
+ s !== void 0 && (n.baseline = s), c(e, t, n, "sz", "size");
316
+ let l = e.evaluate("color", t);
317
+ this.processDataBarColor(e, l, n, "color"), n.color ||= "auto", _(e, t, n, "name", "family"), _(e, t, n, "rFont", "family");
318
+ let d = e.evaluate("family", t);
319
+ if (d) {
320
+ let e = d.getAttribute("val");
259
321
  if (e) switch (e) {
260
322
  case "1":
261
323
  n.fallbacks = ["serif"];
@@ -272,7 +334,12 @@ var F = class {
272
334
  case "5": n.fallbacks = ["fantasy"];
273
335
  }
274
336
  }
275
- return r(e, t, n, "scheme", "scheme"), n.family !== void 0 && n.scheme === void 0 && (n.scheme = A.Scheme.None), a(e, t, n, "shadow", "shadow", !0), a(e, t, n, "outline", "outline", !0), e.getValAttrAsBoolean("condense", t, !0) && (n.letterSpacing = -1), e.getValAttrAsBoolean("extend", t, !0) && (n.letterSpacing = 1), c(e, t, n, "charset", "charset"), n;
337
+ v(n, e.evaluate("scheme", t)?.getAttribute("val")), o(e, t, n, "shadow", "shadow", !0), o(e, t, n, "outline", "outline", !0);
338
+ for (let r of ["condense", "extend"]) {
339
+ let i = a(r, !!e.getValAttrAsBoolean(r, t, !0));
340
+ i !== void 0 && (n.letterSpacing = i);
341
+ }
342
+ return u(e, t, n, "charset", "charset"), n;
276
343
  }
277
344
  processFills(e, t, n) {
278
345
  if (!t) return;
@@ -284,7 +351,7 @@ var F = class {
284
351
  return n;
285
352
  }
286
353
  processFill(e, t, n, r) {
287
- let i = { type: k.Type.None }, a = t.childNodes, o = !1, s = a.length;
354
+ let i = { type: M.Type.None }, a = t.childNodes, o = !1, s = a.length;
288
355
  for (let t = 0; !o && t < s; t++) {
289
356
  let n = a.item(t);
290
357
  n.nodeType === 1 && (n.localName === "gradientFill" ? (this.processGradientFill(e, n, i), o = !0) : n.localName === "patternFill" && (this.processPatternFill(e, n, i), o = !0));
@@ -293,17 +360,17 @@ var F = class {
293
360
  }
294
361
  processGradientFill(e, t, n) {
295
362
  if (!t) return;
296
- n.type = k.Type.Gradient;
363
+ n.type = M.Type.Gradient;
297
364
  let r = [];
298
365
  n.stops = r;
299
366
  let i = t.getAttribute("type");
300
367
  i && (n.gradientType = i);
301
368
  let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
302
369
  (a + 90) % 360 != 0 && (n.angle = (a + 90) % 360), (t.hasAttribute("left") || t.hasAttribute("top") || t.hasAttribute("right") || t.hasAttribute("bottom")) && (n.focus = {
303
- left: H(t.getAttribute("left")),
304
- top: H(t.getAttribute("top")),
305
- right: H(t.getAttribute("right")),
306
- bottom: H(t.getAttribute("bottom"))
370
+ left: G(t.getAttribute("left")),
371
+ top: G(t.getAttribute("top")),
372
+ right: G(t.getAttribute("right")),
373
+ bottom: G(t.getAttribute("bottom"))
307
374
  });
308
375
  let o = t.childNodes, s = o.length;
309
376
  for (let t = 0; t < s; t++) {
@@ -319,10 +386,10 @@ var F = class {
319
386
  }
320
387
  processPatternFill(e, t, n) {
321
388
  if (!t) return;
322
- let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ? k.BuiltInSheetPattern.Solid : k.BuiltInSheetPattern.None);
323
- if (i === k.BuiltInSheetPattern.None) return { none: !0 };
324
- n.type = k.Type.Pattern, i && (n.patternType = i);
325
- let a = "foreground", o = "background", s = n.patternType === k.BuiltInSheetPattern.Solid && r, c = s ? "dk1" : "lt1", l = s ? "lt1" : "dk1";
389
+ let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ? M.BuiltInSheetPattern.Solid : M.BuiltInSheetPattern.None);
390
+ if (i === M.BuiltInSheetPattern.None) return { none: !0 };
391
+ n.type = M.Type.Pattern, i && (n.patternType = i);
392
+ let a = "foreground", o = "background", s = n.patternType === M.BuiltInSheetPattern.Solid && r, c = s ? "dk1" : "lt1", l = s ? "lt1" : "dk1";
326
393
  if (s) {
327
394
  let e = a;
328
395
  a = o, o = e;
@@ -344,26 +411,28 @@ var F = class {
344
411
  processBorder(e, t, n, r, i) {
345
412
  if (!t) return;
346
413
  let a = {};
347
- return this.processBorderStroke(e, t, a, E.Edge.Left), this.processBorderStroke(e, t, a, E.Edge.Right), i ? (a.right || a.left) && (a.vertical = a.right ? { ...a.right } : { ...a.left }) : this.processBorderStroke(e, t, a, E.Edge.Vertical), this.processBorderStroke(e, t, a, E.Edge.Top), this.processBorderStroke(e, t, a, E.Edge.Bottom), i ? (a.bottom || a.top) && (a.horizontal = a.bottom ? { ...a.bottom } : { ...a.top }) : this.processBorderStroke(e, t, a, E.Edge.Horizontal), n[r] = a, n;
414
+ this.processBorderStroke(e, t, a, k.Edge.Left), this.processBorderStroke(e, t, a, k.Edge.Right), i ? (a.right || a.left) && (a.vertical = a.right ? { ...a.right } : { ...a.left }) : this.processBorderStroke(e, t, a, k.Edge.Vertical), this.processBorderStroke(e, t, a, k.Edge.Top), this.processBorderStroke(e, t, a, k.Edge.Bottom), i ? (a.bottom || a.top) && (a.horizontal = a.bottom ? { ...a.bottom } : { ...a.top }) : this.processBorderStroke(e, t, a, k.Edge.Horizontal);
415
+ let o = this.processBorderStroke(e, t, {}, "diagonal");
416
+ return o && (U(t.getAttribute("diagonalUp")) && (a.diagonalUp = { ...o }), U(t.getAttribute("diagonalDown")) && (a.diagonalDown = { ...o })), n[r] = a, n;
348
417
  }
349
418
  processBorderStroke(e, t, n, r) {
350
419
  if (!t) return;
351
420
  let i = e.evaluate(r, t);
352
421
  if (!i) return;
353
422
  let a = {};
354
- i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = E.StrokeStyle.None);
423
+ i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = k.StrokeStyle.None);
355
424
  let o = e.evaluate("color", i);
356
425
  return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
357
426
  }
358
- }, H = (e) => {
427
+ }, G = (e) => {
359
428
  if (!e) return 0;
360
429
  let t = parseFloat(e);
361
430
  return isNaN(t) ? 0 : t;
362
- }, U = new Set(Object.values(M.ElementType).filter((e) => e !== M.ElementType.WholeTable && e !== M.ElementType.HeaderRow)), W = {
431
+ }, Oe = new Set(Object.values(F.ElementType).filter((e) => e !== F.ElementType.WholeTable && e !== F.ElementType.HeaderRow)), ke = {
363
432
  auto: "auto",
364
433
  autoNoTable: "automaticExceptTables",
365
434
  manual: "manual"
366
- }, G = [
435
+ }, K = [
367
436
  "tableId",
368
437
  "columnId",
369
438
  "cacheName",
@@ -372,10 +441,10 @@ var F = class {
372
441
  "sortOrder",
373
442
  "customListSort",
374
443
  "crossFilter"
375
- ], K = (e, t) => {
444
+ ], q = (e, t) => {
376
445
  let n = e.content, r = n?.json;
377
446
  if (r) {
378
- if (n.type === "shape" || t && n.type === "picture") {
447
+ if (n.type === "shape" || n.type === "picture") {
379
448
  let { rotation: n, flipH: i, flipV: a, bounds: o } = r;
380
449
  delete r.rotation, delete r.flipH, delete r.flipV, delete r.bounds, n !== void 0 && n !== 0 && (e.rotation = n), i && (e.flipH = !0), a && (e.flipV = !0), t && o && (e.anchor = {
381
450
  tl: {
@@ -388,130 +457,36 @@ var F = class {
388
457
  }
389
458
  });
390
459
  }
391
- if (n.type === "group") for (let e of r.members ?? []) K(e, !0);
460
+ if (n.type === "group") for (let e of r.members ?? []) q(e, !0);
392
461
  }
393
- }, le = [
394
- ["fillRef", "fill"],
395
- ["lnRef", "stroke"],
396
- ["effectRef", "effect"]
397
- ], q = class {
398
- visit(e, t, n) {
399
- if (!t) return;
400
- let r = e.evaluate("*/cNvPr", t);
401
- return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, r, n), e.copyFromAttribute(r, "id", n)), n;
402
- }
403
- readNonVisualDetails(e, n, r) {
404
- n.hasAttribute("title") && (r.title = n.getAttribute("title"));
405
- let i = e.evaluate("hlinkClick", n);
406
- i && (r.hyperlink = t(e, i));
407
- let a = e.evaluate("hlinkHover", n);
408
- a && (r.hoverHyperlink = t(e, a));
409
- let o = e.evaluate("extLst", n), s = o ? e.serializeElement(o) : null;
410
- s && (r.extLst = {
411
- ...r.extLst,
412
- nonVisual: s
413
- });
414
- }
415
- setContent(e, t) {
416
- let n = e;
417
- n.name !== void 0 && (t.name = n.name, delete n.name), n.description !== void 0 && (t.description = n.description, delete n.description);
418
- for (let e of [
419
- "title",
420
- "hyperlink",
421
- "hoverHyperlink",
422
- "extLst"
423
- ]) n[e] !== void 0 && (t.json && (t.json[e] = n[e]), delete n[e]);
424
- e.content = t;
425
- }
426
- isGroupContent(e) {
427
- return Array.isArray(e?.members);
428
- }
429
- readMemberHeader(e, t, n) {
430
- let r = {}, i = {
431
- anchor: void 0,
432
- content: {
433
- type: n,
434
- json: r
435
- }
436
- }, a = e.evaluate("*/cNvPr", t);
437
- if (a?.item && (a = a.item(0)), a) {
438
- let n = a.getAttribute("name");
439
- n !== null && (i.content.name = n);
440
- let o = a.getAttribute("descr");
441
- o && (i.content.description = o), e.copyFromAttribute(a, "hidden", i, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, a, r);
442
- let s = this.readSourceId(e, t);
443
- s !== void 0 && (r.sourceId = s);
444
- }
445
- return {
446
- movable: i,
447
- content: r
448
- };
449
- }
450
- readStyleRefs(e, t, n) {
451
- let r = e.evaluate("style", t);
452
- if (!r) return void (n.style = null);
453
- let i = new v(), a = {};
454
- for (let [t, n] of le) {
455
- let o = e.evaluate(t, r);
456
- if (!o) continue;
457
- let s = { index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0 }, c = i.processAdjColor(e, o);
458
- c && (s.color = c), a[n] = s;
459
- }
460
- let o = e.evaluate("fontRef", r);
461
- if (o) {
462
- let t = { index: o.getAttribute("idx") ?? "none" }, n = i.processAdjColor(e, o);
463
- n && (t.color = n), a.font = t;
464
- }
465
- let s = ie.withoutDefaultStyleRefs({
466
- ...n,
467
- style: a
468
- });
469
- s && (n.style = s);
470
- }
471
- readLocks(e) {
472
- let t = e?.attributes;
473
- if (!t || t.length === 0) return;
474
- let n = {};
475
- for (let e = 0; e < t.length; e++) {
476
- let r = t.item(e);
477
- r.name.startsWith("xmlns") || (n[r.localName ?? r.name] = b(r.value));
478
- }
479
- return Object.keys(n).length > 0 ? n : void 0;
480
- }
481
- readSourceId(e, t) {
482
- let n = e.evaluate("*/cNvPr", t);
483
- n?.item && (n = n.item(0));
484
- let r = n?.getAttribute?.("id"), i = r ? parseInt(r, 10) : void 0;
485
- return i === void 0 || isNaN(i) ? void 0 : i;
486
- }
487
- }, J = class extends q {
462
+ }, J = class extends V {
488
463
  visit(e, t, n) {
489
464
  if (t) return this.visitShape(e, t, n, "sp", "nvSpPr/cNvSpPr/spLocks");
490
465
  }
491
- visitShape(e, t, n, r, a) {
492
- let o = i[r];
466
+ visitShape(e, t, n, i, a) {
467
+ let o = fe[i];
493
468
  if (this.isGroupContent(n)) {
494
469
  if (e.getPath().includes("Fallback")) return {};
495
- let { movable: i, content: s } = this.readMemberHeader(e, t, "shape");
496
- o !== j.Type.Shape && (s.type = o), this.readStyleRefs(e, t, s), this.readShapeDetails(e, t, r, a, s);
470
+ let { movable: r, content: s } = this.readMemberHeader(e, t, "shape");
471
+ o !== P.Type.Shape && (s.type = o), this.readShapeDetails(e, t, i, a, s), this.readStyleRefs(e, t, s);
497
472
  let c = e.evaluate(a, t);
498
- c?.hasAttribute?.("noChangeAspect") && (i.lockAspect = c.getAttribute("noChangeAspect") === "1");
473
+ c?.hasAttribute?.("noChangeAspect") && (r.lockAspect = c.getAttribute("noChangeAspect") === "1");
499
474
  let l = this.readTwinOf(e, t);
500
- return l !== void 0 && Object.assign(s, { twinOf: l }), n.members.push(i), s;
475
+ return l !== void 0 && Object.assign(s, { twinOf: l }), n.members.push(r), s;
501
476
  }
502
477
  if (e.getPath().includes("Fallback") && n.content) {
503
- let r = n.content.json;
504
- if (n.content.type === "shape" && r && (r.type ?? j.Type.Shape) === o) {
505
- let n = e.evaluate("txBody", t), i = n ? new y().readTextBody(e, n) : null;
506
- i && f(i) !== "" && (r.text = i);
478
+ let i = n.content.json;
479
+ if (n.content.type === "shape" && i && (i.type ?? P.Type.Shape) === o) {
480
+ let n = e.evaluate("txBody", t), a = n ? new r().readTextBody(e, n) : null;
481
+ a && m(a) !== "" && (i.text = a);
507
482
  }
508
483
  return {};
509
484
  }
510
485
  n = super.visit(e, t, n);
511
486
  let s = e.evaluate(a, t);
512
487
  s?.hasAttribute?.("noChangeAspect") && (n.lockAspect = s.getAttribute("noChangeAspect") === "1");
513
- let c = o === j.Type.Shape ? {} : { type: o }, l = this.readSourceId(e, t);
514
- l !== void 0 && (c.sourceId = l), this.readStyleRefs(e, t, c), this.readShapeDetails(e, t, r, a, c);
488
+ let c = o === P.Type.Shape ? {} : { type: o }, l = this.readSourceId(e, t);
489
+ l !== void 0 && (c.sourceId = l), this.readShapeDetails(e, t, i, a, c), this.readStyleRefs(e, t, c);
515
490
  let u = this.readTwinOf(e, t);
516
491
  return u !== void 0 && Object.assign(c, { twinOf: u }), this.setContent(n, {
517
492
  type: "shape",
@@ -528,7 +503,7 @@ var F = class {
528
503
  let a = t.getAttribute("macro");
529
504
  a && (i.macro = a);
530
505
  let o = t.getAttribute("textlink");
531
- o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText = b(t.getAttribute("fLocksText"))), t.hasAttribute("fPublished") && (i.published = b(t.getAttribute("fPublished")));
506
+ o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText = y(t.getAttribute("fLocksText"))), t.hasAttribute("fPublished") && (i.published = y(t.getAttribute("fPublished")));
532
507
  let s = r.slice(0, r.lastIndexOf("/")), c = e.evaluate(s, t);
533
508
  c?.getAttribute?.("txBox") === "1" && (i.textBox = !0);
534
509
  let l = this.readLocks(e.evaluate(r, t));
@@ -543,25 +518,25 @@ var F = class {
543
518
  (n || r) && (i.connectorEnds = {}, n && (i.connectorEnds.start = n), r && (i.connectorEnds.end = r));
544
519
  }
545
520
  }
546
- }, Y = (e, t, n, r) => {
521
+ }, Ae = /^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/, Y = (e, t, n, r) => {
547
522
  let i = e.evaluate(n, t), a = e.evaluate(r, t);
548
523
  return i || a ? {
549
- x: d(i?.getAttribute("x") ?? null) ?? 0,
550
- y: d(i?.getAttribute("y") ?? null) ?? 0,
551
- width: d(a?.getAttribute("cx") ?? null) ?? 0,
552
- height: d(a?.getAttribute("cy") ?? null) ?? 0
524
+ x: b(i?.getAttribute("x") ?? null) ?? 0,
525
+ y: b(i?.getAttribute("y") ?? null) ?? 0,
526
+ width: b(a?.getAttribute("cx") ?? null) ?? 0,
527
+ height: b(a?.getAttribute("cy") ?? null) ?? 0
553
528
  } : null;
554
529
  }, X = "richTypes", Z = "richData", Q = (e) => {
555
530
  let t = e.getAttribute("val");
556
531
  return t !== "0" && t !== "false";
557
- }, ue = {
532
+ }, je = {
558
533
  1: "serif",
559
534
  2: "sans-serif",
560
535
  3: "monospace",
561
536
  4: "cursive",
562
537
  5: "fantasy"
563
538
  };
564
- function de(e) {
539
+ function Me(e) {
565
540
  let t = {}, n = e.childNodes;
566
541
  for (let e = 0; e < n.length; e++) {
567
542
  let r = n.item(e);
@@ -570,10 +545,10 @@ function de(e) {
570
545
  t.weight = Q(r) ? 700 : 400;
571
546
  break;
572
547
  case "i":
573
- t.style = Q(r) ? A.Style.Italic : A.Style.Normal;
548
+ t.style = Q(r) ? N.Style.Italic : N.Style.Normal;
574
549
  break;
575
550
  case "strike":
576
- t.strike = Q(r);
551
+ t.strike = i(Q(r));
577
552
  break;
578
553
  case "outline":
579
554
  t.outline = Q(r);
@@ -581,15 +556,18 @@ function de(e) {
581
556
  case "shadow":
582
557
  t.shadow = Q(r);
583
558
  break;
584
- case "extend":
585
- t.extend = Q(r);
559
+ case "condense":
560
+ case "extend": {
561
+ let e = a(r.localName, Q(r));
562
+ e !== void 0 && (t.letterSpacing = e);
586
563
  break;
564
+ }
587
565
  case "u":
588
- t.underline = r.getAttribute("val") || A.UnderlineStyle.Single;
566
+ t.underline = h(r.getAttribute("val"));
589
567
  break;
590
568
  case "vertAlign": {
591
- let e = r.getAttribute("val");
592
- e === "superscript" ? t.verticalAlign = A.VerticalAlignment.Super : e === "subscript" ? t.verticalAlign = A.VerticalAlignment.Sub : e === "baseline" && (t.verticalAlign = A.VerticalAlignment.Baseline);
569
+ let e = T(r.getAttribute("val"));
570
+ e !== void 0 && (t.baseline = e);
593
571
  break;
594
572
  }
595
573
  case "sz": {
@@ -603,7 +581,7 @@ function de(e) {
603
581
  break;
604
582
  }
605
583
  case "family": {
606
- let e = ue[r.getAttribute("val") ?? ""];
584
+ let e = je[r.getAttribute("val") ?? ""];
607
585
  e && (t.fallbacks = [e]);
608
586
  break;
609
587
  }
@@ -612,18 +590,16 @@ function de(e) {
612
590
  isNaN(e) || (t.charset = e);
613
591
  break;
614
592
  }
615
- case "scheme": {
616
- let e = r.getAttribute("val");
617
- e && (t.scheme = e);
593
+ case "scheme":
594
+ v(t, r.getAttribute("val"));
618
595
  break;
619
- }
620
596
  case "color": {
621
597
  let e = r.getAttribute("rgb");
622
598
  if (e && !r.hasAttribute("theme")) {
623
599
  t.color = "#" + (e.length === 8 ? e.substring(2) : e).toUpperCase();
624
600
  break;
625
601
  }
626
- let n = S((e) => r.getAttribute(e));
602
+ let n = x((e) => r.getAttribute(e));
627
603
  n && (t.color = n);
628
604
  break;
629
605
  }
@@ -667,14 +643,37 @@ var $ = {
667
643
  },
668
644
  AppPropertiesVisitor: class {
669
645
  visit(e, t, n) {
670
- let r = [], i = t.childNodes, a = i.length;
671
- for (let t = 0; t < a; t++) {
672
- let n = i.item(t);
646
+ let r = t.childNodes, i = r.length;
647
+ for (let e = 0; e < i; e++) if (r.item(e).localName === "property") return this.visitCustom(t, n);
648
+ let a = [];
649
+ for (let t = 0; t < i; t++) {
650
+ let n = r.item(t);
673
651
  if (n.nodeType !== 1) continue;
674
- let a = this.processProperty(e, n);
675
- a && r.push(a);
652
+ let i = this.processProperty(e, n);
653
+ i && a.push(i);
676
654
  }
677
- return r.length > 0 && (n.properties = r), r;
655
+ return a.length > 0 && (n.properties = a), a;
656
+ }
657
+ visitCustom(e, t) {
658
+ let n = [], r = e.childNodes, i = r.length;
659
+ for (let e = 0; e < i; e++) {
660
+ let t = r.item(e);
661
+ if (t.nodeType !== 1 || t.localName !== "property") continue;
662
+ let i = t.getAttribute("name");
663
+ if (!i) continue;
664
+ let a = null;
665
+ for (let e = 0; e < t.childNodes.length && !a; e++) {
666
+ let n = t.childNodes.item(e);
667
+ n.nodeType === 1 && (a = n);
668
+ }
669
+ let o = {
670
+ key: i,
671
+ kind: a?.localName ?? null,
672
+ value: a?.textContent ?? ""
673
+ }, s = t.getAttribute("linkTarget");
674
+ s && (o.linkTarget = s), n.push(o);
675
+ }
676
+ return n.length > 0 && (t.custom = n), n;
678
677
  }
679
678
  processProperty(e, t) {
680
679
  if (t) return {
@@ -683,272 +682,37 @@ var $ = {
683
682
  };
684
683
  }
685
684
  },
686
- ChartSpaceVisitor: class {
687
- visit(e, t, n) {
688
- return a(e, t, n, "roundedCorners", "roundedCorners"), c(e, t, n, ".//AlternateContent/Fallback/style", "styleId"), e.getVisitorParamsState().set("types", []), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), n.range = null, n;
689
- }
690
- afterVisit(e, t, n) {
691
- let r = {};
692
- n.types = r;
693
- let i = {}, a = 0, o = {}, s = 0, c = e.getVisitorParamsState().get("axes"), l = e.getVisitorParamsState().get("types"), u = l.length;
694
- for (let e = 0; e < u; e++) {
695
- let t = l[e];
696
- if (t.xAxisId) {
697
- let r = t.xAxisId, o = c.get(r);
698
- i[e + ""] = o, t.offsetXAxis = e, delete t.xAxisId, n.xAxes = i, i.length = ++a;
699
- }
700
- if (t.yAxisId) {
701
- let r = t.yAxisId, i = c.get(r);
702
- o[e + ""] = i, t.offsetYAxis = e, delete t.yAxisId, n.yAxes = o, o.length = ++s;
703
- }
704
- r[e + ""] = t;
705
- }
706
- r.length = l.length;
707
- let d = e.getVisitorParamsState().get("series");
708
- if (!d || d.length === 0) return;
709
- let f = {};
710
- n.series = f;
711
- let p = d.length;
712
- for (let e = 0; e < p; e++) f[e + ""] = d[e];
713
- f.length = p, e.getVisitorParamsState().delete("types"), e.getVisitorParamsState().delete("axes"), e.getVisitorParamsState().delete("series");
714
- }
715
- },
716
- ChartVisitor: class {
717
- visit(e, t, n) {
718
- return e.getVisitorParamsState().set("types", []), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), a(e, t, n, "plotVisOnly", "plotVisOnly"), r(e, t, n, "dispBlanksAs", "dispBlanksAs"), a(e, t, n, ".//extLst/ext/dataDisplayOptions16/dispNaAsBlank", "dispNaAsBlank"), a(e, t, n, "showDLblsOverMax", "showDLblsOverMax"), n;
719
- }
720
- afterVisit(e, t, n) {
721
- try {
722
- let r = e.getValAttrAsBoolean("autoTitleDeleted", t), i = e.evaluate("title", t);
723
- e.setToPath(n, "title.shown", !(!0 === r || !i));
724
- let a = e.evaluate("legend", t);
725
- e.setToPath(n, "legend.shown", a !== null);
726
- } catch (e) {
727
- throw Error("Unexpected Error parsing Chart: " + e);
728
- }
729
- }
730
- },
731
- PlotAreaVisitor: class {
732
- visit(e, t, n) {
733
- let r = {};
734
- return n.plotArea = r, r;
735
- }
736
- },
737
- ShapePropertiesVisitor: s,
738
- BarChartTypeVisitor: class extends z {
739
- parseType(e, t, n) {
740
- let r = e.getValAttrAsString("barDir", t);
741
- r && (n.type = r === "col" ? "column" : "bar");
742
- }
743
- },
744
- ChartTypeVisitor: z,
745
- DataLabelsVisitor: class {
746
- constructor(e) {
747
- this.jsonKey = e;
748
- }
749
- visit(e, t, n) {
750
- let i = {}, o = i, s = e.getValAttrAsString("idx", t);
751
- s !== null && (o = {}, o[s] = i);
752
- let c = e.getValAttrAsBoolean("delete", t);
753
- this.parseNumFormat(e, t, i), !0 === c ? (i.showBubbleSize = !1, i.showCatName = !1, i.showLeaderLines = !1, i.showPercentage = !1, i.showSerName = !1, i.showVal = !1, i.showLegendKey = !1) : (a(e, t, i, "showBubbleSize", "showBubbleSize"), a(e, t, i, "showCatName", "showCatName"), a(e, t, i, "showLeaderLines", "showLeaderLines"), a(e, t, i, "showPercent", "showPercentage"), a(e, t, i, "showSerName", "showSerName"), a(e, t, i, "showVal", "showVal"), a(e, t, i, "showLegendKey", "showLegendKey"));
754
- let l = e.evaluate("separator", t);
755
- return l !== null && (i.separator = l.textContent), r(e, t, i, "dLblPos", "position"), n[this.jsonKey] = o, i;
756
- }
757
- parseNumFormat(e, t, n) {
758
- let r = e.evaluate("numFmt", t);
759
- r && (n.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (n.sourceLinked = r.getAttribute("sourceLinked") === "1"));
760
- }
761
- },
762
- SeriesVisitor: class {
685
+ ShapePropertiesVisitor: C,
686
+ TextPropertiesVisitor: ie,
687
+ ShapeTextVisitor: r,
688
+ ThemeVisitor: class {
763
689
  visit(e, t, n) {
764
- let r = {};
765
- c(e, t, r, "explosion", "explosion");
766
- let i = e.evaluate("cat/*/f", t);
767
- i ||= e.evaluate("xVal/*/f", t);
768
- let o = null;
769
- i !== null && i.firstChild !== null && (o = i.firstChild.nodeValue), i || (i = e.evaluate("cat/strLit", t), i ||= e.evaluate("cat/numLit", t), i && (o = this.parsePointsAsString(e, i))), o !== null && (r.xRange = o);
770
- let s = e.evaluate("val/*/f", t);
771
- s ||= e.evaluate("yVal/*/f", t);
772
- let l = null;
773
- s && s.firstChild && (l = s.firstChild.nodeValue), s || (s = e.evaluate("val/numLit", t), s !== null && (l = this.parsePointsAsString(e, s))), l !== null && (r.valRange = l), this.parseTitleRangeOrValue(e, t, r), c(e, t, r, "idx", "idx"), a(e, t, r, "smooth", "smooth"), r.offsetChart = e.getVisitorParamsState().get("types").length - 1;
774
- let u = e.getVisitorParamsState().get("series");
775
- return u || (u = [], e.getVisitorParamsState().set("series", u)), u.push(r), r;
776
- }
777
- parseTitleRangeOrValue(e, t, n) {
778
- let r = e.evaluate("tx/strRef/f", t);
779
- if (r !== null) {
780
- let t = r.firstChild.nodeValue;
781
- e.setToPath(n, "title.range", t);
782
- } else {
783
- let r = e.evaluate("tx/v", t);
784
- r !== null && e.setToPath(n, "title.text.simpleRun", r.firstChild.nodeValue);
785
- }
786
- }
787
- parsePointsAsString(e, t) {
788
- let n = "{", r = e.getValAttrAsInteger("ptCount", t), i = e.evaluate("pt", t), a = [];
789
- for (let n = 0; i && r && n < r; n++) {
790
- let r = null, i = e.evaluate("pt[@idx='" + n + "']/v", t);
791
- i && (r = i.textContent), a[n] = r;
792
- }
793
- for (let e = 0; e < a.length; e++) e > 0 && (n += ","), a[e] !== void 0 && (n += a[e]);
794
- return n += "}", n;
795
- }
796
- afterVisit(e, t, n) {
797
- B(e, t, n);
798
- let r = e.getFromPath(n, "points");
690
+ n.name = t.getAttribute("name"), n.objectDefaults = {};
691
+ let r = z(t, "custClrLst")[0];
799
692
  if (r) {
800
- let t = Object.keys(r);
801
- for (let i = 0; i < t.length; i++) {
802
- let a = t[i], o = e.getFromPath(r, a);
803
- if (!o) continue;
804
- let s = e.getFromPath(o, "markers");
805
- s && (e.setToPath(n, "markers.points." + a, s), delete o.markers);
693
+ let t = new f(), i = [];
694
+ for (let n of z(r, "custClr")) {
695
+ let r = t.processAdjColor(e, n);
696
+ if (!r) continue;
697
+ let a = { color: r }, o = n.getAttribute("name");
698
+ o && (a.name = o), i.push(a);
806
699
  }
700
+ i.length && (n.customColors = i);
807
701
  }
808
- }
809
- },
810
- DataPointVisitor: class {
811
- DataPointVisitor() {}
812
- visit(e, t, n) {
813
- let r = e.getFromPath(n, "points"), i = null;
814
- r ? i = r : (i = {}, e.setToPath(n, "points", i));
815
- let o = {}, s = e.getValAttrAsString("idx", t);
816
- return s !== null && (i[s] = o), a(e, t, o, "bubble3D", "bubble3D"), c(e, t, o, "explosion", "explosion"), B(e, t, o), o;
817
- }
818
- },
819
- MarkerVisitor: class {
820
- visit(e, t, n) {
821
- let r = t.parentNode.localName;
822
- if (r === "ser" || r === "dPt") {
823
- let r = {}, i = e.getValAttrAsString("size", t);
824
- i !== null && (r.size = i);
825
- let a = e.getValAttrAsString("symbol", t);
826
- return a && (r.type = a), n.markers = r, r;
827
- }
828
- return null;
829
- }
830
- },
831
- AxisVisitor: class {
832
- visit(e, t, n) {
833
- let i = {};
834
- this.parseScaling(e, t, i), o(e, t, i, "majorUnit", "majorUnits"), o(e, t, i, "minorUnit", "minorUnits"), a(e, t, i, "delete", "shown"), this.parseOrientation(e, t, i), this.parseNumFormat(e, t, i), r(e, t, i, "majorTickMark", "majorTickMarks"), r(e, t, i, "minorTickMark", "minorTickMarks"), r(e, t, i, "crosses", "crosses"), o(e, t, i, "crossesAt", "crosses"), r(e, t, i, "crossBetween", "crossBetween"), this.parseLabelAlign(e, t, i), c(e, t, i, "lblOffset", "labelOffset"), r(e, t, i, "tickLblPos", "labelPosition");
835
- let s = e.getValAttrAsInteger("noMultiLvlLbl", t);
836
- i.labelMultiLevel = s !== null && s === 0, c(e, t, i, "tickMarkSkip", "tickMarkSkip"), c(e, t, i, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(t, e, i), this.parseTimeUnits(e, t, i, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(e, t, i, "minorUnitDates", "minorTimeUnit", "minorUnit"), r(e, t, i, "baseTimeUnit", "baseUnitDates"), e.getVisitorParamsState().get("axes") || (e.warn("An axis was read outside a chart; its axes were started fresh.", { onceKey: "xlsx.chart.axesState" }), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
837
- let l = e.getValAttrAsString("axId", t);
838
- return e.getVisitorParamsState().get("axes").set(l, i), i;
839
- }
840
- parseTimeUnits(e, t, n, r, i, a) {
841
- let o = {}, s = e.getValAttrAsString(i, t);
842
- s !== null && (o.dem = s, o.amt = e.getValAttrAsString(a, t)), Object.keys(o).length > 0 && (n[r] = o);
843
- }
844
- parseDisplayCustOrBuiltInUnit(e, t, n) {
845
- let r = t.getValAttrAsString("dispUnits/builtInUnit", e);
846
- r ||= t.getValAttrAsString("dispUnits/custUnit", e), r && (n.displayUnits = r);
847
- }
848
- parseLabelAlign(e, t, n) {
849
- let r = e.getValAttrAsString("lblAlgn", t);
850
- r !== null && (r === "ctr" ? n.labelAlign = "center" : r === "l" ? n.labelAlign = "left" : r === "r" && (n.labelAlign = "right"));
851
- }
852
- parseOrientation(e, t, n) {
853
- let r = e.getValAttrAsString("AxPos", t);
854
- r !== null && (r === "b" ? n.orientation = "bottom" : r === "l" ? n.orientation = "left" : r === "r" ? n.orientation = "right" : r === "t" && (n.orientation = "top"));
855
- }
856
- parseNumFormat(e, t, n) {
857
- let r = {}, i = e.evaluate("numFmt", t);
858
- i !== null && (i.hasAttribute("formatCode") && (r.formatCode = i.getAttribute("formatCode")), i.hasAttribute("sourceLinked") && (r.sourceLinked = i.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (n.labels = r);
859
- }
860
- parseScaling(e, t, n) {
861
- let r = e.getValAttrAsString("scaling/orientation", t);
862
- r !== null && (n.inverted = r !== "minMax");
863
- let i = e.getValAttrAsFloat("scaling/logBase", t);
864
- i !== null && (n.logBase = i, n.scaleType = "log"), o(e, t, n, "scaling/max", "max"), o(e, t, n, "scaling/min", "min");
865
- }
866
- afterVisit(e, t, n) {
867
- n.fill && n.labels && (n.labels.fill = n.fill, delete n.fill);
868
- let r = e.getValAttrAsBoolean("delete", t);
869
- r !== null && (e.setToPath(n, "labels.shown", !0 !== r), e.setToPath(n, "shown", !0 !== r));
870
- let i = e.getFromPath(n, "dispUnits.displayUnitsLabel");
871
- i && (e.setToPath(n, "displayUnitsLabel", i), delete n.dispUnits);
872
- let a = e.evaluate("title", t);
873
- e.setToPath(n, "title.shown", a !== null);
874
- let o = e.evaluate("minorGridlines", t);
875
- e.setToPath(n, "gridLinesMinor.shown", o !== null);
876
- let s = e.evaluate("majorGridlines", t);
877
- e.setToPath(n, "gridLinesMajor.shown", s !== null);
878
- }
879
- },
880
- TextPropertiesVisitor: n,
881
- ShapeTextVisitor: y,
882
- LegendEntryVisitor: class {
883
- visit(e, t, n) {
884
- let r = e.getVisitorParamsState().get("series"), i = e.getValAttrAsInteger("idx", t), a = i === null ? void 0 : r[i];
885
- if (a) {
886
- let n = e.getFromPath(a, "title");
887
- n || (n = {}, e.setToPath(a, "title", n));
888
- let r = n, i = e.getValAttrAsBoolean("delete", t);
889
- return i !== null && (r.shown = !i), r;
890
- }
891
- return n;
892
- }
893
- },
894
- LegendVisitor: class {
895
- visit(e, t, n) {
896
- let i = {};
897
- return a(e, t, i, "overlay", "overlay"), r(e, t, i, "legendPos", "position"), n.legend = i, i;
898
- }
899
- },
900
- NegativeShapeVisitor: class extends s {
901
- visit(e, t, n) {
902
- let r = this.getFill(e, t);
903
- Object.keys(r).length > 0 && (n.fillNegative = r);
904
- let i = this.getStroke(e, t);
905
- return Object.keys(i).length > 0 && (n.strokeNegative = i), n;
906
- }
907
- },
908
- TitleVisitor: class extends n {
909
- constructor(e = "title") {
910
- super(e);
911
- }
912
- parseTitleRangeOrValue(e, t, n) {
913
- let r = e.evaluate("tx/strRef/f", t) ?? null;
914
- if (r) {
915
- let t = r.firstElementChild.nodeValue;
916
- e.setToPath(n, "range", t);
917
- }
918
- }
919
- visit(e, t, n) {
920
- let r = {};
921
- a(e, t, r, "overlay", "overlay"), n[this._jsonKey] = r;
922
- let i = e.getFromPath(r, this.getTextPath());
923
- i ||= {}, this.parseTitleRangeOrValue(e, t, r);
924
- let o = e.evaluate("txPr", t);
925
- o && this.parseTextElement(e, o, i, !1);
926
- let s = e.evaluate("tx/rich", t);
927
- return s && this.parseTextElement(e, s, i, !0), Object.keys(i).length > 0 && e.setToPath(r, "text", i), r;
928
- }
929
- afterVisit(e, t, n) {
930
- if (n?.text) {
931
- let e = n.text?.rotation ?? null;
932
- e !== null && (n.rotation = parseInt(e), delete n.title.rotation);
933
- }
934
- }
935
- },
936
- LayoutVisitor: class {
937
- visit(e, t, n) {
938
- let i = e.evaluate("manualLayout", t);
939
- if (i) {
940
- let t = {};
941
- o(e, i, t, "x", "x"), o(e, i, t, "y", "y"), o(e, i, t, "w", "w"), o(e, i, t, "h", "h"), r(e, i, t, "xMode", "xMode"), r(e, i, t, "yMode", "yMode"), r(e, i, t, "wMode", "wMode"), r(e, i, t, "hMode", "hMode"), Object.keys(t).length > 0 && (n.manualLayout = t);
702
+ for (let e of z(t, "extLst")) for (let t of z(e, "ext")) {
703
+ if (t.getAttribute("uri") !== "{05A4C25C-085E-4340-85A3-A5531E510DB2}") continue;
704
+ let e = z(t, "themeFamily")[0], r = e?.getAttribute("id");
705
+ if (!r) continue;
706
+ let i = {
707
+ name: e.getAttribute("name") ?? "",
708
+ id: r
709
+ }, a = e.getAttribute("vid");
710
+ a && (i.vid = a), n.family = i;
942
711
  }
943
712
  return n;
944
713
  }
945
714
  },
946
- ThemeVisitor: class {
947
- visit(e, t, n) {
948
- return n.name = t.getAttribute("name"), n;
949
- }
950
- },
951
- ClrSchemeVisitor: class extends v {
715
+ ClrSchemeVisitor: class extends f {
952
716
  visit(e, t, n) {
953
717
  let r = {};
954
718
  r.name = t.getAttribute("name");
@@ -967,22 +731,50 @@ var $ = {
967
731
  visit(e, t, n) {
968
732
  let r = {};
969
733
  r.name = t.getAttribute("name");
970
- let i = e.evaluate("majorFont", t), a = this.processFontElement(e, i, {});
971
- a && (r.majorFont = a.family, a.fallbacks && (r.majorFallbacks = a.fallbacks));
972
- let o = e.evaluate("minorFont", t), s = this.processFontElement(e, o, {});
973
- return s && (r.minorFont = s.family, s.fallbacks && (r.minorFallbacks = s.fallbacks)), n.fonts = r, r;
734
+ let i = this.processFontCollection(e, e.evaluate("majorFont", t));
735
+ i && (r.major = i);
736
+ let a = this.processFontCollection(e, e.evaluate("minorFont", t));
737
+ return a && (r.minor = a), n.fonts = r, r;
974
738
  }
975
- processFontElement(e, t, n) {
739
+ processFontCollection(e, t) {
976
740
  if (!t) return;
977
- let r = e.evaluate("latin", t);
978
- if (!r) return;
979
- let i = r.getAttribute("typeface");
980
- i && (n.family = i);
981
- let a = r.getAttribute("panose");
982
- return a && (n.fallbacks = [A.getPanoseFallback(a)]), n;
741
+ let n = {}, r = e.evaluate("latin", t), i = r?.getAttribute("typeface");
742
+ i && (n.latin = i);
743
+ let a = r?.getAttribute("panose");
744
+ a && (n.panose = a);
745
+ let o = e.evaluate("ea", t)?.getAttribute("typeface");
746
+ o && (n.eastAsian = o);
747
+ let s = e.evaluate("cs", t)?.getAttribute("typeface"), c;
748
+ s && (n.complexScript = s);
749
+ let l = t.childNodes, u = l.length;
750
+ for (let e = 0; e < u; e++) {
751
+ let t = l.item(e);
752
+ if (t.nodeType !== 1 || t.localName !== "font") continue;
753
+ let n = t.getAttribute("script");
754
+ n && ((c ??= {})[n] = t.getAttribute("typeface") ?? "");
755
+ }
756
+ return c && (n.scripts = c), n;
983
757
  }
984
758
  },
985
- FmtSchemeVisitor: class extends v {
759
+ ObjectDefaultsVisitor: class {
760
+ visit(e, t, n) {
761
+ let r = {};
762
+ for (let [n, i] of De) {
763
+ let a = e.evaluate(n, t);
764
+ a && (r[i] = this.processDefault(e, a));
765
+ }
766
+ return n.objectDefaults = r, {};
767
+ }
768
+ processDefault(e, t) {
769
+ let n = {}, i = e.evaluate("spPr", t);
770
+ i && new C().visit(e, i, n);
771
+ let a = new r().readTextBody(e, t);
772
+ (a.body || a.listStyle) && (n.text = a);
773
+ let o = e.evaluate("style", t);
774
+ return o && (n.style = B(e, o)), n;
775
+ }
776
+ },
777
+ FmtSchemeVisitor: class extends f {
986
778
  visit(e, t, n) {
987
779
  let r = this.parseFillList(e, t, "fillStyleLst"), i = this.parseLnList(e, t, "lnStyleLst"), a = this.parseEffectStyleList(e, t, "effectStyleLst"), o = this.parseFillList(e, t, "bgFillStyleLst");
988
780
  if (r && (n.fillStyleLst = r), i && (n.lnStyleLst = i), a && (n.effectStyleLst = a), o && (n.bgFillStyleLst = o), r && i && a && o) return;
@@ -1004,11 +796,11 @@ var $ = {
1004
796
  }
1005
797
  parseFillListItem(e, t) {
1006
798
  switch (t.localName) {
1007
- case "noFill": return { type: k.Type.None };
799
+ case "noFill": return { type: M.Type.None };
1008
800
  case "solidFill": {
1009
801
  let n = this.processAdjColor(e, t);
1010
802
  return n ? {
1011
- type: k.Type.Solid,
803
+ type: M.Type.Solid,
1012
804
  color: n
1013
805
  } : void 0;
1014
806
  }
@@ -1046,17 +838,19 @@ var $ = {
1046
838
  visit(e, t, n) {
1047
839
  if (!t) return;
1048
840
  let r = {}, i = [];
1049
- return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r), r;
841
+ return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r), n;
1050
842
  }
1051
843
  processColorFilter(e, t) {
1052
844
  let n = {}, r = {
1053
- operator: O.BuiltInOperatorNames.Color,
845
+ operator: j.BuiltInOperatorNames.Color,
1054
846
  param: n
1055
847
  };
1056
- return e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY), e.copyFromAttribute(t, "dxfId", n, "styleId", e.INT_COPY), r;
848
+ e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY);
849
+ let i = H(e, t);
850
+ return i && (n.style = i), r;
1057
851
  }
1058
852
  processCustomFilter(e, t) {
1059
- return te({
853
+ return se({
1060
854
  operator: t.getAttribute("operator"),
1061
855
  val: t.getAttribute("val")
1062
856
  }, (t) => e.warn(t));
@@ -1065,7 +859,7 @@ var $ = {
1065
859
  let n = t.getAttribute("and"), r = n === "and" || n === "1";
1066
860
  t.getAttribute("val");
1067
861
  let i = [], a = {
1068
- operator: r ? O.BuiltInOperatorNames.And : O.BuiltInOperatorNames.Or,
862
+ operator: r ? j.BuiltInOperatorNames.And : j.BuiltInOperatorNames.Or,
1069
863
  param: i
1070
864
  }, o = t.childNodes, s = o.length;
1071
865
  for (let t = 0; t < s; t++) {
@@ -1074,10 +868,10 @@ var $ = {
1074
868
  let r = null;
1075
869
  n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
1076
870
  }
1077
- return i.length === 1 ? i[0] : l(a);
871
+ return i.length === 1 ? i[0] : le(a);
1078
872
  }
1079
873
  processDynamicFilter(e, t) {
1080
- return p(t.getAttribute("type"));
874
+ return ne(t.getAttribute("type"));
1081
875
  }
1082
876
  processDateGroupItem(e, t) {
1083
877
  let n = {};
@@ -1088,10 +882,10 @@ var $ = {
1088
882
  }
1089
883
  processFilters(e, t) {
1090
884
  let n = {}, r = {
1091
- operator: O.BuiltInOperatorNames.InSet,
885
+ operator: j.BuiltInOperatorNames.InSet,
1092
886
  param: n
1093
887
  };
1094
- r.selector = O.BuiltInSelectorNames.Display, e.copyFromAttribute(t, "blank", n, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", n, "calendarType");
888
+ r.selector = j.BuiltInSelectorNames.Display, e.copyFromAttribute(t, "blank", n, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", n, "calendarType");
1095
889
  let i = [], a = [], o = t.childNodes, s = o.length;
1096
890
  for (let t = 0; t < s; t++) {
1097
891
  let n = o.item(t);
@@ -1109,14 +903,14 @@ var $ = {
1109
903
  }
1110
904
  processIcon(e, t) {
1111
905
  let n = {}, r = {
1112
- operator: O.BuiltInOperatorNames.Icon,
906
+ operator: j.BuiltInOperatorNames.Icon,
1113
907
  param: n
1114
908
  };
1115
909
  return e.copyFromAttribute(t, "iconId", n, "iconId", e.INT_COPY), e.copyFromAttribute(t, "iconSet", n), r;
1116
910
  }
1117
911
  processTop10(e, t) {
1118
912
  let n = {}, r = {
1119
- operator: O.BuiltInOperatorNames.TopN,
913
+ operator: j.BuiltInOperatorNames.TopN,
1120
914
  param: n
1121
915
  };
1122
916
  return e.copyFromAttribute(t, "filterVal", n, "filterVal", e.FLOAT_COPY), e.copyFromAttribute(t, "percent", n, "percent", e.BOOLEAN_COPY), e.copyFromAttribute(t, "top", n, "top", e.BOOLEAN_COPY), e.copyFromAttribute(t, "val", n, "limit", e.FLOAT_COPY), r;
@@ -1125,7 +919,7 @@ var $ = {
1125
919
  let n = t.childNodes;
1126
920
  for (let t = 0; t < n.length; t++) {
1127
921
  let r = n.item(t);
1128
- if (r.nodeType !== 1 || r.localName !== "ext" || u(r.getAttribute("uri")) !== u("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
922
+ if (r.nodeType !== 1 || r.localName !== "ext" || w(r.getAttribute("uri")) !== w("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
1129
923
  let i = r.childNodes;
1130
924
  for (let t = 0; t < i.length; t++) {
1131
925
  let n = i.item(t);
@@ -1151,12 +945,12 @@ var $ = {
1151
945
  if (!t) return null;
1152
946
  if (!t.hasAttribute("colId")) return;
1153
947
  let r = parseInt(t.getAttribute("colId")), i = !1;
1154
- if (t.hasAttribute("hiddenButton") && (i = b(t.getAttribute("hiddenButton"))), i && n) {
948
+ if (t.hasAttribute("hiddenButton") && (i = y(t.getAttribute("hiddenButton"))), i && n) {
1155
949
  let e = n.hiddenButtons;
1156
950
  e || (e = [], n.hiddenButtons = e), e.push(r);
1157
951
  }
1158
952
  let a = !1;
1159
- if (t.hasAttribute("showButton") && (a = b(t.getAttribute("showButton"))), a && n) {
953
+ if (t.hasAttribute("showButton") && (a = y(t.getAttribute("showButton"))), a && n) {
1160
954
  let e = n.showButtons;
1161
955
  !0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
1162
956
  }
@@ -1180,7 +974,7 @@ var $ = {
1180
974
  visit(e, t, n) {
1181
975
  if (!t) return;
1182
976
  let r = t.getAttribute("ref"), i = {};
1183
- t.hasAttribute("caseSensitive") && (i.collatorOptions = b(t.getAttribute("caseSensitive")) ? P.CaseSensitiveOptions : P.CaseInsensitiveOptions);
977
+ t.hasAttribute("caseSensitive") && (i.collatorOptions = y(t.getAttribute("caseSensitive")) ? L.CaseSensitiveOptions : L.CaseInsensitiveOptions);
1184
978
  let a = t.getAttribute("sortMethod");
1185
979
  a != null && a !== "none" && (a === "stroke" ? i.collatorOptions = {
1186
980
  ...i.collatorOptions,
@@ -1190,63 +984,101 @@ var $ = {
1190
984
  collation: "pinyin"
1191
985
  }));
1192
986
  let o = {};
1193
- t.hasAttribute("columnSort") && b(t.getAttribute("columnSort")) && (o.axis = re.Axis.Column);
1194
- let s = w.fastStringToRange(r), c = [];
1195
- return this.processSortConditions(e, t, c, s, i), c.length > 0 && (o.sorts = c), Object.keys(c).length > 0 && (n.sort = o), o;
987
+ t.hasAttribute("columnSort") && y(t.getAttribute("columnSort")) && (o.axis = ve.Axis.Column);
988
+ let s = D.fastStringToRange(r), c = [], u = [];
989
+ this.processSortConditions(e, t, c, s, i, u), c.length > 0 && (o.sorts = c);
990
+ let d = e.getVisitorParamsState().get("ref");
991
+ if (d && r) {
992
+ let e = D.fastStringToRange(d);
993
+ o.extent = {
994
+ range: l(e, s),
995
+ sorts: u.map((t) => ee(e, s, t))
996
+ };
997
+ }
998
+ return Object.keys(c).length > 0 && (n.sort = o), o;
1196
999
  }
1197
- processSortCondition(e, t, n, r) {
1000
+ processSortCondition(e, t, n, r, i) {
1198
1001
  if (!t) return null;
1199
- let i = {};
1002
+ let a = {};
1200
1003
  if (!t.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1201
1004
  if (t.hasAttribute("ref")) {
1202
- let e = t.getAttribute("ref"), r = w.fastStringToRange(e);
1203
- i.index = n ? r.colStart - n.colStart : r.colStart;
1005
+ let e = t.getAttribute("ref"), r = D.fastStringToRange(e);
1006
+ a.index = n ? r.colStart - n.colStart : r.colStart, i?.push(r);
1204
1007
  }
1205
- let a = { ...r };
1206
- return i.criteria = a, a.reverse = !1, t.hasAttribute("descending") && (a.reverse = b(t.getAttribute("descending"))), e.copyFromAttribute(t, "sortBy", a, "sortOn"), e.copyFromAttribute(t, "dxfId", a), e.copyFromAttribute(t, "iconSet", a), e.copyFromAttribute(t, "customList", a), i;
1008
+ let o = { ...r };
1009
+ a.criteria = o, o.reverse = !1, t.hasAttribute("descending") && (o.reverse = y(t.getAttribute("descending")));
1010
+ let s = oe(t.getAttribute("sortBy"));
1011
+ s && (o.sortOn = s);
1012
+ let c = H(e, t);
1013
+ return c && (o.style = c), e.copyFromAttribute(t, "iconSet", o), e.copyFromAttribute(t, "customList", o), a;
1207
1014
  }
1208
- processSortConditions(e, t, n, r, i) {
1015
+ processSortConditions(e, t, n, r, i, a) {
1209
1016
  if (!t) return;
1210
- let a = t.childNodes, o = a.length;
1211
- for (let t = 0; t < o; t++) {
1212
- let o = a.item(t);
1213
- if (o.nodeType === 1 && o.localName === "sortCondition") {
1214
- let t = this.processSortCondition(e, o, r, i);
1017
+ let o = t.childNodes, s = o.length;
1018
+ for (let t = 0; t < s; t++) {
1019
+ let s = o.item(t);
1020
+ if (s.nodeType === 1 && s.localName === "sortCondition") {
1021
+ let t = this.processSortCondition(e, s, r, i, a);
1215
1022
  t && n.push(t);
1216
1023
  }
1217
1024
  }
1218
1025
  }
1219
1026
  },
1220
- SheetStyleVisitor: class extends V {
1221
- visit(e, t, n) {
1222
- this.processNumFmts(e, e.evaluate("numFmts", t), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1223
- let r = {
1027
+ SheetStyleVisitor: class extends W {
1028
+ visit(e, r, i) {
1029
+ this.processNumFmts(e, e.evaluate("numFmts", r), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1030
+ let a = {
1224
1031
  fills: {},
1225
1032
  fonts: {},
1226
1033
  borders: {}
1034
+ }, o = e.evaluate("fonts", r);
1035
+ this.processFonts(e, o, a.fonts);
1036
+ let s = a.fonts[this.normalFontId(e, r)], c = {
1037
+ declared: ["1", "true"].includes(o?.getAttribute("x14ac:knownFonts") ?? ""),
1038
+ normalIsThemeFont: n(s?.family),
1039
+ faces: ae(Object.values(a.fonts).map((e) => ({
1040
+ ...e,
1041
+ family: t(e?.family, e?.fallbacks, null, !1).name
1042
+ })))
1227
1043
  };
1228
- this.processFonts(e, e.evaluate("fonts", t), r.fonts), this.processFills(e, e.evaluate("fills", t), r.fills), this.processBorders(e, e.evaluate("borders", t), r.borders, !0), r.fills[0] = { type: k.Type.None }, r.fills[1] = {
1229
- type: k.Type.Pattern,
1230
- patternType: k.BuiltInSheetPattern.Gray125
1231
- }, r.borders[0] = {
1232
- bottom: { style: E.StrokeStyle.None },
1233
- left: { style: E.StrokeStyle.None },
1234
- right: { style: E.StrokeStyle.None },
1235
- top: { style: E.StrokeStyle.None }
1044
+ e.getVisitorParamsState().set(ce, c), s && e.getVisitorParamsState().set(me, s), this.processFills(e, e.evaluate("fills", r), a.fills), this.processBorders(e, e.evaluate("borders", r), a.borders, !0), a.fills[0] = { type: M.Type.None }, a.fills[1] = {
1045
+ type: M.Type.Pattern,
1046
+ patternType: M.BuiltInSheetPattern.Gray125
1047
+ }, a.borders[0] = {
1048
+ bottom: { style: k.StrokeStyle.None },
1049
+ left: { style: k.StrokeStyle.None },
1050
+ right: { style: k.StrokeStyle.None },
1051
+ top: { style: k.StrokeStyle.None }
1236
1052
  };
1237
- let i = [];
1238
- this.processXFs(e, e.evaluate("cellStyleXfs", t), i, r, null, !1);
1239
- let a = /* @__PURE__ */ new Map();
1240
- if (i.length > 0) {
1241
- let r = [];
1242
- this.processCellStyles(e, e.evaluate("cellStyles", t), r, i, a), n.named = r;
1053
+ let l = [];
1054
+ this.processXFs(e, e.evaluate("cellStyleXfs", r), l, a, null, !1);
1055
+ let u = /* @__PURE__ */ new Map();
1056
+ if (l.length > 0) {
1057
+ let t = [];
1058
+ this.processCellStyles(e, e.evaluate("cellStyles", r), t, l, u), i.named = t;
1059
+ }
1060
+ let d = [];
1061
+ this.processXFs(e, e.evaluate("cellXfs", r), d, a, u), Object.keys(d).length > 0 && (i.direct = d);
1062
+ let f = this.collectHiddenXfs(e.evaluate("cellXfs", r));
1063
+ f.size > 0 && e.getVisitorParamsState().set(pe, f);
1064
+ let p = [];
1065
+ return this.processDXFs(e, e.evaluate("dxfs", r), p), this.processTableStyles(e, e.evaluate("tableStyles", r), i, p), this.processSlicerStyles(e, e.evaluate("extLst", r), i), this.processIndexColors(e, e.evaluate("colors/indexedColors", r), i), this.processMruColors(e, e.evaluate("colors/mruColors", r), i), i;
1066
+ }
1067
+ normalFontId(e, t) {
1068
+ let n = e.evaluate("cellStyles", t)?.childNodes, r = 0;
1069
+ for (let e = 0; e < (n?.length ?? 0); e++) {
1070
+ let t = n.item(e);
1071
+ if (t.nodeType === 1 && t.getAttribute("builtinId") === "0") {
1072
+ r = parseInt(t.getAttribute("xfId") ?? "0", 10) || 0;
1073
+ break;
1074
+ }
1243
1075
  }
1244
- let o = [];
1245
- this.processXFs(e, e.evaluate("cellXfs", t), o, r, a), Object.keys(o).length > 0 && (n.direct = o);
1246
- let s = this.collectHiddenXfs(e.evaluate("cellXfs", t));
1247
- s.size > 0 && e.getVisitorParamsState().set(ne, s);
1248
- let c = [];
1249
- return this.processDXFs(e, e.evaluate("dxfs", t), c), this.processTableStyles(e, e.evaluate("tableStyles", t), n, c), this.processSlicerStyles(e, e.evaluate("extLst", t), n), this.processIndexColors(e, e.evaluate("colors/indexedColors", t), n), this.processMruColors(e, e.evaluate("colors/mruColors", t), n), n;
1076
+ let i = e.evaluate("cellStyleXfs", t)?.childNodes, a = 0;
1077
+ for (let e = 0; e < (i?.length ?? 0); e++) {
1078
+ let t = i.item(e);
1079
+ if (t.nodeType === 1 && a++ === r) return parseInt(t.getAttribute("fontId") ?? "0", 10) || 0;
1080
+ }
1081
+ return 0;
1250
1082
  }
1251
1083
  processIndexColors(e, t, n) {
1252
1084
  if (!t) return;
@@ -1304,9 +1136,9 @@ var $ = {
1304
1136
  let o = t.getAttribute("xfId");
1305
1137
  if (o && i) {
1306
1138
  let e = i.get(parseInt(o));
1307
- e && e !== D.BuiltInName.Normal && (n.named = e);
1139
+ e && e !== A.BuiltInName.Normal && (n.named = e);
1308
1140
  }
1309
- let s = (e) => !(!a && t.hasAttribute(e)) || b(t.getAttribute(e)), c = (e) => !a || t.hasAttribute(e) && b(t.getAttribute(e)), l = a ? "0" : void 0;
1141
+ let s = (e) => !(!a && t.hasAttribute(e)) || y(t.getAttribute(e)), c = (e) => !a || t.hasAttribute(e) && y(t.getAttribute(e)), l = a ? "0" : void 0;
1310
1142
  if (s("applyFont")) {
1311
1143
  let e = t.getAttribute("fontId") ?? l;
1312
1144
  if (e !== void 0 && (e !== "0" || c("applyFont"))) {
@@ -1346,18 +1178,18 @@ var $ = {
1346
1178
  let r = e.evaluate("protection", t);
1347
1179
  (r || c("applyProtection")) && this.processProtection(e, r, n);
1348
1180
  }
1349
- let u = b(t.getAttribute("quotePrefix") ?? "");
1181
+ let u = y(t.getAttribute("quotePrefix") ?? "");
1350
1182
  u && (n.quotePrefix = u);
1351
1183
  }
1352
1184
  processAlignment(e, t, n) {
1353
1185
  let r = {};
1354
- if (r.horizontal = t?.hasAttribute("horizontal") ? t.getAttribute("horizontal") : N.HorizontalAlignment.General, r.vertical = t?.hasAttribute("vertical") ? t.getAttribute("vertical") : N.VerticalAlignment.Bottom, r.indent = t?.hasAttribute("indent") ? parseInt(t.getAttribute("indent")) : 0, r.relativeIndent = t?.hasAttribute("relativeIndent") ? parseInt(t.getAttribute("relativeIndent")) : 0, r.overflow = b(t?.getAttribute("wrapText") ?? "") ? N.Overflow.Wrap : N.Overflow.Visible, b(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = N.Overflow.Shrink), t?.hasAttribute("textRotation")) {
1186
+ if (r.horizontal = t?.hasAttribute("horizontal") ? t.getAttribute("horizontal") : I.HorizontalAlignment.General, r.vertical = t?.hasAttribute("vertical") ? t.getAttribute("vertical") : I.VerticalAlignment.Bottom, r.indent = t?.hasAttribute("indent") ? parseInt(t.getAttribute("indent")) : 0, r.relativeIndent = t?.hasAttribute("relativeIndent") ? parseInt(t.getAttribute("relativeIndent")) : 0, r.overflow = y(t?.getAttribute("wrapText") ?? "") ? I.Overflow.Wrap : I.Overflow.Visible, y(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = I.Overflow.Shrink), t?.hasAttribute("textRotation")) {
1355
1187
  let e = parseFloat(t.getAttribute("textRotation"));
1356
1188
  e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
1357
1189
  } else r.rotation = 0;
1358
- t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = b(t.getAttribute("justifyLastLine")));
1190
+ t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = y(t.getAttribute("justifyLastLine")));
1359
1191
  let i = t?.getAttribute("readingOrder");
1360
- return i && (i === "0" ? r.readingDirection = N.ReadingDirection.Auto : i === "1" ? r.readingDirection = N.ReadingDirection.LeftToRight : i === "2" ? r.readingDirection = N.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(r).length > 0 && (n.alignment = r), n;
1192
+ return i && (i === "0" ? r.readingDirection = I.ReadingDirection.Auto : i === "1" ? r.readingDirection = I.ReadingDirection.LeftToRight : i === "2" ? r.readingDirection = I.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(r).length > 0 && (n.alignment = r), n;
1361
1193
  }
1362
1194
  collectHiddenXfs(e) {
1363
1195
  let t = /* @__PURE__ */ new Set();
@@ -1369,7 +1201,7 @@ var $ = {
1369
1201
  let a = i.childNodes;
1370
1202
  for (let e = 0; e < a.length; e++) {
1371
1203
  let n = a.item(e);
1372
- n.nodeType === 1 && n.localName === "protection" && b(n.getAttribute("hidden") ?? "") && t.add(r);
1204
+ n.nodeType === 1 && n.localName === "protection" && y(n.getAttribute("hidden") ?? "") && t.add(r);
1373
1205
  }
1374
1206
  r++;
1375
1207
  }
@@ -1378,7 +1210,7 @@ var $ = {
1378
1210
  processProtection(e, t, n) {
1379
1211
  if (!t) return;
1380
1212
  let r = t.getAttribute("locked");
1381
- return n.protection = { alwaysUnlocked: !!r && !b(r) }, n;
1213
+ return n.protection = { alwaysUnlocked: !!r && !y(r) }, n;
1382
1214
  }
1383
1215
  processDXF(e, t, n) {
1384
1216
  if (!t) return;
@@ -1461,7 +1293,7 @@ var $ = {
1461
1293
  let n = c.item(t);
1462
1294
  if (n.nodeType !== 1 || n.localName !== "slicerStyleElement") continue;
1463
1295
  let r = n.getAttribute("type");
1464
- if (!r || !U.has(r)) continue;
1296
+ if (!r || !Oe.has(r)) continue;
1465
1297
  let a = n.getAttribute("dxfId"), s = a == null ? void 0 : o[parseInt(a)];
1466
1298
  s ? i[r] = s : e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
1467
1299
  }
@@ -1471,7 +1303,7 @@ var $ = {
1471
1303
  }
1472
1304
  processTableStyle(e, t, n, r, i = !1) {
1473
1305
  let a = t.getAttribute("name"), o = { name: a };
1474
- t.hasAttribute("table") && (o.table = b(t.getAttribute("table"))), t.hasAttribute("pivot") && (o.pivot = b(t.getAttribute("pivot"))), i && !o.pivot && r.unshift(null);
1306
+ t.hasAttribute("table") && (o.table = y(t.getAttribute("table"))), t.hasAttribute("pivot") && (o.pivot = y(t.getAttribute("pivot"))), i && !o.pivot && r.unshift(null);
1475
1307
  let s = t.childNodes, c = s.length;
1476
1308
  for (let t = 0; t < c; t++) {
1477
1309
  let n = s.item(t);
@@ -1505,7 +1337,7 @@ var $ = {
1505
1337
  if (t.nodeType === 1 && t.localName === "cellStyle") {
1506
1338
  let e = parseInt(t.getAttribute("xfId") ?? ""), a = t.getAttribute("name"), o = t.getAttribute("builtinId"), s = a;
1507
1339
  if (o !== null) {
1508
- let e = D.builtInNameFromId(parseInt(o));
1340
+ let e = A.builtInNameFromId(parseInt(o));
1509
1341
  e !== void 0 && (s = e);
1510
1342
  }
1511
1343
  if (i.set(e, s), !r[e]) continue;
@@ -1513,32 +1345,32 @@ var $ = {
1513
1345
  name: s,
1514
1346
  style: r[e]
1515
1347
  };
1516
- t.getAttribute("hidden") && (c.hidden = b(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (c.iLevel = parseInt(t.getAttribute("iLevel"))), n.push(c);
1348
+ t.getAttribute("hidden") && (c.hidden = y(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (c.iLevel = parseInt(t.getAttribute("iLevel"))), o !== null && y(t.getAttribute("customBuiltin") ?? "0") && (c.customized = !0), n.push(c);
1517
1349
  }
1518
1350
  }
1519
1351
  }
1520
1352
  afterVisit(e, t, n) {}
1521
1353
  },
1522
- WorkbookVisitor: class extends V {
1354
+ WorkbookVisitor: class extends W {
1523
1355
  visit(e, t, n) {
1524
1356
  return this.processSheetRefs(e, e.evaluate("sheets", t), n), this.processExternalReferences(e, e.evaluate("externalReferences", t), n), this.processBookViews(e, e.evaluate("bookViews", t), n), this.processDefinedNames(e, e.evaluate("definedNames", t), n), this.processCalcPr(e, e.evaluate("calcPr", t), n), this.processPivotCaches(e, e.evaluate("pivotCaches", t), n), this.processWorkbookProtection(e, e.evaluate("workbookProtection", t), n), this.processWorkbookPr(e, e.evaluate("workbookPr", t), n), n;
1525
1357
  }
1526
1358
  processPassword(e, t, n, r = "workbook", i = "password") {
1527
1359
  if (!t) return;
1528
1360
  let a = {};
1529
- e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), Object.keys(a).length > 0 && (n[i] = a);
1361
+ e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), e.copyFromAttribute(t, `${r}Password`, a, "legacyHash"), Object.keys(a).length > 0 && (n[i] = a);
1530
1362
  }
1531
1363
  processWorkbookProtection(e, t, n) {
1532
1364
  if (!t) return;
1533
1365
  let r = {};
1534
1366
  this.processPassword(e, t, r, "workbook", "password"), this.processPassword(e, t, r, "revisions", "revisionsPassword");
1535
- for (let e of h) r[e.key] = ee(e, t.getAttribute(e.attribute));
1367
+ for (let e of de) r[e.key] = ue(e, t.getAttribute(e.attribute));
1536
1368
  return n.protection = r, n;
1537
1369
  }
1538
1370
  processCalcPr(e, t, n) {
1539
1371
  if (!t) return;
1540
1372
  let r = {};
1541
- e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) => W[e] ?? null), e.copyFromAttribute(t, "fullCalcOnLoad", r, "fullCalcOnLoad", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcOnSave", r, "calcOnSave", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcCompleted", r, "calcCompleted", e.BOOLEAN_COPY), e.copyFromAttribute(t, "fullPrecision", r, "fullPrecision", e.BOOLEAN_COPY), e.copyFromAttribute(t, "forceFullCalc", r, "forceFullCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentCalc", r, "concurrentCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "refMode", r, "refMode"), e.copyFromAttribute(t, "iterate", r, "iterate", e.BOOLEAN_COPY), e.copyFromAttribute(t, "iterateCount", r, "maxIteration", e.INT_COPY), e.copyFromAttribute(t, "iterateDelta", r, "maxIterateChange", e.FLOAT_COPY);
1373
+ e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) => ke[e] ?? null), e.copyFromAttribute(t, "fullCalcOnLoad", r, "fullCalcOnLoad", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcOnSave", r, "calcOnSave", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcCompleted", r, "calcCompleted", e.BOOLEAN_COPY), e.copyFromAttribute(t, "fullPrecision", r, "fullPrecision", e.BOOLEAN_COPY), e.copyFromAttribute(t, "forceFullCalc", r, "forceFullCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentCalc", r, "concurrentCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentManualCount", r, "concurrentManualCount", e.INT_COPY), e.copyFromAttribute(t, "refMode", r, "refMode"), e.copyFromAttribute(t, "iterate", r, "iterate", e.BOOLEAN_COPY), e.copyFromAttribute(t, "iterateCount", r, "maxIteration", e.INT_COPY), e.copyFromAttribute(t, "iterateDelta", r, "maxIterateChange", e.FLOAT_COPY);
1542
1374
  let i = t.getAttribute("calcId");
1543
1375
  i !== null && e.getVisitorParamsState().set("calcId", i), n.calc = r;
1544
1376
  }
@@ -1554,8 +1386,19 @@ var $ = {
1554
1386
  processSheetRef(e, t, n) {
1555
1387
  let r = {};
1556
1388
  e.copyFromAttribute(t, "name", r, "name"), e.copyFromAttribute(t, "state", r, "visibility"), e.copyFromAttribute(t, "sheetId", r, "sheetId", e.INT_COPY);
1557
- let i = t.getAttribute("r:id"), a = e.getRef(i);
1558
- a && (r.sheet = a), n.push(r);
1389
+ let i = t.getAttribute("r:id"), a = i ? te(e.getRelationships().get(i)?.type) : null;
1390
+ if (a) {
1391
+ let t = e.readEmbeddedPart(i);
1392
+ if (t?.xml) {
1393
+ let e = { part: t }, i = d(t.xml), o = i ? x((e) => i.get(e)) : void 0;
1394
+ o && (e.tabColor = o), r.kind = a, r.sheet = e, n.push(r);
1395
+ return;
1396
+ }
1397
+ e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`), n.push(r);
1398
+ return;
1399
+ }
1400
+ let o = i ? e.getRef(i) : null;
1401
+ o && (r.sheet = o), n.push(r);
1559
1402
  }
1560
1403
  processExternalReferences(e, t, n) {
1561
1404
  if (!t) return;
@@ -1595,8 +1438,24 @@ var $ = {
1595
1438
  }
1596
1439
  processWorkbookView(e, t, n) {
1597
1440
  if (!t) return;
1598
- let r = {};
1599
- e.copyFromAttribute(t, "activeTab", r, "activeSheetId", [e.INT_COPY, (e) => e]), t.hasAttribute("activeTab") || (r.activeSheetId = 0), e.copyFromAttribute(t, "showHorizontalScroll", r, "showHorizontalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showVerticalScroll", r, "showVerticalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showSheetTabs", r, "showTabs", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tabRatio", r, "tabRatio", [e.FLOAT_COPY, (e) => e]), Object.keys(r).length > 0 && (n.view = r);
1441
+ let r = {}, i = [
1442
+ "xWindow",
1443
+ "yWindow",
1444
+ "windowWidth",
1445
+ "windowHeight"
1446
+ ].map((e) => parseInt(t.getAttribute(e) ?? "", 10));
1447
+ if (i.some((e) => Number.isFinite(e))) {
1448
+ let [e, t, n, a] = i.map((e) => Number.isFinite(e) ? e : 0);
1449
+ r.windowBounds = {
1450
+ left: e,
1451
+ top: t,
1452
+ width: n,
1453
+ height: a
1454
+ };
1455
+ }
1456
+ e.copyFromAttribute(t, "activeTab", r, "activeSheetId", [e.INT_COPY, (e) => e]), t.hasAttribute("activeTab") || (r.activeSheetId = 0), e.copyFromAttribute(t, "showHorizontalScroll", r, "showHorizontalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showVerticalScroll", r, "showVerticalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showSheetTabs", r, "showTabs", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tabRatio", r, "tabRatio", [e.FLOAT_COPY, (e) => e]), e.copyFromAttribute(t, "firstSheet", r, "firstTab", [e.INT_COPY, (e) => e]), e.copyFromAttribute(t, "minimized", r, "minimized", e.BOOLEAN_COPY), e.copyFromAttribute(t, "autoFilterDateGrouping", r, "autoFilterDateGrouping", e.BOOLEAN_COPY);
1457
+ let a = t.getAttribute("visibility");
1458
+ a !== "hidden" && a !== "veryHidden" || (r.visibility = a), Object.keys(r).length > 0 && (n.view = r);
1600
1459
  }
1601
1460
  processDefineName(e, t, n, r) {
1602
1461
  if (!t) return;
@@ -1606,7 +1465,13 @@ var $ = {
1606
1465
  if (!r[n]?.name) return void e.warn(`Defined name '${t.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1607
1466
  i.scope = r[n].name;
1608
1467
  }
1609
- e.copyFromAttribute(t, "customMenu", i), e.copyFromAttribute(t, "description", i), e.copyFromAttribute(t, "statusBar", i), e.copyFromAttribute(t, "help", i), e.copyFromAttribute(t, "shortcutKey", i), e.copyFromAttribute(t, "function", i, "function", e.BOOLEAN_COPY), e.copyFromAttribute(t, "functionGroupId", i, "functionGroupId", e.INT_COPY), e.copyFromAttribute(t, "publishToServer", i, "publishToServer", e.BOOLEAN_COPY), e.copyFromAttribute(t, "vbProcedure", i, "vbProcedure", e.BOOLEAN_COPY), e.copyFromAttribute(t, "xlm", i, "xlm", e.BOOLEAN_COPY), Object.keys(i).length > 0 && n.push(i);
1468
+ let o = {};
1469
+ for (let n of ge) e.copyFromAttribute(t, n, o);
1470
+ for (let e of he) {
1471
+ let n = t.getAttribute(e);
1472
+ n !== "1" && n !== "true" || (o[e] = !0);
1473
+ }
1474
+ e.copyFromAttribute(t, "functionGroupId", o, "functionGroupId", e.INT_COPY), Object.keys(o).length > 0 && (i.fileAttributes = o), Object.keys(i).length > 0 && n.push(i);
1610
1475
  }
1611
1476
  processDefinedNames(e, t, n) {
1612
1477
  if (!t) return;
@@ -1625,7 +1490,7 @@ var $ = {
1625
1490
  TableVisitor: class {
1626
1491
  visit(e, t, n) {
1627
1492
  let r = {};
1628
- return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), r.totalsRowShown = t.getAttribute("totalsRowShown") !== "0", r;
1493
+ return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r, "name"), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), r.totalsRowShown = t.getAttribute("totalsRowShown") !== "0", r;
1629
1494
  }
1630
1495
  afterVisit(e, t, n) {
1631
1496
  let r = n.v;
@@ -1745,7 +1610,7 @@ var $ = {
1745
1610
  i.length > 0 && (n.sheetDataSet = i);
1746
1611
  }
1747
1612
  processSheetData(e, t) {
1748
- let n = new ae.Builder(), r = t.childNodes, i = r.length;
1613
+ let n = new be.Builder(), r = t.childNodes, i = r.length;
1749
1614
  for (let e = 0; e < i; e++) {
1750
1615
  let t = r.item(e);
1751
1616
  if (t.nodeType !== 1 || t.localName !== "row") continue;
@@ -1755,7 +1620,7 @@ var $ = {
1755
1620
  if (t.nodeType !== 1 || t.localName !== "cell") continue;
1756
1621
  let r = t.getAttribute("r");
1757
1622
  if (!r) continue;
1758
- let a = w.fastStringToCell(r);
1623
+ let a = D.fastStringToCell(r);
1759
1624
  if (a?.rowIndex === void 0 || a?.colIndex === void 0) continue;
1760
1625
  let o = this._readCellValue(t);
1761
1626
  o !== void 0 && n.pushAt(a.rowIndex, a.colIndex, o);
@@ -1775,7 +1640,7 @@ var $ = {
1775
1640
  case "str":
1776
1641
  default: return t;
1777
1642
  case "e": {
1778
- let e = T.getBuiltInByLabel(t);
1643
+ let e = O.getBuiltInByLabel(t);
1779
1644
  return e ? {
1780
1645
  t: "e",
1781
1646
  v: e.getCode()
@@ -1819,8 +1684,8 @@ var $ = {
1819
1684
  let r = {};
1820
1685
  n[t.getAttribute("name")] = r, e.copyFromAttribute(t, "xr10:uid", r, "uid");
1821
1686
  let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches"), o = i ? a?.get(i) : void 0;
1822
- if (o) for (let e = 0; e < G.length; e++) {
1823
- let t = G[e];
1687
+ if (o) for (let e = 0; e < K.length; e++) {
1688
+ let t = K[e];
1824
1689
  o[t] !== void 0 && (r[t] = o[t]);
1825
1690
  }
1826
1691
  e.copyFromAttribute(t, "caption", r), e.copyFromAttribute(t, "startItem", r, "startItem", e.INT_COPY), e.copyFromAttribute(t, "columnCount", r, "columnCount", e.INT_COPY), e.copyFromAttribute(t, "showCaption", r, "showCaption", e.BOOLEAN_COPY), e.copyFromAttribute(t, "level", r, "level", e.INT_COPY), e.copyFromAttribute(t, "style", r), e.copyFromAttribute(t, "lockedPosition", r, "lockedPosition", e.BOOLEAN_COPY), e.copyFromAttribute(t, "rowHeight", r, "rowHeight", e.INT_COPY);
@@ -1846,7 +1711,7 @@ var $ = {
1846
1711
  } else n.localName === "extLst" && (o = e.serializeElement(n) ?? void 0);
1847
1712
  }
1848
1713
  }
1849
- let c = g(r, a, o);
1714
+ let c = re(r, a, o);
1850
1715
  return n.formControl = c, c;
1851
1716
  }
1852
1717
  },
@@ -1855,14 +1720,19 @@ var $ = {
1855
1720
  return n;
1856
1721
  }
1857
1722
  afterVisit(e, t, n) {
1858
- for (let e of n?.movables ?? []) K(e, !1);
1723
+ for (let e of n?.movables ?? []) q(e, !1);
1859
1724
  }
1860
1725
  },
1861
1726
  DrawingAnchorVisitor: class {
1862
1727
  visit(e, t, n) {
1863
1728
  if (!t) return;
1864
1729
  let r = {};
1865
- return e.copyFromAttribute(t, "editAs", r, "anchorType"), r.anchor = {}, t.localName === "absoluteAnchor" ? (r.anchorType = "absolute", this.processAbsoluteCoord(e, e.evaluate("xdr:pos", t), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : t.localName === "oneCellAnchor" ? (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processOffsetCoord(e, e.evaluate("to", t), r.anchor, "to")), n.movables ||= [], n.movables.push(r), r;
1730
+ e.copyFromAttribute(t, "editAs", r, "anchorType"), r.anchor = {}, t.localName === "absoluteAnchor" ? (r.anchorType = "absolute", this.processAbsoluteCoord(e, e.evaluate("pos", t), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(e, e.evaluate("ext", t), r.anchor, "to", "cx", "cy")) : t.localName === "oneCellAnchor" ? (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processAbsoluteCoord(e, e.evaluate("ext", t), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processOffsetCoord(e, e.evaluate("to", t), r.anchor, "to"));
1731
+ let i = e.evaluate("clientData", t), a = (e) => {
1732
+ let t = i?.getAttribute(e);
1733
+ return t === "0" || t === "false";
1734
+ };
1735
+ return a("fPrintsWithSheet") && (r.noPrint = !0), a("fLocksWithSheet") && (r.unlocked = !0), n.movables ||= [], n.movables.push(r), r;
1866
1736
  }
1867
1737
  processAbsoluteCoord(e, t, n, r, i, a) {
1868
1738
  if (!t) return;
@@ -1870,7 +1740,7 @@ var $ = {
1870
1740
  x: 0,
1871
1741
  y: 0
1872
1742
  };
1873
- return o.x = d(t.getAttribute(i)), o.y = d(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
1743
+ return o.x = b(t.getAttribute(i)), o.y = b(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
1874
1744
  }
1875
1745
  processOffsetCoord(e, t, n, r) {
1876
1746
  if (!t) return;
@@ -1880,34 +1750,37 @@ var $ = {
1880
1750
  x: 0,
1881
1751
  y: 0
1882
1752
  };
1883
- return e.evaluate("col", t) && (i.c = parseInt(e.evaluate("col", t).textContent)), e.evaluate("row", t) && (i.r = parseInt(e.evaluate("row", t).textContent)), e.evaluate("colOff", t) && (i.x = d(e.evaluate("colOff", t).textContent)), e.evaluate("rowOff", t) && (i.y = d(e.evaluate("rowOff", t).textContent)), r === "from" ? n.tl = i : n.br = i, n;
1753
+ return e.evaluate("col", t) && (i.c = parseInt(e.evaluate("col", t).textContent)), e.evaluate("row", t) && (i.r = parseInt(e.evaluate("row", t).textContent)), e.evaluate("colOff", t) && (i.x = b(e.evaluate("colOff", t).textContent)), e.evaluate("rowOff", t) && (i.y = b(e.evaluate("rowOff", t).textContent)), r === "from" ? n.tl = i : n.br = i, n;
1884
1754
  }
1885
1755
  },
1886
- DrawingGraphicFrameVisitor: class extends q {
1756
+ DrawingGraphicFrameVisitor: class extends V {
1887
1757
  visit(e, t, n) {
1888
1758
  if (!t) return;
1889
1759
  if (this.isGroupContent(n)) {
1890
1760
  if (e.getPath().includes("Fallback")) return {};
1891
1761
  let { movable: r } = this.readMemberHeader(e, t, "graphicFrame"), i = e.evaluate("xfrm", t);
1892
1762
  if (i) {
1893
- _(i, r);
1763
+ g(i, r);
1894
1764
  let t = e.evaluate("off", i), n = e.evaluate("ext", i);
1895
1765
  r.anchor = {
1896
1766
  tl: {
1897
- x: d(t?.getAttribute("x") ?? null) ?? 0,
1898
- y: d(t?.getAttribute("y") ?? null) ?? 0
1767
+ x: b(t?.getAttribute("x") ?? null) ?? 0,
1768
+ y: b(t?.getAttribute("y") ?? null) ?? 0
1899
1769
  },
1900
1770
  br: {
1901
- x: d(n?.getAttribute("cx") ?? null) ?? 0,
1902
- y: d(n?.getAttribute("cy") ?? null) ?? 0
1771
+ x: b(n?.getAttribute("cx") ?? null) ?? 0,
1772
+ y: b(n?.getAttribute("cy") ?? null) ?? 0
1903
1773
  }
1904
1774
  };
1905
1775
  }
1906
- let a = this.readGraphic(e, t);
1776
+ let a = this.readGraphic(e, t), o = a.type === "chart" ? {
1777
+ ...r.content.json,
1778
+ ...a.json
1779
+ } : a.json;
1907
1780
  return r.content = {
1908
1781
  ...r.content,
1909
1782
  type: a.type,
1910
- json: a.json
1783
+ json: o
1911
1784
  }, n.members.push(r), a.json;
1912
1785
  }
1913
1786
  n = super.visit(e, t, n);
@@ -1933,11 +1806,17 @@ var $ = {
1933
1806
  n === "chart" ? n = "chart" : n === "slicer" && (n = "slicer"), r.type = n;
1934
1807
  let i = a.getAttribute("r:id");
1935
1808
  if (n === "chart" && i) {
1936
- let n = this.readSourceId(e, t);
1809
+ let n = this.readSourceId(e, t), a = e.readEmbeddedPart(i) ?? void 0, o;
1810
+ try {
1811
+ let t = a?.xml ? _e(a.xml) : null;
1812
+ o = t?.model, t?.lossy && e.warn("A chart states something its model does not; it is saved as it was until it is changed.", { onceKey: "xlsx.chart.lossy" });
1813
+ } catch (t) {
1814
+ e.warn(`A chart could not be read into the chart model; it is kept as its markup: ${t?.message ?? t}`, { onceKey: "xlsx.chart.model" });
1815
+ }
1937
1816
  r.json = {
1938
- xml: e.serializeElement(t) ?? void 0,
1939
1817
  sourceId: n,
1940
- part: e.readEmbeddedPart(i) ?? void 0
1818
+ part: a,
1819
+ model: o
1941
1820
  };
1942
1821
  } else if (n === "slicer") {
1943
1822
  let n = this.readSourceId(e, t);
@@ -1951,45 +1830,47 @@ var $ = {
1951
1830
  }
1952
1831
  },
1953
1832
  DrawingSpVisitor: J,
1954
- DrawingPicVisitor: class extends q {
1833
+ DrawingPicVisitor: class extends V {
1955
1834
  visit(e, t, n) {
1956
1835
  if (!t) return;
1957
1836
  if (this.isGroupContent(n)) {
1958
1837
  if (e.getPath().includes("Fallback")) return {};
1959
- let { movable: r, content: i } = this.readMemberHeader(e, t, "picture"), a = this.readImageResource(e, t);
1960
- if (a == null) return {};
1961
- i.resId = a;
1962
- let o = this.readLocks(e.evaluate("nvPicPr/cNvPicPr/picLocks", t));
1963
- return o && (o.noChangeAspect !== void 0 && (r.lockAspect = o.noChangeAspect), r.locks = o), n.members.push(r), i;
1964
- }
1965
- let r = super.visit(e, t, n), i = e.evaluate("nvPicPr/cNvPicPr", t);
1966
- if (i) {
1967
- e.copyFromAttribute(t, "preferRelativeResize", r, "preferRelativeResize", e.BOOLEAN_COPY);
1968
- let n = e.evaluate("picLocks", i);
1969
- if (n) {
1970
- n.hasAttribute("noChangeAspect") && (r.lockAspect = n.getAttribute("noChangeAspect") === "1");
1971
- let t = {};
1972
- e.copyFromAttribute(n, "noChangeArrowheads", r, "noChangeArrowheads", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noChangeShapeType", r, "noChangeShapeType", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noEditPoints", r, "noEditPoints", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noAdjustHandles", r, "noAdjustHandles", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noCrop", r, "noCrop", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noGrp", r, "noGrp", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noMove", r, "noMove", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noResize", r, "noResize", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noRot", r, "noRot", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noSelect", r, "noSelect", e.BOOLEAN_COPY), Object.keys(t).length > 0 && (r.locks = t);
1973
- }
1838
+ let { movable: r, content: i } = this.readMemberHeader(e, t, "picture"), a = this.readImage(e, t);
1839
+ return a ? (this.readPictureDetails(e, t, a, r, i), n.members.push(r), i) : {};
1974
1840
  }
1975
- let a = this.readImageResource(e, t);
1976
- if (a === null) return;
1977
- let o = { resId: a }, s = this.readSourceId(e, t);
1978
- return s !== void 0 && (o.sourceId = s), this.setContent(n, {
1841
+ let r = super.visit(e, t, n), i = this.readImage(e, t);
1842
+ if (i === null) return;
1843
+ let a = {}, o = this.readSourceId(e, t);
1844
+ return o !== void 0 && (a.sourceId = o), this.readPictureDetails(e, t, i, r, a), this.setContent(r, {
1979
1845
  type: "picture",
1980
- json: o
1981
- }), r;
1982
- }
1983
- readImageResource(e, t) {
1984
- let n = e.evaluate("blipFill/blip", t);
1985
- if (!n) return;
1986
- let r = n.getAttribute("r:embed") ?? n.getAttribute("embed");
1987
- return r ||= n.getAttribute("r:link") ?? n.getAttribute("link"), r ? e.getRef(r, !0) : (e.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null);
1846
+ json: a
1847
+ }), a;
1848
+ }
1849
+ readPictureDetails(e, t, n, r, i) {
1850
+ n?.resId !== void 0 && (i.resId = n.resId), n?.image && (i.image = n.image);
1851
+ let a = t.getAttribute("macro");
1852
+ a && (i.macro = a), t.hasAttribute("fPublished") && (i.published = y(t.getAttribute("fPublished")));
1853
+ let o = e.evaluate("nvPicPr/cNvPicPr", t);
1854
+ if (o?.getAttribute) {
1855
+ o.getAttribute("preferRelativeResize") === "0" && (i.noRelativeResize = !0);
1856
+ let t = this.readLocks(e.evaluate("picLocks", o));
1857
+ t && (i.locks = t), r.lockAspect = t?.noChangeAspect ?? !1;
1858
+ }
1859
+ }
1860
+ readImage(e, t) {
1861
+ let n = e.evaluate("blipFill", t), r = n ? e.evaluate("blip", n) : null;
1862
+ if (!r) return;
1863
+ if (!(r.getAttribute("r:embed") ?? r.getAttribute("embed") ?? r.getAttribute("r:link") ?? r.getAttribute("link"))) return e.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null;
1864
+ let { type: i, resId: a, ...o } = new f().processImageFill(e, n);
1865
+ return !o.tile && o.stretch && Object.keys(o.stretch).length === 0 && delete o.stretch, o.extLst && Ae.test(o.extLst) && delete o.extLst, {
1866
+ resId: a,
1867
+ image: Object.keys(o).length > 0 ? o : void 0
1868
+ };
1988
1869
  }
1989
1870
  },
1990
- DrawingGrpSpVisitor: class extends q {
1871
+ DrawingGrpSpVisitor: class extends V {
1991
1872
  constructor(...e) {
1992
- super(...e), this._fills = new v();
1873
+ super(...e), this._fills = new f();
1993
1874
  }
1994
1875
  visit(e, t, n) {
1995
1876
  if (!t) return;
@@ -2016,7 +1897,7 @@ var $ = {
2016
1897
  if (c) {
2017
1898
  let t = e.evaluate("xfrm", c);
2018
1899
  if (t) {
2019
- _(t, i), t.getAttribute("flipH") === "1" && (i.flipH = !0), t.getAttribute("flipV") === "1" && (i.flipV = !0);
1900
+ g(t, i), t.getAttribute("flipH") === "1" && (i.flipH = !0), t.getAttribute("flipV") === "1" && (i.flipV = !0);
2020
1901
  let n = Y(e, t, "off", "ext"), o = Y(e, t, "chOff", "chExt") ?? n;
2021
1902
  o && (a.childBounds = o), r && n && (i.anchor = {
2022
1903
  tl: {
@@ -2207,7 +2088,7 @@ var $ = {
2207
2088
  if (t.type === "_error") {
2208
2089
  let e = t.errorType;
2209
2090
  if (e) try {
2210
- t = T.getBuiltInByCode(e + 1) ?? T.BuiltIn.Unknown;
2091
+ t = O.getBuiltInByCode(e + 1) ?? O.BuiltIn.Unknown;
2211
2092
  } catch {}
2212
2093
  }
2213
2094
  return t;
@@ -2271,7 +2152,7 @@ var $ = {
2271
2152
  if (n.nodeType === 1) {
2272
2153
  if (n.localName === "t") e.text += n.textContent ?? "";
2273
2154
  else if (n.localName === "rPr") {
2274
- let t = de(n);
2155
+ let t = Me(n);
2275
2156
  t && (e.font = t);
2276
2157
  }
2277
2158
  }
@@ -2298,16 +2179,16 @@ var $ = {
2298
2179
  visit(e, t, n) {
2299
2180
  if (!t) return;
2300
2181
  let r = {};
2301
- e.copyFromAttribute(t, "id", r, "id", x);
2182
+ e.copyFromAttribute(t, "id", r, "id", S);
2302
2183
  let i = t.getAttribute("ref");
2303
- e.copyFromAttribute(t, "personId", r, "personId", x), e.copyFromAttribute(t, "parentId", r, "parentId", x);
2184
+ e.copyFromAttribute(t, "personId", r, "personId", S), e.copyFromAttribute(t, "parentId", r, "parentId", S);
2304
2185
  let a = t.getAttribute("dT");
2305
2186
  a && (r.dt = function(e) {
2306
2187
  let t = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());
2307
2188
  if (!t) return e;
2308
2189
  let [, n, r, i] = t;
2309
2190
  return `${n}${r ? `.${(r + "00").substring(0, 3)}` : ""}${i ?? "Z"}`;
2310
- }(a)), t.hasAttribute("done") && (r.done = b(t.getAttribute("done")));
2191
+ }(a)), t.hasAttribute("done") && (r.done = y(t.getAttribute("done")));
2311
2192
  let o = function(e) {
2312
2193
  let t, n = e.childNodes;
2313
2194
  for (let e = 0; e < n.length; e++) {
@@ -2320,8 +2201,8 @@ var $ = {
2320
2201
  let r = n.getAttribute("mentionId"), a = n.getAttribute("mentionpersonId");
2321
2202
  if (!r || !a) continue;
2322
2203
  let o = {
2323
- id: x(r),
2324
- personId: x(a)
2204
+ id: S(r),
2205
+ personId: S(a)
2325
2206
  }, s = parseInt(n.getAttribute("startIndex") ?? "", 10);
2326
2207
  isNaN(s) || (o.startIndex = s);
2327
2208
  let c = parseInt(n.getAttribute("length") ?? "", 10);
@@ -2343,33 +2224,33 @@ var $ = {
2343
2224
  let n = i.item(t);
2344
2225
  if (n.nodeType === 1 && n.localName === "person") {
2345
2226
  let t = {};
2346
- e.copyFromAttribute(n, "id", t, "id", x), e.copyFromAttribute(n, "displayName", t), e.copyFromAttribute(n, "userId", t, "userId", x), e.copyFromAttribute(n, "providerId", t), r.push(t);
2227
+ e.copyFromAttribute(n, "id", t, "id", S), e.copyFromAttribute(n, "displayName", t), e.copyFromAttribute(n, "userId", t, "userId", S), e.copyFromAttribute(n, "providerId", t), r.push(t);
2347
2228
  }
2348
2229
  }
2349
2230
  return r.length > 0 && (n.persons = r), r;
2350
2231
  }
2351
2232
  }
2352
- }, fe = class {
2233
+ }, Ne = class {
2353
2234
  constructor(e, t) {
2354
2235
  this.path = e, this.visitor = t;
2355
2236
  }
2356
- }, pe = class {
2237
+ }, Pe = class {
2357
2238
  constructor() {
2358
- this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new $.RelsVisitor()), this.registerVisitor("cp:coreProperties", new $.CorePropertiesVisitor()), this.registerVisitor("Properties", new $.AppPropertiesVisitor()), this.registerVisitor("spPr", new $.ShapePropertiesVisitor()), this.registerVisitor("txBody", new $.ShapeTextVisitor()), this.registerVisitor("txPr", new $.TextPropertiesVisitor()), this.registerVisitor("c:chartSpace", new $.ChartSpaceVisitor()), this.registerVisitor("c:plotArea", new $.PlotAreaVisitor()), this.registerVisitor("c:barChart", new $.BarChartTypeVisitor()), this.registerVisitor("c:doughnutChart", new $.ChartTypeVisitor()), this.registerVisitor("c:lineChart", new $.ChartTypeVisitor()), this.registerVisitor("c:ofPieType", new $.ChartTypeVisitor()), this.registerVisitor("c:pieChart", new $.ChartTypeVisitor()), this.registerVisitor("c:scatterChart", new $.ChartTypeVisitor()), this.registerVisitor("c:barChart", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new $.DataLabelsVisitor("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new $.SeriesVisitor()), this.registerVisitor("c:dPt", new $.DataPointVisitor()), this.registerVisitor("c:marker", new $.MarkerVisitor()), this.registerVisitor("c:catAx", new $.AxisVisitor()), this.registerVisitor("c:valAx", new $.AxisVisitor()), this.registerVisitor("c:dateAx", new $.AxisVisitor()), this.registerVisitor("c:majorGridlines", new R("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new R("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new $.TextPropertiesVisitor("labels.text"), "txPr"), this.registerVisitor("c:valAx", new $.TextPropertiesVisitor("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new $.TextPropertiesVisitor("labels.text"), "txPr"), this.registerVisitor("c:legend", new $.LegendVisitor()), this.registerVisitor("c:legend", new $.TextPropertiesVisitor("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new $.LegendEntryVisitor()), this.registerVisitor("c:ser", new $.NegativeShapeVisitor(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new $.DataLabelsVisitor("labels"), "dLbls"), this.registerVisitor("c:dLbl", new $.DataLabelsVisitor("points")), this.registerVisitor("c:title", new $.TitleVisitor()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new $.LayoutVisitor()), this.registerVisitor("c:dispUnits", new R("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new $.TitleVisitor("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new $.TextPropertiesVisitor(), "tx/rich"), this.registerVisitor("a:theme", new $.ThemeVisitor()), this.registerVisitor("a:theme", new $.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new $.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new $.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("autoFilter", new $.AutoFilterVisitor()), this.registerVisitor("sortState", new $.SortStateVisitor()), this.registerVisitor("s:workbook", new $.WorkbookVisitor()), this.registerVisitor("styleSheet", new $.SheetStyleVisitor()), this.registerVisitor("x14:table", new $.TableX14Visitor()), this.registerVisitor("table", new $.TableVisitor()), this.registerVisitor("externalLink", new $.ExternalLinkVisitor()), this.registerVisitor("wsDr", new $.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new $.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new $.DrawingSpVisitor()), this.registerVisitor("grpSp", new $.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new $.DrawingCxnSpVisitor()), this.registerVisitor("pic", new $.DrawingPicVisitor()), this.registerVisitor("metadata", new $.MetadataVisitor()), this.registerVisitor("rvStructures", new $.RichValueStructureVisitor()), this.registerVisitor("rvData", new $.RichValueDataVisitor()), this.registerVisitor("comments", new $.CommentsVisitor()), this.registerVisitor("comment", new $.CommentVisitor()), this.registerVisitor("ThreadedComments", new $.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new $.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new $.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new $.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new $.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new $.SlicersVisitor()), this.registerVisitor("formControlPr", new $.FormControlPrVisitor());
2239
+ this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new $.RelsVisitor()), this.registerVisitor("cp:coreProperties", new $.CorePropertiesVisitor()), this.registerVisitor("Properties", new $.AppPropertiesVisitor()), this.registerVisitor("spPr", new $.ShapePropertiesVisitor()), this.registerVisitor("txBody", new $.ShapeTextVisitor()), this.registerVisitor("txPr", new $.TextPropertiesVisitor()), this.registerVisitor("a:theme", new $.ThemeVisitor()), this.registerVisitor("a:theme", new $.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new $.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new $.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("a:theme", new $.ObjectDefaultsVisitor(), "objectDefaults"), this.registerVisitor("autoFilter", new $.AutoFilterVisitor()), this.registerVisitor("sortState", new $.SortStateVisitor()), this.registerVisitor("s:workbook", new $.WorkbookVisitor()), this.registerVisitor("styleSheet", new $.SheetStyleVisitor()), this.registerVisitor("x14:table", new $.TableX14Visitor()), this.registerVisitor("table", new $.TableVisitor()), this.registerVisitor("externalLink", new $.ExternalLinkVisitor()), this.registerVisitor("wsDr", new $.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new $.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new $.DrawingSpVisitor()), this.registerVisitor("grpSp", new $.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new $.DrawingCxnSpVisitor()), this.registerVisitor("pic", new $.DrawingPicVisitor()), this.registerVisitor("metadata", new $.MetadataVisitor()), this.registerVisitor("rvStructures", new $.RichValueStructureVisitor()), this.registerVisitor("rvData", new $.RichValueDataVisitor()), this.registerVisitor("comments", new $.CommentsVisitor()), this.registerVisitor("comment", new $.CommentVisitor()), this.registerVisitor("ThreadedComments", new $.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new $.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new $.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new $.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new $.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new $.SlicersVisitor()), this.registerVisitor("formControlPr", new $.FormControlPrVisitor());
2359
2240
  }
2360
2241
  registerVisitor(e, t, n = null) {
2361
2242
  e.indexOf(":") === -1 && (e = "*:" + e);
2362
2243
  let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
2363
2244
  if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
2364
2245
  let a = this.scopedVisitorsByXmlTagName.get(i);
2365
- a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new fe(n, t));
2246
+ a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new Ne(n, t));
2366
2247
  }
2367
- parseDxf(e, t = "", n = C.EmptyObject) {
2248
+ parseDxf(e, t = "", n = E.EmptyObject) {
2368
2249
  this.visitorParamsState ||= /* @__PURE__ */ new Map();
2369
2250
  let r = this.visitorParamsState, i = r.get("processingDXFs");
2370
2251
  r.set("processingDXFs", !0);
2371
2252
  try {
2372
- let r = new L(null, this, "/dxf", e, {}, t, n), i = {};
2253
+ let r = new R(null, this, "/dxf", e, {}, t, n), i = {};
2373
2254
  return new $.SheetStyleVisitor().processDXF(r, e, i), i;
2374
2255
  } finally {
2375
2256
  i === void 0 ? r.delete("processingDXFs") : r.set("processingDXFs", i);
@@ -2378,12 +2259,12 @@ var $ = {
2378
2259
  getVisitorParamsState() {
2379
2260
  return this.visitorParamsState;
2380
2261
  }
2381
- transform(e, t, n = C.EmptyObject) {
2262
+ transform(e, t, n = E.EmptyObject) {
2382
2263
  let r = e.documentElement;
2383
2264
  this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
2384
2265
  let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
2385
2266
  if (a ||= this.visitorsByXmlTagName.get(r.localName), !a) throw Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
2386
- let o = "/" + r.localName, s = new L(null, this, o, r, i, t, n), c = [];
2267
+ let o = "/" + r.localName, s = new R(null, this, o, r, i, t, n), c = [];
2387
2268
  this._doWalk(a, s, c, r, i, t, n);
2388
2269
  let l = c.length;
2389
2270
  for (let e = 0; e < l; e++) {
@@ -2411,7 +2292,7 @@ var $ = {
2411
2292
  for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
2412
2293
  let u = t.getPath() + "/" + s;
2413
2294
  if (c.visitor) {
2414
- let r = new L(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
2295
+ let r = new R(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
2415
2296
  this._doWalk(c.visitor, r, n, e, i, a, o);
2416
2297
  }
2417
2298
  };
@@ -2437,10 +2318,10 @@ var $ = {
2437
2318
  if (r.nodeType !== 1) continue;
2438
2319
  let c = r, p = c.nodeName, m = l.get(p);
2439
2320
  m ||= (p = c.localName, l.get(p));
2440
- let h = t.getPath() + "/" + p, g = new L(t, this, h, u, d, a, o);
2321
+ let h = t.getPath() + "/" + p, g = new R(t, this, h, u, d, a, o);
2441
2322
  this._doWalk(m, g, n, c, s ?? i, a, o);
2442
2323
  }
2443
2324
  return s;
2444
2325
  }
2445
2326
  };
2446
- export { pe as DOMTransformer, L as ExecutionContext, m as NumberUtils, e as VisitorUtils };
2327
+ export { Pe as DOMTransformer, R as ExecutionContext, s as NumberUtils, p as VisitorUtils };