@sheetxl/studio-vanilla 0.8.0-beta.1 → 0.8.0-beta.3

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 (478) hide show
  1. package/browser/cjs/00npLPxW7DhY7cIJ.cjs +5 -0
  2. package/browser/cjs/1gbSV4OYBoEWTygY2.cjs +1 -0
  3. package/browser/cjs/7SCJ4vwRZW4B71kq.cjs +8 -0
  4. package/browser/cjs/9LTjOB1_w-bikScD.cjs +1 -0
  5. package/browser/cjs/AVUt0iNPhRf4R5xb.cjs +1 -0
  6. package/browser/cjs/{aYuNpndpwcZG5eik2.cjs → B2fdTYeKGNugWRgn2.cjs} +2 -2
  7. package/browser/cjs/B4ANcw0mAmhe2Aeb2.cjs +1 -0
  8. package/browser/cjs/B6IXpae7f0J8Ocq62.cjs +1 -0
  9. package/browser/cjs/B6vy56yEA1I3B74O.cjs +1 -0
  10. package/browser/cjs/B7QDcu7uACQA1y3h.cjs +1 -0
  11. package/browser/cjs/B7oyN0rn95Kyes8D2.cjs +1 -0
  12. package/browser/cjs/BArvhvpcrQEcbcyY.cjs +1 -0
  13. package/browser/cjs/{Ci8Uu7_b4lwwRLAD2.cjs → BC3OSmoFNyA52TRp2.cjs} +1 -1
  14. package/browser/cjs/{_H5j4dU7HOBYTawU.cjs → BDmBYZigchoACsQx.cjs} +1 -1
  15. package/browser/cjs/BFmgMQoM5sQsWIxf2.cjs +1 -0
  16. package/browser/cjs/BIN8L9V0hoUwMh64.cjs +1 -0
  17. package/browser/cjs/BPWKnUtyoTrtW567.cjs +1 -0
  18. package/browser/cjs/BcROQ4pvVajDQ1em.cjs +1 -0
  19. package/browser/cjs/BjjAQLiorKWXy3g5.cjs +4 -0
  20. package/browser/cjs/Bncc0oXhFMdj_HuR2.cjs +1 -0
  21. package/browser/cjs/BoRfsJCaLzUHQseD.cjs +1 -0
  22. package/browser/cjs/BqQgEaUREvuFHYoW.cjs +1 -0
  23. package/browser/cjs/{Cm21F18ga8TluA9h.cjs → BtAs67e7WBCglqc5.cjs} +1 -1
  24. package/browser/cjs/BxFSy-hOEbyllj-r2.cjs +22 -0
  25. package/browser/cjs/{CRx1WvmgBjT8WVyB2.cjs → C0g87ndP2zMUbX6f2.cjs} +1 -1
  26. package/browser/cjs/C0xAhPzztP9a24zR.cjs +5 -0
  27. package/browser/cjs/C2SohnuJK8Urc7Fx2.cjs +2 -0
  28. package/browser/cjs/C3scwi-q2KqEM39H.cjs +126 -0
  29. package/browser/cjs/C4cZxb9nRtzTCA402.cjs +1 -0
  30. package/browser/cjs/C9q3zr8iCIoYDrdA2.cjs +1 -0
  31. package/browser/cjs/CBLwtHFYNB1BTpSS.cjs +1 -0
  32. package/browser/cjs/{lEQC21-Sk4lwHy2r2.cjs → CFxueP0tbpmvY1Ip2.cjs} +1 -1
  33. package/browser/cjs/CGtG2pvGgTAnImBg2.cjs +8 -0
  34. package/browser/cjs/CH0vbLpwoyU7oOFk.cjs +11 -0
  35. package/browser/cjs/CKtdmbeMjJ2udO8s.cjs +1 -0
  36. package/browser/cjs/CQ-W9AUNHdts8pmY.cjs +1 -0
  37. package/browser/cjs/CQ5x8oFPDaU6OCJf.cjs +3 -0
  38. package/browser/cjs/CRcv32tHTbGSGtkh2.cjs +1 -0
  39. package/browser/cjs/{DsIHLUKUrSrYhFHl.cjs → CTObzk4r7C71x9Ep2.cjs} +1 -1
  40. package/browser/cjs/CUyKbhM67853Rnt22.cjs +1 -0
  41. package/browser/cjs/CVHRh1RGDSgqfAm4.cjs +2 -0
  42. package/browser/cjs/CVHc_cJddJk7J3Zt.cjs +1 -0
  43. package/browser/cjs/CaJGoNwTL6pAJ6a42.cjs +1 -0
  44. package/browser/cjs/{bGMaev70Zd_NXqLM2.cjs → CcqhH_Ign02tLFbU2.cjs} +1 -1
  45. package/browser/cjs/CdsreHc3A0wBhEy9.cjs +14 -0
  46. package/browser/cjs/CfXcRa4RlFmqU0Op.cjs +1 -0
  47. package/browser/cjs/CgyU8XPzm6O1a93m.cjs +41 -0
  48. package/browser/cjs/CzGNIWwu8KL3tcCO2.cjs +1 -0
  49. package/browser/cjs/D-8QQWC-67PplJdV2.cjs +1 -0
  50. package/browser/cjs/D6XEHfNbKx-9qZye.cjs +32 -0
  51. package/browser/cjs/{a0Z-SXs_N71CtqYb2.cjs → D6YaqporVrSewZpm2.cjs} +1 -1
  52. package/browser/cjs/D6m2M4H6JZaYZ4El2.cjs +1 -0
  53. package/browser/cjs/{DIbdDzNf_3S2RYZN.cjs → D9SdUvJVa64UoGj9.cjs} +1 -1
  54. package/browser/cjs/DCVnwgmc5HuYp_iv2.cjs +1 -0
  55. package/browser/cjs/{EeOVMRq7TuptFKTc2.cjs → DF4l8xrxkcLkgExp.cjs} +1 -1
  56. package/browser/cjs/DNnMGL1ff8hutxSd.cjs +1 -0
  57. package/browser/cjs/{D19RglhKiroWfpQn2.cjs → DOEhH2HGT1Zv0irr2.cjs} +1 -1
  58. package/browser/cjs/DQOt8XSpXyhsrF9N.cjs +93 -0
  59. package/browser/cjs/{CnZfa45XxA-9Jhmp.cjs → DRmo6uoGoqtiVff82.cjs} +1 -1
  60. package/browser/cjs/DSXLVieENYN9qXYl.cjs +1 -0
  61. package/browser/cjs/{BEJFcqVMDMKOvs11.cjs → DUXRl3eYfSwbhAfx.cjs} +1 -1
  62. package/browser/cjs/{B9EI7wviSkHS9ZkH.cjs → DWdUSWl4MXn2-MLU.cjs} +1 -1
  63. package/browser/cjs/DWyoF5GqKXce_GmT2.cjs +3 -0
  64. package/browser/cjs/Df3jw0eHS0X-qFvT.cjs +1 -0
  65. package/browser/cjs/{DiZDRPIgbO3sQ8Vb.cjs → Doiqeo4Qlie45lbl.cjs} +1 -1
  66. package/browser/cjs/Dp2fPEReFhDsI01j.cjs +3 -0
  67. package/browser/cjs/DpFg69dDCPoOK2BY2.cjs +1 -0
  68. package/browser/cjs/{Du4jBiFxRIF1OjD4.cjs → Dtxj9JR14A-uliu52.cjs} +1 -1
  69. package/browser/cjs/{CpJJh4UnFl1_qFui.cjs → Dx7GQ4ALtNG3kshu.cjs} +1 -1
  70. package/browser/cjs/{DG-AY_xO8RKHtEBE.cjs → Dy50BSaRMmRISD2Y.cjs} +1 -2
  71. package/browser/cjs/LD1P-jAXleebK12X.cjs +7 -0
  72. package/browser/cjs/P0AUOlaMi9tyE0vN.cjs +3747 -0
  73. package/browser/cjs/PmwvZPFhqmL4DO58.cjs +1 -0
  74. package/browser/cjs/Qp04O3ALK3M9d3At.cjs +54 -0
  75. package/browser/cjs/SATfdSwNygvlOSKC2.cjs +1 -0
  76. package/browser/cjs/XRCcogT-Iqd3Wv6R2.cjs +1 -0
  77. package/browser/cjs/{BziOCn_XEGT4ynN5.cjs → Z_6RasaVpnIv1MHk.cjs} +1 -1
  78. package/browser/cjs/Zz5dLT_2gLI18Jmx.cjs +7 -0
  79. package/browser/cjs/a4xpA8d_d22-GKos.cjs +1 -0
  80. package/browser/cjs/cexWxRluo6g-NG_u.cjs +1 -0
  81. package/browser/cjs/{C5rQELB0TUeXY6VM.cjs → ge8Wd-0WC6oMuJZR.cjs} +1 -1
  82. package/browser/cjs/iYn00uzmSLl2T0oN2.cjs +1 -0
  83. package/browser/cjs/index.cjs +2 -2
  84. package/browser/cjs/kj_kwD7S9uUbhKiz2.cjs +1 -0
  85. package/browser/cjs/qA_ElZ6f49Un56OC.cjs +1 -0
  86. package/browser/cjs/s2c8Pr4obSACz8Lu2.cjs +1 -0
  87. package/browser/cjs/{hzUo76TXMOBqsI3U2.cjs → uAWsHfi-JD_ZQIT82.cjs} +1 -1
  88. package/browser/cjs/uRXkwHKoe-2HtXuR.cjs +1 -0
  89. package/browser/cjs/{DxQkFYAFNZubVdn22.cjs → y4KFnuCKf8r5oFal2.cjs} +1 -1
  90. package/browser/esm/{CZWIS7FuqNjbheSw.mjs → 2eBMkUK0-HxaCmDY.mjs} +40 -40
  91. package/browser/esm/{DzDwSOBdJh_lx_NM.mjs → 53nnk5W22gJW7Ddx.mjs} +241 -241
  92. package/{cdn/assets/BCZjYGV8AqIZghBH.js → browser/esm/5SHS088DeaZ82qmD2.mjs} +69 -4
  93. package/browser/esm/{B4vYIE3kSPTxCgpf2.mjs → 5shGy9JSRzvoIfDE2.mjs} +6 -6
  94. package/browser/esm/{-vgNEEXiEad4bltZ.mjs → 74Ynqpv5NPbb_8vB.mjs} +15762 -16413
  95. package/browser/esm/B-VKr_KwiWjDeAP5.mjs +3343 -0
  96. package/{cdn/assets/BDkVAo0CDCTE04ZJ.js → browser/esm/B08GCyGdLNiXtb_R.mjs} +1 -1
  97. package/browser/esm/{3y_bCend8tkaewDG2.mjs → B0F5gtNQjANAfRw32.mjs} +19 -27
  98. package/browser/esm/B0gZ5e38MXWbEDS_.mjs +25 -0
  99. package/browser/esm/{D3G3tI3DVCUF3Gdk.mjs → B45vVm2Ma1i2b6_F.mjs} +1 -1
  100. package/browser/esm/B5z-uoALcLY2ABTo.mjs +27 -0
  101. package/{cdn/assets/Bv_96nwOEMHN9Sa0.js → browser/esm/B72sK2NRGAke-aCk2.mjs} +27 -29
  102. package/{cdn/assets/DQ4o4dG7gWbL1X8F.js → browser/esm/B8q1hrKv7LAL4xmM2.mjs} +2 -2
  103. package/{cdn/assets/DIQf1pX-j-dWQu_e.js → browser/esm/BCQJVniXgm81YQ0v2.mjs} +141 -140
  104. package/browser/esm/{CR3jgkduTLczbMjH2.mjs → BCcbek_TFOdgqxXq.mjs} +1 -1
  105. package/browser/esm/{1guzFZp1LHz_FwfL.mjs → BEb3QhWwGW8rErZy.mjs} +1 -1
  106. package/browser/esm/{CU1d8OvDv5TU6fSd.mjs → BGRNyE5ar4c3ggrS.mjs} +465 -366
  107. package/browser/esm/{fJ1McMt7xzRA_lUX.mjs → BHIVjD6BdBS3BAWp.mjs} +15 -15
  108. package/browser/esm/BH_qL-oGqwG-7JKF.mjs +87746 -0
  109. package/browser/esm/BJ26E2DhS1Jz4nUY2.mjs +514 -0
  110. package/browser/esm/BJVcTpMN-u5XhMVE2.mjs +47 -0
  111. package/browser/esm/BNgf4HZDOKYBkvL3.mjs +15495 -0
  112. package/browser/esm/BOMJTicRKnx01hw-.mjs +155 -0
  113. package/browser/esm/{8V-VceXEjpADM8qK2.mjs → BPZxx-OH0wACHLsN2.mjs} +1 -1
  114. package/browser/esm/BQIRHi8T3P5MZtan.mjs +15 -0
  115. package/browser/esm/{Dc0BDcQUGy_WIVFa.mjs → BQhVWbI9uag9iRfX2.mjs} +1 -1
  116. package/{cdn/assets/D_t53-8k73CNpV-p2.js → browser/esm/BSWXx2rKOMPxLLs8.mjs} +88 -72
  117. package/browser/esm/{CJPemkFUzhcAD_qR.mjs → BUjTEjAeByh6MKpn.mjs} +1 -1
  118. package/{cdn/assets/B5ZqqASTcBEV5L9K.js → browser/esm/BUokT-PbfvYzD63f2.mjs} +1 -1
  119. package/browser/esm/BYAZ3XZq8XXkOulw.mjs +758 -0
  120. package/browser/esm/BYPIn5AkddMzMcsa2.mjs +117 -0
  121. package/browser/esm/{CH0of3GZTzHviuQV.mjs → BcPnGFFKCddWgOch.mjs} +1 -1
  122. package/browser/esm/{BCkXtOM3yKocv7L-2.mjs → BgwzL8v2pmR5HJXW.mjs} +1 -1
  123. package/browser/esm/BiomOxscV1M0Uw2n.mjs +37 -0
  124. package/browser/esm/{DTaVECXVrgvC48BE.mjs → Bj42pxe5AuY4bF2e.mjs} +3 -3
  125. package/browser/esm/{DBL3Qp5jyPrFg7KI2.mjs → BmC-_QeQ-53oyorq2.mjs} +1 -1
  126. package/browser/esm/{DW72HwfnJtQxzoGa.mjs → BnHE1Z6WkOfTWheU2.mjs} +2 -2
  127. package/{cdn/assets/BHBJtVTiQByD_y9j2.js → browser/esm/BoWCDK44X4tp02_4.mjs} +2 -2
  128. package/browser/esm/{DVZ_UnchuMRveDG32.mjs → Bq7qy-C7tVkiIaDE2.mjs} +42 -4
  129. package/browser/esm/{Cc5IufffX4N-8QpE.mjs → BrzXFBoYDjcG3ct8.mjs} +3 -3
  130. package/browser/esm/{BOl4FzJRD7MplCU72.mjs → BsY_DyFxoqjRHTv02.mjs} +1 -1
  131. package/{cdn/assets/COA_SZY2x8q6t4BD.js → browser/esm/Bsfof8nD-exhrNwn.mjs} +7 -6
  132. package/browser/esm/BtC6lEbd98TeKGsX2.mjs +298 -0
  133. package/browser/esm/BuoHLVUSwf-mq0hg2.mjs +32 -0
  134. package/browser/esm/{R5bs6kCQSZmsCXz-.mjs → BwbR2Dao5LgLYQgV.mjs} +1 -1
  135. package/browser/esm/ByQakLd0YFwc0Lgl.mjs +91 -0
  136. package/browser/esm/{DuPdSe-EXFTx9dsc2.mjs → C-97pwItkHA3s5rD2.mjs} +16 -16
  137. package/browser/esm/{DMLwXmjo28k_iNEU.mjs → C02og4vKxq9qpIUA.mjs} +1866 -1401
  138. package/{cdn/assets/BykiUmcpDgSRNQI1.js → browser/esm/C0HHZ3XLqp0LgRuW.mjs} +1 -1
  139. package/browser/esm/C213T1hhBphljJTF2.mjs +19 -0
  140. package/browser/esm/{Dnx3_xXfRlD6ECfZ2.mjs → C3A-yJ12PN-CPPnI2.mjs} +5 -5
  141. package/browser/esm/{DQ-0yyFAwoWtxmhV2.mjs → C5Oex2msskTvaCQ92.mjs} +1 -1
  142. package/{cdn/assets/8f9hCbpXTTYEgG31.js → browser/esm/C5u9ds7LUh9JJEbW2.mjs} +2 -2
  143. package/browser/esm/{BVRzmIk5PujkT_Ap.mjs → C6D3gk0GBvvDjawh.mjs} +563 -534
  144. package/browser/esm/{BHmYoIIbNW3GdcqV2.mjs → C7b3GyO7FCiMLeyn.mjs} +1 -1
  145. package/browser/esm/{BqTFwWLbXXJ0Fu-X2.mjs → C8qOmdaHh4WQkzEy.mjs} +2 -2
  146. package/browser/esm/CD44l4eg_lxr7kgn2.mjs +115 -0
  147. package/{cdn/assets/iXWgTu3qpYZHcx1J.js → browser/esm/CDxmuF7Iay8T4cnU.mjs} +963 -946
  148. package/browser/esm/CS38A8yr4eKvdDZm.mjs +159 -0
  149. package/browser/esm/CSu0Md4a1JIZrirV.mjs +3324 -0
  150. package/{cdn/assets/BMRav2VAqEzDSp3r.js → browser/esm/CU1J-I76aVm-KPP6.mjs} +37 -3
  151. package/{cdn/assets/D9-wpGVbTS9rRpxx.js → browser/esm/CVbPAnmNN3TxMkq4.mjs} +1 -1
  152. package/browser/esm/{qG5zdZZAe6mQIJo32.mjs → CXvcyGN4L9iDr1LK2.mjs} +5 -5
  153. package/{cdn/assets/CopfZ7Y1Zn_PDNXK.js → browser/esm/CZN6c8yBDjLVTVpH.mjs} +16 -11
  154. package/{cdn/assets/DOsbSsKsexrBoeXa2.js → browser/esm/C__tNzwz0i7bQrSu2.mjs} +17 -18
  155. package/browser/esm/CcPFyWALYlJWf17T2.mjs +58 -0
  156. package/browser/esm/{47Yv4X226-93If7L.mjs → CcuNkPxT6rqElgbZ2.mjs} +1 -1
  157. package/{cdn/assets/C1ZePT2B182vSnxW.js → browser/esm/Cjbksosgv7NZFNE0.mjs} +1 -1
  158. package/browser/esm/{BD7RxHQgrqy_4tb5.mjs → CjxOVBbWLFeUZza82.mjs} +2 -2
  159. package/browser/esm/CksEMRqAqI-_nekb.mjs +149 -0
  160. package/{cdn/assets/DZDynaLqNeVaDoiH2.js → browser/esm/CnB5AuoIz-49NXD_.mjs} +3 -3
  161. package/{cdn/assets/DRc_Wi5c7WdKHTVN.js → browser/esm/Co06Uf-tv1IuVQhe.mjs} +6 -6
  162. package/browser/esm/{D6SKy2BtcWkhfiA02.mjs → CpzLNwtfx0Zd0OZ0.mjs} +2 -5
  163. package/{cdn/assets/Cbw0JeJURvQyxIoa.js → browser/esm/CwRAK6IVjIYuwofE.mjs} +1 -1
  164. package/{cdn/assets/CtXoSHbCUKMY-tSJ2.js → browser/esm/CyS1VLOdAweeZsMV.mjs} +48 -2
  165. package/browser/esm/CyomJv3_vWy4trRe2.mjs +33 -0
  166. package/browser/esm/{Be4QC65cR8N84rTn.mjs → D-1WiFWkKNPWXppx2.mjs} +1 -1
  167. package/browser/esm/D16eCDM3k1_Fk-MN.mjs +225 -0
  168. package/browser/esm/{DZbR5R1fNikjgqYb.mjs → D3Qv3--VfvVHImXW.mjs} +1 -1
  169. package/{cdn/assets/BJEpPEyFWtLzMIq-2.js → browser/esm/D5j8qMZCamJQ82pi.mjs} +1809 -1038
  170. package/{cdn/assets/CdMv3f8Gyxh8q2RR.js → browser/esm/D718rIGL3d_m1mjm2.mjs} +1 -1
  171. package/browser/esm/{BPv6Pw1hW-sV5Fya.mjs → DAhlDEV6ehTRvrj72.mjs} +1 -1
  172. package/browser/esm/{CEN8dYSpN2oew8HH.mjs → DB_I2ygTnDxYiYyc.mjs} +526 -350
  173. package/browser/esm/{D4VqLbEWag8lTWzC2.mjs → DGde1GUi2j-ZUPJW2.mjs} +121 -94
  174. package/browser/esm/DJUnZsVsvwRT_Onq2.mjs +8 -0
  175. package/browser/esm/{DXWmgQSeh0_HDxZj.mjs → DLgM7RXEEfx33zms.mjs} +4 -4
  176. package/browser/esm/DNxL1aQIN6J2PLV7.mjs +35 -0
  177. package/browser/esm/{BjTf3XA9Swj0ngpH.mjs → DRRx9F2h6V-Q957j.mjs} +2 -2
  178. package/{cdn/assets/hFSDx-LnUOObv-6h.js → browser/esm/DZGMsbIACs9TKYrM2.mjs} +2 -2
  179. package/browser/esm/{DFdU1DsC1lXOrejZ.mjs → Dcpd3kkjvidrDQuN.mjs} +1814 -1737
  180. package/browser/esm/{7rixDGGrR72lXkMV.mjs → DevyWm6bXV7lW2dr.mjs} +97 -54
  181. package/browser/esm/{Gy0CHZTvn4hY-rkx2.mjs → DfIwClWz03Qw38-O.mjs} +1 -1
  182. package/{cdn/assets/CAPgMrAKg07EREFD2.js → browser/esm/Dg7wE0RZdHeJv537.mjs} +1 -1
  183. package/browser/esm/Dj_S0P34nk_fjFoh2.mjs +427 -0
  184. package/browser/esm/DjyzSKZNfvxPmFqi.mjs +3342 -0
  185. package/browser/esm/{9_bymSfTn_rR_v6W.mjs → DlHJ7zkV6AMCtYPP.mjs} +6 -6
  186. package/browser/esm/{B1NoGosH2YQh01g7.mjs → DnLi57ylUOd3DUek.mjs} +6 -6
  187. package/{cdn/assets/BVjXdv_wkL1x_8ZJ2.js → browser/esm/DoAKAH3cmECZGboo2.mjs} +1 -1
  188. package/browser/esm/Dok4MRpMgkcsNzp4.mjs +589 -0
  189. package/browser/esm/{Blc1T4zLkp8bRC_n2.mjs → DpORFFFF3LUx_zsT2.mjs} +22 -22
  190. package/{cdn/assets/DvlpP6sUZ9Qzl9s22.js → browser/esm/Ds5mE3-q83ZhE-2T.mjs} +193 -172
  191. package/browser/esm/Du5dlbWtpboIrJk-2.mjs +394 -0
  192. package/{cdn/assets/Chq4BwbjH0sbIkJN2.js → browser/esm/DuMveAGZv1j1YAwO.mjs} +28 -13
  193. package/browser/esm/{C6CK_4GD9IpxKglV2.mjs → GETgdmj9xZWcFrIC2.mjs} +2391 -2900
  194. package/browser/esm/GJUYPKfNptRZyU9r.mjs +267 -0
  195. package/browser/esm/{vcRSnmAqjwKglEkY.mjs → JDCQtP0lkncrmnpC2.mjs} +2 -2
  196. package/browser/esm/{BceIETi6JJRW6Ss62.mjs → OsRyVy3M_rNtmU472.mjs} +13 -13
  197. package/{cdn/assets/DrUEYcXg6N2D2s1Z.js → browser/esm/OtaDVRqZVyi7IBBa.mjs} +51 -11
  198. package/browser/esm/OyyHiDjohIf4lZX62.mjs +119 -0
  199. package/browser/esm/QEPUcBp4VkPz75h8.mjs +637 -0
  200. package/{cdn/assets/CpnA5TZRkPDt4HnM2.js → browser/esm/R0Xd51SJLUebJwYv.mjs} +2 -2
  201. package/browser/esm/{DMX-ZlC_ljcf7oUN.mjs → S4MMwlNd4kcK3RDU.mjs} +1 -1
  202. package/browser/esm/{CsufM5aF6VTLKDWM.mjs → VaST17rbOSkMsGyn.mjs} +12 -12
  203. package/browser/esm/{DtXC6uPF2LLktqFE.mjs → WfqSQXib2MuH663g.mjs} +2 -2
  204. package/browser/esm/{CG5v2hAwGR5Ptufn.mjs → XuGWliVSRCNi5it12.mjs} +1 -1
  205. package/browser/esm/Z83G4i9Tvq4z2kCB.mjs +87 -0
  206. package/browser/esm/_cZz4ZhEEr54LYNe2.mjs +32 -0
  207. package/browser/esm/{NekeSGoazNCraGNC2.mjs → cDMkMgN5tB-wni7c2.mjs} +15 -15
  208. package/{cdn/assets/Clfp7SznkOrJoQvL.js → browser/esm/efVOgresgMXMdh7J2.mjs} +3 -3
  209. package/{cdn/assets/CGqvy5LwQ4z9J2oD.js → browser/esm/gXemYPUoPvaUd055.mjs} +1 -1
  210. package/browser/esm/index.mjs +6 -6
  211. package/browser/esm/kef_IwcJES4VXcNa2.mjs +238 -0
  212. package/browser/esm/{oYdWyqsKo9ejAdVm.mjs → lfNgkSweNYs6v7g2.mjs} +2 -2
  213. package/browser/esm/{BLcn1kGRsjURZSzk.mjs → lfNgkSweNYs6v7g22.mjs} +2 -2
  214. package/{cdn/assets/EwzqnZl1lTr56hH-.js → browser/esm/mbUWaIl3SJkdbWx02.mjs} +1 -1
  215. package/browser/esm/vDg2R-517z6mPR3B2.mjs +280 -0
  216. package/browser/esm/{CfvrjQGuf7vXiQCB.mjs → vP8Rb-lgzeerBAx4.mjs} +1 -1
  217. package/cdn/assets/0uSu6ChH_CTmXM2q2.js +226 -0
  218. package/{browser/esm/BCZjYGV8AqIZghBH.mjs → cdn/assets/5SHS088DeaZ82qmD.js} +69 -4
  219. package/cdn/assets/8rILuc7bVIGEeb97.js +394 -0
  220. package/cdn/assets/9ra2y9Srlg_Pw7Q32.js +590 -0
  221. package/cdn/assets/B-ylRvlizyArIFrd.js +15496 -0
  222. package/{browser/esm/BDkVAo0CDCTE04ZJ2.mjs → cdn/assets/B08GCyGdLNiXtb_R2.js} +1 -1
  223. package/cdn/assets/B0gZ5e38MXWbEDS_.js +25 -0
  224. package/cdn/assets/{C8mUyjJ26jsHGl_D.js → B15uSTYXbbRVKP0X2.js} +7 -7
  225. package/cdn/assets/{BixsQGDDf3Iv_PtW2.js → B1Lxf24mP-fwn03r2.js} +1866 -1401
  226. package/cdn/assets/{D3G3tI3DVCUF3Gdk2.js → B45vVm2Ma1i2b6_F.js} +1 -1
  227. package/cdn/assets/B63SfOuKJt36aTr_.js +8 -0
  228. package/cdn/assets/B69EK_yDF3V8Rq2r2.js +299 -0
  229. package/{browser/esm/Bv_96nwOEMHN9Sa02.mjs → cdn/assets/B72sK2NRGAke-aCk.js} +27 -29
  230. package/cdn/assets/{DW7JlG-SQEdLYNar2.js → B7SJVFUHxy16UJRA.js} +41 -3
  231. package/{browser/esm/DQ4o4dG7gWbL1X8F2.mjs → cdn/assets/B8q1hrKv7LAL4xmM.js} +2 -2
  232. package/cdn/assets/{DVS_5oDniuAFH3vT2.js → BAbRLjxqebqVPyto2.js} +2451 -2960
  233. package/cdn/assets/BCOGONuWSq4hgADu.js +4426 -0
  234. package/cdn/assets/{CR3jgkduTLczbMjH.js → BCcbek_TFOdgqxXq2.js} +1 -1
  235. package/cdn/assets/{1guzFZp1LHz_FwfL2.js → BEb3QhWwGW8rErZy2.js} +1 -1
  236. package/cdn/assets/BHpE1nCbJEbRdzIG2.js +118 -0
  237. package/cdn/assets/BJVcTpMN-u5XhMVE.js +47 -0
  238. package/cdn/assets/{B55nrhIK6gAAu4ZA.js → BLpNuslYLGia3h9t2.js} +2 -2
  239. package/cdn/assets/{8V-VceXEjpADM8qK.js → BPZxx-OH0wACHLsN.js} +1 -1
  240. package/cdn/assets/BQIRHi8T3P5MZtan2.js +15 -0
  241. package/cdn/assets/{Dc0BDcQUGy_WIVFa.js → BQhVWbI9uag9iRfX.js} +1 -1
  242. package/{browser/esm/D_t53-8k73CNpV-p.mjs → cdn/assets/BSWXx2rKOMPxLLs82.js} +88 -72
  243. package/cdn/assets/{CBuvbUg67ah_3BOZ.js → BUeKY15yUtNX2nYg.js} +2 -2
  244. package/cdn/assets/{CJPemkFUzhcAD_qR.js → BUjTEjAeByh6MKpn.js} +1 -1
  245. package/{browser/esm/B5ZqqASTcBEV5L9K2.mjs → cdn/assets/BUokT-PbfvYzD63f.js} +1 -1
  246. package/cdn/assets/BWbSIhQVBaXJNFgl.js +3324 -0
  247. package/cdn/assets/{tVOVNvOs6ro8FXqa2.js → BZDRat2zTkUEg9cR.js} +16 -16
  248. package/cdn/assets/{c6VvwMHfXubjjtyj.js → BeFqINcF0gIgBnB1.js} +16 -16
  249. package/cdn/assets/{DJwQ9abZkyFO9Doy.js → Beyy1fJJeov2iYL4.js} +4 -4
  250. package/cdn/assets/{BCkXtOM3yKocv7L-.js → BgwzL8v2pmR5HJXW2.js} +1 -1
  251. package/cdn/assets/BiomOxscV1M0Uw2n.js +37 -0
  252. package/cdn/assets/{DBL3Qp5jyPrFg7KI.js → BmC-_QeQ-53oyorq.js} +1 -1
  253. package/{browser/esm/BHBJtVTiQByD_y9j.mjs → cdn/assets/BoWCDK44X4tp02_42.js} +2 -2
  254. package/cdn/assets/{BOl4FzJRD7MplCU7.js → BsY_DyFxoqjRHTv0.js} +1 -1
  255. package/{browser/esm/COA_SZY2x8q6t4BD.mjs → cdn/assets/Bsfof8nD-exhrNwn.js} +7 -6
  256. package/cdn/assets/{BzUU8y1IFjREzgog2.js → BsiuCRJjX2LRrDF22.js} +20 -28
  257. package/cdn/assets/BuPGWNRZMMyn4fm8.js +268 -0
  258. package/cdn/assets/Bub12rk6wWVZVNx62.js +496 -0
  259. package/cdn/assets/BuoHLVUSwf-mq0hg.js +32 -0
  260. package/cdn/assets/{DbEGszSW_J_k96KJ.js → ButSau4Lf36Oe3GD.js} +2 -2
  261. package/cdn/assets/{R5bs6kCQSZmsCXz-2.js → BwbR2Dao5LgLYQgV2.js} +1 -1
  262. package/{browser/esm/B0HA_dHcr0kKfudQ.mjs → cdn/assets/C-F-eIvIRbCAMD662.js} +194 -171
  263. package/cdn/assets/{BhDLR-jtbOOG-tl12.js → C-KWjRT0CUb-bkvj2.js} +8 -8
  264. package/{browser/esm/BykiUmcpDgSRNQI12.mjs → cdn/assets/C0HHZ3XLqp0LgRuW2.js} +1 -1
  265. package/cdn/assets/C213T1hhBphljJTF.js +19 -0
  266. package/cdn/assets/{Dnx3_xXfRlD6ECfZ.js → C3A-yJ12PN-CPPnI.js} +5 -5
  267. package/cdn/assets/C4vZWmW5DZLQTTAx.js +758 -0
  268. package/cdn/assets/{DQ-0yyFAwoWtxmhV2.js → C5Oex2msskTvaCQ9.js} +1 -1
  269. package/{browser/esm/8f9hCbpXTTYEgG312.mjs → cdn/assets/C5u9ds7LUh9JJEbW.js} +2 -2
  270. package/cdn/assets/{BHmYoIIbNW3GdcqV.js → C7b3GyO7FCiMLeyn2.js} +1 -1
  271. package/cdn/assets/C8W7e-O1V1Mo2HOp.js +35 -0
  272. package/cdn/assets/{BqTFwWLbXXJ0Fu-X.js → C8qOmdaHh4WQkzEy.js} +2 -2
  273. package/cdn/assets/{Ce5A_D4YBgi_s2KF.js → CEyEKBYpjE5GGcmE.js} +13 -13
  274. package/{browser/esm/Dg5wjQp0fArKXlM3.mjs → cdn/assets/CJoCbCtXkTbj6-nC.js} +16 -11
  275. package/cdn/assets/{j8nXVEYbO2kPuEYQ.js → CLEhV4ZVh2Jf4WLI.js} +3 -3
  276. package/{browser/esm/BMRav2VAqEzDSp3r2.mjs → cdn/assets/CU1J-I76aVm-KPP6.js} +37 -3
  277. package/{browser/esm/D9-wpGVbTS9rRpxx.mjs → cdn/assets/CVbPAnmNN3TxMkq4.js} +1 -1
  278. package/cdn/assets/{2CuCH0wi9XPgVzE42.js → CWIp4JC2SCM6lg-s.js} +11 -9
  279. package/cdn/assets/{BKEzd89UphJ8q1pp2.js → CXKguOBpJrsoXPTQ.js} +485 -386
  280. package/cdn/assets/CXgMJ_MuMQRu0isj2.js +159 -0
  281. package/cdn/assets/{qG5zdZZAe6mQIJo3.js → CXvcyGN4L9iDr1LK.js} +5 -5
  282. package/cdn/assets/{DnzDlqizzNkbhJP7.js → CYFmWcVbnUCDPJ8m.js} +2 -2
  283. package/cdn/assets/{CF8m5SqeMaRkGIYM.js → C_W3L9-im26Qc-Ub.js} +2 -2
  284. package/cdn/assets/Cb7x4GW2rRvj_q2Z.js +87 -0
  285. package/cdn/assets/CcOMQhQN8PPKQulw2.js +428 -0
  286. package/cdn/assets/CcPFyWALYlJWf17T.js +58 -0
  287. package/{browser/esm/Bl6bX86tSq8hfyb2.mjs → cdn/assets/CcXDdl0SsmyEFtmU.js} +965 -944
  288. package/cdn/assets/{47Yv4X226-93If7L2.js → CcuNkPxT6rqElgbZ.js} +1 -1
  289. package/cdn/assets/CdDTtABobc5txUF6.js +149 -0
  290. package/cdn/assets/CdTHBpWoW1Fu4Dg_.js +27 -0
  291. package/cdn/assets/{CT3G9YRPVfKtHWwf2.js → Cdm7E0sw56lpdqRU2.js} +17 -17
  292. package/cdn/assets/{mtrwY1hjJeYlmzC-.js → Cf-bndowUtxZ6tmG.js} +3 -3
  293. package/cdn/assets/{DaBczM5xU9ev5_or.js → CiTCEuoCSDCy9khR.js} +2 -2
  294. package/{browser/esm/C1ZePT2B182vSnxW2.mjs → cdn/assets/Cjbksosgv7NZFNE02.js} +1 -1
  295. package/cdn/assets/{DvItgGbf8IOWPyxd.js → CmRLwDXiK3woZrVI.js} +15461 -16112
  296. package/{browser/esm/DRc_Wi5c7WdKHTVN2.mjs → cdn/assets/Co06Uf-tv1IuVQhe.js} +6 -6
  297. package/cdn/assets/Cpkl0peJbfEXl6ta2.js +239 -0
  298. package/cdn/assets/{D6SKy2BtcWkhfiA0.js → CpzLNwtfx0Zd0OZ02.js} +2 -5
  299. package/cdn/assets/{CpYlf4dXa_V2v-iS2.js → CukMw9Sc4iO21aRQ2.js} +1109 -955
  300. package/cdn/assets/{EjOJX5m8OEL-IjPB.js → CwGEi_5ErUTrkWRj.js} +7 -7
  301. package/{browser/esm/Cbw0JeJURvQyxIoa.mjs → cdn/assets/CwRAK6IVjIYuwofE2.js} +1 -1
  302. package/cdn/assets/{-2S675KWulPRlVNb2.js → Cx1HsOCOdZoKJDEN2.js} +14 -14
  303. package/{browser/esm/BqwvP0318zI2izeL2.mjs → cdn/assets/Cy6Cst4s2vE_WWKK2.js} +27 -26
  304. package/{browser/esm/CtXoSHbCUKMY-tSJ.mjs → cdn/assets/CyS1VLOdAweeZsMV2.js} +48 -2
  305. package/cdn/assets/CyomJv3_vWy4trRe.js +33 -0
  306. package/cdn/assets/{Be4QC65cR8N84rTn2.js → D-1WiFWkKNPWXppx.js} +1 -1
  307. package/cdn/assets/{DZbR5R1fNikjgqYb.js → D3Qv3--VfvVHImXW.js} +1 -1
  308. package/cdn/assets/D6B6VvRh1cfT2e-M2.js +116 -0
  309. package/{browser/esm/CdMv3f8Gyxh8q2RR2.mjs → cdn/assets/D718rIGL3d_m1mjm.js} +1 -1
  310. package/cdn/assets/D7WMzCfJnKIfTbdg.js +280 -0
  311. package/cdn/assets/{C_Io1QC4CeLGRBrz.js → D8sc6gCXnfpn7W79.js} +2 -2
  312. package/cdn/assets/DA4QV7VUyNUEfx1k2.js +156 -0
  313. package/cdn/assets/{BPv6Pw1hW-sV5Fya.js → DAhlDEV6ehTRvrj7.js} +1 -1
  314. package/cdn/assets/{gspQcUnmlRIwG609.js → DBKHpCvbeQU-Y4eS2.js} +5 -5
  315. package/cdn/assets/{CEN8dYSpN2oew8HH2.js → DB_I2ygTnDxYiYyc2.js} +526 -350
  316. package/cdn/assets/{DLEdaT0MmrOxMa2h2.js → DKwpjlUd2pFOI9yp2.js} +64 -64
  317. package/cdn/assets/{BNybEGR813e3aNIv.js → DW3_Jr-4VdZZqNEg.js} +1817 -1740
  318. package/{browser/esm/hFSDx-LnUOObv-6h2.mjs → cdn/assets/DZGMsbIACs9TKYrM.js} +2 -2
  319. package/cdn/assets/{Gy0CHZTvn4hY-rkx.js → DfIwClWz03Qw38-O2.js} +1 -1
  320. package/{browser/esm/CAPgMrAKg07EREFD.mjs → cdn/assets/Dg7wE0RZdHeJv5372.js} +1 -1
  321. package/{browser/esm/BVjXdv_wkL1x_8ZJ2.mjs → cdn/assets/DoAKAH3cmECZGboo2.js} +1 -1
  322. package/cdn/assets/FAaqx6EbN4JxNuNL2.js +87746 -0
  323. package/{browser/esm/CPUlpDM6aAzZzCat2.mjs → cdn/assets/FHIg3Yb5Rn05W1F22.js} +142 -139
  324. package/{browser/esm/CQM87ZBN7Yzn4Yxr.mjs → cdn/assets/FbLFNYdTqRtQ7QiS.js} +9 -9
  325. package/cdn/assets/{vcRSnmAqjwKglEkY2.js → JDCQtP0lkncrmnpC.js} +2 -2
  326. package/cdn/assets/{D-fJXasEYyfRUcj2.js → KOiR-1SNAX7AiEes.js} +3 -3
  327. package/cdn/assets/KS5XJUWdKvEezJfs2.js +264 -0
  328. package/{browser/esm/B4iT_CduJeJunwBc.mjs → cdn/assets/OTQWLENoZ1cSiDQb2.js} +28 -13
  329. package/{browser/esm/DrUEYcXg6N2D2s1Z2.mjs → cdn/assets/OtaDVRqZVyi7IBBa2.js} +51 -11
  330. package/cdn/assets/OyyHiDjohIf4lZX6.js +119 -0
  331. package/cdn/assets/{DKeLjEJPO9nT3bpr.js → PLFw1pLjdLQLrlB0.js} +242 -242
  332. package/cdn/assets/S4MMwlNd4kcK3RDU.js +24 -0
  333. package/cdn/assets/S4MMwlNd4kcK3RDU2.js +24 -0
  334. package/cdn/assets/{CG5v2hAwGR5Ptufn2.js → XuGWliVSRCNi5it1.js} +1 -1
  335. package/cdn/assets/_cZz4ZhEEr54LYNe.js +32 -0
  336. package/cdn/assets/{DCnA2-zB7W_QB-tD2.js → bQ6G23JQrt4l2Ls92.js} +566 -537
  337. package/{browser/esm/Clfp7SznkOrJoQvL.mjs → cdn/assets/efVOgresgMXMdh7J.js} +3 -3
  338. package/{browser/esm/CGqvy5LwQ4z9J2oD2.mjs → cdn/assets/gXemYPUoPvaUd055.js} +1 -1
  339. package/cdn/assets/{UYgwKnPX3US3Cj2k2.js → hHkEq7qn0rj2XKD82.js} +75 -48
  340. package/cdn/assets/{D1MA2ed2cLMt7hV9.js → hqW1sMr576y2S1qX.js} +41 -41
  341. package/cdn/assets/mI8tvfP8ed2Zerre.js +3344 -0
  342. package/{browser/esm/EwzqnZl1lTr56hH-2.mjs → cdn/assets/mbUWaIl3SJkdbWx0.js} +1 -1
  343. package/{browser/esm/RW23HF8taEtW8q9D.mjs → cdn/assets/n_NkstgVVwl2iAnp.js} +2 -2
  344. package/cdn/assets/ryzcqI-93l1HBuTe2.js +91 -0
  345. package/cdn/assets/{CfvrjQGuf7vXiQCB2.js → vP8Rb-lgzeerBAx42.js} +1 -1
  346. package/cdn/assets/{CHttngK66Ido5dWW.js → w65zHFqjAp_NlbXg2.js} +7 -7
  347. package/cdn/index.js +2 -2
  348. package/package.json +3 -3
  349. package/browser/cjs/2zXD3NPfuQT2KSZq.cjs +0 -7
  350. package/browser/cjs/49_x589Na12sizKK.cjs +0 -1
  351. package/browser/cjs/B19QM3SGmPKKwD_o.cjs +0 -1
  352. package/browser/cjs/B4JJfKSI4ppwU8552.cjs +0 -1
  353. package/browser/cjs/B5YBx0GqLor3i0O1.cjs +0 -1
  354. package/browser/cjs/BC2gCQkR1iykfAuC.cjs +0 -1
  355. package/browser/cjs/BEVqcFGFU6Ri9y8T.cjs +0 -5
  356. package/browser/cjs/BEzaum_kgG4yAOx0.cjs +0 -1
  357. package/browser/cjs/BF-38Z7Z0FZOPl192.cjs +0 -1
  358. package/browser/cjs/BIQZDBQfv3Qm5iC8.cjs +0 -4
  359. package/browser/cjs/BSCgCfORdZz1Ii5S.cjs +0 -2
  360. package/browser/cjs/BZr-IqNS1skh1hr6.cjs +0 -21
  361. package/browser/cjs/BfzzZ9IR27ZPzj-8.cjs +0 -3
  362. package/browser/cjs/Bgke3PtMSF2Iaen4.cjs +0 -1
  363. package/browser/cjs/BnccBYHCCq9TGFx4.cjs +0 -8
  364. package/browser/cjs/BwLx9ix5Sq7suAYP2.cjs +0 -1
  365. package/browser/cjs/C-HOJozu5NgCil1q.cjs +0 -1
  366. package/browser/cjs/C2oTW2DjZypuqq7x.cjs +0 -1
  367. package/browser/cjs/C6yxQPAEgcGWAhYR.cjs +0 -33
  368. package/browser/cjs/C9C-pr-T_ThweQX92.cjs +0 -1
  369. package/browser/cjs/CPgCih_KEqnUZ9Rv.cjs +0 -3
  370. package/browser/cjs/CSNCOmYEOR-iTJ7K.cjs +0 -5
  371. package/browser/cjs/C_7w8EJZpHw8ueuq.cjs +0 -1
  372. package/browser/cjs/C_IEgjM-hSJCv6Gm.cjs +0 -1
  373. package/browser/cjs/CcneNtiqtKppCa-p.cjs +0 -57
  374. package/browser/cjs/CeF0DZ-k4DB8M47I.cjs +0 -1
  375. package/browser/cjs/Clu7XiAsCB48GDXN2.cjs +0 -1
  376. package/browser/cjs/CojEXZgX08waZOoq.cjs +0 -1
  377. package/browser/cjs/CrDTTLE9EvaGDSD4.cjs +0 -88
  378. package/browser/cjs/Cty5pi0fwToP1GWe.cjs +0 -7
  379. package/browser/cjs/CvV18ZJgssoHMkdf2.cjs +0 -2
  380. package/browser/cjs/Cy-4IMt-AbR-ifP3.cjs +0 -126
  381. package/browser/cjs/CyGzzWYDy-IniKCq2.cjs +0 -7
  382. package/browser/cjs/CzgwTfy2072Dmt5u.cjs +0 -1
  383. package/browser/cjs/DCIlWcGDrp-5PDoA.cjs +0 -1
  384. package/browser/cjs/DFHxNnJ-lHtv0hIq.cjs +0 -1
  385. package/browser/cjs/DH3WXPfGHwWJW0nH.cjs +0 -1
  386. package/browser/cjs/DNCC-QNp2I7saV-I.cjs +0 -1
  387. package/browser/cjs/DNy-UU3NKNqQQngF.cjs +0 -1
  388. package/browser/cjs/DPjEO7dwhCFd8DHR2.cjs +0 -2
  389. package/browser/cjs/DfMJOaJ0GcUiSn4Q.cjs +0 -1
  390. package/browser/cjs/DsFZgtSQpC75d1M02.cjs +0 -1
  391. package/browser/cjs/DvSvfeo9V0Abfd3q2.cjs +0 -1
  392. package/browser/cjs/E-IqDztfMb_xdszH.cjs +0 -1
  393. package/browser/cjs/ElcoSB--cCpS6i7R2.cjs +0 -1
  394. package/browser/cjs/KNCocKN9uPR0tvUS.cjs +0 -1
  395. package/browser/cjs/Kr8f1inOTt-MICaP2.cjs +0 -1
  396. package/browser/cjs/Kvn916ebqGc4t6hv2.cjs +0 -1
  397. package/browser/cjs/PM3PrEWG3WHKxaDx.cjs +0 -1
  398. package/browser/cjs/YG320hBA20Dl3HoU2.cjs +0 -1
  399. package/browser/cjs/bIaGoYEDSBCrAaB6.cjs +0 -1
  400. package/browser/cjs/fqTQ_p3ehzUvc1tF2.cjs +0 -1
  401. package/browser/cjs/h3dw1jAp2J5Pu4p32.cjs +0 -1
  402. package/browser/cjs/i2VboqjlOcozI9MQ.cjs +0 -12
  403. package/browser/cjs/jev6VGWTdgEgm4Yk2.cjs +0 -1
  404. package/browser/cjs/ppSJKdLn646BZOzg.cjs +0 -1
  405. package/browser/cjs/xBcvszV6x7ys-m532.cjs +0 -1
  406. package/browser/esm/At60x9FEPePwPP_J.mjs +0 -51151
  407. package/browser/esm/B4h6iO7hQ9lCR7kj.mjs +0 -11273
  408. package/browser/esm/BBtOlJMVlsWorNJH.mjs +0 -824
  409. package/browser/esm/BQDXkeSabbxB5DUB2.mjs +0 -47
  410. package/browser/esm/BUCKq_2lHPd1ndvw.mjs +0 -149
  411. package/browser/esm/BX4f6i2WMBMKFVCq.mjs +0 -99
  412. package/browser/esm/BZsx0QHg1RZlM9ZN.mjs +0 -15
  413. package/browser/esm/BhxX7CZWSOlV2Dsz.mjs +0 -224
  414. package/browser/esm/BhzLZRz2N8RxjQ_U.mjs +0 -34
  415. package/browser/esm/BkSb_vyWe-AhyEDa.mjs +0 -4423
  416. package/browser/esm/Bp9qFBIcpIGXvMgo.mjs +0 -134
  417. package/browser/esm/C0rS1uBqfsj-gPR8.mjs +0 -152
  418. package/browser/esm/CGGJWgWSPZ0aP_C3.mjs +0 -87
  419. package/browser/esm/CGyydD3tRb0ik50l2.mjs +0 -20
  420. package/browser/esm/CY1zykikO58_ADk8.mjs +0 -3188
  421. package/browser/esm/Cb-FUOYcyRSkHG6u2.mjs +0 -238
  422. package/browser/esm/Cd8HXAJlflkkTXxc.mjs +0 -53
  423. package/browser/esm/CfuhUkrvOq11d9FR.mjs +0 -44
  424. package/browser/esm/Ckl3FLCOeqw7yhkP2.mjs +0 -82
  425. package/browser/esm/CpjX81WsWJbXMUoT.mjs +0 -3655
  426. package/browser/esm/DDOO4tcrO4OfMUDe.mjs +0 -25
  427. package/browser/esm/DDUYQ8FPeh1TJU24.mjs +0 -538
  428. package/browser/esm/DVJd6McdAG5udItH.mjs +0 -27
  429. package/browser/esm/DVQNQmjI2PKkwiOw2.mjs +0 -514
  430. package/browser/esm/D_zNx76HGunFi7xJ.mjs +0 -509
  431. package/browser/esm/DfRGH6mEtIVDWEYN2.mjs +0 -304
  432. package/browser/esm/DnuaqN0xfgqzl8qG.mjs +0 -2687
  433. package/browser/esm/nguMxPB9LKexKBRX.mjs +0 -219
  434. package/browser/esm/qzhFT2j-mpQEQnKs.mjs +0 -16386
  435. package/cdn/assets/2UHIeioUPXrwtZy-2.js +0 -83
  436. package/cdn/assets/BAhvL7M7ZcgZ8eDc2.js +0 -48
  437. package/cdn/assets/BM7OqAUEUk-up7_82.js +0 -134
  438. package/cdn/assets/BNuoKAzs4zkxSocG2.js +0 -44
  439. package/cdn/assets/BU6uQhQhpaLElTT82.js +0 -225
  440. package/cdn/assets/BVgTMDEoPgsWFmku.js +0 -510
  441. package/cdn/assets/BWlMK76Aj2d4ygsH.js +0 -538
  442. package/cdn/assets/BZsx0QHg1RZlM9ZN2.js +0 -15
  443. package/cdn/assets/Bl6C6xWT8E6b7OwJ2.js +0 -239
  444. package/cdn/assets/CGyydD3tRb0ik50l.js +0 -20
  445. package/cdn/assets/CH0of3GZTzHviuQV.js +0 -24
  446. package/cdn/assets/CH0of3GZTzHviuQV2.js +0 -24
  447. package/cdn/assets/Crkvq5j5KIa6eTLI2.js +0 -51151
  448. package/cdn/assets/Cv-KXN9kl0UeMezQ.js +0 -824
  449. package/cdn/assets/CvtkpvGzCHhNuwTm.js +0 -16386
  450. package/cdn/assets/D9gETGi23d14kT7u2.js +0 -99
  451. package/cdn/assets/D9joTG0Z2zdWHAEa2.js +0 -4423
  452. package/cdn/assets/DC9obE_EVmxtvXCf.js +0 -11275
  453. package/cdn/assets/DDNivpFWzQ3AIJia.js +0 -2687
  454. package/cdn/assets/DDOO4tcrO4OfMUDe.js +0 -25
  455. package/cdn/assets/DEUY_zuVwmptMX4l.js +0 -150
  456. package/cdn/assets/DTCtbG90ip7Z7LaG.js +0 -220
  457. package/cdn/assets/D_HeH7AJqWoxehn52.js +0 -53
  458. package/cdn/assets/DfRGH6mEtIVDWEYN.js +0 -304
  459. package/cdn/assets/WLUhtyUNK5QJ7Pff.js +0 -34
  460. package/cdn/assets/c7aIqKLOO4pvUsV12.js +0 -220
  461. package/cdn/assets/mtI43hWjdp4E3Z_-.js +0 -152
  462. package/cdn/assets/nmR_PgTW7GrlbHHZ.js +0 -27
  463. package/cdn/assets/vTCuFafvRlSaT9wy.js +0 -87
  464. /package/browser/cjs/{1XrWGMP3GmsQOMIX2.cjs → 1XrWGMP3GmsQOMIX.cjs} +0 -0
  465. /package/browser/cjs/{4nReftSsKWmnRdtf2.cjs → 4nReftSsKWmnRdtf.cjs} +0 -0
  466. /package/browser/cjs/{507hQYooKKjnRzsZ2.cjs → 507hQYooKKjnRzsZ.cjs} +0 -0
  467. /package/browser/cjs/{BAxVLKkxFgI6cXnR.cjs → BAxVLKkxFgI6cXnR2.cjs} +0 -0
  468. /package/browser/cjs/{C2uDl8VIJqh58YF_.cjs → C2uDl8VIJqh58YF_2.cjs} +0 -0
  469. /package/browser/cjs/{CV4KQsHluMqo1I2Q.cjs → CV4KQsHluMqo1I2Q2.cjs} +0 -0
  470. /package/browser/cjs/{CXlzsh_WHCOsErJ12.cjs → CXlzsh_WHCOsErJ1.cjs} +0 -0
  471. /package/browser/cjs/{D8-KovdJ0LjxqCe2.cjs → D8-KovdJ0LjxqCe22.cjs} +0 -0
  472. /package/browser/cjs/{DDnGLOLTqLFsdUDS2.cjs → DDnGLOLTqLFsdUDS.cjs} +0 -0
  473. /package/browser/cjs/{DM7-R_ltoLbA9jde2.cjs → DM7-R_ltoLbA9jde.cjs} +0 -0
  474. /package/browser/cjs/{DNKyaSruDogoBd2H2.cjs → DNKyaSruDogoBd2H.cjs} +0 -0
  475. /package/browser/cjs/{Dx79LP1-YCQg8B87.cjs → Dx79LP1-YCQg8B872.cjs} +0 -0
  476. /package/browser/cjs/{JfM6P_qoQQTWakZf.cjs → JfM6P_qoQQTWakZf2.cjs} +0 -0
  477. /package/browser/cjs/{CbLXP9WY38wTcGn5.cjs → NcNz8RfT5V889CMT2.cjs} +0 -0
  478. /package/browser/cjs/{z_rZE1OHFPpdGBh42.cjs → z_rZE1OHFPpdGBh4.cjs} +0 -0
