@sheetxl/mcp 0.0.0-stage → 0.8.0-beta.15

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 (509) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +72 -2
  3. package/agent/instructions.md +66 -0
  4. package/assets/9U9XCqqdn-q3i2fj.js +123 -0
  5. package/assets/B-MqXm_7luDLwazY.js +596 -0
  6. package/assets/B2Ek-DWpZMGJ0V1Z.js +18 -0
  7. package/assets/B2udpZ-uIaql3AUh.js +104 -0
  8. package/assets/B4VnJacrzr1x4PHR.js +402 -0
  9. package/assets/B5lHOOQ_rkP4Mi2r.js +638 -0
  10. package/assets/B7gUyrfLln3TiyKM.js +14 -0
  11. package/assets/B9US2ZrF93KOjmAx.js +22 -0
  12. package/assets/BBb_3gEGzmEzbTIk.js +359 -0
  13. package/assets/BCy1zP97fsiIcvj6.js +18 -0
  14. package/assets/BFXeoFUbuc4IKTz9.js +28 -0
  15. package/assets/BFdeov2e_xUQPEY_.js +202 -0
  16. package/assets/BG5kgbDRXMc0re6W.js +242 -0
  17. package/assets/BJxfinOazQqqByc-.js +105 -0
  18. package/assets/BOPsJmq7v7HOKUkO.js +32 -0
  19. package/assets/BPwmBu_aouERJjiW.js +45 -0
  20. package/assets/BQMDOjNBMjAx9WiW.js +3011 -0
  21. package/assets/BQbF1RkUH8WyXqSD.js +780 -0
  22. package/assets/BRzp6DEIYUgM3NkN.js +369 -0
  23. package/assets/BSxTn2BhkEEeF9x_.js +2346 -0
  24. package/assets/BTQhJQ3e0hsiousD.js +28 -0
  25. package/assets/BZPTaa0WjpoUAbgZ.js +35 -0
  26. package/assets/BbAmA46MhQSu3ZF_.js +119 -0
  27. package/assets/BbcUxIZe3YXywsQR.js +28 -0
  28. package/assets/BeLr36oL3jmeXFFi.js +58 -0
  29. package/assets/Bg95xYj5siqhHVEz.js +594 -0
  30. package/assets/Bh0PNKlrR4VAqnP8.js +60500 -0
  31. package/assets/BjqQjxBuoXza8oqg.js +362 -0
  32. package/assets/BlPubAFi7DY7VrAo.js +33 -0
  33. package/assets/BleMG0hAQgjE8fTa.js +7 -0
  34. package/assets/Bn8D2bebQ2tFfwQt.js +310 -0
  35. package/assets/BrcQmHcE7Hcr1erJ.js +24 -0
  36. package/assets/BsQZI1vXTRE63Zy-.js +2368 -0
  37. package/assets/BtjqpAKczftx91BQ.js +96 -0
  38. package/assets/Btys7KwtvV3hz2F6.js +656 -0
  39. package/assets/BuUEsifnQALe49uk.js +857 -0
  40. package/assets/By-7OWXShMlFFejV.js +119 -0
  41. package/assets/C0CiMKC3lWK1z9p5.js +449 -0
  42. package/assets/C2OrZ8LZ-TI6eYG0.js +22 -0
  43. package/assets/C4z2IilWTuu2TWXw.js +3917 -0
  44. package/assets/C7ONfuYIWRmDu_vs.js +319 -0
  45. package/assets/C7Z1li2XjWi6bkrp.js +1556 -0
  46. package/assets/C97xDe_wBbLZh_uW.js +35 -0
  47. package/assets/CGBGyaCGdlZFQYK0.js +447 -0
  48. package/assets/CJ5WQnaoCsdr5gf4.js +1783 -0
  49. package/assets/CMK6tIDVqYYvK4GZ.js +55 -0
  50. package/assets/CMWAsUQ66V8fYrME.js +223 -0
  51. package/assets/CNz3LdmvsOEJoLO9.js +12 -0
  52. package/assets/CWVWdbY1B1-WLl9k.js +199 -0
  53. package/assets/CWl6oHiJxkNKRixk.js +17 -0
  54. package/assets/CXHslDxkWCuEcCSQ.js +13 -0
  55. package/assets/CZTSZL3T_f-vSXqM.js +7 -0
  56. package/assets/CduNzsdbTigxH-ZK.js +5220 -0
  57. package/assets/CecTe22WURiXbVdY.js +2260 -0
  58. package/assets/Cf2dcwmmmf13Rywg.js +146 -0
  59. package/assets/Cf9LpgZz-W5blzy_.js +27 -0
  60. package/assets/Cfhv_Yw_LT8VzAMt.js +255 -0
  61. package/assets/Cg51xaLRUkVOMdCZ.js +144 -0
  62. package/assets/ChWpsFGl-BYOnX_A.js +142 -0
  63. package/assets/ClNQN3vEg5b5qUDp.js +10289 -0
  64. package/assets/Crt2kLdGIlBHANgg.js +28 -0
  65. package/assets/CudNpUD78SrtJIiy.js +610 -0
  66. package/assets/CvngwB17_ve4W49b.js +639 -0
  67. package/assets/CwPBmcY6xSP8dNlh.js +51 -0
  68. package/assets/CxjchwpiqxPM1XKd.js +304 -0
  69. package/assets/D-ffk16w8c5w0mxI.js +71 -0
  70. package/assets/D0CHDsemn0S31ltt.js +32 -0
  71. package/assets/D7oUtYjetuykGhQ5.js +18 -0
  72. package/assets/D8J14MLlN2HRXdXB.js +20 -0
  73. package/assets/DA_ar3QKLKtJ9fJD.js +37 -0
  74. package/assets/DB-tkqI6wFXDKEfB.js +118 -0
  75. package/assets/DD8HNAUFroTCuD-b.js +7514 -0
  76. package/assets/DDnwKPJSznyfYDZS.js +49 -0
  77. package/assets/DEW2GxfGYqVFvrfg.js +23 -0
  78. package/assets/DH7sGHzxUqIQkDnd.js +16 -0
  79. package/assets/DJiLWtmPR2OQNjzi.js +19 -0
  80. package/assets/DKLm4nWzynGw1Kr9.js +15 -0
  81. package/assets/DPCKMM7sgWbrtB8z.js +81 -0
  82. package/assets/DTfl-4Iboi6TQU5m.js +37 -0
  83. package/assets/DVchxwp6w6lu2Ihu.js +7 -0
  84. package/assets/DaoSWy3EFlqpZaLr.js +4437 -0
  85. package/assets/DcWTBOi_iBFc6U4J.js +8338 -0
  86. package/assets/Dht2mcOSyYlPY32b.js +14 -0
  87. package/assets/Diee6f_qAmcZBd2_.js +52 -0
  88. package/assets/DkibD_CEVePaoj_y.js +7 -0
  89. package/assets/DlBdhv6NHgrNp5Yo.js +7 -0
  90. package/assets/DoILAmhKUOlKWRVw.js +12 -0
  91. package/assets/DpdHDTFOeuzDVNEe.js +405 -0
  92. package/assets/DsCI_ZYm_jDjXF3J.js +12996 -0
  93. package/assets/DvUUArnZwoYOKOuk.js +12 -0
  94. package/assets/DwLZpYUp85UHBE3H.js +63 -0
  95. package/assets/DwWngYJTgC0KLbih.js +184 -0
  96. package/assets/Dz8UUJ7Xc2oN5PBG.js +45 -0
  97. package/assets/FS9NbEKgQvz5wqvZ.js +1135 -0
  98. package/assets/F_f0jJqM5MrXGbwC.js +86 -0
  99. package/assets/FzNG48GE_wso6RII.js +173 -0
  100. package/assets/JO3zH9hupFSV6vj2.js +15 -0
  101. package/assets/LEJp05fjmflKgyqF.js +1760 -0
  102. package/assets/LyLlBk--VJD2V-f8.js +351 -0
  103. package/assets/OVRdpPUzR0-ueTxE.js +1860 -0
  104. package/assets/PpFbmF0DFeUdpb9I.js +145 -0
  105. package/assets/S16s2h9qoYVBlVEa.js +9137 -0
  106. package/assets/SHZe9VOU1prGs1F9.js +19 -0
  107. package/assets/U1XXGEPuuqIAzYl1.js +8 -0
  108. package/assets/ZuYfVKlp41IJnrOS.js +540 -0
  109. package/assets/_d5XJ7dn1CKKYrep.js +1131 -0
  110. package/assets/_fUXIv6nKvgZkhxn.js +23 -0
  111. package/assets/fDMpDhXp36CatF-G.js +23 -0
  112. package/assets/hulrR0PldUxMJm_F.js +504 -0
  113. package/assets/iujMYIEPx_v3sdPf.js +9109 -0
  114. package/assets/jPUOH4FHF4b-rapv.js +171 -0
  115. package/assets/jadLBUNBVR9mbZ35.js +4036 -0
  116. package/assets/jiEe5eKV3BFPBWfi.js +6294 -0
  117. package/assets/oxjm7Yr7u7MeaO5P.js +37 -0
  118. package/assets/vZZi_iKYHm05gAye.js +30 -0
  119. package/assets/wfVh0olISLRWdv9Q.js +47 -0
  120. package/assets/xmTQJJVyCrcq77WR.js +63 -0
  121. package/assets/xnhBSX6lAcmBM65y.js +32 -0
  122. package/index.js +8070 -0
  123. package/lib.js +7 -0
  124. package/licenses/dependencies.txt +1552 -0
  125. package/package.json +44 -3
  126. package/resources/contents.json +333 -0
  127. package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
  128. package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
  129. package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
  130. package/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
  131. package/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
  132. package/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
  133. package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
  134. package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
  135. package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
  136. package/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
  137. package/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
  138. package/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
  139. package/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
  140. package/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
  141. package/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
  142. package/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
  143. package/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
  144. package/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
  145. package/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
  146. package/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
  147. package/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
  148. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
  149. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
  150. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
  151. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
  152. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
  153. package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
  154. package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
  155. package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
  156. package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
  157. package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
  158. package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
  159. package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
  160. package/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
  161. package/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
  162. package/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
  163. package/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
  164. package/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
  165. package/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
  166. package/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
  167. package/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
  168. package/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
  169. package/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
  170. package/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
  171. package/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
  172. package/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
  173. package/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
  174. package/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
  175. package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
  176. package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
  177. package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
  178. package/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
  179. package/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
  180. package/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
  181. package/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
  182. package/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
  183. package/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
  184. package/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
  185. package/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
  186. package/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
  187. package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
  188. package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
  189. package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
  190. package/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
  191. package/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
  192. package/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
  193. package/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
  194. package/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
  195. package/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
  196. package/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
  197. package/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
  198. package/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
  199. package/resources/fonts/@sheetxl/sdk/contents.json +646 -0
  200. package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
  201. package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
  202. package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
  203. package/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
  204. package/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
  205. package/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
  206. package/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
  207. package/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
  208. package/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
  209. package/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
  210. package/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
  211. package/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
  212. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
  213. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
  214. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
  215. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
  216. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
  217. package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
  218. package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
  219. package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
  220. package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
  221. package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
  222. package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
  223. package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
  224. package/resources/locales/@sheetxl/formulas/contents.json +9 -0
  225. package/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
  226. package/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
  227. package/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
  228. package/resources/locales/@sheetxl/sdk/contents.json +19 -0
  229. package/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
  230. package/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
  231. package/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
  232. package/screenshot-page/assets/-cpi3yOZYn6GsYN4.js +9 -0
  233. package/screenshot-page/assets/-i_fTASJeu9NdNH_.js +7 -0
  234. package/screenshot-page/assets/0MTaPYjKud2Q9QG9.js +1 -0
  235. package/screenshot-page/assets/21oAESJyBGXeHegm.js +2 -0
  236. package/screenshot-page/assets/3Ls_kOvlQseMV8Q0.js +1 -0
  237. package/screenshot-page/assets/4qZpl2QCzneWdmJO.js +1 -0
  238. package/screenshot-page/assets/6IEV7KeOEbBdrthj.js +1 -0
  239. package/screenshot-page/assets/8QrkTrKHDnMBb7q4.js +1 -0
  240. package/screenshot-page/assets/9w0ECZmzGUyk3F_O.js +1 -0
  241. package/screenshot-page/assets/AjS2PipZDIH3BXB2.js +1 -0
  242. package/screenshot-page/assets/B-KIwD5F_5S-NsPg.js +1 -0
  243. package/screenshot-page/assets/B-sAzW5ROrhvMGM4.js +1 -0
  244. package/screenshot-page/assets/B0FQypGas6gbGT_U.js +1 -0
  245. package/screenshot-page/assets/B2IQMVqTZT1rUnib.js +1 -0
  246. package/screenshot-page/assets/B2MJPcMcsuv6FekC.js +1 -0
  247. package/screenshot-page/assets/B2g3jiFIQ4Qjh5gG.js +1 -0
  248. package/screenshot-page/assets/B4PbXdzBe9BsoZ0e.js +2 -0
  249. package/screenshot-page/assets/B5GO9v4p9L70Xb9i.js +1 -0
  250. package/screenshot-page/assets/B8y_eLNCGnXLEIaE.js +1 -0
  251. package/screenshot-page/assets/BEuMvXYIa9A1JacY.js +1 -0
  252. package/screenshot-page/assets/BEwl-ucV9Jfr0RoC.js +1 -0
  253. package/screenshot-page/assets/BFaiQZKle44Rhyou.js +1 -0
  254. package/screenshot-page/assets/BHqg55S-4_OoAu3P.js +2 -0
  255. package/screenshot-page/assets/BNgLvS2bLOYKRguv.js +1 -0
  256. package/screenshot-page/assets/BQAN82ftWBiLJT3r.js +1 -0
  257. package/screenshot-page/assets/BQfe-XTIOGeUnD9B.js +1 -0
  258. package/screenshot-page/assets/BQnELVV0uR4T4ItQ.js +1 -0
  259. package/screenshot-page/assets/BRVZJ0OGJg9XJro6.js +1 -0
  260. package/screenshot-page/assets/BSdFVGZNhU6YHbMI.js +2 -0
  261. package/screenshot-page/assets/BTMW3ukmc44U2fy7.js +1 -0
  262. package/screenshot-page/assets/BTOQaSn9DDyJPUlX.js +1 -0
  263. package/screenshot-page/assets/BTboCICZ-951XWsi.js +1 -0
  264. package/screenshot-page/assets/BUGXf2DEBog16Slb.js +2 -0
  265. package/screenshot-page/assets/BUjI304IvdJnFXH3.js +1 -0
  266. package/screenshot-page/assets/B_W2QroTKADz3ABp.js +2 -0
  267. package/screenshot-page/assets/Baz0SC2AgGyxMX72.js +1 -0
  268. package/screenshot-page/assets/BbP9KThfrodyosvn.js +1 -0
  269. package/screenshot-page/assets/BcOdl17EeFSxnAiq.js +1 -0
  270. package/screenshot-page/assets/BclKeOKIOBjijhsu.js +1 -0
  271. package/screenshot-page/assets/Bf7xq8PyF4ohjMzP.js +2 -0
  272. package/screenshot-page/assets/BimyzECCZl-NESff.js +1 -0
  273. package/screenshot-page/assets/Bj-vfAT28PK-tWWa.js +2 -0
  274. package/screenshot-page/assets/BkLH7JH3A93TXFJi.js +1 -0
  275. package/screenshot-page/assets/BksaQEoZr5OWq-_d.js +3 -0
  276. package/screenshot-page/assets/BnoVwUBEor8NgQNs.js +4 -0
  277. package/screenshot-page/assets/BowRIybLgENunTOT.js +1 -0
  278. package/screenshot-page/assets/Bp7se0JaDGrzfSA_.js +1 -0
  279. package/screenshot-page/assets/Bx61vmiWY0Xvx9qs.js +1 -0
  280. package/screenshot-page/assets/ByY3fmwyDPAyOLdo.js +1 -0
  281. package/screenshot-page/assets/Bz5V1tmiy5gbT9ys.js +1 -0
  282. package/screenshot-page/assets/Bz9v1lgjvbu4QnOs.js +2 -0
  283. package/screenshot-page/assets/BzQ5GyiXq8gTz-H-.js +1 -0
  284. package/screenshot-page/assets/C1k_VrZqlpiUigCP.js +1 -0
  285. package/screenshot-page/assets/C2Wh2h27c7FUb8Yk.js +1 -0
  286. package/screenshot-page/assets/C6oLDVnuCS9LGkkH.js +1 -0
  287. package/screenshot-page/assets/C81mK8aZKZAAS-AB.js +1 -0
  288. package/screenshot-page/assets/C9SC-cEIt6gdhZRw.js +1 -0
  289. package/screenshot-page/assets/CE8MCCIiwjOVwBBW.js +1 -0
  290. package/screenshot-page/assets/CG3ynup87FmG-kkX.js +1 -0
  291. package/screenshot-page/assets/CHlWgOAlcRCjVuhg.js +1 -0
  292. package/screenshot-page/assets/CIged53b3hHKxa-o.js +1 -0
  293. package/screenshot-page/assets/CNQczIR5xcE5u5fT.js +1 -0
  294. package/screenshot-page/assets/CSUd8n1H0VBfREnk.js +2 -0
  295. package/screenshot-page/assets/CSlBTkRDITCC8JRB.js +1 -0
  296. package/screenshot-page/assets/CV2jr9hpQOG2OG0C.js +1 -0
  297. package/screenshot-page/assets/CXGgKVbVXjWzE0p6.js +1 -0
  298. package/screenshot-page/assets/CXKCmZ_TRyGaB9Ob.js +1 -0
  299. package/screenshot-page/assets/CXUO3vYip3JPSJ7A.js +1 -0
  300. package/screenshot-page/assets/CXwbGzavyvYgDbWU.js +1 -0
  301. package/screenshot-page/assets/CZf9s6otzzoaBlSs.js +1 -0
  302. package/screenshot-page/assets/CZvwQEeVhBilgKLG.js +1 -0
  303. package/screenshot-page/assets/Ca6nxdhEuLLty3d7.js +2 -0
  304. package/screenshot-page/assets/CbUDukmvDZmVfhJH.js +1 -0
  305. package/screenshot-page/assets/CbXtAM7H-Jg_J0dk.js +1 -0
  306. package/screenshot-page/assets/CctIRGMFmARVi2KT.js +1 -0
  307. package/screenshot-page/assets/Cenh1POxiGMxIQlv.js +1 -0
  308. package/screenshot-page/assets/ChSvXfVMLxZsP9zG.js +8 -0
  309. package/screenshot-page/assets/Ci5NtzhJLll1kxGf.js +10 -0
  310. package/screenshot-page/assets/CjngjJNheGaVRvZp.js +1 -0
  311. package/screenshot-page/assets/ClzdIJrFdInttVJA.js +1 -0
  312. package/screenshot-page/assets/CnPgk3HcIziOcskY.js +10 -0
  313. package/screenshot-page/assets/CnXLpFE_vFrJ5Jbf.js +1 -0
  314. package/screenshot-page/assets/CpbohdgEaEsVDi9J.js +1 -0
  315. package/screenshot-page/assets/CqR3hGrC956TkCMj.js +20 -0
  316. package/screenshot-page/assets/Cr1tQKUBVKOQl3QC.js +1 -0
  317. package/screenshot-page/assets/CwqNb7JYzC03lCj0.js +1 -0
  318. package/screenshot-page/assets/CykecBozGGFl26KA.js +3940 -0
  319. package/screenshot-page/assets/CzTizxHhb-CI_ajE.js +1 -0
  320. package/screenshot-page/assets/CzhH7lTYQrYGHct6.js +1 -0
  321. package/screenshot-page/assets/CzzEl3lAkZopkwhC.js +1 -0
  322. package/screenshot-page/assets/D-LgRj0s-PAVqY-L.js +1 -0
  323. package/screenshot-page/assets/D-XR1MGhwn7Jqj60.js +1 -0
  324. package/screenshot-page/assets/D47ePD4x1lVazNdl.js +7 -0
  325. package/screenshot-page/assets/D66vSE1ConAuENmB.js +586 -0
  326. package/screenshot-page/assets/D6Jpaz2YkhOfzxDB.js +1 -0
  327. package/screenshot-page/assets/D9zCVZpnJBfNSNO2.js +1 -0
  328. package/screenshot-page/assets/DCVUZ_ayOXFwV2d_.js +3 -0
  329. package/screenshot-page/assets/DDQWM8rNYCYzKa9R.js +1 -0
  330. package/screenshot-page/assets/DFE-fKq5NV7_O8V6.js +1 -0
  331. package/screenshot-page/assets/DGXDfjkGZjMRAXPg.js +5 -0
  332. package/screenshot-page/assets/DHa5_U58lSwCnpmG.js +1 -0
  333. package/screenshot-page/assets/DKVB6ddRfDJatYid.js +1 -0
  334. package/screenshot-page/assets/DK_QSosKV62NDcuT.js +42 -0
  335. package/screenshot-page/assets/DM9U7u7FQK0jcwh4.js +1 -0
  336. package/screenshot-page/assets/DNDaHmkQrQTaCHhV.js +1 -0
  337. package/screenshot-page/assets/DQ0kGd99-fXxuNYk.js +1 -0
  338. package/screenshot-page/assets/DQWHkaQeNXft9j8b.js +2 -0
  339. package/screenshot-page/assets/DRVfGdmVBvktrZ1t.js +1 -0
  340. package/screenshot-page/assets/DRrM-dY9nM7nDRpV.js +1 -0
  341. package/screenshot-page/assets/DT2x1gO3f2G5NfeB.js +1 -0
  342. package/screenshot-page/assets/DTFRGj188QuLKEXw.js +1 -0
  343. package/screenshot-page/assets/DU3FmyUH0RjPIBd-.js +1 -0
  344. package/screenshot-page/assets/DVueE--eOrZPrqrm.js +1 -0
  345. package/screenshot-page/assets/DXQLzGmxoyN3kfQi.js +27 -0
  346. package/screenshot-page/assets/DXWWyJlMSWgDFxs1.js +10 -0
  347. package/screenshot-page/assets/DYJSIlNxrNw8qk-w.js +1 -0
  348. package/screenshot-page/assets/DYRbCudWTaiE_Sjc.js +1 -0
  349. package/screenshot-page/assets/DZDRRw-62D6Zw7qs.js +1 -0
  350. package/screenshot-page/assets/DaKZ4-Li_ULIIwnK.js +1 -0
  351. package/screenshot-page/assets/DadZXeaVK5UXSHIi.js +1 -0
  352. package/screenshot-page/assets/Db_VGqQo2G2JgXWW.js +1 -0
  353. package/screenshot-page/assets/DceNHPrRLok2At-X.js +1 -0
  354. package/screenshot-page/assets/DcrVJCyDwGKeil2U.js +1 -0
  355. package/screenshot-page/assets/DeAKjatTVaZ0u_FY.js +1 -0
  356. package/screenshot-page/assets/DmMZ4pd492HPw_3_.js +1 -0
  357. package/screenshot-page/assets/DmbuCapSSCYIa3yk.js +1 -0
  358. package/screenshot-page/assets/Dpepompn_NhpSncR.js +1 -0
  359. package/screenshot-page/assets/DqYhS4mcQfOe96hU.js +1 -0
  360. package/screenshot-page/assets/Dsx0NUmGIxS7SvZ8.js +1 -0
  361. package/screenshot-page/assets/DyGpT6t96jrvgJes.js +1 -0
  362. package/screenshot-page/assets/DyLWQxXXTw5uwPVy.js +30 -0
  363. package/screenshot-page/assets/DyYVf8O1rhg3YmjW.js +1 -0
  364. package/screenshot-page/assets/DyxJBLjUkeDuu96F.js +1 -0
  365. package/screenshot-page/assets/HclGiUj8dZXDFmoM.js +1 -0
  366. package/screenshot-page/assets/IRtoU5oVgBWu9rnK.js +2 -0
  367. package/screenshot-page/assets/J73KTOmdZGNmnq-z.js +1 -0
  368. package/screenshot-page/assets/J_xJVgE7YlmeU-ZO.js +6 -0
  369. package/screenshot-page/assets/KoxRo2J_cwB_yOd5.js +2 -0
  370. package/screenshot-page/assets/LVtV_IPhPQroHRui.js +1 -0
  371. package/screenshot-page/assets/MNoPOsydrUv1UGU8.js +2 -0
  372. package/screenshot-page/assets/Q5EKmzoJZCE81Om-.js +2 -0
  373. package/screenshot-page/assets/TfhknTx8vxQkw4zV.js +2 -0
  374. package/screenshot-page/assets/VvqAh6BWzaD5OUPF.js +1 -0
  375. package/screenshot-page/assets/fGlPAximvsxzPzGA.js +1 -0
  376. package/screenshot-page/assets/gG0AFZ45VxS_moMw.js +2 -0
  377. package/screenshot-page/assets/hp_-JA1DMK4Yoztn.js +57 -0
  378. package/screenshot-page/assets/l32n8O_A78Qqduv3.js +1 -0
  379. package/screenshot-page/assets/nHThFXCAZFOM_npq.js +1 -0
  380. package/screenshot-page/assets/pRykm05ElquZBk_a.js +1 -0
  381. package/screenshot-page/assets/rPOkVKdPbFpTG6AY.js +1 -0
  382. package/screenshot-page/assets/sHBomL5R4-_px8rD.js +1 -0
  383. package/screenshot-page/assets/skRJ2qjA7kcmnOsh.js +39 -0
  384. package/screenshot-page/assets/w3bV7wggRayUYTd-.js +1 -0
  385. package/screenshot-page/assets/zFbb8ESzwR_bE7IQ.js +1 -0
  386. package/screenshot-page/index.html +44 -0
  387. package/screenshot-page/resources/contents.json +333 -0
  388. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
  389. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
  390. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
  391. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
  392. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
  393. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
  394. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
  395. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
  396. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
  397. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
  398. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
  399. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
  400. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
  401. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
  402. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
  403. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
  404. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
  405. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
  406. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
  407. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
  408. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
  409. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
  410. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
  411. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
  412. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
  413. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
  414. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
  415. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
  416. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
  417. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
  418. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
  419. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
  420. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
  421. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
  422. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
  423. package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
  424. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
  425. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
  426. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
  427. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
  428. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
  429. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
  430. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
  431. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
  432. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
  433. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
  434. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
  435. package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
  436. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
  437. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
  438. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
  439. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
  440. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
  441. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
  442. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
  443. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
  444. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
  445. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
  446. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
  447. package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
  448. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
  449. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
  450. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
  451. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
  452. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
  453. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
  454. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
  455. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
  456. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
  457. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
  458. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
  459. package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
  460. package/screenshot-page/resources/fonts/@sheetxl/sdk/contents.json +646 -0
  461. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
  462. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
  463. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
  464. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
  465. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
  466. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
  467. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
  468. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
  469. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
  470. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
  471. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
  472. package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
  473. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
  474. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
  475. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
  476. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
  477. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
  478. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
  479. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
  480. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
  481. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
  482. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
  483. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
  484. package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
  485. package/screenshot-page/resources/locales/@sheetxl/formulas/contents.json +9 -0
  486. package/screenshot-page/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
  487. package/screenshot-page/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
  488. package/screenshot-page/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
  489. package/screenshot-page/resources/locales/@sheetxl/sdk/contents.json +19 -0
  490. package/screenshot-page/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
  491. package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
  492. package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
  493. package/types/index.d.ts +1 -0
  494. package/types/lib.d.ts +2 -0
  495. package/types/scripting-api.json +10855 -0
  496. package/types/scripting-enums.json +1339 -0
  497. package/types/scripting.d.ts +49295 -0
  498. package/types/src/SessionRegistry.d.ts +630 -0
  499. package/types/src/index.d.ts +3 -0
  500. package/types/src/instances.d.ts +104 -0
  501. package/types/src/lib/Types.d.ts +17 -0
  502. package/types/src/lib/index.d.ts +2 -0
  503. package/types/src/lib/runReport.d.ts +158 -0
  504. package/types/src/lib.d.ts +2 -0
  505. package/types/src/prepareRun.d.ts +56 -0
  506. package/types/src/relay.d.ts +102 -0
  507. package/types/src/screenshot.d.ts +23 -0
  508. package/types/src/server.d.ts +37 -0
  509. package/types/src/taskStore.d.ts +28 -0
@@ -0,0 +1,27 @@
1
+ import{Z as e,u as t,y as n}from"./ChSvXfVMLxZsP9zG.js";import{a as r}from"./DcrVJCyDwGKeil2U.js";import{A as i,D as a,E as o,U as s,Y as c,Z as l,Zt as u,_ as d,b as f,jt as p,p as m,tt as h,zt as g}from"./Ca6nxdhEuLLty3d7.js";import{i as _}from"./BcOdl17EeFSxnAiq.js";import{Mr as v,Ot as y,ei as b,fn as x,ki as S,qt as C,st as w}from"./D66vSE1ConAuENmB.js";import{i as ee,n as T,t as E}from"./CZf9s6otzzoaBlSs.js";var D=/<!\[CDATA\[([\s\S]*?)\]\]>|<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<(\/?)([^\s/>]+)((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>|([^<]+)/g,te={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`},ne=e=>e.indexOf(`&`)===-1?e:e.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g,(e,t)=>{if(t[0]!==`#`)return te[t]??e;let n=t[1]===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isFinite(n)?String.fromCodePoint(n):e}),re=e=>{let t=e.indexOf(`:`);return t===-1?e:e.slice(t+1)},O=e=>e.children.filter(e=>typeof e!=`string`),ie=(e,t)=>O(e).find(e=>e.name===t)??null,ae=new Set([`pPr`,`rPr`,`endParaRPr`,`bodyPr`,`lstStyle`]),oe=e=>{let t=``,n=e=>{if(ae.has(e.name))return;if(e.name===`br`)return void(t+=`
2
+ `);if(e.name===`t`)return void(t+=(e=>{let t=``;for(let n of e.children)typeof n==`string`&&(t+=n);return t})(e));let r=e.name===`AlternateContent`?(e=>{let t=ie(e,`Fallback`)??ie(e,`Choice`);return t?O(t):[]})(e):O(e);for(let e of r)n(e)};for(let t of O(e))n(t);return t},k=Object.freeze({text:null,slot:null}),se=Object.freeze({slot:null,literal:null}),ce={cat:`category`,val:`value`,date:`date`,ser:`series`},le=/(<(?:[\w.-]+:)?f(?:\s[^>]*)?>)([^<]*)(<\/(?:[\w.-]+:)?f>)/g,ue=e=>{let t=[];le.lastIndex=0;for(let n=le.exec(e);n;n=le.exec(e))n[2]!==``&&t.push(ne(n[2]));return t},de=e=>{let t=[],n=new Map,r=[],i=e=>{if(Array.isArray(e)){for(let t of e)i(t);return}if(typeof e!=`object`||!e)return;let a=e;typeof a.f==`string`&&(n.set(a,t.length),t.push({text:a.f}));for(let e of a.unknown?.elements??[])for(let n of ue(e.xml))r.push({text:n,slot:t.length}),t.push({text:n});for(let e of Object.keys(a))e!==`unknown`&&i(a[e])};return i(e),{slots:t,referenceSlots:n,kept:r}},fe=new Set([`area`,`bar`,`line`,`pie`,`doughnut`,`ofPie`,`scatter`,`bubble`,`radar`,`stock`,`surface`,`custom`]),A=new Set([`waterfall`,`histogram`,`boxWhisker`,`treemap`,`sunburst`,`funnel`,`regionMap`]),j=e=>(e.chart?.plotArea?.groups??[]).every(e=>fe.has(e.type)),pe=e=>(e.chart?.plotArea?.groups??[]).every(e=>fe.has(e.type)||A.has(e.type)),me={boxWhisker:`boxwhisker`},he=(e,t)=>{let n=t?.marker?.symbol;return n===void 0?e.type===`line`?!1!==e.marker:e.type===`scatter`?e.scatterStyle!==`line`&&e.scatterStyle!==`smooth`&&e.scatterStyle!==`none`:e.radarStyle===`marker`:n!==`none`},ge={cylinder:`cylinder`,cone:`cone`,coneToMax:`cone`,pyramid:`pyramid`,pyramidToMax:`pyramid`},_e=(e,t)=>{let n=(e=>e.grouping===`stacked`?`Stacked`:e.grouping===`percentStacked`?`Stacked100`:``)(e);switch(e.type){case`bar`:{let r=e.barDir!==`bar`,i=e.is3D?ge[t?.shape??e.shape??`box`]:void 0,a=e.grouping===`standard`?``:n||`Clustered`;return i?`${i}${r?`Col`:`Bar`}${a}`:e.is3D?`3D${r?`Column`:`Bar`}${a}`:`${r?`column`:`bar`}${n||`Clustered`}`}case`line`:return e.is3D?`3DLine`:`${he(e,t)?`lineMarkers`:`line`}${n}`;case`area`:return`${e.is3D?`3DArea`:`area`}${n}`;case`pie`:{let n=(t?.explosion??0)>0;return`${e.is3D?`3DPie`:`pie`}${n?`Exploded`:``}`}case`ofPie`:return e.ofPieType===`bar`?`barOfPie`:`pieOfPie`;case`doughnut`:return(t?.explosion??0)>0?`doughnutExploded`:`doughnut`;case`scatter`:{let n=he(e,t),r=t?.spPr?.stroke,i=r?r.fill?.type===`none`:e.scatterStyle===`marker`||e.scatterStyle===`none`;return e.scatterStyle===`smooth`||e.scatterStyle===`smoothMarker`||t?.smooth?n?`xyscatterSmooth`:`xyscatterSmoothNoMarkers`:i?`xyscatter`:n?`xyscatterLines`:`xyscatterLinesNoMarkers`}case`bubble`:return t?.bubble3D||e.bubble3D?`bubble3DEffect`:`bubble`;case`radar`:return e.radarStyle===`filled`?`radarFilled`:he(e,t)?`radarMarkers`:`radar`;case`stock`:return e.upDownBars?`stockOHLC`:`stockHLC`;case`surface`:return e.is3D?e.wireframe?`surfaceWireframe`:`surface`:e.wireframe?`surfaceTopViewWireframe`:`surfaceTopView`;default:return me[e.type]??e.type}},ve=e=>{if(e.length===0)return`unknown`;if(e.length===1&&e[0].type===`custom`)return`custom:${e[0].custom?.kind??``}`;let t=new Set(e.map(e=>_e(e,(e=>[...e.series].sort((e,t)=>(e.order??0)-(t.order??0)))(e)[0])));return e.length===2&&e[0].type===`bar`&&e[1].type===`stock`?e[1].upDownBars?`stockVOHLC`:`stockVHLC`:t.size===1&&t.has(`histogram`)&&e.some(e=>e.series.some(e=>e.cumulativeLine))?`pareto`:t.size===1?[...t][0]:`combo`},ye=e=>ve(e.chart?.plotArea?.groups??[]),be=e=>{let t=e.paragraphs.map(e=>(e.runs??[]).map(e=>e.text).join(``)),n=0,r=t.length;for(;n<r&&t[n].trim()===``;)n++;for(;r>n&&t[r-1].trim()===``;)r--;return t.slice(n,r).join(`
3
+ `)},M=e=>{let t=e.unknown?.elements?.find(e=>/^<(?:[\w.-]+:)?rich[\s>/]/.test(e.xml)),n=t?(e=>{let t={name:``,attrs:``,children:[],contentStart:0,contentEnd:e.length},n=[t];D.lastIndex=0;for(let t=D.exec(e);t;t=D.exec(e)){let e=n[n.length-1];if(t[1]!==void 0)e.children.push(t[1]);else if(t[6]!==void 0)e.children.push(ne(t[6]));else if(t[3]!==void 0){if(t[2]){n.length>1&&(n.pop().contentEnd=t.index);continue}let r=t.index+t[0].length,i={name:re(t[3]),attrs:t[4]??``,children:[],contentStart:r,contentEnd:r};e.children.push(i),t[5]||n.push(i)}}return t.children.find(e=>typeof e!=`string`)??null})(t.xml):null;return n&&(e=>{let t=O(e).filter(e=>e.name===`p`).map(oe),n=0,r=t.length;for(;n<r&&t[n].trim()===``;)n++;for(;r>n&&t[r-1].trim()===``;)r--;return t.slice(n,r).join(`
4
+ `)})(n)||null},xe=(e,t)=>`{${(e.points??[]).map(e=>t?`"${e.v.replace(/"/g,`""`)}"`:e.v).join(`,`)}}`,Se=class{constructor(e){this._slots=e}slotOf(e){return e?this._slots.get(e)??null:null}text(e){if(!e)return k;if(e.rich)return{text:be(e.rich)||null,slot:null};if(e.strRef)return{text:(t=e.strRef,(t.cache?.points?.[0]?.v||null)??(e.v||null)),slot:this.slotOf(e.strRef)};var t;if(e.v!==void 0)return{text:e.v||null,slot:null};let n=M(e);return n===null?k:{text:n,slot:null}}source(e){if(!e)return se;if(e.numLit&&!e.numLit.levels)return{slot:null,literal:xe(e.numLit,!1)};if(e.strLit&&!e.strLit.levels)return{slot:null,literal:xe(e.strLit,!0)};let t=this.slotOf(e.multiLvlStrRef??e.numRef??e.strRef);return t===null?se:{slot:t,literal:null}}},Ce={numRef:`num`,strRef:`str`,multiLvlStrRef:`multiLvlStr`,datalabelsRange:`str`},we=(e,t)=>{let n=e??[],r=t??[];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t.idx!==i.idx||(t.formatCode??null)!==(i.formatCode??null)||t.v!==i.v&&(t.v.trim()===``||Number(t.v)!==Number(i.v)))return!1}return!0},Te=(e,t,n)=>{let r=new Map;for(let{text:e,slot:i}of t.kept){let t=n.movedAt(i);t!==null&&t!==e&&r.set(e,t)}let i=(e,a)=>{if(Array.isArray(e)){let t=!1,n=e.map(e=>{let n=i(e,a);return n!==e&&(t=!0),n});return t?n:e}if(typeof e!=`object`||!e)return e;let o=e,s=null,c=o,l=t.referenceSlots.get(c);if(l!==void 0){let e=n.movedAt(l);e!==null&&e!==c.f&&(s={...o,f:e});let t=Ce[a],r=t&&n.cacheOf?n.cacheOf(c,t):null;!r||c.cache&&((e,t)=>{if((e.formatCode??null)!==(t.formatCode??null)||(e.ptCount??null)!==(t.ptCount??null)||!we(e.points,t.points))return!1;let n=e.levels??[],r=t.levels??[];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!we(n[e].points,r[e].points))return!1;return!0})(c.cache,r)||((s??={...o}).cache=c.cache?.unknown?{...r,unknown:c.cache.unknown}:r)}let u=o.unknown;if(r.size>0&&u?.elements){let e=((e,t)=>{let n=!1,r=e.elements?.map(e=>{let r=e.xml.replace(le,(e,n,r,i)=>{let a=t.get(ne(r));return a===void 0?e:n+(e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`))(a)+i});return r===e.xml?e:(n=!0,{...e,xml:r})});return n?{...e,elements:r}:e})(u,r);e!==u&&((s??={...o}).unknown=e)}for(let e of Object.keys(o)){if(e===`unknown`||l!==void 0&&(e===`f`||e===`cache`))continue;let t=i(o[e],e);t!==o[e]&&((s??={...o})[e]=t)}return s??o};return i(e,``)},Ee={none:{description:`None`,multi:1},hundreds:{description:`Hundreds`,multi:100},thousands:{description:`Thousands`,multi:1e3},tenThousands:{description:`10000`,multi:1e4},hundredThousands:{description:`100000`,multi:1e5},millions:{description:`Millions`,multi:1e6},tenMillions:{description:`10000000`,multi:1e7},hundredMillions:{description:`100000000`,multi:1e8},billions:{description:`Billions`,multi:1e9},trillions:{description:`Trillions`,multi:0xe8d4a51000}},De=(e,t)=>e===0?0:Number(e.toPrecision(t));function Oe(e){let t=(e=>{let t=e.length;if(t<2)return 0;let n=e.reduce((e,t)=>e+t,0)/t;return Math.sqrt(e.reduce((e,t)=>e+(t-n)**2,0)/(t-1))})(e);return t>0?De(3.5*t/Math.cbrt(e.length),2):5}function ke(e,t,n){let r=e.length;if(r===0)return NaN;let i=Math.min(r,Math.max(1,n===`exclusive`?t*(r+1):1+t*(r-1))),a=Math.floor(i),o=i-a,s=e[a-1];return s+o*(e[Math.min(r,a+1)-1]-s)}var Ae=(e,t)=>{let n=e.length,r=e.reduce((e,t)=>e+t,0)/n,i=t.reduce((e,t)=>e+t,0)/n,a=0,o=0,s=0;for(let c=0;c<n;c++)a+=(e[c]-r)*(t[c]-i),o+=(t[c]-i)**2,s+=(e[c]-r)**2;return o===0||s===0?1:a*a/(o*s)},je=(e,t,n,r)=>{let i=r!==void 0;if(n===1){let n=e.length;if(i){let i=0,a=0;for(let o=0;o<n;o++)i+=e[o]*(t[o]-r),a+=e[o]*e[o];return a===0?null:[r,i/a]}let a=0,o=0,s=0,c=0;for(let r=0;r<n;r++)a+=e[r],o+=t[r],s+=e[r]*t[r],c+=e[r]*e[r];let l=a/n,u=o/n,d=0,f=0;for(let r=0;r<n;r++)d+=(e[r]-l)*(t[r]-u),f+=(e[r]-l)**2;let p=n*c-a*a;return f===0||p===0?null:[(c*o-a*s)/p,d/f]}let a=((e,t)=>{let n=e.length,r=e[0]?.length??0;if(r===0||n<r)return null;let i=e.map(e=>e.slice()),a=t.slice();for(let e=0;e<r;e++){let t=0;for(let r=e;r<n;r++)t+=i[r][e]*i[r][e];if(t=Math.sqrt(t),t===0)return null;let o=i[e][e]>0?-t:t,s=Array(n).fill(0);s[e]=i[e][e]-o;for(let t=e+1;t<n;t++)s[t]=i[t][e];let c=0;for(let t=e;t<n;t++)c+=s[t]*s[t];if(c===0)continue;for(let t=e;t<r;t++){let r=0;for(let a=e;a<n;a++)r+=s[a]*i[a][t];let a=2*r/c;for(let r=e;r<n;r++)i[r][t]-=a*s[r]}let l=0;for(let t=e;t<n;t++)l+=s[t]*a[t];let u=2*l/c;for(let t=e;t<n;t++)a[t]-=u*s[t]}let o=Array(r).fill(0);for(let e=r-1;e>=0;e--){let t=a[e];for(let n=e+1;n<r;n++)t-=i[e][n]*o[n];if(i[e][e]===0)return null;o[e]=t/i[e][e]}return o})(e.map(e=>{let t=[];for(let r=+!!i;r<=n;r++)t.push(e**r);return t}),i?t.map(e=>e-r):t);return a?i?[r,...a]:a:null};function Me(e,t,n){let r=Math.max(2,Math.round(n)),i=[];for(let n=r-1;n<t.length;n++){let a=0;for(let e=n-r+1;e<=n;e++)a+=t[e];i.push({x:e[n],y:a/r})}return i}var Ne=(e,t)=>e.toFixed(t);function Pe(e,t=6){if(!Number.isFinite(e))return String(e);if(e===0)return`0`;let n=e<0?`-`:``,r=Math.abs(e),i=Math.floor(Math.log10(r)),a=null;if(i>=0){let e=i+1;if(e<=t){let n=Fe(Ne(r,Math.max(0,t-e-1)));n.length<=t&&(a=n)}}else 2-i<=t&&(a=Fe(Ne(r,t-2)));return n+(a??((e,t)=>{let n=Math.max(0,t-5-1),r=Math.floor(Math.log10(e)),i=Ne(e/10**r,n);return Number(i)>=10&&(r+=1,i=Ne(e/10**r,n)),`${Fe(i)}E${r<0?`-`:`+`}${String(Math.abs(r)).padStart(2,`0`)}`})(r,t))}var Fe=e=>e.includes(`.`)?e.replace(/\.?0+$/,``):e,Ie=(e,t)=>e<0?` - ${t(-e)}`:` + ${t(e)}`;function Le(e,t){return`R² = ${t(e.rSquared)}`}var Re=1e-10,N=e=>e!=null,ze=(e,t)=>{let n=10**t;return Math.round(e*n)/n},Be=e=>e===0?0:Number(e.toPrecision(15));function Ve(e){if(e===0)return 0;let t=Math.floor(Math.log10(Math.abs(e))),n=e/10**t,r=1;return n<=2?r=.1*Math.ceil(n):n>2&&n<=5&&(r=.5),10**t*Math.sign(e)*r}function He(e){return e/5}function Ue(e){let t=10**Math.floor(Math.log10(e)+1e-9),n=Math.round(e/t*1e6)/1e6;return ze(n<2?2*t:n<5?5*t:10*t,15)}function We(e,t,n,r){let i=[],a=n;for(;a<=r;)i.push(a),a=Be(e**+i.length*n);return i.length<=2&&!N(t)&&(i=[n,r]),i}function Ge(e=1,t=1,n,r,i,a,o=10,s=!0){if(e=Number(e),t=Number(t),N(a)&&a<o&&(a=void 0),N(i)||(i=a),N(i)&&i<o&&(i=void 0),e>t)throw Error(`minIn is greater than maxIn`);if(e<=0)throw Error(`minValue for log limits must be positive: `+e);N(n)&&N(r)&&n>=r&&(n=void 0);let c=N(a)?a:o,l=N(i)?i:o,u=N(n)?n:e,d=N(r)?r:t,f,p;if(c<o&&(c=o),l<o&&(l=o),N(n))f=n;else for(f=1;f>u;)f=Be(f/o);if(N(r))p=r;else{p=1;let e=0;for(;p<Math.max(u,d);)p=Be(o**+e),e++}f===p&&(p=u*o);let m={min:Be(f),max:Be(p),majorUnits:Be(c),minorUnits:Be(l),autoZero:1};return s&&(m.majorTicks=We(c,a,f,p),m.minorTicks=function(e,t,n,r){let i=We(e,t,n,r),a=[];for(let t=0;t<i.length;t++){let n=i[t],o=Be(e**+(Math.log(n)/Math.log(e)+1)),s=n,c=0;for(;o-s>Re&&r-s>Re;)s=Be(o/10*(c+1)),c++,s-n>Re&&o-s>Re&&r-s>Re&&a.push(s)}return Math.abs(i[i.length-1]-r)>Re&&Math.abs(a[a.length-1]-r)>Re&&a.push(r),a}(l,i,f,p),m.ticks=m.majorTicks,m.labelTicks=m.majorTicks),m}var Ke=(e,t,n,r,i)=>{let a=qe(0,Math.abs(e),0,Math.abs(e),n,r,i);return e+t*Math.ceil(Math.abs(e)/a.majorUnits)*a.majorUnits};function qe(e,t,n,r,i,a,o=!1,s=.05,c=s){let l=N(e)?Number(e):0,u=N(t)?Number(t):1;if(N(n)||(n=void 0),N(r)||(r=void 0),l>u)throw Error(`minIn is greater than maxIn`);if(N(n)&&N(r)&&n>r)throw Error(`explicitMin is greater than explicitMax`);let d=l,f=u;N(a)&&a<=0&&(a=void 0),N(i)&&i<=0&&(i=void 0),N(n)&&N(r)&&n>=r&&(n=void 0),N(n)&&(d=n),N(r)&&(f=r);let p=d,m=d,h=f,g=f;l===u&&u===0&&(f=h=r=N(r)?r:1),u>=0&&l>=0?(r===0?(g=h=0,m=p=-1):N(r)&&r<=d?(g=h=r,m=p=Ke(r,-1,i,a,o)):N(n)&&n>=f?(m=p=n,r=g=h=Ke(n,1,i,a,o)):N(n)?p=m=n:(f-d)/f*100>16.666||u-l===0||d===0?p=m=0:(p=Math.max(0,d-(h-d)/2),o||(m=Math.max(0,d-(f-d)/2))),N(r)||(g=f+s*(f-m),h=f+c*(f-m))):l<=0&&u<=0?(n===0?(g=h=1,m=p=0):N(r)&&r<=d?(g=h=r,n=m=p=Ke(r,-1,i,a,o)):N(n)&&n>=f?(m=p=n,g=h=Ke(n,1,i,a,o)):N(r)?h=g=r:(d-f)/d*100>16.666||u-l===0||f===0?h=g=0:(h=Math.min(0,f-(p-f)/2),o||(g=Math.min(0,f-(d-f)/2))),N(n)||(m=d+s*(d-g),p=d+c*(d-g))):(N(n)&&n>=f?(m=p=n,r=g=h=Ke(n,1,i,a,o)):N(r)&&r<=d&&(g=h=r,n=m=p=Ke(r,-1,i,a,o)),N(r)||(g=f+s*(f-d),h=f+c*(f-d)),N(n)||(m=d+s*(d-f),p=d+c*(d-f)));let _=N(a)?a:Ve(h-p),v=N(i)?i:He(_),y=Xe(n,r,_,l,u,m,g),b={min:N(n)?n:y[0],max:N(r)?r:y[y.length-1],majorUnits:_,minorUnits:v,autoZero:0};return b.autoZero=Ye(b.min,b.max),b}function Je(e,t,n){let r=e;for(let e=0;e<64;e++){let e=t(r),i=Xe(e.min,e.max,r);if(i.length<=2||n(i))return r;r=Ue(r)}return r}function Ye(e,t){return e>0?e:0}function Xe(e,t,n,r,i,a,o){let s=ze(o??0,5),c=ze(a??0,5),l=[];if(N(t)&&!N(e)){let e;do e=ze(t-n*l.length,5),l.unshift(e);while(e>c);return l}if(N(e))c=e;else{let e=ze(c%n,5);e!==0&&Math.abs(e-n)>2e-4&&(c-=e,N(r)&&r<0&&(c-=n))}if(N(t))s=t;else{let e=ze(c,5);for(;e<s;)e=ze(e+n,5);s=e}if(s===c)return[s];let u=c;for(;u<=s;)l.push(u),u=ze(u+n,5);return l}var Ze=(e,t,n)=>{let r=n*Math.PI/180,i=Math.cos(r),a=Math.sin(r);return{x:e*i-t*a,y:e*a+t*i}},Qe=(e,t)=>{if(e.y>0&&t.y>0||e.y<0&&t.y<0||e.y===t.y)return null;let n=e.y/(e.y-t.y);return{x:e.x+n*(t.x-e.x),y:0}},$e=e=>{switch(e.type){case`pie`:case`doughnut`:case`ofPie`:return`none`;case`scatter`:return`scatter`;case`radar`:return`radar`;case`bubble`:return`bubble`;case`stock`:return`stock`;case`bar`:return e.barDir===`bar`?`horizontal`:`category`;default:return`category`}},et=e=>!!e.is3D||e.type===`bubble`||e.type===`surface`||e.type===`ofPie`,tt=[[`pie`,`doughnut`],[`area`],[`bar`],[`line`,`radar`,`stock`],[`scatter`]],nt=(e,t)=>e.type===t.type&&!!e.is3D==!!t.is3D&&(e.type!==`bar`||(e.barDir??`col`)===(t.barDir??`col`)),rt=e=>{let t=e.axes[0];return t?[t.axId,t.crossAx??t.axId]:[]},it=(e,t)=>e.axIds.length>0&&t.length>0&&e.axIds.some(e=>t.includes(e)),at=(e,t)=>t.axIds.length===0?null:it(t,rt(e))?`primary`:`secondary`,ot=(e,t)=>{for(let n=0;n<e.groups.length;n++){let r=e.groups[n],i=r.series.find(e=>e.idx===t);if(i)return{group:r,groupIndex:n,series:i}}return null},st=(e,t)=>{if(/^\d+$/.test(t))return ot(e,Number(t));let n=/^#(\d+)$/.exec(t);if(!n)return null;let r=Number(n[1]);for(let t=0;t<e.groups.length;t++){let n=e.groups[t];if(r<n.series.length){let e=n.series[r];return e.idx===void 0?{group:n,groupIndex:t,series:e}:null}r-=n.series.length}return null},ct=e=>{let t=[],n=rt(e);n.length&&t.push(n);for(let n of e.axes)t.some(e=>e.includes(n.axId))||t.push([n.axId,n.crossAx??n.axId]);return t},lt=(e,t)=>{let n=e.groups.find(e=>it(e,t));return n?$e(n):null},ut=(e,t)=>t===null||e===t||e===`category`&&t===`scatter`,dt=(e,t)=>{let n=[...e],r=n.findIndex(e=>(e.order??0)>(t.order??0));return r===-1&&(r=n.length),n.splice(r,0,t),n},ft=(e,t,n)=>{let r=t=>{let n=tt.findIndex(e=>e.includes(t.type));return 2*(n===-1?tt.length:n)+ +(at(e,t)===`secondary`)},i=r(n),a=t.length;for(let e=t.length-1;e>=0&&!(r(t[e])<=i);e--)a=e;let o=[...t];return o.splice(a,0,n),o},pt=(e,t,n)=>{switch(t.type){case`bar`:{let r=e.groups.some(e=>$e(e)===`none`)&&!e.groups.some(e=>$e(e)!==`none`),i=e.groups.find(e=>e.type===`bar`),a={type:`bar`,barDir:t.barDir??`col`,grouping:t.grouping??`clustered`,varyColors:!1,series:[],gapWidth:i?.gapWidth??(r?100:150),axIds:n};return a.grouping!==`stacked`&&a.grouping!==`percentStacked`||(a.overlap=100),a}case`line`:return{type:`line`,grouping:t.grouping??`standard`,varyColors:!1,series:[],axIds:n};case`area`:return{type:`area`,grouping:t.grouping??`standard`,varyColors:!1,series:[],axIds:n};case`pie`:return{type:`pie`,varyColors:!0,series:[],firstSliceAng:0,axIds:[]};case`doughnut`:return{type:`doughnut`,varyColors:!0,series:[],firstSliceAng:0,holeSize:50,axIds:[]};case`scatter`:return{type:`scatter`,scatterStyle:`lineMarker`,varyColors:!1,series:[],axIds:n};case`radar`:return{type:`radar`,radarStyle:`marker`,varyColors:!1,series:[],axIds:n};default:return{type:t.type,series:[],axIds:n}}},mt=(e,t,n,r,i)=>({type:e,axId:t,scaling:{orientation:`minMax`},delete:!1,axPos:r,majorTickMark:`out`,tickLblPos:`nextTo`,crossAx:n,...i}),ht=(e,t,n)=>{let r=t(),i=t();if(n)return{axes:[mt(`val`,i,r,`l`,{crossBetween:`between`,majorGridlines:{}}),mt(`cat`,r,i,`b`,{auto:!0})],axIds:[r,i]};switch(e){case`scatter`:return{axes:[mt(`val`,i,r,`r`,{crosses:`max`,crossBetween:`midCat`}),mt(`val`,r,i,`t`,{crosses:`max`,crossBetween:`midCat`})],axIds:[r,i]};case`radar`:return{axes:[mt(`val`,i,r,`l`,{crossBetween:`between`}),mt(`cat`,r,i,`b`,{auto:!0,majorGridlines:{}})],axIds:[r,i]};case`horizontal`:return{axes:[mt(`val`,i,r,`t`,{crosses:`max`,crossBetween:`between`}),mt(`cat`,r,i,`l`,{delete:!0,auto:!0})],axIds:[r,i]};default:return{axes:[mt(`val`,i,r,`r`,{crosses:`max`,crossBetween:`between`}),mt(`cat`,r,i,`b`,{delete:!0,auto:!0})],axIds:[r,i]}}},gt=e=>{let t=e.groups.filter(e=>e.series.length>0),n=rt(e);if(n.length>0&&t.some(e=>e.axIds.length>0)&&!t.some(e=>it(e,n))){let r=[];for(let i of t){if(i.axIds.length===0){r.push(i);continue}let t=r.find(e=>e.axIds.length>0&&nt(e,i));if(t){let e=t.series;for(let t of i.series)e=dt(e,t);r[r.indexOf(t)]={...t,series:e}}else{let t=e.axes.filter(e=>n.includes(e.axId)),a=i.axIds.map((r,i)=>{let a=e.axes.find(e=>e.axId===r)?.type,o=t.find(e=>e.type===a)??t[0];return o?(t.splice(t.indexOf(o),1),o.axId):n[i]??r});r.push({...i,axIds:a})}}t=r}let r=new Set(t.flatMap(e=>e.axIds)),i=e.axes.filter(e=>r.has(e.axId));return{...e,groups:t,axes:i}},_t=(e,t,n)=>{let r=[...e.groups],i=r[t];return r[t]={...i,series:i.series.filter(e=>e.idx!==n)},r},vt=(e,t,n,r)=>{let i=ot(e,t);if(!i)throw Error(`No series with idx ${t}.`);let{group:a,groupIndex:o}=i;if(et(n)||e.groups.some(et))return((e,t)=>{let n=e.groups.flatMap(e=>e.series).sort((e,t)=>(e.order??0)-(t.order??0)),r=$e(t),i=rt(e),a=e.axes.filter(e=>i.includes(e.axId));r===`none`?a=[]:r!==`bubble`&&r!==`scatter`||(a=a.map(e=>({...e,type:`val`,crossBetween:`midCat`})));let o=r===`none`?[]:[...i];t.is3D&&r!==`none`&&t.type!==`surface`&&o.push(0);let s={...pt(e,t,o),series:n};return t.is3D?(s.is3D=!0,delete s.overlap):delete s.is3D,{...e,groups:[s],axes:a}})(e,n);if(nt(a,n)){if(n.grouping===void 0||n.grouping===a.grouping)return e;let t=[...e.groups],r={...a,grouping:n.grouping};return a.type===`bar`&&(n.grouping===`clustered`?delete r.overlap:r.overlap=100),t[o]=r,{...e,groups:t}}let s=$e(n),c=_t(e,o,t),l=e.axes,u=[];if(s!==`none`){let t=ct(e),n=a.axIds.length>0?t.find(e=>it(a,e)):void 0,i=(n?[n,...t.filter(e=>e!==n)]:t).find(t=>ut(s,lt({...e,groups:c},t)));if(i){u=[...i];let t=c.find(e=>it(e,i));if(t&&(u=[...t.axIds]),s===`category`&&lt({...e,groups:c},i)===`scatter`){let e=c.find(e=>it(e,i)).axIds[0];l=l.map(t=>t.axId===e?{...t,type:`cat`,crossBetween:void 0,auto:!0}:i.includes(t.axId)?{...t,crossBetween:`between`}:t)}}else{if(t.length>=2)throw Error(`This move needs a third pair of axes, which is not supported.`);let e=ht(s,r,t.length===0);l=[...l,...e.axes],u=e.axIds}}let d={...e,groups:c,axes:l},f=c.findIndex(e=>nt(e,n)&&(s===`none`?e.axIds.length===0:it(e,u)));if(f!==-1){let e={...c[f],series:dt(c[f].series,i.series)};e.type===`bar`&&delete e.overlap,c=[...c],c[f]=e}else{let e={...pt(d,n,u),series:[i.series]};c=ft({...d,groups:c},c,e)}return gt({...d,groups:c})},yt=(()=>{let e={},t=t=>{for(let n=0;n<6;n++)e[t+n]=`fade accent${n+1}`};for(let n of[1,9,17,25,33])e[n]=`pattern 1`,e[n+1]=`pattern 2`,n!==33&&t(n+2);return t(35),e[41]=`pattern 4`,e[42]=`pattern 2`,t(43),e})(),bt={1:[`dk1 tint 88`,`dk1 tint 55`,`dk1 tint 78`,`dk1 tint 92.5`,`dk1 tint 70`,`dk1 tint 30`],2:[`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`],3:[`accent1 shade 38`,`accent2 shade 38`,`accent3 shade 38`,`accent4 shade 38`,`accent5 shade 38`,`accent6 shade 38`],4:[`dk1 tint 5`,`dk1 tint 55`,`dk1 tint 78`,`dk1 tint 15`,`dk1 tint 70`,`dk1 tint 30`]},xt=new class{constructor(e,t){this._xs=e,this._ys=t,this._ks=function(e,t){let n=e.length-1,r=[];for(let e=0;e<=n;e++)r.push(Array(n+2).fill(0));for(let i=1;i<n;i++){let a=1/(e[i]-e[i-1]),o=1/(e[i+1]-e[i]);r[i][i-1]=a,r[i][i]=2*(a+o),r[i][i+1]=o,r[i][n+1]=3*((t[i]-t[i-1])*a*a+(t[i+1]-t[i])*o*o)}let i=1/(e[1]-e[0]);r[0][0]=2*i,r[0][1]=i,r[0][n+1]=3*(t[1]-t[0])*i*i;let a=1/(e[n]-e[n-1]);r[n][n-1]=a,r[n][n]=2*a,r[n][n+1]=3*(t[n]-t[n-1])*a*a;let o=r.length;for(let e=0;e<o;e++){let t=e;for(let n=e;n<o;n++)r[n][e]>r[t][e]&&(t=n);[r[e],r[t]]=[r[t],r[e]];for(let t=e+1;t<o;t++){for(let n=e+1;n<o+1;n++)r[e][e]&&(r[t][n]=r[t][n]-r[e][n]*(r[t][e]/r[e][e]));r[t][e]=0}}let s=Array(o).fill(0);for(let e=o-1;e>=0;e--){let t=r[e][e]?r[e][o]/r[e][e]:0;s[e]=t;for(let n=e-1;n>=0;n--)r[n][o]-=r[n][e]*t,r[n][e]=0}return s}(e,t)}at(e){let t=this._xs,n=this._ys,r=1;for(;t[r]<e;)r++;let i=t[r]-t[r-1],a=(e-t[r-1])/i,o=this._ks[r-1]*i-(n[r]-n[r-1]),s=-this._ks[r]*i+(n[r]-n[r-1]);return(1-a)*n[r-1]+a*n[r]+a*(1-a)*(o*(1-a)+s*a)}}([1,2,3,4,5,6,7,8,9,10,13,17,35,120,Number.MAX_VALUE],[1,.46,.35,.28,.23,.2,.17,.16,.14,.13,.1,.09,.04,.01,0]),St=(e,t)=>{let n=(t-1)/2;if(e===n)return``;let r=xt.at(t),i=Math.abs(t-1-n-e);return` ${e<n?`shade`:`tint`} ${Math.round(100*(1-r*i))}`},Ct=e=>e===void 0||!Number.isFinite(e)||e<2?2:Math.min(48,Math.round(e));function wt(e,t,n){let r=yt[Ct(e)];if(r.startsWith(`fade `))return r.slice(5)+St(t,n);let i=bt[Number(r.slice(8))];return i[t%i.length]+St(Math.floor(t/i.length),Math.floor(n/i.length)+1)}function Tt(e){let t=Ct(e);return t<=32?{axis:`tx1`,gridLineMajor:`tx1 tint 75`,gridLineMinor:`tx1 tint 50`,plotArea:null}:t<=34?{axis:`dk1`,gridLineMajor:`dk1 tint 75`,gridLineMinor:`dk1 tint 50`,plotArea:`dk1 tint 20`}:t<=40?{axis:`dk1`,gridLineMajor:`dk1 tint 75`,gridLineMinor:`dk1 tint 50`,plotArea:`accent${t-34} tint 20`}:{axis:`dk1`,gridLineMajor:`dk1 tint 75`,gridLineMinor:`dk1 tint 90`,plotArea:`dk1 tint 95`}}function Et(e){return{parseColor:t=>e.parseColor(t),minorFont:()=>e.getTheme().getFontScheme().getMinorFont(),majorFont:()=>e.getTheme().getFontScheme().getMajorFont()}}var Dt=[`diamond`,`square`,`triangle`,`x`,`star`,`circle`,`plus`,`dot`,`dash`],Ot=new Set([`x`,`star`,`plus`]),kt={linear:`Linear`,exp:`Expon.`,log:`Log.`,poly:`Poly.`,power:`Power`},At=[`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`],jt=new Set([`sunburst`,`treemap`]),Mt=new Set([`sunburst`,`treemap`,`funnel`]),Nt=(e,t)=>e===void 0?t:e,P=e=>({type:`solid`,color:e}),Pt=e=>e?.paragraphs?.[0]?.pPr?.defaultRun,Ft=(e,t)=>!(t.type!==`scatter`&&t.type!==`bubble`||e.axPos!==`b`&&e.axPos!==`t`),It=(e,t,n)=>{try{return h.getEngine().format(e||`General`,t,{date1904:n,placeholders:!0}).text??``}catch{return String(t)}},Lt=e=>e.points?.find(e=>e.idx===0)?.formatCode??e.formatCode??`General`,Rt=[`ctr`,`inEnd`,`inBase`,`outEnd`],zt=[`ctr`,`inEnd`,`inBase`],Bt=[`ctr`,`l`,`r`,`t`,`b`],Vt=[`ctr`,`inEnd`,`outEnd`,`bestFit`],Ht=e=>{switch(e.type){case`bar`:return e.is3D?[]:e.grouping===`stacked`||e.grouping===`percentStacked`?zt:Rt;case`line`:return e.is3D?[]:Bt;case`stock`:case`scatter`:case`bubble`:return Bt;case`pie`:case`ofPie`:return Vt;case`area`:case`doughnut`:case`radar`:case`surface`:return[];default:return null}},Ut=(e,t)=>{let n=Ht(e);return!t||n&&!n.includes(t)?(e=>{switch(e.type){case`bar`:return e.grouping===`stacked`||e.grouping===`percentStacked`?`ctr`:`outEnd`;case`area`:case`doughnut`:return`ctr`;case`pie`:case`ofPie`:return`bestFit`;case`radar`:return`outEnd`;default:return`r`}})(e):t},Wt=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n))r!==void 0&&e!==`labels`&&e!==`unknown`&&(t[e]=r);return t};function Gt(e,t,n){let r=(e.chart?.plotArea?.groups??[]).reduce((e,t)=>e+t.series.length,0);return T(t.parseColor(wt(e.style,n,r)))}var Kt=class{constructor(e,t,n){var r;this._model=e,this._theme=t,this._data=n,this._bins=new Map,this._css=e=>{try{return this.color(e)}catch{return null}},this._style=e.style,this._c14=(r=e,r.unknown?.elements?.some(e=>/<c14:style\b/.test(e.xml))??!1),this._spaceRun=Pt(e.txPr),this._date1904=e.date1904??!1,this._seriesCount=(e.chart?.plotArea?.groups??[]).reduce((e,t)=>e+t.series.length,0),this._chartEx=!j(e),this._textSize=this._chartEx?9:10,this._keys=(e=>{let t=new Map,n=0;for(let r of e?.groups??[])for(let e of r.series)t.set(e,e.idx===void 0?`#${n}`:String(e.idx)),n++;return t})(e.chart?.plotArea)}color(e){return T(this._theme.parseColor(e))}fill(e){if(!e||e.type===`group`)return;let t=E(e,this._css);return t===null&&e.type!==`none`?void 0:t}stroke(e,t){if(!e)return t;let n=this.fill(e.fill);if(n===null)return null;let r=e.lineCap,i=e.dash===void 0?t?.dash:c.toDashLengths(e.dash)?e.dash:void 0;return{fill:n??t?.fill??P(this.color(`tx1`)),width:typeof e.width==`number`?e.width:t?.width??.75,lineCap:r===`round`||r===`square`?r:`butt`,...i===void 0?{}:{dash:i}}}line(e,t,n,r){return{fill:P(e),width:t,lineCap:n,...r===void 0?{}:{dash:r}}}hairline(){return this.line(this.color(`tx1 lumMod 15 lumOff 85`),.75,`butt`)}font(e,t){let n=[...e,this._spaceRun].filter(e=>!!e),r=e=>{for(let t of n)if(t[e]!==void 0)return t[e]},i=r(`weight`),a=r(`style`),o=this.fill(r(`color`));return{family:this.typeface(r(`latin`)),size:r(`size`)??t.size,bold:i===void 0?t.bold:Number(i)>=600,italic:a!==void 0&&a===`italic`,color:o??P(this.color(this._chartEx?`tx1 lumMod 65 lumOff 35`:`tx1`))}}typeface(e){return e&&e!==s.ThemeFamily.Body?e===s.ThemeFamily.Heading?this._theme.majorFont():e:this._theme.minorFont()}textFont(e,t){let n=e.tx?.rich;return this.font([n?.paragraphs?.[0]?.runs?.[0]?.rPr,Pt(n),Pt(e.txPr)],t)}title(e,t,n){let r=t;e.tx?.rich?r=be(e.tx.rich):e.tx?.strRef?r=this._data?.text(e.tx.strRef)??e.tx.strRef.cache?.points?.[0]?.v??``:e.tx?.v!==void 0&&(r=e.tx.v);let i={text:r,font:this.textFont(e,n),fill:this.fill(e.spPr?.fill)??null,border:this.stroke(e.spPr?.stroke,null),overlay:e.overlay??!1};if(n.rotation!==void 0){let t=e.tx?.rich?.bodyPr?.rotation??e.txPr?.bodyPr?.rotation;i.rotation=t===void 0||t<=-1e3?n.rotation:t===0?0:-t}return i}chartTitle(){let e=this._model.chart,t=this._chartEx?{size:14,bold:!1}:{size:this._c14?18:10,bold:!0},n=this.allSeries();return e.title?this.title(e.title,n.length!==1||this._chartEx?`Chart Title`:this.seriesName(n[0]),t):j(this._model)&&!0!==e.autoTitleDeleted&&n.length===1?this.title({},this.seriesName(n[0]),t):null}allSeries(){return(this._model.chart?.plotArea?.groups??[]).flatMap(e=>e.series)}seriesName(e){return e.tx?.strRef?this._data?.text(e.tx.strRef)??e.tx.strRef.cache?.points?.[0]?.v??``:e.tx?.v===void 0?`Series${(e.idx??0)+1}`:e.tx.v}blank(){return this._model.chart?.dispBlanksAs===`zero`?0:null}referenceOf(e){return e?.numRef??e?.strRef??e?.multiLvlStrRef??null}cachePoints(e){if(!e)return null;if(e.numRef?.cache)return{cache:e.numRef.cache,kind:`num`};if(e.numLit)return{cache:e.numLit,kind:`num`};if(e.strRef?.cache)return{cache:e.strRef.cache,kind:`str`};if(e.strLit)return{cache:e.strLit,kind:`str`};let t=e.multiLvlStrRef?.cache?.levels;return t?.length?{cache:{points:t[0].points,ptCount:e.multiLvlStrRef?.cache?.ptCount},kind:`str`}:null}count(e){let t=e.ptCount??0;for(let n of e.points??[])t=Math.max(t,n.idx+1);return t}values(e){let t=this.blank(),n=this.referenceOf(e),r=n?this._data?.values(n):null;if(r)return t===null?r:r.map(e=>e??t);let i=this.cachePoints(e);if(!i)return[];let a=Array(this.count(i.cache)).fill(t);for(let e of i.cache.points??[]){let n=Number(e.v);a[e.idx]=e.v!==``&&Number.isFinite(n)?n:t}return a}categories(e){let t=this.categoryLevels(e);if(t)return t[0];let n=this.referenceOf(e),r=n&&!e?.multiLvlStrRef?this._data?.categories(n):null;if(r)return r;let i=this.cachePoints(e);if(!i)return[];let a=Array(this.count(i.cache)).fill(``);for(let e of i.cache.points??[]){if(i.kind===`str`){a[e.idx]=e.v;continue}let t=Number(e.v);a[e.idx]=Number.isFinite(t)?It(e.formatCode??i.cache.formatCode??`General`,t,this._date1904):e.v}return a}categoryLevels(e){let t=e?.multiLvlStrRef;if(!t)return null;let n=this._data?.levels?.(t)??null;if(!n){let e=t.cache;if(!e?.levels)return null;let r=e.levels.reduce((t,n)=>Math.max(t,this.count({points:n.points,ptCount:n.ptCount??e.ptCount})),0);n=e.levels.map(e=>{let t=Array(r).fill(``);for(let n of e.points??[])t[n.idx]=n.v;return t})}return n.length>0?n:null}levelsOf(e,t=!1){let n=this.categoryLevels(e)??(t&&e?.strRef?this._data?.levels?.(e.strRef)??null:null);return n&&n.length>1?{categoryLevels:n}:{}}series(e,t){let n=e.type===`line`||e.type===`stock`||e.type===`scatter`||e.type===`radar`,r=t.idx??(Number(this._keys.get(t)?.replace(`#`,``))||0),i=this.color(wt(this._style,r,this._seriesCount)),a=this.fill(t.spPr?.fill),o=n?null:a===void 0?P(i):a,s=t.spPr?.stroke?.width??function(e){let t=Math.ceil(Ct(e)/8);return t===1?3:t===4?7:5}(this._style),c=n?this.stroke(t.spPr?.stroke,this.line(i,s,`round`)):this.stroke(t.spPr?.stroke,null),l=t.marker?.symbol,u=!l||l===`auto`,d=t.marker?.size??(u?Math.floor(2*s+3):5),f=null;if(n&&!1!==e.marker&&l!==`none`&&l!==`picture`){let e=u?Dt[r%Dt.length]:l;f={symbol:e,size:d,fill:Nt(this.fill(t.marker?.spPr?.fill),Ot.has(e)?null:P(i)),stroke:this.stroke(t.marker?.spPr?.stroke,this.line(i,.75,`butt`))}}let p=jt.has(e.type)?t.bubbleSize??t.val:t.val??t.yVal,m=this.cachePoints(p),h=this.referenceOf(p),g=this.values(p),_=this.levelsOf(t.cat,jt.has(e.type)),v={id:`s${this._keys.get(t)??r}`,idx:r,order:t.order??r,name:this.seriesName(t),values:g,categories:_.categoryLevels?_.categoryLevels[0]:this.categories(t.cat??t.xVal),...this.categoryValues(t.cat),..._,formatCode:h&&this._data?.formatCode(h)||(m?Lt(m.cache):`General`),fill:o,stroke:c,marker:f,smooth:t.smooth??!1,markerSize:d};if(e.type!==`scatter`&&e.type!==`bubble`||(v.xValues=this.xValues(t.xVal,g.length)),e.type===`waterfall`){let e=this.waterfall(t);v.points=this.waterfallPoints(t,g,e),v.fill=e.increase.fill,v.stroke=e.increase.stroke}e.type===`bubble`&&(v.bubbleSizes=t.bubbleSize?this.values(t.bubbleSize):g.map(()=>1)),e.type===`histogram`&&this._bins.set(v,this.binSeries(t,v)),e.type===`boxWhisker`&&this.boxSeries(t,v),e.type!==`pie`&&e.type!==`doughnut`||(v.points=this.points(e,t,g.length,o,c)),e.type===`ofPie`&&(v.points=this.points(e,t,g.length+1,o,c));let y=this.labels(e,t,v);y&&(v.labels=y);let b=!!e.axIds?.length&&(this._model.chart?.plotArea?.axes??[]).some(t=>t.type===`date`&&e.axIds.includes(t.axId)),x=(t.trendlines??[]).map(e=>this.trendline(e,v,i,b));x.length>0&&(v.trendlines=x);let S=(t.errBars??[]).map(e=>this.errorBars(e,v));return S.length>0&&(v.errorBars=S),v}errorBars(e,t){let n=e.errDir===`x`?`x`:`y`,r=n===`x`?t.xValues??t.values.map((e,t)=>t+1):t.values,i=r.filter((e,n)=>e!==null&&t.values[n]!==null),a=i.length,o=a>0?i.reduce((e,t)=>e+t,0)/a:0,s=a>1?Math.sqrt(i.reduce((e,t)=>e+(t-o)**2,0)/(a-1)):0,c=e.val??0,l=e.errValType===`cust`?this.values(e.plus):[],u=e.errValType===`cust`?this.values(e.minus):[],d=e.errBarType!==`minus`,f=e.errBarType!==`plus`,p=r.map((n,r)=>{if(n===null||t.values[r]===null)return null;let i,o;switch(e.errValType){case`percentage`:i=o=Math.abs(n)*c/100;break;case`stdDev`:i=o=c*s;break;case`stdErr`:i=o=a>0?s/Math.sqrt(a):0;break;case`cust`:i=u[r]??0,o=l[r]??0;break;default:i=o=c}return{minus:f?i:0,plus:d?o:0}}),m=e.spPr?this.stroke(e.spPr.stroke,this.line(this.color(`tx1 lumMod 65 lumOff 35`),.75,`butt`)):this.unstatedLine();return{direction:n,about:e.errValType===`stdDev`?o:`point`,amounts:p,cap:!0!==e.noEndCap,stroke:m}}trendline(e,t,n,r=!1){let i=[],a=[];t.values.forEach((e,n)=>{let o=t.xValues?t.xValues[n]:r?t.categoryValues?.[n]:n+1;e!==null&&o!=null&&(i.push(o),a.push(e))});let o=e.trendlineType,s=o===`movingAvg`?null:function(e,t,n,r={}){let i=t.slice(),a=n.slice();if(i.length<2)return null;let o,s=null;switch(e){case`linear`:case`poly`:{s=je(i,a,e===`linear`?1:Math.max(2,Math.min(6,Math.round(r.order??2))),r.intercept);let t=s;o=e=>((e,t)=>{let n=0;for(let r=e.length-1;r>=0;r--)n=n*t+e[r];return n})(t,e);break}case`exp`:{if(a.some(e=>!(e>0))||r.intercept!==void 0&&!(r.intercept>0))return null;let e=je(i,a.map(Math.log),1,r.intercept===void 0?void 0:Math.log(r.intercept));s=e?[Math.exp(e[0]),e[1]]:null;let t=s;o=e=>t[0]*Math.exp(t[1]*e);break}case`log`:{if(i.some(e=>!(e>0)))return null;let e=je(i.map(Math.log),a,1);s=e?[e[1],e[0]]:null;let t=s;o=e=>t[0]*Math.log(e)+t[1];break}case`power`:{if(i.some(e=>!(e>0))||a.some(e=>!(e>0)))return null;let e=je(i.map(Math.log),a.map(Math.log),1);s=e?[Math.exp(e[0]),e[1]]:null;let t=s;o=e=>t[0]*e**t[1];break}}return!s||s.some(e=>!Number.isFinite(e))?null:{type:e,coefficients:s,rSquared:Ae(a,i.map(o)),at:o}}(o,i,a,{order:e.order,intercept:e.intercept}),l=e.period??2,u=Math.max(0,e.forward??0),d=Math.max(0,e.backward??0),f=e.name??`${o===`movingAvg`?`${l} per. Mov. Avg.`:kt[o]} (${t.name})`,p=e.spPr?this.stroke(e.spPr.stroke,this.line(n,1.5,`round`,c.DashStyle.SysDot)):this.stroke(void 0,this.line(`#000000`,this._c14?1:.5,`round`)),m=null;if(s&&(e.dispEq||e.dispRSqr)){let t=e.trendlineLbl,n=t?.numFmt?.formatCode,r=n&&n!==`General`?e=>It(n,e,this._date1904):Pe,i=[];e.dispEq&&i.push(function(e,t){let n=e.coefficients;switch(e.type){case`exp`:return[{text:`y = ${t(n[0])}e`},{text:`${t(n[1])}x`,superscript:!0}];case`log`:return[{text:`y = ${t(n[0])}ln(x)${Ie(n[1],t)}`}];case`power`:return[{text:`y = ${t(n[0])}x`},{text:t(n[1]),superscript:!0}];default:{let e=[],r=`y = `;for(let i=n.length-1;i>=1;i--)r+=i===n.length-1?t(n[i]):Ie(n[i],t),r+=`x`,i>1&&(e.push({text:r},{text:String(i),superscript:!0}),r=``);return e.push({text:r+Ie(n[0],t)}),e}}}(s,r)),e.dispRSqr&&i.push([{text:Le(s,r)}]);let a=t?.layout?.manualLayout;m={lines:i,...!a||a.x===void 0&&a.y===void 0?{}:{moved:{x:a.x??0,y:a.y??0,xEdge:a.xMode===`edge`,yEdge:a.yMode===`edge`}},font:this.font([Pt(t?.txPr)],{size:this._textSize,bold:!1}),fill:this.fill(t?.spPr?.fill)??null,border:this.stroke(t?.spPr?.stroke,null)}}return{name:f,type:o,fit:s,...o===`movingAvg`?{average:Me(i,a,l)}:{},from:i.length>0?Math.min(...i)-d:0,to:i.length>0?Math.max(...i)+u:0,forward:u,stroke:p,label:m}}labels(e,t,n){let r=t.dLbls;if(r?.delete)return null;let i=new Map((r?.labels??[]).map(e=>[e.idx,e])),a=Wt(e.dLbls,r);if(!this.showsAny(a,e)&&i.size===0)return null;let o=e.type===`pie`||e.type===`doughnut`||e.type===`ofPie`,s=o?n.values.reduce((e,t)=>e+(t===null?0:Math.abs(t)),0):0,c=!1,l=n.values.map((t,l)=>{let u=i.get(l);if(u?.delete||t===null)return null;let d=u?Wt(a,u):a;if(!this.showsAny(d,e))return null;let f=[];if(d.showSerName&&f.push(n.name),d.showCatName&&f.push(n.categories[l]??String(l+1)),d.showVal){let e=d.numFmt&&!d.numFmt.sourceLinked?d.numFmt.formatCode:n.formatCode;f.push(It(e,t,this._date1904))}return d.showPercent&&o&&f.push(It(`0%`,s>0?Math.abs(t)/s:0,this._date1904)),c=!0,{text:f.join((d.separator??`, `).replace(/\r\n?/g,`
5
+ `)),position:Ut(e,d.dLblPos),font:this.labelFont(e,[Pt(u?.txPr),Pt(r?.txPr),Pt(e.dLbls?.txPr)]),fill:this.fill(d.spPr?.fill)??null,border:this.stroke(d.spPr?.stroke,null)}});return c?l:null}labelFont(e,t){let n=this.font(t,{size:this._textSize,bold:!1});return!Mt.has(e.type)||t.some(e=>e?.color!==void 0)||this._spaceRun?.color!==void 0?n:{...n,color:P(this.color(`bg1`))}}showsAny(e,t){let n=t.type===`pie`||t.type===`doughnut`||t.type===`ofPie`;return!!(e.showVal||e.showCatName||e.showSerName||e.showPercent&&n)}categoryValues(e){if(!e?.numRef&&!e?.numLit)return{};let t=this.referenceOf(e),n=t?this._data?.values(t):null;if(n)return{categoryValues:n};let r=this.cachePoints(e);if(!r)return{};let i=Array(this.count(r.cache)).fill(null);for(let e of r.cache.points??[]){let t=Number(e.v);e.v!==``&&Number.isFinite(t)&&(i[e.idx]=t)}return{categoryValues:i}}xValues(e,t){let n=e?.numRef||e?.numLit?this.values(e):[],r=Array.from({length:Math.max(t,n.length)},(e,t)=>t+1);return n.length===0||n.forEach((e,t)=>{r[t]=e}),r}points(e,t,n,r,i){let a=new Map((t.points??[]).map(e=>[e.idx,e])),o=e.varyColors??!1,s=this.fill(t.spPr?.fill)!==void 0;return Array.from({length:n},(e,c)=>{let l=a.get(c),u=this.fill(l?.spPr?.fill),d=s||!o?r:P(this.color(wt(this._style,c,n)));return{fill:u===void 0?d:u,stroke:this.stroke(l?.spPr?.stroke,i),explosion:l?.explosion??t.explosion??0}})}surface(e,t){let n=t.flatMap(e=>e.values.filter(e=>e!==null)),r=(this._model.chart?.plotArea?.axes??[]).find(t=>t.type===`val`&&e.axIds.includes(t.axId)),[i,a]=n.length?[Math.min(...n),Math.max(...n)]:[0,1],o=e=>qe(i,a,r?.scaling?.min,r?.scaling?.max,r?.minorUnit,e,!1,0,.05),s=o(r?.majorUnit);if(r?.majorUnit===void 0){let e=Je(s.majorUnits,o,e=>e.length-1<=5);e!==s.majorUnits&&(s=o(e))}let c=Xe(s.min,s.max,s.majorUnits),l=new Map((e.bandFmts??[]).map(e=>[e.idx,e])),u=Math.max(1,c.length-1),d=t[0]?.formatCode??`General`,f=c.slice(0,-1).map((t,n)=>{let r=c[n+1],i=l.get(n)?.spPr,a=this.color(wt(this._style,n,u));return{from:t,to:r,text:`${It(d,t,this._date1904)}-${It(d,r,this._date1904)}`,fill:e.wireframe?null:Nt(this.fill(i?.fill),P(a)),stroke:e.wireframe?this.stroke(i?.stroke,this.line(a,.75,`round`)):null}});return{wireframe:!!e.wireframe,flat:!!e.is3D,min:s.min,max:s.max,majorUnit:s.majorUnits,bands:f}}groups(){let e=this._model.chart?.plotArea?.groups??[];return e.map(e=>{let t=[...e.series].filter(e=>!this._chartEx||!e.hidden).sort((e,t)=>(e.order??0)-(t.order??0)),n=t.map(t=>this.series(e,t)),r=t[0];return{type:e.type,...e.custom?{custom:e.custom}:{},barDir:e.barDir??`col`,grouping:e.grouping??(e.type===`bar`?`clustered`:`standard`),gapWidth:e.gapWidth??this.chartExGapWidth()??150,overlap:e.overlap??(e.grouping===`stacked`||e.grouping===`percentStacked`?100:0),varyColors:e.varyColors??!1,firstSliceAng:e.firstSliceAng??0,holeSize:e.holeSize??10,axIds:this._chartEx?this.chartExAxisIds():e.axIds,...e.type===`waterfall`?{waterfall:this.waterfall(r)}:{},...jt.has(e.type)&&r?{hierarchy:this.hierarchy(r)}:{},...e.type===`treemap`&&r?{treemap:this.treemap(e,r)}:{},...e.type===`histogram`&&r&&n[0]?{histogram:this.histogram(r,n[0])}:{},series:n,...this.analysisLines(e),...e.type===`radar`?{radarStyle:e.radarStyle??`standard`}:{},...e.type===`bubble`?{bubble:{scale:e.bubbleScale??100,sizeRepresents:e.sizeRepresents??`area`,showNegative:e.showNegBubbles??!1}}:{},...e.type===`ofPie`?{ofPie:{of:e.ofPieType??`pie`,splitType:e.splitType??`auto`,...e.splitPos===void 0?{}:{splitPos:e.splitPos},custSplit:e.custSplit??[],secondSize:e.secondPieSize??75}}:{}}}).map((t,n)=>t.type===`surface`?{...t,surface:this.surface(e[n],t.series)}:t)}binSeries(e,t){let n=t.values,r=e.layoutPr?.binning?.intervalClosed??`r`,i,a,o;if(e.layoutPr?.aggregation){let e=[],r=[];n.forEach((n,i)=>{let a=t.categories[i]??``,o=e.indexOf(a);o===-1&&(o=e.length,e.push(a),r.push([])),n!==null&&r[o].push(i)}),i=e.map((e,t)=>({kind:`bin`,from:null,to:null,points:r[t]})),a=e,o=i.map(e=>e.points.reduce((e,t)=>e+(n[t]??0),0))}else{let s=e.layoutPr?.binning,c=e=>typeof e==`number`?e:void 0;i=function(e,t){let n=e.map((e,t)=>({value:e,k:t})).filter(e=>e.value!==null&&Number.isFinite(e.value));if(n.length===0)return[];let r=n.map(e=>e.value),i=Math.min(...r),a=Math.max(...r),o=t.intervalClosed!==`l`,{underflow:s,overflow:c}=t,l=s??i,u=c??a,d;d=t.binSize!==void 0&&t.binSize>0?t.binSize:t.binCount!==void 0&&t.binCount>0?(u-l)/t.binCount||5:Oe(r);let f=Math.max(0,u-l),p;p=t.binCount!==void 0&&t.binCount>0&&t.binSize===void 0?t.binCount:o?Math.max(1,Math.ceil(f/d-1e-9)):Math.floor(f/d+1e-9)+1,c!==void 0&&(p=Math.max(1,Math.ceil(f/d-1e-9)));let m=e=>De(l+e*d,12),h=[];s!==void 0&&h.push({kind:`underflow`,from:null,to:s,points:[]});for(let e=0;e<p;e++){let t=m(e),n=c===void 0?m(e+1):Math.min(m(e+1),c);h.push({kind:`bin`,from:t,to:n,points:[]})}c!==void 0&&h.push({kind:`overflow`,from:c,to:null,points:[]});let g=h.findIndex(e=>e.kind===`bin`),_=h.length-1-[...h].reverse().findIndex(e=>e.kind===`bin`);for(let{value:e,k:t}of n){let n=-1;if(s!==void 0&&(o?e<=s:e<s))n=0;else if(c!==void 0&&(o?e>c:e>=c))n=h.length-1;else{for(let t=g;t<=_;t++){let{from:r,to:i}=h[t];if(o?(t===g?e>=r:e>r)&&e<=i:e>=r&&(t===_?e<=i:e<i)){n=t;break}}n===-1&&(n=e<h[g].from?g:_)}h[n].points.push(t)}return h}(n,{intervalClosed:r,binSize:s?.binSize,binCount:s?.binCount,underflow:c(s?.underflow),overflow:c(s?.overflow)});let l=e=>It(t.formatCode,e,this._date1904);a=i.map((e,t)=>function(e,t,n,r){let i=e[t],a=n!==`l`;if(i.kind===`underflow`)return`${a?`≤`:`<`} ${r(i.to)}`;if(i.kind===`overflow`)return`${a?`>`:`≥`} ${r(i.from)}`;let o=a?`]`:`)`;return`${a&&t>0?`(`:`[`}${r(i.from)}, ${r(i.to)}${o}`}(i,t,r,l)),o=i.map(e=>e.points.length)}if(e.cumulativeLine){let e=o.map((e,t)=>t).sort((e,t)=>o[t]-o[e]);i=e.map(e=>i[e]),a=e.map(e=>a[e]),o=e.map(e=>o[e])}return t.raw=n,t.values=o,t.categories=a,delete t.categoryLevels,delete t.categoryValues,i}histogram(e,t){let n=e.cumulativeLine,r=(this._model.chart?.plotArea?.axes??[]).filter(e=>e.type===`val`),i={bins:this._bins.get(t)??[],intervalClosed:e.layoutPr?.binning?.intervalClosed??`r`,byCategory:!!e.layoutPr?.aggregation};if(n){let t=this._keys.get(e)??String(e.idx??0),a=n.axIds?.[0]??r[1]?.axId??r[0]?.axId??0;i.cumulative={id:`s${t}-line`,name:this.seriesName(n),axisId:a,stroke:this.stroke(n.spPr?.stroke,this.line(this.color(`accent2`),2.25,`round`))}}return i}boxSeries(e,t){let n=[],r=[],i=t.categories.length>0;t.values.forEach((e,a)=>{let o=i?t.categories[a]??``:`1`,s=n.indexOf(o);s===-1&&(s=n.length,n.push(o),r.push([])),r[s].push(e)});let a=e.layoutPr?.statistics?.quartileMethod??`exclusive`,o=e.layoutPr?.visibility;t.boxes=r.map(e=>function(e,t){let n=e.filter(e=>e!==null&&Number.isFinite(e));if(n.length===0)return null;let r=[...n].sort((e,t)=>e-t),i=ke(r,.25,t),a=ke(r,.5,`inclusive`),o=ke(r,.75,t),s=1.5*(o-i),c=i-s,l=o+s,u=n.filter(e=>e>=c&&e<=l),d=n.filter(e=>e<c||e>l);return{count:n.length,min:r[0],max:r[r.length-1],q1:i,median:a,q3:o,mean:n.reduce((e,t)=>e+t,0)/n.length,whiskerLow:u.length>0?Math.min(...u):i,whiskerHigh:u.length>0?Math.max(...u):o,outliers:d,inliers:u}}(e,a)),t.values=t.boxes.map(e=>e?e.median:null),t.categories=n,delete t.categoryLevels,delete t.categoryValues,t.box={quartileMethod:a,meanMarker:o?.meanMarker??!0,meanLine:o?.meanLine??!1,outliers:o?.outliers??!0,innerPoints:o?.nonoutliers??!1,line:this.line(this.shade(t.fill,.8),.75,`butt`)}}treemap(e,t){return{parentLabels:t.layoutPr?.parentLabelLayout??`overlapping`,font:this.labelFont(e,[Pt(t.dLbls?.txPr),Pt(e.dLbls?.txPr)]),bannerFill:P(this.color(`bg1 lumMod 65`))}}shade(e,t){let n=(e&&e.type===`solid`?e.color:void 0)?.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);if(!n)return this.color(`tx1`);let[r,i,a]=[n[1],n[2],n[3]].map(e=>parseInt(e,16)/255),o=Math.max(r,i,a),s=Math.min(r,i,a),c=(o+s)/2,l=o-s,u=l===0?0:l/(1-Math.abs(2*c-1)),d=0;l!==0&&(d=o===r?(i-a)/l%6:o===i?(a-r)/l+2:(r-i)/l+4,d=(60*d+360)%360);let f=Math.min(1,Math.max(0,c*t)),p=(1-Math.abs(2*f-1))*u,m=p*(1-Math.abs(d/60%2-1)),h=f-p/2,[g,_,v]=d<60?[p,m,0]:d<120?[m,p,0]:d<180?[0,p,m]:d<240?[0,m,p]:d<300?[m,0,p]:[p,0,m],y=e=>Math.round(255*(e+h)).toString(16).padStart(2,`0`).toUpperCase();return`#${y(g)}${y(_)}${y(v)}`}chartExGapWidth(){if(!this._chartEx)return;let e=(this._model.chart?.plotArea?.axes??[]).find(e=>e.type!==`val`)?.scaling?.gapWidth;return typeof e==`number`?100*e:void 0}chartExAxisIds(){let e=this._model.chart?.plotArea?.axes??[];return[e.find(e=>e.type!==`val`),e.find(e=>e.type===`val`)].filter(e=>!!e).map(e=>e.axId)}unstatedLine(){return this.line(`#000000`,this._c14?1:.5,`butt`)}analysisLines(e){let t=e=>this.stroke(e?.spPr?.stroke,this.unstatedLine()),n=(e,n)=>({fill:Nt(this.fill(e?.spPr?.fill),P(n)),stroke:t(e)}),r={},i=e.type===`line`||e.type===`stock`;return i&&e.upDownBars&&(r.upDownBars={gapWidth:e.upDownBars.gapWidth??150,up:n(e.upDownBars.upBars,`#FFFFFF`),down:n(e.upDownBars.downBars,`#3F3F3F`)}),i&&e.hiLowLines&&(r.hiLowLines=t(e.hiLowLines)),(i||e.type===`area`)&&e.dropLines&&(r.dropLines=t(e.dropLines)),e.type!==`bar`&&e.type!==`ofPie`||!e.serLines?.length||(r.seriesLines=t(e.serLines[0])),r}linkedFormat(e,t){for(let n of t){if(!n.axIds.includes(e.axId))continue;let t=n.series[0];if(!t)continue;if(e.type===`val`&&!Ft(e,n))return n.grouping===`percentStacked`?`0%`:t.formatCode;let r=this._model.chart.plotArea.groups.flatMap(e=>e.series).find(e=>e.idx===t.idx),i=r?.cat??r?.xVal,a=this.referenceOf(i),o=a?this._data?.formatCode(a):null;if(o)return o;let s=this.cachePoints(i);return s?.kind===`num`?Lt(s.cache):`General`}return`General`}axes(e){let t=Tt(this._style),n=this._model.chart?.plotArea?.axes??[];return n.map(r=>{let i=r.numFmt,a=r.dispUnits?.builtInUnit===`percentage`,o=a?`0%`:!i||i.sourceLinked?this.linkedFormat(r,e):i.formatCode,s=n.find(e=>e.axId===r.crossAx),c=r.txPr?.bodyPr?.rotation,l=this.line(this.color(t.axis),.75,`butt`),u=this._chartEx?this.chartExAxis(r,n):null,d=u?.position??((e,t)=>{let n=e.axPos??`b`,r=t.find(t=>t.axIds.includes(e.axId));if(!r||!qt.has(r.type)||e.type!==`cat`&&e.type!==`date`&&e.type!==`val`)return n;let i=r.type===`bar`&&r.barDir===`bar`?`vertical`:`horizontal`,a=e.type===`val`?i===`vertical`?`horizontal`:`vertical`:i;return(n===`b`||n===`t`?`horizontal`:`vertical`)===a?n:a===`horizontal`?`b`:`l`})(r,e),f=!!u&&r.type!==`val`&&e.some(e=>e.type===`funnel`);return{id:r.axId,crossAx:u?.crossAx??r.crossAx??r.axId,type:r.type,position:d,deleted:r.delete??!1,line:this.stroke(r.spPr?.stroke,u?f?this.hairline():null:l),majorGridlines:r.majorGridlines?this.stroke(r.majorGridlines.spPr?.stroke,this.hairline()):null,minorGridlines:r.minorGridlines?this.stroke(r.minorGridlines.spPr?.stroke,this.hairline()):null,majorTickMark:r.majorTickMark??(u?`none`:`cross`),minorTickMark:r.minorTickMark??(u?`none`:`cross`),tickLblPos:r.tickLblPos??(u&&r.type!==`val`?`low`:`nextTo`),labelFont:this.font([Pt(r.txPr)],{size:this._textSize,bold:!1}),labelRotation:c===void 0||c<=-1e3?void 0:c===0?0:-c,labelSkip:r.tickLblSkip,multiLevel:!r.noMultiLvlLbl,formatCode:o,orientation:r.scaling?.orientation??`minMax`,min:r.scaling?.min,max:r.scaling?.max,majorUnit:r.majorUnit,minorUnit:r.minorUnit,logBase:r.scaling?.logBase,baseTimeUnit:r.baseTimeUnit,majorTimeUnit:r.majorTimeUnit,minorTimeUnit:r.minorTimeUnit,crosses:u?.crosses??r.crosses??`autoZero`,crossesAt:r.crossesAt,crossBetween:r.crossBetween??s?.crossBetween??`between`,displayUnit:a?void 0:r.dispUnits?.custUnit??r.dispUnits?.builtInUnit,displayUnitLabel:this.displayUnitLabel(r,d),labelOffset:r.lblOffset??100,labelVertical:r.txPr?.bodyPr?.vert===`wordArtVert`,title:r.title?this.title(r.title,`Axis Title`,{size:(this._chartEx,10),bold:!this._chartEx,rotation:d===`l`||d===`r`?90:0}):null}})}displayUnitLabel(e,t){let n=e.dispUnits,r=n?.dispUnitsLbl,i=n?.custUnit??n?.builtInUnit;if(!r||i===void 0||i===`none`)return null;let a=typeof i==`string`?Ee[i]:void 0,o=typeof i==`number`?`x ${i}`:a?/^\d+$/.test(a.description)?`x ${a.description}`:a.description:i;return this.title(r,o,{size:10,bold:!1,rotation:t===`l`||t===`r`?90:0})}chartExAxis(e,t){let n=t.find(e=>e.type!==`val`),r=t.filter(e=>e.type===`val`);if(e.type!==`val`)return{position:`b`,crossAx:r[0]?.axId??e.axId};let i=r.indexOf(e)>0;return{position:i?`r`:`l`,crossAx:n?.axId??e.axId,...i?{crosses:`max`}:{}}}waterfall(e){let t=this.fill(e?.spPr?.fill),n=this.stroke(e?.spPr?.stroke,null),r=e=>({fill:t===void 0?P(this.color(e)):t,stroke:n});return{increase:r(`accent1`),decrease:r(`accent2`),total:r(`accent3`),connectorLines:!1===e?.layoutPr?.visibility?.connectorLines?null:this.hairline()}}hierarchy(e){let t=this.levelsOf(e.cat,!0).categoryLevels,n=t?t[t.length-1]:this.categories(e.cat),r=[];for(let e of n)e&&!r.includes(e)&&r.push(e);let i=this.fill(e.spPr?.fill);return{branches:r.map((e,t)=>({name:e,fill:i===void 0?P(this.color(At[t%At.length])):i})),border:this.stroke(e.spPr?.stroke,this.line(this.color(`bg1`),1.5,`butt`))}}waterfallPoints(e,t,n){let r=new Map((e.points??[]).map(e=>[e.idx,e]));return t.map((e,t)=>{let i=r.get(t),a=!0===i?.subtotal,o=a?n.total:(e??0)<0?n.decrease:n.increase,s=this.fill(i?.spPr?.fill);return{fill:s===void 0?o.fill:s,stroke:this.stroke(i?.spPr?.stroke,o.stroke),explosion:0,...a?{total:a}:{}}})}legend(e,t){let r=this._model.chart?.legend;if(!r)return null;let i=new Set((r.entries??[]).filter(e=>e.delete).map(e=>e.idx)),a=e[0]?.waterfall;if(a&&e.every(e=>e.type===`waterfall`)){let t=e[0].series[0]?.id??``,o=[{text:n(`chart.waterfall.increase`),swatch:a.increase},{text:n(`chart.waterfall.decrease`),swatch:a.decrease},{text:n(`chart.waterfall.total`),swatch:a.total}];return{...this.legendBox(r),entries:o.map(({text:e,swatch:n})=>({seriesId:t,text:e,key:`bar`,swatch:n})).filter((e,t)=>!i.has(t))}}let o=e[0]?.hierarchy;if(o&&e.every(e=>e.type===`sunburst`||e.type===`treemap`)){let t=e[0].series[0]?.id??``;return{...this.legendBox(r),entries:o.branches.map(({name:e,fill:n})=>({seriesId:t,text:e,key:`bar`,swatch:{fill:n,stroke:null}})).filter((e,t)=>!i.has(t))}}let s=e[0]?.surface;if(s&&e.every(e=>e.type===`surface`))return{...this.legendBox(r),entries:s.bands.map((t,n)=>({seriesId:e[0].series[0]?.id??``,bandIndex:n,text:t.text,key:`bar`})).filter(e=>!i.has(e.bandIndex))};let c=e.length===1&&e[0].series.length===1?e[0].series[0]:null;if(c&&e[0].varyColors)return{...this.legendBox(r),entries:c.values.map((e,t)=>({seriesId:c.id,pointIndex:t,text:c.categories[t]??String(t+1),key:`bar`})).filter(e=>!i.has(e.pointIndex))};let l=this.legendBox(r),u=e.flatMap(e=>e.series.map(t=>({group:e,series:t}))).sort((e,t)=>e.series.order-t.series.order).filter(e=>!i.has(e.series.idx)),d=l.position!==`b`&&l.position!==`t`,f=e=>t.some(t=>e.axIds.includes(t.id)&&t.type!==`val`&&t.orientation===`maxMin`);for(let t of e){let e=t.grouping===`stacked`||t.grouping===`percentStacked`;if(t.type===`bar`&&t.barDir===`bar`?e||f(t):!e||!d)continue;let n=u.map((e,n)=>e.group===t?n:-1).filter(e=>e>=0),r=n.map(e=>u[e]).reverse();n.forEach((e,t)=>{u[e]=r[t]})}let p=u.map(e=>({seriesId:e.series.id,text:e.series.name,key:(e.group.type===`line`||e.group.type===`stock`||e.group.type===`scatter`||e.group.type===`radar`&&e.group.radarStyle!==`filled`)&&e.series.stroke?`line`:`bar`}));for(let{series:e}of u)(e.trendlines??[]).forEach((t,n)=>p.push({seriesId:e.id,trendlineIndex:n,text:t.name,key:`line`}));return{...l,entries:p}}legendBox(e){return{position:e.legendPos??`r`,overlay:e.overlay??!1,font:this.font([Pt(e.txPr)],{size:this._textSize,bold:!1}),fill:this.fill(e.spPr?.fill)??null,border:this.stroke(e.spPr?.stroke,null)}}resolve(){let e=this._model,t=e.chart?.plotArea,n=Tt(this._style).plotArea,r=this.groups(),i=this.axes(r);return{chartType:ye(e),...this._chartEx?{chartEx:!0}:{},font:this.font([],{size:this._textSize,bold:!1}),chartArea:{fill:this.fill(e.spPr?.fill),border:this.stroke(e.spPr?.stroke,this.hairline()),cornerRadius:!1===e.roundedCorners||this._chartEx&&!0!==e.roundedCorners?0:9.75},title:this.chartTitle(),plotArea:{fill:Nt(this.fill(t?.spPr?.fill),n?P(this.color(n)):null),border:this.stroke(t?.spPr?.stroke,null)},axes:i,groups:r,legend:this.legend(r,i),date1904:this._date1904,spanBlanks:this._model.chart?.dispBlanksAs===`span`}}},qt=new Set([`bar`,`line`,`area`,`stock`]);function Jt(e,t,n){return new Kt(e,t,n??null).resolve()}var Yt=/^\p{White_Space}$/u;function Xt(e=y.getShared()){let t=t=>e.getByName(t.family,{bold:t.bold,italic:t.italic}).table;return{width:(e,n)=>function(e,t,n){if(!e.isHinted)return e.width(t,n);let r=e.advance(32)??0,i=0;for(let n of t)i+=e.advance(n.codePointAt(0))??(Yt.test(n)?r:0);return i*n}(t(n),e,n.size),lineHeight:e=>{let n=t(e);if(n.typoLine!==null)return n.typoLine*e.size;let r=n.metrics(1e4);return(r.ascent+r.descent)/1e4*e.size}}}var Zt=96/72,Qt={perLine:.7564,offset:-4.5},$t={perLine:.5127,offset:-4.5},en=e=>.99*e-1.1,tn=e=>.6*e+.6,F=e=>e*Zt,I=e=>(e+4)*Zt,L=(e,t,n,r)=>({x:I(e),y:I(t),width:F(n),height:F(r)}),R=e=>({font:{family:e.family},size:F(e.size),color:e.color,weight:e.bold?700:400,style:e.italic?`italic`:`normal`}),z=e=>e?{...e,width:F(e.width)}:null,nn=e=>e?{symbol:e.symbol,size:F(e.size),fill:e.fill,stroke:z(e.stroke)}:null,rn=(e,t)=>e.logBase?t>0?(Math.log(t)-Math.log(e.min))/(Math.log(e.max)-Math.log(e.min)||1):null:(t-e.min)/(e.max-e.min||1),an=e=>e.grouping===`stacked`||e.grouping===`percentStacked`,B=e=>e.position===`b`||e.position===`t`,V=e=>!e.deleted&&e.tickLblPos!==`none`,on={b:`bottom`,l:`left`,r:`right`,t:`top`},sn=(e,t)=>{let n=e.axIds.map(e=>t.find(t=>t.id===e)).filter(e=>!!e),r=n.find(B),i=n.find(e=>!B(e));return r&&i?{x:r,y:i}:null},cn=(e,t,n)=>{let r=[[]];for(let t of e)t.text.split(` `).forEach((e,n)=>{n>0&&r.push([]),e&&r[r.length-1].push(t.superscript?{text:e,superscript:!0}:{text:e})});let i=[],a=[];for(let e of r.filter(e=>e.length>0)){let r=a.length>0?[...a,{text:` `},...e]:e;a.length>0&&n(r)>t?(i.push(a),a=e):a=r}return a.length>0&&i.push(a),i},H=(e,t)=>!!e&&t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height,ln=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}),un=(e,t)=>({x:e.x-t/2,y:e.y-t/2,width:t,height:t}),dn=e=>{let t=null;for(let n of e){if(!n)continue;if(!t){t={...n};continue}let e=Math.min(t.x,n.x),r=Math.min(t.y,n.y);t={x:e,y:r,width:Math.max(t.x+t.width,n.x+n.width)-e,height:Math.max(t.y+t.height,n.y+n.height)-r}}return t},fn=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)a&&(a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>r&&(r=a.x),a.y>i&&(i=a.y));return t===1/0?null:{x:t,y:n,width:r-t,height:i-n}},pn=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),mn=(e,t,n,r=!1)=>{let i=null,a=(r,a)=>{let o=t[r],s=t[a];if(!o||!s)return;let c=((e,t,n)=>{let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return pn(e,t);let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a));return pn(e,{x:t.x+o*r,y:t.y+o*i})})(e,o,s);c>n||i&&c>=i.distance||(i={index:pn(e,o)<=pn(e,s)?r:a,distance:c})};for(let e=1;e<t.length;e++)a(e-1,e);return r&&t.length>2&&a(t.length-1,0),i},hn=(e,t)=>{let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let a=t[r],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n},gn=(e,t,n)=>{let r=n*Math.PI/180;return{x:e.x+t*Math.sin(r),y:e.y-t*Math.cos(r)}},_n=e=>(e%360+360)%360,vn=(e,t)=>{let n=t.endAngle-t.startAngle;if(!(n>0))return!1;let r=pn(e,t.center);if(r<t.innerRadius||r>t.outerRadius)return!1;if(n>=360)return!0;let i=_n(t.startAngle);return _n(((e,t)=>_n(180*Math.atan2(t.x-e.x,-(t.y-e.y))/Math.PI))(t.center,e)-i)<=n},yn=e=>{let t=[];for(let n of[e.innerRadius,e.outerRadius])t.push(gn(e.center,n,e.startAngle),gn(e.center,n,e.endAngle));let n=e.endAngle-e.startAngle,r=_n(e.startAngle);for(let i of[0,90,180,270])(n>=360||_n(i-r)<=n)&&t.push(gn(e.center,e.outerRadius,i));return fn(t)},bn={types:[`bar`],coordinates:`cartesian`,drawn:e=>e.grouping!==`standard`,categoryAxis:e=>e.barDir===`bar`?`y`:`x`,layout:(e,t)=>{let{inner:n,index:r,base:i}=t,{category:a,value:o}=t.roles,s=t.scale(o),c=!B(a),l=e.series.length,u=e.overlap/100,d=(c?n.height:n.width)/t.categoryCount(a)/(l-(l-1)*u+e.gapWidth/100),f=d*(l-(l-1)*u),p=a.orientation===`maxMin`,m=t.crossValue(a,s),h=e=>{let n=Math.min(s.max,Math.max(s.min,e));return c?t.xOfValue(s,o,n):t.yOf(s,o,n)},{own:g,tops:_}=t.stack,v=an(e),y=[],b={type:`bar`,axisIds:[a.id,o.id],barDir:e.barDir,grouping:v?e.grouping:`clustered`,barWidth:F(d),overlap:e.overlap,gapWidth:e.gapWidth,series:e.series.map((e,n)=>{let r=_[n].map((e,r)=>{let i=t.pointSlot(a,r);if(e===null||i===null||s.logBase&&!(e>0))return null;let o=h(v?e-g[n][r]:m),l=h(e),_=n*d*(1-u);if(c){let e=t.yOfCategory(a,i),n=p?e-f/2+_:e+f/2-_-d;return{box:{x:Math.min(o,l),y:n,width:Math.abs(l-o),height:d},base:o,end:l}}let y=t.xOf(a,i);return{box:{x:p?y+f/2-_-d:y-f/2+_,y:Math.min(o,l),width:d,height:Math.abs(l-o)},base:o,end:l}});y.push(r);let l=t.labels.bars(e,r,c),b=t.errorBars(e,e=>{let t=r[e];return t?{x:t.box.x+t.box.width/2,y:t.box.y+t.box.height/2}:null},e=>e===`y`?{horizontal:c,toPt:e=>c?t.xOfValue(s,o,e):t.yOf(s,o,e),plotted:_[n]}:null);return{...i(e),marker:null,plotted:g[n],rects:r.map(e=>e?L(e.box.x,e.box.y,e.box.width,e.box.height):null),...l?{labels:l}:{},...b?{errorBars:b}:{}}})};if(v&&e.seriesLines!==void 0){let n=[];for(let e of y)for(let t=0;t+1<e.length;t++){let[r,i]=[e[t],e[t+1]];if(r&&i){if(c){let e=i.box.y>r.box.y;n.push([{x:r.end,y:e?r.box.y+r.box.height:r.box.y},{x:i.end,y:e?i.box.y:i.box.y+i.box.height}])}else{let e=i.box.x>r.box.x;n.push([{x:e?r.box.x+r.box.width:r.box.x,y:r.end},{x:e?i.box.x:i.box.x+i.box.width,y:i.end}])}}}b.seriesLines={id:`g${r}:series`,segments:t.segments(n),stroke:z(e.seriesLines)}}return b},hitTest:(e,t)=>{let n=e.series;for(let e=n.length-1;e>=0;e--){let r=n[e].rects;for(let n=r.length-1;n>=0;n--)if(H(r[n],t))return{series:e,point:n}}return null},pointBounds:(e,t,n)=>e.series[t]?.rects[n]??null},xn=e=>{let t=0;return e.values.map((n,r)=>{if(n===null)return null;if(e.points?.[r]?.total)return t=n,{from:0,to:n};let i=t;return t+=n,{from:i,to:t}})},Sn=(e,t,n)=>{let r=e.labels;if(!r)return;let i={left:0,top:0,right:0,bottom:0};return t.map((e,t)=>{let a=r[t];if(!e||!a)return null;let o=a.text.split(`
6
+ `),s=o.reduce((e,t)=>Math.max(e,n.text.width(t,a.font)),0),c=o.length*n.text.lineHeight(a.font),l=e.end<=e.base,u;switch(a.position){case`ctr`:u=e.box.y+(e.box.height-c)/2;break;case`inEnd`:u=l?e.end:e.end-c;break;case`inBase`:u=l?e.base-c:e.base;break;default:u=l?e.end-c:e.end}return u=Math.min(Math.max(u,n.inner.y-1),n.inner.y+n.inner.height+1-c),{text:a.text,rect:L(e.box.x+(e.box.width-s)/2,u,s,c),insets:i,font:R(a.font),fill:a.fill,border:z(a.border)}})},Cn={types:[`waterfall`],coordinates:`cartesian`,categoryAxis:()=>`x`,stack:e=>{let t=[],n=[];for(let r of e.series){let e=xn(r);t.push(e.map(e=>e?e.to-e.from:null)),n.push(e.map(e=>e?e.to:null))}return{own:t,tops:n}},layout:(e,t)=>{let{inner:n,index:r}=t,{category:i,value:a}=t.roles,o=t.scale(a),s=n.width/Math.max(1,t.categoryCount(i))/(1+e.gapWidth/100),c=i.orientation===`maxMin`,l=e=>t.yOf(o,a,Math.min(o.max,Math.max(o.min,e))),u=[],d={type:`waterfall`,axisIds:[i.id,a.id],barWidth:F(s),gapWidth:e.gapWidth,series:e.series.map((n,r)=>{let a=xn(n),o=a.map((e,n)=>{let r=t.pointSlot(i,n);if(!e||r===null)return null;let a=t.xOf(i,r),o=l(e.from),c=l(e.to);return{box:{x:a-s/2,y:Math.min(o,c),width:s,height:Math.abs(c-o)},base:o,end:c}});if(e.waterfall?.connectorLines)for(let e=0;e+1<o.length;e++){let[t,n]=[o[e],o[e+1]];if(!t||!n)continue;let[r,i]=c?[n,t]:[t,n];u.push([{x:r.box.x+r.box.width,y:t.end},{x:i.box.x,y:t.end}])}let d=Sn(n,o,t);return{...t.base(n),marker:null,plotted:a.map(e=>e?e.to:null),bars:o.map((e,t)=>{if(!e)return null;let r=n.points?.[t];return{rect:L(e.box.x,e.box.y,e.box.width,e.box.height),fill:r?r.fill:n.fill,stroke:z(r?r.stroke:n.stroke),total:!0===r?.total}}),...d?{labels:d}:{}}})};return e.waterfall?.connectorLines&&(d.connectorLines={id:`g${r}:connector`,segments:t.segments(u),stroke:z(e.waterfall.connectorLines)}),d},hitTest:(e,t)=>{let n=e.series;for(let e=n.length-1;e>=0;e--){let r=n[e].bars;for(let n=r.length-1;n>=0;n--)if(H(r[n]?.rect,t))return{series:e,point:n}}return null},pointBounds:(e,t,n)=>e.series[t]?.bars[n]?.rect??null},wn=e=>{let t=e.categoryLevels??[e.categories],n=[],r=0;return e.values.forEach((e,i)=>{if(e===null||!(e>0))return;let a=[];for(let e=t.length-1;e>=0;e--)a.push(t[e]?.[i]??``);for(;a.length>1&&a[a.length-1]===``;)a.pop();r=Math.max(r,a.length);let o=n;a.forEach((t,n)=>{let r=n===a.length-1,s=r?void 0:o.find(e=>e.name===t&&e.point===null);s||(s={name:t,level:n,value:0,point:r?i:null,branch:a[0],children:[]},o.push(s)),s.value+=e,o=s.children})}),{roots:n,depth:r}},Tn=(e,t,n)=>{let r=[],i=``,a=e=>{let a=i?`${i} ${e}`:e;for(n(a)<=t||!i?i=a:(r.push(i),i=e);n(i)>t&&i.length>1;){let e=i.length-1;for(;e>1&&n(i.slice(0,e))>t;)e--;r.push(i.slice(0,e)),i=i.slice(e)}};for(let t of e.split(/\s+/).filter(Boolean))a(t);return i&&r.push(i),r},En=(e,t,n,r,i,a)=>{let o=t.outer-t.inner,s=e=>a.text.width(e,i.font),c=Tn(e.name,o,s);if(c.length===0)return;let l=c.reduce((e,t)=>Math.max(e,s(t)),0),u=c.length*a.text.lineHeight(i.font);if(l>o+.1)return;let d=(t.start+t.end)/2,f=(t.inner+t.outer)/2,p=(t.end-t.start)*Math.PI/180*f;if(t.end-t.start<360&&p<l+6)return;let m=d*Math.PI/180,h=n+f*Math.sin(m),g=r-f*Math.cos(m),_=d<=180?90-d:270-d;return{text:c.join(`
7
+ `),rect:L(h-l/2,g-u/2,l,u),insets:{left:0,top:0,right:0,bottom:0},font:R(i.font),...Math.abs(_)>1e-9?{rotation:_}:{}}},Dn=(e,t)=>({center:e.center,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle}),On={types:[`sunburst`],coordinates:`plot`,layout:(e,t)=>{let{outer:n}=t,r=n.x+n.width/2,i=n.y+n.height/2,a=Math.max(0,Math.min(n.width,n.height)/2-.7),o=e.series.slice(0,1),s=new Map((e.hierarchy?.branches??[]).map(e=>[e.name,e.fill])),c=z(e.hierarchy?.border??null),l=a/2,u=o.map(e=>{let{roots:n,depth:o}=wn(e),u=a/(Math.max(1,o)+1);l=u;let d=n.reduce((e,t)=>e+t.value,0),f=e.labels?.find(e=>e!==null)??null,p=[],m=(n,a)=>{let o=a;for(let a of n){let n=d>0?a.value/d*360:0,l={start:o,end:o+n,inner:u*(a.level+1),outer:u*(a.level+2)},h=f?En(a,l,r,i,f,t):void 0;p.push({level:a.level,name:a.name,value:a.value,startAngle:l.start,endAngle:l.end,innerRadius:F(l.inner),outerRadius:F(l.outer),fill:s.get(a.branch)??e.fill,stroke:c,point:a.point,...h?{label:h}:{}}),m(a.children,o),o+=n}};return m(n,0),{...t.base(e),marker:null,segments:p}});return{type:`sunburst`,center:{x:I(r),y:I(i)},radius:F(a),hole:F(l),series:u}},hitTest:(e,t)=>{let n=e;for(let e=n.series.length-1;e>=0;e--){let r=n.series[e].segments;for(let i=r.length-1;i>=0;i--)if(vn(t,Dn(n,r[i])))return{series:e,point:r[i].point}}return null},pointBounds:(e,t,n)=>{let r=e,i=r.series[t]?.segments.find(e=>e.point===n);return i&&i.endAngle>i.startAngle?yn(Dn(r,i)):null}},kn={types:[`histogram`],coordinates:`cartesian`,categoryAxis:()=>`x`,stack:e=>{let t=e.series.map(e=>e.values);return{own:t,tops:t}},layout:(e,t)=>{let{inner:n}=t,{category:r,value:i}=t.roles,a=t.scale(i),o=Math.max(1,t.categoryCount(r)),s=n.width/o/(1+e.gapWidth/100),c=t.crossValue(r,a),l=e=>t.yOf(a,i,Math.min(a.max,Math.max(a.min,e))),u=e.histogram,d=e.series[0],f=(u?.bins??[]).map((e,t)=>({kind:e.kind,from:e.from,to:e.to,label:d?.categories[t]??``})),p=e.series.map((e,n)=>{let i=t.stack.tops[n].map((e,n)=>{if(e===null||e===0)return null;let i=t.xOf(r,n),a=l(c),o=l(e);return{box:{x:i-s/2,y:Math.min(a,o),width:s,height:Math.abs(o-a)},base:a,end:o}}),a=Sn(e,i,t);return{...t.base(e),marker:null,bars:i.map(e=>e?L(e.box.x,e.box.y,e.box.width,e.box.height):null),...a?{labels:a}:{}}}),m=u?.cumulative,h=m?t.chart.axes.find(e=>e.id===m.axisId):void 0;if(m&&h&&d){let e=t.scale(h),n=d.values.reduce((e,t)=>e+(t??0),0),i=0,a=d.values.map(e=>(i+=e??0,n>0?i/n:0));p.push({id:m.id,name:m.name,values:a,fill:null,stroke:z(m.stroke),marker:null,bars:[],line:{points:a.map((n,i)=>({x:I(t.xOf(r,i)),y:I(t.yOf(e,h,n))})),axisId:h.id}})}return{type:`histogram`,axisIds:[r.id,i.id],bins:f,barWidth:F(s),gapWidth:e.gapWidth,series:p}},hitTest:(e,t)=>{let n=e.series;for(let e=n.length-1;e>=0;e--){let r=n[e].line;if(r){for(let n=r.points.length-1;n>=0;n--){let i=r.points[n];if(i&&H(un(i,6),t))return{series:e,point:n}}if(mn(t,r.points,3)!==null)return{series:e,point:null};continue}let i=n[e].bars;for(let n=i.length-1;n>=0;n--)if(H(i[n],t))return{series:e,point:n}}return null},pointBounds:(e,t,n)=>{let r=e.series[t];if(!r)return null;if(r.line){let e=r.line.points[n];return e?un(e,6):null}return r.bars[n]??null}},An={types:[`boxWhisker`],coordinates:`cartesian`,categoryAxis:()=>`x`,stack:e=>{let t=e.series.map(e=>(e.boxes??[]).flatMap(e=>e?[e.min,e.max]:[]));return{own:t,tops:t}},layout:(e,t)=>{let{inner:n}=t,{category:r,value:i}=t.roles,a=t.scale(i),o=Math.max(1,e.series.length),s=Math.max(1,t.categoryCount(r)),c=e.gapWidth/100,l=n.width/s/(1+c),u=l/o,d=o===1?u:.9299999999999999*u,f=e=>t.yOf(a,i,Math.min(a.max,Math.max(a.min,e))),p=(e,t,n,r)=>({from:{x:I(e),y:I(t)},to:{x:I(n),y:I(r)}}),m=e.series.map((e,n)=>{let i=e.box,a=z(i?.line??e.stroke),o=[],s=(e.boxes??[]).map((s,c)=>{if(!s)return o.push(null),null;let m=t.xOf(r,c)-l/2+n*u+d/2,h=f(s.q3),g=f(s.q1),_=.31*d,v=(e,t)=>{let n=f(e);return{line:p(m,t,m,n),cap:p(m-_/2,n,m+_/2,n)}},y=e=>({center:{x:I(m),y:I(f(e))},size:F(3.75)});return o.push({x:m,y:f(s.mean)}),{rect:L(m-d/2,h,d,g-h),median:p(m-d/2,f(s.median),m+d/2,f(s.median)),...s.whiskerHigh>s.q3?{whiskerHigh:v(s.whiskerHigh,h)}:{},...s.whiskerLow<s.q1?{whiskerLow:v(s.whiskerLow,g)}:{},...!1===i?.meanMarker?{}:{mean:{center:{x:I(m),y:I(f(s.mean))},size:F(5.25)}},outliers:!1===i?.outliers?[]:s.outliers.map(y),innerPoints:i?.innerPoints?s.inliers.map(y):[],fill:e.fill,stroke:a,stats:{min:s.min,q1:s.q1,median:s.median,q3:s.q3,max:s.max,mean:s.mean}}}),c=[];if(i?.meanLine)for(let e=0;e+1<o.length;e++){let[t,n]=[o[e],o[e+1]];t&&n&&c.push([t,n])}return{...t.base(e),marker:null,boxes:s,...i?.meanLine?{meanLine:{id:`${e.id}:mean`,segments:t.segments(c),stroke:a}}:{}}});return{type:`boxWhisker`,axisIds:[r.id,i.id],boxWidth:F(d),gapWidth:e.gapWidth,series:m}},hitTest:(e,t)=>{let n=e.series;for(let e=n.length-1;e>=0;e--){let r=n[e].boxes;for(let n=r.length-1;n>=0;n--){let i=r[n];if(i&&(H(i.rect,t)||i.outliers.some(e=>H(ln({x:e.center.x,y:e.center.y,width:0,height:0},e.size),t))||[i.whiskerHigh,i.whiskerLow].filter(e=>!!e).some(e=>H(ln({x:e.line.from.x,y:Math.min(e.line.from.y,e.line.to.y),width:0,height:Math.abs(e.line.to.y-e.line.from.y)},3),t))))return{series:e,point:n}}}return null},pointBounds:(e,t,n)=>{let r=e.series[t]?.boxes[n];return r?(e=>{let t=e.whiskerHigh?e.whiskerHigh.line.to.y:e.rect.y,n=e.whiskerLow?e.whiskerLow.line.to.y:e.rect.y+e.rect.height;return{x:e.rect.x,y:t,width:e.rect.width,height:n-t}})(r):null}},jn=4.13,Mn={types:[`treemap`],coordinates:`plot`,layout:(e,t)=>{let{outer:n}=t,r=e.treemap?.parentLabels??`overlapping`,i=new Map((e.hierarchy?.branches??[]).map(e=>[e.name,e.fill])),a=z(e.hierarchy?.border??null),o=e.series.slice(0,1).map(o=>{let{roots:s}=wn(o),c=e.treemap?.font??t.chart.font,l=[],u=[],d=(e,n)=>t.text.width(e,n),f=(n,s,p)=>{let m=[...n].sort((e,t)=>t.value-e.value),h=function(e,t){let n=[],r={...t},i=e.reduce((e,t)=>e+Math.max(0,t),0);return e.forEach((t,a)=>{let o=Math.max(0,t),s=i>0?o/i:0;if(i-=o,a===e.length-1||s>=1)return n.push({...r}),void(r={...r,x:r.x+r.width,width:0});if(r.height>r.width&&r.width<=1.618*r.height*s){let e=r.height*s;n.push({x:r.x,y:r.y,width:r.width,height:e}),r={...r,y:r.y+e,height:r.height-e}}else{let e=r.width*s;n.push({x:r.x,y:r.y,width:e,height:r.height}),r={...r,x:r.x+e,width:r.width-e}}}),n}(m.map(e=>e.value),s);m.forEach((n,s)=>{let m=h[s];if(n.children.length===0){let e=((e,n)=>{let r=e.point===null?void 0:o.labels?.[e.point];if(!r)return;let i=n.width-8.26,a=Tn(r.text,i,e=>d(e,r.font));if(a.length===0)return;let s=a.reduce((e,t)=>Math.max(e,d(t,r.font)),0),c=a.length*t.text.lineHeight(r.font);return s>i+.1||c+jn>n.height?void 0:{text:a.join(`
8
+ `),rect:L(n.x+jn,n.y+n.height-jn-c,s,c),insets:{left:0,top:0,right:0,bottom:0},font:R(r.font)}})(n,m);l.push({level:n.level,name:n.name,value:n.value,rect:L(m.x,m.y,m.width,m.height),fill:i.get(n.branch)??o.fill,stroke:a,point:n.point,...e?{label:e}:{}});return}let g=m;if(p===0&&r!==`none`){let i=d(n.name,c),o=t.text.lineHeight(c),s={text:n.name,rect:L(m.x+jn,m.y+jn,i,o),insets:{left:0,top:0,right:0,bottom:0},font:R(c)};if(r===`banner`){let t=Math.min(18.45,m.height);u.push({name:n.name,label:s,banner:{rect:L(m.x,m.y,m.width,t),fill:e.treemap?.bannerFill??null,stroke:a}}),g={x:m.x,y:m.y+t,width:m.width,height:m.height-t}}else i<=m.width-8.26&&u.push({name:n.name,label:s})}f(n.children,g,p+1)})};return f(s,n,0),{...t.base(o),marker:null,tiles:l,parents:u}});return{type:`treemap`,plot:L(n.x,n.y,n.width,n.height),parentLabels:r,series:o}},hitTest:(e,t)=>{let n=e;for(let e=n.series.length-1;e>=0;e--){let{tiles:r,parents:i}=n.series[e];for(let n=r.length-1;n>=0;n--)if(H(r[n].rect,t))return{series:e,point:r[n].point};if(i.some(e=>H(e.banner?.rect,t)))return{series:e,point:null}}return null},pointBounds:(e,t,n)=>e.series[t]?.tiles.find(e=>e.point===n)?.rect??null},Nn={types:[`funnel`],coordinates:`own`,layoutChart:(e,t)=>{let n=t.chart,{outer:r}=t,i=e[0],a=i?.series[0],o=n.axes.find(e=>e.type!==`val`&&!!i&&i.axIds.includes(e.id))??n.axes.find(e=>e.type!==`val`),s=o?.labelFont??n.font,c=t.text.lineHeight(s),l=a?.values??[],u=l.map((e,t)=>a?.categories[t]??String(t+1)),d=!!o&&V(o),f=d?u.reduce((e,n)=>Math.max(e,t.text.width(n,s)),0):0,p=d?f+Qt.perLine*c+Qt.offset+3.3:0,m=r.x+p,h={x:m,y:r.y+1.6,width:Math.max(0,r.x+r.width-.7-m),height:Math.max(0,r.height-1.6-.5)},g=Math.max(1,l.length),_=h.height/g,v=i?.gapWidth??0,y=_/(1+v/100),b=l.reduce((e,t)=>t!==null&&t>e?t:e,0),x=l.map((e,t)=>{if(!(e!==null&&e>0&&b>0))return null;let n=h.width*e/b;return{x:h.x+(h.width-n)/2,y:h.y+t*_+(_-y)/2,width:n,height:y}}),S={left:0,top:0,right:0,bottom:0},C=a?.labels,w=C?x.map((e,n)=>{let r=C[n];if(!r||!e)return null;let i=r.text.split(`
9
+ `),a=i.reduce((e,n)=>Math.max(e,t.text.width(n,r.font)),0),o=i.length*t.text.lineHeight(r.font);return a>e.width?null:{text:r.text,rect:L(e.x+(e.width-a)/2,e.y+(e.height-o)/2,a,o),insets:S,font:R(r.font),fill:r.fill,border:z(r.border)}}):void 0,ee=tn(s.size),T=u.map((e,n)=>{if(!d)return null;let r=t.text.width(e,s);return{text:e,rect:L(m-ee-r,h.y+(n+.5)*_-c/2,r,c),insets:S,font:R(s)}}),E=o?.line?{from:{x:I(m),y:I(h.y)},to:{x:I(m),y:I(h.y+h.height)}}:null,D={type:`funnel`,axisIds:o?[o.id]:[],plot:L(h.x,h.y,h.width,h.height),barHeight:F(y),gapWidth:v,axisLine:E,axisStroke:z(o?.line??null),categoryLabels:T,series:a?[{id:a.id,name:a.name,values:a.values,fill:a.fill,stroke:z(a.stroke),marker:null,bars:x.map(e=>e?L(e.x,e.y,e.width,e.height):null),...w&&w.some(e=>e)?{labels:w}:{}}]:[]},te=n.axes.map(e=>{let t={id:e.id,crossAxisId:e.crossAx,position:on[e.position],deleted:!0,reversed:!1,line:null,majorGridlines:null,tickMark:`none`,tickLength:0,labelFont:null,labelMargin:0,lineAt:I(e===o?m:h.y+h.height),title:null};return e.type===`val`?{...t,kind:`value`,min:0,max:1,majorUnit:1,ticks:[]}:{...t,kind:`category`,categories:u,labels:u,labelRotation:0,labelLineHeight:F(c),crossBetween:`between`}});return t.frame({inner:h,axes:te,groups:i?[D]:[]})},hitTest:(e,t)=>{let n=e.series;for(let e=n.length-1;e>=0;e--){let r=n[e].bars;for(let n=r.length-1;n>=0;n--)if(H(r[n],t))return{series:e,point:n}}return null},pointBounds:(e,t,n)=>e.series[t]?.bars[n]??null},Pn=e=>Math.max(6,e.marker?.size??0),Fn=(e,t)=>{let n=e?.points[t];return n?un(n,Pn(e)):null},In=(e,t,n=!1,r=!1)=>{for(let n=e.length-1;n>=0;n--){let r=Pn(e[n]),i=e[n].points;for(let e=i.length-1;e>=0;e--){let a=i[e];if(a&&H(un(a,r),t))return{series:n,point:e}}}for(let i=e.length-1;i>=0;i--){if(!e[i].stroke)continue;let a=e[i].points;if(mn(t,n?a.filter(e=>e!==null):a,3,r))return{series:i,point:null}}return null},Ln={types:[`line`,`stock`],coordinates:`cartesian`,layout:(e,t)=>{let n=t.pair,r=t.scale(n.y),i=t.crossValue(n.x,r),{own:a,tops:o}=t.stack;return{type:`line`,axisIds:[n.x.id,n.y.id],grouping:e.grouping===`stacked`||e.grouping===`percentStacked`?e.grouping:`standard`,...t.chart.spanBlanks?{spanBlanks:!0}:{},...t.analysisLines(r,o,i),series:e.series.map((e,i)=>{let s=o[i].map((e,i)=>{let a=t.pointSlot(n.x,i);return e===null||a===null||rn(r,e)===null?null:{x:t.xOf(n.x,a),y:t.yOf(r,n.y,e)}}),c=t.labels.points(e,s),l=t.errorBars(e,e=>s[e],e=>e===`y`?{horizontal:!1,toPt:e=>t.yOf(r,n.y,e),plotted:o[i]}:null);return{...t.base(e),marker:nn(e.marker),plotted:a[i],points:s.map(e=>e?{x:I(e.x),y:I(e.y)}:null),...c?{labels:c}:{},...l?{errorBars:l}:{}}})}},hitTest:(e,t)=>{let n=e;return In(n.series,t,n.spanBlanks??!1)},pointBounds:(e,t,n)=>Fn(e.series[t],n)},Rn=(e,t,n)=>(e.grouping!==`standard`&&t>0?e.series[t-1].points[n]?.y:void 0)??e.baseY,zn={types:[`area`],coordinates:`cartesian`,layout:(e,t)=>{let n=t.pair,r=t.scale(n.y),i=t.crossValue(n.x,r),a=t.yOf(r,n.y,i),{own:o,tops:s}=t.stack,c=an(e);return{type:`area`,axisIds:[n.x.id,n.y.id],grouping:e.grouping===`stacked`||e.grouping===`percentStacked`?e.grouping:`standard`,baseValue:i,baseY:I(a),...e.dropLines===void 0?{}:{dropLines:t.analysisLines(r,s,i).dropLines},series:e.series.map((e,a)=>{let l=s[a].map((e,s)=>{let l=t.pointSlot(n.x,s);if(e===null||l===null||rn(r,e)===null)return null;let u=c?e-(o[a][s]??0):i;return{x:t.xOf(n.x,l),top:t.yOf(r,n.y,e),bottom:t.yOf(r,n.y,u)}}),u=t.labels.areas(e,l),d=t.errorBars(e,e=>l[e]?{x:l[e].x,y:l[e].top}:null,e=>e===`y`?{horizontal:!1,toPt:e=>t.yOf(r,n.y,e),plotted:s[a]}:null);return{...t.base(e),marker:null,plotted:o[a],points:l.map(e=>e?{x:I(e.x),y:I(e.top)}:null),...u?{labels:u}:{},...d?{errorBars:d}:{}}})}},hitTest:(e,t)=>{let n=e;for(let e=n.series.length-1;e>=0;e--){let r=n.series[e].points,i=-1;for(let a=0;a<=r.length;a++){let o=a<r.length?r[a]:null;if(o&&i===-1&&(i=a),o&&a<r.length-1||i===-1)continue;let s=o?a:a-1,c=[];for(let e=i;e<=s;e++)c.push(r[e]);for(let t=s;t>=i;t--)c.push({x:r[t].x,y:Rn(n,e,t)});if(hn(t,c)){for(let n=i;n<=s;n++)if(Math.abs(r[n].x-t.x)<=3)return{series:e,point:n};return{series:e,point:null}}i=-1}}return null},pointBounds:(e,t,n)=>{let r=e,i=r.series[t]?.points[n];if(!i)return null;let a=Rn(r,t,n);return{x:i.x-3,y:Math.min(i.y,a),width:6,height:Math.abs(a-i.y)}}},Bn=(e,t)=>{let n=t.pair,r=t.scale(n.y),i=t.scale(n.x);return{type:`scatter`,axisIds:[n.x.id,n.y.id],...t.chart.spanBlanks?{spanBlanks:!0}:{},series:e.series.map(e=>{let a=e.xValues??e.values.map((e,t)=>t+1),o=e.values.map((e,o)=>{let s=a[o];return e===null||s==null||rn(r,e)===null||rn(i,s)===null?null:{x:t.xOfValue(i,n.x,s),y:t.yOf(r,n.y,e)}}),s=t.labels.points(e,o),c=t.errorBars(e,e=>o[e],o=>o===`y`?{horizontal:!1,toPt:e=>t.yOf(r,n.y,e),plotted:e.values}:{horizontal:!0,toPt:e=>t.xOfValue(i,n.x,e),plotted:a});return{...t.base(e),marker:nn(e.marker),xValues:a,smooth:e.smooth,points:o.map(e=>e?{x:I(e.x),y:I(e.y)}:null),...s?{labels:s}:{},...c?{errorBars:c}:{}}})}},Vn={types:[`scatter`],coordinates:`cartesian`,categoryAxis:()=>null,layout:Bn,hitTest:(e,t)=>{let n=e;return In(n.series,t,n.spanBlanks??!1)},pointBounds:(e,t,n)=>Fn(e.series[t],n)},Hn={types:[`bubble`],coordinates:`cartesian`,categoryAxis:()=>null,layout:(e,t)=>{let n=Bn(e,t),r=e.bubble;if(!r)return n;let i=e=>e==null||!Number.isFinite(e)||e<0&&!r.showNegative?null:Math.abs(e),a=Math.max(0,...e.series.flatMap(e=>(e.bubbleSizes??[]).map(e=>i(e)??0))),o=(s=t.outer,c=r.scale,.3*(Math.min(s.width,s.height)+12)*c/(100+.3*c));var s,c;return{type:`bubble`,axisIds:n.axisIds,negative:{fill:{type:`solid`,color:`#FFFFFF`},stroke:{fill:{type:`solid`,color:`#000000`},width:F(.75)}},series:n.series.map((t,n)=>({...t,negative:t.points.map((t,r)=>(e.series[n].bubbleSizes?.[r]??0)<0),radii:t.points.map((t,s)=>{let c=i(e.series[n].bubbleSizes?.[s]);if(!(t&&c!==null&&c>0&&a>0&&o>0))return null;let l=r.sizeRepresents===`w`?c/a:Math.sqrt(c/a);return F(o*l/2)})}))}},hitTest:(e,t)=>{if(e.type!==`bubble`)return Vn.hitTest(e,t);for(let n=e.series.length-1;n>=0;n--){let r=e.series[n];for(let e=r.points.length-1;e>=0;e--){let i=r.points[e],a=r.radii[e];if(i&&a&&pn(i,t)<=a)return{series:n,point:e}}}return null},pointBounds:(e,t,n)=>e.type===`bubble`?((e,t)=>{let n=e?.points[t],r=e?.radii[t];return n&&r?un(n,2*r):null})(e.series[t],n):Vn.pointBounds(e,t,n)},Un=e=>(e.type===`doughnut`?e.series:e.series.slice(0,1)).some(t=>t.labels?.some(t=>t!==null&&(e.type===`doughnut`||t.position===`outEnd`||t.position===`bestFit`))),Wn=(e,t)=>({center:t.center,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle}),Gn={types:[`pie`,`doughnut`],coordinates:`plot`,plotRect:(e,t)=>{let n=Math.min(t.width,t.height);return e.some(Un)&&(n=Math.max(0,.875*n-2.74)),{x:t.x+(t.width-n)/2,y:t.y+(t.height-n)/2,width:n,height:n}},layout:(e,t)=>{let n=t.inner,r=e.type===`doughnut`,i=n.x+n.width/2,a=n.y+n.height/2,o=r?e.series:e.series.slice(0,1),s=Math.min(...o.flatMap(e=>e.values.map((t,n)=>t===null?1/0:e.points?.[n]?.explosion??0))),c=Math.min(n.width,n.height)/2/(1+(Number.isFinite(s)?s:0)/100),l=r?c*e.holeSize/100:0,u=(c-l)/Math.max(1,o.length);return{type:`pie`,doughnut:r,center:{x:I(i),y:I(a)},radius:F(c),series:o.map((n,o)=>{let s=n.values.reduce((e,t)=>e+(t===null?0:Math.abs(t)),0),d=e.firstSliceAng,f=l+o*u,p=r?l+(o+1)*u:c,m=[],h={id:n.id,name:n.name,values:n.values,fill:n.fill,stroke:z(n.stroke),marker:null,innerRadius:F(f),outerRadius:F(p),slices:n.values.map((e,r)=>{if(e===null)return m.push(null),null;let o=s>0?Math.abs(e)/s*360:0,l=d;d+=o;let u=n.points?.[r],h=(u?.explosion??0)/100*c,g=(l+o/2)*Math.PI/180,_={x:i+h*Math.sin(g),y:a-h*Math.cos(g)};return m.push(t.labels.pie(n,r,{middle:g,center:_,innerRadius:f,outerRadius:p})),{startAngle:l,endAngle:l+o,center:{x:I(_.x),y:I(_.y)},fill:u?u.fill:n.fill,stroke:z(u?u.stroke:n.stroke)}})};return m.some(e=>e!==null)&&(h.labels=m),h})}},hitTest:(e,t)=>{let n=e;for(let e=n.series.length-1;e>=0;e--){let r=n.series[e];for(let n=r.slices.length-1;n>=0;n--){let i=r.slices[n];if(i&&vn(t,Wn(r,i)))return{series:e,point:n}}}return null},pointBounds:(e,t,n)=>{let r=e.series[t],i=r?.slices[n];return i&&i.endAngle>i.startAngle?yn(Wn(r,i)):null}},Kn=e=>Math.ceil(e/3),qn=(e,t)=>{let n=t.length,r=t.reduce((e,t)=>e+(t===null?0:Math.abs(t)),0),i=e.splitType===`pos`&&e.splitPos!==void 0?e.splitPos:Kn(n);return t.map((t,a)=>{switch(e.splitType){case`cust`:return(e.custSplit??[]).includes(a);case`val`:return t!==null&&t<(e.splitPos??0);case`percent`:return t!==null&&r>0&&Math.abs(t)/r*100<(e.splitPos??0);default:return a>=n-i}})},Jn=e=>({center:e.center,innerRadius:0,outerRadius:e.radius,startAngle:e.startAngle,endAngle:e.endAngle}),Yn={types:[`ofPie`],coordinates:`plot`,layout:(e,t)=>{let n=t.inner,r=e.ofPie,i=r.of===`bar`,a=r.secondSize/100,o=e.gapWidth/100,s=Math.min(n.height/2,n.width/(i?2+o/2+a:2+o+2*a)),c=i?s*(2+o/2+a):s*(2+o+2*a),l=n.y+n.height/2,u=n.x+(n.width-c)/2+s,d=a*s,f=u+s+o*s+d,p={x:u+s+o*s/2,y:l-d,width:d,height:2*d},m={type:`ofPie`,of:r.of,center:{x:I(u),y:I(l)},radius:F(s),second:i?null:{center:{x:I(f),y:I(l)},radius:F(d)},bar:i?L(p.x,p.y,p.width,p.height):null,series:[]},h=e.series[0];if(!h)return m;let g=h.values,_=qn(r,g),v=e=>e===null?0:Math.abs(e),y=g.reduce((e,t)=>e+v(t),0),b=g.reduce((e,t,n)=>e+(_[n]?v(t):0),0),x=e=>h.points?.[e]??{fill:h.fill,stroke:h.stroke,explosion:0},S=(e,t,n,r,i)=>{let a=x(e),o=a.explosion/100*i,s=(t+n/2)*Math.PI/180;return{startAngle:t,endAngle:t+n,center:{x:I(r.x+o*Math.sin(s)),y:I(r.y-o*Math.cos(s))},radius:F(i),fill:a.fill,stroke:z(a.stroke)}},C=y>0?b/y*360:0,w=90-C/2,ee=90+C/2,T=[],E=[],D=ee,te=ee,ne=p.y;g.forEach((e,t)=>{if(e===null)T.push(null),E.push(null);else if(_[t]){if(i){let n=b>0?v(e)/b*p.height:0,r=x(t);E.push({rect:L(p.x,ne,p.width,n),fill:r.fill,stroke:z(r.stroke)}),T.push(null),ne+=n}else{let n=b>0?v(e)/b*360:0;T.push(S(t,te,n,{x:f,y:l},d)),E.push(null),te+=n}}else{let n=y>0?v(e)/y*360:0;T.push(S(t,D,n,{x:u,y:l},s)),E.push(null),D+=n}});let re=S(g.length,w,C,{x:u,y:l},s);if(m.series.push({id:h.id,name:h.name,values:g,fill:h.fill,stroke:z(h.stroke),marker:null,slices:T,...i?{bars:E}:{},second:_,other:re}),e.seriesLines!==void 0&&C>0){let t=e=>({x:u+s*Math.sin(e*Math.PI/180),y:l-s*Math.cos(e*Math.PI/180)}),n=i?180*(Math.atan2(p.x-u,d)-Math.acos(Math.min(1,s/Math.hypot(p.x-u,d))))/Math.PI:180*Math.asin(Math.max(-1,Math.min(1,(s-d)/(f-u))))/Math.PI,[r,a]=[t(Math.max(w,n)),t(Math.min(ee,180-n))],o=(e,t)=>{let n=Math.hypot(e.x-f,e.y-l);if(n<=d)return null;let r=Math.atan2(e.y-l,e.x-f),i=Math.acos(d/n),[a,o]=[r+i,r-i].map(e=>({x:f+d*Math.cos(e),y:l+d*Math.sin(e)}));return a.y<o.y===t?a:o},c=i?[{x:p.x,y:p.y},{x:p.x,y:p.y+p.height}]:[o(r,!0),o(a,!1)],h=[];[[r,c[0]],[a,c[1]]].forEach(([e,t])=>{e&&t&&h.push({from:{x:I(e.x),y:I(e.y)},to:{x:I(t.x),y:I(t.y)}})}),m.seriesLines={id:`g0:series`,segments:h,stroke:z(e.seriesLines)}}return m},hitTest:(e,t)=>{let n=e;for(let e=n.series.length-1;e>=0;e--){let r=n.series[e];for(let n=r.slices.length-1;n>=0;n--){let i=r.slices[n];if(i&&vn(t,Jn(i))||H(r.bars?.[n]?.rect,t))return{series:e,point:n}}if(vn(t,Jn(r.other)))return{series:e,point:null}}return null},pointBounds:(e,t,n)=>{let r=e.series[t],i=r?.slices[n];return i?i.endAngle>i.startAngle?yn(Jn(i)):null:r?.bars?.[n]?.rect??null}},Xn={types:[`radar`],coordinates:`own`,layoutChart:(e,t)=>{let{outer:n}=t,r=t.chart,i=e[0],a=sn(i,r.axes),o=a?.x??null,s=a?.y??null,c=o?.labelFont??s?.labelFont,l=Math.max(1,...i.series.map(e=>Math.max(e.values.length,e.categories.length))),u=i.series.find(e=>e.categories.length>0),d=Array.from({length:l},(e,t)=>u?.categories[t]??String(t+1)),f=!!o&&V(o)&&!!c,p=c?t.text.lineHeight(c):0,m=0,h=0;if(f)for(let e of d){let n=cn([{text:e}],42.18,e=>t.text.width(e.map(e=>e.text).join(``),c));m=Math.max(m,n.length),h=Math.max(h,Math.min(42.18,t.text.width(e,c)))}let g=m>0?m*p-2.436:0,_=h>0?h-.26:0,v=Math.max(0,Math.min(n.height-2*g,n.width-2*_)),y=v/2,b=n.x+n.width/2,x=n.y+n.height/2,S={x:b-y,y:x-y,width:v,height:v},C=1/0,w=-1/0;for(let e of i.series)for(let t of e.values)t!==null&&(C=Math.min(C,t),w=Math.max(w,t));C>w&&([C,w]=[0,1]);let ee=s?.labelFont??c,T=e=>qe(C,w,s?.min,s?.max,s?.minorUnit,e,!1,0),E=T(s?.majorUnit);if(s&&s.majorUnit===void 0&&ee){let e=Math.min(n.height/2-g,n.width/2),r=t.text.lineHeight(ee),i=Je(E.majorUnits,T,t=>(t.length-1)*r-7.87<=e);i!==E.majorUnits&&(E=T(i))}let D=Xe(E.min,E.max,E.majorUnits),te=e=>(e-E.min)/(E.max-E.min||1)*y,ne=e=>2*e*Math.PI/l,re=(e,t)=>({x:b+t*Math.sin(ne(e)),y:x-t*Math.cos(ne(e))}),O=e=>({x:I(e.x),y:I(e.y)}),ie=d.map((e,n)=>{if(!f)return null;let r=t.text.width(e,c),i=re(n,y+3),a=180*ne(n)/Math.PI%360,o=i.x,s=i.y-p/2;return Math.abs(a)<1e-6?[o,s]=[i.x-r/2,i.y-p]:Math.abs(a-180)<1e-6?[o,s]=[i.x-r/2,i.y]:a>180&&(o=i.x-r),{text:e,rect:L(o,s,r,p),insets:{left:0,top:0,right:0,bottom:0},font:R(c)}}),ae=s&&V(s)?D.map(e=>{let n=t.label(s,e),r=t.text.width(n,s.labelFont),i=t.text.lineHeight(s.labelFont);return{text:n,rect:L(b-8.7-r,x-te(e)-i/2,r,i),insets:{left:0,top:0,right:0,bottom:0},font:R(s.labelFont)}}):[],oe={type:`radar`,axisIds:[o?.id??0,s?.id??0],filled:i.radarStyle===`filled`,center:{x:I(b),y:I(x)},radius:F(y),spokes:Array.from({length:l},(e,t)=>({from:O({x:b,y:x}),to:O(re(t,y))})),spokeStroke:z(o?.line??null),rings:D.filter(e=>te(e)>1e-9).map(e=>Array.from({length:l},(t,n)=>O(re(n,te(e))))),ringStroke:z(s?.majorGridlines??null),categoryLabels:ie,valueLabels:ae,series:i.series.map(e=>{let n=e.values.map((e,t)=>e===null?null:re(t,te(Math.min(E.max,Math.max(E.min,e))))),r=t.labels.points(e,n);return{id:e.id,name:e.name,values:e.values,fill:e.fill,stroke:z(e.stroke),marker:nn(e.marker),points:n.map(e=>e?O(e):null),...r?{labels:r}:{}}})},k=r.axes.map(e=>{let n={id:e.id,crossAxisId:e.crossAx,position:on[e.position],deleted:!0,reversed:!1,line:null,majorGridlines:null,tickMark:`none`,tickLength:0,labelFont:null,labelMargin:0,lineAt:e.type===`val`?I(b):I(x),title:null};return e.type===`val`?{...n,kind:`value`,min:E.min,max:E.max,majorUnit:E.majorUnits,ticks:D.map(n=>({value:n,label:t.label(e,n)}))}:{...n,kind:`category`,categories:d,labels:d,labelRotation:0,labelLineHeight:F(p),crossBetween:`between`}});return t.frame({inner:S,axes:k,groups:[oe]})},hitTest:(e,t)=>{let n=e,r=In(n.series,t,!1,!0);if(r||!n.filled)return r;for(let e=n.series.length-1;e>=0;e--){let r=n.series[e].points.filter(e=>e!==null);if(r.length>=3&&hn(t,r))return{series:e,point:null}}return null},pointBounds:(e,t,n)=>Fn(e.series[t],n)},Zn={types:[`surface`],coordinates:`own`,layoutChart:(e,t)=>{let n=e[0],{outer:r}=t,i=t.legend?((e,t)=>({...e,rect:{...e.rect,x:e.rect.x+t},entries:e.entries.map(e=>({...e,rect:{...e.rect,x:e.rect.x+t},keyRect:{...e.keyRect,x:e.keyRect.x+t}}))}))(t.legend,F(.75)):null,a=t.chart,o=n.surface,s=e=>a.axes.find(t=>t.type===e&&n.axIds.includes(t.id)),c=s(`cat`)??s(`date`),l=s(`ser`),u=Math.max(1,n.series.length),d=Math.max(1,...n.series.map(e=>e.values.length)),f=n.series.find(e=>e.categories.length>0),p=Array.from({length:d},(e,t)=>f?.categories[t]??String(t+1)),m=!!c&&V(c),h=!!l&&V(l),g=h?Math.max(0,...n.series.map(e=>t.text.width(e.name,l.labelFont))):0,_=m?t.text.lineHeight(c.labelFont):0,v=m&&o.min>=0?_+$t.perLine*_+$t.offset:0,y={x:r.x+2.4,y:r.y,width:r.width-2.4-(h?g+1:0),height:r.height-v},b=Math.min(.97*y.height/u,y.width/d),x={x:y.x+(y.width-b*d)/2,y:y.y+(y.height-b*u)/2,width:b*d,height:b*u},S=e=>x.x+(d===1?x.width/2:e*x.width/(d-1)),C=e=>x.y+x.height-(u===1?x.height/2:e*x.height/(u-1)),w=(e,t)=>{let n=[];return e.forEach((r,i)=>{let a=e[(i+1)%e.length],[o,s]=[t(r.z),t(a.z)];if(o>=0&&n.push(r),o>=0!=s>=0){let e=o/(o-s);n.push({x:r.x+e*(a.x-r.x),y:r.y+e*(a.y-r.y),z:r.z+e*(a.z-r.z)})}}),n},ee=(e,t)=>n.series[e]?.values[t]??null,T=[];for(let e=0;e+1<u;e++)for(let t=0;t+1<d;t++){let n=(e,t)=>{let n=ee(e,t);return n===null?null:{x:S(t),y:C(e),z:n}},[r,i,a,o]=[n(e,t),n(e,t+1),n(e+1,t+1),n(e+1,t)];r&&i&&a&&T.push([r,i,a]),r&&a&&o&&T.push([r,a,o])}let E=o.bands.map((e,t)=>{let n=t===o.bands.length-1,r=T.map(t=>w(w(t,t=>t-e.from),t=>(n?e.to+1e-9:e.to)-t)).filter(e=>e.length>=3).map(e=>e.map(e=>({x:I(e.x),y:I(e.y)})));return{from:e.from,to:e.to,fill:e.fill,stroke:z(e.stroke),polygons:r}}),D=m?p.map((e,n)=>{let r=t.text.width(e,c.labelFont);return{text:e,rect:L(S(n)-r/2,x.y+x.height+tn(c.labelFont.size),r,_),insets:{left:0,top:0,right:0,bottom:0},font:R(c.labelFont)}}):[],te=h?n.series.map((e,n)=>{let r=t.text.lineHeight(l.labelFont);return{text:e.name,rect:L(x.x+x.width+6,C(n)-r/2,t.text.width(e.name,l.labelFont),r),insets:{left:0,top:0,right:0,bottom:0},font:R(l.labelFont)}}):[],ne={type:`surface`,axisIds:[...n.axIds],wireframe:o.wireframe,flat:o.flat,grid:L(x.x,x.y,x.width,x.height),bands:E,categoryLabels:D,seriesLabels:te,series:n.series.map(e=>({id:e.id,name:e.name,values:e.values,fill:e.fill,stroke:z(e.stroke),marker:null}))},re=Xe(o.min,o.max,o.majorUnit),O=a.axes.map(e=>{let r={id:e.id,crossAxisId:e.crossAx,position:on[e.position],deleted:!0,reversed:!1,line:null,majorGridlines:null,tickMark:`none`,tickLength:0,labelFont:null,labelMargin:0,lineAt:I(x.y+x.height),title:null};if(e.type===`val`)return{...r,kind:`value`,min:o.min,max:o.max,majorUnit:o.majorUnit,ticks:re.map(n=>({value:n,label:t.label(e,n)}))};let i=e.type===`ser`?n.series.map(e=>e.name):p;return{...r,kind:`category`,categories:i,labels:i,labelRotation:0,labelLineHeight:F(_),crossBetween:`midCat`}});return t.frame({inner:y,axes:O,groups:[ne],legend:i})}},Qn={types:[`regionMap`],coordinates:`own`,layoutChart:(e,t)=>{let r=t.chart,{outer:i}=t,a=r.font,o=n(`chart.renderingNotSupported`,{type:r.chartType}),s=t.text.width(o,a),c=t.text.lineHeight(a),l={text:o,rect:L(i.x+(i.width-s)/2,i.y+(i.height-c)/2,s,c),insets:{left:0,top:0,right:0,bottom:0},font:R(a)},u=e.map((e,t)=>({type:e.type,axisIds:[],plot:L(i.x,i.y,i.width,i.height),series:e.series.map(e=>({id:e.id,name:e.name,values:e.values,fill:e.fill,stroke:z(e.stroke),marker:null})),...t===0?{label:l}:{}})),d=r.axes.map(e=>{let t={id:e.id,crossAxisId:e.crossAx,position:on[e.position],deleted:!0,reversed:!1,line:null,majorGridlines:null,tickMark:`none`,tickLength:0,labelFont:null,labelMargin:0,lineAt:I(i.y+i.height),title:null};return e.type===`val`?{...t,kind:`value`,min:0,max:1,majorUnit:1,ticks:[]}:{...t,kind:`category`,categories:[],labels:[],labelRotation:0,labelLineHeight:0,crossBetween:`between`}});return t.frame({inner:i,axes:d,groups:u})}};function $n(e){for(let t of[bn,Cn,On,kn,An,Mn,Nn,Ln,zn,Vn,Hn,Gn,Yn,Xn,Zn,Qn])e(t)}function er(e,t=`days`,n=!1){let r=Math.floor(e);if(t===`days`)return r;let i=r-(g(r,n)-1);if(t===`months`)return i;let a=f(i,n)%12;return l(i,-a,!1,n)}function tr(e,t,n,r=!1){return n===`days`?e+t:l(e,n===`months`?t:12*t,!1,r)}function nr(e,t,n,r=!1){if(n===`days`)return Math.floor(t)-Math.floor(e);let i=f(Math.floor(t),r)-f(Math.floor(e),r);return n===`months`?i:Math.floor(f(Math.floor(t),r)/12)-Math.floor(f(Math.floor(e),r)/12)}function rr(e,t=!1){let n=[...new Set(e.filter(Number.isFinite).map(e=>Math.floor(e)))].sort((e,t)=>e-t),r=`years`;for(let e=1;e<n.length;e++){let i=f(n[e-1],t),a=f(n[e],t);if(i===a)return`days`;Math.floor(i/12)===Math.floor(a/12)&&(r=`months`)}return r}function ir(e,t,n=!1){if(!Number.isFinite(t))return null;let r=nr(e.min,t,e.baseUnit,n);return r<0||r>=e.count?null:r}function ar(e,t,n=!1){let r=[];for(let i=0;i<=e.count;i++){let a=tr(e.min,i*t.count,t.unit,n),o=ir(e,a,n);if(o===null)break;r.push({serial:a,slot:o})}return r}var or=1.4648,sr=2.8095,cr=41.6,lr=9;function ur(e,t,n,r=!1){let i=function(e){if(e.baseUnit!==`days`)return Array.from({length:e.count},(t,n)=>({count:n+1,unit:e.baseUnit}));let t=[1,2,7].map(e=>({count:e,unit:`days`}));if(e.count<28){for(let n=2;7*n<e.count+7;n++)t.push({count:7*n,unit:`days`});return t}let n=Math.ceil(e.count/365)+1;return[...t,{count:1,unit:`months`},{count:2,unit:`months`},...Array.from({length:n},(e,t)=>({count:t+1,unit:`years`}))]}(e),a=or*n;for(let o of i)if(!(ar(e,o,r).length*a>t||o.unit===`days`&&o.count===7&&e.count>=28&&t<(sr*e.count+cr)*n/lr))return o;return i[i.length-1]}var dr=/\s+/;function fr(e,t){let n=0;for(let r of e.split(dr))r.length!==0&&(n=Math.max(n,t(r)));return n}var pr=(e,t,n)=>{let r=Array.from(e),i=1;for(;i<r.length&&n(r.slice(0,i+1).join(``))<=t;)i++;return r.slice(0,i).join(``)};function mr(e,t,n,r=!1){if(e.includes(`
10
+ `))return e.split(`
11
+ `).flatMap(e=>mr(e,t,n,r));let i=[],a=``;for(let o of e.split(dr)){if(o.length===0)continue;let e=a?`${a} ${o}`:o;if(n(e)<=t)a=e;else for(a&&i.push(a),a=o;r&&a&&n(a)>t;){let e=pr(a,t,n);i.push(e),a=a.slice(e.length)}}return(a||i.length===0)&&i.push(a),i}var hr=(e,t,n)=>{let r=n(e);if(r<=t)return{text:e,width:r};let i=t-n(`…`),a=``;for(let t of e.matchAll(/\S+/g)){let r=e.slice(0,t.index+t[0].length);if(n(r)>i)break;a=r}return a||=pr(e,i,n),{text:a+`…`,width:n(a)}},gr=(e,t,n,r)=>{let i=r(e);if(i<=t||t<=0)return{text:e,width:i};if(n<=1)return hr(e,t,r);let a=mr(e,t,r,!0),o=e=>e.reduce((e,t)=>Math.max(e,r(t)),0);if(a.length<=n)return{text:a.join(`
12
+ `),width:o(a)};let s=a.slice(0,n-1),c=0;for(let t of s){for(;c<e.length&&/\s/.test(e[c]);)c++;c+=t.length}let l=hr(e.slice(c).trim(),t,r);return{text:[...s,l.text].join(`
13
+ `),width:Math.max(o(s),l.width)}},_r=Math.PI/180,vr=7/6;function yr(e,t,n,r){let i=e=>n.width(e,t),a=n.lineHeight(t),o=Math.max(1,e.length),s=r.length/o,c=e=>{if(r.skip!==void 0)return Math.max(1,Math.round(r.skip));let t=Math.floor(r.length/e+1e-9);return t>=o?1:Math.ceil(o/Math.max(1,t))},l=t=>e.map((e,t)=>t).filter(e=>e%t===0);if(r.vertical){let n=vr*a,i=e.map(e=>Array.from(e.replace(/\n/g,` `))),o=e.map(()=>null),s=e=>r.reversed?[e[e.length-1],e[0]]:[e[0],e[e.length-1]];if(!r.horizontal){let e=c(n),t=l(e);for(let e of t)o[e]=i[e].join(`
14
+ `);let r=e=>e===void 0?0:i[e].length*n/2,[a,u]=s(t);return{skip:e,rotation:0,vertical:!0,labels:o,depth:n,reach:{start:r(a),end:r(u)}}}let u=Math.max(1,Math.floor((r.maxDepth??1/0)/n+1e-9)),d=e=>Math.max(1,Math.ceil(e.length/u)),f=c(.95*i.reduce((e,t)=>Math.max(e,d(t)),0)*t.size),p=l(f),m=0,h=e=>e===void 0?0:Math.min(i[e].length,u)*n;for(let e of p){let t=[];for(let n=0;n<i[e].length;n+=u)t.push(i[e].slice(n,n+u).join(`
15
+ `));o[e]=t.join(` `),m=Math.max(m,h(e))}return{skip:f,rotation:0,vertical:!0,labels:o,depth:m,reach:{start:0,end:.9395*h(s(p)[1])}}}if(!r.horizontal){let t=c(a),n=l(t),o=Math.max(1,Math.floor(t*s/a+1e-9)),u=r.maxWidth??1/0,d=e.map(()=>null),f=0,p=e=>e===void 0?0:(d[e]?.split(`
16
+ `).length??0)*a/2,m=()=>{let[e,t]=r.reversed?[n[n.length-1],n[0]]:[n[0],n[n.length-1]];return{start:p(e),end:p(t)}};for(let t of n){if(e[t].includes(`
17
+ `)){let n=mr(e[t],u,i,!0);n.length>o&&(n=[...n.slice(0,o-1),hr(n.slice(o-1).join(` `),u,i).text]),d[t]=n.join(`
18
+ `);for(let e of n)f=Math.max(f,i(e.endsWith(`…`)?e.slice(0,-1):e));continue}let n=gr(e[t],u,o,i);d[t]=n.text,f=Math.max(f,n.width)}return{skip:t,rotation:0,labels:d,depth:f,reach:m()}}let u=e.map(e=>e.replace(/\n/g,` `)),d=u.reduce((e,t)=>Math.max(e,i(t)),0),f=e.reduce((e,t)=>Math.max(e,fr(t,i)),0),p=e=>e===0?f:function(e,t,n){let r=-e/2,i=-t/2,a=e/2,o=t/2,s=Ze(r,o,n),c=Ze(r,i,n),l=Ze(a,o,n),u=Ze(a,i,n),d=0,f=0;for(let[e,t]of[[s,c],[c,u],[u,l],[l,s]]){let n=Qe(e,t);n&&(d=Math.min(d,n.x),f=Math.max(f,n.x))}return f-d}(d,a,e),m=r.rotation===void 0?r.innermost?[0,90]:[0,45,90]:[r.rotation],h=c(p(m[m.length-1])),g=h*s,_=m.find(e=>p(e)<=g+.005)??m[m.length-1],v=l(h),y=e.map(()=>null),b=r.maxDepth??1/0,x=e=>r.reversed?[e[e.length-1],e[0]]:[e[0],e[e.length-1]];if(_===0){let t=v.map(t=>mr(e[t],g,i));t.some(e=>e.length*a>b)&&(t=v.map(t=>e[t].split(`
19
+ `))),t.forEach((e,t)=>y[v[t]]=e.join(`
20
+ `));let[n,r]=x(t.map(e=>e.reduce((e,t)=>Math.max(e,i(t)),0)));return{skip:h,rotation:_,labels:y,depth:Math.min(b,t.reduce((e,t)=>Math.max(e,t.length*a),0)),reach:{start:n/2,end:r/2}}}let S=Math.abs(_)===90?Math.max(1,Math.floor(g/a+1e-9)):1;return{skip:h,...br(u,v,_,a,i,b,r.length,x,S)}}var br=(e,t,n,r,i,a,o,s,c=1)=>{let l=Math.abs(Math.sin(n*_r)),u=Math.abs(Math.cos(n*_r)),d=.005+Math.min(l>1e-9?(a-r*u)/l:1/0,u>1e-9?(o-r*l)/u:1/0),f=e.map(()=>null),p=t.map(t=>gr(e[t]??``,d,c,i));p.forEach((e,n)=>f[t[n]]=e.text);let m=Math.min(a,p.reduce((e,t)=>Math.max(e,t.width*l+r*u),0)),[h,g]=s(p.map(e=>e.width));return{rotation:n,labels:f,depth:m,reach:n>0?{start:h*u,end:r*u}:{start:r*u,end:g*u}}},xr=.71,Sr=1.07,Cr=.0122,wr={titleTop:2,titleInsetX:3,titleInsetY:1.5,legendEdge:2,legendEdgeFar:2,legendTitleGap:6,plotMargin:7,plotMarginRight:7,plotMarginBottom:7,plotGap:11,overhang:6,insideRight:0,valueBand:Qt,categoryBand:$t,legend:`classic`},Tr={titleTop:1,titleInsetX:0,titleInsetY:0,legendEdge:1,legendEdgeFar:1.8,legendTitleGap:3.6,plotMargin:1,plotMarginRight:1.8,plotMarginBottom:1.8,plotGap:3.6,overhang:0,insideRight:.7,valueBand:{perLine:Qt.perLine,offset:Qt.offset+3.3},categoryBand:{perLine:$t.perLine,offset:$t.offset+5.3},legend:`chartEx`},Er={key:6,keyGap:4.875,entryGap:7.875,padStart:9.85,padEnd:3.8,sidePadEnd:4.8,insetY:7.05,rowGap:6.9,keyDrop:.7},Dr=3.795,Or=.922,kr=.995,Ar=.9,jr=1.5,Mr=.277,Nr=.5,Pr=e=>.663*e+.45,Fr=e=>.846*e+1.78,Ir=2/3,Lr=e=>{if(e.average)return e.average;let t=e.fit;if(!(t&&e.to>e.from))return[];let n=e.from;(t.type===`log`||t.type===`power`)&&n<=0&&(n=e.to/120);let r=t.type===`linear`?1:120,i=[];for(let a=0;a<=r;a++){let o=n+(e.to-n)*a/r,s=t.at(o);Number.isFinite(s)&&i.push({x:o,y:s})}return i},Rr=(e,t)=>e.amounts.map((n,r)=>{let i=e.about===`point`?t[r]:e.about;return n&&i!=null?{from:i-n.minus,to:i+n.plus,minus:n.minus,plus:n.plus}:null}),zr=(e,t)=>{let n=[],r=[],i=()=>{r.length>1&&n.push(r),r=[]};for(let n=1;n<e.length;n++){let a=e[n-1],o=e[n],s=o.x-a.x,c=o.y-a.y,l=0,u=1,d=[[-s,a.x-t.x],[s,t.x+t.width-a.x],[-c,a.y-t.y],[c,t.y+t.height-a.y]],f=!0;for(let[e,t]of d){if(e===0){t<0&&(f=!1);continue}let n=t/e;e<0?l=Math.max(l,n):u=Math.min(u,n)}if(!f||l>u){i();continue}let p={x:a.x+l*s,y:a.y+l*c},m={x:a.x+u*s,y:a.y+u*c};(l>0||r.length===0)&&(i(),r.push(p)),r.push(m),u<1&&i()}return i(),n},Br=Math.tan(18.17*Math.PI/180),Vr=class{constructor(e,t,n){this._chart=e,this._measurer=t,this._width=n.width/Zt-8,this._height=n.height/Zt-8,this._chrome=e.chartEx?Tr:wr}lineHeight(e){return this._measurer.lineHeight(e)}textWidth(e,t){return this._measurer.width(e,t)}labelSize(e){let t=e.text.split(`
21
+ `);return{width:t.reduce((t,n)=>Math.max(t,this.textWidth(n,e.font)),0)+6,height:t.length*this.lineHeight(e.font)+3}}trendlines(e,t,n){if(e.trendlines)return e.trendlines.map((r,i)=>{let a=Lr(r).map(e=>t(e.x,e.y)),o=a[a.length-1];return{id:`${e.id}:t${i}`,name:r.name,paths:zr(a,n).map(e=>e.map(e=>({x:I(e.x),y:I(e.y)}))),stroke:z(r.stroke),label:r.label&&o?this.trendlineLabel(r.label,o,n):null}})}errorBars(e,t,n,r){if(e.errorBars)return e.errorBars.map((i,a)=>{let o=n(i.direction),s=[];if(o){let e=2.625,n=(e,t,n)=>o.horizontal?[{x:e,y:t},{x:n,y:t}]:[{x:t,y:e},{x:t,y:n}],a=(t,n)=>o.horizontal?[{x:t,y:n-e},{x:t,y:n+e}]:[{x:n-e,y:t},{x:n+e,y:t}];Rr(i,o.plotted).forEach((e,c)=>{let l=t(c);if(!e||!l)return;let u=o.horizontal?l.y:l.x,d=o.toPt(e.from),f=o.toPt(e.to);if(!Number.isFinite(d)||!Number.isFinite(f))return;let p=[n(d,u,f)];i.cap&&e.minus>0&&p.push(a(d,u)),i.cap&&e.plus>0&&p.push(a(f,u));for(let e of p)for(let t of zr(e,r))s.push(t.map(e=>({x:I(e.x),y:I(e.y)})))})}return{id:`${e.id}:e${a}`,direction:i.direction,paths:s,stroke:z(i.stroke)}})}trendlineLabel(e,t,n){let r={...e.font,size:e.font.size*Ir},i=t=>this.textWidth(t.text,t.superscript?r:e.font),a=e=>e.reduce((e,t)=>e+i(t),0),o=this.lineHeight(e.font),s=n.width-6,c=e.lines.flatMap(e=>a(e)>s?cn(e,s,a):[e]),l=c.reduce((e,t)=>Math.max(e,a(t)),0)+6,u=c.length*o+3,d=this._width+8,f=this._height+8,p=Math.max(-4,Math.min(d-4-l,t.x-6-l)),m=Math.max(n.y+6,Math.min(n.y+n.height-u,t.y-u/2));return e.moved&&(p=e.moved.xEdge?e.moved.x*d-4:p+e.moved.x*d,m=e.moved.yEdge?e.moved.y*f-4:m+e.moved.y*f),{rect:L(p,m,l,u),insets:{left:F(3),top:F(jr),right:F(3),bottom:F(jr)},font:R(e.font),lines:c.map(e=>e.map(e=>e.superscript?{text:e.text,superscript:!0}:{text:e.text})),lineHeight:F(o),superscriptSize:F(r.size),fill:e.fill,border:z(e.border)}}labelLayout(e,t,n){return{text:e.text,rect:L(t.x,t.y,n.width,n.height),insets:{left:F(3),top:F(jr),right:F(3),bottom:F(jr)},font:R(e.font),fill:e.fill,border:z(e.border)}}pointLabels(e,t){if(!e.labels)return;let n=3+e.markerSize/2;return e.labels.map((e,r)=>{let i=t[r];if(!e||!i)return null;let a=this.labelSize(e),o=i.x-a.width/2,s=i.y-a.height/2;switch(e.position){case`l`:o=i.x-n-a.width;break;case`t`:s=i.y-n-a.height;break;case`b`:s=i.y+n;break;case`ctr`:break;default:o=i.x+n}return this.labelLayout(e,{x:o,y:s},a)})}barLabels(e,t,n){if(e.labels)return e.labels.map((e,r)=>{let i=t[r];if(!e||!i)return null;let a=this.labelSize(e),o=n?a.width:a.height,s=i.end===i.base?n?1:-1:Math.sign(i.end-i.base),c=i.box,l=(n?c.x+c.width/2:c.y+c.height/2)-o/2;switch(e.position){case`outEnd`:l=s>0?i.end+3:i.end-3-o;break;case`inEnd`:l=s>0?i.end-3-o:i.end+3;break;case`inBase`:l=s>0?i.base+3:i.base-3-o}let u=n?c.y+c.height/2-a.height/2:c.x+c.width/2-a.width/2;return this.labelLayout(e,n?{x:l,y:u}:{x:u,y:l},a)})}pieLabel(e,t,n){let r=e.labels?.[t];if(!r)return null;let i=this.labelSize(r),a=i.width/2,o=i.height/2,s=Math.sin(n.middle),c=Math.cos(n.middle),l,u;if(r.position===`ctr`){let e=(n.innerRadius+n.outerRadius)/2;l=n.center.x+e*s,u=n.center.y-e*c}else if(r.position===`inEnd`){let e=Math.min(Math.abs(s)>1e-9?a/Math.abs(s):1/0,Math.abs(c)>1e-9?o/Math.abs(c):1/0),t=.963*n.outerRadius-e;l=n.center.x+t*s,u=n.center.y-t*c}else{let e=Math.abs(c)>1e-9?Math.abs(s/c):1/0,t=Math.sign(s)*Math.min(1,e/Br),r=Math.sign(c)*Math.min(1,e>0?1/e:1/0);l=n.center.x+1.052*n.outerRadius*s+a*t,u=n.center.y-1.04*n.outerRadius*c-o*r}return this.labelLayout(r,{x:l-a,y:u-o},i)}areaLabels(e,t){if(e.labels)return e.labels.map((e,n)=>{let r=t[n];if(!e||!r)return null;let i=this.labelSize(e);return this.labelLayout(e,{x:r.x-i.width/2,y:(r.top+r.bottom)/2-i.height/2},i)})}axisTitleSize(e){let t=this.textWidth(e.text,e.font)+6,n=this.lineHeight(e.font)+3;return Math.abs(e.rotation??0)===90?{width:n,height:t}:{width:t,height:n}}title(){let e=this._chart.title;if(!e||!e.text)return null;let{titleInsetX:t,titleInsetY:n,titleTop:r}=this._chrome,i=this.textWidth(e.text,e.font)+2*t,a=this.lineHeight(e.font)+2*n,o={x:(this._width-i)/2,y:r,width:i,height:a};return{box:o,layout:{text:e.text,rect:L(o.x,o.y,o.width,o.height),insets:{left:F(t),top:F(n),right:F(t),bottom:F(n)},font:R(e.font)}}}legend(e){let t=this._chart.legend;if(!t||t.entries.length===0)return null;if(this._chrome.legend===`chartEx`)return this.chartExLegend(t,e);let n=this.lineHeight(t.font),r=.45*n,i=t.entries.some(e=>e.key===`line`&&!!this.entryStroke(e)?.dash),a=t.entries.some(e=>e.key===`line`)?i?15.75:12:r,o=2*a,s=t.entries.map(e=>o+this.textWidth(e.text,t.font)),c=t.position===`r`||t.position===`l`||t.position===`tr`,l,u=[];if(c){let r=Math.max(...s)+3+3,i=n+6-Cr*t.font.size,a=s.length*i,o=t.position===`l`?2:this._width-2-r,c=e&&!this._chart.title?.overlay?e.y+e.height+11:7,d=t.position===`tr`?e?e.y+e.height+6:2:(c+this._height-7-a)/2;l={x:o,y:d,width:r,height:a},s.forEach((e,t)=>{u.push({x:o+1.5,y:d+3+t*i,width:e+3,height:n})})}else{let r=s.reduce((e,t)=>e+t,0),i=.9*(this._width+8),a=n+6-Cr*t.font.size,o=n=>t.position===`t`?e?e.y+e.height+6:2:this._height-2-n;if(r<=i){let e=Math.min(1.2*r,i),t=(e-r)/(s.length+1);l={x:(this._width-e)/2,y:o(a),width:e,height:a};let c=l.x+t;for(let e of s)u.push({x:c,y:l.y+3,width:e,height:n}),c+=e+t}else{let e=Math.max(...s),t=Math.ceil(s.length/Math.max(1,Math.floor(i/e))),r=Math.ceil(s.length/t),c=r*e,d=t*a-1.5;l={x:(this._width-c)/2,y:o(d),width:c,height:d},s.forEach((t,i)=>{u.push({x:l.x+i%r*e,y:l.y+3+Math.floor(i/r)*a,width:e,height:n})})}}return{box:l,layout:{rect:L(l.x,l.y,l.width,l.height),orient:c?`vertical`:`horizontal`,font:R(t.font),entries:t.entries.map((e,t)=>{let n=u[t];return{seriesId:e.seriesId,...e.pointIndex===void 0?{}:{pointIndex:e.pointIndex},...e.trendlineIndex===void 0?{}:{trendlineIndex:e.trendlineIndex},...e.bandIndex===void 0?{}:{bandIndex:e.bandIndex},text:e.text,rect:L(n.x,n.y,n.width,n.height),keyRect:L(n.x+a/2,n.y+r/2,a,r),...e.swatch?{swatch:{fill:e.swatch.fill,stroke:z(e.swatch.stroke)}}:{}}})}}}entryStroke(e){for(let t of this._chart.groups){let n=t.series.find(t=>t.id===e.seriesId);if(n)return e.trendlineIndex===void 0?n.stroke:n.trendlines?.[e.trendlineIndex]?.stroke??null}return null}chartExLegend(e,t){let{key:n,keyGap:r,entryGap:i,padStart:a,padEnd:o,sidePadEnd:s,insetY:c,rowGap:l,keyDrop:u}=Er,d=this._chrome,f=this.lineHeight(e.font),p=e.entries.map(t=>n+r+this.textWidth(t.text,e.font)),m=e.position===`r`||e.position===`l`||e.position===`tr`,h=t&&!this._chart.title?.overlay?t.y+t.height:null,g=[],_;if(m){let t=Math.max(...p)+a+s,n=p.length*(f+l)-l+2*c,r=e.position===`l`?d.legendEdge:this._width-d.legendEdgeFar-t,i=h===null?d.plotMargin:h+d.plotGap,o=e.position===`tr`?h===null?d.legendEdge:h+d.legendTitleGap:(i+this._height-d.plotMarginBottom-n)/2;_={x:r,y:o,width:t,height:n},p.forEach((e,t)=>g.push({x:r+a,y:o+c+t*(f+l),width:e,height:f}))}else{let t=.9*(this._width+8),n=p.reduce((e,t)=>e+t,0)+(p.length-1)*i,r=Math.max(...p)+i,s=n+a+o<=t?p.length:Math.max(1,Math.floor((t-a-o+i)/r)),u=Math.ceil(p.length/s),m=(s===p.length?n:s*r-i)+a+o,v=u*(f+l)-l+2*c,y=e.position===`t`?h===null?d.legendEdge:h+d.legendTitleGap:this._height-d.legendEdgeFar-v;_={x:(this._width-m)/2,y,width:m,height:v};let b=_.x+a;p.forEach((e,t)=>{t%s===0&&(b=_.x+a),g.push({x:b,y:_.y+c+Math.floor(t/s)*(f+l),width:e,height:f}),b+=s===p.length?e+i:r})}return{box:_,layout:{rect:L(_.x,_.y,_.width,_.height),orient:m?`vertical`:`horizontal`,font:R(e.font),entries:e.entries.map((e,t)=>{let i=g[t];return{seriesId:e.seriesId,...e.pointIndex===void 0?{}:{pointIndex:e.pointIndex},...e.trendlineIndex===void 0?{}:{trendlineIndex:e.trendlineIndex},...e.bandIndex===void 0?{}:{bandIndex:e.bandIndex},text:e.text,rect:L(i.x-r,i.y,i.width+r,i.height),keyRect:L(i.x,i.y+(f-n)/2+u,n,n),...e.swatch?{swatch:{fill:e.swatch.fill,stroke:z(e.swatch.stroke)}}:{}}})}}}plotOuter(e,t){let{plotMargin:n,plotMarginRight:r,plotMarginBottom:i,plotGap:a}=this._chrome,o=n,s=this._width-r,c=e&&!this._chart.title?.overlay?e.y+e.height+a:n,l=this._height-i;if(t&&!this._chart.legend?.overlay){let e=t.box;t.position===`b`?l=e.y-a:t.position===`t`?c=e.y+e.height+a:t.position===`l`?o=e.x+e.width+a:t.position===`tr`?(s=e.x-a,c=e.y+e.height+5,l-=6):s=e.x-a}return{x:o,y:c,width:s-o,height:l-c}}label(e,t){return It(e.formatCode,function(e,t){if(t==null||t===`none`)return e;let n=Ee[t],r=n?n.multi:Number(t);return e/(Number.isFinite(r)&&r?r:1)}(t,e.displayUnit),this._chart.date1904)}logScale(e,t,n,r){let i=e.logBase,a=1/0,o=-1/0;for(let e of t)for(let t of e)t!==null&&t>0&&(t<a&&(a=t),t>o&&(o=t));a>o&&(a=1,o=i);let s=Ge(a,o,e.min,e.max,e.minorUnit,e.majorUnit,i,!1),c=e=>((e,t,n)=>{let r=[];for(let i=e;i<=t*(1+1e-9)&&r.length<1024;i=Number((i*n).toPrecision(15)))r.push(i);return r})(s.min,s.max,e),l=e.majorUnit!==void 0&&e.majorUnit>=i?e.majorUnit:i;if(e.majorUnit===void 0&&V(e)){let t=this.lineHeight(e.labelFont),a=e=>e.length+ +(e[e.length-1]<s.max*(1-1e-9)),o=r.horizontal?t=>(a(t)-1)*Dr*e.labelFont.size<=r.outer:e=>a(e)*kr*t-Ar<=n;for(;a(c(l))>2&&!o(c(l))&&l*i<=s.max/s.min;)l*=i}let u=c(l),d=Math.min(s.max,Math.max(s.min,1)),f=u.map(t=>this.label(e,t)),p=[...f,this.label(e,s.max),...i===10?[this.label(e,s.min/i)]:[]];return{...s,majorUnits:l,autoZero:d,logBase:i,ticks:u,labels:f,measured:p}}valueScale(e,t,n,r){if(e.logBase&&!r.percent)return this.logScale(e,t,n,r);let i=1/0,a=-1/0;for(let e of t)for(let t of e)t!==null&&(t<i&&(i=t),t>a&&(a=t));if(i>a&&(i=0,a=1),r.bubbleScale!==void 0&&!r.percent){let t=qe(i,a,e.min,e.max,e.minorUnit,e.majorUnit,!0,0),n=(t.max-t.min)*r.bubbleScale/600,o=i-n,s=a+n;t.min===0&&o>0&&(o=0),t.max===0&&s<0&&(s=0),[i,a]=[o,s]}let o=r.bubbleScale===void 0?.05:0,s=t=>r.percent?function(e,t,n,r,i,a){let o=N(r)?r:t,s=N(n)?n:e,c=N(a)?a:Ve(o-s),l=N(i)?i:He(c),u=Xe(n,r,c,e,0,e,t),d={min:N(n)?n:u[0],max:N(r)?r:u[u.length-1],majorUnits:c,minorUnits:l,autoZero:0};return d.autoZero=Ye(d.min,d.max),d}(Math.min(0,i),Math.max(0,a),e.min,e.max,e.minorUnit,t):qe(i,a,e.min,e.max,e.minorUnit,t,r.scatter,o),c=s(e.majorUnit);if(e.majorUnit===void 0&&V(e)){let t=this.lineHeight(e.labelFont),i=r.bubbleScale===void 0?Dr:3.5,a=n=>e.labelVertical?n.reduce((t,n)=>Math.max(t,Array.from(this.label(e,n)).length),1)*vr*t:t,o=r.horizontal?t=>(t.length-1)*i*e.labelFont.size<=r.outer:e=>(r.pitch?e.length-1:e.length)*a(e)<=n,l=Je(c.majorUnits,s,o);if(l!==c.majorUnits&&(c=s(l)),r.horizontal){let t={min:c.min,max:c.max},r=Je(c.majorUnits,()=>t,t=>(t.length-1)*Or*t.reduce((t,n)=>Math.max(t,this.textWidth(this.label(e,n),e.labelFont)),0)<=n);r!==c.majorUnits&&(c={...c,majorUnits:r})}}let l=Xe(c.min,c.max,c.majorUnits);return{...c,ticks:l,labels:l.map(t=>this.label(e,t))}}textContext(){return{lineHeight:e=>this.lineHeight(e),width:(e,t)=>this.textWidth(e,t)}}labelsContext(){return{points:(e,t)=>this.pointLabels(e,t),bars:(e,t,n)=>this.barLabels(e,t,n),areas:(e,t)=>this.areaLabels(e,t),pie:(e,t,n)=>this.pieLabel(e,t,n)}}frame(e,t,n,r){let i=this._chart,{inner:a}=e;return{width:(this._width+8)*Zt,height:(this._height+8)*Zt,chartArea:{fill:i.chartArea.fill,border:z(i.chartArea.border),cornerRadius:i.chartArea.cornerRadius*Zt},title:n,plotArea:{inner:L(a.x,a.y,a.width,a.height),outer:L(t.x,t.y,t.width,t.height),fill:i.plotArea.fill,border:z(i.plotArea.border)},axes:e.axes,groups:e.groups,legend:e.legend===void 0?r:e.legend}}chartContext(e,t,n){return{chart:this._chart,width:this._width,height:this._height,outer:e,at:I,px:F,title:t,legend:n,text:this.textContext(),labels:this.labelsContext(),label:(e,t)=>this.label(e,t),frame:r=>this.frame(r,e,t,n)}}build(){let e=this._chart,t=e=>ee.of(e),n=Hr(e),r=e=>{let n=t(e);return n.categoryAxis?n.categoryAxis(e):`x`},i=e=>t(e).coordinates===`cartesian`&&r(e)===null,a=(e,t)=>r(e)===`y`?{category:t.y,value:t.x}:{category:t.x,value:t.y},o=n.map(t=>sn(t,e.axes)),s=n.map(e=>t(e).stack?.(e)??(e=>{let t=e.series.map(e=>e.values);if(!an(e))return{own:t,tops:t};let n=t.reduce((e,t)=>Math.max(e,t.length),0),r=Array.from({length:n},(e,n)=>t.reduce((e,t)=>e+Math.abs(t[n]??0),0)),i=e.grouping===`percentStacked`?t.map(e=>e.map((e,t)=>e===null?null:r[t]>0?e/r[t]:0)):t,a=Array(n).fill(0),o=Array(n).fill(0);return{own:i,tops:i.map(e=>e.map((e,t)=>e===null?null:e<0?o[t]+=e:a[t]+=e))}})(e)),c=this.title(),l=this.legend(c?.box??null),u=this.plotOuter(c?.box??null,l&&e.legend?{box:l.box,position:e.legend.position}:null);if(n.length>0){let e=t(n[0]);if(e.coordinates===`own`&&e.layoutChart&&n.every(n=>t(n)===e))return e.layoutChart(n,this.chartContext(u,c?.layout??null,l?.layout??null))}let d=new Map,f=new Map;for(let t of e.axes){if(t.deleted)continue;let e=t.title?.text?this.axisTitleSize(t.title):null,n=t.displayUnitLabel?.text?this.axisTitleSize(t.displayUnitLabel):null;if(!e&&!n)continue;let r=t.position,i=e=>r===`l`||r===`r`?e.width:e.height,a=e?i(e):0,o=n?i(n):0,s=a+o+(e&&n?6:0),c;r===`l`?(c=u.x,u.x+=s,u.width-=s):r===`r`?(c=u.x+u.width,u.width-=s):r===`t`?(c=u.y,u.y+=s,u.height-=s):(c=u.y+u.height,u.height-=s);let l=(e,t)=>r===`l`||r===`t`?c+t:c-t-e;e&&d.set(t.id,{side:r,at:l(a,0),size:e}),n&&f.set(t.id,{side:r,at:l(o,s-o),size:n})}let p=e.axes.filter(e=>e.type===`val`),m=this._chrome.legend===`chartEx`,h=t=>e.axes.find(e=>e.id===t.crossAx),g=(e,t)=>{let r=(e=>n.filter((t,n)=>o[n]?.x===e||o[n]?.y===e))(e);return this.valueScale(e,(e=>n.flatMap((t,n)=>{let r=o[n];if(!r)return[];let c=t.series.flatMap(e=>e.trendlines??[]),l=c.map(e=>Lr(e).map(e=>e.y)),u=(e,n)=>t.series.flatMap((t,r)=>(t.errorBars??[]).filter(t=>t.direction===e).map(e=>Rr(e,n(r)).flatMap(e=>e?[e.from,e.to]:[])));return i(t)?r.y===e?[...s[n].tops,...l,...u(`y`,e=>s[n].tops[e])]:r.x===e?[...t.series.map(e=>e.xValues??[]),...c.map(e=>[e.from,e.to]),...u(`x`,e=>t.series[e].xValues??[])]:[]:a(t,r).value===e?[...s[n].tops,...an(t)?[]:l,...u(`y`,e=>s[n].tops[e])]:[]}))(e),t,{horizontal:B(e),pitch:m,outer:B(e)?u.width:u.height,percent:r.length>0&&r.every(e=>e.grouping===`percentStacked`),scatter:r.length>0&&r.every(i),...r.length>0&&r.every(e=>!!e.bubble)?{bubbleScale:Math.max(...r.map(e=>e.bubble.scale))}:{}})},_=new Map(p.map(e=>[e.id,g(e,B(e)?u.width:u.height)])),v=(e,t)=>e.crosses===`max`?t.max:e.crosses===`min`?t.min:Math.min(t.max,Math.max(t.min,e.crossesAt??t.autoZero)),y=e=>{let t=h(e);if(!t)return e.position;let n,r=t.type===`val`?_.get(t.id):void 0;if(n=e.tickLblPos===`low`||e.tickLblPos===`high`?e.tickLblPos:e.crosses===`max`||e.crosses===`min`?e.crosses===`max`?`high`:`low`:r?v(e,r)<=r.min?`low`:`inside`:(e.crossesAt??1)>1?`inside`:`low`,n===`inside`)return null;let i=n===`low`!=(t.orientation===`maxMin`);return B(e)?i?`b`:`t`:i?`l`:`r`},b=e=>{let t=y(e);if(t)return t;let n=h(e);return n&&n.type!==`val`&&n.orientation===`maxMin`?e.position===`l`?`r`:e.position===`r`?`l`:e.position===`b`?`t`:`b`:e.position},x=e=>e.type===`val`?0:(e.labelOffset-100)/100*(Mr*e.labelFont.size+Nr),S=e.date1904,C=e=>{if(e.type!==`date`)return null;for(let t=0;t<n.length;t++){if(o[t]?.x!==e&&o[t]?.y!==e)continue;let r=n[t].series.find(e=>e.categoryValues?.some(e=>e!==null));if(r)return r.categoryValues}return null},w=new Map,T=e=>{if(!w.has(e.id)){let t=C(e);w.set(e.id,t?function(e,t={}){let n=t.date1904??!1,r=e.filter(Number.isFinite),i=t.baseUnit??rr(r,n),a=1/0,o=-1/0;for(let e of r)e<a&&(a=e),e>o&&(o=e);a>o&&(a=o=0);let s=er(t.min??a,i,n),c=Math.max(s,er(t.max??o,i,n));return{min:s,max:c,baseUnit:i,count:nr(s,c,i,n)+1}}(t.filter(e=>e!==null),{min:e.min,max:e.max,baseUnit:e.baseTimeUnit,date1904:S}):null)}return w.get(e.id)},E=(e,t)=>{let n=T(e);if(!n)return t;let r=C(e)[t];return r==null?null:ir(n,r,S)},D=e=>{let t=T(e);if(t)return t.count;let r=0;return n.forEach((t,n)=>{if(o[n]?.x===e||o[n]?.y===e)for(let e of t.series){r=Math.max(r,e.values.length,e.categories.length);for(let t of e.trendlines??[])r=Math.max(r,Math.ceil(t.to-1e-9))}}),Math.max(1,r)},te=e=>{let t=D(e),r=T(e);if(r)return Array.from({length:t},(t,n)=>this.label(e,tr(r.min,n,r.baseUnit,S)));for(let r=0;r<n.length;r++){if(o[r]?.x!==e&&o[r]?.y!==e)continue;let i=n[r].series.find(e=>e.categories.length>0);if(i)return Array.from({length:t},(e,t)=>i.categories[t]??``)}return Array.from({length:t},(e,t)=>String(t+1))},ne=e=>{if(e.type===`val`||T(e))return null;for(let t=0;t<n.length;t++){if(o[t]?.x!==e&&o[t]?.y!==e)continue;let r=n[t].series.find(e=>e.categories.length>0);if(r)return r.categoryLevels??null}return null},re=e=>e.multiLevel&&ne(e)!==null,O=e=>re(e)?`between`:h(e)?.crossBetween??`between`,ie=p.filter(e=>!B(e)&&V(e)),ae=e=>{let t=this.lineHeight(e.labelFont);return e.labelVertical?(_.get(e.id)?.labels??[]).reduce((e,t)=>Math.max(e,Array.from(t).length),1)*vr*t:t},oe=ie.reduce((e,t)=>Math.max(e,ae(t)),0),k={b:0,t:0,l:0,r:0},se=new Map,ce=new Map,le=(e,t,n=1/0)=>{let r=ce.get(e.id);if(!r)return 0;let i=this.lineHeight(e.labelFont);return r.slice(0,n).reduce((e,n,r)=>e+n.depth+t*i+(r>=1?.75:0),0)},ue=()=>{k.b=0,k.t=0;for(let t of e.axes){if(!B(t)||!V(t))continue;let e=y(t);if(e!==`b`&&e!==`t`)continue;let n=this.lineHeight(t.labelFont),r=se.get(t.id)?.depth??n,i=d.get(t.id)?.side===e||f.get(t.id)?.side===e?6:0,a=this._chrome.categoryBand,o=le(t,a.perLine);k[e]=Math.max(k[e],r+a.perLine*n+a.offset+i+o+x(t))}},de=(t=oe/2)=>{let n=u.y,r=u.y+u.height,i=this._chrome.overhang;oe>0&&(n=Math.max(n,u.y-i+t)),r-=k.b>0?k.b:oe>0?Math.max(0,oe/2-i):0,k.t>0&&(n=Math.max(n,u.y+k.t));for(let t of e.axes){let e=se.get(t.id);if(!e||B(t)||t.type===`val`||!V(t))continue;let i=(u.width+12)/D(t)/2;n=Math.max(n,u.y+e.reach.end-i),r=Math.min(r,u.y+u.height-(e.reach.start-i))}return ce.size>0&&(r=Math.max(r,n+6)),{top:n,bottom:r}};ue();let fe=de(m?0:void 0),A=new Map;for(let e of p)B(e)||A.set(e.id,g(e,fe.bottom-fe.top));let j=new Set,pe=m&&new Set(ie.map(y)).size>1;if(m){let e=fe.bottom-fe.top;for(let t of ie){let n=A.get(t.id),r=ae(t);n&&(n.ticks.length-1)*r>e-r/2+1e-6&&j.add(t.id)}}let me=(e,t)=>{let n={length:t,horizontal:B(e),rotation:e.labelRotation,maxDepth:u.height/2,maxWidth:u.width/2-3.415,reversed:e.orientation===`maxMin`},r=T(e),i;if(r){let a=e.majorUnit===void 0?ur(r,t,e.labelFont.size,S):{count:e.majorUnit,unit:e.majorTimeUnit??r.baseUnit},o=Array(r.count).fill(null);for(let t of ar(r,a,S))o[t.slot]=this.label(e,t.serial);i=function(e,t,n,r){let i=e=>n.width(e,t),a=n.lineHeight(t),o=e.map((e,t)=>e===null?-1:t).filter(e=>e>=0),s=e.length;for(let e=1;e<o.length;e++)s=Math.min(s,o[e]-o[e-1]);let c=o.map(t=>i(e[t])),l=c.reduce((e,t)=>Math.max(e,t),0);if(!r.horizontal)return{skip:s,rotation:0,labels:[...e],depth:l,reach:{start:0,end:0}};let u=r.length/Math.max(1,o.length),d=s*r.length/Math.max(1,e.length),f=or*t.size,p=xr*i(r.sample)+Sr*t.size,m=r.rotation??(p<=u?0:Math.SQRT2*f<=d?45:90),h=e=>r.reversed?[e[e.length-1]??0,e[0]??0]:[e[0]??0,e[e.length-1]??0];if(m===0){let[t,n]=h(c);return{skip:s,rotation:m,labels:[...e],depth:a,reach:{start:t/2,end:n/2}}}return{skip:s,...br(e,o,m,a,i,r.maxDepth??1/0,r.length,h)}}(o,e.labelFont,this._measurer,{...n,sample:this.label(e,S?35411:36873)})}else{let r=re(e),a=(e=>{let t=te(e),n=ne(e);return!n||e.multiLevel?t:t.map((e,t)=>[e,...n.slice(1).map(e=>e[t]??``).filter(e=>e)].join(`
22
+ `))})(e);if(i=yr(a,e.labelFont,this._measurer,{...n,skip:e.labelSkip,innermost:r,vertical:e.labelVertical}),r){let r=D(e);ce.set(e.id,function(e,t){let n=[],r=new Set([0]);for(let i=e.length-1;i>=1;i--){let a=e[i],o=new Set(r);for(let e=0;e<t;e++)a[e]&&o.add(e);let s=[...o].sort((e,t)=>e-t);n.unshift(s.map((e,n)=>({first:e,last:(s[n+1]??t)-1,text:a[e]||null}))),r=o}return n}(ne(e),r).map(i=>function(e,t,n,r){let i=e=>n.width(e,t),a=r.length/Math.max(1,r.count),o=e=>(e.last-e.first+1)*a,s=e=>e.text!==null&&(r.skip===void 0||e.first%Math.max(1,Math.round(r.skip))===0),c=!r.horizontal||e.every(e=>!s(e)||fr(e.text,i)<=o(e)),l=e.map(e=>({...e,lines:s(e)?mr(e.text,c?o(e):.85*r.length,i,!r.horizontal):null}));return{groups:l,depth:l.reduce((e,t)=>Math.max(e,t.lines?.length??0),0)*n.lineHeight(t)}}(i,e.labelFont,this._measurer,{length:t,count:r,horizontal:n.horizontal,skip:e.labelSkip})))}else n.horizontal&&i.rotation===0&&a.some((e,t)=>i.labels[t]!==null&&e.includes(`
23
+ `))&&(i={...i,depth:i.depth+-.75})}return se.set(e.id,i),i};for(let t of e.axes){if(B(t)||!V(t))continue;let e=j.has(t.id)?0:t.type===`val`?t.labelVertical?vr*this.lineHeight(t.labelFont):(A.get(t.id).measured??A.get(t.id).labels).reduce((e,n)=>Math.max(e,this.textWidth(n,t.labelFont)),0):me(t,fe.bottom-fe.top).depth,n=y(t);if(n!==`l`&&n!==`r`)continue;let r=this.lineHeight(t.labelFont),i=d.get(t.id)?.side===n||f.get(t.id)?.side===n?6:0,a=this._chrome.valueBand,o=le(t,a.perLine);k[n]=Math.max(k[n],e+a.perLine*r+a.offset+i+o+x(t)+(pe&&t.type===`val`?5.7:0))}for(let t of e.axes)B(t)&&t.type!==`val`&&V(t)&&me(t,u.width-k.l-k.r);ue();let he=oe/2;if(m&&ie.length>0){let e=fe.bottom-fe.top;he=ie.reduce((t,n)=>{let r=A.get(n.id),i=ae(n);return r&&j.has(n.id)?Math.max(t,Math.min(i/2,Math.max(0,e-(r.ticks.length-1)*i))):Math.max(t,i/2)},0),pe&&(he+=1.05)}let{top:ge,bottom:_e}=de(m?he:void 0),ve=_e-ge,ye=u.x+k.l,be=u.x+u.width-k.r-this._chrome.insideRight;for(let t of e.axes){if(!B(t)||!V(t))continue;if(t.type!==`val`){let e=se.get(t.id),n=T(t)&&e.rotation===0?e.skip:1,r=O(t)===`midCat`?0:n*(u.width+12)/D(t)/2;ye=Math.max(ye,u.x+e.reach.start-r),be=Math.min(be,u.x+u.width-(e.reach.end-r));continue}let e=g(t,be-ye),n=e=>t.displayUnit===void 0?this.label(t,e):It(t.formatCode,e,this._chart.date1904),r=e.logBase?[n(e.ticks[0]),n(e.max)]:e.ticks.map(n);if(r.length===0)continue;let[i,a]=t.orientation===`maxMin`?[r[r.length-1],r[0]]:[r[0],r[r.length-1]];ye=Math.max(ye,u.x+this.textWidth(i,t.labelFont)/2),be=Math.min(be,u.x+u.width-this.textWidth(a,t.labelFont)/2)}for(let e of p)B(e)&&A.set(e.id,g(e,be-ye));let M={x:ye,y:ge,width:be-ye,height:ve},xe=n.map(t).find(e=>e.coordinates===`plot`&&e.plotRect);xe&&(M=xe.plotRect(n.filter(e=>t(e)===xe),M));let Se=(e,t,n)=>{let r=rn(e,n)??0;return t.orientation===`maxMin`?M.y+r*M.height:M.y+M.height-r*M.height},Ce=(e,t,n)=>{let r=rn(e,n)??0;return t.orientation===`maxMin`?M.x+M.width-r*M.width:M.x+r*M.width},we=(e,t)=>{let n=D(e),r=e.orientation===`maxMin`?n-1-t:t;return O(e)===`midCat`?M.x+(n===1?M.width/2:r*M.width/(n-1)):M.x+(r+.5)*M.width/n},Te=(e,t)=>{let n=D(e),r=e.orientation===`maxMin`?n-1-t:t;return O(e)===`midCat`?M.y+M.height-(n===1?M.height/2:r*M.height/(n-1)):M.y+M.height-(r+.5)*M.height/n},Ee=e=>{let t=y(e);return t?t===`b`?M.y+M.height:t===`t`?M.y:t===`l`?M.x:M.x+M.width:De(e)},De=e=>{let t=B(e),n=h(e),r=n?.type===`val`?A.get(n.id):void 0;if(n&&r){let i=v(e,r);return t?Se(r,n,i):Ce(r,n,i)}if(n&&e.crosses!==`max`&&e.crosses!==`min`&&e.crossesAt!==void 0)return((e,t,n)=>{let r=D(e),i=O(e)===`between`?r:Math.max(1,r-1),a=Math.min(i,Math.max(0,Math.round(t)-1));e.orientation===`maxMin`&&(a=i-a);let o=a/i;return n?M.y+M.height-o*M.height:M.x+o*M.width})(n,e.crossesAt,t);let i=n?e.crosses===`max`!=(n.orientation===`maxMin`):e.position===`t`||e.position===`r`;return t?i?M.y:M.y+M.height:i?M.x+M.width:M.x},Oe=e=>{let t=Ee(e);return Math.abs(t-De(e))>1e-6?{labelsAt:I(t)}:{}},ke=e=>e.flatMap(e=>zr(e,M)).map(e=>({from:{x:I(e[0].x),y:I(e[0].y)},to:{x:I(e[e.length-1].x),y:I(e[e.length-1].y)}})),Ae=(e,t)=>e.flatMap(e=>e[t]===null||e[t]===void 0?[]:[e[t]]),je=(e,t,n,r,i)=>{let a=o[t],s=a.x,c=Math.max(0,...r.map(e=>e.length)),l=e=>Se(n,a.y,(e=>Math.min(n.max,Math.max(n.min,e)))(e)),u=e=>{let t=E(s,e);return t===null?null:we(s,t)},d={},f=e.upDownBars;if(f){let e=[];if(r.length>1){let t=D(s),n=(O(s)===`midCat`?M.width/Math.max(1,t-1):M.width/Math.max(1,t))/(1+f.gapWidth/100),[i,a]=[r[0],r[r.length-1]];for(let t=0;t<c;t++){let r=u(t),[o,s]=[i[t],a[t]];if(r===null||o==null||s==null)continue;let[c,d]=[l(o),l(s)],p=(s>o?f.up:f.down).stroke?.width??0,m=Math.abs(c-d)<p?p:Math.abs(c-d);e.push({category:t,up:s>o,rect:L(r-n/2,Math.min(c,d),n,m)})}}d.upDownBars={id:`g${t}:upDown`,bars:e,up:{fill:f.up.fill,stroke:z(f.up.stroke)},down:{fill:f.down.fill,stroke:z(f.down.stroke)}}}let p=(e,t)=>{let n=[];for(let i=0;i<c;i++){let a=u(i),o=Ae(r,i),[s,c]=[e(o),t(o)];a!==null&&s!==null&&c!==null&&c>s&&n.push([{x:a,y:l(c)},{x:a,y:l(s)}])}return n};if(e.hiLowLines!==void 0){let n=p(e=>e.length>1?Math.min(...e):null,e=>e.length>1?Math.max(...e):null);d.hiLowLines={id:`g${t}:hiLow`,segments:ke(n),stroke:z(e.hiLowLines)}}if(e.dropLines!==void 0){let n=p(e=>e.length?Math.min(i,...e):null,e=>e.length?Math.max(i,...e):null);d.dropLines={id:`g${t}:drop`,segments:ke(n),stroke:z(e.dropLines)}}return d},Me=[],Ne=(n,r)=>{let c=o[r],l=c&&t(n).coordinates===`cartesian`&&!i(n)?a(n,c):null,d=l?.category??null,f=d&&T(d)?d:null,p=(e,t)=>{if(!d)return{x:Ce(A.get(c.x.id),c.x,e),y:Se(A.get(c.y.id),c.y,t)};let n=l.value,r=A.get(n.id),i=f?function(e,t,n=!1){if(e.baseUnit===`days`)return t-e.min;let r=nr(e.min,t,e.baseUnit,n),i=tr(e.min,r,e.baseUnit,n),a=tr(e.min,r+1,e.baseUnit,n);return r+(a>i?(t-i)/(a-i):0)}(T(f),e,S):e-1;return B(d)?{x:we(d,i),y:Se(r,n,t)}:{x:Ce(r,n,t),y:Te(d,i)}};return{chart:e,index:r,inner:M,outer:u,at:I,px:F,pair:c,roles:l,stack:s[r],scale:e=>A.get(e.id),categoryCount:D,crossValue:v,slotsOf:T,pointSlot:E,xOf:we,yOfCategory:Te,yOf:Se,xOfValue:Ce,base:e=>{let t=!c||an(n)?void 0:this.trendlines(e,p,M);return{id:e.id,name:e.name,values:e.values,...f?{slots:e.values.map((e,t)=>E(f,t))}:{},fill:e.fill,stroke:z(e.stroke),...t?{trendlines:t}:{}}},analysisLines:(e,t,i)=>je(n,r,e,t,i),segments:ke,errorBars:(e,t,n)=>this.errorBars(e,t,n,M),text:this.textContext(),labels:this.labelsContext()}};n.forEach((e,n)=>{let r=t(e);r.layout&&(r.coordinates!==`cartesian`||o[n])&&Me.push(r.layout(e,Ne(e,n)))});let Pe=e=>{let t=d.get(e.id);if(!t||!e.title)return null;let{width:n,height:r}=t.size,i=t.side===`b`||t.side===`t`,a=i?M.x+M.width/2-n/2:t.at,o=i?t.at:M.y+M.height/2-r/2,s=e.title.rotation??0;return{text:e.title.text,rect:L(a,o,n,r),insets:{left:F(3),top:F(jr),right:F(3),bottom:F(jr)},font:R(e.title.font),...s===0?{}:{rotation:s}}},Fe=(e,t,n)=>{let r=B(e),i=D(e),a=e.orientation===`maxMin`,o=e.labelFont,s=this.lineHeight(o),c=Ee(e),l=y(e)??e.position,u=l===`b`||l===`r`?1:-1,d=e=>{let t=a?i-e:e;return r?M.x+t*M.width/i:M.y+M.height-t*M.height/i},f=[],p=(r?tn(o.size):en(o.size))+x(e)+t.depth;for(let e of n){let t=p+(r?Pr(o.size):Fr(o.size)),n=[];for(let i of e.groups){if(!i.lines)continue;let e=(d(i.first)+d(i.last+1))/2,a=i.lines.reduce((e,t)=>Math.max(e,this.textWidth(t,o)),0),l=i.lines.length*s,f=c+u*t,p=u>0?f:f-l;n.push({text:i.lines.join(`
24
+ `),rect:r?L(e-a/2,p,a,l):L(p,e-a/2,l,a),insets:{left:0,top:0,right:0,bottom:0},font:R(o),...r?{}:{rotation:90},first:i.first,last:i.last,lineHeight:F(s)})}f.push({labels:n}),p=t+e.depth}let m=r?this._chrome.categoryBand:this._chrome.valueBand,h=n=>t.depth+m.perLine*s+m.offset+le(e,m.perLine,n)+6,g=e.majorTickMark===`cross`||e.majorTickMark===`in`?3:0,_=[];for(let t=0;t<=i;t++){let a=t===0||t===i?n.length:0;if(n.forEach((e,n)=>{e.groups.some(e=>e.first===t)&&(a=Math.max(a,n+1))}),a===0&&e.majorTickMark===`none`)continue;let o=d(t),[s,l]=[c-u*g,c+u*h(a)];_.push(r?{from:{x:I(o),y:I(s)},to:{x:I(o),y:I(l)}}:{from:{x:I(s),y:I(o)},to:{x:I(l),y:I(o)}})}return{levels:f,dividers:_}},Ie=e.axes.map(e=>{let t=V(e),n=(e=>{if(!e.majorGridlines)return;let t=B(e),n=e=>t?{from:{x:I(e),y:I(M.y)},to:{x:I(e),y:I(M.y+M.height)}}:{from:{x:I(M.x),y:I(e)},to:{x:I(M.x+M.width),y:I(e)}};if(e.type===`val`){let r=A.get(e.id);return r?r.ticks.map(i=>n(t?Ce(r,e,i):Se(r,e,i))):void 0}let r=D(e);return r===0?[]:O(e)===`midCat`?Array.from({length:r},(r,i)=>n(t?we(e,i):Te(e,i))):Array.from({length:r+1},(e,i)=>n(t?M.x+i*M.width/r:M.y+M.height-i*M.height/r))})(e),r=(e=>{let t=f.get(e.id),n=e.displayUnitLabel;if(!t||!n)return null;let{width:r,height:i}=t.size,a=t.side===`b`||t.side===`t`,o=y(e)??t.side,s,c;a?(s=M.x+M.width-r,c=o===t.side?t.at:o===`b`?M.y+M.height+k.b+6:M.y-k.t-6-i):(c=M.y,s=o===t.side?t.at:o===`r`?M.x+M.width+k.r+6:M.x-k.l-6-r);let l=n.rotation??0;return{text:n.text,rect:L(s,c,r,i),insets:{left:F(3),top:F(jr),right:F(3),bottom:F(jr)},font:R(n.font),...l===0?{}:{rotation:l}}})(e),i={id:e.id,crossAxisId:e.crossAx,position:on[b(e)],deleted:e.deleted,reversed:e.orientation===`maxMin`,line:z(e.line),majorGridlines:z(e.majorGridlines),...n?{gridlines:n}:{},tickMark:e.majorTickMark,tickLength:F(4),labelFont:t&&!j.has(e.id)?R(e.labelFont):null,labelMargin:F((B(e)?tn(e.labelFont.size):en(e.labelFont.size))+x(e)),lineAt:I(De(e)),...Oe(e),title:Pe(e),...r?{unitLabel:r}:{}};if(e.type===`val`){let n=A.get(e.id);return{...i,kind:`value`,min:n.min,max:n.max,majorUnit:n.majorUnits,...n.logBase?{logBase:n.logBase}:{},ticks:n.ticks.map((e,t)=>({value:e,label:n.labels[t]})),...e.labelVertical&&t?{labelVertical:!0,labelLineHeight:F(vr*this.lineHeight(e.labelFont))}:{}}}let a=te(e),o=se.get(e.id),s=ce.get(e.id);return{...i,kind:`category`,categories:a,labels:o?.labels??a,labelRotation:o?.rotation??0,labelLineHeight:F((o?.vertical?vr:1)*this.lineHeight(e.labelFont)),...o?.vertical?{labelVertical:!0}:{},crossBetween:O(e),...o&&s&&t?Fe(e,o,s):{}}});return{width:(this._width+8)*Zt,height:(this._height+8)*Zt,chartArea:{fill:e.chartArea.fill,border:z(e.chartArea.border),cornerRadius:e.chartArea.cornerRadius*Zt},title:c?.layout??null,plotArea:{inner:L(M.x,M.y,M.width,M.height),outer:L(u.x,u.y,u.width,u.height),fill:e.plotArea.fill,border:z(e.plotArea.border)},axes:Ie,groups:Me,legend:l?.layout??null}}};function Hr(e){return e.groups.filter(e=>{let t=ee.of(e);return!!t&&(t.drawn?.(e)??!0)})}var Ur=e=>ee.get(e.type===`custom`?`custom:${e.kind}`:e.type),Wr=(e,t)=>t.some(t=>mn(e,t,3)!==null),Gr=(e,t)=>t.some(t=>mn(e,[t.from,t.to],3)!==null),Kr=e=>{let t=fn(e);return t?ln(t,3):null},qr=e=>Kr(e.flatMap(e=>[e.from,e.to])),Jr=e=>Kr(e.flat()),Yr=e=>{let t=[];return`upDownBars`in e&&e.upDownBars&&t.push({name:`upDownBars`,rects:e.upDownBars.bars.map(e=>e.rect)}),`hiLowLines`in e&&e.hiLowLines&&t.push({name:`hiLoLines`,segments:e.hiLowLines.segments}),`dropLines`in e&&e.dropLines&&t.push({name:`dropLines`,segments:e.dropLines.segments}),`seriesLines`in e&&e.seriesLines&&t.push({name:`seriesLines`,segments:e.seriesLines.segments}),t},Xr=(e,t)=>{let{inner:n,outer:r}=t,i=e.position===`bottom`||e.position===`top`,a=e.position===`bottom`||e.position===`right`?1:-1,o=e.labelsAt??e.lineAt,s=e.position===`bottom`?n.y+n.height:e.position===`top`?n.y:e.position===`left`?n.x:n.x+n.width,c=e.position===`bottom`?r.y+r.height:e.position===`top`?r.y:e.position===`left`?r.x:r.x+r.width,l;if(e.labelFont){if(Math.abs(o-s)<=.5)l=c;else{let t=e.kind===`category`?Math.max(1,...e.labels.map(e=>e?e.split(`
25
+ `).length:1)):1,n=e.kind===`category`&&e.labelLineHeight>0?e.labelLineHeight:1.2*(e.labelFont.size??10);l=o+a*(e.tickLength+e.labelMargin+t*n)}}else l=o+a*Math.max(e.tickMark===`none`?0:e.tickLength,3);let u=o-3*a,d=Math.min(u,l),f=Math.max(u,l);return i?{x:n.x,y:d,width:n.width,height:f-d}:{x:d,y:n.y,width:f-d,height:n.height}},Zr=(e,t)=>{let n=Ur(e),r=e.series[t];return n?.pointBounds&&r?dn(r.values.map((r,i)=>n.pointBounds(e,t,i))):null},Qr=(e,t,n)=>{let r=Ur(e)?.hitTest?.(e,t);if(!r)return null;let i=n.series.get(e.series[r.series]?.id??``);return i?r.point===null?i:`${i}/points/${r.point}`:null},$r=e=>{let t=new Map;return e.forEach((e,n)=>t.set(e,n)),t},ei={rotX:15,rotY:20,depthPercent:100,rAngAx:!0},ti={rotX:15,rotY:20,depthPercent:100,rAngAx:!1},ni={rotX:30,rotY:0,depthPercent:100,rAngAx:!1},ri={rotX:15,rotY:20,rAngAx:!1},ii={rotX:90,rotY:0,rAngAx:!1,perspective:0},ai={columnClustered:{group:`bar`,family:`category`,barDir:`col`,grouping:`clustered`},columnStacked:{group:`bar`,family:`category`,barDir:`col`,grouping:`stacked`},columnStacked100:{group:`bar`,family:`category`,barDir:`col`,grouping:`percentStacked`},barClustered:{group:`bar`,family:`category`,barDir:`bar`,grouping:`clustered`},barStacked:{group:`bar`,family:`category`,barDir:`bar`,grouping:`stacked`},barStacked100:{group:`bar`,family:`category`,barDir:`bar`,grouping:`percentStacked`},line:{group:`line`,family:`category`,grouping:`standard`},lineStacked:{group:`line`,family:`category`,grouping:`stacked`},lineStacked100:{group:`line`,family:`category`,grouping:`percentStacked`},lineMarkers:{group:`line`,family:`category`,grouping:`standard`,markers:!0},lineMarkersStacked:{group:`line`,family:`category`,grouping:`stacked`,markers:!0},lineMarkersStacked100:{group:`line`,family:`category`,grouping:`percentStacked`,markers:!0},pie:{group:`pie`,family:`category`},pieExploded:{group:`pie`,family:`category`,exploded:!0},doughnut:{group:`doughnut`,family:`category`},pieOfPie:{group:`ofPie`,family:`category`,of:`pie`},barOfPie:{group:`ofPie`,family:`category`,of:`bar`},area:{group:`area`,family:`category`,grouping:`standard`},areaStacked:{group:`area`,family:`category`,grouping:`stacked`},areaStacked100:{group:`area`,family:`category`,grouping:`percentStacked`},xyscatter:{group:`scatter`,family:`scatter`,markers:!0,noLine:!0},xyscatterLines:{group:`scatter`,family:`scatter`,markers:!0},xyscatterLinesNoMarkers:{group:`scatter`,family:`scatter`},xyscatterSmooth:{group:`scatter`,family:`scatter`,markers:!0,smooth:!0},xyscatterSmoothNoMarkers:{group:`scatter`,family:`scatter`,smooth:!0},bubble:{group:`bubble`,family:`bubble`},bubble3DEffect:{group:`bubble`,family:`bubble`,bubble3D:!0},radar:{group:`radar`,family:`category`},radarMarkers:{group:`radar`,family:`category`,markers:!0},radarFilled:{group:`radar`,family:`category`,filled:!0},stockHLC:{group:`stock`,family:`category`,stock:{open:!1,volume:!1}},stockOHLC:{group:`stock`,family:`category`,stock:{open:!0,volume:!1}},stockVHLC:{group:`stock`,family:`category`,stock:{open:!1,volume:!0}},stockVOHLC:{group:`stock`,family:`category`,stock:{open:!0,volume:!0}},doughnutExploded:{group:`doughnut`,family:`category`,exploded:!0},surface:{group:`surface`,family:`category`,is3D:!0,view:ri,seriesAxis:!0},surfaceWireframe:{group:`surface`,family:`category`,is3D:!0,view:ri,seriesAxis:!0,wireframe:!0},surfaceTopView:{group:`surface`,family:`category`,view:ii,seriesAxis:!0,topView:!0},surfaceTopViewWireframe:{group:`surface`,family:`category`,view:ii,seriesAxis:!0,topView:!0,wireframe:!0},"3DColumn":{group:`bar`,family:`category`,barDir:`col`,grouping:`standard`,is3D:!0,view:ei,seriesAxis:!0},"3DColumnClustered":{group:`bar`,family:`category`,barDir:`col`,grouping:`clustered`,is3D:!0,view:ei},"3DColumnStacked":{group:`bar`,family:`category`,barDir:`col`,grouping:`stacked`,is3D:!0,view:ei},"3DColumnStacked100":{group:`bar`,family:`category`,barDir:`col`,grouping:`percentStacked`,is3D:!0,view:ei},"3DBarClustered":{group:`bar`,family:`category`,barDir:`bar`,grouping:`clustered`,is3D:!0,view:ei},"3DBarStacked":{group:`bar`,family:`category`,barDir:`bar`,grouping:`stacked`,is3D:!0,view:ei},"3DBarStacked100":{group:`bar`,family:`category`,barDir:`bar`,grouping:`percentStacked`,is3D:!0,view:ei},"3DLine":{group:`line`,family:`category`,grouping:`standard`,is3D:!0,view:{rotX:15,rotY:20,rAngAx:!1},seriesAxis:!0},"3DPie":{group:`pie`,family:`category`,is3D:!0,view:ni},"3DPieExploded":{group:`pie`,family:`category`,is3D:!0,view:ni,exploded:!0},"3DArea":{group:`area`,family:`category`,grouping:`standard`,is3D:!0,view:ti,seriesAxis:!0},"3DAreaStacked":{group:`area`,family:`category`,grouping:`stacked`,is3D:!0,view:ti},"3DAreaStacked100":{group:`area`,family:`category`,grouping:`percentStacked`,is3D:!0,view:ti},waterfall:{group:`waterfall`,family:`category`,chartEx:!0},treemap:{group:`treemap`,family:`category`,chartEx:!0},sunburst:{group:`sunburst`,family:`category`,chartEx:!0},histogram:{group:`histogram`,family:`category`,chartEx:!0},pareto:{group:`histogram`,family:`category`,chartEx:!0,pareto:!0},boxwhisker:{group:`boxWhisker`,family:`category`,chartEx:!0},funnel:{group:`funnel`,family:`category`,chartEx:!0},regionMap:{group:`regionMap`,family:`category`,chartEx:!0,seriesBy:`rows`}},oi=e=>!!ai[e].stock,si=500000001,ci=500000002,li=500000003,ui=500000004,di=500000005,fi={elements:[{after:`effectLst`,xml:`<a:sp3d/>`}]},pi=e=>({...e,unknown:fi}),U=e=>({type:`solid`,color:e}),W=(e=`tx1 lumMod 15 lumOff 85`)=>({width:.75,lineCap:`butt`,compound:`sng`,align:`ctr`,fill:U(e),lineJoin:`round`}),mi=()=>({spPr:{stroke:W(),effects:[]}}),G=(e,t,n=!1,r=`tx1 lumMod 65 lumOff 35`)=>({bodyPr:{rotation:t,spcFirstLastPara:!0,vertOverflow:`ellipsis`,vert:`horz`,wrap:`square`,anchor:`ctr`,anchorCtr:!0},lstStyle:{},paragraphs:[{pPr:{defaultRun:{size:e,weight:400,style:`normal`,underline:`none`,strike:`none`,kerning:12,...n?{letterSpacing:0}:{},baseline:0,color:U(r),latin:s.ThemeFamily.Body,eastAsian:s.ThemeFamily.Body,complexScript:s.ThemeFamily.Body}},endRun:{language:`en-US`}}]}),hi=-1e3,gi=[``,` lumMod 60`,` lumMod 80 lumOff 20`,` lumMod 80`,` lumMod 60 lumOff 40`,` lumMod 50`,` lumMod 70 lumOff 30`,` lumMod 70`,` lumMod 50 lumOff 50`],_i=e=>`accent${e%6+1}${gi[Math.floor(e/6)%gi.length]}`,vi=e=>({symbol:`circle`,size:5,spPr:{fill:U(e),stroke:{width:.75,fill:U(e)},effects:[]}}),yi=(e,t)=>({stroke:{width:t,lineCap:`round`,fill:e?U(e):{type:`none`},lineJoin:`round`},effects:[]}),bi=e=>({fill:U(e),stroke:{fill:{type:`none`}},effects:[]}),xi=(e,t,n,r,i)=>{switch(e.group){case`bar`:t.spPr=bi(n),t.invertIfNegative=!1;break;case`area`:t.spPr=bi(n);break;case`line`:if(e.is3D){t.spPr=bi(n);break}t.spPr=yi(n,2.25),t.marker=e.markers?vi(n):{symbol:`none`};break;case`surface`:t.spPr=Si(e,n);break;case`radar`:e.filled?t.spPr=bi(n):(t.spPr=yi(n,2.25),t.marker=e.markers?vi(n):{symbol:`none`});break;case`pie`:case`doughnut`:case`ofPie`:e.exploded&&(t.explosion=25),t.points=[];for(let n=0;n<i+ +(e.group===`ofPie`);n++)t.points.push({idx:n,bubble3D:!1,spPr:{fill:U(_i(n)),stroke:{width:e.is3D?2:1.5,fill:U(`lt1`)},effects:[]}});break;case`scatter`:t.spPr=e.noLine?yi(null,3):yi(n,1.5),t.marker=e.markers?vi(n):{symbol:`none`};break;case`bubble`:t.spPr=bi(`${n} alpha 0.75`),r>0&&(t.spPr.stroke={width:2,fill:{type:`none`}}),t.invertIfNegative=!1}},Si=(e,t)=>e.wireframe?yi(t,.75):pi({fill:U(t),stroke:{},effects:[]}),Ci=[`spPr`,`marker`,`invertIfNegative`,`explosion`,`points`,`smooth`,`bubble3D`],wi=e=>{for(let t of[e.spPr?.fill,e.spPr?.stroke?.fill]){let e=t;if(e?.type===`solid`&&typeof e.color==`string`)return e.color}return _i(e.idx??0)},Ti=e=>{let t=ai[e];return{type:t.group,barDir:t.barDir,grouping:t.grouping,markers:!!t.markers}},Ei=(e,t,n)=>{let r=ai[t],i={...e};for(let e of Ci)delete i[e];return xi(r,i,wi(e),e.idx??0,n),r.group!==`line`&&r.group!==`scatter`||(i.smooth=!!r.smooth),r.group===`bubble`&&(i.bubble3D=!!r.bubble3D),i},Di=(e,t)=>{for(let n of e)for(let e=n.rowStart;e<=n.rowEnd;e++)for(let r=n.colStart;r<=n.colEnd;r++)if(!t(e,r))return!1;return!0},Oi=(e,t,n)=>{let r=t.formula(e);if(n&&e.length===1){let t=e[0];if(t.rowEnd>t.rowStart&&t.colEnd>t.colStart)return{multiLvlStrRef:{f:r}}}let i=0;return Di(e,(e,n)=>{let r=t.kindAt(e,n);return(e=>e===`number`||e===`date`)(r)&&i++,r!==`text`})&&i>0?{numRef:{f:r}}:{strRef:{f:r}}},ki=(e,t)=>e?.[0]&&t.formatAt(e[0].rowStart,e[0].colStart)||`General`;function Ai(e,t){let n=((e,t)=>{if(!e)return null;let n=[];return Di(e,(e,r)=>{let i=t.kindAt(e,r);return i===`blank`||i===`date`&&(n.push(t.numberAt(e,r)),!0)})&&n.length>0?n:null})(e,t),r={type:n?`date`:`cat`};return e&&(r.numFmt={formatCode:ki(e,t),sourceLinked:!0}),n?(r.lblOffset=100,r.baseTimeUnit=rr(n,t.date1904)):(r.lblAlgn=`ctr`,r.lblOffset=100,r.noMultiLvlLbl=!1),r}function ji(e,t,n){let r=ai[e];if(r.chartEx)return Ri(r,Pi(t,n),t.seriesBy===`rows`);let i=r.group,a=r.family!==`category`,o=i===`pie`||i===`doughnut`||i===`ofPie`,s=!!r.is3D,c=t.series[0],l=c?.categories??null,u=t.series.map((e,c)=>{let l=_i(c),u={idx:c,order:c};e.name&&(u.tx={strRef:{f:n.formula(e.name)}});let d=e.categories?Oi(e.categories,n,!a):void 0,f={numRef:{f:n.formula(e.values)}};if(r.stock?.volume&&c===0)u.spPr={...bi(l),stroke:{width:3,fill:{type:`none`}}},u.invertIfNegative=!1;else if(r.stock){let e=!r.stock.open&&c===t.series.length-1;u.spPr=yi(null,3),u.marker=e?{...vi(l),symbol:`dot`,size:r.stock.volume?5:3}:{symbol:`none`}}else xi(r,u,l,c,(e=>{let t=0;for(let n of e)t+=(n.rowEnd-n.rowStart+1)*(n.colEnd-n.colStart+1);return t})(e.values));if(a?(d&&(u.xVal=d),u.yVal=f):(d&&(u.cat=d),u.val=f),i===`bubble`){let t=e.sizes;u.bubbleSize=typeof t==`number`||t===void 0?{numLit:{formatCode:`General`,ptCount:t??0,points:Array.from({length:t??0},(e,t)=>({idx:t,v:`1`}))}}:{numRef:{f:n.formula(t)}},u.bubble3D=!!r.bubble3D}return i!==`line`&&i!==`scatter`&&(i!==`stock`||r.stock?.volume&&c===0)||(u.smooth=!!r.smooth),s&&u.spPr&&i!==`surface`&&!o&&(u.spPr=pi(u.spPr)),u});if(r.stock)return function(e,t,n,r){let i=e.volume?t.slice(1):t,a=e.volume?[li,ui]:[si,ci],o=e=>({stroke:W(e),effects:[]}),s={type:`stock`,series:i,dLbls:{showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1},hiLowLines:{spPr:o(`tx1 lumMod 75 lumOff 25`)},axIds:a};e.open&&(s.upDownBars={gapWidth:150,upBars:{spPr:{fill:U(`lt1`),...o(`tx1 lumMod 65 lumOff 35`)}},downBars:{spPr:{fill:U(`dk1 lumMod 75 lumOff 25`),...o(`tx1 lumMod 65 lumOff 35`)}}});let c=[s];e.volume&&c.unshift({type:`bar`,barDir:`col`,grouping:`clustered`,varyColors:!1,series:t.slice(0,1),dLbls:{showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1},gapWidth:150,axIds:[si,ci]});let{type:l,numFmt:u,...d}=Ai(n.series[0]?.categories??null,r),f=l===`date`?`out`:`none`,p={type:l,axId:si,scaling:{orientation:`minMax`},delete:!1,axPos:`b`,majorTickMark:f,minorTickMark:`none`,tickLblPos:`nextTo`,spPr:{fill:{type:`none`},stroke:W(),effects:[]},txPr:G(9,hi),crossAx:ci,crosses:`autoZero`,auto:!0};u&&(p.numFmt=u);let m=zi(ci,si,`l`,ki(n.series[0]?.values??null,r),!1);m.crossBetween=`between`;let h=[{...p,...d},m];if(e.volume){let e=zi(ui,li,`r`,ki(n.series[1]?.values??null,r),!1);e.crosses=`max`,e.crossBetween=`between`;let t={type:l,axId:li,scaling:{orientation:`minMax`},delete:!0,axPos:`b`,majorTickMark:f,minorTickMark:`none`,tickLblPos:`nextTo`,crossAx:ui,auto:!0};u&&(t.numFmt=u),h.push(e,{...t,...d})}return{date1904:r.date1904,lang:`en-US`,roundedCorners:!1,chart:{title:{overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(14,0,!0)},autoTitleDeleted:!1,plotArea:{layout:{},groups:c,axes:h,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]}},legend:{legendPos:`b`,overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(9,0)},plotVisOnly:!0,dispBlanksAs:`gap`,showDLblsOverMax:!1},spPr:{fill:U(`bg1`),stroke:W(),effects:[]},txPr:{bodyPr:{},lstStyle:{},paragraphs:[{pPr:{defaultRun:{}},endRun:{language:`en-US`}}]}}}(r.stock,u,t,n);let d=o?[]:[si,ci];!o&&r.seriesAxis?d.push(di):!o&&s&&d.push(0);let f={type:i,series:u,axIds:d};if(s&&(f.is3D=!0),i===`bar`?(f.barDir=r.barDir,f.grouping=r.grouping):i===`line`||i===`area`?f.grouping=r.grouping:i===`scatter`?f.scatterStyle=r.smooth?`smoothMarker`:`lineMarker`:i===`radar`?f.radarStyle=r.filled?`filled`:`marker`:i===`surface`&&(f.wireframe=!!r.wireframe),i!==`surface`&&(f.varyColors=o,f.dLbls={showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1},o&&(f.dLbls.showLeaderLines=!0)),i===`bar`){let e=r.grouping!==`clustered`;s?(f.gapWidth=150,f.shape=`box`):(f.gapWidth=e?150:r.barDir===`bar`?182:219,e?f.overlap=100:r.barDir===`col`&&(f.overlap=-27))}else i===`line`?(r.markers&&(f.marker=!0),s||(f.smooth=!1)):i===`ofPie`?(f.ofPieType=r.of,f.gapWidth=100,f.secondPieSize=75,f.serLines=[{spPr:{stroke:W(`tx1 lumMod 35 lumOff 65`),effects:[]}}]):o?(s||(f.firstSliceAng=0),i===`doughnut`&&(f.holeSize=75)):i===`bubble`?(f.bubbleScale=100,f.showNegBubbles=!1):i===`surface`&&(f.bandFmts=Array.from({length:15},(e,t)=>({idx:t,spPr:Si(r,_i(t))})));let p=r.grouping===`percentStacked`,m=r.barDir===`bar`,h=[];if(a){let e=c?.categories??null,t=!!e&&!!Oi(e,n,!1).numRef;h.push(zi(si,ci,`b`,t?ki(e,n):null,!0)),h.push(zi(ci,si,`l`,ki(c?.values??null,n),!0))}else if(!o){let{type:e,numFmt:t,...a}=Ai(l,n),o={type:e,axId:si,scaling:{orientation:`minMax`},delete:!1,axPos:m?`l`:`b`,majorTickMark:e===`date`||i===`area`||i===`surface`||i===`line`&&s?`out`:`none`,minorTickMark:`none`,tickLblPos:`nextTo`,spPr:s&&i===`bar`?{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]}:{fill:{type:`none`},stroke:W(),effects:[]},txPr:G(9,hi),crossAx:ci,crosses:`autoZero`,auto:!0};t&&(o.numFmt=t),h.push({...o,...a});let u=zi(ci,si,m?`b`:`l`,p?`0%`:ki(c?.values??null,n),!1);u.crossBetween=i===`area`||i===`surface`?`midCat`:`between`,r.topView&&(u.tickLblPos=`none`),h.push(u),r.seriesAxis&&h.push(Mi(i===`bar`))}let g={title:{overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(i===`ofPie`?14.4:14,0,!0)},autoTitleDeleted:!1,plotArea:{layout:{},groups:[f],axes:h,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]}}};return r.view&&Object.assign(g,Ni(r.view,i===`area`)),(u.length>1||o)&&(g.legend={legendPos:i===`radar`?`t`:`b`,overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(9,0)}),g.plotVisOnly=!0,g.dispBlanksAs=i===`area`||i===`surface`||i===`line`&&r.grouping!==`standard`?`zero`:`gap`,g.showDLblsOverMax=!1,{date1904:n.date1904,lang:`en-US`,roundedCorners:!1,chart:g,spPr:{fill:U(`bg1`),stroke:W(),effects:[]},txPr:{bodyPr:{},lstStyle:{},paragraphs:[{pPr:{defaultRun:{}},endRun:{language:`en-US`}}]}}}var Mi=e=>({type:`ser`,axId:di,scaling:{orientation:`minMax`},delete:!1,axPos:`b`,majorTickMark:e?`none`:`out`,minorTickMark:`none`,tickLblPos:`nextTo`,spPr:e?{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]}:{fill:{type:`none`},stroke:W(),effects:[]},txPr:G(9,hi),crossAx:ci,crosses:`autoZero`}),Ni=(e,t)=>{let n=e=>({thickness:0,spPr:pi(e?{fill:{type:`none`},stroke:W(),effects:[]}:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]})});return{view3D:{...e},floor:n(t),sideWall:n(!1),backWall:n(!1)}},Pi=(e,t)=>e.series.map(n=>{let r={};n.name&&(r.tx={strRef:{f:t.formula(n.name)}}),n.categories&&(r.cat=Oi(n.categories,t,!0)),r.val={numRef:{f:t.formula(n.values)}};let i=n.name?.[0],a=n.categories?.[0];if(i&&a){let n=e.seriesBy===`rows`?{rowStart:a.rowStart,rowEnd:a.rowStart,colStart:i.colStart,colEnd:i.colStart}:{rowStart:i.rowStart,rowEnd:i.rowStart,colStart:a.colStart,colEnd:a.colStart};r.catName=t.formula([n])}return r}),Fi={waterfall:{dLblPos:`outEnd`,showSerName:!1,showCatName:!1,showVal:!0},treemap:{dLblPos:`inEnd`,showSerName:!1,showCatName:!0,showVal:!1},sunburst:{dLblPos:`ctr`,showSerName:!1,showCatName:!0,showVal:!1},funnel:{showSerName:!1,showCatName:!1,showVal:!0}},Ii={waterfall:.5,histogram:0,boxWhisker:1,funnel:.0599999987},Li={waterfall:{legendPos:`t`,align:`ctr`,overlay:!1},treemap:{legendPos:`t`,align:`ctr`,overlay:!1},regionMap:{legendPos:`r`,align:`min`,overlay:!1}};function Ri(e,t,n){let r=e.group,i=r===`treemap`||r===`sunburst`,a=e=>{if(!e)return;let t=e.numRef?`numRef`:e.strRef?`strRef`:e.multiLvlStrRef?`multiLvlStrRef`:null;if(!t)return e;let r=e[t].f;return{[t]:n?{f:r,dir:`row`}:{f:r}}},o=e=>e===void 0?void 0:n?{f:e,dir:`row`}:{f:e},s=t.map((t,n)=>{let s={};r!==`boxWhisker`&&(s.idx=e.pareto?2*n:n),n>0&&r!==`boxWhisker`&&(s.hidden=!0),t.tx&&(s.tx=t.tx.strRef?{strRef:{f:t.tx.strRef.f}}:t.tx);let c=Fi[r];c&&(s.dLbls={...c}),r===`treemap`?s.layoutPr={parentLabelLayout:`overlapping`}:r===`histogram`?s.layoutPr=e.pareto?{aggregation:{}}:{binning:{intervalClosed:`r`}}:r===`boxWhisker`&&(s.layoutPr={visibility:{meanLine:!1,meanMarker:!0,nonoutliers:!1,outliers:!0},statistics:{quartileMethod:`exclusive`}});let l=a(t.cat),u=a(t.val);if(r===`regionMap`){let e=o(t.catName);l&&(s.cat=e?{...l,nf:e}:l);let n=o(t.tx?.strRef?.f);u&&(s.color=n?{...u,nf:n}:u)}else l&&(s.cat=l),i?s.bubbleSize=u:s.val=u;return e.pareto&&(s.cumulativeLine={idx:2*n+1,axIds:[2]}),s}),c=[],l=Ii[r];l!==void 0&&c.push({type:`cat`,axId:0,scaling:{gapWidth:l}}),r!==`waterfall`&&r!==`histogram`&&r!==`boxWhisker`||c.push({type:`val`,axId:1,scaling:{},majorGridlines:{}}),e.pareto&&c.push({type:`val`,axId:2,scaling:{max:1,min:0},dispUnits:{builtInUnit:`percentage`}});let u={title:{overlay:!1,pos:`t`,align:`ctr`},plotArea:{groups:[{type:r,series:s,axIds:e.pareto?[1]:[]}],axes:c}},d=Li[r];return d&&(u.legend={...d}),{chart:u}}function zi(e,t,n,r,i){let a={type:`val`,axId:e,scaling:{orientation:`minMax`},delete:!1,axPos:n,majorGridlines:mi()};return r!==null&&(a.numFmt={formatCode:r,sourceLinked:!0}),a.majorTickMark=`none`,a.minorTickMark=`none`,a.tickLblPos=`nextTo`,a.spPr=i?{fill:{type:`none`},stroke:W(`tx1 lumMod 25 lumOff 75`),effects:[]}:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},a.txPr=G(9,hi),a.crossAx=t,a.crosses=`autoZero`,i&&(a.crossBetween=`midCat`),a}var Bi=[`tx`,`cat`,`val`,`xVal`,`yVal`,`bubbleSize`];function Vi(e,t){let n=e.chart.plotArea,r=t.chart.plotArea.groups[0]?.series??[],i=[];n.groups.forEach((e,t)=>e.series.forEach((e,n)=>i.push({group:t,index:n,series:e}))),i.sort((e,t)=>(e.series.order??0)-(t.series.order??0));let a=n.groups.map(()=>[]),o=Math.max(-1,...i.map(e=>e.series.idx??-1))+1;r.forEach((e,t)=>{let n=i[t];if(n){let r={...n.series};for(let t of Bi)e[t]===void 0?delete r[t]:r[t]=e[t];n.series.points&&e.points&&(r.points=[...n.series.points.filter(t=>t.idx<e.points.length),...e.points.filter(e=>!n.series.points.some(t=>t.idx===e.idx))]),r.order=t,a[n.group].push(r)}else{let n=i[i.length-1]?.group??0;a[n].push({...e,idx:o++,order:t})}});let s=n.groups.map((e,t)=>({...e,series:a[t]})).filter(e=>e.series.length>0);s.length===0&&(s=n.groups.slice(0,1).map(e=>({...e,series:[]})));let c=new Set(s.flatMap(e=>e.axIds)),l=n.axes.filter(e=>c.has(e.axId)||c.size===0),u=t.chart.plotArea.axes.find(e=>e.type===`cat`||e.type===`date`);return u&&(l=l.map(e=>{if(e.type!==`cat`&&e.type!==`date`||!0!==e.auto||e.type===u.type)return e;let t={...e,type:u.type,majorTickMark:u.majorTickMark,numFmt:u.numFmt};for(let e of[`lblAlgn`,`noMultiLvlLbl`,`baseTimeUnit`])u[e]===void 0?delete t[e]:t[e]=u[e];return t})),{...e,chart:{...e.chart,plotArea:{...n,groups:s,axes:l}}}}var Hi=500000001,Ui=500000002,Wi=[`spPr`,`marker`,`invertIfNegative`,`explosion`,`points`,`smooth`,`bubble3D`,`bubbleSize`],Gi=[`hidden`,`layoutPr`,`cumulativeLine`,`uniqueId`,`color`,`entityId`],Ki=[`auto`,`lblAlgn`,`lblOffset`,`tickLblSkip`,`tickMarkSkip`,`noMultiLvlLbl`,`baseTimeUnit`,`majorTimeUnit`,`minorTimeUnit`],qi=(e,t,n)=>{if(e.group===`pie`||e.group===`doughnut`||e.group===`ofPie`)return[];let r=n.find(e=>e.axIds.length>0),i=r?t.filter(e=>r.axIds.includes(e.axId)&&e.type!==`ser`):[];if(i.length<2||i.some(e=>e.axPos===void 0))return[{type:`cat`,axId:Hi,scaling:{orientation:`minMax`},delete:!1,axPos:`b`,numFmt:{formatCode:`General`,sourceLinked:!0},majorTickMark:`out`,minorTickMark:`none`,tickLblPos:`nextTo`,spPr:{fill:{type:`none`},stroke:W(),effects:[]},txPr:G(9,hi),crossAx:Ui,auto:!0,lblAlgn:`ctr`,lblOffset:100,noMultiLvlLbl:!1},{type:`val`,axId:Ui,scaling:{orientation:`minMax`},delete:!1,axPos:`l`,majorGridlines:mi(),numFmt:{formatCode:`General`,sourceLinked:!0},majorTickMark:`out`,minorTickMark:`none`,tickLblPos:`nextTo`,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(9,hi),crossAx:Hi,crossBetween:`between`}];let a=e.group===`scatter`||e.group===`bubble`,o=e.group===`bar`&&e.barDir===`bar`,s=r.type===`surface`&&!r.is3D;return i.map(t=>{let n={...t},i=t.type!==`val`||(r.type===`scatter`||r.type===`bubble`)&&t.axId===r.axIds[0];if(a){n.type=`val`;for(let e of Ki)delete n[e];n.crossBetween=`midCat`}else i?(n.type===`val`&&(n.type=`cat`,delete n.crossBetween,n.auto=!0,n.lblAlgn=`ctr`,n.lblOffset=100,n.noMultiLvlLbl=!1),e.group!==`radar`||n.majorGridlines||(n.majorGridlines=mi())):(n.crossBetween=e.group===`area`||e.group===`surface`?`midCat`:`between`,e.grouping===`percentStacked`?n.numFmt={formatCode:`0%`,sourceLinked:!0}:t.numFmt?.formatCode===`0%`&&t.numFmt.sourceLinked&&(n.numFmt={formatCode:`General`,sourceLinked:!0}),e.topView?n.tickLblPos=`none`:s&&n.tickLblPos===`none`&&(n.tickLblPos=`nextTo`));if(!a&&e.group!==`radar`){let e=i?o?`l`:`b`:o?`b`:`l`,r=i?o?`r`:`t`:o?`t`:`r`;n.axPos=t.axPos===`t`||t.axPos===`r`?r:e}return n})},Ji=(e,t,n)=>{let r=(e=>ai[e])(t),i=e.chart.plotArea,a=i.groups.flatMap(e=>e.series.map(t=>({series:t,fromScatter:e.type===`scatter`}))).sort((e,t)=>(e.series.order??0)-(t.series.order??0));if(r.chartEx)return((e,t,n)=>{let r=Ri(t,n.map(e=>{let t={};e.tx&&(t.tx=e.tx);let n=e.cat??e.xVal;n&&(t.cat=n);let r=e.val??e.yVal??e.bubbleSize??e.color;return r&&(t.val=r),t}),!1),i=(e=>{let t=e?.tx?.rich;return t?t.paragraphs.map(e=>(e.runs??[]).map(e=>e.text).join(``)).join(`
26
+ `).trim()||void 0:e?.tx?.v})(e.chart.title);return i!==void 0&&r.chart.title&&(r.chart.title={...r.chart.title,tx:{v:i}}),{...e,chart:r.chart}})(e,r,a.map(e=>e.series));let o=i.groups.every(e=>e.type!==`custom`&&!Yi.has(e.type))||i.groups.every(e=>e.type===`custom`),s=a.map(({series:e,fromScatter:t},i)=>{let a=((e,t,n,r)=>{let i={};for(let t of Wi)i[t]=e[t];let a={...e};for(let e of Wi)delete a[e];for(let e of Gi)delete a[e];let o=i.spPr??i.points?.[0]?.spPr,s=wi({...e,spPr:o}),c=t.group===`line`&&!!t.is3D,l=t.group===`line`&&!c||t.group===`scatter`||t.group===`radar`&&!t.filled,u=t.group===`bar`||t.group===`area`||t.group===`bubble`||t.group===`radar`&&!!t.filled||c;if(t.group===`surface`)a.spPr=Si(t,s);else if(u)a.spPr=(e=>{let t=e?.fill?.type;return t!==void 0&&t!==`none`})(o)?o:bi(s),t.group!==`bar`&&t.group!==`bubble`||(a.invertIfNegative=i.invertIfNegative??!1),t.group===`bubble`&&(a.bubbleSize=i.bubbleSize??{numLit:{formatCode:`General`,ptCount:n,points:Array.from({length:n},(e,t)=>({idx:t,v:`1`}))}},a.bubble3D=!!t.bubble3D),t.is3D&&a.spPr&&(a.spPr=pi(a.spPr));else if(l)a.spPr=t.noLine?yi(null,2):(e=>{let t=e?.stroke?.fill?.type;return t!==void 0&&t!==`none`})(o)?o:yi(s,r?1.5:2.25),a.marker=t.markers?i.marker?.symbol&&i.marker.symbol!==`none`?i.marker:vi(s):{symbol:`none`},t.group!==`radar`&&(a.smooth=!!t.smooth);else{t.exploded&&(a.explosion=25);let e=o?.stroke??{fill:{type:`none`}};a.points=i.points?.length?i.points:Array.from({length:n},(t,n)=>({idx:n,bubble3D:!1,spPr:{fill:U(_i(n)),stroke:{...e},effects:[]}}))}return a})(e,r,n.get(e.idx??-1)??0,t);return o||(a.idx??=i,a.order??=i),a}),c=qi(r,i.axes,i.groups);r.seriesAxis&&c.push(Mi(r.group===`bar`));let l=c.map(e=>e.axId),u=((e,t,n,r)=>{let i=n[0],a=i?.dLbls?{...i.dLbls}:{showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1};delete a.showLeaderLines;let o={type:e.group,series:t,axIds:r};switch(e.group){case`bar`:o.barDir=e.barDir,o.grouping=e.grouping,o.varyColors=!1,o.dLbls=a,o.gapWidth=n.find(e=>e.type===`bar`)?.gapWidth??(r.length>0&&n.some(e=>e.axIds.length>0)?219:150),e.grouping!==`stacked`&&e.grouping!==`percentStacked`||(o.overlap=100);break;case`line`:o.grouping=e.grouping,o.varyColors=!1,o.dLbls=a,e.markers&&(o.marker=!0),e.is3D||(o.smooth=!1);break;case`area`:o.grouping=e.grouping,o.varyColors=!1,o.dLbls=a;break;case`pie`:case`doughnut`:o.varyColors=!0,o.dLbls={...a,showLeaderLines:!0},e.is3D||(o.firstSliceAng=0),e.group===`doughnut`&&(o.holeSize=50);break;case`scatter`:o.scatterStyle=e.smooth?`smoothMarker`:`lineMarker`,o.varyColors=!1,o.dLbls=a;break;case`bubble`:o.varyColors=!1,o.dLbls=a,o.bubbleScale=100,o.showNegBubbles=!1;break;case`radar`:o.radarStyle=e.filled?`filled`:`marker`,o.varyColors=!1,o.dLbls=a;break;case`surface`:o.wireframe=!!e.wireframe,o.bandFmts=Array.from({length:15},(t,n)=>({idx:n,spPr:Si(e,_i(n))}))}return o})(r,s.map(e=>{let t=r.group===`scatter`||r.group===`bubble`,n={...e},[i,a,o,s]=t?[`cat`,`val`,`xVal`,`yVal`]:[`xVal`,`yVal`,`cat`,`val`];return n[i]!==void 0&&(n[o]=n[i],delete n[i]),n[a]!==void 0&&(n[s]=n[a],delete n[a]),n}),i.groups,l),d={...e.chart,plotArea:{...i,groups:[u],axes:c}};if(r.view){r.is3D&&(u.is3D=!0),r.group===`bar`&&(u.shape=`box`,delete u.overlap),r.is3D&&!r.seriesAxis&&l.length>0&&(u.axIds=[...l,0]);let e=t===`3DColumnClustered`?{rotX:15,rotY:20,rAngAx:!1}:r.view;Object.assign(d,Ni(e,r.group===`area`))}else delete d.view3D,delete d.floor,delete d.sideWall,delete d.backWall;return o||(d.autoTitleDeleted??=!1,d.plotVisOnly??=!0,d.dispBlanksAs??=`gap`,d.showDLblsOverMax??=!1,d.plotArea.layout===void 0&&(d.plotArea={...d.plotArea,layout:{},spPr:d.plotArea.spPr??{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]}})),{...e,chart:d}},Yi=new Set([`waterfall`,`histogram`,`boxWhisker`,`treemap`,`sunburst`,`funnel`,`regionMap`]),K=e=>t=>e.reduce((e,t)=>t(e),t),q=(e,t,n)=>{if(n===void 0){if(!(t in e))return e;let n={...e};return delete n[t],n}return e[t]===n?e:{...e,[t]:n}},Xi=(e,t)=>{let n=t(e.chart);return n===e.chart?e:{...e,chart:n}},Zi=(e,t)=>Xi(e,e=>{let n=t(e.plotArea);return n===e.plotArea?e:{...e,plotArea:n}}),J=(e,t,n)=>Zi(e,e=>{let r=!1,i=e.axes.map(e=>{if(e.axId!==t)return e;let i=n(e);return i!==e&&(r=!0),i});return r?{...e,axes:i}:e}),Y=(e,t,n)=>Zi(e,e=>{let r=!1,i=e.groups.map(e=>{let i=e.series.find(e=>e.idx===t);if(!i)return e;let a=n(e,i);return a!==e&&(r=!0),a});return r?{...e,groups:i}:e}),Qi=(e,t,n)=>Y(e,t,(e,t)=>{let r=n(t);return r===t?e:{...e,series:e.series.map(e=>e===t?r:e)}}),$i=(e,t,n)=>{let r=t?.paragraphs?.[0]?.pPr?.defaultRun;return{bodyPr:{...t?.bodyPr??{}},lstStyle:{},paragraphs:e.split(/\r?\n/).map(e=>({...r?{pPr:{defaultRun:r}}:{},runs:[{text:e,...n?{rPr:{language:n}}:{}}]}))}},ea=(e,t,n)=>{if(e!==null)return e.startsWith(`=`)&&e.length>1?{strRef:{f:e.slice(1)}}:{rich:$i(e,t,n)}},ta=(e,t)=>Xi(e,n=>{let r=n.title;if(!j(e)){let e=t(r??{pos:`t`,align:`ctr`,overlay:!1});return e===r?n:{...n,title:e}}let i=t(r??{overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(14,0,!0)});return i===r&&!0!==n.autoTitleDeleted?n:{...n,title:i,autoTitleDeleted:!1}}),na=(e,t)=>Xi(e,n=>{let r=n.legend,i=t(r??(j(e)?{legendPos:`r`,overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(9,0)}:{legendPos:`r`,align:`min`,overlay:!1}));return i===r?n:{...n,legend:i}}),ra=(e,t,n)=>r=>J(r,e,e=>{let r=q(e.scaling??{},t,n===`auto`?void 0:n);return r===e.scaling?e:{...e,scaling:r}}),ia=(e,t,n)=>r=>J(r,e,e=>q(e,t,n===`auto`?void 0:n)),aa=e=>e.axPos===`l`||e.axPos===`r`?-90:0,oa=(e,t,n)=>r=>Zi(r,r=>{let i=!1,a=r.groups.map(n=>{if(!n.axIds.includes(e))return n;let r=n.series.map(e=>q(e,`cat`,t));return r.every((e,t)=>e===n.series[t])?n:(i=!0,{...n,series:r})}),o=n?r.axes.map(t=>{if(t.axId!==e)return t;let r=ca(t,n);return r!==t&&(i=!0),r}):r.axes;return i?{...r,groups:a,axes:o}:r}),sa=[`lblAlgn`,`lblOffset`,`noMultiLvlLbl`,`baseTimeUnit`],ca=(e,t)=>{let n=e;if(!0===e.auto&&(e.type===`cat`||e.type===`date`)&&e.type!==t.type){n={...e,type:t.type};for(let e of sa)n=q(n,e,t[e])}return t.numFmt&&!1!==n.numFmt?.sourceLinked&&n.numFmt?.formatCode!==t.numFmt.formatCode&&(n={...n,numFmt:{...n.numFmt,...t.numFmt}}),n},la=(e,t,n)=>r=>J(r,e,e=>n?e[t]?e:{...e,[t]:t===`majorGridlines`?mi():{spPr:{stroke:W(`tx1 lumMod 5 lumOff 95`),effects:[]}}}:q(e,t,void 0)),ua=(e,t)=>n=>Qi(n,e,e=>t===null?q(e,`tx`,void 0):t.startsWith(`=`)&&t.length>1?{...e,tx:{strRef:{f:t.slice(1)}}}:{...e,tx:{v:t}}),da=(e,t,n)=>r=>Y(r,e,(e,r)=>{let i=e.type===`scatter`||e.type===`bubble`,a=q(r,t===`bubbleSizes`?`bubbleSize`:t===`values`?i?`yVal`:`val`:i?`xVal`:`cat`,n);return a===r?e:{...e,series:e.series.map(e=>e===r?a:e)}}),fa=(e,t)=>n=>Qi(n,e,e=>{let n=e.spPr??{};return`fill`in t&&(n=q(n,`fill`,t.fill)),`stroke`in t&&(n=q(n,`stroke`,t.stroke)),n===e.spPr?e:q(e,`spPr`,Object.keys(n).length>0?n:void 0)}),pa=(e,t)=>n=>Y(n,e,(e,n)=>{let r=n.marker??{};if(t.symbol!==void 0){if(t.symbol===`none`)r={...r.unknown?{unknown:r.unknown}:{},symbol:`none`};else if(r=q(r,`symbol`,t.symbol),r.size===void 0&&(r={...r,size:5}),!r.spPr){let e=n.spPr?.stroke?.fill?.color??n.spPr?.fill?.color;e&&(r={...r,spPr:{fill:{type:`solid`,color:e},stroke:{width:.75,fill:{type:`solid`,color:e}},effects:[]}})}}if(t.size!==void 0&&(r=q(r,`size`,t.size)),t.spPr!==void 0&&(r=q(r,`spPr`,t.spPr??void 0)),r===n.marker)return e;let i={...e,series:e.series.map(e=>e===n?{...n,marker:r}:e)};return e.type===`line`&&t.symbol!==void 0&&(i=q(i,`marker`,t.symbol!==`none`||void 0)),i}),ma=[`showLegendKey`,`showVal`,`showCatName`,`showSerName`,`showPercent`,`showBubbleSize`],ha=()=>{let e=G(9,0,!1,`tx1 lumMod 75 lumOff 25`);return e.bodyPr={...e.bodyPr,lIns:38100,tIns:19050,rIns:38100,bIns:19050},e.bodyPr.unknown={elements:[{after:``,xml:`<a:spAutoFit/>`}]},{spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:e,showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1,showLeaderLines:!1}},ga=e=>!!e&&!e.delete&&ma.some(t=>t!==`showLegendKey`&&!0===e[t]),_a=(e,t,n)=>Y(e,t,(e,t)=>{let r=t.dLbls,i=n(r&&!r.delete?r:{...ha(),...r?.labels?{labels:r.labels}:{}},e);return i===r?e:{...e,series:e.series.map(e=>e===t?{...t,dLbls:i}:e)}}),va=(e,t)=>n=>Y(n,e,e=>{let n=e.dLbls??{showLegendKey:!1,showVal:!1,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1};return t.showVal!==void 0&&(n=q(n,`showVal`,t.showVal)),t.dLblPos!==void 0&&(n=q(n,`dLblPos`,t.dLblPos)),n===e.dLbls?e:{...e,dLbls:n}}),ya=(e,t,n)=>r=>_a(r,e,e=>q(e,t,n)),ba=[`linear`,`exp`,`poly`,`movingAvg`],xa=(e,t)=>({spPr:{stroke:{width:1.5,lineCap:`round`,fill:{type:`solid`,color:t},dash:`sysDot`},effects:[]},trendlineType:e,...e===`poly`?{order:2}:e===`movingAvg`?{period:2}:{},dispRSqr:!1,dispEq:!1}),Sa=()=>({numFmt:{formatCode:`General`,sourceLinked:!1},spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(9,0)}),Ca=(e,t)=>n=>Qi(n,e,e=>({...e,trendlines:[...e.trendlines??[],t]})),wa=(e,t,n)=>r=>Qi(r,e,e=>{let r=e.trendlines?.[t];if(!r)return e;let i=n(r);return i===r?e:{...e,trendlines:e.trendlines.map(e=>e===r?i:e)}}),Ta=(e,t)=>n=>Qi(n,e,e=>{if(!e.trendlines?.[t])return e;let n=e.trendlines.filter((e,n)=>n!==t);return q(e,`trendlines`,n.length>0?n:void 0)}),Ea=(e,t,n,r)=>wa(e,t,e=>q(e,n,r>0?r:void 0)),Da=(e,t,n,r)=>wa(e,t,e=>{let t=q(e,n,r);return t.dispEq||t.dispRSqr?t.trendlineLbl||(t={...t,trendlineLbl:Sa()}):t=q(t,`trendlineLbl`,void 0),t}),Oa=(e,t,n)=>wa(e,t,e=>{let t=e.spPr??{};return`fill`in n&&(t=q(t,`fill`,n.fill)),`stroke`in n&&(t=q(t,`stroke`,n.stroke)),t===e.spPr?e:q(e,`spPr`,Object.keys(t).length>0?t:void 0)}),X=(e,t)=>{let n=e.spPr??{};return`fill`in t&&(n=q(n,`fill`,t.fill)),`stroke`in t&&(n=q(n,`stroke`,t.stroke)),n===e.spPr?e:q(e,`spPr`,Object.keys(n).length>0?n:void 0)},ka={fixedVal:5,percentage:5,stdDev:1},Aa=(e,t,n)=>r=>Y(r,e,(e,r)=>{let i=r.errBars??[],a=i.findIndex(e=>(e=>e.errDir===`x`?`x`:`y`)(e)===t),o=a>=0?i[a]:void 0,s=n(o??((e,t)=>({...t.type===`bar`?{}:{errDir:e},errBarType:`both`,errValType:`fixedVal`,noEndCap:!1,val:5,spPr:{fill:{type:`none`},stroke:W(`tx1 lumMod 65 lumOff 35`),effects:[]}}))(t,e));if(s===o)return e;let c;c=s?a>=0?i.map((e,t)=>t===a?s:e):[...i,s]:i.filter((e,t)=>t!==a);let l=q(r,`errBars`,c.length>0?c:void 0);return l===r?e:{...e,series:e.series.map(e=>e===r?l:e)}}),ja=(e,t,n)=>Aa(e,t,e=>n?e:void 0),Ma=(e,t,n)=>Aa(e,t,e=>{if(e.errValType===n)return e;let t=q(e,`errValType`,n);return t=q(t,`val`,ka[n]),n!==`cust`&&(t=q(t,`plus`,void 0),t=q(t,`minus`,void 0)),t}),Na=(e,t,n)=>Aa(e,t,e=>X(e,n)),Pa={hiLowLines:`tx1 lumMod 75 lumOff 25`,dropLines:`tx1 lumMod 35 lumOff 65`,serLines:`tx1 lumMod 35 lumOff 65`},Fa=(e,t,n)=>r=>Y(r,e,e=>{let r=((e,t)=>t===`serLines`?e.serLines?.[0]:e[t])(e,t),i=n(r??(e=>({spPr:{stroke:W(Pa[e]),effects:[]}}))(t));return i===r?e:((e,t,n)=>t===`serLines`?q(e,`serLines`,n?[n]:void 0):q(e,t,n))(e,t,i)}),Ia=(e,t,n)=>Fa(e,t,e=>n?e:void 0),La=(e,t,n)=>Fa(e,t,e=>X(e,n)),Ra=(e,t)=>n=>Y(n,e,e=>{let n=e.upDownBars,r=t(n??(e=>{let t=e=>({type:`solid`,color:e});if(e.type===`stock`){let e=W(`tx1 lumMod 65 lumOff 35`);return{gapWidth:150,upBars:{spPr:{fill:t(`lt1`),stroke:e,effects:[]}},downBars:{spPr:{fill:t(`dk1 lumMod 75 lumOff 25`),stroke:{...e},effects:[]}}}}let n=e=>({width:.75,fill:t(e)});return{gapWidth:150,upBars:{spPr:{fill:t(`lt1`),stroke:n(`tx1 lumMod 15 lumOff 85`),effects:[]}},downBars:{spPr:{fill:t(`dk1 lumMod 65 lumOff 35`),stroke:n(`tx1 lumMod 65 lumOff 35`),effects:[]}}}})(e));return r===n?e:q(e,`upDownBars`,r)}),za=(e,t)=>Ra(e,e=>t?e:void 0),Ba=(e,t)=>Ra(e,e=>q(e,`gapWidth`,t)),Va=(e,t,n)=>Ra(e,e=>{let r=X(e[t]??{},n);return r===e[t]?e:{...e,[t]:r}}),Ha=[`size`,`weight`,`style`,`underline`,`strike`,`letterSpacing`,`baseline`,`color`,`latin`,`eastAsian`,`complexScript`,`fallbacks`],Ua=(e,t)=>{let n=e.paragraphs.length?e.paragraphs:[{}],r=n!==e.paragraphs,i=n.map(e=>{let n=((e,t)=>{let n={...e};if(t.clear)for(let e of Ha)n=q(n,e,void 0);if(t.size!==void 0&&(n=q(n,`size`,t.size)),t.weight!==void 0&&(n=q(n,`weight`,t.weight)),t.italic!==void 0&&(n=q(n,`style`,t.italic?`italic`:`normal`)),t.underline!==void 0&&(n=q(n,`underline`,t.underline)),t.strike!==void 0&&(n=q(n,`strike`,t.strike)),t.letterSpacing!==void 0&&(n=q(n,`letterSpacing`,t.letterSpacing===0?void 0:t.letterSpacing)),t.baseline!==void 0&&(n=q(n,`baseline`,t.baseline===0?void 0:t.baseline)),t.color!==void 0&&(n=q(n,`color`,t.color===null?void 0:{type:`solid`,color:t.color})),t.family!==void 0){let e=t.family??s.ThemeFamily.Body;n=q(n,`latin`,e),n=q(n,`eastAsian`,e),n=q(n,`complexScript`,e)}return t.fallbacks!==void 0&&(n=q(n,`fallbacks`,t.fallbacks?.length?[...t.fallbacks]:void 0)),n})(e.pPr?.defaultRun,t);return e.pPr?.defaultRun&&Object.keys(n).every(t=>n[t]===e.pPr.defaultRun[t])&&Object.keys(e.pPr.defaultRun).length===Object.keys(n).length?e:(r=!0,{...e,pPr:{...e.pPr,defaultRun:n}})});return r?{...e,paragraphs:i}:e},Wa=(e,t,n,r=0)=>{let i=e,a=e.txPr||!t.clear?Ua(e.txPr??G(n,r),t):e.txPr;if(a!==e.txPr&&(i={...i,txPr:a}),e.tx?.rich){let n=Ua(e.tx.rich,t);n!==e.tx.rich&&(i={...i,tx:{...e.tx,rich:n}})}return i},Ga=e=>e?.tx?.rich?.paragraphs?.[0]?.pPr?.defaultRun??e?.txPr?.paragraphs?.[0]?.pPr?.defaultRun,Ka=(e,t)=>n=>Ji(n,e,t),qa=(e,t)=>n=>Xi(n,n=>({...n,plotArea:{...n.plotArea,groups:n.plotArea.groups.map(n=>({...n,type:`custom`,custom:{kind:e,...t?{options:t}:{}}}))}})),Ja=e=>t=>Xi(t,t=>q(t,`plotVisOnly`,e)),Ya=e=>t=>Zi(t,t=>X(t,e)),Xa=(e,t)=>Zi(e,e=>{let n=e.dTable,r=t(n??(()=>{let e=G(9,0);return e.paragraphs[0].pPr={rtl:!1,...e.paragraphs[0].pPr},{showHorzBorder:!0,showVertBorder:!0,showOutline:!0,showKeys:!0,spPr:{fill:{type:`none`},stroke:W(),effects:[]},txPr:e}})());return r===n?e:{...e,dTable:r}}),Za=(e,t)=>n=>Xa(n,n=>q(n,e,t)),Qa=(e,t,n)=>na(e,e=>{let r=e.entries??[],i=r.findIndex(e=>e.idx===t),a=i>=0?r[i]:void 0,o=n(a??{idx:t});if(o===a)return e;let s;return s=o?i>=0?r.map((e,t)=>t===i?o:e):[...r,o].sort((e,t)=>e.idx-t.idx):r.filter((e,t)=>t!==i),q(e,`entries`,s.length?s:void 0)}),$a=(e,t)=>n=>J(n,e,e=>{let n=q(e.scaling??{},`logBase`,t??void 0);return n===e.scaling?e:{...e,scaling:n}}),eo=()=>({spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(10,-90)}),to=(e,t)=>n=>J(n,e,e=>{if(t===null)return q(e,`dispUnits`,void 0);let n=e.dispUnits,r={...n?.unknown?{unknown:n.unknown}:{}};return typeof t==`number`?r.custUnit=t:r.builtInUnit=t,!n?.dispUnitsLbl&&n||(r.dispUnitsLbl=n?.dispUnitsLbl??eo()),n&&n.custUnit===r.custUnit&&n.builtInUnit===r.builtInUnit&&n.dispUnitsLbl===r.dispUnitsLbl?e:{...e,dispUnits:r}}),no=e=>e.axPos===`l`||e.axPos===`r`?`r`:`t`,ro=(e,t,n)=>t.crossAx===void 0?e:J(e,t.crossAx,e=>e.delete?e:q(e,`axPos`,n===`far`?no(e):n===`near`?(e=>e.axPos===`l`||e.axPos===`r`?`l`:`b`)(e):(e=>({l:`r`,r:`l`,b:`t`,t:`b`})[e.axPos??`b`])(e))),io=(e,t)=>n=>{let r=n.chart.plotArea.axes.find(t=>t.axId===e);if(!r||r.crossAx===void 0)return n;let i=J(n,r.crossAx,e=>{let n=q(e,`crosses`,typeof t==`number`?void 0:t);return n=q(n,`crossesAt`,typeof t==`number`?t:void 0),n});return t===`max`?i=ro(i,r,`far`):t!==`min`&&t!==`autoZero`||(i=ro(i,r,`near`)),i},ao=(e,t,n)=>r=>J(r,e,e=>q(e,t,n)),oo=(e,t)=>{let n=((e,t)=>{let n=e??G(9,0).bodyPr;return t===`vertical`?{...n,rotation:0,vert:`wordArtVert`}:{...n,rotation:t===`auto`?hi:t===0?0:-t,vert:`horz`}})(e.bodyPr,t);return e.bodyPr&&n.rotation===e.bodyPr.rotation&&n.vert===e.bodyPr.vert?e:{...e,bodyPr:n}},so=(e,t)=>n=>J(n,e,e=>t?e.title?e:{...e,title:{overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(10,aa(e))}}:q(e,`title`,void 0)),co=(e,t,n)=>r=>J(r,e,e=>q(e,t,n??void 0)),lo=(e,t,n,r)=>i=>J(i,e,e=>{if(e.type!==`date`)return e;let i=q(e,t===`major`?`majorUnit`:`minorUnit`,n??void 0);return i=q(i,t===`major`?`majorTimeUnit`:`minorTimeUnit`,n===null?void 0:r),i}),uo=e=>e.groups.flatMap(e=>e.series.map(t=>({group:e,series:t}))).sort((e,t)=>(e.series.order??0)-(t.series.order??0)),fo=(e,t)=>{let n=e.groups.flatMap(e=>e.series.map(t=>({group:e,series:t}))).sort((e,n)=>t(e.series)-t(n.series)),r=new Map(n.map(({series:e},t)=>[e,t])),i=e.groups.map(e=>{let t=[...e.series].sort((e,t)=>r.get(e)-r.get(t)).map(e=>q(e,`order`,r.get(e)));return t.every((t,n)=>t===e.series[n])?e:{...e,series:t}});return i.every((t,n)=>t===e.groups[n])?e:{...e,groups:i}},po=e=>{let t=uo(e),n=!1,r=e.axes.map(e=>{if(!e.numFmt||!1===e.numFmt.sourceLinked)return e;let r=t.find(t=>t.group.axIds.includes(e.axId)),i=e.type!==`val`;return r&&(i?r.series.cat??r.series.xVal:r.series.val??r.series.yVal??r.series)?e:(n=!0,q(e,`numFmt`,void 0))});return n?{...e,axes:r}:e},mo=(e,t)=>n=>Zi(n,n=>{let r=n.groups;if(r.length===0)return n;let i=r.flatMap(e=>e.series),a=Math.max(-1,...i.map(e=>e.idx??-1))+1,o=r[r.length-1],s=o.type===`scatter`||o.type===`bubble`,c={idx:a,order:i.length};e.tx&&(c.tx=e.tx),c=((e,t,n)=>{let r=_i(t.idx??0),i={...t};switch(e.type){case`bar`:i.spPr=bi(r),i.invertIfNegative=!1;break;case`area`:i.spPr=bi(r);break;case`line`:case`radar`:if(e.type===`radar`&&e.radarStyle===`filled`){i.spPr=bi(r);break}i.spPr=yi(r,2.25),i.marker=(e.type===`line`?!1!==e.marker&&e.series.some(e=>e.marker?.symbol!==`none`):e.radarStyle===`marker`)?vi(r):{symbol:`none`},e.type===`line`&&(i.smooth=!1);break;case`scatter`:i.spPr=yi(null,2),i.marker=vi(r),i.smooth=!1;break;case`bubble`:i.spPr={...bi(`${r} alpha 0.75`),stroke:{width:2,fill:{type:`none`}}},i.invertIfNegative=!1,i.bubble3D=!1;break;case`pie`:case`doughnut`:case`ofPie`:i.points=Array.from({length:n},(e,t)=>({idx:t,bubble3D:!1,spPr:{fill:U(_i(t)),stroke:{width:1.5,fill:U(`lt1`)},effects:[]}}))}return i})(o,c,e.count),e.cat&&(c[s?`xVal`:`cat`]=e.cat),e.val&&(c[s?`yVal`:`val`]=e.val),e.bubbleSize&&o.type===`bubble`&&(c.bubbleSize=e.bubbleSize);let l={...n,groups:r.map(e=>e===o?{...o,series:[...o.series,c]}:e)};if(t!==void 0&&t<i.length){let e=Math.max(0,t);l=fo(l,t=>t===c?e-.5:t.order??0)}return po(l)}),ho=(e,t)=>n=>Y(n,e,(e,n)=>{if(e.type!==`pie`&&e.type!==`doughnut`&&e.type!==`ofPie`||n.points?.length||t<=0)return e;let r=Array.from({length:t},(e,t)=>({idx:t,bubble3D:!1,spPr:{fill:U(_i(t)),stroke:{width:1.5,fill:U(`lt1`)},effects:[]}}));return{...e,series:e.series.map(e=>e===n?{...n,points:r}:e)}}),go=(e,t)=>n=>Zi(n,n=>{let r=ot(n,e);if(!r)return n;let i=uo(n).map(e=>e.series).filter(e=>e!==r.series);i.splice(Math.max(0,Math.min(t,i.length)),0,r.series);let a=fo(n,e=>i.indexOf(e));return a===n?n:po(a)}),_o=(e,t,n)=>r=>Qi(r,e,e=>q(e,t,n)),vo=(e,t,n)=>r=>Y(r,e,(e,r)=>{let i=r.points??[],a=i.findIndex(e=>e.idx===t),o=a>=0?i[a]:void 0,s=n(o??((e,t,n)=>({idx:n,...e.type===`bar`?{invertIfNegative:t.invertIfNegative??!1}:{},bubble3D:!1}))(e,r,t),r,e);if(s===o)return e;let c=a>=0?i.map((e,t)=>t===a?s:e):[...i,s].sort((e,t)=>e.idx-t.idx);return{...e,series:e.series.map(e=>e===r?{...r,points:c}:e)}}),yo=(e,t,n)=>vo(e,t,(e,t,r)=>{if(r.type!==`line`&&r.type!==`scatter`&&(r.type!==`radar`||r.radarStyle===`filled`)){let i=X({spPr:e.spPr??(r.type===`pie`||r.type===`doughnut`||r.type===`ofPie`?void 0:t.spPr)??{}},n).spPr;return i===e.spPr?e:{...e,spPr:i}}let i=e,a=e.marker??t.marker??{symbol:`circle`,size:5},o={};`fill`in n&&(o.fill=n.fill),`stroke`in n&&(o.stroke=n.stroke?{width:n.stroke.width,fill:n.stroke.fill}:void 0);let s=X({...a,spPr:a.spPr??{}},o);if(s===a&&e.marker||(i={...i,marker:s}),`stroke`in n){let t=X({spPr:e.spPr??{effects:[]}},{stroke:n.stroke?{...n.stroke,lineCap:`round`,lineJoin:`round`}:void 0}).spPr;i=q(i,`spPr`,t)}return i}),bo=(e,t,n)=>vo(e,t,(e,t)=>{let r=e.marker??t.marker??{symbol:`circle`,size:5};return n.symbol!==void 0&&(r=q(r,`symbol`,n.symbol)),n.size!==void 0&&(r=q(r,`size`,n.size)),n.spPr!==void 0&&(r=q(r,`spPr`,n.spPr??void 0)),r===e.marker?e:{...e,marker:r}}),xo=(e,t,n)=>r=>((e,t,n)=>Zi(e,e=>{let r=st(e,t);if(!r)return e;let i=n(r.group,r.series);return i===r.group?e:{...e,groups:e.groups.map(e=>e===r.group?i:e)}}))(r,e,(e,r)=>{let i=r.points??[],a=i.findIndex(e=>e.idx===t),o=a>=0?i[a]:void 0;if(!0===o?.subtotal===n)return e;let s;if(o){let{subtotal:e,...t}=o,r=n?{...o,subtotal:!0}:t;s=Object.keys(r).every(e=>e===`idx`)?i.filter((e,t)=>t!==a):i.map((e,t)=>t===a?r:e)}else s=[...i,{idx:t,subtotal:!0}].sort((e,t)=>e.idx-t.idx);let c=s.length>0?{...r,points:s}:(({points:e,...t})=>t)(r);return{...e,series:e.series.map(e=>e===r?c:e)}}),So=e=>({idx:e,showLegendKey:!1,showVal:!0,showCatName:!1,showSerName:!1,showPercent:!1,showBubbleSize:!1}),Co=(e,t,n)=>r=>Y(r,e,(e,r)=>{let i=(r.dLbls&&!r.dLbls.delete?r.dLbls:void 0)??(()=>{let{showLeaderLines:e,...t}=ha();return t})(),a=i.labels??[],o=a.findIndex(e=>e.idx===t),s=o>=0?a[o]:void 0,c=n(s??So(t),i);if(c===s)return e;let l=c?o>=0?a.map((e,t)=>t===o?c:e):[...a,c].sort((e,t)=>e.idx-t.idx):a.filter((e,t)=>t!==o),u=q(i,`labels`,l.length?l:void 0);return l.length!==0||ga(i)||(u=void 0),{...e,series:e.series.map(e=>e===r?q(e,`dLbls`,u):e)}}),wo=(e,t,n)=>Co(e,t,(e,r)=>n?e.delete?So(t):e:ga(r)?{idx:t,delete:!0}:void 0),To=(e,t,n,r)=>Co(e,t,e=>q(e.delete?So(t):e,n,r)),Eo=e=>{let t=e.delete?So(e.idx):e;if(t.spPr&&t.txPr)return t;let n=ha();return{...t,spPr:t.spPr??n.spPr,txPr:t.txPr??n.txPr}},Do=(e,t)=>n=>_a(n,e,e=>X(ga(e)?e:{...e,showVal:!0},t)),Oo=(e,t)=>n=>_a(n,e,e=>Wa(ga(e)?e:{...e,showVal:!0},t,9)),ko=`{02D57815-91ED-43cb-92C2-25804820EDAC}`,Ao=`{CE6537A1-D6FC-4f65-9D91-7224C49458BB}`;function jo(e,t,n=`category`,r){if(e.length===0)return{seriesBy:r??`columns`,series:[]};let i=function(e,t){if(e.length===1)return No(e[0],t);let n=e[0],r=e.every(e=>e.rowStart===n.rowStart&&e.rowEnd===n.rowEnd);if(r===e.every(e=>e.colStart===n.colStart&&e.colEnd===n.colEnd))return null;let i=[],a=[...e].sort((e,t)=>r?e.colStart-t.colStart:e.rowStart-t.rowStart);for(let e of a){let t=r?e.colStart:e.rowStart,n=r?e.colEnd:e.rowEnd;for(let e=t;e<=n;e++)i[i.length-1]!==void 0&&e<=i[i.length-1]||i.push(e)}let o=r?n.rowStart:n.colStart,s=r?n.rowEnd-n.rowStart+1:n.colEnd-n.colStart+1;return{rows:r?s:i.length,cols:r?i.length:s,kind:(e,n)=>r?t(o+e,i[n]):t(i[e],o+n),toAreas:e=>{let t=[],n=r?e.c0:e.r0,a=r?e.c1:e.r1,s=i[n];for(let c=n;c<=a;c++)c!==a&&i[c+1]===i[c]+1||(t.push(r?{rowStart:o+e.r0,rowEnd:o+e.r1,colStart:s,colEnd:i[c]}:{colStart:o+e.c0,colEnd:o+e.c1,rowStart:s,rowEnd:i[c]}),c<a&&(s=i[c+1]));return t}}}(e,t);return n===`bubble`?function(e,t){let n=Fo(e),r=e.rows-n.rows,i=e.cols-n.cols;if(t)return(t===`columns`?e.cols:e.rows)%2==1&&zo(e,t,0)?Bo(e,t):Vo(e,n,t);if(n.cols>0&&function(e,t){for(let n=t.r0;n<=t.r1;n++)for(let r=t.c0;r<=t.c1;r++)if(e.kind(n,r)===`text`)return!0;return!1}(e,{r0:n.rows,c0:0,r1:e.rows-1,c1:n.cols-1})){let t=n.cols>0?i%2==0:i%2==1;return Vo(e,n,t===(n.rows>0?r%2==0:r%2==1)?r>i?`columns`:`rows`:t?`columns`:`rows`)}let a=Io(e,n);if((a===`columns`?n.rows>0&&n.cols===0:n.cols>0&&n.rows===0)&&(a===`columns`?i:r)===2)return Vo(e,n,a);let o=e.rows%2==1,s=e.cols%2==1,c;return c=o===s?e.rows===e.cols?s?`columns`:`rows`:e.rows>e.cols?`columns`:`rows`:s?`columns`:`rows`,Bo(e,c)}(i??No(e[0],t),r):i?Ro(i,n,r):function(e,t,n,r){let i=No(e[0],t),a=Fo(i),o=r??Io(i,a),s=Ro(i,n,o),c=s.series[0]?.categories??null;for(let n=1;n<e.length;n++){let r=No(e[n],t),i=o===`columns`?Math.min(a.rows,r.rows-1):Math.min(a.cols,r.cols-1),{lines:l}=Lo(r,o===`columns`?{rows:i,cols:0}:{rows:0,cols:i},o);for(let e of l)s.series.push({name:e.name?r.toAreas(e.name):null,categories:c,values:r.toAreas(e.values)})}return s}(e,t,n,r)}function Mo(e,t,n){let r={rowStart:e.rowIndex,colStart:e.colIndex,rowEnd:e.rowIndex,colEnd:e.colIndex},i=(e,r,i,a)=>{for(let o=Math.max(e,0);o<=Math.min(i,n.rowIndex);o++)for(let e=Math.max(r,0);e<=Math.min(a,n.colIndex);e++)if(t(o,e)!==`blank`)return!0;return!1},a=!0;for(;a;){a=!1;let{rowStart:e,colStart:t,rowEnd:o,colEnd:s}=r;e>0&&i(e-1,t-1,e-1,s+1)&&(r.rowStart--,a=!0),o<n.rowIndex&&i(o+1,t-1,o+1,s+1)&&(r.rowEnd++,a=!0),t>0&&i(r.rowStart-1,t-1,r.rowEnd+1,t-1)&&(r.colStart--,a=!0),s<n.colIndex&&i(r.rowStart-1,s+1,r.rowEnd+1,s+1)&&(r.colEnd++,a=!0)}return r}function No(e,t){return{rows:e.rowEnd-e.rowStart+1,cols:e.colEnd-e.colStart+1,kind:(n,r)=>t(e.rowStart+n,e.colStart+r),toAreas:t=>[{rowStart:e.rowStart+t.r0,colStart:e.colStart+t.c0,rowEnd:e.rowStart+t.r1,colEnd:e.colStart+t.c1}]}}var Po=e=>e===`text`||e===`date`;function Fo(e){let{rows:t,cols:n}=e,r=-1,i=-1;for(let t=0;t<n&&e.kind(0,t)===`blank`;t++)r=t,i=0;let a=r===n-1&&t>1;if(a&&(r=0),r>=0)t:for(let n=1;n<t;n++)for(let t=0;t<=r;t++){if(e.kind(n,t)!==`blank`)break t;t===r&&(i=n)}if(a&&i===t-1&&n>1&&(i=0),i===-1){r=n-1,i=t-1;for(let i=n-1;i>=0&&!Po(e.kind(t-1,i));i--)r=i-1;for(let r=t-1;r>=0&&!Po(e.kind(r,n-1));r--)i=r-1}r===n-1&&i===t-1&&(r=n-2,i=t-2);let o=i+1,s=r+1;return o>=t&&(o=0),s>=n&&(s=0),{rows:o,cols:s}}function Io(e,t){return e.rows-t.rows>e.cols-t.cols||e.cols===1&&e.rows>1?`columns`:`rows`}function Lo(e,t,n){let r=[],{rows:i,cols:a}=e;if(n===`columns`){for(let e=t.cols;e<a;e++)r.push({name:t.rows>0?{r0:0,c0:e,r1:t.rows-1,c1:e}:null,values:{r0:t.rows,c0:e,r1:i-1,c1:e}});return{lines:r,categories:t.cols>0?{r0:t.rows,c0:0,r1:i-1,c1:t.cols-1}:null}}for(let e=t.rows;e<i;e++)r.push({name:t.cols>0?{r0:e,c0:0,r1:e,c1:t.cols-1}:null,values:{r0:e,c0:t.cols,r1:e,c1:a-1}});return{lines:r,categories:t.rows>0?{r0:0,c0:t.cols,r1:t.rows-1,c1:a-1}:null}}function Ro(e,t,n){let r=Fo(e),i=n??Io(e,r),{lines:a,categories:o}=Lo(e,r,i),s=t=>t?e.toAreas(t):null,c=s(o),l=0;t===`scatter`&&!c&&a.length>1&&(c=e.toAreas(a[0].values),l=1);let u=[];for(let t=l;t<a.length;t++)u.push({name:s(a[t].name),categories:c,values:e.toAreas(a[t].values)});return{seriesBy:i,series:u}}function zo(e,t,n){let r=t===`columns`?e.rows:e.cols;for(let i=0;i<r;i++){let r=t===`columns`?e.kind(i,n):e.kind(n,i);if(r===`number`||r===`date`)return!0}return!1}function Bo(e,t){let n=[],r=t===`columns`?e.cols:e.rows;for(let i=0;i<r;i++)n.push(t===`columns`?{r0:0,c0:i,r1:e.rows-1,c1:i}:{r0:i,c0:0,r1:i,c1:e.cols-1});let i=r%2==1&&zo(e,t,0),a=i?e.toAreas(n[0]):null;return Ho(e,t,n.slice(+!!i).map(e=>({name:null,values:e})),a)}function Vo(e,t,n){let{lines:r,categories:i}=Lo(e,t,n);return i?Ho(e,n,r,e.toAreas(i)):r.length<2?Ho(e,n,r,null):Ho(e,n,r.slice(1),e.toAreas(r[0].values))}function Ho(e,t,n,r){let i=[];for(let a=0;a<n.length;a+=2){let o=n[a],s=n[a+1],c=t===`columns`?o.values.r1-o.values.r0+1:o.values.c1-o.values.c0+1;i.push({name:o.name?e.toAreas(o.name):null,categories:r,values:e.toAreas(o.values),sizes:s?e.toAreas(s.values):c})}return{seriesBy:t,series:i}}var Uo={column:`columnClustered`,columnPercentStacked:`columnStacked100`,bar:`barClustered`,barPercentStacked:`barStacked100`,linePercentStacked:`lineStacked100`,areaPercentStacked:`areaStacked100`,scatter:`xyscatter`},Wo=e=>typeof e==`string`&&e.startsWith(`custom:`)&&e.length>7?e.slice(7):null;function Go(e){let r=e??`columnClustered`,i=Uo[r]??r;if(!(e=>Object.prototype.hasOwnProperty.call(ai,e))(i))throw new t(n(`error.chart.typeNotSupported`,{type:r}));return i}var Ko=(e,t)=>{let n=d[e];return n===void 0?e:(typeof n==`number`?o(n,t):void 0)??m(n)},qo=(e,t)=>e==null?`blank`:typeof e==`string`?`text`:typeof e==`number`&&t&&h.getEngine().isDateFormat(t)?`date`:`number`,Jo=class{constructor(e){this._sheet=e,this._blocks=[]}load(e){let t=this._sheet.getRange(e);this._blocks.push({coords:e,values:t.getValues(),formats:t.getNumberFormats()})}_at(e,t){for(let n of this._blocks){let{coords:r}=n;if(e>=r.rowStart&&e<=r.rowEnd&&t>=r.colStart&&t<=r.colEnd)return{value:n.values[e-r.rowStart]?.[t-r.colStart]??null,format:n.formats[e-r.rowStart]?.[t-r.colStart]??``}}let n=this._sheet.getRange({rowStart:e,colStart:t,rowEnd:e,colEnd:t});return{value:n.getValues()[0]?.[0]??null,format:n.getNumberFormats()[0]?.[0]??``}}kind(e,t){let{value:n,format:r}=this._at(e,t);return qo(n,r)}number(e,t){let{value:n}=this._at(e,t);return typeof n==`number`?n:null}format(e,t){return this._at(e,t).format}},Yo=(e,t)=>{let n=S(e.getName()),r=(e,t)=>`$${v(t)}$${x(e)}`,i=r(t.rowStart,t.colStart);return`${n}!${t.rowStart===t.rowEnd&&t.colStart===t.colEnd?i:`${i}:${r(t.rowEnd,t.colEnd)}`}`},Xo=e=>Yo(e.getWorksheet(),e.getCoords()),Zo=e=>{let t=/^\{(.*)\}$/s.exec(e.trim());if(!t)return null;let n=[],r=!0,i=t[1],a=0;for(;a<=i.length;){for(;i[a]===` `;)a++;let e;if(i[a]===`"`){let t=a+1;for(e=``;t<i.length;)if(i[t]!==`"`||i[t+1]!==`"`){if(i[t]===`"`)break;e+=i[t++]}else e+=`"`,t+=2;for(r=!1,a=t+1;a<i.length&&i[a]!==`,`&&i[a]!==`;`;)a++}else{let t=a;for(;t<i.length&&i[t]!==`,`&&i[t]!==`;`;)t++;e=i.slice(a,t).trim(),e!==``&&Number.isFinite(Number(e))||(r=!1),a=t}n.push(e),a++}return{values:n,numbers:r}},Qo=(e,t)=>{try{let n=e.includes(`!`)?t.getWorkbook()?.getRanges(e):t.getRanges(e);return n&&n.getCount()===1?n.at(0):null}catch{return null}},$o=(e,t)=>{let n=t=>Yo(e,t);return{formula:e=>e.length===1?n(e[0]):`(${e.map(n).join(`,`)})`,kindAt:(e,n)=>t.kind(e,n),numberAt:(e,n)=>t.number(e,n),formatAt:(n,r)=>Ko(t.format(n,r),e.getWorkbook()?.getLocale()),date1904:e.getWorkbook()?.getRuntime().isDate1904()??!1}};function es(e,r,i){let a,o=null;if(typeof e==`string`){let s=e.trim().replace(/^=/,``),c=Zo(s);if(c){let e={...c.numbers||r===`values`?{formatCode:`General`}:{},ptCount:c.values.length,points:c.values.map((e,t)=>({idx:t,v:e}))};return c.numbers||r===`values`?{numLit:e}:{strLit:e}}if(!s)throw new t(n(`error.chart.noData`));o=Qo(s,i),a=o&&w(s)?Xo(o):s}else o=e,a=Xo(e);if(r===`values`)return{numRef:{f:a}};if(!o||o.isInvalid())return{strRef:{f:a}};let s=o.getCoords();if(s.rowEnd>s.rowStart&&s.colEnd>s.colStart)return{multiLvlStrRef:{f:a}};let c=o.getValues(),l=o.getNumberFormats(),u=0;for(let e=0;e<c.length;e++)for(let t=0;t<c[e].length;t++){let n=qo(c[e][t],l[e]?.[t]??``);if(n===`text`)return{strRef:{f:a}};n!==`blank`&&u++}return u>0?{numRef:{f:a}}:{strRef:{f:a}}}function ts(e,t){if(typeof e!=`string`)return e.isInvalid()?0:e.size;let n=e.trim().replace(/^=/,``),r=Zo(n);if(r)return r.values.length;let i=t?Qo(n,t):null;return i&&!i.isInvalid()?i.size:0}function ns(e,r,i,a=`auto`){let o=((e,r)=>{let i=null;if(typeof e==`string`){let t=e.trim().replace(/^=/,``);if(t)try{i=t.includes(`!`)?r.getWorkbook()?.getRanges(t)??null:r.getRanges(t)}catch{i=null}}else i=e;let a=[];if(i&&i.isICellRanges){let e=i;for(let t=0;t<e.getCount();t++)a.push(e.at(t))}else i&&a.push(i);let o=a[0]?.getWorksheet();if(!o||a.some(e=>e.isInvalid()||e.getWorksheet()!==o))throw new t(n(`error.chart.noData`));return a})(r,i),s=o[0].getWorksheet(),c=new Jo(s),l=(e=>{try{return e.getEntireRange().getUsedRange({features:[]})?.getCoords()??null}catch{return null}})(s),u=[];for(let e of o)if(e.isEntireRows()||e.isEntireColumns()){if(!l)continue;let t=e.getCoords(),n=Math.max(t.rowStart,l.rowStart),r=Math.min(t.rowEnd,l.rowEnd),i=Math.max(t.colStart,l.colStart),a=Math.min(t.colEnd,l.colEnd);n<=r&&i<=a&&u.push({rowStart:n,colStart:i,rowEnd:r,colEnd:a})}else u.push(e.getCoords());if(u.length===1&&u[0].rowStart===u[0].rowEnd&&u[0].colStart===u[0].colEnd&&l){let e={rowIndex:u[0].rowStart,colIndex:u[0].colStart};u=[Mo(e,(e,t)=>c.kind(e,t),{rowIndex:Math.max(l.rowEnd,e.rowIndex),colIndex:Math.max(l.colEnd,e.colIndex)})]}for(let e of u)c.load(e);let d=u.length===0||u.every(e=>{for(let t=e.rowStart;t<=e.rowEnd;t++)for(let n=e.colStart;n<=e.colEnd;n++)if(c.kind(t,n)!==`blank`)return!1;return!0})?{seriesBy:`columns`,series:[]}:jo(u,(e,t)=>c.kind(e,t),(e=>ai[e].family)(e),a===`auto`?(e=>ai[e].seriesBy)(e):a),f=(e=>{let t=ai[e].stock;return t?3+ +!!t.open+ +!!t.volume:null})(e);if(f!==null&&d.series.length!==f){let r=[...e===`stockVHLC`||e===`stockVOHLC`?[`volume`]:[],...e===`stockOHLC`||e===`stockVOHLC`?[`open`]:[],`high`,`low`,`close`];throw new t(n(`error.chart.stockSeries`,{type:e,count:f,order:r.join(`, `)}))}return ji(e,d,$o(s,c))}var rs=e(`op.setChartTitle`),is=e(`op.setChartLegend`),as=e(`op.setChartAxis`),os=e(`op.setChartAxisTitle`),ss=e(`op.setChartCategoryNames`),cs=e(`op.setChartGridlines`),ls=e(`op.setChartSeriesData`),us=e(`op.setChartSeriesType`),ds=e(`op.setChartSeriesAxisGroup`),fs=e(`op.setChartSeriesStyle`),Z=e(`op.setChartSeriesOptions`),ps=e(`op.setChartMarker`),ms=e(`op.setChartDataLabels`),hs=e(`op.addChartTrendline`),gs=e(`op.deleteChartTrendline`),_s=e(`op.setChartTrendline`),vs=e(`op.setChartErrorBars`),ys=e(`op.setChartUpDownBars`);e(`op.setChartType`),e(`op.addSeries`);var bs=e(`op.deleteChartSeries`),xs=e(`op.setChartSeriesOrder`),Ss=e(`op.setChartPoint`),Cs=e(`op.setChartPlotArea`),ws=e(`op.setChartDataTable`),Ts=e(`op.setChartArea`),Es=e(`op.setChartFont`),Ds=e(`op.setChartLegendEntry`),Os={hiLowLines:e(`op.setChartHiLoLines`),dropLines:e(`op.setChartDropLines`),serLines:e(`op.setChartSeriesLines`)},Q=e=>({type:`solid`,color:e}),$=(e,t,n,r,i)=>new p({getData:()=>{let e=t();return{fill:e?.fill,stroke:e?.stroke}},getStyles:()=>e.styles(),getTheme:()=>null,getMovable:()=>e.movable(),getResource:()=>null,write:(t,n)=>e.edit(i,r(t),n),resolve:e=>n(e),describe:()=>i}),ks=(e,t)=>e?{...t,...e,fill:e.fill??t?.fill}:t,As=class{constructor(e,t,n,r,i){this._host=e,this._run=t,this._write=n,this._description=r,this._defaults=i}_pick(e){let t=this._run()?.[e];return t===void 0?Ga(this._host.model()??void 0)?.[e]:t}getFamily(){let e=this._pick(`latin`);return e&&e!==s.ThemeFamily.Body?e===s.ThemeFamily.Heading?this._host.theme().majorFont():e:this._host.theme().minorFont()}setFamily(e,t){return this.update({family:e},t)}getName(){return this.getFamily()}setName(e,t){return this.setFamily(e,t)}getThemeFamily(){let e=this._pick(`latin`);return e&&e!==s.ThemeFamily.Body?e===s.ThemeFamily.Heading?e:null:s.ThemeFamily.Body}getFallbacks(){return this._pick(`fallbacks`)??[]}setFallbacks(e,t){return this.update({fallbacks:e},t)}getSize(){return this._pick(`size`)??this._defaults.size}setSize(e,t){return this.update({size:e},t)}getWeight(){return this._pick(`weight`)??(this._defaults.bold?700:400)}setWeight(e,t){return this.update({weight:e},t)}getBold(){return this.getWeight()>400}setBold(e,t){return this.update({bold:e},t)}getItalic(){return this._pick(`style`)===a.Style.Italic}setItalic(e,t){return this.update({italic:e},t)}getUnderline(){return this._pick(`underline`)??a.UnderlineStyle.None}setUnderline(e,t){return this.update({underline:e},t)}getStrike(){return this._pick(`strike`)??a.StrikeStyle.None}setStrike(e,t){return this.update({strike:e},t)}getColor(){let e=this._pick(`color`),t=e?.type===`solid`&&typeof e.color==`string`?e.color:this._defaults.color??`tx1 lumMod 65 lumOff 35`;return this._host.theme().parseColor(t)}setColor(e,t){return this.update({color:e},t)}getLetterSpacing(){return this._pick(`letterSpacing`)??0}setLetterSpacing(e,t){return this.update({letterSpacing:e},t)}getBaseline(){return this._pick(`baseline`)??0}setBaseline(e,t){return this.update({baseline:e},t)}edit(e){let r=e=>{throw new t(n(`error.chart.notValidForType`,{type:String(e)}))},i=(e,t)=>e==null?void 0:Number.isFinite(e)&&t(e)?e:r(e),o={};e.family!==void 0&&(o.family=e.family),e.fallbacks!==void 0&&(o.fallbacks=e.fallbacks),e.size!==void 0&&(o.size=i(e.size,e=>e>0)??this._defaults.size);let s=e.weight??(e.bold===void 0||e.bold===null?e.bold:e.bold?700:400);s!==void 0&&(o.weight=i(typeof s==`string`?s===`bold`?700:s===`normal`?400:Number(s):s,e=>e>=1&&e<=1e3)??(this._defaults.bold?700:400));let c=e.style??(e.italic===void 0||e.italic===null?e.italic:e.italic?a.Style.Italic:a.Style.Normal);if(c!==void 0&&(o.italic=c===a.Style.Italic),e.color!==void 0&&(o.color=e.color===null?null:Ms(this._host,String(e.color))),e.underline!==void 0){let t=!0===e.underline?a.UnderlineStyle.Single:e.underline||a.UnderlineStyle.None;t!==a.UnderlineStyle.SingleAccounting&&t!==a.UnderlineStyle.DoubleAccounting&&Object.values(a.UnderlineStyle).includes(t)||r(t),o.underline=t}if(e.strike!==void 0){let t=e.strike??a.StrikeStyle.None;Object.values(a.StrikeStyle).includes(t)||r(t),o.strike=t}return e.letterSpacing!==void 0&&(o.letterSpacing=i(e.letterSpacing,e=>Math.abs(e)<=4e3)??0),e.baseline!==void 0&&(o.baseline=i(e.baseline,()=>!0)??0),this._write(o)}update(e,t){return this._host.edit(this._description,this.edit(e),t),this}stated(){let e=this._run();if(!e)return null;let t={};e.latin!==void 0&&(t.family=e.latin),e.fallbacks?.length&&(t.fallbacks=[...e.fallbacks]),e.size!==void 0&&(t.size=e.size),e.weight!==void 0&&(t.weight=e.weight),e.style!==void 0&&(t.style=e.style);let n=e.color;return n?.type===`solid`&&typeof n.color==`string`&&(t.color=n.color),e.underline!==void 0&&(t.underline=e.underline),e.strike!==void 0&&(t.strike=e.strike),e.letterSpacing!==void 0&&(t.letterSpacing=e.letterSpacing),e.baseline!==void 0&&(t.baseline=e.baseline),Object.keys(t).length?t:null}clearEdit(){return this.stated()?this._write({clear:!0}):null}isEqualMeasure(e){return!!e&&this.getFamily()===e.getFamily()&&this.getSize()===e.getSize()&&this.getWeight()===e.getWeight()&&this.getItalic()===e.getItalic()&&this.getLetterSpacing()===e.getLetterSpacing()&&this.getBaseline()===e.getBaseline()&&this.getFallbacks().join()===e.getFallbacks().join()}toCSS(e,t=1){return{fontFamily:i(this.getFamily(),this.getFallbacks()),fontSize:this.getSize()*a.getDeviceScale()*t+`px`,fontWeight:this.getWeight(),fontStyle:this.getItalic()?a.Style.Italic:a.Style.Normal,textDecoration:u(this.getUnderline(),this.getStrike()),letterSpacing:`${this.getLetterSpacing()}pt`,color:this.getColor().toCSS(e)}}toJSON(){let e={family:this.getThemeFamily()??this.getFamily(),size:this.getSize(),weight:this.getWeight(),style:this.getItalic()?a.Style.Italic:a.Style.Normal,color:String(this.getColor()),underline:this.getUnderline(),strike:this.getStrike(),letterSpacing:this.getLetterSpacing(),baseline:this.getBaseline()},t=this.getFallbacks();return t.length&&(e.fallbacks=[...t]),e}get isIFontStyle(){return!0}},js=class{constructor(e,t,n,r,i,a=!0){this._host=e,this._styleOf=t,this._write=n,this._font=r,this._description=i,this._ownShape=a,this._shape=t(n)}getFont(){return this._font}getFill(){return this._shape.getFill()}setFill(e,t){return this._shape.setFill(e,t),this}setFillSolid(e){return this._shape.setFillSolid(e)}setFillGradient(e){return this._shape.setFillGradient(e)}setFillPattern(e){return this._shape.setFillPattern(e)}setFillNone(e){return this._shape.setFillNone(e)}getStroke(){return this._shape.getStroke()}setStroke(e,t){return this._shape.setStroke(e,t),this}setStrokeNone(e){return this._shape.setStrokeNone(e)}edits(e){let t=[];if(e===null){this._ownShape&&!this._shape.isThemed()&&t.push(Ls(this._styleOf,this._write,null));let e=this._font.clearEdit();return e&&t.push(e),t}let n=e.isIShapeStyle?e.toJSON()??{}:e,r={};if(`fill`in n&&(r.fill=n.fill),`stroke`in n&&(r.stroke=n.stroke),(`fill`in r||`stroke`in r)&&t.push(Ls(this._styleOf,this._write,r)),n.font===null){let e=this._font.clearEdit();e&&t.push(e)}else n.font!==void 0&&t.push(this._font.edit(n.font));return t}edit(e){return K(this.edits(e))}update(e,t){let n=this.edits(e);return n.length&&this._host.edit(this._description,K(n),t),this}clear(e){return this.update(null,e)}isThemed(){return(!this._ownShape||this._shape.isThemed())&&!this._font.stated()}toJSON(){let e={...this._ownShape?this._shape.toJSON():null},t=this._font.stated();return t&&(e.font=t),Object.keys(e).length?e:null}get[Symbol.toStringTag](){return`[ChartTextBoxStyle]`}toString(){return`[ChartTextBoxStyle]`}get isIShapeStyle(){return!0}get isITextBoxStyle(){return!0}},Ms=(e,r)=>{let i=r.trim();if(/^[a-z]+\d?( |$)/i.test(i)&&!/^#|^rgb|^hsl/i.test(i))return i;try{return e.theme().parseColor(i).toHex().toString(!1).replace(`#`,``).toUpperCase()}catch{throw new t(n(`error.chart.notValidForType`,{type:r}))}},Ns=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},Ps=(e,t,n)=>{for(let n of e.keys())n>=t&&e.delete(n);let r=[];for(let i=0;i<t;i++)r.push(Ns(e,i,()=>n(i)));return r},Fs=class{constructor(e){this._host=e,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return null}getElementType(){return`chartArea`}getPath(){return`chartArea`}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>(e=>t=>X(t,e))(e),new As(this._host,()=>this._host.model()?.txPr?.paragraphs?.[0]?.pPr?.defaultRun,e=>(e=>t=>{let n=e.size===void 0?e:{...e,size:Math.round(1.2*e.size*100)/100},r=(i,a)=>{if(Array.isArray(i)){let e=!1,t=i.map(t=>{let n=r(t,!1);return n!==t&&(e=!0),n});return e?t:i}if(typeof i!=`object`||!i)return i;let o=i,s=null;for(let i of Object.keys(o)){if(i===`unknown`)continue;let c=o[i],l;l=(i===`txPr`||i===`rich`)&&c&&typeof c==`object`&&`paragraphs`in c?Ua(c,a?n:e):r(c,i===`title`&&o===t.chart),l!==c&&((s??={...o})[i]=l)}return s??o},i=r(t.chart,!1),a=t.txPr||!e.clear?Ua(t.txPr??{bodyPr:{},lstStyle:{},paragraphs:[{pPr:{defaultRun:{}},endRun:{language:t.lang??`en-US`}}]},e):t.txPr;return i===t.chart&&a===t.txPr?t:{...t,chart:i,txPr:a}})(e),Es,{size:10,bold:!1}),Ts)}_style(e){return $(this._host,()=>this._host.model()?.spPr,e=>({fill:e?.fill??Q(`bg1`),stroke:e?.stroke??{width:.75,fill:Q(`tx1 lumMod 15 lumOff 85`)}}),e,Ts)}getRoundedCorners(){return!1!==this._host.model()?.roundedCorners}setRoundedCorners(e,t){return this.update({roundedCorners:e},t)}edits(e){let t=[];var n;return e.roundedCorners!==void 0&&t.push((n=!!e.roundedCorners,e=>q(e,`roundedCorners`,n))),e.style!==void 0&&t.push(...this.getStyle().edits(e.style)),t}update(e,t){return this._host.edit(Ts,K(this.edits(e)),t),this}get isIChartArea(){return!0}},Is=class{constructor(e){this._host=e,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`title`}getPath(){return`title`}getText(){let e=this._host.resolved();if(e)return e.title?.text??null;let t=this._host.facts();return t?this._host.text(t.title):null}setText(e,t){return this.update({text:e},t)}getVisible(){let e=this._host.resolved();return e?!!e.title:!!this._host.model()?.chart?.title}setVisible(e,t){return this.update({visible:e},t)}getOverlay(){return this._host.model()?.chart?.title?.overlay??!1}setOverlay(e,t){return this.update({overlay:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>(e=>t=>ta(t,t=>X(t,e)))(e),new As(this._host,()=>Ga(this._host.model()?.chart?.title),e=>(e=>t=>ta(t,t=>Wa(t,e,14)))(e),rs,{size:14,bold:!1}),rs)}_style(e){return $(this._host,()=>this._host.model()?.chart?.title?.spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,rs)}edits(e){let t=[];var n,r,i;return e.visible!==void 0&&t.push((n=e.visible,e=>n?ta(e,e=>e):Xi(e,t=>{let n=j(e);if(!(t.title||n&&!0!==t.autoTitleDeleted))return t;let{title:r,...i}=t;return n?{...i,autoTitleDeleted:!0}:i}))),e.text!==void 0&&t.push((r=e.text,e=>ta(e,t=>q(t,`tx`,j(e)?ea(r,t.txPr,e.lang):r===null?void 0:{v:r})))),e.overlay!==void 0&&t.push((i=e.overlay,e=>ta(e,e=>q(e,`overlay`,i)))),e.style!==void 0&&t.push(...this.getStyle().edits(e.style)),t}update(e,t){return this._host.edit(rs,K(this.edits(e)),t,!0),this}get isITitle(){return!0}},Ls=(e,t,n)=>{let r=e=>e;return e(e=>(r=t(e),e=>e)).update(n),r},Rs={b:`bottom`,t:`top`,l:`left`,r:`right`,tr:`corner`},zs={bottom:`b`,top:`t`,left:`l`,right:`r`,corner:`tr`},Bs=class{constructor(e){this._host=e,this._styleCache=null,this._entries=new Map}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`legend`}getPath(){return`legend`}getVisible(){return!!this._host.model()?.chart?.legend}setVisible(e,t){return this.update({visible:e},t)}getPosition(){return Rs[this._host.model()?.chart?.legend?.legendPos??`r`]}setPosition(e,t){return this.update({position:e},t)}getOverlay(){return this._host.model()?.chart?.legend?.overlay??!1}setOverlay(e,t){return this.update({overlay:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>(e=>t=>na(t,t=>X(t,e)))(e),new As(this._host,()=>Ga(this._host.model()?.chart?.legend),e=>(e=>t=>na(t,t=>Wa(t,e,9)))(e),is,{size:9,bold:!1}),is)}_style(e){return $(this._host,()=>this._host.model()?.chart?.legend?.spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,is)}getLegendEntries(){return Ps(this._entries,this.entryTexts().length,e=>new Vs(this._host,this,e))}entryTexts(){let e=this._host.resolved(),t=this._host.model();if(!e||!t?.chart?.legend)return[];let r=new Set((t.chart.legend.entries??[]).filter(e=>e.delete).map(e=>e.idx)),i=e.legend?.entries??[],a=[],o=t=>e.groups.length>0&&e.groups.every(e=>e.type===t),s=o(`waterfall`)?[n(`chart.waterfall.increase`),n(`chart.waterfall.decrease`),n(`chart.waterfall.total`)]:o(`sunburst`)||o(`treemap`)?(e.groups[0].hierarchy?.branches??[]).map(e=>e.name):null,c=e.groups.length===1&&e.groups[0].series.length===1&&e.groups[0].varyColors?e.groups[0].series[0]:null,l=s?s.length:c?c.values.length:e.groups.flatMap(e=>e.series).length,u=0;for(let t=0;t<l;t++)r.has(t)?s?a.push(s[t]):a.push(c?c.categories[t]??String(t+1):e.groups.flatMap(e=>e.series).find(e=>e.idx===t)?.name??``):a.push(i[u++]?.text??``);return a}entry(e){return Number.isInteger(e)&&e>=0&&e<this.entryTexts().length?Ns(this._entries,e,()=>new Vs(this._host,this,e)):null}edits(e){let r=[];var i,a;if(e.visible!==void 0&&r.push((i=e.visible,e=>i?na(e,e=>e):Xi(e,e=>{if(!e.legend)return e;let{legend:t,...n}=e;return n}))),e.position!==void 0){let i=zs[e.position],a=this._host.model();if(!i||i===`tr`&&a&&!j(a))throw new t(n(`error.chart.notValidForType`,{type:String(e.position)}));r.push((e=>t=>na(t,n=>j(t)?q(n,`legendPos`,e):q(q(n,`legendPos`,e),`align`,(e=>e===`l`||e===`r`?`min`:`ctr`)(e))))(i))}return e.overlay!==void 0&&r.push((a=e.overlay,e=>na(e,e=>q(e,`overlay`,a)))),e.style!==void 0&&r.push(...this.getStyle().edits(e.style)),r}update(e,t){return this._host.edit(is,K(this.edits(e)),t,!0),this}get isILegend(){return!0}},Vs=class{constructor(e,t,n){this._host=e,this._legend=t,this._index=n,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._legend}getElementType(){return`legendEntry`}getPath(){return`legend/entries/${this._index}`}_entry(){return this._host.model()?.chart?.legend?.entries?.find(e=>e.idx===this._index)}getIndex(){return this._index}getText(){return this._legend.entryTexts()[this._index]??``}getVisible(){return!0!==this._entry()?.delete}setVisible(e,t){return this._host.edit(Ds,((e,t)=>n=>Qa(n,e,e=>{if(!t)return q(e,`delete`,!0);let n=q(e,`delete`,void 0);return n.txPr?n:void 0}))(this._index,e),t),this}getStyle(){return this._styleCache??=new js(this._host,e=>this._legend._style(e),e=>{throw new t(n(`error.chart.notValidForType`,{type:Object.keys(e).join(`, `)||`style`}))},new As(this._host,()=>Ga(this._entry())??Ga(this._host.model()?.chart?.legend),e=>((e,t)=>n=>Qa(n,e,e=>Wa(e,t,9)))(this._index,e),Ds,{size:9,bold:!1}),Ds,!1)}get isILegendEntry(){return!0}},Hs={cat:`category`,val:`value`,date:`date`,ser:`series`},Us=e=>{let t=e.axes[0];if(!t)return[];if(t.crossAx!==void 0)return[t.axId,t.crossAx];let n=e.axes.find(e=>e.type!==t.type);return n?[t.axId,n.axId]:[t.axId]},Ws=(e,t)=>{if(t.type===`ser`)return!1;let n=e.groups.find(e=>e.axIds.includes(t.axId));return n?.type===`scatter`||n?.type===`bubble`?(e=>e.axPos===`b`||e.axPos===`t`)(t):t.type===`cat`||t.type===`date`},Gs=class{constructor(e,t,n){this._host=e,this._axis=t,this._which=n,this._styleCache=null,this._axId=t.axId()}getChart(){return this._host.chart()}getParent(){return this._axis}getElementType(){return`gridlines`}getPath(){return`${this._axis.getPath()}/${this._which}`}get isIGridlines(){return!0}_lines(){return this._host.model()?.chart?.plotArea?.axes.find(e=>e.axId===this._axId)?.[this._which]}getVisible(){return!!this._lines()}setVisible(e,t){return this._host.edit(cs,la(this._axId,this._which,e),t),this}getStyle(){let e=this._host,t=this._which===`majorGridlines`?`tx1 lumMod 15 lumOff 85`:`tx1 lumMod 5 lumOff 95`;return this._styleCache??=$(e,()=>this._lines()?.spPr,e=>({fill:void 0,stroke:ks(e?.stroke,{width:.75,fill:Q(t)})}),e=>K([la(this._axId,this._which,!0),t=>{return(n=this._axId,r=this._which,i=Ks(this._lines()?.spPr,e),e=>J(e,n,e=>{let t=e[r]??{};return{...e,[r]:q(t,`spPr`,i)}}))(t);var n,r,i}]),cs)}},Ks=(e,t)=>{let n={...e};return`fill`in t&&(t.fill===void 0?delete n.fill:n.fill=t.fill),`stroke`in t&&(t.stroke===void 0?delete n.stroke:n.stroke=t.stroke),Object.keys(n).length>0?n:void 0},qs=class{constructor(e,t){this._host=e,this._axId=t,this._title=null,this._major=null,this._minor=null,this._styleCache=null,this._path=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`axis`}getPath(){let e=this._host.model()?.chart?.plotArea,t=this._axis();return e&&t&&(this._path=`axes/${this.getAxisGroup()}/${((e,t)=>t.type===`ser`?`series`:Ws(e,t)?`category`:`value`)(e,t)}`),this._path??`axes/${this.getAxisGroup()}/value`}axId(){return this._axId}get isIAxis(){return!0}_axis(){return this._host.model()?.chart?.plotArea?.axes.find(e=>e.axId===this._axId)??null}_laidOut(){let e=this._host.layout()?.axes.find(e=>e.id===this._axId);return e?.kind===`value`?e:null}getKind(){return Hs[this._axis()?.type??`val`]}getAxisGroup(){let e=this._host.model()?.chart?.plotArea;return!e||Us(e).includes(this._axId)?`primary`:`secondary`}getTitle(){return this._title??=new nc(this._host,this,this._axId)}getNumberFormat(){return this._axis()?.numFmt?.formatCode??null}setNumberFormat(e,t){return this.update({numberFormat:e},t)}getLinkNumberFormat(){let e=this._axis()?.numFmt;return!e||!0===e.sourceLinked}setLinkNumberFormat(e,t){return this.update({linkNumberFormat:e},t)}getVisible(){return!0!==this._axis()?.delete}setVisible(e,t){return this.update({visible:e},t)}getMinimum(){return this._axis()?.scaling?.min??this._laidOut()?.min??null}setMinimum(e,t){return this.update({minimum:e},t)}isMinimumAuto(){return this._axis()?.scaling?.min===void 0}getMaximum(){return this._axis()?.scaling?.max??this._laidOut()?.max??null}setMaximum(e,t){return this.update({maximum:e},t)}isMaximumAuto(){return this._axis()?.scaling?.max===void 0}getMajorUnit(){return this._axis()?.majorUnit??this._laidOut()?.majorUnit??null}setMajorUnit(e,t){return this.update({majorUnit:e},t)}isMajorUnitAuto(){return this._axis()?.majorUnit===void 0}getMajorGridlines(){return this._major??=new Gs(this._host,this,`majorGridlines`)}getMinorGridlines(){return this._minor??=new Gs(this._host,this,`minorGridlines`)}getMultiLevel(){let e=this._axis();return e?.type===`cat`&&!0!==e.noMultiLvlLbl}setMultiLevel(e,t){return this.update({multiLevel:e},t)}setCategoryNames(e,t){return this.update({categoryNames:e},t)}getMinorUnit(){let e=this._axis();if(!e||e.type===`cat`)return null;if(e.minorUnit!==void 0)return e.minorUnit;if(e.type===`date`)return null;let t=this.getMajorUnit();return t===null?null:t/5}setMinorUnit(e,t){return this.update({minorUnit:e},t)}isMinorUnitAuto(){return this._axis()?.minorUnit===void 0}getScaleType(){return this._axis()?.scaling?.logBase?`logarithmic`:`linear`}setScaleType(e,t){return this.update({scaleType:e},t)}getLogBase(){return this._axis()?.scaling?.logBase??10}setLogBase(e,t){return this.update({logBase:e},t)}getDisplayUnit(){let e=this._axis()?.dispUnits;return e?e.custUnit===void 0?e.builtInUnit??`none`:`custom`:`none`}setDisplayUnit(e,t){return this.update({displayUnit:e},t)}getCustomDisplayUnit(){let e=this._axis()?.dispUnits;return e?e.custUnit===void 0?Ys[e.builtInUnit??``]??1:e.custUnit:1}setCustomDisplayUnit(e,t){return this.update({customDisplayUnit:e},t)}getShowDisplayUnitLabel(){return!!this._axis()?.dispUnits?.dispUnitsLbl}setShowDisplayUnitLabel(e,t){return this.update({showDisplayUnitLabel:e},t)}_crossing(){let e=this._axis();return this._host.model()?.chart?.plotArea?.axes.find(t=>t.axId===e?.crossAx)??null}getCrosses(){let e=this._crossing();return e?.crossesAt===void 0?e?.crosses===`max`?`maximum`:e?.crosses===`min`?`minimum`:`automatic`:`custom`}setCrosses(e,t){return this.update({crosses:e},t)}getCrossesAt(){return this._crossing()?.crossesAt??null}setCrossesAt(e,t){return this.update({crossesAt:e},t)}getReversePlotOrder(){return this._axis()?.scaling?.orientation===`maxMin`}setReversePlotOrder(e,t){return this.update({reversePlotOrder:e},t)}getMajorTickMark(){return Zs[this._axis()?.majorTickMark??`cross`]}setMajorTickMark(e,t){return this.update({majorTickMark:e},t)}getMinorTickMark(){return Zs[this._axis()?.minorTickMark??`cross`]}setMinorTickMark(e,t){return this.update({minorTickMark:e},t)}getTickLabelPosition(){return $s[this._axis()?.tickLblPos??`nextTo`]}setTickLabelPosition(e,t){return this.update({tickLabelPosition:e},t)}getTextOrientation(){return tc(this._axis()?.txPr?.bodyPr)}setTextOrientation(e,t){return this.update({textOrientation:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>((e,t)=>n=>J(n,e,e=>X(e,t)))(this._axId,e),new As(this._host,()=>Ga(this._axis()??void 0),e=>((e,t)=>n=>J(n,e,e=>Wa(e,t,9,hi)))(this._axId,e),as,{size:10,bold:!1}),as)}_style(e){return $(this._host,()=>this._axis()?.spPr,e=>({fill:e?.fill,stroke:ks(e?.stroke,{width:.75,fill:Q(`tx1 lumMod 15 lumOff 85`)})}),e,as)}getTickLabelSpacing(){return this._axis()?.tickLblSkip??null}setTickLabelSpacing(e,t){return this.update({tickLabelSpacing:e},t)}getTickMarkSpacing(){return this._axis()?.tickMarkSkip??null}setTickMarkSpacing(e,t){return this.update({tickMarkSpacing:e},t)}getBaseTimeUnit(){let e=this._axis();return e?.type===`date`?e.baseTimeUnit??this._automaticBaseUnit():null}setBaseTimeUnit(e,t){return this.update({baseTimeUnit:e},t)}getMajorTimeUnitScale(){let e=this._axis();return e?.type===`date`?e.majorTimeUnit??e.baseTimeUnit??this._automaticBaseUnit():null}setMajorTimeUnitScale(e,t){return this.update({majorTimeUnitScale:e},t)}getMinorTimeUnitScale(){let e=this._axis();return e?.type===`date`?e.minorTimeUnit??e.baseTimeUnit??this._automaticBaseUnit():null}setMinorTimeUnitScale(e,t){return this.update({minorTimeUnitScale:e},t)}getCategoryType(){let e=this._axis();return!1===e?.auto?e.type===`date`?`dateAxis`:`textAxis`:`automatic`}setCategoryType(e,t){return this.update({categoryType:e},t)}_dates(){let e=(this._host.resolved()?.groups.find(e=>e.axIds.includes(this._axId)))?.series[0]?.categoryValues;return!e||e.length===0||e.some(e=>e===null)?null:e}_automaticBaseUnit(){let e=this._dates();return e?rr(e,this._host.model()?.date1904??!1):`days`}_categoriesEdit(e){this._categoryAxis(`categoryNames`);let r=this._host.sheet();if(!r){if(typeof e==`string`)throw new t(n(`error.chart.noData`));return oa(this._axId,{strRef:{f:Xo(e)}},null)}let{source:i,axis:a}=function(e,t){let n=es(e,`categories`,t),r=null;if(typeof e!=`string`)r=e;else{let n=e.trim().replace(/^=/,``);Zo(n)||(r=Qo(n,t))}if(!r||r.isInvalid())return{source:n,axis:null};let i=r.getWorksheet(),a=new Jo(i),o=r.getCoords();return a.load(o),{source:n,axis:Ai([o],$o(i,a))}}(e,r);return oa(this._axId,i,a)}_categoryAxis(e){let r=this._axis();if(r?.type!==`cat`&&r?.type!==`date`)throw new t(n(`error.chart.notValidForType`,{type:e}));return r}edits(e){let r=this._axId,i=(e,r)=>{if(e!==`auto`&&!Number.isFinite(e))throw new t(n(`error.chart.notValidForType`,{type:r}));return e},a=[];if(e.title!==void 0){let t=e.title;a.push(...this.getTitle().edits(typeof t==`object`&&t?t:{text:t}))}var o,s;if(e.linkNumberFormat!==void 0&&a.push((o=r,s=e.linkNumberFormat,e=>J(e,o,e=>(e.numFmt?.sourceLinked??!1)===s&&e.numFmt?e:{...e,numFmt:{...e.numFmt,formatCode:e.numFmt?.formatCode??`General`,sourceLinked:s}}))),e.numberFormat!==void 0&&a.push(((e,t)=>n=>J(n,e,e=>e.numFmt?.formatCode===t&&!1===e.numFmt.sourceLinked?e:{...e,numFmt:{...e.numFmt,formatCode:t,sourceLinked:!1}}))(r,e.numberFormat)),e.visible!==void 0&&a.push(((e,t)=>n=>J(n,e,e=>{if(!t||!0!==e.delete)return q(e,`delete`,!t);let r={...e,delete:!1};if(!e.spPr&&!e.txPr){r.spPr={fill:{type:`none`},stroke:W(),effects:[]},r.txPr=G(9,hi);let t=n.chart.plotArea.axes.find(t=>t.axId===e.crossAx);!t||t.axPos!==`r`&&t.axPos!==`t`||(r.axPos=no(e),r=q(r,`crosses`,`max`))}return r}))(r,e.visible)),e.minimum!==void 0&&a.push(ra(r,`min`,i(e.minimum,`minimum`))),e.maximum!==void 0&&a.push(ra(r,`max`,i(e.maximum,`maximum`))),e.majorUnit!==void 0){let o=i(e.majorUnit,`majorUnit`);if(o!==`auto`&&!(o>0))throw new t(n(`error.chart.notValidForType`,{type:`majorUnit`}));let s=this._axis();s?.type===`date`?a.push(lo(r,`major`,o===`auto`?null:o,e.majorTimeUnitScale??s.majorTimeUnit??s.baseTimeUnit??this._automaticBaseUnit())):a.push(ia(r,`majorUnit`,o))}e.majorGridlines!==void 0&&a.push(la(r,`majorGridlines`,e.majorGridlines)),e.minorGridlines!==void 0&&a.push(la(r,`minorGridlines`,e.minorGridlines)),e.multiLevel!==void 0&&(this._categoryAxis(`multiLevel`),a.push(((e,t)=>n=>J(n,e,e=>e.type===`cat`?q(e,`noMultiLvlLbl`,!t):e))(r,e.multiLevel))),e.categoryNames!==void 0&&a.push(this._categoriesEdit(e.categoryNames));let c=e=>{throw new t(n(`error.chart.notValidForType`,{type:e}))},l=e=>{this._axis()?.type===`cat`&&c(e)};if(e.minorUnit!==void 0){l(`minorUnit`);let t=i(e.minorUnit,`minorUnit`);t===`auto`||t>0||c(`minorUnit`);let n=this._axis();n?.type===`date`?a.push(lo(r,`minor`,t===`auto`?null:t,e.minorTimeUnitScale??n.minorTimeUnit??n.baseTimeUnit??this._automaticBaseUnit())):a.push(ia(r,`minorUnit`,t))}if(e.scaleType!==void 0&&(l(`scaleType`),e.scaleType!==`linear`&&e.scaleType!==`logarithmic`&&c(String(e.scaleType)),a.push($a(r,e.scaleType===`logarithmic`?this._axis()?.scaling?.logBase??10:null))),e.logBase!==void 0&&(l(`logBase`),(!Number.isFinite(e.logBase)||e.logBase<2)&&c(`logBase`),a.push($a(r,e.logBase))),e.displayUnit!==void 0){l(`displayUnit`);let t=e.displayUnit;t===`custom`?a.push(to(r,this._axis()?.dispUnits?.custUnit??this.getCustomDisplayUnit())):t===`none`?a.push(to(r,null)):Ys[t]===void 0?c(String(t)):a.push(to(r,t))}if(e.customDisplayUnit!==void 0&&(l(`customDisplayUnit`),(!Number.isFinite(e.customDisplayUnit)||e.customDisplayUnit<=0)&&c(`customDisplayUnit`),a.push(to(r,e.customDisplayUnit))),e.showDisplayUnitLabel!==void 0&&a.push(((e,t)=>n=>J(n,e,e=>{if(!e.dispUnits)return e;let n=q(e.dispUnits,`dispUnitsLbl`,t?e.dispUnits.dispUnitsLbl??eo():void 0);return n===e.dispUnits?e:{...e,dispUnits:n}}))(r,e.showDisplayUnitLabel)),e.crosses!==void 0){let t=e.crosses===`automatic`?`autoZero`:e.crosses===`maximum`?`max`:e.crosses===`minimum`?`min`:e.crosses===`custom`?this._crossing()?.crossesAt??0:c(String(e.crosses));a.push(io(r,t))}e.crossesAt!==void 0&&(Number.isFinite(e.crossesAt)||c(`crossesAt`),a.push(io(r,e.crossesAt))),e.reversePlotOrder!==void 0&&a.push(((e,t)=>n=>{let r=n.chart.plotArea.axes.find(t=>t.axId===e);return!r||r.scaling?.orientation===`maxMin`===t?n:ro(J(n,e,e=>({...e,scaling:{...e.scaling,orientation:t?`maxMin`:`minMax`}})),r,`other`)})(r,!!e.reversePlotOrder));for(let[t,n]of[[`majorTickMark`,`majorTickMark`],[`minorTickMark`,`minorTickMark`]]){let i=e[t];if(i===void 0)continue;let o=Xs[i];o||c(String(i)),a.push(ao(r,n,o))}if(e.tickLabelPosition!==void 0){let t=Qs[e.tickLabelPosition];t||c(String(e.tickLabelPosition)),a.push(((e,t)=>n=>J(n,e,e=>q(e,`tickLblPos`,t)))(r,t))}if(e.textOrientation!==void 0){let t=e.textOrientation;(typeof t==`number`?!Number.isFinite(t)||t<-90||t>90:t!==`vertical`&&t!==`auto`)&&c(`textOrientation`),a.push(((e,t)=>n=>J(n,e,e=>{let n=oo(e.txPr??G(9,-1e3),t);return n===e.txPr?e:{...e,txPr:n}}))(r,t))}e.style!==void 0&&a.push(...this.getStyle().edits(e.style));for(let[t,n]of[[`tickLabelSpacing`,`tickLblSkip`],[`tickMarkSpacing`,`tickMarkSkip`]]){let i=e[t];i!==void 0&&(this._axis()?.type!==`cat`&&c(t),i!==null&&(!Number.isInteger(i)||i<1)&&c(t),a.push(co(r,n,i)))}if(e.baseTimeUnit!==void 0){this._axis()?.type!==`date`&&c(`baseTimeUnit`);let t=e.baseTimeUnit===`auto`?this._automaticBaseUnit():e.baseTimeUnit;ec.includes(t)||c(String(t)),a.push(((e,t)=>n=>J(n,e,e=>e.type===`date`?q(e,`baseTimeUnit`,t):e))(r,t))}for(let[t,n,i]of[[`majorTimeUnitScale`,`major`,e.majorUnit],[`minorTimeUnitScale`,`minor`,e.minorUnit]]){let o=e[t];if(o===void 0||(this._axis()?.type===`date`&&ec.includes(o)||c(t),i!==void 0))continue;let s=n===`major`?this._axis()?.majorUnit:this._axis()?.minorUnit;a.push(lo(r,n,s??1,o))}if(e.categoryType!==void 0){let t=this._categoryAxis(`categoryType`),n=e.categoryType===`automatic`?`auto`:e.categoryType===`textAxis`?`cat`:e.categoryType===`dateAxis`?`date`:c(String(e.categoryType)),r=this._dates();a.push(((e,t,n,r)=>i=>J(i,e,e=>{if(e.type!==`cat`&&e.type!==`date`)return e;let i=t===`auto`?n?`date`:`cat`:t,a={...e,type:i,auto:t===`auto`};if(i===`cat`){a=q(a,`lblAlgn`,e.lblAlgn??`ctr`),a=q(a,`noMultiLvlLbl`,e.noMultiLvlLbl??!1);for(let e of[`baseTimeUnit`,`majorTimeUnit`,`minorTimeUnit`,`majorUnit`,`minorUnit`])a=q(a,e,void 0)}else a=q(a,`lblAlgn`,void 0),a=q(a,`noMultiLvlLbl`,void 0),a=q(a,`tickLblSkip`,void 0),a=q(a,`tickMarkSkip`,void 0),a=q(a,`baseTimeUnit`,e.baseTimeUnit??r);return a=q(a,`lblOffset`,e.lblOffset??100),a}))(t.axId,n,!!r,this._automaticBaseUnit()))}return a}update(e,t){let n=Object.keys(e).filter(t=>e[t]!==void 0),r=n.length===1&&n[0]===`categoryNames`?ss:as;return this._host.edit(r,K(this.edits(e)),t),this}},Js=class{constructor(e){this._host=e,this._axes=new Map}axis(e){let t=this._axes.get(e);return t||this._axes.set(e,t=new qs(this._host,e)),t}_prune(e){for(let t of this._axes.keys())e?.axes.some(e=>e.axId===t)||this._axes.delete(t)}getItems(){this._prune(this._host.model()?.chart?.plotArea);let e=this._host.facts();return e?e.axes.filter(e=>!e.deleted).map(e=>this.axis(e.axId)):[]}getChartAxis(e,t=`primary`){let n=this._host.model()?.chart?.plotArea;if(this._prune(n),!n)return null;let r=Us(n),i=n.axes.find(i=>r.includes(i.axId)===(t===`primary`)&&(e===`series`?i.type===`ser`:i.type!==`ser`&&Ws(n,i)===(e===`category`)));return i?this.axis(i.axId):null}getValueAxis(e){return this.getChartAxis(`value`,e)}getCategoryAxis(e){return this.getChartAxis(`category`,e)}getSeriesAxis(){return this.getChartAxis(`series`)}},Ys={hundreds:100,thousands:1e3,tenThousands:1e4,hundredThousands:1e5,millions:1e6,tenMillions:1e7,hundredMillions:1e8,billions:1e9,trillions:0xe8d4a51000},Xs={none:`none`,inside:`in`,outside:`out`,cross:`cross`},Zs={none:`none`,in:`inside`,out:`outside`,cross:`cross`},Qs={nextToAxis:`nextTo`,high:`high`,low:`low`,none:`none`},$s={nextTo:`nextToAxis`,high:`high`,low:`low`,none:`none`},ec=[`days`,`months`,`years`],tc=e=>{if(e?.vert===`wordArtVert`||e?.vert===`vert`)return`vertical`;let t=e?.rotation;return t===void 0||t<=-1e3?`auto`:t===0?0:-t},nc=class{constructor(e,t,n){this._host=e,this._axis=t,this._axId=n,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._axis}getElementType(){return`axisTitle`}getPath(){return`${this._axis.getPath()}/title`}get isITitle(){return!0}get isIAxisTitle(){return!0}_title(){return this._host.model()?.chart?.plotArea?.axes.find(e=>e.axId===this._axId)?.title}getText(){let e=this._host.resolved();if(e)return e.axes.find(e=>e.id===this._axId)?.title?.text??null;let t=this._host.facts()?.axes.find(e=>e.axId===this._axId);return t?this._host.text(t.title):null}setText(e,t){return this.update({text:e},t)}getVisible(){return!!this._title()}setVisible(e,t){return this.update({visible:e},t)}getOverlay(){return this._title()?.overlay??!1}setOverlay(e,t){return this.update({overlay:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>((e,t)=>n=>J(n,e,e=>{if(!e.title)return e;let n=X(e.title,t);return n===e.title?e:{...e,title:n}}))(this._axId,e),new As(this._host,()=>Ga(this._title()),e=>((e,t)=>n=>J(n,e,e=>{if(!e.title)return e;let n=Wa(e.title,t,10,aa(e));return n===e.title?e:{...e,title:n}}))(this._axId,e),os,{size:10,bold:!0}),os)}_style(e){return $(this._host,()=>this._title()?.spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,os)}getTextOrientation(){let e=this._title();return tc(e?.tx?.rich?.bodyPr??e?.txPr?.bodyPr)}setTextOrientation(e,t){return this.update({textOrientation:e},t)}edits(e){let r=this._axId,i=[];var a,o;if(e.visible!==void 0&&i.push(so(r,e.visible)),e.text!==void 0&&i.push((a=r,o=e.text,e=>J(e,a,t=>{if(o===null)return q(t,`title`,void 0);let n=t.title??{overlay:!1,spPr:{fill:{type:`none`},stroke:{fill:{type:`none`}},effects:[]},txPr:G(10,aa(t))};return{...t,title:{...n,tx:ea(o,n.txPr,e.lang)}}}))),e.overlay!==void 0&&i.push(so(r,!0),((e,t)=>n=>J(n,e,e=>e.title?{...e,title:q(e.title,`overlay`,t)}:e))(r,!!e.overlay)),e.style!==void 0&&i.push(so(r,!0),...this.getStyle().edits(e.style)),e.textOrientation!==void 0){let a=e.textOrientation;if(typeof a==`number`?!Number.isFinite(a):a!==`vertical`&&a!==`auto`)throw new t(n(`error.chart.notValidForType`,{type:`textOrientation`}));i.push(so(r,!0),((e,t)=>n=>J(n,e,e=>{if(!e.title)return e;let n=oo(e.title.txPr??G(10,aa(e)),t),r=e.title.tx?.rich?oo(e.title.tx.rich,t):void 0;return n===e.title.txPr&&r===e.title.tx?.rich?e:{...e,title:{...e.title,txPr:n,...r?{tx:{...e.title.tx,rich:r}}:{}}}}))(r,a))}return i}update(e,t){return this._host.edit(os,K(this.edits(e)),t),this}axis(){return this._axis}},rc={automatic:`auto`,none:`none`,square:`square`,diamond:`diamond`,triangle:`triangle`,x:`x`,star:`star`,dot:`dot`,dash:`dash`,circle:`circle`,plus:`plus`},ic={ctr:`center`,inEnd:`insideEnd`,inBase:`insideBase`,outEnd:`outsideEnd`,l:`left`,r:`right`,t:`top`,b:`bottom`,bestFit:`bestFit`},ac={center:`ctr`,insideEnd:`inEnd`,insideBase:`inBase`,outsideEnd:`outEnd`,left:`l`,right:`r`,top:`t`,bottom:`b`,bestFit:`bestFit`},oc=e=>e.type===`line`||e.type===`scatter`||e.type===`radar`,sc=e=>e.type===`pie`||e.type===`doughnut`||e.type===`ofPie`,cc={splitByPosition:`pos`,splitByValue:`val`,splitByPercentValue:`percent`,splitByCustomSplit:`cust`},lc={auto:`splitByPosition`,pos:`splitByPosition`,val:`splitByValue`,percent:`splitByPercentValue`,cust:`splitByCustomSplit`},uc=e=>{let t=Math.max(5e8,...e.axes.map(e=>e.axId))+1;return()=>t++},dc=class{constructor(e,t){this._host=e,this._key=t,this._marker=null,this._labels=null,this._xErrorBars=null,this._yErrorBars=null,this._styleCache=null,this._trendlines=new Map,this._points=new Map,this._group=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`series`}getPath(){return`series/${this._key}`}get isISeries(){return!0}key(){return this._key}groupPart(){let e=this._facts();return e&&(this._group=this._host.group(e.group)),this._group??=this._host.group(0)}_facts(){return this._host.facts()?.series.find(e=>e.key===this._key)??null}idx(){if(!/^\d+$/.test(this._key))throw new t(n(`error.chart.typeNotEditable`,{type:this.getChartType()}));return Number(this._key)}found(){let e=this._host.model()?.chart?.plotArea;return e?st(e,this._key):null}resolved(){for(let e of this._host.resolved()?.groups??[]){let t=e.series.find(e=>e.id===`s${this._key}`);if(t)return t}return null}getName(){let e=this._facts();return e?this._host.text(e.name):null}getNameFormula(){return this._host.formula(this._facts()?.name.slot??null)}getValuesFormula(){let e=this._facts();return e?this._host.formulaOf(e.values):null}getCategoriesFormula(){let e=this._facts();return e?this._host.formulaOf(e.categories):null}getBubbleSizesFormula(){let e=this._facts();return e?this._host.formulaOf(e.sizes):null}getNameRange(){return this._host.range(this._facts()?.name.slot??null)}getValuesRange(){return this._host.range(this._facts()?.values.slot??null)}getCategoriesRange(){return this._host.range(this._facts()?.categories.slot??null)}getChartType(){return this._facts()?.type??`unknown`}isSecondaryAxis(){return this._facts()?.secondary??!1}setName(e,t){return this.update({name:e},t)}setValues(e,t){return this.update({values:e},t)}setXAxisValues(e,t){return this.update({xAxisValues:e},t)}setBubbleSizes(e,t){return this.update({bubbleSizes:e},t)}setChartType(e,t){return this._host.edit(us,this._typeEdit(e),t),this}getAxisGroup(){let e=this._host.model()?.chart?.plotArea,t=this.found();return e&&t?at(e,t.group)??`primary`:`primary`}setAxisGroup(e,t){return this._host.edit(ds,this._axisGroupEdit(e),t),this}getStyle(){return this._styleCache??=this._style(e=>fa(this.idx(),e))}_style(e){let t=this._host;return $(t,()=>this.found()?.series.spPr,e=>{let n=t.model(),r=this.found(),i=n&&r?Gt(n,t.theme(),r.series.idx??0):`#000000`;return r&&(r.group.type===`line`||r.group.type===`scatter`||r.group.type===`radar`&&r.group.radarStyle!==`filled`)?{fill:e?.fill??{type:`none`},stroke:ks(e?.stroke,{width:2.25,lineCap:`round`,fill:Q(i)})}:{fill:e?.fill??Q(i),stroke:e?.stroke}},e,fs)}getMarker(){return this._marker??=new fc(this._host,this)}getDataLabels(){return this._labels??=new pc(this._host,this)}getTrendlines(){return Ps(this._trendlines,this.found()?.series.trendlines?.length??0,e=>new _c(this._host,this,e))}getChartTrendline(e){let t=this.found()?.series.trendlines?.length??0;return Number.isInteger(e)&&e>=0&&e<t?Ns(this._trendlines,e,()=>new _c(this._host,this,e)):null}getXErrorBars(){return this._xErrorBars??=new wc(this._host,this,`x`)}getYErrorBars(){return this._yErrorBars??=new wc(this._host,this,`y`)}getUpDownBars(){return this.groupPart().getUpDownBars()}getHiLoLines(){return this.groupPart().getHiLoLines()}getDropLines(){return this.groupPart().getDropLines()}getSeriesLines(){return this.groupPart().getSeriesLines()}addChartTrendline(e=`linear`,r){let i=this.found();if(!i||!gc(i.group))throw new t(n(`error.chart.notValidForType`,{type:this.getChartType()}));let a=mc[e];if(!a)throw new t(n(`error.chart.notValidForType`,{type:String(e)}));let o=this.idx(),s=i.series.trendlines?.length??0;return this._host.edit(hs,Ca(o,xa(a,_i(o))),r),Ns(this._trendlines,s,()=>new _c(this._host,this,s))}getGapWidth(){let e=this.found()?.group;return e&&Tc(e)?e.upDownBars?e.upDownBars.gapWidth??150:null:e?.type===`bar`||e?.type===`ofPie`?e.gapWidth??150:null}setGapWidth(e,t){return this.update({gapWidth:e},t)}getOverlap(){let e=this.found()?.group;return e?.type===`bar`?e.overlap??(e.grouping===`stacked`||e.grouping===`percentStacked`?100:0):null}setOverlap(e,t){return this.update({overlap:e},t)}getBubbleScale(){let e=this.found()?.group;return e?.type===`bubble`?e.bubbleScale??100:null}setBubbleScale(e,t){return this.update({bubbleScale:e},t)}getShowNegativeBubbles(){let e=this.found()?.group;return e?.type===`bubble`?e.showNegBubbles??!1:null}setShowNegativeBubbles(e,t){return this.update({showNegativeBubbles:e},t)}getBubbleSizeRepresents(){let e=this.found()?.group;return e?.type===`bubble`?e.sizeRepresents===`w`?`width`:`area`:null}setBubbleSizeRepresents(e,t){return this.update({bubbleSizeRepresents:e},t)}_bubbleEdit(e){if(this.found()?.group.type!==`bubble`)throw new t(n(`error.chart.notValidForType`,{type:this.getChartType()}));let r=e.bubbleScale;if(r!==void 0&&(!Number.isFinite(r)||r<0||r>300))throw new t(n(`error.chart.notValidForType`,{type:`bubbleScale`}));return((e,t)=>n=>Y(n,e,e=>{let n=e;return t.bubbleScale!==void 0&&(n=q(n,`bubbleScale`,t.bubbleScale)),t.showNegBubbles!==void 0&&(n=q(n,`showNegBubbles`,t.showNegBubbles)),t.sizeRepresents!==void 0&&(n=q(n,`sizeRepresents`,t.sizeRepresents===`w`?`w`:void 0)),n}))(this.idx(),r===void 0?e:{...e,bubbleScale:Math.round(r)})}getSplitType(){let e=this.found()?.group;return e?.type===`ofPie`?lc[e.splitType??`pos`]:null}setSplitType(e,t){return this.update({splitType:e},t)}getSplitValue(){let e=this.found()?.group;return e?.type!==`ofPie`||e.splitType===`cust`?null:e.splitType===void 0||e.splitType===`auto`?Kn(this.resolved()?.values.length??0):e.splitPos??(e.splitType===`pos`?Kn(this.resolved()?.values.length??0):0)}setSplitValue(e,t){return this.update({splitValue:e},t)}getSecondPlotSize(){let e=this.found()?.group;return e?.type===`ofPie`?e.secondPieSize??75:null}setSecondPlotSize(e,t){return this.update({secondPlotSize:e},t)}getSecondPlotPoints(){let e=this.found()?.group;return e?.type===`ofPie`?qn(e,this.resolved()?.values??[]).flatMap((e,t)=>e?[t]:[]):[]}setSecondPlotPoints(e,t){return this.update({secondPlotPoints:e},t)}_splitEdit(e){let r=this.found()?.group;if(r?.type!==`ofPie`)throw new t(n(`error.chart.notValidForType`,{type:this.getChartType()}));let i=this.resolved()?.values??[];if(`type`in e&&!e.type)throw new t(n(`error.chart.notValidForType`,{type:`splitType`}));if(`value`in e&&(!Number.isFinite(e.value)||e.value<0||r.splitType===`cust`))throw new t(n(`error.chart.notValidForType`,{type:`splitValue`}));if(`points`in e&&e.points.some(e=>!Number.isInteger(e)||e<0||e>=i.length))throw new t(n(`error.chart.notValidForType`,{type:`secondPlotPoints`}));return((e,t,n)=>r=>Y(r,e,e=>{let r=e.splitType??`auto`,i=()=>qn(e,n).flatMap((e,t)=>e?[t]:[]),a=e;return`points`in t?(a=q(a,`splitType`,`cust`),a=q(a,`splitPos`,void 0),q(a,`custSplit`,[...new Set(t.points)].sort((e,t)=>e-t))):`value`in t?(r===`auto`&&(a=q(a,`splitType`,`pos`)),q(a,`splitPos`,t.value)):t.type===r?e:(a=q(a,`splitType`,t.type),t.type===`cust`?(a=q(a,`splitPos`,void 0),q(a,`custSplit`,i())):(a=q(a,`custSplit`,void 0),q(a,`splitPos`,t.type===`pos`?i().length:1)))}))(this.idx(),e,i)}_groupOption(e,r){let i=this.found()?.group,a=e===`gapWidth`&&!!i?.upDownBars&&Tc(i),o=i?.type===`ofPie`&&e!==`overlap`;if(!(i?.type===`bar`&&e!==`secondPieSize`||a||o))throw new t(n(`error.chart.notValidForType`,{type:this.getChartType()}));let[s,c]=e===`gapWidth`?[0,500]:e===`secondPieSize`?[5,200]:[-100,100];if(!Number.isFinite(r)||r<s||r>c)throw new t(n(`error.chart.notValidForType`,{type:e}));return a?Ba(this.idx(),Math.round(r)):((e,t,n)=>r=>Y(r,e,e=>q(e,t,n)))(this.idx(),e,Math.round(r))}_typeEdit(e){let r=Go(e);if(oi(r)||!(e=>{let t=ai[e];return!t.is3D&&!t.view&&!t.chartEx})(r)||Ti(r).type===`ofPie`)throw new t(n(`error.chart.notValidForType`,{type:String(e)}));let i=Ti(r),a=this.idx(),o=this.getChartType(),s=new Map;for(let e of this._host.resolved()?.groups??[])for(let t of e.series)s.set(t.idx,t.values.length);return e=>{let t=e.chart.plotArea;if(!ot(t,a))return e;let n=vt(t,a,i,uc(t)),c=n.groups.map(e=>{let n=!1,c=e.series.map(i=>{let c=ot(t,i.idx??-1)?.group,l=s.get(i.idx??-1)??0;if(c&&(c.type!==e.type||(c.barDir??`col`)!==(e.barDir??`col`)))return n=!0,Rc(Ei(i,r,l),e);if(i.idx!==a||o===r)return i;n=!0;let u=Ei(i,r,l);return e.type===`scatter`?u:{...u,spPr:i.spPr}});if(!n)return e;let l={...e,series:c};return e.type===`line`&&i.markers&&(l.marker=!0),l});return{...e,chart:{...e.chart,plotArea:{...n,groups:c}}}}}_axisGroupEdit(e){if(e!==`primary`&&e!==`secondary`)throw new t(n(`error.chart.notValidForType`,{type:String(e)}));let r=this.idx();return t=>{let n=((e,t,n,r)=>{let i=ot(e,t);if(!i)throw Error(`No series with idx ${t}.`);let{group:a,groupIndex:o}=i,s=at(e,a);if(s===null||s===n)return e;let c=ct(e),l=_t(e,o,t),u=e.axes,d=n===`primary`?c[0]:c[1];if(d){if(!ut($e(a),lt({...e,groups:l},d)))throw Error(`Those axes hold groups this series cannot share them with.`)}else{let e=ht($e(a),r,!1);u=[...u,...e.axes],d=e.axIds}let f={...e,groups:l,axes:u},p=l.findIndex(e=>nt(e,a)&&it(e,d));if(p!==-1)l=[...l],l[p]={...l[p],series:dt(l[p].series,i.series)};else{let e=l.find(e=>it(e,d)),{series:t,dLbls:n,unknown:r,...o}=a,s={...o,series:[i.series],axIds:e?[...e.axIds]:[...d]};l=ft(f,l,s)}return gt({...f,groups:l})})(t.chart.plotArea,r,e,uc(t.chart.plotArea));return n===t.chart.plotArea?t:{...t,chart:{...t.chart,plotArea:n}}}}getFormula(){let e=this._facts(),t=this.found();if(!e||!t)return``;let n=[this.getNameFormula()??(t.series.tx?.v===void 0?``:`"${t.series.tx.v.replace(/"/g,`""`)}"`),this.getCategoriesFormula()??``,this.getValuesFormula()??``,String(this.getPlotOrder()+1)],r=this.getBubbleSizesFormula();return r!==null&&n.push(r),`=SERIES(${n.join(`,`)})`}setFormula(e,t){return this.update({formula:e},t)}getDimensionValues(e){let r=this.resolved();if(!r)return[];let i=e=>(e??[]).map(e=>e===null?``:String(e));switch(e){case`categories`:return r.categories.slice();case`values`:case`yvalues`:return i(r.values);case`xvalues`:return r.xValues?i(r.xValues):r.categories.slice();case`bubbleSizes`:return i(r.bubbleSizes);default:throw new t(n(`error.chart.notValidForType`,{type:String(e)}))}}getPlotOrder(){let e=this.found();if(!e)return 0;let t=(this._host.model()?.chart?.plotArea?.groups??[]).flatMap(e=>e.series).sort((e,t)=>(e.order??0)-(t.order??0));return Math.max(0,t.indexOf(e.series))}setPlotOrder(e,t){return this.update({plotOrder:e},t)}getSmooth(){let e=this.found();return!!e&&(e.series.smooth===void 0?e.group.smooth??(e.group.scatterStyle===`smooth`||e.group.scatterStyle===`smoothMarker`):e.series.smooth)}setSmooth(e,t){return this.update({smooth:e},t)}getInvertIfNegative(){return this.found()?.series.invertIfNegative??!1}setInvertIfNegative(e,t){return this.update({invertIfNegative:e},t)}getExplosion(){return this.found()?.series.explosion??0}setExplosion(e,t){return this.update({explosion:e},t)}getVaryByCategories(){return this.found()?.group.varyColors??!1}setVaryByCategories(e,t){return this.update({varyByCategories:e},t)}getPoints(){return Ps(this._points,this.pointCount(),e=>new jc(this._host,this,e))}point(e){return Number.isInteger(e)&&e>=0&&e<this.pointCount()?Ns(this._points,e,()=>new jc(this._host,this,e)):null}delete(e){var t;this._host.edit(bs,(t=this.idx(),e=>Zi(e,e=>{let n=ot(e,t);if(!n)return e;let r=e.groups.map(e=>e===n.group?{...e,series:e.series.filter(e=>e.idx!==t)}:e),i={...e,groups:r};return r.some(e=>e.series.length>0)&&(i=gt(i)),po(fo(i,e=>e.order??0))})),e)}pointCount(){return this.resolved()?.values.length??0}_formulaEdits(e){let r=/^\s*=?\s*SERIES\s*\((.*)\)\s*$/is.exec(e);if(!r)throw new t(n(`error.chart.notValidForType`,{type:e}));let i=Ac(r[1]);if(i.length<3||i.length>5)throw new t(n(`error.chart.notValidForType`,{type:e}));let[a,o,s,c,l]=i.map(e=>e.trim()),u=this.idx(),d=[],f=/^".*"$/s.test(p=a)?p.slice(1,-1).replace(/""/g,`"`):null;var p;d.push(ua(u,a===``?null:f===null?`=${a.replace(/^=/,``)}`:f)),d.push(this._categoriesEdit(o===``?null:o)),s!==``&&d.push(da(u,`values`,this._source(s,`values`)),ho(u,ts(s,this._host.sheet()))),l!==void 0&&l!==``&&this.found()?.group.type===`bubble`&&d.push(da(u,`bubbleSizes`,this._source(l,`values`)));let m=c===void 0||c===``?NaN:Number(c);return Number.isInteger(m)&&m>=1&&d.push(go(u,m-1)),d}_categoriesEdit(e){let t=this.found(),n=t?.group.type===`scatter`||t?.group.type===`bubble`,r=e===null?void 0:this._source(e,`categories`),i=t?.group.axIds[0];return n||i===void 0||t?.group.axIds.length===0?da(this.idx(),`categories`,r):oa(i,r,null)}_source(e,r){let i=this._host.sheet();if(!i){if(typeof e!=`string`)return r===`values`?{numRef:{f:Xo(e)}}:{strRef:{f:Xo(e)}};throw new t(n(`error.chart.noData`))}return es(e,r,i)}edits(e){let r=this.idx(),i=[],a=ls,o=(e,t)=>{i.push(da(r,e,t))};if(e.name!==void 0){let t=e.name;i.push(ua(r,t===null?null:typeof t==`string`?t:`=${Xo(t)}`))}if(e.values!==void 0&&(o(`values`,this._source(e.values,`values`)),i.push(ho(r,ts(e.values,this._host.sheet())))),e.xAxisValues!==void 0&&i.push(this._categoriesEdit(e.xAxisValues)),e.bubbleSizes!==void 0&&o(`bubbleSizes`,this._source(e.bubbleSizes,`values`)),e.chartType!==void 0&&(i.push(this._typeEdit(e.chartType)),a=us),e.axisGroup!==void 0&&(i.push(this._axisGroupEdit(e.axisGroup)),a=ds),e.style!==void 0&&(i.push(this._styleEdit(e.style)),a=fs),e.marker!==void 0&&(i.push(...this.getMarker().edits(e.marker)),a=ps),e.dataLabels!==void 0&&(i.push(...this.getDataLabels().edits(e.dataLabels)),a=ms),e.gapWidth!==void 0&&(i.push(this._groupOption(`gapWidth`,e.gapWidth)),a=Z),e.overlap!==void 0&&(i.push(this._groupOption(`overlap`,e.overlap)),a=Z),e.bubbleScale!==void 0&&(i.push(this._bubbleEdit({bubbleScale:e.bubbleScale})),a=Z),e.showNegativeBubbles!==void 0&&(i.push(this._bubbleEdit({showNegBubbles:!!e.showNegativeBubbles})),a=Z),e.bubbleSizeRepresents!==void 0){if(e.bubbleSizeRepresents!==`area`&&e.bubbleSizeRepresents!==`width`)throw new t(n(`error.chart.notValidForType`,{type:String(e.bubbleSizeRepresents)}));i.push(this._bubbleEdit({sizeRepresents:e.bubbleSizeRepresents===`width`?`w`:`area`})),a=Z}e.splitType!==void 0&&(i.push(this._splitEdit({type:cc[e.splitType]})),a=Z),e.splitValue!==void 0&&(i.push(this._splitEdit({value:e.splitValue})),a=Z),e.secondPlotSize!==void 0&&(i.push(this._groupOption(`secondPieSize`,e.secondPlotSize)),a=Z),e.secondPlotPoints!==void 0&&(i.push(this._splitEdit({points:e.secondPlotPoints})),a=Z);let s=this.found()?.group,c=()=>{throw new t(n(`error.chart.notValidForType`,{type:this.getChartType()}))};if(e.formula!==void 0&&i.push(...this._formulaEdits(e.formula)),e.plotOrder!==void 0){if(!Number.isInteger(e.plotOrder)||e.plotOrder<0)throw new t(n(`error.chart.notValidForType`,{type:`plotOrder`}));i.push(go(r,e.plotOrder)),a=xs}if(e.smooth!==void 0&&(s?.type!==`line`&&s?.type!==`scatter`&&c(),i.push(_o(r,`smooth`,!!e.smooth)),a=Z),e.invertIfNegative!==void 0&&(s?.type!==`bar`&&s?.type!==`bubble`&&c(),i.push(_o(r,`invertIfNegative`,!!e.invertIfNegative)),a=Z),e.explosion!==void 0){if(s?.type!==`pie`&&s?.type!==`doughnut`&&s?.type!==`ofPie`&&c(),!Number.isFinite(e.explosion)||e.explosion<0||e.explosion>400)throw new t(n(`error.chart.notValidForType`,{type:`explosion`}));i.push(((e,t)=>n=>Qi(n,e,e=>q(e,`explosion`,t>0?t:void 0)))(r,Math.round(e.explosion))),a=Z}return e.varyByCategories!==void 0&&(i.push(((e,t,n)=>r=>Y(r,e,(e,r)=>{let i=q(e,`varyColors`,t);if(e.series.length!==1)return i;let a={...r};if(t){if(r.points?.length)return i;let t=r.spPr?.stroke??{fill:{type:`none`}};a.points=Array.from({length:n},(n,i)=>({idx:i,...e.type===`bar`?{invertIfNegative:!1}:{},bubble3D:!1,spPr:i===0&&r.spPr?r.spPr:{fill:U(_i(i)),stroke:{...t},effects:[]}})),delete a.spPr}else{if(!r.points?.length)return i;let e=r.points.find(e=>e.idx===0)??r.points[0];e.spPr&&(a.spPr=e.spPr),delete a.points}return i={...i,series:i.series.map(e=>e===r?a:e)},i}))(r,!!e.varyByCategories,this.pointCount())),a=Z),Object.keys(e).filter(t=>e[t]!==void 0).length>1&&(a=fs),{description:a,edits:i}}_styleEdit(e){let t=e=>e;return this._style(e=>(t=fa(this.idx(),e),e=>e)).update(e),t}update(e,t){let{description:n,edits:r}=this.edits(e);return this._host.edit(n,K(r),t),this}},fc=class{constructor(e,t){this._host=e,this._series=t,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._series}getElementType(){return`marker`}getPath(){return`${this._series.getPath()}/marker`}get isIMarker(){return!0}_check(){let e=this._series.found()?.group;if(!e||!oc(e))throw new t(n(`error.chart.notValidForType`,{type:this._series.getChartType()}));return this._series.idx()}getSymbol(){let e=this._series.found();if(!e||!oc(e.group))return`none`;let t=e.series.marker?.symbol;return t===void 0?this._series.resolved()?.marker?`automatic`:`none`:t===`auto`||t===`picture`?`automatic`:t}setSymbol(e,t){return this.update({symbol:e},t)}getSize(){return this._series.found()?.series.marker?.size??5}setSize(e,t){return this.update({size:e},t)}getStyle(){return this._styleCache??=this._style(e=>t=>pa(this._check(),{spPr:Ks(this._series.found()?.series.marker?.spPr,e)??null})(t))}_style(e){let t=this._host;return $(t,()=>this._series.found()?.series.marker?.spPr,e=>{let n=t.model(),r=this._series.found(),i=n&&r?Gt(n,t.theme(),r.series.idx??0):`#000000`;return{fill:e?.fill??Q(i),stroke:ks(e?.stroke,{width:.75,fill:Q(i)})}},e,ps)}edits(e){let r=this._check(),i=[];if(e.symbol!==void 0){let a=rc[e.symbol];if(!a)throw new t(n(`error.chart.notValidForType`,{type:String(e.symbol)}));i.push(pa(r,{symbol:a}))}if(e.size!==void 0){if(!Number.isFinite(e.size)||e.size<2||e.size>72)throw new t(n(`error.chart.notValidForType`,{type:`size`}));i.push(pa(r,{size:Math.round(e.size)}))}if(e.style!==void 0){let t=e=>e;this._style(e=>(t=t=>pa(r,{spPr:Ks(this._series.found()?.series.marker?.spPr,e)??null})(t),e=>e)).update(e.style),i.push(t)}return i}update(e,t){return this._host.edit(ps,K(this.edits(e)),t),this}},pc=class{constructor(e,t){this._host=e,this._series=t,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._series}getElementType(){return`dataLabels`}getPath(){return`${this._series.getPath()}/dataLabels`}get isIDataLabels(){return!0}stated(){return this._options()}_options(){let e=this._series.found();if(!e)return{};let t=e.series.dLbls;return t?.delete?{delete:!0}:{...e.group.dLbls,...zc(t)}}getVisible(){let e=this._series.found();return!(!e||e.series.dLbls?.delete)&&ga(this._options())}setVisible(e,t){return this.update({visible:e},t)}_flag(e){let t=this._options();return!t.delete&&!0===t[e]}getShowValue(){return this._flag(`showVal`)}setShowValue(e,t){return this.update({showValue:e},t)}getShowCategoryName(){return this._flag(`showCatName`)}setShowCategoryName(e,t){return this.update({showCategoryName:e},t)}getShowSeriesName(){return this._flag(`showSerName`)}setShowSeriesName(e,t){return this.update({showSeriesName:e},t)}getShowPercentage(){return this._flag(`showPercent`)}setShowPercentage(e,t){return this.update({showPercentage:e},t)}getPosition(){let e=this._series.found(),t=this._options().dLblPos;return ic[e?Ut(e.group,t):t??`r`]}setPosition(e,t){return this.update({position:e},t)}getSeparator(){return this._options().separator??`, `}setSeparator(e,t){return this.update({separator:e},t)}getNumberFormat(){let e=this._options().numFmt;return e&&!e.sourceLinked?e.formatCode:null}setNumberFormat(e,t){return this.update({numberFormat:e},t)}getLinkNumberFormat(){let e=this._options().numFmt;return!e||!1!==e.sourceLinked}setLinkNumberFormat(e,t){return this.update({linkNumberFormat:e},t)}getShowLegendKey(){return this._flag(`showLegendKey`)}setShowLegendKey(e,t){return this.update({showLegendKey:e},t)}getShowBubbleSize(){return this._flag(`showBubbleSize`)}setShowBubbleSize(e,t){return this.update({showBubbleSize:e},t)}getValueFromCellsFormula(){let e=(this._series.found()?.series)?.extLst?.extensions?.find(e=>e.datalabelsRange)?.datalabelsRange;if(!e)return null;let t=de(this._host.model()).referenceSlots.get(e);return this._host.formula(t??null)??e.f}setValueFromCells(e,t){return this.update({valueFromCells:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>Do(this._series.idx(),e),new As(this._host,()=>Ga({txPr:this._options().txPr}),e=>Oo(this._series.idx(),e),ms,{size:10,bold:!1}),ms)}_style(e){return $(this._host,()=>this._options().spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,ms)}getTextOrientation(){let e=tc(this._options().txPr?.bodyPr);return e===`auto`?0:e}setTextOrientation(e,t){return this.update({textOrientation:e},t)}edits(e,r=!1){let i=this._series.idx(),a=this._series.found()?.group,o=[],s=e=>{throw new t(n(`error.chart.notValidForType`,{type:e}))};e.visible!==void 0&&o.push(((e,t,n=!1)=>r=>t?_a(r,e,(e,t)=>{let r=ga(e)?e:{...e,showVal:!0};return!n||t.type!==`pie`&&t.type!==`doughnut`&&t.type!==`ofPie`||r.leaderLines||(r={...r,showLeaderLines:!0,leaderLines:{spPr:{stroke:W(`tx1 lumMod 35 lumOff 65`),effects:[]}}}),r}):Y(r,e,(e,t)=>{let n=q(t,`dLbls`,ga(e.dLbls)?{delete:!0}:void 0);return n===t?e:{...e,series:e.series.map(e=>e===t?n:e)}}))(i,e.visible,r));let c=[[`showValue`,`showVal`],[`showCategoryName`,`showCatName`],[`showSeriesName`,`showSerName`],[`showPercentage`,`showPercent`],[`showLegendKey`,`showLegendKey`],[`showBubbleSize`,`showBubbleSize`]];r&&!1!==e.visible&&c.some(([t])=>e[t])&&o.push((e=>t=>_a(t,e,(e,t)=>t.type!==`pie`&&t.type!==`doughnut`&&t.type!==`ofPie`||e.leaderLines?e:{...e,showLeaderLines:!0,leaderLines:{spPr:{stroke:W(`tx1 lumMod 35 lumOff 65`),effects:[]}}}))(i));for(let[t,n]of c){let r=e[t];r!==void 0&&(n!==`showPercent`||!r||a&&sc(a)||s(this._series.getChartType()),n===`showBubbleSize`&&r&&a?.type!==`bubble`&&s(this._series.getChartType()),o.push(ya(i,n,r)))}if(e.position!==void 0){let t=ac[e.position];t||s(String(e.position)),a&&!(Ht(a)??[`ctr`]).includes(t)&&s(String(e.position)),o.push(((e,t)=>n=>_a(n,e,e=>q(e,`dLblPos`,t)))(i,t))}if(e.separator!==void 0&&o.push(((e,t)=>n=>_a(n,e,e=>q(e,`separator`,t)))(i,e.separator)),e.numberFormat!==void 0&&o.push(((e,t)=>n=>_a(n,e,e=>q(e,`numFmt`,t===null?void 0:{formatCode:t,sourceLinked:!1})))(i,e.numberFormat)),e.linkNumberFormat!==void 0&&o.push(((e,t)=>n=>_a(n,e,e=>{let n=ga(e)?e:{...e,showVal:!0};return q(n,`numFmt`,t?void 0:{formatCode:n.numFmt?.formatCode??`General`,sourceLinked:!1})}))(i,!!e.linkNumberFormat)),e.valueFromCells!==void 0){let t=e.valueFromCells;o.push(((e,t)=>n=>Qi(n,e,e=>{let n=(e.extLst?.extensions??[]).filter(e=>!e.datalabelsRange);t&&n.push({uri:ko,datalabelsRange:t});let r=q(e,`extLst`,n.length?{...e.extLst,extensions:n}:void 0),i=r.dLbls&&!r.dLbls.delete?r.dLbls:{...ha(),showVal:!0},a=(i.extLst?.extensions??[]).filter(e=>e.showDataLabelsRange===void 0);return t&&a.push({uri:Ao,showDataLabelsRange:!0}),r={...r,dLbls:q(i,`extLst`,a.length?{...i.extLst,extensions:a}:void 0)},r}))(i,t===null?null:this._rangeSource(t)))}if(e.style!==void 0&&o.push(...this.getStyle().edits(e.style)),e.textOrientation!==void 0){let t=e.textOrientation;(typeof t==`number`?!Number.isFinite(t)||t<-90||t>90:t!==`vertical`)&&s(`textOrientation`),o.push(((e,t)=>n=>_a(n,e,e=>{let n=ga(e)?e:{...e,showVal:!0},r=oo(n.txPr??ha().txPr,t===`auto`?0:t);return r===e.txPr?e:{...n,txPr:r}}))(i,t))}return o}_rangeSource(e){let r=this._host.sheet();if(typeof e!=`string`)return{f:Xo(e)};if(!r)throw new t(n(`error.chart.noData`));let i=es(e,`categories`,r),a=i.strRef??i.numRef??i.multiLvlStrRef;if(!a)throw new t(n(`error.chart.notValidForType`,{type:e}));return{f:a.f}}update(e,t){return this._host.edit(ms,K(this.edits(e)),t),this}},mc={linear:`linear`,exponential:`exp`,logarithmic:`log`,polynomial:`poly`,power:`power`,movingAverage:`movingAvg`},hc={linear:`linear`,exp:`exponential`,log:`logarithmic`,poly:`polynomial`,power:`power`,movingAvg:`movingAverage`},gc=e=>!e.is3D&&(e.type===`scatter`||e.type===`bubble`||e.type===`stock`||(e.type===`bar`||e.type===`line`||e.type===`area`)&&e.grouping!==`stacked`&&e.grouping!==`percentStacked`),_c=class{constructor(e,t,n){this._host=e,this._series=t,this._index=n,this._label=null,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._series}getElementType(){return`trendline`}getPath(){return`${this._series.getPath()}/trendlines/${this._index}`}get isITrendline(){return!0}model(){return this._series.found()?.series.trendlines?.[this._index]??null}resolved(){return this._series.resolved()?.trendlines?.[this._index]??null}_check(){let e=this.model();if(!e)throw new t(n(`error.chart.notValidForType`,{type:`trendline`}));return e}_onCategories(){let e=this._series.found()?.group.type;return e!==`scatter`&&e!==`bubble`}getType(){return hc[this.model()?.trendlineType??`linear`]}setType(e,t){return this.update({type:e},t)}getPolynomialOrder(){return this.model()?.order??2}setPolynomialOrder(e,t){return this.update({polynomialOrder:e},t)}getMovingAveragePeriod(){return this.model()?.period??2}setMovingAveragePeriod(e,t){return this.update({movingAveragePeriod:e},t)}getForwardPeriod(){return this.model()?.forward??0}setForwardPeriod(e,t){return this.update({forwardPeriod:e},t)}getBackwardPeriod(){return this.model()?.backward??0}setBackwardPeriod(e,t){return this.update({backwardPeriod:e},t)}getIntercept(){let e=this.model();if(e?.intercept!==void 0)return e.intercept;let t=this.resolved()?.fit;return!t||t.type!==`linear`&&t.type!==`exp`&&t.type!==`poly`?null:t.at(0)}isInterceptAuto(){return this.model()?.intercept===void 0}setIntercept(e,t){return this.update({intercept:e},t)}getShowEquation(){return!0===this.model()?.dispEq}setShowEquation(e,t){return this.update({showEquation:e},t)}getShowRSquared(){return!0===this.model()?.dispRSqr}setShowRSquared(e,t){return this.update({showRSquared:e},t)}getName(){return this.model()?.name??this.resolved()?.name??``}isNameAuto(){return this.model()?.name===void 0}setName(e,t){return this.update({name:e},t)}getLabel(){return this._label??=new vc(this._host,this)}getStyle(){return this._styleCache??=this._style(e=>Oa(this._series.idx(),this._index,e))}_style(e){let t=this._host;return $(t,()=>this.model()?.spPr,e=>{let n=t.model(),r=this._series.found(),i=n&&r?Gt(n,t.theme(),r.series.idx??0):`#000000`;return{fill:e?.fill,stroke:ks(e?.stroke,{width:1.5,lineCap:`round`,dash:`sysDot`,fill:Q(i)})}},e,_s)}getFit(){let e=this.resolved()?.fit;return e?{type:hc[e.type],coefficients:e.coefficients.slice(),rSquared:e.rSquared}:null}delete(e){this._check(),this._host.edit(gs,Ta(this._series.idx(),this._index),e)}edits(e){let r=this._check(),i=this._series.idx(),a=this._index,o=e=>{throw new t(n(`error.chart.notValidForType`,{type:e}))},s=[],c=r.trendlineType;if(e.type!==void 0&&(c=mc[e.type]??o(String(e.type)),s.push(((e,t,n)=>wa(e,t,e=>{if(e.trendlineType===n)return e;let t={...e,trendlineType:n};return t=q(t,`order`,n===`poly`?2:void 0),t=q(t,`period`,n===`movingAvg`?2:void 0),ba.includes(n)||(t=q(t,`intercept`,void 0)),t}))(i,a,c))),e.polynomialOrder!==void 0){let t=e.polynomialOrder;(!Number.isInteger(t)||t<2||t>6)&&o(`polynomialOrder`),s.push(((e,t,n)=>wa(e,t,e=>e.trendlineType===`poly`?q(e,`order`,n):e))(i,a,t))}if(e.movingAveragePeriod!==void 0){let t=e.movingAveragePeriod,n=this._series.resolved()?.values.length??0;(c!==`movingAvg`||!Number.isInteger(t)||t<2||t>=Math.max(3,n))&&o(`movingAveragePeriod`),s.push(((e,t,n)=>wa(e,t,e=>q(e,`period`,n)))(i,a,t))}if(e.forwardPeriod!==void 0&&((!Number.isFinite(e.forwardPeriod)||e.forwardPeriod<0)&&o(`forwardPeriod`),s.push(Ea(i,a,`forward`,e.forwardPeriod))),e.backwardPeriod!==void 0){let t=e.backwardPeriod;(!Number.isFinite(t)||t<0||this._onCategories()&&t>.5)&&o(`backwardPeriod`),s.push(Ea(i,a,`backward`,t))}if(e.intercept!==void 0&&(e.intercept===`auto`||Number.isFinite(e.intercept)||o(`intercept`),s.push(((e,t,n)=>wa(e,t,e=>n===`auto`?q(e,`intercept`,void 0):ba.includes(e.trendlineType)?q(e,`intercept`,n):e))(i,a,e.intercept))),e.showEquation!==void 0&&s.push(Da(i,a,`dispEq`,e.showEquation)),e.showRSquared!==void 0&&s.push(Da(i,a,`dispRSqr`,e.showRSquared)),e.name!==void 0&&s.push(((e,t,n)=>wa(e,t,e=>q(e,`name`,n??void 0)))(i,a,e.name)),e.style!==void 0){let t=e=>e;this._style(e=>(t=Oa(i,a,e),e=>e)).update(e.style),s.push(t)}return e.label!==void 0&&s.push(...this.getLabel().edits(e.label)),s}update(e,t){return this._host.edit(_s,K(this.edits(e)),t),this}index(){return this._index}series(){return this._series}},vc=class{constructor(e,t){this._host=e,this._trendline=t}getChart(){return this._host.chart()}getParent(){return this._trendline}getElementType(){return`trendlineLabel`}getPath(){return`${this._trendline.getPath()}/label`}get isITrendlineLabel(){return!0}getText(){let e=this._trendline.resolved()?.label;return e?e.lines.map(e=>e.map(e=>e.text).join(``)).join(`
27
+ `):null}getNumberFormat(){return this._trendline.model()?.trendlineLbl?.numFmt?.formatCode??`General`}setNumberFormat(e,t){return this.update({numberFormat:e},t)}edits(e){let t=[],n=this._trendline.series().idx();return e.numberFormat!==void 0&&t.push(((e,t,n)=>wa(e,t,e=>{let t=e.trendlineLbl??Sa(),r={formatCode:n??`General`,sourceLinked:!1};return t.numFmt?.formatCode===r.formatCode&&!1===t.numFmt.sourceLinked?e:{...e,trendlineLbl:{...t,numFmt:r}}}))(n,this._trendline.index(),e.numberFormat)),t}update(e,t){return this._host.edit(_s,K(this.edits(e)),t),this}},yc={fixedValue:`fixedVal`,percent:`percentage`,stDev:`stdDev`,stError:`stdErr`,custom:`cust`},bc={fixedVal:`fixedValue`,percentage:`percent`,stdDev:`stDev`,stdErr:`stError`,cust:`custom`},xc={both:`both`,minusValues:`minus`,plusValues:`plus`},Sc={both:`both`,minus:`minusValues`,plus:`plusValues`},Cc=(e,t)=>!e.is3D&&(e.type===`scatter`||e.type===`bubble`||t===`y`&&(e.type===`bar`||e.type===`line`||e.type===`area`||e.type===`stock`)),wc=class{constructor(e,t,n){this._host=e,this._series=t,this._direction=n,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._series}getElementType(){return`errorBars`}getPath(){return`${this._series.getPath()}/errorBars/${this._direction}`}get isIErrorBars(){return!0}_model(){return this._series.found()?.series.errBars?.find(e=>(e.errDir===`x`?`x`:`y`)===this._direction)??null}_check(){let e=this._series.found()?.group;if(!e||!Cc(e,this._direction))throw new t(n(`error.chart.notValidForType`,{type:this._series.getChartType()}));return this._series.idx()}getVisible(){return!!this._model()}setVisible(e,t){return this.update({visible:e},t)}getType(){return bc[this._model()?.errValType??`fixedVal`]}setType(e,t){return this.update({type:e},t)}getAmount(){let e=this._model();return e?e.errValType===`stdErr`||e.errValType===`cust`?null:e.val??null:null}setAmount(e,t){return this.update({amount:e},t)}getInclude(){return Sc[this._model()?.errBarType??`both`]}setInclude(e,t){return this.update({include:e},t)}getEndStyleCap(){return!0!==this._model()?.noEndCap}setEndStyleCap(e,t){return this.update({endStyleCap:e},t)}_formulaOf(e){let t=this._model();if(!t||t.errValType!==`cust`||!e)return null;let n=e.numRef??e.strRef;if(n){let e=de(this._host.model()).referenceSlots.get(n);return this._host.formula(e??null)??n.f}let r=e.numLit??e.strLit;return r?`{${(r.points??[]).map(e=>e.v).join(`,`)}}`:null}getPlusValuesFormula(){return this._formulaOf(this._model()?.plus)}getMinusValuesFormula(){return this._formulaOf(this._model()?.minus)}setCustomValues(e,t,n){return this.update({customValues:{plus:e,minus:t}},n)}getStyle(){return this._styleCache??=this._style(e=>Na(this._check(),this._direction,e))}_style(e){return $(this._host,()=>this._model()?.spPr,e=>({fill:e?.fill,stroke:ks(e?.stroke,{width:.75,lineCap:`butt`,fill:Q(`tx1 lumMod 65 lumOff 35`)})}),e,vs)}_source(e){let r=this._host.sheet();if(r)return es(e,`values`,r);if(typeof e!=`string`)return{numRef:{f:Xo(e)}};throw new t(n(`error.chart.noData`))}edits(e){let r=this._check(),i=this._direction,a=e=>{throw new t(n(`error.chart.notValidForType`,{type:e}))},o=[];if(!1===e.visible)return[ja(r,i,!1)];e.visible&&o.push(ja(r,i,!0));let s=this._model()?.errValType??`fixedVal`;if(e.type!==void 0&&(s=yc[e.type]??a(String(e.type)),o.push(Ma(r,i,s))),e.customValues!==void 0&&(s=`cust`,o.push(((e,t,n,r)=>Aa(e,t,e=>{let t={...e,errValType:`cust`,plus:n,minus:r};return t=q(t,`val`,void 0),t}))(r,i,this._source(e.customValues.plus),this._source(e.customValues.minus)))),e.amount!==void 0&&((s===`stdErr`||s===`cust`||!Number.isFinite(e.amount)||e.amount<0)&&a(`amount`),o.push(((e,t,n)=>Aa(e,t,e=>q(e,`val`,n)))(r,i,e.amount))),e.include!==void 0&&o.push(((e,t,n)=>Aa(e,t,e=>q(e,`errBarType`,n)))(r,i,xc[e.include]??a(String(e.include)))),e.endStyleCap!==void 0&&o.push(((e,t,n)=>Aa(e,t,e=>q(e,`noEndCap`,!n)))(r,i,e.endStyleCap)),e.style!==void 0){let t=e=>e;this._style(e=>(t=Na(r,i,e),e=>e)).update(e.style),o.push(t)}return o}update(e,t){return this._host.edit(vs,K(this.edits(e)),t),this}},Tc=e=>!e.is3D&&(e.type===`line`||e.type===`stock`),Ec=(e,t)=>{if(e.is3D)return!1;switch(t){case`hiLowLines`:return Tc(e);case`dropLines`:return Tc(e)||e.type===`area`;default:return e.type===`ofPie`||e.type===`bar`&&(e.grouping===`stacked`||e.grouping===`percentStacked`)}},Dc={hiLowLines:`hiLoLines`,dropLines:`dropLines`,serLines:`seriesLines`},Oc=class{constructor(e,t,n){this._host=e,this._group=t,this._kind=n,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._group}getElementType(){return Dc[this._kind]}getPath(){return`${this._group.getPath()}/${Dc[this._kind]}`}get isILines(){return!0}_model(){let e=this._group.found()?.group;return e?(this._kind===`serLines`?e.serLines?.[0]:e[this._kind])??null:null}_check(){let e=this._group.found()?.group;if(!e||!Ec(e,this._kind))throw new t(n(`error.chart.notValidForType`,{type:this._group.getChartType()}));return this._group.idx()}getVisible(){return!!this._model()}setVisible(e,t){return this.update({visible:e},t)}getStyle(){return this._styleCache??=this._style(e=>La(this._check(),this._kind,e))}_style(e){return $(this._host,()=>this._model()?.spPr,e=>({fill:e?.fill,stroke:ks(e?.stroke,{width:.75,lineCap:`butt`,fill:Q(Pa[this._kind])})}),e,Os[this._kind])}edits(e){let t=this._check();if(!1===e.visible)return[Ia(t,this._kind,!1)];let n=[];if(e.visible&&n.push(Ia(t,this._kind,!0)),e.style!==void 0){let r=e=>e;this._style(e=>(r=La(t,this._kind,e),e=>e)).update(e.style),n.push(r)}return n}update(e,t){return this._host.edit(Os[this._kind],K(this.edits(e)),t),this}},kc=class{constructor(e,t){this._host=e,this._group=t,this._upStyle=null,this._downStyle=null}getChart(){return this._host.chart()}getParent(){return this._group}getElementType(){return`upDownBars`}getPath(){return`${this._group.getPath()}/upDownBars`}get isIUpDownBars(){return!0}_model(){return this._group.found()?.group.upDownBars??null}_check(){let e=this._group.found()?.group;if(!e||!Tc(e))throw new t(n(`error.chart.notValidForType`,{type:this._group.getChartType()}));return this._group.idx()}getVisible(){return!!this._model()}setVisible(e,t){return this.update({visible:e},t)}getGapWidth(){return this._model()?.gapWidth??150}setGapWidth(e,t){return this.update({gapWidth:e},t)}getUpBarsStyle(){return this._upStyle??=this._style(`upBars`,e=>Va(this._check(),`upBars`,e))}getDownBarsStyle(){return this._downStyle??=this._style(`downBars`,e=>Va(this._check(),`downBars`,e))}_style(e,t){let[n,r]=e===`upBars`?[`lt1`,`tx1 lumMod 15 lumOff 85`]:[`dk1 lumMod 65 lumOff 35`,`tx1 lumMod 65 lumOff 35`];return $(this._host,()=>this._model()?.[e]?.spPr,e=>({fill:e?.fill??Q(n),stroke:ks(e?.stroke,{width:.75,fill:Q(r)})}),t,ys)}edits(e){let r=this._check();if(!1===e.visible)return[za(r,!1)];let i=[];if(e.visible&&i.push(za(r,!0)),e.gapWidth!==void 0){let a=e.gapWidth;if(!Number.isFinite(a)||a<0||a>500)throw new t(n(`error.chart.notValidForType`,{type:`gapWidth`}));i.push(Ba(r,Math.round(a)))}for(let t of[`upBars`,`downBars`]){let n=e[t];if(n===void 0)continue;let a=e=>e;this._style(t,e=>(a=Va(r,t,e),e=>e)).update(n),i.push(a)}return i}update(e,t){return this._host.edit(ys,K(this.edits(e)),t),this}},Ac=e=>{let t=[],n=0,r=!1,i=``;for(let a=0;a<e.length;a++){let o=e[a];r?(i+=o,o===`"`&&(e[a+1]===`"`?(i+=`"`,a++):r=!1)):o===`"`?(r=!0,i+=o):(o!==`(`&&o!==`{`||n++,o!==`)`&&o!==`}`||n--,o!==`,`||n!==0?i+=o:(t.push(i),i=``))}return t.push(i),t},jc=class{constructor(e,t,n){this._host=e,this._series=t,this._index=n,this._styleCache=null,this._marker=null,this._label=null}getChart(){return this._host.chart()}getParent(){return this._series}getElementType(){return`point`}getPath(){return`${this._series.getPath()}/points/${this._index}`}get isIPoint(){return!0}_point(){return this._series.found()?.series.points?.find(e=>e.idx===this._index)}getIndex(){return this._index}getStyle(){return this._styleCache??=this._style(e=>yo(this._series.idx(),this._index,e))}_style(e){let t=this._host;return $(t,()=>{let e=this._series.found(),t=this._point();if(e)return e.group.type===`line`||e.group.type===`scatter`||e.group.type===`radar`&&e.group.radarStyle!==`filled`?{fill:(t?.marker??e.series.marker)?.spPr?.fill,stroke:t?.spPr?.stroke??e.series.spPr?.stroke}:t?.spPr??e.series.spPr},e=>{let t=this._series.resolved(),n=t?.points?.[this._index];return{fill:e?.fill??n?.fill??t?.fill??void 0,stroke:e?.stroke??(t?.stroke?{width:t.stroke.width,fill:t.stroke.fill}:void 0)}},e,Ss)}getMarker(){return this._marker??=new Mc(this._host,this._series,this,this._index)}getExplosion(){return this._point()?.explosion??this._series.getExplosion()}setExplosion(e,t){return this.update({explosion:e},t)}getInvertIfNegative(){return this._point()?.invertIfNegative??this._series.getInvertIfNegative()}setInvertIfNegative(e,t){return this.update({invertIfNegative:e},t)}getIsTotal(){return this._series.found()?.group.type===`waterfall`&&!0===this._point()?.subtotal}setIsTotal(e,t){return this.update({isTotal:e},t)}getDataLabel(){return this._label??=new Nc(this._host,this._series,this,this._index)}getHasDataLabel(){return this.getDataLabel().getVisible()}setHasDataLabel(e,t){return this.update({hasDataLabel:e},t)}edits(e){let r=()=>this._series.idx(),i=this._series.found()?.group,a=()=>{throw new t(n(`error.chart.notValidForType`,{type:this._series.getChartType()}))},o=[];if(e.style!==void 0&&o.push(Ls(e=>this._style(e),e=>yo(r(),this._index,e),e.style)),e.marker!==void 0&&o.push(...this.getMarker().edits(e.marker)),e.explosion!==void 0){if(i?.type!==`pie`&&i?.type!==`doughnut`&&i?.type!==`ofPie`&&a(),!Number.isFinite(e.explosion)||e.explosion<0)throw new t(n(`error.chart.notValidForType`,{type:`explosion`}));o.push(((e,t,n)=>vo(e,t,e=>q(e,`explosion`,n>0?n:void 0)))(r(),this._index,Math.round(e.explosion)))}return e.invertIfNegative!==void 0&&(i?.type!==`bar`&&i?.type!==`bubble`&&a(),o.push(((e,t,n)=>vo(e,t,e=>q(e,`invertIfNegative`,n)))(r(),this._index,!!e.invertIfNegative))),e.isTotal!==void 0&&(i?.type!==`waterfall`&&a(),o.push(xo(this._series.key(),this._index,!!e.isTotal))),e.hasDataLabel!==void 0&&o.push(wo(r(),this._index,!!e.hasDataLabel)),e.dataLabel!==void 0&&o.push(...this.getDataLabel().edits(e.dataLabel)),o}update(e,t){let n=Object.keys(e).every(e=>e===`isTotal`);return this._host.edit(Ss,K(this.edits(e)),t,n),this}},Mc=class{constructor(e,t,n,r){this._host=e,this._series=t,this._point=n,this._index=r,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._point}getElementType(){return`marker`}getPath(){return`${this._point.getPath()}/marker`}get isIMarker(){return!0}_marker(){let e=this._series.found();return e?.series.points?.find(e=>e.idx===this._index)?.marker??e?.series.marker}_check(){let e=this._series.found()?.group;if(!e||!oc(e))throw new t(n(`error.chart.notValidForType`,{type:this._series.getChartType()}));return this._series.idx()}getSymbol(){let e=this._marker()?.symbol;return e===void 0?this._series.getMarker().getSymbol():e===`auto`||e===`picture`?`automatic`:e}setSymbol(e,t){return this.update({symbol:e},t)}getSize(){return this._marker()?.size??5}setSize(e,t){return this.update({size:e},t)}getStyle(){return this._styleCache??=this._style(e=>t=>bo(this._check(),this._index,{spPr:Ks(this._marker()?.spPr,e)??null})(t))}_style(e){let t=this._host;return $(t,()=>this._marker()?.spPr,e=>{let n=t.model(),r=this._series.found(),i=n&&r?Gt(n,t.theme(),r.series.idx??0):`#000000`;return{fill:e?.fill??Q(i),stroke:ks(e?.stroke,{width:.75,fill:Q(i)})}},e,Ss)}edits(e){let r=this._check(),i=[];if(e.symbol!==void 0){let a=rc[e.symbol];if(!a)throw new t(n(`error.chart.notValidForType`,{type:String(e.symbol)}));i.push(bo(r,this._index,{symbol:a}))}if(e.size!==void 0){if(!Number.isFinite(e.size)||e.size<2||e.size>72)throw new t(n(`error.chart.notValidForType`,{type:`size`}));i.push(bo(r,this._index,{size:Math.round(e.size)}))}return e.style!==void 0&&i.push(Ls(e=>this._style(e),e=>t=>bo(r,this._index,{spPr:Ks(this._marker()?.spPr,e)??null})(t),e.style)),i}update(e,t){return this._host.edit(Ss,K(this.edits(e)),t),this}},Nc=class{constructor(e,t,n,r){this._host=e,this._series=t,this._point=n,this._index=r,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._point}getElementType(){return`dataLabel`}getPath(){return`${this._point.getPath()}/dataLabel`}get isIDataLabel(){return!0}_label(){return this._series.found()?.series.dLbls?.labels?.find(e=>e.idx===this._index)}_options(){let e=this._series.found(),t=this._label();if(!e)return{};if(t?.delete)return{delete:!0};let n=e.series.dLbls;return n?.delete&&!t?{delete:!0}:{...e.group.dLbls,...zc(n),...zc(t)}}getVisible(){let e=this._options();return!e.delete&&ga(e)}setVisible(e,t){return this.update({visible:e},t)}getText(){let e=this._label()?.tx?.rich;return e?be(e):null}setText(e,t){return this.update({text:e},t)}getPosition(){let e=this._series.found(),t=this._options().dLblPos;return ic[e?Ut(e.group,t):t??`r`]}setPosition(e,t){return this.update({position:e},t)}_flag(e){let t=this._options();return!t.delete&&!0===t[e]}getShowValue(){return this._flag(`showVal`)}setShowValue(e,t){return this.update({showValue:e},t)}getShowCategoryName(){return this._flag(`showCatName`)}setShowCategoryName(e,t){return this.update({showCategoryName:e},t)}getShowSeriesName(){return this._flag(`showSerName`)}setShowSeriesName(e,t){return this.update({showSeriesName:e},t)}getShowPercentage(){return this._flag(`showPercent`)}setShowPercentage(e,t){return this.update({showPercentage:e},t)}getShowLegendKey(){return this._flag(`showLegendKey`)}setShowLegendKey(e,t){return this.update({showLegendKey:e},t)}getNumberFormat(){let e=this._options().numFmt;return e&&!e.sourceLinked?e.formatCode:null}setNumberFormat(e,t){return this.update({numberFormat:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>((e,t,n)=>Co(e,t,e=>X(Eo(e),n)))(this._series.idx(),this._index,e),new As(this._host,()=>Ga({txPr:this._options().txPr}),e=>((e,t,n)=>Co(e,t,e=>Wa(Eo(e),n,9)))(this._series.idx(),this._index,e),ms,{size:10,bold:!1}),ms)}_style(e){return $(this._host,()=>this._options().spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,ms)}edits(e){let r=this._series.idx(),i=this._index,a=this._series.found()?.group,o=e=>{throw new t(n(`error.chart.notValidForType`,{type:e}))},s=[];if(e.visible!==void 0&&s.push(wo(r,i,!!e.visible)),e.text!==void 0&&s.push(((e,t,n)=>r=>Co(e,t,e=>{let i=e.delete?So(t):e;if(n===null)return q(i,`tx`,void 0);let a={bodyPr:{},lstStyle:{},paragraphs:n.split(/\r?\n/).map(e=>({runs:[{text:e,...r.lang?{rPr:{language:r.lang}}:{}}]}))};return{...i,tx:{rich:a}}})(r))(r,i,e.text)),e.position!==void 0){let t=ac[e.position];(!t||a&&!(Ht(a)??[`ctr`]).includes(t))&&o(String(e.position)),s.push(((e,t,n)=>Co(e,t,e=>q(e.delete?So(t):e,`dLblPos`,n)))(r,i,t))}for(let[t,n]of[[`showValue`,`showVal`],[`showCategoryName`,`showCatName`],[`showSeriesName`,`showSerName`],[`showPercentage`,`showPercent`],[`showLegendKey`,`showLegendKey`]]){let c=e[t];c!==void 0&&(n!==`showPercent`||!c||a&&sc(a)||o(this._series.getChartType()),s.push(To(r,i,n,!!c)))}return e.numberFormat!==void 0&&s.push(((e,t,n)=>Co(e,t,e=>q(Eo(e),`numFmt`,n===null?void 0:{formatCode:n,sourceLinked:!1})))(r,i,e.numberFormat)),e.style!==void 0&&s.push(...this.getStyle().edits(e.style)),s}update(e,t){return this._host.edit(ms,K(this.edits(e)),t),this}},Pc=class{constructor(e){this._host=e,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`plotArea`}getPath(){return`plotArea`}get isIPlotArea(){return!0}getStyle(){return this._styleCache??=this._style(e=>Ya(e))}_style(e){return $(this._host,()=>this._host.model()?.chart?.plotArea?.spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,Cs)}_rect(e){return this._host.layout()?.plotArea[e]??{x:0,y:0,width:0,height:0}}getLeft(){return this._rect(`outer`).x}getTop(){return this._rect(`outer`).y}getWidth(){return this._rect(`outer`).width}getHeight(){return this._rect(`outer`).height}getInsideLeft(){return this._rect(`inner`).x}getInsideTop(){return this._rect(`inner`).y}getInsideWidth(){return this._rect(`inner`).width}getInsideHeight(){return this._rect(`inner`).height}edits(e){let t=[];return e.style!==void 0&&t.push(Ls(e=>this._style(e),e=>Ya(e),e.style)),t}update(e,t){return this._host.edit(Cs,K(this.edits(e)),t),this}},Fc=class{constructor(e){this._host=e,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`dataTable`}getPath(){return`dataTable`}get isIDataTable(){return!0}_table(){return this._host.model()?.chart?.plotArea?.dTable}getVisible(){return!!this._table()}setVisible(e,t){return this.update({visible:e},t)}getShowLegendKey(){return!1!==this._table()?.showKeys}setShowLegendKey(e,t){return this.update({showLegendKey:e},t)}getShowHorizontalBorder(){return!1!==this._table()?.showHorzBorder}setShowHorizontalBorder(e,t){return this.update({showHorizontalBorder:e},t)}getShowVerticalBorder(){return!1!==this._table()?.showVertBorder}setShowVerticalBorder(e,t){return this.update({showVerticalBorder:e},t)}getShowOutlineBorder(){return!1!==this._table()?.showOutline}setShowOutlineBorder(e,t){return this.update({showOutlineBorder:e},t)}getStyle(){return this._styleCache??=new js(this._host,e=>this._style(e),e=>(e=>t=>Xa(t,t=>{let n=e.stroke&&t.spPr?.stroke?{...t.spPr.stroke,...e.stroke}:e.stroke;return X(t,`stroke`in e?{...e,stroke:n}:e)}))(e),new As(this._host,()=>Ga(this._table()),e=>(e=>t=>Xa(t,t=>Wa(t,e,9)))(e),ws,{size:10,bold:!1}),ws)}_style(e){return $(this._host,()=>this._table()?.spPr,e=>({fill:e?.fill,stroke:ks(e?.stroke,{width:.75,fill:Q(`tx1 lumMod 15 lumOff 85`)})}),e,ws)}edits(e){let t=[];var n;e.visible!==void 0&&t.push((n=!!e.visible,e=>n?Xa(e,e=>e):Zi(e,e=>q(e,`dTable`,void 0))));for(let[n,r]of[[`showLegendKey`,`showKeys`],[`showHorizontalBorder`,`showHorzBorder`],[`showVerticalBorder`,`showVertBorder`],[`showOutlineBorder`,`showOutline`]]){let i=e[n];i!==void 0&&t.push(Za(r,!!i))}return e.style!==void 0&&t.push(...this.getStyle().edits(e.style)),t}update(e,t){return this._host.edit(ws,K(this.edits(e)),t),this}},Ic=class{constructor(e,t){this._host=e,this._index=t,this._upDownBars=null,this._lines=new Map}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`chartGroup`}getPath(){return`groups/${this._index}`}get isIChartGroup(){return!0}_group(){return this._host.model()?.chart?.plotArea?.groups[this._index]}_first(){return this.getSeries()[0]??null}found(){return this._first()?.found()??null}idx(){let e=this._first();if(!e)throw new t(n(`error.chart.noData`));return e.idx()}getUpDownBars(){return this._upDownBars??=new kc(this._host,this)}getHiLoLines(){return Ns(this._lines,`hiLowLines`,()=>new Oc(this._host,this,`hiLowLines`))}getDropLines(){return Ns(this._lines,`dropLines`,()=>new Oc(this._host,this,`dropLines`))}getSeriesLines(){return Ns(this._lines,`serLines`,()=>new Oc(this._host,this,`serLines`))}getIndex(){return this._index}getChartType(){let e=this.getSeries()[0];return e?e.getChartType():`unknown`}getAxisGroup(){let e=this._host.model()?.chart?.plotArea,t=this._group();return e&&t?at(e,t)??`primary`:`primary`}getSeries(){return(this._host.facts()?.series??[]).filter(e=>e.group===this._index).map(e=>this._host.seriesPart(e.key)).filter(e=>!!e)}getGapWidth(){let e=this._group();return e?e.type===`bar`||e.type===`ofPie`?e.gapWidth??150:e.upDownBars?e.upDownBars.gapWidth??150:null:null}getOverlap(){let e=this._group();return e?.type===`bar`?e.overlap??(e.grouping===`stacked`||e.grouping===`percentStacked`?100:0):null}getVaryByCategories(){return this._group()?.varyColors??!1}setVaryByCategories(e,r){let i=this.getSeries()[0];if(!i)throw new t(n(`error.chart.noData`));return i.setVaryByCategories(e,r),this}},Lc=class{constructor(e,t){this._host=e,this._all=t,this._styleCache=null}getChart(){return this._host.chart()}getParent(){return this._host.chartArea()}getElementType(){return`dataLabels`}getPath(){return`dataLabels`}get isIDataLabels(){return!0}_first(){return this._all()[0]?.getDataLabels()??null}getVisible(){return this._first()?.getVisible()??!1}setVisible(e,t){return this.update({visible:e},t)}getShowValue(){return this._first()?.getShowValue()??!1}setShowValue(e,t){return this.update({showValue:e},t)}getShowCategoryName(){return this._first()?.getShowCategoryName()??!1}setShowCategoryName(e,t){return this.update({showCategoryName:e},t)}getShowSeriesName(){return this._first()?.getShowSeriesName()??!1}setShowSeriesName(e,t){return this.update({showSeriesName:e},t)}getShowPercentage(){return this._first()?.getShowPercentage()??!1}setShowPercentage(e,t){return this.update({showPercentage:e},t)}getPosition(){return this._first()?.getPosition()??`right`}setPosition(e,t){return this.update({position:e},t)}getSeparator(){return this._first()?.getSeparator()??`, `}setSeparator(e,t){return this.update({separator:e},t)}getNumberFormat(){return this._first()?.getNumberFormat()??null}setNumberFormat(e,t){return this.update({numberFormat:e},t)}getLinkNumberFormat(){return this._first()?.getLinkNumberFormat()??!0}setLinkNumberFormat(e,t){return this.update({linkNumberFormat:e},t)}getShowLegendKey(){return this._first()?.getShowLegendKey()??!1}setShowLegendKey(e,t){return this.update({showLegendKey:e},t)}getShowBubbleSize(){return this._first()?.getShowBubbleSize()??!1}setShowBubbleSize(e,t){return this.update({showBubbleSize:e},t)}getValueFromCellsFormula(){return this._first()?.getValueFromCellsFormula()??null}setValueFromCells(e,t){return this.update({valueFromCells:e},t)}getTextOrientation(){return this._first()?.getTextOrientation()??0}setTextOrientation(e,t){return this.update({textOrientation:e},t)}_stated(){let e=this._all()[0];return e?e.getDataLabels().stated():void 0}getStyle(){return this._styleCache??=new js(this._host,e=>$(this._host,()=>this._stated()?.spPr,e=>({fill:e?.fill,stroke:e?.stroke}),e,ms),e=>K(this._all().map(t=>Do(t.idx(),e))),new As(this._host,()=>Ga({txPr:this._stated()?.txPr}),e=>K(this._all().map(t=>Oo(t.idx(),e))),ms,{size:10,bold:!1}),ms)}edits(e){return this._all().flatMap(t=>t.getDataLabels().edits(e,!0))}update(e,t){return this._host.edit(ms,K(this.edits(e)),t),this}},Rc=(e,t)=>{let[n,r,i,a]=t.type===`scatter`||t.type===`bubble`?[`cat`,`val`,`xVal`,`yVal`]:[`xVal`,`yVal`,`cat`,`val`];if(e[n]===void 0&&e[r]===void 0)return e;let o={...e};return o[n]!==void 0&&(o[i]=o[n]),o[r]!==void 0&&(o[a]=o[r]),delete o[n],delete o[r],o},zc=e=>{let t={};for(let[n,r]of Object.entries(e??{}))r!==void 0&&(t[n]=r);return t},Bc=class i extends r{constructor(e){super(e),this._part=null,this._readSource=null,this._read=null,this._partModel=null,this._series=null,this._parts=null,this._held=null,this._heldModel=null,this._heldBefore=new WeakMap,this._layoutListeners=0,this._layoutSources=null,this._dataListeners=new Map,this._sheetListeners=new Map,this._layoutQueued=!1,this._getStyles=e.getStyles??null,this._canHold=!!e.addWatch,e.json&&(this._part=C.fromJSON(e.json.part,e.fromResourceId),this._updateState({data:e.json}),this._partModel=e.json.model??null),this._syncHolds()}_syncHolds(){if(!this._canHold)return;let e=this._getModel();if(e===this._heldModel)return;if(this._held&&this._heldModel){for(let e of this._held)e.remove();this._heldBefore.set(this._heldModel,this._held)}this._heldModel=e;let t=e?this._heldBefore.get(e):void 0,n=this._getFacts()?.slots??null;this._held=n?.map((e,n)=>{let r=t?.[n]??{formula:null,wired:null,remove:()=>{}};return r.remove=this._addWatch(r.formula??e.text,e=>{r.formula=e.formula,r.wired??=e.formula.getExpression()}),r})??null}getType(){return`chart`}_getModel(){return this._getState()?.data?.model??null}_getRead(){let e=this._getModel();return e!==this._readSource&&(this._readSource=e,this._read=e?(e=>{let t=de(e),n=new Se(t.referenceSlots),r=e.chart?.plotArea,i=r?.groups??[],a=r?.axes??[],o=a.length>0?a[0].axId:null,s=[],c=0;for(let e=0;e<i.length;e++){let t=i[e],r=t.axIds.length>1&&o!==null&&!t.axIds.includes(o);for(let i of t.series){let a=i.idx===void 0?`#${c}`:String(i.idx);c++,s.push({order:Number.isFinite(i.order)?i.order:s.length,facts:{key:a,type:_e(t,i),name:n.text(i.tx),values:n.source(i.val??i.yVal??(fe.has(t.type)?void 0:i.bubbleSize)),categories:n.source(i.cat??i.xVal),sizes:n.source(fe.has(t.type)?i.bubbleSize:void 0),secondary:r,group:e}}),i.cumulativeLine&&s.push({order:s.length,facts:{key:`${a}-line`,type:`paretoLine`,name:n.text(i.cumulativeLine.tx),values:se,categories:se,sizes:se,secondary:!1,group:e}})}}return s.sort((e,t)=>e.order-t.order),{facts:{type:ve(i),title:n.text(e.chart?.title?.tx),series:s.map(e=>e.facts),axes:a.map(e=>({axId:e.axId,deleted:!0===e.delete,kind:ce[e.type],title:n.text(e.title?.tx),numberFormat:e.numFmt?.formatCode??null})),pivotSource:e.pivotSource?.name||null,slots:t.slots},slots:t}})(e):null,this._series=null),this._read}_getFacts(){return this._getRead()?.facts??null}_movedAt(e){let t=this._held?.[e],n=t?.formula?.getExpression()??null;return n!==null&&n!==t.wired?n:null}_formulaAt(e){return e===null?null:this._movedAt(e)??this._getFacts()?.slots[e]?.text??null}_formulaOf(e){return e.slot===null?e.literal:this._formulaAt(e.slot)}_rangeAt(e){let t=this._formulaAt(e);if(!t||!w(t))return null;try{return this._resolveRange(t)}catch{return null}}_textOf(e){if(e.slot===null)return e.text;let t=this._rangeAt(e.slot);if(t?.isSingleCell())try{return t.getCell().getText(Gc)||null}catch{}return e.text}getChartTitle(){let e=this._getFacts();if(e)return this._textOf(e.title);let t=this._getState()?.data?.title?.text?.runs;if(!Array.isArray(t))return null;let n=``;for(let e=0;e<t.length;e++)typeof t[e]?.text==`string`&&(n+=t[e].text);return n||null}getChartType(){let e=this._getFacts();return e?e.type:(this._getState()?.data)?.types?.[0]?.type??`unknown`}_getParts(){if(this._parts)return this._parts;let e={chart:()=>this,chartArea:()=>this._getParts().chartArea,group:t=>{let n=this._getParts().groups,r=n.get(t);return r||n.set(t,r=new Ic(e,t)),r},model:()=>this._getModel(),facts:()=>this._getFacts(),edit:(e,t,n,r)=>this._editModel(e,t,n,r),resolved:()=>this._resolve(),layout:()=>this._getLayout()??this._getLayout(Hc),theme:()=>Et(this._styles()),styles:()=>this._getStyles?.()??null,movable:()=>this.getMovable(),sheet:()=>this.getMovable()?.getRange().getWorksheet()??null,text:e=>this._textOf(e),formula:e=>this._formulaAt(e),formulaOf:e=>this._formulaOf(e),range:e=>this._rangeAt(e),seriesPart:e=>(this.getSeries(),this._parts?.series.get(e)??null)};return this._parts={host:e,chartArea:new Fs(e),title:new Is(e),legend:new Bs(e),axes:new Js(e),series:new Map,groups:new Map,plotArea:new Pc(e),dataTable:new Fc(e),labels:new Lc(e,()=>this._seriesParts())}}_seriesParts(){return this.getSeries()}setChartType(t,n){return this._editModel(e(`op.setChartType`),this._chartTypeEdit(t),n,!0),this}_chartTypeEdit(e){let r=new Map;for(let e of this._resolve()?.groups??[])for(let t of e.series)r.set(t.idx,t.values.length);let i=Wo(e);if(i)return K([Ka(`columnClustered`,r),qa(i)]);let a=Go(e);if(oi(a))throw new t(n(`error.chart.notValidForType`,{type:String(e)}));return Ka(a,r)}addSeries(r,i,a){let o=this._getModel();if(!o)throw new t(n(`error.chart.noData`));let s;if(typeof r==`string`&&r!==``?s=r.startsWith(`=`)&&r.length>1?{strRef:{f:r.slice(1)}}:{v:r}:r&&typeof r==`object`&&(s={strRef:{f:Xo(r)}}),i!==void 0&&(!Number.isInteger(i)||i<0))throw new t(n(`error.chart.notValidForType`,{type:`index`}));let c=o.chart.plotArea.groups.flatMap(e=>e.series).map(e=>e.idx??-1);this._editModel(e(`op.addSeries`),mo({tx:s,count:0},i),a);let l=(this._getModel()?.chart.plotArea.groups.flatMap(e=>e.series).map(e=>e.idx??-1)??[]).find(e=>!c.includes(e)),u=l===void 0?null:this._getParts().host.seriesPart(String(l));if(!u)throw new t(n(`error.chart.noData`));return u}getGroups(){let e=this._getModel()?.chart?.plotArea?.groups?.length??0,t=this._getParts();for(let n of t.groups.keys())n>=e&&t.groups.delete(n);let n=[];for(let r=0;r<e;r++)n.push(t.host.group(r));return n}setSeriesBy(r,i){if(r!==`rows`&&r!==`columns`)throw new t(n(`error.chart.notValidForType`,{type:String(r)}));let a=null;for(let e of this.getSeries())for(let r of[e.getNameRange(),e.getCategoriesRange(),e.getValuesRange()])if(r){if(a){if(a.getWorksheet()!==r.getWorksheet())throw new t(n(`error.chart.noData`));a=a.getUnion(r)}else a=r}if(!a)throw new t(n(`error.chart.noData`));return this.setData(a,r,{...i,description:e(`op.setChartPlotBy`)})}getPlotVisibleOnly(){return!1!==this._getModel()?.chart?.plotVisOnly}setPlotVisibleOnly(t,n){return this._editModel(e(`op.setChartPlotVisibleOnly`),Ja(!!t),n),this}getDataLabels(){return this._getParts().labels}getPlotArea(){return this._getParts().plotArea}getElementAt(e,t){if(!e||typeof e.x!=`number`||typeof e.y!=`number`)return null;let n=this._layoutFor(t);if(!n)return null;let r=function(e,t,n){if(!H({x:0,y:0,width:e.width,height:e.height},t))return null;if(H(e.title?.rect,t))return`title`;let r=e.legend;if(r&&H(r.rect,t)){for(let e=r.entries.length-1;e>=0;e--)if(H(r.entries[e].rect,t))return n.legendEntries.get(e)??`legend`;return`legend`}let i=e.groups,a=[];for(let e=i.length-1;e>=0;e--)for(let t=i[e].series.length-1;t>=0;t--){let r=i[e].series[t],o=n.series.get(r.id);o&&a.push({series:r,path:o})}for(let{series:e,path:n}of a){let r=e.labels;if(r){for(let e=r.length-1;e>=0;e--)if(H(r[e]?.rect,t))return`${n}/points/${e}/dataLabel`}let i=e.trendlines?.findIndex(e=>H(e.label?.rect,t))??-1;if(i!==-1)return`${n}/trendlines/${i}/label`}for(let{series:e,path:n}of a){let r=e.trendlines?.findIndex(e=>Wr(t,e.paths))??-1;if(r!==-1)return`${n}/trendlines/${r}`;let i=e.errorBars?.find(e=>Wr(t,e.paths));if(i)return`${n}/errorBars/${i.direction}`}for(let e=i.length-1;e>=0;e--){let r=Qr(i[e],t,n);if(r)return r}for(let e=i.length-1;e>=0;e--){let r=n.groups.get(e);if(r){for(let n of Yr(i[e]))if(n.rects?.some(e=>H(ln(e,3),t))||n.segments&&Gr(t,n.segments))return`${r}/${n.name}`}}for(let e of i){if(e.type===`funnel`){let r=n.axes.get(e.axisIds[0]);if(r&&e.categoryLabels.some(e=>H(e?.rect,t))||r&&e.axisLine&&Gr(t,[e.axisLine]))return r}if(e.type===`radar`){let r=n.axes.get(e.axisIds[0]),i=n.axes.get(e.axisIds[1]);if(r&&e.categoryLabels.some(e=>H(e?.rect,t)))return r;if(i&&e.valueLabels.some(e=>H(e.rect,t)))return i;if(r&&Gr(t,e.spokes))return r;if(i&&e.rings.some(e=>mn(t,e,3,!0)))return`${i}/majorGridlines`}}let o=e.axes.filter(e=>!e.deleted);for(let e of o){let r=n.axes.get(e.id);if(r&&H(e.title?.rect,t))return`${r}/title`}for(let r of o){let i=n.axes.get(r.id);if(i&&H(Xr(r,e.plotArea),t))return i}for(let e of o){let r=n.axes.get(e.id);if(r&&e.gridlines&&Gr(t,e.gridlines))return`${r}/majorGridlines`}return H(e.plotArea.outer,t)?`plotArea`:`chartArea`}(n,e,this._hitNames(n));for(;r;){let e=this.getElement(r);if(e)return e;let t=r.lastIndexOf(`/`);r=t===-1?null:r.slice(0,t)}return null}getElementBounds(e,t){let n=typeof e==`string`?e:e?.getPath?.();if(typeof n!=`string`)return null;let r=this._layoutFor(t);return r?function(e,t,n){let[r,...i]=t.split(`/`),a=e=>e!==void 0&&/^\d+$/.test(e)?Number(e):-1;switch(r){case`chartArea`:return i.length?null:{x:0,y:0,width:e.width,height:e.height};case`title`:return i.length?null:e.title?.rect??null;case`plotArea`:return i.length?null:e.plotArea.outer;case`dataTable`:default:return null;case`dataLabels`:return i.length?null:dn(e.groups.flatMap(e=>e.series.flatMap(e=>(e.labels??[]).map(e=>e?.rect))));case`legend`:{if(i.length===0)return e.legend?.rect??null;let r=$r(n.legendEntries).get(t);return r===void 0?null:e.legend?.entries[r]?.rect??null}case`axes`:{let[t,r,a,...o]=i;if(o.length)return null;let s=`axes/${t}/${r}`,c=$r(n.axes).get(s),l=c===void 0?void 0:e.axes.find(e=>e.id===c);if(!l)return null;if(a===`title`)return l.title?.rect??null;let u=e.groups.find(e=>e.type===`radar`);if(a===`majorGridlines`)return u&&u.axisIds[1]===l.id?Kr(u.rings.flat()):l.gridlines?qr(l.gridlines):null;if(a!==void 0)return null;if(!l.deleted)return Xr(l,e.plotArea);let d=e.groups.find(e=>e.type===`funnel`);return d&&d.axisIds[0]===l.id?dn([...d.categoryLabels.map(e=>e?.rect),d.axisLine?qr([d.axisLine]):null]):u&&u.axisIds[0]===l.id?dn([...u.categoryLabels.map(e=>e?.rect),qr(u.spokes)]):u&&u.axisIds[1]===l.id?dn(u.valueLabels.map(e=>e.rect)):null}case`series`:{let[t,r,o,s,...c]=i;if(t===void 0||c.length)return null;let l=((e,t)=>{if(t===void 0)return null;for(let n of e.groups){let e=n.series.findIndex(e=>e.id===t);if(e!==-1)return{group:n,s:e}}return null})(e,$r(n.series).get(`series/${t}`));if(!l)return null;let{group:u,s:d}=l,f=u.series[d];if(r===void 0||r===`marker`&&o===void 0)return Zr(u,d);if(r===`dataLabels`)return o===void 0?dn((f.labels??[]).map(e=>e?.rect)):null;if(r===`errorBars`){let e=f.errorBars?.find(e=>e.direction===o);return e&&s===void 0?Jr(e.paths):null}if(r===`trendlines`){let e=f.trendlines?.[a(o)];return e?s===void 0?Jr(e.paths):s===`label`?e.label?.rect??null:null:null}if(r!==`points`)return null;let p=a(o);return p<0?null:s===void 0||s===`marker`?Ur(u)?.pointBounds?.(u,d,p)??null:s===`dataLabel`?f.labels?.[p]?.rect??null:null}case`groups`:{let[t,r,...a]=i;if(a.length)return null;let o=$r(n.groups).get(`groups/${t}`),s=o===void 0?void 0:e.groups[o];if(!s)return null;if(r===void 0)return dn(s.series.map((e,t)=>Zr(s,t)));let c=Yr(s).find(e=>e.name===r);return c?c.rects?dn(c.rects):qr(c.segments??[]):null}}}(r,n,this._hitNames(r)):null}static{this._hitNamesOf=new WeakMap}_layoutFor(e){return e&&`groups`in e?e:this._getLayout(e)}_hitNames(e){let t=i._hitNamesOf.get(e);if(t)return t;let n=this._nameHits();return i._hitNamesOf.set(e,n),n}_nameHits(){let e=this._getParts(),t=new Map;for(let e of this._seriesParts())t.set(`s${e.key()}`,e.getPath());let n=new Map;for(let t of e.axes.getItems())n.set(t.axId(),t.getPath());let r=new Map,i=this._resolve();i&&Hr(i).forEach((e,t)=>r.set(t,`groups/${i.groups.indexOf(e)}`));let a=new Map,o=new Set((this._getModel()?.chart?.legend?.entries??[]).filter(e=>e.delete).map(e=>e.idx)),s=e.legend.entryTexts().length;for(let e=0,t=0;e<s;e++)o.has(e)||a.set(t++,`legend/entries/${e}`);return{series:t,axes:n,groups:r,legendEntries:a}}getDataTable(){return this._getParts().dataTable}getChartArea(){return this._getParts().chartArea}getStyle(){return this._getParts().chartArea.getStyle()}getChartStyle(){return this._getModel()?.style??2}getRoundedCorners(){return this._getParts().chartArea.getRoundedCorners()}setRoundedCorners(e,t){return this._getParts().chartArea.setRoundedCorners(e,t),this}getElement(e){if(typeof e!=`string`)return null;let t=this._getParts(),[n,...r]=e.split(`/`),i=e=>e!==void 0&&/^\d+$/.test(e)?Number(e):-1,a=e=>r.length===0?e:null;switch(n){case`chartArea`:return a(t.chartArea);case`title`:return a(t.title);case`plotArea`:return a(t.plotArea);case`dataTable`:return a(t.dataTable);case`dataLabels`:return a(t.labels);case`legend`:return r.length===0?t.legend:r.length===2&&r[0]===`entries`?t.legend.entry(i(r[1])):null;case`axes`:{let[e,n,i,...a]=r;if(e!==`primary`&&e!==`secondary`||n!==`category`&&n!==`value`&&n!==`series`||a.length)return null;let o=t.axes.getChartAxis(n,e);return o&&i!==void 0?i===`title`?o.getTitle():i===`majorGridlines`?o.getMajorGridlines():i===`minorGridlines`?o.getMinorGridlines():null:o}case`series`:{let[e,t,n,a,...o]=r;if(e===void 0||o.length)return null;let s=this._seriesParts().find(t=>t.key()===e);if(!s||t===void 0)return s??null;if(t===`marker`||t===`dataLabels`)return n===void 0?t===`marker`?s.getMarker():s.getDataLabels():null;if(t===`errorBars`)return a===void 0?n===`x`?s.getXErrorBars():n===`y`?s.getYErrorBars():null:null;if(t===`trendlines`){let e=s.getChartTrendline(i(n));return e&&a!==void 0?a===`label`?e.getLabel():null:e}if(t!==`points`)return null;let c=s.point(i(n));return c&&a!==void 0?a===`marker`?c.getMarker():a===`dataLabel`?c.getDataLabel():null:c}case`groups`:{let[e,n,...a]=r,o=i(e);if(o<0||o>=(this._getModel()?.chart?.plotArea?.groups?.length??0)||a.length)return null;let s=t.host.group(o);switch(n){case void 0:return s;case`upDownBars`:return s.getUpDownBars();case`hiLoLines`:return s.getHiLoLines();case`dropLines`:return s.getDropLines();case`seriesLines`:return s.getSeriesLines();default:return null}}default:return null}}getElements(){let e=this._getParts(),t=[e.chartArea];e.title.getVisible()&&t.push(e.title),e.legend.getVisible()&&t.push(e.legend),t.push(e.plotArea);for(let n of e.axes.getItems())t.push(n),n.getTitle().getVisible()&&t.push(n.getTitle()),n.getMajorGridlines().getVisible()&&t.push(n.getMajorGridlines()),n.getMinorGridlines().getVisible()&&t.push(n.getMinorGridlines());for(let e of this._seriesParts())t.push(e),e.getDataLabels().getVisible()&&t.push(e.getDataLabels()),t.push(...e.getTrendlines()),e.getXErrorBars().getVisible()&&t.push(e.getXErrorBars()),e.getYErrorBars().getVisible()&&t.push(e.getYErrorBars());for(let e of this.getGroups())for(let n of[e.getUpDownBars(),e.getHiLoLines(),e.getDropLines(),e.getSeriesLines()])n.getVisible()&&t.push(n);return e.dataTable.getVisible()&&t.push(e.dataTable),t}setElement(r,i){let a=this._getParts(),o=((e,r)=>{let i=()=>{throw new t(n(`error.chart.notValidForType`,{type:String(r)}))},a=(t,n)=>e.axes.getChartAxis(t,n)??i(),o=t=>e.series().flatMap(t),s=t=>{let n=new Set,r=[];for(let i of e.series()){let e=i.found();e&&!n.has(e.group)&&(n.add(e.group),t(e.group)&&r.push(i))}return r},c;if(r===`chartTitleNone`)return e.title.edits({visible:!1});if(r===`chartTitleCenteredOverlay`)return e.title.edits({visible:!0,overlay:!0});if(r===`chartTitleAboveChart`)return e.title.edits({visible:!0,overlay:!1});if(r===`legendNone`)return e.legend.edits({visible:!1});if(c=/^legend(Right|Top|Left|Bottom)(Overlay)?$/.exec(r))return e.legend.edits({position:c[1].toLowerCase(),overlay:!!c[2]});if(r===`dataLabelNone`)return o(e=>e.getDataLabels().edits({visible:!1},!0));if(r===`dataLabelShow`)return o(e=>[...e.getDataLabels().edits({visible:!0},!0),va(e.idx(),{showVal:!0})]);if(r===`dataLabelCallout`)return i();if(c=/^dataLabel(Center|InsideEnd|InsideBase|OutsideEnd|Left|Right|Top|Bottom|BestFit)$/.exec(r)){let e=c[1][0].toLowerCase()+c[1].slice(1);return o(t=>[...t.getDataLabels().edits({visible:!0,position:e},!0),va(t.idx(),{showVal:!0,dLblPos:ac[e]})])}if(c=/^(primary|secondary|series)(Category|Value)?AxisTitle(None|AdjacentToAxis|BelowAxis|Rotated|Vertical|Horizontal)$/.exec(r)){if(c[1]===`series`)return i();let e=c[2]===`Category`?`category`:`value`,t=a(e,c[1]).getTitle();if(c[3]===`None`)return t.edits({visible:!1});let n=c[3]===`Rotated`?90:c[3]===`Vertical`?`vertical`:c[3]===`Horizontal`?0:e===`value`?90:0;return t.edits({visible:!0,textOrientation:n})}if(c=/^(primary|secondary|series)(Category|Value)?(?:Axis)?GridLines(None|Minor|Major|MinorMajor)$/.exec(r)){if(c[1]===`series`)return i();let e=a(c[2]===`Category`?`category`:`value`,c[1]),t=c[3];return e.edits({...t===`None`?{majorGridlines:!1,minorGridlines:!1}:{},...t===`Minor`?{minorGridlines:!0}:{},...t===`Major`?{majorGridlines:!0}:{},...t===`MinorMajor`?{majorGridlines:!0,minorGridlines:!0}:{}})}if(c=/^(primary|secondary|series)(Category|Value)?Axis(None|Show|WithoutLabels|WithoutLabeling|Reverse|Thousands|Millions|Billions|LogScale)$/.exec(r)){if(c[1]===`series`)return i();let e=c[2]===`Category`?`category`:`value`,t=a(e,c[1]);switch(c[3]){case`None`:return t.edits({visible:!1});case`Show`:return t.edits({visible:!0,majorTickMark:`outside`});case`WithoutLabels`:case`WithoutLabeling`:return t.edits({visible:!0,tickLabelPosition:`none`,...c[1]===`secondary`&&e===`category`?{majorTickMark:`none`}:{}});case`Reverse`:return t.edits({visible:!0,reversePlotOrder:!0,majorTickMark:`outside`});case`LogScale`:return t.edits({scaleType:`logarithmic`});default:return t.edits({displayUnit:c[3].toLowerCase()})}}if(r===`dataTableNone`)return e.dataTable.edits({visible:!1});if(r===`dataTableShow`)return e.dataTable.edits({visible:!0,showLegendKey:!1});if(r===`dataTableWithLegendKeys`)return e.dataTable.edits({visible:!0,showLegendKey:!0});if(r===`trendlineNone`)return o(e=>(e.found()?.series.trendlines??[]).map((t,n)=>Ta(e.idx(),0)).slice(0,1).concat((e.found()?.series.trendlines??[]).slice(1).map(()=>Ta(e.idx(),0))));if(c=/^trendlineAdd(Linear|Exponential|LinearForecast|TwoPeriodMovingAverage)$/.exec(r)){let e=c[1],t=e===`Exponential`?`exp`:e===`TwoPeriodMovingAverage`?`movingAvg`:`linear`;return o(n=>{let r=n.found();if(!r||!gc(r.group))return[];let i=n.idx(),a=r.series.trendlines?.length??0,o=[Ca(i,xa(t,_i(i)))];return e===`LinearForecast`&&o.push(Ea(i,a,`forward`,2)),o})}if(r===`errorBarNone`)return o(e=>[ja(e.idx(),`y`,!1)]);if(c=/^errorBar(StandardError|Percentage|StandardDeviation)$/.exec(r)){let e=c[1]===`StandardError`?`stdErr`:c[1]===`Percentage`?`percentage`:`stdDev`;return o(t=>{let n=t.found();return n&&Cc(n.group,`y`)?[ja(t.idx(),`y`,!0),Ma(t.idx(),`y`,e)]:[]})}if(r===`lineNone`){let e=[`hiLowLines`,`dropLines`,`serLines`].flatMap(e=>s(t=>Ec(t,e)).map(t=>Ia(t.idx(),e,!1)));return e.length?e:i()}if(r===`lineDropHiLoLine`)return i();if(c=/^line(DropLine|HiLoLine|SeriesLine)$/.exec(r)){let e=c[1]===`DropLine`?`dropLines`:c[1]===`HiLoLine`?`hiLowLines`:`serLines`,t=s(t=>Ec(t,e));return t.length===0?i():t.map(t=>Ia(t.idx(),e,!0))}if(r===`upDownBarsNone`||r===`upDownBarsShow`){let e=s(Tc);return e.length===0?i():e.map(e=>za(e.idx(),r===`upDownBarsShow`))}return r===`plotAreaNone`?e.plotArea.edits({style:{fill:{type:`none`},stroke:{fill:{type:`none`}}}}):r===`plotAreaShow`?[]:i()})({host:a.host,title:a.title,legend:a.legend,axes:a.axes,series:()=>this._seriesParts(),plotArea:a.plotArea,dataTable:a.dataTable},r);return this._editModel(e(`op.setChartElement`),K(o),i),this}addChartSeries(e,t,n){return this.addSeries(e,t,n)}getChartGroups(){return this.getGroups()}getSeries(){let e=this._getFacts();if(!e)return Vc;if(!this._series){let t=this._getParts(),n=new Set(e.series.map(e=>e.key));for(let e of t.series.keys())n.has(e)||t.series.delete(e);this._series=Object.freeze(e.series.map(e=>{let n=t.series.get(e.key);return n||t.series.set(e.key,n=new dc(t.host,e.key)),n}))}return this._series}getAxes(){return this._getParts().axes}getTitle(){return this._getParts().title}getLegend(){return this._getParts().legend}getSeriesBy(){let e=this.getSeries()[0],t=e?.getValuesRange()?.getCoords();if(t){let n=t.rowEnd-t.rowStart+1,r=t.colEnd-t.colStart+1;if(n>1&&r===1)return`columns`;if(r>1&&n===1)return`rows`;let i=e.getNameRange()?.getCoords();if(i&&i.rowStart===t.rowStart&&i.colStart<t.colStart)return`rows`}return`columns`}getDisplayBlanksAs(){return Uc[this._getModel()?.chart?.dispBlanksAs??`gap`]}setDisplayBlanksAs(t,n){return this._editModel(e(`op.setChartBlanks`),this._blanksEdit(t),n),this}_blanksEdit(e){let r=Wc[e];if(!r)throw new t(n(`error.chart.notValidForType`,{type:String(e)}));return(e=>t=>Xi(t,t=>q(t,`dispBlanksAs`,e)))(r)}update(t,n){let r=this._getParts(),i=[];if(t.title!==void 0){let e=t.title;i.push(...r.title.edits(typeof e==`object`&&e?e:{text:e}))}t.legend!==void 0&&i.push(...r.legend.edits(t.legend));let a=Object.keys(t).every(e=>e===`title`||e===`legend`);if(t.displayBlanksAs!==void 0&&i.push(this._blanksEdit(t.displayBlanksAs)),t.valueAxis!==void 0){let e=r.axes.getValueAxis();e&&i.push(...e.edits(t.valueAxis))}if(t.categoryAxis!==void 0){let e=r.axes.getCategoryAxis();e&&i.push(...e.edits(t.categoryAxis))}if(t.chartType!==void 0&&i.unshift(this._chartTypeEdit(t.chartType)),t.plotVisibleOnly!==void 0&&i.push(Ja(!!t.plotVisibleOnly)),i.push(...r.chartArea.edits({roundedCorners:t.roundedCorners,style:t.style})),t.plotArea!==void 0&&i.push(...r.plotArea.edits(t.plotArea)),t.dataTable!==void 0&&i.push(...r.dataTable.edits(t.dataTable)),t.dataLabels!==void 0)for(let e of this._seriesParts())i.push(...e.getDataLabels().edits(t.dataLabels));return this._editModel(e(`op.updateChart`),K(i),n,a),this}_editModel(e,r,i,a){this._protectionCheck(e);let o=this._getState()?.data,s=this._getModel(),c=this._getRead();if(!o||!s||!c)throw new t(n(`error.chart.noData`));if(s.pivotSource)throw new t(n(`error.chart.pivotNotEditable`));if(!a&&!j(s))throw new t(n(`error.chart.typeNotEditable`,{type:this.getChartType()}));let l=Te(s,c.slots,{movedAt:e=>this._movedAt(e)}),u=r(l);u!==l&&(this._updateState({data:{...o,model:u}},{...i,description:e},[`onAnyChange`]),this._syncHolds())}_resolve(){let e=this._getModel();return e&&pe(e)?Jt(e,Et(this._styles()),this._dataReader()):null}_styles(){return this._getStyles?.()??(i._defaultStyles??=new b)}getPivotSource(){return this._getFacts()?.pivotSource??null}getLayout(e){return this._getLayout(e)}_getLayout(e,t){let n=this._getModel(),r=e??this.getMovable()?.getBounds()??null;return n&&pe(n)&&r&&r.width>0&&r.height>0?(e={width:r.width,height:r.height},function(e,t,n){return ee.registerBuiltIns($n),new Vr(e,t,n).build()}(Jt(n,Et(this._styles()),this._dataReader()),t??Xt(),e)):null}setData(r,i,a){let o=e(`op.setChartData`);this._protectionCheck(o);let s=this._getState()?.data,c=this._getModel(),l=this.getMovable()?.getRange().getWorksheet();if(!s||!c||!l)throw new t(n(`error.chart.noData`));let u=ns(function(e){let t=e.chart?.plotArea?.groups?.[0];if(!t)return null;let n=t.series[0],r=!!n?.marker&&n.marker.symbol!==`none`,i=t.grouping===`stacked`?`Stacked`:t.grouping===`percentStacked`?`Stacked100`:``;switch(t.type){case`bar`:return`${t.barDir===`bar`?`bar`:`column`}${i||`Clustered`}`;case`line`:return`${t.marker||r?`lineMarkers`:`line`}${i}`;case`area`:return`area${i}`;case`pie`:return n?.explosion?`pieExploded`:`pie`;case`ofPie`:return t.ofPieType===`bar`?`barOfPie`:`pieOfPie`;case`doughnut`:return`doughnut`;case`bubble`:return`bubble`;case`radar`:return t.radarStyle===`filled`?`radarFilled`:r?`radarMarkers`:`radar`;case`scatter`:return t.scatterStyle===`smooth`||t.scatterStyle===`smoothMarker`?r?`xyscatterSmooth`:`xyscatterSmoothNoMarkers`:n?.spPr?.stroke?.fill?.type===`none`?`xyscatter`:r?`xyscatterLines`:`xyscatterLinesNoMarkers`;default:return null}}(c)??Go(void 0),r,l,i);return this._updateState({data:{...s,model:Vi(c,u)}},{...a,description:o},[`onAnyChange`]),this._syncHolds(),this}_processRestoreOrRevert(e,t){super._processRestoreOrRevert(e,t),this.isDeleted()||this._syncHolds()}static{this._defaultStyles=null}_plotRange(e){let t=this._getRead()?.slots.referenceSlots.get(e);if(t===void 0)return null;let n=null,r=this._held?.[t]?.formula;if(r){if(r.isReferenceOnly()){let e=r.getReferences();n=e?.getCount()===1?e.at(0):null}else if(n=this._namedRange(r.getExpression()),!n)return null}else n=this._rangeAt(t)??this._namedRange(this._formulaAt(t));if(!n||n.isInvalid())return null;if(n.isEntireRows()||n.isEntireColumns())try{return n.getUsedRange({features:[]})}catch{return null}return n}_namedRange(e){let t=e?.trim().replace(/^=/,``);if(!t||!/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u.test(t))return null;let n=this.getMovable()?.getRange().getWorksheet();try{let e=n?.getNames().getByName(t)?.getRanges?.()??null;return e?.getCount()===1?e.at(0):null}catch{return null}}_readCells(e){let t=this._plotRange(e);if(!t)return null;let n=!1!==this._getModel()?.chart?.plotVisOnly,r;try{r=t.getValues({ignoreHidden:n,maxSize:Kc})}catch{return null}let i=null;return{rows:r,formats:()=>{if(i)return i;let e=t.getCoords();return i=r.length===e.rowEnd-e.rowStart+1&&(r[0]?.length??0)===e.colEnd-e.colStart+1?t.getNumberFormats():t.getCells({ignoreHidden:n,maxSize:Kc}).map(e=>e.map(e=>e?.getStyle().getNumberFormat()??qc)),i}}}_cellText(e,t){return typeof e==`number`?It(t()||qc,e,this._getModel()?.date1904??!1):$c(e)}_dataReader(){return this._getModel()&&this._getRead()?{values:e=>{let t=this._readCells(e);return t?Jc(t.rows).map(Qc):null},categories:e=>{let t=this._readCells(e);if(!t)return null;let n=Jc(t.rows),r=null;return n.map((e,n)=>this._cellText(e,()=>(r??=Jc(t.formats()))[n]))},levels:e=>{let t=this._readCells(e),n=t?this._levelsCache(t,e.cache):null;return n?.levels?n.levels.map(e=>{let t=Array(n.ptCount??0).fill(``);for(let n of e.points)t[n.idx]=n.v;return t}):null},text:e=>{let t=this._plotRange(e);if(!t?.isSingleCell())return null;try{return t.getCell().getText(Gc)}catch{return null}},formatCode:e=>{let t=this._plotRange(e);if(!t)return null;try{return t.getCell().getStyle().getNumberFormat()||null}catch{return null}}}:null}addListeners(e,t){let n=super.addListeners(e,t);if(!e.onLayoutChange)return n;this._watchLayout(1);let r=!1;return()=>{n(),r||(r=!0,this._watchLayout(-1))}}_watchLayout(e){if(this._layoutListeners+=e,this._layoutListeners>0&&!this._layoutSources&&!this._closed){let e=()=>{this._closed||this._emitter.notify(`onLayoutChange`)},t=this.getMovable(),n=()=>JSON.stringify(t?.getBounds()??null),r=n(),i=[this._emitter.addListeners({onAnyChange:e,onReferencesChange:()=>this._syncDataListeners()}),t?.addListeners({onBoundsChange:()=>{let t=n();t!==r&&(r=t,e())}}),this._getStyles?.()?.addListeners({onThemeChange:e}),y.getShared().addListeners({onCollectionChange:e})];this._layoutSources=i.filter(e=>!!e),this._syncDataListeners()}else this._layoutListeners<=0&&this._layoutSources&&this._releaseLayoutSources()}_releaseLayoutSources(){for(let e of this._layoutSources??[])e();this._layoutSources=null;for(let e of this._dataListeners.values())e();this._dataListeners.clear();for(let e of this._sheetListeners.values())e();this._sheetListeners.clear()}_queueLayoutChange(){this._layoutQueued||(this._layoutQueued=!0,queueMicrotask(()=>{this._layoutQueued=!1,!this._closed&&this._layoutListeners>0&&this._emitter.notify(`onLayoutChange`)}))}_syncDataListeners(){if(!this._layoutSources||this._closed)return;let e=new Map,t=new Set,n=this.getReferences(),r=n?.getCount()??0;for(let i=0;i<r;i++){let r=n.at(i);e.set(Zc(r),r),t.add(r.getWorksheet())}for(let[t,n]of this._dataListeners)e.has(t)||(n(),this._dataListeners.delete(t));for(let[t,n]of e){if(this._dataListeners.has(t))continue;let e=t,r=n.addListener(t=>{if(t.getTrigger()===`address`){let n=t.getSource(),i=n.isInvalid()?e:Zc(n);i!==e&&this._dataListeners.get(e)===r&&(this._dataListeners.delete(e),this._dataListeners.has(i)||this._dataListeners.set(i,r),e=i)}this._queueLayoutChange()});this._dataListeners.set(t,r)}for(let[e,n]of this._sheetListeners)t.has(e)||(n(),this._sheetListeners.delete(e));let i=()=>this._queueLayoutChange();for(let e of t)this._sheetListeners.has(e)||this._sheetListeners.set(e,e.addListeners({onRowsHiddenChange:i,onColumnsHiddenChange:i},{transactional:!1}))}close(){this._releaseLayoutSources(),super.close()}_cacheOf(e,t){let n=this._readCells(e);if(!n)return null;if(t===`multiLvlStr`)return this._levelsCache(n,e.cache);let r=Jc(n.rows),i=null,a=e=>(i??=Jc(n.formats()))[e]||qc,o=[];if(t===`str`){for(let e=0;e<r.length;e++)r[e]!==null&&r[e]!==void 0&&o.push({idx:e,v:this._cellText(r[e],()=>a(e))});return{ptCount:r.length,points:o}}let s=this.getMovable()?.getRange().getWorksheet().getWorkbook()?.getLocale(),c=e=>Ko(a(e),s),l=r.length===0?qc:c(+(r.length>1));for(let e=0;e<r.length;e++){let t=Xc(r[e]);if(t===null)continue;let n={idx:e,v:t},i=c(e);i!==l&&(n.formatCode=i),o.push(n)}return{formatCode:l,ptCount:r.length,points:o}}_levelsCache(e,t){let n=e.rows.length,r=e.rows[0]?.length??0,i=t?.levels?.length,a;if(i===r&&i!==n)a=!0;else if(i===n&&i!==r)a=!1;else if(t?.ptCount===n)a=!0;else if(t?.ptCount===r)a=!1;else{if(i!==void 0)return null;a=n>=r}let o=a?n:r,s=a?r:n,c=null,l=[];for(let t=0;t<s;t++){let i=[];for(let s=0;s<o;s++){let o=a?s:n-1-t,l=a?r-1-t:s,u=e.rows[o][l];u!=null&&i.push({idx:s,v:this._cellText(u,()=>(c??=e.formats())[o]?.[l])})}l.push({points:i})}return{ptCount:o,levels:l}}toJSON(e){let t=this._getState();if(!t?.data)return null;let n={...t.data},r=this._getModel(),i=this._getRead()?.slots,a=e=>this._movedAt(e);if(r&&i&&!j(r))n.model=Te(r,i,{movedAt:a});else if(r&&i){let e=new Map;n.model=Te(r,i,{movedAt:a,cacheOf:(t,n)=>{let r=n===`multiLvlStr`?null:this._plotRange(t);if(!r)return this._cacheOf(t,n);let i=`${n}:${Zc(r)}`;return e.has(i)||e.set(i,this._cacheOf(t,n)),e.get(i)}})}let o=C.toJSON(this._part,e);return o?((n.model??null)!==this._partModel&&delete o.xml,n.part=o):delete n.part,n}getTypeDescription(){return`Chart`}get isIChart(){return!0}},Vc=Object.freeze([]),Hc=Object.freeze({width:480,height:288}),Uc={gap:`notPlotted`,zero:`zero`,span:`interplotted`},Wc={notPlotted:`gap`,zero:`zero`,interplotted:`span`},Gc=Object.freeze({hideStringPrefix:!0}),Kc=1<<20,qc=`General`,Jc=e=>{if(e.length<=1)return e[0]?.slice()??[];let t=e[0].length;if(t===1)return e.map(e=>e[0]);let n=[];for(let r=0;r<t;r++)for(let t=0;t<e.length;t++)n.push(e[t][r]);return n},Yc=e=>{if(e===0||!Number.isFinite(e))return`0`;let[t,n]=e.toExponential().split(`e`),r=t.replace(/[-.]/g,``);r.length>15&&([t,n]=e.toExponential(16).split(`e`),r=t.replace(/[-.]/g,``).replace(/0+$/,``));let i=Number(n),a=e<0?`-`:``;return i>=16||i<=-3?`${a}${r[0]}${r.length>1?`.`+r.slice(1):``}E${i<0?`-`:`+`}${Math.abs(i)}`:i<0?`${a}0.${`0`.repeat(-i-1)}${r}`:r.length<=i+1?a+r+`0`.repeat(i+1-r.length):`${a}${r.slice(0,i+1)}.${r.slice(i+1)}`},Xc=e=>typeof e==`number`?Yc(e):e==null?null:typeof e==`boolean`?e?`1`:`0`:!0===e.isFormulaError&&e.getCode()===_.Code.NA?`#N/A`:`0`,Zc=e=>{let t=e.getCoords();return`${e.getWorksheet().getId()}:${t.rowStart},${t.colStart},${t.rowEnd},${t.colEnd}`},Qc=e=>typeof e==`number`?Number.isFinite(e)?e:null:e==null?null:typeof e==`boolean`?+!!e:!0===e.isFormulaError&&e.getCode()===_.Code.NA?null:0,$c=e=>e==null?``:typeof e==`string`?e:typeof e==`boolean`?e?`TRUE`:`FALSE`:!0===e.isFormulaError?e.getLabel():String(e);export{Bc as Chart,Yc as cacheNumberText,ns as createModelFromSource,Wo as customKindOf,Go as newChartType,qa as setCustomKind};