@sheetxl/io-xlsx 0.7.28-beta.4 → 0.8.0-beta.10

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 (127) hide show
  1. package/browser/esm/{BXCOn1XvLvYSfpzi.mjs → 2EOdn2WRK5y1L58S.mjs} +193 -143
  2. package/browser/esm/{BknJ4AeVeFJploh9.mjs → B-jb5SuiVh5NnBG_.mjs} +28 -13
  3. package/browser/esm/BKT8OBj-bhQwdg49.mjs +67 -0
  4. package/browser/esm/BLXcoiDAaOMjFuhw.mjs +8056 -0
  5. package/browser/esm/BPmehfSqdvgsLBsB.mjs +5153 -0
  6. package/browser/esm/CI_CZI5m5-KkiAK5.mjs +3559 -0
  7. package/browser/esm/{C3sYFBc7Tym8l12A.mjs → DXopGe8PrLWmwGaV.mjs} +1 -1
  8. package/browser/esm/NQIuOQIleHC4NUW6.mjs +2446 -0
  9. package/browser/esm/index.mjs +2 -3
  10. package/browser/esm/{BhohPLTubb_9rfrh.mjs → xc_LzCPgHn-acgFZ.mjs} +2 -2
  11. package/licenses/dependencies.txt +2 -2
  12. package/node/esm/{B6lQXVQjFT_OE3IA.mjs → BmdmvgO5Zdgx-RWo.mjs} +2 -2
  13. package/node/esm/BpxxiZ2oKPkUSfdB.mjs +2486 -0
  14. package/node/esm/{B9CUp-rqol5K1r1c.mjs → CHqRP_NjPpPd7m9L.mjs} +1 -1
  15. package/node/esm/CtAF486aZqYzMeLM.mjs +3651 -0
  16. package/node/esm/{CfIzBnObj09fDuUX.mjs → O5mti2R9drFOlXc7.mjs} +49 -35
  17. package/node/esm/QS_theNoeqNGLStj.mjs +5298 -0
  18. package/node/esm/index.mjs +40 -25
  19. package/node/esm/nNQ7MG89sGKwkjMA.mjs +4649 -0
  20. package/package.json +7 -8
  21. package/types/src/AutoFilterRules.d.ts +86 -10
  22. package/types/src/ConditionalFormatRules.d.ts +5 -5
  23. package/types/src/DataValidationRules.d.ts +18 -2
  24. package/types/src/ExcelCalcStamp.d.ts +39 -0
  25. package/types/src/ExcelCompat.d.ts +197 -42
  26. package/types/src/ExcelReservedNames.d.ts +3 -4
  27. package/types/src/LegacyFormula.d.ts +28 -7
  28. package/types/src/OOXMLExtensions.d.ts +14 -2
  29. package/types/src/Plugin.d.ts +16 -5
  30. package/types/src/ProtectionAttributes.d.ts +38 -0
  31. package/types/src/SourcePackage.d.ts +31 -12
  32. package/types/src/Types.d.ts +17 -0
  33. package/types/src/reader/HiddenFormulas.d.ts +16 -0
  34. package/types/src/reader/SlicerJoin.d.ts +24 -0
  35. package/types/src/reader/Warning.d.ts +29 -0
  36. package/types/src/reader/ZipReader.d.ts +1 -1
  37. package/types/src/reader/_SlicerRecord.d.ts +37 -0
  38. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  39. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  40. package/types/src/reader/dom/ExecutionContext.d.ts +16 -3
  41. package/types/src/reader/dom/Types.d.ts +19 -3
  42. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
  43. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  44. package/types/src/reader/domVisitors/CommentVisitor.d.ts +24 -2
  45. package/types/src/reader/domVisitors/CommentsVisitor.d.ts +2 -2
  46. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  47. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +32 -1
  48. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  49. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  50. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +13 -0
  51. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  52. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  53. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +21 -3
  54. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +4 -4
  55. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  56. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  57. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  58. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +19 -6
  59. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +7 -2
  60. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -3
  61. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  62. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +18 -1
  63. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  64. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +11 -1
  65. package/types/src/reader/domVisitors/index.d.ts +4 -2
  66. package/types/src/reader/sax/LeanSaxParser.d.ts +58 -0
  67. package/types/src/reader/sax/SaxParser.d.ts +11 -1
  68. package/types/src/reader/sax/SaxVisitor.d.ts +3 -2
  69. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +9 -0
  70. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +11 -4
  71. package/types/src/utils/DrawingMLText.d.ts +39 -0
  72. package/types/src/utils/FormControls.d.ts +170 -0
  73. package/types/src/utils/VmlNoteShapes.d.ts +135 -0
  74. package/types/src/vba/VBAProject.d.ts +52 -4
  75. package/types/src/writer/builder/ContentTypes.d.ts +13 -0
  76. package/types/src/writer/builder/Emitter.d.ts +11 -6
  77. package/types/src/writer/builder/EmitterRegistry.d.ts +7 -0
  78. package/types/src/writer/builder/OpcXmlUtils.d.ts +2 -0
  79. package/types/src/writer/builder/PackageBuilder.d.ts +72 -22
  80. package/types/src/writer/builder/PartWriter.d.ts +5 -0
  81. package/types/src/writer/builder/RelationshipSet.d.ts +3 -0
  82. package/types/src/writer/builder/Types.d.ts +117 -38
  83. package/types/src/writer/builder/_Types.d.ts +17 -0
  84. package/types/src/writer/emitters/CommentsEmitter.d.ts +58 -0
  85. package/types/src/writer/emitters/EmbeddedPartEmitter.d.ts +60 -0
  86. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +19 -0
  87. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +18 -0
  88. package/types/src/writer/emitters/PersonsEmitter.d.ts +17 -0
  89. package/types/src/writer/emitters/PivotTableEmitter.d.ts +45 -0
  90. package/types/src/writer/emitters/SlicerEmitter.d.ts +66 -0
  91. package/types/src/writer/emitters/StylesEmitter.d.ts +2 -2
  92. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  93. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +27 -0
  94. package/types/src/writer/emitters/WorkbookEmitter.d.ts +16 -3
  95. package/types/src/writer/utils/AutoFilter.d.ts +2 -2
  96. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  97. package/types/src/writer/utils/DrawMLUtils.d.ts +57 -3
  98. package/types/src/writer/utils/DummyFunction.d.ts +0 -2
  99. package/types/src/writer/utils/DxfCollector.d.ts +3 -3
  100. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +28 -0
  101. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  102. package/types/src/writer/utils/TextUtils.d.ts +21 -2
  103. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  104. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  105. package/browser/cjs/Bhq8KfEhCnRykWeS.cjs +0 -1
  106. package/browser/cjs/BmG0GOcbuYvt3-R2.cjs +0 -1
  107. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  108. package/browser/cjs/D3YH3tTndeltJsh5.cjs +0 -1
  109. package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +0 -2
  110. package/browser/cjs/DK9GutW2zPbyNlfU.cjs +0 -2
  111. package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +0 -1
  112. package/browser/cjs/Dmi-Tsz618B6vKpZ.cjs +0 -5
  113. package/browser/cjs/index.cjs +0 -1
  114. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  115. package/browser/esm/BcnofzmeeuCVzr_M.mjs +0 -52
  116. package/browser/esm/C7R1lFA0iv-1bZ9i.mjs +0 -99
  117. package/browser/esm/CV_L3E5OoPstI9lx.mjs +0 -2211
  118. package/browser/esm/D8qZcXzj_fdusd0Y.mjs +0 -4748
  119. package/browser/esm/DLEtaZiz_1cZH0dA.mjs +0 -2685
  120. package/browser/esm/DlBlJGlFQJrKovwJ.mjs +0 -3651
  121. package/browser/esm/saBnxecsRUpY6fGv.mjs +0 -24
  122. package/node/esm/BSrW-J3BEH4Tza_S.mjs +0 -2486
  123. package/node/esm/BYCpXFieBgL_cwTO.mjs +0 -2255
  124. package/node/esm/Bqi4c7-14v0oNgFN.mjs +0 -108
  125. package/node/esm/D0frS50CfyeuXcuz.mjs +0 -2766
  126. package/node/esm/DsZ19z4oXoL-d0Lk.mjs +0 -3740
  127. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
