@sheetxl/studio-vanilla 0.1.98

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 (184) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +100 -0
  3. package/build/browser/cjs/1q6_3-jGNZllbF3R.cjs +6 -0
  4. package/build/browser/cjs/5KDindu3wyLVvG7F.cjs +6 -0
  5. package/build/browser/cjs/87m5i_TKPbDn6tke.cjs +30 -0
  6. package/build/browser/cjs/B0L2YQ9agsyHWOu2.cjs +6 -0
  7. package/build/browser/cjs/B3HvYH5kqySWdJ0f.cjs +6 -0
  8. package/build/browser/cjs/B6AOUko0HYRy2MPw.cjs +6 -0
  9. package/build/browser/cjs/BC5MKXBhHGdPeiJ3.cjs +21 -0
  10. package/build/browser/cjs/BG0RxkPyZY6Be7Lk.cjs +6 -0
  11. package/build/browser/cjs/BJsJYwvFiJBFxTov.cjs +6 -0
  12. package/build/browser/cjs/BMVMyi5NiMBuQrl9.cjs +52 -0
  13. package/build/browser/cjs/BS_QXQWoKRl_7MiR.cjs +17 -0
  14. package/build/browser/cjs/BZPhmHWsFBTIA3BQ.cjs +210 -0
  15. package/build/browser/cjs/B_5ro-VEKfZDMSn_.cjs +6 -0
  16. package/build/browser/cjs/B_c3i0fXSlX7dH12.cjs +1521 -0
  17. package/build/browser/cjs/BarieqwSecnaFn0d.cjs +6 -0
  18. package/build/browser/cjs/BfNo_1u55uW2HhAa.cjs +6 -0
  19. package/build/browser/cjs/Bl6FyLoMkFiQqhvc.cjs +7 -0
  20. package/build/browser/cjs/Bsyzteo6tD31A45e.cjs +11 -0
  21. package/build/browser/cjs/Btzizuqo7zQ_grdS.cjs +16 -0
  22. package/build/browser/cjs/BxBOlXY9P3Ymi6oT.cjs +6 -0
  23. package/build/browser/cjs/C0AP85yKTJU5XzPW.cjs +6 -0
  24. package/build/browser/cjs/C0Pjx18ua-OCdtpy.cjs +6 -0
  25. package/build/browser/cjs/CA2wSX6txFrM5nXD.cjs +6 -0
  26. package/build/browser/cjs/CB3jEtNo5ZsjfE5p.cjs +6 -0
  27. package/build/browser/cjs/CDiYZ1cSoLW8U5Mz.cjs +6 -0
  28. package/build/browser/cjs/CHD5c5FdcMm6vLyG.cjs +155 -0
  29. package/build/browser/cjs/COCpf8tSdkj2O19V.cjs +134 -0
  30. package/build/browser/cjs/CTV1KRGhkieiY4Rf.cjs +42 -0
  31. package/build/browser/cjs/CUw8AoM-rVbp1W3s.cjs +6 -0
  32. package/build/browser/cjs/CVTydWBioXRZeoNf.cjs +6 -0
  33. package/build/browser/cjs/C_uXPPlfjY68-QA8.cjs +6 -0
  34. package/build/browser/cjs/CaNR-X0TWW9OF1S0.cjs +33 -0
  35. package/build/browser/cjs/CiySKEsfDr8XnkZh.cjs +6 -0
  36. package/build/browser/cjs/CtBikymnhpcCzP3X.cjs +6 -0
  37. package/build/browser/cjs/CyF7bxA0DO13ETpx.cjs +30 -0
  38. package/build/browser/cjs/D-vkFAlNHXwUvmUT.cjs +16 -0
  39. package/build/browser/cjs/D2OU29-ZPOAWFVJB.cjs +22 -0
  40. package/build/browser/cjs/DFX31uXp449or-Xs.cjs +6 -0
  41. package/build/browser/cjs/DLqNXuHYff_kQuj1.cjs +6 -0
  42. package/build/browser/cjs/DMKZDMHHXLePvLy3.cjs +524 -0
  43. package/build/browser/cjs/DP8biA0GQqyPKLyq.cjs +6 -0
  44. package/build/browser/cjs/DcYrNx0uy99yQNMl.cjs +21 -0
  45. package/build/browser/cjs/Dcyg_YxTfBgi_6cp.cjs +26 -0
  46. package/build/browser/cjs/DeR9YbwO2xDBKVWN.cjs +21 -0
  47. package/build/browser/cjs/DfNbgyjaLMn81dqP.cjs +6 -0
  48. package/build/browser/cjs/DirazCTz5IsFWrUv.cjs +22 -0
  49. package/build/browser/cjs/Dix4vuDuOzj4WGCJ.cjs +19 -0
  50. package/build/browser/cjs/DqbTRjj97q78RuGC.cjs +6 -0
  51. package/build/browser/cjs/Dy28YI90qj65PHFO.cjs +17 -0
  52. package/build/browser/cjs/Nkl33Tt1_oEy9kjk.cjs +6 -0
  53. package/build/browser/cjs/S1S-AvD0w8s-LV8O.cjs +6 -0
  54. package/build/browser/cjs/bnPgbgGBTq7DESzd.cjs +6 -0
  55. package/build/browser/cjs/d9tJGmGw-3KZjpAx.cjs +17 -0
  56. package/build/browser/cjs/dke2gbIUS44QXwEl.cjs +6 -0
  57. package/build/browser/cjs/index.cjs +6 -0
  58. package/build/browser/cjs/mPpQR06-jf99r2jM.cjs +6 -0
  59. package/build/browser/cjs/wq0Sm3fu9rxt43OK.cjs +6 -0
  60. package/build/browser/cjs/xM54FRmGddZFVTTI.cjs +6 -0
  61. package/build/browser/cjs/xgGpGg5b8fu3GAnL.cjs +33 -0
  62. package/build/browser/esm/1Jl9rrRJdbPsUP_1.mjs +13222 -0
  63. package/build/browser/esm/3RX6dP_O-47yXKHQ.mjs +1492 -0
  64. package/build/browser/esm/5F5MTh8R-sIiPq0h.mjs +22 -0
  65. package/build/browser/esm/B3_l6_TLa9ImyRmW.mjs +5572 -0
  66. package/build/browser/esm/B7odLLxNfEmKGWX6.mjs +49 -0
  67. package/build/browser/esm/BAjCWyggrIkCz6wr.mjs +22 -0
  68. package/build/browser/esm/BE4io65W825i_dzC.mjs +58 -0
  69. package/build/browser/esm/BEZ41ST3hkC4W-_9.mjs +22 -0
  70. package/build/browser/esm/BKkD05hqNTBap4Oc.mjs +22 -0
  71. package/build/browser/esm/BOiR2dTlvcgYjz8P.mjs +402 -0
  72. package/build/browser/esm/BOjAZRs_NVerYv4t.mjs +22 -0
  73. package/build/browser/esm/BRkMPyIUXMixnL8d.mjs +22 -0
  74. package/build/browser/esm/BSS_RvWzDRX8_EJd.mjs +1684 -0
  75. package/build/browser/esm/BXC9rQVV2gq5x8br.mjs +22 -0
  76. package/build/browser/esm/BYmMkbrRTsNuR3aY.mjs +1358 -0
  77. package/build/browser/esm/BaSzK17p3_gCvNVV.mjs +24 -0
  78. package/build/browser/esm/BdtlmF31h4Y7RgUj.mjs +22 -0
  79. package/build/browser/esm/Be3zRnYQ13HUcsRW.mjs +150 -0
  80. package/build/browser/esm/BiSk8LRROMF0Bl4-.mjs +92 -0
  81. package/build/browser/esm/BlfHOASL_bJ6Hy0y.mjs +40 -0
  82. package/build/browser/esm/C-jC-wgAoMOxrVvv.mjs +1377 -0
  83. package/build/browser/esm/C0Lw5hMgKbooA6Jl.mjs +22 -0
  84. package/build/browser/esm/C32FpMEFLbDnBtO3.mjs +22 -0
  85. package/build/browser/esm/C9uN8RnLjnGSimTA.mjs +439 -0
  86. package/build/browser/esm/CB0UHheTgg0735hj.mjs +52 -0
  87. package/build/browser/esm/CU55zbw8Xbwap6Tl.mjs +22 -0
  88. package/build/browser/esm/CWRCdxOg103AFis3.mjs +3926 -0
  89. package/build/browser/esm/CpJdzwQYkBw7IPnN.mjs +22 -0
  90. package/build/browser/esm/CprFmxuwGvaUtLG2.mjs +22 -0
  91. package/build/browser/esm/CtZxtE4tRmMGFT5o.mjs +22 -0
  92. package/build/browser/esm/D-Oj36iQScXAKSMA.mjs +53 -0
  93. package/build/browser/esm/D2yyUr4KbJEFsxKC.mjs +21 -0
  94. package/build/browser/esm/D8HF2X8hvAkV29oq.mjs +55 -0
  95. package/build/browser/esm/DCauh523moR7slpq.mjs +22 -0
  96. package/build/browser/esm/DIA-Gy5mdjefjUaA.mjs +22 -0
  97. package/build/browser/esm/DJjdfX9aUyVGMkri.mjs +47 -0
  98. package/build/browser/esm/DMWb8cCaNVRcm-tT.mjs +2352 -0
  99. package/build/browser/esm/DP7HVKT0w_4L2vMQ.mjs +844 -0
  100. package/build/browser/esm/DToiYU1jffn1g7TH.mjs +639 -0
  101. package/build/browser/esm/DgSuz0WKGy36a2cp.mjs +22 -0
  102. package/build/browser/esm/Dgw3FTbNKuo2CIxP.mjs +22 -0
  103. package/build/browser/esm/DnV_Y9xoMPSav0-o.mjs +56 -0
  104. package/build/browser/esm/Do7pHqmnwO45_ymt.mjs +22 -0
  105. package/build/browser/esm/DqvZDTDIyX-qv4r9.mjs +29 -0
  106. package/build/browser/esm/Ds8V__cRAClpmjZn.mjs +1714 -0
  107. package/build/browser/esm/DtQdtXJDZgNEIz9d.mjs +440 -0
  108. package/build/browser/esm/DtpBQqwK7XXBMTB-.mjs +1598 -0
  109. package/build/browser/esm/DuzJ1k0LbZ29l8oN.mjs +945 -0
  110. package/build/browser/esm/Dxl4WJXcEhDAw_yE.mjs +42 -0
  111. package/build/browser/esm/LblYfFi1ns9H1ueN.mjs +28 -0
  112. package/build/browser/esm/NBkvFJzfLU32Pkup.mjs +496 -0
  113. package/build/browser/esm/SrBQAOpMKiDW0mGB.mjs +22 -0
  114. package/build/browser/esm/VLa1cYMb7h6UD253.mjs +64 -0
  115. package/build/browser/esm/YOEDF-U1QTzbXeMV.mjs +3826 -0
  116. package/build/browser/esm/a3tuiJ83MwzLMWaL.mjs +22 -0
  117. package/build/browser/esm/ai2Jw3PRL29E1T8h.mjs +22 -0
  118. package/build/browser/esm/ajBoEmoL9hCBQYYm.mjs +2175 -0
  119. package/build/browser/esm/index.mjs +13 -0
  120. package/build/browser/esm/k9kWmEk0ZT8y9Gii.mjs +48740 -0
  121. package/build/cdn/assets/1Jl9rrRJdbPsUP_1.js +13222 -0
  122. package/build/cdn/assets/4u46flV9M6Bwb7d3.js +29 -0
  123. package/build/cdn/assets/5F5MTh8R-sIiPq0h.js +22 -0
  124. package/build/cdn/assets/B3oMCEEls1lRVrGd.js +5572 -0
  125. package/build/cdn/assets/B4QYfmNd300iFLAx.js +945 -0
  126. package/build/cdn/assets/BAjCWyggrIkCz6wr.js +22 -0
  127. package/build/cdn/assets/BEZ41ST3hkC4W-_9.js +22 -0
  128. package/build/cdn/assets/BJIsFTUdHtUKsFJs.js +28 -0
  129. package/build/cdn/assets/BKkD05hqNTBap4Oc.js +22 -0
  130. package/build/cdn/assets/BOiR2dTlvcgYjz8P.js +402 -0
  131. package/build/cdn/assets/BOjAZRs_NVerYv4t.js +22 -0
  132. package/build/cdn/assets/BPFW3UexkNNh1lLK.js +2352 -0
  133. package/build/cdn/assets/BRkMPyIUXMixnL8d.js +22 -0
  134. package/build/cdn/assets/BSS_RvWzDRX8_EJd.js +1684 -0
  135. package/build/cdn/assets/BXC9rQVV2gq5x8br.js +22 -0
  136. package/build/cdn/assets/BY2sO3ExW1ShzKnX.js +1714 -0
  137. package/build/cdn/assets/BYmMkbrRTsNuR3aY.js +1358 -0
  138. package/build/cdn/assets/BaSzK17p3_gCvNVV.js +24 -0
  139. package/build/cdn/assets/BbpmcI-KEp3PqrdL.js +496 -0
  140. package/build/cdn/assets/BdtlmF31h4Y7RgUj.js +22 -0
  141. package/build/cdn/assets/BjgtkLR9U00HgSRn.js +58 -0
  142. package/build/cdn/assets/BlfHOASL_bJ6Hy0y.js +40 -0
  143. package/build/cdn/assets/C-jC-wgAoMOxrVvv.js +1377 -0
  144. package/build/cdn/assets/C0Lw5hMgKbooA6Jl.js +22 -0
  145. package/build/cdn/assets/C32FpMEFLbDnBtO3.js +22 -0
  146. package/build/cdn/assets/C7CDwp-nhN2WFzUs.js +844 -0
  147. package/build/cdn/assets/C9uN8RnLjnGSimTA.js +439 -0
  148. package/build/cdn/assets/CEq_C1Sim0pQ6fj0.js +56 -0
  149. package/build/cdn/assets/CLdcRW7BQK3JCguC.js +48587 -0
  150. package/build/cdn/assets/CU55zbw8Xbwap6Tl.js +22 -0
  151. package/build/cdn/assets/C_L_pvQemfhI00iS.js +150 -0
  152. package/build/cdn/assets/CkhSGQneqlTRflfQ.js +47 -0
  153. package/build/cdn/assets/CpJdzwQYkBw7IPnN.js +22 -0
  154. package/build/cdn/assets/CprFmxuwGvaUtLG2.js +22 -0
  155. package/build/cdn/assets/CtZxtE4tRmMGFT5o.js +22 -0
  156. package/build/cdn/assets/CvbyGDitUPabmYBl.js +64 -0
  157. package/build/cdn/assets/D06aHumWZLILF489.js +3926 -0
  158. package/build/cdn/assets/D2pceTwrS_dagByu.js +21 -0
  159. package/build/cdn/assets/D4ZBjoUG2QO1RO3t.js +1492 -0
  160. package/build/cdn/assets/DARyg_kqL8Eu81Fa.js +2175 -0
  161. package/build/cdn/assets/DCauh523moR7slpq.js +22 -0
  162. package/build/cdn/assets/DIA-Gy5mdjefjUaA.js +22 -0
  163. package/build/cdn/assets/DLHK1pMyNN3B2g-j.js +52 -0
  164. package/build/cdn/assets/DMoEzt3UKZedfext.js +1598 -0
  165. package/build/cdn/assets/DMwOymY267-LxmJ_.js +49 -0
  166. package/build/cdn/assets/DToiYU1jffn1g7TH.js +639 -0
  167. package/build/cdn/assets/DUUO52IRQCve_iCM.js +440 -0
  168. package/build/cdn/assets/DgSuz0WKGy36a2cp.js +22 -0
  169. package/build/cdn/assets/Dgw3FTbNKuo2CIxP.js +22 -0
  170. package/build/cdn/assets/Do7pHqmnwO45_ymt.js +22 -0
  171. package/build/cdn/assets/Dxl4WJXcEhDAw_yE.js +42 -0
  172. package/build/cdn/assets/QXzPuadwi3BBJC2-.js +53 -0
  173. package/build/cdn/assets/SrBQAOpMKiDW0mGB.js +22 -0
  174. package/build/cdn/assets/W3SqjN4yIzwYTvvj.js +55 -0
  175. package/build/cdn/assets/YOEDF-U1QTzbXeMV.js +3826 -0
  176. package/build/cdn/assets/a3tuiJ83MwzLMWaL.js +22 -0
  177. package/build/cdn/assets/ai2Jw3PRL29E1T8h.js +22 -0
  178. package/build/cdn/assets/fWcbv7BXhriCYeod.js +92 -0
  179. package/build/cdn/index.js +171 -0
  180. package/build/cdn/loader.js +6 -0
  181. package/build/licenses/dependencies.txt +1 -0
  182. package/build/package.json +61 -0
  183. package/build/types/index.d.ts +151 -0
  184. package/package.json +92 -0
