@sheetxl/studio-vanilla 0.4.11 → 0.4.12

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 (96) hide show
  1. package/browser/cjs/{BlSFY6zLlebuejdV.cjs → B35OZ0mE8aINQPP9.cjs} +2 -2
  2. package/browser/cjs/{DiBy6-IxLscyMW2y.cjs → BPzEQNENF-gEBkg9.cjs} +2 -2
  3. package/browser/cjs/{C7EZCTczsC-gkRcq.cjs → BUokV6yuzE-_8MyK.cjs} +2 -2
  4. package/browser/cjs/{T4SHYo66xDT3l9JN.cjs → BeZHmOKfa37mFNAu.cjs} +2 -2
  5. package/browser/cjs/{BplA5pDzOJpfTZuA.cjs → BflJ_0gT9lQtDvY_.cjs} +2 -2
  6. package/browser/cjs/{DFspSkki779xN-Ey.cjs → BwN8vKi5o3-PbIMo.cjs} +2 -2
  7. package/browser/cjs/{D3iOk-Q2tRdUeTcn.cjs → C3OizZPVuxO2fjSG.cjs} +1 -1
  8. package/browser/cjs/{BshvMtUxTJHj3JQN.cjs → CBL6KkiWI2RPflEN.cjs} +2 -2
  9. package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +7 -0
  10. package/browser/cjs/{vfUix5Di0Ro8tEID.cjs → CTrEV_UpxC0W6cZZ.cjs} +2 -2
  11. package/browser/cjs/{CFcjX5-nVsgzdZ4F.cjs → CU30GVjjFXl44vEU.cjs} +1 -1
  12. package/browser/cjs/{DgBn3aW39yjgm0X_.cjs → CZWBxvUXzfpn_zmc.cjs} +2 -2
  13. package/browser/cjs/{DrlS1oz9Nea8Pm3j.cjs → Ccs2ouvlLekaLGH0.cjs} +2 -2
  14. package/browser/cjs/{B0rdyyttE2Aibsag.cjs → Ce-8L4Viq3I_6j0i.cjs} +2 -2
  15. package/browser/cjs/{SzxJv7OUs5ojl8gx.cjs → CtNjLzIHB8WX63Bl.cjs} +2 -2
  16. package/browser/cjs/{Dx-jp_LJxWbAScyA.cjs → DAHpsyykuPBkoh-Z.cjs} +1 -1
  17. package/browser/cjs/{B2e7dDI-zKoqXpIW.cjs → DJbKKxeeTEHHA1gR.cjs} +20 -20
  18. package/browser/cjs/{CjZbhk41S1qO_74G.cjs → D_VQzwC1zzTJyKtG.cjs} +1 -1
  19. package/browser/cjs/{Db_Ew1r6yOMYylvA.cjs → GrsZZ_mEdsM5dEMA.cjs} +2 -2
  20. package/browser/cjs/{BPTHTRDvNOVkUJGa.cjs → JKEGlXjMwGnXk_Gv.cjs} +2 -2
  21. package/browser/cjs/{C5FXOMLhAu_KTjVe.cjs → L1iE_VcelYZIy0wI.cjs} +1 -1
  22. package/browser/cjs/{DFtyXc7YFh9dIp74.cjs → Q_VvA-yUQx3xFKiJ.cjs} +1 -1
  23. package/browser/cjs/{BAyEOOtO-9sHQQRW.cjs → fTGpiXzFm3K_u2Fm.cjs} +2 -2
  24. package/browser/cjs/{CuTW2Pt-L5n-hNxV.cjs → hwDUzorB6aCvH1eL.cjs} +1 -1
  25. package/browser/cjs/index.cjs +2 -2
  26. package/browser/cjs/{BuWtGFX0HiBezGjw.cjs → no5c2H18QD2qmOH6.cjs} +2 -2
  27. package/browser/esm/{BALnKy2Fp7fyk-lc.mjs → B4Mm5gczpI_k2zzN.mjs} +2 -2
  28. package/browser/esm/{BXUGsC1Mo3FP8vnW.mjs → B8ISUdOxsJMYWzNN.mjs} +2 -2
  29. package/browser/esm/{BGpv6Kq7eBlJy43T.mjs → BnJiF38TGudjoHzT.mjs} +1 -1
  30. package/browser/esm/Bts4nCgfCAUpTfxz.mjs +7 -0
  31. package/browser/esm/{DtmE60AvstK9u0Ta.mjs → C3cyAbIH8Qc8MIFN.mjs} +20 -20
  32. package/browser/esm/C4jlaVv8bELgiHyE.mjs +7 -0
  33. package/browser/esm/{CFFC0SNc24a0Dxnh.mjs → CYIhGb86r-kKOrP5.mjs} +2 -2
  34. package/browser/esm/{B905wKzTtod-jbsD.mjs → CcpskguvlvemArQn.mjs} +2 -2
  35. package/browser/esm/CeRfALx1iU5fqOUg.mjs +7 -0
  36. package/browser/esm/CfYWmP_Hots5f0f6.mjs +7 -0
  37. package/browser/esm/CkarbqNx_lhlBnw7.mjs +7 -0
  38. package/browser/esm/D2PlWNQjrTgf6GuR.mjs +7 -0
  39. package/browser/esm/{Cc_VWd0wF5-39LsI.mjs → D3KNxvnrwR6_fTJE.mjs} +1 -1
  40. package/browser/esm/{Bo_ZPRrOQrqOVHAF.mjs → DIJyH94oCzUnlcNZ.mjs} +2 -2
  41. package/browser/esm/{De6RPxc4p_jXLlT5.mjs → DVAG1NxFe3cMjLE1.mjs} +1 -1
  42. package/browser/esm/DVqga7g7j0FUiM6p.mjs +7 -0
  43. package/browser/esm/{PS0cqYnlMVEGOQpI.mjs → DcX8yGEBX6qi9RCe.mjs} +2 -2
  44. package/browser/esm/{BUSR_OK5Qi6hRPfw.mjs → DeXfOSxGE_Ez7DZq.mjs} +1 -1
  45. package/browser/esm/{Cq8D_M0jeHLcnRjg.mjs → DzgM_rkwyIHsCb6I.mjs} +1 -1
  46. package/browser/esm/{BDVJ7eOPpW5FnEAP.mjs → M4hZ25330e96seUM.mjs} +1 -1
  47. package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +7 -0
  48. package/browser/esm/SAyRTPVprOHZ8Up8.mjs +7 -0
  49. package/browser/esm/_ft7JYO6QdDbIu3d.mjs +7 -0
  50. package/browser/esm/{BlGoi1_x9rUMpWMd.mjs → dpdy0BU4GGI5lZrX.mjs} +1 -1
  51. package/browser/esm/index.mjs +2 -2
  52. package/browser/esm/{tFhROdVSw9KLQfUN.mjs → oLCocGFRAwsVsOSE.mjs} +2 -2
  53. package/cdn/assets/7_O6nILzn1fSVvkO.js +13449 -0
  54. package/cdn/assets/B3kbBB6oxKBErwzn.js +27 -0
  55. package/cdn/assets/BB66NDz7S3ocEfRB.js +150 -0
  56. package/cdn/assets/BCK7yhx9JfzU2rF0.js +22 -0
  57. package/cdn/assets/BSAH88RG1oubICau.js +84 -0
  58. package/cdn/assets/BT5EcMEFBsphczwC.js +1469 -0
  59. package/cdn/assets/BcWoqhD_sX85c7Mh.js +1701 -0
  60. package/cdn/assets/BoOefjrM4kZ-YXxa.js +90 -0
  61. package/cdn/assets/BtweFYnoj_aEfydW.js +1371 -0
  62. package/cdn/assets/Bv0Xb6DdcQbPYJKo.js +24 -0
  63. package/cdn/assets/CC-S4NMYhLg3WgqO.js +3875 -0
  64. package/cdn/assets/CJhyHcQcrhbtC33r.js +50 -0
  65. package/cdn/assets/CUc6gRjjRGTFWSHD.js +50 -0
  66. package/cdn/assets/CfObTzh8pGdd8D23.js +2183 -0
  67. package/cdn/assets/CiY3HumGDc_5bMtR.js +58 -0
  68. package/cdn/assets/CpPLN0-hDsTIFHZV.js +46 -0
  69. package/cdn/assets/Cq94woVmlxhjWVRI.js +21 -0
  70. package/cdn/assets/CsjftXmSYQRHNKdq.js +41 -0
  71. package/cdn/assets/DBL4jY0AVc53RGNm.js +637 -0
  72. package/cdn/assets/DDW1WJ2IM_9ZUfKm.js +36 -0
  73. package/cdn/assets/DJQOS9qxVAlpgDMt.js +1704 -0
  74. package/cdn/assets/DWJE3K3jMKMTCi3o.js +393 -0
  75. package/cdn/assets/D_5RgqgwXsoqLJDR.js +241 -0
  76. package/cdn/assets/DfmaL8DmDaFAv8M_.js +6481 -0
  77. package/cdn/assets/DgLPO_EQ9DYoGgec.js +423 -0
  78. package/cdn/assets/DkS6quwH1okWaho6.js +46 -0
  79. package/cdn/assets/DxMu6URURFWj9aXM.js +2373 -0
  80. package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +26490 -0
  81. package/cdn/assets/MRBi3juXAW0lA_mj.js +1358 -0
  82. package/cdn/assets/dk2teWHDODYNarJY.js +27 -0
  83. package/cdn/assets/phYz0vGgqIEQ2hco.js +12 -0
  84. package/cdn/assets/qA23x9VVBL9R4qxN.js +43 -0
  85. package/cdn/index.js +41 -37
  86. package/cdn/loader.js +1 -1
  87. package/package.json +3 -3
  88. package/browser/esm/B5kkStdEkTczERyM.mjs +0 -7
  89. package/browser/esm/BuURCm92KsyGHG9e.mjs +0 -7
  90. package/browser/esm/CGZ5MX7afzMxDkCe.mjs +0 -7
  91. package/browser/esm/CzmNwV9tfFYUp_gS.mjs +0 -7
  92. package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +0 -7
  93. package/browser/esm/DqXxZP6yKF4U1YfY.mjs +0 -7
  94. package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +0 -7
  95. package/browser/esm/QBGUD1XS5_pysBLL.mjs +0 -7
  96. package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +0 -7