@@ -0,0 +1,2446 @@
1
+ /**
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.10
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
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 {
12
+ constructor(e) {
13
+ this.list = e;
14
+ }
15
+ get length() {
16
+ return this.list.length;
17
+ }
18
+ item(e) {
19
+ return this.list[e];
20
+ }
21
+ forEach(e, t) {
22
+ let n = this.list, r = n.length;
23
+ for (let t = 0; t < r; t++) e(n[t], t, this);
24
+ }
25
+ entries() {
26
+ return this.list.entries();
27
+ }
28
+ keys() {
29
+ return this.list.keys();
30
+ }
31
+ values() {
32
+ return this.list.values();
33
+ }
34
+ [Symbol.iterator]() {
35
+ return this.list.values();
36
+ }
37
+ }, I = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, oe = (e) => {
38
+ let t = parseInt(e);
39
+ return isNaN(t) ? null : t;
40
+ }, se = (e) => {
41
+ let t = parseFloat(e);
42
+ return isNaN(t) ? null : t;
43
+ }, ce = /* @__PURE__ */ new Map(), L = class {
44
+ constructor(e, t, n, r, i, a = null, o = C.EmptyObject) {
45
+ this._fileLocation = "";
46
+ let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
47
+ 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);
48
+ }
49
+ getRef(e, t = !1) {
50
+ return this._getRef?.(e, this._fileLocation, t) ?? null;
51
+ }
52
+ readEmbeddedPart(e) {
53
+ return this._readEmbeddedPart?.(e, this._fileLocation) ?? null;
54
+ }
55
+ getRelationships() {
56
+ return this._getRefs?.(this._fileLocation) ?? ce;
57
+ }
58
+ getPath() {
59
+ return this.currentPath;
60
+ }
61
+ getFileLocation() {
62
+ return this._fileLocation;
63
+ }
64
+ getElemRoot() {
65
+ return this.elemRoot;
66
+ }
67
+ getJsonRoot() {
68
+ return this.jsonRoot;
69
+ }
70
+ warn(e, t) {
71
+ this._raiseWarning(e, this.getFileLocation(), t?.onceKey);
72
+ }
73
+ _raiseWarning(e, t, n) {
74
+ this._onWarning ? this._onWarning(e, t, n) : this._parent ? this._parent._raiseWarning(e, t, n) : console.warn(e);
75
+ }
76
+ serializeElement(e) {
77
+ return this._serializeElement?.(e) ?? null;
78
+ }
79
+ addPerson(e) {
80
+ return typeof e == "string" && (e = { displayName: e }), this._addPerson ? this._addPerson(e) : this._parent ? this._parent?._addPerson?.(e) ?? null : null;
81
+ }
82
+ getVisitorParamsState() {
83
+ return this.sharedShared.getVisitorParamsState();
84
+ }
85
+ evaluate(e, t) {
86
+ if (!e) return t;
87
+ let n = [t], r = e.split("/"), i = r.length;
88
+ for (let e = 0; e < i; e++) {
89
+ let t = r[e];
90
+ if (t === "" || t === ".") continue;
91
+ let a = [], o = (t === "*" || t === "**") && e !== i - 1;
92
+ for (let i of n) if (i) {
93
+ if (o) {
94
+ let t = r[e + 1];
95
+ t && t !== "" && t !== "." && (this._findDescendants(i, t, a), e++);
96
+ } else if (t === "*" || t === "**") {
97
+ if (!i.childNodes) continue;
98
+ let e = i.childNodes, t = e.length;
99
+ for (let n = 0; n < t; n++) {
100
+ let t = e[n];
101
+ t.nodeType === 1 && a.push(t);
102
+ }
103
+ } else {
104
+ if (!i.childNodes) continue;
105
+ let e = i.childNodes, n = e.length;
106
+ for (let r = 0; r < n; r++) {
107
+ let n = e[r];
108
+ if (n.nodeType !== 1) continue;
109
+ let i = n;
110
+ this._matchesElementName(i, t) && a.push(i);
111
+ }
112
+ }
113
+ }
114
+ if (n = a, n.length === 0) return null;
115
+ }
116
+ return n.length === 1 ? n[0] : n.length === 0 ? null : new F(n);
117
+ }
118
+ _matchesElementName(e, t) {
119
+ return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
120
+ }
121
+ _findDescendants(e, t, n) {
122
+ if (!e || !e.childNodes) return;
123
+ let r = e.childNodes, i = r.length;
124
+ for (let e = 0; e < i; e++) {
125
+ let i = r[e];
126
+ if (i.nodeType !== 1) continue;
127
+ let a = i;
128
+ this._matchesElementName(a, t) && n.push(a), this._findDescendants(a, t, n);
129
+ }
130
+ }
131
+ getFromPath(e, t) {
132
+ return C.getFromPath(e, t);
133
+ }
134
+ setToPath(e, t, n) {
135
+ return C.setToPath(e, t, n);
136
+ }
137
+ getValAttrAsString(e, t) {
138
+ let n = this.evaluate(e, t);
139
+ return n && n.hasAttribute("val") ? n.getAttribute("val") ?? null : null;
140
+ }
141
+ getValAttrAsBoolean(e, t, n = !1) {
142
+ let r = this.evaluate(e, t);
143
+ if (!r) return null;
144
+ let i = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
145
+ return i == null ? n : i === "1" || i === "on" || i === "true" || i !== "0" && i !== "off" && i !== "false" && n;
146
+ }
147
+ getValAttrAsInteger(e, t) {
148
+ let n = this.evaluate(e, t);
149
+ return n && n.hasAttribute("val") ? parseInt(n.getAttribute("val")) ?? null : null;
150
+ }
151
+ getValAttrAsFloat(e, t) {
152
+ let n = this.evaluate(e, t);
153
+ return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
154
+ }
155
+ get BOOLEAN_COPY() {
156
+ return I;
157
+ }
158
+ get INT_COPY() {
159
+ return oe;
160
+ }
161
+ get FLOAT_COPY() {
162
+ return se;
163
+ }
164
+ copyFromAttribute(e, t, n, r = t, i = null) {
165
+ if (!e || !n || !e.hasAttribute(t)) return;
166
+ let a = e.getAttribute(t);
167
+ if (i) {
168
+ if (Array.isArray(i)) {
169
+ let e = i.length;
170
+ for (let t = 0; t < e; t++) if (a == null || (a = i[t](a), a == null)) return;
171
+ } else if (a == null || (a = i(a), a == null)) return;
172
+ }
173
+ this.setToPath(n, r, a);
174
+ }
175
+ }, R = class {
176
+ constructor(e) {
177
+ this.jsonKey = e;
178
+ }
179
+ visit(e, t, n) {
180
+ let r = {};
181
+ return n[this.jsonKey] = r, r;
182
+ }
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;
191
+ }
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
+ }
210
+ }
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"));
214
+ }
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);
221
+ }
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;
229
+ }
230
+ }
231
+ }, V = class {
232
+ visit(e, t, n) {}
233
+ processDataBarColor(e, t, n, r, i = "auto") {
234
+ if (!t) return;
235
+ let a = S((e) => t.getAttribute(e), i);
236
+ return a && (n[r] = a), n;
237
+ }
238
+ processFonts(e, t, n) {
239
+ if (!t) return;
240
+ let r = t.childNodes, i = 0, a = r.length;
241
+ for (let t = 0; t < a; t++) {
242
+ let a = r.item(t);
243
+ if (a.nodeType === 1 && a.localName === "font") {
244
+ let t = {};
245
+ this.processFont(e, a, t), n[i++] = t;
246
+ }
247
+ }
248
+ return n;
249
+ }
250
+ 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");
259
+ if (e) switch (e) {
260
+ case "1":
261
+ n.fallbacks = ["serif"];
262
+ break;
263
+ case "2":
264
+ n.fallbacks = ["sans-serif"];
265
+ break;
266
+ case "3":
267
+ n.fallbacks = ["monospace"];
268
+ break;
269
+ case "4":
270
+ n.fallbacks = ["cursive"];
271
+ break;
272
+ case "5": n.fallbacks = ["fantasy"];
273
+ }
274
+ }
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;
276
+ }
277
+ processFills(e, t, n) {
278
+ if (!t) return;
279
+ let r = t.childNodes, i = 0, a = r.length;
280
+ for (let t = 0; t < a; t++) {
281
+ let a = r.item(t);
282
+ a.nodeType === 1 && a.localName === "fill" && this.processFill(e, a, n, i++);
283
+ }
284
+ return n;
285
+ }
286
+ processFill(e, t, n, r) {
287
+ let i = { type: k.Type.None }, a = t.childNodes, o = !1, s = a.length;
288
+ for (let t = 0; !o && t < s; t++) {
289
+ let n = a.item(t);
290
+ n.nodeType === 1 && (n.localName === "gradientFill" ? (this.processGradientFill(e, n, i), o = !0) : n.localName === "patternFill" && (this.processPatternFill(e, n, i), o = !0));
291
+ }
292
+ return n[r] = i, n;
293
+ }
294
+ processGradientFill(e, t, n) {
295
+ if (!t) return;
296
+ n.type = k.Type.Gradient;
297
+ let r = [];
298
+ n.stops = r;
299
+ let i = t.getAttribute("type");
300
+ i && (n.gradientType = i);
301
+ let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
302
+ (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"))
307
+ });
308
+ let o = t.childNodes, s = o.length;
309
+ for (let t = 0; t < s; t++) {
310
+ let n = o.item(t);
311
+ if (n.nodeType === 1 && n.localName === "stop") {
312
+ let t = {};
313
+ r.push(t), t.offset = parseFloat(n.getAttribute("position") ?? "");
314
+ let i = e.evaluate("color", n);
315
+ this.processDataBarColor(e, i, t, "color");
316
+ }
317
+ }
318
+ return n;
319
+ }
320
+ processPatternFill(e, t, n) {
321
+ 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";
326
+ if (s) {
327
+ let e = a;
328
+ a = o, o = e;
329
+ }
330
+ let u = e.evaluate("fgColor", t);
331
+ this.processDataBarColor(e, u, n, a, c);
332
+ let d = e.evaluate("bgColor", t);
333
+ return this.processDataBarColor(e, d, n, o, l), s && (n.foreground ||= "lt1", n.background ||= "dk1"), n;
334
+ }
335
+ processBorders(e, t, n, r) {
336
+ if (!t) return;
337
+ let i = t.childNodes, a = 0, o = i.length;
338
+ for (let t = 0; t < o; t++) {
339
+ let o = i.item(t);
340
+ o.nodeType === 1 && o.localName === "border" && this.processBorder(e, o, n, a++, r);
341
+ }
342
+ return n;
343
+ }
344
+ processBorder(e, t, n, r, i) {
345
+ if (!t) return;
346
+ 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;
348
+ }
349
+ processBorderStroke(e, t, n, r) {
350
+ if (!t) return;
351
+ let i = e.evaluate(r, t);
352
+ if (!i) return;
353
+ let a = {};
354
+ i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = E.StrokeStyle.None);
355
+ let o = e.evaluate("color", i);
356
+ return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
357
+ }
358
+ }, H = (e) => {
359
+ if (!e) return 0;
360
+ let t = parseFloat(e);
361
+ return isNaN(t) ? 0 : t;
362
+ }, U = new Set(Object.values(M.ElementType).filter((e) => e !== M.ElementType.WholeTable && e !== M.ElementType.HeaderRow)), W = {
363
+ auto: "auto",
364
+ autoNoTable: "automaticExceptTables",
365
+ manual: "manual"
366
+ }, G = [
367
+ "tableId",
368
+ "columnId",
369
+ "cacheName",
370
+ "cachePath",
371
+ "sourceName",
372
+ "sortOrder",
373
+ "customListSort",
374
+ "crossFilter"
375
+ ], K = (e, t) => {
376
+ let n = e.content, r = n?.json;
377
+ if (r) {
378
+ if (n.type === "shape" || t && n.type === "picture") {
379
+ let { rotation: n, flipH: i, flipV: a, bounds: o } = r;
380
+ 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
+ tl: {
382
+ x: o.x,
383
+ y: o.y
384
+ },
385
+ br: {
386
+ x: o.width,
387
+ y: o.height
388
+ }
389
+ });
390
+ }
391
+ if (n.type === "group") for (let e of r.members ?? []) K(e, !0);
392
+ }
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 {
488
+ visit(e, t, n) {
489
+ if (t) return this.visitShape(e, t, n, "sp", "nvSpPr/cNvSpPr/spLocks");
490
+ }
491
+ visitShape(e, t, n, r, a) {
492
+ let o = i[r];
493
+ if (this.isGroupContent(n)) {
494
+ 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);
497
+ let c = e.evaluate(a, t);
498
+ c?.hasAttribute?.("noChangeAspect") && (i.lockAspect = c.getAttribute("noChangeAspect") === "1");
499
+ let l = this.readTwinOf(e, t);
500
+ return l !== void 0 && Object.assign(s, { twinOf: l }), n.members.push(i), s;
501
+ }
502
+ 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);
507
+ }
508
+ return {};
509
+ }
510
+ n = super.visit(e, t, n);
511
+ let s = e.evaluate(a, t);
512
+ 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);
515
+ let u = this.readTwinOf(e, t);
516
+ return u !== void 0 && Object.assign(c, { twinOf: u }), this.setContent(n, {
517
+ type: "shape",
518
+ json: c
519
+ }), c;
520
+ }
521
+ readTwinOf(e, t) {
522
+ let n = e.evaluate("*/cNvPr/extLst/ext/compatExt", t);
523
+ n?.item && (n = n.item(0));
524
+ let r = /^_x0000_s(\d+)$/.exec(n?.getAttribute?.("spid") ?? "");
525
+ return r ? parseInt(r[1], 10) : void 0;
526
+ }
527
+ readShapeDetails(e, t, n, r, i) {
528
+ let a = t.getAttribute("macro");
529
+ a && (i.macro = a);
530
+ 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")));
532
+ let s = r.slice(0, r.lastIndexOf("/")), c = e.evaluate(s, t);
533
+ c?.getAttribute?.("txBox") === "1" && (i.textBox = !0);
534
+ let l = this.readLocks(e.evaluate(r, t));
535
+ if (l && (i.locks = l), n === "cxnSp" && c) {
536
+ let t = (t) => {
537
+ let n = e.evaluate(t, c);
538
+ if (n?.getAttribute) return {
539
+ id: parseInt(n.getAttribute("id") ?? "0", 10) || 0,
540
+ index: parseInt(n.getAttribute("idx") ?? "0", 10) || 0
541
+ };
542
+ }, n = t("stCxn"), r = t("endCxn");
543
+ (n || r) && (i.connectorEnds = {}, n && (i.connectorEnds.start = n), r && (i.connectorEnds.end = r));
544
+ }
545
+ }
546
+ }, Y = (e, t, n, r) => {
547
+ let i = e.evaluate(n, t), a = e.evaluate(r, t);
548
+ 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
553
+ } : null;
554
+ }, X = "richTypes", Z = "richData", Q = (e) => {
555
+ let t = e.getAttribute("val");
556
+ return t !== "0" && t !== "false";
557
+ }, ue = {
558
+ 1: "serif",
559
+ 2: "sans-serif",
560
+ 3: "monospace",
561
+ 4: "cursive",
562
+ 5: "fantasy"
563
+ };
564
+ function de(e) {
565
+ let t = {}, n = e.childNodes;
566
+ for (let e = 0; e < n.length; e++) {
567
+ let r = n.item(e);
568
+ if (r.nodeType === 1) switch (r.localName) {
569
+ case "b":
570
+ t.weight = Q(r) ? 700 : 400;
571
+ break;
572
+ case "i":
573
+ t.style = Q(r) ? A.Style.Italic : A.Style.Normal;
574
+ break;
575
+ case "strike":
576
+ t.strike = Q(r);
577
+ break;
578
+ case "outline":
579
+ t.outline = Q(r);
580
+ break;
581
+ case "shadow":
582
+ t.shadow = Q(r);
583
+ break;
584
+ case "extend":
585
+ t.extend = Q(r);
586
+ break;
587
+ case "u":
588
+ t.underline = r.getAttribute("val") || A.UnderlineStyle.Single;
589
+ break;
590
+ 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);
593
+ break;
594
+ }
595
+ case "sz": {
596
+ let e = parseFloat(r.getAttribute("val") ?? "");
597
+ isNaN(e) || (t.size = e);
598
+ break;
599
+ }
600
+ case "rFont": {
601
+ let e = r.getAttribute("val");
602
+ e && (t.family = e);
603
+ break;
604
+ }
605
+ case "family": {
606
+ let e = ue[r.getAttribute("val") ?? ""];
607
+ e && (t.fallbacks = [e]);
608
+ break;
609
+ }
610
+ case "charset": {
611
+ let e = parseInt(r.getAttribute("val") ?? "", 10);
612
+ isNaN(e) || (t.charset = e);
613
+ break;
614
+ }
615
+ case "scheme": {
616
+ let e = r.getAttribute("val");
617
+ e && (t.scheme = e);
618
+ break;
619
+ }
620
+ case "color": {
621
+ let e = r.getAttribute("rgb");
622
+ if (e && !r.hasAttribute("theme")) {
623
+ t.color = "#" + (e.length === 8 ? e.substring(2) : e).toUpperCase();
624
+ break;
625
+ }
626
+ let n = S((e) => r.getAttribute(e));
627
+ n && (t.color = n);
628
+ break;
629
+ }
630
+ }
631
+ }
632
+ return Object.keys(t).length > 0 ? t : null;
633
+ }
634
+ var $ = {
635
+ RelsVisitor: class {
636
+ visit(e, t, n) {
637
+ if (!t) return;
638
+ let r = t.childNodes, i = r.length;
639
+ for (let t = 0; t < i; t++) {
640
+ let i = r.item(t);
641
+ i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(e, i, n);
642
+ }
643
+ return n;
644
+ }
645
+ processRelationship(e, t, n) {
646
+ let r = {};
647
+ e.copyFromAttribute(t, "Target", r, "target"), e.copyFromAttribute(t, "Type", r, "type"), e.copyFromAttribute(t, "TargetMode", r, "targetMode"), n[t.getAttribute("Id")] = r;
648
+ }
649
+ },
650
+ CorePropertiesVisitor: class {
651
+ visit(e, t, n) {
652
+ let r = [], i = t.childNodes, a = i.length;
653
+ for (let t = 0; t < a; t++) {
654
+ let n = i.item(t);
655
+ if (n.nodeType !== 1) continue;
656
+ let a = this.processProperty(e, n);
657
+ a && r.push(a);
658
+ }
659
+ return r.length > 0 && (n.properties = r), r;
660
+ }
661
+ processProperty(e, t) {
662
+ if (t) return t.getAttribute("xsi:type"), {
663
+ key: t.localName,
664
+ value: t.textContent || ""
665
+ };
666
+ }
667
+ },
668
+ AppPropertiesVisitor: class {
669
+ 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);
673
+ if (n.nodeType !== 1) continue;
674
+ let a = this.processProperty(e, n);
675
+ a && r.push(a);
676
+ }
677
+ return r.length > 0 && (n.properties = r), r;
678
+ }
679
+ processProperty(e, t) {
680
+ if (t) return {
681
+ key: t.localName,
682
+ value: t.textContent || ""
683
+ };
684
+ }
685
+ },
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 {
763
+ 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");
799
+ 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);
806
+ }
807
+ }
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);
942
+ }
943
+ return n;
944
+ }
945
+ },
946
+ ThemeVisitor: class {
947
+ visit(e, t, n) {
948
+ return n.name = t.getAttribute("name"), n;
949
+ }
950
+ },
951
+ ClrSchemeVisitor: class extends v {
952
+ visit(e, t, n) {
953
+ let r = {};
954
+ r.name = t.getAttribute("name");
955
+ let i = t.childNodes, a = i.length;
956
+ for (let n = 0; n < a; n++) {
957
+ let a = i.item(n);
958
+ if (a.nodeType === 1) {
959
+ let n = a.localName, i = e.evaluate(n, t);
960
+ r[n] = this.processAdjColor(e, i);
961
+ }
962
+ }
963
+ return Object.keys(r).length > 0 && (n.colors = r), r;
964
+ }
965
+ },
966
+ FontSchemeVisitor: class {
967
+ visit(e, t, n) {
968
+ let r = {};
969
+ 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;
974
+ }
975
+ processFontElement(e, t, n) {
976
+ 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;
983
+ }
984
+ },
985
+ FmtSchemeVisitor: class extends v {
986
+ visit(e, t, n) {
987
+ 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
+ if (r && (n.fillStyleLst = r), i && (n.lnStyleLst = i), a && (n.effectStyleLst = a), o && (n.bgFillStyleLst = o), r && i && a && o) return;
989
+ let s = e.serializeElement(t);
990
+ s && (n.formatSchemeXml = s);
991
+ }
992
+ parseFillList(e, t, n) {
993
+ let r = e.evaluate(n, t);
994
+ if (!r) return;
995
+ let i = [], a = r.childNodes, o = a.length;
996
+ for (let t = 0; t < o; t++) {
997
+ let n = a.item(t);
998
+ if (n.nodeType !== 1) continue;
999
+ let r = this.parseFillListItem(e, n);
1000
+ if (r === void 0) return;
1001
+ i.push(r);
1002
+ }
1003
+ return i;
1004
+ }
1005
+ parseFillListItem(e, t) {
1006
+ switch (t.localName) {
1007
+ case "noFill": return { type: k.Type.None };
1008
+ case "solidFill": {
1009
+ let n = this.processAdjColor(e, t);
1010
+ return n ? {
1011
+ type: k.Type.Solid,
1012
+ color: n
1013
+ } : void 0;
1014
+ }
1015
+ case "gradFill": return this.processGradFill(e, t);
1016
+ case "pattFill": return this.processPatternFill(e, t);
1017
+ default: return;
1018
+ }
1019
+ }
1020
+ parseLnList(e, t, n) {
1021
+ let r = e.evaluate(n, t);
1022
+ if (!r) return;
1023
+ let i = [], a = r.childNodes, o = a.length;
1024
+ for (let t = 0; t < o; t++) {
1025
+ let n = a.item(t);
1026
+ n.nodeType === 1 && i.push(this.parseLn(e, n));
1027
+ }
1028
+ return i;
1029
+ }
1030
+ parseEffectStyleList(e, t, n) {
1031
+ let r = e.evaluate(n, t);
1032
+ if (!r) return;
1033
+ let i = [], a = r.childNodes, o = a.length;
1034
+ for (let t = 0; t < o; t++) {
1035
+ let n = a.item(t);
1036
+ if (n.nodeType !== 1) continue;
1037
+ if (e.evaluate("scene3d", n) || e.evaluate("sp3d", n)) return;
1038
+ let r = this.getEffects(e, n);
1039
+ if (r === void 0) return;
1040
+ i.push(r ?? []);
1041
+ }
1042
+ return i;
1043
+ }
1044
+ },
1045
+ AutoFilterVisitor: class {
1046
+ visit(e, t, n) {
1047
+ if (!t) return;
1048
+ 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;
1050
+ }
1051
+ processColorFilter(e, t) {
1052
+ let n = {}, r = {
1053
+ operator: O.BuiltInOperatorNames.Color,
1054
+ param: n
1055
+ };
1056
+ return e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY), e.copyFromAttribute(t, "dxfId", n, "styleId", e.INT_COPY), r;
1057
+ }
1058
+ processCustomFilter(e, t) {
1059
+ return te({
1060
+ operator: t.getAttribute("operator"),
1061
+ val: t.getAttribute("val")
1062
+ }, (t) => e.warn(t));
1063
+ }
1064
+ processCustomFilters(e, t) {
1065
+ let n = t.getAttribute("and"), r = n === "and" || n === "1";
1066
+ t.getAttribute("val");
1067
+ let i = [], a = {
1068
+ operator: r ? O.BuiltInOperatorNames.And : O.BuiltInOperatorNames.Or,
1069
+ param: i
1070
+ }, o = t.childNodes, s = o.length;
1071
+ for (let t = 0; t < s; t++) {
1072
+ let n = o.item(t);
1073
+ if (n.nodeType !== 1) continue;
1074
+ let r = null;
1075
+ n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
1076
+ }
1077
+ return i.length === 1 ? i[0] : l(a);
1078
+ }
1079
+ processDynamicFilter(e, t) {
1080
+ return p(t.getAttribute("type"));
1081
+ }
1082
+ processDateGroupItem(e, t) {
1083
+ let n = {};
1084
+ return e.copyFromAttribute(t, "dateTimeGrouping", n, "group"), e.copyFromAttribute(t, "day", n, "day", e.INT_COPY), e.copyFromAttribute(t, "hour", n, "hour", e.INT_COPY), e.copyFromAttribute(t, "minute", n, "minute", e.INT_COPY), e.copyFromAttribute(t, "month", n, "month", e.INT_COPY), e.copyFromAttribute(t, "second", n, "second", e.INT_COPY), e.copyFromAttribute(t, "year", n, "year", e.INT_COPY), n;
1085
+ }
1086
+ processFilterItem(e, t) {
1087
+ if (t.hasAttribute("val")) return t.getAttribute("val");
1088
+ }
1089
+ processFilters(e, t) {
1090
+ let n = {}, r = {
1091
+ operator: O.BuiltInOperatorNames.InSet,
1092
+ param: n
1093
+ };
1094
+ r.selector = O.BuiltInSelectorNames.Display, e.copyFromAttribute(t, "blank", n, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", n, "calendarType");
1095
+ let i = [], a = [], o = t.childNodes, s = o.length;
1096
+ for (let t = 0; t < s; t++) {
1097
+ let n = o.item(t);
1098
+ if (n.nodeType === 1) {
1099
+ if (n.localName === "dateGroupItem") {
1100
+ let t = this.processDateGroupItem(e, n);
1101
+ t && i.push(t);
1102
+ } else if (n.localName === "filter") {
1103
+ let t = this.processFilterItem(e, n);
1104
+ t !== void 0 && a.push(t);
1105
+ }
1106
+ }
1107
+ }
1108
+ return i.length > 0 && (n.dateGroups = i), a.length > 0 && (n.items = a), r;
1109
+ }
1110
+ processIcon(e, t) {
1111
+ let n = {}, r = {
1112
+ operator: O.BuiltInOperatorNames.Icon,
1113
+ param: n
1114
+ };
1115
+ return e.copyFromAttribute(t, "iconId", n, "iconId", e.INT_COPY), e.copyFromAttribute(t, "iconSet", n), r;
1116
+ }
1117
+ processTop10(e, t) {
1118
+ let n = {}, r = {
1119
+ operator: O.BuiltInOperatorNames.TopN,
1120
+ param: n
1121
+ };
1122
+ 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;
1123
+ }
1124
+ processFilterColumnExt(e, t) {
1125
+ let n = t.childNodes;
1126
+ for (let t = 0; t < n.length; t++) {
1127
+ let r = n.item(t);
1128
+ if (r.nodeType !== 1 || r.localName !== "ext" || u(r.getAttribute("uri")) !== u("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
1129
+ let i = r.childNodes;
1130
+ for (let t = 0; t < i.length; t++) {
1131
+ let n = i.item(t);
1132
+ if (n.nodeType !== 1 || n.localName !== "filterColumn") continue;
1133
+ let r = n.childNodes;
1134
+ for (let t = 0; t < r.length; t++) {
1135
+ let n = r.item(t);
1136
+ if (n.nodeType === 1 && n.localName === "filters") return this.processFilters(e, n);
1137
+ }
1138
+ }
1139
+ }
1140
+ }
1141
+ processFilterCriteria(e, t) {
1142
+ if (!t) return;
1143
+ let n = t.childNodes, r, i = n.length;
1144
+ for (let t = 0; t < i; t++) {
1145
+ let i = n.item(t);
1146
+ i.nodeType === 1 && (i.localName === "colorFilter" ? r = this.processColorFilter(e, i) : i.localName === "customFilters" ? r = this.processCustomFilters(e, i) : i.localName === "dynamicFilter" ? r = this.processDynamicFilter(e, i) : i.localName === "filters" ? r = this.processFilters(e, i) : i.localName === "iconFilter" ? r = this.processIcon(e, i) : i.localName === "top10" ? r = this.processTop10(e, i) : i.localName === "extLst" && (r = this.processFilterColumnExt(e, i) ?? r));
1147
+ }
1148
+ return r;
1149
+ }
1150
+ processFilterColumn(e, t, n) {
1151
+ if (!t) return null;
1152
+ if (!t.hasAttribute("colId")) return;
1153
+ let r = parseInt(t.getAttribute("colId")), i = !1;
1154
+ if (t.hasAttribute("hiddenButton") && (i = b(t.getAttribute("hiddenButton"))), i && n) {
1155
+ let e = n.hiddenButtons;
1156
+ e || (e = [], n.hiddenButtons = e), e.push(r);
1157
+ }
1158
+ let a = !1;
1159
+ if (t.hasAttribute("showButton") && (a = b(t.getAttribute("showButton"))), a && n) {
1160
+ let e = n.showButtons;
1161
+ !0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
1162
+ }
1163
+ let o = this.processFilterCriteria(e, t);
1164
+ return o ? (o.index = r, o) : null;
1165
+ }
1166
+ processFilterColumns(e, t, n, r) {
1167
+ if (!t) return;
1168
+ let i = t.childNodes, a = i.length;
1169
+ for (let t = 0; t < a; t++) {
1170
+ let a = i.item(t);
1171
+ if (a.nodeType === 1 && a.localName === "filterColumn") {
1172
+ let t = this.processFilterColumn(e, a, r);
1173
+ t && n.push(t);
1174
+ }
1175
+ }
1176
+ return n;
1177
+ }
1178
+ },
1179
+ SortStateVisitor: class {
1180
+ visit(e, t, n) {
1181
+ if (!t) return;
1182
+ let r = t.getAttribute("ref"), i = {};
1183
+ t.hasAttribute("caseSensitive") && (i.collatorOptions = b(t.getAttribute("caseSensitive")) ? P.CaseSensitiveOptions : P.CaseInsensitiveOptions);
1184
+ let a = t.getAttribute("sortMethod");
1185
+ a != null && a !== "none" && (a === "stroke" ? i.collatorOptions = {
1186
+ ...i.collatorOptions,
1187
+ collation: "stroke"
1188
+ } : a === "pinYin" && (i.collatorOptions = {
1189
+ ...i.collatorOptions,
1190
+ collation: "pinyin"
1191
+ }));
1192
+ 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;
1196
+ }
1197
+ processSortCondition(e, t, n, r) {
1198
+ if (!t) return null;
1199
+ let i = {};
1200
+ if (!t.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1201
+ if (t.hasAttribute("ref")) {
1202
+ let e = t.getAttribute("ref"), r = w.fastStringToRange(e);
1203
+ i.index = n ? r.colStart - n.colStart : r.colStart;
1204
+ }
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;
1207
+ }
1208
+ processSortConditions(e, t, n, r, i) {
1209
+ 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);
1215
+ t && n.push(t);
1216
+ }
1217
+ }
1218
+ }
1219
+ },
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 = {
1224
+ fills: {},
1225
+ fonts: {},
1226
+ borders: {}
1227
+ };
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 }
1236
+ };
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;
1243
+ }
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;
1250
+ }
1251
+ processIndexColors(e, t, n) {
1252
+ if (!t) return;
1253
+ let r = [], i = t.childNodes, a = i.length;
1254
+ for (let t = 0; t < a; t++) {
1255
+ let n = i.item(t);
1256
+ if (n.nodeType === 1 && n.localName === "rgbColor") {
1257
+ let t = { color: null };
1258
+ this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
1259
+ }
1260
+ }
1261
+ n.indexedColors = r;
1262
+ }
1263
+ processMruColors(e, t, n) {
1264
+ if (!t) return;
1265
+ let r = [], i = t.childNodes, a = i.length;
1266
+ for (let t = 0; t < a; t++) {
1267
+ let n = i.item(t);
1268
+ if (n.nodeType === 1 && n.localName === "color") {
1269
+ let t = { color: null };
1270
+ this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
1271
+ }
1272
+ }
1273
+ r.length > 0 && (n.mruColors = r);
1274
+ }
1275
+ processNumFmts(e, t, n) {
1276
+ if (!t) return;
1277
+ let r = /* @__PURE__ */ new Map();
1278
+ if (e.getVisitorParamsState().set("numFmts", r), !t) return;
1279
+ let i = t.childNodes, a = i.length;
1280
+ for (let e = 0; e < a; e++) {
1281
+ let t = i.item(e);
1282
+ if (t.nodeType === 1 && t.localName === "numFmt") {
1283
+ let e = t.getAttribute("numFmtId"), n = t.getAttribute("formatCode");
1284
+ if (e && n) {
1285
+ let t = n;
1286
+ r.set(parseInt(e), t);
1287
+ }
1288
+ }
1289
+ }
1290
+ }
1291
+ processXFs(e, t, n, r, i = null, a = !0) {
1292
+ if (!t) return;
1293
+ let o = t.childNodes, s = o.length;
1294
+ for (let t = 0; t < s; t++) {
1295
+ let s = o.item(t);
1296
+ if (s.nodeType === 1 && s.localName === "xf") {
1297
+ let t = {};
1298
+ this.processXF(e, s, t, r, i, a), n.push(t);
1299
+ }
1300
+ }
1301
+ }
1302
+ processXF(e, t, n, r, i, a) {
1303
+ if (!t) return;
1304
+ let o = t.getAttribute("xfId");
1305
+ if (o && i) {
1306
+ let e = i.get(parseInt(o));
1307
+ e && e !== D.BuiltInName.Normal && (n.named = e);
1308
+ }
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;
1310
+ if (s("applyFont")) {
1311
+ let e = t.getAttribute("fontId") ?? l;
1312
+ if (e !== void 0 && (e !== "0" || c("applyFont"))) {
1313
+ let t = r.fonts[e];
1314
+ t !== void 0 && (n.font = t);
1315
+ }
1316
+ }
1317
+ if (s("applyFill")) {
1318
+ let e = t.getAttribute("fillId") ?? l;
1319
+ if (e !== void 0 && (e !== "0" || c("applyFill"))) {
1320
+ let t = r.fills[e];
1321
+ t !== void 0 && Object.keys(t).length > 0 && (n.fill = t);
1322
+ }
1323
+ }
1324
+ if (s("applyBorder")) {
1325
+ let e = t.getAttribute("borderId") ?? l;
1326
+ if (e !== void 0 && (e !== "0" || c("applyBorder"))) {
1327
+ let t = r.borders[e];
1328
+ t !== void 0 && (n.borders = t);
1329
+ }
1330
+ }
1331
+ if (s("applyNumberFormat")) {
1332
+ let r = t.getAttribute("numFmtId") ?? l;
1333
+ if (r !== void 0 && (r !== "0" || c("applyNumberFormat"))) {
1334
+ let t = parseInt(r), i, a = e.getVisitorParamsState();
1335
+ if (a) {
1336
+ let e = a.get("numFmts");
1337
+ e && (i = e.get(t)), n.numberFormat = i ?? t;
1338
+ } else e.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
1339
+ }
1340
+ }
1341
+ if (s("applyAlignment")) {
1342
+ let r = e.evaluate("alignment", t);
1343
+ (r || c("applyAlignment")) && this.processAlignment(e, r, n);
1344
+ }
1345
+ if (s("applyProtection")) {
1346
+ let r = e.evaluate("protection", t);
1347
+ (r || c("applyProtection")) && this.processProtection(e, r, n);
1348
+ }
1349
+ let u = b(t.getAttribute("quotePrefix") ?? "");
1350
+ u && (n.quotePrefix = u);
1351
+ }
1352
+ processAlignment(e, t, n) {
1353
+ 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")) {
1355
+ let e = parseFloat(t.getAttribute("textRotation"));
1356
+ e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
1357
+ } else r.rotation = 0;
1358
+ t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = b(t.getAttribute("justifyLastLine")));
1359
+ 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;
1361
+ }
1362
+ collectHiddenXfs(e) {
1363
+ let t = /* @__PURE__ */ new Set();
1364
+ if (!e) return t;
1365
+ let n = e.childNodes, r = 0;
1366
+ for (let e = 0; e < n.length; e++) {
1367
+ let i = n.item(e);
1368
+ if (i.nodeType !== 1 || i.localName !== "xf") continue;
1369
+ let a = i.childNodes;
1370
+ for (let e = 0; e < a.length; e++) {
1371
+ let n = a.item(e);
1372
+ n.nodeType === 1 && n.localName === "protection" && b(n.getAttribute("hidden") ?? "") && t.add(r);
1373
+ }
1374
+ r++;
1375
+ }
1376
+ return t;
1377
+ }
1378
+ processProtection(e, t, n) {
1379
+ if (!t) return;
1380
+ let r = t.getAttribute("locked");
1381
+ return n.protection = { alwaysUnlocked: !!r && !b(r) }, n;
1382
+ }
1383
+ processDXF(e, t, n) {
1384
+ if (!t) return;
1385
+ let r = t.childNodes, i = r.length;
1386
+ for (let t = 0; t < i; t++) {
1387
+ let i = r.item(t);
1388
+ if (i.nodeType === 1 && i.localName === "font") {
1389
+ let t = {};
1390
+ this.processFont(e, i, t), n.font = t;
1391
+ } else if (i.nodeType === 1 && i.localName === "fill") {
1392
+ let t = [];
1393
+ this.processFill(e, i, t, 0), t.length > 0 && t[0] && (n.fill = t[0]);
1394
+ } else if (i.nodeType === 1 && i.localName === "border") {
1395
+ let t = [];
1396
+ this.processBorder(e, i, t, 0, !1), t.length > 0 && t[0] && (n.borders = t[0]);
1397
+ } else if (i.nodeType === 1 && i.localName === "numFmt") {
1398
+ let e = i.getAttribute("formatCode");
1399
+ if (e) n.numberFormat = e;
1400
+ else {
1401
+ let e = i.getAttribute("numFmtId");
1402
+ e && (n.numberFormat = Number(e));
1403
+ }
1404
+ } else i.nodeType === 1 && i.localName === "alignment" && this.processAlignment(e, i, n);
1405
+ }
1406
+ }
1407
+ processDXFs(e, t, n) {
1408
+ if (!t) return;
1409
+ e.getVisitorParamsState().set("processingDXFs", !0);
1410
+ let r = /* @__PURE__ */ new Map();
1411
+ e.getVisitorParamsState().set("dxfs", r);
1412
+ let i = t.childNodes, a = i.length;
1413
+ for (let t = 0; t < a; t++) {
1414
+ let a = i.item(t);
1415
+ if (a.nodeType === 1 && a.localName === "dxf") {
1416
+ let t = {};
1417
+ this.processDXF(e, a, t);
1418
+ let i = n.length;
1419
+ r.set(i, t), n.push(t);
1420
+ }
1421
+ }
1422
+ e.getVisitorParamsState().delete("processingDXFs");
1423
+ }
1424
+ processSlicerStyles(e, t, n) {
1425
+ if (!t) return;
1426
+ let r = null, i = null, a = t.childNodes;
1427
+ for (let e = 0; e < a.length; e++) {
1428
+ let t = a.item(e);
1429
+ if (t.nodeType !== 1 || t.localName !== "ext") continue;
1430
+ let n = t.childNodes;
1431
+ for (let e = 0; e < n.length; e++) {
1432
+ let t = n.item(e);
1433
+ t.nodeType === 1 && (t.localName === "dxfs" ? r = t : t.localName === "slicerStyles" && (i = t));
1434
+ }
1435
+ }
1436
+ if (!i) return;
1437
+ let o = [];
1438
+ if (r) {
1439
+ e.getVisitorParamsState().set("processingDXFs", !0);
1440
+ let t = r.childNodes;
1441
+ for (let n = 0; n < t.length; n++) {
1442
+ let r = t.item(n);
1443
+ if (r.nodeType !== 1 || r.localName !== "dxf") continue;
1444
+ let i = {};
1445
+ this.processDXF(e, r, i), o.push(i);
1446
+ }
1447
+ e.getVisitorParamsState().delete("processingDXFs");
1448
+ }
1449
+ let s = {}, c = i.getAttribute("defaultSlicerStyle");
1450
+ c && c !== "SlicerStyleLight1" && (s.defaultSlicerStyle = c);
1451
+ let l = n.tables?.styles, u = i.childNodes;
1452
+ for (let t = 0; t < u.length; t++) {
1453
+ let n = u.item(t);
1454
+ if (n.nodeType !== 1 || n.localName !== "slicerStyle") continue;
1455
+ let r = n.getAttribute("name");
1456
+ if (!r) continue;
1457
+ let i = {}, a = l?.[r];
1458
+ a && !1 === a.table && !a.pivot && (a.wholeTable && (i.wholeTable = a.wholeTable), a.headerRow && (i.headerRow = a.headerRow), delete l[r]);
1459
+ let c = e.evaluate("slicerStyleElements", n)?.childNodes, d = c?.length ?? 0;
1460
+ for (let t = 0; t < d; t++) {
1461
+ let n = c.item(t);
1462
+ if (n.nodeType !== 1 || n.localName !== "slicerStyleElement") continue;
1463
+ let r = n.getAttribute("type");
1464
+ if (!r || !U.has(r)) continue;
1465
+ let a = n.getAttribute("dxfId"), s = a == null ? void 0 : o[parseInt(a)];
1466
+ s ? i[r] = s : e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
1467
+ }
1468
+ (s.styles ??= {})[r] = i;
1469
+ }
1470
+ l && Object.keys(l).length === 0 && (delete n.tables.styles, Object.keys(n.tables).length === 0 && delete n.tables), Object.keys(s).length > 0 && (n.slicers = s);
1471
+ }
1472
+ processTableStyle(e, t, n, r, i = !1) {
1473
+ 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);
1475
+ let s = t.childNodes, c = s.length;
1476
+ for (let t = 0; t < c; t++) {
1477
+ let n = s.item(t);
1478
+ if (n.nodeType === 1 && n.localName === "tableStyleElement") {
1479
+ let t = n.getAttribute("type"), i = n.getAttribute("dxfId"), a = i == null ? void 0 : r?.[i];
1480
+ a ||= (e.warn(`A table style names a format that does not exist (dxfId '${i}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), {}), o[t] = a;
1481
+ let s = null;
1482
+ n.hasAttribute("size") && (s = parseInt(n.getAttribute("size"))), s && !isNaN(s) && (a.size = s);
1483
+ }
1484
+ }
1485
+ delete o.name, n[a] = o;
1486
+ }
1487
+ processTableStyles(e, t, n, r, i) {
1488
+ if (!t) return;
1489
+ let a = {}, o = t.getAttribute("defaultTableStyle");
1490
+ o && (a.defaultTableStyle = o);
1491
+ let s = t.getAttribute("defaultPivotStyle");
1492
+ s && (a.defaultPivotStyle = s);
1493
+ let c = t.childNodes, l = {}, u = c.length;
1494
+ for (let t = 0; t < u; t++) {
1495
+ let n = c.item(t);
1496
+ n.nodeType === 1 && n.localName === "tableStyle" && this.processTableStyle(e, n, l, r, i);
1497
+ }
1498
+ return Object.keys(l).length > 0 && (a.styles = l), Object.keys(a).length > 0 && (n.tables = a), n;
1499
+ }
1500
+ processCellStyles(e, t, n, r, i) {
1501
+ if (!t) return;
1502
+ let a = t.childNodes, o = a.length;
1503
+ for (let e = 0; e < o; e++) {
1504
+ let t = a.item(e);
1505
+ if (t.nodeType === 1 && t.localName === "cellStyle") {
1506
+ let e = parseInt(t.getAttribute("xfId") ?? ""), a = t.getAttribute("name"), o = t.getAttribute("builtinId"), s = a;
1507
+ if (o !== null) {
1508
+ let e = D.builtInNameFromId(parseInt(o));
1509
+ e !== void 0 && (s = e);
1510
+ }
1511
+ if (i.set(e, s), !r[e]) continue;
1512
+ let c = {
1513
+ name: s,
1514
+ style: r[e]
1515
+ };
1516
+ t.getAttribute("hidden") && (c.hidden = b(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (c.iLevel = parseInt(t.getAttribute("iLevel"))), n.push(c);
1517
+ }
1518
+ }
1519
+ }
1520
+ afterVisit(e, t, n) {}
1521
+ },
1522
+ WorkbookVisitor: class extends V {
1523
+ visit(e, t, n) {
1524
+ 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
+ }
1526
+ processPassword(e, t, n, r = "workbook", i = "password") {
1527
+ if (!t) return;
1528
+ 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);
1530
+ }
1531
+ processWorkbookProtection(e, t, n) {
1532
+ if (!t) return;
1533
+ let r = {};
1534
+ 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));
1536
+ return n.protection = r, n;
1537
+ }
1538
+ processCalcPr(e, t, n) {
1539
+ if (!t) return;
1540
+ 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);
1542
+ let i = t.getAttribute("calcId");
1543
+ i !== null && e.getVisitorParamsState().set("calcId", i), n.calc = r;
1544
+ }
1545
+ processSheetRefs(e, t, n) {
1546
+ if (!t) return;
1547
+ let r = [], i = t.childNodes, a = i.length;
1548
+ for (let t = 0; t < a; t++) {
1549
+ let n = i.item(t);
1550
+ n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(e, n, r);
1551
+ }
1552
+ n.sheets = r;
1553
+ }
1554
+ processSheetRef(e, t, n) {
1555
+ let r = {};
1556
+ 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);
1559
+ }
1560
+ processExternalReferences(e, t, n) {
1561
+ if (!t) return;
1562
+ let r = [], i = t.childNodes, a = i.length;
1563
+ for (let t = 0; t < a; t++) {
1564
+ let n = i.item(t);
1565
+ if (n.nodeType === 1 && n.localName === "externalReference") {
1566
+ let t = n.getAttribute("r:id"), i = t ? e.getRef(t) : null;
1567
+ r.push(i ?? null);
1568
+ }
1569
+ }
1570
+ r.length > 0 && (n.externalBooks = r);
1571
+ }
1572
+ processPivotCaches(e, t, n) {
1573
+ if (!t) return;
1574
+ let r = [], i = t.childNodes, a = i.length;
1575
+ for (let t = 0; t < a; t++) {
1576
+ let n = i.item(t);
1577
+ if (n.nodeType !== 1 || n.localName !== "pivotCache") continue;
1578
+ let a = parseInt(n.getAttribute("cacheId") ?? "", 10), o = n.getAttribute("r:id");
1579
+ if (isNaN(a) || !o) continue;
1580
+ let s = e.readEmbeddedPart(o);
1581
+ s && r.push({
1582
+ cacheId: a,
1583
+ part: s
1584
+ });
1585
+ }
1586
+ r.length > 0 && (n.pivotCaches = r);
1587
+ }
1588
+ processBookViews(e, t, n) {
1589
+ if (!t) return;
1590
+ let r = t.childNodes, i = 0, a = r.length;
1591
+ for (let t = 0; i < 1 && t < a; t++) {
1592
+ let a = r.item(t);
1593
+ a.nodeType === 1 && a.localName === "workbookView" && (this.processWorkbookView(e, a, n), i++);
1594
+ }
1595
+ }
1596
+ processWorkbookView(e, t, n) {
1597
+ 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);
1600
+ }
1601
+ processDefineName(e, t, n, r) {
1602
+ if (!t) return;
1603
+ let i = {}, a = t.firstChild;
1604
+ if (a && a.nodeType === 3 && (i.ref = a.textContent), e.copyFromAttribute(t, "name", i), e.copyFromAttribute(t, "comment", i), e.copyFromAttribute(t, "hidden", i, "hidden", e.BOOLEAN_COPY), t.hasAttribute("localSheetId")) {
1605
+ let n = t.getAttribute("localSheetId");
1606
+ if (!r[n]?.name) return void e.warn(`Defined name '${t.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1607
+ i.scope = r[n].name;
1608
+ }
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);
1610
+ }
1611
+ processDefinedNames(e, t, n) {
1612
+ if (!t) return;
1613
+ let r = [], i = t.childNodes, a = i.length;
1614
+ for (let t = 0; t < a; t++) {
1615
+ let a = i.item(t);
1616
+ a.nodeType === 1 && a.localName === "definedName" && this.processDefineName(e, a, r, n.sheets);
1617
+ }
1618
+ r.length > 0 && (n.names = r);
1619
+ }
1620
+ processWorkbookPr(e, t, n) {
1621
+ t && (e.copyFromAttribute(t, "date1904", n, "date1904", e.BOOLEAN_COPY), e.copyFromAttribute(t, "codeName", n, "codeName"), e.copyFromAttribute(t, "updateLinks", n, "updateLinks"));
1622
+ }
1623
+ afterVisit(e, t, n) {}
1624
+ },
1625
+ TableVisitor: class {
1626
+ visit(e, t, n) {
1627
+ 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;
1629
+ }
1630
+ afterVisit(e, t, n) {
1631
+ let r = n.v;
1632
+ if (e.evaluate("autoFilter", t)) {
1633
+ if (Array.isArray(r.hiddenButtons)) {
1634
+ let e = r.hiddenButtons.length;
1635
+ e === 0 ? r.hiddenButtons = !1 : e === r.columns?.length && (r.hiddenButtons = !0);
1636
+ }
1637
+ } else r.hiddenButtons = !0, r.showButtons = !1;
1638
+ return r;
1639
+ }
1640
+ processTableStyleInfo(e, t, n) {
1641
+ if (!t) return;
1642
+ let r = t.childNodes, i = {}, a = r.length;
1643
+ for (let t = 0; t < a; t++) {
1644
+ let n = r.item(t);
1645
+ n.nodeType === 1 && n.localName === "tableStyleInfo" && (e.copyFromAttribute(n, "name", i), e.copyFromAttribute(n, "showColumnStripes", i, "showColumnStripes", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showFirstColumn", i, "showFirstColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showLastColumn", i, "showLastColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showRowStripes", i, "showRowStripes", e.BOOLEAN_COPY));
1646
+ }
1647
+ Object.keys(i).length > 0 && (n.style = i);
1648
+ }
1649
+ processTableColumn(e, t, n) {
1650
+ if (!t) return null;
1651
+ let r = t.childNodes, i = r.length;
1652
+ for (let t = 0; t < i; t++) {
1653
+ let i = r.item(t);
1654
+ if (i.nodeType === 1 && i.localName === "tableColumn") {
1655
+ let t = {};
1656
+ e.copyFromAttribute(i, "name", t), e.copyFromAttribute(i, "id", t), e.copyFromAttribute(i, "uniqueName", t), e.copyFromAttribute(i, "queryTableFieldId", t), e.copyFromAttribute(i, "totalsRowLabel", t);
1657
+ let r = i.getAttribute("totalsRowFunction");
1658
+ if (r !== null) {
1659
+ if (r === "custom") {
1660
+ let n = e.evaluate("totalsRowFormula", i);
1661
+ n && (t.totalsRowFormula = n.textContent);
1662
+ } else t.totalsRowFormula = r;
1663
+ }
1664
+ e.copyFromAttribute(i, "totalsRowLabel", t);
1665
+ let a = e.evaluate("calculatedColumnFormula", i);
1666
+ a?.textContent && (t.calculatedColumnFormula = a.textContent), n.push(t);
1667
+ }
1668
+ }
1669
+ return n;
1670
+ }
1671
+ processTableColumns(e, t, n) {
1672
+ let r = t.childNodes, i = [], a = r.length;
1673
+ for (let t = 0; t < a; t++) {
1674
+ let n = r.item(t);
1675
+ n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(e, n, i);
1676
+ }
1677
+ i.length > 0 && (n.columns = i);
1678
+ }
1679
+ },
1680
+ TableX14Visitor: class {
1681
+ visit(e, t, n) {
1682
+ let r = e.getVisitorParamsState().get("ref");
1683
+ if (r) {
1684
+ let n = e.getVisitorParamsState().get("descriptions");
1685
+ n && (n.add(r, t.getAttribute("altText")), n.add(r, t.getAttribute("altTextSummary")));
1686
+ }
1687
+ return e.copyFromAttribute(t, "altText", n), e.copyFromAttribute(t, "altTextSummary", n), n;
1688
+ }
1689
+ },
1690
+ ExternalLinkVisitor: class {
1691
+ visit(e, t, n) {
1692
+ let r = t.childNodes, i = r.length, a = null;
1693
+ for (let e = 0; e < i; e++) {
1694
+ let t = r.item(e);
1695
+ if (t.nodeType === 1) {
1696
+ t.localName === "externalBook" && (a = t);
1697
+ break;
1698
+ }
1699
+ }
1700
+ if (!a) return n;
1701
+ t.getAttribute("mc:Ignorable") && (n.mceIgnorable = !0);
1702
+ let o = a.getAttribute("r:id");
1703
+ o && (n.__bookRelId = o);
1704
+ let s = this._findAbsoluteUrlRelId(a);
1705
+ return s && (n.__absoluteUrlRelId = s), n.sheetNames = [], this.processSheetNames(e, a, n), this.processDefinedNames(e, a, n), this.processSheetDataSet(e, a, n), n;
1706
+ }
1707
+ processSheetNames(e, t, n) {
1708
+ let r = this._findChild(t, "sheetNames");
1709
+ if (!r) return;
1710
+ let i = r.childNodes, a = i.length;
1711
+ for (let e = 0; e < a; e++) {
1712
+ let t = i.item(e);
1713
+ t.nodeType === 1 && t.localName === "sheetName" && n.sheetNames.push(t.getAttribute("val") ?? "");
1714
+ }
1715
+ }
1716
+ processDefinedNames(e, t, n) {
1717
+ let r = this._findChild(t, "definedNames");
1718
+ if (!r) return;
1719
+ let i = [], a = r.childNodes, o = a.length;
1720
+ for (let e = 0; e < o; e++) {
1721
+ let t = a.item(e);
1722
+ if (t.nodeType !== 1 || t.localName !== "definedName") continue;
1723
+ let n = t.getAttribute("name");
1724
+ if (!n) continue;
1725
+ let r = {
1726
+ name: n,
1727
+ refersTo: t.getAttribute("refersTo") ?? ""
1728
+ }, o = t.getAttribute("sheetId");
1729
+ o !== null && (r.sheetIndex = parseInt(o, 10)), i.push(r);
1730
+ }
1731
+ i.length > 0 && (n.definedNames = i);
1732
+ }
1733
+ processSheetDataSet(e, t, n) {
1734
+ let r = this._findChild(t, "sheetDataSet");
1735
+ if (!r) return;
1736
+ let i = [], a = r.childNodes, o = a.length;
1737
+ for (let t = 0; t < o; t++) {
1738
+ let n = a.item(t);
1739
+ if (n.nodeType !== 1 || n.localName !== "sheetData") continue;
1740
+ let r = n.getAttribute("sheetId");
1741
+ if (r === null) continue;
1742
+ let o = this.processSheetData(e, n);
1743
+ o.sheetIndex = parseInt(r, 10), n.getAttribute("refreshError") === "1" && (o.refreshError = !0), i.push(o);
1744
+ }
1745
+ i.length > 0 && (n.sheetDataSet = i);
1746
+ }
1747
+ processSheetData(e, t) {
1748
+ let n = new ae.Builder(), r = t.childNodes, i = r.length;
1749
+ for (let e = 0; e < i; e++) {
1750
+ let t = r.item(e);
1751
+ if (t.nodeType !== 1 || t.localName !== "row") continue;
1752
+ let i = t.childNodes, a = i.length;
1753
+ for (let e = 0; e < a; e++) {
1754
+ let t = i.item(e);
1755
+ if (t.nodeType !== 1 || t.localName !== "cell") continue;
1756
+ let r = t.getAttribute("r");
1757
+ if (!r) continue;
1758
+ let a = w.fastStringToCell(r);
1759
+ if (a?.rowIndex === void 0 || a?.colIndex === void 0) continue;
1760
+ let o = this._readCellValue(t);
1761
+ o !== void 0 && n.pushAt(a.rowIndex, a.colIndex, o);
1762
+ }
1763
+ }
1764
+ return {
1765
+ sheetIndex: -1,
1766
+ data: n.build()?.tuples ?? []
1767
+ };
1768
+ }
1769
+ _readCellValue(e) {
1770
+ let t = this._findChild(e, "v")?.textContent?.trim();
1771
+ if (t !== void 0 && t !== "") switch (e.getAttribute("t")) {
1772
+ case null:
1773
+ case "n": return parseFloat(t);
1774
+ case "b": return t === "1" || t === "true";
1775
+ case "str":
1776
+ default: return t;
1777
+ case "e": {
1778
+ let e = T.getBuiltInByLabel(t);
1779
+ return e ? {
1780
+ t: "e",
1781
+ v: e.getCode()
1782
+ } : t;
1783
+ }
1784
+ }
1785
+ }
1786
+ _findChild(e, t) {
1787
+ let n = e.childNodes, r = n.length;
1788
+ for (let e = 0; e < r; e++) {
1789
+ let r = n.item(e);
1790
+ if (r.nodeType === 1 && r.localName === t) return r;
1791
+ }
1792
+ return null;
1793
+ }
1794
+ _findAbsoluteUrlRelId(e) {
1795
+ let t = this._findChild(e, "alternateUrls");
1796
+ return t ? this._findChild(t, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
1797
+ }
1798
+ },
1799
+ SlicerCacheDefinitionVisitor: class {
1800
+ visit(e, t, n) {
1801
+ e.copyFromAttribute(t, "name", n, "cacheName"), e.copyFromAttribute(t, "sourceName", n);
1802
+ let r = e.evaluate("*/tableSlicerCache", t);
1803
+ return r ? (e.copyFromAttribute(r, "tableId", n), e.copyFromAttribute(r, "column", n, "columnId"), e.copyFromAttribute(r, "sortOrder", n), e.copyFromAttribute(r, "customListSort", n, "customListSort", e.BOOLEAN_COPY), e.copyFromAttribute(r, "crossFilter", n), n) : (e.warn("A slicer names no table; it was not imported.", { onceKey: "xlsx.slicer.cacheDefinition" }), n);
1804
+ }
1805
+ },
1806
+ SlicersVisitor: class {
1807
+ visit(e, t, n) {
1808
+ let r = n.slicers;
1809
+ r || (r = {}, n.slicers = r);
1810
+ let i = t.childNodes, a = i.length;
1811
+ for (let t = 0; t < a; t++) {
1812
+ let n = i.item(t);
1813
+ n.nodeType === 1 && n.localName === "slicer" && this.processSlicer(e, n, r);
1814
+ }
1815
+ return r;
1816
+ }
1817
+ processSlicer(e, t, n) {
1818
+ if (!t) return;
1819
+ let r = {};
1820
+ n[t.getAttribute("name")] = r, e.copyFromAttribute(t, "xr10:uid", r, "uid");
1821
+ 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];
1824
+ o[t] !== void 0 && (r[t] = o[t]);
1825
+ }
1826
+ 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);
1827
+ }
1828
+ },
1829
+ FormControlPrVisitor: class {
1830
+ visit(e, t, n) {
1831
+ let r = {}, i = t.attributes;
1832
+ for (let e = 0; e < i.length; e++) {
1833
+ let t = i.item(e), n = t.name;
1834
+ n === "xmlns" || n.startsWith("xmlns:") || (r[n] = t.value);
1835
+ }
1836
+ let a = [], o, s = t.childNodes;
1837
+ for (let t = 0; t < s.length; t++) {
1838
+ let n = s.item(t);
1839
+ if (n.nodeType === 1) {
1840
+ if (n.localName === "itemLst") {
1841
+ let e = n.childNodes;
1842
+ for (let t = 0; t < e.length; t++) {
1843
+ let n = e.item(t);
1844
+ n.nodeType === 1 && n.localName === "item" && a.push(n.getAttribute("val") ?? "");
1845
+ }
1846
+ } else n.localName === "extLst" && (o = e.serializeElement(n) ?? void 0);
1847
+ }
1848
+ }
1849
+ let c = g(r, a, o);
1850
+ return n.formControl = c, c;
1851
+ }
1852
+ },
1853
+ DrawingVisitor: class {
1854
+ visit(e, t, n) {
1855
+ return n;
1856
+ }
1857
+ afterVisit(e, t, n) {
1858
+ for (let e of n?.movables ?? []) K(e, !1);
1859
+ }
1860
+ },
1861
+ DrawingAnchorVisitor: class {
1862
+ visit(e, t, n) {
1863
+ if (!t) return;
1864
+ 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;
1866
+ }
1867
+ processAbsoluteCoord(e, t, n, r, i, a) {
1868
+ if (!t) return;
1869
+ let o = {
1870
+ x: 0,
1871
+ y: 0
1872
+ };
1873
+ return o.x = d(t.getAttribute(i)), o.y = d(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
1874
+ }
1875
+ processOffsetCoord(e, t, n, r) {
1876
+ if (!t) return;
1877
+ let i = {
1878
+ c: 0,
1879
+ r: 0,
1880
+ x: 0,
1881
+ y: 0
1882
+ };
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;
1884
+ }
1885
+ },
1886
+ DrawingGraphicFrameVisitor: class extends q {
1887
+ visit(e, t, n) {
1888
+ if (!t) return;
1889
+ if (this.isGroupContent(n)) {
1890
+ if (e.getPath().includes("Fallback")) return {};
1891
+ let { movable: r } = this.readMemberHeader(e, t, "graphicFrame"), i = e.evaluate("xfrm", t);
1892
+ if (i) {
1893
+ _(i, r);
1894
+ let t = e.evaluate("off", i), n = e.evaluate("ext", i);
1895
+ r.anchor = {
1896
+ tl: {
1897
+ x: d(t?.getAttribute("x") ?? null) ?? 0,
1898
+ y: d(t?.getAttribute("y") ?? null) ?? 0
1899
+ },
1900
+ br: {
1901
+ x: d(n?.getAttribute("cx") ?? null) ?? 0,
1902
+ y: d(n?.getAttribute("cy") ?? null) ?? 0
1903
+ }
1904
+ };
1905
+ }
1906
+ let a = this.readGraphic(e, t);
1907
+ return r.content = {
1908
+ ...r.content,
1909
+ type: a.type,
1910
+ json: a.json
1911
+ }, n.members.push(r), a.json;
1912
+ }
1913
+ n = super.visit(e, t, n);
1914
+ let r = e.evaluate("nvGraphicFramePr/cNvGraphicFramePr", t);
1915
+ if (r) {
1916
+ let t = e.evaluate("graphicFrameLocks", r);
1917
+ t && t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
1918
+ }
1919
+ let i = this.readGraphic(e, t);
1920
+ return this.setContent(n, i), i;
1921
+ }
1922
+ readGraphic(e, t) {
1923
+ let n = e.evaluate("graphic/graphicData", t), r = {
1924
+ type: "graphicFrame",
1925
+ json: {}
1926
+ };
1927
+ if (!n) return r;
1928
+ let i = n.childNodes, a = i.length;
1929
+ for (let n = 0; n < a; n++) {
1930
+ let a = i.item(n);
1931
+ if (a.nodeType === 1) try {
1932
+ let n = a.localName;
1933
+ n === "chart" ? n = "chart" : n === "slicer" && (n = "slicer"), r.type = n;
1934
+ let i = a.getAttribute("r:id");
1935
+ if (n === "chart" && i) {
1936
+ let n = this.readSourceId(e, t);
1937
+ r.json = {
1938
+ xml: e.serializeElement(t) ?? void 0,
1939
+ sourceId: n,
1940
+ part: e.readEmbeddedPart(i) ?? void 0
1941
+ };
1942
+ } else if (n === "slicer") {
1943
+ let n = this.readSourceId(e, t);
1944
+ n !== void 0 && (r.json = { sourceId: n });
1945
+ } else i && (r.json = e.getRef(i));
1946
+ } catch (t) {
1947
+ e.warn(`Unable to read a graphic frame: ${t?.message ?? t}`, { onceKey: "xlsx.drawing.graphicFrame" });
1948
+ }
1949
+ }
1950
+ return r;
1951
+ }
1952
+ },
1953
+ DrawingSpVisitor: J,
1954
+ DrawingPicVisitor: class extends q {
1955
+ visit(e, t, n) {
1956
+ if (!t) return;
1957
+ if (this.isGroupContent(n)) {
1958
+ 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
+ }
1974
+ }
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, {
1979
+ 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);
1988
+ }
1989
+ },
1990
+ DrawingGrpSpVisitor: class extends q {
1991
+ constructor(...e) {
1992
+ super(...e), this._fills = new v();
1993
+ }
1994
+ visit(e, t, n) {
1995
+ if (!t) return;
1996
+ let r = this.isGroupContent(n), i, a;
1997
+ if (r) {
1998
+ if (e.getPath().includes("Fallback")) return {};
1999
+ let r = this.readMemberHeader(e, t, "group");
2000
+ i = r.movable, a = r.content, n.members.push(i);
2001
+ } else {
2002
+ if (e.getPath().includes("Fallback") && n.content) return {};
2003
+ i = super.visit(e, t, n), a = {};
2004
+ let r = this.readSourceId(e, t);
2005
+ r !== void 0 && (a.sourceId = r), this.setContent(i, {
2006
+ type: "group",
2007
+ json: a
2008
+ });
2009
+ }
2010
+ a.members = [];
2011
+ let o = e.evaluate("nvGrpSpPr/cNvGrpSpPr/grpSpLocks", t);
2012
+ o?.hasAttribute?.("noChangeAspect") && (i.lockAspect = o.getAttribute("noChangeAspect") === "1");
2013
+ let s = this.readLocks(o);
2014
+ s && (a.locks = s);
2015
+ let c = e.evaluate("grpSpPr", t);
2016
+ if (c) {
2017
+ let t = e.evaluate("xfrm", c);
2018
+ if (t) {
2019
+ _(t, i), t.getAttribute("flipH") === "1" && (i.flipH = !0), t.getAttribute("flipV") === "1" && (i.flipV = !0);
2020
+ let n = Y(e, t, "off", "ext"), o = Y(e, t, "chOff", "chExt") ?? n;
2021
+ o && (a.childBounds = o), r && n && (i.anchor = {
2022
+ tl: {
2023
+ x: n.x,
2024
+ y: n.y
2025
+ },
2026
+ br: {
2027
+ x: n.width,
2028
+ y: n.height
2029
+ }
2030
+ });
2031
+ }
2032
+ let n = this._fills.getFill(e, c);
2033
+ n && Object.keys(n).length > 0 && (a.fill = n);
2034
+ let o = this._fills.getEffects(e, c);
2035
+ o && (a.effects = o);
2036
+ let s = e.evaluate("scene3d", c), l = s ? e.serializeElement(s) : null;
2037
+ l && (a.scene3d = l);
2038
+ let u = e.evaluate("extLst", c), d = u ? e.serializeElement(u) : null;
2039
+ d && (a.extLst = {
2040
+ ...a.extLst,
2041
+ properties: d
2042
+ });
2043
+ }
2044
+ return a;
2045
+ }
2046
+ },
2047
+ DrawingCxnSpVisitor: class extends J {
2048
+ visit(e, t, n) {
2049
+ if (t) return this.visitShape(e, t, n, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
2050
+ }
2051
+ },
2052
+ MetadataVisitor: class {
2053
+ visit(e, t, n) {
2054
+ let r = [], i = /* @__PURE__ */ new Map(), a = {
2055
+ cells: [],
2056
+ values: []
2057
+ }, o = t.childNodes;
2058
+ for (let e = 0; e < o.length; e++) {
2059
+ let t = o.item(e);
2060
+ if (t.nodeType === 1) switch (t.localName) {
2061
+ case "metadataTypes":
2062
+ this._parseMetadataTypes(t, r, i);
2063
+ break;
2064
+ case "futureMetadata":
2065
+ this._attachFutureMetadata(t, i);
2066
+ break;
2067
+ case "cellMetadata":
2068
+ this._resolveBlocks(t, r, a.cells);
2069
+ break;
2070
+ case "valueMetadata": this._resolveBlocks(t, r, a.values);
2071
+ }
2072
+ }
2073
+ return n.metadata = a, a;
2074
+ }
2075
+ _parseMetadataTypes(e, t, n) {
2076
+ let r = e.childNodes;
2077
+ for (let e = 0; e < r.length; e++) {
2078
+ let i = r.item(e);
2079
+ if (i.nodeType === 1 && i.localName === "metadataType") {
2080
+ let e = this._parseMetadataType(i);
2081
+ t.push(e), n.set(e.name, e);
2082
+ }
2083
+ }
2084
+ }
2085
+ _parseMetadataType(e) {
2086
+ let t = {
2087
+ name: e.getAttribute("name") ?? "",
2088
+ _blocks: []
2089
+ }, n = e.getAttribute("minSupportedVersion");
2090
+ n != null && (t.minSupportedVersion = Number(n));
2091
+ for (let n of [
2092
+ "copy",
2093
+ "pasteAll",
2094
+ "pasteValues",
2095
+ "merge",
2096
+ "splitFirst",
2097
+ "splitAll",
2098
+ "rowColShift",
2099
+ "clearFormats",
2100
+ "clearComments",
2101
+ "assign",
2102
+ "coerce",
2103
+ "cellMeta",
2104
+ "adjust",
2105
+ "trans",
2106
+ "delete",
2107
+ "edit"
2108
+ ]) e.getAttribute(n) === "1" && (t[n] = !0);
2109
+ return t;
2110
+ }
2111
+ _attachFutureMetadata(e, t) {
2112
+ let n = e.getAttribute("name") ?? "", r = t.get(n);
2113
+ if (!r) return;
2114
+ let i = e.childNodes;
2115
+ for (let e = 0; e < i.length; e++) {
2116
+ let t = i.item(e);
2117
+ t.nodeType === 1 && t.localName === "bk" && r._blocks.push(this._parseFutureBlock(t));
2118
+ }
2119
+ }
2120
+ _parseFutureBlock(e) {
2121
+ let t = {}, n = e.childNodes;
2122
+ for (let e = 0; e < n.length; e++) {
2123
+ let r = n.item(e);
2124
+ if (r.nodeType !== 1 || r.localName !== "extLst") continue;
2125
+ let i = r.childNodes;
2126
+ for (let e = 0; e < i.length; e++) {
2127
+ let n = i.item(e);
2128
+ if (n.nodeType !== 1 || n.localName !== "ext") continue;
2129
+ let r = n.childNodes;
2130
+ for (let e = 0; e < r.length; e++) {
2131
+ let n = r.item(e);
2132
+ n.nodeType === 1 && (n.localName === "dynamicArrayProperties" ? (t.fDynamic = n.getAttribute("fDynamic") === "1", t.fCollapsed = n.getAttribute("fCollapsed") === "1") : n.localName === "rvb" && (t.richValueIndex = Number(n.getAttribute("i") ?? "0")));
2133
+ }
2134
+ }
2135
+ }
2136
+ return t;
2137
+ }
2138
+ _resolveBlocks(e, t, n) {
2139
+ let r = e.childNodes;
2140
+ for (let e = 0; e < r.length; e++) {
2141
+ let i = r.item(e);
2142
+ i.nodeType === 1 && i.localName === "bk" && n.push(this._resolveBlock(i, t));
2143
+ }
2144
+ }
2145
+ _resolveBlock(e, t) {
2146
+ let n = /* @__PURE__ */ new Map(), r = e.childNodes;
2147
+ for (let e = 0; e < r.length; e++) {
2148
+ let i = r.item(e);
2149
+ if (i.nodeType !== 1 || i.localName !== "rc") continue;
2150
+ let a = Number(i.getAttribute("t")), o = Number(i.getAttribute("v")), s = t[a - 1];
2151
+ if (!s) continue;
2152
+ let { _blocks: c, ...l } = s, u = { ...l };
2153
+ for (let e of Object.keys(u)) u[e] === void 0 && delete u[e];
2154
+ let d = c[o];
2155
+ d && (d.fDynamic !== void 0 && (u.fDynamic = d.fDynamic, u.fCollapsed = d.fCollapsed ?? !1), d.richValueIndex !== void 0 && (u.richValueIndex = d.richValueIndex)), n.set(s.name, u);
2156
+ }
2157
+ return n;
2158
+ }
2159
+ },
2160
+ RichValueStructureVisitor: class {
2161
+ visit(e, t, n) {
2162
+ let r = e.getVisitorParamsState().get(X);
2163
+ r || (r = [], e.getVisitorParamsState().set(X, r));
2164
+ let i = t.childNodes, a = i.length;
2165
+ for (let t = 0; t < a; t++) {
2166
+ let n = i.item(t);
2167
+ if (n.nodeType === 1 && n.localName === "s") {
2168
+ let t = {
2169
+ type: n.getAttribute("t") ?? "n",
2170
+ keys: []
2171
+ };
2172
+ this.processKeys(e, n, t), r.push(t);
2173
+ }
2174
+ }
2175
+ return n.richTypes = r, r;
2176
+ }
2177
+ processKeys(e, t, n) {
2178
+ let r = t.childNodes, i = r.length, a = n.keys;
2179
+ for (let e = 0; e < i; e++) {
2180
+ let t = r.item(e);
2181
+ if (t.nodeType === 1 && t.localName === "k") {
2182
+ let e = t.getAttribute("n"), n = t.getAttribute("t");
2183
+ a.push([e, n]);
2184
+ }
2185
+ }
2186
+ }
2187
+ },
2188
+ RichValueDataVisitor: class {
2189
+ visit(e, t, n) {
2190
+ let r = e.getVisitorParamsState().get("richTypes");
2191
+ if (!r) return void e.warn("RichValueFound but not type.");
2192
+ let i = e.getVisitorParamsState().get(Z);
2193
+ i || (i = [], e.getVisitorParamsState().set(Z, i));
2194
+ let a = t.childNodes, o = a.length;
2195
+ for (let t = 0; t < o; t++) {
2196
+ let n = a.item(t);
2197
+ if (n.nodeType === 1 && n.localName === "rv") {
2198
+ let t = r[n.getAttribute("s")], a = { type: t.type };
2199
+ this.processValues(e, n, a, t);
2200
+ let o = this.mapType(e, a);
2201
+ i.push(o);
2202
+ }
2203
+ }
2204
+ return n.richData = i, i;
2205
+ }
2206
+ mapType(e, t) {
2207
+ if (t.type === "_error") {
2208
+ let e = t.errorType;
2209
+ if (e) try {
2210
+ t = T.getBuiltInByCode(e + 1) ?? T.BuiltIn.Unknown;
2211
+ } catch {}
2212
+ }
2213
+ return t;
2214
+ }
2215
+ processValues(e, t, n, r) {
2216
+ let i = t.childNodes, a = i.length;
2217
+ r.type;
2218
+ let o = r.keys;
2219
+ for (let t = 0; t < a; t++) {
2220
+ let r = i.item(t);
2221
+ if (r.nodeType === 1 && r.localName === "v") {
2222
+ let i = o[t];
2223
+ if (!i) return void e.warn("Invalid richData");
2224
+ let a = i[0], s = i[1], c = r.textContent;
2225
+ s === "i" && (c = Number(c)), n[a] = c;
2226
+ }
2227
+ }
2228
+ }
2229
+ },
2230
+ CommentsVisitor: class {
2231
+ visit(e, t, n) {
2232
+ if (!t) return;
2233
+ let r = [];
2234
+ this.processAuthors(e, e.evaluate("authors", t), r), r.length > 0 && (n.authors = r);
2235
+ let i = [];
2236
+ return n.comments = i, i;
2237
+ }
2238
+ processAuthors(e, t, n) {
2239
+ if (!t) return;
2240
+ let r = t.childNodes, i = r.length;
2241
+ for (let e = 0; e < i; e++) {
2242
+ let t = r.item(e);
2243
+ if (t.nodeType === 1 && t.localName === "author") {
2244
+ let e = t.firstChild;
2245
+ e && e.nodeType === 3 && n.push(e.textContent);
2246
+ }
2247
+ }
2248
+ }
2249
+ },
2250
+ CommentVisitor: class {
2251
+ visit(e, t, n) {
2252
+ if (!t) return;
2253
+ let r = t.getAttribute("ref");
2254
+ if (!r) return;
2255
+ let i = { content: "" };
2256
+ if (t.hasAttribute("authorId")) {
2257
+ let e = parseInt(t.getAttribute("authorId"), 10);
2258
+ isNaN(e) || (i.authorId = e);
2259
+ }
2260
+ return i.content = function(e) {
2261
+ if (!e) return "";
2262
+ let t = [], n = !0, r = e.childNodes;
2263
+ for (let e = 0; e < r.length; e++) {
2264
+ let i = r.item(e);
2265
+ if (i.nodeType === 1) {
2266
+ if (i.localName === "t") t.push({ text: i.textContent ?? "" });
2267
+ else if (i.localName === "r") {
2268
+ let e = { text: "" }, r = i.childNodes;
2269
+ for (let t = 0; t < r.length; t++) {
2270
+ let n = r.item(t);
2271
+ if (n.nodeType === 1) {
2272
+ if (n.localName === "t") e.text += n.textContent ?? "";
2273
+ else if (n.localName === "rPr") {
2274
+ let t = de(n);
2275
+ t && (e.font = t);
2276
+ }
2277
+ }
2278
+ }
2279
+ e.font && (n = !1), t.push(e);
2280
+ }
2281
+ }
2282
+ }
2283
+ return t.length === 0 ? e.textContent ?? "" : n ? t.map((e) => e.text).join("") : { runs: t };
2284
+ }(e.evaluate("text", t)), n.push({
2285
+ r,
2286
+ v: i
2287
+ }), i;
2288
+ }
2289
+ },
2290
+ ThreadedCommentsVisitor: class {
2291
+ visit(e, t, n) {
2292
+ if (!t) return;
2293
+ let r = [];
2294
+ return n.comments = r, r;
2295
+ }
2296
+ },
2297
+ ThreadedCommentVisitor: class {
2298
+ visit(e, t, n) {
2299
+ if (!t) return;
2300
+ let r = {};
2301
+ e.copyFromAttribute(t, "id", r, "id", x);
2302
+ let i = t.getAttribute("ref");
2303
+ e.copyFromAttribute(t, "personId", r, "personId", x), e.copyFromAttribute(t, "parentId", r, "parentId", x);
2304
+ let a = t.getAttribute("dT");
2305
+ a && (r.dt = function(e) {
2306
+ let t = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());
2307
+ if (!t) return e;
2308
+ let [, n, r, i] = t;
2309
+ return `${n}${r ? `.${(r + "00").substring(0, 3)}` : ""}${i ?? "Z"}`;
2310
+ }(a)), t.hasAttribute("done") && (r.done = b(t.getAttribute("done")));
2311
+ let o = function(e) {
2312
+ let t, n = e.childNodes;
2313
+ for (let e = 0; e < n.length; e++) {
2314
+ let r = n.item(e);
2315
+ if (r.nodeType !== 1 || r.localName !== "mentions") continue;
2316
+ let i = r.childNodes;
2317
+ for (let e = 0; e < i.length; e++) {
2318
+ let n = i.item(e);
2319
+ if (n.nodeType !== 1 || n.localName !== "mention") continue;
2320
+ let r = n.getAttribute("mentionId"), a = n.getAttribute("mentionpersonId");
2321
+ if (!r || !a) continue;
2322
+ let o = {
2323
+ id: x(r),
2324
+ personId: x(a)
2325
+ }, s = parseInt(n.getAttribute("startIndex") ?? "", 10);
2326
+ isNaN(s) || (o.startIndex = s);
2327
+ let c = parseInt(n.getAttribute("length") ?? "", 10);
2328
+ isNaN(c) || (o.length = c), (t ??= []).push(o);
2329
+ }
2330
+ }
2331
+ return t;
2332
+ }(t);
2333
+ return o && (r.mentions = o), n.push({
2334
+ r: i,
2335
+ v: r
2336
+ }), r;
2337
+ }
2338
+ },
2339
+ PersonListVisitor: class {
2340
+ visit(e, t, n) {
2341
+ let r = [], i = t.childNodes, a = i.length;
2342
+ for (let t = 0; t < a; t++) {
2343
+ let n = i.item(t);
2344
+ if (n.nodeType === 1 && n.localName === "person") {
2345
+ 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);
2347
+ }
2348
+ }
2349
+ return r.length > 0 && (n.persons = r), r;
2350
+ }
2351
+ }
2352
+ }, fe = class {
2353
+ constructor(e, t) {
2354
+ this.path = e, this.visitor = t;
2355
+ }
2356
+ }, pe = class {
2357
+ 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());
2359
+ }
2360
+ registerVisitor(e, t, n = null) {
2361
+ e.indexOf(":") === -1 && (e = "*:" + e);
2362
+ let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
2363
+ if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
2364
+ 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));
2366
+ }
2367
+ parseDxf(e, t = "", n = C.EmptyObject) {
2368
+ this.visitorParamsState ||= /* @__PURE__ */ new Map();
2369
+ let r = this.visitorParamsState, i = r.get("processingDXFs");
2370
+ r.set("processingDXFs", !0);
2371
+ try {
2372
+ let r = new L(null, this, "/dxf", e, {}, t, n), i = {};
2373
+ return new $.SheetStyleVisitor().processDXF(r, e, i), i;
2374
+ } finally {
2375
+ i === void 0 ? r.delete("processingDXFs") : r.set("processingDXFs", i);
2376
+ }
2377
+ }
2378
+ getVisitorParamsState() {
2379
+ return this.visitorParamsState;
2380
+ }
2381
+ transform(e, t, n = C.EmptyObject) {
2382
+ let r = e.documentElement;
2383
+ this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
2384
+ let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
2385
+ 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 = [];
2387
+ this._doWalk(a, s, c, r, i, t, n);
2388
+ let l = c.length;
2389
+ for (let e = 0; e < l; e++) {
2390
+ let t = c[e];
2391
+ try {
2392
+ t.visitor?.afterVisit?.(t.context, t.elemParent, t.jsonParent);
2393
+ } catch (e) {
2394
+ t.context.warn(`Unable to finish reading '${t.context.getPath()}': ${e?.message ?? e}`, { onceKey: "xlsx.transform.afterVisit" });
2395
+ }
2396
+ }
2397
+ return i;
2398
+ }
2399
+ _walkScoped(e, t, n, r, i, a, o) {
2400
+ let s = this.scopedVisitorsByXmlTagName.get(e), c = s ? s.length : 0;
2401
+ for (let l = 0; l < c; l++) {
2402
+ let c = s[l], u = null;
2403
+ try {
2404
+ u = t.evaluate(c.path, r);
2405
+ } catch {
2406
+ t.warn(`Invalid path '${c.path}' for '${e}'.`, { onceKey: "xlsx.transform.invalidPath" });
2407
+ }
2408
+ if (!u) continue;
2409
+ let d = (e) => {
2410
+ let s = e.localName, l = e.parentNode;
2411
+ for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
2412
+ let u = t.getPath() + "/" + s;
2413
+ if (c.visitor) {
2414
+ let r = new L(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
2415
+ this._doWalk(c.visitor, r, n, e, i, a, o);
2416
+ }
2417
+ };
2418
+ if (u.length > 0) {
2419
+ let e = u, t = e.length;
2420
+ for (let n = 0; n < t; n++) d(e.item(n));
2421
+ } else d(u);
2422
+ }
2423
+ }
2424
+ _doWalk(e, t, n, r, i, a, o) {
2425
+ let s = null;
2426
+ e && (n.push({
2427
+ visitor: e,
2428
+ context: t,
2429
+ elemParent: r,
2430
+ jsonParent: i
2431
+ }), s = e.visit(t, r, i)), s ||= i;
2432
+ let c = r.localName;
2433
+ this._walkScoped(c, t, n, r, s, a, o);
2434
+ let l = this.visitorsByXmlTagName, u = t.getElemRoot(), d = t.getJsonRoot(), f = r.childNodes, p = f.length;
2435
+ for (let e = 0; e < p; e++) {
2436
+ let r = f.item(e);
2437
+ if (r.nodeType !== 1) continue;
2438
+ let c = r, p = c.nodeName, m = l.get(p);
2439
+ m ||= (p = c.localName, l.get(p));
2440
+ let h = t.getPath() + "/" + p, g = new L(t, this, h, u, d, a, o);
2441
+ this._doWalk(m, g, n, c, s ?? i, a, o);
2442
+ }
2443
+ return s;
2444
+ }
2445
+ };
2446
+ export { pe as DOMTransformer, L as ExecutionContext, m as NumberUtils, e as VisitorUtils };