@sheetxl/io-xlsx 0.8.0-beta.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/7rZlWcm56hn3Jmnk.mjs +7021 -0
  3. package/browser/esm/AZus_5slvoIVhf1u.mjs +10323 -0
  4. package/browser/esm/B9QfzGvsvg-V3utu.mjs +4632 -0
  5. package/browser/esm/{C-2KaUyV4gs-sDTZ.mjs → BIR_Si489gIkGOnc.mjs} +194 -144
  6. package/browser/esm/{DsSIg46AR7IFBN5N.mjs → BJFvc-i40R4rPZ5y.mjs} +939 -804
  7. package/browser/esm/{D-epcZSoKLbsAIaC.mjs → BX8Ebx4NC5zp7_3J.mjs} +3 -3
  8. package/browser/esm/{CxtFawTfwRTCC4Xr.mjs → Bnxw38IvtA04zXEE.mjs} +2 -2
  9. package/browser/esm/CfVhYH77KdrR3fEK.mjs +24 -0
  10. package/browser/esm/index.mjs +3 -4
  11. package/browser/esm/jIQks3Crw6jehdDU.mjs +2474 -0
  12. package/browser/esm/{CRrTMRdN_IcSA_pm.mjs → qc9hnuR2z-whY8YO.mjs} +3 -3
  13. package/browser/esm/wZGpmkMUubNjClhG.mjs +104 -0
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{BsTMtvwpQoPNv95M.mjs → BNLHWJHyy5eB0P_4.mjs} +2 -2
  16. package/node/esm/CVtsY2F9A9NzEGLk.mjs +2478 -0
  17. package/node/esm/CoeQ0LO-nNXiowwv.mjs +7284 -0
  18. package/node/esm/CxY3iIYLXVhCebeV.mjs +4746 -0
  19. package/node/esm/D2CZy9TQM9h2uqBh.mjs +2562 -0
  20. package/node/esm/{BCr4lCI6qQXXN0K1.mjs → Dm0hvKcR4xb0TV_N.mjs} +3 -3
  21. package/node/esm/_IA1gQ-zFQYQSZSs.mjs +6957 -0
  22. package/node/esm/index.mjs +65 -28
  23. package/node/esm/{CBtj0-a4l2qux2hA.mjs → zZFe3mW0xjmobowq.mjs} +3 -3
  24. package/package.json +9 -10
  25. package/types/src/AutoFilterRules.d.ts +34 -44
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +24 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  80. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  81. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -11
  82. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +8 -1
  83. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  84. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +13 -6
  85. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  86. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +10 -7
  87. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +22 -13
  88. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +5 -5
  89. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +4 -2
  90. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  91. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  92. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  93. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  94. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  95. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  96. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  97. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  98. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  99. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  101. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  102. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  103. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  104. package/types/src/reader/domVisitors/index.d.ts +6 -34
  105. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  106. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  107. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  108. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  109. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  110. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  111. package/types/src/richValue/RichDataParts.d.ts +69 -0
  112. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  113. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  114. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  115. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  116. package/types/src/richValue/index.d.ts +7 -0
  117. package/types/src/utils/DrawingMLText.d.ts +2 -2
  118. package/types/src/utils/FormControls.d.ts +79 -6
  119. package/types/src/utils/SharedNames.d.ts +13 -0
  120. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  121. package/types/src/utils/VmlNoteShapes.d.ts +25 -32
  122. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  123. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  124. package/types/src/vba/VBAProject.d.ts +0 -19
  125. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  126. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  127. package/types/src/writer/builder/PackageBuilder.d.ts +2 -41
  128. package/types/src/writer/builder/Types.d.ts +18 -28
  129. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  130. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  131. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  132. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  133. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  134. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  135. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  136. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  137. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  138. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  139. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  140. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  141. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  142. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  143. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  144. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  145. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  146. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  147. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  148. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  149. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  150. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  151. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  152. package/types/src/writer/utils/DrawMLUtils.d.ts +8 -6
  153. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  154. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  155. package/types/src/writer/utils/PrstGeomUtils.d.ts +11 -3
  156. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  157. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  158. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  159. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  160. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  161. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +0 -1
  162. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  163. package/browser/cjs/BHM3_D9PsNURVAVy.cjs +0 -1
  164. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +0 -6
  165. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +0 -2
  166. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  167. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +0 -30
  168. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +0 -1
  169. package/browser/cjs/index.cjs +0 -1
  170. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +0 -6
  171. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  172. package/browser/esm/Bu64BYvRAlVftMr1.mjs +0 -67
  173. package/browser/esm/CWt4fDYEbj2hvsl_.mjs +0 -3346
  174. package/browser/esm/Ccnxz-y2WBEgfvvh.mjs +0 -6498
  175. package/browser/esm/Dx64JMAGwNNDBkC1.mjs +0 -4928
  176. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +0 -149
  177. package/node/esm/BPn5XBizKkwaUqXB.mjs +0 -4285
  178. package/node/esm/BVV11IlqF6Lmlv8D.mjs +0 -154
  179. package/node/esm/BiJEEgltJzx94zIR.mjs +0 -3433
  180. package/node/esm/CkmZuMvRTpva7eQu.mjs +0 -5074
  181. package/node/esm/j0RE2usgdljRw_gr.mjs +0 -2345
  182. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  183. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  184. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  185. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  186. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  187. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  188. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  189. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  190. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  191. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  192. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  193. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  194. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  195. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  196. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  197. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  198. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  199. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  200. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  201. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  202. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  203. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  204. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  205. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -0,0 +1,2478 @@