@@ -0,0 +1,1704 @@
1
+ import { _ as Y } from "./Jhm2DAcrfAqiM-Y-.js";
2
+ import { c as x, b as f, r as I, t as Z, a as A, p as D, d as tt } from "./BT5EcMEFBsphczwC.js";
3
+ import { IFont as k, IAutoFilter as T, Sort as G, IRange as et, AddressUtils as W, IFill as C, IStyle as rt, ITextFrame as P, FormulaError as st, IBorder as V } from "@sheetxl/sdk";
4
+ /**
5
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
6
+ *
7
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
8
+ * License: The license can be found at https://www.sheetxl.com/license.
9
+ */
10
+ class ot {
11
+ constructor(t) {
12
+ this.list = t;
13
+ }
14
+ get length() {
15
+ return this.list.length;
16
+ }
17
+ item(t) {
18
+ return this.list[t];
19
+ }
20
+ forEach(t, e) {
21
+ for (let s = 0; s < this.list.length; s++) t(this.list[s], s, this);
22
+ }
23
+ }
24
+ const it = (u) => u === !0 || u === "1" || u === "on" || u === "true" || u !== !1 && u !== "0" && u !== "off" && u !== "false" && null, nt = (u) => {
25
+ const t = parseInt(u);
26
+ return isNaN(t) ? null : t;
27
+ }, lt = (u) => {
28
+ const t = parseFloat(u);
29
+ return isNaN(t) ? null : t;
30
+ }, at = /* @__PURE__ */ new Map();
31
+ class _ {
32
+ constructor(t, e, s, r, o, i = null, n) {
33
+ const l = (c, h, p) => n?.getRef?.(c, h, p, n?.parsedRefs), a = (c) => n?.getRefs?.(c, n?.parsedRefs);
34
+ this._parent = t, this.sharedShared = e, this.currentPath = s, this.elemRoot = r, this.jsonRoot = o, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs) : (i && (this._fileLocation = i), l && a && (this._getRef = l), a && (this._getRefs = a), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson);
35
+ }
36
+ getRef(t, e = !1) {
37
+ return this._getRef?.(t, this._fileLocation, e) ?? null;
38
+ }
39
+ getRelationships() {
40
+ return this._getRefs(this._fileLocation) ?? at;
41
+ }
42
+ getPath() {
43
+ return this.currentPath;
44
+ }
45
+ getElemRoot() {
46
+ return this.elemRoot;
47
+ }
48
+ getJsonRoot() {
49
+ return this.jsonRoot;
50
+ }
51
+ warn(t) {
52
+ this._onWarning ? this._onWarning(t) : this._parent ? this._parent?.warn?.(t) : console.warn(t);
53
+ }
54
+ addPerson(t) {
55
+ return this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) : null;
56
+ }
57
+ getVisitorParamsState() {
58
+ return this.sharedShared.getVisitorParamsState();
59
+ }
60
+ evaluate(t, e) {
61
+ if (!t) return e;
62
+ let s = [e];
63
+ const r = t.split("/");
64
+ for (let o = 0; o < r.length; o++) {
65
+ const i = r[o];
66
+ if (i === "" || i === ".") continue;
67
+ let n = [];
68
+ for (let l = 0; l < s.length; l++) {
69
+ const a = s[l], c = a.childNodes;
70
+ for (let h = 0; c && h < c.length; h++) {
71
+ const p = a.childNodes[h];
72
+ p.localName !== i && i !== "*" || n.push(p);
73
+ }
74
+ }
75
+ s = n;
76
+ }
77
+ return s.length === 1 ? s[0] : s.length === 0 ? null : new ot(s);
78
+ }
79
+ getFromPath(t, e) {
80
+ return Y.getFromPath(t, e);
81
+ }
82
+ setToPath(t, e, s) {
83
+ return Y.setToPath(t, e, s);
84
+ }
85
+ getValAttrAsString(t, e) {
86
+ let s = this.evaluate(t, e);
87
+ return s && s.hasAttribute("val") ? s.getAttribute("val") ?? null : null;
88
+ }
89
+ getValAttrAsBoolean(t, e, s = !1) {
90
+ let r = this.evaluate(t, e);
91
+ if (!r) return null;
92
+ const o = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
93
+ return o == null ? s : o === "1" || o === "on" || o === "true" || o !== "0" && o !== "off" && o !== "false" && s;
94
+ }
95
+ getValAttrAsInteger(t, e) {
96
+ let s = this.evaluate(t, e);
97
+ return s && s.hasAttribute("val") ? parseInt(s.getAttribute("val")) ?? null : null;
98
+ }
99
+ getValAttrAsFloat(t, e) {
100
+ let s = this.evaluate(t, e);
101
+ return s && s.hasAttribute("val") ? parseFloat(s.getAttribute("val")) ?? null : null;
102
+ }
103
+ get BOOLEAN_COPY() {
104
+ return it;
105
+ }
106
+ get INT_COPY() {
107
+ return nt;
108
+ }
109
+ get FLOAT_COPY() {
110
+ return lt;
111
+ }
112
+ copyFromAttribute(t, e, s, r = e, o = null) {
113
+ if (!t || !s || !t.hasAttribute(e)) return;
114
+ let i = t.getAttribute(e);
115
+ if (o) {
116
+ if (Array.isArray(o)) {
117
+ for (let n = 0; n < o.length; n++)
118
+ if (i == null || (i = o[n](i), i == null)) return;
119
+ } else if (i == null || (i = o(i), i == null)) return;
120
+ }
121
+ this.setToPath(s, r, i);
122
+ }
123
+ }
124
+ class j {
125
+ constructor(t) {
126
+ this.jsonKey = t;
127
+ }
128
+ visit(t, e, s) {
129
+ const r = {};
130
+ return s[this.jsonKey] = r, r;
131
+ }
132
+ }
133
+ class ct {
134
+ visit(t, e, s) {
135
+ if (!e) return;
136
+ const r = e.childNodes;
137
+ for (let o = 0; o < r.length; o++) {
138
+ const i = r.item(o);
139
+ i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(t, i, s);
140
+ }
141
+ return s;
142
+ }
143
+ processRelationship(t, e, s) {
144
+ const r = {};
145
+ t.copyFromAttribute(e, "Target", r, "target"), t.copyFromAttribute(e, "Type", r, "type"), t.copyFromAttribute(e, "TargetMode", r, "targetMode"), s[e.getAttribute("Id")] = r;
146
+ }
147
+ }
148
+ const H = (u, t) => {
149
+ if (u || !u.hasAttribute("rot")) return;
150
+ const e = u.getAttribute("rot"), s = Y.roundAccurately(D(e), 2);
151
+ s !== -1e3 && (t.rotation = s);
152
+ }, b = (u, t, e, s, r) => {
153
+ const o = u.getValAttrAsString(s, t);
154
+ o !== null && (e[r] = o);
155
+ }, m = (u, t, e, s, r = s, o = null) => {
156
+ const i = u.getValAttrAsBoolean(s, t, o);
157
+ i !== null && (e[r] = i);
158
+ }, w = (u, t, e, s, r) => {
159
+ const o = u.getValAttrAsInteger(s, t);
160
+ o !== null && (e[r] = o);
161
+ }, y = (u, t, e, s, r, o = 1) => {
162
+ const i = u.getValAttrAsFloat(s, t);
163
+ i !== null && (e[r] = i * o);
164
+ };
165
+ class ut {
166
+ visit(t, e, s) {
167
+ return m(t, e, s, "roundedCorners", "roundedCorners"), w(t, e, s, ".//AlternateContent/Fallback/style", "styleId"), s.range = null, s;
168
+ }
169
+ afterVisit(t, e, s) {
170
+ let r = {};
171
+ s.types = r;
172
+ let o = {}, i = 0, n = {}, l = 0, a = t.getVisitorParamsState().get("axes");
173
+ const c = t.getVisitorParamsState().get("types");
174
+ for (let g = 0; g < c.length; g++) {
175
+ const d = c[g];
176
+ if (d.xAxisId) {
177
+ const v = d.xAxisId, O = a.get(v);
178
+ o[g + ""] = O, d.offsetXAxis = g, delete d.xAxisId, s.xAxes = o, o.length = ++i;
179
+ }
180
+ if (d.yAxisId) {
181
+ const v = d.yAxisId, O = a.get(v);
182
+ n[g + ""] = O, d.offsetYAxis = g, delete d.yAxisId, s.yAxes = n, n.length = ++l;
183
+ }
184
+ r[g + ""] = d;
185
+ }
186
+ r.length = c.length;
187
+ const h = t.getVisitorParamsState().get("series");
188
+ if (!h || h.length === 0) return;
189
+ const p = {};
190
+ s.series = p;
191
+ for (let g = 0; g < h.length; g++) p[g + ""] = h[g];
192
+ p.length = h.length;
193
+ }
194
+ }
195
+ class ht {
196
+ visit(t, e, s) {
197
+ return m(t, e, s, "plotVisOnly", "plotVisOnly"), b(t, e, s, "dispBlanksAs", "dispBlanksAs"), m(t, e, s, ".//extLst/ext/dataDisplayOptions16/dispNaAsBlank", "dispNaAsBlank"), m(t, e, s, "showDLblsOverMax", "showDLblsOverMax"), s;
198
+ }
199
+ afterVisit(t, e, s) {
200
+ try {
201
+ const r = t.getValAttrAsBoolean("autoTitleDeleted", e), o = t.evaluate("title", e);
202
+ t.setToPath(s, "title.shown", !(r === !0 || !o));
203
+ const i = t.evaluate("legend", e);
204
+ t.setToPath(s, "legend.shown", i !== null);
205
+ } catch (r) {
206
+ throw new Error("Unexpected Error parsing Chart: " + r);
207
+ }
208
+ }
209
+ }
210
+ class pt {
211
+ visit(t, e, s) {
212
+ let r = {};
213
+ return s.plotArea = r, r;
214
+ }
215
+ }
216
+ class L {
217
+ EnumMappings() {
218
+ }
219
+ static fromOoxmlGradientType(t) {
220
+ return t === "circle" ? "radial" : t;
221
+ }
222
+ static fromOoxmlLineCap(t) {
223
+ if (t === "rnd") return "round";
224
+ if (t === "flat") return "butt";
225
+ if (t === "sq") return "square";
226
+ throw new Error("Invalid lineCap type: " + t);
227
+ }
228
+ static fromOoxmlCompound(t) {
229
+ return t === "sng" ? "single" : t;
230
+ }
231
+ static fromOoxmlAlignment(t) {
232
+ return t === "ctr" ? "center" : t;
233
+ }
234
+ }
235
+ class J {
236
+ visit(t, e, s) {
237
+ }
238
+ processStroke(t, e, s) {
239
+ const r = {}, o = t.evaluate("ln", e);
240
+ if (o) {
241
+ o.hasAttribute("algn") && (r.align = L.fromOoxmlAlignment(o.getAttribute("algn"))), o.hasAttribute("cap") && (r.lineCap = L.fromOoxmlLineCap(o.getAttribute("cap"))), o.hasAttribute("cmpd") && (r.compound = L.fromOoxmlCompound(o.getAttribute("cmpd"))), o.hasAttribute("w") && (r.width = Z(o.getAttribute("w")));
242
+ const i = t.evaluate("miter", o);
243
+ i && (r.lineJoin = "miter", i.hasAttribute("lim") && (r.miter = parseFloat(i.getAttribute("lim")))), t.evaluate("bevel", o) && (r.lineJoin = "bevel"), t.evaluate("round", o) && (r.lineJoin = "round");
244
+ const n = t.evaluate("custDash", o);
245
+ if (n) {
246
+ const c = t.evaluate("ds", n);
247
+ if (c && c.length > 0) {
248
+ let h = "";
249
+ for (let p = 0; p < c.length; p++) {
250
+ const g = c.item(p);
251
+ h += A(g.getAttribute("d")) + "," + A(g.getAttribute("sp"));
252
+ }
253
+ r.dash = h;
254
+ }
255
+ }
256
+ const l = t.evaluate("prstDash", o);
257
+ l && l.hasAttribute("val") && (r.dash = l.getAttribute("val")), this.parseEndElement(t, o, r, "headEnd", "head"), this.parseEndElement(t, o, r, "tailEnd", "tail");
258
+ const a = this.processFill(t, o, s);
259
+ r.fill = a;
260
+ }
261
+ return r;
262
+ }
263
+ parseEndElement(t, e, s, r, o) {
264
+ const i = t.evaluate(r, e);
265
+ if (i && (i.hasAttribute("type") && (s[o + "Type"] = i.getAttribute("type")), i.hasAttribute("len") || i.hasAttribute("w"))) {
266
+ const n = i.getAttribute("len") ? i.getAttribute("len") : "med", l = i.getAttribute("w") ? i.getAttribute("w") : "med";
267
+ s[o + "Size"] = n + "-" + l;
268
+ }
269
+ }
270
+ processFill(t, e, s) {
271
+ const r = {};
272
+ if (t.evaluate("noFill", e)) return r.none = !0, r;
273
+ const o = t.evaluate("solidFill", e);
274
+ if (o) {
275
+ const a = this.processAdjColor(t, o);
276
+ return a && (r.solid = a), r;
277
+ }
278
+ const i = t.evaluate("gradFill", e);
279
+ if (i) {
280
+ i.hasAttribute("rotWithShape") && (r.isRotated = i.getAttribute("rotWithShape") === "1");
281
+ const a = this.processGradFill(t, i);
282
+ return r.gradient = a, r;
283
+ }
284
+ const n = t.evaluate("pattFill", e);
285
+ if (n) {
286
+ const a = this.processPatternFill(t, n);
287
+ return r.pattern = a, r;
288
+ }
289
+ const l = t.evaluate("blipFill", e);
290
+ if (l) {
291
+ l.hasAttribute("rotWithShape") && (r.isRotated = f(l.getAttribute("rotWithShape"))), l.hasAttribute("dpi") && (r.dpi = l.getAttribute("dpi"));
292
+ const a = this.processImageFill(t, l);
293
+ return r.image = a, r;
294
+ }
295
+ return r.none = !0, r;
296
+ }
297
+ processGradFill(t, e) {
298
+ const s = {}, r = t.evaluate("lin", e);
299
+ if (r) {
300
+ if (s.type = "linear", r.hasAttribute("ang")) {
301
+ const c = D(r.getAttribute("ang"));
302
+ s.angle = c;
303
+ }
304
+ if (r.hasAttribute("scaled")) {
305
+ const c = f(r.getAttribute("scaled"));
306
+ s.scaled = c;
307
+ }
308
+ }
309
+ const o = {};
310
+ e.hasAttribute("flip") && (o.mirror = e.getAttribute("flip")), Object.keys(o).length > 0 && (s.tile = o);
311
+ const i = t.evaluate("path", e);
312
+ if (i) {
313
+ i.hasAttribute("path") && (s.type = L.fromOoxmlGradientType(i.getAttribute("path")));
314
+ const c = t.evaluate("fillToRect", i);
315
+ c && (s.fillTo = this.getRect(c));
316
+ }
317
+ const n = t.evaluate("tileRect", e);
318
+ n && (s.tile.bounds = this.getRect(n));
319
+ const l = [], a = t.evaluate("gsLst/gs", e);
320
+ for (let c = 0; a && c < a.length; c++) {
321
+ const h = a.item(c), p = { offset: A(h.getAttribute("pos")), color: this.processAdjColor(t, h) };
322
+ l.push(p);
323
+ }
324
+ return l.length > 0 && (s.stops = l), s;
325
+ }
326
+ getRect(t) {
327
+ const e = {};
328
+ return t.hasAttribute("t") && (e.t = A(t.getAttribute("t"))), t.hasAttribute("l") && (e.l = A(t.getAttribute("l"))), t.hasAttribute("b") && (e.b = A(t.getAttribute("b"))), t.hasAttribute("r") && (e.r = A(t.getAttribute("r"))), Object.keys(e).length === 0 ? null : e;
329
+ }
330
+ processImageFill(t, e) {
331
+ return { ref: "https://www.sheetxl.com/logo-color-padded-white.jpg", tile: !1 };
332
+ }
333
+ processPatternFill(t, e) {
334
+ const s = {}, r = e.getAttribute("prst");
335
+ s.type = r;
336
+ const o = t.evaluate("bgClr", e);
337
+ if (o) {
338
+ const n = this.processAdjColor(t, o);
339
+ n && (s.background = n);
340
+ }
341
+ const i = t.evaluate("fgClr", e);
342
+ if (i) {
343
+ let n = this.processAdjColor(t, i);
344
+ n && (s.foreground = n);
345
+ }
346
+ return s;
347
+ }
348
+ processAdjColor(t, e) {
349
+ const s = t.evaluate("hslClr", e);
350
+ if (s) return this.processHslClr(t, s);
351
+ const r = t.evaluate("prstClr", e);
352
+ if (r) return this.processClrWithValAttribute(t, r);
353
+ const o = t.evaluate("schemeClr", e);
354
+ if (o) return this.processClrWithValAttribute(t, o);
355
+ const i = t.evaluate("sysClr", e);
356
+ if (i) return this.processClrWithValAttribute(t, i);
357
+ const n = t.evaluate("scrgbClr", e);
358
+ if (n) return this.processScrgbClrElement(t, n);
359
+ const l = t.evaluate("srgbClr", e);
360
+ return l ? this.processSrgbClrElement(t, l) : null;
361
+ }
362
+ processScrgbClrElement(t, e) {
363
+ let s = "lrgba(" + A(e.getAttribute("r")) + "," + A(e.getAttribute("g")) + "," + A(e.getAttribute("b")) + ")";
364
+ return s += this.processAdjustments(t, e), s;
365
+ }
366
+ processSrgbClrElement(t, e) {
367
+ let s = e.getAttribute("val");
368
+ return s += this.processAdjustments(t, e), s;
369
+ }
370
+ processHslClr(t, e) {
371
+ let s = "hsl(" + D(e.getAttribute("hue")) + "," + A(e.getAttribute("sat")) + "," + A(e.getAttribute("lum")) + ")";
372
+ return s += this.processAdjustments(t, e), s;
373
+ }
374
+ processClrWithValAttribute(t, e) {
375
+ const s = e.getAttribute("val");
376
+ if (!s) return;
377
+ let r = s;
378
+ return r += this.processAdjustments(t, e), r;
379
+ }
380
+ processAdjustments(t, e) {
381
+ let s = "";
382
+ const r = e.childNodes;
383
+ for (let o = 0; o < r.length; o++) {
384
+ const i = r.item(o);
385
+ if (i.nodeType === 1) {
386
+ let n = i.localName;
387
+ s += n === "hue" || n === "hueOff" || n === "hueMod" ? this.processAdjustmentElement(t, e, n, 6e4) : n === "gray" || n === "comp" || n === "inv" || n === "gamma" || n === "invGamma" ? this.processAdjustmentElement(t, e, n, 1) : this.processAdjustmentElement(t, e, n);
388
+ }
389
+ }
390
+ return s;
391
+ }
392
+ processAdjustmentElement(t, e, s, r = 1e3) {
393
+ const o = t.evaluate(s, e);
394
+ if (!o) return "";
395
+ const i = o.getAttribute("val");
396
+ return i ? ` ${s} ${!i || parseFloat(i) / r}` : ` ${s}`;
397
+ }
398
+ }
399
+ class M extends J {
400
+ visit(t, e, s) {
401
+ try {
402
+ const r = t.evaluate("xfrm", e);
403
+ if (r) {
404
+ H(r, s);
405
+ const l = { x: 0, y: 0, width: 0, height: 0 }, a = t.evaluate("off", r);
406
+ a && (l.x = x(a.getAttribute("x")) ?? 0, l.y = x(a.getAttribute("y")) ?? 0);
407
+ const c = t.evaluate("ext", r);
408
+ a && (l.width = x(c.getAttribute("cx")) ?? 0, l.height = x(c.getAttribute("cy")) ?? 0), s.bounds = l;
409
+ }
410
+ const o = t.evaluate("prstGeom", e);
411
+ o?.hasAttribute("prst") ? s.geometry = o?.getAttribute("prst") : t.evaluate("customGeom", e) && console.warn("customGeom not supported yet");
412
+ const i = this.processFill(t, e, s);
413
+ i && Object.keys(i).length > 0 && (s.fill = i);
414
+ const n = this.processStroke(t, e, s);
415
+ return n && Object.keys(n).length > 0 && (s.stroke = n), s;
416
+ } catch (r) {
417
+ throw console.warn(r), new Error("Unexpected Error parsing Shape Properties element");
418
+ }
419
+ }
420
+ }
421
+ class S {
422
+ visit(t, e, s) {
423
+ let r = {};
424
+ if (b(t, e, r, "grouping", "grouping"), m(t, e, r, "varyColors", "varyColors"), y(t, e, r, "gapWidth", "gapWidth", 0.01), y(t, e, r, "overlap", "overlap", 0.01), this.parseType(t, e, r), w(t, e, r, "bubbleScale", "bubbleScale"), m(t, e, r, "showNegBubbles", "showNegativeBubbleValues"), m(t, e, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), w(t, e, r, "firstSliceAng", "startAngle"), w(t, e, r, "holeSize", "holeSize"), b(t, e, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(t, e, r), Object.keys(r).length > 0) {
425
+ let o = t.getVisitorParamsState().get("types");
426
+ o || (o = [], t.getVisitorParamsState().set("types", o)), o.push(r);
427
+ }
428
+ return r;
429
+ }
430
+ parseType(t, e, s) {
431
+ switch (e.localName) {
432
+ case "areaChart":
433
+ s.type = "area";
434
+ break;
435
+ case "bubbleChart":
436
+ s.type = "bubble";
437
+ break;
438
+ case "doughnutChart":
439
+ case "ofPieType":
440
+ case "pieChart":
441
+ s.type = "pie";
442
+ break;
443
+ case "lineChart":
444
+ s.type = "line";
445
+ break;
446
+ case "scatterChart":
447
+ s.type = "scatter";
448
+ }
449
+ }
450
+ parseAxisIds(t, e, s) {
451
+ const r = t.evaluate("axId", e);
452
+ if (r.length === 0) return;
453
+ const o = r.item(0).getAttribute("val");
454
+ s.xAxisId = o;
455
+ const i = r.item(1).getAttribute("val");
456
+ s.yAxisId = i;
457
+ }
458
+ }
459
+ class gt extends S {
460
+ parseType(t, e, s) {
461
+ const r = t.getValAttrAsString("barDir", e);
462
+ r && (s.type = r === "col" ? "column" : "bar");
463
+ }
464
+ }
465
+ class N {
466
+ constructor(t) {
467
+ this.jsonKey = t;
468
+ }
469
+ visit(t, e, s) {
470
+ let r = {}, o = r, i = t.getValAttrAsString("idx", e);
471
+ i !== null && (o = {}, o[i] = r);
472
+ const n = t.getValAttrAsBoolean("delete", e);
473
+ this.parseNumFormat(t, e, r), n === !0 ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (m(t, e, r, "showBubbleSize", "showBubbleSize"), m(t, e, r, "showCatName", "showCatName"), m(t, e, r, "showLeaderLines", "showLeaderLines"), m(t, e, r, "showPercent", "showPercentage"), m(t, e, r, "showSerName", "showSerName"), m(t, e, r, "showVal", "showVal"), m(t, e, r, "showLegendKey", "showLegendKey"));
474
+ const l = t.evaluate("separator", e);
475
+ return l !== null && (r.separator = l.textContent), b(t, e, r, "dLblPos", "position"), s[this.jsonKey] = o, r;
476
+ }
477
+ parseNumFormat(t, e, s) {
478
+ const r = t.evaluate("numFmt", e);
479
+ if (r) {
480
+ const o = r.getAttribute("formatCode");
481
+ s.formatCode = o, r.hasAttribute("sourceLinked") && (s.sourceLinked = r.getAttribute("sourceLinked") === "1");
482
+ }
483
+ }
484
+ }
485
+ const q = (u, t, e) => {
486
+ if (u.getValAttrAsBoolean("invertIfNegative", t) === !0) if (u.evaluate("extLst/ext/invertSolidFillFmt", t)) {
487
+ if (e.fill && e.fillNegative) {
488
+ const s = u.getFromPath(e, "fill.solid.adjs");
489
+ s && u.setToPath(e, "fillNegative.solid.adjs", s);
490
+ }
491
+ } else {
492
+ const s = { val: "FFFFFF" }, r = {};
493
+ r.solid = s, e.fillNegative = r;
494
+ const o = { val: "000000" }, i = {};
495
+ i.solid = o;
496
+ const n = {};
497
+ n.fill = i, e.strokeNegative = n;
498
+ }
499
+ };
500
+ class dt {
501
+ visit(t, e, s) {
502
+ const r = {};
503
+ w(t, e, r, "explosion", "explosion");
504
+ let o = t.evaluate("cat/*/f", e);
505
+ o || (o = t.evaluate("xVal/*/f", e));
506
+ let i = null;
507
+ o !== null && o.firstChild !== null && (i = o.firstChild.nodeValue), o || (o = t.evaluate("cat/strLit", e), o || (o = t.evaluate("cat/numLit", e)), o && (i = this.parsePointsAsString(t, o))), i !== null && (r.xRange = i);
508
+ let n = t.evaluate("val/*/f", e);
509
+ n || (n = t.evaluate("yVal/*/f", e));
510
+ let l = null;
511
+ n && n.firstChild && (l = n.firstChild.nodeValue), n || (n = t.evaluate("val/numLit", e), n !== null && (l = this.parsePointsAsString(t, n))), l !== null && (r.valRange = l), this.parseTitleRangeOrValue(t, e, r), w(t, e, r, "idx", "idx"), m(t, e, r, "smooth", "smooth");
512
+ const a = t.getVisitorParamsState().get("types").length - 1;
513
+ r.offsetChart = a;
514
+ let c = t.getVisitorParamsState().get("series");
515
+ return c || (c = [], t.getVisitorParamsState().set("series", c)), c.push(r), r;
516
+ }
517
+ parseTitleRangeOrValue(t, e, s) {
518
+ const r = t.evaluate("tx/strRef/f", e);
519
+ if (r !== null) {
520
+ const o = r.firstChild.nodeValue;
521
+ t.setToPath(s, "title.range", o);
522
+ } else {
523
+ const o = t.evaluate("tx/v", e);
524
+ o !== null && t.setToPath(s, "title.text.simpleRun", o.firstChild.nodeValue);
525
+ }
526
+ }
527
+ parsePointsAsString(t, e) {
528
+ let s = "{";
529
+ const r = t.getValAttrAsInteger("ptCount", e), o = t.evaluate("pt", e), i = [];
530
+ for (let n = 0; o && r && n < r; n++) {
531
+ let l = null, a = t.evaluate("pt[@idx='" + n + "']/v", e);
532
+ a instanceof Node && (l = a.textContent), i[n] = l;
533
+ }
534
+ for (let n = 0; n < i.length; n++) n > 0 && (s += ","), i[n] !== void 0 && (s += i[n]);
535
+ return s += "}", s;
536
+ }
537
+ afterVisit(t, e, s) {
538
+ q(t, e, s);
539
+ let r = t.getFromPath(s, "points");
540
+ if (r) {
541
+ const o = Object.keys(r);
542
+ for (let i = 0; i < o.length; i++) {
543
+ const n = o[i], l = t.getFromPath(r, n);
544
+ if (!l) continue;
545
+ let a = t.getFromPath(l, "markers");
546
+ a && (t.setToPath(s, "markers.points." + n, a), delete l.markers);
547
+ }
548
+ }
549
+ }
550
+ }
551
+ class mt {
552
+ DataPointVisitor() {
553
+ }
554
+ visit(t, e, s) {
555
+ let r = t.getFromPath(s, "points"), o = null;
556
+ r ? o = r : (o = {}, t.setToPath(s, "points", o));
557
+ let i = {}, n = t.getValAttrAsString("idx", e);
558
+ return n !== null && (o[n] = i), m(t, e, i, "bubble3D", "bubble3D"), w(t, e, i, "explosion", "explosion"), q(t, e, i), i;
559
+ }
560
+ }
561
+ class bt {
562
+ visit(t, e, s) {
563
+ const r = e.parentNode.localName;
564
+ if (r === "ser" || r === "dPt") {
565
+ const o = {}, i = t.getValAttrAsString("size", e);
566
+ i !== null && (o.size = i);
567
+ const n = t.getValAttrAsString("symbol", e);
568
+ return n && (o.type = n), s.markers = o, o;
569
+ }
570
+ return null;
571
+ }
572
+ }
573
+ class R {
574
+ visit(t, e, s) {
575
+ let r = {};
576
+ this.parseScaling(t, e, r), y(t, e, r, "majorUnit", "majorUnits"), y(t, e, r, "minorUnit", "minorUnits"), m(t, e, r, "delete", "shown"), this.parseOrientation(t, e, r), this.parseNumFormat(t, e, r), b(t, e, r, "majorTickMark", "majorTickMarks"), b(t, e, r, "minorTickMark", "minorTickMarks"), b(t, e, r, "crosses", "crosses"), y(t, e, r, "crossesAt", "crosses"), b(t, e, r, "crossBetween", "crossBetween"), this.parseLabelAlign(t, e, r), w(t, e, r, "lblOffset", "labelOffset"), b(t, e, r, "tickLblPos", "labelPosition");
577
+ const o = t.getValAttrAsInteger("noMultiLvlLbl", e);
578
+ r.labelMultiLevel = o !== null && o === 0, w(t, e, r, "tickMarkSkip", "tickMarkSkip"), w(t, e, r, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(e, t, r), this.parseTimeUnits(t, e, r, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(t, e, r, "minorUnitDates", "minorTimeUnit", "minorUnit"), b(t, e, r, "baseTimeUnit", "baseUnitDates"), t.getVisitorParamsState().get("axes") || t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map());
579
+ const i = t.getValAttrAsString("axId", e);
580
+ return t.getVisitorParamsState().get("axes").set(i, r), r;
581
+ }
582
+ parseTimeUnits(t, e, s, r, o, i) {
583
+ const n = {};
584
+ let l = t.getValAttrAsString(o, e);
585
+ if (l !== null) {
586
+ n.dem = l;
587
+ let a = t.getValAttrAsString(i, e);
588
+ n.amt = a;
589
+ }
590
+ Object.keys(n).length > 0 && (s[r] = n);
591
+ }
592
+ parseDisplayCustOrBuiltInUnit(t, e, s) {
593
+ let r = e.getValAttrAsString("dispUnits/builtInUnit", t);
594
+ r || (r = e.getValAttrAsString("dispUnits/custUnit", t)), r && (s.displayUnits = r);
595
+ }
596
+ parseLabelAlign(t, e, s) {
597
+ let r = t.getValAttrAsString("lblAlgn", e);
598
+ r !== null && (r === "ctr" ? s.labelAlign = "center" : r === "l" ? s.labelAlign = "left" : r === "r" && (s.labelAlign = "right"));
599
+ }
600
+ parseOrientation(t, e, s) {
601
+ const r = t.getValAttrAsString("AxPos", e);
602
+ r !== null && (r === "b" ? s.orientation = "bottom" : r === "l" ? s.orientation = "left" : r === "r" ? s.orientation = "right" : r === "t" && (s.orientation = "top"));
603
+ }
604
+ parseNumFormat(t, e, s) {
605
+ const r = {}, o = t.evaluate("numFmt", e);
606
+ o !== null && (o.hasAttribute("formatCode") && (r.formatCode = o.getAttribute("formatCode")), o.hasAttribute("sourceLinked") && (r.sourceLinked = o.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (s.labels = r);
607
+ }
608
+ parseScaling(t, e, s) {
609
+ const r = t.getValAttrAsString("scaling/orientation", e);
610
+ r !== null && (s.inverted = r !== "minMax");
611
+ const o = t.getValAttrAsFloat("scaling/logBase", e);
612
+ o !== null && (s.logBase = o, s.scaleType = "log"), y(t, e, s, "scaling/max", "max"), y(t, e, s, "scaling/min", "min");
613
+ }
614
+ afterVisit(t, e, s) {
615
+ s.fill && s.labels && (s.labels.fill = s.fill, delete s.fill);
616
+ let r = t.getValAttrAsBoolean("delete", e);
617
+ r !== null && (t.setToPath(s, "labels.shown", r !== !0), t.setToPath(s, "shown", r !== !0));
618
+ const o = t.getFromPath(s, "dispUnits.displayUnitsLabel");
619
+ o && (t.setToPath(s, "displayUnitsLabel", o), delete s.dispUnits);
620
+ const i = t.evaluate("title", e);
621
+ t.setToPath(s, "title.shown", i !== null);
622
+ const n = t.evaluate("minorGridlines", e);
623
+ t.setToPath(s, "gridLinesMinor.shown", n !== null);
624
+ const l = t.evaluate("majorGridlines", e);
625
+ t.setToPath(s, "gridLinesMajor.shown", l !== null);
626
+ }
627
+ }
628
+ class F {
629
+ constructor(t = "text") {
630
+ this._jsonKey = t;
631
+ }
632
+ getTextPath() {
633
+ return this._jsonKey;
634
+ }
635
+ visit(t, e, s) {
636
+ let r = t.getFromPath(s, this.getTextPath());
637
+ return r || (r = {}), this.parseTextElement(t, e, r, !1), Object.keys(r).length > 0 && t.setToPath(s, this.getTextPath(), r), s;
638
+ }
639
+ parseTextElement(t, e, s, r) {
640
+ const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e);
641
+ o && (this.parseTextProperties(t, o, s), new M().visit(t, o, s));
642
+ let i = [], n = t.evaluate("p/r", e) ?? t.evaluate("r", e);
643
+ const l = (c) => {
644
+ const h = {};
645
+ let p = t.evaluate("t", c);
646
+ const g = t.evaluate("rPr", c);
647
+ g && this.parseTextProperties(t, g, h), p ? h.text = p.firstChild.textContent ?? "" : c.textContent && (h.text = c.textContent ?? ""), i.push(h);
648
+ };
649
+ if (n?.length !== void 0) for (let c = 0; n && c < n.length; c++) l(n.item(c));
650
+ else l(n || e);
651
+ i.length > 0 && (s.runs = i);
652
+ const a = t.evaluate("bodyPr", e);
653
+ a && H(a, s);
654
+ }
655
+ parseTextProperties(t, e, s) {
656
+ if (!e) return;
657
+ e.hasAttribute("sz") && (s.size = parseFloat(e.getAttribute("sz")) / 100), e.hasAttribute("b") && (s.weight = e.getAttribute("b") === "1" ? 700 : 400), e.hasAttribute("i") && (s.italic = e.getAttribute("i") === "1"), e.hasAttribute("u") && (s.underline = e.getAttribute("u")), e.hasAttribute("strike") && (s.strike = e.getAttribute("strike"));
658
+ const r = t.evaluate("latin", e);
659
+ if (r && !r.getAttribute("typeface").startsWith("+")) {
660
+ const o = s.font ?? {};
661
+ if (r.hasAttribute("typeface") && (o.family = r.getAttribute("typeface")), r.hasAttribute("panose")) {
662
+ const i = r.getAttribute("panose");
663
+ i && (o.fallbacks = [k.getPanoseFallback(i)]);
664
+ }
665
+ r.hasAttribute("pitchFamily") && (o.pitch = r.getAttribute("pitchFamily")), r.hasAttribute("charset") && (o.charset = r.getAttribute("charset")), Object.keys(o).length > 0 && (s.font = o);
666
+ }
667
+ }
668
+ }
669
+ class ft {
670
+ visit(t, e, s) {
671
+ let r = t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx", e)];
672
+ if (r) {
673
+ let o = t.getFromPath(r, "title");
674
+ o || (o = {}, t.setToPath(r, "title", o));
675
+ let i = o, n = t.getValAttrAsBoolean("delete", e);
676
+ return n !== null && (i.shown = !n), i;
677
+ }
678
+ return s;
679
+ }
680
+ }
681
+ class At {
682
+ visit(t, e, s) {
683
+ const r = {};
684
+ return m(t, e, r, "overlay", "overlay"), b(t, e, r, "legendPos", "position"), s.legend = r, r;
685
+ }
686
+ }
687
+ class yt extends M {
688
+ visit(t, e, s) {
689
+ const r = this.processFill(t, e, s);
690
+ Object.keys(r).length > 0 && (s.fillNegative = r);
691
+ const o = this.processStroke(t, e, s);
692
+ return Object.keys(o).length > 0 && (s.strokeNegative = o), s;
693
+ }
694
+ }
695
+ class X extends F {
696
+ constructor(t = "title") {
697
+ super(t);
698
+ }
699
+ parseTitleRangeOrValue(t, e, s) {
700
+ let r = t.evaluate("tx/strRef/f", e) ?? null;
701
+ if (r) {
702
+ const o = r.firstElementChild.nodeValue;
703
+ t.setToPath(s, "range", o);
704
+ }
705
+ }
706
+ visit(t, e, s) {
707
+ const r = {};
708
+ m(t, e, r, "overlay", "overlay"), s[this._jsonKey] = r;
709
+ let o = t.getFromPath(r, this.getTextPath());
710
+ o || (o = {}), this.parseTitleRangeOrValue(t, e, r);
711
+ const i = t.evaluate("txPr", e);
712
+ i && this.parseTextElement(t, i, o, !1);
713
+ const n = t.evaluate("tx/rich", e);
714
+ return n && this.parseTextElement(t, n, o, !0), Object.keys(o).length > 0 && t.setToPath(r, this.getTextPath(), o), r;
715
+ }
716
+ afterVisit(t, e, s) {
717
+ if (s?.text) {
718
+ const r = s.text?.rotation ?? null;
719
+ r !== null && (s.rotation = parseInt(r), delete s.title.rotation);
720
+ }
721
+ }
722
+ }
723
+ class vt {
724
+ visit(t, e, s) {
725
+ const r = t.evaluate("manualLayout", e);
726
+ if (r) {
727
+ let o = {};
728
+ y(t, r, o, "x", "x"), y(t, r, o, "y", "y"), y(t, r, o, "w", "w"), y(t, r, o, "h", "h"), b(t, r, o, "xMode", "xMode"), b(t, r, o, "yMode", "yMode"), b(t, r, o, "wMode", "wMode"), b(t, r, o, "hMode", "hMode"), Object.keys(o).length > 0 && (s.manualLayout = o);
729
+ }
730
+ return s;
731
+ }
732
+ }
733
+ class Ft {
734
+ visit(t, e, s) {
735
+ return s.name = e.getAttribute("name"), s;
736
+ }
737
+ }
738
+ class Ct extends J {
739
+ visit(t, e, s) {
740
+ const r = {};
741
+ r.name = e.getAttribute("name");
742
+ const o = e.childNodes;
743
+ for (let i = 0; i < o.length; i++) {
744
+ const n = o.item(i);
745
+ if (n.nodeType === 1) {
746
+ let l = n.localName;
747
+ const a = t.evaluate(l, e), c = this.processAdjColor(t, a);
748
+ r[l] = c;
749
+ }
750
+ }
751
+ return Object.keys(r).length > 0 && (s.colors = r), r;
752
+ }
753
+ }
754
+ class wt {
755
+ visit(t, e, s) {
756
+ const r = {};
757
+ r.name = e.getAttribute("name");
758
+ const o = t.evaluate("majorFont", e), i = this.processFontElement(t, o, {});
759
+ r.majorFont = i.family, i.fallbacks && (r.majorFallbacks = i.fallbacks);
760
+ const n = t.evaluate("minorFont", e), l = this.processFontElement(t, n, {});
761
+ return r.minorFont = l.family, i.fallbacks && (r.minorFallbacks = l.fallbacks), s.fonts = r, r;
762
+ }
763
+ processFontElement(t, e, s) {
764
+ if (!e) return;
765
+ const r = t.evaluate("latin", e);
766
+ if (!r) return;
767
+ const o = r.getAttribute("typeface");
768
+ o && (s.family = o);
769
+ const i = r.getAttribute("panose");
770
+ return i && (s.fallbacks = [k.getPanoseFallback(i)]), s;
771
+ }
772
+ }
773
+ class Pt {
774
+ visit(t, e, s) {
775
+ if (!e) return;
776
+ const r = {}, o = e.getAttribute("r:id");
777
+ if (o) {
778
+ const i = t.getRef(o);
779
+ typeof i == "string" && (r.address = i);
780
+ }
781
+ return t.copyFromAttribute(e, "tooltip", r), t.copyFromAttribute(e, "history", r, "history", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tgtFrame", r, "target"), s.hyperlink = r, r;
782
+ }
783
+ }
784
+ class Nt {
785
+ visit(t, e, s) {
786
+ if (!e) return;
787
+ const r = {};
788
+ return t.copyFromAttribute(e, "ref", r), this.processFilterColumns(t, e, r), Object.keys(r).length > 0 && (s.filter = r), r;
789
+ }
790
+ processColorFilter(t, e) {
791
+ const s = { type: T.Type.Color };
792
+ return t.copyFromAttribute(e, "cellColor", s, "cellColor", t.BOOLEAN_COPY), t.copyFromAttribute(e, "dxfId", s, "styleId", t.INT_COPY), s;
793
+ }
794
+ processCustomFilter(t, e) {
795
+ const s = {};
796
+ return t.copyFromAttribute(e, "operator", s, "operator", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val"), s;
797
+ }
798
+ processCustomFilters(t, e) {
799
+ const s = { type: T.Type.Custom };
800
+ t.copyFromAttribute(e, "and", s, "and", t.BOOLEAN_COPY);
801
+ const r = e.childNodes;
802
+ s.filters = [];
803
+ for (let o = 0; o < r.length; o++) {
804
+ const i = r.item(o);
805
+ if (i.nodeType !== 1) continue;
806
+ let n = null;
807
+ i.localName === "customFilter" && (n = this.processCustomFilter(t, i)), n && s.filters.push(n);
808
+ }
809
+ return s;
810
+ }
811
+ processDynamicFilter(t, e) {
812
+ const s = { type: T.Type.Dynamic };
813
+ return t.copyFromAttribute(e, "type", s, "dynamicType"), t.copyFromAttribute(e, "val", s, "val", t.INT_COPY), t.copyFromAttribute(e, "maxVal", s, "maxVal", t.INT_COPY), s;
814
+ }
815
+ processDateGroupItem(t, e) {
816
+ const s = {};
817
+ return t.copyFromAttribute(e, "dateTimeGrouping", s, "group"), t.copyFromAttribute(e, "day", s, "day", t.INT_COPY), t.copyFromAttribute(e, "hour", s, "hour", t.INT_COPY), t.copyFromAttribute(e, "minute", s, "minute", t.INT_COPY), t.copyFromAttribute(e, "month", s, "month", t.INT_COPY), t.copyFromAttribute(e, "second", s, "second", t.INT_COPY), t.copyFromAttribute(e, "year", s, "year", t.INT_COPY), s;
818
+ }
819
+ processFilterItem(t, e) {
820
+ if (e.hasAttribute("val")) return e.getAttribute("val");
821
+ }
822
+ processFilters(t, e) {
823
+ const s = { type: T.Type.Items };
824
+ t.copyFromAttribute(e, "blank", s, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", s, "calendarType");
825
+ let r = [], o = [];
826
+ const i = e.childNodes;
827
+ for (let n = 0; n < i.length; n++) {
828
+ const l = i.item(n);
829
+ if (l.nodeType === 1) {
830
+ if (l.localName === "dateGroupItem") {
831
+ const a = this.processDateGroupItem(t, l);
832
+ a && r.push(a);
833
+ } else if (l.localName === "filter") {
834
+ const a = this.processFilterItem(t, l);
835
+ a !== void 0 && o.push(a);
836
+ }
837
+ }
838
+ }
839
+ return r.length > 0 && (s.dateGroups = r), o.length > 0 && (s.items = o), s;
840
+ }
841
+ processIcon(t, e) {
842
+ const s = { type: T.Type.Icon };
843
+ return t.copyFromAttribute(e, "iconId", s, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", s), s;
844
+ }
845
+ processTop10(t, e) {
846
+ const s = { type: T.Type.Top10 };
847
+ return t.copyFromAttribute(e, "filterVal", s, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", s, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", s, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val", t.FLOAT_COPY), s;
848
+ }
849
+ processFilterCriteria(t, e, s) {
850
+ if (!e) return;
851
+ const r = e.childNodes, o = [];
852
+ for (let i = 0; i < r.length; i++) {
853
+ const n = r.item(i);
854
+ if (n.nodeType !== 1) continue;
855
+ let l = null;
856
+ n.localName === "colorFilter" ? l = this.processColorFilter(t, n) : n.localName === "customFilters" ? l = this.processCustomFilters(t, n) : n.localName === "dynamicFilter" ? l = this.processDynamicFilter(t, n) : n.localName === "filters" ? l = this.processFilters(t, n) : n.localName === "iconFilter" ? l = this.processIcon(t, n) : n.localName === "top10" && (l = this.processTop10(t, n)), l && o.push(l);
857
+ }
858
+ return o.length > 0 && (s.criteria = o), o;
859
+ }
860
+ processFilterColumn(t, e) {
861
+ if (!e) return null;
862
+ const s = {};
863
+ if (!e.hasAttribute("colId")) return;
864
+ s.offset = parseInt(e.getAttribute("colId"));
865
+ let r = !1;
866
+ return e.hasAttribute("hiddenButton") && (r = f(e.getAttribute("hiddenButton"))), r && (s.hiddenButton = !0), e.hasAttribute("showButton") && (s.showButton = f(e.getAttribute("showButton"))), this.processFilterCriteria(t, e, s), s;
867
+ }
868
+ processFilterColumns(t, e, s) {
869
+ if (!e) return;
870
+ const r = e.childNodes, o = [];
871
+ for (let i = 0; i < r.length; i++) {
872
+ const n = r.item(i);
873
+ if (n.nodeType === 1 && n.localName === "filterColumn") {
874
+ const l = this.processFilterColumn(t, n);
875
+ l && o.push(l);
876
+ }
877
+ }
878
+ return o.length > 0 && (s.fields = o), o;
879
+ }
880
+ }
881
+ class Ot {
882
+ visit(t, e, s) {
883
+ if (!e) return;
884
+ const r = {};
885
+ if (t.copyFromAttribute(e, "ref", r), e.hasAttribute("caseSensitive")) {
886
+ const n = f(e.getAttribute("caseSensitive"));
887
+ r.collatorOptions = n ? G.CaseSensitiveOptions : G.CaseInsensitiveOptions;
888
+ }
889
+ const o = e.getAttribute("sortMethod");
890
+ o != null && o !== "none" && (o === "stroke" ? r.collatorOptions = { ...r.collatorOptions, collation: "stroke" } : o === "pinYin" && (r.collatorOptions = { ...r.collatorOptions, collation: "pinyin" })), e.hasAttribute("columnSort") && f(e.getAttribute("columnSort")) && (r.orientation = et.Orientation.Column);
891
+ const i = W.fastStringToRange(r.ref);
892
+ return this.processSortConditions(t, e, r, i), Object.keys(r).length > 0 && (s.sort = r), r;
893
+ }
894
+ processSortCondition(t, e, s) {
895
+ if (!e) return null;
896
+ const r = {};
897
+ if (e.hasAttribute("ref")) {
898
+ if (e.hasAttribute("ref")) {
899
+ const o = e.getAttribute("ref"), i = W.fastStringToRange(o);
900
+ r.offset = s ? i.colStart - s.colStart : i.colStart;
901
+ }
902
+ return r.reverse = !1, e.hasAttribute("descending") && (r.reverse = f(e.getAttribute("descending"))), t.copyFromAttribute(e, "sortBy", r, "sortOn"), t.copyFromAttribute(e, "dxfId", r), t.copyFromAttribute(e, "iconSet", r), t.copyFromAttribute(e, "customList", r), r;
903
+ }
904
+ console.warn("no ref for sort conditional", t.getPath());
905
+ }
906
+ processSortConditions(t, e, s, r) {
907
+ if (!e) return;
908
+ const o = e.childNodes, i = [];
909
+ for (let n = 0; n < o.length; n++) {
910
+ const l = o.item(n);
911
+ if (l.nodeType === 1 && l.localName === "sortCondition") {
912
+ const a = this.processSortCondition(t, l, r);
913
+ a && i.push(a);
914
+ }
915
+ }
916
+ return i.length > 0 && (s.fields = i), i;
917
+ }
918
+ }
919
+ class Q {
920
+ visit(t, e, s) {
921
+ }
922
+ processDataBarColor(t, e, s, r, o = "dk1") {
923
+ if (!e) return;
924
+ const i = tt((n) => e.getAttribute(n), o);
925
+ return i && (s[r] = i), s;
926
+ }
927
+ processFonts(t, e, s) {
928
+ if (!e) return;
929
+ const r = e.childNodes;
930
+ let o = 0;
931
+ for (let i = 0; i < r.length; i++) {
932
+ const n = r.item(i);
933
+ if (n.nodeType === 1 && n.localName === "font") {
934
+ const l = {};
935
+ this.processFont(t, n, l), s[o++] = l;
936
+ }
937
+ }
938
+ return s;
939
+ }
940
+ processFont(t, e, s) {
941
+ t.getValAttrAsBoolean("b", e, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (s.style = k.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (s.strike = !0);
942
+ const r = t.evaluate("u", e);
943
+ if (r) {
944
+ const n = r.getAttribute("val");
945
+ s.underline = n || k.UnderlineStyle.Single;
946
+ }
947
+ b(t, e, s, "vertAlign", "verticalAlign"), s.verticalAlign === "superscript" ? s.verticalAlign = k.VerticalAlignment.Super : s.verticalAlign === "subscript" && (s.verticalAlign = k.VerticalAlignment.Sub), y(t, e, s, "sz", "size");
948
+ const o = t.evaluate("color", e);
949
+ this.processDataBarColor(t, o, s, "fill"), s.fill || (s.fill = "dk1"), b(t, e, s, "name", "family"), b(t, e, s, "rFont", "family");
950
+ const i = t.evaluate("family", e);
951
+ if (i) {
952
+ const n = i.getAttribute("val");
953
+ if (n) switch (n) {
954
+ case "1":
955
+ s.fallbacks = ["serif"];
956
+ break;
957
+ case "2":
958
+ s.fallbacks = ["sans-serif"];
959
+ break;
960
+ case "3":
961
+ s.fallbacks = ["monospace"];
962
+ break;
963
+ case "4":
964
+ s.fallbacks = ["cursive"];
965
+ break;
966
+ case "5":
967
+ s.fallbacks = ["fantasy"];
968
+ }
969
+ }
970
+ return b(t, e, s, "scheme", "scheme"), m(t, e, s, "shadow", "shadow", !0), m(t, e, s, "outline", "outline", !0), t.getValAttrAsBoolean("condense", e, !0) && (s.letterSpacing = -1), t.getValAttrAsBoolean("extend", e, !0) && (s.letterSpacing = 1), b(t, e, s, "charset", "charset"), s;
971
+ }
972
+ processFills(t, e, s) {
973
+ if (!e) return;
974
+ const r = e.childNodes;
975
+ let o = 0;
976
+ for (let i = 0; i < r.length; i++) {
977
+ const n = r.item(i);
978
+ n.nodeType === 1 && n.localName === "fill" && this.processFill(t, n, s, o++);
979
+ }
980
+ return s;
981
+ }
982
+ processFill(t, e, s, r) {
983
+ const o = { type: C.Type.None }, i = e.childNodes;
984
+ let n = !1;
985
+ for (let l = 0; !n && l < i.length; l++) {
986
+ const a = i.item(l);
987
+ a.nodeType === 1 && (a.localName === "gradientFill" ? (this.processGradientFill(t, a, o), n = !0) : a.localName === "patternFill" && (this.processPatternFill(t, a, o), n = !0));
988
+ }
989
+ return s[r] = o, s;
990
+ }
991
+ processGradientFill(t, e, s) {
992
+ if (!e) return;
993
+ s.type = C.Type.Gradient;
994
+ const r = [];
995
+ s.stops = r, s.angle = 90 + (e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0);
996
+ const o = e.getAttribute("type");
997
+ o && (s.gradientType = o);
998
+ const i = (l) => {
999
+ if (!l) return 0;
1000
+ const a = parseFloat(l);
1001
+ return isNaN(a) ? 0 : a;
1002
+ };
1003
+ (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (s.fillTo = { left: i(e.getAttribute("left")), top: i(e.getAttribute("top")), right: i(e.getAttribute("right")), bottom: i(e.getAttribute("bottom")) });
1004
+ const n = e.childNodes;
1005
+ for (let l = 0; l < n.length; l++) {
1006
+ const a = n.item(l);
1007
+ if (a.nodeType === 1 && a.localName === "stop") {
1008
+ const c = {};
1009
+ r.push(c);
1010
+ const h = parseFloat(a.getAttribute("position"));
1011
+ c.offset = h;
1012
+ const p = t.evaluate("color", a);
1013
+ this.processDataBarColor(t, p, c, "color");
1014
+ }
1015
+ }
1016
+ return s;
1017
+ }
1018
+ processPatternFill(t, e, s) {
1019
+ if (!e) return;
1020
+ const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ? C.BuiltInSheetPattern.Solid : C.BuiltInSheetPattern.None);
1021
+ if (o === C.BuiltInSheetPattern.None) return { none: !0 };
1022
+ s.type = C.Type.Pattern, o && (s.patternType = o);
1023
+ let i, n = "foreground", l = "background";
1024
+ const a = s.patternType === C.BuiltInSheetPattern.Solid && r;
1025
+ if (a) {
1026
+ i = "lt1";
1027
+ const p = n;
1028
+ n = l, l = p;
1029
+ }
1030
+ const c = t.evaluate("fgColor", e);
1031
+ this.processDataBarColor(t, c, s, n, i);
1032
+ const h = t.evaluate("bgColor", e);
1033
+ return this.processDataBarColor(t, h, s, l, i), a && !s.foreground && (s.foreground = i), s;
1034
+ }
1035
+ processBorders(t, e, s, r) {
1036
+ if (!e) return;
1037
+ const o = e.childNodes;
1038
+ let i = 0;
1039
+ for (let n = 0; n < o.length; n++) {
1040
+ const l = o.item(n);
1041
+ l.nodeType === 1 && l.localName === "border" && this.processBorder(t, l, s, i++, r);
1042
+ }
1043
+ return s;
1044
+ }
1045
+ processBorder(t, e, s, r, o) {
1046
+ if (!e) return;
1047
+ const i = {};
1048
+ return this.processBorderStroke(t, e, i, V.Edge.Left), this.processBorderStroke(t, e, i, V.Edge.Right), o ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, V.Edge.Vertical), this.processBorderStroke(t, e, i, V.Edge.Top), this.processBorderStroke(t, e, i, V.Edge.Bottom), o ? (i.bottom || i.top) && (i.right ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, V.Edge.Horizontal), s[r] = i, s;
1049
+ }
1050
+ processBorderStroke(t, e, s, r) {
1051
+ if (!e) return;
1052
+ const o = t.evaluate(r, e);
1053
+ if (!o) return;
1054
+ const i = {};
1055
+ o.hasAttribute("style") && (i.style = o.getAttribute("style"));
1056
+ const n = t.evaluate("color", o);
1057
+ return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? s[r] = i : null;
1058
+ }
1059
+ }
1060
+ class Tt extends Q {
1061
+ visit(t, e, s) {
1062
+ this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1063
+ const r = { fills: {}, fonts: {}, borders: {} };
1064
+ this.processFonts(t, t.evaluate("fonts", e), r.fonts), this.processFills(t, t.evaluate("fills", e), r.fills), this.processBorders(t, t.evaluate("borders", e), r.borders, !0), r.fills[0] = { type: C.Type.None }, r.fills[1] = { type: C.Type.Pattern, patternType: C.BuiltInSheetPattern.Gray125 }, r.borders[0] = {};
1065
+ const o = [];
1066
+ this.processXFs(t, t.evaluate("cellStyleXfs", e), o, r, null, !1);
1067
+ const i = /* @__PURE__ */ new Map();
1068
+ if (o.length > 0) {
1069
+ const a = [];
1070
+ this.processCellStyles(t, t.evaluate("cellStyles", e), a, o, i), s.named = a;
1071
+ }
1072
+ const n = [];
1073
+ this.processXFs(t, t.evaluate("cellXfs", e), n, r, i), Object.keys(n).length > 0 && (s.direct = n);
1074
+ const l = [];
1075
+ return this.processDXFs(t, t.evaluate("dxfs", e), l), this.processTableStyles(t, t.evaluate("tableStyles", e), s, l), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), s), this.processMruColors(t, t.evaluate("colors/mruColors", e), s), s;
1076
+ }
1077
+ processIndexColors(t, e, s) {
1078
+ if (!e) return;
1079
+ const r = [], o = e.childNodes;
1080
+ for (let i = 0; i < o.length; i++) {
1081
+ const n = o.item(i);
1082
+ if (n.nodeType === 1 && n.localName === "rgbColor") {
1083
+ const l = { color: null };
1084
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1085
+ }
1086
+ }
1087
+ s.indexedColors = r;
1088
+ }
1089
+ processMruColors(t, e, s) {
1090
+ if (!e) return;
1091
+ const r = [], o = e.childNodes;
1092
+ for (let i = 0; i < o.length; i++) {
1093
+ const n = o.item(i);
1094
+ if (n.nodeType === 1 && n.localName === "color") {
1095
+ const l = { color: null };
1096
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1097
+ }
1098
+ }
1099
+ r.length > 0 && (s.mruColors = r);
1100
+ }
1101
+ processNumFmts(t, e, s) {
1102
+ if (!e) return;
1103
+ const r = /* @__PURE__ */ new Map();
1104
+ if (t.getVisitorParamsState().set("numFmts", r), !e) return;
1105
+ const o = e.childNodes;
1106
+ for (let i = 0; i < o.length; i++) {
1107
+ const n = o.item(i);
1108
+ if (n.nodeType === 1 && n.localName === "numFmt") {
1109
+ const l = n.getAttribute("numFmtId"), a = n.getAttribute("formatCode");
1110
+ if (l && a) {
1111
+ const c = a.replace(/\\(.)/g, "$1");
1112
+ r.set(parseInt(l), c);
1113
+ }
1114
+ }
1115
+ }
1116
+ }
1117
+ processXFs(t, e, s, r, o = null, i = !0) {
1118
+ if (!e) return;
1119
+ const n = e.childNodes;
1120
+ for (let l = 0; l < n.length; l++) {
1121
+ const a = n.item(l);
1122
+ if (a.nodeType === 1 && a.localName === "xf") {
1123
+ const c = {};
1124
+ this.processXF(t, a, c, r, o, i), s.push(c);
1125
+ }
1126
+ }
1127
+ }
1128
+ processXF(t, e, s, r, o, i) {
1129
+ if (!e) return;
1130
+ const n = e.getAttribute("xfId");
1131
+ if (n && o) {
1132
+ const c = o.get(parseInt(n));
1133
+ c && c !== rt.BuiltInName.Normal && (s.named = c);
1134
+ }
1135
+ const l = (c) => !(!i && e.hasAttribute(c)) || f(e.getAttribute("applyFont"));
1136
+ if (l("applyFont")) {
1137
+ const c = r.fonts[e.getAttribute("fontId")];
1138
+ c && (s.font = c);
1139
+ }
1140
+ if (l("applyFill")) {
1141
+ const c = r.fills[e.getAttribute("fillId")];
1142
+ c && Object.keys(c).length > 0 && (s.fill = c);
1143
+ }
1144
+ if (l("applyBorder")) {
1145
+ const c = r.borders[e.getAttribute("borderId")];
1146
+ c && Object.keys(c).length > 0 && (s.border = c);
1147
+ }
1148
+ if (l("applyNumberFormat")) {
1149
+ const c = e.getAttribute("numFmtId");
1150
+ if (c) {
1151
+ const h = parseInt(c);
1152
+ let p;
1153
+ const g = t.getVisitorParamsState();
1154
+ if (g) {
1155
+ const d = g.get("numFmts");
1156
+ d && (p = d.get(h)), s.numberFormat = p ?? h;
1157
+ } else console.warn("no visitor params state");
1158
+ }
1159
+ }
1160
+ l("applyAlignment") && this.processAlignment(t, t.evaluate("alignment", e), s), l("applyProtection") && this.processProtection(t, t.evaluate("protection", e), s);
1161
+ const a = f(e.getAttribute("quotePrefix"));
1162
+ a && (s.quotePrefix = a);
1163
+ }
1164
+ processAlignment(t, e, s) {
1165
+ const r = {};
1166
+ if (e?.hasAttribute("horizontal") ? r.horizontal = e.getAttribute("horizontal") : r.horizontal = P.HorizontalAlignment.General, e?.hasAttribute("vertical") ? r.vertical = e.getAttribute("vertical") : r.vertical = P.VerticalAlignment.Bottom, e?.hasAttribute("indent") ? r.indent = parseInt(e.getAttribute("indent")) : r.indent = 0, e?.hasAttribute("relativeIndent") ? r.relativeIndent = parseInt(e.getAttribute("relativeIndent")) : r.relativeIndent = 0, f(e?.getAttribute("wrapText")) ? r.overflow = P.Overflow.Wrap : r.overflow = P.Overflow.Visible, f(e?.getAttribute("shrinkToFit")) && (r.overflow = P.Overflow.Shrink), e?.hasAttribute("textRotation")) {
1167
+ let i = parseFloat(e.getAttribute("textRotation"));
1168
+ i > 0 && i <= 90 ? i = 360 - i : i > 90 && i <= 180 ? i -= 90 : i === 255 && (i = 0, r.stacked = !0), r.rotation = i;
1169
+ } else r.rotation = 0;
1170
+ e?.hasAttribute("justifyLastLine") && (r.justifyLastLine = f(e.getAttribute("justifyLastLine")));
1171
+ const o = e?.getAttribute("readingOrder");
1172
+ return o && (o === "0" ? r.readingDirection = P.ReadingDirection.Auto : o === "1" ? r.readingDirection = P.ReadingDirection.LeftToRight : o === "2" ? r.readingDirection = P.ReadingDirection.RightToLeft : console.warn(`invalid readingOrder: ${o}`)), Object.keys(r).length > 0 && (s.alignment = r), s;
1173
+ }
1174
+ processProtection(t, e, s) {
1175
+ if (!e) return;
1176
+ const r = {}, o = e.getAttribute("locked");
1177
+ o && !f(o) && (r.edit = !0);
1178
+ const i = e.getAttribute("hidden");
1179
+ return i && f(i) && (r.formulaHidden = !0), Object.keys(r).length > 0 && (s.protection = r), s;
1180
+ }
1181
+ processDXF(t, e, s) {
1182
+ if (!e) return;
1183
+ const r = e.childNodes;
1184
+ for (let o = 0; o < r.length; o++) {
1185
+ const i = r.item(o);
1186
+ if (i.nodeType === 1 && i.localName === "font") {
1187
+ const n = {};
1188
+ this.processFont(t, i, n), s.font = n;
1189
+ } else if (i.nodeType === 1 && i.localName === "fill") {
1190
+ const n = [];
1191
+ this.processFill(t, i, n, 0), n.length > 0 && n[0] && (s.fill = n[0]);
1192
+ } else if (i.nodeType === 1 && i.localName === "border") {
1193
+ const n = [];
1194
+ this.processBorder(t, i, n, 0, !1), n.length > 0 && n[0] && (s.border = n[0]);
1195
+ }
1196
+ }
1197
+ }
1198
+ processDXFs(t, e, s) {
1199
+ if (!e) return;
1200
+ t.getVisitorParamsState().set("processingDXFs", !0);
1201
+ const r = /* @__PURE__ */ new Map();
1202
+ t.getVisitorParamsState().set("dxfs", r);
1203
+ const o = e.childNodes;
1204
+ for (let i = 0; i < o.length; i++) {
1205
+ const n = o.item(i);
1206
+ if (n.nodeType === 1 && n.localName === "dxf") {
1207
+ const l = {};
1208
+ this.processDXF(t, n, l);
1209
+ const a = s.length;
1210
+ r.set(a, l), s.push(l);
1211
+ }
1212
+ }
1213
+ t.getVisitorParamsState().delete("processingDXFs");
1214
+ }
1215
+ processTableStyle(t, e, s, r, o = !1) {
1216
+ const i = e.getAttribute("name"), n = { name: i };
1217
+ e.hasAttribute("table") && (n.table = f(e.getAttribute("table"))), e.hasAttribute("pivot") && (n.pivot = f(e.getAttribute("pivot"))), o && !n.pivot && r.unshift(null);
1218
+ const l = e.childNodes;
1219
+ for (let a = 0; a < l.length; a++) {
1220
+ const c = l.item(a);
1221
+ if (c.nodeType === 1 && c.localName === "tableStyleElement") {
1222
+ const h = c.getAttribute("type"), p = c.getAttribute("dxfId");
1223
+ let g = r?.[p];
1224
+ g || (console.warn("invalid dfx id", p), g = {}), n[h] = g;
1225
+ let d = null;
1226
+ c.hasAttribute("size") && (d = parseInt(c.getAttribute("size"))), d && !isNaN(d) && (g.size = d);
1227
+ }
1228
+ }
1229
+ delete n.name, s[i] = n;
1230
+ }
1231
+ processTableStyles(t, e, s, r, o) {
1232
+ if (!e) return;
1233
+ const i = {}, n = e.getAttribute("defaultTableStyle");
1234
+ n && (i.defaultTableStyle = n);
1235
+ const l = e.getAttribute("defaultPivotStyle");
1236
+ l && (i.defaultPivotStyle = l);
1237
+ const a = e.childNodes, c = {};
1238
+ for (let h = 0; h < a.length; h++) {
1239
+ const p = a.item(h);
1240
+ p.nodeType === 1 && p.localName === "tableStyle" && this.processTableStyle(t, p, c, r, o);
1241
+ }
1242
+ return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (s.tables = i), s;
1243
+ }
1244
+ processCellStyles(t, e, s, r, o) {
1245
+ if (!e) return;
1246
+ const i = e.childNodes;
1247
+ for (let n = 0; n < i.length; n++) {
1248
+ const l = i.item(n);
1249
+ if (l.nodeType === 1 && l.localName === "cellStyle") {
1250
+ const a = parseInt(l.getAttribute("xfId")), c = l.getAttribute("name");
1251
+ if (o.set(a, c), !r[a]) continue;
1252
+ const h = { name: c, style: r[a] };
1253
+ l.getAttribute("hidden") && (h.hidden = f(l.getAttribute("hidden"))), l.getAttribute("iLevel") && (h.iLevel = parseInt(l.getAttribute("iLevel"))), s.push(h);
1254
+ }
1255
+ }
1256
+ }
1257
+ afterVisit(t, e, s) {
1258
+ }
1259
+ }
1260
+ class Vt extends Q {
1261
+ visit(t, e, s) {
1262
+ return this.processSheetRefs(t, t.evaluate("sheets", e), s), this.processBookViews(t, t.evaluate("bookViews", e), s), this.processDefinedNames(t, t.evaluate("definedNames", e), s), this.processCalcPr(t, t.evaluate("calcPr", e), s), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), s), this.processWorkbookPr(t, t.evaluate("workbookPr", e), s), s;
1263
+ }
1264
+ processPassword(t, e, s, r = "password") {
1265
+ if (!e) return;
1266
+ const o = {};
1267
+ t.copyFromAttribute(e, "algorithmName", o, "algorithmName"), t.copyFromAttribute(e, "hashValue", o, "hashValue"), t.copyFromAttribute(e, "saltValue", o, "saltValue", t.BOOLEAN_COPY), t.copyFromAttribute(e, "spinCount", o, "spinCount", t.INT_COPY), Object.keys(o).length > 0 && (s[r] = o);
1268
+ }
1269
+ processWorkbookProtection(t, e, s) {
1270
+ if (!e) return;
1271
+ const r = {};
1272
+ this.processPassword(t, t.evaluate("workbookPassword", e), r), this.processPassword(t, t.evaluate("revisionsPassword", e), r, "revisionsPassword");
1273
+ const o = (i) => i !== !0 && i !== "1" && i !== "on" && i !== "true" && (i === !1 || i === "0" || i === "off" || i === "false" || null);
1274
+ return t.copyFromAttribute(e, "lockStructure", r, "structure", o), t.copyFromAttribute(e, "lockWindows", r, "windows", o), t.copyFromAttribute(e, "lockRevision", r, "revision", o), s.protection = r, s;
1275
+ }
1276
+ processCalcPr(t, e, s) {
1277
+ e && (s.calc = {});
1278
+ }
1279
+ processSheetRefs(t, e, s) {
1280
+ if (!e) return;
1281
+ const r = [], o = e.childNodes;
1282
+ for (let i = 0; i < o.length; i++) {
1283
+ const n = o.item(i);
1284
+ n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(t, n, r);
1285
+ }
1286
+ s.sheets = r;
1287
+ }
1288
+ processSheetRef(t, e, s) {
1289
+ const r = {};
1290
+ t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility");
1291
+ const o = e.getAttribute("r:id"), i = t.getRef(o);
1292
+ i && (r.sheet = i), s.push(r);
1293
+ }
1294
+ processBookViews(t, e, s) {
1295
+ if (!e) return;
1296
+ const r = e.childNodes;
1297
+ let o = 0;
1298
+ for (let i = 0; o < 1 && i < e.childNodes.length; i++) {
1299
+ const n = r.item(i);
1300
+ n.nodeType === 1 && n.localName === "workbookView" && (this.processWorkbookView(t, n, s), o++);
1301
+ }
1302
+ }
1303
+ processWorkbookView(t, e, s) {
1304
+ if (!e) return;
1305
+ const r = {};
1306
+ t.copyFromAttribute(e, "activeTab", r, "activeSheetId", [t.INT_COPY, (o) => o + 1]), e.hasAttribute("activeTab") || (r.activeSheetId = 1), t.copyFromAttribute(e, "showHorizontalScroll", r, "showHorizontalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showVerticalScroll", r, "showVerticalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showSheetTabs", r, "showTabs", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tabRatio", r, "tabRatio", [t.FLOAT_COPY, (o) => o]), Object.keys(r).length > 0 && (s.view = r);
1307
+ }
1308
+ processDefineName(t, e, s, r) {
1309
+ if (!e) return;
1310
+ const o = {}, i = e.firstChild;
1311
+ if (i && i.nodeType === 3 && (o.ref = i.textContent), t.copyFromAttribute(e, "name", o), t.copyFromAttribute(e, "comment", o), t.copyFromAttribute(e, "hidden", o, "hidden", t.BOOLEAN_COPY), e.hasAttribute("localSheetId")) {
1312
+ const n = e.getAttribute("localSheetId");
1313
+ if (!r[n]?.name) return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1314
+ o.scope = r[n].name;
1315
+ }
1316
+ t.copyFromAttribute(e, "customMenu", o), t.copyFromAttribute(e, "description", o), t.copyFromAttribute(e, "statusBar", o), t.copyFromAttribute(e, "help", o), t.copyFromAttribute(e, "shortcutKey", o), t.copyFromAttribute(e, "function", o, "function", t.BOOLEAN_COPY), t.copyFromAttribute(e, "functionGroupId", o, "functionGroupId", t.INT_COPY), t.copyFromAttribute(e, "publishToServer", o, "publishToServer", t.BOOLEAN_COPY), t.copyFromAttribute(e, "vbProcedure", o, "vbProcedure", t.BOOLEAN_COPY), t.copyFromAttribute(e, "xlm", o, "xlm", t.BOOLEAN_COPY), Object.keys(o).length > 0 && s.push(o);
1317
+ }
1318
+ processDefinedNames(t, e, s) {
1319
+ if (!e) return;
1320
+ const r = [], o = e.childNodes;
1321
+ for (let i = 0; i < o.length; i++) {
1322
+ const n = o.item(i);
1323
+ n.nodeType === 1 && n.localName === "definedName" && this.processDefineName(t, n, r, s.sheets);
1324
+ }
1325
+ r.length > 0 && (s.names = r);
1326
+ }
1327
+ processWorkbookPr(t, e, s) {
1328
+ e && t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY);
1329
+ }
1330
+ afterVisit(t, e, s) {
1331
+ }
1332
+ }
1333
+ class St {
1334
+ visit(t, e, s) {
1335
+ return t.copyFromAttribute(e, "name", s), t.copyFromAttribute(e, "displayName", s), t.copyFromAttribute(e, "ref", s), t.copyFromAttribute(e, "headerRowCount", s, "headerRowCount", t.INT_COPY), t.copyFromAttribute(e, "totalsRowCount", s, "totalsRowCount", t.INT_COPY), this.processTableColumns(t, e, s), this.processTableStyleInfo(t, e, s), s;
1336
+ }
1337
+ processTableStyleInfo(t, e, s) {
1338
+ if (!e) return;
1339
+ const r = e.childNodes, o = {};
1340
+ for (let i = 0; i < r.length; i++) {
1341
+ const n = r.item(i);
1342
+ n.nodeType === 1 && n.localName === "tableStyleInfo" && (t.copyFromAttribute(n, "name", o), t.copyFromAttribute(n, "showColumnStripes", o, "showColumnStripes", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showFirstColumn", o, "showFirstColumn", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showLastColumn", o, "showLastColumn", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showRowStripes", o, "showRowStripes", t.BOOLEAN_COPY));
1343
+ }
1344
+ Object.keys(o).length > 0 && (s.styleOptions = o);
1345
+ }
1346
+ processTableColumn(t, e, s) {
1347
+ if (!e) return null;
1348
+ const r = e.childNodes;
1349
+ for (let o = 0; o < r.length; o++) {
1350
+ const i = r.item(o);
1351
+ if (i.nodeType === 1 && i.localName === "tableColumn") {
1352
+ const n = {};
1353
+ t.copyFromAttribute(i, "name", n), t.copyFromAttribute(i, "uniqueName", n), s.push(n);
1354
+ }
1355
+ }
1356
+ return s;
1357
+ }
1358
+ processTableColumns(t, e, s) {
1359
+ const r = e.childNodes, o = [];
1360
+ for (let i = 0; i < r.length; i++) {
1361
+ const n = r.item(i);
1362
+ n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(t, n, o);
1363
+ }
1364
+ o.length > 0 && (s.columns = o);
1365
+ }
1366
+ }
1367
+ class xt {
1368
+ visit(t, e, s) {
1369
+ return s;
1370
+ }
1371
+ }
1372
+ class E {
1373
+ visit(t, e, s) {
1374
+ if (!e) return;
1375
+ const r = {};
1376
+ return t.copyFromAttribute(e, "editAs", r, "anchorType"), r.anchor = {}, this.processOffsetCoord(t, t.evaluate("from", e), r.anchor, "from"), this.processOffsetCoord(t, t.evaluate("to", e), r.anchor, "to"), s.movables || (s.movables = []), s.movables.push(r), r;
1377
+ }
1378
+ processOffsetCoord(t, e, s, r) {
1379
+ if (!e) return;
1380
+ const o = { c: 0, r: 0, x: 0, y: 0 };
1381
+ return t.evaluate("col", e) && (o.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (o.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (o.x = x(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (o.y = x(t.evaluate("rowOff", e).textContent)), r === "from" ? s.tl = o : s.br = o, s;
1382
+ }
1383
+ }
1384
+ class U {
1385
+ visit(t, e, s) {
1386
+ if (!e) return;
1387
+ const r = t.evaluate("*/cNvPr", e);
1388
+ return r && (t.copyFromAttribute(r, "name", s), t.copyFromAttribute(r, "desc", s), t.copyFromAttribute(r, "hidden", s, "hidden", t.BOOLEAN_COPY), t.copyFromAttribute(r, "id", s)), s;
1389
+ }
1390
+ }
1391
+ class kt extends U {
1392
+ visit(t, e, s) {
1393
+ if (!e) return;
1394
+ s = super.visit(t, e, s);
1395
+ const r = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1396
+ if (r) {
1397
+ const n = t.evaluate("graphicFrameLocks", r);
1398
+ if (n) {
1399
+ n.hasAttribute("noChangeAspect") && (s.lockAspect = n.getAttribute("noChangeAspect") === "1");
1400
+ const l = {};
1401
+ Object.keys(l).length > 0 && (s.locks = l);
1402
+ }
1403
+ }
1404
+ let o = { type: "graphicFrame", json: {} };
1405
+ const i = t.evaluate("graphic/graphicData", e).childNodes;
1406
+ for (let n = 0; n < i.length; n++) {
1407
+ const l = i.item(n);
1408
+ if (l.nodeType === 1) try {
1409
+ let a = l.localName;
1410
+ a === "chart" && (a = "chart"), o.type = a;
1411
+ const c = l.getAttribute("r:id");
1412
+ c && (o.json = t.getRef(c));
1413
+ } catch (a) {
1414
+ console.warn("Unable to parse graphicFrame", a);
1415
+ }
1416
+ }
1417
+ return o && (s.content = o), o;
1418
+ }
1419
+ }
1420
+ class z extends U {
1421
+ visit(t, e, s) {
1422
+ if (!e) return;
1423
+ s = super.visit(t, e, s);
1424
+ const r = t.evaluate("nvSpPr/cNvSpPr", e);
1425
+ if (r) {
1426
+ const i = t.evaluate("spLocks", r);
1427
+ if (i) {
1428
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1429
+ const n = {};
1430
+ Object.keys(n).length > 0 && (s.locks = n);
1431
+ }
1432
+ }
1433
+ t.warn(`Unable to import '${s.name}', shapes are not supported.`);
1434
+ const o = {};
1435
+ return s.content = { type: "sp", json: o }, o;
1436
+ }
1437
+ }
1438
+ class It extends U {
1439
+ visit(t, e, s) {
1440
+ if (!e) return;
1441
+ const r = super.visit(t, e, s), o = t.evaluate("nvPicPr/cNvPicPr", e);
1442
+ if (o) {
1443
+ t.copyFromAttribute(e, "preferRelativeResize", r, "preferRelativeResize", t.BOOLEAN_COPY);
1444
+ const a = t.evaluate("picLocks", o);
1445
+ if (a) {
1446
+ a.hasAttribute("noChangeAspect") && (r.lockAspect = a.getAttribute("noChangeAspect") === "1");
1447
+ const c = {};
1448
+ t.copyFromAttribute(a, "noChangeArrowheads", r, "noChangeArrowheads", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noChangeShapeType", r, "noChangeShapeType", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noEditPoints", r, "noEditPoints", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noAdjustHandles", r, "noAdjustHandles", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noCrop", r, "noCrop", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noGrp", r, "noGrp", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noMove", r, "noMove", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noResize", r, "noResize", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noRot", r, "noRot", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noSelect", r, "noSelect", t.BOOLEAN_COPY), Object.keys(c).length > 0 && (r.locks = c);
1449
+ }
1450
+ }
1451
+ const i = t.evaluate("blipFill/blip", e);
1452
+ let n;
1453
+ if (i) {
1454
+ const a = i.getAttribute("r:embed") ?? i.getAttribute("embed");
1455
+ if (!a) return void console.warn("no rId found for blip", i);
1456
+ n = t.getRef(a, !0);
1457
+ }
1458
+ const l = { resId: n };
1459
+ return s.content = { type: "picture", json: l }, r;
1460
+ }
1461
+ }
1462
+ class Lt extends z {
1463
+ visit(t, e, s) {
1464
+ if (!e) return;
1465
+ s = super.visit(t, e, s);
1466
+ const r = t.evaluate("nvGrpSpPr/cNvGrpSpPr", e);
1467
+ if (r) {
1468
+ const i = t.evaluate("grpSpLocks", r);
1469
+ if (i) {
1470
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1471
+ const n = {};
1472
+ Object.keys(n).length > 0 && (s.locks = n);
1473
+ }
1474
+ }
1475
+ t.warn(`Unable to import '${s.name}', group shapes are not supported.`);
1476
+ const o = {};
1477
+ return s.content = { type: "grpSp", json: o }, o;
1478
+ }
1479
+ }
1480
+ class Bt extends z {
1481
+ visit(t, e, s) {
1482
+ if (!e) return;
1483
+ s = super.visit(t, e, s);
1484
+ const r = t.evaluate("nvCxnSpPr/cNvCxnSpPr", e);
1485
+ if (r) {
1486
+ const i = t.evaluate("cxnSpLocks", r);
1487
+ if (i) {
1488
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1489
+ const n = {};
1490
+ Object.keys(n).length > 0 && (s.locks = n);
1491
+ }
1492
+ }
1493
+ t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);
1494
+ const o = {};
1495
+ return s.content = { type: "cxnSp", json: o }, o;
1496
+ }
1497
+ }
1498
+ const $ = "richTypes";
1499
+ class _t {
1500
+ visit(t, e, s) {
1501
+ let r = t.getVisitorParamsState().get($);
1502
+ r || (r = [], t.getVisitorParamsState().set($, r));
1503
+ const o = e.childNodes, i = o.length;
1504
+ for (let n = 0; n < i; n++) {
1505
+ const l = o.item(n);
1506
+ if (l.nodeType === 1 && l.localName === "s") {
1507
+ const a = { type: l.getAttribute("t") ?? "n", keys: [] };
1508
+ this.processKeys(t, l, a), r.push(a);
1509
+ }
1510
+ }
1511
+ return s.richTypes = r, r;
1512
+ }
1513
+ processKeys(t, e, s) {
1514
+ const r = e.childNodes, o = r.length, i = s.keys;
1515
+ for (let n = 0; n < o; n++) {
1516
+ const l = r.item(n);
1517
+ if (l.nodeType === 1 && l.localName === "k") {
1518
+ const a = l.getAttribute("n"), c = l.getAttribute("t");
1519
+ i.push([a, c]);
1520
+ }
1521
+ }
1522
+ }
1523
+ }
1524
+ const K = "richData";
1525
+ class jt {
1526
+ visit(t, e, s) {
1527
+ let r = t.getVisitorParamsState().get("richTypes");
1528
+ if (!r) return void t.warn("RichValueFound but not type.");
1529
+ let o = t.getVisitorParamsState().get(K);
1530
+ o || (o = [], t.getVisitorParamsState().set(K, o));
1531
+ const i = e.childNodes, n = i.length;
1532
+ for (let l = 0; l < n; l++) {
1533
+ const a = i.item(l);
1534
+ if (a.nodeType === 1 && a.localName === "rv") {
1535
+ const c = r[a.getAttribute("s")], h = { type: c.type };
1536
+ this.processValues(t, a, h, c);
1537
+ const p = this.mapType(t, h);
1538
+ o.push(p);
1539
+ }
1540
+ }
1541
+ return s.richData = o, o;
1542
+ }
1543
+ mapType(t, e) {
1544
+ if (e.type === "_error") {
1545
+ const s = e.errorType;
1546
+ if (s) try {
1547
+ e = st.getBuiltInById(s + 1);
1548
+ } catch {
1549
+ }
1550
+ }
1551
+ return e;
1552
+ }
1553
+ processValues(t, e, s, r) {
1554
+ const o = e.childNodes, i = o.length;
1555
+ r.type;
1556
+ const n = r.keys;
1557
+ for (let l = 0; l < i; l++) {
1558
+ const a = o.item(l);
1559
+ if (a.nodeType === 1 && a.localName === "v") {
1560
+ const c = n[l];
1561
+ if (!c) return void t.warn("Invalid richData");
1562
+ const h = c[0], p = c[1];
1563
+ let g = a.textContent;
1564
+ p === "i" && (g = Number(g)), s[h] = g;
1565
+ }
1566
+ }
1567
+ }
1568
+ }
1569
+ class Rt {
1570
+ visit(t, e, s) {
1571
+ if (!e) return;
1572
+ const r = [];
1573
+ return this.processAuthors(t, t.evaluate("authors", e), r), r.length > 0 && (s.authors = r), s.comments = [], s;
1574
+ }
1575
+ processAuthors(t, e, s) {
1576
+ if (!e) return;
1577
+ const r = e.childNodes;
1578
+ for (let o = 0; o < r.length; o++) {
1579
+ const i = r.item(o);
1580
+ if (i.nodeType === 1 && i.localName === "author") {
1581
+ const n = i.firstChild;
1582
+ n && n.nodeType === 3 && s.push(n.textContent);
1583
+ }
1584
+ }
1585
+ }
1586
+ }
1587
+ class Et {
1588
+ visit(t, e, s) {
1589
+ if (!e) return;
1590
+ const r = {};
1591
+ return t.copyFromAttribute(e, "ref", r), t.copyFromAttribute(e, "authorId", r, "authorId", t.INT_COPY), r.asNote = !0, s.comments || (s.comments = []), s.comments.push(r), r;
1592
+ }
1593
+ }
1594
+ class Yt {
1595
+ visit(t, e, s) {
1596
+ if (!e) return;
1597
+ const r = [];
1598
+ return s.comments = r, r;
1599
+ }
1600
+ }
1601
+ class Dt {
1602
+ visit(t, e, s) {
1603
+ if (!e) return;
1604
+ const r = {};
1605
+ return t.copyFromAttribute(e, "id", r, "id", I), t.copyFromAttribute(e, "personId", r, "personId", I), t.copyFromAttribute(e, "ref", r), t.copyFromAttribute(e, "parentId", r, "parentId", I), t.copyFromAttribute(e, "dT", r), e.hasAttribute("done") && (r.done = f(e.getAttribute("done"))), s.push(r), r;
1606
+ }
1607
+ }
1608
+ class Mt {
1609
+ visit(t, e, s) {
1610
+ const r = [], o = e.childNodes;
1611
+ for (let i = 0; i < o.length; i++) {
1612
+ const n = o.item(i);
1613
+ if (n.nodeType === 1 && n.localName === "person") {
1614
+ const l = {};
1615
+ t.copyFromAttribute(n, "id", l, "id", I), t.copyFromAttribute(n, "displayName", l), t.copyFromAttribute(n, "userId", l, "userId", I), t.copyFromAttribute(n, "providerId", l), r.push(l);
1616
+ }
1617
+ }
1618
+ return r.length > 0 && (s.persons = r), r;
1619
+ }
1620
+ }
1621
+ const Ut = {};
1622
+ class zt {
1623
+ constructor(t, e) {
1624
+ this.path = t, this.visitor = e;
1625
+ }
1626
+ }
1627
+ class $t {
1628
+ constructor() {
1629
+ this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new ct()), this.registerVisitor("spPr", new M()), this.registerVisitor("txBody", new F()), this.registerVisitor("txPr", new F()), this.registerVisitor("c:chartSpace", new ut()), this.registerVisitor("c:chartSpace", new ht(), "chart"), this.registerVisitor("c:plotArea", new pt()), this.registerVisitor("c:barChart", new gt()), this.registerVisitor("c:doughnutChart", new S()), this.registerVisitor("c:lineChart", new S()), this.registerVisitor("c:ofPieType", new S()), this.registerVisitor("c:pieChart", new S()), this.registerVisitor("c:scatterChart", new S()), this.registerVisitor("c:barChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new N("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new dt()), this.registerVisitor("c:dPt", new mt()), this.registerVisitor("c:marker", new bt()), this.registerVisitor("c:catAx", new R()), this.registerVisitor("c:valAx", new R()), this.registerVisitor("c:dateAx", new R()), this.registerVisitor("c:majorGridlines", new j("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new j("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new F("labels.text"), "txPr"), this.registerVisitor("c:valAx", new F("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new F("labels.text"), "txPr"), this.registerVisitor("c:legend", new At()), this.registerVisitor("c:legend", new F("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new ft()), this.registerVisitor("c:ser", new yt(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new N("labels"), "dLbls"), this.registerVisitor("c:dLbl", new N("points")), this.registerVisitor("c:title", new X()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new vt()), this.registerVisitor("c:dispUnits", new j("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new X("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new F(), "tx/rich"), this.registerVisitor("a:theme", new Ft()), this.registerVisitor("a:theme", new Ct(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new wt(), "themeElements/fontScheme"), this.registerVisitor("autoFilter", new Nt()), this.registerVisitor("sortState", new Ot()), this.registerVisitor("s:workbook", new Vt()), this.registerVisitor("styleSheet", new Tt()), this.registerVisitor("table", new St()), this.registerVisitor("hlinkClick", new Pt()), this.registerVisitor("wsDr", new xt()), this.registerVisitor("twoCellAnchor", new E()), this.registerVisitor("oneCellAnchor", new E()), this.registerVisitor("absoluteAnchor", new E()), this.registerVisitor("graphicFrame", new kt()), this.registerVisitor("sp", new z()), this.registerVisitor("grpSp", new Lt()), this.registerVisitor("cxnSp", new Bt()), this.registerVisitor("pic", new It()), this.registerVisitor("rvStructures", new _t()), this.registerVisitor("rvData", new jt()), this.registerVisitor("comments", new Rt()), this.registerVisitor("commentList", new Et(), "comment"), this.registerVisitor("comment", new F("content"), "text"), this.registerVisitor("ThreadedComments", new Yt()), this.registerVisitor("threadedComment", new Dt()), this.registerVisitor("threadedComment", new F("content"), "text"), this.registerVisitor("personList", new Mt());
1630
+ }
1631
+ registerVisitor(t, e, s = null) {
1632
+ t.indexOf(":") === -1 && (t = "*:" + t);
1633
+ const r = t.split(":"), o = r.length > 1 ? r[1] : r[0];
1634
+ if (!s) return this.visitorsByXmlTagName.set(o, e), void this.visitorsByXmlTagName.set(t, e);
1635
+ let i = this.scopedVisitorsByXmlTagName.get(o);
1636
+ i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new zt(s, e));
1637
+ }
1638
+ getVisitorParamsState() {
1639
+ return this.visitorParamsState;
1640
+ }
1641
+ convert(t, e, s = Ut) {
1642
+ const r = t.documentElement;
1643
+ this.visitorParamsState && !s?.paramMap || (this.visitorParamsState = s?.paramMap ?? /* @__PURE__ */ new Map());
1644
+ const o = {};
1645
+ let i = this.visitorsByXmlTagName.get(r.nodeName);
1646
+ if (i || (i = this.visitorsByXmlTagName.get(r.localName)), !i) throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
1647
+ const n = "/" + r.localName, l = new _(null, this, n, r, o, e, s), a = [];
1648
+ this._doWalk(i, l, a, r, o, e, s);
1649
+ for (let c = 0; c < a.length; c++) {
1650
+ const h = a[c];
1651
+ try {
1652
+ h.visitor?.afterVisit?.(h.context, h.elemParent, h.jsonParent);
1653
+ } catch (p) {
1654
+ console.warn(`Error in afterVisit: ${h.context.getPath()}`, p);
1655
+ }
1656
+ }
1657
+ return o;
1658
+ }
1659
+ _walkScoped(t, e, s, r, o, i, n) {
1660
+ const l = this.scopedVisitorsByXmlTagName.get(t);
1661
+ for (let a = 0; l && a < l.length; a++) {
1662
+ const c = l[a];
1663
+ let h = null;
1664
+ try {
1665
+ h = e.evaluate(c.path, r);
1666
+ } catch {
1667
+ console.warn(`"Invalid path '${c.path}' for '${t}'.`);
1668
+ }
1669
+ if (!h) continue;
1670
+ const p = (g) => {
1671
+ let d = g.localName, v = g.parentNode;
1672
+ for (; v && v !== r; ) d = v.localName + "/" + d, v = v.parentNode;
1673
+ const O = e.getPath() + "/" + d;
1674
+ if (c.visitor) {
1675
+ const B = new _(e, this, O, e.getElemRoot(), e.getJsonRoot(), i, n);
1676
+ this._doWalk(c.visitor, B, s, g, o, i, n);
1677
+ }
1678
+ };
1679
+ if (h.length > 0) {
1680
+ const g = h;
1681
+ for (let d = 0; d < g.length; d++) p(g.item(d));
1682
+ } else p(h);
1683
+ }
1684
+ }
1685
+ _doWalk(t, e, s, r, o, i, n) {
1686
+ let l = null;
1687
+ t && (s.push({ visitor: t, context: e, elemParent: r, jsonParent: o }), l = t.visit(e, r, o)), l || (l = o);
1688
+ const a = r.localName;
1689
+ this._walkScoped(a, e, s, r, l, i, n);
1690
+ const c = r.childNodes;
1691
+ for (let h = 0; h < c.length; h++) {
1692
+ const p = c.item(h);
1693
+ if (p.nodeType === 1) {
1694
+ const g = p, d = g.localName, v = this.visitorsByXmlTagName.get(d), O = e.getPath() + "/" + d, B = new _(e, this, O, e.getElemRoot(), e.getJsonRoot(), i, n);
1695
+ this._doWalk(v, B, s, g, l ?? o, i, n);
1696
+ }
1697
+ }
1698
+ return l;
1699
+ }
1700
+ }
1701
+ export {
1702
+ $t as FromOOXMLConverter,
1703
+ $t as default
1704
+ };