@@ -1,44 +1,44 @@
1
1
  /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.8.0-beta.1
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.8.0-beta.3
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { o as e, t } from "./D_t53-8k73CNpV-p2.js";
8
- import { A as n, F as r, l as i } from "./CEN8dYSpN2oew8HH2.js";
9
- import { B as a, C as o, G as s, Jt as c, O as l, Y as u, ct as d, dt as f, fn as p, s as m, w as h } from "./Crkvq5j5KIa6eTLI2.js";
10
- import { i as g, o as _ } from "./CpYlf4dXa_V2v-iS2.js";
11
- import { C as v, D as y, E as b, F as x, G as S, I as ee, M as C, N as te, O as ne, P as w, T, U as E, W as re, _ as D, b as O, c as k, f as ie, h as A, l as j, n as M, q as ae, s as N, t as oe, v as P, z as se } from "./BixsQGDDf3Iv_PtW2.js";
12
- var F = class {
7
+ import { n as e, p as t, z as n } from "./DB_I2ygTnDxYiYyc.mjs";
8
+ import { i as r, t as i } from "./BSWXx2rKOMPxLLs8.mjs";
9
+ import { C as a, It as o, S as s, W as c, Xt as l, _t as u, an as d, et as f, jt as p, o as m, on as h, ot as g } from "./BH_qL-oGqwG-7JKF.mjs";
10
+ import { h as _, p as v } from "./DjyzSKZNfvxPmFqi.mjs";
11
+ import { $ as y, B as b, D as x, G as S, J as C, K as w, M as T, R as E, S as D, T as O, U as k, V as ee, X as A, Y as j, Z as M, a as te, at as ne, b as re, c as ie, d as ae, et as N, f as oe, g as se, h as ce, i as P, j as le, k as F, m as ue, n as I, r as de, rt as fe, s as pe, t as me, tt as he, v as ge, w as _e, y as ve, z as ye } from "./C02og4vKxq9qpIUA.mjs";
12
+ var be = "resourcesById", L = class {
13
13
  constructor(e) {
14
14
  this._kind = e.kind, this._contentType = e.contentType, this._relTypeUri = e.relTypeUri, this._path = e.path;
15
15
  }
16
- get kind() {
16
+ getKind() {
17
17
  return this._kind;
18
18
  }
19
- get contentType() {
19
+ getContentType(e) {
20
20
  return this._contentType;
21
21
  }
22
- get relTypeUri() {
22
+ getRelTypeUri(e) {
23
23
  return this._relTypeUri;
24
24
  }
25
25
  getPath(e) {
26
26
  return typeof this._path == "function" ? this._path(e) : this._path;
27
27
  }
28
- }, ce = class e {
28
+ }, xe = class e {
29
29
  constructor(e, t, n) {
30
30
  this.zipWriter = e, this.outputKind = t, this.outWritable = n;
31
31
  }
32
32
  static createUint8Array(t) {
33
- let n = new M(new O(), t);
33
+ let n = new P(new T(), t);
34
34
  return new e(n, "uint8array");
35
35
  }
36
36
  static createBlob(t) {
37
- let n = new M(new P("application/zip"), t);
37
+ let n = new P(new k("application/zip"), t);
38
38
  return new e(n, "blob");
39
39
  }
40
40
  static createWritableStream(t, n) {
41
- let r = new M(t, n);
41
+ let r = new P(t, n);
42
42
  return new e(r, "writable", t);
43
43
  }
44
44
  async add(e, t, n) {
@@ -59,10 +59,10 @@ var F = class {
59
59
  compressionMethod: n?.compressionMethod,
60
60
  signature: n?.signature
61
61
  };
62
- if (typeof t == "string") return void await this.zipWriter.add(r, new x(t), i);
62
+ if (typeof t == "string") return void await this.zipWriter.add(r, new he(t), i);
63
63
  if (t instanceof Uint8Array || ArrayBuffer.isView(t) || t && typeof t.byteLength == "number" && typeof t.byteOffset == "number") {
64
64
  try {
65
- await this.zipWriter.add(r, new E(t), i);
65
+ await this.zipWriter.add(r, new F(t), i);
66
66
  } catch (e) {
67
67
  throw console.log("Error adding Uint8Array source to zip:", r, i), e;
68
68
  }
@@ -90,7 +90,7 @@ var F = class {
90
90
  return this.outputKind === "writable" ? this.outWritable ?? n : n;
91
91
  }
92
92
  };
93
- function I(e) {
93
+ function Se(e) {
94
94
  let t = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), n = (e) => t(e).replace(/"/g, "&quot;"), r = (e) => {
95
95
  if (!e) return "";
96
96
  let t = "";
@@ -151,13 +151,13 @@ function I(e) {
151
151
  }
152
152
  };
153
153
  }
154
- function le(e) {
154
+ function Ce(e) {
155
155
  switch (e.kind) {
156
156
  case "bytes": return e.bytes;
157
157
  case "text": return e.text;
158
158
  case "stream": return e.stream;
159
159
  case "xmlStream": {
160
- let t = [], n = I({ write: (e) => t.push(e) });
160
+ let t = [], n = Se({ write: (e) => t.push(e) });
161
161
  return e.writeXml(n), n.close(), function(e) {
162
162
  let t = 0;
163
163
  for (let n of e) t += n.byteLength;
@@ -169,7 +169,7 @@ function le(e) {
169
169
  case "xmlStreamed": return e.write();
170
170
  }
171
171
  }
172
- function L(e) {
172
+ function we(e) {
173
173
  let t = R(e);
174
174
  if (!t) return "_rels/.rels";
175
175
  let n = t.lastIndexOf("/"), r = n >= 0 ? t.slice(0, n) : "";
@@ -180,21 +180,25 @@ function R(e) {
180
180
  for (; t.startsWith("/");) t = t.slice(1);
181
181
  return t;
182
182
  }
183
- function z(e) {
183
+ function Te(e) {
184
+ let t = (e ?? "").replace(/\\/g, "/").trim();
185
+ return t.startsWith("/") || (t = "/" + t), t;
186
+ }
187
+ function Ee(e) {
184
188
  let t = /^rId(\d+)$/.exec(e);
185
189
  return t ? parseInt(t[1], 10) : 2 ** 53 - 1;
186
190
  }
187
- function B(e) {
191
+ function z(e) {
188
192
  return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
189
193
  }
190
- function ue(e, t, n, r = !1) {
194
+ function De(e, t, n, r = !1) {
191
195
  let i = t;
192
196
  if (t.startsWith("/")) i = t.slice(1);
193
197
  else {
194
198
  if (!e) throw Error(`Relative path "${t}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
195
199
  i = (e.includes("/") ? e.slice(0, e.lastIndexOf("/") + 1) : "") + t;
196
200
  }
197
- if (i = de(i), !i.includes("{n}")) {
201
+ if (i = Oe(i), !i.includes("{n}")) {
198
202
  if (!r && n.has(i)) throw Error(`Path already existing path: ${i}`);
199
203
  return i;
200
204
  }
@@ -204,7 +208,7 @@ function ue(e, t, n, r = !1) {
204
208
  while (n.has(a));
205
209
  return a;
206
210
  }
207
- function de(e) {
211
+ function Oe(e) {
208
212
  let t = e.split("/"), n = [];
209
213
  for (let r of t) if (r !== "" && r !== ".") if (r === "..") {
210
214
  if (n.length === 0) throw Error(`Invalid path: too many ".." segments in "${e}"`);
@@ -212,56 +216,25 @@ function de(e) {
212
216
  } else n.push(r);
213
217
  return n.join("/");
214
218
  }
215
- function fe(e, t) {
219
+ function ke(e, t) {
216
220
  if (!e) return t;
217
221
  let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "", r = n ? n.split("/") : [], i = t.split("/"), a = 0, o = Math.min(r.length, i.length - 1);
218
222
  for (let e = 0; e < o && r[e] === i[e]; e++) a++;
219
223
  let s = r.length - a;
220
224
  return "../".repeat(s) + i.slice(a).join("/");
221
225
  }
222
- function pe(e) {
226
+ function Ae(e) {
223
227
  return new TextEncoder().encode(e);
224
228
  }
225
- var me = /&(amp|lt|gt|quot|apos|#x[0-9a-fA-F]+|#[0-9]+);/g;
226
- function he(e, t) {
227
- switch (t) {
228
- case "amp": return "&";
229
- case "lt": return "<";
230
- case "gt": return ">";
231
- case "quot": return "\"";
232
- case "apos": return "'";
233
- default: return t.startsWith("#x") ? String.fromCodePoint(parseInt(t.slice(2), 16)) : t.startsWith("#") ? String.fromCodePoint(parseInt(t.slice(1), 10)) : e;
234
- }
235
- }
236
- function ge(e) {
237
- return e.replace(me, he);
238
- }
239
- function _e(e) {
240
- let t, n = {}, r = /([A-Za-z_:][-A-Za-z0-9_:.]*)\s*=\s*"([^"]*)"/g;
241
- for (; t = r.exec(e);) n[t[1]] = ge(t[2]);
242
- return n;
243
- }
244
- function ve(e, t) {
245
- let n, r = [], i = RegExp(`<${t}\\b([^>]*)/?>`, "g");
246
- for (; n = i.exec(e);) r.push(_e(n[1]));
247
- return r;
248
- }
249
- function ye(e) {
250
- return ve(new TextDecoder("utf-8").decode(e), "Relationship").filter((e) => e.Type && e.Target).map((e) => ({
251
- type: e.Type,
252
- target: e.Target,
253
- external: e.TargetMode === "External"
254
- }));
255
- }
256
- var be = class {
229
+ var je = class {
257
230
  constructor(e) {
258
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = R(e);
231
+ this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = R(e);
259
232
  }
260
233
  add(e, t, n) {
261
234
  let r = n?.idHint && !this.usedIds.has(n.idHint) ? n.idHint : void 0;
262
235
  if (!r) do
263
236
  r = "rId" + this.nextId++;
264
- while (this.usedIds.has(r));
237
+ while (this.usedIds.has(r) || this.reservedIds.has(r));
265
238
  let i = /^rId(\d+)$/.exec(r);
266
239
  return i && (this.nextId = Math.max(this.nextId, parseInt(i[1], 10) + 1)), this.usedIds.add(r), this.rels.push({
267
240
  id: r,
@@ -270,23 +243,31 @@ var be = class {
270
243
  targetMode: n?.external ? "External" : void 0
271
244
  }), r;
272
245
  }
246
+ reserve(e) {
247
+ for (let t of e) {
248
+ if (!t) continue;
249
+ this.reservedIds.add(t);
250
+ let e = /^rId(\d+)$/.exec(t);
251
+ e && (this.nextId = Math.max(this.nextId, parseInt(e[1], 10) + 1));
252
+ }
253
+ }
273
254
  list() {
274
255
  return this.rels;
275
256
  }
276
257
  toXmlBytes() {
277
- let e = [...this.rels].sort((e, t) => z(t.id) - z(e.id) || e.id.localeCompare(t.id)), t = [];
278
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${xe}">`);
258
+ let e = [...this.rels].sort((e, t) => Ee(t.id) - Ee(e.id) || e.id.localeCompare(t.id)), t = [];
259
+ t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${Me}">`);
279
260
  for (let n of e) {
280
261
  let e = [
281
- `Id="${B(n.id)}"`,
282
- `Type="${B(n.type)}"`,
283
- `Target="${B(n.target)}"`
262
+ `Id="${z(n.id)}"`,
263
+ `Type="${z(n.type)}"`,
264
+ `Target="${z(n.target)}"`
284
265
  ];
285
266
  n.targetMode === "External" && e.push("TargetMode=\"External\""), t.push(`<Relationship ${e.join(" ")}/>`);
286
267
  }
287
- return t.push("</Relationships>"), pe(t.join(""));
268
+ return t.push("</Relationships>"), Ae(t.join(""));
288
269
  }
289
- }, xe = "http://schemas.openxmlformats.org/package/2006/relationships", Se = class {
270
+ }, Me = "http://schemas.openxmlformats.org/package/2006/relationships", Ne = class {
290
271
  constructor() {
291
272
  this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
292
273
  }
@@ -301,28 +282,31 @@ var be = class {
301
282
  }));
302
283
  }
303
284
  addOverride(e, t) {
304
- let n = function(e) {
305
- let t = (e ?? "").replace(/\\/g, "/").trim();
306
- return t.startsWith("/") || (t = "/" + t), t;
307
- }(e);
285
+ let n = Te(e);
308
286
  this._overridesSet.has(n) || (this._overridesSet.add(n), this._overrides.push({
309
287
  key: n,
310
288
  content: t
311
289
  }));
312
290
  }
291
+ replaceOverride(e, t) {
292
+ let n = Te(e);
293
+ if (!this._overridesSet.has(n)) return;
294
+ let r = this._overrides.find((e) => e.key === n);
295
+ r && (r.content = t);
296
+ }
313
297
  toXmlBytes() {
314
298
  let e = [];
315
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${Ce}">`);
299
+ e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${Pe}">`);
316
300
  let t = this._defaults.reverse();
317
301
  this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
318
- for (let { key: n, content: r } of t) e.push(`<Default Extension="${B(n)}" ContentType="${B(r)}"/>`);
302
+ for (let { key: n, content: r } of t) e.push(`<Default Extension="${z(n)}" ContentType="${z(r)}"/>`);
319
303
  let n = this._overrides;
320
- for (let { key: t, content: r } of n) e.push(`<Override PartName="${B(t)}" ContentType="${B(r)}"/>`);
321
- return e.push("</Types>"), pe(e.join(""));
304
+ for (let { key: t, content: r } of n) e.push(`<Override PartName="${z(t)}" ContentType="${z(r)}"/>`);
305
+ return e.push("</Types>"), Ae(e.join(""));
322
306
  }
323
- }, Ce = "http://schemas.openxmlformats.org/package/2006/content-types", we = class {
307
+ }, Pe = "http://schemas.openxmlformats.org/package/2006/content-types", Fe = class {
324
308
  constructor(e) {
325
- this.parts = [], this.relsRoot = new be(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Se(), this.zip = e;
309
+ this.parts = [], this.relsRoot = new je(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Ne(), this.zip = e;
326
310
  }
327
311
  addContentType(e, t) {
328
312
  let n = R(e);
@@ -331,6 +315,9 @@ var be = class {
331
315
  addDefaultType(e, t) {
332
316
  this.contentTypes.addDefault(e, t);
333
317
  }
318
+ replaceContentType(e, t) {
319
+ this.contentTypes.replaceOverride("/" + R(e), t);
320
+ }
334
321
  addPart(e, t, n, r) {
335
322
  let i = R(e);
336
323
  this.parts.push({
@@ -343,19 +330,19 @@ var be = class {
343
330
  let t = R(e || "");
344
331
  if (!t) return this.relsRoot;
345
332
  let n = this.relsByPart.get(t);
346
- return n || (n = new be(t), this.relsByPart.set(t, n)), n;
333
+ return n || (n = new je(t), this.relsByPart.set(t, n)), n;
347
334
  }
348
335
  async emit() {
349
336
  let e = [...this.parts].sort((e, t) => e.path.localeCompare(t.path));
350
337
  for (let t of e) {
351
- let e = le(t.body);
338
+ let e = Ce(t.body);
352
339
  await this.zip.add(t.path, e, t.optionsZip);
353
340
  }
354
341
  let t = this.relsRoot.toXmlBytes();
355
342
  await this.zip.add("_rels/.rels", t, {});
356
343
  let n = [...this.relsByPart.values()].sort((e, t) => e.sourcePart.localeCompare(t.sourcePart));
357
344
  for (let e of n) {
358
- let t = L(e.sourcePart), n = e.toXmlBytes();
345
+ let t = we(e.sourcePart), n = e.toXmlBytes();
359
346
  await this.zip.add(t, n, {});
360
347
  }
361
348
  let r = this.contentTypes.toXmlBytes();
@@ -364,31 +351,39 @@ var be = class {
364
351
  async build(e) {
365
352
  return await this.emit(), await this.zip.close(e);
366
353
  }
367
- }, Te = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Ee = [
368
- /^xl\/drawings\/vmlDrawing\d+\.vml$/i,
369
- /^xl\/ctrlProps\//i,
370
- /^xl\/slicers\//i,
371
- /^xl\/slicerCaches\//i,
372
- /^xl\/pivotCache\//i,
373
- /^xl\/pivotTables\//i
374
- ];
375
- function De(e) {
376
- return Ee.some((t) => t.test(e));
354
+ }, Ie = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Le = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
355
+ function Re(e) {
356
+ return e === "[Content_Types].xml" || ze.test(e);
377
357
  }
378
- function Oe(e) {
379
- return e === "[Content_Types].xml" || ke.test(e);
380
- }
381
- var ke = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
382
- function Ae(e) {
358
+ var ze = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
359
+ function Be(e) {
383
360
  if (e === "_rels/.rels") return "";
384
- let t = ke.exec(e);
361
+ let t = ze.exec(e);
385
362
  if (!t) return null;
386
363
  let n = t[1] ?? "", r = t[2];
387
364
  return n ? `${n}/${r}` : r;
388
365
  }
389
- var je = class {
366
+ function Ve(e) {
367
+ return e.startsWith("#");
368
+ }
369
+ function He(e, t) {
370
+ if (t.startsWith("/")) return Oe(t);
371
+ let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "";
372
+ return Oe((n ? n + "/" : "") + t);
373
+ }
374
+ var Ue = class {
390
375
  constructor(e, t, n) {
391
- this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new we(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null;
376
+ this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new Fe(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
377
+ }
378
+ _isSourcePartCarried(e) {
379
+ let t = this._sourcePackage;
380
+ return !(!t || !t.has(e) || Ie.has(e) || t.isAbsorbed(e) || !this._macroEnabled && e === "xl/vbaProject.bin" || Re(e) || t.hasStructuralChange() && function(e) {
381
+ return Le.some((t) => t.test(e));
382
+ }(e));
383
+ }
384
+ _reserveSourceRelIds(e) {
385
+ let t = this._sourcePackage?.getPart(we(e));
386
+ t && this._partWriter.rels(e).reserve(C(t.data).map((e) => e.id));
392
387
  }
393
388
  async waitEmit() {
394
389
  let e = this._queue;
@@ -398,29 +393,19 @@ var je = class {
398
393
  }
399
394
  }
400
395
  async build(e) {
401
- return await this.waitEmit(), this._passthroughSourceParts(), await this._partWriter.build(e ?? {});
396
+ return await this.waitEmit(), this._passthroughSourceParts(), this._applyWorkbookContentTypeVariant(), await this._partWriter.build(e ?? {});
402
397
  }
403
398
  _passthroughSourceParts() {
404
399
  let e = this._sourcePackage;
405
400
  if (!e) return;
406
- let t = new Set(this._writtenPaths), n = e.hasStructuralChange(), r = [];
407
- for (let i of e.getNames()) t.has(i) || Te.has(i) || Oe(i) || n && De(i) || r.push(i);
408
- let i = new Set(t);
409
- for (let e of r) i.add(e);
410
- let a = e.getPart("[Content_Types].xml"), o = a ? function(e) {
411
- let t = new TextDecoder("utf-8").decode(e), n = ve(t, "Default").map((e) => ({
412
- ext: (e.Extension ?? "").toLowerCase(),
413
- contentType: e.ContentType ?? ""
414
- })).filter((e) => e.ext && e.contentType), r = /* @__PURE__ */ new Map();
415
- for (let e of ve(t, "Override")) e.PartName && e.ContentType && r.set(e.PartName, e.ContentType);
416
- return {
417
- defaults: n,
418
- overrides: r
419
- };
420
- }(a.data) : null;
421
- if (o) for (let { ext: e, contentType: t } of o.defaults) this._partWriter.addDefaultType(e, t);
422
- for (let t of r) {
423
- let n = e.getPart(t), r = o?.overrides.get("/" + t);
401
+ let t = new Set(this._writtenPaths), n = [];
402
+ for (let r of e.getNames()) t.has(r) || this._isSourcePartCarried(r) && n.push(r);
403
+ let r = new Set(t);
404
+ for (let e of n) r.add(e);
405
+ let i = e.getPart("[Content_Types].xml"), a = i ? le(i.data) : null;
406
+ if (a) for (let { ext: e, contentType: t } of a.defaults) this._partWriter.addDefaultType(e, t);
407
+ for (let t of n) {
408
+ let n = e.getPart(t), r = a?.overrides.get("/" + t);
424
409
  n.raw ? this._partWriter.addPart(t, {
425
410
  kind: "bytes",
426
411
  bytes: n.raw.compressedData
@@ -435,100 +420,92 @@ var je = class {
435
420
  }, r), this._writtenPaths.add(t);
436
421
  }
437
422
  for (let n of e.getNames()) {
438
- if (n === "[Content_Types].xml" || !Oe(n)) continue;
439
- let r = Ae(n);
440
- r !== null && (r === "" || i.has(r)) && this._mergeSourceRelsInto(r, e.getPart(n).data, t, i);
423
+ if (n === "[Content_Types].xml" || !Re(n)) continue;
424
+ let i = Be(n);
425
+ i !== null && (i === "" || r.has(i)) && (e.isAbsorbed(i) || this._mergeSourceRelsInto(i, e.getPart(n).data, t, r));
441
426
  }
442
427
  }
428
+ _applyWorkbookContentTypeVariant() {
429
+ this._macroEnabled && this._partWriter.replaceContentType("xl/workbook.xml", "application/vnd.ms-excel.sheet.macroEnabled.main+xml");
430
+ }
443
431
  _mergeSourceRelsInto(e, t, n, r) {
444
- let i = this._partWriter.rels(e), a = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "";
445
- for (let o of ye(t)) {
446
- if (o.external) {
447
- i.add(o.type, o.target, { external: !0 });
432
+ let i = this._partWriter.rels(e), a = e === "" || n.has(e);
433
+ for (let o of C(t)) {
434
+ if (o.external || Ve(o.target)) {
435
+ i.add(o.type, o.target, {
436
+ external: o.external,
437
+ idHint: o.id
438
+ });
448
439
  continue;
449
440
  }
450
- let t = de((a ? a + "/" : "") + o.target);
451
- n.has(t) || this._explicitRelTargets.has(`${e}::${t}`) || (r.has(t) ? i.add(o.type, o.target) : this._registry.ownsRelType(o.type) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
452
- }
453
- }
454
- addPart(e, t, n) {
455
- return this._addPartInternal("", e, t, n);
456
- }
457
- _addPartInternal(e, t, n, r) {
458
- let i = this._registry.get(t);
459
- if (!i) throw Error(`No emitter registered for kind '${t}'.`);
460
- let a = r ?? i.getPath?.(n);
461
- if (!a) throw Error("No path provided in either argument or emitter.");
462
- let o = this._writtenPaths, s = ue(e, a, o), c = `${t}:${s}`, l = this._scheduledByNodeKey.get(c);
463
- if (!l) {
464
- let e, r = new Promise((t) => {
465
- e = t;
466
- });
467
- l = {
441
+ let t = He(e, o.target);
442
+ a && (n.has(t) || this._explicitRelTargets.has(`${e}::${t}`)) || (r.has(t) ? i.add(o.type, o.target, { idHint: o.id }) : this._registry.ownsRelType(o.type) || Ie.has(t) || this._sourcePackage?.isAbsorbed(t) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
443
+ }
444
+ }
445
+ addPart(e, t, n, r) {
446
+ return this._addPartInternal("", e, t, n, r);
447
+ }
448
+ _addPartInternal(e, t, n, r, i) {
449
+ let a = this._registry.get(t);
450
+ if (!a) throw Error(`No emitter registered for kind '${t}'.`);
451
+ let o = a.getContentType(n), s = a.getRelTypeUri(n), c = r ?? a.getPath?.(n);
452
+ if (!c) throw Error("No path provided in either argument or emitter.");
453
+ let l = this._writtenPaths, u = De(e, c, l), d = `${t}:${u}`, f = this._scheduledByNodeKey.get(d);
454
+ if (!f) {
455
+ let e;
456
+ this._reserveSourceRelIds(u), f = {
468
457
  kind: t,
469
- key: c,
458
+ key: d,
470
459
  payload: n,
471
- path: s,
472
- contentType: i.contentType,
473
- promise: r,
460
+ path: u,
461
+ contentType: o,
462
+ promise: new Promise((t) => {
463
+ e = t;
464
+ }),
474
465
  resolve: e
475
- }, this._scheduledByNodeKey.set(c, l), this._queue.push(l);
476
- }
477
- let u = this._nodesByPath.get(e);
478
- u || (u = /* @__PURE__ */ new Set(), this._nodesByPath.set(e, u)), u.add(c), !i.contentType || i.relTypeUri || e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", s);
479
- let d = null;
480
- if (i.relTypeUri) {
481
- let t = fe(e, l.path);
482
- d = this._partWriter.rels(e).add(i.relTypeUri, t);
483
- }
484
- return o.add(s), {
485
- path: s,
486
- contentTypeUri: i.contentType,
487
- relId: d
466
+ }, this._scheduledByNodeKey.set(d, f), this._queue.push(f);
467
+ }
468
+ let p = this._nodesByPath.get(e);
469
+ p || (p = /* @__PURE__ */ new Set(), this._nodesByPath.set(e, p)), p.add(d), !o || s || e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", u);
470
+ let m = null;
471
+ if (s) {
472
+ let t = ke(e, f.path);
473
+ m = this._partWriter.rels(e).add(s, t, { idHint: i });
474
+ }
475
+ return l.add(u), {
476
+ path: u,
477
+ contentTypeUri: o,
478
+ relId: m
488
479
  };
489
480
  }
490
- addBinary(e, t, n, r, i = !1) {
491
- return this._addBinaryInternal("", e, t, n, r, i);
481
+ addBinary(e, t, n, r, i = !1, a) {
482
+ return this._addBinaryInternal("", e, t, n, r, i, a);
492
483
  }
493
- _addBinaryInternal(e, t, n, r, i, a = !1) {
484
+ _addBinaryInternal(e, t, n, r, i, a = !1, o) {
494
485
  if (!i) throw Error("No path provided for binary.");
495
486
  if (!n) throw Error("No content type provided for binary.");
496
- let o = this._writtenPaths, s = ue(e, i, o, a), c = null;
487
+ let s = this._writtenPaths, c = De(e, i, s, a), l = null;
497
488
  if (r) {
498
- let t = fe(e, s);
499
- c = this._partWriter.rels(e).add(r, t);
489
+ let t = ke(e, c);
490
+ l = this._partWriter.rels(e).add(r, t, { idHint: o });
500
491
  }
501
- if (e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", s), !o.has(s)) {
502
- let e = s.split(".").pop() || "";
503
- e && this._partWriter.addDefaultType(e, n), this._partWriter.addPart(s, {
492
+ if (e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", c), !s.has(c)) {
493
+ let e = c.split(".").pop() || "";
494
+ e && this._partWriter.addDefaultType(e, n), this._partWriter.addPart(c, {
504
495
  kind: "bytes",
505
496
  bytes: t
506
497
  }, void 0, {
507
498
  level: 0,
508
499
  uncompressedSize: t.byteLength,
509
500
  dataDescriptor: !1
510
- }), o.add(s);
501
+ }), s.add(c);
511
502
  }
512
503
  return {
513
- path: s,
504
+ path: c,
514
505
  contentTypeUri: n,
515
- relId: c
506
+ relId: l
516
507
  };
517
508
  }
518
- _forkPreservedPart(e, t, n, r, i) {
519
- let a = this._sourcePackage;
520
- if (!a) return null;
521
- let o = a.getPart(t);
522
- if (!o) return null;
523
- let s = new Set(this._writtenPaths);
524
- for (let e of a.getNames()) s.add(e);
525
- let c = ue(e, i, s), l = this._addBinaryInternal(e, o.data, n, r, "/" + c), u = a.getPart(L(t));
526
- if (u) {
527
- let e = this._partWriter.rels(l.path);
528
- for (let t of ye(u.data)) e.add(t.type, t.target, t.external ? { external: !0 } : void 0);
529
- }
530
- return l;
531
- }
532
509
  async _waitForDescendants(e) {
533
510
  let t = this._nodesByPath.get(e);
534
511
  if (!t || t.size === 0) return;
@@ -552,24 +529,31 @@ var je = class {
552
529
  i.push(e);
553
530
  } };
554
531
  await t.emit(e.payload, {
555
- getXMLWriter: () => r || (r = I(a), r),
556
- addPart: (e, t, r) => this._addPartInternal(n, e, t, r),
557
- addBinary: (e, t, r, i, a = !1) => this._addBinaryInternal(n, e, t, r, i, a),
558
- addExternal: (e, t) => ({
532
+ getXMLWriter: () => r || (r = Se(a), r),
533
+ addPart: (e, t, r, i) => this._addPartInternal(n, e, t, r, i),
534
+ addBinary: (e, t, r, i, a = !1, o) => this._addBinaryInternal(n, e, t, r, i, a, o),
535
+ addExternal: (e, t, r) => ({
559
536
  path: t,
560
537
  contentTypeUri: null,
561
- relId: this._partWriter.rels(n).add(e, t, { external: !0 })
538
+ relId: this._partWriter.rels(n).add(e, t, {
539
+ external: !0,
540
+ idHint: r
541
+ })
562
542
  }),
563
- addPreservedRelationship: (e, t, r) => {
564
- let i = fe(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
543
+ addRelationship: (e, t, r) => {
544
+ if (!this._writtenPaths.has(t) && !this._isSourcePartCarried(t)) return null;
545
+ let i = ke(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
565
546
  return this._explicitRelTargets.add(`${n}::${t}`), a;
566
547
  },
567
- forkPreservedPart: (e, t, r, i) => this._forkPreservedPart(n, e, t, r, i),
568
548
  waitEmit: () => this._waitForDescendants(e.path),
569
549
  getPath: () => e.path,
570
550
  getSharedStates: () => this._mapState,
571
- warn: (e, t) => {
572
- console.warn(e, t);
551
+ warn: (t, n, r) => {
552
+ let i = n ?? e.path, a = this._options.onWarning;
553
+ a ? a(t, i, r) : console.warn(t, i);
554
+ },
555
+ log: (t, n) => {
556
+ console.warn(t, n ?? e.path);
573
557
  }
574
558
  });
575
559
  let o = function(e) {
@@ -579,7 +563,7 @@ var je = class {
579
563
  for (let t of e) n.set(t, r), r += t.byteLength;
580
564
  return n;
581
565
  }(i), s = this._options.onPartEmitted;
582
- s && await s(e.kind, e.path, o), Me && (console.log(`\n=== ${e.path} ===`), console.log(function(e, t) {
566
+ s && await s(e.kind, e.path, o), We && (console.log(`\n=== ${e.path} ===`), console.log(function(e, t) {
583
567
  return function(e, t = " ") {
584
568
  let n = "", r = 0, i = e.split(/(<[^>]+>)/g).filter(Boolean);
585
569
  for (let e = 0; e < i.length; e++) {
@@ -605,13 +589,14 @@ var je = class {
605
589
  this._nodesByPath.delete(e.path), this._scheduledByNodeKey.delete(e.key), e.resolve();
606
590
  }
607
591
  }
608
- }, Me = !1, Ne = class {
592
+ }, We = !1, Ge = class {
609
593
  constructor() {
610
594
  this.map = /* @__PURE__ */ new Map();
611
595
  }
612
596
  register(e) {
613
- if (this.map.has(e.kind)) throw Error(`Duplicate part kind: ${e.kind}`);
614
- this.map.set(e.kind, e);
597
+ let t = e.getKind();
598
+ if (this.map.has(t)) throw Error(`Duplicate part kind: ${t}`);
599
+ this.map.set(t, e);
615
600
  }
616
601
  get(e) {
617
602
  let t = this.map.get(e);
@@ -622,14 +607,31 @@ var je = class {
622
607
  return this.map.has(e);
623
608
  }
624
609
  ownsRelType(e) {
625
- for (let t of this.map.values()) if (t.relTypeUri === e) return !0;
610
+ for (let t of this.map.values()) if (t.getRelTypeUri() === e) return !0;
626
611
  return !1;
627
612
  }
628
613
  };
629
- function Pe(e, t, n) {
614
+ function Ke(e, t, n) {
630
615
  e && (e.algorithm && (t[n ? `${n}AlgorithmName` : "algorithmName"] = e.algorithm), e.hash && (t[n ? `${n}HashValue` : "hashValue"] = e.hash), e.salt && (t[n ? `${n}SaltValue` : "saltValue"] = e.salt), e.spinCount !== void 0 && (t[n ? `${n}SpinCount` : "spinCount"] = e.spinCount));
631
616
  }
632
- var Fe = class {
617
+ var qe = "hiddenFormulaXfs", Je = class {
618
+ constructor(e, t) {
619
+ this._variants = /* @__PURE__ */ new Map(), this._sources = [], this._json = e, this._styles = t, this._directCount = Math.max(1, e?.direct?.length ?? 0);
620
+ }
621
+ getHiddenXf(e) {
622
+ let t = this._variants.get(e);
623
+ return t !== void 0 || (this._isShown(e) ? t = e : (t = this._directCount + this._sources.length, this._sources.push(e)), this._variants.set(e, t)), t;
624
+ }
625
+ getSources() {
626
+ return this._sources;
627
+ }
628
+ _isShown(e) {
629
+ let t = this._json?.direct?.[e], n = t?.protection?.showFormulas;
630
+ if (n !== void 0) return n;
631
+ let r = (e === 0 ? void 0 : t?.named) ?? f.BuiltInName.Normal;
632
+ return this._styles.getNamedStyles().getByName(r)?.toJSON().style?.protection?.showFormulas ?? !1;
633
+ }
634
+ }, Ye = class {
633
635
  constructor() {
634
636
  this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
635
637
  }
@@ -664,21 +666,21 @@ var Fe = class {
664
666
  getValueMeta() {
665
667
  return this._valueMeta;
666
668
  }
667
- }, Ie = class {
669
+ }, Xe = class {
668
670
  constructor(e, t = console.warn) {
669
671
  this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = e, this._onWarn = t;
670
672
  }
671
- add(t) {
672
- if (t == null) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
673
- if (e.isError(t)) {
674
- let e = t.getCode(), n = this._register(`_error:${e}`, { errorType: "" + (e - 1) }, Le);
673
+ add(e) {
674
+ if (e == null) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
675
+ if (r.isError(e)) {
676
+ let t = e.getCode(), n = this._register(`_error:${t}`, { errorType: "" + (t - 1) }, Ze);
675
677
  return this._metaCollector.registerRichValueCell(n);
676
678
  }
677
- return t.isIRichData && t.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", t), this._registerFallback();
679
+ return e.isIRichData && e.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", e), this._registerFallback();
678
680
  }
679
681
  _registerFallback() {
680
- let t = this._register("_error:fallback", { errorType: e.Code.Unknown - 1 }, Le);
681
- return this._metaCollector.registerRichValueCell(t);
682
+ let e = this._register("_error:fallback", { errorType: r.Code.Unknown - 1 }, Ze);
683
+ return this._metaCollector.registerRichValueCell(e);
682
684
  }
683
685
  _register(e, t, n) {
684
686
  let r = this._keyMap.get(e);
@@ -709,7 +711,7 @@ var Fe = class {
709
711
  }
710
712
  return -1;
711
713
  }
712
- }, Le = new class {
714
+ }, Ze = new class {
713
715
  constructor(e, t) {
714
716
  this.type = e, this.props = t;
715
717
  }
@@ -727,58 +729,91 @@ var Fe = class {
727
729
  "subType",
728
730
  "i",
729
731
  "0"
730
- ]]), Re = {
732
+ ]]), Qe = "application/xml", $e = async (e, t) => {
733
+ let n = e.parts, r = n ? n.length : 0;
734
+ for (let i = 0; i < r; i++) {
735
+ let r = n[i];
736
+ try {
737
+ await et(r, t);
738
+ } catch (n) {
739
+ t.log(`Unable to write the part '${r.name ?? r.id}' referenced by '${e.name ?? e.id}'`, n);
740
+ }
741
+ }
742
+ }, et = async (e, t, n) => {
743
+ let r = e.resId === void 0 ? void 0 : t.getSharedStates().get(be)?.get(e.resId);
744
+ if (!r) return e.resId === void 0 ? t.addPart("embeddedPart", e, n, e.id) : (t.log(`The part '${e.name ?? e.id}' cites resource ${e.resId}, which is not in the workbook.`), null);
745
+ let i = await r.getExternalURI();
746
+ if (i) {
747
+ let n = t.addExternal(e.type, i, e.id);
748
+ return n.relId !== e.id && t.log(`The external reference '${e.id}' was written as '${n.relId}'; the markup will not find it.`), n;
749
+ }
750
+ let a = await r.toBuffer();
751
+ return t.addBinary(new Uint8Array(a), e.contentType || Qe, e.type, n ?? `./${tt(e.name)}`, !1, e.id);
752
+ }, tt = (e) => {
753
+ let t = e && /^[\w.\-~%]+$/.test(e) ? e : "part.xml", n = t.lastIndexOf("."), r = n > 0 ? t.slice(0, n) : t, i = n > 0 ? t.slice(n) : "";
754
+ return `${r.replace(/\d+$/, "")}{n}${i}`;
755
+ }, nt = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", rt = (e, t) => e.getSharedStates().get("pivotCachePaths")?.get(t) ?? null, it = "fileVersion", at = "sheetParts", ot = "externalLinkParts";
756
+ function st(e) {
757
+ if (!e || e.indexOf("[") === -1) return [];
758
+ let t = [], n = e.replace(/"(?:[^"]|"")*"/g, "");
759
+ for (let e of n.matchAll(/\[(\d+)\]/g)) {
760
+ let n = Number(e[1]);
761
+ n > 0 && !t.includes(n) && t.push(n);
762
+ }
763
+ return t;
764
+ }
765
+ var ct = {
731
766
  auto: "auto",
732
767
  automaticExceptTables: "autoNoTable",
733
768
  manual: "manual"
734
769
  };
735
- function V(e, t, n, r) {
770
+ function B(e, t, n, r) {
736
771
  if (!n) return;
737
772
  let i = typeof n == "string" ? t.parseColor(n) : n;
738
773
  r && e.start(r);
739
774
  let a = i.getType(), o = i.getVal(), s = i.getAdjustments(), c = s && s.length > 0;
740
775
  switch (a) {
741
776
  case "scheme":
742
- c ? (e.start("schemeClr", { val: o }), H(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
777
+ c ? (e.start("schemeClr", { val: o }), V(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
743
778
  break;
744
779
  case "named":
745
- if (u.isSystem(o)) {
780
+ if (d.isSystem(o)) {
746
781
  let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
747
782
  c ? (e.start("sysClr", {
748
783
  val: o,
749
784
  lastClr: t
750
- }), H(e, s), e.end("sysClr")) : e.empty("sysClr", {
785
+ }), V(e, s), e.end("sysClr")) : e.empty("sysClr", {
751
786
  val: o,
752
787
  lastClr: t
753
788
  });
754
- } else c ? (e.start("prstClr", { val: o }), H(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
789
+ } else c ? (e.start("prstClr", { val: o }), V(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
755
790
  break;
756
791
  case "auto": {
757
792
  let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
758
793
  c ? (e.start("sysClr", {
759
794
  val: "windowText",
760
795
  lastClr: t
761
- }), H(e, s), e.end("sysClr")) : e.empty("sysClr", {
796
+ }), V(e, s), e.end("sysClr")) : e.empty("sysClr", {
762
797
  val: "windowText",
763
798
  lastClr: t
764
799
  });
765
800
  break;
766
801
  }
767
802
  case "index":
768
- c ? (e.start("srgbClr", { val: o }), H(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
803
+ c ? (e.start("srgbClr", { val: o }), V(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
769
804
  break;
770
805
  case "hsl":
771
806
  let t = i.toHex().toString();
772
- c ? (e.start("srgbClr", { val: t }), H(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
807
+ c ? (e.start("srgbClr", { val: t }), V(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
773
808
  break;
774
809
  case "rgb":
775
810
  case "lrgb":
776
811
  let n = i.toHex().toString();
777
- c ? (e.start("srgbClr", { val: n }), H(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
812
+ c ? (e.start("srgbClr", { val: n }), V(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
778
813
  break;
779
814
  case "hex":
780
815
  let r = o.replace("#", "").toUpperCase();
781
- c ? (e.start("srgbClr", { val: r }), H(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
816
+ c ? (e.start("srgbClr", { val: r }), V(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
782
817
  break;
783
818
  default:
784
819
  let a = o.replace("#", "").toUpperCase();
@@ -786,7 +821,7 @@ function V(e, t, n, r) {
786
821
  }
787
822
  r && e.end(r);
788
823
  }
789
- function H(e, t) {
824
+ function V(e, t) {
790
825
  if (t && t.length !== 0) for (let n of t) for (let [t, r] of Object.entries(n)) {
791
826
  if (r == null) continue;
792
827
  let n = t;
@@ -809,14 +844,14 @@ function H(e, t) {
809
844
  }
810
845
  }
811
846
  }
812
- function U(e, t, n, r, i = !1, a = !1) {
847
+ function H(e, t, n, r, i = !1, a = !1) {
813
848
  if (!n) return;
814
849
  let s = typeof n == "string" ? t.parseColor(n) : n, c = () => {
815
- e.empty(r, { rgb: Ge(s.toHex().toString(!0)) });
850
+ e.empty(r, { rgb: ht(s.toHex().toString(!0)) });
816
851
  }, l = s.getAdjustments(), u = l && l.length > 0, d = s.getType();
817
852
  if (d !== o.Type.Auto) {
818
853
  if (d === o.Type.Scheme) {
819
- let t = s.getVal(), n = ze[t] ?? t, i = He.get(n);
854
+ let t = s.getVal(), n = lt[t] ?? t, i = ft.get(n);
820
855
  if (i === void 0 && n !== "phClr") return console.warn(`Color scheme not in theme. schemeVal=${t} themeKey=${n}`), c();
821
856
  let a = {};
822
857
  if (a.theme = i, u) {
@@ -836,13 +871,13 @@ function U(e, t, n, r, i = !1, a = !1) {
836
871
  return !0;
837
872
  }(l)) return c();
838
873
  let e, t = l.length === 1 ? l[0][o.AdjustmentType.ETint] : void 0;
839
- if (t !== void 0) e = Ue(t);
874
+ if (t !== void 0) e = pt(t);
840
875
  else {
841
876
  let t = s.getBaseColor().toHex().toString(!0), n = s.toHex().toString(!0);
842
- e = Ue(function(e, t) {
843
- let n = W(e, 0, 255), r = W(t, 0, 255);
844
- return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : W(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : W((r - n) / (255 - n), 0, 1);
845
- }(We(t), We(n)));
877
+ e = pt(function(e, t) {
878
+ let n = U(e, 0, 255), r = U(t, 0, 255);
879
+ return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : U(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : U((r - n) / (255 - n), 0, 1);
880
+ }(mt(t), mt(n)));
846
881
  }
847
882
  e !== 0 && (a.tint = e);
848
883
  }
@@ -858,7 +893,7 @@ function U(e, t, n, r, i = !1, a = !1) {
858
893
  }
859
894
  e.empty(r, { auto: 1 });
860
895
  }
861
- var ze = {
896
+ var lt = {
862
897
  bg1: "lt1",
863
898
  tx1: "dk1",
864
899
  bg2: "lt2",
@@ -871,7 +906,7 @@ var ze = {
871
906
  accent6: "accent6",
872
907
  hlink: "hlink",
873
908
  folHlink: "folHlink"
874
- }, Be = Object.freeze([
909
+ }, ut = Object.freeze([
875
910
  "lt1",
876
911
  "dk1",
877
912
  "lt2",
@@ -884,7 +919,7 @@ var ze = {
884
919
  "accent6",
885
920
  "hlink",
886
921
  "folHlink"
887
- ]), Ve = Object.freeze([
922
+ ]), dt = Object.freeze([
888
923
  "dk1",
889
924
  "lt1",
890
925
  "dk2",
@@ -897,15 +932,15 @@ var ze = {
897
932
  "accent6",
898
933
  "hlink",
899
934
  "folHlink"
900
- ]), He = new Map(Be.map((e, t) => [e, t]));
901
- function W(e, t, n) {
935
+ ]), ft = new Map(ut.map((e, t) => [e, t]));
936
+ function U(e, t, n) {
902
937
  return Math.max(t, Math.min(n, e));
903
938
  }
904
- function Ue(e) {
905
- let t = W(e, -1, 1);
939
+ function pt(e) {
940
+ let t = U(e, -1, 1);
906
941
  return Math.abs(t) < 1e-12 ? 0 : t;
907
942
  }
908
- function We(e) {
943
+ function mt(e) {
909
944
  let t = function(e) {
910
945
  let t = e.replace(/^#/, "").toUpperCase();
911
946
  if (t.length === 8) return t.slice(2);
@@ -914,31 +949,58 @@ function We(e) {
914
949
  }(e), n = parseInt(t.slice(0, 2), 16) / 255, r = parseInt(t.slice(2, 4), 16) / 255, i = parseInt(t.slice(4, 6), 16) / 255;
915
950
  return (Math.max(n, r, i) + Math.min(n, r, i)) / 2 * 255;
916
951
  }
917
- function Ge(e) {
952
+ function ht(e) {
918
953
  let t = e.replace(/^#/, "").toUpperCase();
919
954
  if (t.length === 8) return t;
920
955
  if (t.length === 6) return "FF" + t;
921
956
  throw Error(`Invalid hex: ${e}`);
922
957
  }
923
- function Ke(e, t = !1) {
958
+ function gt(e, t = !1) {
924
959
  let n = e;
925
960
  return n.length === 8 && (n = n.substring(2, 8)), n.length === 6 && (n = (t ? "00" : "FF") + n), n.toUpperCase();
926
961
  }
927
- function G(e, t, r, i, a = !1, o = !1) {
928
- let s = i.getTheme();
962
+ function _t(e) {
963
+ return `[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${e.getContent()}`;
964
+ }
965
+ function vt(e, t) {
966
+ if (typeof t == "string") return void yt(e, t);
967
+ let n = t.runs;
968
+ for (let t = 0; t < n.length; t++) {
969
+ let r = n[t];
970
+ e.start("r"), (r.bold || r.italic || r.size !== void 0 || r.font || r.color) && (e.start("rPr"), r.bold && e.empty("b"), r.italic && e.empty("i"), r.size !== void 0 && e.empty("sz", { val: r.size }), r.color && e.empty("color", { rgb: "FF" + r.color.replace(/^#/, "").toUpperCase() }), r.font && e.empty("rFont", { val: r.font }), e.end("rPr")), yt(e, r.text ?? ""), e.end("r");
971
+ }
972
+ }
973
+ function yt(e, t) {
974
+ e.start("t", oe.test(t) || /[\n\r]/.test(t) ? b : void 0), e.text(t), e.end("t");
975
+ }
976
+ function bt(e) {
977
+ let t = e.getRanges();
978
+ if (t.isInvalid()) return null;
979
+ let n = t.getCoords()[0];
980
+ return n ? {
981
+ ref: a.cellToString({
982
+ rowIndex: n.rowStart,
983
+ colIndex: n.colStart
984
+ }),
985
+ row: n.rowStart,
986
+ col: n.colStart
987
+ } : null;
988
+ }
989
+ function W(e, t, r, i, a = !1, o = !1) {
990
+ let c = i.getTheme();
929
991
  if (a && t.start("fill"), typeof r == "string" && (r = {
930
- type: f.Type.Solid,
992
+ type: s.Type.Solid,
931
993
  color: r
932
- }), r.type === f.Type.None) a ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
933
- else if (r.type === f.Type.Solid) {
994
+ }), r.type === s.Type.None) a ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
995
+ else if (r.type === s.Type.Solid) {
934
996
  let e = r;
935
- a ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (a ? U(t, s, e.color, "fgColor") : V(t, s, e.color)), a ? t.end("patternFill") : t.end("solidFill");
936
- } else if (r.type === f.Type.Pattern) {
997
+ a ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (a ? H(t, c, e.color, "fgColor") : B(t, c, e.color)), a ? t.end("patternFill") : t.end("solidFill");
998
+ } else if (r.type === s.Type.Pattern) {
937
999
  let e = r, n = e.patternType || "solid";
938
- t.start("patternFill", { patternType: n }), e.foreground && (a ? U(t, s, o ? e.background : e.foreground, "fgColor") : V(t, s, o ? e.background : e.foreground)), e.background && (a ? U(t, s, o ? e.foreground : e.background, "bgColor") : V(t, s, o ? e.foreground : e.background)), t.end("patternFill");
939
- } else if (r.type === f.Type.Gradient && a) {
1000
+ t.start("patternFill", { patternType: n }), e.foreground && (a ? H(t, c, o ? e.background : e.foreground, "fgColor") : B(t, c, o ? e.background : e.foreground)), e.background && (a ? H(t, c, o ? e.foreground : e.background, "bgColor") : B(t, c, o ? e.foreground : e.background)), t.end("patternFill");
1001
+ } else if (r.type === s.Type.Gradient && a) {
940
1002
  let e = r, n = {}, i = e.gradientType;
941
- if (i !== f.GradientType.Path && i !== f.GradientType.Linear || (n.type = i), e.angle !== void 0) {
1003
+ if (i !== s.GradientType.Path && i !== s.GradientType.Linear || (n.type = i), e.angle !== void 0) {
942
1004
  let t = (e.angle - 90) % 360;
943
1005
  t !== 0 && (n.degree = String(t));
944
1006
  }
@@ -952,10 +1014,10 @@ function G(e, t, r, i, a = !1, o = !1) {
952
1014
  let t = e;
953
1015
  r = t.offset || 0, n = t.color;
954
1016
  }
955
- t.start("stop", { position: String(r) }), n && U(t, s, n, "color"), t.end("stop");
1017
+ t.start("stop", { position: String(r) }), n && H(t, c, n, "color"), t.end("stop");
956
1018
  }
957
1019
  t.end("gradientFill");
958
- } else if (r.type === f.Type.Gradient) {
1020
+ } else if (r.type === s.Type.Gradient) {
959
1021
  let e = r, i = {};
960
1022
  e.isRotatedWithShape !== void 0 && (i.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.start("gradFill", i), t.start("gsLst");
961
1023
  let a = e.stops;
@@ -966,11 +1028,11 @@ function G(e, t, r, i, a = !1, o = !1) {
966
1028
  let t = e;
967
1029
  i = t.offset || 0, r = t.color;
968
1030
  }
969
- t.start("gs", { pos: String(n.roundAccurately(1e3 * i, 0)) }), r && V(t, s, r), t.end("gs");
1031
+ t.start("gs", { pos: String(n.roundAccurately(1e3 * i, 0)) }), r && B(t, c, r), t.end("gs");
970
1032
  }
971
1033
  t.end("gsLst");
972
1034
  let o = e.gradientType;
973
- if (o && o !== f.GradientType.Linear) {
1035
+ if (o && o !== s.GradientType.Linear) {
974
1036
  let r = o === "radial" ? "circle" : o;
975
1037
  t.start("path", { path: r });
976
1038
  let i = e.focus;
@@ -989,11 +1051,11 @@ function G(e, t, r, i, a = !1, o = !1) {
989
1051
  } else a ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
990
1052
  a && t.end("fill");
991
1053
  }
992
- var qe = (e, t, r, i) => {
1054
+ var xt = (e, t, r, i) => {
993
1055
  if (!r) return t.start("ln"), t.empty("noFill"), void t.end("ln");
994
1056
  typeof r == "string" && (r = { fill: r });
995
1057
  let a = r, o = {};
996
- if (a.width !== void 0 && (o.w = String(K(a.width))), a.lineCap !== void 0 && (o.cap = Je(a.lineCap)), a.compound !== void 0 && (o.cmpd = a.compound), a.align !== void 0 && (o.algn = a.align), t.start("ln", o), G(0, t, a.fill ?? Qe, i), Array.isArray(a.dash)) {
1058
+ if (a.width !== void 0 && (o.w = String(q(a.width))), a.lineCap !== void 0 && (o.cap = St(a.lineCap)), a.compound !== void 0 && (o.cmpd = a.compound), a.align !== void 0 && (o.algn = a.align), t.start("ln", o), W(0, t, a.fill ?? Et, i), Array.isArray(a.dash)) {
997
1059
  t.start("custDash");
998
1060
  for (let e = 0; e < a.dash.length; e += 2) t.empty("ds", {
999
1061
  d: String(n.roundAccurately(1e3 * a.dash[e], 0)),
@@ -1001,58 +1063,58 @@ var qe = (e, t, r, i) => {
1001
1063
  });
1002
1064
  t.end("custDash");
1003
1065
  } else typeof a.dash == "string" && t.empty("prstDash", { val: a.dash });
1004
- if (a.lineJoin === g.LineJoin.Round) t.empty("round");
1005
- else if (a.lineJoin === g.LineJoin.Bevel) t.empty("bevel");
1006
- else if (a.lineJoin === g.LineJoin.Miter) {
1066
+ if (a.lineJoin === _.LineJoin.Round) t.empty("round");
1067
+ else if (a.lineJoin === _.LineJoin.Bevel) t.empty("bevel");
1068
+ else if (a.lineJoin === _.LineJoin.Miter) {
1007
1069
  let e = {};
1008
1070
  a.miterLimit !== void 0 && (e.lim = String(n.roundAccurately(1e5 * a.miterLimit, 0))), t.empty("miter", e);
1009
1071
  }
1010
1072
  t.end("ln");
1011
- }, Je = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, Ye = (e, t, n, r = void 0, i = !1) => {
1073
+ }, St = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, Ct = (e, t, n, r = void 0, i = !1) => {
1012
1074
  if (!n || !(n.fill || n.stroke || n.effects?.length || i)) return;
1013
1075
  let a = e.getXMLWriter();
1014
- r && a.start(r), a.pushDefaultNamespace("a"), n.fill && G(0, a, n.fill, t), n.stroke && qe(0, a, n.stroke, t), n.effects?.length ? Xe(e, a, t.getTheme(), n.effects) : i && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1015
- }, Xe = (e, t, n, r) => {
1076
+ r && a.start(r), a.pushDefaultNamespace("a"), n.fill && W(0, a, n.fill, t), n.stroke && xt(0, a, n.stroke, t), n.effects?.length ? wt(e, a, t.getTheme(), n.effects) : i && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1077
+ }, wt = (e, t, n, r) => {
1016
1078
  t.start("effectLst");
1017
- for (let e of r) Ze(t, n, e);
1079
+ for (let e of r) Tt(t, n, e);
1018
1080
  t.end("effectLst");
1019
- }, Ze = (e, t, r) => {
1081
+ }, Tt = (e, t, r) => {
1020
1082
  switch (r.type) {
1021
- case _.Type.OuterShadow: {
1083
+ case v.Type.OuterShadow: {
1022
1084
  let i = r, a = {};
1023
- i.blur !== void 0 && (a.blurRad = String(K(i.blur))), i.distance !== void 0 && (a.dist = String(K(i.distance))), i.angle !== void 0 && (a.dir = String(J(i.angle))), i.alignment !== void 0 && (a.algn = i.alignment), i.isRotatedWithShape !== void 0 && (a.rotWithShape = i.isRotatedWithShape ? "1" : "0"), i.scaleX !== void 0 && (a.sx = String(n.roundAccurately(1e3 * i.scaleX, 0))), i.scaleY !== void 0 && (a.sy = String(n.roundAccurately(1e3 * i.scaleY, 0))), i.skewX !== void 0 && (a.kx = String(J(i.skewX))), i.skewY !== void 0 && (a.ky = String(J(i.skewY))), e.start("outerShdw", a), V(e, t, i.color), e.end("outerShdw");
1085
+ i.blur !== void 0 && (a.blurRad = String(q(i.blur))), i.distance !== void 0 && (a.dist = String(q(i.distance))), i.angle !== void 0 && (a.dir = String(Y(i.angle))), i.alignment !== void 0 && (a.algn = i.alignment), i.isRotatedWithShape !== void 0 && (a.rotWithShape = i.isRotatedWithShape ? "1" : "0"), i.scaleX !== void 0 && (a.sx = String(n.roundAccurately(1e3 * i.scaleX, 0))), i.scaleY !== void 0 && (a.sy = String(n.roundAccurately(1e3 * i.scaleY, 0))), i.skewX !== void 0 && (a.kx = String(Y(i.skewX))), i.skewY !== void 0 && (a.ky = String(Y(i.skewY))), e.start("outerShdw", a), B(e, t, i.color), e.end("outerShdw");
1024
1086
  break;
1025
1087
  }
1026
- case _.Type.InnerShadow: {
1088
+ case v.Type.InnerShadow: {
1027
1089
  let n = r, i = {};
1028
- n.blur !== void 0 && (i.blurRad = String(K(n.blur))), n.distance !== void 0 && (i.dist = String(K(n.distance))), n.angle !== void 0 && (i.dir = String(J(n.angle))), e.start("innerShdw", i), V(e, t, n.color), e.end("innerShdw");
1090
+ n.blur !== void 0 && (i.blurRad = String(q(n.blur))), n.distance !== void 0 && (i.dist = String(q(n.distance))), n.angle !== void 0 && (i.dir = String(Y(n.angle))), e.start("innerShdw", i), B(e, t, n.color), e.end("innerShdw");
1029
1091
  break;
1030
1092
  }
1031
- case _.Type.PresetShadow: {
1093
+ case v.Type.PresetShadow: {
1032
1094
  let n = r, i = { prst: n.preset };
1033
- n.distance !== void 0 && (i.dist = String(K(n.distance))), n.angle !== void 0 && (i.dir = String(J(n.angle))), e.start("prstShdw", i), V(e, t, n.color), e.end("prstShdw");
1095
+ n.distance !== void 0 && (i.dist = String(q(n.distance))), n.angle !== void 0 && (i.dir = String(Y(n.angle))), e.start("prstShdw", i), B(e, t, n.color), e.end("prstShdw");
1034
1096
  break;
1035
1097
  }
1036
- case _.Type.Glow: {
1098
+ case v.Type.Glow: {
1037
1099
  let n = r, i = {};
1038
- n.radius !== void 0 && (i.rad = String(K(n.radius))), e.start("glow", i), V(e, t, n.color), e.end("glow");
1100
+ n.radius !== void 0 && (i.rad = String(q(n.radius))), e.start("glow", i), B(e, t, n.color), e.end("glow");
1039
1101
  break;
1040
1102
  }
1041
- case _.Type.SoftEdge: {
1103
+ case v.Type.SoftEdge: {
1042
1104
  let t = r, n = {};
1043
- t.radius !== void 0 && (n.rad = String(K(t.radius))), e.empty("softEdge", n);
1105
+ t.radius !== void 0 && (n.rad = String(q(t.radius))), e.empty("softEdge", n);
1044
1106
  break;
1045
1107
  }
1046
- case _.Type.Reflection: {
1108
+ case v.Type.Reflection: {
1047
1109
  let t = r, i = {};
1048
- t.blur !== void 0 && (i.blurRad = String(K(t.blur))), t.distance !== void 0 && (i.dist = String(K(t.distance))), t.angle !== void 0 && (i.dir = String(J(t.angle))), t.fadeAngle !== void 0 && (i.fadeDir = String(J(t.fadeAngle))), t.startAlpha !== void 0 && (i.stA = String(n.roundAccurately(1e3 * t.startAlpha, 0))), t.startPosition !== void 0 && (i.stPos = String(n.roundAccurately(1e3 * t.startPosition, 0))), t.endAlpha !== void 0 && (i.endA = String(n.roundAccurately(1e3 * t.endAlpha, 0))), t.endPosition !== void 0 && (i.endPos = String(n.roundAccurately(1e3 * t.endPosition, 0))), t.scaleX !== void 0 && (i.sx = String(n.roundAccurately(1e3 * t.scaleX, 0))), t.scaleY !== void 0 && (i.sy = String(n.roundAccurately(1e3 * t.scaleY, 0))), t.skewX !== void 0 && (i.kx = String(J(t.skewX))), t.skewY !== void 0 && (i.ky = String(J(t.skewY))), t.alignment !== void 0 && (i.algn = t.alignment), t.isRotatedWithShape !== void 0 && (i.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.empty("reflection", i);
1110
+ t.blur !== void 0 && (i.blurRad = String(q(t.blur))), t.distance !== void 0 && (i.dist = String(q(t.distance))), t.angle !== void 0 && (i.dir = String(Y(t.angle))), t.fadeAngle !== void 0 && (i.fadeDir = String(Y(t.fadeAngle))), t.startAlpha !== void 0 && (i.stA = String(n.roundAccurately(1e3 * t.startAlpha, 0))), t.startPosition !== void 0 && (i.stPos = String(n.roundAccurately(1e3 * t.startPosition, 0))), t.endAlpha !== void 0 && (i.endA = String(n.roundAccurately(1e3 * t.endAlpha, 0))), t.endPosition !== void 0 && (i.endPos = String(n.roundAccurately(1e3 * t.endPosition, 0))), t.scaleX !== void 0 && (i.sx = String(n.roundAccurately(1e3 * t.scaleX, 0))), t.scaleY !== void 0 && (i.sy = String(n.roundAccurately(1e3 * t.scaleY, 0))), t.skewX !== void 0 && (i.kx = String(Y(t.skewX))), t.skewY !== void 0 && (i.ky = String(Y(t.skewY))), t.alignment !== void 0 && (i.algn = t.alignment), t.isRotatedWithShape !== void 0 && (i.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.empty("reflection", i);
1049
1111
  break;
1050
1112
  }
1051
1113
  }
1052
- }, Qe = { type: "none" }, $e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", et = {
1114
+ }, Et = { type: "none" }, G = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", K = "imagesWritten", Dt = {
1053
1115
  mime: "image/png",
1054
1116
  ext: "png"
1055
- }, K = (e = 0) => n.roundAccurately(12700 * e, 0), q = (e = 0) => n.roundAccurately(9525 * e, 0), J = (e) => 6e4 * e, tt = (e = 0) => n.roundAccurately(100 * e, 2), nt = class {
1117
+ }, q = (e = 0) => n.roundAccurately(12700 * e, 0), J = (e = 0) => n.roundAccurately(9525 * e, 0), Y = (e) => 6e4 * e, Ot = (e = 0) => n.roundAccurately(100 * e, 2), kt = class {
1056
1118
  constructor() {
1057
1119
  this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1058
1120
  }
@@ -1066,64 +1128,64 @@ var qe = (e, t, r, i) => {
1066
1128
  getCount() {
1067
1129
  return this._dxfs.length;
1068
1130
  }
1069
- }, rt = "cfDxfs", it = [
1131
+ }, At = "cfDxfs", jt = [
1070
1132
  "font",
1071
1133
  "fill",
1072
- "border",
1134
+ "borders",
1073
1135
  "numberFormat",
1074
1136
  "alignment"
1075
1137
  ];
1076
- function at(e, t, i) {
1077
- if (t) {
1078
- if (t.named) {
1079
- let r = t.named, a = r.toLowerCase(), o = i.namedStyleMap;
1138
+ function Mt(t, r, i) {
1139
+ if (r) {
1140
+ if (r.named) {
1141
+ let e = r.named, a = e.toLowerCase(), o = i.namedStyleMap;
1080
1142
  if (!o.has(a)) {
1081
1143
  o.set(a, "" + o.size);
1082
- let t = e.getNamed(r).toJSON();
1083
- at(e, t.style ?? n.EmptyObject, i), i.namedStyles.push(t);
1144
+ let r = t.getNamedStyles().getByName(e).toJSON();
1145
+ Mt(t, r.style ?? n.EmptyObject, i), i.namedStyles.push(r);
1084
1146
  }
1085
1147
  }
1086
- t.font && function(e, t, n) {
1087
- if (!t) return;
1088
- let i = r.JSONStableStringify(t), a = n.fontMap;
1148
+ r.font && function(t, n, r) {
1149
+ if (!n) return;
1150
+ let i = e.JSONStableStringify(n), a = r.fontMap;
1089
1151
  if (!a.has(i)) {
1090
1152
  let e = a.size;
1091
- a.set(i, "" + e), n.fonts.push(t);
1153
+ a.set(i, "" + e), r.fonts.push(n);
1092
1154
  }
1093
- }(0, t.font, i), t.fill && function(e, t, n) {
1094
- if (!t) return;
1095
- let i = r.JSONStableStringify(t), a = n.fillMap;
1096
- if (!a.has(i) && typeof t == "object" && t.type) {
1155
+ }(0, r.font, i), r.fill && function(t, n, r) {
1156
+ if (!n) return;
1157
+ let i = e.JSONStableStringify(n), a = r.fillMap;
1158
+ if (!a.has(i) && typeof n == "object" && n.type) {
1097
1159
  let e = a.size;
1098
- a.set(i, "" + e), n.fills.push(t);
1160
+ a.set(i, "" + e), r.fills.push(n);
1099
1161
  }
1100
- }(0, t.fill, i), t.border && function(e, t, n) {
1101
- if (!t) return;
1102
- let i = r.JSONStableStringify(t), a = n.borderMap;
1162
+ }(0, r.fill, i), r.borders && function(t, n, r) {
1163
+ if (!n) return;
1164
+ let i = e.JSONStableStringify(n), a = r.borderMap;
1103
1165
  if (!a.has(i)) {
1104
1166
  let e = a.size;
1105
- a.set(i, "" + e), n.borders.push(t);
1167
+ a.set(i, "" + e), r.borders.push(n);
1106
1168
  }
1107
- }(0, t.border, i), t.numberFormat !== void 0 && function(e, t, n) {
1169
+ }(0, r.borders, i), r.numberFormat !== void 0 && function(e, t, n) {
1108
1170
  if (!t) return;
1109
- let r = l.toBuiltInID(t), i = n.numFmtMap;
1171
+ let r = p.toBuiltInID(t), i = n.numFmtMap;
1110
1172
  if (!i.has(r)) {
1111
1173
  let e = 0;
1112
- typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + ft, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1174
+ typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + zt, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1113
1175
  }
1114
- }(0, t.numberFormat, i);
1176
+ }(0, r.numberFormat, i);
1115
1177
  }
1116
1178
  }
1117
- function ot(e, t, n) {
1179
+ function Nt(e, t, n) {
1118
1180
  if (!t) return;
1119
1181
  let r = t.name.toLowerCase();
1120
- n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), at(e, t.style, n));
1182
+ n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), Mt(e, t.style, n));
1121
1183
  }
1122
- function st(e, t, n, r, i = !1) {
1184
+ function Pt(e, t, n, r, i = !1) {
1123
1185
  let a = r.getDefaultFontSize(), o = r.getTheme().getFontScheme().getMinorFont() ?? "Calibri", s = r.getNormal().getFont().getColor();
1124
1186
  t.start("font"), n.weight && n.weight >= 700 && t.empty("b"), n.style && n.style !== "normal" && t.empty("i"), n.strike && t.empty("strike"), n.underline && t.empty("u", { val: n.underline }), n.outline && t.empty("outline"), n.shadow && t.empty("shadow"), n.extend && t.empty("extend");
1125
1187
  let c = n.verticalAlign;
1126
- c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), U(t, r.getTheme(), n.color ?? s, "color", !i);
1188
+ c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), H(t, r.getTheme(), n.color ?? s, "color", !i);
1127
1189
  let l = !i || n.family && n.family !== o;
1128
1190
  if (l && (t.empty("name", { val: n.family ?? o }), n.fallbacks && n.fallbacks.length > 0)) {
1129
1191
  let e = n.fallbacks;
@@ -1133,57 +1195,59 @@ function st(e, t, n, r, i = !1) {
1133
1195
  let u = n.scheme ?? (n.family === void 0 ? "minor" : void 0);
1134
1196
  l && u !== void 0 && u !== "none" && t.empty("scheme", { val: u }), t.end("font");
1135
1197
  }
1136
- function Y(e, t, n, r, i, a = !1) {
1198
+ function X(e, t, n, r, i, a = !1) {
1137
1199
  if (!i || i.style === "none" || !i.style) return void (a && !i || t.empty(r));
1138
1200
  t.start(r, { style: i.style });
1139
1201
  let o = i.color;
1140
- o && U(t, n, o, "color", !a, a), t.end(r);
1202
+ o && H(t, n, o, "color", !a, a), t.end(r);
1141
1203
  }
1142
- function ct(e, t, n, r, i = !1) {
1204
+ function Ft(e, t, n, r, i = !1) {
1143
1205
  let a = {};
1144
- i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), Y(0, t, r, "left", n.left, i), Y(0, t, r, "right", n.right, i), Y(0, t, r, "top", n.top, i), Y(0, t, r, "bottom", n.bottom, i), i ? (Y(0, t, r, "vertical", n.vertical, i), Y(0, t, r, "horizontal", n.horizontal, i)) : Y(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1206
+ i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), X(0, t, r, "left", n.left, i), X(0, t, r, "right", n.right, i), X(0, t, r, "top", n.top, i), X(0, t, r, "bottom", n.bottom, i), i ? (X(0, t, r, "vertical", n.vertical, i), X(0, t, r, "horizontal", n.horizontal, i)) : X(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1145
1207
  }
1146
- function lt(e, t, n, r = !1) {
1208
+ function It(e, t, n, r = !1) {
1147
1209
  let i = {};
1148
- n.horizontal && n.horizontal !== p.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== p.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1210
+ n.horizontal && n.horizontal !== c.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== c.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1149
1211
  let a = n.rotation;
1150
1212
  n.stacked && (i.textRotation = "255", a = 0), a && (a >= 270 && a < 360 ? a = 360 - a : a > 0 && a <= 90 && (a += 90), i.textRotation = String(a));
1151
1213
  let o = n.overflow;
1152
- switch (o === p.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === p.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1153
- case p.ReadingDirection.Auto: break;
1154
- case p.ReadingDirection.LeftToRight:
1214
+ switch (o === c.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === c.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1215
+ case c.ReadingDirection.Auto: break;
1216
+ case c.ReadingDirection.LeftToRight:
1155
1217
  i.readingOrder = "1";
1156
1218
  break;
1157
- case p.ReadingDirection.RightToLeft: i.readingOrder = "2";
1219
+ case c.ReadingDirection.RightToLeft: i.readingOrder = "2";
1158
1220
  }
1159
1221
  return Object.keys(i).length > 0 ? i : null;
1160
1222
  }
1161
- function ut(e, t, n, i, a, o) {
1162
- let s = {}, c = null, l = i.named;
1163
- l && (c = n.getNamed(l).toJSON().style);
1164
- let u = i.font ?? c?.font, f = u ? a.fontMap.get(r.JSONStableStringify(u)) ?? 0 : 0, p = i.fill ?? c?.fill, m = p ? a.fillMap.get(r.JSONStableStringify(p)) ?? 0 : 0, h = i.border ?? c?.border, g = h ? a.borderMap.get(r.JSONStableStringify(h)) ?? 0 : 0, _ = i.numberFormat ?? c?.numberFormat;
1165
- if (s.numFmtId = (_ === void 0 ? void 0 : a.numFmtMap.get(_)) ?? "0", s.fontId = String(f), s.fillId = String(m), s.borderId = String(g), o) {
1166
- let e = i.named ?? d.BuiltInName.Normal;
1167
- s.xfId = a.namedStyleMap.get(e.toLowerCase());
1168
- }
1169
- let v = null, y = i.alignment ?? c?.alignment;
1170
- y && (v = lt(0, 0, y)), i.font && (s.applyFont = "1"), i.fill && (s.applyFill = "1"), i.numberFormat && (s.applyNumberFormat = "1"), i.border && (s.applyBorder = "1"), v && (s.applyAlignment = "1"), i.quotePrefix && (s.quotePrefix = "1"), v ? (t.start("xf", s), v && t.empty("alignment", v), t.end("xf")) : t.empty("xf", s);
1223
+ function Lt(t, n, r, i, a, o, s = !1) {
1224
+ let c = {}, l = null, u = i.named;
1225
+ u && (l = r.getNamedStyles().getByName(u).toJSON().style);
1226
+ let d = i.font ?? l?.font, p = d ? a.fontMap.get(e.JSONStableStringify(d)) ?? 0 : 0, m = i.fill ?? l?.fill, h = m ? a.fillMap.get(e.JSONStableStringify(m)) ?? 0 : 0, g = i.borders ?? l?.borders, _ = g ? a.borderMap.get(e.JSONStableStringify(g)) ?? 0 : 0, v = i.numberFormat ?? l?.numberFormat;
1227
+ if (c.numFmtId = (v === void 0 ? void 0 : a.numFmtMap.get(v)) ?? "0", c.fontId = String(p), c.fillId = String(h), c.borderId = String(_), o) {
1228
+ let e = i.named ?? f.BuiltInName.Normal;
1229
+ c.xfId = a.namedStyleMap.get(e.toLowerCase());
1230
+ }
1231
+ let y = null, b = i.alignment ?? l?.alignment;
1232
+ b && (y = It(0, 0, b)), i.font && (c.applyFont = "1"), i.fill && (c.applyFill = "1"), i.numberFormat && (c.applyNumberFormat = "1"), i.borders && (c.applyBorder = "1"), y && (c.applyAlignment = "1");
1233
+ let x = null, S = i.protection?.alwaysUnlocked ?? l?.protection?.alwaysUnlocked ?? !1;
1234
+ (S || s) && (x = {}, S && (x.locked = "0"), s && (x.hidden = "1"), c.applyProtection = "1"), i.quotePrefix && (c.quotePrefix = "1"), y || x ? (n.start("xf", c), y && n.empty("alignment", y), x && n.empty("protection", x), n.end("xf")) : n.empty("xf", c);
1171
1235
  }
1172
- function dt(e, t, n, r, i, a = "dxf", o = ft) {
1173
- if (t.start(a), n.font && st(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1174
- let e = l.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? l.builtInFormat(e) : String(e);
1236
+ function Rt(e, t, n, r, i, a = "dxf", o = zt) {
1237
+ if (t.start(a), n.font && Pt(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1238
+ let e = p.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? p.builtInFormat(e) : String(e);
1175
1239
  i && t.empty("numFmt", {
1176
1240
  numFmtId: String(r ? e : o++),
1177
1241
  formatCode: i
1178
1242
  });
1179
1243
  }
1180
- if (n.fill && G(0, t, n.fill, r, !0, !0), n.alignment) {
1181
- let e = lt(0, 0, n.alignment, !0);
1244
+ if (n.fill && W(0, t, n.fill, r, !0, !0), n.alignment) {
1245
+ let e = It(0, 0, n.alignment, !0);
1182
1246
  e && t.empty("alignment", e);
1183
1247
  }
1184
- return n.border && ct(0, t, n.border, i, !0), t.end(a), o;
1248
+ return n.borders && Ft(0, t, n.borders, i, !0), t.end(a), o;
1185
1249
  }
1186
- var ft = 164, pt = Object.freeze([
1250
+ var zt = 164, Bt = Object.freeze([
1187
1251
  "wholeTable",
1188
1252
  "headerRow",
1189
1253
  "totalRow",
@@ -1197,7 +1261,7 @@ var ft = 164, pt = Object.freeze([
1197
1261
  "lastHeaderCell",
1198
1262
  "firstTotalCell",
1199
1263
  "lastTotalCell"
1200
- ]), mt = a.BuiltInOperatorNames, ht = (e, t, n, r, i, a) => {
1264
+ ]), Vt = g.BuiltInOperatorNames, Ht = (e, t, n, r, i, a) => {
1201
1265
  let o = r.sorts, s = o ? o.length : 0;
1202
1266
  if (s === 0) return;
1203
1267
  let c = {};
@@ -1216,7 +1280,7 @@ var ft = 164, pt = Object.freeze([
1216
1280
  }).toString(), r.sortOn && (c.sortBy = r.sortOn), r.dxfId !== void 0 && (c.dxfId = r.dxfId), r.iconSet !== void 0 && (c.iconSet = r.iconSet), r.customList !== void 0 && (c.customList = r.customList), t.empty("sortCondition", c);
1217
1281
  }
1218
1282
  t.end("sortState");
1219
- }, gt = (e, t, n, r, i = !1) => {
1283
+ }, Ut = (e, t, n, r, i = !1) => {
1220
1284
  let a = n.getRange();
1221
1285
  n.isShowTotals() && (a = a.getResizeBy(-1, 0));
1222
1286
  let o = a.getCoords(), s = r.sort, c = r.filter, l = c ? c.conditions : void 0, u = l ? l.length : 0, d = r.hiddenButtons, f = {};
@@ -1236,58 +1300,58 @@ var ft = 164, pt = Object.freeze([
1236
1300
  r.columns ? c = r.columns.length : i && (c = a.getColumnCount()), t.start("autoFilter", f);
1237
1301
  for (let n = 0; n < c; n++) {
1238
1302
  let r = !0 === d || !0 === p?.[n], i = m[n];
1239
- (i || r) && _t(e, t, n, i, r);
1303
+ (i || r) && Gt(e, t, n, i, r);
1240
1304
  }
1241
- s && i && ht(0, t, n, s, a, o), t.end("autoFilter");
1305
+ s && i && Ht(0, t, n, s, a, o), t.end("autoFilter");
1242
1306
  } else t.empty("autoFilter", f);
1243
- s && !i && ht(0, t, n, s, a, o);
1244
- }, X = (e, t, n) => {
1245
- let r = A(n, (t) => e.warn(t, n));
1307
+ s && !i && Ht(0, t, n, s, a, o);
1308
+ }, Wt = (e, t, n) => {
1309
+ let r = _e(n, (t) => e.warn(t, n));
1246
1310
  if (!r) return;
1247
1311
  let i = { operator: r.operator };
1248
1312
  r.val !== void 0 && (i.val = r.val), t.empty("customFilter", i);
1249
- }, _t = (e, t, n, r, i) => {
1250
- let o = {};
1251
- o.colId = "" + n, i && (o.hiddenButton = "1"), r ? (t.start("filterColumn", o), ((e, t, n) => {
1313
+ }, Gt = (e, t, n, r, i) => {
1314
+ let a = {};
1315
+ a.colId = "" + n, i && (a.hiddenButton = "1"), r ? (t.start("filterColumn", a), ((e, t, n) => {
1252
1316
  let r = n.operator;
1253
- if (r !== a.BuiltInOperatorNames.Expression) if (r !== a.BuiltInOperatorNames.Unique) {
1254
- if (r === a.BuiltInOperatorNames.Color) {
1317
+ if (r !== g.BuiltInOperatorNames.Expression) if (r !== g.BuiltInOperatorNames.Unique) {
1318
+ if (r === g.BuiltInOperatorNames.Color) {
1255
1319
  let e = n.param, r = {};
1256
1320
  e.cellColor !== void 0 && (r.cellColor = e.cellColor ? "1" : "0"), e.styleId !== void 0 && (r.dxfId = e.styleId), t.empty("colorFilter", r);
1257
1321
  }
1258
- if (vt(r)) if (r === "between") {
1322
+ if (Kt(r)) if (r === "between") {
1259
1323
  let r = n.param;
1260
- t.start("customFilters", { and: "1" }), X(e, t, {
1261
- operator: mt.GreaterThanEqualTo,
1324
+ t.start("customFilters", { and: "1" }), Wt(e, t, {
1325
+ operator: Vt.GreaterThanEqualTo,
1262
1326
  param: r.from
1263
- }), X(e, t, {
1264
- operator: mt.LessThanEqualTo,
1327
+ }), Wt(e, t, {
1328
+ operator: Vt.LessThanEqualTo,
1265
1329
  param: r.to
1266
1330
  }), t.end("customFilters");
1267
- } else if (r === a.BuiltInOperatorNames.Not) {
1331
+ } else if (r === g.BuiltInOperatorNames.Not) {
1268
1332
  let r = n.param;
1269
- k(r?.operator) ? (t.start("customFilters"), X(e, t, n), t.end("customFilters")) : e.warn("Not rule with non-comparison criteria not supported in OOXML", r);
1270
- } else if (r === a.BuiltInOperatorNames.And || r === a.BuiltInOperatorNames.Or) {
1271
- let i = n.param, o = i.length;
1272
- if (o > 0) {
1333
+ D(r?.operator) ? (t.start("customFilters"), Wt(e, t, n), t.end("customFilters")) : e.warn("Not rule with non-comparison criteria not supported in OOXML", r);
1334
+ } else if (r === g.BuiltInOperatorNames.And || r === g.BuiltInOperatorNames.Or) {
1335
+ let i = n.param, a = i.length;
1336
+ if (a > 0) {
1273
1337
  let n = {};
1274
- r === a.BuiltInOperatorNames.And && o > 1 && (n.and = "1"), t.start("customFilters", n);
1275
- for (let n = 0; n < o; n++) {
1276
- let r = i[n], a = r.operator === mt.Not && k(r.param?.operator);
1277
- k(r.operator) || a ? X(e, t, r) : e.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", r);
1338
+ r === g.BuiltInOperatorNames.And && a > 1 && (n.and = "1"), t.start("customFilters", n);
1339
+ for (let n = 0; n < a; n++) {
1340
+ let r = i[n], a = r.operator === Vt.Not && D(r.param?.operator);
1341
+ D(r.operator) || a ? Wt(e, t, r) : e.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", r);
1278
1342
  }
1279
1343
  t.end("customFilters");
1280
1344
  }
1281
- } else k(r) && (t.start("customFilters"), X(e, t, n), t.end("customFilters"));
1282
- if (r === a.BuiltInOperatorNames.TimePeriod) {
1345
+ } else D(r) && (t.start("customFilters"), Wt(e, t, n), t.end("customFilters"));
1346
+ if (r === g.BuiltInOperatorNames.TimePeriod) {
1283
1347
  let e = n.param, r = {};
1284
1348
  e.type && (r.type = e.type), e.anchorDate !== void 0 && (r.val = "" + e.anchorDate), e.maxVal !== void 0 && (r.maxVal = "" + e.maxVal), t.empty("dynamicFilter", r);
1285
1349
  }
1286
- if (r === a.BuiltInOperatorNames.Average) {
1350
+ if (r === g.BuiltInOperatorNames.Average) {
1287
1351
  let e = n.param, r = {}, i = e.type;
1288
- i && (i === a.AverageType.Above ? r.type = "aboveAverage" : i === a.AverageType.Below && (r.type = "belowAverage")), e.stdDevs !== void 0 && (r.val = "" + e.stdDevs), t.empty("dynamicFilter", r);
1352
+ i && (i === g.AverageType.Above ? r.type = "aboveAverage" : i === g.AverageType.Below && (r.type = "belowAverage")), e.stdDevs !== void 0 && (r.val = "" + e.stdDevs), t.empty("dynamicFilter", r);
1289
1353
  }
1290
- if (r === a.BuiltInOperatorNames.InSet) {
1354
+ if (r === g.BuiltInOperatorNames.InSet) {
1291
1355
  let e = n.param;
1292
1356
  if (e.dateGroups) {
1293
1357
  let n = e.dateGroups, r = n.length;
@@ -1308,66 +1372,66 @@ var ft = 164, pt = Object.freeze([
1308
1372
  t.end("filters");
1309
1373
  }
1310
1374
  }
1311
- if (r === a.BuiltInOperatorNames.Icon) {
1375
+ if (r === g.BuiltInOperatorNames.Icon) {
1312
1376
  let e = n.param, r = {};
1313
1377
  e.iconSet !== void 0 && (r.iconSet = e.iconSet), e.iconId !== void 0 && (r.iconId = "" + e.iconId), t.empty("iconFilter", r);
1314
1378
  }
1315
- if (r === a.BuiltInOperatorNames.TopN) {
1379
+ if (r === g.BuiltInOperatorNames.TopN) {
1316
1380
  let e = n.param, r = {};
1317
1381
  e.percent && (r.percent = "1"), e.top !== void 0 && (r.top = e.top ? "1" : "0"), e.limit !== void 0 && (r.val = "" + e.limit), e.filterVal !== void 0 && (r.filterVal = "" + e.filterVal), t.empty("top10", r);
1318
1382
  }
1319
1383
  } else e.warn("Unique conditions not supported in Table AutoFilters", n);
1320
1384
  else e.warn("Expression conditions not supported in Table AutoFilters", n);
1321
- })(e, t, r), t.end("filterColumn")) : t.empty("filterColumn", o);
1322
- }, vt = (e) => e === a.BuiltInOperatorNames.GreaterThan || e === a.BuiltInOperatorNames.GreaterThanEqualTo || e === a.BuiltInOperatorNames.LessThan || e === a.BuiltInOperatorNames.LessThanEqualTo || e === a.BuiltInOperatorNames.EqualTo || e === a.BuiltInOperatorNames.And || e === a.BuiltInOperatorNames.Or || e === a.BuiltInOperatorNames.Not || e === "between", yt = "16.0000", bt = {
1385
+ })(e, t, r), t.end("filterColumn")) : t.empty("filterColumn", a);
1386
+ }, Kt = (e) => e === g.BuiltInOperatorNames.GreaterThan || e === g.BuiltInOperatorNames.GreaterThanEqualTo || e === g.BuiltInOperatorNames.LessThan || e === g.BuiltInOperatorNames.LessThanEqualTo || e === g.BuiltInOperatorNames.EqualTo || e === g.BuiltInOperatorNames.And || e === g.BuiltInOperatorNames.Or || e === g.BuiltInOperatorNames.Not || e === "between", qt = {
1323
1387
  names: /* @__PURE__ */ new Set(),
1324
1388
  perFormula: [],
1325
1389
  affects: () => !1
1326
- }, xt = 1048576;
1327
- function St(e, t) {
1390
+ }, Jt = 1048576;
1391
+ function Yt(e, t) {
1328
1392
  let n = t.type;
1329
- n === s.ColorStopType.AutoMin ? n = s.ColorStopType.Min : n === s.ColorStopType.AutoMax && (n = s.ColorStopType.Max), e.empty("cfvo", {
1393
+ n === l.ColorStopType.AutoMin ? n = l.ColorStopType.Min : n === l.ColorStopType.AutoMax && (n = l.ColorStopType.Max), e.empty("cfvo", {
1330
1394
  type: n,
1331
1395
  val: t.value,
1332
1396
  gte: t.exclusive ? "0" : void 0
1333
1397
  });
1334
1398
  }
1335
- function Ct(e, t) {
1399
+ function Xt(e, t) {
1336
1400
  let n = {
1337
1401
  type: t.type,
1338
1402
  gte: t.exclusive ? "0" : void 0
1339
1403
  };
1340
1404
  t.value === void 0 ? e.empty("x14:cfvo", n) : (e.start("x14:cfvo", n), e.start("xm:f"), e.text(t.value), e.end("xm:f"), e.end("x14:cfvo"));
1341
1405
  }
1342
- var wt = /* @__PURE__ */ new Set([
1343
- d.IconSet.Arrows3,
1344
- d.IconSet.ArrowsGray3,
1345
- d.IconSet.Flags3,
1346
- d.IconSet.Signs3,
1347
- d.IconSet.Symbols3,
1348
- d.IconSet.Symbols3_2,
1349
- d.IconSet.TrafficLights3,
1350
- d.IconSet.TrafficLights3_2,
1351
- d.IconSet.Arrows4,
1352
- d.IconSet.ArrowsGray4,
1353
- d.IconSet.Rating4,
1354
- d.IconSet.RedToBlack4,
1355
- d.IconSet.TrafficLights4,
1356
- d.IconSet.Arrows5,
1357
- d.IconSet.ArrowsGray5,
1358
- d.IconSet.Quarters5,
1359
- d.IconSet.Rating5
1406
+ var Zt = /* @__PURE__ */ new Set([
1407
+ f.IconSet.Arrows3,
1408
+ f.IconSet.ArrowsGray3,
1409
+ f.IconSet.Flags3,
1410
+ f.IconSet.Signs3,
1411
+ f.IconSet.Symbols3,
1412
+ f.IconSet.Symbols3_2,
1413
+ f.IconSet.TrafficLights3,
1414
+ f.IconSet.TrafficLights3_2,
1415
+ f.IconSet.Arrows4,
1416
+ f.IconSet.ArrowsGray4,
1417
+ f.IconSet.Rating4,
1418
+ f.IconSet.RedToBlack4,
1419
+ f.IconSet.TrafficLights4,
1420
+ f.IconSet.Arrows5,
1421
+ f.IconSet.ArrowsGray5,
1422
+ f.IconSet.Quarters5,
1423
+ f.IconSet.Rating5
1360
1424
  ]);
1361
- function Tt(e) {
1362
- return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !wt.has(e.iconSet);
1425
+ function Qt(e) {
1426
+ return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !Zt.has(e.iconSet);
1363
1427
  }
1364
- function Et(e, t, r, i, a, o, c, l, u) {
1428
+ function $t(e, t, r, i, a, o, s, c, u) {
1365
1429
  let d = i.scale;
1366
1430
  i.ext && e.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1367
1431
  let f, p = {
1368
1432
  type: a.type,
1369
- dxfId: i.style && Object.keys(i.style).length > 0 ? l.add(i.style) : void 0,
1370
- priority: c,
1433
+ dxfId: i.style && Object.keys(i.style).length > 0 ? c.add(i.style) : void 0,
1434
+ priority: s,
1371
1435
  stopIfTrue: Z(i.stopIfTrue),
1372
1436
  aboveAverage: Z(a.aboveAverage),
1373
1437
  equalAverage: Z(a.equalAverage),
@@ -1379,47 +1443,47 @@ function Et(e, t, r, i, a, o, c, l, u) {
1379
1443
  text: a.text,
1380
1444
  timePeriod: a.timePeriod
1381
1445
  };
1382
- d?.type === s.ScaleType.DataBar && function(e) {
1446
+ d?.type === l.ScaleType.DataBar && function(e) {
1383
1447
  if (e.gradient || e.borderColor || e.negativeFillColor || e.negativeBorderColor || e.axisColor || e.axisPosition || e.direction) return !0;
1384
1448
  let t = e.stops, n = t ? t.length : 0;
1385
1449
  for (let e = 0; e < n; e++) {
1386
1450
  let n = t[e].type;
1387
- if (n === s.ColorStopType.AutoMin || n === s.ColorStopType.AutoMax) return !0;
1451
+ if (n === l.ColorStopType.AutoMin || n === l.ColorStopType.AutoMax) return !0;
1388
1452
  }
1389
1453
  return !1;
1390
- }(d) && (f = C(n.uuidV4), u.push({
1454
+ }(d) && (f = fe(n.uuidV4), u.push({
1391
1455
  guid: f,
1392
1456
  sqref: o,
1393
- priority: c,
1457
+ priority: s,
1394
1458
  scale: d
1395
1459
  }));
1396
1460
  let m = a.formulas, h = m ? m.length : 0;
1397
1461
  if (h !== 0 || d) {
1398
1462
  t.start("cfRule", p);
1399
1463
  for (let e = 0; e < h; e++) t.start("formula"), t.text(m[e]), t.end("formula");
1400
- if (d?.type === s.ScaleType.ColorScale) {
1464
+ if (d?.type === l.ScaleType.ColorScale) {
1401
1465
  let e = d.stops ?? [];
1402
1466
  t.start("colorScale");
1403
- for (let n = 0; n < e.length; n++) St(t, e[n]);
1404
- for (let n = 0; n < e.length; n++) U(t, r, e[n].color, "color");
1467
+ for (let n = 0; n < e.length; n++) Yt(t, e[n]);
1468
+ for (let n = 0; n < e.length; n++) H(t, r, e[n].color, "color");
1405
1469
  t.end("colorScale");
1406
- } else if (d?.type === s.ScaleType.DataBar) {
1470
+ } else if (d?.type === l.ScaleType.DataBar) {
1407
1471
  let e = d.stops ?? [];
1408
1472
  t.start("dataBar", {
1409
1473
  minLength: d.minLength,
1410
1474
  maxLength: d.maxLength,
1411
1475
  showValue: Z(d.showValue)
1412
1476
  });
1413
- for (let n = 0; n < e.length; n++) St(t, e[n]);
1414
- d.color && U(t, r, d.color, "color"), t.end("dataBar");
1415
- } else if (d?.type === s.ScaleType.IconSet) {
1477
+ for (let n = 0; n < e.length; n++) Yt(t, e[n]);
1478
+ d.color && H(t, r, d.color, "color"), t.end("dataBar");
1479
+ } else if (d?.type === l.ScaleType.IconSet) {
1416
1480
  let e = d.stops ?? [];
1417
1481
  t.start("iconSet", {
1418
1482
  iconSet: d.iconSet,
1419
1483
  reverse: Z(d.reverse),
1420
1484
  showValue: Z(d.showValue)
1421
1485
  });
1422
- for (let n = 0; n < e.length; n++) St(t, e[n]);
1486
+ for (let n = 0; n < e.length; n++) Yt(t, e[n]);
1423
1487
  t.end("iconSet");
1424
1488
  }
1425
1489
  f && (t.start("extLst"), t.start("ext", {
@@ -1428,25 +1492,34 @@ function Et(e, t, r, i, a, o, c, l, u) {
1428
1492
  }), t.start("x14:id"), t.text(f), t.end("x14:id"), t.end("ext"), t.end("extLst")), t.end("cfRule");
1429
1493
  } else t.empty("cfRule", p);
1430
1494
  }
1431
- function Dt(e) {
1432
- return e.split(" ")[0].split(":")[0];
1495
+ function en(e) {
1496
+ let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1497
+ for (let e = 0; e < r.length; e++) {
1498
+ if (!r[e]) continue;
1499
+ let i = a.fastStringToRange(r[e]);
1500
+ i.rowStart < t && (t = i.rowStart), i.colStart < n && (n = i.colStart);
1501
+ }
1502
+ return a.cellToString({
1503
+ rowIndex: t,
1504
+ colIndex: n
1505
+ });
1433
1506
  }
1434
- function Ot(e) {
1507
+ function tn(e) {
1435
1508
  if (typeof e == "string") return e.split(",").join(" ");
1436
1509
  if (Array.isArray(e)) {
1437
1510
  let t = [];
1438
1511
  for (let n = 0; n < e.length; n++) {
1439
- let r = m.rangeToString(e[n]);
1512
+ let r = a.rangeToString(e[n]);
1440
1513
  r && t.push(r);
1441
1514
  }
1442
1515
  return t.length > 0 ? t.join(" ") : null;
1443
1516
  }
1444
- return m.rangeToString(e);
1517
+ return a.rangeToString(e);
1445
1518
  }
1446
1519
  function Z(e) {
1447
1520
  if (e !== void 0) return e ? "1" : "0";
1448
1521
  }
1449
- function kt(e) {
1522
+ function nn(e) {
1450
1523
  if (typeof e != "string") return !1;
1451
1524
  let t = !1;
1452
1525
  for (let n = 0; n < e.length; n++) {
@@ -1456,18 +1529,63 @@ function kt(e) {
1456
1529
  }
1457
1530
  return !1;
1458
1531
  }
1459
- function At(e) {
1532
+ function rn(e) {
1460
1533
  let t = e.formulas, n = t ? t.length : 0;
1461
- for (let e = 0; e < n; e++) if (kt(t[e])) return !0;
1534
+ for (let e = 0; e < n; e++) if (nn(t[e])) return !0;
1462
1535
  return !1;
1463
1536
  }
1464
- var jt = {
1537
+ function an(e) {
1538
+ let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1539
+ for (let e = 0; e < r.length; e++) {
1540
+ if (!r[e]) continue;
1541
+ let i = a.fastStringToRange(r[e]);
1542
+ i.rowStart < t && (t = i.rowStart), i.colStart < n && (n = i.colStart);
1543
+ }
1544
+ return t === 2 ** 53 - 1 ? null : {
1545
+ rowIndex: t,
1546
+ colIndex: n
1547
+ };
1548
+ }
1549
+ function on(e, t, n) {
1550
+ if (typeof e != "string" || !e || !t || !n) return e;
1551
+ try {
1552
+ let r = n.parse(e, t);
1553
+ return r && h.image(n.spell(r, !0), { at: t }) || e;
1554
+ } catch {
1555
+ return e;
1556
+ }
1557
+ }
1558
+ function sn(e, t, n) {
1559
+ let r, i = e?.stops;
1560
+ if (!i || !n) return e;
1561
+ for (let e = 0; e < i.length; e++) {
1562
+ let a = i[e]?.value;
1563
+ if (typeof a != "string") continue;
1564
+ let o = on(a, t, n);
1565
+ o !== a && (r ||= [...i], r[e] = {
1566
+ ...i[e],
1567
+ value: o
1568
+ });
1569
+ }
1570
+ return r ? {
1571
+ ...e,
1572
+ stops: r
1573
+ } : e;
1574
+ }
1575
+ function cn(e, t, n, r) {
1576
+ if (!r?.xml) return;
1577
+ let i = e.addPart("legacyDrawing", r);
1578
+ t.empty(n, { "r:id": i.relId });
1579
+ }
1580
+ var ln = (e) => e.content?.type !== "control", un = (e, t, n) => {
1581
+ e.start(t), e.start("xdr:col"), e.text(n.c ?? 0), e.end("xdr:col"), e.start("xdr:colOff"), e.text(J(n.x)), e.end("xdr:colOff"), e.start("xdr:row"), e.text(n.r ?? 0), e.end("xdr:row"), e.start("xdr:rowOff"), e.text(J(n.y)), e.end("xdr:rowOff"), e.end(t);
1582
+ }, dn = {
1465
1583
  r: void 0,
1466
1584
  s: void 0,
1467
1585
  t: void 0,
1468
1586
  cm: void 0,
1469
1587
  vm: void 0
1470
- }, Mt = {
1588
+ }, fn = {
1471
1589
  r: void 0,
1472
1590
  s: void 0,
1473
1591
  customFormat: void 0,
@@ -1477,29 +1595,29 @@ var jt = {
1477
1595
  "x14ac:dyDescent": "0.25",
1478
1596
  outlineLevel: void 0,
1479
1597
  collapsed: void 0
1480
- }, Nt = {
1598
+ }, pn = {
1481
1599
  t: void 0,
1482
1600
  aca: void 0,
1483
1601
  ref: void 0,
1484
1602
  ca: void 0,
1485
1603
  si: void 0
1486
- }, Pt = {
1604
+ }, mn = {
1487
1605
  t: "shared",
1488
1606
  aca: void 0,
1489
1607
  ref: void 0,
1490
1608
  ca: void 0,
1491
1609
  si: void 0
1492
- }, Ft = {
1610
+ }, hn = {
1493
1611
  t: "array",
1494
1612
  aca: void 0,
1495
1613
  ref: void 0,
1496
1614
  ca: void 0,
1497
1615
  si: void 0
1498
1616
  };
1499
- function It(e, t, n, r) {
1617
+ function gn(e, t, n, r) {
1500
1618
  n && (t.start(r), t.empty("latin", { typeface: n }), t.empty("ea", { typeface: "" }), t.empty("cs", { typeface: "" }), t.end(r));
1501
1619
  }
1502
- var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1620
+ var _n = (e) => e.toISOString().split(".")[0] + "Z", vn = (e, t, n) => {
1503
1621
  switch (t) {
1504
1622
  case "creator":
1505
1623
  e.start("dc:creator"), e.text(n), e.end("dc:creator");
@@ -1514,7 +1632,7 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1514
1632
  }
1515
1633
  }, Q = (e, t, n, r) => {
1516
1634
  t.start(n), t.text(r), t.end(n);
1517
- }, zt = {
1635
+ }, yn = {
1518
1636
  minSupportedVersion: "120000",
1519
1637
  copy: "1",
1520
1638
  pasteAll: "1",
@@ -1526,17 +1644,17 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1526
1644
  clearComments: "1",
1527
1645
  assign: "1",
1528
1646
  coerce: "1"
1529
- }, Bt = (e, t, r = n.EmptyArray) => {
1647
+ }, bn = (e, t, r = n.EmptyArray) => {
1530
1648
  if (!t) return { ...r };
1531
1649
  let { text: i, runs: a, color: o, size: s, kern: c, weight: l, style: u, b: d, i: f, spc: p, baseline: m, ...h } = t, g = {
1532
1650
  ...r,
1533
1651
  ...h
1534
1652
  };
1535
- return s !== void 0 && (g.sz = "" + tt(s)), d !== void 0 && (g.b = d ? "1" : "0"), l !== void 0 && (g.b = l > 500 ? "1" : "0"), f !== void 0 && (g.i = f ? "1" : "0"), u !== void 0 && (g.i = u === "italic" ? "1" : "0"), c !== void 0 && (g.kern = "" + tt(c)), p !== void 0 && (g.spc = "" + tt(p)), m !== void 0 && (g.baseline = "" + tt(m)), g;
1536
- }, Vt = (e, t, n) => {
1653
+ return s !== void 0 && (g.sz = "" + Ot(s)), d !== void 0 && (g.b = d ? "1" : "0"), l !== void 0 && (g.b = l > 500 ? "1" : "0"), f !== void 0 && (g.i = f ? "1" : "0"), u !== void 0 && (g.i = u === "italic" ? "1" : "0"), c !== void 0 && (g.kern = "" + Ot(c)), p !== void 0 && (g.spc = "" + Ot(p)), m !== void 0 && (g.baseline = "" + Ot(m)), g;
1654
+ }, xn = (e, t, n) => {
1537
1655
  if (!n) return;
1538
1656
  let r = e.getXMLWriter();
1539
- r.start("txBody"), r.pushDefaultNamespace("a"), Ut(e, t, {
1657
+ r.start("txBody"), r.pushDefaultNamespace("a"), Cn(e, t, {
1540
1658
  vertOverflow: "clip",
1541
1659
  horzOverflow: "clip",
1542
1660
  rtlCol: "0",
@@ -1545,28 +1663,28 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1545
1663
  if (!n) return;
1546
1664
  let r = e.getXMLWriter();
1547
1665
  r.pushDefaultNamespace("a"), typeof n == "string" && (n = { runs: [{ text: n }] }), r.start("p"), r.empty("pPr", { algn: "ctr" });
1548
- let i = Bt(0, n, {
1549
- ...Wt,
1666
+ let i = bn(0, n, {
1667
+ ...wn,
1550
1668
  size: t.getDefaultFontSize()
1551
1669
  }), a = n?.runs, o = a ? a.length : 0;
1552
1670
  if (o > 0) for (let e = 0; e < o; e++) {
1553
1671
  let n = a[e];
1554
1672
  r.start("r", {});
1555
- let i = Bt(0, n, Wt), o = n.color;
1556
- o ? (r.start("rPr", i), G(0, r, o, t), r.end("rPr")) : r.empty("rPr", i), r.start("t"), r.text(n?.text ?? ""), r.end("t"), r.end("r");
1673
+ let i = bn(0, n, wn), o = n.color;
1674
+ o ? (r.start("rPr", i), W(0, r, o, t), r.end("rPr")) : r.empty("rPr", i), r.start("t"), r.text(n?.text ?? ""), r.end("t"), r.end("r");
1557
1675
  }
1558
1676
  else r.empty("endParaRPr", i);
1559
1677
  r.end("p"), r.popDefaultNamespace();
1560
1678
  })(e, t, n), r.popDefaultNamespace(), r.end("txBody");
1561
- }, Ht = (e, t, n) => {
1679
+ }, Sn = (e, t, n) => {
1562
1680
  if (!n) return;
1563
- let r = e.getXMLWriter(), i = Bt(0, n);
1681
+ let r = e.getXMLWriter(), i = bn(0, n);
1564
1682
  r.empty("defRPr", i);
1565
- }, Ut = (e, t, n) => {
1683
+ }, Cn = (e, t, n) => {
1566
1684
  if (!n) return;
1567
1685
  let r = e.getXMLWriter(), { spAutoFit: i, ...a } = n;
1568
1686
  i ? (r.start("bodyPr", a), r.empty("spAutoFit"), r.end("bodyPr")) : r.empty("bodyPr", a);
1569
- }, Wt = Object.freeze({ lang: "en-US" }), Gt = (e, t) => {
1687
+ }, wn = Object.freeze({ lang: "en-US" }), Tn = (e, t) => {
1570
1688
  if (t.length !== 0) {
1571
1689
  e.start("a:extLst");
1572
1690
  for (let n of t) {
@@ -1575,22 +1693,22 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1575
1693
  }
1576
1694
  e.end("a:extLst");
1577
1695
  }
1578
- }, Kt = async (e, t, n, r, i) => {
1696
+ }, En = async (e, t, n, r, i) => {
1579
1697
  let a, o = e.getSharedStates(), s = r.getContent().getResource(), c = await s.getExternalURI();
1580
- if (c) a = e.addExternal($e, c);
1698
+ if (c) a = e.addExternal(G, c);
1581
1699
  else if (a = n.get(s), !a) {
1582
- let t = o.get("imagesWritten");
1583
- t || (t = /* @__PURE__ */ new Map(), o.set("imagesWritten", t));
1700
+ let t = o.get(K);
1701
+ t || (t = /* @__PURE__ */ new Map(), o.set(K, t));
1584
1702
  let r = t.get(s);
1585
1703
  if (!r) {
1586
1704
  let e = await s.toBuffer();
1587
1705
  r = {
1588
1706
  bytes: new Uint8Array(e),
1589
- type: await s.getType() ?? et,
1707
+ type: await s.getType() ?? Dt,
1590
1708
  index: t.size + 1
1591
1709
  }, t.set(s, r);
1592
1710
  }
1593
- a = e.addBinary(r.bytes, r.type.mime, $e, `../media/image${r.index}.${r.type.ext}`, !0), n.set(s, a);
1711
+ a = e.addBinary(r.bytes, r.type.mime, G, `../media/image${r.index}.${r.type.ext}`, !0), n.set(s, a);
1594
1712
  }
1595
1713
  let l = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1596
1714
  c ? l["r:link"] = a.relId : l["r:embed"] = a.relId;
@@ -1604,19 +1722,15 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1604
1722
  }
1605
1723
  ]);
1606
1724
  let d = e.getXMLWriter();
1607
- d.start("pic"), d.start("nvPicPr"), tn(e, d, r, i, t), rn(e, d, r, i), d.end("nvPicPr"), d.start("blipFill"), d.start("a:blip", l), Gt(d, u), d.end("a:blip"), d.start("a:stretch"), d.empty("a:fillRect"), d.end("a:stretch"), d.end("blipFill"), $t(e, t, n, r, i), d.end("pic");
1608
- }, qt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart", Jt = async (e, t, n, r, i, a) => {
1609
- let o = i.content?.json, s = o?.xml, c = o?.chartRelId, l = o?.chartTargetPath;
1610
- if (!s || !c || !l) return $(e, t, n, r, i);
1611
- let u, d = e.getSharedStates(), f = d.get("claimedChartTargets");
1612
- if (f || (f = /* @__PURE__ */ new Set(), d.set("claimedChartTargets", f)), f.has(l)) {
1613
- let a = e.forkPreservedPart(l, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", qt, "../charts/chart{n}.xml");
1614
- if (!a?.relId) return $(e, t, n, r, i);
1615
- u = a.relId;
1616
- } else f.add(l), u = e.addPreservedRelationship(qt, l, c);
1617
- let p = u === c ? s : s.replace(`r:id="${c}"`, `r:id="${u}"`);
1618
- a !== void 0 && typeof o?.sourceId == "number" && (p = p.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`)), e.getXMLWriter().raw(p);
1619
- }, Yt = async (e, t, n, r, i) => $(e, t, n, r, i), Xt = async (e, t, n, r, i) => $(e, t, n, r, i), Zt = async (e, t, n, r, i) => $(e, t, n, r, i), Qt = async (e, t, n, r, i, a) => {
1725
+ d.start("pic"), d.start("nvPicPr"), Pn(e, d, r, i, t), In(e, d, r, i), d.end("nvPicPr"), d.start("blipFill"), d.start("a:blip", l), Tn(d, u), d.end("a:blip"), d.start("a:stretch"), d.empty("a:fillRect"), d.end("a:stretch"), d.end("blipFill"), Mn(e, t, n, r, i), d.end("pic");
1726
+ }, Dn = async (e, t, n, r, i, a) => {
1727
+ let o = i.content?.json, s = o?.xml, c = o?.part;
1728
+ if (!s || !c) return $(e, t, n, r, i);
1729
+ let l = await et(c, e, "../charts/chart{n}.xml");
1730
+ if (!l?.relId) return $(e, t, n, r, i);
1731
+ let u = l.relId === c.id ? s : s.replace(`r:id="${c.id}"`, `r:id="${l.relId}"`);
1732
+ a !== void 0 && typeof i.content?.json?.sourceId == "number" && (u = u.replace(`cNvPr id="${i.content.json.sourceId}"`, `cNvPr id="${a}"`)), e.getXMLWriter().raw(u);
1733
+ }, On = async (e, t, n, r, i) => $(e, t, n, r, i), kn = async (e, t, n, r, i) => $(e, t, n, r, i), An = async (e, t, n, r, i) => $(e, t, n, r, i), jn = async (e, t, n, r, i, a) => {
1620
1734
  let o = i.content?.json, s = o?.xml;
1621
1735
  if (!s) return $(e, t, n, r, i);
1622
1736
  let c = a !== void 0 && typeof o?.sourceId == "number" ? s.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`) : s;
@@ -1624,10 +1738,10 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1624
1738
  }, $ = async (e, t, n, r, i) => {
1625
1739
  (async (e, t, n, r, i) => {
1626
1740
  let a = e.getXMLWriter(), o = {}, s = i.content?.json, c = s?.type ?? "sp", l = t.getStyles();
1627
- c === "cxnSp" ? (o.macro = "", a.start("cxnSp", o), a.start("nvCxnSpPr"), tn(e, a, r, i, t), nn(e, a, r, i, t), a.start("cNvCxnSpPr"), a.empty("a:stCnx", {
1741
+ c === "cxnSp" ? (o.macro = "", a.start("cxnSp", o), a.start("nvCxnSpPr"), Pn(e, a, r, i, t), Fn(e, a, r, i, t), a.start("cNvCxnSpPr"), a.empty("a:stCnx", {
1628
1742
  id: "0",
1629
1743
  idx: "0"
1630
- }), a.end("cNvCxnSpPr"), a.end("nvCxnSpPr"), $t(e, t, n, r, i), en(e, t, n, r, i), Vt(e, l, s?.text), a.end("cxnSp")) : c === "grpSp" || (o.macro = "", o.textlink = "", a.start("sp", o), a.start("nvSpPr"), tn(e, a, r, i, t), nn(e, a, r, i, t), a.end("nvSpPr"), $t(e, t, n, r, i), en(e, t, n, r, i), Vt(e, l, s?.text), a.end("sp"));
1744
+ }), a.end("cNvCxnSpPr"), a.end("nvCxnSpPr"), Mn(e, t, n, r, i), Nn(e, t, n, r, i), xn(e, l, s?.text), a.end("cxnSp")) : c === "grpSp" || (o.macro = "", o.textlink = "", a.start("sp", o), a.start("nvSpPr"), Pn(e, a, r, i, t), Fn(e, a, r, i, t), a.end("nvSpPr"), Mn(e, t, n, r, i), Nn(e, t, n, r, i), xn(e, l, s?.text), a.end("sp"));
1631
1745
  })(e, t, n, r, {
1632
1746
  ...i,
1633
1747
  content: {
@@ -1645,13 +1759,13 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1645
1759
  }
1646
1760
  }
1647
1761
  });
1648
- }, $t = (e, t, n, r, i) => {
1762
+ }, Mn = (e, t, n, r, i) => {
1649
1763
  let a = e.getXMLWriter(), o = i.content?.json, s = o?.geometry ?? "rect", c = t.getStyles();
1650
- a.start("spPr"), a.pushDefaultNamespace("a"), an(a, r, i), a.start("prstGeom", { prst: s }), a.empty("avLst"), a.end("prstGeom"), Ye(e, c, o), a.popDefaultNamespace(), a.end("spPr");
1651
- }, en = (e, t, n, r, i) => {
1764
+ a.start("spPr"), a.pushDefaultNamespace("a"), Ln(a, r, i), a.start("prstGeom", { prst: s }), a.empty("avLst"), a.end("prstGeom"), Ct(e, c, o), a.popDefaultNamespace(), a.end("spPr");
1765
+ }, Nn = (e, t, n, r, i) => {
1652
1766
  let a = e.getXMLWriter();
1653
1767
  a.start("style"), a.pushDefaultNamespace("a"), a.start("lnRef", { idx: "1" }), a.start("schemeClr", { val: "accent1" }), a.empty("shade", { val: "15000" }), a.end("schemeClr"), a.end("lnRef"), a.start("fillRef", { idx: "1" }), a.empty("schemeClr", { val: "accent1" }), a.end("fillRef"), a.start("effectRef", { idx: "0" }), a.empty("schemeClr", { val: "accent1" }), a.end("effectRef"), a.start("fontRef", { idx: "minor" }), a.empty("schemeClr", { val: "lt1" }), a.end("fontRef"), a.popDefaultNamespace(), a.end("style");
1654
- }, tn = (e, t, r, i, a) => {
1768
+ }, Pn = (e, t, r, i, a) => {
1655
1769
  let o = e.getSharedStates(), s = o.get("uniqueIdCounter");
1656
1770
  s || (s = /* @__PURE__ */ new Map(), o.set("uniqueIdCounter", s));
1657
1771
  let c = s.get(a) ?? 1;
@@ -1669,43 +1783,109 @@ var Lt = (e) => e.toISOString().split(".")[0] + "Z", Rt = (e, t, n) => {
1669
1783
  "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1670
1784
  id: `{${n.uuidV4().toUpperCase()}}`
1671
1785
  }
1672
- ]), t.start("cNvPr", l), Gt(t, u), t.end("cNvPr");
1673
- }, nn = (e, t, n, r, i) => {
1786
+ ]), t.start("cNvPr", l), Tn(t, u), t.end("cNvPr");
1787
+ }, Fn = (e, t, n, r, i) => {
1674
1788
  t.empty("cNvSpPr");
1675
- }, rn = (e, t, n, r) => {
1789
+ }, In = (e, t, n, r) => {
1676
1790
  let i = {};
1677
1791
  if (r.lockAspect && (i.noChangeAspect = "1"), r.locks) for (let e of Object.keys(r.locks)) !0 === r.locks[e] && (i[e] = "1");
1678
1792
  t.start("cNvPicPr", {}), t.empty("a:picLocks", i), t.end("cNvPicPr");
1679
- }, an = (e, t, n) => {
1793
+ }, Ln = (e, t, n) => {
1680
1794
  let r = t.getBounds(), i = {}, a = n.rotation;
1681
- a !== void 0 && a !== 0 && (i.rot = "" + J(a)), e.start("xfrm", i), e.start("off", {
1682
- x: q(r.x),
1683
- y: q(r.y)
1795
+ a !== void 0 && a !== 0 && (i.rot = "" + Y(a)), e.start("xfrm", i), e.start("off", {
1796
+ x: J(r.x),
1797
+ y: J(r.y)
1684
1798
  }), e.end("off"), e.start("ext", {
1685
- cx: q(r.width),
1686
- cy: q(r.height)
1799
+ cx: J(r.width),
1800
+ cy: J(r.height)
1687
1801
  }), e.end("ext"), e.end("xfrm");
1688
- }, on = (e, t, n) => {
1689
- e.start(t), e.start("col"), e.text(n.c ?? 0), e.end("col"), e.start("colOff"), e.text(q(n.x)), e.end("colOff"), e.start("row"), e.text(n.r ?? 0), e.end("row"), e.start("rowOff"), e.text(q(n.y)), e.end("rowOff"), e.end(t);
1690
- }, sn = 0, cn = /* @__PURE__ */ new Map([
1691
- ["average", 101],
1692
- ["countnums", 102],
1693
- ["count", 103],
1694
- ["max", 104],
1695
- ["min", 105],
1696
- ["product", 106],
1697
- ["stddev", 107],
1698
- ["stddevp", 108],
1699
- ["sum", 109],
1700
- ["var", 110]
1701
- ]), ln = /* @__PURE__ */ new Map();
1702
- cn.forEach((e, t) => {
1703
- ln.set(e, t);
1704
- });
1705
- var un = (e, t, n, r, i, a = "0") => {
1802
+ }, Rn = (e, t, n) => {
1803
+ e.start(t), e.start("col"), e.text(n.c ?? 0), e.end("col"), e.start("colOff"), e.text(J(n.x)), e.end("colOff"), e.start("row"), e.text(n.r ?? 0), e.end("row"), e.start("rowOff"), e.text(J(n.y)), e.end("rowOff"), e.end(t);
1804
+ }, zn = async (e, t, n) => {
1805
+ let r = await n.getExternalURI();
1806
+ if (r) return void e.addExternal(G, r);
1807
+ let i = e.getSharedStates(), a = i.get(K);
1808
+ a || (a = /* @__PURE__ */ new Map(), i.set(K, a));
1809
+ let o = a.get(n);
1810
+ if (!o) {
1811
+ let e = await n.toBuffer();
1812
+ o = {
1813
+ bytes: new Uint8Array(e),
1814
+ type: await n.getType() ?? Dt,
1815
+ index: a.size + 1
1816
+ }, a.set(n, o);
1817
+ }
1818
+ let s = e.addBinary(o.bytes, o.type.mime, G, `../media/image${o.index}.${o.type.ext}`, !0, t);
1819
+ s.relId !== t && e.log(`Legacy drawing image '${t}' was written as '${s.relId}'; the markup will not find it.`);
1820
+ };
1821
+ function Bn(e, t, n, r, i, a, o, s) {
1822
+ let c = {
1823
+ ref: t,
1824
+ dT: (i ?? /* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z"),
1825
+ personId: r ? Vn(r) : void 0,
1826
+ id: Vn(n),
1827
+ parentId: o ? Vn(o) : void 0,
1828
+ done: s ? "1" : void 0
1829
+ };
1830
+ e.start("threadedComment", c), e.start("text", oe.test(a) || /[\n\r]/.test(a) ? b : void 0), e.text(a), e.end("text"), e.end("threadedComment");
1831
+ }
1832
+ function Vn(e) {
1833
+ return `{${e.replace(/^\{|\}$/g, "").toUpperCase()}}`;
1834
+ }
1835
+ var Hn = 0, Un = (e, t, n, r) => {
1836
+ let i = e.getSharedStates().get(A);
1837
+ if (!i) return r;
1838
+ try {
1839
+ let e = t.getDataRange().getCoords(), a = {
1840
+ rowIndex: e.rowStart,
1841
+ colIndex: e.colStart + n
1842
+ }, o = i.parse(r, a);
1843
+ return o && h.image(i.spell(o, !1, t.getName()), { at: a }) || r;
1844
+ } catch {
1845
+ return r;
1846
+ }
1847
+ }, Wn = /* @__PURE__ */ new Map([
1848
+ [101, "average"],
1849
+ [102, "countNums"],
1850
+ [103, "count"],
1851
+ [104, "max"],
1852
+ [105, "min"],
1853
+ [107, "stdDev"],
1854
+ [109, "sum"],
1855
+ [110, "var"]
1856
+ ]), Gn = {
1857
+ rowIndex: 0,
1858
+ colIndex: 0
1859
+ };
1860
+ function Kn(e, t, n, i) {
1861
+ if (i == null) return;
1862
+ Gn.rowIndex = t, Gn.colIndex = n;
1863
+ let o, s, c = a.cellToString(Gn);
1864
+ switch (typeof i) {
1865
+ case "number":
1866
+ s = "" + i;
1867
+ break;
1868
+ case "boolean":
1869
+ o = "b", s = i ? "1" : "0";
1870
+ break;
1871
+ case "string":
1872
+ o = "str", s = i;
1873
+ break;
1874
+ default: {
1875
+ let e = i;
1876
+ if (e.t !== "e") return;
1877
+ o = "e", s = r.getBuiltInByCode(e.v)?.getLabel() ?? r.BuiltIn.Value.getLabel();
1878
+ }
1879
+ }
1880
+ e.start("cell", o ? {
1881
+ r: c,
1882
+ t: o
1883
+ } : { r: c }), e.start("v"), e.text(s), e.end("v"), e.end("cell");
1884
+ }
1885
+ var qn = (e, t, n, r, i, a = "0") => {
1706
1886
  let o = i?.color, s = { idx: i?.idx ?? a };
1707
- o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), V(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
1708
- }, dn = Object.freeze([
1887
+ o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), B(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
1888
+ }, Jn = Object.freeze([
1709
1889
  {
1710
1890
  type: "axisTitle",
1711
1891
  fontRef: { color: "tx1 lumMod 65 lumOff 35" },
@@ -2057,7 +2237,7 @@ var un = (e, t, n, r, i, a = "0") => {
2057
2237
  fill: { type: "none" },
2058
2238
  stroke: {}
2059
2239
  }
2060
- ]), fn = Object.freeze([
2240
+ ]), Yn = Object.freeze([
2061
2241
  [0, 0],
2062
2242
  [6e4, 0],
2063
2243
  [8e4, 2e4],
@@ -2067,8 +2247,8 @@ var un = (e, t, n, r, i, a = "0") => {
2067
2247
  [7e4, 3e4],
2068
2248
  [7e4, 0],
2069
2249
  [5e4, 5e4]
2070
- ]), pn = [
2071
- new class extends F {
2250
+ ]), Xn = [
2251
+ new class extends L {
2072
2252
  constructor() {
2073
2253
  super({
2074
2254
  kind: "workbook",
@@ -2090,24 +2270,39 @@ var un = (e, t, n, r, i, a = "0") => {
2090
2270
  "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2091
2271
  "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2092
2272
  });
2093
- let r = /* @__PURE__ */ new Set(), i = e.getCalculation().getNamedFormulas().getItems();
2094
- for (let e = 0; e < i.length; e++) r.add(i[e].getName().toUpperCase());
2095
- let a = T(r), o = await e.toJSON({
2273
+ let r = t.getSharedStates().get(be), i = await e.toJSON({
2096
2274
  ignoreData: !0,
2097
- ignoreResources: !0,
2275
+ resources: (e, t) => (r?.set(t, e), null),
2098
2276
  includeHeaderStyles: !0,
2099
- formulaTransform: a,
2100
2277
  splitDirectBorders: !0
2101
2278
  });
2102
- (function(e, t, n) {
2103
- let r = {};
2104
- n.getRuntime().isDate1904() && (r.date1904 = "1"), t.empty("workbookPr", r);
2105
- })(0, n, e), function(e, t, n, r) {
2279
+ t.getSharedStates().set(A, E(i.names, function(e) {
2280
+ let t = [], n = e.sheets ?? [];
2281
+ for (let e = 0; e < n.length; e++) {
2282
+ let r = n[e]?.sheet?.tables;
2283
+ if (r) for (let e = 0; e < r.length; e++) {
2284
+ let n = r[e], i = Array.isArray(n) ? n[1]?.name : n?.v?.name;
2285
+ i && t.push(String(i));
2286
+ }
2287
+ }
2288
+ return t;
2289
+ }(i))), function(e, t) {
2290
+ let n = e.getSharedStates().get(it);
2291
+ n && t.empty("fileVersion", n);
2292
+ }(t, n), function(e, t, n, r) {
2293
+ let i = {}, a = n.getCodeName();
2294
+ a && (i.codeName = a), n.getRuntime().isDate1904() && (i.date1904 = "1"), r.updateLinks && (i.updateLinks = r.updateLinks), t.empty("workbookPr", i);
2295
+ }(0, n, e, i), function(e, t, n, r) {
2106
2296
  let i = r.protection;
2107
- if (!i) return;
2297
+ if (!i || i.workbook) return;
2108
2298
  let a = {};
2109
- Pe(i.password ?? {}, a, "workbook"), Pe(i.revisionsPassword ?? {}, a, "revisions"), i.structure && (a.lockStructure = "1"), i.windows && (a.lockWindows = "1"), i.revision && (a.lockRevision = "1"), t.empty("workbookProtection", a);
2110
- }(0, n, 0, o), function(e, t, n) {
2299
+ Ke(i.password ?? {}, a, "workbook"), Ke(i.revisionsPassword ?? {}, a, "revisions");
2300
+ for (let e of ye) {
2301
+ let t = ae(e, i[e.key]);
2302
+ t !== null && (a[e.attribute] = t);
2303
+ }
2304
+ t.empty("workbookProtection", a);
2305
+ }(0, n, 0, i), function(e, t, n) {
2111
2306
  t.start("bookViews");
2112
2307
  let r = n.getView(), i = {};
2113
2308
  r.isShowHorizontalScrollbar() || (i.showHorizontalScroll = "0"), r.isShowVerticalScrollbar() || (i.showVerticalScroll = "0"), r.isShowTabs() || (i.showSheetTabs = "0");
@@ -2115,89 +2310,177 @@ var un = (e, t, n, r, i, a = "0") => {
2115
2310
  a !== 600 && (i.tabRatio = a);
2116
2311
  let o = n.getSelectedSheet().getIndex();
2117
2312
  o !== 0 && (i.activeTab = "" + o), t.empty("workbookView", i), t.end("bookViews");
2118
- }(0, n, e, o.view), n.start("sheets");
2119
- let s = t.getSharedStates();
2120
- s.set("formulaTransform", a);
2121
- let c = e.getStrings().beginPersist();
2122
- s.set("persistStrings", c);
2123
- let l = new Fe();
2124
- s.set("metaCollector", l);
2125
- let u = new Ie(l, t.warn.bind(t));
2126
- s.set("persistRichTypes", u);
2313
+ }(0, n, e, i.view);
2314
+ let a = await (async (e, t) => {
2315
+ let n = [], r = t ? t.length : 0;
2316
+ if (r === 0) return n;
2317
+ let i = /* @__PURE__ */ new Map();
2318
+ e.getSharedStates().set("pivotCachePaths", i);
2319
+ for (let a = 0; a < r; a++) {
2320
+ let r = t[a], o = r.cacheId, s = r.part;
2321
+ if (s?.xml && !i.has(o)) try {
2322
+ let t = await et({
2323
+ ...s,
2324
+ type: s.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
2325
+ contentType: s.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
2326
+ }, e, "/xl/pivotCache/pivotCacheDefinition{n}.xml");
2327
+ if (!t?.relId) continue;
2328
+ i.set(o, t.path), n.push({
2329
+ cacheId: o,
2330
+ relId: t.relId
2331
+ });
2332
+ } catch (t) {
2333
+ e.log(`Unable to write the pivot cache ${o}; the pivot tables on it will be dropped.`, t);
2334
+ }
2335
+ }
2336
+ return n;
2337
+ })(t, i.pivotCaches);
2338
+ (function(e, t) {
2339
+ t.getComments().some((e) => !e.isNote()) && e.addPart("persons", t.getPeople());
2340
+ })(t, e), n.start("sheets");
2341
+ let o = t.getSharedStates(), s = e.getStrings().beginPersist();
2342
+ o.set("persistStrings", s);
2343
+ let c = new Ye();
2344
+ o.set("metaCollector", c);
2345
+ let l = new Xe(c, t.log.bind(t));
2346
+ o.set("persistRichTypes", l), o.set(qe, new Je(i.styles, e.getStyles()));
2127
2347
  try {
2128
- let r = e.getSheets().getItems({ visibility: h.Visibility.VeryHidden }), i = o.sheets, a = e.getSelectedSheet(), l = r.length;
2348
+ let r = e.getSheets().getItems({ visibility: u.Visibility.VeryHidden }), a = i.sheets, c = e.getSelectedSheet(), l = r.length, d = ((e, t) => {
2349
+ let n = Array(t), r = /* @__PURE__ */ new Set(), i = 1;
2350
+ for (let a = 0; a < t; a++) {
2351
+ let t = e?.[a]?.sheetId;
2352
+ t === void 0 || !Number.isInteger(t) || t < 1 || r.has(t) || (r.add(t), n[a] = t, t >= i && (i = t + 1));
2353
+ }
2354
+ for (let e = 0; e < t; e++) if (n[e] === void 0) {
2355
+ for (; r.has(i);) i++;
2356
+ r.add(i), n[e] = i++;
2357
+ }
2358
+ return n;
2359
+ })(a, l), f = ((e, t, n) => {
2360
+ let r = t.length, i = Array(r), a = new Set(n?.values() ?? []), o = /* @__PURE__ */ new Set();
2361
+ for (let a = 0; a < r; a++) {
2362
+ let r = e?.[a]?.sheetId;
2363
+ if (r === void 0 || t[a] !== r) continue;
2364
+ let s = n?.get(r);
2365
+ s && !o.has(s) && (o.add(s), i[a] = s);
2366
+ }
2367
+ let s = 1;
2368
+ for (let e = 0; e < r; e++) {
2369
+ if (i[e]) continue;
2370
+ let t;
2371
+ do
2372
+ t = `xl/worksheets/sheet${s++}.xml`;
2373
+ while (a.has(t) || o.has(t));
2374
+ o.add(t), i[e] = t;
2375
+ }
2376
+ return i;
2377
+ })(a, d, o.get(at));
2129
2378
  for (let e = 0; e < l; e++) {
2130
- let o = r[e], s = "" + (o.getIndex() + 1), l = {
2131
- name: o.getName(),
2132
- sheetId: s
2133
- }, u = o.getVisibility();
2379
+ let i = r[e], o = "" + d[e], l = {
2380
+ name: i.getName(),
2381
+ sheetId: o
2382
+ }, u = i.getVisibility();
2134
2383
  u === "hidden" ? l.state = "hidden" : u === "veryHidden" && (l.state = "veryHidden");
2135
- let d = i[e].sheet;
2384
+ let p = a[e].sheet;
2136
2385
  l["r:id"] = t.addPart("worksheet", {
2137
- model: o,
2138
- isSelected: a === o,
2139
- json: d,
2140
- persistStrings: c
2141
- }).relId, n.empty("sheet", l);
2386
+ model: i,
2387
+ isSelected: c === i,
2388
+ json: p,
2389
+ persistStrings: s
2390
+ }, "/" + f[e]).relId, n.empty("sheet", l);
2142
2391
  }
2143
2392
  await t.waitEmit();
2144
- let u = e.getTheme();
2393
+ let p = e.getTheme();
2145
2394
  t.addPart("theme", {
2146
- model: u,
2147
- json: o.theme
2395
+ model: p,
2396
+ json: i.theme
2148
2397
  }), await t.waitEmit(), t.addPart("styles", {
2149
2398
  styles: e.getStyles(),
2150
2399
  theme: e.getTheme(),
2151
- json: o.styles
2400
+ json: i.styles
2152
2401
  }), await t.waitEmit();
2153
- let d = await c.toJSONAsync();
2154
- d && d.length > 0 && (t.addPart("sharedStrings", {
2155
- model: d,
2156
- json: d
2402
+ let m = await s.toJSONAsync();
2403
+ m && m.length > 0 && (t.addPart("sharedStrings", {
2404
+ model: m,
2405
+ json: m
2157
2406
  }), await t.waitEmit());
2158
- let f = s.get("persistRichTypes");
2159
- f?.hasAny() && (t.addPart("richValue", f), t.addPart("richValueStructure", f), t.addPart("richValueTypes", null), await t.waitEmit());
2160
- let p = s.get("metaCollector");
2161
- p?.hasAny() && (t.addPart("metadata", p), await t.waitEmit()), s.delete("persistRichTypes"), s.delete("metaCollector"), s.delete("persistStrings");
2407
+ let h = o.get("persistRichTypes");
2408
+ h?.hasAny() && (t.addPart("richValue", h), t.addPart("richValueStructure", h), t.addPart("richValueTypes", null), await t.waitEmit());
2409
+ let g = o.get("metaCollector");
2410
+ g?.hasAny() && (t.addPart("metadata", g), await t.waitEmit()), o.delete("persistRichTypes"), o.delete("metaCollector"), o.delete("persistStrings");
2162
2411
  } catch (e) {
2163
2412
  throw e;
2164
2413
  } finally {
2165
- c.endPersist();
2414
+ s.endPersist();
2166
2415
  }
2167
- n.end("sheets"), function(e, t, n, r, i) {
2168
- let a = r.names, o = a ? a.length : 0;
2416
+ n.end("sheets"), function(e, t, n) {
2417
+ let r = n.externalBooks, i = r ? r.length : 0;
2418
+ if (i === 0) return;
2419
+ let a = e.getSharedStates().get(ot), o = /* @__PURE__ */ new Set();
2420
+ if (a) for (let e = 0; e < i; e++) !r[e] && a[e] && o.add(a[e]);
2421
+ let s = [], c = 1;
2422
+ for (let t = 0; t < i; t++) {
2423
+ let n = r[t];
2424
+ if (n) {
2425
+ let t;
2426
+ do
2427
+ t = `xl/externalLinks/externalLink${c++}.xml`;
2428
+ while (o.has(t));
2429
+ s.push(e.addPart("externalLink", n, "/" + t).relId);
2430
+ continue;
2431
+ }
2432
+ let i = a?.[t], l = i ? e.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", i) : null;
2433
+ l ? s.push(l) : e.log(`External link [${t + 1}] cannot be written and is being dropped; later links will renumber.`);
2434
+ }
2435
+ if (s.length !== 0) {
2436
+ t.start("externalReferences");
2437
+ for (let e = 0; e < s.length; e++) t.empty("externalReference", { "r:id": s[e] });
2438
+ t.end("externalReferences");
2439
+ }
2440
+ }(t, n, i), function(e, t, n, r) {
2441
+ let i = e.getSharedStates().get(A), a = r.names, o = a ? a.length : 0;
2169
2442
  if (o === 0) return;
2170
- let s = n.getCalculation().getNamedFormulas(), c = /* @__PURE__ */ new Map(), l = n.getSheets().getItems({ visibility: h.Visibility.VeryHidden });
2443
+ let s = r.externalBooks?.length ?? 0, c = /* @__PURE__ */ new Map(), l = n.getSheets().getItems({ visibility: u.Visibility.VeryHidden });
2171
2444
  for (let e = 0; e < l.length; e++) c.set(l[e].getName().toLowerCase(), e);
2172
2445
  t.start("definedNames");
2173
2446
  for (let n = 0; n < o; n++) {
2174
2447
  let r = a[n], o = { name: r.name };
2175
2448
  if (r.comment && (o.comment = r.comment), r.scope) {
2176
2449
  let t = c.get(r.scope.toLowerCase());
2177
- t === void 0 ? e.warn(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : o.localSheetId = "" + t;
2450
+ t === void 0 ? e.log(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : o.localSheetId = "" + t;
2178
2451
  }
2179
2452
  r.hidden && (o.hidden = "1");
2180
- let l = r.ref, u = s.getItems({
2181
- name: r.name,
2182
- scope: r.scope ?? null
2183
- })[0];
2184
- u && (l = u.getExpression({ formulaTransform: i })), t.start("definedName", o), t.text(l), t.end("definedName");
2453
+ let l = i.writeName(r.ref);
2454
+ for (let t of st(l)) t > s && e.log(`Defined name '${r.name}' cites external book [${t}], but only ${s} ${s === 1 ? "is" : "are"} written; Excel will report the file as needing repair.`);
2455
+ t.start("definedName", o), t.text(l), t.end("definedName");
2185
2456
  }
2186
2457
  t.end("definedNames");
2187
- }(t, n, e, o, a), function(e, t, n) {
2188
- let r = n.getCalculation().toJSON(), i = {}, a = (e, t) => {
2458
+ }(t, n, e, i), function(e, t, n) {
2459
+ let r = n.getCalculation().toJSON(), i = { calcId: e.getSharedStates().get("calcId") ?? "191029" }, a = (e, t) => {
2189
2460
  let n = r[e];
2190
2461
  typeof n == "boolean" && (i[t] = n ? "1" : "0");
2191
2462
  };
2192
2463
  if (r.calcMode) {
2193
- let e = Re[r.calcMode];
2464
+ let e = ct[r.calcMode];
2194
2465
  e && e !== "auto" && (i.calcMode = e);
2195
2466
  }
2196
- a("fullCalcOnLoad", "fullCalcOnLoad"), a("calcOnSave", "calcOnSave"), a("calcCompleted", "calcCompleted"), a("fullPrecision", "fullPrecision"), a("forceFullCalc", "forceFullCalc"), a("concurrentCalc", "concurrentCalc"), r.refMode && (i.refMode = r.refMode), r.iterate && (i.iterate = "1"), r.maxIterations !== void 0 && (i.iterateCount = String(r.maxIterations)), r.maxIterateChange !== void 0 && (i.iterateDelta = String(r.maxIterateChange)), Object.keys(i).length !== 0 && t.empty("calcPr", i);
2197
- }(0, n, e), n.end("workbook"), n.close();
2467
+ a("fullCalcOnLoad", "fullCalcOnLoad"), a("calcOnSave", "calcOnSave"), a("calcCompleted", "calcCompleted"), a("fullPrecision", "fullPrecision"), a("forceFullCalc", "forceFullCalc"), a("concurrentCalc", "concurrentCalc"), r.refMode && (i.refMode = r.refMode), r.iterate && (i.iterate = "1"), r.maxIteration !== void 0 && (i.iterateCount = String(r.maxIteration)), r.maxIterateChange !== void 0 && (i.iterateDelta = String(r.maxIterateChange)), t.empty("calcPr", i);
2468
+ }(t, n, e), function(e, t) {
2469
+ if (t.length !== 0) {
2470
+ e.start("pivotCaches");
2471
+ for (let n = 0; n < t.length; n++) e.empty("pivotCache", {
2472
+ cacheId: t[n].cacheId,
2473
+ "r:id": t[n].relId
2474
+ });
2475
+ e.end("pivotCaches");
2476
+ }
2477
+ }(n, a), function(e, t) {
2478
+ let n = e.getSharedStates().get("calcFeatures") ?? "<ext uri=\"{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}\" xmlns:xcalcf=\"http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures\"><xcalcf:calcFeatures><xcalcf:feature name=\"microsoft.com:RD\"/><xcalcf:feature name=\"microsoft.com:Single\"/><xcalcf:feature name=\"microsoft.com:FV\"/><xcalcf:feature name=\"microsoft.com:CNMTM\"/><xcalcf:feature name=\"microsoft.com:LET_WF\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext>";
2479
+ t.start("extLst"), t.raw(n), t.end("extLst");
2480
+ }(t, n), n.end("workbook"), n.close();
2198
2481
  }
2199
2482
  }(),
2200
- new class extends F {
2483
+ new class extends L {
2201
2484
  constructor() {
2202
2485
  super({
2203
2486
  kind: "worksheet",
@@ -2206,46 +2489,53 @@ var un = (e, t, n, r, i, a = "0") => {
2206
2489
  path: () => "/xl/worksheets/sheet{n}.xml"
2207
2490
  });
2208
2491
  }
2209
- async emit(r, a) {
2210
- let o = a.getXMLWriter(), c = r.model, l = r.json;
2211
- o.decl(), o.start("worksheet", {
2492
+ async emit(e, o) {
2493
+ let s = o.getXMLWriter(), c = e.model, u = e.json;
2494
+ s.decl(), s.start("worksheet", {
2212
2495
  xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2213
2496
  "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2214
2497
  "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2215
2498
  "mc:Ignorable": "x14ac",
2216
2499
  "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2217
2500
  }), function(e, t, n) {
2218
- let r = n.getTabColor();
2219
- r && (t.start("sheetPr"), r && U(t, n.getStyles().getTheme(), r, "tabColor", !1), t.end("sheetPr"));
2220
- }(0, o, c), function(e, t, n, r) {
2221
- let a = n.getUsedRange({ features: [] }), o = a ? a.getCoords() : null, s = 1048575, c = r.directStyles, l = c ? c.length : 0;
2222
- for (let e = 0; e < l; e++) {
2223
- let t = n.getRange(c[e][0]).getCoords();
2224
- if (t.colEnd === 16383) {
2501
+ let r = n.getTabColor(), i = n.getCodeName(), a = {};
2502
+ i && (a.codeName = i), n.isConditionalFormatCalculationEnabled() || (a.enableFormatConditionsCalculation = "0");
2503
+ let o = n.getOutlineSettings(), s = {};
2504
+ o.summaryBelow || (s.summaryBelow = "0"), o.summaryRight || (s.summaryRight = "0"), o.showOutlineSymbols || (s.showOutlineSymbols = "0"), o.applyStyles && (s.applyStyles = "1");
2505
+ let c = Object.keys(s).length > 0, l = !!r || c;
2506
+ if (l || Object.keys(a).length !== 0) {
2507
+ if (!l) return void t.empty("sheetPr", a);
2508
+ t.start("sheetPr", a), r && H(t, n.getStyles().getTheme(), r, "tabColor", !1), c && t.empty("outlinePr", s), t.end("sheetPr");
2509
+ }
2510
+ }(0, s, c), function(e, n, r, i) {
2511
+ let a = r.getUsedRange({ features: [] }), o = a ? a.getCoords() : null, s = y, c = w, l = i.directStyles, u = l ? l.length : 0;
2512
+ for (let e = 0; e < u; e++) {
2513
+ let n = r.getRange(l[e][0]).getCoords();
2514
+ if (n.colEnd === c) {
2225
2515
  let e = o?.colStart ?? 0;
2226
- t = {
2227
- ...t,
2516
+ n = {
2517
+ ...n,
2228
2518
  colStart: e,
2229
2519
  colEnd: e
2230
2520
  };
2231
2521
  }
2232
- if (t.rowEnd === s) {
2522
+ if (n.rowEnd === s) {
2233
2523
  let e = o?.rowStart ?? 0;
2234
- t = {
2235
- ...t,
2524
+ n = {
2525
+ ...n,
2236
2526
  rowStart: e,
2237
2527
  rowEnd: e
2238
2528
  };
2239
2529
  }
2240
- o = i.unionRanges(o, t);
2530
+ o = t.unionRanges(o, n);
2241
2531
  }
2242
- let u = r.merges, d = u ? u.length : 0;
2243
- for (let e = 0; e < d; e++) {
2244
- let t = n.getRange(u[e]).getCoords();
2245
- t.colEnd === 16383 && (t = { ...o }, t.colStart = o?.colStart ?? 0, t.colEnd = t.colStart), t.rowEnd === s && (t = { ...t }, t.rowStart = o?.rowStart ?? 0, t.rowEnd = t.rowStart), o = i.unionRanges(o, t);
2532
+ let d = i.merges, f = d ? d.length : 0;
2533
+ for (let e = 0; e < f; e++) {
2534
+ let n = r.getRange(d[e]).getCoords();
2535
+ n.colEnd === c && (n = { ...o }, n.colStart = o?.colStart ?? 0, n.colEnd = n.colStart), n.rowEnd === s && (n = { ...n }, n.rowStart = o?.rowStart ?? 0, n.rowEnd = n.rowStart), o = t.unionRanges(o, n);
2246
2536
  }
2247
- let f = "A1";
2248
- o && (a = n.getRange(o), f = o.colStart === o.colEnd && o.rowStart === o.rowEnd ? a.getAddress() : `${a.getIntersect({
2537
+ let p = "A1";
2538
+ o && (a = r.getRange(o), p = o.colStart === o.colEnd && o.rowStart === o.rowEnd ? a.getAddress() : `${a.getIntersect({
2249
2539
  colStart: o.colStart,
2250
2540
  rowStart: o.rowStart,
2251
2541
  colEnd: o.colStart,
@@ -2255,44 +2545,44 @@ var un = (e, t, n, r, i, a = "0") => {
2255
2545
  rowStart: o.rowEnd,
2256
2546
  colEnd: o.colEnd,
2257
2547
  rowEnd: o.rowEnd
2258
- }).getAddress()}`), t.empty("dimension", { ref: f });
2259
- }(0, o, c, l), function(e, t, n, r, i) {
2260
- let a = n.getView(), o = a.getTopLeft(), s = n.getRowHeaders().getIndex(o.top), c = n.getColumnHeaders().getIndex(o.left), l = m.cellToString({
2261
- colIndex: c,
2262
- rowIndex: s
2548
+ }).getAddress()}`), n.empty("dimension", { ref: p });
2549
+ }(0, s, c, u), function(e, t, n, r, i) {
2550
+ let o = n.getView(), s = o.getTopLeft(), c = n.getRowHeaders().getIndex(s.top), l = n.getColumnHeaders().getIndex(s.left), u = a.cellToString({
2551
+ colIndex: l,
2552
+ rowIndex: c
2263
2553
  });
2264
2554
  t.start("sheetViews");
2265
- let u = {};
2266
- a.isShowFormulas() && (u.showFormulas = "1"), a.isShowColumnGridlines() || a.isShowRowGridlines() || (u.showGridLines = "0"), a.isShowColumnHeaders() || a.isShowRowHeaders() || (u.showRowColHeaders = "0"), a.isShowZeros() || (u.showZeros = "0"), a.isRightToLeft() && (u.rightToLeft = "1"), i && (u.tabSelected = "1"), l !== "A1" && (u.topLeftCell = l);
2267
- let d = a.getZoomScale();
2268
- d !== 100 && (u.zoomScale = d, u.zoomScaleNormal = d);
2269
- let f = a.getGridLineColor();
2270
- if (f) {
2271
- u.defaultGridColor = "0";
2272
- let e = f.toRGBA(), t = e.red, r = e.green, i = e.blue, a = n.getStyles().getIndexedColors(), o = a.length, s = 0, c = Number.MAX_VALUE;
2555
+ let d = {};
2556
+ o.isShowFormulas() && (d.showFormulas = "1"), o.isShowColumnGridlines() || o.isShowRowGridlines() || (d.showGridLines = "0"), o.isShowColumnHeaders() || o.isShowRowHeaders() || (d.showRowColHeaders = "0"), o.isShowZeros() || (d.showZeros = "0"), o.isRightToLeft() && (d.rightToLeft = "1"), i && (d.tabSelected = "1"), u !== "A1" && (d.topLeftCell = u);
2557
+ let f = o.getZoomScale();
2558
+ f !== 100 && (d.zoomScale = f, d.zoomScaleNormal = f);
2559
+ let p = o.getGridLineColor();
2560
+ if (p) {
2561
+ d.defaultGridColor = "0";
2562
+ let e = p.toRGBA(), t = e.red, r = e.green, i = e.blue, a = n.getStyles().getIndexedColors(), o = a.length, s = 0, c = Number.MAX_VALUE;
2273
2563
  for (let e = 0; e < o; e++) {
2274
2564
  let n = a[e].toRGBA(), o = (t - n.red) ** 2 + (r - n.green) ** 2 + (i - n.blue) ** 2;
2275
2565
  o < c && (c = o, s = e);
2276
2566
  }
2277
- u.colorId = "" + s;
2567
+ d.colorId = "" + s;
2278
2568
  }
2279
- u.workbookViewId = "0";
2280
- let p = n.getSelection().getCoords(), h = m.cellToString(p.cell), g = {}, _ = a.getFreezePanes(), v = _.coords ?? {}, y = v.colIndex ?? 0, b = v.rowIndex ?? 0;
2569
+ d.workbookViewId = "0";
2570
+ let m = n.getSelection().getCoords(), h = a.cellToString(m.cell), g = {}, _ = o.getFreezePanes(), v = _.coords ?? {}, y = v.colIndex ?? 0, b = v.rowIndex ?? 0;
2281
2571
  if (y > 0 || b > 0) {
2282
- let e = _.topLeft ?? {}, r = e.top ?? 0, i = e.left ?? 0, a = n.getRowHeaders().getIndex(r), s = n.getColumnHeaders().getIndex(i), c = y - s, l = b - a, d = Math.max(y, n.getColumnHeaders().getIndex(o.left + n.getColumnHeaders().getOffset(y) - i)), f = Math.max(b, n.getRowHeaders().getIndex(o.top + n.getRowHeaders().getOffset(b) - r)), p = m.cellToString({
2283
- colIndex: s,
2284
- rowIndex: a
2572
+ let e = _.topLeft ?? {}, r = e.top ?? 0, i = e.left ?? 0, o = n.getRowHeaders().getIndex(r), c = n.getColumnHeaders().getIndex(i), l = y - c, u = b - o, f = Math.max(y, n.getColumnHeaders().getIndex(s.left + n.getColumnHeaders().getOffset(y) - i)), p = Math.max(b, n.getRowHeaders().getIndex(s.top + n.getRowHeaders().getOffset(b) - r)), m = a.cellToString({
2573
+ colIndex: c,
2574
+ rowIndex: o
2285
2575
  });
2286
- p === "A1" ? delete u.topLeftCell : u.topLeftCell = p, t.start("sheetView", u);
2576
+ m === "A1" ? delete d.topLeftCell : d.topLeftCell = m, t.start("sheetView", d);
2287
2577
  let h = {};
2288
- if (c > 0 && (h.xSplit = c), l > 0 && (h.ySplit = l), h.topLeftCell = m.cellToString({
2289
- colIndex: d,
2290
- rowIndex: f
2578
+ if (l > 0 && (h.xSplit = l), u > 0 && (h.ySplit = u), h.topLeftCell = a.cellToString({
2579
+ colIndex: f,
2580
+ rowIndex: p
2291
2581
  }), h.state = "frozen", y === 0) {
2292
2582
  h.activePane = "bottomLeft", t.empty("pane", h);
2293
- let e = m.cellToString({
2294
- colIndex: d,
2295
- rowIndex: a
2583
+ let e = a.cellToString({
2584
+ colIndex: f,
2585
+ rowIndex: o
2296
2586
  });
2297
2587
  e !== "A1" && t.empty("selection", {
2298
2588
  activeCell: e,
@@ -2300,31 +2590,31 @@ var un = (e, t, n, r, i, a = "0") => {
2300
2590
  }), g.pane = "bottomLeft";
2301
2591
  } else if (b === 0) {
2302
2592
  h.activePane = "topRight", t.empty("pane", h);
2303
- let e = m.cellToString({
2304
- colIndex: s,
2305
- rowIndex: f
2593
+ let e = a.cellToString({
2594
+ colIndex: c,
2595
+ rowIndex: p
2306
2596
  });
2307
2597
  e !== "A1" && t.empty("selection", {
2308
2598
  activeCell: e,
2309
2599
  sqref: e
2310
2600
  }), g.pane = "topRight";
2311
2601
  } else {
2312
- h.activePane = "bottomRight", t.empty("pane", h), p !== "A1" && t.empty("selection", {
2313
- activeCell: p,
2314
- sqref: p
2602
+ h.activePane = "bottomRight", t.empty("pane", h), m !== "A1" && t.empty("selection", {
2603
+ activeCell: m,
2604
+ sqref: m
2315
2605
  });
2316
- let e = m.cellToString({
2317
- colIndex: d,
2318
- rowIndex: a
2606
+ let e = a.cellToString({
2607
+ colIndex: f,
2608
+ rowIndex: o
2319
2609
  });
2320
2610
  t.empty("selection", {
2321
2611
  pane: "topRight",
2322
2612
  activeCell: e,
2323
2613
  sqref: e
2324
2614
  });
2325
- let n = m.cellToString({
2326
- colIndex: s,
2327
- rowIndex: f
2615
+ let n = a.cellToString({
2616
+ colIndex: c,
2617
+ rowIndex: p
2328
2618
  });
2329
2619
  t.empty("selection", {
2330
2620
  pane: "bottomLeft",
@@ -2332,285 +2622,299 @@ var un = (e, t, n, r, i, a = "0") => {
2332
2622
  sqref: n
2333
2623
  }), g.pane = "bottomRight";
2334
2624
  }
2335
- } else t.start("sheetView", u);
2625
+ } else t.start("sheetView", d);
2336
2626
  g.activeCell = h;
2337
- let x = p.ranges, S = x ? x.length : 0;
2627
+ let x = m.ranges, S = x ? x.length : 0;
2338
2628
  if (S > 0) {
2339
2629
  let e = "";
2340
2630
  for (let t = 0; t < S; t++) {
2341
2631
  let n = x[t];
2342
- t > 0 && (e += " "), e += m.rangeToString(n);
2632
+ t > 0 && (e += " "), e += a.rangeToString(n);
2343
2633
  }
2344
- g.sqref = e, (p.rangeIndex ?? 0) > 0 && (g.activeCellId = "" + p.rangeIndex);
2634
+ g.sqref = e, (m.rangeIndex ?? 0) > 0 && (g.activeCellId = "" + m.rangeIndex);
2345
2635
  } else h === "A1" ? g = null : g.sqref = h;
2346
2636
  g && t.empty("selection", g), t.end("sheetView"), t.end("sheetViews");
2347
- }(0, o, c, 0, r.isSelected), function(e, t, n, r) {
2637
+ }(0, s, c, 0, e.isSelected), function(e, t, n, r) {
2348
2638
  let i = r.defaultColSize, a = r.defaultRowSize, o = {};
2349
2639
  i !== void 0 && (o.defaultColWidth = i), o.defaultRowHeight = a ?? .75 * n.getRowHeaders().getDefaultSize(), a !== void 0 && (o.customHeight = "1"), o["x14ac:dyDescent"] = "0.25", t.empty("sheetFormatPr", o);
2350
- }(0, o, c, l), function(e, t, n, r) {
2351
- let i = r.cols ? m.refsToRuns(r.cols, !0) : null, a = i ? i.length : 0;
2640
+ }(0, s, c, u);
2641
+ let d = !1 === u.protection?.showFormulas ? o.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
2642
+ (function(e, t, n, r, i) {
2643
+ let o = r.cols ? a.refsToRuns(r.cols, !0) : null, s = o ? o.length : 0;
2352
2644
  n.getEntireRange().getColumnEnd();
2353
- let o = n.getColumnHeaders().getDefaultSizeNative();
2354
- if (a > 0) {
2645
+ let c = n.getColumnHeaders().getDefaultSizeNative(), l = i ? i.getHiddenXf(0) : 0, u = 1, d = (e) => {
2646
+ l !== 0 && e >= u && t.empty("col", {
2647
+ min: u,
2648
+ max: e,
2649
+ width: c,
2650
+ style: l
2651
+ });
2652
+ };
2653
+ if (s > 0 || l !== 0) {
2355
2654
  t.start("cols");
2356
- for (let e = 0; e < a; e++) {
2357
- let n = i[e], r = n.min + 1, a = 16384;
2655
+ for (let e = 0; e < s; e++) {
2656
+ let n = o[e], r = n.min + 1, a = w + 1;
2358
2657
  if (r > a) continue;
2359
- let s = {
2658
+ let s = Math.min(n.max + 1, a);
2659
+ d(r - 1), u = s + 1;
2660
+ let l = {
2360
2661
  min: r,
2361
- max: Math.min(n.max + 1, a)
2362
- }, c = n.value, l = c.sz;
2363
- l === void 0 ? s.width = o : l !== 0 && (s.width = Math.round(256 * l) / 256), c.s && (s.style = c.s), c.h !== void 0 && (s.hidden = 1), c.csz && (s.customWidth = 1), c.l !== void 0 && (s.outlineLevel = c.l), c.cl !== void 0 && (s.collapsed = 1), t.empty("col", s);
2662
+ max: s
2663
+ }, f = n.value, p = f.sz;
2664
+ p === void 0 ? l.width = c : p !== 0 && (l.width = Math.round(256 * p) / 256);
2665
+ let m = i ? i.getHiddenXf(f.s ?? 0) : f.s;
2666
+ m && (l.style = m), f.h !== void 0 && (l.hidden = 1), f.csz && (l.customWidth = 1), f.l !== void 0 && (l.outlineLevel = f.l), f.cl !== void 0 && (l.collapsed = 1), t.empty("col", l);
2364
2667
  }
2365
- t.end("cols");
2668
+ d(w + 1), t.end("cols");
2366
2669
  }
2367
- }(0, o, c, l), function(n, r, i, a, o) {
2368
- let s = n.getSharedStates(), c = s.get("persistStrings"), l = s.get("metaCollector"), u = s.get("persistRichTypes"), d = s.get("formulaTransform"), f = 0, p = 0, h = i.getUsedRange(), g = 0, _ = a.rows ? m.refsToRuns(a.rows, !1) : null, y = _ ? _.length : 0, b = _?.[y - 1]?.max ?? -1, x = a.cols ? m.refsToRuns(a.cols, !0) : null, C = x ? x.length : 0, te = x?.[C - 1]?.max ?? -1;
2369
- if (h || y > 0) {
2370
- let s = .75, h = a.defaultRowSize ?? i.getRowHeaders().getDefaultSize() * s, y = i.getStyles().getNormal().getBestFit().height * s, C = (e, t) => {
2371
- let n = Mt;
2670
+ })(0, s, c, u, d), function(e, t, n, o, s, c) {
2671
+ let l = e.getSharedStates(), u = l.get("persistStrings"), d = l.get("metaCollector"), f = l.get("persistRichTypes"), p = 0, m = 0, g = n.getUsedRange(), _ = 0, v = o.rows ? a.refsToRuns(o.rows, !1) : null, y = v ? v.length : 0, x = v?.[y - 1]?.max ?? -1, S = o.cols ? a.refsToRuns(o.cols, !0) : null, C = S ? S.length : 0, w = S?.[C - 1]?.max ?? -1;
2672
+ if (g || y > 0) {
2673
+ let l = .75, g = o.defaultRowSize ?? n.getRowHeaders().getDefaultSize() * l, y = n.getStyles().getNormal().getBestFit().height * l, C = (e, t) => {
2674
+ let n = fn;
2372
2675
  if (n.r = "" + (e + 1), n.s = void 0, n.customFormat = void 0, n.hidden = void 0, n.ht = void 0, n.customHeight = void 0, n.outlineLevel = void 0, n.collapsed = void 0, !t) return n;
2373
2676
  let r = t.value;
2374
- r.s !== void 0 && (n.s = "" + r.s, n.customFormat = "1"), r.h && (n.hidden = "1");
2375
- let i = r.csz ?? !1, a = r.sz ?? h;
2677
+ r.s !== void 0 && (n.s = "" + (c ? c.getHiddenXf(r.s) : r.s), n.customFormat = "1"), r.h && (n.hidden = "1");
2678
+ let i = r.csz ?? !1, a = r.sz ?? g;
2376
2679
  return (a !== y || i) && (n.ht = "" + a), i && (n.customHeight = "1"), r.l !== void 0 && (n.outlineLevel = "" + r.l), r.cl !== void 0 && (n.collapsed = "" + r.cl), n;
2377
- }, w = 0, T = _?.[w] ?? null, E = T?.min ?? 2 ** 53 - 1, D = T?.max ?? 2 ** 53 - 1, O = T?.value?.s, k = -1, A = 0, j = x?.[A] ?? null, M = j?.min ?? 2 ** 53 - 1, N = j?.max ?? 2 ** 53 - 1, P = j?.value?.s, se = (e, t = !1) => {
2378
- if (k !== e) {
2379
- for (k !== -1 && (r.end("row"), A !== 0 && (A = 0, j = x?.[A] ?? null, M = j?.min ?? 2 ** 53 - 1, N = j?.max ?? 2 ** 53 - 1, P = j?.value?.s)); k + 1 <= e;) {
2380
- k++, T && k > D && (T = _[++w] ?? null, T ? (E = T.min, D = T.max, O = T.value?.s) : (E = 2 ** 53 - 1, D = 2 ** 53 - 1, O = void 0)), k < E && k < e && (k = T ? Math.min(E, e) : e);
2381
- let n = k < e || t && k === e, i = C(k, T && k >= E && k <= D ? T : null);
2382
- n ? r.empty("row", i) : r.start("row", i);
2680
+ }, T = 0, D = v?.[T] ?? null, O = D?.min ?? 2 ** 53 - 1, k = D?.max ?? 2 ** 53 - 1, ee = D?.value?.s, A = -1, j = 0, M = S?.[j] ?? null, ne = M?.min ?? 2 ** 53 - 1, re = M?.max ?? 2 ** 53 - 1, ie = M?.value?.s, ae = (e, n = !1) => {
2681
+ if (A !== e) {
2682
+ for (A !== -1 && (t.end("row"), j !== 0 && (j = 0, M = S?.[j] ?? null, ne = M?.min ?? 2 ** 53 - 1, re = M?.max ?? 2 ** 53 - 1, ie = M?.value?.s)); A + 1 <= e;) {
2683
+ A++, D && A > k && (D = v[++T] ?? null, D ? (O = D.min, k = D.max, ee = D.value?.s) : (O = 2 ** 53 - 1, k = 2 ** 53 - 1, ee = void 0)), A < O && A < e && (A = D ? Math.min(O, e) : e);
2684
+ let r = A < e || n && A === e, i = C(A, D && A >= O && A <= k ? D : null);
2685
+ r ? t.empty("row", i) : t.start("row", i);
2383
2686
  }
2384
- if (e < k) {
2385
- let t = C(e, null);
2386
- r.start("row", t);
2687
+ if (e < A) {
2688
+ let n = C(e, null);
2689
+ t.start("row", n);
2387
2690
  }
2388
2691
  }
2389
2692
  };
2390
- r.setValidationDisabled(!0), r.start("sheetData");
2391
- let F = [];
2392
- F.push(((e, t, n) => {
2693
+ t.setValidationDisabled(!0), t.start("sheetData");
2694
+ let N = [];
2695
+ N.push(((e, t, n) => {
2393
2696
  if (!n) return [];
2394
2697
  let r = 0;
2395
2698
  for (let i = 0; i < n.length; i++) {
2396
2699
  let a = n[i][0], o = t.getRange(a).getCoords();
2397
- if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > xt) return e.warn(`Direct styles cover more than ${xt} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
2700
+ if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > Jt) return e.warn(`Direct styles cover more than ${Jt} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
2398
2701
  }
2399
2702
  return n;
2400
- })(n, i, a.directStyles));
2401
- let ce = a.formulas, I = ce ? ce.length : 0;
2402
- if (I > 0) {
2403
- let e = /* @__PURE__ */ new Map();
2404
- if (o.names.size > 0 && a.formulaArray) for (let t of a.formulaArray) try {
2405
- let n = i.getRange(t[0]).getCoords();
2406
- e.set(`${n.rowStart},${n.colStart}`, n);
2703
+ })(e, n, o.directStyles));
2704
+ let ce = o.formulas, P = ce ? ce.length : 0;
2705
+ if (P > 0) {
2706
+ let t = /* @__PURE__ */ new Map();
2707
+ if (s.names.size > 0 && o.formulaArray) for (let e of o.formulaArray) try {
2708
+ let r = n.getRange(e[0]).getCoords();
2709
+ t.set(`${r.rowStart},${r.colStart}`, r);
2407
2710
  } catch {}
2408
- let t = [];
2409
- if (a.formulaArray) for (let e of a.formulaArray) try {
2410
- t.push(i.getRange(e[0]).getCoords());
2711
+ let r = [];
2712
+ if (o.formulaArray) for (let e of o.formulaArray) try {
2713
+ r.push(n.getRange(e[0]).getCoords());
2411
2714
  } catch {}
2412
- let n = (e) => {
2413
- for (let n = 0; n < t.length; n++) {
2414
- let r = t[n];
2415
- if (r.rowStart <= e.rowEnd && r.rowEnd >= e.rowStart && r.colStart <= e.colEnd && r.colEnd >= e.colStart) return !0;
2715
+ let i = (e) => {
2716
+ for (let t = 0; t < r.length; t++) {
2717
+ let n = r[t];
2718
+ if (n.rowStart <= e.rowEnd && n.rowEnd >= e.rowStart && n.colStart <= e.colEnd && n.colEnd >= e.colStart) return !0;
2416
2719
  }
2417
2720
  return !1;
2418
- }, r = ae(() => i.getCalculation()), s = (e) => {
2419
- if (!e) return;
2420
- let t;
2421
- return e.getExpression({ formulaTransform: (e, n) => {
2422
- n === void 0 && (t = e);
2423
- } }), t;
2424
- }, c = [];
2425
- for (let t = 0; t < I; t++) {
2426
- let a = ce[t];
2721
+ }, c = e.getSharedStates().get("xlsxFormulaDialect") ?? E(n.getCalculation().getNamedFormulas().toJSON(), n.getTables().getItems().map((e) => e.getName())), l = n.getEntireRange().getCoords(), u = [];
2722
+ for (let e of n.getTables().getItems()) u.push([e.getRange().getCoords(), e.getName()]);
2723
+ let d = (e, t) => {
2724
+ for (let n = 0; n < u.length; n++) {
2725
+ let r = u[n][0];
2726
+ if (e >= r.rowStart && e <= r.rowEnd && t >= r.colStart && t <= r.colEnd) return u[n][1];
2727
+ }
2728
+ return null;
2729
+ }, f = /* @__PURE__ */ new Set();
2730
+ for (let e = 0; e < r.length; e++) f.add(`${r[e].rowStart},${r[e].colStart}`);
2731
+ let p = [];
2732
+ for (let r = 0; r < P; r++) {
2733
+ let o = ce[r];
2427
2734
  try {
2428
- let l = a[0], u = i.getRange(l), f = u.getCoords(), p = a[1], h = null, _ = s(u.getCell().getFormula()), y = !!_ && ie(_, r), b = oe(_);
2429
- if (o.affects(t)) {
2430
- h = null, y = !1;
2431
- let t = (e, t, n) => {
2735
+ let e = o[0], u = n.getRange(e), m = u.getCoords(), g = o[1], v = null, y = {
2736
+ rowIndex: m.rowStart,
2737
+ colIndex: m.colStart
2738
+ }, b = c.parse(g, y), x = b ? c.annotate(b) : void 0, S = b ? c.spell(b, f.has(`${m.rowStart},${m.colStart}`), d(m.rowStart, m.colStart)) : null, C = S ? h.imager(S, { entireCoords: l }) : null;
2739
+ C && (g = C(y));
2740
+ let w = !0 === x?.cm, T = !0 === x?.ca;
2741
+ if (s.affects(r)) {
2742
+ v = null, w = !1;
2743
+ let e = (e, t, n) => {
2432
2744
  let r = {
2433
2745
  rowStart: e,
2434
2746
  colStart: t,
2435
2747
  rowEnd: e,
2436
2748
  colEnd: t
2437
2749
  };
2438
- c.push([r, {
2750
+ p.push([r, {
2439
2751
  coords: r,
2440
2752
  formula: n,
2441
2753
  sharedId: null,
2442
- ref: m.rangeToString(r),
2754
+ ref: a.rangeToString(r),
2443
2755
  isDynamicRange: !1,
2444
2756
  isWrapped: !0
2445
2757
  }]);
2446
- }, n = e.get(`${f.rowStart},${f.colStart}`), r = n !== void 0 && (n.rowEnd > n.rowStart || n.colEnd > n.colStart), a = !1;
2447
- if (r) {
2448
- let e = v(p, u.getCell().getValue());
2449
- if (e !== null) for (let r = n.rowStart; r <= n.rowEnd; r++) for (let o = n.colStart; o <= n.colEnd; o++) {
2450
- if (r === n.rowStart && o === n.colStart) {
2451
- t(r, o, e), a = !0;
2758
+ }, r = t.get(`${m.rowStart},${m.colStart}`), i = r !== void 0 && (r.rowEnd > r.rowStart || r.colEnd > r.colStart), o = !1;
2759
+ if (i) {
2760
+ let t = se(g, u.getCell().getValue());
2761
+ if (t !== null) for (let i = r.rowStart; i <= r.rowEnd; i++) for (let s = r.colStart; s <= r.colEnd; s++) {
2762
+ if (i === r.rowStart && s === r.colStart) {
2763
+ e(i, s, t), o = !0;
2452
2764
  continue;
2453
2765
  }
2454
- let s = S(i.getRange(m.rangeToString({
2455
- rowStart: r,
2456
- colStart: o,
2457
- rowEnd: r,
2458
- colEnd: o
2766
+ let c = de(n.getRange(a.rangeToString({
2767
+ rowStart: i,
2768
+ colStart: s,
2769
+ rowEnd: i,
2770
+ colEnd: s
2459
2771
  })).getCell().getValue());
2460
- s !== null && t(r, o, s);
2772
+ c !== null && e(i, s, c);
2461
2773
  }
2462
- } else {
2463
- let e = u.getCells();
2464
- for (let n = 0; n < e.length; n++) {
2465
- let r = e[n];
2466
- for (let e = 0; e < r.length; e++) {
2467
- let i = r[e], o = v(i.getFormula()?.getExpression() ?? p, i.getValue());
2468
- o !== null && (t(f.rowStart + n, f.colStart + e, o), a = !0);
2469
- }
2470
- }
2471
- }
2472
- if (a) continue;
2473
- }
2474
- let x, ee = p.indexOf("!") !== -1 || p.indexOf("[") !== -1;
2475
- if (y || u.isSingleCell() || ee || n(f) || (h = "" + g++), h === null && !u.isSingleCell()) {
2476
- x = [];
2477
- let e = u.getCells();
2478
- for (let t = 0; t < e.length; t++) {
2479
- let n = e[t], r = Array(n.length);
2480
- for (let e = 0; e < n.length; e++) t === 0 && e === 0 || (r[e] = n[e].getFormula()?.getExpression({ formulaTransform: d }) ?? void 0);
2481
- x.push(r);
2482
- }
2774
+ } else u.forEach((t, n) => {
2775
+ let r = n.getCoords(), i = se(C?.(r) ?? g, n.getCell().getValue());
2776
+ i !== null && (e(r.rowIndex, r.colIndex, i), o = !0);
2777
+ }, { includeEmpty: !0 });
2778
+ if (o) continue;
2483
2779
  }
2484
- let C = [f, {
2485
- coords: f,
2486
- formula: p,
2487
- sharedId: h,
2488
- ref: l,
2489
- isDynamicRange: y,
2490
- isExcelVolatile: b,
2491
- memberTexts: x
2780
+ let E = g.indexOf("!") !== -1 || g.indexOf("[") !== -1;
2781
+ w || u.isSingleCell() || E || i(m) || (v = "" + _++);
2782
+ let D = v !== null || u.isSingleCell() ? null : C, O = [m, {
2783
+ coords: m,
2784
+ formula: g,
2785
+ sharedId: v,
2786
+ ref: e,
2787
+ isDynamicRange: w,
2788
+ isExcelVolatile: T,
2789
+ memberImage: D
2492
2790
  }];
2493
- c.push(C);
2494
- } catch (e) {
2495
- console.warn(`Failed to parse formula: ${a[1]}`, e);
2791
+ p.push(O);
2792
+ } catch (t) {
2793
+ e.log(`Could not write the formula '${o[1]}' over '${o[0]}'; those cells are written as values only. ${t}`);
2496
2794
  continue;
2497
2795
  }
2498
2796
  }
2499
- F.push(c);
2500
- } else F.push([]);
2501
- let le = a.volatile, L = le ? le.length : 0;
2502
- if (L > 0) {
2503
- let e = Array(L);
2504
- for (let t = 0; t < L; t++) {
2505
- let n = le[t];
2797
+ N.push(p);
2798
+ } else N.push([]);
2799
+ let le = o.volatile, F = le ? le.length : 0;
2800
+ if (F > 0) {
2801
+ let e = Array(F);
2802
+ for (let t = 0; t < F; t++) {
2803
+ let r = le[t];
2506
2804
  try {
2507
- e[t] = [i.getRange(n).getCoords(), !0];
2805
+ e[t] = [n.getRange(r).getCoords(), !0];
2508
2806
  } catch (e) {
2509
- console.warn(`Failed to parse volatile: ${n}`, e);
2807
+ console.warn(`Failed to parse volatile: ${r}`, e);
2510
2808
  continue;
2511
2809
  }
2512
2810
  }
2513
- F.push(e);
2514
- } else F.push([]);
2515
- let R = a.formulaArray, z = R ? R.length : 0;
2516
- if (z > 0) {
2517
- let e = Array(z);
2518
- for (let t = 0; t < z; t++) {
2519
- let n = R[t];
2811
+ N.push(e);
2812
+ } else N.push([]);
2813
+ let ue = o.formulaArray, I = ue ? ue.length : 0;
2814
+ if (I > 0) {
2815
+ let e = Array(I);
2816
+ for (let t = 0; t < I; t++) {
2817
+ let r = ue[t];
2520
2818
  try {
2521
- let r = n[0];
2522
- e[t] = [i.getRange(r).getCoords(), {
2523
- ref: r,
2524
- kind: n[1] ?? "dynamic"
2819
+ let i = r[0];
2820
+ e[t] = [n.getRange(i).getCoords(), {
2821
+ ref: i,
2822
+ kind: r[1] ?? "dynamic"
2525
2823
  }];
2526
2824
  } catch (e) {
2527
- console.warn(`Failed to parse formula array: ${n}`, e);
2825
+ console.warn(`Failed to parse formula array: ${r}`, e);
2528
2826
  continue;
2529
2827
  }
2530
2828
  }
2531
- F.push(e);
2532
- } else F.push([]);
2533
- i.getEntireRange().forEach((i, a) => {
2534
- let o = a.getCoords(), s = o.rowIndex, d = o.colIndex;
2535
- k !== s && se(s);
2536
- let m = a.getInjectedReference(0);
2537
- if (m === void 0 && O !== void 0 && s >= E && s <= D && (m = O), m === void 0) {
2538
- for (; d <= te && d > N;) A++, j = x?.[A] ?? null, M = j?.min ?? 2 ** 53 - 1, N = j?.max ?? 2 ** 53 - 1, P = j?.value?.s;
2539
- P !== void 0 && d >= M && d <= N && (m = P);
2829
+ N.push(e);
2830
+ } else N.push([]);
2831
+ n.getEntireRange().forEach((n, a) => {
2832
+ let o = a.getCoords(), s = o.rowIndex, l = o.colIndex;
2833
+ A !== s && ae(s);
2834
+ let h = a.getInjectedReference(0);
2835
+ if (h === void 0 && ee !== void 0 && s >= O && s <= k && (h = ee), h === void 0) {
2836
+ for (; l <= w && l > re;) j++, M = S?.[j] ?? null, ne = M?.min ?? 2 ** 53 - 1, re = M?.max ?? 2 ** 53 - 1, ie = M?.value?.s;
2837
+ ie !== void 0 && l >= ne && l <= re && (h = ie);
2540
2838
  }
2541
- let h = a.getType(), g = null;
2542
- I > 0 && (g = a.getInjectedReference(1) ?? null);
2543
- let _ = !1;
2544
- L > 0 && (_ = a.getInjectedReference(2) ?? !1);
2545
- let v = null;
2546
- z > 0 && (v = a.getInjectedReference(3) ?? null);
2547
- let y = v?.kind === "dynamicSpillError", b = v?.kind === "static", S = jt;
2548
- S.r = a.getAddress(), S.s = void 0, S.t = void 0, S.cm = void 0, S.vm = void 0, m !== void 0 && m !== 0 && (S.s = "" + m);
2549
- let C = null, w = null;
2550
- switch (h) {
2551
- case t.Boolean:
2552
- C = i ? "1" : "0", w = "b";
2839
+ let g = a.getType(), _ = null;
2840
+ P > 0 && (_ = a.getInjectedReference(1) ?? null);
2841
+ let v = !1;
2842
+ F > 0 && (v = a.getInjectedReference(2) ?? !1);
2843
+ let y = null;
2844
+ I > 0 && (y = a.getInjectedReference(3) ?? null);
2845
+ let x = y?.kind === "error", C = y?.kind === "fixed", T = dn;
2846
+ T.r = a.getAddress(), T.s = void 0, T.t = void 0, T.cm = void 0, T.vm = void 0, c && (h = c.getHiddenXf(h ?? 0)), h !== void 0 && h !== 0 && (T.s = "" + h);
2847
+ let E = null, D = null;
2848
+ switch (g) {
2849
+ case i.Boolean:
2850
+ E = n ? "1" : "0", D = "b";
2553
2851
  break;
2554
- case t.Error:
2555
- let n = i.getCode();
2556
- if (w = "e", n > 7) C = e.BuiltIn.Value.getLabel(), S.vm = "" + u.add(i);
2557
- else if (n < 1) {
2852
+ case i.Error:
2853
+ let e = n.getCode();
2854
+ if (D = "e", e > 7) E = r.BuiltIn.Value.getLabel(), T.vm = "" + f.add(n);
2855
+ else if (e < 1) {
2558
2856
  let e;
2559
- w = "s", g ? (e = "=" + g.formula, g = null) : e = "" + i.getLabel(), C = "" + c.add(e), f++;
2560
- } else C = "" + i.getLabel();
2857
+ D = "s", _ ? (e = "=" + _.formula, _ = null) : e = "" + n.getLabel(), E = "" + u.add(e), p++;
2858
+ } else E = "" + n.getLabel();
2561
2859
  break;
2562
- case t.Number:
2563
- C = "" + i, w = null;
2860
+ case i.Number:
2861
+ E = "" + n, D = null;
2564
2862
  break;
2565
- case t.String:
2566
- C = i, g ? (w = "str", C = i) : (w = "s", C = "" + c.add(C), f++);
2863
+ case i.String:
2864
+ E = n, _ ? (D = "str", E = n) : (D = "s", E = "" + u.add(E), p++);
2567
2865
  break;
2568
- case t.RichData: w = "e", C = e.BuiltIn.Value.getLabel(), S.vm = "" + u.add(i);
2866
+ case i.RichData: D = "e", E = r.BuiltIn.Value.getLabel(), T.vm = "" + f.add(n);
2569
2867
  }
2570
- w && (S.t = w);
2571
- let T = !g?.isWrapped && (v !== null || (g?.isDynamicRange ?? !1));
2572
- if (g !== null || C !== null) {
2573
- if (T && g !== null && !b && (S.cm = "" + l.registerArrayCell(y)), r.start("c", S), g) {
2574
- let e, t = g.memberTexts?.[s - g.coords.rowStart]?.[d - g.coords.colStart] ?? g.formula, n = null, i = g.sharedId;
2575
- if (i) {
2576
- e = Pt;
2577
- let t = g.coords;
2578
- t.colStart === d && t.rowStart === s ? (e.ref = g.ref, e.si = i, n = g.formula) : (e.ref = void 0, e.si = i);
2579
- } else T ? (e = Ft, e.aca = y ? "1" : void 0, e.ref = y ? S.r : v?.ref ?? S.r, n = t) : (e = Nt, n = t);
2580
- e.ca = _ || y || g.isExcelVolatile ? "1" : void 0, n ? (r.start("f", e), r.text(n), r.end("f")) : r.empty("f", e);
2868
+ D && (T.t = D);
2869
+ let N = !_?.isWrapped && (y !== null || (_?.isDynamicRange ?? !1));
2870
+ if (_ !== null || E !== null) {
2871
+ if (N && _ !== null && !C && (T.cm = "" + d.registerArrayCell(x)), t.start("c", T), _) {
2872
+ let e = s === _.coords.rowStart && l === _.coords.colStart, n = _.formula;
2873
+ _.memberImage && !e && (n = _.memberImage({
2874
+ rowIndex: s,
2875
+ colIndex: l
2876
+ }));
2877
+ let r, i = null, a = _.sharedId;
2878
+ if (a) {
2879
+ r = mn;
2880
+ let e = _.coords;
2881
+ e.colStart === l && e.rowStart === s ? (r.ref = _.ref, r.si = a, i = _.formula) : (r.ref = void 0, r.si = a);
2882
+ } else N ? (r = hn, r.aca = x ? "1" : void 0, r.ref = x ? T.r : y?.ref ?? T.r, i = n) : (r = pn, i = n);
2883
+ r.ca = v || x || _.isExcelVolatile ? "1" : void 0, i ? (t.start("f", r), t.text(i), t.end("f")) : t.empty("f", r);
2581
2884
  }
2582
- C !== null && (w === "str" && C ? (r.start("v", ee.test(C) ? re : void 0), r.text(ne(C))) : (r.start("v"), C && r.text(C)), r.end("v")), r.end("c");
2583
- } else p++ < xt ? r.empty("c", S) : p === 1048577 && n.warn(`Reached ${xt} style-only cells at '${S.r}'; not writing the rest.`);
2885
+ E !== null && (D === "str" && E ? (t.start("v", oe.test(E) ? b : void 0), t.text(te(E))) : (t.start("v"), E && t.text(E)), t.end("v")), t.end("c");
2886
+ } else m++ < Jt ? t.empty("c", T) : m === 1048577 && e.warn(`Reached ${Jt} style-only cells at '${T.r}'; not writing the rest.`);
2584
2887
  }, {
2585
- injectReferences: F,
2888
+ injectReferences: N,
2586
2889
  features: []
2587
- }), k !== -1 && k >= b ? r.end("row") : se(b, !0), r.end("sheetData"), r.setValidationDisabled(!1);
2588
- } else r.empty("sheetData");
2589
- if (f > 0) {
2590
- let e = s.get("stringsCount") ?? 0;
2591
- s.set("stringsCount", e + f);
2890
+ }), A !== -1 && A >= x ? t.end("row") : ae(x, !0), t.end("sheetData"), t.setValidationDisabled(!1);
2891
+ } else t.empty("sheetData");
2892
+ if (p > 0) {
2893
+ let e = l.get("stringsCount") ?? 0;
2894
+ l.set("stringsCount", e + p);
2592
2895
  }
2593
- }(a, o, c, l, await (async (e, t) => {
2896
+ }(o, s, c, u, await (async (e, t) => {
2594
2897
  let n = t ? t.length : 0;
2595
- if (n === 0) return bt;
2898
+ if (n === 0) return qt;
2596
2899
  let r = /* @__PURE__ */ new Set(), i = Array(n);
2597
- for (let a = 0; a < n; a++) {
2598
- i[a] = null;
2900
+ for (let e = 0; e < n; e++) {
2901
+ i[e] = null;
2599
2902
  try {
2600
- let n = e.getRange(t[a][0]).getCell().getFormula()?.getTokens();
2903
+ let n = h.parse(t[e][1]);
2601
2904
  if (!n) continue;
2602
- let o = null;
2603
- for (let e = 0; e < n.length; e++) {
2604
- let t = n[e], i = null;
2605
- t.type === "function" ? i = String(t.value) : t.type === "named" && n[e + 1]?.type === "paren" && n[e + 1].value === "(" && (i = String(t.value?.name ?? "")), i && (i = i.toUpperCase(), r.add(i), (o ??= /* @__PURE__ */ new Set()).add(i));
2606
- }
2607
- i[a] = o;
2905
+ let a = null, o = (e) => {
2906
+ let t = null;
2907
+ e.type === "function" ? t = String(e.value) : e.type === "call" && e.inputs?.[0]?.type === "named" && (t = String(e.inputs[0].value?.name ?? "")), t && (t = t.toUpperCase(), r.add(t), (a ??= /* @__PURE__ */ new Set()).add(t));
2908
+ let n = e.inputs;
2909
+ if (n) for (let e = 0; e < n.length; e++) n[e] && o(n[e]);
2910
+ };
2911
+ o(n), i[e] = a;
2608
2912
  } catch {}
2609
2913
  }
2610
2914
  let a = e.getWorkbook();
2611
- if (!a) return bt;
2612
- let o = await te(a, r);
2613
- return o.size === 0 ? bt : {
2915
+ if (!a) return qt;
2916
+ let o = await ne(a, r);
2917
+ return o.size === 0 ? qt : {
2614
2918
  names: o,
2615
2919
  perFormula: i,
2616
2920
  affects: (e) => {
@@ -2620,136 +2924,141 @@ var un = (e, t, n, r, i, a = "0") => {
2620
2924
  return !1;
2621
2925
  }
2622
2926
  };
2623
- })(c, l.formulas)), function(e, t, n, r) {
2927
+ })(c, u.formulas), d), function(e, t, n, r) {
2624
2928
  let i = r.protection;
2625
2929
  if (!i) return;
2626
2930
  let a = {};
2627
- Pe(i.password ?? {}, a), a.sheet = "1";
2628
- let o = (e, t, n) => {
2629
- let r = i[e];
2630
- r !== void 0 && r !== t && (a[n ?? e] = r ? "1" : "0");
2631
- };
2632
- o("objects", "0"), o("scenarios", "0"), o("formatCells", "0"), o("formatColumns", "0"), o("formatRows", "0"), o("insertColumns", "0"), o("insertRows", "0"), o("insertHyperlinks", "0"), o("deleteColumns", "0"), o("deleteRows", "0"), o("selectLockedCells", "1"), o("sort", "0"), o("autoTable", "0", "autoFilter"), o("pivotTables", "0"), o("selectUnlockedCells", "1"), t.empty("sheetProtection", a);
2633
- }(0, o, 0, l), function(e, t, n, r) {
2931
+ i.sheet || Ke(i.password ?? {}, a);
2932
+ for (let e of I) {
2933
+ let t = ae(e, i[e.key]);
2934
+ t !== null && (a[e.attribute] = t);
2935
+ }
2936
+ t.empty("sheetProtection", a);
2937
+ }(0, s, 0, u), function(e, t, n, r) {
2634
2938
  let i = r.protectedRanges, a = i ? i.length : 0;
2635
2939
  if (a === 0) return;
2636
2940
  let o = [];
2637
2941
  for (let t = 0; t < a; t++) {
2638
2942
  let n, r, a = i[t];
2639
2943
  Array.isArray(a) ? (n = a[0], r = a[1]) : (n = a.r, r = a.v);
2640
- let s = Ot(n);
2944
+ let s = tn(n);
2641
2945
  if (!s || !r) {
2642
- e.warn("Skipping protectedRange with no range.");
2946
+ e.log("Skipping protectedRange with no range.");
2643
2947
  continue;
2644
2948
  }
2645
2949
  if (!r.name) {
2646
- e.warn("Skipping protectedRange with no name.");
2950
+ e.log("Skipping protectedRange with no name.");
2647
2951
  continue;
2648
2952
  }
2649
2953
  let c = {};
2650
- Pe(r.password ?? {}, c), c.sqref = s, c.name = r.name, r.securityDescriptor && (c.securityDescriptor = r.securityDescriptor), o.push(c);
2954
+ Ke(r.password ?? {}, c), c.sqref = s, c.name = r.name, r.securityDescriptor && (c.securityDescriptor = r.securityDescriptor), o.push(c);
2651
2955
  }
2652
2956
  if (o.length !== 0) {
2653
2957
  t.start("protectedRanges");
2654
2958
  for (let e = 0; e < o.length; e++) t.empty("protectedRange", o[e]);
2655
2959
  t.end("protectedRanges");
2656
2960
  }
2657
- }(a, o, 0, l);
2658
- let u = l.autoTable;
2659
- if (u) {
2660
- let e, t = u;
2661
- e = Array.isArray(t) ? t[1] : t.v, gt(a, o, c.getAutoTable(), e, !0);
2961
+ }(o, s, 0, u);
2962
+ let f = u.autoTable;
2963
+ if (f) {
2964
+ let e, t = f;
2965
+ e = Array.isArray(t) ? t[1] : t.v, Ut(o, s, c.getAutoTable(), e, !0);
2662
2966
  }
2663
2967
  (function(e, t, n, r) {
2664
2968
  let i = r.merges ? r.merges.length : 0;
2665
2969
  if (i > 0) {
2666
2970
  t.start("mergeCells", { count: i });
2667
2971
  for (let e = 0; e < i; e++) {
2668
- let n = r.merges[e], i = typeof n == "string" ? n : m.rangeToString(n);
2972
+ let n = r.merges[e], i = typeof n == "string" ? n : a.rangeToString(n);
2669
2973
  t.empty("mergeCell", { ref: i });
2670
2974
  }
2671
2975
  t.end("mergeCells");
2672
2976
  }
2673
- })(0, o, 0, l);
2674
- let d = function(e, t, r, i) {
2675
- let a = [], o = i.conditionals, c = o ? o.length : 0;
2676
- if (c === 0) return a;
2677
- let l = e.getSharedStates(), u = l.get(rt);
2678
- u || (u = new nt(), l.set(rt, u));
2679
- let d = r.getStyles().getTheme(), f = null, p = 0;
2680
- for (let r = 0; r < c; r++) {
2681
- let i, c, l = o[r];
2682
- Array.isArray(l) ? (i = l[0], c = l[1]) : (i = l.r, c = l.v);
2683
- let m = Ot(i);
2684
- if (!m || !c) {
2685
- e.warn("Skipping conditionalFormatting with no range.");
2977
+ })(0, s, 0, u);
2978
+ let p = function(e, t, r, i) {
2979
+ let a = [], o = i.conditionals, s = o ? o.length : 0;
2980
+ if (s === 0) return a;
2981
+ let c = e.getSharedStates(), u = c.get(At);
2982
+ u || (u = new kt(), c.set(At, u));
2983
+ let d = r.getStyles().getTheme(), f = c.get(A), p = null, m = 0;
2984
+ for (let r = 0; r < s; r++) {
2985
+ let i, s, c = o[r];
2986
+ Array.isArray(c) ? (i = c[0], s = c[1]) : (i = c.r, s = c.v);
2987
+ let h = tn(i);
2988
+ if (!h || !s) {
2989
+ e.log("Skipping conditionalFormatting with no range.");
2686
2990
  continue;
2687
2991
  }
2688
- let h = c.scale, g = h ? { type: h.type } : j(c.condition, Dt(m), (t) => e.warn(t));
2689
- g ? h?.type === s.ScaleType.IconSet && Tt(h) ? (p++, a.push({
2690
- guid: C(n.uuidV4),
2691
- sqref: m,
2692
- priority: p,
2693
- scale: h
2694
- })) : h || !At(g) ? (m !== f && (f !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
2695
- sqref: m,
2696
- pivot: c.pivot ? "1" : void 0
2697
- }), f = m), p++, Et(e, t, d, c, g, m, p, u, a)) : (p++, a.push({
2698
- guid: C(n.uuidV4),
2699
- sqref: m,
2700
- priority: p,
2701
- rule: g,
2702
- style: c.style,
2703
- stopIfTrue: c.stopIfTrue
2704
- })) : c.condition || e.warn("Skipping conditional format with neither a condition nor a scale.");
2992
+ let g = an(h), _ = sn(s.scale, g, f);
2993
+ _ !== s.scale && (s = {
2994
+ ...s,
2995
+ scale: _
2996
+ });
2997
+ let v = _ ? { type: _.type } : x(s.condition, en(h), (t, n) => e.warn(t, void 0, n));
2998
+ v ? (v.formulas &&= v.formulas.map((e) => on(e, g, f)), _?.type === l.ScaleType.IconSet && Qt(_) ? (m++, a.push({
2999
+ guid: fe(n.uuidV4),
3000
+ sqref: h,
3001
+ priority: m,
3002
+ scale: _
3003
+ })) : _ || !rn(v) ? (h !== p && (p !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
3004
+ sqref: h,
3005
+ pivot: s.pivot ? "1" : void 0
3006
+ }), p = h), m++, $t(e, t, d, s, v, h, m, u, a)) : (m++, a.push({
3007
+ guid: fe(n.uuidV4),
3008
+ sqref: h,
3009
+ priority: m,
3010
+ rule: v,
3011
+ style: s.style,
3012
+ stopIfTrue: s.stopIfTrue
3013
+ }))) : s.condition || e.log("Skipping conditional format with neither a condition nor a scale.");
2705
3014
  }
2706
- return f !== null && t.end("conditionalFormatting"), a;
2707
- }(a, o, c, l), f = function(e, t, n, r) {
2708
- let i = [], a = r.validations, o = a ? a.length : 0;
2709
- if (o === 0) return i;
2710
- let s = [];
2711
- for (let t = 0; t < o; t++) {
2712
- let n, r, o = a[t];
2713
- Array.isArray(o) ? (n = o[0], r = o[1]) : (n = o.r, r = o.v);
2714
- let c = Ot(n);
2715
- if (!c || !r) {
2716
- e.warn?.("Skipping dataValidation with no range.");
3015
+ return p !== null && t.end("conditionalFormatting"), a;
3016
+ }(o, s, c, u), m = function(e, t, n, r) {
3017
+ let i = [], a = e.getSharedStates().get(A), o = r.validations, s = o ? o.length : 0;
3018
+ if (s === 0) return i;
3019
+ let c = [];
3020
+ for (let t = 0; t < s; t++) {
3021
+ let n, r, s = o[t];
3022
+ Array.isArray(s) ? (n = s[0], r = s[1]) : (n = s.r, r = s.v);
3023
+ let l = tn(n);
3024
+ if (!l || !r) {
3025
+ e.log("Skipping dataValidation with no range.");
2717
3026
  continue;
2718
3027
  }
2719
3028
  r.ext && e.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
2720
- let { type: l, operator: u, formula1: d, formula2: f } = b(r.condition, (t) => e.warn(t)) ?? {}, p = {
2721
- type: l,
2722
- operator: u,
3029
+ let u = (t, n) => e.warn(t, void 0, n), d = ce(r.condition, u), { type: f, operator: p } = d ?? {}, m = an(l), h = on(d?.formula1, m, a), g = on(d?.formula2, m, a), _ = {
3030
+ type: f,
3031
+ operator: p,
2723
3032
  allowBlank: Z(r.condition?.includeBlanks ?? !1),
2724
3033
  showDropDown: r.hideDropdown ? "1" : void 0,
2725
3034
  showInputMessage: Z(r.showPromptMessage),
2726
3035
  showErrorMessage: Z(r.showAlertMessage),
2727
- errorStyle: r.alertStyle ?? "information",
2728
- errorTitle: r.alertTitle,
2729
- error: r.alert,
2730
- promptTitle: r.promptTitle,
2731
- prompt: r.prompt,
3036
+ errorStyle: r.alertStyle ?? "stop",
3037
+ errorTitle: pe(r.alertTitle, "errorTitle", u),
3038
+ error: pe(r.alert, "error", u),
3039
+ promptTitle: pe(r.promptTitle, "promptTitle", u),
3040
+ prompt: pe(r.prompt, "prompt", u),
2732
3041
  imeMode: r.imeMode
2733
3042
  };
2734
- kt(d) || kt(f) ? i.push({
2735
- attrs: p,
2736
- formula1: d,
2737
- formula2: f,
2738
- sqref: c
2739
- }) : (p.sqref = c, s.push({
2740
- attrs: p,
2741
- formula1: d,
2742
- formula2: f
3043
+ nn(h) || nn(g) ? i.push({
3044
+ attrs: _,
3045
+ formula1: h,
3046
+ formula2: g,
3047
+ sqref: l
3048
+ }) : (_.sqref = l, c.push({
3049
+ attrs: _,
3050
+ formula1: h,
3051
+ formula2: g
2743
3052
  }));
2744
3053
  }
2745
- if (s.length === 0) return i;
2746
- t.start("dataValidations", { count: s.length });
2747
- for (let e = 0; e < s.length; e++) {
2748
- let { attrs: n, formula1: r, formula2: i } = s[e];
3054
+ if (c.length === 0) return i;
3055
+ t.start("dataValidations", { count: c.length });
3056
+ for (let e = 0; e < c.length; e++) {
3057
+ let { attrs: n, formula1: r, formula2: i } = c[e];
2749
3058
  r !== void 0 || i !== void 0 ? (t.start("dataValidation", n), r !== void 0 && (t.start("formula1"), t.text(r), t.end("formula1")), i !== void 0 && (t.start("formula2"), t.text(i), t.end("formula2")), t.end("dataValidation")) : t.empty("dataValidation", n);
2750
3059
  }
2751
3060
  return t.end("dataValidations"), i;
2752
- }(a, o, 0, l);
3061
+ }(o, s, 0, u);
2753
3062
  (function(e, t, n, r) {
2754
3063
  let i = r.hyperlinks, a = i ? i.length : 0;
2755
3064
  if (a !== 0) {
@@ -2762,7 +3071,7 @@ var un = (e, t, n, r, i, a = "0") => {
2762
3071
  }
2763
3072
  t.end("hyperlinks");
2764
3073
  }
2765
- })(a, o, 0, l), function(e, t, n, r) {
3074
+ })(o, s, 0, u), function(e, t, n, r) {
2766
3075
  let i = r.pageMargins;
2767
3076
  t.empty("pageMargins", {
2768
3077
  left: i?.left ?? .7,
@@ -2772,8 +3081,8 @@ var un = (e, t, n, r, i, a = "0") => {
2772
3081
  header: i?.header ?? .3,
2773
3082
  footer: i?.footer ?? .3
2774
3083
  });
2775
- }(0, o, 0, l), function(e, t, n, r) {
2776
- let i = r.movables;
3084
+ }(0, s, 0, u), function(e, t, n, r) {
3085
+ let i = r.movables?.filter(ln);
2777
3086
  if ((i ? i.length : 0) === 0 || !i.some((e) => {
2778
3087
  let t = e.content?.type;
2779
3088
  if (t === "picture" || t === "chart") return !0;
@@ -2783,14 +3092,142 @@ var un = (e, t, n, r, i, a = "0") => {
2783
3092
  }
2784
3093
  return !1;
2785
3094
  })) return;
2786
- let a = n.getMovables().getItems(), o = e.addPart("drawing", {
3095
+ let a = n.getMovables().getItems().filter((e, t) => ln(r.movables[t])), o = e.addPart("drawing", {
2787
3096
  sheet: n,
2788
3097
  movables: a,
2789
3098
  jsonMovables: i,
2790
3099
  resources: n.getResources()
2791
3100
  });
2792
3101
  t.empty("drawing", { "r:id": o.relId });
2793
- }(a, o, c, l), function(e, t, n, r) {
3102
+ }(o, s, c, u);
3103
+ let g = function(e) {
3104
+ let t = e.getComments().toArray();
3105
+ if (t.length === 0) return null;
3106
+ let n = [];
3107
+ for (let e = 0; e < t.length; e++) {
3108
+ let r = t[e], i = bt(r);
3109
+ i && n.push({
3110
+ comment: r,
3111
+ ...i
3112
+ });
3113
+ }
3114
+ return n.length === 0 ? null : (n.sort((e, t) => e.row - t.row || e.col - t.col), {
3115
+ sheet: e,
3116
+ comments: n
3117
+ });
3118
+ }(c);
3119
+ var _, v;
3120
+ cn(o, s, "legacyDrawing", ((e, t) => {
3121
+ if (!t) return e;
3122
+ let n = e?.xml ?? null, r = ge(n ?? ""), i = [], a = t.comments;
3123
+ for (let e = 0; e < a.length; e++) {
3124
+ let { comment: t, row: n, col: o } = a[e], s = t.toJSON()?.box, c = s?.xml ? ie(s.xml).notes[0] : void 0;
3125
+ if (c) {
3126
+ let e = me(c.xml);
3127
+ e !== null && (r = Math.max(r, e)), i.push(ve(c, n, o));
3128
+ } else i.push(re(n, o, ++r));
3129
+ }
3130
+ let o = ue(n, i);
3131
+ return o ? o === n ? e : e ? {
3132
+ ...e,
3133
+ xml: o
3134
+ } : { xml: o } : e;
3135
+ })(((e, t) => {
3136
+ if (!e?.xml) return e;
3137
+ let n = t.movables;
3138
+ if (!n) return e;
3139
+ let r = /* @__PURE__ */ new Map(), i = n.length;
3140
+ for (let e = 0; e < i; e++) {
3141
+ let t = n[e];
3142
+ if (ln(t)) continue;
3143
+ let i = t.content?.json?.shapeId;
3144
+ typeof i == "number" && r.set(i, t);
3145
+ }
3146
+ if (r.size === 0) return e;
3147
+ let a = e.xml.replace(/<v:shape\b[\s\S]*?<\/v:shape>/g, (e) => {
3148
+ let t = /\bo:spid="_x0000_s(\d+)"/.exec(e) ?? /\bid="_x0000_s(\d+)"/.exec(e), n = t ? r.get(parseInt(t[1], 10)) : void 0;
3149
+ if (!n) return e;
3150
+ let i = n.anchor, a = [
3151
+ i.tl.c,
3152
+ i.tl.r,
3153
+ i.br.c,
3154
+ i.br.r
3155
+ ];
3156
+ return e.replace(/(<x:Anchor>)([\s\d,-]*)(<\/x:Anchor>)/, (e, t, n, r) => {
3157
+ let i = n.split(",").map((e) => e.trim());
3158
+ if (i.length !== 8) return e;
3159
+ let o = i.slice();
3160
+ for (let e = 0; e < 4; e++) o[2 * e] = String(a[e] ?? 0);
3161
+ return o.join(",") === i.join(",") ? e : `${t}${o.join(", ")}${r}`;
3162
+ });
3163
+ });
3164
+ return a === e.xml ? e : {
3165
+ ...e,
3166
+ xml: a
3167
+ };
3168
+ })(u.legacyDrawing ?? null, u), g)), cn(o, s, "legacyDrawingHF", u.legacyDrawingHF ?? null), await async function(e, t, n) {
3169
+ let r = n.getPicture();
3170
+ if (!r) return;
3171
+ let i, a = r.getResource(), o = await a.getExternalURI();
3172
+ if (o) i = e.addExternal(G, o);
3173
+ else {
3174
+ let t = e.getSharedStates(), n = t.get(K);
3175
+ n || (n = /* @__PURE__ */ new Map(), t.set(K, n));
3176
+ let r = n.get(a);
3177
+ if (!r) {
3178
+ let e = await a.toBuffer();
3179
+ r = {
3180
+ bytes: new Uint8Array(e),
3181
+ type: await a.getType() ?? Dt,
3182
+ index: n.size + 1
3183
+ }, n.set(a, r);
3184
+ }
3185
+ i = e.addBinary(r.bytes, r.type.mime, G, `../media/image${r.index}.${r.type.ext}`, !0);
3186
+ }
3187
+ t.empty("picture", { "r:id": i.relId });
3188
+ }(o, s, c), await async function(e, t, n) {
3189
+ let r = n.movables;
3190
+ if (!r || r.every(ln)) return;
3191
+ let i = [], a = r.length;
3192
+ for (let t = 0; t < a; t++) {
3193
+ let n = r[t];
3194
+ if (ln(n)) continue;
3195
+ let a, o = n.content?.json ?? {}, s = o.part;
3196
+ if (s) try {
3197
+ a = (await et(s.type ? s : {
3198
+ ...s,
3199
+ type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp"
3200
+ }, e, "../ctrlProps/ctrlProp{n}.xml"))?.relId ?? void 0;
3201
+ } catch (t) {
3202
+ e.log(`Unable to write the properties of the control '${n.name}'`, t);
3203
+ }
3204
+ a ? i.push({
3205
+ jsonMovable: n,
3206
+ jsonControl: o,
3207
+ relId: a
3208
+ }) : e.log(`The control '${n.name}' has no properties to write and was dropped.`);
3209
+ }
3210
+ if (i.length === 0) return;
3211
+ t.start("mc:AlternateContent", {
3212
+ "xmlns:x14": M,
3213
+ "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
3214
+ }), t.start("mc:Choice", { Requires: "x14" }), t.start("controls");
3215
+ let o = i.length;
3216
+ for (let e = 0; e < o; e++) {
3217
+ let { jsonMovable: n, jsonControl: r, relId: a } = i[e];
3218
+ t.start("mc:AlternateContent"), t.start("mc:Choice", { Requires: "x14" }), t.start("control", {
3219
+ shapeId: r.shapeId,
3220
+ "r:id": a,
3221
+ name: n.name ?? void 0
3222
+ });
3223
+ let o = n.anchorType ?? "twoCell";
3224
+ t.start("controlPr", r.props), t.start("anchor", {
3225
+ moveWithCells: o === "absolute" ? void 0 : "1",
3226
+ sizeWithCells: o === "twoCell" ? "1" : void 0
3227
+ }), un(t, "from", n.anchor.tl), un(t, "to", n.anchor.br), t.end("anchor"), r.xml && t.raw(r.xml), t.end("controlPr"), t.end("control"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3228
+ }
3229
+ t.end("controls"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3230
+ }(o, s, u), function(e, t, n, r) {
2794
3231
  let i = r.tables, a = i ? i.length : 0;
2795
3232
  if (a === 0) return;
2796
3233
  let o = n.getTables().getItems();
@@ -2806,48 +3243,48 @@ var un = (e, t, n, r, i, a = "0") => {
2806
3243
  l["r:id"] = c.relId, t.empty("tablePart", l);
2807
3244
  }
2808
3245
  t.end("tableParts");
2809
- }(a, o, c, l), function(e, t, n, r, i) {
3246
+ }(o, s, c, u), function(e, t, n, r, i) {
2810
3247
  if (r.length === 0 && i.length === 0) return;
2811
3248
  let a = n.getStyles(), o = a.getTheme();
2812
3249
  if (t.start("extLst"), r.length > 0) {
2813
3250
  t.start("ext", {
2814
- uri: w,
2815
- "xmlns:x14": se
3251
+ uri: N,
3252
+ "xmlns:x14": M
2816
3253
  }), t.start("x14:conditionalFormattings");
2817
3254
  for (let e = 0; e < r.length; e++) {
2818
- let { guid: n, sqref: i, priority: c, scale: l, rule: u, style: d, stopIfTrue: f } = r[e];
2819
- if (t.start("x14:conditionalFormatting", { "xmlns:xm": "http://schemas.microsoft.com/office/excel/2006/main" }), l) if (l.type === s.ScaleType.DataBar) {
3255
+ let { guid: n, sqref: i, priority: s, scale: c, rule: u, style: d, stopIfTrue: f } = r[e];
3256
+ if (t.start("x14:conditionalFormatting", { "xmlns:xm": "http://schemas.microsoft.com/office/excel/2006/main" }), c) if (c.type === l.ScaleType.DataBar) {
2820
3257
  t.start("x14:cfRule", {
2821
3258
  type: "dataBar",
2822
3259
  id: n
2823
3260
  }), t.start("x14:dataBar", {
2824
- minLength: l.minLength,
2825
- maxLength: l.maxLength,
2826
- gradient: l.gradient ? void 0 : "0",
2827
- border: l.borderColor ? "1" : void 0,
2828
- direction: l.direction,
2829
- negativeBarColorSameAsPositive: l.negativeFillColor ? "0" : "1",
2830
- negativeBarBorderColorSameAsPositive: l.negativeBorderColor ? "0" : void 0,
2831
- axisPosition: l.axisPosition
3261
+ minLength: c.minLength,
3262
+ maxLength: c.maxLength,
3263
+ gradient: c.gradient ? void 0 : "0",
3264
+ border: c.borderColor ? "1" : void 0,
3265
+ direction: c.direction,
3266
+ negativeBarColorSameAsPositive: c.negativeFillColor ? "0" : "1",
3267
+ negativeBarBorderColorSameAsPositive: c.negativeBorderColor ? "0" : void 0,
3268
+ axisPosition: c.axisPosition
2832
3269
  });
2833
- let e = l.stops ?? [];
2834
- if (e.length === 0) Ct(t, { type: s.ColorStopType.AutoMin }), Ct(t, { type: s.ColorStopType.AutoMax });
2835
- else for (let n = 0; n < e.length; n++) Ct(t, e[n]);
2836
- l.borderColor && U(t, o, l.borderColor, "x14:borderColor"), l.negativeFillColor && U(t, o, l.negativeFillColor, "x14:negativeFillColor"), l.negativeBorderColor && U(t, o, l.negativeBorderColor, "x14:negativeBorderColor"), l.axisColor && U(t, o, l.axisColor, "x14:axisColor"), t.end("x14:dataBar"), t.end("x14:cfRule");
3270
+ let e = c.stops ?? [];
3271
+ if (e.length === 0) Xt(t, { type: l.ColorStopType.AutoMin }), Xt(t, { type: l.ColorStopType.AutoMax });
3272
+ else for (let n = 0; n < e.length; n++) Xt(t, e[n]);
3273
+ c.borderColor && H(t, o, c.borderColor, "x14:borderColor"), c.negativeFillColor && H(t, o, c.negativeFillColor, "x14:negativeFillColor"), c.negativeBorderColor && H(t, o, c.negativeBorderColor, "x14:negativeBorderColor"), c.axisColor && H(t, o, c.axisColor, "x14:axisColor"), t.end("x14:dataBar"), t.end("x14:cfRule");
2837
3274
  } else {
2838
3275
  t.start("x14:cfRule", {
2839
3276
  type: "iconSet",
2840
- priority: c,
3277
+ priority: s,
2841
3278
  id: n
2842
3279
  }), t.start("x14:iconSet", {
2843
- iconSet: l.iconSet,
2844
- reverse: Z(l.reverse),
2845
- showValue: Z(l.showValue),
2846
- custom: (l.icon?.length ?? 0) > 0 ? "1" : void 0
3280
+ iconSet: c.iconSet,
3281
+ reverse: Z(c.reverse),
3282
+ showValue: Z(c.showValue),
3283
+ custom: (c.icon?.length ?? 0) > 0 ? "1" : void 0
2847
3284
  });
2848
- let e = l.stops ?? [];
2849
- for (let n = 0; n < e.length; n++) Ct(t, e[n]);
2850
- let r = l.icon ?? [];
3285
+ let e = c.stops ?? [];
3286
+ for (let n = 0; n < e.length; n++) Xt(t, e[n]);
3287
+ let r = c.icon ?? [];
2851
3288
  for (let e = 0; e < r.length; e++) t.empty("x14:cfIcon", {
2852
3289
  iconSet: r[e].set,
2853
3290
  iconId: r[e].id
@@ -2857,7 +3294,7 @@ var un = (e, t, n, r, i, a = "0") => {
2857
3294
  else {
2858
3295
  t.start("x14:cfRule", {
2859
3296
  type: u.type,
2860
- priority: c,
3297
+ priority: s,
2861
3298
  stopIfTrue: Z(f),
2862
3299
  aboveAverage: Z(u.aboveAverage),
2863
3300
  equalAverage: Z(u.equalAverage),
@@ -2872,7 +3309,7 @@ var un = (e, t, n, r, i, a = "0") => {
2872
3309
  });
2873
3310
  let e = u.formulas ?? [];
2874
3311
  for (let n = 0; n < e.length; n++) t.start("xm:f"), t.text(e[n]), t.end("xm:f");
2875
- d && Object.keys(d).length > 0 && dt(0, t, d, a, o, "x14:dxf"), t.end("x14:cfRule");
3312
+ d && Object.keys(d).length > 0 && Rt(0, t, d, a, o, "x14:dxf"), t.end("x14:cfRule");
2876
3313
  }
2877
3314
  t.start("xm:sqref"), t.text(i), t.end("xm:sqref"), t.end("x14:conditionalFormatting");
2878
3315
  }
@@ -2880,10 +3317,10 @@ var un = (e, t, n, r, i, a = "0") => {
2880
3317
  }
2881
3318
  if (i.length > 0) {
2882
3319
  t.start("ext", {
2883
- uri: D,
2884
- "xmlns:x14": se
3320
+ uri: ee,
3321
+ "xmlns:x14": M
2885
3322
  }), t.start("x14:dataValidations", {
2886
- "xmlns:xm": y,
3323
+ "xmlns:xm": O,
2887
3324
  count: i.length
2888
3325
  });
2889
3326
  for (let e = 0; e < i.length; e++) {
@@ -2893,10 +3330,16 @@ var un = (e, t, n, r, i, a = "0") => {
2893
3330
  t.end("x14:dataValidations"), t.end("ext");
2894
3331
  }
2895
3332
  t.end("extLst");
2896
- }(0, o, c, d, f), o.end("worksheet"), o.close();
3333
+ }(0, s, c, p, m), function(e, t) {
3334
+ let n = t.pivotTables, r = n ? n.length : 0;
3335
+ for (let t = 0; t < r; t++) {
3336
+ let r = n[t], i = r.part;
3337
+ i?.xml && (rt(e, r.cacheId) ? e.addPart("pivotTable", r) : e.log(`The pivot table '${i.name ?? ""}' has no cache with id ${r.cacheId} and was dropped.`));
3338
+ }
3339
+ }(o, u), _ = o, (v = g) && (_.addPart("comments", v), v.comments.some((e) => !e.comment.isNote()) && _.addPart("threadedComments", v)), s.end("worksheet"), s.close();
2897
3340
  }
2898
3341
  }(),
2899
- new class extends F {
3342
+ new class extends L {
2900
3343
  constructor() {
2901
3344
  super({
2902
3345
  kind: "sharedStrings",
@@ -2915,13 +3358,13 @@ var un = (e, t, n, r, i, a = "0") => {
2915
3358
  for (let e = 0; e < i; e++) {
2916
3359
  let t = r[e];
2917
3360
  n.start("si");
2918
- let i = ee.test(t) ? re : void 0;
2919
- n.start("t", i), n.text(ne(t)), n.end("t"), n.end("si");
3361
+ let i = oe.test(t) ? b : void 0;
3362
+ n.start("t", i), n.text(te(t)), n.end("t"), n.end("si");
2920
3363
  }
2921
3364
  n.end("sst"), n.close();
2922
3365
  }
2923
3366
  }(),
2924
- new class extends F {
3367
+ new class extends L {
2925
3368
  constructor() {
2926
3369
  super({
2927
3370
  kind: "theme",
@@ -2939,22 +3382,22 @@ var un = (e, t, n, r, i, a = "0") => {
2939
3382
  let i = n?.getColorScheme();
2940
3383
  if (i) {
2941
3384
  t.start(r, { name: i.getName() || "Office" });
2942
- for (let e of Ve) t.start(e), V(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
3385
+ for (let e of dt) t.start(e), B(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
2943
3386
  t.end(r);
2944
3387
  }
2945
3388
  }(0, n, r, "clrScheme"), function(e, t, n, r) {
2946
- n && (t.start(r, { name: n.getName() || "Office" }), It(0, t, n.getMajorFont() || "Calibri Light", "majorFont"), It(0, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
3389
+ n && (t.start(r, { name: n.getName() || "Office" }), gn(0, t, n.getMajorFont() || "Calibri Light", "majorFont"), gn(0, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
2947
3390
  }(0, n, r.getFontScheme(), "fontScheme"), function(e, t, n, r, i) {
2948
3391
  i?.fillStyleLst && i?.lnStyleLst && i?.effectStyleLst && i?.bgFillStyleLst ? function(e, t, n, r, i) {
2949
3392
  let a = { getTheme: () => r };
2950
3393
  t.start(n, { name: "Office" }), t.start("fillStyleLst");
2951
- for (let e of i.fillStyleLst) G(0, t, e, a);
3394
+ for (let e of i.fillStyleLst) W(0, t, e, a);
2952
3395
  t.end("fillStyleLst"), t.start("lnStyleLst");
2953
- for (let e of i.lnStyleLst) qe(0, t, e, a);
3396
+ for (let e of i.lnStyleLst) xt(0, t, e, a);
2954
3397
  t.end("lnStyleLst"), t.start("effectStyleLst");
2955
- for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? Xe(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
3398
+ for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? wt(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
2956
3399
  t.end("effectStyleLst"), t.start("bgFillStyleLst");
2957
- for (let e of i.bgFillStyleLst) G(0, t, e, a);
3400
+ for (let e of i.bgFillStyleLst) W(0, t, e, a);
2958
3401
  t.end("bgFillStyleLst"), t.end(n);
2959
3402
  }(e, t, n, r, i) : i?.formatSchemeXml ? t.raw(i.formatSchemeXml) : (t.start(n, { name: "Office" }), function(e, t) {
2960
3403
  t.start("fillStyleLst"), t.start("solidFill"), t.empty("schemeClr", { val: "phClr" }), t.end("solidFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "50000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "35000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "37000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "15000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("lin", {
@@ -3003,7 +3446,7 @@ var un = (e, t, n, r, i, a = "0") => {
3003
3446
  }(t, n, "fmtScheme", r, i), n.end("themeElements"), n.start("objectDefaults"), n.end("objectDefaults"), n.start("extraClrSchemeLst"), n.end("extraClrSchemeLst"), n.end("theme"), n.close();
3004
3447
  }
3005
3448
  }(),
3006
- new class extends F {
3449
+ new class extends L {
3007
3450
  constructor() {
3008
3451
  super({
3009
3452
  kind: "styles",
@@ -3012,8 +3455,8 @@ var un = (e, t, n, r, i, a = "0") => {
3012
3455
  path: "/xl/styles.xml"
3013
3456
  });
3014
3457
  }
3015
- async emit(e, t) {
3016
- let i = t.getXMLWriter(), a = e.json, o = (e.theme, e.styles);
3458
+ async emit(t, r) {
3459
+ let i = r.getXMLWriter(), a = t.json, o = (t.theme, t.styles);
3017
3460
  i.decl(), i.start("styleSheet", {
3018
3461
  xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3019
3462
  "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
@@ -3029,11 +3472,11 @@ var un = (e, t, n, r, i, a = "0") => {
3029
3472
  for (let t = 0; t < r; t++) {
3030
3473
  let r = t === 0 ? {
3031
3474
  ...n[t],
3032
- named: d.BuiltInName.Normal
3475
+ named: f.BuiltInName.Normal
3033
3476
  } : n[t], a = e.resolve(r), o = {};
3034
- r.named !== void 0 && (o.named = r.named), r.quotePrefix !== void 0 && (o.quotePrefix = r.quotePrefix);
3035
- for (let e = 0; e < it.length; e++) {
3036
- let t = it[e];
3477
+ r.named !== void 0 && (o.named = r.named), r.quotePrefix !== void 0 && (o.quotePrefix = r.quotePrefix), r.protection !== void 0 && (o.protection = r.protection);
3478
+ for (let e = 0; e < jt.length; e++) {
3479
+ let t = jt[e];
3037
3480
  if (r[t] === void 0 && t !== "alignment") continue;
3038
3481
  let n = a?.[t] ?? r[t];
3039
3482
  n !== void 0 && (o[t] = n);
@@ -3041,7 +3484,7 @@ var un = (e, t, n, r, i, a = "0") => {
3041
3484
  i[t] = o;
3042
3485
  }
3043
3486
  return i;
3044
- }(o, a), c = function(e, t, i) {
3487
+ }(o, a), c = function(t, r, i) {
3045
3488
  let a = {
3046
3489
  fontMap: /* @__PURE__ */ new Map(),
3047
3490
  fonts: [],
@@ -3054,45 +3497,45 @@ var un = (e, t, n, r, i, a = "0") => {
3054
3497
  namedStyleMap: /* @__PURE__ */ new Map(),
3055
3498
  namedStyles: []
3056
3499
  };
3057
- (function(e, t) {
3058
- let n = (e.getNamed(d.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3059
- t.fontMap.set(r.JSONStableStringify(n), "0"), t.fonts.push(n);
3060
- })(e, a), function(e) {
3061
- let t = { type: "none" };
3062
- e.fillMap.set(r.JSONStableStringify(t), "0"), e.fills.push(t);
3063
- let n = {
3500
+ (function(t, n) {
3501
+ let r = (t.getNamedStyles().getByName(f.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3502
+ n.fontMap.set(e.JSONStableStringify(r), "0"), n.fonts.push(r);
3503
+ })(t, a), function(t) {
3504
+ let n = { type: "none" };
3505
+ t.fillMap.set(e.JSONStableStringify(n), "0"), t.fills.push(n);
3506
+ let r = {
3064
3507
  type: "pattern",
3065
3508
  patternType: "gray125"
3066
3509
  };
3067
- e.fillMap.set(r.JSONStableStringify(n), "1"), e.fills.push(n);
3068
- }(a), function(e) {
3069
- let t = {
3510
+ t.fillMap.set(e.JSONStableStringify(r), "1"), t.fills.push(r);
3511
+ }(a), function(t) {
3512
+ let n = {
3070
3513
  bottom: { style: "none" },
3071
3514
  left: { style: "none" },
3072
3515
  right: { style: "none" },
3073
3516
  top: { style: "none" }
3074
3517
  };
3075
- e.borderMap.set(r.JSONStableStringify(t), "0"), e.borders.push(t);
3518
+ t.borderMap.set(e.JSONStableStringify(n), "0"), t.borders.push(n);
3076
3519
  }(a), function(e, t) {
3077
- ot(e, e.getNamed(d.BuiltInName.Normal).toJSON(), t);
3078
- }(e, a);
3079
- let o = t?.named ?? n.EmptyArray;
3080
- for (let t of o) ot(e, t, a);
3081
- for (let t of i) at(e, t, a);
3520
+ Nt(e, e.getNamedStyles().getByName(f.BuiltInName.Normal).toJSON(), t);
3521
+ }(t, a);
3522
+ let o = r?.named ?? n.EmptyArray;
3523
+ for (let e of o) Nt(t, e, a);
3524
+ for (let e of i) Mt(t, e, a);
3082
3525
  return a;
3083
- }(o, a, s), l = t.getSharedStates().get(rt), u = function(e, t = 0) {
3526
+ }(o, a, s), l = r.getSharedStates().get(At), u = function(e, t = 0) {
3084
3527
  let n = e?.tables;
3085
3528
  if (!n) return null;
3086
3529
  let r = n.styles;
3087
3530
  if (!r) return null;
3088
- let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...pt].reverse();
3531
+ let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...Bt].reverse();
3089
3532
  for (let e of o) {
3090
3533
  let n = r[e];
3091
3534
  for (let r of s) {
3092
3535
  let o = n[r];
3093
3536
  if (!o) continue;
3094
3537
  let s = {};
3095
- if (o.font && (s.font = o.font), o.fill && (s.fill = o.fill), o.border && (s.border = o.border), o.numberFormat !== void 0 && (s.numberFormat = o.numberFormat), Object.keys(s).length === 0) continue;
3538
+ if (o.font && (s.font = o.font), o.fill && (s.fill = o.fill), o.borders && (s.borders = o.borders), o.numberFormat !== void 0 && (s.numberFormat = o.numberFormat), Object.keys(s).length === 0) continue;
3096
3539
  let c = t + i.length;
3097
3540
  i.push(s);
3098
3541
  let l = `${e}:${r}`;
@@ -3111,7 +3554,7 @@ var un = (e, t, n, r, i, a = "0") => {
3111
3554
  for (let e = 0; e < i; e++) {
3112
3555
  let n = r[e];
3113
3556
  t.empty("numFmt", {
3114
- numFmtId: String(e + ft),
3557
+ numFmtId: String(e + zt),
3115
3558
  formatCode: n
3116
3559
  });
3117
3560
  }
@@ -3123,30 +3566,31 @@ var un = (e, t, n, r, i, a = "0") => {
3123
3566
  count: String(a),
3124
3567
  "x14ac:knownFonts": "1"
3125
3568
  });
3126
- for (let e of i) st(0, t, e, n);
3569
+ for (let e of i) Pt(0, t, e, n);
3127
3570
  t.end("fonts");
3128
3571
  }(0, i, o, c), function(e, t, n, r) {
3129
3572
  let i = r.fills, a = i.length;
3130
3573
  t.start("fills", { count: String(a) });
3131
- for (let e of i) G(0, t, e, n, !0);
3574
+ for (let e of i) W(0, t, e, n, !0);
3132
3575
  t.end("fills");
3133
3576
  }(0, i, o, c), function(e, t, n, r) {
3134
3577
  let i = r.borders, a = i.length;
3135
3578
  t.start("borders", { count: String(a) });
3136
3579
  let o = n.getTheme();
3137
- for (let e of i) ct(0, t, e, o, !1);
3580
+ for (let e of i) Ft(0, t, e, o, !1);
3138
3581
  t.end("borders");
3139
3582
  }(0, i, o, c), function(e, t, r, i, a) {
3140
3583
  let o = a.namedStyles, s = o.length;
3141
3584
  t.start("cellStyleXfs", { count: String(s) });
3142
- for (let e of o) ut(0, t, r, e.style ?? n.EmptyObject, a, !1);
3585
+ for (let e of o) Lt(0, t, r, e.style ?? n.EmptyObject, a, !1);
3143
3586
  t.end("cellStyleXfs");
3144
- }(0, i, o, 0, c), function(e, t, n, r, i) {
3145
- let a = r.length;
3146
- t.start("cellXfs", { count: String(a) });
3147
- for (let e = 0; e < a; e++) ut(0, t, n, r[e], i, !0);
3587
+ }(0, i, o, 0, c), function(e, t, n, r, i, a) {
3588
+ let o = r.length, s = a?.getSources() ?? [];
3589
+ t.start("cellXfs", { count: String(o + s.length) });
3590
+ for (let e = 0; e < o; e++) Lt(0, t, n, r[e], i, !0);
3591
+ for (let e = 0; e < s.length; e++) Lt(0, t, n, r[s[e]], i, !0, !0);
3148
3592
  t.end("cellXfs");
3149
- }(0, i, o, s, c), function(e, t, n, r, i) {
3593
+ }(0, i, o, s, c, r.getSharedStates().get(qe)), function(e, t, n, r, i) {
3150
3594
  let a = i.namedStyles, o = a.length;
3151
3595
  t.start("cellStyles", { count: String(o) });
3152
3596
  let s = i.namedStyleMap;
@@ -3157,7 +3601,7 @@ var un = (e, t, n, r, i, a = "0") => {
3157
3601
  };
3158
3602
  r.hidden && (c.hidden = "1"), r.iLevel && (c.iLevel = String(r.iLevel));
3159
3603
  let l = null;
3160
- l = o === d.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamed(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
3604
+ l = o === f.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamedStyles().getByName(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
3161
3605
  }
3162
3606
  t.end("cellStyles");
3163
3607
  }(0, i, o, 0, c), function(e, t, n, r, i) {
@@ -3165,8 +3609,8 @@ var un = (e, t, n, r, i, a = "0") => {
3165
3609
  if (a.length === 0) return void t.empty("dxfs", { count: "0" });
3166
3610
  let o = n.getTheme();
3167
3611
  t.start("dxfs", { count: String(a.length) });
3168
- let s = ft;
3169
- for (let e of a) s = dt(0, t, e, n, o, "dxf", s);
3612
+ let s = zt;
3613
+ for (let e of a) s = Rt(0, t, e, n, o, "dxf", s);
3170
3614
  t.end("dxfs");
3171
3615
  }(0, i, o, u, l), function(e, t, n, r, i) {
3172
3616
  let a = r?.tables, o = a?.styles ?? null, s = o ? Object.keys(o) : null, c = s ? s.length : 0, l = {
@@ -3178,7 +3622,7 @@ var un = (e, t, n, r, i, a = "0") => {
3178
3622
  t.start("tableStyles", l);
3179
3623
  for (let e of s) {
3180
3624
  let n = o[e], r = [];
3181
- for (let e of pt) {
3625
+ for (let e of Bt) {
3182
3626
  let t = n[e];
3183
3627
  t && r.push([e, t]);
3184
3628
  }
@@ -3202,7 +3646,7 @@ var un = (e, t, n, r, i, a = "0") => {
3202
3646
  if (t.start("colors"), i) {
3203
3647
  t.start("indexedColors");
3204
3648
  for (let e of r.indexedColors) {
3205
- let n = Ke(e, !0);
3649
+ let n = gt(e, !0);
3206
3650
  t.empty("rgbColor", { rgb: n });
3207
3651
  }
3208
3652
  t.end("indexedColors");
@@ -3210,7 +3654,7 @@ var un = (e, t, n, r, i, a = "0") => {
3210
3654
  if (a) {
3211
3655
  t.start("mruColors");
3212
3656
  for (let e of r.mruColors) {
3213
- let n = Ke(e);
3657
+ let n = gt(e);
3214
3658
  t.empty("color", { rgb: n });
3215
3659
  }
3216
3660
  t.end("mruColors");
@@ -3228,7 +3672,7 @@ var un = (e, t, n, r, i, a = "0") => {
3228
3672
  }(0, i), i.end("styleSheet"), i.close();
3229
3673
  }
3230
3674
  }(),
3231
- new class extends F {
3675
+ new class extends L {
3232
3676
  constructor() {
3233
3677
  super({
3234
3678
  kind: "propsCore",
@@ -3249,14 +3693,14 @@ var un = (e, t, n, r, i, a = "0") => {
3249
3693
  let r = /* @__PURE__ */ new Date(), i = [
3250
3694
  ["creator", "SheetXL"],
3251
3695
  ["lastModifiedBy", "SheetXL"],
3252
- ["created", Lt(r)],
3253
- ["modified", Lt(r)]
3696
+ ["created", _n(r)],
3697
+ ["modified", _n(r)]
3254
3698
  ];
3255
- for (let e of i) Rt(n, e[0], e[1]);
3699
+ for (let e of i) vn(n, e[0], e[1]);
3256
3700
  n.end("cp:coreProperties"), n.close();
3257
3701
  }
3258
3702
  }(),
3259
- new class extends F {
3703
+ new class extends L {
3260
3704
  constructor() {
3261
3705
  super({
3262
3706
  kind: "propsApp",
@@ -3266,19 +3710,12 @@ var un = (e, t, n, r, i, a = "0") => {
3266
3710
  });
3267
3711
  }
3268
3712
  async emit(e, t) {
3269
- let n = t.getXMLWriter(), r = e.model, i = await c.getDetails(), a = function(e) {
3270
- if (!e || typeof e != "string") return yt;
3271
- if (e === "local" || e === "dev" || e === "development") return "00.0000";
3272
- let t = e.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
3273
- if (!t) return yt;
3274
- let n = parseInt(t[1], 10), r = parseInt(t[2] || "0", 10);
3275
- return n > 99 || r > 9999 ? yt : `${n.toString()}.${r.toString().padStart(4, "0")}`;
3276
- }(i.getBuildVersion()), o = i.getLicensee() || "";
3713
+ let n = t.getXMLWriter(), r = e.model, i = await m.getDetails(), a = j(i.getBuildVersion()), o = i.getLicensee() || "";
3277
3714
  n.setValidationDisabled(!0), n.decl(), n.start("Properties", {
3278
3715
  xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3279
3716
  "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3280
3717
  }), Q(0, n, "Application", "SheetXL"), Q(0, n, "DocSecurity", "0"), Q(0, n, "ScaleCrop", "false"), ((e, t, n) => {
3281
- let r = n.getSheets().getItems({ visibility: h.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
3718
+ let r = n.getSheets().getItems({ visibility: u.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
3282
3719
  t.start("HeadingPairs"), t.start("vt:vector", {
3283
3720
  size: i.length > 0 ? "4" : "2",
3284
3721
  baseType: "variant"
@@ -3292,7 +3729,7 @@ var un = (e, t, n, r, i, a = "0") => {
3292
3729
  })(0, n, r), Q(0, n, "Company", o), Q(0, n, "LinksUpToDate", "false"), Q(0, n, "SharedDoc", "false"), Q(0, n, "HyperlinksChanged", "false"), Q(0, n, "AppVersion", a), n.end("Properties"), n.close();
3293
3730
  }
3294
3731
  }(),
3295
- new class extends F {
3732
+ new class extends L {
3296
3733
  constructor() {
3297
3734
  super({
3298
3735
  kind: "metadata",
@@ -3307,11 +3744,11 @@ var un = (e, t, n, r, i, a = "0") => {
3307
3744
  let d = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3308
3745
  if (r && (d["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), i && (d["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), n.decl(), n.start("metadata", d), n.start("metadataTypes", { count: u }), r && n.empty("metadataType", {
3309
3746
  name: "XLDAPR",
3310
- ...zt,
3747
+ ...yn,
3311
3748
  cellMeta: "1"
3312
3749
  }), i && n.empty("metadataType", {
3313
3750
  name: "XLRICHVALUE",
3314
- ...zt
3751
+ ...yn
3315
3752
  }), n.end("metadataTypes"), r) {
3316
3753
  n.start("futureMetadata", {
3317
3754
  name: "XLDAPR",
@@ -3350,7 +3787,7 @@ var un = (e, t, n, r, i, a = "0") => {
3350
3787
  n.end("metadata"), n.close();
3351
3788
  }
3352
3789
  }(),
3353
- new class extends F {
3790
+ new class extends L {
3354
3791
  constructor() {
3355
3792
  super({
3356
3793
  kind: "richValue",
@@ -3375,7 +3812,7 @@ var un = (e, t, n, r, i, a = "0") => {
3375
3812
  n.end("rvData"), n.close();
3376
3813
  }
3377
3814
  }(),
3378
- new class extends F {
3815
+ new class extends L {
3379
3816
  constructor() {
3380
3817
  super({
3381
3818
  kind: "richValueStructure",
@@ -3401,7 +3838,7 @@ var un = (e, t, n, r, i, a = "0") => {
3401
3838
  n.end("rvStructures"), n.close();
3402
3839
  }
3403
3840
  }(),
3404
- new class extends F {
3841
+ new class extends L {
3405
3842
  constructor() {
3406
3843
  super({
3407
3844
  kind: "richValueTypes",
@@ -3442,7 +3879,7 @@ var un = (e, t, n, r, i, a = "0") => {
3442
3879
  n.end("keyFlags"), n.end("global"), n.end("rvTypesInfo"), n.close();
3443
3880
  }
3444
3881
  }(),
3445
- new class extends F {
3882
+ new class extends L {
3446
3883
  constructor() {
3447
3884
  super({
3448
3885
  kind: "drawing",
@@ -3477,24 +3914,24 @@ var un = (e, t, n, r, i, a = "0") => {
3477
3914
  }
3478
3915
  for (let e = 0; e < s; e++) {
3479
3916
  let s = o[e], c = a[e], l = s.content?.type;
3480
- switch (n.start("twoCellAnchor", { editAs: s.anchorType || "twoCell" }), on(n, "from", s.anchor.tl), on(n, "to", s.anchor.br), l) {
3917
+ switch (n.start("twoCellAnchor", { editAs: s.anchorType || "twoCell" }), Rn(n, "from", s.anchor.tl), Rn(n, "to", s.anchor.br), l) {
3481
3918
  case "picture":
3482
- await Kt(t, i, r, c, s);
3919
+ await En(t, i, r, c, s);
3483
3920
  break;
3484
3921
  case "chart":
3485
- await Jt(t, i, r, c, s, u.get(s));
3922
+ await Dn(t, i, r, c, s, u.get(s));
3486
3923
  break;
3487
3924
  case "shape":
3488
- await Qt(t, i, r, c, s, u.get(s));
3925
+ await jn(t, i, r, c, s, u.get(s));
3489
3926
  break;
3490
3927
  case "smartArt":
3491
- await Yt(t, i, r, c, s);
3928
+ await On(t, i, r, c, s);
3492
3929
  break;
3493
3930
  case "slicer":
3494
- await Xt(t, i, r, c, s);
3931
+ await kn(t, i, r, c, s);
3495
3932
  break;
3496
3933
  case "graphicFrame":
3497
- await Zt(t, i, r, c, s);
3934
+ await An(t, i, r, c, s);
3498
3935
  break;
3499
3936
  default: await $(t, i, r, c, s);
3500
3937
  }
@@ -3503,7 +3940,182 @@ var un = (e, t, n, r, i, a = "0") => {
3503
3940
  n.end("wsDr"), n.close();
3504
3941
  }
3505
3942
  }(),
3506
- new class extends F {
3943
+ new class extends L {
3944
+ constructor() {
3945
+ super({
3946
+ kind: "legacyDrawing",
3947
+ contentType: "application/vnd.openxmlformats-officedocument.vmlDrawing",
3948
+ relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
3949
+ path: "../drawings/vmlDrawing{n}.vml"
3950
+ });
3951
+ }
3952
+ async emit(e, t) {
3953
+ let n = e.images, r = n ? n.length : 0;
3954
+ if (r > 0) {
3955
+ let e = t.getSharedStates().get(be);
3956
+ for (let i = 0; i < r; i++) {
3957
+ let r = n[i], a = e?.get(r.resId);
3958
+ if (a) try {
3959
+ await zn(t, r.id, a);
3960
+ } catch (e) {
3961
+ t.log(`Unable to write legacy drawing image '${r.id}'`, e);
3962
+ }
3963
+ else t.log(`Legacy drawing image '${r.id}' has no resource ${r.resId} and was not written.`);
3964
+ }
3965
+ }
3966
+ let i = t.getXMLWriter();
3967
+ i.setValidationDisabled(!0), i.raw(e.xml), i.close();
3968
+ }
3969
+ }(),
3970
+ new class extends L {
3971
+ constructor() {
3972
+ super({
3973
+ kind: "embeddedPart",
3974
+ contentType: Qe,
3975
+ relTypeUri: ""
3976
+ });
3977
+ }
3978
+ getContentType(e) {
3979
+ return e?.contentType || Qe;
3980
+ }
3981
+ getRelTypeUri(e) {
3982
+ return e?.type ?? "";
3983
+ }
3984
+ getPath(e) {
3985
+ return `./${tt(e.name)}`;
3986
+ }
3987
+ async emit(e, t) {
3988
+ await $e(e, t);
3989
+ let n = t.getXMLWriter();
3990
+ n.setValidationDisabled(!0), n.raw(e.xml ?? ""), n.close();
3991
+ }
3992
+ }(),
3993
+ new class extends L {
3994
+ constructor() {
3995
+ super({
3996
+ kind: "pivotTable",
3997
+ contentType: nt,
3998
+ relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
3999
+ path: "../pivotTables/pivotTable{n}.xml"
4000
+ });
4001
+ }
4002
+ getContentType(e) {
4003
+ return e?.part?.contentType || nt;
4004
+ }
4005
+ async emit(e, t) {
4006
+ let n = e.part;
4007
+ await $e(n, t);
4008
+ let r = rt(t, e.cacheId);
4009
+ if (!r || !t.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition", r)) throw Error(`Pivot table '${n.name ?? ""}' has no cache with id ${e.cacheId}.`);
4010
+ let i = t.getXMLWriter();
4011
+ i.setValidationDisabled(!0), i.raw(n.xml ?? ""), i.close();
4012
+ }
4013
+ }(),
4014
+ new class extends L {
4015
+ constructor() {
4016
+ super({
4017
+ kind: "comments",
4018
+ contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
4019
+ relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
4020
+ path: "../comments{n}.xml"
4021
+ });
4022
+ }
4023
+ async emit(e, t) {
4024
+ let n = t.getXMLWriter();
4025
+ n.decl(), n.start("comments", {
4026
+ xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4027
+ "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4028
+ "mc:Ignorable": "xr",
4029
+ "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
4030
+ });
4031
+ let r = [], i = /* @__PURE__ */ new Map(), a = (e) => {
4032
+ let t = i.get(e);
4033
+ return t === void 0 && (t = r.length, r.push(e), i.set(e, t)), t;
4034
+ }, o = e.comments, s = [];
4035
+ for (let e = 0; e < o.length; e++) {
4036
+ let { comment: t, ref: n } = o[e];
4037
+ t.isNote() ? s.push({
4038
+ ref: n,
4039
+ authorId: a(t.getAuthor()?.getDisplayName() ?? ""),
4040
+ content: t.getRichContent() ?? t.getContent()
4041
+ }) : s.push({
4042
+ ref: n,
4043
+ authorId: a(`tc={${t.getId().toUpperCase()}}`),
4044
+ content: _t(t)
4045
+ });
4046
+ }
4047
+ n.start("authors");
4048
+ for (let e = 0; e < r.length; e++) n.start("author"), n.text(r[e]), n.end("author");
4049
+ n.end("authors"), n.start("commentList");
4050
+ for (let e = 0; e < s.length; e++) {
4051
+ let t = s[e];
4052
+ n.start("comment", {
4053
+ ref: t.ref,
4054
+ authorId: t.authorId,
4055
+ shapeId: 0
4056
+ }), n.start("text"), vt(n, t.content), n.end("text"), n.end("comment");
4057
+ }
4058
+ n.end("commentList"), n.end("comments"), n.close();
4059
+ }
4060
+ }(),
4061
+ new class extends L {
4062
+ constructor() {
4063
+ super({
4064
+ kind: "threadedComments",
4065
+ contentType: "application/vnd.ms-excel.threadedcomments+xml",
4066
+ relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
4067
+ path: "../threadedComments/threadedComment{n}.xml"
4068
+ });
4069
+ }
4070
+ async emit(e, t) {
4071
+ let n = t.getXMLWriter();
4072
+ n.decl(), n.start("ThreadedComments", {
4073
+ xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4074
+ "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4075
+ });
4076
+ let r = e.comments;
4077
+ for (let e = 0; e < r.length; e++) {
4078
+ let { comment: t, ref: i } = r[e];
4079
+ if (t.isNote()) continue;
4080
+ Bn(n, i, t.getId(), t.getAuthor()?.getId(), t.getCreationDate(), t.getContent(), null, t.isResolved());
4081
+ let a = t.getReplies();
4082
+ for (let e = 0; e < a.length; e++) {
4083
+ let r = a[e];
4084
+ Bn(n, i, r.getId(), r.getAuthor()?.getId(), r.getCreationDate(), r.getContent(), t.getId(), !1);
4085
+ }
4086
+ }
4087
+ n.end("ThreadedComments"), n.close();
4088
+ }
4089
+ }(),
4090
+ new class extends L {
4091
+ constructor() {
4092
+ super({
4093
+ kind: "persons",
4094
+ contentType: "application/vnd.ms-excel.person+xml",
4095
+ relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/person",
4096
+ path: "persons/person.xml"
4097
+ });
4098
+ }
4099
+ async emit(e, t) {
4100
+ let n = t.getXMLWriter();
4101
+ n.decl(), n.start("personList", {
4102
+ xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4103
+ "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4104
+ });
4105
+ let r = e.toArray();
4106
+ for (let e = 0; e < r.length; e++) {
4107
+ let t = r[e];
4108
+ n.empty("person", {
4109
+ displayName: t.getDisplayName(),
4110
+ id: Vn(t.getId()),
4111
+ userId: t.getUserId() ?? t.getDisplayName(),
4112
+ providerId: t.getProviderId() ?? "None"
4113
+ });
4114
+ }
4115
+ n.end("personList"), n.close();
4116
+ }
4117
+ }(),
4118
+ new class extends L {
3507
4119
  constructor() {
3508
4120
  super({
3509
4121
  kind: "table",
@@ -3522,21 +4134,27 @@ var un = (e, t, n, r, i, a = "0") => {
3522
4134
  "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
3523
4135
  "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
3524
4136
  }, i = e.json, a = e.model;
3525
- a.isShowHeaders(), r.id = ++sn, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && gt(t, n, a, i), ((e, t, n, r) => {
4137
+ a.isShowHeaders(), r.id = ++Hn, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), i.totalsRowShown || a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && Ut(t, n, a, i), ((e, t, n, r) => {
3526
4138
  let i = r.columns, a = i ? i.length : 0;
3527
4139
  if (a !== 0) {
3528
4140
  t.start("tableColumns", { count: a });
3529
- for (let e = 0; e < a; e++) {
3530
- let n = i[e];
3531
- typeof n == "string" && (n = { name: n });
3532
- let r = {};
3533
- r.id = e + 1, r.name = n.name ?? `Column${e + 1}`;
3534
- let a = null, o = n.totalsRowFormula;
3535
- o && (typeof o == "number" && (o = ln.get(o)), o && !cn.has(o.toLowerCase()) && (a = o, o = "custom"), o && (r.totalsRowFunction = o)), n.totalsRowLabel && (r.totalsRowLabel = n.totalsRowLabel), a ? (t.start("tableColumn", r), t.start("totalsRowFormula"), t.text(a), t.end("totalsRowFormula"), t.end("tableColumn")) : t.empty("tableColumn", r);
4141
+ for (let o = 0; o < a; o++) {
4142
+ let a = i[o];
4143
+ typeof a == "string" && (a = { name: a });
4144
+ let s = {};
4145
+ s.id = o + 1, s.name = a.name ?? `Column${o + 1}`;
4146
+ let c = null, l = a.totalsRowFormula;
4147
+ if (typeof l == "number") {
4148
+ let e = Wn.get(l);
4149
+ e ? s.totalsRowFunction = e : c = `SUBTOTAL(${l},${r.name?.trim()}[${s.name}])`;
4150
+ } else l && (c = Un(e, n, o, l.startsWith("=") ? l.substring(1) : l));
4151
+ c && (s.totalsRowFunction = "custom"), a.totalsRowLabel && (s.totalsRowLabel = a.totalsRowLabel);
4152
+ let u = a.calculatedColumnFormula ? Un(e, n, o, a.calculatedColumnFormula) : null;
4153
+ (c || u) && (t.start("tableColumn", s), u && (t.start("calculatedColumnFormula"), t.text(u), t.end("calculatedColumnFormula"))), c && (t.start("totalsRowFormula"), t.text(c), t.end("totalsRowFormula")), c || u ? t.end("tableColumn") : t.empty("tableColumn", s);
3536
4154
  }
3537
4155
  t.end("tableColumns");
3538
4156
  }
3539
- })(0, n, 0, i), ((e, t, n) => {
4157
+ })(t, n, a, i), ((e, t, n) => {
3540
4158
  let r = {
3541
4159
  name: n.getStyle().getName(),
3542
4160
  showFirstColumn: n.isShowHighlightFirstColumn() ? "1" : "0",
@@ -3548,7 +4166,76 @@ var un = (e, t, n, r, i, a = "0") => {
3548
4166
  })(0, n, a), n.end("table"), n.close();
3549
4167
  }
3550
4168
  }(),
3551
- new class extends F {
4169
+ new class extends L {
4170
+ constructor() {
4171
+ super({
4172
+ kind: "externalLink",
4173
+ contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml",
4174
+ relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
4175
+ path: "../externalLinks/externalLink{n}.xml"
4176
+ });
4177
+ }
4178
+ async emit(e, t) {
4179
+ let n = t.getXMLWriter(), r = e.sources ?? [], i = r.findIndex((e) => e.role === "book");
4180
+ i < 0 && r.length > 0 && (i = 0);
4181
+ let a = null, o = null;
4182
+ for (let e = 0; e < r.length; e++) {
4183
+ let n = r[e], s = t.addExternal(n.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath", n.target).relId;
4184
+ e === i ? a = s : n.role === "absoluteUrl" && (o = s);
4185
+ }
4186
+ a || t.log("External book has no path relationship; Excel cannot locate its source.", e.sheetNames), n.decl();
4187
+ let s = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
4188
+ (e.mceIgnorable || o) && (s["xmlns:mc"] = "http://schemas.openxmlformats.org/markup-compatibility/2006", s["mc:Ignorable"] = "x14 xxl21", s["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", s["xmlns:xxl21"] = "http://schemas.microsoft.com/office/spreadsheetml/2021/extlinks2021"), n.start("externalLink", s);
4189
+ let c = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
4190
+ a && (c["r:id"] = a), n.start("externalBook", c), o && (n.start("xxl21:alternateUrls"), n.empty("xxl21:absoluteUrl", { "r:id": o }), n.end("xxl21:alternateUrls")), function(e, t) {
4191
+ let n = t.sheetNames, r = n ? n.length : 0;
4192
+ if (r !== 0) {
4193
+ e.start("sheetNames");
4194
+ for (let t = 0; t < r; t++) e.empty("sheetName", { val: n[t] });
4195
+ e.end("sheetNames");
4196
+ }
4197
+ }(n, e), function(e, t) {
4198
+ let n = t.definedNames, r = n ? n.length : 0;
4199
+ if (r !== 0) {
4200
+ e.start("definedNames");
4201
+ for (let t = 0; t < r; t++) {
4202
+ let r = n[t], i = {
4203
+ name: r.name,
4204
+ refersTo: r.refersTo
4205
+ };
4206
+ r.sheetIndex !== void 0 && (i.sheetId = "" + r.sheetIndex), e.empty("definedName", i);
4207
+ }
4208
+ e.end("definedNames");
4209
+ }
4210
+ }(n, e), function(e, t) {
4211
+ let n = t.sheetDataSet, r = n ? n.length : 0;
4212
+ if (r !== 0) {
4213
+ e.start("sheetDataSet");
4214
+ for (let t = 0; t < r; t++) {
4215
+ let r = n[t], i = { sheetId: "" + r.sheetIndex };
4216
+ r.refreshError && (i.refreshError = "1");
4217
+ let a = r.data, o = a ? a.length : 0;
4218
+ if (o !== 0) {
4219
+ e.start("sheetData", i);
4220
+ for (let t = 0; t < o; t++) {
4221
+ let [n, r] = a[t];
4222
+ e.start("row", { r: "" + (n + 1) });
4223
+ let i = r.length;
4224
+ for (let t = 0; t < i; t++) {
4225
+ let [i, a] = r[t], o = a.length;
4226
+ for (let t = 0; t < o; t++) Kn(e, n, i + t, a.at(t));
4227
+ }
4228
+ e.end("row");
4229
+ }
4230
+ e.end("sheetData");
4231
+ } else e.empty("sheetData", i);
4232
+ }
4233
+ e.end("sheetDataSet");
4234
+ }
4235
+ }(n, e), n.end("externalBook"), n.end("externalLink"), n.close();
4236
+ }
4237
+ }(),
4238
+ new class extends L {
3552
4239
  constructor() {
3553
4240
  super({
3554
4241
  kind: "chart",
@@ -3571,9 +4258,9 @@ var un = (e, t, n, r, i, a = "0") => {
3571
4258
  }), t.empty("c14:style", { val: "102" }), t.end("mc:Choice"), t.start("mc:Fallback"), t.empty("c:style", { val: "2" }), t.end("mc:Fallback"), t.end("mc:AlternateContent");
3572
4259
  })(0, n, e.model, e.json), ((e, t, n, r, i) => {
3573
4260
  t.start("chart"), ((e, t, n, r, i) => {
3574
- t.start("title"), t.empty("overlay", { val: "0" }), Ye(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
4261
+ t.start("title"), t.empty("overlay", { val: "0" }), Ct(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
3575
4262
  })(e, t, n, 0, i), ((e, t, n, r, i) => {
3576
- t.start("plotArea"), t.empty("layout"), Ye(e, n, i, "spPr", !0), t.end("plotArea");
4263
+ t.start("plotArea"), t.empty("layout"), Ct(e, n, i, "spPr", !0), t.end("plotArea");
3577
4264
  })(e, t, n, 0, i), t.empty("plotVisOnly", { val: "1" }), t.empty("dispBlanksAs", { val: "gap" }), t.empty("showDLblsOverMax", { val: "0" }), t.end("chart");
3578
4265
  })(t, n, e.styles, e.model, e.json), ((e, t) => {
3579
4266
  t.start("printSettings"), t.empty("headerFooter"), t.empty("pageMargins", {
@@ -3587,7 +4274,7 @@ var un = (e, t, n, r, i, a = "0") => {
3587
4274
  })(0, n, e.model, e.json), n.end("chartSpace"), n.popDefaultNamespace(), n.close(), t.addPart("chartStyle", { styles: e.styles }), t.addPart("chartColors", { styles: e.styles });
3588
4275
  }
3589
4276
  }(),
3590
- new class extends F {
4277
+ new class extends L {
3591
4278
  constructor() {
3592
4279
  super({
3593
4280
  kind: "chartStyle",
@@ -3606,12 +4293,12 @@ var un = (e, t, n, r, i, a = "0") => {
3606
4293
  let i = n.length;
3607
4294
  for (let a = 0; a < i; a++) {
3608
4295
  let i = n[a];
3609
- i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), un(0, t, r, "lnRef", i.lineRef, "0"), un(0, t, r, "fillRef", i.fillRef, "0"), un(0, t, r, "effectRef", i.effectRef, "0"), un(0, t, r, "fontRef", i.fontRef, "minor"), Ye(e, r, i, "spPr"), Ht(e, 0, i.defRPr), Ut(e, r, i.bodyPr), t.end(i.type));
4296
+ i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), qn(0, t, r, "lnRef", i.lineRef, "0"), qn(0, t, r, "fillRef", i.fillRef, "0"), qn(0, t, r, "effectRef", i.effectRef, "0"), qn(0, t, r, "fontRef", i.fontRef, "minor"), Ct(e, r, i, "spPr"), Sn(e, 0, i.defRPr), Cn(e, r, i.bodyPr), t.end(i.type));
3610
4297
  }
3611
- })(t, n, dn, e.styles), n.end("chartStyle"), n.close();
4298
+ })(t, n, Jn, e.styles), n.end("chartStyle"), n.close();
3612
4299
  }
3613
4300
  }(),
3614
- new class extends F {
4301
+ new class extends L {
3615
4302
  constructor() {
3616
4303
  super({
3617
4304
  kind: "chartColors",
@@ -3633,23 +4320,107 @@ var un = (e, t, n, r, i, a = "0") => {
3633
4320
  let r = n[e], i = {}, a = r[0], o = r[1];
3634
4321
  a || o ? (t.start("variation", i), a && t.empty("a:lumMod", { val: a }), o && t.empty("a:lumOff", { val: o }), t.end("variation")) : t.empty("variation", i);
3635
4322
  }
3636
- })(0, n, fn), n.end("cs:colorStyle"), n.close();
4323
+ })(0, n, Yn), n.end("cs:colorStyle"), n.close();
3637
4324
  }
3638
4325
  }()
3639
- ], mn = async (e, t) => {
3640
- let n = new Ne();
3641
- for (let e of pn) n.register(e);
3642
- let r = hn, i = ce.createUint8Array({
4326
+ ], Zn = (e) => {
4327
+ let t = e.getPart("xl/_rels/workbook.xml.rels");
4328
+ if (!t) return null;
4329
+ let n = /* @__PURE__ */ new Map();
4330
+ for (let e of C(t.data)) {
4331
+ if (!e.id) continue;
4332
+ let t = e.external ? e.target : Oe(e.target.startsWith("/") ? e.target : "xl/" + e.target);
4333
+ n.set(e.id, {
4334
+ type: e.type,
4335
+ target: t,
4336
+ external: e.external
4337
+ });
4338
+ }
4339
+ return n;
4340
+ }, Qn = (e) => {
4341
+ let t = e.getPart("xl/workbook.xml");
4342
+ return t ? new TextDecoder("utf-8").decode(t.data) : null;
4343
+ }, $n = (e) => {
4344
+ let t = er.get(e);
4345
+ if (t !== void 0) return t;
4346
+ let n = e.getPart("xl/workbook.xml"), r = n ? new TextDecoder("utf-8").decode(n.data) : null;
4347
+ return er.set(e, r), r;
4348
+ }, er = /* @__PURE__ */ new WeakMap(), tr = async (e, t) => {
4349
+ let n = new Ge();
4350
+ for (let e of Xn) n.register(e);
4351
+ let r = nr, i = xe.createUint8Array({
3643
4352
  lastModDate: new Date(1899, 11, 29, 19, 0, 0),
3644
4353
  level: r
3645
- }), a = e.getOrigin(), o = t?.format === "Excel" ? N(a) : null, s = /* @__PURE__ */ new Map(), c = new je(i, n, {
4354
+ }), a = t?.format === "Excel" || t?.format === "ExcelMacro" ? S(e) : null, o = /* @__PURE__ */ new Map(), s = a ? ((e) => {
4355
+ let t = e.getPart("xl/workbook.xml");
4356
+ if (!t) return null;
4357
+ let n = new TextDecoder("utf-8").decode(t.data.subarray(0, 4096)).match(/<fileVersion\b([^>]*)\/?>/);
4358
+ if (!n) return null;
4359
+ let r = {};
4360
+ for (let e of n[1].matchAll(/([\w:]+)="([^"]*)"/g)) r[e[1]] = e[2];
4361
+ return Object.keys(r).length > 0 ? r : null;
4362
+ })(a) : null;
4363
+ s && (t?.macroEnabled || delete s.codeName, o.set(it, s));
4364
+ let c = a ? ((e) => {
4365
+ let t = $n(e)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4366
+ return t ? t[1] : null;
4367
+ })(a) : null;
4368
+ c !== null && o.set("calcId", c);
4369
+ let l = a ? ((e) => {
4370
+ let t = $n(e)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4371
+ return t ? t[0] : null;
4372
+ })(a) : null;
4373
+ l !== null && o.set("calcFeatures", l);
4374
+ let u = a ? ((e) => {
4375
+ let t = Qn(e);
4376
+ if (!t) return null;
4377
+ let n = /<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(t);
4378
+ if (!n) return null;
4379
+ let r = [...n[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map((e) => e[1]);
4380
+ if (r.length === 0) return null;
4381
+ let i = Zn(e);
4382
+ return i ? r.map((e) => {
4383
+ let t = i.get(e);
4384
+ return t && !t.external ? t.target : null;
4385
+ }) : null;
4386
+ })(a) : null;
4387
+ u && o.set(ot, u);
4388
+ let d = a ? ((e) => {
4389
+ let t = Qn(e), n = t ? Zn(e) : null;
4390
+ if (!t || !n) return null;
4391
+ let r = /* @__PURE__ */ new Map();
4392
+ for (let e of t.matchAll(/<sheet\b([^>]*)\/?>/g)) {
4393
+ let t = /\bsheetId="(\d+)"/.exec(e[1])?.[1], i = /\br:id="([^"]*)"/.exec(e[1])?.[1];
4394
+ if (!t || !i) continue;
4395
+ let a = n.get(i);
4396
+ a && !a.external && a.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" && r.set(parseInt(t, 10), a.target);
4397
+ }
4398
+ return r.size > 0 ? r : null;
4399
+ })(a) : null;
4400
+ d && o.set(at, d), o.set(be, /* @__PURE__ */ new Map());
4401
+ let f = [], p = new Ue(i, n, {
3646
4402
  strictDuplicateChildren: !0,
3647
4403
  onPartEmitted: t?.onPartEmitted,
3648
- mapState: s,
3649
- sourcePackage: o
4404
+ onWarning: (e, t, n) => {
4405
+ f.push([
4406
+ e,
4407
+ t,
4408
+ n
4409
+ ]);
4410
+ },
4411
+ mapState: o,
4412
+ sourcePackage: a,
4413
+ macroEnabled: t?.macroEnabled ?? !1
3650
4414
  });
3651
- c.addPart("workbook", e, "/xl/workbook.xml"), await c.waitEmit(), c.addPart("propsCore", {}), c.addPart("propsApp", { model: e });
3652
- let l = await c.build();
3653
- return l.byteOffset === 0 && l.byteLength === l.buffer.byteLength ? l.buffer : l.slice().buffer;
3654
- }, hn = 1;
3655
- export { mn as writeXLSX };
4415
+ p.addPart("workbook", e, "/xl/workbook.xml"), await p.waitEmit(), p.addPart("propsCore", {}), p.addPart("propsApp", { model: e });
4416
+ let m = await p.build(), h = t?.progress?.onWarning;
4417
+ if (f.length && h) {
4418
+ let e = /* @__PURE__ */ new Set();
4419
+ for (let [n, r, i] of f) {
4420
+ let a = i ?? n;
4421
+ e.has(a) || (e.add(a), h.call(t.progress, n, r));
4422
+ }
4423
+ }
4424
+ return m.byteOffset === 0 && m.byteLength === m.buffer.byteLength ? m.buffer : m.slice().buffer;
4425
+ }, nr = 1;
4426
+ export { tr as writeXLSX };