1
+ /**
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
+ */
7
+ import { $n as t, A as e, Ar as o, B as s, Ct as r, Dt as i, F as n, Ht as l, I as a, L as u, M as d, N as h, Nt as p, P as m, R as f, Sr as g, St as b, Tt as y, Ut as A, V as v, Wt as N, bt as F, dn as C, er as S, fn as x, gt as T, in as w, j as P, jr as I, jt as k, k as O, mn as V, r as _, rn as B, t as D, v as E, vt as R, wt as j, xt as Y, yn as X, z as M } from "./_IA1gQ-zFQYQSZSs.mjs";
8
+ import { a as z, i as G, n as W, r as $ } from "./CxY3iIYLXVhCebeV.mjs";
9
+ import { c as H, l as U, o as K, r as q, s as J } from "./D2CZy9TQM9h2uqBh.mjs";
10
+ import { CommonUtils as Z } from "@sheetxl/utils";
11
+ import { AddressUtils as Q, FormulaError as tt, IBorders as et, ICellStyle as ot, ICondition as st, IFill as rt, IFont as it, IRange as nt, IShape as lt, ISlicerStyle as at, ITextFrame as ct, ShapeStyleUtils as ut, Sort as dt, Tuple as ht } from "@sheetxl/sdk";
12
+ var pt = class {
13
+ constructor(t) {
14
+ this.list = t;
15
+ }
16
+ get length() {
17
+ return this.list.length;
18
+ }
19
+ item(t) {
20
+ return this.list[t];
21
+ }
22
+ forEach(t, e) {
23
+ const o = this.list, s = o.length;
24
+ for (let e = 0; e < s; e++) t(o[e], e, this);
25
+ }
26
+ entries() {
27
+ return this.list.entries();
28
+ }
29
+ keys() {
30
+ return this.list.keys();
31
+ }
32
+ values() {
33
+ return this.list.values();
34
+ }
35
+ [Symbol.iterator]() {
36
+ return this.list.values();
37
+ }
38
+ }, mt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, ft = (t) => {
39
+ const e = parseInt(t);
40
+ return isNaN(e) ? null : e;
41
+ }, gt = (t) => {
42
+ const e = parseFloat(t);
43
+ return isNaN(e) ? null : e;
44
+ }, bt = /* @__PURE__ */ new Map(), yt = class {
45
+ constructor(t, e, o, s, r, i = null, n = Z.EmptyObject) {
46
+ this._fileLocation = "";
47
+ const l = (t, e, o) => n?.getRef?.(t, e, o, n?.parsedRefs), a = (t) => n?.getRefs?.(t, n?.parsedRefs);
48
+ this._parent = t, this.sharedShared = e, this.currentPath = o, this.elemRoot = s, this.jsonRoot = r, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs, this._serializeElement = t._serializeElement, this._readEmbeddedPart = t._readEmbeddedPart) : (i && (this._fileLocation = i), n?.getRef && (this._getRef = l), n?.getRefs && (this._getRefs = a), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson, this._serializeElement = n?.serializeElement, this._readEmbeddedPart = n?.readEmbeddedPart);
49
+ }
50
+ getRef(t, e = !1) {
51
+ return this._getRef?.(t, this._fileLocation, e) ?? null;
52
+ }
53
+ readEmbeddedPart(t) {
54
+ return this._readEmbeddedPart?.(t, this._fileLocation) ?? null;
55
+ }
56
+ getRelationships() {
57
+ return this._getRefs?.(this._fileLocation) ?? bt;
58
+ }
59
+ getPath() {
60
+ return this.currentPath;
61
+ }
62
+ getFileLocation() {
63
+ return this._fileLocation;
64
+ }
65
+ getElemRoot() {
66
+ return this.elemRoot;
67
+ }
68
+ getJsonRoot() {
69
+ return this.jsonRoot;
70
+ }
71
+ warn(t, e) {
72
+ this._raiseWarning(t, this.getFileLocation(), e?.onceKey);
73
+ }
74
+ _raiseWarning(t, e, o) {
75
+ this._onWarning ? this._onWarning(t, e, o) : this._parent ? this._parent._raiseWarning(t, e, o) : console.warn(t);
76
+ }
77
+ serializeElement(t) {
78
+ return this._serializeElement?.(t) ?? null;
79
+ }
80
+ addPerson(t) {
81
+ return "string" == typeof t && (t = { displayName: t }), this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) ?? null : null;
82
+ }
83
+ getVisitorParamsState() {
84
+ return this.sharedShared.getVisitorParamsState();
85
+ }
86
+ evaluate(t, e) {
87
+ if (!t) return e;
88
+ let o = [e];
89
+ const s = t.split("/"), r = s.length;
90
+ for (let t = 0; t < r; t++) {
91
+ const e = s[t];
92
+ if ("" === e || "." === e) continue;
93
+ const i = [], n = ("*" === e || "**" === e) && !(t === r - 1);
94
+ for (const r of o) if (r) if (n) {
95
+ const e = s[t + 1];
96
+ e && "" !== e && "." !== e && (this._findDescendants(r, e, i), t++);
97
+ } else if ("*" === e || "**" === e) {
98
+ if (!r.childNodes) continue;
99
+ const t = r.childNodes, e = t.length;
100
+ for (let o = 0; o < e; o++) {
101
+ const e = t[o];
102
+ 1 === e.nodeType && i.push(e);
103
+ }
104
+ } else {
105
+ if (!r.childNodes) continue;
106
+ const t = r.childNodes, o = t.length;
107
+ for (let s = 0; s < o; s++) {
108
+ const o = t[s];
109
+ if (1 !== o.nodeType) continue;
110
+ const r = o;
111
+ this._matchesElementName(r, e) && i.push(r);
112
+ }
113
+ }
114
+ if (o = i, 0 === o.length) return null;
115
+ }
116
+ return 1 === o.length ? o[0] : 0 === o.length ? null : new pt(o);
117
+ }
118
+ _matchesElementName(t, e) {
119
+ return e.includes(":") ? (t.tagName || t.nodeName) === e : t.localName === e;
120
+ }
121
+ _findDescendants(t, e, o) {
122
+ if (!t || !t.childNodes) return;
123
+ const s = t.childNodes, r = s.length;
124
+ for (let t = 0; t < r; t++) {
125
+ const r = s[t];
126
+ if (1 !== r.nodeType) continue;
127
+ const i = r;
128
+ this._matchesElementName(i, e) && o.push(i), this._findDescendants(i, e, o);
129
+ }
130
+ }
131
+ getFromPath(t, e) {
132
+ return Z.getFromPath(t, e);
133
+ }
134
+ setToPath(t, e, o) {
135
+ return Z.setToPath(t, e, o);
136
+ }
137
+ getValAttrAsString(t, e) {
138
+ let o = this.evaluate(t, e);
139
+ return o && o.hasAttribute("val") ? o.getAttribute("val") ?? null : null;
140
+ }
141
+ getValAttrAsBoolean(t, e, o = !1) {
142
+ let s = this.evaluate(t, e);
143
+ if (!s) return null;
144
+ const r = s.hasAttribute("val") ? s.getAttribute("val") : void 0;
145
+ return null == r ? o : "1" === r || "on" === r || "true" === r || "0" !== r && "off" !== r && "false" !== r && o;
146
+ }
147
+ getValAttrAsInteger(t, e) {
148
+ let o = this.evaluate(t, e);
149
+ return o && o.hasAttribute("val") ? parseInt(o.getAttribute("val")) ?? null : null;
150
+ }
151
+ getValAttrAsFloat(t, e) {
152
+ let o = this.evaluate(t, e);
153
+ return o && o.hasAttribute("val") ? parseFloat(o.getAttribute("val")) ?? null : null;
154
+ }
155
+ get BOOLEAN_COPY() {
156
+ return mt;
157
+ }
158
+ get INT_COPY() {
159
+ return ft;
160
+ }
161
+ get FLOAT_COPY() {
162
+ return gt;
163
+ }
164
+ copyFromAttribute(t, e, o, s = e, r = null) {
165
+ if (!t || !o || !t.hasAttribute(e)) return;
166
+ let i = t.getAttribute(e);
167
+ if (r) if (Array.isArray(r)) {
168
+ const t = r.length;
169
+ for (let e = 0; e < t; e++) {
170
+ if (null == i) return;
171
+ if (i = r[e](i), null == i) return;
172
+ }
173
+ } else {
174
+ if (null == i) return;
175
+ if (i = r(i), null == i) return;
176
+ }
177
+ this.setToPath(o, s, i);
178
+ }
179
+ }, At = (t, e) => {
180
+ const o = [], s = t.childNodes, r = s.length;
181
+ for (let t = 0; t < r; t++) {
182
+ const r = s.item(t);
183
+ 1 === r.nodeType && r.localName === e && o.push(r);
184
+ }
185
+ return o;
186
+ }, vt = [
187
+ ["fillRef", "fill"],
188
+ ["lnRef", "stroke"],
189
+ ["effectRef", "effect"]
190
+ ], Nt = (t, e) => {
191
+ const o = new m(), s = {};
192
+ for (const [r, i] of vt) {
193
+ const n = t.evaluate(r, e);
194
+ if (!n) continue;
195
+ const l = { index: parseInt(n.getAttribute("idx") ?? "0", 10) || 0 }, a = o.processAdjColor(t, n);
196
+ a && (l.color = a), s[i] = l;
197
+ }
198
+ const r = t.evaluate("fontRef", e);
199
+ if (r) {
200
+ const e = { index: r.getAttribute("idx") ?? "none" }, i = o.processAdjColor(t, r);
201
+ i && (e.color = i), s.font = e;
202
+ }
203
+ return s;
204
+ }, Ft = class {
205
+ visit(t, e, o) {
206
+ if (!e) return;
207
+ let s = t.evaluate("*/cNvPr", e);
208
+ return s.item && (s = s.item(0)), s && (t.copyFromAttribute(s, "name", o), t.copyFromAttribute(s, "descr", o, "description"), t.copyFromAttribute(s, "hidden", o, "hidden", t.BOOLEAN_COPY), this.readNonVisualDetails(t, s, o), t.copyFromAttribute(s, "id", o)), o;
209
+ }
210
+ readNonVisualDetails(t, e, o) {
211
+ e.hasAttribute("title") && (o.title = e.getAttribute("title"));
212
+ const s = t.evaluate("hlinkClick", e);
213
+ s && (o.hyperlink = d(t, s));
214
+ const r = t.evaluate("hlinkHover", e);
215
+ r && (o.hoverHyperlink = d(t, r));
216
+ const i = t.evaluate("extLst", e), n = i ? t.serializeElement(i) : null;
217
+ n && (o.extLst = {
218
+ ...o.extLst,
219
+ nonVisual: n
220
+ });
221
+ }
222
+ setContent(t, e) {
223
+ const o = t;
224
+ void 0 !== o.name && (e.name = o.name, delete o.name), void 0 !== o.description && (e.description = o.description, delete o.description);
225
+ for (const t of [
226
+ "title",
227
+ "hyperlink",
228
+ "hoverHyperlink",
229
+ "extLst"
230
+ ]) void 0 !== o[t] && (e.json && (e.json[t] = o[t]), delete o[t]);
231
+ t.content = e;
232
+ }
233
+ isGroupContent(t) {
234
+ return Array.isArray(t?.members);
235
+ }
236
+ readMemberHeader(t, e, o) {
237
+ const s = {}, r = {
238
+ anchor: void 0,
239
+ content: {
240
+ type: o,
241
+ json: s
242
+ }
243
+ };
244
+ let i = t.evaluate("*/cNvPr", e);
245
+ if (i?.item && (i = i.item(0)), i) {
246
+ const o = i.getAttribute("name");
247
+ null !== o && (r.content.name = o);
248
+ const n = i.getAttribute("descr");
249
+ n && (r.content.description = n), t.copyFromAttribute(i, "hidden", r, "hidden", t.BOOLEAN_COPY), this.readNonVisualDetails(t, i, s);
250
+ const l = this.readSourceId(t, e);
251
+ void 0 !== l && (s.sourceId = l);
252
+ }
253
+ return {
254
+ movable: r,
255
+ content: s
256
+ };
257
+ }
258
+ readStyleRefs(t, e, o) {
259
+ const s = t.evaluate("style", e);
260
+ if (!s) return void (o.style = null);
261
+ const r = Nt(t, s), i = ut.withoutDefaultStyleRefs({
262
+ ...o,
263
+ style: r
264
+ });
265
+ i && (o.style = i);
266
+ }
267
+ readLocks(t) {
268
+ const e = t?.attributes;
269
+ if (!e || 0 === e.length) return;
270
+ const o = {};
271
+ for (let t = 0; t < e.length; t++) {
272
+ const s = e.item(t);
273
+ s.name.startsWith("xmlns") || (o[s.localName ?? s.name] = A(s.value));
274
+ }
275
+ return Object.keys(o).length > 0 ? o : void 0;
276
+ }
277
+ readSourceId(t, e) {
278
+ let o = t.evaluate("*/cNvPr", e);
279
+ o?.item && (o = o.item(0));
280
+ const s = o?.getAttribute?.("id"), r = s ? parseInt(s, 10) : void 0;
281
+ return void 0 === r || isNaN(r) ? void 0 : r;
282
+ }
283
+ }, Ct = [
284
+ ["spDef", "shape"],
285
+ ["lnDef", "line"],
286
+ ["txDef", "text"]
287
+ ], St = (t, e) => {
288
+ const o = e.getAttribute("dxfId");
289
+ if (null === o) return;
290
+ const s = parseInt(o);
291
+ return t.getVisitorParamsState().get("dxfs")?.get(s) || (t.warn(`A color filter or sort names a format that does not exist (dxfId '${o}').`), {});
292
+ }, xt = (t) => "1" === t || "true" === t, Tt = class {
293
+ visit(t, e, o) {}
294
+ processDataBarColor(e, o, s, r, i = "auto") {
295
+ if (!o) return;
296
+ const n = t((t) => o.getAttribute(t), i);
297
+ return n && (s[r] = n), s;
298
+ }
299
+ processFonts(t, e, o) {
300
+ if (!e) return;
301
+ const s = e.childNodes;
302
+ let r = 0;
303
+ const i = s.length;
304
+ for (let e = 0; e < i; e++) {
305
+ const i = s.item(e);
306
+ if (1 === i.nodeType && "font" === i.localName) {
307
+ const e = {};
308
+ this.processFont(t, i, e), o[r++] = e;
309
+ }
310
+ }
311
+ return o;
312
+ }
313
+ processFont(t, e, o) {
314
+ t.getValAttrAsBoolean("b", e, !0) && (o.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (o.style = it.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (o.strike = j(!0));
315
+ const i = t.evaluate("u", e);
316
+ if (i) {
317
+ const t = i.getAttribute("val");
318
+ o.underline = y(t);
319
+ }
320
+ const n = Y(t.evaluate("vertAlign", e)?.getAttribute("val"));
321
+ void 0 !== n && (o.baseline = n), f(t, e, o, "sz", "size");
322
+ const l = t.evaluate("color", e);
323
+ this.processDataBarColor(t, l, o, "color"), o.color || (o.color = "auto"), s(t, e, o, "name", "family"), s(t, e, o, "rFont", "family");
324
+ const a = t.evaluate("family", e);
325
+ if (a) {
326
+ const t = a.getAttribute("val");
327
+ if (t) switch (t) {
328
+ case "1":
329
+ o.fallbacks = ["serif"];
330
+ break;
331
+ case "2":
332
+ o.fallbacks = ["sans-serif"];
333
+ break;
334
+ case "3":
335
+ o.fallbacks = ["monospace"];
336
+ break;
337
+ case "4":
338
+ o.fallbacks = ["cursive"];
339
+ break;
340
+ case "5": o.fallbacks = ["fantasy"];
341
+ }
342
+ }
343
+ b(o, t.evaluate("scheme", e)?.getAttribute("val")), u(t, e, o, "shadow", "shadow", !0), u(t, e, o, "outline", "outline", !0);
344
+ for (const s of ["condense", "extend"]) {
345
+ const i = r(s, !!t.getValAttrAsBoolean(s, e, !0));
346
+ void 0 !== i && (o.letterSpacing = i);
347
+ }
348
+ return M(t, e, o, "charset", "charset"), o;
349
+ }
350
+ processFills(t, e, o) {
351
+ if (!e) return;
352
+ const s = e.childNodes;
353
+ let r = 0;
354
+ const i = s.length;
355
+ for (let e = 0; e < i; e++) {
356
+ const i = s.item(e);
357
+ 1 === i.nodeType && "fill" === i.localName && this.processFill(t, i, o, r++);
358
+ }
359
+ return o;
360
+ }
361
+ processFill(t, e, o, s) {
362
+ const r = { type: rt.Type.None }, i = e.childNodes;
363
+ let n = !1;
364
+ const l = i.length;
365
+ for (let e = 0; !n && e < l; e++) {
366
+ const o = i.item(e);
367
+ 1 === o.nodeType && ("gradientFill" === o.localName ? (this.processGradientFill(t, o, r), n = !0) : "patternFill" === o.localName && (this.processPatternFill(t, o, r), n = !0));
368
+ }
369
+ return o[s] = r, o;
370
+ }
371
+ processGradientFill(t, e, o) {
372
+ if (!e) return;
373
+ o.type = rt.Type.Gradient;
374
+ const s = [];
375
+ o.stops = s;
376
+ const r = e.getAttribute("type");
377
+ r && (o.gradientType = r);
378
+ const i = e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0;
379
+ (i + 90) % 360 != 0 && (o.angle = (i + 90) % 360), (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (o.focus = {
380
+ left: wt(e.getAttribute("left")),
381
+ top: wt(e.getAttribute("top")),
382
+ right: wt(e.getAttribute("right")),
383
+ bottom: wt(e.getAttribute("bottom"))
384
+ });
385
+ const n = e.childNodes, l = n.length;
386
+ for (let e = 0; e < l; e++) {
387
+ const o = n.item(e);
388
+ if (1 === o.nodeType && "stop" === o.localName) {
389
+ const e = {};
390
+ s.push(e), e.offset = parseFloat(o.getAttribute("position") ?? "");
391
+ const r = t.evaluate("color", o);
392
+ this.processDataBarColor(t, r, e, "color");
393
+ }
394
+ }
395
+ return o;
396
+ }
397
+ processPatternFill(t, e, o) {
398
+ if (!e) return;
399
+ const s = t.getVisitorParamsState().get("processingDXFs"), r = e.getAttribute("patternType") || (s ? rt.BuiltInSheetPattern.Solid : rt.BuiltInSheetPattern.None);
400
+ if (r === rt.BuiltInSheetPattern.None) return { none: !0 };
401
+ o.type = rt.Type.Pattern, r && (o.patternType = r);
402
+ let i = "foreground", n = "background";
403
+ const l = o.patternType === rt.BuiltInSheetPattern.Solid && s;
404
+ if (l) {
405
+ const t = i;
406
+ i = n, n = t;
407
+ }
408
+ const a = t.evaluate("fgColor", e);
409
+ this.processDataBarColor(t, a, o, i, "dk1");
410
+ const c = t.evaluate("bgColor", e);
411
+ return this.processDataBarColor(t, c, o, n, "lt1"), l && (o.foreground || (o.foreground = "lt1"), o.background || (o.background = "dk1")), o;
412
+ }
413
+ processBorders(t, e, o, s) {
414
+ if (!e) return;
415
+ const r = e.childNodes;
416
+ let i = 0;
417
+ const n = r.length;
418
+ for (let e = 0; e < n; e++) {
419
+ const n = r.item(e);
420
+ 1 === n.nodeType && "border" === n.localName && this.processBorder(t, n, o, i++, s);
421
+ }
422
+ return o;
423
+ }
424
+ processBorder(t, e, o, s, r) {
425
+ if (!e) return;
426
+ const i = {};
427
+ this.processBorderStroke(t, e, i, et.Edge.Left), this.processBorderStroke(t, e, i, et.Edge.Right), r ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, et.Edge.Vertical), this.processBorderStroke(t, e, i, et.Edge.Top), this.processBorderStroke(t, e, i, et.Edge.Bottom), r ? (i.bottom || i.top) && (i.bottom ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, et.Edge.Horizontal);
428
+ const n = this.processBorderStroke(t, e, {}, "diagonal");
429
+ return n && (xt(e.getAttribute("diagonalUp")) && (i.diagonalUp = { ...n }), xt(e.getAttribute("diagonalDown")) && (i.diagonalDown = { ...n })), o[s] = i, o;
430
+ }
431
+ processBorderStroke(t, e, o, s) {
432
+ if (!e) return;
433
+ const r = t.evaluate(s, e);
434
+ if (!r) return;
435
+ const i = {};
436
+ r.hasAttribute("style") ? i.style = r.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style = et.StrokeStyle.None);
437
+ const n = t.evaluate("color", r);
438
+ return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? o[s] = i : null;
439
+ }
440
+ }, wt = (t) => {
441
+ if (!t) return 0;
442
+ const e = parseFloat(t);
443
+ return isNaN(e) ? 0 : e;
444
+ }, Pt = (t, e) => {
445
+ if (!t || 1 !== t.nodeType) return null;
446
+ const o = t.childNodes;
447
+ for (let t = 0; t < o.length; t++) {
448
+ const s = o.item(t);
449
+ if (1 === s.nodeType && s.localName === e) return s;
450
+ }
451
+ return null;
452
+ }, It = new Set(Object.values(at.ElementType).filter((t) => t !== at.ElementType.WholeTable && t !== at.ElementType.HeaderRow)), kt = {
453
+ auto: "auto",
454
+ autoNoTable: "automaticExceptTables",
455
+ manual: "manual"
456
+ }, Ot = [
457
+ "tableId",
458
+ "columnId",
459
+ "cacheName",
460
+ "cachePath",
461
+ "sourceName",
462
+ "sortOrder",
463
+ "customListSort",
464
+ "crossFilter",
465
+ "pivotTables",
466
+ "pivotCacheId",
467
+ "pivotBody",
468
+ "tabular",
469
+ "pivotData",
470
+ "showMissing"
471
+ ], Vt = /* @__PURE__ */ new Set([
472
+ "name",
473
+ "xr10:uid",
474
+ "cache",
475
+ "caption"
476
+ ]), _t = (t, e) => {
477
+ const o = t.content, s = o?.json;
478
+ if (s) {
479
+ if ("shape" === o.type || "picture" === o.type) {
480
+ const { rotation: o, flipH: r, flipV: i, bounds: n } = s;
481
+ delete s.rotation, delete s.flipH, delete s.flipV, delete s.bounds, void 0 !== o && 0 !== o && (t.rotation = o), r && (t.flipH = !0), i && (t.flipV = !0), e && n && (t.anchor = {
482
+ tl: {
483
+ x: n.x,
484
+ y: n.y
485
+ },
486
+ br: {
487
+ x: n.width,
488
+ y: n.height
489
+ }
490
+ });
491
+ }
492
+ if ("group" === o.type) for (const t of s.members ?? []) _t(t, !0);
493
+ }
494
+ }, Bt = class extends Ft {
495
+ visit(t, e, o) {
496
+ if (e) return this.visitShape(t, e, o, "sp", "nvSpPr/cNvSpPr/spLocks");
497
+ }
498
+ visitShape(t, o, s, r, i) {
499
+ const n = v[r];
500
+ if (this.isGroupContent(s)) {
501
+ if (t.getPath().includes("Fallback")) return {};
502
+ const { movable: e, content: l } = this.readMemberHeader(t, o, "shape");
503
+ n !== lt.Type.Shape && (l.type = n), this.readShapeDetails(t, o, r, i, l), this.readStyleRefs(t, o, l);
504
+ const a = t.evaluate(i, o);
505
+ a?.hasAttribute?.("noChangeAspect") && (e.lockAspect = "1" === a.getAttribute("noChangeAspect"));
506
+ const c = this.readTwinOf(t, o);
507
+ return void 0 !== c && Object.assign(l, { twinOf: c }), s.members.push(e), l;
508
+ }
509
+ if (t.getPath().includes("Fallback") && s.content) {
510
+ const r = s.content.json;
511
+ if ("shape" === s.content.type && r && (r.type ?? lt.Type.Shape) === n) {
512
+ const s = t.evaluate("txBody", o), i = s ? new O().readTextBody(t, s) : null;
513
+ i && "" !== e(i) && (r.text = i);
514
+ }
515
+ return {};
516
+ }
517
+ s = super.visit(t, o, s);
518
+ const l = t.evaluate(i, o);
519
+ l?.hasAttribute?.("noChangeAspect") && (s.lockAspect = "1" === l.getAttribute("noChangeAspect"));
520
+ const a = n === lt.Type.Shape ? {} : { type: n }, c = this.readSourceId(t, o);
521
+ void 0 !== c && (a.sourceId = c), this.readShapeDetails(t, o, r, i, a), this.readStyleRefs(t, o, a);
522
+ const u = this.readTwinOf(t, o);
523
+ return void 0 !== u && Object.assign(a, { twinOf: u }), this.setContent(s, {
524
+ type: "shape",
525
+ json: a
526
+ }), a;
527
+ }
528
+ readTwinOf(t, e) {
529
+ let o = t.evaluate("*/cNvPr/extLst/ext/compatExt", e);
530
+ o?.item && (o = o.item(0));
531
+ const s = /^_x0000_s(\d+)$/.exec(o?.getAttribute?.("spid") ?? "");
532
+ return s ? parseInt(s[1], 10) : void 0;
533
+ }
534
+ readShapeDetails(t, e, o, s, r) {
535
+ const i = e.getAttribute("macro");
536
+ i && (r.macro = i);
537
+ const n = e.getAttribute("textlink");
538
+ n && (r.textLink = n), e.hasAttribute("fLocksText") && (r.locksText = A(e.getAttribute("fLocksText"))), e.hasAttribute("fPublished") && (r.published = A(e.getAttribute("fPublished")));
539
+ const l = s.slice(0, s.lastIndexOf("/")), a = t.evaluate(l, e);
540
+ "1" === a?.getAttribute?.("txBox") && (r.textBox = !0);
541
+ const c = this.readLocks(t.evaluate(s, e));
542
+ if (c && (r.locks = c), "cxnSp" === o && a) {
543
+ const e = (e) => {
544
+ const o = t.evaluate(e, a);
545
+ if (o?.getAttribute) return {
546
+ id: parseInt(o.getAttribute("id") ?? "0", 10) || 0,
547
+ index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0
548
+ };
549
+ }, o = e("stCxn"), s = e("endCxn");
550
+ (o || s) && (r.connectorEnds = {}, o && (r.connectorEnds.start = o), s && (r.connectorEnds.end = s));
551
+ }
552
+ }
553
+ }, Lt = /^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/, Dt = (t, e, o, s) => {
554
+ const r = t.evaluate(o, e), i = t.evaluate(s, e);
555
+ return r || i ? {
556
+ x: N(r?.getAttribute("x") ?? null) ?? 0,
557
+ y: N(r?.getAttribute("y") ?? null) ?? 0,
558
+ width: N(i?.getAttribute("cx") ?? null) ?? 0,
559
+ height: N(i?.getAttribute("cy") ?? null) ?? 0
560
+ } : null;
561
+ }, Et = { Checkbox: "checkbox" };
562
+ var Rt = (t) => {
563
+ const e = t.getAttribute("val");
564
+ return "0" !== e && "false" !== e;
565
+ }, jt = {
566
+ 1: "serif",
567
+ 2: "sans-serif",
568
+ 3: "monospace",
569
+ 4: "cursive",
570
+ 5: "fantasy"
571
+ };
572
+ function Yt(e) {
573
+ const o = {}, s = e.childNodes;
574
+ for (let e = 0; e < s.length; e++) {
575
+ const i = s.item(e);
576
+ if (1 === i.nodeType) switch (i.localName) {
577
+ case "b":
578
+ o.weight = Rt(i) ? 700 : 400;
579
+ break;
580
+ case "i":
581
+ o.style = Rt(i) ? it.Style.Italic : it.Style.Normal;
582
+ break;
583
+ case "strike":
584
+ o.strike = j(Rt(i));
585
+ break;
586
+ case "outline":
587
+ o.outline = Rt(i);
588
+ break;
589
+ case "shadow":
590
+ o.shadow = Rt(i);
591
+ break;
592
+ case "condense":
593
+ case "extend": {
594
+ const t = r(i.localName, Rt(i));
595
+ void 0 !== t && (o.letterSpacing = t);
596
+ break;
597
+ }
598
+ case "u":
599
+ o.underline = y(i.getAttribute("val"));
600
+ break;
601
+ case "vertAlign": {
602
+ const t = Y(i.getAttribute("val"));
603
+ void 0 !== t && (o.baseline = t);
604
+ break;
605
+ }
606
+ case "sz": {
607
+ const t = parseFloat(i.getAttribute("val") ?? "");
608
+ isNaN(t) || (o.size = t);
609
+ break;
610
+ }
611
+ case "rFont": {
612
+ const t = i.getAttribute("val");
613
+ t && (o.family = t);
614
+ break;
615
+ }
616
+ case "family": {
617
+ const t = jt[i.getAttribute("val") ?? ""];
618
+ t && (o.fallbacks = [t]);
619
+ break;
620
+ }
621
+ case "charset": {
622
+ const t = parseInt(i.getAttribute("val") ?? "", 10);
623
+ isNaN(t) || (o.charset = t);
624
+ break;
625
+ }
626
+ case "scheme":
627
+ b(o, i.getAttribute("val"));
628
+ break;
629
+ case "color": {
630
+ const e = i.getAttribute("rgb");
631
+ if (e && !i.hasAttribute("theme")) {
632
+ o.color = "#" + (8 === e.length ? e.substring(2) : e).toUpperCase();
633
+ break;
634
+ }
635
+ const s = t((t) => i.getAttribute(t));
636
+ s && (o.color = s);
637
+ break;
638
+ }
639
+ }
640
+ }
641
+ return Object.keys(o).length > 0 ? o : null;
642
+ }
643
+ var Xt = {
644
+ RelsVisitor: class {
645
+ visit(t, e, o) {
646
+ if (!e) return;
647
+ const s = e.childNodes, r = s.length;
648
+ for (let e = 0; e < r; e++) {
649
+ const r = s.item(e);
650
+ 1 === r.nodeType && "Relationship" === r.localName && this.processRelationship(t, r, o);
651
+ }
652
+ return o;
653
+ }
654
+ processRelationship(t, e, o) {
655
+ const s = {};
656
+ t.copyFromAttribute(e, "Target", s, "target"), t.copyFromAttribute(e, "Type", s, "type"), t.copyFromAttribute(e, "TargetMode", s, "targetMode");
657
+ o[e.getAttribute("Id")] = s;
658
+ }
659
+ },
660
+ CorePropertiesVisitor: class {
661
+ visit(t, e, o) {
662
+ const s = [], r = e.childNodes, i = r.length;
663
+ for (let e = 0; e < i; e++) {
664
+ const o = r.item(e);
665
+ if (1 !== o.nodeType) continue;
666
+ const i = this.processProperty(t, o);
667
+ i && s.push(i);
668
+ }
669
+ return s.length > 0 && (o.properties = s), s;
670
+ }
671
+ processProperty(t, e) {
672
+ if (e) return e.getAttribute("xsi:type"), {
673
+ key: e.localName,
674
+ value: e.textContent || ""
675
+ };
676
+ }
677
+ },
678
+ AppPropertiesVisitor: class {
679
+ visit(t, e, o) {
680
+ const s = e.childNodes, r = s.length;
681
+ for (let t = 0; t < r; t++) if ("property" === s.item(t).localName) return this.visitCustom(e, o);
682
+ const i = [];
683
+ for (let e = 0; e < r; e++) {
684
+ const o = s.item(e);
685
+ if (1 !== o.nodeType) continue;
686
+ const r = this.processProperty(t, o);
687
+ r && i.push(r);
688
+ }
689
+ return i.length > 0 && (o.properties = i), i;
690
+ }
691
+ visitCustom(t, e) {
692
+ const o = [], s = t.childNodes, r = s.length;
693
+ for (let t = 0; t < r; t++) {
694
+ const e = s.item(t);
695
+ if (1 !== e.nodeType || "property" !== e.localName) continue;
696
+ const r = e.getAttribute("name");
697
+ if (!r) continue;
698
+ let i = null;
699
+ for (let t = 0; t < e.childNodes.length && !i; t++) {
700
+ const o = e.childNodes.item(t);
701
+ 1 === o.nodeType && (i = o);
702
+ }
703
+ const n = {
704
+ key: r,
705
+ kind: i?.localName ?? null,
706
+ value: i?.textContent ?? ""
707
+ }, l = e.getAttribute("linkTarget");
708
+ l && (n.linkTarget = l), o.push(n);
709
+ }
710
+ return o.length > 0 && (e.custom = o), o;
711
+ }
712
+ processProperty(t, e) {
713
+ if (e) return {
714
+ key: e.localName,
715
+ value: e.textContent || ""
716
+ };
717
+ }
718
+ },
719
+ ShapePropertiesVisitor: h,
720
+ TextPropertiesVisitor: P,
721
+ ShapeTextVisitor: O,
722
+ ThemeVisitor: class {
723
+ visit(t, e, o) {
724
+ o.name = e.getAttribute("name"), o.objectDefaults = {};
725
+ const s = At(e, "custClrLst")[0];
726
+ if (s) {
727
+ const e = new m(), r = [];
728
+ for (const o of At(s, "custClr")) {
729
+ const s = e.processAdjColor(t, o);
730
+ if (!s) continue;
731
+ const i = { color: s }, n = o.getAttribute("name");
732
+ n && (i.name = n), r.push(i);
733
+ }
734
+ r.length && (o.customColors = r);
735
+ }
736
+ for (const t of At(e, "extLst")) for (const e of At(t, "ext")) {
737
+ if ("{05A4C25C-085E-4340-85A3-A5531E510DB2}" !== e.getAttribute("uri")) continue;
738
+ const t = At(e, "themeFamily")[0], s = t?.getAttribute("id");
739
+ if (!s) continue;
740
+ const r = {
741
+ name: t.getAttribute("name") ?? "",
742
+ id: s
743
+ }, i = t.getAttribute("vid");
744
+ i && (r.vid = i), o.family = r;
745
+ }
746
+ return o;
747
+ }
748
+ },
749
+ ClrSchemeVisitor: class extends m {
750
+ visit(t, e, o) {
751
+ const s = {};
752
+ s.name = e.getAttribute("name");
753
+ const r = e.childNodes, i = r.length;
754
+ for (let o = 0; o < i; o++) {
755
+ const i = r.item(o);
756
+ if (1 === i.nodeType) {
757
+ let o = i.localName;
758
+ const r = t.evaluate(o, e);
759
+ s[o] = this.processAdjColor(t, r);
760
+ }
761
+ }
762
+ return Object.keys(s).length > 0 && (o.colors = s), s;
763
+ }
764
+ },
765
+ FontSchemeVisitor: class {
766
+ visit(t, e, o) {
767
+ const s = {};
768
+ s.name = e.getAttribute("name");
769
+ const r = this.processFontCollection(t, t.evaluate("majorFont", e));
770
+ r && (s.major = r);
771
+ const i = this.processFontCollection(t, t.evaluate("minorFont", e));
772
+ return i && (s.minor = i), o.fonts = s, s;
773
+ }
774
+ processFontCollection(t, e) {
775
+ if (!e) return;
776
+ const o = {}, s = t.evaluate("latin", e), r = s?.getAttribute("typeface");
777
+ r && (o.latin = r);
778
+ const i = s?.getAttribute("panose");
779
+ i && (o.panose = i);
780
+ const n = t.evaluate("ea", e)?.getAttribute("typeface");
781
+ n && (o.eastAsian = n);
782
+ const l = t.evaluate("cs", e)?.getAttribute("typeface");
783
+ let a;
784
+ l && (o.complexScript = l);
785
+ const c = e.childNodes, u = c.length;
786
+ for (let t = 0; t < u; t++) {
787
+ const e = c.item(t);
788
+ if (1 !== e.nodeType || "font" !== e.localName) continue;
789
+ const o = e.getAttribute("script");
790
+ o && ((a ??= {})[o] = e.getAttribute("typeface") ?? "");
791
+ }
792
+ return a && (o.scripts = a), o;
793
+ }
794
+ },
795
+ ObjectDefaultsVisitor: class {
796
+ visit(t, e, o) {
797
+ const s = {};
798
+ for (const [o, r] of Ct) {
799
+ const i = t.evaluate(o, e);
800
+ i && (s[r] = this.processDefault(t, i));
801
+ }
802
+ return o.objectDefaults = s, {};
803
+ }
804
+ processDefault(t, e) {
805
+ const o = {}, s = t.evaluate("spPr", e);
806
+ s && new h().visit(t, s, o);
807
+ const r = new O().readTextBody(t, e);
808
+ (r.body || r.listStyle) && (o.text = r);
809
+ const i = t.evaluate("style", e);
810
+ return i && (o.style = Nt(t, i)), o;
811
+ }
812
+ },
813
+ FmtSchemeVisitor: class extends m {
814
+ visit(t, e, o) {
815
+ const s = this.parseFillList(t, e, "fillStyleLst"), r = this.parseLnList(t, e, "lnStyleLst"), i = this.parseEffectStyleList(t, e, "effectStyleLst"), n = this.parseFillList(t, e, "bgFillStyleLst");
816
+ if (s && (o.fillStyleLst = s), r && (o.lnStyleLst = r), i && (o.effectStyleLst = i), n && (o.bgFillStyleLst = n), s && r && i && n) return;
817
+ const l = t.serializeElement(e);
818
+ l && (o.formatSchemeXml = l);
819
+ }
820
+ parseFillList(t, e, o) {
821
+ const s = t.evaluate(o, e);
822
+ if (!s) return;
823
+ const r = [], i = s.childNodes, n = i.length;
824
+ for (let e = 0; e < n; e++) {
825
+ const o = i.item(e);
826
+ if (1 !== o.nodeType) continue;
827
+ const s = this.parseFillListItem(t, o);
828
+ if (void 0 === s) return;
829
+ r.push(s);
830
+ }
831
+ return r;
832
+ }
833
+ parseFillListItem(t, e) {
834
+ switch (e.localName) {
835
+ case "noFill": return { type: rt.Type.None };
836
+ case "solidFill": {
837
+ const o = this.processAdjColor(t, e);
838
+ return o ? {
839
+ type: rt.Type.Solid,
840
+ color: o
841
+ } : void 0;
842
+ }
843
+ case "gradFill": return this.processGradFill(t, e);
844
+ case "pattFill": return this.processPatternFill(t, e);
845
+ default: return;
846
+ }
847
+ }
848
+ parseLnList(t, e, o) {
849
+ const s = t.evaluate(o, e);
850
+ if (!s) return;
851
+ const r = [], i = s.childNodes, n = i.length;
852
+ for (let e = 0; e < n; e++) {
853
+ const o = i.item(e);
854
+ 1 === o.nodeType && r.push(this.parseLn(t, o));
855
+ }
856
+ return r;
857
+ }
858
+ parseEffectStyleList(t, e, o) {
859
+ const s = t.evaluate(o, e);
860
+ if (!s) return;
861
+ const r = [], i = s.childNodes, n = i.length;
862
+ for (let e = 0; e < n; e++) {
863
+ const o = i.item(e);
864
+ if (1 !== o.nodeType) continue;
865
+ if (t.evaluate("scene3d", o) || t.evaluate("sp3d", o)) return;
866
+ const s = this.getEffects(t, o);
867
+ if (void 0 === s) return;
868
+ r.push(s ?? []);
869
+ }
870
+ return r;
871
+ }
872
+ },
873
+ AutoFilterVisitor: class {
874
+ visit(t, e, o) {
875
+ if (!e) return;
876
+ const s = {}, r = [];
877
+ return this.processFilterColumns(t, e, r, o), r.length > 0 && (s.conditions = r), Object.keys(s).length > 0 && (o.filter = s), o;
878
+ }
879
+ processColorFilter(t, e) {
880
+ const o = {}, s = {
881
+ operator: st.BuiltInOperatorNames.Color,
882
+ param: o
883
+ };
884
+ t.copyFromAttribute(e, "cellColor", o, "cellColor", t.BOOLEAN_COPY);
885
+ const r = St(t, e);
886
+ return r && (o.style = r), s;
887
+ }
888
+ processCustomFilter(t, e) {
889
+ return X({
890
+ operator: e.getAttribute("operator"),
891
+ val: e.getAttribute("val")
892
+ }, (e) => t.warn(e));
893
+ }
894
+ processCustomFilters(t, e) {
895
+ const o = e.getAttribute("and"), s = "and" === o || "1" === o;
896
+ e.getAttribute("val");
897
+ const r = [], i = {
898
+ operator: s ? st.BuiltInOperatorNames.And : st.BuiltInOperatorNames.Or,
899
+ param: r
900
+ }, n = e.childNodes, l = n.length;
901
+ for (let e = 0; e < l; e++) {
902
+ const o = n.item(e);
903
+ if (1 !== o.nodeType) continue;
904
+ let s = null;
905
+ "customFilter" === o.localName && (s = this.processCustomFilter(t, o)), s && r.push(s);
906
+ }
907
+ return 1 === r.length ? r[0] : x(i);
908
+ }
909
+ processDynamicFilter(t, e) {
910
+ return C(e.getAttribute("type"), e.getAttribute("val"), e.getAttribute("maxVal"));
911
+ }
912
+ processDateGroupItem(t, e) {
913
+ const o = {};
914
+ return t.copyFromAttribute(e, "dateTimeGrouping", o, "group"), t.copyFromAttribute(e, "day", o, "day", t.INT_COPY), t.copyFromAttribute(e, "hour", o, "hour", t.INT_COPY), t.copyFromAttribute(e, "minute", o, "minute", t.INT_COPY), t.copyFromAttribute(e, "month", o, "month", t.INT_COPY), t.copyFromAttribute(e, "second", o, "second", t.INT_COPY), t.copyFromAttribute(e, "year", o, "year", t.INT_COPY), o;
915
+ }
916
+ processFilterItem(t, e) {
917
+ if (e.hasAttribute("val")) return e.getAttribute("val");
918
+ }
919
+ processFilters(t, e) {
920
+ const o = {}, s = {
921
+ operator: st.BuiltInOperatorNames.InSet,
922
+ param: o
923
+ };
924
+ s.selector = st.BuiltInSelectorNames.Display, t.copyFromAttribute(e, "blank", o, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", o, "calendarType");
925
+ let r = [], i = [];
926
+ const n = e.childNodes, l = n.length;
927
+ for (let e = 0; e < l; e++) {
928
+ const o = n.item(e);
929
+ if (1 === o.nodeType) {
930
+ if ("dateGroupItem" === o.localName) {
931
+ const e = this.processDateGroupItem(t, o);
932
+ e && r.push(e);
933
+ } else if ("filter" === o.localName) {
934
+ const e = this.processFilterItem(t, o);
935
+ void 0 !== e && i.push(e);
936
+ }
937
+ }
938
+ }
939
+ return r.length > 0 && (o.dateGroups = r), i.length > 0 && (o.items = i), s;
940
+ }
941
+ processIcon(t, e) {
942
+ const o = {}, s = {
943
+ operator: st.BuiltInOperatorNames.Icon,
944
+ param: o
945
+ };
946
+ return t.copyFromAttribute(e, "iconId", o, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", o), s;
947
+ }
948
+ processTop10(t, e) {
949
+ const o = {}, s = {
950
+ operator: st.BuiltInOperatorNames.TopN,
951
+ param: o
952
+ };
953
+ return t.copyFromAttribute(e, "filterVal", o, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", o, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", o, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", o, "limit", t.FLOAT_COPY), s;
954
+ }
955
+ processFilterColumnExt(t, e) {
956
+ const o = e.childNodes;
957
+ for (let e = 0; e < o.length; e++) {
958
+ const s = o.item(e);
959
+ if (1 !== s.nodeType || "ext" !== s.localName) continue;
960
+ if (g(s.getAttribute("uri")) !== g("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
961
+ const r = s.childNodes;
962
+ for (let e = 0; e < r.length; e++) {
963
+ const o = r.item(e);
964
+ if (1 !== o.nodeType || "filterColumn" !== o.localName) continue;
965
+ const s = o.childNodes;
966
+ for (let e = 0; e < s.length; e++) {
967
+ const o = s.item(e);
968
+ if (1 === o.nodeType && "filters" === o.localName) return this.processFilters(t, o);
969
+ }
970
+ }
971
+ }
972
+ }
973
+ processFilterCriteria(t, e) {
974
+ if (!e) return;
975
+ const o = e.childNodes;
976
+ let s;
977
+ const r = o.length;
978
+ for (let e = 0; e < r; e++) {
979
+ const r = o.item(e);
980
+ 1 === r.nodeType && ("colorFilter" === r.localName ? s = this.processColorFilter(t, r) : "customFilters" === r.localName ? s = this.processCustomFilters(t, r) : "dynamicFilter" === r.localName ? s = this.processDynamicFilter(t, r) : "filters" === r.localName ? s = this.processFilters(t, r) : "iconFilter" === r.localName ? s = this.processIcon(t, r) : "top10" === r.localName ? s = this.processTop10(t, r) : "extLst" === r.localName && (s = this.processFilterColumnExt(t, r) ?? s));
981
+ }
982
+ return s;
983
+ }
984
+ processFilterColumn(t, e, o) {
985
+ if (!e) return null;
986
+ if (!e.hasAttribute("colId")) return;
987
+ const s = parseInt(e.getAttribute("colId"));
988
+ let r = !1;
989
+ if (e.hasAttribute("hiddenButton") && (r = A(e.getAttribute("hiddenButton"))), r && o) {
990
+ let t = o.hiddenButtons;
991
+ t || (t = [], o.hiddenButtons = t), t.push(s);
992
+ }
993
+ let i = !1;
994
+ if (e.hasAttribute("showButton") && (i = A(e.getAttribute("showButton"))), i && o) {
995
+ let t = o.showButtons;
996
+ !0 !== t && (t || (t = [], o.showButtons = t), t[s] = !0);
997
+ }
998
+ const n = this.processFilterCriteria(t, e);
999
+ return n ? (n.index = s, n) : null;
1000
+ }
1001
+ processFilterColumns(t, e, o, s) {
1002
+ if (!e) return;
1003
+ const r = e.childNodes, i = r.length;
1004
+ for (let e = 0; e < i; e++) {
1005
+ const i = r.item(e);
1006
+ if (1 === i.nodeType && "filterColumn" === i.localName) {
1007
+ const e = this.processFilterColumn(t, i, s);
1008
+ e && o.push(e);
1009
+ }
1010
+ }
1011
+ return o;
1012
+ }
1013
+ },
1014
+ SortStateVisitor: class {
1015
+ visit(t, e, o) {
1016
+ if (!e) return;
1017
+ const s = e.getAttribute("ref"), r = {};
1018
+ e.hasAttribute("caseSensitive") && (r.collatorOptions = A(e.getAttribute("caseSensitive")) ? dt.CaseSensitiveOptions : dt.CaseInsensitiveOptions);
1019
+ const i = e.getAttribute("sortMethod");
1020
+ null != i && "none" !== i && ("stroke" === i ? r.collatorOptions = {
1021
+ ...r.collatorOptions,
1022
+ collation: "stroke"
1023
+ } : "pinYin" === i && (r.collatorOptions = {
1024
+ ...r.collatorOptions,
1025
+ collation: "pinyin"
1026
+ }));
1027
+ const n = {};
1028
+ e.hasAttribute("columnSort") && A(e.getAttribute("columnSort")) && (n.axis = nt.Axis.Column);
1029
+ const l = Q.fastStringToRange(s), a = [], c = [];
1030
+ this.processSortConditions(t, e, a, l, r, c), a.length > 0 && (n.sorts = a);
1031
+ const u = t.getVisitorParamsState().get("ref");
1032
+ if (u && s) {
1033
+ const t = Q.fastStringToRange(u);
1034
+ n.extent = {
1035
+ range: p(t, l),
1036
+ sorts: c.map((e) => k(t, l, e))
1037
+ };
1038
+ }
1039
+ return Object.keys(a).length > 0 && (o.sort = n), n;
1040
+ }
1041
+ processSortCondition(t, e, o, s, r) {
1042
+ if (!e) return null;
1043
+ const i = {};
1044
+ if (!e.hasAttribute("ref")) return void t.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1045
+ if (e.hasAttribute("ref")) {
1046
+ const t = e.getAttribute("ref"), s = Q.fastStringToRange(t);
1047
+ i.index = o ? s.colStart - o.colStart : s.colStart, r?.push(s);
1048
+ }
1049
+ const n = { ...s };
1050
+ i.criteria = n, n.reverse = !1, e.hasAttribute("descending") && (n.reverse = A(e.getAttribute("descending")));
1051
+ const l = V(e.getAttribute("sortBy"));
1052
+ l && (n.sortOn = l);
1053
+ const a = St(t, e);
1054
+ return a && (n.style = a), t.copyFromAttribute(e, "iconSet", n), t.copyFromAttribute(e, "customList", n), i;
1055
+ }
1056
+ processSortConditions(t, e, o, s, r, i) {
1057
+ if (!e) return;
1058
+ const n = e.childNodes, l = n.length;
1059
+ for (let e = 0; e < l; e++) {
1060
+ const l = n.item(e);
1061
+ if (1 === l.nodeType && "sortCondition" === l.localName) {
1062
+ const e = this.processSortCondition(t, l, s, r, i);
1063
+ e && o.push(e);
1064
+ }
1065
+ }
1066
+ }
1067
+ },
1068
+ SheetStyleVisitor: class extends Tt {
1069
+ visit(t, e, o) {
1070
+ this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1071
+ const s = {
1072
+ fills: {},
1073
+ fonts: {},
1074
+ borders: {}
1075
+ }, r = t.evaluate("fonts", e);
1076
+ this.processFonts(t, r, s.fonts);
1077
+ const n = s.fonts[this.normalFontId(t, e)], l = {
1078
+ declared: ["1", "true"].includes(r?.getAttribute("x14ac:knownFonts") ?? ""),
1079
+ normalIsThemeFont: F(n?.family),
1080
+ faces: _(Object.values(s.fonts).map((t) => ({
1081
+ ...t,
1082
+ family: i(t?.family, t?.fallbacks, null, !1).name
1083
+ })))
1084
+ };
1085
+ t.getVisitorParamsState().set(D, l), n && t.getVisitorParamsState().set(z, n), this.processFills(t, t.evaluate("fills", e), s.fills), this.processBorders(t, t.evaluate("borders", e), s.borders, !0), s.fills[0] = { type: rt.Type.None }, s.fills[1] = {
1086
+ type: rt.Type.Pattern,
1087
+ patternType: rt.BuiltInSheetPattern.Gray125
1088
+ }, s.borders[0] = {
1089
+ bottom: { style: et.StrokeStyle.None },
1090
+ left: { style: et.StrokeStyle.None },
1091
+ right: { style: et.StrokeStyle.None },
1092
+ top: { style: et.StrokeStyle.None }
1093
+ };
1094
+ const a = [];
1095
+ this.processXFs(t, t.evaluate("cellStyleXfs", e), a, s, null, !1);
1096
+ const c = /* @__PURE__ */ new Map();
1097
+ if (a.length > 0) {
1098
+ const s = [];
1099
+ this.processCellStyles(t, t.evaluate("cellStyles", e), s, a, c), o.named = s;
1100
+ }
1101
+ const u = [];
1102
+ this.processXFs(t, t.evaluate("cellXfs", e), u, s, c), Object.keys(u).length > 0 && (o.direct = u);
1103
+ const d = this.collectHiddenXfs(t.evaluate("cellXfs", e));
1104
+ d.size > 0 && t.getVisitorParamsState().set(G, d);
1105
+ const h = this.collectPivotButtonXfs(t.evaluate("cellXfs", e));
1106
+ h.size > 0 && t.getVisitorParamsState().set($, h);
1107
+ const p = this.collectXfComplements(t.evaluate("cellXfs", e));
1108
+ p.size > 0 && t.getVisitorParamsState().set(W, p);
1109
+ const m = [];
1110
+ return this.processDXFs(t, t.evaluate("dxfs", e), m), this.processTableStyles(t, t.evaluate("tableStyles", e), o, m), this.processSlicerStyles(t, t.evaluate("extLst", e), o), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), o), this.processMruColors(t, t.evaluate("colors/mruColors", e), o), o;
1111
+ }
1112
+ normalFontId(t, e) {
1113
+ const o = t.evaluate("cellStyles", e)?.childNodes;
1114
+ let s = 0;
1115
+ for (let t = 0; t < (o?.length ?? 0); t++) {
1116
+ const e = o.item(t);
1117
+ if (1 === e.nodeType && "0" === e.getAttribute("builtinId")) {
1118
+ s = parseInt(e.getAttribute("xfId") ?? "0", 10) || 0;
1119
+ break;
1120
+ }
1121
+ }
1122
+ const r = t.evaluate("cellStyleXfs", e)?.childNodes;
1123
+ let i = 0;
1124
+ for (let t = 0; t < (r?.length ?? 0); t++) {
1125
+ const e = r.item(t);
1126
+ if (1 === e.nodeType && i++ === s) return parseInt(e.getAttribute("fontId") ?? "0", 10) || 0;
1127
+ }
1128
+ return 0;
1129
+ }
1130
+ processIndexColors(t, e, o) {
1131
+ if (!e) return;
1132
+ const s = [], r = e.childNodes, i = r.length;
1133
+ for (let e = 0; e < i; e++) {
1134
+ const o = r.item(e);
1135
+ if (1 === o.nodeType && "rgbColor" === o.localName) {
1136
+ const e = { color: null };
1137
+ this.processDataBarColor(t, o, e, "color"), e.color && s.push(e.color);
1138
+ }
1139
+ }
1140
+ o.indexedColors = s;
1141
+ }
1142
+ processMruColors(t, e, o) {
1143
+ if (!e) return;
1144
+ const s = [], r = e.childNodes, i = r.length;
1145
+ for (let e = 0; e < i; e++) {
1146
+ const o = r.item(e);
1147
+ if (1 === o.nodeType && "color" === o.localName) {
1148
+ const e = { color: null };
1149
+ this.processDataBarColor(t, o, e, "color"), e.color && s.push(e.color);
1150
+ }
1151
+ }
1152
+ s.length > 0 && (o.mruColors = s);
1153
+ }
1154
+ processNumFmts(t, e, o) {
1155
+ if (!e) return;
1156
+ const s = /* @__PURE__ */ new Map();
1157
+ if (t.getVisitorParamsState().set("numFmts", s), !e) return;
1158
+ const r = e.childNodes, i = r.length;
1159
+ for (let t = 0; t < i; t++) {
1160
+ const e = r.item(t);
1161
+ if (1 === e.nodeType && "numFmt" === e.localName) {
1162
+ const t = e.getAttribute("numFmtId"), o = e.getAttribute("formatCode");
1163
+ if (t && o) {
1164
+ const e = o;
1165
+ s.set(parseInt(t), e);
1166
+ }
1167
+ }
1168
+ }
1169
+ }
1170
+ processXFs(t, e, o, s, r = null, i = !0) {
1171
+ if (!e) return;
1172
+ const n = e.childNodes, l = n.length;
1173
+ for (let e = 0; e < l; e++) {
1174
+ const l = n.item(e);
1175
+ if (1 === l.nodeType && "xf" === l.localName) {
1176
+ const e = {};
1177
+ this.processXF(t, l, e, s, r, i), o.push(e);
1178
+ }
1179
+ }
1180
+ }
1181
+ processXF(t, e, o, s, r, i) {
1182
+ if (!e) return;
1183
+ const n = e.getAttribute("xfId");
1184
+ if (n && r) {
1185
+ const t = r.get(parseInt(n));
1186
+ t && t !== ot.BuiltInName.Normal && (o.named = t);
1187
+ }
1188
+ const l = (t) => !(!i && e.hasAttribute(t)) || A(e.getAttribute(t)), a = (t) => !i || e.hasAttribute(t) && A(e.getAttribute(t)), c = "0", u = i ? c : void 0;
1189
+ if (l("applyFont")) {
1190
+ const t = e.getAttribute("fontId") ?? u;
1191
+ if (void 0 !== t && (t !== c || a("applyFont"))) {
1192
+ const e = s.fonts[t];
1193
+ void 0 !== e && (o.font = e);
1194
+ }
1195
+ }
1196
+ if (l("applyFill")) {
1197
+ const t = e.getAttribute("fillId") ?? u;
1198
+ if (void 0 !== t && (t !== c || a("applyFill"))) {
1199
+ const e = s.fills[t];
1200
+ void 0 !== e && Object.keys(e).length > 0 && (o.fill = e);
1201
+ }
1202
+ }
1203
+ if (l("applyBorder")) {
1204
+ const t = e.getAttribute("borderId") ?? u;
1205
+ if (void 0 !== t && (t !== c || a("applyBorder"))) {
1206
+ const e = s.borders[t];
1207
+ void 0 !== e && (o.borders = e);
1208
+ }
1209
+ }
1210
+ if (l("applyNumberFormat")) {
1211
+ const s = e.getAttribute("numFmtId") ?? u;
1212
+ if (void 0 !== s && (s !== c || a("applyNumberFormat"))) {
1213
+ const e = parseInt(s);
1214
+ let r;
1215
+ const i = t.getVisitorParamsState();
1216
+ if (i) {
1217
+ const t = i.get("numFmts");
1218
+ t && (r = t.get(e)), o.numberFormat = r ?? e;
1219
+ } else t.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
1220
+ }
1221
+ }
1222
+ if (l("applyAlignment")) {
1223
+ const s = t.evaluate("alignment", e);
1224
+ (s || a("applyAlignment")) && this.processAlignment(t, s, o);
1225
+ }
1226
+ if (l("applyProtection")) {
1227
+ const s = t.evaluate("protection", e);
1228
+ (s || a("applyProtection")) && this.processProtection(t, s, o);
1229
+ }
1230
+ const d = A(e.getAttribute("quotePrefix") ?? "");
1231
+ d && (o.quotePrefix = d);
1232
+ }
1233
+ processAlignment(t, e, o) {
1234
+ const s = {};
1235
+ if (e?.hasAttribute("horizontal") ? s.horizontal = e.getAttribute("horizontal") : s.horizontal = ct.HorizontalAlignment.General, e?.hasAttribute("vertical") ? s.vertical = e.getAttribute("vertical") : s.vertical = ct.VerticalAlignment.Bottom, e?.hasAttribute("indent") ? s.indent = parseInt(e.getAttribute("indent")) : s.indent = 0, e?.hasAttribute("relativeIndent") ? s.relativeIndent = parseInt(e.getAttribute("relativeIndent")) : s.relativeIndent = 0, A(e?.getAttribute("wrapText") ?? "") ? s.overflow = ct.Overflow.Wrap : s.overflow = ct.Overflow.Visible, A(e?.getAttribute("shrinkToFit") ?? "") && (s.overflow = ct.Overflow.Shrink), e?.hasAttribute("textRotation")) {
1236
+ let t = parseFloat(e.getAttribute("textRotation"));
1237
+ t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0, s.stacked = !0), s.rotation = t;
1238
+ } else s.rotation = 0;
1239
+ e?.hasAttribute("justifyLastLine") && (s.justifyLastLine = A(e.getAttribute("justifyLastLine")));
1240
+ const r = e?.getAttribute("readingOrder");
1241
+ return r && ("0" === r ? s.readingDirection = ct.ReadingDirection.Auto : "1" === r ? s.readingDirection = ct.ReadingDirection.LeftToRight : "2" === r ? s.readingDirection = ct.ReadingDirection.RightToLeft : t.warn(`Invalid readingOrder '${r}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(s).length > 0 && (o.alignment = s), o;
1242
+ }
1243
+ collectHiddenXfs(t) {
1244
+ const e = /* @__PURE__ */ new Set();
1245
+ if (!t) return e;
1246
+ const o = t.childNodes;
1247
+ let s = 0;
1248
+ for (let t = 0; t < o.length; t++) {
1249
+ const r = o.item(t);
1250
+ if (1 !== r.nodeType || "xf" !== r.localName) continue;
1251
+ const i = r.childNodes;
1252
+ for (let t = 0; t < i.length; t++) {
1253
+ const o = i.item(t);
1254
+ 1 === o.nodeType && "protection" === o.localName && A(o.getAttribute("hidden") ?? "") && e.add(s);
1255
+ }
1256
+ s++;
1257
+ }
1258
+ return e;
1259
+ }
1260
+ collectPivotButtonXfs(t) {
1261
+ const e = /* @__PURE__ */ new Set();
1262
+ if (!t) return e;
1263
+ const o = t.childNodes;
1264
+ let s = 0;
1265
+ for (let t = 0; t < o.length; t++) {
1266
+ const r = o.item(t);
1267
+ 1 === r.nodeType && "xf" === r.localName && (A(r.getAttribute("pivotButton") ?? "") && e.add(s), s++);
1268
+ }
1269
+ return e;
1270
+ }
1271
+ collectXfComplements(t) {
1272
+ const e = /* @__PURE__ */ new Map();
1273
+ if (!t) return e;
1274
+ const o = t.childNodes;
1275
+ let s = 0;
1276
+ for (let t = 0; t < o.length; t++) {
1277
+ const r = o.item(t);
1278
+ if (1 !== r.nodeType || "xf" !== r.localName) continue;
1279
+ const i = Pt(r, "extLst");
1280
+ if (i) {
1281
+ const t = i.childNodes;
1282
+ for (let o = 0; o < t.length; o++) {
1283
+ const r = Pt(t.item(o), "xfComplement"), i = parseInt(r?.getAttribute("i") ?? "", 10);
1284
+ isNaN(i) || e.set(s, i);
1285
+ }
1286
+ }
1287
+ s++;
1288
+ }
1289
+ return e;
1290
+ }
1291
+ processProtection(t, e, o) {
1292
+ if (!e) return;
1293
+ const s = e.getAttribute("locked");
1294
+ return o.protection = { alwaysUnlocked: !!s && !A(s) }, o;
1295
+ }
1296
+ processDXF(t, e, o) {
1297
+ if (!e) return;
1298
+ const s = e.childNodes, r = s.length;
1299
+ for (let e = 0; e < r; e++) {
1300
+ const r = s.item(e);
1301
+ if (1 === r.nodeType && "font" === r.localName) {
1302
+ const e = {};
1303
+ this.processFont(t, r, e), o.font = e;
1304
+ } else if (1 === r.nodeType && "fill" === r.localName) {
1305
+ const e = [];
1306
+ this.processFill(t, r, e, 0), e.length > 0 && e[0] && (o.fill = e[0]);
1307
+ } else if (1 === r.nodeType && "border" === r.localName) {
1308
+ const e = [];
1309
+ this.processBorder(t, r, e, 0, !1), e.length > 0 && e[0] && (o.borders = e[0]);
1310
+ } else if (1 === r.nodeType && "numFmt" === r.localName) {
1311
+ const t = r.getAttribute("formatCode");
1312
+ if (t) o.numberFormat = t;
1313
+ else {
1314
+ const t = r.getAttribute("numFmtId");
1315
+ t && (o.numberFormat = Number(t));
1316
+ }
1317
+ } else 1 === r.nodeType && "alignment" === r.localName && this.processAlignment(t, r, o);
1318
+ }
1319
+ }
1320
+ processDXFs(t, e, o) {
1321
+ if (!e) return;
1322
+ t.getVisitorParamsState().set("processingDXFs", !0);
1323
+ const s = /* @__PURE__ */ new Map();
1324
+ t.getVisitorParamsState().set("dxfs", s);
1325
+ const r = e.childNodes, i = r.length;
1326
+ for (let e = 0; e < i; e++) {
1327
+ const i = r.item(e);
1328
+ if (1 === i.nodeType && "dxf" === i.localName) {
1329
+ const e = {};
1330
+ this.processDXF(t, i, e);
1331
+ const r = o.length;
1332
+ s.set(r, e), o.push(e);
1333
+ }
1334
+ }
1335
+ t.getVisitorParamsState().delete("processingDXFs");
1336
+ }
1337
+ processSlicerStyles(t, e, o) {
1338
+ if (!e) return;
1339
+ let s = null, r = null;
1340
+ const i = e.childNodes;
1341
+ for (let t = 0; t < i.length; t++) {
1342
+ const e = i.item(t);
1343
+ if (1 !== e.nodeType || "ext" !== e.localName) continue;
1344
+ const o = e.childNodes;
1345
+ for (let t = 0; t < o.length; t++) {
1346
+ const e = o.item(t);
1347
+ 1 === e.nodeType && ("dxfs" === e.localName ? s = e : "slicerStyles" === e.localName && (r = e));
1348
+ }
1349
+ }
1350
+ if (!r) return;
1351
+ const n = [];
1352
+ if (s) {
1353
+ t.getVisitorParamsState().set("processingDXFs", !0);
1354
+ const e = s.childNodes;
1355
+ for (let o = 0; o < e.length; o++) {
1356
+ const s = e.item(o);
1357
+ if (1 !== s.nodeType || "dxf" !== s.localName) continue;
1358
+ const r = {};
1359
+ this.processDXF(t, s, r), n.push(r);
1360
+ }
1361
+ t.getVisitorParamsState().delete("processingDXFs");
1362
+ }
1363
+ const l = {}, a = r.getAttribute("defaultSlicerStyle");
1364
+ a && "SlicerStyleLight1" !== a && (l.defaultSlicerStyle = a);
1365
+ const c = o.tables?.styles, u = r.childNodes;
1366
+ for (let e = 0; e < u.length; e++) {
1367
+ const o = u.item(e);
1368
+ if (1 !== o.nodeType || "slicerStyle" !== o.localName) continue;
1369
+ const s = o.getAttribute("name");
1370
+ if (!s) continue;
1371
+ const r = {}, i = c?.[s];
1372
+ i && !1 === i.table && !i.pivot && (i.wholeTable && (r.wholeTable = i.wholeTable), i.headerRow && (r.headerRow = i.headerRow), delete c[s]);
1373
+ const a = t.evaluate("slicerStyleElements", o)?.childNodes, d = a?.length ?? 0;
1374
+ for (let e = 0; e < d; e++) {
1375
+ const o = a.item(e);
1376
+ if (1 !== o.nodeType || "slicerStyleElement" !== o.localName) continue;
1377
+ const s = o.getAttribute("type");
1378
+ if (!s || !It.has(s)) continue;
1379
+ const i = o.getAttribute("dxfId"), l = null != i ? n[parseInt(i)] : void 0;
1380
+ l ? r[s] = l : t.warn(`A slicer style names a format that does not exist (dxfId '${i}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
1381
+ }
1382
+ (l.styles ??= {})[s] = r;
1383
+ }
1384
+ c && 0 === Object.keys(c).length && (delete o.tables.styles, 0 === Object.keys(o.tables).length && delete o.tables), Object.keys(l).length > 0 && (o.slicers = l);
1385
+ }
1386
+ processTableStyle(t, e, o, s, r = !1) {
1387
+ const i = e.getAttribute("name"), n = { name: i };
1388
+ e.hasAttribute("table") && (n.table = A(e.getAttribute("table"))), n.pivot = !e.hasAttribute("pivot") || A(e.getAttribute("pivot")), r && !n.pivot && s.unshift(null);
1389
+ const l = e.childNodes, a = l.length;
1390
+ for (let e = 0; e < a; e++) {
1391
+ const o = l.item(e);
1392
+ if (1 === o.nodeType && "tableStyleElement" === o.localName) {
1393
+ const e = o.getAttribute("type"), r = o.getAttribute("dxfId");
1394
+ let i = null != r ? s?.[r] : void 0;
1395
+ i || (t.warn(`A table style names a format that does not exist (dxfId '${r}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), i = {}), n[e] = i;
1396
+ let l = null;
1397
+ o.hasAttribute("size") && (l = parseInt(o.getAttribute("size"))), l && !isNaN(l) && (i.size = l);
1398
+ }
1399
+ }
1400
+ delete n.name, o[i] = n;
1401
+ }
1402
+ processTableStyles(t, e, o, s, r) {
1403
+ if (!e) return;
1404
+ const i = {}, n = e.getAttribute("defaultTableStyle");
1405
+ n && (i.defaultTableStyle = n);
1406
+ const l = e.getAttribute("defaultPivotStyle");
1407
+ l && (i.defaultPivotStyle = l);
1408
+ const a = e.childNodes, c = {}, u = a.length;
1409
+ for (let e = 0; e < u; e++) {
1410
+ const o = a.item(e);
1411
+ 1 === o.nodeType && "tableStyle" === o.localName && this.processTableStyle(t, o, c, s, r);
1412
+ }
1413
+ return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (o.tables = i), o;
1414
+ }
1415
+ processCellStyles(t, e, o, s, r) {
1416
+ if (!e) return;
1417
+ const i = e.childNodes, n = i.length;
1418
+ for (let t = 0; t < n; t++) {
1419
+ const e = i.item(t);
1420
+ if (1 === e.nodeType && "cellStyle" === e.localName) {
1421
+ const t = parseInt(e.getAttribute("xfId") ?? ""), i = e.getAttribute("name"), n = e.getAttribute("builtinId");
1422
+ let l = i;
1423
+ if (null !== n) {
1424
+ const t = ot.builtInNameFromId(parseInt(n));
1425
+ void 0 !== t && (l = t);
1426
+ }
1427
+ if (r.set(t, l), !s[t]) continue;
1428
+ const a = {
1429
+ name: l,
1430
+ style: s[t]
1431
+ };
1432
+ e.getAttribute("hidden") && (a.hidden = A(e.getAttribute("hidden"))), e.getAttribute("iLevel") && (a.iLevel = parseInt(e.getAttribute("iLevel"))), null !== n && A(e.getAttribute("customBuiltin") ?? "0") && (a.customized = !0), o.push(a);
1433
+ }
1434
+ }
1435
+ }
1436
+ afterVisit(t, e, o) {}
1437
+ },
1438
+ WorkbookVisitor: class extends Tt {
1439
+ visit(t, e, o) {
1440
+ return this.processSheetRefs(t, t.evaluate("sheets", e), o), this.processExternalReferences(t, t.evaluate("externalReferences", e), o), this.processBookViews(t, t.evaluate("bookViews", e), o), this.processDefinedNames(t, t.evaluate("definedNames", e), o), this.processCalcPr(t, t.evaluate("calcPr", e), o), this.processPivotCaches(t, t.evaluate("pivotCaches", e), o), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), o), this.processWorkbookPr(t, t.evaluate("workbookPr", e), o), o;
1441
+ }
1442
+ processPassword(t, e, o, s = "workbook", r = "password") {
1443
+ if (!e) return;
1444
+ const i = {};
1445
+ t.copyFromAttribute(e, `${s}AlgorithmName`, i, "algorithm"), t.copyFromAttribute(e, `${s}HashValue`, i, "hash"), t.copyFromAttribute(e, `${s}SaltValue`, i, "salt"), t.copyFromAttribute(e, `${s}SpinCount`, i, "spinCount", t.INT_COPY), t.copyFromAttribute(e, `${s}Password`, i, "legacyHash"), Object.keys(i).length > 0 && (o[r] = i);
1446
+ }
1447
+ processWorkbookProtection(t, e, o) {
1448
+ if (!e) return;
1449
+ const s = {};
1450
+ this.processPassword(t, e, s, "workbook", "password"), this.processPassword(t, e, s, "revisions", "revisionsPassword");
1451
+ for (const t of T) s[t.key] = R(t, e.getAttribute(t.attribute));
1452
+ return o.protection = s, o;
1453
+ }
1454
+ processCalcPr(t, e, o) {
1455
+ if (!e) return;
1456
+ const s = {};
1457
+ t.copyFromAttribute(e, "calcMode", s, "calcMode", (t) => kt[t] ?? null), t.copyFromAttribute(e, "fullCalcOnLoad", s, "fullCalcOnLoad", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcOnSave", s, "calcOnSave", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcCompleted", s, "calcCompleted", t.BOOLEAN_COPY), t.copyFromAttribute(e, "fullPrecision", s, "fullPrecision", t.BOOLEAN_COPY), t.copyFromAttribute(e, "forceFullCalc", s, "forceFullCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentCalc", s, "concurrentCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentManualCount", s, "concurrentManualCount", t.INT_COPY), t.copyFromAttribute(e, "refMode", s, "refMode"), t.copyFromAttribute(e, "iterate", s, "iterate", t.BOOLEAN_COPY), t.copyFromAttribute(e, "iterateCount", s, "maxIteration", t.INT_COPY), t.copyFromAttribute(e, "iterateDelta", s, "maxIterateChange", t.FLOAT_COPY);
1458
+ const r = e.getAttribute("calcId");
1459
+ null !== r && t.getVisitorParamsState().set("calcId", r), o.calc = s;
1460
+ }
1461
+ processSheetRefs(t, e, o) {
1462
+ if (!e) return;
1463
+ const s = [], r = e.childNodes, i = r.length;
1464
+ for (let e = 0; e < i; e++) {
1465
+ const o = r.item(e);
1466
+ 1 === o.nodeType && "sheet" === o.localName && this.processSheetRef(t, o, s);
1467
+ }
1468
+ o.sheets = s;
1469
+ }
1470
+ processSheetRef(e, s, r) {
1471
+ const i = {};
1472
+ e.copyFromAttribute(s, "name", i, "name"), e.copyFromAttribute(s, "state", i, "visibility"), e.copyFromAttribute(s, "sheetId", i, "sheetId", e.INT_COPY);
1473
+ const n = s.getAttribute("r:id"), l = n ? I(e.getRelationships().get(n)?.type) : null;
1474
+ if (l) {
1475
+ const s = e.readEmbeddedPart(n);
1476
+ if (s?.xml) {
1477
+ const e = { part: s }, n = o(s.xml), a = n ? t((t) => n.get(t)) : void 0;
1478
+ a && (e.tabColor = a), i.kind = l, i.sheet = e, r.push(i);
1479
+ return;
1480
+ }
1481
+ e.warn(`The ${l} sheet '${i.name}' could not be read and was loaded as an empty worksheet.`), r.push(i);
1482
+ return;
1483
+ }
1484
+ const a = n ? e.getRef(n) : null;
1485
+ a && (i.sheet = a), r.push(i);
1486
+ }
1487
+ processExternalReferences(t, e, o) {
1488
+ if (!e) return;
1489
+ const s = [], r = e.childNodes, i = r.length;
1490
+ for (let e = 0; e < i; e++) {
1491
+ const o = r.item(e);
1492
+ if (1 === o.nodeType && "externalReference" === o.localName) {
1493
+ const e = o.getAttribute("r:id"), r = e ? t.getRef(e) : null;
1494
+ s.push(r ?? null);
1495
+ }
1496
+ }
1497
+ s.length > 0 && (o.externalBooks = s);
1498
+ }
1499
+ processPivotCaches(t, e, o) {
1500
+ if (!e) return;
1501
+ const s = [], r = t.evaluate("workbookPr", e.parentNode)?.getAttribute?.("date1904"), i = "1" === r || "true" === r, n = B(t.getVisitorParamsState().get("numFmts"), void 0), l = e.childNodes, a = l.length;
1502
+ for (let e = 0; e < a; e++) {
1503
+ const o = l.item(e);
1504
+ if (1 !== o.nodeType || "pivotCache" !== o.localName) continue;
1505
+ const r = parseInt(o.getAttribute("cacheId") ?? "", 10), a = o.getAttribute("r:id");
1506
+ if (isNaN(r) || !a) continue;
1507
+ const c = t.readEmbeddedPart(a);
1508
+ if (!c) continue;
1509
+ const u = K(c, i, (t) => n.numberFormat(t)), d = !u && c.xml ? w(c.xml, n) : void 0, h = !u && c.xml ? J(c.xml) : void 0;
1510
+ s.push({
1511
+ cacheId: r,
1512
+ part: c,
1513
+ ...d ? { partFormats: d } : {},
1514
+ ...h ? { source: h } : {},
1515
+ ...u
1516
+ });
1517
+ }
1518
+ s.length > 0 && (o.pivotCaches = s);
1519
+ }
1520
+ processBookViews(t, e, o) {
1521
+ if (!e) return;
1522
+ const s = e.childNodes;
1523
+ let r = 0;
1524
+ const i = s.length;
1525
+ for (let e = 0; r < 1 && e < i; e++) {
1526
+ const i = s.item(e);
1527
+ 1 === i.nodeType && "workbookView" === i.localName && (this.processWorkbookView(t, i, o), r++);
1528
+ }
1529
+ }
1530
+ processWorkbookView(t, e, o) {
1531
+ if (!e) return;
1532
+ const s = {}, r = [
1533
+ "xWindow",
1534
+ "yWindow",
1535
+ "windowWidth",
1536
+ "windowHeight"
1537
+ ].map((t) => parseInt(e.getAttribute(t) ?? "", 10));
1538
+ if (r.some((t) => Number.isFinite(t))) {
1539
+ const [t, e, o, i] = r.map((t) => Number.isFinite(t) ? t : 0);
1540
+ s.windowBounds = {
1541
+ left: t,
1542
+ top: e,
1543
+ width: o,
1544
+ height: i
1545
+ };
1546
+ }
1547
+ t.copyFromAttribute(e, "activeTab", s, "activeSheetId", [t.INT_COPY, (t) => t]), e.hasAttribute("activeTab") || (s.activeSheetId = 0), t.copyFromAttribute(e, "showHorizontalScroll", s, "showHorizontalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showVerticalScroll", s, "showVerticalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showSheetTabs", s, "showTabs", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tabRatio", s, "tabRatio", [t.FLOAT_COPY, (t) => t]), t.copyFromAttribute(e, "firstSheet", s, "firstTab", [t.INT_COPY, (t) => t]), t.copyFromAttribute(e, "minimized", s, "minimized", t.BOOLEAN_COPY), t.copyFromAttribute(e, "autoFilterDateGrouping", s, "autoFilterDateGrouping", t.BOOLEAN_COPY);
1548
+ const i = e.getAttribute("visibility");
1549
+ "hidden" !== i && "veryHidden" !== i || (s.visibility = i), Object.keys(s).length > 0 && (o.view = s);
1550
+ }
1551
+ processDefineName(t, e, o, s) {
1552
+ if (!e) return;
1553
+ const r = {}, i = e.firstChild;
1554
+ if (i && 3 === i.nodeType && (r.ref = i.textContent), t.copyFromAttribute(e, "name", r), t.copyFromAttribute(e, "comment", r), t.copyFromAttribute(e, "hidden", r, "hidden", t.BOOLEAN_COPY), e.hasAttribute("localSheetId")) {
1555
+ const o = e.getAttribute("localSheetId");
1556
+ if (!s[o]?.name) return void t.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${o}' which does not exist.`);
1557
+ r.scope = s[o].name;
1558
+ }
1559
+ const n = {};
1560
+ for (const o of U) t.copyFromAttribute(e, o, n);
1561
+ for (const t of H) {
1562
+ const o = e.getAttribute(t);
1563
+ "1" !== o && "true" !== o || (n[t] = !0);
1564
+ }
1565
+ t.copyFromAttribute(e, "functionGroupId", n, "functionGroupId", t.INT_COPY), Object.keys(n).length > 0 && (r.fileAttributes = n), Object.keys(r).length > 0 && o.push(r);
1566
+ }
1567
+ processDefinedNames(t, e, o) {
1568
+ if (!e) return;
1569
+ const s = [], r = e.childNodes, i = r.length;
1570
+ for (let e = 0; e < i; e++) {
1571
+ const i = r.item(e);
1572
+ 1 === i.nodeType && "definedName" === i.localName && this.processDefineName(t, i, s, o.sheets);
1573
+ }
1574
+ s.length > 0 && (o.names = s);
1575
+ }
1576
+ processWorkbookPr(t, e, o) {
1577
+ if (!e) return;
1578
+ t.copyFromAttribute(e, "date1904", o, "date1904", t.BOOLEAN_COPY), t.copyFromAttribute(e, "codeName", o, "codeName"), t.copyFromAttribute(e, "updateLinks", o, "updateLinks");
1579
+ const s = e.getAttribute("hidePivotFieldList");
1580
+ "1" !== s && "true" !== s || (o.hiddenPivotFieldList = !0);
1581
+ }
1582
+ afterVisit(t, e, o) {}
1583
+ },
1584
+ TableVisitor: class {
1585
+ visit(t, e, o) {
1586
+ const s = {};
1587
+ return t.copyFromAttribute(e, "ref", o, "r"), t.getVisitorParamsState().set("ref", o.r), o.v = s, t.copyFromAttribute(e, "name", s), t.copyFromAttribute(e, "displayName", s, "name"), t.copyFromAttribute(e, "headerRowCount", s, "headerRowCount", t.INT_COPY), t.copyFromAttribute(e, "totalsRowCount", s, "totalsRowCount", t.INT_COPY), this.processTableColumns(t, e, s), this.processTableStyleInfo(t, e, s), t.copyFromAttribute(e, "id", s), t.copyFromAttribute(e, "comment", s, "description"), t.copyFromAttribute(e, "connectionId", s, "connectionId", t.INT_COPY), t.copyFromAttribute(e, "tableType", s), t.copyFromAttribute(e, "published", s, "published", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRow", s, "insertRow", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRowShift", s, "insertRowShift", t.BOOLEAN_COPY), s.totalsRowShown = "0" !== e.getAttribute("totalsRowShown"), s;
1588
+ }
1589
+ afterVisit(t, e, o) {
1590
+ const s = o.v;
1591
+ if (t.evaluate("autoFilter", e)) {
1592
+ if (Array.isArray(s.hiddenButtons)) {
1593
+ const t = s.hiddenButtons.length;
1594
+ 0 === t ? s.hiddenButtons = !1 : t === s.columns?.length && (s.hiddenButtons = !0);
1595
+ }
1596
+ } else s.hiddenButtons = !0, s.showButtons = !1;
1597
+ return s;
1598
+ }
1599
+ processTableStyleInfo(t, e, o) {
1600
+ if (!e) return;
1601
+ const s = e.childNodes, r = {}, i = s.length;
1602
+ for (let e = 0; e < i; e++) {
1603
+ const o = s.item(e);
1604
+ 1 === o.nodeType && "tableStyleInfo" === o.localName && (t.copyFromAttribute(o, "name", r), t.copyFromAttribute(o, "showColumnStripes", r, "showColumnStripes", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showFirstColumn", r, "showFirstColumn", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showLastColumn", r, "showLastColumn", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showRowStripes", r, "showRowStripes", t.BOOLEAN_COPY));
1605
+ }
1606
+ Object.keys(r).length > 0 && (o.style = r);
1607
+ }
1608
+ processTableColumn(t, e, o) {
1609
+ if (!e) return null;
1610
+ const s = e.childNodes, r = s.length;
1611
+ for (let e = 0; e < r; e++) {
1612
+ const r = s.item(e);
1613
+ if (1 === r.nodeType && "tableColumn" === r.localName) {
1614
+ const e = {};
1615
+ t.copyFromAttribute(r, "name", e), t.copyFromAttribute(r, "id", e), t.copyFromAttribute(r, "uniqueName", e), t.copyFromAttribute(r, "queryTableFieldId", e), t.copyFromAttribute(r, "totalsRowLabel", e);
1616
+ let s = r.getAttribute("totalsRowFunction");
1617
+ if (null !== s) if ("custom" === s) {
1618
+ const o = t.evaluate("totalsRowFormula", r);
1619
+ o && (e.totalsRowFormula = o.textContent);
1620
+ } else e.totalsRowFormula = s;
1621
+ t.copyFromAttribute(r, "totalsRowLabel", e);
1622
+ const i = t.evaluate("calculatedColumnFormula", r);
1623
+ i?.textContent && (e.calculatedColumnFormula = i.textContent), o.push(e);
1624
+ }
1625
+ }
1626
+ return o;
1627
+ }
1628
+ processTableColumns(t, e, o) {
1629
+ const s = e.childNodes, r = [], i = s.length;
1630
+ for (let e = 0; e < i; e++) {
1631
+ const o = s.item(e);
1632
+ 1 === o.nodeType && "tableColumns" === o.localName && this.processTableColumn(t, o, r);
1633
+ }
1634
+ r.length > 0 && (o.columns = r);
1635
+ }
1636
+ },
1637
+ TableX14Visitor: class {
1638
+ visit(t, e, o) {
1639
+ const s = t.getVisitorParamsState().get("ref");
1640
+ if (s) {
1641
+ const o = t.getVisitorParamsState().get("descriptions");
1642
+ o && (o.add(s, e.getAttribute("altText")), o.add(s, e.getAttribute("altTextSummary")));
1643
+ }
1644
+ return t.copyFromAttribute(e, "altText", o), t.copyFromAttribute(e, "altTextSummary", o), o;
1645
+ }
1646
+ },
1647
+ ExternalLinkVisitor: class {
1648
+ visit(t, e, o) {
1649
+ const s = e.childNodes, r = s.length;
1650
+ let i = null;
1651
+ for (let t = 0; t < r; t++) {
1652
+ const e = s.item(t);
1653
+ if (1 === e.nodeType) {
1654
+ "externalBook" === e.localName && (i = e);
1655
+ break;
1656
+ }
1657
+ }
1658
+ if (!i) return o;
1659
+ e.getAttribute("mc:Ignorable") && (o.mceIgnorable = !0);
1660
+ const n = i.getAttribute("r:id");
1661
+ n && (o.__bookRelId = n);
1662
+ const l = this._findAbsoluteUrlRelId(i);
1663
+ return l && (o.__absoluteUrlRelId = l), o.sheetNames = [], this.processSheetNames(t, i, o), this.processDefinedNames(t, i, o), this.processSheetDataSet(t, i, o), o;
1664
+ }
1665
+ processSheetNames(t, e, o) {
1666
+ const s = this._findChild(e, "sheetNames");
1667
+ if (!s) return;
1668
+ const r = s.childNodes, i = r.length;
1669
+ for (let t = 0; t < i; t++) {
1670
+ const e = r.item(t);
1671
+ 1 === e.nodeType && "sheetName" === e.localName && o.sheetNames.push(e.getAttribute("val") ?? "");
1672
+ }
1673
+ }
1674
+ processDefinedNames(t, e, o) {
1675
+ const s = this._findChild(e, "definedNames");
1676
+ if (!s) return;
1677
+ const r = [], i = s.childNodes, n = i.length;
1678
+ for (let t = 0; t < n; t++) {
1679
+ const e = i.item(t);
1680
+ if (1 !== e.nodeType || "definedName" !== e.localName) continue;
1681
+ const o = e.getAttribute("name");
1682
+ if (!o) continue;
1683
+ const s = {
1684
+ name: o,
1685
+ refersTo: e.getAttribute("refersTo") ?? ""
1686
+ }, n = e.getAttribute("sheetId");
1687
+ null !== n && (s.sheetIndex = parseInt(n, 10)), r.push(s);
1688
+ }
1689
+ r.length > 0 && (o.definedNames = r);
1690
+ }
1691
+ processSheetDataSet(t, e, o) {
1692
+ const s = this._findChild(e, "sheetDataSet");
1693
+ if (!s) return;
1694
+ const r = [], i = s.childNodes, n = i.length;
1695
+ for (let e = 0; e < n; e++) {
1696
+ const o = i.item(e);
1697
+ if (1 !== o.nodeType || "sheetData" !== o.localName) continue;
1698
+ const s = o.getAttribute("sheetId");
1699
+ if (null === s) continue;
1700
+ const n = this.processSheetData(t, o);
1701
+ n.sheetIndex = parseInt(s, 10), "1" === o.getAttribute("refreshError") && (n.refreshError = !0), r.push(n);
1702
+ }
1703
+ r.length > 0 && (o.sheetDataSet = r);
1704
+ }
1705
+ processSheetData(t, e) {
1706
+ const o = new ht.Builder(), s = e.childNodes, r = s.length;
1707
+ for (let t = 0; t < r; t++) {
1708
+ const e = s.item(t);
1709
+ if (1 !== e.nodeType || "row" !== e.localName) continue;
1710
+ const r = e.childNodes, i = r.length;
1711
+ for (let t = 0; t < i; t++) {
1712
+ const e = r.item(t);
1713
+ if (1 !== e.nodeType || "cell" !== e.localName) continue;
1714
+ const s = e.getAttribute("r");
1715
+ if (!s) continue;
1716
+ const i = Q.fastStringToCell(s);
1717
+ if (void 0 === i?.rowIndex || void 0 === i?.colIndex) continue;
1718
+ const n = this._readCellValue(e);
1719
+ void 0 !== n && o.pushAt(i.rowIndex, i.colIndex, n);
1720
+ }
1721
+ }
1722
+ return {
1723
+ sheetIndex: -1,
1724
+ data: o.build()?.tuples ?? []
1725
+ };
1726
+ }
1727
+ _readCellValue(t) {
1728
+ const e = this._findChild(t, "v")?.textContent?.trim();
1729
+ if (void 0 !== e && "" !== e) switch (t.getAttribute("t")) {
1730
+ case null:
1731
+ case "n": return parseFloat(e);
1732
+ case "b": return "1" === e || "true" === e;
1733
+ case "str":
1734
+ default: return e;
1735
+ case "e": {
1736
+ const t = tt.getBuiltInByLabel(e);
1737
+ return t ? {
1738
+ t: "e",
1739
+ v: t.getCode()
1740
+ } : e;
1741
+ }
1742
+ }
1743
+ }
1744
+ _findChild(t, e) {
1745
+ const o = t.childNodes, s = o.length;
1746
+ for (let t = 0; t < s; t++) {
1747
+ const s = o.item(t);
1748
+ if (1 === s.nodeType && s.localName === e) return s;
1749
+ }
1750
+ return null;
1751
+ }
1752
+ _findAbsoluteUrlRelId(t) {
1753
+ const e = this._findChild(t, "alternateUrls");
1754
+ return e ? this._findChild(e, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
1755
+ }
1756
+ },
1757
+ SlicerCacheDefinitionVisitor: class {
1758
+ visit(t, e, o) {
1759
+ t.copyFromAttribute(e, "name", o, "cacheName"), t.copyFromAttribute(e, "sourceName", o);
1760
+ const s = t.evaluate("*/tableSlicerCache", e);
1761
+ return s ? (t.copyFromAttribute(s, "tableId", o), t.copyFromAttribute(s, "column", o, "columnId"), t.copyFromAttribute(s, "sortOrder", o), t.copyFromAttribute(s, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(s, "crossFilter", o), o) : (this.processPivot(t, e, o), o);
1762
+ }
1763
+ processPivot(t, e, o) {
1764
+ const s = [];
1765
+ let r = "";
1766
+ const i = e.childNodes;
1767
+ for (let e = 0; e < i.length; e++) {
1768
+ const n = i.item(e);
1769
+ if (1 !== n.nodeType) continue;
1770
+ if ("pivotTables" === n.localName) {
1771
+ const t = n.childNodes;
1772
+ for (let e = 0; e < t.length; e++) {
1773
+ const o = t.item(e);
1774
+ 1 === o.nodeType && "pivotTable" === o.localName && s.push({
1775
+ tabId: o.getAttribute("tabId") ?? "",
1776
+ name: o.getAttribute("name") ?? ""
1777
+ });
1778
+ }
1779
+ continue;
1780
+ }
1781
+ const l = n.getAttribute("pivotCacheId");
1782
+ if (l && (o.pivotCacheId = l), "state" === n.localName || "timelinePivotFilter" === n.localName) {
1783
+ o.tabular = !0, o.pivotData = (o.pivotData ?? "") + (t.serializeElement(n) ?? "");
1784
+ continue;
1785
+ }
1786
+ if ("data" === n.localName) {
1787
+ let e = null;
1788
+ const s = n.childNodes;
1789
+ for (let t = 0; t < s.length; t++) {
1790
+ const r = s.item(t);
1791
+ if (1 !== r.nodeType) continue;
1792
+ const i = r.getAttribute("pivotCacheId");
1793
+ i && (o.pivotCacheId = i), "tabular" === r.localName && (e = r);
1794
+ }
1795
+ if (e) {
1796
+ o.tabular = !0, t.copyFromAttribute(e, "sortOrder", o), t.copyFromAttribute(e, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(e, "crossFilter", o), t.copyFromAttribute(e, "showMissing", o, "showMissing", t.BOOLEAN_COPY), o.pivotData = t.serializeElement(n) ?? void 0;
1797
+ continue;
1798
+ }
1799
+ }
1800
+ const a = t.serializeElement(n);
1801
+ if (null === a) return;
1802
+ r += a;
1803
+ }
1804
+ o.pivotTables = s, o.pivotBody = r;
1805
+ }
1806
+ },
1807
+ SlicersVisitor: class {
1808
+ visit(t, e, o) {
1809
+ let s = o.slicers;
1810
+ s || (s = {}, o.slicers = s);
1811
+ const r = e.childNodes, i = r.length;
1812
+ for (let e = 0; e < i; e++) {
1813
+ const o = r.item(e);
1814
+ 1 === o.nodeType && "slicer" === o.localName && this.processSlicer(t, o, s);
1815
+ }
1816
+ return s;
1817
+ }
1818
+ processSlicer(t, e, o) {
1819
+ if (!e) return;
1820
+ const s = {};
1821
+ o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
1822
+ const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
1823
+ if (n) for (let t = 0; t < Ot.length; t++) {
1824
+ const e = Ot[t];
1825
+ void 0 !== n[e] && (s[e] = n[e]);
1826
+ }
1827
+ t.copyFromAttribute(e, "caption", s), t.copyFromAttribute(e, "startItem", s, "startItem", t.INT_COPY), t.copyFromAttribute(e, "columnCount", s, "columnCount", t.INT_COPY), t.copyFromAttribute(e, "showCaption", s, "showCaption", t.BOOLEAN_COPY), t.copyFromAttribute(e, "level", s, "level", t.INT_COPY), t.copyFromAttribute(e, "style", s), t.copyFromAttribute(e, "lockedPosition", s, "lockedPosition", t.BOOLEAN_COPY), t.copyFromAttribute(e, "rowHeight", s, "rowHeight", t.INT_COPY);
1828
+ }
1829
+ },
1830
+ TimelinesVisitor: class {
1831
+ visit(t, e, o) {
1832
+ let s = o.slicers;
1833
+ s || (s = {}, o.slicers = s);
1834
+ const r = e.childNodes;
1835
+ for (let e = 0; e < r.length; e++) {
1836
+ const o = r.item(e);
1837
+ 1 === o.nodeType && "timeline" === o.localName && this.processTimeline(t, o, s);
1838
+ }
1839
+ return s;
1840
+ }
1841
+ processTimeline(t, e, o) {
1842
+ const s = {};
1843
+ o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
1844
+ const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
1845
+ if (n) for (let t = 0; t < Ot.length; t++) {
1846
+ const e = Ot[t];
1847
+ void 0 !== n[e] && (s[e] = n[e]);
1848
+ }
1849
+ t.copyFromAttribute(e, "caption", s);
1850
+ const l = {};
1851
+ for (let t = 0; t < e.attributes.length; t++) {
1852
+ const o = e.attributes.item(t);
1853
+ Vt.has(o.name) || o.name.startsWith("xmlns") || (l[o.name] = o.value);
1854
+ }
1855
+ s.timelineAttributes = l;
1856
+ let a = "";
1857
+ const c = e.childNodes;
1858
+ for (let e = 0; e < c.length; e++) {
1859
+ const o = c.item(e);
1860
+ 1 === o.nodeType && (a += t.serializeElement(o) ?? "");
1861
+ }
1862
+ s.timelineBody = a;
1863
+ }
1864
+ },
1865
+ FormControlPrVisitor: class {
1866
+ visit(t, e, o) {
1867
+ const s = {}, r = e.attributes;
1868
+ for (let t = 0; t < r.length; t++) {
1869
+ const e = r.item(t), o = e.name;
1870
+ "xmlns" === o || o.startsWith("xmlns:") || (s[o] = e.value);
1871
+ }
1872
+ const i = [];
1873
+ let n;
1874
+ const l = e.childNodes;
1875
+ for (let e = 0; e < l.length; e++) {
1876
+ const o = l.item(e);
1877
+ if (1 === o.nodeType) if ("itemLst" === o.localName) {
1878
+ const t = o.childNodes;
1879
+ for (let e = 0; e < t.length; e++) {
1880
+ const o = t.item(e);
1881
+ 1 === o.nodeType && "item" === o.localName && i.push(o.getAttribute("val") ?? "");
1882
+ }
1883
+ } else "extLst" === o.localName && (n = t.serializeElement(o) ?? void 0);
1884
+ }
1885
+ const a = E(s, i, n);
1886
+ return o.formControl = a, a;
1887
+ }
1888
+ },
1889
+ DrawingVisitor: class {
1890
+ visit(t, e, o) {
1891
+ return o;
1892
+ }
1893
+ afterVisit(t, e, o) {
1894
+ for (const t of o?.movables ?? []) _t(t, !1);
1895
+ }
1896
+ },
1897
+ DrawingAnchorVisitor: class {
1898
+ visit(t, e, o) {
1899
+ if (!e) return;
1900
+ const s = {};
1901
+ t.copyFromAttribute(e, "editAs", s, "anchorType"), s.anchor = {}, "absoluteAnchor" === e.localName ? (s.anchorType = "absolute", this.processAbsoluteCoord(t, t.evaluate("pos", e), s.anchor, "from", "x", "y"), this.processAbsoluteCoord(t, t.evaluate("ext", e), s.anchor, "to", "cx", "cy")) : "oneCellAnchor" === e.localName ? (this.processOffsetCoord(t, t.evaluate("from", e), s.anchor, "from"), this.processAbsoluteCoord(t, t.evaluate("ext", e), s.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(t, t.evaluate("from", e), s.anchor, "from"), this.processOffsetCoord(t, t.evaluate("to", e), s.anchor, "to"));
1902
+ const r = t.evaluate("clientData", e), i = (t) => {
1903
+ const e = r?.getAttribute(t);
1904
+ return "0" === e || "false" === e;
1905
+ };
1906
+ return i("fPrintsWithSheet") && (s.noPrint = !0), i("fLocksWithSheet") && (s.unlocked = !0), o.movables || (o.movables = []), o.movables.push(s), s;
1907
+ }
1908
+ processAbsoluteCoord(t, e, o, s, r, i) {
1909
+ if (!e) return;
1910
+ const n = {
1911
+ x: 0,
1912
+ y: 0
1913
+ };
1914
+ return n.x = N(e.getAttribute(r)), n.y = N(e.getAttribute(i)), "from" === s ? o.tl = n : o.br = n, o;
1915
+ }
1916
+ processOffsetCoord(t, e, o, s) {
1917
+ if (!e) return;
1918
+ const r = {
1919
+ c: 0,
1920
+ r: 0,
1921
+ x: 0,
1922
+ y: 0
1923
+ };
1924
+ return t.evaluate("col", e) && (r.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (r.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (r.x = N(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (r.y = N(t.evaluate("rowOff", e).textContent)), "from" === s ? o.tl = r : o.br = r, o;
1925
+ }
1926
+ },
1927
+ DrawingGraphicFrameVisitor: class extends Ft {
1928
+ visit(t, e, o) {
1929
+ if (!e) return;
1930
+ if (this.isGroupContent(o)) {
1931
+ if (t.getPath().includes("Fallback")) return {};
1932
+ const { movable: s } = this.readMemberHeader(t, e, "graphicFrame"), r = t.evaluate("xfrm", e);
1933
+ if (r) {
1934
+ a(r, s);
1935
+ const e = t.evaluate("off", r), o = t.evaluate("ext", r);
1936
+ s.anchor = {
1937
+ tl: {
1938
+ x: N(e?.getAttribute("x") ?? null) ?? 0,
1939
+ y: N(e?.getAttribute("y") ?? null) ?? 0
1940
+ },
1941
+ br: {
1942
+ x: N(o?.getAttribute("cx") ?? null) ?? 0,
1943
+ y: N(o?.getAttribute("cy") ?? null) ?? 0
1944
+ }
1945
+ };
1946
+ }
1947
+ const i = this.readGraphic(t, e), n = "chart" === i.type ? {
1948
+ ...s.content.json,
1949
+ ...i.json
1950
+ } : i.json;
1951
+ return s.content = {
1952
+ ...s.content,
1953
+ type: i.type,
1954
+ json: n
1955
+ }, o.members.push(s), i.json;
1956
+ }
1957
+ o = super.visit(t, e, o);
1958
+ const s = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1959
+ if (s) {
1960
+ const e = t.evaluate("graphicFrameLocks", s);
1961
+ e && e.hasAttribute("noChangeAspect") && (o.lockAspect = "1" === e.getAttribute("noChangeAspect"));
1962
+ }
1963
+ const r = this.readGraphic(t, e);
1964
+ return this.setContent(o, r), r;
1965
+ }
1966
+ readGraphic(t, e) {
1967
+ const o = t.evaluate("graphic/graphicData", e), s = {
1968
+ type: "graphicFrame",
1969
+ json: {}
1970
+ };
1971
+ if (!o) return s;
1972
+ const r = o.childNodes, i = r.length;
1973
+ for (let o = 0; o < i; o++) {
1974
+ const i = r.item(o);
1975
+ if (1 === i.nodeType) try {
1976
+ let o = i.localName;
1977
+ "chart" === o ? o = "chart" : "slicer" !== o && "timeslicer" !== o || (o = "slicer"), s.type = o;
1978
+ const r = i.getAttribute("r:id");
1979
+ if ("chart" === o && r) {
1980
+ const o = this.readSourceId(t, e), i = t.readEmbeddedPart(r) ?? void 0;
1981
+ let n;
1982
+ try {
1983
+ const e = i?.xml ? q(i.xml) : null;
1984
+ n = e?.model, e?.lossy && t.warn("A chart states something its model does not; it is saved as it was until it is changed.", { onceKey: "xlsx.chart.lossy" });
1985
+ } catch (e) {
1986
+ t.warn(`A chart could not be read into the chart model; it is kept as its markup: ${e?.message ?? e}`, { onceKey: "xlsx.chart.model" });
1987
+ }
1988
+ s.json = {
1989
+ sourceId: o,
1990
+ part: i,
1991
+ model: n
1992
+ };
1993
+ } else if ("slicer" === o) {
1994
+ const o = this.readSourceId(t, e);
1995
+ void 0 !== o && (s.json = { sourceId: o });
1996
+ } else r && (s.json = t.getRef(r));
1997
+ } catch (e) {
1998
+ t.warn(`Unable to read a graphic frame: ${e?.message ?? e}`, { onceKey: "xlsx.drawing.graphicFrame" });
1999
+ }
2000
+ }
2001
+ return s;
2002
+ }
2003
+ },
2004
+ DrawingSpVisitor: Bt,
2005
+ DrawingPicVisitor: class extends Ft {
2006
+ visit(t, e, o) {
2007
+ if (!e) return;
2008
+ if (this.isGroupContent(o)) {
2009
+ if (t.getPath().includes("Fallback")) return {};
2010
+ const { movable: s, content: r } = this.readMemberHeader(t, e, "picture"), i = this.readImage(t, e);
2011
+ return i ? (this.readPictureDetails(t, e, i, s, r), o.members.push(s), r) : {};
2012
+ }
2013
+ const s = super.visit(t, e, o), r = this.readImage(t, e);
2014
+ if (null === r) return;
2015
+ const i = {}, n = this.readSourceId(t, e);
2016
+ return void 0 !== n && (i.sourceId = n), this.readPictureDetails(t, e, r, s, i), this.setContent(s, {
2017
+ type: "picture",
2018
+ json: i
2019
+ }), i;
2020
+ }
2021
+ readPictureDetails(t, e, o, s, r) {
2022
+ void 0 !== o?.resId && (r.resId = o.resId), o?.image && (r.image = o.image);
2023
+ const i = e.getAttribute("macro");
2024
+ i && (r.macro = i), e.hasAttribute("fPublished") && (r.published = A(e.getAttribute("fPublished")));
2025
+ const n = t.evaluate("nvPicPr/cNvPicPr", e);
2026
+ if (n?.getAttribute) {
2027
+ "0" === n.getAttribute("preferRelativeResize") && (r.noRelativeResize = !0);
2028
+ const e = this.readLocks(t.evaluate("picLocks", n));
2029
+ e && (r.locks = e), s.lockAspect = e?.noChangeAspect ?? !1;
2030
+ }
2031
+ }
2032
+ readImage(t, e) {
2033
+ const o = t.evaluate("blipFill", e), s = o ? t.evaluate("blip", o) : null;
2034
+ if (!s) return;
2035
+ if (!(s.getAttribute("r:embed") ?? s.getAttribute("embed") ?? s.getAttribute("r:link") ?? s.getAttribute("link"))) return t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null;
2036
+ const { type: r, resId: i, ...n } = new m().processImageFill(t, o);
2037
+ return !n.tile && n.stretch && 0 === Object.keys(n.stretch).length && delete n.stretch, n.extLst && Lt.test(n.extLst) && delete n.extLst, {
2038
+ resId: i,
2039
+ image: Object.keys(n).length > 0 ? n : void 0
2040
+ };
2041
+ }
2042
+ },
2043
+ DrawingGrpSpVisitor: class extends Ft {
2044
+ constructor(...t) {
2045
+ super(...t), this._fills = new m();
2046
+ }
2047
+ visit(t, e, o) {
2048
+ if (!e) return;
2049
+ const s = this.isGroupContent(o);
2050
+ let r, i;
2051
+ if (s) {
2052
+ if (t.getPath().includes("Fallback")) return {};
2053
+ const s = this.readMemberHeader(t, e, "group");
2054
+ r = s.movable, i = s.content, o.members.push(r);
2055
+ } else {
2056
+ if (t.getPath().includes("Fallback") && o.content) return {};
2057
+ r = super.visit(t, e, o), i = {};
2058
+ const s = this.readSourceId(t, e);
2059
+ void 0 !== s && (i.sourceId = s), this.setContent(r, {
2060
+ type: "group",
2061
+ json: i
2062
+ });
2063
+ }
2064
+ i.members = [];
2065
+ const n = t.evaluate("nvGrpSpPr/cNvGrpSpPr/grpSpLocks", e);
2066
+ n?.hasAttribute?.("noChangeAspect") && (r.lockAspect = "1" === n.getAttribute("noChangeAspect"));
2067
+ const l = this.readLocks(n);
2068
+ l && (i.locks = l);
2069
+ const c = t.evaluate("grpSpPr", e);
2070
+ if (c) {
2071
+ const e = t.evaluate("xfrm", c);
2072
+ if (e) {
2073
+ a(e, r), "1" === e.getAttribute("flipH") && (r.flipH = !0), "1" === e.getAttribute("flipV") && (r.flipV = !0);
2074
+ const o = Dt(t, e, "off", "ext"), n = Dt(t, e, "chOff", "chExt") ?? o;
2075
+ n && (i.childBounds = n), s && o && (r.anchor = {
2076
+ tl: {
2077
+ x: o.x,
2078
+ y: o.y
2079
+ },
2080
+ br: {
2081
+ x: o.width,
2082
+ y: o.height
2083
+ }
2084
+ });
2085
+ }
2086
+ const o = this._fills.getFill(t, c);
2087
+ o && Object.keys(o).length > 0 && (i.fill = o);
2088
+ const n = this._fills.getEffects(t, c);
2089
+ n && (i.effects = n);
2090
+ const l = t.evaluate("scene3d", c), u = l ? t.serializeElement(l) : null;
2091
+ u && (i.scene3d = u);
2092
+ const d = t.evaluate("extLst", c), h = d ? t.serializeElement(d) : null;
2093
+ h && (i.extLst = {
2094
+ ...i.extLst,
2095
+ properties: h
2096
+ });
2097
+ }
2098
+ return i;
2099
+ }
2100
+ },
2101
+ DrawingCxnSpVisitor: class extends Bt {
2102
+ visit(t, e, o) {
2103
+ if (e) return this.visitShape(t, e, o, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
2104
+ }
2105
+ },
2106
+ MetadataVisitor: class {
2107
+ visit(t, e, o) {
2108
+ const s = [], r = /* @__PURE__ */ new Map(), i = {
2109
+ cells: [],
2110
+ values: []
2111
+ }, n = e.childNodes;
2112
+ for (let t = 0; t < n.length; t++) {
2113
+ const e = n.item(t);
2114
+ if (1 === e.nodeType) switch (e.localName) {
2115
+ case "metadataTypes":
2116
+ this._parseMetadataTypes(e, s, r);
2117
+ break;
2118
+ case "futureMetadata":
2119
+ this._attachFutureMetadata(e, r);
2120
+ break;
2121
+ case "cellMetadata":
2122
+ this._resolveBlocks(e, s, i.cells);
2123
+ break;
2124
+ case "valueMetadata": this._resolveBlocks(e, s, i.values);
2125
+ }
2126
+ }
2127
+ return o.metadata = i, i;
2128
+ }
2129
+ _parseMetadataTypes(t, e, o) {
2130
+ const s = t.childNodes;
2131
+ for (let t = 0; t < s.length; t++) {
2132
+ const r = s.item(t);
2133
+ if (1 === r.nodeType && "metadataType" === r.localName) {
2134
+ const t = this._parseMetadataType(r);
2135
+ e.push(t), o.set(t.name, t);
2136
+ }
2137
+ }
2138
+ }
2139
+ _parseMetadataType(t) {
2140
+ const e = {
2141
+ name: t.getAttribute("name") ?? "",
2142
+ _blocks: []
2143
+ }, o = t.getAttribute("minSupportedVersion");
2144
+ null != o && (e.minSupportedVersion = Number(o));
2145
+ for (const o of [
2146
+ "copy",
2147
+ "pasteAll",
2148
+ "pasteValues",
2149
+ "merge",
2150
+ "splitFirst",
2151
+ "splitAll",
2152
+ "rowColShift",
2153
+ "clearFormats",
2154
+ "clearComments",
2155
+ "assign",
2156
+ "coerce",
2157
+ "cellMeta",
2158
+ "adjust",
2159
+ "trans",
2160
+ "delete",
2161
+ "edit"
2162
+ ]) "1" === t.getAttribute(o) && (e[o] = !0);
2163
+ return e;
2164
+ }
2165
+ _attachFutureMetadata(t, e) {
2166
+ const o = t.getAttribute("name") ?? "", s = e.get(o);
2167
+ if (!s) return;
2168
+ const r = t.childNodes;
2169
+ for (let t = 0; t < r.length; t++) {
2170
+ const e = r.item(t);
2171
+ 1 === e.nodeType && "bk" === e.localName && s._blocks.push(this._parseFutureBlock(e));
2172
+ }
2173
+ }
2174
+ _parseFutureBlock(t) {
2175
+ const e = {}, o = t.childNodes;
2176
+ for (let t = 0; t < o.length; t++) {
2177
+ const s = o.item(t);
2178
+ if (1 !== s.nodeType || "extLst" !== s.localName) continue;
2179
+ const r = s.childNodes;
2180
+ for (let t = 0; t < r.length; t++) {
2181
+ const o = r.item(t);
2182
+ if (1 !== o.nodeType || "ext" !== o.localName) continue;
2183
+ const s = o.childNodes;
2184
+ for (let t = 0; t < s.length; t++) {
2185
+ const o = s.item(t);
2186
+ 1 === o.nodeType && ("dynamicArrayProperties" === o.localName ? (e.fDynamic = "1" === o.getAttribute("fDynamic"), e.fCollapsed = "1" === o.getAttribute("fCollapsed")) : "rvb" === o.localName && (e.richValueIndex = Number(o.getAttribute("i") ?? "0")));
2187
+ }
2188
+ }
2189
+ }
2190
+ return e;
2191
+ }
2192
+ _resolveBlocks(t, e, o) {
2193
+ const s = t.childNodes;
2194
+ for (let t = 0; t < s.length; t++) {
2195
+ const r = s.item(t);
2196
+ 1 === r.nodeType && "bk" === r.localName && o.push(this._resolveBlock(r, e));
2197
+ }
2198
+ }
2199
+ _resolveBlock(t, e) {
2200
+ const o = /* @__PURE__ */ new Map(), s = t.childNodes;
2201
+ for (let t = 0; t < s.length; t++) {
2202
+ const r = s.item(t);
2203
+ if (1 !== r.nodeType || "rc" !== r.localName) continue;
2204
+ const i = Number(r.getAttribute("t")), n = Number(r.getAttribute("v")), l = e[i - 1];
2205
+ if (!l) continue;
2206
+ const { _blocks: a, ...c } = l, u = { ...c };
2207
+ for (const t of Object.keys(u)) void 0 === u[t] && delete u[t];
2208
+ const d = a[n];
2209
+ d && (void 0 !== d.fDynamic && (u.fDynamic = d.fDynamic, u.fCollapsed = d.fCollapsed ?? !1), void 0 !== d.richValueIndex && (u.richValueIndex = d.richValueIndex)), o.set(l.name, u);
2210
+ }
2211
+ return o;
2212
+ }
2213
+ },
2214
+ FeaturePropertyBagVisitor: class {
2215
+ visit(t, e, o) {
2216
+ const s = [], r = e.childNodes;
2217
+ for (let t = 0; t < r.length; t++) {
2218
+ const e = r.item(t);
2219
+ 1 === e.nodeType && "bag" === e.localName && s.push(this._readBag(e));
2220
+ }
2221
+ const i = [], n = s.find((t) => "XFComplements" === t.type)?.arrays.get("MappedFeaturePropertyBags") ?? [];
2222
+ for (let e = 0; e < n.length; e++) {
2223
+ const o = s[n[e]]?.ids.get("XFControls"), r = void 0 !== o ? s[o]?.ids.get("CellControl") : void 0, l = void 0 !== r ? s[r]?.type : void 0, a = l ? Et[l] : void 0;
2224
+ a || t.warn(`A cell format's feature '${l ?? "unknown"}' is not read; its cells keep their values.`), i.push(a ? { type: a } : null);
2225
+ }
2226
+ const l = { controls: i };
2227
+ return o.featurePropertyBag = l, l;
2228
+ }
2229
+ _readBag(t) {
2230
+ const e = {
2231
+ type: t.getAttribute("type") ?? "",
2232
+ ids: /* @__PURE__ */ new Map(),
2233
+ arrays: /* @__PURE__ */ new Map()
2234
+ }, o = t.childNodes;
2235
+ for (let t = 0; t < o.length; t++) {
2236
+ const s = o.item(t);
2237
+ if (1 !== s.nodeType) continue;
2238
+ const r = s.getAttribute("k") ?? "";
2239
+ if ("bagId" === s.localName) {
2240
+ const t = parseInt(s.textContent ?? "", 10);
2241
+ isNaN(t) || e.ids.set(r, t);
2242
+ } else if ("a" === s.localName) {
2243
+ const t = [], o = s.childNodes;
2244
+ for (let e = 0; e < o.length; e++) {
2245
+ const s = o.item(e);
2246
+ if (1 !== s.nodeType || "bagId" !== s.localName) continue;
2247
+ const r = parseInt(s.textContent ?? "", 10);
2248
+ isNaN(r) || t.push(r);
2249
+ }
2250
+ e.arrays.set(r, t);
2251
+ }
2252
+ }
2253
+ return e;
2254
+ }
2255
+ },
2256
+ CommentsVisitor: class {
2257
+ visit(t, e, o) {
2258
+ if (!e) return;
2259
+ const s = [];
2260
+ this.processAuthors(t, t.evaluate("authors", e), s), s.length > 0 && (o.authors = s);
2261
+ const r = [];
2262
+ return o.comments = r, r;
2263
+ }
2264
+ processAuthors(t, e, o) {
2265
+ if (!e) return;
2266
+ const s = e.childNodes, r = s.length;
2267
+ for (let t = 0; t < r; t++) {
2268
+ const e = s.item(t);
2269
+ if (1 === e.nodeType && "author" === e.localName) {
2270
+ const t = e.firstChild;
2271
+ t && 3 === t.nodeType && o.push(t.textContent);
2272
+ }
2273
+ }
2274
+ }
2275
+ },
2276
+ CommentVisitor: class {
2277
+ visit(t, e, o) {
2278
+ if (!e) return;
2279
+ const s = e.getAttribute("ref");
2280
+ if (!s) return;
2281
+ const r = { content: "" };
2282
+ if (e.hasAttribute("authorId")) {
2283
+ const t = parseInt(e.getAttribute("authorId"), 10);
2284
+ isNaN(t) || (r.authorId = t);
2285
+ }
2286
+ return r.content = function(t) {
2287
+ if (!t) return "";
2288
+ const e = [];
2289
+ let o = !0;
2290
+ const s = t.childNodes;
2291
+ for (let t = 0; t < s.length; t++) {
2292
+ const r = s.item(t);
2293
+ if (1 === r.nodeType) {
2294
+ if ("t" === r.localName) e.push({ text: r.textContent ?? "" });
2295
+ else if ("r" === r.localName) {
2296
+ const t = { text: "" }, s = r.childNodes;
2297
+ for (let e = 0; e < s.length; e++) {
2298
+ const o = s.item(e);
2299
+ if (1 === o.nodeType) {
2300
+ if ("t" === o.localName) t.text += o.textContent ?? "";
2301
+ else if ("rPr" === o.localName) {
2302
+ const e = Yt(o);
2303
+ e && (t.font = e);
2304
+ }
2305
+ }
2306
+ }
2307
+ t.font && (o = !1), e.push(t);
2308
+ }
2309
+ }
2310
+ }
2311
+ return 0 === e.length ? t.textContent ?? "" : o ? e.map((t) => t.text).join("") : { runs: e };
2312
+ }(t.evaluate("text", e)), o.push({
2313
+ r: s,
2314
+ v: r
2315
+ }), r;
2316
+ }
2317
+ },
2318
+ ThreadedCommentsVisitor: class {
2319
+ visit(t, e, o) {
2320
+ if (!e) return;
2321
+ const s = [];
2322
+ return o.comments = s, s;
2323
+ }
2324
+ },
2325
+ ThreadedCommentVisitor: class {
2326
+ visit(t, e, o) {
2327
+ if (!e) return;
2328
+ const s = {};
2329
+ t.copyFromAttribute(e, "id", s, "id", S);
2330
+ const r = e.getAttribute("ref");
2331
+ t.copyFromAttribute(e, "personId", s, "personId", S), t.copyFromAttribute(e, "parentId", s, "parentId", S);
2332
+ const i = e.getAttribute("dT");
2333
+ i && (s.dt = function(t) {
2334
+ const e = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(t.trim());
2335
+ if (!e) return t;
2336
+ const [, o, s, r] = e;
2337
+ return `${o}${s ? `.${(s + "00").substring(0, 3)}` : ""}${r ?? "Z"}`;
2338
+ }(i)), e.hasAttribute("done") && (s.done = A(e.getAttribute("done")));
2339
+ const n = function(t) {
2340
+ let e;
2341
+ const o = t.childNodes;
2342
+ for (let t = 0; t < o.length; t++) {
2343
+ const s = o.item(t);
2344
+ if (1 !== s.nodeType || "mentions" !== s.localName) continue;
2345
+ const r = s.childNodes;
2346
+ for (let t = 0; t < r.length; t++) {
2347
+ const o = r.item(t);
2348
+ if (1 !== o.nodeType || "mention" !== o.localName) continue;
2349
+ const s = o.getAttribute("mentionId"), i = o.getAttribute("mentionpersonId");
2350
+ if (!s || !i) continue;
2351
+ const n = {
2352
+ id: S(s),
2353
+ personId: S(i)
2354
+ }, l = parseInt(o.getAttribute("startIndex") ?? "", 10);
2355
+ isNaN(l) || (n.startIndex = l);
2356
+ const a = parseInt(o.getAttribute("length") ?? "", 10);
2357
+ isNaN(a) || (n.length = a), (e ??= []).push(n);
2358
+ }
2359
+ }
2360
+ return e;
2361
+ }(e);
2362
+ return n && (s.mentions = n), o.push({
2363
+ r,
2364
+ v: s
2365
+ }), s;
2366
+ }
2367
+ },
2368
+ PersonListVisitor: class {
2369
+ visit(t, e, o) {
2370
+ const s = [], r = e.childNodes, i = r.length;
2371
+ for (let e = 0; e < i; e++) {
2372
+ const o = r.item(e);
2373
+ if (1 === o.nodeType && "person" === o.localName) {
2374
+ const e = {};
2375
+ t.copyFromAttribute(o, "id", e, "id", S), t.copyFromAttribute(o, "displayName", e), t.copyFromAttribute(o, "userId", e, "userId", S), t.copyFromAttribute(o, "providerId", e), s.push(e);
2376
+ }
2377
+ }
2378
+ return s.length > 0 && (o.persons = s), s;
2379
+ }
2380
+ }
2381
+ }, Mt = class {
2382
+ constructor(t, e) {
2383
+ this.path = t, this.visitor = e;
2384
+ }
2385
+ }, zt = class {
2386
+ constructor() {
2387
+ this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new Xt.RelsVisitor()), this.registerVisitor("cp:coreProperties", new Xt.CorePropertiesVisitor()), this.registerVisitor("Properties", new Xt.AppPropertiesVisitor()), this.registerVisitor("spPr", new Xt.ShapePropertiesVisitor()), this.registerVisitor("txBody", new Xt.ShapeTextVisitor()), this.registerVisitor("txPr", new Xt.TextPropertiesVisitor()), this.registerVisitor("a:theme", new Xt.ThemeVisitor()), this.registerVisitor("a:theme", new Xt.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new Xt.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Xt.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("a:theme", new Xt.ObjectDefaultsVisitor(), "objectDefaults"), this.registerVisitor("autoFilter", new Xt.AutoFilterVisitor()), this.registerVisitor("sortState", new Xt.SortStateVisitor()), this.registerVisitor("s:workbook", new Xt.WorkbookVisitor()), this.registerVisitor("styleSheet", new Xt.SheetStyleVisitor()), this.registerVisitor("x14:table", new Xt.TableX14Visitor()), this.registerVisitor("table", new Xt.TableVisitor()), this.registerVisitor("externalLink", new Xt.ExternalLinkVisitor()), this.registerVisitor("wsDr", new Xt.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new Xt.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new Xt.DrawingSpVisitor()), this.registerVisitor("grpSp", new Xt.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new Xt.DrawingCxnSpVisitor()), this.registerVisitor("pic", new Xt.DrawingPicVisitor()), this.registerVisitor("metadata", new Xt.MetadataVisitor()), this.registerVisitor("FeaturePropertyBags", new Xt.FeaturePropertyBagVisitor()), this.registerVisitor("comments", new Xt.CommentsVisitor()), this.registerVisitor("comment", new Xt.CommentVisitor()), this.registerVisitor("ThreadedComments", new Xt.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new Xt.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new Xt.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new Xt.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new Xt.SlicersVisitor()), this.registerVisitor("timelineCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("timelines", new Xt.TimelinesVisitor()), this.registerVisitor("formControlPr", new Xt.FormControlPrVisitor());
2388
+ }
2389
+ registerVisitor(t, e, o = null) {
2390
+ -1 === t.indexOf(":") && (t = "*:" + t);
2391
+ const s = t.split(":"), r = s.length > 1 ? s[1] : s[0];
2392
+ if (!o) return this.visitorsByXmlTagName.set(r, e), void this.visitorsByXmlTagName.set(t, e);
2393
+ let i = this.scopedVisitorsByXmlTagName.get(r);
2394
+ i || (i = [], this.scopedVisitorsByXmlTagName.set(r, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new Mt(o, e));
2395
+ }
2396
+ parseDxf(t, e = "", o = Z.EmptyObject) {
2397
+ this.visitorParamsState || (this.visitorParamsState = /* @__PURE__ */ new Map());
2398
+ const s = this.visitorParamsState, r = s.get("processingDXFs");
2399
+ s.set("processingDXFs", !0);
2400
+ try {
2401
+ const s = new yt(null, this, "/dxf", t, {}, e, o), r = {};
2402
+ return new Xt.SheetStyleVisitor().processDXF(s, t, r), r;
2403
+ } finally {
2404
+ void 0 === r ? s.delete("processingDXFs") : s.set("processingDXFs", r);
2405
+ }
2406
+ }
2407
+ getVisitorParamsState() {
2408
+ return this.visitorParamsState;
2409
+ }
2410
+ transform(t, e, o = Z.EmptyObject) {
2411
+ const s = t.documentElement;
2412
+ this.visitorParamsState && !o?.paramMap || (this.visitorParamsState = o?.paramMap ?? /* @__PURE__ */ new Map());
2413
+ const r = {};
2414
+ let i = this.visitorsByXmlTagName.get(s.nodeName);
2415
+ if (i || (i = this.visitorsByXmlTagName.get(s.localName)), !i) throw new Error(`A visitor for the root element: '${s.nodeName}' or '${s.localName}' must be registered.`);
2416
+ const n = "/" + s.localName, l = new yt(null, this, n, s, r, e, o), a = [];
2417
+ this._doWalk(i, l, a, s, r, e, o);
2418
+ const c = a.length;
2419
+ for (let t = 0; t < c; t++) {
2420
+ const e = a[t];
2421
+ try {
2422
+ e.visitor?.afterVisit?.(e.context, e.elemParent, e.jsonParent);
2423
+ } catch (t) {
2424
+ e.context.warn(`Unable to finish reading '${e.context.getPath()}': ${t?.message ?? t}`, { onceKey: "xlsx.transform.afterVisit" });
2425
+ }
2426
+ }
2427
+ return r;
2428
+ }
2429
+ _walkScoped(t, e, o, s, r, i, n) {
2430
+ const l = this.scopedVisitorsByXmlTagName.get(t), a = l ? l.length : 0;
2431
+ for (let c = 0; c < a; c++) {
2432
+ const a = l[c];
2433
+ let u = null;
2434
+ try {
2435
+ u = e.evaluate(a.path, s);
2436
+ } catch (o) {
2437
+ e.warn(`Invalid path '${a.path}' for '${t}'.`, { onceKey: "xlsx.transform.invalidPath" });
2438
+ }
2439
+ if (!u) continue;
2440
+ const d = (t) => {
2441
+ let l = t.localName, c = t.parentNode;
2442
+ for (; c && c !== s;) l = c.localName + "/" + l, c = c.parentNode;
2443
+ const u = e.getPath() + "/" + l;
2444
+ if (a.visitor) {
2445
+ const s = new yt(e, this, u, e.getElemRoot(), e.getJsonRoot(), i, n);
2446
+ this._doWalk(a.visitor, s, o, t, r, i, n);
2447
+ }
2448
+ };
2449
+ if (u.length > 0) {
2450
+ const t = u, e = t.length;
2451
+ for (let o = 0; o < e; o++) d(t.item(o));
2452
+ } else d(u);
2453
+ }
2454
+ }
2455
+ _doWalk(t, e, o, s, r, i, n) {
2456
+ let l = null;
2457
+ t && (o.push({
2458
+ visitor: t,
2459
+ context: e,
2460
+ elemParent: s,
2461
+ jsonParent: r
2462
+ }), l = t.visit(e, s, r)), l || (l = r);
2463
+ const a = s.localName;
2464
+ this._walkScoped(a, e, o, s, l, i, n);
2465
+ const c = this.visitorsByXmlTagName, u = e.getElemRoot(), d = e.getJsonRoot(), h = s.childNodes, p = h.length;
2466
+ for (let t = 0; t < p; t++) {
2467
+ const s = h.item(t);
2468
+ if (1 !== s.nodeType) continue;
2469
+ const a = s;
2470
+ let p = a.nodeName, m = c.get(p);
2471
+ m || (p = a.localName, m = c.get(p));
2472
+ const f = e.getPath() + "/" + p, g = new yt(e, this, f, u, d, i, n);
2473
+ this._doWalk(m, g, o, a, l ?? r, i, n);
2474
+ }
2475
+ return l;
2476
+ }
2477
+ };
2478
+ export { zt as DOMTransformer, yt as ExecutionContext, l as NumberUtils, n as VisitorUtils };