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

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