@@ -0,0 +1,1714 @@
1
+ import { aX as k, o as T, aY as G, q as Q, S as W, aZ as C, a_ as tt, a$ as P, M as et, y as Y, b0 as V } from "./k9kWmEk0ZT8y9Gii.mjs";
2
+ import { c as x, b as f, r as L, t as rt, a as A, p as D, d as st } from "./3RX6dP_O-47yXKHQ.mjs";
3
+ /**
4
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
5
+ *
6
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
7
+ * License: The license can be found at https://www.sheetxl.com/license.
8
+ */
9
+ /**
10
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
11
+ *
12
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
13
+ * License: The license can be found at https://www.sheetxl.com/license.
14
+ */
15
+ /**
16
+ * @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
17
+ *
18
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
19
+ * License: The license can be found at https://www.sheetxl.com/license.
20
+ */
21
+ class ot {
22
+ constructor(t) {
23
+ this.list = t;
24
+ }
25
+ get length() {
26
+ return this.list.length;
27
+ }
28
+ item(t) {
29
+ return this.list[t];
30
+ }
31
+ forEach(t, e) {
32
+ for (let s = 0; s < this.list.length; s++) t(this.list[s], s, this);
33
+ }
34
+ }
35
+ const it = (u) => u === !0 || u === "1" || u === "on" || u === "true" || u !== !1 && u !== "0" && u !== "off" && u !== "false" && null, nt = (u) => {
36
+ const t = parseInt(u);
37
+ return isNaN(t) ? null : t;
38
+ }, lt = (u) => {
39
+ const t = parseFloat(u);
40
+ return isNaN(t) ? null : t;
41
+ }, at = /* @__PURE__ */ new Map();
42
+ class _ {
43
+ constructor(t, e, s, r, o, i = null, n) {
44
+ const l = (c, h, p) => n?.getRef?.(c, h, p, n?.parsedRefs), a = (c) => n?.getRefs?.(c, n?.parsedRefs);
45
+ 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);
46
+ }
47
+ getRef(t, e = !1) {
48
+ return this._getRef?.(t, this._fileLocation, e) ?? null;
49
+ }
50
+ getRelationships() {
51
+ return this._getRefs(this._fileLocation) ?? at;
52
+ }
53
+ getPath() {
54
+ return this.currentPath;
55
+ }
56
+ getElemRoot() {
57
+ return this.elemRoot;
58
+ }
59
+ getJsonRoot() {
60
+ return this.jsonRoot;
61
+ }
62
+ warn(t) {
63
+ this._onWarning ? this._onWarning(t) : this._parent ? this._parent?.warn?.(t) : console.warn(t);
64
+ }
65
+ addPerson(t) {
66
+ return this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) : null;
67
+ }
68
+ getVisitorParamsState() {
69
+ return this.sharedShared.getVisitorParamsState();
70
+ }
71
+ evaluate(t, e) {
72
+ if (!t) return e;
73
+ let s = [e];
74
+ const r = t.split("/");
75
+ for (let o = 0; o < r.length; o++) {
76
+ const i = r[o];
77
+ if (i === "" || i === ".") continue;
78
+ let n = [];
79
+ for (let l = 0; l < s.length; l++) {
80
+ const a = s[l], c = a.childNodes;
81
+ for (let h = 0; c && h < c.length; h++) {
82
+ const p = a.childNodes[h];
83
+ p.localName !== i && i !== "*" || n.push(p);
84
+ }
85
+ }
86
+ s = n;
87
+ }
88
+ return s.length === 1 ? s[0] : s.length === 0 ? null : new ot(s);
89
+ }
90
+ getFromPath(t, e) {
91
+ return Y.getFromPath(t, e);
92
+ }
93
+ setToPath(t, e, s) {
94
+ return Y.setToPath(t, e, s);
95
+ }
96
+ getValAttrAsString(t, e) {
97
+ let s = this.evaluate(t, e);
98
+ return s && s.hasAttribute("val") ? s.getAttribute("val") ?? null : null;
99
+ }
100
+ getValAttrAsBoolean(t, e, s = !1) {
101
+ let r = this.evaluate(t, e);
102
+ if (!r) return null;
103
+ const o = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
104
+ return o == null ? s : o === "1" || o === "on" || o === "true" || o !== "0" && o !== "off" && o !== "false" && s;
105
+ }
106
+ getValAttrAsInteger(t, e) {
107
+ let s = this.evaluate(t, e);
108
+ return s && s.hasAttribute("val") ? parseInt(s.getAttribute("val")) ?? null : null;
109
+ }
110
+ getValAttrAsFloat(t, e) {
111
+ let s = this.evaluate(t, e);
112
+ return s && s.hasAttribute("val") ? parseFloat(s.getAttribute("val")) ?? null : null;
113
+ }
114
+ get BOOLEAN_COPY() {
115
+ return it;
116
+ }
117
+ get INT_COPY() {
118
+ return nt;
119
+ }
120
+ get FLOAT_COPY() {
121
+ return lt;
122
+ }
123
+ copyFromAttribute(t, e, s, r = e, o = null) {
124
+ if (!t || !s || !t.hasAttribute(e)) return;
125
+ let i = t.getAttribute(e);
126
+ if (o) {
127
+ if (Array.isArray(o)) {
128
+ for (let n = 0; n < o.length; n++) if (i == null || (i = o[n](i), i == null)) return;
129
+ } else if (i == null || (i = o(i), i == null)) return;
130
+ }
131
+ this.setToPath(s, r, i);
132
+ }
133
+ }
134
+ class j {
135
+ constructor(t) {
136
+ this.jsonKey = t;
137
+ }
138
+ visit(t, e, s) {
139
+ const r = {};
140
+ return s[this.jsonKey] = r, r;
141
+ }
142
+ }
143
+ class ct {
144
+ visit(t, e, s) {
145
+ if (!e) return;
146
+ const r = e.childNodes;
147
+ for (let o = 0; o < r.length; o++) {
148
+ const i = r.item(o);
149
+ i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(t, i, s);
150
+ }
151
+ return s;
152
+ }
153
+ processRelationship(t, e, s) {
154
+ const r = {};
155
+ t.copyFromAttribute(e, "Target", r, "target"), t.copyFromAttribute(e, "Type", r, "type"), t.copyFromAttribute(e, "TargetMode", r, "targetMode"), s[e.getAttribute("Id")] = r;
156
+ }
157
+ }
158
+ const H = (u, t) => {
159
+ if (u || !u.hasAttribute("rot")) return;
160
+ const e = u.getAttribute("rot"), s = Y.roundAccurately(D(e), 2);
161
+ s !== -1e3 && (t.rotation = s);
162
+ }, b = (u, t, e, s, r) => {
163
+ const o = u.getValAttrAsString(s, t);
164
+ o !== null && (e[r] = o);
165
+ }, m = (u, t, e, s, r = s, o = null) => {
166
+ const i = u.getValAttrAsBoolean(s, t, o);
167
+ i !== null && (e[r] = i);
168
+ }, w = (u, t, e, s, r) => {
169
+ const o = u.getValAttrAsInteger(s, t);
170
+ o !== null && (e[r] = o);
171
+ }, y = (u, t, e, s, r, o = 1) => {
172
+ const i = u.getValAttrAsFloat(s, t);
173
+ i !== null && (e[r] = i * o);
174
+ };
175
+ class ut {
176
+ visit(t, e, s) {
177
+ return m(t, e, s, "roundedCorners", "roundedCorners"), w(t, e, s, ".//AlternateContent/Fallback/style", "styleId"), s.range = null, s;
178
+ }
179
+ afterVisit(t, e, s) {
180
+ let r = {};
181
+ s.types = r;
182
+ let o = {}, i = 0, n = {}, l = 0, a = t.getVisitorParamsState().get("axes");
183
+ const c = t.getVisitorParamsState().get("types");
184
+ for (let g = 0; g < c.length; g++) {
185
+ const d = c[g];
186
+ if (d.xAxisId) {
187
+ const v = d.xAxisId, O = a.get(v);
188
+ o[g + ""] = O, d.offsetXAxis = g, delete d.xAxisId, s.xAxes = o, o.length = ++i;
189
+ }
190
+ if (d.yAxisId) {
191
+ const v = d.yAxisId, O = a.get(v);
192
+ n[g + ""] = O, d.offsetYAxis = g, delete d.yAxisId, s.yAxes = n, n.length = ++l;
193
+ }
194
+ r[g + ""] = d;
195
+ }
196
+ r.length = c.length;
197
+ const h = t.getVisitorParamsState().get("series");
198
+ if (!h || h.length === 0) return;
199
+ const p = {};
200
+ s.series = p;
201
+ for (let g = 0; g < h.length; g++) p[g + ""] = h[g];
202
+ p.length = h.length;
203
+ }
204
+ }
205
+ class ht {
206
+ visit(t, e, s) {
207
+ 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;
208
+ }
209
+ afterVisit(t, e, s) {
210
+ try {
211
+ const r = t.getValAttrAsBoolean("autoTitleDeleted", e), o = t.evaluate("title", e);
212
+ t.setToPath(s, "title.shown", !(r === !0 || !o));
213
+ const i = t.evaluate("legend", e);
214
+ t.setToPath(s, "legend.shown", i !== null);
215
+ } catch (r) {
216
+ throw new Error("Unexpected Error parsing Chart: " + r);
217
+ }
218
+ }
219
+ }
220
+ class pt {
221
+ visit(t, e, s) {
222
+ let r = {};
223
+ return s.plotArea = r, r;
224
+ }
225
+ }
226
+ class I {
227
+ EnumMappings() {
228
+ }
229
+ static fromOoxmlGradientType(t) {
230
+ return t === "circle" ? "radial" : t;
231
+ }
232
+ static fromOoxmlLineCap(t) {
233
+ if (t === "rnd") return "round";
234
+ if (t === "flat") return "butt";
235
+ if (t === "sq") return "square";
236
+ throw new Error("Invalid lineCap type: " + t);
237
+ }
238
+ static fromOoxmlCompound(t) {
239
+ return t === "sng" ? "single" : t;
240
+ }
241
+ static fromOoxmlAlignment(t) {
242
+ return t === "ctr" ? "center" : t;
243
+ }
244
+ }
245
+ class q {
246
+ visit(t, e, s) {
247
+ }
248
+ processStroke(t, e, s) {
249
+ const r = {}, o = t.evaluate("ln", e);
250
+ if (o) {
251
+ o.hasAttribute("algn") && (r.align = I.fromOoxmlAlignment(o.getAttribute("algn"))), o.hasAttribute("cap") && (r.lineCap = I.fromOoxmlLineCap(o.getAttribute("cap"))), o.hasAttribute("cmpd") && (r.compound = I.fromOoxmlCompound(o.getAttribute("cmpd"))), o.hasAttribute("w") && (r.width = rt(o.getAttribute("w")));
252
+ const i = t.evaluate("miter", o);
253
+ 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");
254
+ const n = t.evaluate("custDash", o);
255
+ if (n) {
256
+ const c = t.evaluate("ds", n);
257
+ if (c && c.length > 0) {
258
+ let h = "";
259
+ for (let p = 0; p < c.length; p++) {
260
+ const g = c.item(p);
261
+ h += A(g.getAttribute("d")) + "," + A(g.getAttribute("sp"));
262
+ }
263
+ r.dash = h;
264
+ }
265
+ }
266
+ const l = t.evaluate("prstDash", o);
267
+ l && l.hasAttribute("val") && (r.dash = l.getAttribute("val")), this.parseEndElement(t, o, r, "headEnd", "head"), this.parseEndElement(t, o, r, "tailEnd", "tail");
268
+ const a = this.processFill(t, o, s);
269
+ r.fill = a;
270
+ }
271
+ return r;
272
+ }
273
+ parseEndElement(t, e, s, r, o) {
274
+ const i = t.evaluate(r, e);
275
+ if (i && (i.hasAttribute("type") && (s[o + "Type"] = i.getAttribute("type")), i.hasAttribute("len") || i.hasAttribute("w"))) {
276
+ const n = i.getAttribute("len") ? i.getAttribute("len") : "med", l = i.getAttribute("w") ? i.getAttribute("w") : "med";
277
+ s[o + "Size"] = n + "-" + l;
278
+ }
279
+ }
280
+ processFill(t, e, s) {
281
+ const r = {};
282
+ if (t.evaluate("noFill", e)) return r.none = !0, r;
283
+ const o = t.evaluate("solidFill", e);
284
+ if (o) {
285
+ const a = this.processAdjColor(t, o);
286
+ return a && (r.solid = a), r;
287
+ }
288
+ const i = t.evaluate("gradFill", e);
289
+ if (i) {
290
+ i.hasAttribute("rotWithShape") && (r.isRotated = i.getAttribute("rotWithShape") === "1");
291
+ const a = this.processGradFill(t, i);
292
+ return r.gradient = a, r;
293
+ }
294
+ const n = t.evaluate("pattFill", e);
295
+ if (n) {
296
+ const a = this.processPatternFill(t, n);
297
+ return r.pattern = a, r;
298
+ }
299
+ const l = t.evaluate("blipFill", e);
300
+ if (l) {
301
+ l.hasAttribute("rotWithShape") && (r.isRotated = f(l.getAttribute("rotWithShape"))), l.hasAttribute("dpi") && (r.dpi = l.getAttribute("dpi"));
302
+ const a = this.processImageFill(t, l);
303
+ return r.image = a, r;
304
+ }
305
+ return r.none = !0, r;
306
+ }
307
+ processGradFill(t, e) {
308
+ const s = {}, r = t.evaluate("lin", e);
309
+ if (r) {
310
+ if (s.type = "linear", r.hasAttribute("ang")) {
311
+ const c = D(r.getAttribute("ang"));
312
+ s.angle = c;
313
+ }
314
+ if (r.hasAttribute("scaled")) {
315
+ const c = f(r.getAttribute("scaled"));
316
+ s.scaled = c;
317
+ }
318
+ }
319
+ const o = {};
320
+ e.hasAttribute("flip") && (o.mirror = e.getAttribute("flip")), Object.keys(o).length > 0 && (s.tile = o);
321
+ const i = t.evaluate("path", e);
322
+ if (i) {
323
+ i.hasAttribute("path") && (s.type = I.fromOoxmlGradientType(i.getAttribute("path")));
324
+ const c = t.evaluate("fillToRect", i);
325
+ c && (s.fillTo = this.getRect(c));
326
+ }
327
+ const n = t.evaluate("tileRect", e);
328
+ n && (s.tile.bounds = this.getRect(n));
329
+ const l = [], a = t.evaluate("gsLst/gs", e);
330
+ for (let c = 0; a && c < a.length; c++) {
331
+ const h = a.item(c), p = { offset: A(h.getAttribute("pos")), color: this.processAdjColor(t, h) };
332
+ l.push(p);
333
+ }
334
+ return l.length > 0 && (s.stops = l), s;
335
+ }
336
+ getRect(t) {
337
+ const e = {};
338
+ 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;
339
+ }
340
+ processImageFill(t, e) {
341
+ return { ref: "https://cdn.sheetxl.com/public/logo-color-square-onwhite.png", tile: !1 };
342
+ }
343
+ processPatternFill(t, e) {
344
+ const s = {}, r = e.getAttribute("prst");
345
+ s.type = r;
346
+ const o = t.evaluate("bgClr", e);
347
+ if (o) {
348
+ const n = this.processAdjColor(t, o);
349
+ n && (s.background = n);
350
+ }
351
+ const i = t.evaluate("fgClr", e);
352
+ if (i) {
353
+ let n = this.processAdjColor(t, i);
354
+ n && (s.foreground = n);
355
+ }
356
+ return s;
357
+ }
358
+ processAdjColor(t, e) {
359
+ const s = t.evaluate("hslClr", e);
360
+ if (s) return this.processHslClr(t, s);
361
+ const r = t.evaluate("prstClr", e);
362
+ if (r) return this.processClrWithValAttribute(t, r);
363
+ const o = t.evaluate("schemeClr", e);
364
+ if (o) return this.processClrWithValAttribute(t, o);
365
+ const i = t.evaluate("sysClr", e);
366
+ if (i) return this.processClrWithValAttribute(t, i);
367
+ const n = t.evaluate("scrgbClr", e);
368
+ if (n) return this.processScrgbClrElement(t, n);
369
+ const l = t.evaluate("srgbClr", e);
370
+ return l ? this.processSrgbClrElement(t, l) : null;
371
+ }
372
+ processScrgbClrElement(t, e) {
373
+ let s = "lrgba(" + A(e.getAttribute("r")) + "," + A(e.getAttribute("g")) + "," + A(e.getAttribute("b")) + ")";
374
+ return s += this.processAdjustments(t, e), s;
375
+ }
376
+ processSrgbClrElement(t, e) {
377
+ let s = e.getAttribute("val");
378
+ return s += this.processAdjustments(t, e), s;
379
+ }
380
+ processHslClr(t, e) {
381
+ let s = "hsl(" + D(e.getAttribute("hue")) + "," + A(e.getAttribute("sat")) + "," + A(e.getAttribute("lum")) + ")";
382
+ return s += this.processAdjustments(t, e), s;
383
+ }
384
+ processClrWithValAttribute(t, e) {
385
+ const s = e.getAttribute("val");
386
+ if (!s) return;
387
+ let r = s;
388
+ return r += this.processAdjustments(t, e), r;
389
+ }
390
+ processAdjustments(t, e) {
391
+ let s = "";
392
+ const r = e.childNodes;
393
+ for (let o = 0; o < r.length; o++) {
394
+ const i = r.item(o);
395
+ if (i.nodeType === 1) {
396
+ let n = i.localName;
397
+ 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);
398
+ }
399
+ }
400
+ return s;
401
+ }
402
+ processAdjustmentElement(t, e, s, r = 1e3) {
403
+ const o = t.evaluate(s, e);
404
+ if (!o) return "";
405
+ const i = o.getAttribute("val");
406
+ return i ? ` ${s} ${!i || parseFloat(i) / r}` : ` ${s}`;
407
+ }
408
+ }
409
+ class M extends q {
410
+ visit(t, e, s) {
411
+ try {
412
+ const r = t.evaluate("xfrm", e);
413
+ if (r) {
414
+ H(r, s);
415
+ const l = { x: 0, y: 0, width: 0, height: 0 }, a = t.evaluate("off", r);
416
+ a && (l.x = x(a.getAttribute("x")) ?? 0, l.y = x(a.getAttribute("y")) ?? 0);
417
+ const c = t.evaluate("ext", r);
418
+ a && (l.width = x(c.getAttribute("cx")) ?? 0, l.height = x(c.getAttribute("cy")) ?? 0), s.bounds = l;
419
+ }
420
+ const o = t.evaluate("prstGeom", e);
421
+ o?.hasAttribute("prst") ? s.geometry = o?.getAttribute("prst") : t.evaluate("customGeom", e) && console.warn("customGeom not supported yet");
422
+ const i = this.processFill(t, e, s);
423
+ i && Object.keys(i).length > 0 && (s.fill = i);
424
+ const n = this.processStroke(t, e, s);
425
+ return n && Object.keys(n).length > 0 && (s.stroke = n), s;
426
+ } catch (r) {
427
+ throw console.warn(r), new Error("Unexpected Error parsing Shape Properties element");
428
+ }
429
+ }
430
+ }
431
+ class S {
432
+ visit(t, e, s) {
433
+ let r = {};
434
+ 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) {
435
+ let o = t.getVisitorParamsState().get("types");
436
+ o || (o = [], t.getVisitorParamsState().set("types", o)), o.push(r);
437
+ }
438
+ return r;
439
+ }
440
+ parseType(t, e, s) {
441
+ switch (e.localName) {
442
+ case "areaChart":
443
+ s.type = "area";
444
+ break;
445
+ case "bubbleChart":
446
+ s.type = "bubble";
447
+ break;
448
+ case "doughnutChart":
449
+ case "ofPieType":
450
+ case "pieChart":
451
+ s.type = "pie";
452
+ break;
453
+ case "lineChart":
454
+ s.type = "line";
455
+ break;
456
+ case "scatterChart":
457
+ s.type = "scatter";
458
+ }
459
+ }
460
+ parseAxisIds(t, e, s) {
461
+ const r = t.evaluate("axId", e);
462
+ if (r.length === 0) return;
463
+ const o = r.item(0).getAttribute("val");
464
+ s.xAxisId = o;
465
+ const i = r.item(1).getAttribute("val");
466
+ s.yAxisId = i;
467
+ }
468
+ }
469
+ class gt extends S {
470
+ parseType(t, e, s) {
471
+ const r = t.getValAttrAsString("barDir", e);
472
+ r && (s.type = r === "col" ? "column" : "bar");
473
+ }
474
+ }
475
+ class N {
476
+ constructor(t) {
477
+ this.jsonKey = t;
478
+ }
479
+ visit(t, e, s) {
480
+ let r = {}, o = r, i = t.getValAttrAsString("idx", e);
481
+ i !== null && (o = {}, o[i] = r);
482
+ const n = t.getValAttrAsBoolean("delete", e);
483
+ 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"));
484
+ const l = t.evaluate("separator", e);
485
+ return l !== null && (r.separator = l.textContent), b(t, e, r, "dLblPos", "position"), s[this.jsonKey] = o, r;
486
+ }
487
+ parseNumFormat(t, e, s) {
488
+ const r = t.evaluate("numFmt", e);
489
+ if (r) {
490
+ const o = r.getAttribute("formatCode");
491
+ s.formatCode = o, r.hasAttribute("sourceLinked") && (s.sourceLinked = r.getAttribute("sourceLinked") === "1");
492
+ }
493
+ }
494
+ }
495
+ const J = (u, t, e) => {
496
+ if (u.getValAttrAsBoolean("invertIfNegative", t) === !0) if (u.evaluate("extLst/ext/invertSolidFillFmt", t)) {
497
+ if (e.fill && e.fillNegative) {
498
+ const s = u.getFromPath(e, "fill.solid.adjs");
499
+ s && u.setToPath(e, "fillNegative.solid.adjs", s);
500
+ }
501
+ } else {
502
+ const s = { val: "FFFFFF" }, r = {};
503
+ r.solid = s, e.fillNegative = r;
504
+ const o = { val: "000000" }, i = {};
505
+ i.solid = o;
506
+ const n = {};
507
+ n.fill = i, e.strokeNegative = n;
508
+ }
509
+ };
510
+ class dt {
511
+ visit(t, e, s) {
512
+ const r = {};
513
+ w(t, e, r, "explosion", "explosion");
514
+ let o = t.evaluate("cat/*/f", e);
515
+ o || (o = t.evaluate("xVal/*/f", e));
516
+ let i = null;
517
+ 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);
518
+ let n = t.evaluate("val/*/f", e);
519
+ n || (n = t.evaluate("yVal/*/f", e));
520
+ let l = null;
521
+ 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");
522
+ const a = t.getVisitorParamsState().get("types").length - 1;
523
+ r.offsetChart = a;
524
+ let c = t.getVisitorParamsState().get("series");
525
+ return c || (c = [], t.getVisitorParamsState().set("series", c)), c.push(r), r;
526
+ }
527
+ parseTitleRangeOrValue(t, e, s) {
528
+ const r = t.evaluate("tx/strRef/f", e);
529
+ if (r !== null) {
530
+ const o = r.firstChild.nodeValue;
531
+ t.setToPath(s, "title.range", o);
532
+ } else {
533
+ const o = t.evaluate("tx/v", e);
534
+ o !== null && t.setToPath(s, "title.text.simpleRun", o.firstChild.nodeValue);
535
+ }
536
+ }
537
+ parsePointsAsString(t, e) {
538
+ let s = "{";
539
+ const r = t.getValAttrAsInteger("ptCount", e), o = t.evaluate("pt", e), i = [];
540
+ for (let n = 0; o && r && n < r; n++) {
541
+ let l = null, a = t.evaluate("pt[@idx='" + n + "']/v", e);
542
+ a instanceof Node && (l = a.textContent), i[n] = l;
543
+ }
544
+ for (let n = 0; n < i.length; n++) n > 0 && (s += ","), i[n] !== void 0 && (s += i[n]);
545
+ return s += "}", s;
546
+ }
547
+ afterVisit(t, e, s) {
548
+ J(t, e, s);
549
+ let r = t.getFromPath(s, "points");
550
+ if (r) {
551
+ const o = Object.keys(r);
552
+ for (let i = 0; i < o.length; i++) {
553
+ const n = o[i], l = t.getFromPath(r, n);
554
+ if (!l) continue;
555
+ let a = t.getFromPath(l, "markers");
556
+ a && (t.setToPath(s, "markers.points." + n, a), delete l.markers);
557
+ }
558
+ }
559
+ }
560
+ }
561
+ class mt {
562
+ DataPointVisitor() {
563
+ }
564
+ visit(t, e, s) {
565
+ let r = t.getFromPath(s, "points"), o = null;
566
+ r ? o = r : (o = {}, t.setToPath(s, "points", o));
567
+ let i = {}, n = t.getValAttrAsString("idx", e);
568
+ return n !== null && (o[n] = i), m(t, e, i, "bubble3D", "bubble3D"), w(t, e, i, "explosion", "explosion"), J(t, e, i), i;
569
+ }
570
+ }
571
+ class bt {
572
+ visit(t, e, s) {
573
+ const r = e.parentNode.localName;
574
+ if (r === "ser" || r === "dPt") {
575
+ const o = {}, i = t.getValAttrAsString("size", e);
576
+ i !== null && (o.size = i);
577
+ const n = t.getValAttrAsString("symbol", e);
578
+ return n && (o.type = n), s.markers = o, o;
579
+ }
580
+ return null;
581
+ }
582
+ }
583
+ class R {
584
+ visit(t, e, s) {
585
+ let r = {};
586
+ 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");
587
+ const o = t.getValAttrAsInteger("noMultiLvlLbl", e);
588
+ 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());
589
+ const i = t.getValAttrAsString("axId", e);
590
+ return t.getVisitorParamsState().get("axes").set(i, r), r;
591
+ }
592
+ parseTimeUnits(t, e, s, r, o, i) {
593
+ const n = {};
594
+ let l = t.getValAttrAsString(o, e);
595
+ if (l !== null) {
596
+ n.dem = l;
597
+ let a = t.getValAttrAsString(i, e);
598
+ n.amt = a;
599
+ }
600
+ Object.keys(n).length > 0 && (s[r] = n);
601
+ }
602
+ parseDisplayCustOrBuiltInUnit(t, e, s) {
603
+ let r = e.getValAttrAsString("dispUnits/builtInUnit", t);
604
+ r || (r = e.getValAttrAsString("dispUnits/custUnit", t)), r && (s.displayUnits = r);
605
+ }
606
+ parseLabelAlign(t, e, s) {
607
+ let r = t.getValAttrAsString("lblAlgn", e);
608
+ r !== null && (r === "ctr" ? s.labelAlign = "center" : r === "l" ? s.labelAlign = "left" : r === "r" && (s.labelAlign = "right"));
609
+ }
610
+ parseOrientation(t, e, s) {
611
+ const r = t.getValAttrAsString("AxPos", e);
612
+ r !== null && (r === "b" ? s.orientation = "bottom" : r === "l" ? s.orientation = "left" : r === "r" ? s.orientation = "right" : r === "t" && (s.orientation = "top"));
613
+ }
614
+ parseNumFormat(t, e, s) {
615
+ const r = {}, o = t.evaluate("numFmt", e);
616
+ 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);
617
+ }
618
+ parseScaling(t, e, s) {
619
+ const r = t.getValAttrAsString("scaling/orientation", e);
620
+ r !== null && (s.inverted = r !== "minMax");
621
+ const o = t.getValAttrAsFloat("scaling/logBase", e);
622
+ o !== null && (s.logBase = o, s.scaleType = "log"), y(t, e, s, "scaling/max", "max"), y(t, e, s, "scaling/min", "min");
623
+ }
624
+ afterVisit(t, e, s) {
625
+ s.fill && s.labels && (s.labels.fill = s.fill, delete s.fill);
626
+ let r = t.getValAttrAsBoolean("delete", e);
627
+ r !== null && (t.setToPath(s, "labels.shown", r !== !0), t.setToPath(s, "shown", r !== !0));
628
+ const o = t.getFromPath(s, "dispUnits.displayUnitsLabel");
629
+ o && (t.setToPath(s, "displayUnitsLabel", o), delete s.dispUnits);
630
+ const i = t.evaluate("title", e);
631
+ t.setToPath(s, "title.shown", i !== null);
632
+ const n = t.evaluate("minorGridlines", e);
633
+ t.setToPath(s, "gridLinesMinor.shown", n !== null);
634
+ const l = t.evaluate("majorGridlines", e);
635
+ t.setToPath(s, "gridLinesMajor.shown", l !== null);
636
+ }
637
+ }
638
+ class F {
639
+ constructor(t = "text") {
640
+ this._jsonKey = t;
641
+ }
642
+ getTextPath() {
643
+ return this._jsonKey;
644
+ }
645
+ visit(t, e, s) {
646
+ let r = t.getFromPath(s, this.getTextPath());
647
+ return r || (r = {}), this.parseTextElement(t, e, r, !1), Object.keys(r).length > 0 && t.setToPath(s, this.getTextPath(), r), s;
648
+ }
649
+ parseTextElement(t, e, s, r) {
650
+ const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e);
651
+ o && (this.parseTextProperties(t, o, s), new M().visit(t, o, s));
652
+ let i = [], n = t.evaluate("p/r", e) ?? t.evaluate("r", e);
653
+ const l = (c) => {
654
+ const h = {};
655
+ let p = t.evaluate("t", c);
656
+ const g = t.evaluate("rPr", c);
657
+ g && this.parseTextProperties(t, g, h), p ? h.text = p.firstChild.textContent ?? "" : c.textContent && (h.text = c.textContent ?? ""), i.push(h);
658
+ };
659
+ if (n?.length !== void 0) for (let c = 0; n && c < n.length; c++) l(n.item(c));
660
+ else l(n || e);
661
+ i.length > 0 && (s.runs = i);
662
+ const a = t.evaluate("bodyPr", e);
663
+ a && H(a, s);
664
+ }
665
+ parseTextProperties(t, e, s) {
666
+ if (!e) return;
667
+ 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"));
668
+ const r = t.evaluate("latin", e);
669
+ if (r && !r.getAttribute("typeface").startsWith("+")) {
670
+ const o = s.font ?? {};
671
+ if (r.hasAttribute("typeface") && (o.family = r.getAttribute("typeface")), r.hasAttribute("panose")) {
672
+ const i = r.getAttribute("panose");
673
+ i && (o.fallbacks = [k.getPanoseFallback(i)]);
674
+ }
675
+ r.hasAttribute("pitchFamily") && (o.pitch = r.getAttribute("pitchFamily")), r.hasAttribute("charset") && (o.charset = r.getAttribute("charset")), Object.keys(o).length > 0 && (s.font = o);
676
+ }
677
+ }
678
+ }
679
+ class ft {
680
+ visit(t, e, s) {
681
+ let r = t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx", e)];
682
+ if (r) {
683
+ let o = t.getFromPath(r, "title");
684
+ o || (o = {}, t.setToPath(r, "title", o));
685
+ let i = o, n = t.getValAttrAsBoolean("delete", e);
686
+ return n !== null && (i.shown = !n), i;
687
+ }
688
+ return s;
689
+ }
690
+ }
691
+ class At {
692
+ visit(t, e, s) {
693
+ const r = {};
694
+ return m(t, e, r, "overlay", "overlay"), b(t, e, r, "legendPos", "position"), s.legend = r, r;
695
+ }
696
+ }
697
+ class yt extends M {
698
+ visit(t, e, s) {
699
+ const r = this.processFill(t, e, s);
700
+ Object.keys(r).length > 0 && (s.fillNegative = r);
701
+ const o = this.processStroke(t, e, s);
702
+ return Object.keys(o).length > 0 && (s.strokeNegative = o), s;
703
+ }
704
+ }
705
+ class X extends F {
706
+ constructor(t = "title") {
707
+ super(t);
708
+ }
709
+ parseTitleRangeOrValue(t, e, s) {
710
+ let r = t.evaluate("tx/strRef/f", e) ?? null;
711
+ if (r) {
712
+ const o = r.firstElementChild.nodeValue;
713
+ t.setToPath(s, "range", o);
714
+ }
715
+ }
716
+ visit(t, e, s) {
717
+ const r = {};
718
+ m(t, e, r, "overlay", "overlay"), s[this._jsonKey] = r;
719
+ let o = t.getFromPath(r, this.getTextPath());
720
+ o || (o = {}), this.parseTitleRangeOrValue(t, e, r);
721
+ const i = t.evaluate("txPr", e);
722
+ i && this.parseTextElement(t, i, o, !1);
723
+ const n = t.evaluate("tx/rich", e);
724
+ return n && this.parseTextElement(t, n, o, !0), Object.keys(o).length > 0 && t.setToPath(r, this.getTextPath(), o), r;
725
+ }
726
+ afterVisit(t, e, s) {
727
+ if (s?.text) {
728
+ const r = s.text?.rotation ?? null;
729
+ r !== null && (s.rotation = parseInt(r), delete s.title.rotation);
730
+ }
731
+ }
732
+ }
733
+ class vt {
734
+ visit(t, e, s) {
735
+ const r = t.evaluate("manualLayout", e);
736
+ if (r) {
737
+ let o = {};
738
+ 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);
739
+ }
740
+ return s;
741
+ }
742
+ }
743
+ class Ft {
744
+ visit(t, e, s) {
745
+ return s.name = e.getAttribute("name"), s;
746
+ }
747
+ }
748
+ class Ct extends q {
749
+ visit(t, e, s) {
750
+ const r = {};
751
+ r.name = e.getAttribute("name");
752
+ const o = e.childNodes;
753
+ for (let i = 0; i < o.length; i++) {
754
+ const n = o.item(i);
755
+ if (n.nodeType === 1) {
756
+ let l = n.localName;
757
+ const a = t.evaluate(l, e), c = this.processAdjColor(t, a);
758
+ r[l] = c;
759
+ }
760
+ }
761
+ return Object.keys(r).length > 0 && (s.colors = r), r;
762
+ }
763
+ }
764
+ class wt {
765
+ visit(t, e, s) {
766
+ const r = {};
767
+ r.name = e.getAttribute("name");
768
+ const o = t.evaluate("majorFont", e), i = this.processFontElement(t, o, {});
769
+ r.majorFont = i.family, i.fallbacks && (r.majorFallbacks = i.fallbacks);
770
+ const n = t.evaluate("minorFont", e), l = this.processFontElement(t, n, {});
771
+ return r.minorFont = l.family, i.fallbacks && (r.minorFallbacks = l.fallbacks), s.fonts = r, r;
772
+ }
773
+ processFontElement(t, e, s) {
774
+ if (!e) return;
775
+ const r = t.evaluate("latin", e);
776
+ if (!r) return;
777
+ const o = r.getAttribute("typeface");
778
+ o && (s.family = o);
779
+ const i = r.getAttribute("panose");
780
+ return i && (s.fallbacks = [k.getPanoseFallback(i)]), s;
781
+ }
782
+ }
783
+ class Pt {
784
+ visit(t, e, s) {
785
+ if (!e) return;
786
+ const r = {}, o = e.getAttribute("r:id");
787
+ if (o) {
788
+ const i = t.getRef(o);
789
+ typeof i == "string" && (r.address = i);
790
+ }
791
+ 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;
792
+ }
793
+ }
794
+ class Nt {
795
+ visit(t, e, s) {
796
+ if (!e) return;
797
+ const r = {};
798
+ return t.copyFromAttribute(e, "ref", r), this.processFilterColumns(t, e, r), Object.keys(r).length > 0 && (s.filter = r), r;
799
+ }
800
+ processColorFilter(t, e) {
801
+ const s = { type: T.Type.Color };
802
+ return t.copyFromAttribute(e, "cellColor", s, "cellColor", t.BOOLEAN_COPY), t.copyFromAttribute(e, "dxfId", s, "styleId", t.INT_COPY), s;
803
+ }
804
+ processCustomFilter(t, e) {
805
+ const s = {};
806
+ return t.copyFromAttribute(e, "operator", s, "operator", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val"), s;
807
+ }
808
+ processCustomFilters(t, e) {
809
+ const s = { type: T.Type.Custom };
810
+ t.copyFromAttribute(e, "and", s, "and", t.BOOLEAN_COPY);
811
+ const r = e.childNodes;
812
+ s.filters = [];
813
+ for (let o = 0; o < r.length; o++) {
814
+ const i = r.item(o);
815
+ if (i.nodeType !== 1) continue;
816
+ let n = null;
817
+ i.localName === "customFilter" && (n = this.processCustomFilter(t, i)), n && s.filters.push(n);
818
+ }
819
+ return s;
820
+ }
821
+ processDynamicFilter(t, e) {
822
+ const s = { type: T.Type.Dynamic };
823
+ 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;
824
+ }
825
+ processDateGroupItem(t, e) {
826
+ const s = {};
827
+ 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;
828
+ }
829
+ processFilterItem(t, e) {
830
+ if (e.hasAttribute("val")) return e.getAttribute("val");
831
+ }
832
+ processFilters(t, e) {
833
+ const s = { type: T.Type.Items };
834
+ t.copyFromAttribute(e, "blank", s, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", s, "calendarType");
835
+ let r = [], o = [];
836
+ const i = e.childNodes;
837
+ for (let n = 0; n < i.length; n++) {
838
+ const l = i.item(n);
839
+ if (l.nodeType === 1) {
840
+ if (l.localName === "dateGroupItem") {
841
+ const a = this.processDateGroupItem(t, l);
842
+ a && r.push(a);
843
+ } else if (l.localName === "filter") {
844
+ const a = this.processFilterItem(t, l);
845
+ a !== void 0 && o.push(a);
846
+ }
847
+ }
848
+ }
849
+ return r.length > 0 && (s.dateGroups = r), o.length > 0 && (s.items = o), s;
850
+ }
851
+ processIcon(t, e) {
852
+ const s = { type: T.Type.Icon };
853
+ return t.copyFromAttribute(e, "iconId", s, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", s), s;
854
+ }
855
+ processTop10(t, e) {
856
+ const s = { type: T.Type.Top10 };
857
+ 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;
858
+ }
859
+ processFilterCriteria(t, e, s) {
860
+ if (!e) return;
861
+ const r = e.childNodes, o = [];
862
+ for (let i = 0; i < r.length; i++) {
863
+ const n = r.item(i);
864
+ if (n.nodeType !== 1) continue;
865
+ let l = null;
866
+ 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);
867
+ }
868
+ return o.length > 0 && (s.criteria = o), o;
869
+ }
870
+ processFilterColumn(t, e) {
871
+ if (!e) return null;
872
+ const s = {};
873
+ if (!e.hasAttribute("colId")) return;
874
+ s.offset = parseInt(e.getAttribute("colId"));
875
+ let r = !1;
876
+ 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;
877
+ }
878
+ processFilterColumns(t, e, s) {
879
+ if (!e) return;
880
+ const r = e.childNodes, o = [];
881
+ for (let i = 0; i < r.length; i++) {
882
+ const n = r.item(i);
883
+ if (n.nodeType === 1 && n.localName === "filterColumn") {
884
+ const l = this.processFilterColumn(t, n);
885
+ l && o.push(l);
886
+ }
887
+ }
888
+ return o.length > 0 && (s.fields = o), o;
889
+ }
890
+ }
891
+ class Ot {
892
+ visit(t, e, s) {
893
+ if (!e) return;
894
+ const r = {};
895
+ if (t.copyFromAttribute(e, "ref", r), e.hasAttribute("caseSensitive")) {
896
+ const n = f(e.getAttribute("caseSensitive"));
897
+ r.collatorOptions = n ? G.CaseSensitiveOptions : G.CaseInsensitiveOptions;
898
+ }
899
+ const o = e.getAttribute("sortMethod");
900
+ 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 = Q.Orientation.Column);
901
+ const i = W.fastStringToRange(r.ref);
902
+ return this.processSortConditions(t, e, r, i), Object.keys(r).length > 0 && (s.sort = r), r;
903
+ }
904
+ processSortCondition(t, e, s) {
905
+ if (!e) return null;
906
+ const r = {};
907
+ if (e.hasAttribute("ref")) {
908
+ if (e.hasAttribute("ref")) {
909
+ const o = e.getAttribute("ref"), i = W.fastStringToRange(o);
910
+ r.offset = s ? i.colStart - s.colStart : i.colStart;
911
+ }
912
+ 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;
913
+ }
914
+ console.warn("no ref for sort conditional", t.getPath());
915
+ }
916
+ processSortConditions(t, e, s, r) {
917
+ if (!e) return;
918
+ const o = e.childNodes, i = [];
919
+ for (let n = 0; n < o.length; n++) {
920
+ const l = o.item(n);
921
+ if (l.nodeType === 1 && l.localName === "sortCondition") {
922
+ const a = this.processSortCondition(t, l, r);
923
+ a && i.push(a);
924
+ }
925
+ }
926
+ return i.length > 0 && (s.fields = i), i;
927
+ }
928
+ }
929
+ class Z {
930
+ visit(t, e, s) {
931
+ }
932
+ processDataBarColor(t, e, s, r, o = "dk1") {
933
+ if (!e) return;
934
+ const i = st((n) => e.getAttribute(n), o);
935
+ return i && (s[r] = i), s;
936
+ }
937
+ processFonts(t, e, s) {
938
+ if (!e) return;
939
+ const r = e.childNodes;
940
+ let o = 0;
941
+ for (let i = 0; i < r.length; i++) {
942
+ const n = r.item(i);
943
+ if (n.nodeType === 1 && n.localName === "font") {
944
+ const l = {};
945
+ this.processFont(t, n, l), s[o++] = l;
946
+ }
947
+ }
948
+ return s;
949
+ }
950
+ processFont(t, e, s) {
951
+ 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);
952
+ const r = t.evaluate("u", e);
953
+ if (r) {
954
+ const n = r.getAttribute("val");
955
+ s.underline = n || k.UnderlineStyle.Single;
956
+ }
957
+ 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");
958
+ const o = t.evaluate("color", e);
959
+ this.processDataBarColor(t, o, s, "fill"), s.fill || (s.fill = "dk1"), b(t, e, s, "name", "family"), b(t, e, s, "rFont", "family");
960
+ const i = t.evaluate("family", e);
961
+ if (i) {
962
+ const n = i.getAttribute("val");
963
+ if (n) switch (n) {
964
+ case "1":
965
+ s.fallbacks = ["serif"];
966
+ break;
967
+ case "2":
968
+ s.fallbacks = ["sans-serif"];
969
+ break;
970
+ case "3":
971
+ s.fallbacks = ["monospace"];
972
+ break;
973
+ case "4":
974
+ s.fallbacks = ["cursive"];
975
+ break;
976
+ case "5":
977
+ s.fallbacks = ["fantasy"];
978
+ }
979
+ }
980
+ 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;
981
+ }
982
+ processFills(t, e, s) {
983
+ if (!e) return;
984
+ const r = e.childNodes;
985
+ let o = 0;
986
+ for (let i = 0; i < r.length; i++) {
987
+ const n = r.item(i);
988
+ n.nodeType === 1 && n.localName === "fill" && this.processFill(t, n, s, o++);
989
+ }
990
+ return s;
991
+ }
992
+ processFill(t, e, s, r) {
993
+ const o = { type: C.Type.None }, i = e.childNodes;
994
+ let n = !1;
995
+ for (let l = 0; !n && l < i.length; l++) {
996
+ const a = i.item(l);
997
+ a.nodeType === 1 && (a.localName === "gradientFill" ? (this.processGradientFill(t, a, o), n = !0) : a.localName === "patternFill" && (this.processPatternFill(t, a, o), n = !0));
998
+ }
999
+ return s[r] = o, s;
1000
+ }
1001
+ processGradientFill(t, e, s) {
1002
+ if (!e) return;
1003
+ s.type = C.Type.Gradient;
1004
+ const r = [];
1005
+ s.stops = r, s.angle = 90 + (e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0);
1006
+ const o = e.getAttribute("type");
1007
+ o && (s.gradientType = o);
1008
+ const i = (l) => {
1009
+ if (!l) return 0;
1010
+ const a = parseFloat(l);
1011
+ return isNaN(a) ? 0 : a;
1012
+ };
1013
+ (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")) });
1014
+ const n = e.childNodes;
1015
+ for (let l = 0; l < n.length; l++) {
1016
+ const a = n.item(l);
1017
+ if (a.nodeType === 1 && a.localName === "stop") {
1018
+ const c = {};
1019
+ r.push(c);
1020
+ const h = parseFloat(a.getAttribute("position"));
1021
+ c.offset = h;
1022
+ const p = t.evaluate("color", a);
1023
+ this.processDataBarColor(t, p, c, "color");
1024
+ }
1025
+ }
1026
+ return s;
1027
+ }
1028
+ processPatternFill(t, e, s) {
1029
+ if (!e) return;
1030
+ const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ? C.BuiltInSheetPattern.Solid : C.BuiltInSheetPattern.None);
1031
+ if (o === C.BuiltInSheetPattern.None) return { none: !0 };
1032
+ s.type = C.Type.Pattern, o && (s.patternType = o);
1033
+ let i, n = "foreground", l = "background";
1034
+ const a = s.patternType === C.BuiltInSheetPattern.Solid && r;
1035
+ if (a) {
1036
+ i = "lt1";
1037
+ const p = n;
1038
+ n = l, l = p;
1039
+ }
1040
+ const c = t.evaluate("fgColor", e);
1041
+ this.processDataBarColor(t, c, s, n, i);
1042
+ const h = t.evaluate("bgColor", e);
1043
+ return this.processDataBarColor(t, h, s, l, i), a && !s.foreground && (s.foreground = i), s;
1044
+ }
1045
+ processBorders(t, e, s, r) {
1046
+ if (!e) return;
1047
+ const o = e.childNodes;
1048
+ let i = 0;
1049
+ for (let n = 0; n < o.length; n++) {
1050
+ const l = o.item(n);
1051
+ l.nodeType === 1 && l.localName === "border" && this.processBorder(t, l, s, i++, r);
1052
+ }
1053
+ return s;
1054
+ }
1055
+ processBorder(t, e, s, r, o) {
1056
+ if (!e) return;
1057
+ const i = {};
1058
+ 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;
1059
+ }
1060
+ processBorderStroke(t, e, s, r) {
1061
+ if (!e) return;
1062
+ const o = t.evaluate(r, e);
1063
+ if (!o) return;
1064
+ const i = {};
1065
+ o.hasAttribute("style") && (i.style = o.getAttribute("style"));
1066
+ const n = t.evaluate("color", o);
1067
+ return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? s[r] = i : null;
1068
+ }
1069
+ }
1070
+ class Tt extends Z {
1071
+ visit(t, e, s) {
1072
+ this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1073
+ const r = { fills: {}, fonts: {}, borders: {} };
1074
+ 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] = {};
1075
+ const o = [];
1076
+ this.processXFs(t, t.evaluate("cellStyleXfs", e), o, r, null, !1);
1077
+ const i = /* @__PURE__ */ new Map();
1078
+ if (o.length > 0) {
1079
+ const a = [];
1080
+ this.processCellStyles(t, t.evaluate("cellStyles", e), a, o, i), s.named = a;
1081
+ }
1082
+ const n = [];
1083
+ this.processXFs(t, t.evaluate("cellXfs", e), n, r, i), Object.keys(n).length > 0 && (s.direct = n);
1084
+ const l = [];
1085
+ 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;
1086
+ }
1087
+ processIndexColors(t, e, s) {
1088
+ if (!e) return;
1089
+ const r = [], o = e.childNodes;
1090
+ for (let i = 0; i < o.length; i++) {
1091
+ const n = o.item(i);
1092
+ if (n.nodeType === 1 && n.localName === "rgbColor") {
1093
+ const l = { color: null };
1094
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1095
+ }
1096
+ }
1097
+ s.indexedColors = r;
1098
+ }
1099
+ processMruColors(t, e, s) {
1100
+ if (!e) return;
1101
+ const r = [], o = e.childNodes;
1102
+ for (let i = 0; i < o.length; i++) {
1103
+ const n = o.item(i);
1104
+ if (n.nodeType === 1 && n.localName === "color") {
1105
+ const l = { color: null };
1106
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1107
+ }
1108
+ }
1109
+ r.length > 0 && (s.mruColors = r);
1110
+ }
1111
+ processNumFmts(t, e, s) {
1112
+ if (!e) return;
1113
+ const r = /* @__PURE__ */ new Map();
1114
+ if (t.getVisitorParamsState().set("numFmts", r), !e) return;
1115
+ const o = e.childNodes;
1116
+ for (let i = 0; i < o.length; i++) {
1117
+ const n = o.item(i);
1118
+ if (n.nodeType === 1 && n.localName === "numFmt") {
1119
+ const l = n.getAttribute("numFmtId"), a = n.getAttribute("formatCode");
1120
+ if (l && a) {
1121
+ const c = a.replace(/\\(.)/g, "$1");
1122
+ r.set(parseInt(l), c);
1123
+ }
1124
+ }
1125
+ }
1126
+ }
1127
+ processXFs(t, e, s, r, o = null, i = !0) {
1128
+ if (!e) return;
1129
+ const n = e.childNodes;
1130
+ for (let l = 0; l < n.length; l++) {
1131
+ const a = n.item(l);
1132
+ if (a.nodeType === 1 && a.localName === "xf") {
1133
+ const c = {};
1134
+ this.processXF(t, a, c, r, o, i), s.push(c);
1135
+ }
1136
+ }
1137
+ }
1138
+ processXF(t, e, s, r, o, i) {
1139
+ if (!e) return;
1140
+ const n = e.getAttribute("xfId");
1141
+ if (n && o) {
1142
+ const c = o.get(parseInt(n));
1143
+ c && c !== tt.BuiltInName.Normal && (s.named = c);
1144
+ }
1145
+ const l = (c) => !(!i && e.hasAttribute(c)) || f(e.getAttribute("applyFont"));
1146
+ if (l("applyFont")) {
1147
+ const c = r.fonts[e.getAttribute("fontId")];
1148
+ c && (s.font = c);
1149
+ }
1150
+ if (l("applyFill")) {
1151
+ const c = r.fills[e.getAttribute("fillId")];
1152
+ c && Object.keys(c).length > 0 && (s.fill = c);
1153
+ }
1154
+ if (l("applyBorder")) {
1155
+ const c = r.borders[e.getAttribute("borderId")];
1156
+ c && Object.keys(c).length > 0 && (s.border = c);
1157
+ }
1158
+ if (l("applyNumberFormat")) {
1159
+ const c = e.getAttribute("numFmtId");
1160
+ if (c) {
1161
+ const h = parseInt(c);
1162
+ let p;
1163
+ const g = t.getVisitorParamsState();
1164
+ if (g) {
1165
+ const d = g.get("numFmts");
1166
+ d && (p = d.get(h)), s.numberFormat = p ?? h;
1167
+ } else console.warn("no visitor params state");
1168
+ }
1169
+ }
1170
+ l("applyAlignment") && this.processAlignment(t, t.evaluate("alignment", e), s), l("applyProtection") && this.processProtection(t, t.evaluate("protection", e), s);
1171
+ const a = f(e.getAttribute("quotePrefix"));
1172
+ a && (s.quotePrefix = a);
1173
+ }
1174
+ processAlignment(t, e, s) {
1175
+ const r = {};
1176
+ 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")) {
1177
+ let i = parseFloat(e.getAttribute("textRotation"));
1178
+ i > 0 && i <= 90 ? i = 360 - i : i > 90 && i <= 180 ? i -= 90 : i === 255 && (i = 0, r.stacked = !0), r.rotation = i;
1179
+ } else r.rotation = 0;
1180
+ e?.hasAttribute("justifyLastLine") && (r.justifyLastLine = f(e.getAttribute("justifyLastLine")));
1181
+ const o = e?.getAttribute("readingOrder");
1182
+ 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;
1183
+ }
1184
+ processProtection(t, e, s) {
1185
+ if (!e) return;
1186
+ const r = {}, o = e.getAttribute("locked");
1187
+ o && !f(o) && (r.edit = !0);
1188
+ const i = e.getAttribute("hidden");
1189
+ return i && f(i) && (r.formulaHidden = !0), Object.keys(r).length > 0 && (s.protection = r), s;
1190
+ }
1191
+ processDXF(t, e, s) {
1192
+ if (!e) return;
1193
+ const r = e.childNodes;
1194
+ for (let o = 0; o < r.length; o++) {
1195
+ const i = r.item(o);
1196
+ if (i.nodeType === 1 && i.localName === "font") {
1197
+ const n = {};
1198
+ this.processFont(t, i, n), s.font = n;
1199
+ } else if (i.nodeType === 1 && i.localName === "fill") {
1200
+ const n = [];
1201
+ this.processFill(t, i, n, 0), n.length > 0 && n[0] && (s.fill = n[0]);
1202
+ } else if (i.nodeType === 1 && i.localName === "border") {
1203
+ const n = [];
1204
+ this.processBorder(t, i, n, 0, !1), n.length > 0 && n[0] && (s.border = n[0]);
1205
+ }
1206
+ }
1207
+ }
1208
+ processDXFs(t, e, s) {
1209
+ if (!e) return;
1210
+ t.getVisitorParamsState().set("processingDXFs", !0);
1211
+ const r = /* @__PURE__ */ new Map();
1212
+ t.getVisitorParamsState().set("dxfs", r);
1213
+ const o = e.childNodes;
1214
+ for (let i = 0; i < o.length; i++) {
1215
+ const n = o.item(i);
1216
+ if (n.nodeType === 1 && n.localName === "dxf") {
1217
+ const l = {};
1218
+ this.processDXF(t, n, l);
1219
+ const a = s.length;
1220
+ r.set(a, l), s.push(l);
1221
+ }
1222
+ }
1223
+ t.getVisitorParamsState().delete("processingDXFs");
1224
+ }
1225
+ processTableStyle(t, e, s, r, o = !1) {
1226
+ const i = e.getAttribute("name"), n = { name: i };
1227
+ e.hasAttribute("table") && (n.table = f(e.getAttribute("table"))), e.hasAttribute("pivot") && (n.pivot = f(e.getAttribute("pivot"))), o && !n.pivot && r.unshift(null);
1228
+ const l = e.childNodes;
1229
+ for (let a = 0; a < l.length; a++) {
1230
+ const c = l.item(a);
1231
+ if (c.nodeType === 1 && c.localName === "tableStyleElement") {
1232
+ const h = c.getAttribute("type"), p = c.getAttribute("dxfId");
1233
+ let g = r?.[p];
1234
+ g || (console.warn("invalid dfx id", p), g = {}), n[h] = g;
1235
+ let d = null;
1236
+ c.hasAttribute("size") && (d = parseInt(c.getAttribute("size"))), d && !isNaN(d) && (g.size = d);
1237
+ }
1238
+ }
1239
+ delete n.name, s[i] = n;
1240
+ }
1241
+ processTableStyles(t, e, s, r, o) {
1242
+ if (!e) return;
1243
+ const i = {}, n = e.getAttribute("defaultTableStyle");
1244
+ n && (i.defaultTableStyle = n);
1245
+ const l = e.getAttribute("defaultPivotStyle");
1246
+ l && (i.defaultPivotStyle = l);
1247
+ const a = e.childNodes, c = {};
1248
+ for (let h = 0; h < a.length; h++) {
1249
+ const p = a.item(h);
1250
+ p.nodeType === 1 && p.localName === "tableStyle" && this.processTableStyle(t, p, c, r, o);
1251
+ }
1252
+ return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (s.tables = i), s;
1253
+ }
1254
+ processCellStyles(t, e, s, r, o) {
1255
+ if (!e) return;
1256
+ const i = e.childNodes;
1257
+ for (let n = 0; n < i.length; n++) {
1258
+ const l = i.item(n);
1259
+ if (l.nodeType === 1 && l.localName === "cellStyle") {
1260
+ const a = parseInt(l.getAttribute("xfId")), c = l.getAttribute("name");
1261
+ if (o.set(a, c), !r[a]) continue;
1262
+ const h = { name: c, style: r[a] };
1263
+ l.getAttribute("hidden") && (h.hidden = f(l.getAttribute("hidden"))), l.getAttribute("iLevel") && (h.iLevel = parseInt(l.getAttribute("iLevel"))), s.push(h);
1264
+ }
1265
+ }
1266
+ }
1267
+ afterVisit(t, e, s) {
1268
+ }
1269
+ }
1270
+ class Vt extends Z {
1271
+ visit(t, e, s) {
1272
+ 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;
1273
+ }
1274
+ processPassword(t, e, s, r = "password") {
1275
+ if (!e) return;
1276
+ const o = {};
1277
+ 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);
1278
+ }
1279
+ processWorkbookProtection(t, e, s) {
1280
+ if (!e) return;
1281
+ const r = {};
1282
+ this.processPassword(t, t.evaluate("workbookPassword", e), r), this.processPassword(t, t.evaluate("revisionsPassword", e), r, "revisionsPassword");
1283
+ const o = (i) => i !== !0 && i !== "1" && i !== "on" && i !== "true" && (i === !1 || i === "0" || i === "off" || i === "false" || null);
1284
+ 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;
1285
+ }
1286
+ processCalcPr(t, e, s) {
1287
+ e && (s.calc = {});
1288
+ }
1289
+ processSheetRefs(t, e, s) {
1290
+ if (!e) return;
1291
+ const r = [], o = e.childNodes;
1292
+ for (let i = 0; i < o.length; i++) {
1293
+ const n = o.item(i);
1294
+ n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(t, n, r);
1295
+ }
1296
+ s.sheets = r;
1297
+ }
1298
+ processSheetRef(t, e, s) {
1299
+ const r = {};
1300
+ t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility");
1301
+ const o = e.getAttribute("r:id"), i = t.getRef(o);
1302
+ i && (r.sheet = i), s.push(r);
1303
+ }
1304
+ processBookViews(t, e, s) {
1305
+ if (!e) return;
1306
+ const r = e.childNodes;
1307
+ let o = 0;
1308
+ for (let i = 0; o < 1 && i < e.childNodes.length; i++) {
1309
+ const n = r.item(i);
1310
+ n.nodeType === 1 && n.localName === "workbookView" && (this.processWorkbookView(t, n, s), o++);
1311
+ }
1312
+ }
1313
+ processWorkbookView(t, e, s) {
1314
+ if (!e) return;
1315
+ const r = {};
1316
+ 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);
1317
+ }
1318
+ processDefineName(t, e, s, r) {
1319
+ if (!e) return;
1320
+ const o = {}, i = e.firstChild;
1321
+ 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")) {
1322
+ const n = e.getAttribute("localSheetId");
1323
+ if (!r[n]?.name) return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1324
+ o.scope = r[n].name;
1325
+ }
1326
+ 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);
1327
+ }
1328
+ processDefinedNames(t, e, s) {
1329
+ if (!e) return;
1330
+ const r = [], o = e.childNodes;
1331
+ for (let i = 0; i < o.length; i++) {
1332
+ const n = o.item(i);
1333
+ n.nodeType === 1 && n.localName === "definedName" && this.processDefineName(t, n, r, s.sheets);
1334
+ }
1335
+ r.length > 0 && (s.names = r);
1336
+ }
1337
+ processWorkbookPr(t, e, s) {
1338
+ e && t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY);
1339
+ }
1340
+ afterVisit(t, e, s) {
1341
+ }
1342
+ }
1343
+ class St {
1344
+ visit(t, e, s) {
1345
+ 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;
1346
+ }
1347
+ processTableStyleInfo(t, e, s) {
1348
+ if (!e) return;
1349
+ const r = e.childNodes, o = {};
1350
+ for (let i = 0; i < r.length; i++) {
1351
+ const n = r.item(i);
1352
+ 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));
1353
+ }
1354
+ Object.keys(o).length > 0 && (s.styleOptions = o);
1355
+ }
1356
+ processTableColumn(t, e, s) {
1357
+ if (!e) return null;
1358
+ const r = e.childNodes;
1359
+ for (let o = 0; o < r.length; o++) {
1360
+ const i = r.item(o);
1361
+ if (i.nodeType === 1 && i.localName === "tableColumn") {
1362
+ const n = {};
1363
+ t.copyFromAttribute(i, "name", n), t.copyFromAttribute(i, "uniqueName", n), s.push(n);
1364
+ }
1365
+ }
1366
+ return s;
1367
+ }
1368
+ processTableColumns(t, e, s) {
1369
+ const r = e.childNodes, o = [];
1370
+ for (let i = 0; i < r.length; i++) {
1371
+ const n = r.item(i);
1372
+ n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(t, n, o);
1373
+ }
1374
+ o.length > 0 && (s.columns = o);
1375
+ }
1376
+ }
1377
+ class kt {
1378
+ visit(t, e, s) {
1379
+ return s;
1380
+ }
1381
+ }
1382
+ class E {
1383
+ visit(t, e, s) {
1384
+ if (!e) return;
1385
+ const r = {};
1386
+ 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;
1387
+ }
1388
+ processOffsetCoord(t, e, s, r) {
1389
+ if (!e) return;
1390
+ const o = { c: 0, r: 0, x: 0, y: 0 };
1391
+ 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;
1392
+ }
1393
+ }
1394
+ class U {
1395
+ visit(t, e, s) {
1396
+ if (!e) return;
1397
+ const r = t.evaluate("*/cNvPr", e);
1398
+ 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;
1399
+ }
1400
+ }
1401
+ class xt extends U {
1402
+ visit(t, e, s) {
1403
+ if (!e) return;
1404
+ s = super.visit(t, e, s);
1405
+ const r = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1406
+ if (r) {
1407
+ const n = t.evaluate("graphicFrameLocks", r);
1408
+ if (n) {
1409
+ n.hasAttribute("noChangeAspect") && (s.lockAspect = n.getAttribute("noChangeAspect") === "1");
1410
+ const l = {};
1411
+ Object.keys(l).length > 0 && (s.locks = l);
1412
+ }
1413
+ }
1414
+ let o = { type: "graphicFrame", json: {} };
1415
+ const i = t.evaluate("graphic/graphicData", e).childNodes;
1416
+ for (let n = 0; n < i.length; n++) {
1417
+ const l = i.item(n);
1418
+ if (l.nodeType === 1) try {
1419
+ let a = l.localName;
1420
+ a === "chart" && (a = "chart"), o.type = a;
1421
+ const c = l.getAttribute("r:id");
1422
+ c && (o.json = t.getRef(c));
1423
+ } catch (a) {
1424
+ console.warn("Unable to parse graphicFrame", a);
1425
+ }
1426
+ }
1427
+ return o && (s.content = o), o;
1428
+ }
1429
+ }
1430
+ class z extends U {
1431
+ visit(t, e, s) {
1432
+ if (!e) return;
1433
+ s = super.visit(t, e, s);
1434
+ const r = t.evaluate("nvSpPr/cNvSpPr", e);
1435
+ if (r) {
1436
+ const i = t.evaluate("spLocks", r);
1437
+ if (i) {
1438
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1439
+ const n = {};
1440
+ Object.keys(n).length > 0 && (s.locks = n);
1441
+ }
1442
+ }
1443
+ t.warn(`Unable to import '${s.name}', shapes are not supported.`);
1444
+ const o = {};
1445
+ return s.content = { type: "sp", json: o }, o;
1446
+ }
1447
+ }
1448
+ class Lt extends U {
1449
+ visit(t, e, s) {
1450
+ if (!e) return;
1451
+ const r = super.visit(t, e, s), o = t.evaluate("nvPicPr/cNvPicPr", e);
1452
+ if (o) {
1453
+ t.copyFromAttribute(e, "preferRelativeResize", r, "preferRelativeResize", t.BOOLEAN_COPY);
1454
+ const a = t.evaluate("picLocks", o);
1455
+ if (a) {
1456
+ a.hasAttribute("noChangeAspect") && (r.lockAspect = a.getAttribute("noChangeAspect") === "1");
1457
+ const c = {};
1458
+ 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);
1459
+ }
1460
+ }
1461
+ const i = t.evaluate("blipFill/blip", e);
1462
+ let n;
1463
+ if (i) {
1464
+ const a = i.getAttribute("r:embed") ?? i.getAttribute("embed");
1465
+ if (!a) return void console.warn("no rId found for blip", i);
1466
+ n = t.getRef(a, !0);
1467
+ }
1468
+ const l = { resId: n };
1469
+ return s.content = { type: "picture", json: l }, r;
1470
+ }
1471
+ }
1472
+ class It extends z {
1473
+ visit(t, e, s) {
1474
+ if (!e) return;
1475
+ s = super.visit(t, e, s);
1476
+ const r = t.evaluate("nvGrpSpPr/cNvGrpSpPr", e);
1477
+ if (r) {
1478
+ const i = t.evaluate("grpSpLocks", r);
1479
+ if (i) {
1480
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1481
+ const n = {};
1482
+ Object.keys(n).length > 0 && (s.locks = n);
1483
+ }
1484
+ }
1485
+ t.warn(`Unable to import '${s.name}', group shapes are not supported.`);
1486
+ const o = {};
1487
+ return s.content = { type: "grpSp", json: o }, o;
1488
+ }
1489
+ }
1490
+ class Bt extends z {
1491
+ visit(t, e, s) {
1492
+ if (!e) return;
1493
+ s = super.visit(t, e, s);
1494
+ const r = t.evaluate("nvCxnSpPr/cNvCxnSpPr", e);
1495
+ if (r) {
1496
+ const i = t.evaluate("cxnSpLocks", r);
1497
+ if (i) {
1498
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1499
+ const n = {};
1500
+ Object.keys(n).length > 0 && (s.locks = n);
1501
+ }
1502
+ }
1503
+ t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);
1504
+ const o = {};
1505
+ return s.content = { type: "cxnSp", json: o }, o;
1506
+ }
1507
+ }
1508
+ const $ = "richTypes";
1509
+ class _t {
1510
+ visit(t, e, s) {
1511
+ let r = t.getVisitorParamsState().get($);
1512
+ r || (r = [], t.getVisitorParamsState().set($, r));
1513
+ const o = e.childNodes, i = o.length;
1514
+ for (let n = 0; n < i; n++) {
1515
+ const l = o.item(n);
1516
+ if (l.nodeType === 1 && l.localName === "s") {
1517
+ const a = { type: l.getAttribute("t") ?? "n", keys: [] };
1518
+ this.processKeys(t, l, a), r.push(a);
1519
+ }
1520
+ }
1521
+ return s.richTypes = r, r;
1522
+ }
1523
+ processKeys(t, e, s) {
1524
+ const r = e.childNodes, o = r.length, i = s.keys;
1525
+ for (let n = 0; n < o; n++) {
1526
+ const l = r.item(n);
1527
+ if (l.nodeType === 1 && l.localName === "k") {
1528
+ const a = l.getAttribute("n"), c = l.getAttribute("t");
1529
+ i.push([a, c]);
1530
+ }
1531
+ }
1532
+ }
1533
+ }
1534
+ const K = "richData";
1535
+ class jt {
1536
+ visit(t, e, s) {
1537
+ let r = t.getVisitorParamsState().get("richTypes");
1538
+ if (!r) return void t.warn("RichValueFound but not type.");
1539
+ let o = t.getVisitorParamsState().get(K);
1540
+ o || (o = [], t.getVisitorParamsState().set(K, o));
1541
+ const i = e.childNodes, n = i.length;
1542
+ for (let l = 0; l < n; l++) {
1543
+ const a = i.item(l);
1544
+ if (a.nodeType === 1 && a.localName === "rv") {
1545
+ const c = r[a.getAttribute("s")], h = { type: c.type };
1546
+ this.processValues(t, a, h, c);
1547
+ const p = this.mapType(t, h);
1548
+ o.push(p);
1549
+ }
1550
+ }
1551
+ return s.richData = o, o;
1552
+ }
1553
+ mapType(t, e) {
1554
+ if (e.type === "_error") {
1555
+ const s = e.errorType;
1556
+ if (s) try {
1557
+ e = et.getBuiltInById(s + 1);
1558
+ } catch {
1559
+ }
1560
+ }
1561
+ return e;
1562
+ }
1563
+ processValues(t, e, s, r) {
1564
+ const o = e.childNodes, i = o.length;
1565
+ r.type;
1566
+ const n = r.keys;
1567
+ for (let l = 0; l < i; l++) {
1568
+ const a = o.item(l);
1569
+ if (a.nodeType === 1 && a.localName === "v") {
1570
+ const c = n[l];
1571
+ if (!c) return void t.warn("Invalid richData");
1572
+ const h = c[0], p = c[1];
1573
+ let g = a.textContent;
1574
+ p === "i" && (g = Number(g)), s[h] = g;
1575
+ }
1576
+ }
1577
+ }
1578
+ }
1579
+ class Rt {
1580
+ visit(t, e, s) {
1581
+ if (!e) return;
1582
+ const r = [];
1583
+ return this.processAuthors(t, t.evaluate("authors", e), r), r.length > 0 && (s.authors = r), s.comments = [], s;
1584
+ }
1585
+ processAuthors(t, e, s) {
1586
+ if (!e) return;
1587
+ const r = e.childNodes;
1588
+ for (let o = 0; o < r.length; o++) {
1589
+ const i = r.item(o);
1590
+ if (i.nodeType === 1 && i.localName === "author") {
1591
+ const n = i.firstChild;
1592
+ n && n.nodeType === 3 && s.push(n.textContent);
1593
+ }
1594
+ }
1595
+ }
1596
+ }
1597
+ class Et {
1598
+ visit(t, e, s) {
1599
+ if (!e) return;
1600
+ const r = {};
1601
+ 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;
1602
+ }
1603
+ }
1604
+ class Yt {
1605
+ visit(t, e, s) {
1606
+ if (!e) return;
1607
+ const r = [];
1608
+ return s.comments = r, r;
1609
+ }
1610
+ }
1611
+ class Dt {
1612
+ visit(t, e, s) {
1613
+ if (!e) return;
1614
+ const r = {};
1615
+ return t.copyFromAttribute(e, "id", r, "id", L), t.copyFromAttribute(e, "personId", r, "personId", L), t.copyFromAttribute(e, "ref", r), t.copyFromAttribute(e, "parentId", r, "parentId", L), t.copyFromAttribute(e, "dT", r), e.hasAttribute("done") && (r.done = f(e.getAttribute("done"))), s.push(r), r;
1616
+ }
1617
+ }
1618
+ class Mt {
1619
+ visit(t, e, s) {
1620
+ const r = [], o = e.childNodes;
1621
+ for (let i = 0; i < o.length; i++) {
1622
+ const n = o.item(i);
1623
+ if (n.nodeType === 1 && n.localName === "person") {
1624
+ const l = {};
1625
+ t.copyFromAttribute(n, "id", l, "id", L), t.copyFromAttribute(n, "displayName", l), t.copyFromAttribute(n, "userId", l, "userId", L), t.copyFromAttribute(n, "providerId", l), r.push(l);
1626
+ }
1627
+ }
1628
+ return r.length > 0 && (s.persons = r), r;
1629
+ }
1630
+ }
1631
+ const Ut = {};
1632
+ class zt {
1633
+ constructor(t, e) {
1634
+ this.path = t, this.visitor = e;
1635
+ }
1636
+ }
1637
+ class Xt {
1638
+ constructor() {
1639
+ 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 kt()), this.registerVisitor("twoCellAnchor", new E()), this.registerVisitor("oneCellAnchor", new E()), this.registerVisitor("absoluteAnchor", new E()), this.registerVisitor("graphicFrame", new xt()), this.registerVisitor("sp", new z()), this.registerVisitor("grpSp", new It()), this.registerVisitor("cxnSp", new Bt()), this.registerVisitor("pic", new Lt()), 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());
1640
+ }
1641
+ registerVisitor(t, e, s = null) {
1642
+ t.indexOf(":") === -1 && (t = "*:" + t);
1643
+ const r = t.split(":"), o = r.length > 1 ? r[1] : r[0];
1644
+ if (!s) return this.visitorsByXmlTagName.set(o, e), void this.visitorsByXmlTagName.set(t, e);
1645
+ let i = this.scopedVisitorsByXmlTagName.get(o);
1646
+ i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new zt(s, e));
1647
+ }
1648
+ getVisitorParamsState() {
1649
+ return this.visitorParamsState;
1650
+ }
1651
+ convert(t, e, s = Ut) {
1652
+ const r = t.documentElement;
1653
+ this.visitorParamsState && !s?.paramMap || (this.visitorParamsState = s?.paramMap ?? /* @__PURE__ */ new Map());
1654
+ const o = {};
1655
+ let i = this.visitorsByXmlTagName.get(r.nodeName);
1656
+ 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.`);
1657
+ const n = "/" + r.localName, l = new _(null, this, n, r, o, e, s), a = [];
1658
+ this._doWalk(i, l, a, r, o, e, s);
1659
+ for (let c = 0; c < a.length; c++) {
1660
+ const h = a[c];
1661
+ try {
1662
+ h.visitor?.afterVisit?.(h.context, h.elemParent, h.jsonParent);
1663
+ } catch (p) {
1664
+ console.warn(`Error in afterVisit: ${h.context.getPath()}`, p);
1665
+ }
1666
+ }
1667
+ return o;
1668
+ }
1669
+ _walkScoped(t, e, s, r, o, i, n) {
1670
+ const l = this.scopedVisitorsByXmlTagName.get(t);
1671
+ for (let a = 0; l && a < l.length; a++) {
1672
+ const c = l[a];
1673
+ let h = null;
1674
+ try {
1675
+ h = e.evaluate(c.path, r);
1676
+ } catch {
1677
+ console.warn(`"Invalid path '${c.path}' for '${t}'.`);
1678
+ }
1679
+ if (!h) continue;
1680
+ const p = (g) => {
1681
+ let d = g.localName, v = g.parentNode;
1682
+ for (; v && v !== r; ) d = v.localName + "/" + d, v = v.parentNode;
1683
+ const O = e.getPath() + "/" + d;
1684
+ if (c.visitor) {
1685
+ const B = new _(e, this, O, e.getElemRoot(), e.getJsonRoot(), i, n);
1686
+ this._doWalk(c.visitor, B, s, g, o, i, n);
1687
+ }
1688
+ };
1689
+ if (h.length > 0) {
1690
+ const g = h;
1691
+ for (let d = 0; d < g.length; d++) p(g.item(d));
1692
+ } else p(h);
1693
+ }
1694
+ }
1695
+ _doWalk(t, e, s, r, o, i, n) {
1696
+ let l = null;
1697
+ t && (s.push({ visitor: t, context: e, elemParent: r, jsonParent: o }), l = t.visit(e, r, o)), l || (l = o);
1698
+ const a = r.localName;
1699
+ this._walkScoped(a, e, s, r, l, i, n);
1700
+ const c = r.childNodes;
1701
+ for (let h = 0; h < c.length; h++) {
1702
+ const p = c.item(h);
1703
+ if (p.nodeType === 1) {
1704
+ 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);
1705
+ this._doWalk(v, B, s, g, l ?? o, i, n);
1706
+ }
1707
+ }
1708
+ return l;
1709
+ }
1710
+ }
1711
+ export {
1712
+ Xt as FromOOXMLConverter,
1713
+ Xt as default
1714
+ };