@sheetxl/studio-vanilla 0.4.12 → 0.4.13

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 (209) hide show
  1. package/browser/cjs/{BwN8vKi5o3-PbIMo.cjs → -DkdmW3XP1ICRY25.cjs} +2 -2
  2. package/browser/cjs/B-KQs1Bf48nEucW7.cjs +7 -0
  3. package/browser/cjs/B1xnY7pDnbnNzknG.cjs +7 -0
  4. package/browser/cjs/B6A5w_aWHkigBc6j.cjs +7 -0
  5. package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +110 -0
  6. package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +7 -0
  7. package/browser/cjs/{Q_VvA-yUQx3xFKiJ.cjs → BG2uV2RpxrfZyCuV.cjs} +1 -1
  8. package/browser/cjs/{BPzEQNENF-gEBkg9.cjs → BGCPG4Ip5ZijUQwi.cjs} +2 -2
  9. package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +7 -0
  10. package/browser/cjs/BLBNzBvRVl9VLynf.cjs +7 -0
  11. package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +7 -0
  12. package/browser/cjs/{hwDUzorB6aCvH1eL.cjs → BMaq_2S3IFrE5XeJ.cjs} +1 -1
  13. package/browser/cjs/BO7Pbclmywy-QCSV.cjs +13 -0
  14. package/browser/cjs/BPlthbyKkqCDjgxO.cjs +7 -0
  15. package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +7 -0
  16. package/browser/cjs/BdHdXCz_K1djQgI4.cjs +7 -0
  17. package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +7 -0
  18. package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +7 -0
  19. package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +7 -0
  20. package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +7 -0
  21. package/browser/cjs/BsSNzyN8kOGCKzso.cjs +7 -0
  22. package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +7 -0
  23. package/browser/cjs/{Ccs2ouvlLekaLGH0.cjs → BwHquG4sSd7OJjxz.cjs} +2 -2
  24. package/browser/cjs/{D_VQzwC1zzTJyKtG.cjs → BywNBbTVRYbgRbNI.cjs} +1 -1
  25. package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +7 -0
  26. package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +7 -0
  27. package/browser/cjs/{BeZHmOKfa37mFNAu.cjs → CBpt1PBR1VfBegko.cjs} +2 -2
  28. package/browser/cjs/CED8Az5C8GWF7pUT.cjs +7 -0
  29. package/browser/cjs/{JKEGlXjMwGnXk_Gv.cjs → CbD4Wa5QLTdRCYcz.cjs} +2 -2
  30. package/browser/cjs/{L1iE_VcelYZIy0wI.cjs → CbILz9Skl6lWf6yR.cjs} +1 -1
  31. package/browser/cjs/CoFQQqIzuvS9PM77.cjs +7 -0
  32. package/browser/cjs/{B35OZ0mE8aINQPP9.cjs → CpDNo2Lhwr5ZHECs.cjs} +2 -2
  33. package/browser/cjs/{C3OizZPVuxO2fjSG.cjs → CsamfGfFsItvSgo_.cjs} +1 -1
  34. package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +7 -0
  35. package/browser/cjs/CxLvGnG44-qNI36G.cjs +7 -0
  36. package/browser/cjs/D-xyWit7jxctQCpR.cjs +7 -0
  37. package/browser/cjs/D4XQsK7d7DRctaOO.cjs +7 -0
  38. package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +7 -0
  39. package/browser/cjs/DES2NmIRVZg-HXgs.cjs +7 -0
  40. package/browser/cjs/{CBL6KkiWI2RPflEN.cjs → DFxeLNhACFIHb0nv.cjs} +2 -2
  41. package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +7 -0
  42. package/browser/cjs/DJ6L43osbaMzEV5K.cjs +7 -0
  43. package/browser/cjs/DMjLN_HDktNzzUB8.cjs +7 -0
  44. package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +7 -0
  45. package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +7 -0
  46. package/browser/cjs/{DAHpsyykuPBkoh-Z.cjs → Dh_dFnagz7dMZlGh.cjs} +1 -1
  47. package/browser/cjs/DpF6vgGka2d-RKkb.cjs +10 -0
  48. package/browser/cjs/{BUokV6yuzE-_8MyK.cjs → DtY0Jzlwnr_YKnV4.cjs} +2 -2
  49. package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +7 -0
  50. package/browser/cjs/Dy5_viRzFls9rOzN.cjs +7 -0
  51. package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +7 -0
  52. package/browser/cjs/aN3KCqswA1SdJIMq.cjs +7 -0
  53. package/browser/cjs/{no5c2H18QD2qmOH6.cjs → hLJbgylpETByV4wc.cjs} +2 -2
  54. package/browser/cjs/index.cjs +2 -2
  55. package/browser/cjs/qumqKlVHFx89iLeu.cjs +7 -0
  56. package/browser/cjs/{fTGpiXzFm3K_u2Fm.cjs → rKZjTYQ0WpTriIv6.cjs} +2 -2
  57. package/browser/cjs/xjKotAOVt3JH36U7.cjs +7 -0
  58. package/browser/cjs/ymbPxio09Fw7I2BW.cjs +7 -0
  59. package/browser/esm/2P5dQT7wZToOh-n9.mjs +7 -0
  60. package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +110 -0
  61. package/browser/esm/7_x68v6PpvRDox_Z.mjs +7 -0
  62. package/browser/esm/9icgSuuzXq6mlgM8.mjs +7 -0
  63. package/browser/esm/B354iAatN9y9AIIP.mjs +7 -0
  64. package/browser/esm/B5EVyoxm3aSlAnxN.mjs +7 -0
  65. package/browser/esm/BD8rE7MUxuHXsdcf.mjs +7 -0
  66. package/browser/esm/BGFWI1a1PmU8_hCE.mjs +7 -0
  67. package/browser/esm/{Bts4nCgfCAUpTfxz.mjs → BI6JAQCQx1V0F2aC.mjs} +2 -2
  68. package/browser/esm/BIYg30d_9HaluFFz.mjs +7 -0
  69. package/browser/esm/{SAyRTPVprOHZ8Up8.mjs → BKL-uyBp_OE47lXd.mjs} +2 -2
  70. package/browser/esm/BMwJCtLAYUW8wExX.mjs +13 -0
  71. package/browser/esm/BNOfK-lGWF2S8vQE.mjs +7 -0
  72. package/browser/esm/Ba433v6lQUMtECiY.mjs +7 -0
  73. package/browser/esm/BbZWfDW2LUyjqUDy.mjs +7 -0
  74. package/browser/esm/C238uBmZN1XXqMUb.mjs +7 -0
  75. package/browser/esm/C34whwRkHO0lhq4-.mjs +7 -0
  76. package/browser/esm/C6FEpAqSZoW5Hgte.mjs +7 -0
  77. package/browser/esm/COlW5ULL29SUKN1Z.mjs +7 -0
  78. package/browser/esm/CRyxOj2xPj9qe9LK.mjs +7 -0
  79. package/browser/esm/CVeyOpbAhaBhDRye.mjs +7 -0
  80. package/browser/esm/CVyVvtlJuCTn4MDh.mjs +7 -0
  81. package/browser/esm/CapeIfjWq-_BHMlE.mjs +7 -0
  82. package/browser/esm/CcQqGNgK2CsgNtuD.mjs +7 -0
  83. package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +7 -0
  84. package/browser/esm/CdchvB_wAbv_6Whw.mjs +7 -0
  85. package/browser/esm/{D3KNxvnrwR6_fTJE.mjs → Cf8eDl3Tu5NAWWwG.mjs} +1 -1
  86. package/browser/esm/{B8ISUdOxsJMYWzNN.mjs → Cfq9tttQlsKvfaCr.mjs} +2 -2
  87. package/browser/esm/{M4hZ25330e96seUM.mjs → ClR6uLJoM-xKVYEc.mjs} +1 -1
  88. package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +7 -0
  89. package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +7 -0
  90. package/browser/esm/{DeXfOSxGE_Ez7DZq.mjs → CuV-bwi1vcXAqFUY.mjs} +1 -1
  91. package/browser/esm/CwVE0qelO_xgf-l1.mjs +7 -0
  92. package/browser/esm/{CYIhGb86r-kKOrP5.mjs → D1Dzlta8ZVy08ng6.mjs} +2 -2
  93. package/browser/esm/D1TjRQiHLWhpl-dl.mjs +7 -0
  94. package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +10 -0
  95. package/browser/esm/{dpdy0BU4GGI5lZrX.mjs → DTDXNEbHVnnZONNL.mjs} +1 -1
  96. package/browser/esm/DTWfi8Dl-c2s5moT.mjs +7 -0
  97. package/browser/esm/DYVBXcu1r5KRLB-1.mjs +7 -0
  98. package/browser/esm/{BnJiF38TGudjoHzT.mjs → DZjWyWMvr2XHQrBg.mjs} +1 -1
  99. package/browser/esm/DhHK4QmASvgAq9Xy.mjs +7 -0
  100. package/browser/esm/{DcX8yGEBX6qi9RCe.mjs → DoFV2S6Su86IN5Ul.mjs} +2 -2
  101. package/browser/esm/Dq3ybkgattcCsF_4.mjs +7 -0
  102. package/browser/esm/DqWoZ4TjweoJWX3o.mjs +7 -0
  103. package/browser/esm/DtXxHirBm16ldE1l.mjs +7 -0
  104. package/browser/esm/DtuWZG6c_8vKRSdr.mjs +7 -0
  105. package/browser/esm/FBG8XXdIMd9PfUIo.mjs +7 -0
  106. package/browser/esm/Nh7JiwvF01PblHQ0.mjs +7 -0
  107. package/browser/esm/PVYiH9vBQM6rqXI4.mjs +7 -0
  108. package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +7 -0
  109. package/browser/esm/XhQDWZu47oe6bwHh.mjs +7 -0
  110. package/browser/esm/_BjU6TtI-mQfFpfy.mjs +7 -0
  111. package/browser/esm/{DzgM_rkwyIHsCb6I.mjs → gOUfyCw957TzcbNB.mjs} +1 -1
  112. package/browser/esm/index.mjs +2 -2
  113. package/browser/esm/lmkbfs9sNc7f0oe5.mjs +7 -0
  114. package/browser/esm/{oLCocGFRAwsVsOSE.mjs → naa0kcRwxHEYGaQB.mjs} +2 -2
  115. package/browser/esm/qxOkQutRxmAi1vRh.mjs +7 -0
  116. package/browser/esm/tMSro0g2GM5BBTIH.mjs +7 -0
  117. package/cdn/assets/{B3kbBB6oxKBErwzn.js → 0e9wDKSn4SFxSmP5.js} +3 -3
  118. package/cdn/assets/0j_nQmV1Bb0lJ6sB.js +472 -0
  119. package/cdn/assets/2mxiQm6dELsqQoX7.js +5624 -0
  120. package/cdn/assets/5XdpCWQ6AcxZ6oY1.js +10 -0
  121. package/cdn/assets/6JtXguBKwGj6dqfy.js +1577 -0
  122. package/cdn/assets/{Bv0Xb6DdcQbPYJKo.js → 8U2WVdbZHYCBnd9L.js} +13 -14
  123. package/cdn/assets/9-cIcj6CRJx5HTn9.js +10 -0
  124. package/cdn/assets/{BcWoqhD_sX85c7Mh.js → B-kFRtzNNkf4_SiP.js} +1 -1
  125. package/cdn/assets/B1Iys8a964LGNZKf.js +10 -0
  126. package/cdn/assets/B2RAJJJFkcaWUfUW.js +21 -0
  127. package/cdn/assets/{DBL4jY0AVc53RGNm.js → BAzGoI9gE2G3F3on.js} +1 -1
  128. package/cdn/assets/BBJxLS-wB_nXRnI2.js +10 -0
  129. package/cdn/assets/{qA23x9VVBL9R4qxN.js → BDE7FUo2oiivrvBL.js} +14 -14
  130. package/cdn/assets/BL6TUDSeou6wPejW.js +10 -0
  131. package/cdn/assets/{CC-S4NMYhLg3WgqO.js → BLqaorJ5Wl-1YOoy.js} +2 -2
  132. package/cdn/assets/BMiA9p1uOrwnooVT.js +10 -0
  133. package/cdn/assets/{BoOefjrM4kZ-YXxa.js → BNh9nSR83reiVMKt.js} +2 -2
  134. package/cdn/assets/{BtweFYnoj_aEfydW.js → BQON-ToGsIBPrPkM.js} +1 -1
  135. package/cdn/assets/BUwNyHytF9St68tJ.js +10 -0
  136. package/cdn/assets/{D_5RgqgwXsoqLJDR.js → BVYDmdUGWvMG5gNK.js} +1 -1
  137. package/cdn/assets/B_2bXmyji3Dr7LRM.js +50224 -0
  138. package/cdn/assets/BciokME96sykArSM.js +10 -0
  139. package/cdn/assets/BgnlshX157Ob6RLs.js +21 -0
  140. package/cdn/assets/{dk2teWHDODYNarJY.js → BlYoycYtR-sUp0iC.js} +3 -3
  141. package/cdn/assets/{DfmaL8DmDaFAv8M_.js → Bsa9-Itkf_SdDBM9.js} +4 -4
  142. package/cdn/assets/BwpBFv8Ks2ka07ch.js +10 -0
  143. package/cdn/assets/BxblmHGC7YxZcuak.js +10 -0
  144. package/cdn/assets/C-Z8wvIy20kJ7R-k.js +10 -0
  145. package/cdn/assets/C3EFzvmp0DcC_HAx.js +10 -0
  146. package/cdn/assets/C4vStn7wNlvrxdsp.js +10 -0
  147. package/cdn/assets/C5q0qaKi2eeDgoO8.js +10 -0
  148. package/cdn/assets/C9eQW5GKgPRmKKgJ.js +29 -0
  149. package/cdn/assets/{BCK7yhx9JfzU2rF0.js → CHTspRZD2v_dU_eV.js} +9 -9
  150. package/cdn/assets/CKA4s2hlzSnrdWSD.js +10 -0
  151. package/cdn/assets/{BSAH88RG1oubICau.js → CMBDD1Mjde6UL5ep.js} +19 -19
  152. package/cdn/assets/{DDW1WJ2IM_9ZUfKm.js → CR01MBraUPYPpwy4.js} +2 -2
  153. package/cdn/assets/CT0d1P-Aav62lUvV.js +10 -0
  154. package/cdn/assets/CV8UjJPDVplXjK1E.js +49 -0
  155. package/cdn/assets/CrLrvmlJhYpNpXqR.js +10 -0
  156. package/cdn/assets/CsorxCiOoe7qX9j1.js +10 -0
  157. package/cdn/assets/CuNqTH3P8mCglRiz.js +10 -0
  158. package/cdn/assets/{MRBi3juXAW0lA_mj.js → CwdMjMPFdIs8SAV0.js} +1 -1
  159. package/cdn/assets/D-5VYBO5_VEh6fEW.js +24 -0
  160. package/cdn/assets/{BT5EcMEFBsphczwC.js → DD3csu4pddGtMp3n.js} +106 -107
  161. package/cdn/assets/{DWJE3K3jMKMTCi3o.js → DFHruAftzuzBZ71r.js} +2 -2
  162. package/cdn/assets/DHydjLSnijEgtpyU.js +10 -0
  163. package/cdn/assets/DPQqTIMsRLhMxPIy.js +820 -0
  164. package/cdn/assets/{CUc6gRjjRGTFWSHD.js → DUtu7r6CzW4dtW3E.js} +12 -12
  165. package/cdn/assets/{CiY3HumGDc_5bMtR.js → DXHirQMr483hJBil.js} +15 -15
  166. package/cdn/assets/DXtbonLk2ESfF4Dh.js +10 -0
  167. package/cdn/assets/{CsjftXmSYQRHNKdq.js → Dr5X-ng9wbwUWVr4.js} +4 -4
  168. package/cdn/assets/{BB66NDz7S3ocEfRB.js → DvFNLgeMJ9LdQROu.js} +46 -47
  169. package/cdn/assets/Dvj7UEckqOBrgs9i.js +3947 -0
  170. package/cdn/assets/F6zW9Vj410C4yRVG.js +424 -0
  171. package/cdn/assets/{DJQOS9qxVAlpgDMt.js → Gz4u4ewyWfB-Pf-a.js} +20 -21
  172. package/cdn/assets/KDGtuIzSpkf1vsmH.js +10 -0
  173. package/cdn/assets/KtKlo5mM4kTTfFgi.js +46 -0
  174. package/cdn/assets/N3pWBoccPrTedAw-.js +12 -0
  175. package/cdn/assets/{7_O6nILzn1fSVvkO.js → NTINjW8JjyZudT8s.js} +1 -1
  176. package/cdn/assets/{DxMu6URURFWj9aXM.js → R9RwlorPWfftoboH.js} +4 -4
  177. package/cdn/assets/{DgLPO_EQ9DYoGgec.js → Xwyp21e7L5fTeb_y.js} +1 -1
  178. package/cdn/assets/{CfObTzh8pGdd8D23.js → XysyS9rk9tFdbzZh.js} +5 -5
  179. package/cdn/assets/{DkS6quwH1okWaho6.js → f3_QXO8z0p-q4nJo.js} +14 -14
  180. package/cdn/assets/{phYz0vGgqIEQ2hco.js → quOP5QFyTT9soNIl.js} +1 -1
  181. package/cdn/index.js +2 -2
  182. package/cdn/loader.js +1 -1
  183. package/package.json +3 -5
  184. package/browser/cjs/BflJ_0gT9lQtDvY_.cjs +0 -7
  185. package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +0 -7
  186. package/browser/cjs/CTrEV_UpxC0W6cZZ.cjs +0 -7
  187. package/browser/cjs/CU30GVjjFXl44vEU.cjs +0 -7
  188. package/browser/cjs/CZWBxvUXzfpn_zmc.cjs +0 -7
  189. package/browser/cjs/Ce-8L4Viq3I_6j0i.cjs +0 -7
  190. package/browser/cjs/CtNjLzIHB8WX63Bl.cjs +0 -7
  191. package/browser/cjs/DJbKKxeeTEHHA1gR.cjs +0 -107
  192. package/browser/cjs/GrsZZ_mEdsM5dEMA.cjs +0 -7
  193. package/browser/esm/B4Mm5gczpI_k2zzN.mjs +0 -7
  194. package/browser/esm/C3cyAbIH8Qc8MIFN.mjs +0 -107
  195. package/browser/esm/C4jlaVv8bELgiHyE.mjs +0 -7
  196. package/browser/esm/CcpskguvlvemArQn.mjs +0 -7
  197. package/browser/esm/CeRfALx1iU5fqOUg.mjs +0 -7
  198. package/browser/esm/CfYWmP_Hots5f0f6.mjs +0 -7
  199. package/browser/esm/CkarbqNx_lhlBnw7.mjs +0 -7
  200. package/browser/esm/D2PlWNQjrTgf6GuR.mjs +0 -7
  201. package/browser/esm/DIJyH94oCzUnlcNZ.mjs +0 -7
  202. package/browser/esm/DVAG1NxFe3cMjLE1.mjs +0 -7
  203. package/browser/esm/DVqga7g7j0FUiM6p.mjs +0 -7
  204. package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +0 -7
  205. package/browser/esm/_ft7JYO6QdDbIu3d.mjs +0 -7
  206. package/cdn/assets/CJhyHcQcrhbtC33r.js +0 -50
  207. package/cdn/assets/CpPLN0-hDsTIFHZV.js +0 -46
  208. package/cdn/assets/Cq94woVmlxhjWVRI.js +0 -21
  209. package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +0 -26490
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./DJbKKxeeTEHHA1gR.cjs"),e=require("./Ce-8L4Viq3I_6j0i.cjs"),s=require("@sheetxl/sdk");class r{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const o=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,i=t=>{const e=parseInt(t);return isNaN(e)?null:e},n=t=>{const e=parseFloat(t);return isNaN(e)?null:e},l=new Map;class a{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);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)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??l}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const o=t.split("/");for(let t=0;t<o.length;t++){const e=o[t];if(""===e||"."===e)continue;let r=[];for(let t=0;t<s.length;t++){const o=s[t],i=o.childNodes;for(let t=0;i&&t<i.length;t++){const s=o.childNodes[t];s.localName!==e&&"*"!==e||r.push(s)}}s=r}return 1===s.length?s[0]:0===s.length?null:new r(s)}getFromPath(e,s){return t._n.getFromPath(e,s)}setToPath(e,s,r){return t._n.setToPath(e,s,r)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return o}get INT_COPY(){return i}get FLOAT_COPY(){return n}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class c{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class u{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const h=(s,r)=>{if(s||!s.hasAttribute("rot"))return;const o=s.getAttribute("rot"),i=t._n.roundAccurately(e.p(o),2);-1e3!==i&&(r.rotation=i)},p=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},g=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},d=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},m=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class b{visit(t,e,s){return g(t,e,s,"roundedCorners","roundedCorners"),d(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class A{visit(t,e,s){return g(t,e,s,"plotVisOnly","plotVisOnly"),p(t,e,s,"dispBlanksAs","dispBlanksAs"),g(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),g(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class f{visit(t,e,s){let r={};return s.plotArea=r,r}}class y{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class v{visit(t,e,s){}processStroke(t,s,r){const o={},i=t.evaluate("ln",s);if(i){i.hasAttribute("algn")&&(o.align=y.fromOoxmlAlignment(i.getAttribute("algn"))),i.hasAttribute("cap")&&(o.lineCap=y.fromOoxmlLineCap(i.getAttribute("cap"))),i.hasAttribute("cmpd")&&(o.compound=y.fromOoxmlCompound(i.getAttribute("cmpd"))),i.hasAttribute("w")&&(o.width=e.t(i.getAttribute("w")));const s=t.evaluate("miter",i);s&&(o.lineJoin="miter",s.hasAttribute("lim")&&(o.miter=parseFloat(s.getAttribute("lim")))),t.evaluate("bevel",i)&&(o.lineJoin="bevel"),t.evaluate("round",i)&&(o.lineJoin="round");const n=t.evaluate("custDash",i);if(n){const s=t.evaluate("ds",n);if(s&&s.length>0){let t="";for(let r=0;r<s.length;r++){const o=s.item(r);t+=e.a(o.getAttribute("d"))+","+e.a(o.getAttribute("sp"))}o.dash=t}}const l=t.evaluate("prstDash",i);l&&l.hasAttribute("val")&&(o.dash=l.getAttribute("val")),this.parseEndElement(t,i,o,"headEnd","head"),this.parseEndElement(t,i,o,"tailEnd","tail");const a=this.processFill(t,i,r);o.fill=a}return o}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,s,r){const o={};if(t.evaluate("noFill",s))return o.none=!0,o;const i=t.evaluate("solidFill",s);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",s);if(n){n.hasAttribute("rotWithShape")&&(o.isRotated="1"===n.getAttribute("rotWithShape"));const e=this.processGradFill(t,n);return o.gradient=e,o}const l=t.evaluate("pattFill",s);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",s);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=e.b(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const s=this.processImageFill(t,a);return o.image=s,o}return o.none=!0,o}processGradFill(t,s){const r={},o=t.evaluate("lin",s);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=e.p(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=e.b(o.getAttribute("scaled"));r.scaled=t}}const i={};s.hasAttribute("flip")&&(i.mirror=s.getAttribute("flip")),Object.keys(i).length>0&&(r.tile=i);const n=t.evaluate("path",s);if(n){n.hasAttribute("path")&&(r.type=y.fromOoxmlGradientType(n.getAttribute("path")));const e=t.evaluate("fillToRect",n);e&&(r.fillTo=this.getRect(e))}const l=t.evaluate("tileRect",s);l&&(r.tile.bounds=this.getRect(l));const a=[],c=t.evaluate("gsLst/gs",s);for(let s=0;c&&s<c.length;s++){const r=c.item(s),o={offset:e.a(r.getAttribute("pos")),color:this.processAdjColor(t,r)};a.push(o)}return a.length>0&&(r.stops=a),r}getRect(t){const s={};return t.hasAttribute("t")&&(s.t=e.a(t.getAttribute("t"))),t.hasAttribute("l")&&(s.l=e.a(t.getAttribute("l"))),t.hasAttribute("b")&&(s.b=e.a(t.getAttribute("b"))),t.hasAttribute("r")&&(s.r=e.a(t.getAttribute("r"))),0===Object.keys(s).length?null:s}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,s){let r="lrgba("+e.a(s.getAttribute("r"))+","+e.a(s.getAttribute("g"))+","+e.a(s.getAttribute("b"))+")";return r+=this.processAdjustments(t,s),r}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,s){let r="hsl("+e.p(s.getAttribute("hue"))+","+e.a(s.getAttribute("sat"))+","+e.a(s.getAttribute("lum"))+")";return r+=this.processAdjustments(t,s),r}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class F extends v{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){h(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e.c(i.getAttribute("x"))??0,s.y=e.c(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e.c(n.getAttribute("cx"))??0,s.height=e.c(n.getAttribute("cy"))??0),r.bounds=s}const i=t.evaluate("prstGeom",s);i?.hasAttribute("prst")?r.geometry=i?.getAttribute("prst"):t.evaluate("customGeom",s)&&console.warn("customGeom not supported yet");const n=this.processFill(t,s,r);n&&Object.keys(n).length>0&&(r.fill=n);const l=this.processStroke(t,s,r);return l&&Object.keys(l).length>0&&(r.stroke=l),r}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class C{visit(t,e,s){let r={};if(p(t,e,r,"grouping","grouping"),g(t,e,r,"varyColors","varyColors"),m(t,e,r,"gapWidth","gapWidth",.01),m(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),d(t,e,r,"bubbleScale","bubbleScale"),g(t,e,r,"showNegBubbles","showNegativeBubbleValues"),g(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),d(t,e,r,"firstSliceAng","startAngle"),d(t,e,r,"holeSize","holeSize"),p(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class w extends C{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class P{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(g(t,e,r,"showBubbleSize","showBubbleSize"),g(t,e,r,"showCatName","showCatName"),g(t,e,r,"showLeaderLines","showLeaderLines"),g(t,e,r,"showPercent","showPercentage"),g(t,e,r,"showSerName","showSerName"),g(t,e,r,"showVal","showVal"),g(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),p(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const N=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class O{visit(t,e,s){const r={};d(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),d(t,e,r,"idx","idx"),g(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){N(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class T{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),g(t,e,i,"bubble3D","bubble3D"),d(t,e,i,"explosion","explosion"),N(t,e,i),i}}class S{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class V{visit(t,e,s){let r={};this.parseScaling(t,e,r),m(t,e,r,"majorUnit","majorUnits"),m(t,e,r,"minorUnit","minorUnits"),g(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),p(t,e,r,"majorTickMark","majorTickMarks"),p(t,e,r,"minorTickMark","minorTickMarks"),p(t,e,r,"crosses","crosses"),m(t,e,r,"crossesAt","crosses"),p(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),d(t,e,r,"lblOffset","labelOffset"),p(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,d(t,e,r,"tickMarkSkip","tickMarkSkip"),d(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"),p(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),m(t,e,s,"scaling/max","max"),m(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class x{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new F).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&h(a,s)}parseTextProperties(t,e,r){if(!e)return;e.hasAttribute("sz")&&(r.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(r.weight="1"===e.getAttribute("b")?700:400),e.hasAttribute("i")&&(r.italic="1"===e.getAttribute("i")),e.hasAttribute("u")&&(r.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(r.strike=e.getAttribute("strike"));const o=t.evaluate("latin",e);if(o&&!o.getAttribute("typeface").startsWith("+")){const t=r.font??{};if(o.hasAttribute("typeface")&&(t.family=o.getAttribute("typeface")),o.hasAttribute("panose")){const e=o.getAttribute("panose");e&&(t.fallbacks=[s.IFont.getPanoseFallback(e)])}o.hasAttribute("pitchFamily")&&(t.pitch=o.getAttribute("pitchFamily")),o.hasAttribute("charset")&&(t.charset=o.getAttribute("charset")),Object.keys(t).length>0&&(r.font=t)}}}class k{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class I{visit(t,e,s){const r={};return g(t,e,r,"overlay","overlay"),p(t,e,r,"legendPos","position"),s.legend=r,r}}class L extends F{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class B extends x{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};g(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class _{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};m(t,r,e,"x","x"),m(t,r,e,"y","y"),m(t,r,e,"w","w"),m(t,r,e,"h","h"),p(t,r,e,"xMode","xMode"),p(t,r,e,"yMode","yMode"),p(t,r,e,"wMode","wMode"),p(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class j{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class R extends v{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class E{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,r){if(!e)return;const o=t.evaluate("latin",e);if(!o)return;const i=o.getAttribute("typeface");i&&(r.family=i);const n=o.getAttribute("panose");return n&&(r.fallbacks=[s.IFont.getPanoseFallback(n)]),r}}class Y{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}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}}class D{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const r={type:s.IAutoFilter.Type.Color};return t.copyFromAttribute(e,"cellColor",r,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",r,"styleId",t.INT_COPY),r}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const r={type:s.IAutoFilter.Type.Custom};t.copyFromAttribute(e,"and",r,"and",t.BOOLEAN_COPY);const o=e.childNodes;r.filters=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1!==s.nodeType)continue;let i=null;"customFilter"===s.localName&&(i=this.processCustomFilter(t,s)),i&&r.filters.push(i)}return r}processDynamicFilter(t,e){const r={type:s.IAutoFilter.Type.Dynamic};return t.copyFromAttribute(e,"type",r,"dynamicType"),t.copyFromAttribute(e,"val",r,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",r,"maxVal",t.INT_COPY),r}processDateGroupItem(t,e){const s={};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}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const r={type:s.IAutoFilter.Type.Items};t.copyFromAttribute(e,"blank",r,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",r,"calendarType");let o=[],i=[];const n=e.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&o.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&i.push(e)}}return o.length>0&&(r.dateGroups=o),i.length>0&&(r.items=i),r}processIcon(t,e){const r={type:s.IAutoFilter.Type.Icon};return t.copyFromAttribute(e,"iconId",r,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",r),r}processTop10(t,e){const r={type:s.IAutoFilter.Type.Top10};return t.copyFromAttribute(e,"filterVal",r,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",r,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",r,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",r,"val",t.FLOAT_COPY),r}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,s){if(!s)return null;const r={};if(!s.hasAttribute("colId"))return;r.offset=parseInt(s.getAttribute("colId"));let o=!1;return s.hasAttribute("hiddenButton")&&(o=e.b(s.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),s.hasAttribute("showButton")&&(r.showButton=e.b(s.getAttribute("showButton"))),this.processFilterCriteria(t,s,r),r}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class M{visit(t,r,o){if(!r)return;const i={};if(t.copyFromAttribute(r,"ref",i),r.hasAttribute("caseSensitive")){const t=e.b(r.getAttribute("caseSensitive"));i.collatorOptions=t?s.Sort.CaseSensitiveOptions:s.Sort.CaseInsensitiveOptions}const n=r.getAttribute("sortMethod");null!=n&&"none"!==n&&("stroke"===n?i.collatorOptions={...i.collatorOptions,collation:"stroke"}:"pinYin"===n&&(i.collatorOptions={...i.collatorOptions,collation:"pinyin"})),r.hasAttribute("columnSort")&&e.b(r.getAttribute("columnSort"))&&(i.orientation=s.IRange.Orientation.Column);const l=s.AddressUtils.fastStringToRange(i.ref);return this.processSortConditions(t,r,i,l),Object.keys(i).length>0&&(o.sort=i),i}processSortCondition(t,r,o){if(!r)return null;const i={};if(r.hasAttribute("ref")){if(r.hasAttribute("ref")){const t=r.getAttribute("ref"),e=s.AddressUtils.fastStringToRange(t);i.offset=o?e.colStart-o.colStart:e.colStart}return i.reverse=!1,r.hasAttribute("descending")&&(i.reverse=e.b(r.getAttribute("descending"))),t.copyFromAttribute(r,"sortBy",i,"sortOn"),t.copyFromAttribute(r,"dxfId",i),t.copyFromAttribute(r,"iconSet",i),t.copyFromAttribute(r,"customList",i),i}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class U{visit(t,e,s){}processDataBarColor(t,s,r,o,i="dk1"){if(!s)return;const n=e.d(t=>s.getAttribute(t),i);return n&&(r[o]=n),r}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(t,e,r){t.getValAttrAsBoolean("b",e,!0)&&(r.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(r.style=s.IFont.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(r.strike=!0);const o=t.evaluate("u",e);if(o){const t=o.getAttribute("val");r.underline=t||s.IFont.UnderlineStyle.Single}p(t,e,r,"vertAlign","verticalAlign"),"superscript"===r.verticalAlign?r.verticalAlign=s.IFont.VerticalAlignment.Super:"subscript"===r.verticalAlign&&(r.verticalAlign=s.IFont.VerticalAlignment.Sub),m(t,e,r,"sz","size");const i=t.evaluate("color",e);this.processDataBarColor(t,i,r,"fill"),r.fill||(r.fill="dk1"),p(t,e,r,"name","family"),p(t,e,r,"rFont","family");const n=t.evaluate("family",e);if(n){const t=n.getAttribute("val");if(t)switch(t){case"1":r.fallbacks=["serif"];break;case"2":r.fallbacks=["sans-serif"];break;case"3":r.fallbacks=["monospace"];break;case"4":r.fallbacks=["cursive"];break;case"5":r.fallbacks=["fantasy"]}}return p(t,e,r,"scheme","scheme"),g(t,e,r,"shadow","shadow",!0),g(t,e,r,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(r.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(r.letterSpacing=1),p(t,e,r,"charset","charset"),r}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(t,e,r,o){const i={type:s.IFill.Type.None},n=e.childNodes;let l=!1;for(let e=0;!l&&e<n.length;e++){const s=n.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,i),l=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,i),l=!0))}return r[o]=i,r}processGradientFill(t,e,r){if(!e)return;r.type=s.IFill.Type.Gradient;const o=[];r.stops=o,r.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const i=e.getAttribute("type");i&&(r.gradientType=i);const n=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(r.fillTo={left:n(e.getAttribute("left")),top:n(e.getAttribute("top")),right:n(e.getAttribute("right")),bottom:n(e.getAttribute("bottom"))});const l=e.childNodes;for(let e=0;e<l.length;e++){const s=l.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};o.push(e);const r=parseFloat(s.getAttribute("position"));e.offset=r;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return r}processPatternFill(t,e,r){if(!e)return;const o=t.getVisitorParamsState().get("processingDXFs"),i=e.getAttribute("patternType")||(o?s.IFill.BuiltInSheetPattern.Solid:s.IFill.BuiltInSheetPattern.None);if(i===s.IFill.BuiltInSheetPattern.None)return{none:!0};r.type=s.IFill.Type.Pattern,i&&(r.patternType=i);let n,l="foreground",a="background";const c=r.patternType===s.IFill.BuiltInSheetPattern.Solid&&o;if(c){n="lt1";const t=l;l=a,a=t}const u=t.evaluate("fgColor",e);this.processDataBarColor(t,u,r,l,n);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,r,a,n),c&&!r.foreground&&(r.foreground=n),r}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(t,e,r,o,i){if(!e)return;const n={};return this.processBorderStroke(t,e,n,s.IBorder.Edge.Left),this.processBorderStroke(t,e,n,s.IBorder.Edge.Right),i?(n.right||n.left)&&(n.right?n.vertical={...n.right}:n.vertical={...n.left}):this.processBorderStroke(t,e,n,s.IBorder.Edge.Vertical),this.processBorderStroke(t,e,n,s.IBorder.Edge.Top),this.processBorderStroke(t,e,n,s.IBorder.Edge.Bottom),i?(n.bottom||n.top)&&(n.right?n.horizontal={...n.bottom}:n.horizontal={...n.top}):this.processBorderStroke(t,e,n,s.IBorder.Edge.Horizontal),r[o]=n,r}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class z extends U{visit(t,e,r){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const o={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),o.fonts),this.processFills(t,t.evaluate("fills",e),o.fills),this.processBorders(t,t.evaluate("borders",e),o.borders,!0),o.fills[0]={type:s.IFill.Type.None},o.fills[1]={type:s.IFill.Type.Pattern,patternType:s.IFill.BuiltInSheetPattern.Gray125},o.borders[0]={};const i=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),i,o,null,!1);const n=new Map;if(i.length>0){const s=[];this.processCellStyles(t,t.evaluate("cellStyles",e),s,i,n),r.named=s}const l=[];this.processXFs(t,t.evaluate("cellXfs",e),l,o,n),Object.keys(l).length>0&&(r.direct=l);const a=[];return this.processDXFs(t,t.evaluate("dxfs",e),a),this.processTableStyles(t,t.evaluate("tableStyles",e),r,a),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),r),this.processMruColors(t,t.evaluate("colors/mruColors",e),r),r}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(t,r,o,i,n,l){if(!r)return;const a=r.getAttribute("xfId");if(a&&n){const t=n.get(parseInt(a));t&&t!==s.IStyle.BuiltInName.Normal&&(o.named=t)}const c=t=>!(!l&&r.hasAttribute(t))||e.b(r.getAttribute("applyFont"));if(c("applyFont")){const t=i.fonts[r.getAttribute("fontId")];t&&(o.font=t)}if(c("applyFill")){const t=i.fills[r.getAttribute("fillId")];t&&Object.keys(t).length>0&&(o.fill=t)}if(c("applyBorder")){const t=i.borders[r.getAttribute("borderId")];t&&Object.keys(t).length>0&&(o.border=t)}if(c("applyNumberFormat")){const e=r.getAttribute("numFmtId");if(e){const s=parseInt(e);let r;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(r=t.get(s)),o.numberFormat=r??s}else console.warn("no visitor params state")}}c("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",r),o),c("applyProtection")&&this.processProtection(t,t.evaluate("protection",r),o);const u=e.b(r.getAttribute("quotePrefix"));u&&(o.quotePrefix=u)}processAlignment(t,r,o){const i={};if(r?.hasAttribute("horizontal")?i.horizontal=r.getAttribute("horizontal"):i.horizontal=s.ITextFrame.HorizontalAlignment.General,r?.hasAttribute("vertical")?i.vertical=r.getAttribute("vertical"):i.vertical=s.ITextFrame.VerticalAlignment.Bottom,r?.hasAttribute("indent")?i.indent=parseInt(r.getAttribute("indent")):i.indent=0,r?.hasAttribute("relativeIndent")?i.relativeIndent=parseInt(r.getAttribute("relativeIndent")):i.relativeIndent=0,e.b(r?.getAttribute("wrapText"))?i.overflow=s.ITextFrame.Overflow.Wrap:i.overflow=s.ITextFrame.Overflow.Visible,e.b(r?.getAttribute("shrinkToFit"))&&(i.overflow=s.ITextFrame.Overflow.Shrink),r?.hasAttribute("textRotation")){let t=parseFloat(r.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,i.stacked=!0),i.rotation=t}else i.rotation=0;r?.hasAttribute("justifyLastLine")&&(i.justifyLastLine=e.b(r.getAttribute("justifyLastLine")));const n=r?.getAttribute("readingOrder");return n&&("0"===n?i.readingDirection=s.ITextFrame.ReadingDirection.Auto:"1"===n?i.readingDirection=s.ITextFrame.ReadingDirection.LeftToRight:"2"===n?i.readingDirection=s.ITextFrame.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${n}`)),Object.keys(i).length>0&&(o.alignment=i),o}processProtection(t,s,r){if(!s)return;const o={},i=s.getAttribute("locked");i&&!e.b(i)&&(o.edit=!0);const n=s.getAttribute("hidden");return n&&e.b(n)&&(o.formulaHidden=!0),Object.keys(o).length>0&&(r.protection=o),r}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,s,r,o,i=!1){const n=s.getAttribute("name"),l={name:n};s.hasAttribute("table")&&(l.table=e.b(s.getAttribute("table"))),s.hasAttribute("pivot")&&(l.pivot=e.b(s.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=s.childNodes;for(let t=0;t<a.length;t++){const e=a.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let r=o?.[s];r||(console.warn("invalid dfx id",s),r={}),l[t]=r;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(r.size=i)}}delete l.name,r[n]=l}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,s,r,o,i){if(!s)return;const n=s.childNodes;for(let t=0;t<n.length;t++){const s=n.item(t);if(1===s.nodeType&&"cellStyle"===s.localName){const t=parseInt(s.getAttribute("xfId")),n=s.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};s.getAttribute("hidden")&&(l.hidden=e.b(s.getAttribute("hidden"))),s.getAttribute("iLevel")&&(l.iLevel=parseInt(s.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class G extends U{visit(t,e,s){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}processPassword(t,e,s,r="password"){if(!e)return;const o={};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)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);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}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+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,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(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")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}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)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class W{visit(t,e,s){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}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class X{visit(t,e,s){return s}}class ${visit(t,e,s){if(!e)return;const r={};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}processOffsetCoord(t,s,r,o){if(!s)return;const i={c:0,r:0,x:0,y:0};return t.evaluate("col",s)&&(i.c=parseInt(t.evaluate("col",s).textContent)),t.evaluate("row",s)&&(i.r=parseInt(t.evaluate("row",s).textContent)),t.evaluate("colOff",s)&&(i.x=e.c(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e.c(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class K{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);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}}class H extends K{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class q extends K{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class J extends K{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class Q extends q{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class Z extends q{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const tt="richTypes";class et{visit(t,e,s){let r=t.getVisitorParamsState().get(tt);r||(r=[],t.getVisitorParamsState().set(tt,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const st="richData";class rt{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(st);o||(o=[],t.getVisitorParamsState().set(st,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(t,e){if("_error"===e.type){const r=e.errorType;if(r)try{e=s.FormulaError.getBuiltInById(r+1)}catch(t){}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class ot{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class it{visit(t,e,s){if(!e)return;const r={};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}}class nt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class lt{visit(t,s,r){if(!s)return;const o={};return t.copyFromAttribute(s,"id",o,"id",e.r),t.copyFromAttribute(s,"personId",o,"personId",e.r),t.copyFromAttribute(s,"ref",o),t.copyFromAttribute(s,"parentId",o,"parentId",e.r),t.copyFromAttribute(s,"dT",o),s.hasAttribute("done")&&(o.done=e.b(s.getAttribute("done"))),r.push(o),o}}class at{visit(t,s,r){const o=[],i=s.childNodes;for(let s=0;s<i.length;s++){const r=i.item(s);if(1===r.nodeType&&"person"===r.localName){const s={};t.copyFromAttribute(r,"id",s,"id",e.r),t.copyFromAttribute(r,"displayName",s),t.copyFromAttribute(r,"userId",s,"userId",e.r),t.copyFromAttribute(r,"providerId",s),o.push(s)}}return o.length>0&&(r.persons=o),o}}const ct={};class ut{constructor(t,e){this.path=t,this.visitor=e}}class ht{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new u),this.registerVisitor("spPr",new F),this.registerVisitor("txBody",new x),this.registerVisitor("txPr",new x),this.registerVisitor("c:chartSpace",new b),this.registerVisitor("c:chartSpace",new A,"chart"),this.registerVisitor("c:plotArea",new f),this.registerVisitor("c:barChart",new w),this.registerVisitor("c:doughnutChart",new C),this.registerVisitor("c:lineChart",new C),this.registerVisitor("c:ofPieType",new C),this.registerVisitor("c:pieChart",new C),this.registerVisitor("c:scatterChart",new C),this.registerVisitor("c:barChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new P("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new O),this.registerVisitor("c:dPt",new T),this.registerVisitor("c:marker",new S),this.registerVisitor("c:catAx",new V),this.registerVisitor("c:valAx",new V),this.registerVisitor("c:dateAx",new V),this.registerVisitor("c:majorGridlines",new c("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new c("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new x("labels.text"),"txPr"),this.registerVisitor("c:valAx",new x("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new x("labels.text"),"txPr"),this.registerVisitor("c:legend",new I),this.registerVisitor("c:legend",new x("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new k),this.registerVisitor("c:ser",new L,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new P("labels"),"dLbls"),this.registerVisitor("c:dLbl",new P("points")),this.registerVisitor("c:title",new B),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new _),this.registerVisitor("c:dispUnits",new c("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new B("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new x,"tx/rich"),this.registerVisitor("a:theme",new j),this.registerVisitor("a:theme",new R,"themeElements/clrScheme"),this.registerVisitor("a:theme",new E,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new D),this.registerVisitor("sortState",new M),this.registerVisitor("s:workbook",new G),this.registerVisitor("styleSheet",new z),this.registerVisitor("table",new W),this.registerVisitor("hlinkClick",new Y),this.registerVisitor("wsDr",new X),this.registerVisitor("twoCellAnchor",new $),this.registerVisitor("oneCellAnchor",new $),this.registerVisitor("absoluteAnchor",new $),this.registerVisitor("graphicFrame",new H),this.registerVisitor("sp",new q),this.registerVisitor("grpSp",new Q),this.registerVisitor("cxnSp",new Z),this.registerVisitor("pic",new J),this.registerVisitor("rvStructures",new et),this.registerVisitor("rvData",new rt),this.registerVisitor("comments",new ot),this.registerVisitor("commentList",new it,"comment"),this.registerVisitor("comment",new x("content"),"text"),this.registerVisitor("ThreadedComments",new nt),this.registerVisitor("threadedComment",new lt),this.registerVisitor("threadedComment",new x("content"),"text"),this.registerVisitor("personList",new at)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new ut(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=ct){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);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.`);const n="/"+r.localName,l=new a(null,this,n,r,o,e,s),c=[];this._doWalk(i,l,c,r,o,e,s);for(let e=0;e<c.length;e++){const s=c[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let c=0;l&&c<l.length;c++){const u=l[c];let h=null;try{h=e.evaluate(u.path,r)}catch(e){console.warn(`"Invalid path '${u.path}' for '${t}'.`)}if(!h)continue;const p=t=>{let l=t.localName,c=t.parentNode;for(;c&&c!==r;)l=c.localName+"/"+l,c=c.parentNode;const h=e.getPath()+"/"+l;if(u.visitor){const r=new a(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u.visitor,r,s,t,o,i,n)}};if(h.length>0){const t=h;for(let e=0;e<t.length;e++)p(t.item(e))}else p(h)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const c=r.localName;this._walkScoped(c,e,s,r,l,i,n);const u=r.childNodes;for(let t=0;t<u.length;t++){const r=u.item(t);if(1===r.nodeType){const t=r,c=t.localName,u=this.visitorsByXmlTagName.get(c),h=e.getPath()+"/"+c,p=new a(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u,p,s,t,l??o,i,n)}}return l}}exports.FromOOXMLConverter=ht,exports.default=ht;