@sheetxl/mcp 0.8.0-beta.20 → 0.8.0-beta.22

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 (201) hide show
  1. package/assets/{noAnElnMhF05bfJN.js → 0jPw8-AyT6VbPuGO.js} +1 -1
  2. package/assets/{C7oUg84aGjYrJUc6.js → 1U3DwsqHnOBwiGWn.js} +2 -2
  3. package/assets/{DALP-GkmzCJdFIV9.js → 1dUPpOVZSeeylKHv.js} +1 -1
  4. package/assets/{TdK2ciXA5BAlGjbR.js → 3N6hsbh2WLceyO6T.js} +1 -1
  5. package/assets/{C3BZQ5NFwAU_ZdeQ.js → 4zyHb1mmcFfqwpjO.js} +1 -1
  6. package/assets/{C0MAjW1vgsw6o0fx.js → 8csqJ8aGOdnKlrLl.js} +1 -1
  7. package/assets/{C9w-KoMwxvouC73F.js → 91BKH9obG4IfBzhy.js} +514 -505
  8. package/assets/{tCavNu-Tru6yRbec.js → 9AosCdy_xtdhLjN1.js} +1 -1
  9. package/assets/{rtUwIBgECTX9UO_B.js → B5VTjL9m0R-Icfaz.js} +4 -4
  10. package/assets/{Z1zwOeCe-JTLgkxf.js → B6pXiayrnDoDbQt1.js} +57 -57
  11. package/assets/{DwsoGIyPuoQij_vi.js → BDq4iVyBh5lwX8pE.js} +1 -1
  12. package/assets/{4Za9gEGCvms62R7k.js → BHsqPfJZrdKTbPLP.js} +1 -1
  13. package/assets/{DPUXpIzEs1t-jBiv.js → BI5L_Ysr8s0TQxdg.js} +1 -1
  14. package/assets/{-qQT-DFFz0CqGx5C.js → BPZWfwUvFCLQInXN.js} +395 -395
  15. package/assets/{CgIHqG1qp9n1Gwm7.js → BRVEVVhj-8ZPrNyQ.js} +326 -321
  16. package/assets/{C9aV1SF8uCWIB4zU.js → BSdRn3B8QeJFflY6.js} +15 -15
  17. package/assets/{CrRJqUPbvvhnp4p4.js → BUGEQS5WdiLcI_0X.js} +1 -1
  18. package/assets/{DvRH46hupHUjkc7a.js → BUIjRIGTum7VuRFk.js} +1 -1
  19. package/assets/{CrULZhDt8uE-MR2s.js → BV49J63s68Mj6lgF.js} +1 -1
  20. package/assets/{DcwqgbgqPyzQxSsQ.js → BXean6K6oDUxkzyd.js} +1 -1
  21. package/assets/{B5UmlawoCVwHHM_e.js → BZxJKqVEO7B23XwE.js} +5 -5
  22. package/assets/{DYRis8fOyk2uIZ-1.js → BaaVzb7xXROiWUhT.js} +4 -4
  23. package/assets/{swG-DVTsez1uNW8c.js → Bf7Irm8Ua4s1T4xH.js} +1 -1
  24. package/assets/{BGlx7_eRiv47Hu9C.js → BgwCdHyXKQYFAl1M.js} +1 -1
  25. package/assets/{DNwyEanz3LqtOorY.js → Bi65BKwwiZYYZprq.js} +1 -1
  26. package/assets/{C46dyA4YSP1-iTSN.js → BiC09_YKQPmlUklQ.js} +1 -1
  27. package/assets/{CDmri0gcZxpVZfWn.js → BkqENH8xJ3_NQnD5.js} +377 -377
  28. package/assets/{CaOEaghQqXiA1ZzO.js → BlxrCp7d-SeM-2DW.js} +115 -115
  29. package/assets/{DBfBV-tvRxCLgdvs.js → BnGNMsqG5CzUzmX7.js} +4 -4
  30. package/assets/{u-pSumbU-rgT6eLF.js → BnK6HEqT4rf1RoOG.js} +226 -226
  31. package/assets/{DZ2Njh8YgfXcv7EM.js → BrfsWImwRtf54LUU.js} +1 -1
  32. package/assets/{BYYbglFmasE5PrS2.js → BvKzhnweVF6GhjXh.js} +1 -1
  33. package/assets/{BKc7zTK6ZIhcD_Wu.js → Bx592y6pyOwTS2x7.js} +1 -1
  34. package/assets/{BghxJxTwaebNVcIS.js → BygXDW3XTdtR38aA.js} +1 -1
  35. package/assets/{Bp9zuG6P6r9GEb6G.js → BzFIkeB_lheiTR7z.js} +1 -1
  36. package/assets/{BBm3Xjnehvx2fYj8.js → Bzp3UtK_6fqEVlV8.js} +8 -8
  37. package/assets/{DTXRsv2Ww7WbIwCb.js → C1PTfp7kVu3DqqZh.js} +9859 -9844
  38. package/assets/{CoOIn2wx6je_rMDO.js → C1yAmXrOu3iHV2cu.js} +17 -17
  39. package/assets/{BMH_wtFTiRj43c69.js → C4-0s3Udk3v4ytSn.js} +2 -2
  40. package/assets/{YG5hEr6CzWNmNJQ2.js → C7zManFR1LEJXiwb.js} +1 -1
  41. package/assets/{NiD8iNE47sjggYTx.js → C9wlvcFyjQA59G-_.js} +1 -1
  42. package/assets/{BHiZ3GtGCWUWwHqY.js → CAgQJrDxGEfoa7jn.js} +3 -3
  43. package/assets/{DsSlUklPSAsh9DhW.js → CGB4xgirbgEIN3tg.js} +167 -167
  44. package/assets/{CpfpXfCqzZumY4pf.js → CGxhgXj5qKj_Ubcp.js} +1 -1
  45. package/assets/{Bg8EN9R3hbeNfFyU.js → CHG9Q0uLAZdLXYVz.js} +76 -76
  46. package/assets/{CbTKUrroY9PQ6eTu.js → CHnaSM8aMnQ2_VWW.js} +3 -3
  47. package/assets/{CW2Ca6tsd0aLTz88.js → CHpBOpoM9bCvQyn0.js} +1 -1
  48. package/assets/{D--emvI048MvLsXl.js → CHqnRMWNpLKcAWWn.js} +1 -1
  49. package/assets/{93ksqLKL1o40anfw.js → CKhbbbjQ-_auMp3n.js} +1 -1
  50. package/assets/{BGQ1GrnQ-X16GU8k.js → COVhUB0EotytQDHg.js} +2 -2
  51. package/assets/{4Qlx8FuxoYbVTgNW.js → CSGN4rAf7CYnBDEa.js} +19 -19
  52. package/assets/{DAVN6N3srI1WMHCN.js → CSKjFDYwiwn5XNnH.js} +2 -2
  53. package/assets/{MpvZt7VpFWEINIT6.js → CT99WREgkKGpcDTO.js} +1 -1
  54. package/assets/{C9JUgNS6CrdgIcW3.js → CV729JV1mNyYCmrq.js} +1 -1
  55. package/assets/{CTGfmocA1WgM0_e0.js → CXk5vwFfosghrTKo.js} +485 -485
  56. package/assets/{DV_nCOON8Fgq5RBt.js → CXqqaFgNeUVRGvEb.js} +2 -2
  57. package/assets/{CLFe9HgUi_83dE3d.js → CYCqMEoWsry6_hrc.js} +1 -1
  58. package/assets/{I7LAF1nLmYqQwt9i.js → Cahhn5OLNqRYy-n8.js} +1 -1
  59. package/assets/{uMoGfJGab8mZX6eN.js → CdtVv8YQ8PTmS4dz.js} +1 -1
  60. package/assets/{DSy6cpdU-KNWsbSj.js → CpYgsvYMxV5SbRp3.js} +2 -2
  61. package/assets/{Dx_IFz5FEPKw-HC1.js → Cu4VAHfmjXWfTMPu.js} +1 -1
  62. package/assets/{Drmg3-gF0VJs4Yx3.js → CufFcGwo5x95LSb7.js} +1 -1
  63. package/assets/{B4ii9PGvnlYkSX2q.js → CwNKcoA7na7Ess3a.js} +2 -2
  64. package/assets/{uoUKT9hTrwZ2INHN.js → D-MsUF59BhikcNZt.js} +3 -3
  65. package/assets/{yDh_W6M1rvuDhFv1.js → D-N87jCOShDKTFDh.js} +1 -1
  66. package/assets/{CaI562iJKKOoMw8p.js → D1tShC5iBlUoT2V2.js} +1 -1
  67. package/assets/{eWHWPRWHX6YU8bJU.js → D89TE5n8VKre9Gmp.js} +1 -1
  68. package/assets/{eV0oowKJe44NBnWj.js → D8dNiNpu9_L0NjGP.js} +1 -1
  69. package/assets/{C9wXzrhl0dwqZgJ6.js → D9ja7F9irHf9Iovx.js} +1 -1
  70. package/assets/{LugZP3XHNnoiiTJO.js → DAqaOCEQLmZRjcdR.js} +1 -1
  71. package/assets/{D4lMEKXi13vhDJbE.js → DEOkcuqKBFyRnY18.js} +1 -1
  72. package/assets/{B-7inN76S1zUWSAt.js → DFQLoYLUO4TgDZPK.js} +1 -1
  73. package/assets/{CyOyY32LLW-Pj_L7.js → DHHYGjNwlLvja3dS.js} +1 -1
  74. package/assets/{_LMcVYWJksPfGVxz.js → DLbzfP7OOWhafkTq.js} +1 -1
  75. package/assets/{DndzARNYtmumqGnG.js → DQIQR1t3IkC9wshP.js} +1 -1
  76. package/assets/{8FzS1bgbz4U1QE_m.js → DRd8gdwcr3EqtGkb.js} +1 -1
  77. package/assets/{mYZ9Z5AKCn7zltHw.js → DawLBAaNAAmo_P3Y.js} +2 -2
  78. package/assets/{BEq2PSZQN7VV19RQ.js → Dbh-XVDw294AVLtl.js} +1 -1
  79. package/assets/{CDvP9QyhDwdm3MZn.js → DdDKDqtpIkzd-mXi.js} +2 -2
  80. package/assets/{CpLTCQemd_cJ4yFu.js → DdXp_iPwTOHAOvlL.js} +8 -8
  81. package/assets/{Xkr_4WLwk0ZPaYH2.js → DdnALoxd3b8TLNla.js} +1 -1
  82. package/assets/{DIntlX_ha_wRdxYj.js → DevKDvFONeJ9euEq.js} +1 -1
  83. package/assets/{YGYD-116vlZfzPn1.js → DgVCjvTw9Df1DV1x.js} +15 -15
  84. package/assets/{DnDTldUjKy0O586y.js → DgYcOz0M0pmZf9x_.js} +2 -2
  85. package/assets/{BieAybaOdneMdvBS.js → DmVQgN-N_HhYvakk.js} +1 -1
  86. package/assets/DoScYrfTJOHXe-Ko.js +199 -0
  87. package/assets/{wYvkLI8IeHaWTtAx.js → DrLUi6vduqDLmQjl.js} +46 -46
  88. package/assets/{BJYl-kvBtcnMVP8W.js → Ds5pLAwSN4lSbao6.js} +1 -1
  89. package/assets/{klKXcdZmbQmsK2rt.js → DsBXjYAgTUXAAWZZ.js} +1 -1
  90. package/assets/{Ti7kMsQ-Eo3lkfIh.js → DtvJg63vbDd6B7sD.js} +6 -6
  91. package/assets/{nV0eE4R3npcOHLbx.js → Dvsld01DkmiNLjfP.js} +1 -1
  92. package/assets/{Dlbgs8csKymbxu7r.js → DxNK3HVEzFdUou54.js} +1 -1
  93. package/assets/{Dv9ZDmKuxn2tQDGb.js → DzGpZ2CQ1St9BF0y.js} +1 -1
  94. package/assets/{CUJiePMri5kkpdA7.js → E9mta1q4VtVUusy5.js} +1 -1
  95. package/assets/{DzLrAy24em5k5en0.js → GGcMgq3ScY7Tv0PE.js} +3 -3
  96. package/assets/{q57cDvIPcIvWlh5T.js → HVwvDMZh0ZGR-hRT.js} +3 -3
  97. package/assets/{IDq3QQa5uRqjVJx_.js → OfjHqYH31KqC5gVM.js} +1 -1
  98. package/assets/{Dc2LiflUYpt0nVVk.js → OtMeAlbq6tyW5Hnc.js} +4 -4
  99. package/assets/{Bndiqwoh132Upow1.js → UgDy0WNXuV1sEnFW.js} +2 -2
  100. package/assets/{CyYbUk6pGr3NIBsy.js → VSbzBtGH0cA8VBsM.js} +33 -33
  101. package/assets/{Cheq-qaVWm7EaIlQ.js → VWEaItb0XvCoRiCT.js} +1 -1
  102. package/assets/{DMDx0fX8tHKH0DdL.js → WSiEiaP-NUEr9UaB.js} +2 -2
  103. package/assets/{BVdH9-49M3APSiPy.js → Z5tQQ6IW5YBjblWX.js} +1 -1
  104. package/assets/{Cm2WENwEZ0KMyF--.js → b-xk3WtCPBkC4E-Z.js} +2 -2
  105. package/assets/{ndBoGVVjmy3vkff8.js → coTH4ab6CTEzw87b.js} +2 -2
  106. package/assets/{hcXZqO-0tG873E-L.js → do_DTptu6c_xHJoZ.js} +2 -2
  107. package/assets/{B6J8XN1FRN00a_ps.js → hAVtdK6u2tlLI2cB.js} +1 -1
  108. package/assets/{Cirpx81bWi4G2foA.js → hhpAcu3tINDLk7Ov.js} +5 -5
  109. package/assets/{DsWJ-YRyuwDUuSge.js → nSzQt54CIADky_tF.js} +1 -1
  110. package/assets/r-pk3RNq_HjMQFqr.js +14 -0
  111. package/assets/{Co_ZOyp4mKmSfh0A.js → ryaMyh_8KvmXVSJd.js} +1 -1
  112. package/assets/{C9eaFlFi_4GmymzP.js → sYakw2x8dcnpUlsX.js} +40 -40
  113. package/assets/{ltqqdJxoPnLCjhBV.js → tIoHMgrZeRHWyxos.js} +3 -3
  114. package/assets/{B5yaBbFj2Np9Eh8b.js → tPa3RpqYRqCCCYf1.js} +1 -1
  115. package/assets/{PMBjuoD2MpG87dao.js → v5XZSqLd9ZV3kqcA.js} +1 -1
  116. package/assets/{DMMw2v0iTuBnUjMI.js → vazKaFOkHRriv7tX.js} +1 -1
  117. package/assets/{BItblzoSm0lN3bTV.js → wWgI0JPoe_Wv0ceW.js} +1 -1
  118. package/assets/{DjH6ckvISyssOSit.js → xDx1vaNa2aCMs4_e.js} +1 -1
  119. package/assets/{Dsjx528shW3GcGpD.js → zJoBN2CJdxEV7vdh.js} +3 -3
  120. package/assets/{BkhWR4P1Evw_VP5z.js → ze6Q8BiEw9RClBzZ.js} +1 -1
  121. package/index.js +1769 -1706
  122. package/lib.js +1 -1
  123. package/licenses/dependencies.txt +35 -35
  124. package/package.json +2 -2
  125. package/screenshot-page/assets/0buGanYjZDNd9qAK.js +39 -0
  126. package/screenshot-page/assets/B2oadmu_j6WfNbZ1.js +1 -0
  127. package/screenshot-page/assets/{BMKiUDjoabO4aG1U.js → B668_VaGrdcWRbkC.js} +1 -1
  128. package/screenshot-page/assets/BGWgIYge30MP6Xhz.js +48 -0
  129. package/screenshot-page/assets/{FjOiReLnknWbsRRr.js → BGh5K-hHzy8mSVDr.js} +19 -19
  130. package/screenshot-page/assets/{BuzI4z8RJGOw8BZD.js → BIQ7KK-buzeddVA9.js} +1 -1
  131. package/screenshot-page/assets/BPRDGSNh0kvXRFUY.js +1 -0
  132. package/screenshot-page/assets/{BLPyKyNun9-SHQBZ.js → BRemww1df2HKLd_k.js} +1 -1
  133. package/screenshot-page/assets/{CXmrXx6MZ5ApF3co.js → Bm9-R9keVK5Sx-8o.js} +1 -1
  134. package/screenshot-page/assets/{BOjOE9CEMSzcij2W.js → BnZX0sxceYpvtg3I.js} +2 -2
  135. package/screenshot-page/assets/Bv2MgCMkg3EIQ6iE.js +13 -0
  136. package/screenshot-page/assets/BvaiwYJ5zZ0d5NRP.js +1 -0
  137. package/screenshot-page/assets/CAlTfQ_Gh-dURmUc.js +1 -0
  138. package/screenshot-page/assets/CCFxspvs5VzbYCfl.js +1 -0
  139. package/screenshot-page/assets/CCqTTfzZokVHIzs2.js +1 -0
  140. package/screenshot-page/assets/CPs_ARK8JCyz-yZg.js +1 -0
  141. package/screenshot-page/assets/{B9kA0vdaFJi9iRGo.js → CQ9C0-FcDZxrgC3T.js} +4 -4
  142. package/screenshot-page/assets/CUeMb48Ucrm5dK5u.js +1 -0
  143. package/screenshot-page/assets/CcOIj8c4N9KaWnD7.js +1 -0
  144. package/screenshot-page/assets/CjrHeIdacavAT_Ud.js +3 -0
  145. package/screenshot-page/assets/{RutPv2GFWmeBiWvn.js → Cmv8bpHaTWZ7Lmbt.js} +2 -2
  146. package/screenshot-page/assets/CqccUqSMYlwlf2ZU.js +2 -0
  147. package/screenshot-page/assets/CvmImq-Kbg9srxNr.js +4 -0
  148. package/screenshot-page/assets/D-3wYBqe4SWdE6bx.js +2 -0
  149. package/screenshot-page/assets/D-FWnGDbZ9BRDzPR.js +1 -0
  150. package/screenshot-page/assets/D717DArr-KKL0U6R.js +1 -0
  151. package/screenshot-page/assets/{BnPHZ_1rjv6kQgsL.js → D8-mayyvvVE1a4JB.js} +1 -1
  152. package/screenshot-page/assets/DM27mE98BNk1T18I.js +1 -0
  153. package/screenshot-page/assets/DN-T1DyRMKvxEJSK.js +1 -0
  154. package/screenshot-page/assets/DRdL1GN4SP7P8lSP.js +2 -0
  155. package/screenshot-page/assets/DcnhaY93LQd7kVdH.js +2 -0
  156. package/screenshot-page/assets/{BWtLNVUXjY6EBdEt.js → DdusmeEPaU7CWT6e.js} +1 -1
  157. package/screenshot-page/assets/{Dkr-6Z1RJsAp9Xrv.js → DfT1DMR1b5kiyYiV.js} +1 -1
  158. package/screenshot-page/assets/DigI6jhjHePzLgg1.js +1 -0
  159. package/screenshot-page/assets/DrDLCC0R2IV5VJd7.js +1 -0
  160. package/screenshot-page/assets/{H_hWDMWfWmjTui7V.js → Dwv5Z_c2XS-hm-5y.js} +1 -1
  161. package/screenshot-page/assets/Dx0pUf3G4Oa3dGOk.js +1 -0
  162. package/screenshot-page/assets/JcgNMFaj_uqHSFxr.js +1 -0
  163. package/screenshot-page/assets/{Bf9AN5sYHaxae0vV.js → U_8_wApwfA7KmIG3.js} +11 -11
  164. package/screenshot-page/assets/{XiUItCqTNNEApgfa.js → WZprjN2sb7HlraOb.js} +2 -2
  165. package/screenshot-page/assets/{C4v6Ljs6kwQJu06t.js → adhmz3N2Kgq5eW66.js} +2 -2
  166. package/screenshot-page/assets/qjoaeEBxfKWCHmqK.js +2 -0
  167. package/screenshot-page/assets/{BUO6zT3gqK0uOOa-.js → zALFdtoGJBN6m2Bn.js} +1 -1
  168. package/screenshot-page/assets/zd1Z2E1NjFp2EWC7.js +5 -0
  169. package/screenshot-page/index.html +8 -8
  170. package/types/scripting-api.json +7066 -7065
  171. package/types/scripting.d.ts +37 -9
  172. package/assets/BmmIukrNOivfENgD.js +0 -199
  173. package/assets/CCl8x9s8Bujsew7W.js +0 -14
  174. package/screenshot-page/assets/1yHlU53ypZZelMPx.js +0 -1
  175. package/screenshot-page/assets/BQ5BNe1adYfpa2OH.js +0 -1
  176. package/screenshot-page/assets/BZpFWPd0PR1kPT-A.js +0 -1
  177. package/screenshot-page/assets/BaCs7lUeZ7NidSkP.js +0 -1
  178. package/screenshot-page/assets/Bh2PQ0zsoGtMKWp1.js +0 -39
  179. package/screenshot-page/assets/BkhZQsVlVHOiKGTJ.js +0 -1
  180. package/screenshot-page/assets/Bzf_upccQ2ho6mX0.js +0 -13
  181. package/screenshot-page/assets/C0AbuMHcIS9oy4XL.js +0 -1
  182. package/screenshot-page/assets/C7YRL2bVWHPIwzn_.js +0 -1
  183. package/screenshot-page/assets/CImp91jfSuqX0Wz-.js +0 -1
  184. package/screenshot-page/assets/C_vPl50T1L5HWnhv.js +0 -1
  185. package/screenshot-page/assets/Cv-YUArreXqhafcU.js +0 -2
  186. package/screenshot-page/assets/D23_69pojBfIh4nV.js +0 -5
  187. package/screenshot-page/assets/D2q4M3I5Jmxm85P2.js +0 -1
  188. package/screenshot-page/assets/D8QsCbSaWCLAYYso.js +0 -1
  189. package/screenshot-page/assets/DC_Hdwa9KL7xKU8u.js +0 -2
  190. package/screenshot-page/assets/DHtL9Iawmr2Uo5VV.js +0 -2
  191. package/screenshot-page/assets/DKWRl8rs3K9jBYtr.js +0 -1
  192. package/screenshot-page/assets/DNYWB6WNZTquqQ9v.js +0 -4
  193. package/screenshot-page/assets/DegZKTNqt1LRnSxY.js +0 -1
  194. package/screenshot-page/assets/Dhh1xqujbhLa8WFd.js +0 -1
  195. package/screenshot-page/assets/DllI8kZZZ5LG0Mjd.js +0 -2
  196. package/screenshot-page/assets/DrcpGT9FLbDzeLeG.js +0 -2
  197. package/screenshot-page/assets/LCjlxIt1dn3smVjX.js +0 -1
  198. package/screenshot-page/assets/TwKKik-YQENv52LX.js +0 -1
  199. package/screenshot-page/assets/XrFpPrRqQNE9AAwH.js +0 -1
  200. package/screenshot-page/assets/mBuOPJeUPXlKwfPZ.js +0 -48
  201. package/screenshot-page/assets/zSnM7GhGzLu1MM_u.js +0 -3
@@ -0,0 +1,48 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Dx0pUf3G4Oa3dGOk.js","./DigI6jhjHePzLgg1.js","./CbXtAM7H-Jg_J0dk.js","./-cpi3yOZYn6GsYN4.js","./CXGgKVbVXjWzE0p6.js","./BEwl-ucV9Jfr0RoC.js","./zd1Z2E1NjFp2EWC7.js","./ChSvXfVMLxZsP9zG.js","./HclGiUj8dZXDFmoM.js","./CFl15-2FAF9f3V7L.js","./J73KTOmdZGNmnq-z.js","./DRdL1GN4SP7P8lSP.js","./CUeMb48Ucrm5dK5u.js","./DuYb_otrRZZDq6-f.js","./3Ls_kOvlQseMV8Q0.js","./nHThFXCAZFOM_npq.js","./BftXEPOuf5Uwxpud.js","./DknSteOdQ6CdF0RT.js","./zEVoxCTt-ZW8Aowg.js","./DKVB6ddRfDJatYid.js","./BnZX0sxceYpvtg3I.js","./adhmz3N2Kgq5eW66.js","./9w0ECZmzGUyk3F_O.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,n,r,t as i}from"./-cpi3yOZYn6GsYN4.js";import{n as a}from"./DKVB6ddRfDJatYid.js";import{n as o,t as s}from"./CXGgKVbVXjWzE0p6.js";import{n as c,t as l}from"./BEwl-ucV9Jfr0RoC.js";import{t as u}from"./CXUO3vYip3JPSJ7A.js";import{t as d}from"./HclGiUj8dZXDFmoM.js";import{B as f,C as p,E as m,F as h,I as g,K as _,L as v,M as y,O as b,V as x,Y as S,Z as C,_ as w,i as T,l as E,n as D,r as O,u as k,w as A,y as j}from"./ChSvXfVMLxZsP9zG.js";import{r as M,t as N}from"./CFl15-2FAF9f3V7L.js";import{$ as P,A as F,B as I,C as L,D as R,E as ee,F as te,G as z,H as B,I as V,K as H,L as ne,M as U,N as W,O as re,P as ie,Q as ae,R as G,S as oe,T as se,U as ce,V as le,W as ue,X as de,Y as fe,Z as pe,_ as me,at as he,b as ge,c as _e,ct as ve,d as ye,dt as be,et as xe,g as Se,h as Ce,i as we,it as Te,j as Ee,k as De,lt as Oe,m as ke,o as Ae,ot as je,p as K,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,ut as ze,v as Be,w as Ve,x as He,y as Ue,z as We}from"./zd1Z2E1NjFp2EWC7.js";import{a as Ge,i as Ke,n as qe,o as Je,r as Ye}from"./qjoaeEBxfKWCHmqK.js";import{n as Xe,t as Ze}from"./J73KTOmdZGNmnq-z.js";import{$ as Qe,A as $e,B as et,C as tt,D as nt,E as rt,F as it,G as at,H as ot,I as st,J as ct,K as lt,L as ut,M as dt,N as ft,O as pt,P as q,Q as mt,R as ht,S as gt,U as _t,V as vt,W as yt,X as bt,Y as xt,Z as St,a as Ct,b as wt,c as Tt,d as Et,et as Dt,f as Ot,g as kt,h as At,i as jt,j as Mt,k as Nt,l as Pt,m as Ft,n as It,o as Lt,p as Rt,q as zt,r as Bt,s as Vt,t as Ht,u as Ut,v as Wt,w as Gt,x as Kt,y as qt,z as Jt}from"./DRdL1GN4SP7P8lSP.js";import{a as Yt,c as Xt,d as Zt,f as Qt,i as $t,l as en,m as tn,n as nn,o as rn,r as an,s as on,t as sn,u as cn}from"./DcnhaY93LQd7kVdH.js";import{t as ln}from"./BTOQaSn9DDyJPUlX.js";import{t as un}from"./zFbb8ESzwR_bE7IQ.js";import{n as dn}from"./DM27mE98BNk1T18I.js";import{t as fn}from"./C9SC-cEIt6gdhZRw.js";import{n as pn,r as mn}from"./BowRIybLgENunTOT.js";import{C as hn,D as gn,K as _n,Kt as vn,Ot as yn,W as bn,X as xn,Yt as Sn,Z as Cn,ht as J,kt as wn,lt as Tn,t as En,v as Dn,wt as On}from"./DuYb_otrRZZDq6-f.js";import{c as Y,i as kn,t as An}from"./CQukCzhuewMuFOlO.js";import{Ar as jn,Cr as Mn,Ft as Nn,Ht as Pn,It as Fn,K as In,On as Ln,Pn as Rn,St as zn,Ut as Bn,W as Vn,Yn as Hn,an as Un,b as Wn,br as Gn,cn as Kn,d as qn,lt as Jn,mi as Yn,ni as Xn,nn as Zn,oa as Qn,rn as $n,t as er,tn as tr,va as nr,xn as rr}from"./U_8_wApwfA7KmIG3.js";import{r as ir}from"./BftXEPOuf5Uwxpud.js";import{f as ar,i as or,l as sr,n as cr,o as lr,r as ur}from"./CvmImq-Kbg9srxNr.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var dr=e(n(),1),X=e(t(),1),Z=i(),fr=e(r(),1);(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._header_vt581_7{background:var(--sxl-color-base-100,#f5f5f5);color:color-mix(in srgb, var(--sxl-color-base-content,#000) 87%, transparent);line-height:1.2;font-family:var(--sxl-doc-font-minor,"Calibri", sans-serif);align-items:end;display:flex;overflow:hidden}._header_vt581_7._hover_vt581_18{background:var(--sxl-color-base-hover,#ececec)}._header_vt581_7._filtered_vt581_25{color:var(--sxl-color-info,#3b82f6)}._header_vt581_7._selected_vt581_33{background:var(--sxl-color-base-selected,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 20%, transparent));color:var(--sxl-color-base-selected-content,var(--sxl-color-primary,#1976d2))}._header_vt581_7._selectedAll_vt581_42{background:var(--sxl-color-base-emphasis,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 75%, var(--sxl-color-base-100,#f5f5f5)));color:var(--sxl-color-base-emphasis-content,var(--sxl-color-primary-content,#fff))}._panel_14jxb_5{min-width:0;max-width:100%;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);flex-direction:column;display:flex}._search_14jxb_16{margin:4px 4px 2px}._values_14jxb_24{min-width:100%}._empty_14jxb_28{opacity:.6;white-space:nowrap;cursor:default;padding:4px 10px}._prompt_1qgxn_8{box-sizing:content-box;color:light-dark(#1f1f1f,#e8e8e8);box-shadow:0 2px 6px var(--sxl-color-shadow,#0000002e);cursor:default;user-select:none;background:light-dark(#fffbe6,#3d3a2a);border:1px solid light-dark(#c9c2a0,#6a6448);border-radius:3px;padding:4px 6px}._line_1qgxn_24{white-space:pre}._title_1qgxn_28+._message_1qgxn_28{margin-top:2px}._alert_1qgxn_34{box-sizing:border-box;max-width:320px;font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,#000000de);background:var(--sxl-color-elevated,#fff);border:1px solid var(--sxl-color-base-border,#00000042);box-shadow:0 4px 16px var(--sxl-color-shadow,#0003);white-space:pre-line;cursor:default;border-left-width:4px;border-radius:4px;padding:8px 12px;line-height:1.45}._alertRow_1qgxn_52{align-items:flex-start;gap:6px;display:flex}._alertIcon_1qgxn_58{margin-top:2px;display:inline-flex}._alertTitle_1qgxn_63{font-weight:600}._alertHint_1qgxn_67{opacity:.75;margin-top:4px}._preview_d64gw_2{grid-template-rows:0fr;grid-template-columns:minmax(0,1fr);display:grid}._previewShown_d64gw_8{grid-template-rows:1fr}._previewSlide_d64gw_12{animation:.18s ease-out _previewReveal_d64gw_1}._previewClip_d64gw_16{min-height:0;overflow:hidden}@keyframes _previewReveal_d64gw_1{0%{opacity:0;grid-template-rows:0fr}}@media (prefers-reduced-motion:reduce){._previewSlide_d64gw_12{animation:none}}._PivotFields_105hs_4{min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,light-dark(#000000de,#ffffffde));flex-direction:column;flex:auto;gap:8px;display:flex}._Search_105hs_15{box-sizing:border-box;width:100%;padding:var(--sxl-input-padding,4px 6px);border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);background:var(--sxl-input-bg,transparent);color:inherit;font:inherit;&:focus{outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-1px}}._FieldList_105hs_30{border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);flex:120px;min-height:80px;margin:0;padding:2px 0;list-style:none;overflow:auto}._FieldRow_105hs_41{cursor:grab;user-select:none;align-items:center;gap:6px;padding:2px 6px;display:flex;&:hover{background:var(--sxl-color-base-hover,light-dark(#0000000a,#ffffff14))}& input{cursor:pointer;margin:0}}._FieldName_105hs_57{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}._TypeGlyph_105hs_65{opacity:.6;flex:none;justify-content:center;align-items:center;min-width:22px;display:inline-flex}._FilterMark_105hs_74{color:var(--sxl-color-primary,#1a73e8);flex:none;display:inline-flex}._Empty_105hs_80{opacity:.6;padding:4px 6px}._Areas_105hs_86{flex:none;grid-template-columns:1fr 1fr;gap:8px;display:grid}._Area_105hs_86{flex-direction:column;gap:2px;min-width:0;display:flex}._AreaLabel_105hs_100{opacity:.87;font-weight:600}._AreaList_105hs_105{border:1px solid var(--sxl-color-input-border,light-dark(#0003,#fff3));border-radius:var(--sxl-input-radius,4px);flex-direction:column;gap:2px;min-height:88px;max-height:160px;margin:0;padding:2px;list-style:none;display:flex;overflow:auto;&.sxl-over{border-color:var(--sxl-color-primary,#1a73e8);background:var(--sxl-color-base-hover,light-dark(#0000000a,#ffffff14))}}._AreaHint_105hs_123{opacity:.5;pointer-events:none;margin:auto;font-size:11px}._Chip_105hs_130{box-sizing:border-box;border:1px solid var(--sxl-color-base-border,light-dark(#00000042,#ffffff42));background:var(--sxl-color-elevated,light-dark(#fff,#2b2b2b));width:100%;min-height:24px;color:inherit;font:inherit;text-align:left;border-radius:4px;align-items:center;gap:4px;padding:0 2px 0 0;display:flex;&:has(._ChipCaption_105hs_144:focus-visible){outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-1px}&.sxl-dragging{opacity:.4}&.sxl-overlay{cursor:grabbing;box-shadow:0 2px 8px var(--sxl-color-shadow,#0003)}}._ChipCaption_105hs_144{text-overflow:ellipsis;white-space:nowrap;cursor:grab;touch-action:none;outline:none;flex:auto;align-self:stretch;align-items:center;min-width:0;padding:2px 0 2px 6px;display:flex;overflow:hidden}._ChipRename_105hs_172{border:1px solid var(--sxl-color-primary,#1a73e8);background:var(--sxl-input-bg,transparent);min-width:0;color:inherit;font:inherit;border-radius:3px;outline:none;flex:auto;margin:1px;padding:1px 4px}._ChipMenuButton_105hs_185{width:20px;height:20px;color:inherit;cursor:pointer;opacity:.7;background:0 0;border:none;border-radius:3px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;&:hover,&[aria-expanded=true]{opacity:1;background:var(--sxl-color-base-hover,light-dark(#0000000f,#ffffff1a))}&:focus-visible{outline:2px solid var(--sxl-color-primary,#1a73e8);outline-offset:-2px}}._ChipMenu_105hs_185{min-width:160px;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);flex-direction:column;padding:4px 0;display:flex}._ChipMenuItem_105hs_220{width:100%;color:inherit;font:inherit;text-align:left;white-space:nowrap;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;padding:4px 12px 4px 6px;display:flex;&:hover:not(:disabled),&:focus-visible{background:var(--sxl-color-base-hover,light-dark(#0000000f,#ffffff1a));outline:none}&:disabled{opacity:.5;cursor:default}}._ChipMenuCheck_105hs_243{flex:none;width:16px;display:inline-flex}._ChipMenuDivider_105hs_249{background:var(--sxl-color-base-border,light-dark(#0000001f,#ffffff1f));height:1px;margin:4px 0}._Pane_105hs_255{background:var(--sxl-color-base-100,#fff);box-sizing:border-box;min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--sxl-font-size,13px);color:var(--sxl-color-base-content,light-dark(#000000de,#ffffffde));flex-direction:column;flex:100%;gap:8px;padding:8px 16px;display:flex;overflow:auto}._PaneName_105hs_270{opacity:.87;font-weight:600}._PaneEmpty_105hs_276{text-align:center;flex:auto;justify-content:center;align-items:center;display:flex}._EmptyBox_105hs_285{pointer-events:none;color:var(--sxl-color-base-content,light-dark(#1f1f1f,#e6e6e6));overflow:hidden;container-type:size}._EmptyContent_105hs_292{box-sizing:border-box;flex-direction:column;align-items:center;gap:5cqh;height:100%;padding:7cqh 6cqw 4cqh;display:flex}._EmptyName_105hs_302{box-sizing:border-box;color:#8a8a8a;text-align:center;white-space:nowrap;text-overflow:ellipsis;border:1px solid #ababab;width:80%;padding:.15em .5em;font-size:6cqw;overflow:hidden}._EmptyHint_105hs_315{text-align:center;font-size:6cqw;line-height:1.35}._EmptyPicture_105hs_321{width:100%;color:var(--sxl-color-primary,#4472c4);margin-top:auto}._EmptyPicturePaper_105hs_327{fill:var(--sxl-color-base-100,#fff)}._movable-area_2t5k8_14 .sxl-movable-control{pointer-events:none;position:absolute;inset:0;container-type:size}._movable-area_2t5k8_14 .sxl-movable-control.sxl-dragging,._movable-area_2t5k8_14 .sxl-movable-rotate-handle.sxl-dragging,._movable-area_2t5k8_14 .sxl-movable-adornment:has(.sxl-movable-gesture){opacity:0}._movable-area_2t5k8_14 .sxl-movable-control-outline{border:1px solid var(--sxl-color-neutral,grey);pointer-events:none;position:absolute;inset:0}._movable-area_2t5k8_14 .sxl-movable-control-handle{--handle-width:var(--sxl-handle-size);--handle-height:var(--sxl-handle-size);width:var(--handle-width);height:var(--handle-height);box-sizing:border-box;border-radius:calc(var(--sxl-handle-size) / 2);background-color:var(--sxl-color-base-100,white);background-image:var(--sxl-image-background);border:var(--sxl-handle-ring) solid var(--sxl-handle-color);box-shadow:0 0 0 var(--sxl-handle-halo) var(--sxl-color-base-100,white);pointer-events:all;touch-action:none;position:absolute;transform:translate(-50%,-50%)}._movable-area_2t5k8_14 .sxl-movable-control-handle:is([data-direction=n],[data-direction=s]){--handle-width:calc(var(--sxl-handle-size) * 1.6);--handle-height:calc(var(--sxl-handle-size) * .65)}._movable-area_2t5k8_14 .sxl-movable-control-handle:is([data-direction=w],[data-direction=e]){--handle-width:calc(var(--sxl-handle-size) * .65);--handle-height:calc(var(--sxl-handle-size) * 1.6)}._movable-area_2t5k8_14 .sxl-movable-control-handle.sxl-connector-end{--handle-width:var(--sxl-handle-size);--handle-height:var(--sxl-handle-size);opacity:1;cursor:crosshair;border-radius:50%;display:block}._movable-area_2t5k8_14 .sxl-movable-control-handle.sxl-connector-end.sxl-glued{background-color:var(--sxl-handle-color);border-color:var(--sxl-color-base-100,white);box-shadow:0 0 0 var(--sxl-handle-halo) var(--sxl-handle-color);background-image:none}._movable-area_2t5k8_14 .sxl-movable-control.sxl-context .sxl-movable-control-outline{border-style:dotted}._movable-area_2t5k8_14 .sxl-movable-control.sxl-context .sxl-movable-control-handle{border-color:var(--sxl-color-neutral,grey)}._movable-area_2t5k8_14 .sxl-movable-control-handle:before{content:"";inset:min(0px, calc((var(--handle-height) - var(--sxl-handle-hit)) / 2)) min(0px, calc((var(--handle-width) - var(--sxl-handle-hit)) / 2));border-radius:calc(var(--sxl-handle-hit) / 2);position:absolute}._movable-area_2t5k8_14 .sxl-movable-rotate-handle:after{content:"";inset:calc((var(--sxl-handle-size) - var(--sxl-handle-hit)) / 2);border-radius:50%;position:absolute}._movable-area_2t5k8_14 .sxl-movable-rotate-handle{--rotate-size:calc(var(--sxl-handle-size) + 6px);--rotate-gap:calc(var(--sxl-handle-size) + 6px);left:50%;top:calc(-1 * (var(--rotate-gap) + var(--rotate-size) / 2));width:var(--rotate-size);height:var(--rotate-size);margin-left:calc(var(--rotate-size) / -2);margin-top:calc(var(--rotate-size) / -2);box-sizing:border-box;color:var(--sxl-handle-color);pointer-events:all;touch-action:none;position:absolute}._movable-area_2t5k8_14 .sxl-movable-rotate-handle:before{content:"";height:var(--rotate-gap);border-left:1px solid var(--sxl-color-neutral,grey);pointer-events:none;margin-left:-.5px;position:absolute;top:100%;left:50%}._movable-area_2t5k8_14 .sxl-movable-rotate-handle.sxl-below{top:calc(100% + var(--rotate-gap) + var(--rotate-size) / 2)}._movable-area_2t5k8_14 .sxl-movable-rotate-handle.sxl-below:before{top:auto;bottom:100%}._movable-area_2t5k8_14 .sxl-movable-rotate-handle svg,._movable-area_2t5k8_14 .sxl-movable-move-handle svg{pointer-events:none;width:100%;height:100%;filter:drop-shadow(0 0 1px var(--sxl-color-base-100,white));display:block;overflow:visible}._movable-area_2t5k8_14 .sxl-movable-rotate-handle path,._movable-area_2t5k8_14 .sxl-movable-move-handle path{fill:currentColor}._movable-area_2t5k8_14 .sxl-movable-move-handle{--move-size:calc(var(--sxl-handle-size) + 8px);left:50%;top:calc(100% + var(--sxl-handle-size) / 2);width:var(--move-size);height:var(--move-size);margin-left:calc(var(--move-size) / -2);box-sizing:border-box;color:var(--sxl-handle-color);cursor:move;pointer-events:all;touch-action:none;display:none;position:absolute}._movable-area_2t5k8_14 .sxl-movable-move-handle:after{content:"";inset:min(0px, calc((var(--move-size) - var(--sxl-handle-hit)) / 2));position:absolute}@container (width<=28px) and (height<=28px){._movable-area_2t5k8_14 .sxl-movable-control-handle,._movable-area_2t5k8_14 .sxl-movable-rotate-handle{opacity:0}._movable-area_2t5k8_14 .sxl-movable-move-handle{display:block}}@container (width<=30px){._movable-area_2t5k8_14 .sxl-movable-control-handle:is([data-direction=n],[data-direction=s]){display:none}}@container (height<=30px){._movable-area_2t5k8_14 .sxl-movable-control-handle:is([data-direction=w],[data-direction=e]){display:none}}@container (width<=108px){.sxl-touch-input ._movable-area_2t5k8_14 .sxl-movable-control-handle[data-direction=n],.sxl-touch-input ._movable-area_2t5k8_14 .sxl-movable-control-handle[data-direction=s]{display:none}}@container (height<=108px){.sxl-touch-input ._movable-area_2t5k8_14 .sxl-movable-control-handle[data-direction=w],.sxl-touch-input ._movable-area_2t5k8_14 .sxl-movable-control-handle[data-direction=e]{display:none}}._TaskPaneArea_uwth8_5{flex-direction:row;width:100%;height:100%;display:flex;position:absolute}._TaskPaneTitle_uwth8_13{box-sizing:border-box;border-bottom:1px solid #0003;flex-direction:row;flex:1 1 0;align-items:center;width:100%;height:100%;padding:8px 16px;font-size:1.25rem;display:flex;& .sxl-title{opacity:.87}&.sxl-focused{& .sxl-title{opacity:1}}}._TaskPaneFrame_uwth8_36{box-sizing:border-box;border-radius:4px;outline:none;flex-direction:column;flex:1 1 0;justify-content:stretch;align-items:stretch;width:100%;min-height:0;margin-bottom:4px;display:flex;position:relative;overflow:hidden}._TaskPaneAreaFrames_uwth8_55{flex:100%;min-width:0;min-height:0;display:flex;position:relative}._TaskPaneAreaFrameHost_uwth8_63{flex:100%;min-width:0;min-height:0;display:flex}._TaskPaneAreaFrameHidden_uwth8_71{display:none}._TaskPaneStrip_uwth8_75{scrollbar-width:thin;flex-direction:column;gap:4px;min-height:0;margin-top:4px;margin-bottom:4px;margin-left:2px;display:flex;overflow:hidden auto}._TaskPaneStripItem_uwth8_88{writing-mode:vertical-rl;text-orientation:mixed;cursor:pointer;user-select:none;opacity:.75;border:1px solid #0000;border-radius:4px;flex-direction:row;flex:none;align-items:center;min-width:0;padding:4px;transition:opacity .12s,background-color .12s;display:flex;&:hover{opacity:1;background-color:#8080801f}&.sxl-selected{opacity:1;border-color:gray;font-weight:700}}._TaskPaneStripItemIcon_uwth8_117{transform-origin:50%;display:inline-block;transform:rotate(90deg)}._TaskPaneStripItemLabel_uwth8_127{opacity:0;grid-template-columns:0fr;transition:grid-template-columns .2s,opacity .15s;display:grid}._TaskPaneStripItemLabelOpen_uwth8_134{opacity:1;grid-template-columns:1fr}._TaskPaneStripItemLabelClip_uwth8_139{white-space:nowrap;min-width:0;min-height:0;overflow:hidden}._TaskPaneStripItemLabelText_uwth8_146{padding-top:4px;display:inline-block}._MovablePane_uwth8_152{background:var(--sxl-color-base-100,#fff);box-sizing:border-box;min-height:0;font-family:var(--sxl-font-family,system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);flex-direction:column;flex:100%;gap:8px;padding:8px 16px;display:flex;overflow:auto}._MovablePaneKind_uwth8_166{opacity:.87;font-weight:600}._MovablePaneEmpty_uwth8_171{opacity:.6}._dropdown_1bnz9_13{box-sizing:border-box;cursor:pointer;user-select:none;color:light-dark(#444,#ccc);background:light-dark(#f4f4f4,#3a3a3a);border:1px solid light-dark(#b8b8b8,#5a5a5a);border-radius:2px;justify-content:center;align-items:center;transition:background-color .1s ease-out;display:flex}._dropdown_1bnz9_13:hover{background:light-dark(#e4e4e4,#4a4a4a)}._dropdown_1bnz9_13:active{background:light-dark(#d4d4d4,#565656)}@media (prefers-reduced-motion:reduce){._dropdown_1bnz9_13{transition:none}}:root{--sxl-cf-bar-fade:20%}._bar_6li90_16{box-sizing:border-box;pointer-events:none;position:absolute}._axis_6li90_23{pointer-events:none;width:1px;position:absolute}:root{--sxl-cf-icon-bad:#ec5753;--sxl-cf-icon-light-bad:#fc9f6e;--sxl-cf-icon-neutral:#f8cd3d;--sxl-cf-icon-good:#8cb354;--sxl-cf-icon-purple:#9b72cf;--sxl-cf-icon-gold:#ffc000;--sxl-cf-icon-gray:light-dark(#a6a6a6,#8a8a8a);--sxl-cf-icon-black:light-dark(#333,#d9d9d9)}._box_t03y8_41{pointer-events:auto;cursor:default;align-items:flex-end;position:absolute}._box_t03y8_41:hover{contain:none;z-index:1}._box_t03y8_41>svg{transform-origin:var(--sxl-cf-icon-origin,center bottom);transition:transform .12s ease-out,filter .12s ease-out}._box_t03y8_41:hover>svg{filter:drop-shadow(0 1px 2px var(--sxl-color-shadow,#00000059));transform:scale(1.18)}@media (prefers-reduced-motion:reduce){._box_t03y8_41>svg{transition:none}._box_t03y8_41:hover>svg{transform:none}}._mark_p3uld_7{pointer-events:none;color:light-dark(#3a70b0,#80b8f0);position:absolute}._unresolved_p3uld_19{color:light-dark(#c82828,#ff6e6e)}._pending_ldaq4_9{pointer-events:none;background:color-mix(in srgb, var(--sxl-color-primary,#4d4d4d) 25%, transparent);opacity:0;animation:0s .5s forwards _fadeIn_ldaq4_1;position:absolute;overflow:hidden}._sweep_ldaq4_19{background:var(--sxl-color-primary,#4d4d4d);opacity:.9;width:30%;animation:3s infinite _sweep_ldaq4_19;position:absolute;top:0;bottom:0}@keyframes _fadeIn_ldaq4_1{to{opacity:1}}@keyframes _sweep_ldaq4_19{0%{animation-timing-function:ease;left:-150%}to{left:100%}}._insert_8lp5h_8{position:relative}._button_8lp5h_12{cursor:pointer;color:var(--sxl-color-primary,#1976d2);background:0 0;border:none;border-radius:50%;padding:0;display:block}._button_8lp5h_12 svg{fill:var(--sxl-color-base-100,#fff);stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;display:block}._button_8lp5h_12:hover svg,._button_8lp5h_12:focus-visible svg{fill:currentColor;stroke:var(--sxl-color-base-100,#fff)}._line_8lp5h_37{pointer-events:none;background:var(--sxl-color-primary,#1976d2);position:absolute}._row_8lp5h_44{height:2px;top:-1px;left:0;right:0}._column_8lp5h_51{width:2px;top:0;bottom:0;left:-1px}._pressed_8lp5h_58{box-shadow:0 1px 4px var(--sxl-color-shadow,#00000073)}._sheet-scrollbar_104cg_1{align-items:center;margin-bottom:1px;margin-left:2px}._loading-panel_bjv3h_1{box-sizing:border-box;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._loading-spinner_bjv3h_10{border:3px solid color-mix(in srgb, var(--sxl-color-base-content) 44%, transparent);border-top-color:var(--sxl-color-primary,#1976d2);border-radius:50%;width:28px;height:28px;animation:.9s linear infinite _sxl-spin_bjv3h_1}@keyframes _sxl-spin_bjv3h_1{to{transform:rotate(360deg)}}._sheetxl-sheet_zorxx_5{& ._viewport-overlay_zorxx_6{pointer-events:none;& *{pointer-events:initial}}& .sxl-tile{& .sxl-text-box{position:absolute}& .sxl-text-line{text-rendering:optimizespeed;vertical-align:baseline;white-space:pre;position:absolute}& .sxl-column-button{flex-direction:row;justify-content:center;align-items:center;margin-bottom:4px;display:flex;position:absolute}& .sxl-text-debug-bounds{pointer-events:none;opacity:.2;background:green;position:absolute}& .sxl-fill{position:absolute}}}._tag_12081_17{--tag-ease:cubic-bezier(.25, 1, .5, 1);--tag-reach-corner:17px;--tag-reach-edge:20px;font-family:var(--sxl-font-family,system-ui, sans-serif);user-select:none;-webkit-tap-highlight-color:transparent;display:inline-flex;position:relative}._pointer_12081_38{z-index:2;pointer-events:none;width:18px;height:18px;filter:drop-shadow(0 1px 1px var(--sxl-color-shadow,#00000059));transform:rotate(var(--tag-rotate,0deg));position:absolute;overflow:visible}._settled_12081_50 ._pointer_12081_38{transition:transform .22s var(--tag-ease)}._pointer_12081_38 path{fill:var(--sxl-annotation-color);stroke:#fff;stroke-width:1.4px;stroke-linejoin:round}._leftOf_12081_66 ._pointer_12081_38{bottom:-9px;right:-9px}._leftOf_12081_66 ._badge_12081_67{margin:0 var(--tag-reach-corner) var(--tag-reach-corner) 0}[data-placement^=bottom] ._leftOf_12081_66 ._pointer_12081_38{top:-9px;bottom:auto}[data-placement^=bottom] ._leftOf_12081_66 ._badge_12081_67{margin:var(--tag-reach-corner) var(--tag-reach-corner) 0 0}._rightOf_12081_71 ._pointer_12081_38{bottom:-9px;left:-9px}._rightOf_12081_71 ._badge_12081_67{margin:0 0 var(--tag-reach-corner) var(--tag-reach-corner)}[data-placement^=bottom] ._rightOf_12081_71 ._pointer_12081_38{top:-9px;bottom:auto}[data-placement^=bottom] ._rightOf_12081_71 ._badge_12081_67{margin:var(--tag-reach-corner) 0 0 var(--tag-reach-corner)}._edgeTop_12081_76 ._badge_12081_67{margin-top:var(--tag-reach-edge)}._edgeBottom_12081_77 ._badge_12081_67{margin-bottom:var(--tag-reach-edge)}._edgeLeft_12081_78 ._badge_12081_67{margin-left:var(--tag-reach-edge)}._edgeRight_12081_79 ._badge_12081_67{margin-right:var(--tag-reach-edge)}._badge_12081_67{z-index:1;color:#fff;background:var(--sxl-annotation-color);cursor:pointer;border-radius:4px;align-items:center;min-width:20px;height:18px;transition:opacity 0s linear .2s;display:flex;position:relative;box-shadow:0 0 0 1.5px #fff,0 1px 3px 1.5px #0000004d}._expanded_12081_104 ._badge_12081_67{opacity:0;pointer-events:none;transition:opacity}._num_12081_112{box-sizing:border-box;text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap;min-width:20px;padding:0 4px;font-size:10.5px;font-weight:700;line-height:18px}._dot_12081_125{background:#fff;border-radius:50%;width:6px;height:6px;margin:6px 7px;animation:1.6s ease-in-out infinite _breathe_12081_1;display:block}@keyframes _breathe_12081_1{50%{opacity:.35}}._more_12081_140{opacity:.85;white-space:nowrap;margin-left:-3px;padding-right:5px;font-size:10px;font-weight:600;line-height:18px}._card_12081_153{z-index:0;color:#fff;background:var(--sxl-annotation-color);cursor:default;visibility:hidden;width:max-content;min-width:120px;max-width:224px;clip-path:var(--card-clip-closed,inset(50%));transition:clip-path .2s var(--tag-ease), visibility 0s linear .2s;border-radius:4px;flex-direction:column;display:flex;position:absolute;box-shadow:0 0 0 1.5px #fff,0 4px 12px 1.5px #0000004d}._expanded_12081_104 ._card_12081_153{visibility:visible;clip-path:inset(-12px);pointer-events:auto;transition:clip-path .2s var(--tag-ease), visibility 0s}._cardHead_12081_188{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;height:20px;padding:1px 4px 1px 0;display:grid}._place_12081_196{justify-self:start;align-items:center;display:inline-flex}._cardHead_12081_188 ._num_12081_112{text-align:left;padding-left:7px;font-size:11px}._total_12081_208{opacity:.85;font-variant-numeric:tabular-nums;white-space:nowrap;padding-right:6px;font-size:10.5px;font-weight:500;line-height:18px}._address_12081_219{letter-spacing:.02em;opacity:.75;font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;user-select:text;cursor:text;padding:0 6px;font-size:9.5px;font-weight:500;line-height:18px;overflow:hidden}._controls_12081_234{justify-self:end;align-items:center;gap:1px;display:inline-flex}._button_12081_241{width:16px;height:16px;color:inherit;cursor:pointer;background:0 0;border:0;border-radius:3px;place-items:center;padding:0;display:inline-grid}._button_12081_241:hover{background:#ffffff40}._button_12081_241:active{background:#fff6}._label_12081_264{box-sizing:border-box;max-width:220px;color:var(--sxl-color-base-content,#222);background:var(--sxl-color-elevated,var(--sxl-color-base-100,#fff));overflow-wrap:anywhere;white-space:pre-line;-webkit-line-clamp:4;user-select:text;cursor:text;border-radius:3px;-webkit-box-orient:vertical;margin:0 2px 2px;padding:4px 7px 5px;font-size:11.5px;line-height:15px;display:-webkit-box;overflow:hidden}@media (prefers-reduced-motion:reduce){._pointer_12081_38,._badge_12081_67,._card_12081_153{transition:none}._dot_12081_125{animation:none}}.icon[data-icon-pack=shape]{--icon-stroke-em:.04em}._themed_f2asj_9{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem));vertical-align:middle;width:var(--chart-icon-size);height:var(--chart-icon-size);fill:currentColor;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}._themed_f2asj_9>svg{width:var(--chart-icon-size);height:var(--chart-icon-size)}._small_f2asj_36{--chart-icon-size:calc(var(--icon-size-sm,.875rem) * .875)}._medium_f2asj_37{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem))}._large_f2asj_38{--chart-icon-size:calc(var(--icon-size-lg,1.25rem) * 1.5)}._themed_f2asj_9 .current_color{fill:currentColor}._themed_f2asj_9 .background{fill:var(--sxl-color-base-100,#fff)}._themed_f2asj_9 .high_contrast{fill:var(--sxl-color-primary,#595b5e)}._themed_f2asj_9 .info{fill:var(--sxl-color-info,#3b82f6)}._themed_f2asj_9 .info_tint{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 80%, white)}._themed_f2asj_9 .info_shade{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 70%, black)}._themed_f2asj_9 .accent_tint{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 80%, white)}._themed_f2asj_9 .accent_shade{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 70%, black)}._editable-input_1u3oj_6{width:100%;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit;background:0 0;border:none;outline:none;padding:0;line-height:1.2;position:absolute;top:50%;left:0;transform:translateY(-50%)}@keyframes _pop_10yib_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_10yib_29{0%{opacity:0}to{opacity:1}}._Wrapper_10yib_21{box-sizing:border-box;transform:translate3d(var(--translate-x,0), var(--translate-y,0), 0) scaleX(var(--scale-x,1)) scaleY(var(--scale-y,1));transform-origin:0 0;touch-action:manipulation;display:flex;&._dragOverlay_10yib_33{z-index:999}}._Item_10yib_43{box-sizing:border-box;transform-origin:50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale,1));outline:none;align-items:center;display:flex;position:relative;&:not(._withHandle_10yib_57){touch-action:manipulation}&._dragging_10yib_62:not(._dragOverlay_10yib_33){opacity:var(--dragging-opacity,0);z-index:999}&._dragOverlay_10yib_33{cursor:inherit;transform:scale(var(--scale));opacity:1;animation:.2s cubic-bezier(.18,.67,.6,1.22) _pop_10yib_1}}._Row_1kr10_1{box-sizing:border-box;display:flex}._TabStrip_3x0dp_1{&::-webkit-scrollbar{height:0;display:none}position:relative;overflow:hidden auto}._sheet-tab_1cbiv_2 input{color:var(--sxl-sheet-tab-input-color,inherit);text-align:center;font-weight:500}._ghost_1cbiv_18{border:1px solid #0000;transition:background-color .12s,border-color .12s}._sheet-tab_1cbiv_2:hover ._ghost_1cbiv_18{background-color:var(--sxl-tab-hover-bg);border-color:var(--sxl-tab-hover-border)}._root_qhrld_6{box-sizing:border-box;min-width:0;min-height:0;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);border-radius:4px;flex-direction:column;gap:4px;padding:0;display:flex}._list_qhrld_26{border:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));border-radius:4px;flex:auto;min-height:0}._selectAll_qhrld_38{background:var(--sxl-color-base-100,transparent);border-bottom:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));border-radius:3px 3px 0 0}._root_qhrld_6 input[type=checkbox]{accent-color:var(--sxl-color-primary,#0078d7);width:15px;height:15px}._options_qhrld_54{flex:none;align-items:center;margin-left:3px;display:flex;position:relative}._optionsButton_qhrld_62{height:20px;color:inherit;opacity:.6;cursor:pointer;background:0 0;border:none;border-radius:2px;align-items:center;padding:0 1px 0 3px;display:inline-flex}._optionsButton_qhrld_62:hover,._optionsButton_qhrld_62[aria-expanded=true]{opacity:1;background:light-dark(#0000000f,#ffffff1a)}._optionsGlyph_qhrld_81{width:14px;height:14px}._optionsChevron_qhrld_86{width:12px;height:12px;margin-left:-1px}._optionsMenu_qhrld_92{z-index:1;white-space:nowrap;box-shadow:0 2px 6px var(--sxl-color-shadow,#00000026);background:light-dark(#fff,#2b2b2b);border:1px solid light-dark(#c4c4c4,#5a5a5a);border-radius:4px;padding:4px 8px;font-size:12px;position:absolute;top:calc(100% + 4px);left:-4px}._count_qhrld_107{opacity:.75;white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;font-size:12px;overflow:hidden}._truncated_qhrld_117{margin-left:4px}._value_qhrld_122{text-overflow:ellipsis;display:block;overflow:hidden}._number_qhrld_128{text-align:right;font-variant-numeric:tabular-nums}._blank_qhrld_134{opacity:.75;font-style:italic}._toggle_qhrld_140{white-space:nowrap;cursor:pointer;align-items:center;gap:4px;display:inline-flex}._toggle_qhrld_140 input{accent-color:var(--sxl-color-primary);margin:0}._emptyList_qhrld_154{flex-direction:column;display:flex;overflow:hidden}._emptyHeader_qhrld_160{box-sizing:border-box;flex:none;align-items:center;padding:0 8px;display:flex}._empty_qhrld_154{opacity:.6;white-space:nowrap;cursor:default;flex:auto;justify-content:center;align-items:center;padding:6px 10px;display:flex}._node_qhrld_183{align-items:center;gap:4px;min-width:0;display:flex}._disclosure_qhrld_192{cursor:pointer;width:14px;height:14px;color:var(--sxl-color-primary,#0078d7);flex:none;justify-content:center;align-items:center;display:inline-flex}._disclosureIcon_qhrld_204{width:14px;height:14px;transition:transform .15s ease-out;transform:rotate(-90deg)}._disclosure_qhrld_192._expanded_qhrld_211 ._disclosureIcon_qhrld_204{transform:rotate(0)}@media (prefers-reduced-motion:reduce){._disclosureIcon_qhrld_204{transition:none}}._disclosure_qhrld_192._leaf_qhrld_221{cursor:default}._add_qhrld_226{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:50%;font:inherit;color:inherit;border:1px solid var(--sxl-color-base-300,light-dark(#0003,#ffffff3d));cursor:pointer;background:0 0;border-radius:2px;flex:0 auto;padding:2px 8px;font-size:12px;overflow:hidden}._add_qhrld_226:hover{border-color:var(--sxl-color-primary,#0078d7)}._add-button_1b4ig_1{cursor:pointer;color:color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent);background:0 0;border:none;justify-content:center;align-items:center;margin:0 2px;padding:0;display:flex}._add-button_1b4ig_1:hover:not(:disabled){color:var(--sxl-color-primary,#1976d2)}._add-button_1b4ig_1:disabled{cursor:default;opacity:.6}:root{--icon-size:1.25rem}@media (pointer:coarse){:root{--icon-size:1.75rem}}._sheetxl-workbook_ooc7l_11{background-color:var(--sxl-color-base-200);width:100%;min-width:0;height:100%;min-height:0;color:var(--sxl-color-base-content);outline:none;flex-direction:column;flex:100%;display:flex;position:relative;overflow:hidden}._sheetxl-workbook_ooc7l_11 *{font-weight:400}._sheetxl-workbook_ooc7l_11 .sxl-viewport-overlay{outline:none}._sheetxl-reset_ooc7l_40{margin:0;padding:0;line-height:1;display:block}._sheetxl-reset_ooc7l_40 table,._sheetxl-reset_ooc7l_40 thead,._sheetxl-reset_ooc7l_40 tbody,._sheetxl-reset_ooc7l_40 tfoot,._sheetxl-reset_ooc7l_40 tr,._sheetxl-reset_ooc7l_40 th,._sheetxl-reset_ooc7l_40 td{border-collapse:inherit;border-spacing:0;border:none;border-color:inherit;width:auto;height:auto;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0;margin:0;padding:0;display:block}._sheetxl-reset_ooc7l_40 th,._sheetxl-reset_ooc7l_40 td{display:inline}._viewport_ooc7l_75>:first-child{position:relative}.sxl-shape-handle circle{r:calc((var(--sxl-handle-size) - 2px) / 2 / var(--shape-scale,1))}.sxl-shape-handle .sxl-shape-handle-hit{r:calc(max(var(--sxl-handle-hit), var(--sxl-handle-size)) / 2 / var(--shape-scale,1))}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var pr=(e,t,n,r)=>{let i=(0,X.useRef)(n);i.current=n;let a=(0,X.useRef)(r);a.current=r,(0,X.useEffect)(()=>{if(!e||!t)return;let n=e.getRange(t).addListener(e=>{i.current?.(e)},a.current);return()=>{n?.()}},[e,t])},mr=(0,X.createContext)(null);function hr(e){let{workbook:t,children:n}=e;return s(t,[`onSelectedSheetChange`]),(0,Z.jsx)(mr.Provider,{value:t,children:(0,Z.jsx)(c,{sheet:t?t.getSelectedWorksheet():null,children:n})})}function gr(){return(0,X.useContext)(mr)}var _r=e=>{let{value:t,cell:n,bounds:r,children:i,style:a={},range:o,zoom:s=1,normalStyle:c,showFormulas:l,showZeros:u,allowTextOverflow:d=!0,docTheme:f,onLinkClick:p,...m}=e,h=r.height/s,_=r.width/s,v=t,y=v.getValue(),b=v.getType()===An.RichData,x=b?Xn.toPrimitive(y)??Xn.toDisplayText(y)??y:y,S=b?Xn.layoutTypeOf(y):v.getType(),C=y instanceof Zn,w=t.getStyle(),T=null,E=null,D=kn.isError(y)&&y instanceof kn.Parse,O=l||D;if(O){if(v.isSpillOverflow())E=``;else{let e=v.getFormulaText({target:`display`});e?E=e:T=v.getNumberFormat(Sn.Type.General)}}else T=v.getNumberFormat();let k=null;!O&&d&&(k=v.getTextOverflow());let A=k?k.colBounds.width+k.leftOffset+k.rightOffset:_,j=k?k.anchorBounds.x-k.leftOffset:0,M=k?k.anchorBounds.width:_,N=k?k.anchorBounds.x:0,P=v.getRenderHorizontalAlignment(),F=null;T&&(F=T?.formattedRuns,E=F?.runs[0]?.text??T.displayText);let I=null,L=0,R=0;if(!w.getBorders().isEmpty()){let e=w.getBorders().getRight();!e.isNone()&&(yn.BuiltInDefinitions.get(e.getStyle())?.width??0)>1&&(L=1);let t=w.getBorders().getBottom();!t.isNone()&&(yn.BuiltInDefinitions.get(t.getStyle())?.width??0)>1&&(R=1)}let ee=w.getFont(),te=ee.getUnderline()===gn.UnderlineStyle.SingleAccounting||ee.getUnderline()===gn.UnderlineStyle.DoubleAccounting,z=T?.conditionalColor??null,B=w.getAlignment(),V=B.getHorizontal()===J.HorizontalAlignment.Fill,H=B.getHorizontal()===J.HorizontalAlignment.CenterContinuous||V,ne=!H&&!O&&B.getStacked(),U=H||O||ne?0:B.getRotation(),W=v.getInsets(),re=W.top+W.bottom,ie=W.left,ae=W.right,G=A-1-(ie+ae),oe={...a,left:a.left-1,top:a.top-1,width:a.width+1+L,height:a.height+1+R},se=!yr&&!(p||C||i||(F?.runs.length??0)>1||k||U%360!=0||ne||te),ce=H||!(!k||!(k.rightIndex>0||k.leftIndex>0||k.colSpan>1));if(!ce){let e=v.getSpans();(e.width>1||e.height>1)&&(ce=!0)}let le={...oe};if(!g.isEmpty(E)||!g.isEmpty(T?.errorPlaceholder)){let e=T?.canWrap??!1,t,n,r=[],i=0,o=!0;u||O||x!==0||(o=!1);let c=v.getTextFrame(O);if(o&&c&&(G>0||U||ne)){let o=G,l=V||H||T&&(T.repeatChars.length>0||T.spacingChars.length>0),u=!(U||ne||O||e||c.wrapped||k||l),d=v.getTextPlacement({width:_,height:h},O),f=d?.rotation??null,y=d?.stacked??null,b=!d||f||y?null:d.bounds.y;f?o=f.lineLength:y&&(o=2**53-1);let E=null;e&&!f&&(E={width:o});let I=null,L=T?.errorPlaceholder,R=d?.frame??c.layout(E??void 0);if(t=R.bounds,O?t={...t,width:0}:F&&(t={...t,width:T.errorPlaceholder||T.repeatChars.length>0?o:F.width}),!L&&S!==An.String&&Math.floor(t.width)>o){if(w.getNumberFormat()===`General`&&S===An.Number){let e=w.measureText(`0`),t=Math.floor(o/e.width),n=x,r=Math.abs(n),i=n<0,a=r>=1e5||n!==0&&r<=1e-5,s=g.splitNumber(n),c=e=>Math.floor(w.measureText(e).width)<=o,l=Math.min(10,t-(Math.max(1,s?.ipLength??0)+1)-+!!i);if(l>=-1){let e=`0${l>0?`.`:``}${`#`.repeat(Math.max(0,l))}`,t=v.getNumberFormat(e).displayText.replace(/\.$/,``),n=t===`0`&&i?`-0`:t;a&&!/[1-9]/.test(t)||!c(n)||(I=n)}if(!I&&a){let e=t-+!!i-5,n=t-+!!i-4,r=null;if(e>=2?r=`0.${`0`.repeat(e-1)}E+00`:n>=1&&(r=`0E+00`),r){let e=v.getNumberFormat(r).displayText;c(e)&&(I=e)}}}I||(L=`#`)}if(!L&&F&&F.lastRepeatIndex>=0&&F.width>o&&(L=`#`),L&&o>0){let e=w.measureText(L),t=Math.max(1,Math.floor((o||1)/(e?.width||1)));I=L.repeat(t),P=J.HorizontalAlignment.Center}if(O&&(P=J.HorizontalAlignment.Left),I){let e=w.measureText(I).width;e&&(t={...t,width:e})}n={...t,width:t.width+ie+ae,height:t.height},f&&(n={...f.bounds});let oe=b!==null&&u&&!I&&!L;f||y||(oe?(n.x=d.bounds.x,n.y=b):(P===J.HorizontalAlignment.Center||P===J.HorizontalAlignment.CenterContinuous?n.x=(A-n.width)/2:P===J.HorizontalAlignment.Right?n.x=A-n.width-.5:n.x=.5,b===null?B.getVertical()===J.VerticalAlignment.Center?n.y=(h-n.height)/2:B.getVertical()===J.VerticalAlignment.Bottom?n.y=h-n.height-re:n.y=re:n.y=b));let le=se?{...m}:void 0,ue={style:{left:a.left-1,top:a.top-1,width:a.width+1,height:a.height+1,transform:U&&!f?`rotate(${U}deg)`:void 0,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0},...p?Lt:void 0,onClick:p,...le};D&&(ue.style.textDecorationStyle=`wavy`,ue.style.textDecorationColor=`light-dark(red, rgb(0, 255, 255))`,ue.style.textDecorationLine=`underline`);let de=ee.getSize(),fe=ee.toCSS(`adaptive`,s,!0),pe=ee.getStrike(),me=!!pe&&pe!==gn.StrikeStyle.None;if(C){fe.color||=`var(--sxl-doc-color-hlink, #467886)`;let e=ee.getUnderline();e&&e!==gn.UnderlineStyle.None||(fe.textDecoration=me?`underline line-through`:`underline`)}te&&(fe.textDecoration=me?`line-through`:void 0);let he=(e,i,a,c,l,u,d,f=null)=>{let p,m=de*s,h=a;if(d?.runs)p=d.runs;else{let t=w.measureText(e,m);p=[{type:Sn.ParseRunType.Text,text:e,width:t.width,letterSpacing:(t.renderLetterSpacing??0)/s}]}d&&d?.width!==t.width&&(t={...t,width:d?.width});let g=oe?0:ie;if(d&&d.lastRepeatIndex>=0&&o>d.width){let e=d.runs[d.lastRepeatIndex];if(e){let n=[...p],r=Math.max(0,o-1-d.width),i=0,a=``;if(r>0){let t=Math.floor(r/e.width);a=t>0?e.text.repeat(t):``,i=r}n[d.lastRepeatIndex]={type:Sn.ParseRunType.Repeat,text:a,width:i},p=n,t={...t,width:d.width+i}}}let _=(e,t,n,i,a,o,c,d,f,p=null)=>{let _,v=h.width;l===J.HorizontalAlignment.Justify?(v=a,u||(_=`justify`)):l===J.HorizontalAlignment.Distributed&&(v=a,_=u||e.text.split(` `).length-1==0?`center`:`justify`);let{style:y,className:x,...S}=p??{},C=e.text;if(l===J.HorizontalAlignment.Fill&&T?.repeatChars.length===0){let e=Math.max(1,Math.floor((h?.width??0)/(c?.width??1)));C=C.repeat(e)}let w=h.height,E=ee.getBaseline(),D=E<0;(D||E>0)&&(m*=wn.SuperSubScale,w*=wn.SuperSubScale);let O={textAlign:_,textAlignLast:_,...y,...fe,fontSize:m*gn.getDeviceScale()};e.letterSpacing&&(O.letterSpacing=(ee.getLetterSpacing()+e.letterSpacing)*s+`px`),se||(O.background=vr?`pink`:void 0),z&&(O.color=z.toCSS(`adaptive`));let k=g+t,A=(b===null?W.top:0)+h.y+0;if(D&&(A+=f-m),o){let e=(c.x+k)*s+1,t=(c.y+A)*s+1;t<0?O.marginTop=t:O.paddingTop=t,e<0?(O.width=(y?.width??0)-e,O.left=(y?.left??0)+e):O.paddingLeft=e,O.paddingRight=Math.max(0,(y?.width??0)-v*s-e),O.paddingBottom=Math.max(0,(y?.height??0)-h.height*s-t),O.height=(y?.height??0)+(t<0?-t:0),(t<0||e<0)&&(O.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else O.left=(c.x+k)*s+1,O.top=(c.y+A)*s+1,O.width=c.width*s,O.height=c.height*s;O.lineHeight=w*s+`px`;let j=se?void 0:`sxl-text-line`;r.push((0,Z.jsx)(`div`,{className:x?`${x} ${j}`:j,style:O,...S,children:C},`text-${h.y}-${i}-${n}`))};if(B.getOverflow()===J.Overflow.Shrink&&o>0){let n=t?.width??0,r=0;for(;n>1&&n>o&&m>2&&r<100;)m*=o/n,n=w.measureText(e,m).width,r++;t={...t,width:n}}let v=h.x;l===J.HorizontalAlignment.Right?v+=t.width-h.width:l!==J.HorizontalAlignment.Center&&l!==J.HorizontalAlignment.CenterContinuous||(v+=(t.width-h.width)/2),d&&d.lastRepeatIndex>=0&&(v=h.x);let y=p.length;for(let e=0;e<y;e++){let r=p[e];(r.type===Sn.ParseRunType.Text||r.type===Sn.ParseRunType.Repeat)&&(r.type,Sn.ParseRunType.Repeat,_(r,v,e,i,l===J.HorizontalAlignment.Justify||l===J.HorizontalAlignment.Distributed||d&&d.lastRepeatIndex>=0?o:h.width,se,{x:n.x+j,y:n.y,width:r.width,height:t.height},0,c,f)),v+=r.width}};if(y){let e=y.pitch,t=y;(I||L)&&(t=qn.layoutColumns(qn.toColumns(I??L??``,!1,2**53-1),e,d.content,P,B.getVertical()));let n={lineHeight:e*s+`px`,textAlign:`center`,...fe,fontSize:de*s*gn.getDeviceScale()};z&&(n.color=z.toCSS(`adaptive`));let i=[];for(let e=0;e<t.columns.length;e++){let r=t.columns[e];r.glyphs.length!==0&&i.push((0,Z.jsx)(`div`,{className:`sxl-text-line`,style:{...n,left:r.bounds.x*s,top:r.bounds.y*s,width:r.bounds.width*s,height:r.bounds.height*s},children:r.glyphs.join(`
3
+ `)},`col-${e}`))}r.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:1,top:1,width:_*s,height:h*s,overflow:`hidden`,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0,background:vr?`pink`:void 0},...p?Lt:void 0,onClick:ue.onClick,children:i},`text-stacked`))}else if(f){let e=f.angle,n=d.lineHeight,i=de*s,a=B.getVertical(),c=(t,a,o,c,l,u)=>{let d={left:a.x*s+1,top:a.y*s+1,width:o*s,height:n*s,lineHeight:n*s+`px`,transform:`rotate(${e}deg)`,transformOrigin:`0 0`,textAlign:l,textAlignLast:l,whiteSpace:l===`justify`?`normal`:void 0,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:ce?1:void 0,...fe,fontSize:i*gn.getDeviceScale()};u&&(d.letterSpacing=(ee.getLetterSpacing()+u)*s+`px`),vr&&(d.background=`pink`),z&&(d.color=z.toCSS(`adaptive`)),r.push((0,Z.jsx)(`div`,{className:`sxl-text-line`,style:d,...p?Lt:void 0,onClick:ue.onClick,children:c},`text-rot-${t}`))},l=(t,r)=>tr.layoutLines([{width:t,height:n}],e,d.content,r,a);if(I||L){let e=I??L??``;c(`override`,l(t.width,P).lines[0].origin,t.width,e,void 0,(w.measureText(e,i).renderLetterSpacing??0)/s)}else if(F&&R.lines.length===1){let e=F.runs,t=F.width,n=P;if(F.lastRepeatIndex>=0&&o>F.width){let r=F.runs[F.lastRepeatIndex];if(r){let i=[...e],a=Math.max(0,o-F.width),s=``;if(a>0&&r.width>0){let e=Math.floor(a/r.width);s=e>0?r.text.repeat(e):``}i[F.lastRepeatIndex]={type:Sn.ParseRunType.Repeat,text:s,width:a},e=i,t=F.width+a,n=J.HorizontalAlignment.Left}}let r=l(t,n),i=0,a=[];for(let t=0;t<e.length;t++){let n=e[t];n.type!==Sn.ParseRunType.Text&&n.type!==Sn.ParseRunType.Repeat||!n.text||a.push((0,Z.jsx)(`span`,{style:{position:`absolute`,left:i*s,top:0,whiteSpace:`pre`,letterSpacing:n.letterSpacing?(ee.getLetterSpacing()+n.letterSpacing)*s+`px`:void 0},children:n.text},`run-${t}`)),i+=n.width}c(`runs`,r.lines[0].origin,t,a)}else{let t=a===J.VerticalAlignment.Distributed&&e%90==0&&e%180!=0,n=f.lines.length;for(let e=0;e<n;e++){let r=f.lines[e],a=R.lines[e],o=a.runs[0].text.replace(/\s+$/,``),l=e===n-1,u,d=r.size.width;P!==J.HorizontalAlignment.Justify||l||a.runs[0].text.endsWith(`
4
+ `)?(P===J.HorizontalAlignment.Distributed||t)&&(d=f.lineLength,u=l||o.split(` `).length-1==0?`center`:`justify`):(d=f.lineLength,u=`justify`),c(`${e}`,r.origin,d,o,u,(w.measureText(o,i).renderLetterSpacing??0)/s)}}}else I||L?(i=t.y??0,he(I??L??``,0,{...t,x:t.x??0,y:t.y??0},R.lines[0].baseline,P,!0,null,ue)):R.visitLines({visitTextLine:(e,n,r)=>{let a=e.runs[0].text.replace(/\s+$/,``),s=n===r-1,l=P===J.HorizontalAlignment.Justify&&(s||e.runs[0].text.endsWith(`
5
+ `))?J.HorizontalAlignment.Left:P,u=0;n>0&&(B.getVertical()===J.VerticalAlignment.Distributed||B.getVertical()===J.VerticalAlignment.Justify)&&(u=Math.max(0,(h-(re+3)-e.bounds.height*r)/(r-1)*n)),B.getVertical()===J.VerticalAlignment.Distributed&&U&&U%90==0&&U%180!=0&&(l=J.HorizontalAlignment.Distributed),l!==J.HorizontalAlignment.Justify&&l!==J.HorizontalAlignment.Distributed&&l!==J.HorizontalAlignment.Fill||(t={...t,width:o});let d=V||T&&(T.repeatChars.length>0||T.spacingChars.length>0)?t.width:e.bounds.width,f={...e.bounds,y:e.bounds.y+u+0,width:d};i=f.y,he(a,n,f,c.lines[0].baseline,l,s,r===1?F:null,se&&n>0?{...ue,style:{...ue.style,background:void 0}}:ue)}});if(te&&!f&&!y&&!O&&r.length>0){let e=w.measureText(``),t=Math.max(1,Math.round(ee.getSize()/10)),a=(e.baseline??e.lineHeight)+t,o=w.getInsets(),c=N+o.left,l=N+M-o.right;if(F&&!I&&!L){let e=F.runs,t=0;for(;t<e.length&&e[t].type===Sn.ParseRunType.Spacing;)c+=e[t].width,t++;let n=e.length-1;for(;n>=t&&e[n].type===Sn.ParseRunType.Spacing;)l-=e[n].width,n--}if(l>c){let e=n.y+(b===null?W.top:0)+i+a,o=ee.getUnderline()===gn.UnderlineStyle.DoubleAccounting?[e,e+2*t]:[e],u=(z??ee.getColor()).toCSS(`adaptive`);for(let e=0;e<o.length;e++)r.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:c*s+1,top:o[e]*s+1,width:(l-c)*s,height:Math.max(1,t*s),background:u,zIndex:ce?1:void 0}},`accounting-underline-${e}`))}}}r.length>0&&(I=r),vr&&!se&&I&&(I=[I,(0,Z.jsx)(`div`,{style:{left:n.x*s,top:n.y*s,width:n.width*s,height:n.height*s}},`text-debug-bounds`)])}if(se)return I&&I.length>0?I:G<=0?null:(0,Z.jsx)(`div`,{style:le,...m});let ue=null;if(yr){let e=v.getTextPlacement({width:_,height:h},O);e&&(ue=(0,Z.jsx)(`div`,{style:{position:`absolute`,left:e.bounds.x*s+1,top:e.bounds.y*s+1,width:e.bounds.width*s,height:e.bounds.height*s,outline:`1px solid rgba(0,120,255,0.8)`,background:`rgba(0,120,255,0.08)`,pointerEvents:`none`}},`placement-debug`))}let de=[I,i,ue];return(0,Z.jsx)(`div`,{style:{...oe,zIndex:ce?1:void 0},...m,children:de})},vr=!1,yr=!1,br=Object.freeze({top:0,right:0,bottom:0,left:0}),xr={text:`flex-start`,number:`flex-end`,boolean:`center`},Sr=(e,t)=>e===J.HorizontalAlignment.General?xr[t]:e===J.HorizontalAlignment.Left?`flex-start`:e===J.HorizontalAlignment.Right?`flex-end`:`center`,Cr=e=>{let{value:t,control:n,context:r,interactiveProps:i,Default:a,bounds:o,zoom:s=1,cell:c,range:l,style:u,alignAs:d=`boolean`,interactive:f,centerOnTextLine:p,inset:m=!0,children:h,...g}=e,_=t.getStyle(),v=_.getFont(),y=_.getAlignment(),b=m?t.getInsets():br,x=(e=>e===J.VerticalAlignment.Top?`flex-start`:e===J.VerticalAlignment.Center?`center`:`flex-end`)(y.getVertical()),S=b.top*s,C=b.bottom*s,w=p&&o?t.getTextPlacement({width:o.width/s,height:o.height/s}):null;if(w){let e=(w.bounds.y+w.lineHeight/2-1)*s,t=Math.max(0,Math.min(e-S,o.height-C-e));S=e-t,C=o.height-e-t,x=`center`}return(0,Z.jsx)(`div`,{...g,...f?i:void 0,style:{...u,boxSizing:`border-box`,display:`flex`,justifyContent:Sr(y.getHorizontal(),d),alignItems:x,padding:`${S}px ${b.right*s}px ${C}px ${b.left*s}px`,color:v.toCSS(`adaptive`,s,!0).color,fontSize:v.getSize()*(96/72)*s},children:h})};Cr.displayName=`CellContent`;var wr=e=>{let t=e.value,n=e.zoom??1,r=!0===t.getValue(),i=t.getFormula()!==null,a=Math.max(8,Math.round(t.getStyle().getFont().getSize()*(96/72)))*n;return(0,Z.jsx)(Cr,{...e,centerOnTextLine:!0,children:(0,Z.jsx)(`div`,{...i?void 0:e.interactiveProps,role:`checkbox`,"aria-checked":r,"aria-disabled":i||void 0,style:{width:a,height:a,maxWidth:`100%`,maxHeight:`100%`,boxSizing:`border-box`,border:`${Math.max(1,Math.round(n))}px solid currentColor`,borderRadius:2*n,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:i?.6:void 0,cursor:i?void 0:`pointer`},children:r?(0,Z.jsx)(M,{iconKey:`Check`,ariaHidden:!0,size:Math.round(.85*a)}):null})})},Tr=e=>{let t=e.getControl();return!!t&&t.getType()===`checkbox`&&t.isAccepted(e.getValue())&&e.getFormula()===null},Er=Object.freeze([Pn.Feature.CellControl,Pn.Feature.Formula,Pn.Feature.Kind]),Dr=Object.freeze({renderer:wr,onPress:(e,t)=>{t.setCellValue(e,!0!==e.getValue())},onKey:(e,t,n)=>e===` `&&((e,t)=>{let{selection:n,anchor:r}=e,i=n.getRanges(),a=i.getCount(),o=[];for(let e=0;e<a;e++)for(let t of i.at(e).getRegions(Er))Tr(t.getCell())&&o.push(t.getRange());if(o.length===0)return!1;let s=!0!==(Tr(r)?r:o[0].getCell()).getValue();return t.sheet.doBatch(()=>{for(let e of o)t.setRangeValue(e,s)}),!0})(t,n)}),Or=new WeakMap,kr=new Map,Ar=new WeakMap,jr=e=>{let t=e.getStyle().getAlignment(),n=t.getHorizontal(),r=t.getVertical();return`${n===J.HorizontalAlignment.Right?`right`:n===J.HorizontalAlignment.General||n===J.HorizontalAlignment.Left?`left`:`center`} ${r===J.VerticalAlignment.Top?`top`:r===J.VerticalAlignment.Center?`center`:`bottom`}`},Mr=e=>{let{image:t,workbook:n,zoom:r,position:i}=e,[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=!0;return((e,t)=>{let n=t.getResource();if(n&&!n.isClosed()){let e=Ar.get(n);return e||(e=(async()=>{let[e,r]=await Promise.all([n.toBuffer(),n.getType()]);if(!r?.mime.startsWith(`image/`))throw Error(`No picture at '${t.getSource()}'.`);return`data:${r.mime};base64,${h.arrayBufferToBase64(e)}`})(),Ar.set(n,e)),e}let r=t.getSource(),i=kr;e&&(i=Or.get(e)??new Map,Or.set(e,i));let a=i.get(r);return a||(a=(async()=>{let t=e?await e.fetch(r):await fetch(r),n=t.headers.get(`content-type`);if(!t.ok||!n?.startsWith(`image/`))throw Error(`No picture at '${r}'.`);return`data:${n};base64,${h.arrayBufferToBase64(await t.arrayBuffer())}`})(),i.set(r,a)),a})(n,t).then(n=>{e&&o({image:t,url:n})},()=>{e&&o({image:t,failed:!0})}),()=>{e=!1}},[t,n]);let d=!!a&&a.image===t&&`failed`in a;if(z(l!==t&&!d,n),!a||a.image!==t)return null;if(`failed`in a)return(0,Z.jsx)(`span`,{children:`#VALUE!`});let f=t.getSizing(),p={display:`block`,filter:`var(--sxl-image-filter)`,minWidth:0,minHeight:0};if(f===nr.Sizing.Fit||f===nr.Sizing.Fill)p.width=`100%`,p.height=`100%`,p.objectFit=f===nr.Sizing.Fit?`contain`:`fill`,p.objectPosition=i;else if(f===nr.Sizing.Custom){let e=t.getHeight(),n=t.getWidth();p.width=n===null?`auto`:n*r,p.height=e===null?`auto`:e*r,n!==null&&e!==null||(p.aspectRatio=`auto`)}else s&&(p.width=s.width*r,p.height=s.height*r);return(0,Z.jsx)(`img`,{src:a.url,alt:t.getAltText()??``,draggable:!1,style:p,onLoad:e=>{if(f===nr.Sizing.Original){let{naturalWidth:t,naturalHeight:n}=e.currentTarget;c(e=>e?.width===t&&e.height===n?e:{width:t,height:n})}u(t)},onError:()=>u(t)})},Nr=Object.freeze({renderer:e=>{let t=e.value.getValue();return(0,Z.jsx)(Cr,{...e,alignAs:`text`,inset:!1,children:(0,Z.jsx)(Mr,{image:t,workbook:e.context.sheet.getWorkbook(),zoom:e.zoom??1,position:jr(e.value)})})},insertable:!1}),Pr=new Map,Fr=new Map,Ir=new Map,Lr=new Map,Rr=new Set,zr=0,Br=!1,Vr=()=>{Br||(Br=!0,Pr.set(`checkbox`,Dr),Ir.set(`image`,Nr))};function Hr(e){return Vr(),Lr.get(e)??Ir.get(e)}function Ur(e){return Vr(),Fr.get(e)??Pr.get(e)}function Wr(e){Vr();let t=e.getControl();if(t){let n=e.getValue();if(t.isAccepted(n)){let e=Ur(t.getType());if(e)return{entry:e,control:t}}}if(e.getType()===An.RichData){let t=Hr(e.getValue().getKind().getName());if(t)return{entry:t,control:null}}return null}function Gr(e){return Rr.add(e),()=>{Rr.delete(e)}}function Kr(){return zr}function qr(e){let{sheet:t,notifier:n,notifyEditRejected:r}=e,i=(e,t)=>{t.isEditAllowed()?n.showError?.(e instanceof Error?e:String(e)):r(t.getCoords())};return{sheet:t,notifier:n,setCellValue(e,t){if(e.getFormula()!==null)return!1;if(!e.isEditAllowed())return r(e.getCoords()),!1;try{e.getRange().setValue(t)}catch(t){return i(t,e),!1}return!0},setRangeValue(e,n){let r=(e=>{if(e.getCounts(`formula`).formula===0)return[e];let t=[e];for(let n of e.getRegions(`formula`)){if(!n.getFeatures().includes(`formula`))continue;let e=n.getRange(),r=[];for(let n of t){if(!n.getIntersect(e)){r.push(n);continue}let t=n.getDifferences(e);if(!t)continue;let i=t.getCount();for(let e=0;e<i;e++)r.push(t.at(e))}t=r}return t})(e);if(r.length===0)return!1;try{t.doBatch(()=>{for(let e of r)e.setValue(n)})}catch(t){return i(t,e.getCell()),!1}return!0}}}function Jr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Q(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jr(e))&&(r&&(r+=` `),r+=t);return r}var Yr=(0,X.createContext)(null);Yr.displayName=`DocThemesContext`;var Xr=()=>{let e=(0,X.useContext)(Yr),[t]=(0,X.useState)(()=>new Un);return(0,X.useMemo)(()=>e||t,[e])},Zr=`sxl-system-colors`,Qr=()=>{if(typeof document>`u`||document.getElementById(Zr))return;let e=vn.getSystemColorDefaults(),t=Object.keys(e).map(t=>`${On}${t}:${e[t]};`).join(``),n=document.createElement(`style`);n.id=Zr,n.textContent=`:root{${t}}`,document.head.appendChild(n)},$r=()=>{(0,X.useMemo)(()=>{Qr()},[])},ei=[[Dn.Named.Window,`var(--sxl-color-base-100)`],[Dn.Named.Menu,`var(--sxl-color-base-100)`],[Dn.Named.BtnFace,`var(--sxl-color-base-100)`],[Dn.Named.ScrollBar,`var(--sxl-color-base-100)`],[Dn.Named.AppWorkspace,`var(--sxl-color-base-100)`],[Dn.Named.Background,`var(--sxl-color-base-100)`],[Dn.Named.InfoBk,`color-mix(in srgb, var(--sxl-color-base-100) 88%, #ffeb3b)`],[Dn.Named.WindowText,`var(--sxl-color-base-content)`],[Dn.Named.MenuText,`var(--sxl-color-base-content)`],[Dn.Named.BtnText,`var(--sxl-color-base-content)`],[Dn.Named.InfoText,`var(--sxl-color-base-content)`],[Dn.Named.CaptionText,`var(--sxl-color-base-content)`],[Dn.Named.GrayText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[Dn.Named.InactiveCaptionText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[Dn.Named.Highlight,`var(--sxl-color-primary)`],[Dn.Named.ActiveCaption,`var(--sxl-color-primary)`],[Dn.Named.HotLight,`var(--sxl-color-primary)`],[Dn.Named.HighlightText,`var(--sxl-color-primary-content)`],[Dn.Named.BtnHighlight,`var(--sxl-color-base-200)`],[Dn.Named.Light3d,`var(--sxl-color-base-200)`],[Dn.Named.InactiveCaption,`var(--sxl-color-base-200)`],[Dn.Named.ActiveBorder,`var(--sxl-color-base-300)`],[Dn.Named.InactiveBorder,`var(--sxl-color-base-300)`],[Dn.Named.WindowFrame,`var(--sxl-color-base-300)`],[Dn.Named.BtnShadow,`var(--sxl-color-neutral)`],[Dn.Named.DkShadow3d,`var(--sxl-color-neutral)`]],ti={};for(let[e,t]of ei)ti[`sys-color-${e.toLowerCase()}`]=t;var ni={light:ti,dark:ti},ri=(e=`sxl-defaults`,t)=>oe({app:ni,surfaces:{grid:ni,header:ni},layer:e,scope:t}),ii=(e,t,n,r)=>{let i=e.getColorScheme(),a=e.getFontScheme();return{"doc-color-dk1":i.getDk1().toCSS(r),"doc-color-dk2":i.getDk2().toCSS(r),"doc-color-lt1":i.getLt1().toCSS(r),"doc-color-lt2":i.getLt2().toCSS(r),"doc-color-accent1":i.getAccent1().toCSS(r),"doc-color-accent2":i.getAccent2().toCSS(r),"doc-color-accent3":i.getAccent3().toCSS(r),"doc-color-accent4":i.getAccent4().toCSS(r),"doc-color-accent5":i.getAccent5().toCSS(r),"doc-color-accent6":i.getAccent6().toCSS(r),"doc-color-hlink":i.getHlink().toCSS(r),"doc-color-fol-hlink":i.getFolHlink().toCSS(r),"doc-font-major":gn.toCSSFontFamily(a.getMajorFont(),a.getMajorFallbacks()),"doc-font-minor":gn.toCSSFontFamily(a.getMinorFont(),a.getMinorFallbacks()),"doc-font-size":`${t}pt`,"doc-line-height":`${n}px`}},ai=(e,t,n,r=`sxl-defaults`,i)=>oe({app:{light:ii(e,t,n,!1),dark:ii(e,t,n,!0)},layer:r,scope:i}),oi=e=>{let{length:t=0,width:n=1,dashArray:r=null,dashArrayAdditional:i=null,isDouble:a=!1,isAngled:o=!1,offsetX:s=0,offsetY:c=0,isVertical:l=!1,...u}=e,d=e=>{let t=null;if(e&&n>0){t=``;for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=`,`)}return t},f=d(r),p=f;i&&(p=d(i));let m=xe.getDevicePixelRatio(),h=(e,t,n,r)=>{let i=xe.snapLineCenter(e,r/m,m),a=xe.snapDeviceEdge(t,m),o=xe.snapDeviceEdge(n,m);return l?`M ${i} ${a} L ${i} ${o}`:`M ${a} ${i} L ${o} ${i}`},g=n,_=t,v=null;if(a){g=Math.floor(n/2);let e=l?c:s;v=(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:p??void 0,d:h((l?s:c)+(g+g/2+1)/m,e,e+_,g),...u})}if(o){g=n/2;let e=l?c:s;v=(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:p??void 0,strokeDashoffset:`1`,d:h((l?s:c)+(g+g/2)/m,e,e+_,g),...u})}let y=l?c:s;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{strokeWidth:g/m,strokeDasharray:f??void 0,d:h((l?s:c)+g/2/m,y,y+_,g),...u}),v]})},si=(e,t)=>{if(!e||e.isNone())return null;let n=yn.BuiltInDefinitions.get(e.getStyle());return n?{color:e.getColor().toCSS(`adaptive`),width:n.width,dashArray:n.pattern,isDouble:n.style===yn.StrokeStyle.Double,edge:wi(t)}:null},ci=({getBorderAt:e,getMergeAt:t,rendererBorder:n=Ti,getVisibleCells:r,forceThinBorder:i=!1,defaultColor:a=`black`,mode:o=`direct`,normalRows:s=null,normalColumns:c=null,cache:l})=>{let u=K(r,[r]),d=`sxl-borders-`+(0,X.useId)().replace(/[^a-zA-Z0-9_-]/g,``),f=(0,X.useRef)({});return{renderLayer:(0,X.useMemo)(()=>o===`normal`?n=>!s&&!c?null:mi(n,di(l,n,u(n)??[],e,t,a),s,c,f.current,d):r=>{if(!e&&!s&&!c)return null;let o=r.toClipBounds(r.getBoundsFromRange(),-3);if(!o)return;let p=u(r)??[];if(p.length===0&&!s&&!c)return;let m=di(l,r,p,e,t,a),{mergedRows:h,mergedColumns:g,diagonals:_,crossings:v}=m,y=fi(r,m,s,c,f.current,!0);if(g.length===0&&h.length===0&&_.length===0&&!y.dH&&!y.dV)return null;let b=xe.getDevicePixelRatio(),x=r.getMetrics(),S=(e,t,n)=>xe.edgeCenter(e,wi(n),t,b),C=h.length,w=g.length,T=new Float64Array(C),E=new Float64Array(C),D=new Float64Array(w),O=new Float64Array(w),k=v.length;for(let e=0;e<k;e+=2){let t=v[e],n=v[e+1],r=h[t],a=g[n],o=a.index===r.from||a.index===r.to+1,s=r.index===a.from||r.index===a.to+1,c=!i&&r.stroke.getStyle()===yn.StrokeStyle.Double,l=!i&&a.stroke.getStyle()===yn.StrokeStyle.Double,u=o&&c&&!l,d=s&&l&&!c;if(!(o&&s||u||d))continue;let f=yn.BuiltInDefinitions.get(a.stroke.getStyle())?.width??1,p=yn.BuiltInDefinitions.get(r.stroke.getStyle())?.width??1,m=f/2/b,_=p/2/b,y=x.getColOffset(a.index),C=S(y,f,a.edge);u?a.index===r.to+1?E[t]=Math.min(E[t],C-m-y):T[t]=Math.min(T[t],y-(C+m)):o&&s&&(a.index===r.to+1?E[t]=C+m-y:T[t]=y-(C-m));let w=x.getRowOffset(r.index),k=S(w,p,r.edge);d?r.index===a.to+1?O[n]=Math.min(O[n],k-_-w):D[n]=Math.min(D[n],w-(k+_)):o&&s&&(r.index===a.to+1?O[n]=k+_-w:D[n]=w-(k-_))}let A=(e,t,n,r)=>{let a=e=>t?x.getRowOffset(e):x.getColOffset(e),o=.5/b,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(!s.startMet){let r=a(s.from),l=S(r,1,t?yn.Edge.Top:yn.Edge.Left),u=e[c-1],d=u?.ordinal!==s.ordinal||a(u.to+1)!==r||Ci(s.stroke,u.stroke,!0,i);n[c]=r-(d?l-o:l+o)}if(!s.endMet){let n=a(s.to+1),l=S(n,1,t?yn.Edge.Bottom:yn.Edge.Right),u=e[c+1],d=u?.ordinal!==s.ordinal||a(u.from)!==n||Ci(s.stroke,u.stroke,!1,i);r[c]=(d?l+o:l-o)-n}}};A(h,!1,T,E),A(g,!0,D,O);let j=r.getMetrics(),M=e=>!i&&e.getStyle()===yn.StrokeStyle.Double,N=yn.BuiltInDefinitions.get(yn.StrokeStyle.Double).width,P=[],F=[],I=``,L=``,R=[],ee=(e,t,n)=>{if(!e||!t)return;let r=pi(e,t,b,n);t.isDouble&&!i?(F.push(r),I+=e,L+=e):R.push(r)};ee(y.dH,s,`normal-rows`),ee(y.dV,c,`normal-columns`);let te=(e,t,r,a)=>{let o=t?{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}:{rowStart:e.index,rowEnd:e.index,colStart:e.from,colEnd:e.to+1},s=j.getColOffset(o.colStart),c=j.getRowOffset(o.rowStart),l=t?s:j.getColOffset(o.colEnd),u=t?j.getRowOffset(o.rowEnd):c,d=n({key:`${t?`c`:`r`}Border:${e.index}:${e.from}:${e.to}:${e.edge}`,points:[s,c,l,u],stroke:e.stroke,forceThinBorder:i,range:o,edge:e.edge,intersections:e.intersections,startExtend:r,endExtend:a,metrics:j,isVertical:t});if(!M(e.stroke))return void P.push({stroke:e.stroke,node:d});F.push(d);let f=t?s:c,p=t?c:s,m=t?u:l;I+=gi(f,p,m,t,e.edge,b),L+=_i(f,p-r,m+a,t,e.edge,b)};for(let e=0;e<w;e++)te(g[e],!0,D[e],O[e]);for(let e=0;e<C;e++)te(h[e],!1,T[e],E[e]);P.sort((e,t)=>yn.compareStrokes(e.stroke,t.stroke));let z=[],B=[],V=[],H=``,ne=_.length;for(let e=0;e<ne;e++){let{box:t,up:r,down:a}=_[e],o=j.getColOffset(t.colStart),l=j.getRowOffset(t.rowStart),u=j.getColOffset(t.colEnd+1),f=j.getRowOffset(t.rowEnd+1),p=i?null:hi(m,t,s,c,{left:o,top:l,right:u,bottom:f},b),h=o+(p?.left??0),g=l+(p?.top??0),v=u-(p?.right??0),y=f-(p?.bottom??0),x=`${d}-clip-${e}`;V.push((0,Z.jsx)(`clipPath`,{id:x,children:(0,Z.jsx)(`rect`,{x:h,y:g,width:Math.max(0,v-h),height:Math.max(0,y-g)})},x));let S=(e,r,a)=>{let o=`dBorder:${t.rowStart}:${t.colStart}:${r}`,s=(0,Z.jsx)(`g`,{clipPath:`url(#${x})`,children:n({key:o,points:a,stroke:e,forceThinBorder:i,range:t,edge:r,metrics:j})},o);M(e)?(B.push(s),H+=`M ${a[0]} ${a[1]} L ${a[2]} ${a[3]} `):z.push(s)};a&&!a.isNone()&&S(a,yn.Edge.DiagonalDown,[h,g,v,y]),r&&!r.isNone()&&S(r,yn.Edge.DiagonalUp,[h,y,v,g])}let U=o.width,W=o.height,re=`${d}-edges`,ie=`${d}-plain`,ae=`${d}-diagonals`,G=I||H||V.length>0;return(0,Z.jsxs)(`svg`,{width:`${U}`,height:`${W}`,viewBox:`0 0 ${U} ${W}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:`0px`,top:`0px`,width:`${U}px`,height:`${W}px`,pointerEvents:`none`,willChange:`left, top, width, height, stroke-dashoffset`,overflow:`visible`},children:[G?(0,Z.jsxs)(`defs`,{children:[I?yi(re,I,1/b,U,W):null,L?yi(ie,L,N/b,U,W):null,H?yi(ae,H,1/b,U,W):null,V]}):null,(0,Z.jsxs)(`g`,{mask:L?`url(#${ie})`:void 0,children:[R,P.map(e=>e.node)]}),F.length>0?(0,Z.jsx)(`g`,{mask:`url(#${re})`,children:F}):null,z,B.length>0?(0,Z.jsx)(`g`,{mask:`url(#${ae})`,children:B}):null]},`borders`)},[e,t,n,i,a,o,s,c,d])}},li=(e,t,n,r,i)=>{let a=[],o=[],s=[],c=[],l=[],u=new Set,d=e.getVisibleColumns(),f=e.getVisibleRows(),p=d.map(e=>e.index),m=f.map(e=>e.index),h=new Map(p.map((e,t)=>[e,t])),g=new Map(m.map((e,t)=>[e,t])),_=[],v=[],y=[],b=[],x=(e,t,n)=>{let r=e[t];r||(r=new Map,e[t]=r),r.set(n,(r.get(n)??0)+1)},S=(e,t,n,r,i,a,o)=>{let s=e[t];s||(s=new Map,e[t]=s);let c=s.get(r);c&&yn.compareStrokes(c.stroke,i)>0||s.set(r,{index:r,stroke:i,visibleIndex:n,edge:a,length:o})},C=e.getVisibleRange(),T=t.length;for(let e=0;e<T;e++){let i=t[e],p=i.cell;if(!p)continue;let m=i.range??{rowStart:p.rowIndex,colStart:p.colIndex,rowEnd:p.rowIndex,colEnd:p.colIndex};if(!w.isRangesIntersect(m,C)&&!w.isRangeWithinRange(m,C))continue;let T=p.colIndex,E=p.rowIndex,D=h.get(T),O=g.get(E);if(m.rowEnd!==m.rowStart){s.push(m);let e=g.get(m.rowStart)??-1,t=g.get(m.rowEnd)??f.length;a.push({...m,rowStart:e,rowEnd:t})}if(m.colEnd!==m.colStart){c.push(m);let e=h.get(m.colStart)??-1,t=h.get(m.colEnd)??d.length;o.push({...m,colStart:e,colEnd:t})}if(!n)continue;let k=i.value,A=n(k,e),j=!A||A.isEmpty();if(D!==void 0&&O!==void 0&&((j||A.getLeft().isNone())&&x(y,D,E),(j||A.getRight().isNone())&&x(y,D+1,E),(j||A.getTop().isNone())&&x(b,O,T),(j||A.getBottom().isNone())&&x(b,O+1,T)),j)continue;let M=A.getDiagonalUp(),N=A.getDiagonalDown();if(!M.isNone()||!N.isNone()){let t=r?.(k,e)??{rowStart:E,colStart:T,rowEnd:E,colEnd:T},n=`${t.rowStart}:${t.colStart}`;u.has(n)||(u.add(n),l.push({box:t,up:M,down:N}))}let P=A.getLeft(),F=A.getTop(),I=A.getRight(),L=A.getBottom();if(D===void 0||O===void 0)continue;let R=D,ee=O;P.isNone()||S(_,R,ee,E,P,yn.Edge.Left,1),F.isNone()||S(v,ee,R,T,F,yn.Edge.Top,1),I.isNone()||S(_,R+1,ee,E,I,yn.Edge.Right,1),L.isNone()||S(v,ee+1,R,T,L,yn.Edge.Bottom,1)}let E=(e,t,n)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a],o=Math.max(0,(t?i.rowStart:i.colStart)+1),s=Math.min(n,t?i.rowEnd:i.colEnd),c=t?i.colStart:i.rowStart,l=t?i.colEnd:i.rowEnd;for(let e=o;e<=s;e++)(r[e]??=[]).push(c,l)}return r},D=(e,t,n)=>{let r=[],s=n?E(a,!0,f.length):E(o,!1,d.length);return e.forEach((e,n)=>{let a=null,o=s[n],c=Array.from(e.values()).sort((e,t)=>e.visibleIndex-t.visibleIndex),l=c.length;for(let e=0;e<l;e++){let s=c[e];if(!s?.stroke||t[n]===void 0&&t[n-1]===void 0)continue;if(o){let e=!1,t=o.length;for(let n=0;!e&&n<t;n+=2)o[n]<=s.index&&o[n+1]>=s.index&&(e=!0);if(e)continue}let l=s.stroke?.getColor(),u=l?l.toCSS(`adaptive`):i,d=s.stroke.getStyle()+`:`+u;(!a||d!==a.key||a.visibleIndex+1<s.visibleIndex)&&(a&&r.push(a),a={key:d,index:t[n]??t[n-1]+1,ordinal:n,visibleIndex:s.visibleIndex,edge:s.edge,stroke:s.stroke,from:s.index,to:s.index+s.length-1,intersections:[],startMet:!1,endMet:!1,length:1}),a.to=s.index+s.length-1,a.visibleIndex=s.visibleIndex}a&&r.push(a)}),r},O=D(_,p,!1),k=D(v,m,!0);return{mergedColumns:O,mergedRows:k,crossings:ui(k,O),diagonals:l,rangesH:s,rangesV:c,sigRangesH:Si(s),sigRangesV:Si(c),breaksRows:bi(k,null,m),breaksRowsNone:bi(k,b,m),breaksColumns:bi(O,null,p),breaksColumnsNone:bi(O,y,p),columns:_,rows:v,colOrdinal:h,rowOrdinal:g}},ui=(e,t)=>{let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i],a=g.findEqualOrGreater(t,r.from,e=>e.index);for(;a>0&&t[a-1].index>=r.from;)a--;let o=!1;for(;!o;){let e=a++,s=t[e];s&&s.index>=r.from&&s.index<=r.to+1&&s.from<=r.index&&s.to+1>=r.index&&(r.intersections.push({stroke:s.stroke,edge:s.edge,range:{rowStart:s.from,rowEnd:s.to+1,colStart:s.index,colEnd:s.index}}),s.intersections.push({stroke:r.stroke,edge:r.edge,range:{rowStart:r.index,rowEnd:r.index,colStart:r.from,colEnd:r.to+1}}),s.index===r.from&&(r.startMet=!0),s.index===r.to+1&&(r.endMet=!0),r.index===s.from&&(s.startMet=!0),r.index===s.to+1&&(s.endMet=!0),n.push(i,e)),o=!s||s.index>r.to+1}}return n},di=(e,t,n,r,i,a)=>{if(!e)return li(t,n,r,i,a);let o=e.entries,s=t.getVisibleRange(),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.visibleCells===n&&t.getBorderAt===r&&t.getMergeAt===i&&t.defaultColor===a&&w.isEqualRanges(t.visible,s))return t.collected}let l=li(t,n,r,i,a);return o.push({visibleCells:n,getBorderAt:r,getMergeAt:i,defaultColor:a,visible:s,collected:l}),o.length>8&&o.shift(),l},fi=(e,t,n,r,i,a)=>{if(!n&&!r)return{dH:null,dV:null};let{rangesH:o,rangesV:s}=t,c=xe.getDevicePixelRatio(),{top:l,left:u}=e.getScrollTopLeft(),d=e.getPaneBounds(),f=e.getVisibleRange(),p=e.getColumnSize(f.colEnd),m=e.getRowSize(f.rowEnd),h=Math.min(d.width,p?p.offset+p.size:d.width),g=Math.min(d.height,m?m.offset+m.size:d.height);i.pane!==e&&(i.pane=e,i.sigH=i.sigV=void 0);let _=(n,r)=>{if(!n)return null;let d=r?a?t.breaksRowsNone:t.breaksRows:a?t.breaksColumnsNone:t.breaksColumns,f=d.sig,p=r?o:s,m=n.width??1,_=xe.edgeTrailingShift(n.edge??`leading`,m,c),v=r?`${l}|${h}`:`${u}|${g}`,y=p.length===0&&f===``?`${v}|${c}|${m}|${_}`:`${v}|${r?u:l}|${c}|${m}|${_}|${r?t.sigRangesH:t.sigRangesV}|${f}`;if(r?i.sigH===y:i.sigV===y)return(r?i.dH:i.dV)??null;let b=Rt(e,r,p,{width:m,shift:_,breaksAt:d.byTrail.size>0?t=>xi(e,d.byTrail.get(t),r):void 0});return r?(i.sigH=y,i.dH=b):(i.sigV=y,i.dV=b),b};return{dH:_(n,!0)||null,dV:_(r,!1)||null}},pi=(e,t,n,r)=>(0,Z.jsx)(`path`,{d:e,fill:`none`,stroke:t.color,strokeWidth:(t.width??1)/n,strokeDasharray:t.dashArray?t.dashArray.join(`,`):void 0,vectorEffect:`non-scaling-stroke`},r),mi=(e,t,n,r,i,a)=>{let{dH:o,dV:s}=fi(e,t,n,r,i,!1);if(!o&&!s)return null;let c=xe.getDevicePixelRatio(),l=o&&n?.isDouble?o:null,u=s&&r?.isDouble?s:null,d=(l??``)+(u??``),f=e.getPaneBounds(),p=Math.ceil(f.width),m=Math.ceil(f.height),h=`${a}-normal`;return(0,Z.jsxs)(`svg`,{width:`${p}`,height:`${m}`,viewBox:`0 0 ${p} ${m}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:0,top:0,overflow:`visible`,pointerEvents:`none`},children:[d?(0,Z.jsx)(`defs`,{children:yi(h,d,1/c,p,m)}):null,d?(0,Z.jsxs)(`g`,{mask:`url(#${h})`,children:[l?pi(l,n,c):null,u?pi(u,r,c):null]}):null,o&&!l?pi(o,n,c):null,s&&!u?pi(s,r,c):null]})},hi=(e,t,n,r,i,a)=>{let{rows:o,columns:s,rowOrdinal:c,colOrdinal:l}=e,u=(e,t,n,r,i)=>{let a=null;if((t===void 0?void 0:e[t])?.forEach(e=>{e.index<n||e.index>r||(!a||yn.compareStrokes(e.stroke,a.stroke)>0)&&(a=e)}),a){let e=a;return{width:yn.BuiltInDefinitions.get(e.stroke.getStyle())?.width??1,kind:wi(e.edge)}}return i?{width:i.width??1,kind:i.edge??`leading`}:null},d=e=>e===void 0?void 0:e+1,f=(e,t,n)=>{if(!t)return 0;let r=t.width/2/a,i=xe.edgeCenter(e,t.kind,t.width,a),o=Math.floor(e*a)/a;return Math.max(0,n?i+r-(o+1/a):o-(i-r))};return{left:f(i.left,u(s,l.get(t.colStart),t.rowStart,t.rowEnd,r),!0),right:f(i.right,u(s,d(l.get(t.colEnd)),t.rowStart,t.rowEnd,r),!1),top:f(i.top,u(o,c.get(t.rowStart),t.colStart,t.colEnd,n),!0),bottom:f(i.bottom,u(o,d(c.get(t.rowEnd)),t.colStart,t.colEnd,n),!1)}},gi=(e,t,n,r,i,a)=>{let o=vi(e,i,a),s=.5/a,c=xe.snapLineCenter(t,1/a,a)-s,l=xe.snapLineCenter(n,1/a,a)+s;return r?`M ${o} ${c} L ${o} ${l} `:`M ${c} ${o} L ${l} ${o} `},_i=(e,t,n,r,i,a)=>{let o=vi(e,i,a),s=xe.snapDeviceEdge(t,a),c=xe.snapDeviceEdge(n,a);return r?`M ${o} ${s} L ${o} ${c} `:`M ${s} ${o} L ${c} ${o} `},vi=(e,t,n)=>{let r=yn.BuiltInDefinitions.get(yn.StrokeStyle.Double).width;return xe.snapLineCenter(e+xe.edgeTrailingShift(wi(t),r,n),r/n,n)},yi=(e,t,n,r,i)=>(0,Z.jsxs)(`mask`,{id:e,maskUnits:`userSpaceOnUse`,x:-8,y:-8,width:r+16,height:i+16,children:[(0,Z.jsx)(`rect`,{x:-8,y:-8,width:r+16,height:i+16,fill:`white`}),(0,Z.jsx)(`path`,{d:t,fill:`none`,stroke:`black`,strokeWidth:n})]},e),bi=(e,t,n)=>{let r=new Map,i=``,a=(e,t,a)=>{if(e===0||t<0||a<0)return!1;let o=n[e-1];if(o===void 0)return!1;let s=r.get(o);return s||(s=[],r.set(o,s)),s.push(t,a),i+=`${o}:${t}:${a};`,!0},o=e.length;for(let t=0;t<o;t++){let n=e[t];a(n.ordinal,n.from,n.to)}let s=!1;return t?.forEach((e,t)=>{e.forEach((e,n)=>{e>=2&&a(t,n,n)&&(s=!0)})}),s&&r.forEach((e,t)=>{let n=[];for(let t=0;t<e.length;t+=2)n.push([e[t],e[t+1]]);n.sort((e,t)=>e[0]-t[0]),r.set(t,n.flat())}),{byTrail:r,sig:i}},xi=(e,t,n)=>{if(!t)return;let r=Array(t.length);for(let i=0;i<t.length;i+=2){let a=n?e.getColumnSize(t[i]):e.getRowSize(t[i]),o=n?e.getColumnSize(t[i+1]):e.getRowSize(t[i+1]);r[i]=a.offset,r[i+1]=o.offset+o.size}return r},Si=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e[n];t+=`${r.rowStart},${r.colStart},${r.rowEnd},${r.colEnd};`}return t},Ci=(e,t,n,r)=>{if(!r){let n=e.getStyle()===yn.StrokeStyle.Double;if(n!==(t.getStyle()===yn.StrokeStyle.Double))return!n}let i=yn.compareStrokes(e,t);return i===0?n:i>0},wi=e=>e===yn.Edge.Right||e===yn.Edge.Bottom?`trailing`:`leading`,Ti=e=>{let{key:t,points:n,stroke:r,forceThinBorder:i=!1,isVertical:a=!1,edge:o,startExtend:s=0,endExtend:c=0}=e,l=yn.BuiltInDefinitions.get(i?yn.StrokeStyle.Thin:r.getStyle());if(!l)return null;let u=xe.getDevicePixelRatio(),d=n[0],f=n[1],p=n[2],m=n[3],h=r.getColor().toCSS(`adaptive`),g=l.description.toLowerCase().includes(`slant`);if(o===yn.Edge.DiagonalUp||o===yn.Edge.DiagonalDown)return(0,Z.jsx)(`path`,{d:`M ${d} ${f} L ${p} ${m}`,fill:`none`,stroke:h,strokeWidth:l.width/u,strokeDasharray:l.pattern?l.pattern.join(`,`):void 0},t);let _=s,v=(a?m-f:p-d)+c,y=xe.edgeTrailingShift(wi(o),l.width,u),b=a?-l.width/2/u+y:-_,x=a?-_:-l.width/2/u+y;return(0,Z.jsx)(oi,{offsetX:d+b,offsetY:f+x,length:v+_,isVertical:a,stroke:h,width:l.width,dashArray:l.pattern,isAngled:g},t)},Ei=_.Center,Di=Object.freeze({horizontal:!1,vertical:!1}),Oi=D.EmptyTopLeft,ki=(e,t)=>w.EmptyCell,Ai=(e,t)=>new Promise((e,t)=>{t(`StaticBorderRenderer does not support scrolling`)}),ji=(0,X.memo)(e=>{let{getBorderAt:t,getMergeAt:n,width:r,height:i,style:a,rowCount:o=2,columnCount:s=2,forceThinBorder:c,mode:l,normalRows:d,normalColumns:f,children:p,...m}=e,h=(0,X.useRef)(null),[g,{width:_,height:v}]=F(),y=r??_,b=i??v,x=(0,X.useMemo)(()=>{let e=[];for(let t=0;t<o;t++)for(let n=0;n<s;n++){let r={colIndex:n,rowIndex:t};e.push({cell:r,value:r})}return e},[o,s]),{renderLayer:S}=ci({getVisibleCells:(0,X.useCallback)(e=>x,[x]),getBorderAt:t,getMergeAt:n,forceThinBorder:c,mode:l,normalRows:d,normalColumns:f}),C=Math.floor(y/s),T=Math.floor(b/o),E={getColOffset:e=>e*y/s+0,getRowOffset:e=>e*b/o+0,getColIndex:e=>Math.floor((e-0)/C)-1,getRowIndex:e=>Math.floor((e-0)/T)-1},O={rowStart:0,colStart:0,rowEnd:o,colEnd:s},k={x:0,y:0,width:Math.max(0,y)+0,height:Math.max(0,b)+0},A={left:0,top:0,right:0,bottom:0},j=e=>{if(e<0)return null;let t=E.getColOffset(e);return{index:e,offset:t,size:E.getColOffset(e+1)-t}},M=e=>{if(e<0)return null;let t=E.getRowOffset(e);return{index:e,offset:t,size:E.getRowOffset(e+1)-t}},N=u([h,g]);if(!S)return null;let P={width:y,height:b},I={width:y,height:b},L={addReactEventListener:()=>()=>{},getElement:()=>h.current,focus:e=>{h.current?.focus(e)},registerFocusTarget:()=>Mi,getFocusTarget:()=>null,invalidate:Mi,setPointerCapture(e){h.current?.setPointerCapture(e)},releasePointerCapture(e){h.current?.releasePointerCapture(e)},getTotalSize:()=>P,getSurfaceSize:()=>I,getMetrics:()=>E,getRangeFromCell:e=>w.cellToRange(e),getVisibleRange:()=>O,getVisibleRows:()=>{let e=[];for(let t=0;t<o;t++)e.push(M(t));return e},getPaneRange:()=>O,getTotalRange:()=>O,getPanePointFromPointer:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{let e=[];for(let t=0;t<s;t++)e.push(j(t));return e},toClipBounds:(e,t)=>k,toPaneBounds:e=>e,toAbsoluteBounds:e=>e,getPaneBounds:()=>k,getInsets:()=>A,getBoundsFromRange:(e,t)=>k,getColumnSize:j,getRowSize:M,getAllPanes:()=>({[Ei]:L}),getAnchor:()=>Ei,getZoom:()=>1,scrollTo:(e,t)=>Promise.resolve(D.EmptyTopLeft),scrollCellCoordsIntoView:Ai,getCellFromPointer:ki,getPaneFromPointer:()=>L,getScrollOrientation:()=>Di,getScrollTopLeft:()=>Oi,getFreezeTopLeft:()=>Oi},R=S(L);return(0,Z.jsxs)(`div`,{style:{...a,position:`relative`,display:`flex`},...m,children:[(0,Z.jsx)(`div`,{ref:N,style:{flex:`1 1 100%`,display:`flex`,maxWidth:`100%`,maxHeight:`100%`},children:p}),R]})}),Mi=()=>{},Ni=e=>{switch(e){case`right`:return`flex-end`;case`center`:return`center`;default:return`flex-start`}},Pi=e=>{switch(e){case J.VerticalAlignment.Top:return`flex-start`;case J.VerticalAlignment.Bottom:return`flex-end`;case J.VerticalAlignment.Center:return`center`;default:return`stretch`}},Fi=(0,X.memo)(e=>{let{value:t,cellStyle:n,createCell:r,cell:i,propsBorder:a,disabled:o,className:s,style:c,ref:l,...u}=e,d=Ye(),f=d===`dark`,p=(0,X.useMemo)(()=>i||(r?.({value:t,style:n})??null),[i,t,n,r]),m=p?.getStyle(),h=(0,X.useMemo)(()=>m?.getFill().toCSS(f),[m,f]),g=(0,X.useMemo)(()=>m?.getFont().toCSS(f,1),[m,f]),_=(0,X.useMemo)(()=>m?.getInsets()??null,[m]),v=(0,X.useCallback)(()=>m?.getBorders()??null,[m]),y=m?.getAlignment(),b=y?.getRotation()??0,x=y?.getStacked()??!1,S=y?.getOverflow()===J.Overflow.Wrap,C=9*(y?.getIndent()??0),w=p?J.toCSSHorizontalTextAlign(p.getRenderHorizontalAlignment())??`left`:`left`,T=i?i.getNumberFormat().displayText??``:t??``,E=p?.getNumberFormat(),D=E?.formattedRuns?.runs,O=!E?.errorPlaceholder&&!!D&&D.some(e=>e.type!==Sn.ParseRunType.Text),k=O?E.formattedRuns.lastRepeatIndex??-1:-1,A=O?D.map((e,t)=>{if(e.type===Sn.ParseRunType.Spacing)return(0,Z.jsx)(`span`,{style:{visibility:`hidden`,whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t);if(e.type===Sn.ParseRunType.Repeat&&t===k){let n=e.width>0?Math.ceil(1e3/e.width):1;return(0,Z.jsx)(`span`,{style:{flex:`1 1 0%`,minWidth:0,overflow:`hidden`,whiteSpace:`pre`},children:e.text.repeat(n)},t)}return(0,Z.jsx)(`span`,{style:{whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t)}):T;return(0,Z.jsx)(`div`,{ref:l,className:Q(`sxl-static-cell`,s),"data-sxl-theme-surface":`grid`,"data-sxl-theme-mode":d,style:{width:`100px`,height:`100%`,boxSizing:`border-box`,display:`flex`,alignItems:`stretch`,textOverflow:`ellipsis`,background:`var(--sxl-color-base-100)`,filter:o?`grayscale(0.4) opacity(0.8)`:`none`,...c},...u,children:(0,Z.jsx)(ji,{getBorderAt:v,rowCount:1,columnCount:1,...a,style:{height:`100%`,width:`100%`,...a?.style},children:(0,Z.jsx)(`div`,{className:`sxl-fill`,style:{flex:`1 1 100%`,overflow:`hidden`,display:`flex`,alignItems:Pi(y?.getVertical()??J.VerticalAlignment.Bottom),paddingLeft:`4px`,paddingRight:`4px`,marginLeft:`-1px`,marginTop:`-1px`,marginRight:`-2px`,marginBottom:`-2px`,...h},children:(0,Z.jsx)(`div`,{className:`sxl-text`,style:{flex:`1 1 100%`,boxSizing:`border-box`,paddingTop:`${_?.top??0}px`,paddingRight:`${_?.right??0}px`,paddingBottom:`${_?.bottom??0}px`,paddingLeft:`${(_?.left??0)+C}px`,margin:`0px`,outline:`none`,overflow:`hidden`,textOverflow:`ellipsis`,maxHeight:`100%`,background:`transparent`,textAlign:w,whiteSpace:S?`pre-wrap`:`pre`,display:O?`flex`:void 0,alignItems:O?`baseline`:void 0,justifyContent:O&&k<0?Ni(w):void 0,transform:b?`rotate(${-b}deg)`:void 0,writingMode:x?`vertical-rl`:void 0,textOrientation:x?`upright`:void 0,...g},children:A})})})})});Fi.displayName=`StaticCellRenderer`;var Ii=(e,t)=>{if(t<=0||t>e.length||!`/*^&<>=:,+-@( `.includes(e[t-1]))return!1;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n>=e.length||`/*^&<>=:,)`.includes(e[n])},Li=e=>e.length>0&&`=+-`.includes(e[0]),Ri=e=>+(e[0]===`=`),zi=e=>e.referenceIndex===void 0?e.type===`error`?`var(--sxl-color-error, light-dark(#a31515, #ce9178))`:void 0:At[e.referenceIndex%At.length],Bi=(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++){let i=(e[n].text??``).length;if(t>=r&&t<=r+i)return n;r+=i}return-1},Vi=(e,t,n)=>{let r=n,i=-1,a=-1;for(let n of e){let e=(n.text??``).length;n.referenceIndex===t&&(i<0&&(i=r),a=r+e),r+=e}return i<0?null:{start:i,end:a}},Hi=(e,t)=>{for(let n of e)if(n.referenceIndex===t&&n.type===`tableReference`)return!0;return!1},Ui=async(e,t,n,r)=>{if(!Li(t))return null;try{let i=e.createFormula(t,r,{target:`display`}),a=-1,o=`self`,s=-1,c=Ri(t);for(let e of i.getTokens()){let t=(e.text??``).length;if(e.referenceIndex!==void 0&&e.refSide&&n>=c&&n<=c+t){a=e.referenceIndex,o=e.refSide,s=c+t;break}c+=t}if(a<0)return null;let l=await i.setReferenceModeAt(a,o),u=t.slice(0,Ri(t))+l.getExpression({target:`display`});return{value:u,caret:s+(u.length-t.length)}}catch{return null}},Wi=e=>{let{cell:t,tokens:n,zoom:r,size:i,style:a,...o}=e,s=t.getStyle(),c=s.getFont(),l=t.getInsets(),u=t.getTextPlacement(i,!0),d=s.getAlignment().getVertical(),f=u||d===J.VerticalAlignment.Top?`flex-start`:d===J.VerticalAlignment.Center?`center`:`flex-end`,p=`=`,m=[];for(let e=0;e<n.length;e++){let t=n[e];p+=t.text??``;let r=zi(t);m.push((0,Z.jsx)(`span`,r===void 0?{children:t.text??``}:{style:{color:r},children:t.text??``},e))}let h=s.measureText(p).renderLetterSpacing??0;return(0,Z.jsxs)(`div`,{...o,style:{position:`absolute`,inset:0,display:`flex`,alignItems:f,justifyContent:`flex-start`,overflow:`hidden`,whiteSpace:`pre`,pointerEvents:`none`,paddingLeft:(l.left+1)*r,paddingTop:(u?u.bounds.y:l.top)*r,paddingBottom:u?0:l.bottom*r,...c.toCSS(`adaptive`,r,!0),fontSize:c.getSize()*r*gn.getDeviceScale(),...u?{lineHeight:u.lineHeight*r+`px`}:null,...h?{letterSpacing:(c.getLetterSpacing()+h)*r+`px`}:null,...a},children:[`=`,m]})};Wi.displayName=`CellFormulaRenderer`;var Gi=(e,t,n)=>{s(e,[`onSelectionChange`]);let r=t?e.getSelection().getCoords().cell:null;return(0,X.useMemo)(()=>{if(!t||!r)return null;try{let t={rowIndex:r.rowIndex,colIndex:r.colIndex},n=e.getRange(t).getCell();if(n.isSpillOverflow())return null;let i=n.getFormulaText({target:`display`});if(i==null)return null;let a=e.getName(),o=e.getCalculation().createFormula(i,{...t,scope:a},{target:`display`}),s=o.getTokens();if(s.length===0)return null;let c=[];try{let e=o.getReferences();c=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[]}catch{}return{coords:t,cell:n,tokens:s,ranges:c}}catch{return null}},[e,t,r,n])},Ki=`M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673`,qi=`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`,Ji=e=>{let{bounds:t,zoom:n,disabled:r,path:i,onPress:a,style:o,...s}=e,[c,l]=(0,X.useState)(!1),u=dt(!0),d=Math.min(Math.min(18,t.height-8),t.width);return(0,Z.jsx)(`div`,{style:{width:`${d}px`,height:`${d}px`,right:`1px`,boxShadow:`0px 0px 0px 0.5px `+(c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 80%, white)`:`var(--sxl-color-base-300, grey)`),backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,borderRadius:+(d>12)+`px`,marginRight:`2px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:r?void 0:`pointer`,...o},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onPointerDown:e=>{u(e),a?.(e),e.stopPropagation(),e.preventDefault()},...s,children:(0,Z.jsx)(`svg`,{width:``+15*n,height:``+15*n,viewBox:`0 0 15 15`,style:{fill:c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 70%, black)`:`var(--sxl-color-base-content, grey)`,opacity:r?.6:1},children:(0,Z.jsx)(`path`,{d:i})})})},Yi=e=>{let{column:t,onColumnButtonMouseDown:n,...r}=e;s(t.getTable(),[`onAnyChange`]);let i=Ki,a=t?t.getFilter():null,o=t?t.getSort():null,c=o?o.getCriteria():null,l=a&&a.getCondition(),u=c?c.reverse??!1:null;return i=!0===u?l?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z`:`m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:!1===u?l?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z`:`m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:l?qi:Ki,(0,Z.jsx)(Ji,{path:i,onPress:e=>n?.(e,t),...r})},Xi=`_header_vt581_7`,Zi=`_hover_vt581_18`,Qi=`_filtered_vt581_25`,$i=`_selected_vt581_33`,ea=`_selectedAll_vt581_42`,ta=(e,t,n)=>e===n||t.contains(e),na=()=>!1,ra=(0,X.memo)(e=>{let{index:t,value:n,zoomScale:r=100,headerText:i=e=>`${e}`,verticalPadding:a=0,horizontalPadding:o=0,isSelected:s=na,isSelectedAll:c=na,isFiltered:l=na,cell:u,bounds:d,range:f,axis:p,zoom:m=1,onColumnButtonMouseDown:h,propsColumnButton:g,renderColumnButton:_=Yi,className:y,style:b={},...x}=e,S=qt(),C=n?.getColumn(),w=C&&!C.isHiddenButton(),T=(0,X.useRef)(null),[E,D]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=null,t=S.addReactEventListener(`pointermove`,t=>{let{clientX:n,clientY:r,target:i}=t;e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(!T.current)return;let e=T.current.getBoundingClientRect(),t=ta(i,T.current,S.getElement())&&n>=e.left&&n<=e.right&&r>=e.top&&r<=e.bottom;D(t)})}),n=S.addReactEventListener(`pointerleave`,()=>{e&&cancelAnimationFrame(e),D(!1)});return()=>{e&&cancelAnimationFrame(e),t?.(),n?.()}},[S]),(0,X.useEffect)(()=>{if(!E)return;let e=e=>{let t=T.current;if(!t)return;let n=t.getBoundingClientRect();(!ta(e.target,t,S.getElement())||e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&D(!1)};return document.addEventListener(`pointermove`,e,!0),()=>document.removeEventListener(`pointermove`,e,!0)},[E,S]);let O=r/100,k=s?.(t)||!1,A=c?.(t)||!1,j=p===v.Column,M=!j&&l(t),N=i(t),P=j?`center`:`end`,F=0,I=null;if(w){F=4,P=`start`;let e={x:d.x-1,y:-1,width:d.width+1-F,height:d.height+1};I=(0,Z.jsx)(`div`,{style:{...e,position:`absolute`,zIndex:2,display:`flex`,alignItems:`end`,justifyContent:`end`,flexDirection:`row`},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,Z.jsx)(ae,{render:_,props:{bounds:e,className:`sxl-column-button`,disabled:!1,zoom:m,column:C,onColumnButtonMouseDown:h,...g,style:{pointerEvents:`auto`,...g?.style,backgroundColor:`var(--sxl-color-base-100, white)`,marginBottom:`4px`,backgroundImage:void 0}}})},`columnButton`)}return(0,Z.jsxs)(`div`,{ref:T,className:Q(y,Xi,{[Zi]:E,[Qi]:M,[$i]:k&&!A,[ea]:A}),style:{fontSize:`calc(var(--sxl-doc-font-size, 11pt) * ${O})`,lineHeight:`calc(var(--sxl-doc-line-height, 1.2em) * ${O})`,justifyContent:P,paddingLeft:F,paddingBottom:0,paddingRight:j?void 0:`4px`,...b,left:b.left,top:b.top,width:b.width,height:b.height},...x,children:[j?N:(0,Z.jsx)(`span`,{style:{position:`relative`,top:`${O}px`},children:N}),I]})});ra.displayName=`SheetHeaderRenderer`;var ia=(e,t)=>Math.max(1,Math.floor(e-t)),aa=(0,X.memo)(e=>{let{collapsed:t,size:n}=e,r=n/2,i=Math.max(2,Math.round(n/5));return(0,Z.jsx)(`svg`,{width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{display:`block`},children:(0,Z.jsx)(`path`,{d:`M${i},${r}H${n-i}`+(t?`M${r},${i}V${n-i}`:``),stroke:`currentColor`,strokeWidth:1,shapeRendering:`crispEdges`})})});aa.displayName=`OutlineGlyph`;var oa={width:`100%`,height:`100%`,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border)`,color:`var(--sxl-color-base-content)`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`2px`,cursor:`pointer`,userSelect:`none`},sa={opacity:.5,cursor:`default`},ca={border:`1px solid var(--sxl-color-base-100)`,background:`var(--sxl-color-base-hover)`},la=e=>({fontSize:Math.max(8,e-4),lineHeight:e-2+`px`,textAlign:`center`,fontVariantNumeric:`tabular-nums`}),ua=(0,X.memo)(e=>{let{collapsed:t,size:n,title:r,onToggle:i,disabled:a}=e;return(0,Z.jsx)(`div`,{className:`sxl-outline-button`,title:r,"aria-disabled":a||void 0,style:a?{...oa,...sa}:oa,onClick:a?void 0:i,children:(0,Z.jsx)(aa,{collapsed:t,size:n-2})})});ua.displayName=`OutlineButton`;var da=(0,X.memo)(e=>{let{level:t,shown:n,size:r,title:i,onShowLevel:a,disabled:o}=e;return(0,Z.jsx)(`div`,{className:`sxl-outline-level-button`,title:i,"aria-label":i,"aria-disabled":o||void 0,"data-shown":n||void 0,style:{...oa,...ca,...la(r),...o?sa:null},onClick:o?void 0:a,children:t})});da.displayName=`OutlineLevelButton`;var fa=e=>(0,Z.jsx)(ua,{...e}),pa=e=>(0,Z.jsx)(da,{...e}),ma=e=>e.getCurrentPage()!==null||e.getItems().some(e=>!e.isVisible()),ha=e=>{let{fields:t,onPivotButtonMouseDown:n,...r}=e;return(0,Z.jsx)(Ji,{path:t.some(ma)?qi:Ki,onPress:e=>n?.(e,t),...r})},ga=e=>{let{expanded:t,size:n,disabled:r,title:i,onToggle:a,style:o}=e,s=dt(!0);return(0,Z.jsx)(`div`,{className:`sxl-pivot-toggle`,title:i,"aria-disabled":r||void 0,style:{width:n,height:n,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border, grey)`,backgroundColor:`var(--sxl-color-base-100, white)`,color:`var(--sxl-color-base-content)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:r?`default`:`pointer`,opacity:r?.5:1,userSelect:`none`,pointerEvents:`auto`,...o},onPointerDown:e=>{s(e),e.stopPropagation(),e.preventDefault(),r||a()},children:(0,Z.jsx)(aa,{collapsed:!t,size:n-2})})},_a=(0,X.memo)(e=>{let{anchorLocation:t=_.TopLeft,cellWidth:n=0,cellHeight:r=0,size:i=7,inset:a=1,shape:o=`triangle`,fill:s,propsPath:c,style:l,...u}=e,d=i,f=a,p=`red`,m=[],h=[];return t===_.TopLeft?(p=`light-dark(green, rgb(255, 198, 246))`,m.push(f),h.push(f),m.push(f+d),h.push(f),m.push(f),h.push(f+d)):t===_.TopRight?(p=`light-dark(red, rgb(0, 255, 255))`,m.push(n-f),h.push(f),m.push(n-(f+d)),h.push(f),m.push(n-f),h.push(f+d)):t===_.BottomRight?(p=`light-dark(purple, rgb(236, 252, 211))`,m.push(n-f),h.push(r-f),m.push(n-(f+d)),h.push(r-f),m.push(n-f),h.push(r-(f+d))):t===_.BottomLeft&&(p=`light-dark(blue, rgb(255, 236, 183))`,m.push(f),h.push(r-f),m.push(f+d),h.push(r-f),m.push(f),h.push(r-(f+d))),(0,Z.jsx)(`svg`,{width:`${n}`,height:`${r}`,viewBox:`0 0 ${n} ${r}`,style:{position:`absolute`,width:`${n}px`,height:`${r}px`,pointerEvents:`none`,...l},...u,children:(0,Z.jsx)(`path`,{d:o===`bubble`&&t===_.TopRight?va(n-f-d,f,d):`M ${m[0]} ${h[0]} L ${m[1]} ${h[1]} L ${m[2]} ${h[2]} L ${m[0]} ${h[0]} Z`,fill:s??p,...c})})}),va=(e,t,n)=>`M ${e} ${t} H ${e+n} V ${t+n} L ${e+.45*n} ${t+.5*n} H ${e} Z`,ya=(()=>{let e=null,t=new Set;return{getMode:()=>e,setMode:n=>{let r=typeof n==`function`?n(e):n;r!==e&&(e=r,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}})(),ba=()=>ya.getMode(),xa=e=>ya.setMode(e),Sa=(0,X.createContext)(null),Ca=()=>(0,X.useContext)(Sa)??ya,wa=()=>{let e=Ca();return(0,X.useSyncExternalStore)(e.subscribe,e.getMode,e.getMode),e},Ta=null,Ea=new Set,Da=e=>(Ea.add(e),()=>{Ea.delete(e)}),Oa=e=>{Ta!==e&&(Ta=e,Ea.forEach(e=>e()))},ka=()=>Ta,Aa=e=>(0,X.useSyncExternalStore)(Da,()=>Ta?.sheet===e?Ta:null,()=>null),ja=e=>!e||e===`none`||e===`transparent`,Ma=(e,t,n,r)=>{let i=e.getStyle().getFill()?.toCSS(n)?.background;return ja(i)&&(i=t.getStyles().getNormal().getFill().toCSS(n)?.background),ja(i)&&(i=r??`#ffffff`),i},Na=(e,t,n)=>{if(typeof t!=`string`||t.charAt(0)!==`=`||t.length<2)return t;try{let r=e.getCalculation().createFormula(t,n,{target:`display`});r.isValid()||(r=r.autoCorrect()??r);let i=r.getExpression();return i?`=`+i:t}catch{return t}},Pa=(e,t,n)=>{if(!e||!t)return n;try{return e.getWorksheet(t)??n}catch{return n}},Fa=(e,t=e.getWorkbook())=>n=>{if(t?.getProtection().isReadOnly())throw Error(`Cannot start an edit session on a write-protected (read-only) workbook.`);let r=Pa(t,n.scope,e),i={rowIndex:n.rowIndex,colIndex:n.colIndex},a=r.getRange(i),o=a.getCell();if(!o.isEditAllowed())return null;let s=o.getSpillKind()===`fixed`?o.getSpill()?.getCoords()??null:null,c=!!s&&s.colStart===i.colIndex&&s.rowStart===i.rowIndex;if(s&&!c&&!((e,t)=>{let n=e.getSelection().getRanges();if(n.getCount()!==1)return!1;let r=n.at(0).getCoords();return r.colStart===t.colStart&&r.rowStart===t.rowStart&&r.colEnd===t.colEnd&&r.rowEnd===t.rowEnd})(r,s))return null;let l={...i,scope:r.getName()};return{coords:l,clean:()=>{if(s)return r.getRange(s).getCell();let e=r.getRange(i).getCell();return e.isSpillOverflow()?e.createCell({value:null}):e},commit:(e,t)=>{let n=Na(r,e,i),o=e.replace(/\s+/g,` `),c=o.length>20?`${o.slice(0,20)}…`:o,l=typeof n==`string`&&n.charAt(0)===`=`;if(s&&(!t?.arrayFixed||!l)){let e=r.getRange(s),t=j(`op.typeInto`,{text:c,range:e.toString()});l?e.setFormula(n,{arrayFixed:!0,description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0}):e.setValue(n,{description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}if(t?.arrayFixed&&l){let e=r.getSelection().getRanges();if(e.getCount()!==1)throw new k(j(`error.sheet.arrayFixedMultipleRanges`));let t=e.at(0);t.setFormula(n,{arrayFixed:!0,description:j(`op.typeInto`,{text:c,range:t.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}let u=t?.broadcast?r.getSelection().getRanges():a;u.setValue(n,{description:j(`op.typeInto`,{text:c,range:u.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0})},validate:e=>((e,t,n)=>{let r={rowIndex:t.rowIndex,colIndex:t.colIndex},i=e.getRange(w.cellToRange(r)).getDataValidations().filter(e=>!!e.getCondition()&&e.isShowAlertMessage());if(i.length===0)return!0;let a=Na(e,n,r);return(async()=>{for(let o=0;o<i.length;o++){let s=i[o];if(await s.validateInputAt(a,r.rowIndex,r.colIndex))continue;let c=s.getAlertStyle(),l=ka();return c===Gn.AlertStyle.Warning&&l?.dataValidation===s&&l.dirty===n&&l.sheet===e&&w.isEqualCells(l.coords,t)?(Oa(null),!0):(Oa({sheet:e,coords:t,dirty:n,dataValidation:s,style:c}),c===Gn.AlertStyle.Information)}return Oa(null),!0})()})(r,l,e)}},Ia=(e,t)=>{let n=e.getWorkbook(),r=t?.referenceMode??{getMode:ba,setMode:xa},i,{anchor:a,notifySessionChange:o}=((e,t,n)=>{let r=()=>{let r=n();return r?Pa(t,r.getCoords().scope,e):t?.getSelectedWorksheet()??e},i=null,a=null,o=null,s=()=>{let e=r();e!==i&&(a?.(),i=e,a=e.getSelection().addListeners({onChange:()=>o?.()}),o?.())};return{anchor:{getCoords:()=>{let e=r();return{...e.getSelection().getCoords().cell,scope:e.getName()}},subscribe:e=>{o=e,s();let n=t?.addListeners({onSelectedSheetChange:()=>s()})??null;return()=>{a?.(),n?.(),o=null}}},notifySessionChange:s}})(e,n,()=>i?.getSession()??null);return i=new Ot(a,Fa(e,n),{revertAnchor:t=>{Pa(n,t.scope,e).getSelection().clearAndModify({rowIndex:t.rowIndex,colIndex:t.colIndex})}}),i.subscribe(()=>o()),(e=>{let t=null,n=null,r=t=>{var n;B(t?{key:`edit`,description:(n=t.getState().mode,j(n===`edit`?`editMode.edit`:`editMode.enter`)),args:{editable:e},cancel:()=>{e.getSession()===t&&e.cancel()},done:()=>{e.getSession()===t&&e.commit()},onModeChange:n=>{n?.args?.editable!==e&&queueMicrotask(()=>{e.getSession()===t&&e.cancel()})}}:t=>t?.args?.editable===e?null:t)};e.subscribe(()=>{let i=e.getSession();t?.(),t=null,i&&(n=i.getState().mode,t=i.subscribe(()=>{let e=i.getState().mode;e!==n&&(n=e,r(i))})),r(i)})})(i),(e=>{let t=e.getSession(),n=null,r=e=>{let t=ka();t&&!e(t)&&Oa(null)};e.subscribe(()=>{let i=e.getSession();if(i===t)return;let a=t;t=i,n?.(),n=null,i?(r(()=>!1),n=i.subscribe(()=>r(e=>e.dirty===i.getState().dirty))):a&&r(e=>e.style===Gn.AlertStyle.Information)})})(i),((e,t,n,r)=>{e.subscribe(()=>{let i=e.getSession(),a=r.getMode();if(i){if(!a){let a=Pa(n,i.getCoords().scope,t).getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});r.setMode({mode:`show`,selection:a,activeInput:null,allowMulti:!0,onDone:({reason:t})=>{t===`cancel`?e.cancel():e.commit()}})}}else if(a&&(r.setMode(null),a.mode===`point`&&n)){let e=a.selection.getWorksheet();e&&!e.isDeleted()&&n.getSelectedWorksheet()!==e&&e.getSelection().getRanges().select({scrollIntoView:!0,autoFocus:!0})}})})(i,e,n,r),((e,t,n)=>{t&&t.addListeners({onSelectedSheetChange:()=>{let r=e.getSession();if(!r)return;let i=t.getSelectedWorksheet();i&&i.getName()!==r.getCoords().scope&&n.getMode()?.mode!==`point`&&e.commit()}})})(i,n,r),i},La={position:`fixed`,transform:`translate(-50%, -100%)`,pointerEvents:`none`,zIndex:12e3,maxWidth:`24rem`,padding:`2px 8px`,borderRadius:`4px`,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`,background:`var(--sxl-color-base-100, rgb(255,255,255))`,color:`var(--sxl-color-base-content, rgb(37,36,35))`,fontFamily:`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,fontSize:`0.85em`,lineHeight:1.4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,boxShadow:`0 2px 8px var(--sxl-color-shadow, rgba(0, 0, 0, 0.18))`},Ra=(e,t)=>{let n=(0,X.useRef)(!1),r=(0,X.useRef)(e);r.current=e;let i=(0,X.useRef)(t);i.current=t;let a=(0,X.useRef)(null),o=(0,X.useRef)(null);(0,X.useEffect)(()=>()=>{o.current?.()},[]);let s=ee(),c=(0,X.useCallback)(e=>{if(e?.button!==void 0&&e.button!==0||(a.current=e?.clientX!==void 0&&e?.clientY!==void 0?{x:e.clientX,y:e.clientY}:null,n.current))return;n.current=!0,s.onPointerDown(e);let t=()=>{n.current=!1,o.current=null,window.removeEventListener(`pointerup`,t,!0),window.removeEventListener(`pointercancel`,t,!0),i.current?.()};o.current=t,window.addEventListener(`pointerup`,t,!0),window.addEventListener(`pointercancel`,t,!0),r.current?.()},[s]),l=(0,X.useCallback)(e=>{if(n.current)return!0;let t=a.current;return!!t&&(Math.abs(e.clientX-t.x)<=3&&Math.abs(e.clientY-t.y)<=3||(a.current=null,!1))},[]);return(0,X.useMemo)(()=>({isDragging:()=>n.current,blocksHover:l,begin:c,onDragStart:s.onDragStart}),[l,c,s])},za=e=>!!e&&e.selectionStart!==null&&e.selectionEnd!==null&&e.selectionStart!==e.selectionEnd,Ba=(e,t)=>{let n=e[t]?.evalIndex;if(n===void 0)return null;let r=t,i=t;for(;r>0;){let t=e[r-1].evalIndex;if(t===void 0||t<n)break;r--}for(;i<e.length-1;){let t=e[i+1].evalIndex;if(t===void 0||t<n)break;i++}return{lo:r,hi:i,evalIndex:n}},Va=(e,t,n,r,i,a)=>{if(!e||e.length===0||r>=i)return null;let o=t,s=-1,c=-1,l=t,u=t;for(let t=0;t<e.length;t++){let n=(e[t].text??``).length,a=o;o+=n,n!==0&&e[t].type!==`whitespace`&&a<i&&o>r&&(s<0&&(s=t,l=a),c=t,u=o)}if(s<0)return null;let d=null,f=null;for(let t=s;t<=c;t++){let n=Ba(e,t);n&&((!f||n.evalIndex<f.evalIndex)&&(f=n),n.lo<=s&&n.hi>=c&&(!d||n.hi-n.lo<d.hi-d.lo)&&(d=n))}if(d&&d.lo===s&&d.hi===c)return{lo:s,hi:c,start:l,end:u,fragment:null,evalIndex:d.evalIndex};if(a&&l>=r&&u<=i){let e=n.slice(l,u);if(a(e))return{lo:s,hi:c,start:l,end:u,fragment:e,evalIndex:0}}let p=d??f;if(!p)return null;let m=Ua(e,t,p.lo,p.hi);return{lo:p.lo,hi:p.hi,start:m.start,end:m.end,fragment:null,evalIndex:p.evalIndex}},Ha=e=>{if(!e)return null;let t=e.length-1;for(;t>=0&&e[t].evalIndex===void 0;)t--;return t<0?null:{lo:0,hi:t,evalIndex:0}},Ua=(e,t,n,r)=>{let i=t,a=t;for(let t=0;t<e.length&&(t===n&&(a=i),i+=(e[t].text??``).length,t!==r);t++);return{start:a,end:i}},Wa=e=>e===`,`?{decimal:`,`,column:`;`,row:`|`}:{decimal:`.`,column:`,`,row:`;`},Ga=(e,t,n)=>{if(e==null)return`0`;if(kn.isError(e))return String(e);let r=typeof e;if(r===`number`){if(!Number.isFinite(e))return null;let n=String(e);return t.decimal===`.`?n:n.replace(`.`,t.decimal)}return r===`boolean`?e?n.t:n.f:r===`string`?`"${e.replace(/"/g,`""`)}"`:null},Ka=(e,t,n={t:`TRUE`,f:`FALSE`})=>{if(kn.isError(e,kn.Code.Parse))return null;let r=e;if(e!=null&&typeof r?.getRowCount==`function`){let e=r.getRowCount(),i=r.getColumnCount(),a=e*i;if(a===0||a>1024)return null;if(a===1)return Ga(r.getValueAt(0,0),t,n);let o=[];for(let a=0;a<e;a++){let e=[];for(let o=0;o<i;o++){let i=Ga(r.getValueAt(a,o),t,n);if(i===null)return null;e.push(i)}o.push(e.join(t.column))}return`{${o.join(t.row)}}`}return Ga(e,t,n)},qa=e=>e==null?``:(kn.isError(e),String(e)),Ja=e=>{if(e==null)return`0`;if(kn.isError(e,kn.Code.Parse))return null;if(kn.isError(e))return String(e);let t=typeof e;if(t===`number`||t===`boolean`||t===`string`)return String(e);let n=e;if(typeof n?.getRowCount==`function`){let e=n.getRowCount(),t=n.getColumnCount(),r=e*t;if(r<=1)return qa(n.getValueAt?.(0,0));if(r>12)return`{${e}×${t}}`;let i=[];for(let r=0;r<e;r++){let e=[];for(let i=0;i<t;i++)e.push(qa(n.getValueAt(r,i)));i.push(e.join(`, `))}return`{${i.join(`; `)}}`}return String(e)},Ya=!1,Xa=()=>Ya,Za=(e,t,n)=>{if(e.nativeEvent.isComposing||t?.mode!==`point`)return!1;let r=t.selection;if(!r)return!1;let i=e.which===Pe.Left?T.Left:e.which===Pe.Right?T.Right:e.which===Pe.Up?T.Up:e.which===Pe.Down?T.Down:null,a=e.ctrlKey||e.metaKey,o=e.which===Pe.Space?a&&e.shiftKey?x.Both:a?x.Column:e.shiftKey?x.Row:null:null;if(i===null&&o===null)return!1;e.preventDefault(),e.stopPropagation();let s=r.getWorksheet().getName(),c=r.getCoords(),l=c.ranges??[],u=c.rangeIndex??-1;Ya=!0;try{if(u<0){let e={rowStart:c.cell.rowIndex,colStart:c.cell.colIndex,rowEnd:c.cell.rowIndex,colEnd:c.cell.colIndex,scope:n};r.updateCoords({cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:n},ranges:[...l,e],rangeIndex:l.length})}else{let e=l[u];e&&(e.scope??s)!==n&&r.updateCoords({...c,ranges:l.map((e,t)=>t===u?{...e,scope:n}:e)})}}finally{Ya=!1}return o===null?r.navigate(i,e.shiftKey,a):r.selectRegion({axis:o,contentOnly:!1}),!0},Qa=e=>{let t=(0,X.useRef)(e);t.current=e;let[n,r]=(0,X.useState)(e.initialText??``),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),c=(0,X.useRef)(n),l=(0,X.useRef)(n),u=(0,X.useRef)(n),d=(0,X.useRef)(!1),f=(0,X.useRef)(null),p=(0,X.useRef)(null),m=(0,X.useRef)(!1),h=(0,X.useRef)(!1),g=(0,X.useRef)(!0),_=(0,X.useRef)(null),v=e=>{c.current=e,r(e),m.current=!0;let n=e!==l.current;d.current=n,s(n),g.current&&t.current.onChangeText?.(e)},y=e=>{f.current=e,a(e)},b=K(e=>{let{parse:n,changeOn:r=`live`,onChange:i}=t.current,{value:a,error:o}=n(e);o?y(o):(y(null),a!==void 0&&(p.current=a,r!==`done`&&i?.(a)))},[]),x=e=>{l.current=e;let t=m.current;g.current=!1;try{v(e)}finally{g.current=!0}m.current=t,y(null)},S=K(e=>{let{onDone:n}=t.current,r=e.reason!==`cancel`;r&&f.current||(r||(_.current=null),n&&(n(p.current,e),r&&(l.current=c.current,d.current=!1,s(!1))),r&&(()=>{let e=_.current;_.current=null,e&&e.echoOf===c.current&&x(e.text)})())},[]),C=e=>{_.current=null,v(e),y(null),b(e)},w=K(()=>{C(l.current)},[]),T=K(()=>{C(u.current)},[]),E=K((e,n)=>{if(m.current&&t.current.session.isActive()){l.current=e,_.current={text:e,echoOf:c.current};let t=c.current!==e;return d.current=t,s(t),!1}return _.current=null,n!==void 0&&(p.current=n),x(e),!0},[]),D=K(()=>{u.current=c.current,m.current=!1,_.current=null},[]),O=K(()=>{h.current=!1},[]),k=K(()=>{let e=h.current;return h.current=!1,e},[]);return{text:n,error:i,dirty:o,textRef:c,committedTextRef:l,baselineTextRef:u,dirtyRef:d,errorRef:f,touchedRef:m,lastValidRef:p,setText:v,setError:y,liveChange:b,notifyDone:S,revertToCommitted:w,revertToBaseline:T,resetCommitted:E,beginSession:D,handleDoneKeys:K(e=>{let{changeOn:n=`live`,session:r}=t.current;return e.key===`Escape`?(r.isActive()&&m.current?(e.preventDefault(),e.stopPropagation(),r.end({reason:`cancel`,key:`Escape`})):!r.isActive()&&d.current&&(e.preventDefault(),e.stopPropagation(),w()),!0):e.key!==`Enter`||e.altKey||e.ctrlKey||e.metaKey?!(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey)&&(h.current=!0,f.current?r.isActive()?r.end({reason:`cancel`,key:`Tab`,shiftKey:e.shiftKey}):w():r.isActive()?r.end({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}):d.current&&S({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}),!0):f.current?(e.preventDefault(),e.stopPropagation(),!0):n===`done`?(e.preventDefault(),e.stopPropagation(),r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0):(h.current=!0,r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):d.current&&S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0)},[]),handleTextKeys:K(e=>!!G.isCaretKey(e)&&(e.stopPropagation(),!0),[]),resetBlurGuard:O,consumeBlurGuard:k,commit:K(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`accept`}):S({reason:`accept`})},[]),cancel:K(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`cancel`}):(w(),S({reason:`cancel`}))},[])}},$a=(e,t,n)=>{let r=e.getWorksheet(),i=r.getRange(t).toString();return n&&n!==r.getName()?Qn.sheetAndRangeToString(Qn.sheetNameToString(n),i):i},eo=(e,t)=>{try{let n={rowStart:t.rowStart,rowEnd:t.rowEnd,colStart:t.colStart,colEnd:t.colEnd,scope:t.scope},r=e.getWorksheet(),i={...e.getCoords(),scope:r.getName()};return r.getNames().getByRanges([n],{includeParts:!0,home:i})[0]??null}catch{return null}},to=(e,t)=>{let n=t.scope&&t.scope!==e.getName()?e.getWorkbook()?.getWorksheet(t.scope):e;if(!n)return null;let r=n.getCell({rowIndex:t.rowStart,colIndex:t.colStart}),i=r.getSpillKind();if(!i||i===`error`)return null;let a=r.getSpill()?.getCoords();return a&&a.rowStart===t.rowStart&&a.colStart===t.colStart?{coords:a,kind:i}:null},no=(e,t)=>{if(t.rowStart===t.rowEnd&&t.colStart===t.colEnd)return!1;try{let n=to(e,t);return n?.kind===`dynamic`&&n.coords.rowEnd===t.rowEnd&&n.coords.colEnd===t.colEnd}catch{return!1}},ro=(e,t,n)=>{try{return no(e.getWorksheet(),t)?$a(e,{rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowStart,colEnd:t.colStart,$rowStart:n?.$rowStart,$colStart:n?.$colStart},t.scope)+`#`:null}catch{return null}},io=(e,t,n)=>{let r=null;for(let i of t){let t=i.referenceIndex;if(t===void 0||i.value!==`#`)continue;let a=n[t];if(a)try{let i=to(e,a);if(!i)continue;r??=n.slice(),r[t]={...a,rowEnd:i.coords.rowEnd,colEnd:i.coords.colEnd}}catch{}}return r??n},ao=e=>e?e.getSelectedWorksheet()??e.getWorksheets().getItems({visibility:Bn.Visibility.VeryHidden})[0]??null:null,oo=e=>e.length>Nn.MAX_EXPRESSION_LENGTH,so=e=>{let t=[],n=0,r=!1;for(let i=0;i<e.length;i++){let a=e[i];a===`'`?r=!r:a!==`,`||r||(t.push({text:e.slice(n,i),start:n,end:i}),n=i+1)}return t.push({text:e.slice(n),start:n,end:e.length}),t},co=(e,t,n)=>{let r=t.trim();if(!r)return null;let i=e=>{if(!e||e.getCount()!==1)return null;let t=e.at(0),n=t.getCoords();return{rowStart:n.rowStart,colStart:n.colStart,rowEnd:n.rowEnd,colEnd:n.colEnd,scope:t.getWorksheet().getName()}};try{let t=n?.scope&&!r.includes(`!`)?e.getWorksheet(n.scope):null;return i(t?t.getRanges(r):e.getRanges(r))}catch{}try{let t=ao(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});return t&&t.isValid()&&t.isReferenceOnly()?i(t.getReferences()):null}catch{return null}},lo=(e,t,n,r)=>{let i=t.trim();if(!i)return null;let a=!Li(i);if(a&&!r)return null;try{let r=ao(e);if(!r)return{tokens:[],ranges:[]};let i=r.getCalculation().createFormula(a?`=`+t:t,n,{target:`display`}),o=i.getTokens();if(o.length===0)return{tokens:[],ranges:[]};let s=[];try{let e=i.getReferences(),t=n?.scope??r.getName();s=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??t}:null):[],s=io(r,o,s)}catch{}return{tokens:o,ranges:s}}catch{return{tokens:[],ranges:[]}}},uo=(e,t,n)=>{if(!n||!e)return t.toString();try{let r=t.getCoords(),i=t.getWorksheet?.()?.getName()??n;if(!r.every(e=>!e||(e.scope??i)===n))return t.toString();let a=e.getWorksheet(n);return a?a.getRanges(r).toString():t.toString()}catch{return t.toString()}},fo=(e,t)=>{let n=e.trim();if(!n)return e;let r=(Li(n)?n.slice(Ri(n)):n).trim();return r?t?r:`=`+r:e},po=(e,t,n,r,i)=>{if(e==null)return``;let a=r?.scope??null,o=t===`formula`,s=i===`bare`;if(typeof e==`string`)return i===`literal`?e:o?fo(e,s):e;try{if(e.isICellRanges){let t=uo(n,e,a);return o?fo(t,s):t}if(!o){let t=e.getReferences();return t?uo(n,t,a):``}let t=e.getExpression({target:`display`});return t?fo(t,s):``}catch{return``}},mo=(e,t=`formula`)=>{let{value:n,onChange:r,onChangeText:i,changeOn:a=`live`,allowMulti:o=!1,allowCrossSheet:s=!0,required:c=!1,disabled:l=!1,onDone:u,home:d,equals:f=`optional`,pickAs:p=`relative`,pickSpills:m=!1}=e,h=gr(),g=e.workbook===void 0?h:e.workbook,_=t===`formula`,v=f!==`required`&&f!==`literal`,y=wa(),[b,x]=(0,X.useState)(!1),[S,T]=(0,X.useState)(null),[E,D]=(0,X.useState)(!1),O=(0,X.useRef)(null),k=(0,X.useRef)(null),A=(0,X.useRef)(!1),j=(0,X.useRef)(!1),M=(0,X.useRef)(g??null);M.current=g??null;let N=(0,X.useRef)(d);N.current=d;let[P,F]=(0,X.useState)(0);(0,X.useEffect)(()=>{if(!g)return;let e=!0;return Promise.resolve(g.whenCalculationReady()).then(()=>{e&&F(e=>e+1)}).catch(()=>{}),()=>{e=!1}},[g]);let[I]=(0,X.useState)(()=>po(n,t,g??null,d,f)),L=Qa({initialText:I,parse:e=>se(e),changeOn:a,onChange:r,onChangeText:i,onDone:u,session:{isActive:()=>j.current,end:e=>_e(e)}}),{text:R,error:ee,dirty:te,textRef:z,committedTextRef:B,baselineTextRef:V,dirtyRef:H,errorRef:ne,lastValidRef:U,setText:W,setError:re,liveChange:ie,notifyDone:ae}=L,G=()=>N.current?.scope??M.current?.getSelectedWorksheet()?.getName()??null,oe=e=>{let t=G();if(!t)return!0;try{return(e.getReferences()?.getCoords()??[]).every(e=>!e||(e.scope??t)===t)}catch{return!0}},se=e=>{let t=e.trim();if(!t)return c?{error:C(_?`formulaInput.required`:`referenceInput.required`)}:{value:null,error:null};let n=M.current;if(!n)return{error:null};let r=ao(n);if(!r)return{error:null};let i=r.getCalculation();if(!_){if(t.startsWith(`=`))return{error:C(`referenceInput.invalid`)};try{let e=i.createFormula(`=`+t,N.current,{target:`display`});if(e.isValid()&&e.isReferenceOnly()&&e.getReferences())return s||oe(e)?{value:e,error:null}:{error:C(`referenceInput.crossSheet`)}}catch{}return{error:C(`referenceInput.invalid`)}}if(f===`required`&&!Li(t))return{error:C(`formulaInput.equalsRequired`)};if(f===`literal`&&!Li(t))return{error:null};let a=Li(t)?t:`=`+t;try{let e=i.createFormula(a,N.current,{target:`display`});if(!e.isValid()){let t=e.autoCorrect();if(!t)return{error:C(`formulaInput.invalid`)};e=t}return s||oe(e)?{value:e,error:null}:{error:C(`referenceInput.crossSheet`)}}catch{return{error:C(`formulaInput.invalid`)}}};(0,X.useEffect)(()=>{if(P===0)return;let e=z.current;if(!e.trim())return;if(H.current)return void ie(e);let{value:t,error:n}=se(e);re(n),t&&(U.current=t)},[P]);let ce=oo(R),le=ce?(e=>{let t=e.slice(0,Nn.MAX_EXPRESSION_LENGTH),n=t.lastIndexOf(`,`);return`${n>0?t.slice(0,n):t}…`})(R):R,ue=(0,X.useMemo)(()=>_&&!ce&&g?lo(g,R,N.current,v):null,[_,ce,g,R,P,v]),de=_?Ri(R):0,fe=(0,X.useMemo)(()=>ue&&ue.tokens.length!==0&&ue.tokens.map(e=>e.text??``).join(``)===R.slice(de)?ue.tokens:null,[ue,R,de]),pe=K(()=>{let e=k.current;if(!e||!g)return;let t=z.current;if(oo(t))return;if(_){let n=lo(g,t,N.current,v),r=n?.ranges??[],i=O.current?.selectionStart??t.length,a=-1;if(n){let e=Ri(t);for(let t of n.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){a=t.referenceIndex;break}e+=n}a>=0&&(a>=r.length||!r[a])&&(a=-1)}let o=g.getSelectedWorksheet();if(!o)return;let s={...o.getSelection().getCoords().cell,scope:o.getName()},c=r.some(Boolean)?{cell:s,ranges:r,rangeIndex:a}:{cell:s,ranges:w.EmptyRanges,rangeIndex:-1};A.current=!0;try{e.updateCoords(c)}finally{A.current=!1}return}let n=t.trim()?so(t):[],r=n.map(e=>co(g,e.text,N.current)),i=-1;if(o){if(r.length){let e=O.current?.selectionStart??t.length,r=n.findIndex(t=>e>=t.start&&e<=t.end),a=r>=0&&!n[r].text.trim();i=r<0||a?-1:r}}else i=r.length?0:-1;i>=0&&!r[i]&&(i=-1);let a=g.getSelectedWorksheet();if(!a)return;let s={...a.getSelection().getCoords().cell,scope:a.getName()};A.current=!0;try{e.updateCoords({cell:s,ranges:r,rangeIndex:i})}finally{A.current=!1}},[g,o,_]),me=(e,t)=>{let n=M.current,r=e.scope??N.current?.scope??null,i=ao(n);if(m&&i&&r&&no(i,{...e,scope:r})){let n=he({...e,rowEnd:e.rowStart,colEnd:e.colStart},t);return n===null?null:n+`#`}return he(e,t)},he=(e,t)=>{let n=M.current;if(!n)return null;let r=t?((e,t,n)=>{let r=t.trim().replace(/^=\s*/,``).trim();if(!r)return null;try{let t=ao(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});if(!t||!t.isValid()||!t.isReferenceOnly()||Hi(t.getTokens(),0))return null;let i=t.getReferences()?.getCoords(),a=i?.length===1?i[0]:void 0;return a?{$rowStart:!!a.$rowStart,$colStart:!!a.$colStart,$rowEnd:!!a.$rowEnd,$colEnd:!!a.$colEnd}:null}catch{return null}})(n,t,N.current):null,i=p===`absolute`,a=N.current?.scope??null,o=e.scope??a;if(!o)return null;if(o!==a)return((e,t,n,r)=>{if(!t?.scope)return null;try{let i={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd,scope:t.scope};if(r)return e.getRanges([{...i,...r}]).toString();let a=e.getRanges([i]);return(n?a.getFixed(!0):a).toString()}catch{return null}})(n,{...e,scope:o},i,r);try{let t=n.getWorksheet(o);if(!t)return null;let a={rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd};if(r)return t.getRanges([{...a,...r}]).toString();let s=t.getRange(a);return(i?s.getFixed(!0):s).toString()}catch{return null}};(0,X.useEffect)(()=>{let e=S;if(e&&g)return e.addListeners({onChange:()=>{if(A.current||Xa())return;let t=e.getCoords(),n=t.rangeIndex??-1,r=n>=0?t.ranges?.[n]:null;if(_){let e=n>=0?t.ranges?.[n]:null;if(!e)return;let r=z.current,i=O.current,a=lo(g,r,N.current,v),o=a?.ranges.length??0,s=a&&n<o?Vi(a.tokens,n,Ri(r)):null,c=me(e,s?r.slice(s.start,s.end):null);if(c==null)return;let l,u;if(a){if(n<o){if(!s)return;l=r.slice(0,s.start)+c+r.slice(s.end),u=s.start+c.length}else{let e=i?.selectionStart??r.length,t=i?.selectionEnd??r.length,n=(e>0&&!`/*^&<>=:,+-@( `.includes(r[e-1])?`,`:``)+c;l=r.slice(0,e)+n+r.slice(t),u=e+n.length}}else{if(r.trim())return;l=(f===`bare`?``:`=`)+c,u=l.length}W(l),Ce(!0),ie(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),pe()});return}if(!r)return;let i=z.current,a=i.trim()?so(i):[],s=n>=0&&n<a.length&&a[n].text.trim()?a[n]:!o&&a.length===1&&a[0].text.trim()?a[0]:null,c=me(r,s?.text??null);if(!c)return;let l,u;if(n>=0&&n<a.length&&a[n].text.trim()){let e=a[n],t=e.text.match(/^\s*/)?.[0]??``;l=i.slice(0,e.start)+t+c+i.slice(e.end),u=e.start+t.length+c.length}else if(o){let e=i.replace(/\s+$/,``);l=(e?e.endsWith(`,`)?`${e} `:`${e}, `:``)+c,u=l.length}else l=c,u=l.length;W(l),Ce(!0),ie(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),pe()})}})},[S,g,o,_,p,m,f,ie,pe]);let ge=()=>{if(!_)return;let e=z.current.trim();if(!e||!v&&!Li(e))return;let t=e.startsWith(`=`);if(!t&&Li(e))return;let n=ao(M.current)?.getCalculation();if(!n)return;let r;try{let i=n.createFormula(t?e:`=`+e,N.current,{target:`display`});if(i.isValid())return;let a=i.autoCorrect();if(!a)return;let o=a.getExpression({target:`display`});r=t?`=`+o:o}catch{return}W(r),ie(r)},_e=K(e=>{if(e.reason===`cancel`?L.revertToBaseline():ge(),Te(),ae(e),e.key===`Tab`)return;let t=O.current;t&&typeof document<`u`&&(document.activeElement===t?we():t.focus())},[ae,ie]),ve=(0,X.useRef)(null);ve.current||={insertText:e=>{let t=O.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n)+e+t.value.slice(r);W(i),ie(i),requestAnimationFrame(()=>t.setSelectionRange(n+e.length,n+e.length))},selectAll:()=>{O.current?.select()},setSelection:e=>{O.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{O.current?.focus()},toggleReferences:()=>{(async()=>{let e=O.current,t=M.current;if(!e||!t||oo(z.current))return;let n=e.value,r=e.selectionStart??n.length;try{let i=ao(t)?.getCalculation();if(!i)return;if(_){if(!Li(n))return;let t=await Ui(i,n,r,N.current);if(!t)return;W(t.value),ie(t.value),j.current&&pe(),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret));return}let a=so(n).find(e=>r>=e.start&&r<=e.end);if(!a)return;let o=(a.text.match(/^\s*/)?.[0]??``).length,s=a.text.trim();if(!s)return;let c=a.start+o,l=Math.min(Math.max(r-c,0),s.length),u=await Ui(i,`=`+s,l+1);if(!u)return;let d=n.slice(0,c)+u.value.slice(1)+n.slice(c+s.length),f=c+(u.caret-1);W(d),ie(d),j.current&&pe(),requestAnimationFrame(()=>e.setSelectionRange(f,f))}catch{}})()}};let ye=(0,X.useRef)(!1),be=()=>{ye.current||(ye.current=!0,console.warn(`[sheetxl] ${t} input has no workbook (pass the 'workbook' prop or wrap in a WorkbookProvider) — picking, select-current, and validation are disabled; the field degrades to plain text.`))},xe=()=>{let e=z.current,t=O.current?.selectionStart??e.length;if(!e.trim())return{kind:`insert`,at:t};if(!v&&!Li(e.trimStart()))return null;let n=M.current;if(n){let r=lo(n,e,N.current,v);if(r){let n=Ri(e);for(let e=0;e<r.ranges.length;e++){if(!r.ranges[e])continue;let i=Vi(r.tokens,e,n);if(i&&t>=i.start&&t<=i.end)return{kind:`replace`,start:i.start,end:i.end}}}}return Ii(e,t)?{kind:`insert`,at:t}:null},Se=()=>!(f===`literal`&&!z.current.trim())&&xe()!==null,Ce=e=>{if(D(e),!_||!j.current)return;let t=k.current;y.setMode(n=>n&&n.selection===t&&n.mode!==(e?`point`:`show`)?{...n,mode:e?`point`:`show`}:n)},we=K(()=>{if(l||j.current||oo(z.current))return;if(!g)return void be();let t=g.getSelectedWorksheet();if(!t)return;L.beginSession();let n=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});k.current=n,j.current=!0,x(!0),T(n);let r=!_||Se();D(r),y.setMode({mode:r?`point`:`show`,selection:n,activeInput:ve.current,allowMulti:_?e.allowMulti??!0:o,scope:s?void 0:G()??void 0,onDone:_e}),pe()},[l,g,o,e.allowMulti,s,_]),Te=K(()=>{if(!j.current)return;j.current=!1,x(!1),T(null);let e=k.current;k.current=null,y.setMode(t=>t&&t.selection===e?null:t)},[]),Ee=y.getMode();(0,X.useEffect)(()=>{j.current&&k.current&&Ee?.selection!==k.current&&(j.current=!1,x(!1),T(null),k.current=null)},[Ee]),(0,X.useEffect)(()=>()=>{Te()},[Te]),(0,X.useEffect)(()=>{let e=po(n,t,M.current,N.current,f),r=se(e),i=n==null||typeof n==`string`||n.isICellRanges?r.value??null:n;L.resetCommitted(e,i)&&(re(r.error??null),j.current&&pe())},[n]);let De=K(e=>{j.current||we(),W(e.target.value),_?Ce(Se()):a===`done`&&D(!1),ie(e.target.value),j.current&&pe()},[we,ie,pe,a]),Oe=K(e=>{if(L.resetBlurGuard(),!(e.key!==`F2`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Ce(!E);if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void ve.current?.toggleReferences();if(j.current&&E){let t=y.getMode(),n=g?.getSelectedWorksheet()?.getName();if(t&&n&&Za(e,t,n))return}if(e.key===`Escape`&&j.current&&!L.touchedRef.current)return e.preventDefault(),e.stopPropagation(),void Te();L.handleDoneKeys(e)||L.handleTextKeys(e)},[E,g]),ke=K(e=>{L.resetBlurGuard(),we()},[we]),Ae=K(e=>{let t=L.consumeBlurGuard(),n=e.relatedTarget;(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||_&&!E)&&(Te(),t||ge(),!t&&H.current&&ae({reason:`accept`}))},[Te,ae,_,E]),je=K(e=>{j.current&&a===`done`&&!_&&D(!1)},[a,_]),Me=K(e=>{j.current&&(_&&Ce(Se()),pe())},[pe,_]),Ne=K((e,t)=>{j.current||we(),W(e),ie(e),j.current&&pe(),t!==void 0&&requestAnimationFrame(()=>O.current?.setSelectionRange?.(t,t))},[we,ie,pe]),Pe=K(()=>{j.current?_e({reason:`accept`}):(O.current?.focus(),we())},[we,_e]),Fe=K(()=>{if(!g)return void be();let e=g.getSelectedWorksheet();if(!e)return;let t=e.getSelectedRanges(),n=t?.getCount()??0;if(!n)return;if(_){let e=xe();if(!e)return;let n=O.current,r=z.current,i=t.at(0),a=i.getCoords(),o=me({rowStart:a.rowStart,colStart:a.colStart,rowEnd:a.rowEnd,colEnd:a.colEnd,scope:i.getWorksheet().getName()},e.kind===`replace`?r.slice(e.start,e.end):null);if(!o)return;let s,c;if(e.kind===`replace`)s=r.slice(0,e.start)+o+r.slice(e.end),c=e.start+o.length;else if(r.trim()){let e=n?.selectionStart??r.length,t=n?.selectionEnd??r.length,i=(e>0&&!`/*^&<>=:,+-@( `.includes(r[e-1])?`,`:``)+o;s=r.slice(0,e)+i+r.slice(t),c=e+i.length}else s=(f===`bare`?``:`=`)+o,c=s.length;W(s),ie(s),j.current&&pe(),requestAnimationFrame(()=>n?.setSelectionRange?.(c,c));return}let r=[];for(let e=0;e<n;e++){let n=t.at(e),i=n.getCoords(),a=me({rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowEnd,colEnd:i.colEnd,scope:n.getWorksheet().getName()});a&&r.push(a)}if(!r.length)return;let i=o?r.join(`, `):r[0];W(i),ie(i),j.current&&pe()},[g,o,_,p,m,f,ie,pe]),Ie=K(()=>{L.revertToCommitted(),j.current&&pe()},[pe]),Le=(0,X.useMemo)(()=>_||ce||!R.trim()||!g?[]:so(R).map(e=>({text:e.text,start:e.start,end:e.end,valid:!!co(g,e.text,N.current)})),[_,ce,R,g,P]),Re=K(async e=>{let t=g,n=Le[e]?.text.trim();if(!t||!n)return null;try{let e=ao(t)?.getCalculation();return e?Ja(await e.createFormula(`=`+n,void 0,{target:`display`}).evaluate()):null}catch{return null}},[g,Le]),ze=K(()=>{try{return U.current?.getReferences()??null}catch{return null}},[]);return{inputProps:{value:le,readOnly:ce,onChange:De,onKeyDown:Oe,onFocus:ke,onBlur:Ae,onMouseDown:je,onSelect:Me,ref:e=>{O.current=e}},text:R,overLength:ce,segments:Le,tokens:fe,tokenBase:de,error:ee,dirty:te,engaged:b,pointArmed:E,togglePoint:Pe,engage:we,replaceText:Ne,selectCurrent:Fe,canSelectCurrent:!_||xe()!==null,revert:Ie,commit:L.commit,cancel:L.cancel,getRanges:ze,evaluateSegment:Re}},ho={function:`Function`,named:`NamedRange`,lambda:`FormulaCustom`,table:`Table`,parameter:`Named`,column:`Table`,specifier:`Table`,enum:`DataValidation`},go=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,_o=e=>{let{item:t,summary:n,wrapSummary:r=!1,rowHeight:i=22}=e;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:i,padding:`0 10px`},children:[(0,Z.jsx)(M,{iconKey:t.iconKey??ho[t.kind??`function`],size:16,style:{color:go,flex:`0 0 auto`}}),(0,Z.jsx)(`span`,{className:`sxl-named-item-name`,style:{fontWeight:600,color:`var(--sxl-color-primary, rgb(33,115,70))`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.name}),t.detail&&(0,Z.jsx)(`span`,{style:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.detail}),t.category&&(0,Z.jsx)(`span`,{style:{marginLeft:`auto`,flex:`0 0 auto`,color:go},children:t.category})]}),n&&(0,Z.jsx)(`div`,{title:r?void 0:n,style:{padding:`0 10px 4px 34px`,fontSize:11,lineHeight:`14px`,color:go,...r?{whiteSpace:`normal`}:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`}},children:n})]})};_o.displayName=`NamedItemLabel`;var vo=8,yo=e=>{let{items:t,selectedIndex:n,selectedSummary:r,onSelect:i,onHighlight:a,maxVisibleRows:o=vo}=e,s=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let e=s.current,t=e?.children[n];e&&t&&p.scrollIntoContainer(e,t)},[n]),t.length===0?null:(0,Z.jsx)(`div`,{ref:s,role:`listbox`,style:{maxHeight:22*o,overflowY:`auto`,position:`relative`,width:`20rem`,padding:`2px 0`,fontFamily:`var(--sxl-font-family)`,fontSize:12,lineHeight:1.5,color:`var(--sxl-color-base-content, rgb(37,36,35))`},children:t.map((e,t)=>{let o=t===n;return(0,Z.jsx)(`div`,{role:`option`,"aria-selected":o,onMouseDown:n=>{n.preventDefault(),i(e,t)},onMouseMove:()=>{o||a?.(t)},style:{cursor:`pointer`,background:o?`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`:`transparent`},children:(0,Z.jsx)(_o,{item:e,summary:o?r:null,rowHeight:22})},`${t}:${e.name}`)})})};yo.displayName=`NamedItemsPanel`;var bo=e=>{let t=/(\d+)$/.exec(e);return t?{base:e.slice(0,-t[1].length),n:parseInt(t[1],10)}:{base:e,n:1}},xo=(e,t)=>{if(t<0)return null;for(let n=0;n<e.length;n++){let r=e[n],i=r.getRepeatingTypes();if(i||r.isRest()){let e=i??[r];return e[(t-n)%e.length]}if(n===t)return r}return null},So=`0.6em`,Co=`calc(${So} + 1px)`,wo=()=>{let[e,t]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{let e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),(0,Z.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-block`,width:0,overflow:`visible`,verticalAlign:`baseline`},children:(0,Z.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`baseline`,width:So,margin:`0 0 -1px 1px`,opacity:e?.6:0,transition:`opacity 0.2s ease-out`},children:(0,Z.jsx)(`svg`,{viewBox:`0 0 10 3`,width:`100%`,style:{display:`block`,overflow:`visible`},children:(0,Z.jsx)(`path`,{d:`M1.5 0.5v2h8v-2`,fill:`none`,stroke:`#a3a3a3`,strokeWidth:1,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})})})})},To=new Set([`number`,`string`,`boolean`]),Eo=`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 45%, transparent)`,Do={backgroundColor:H,borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${Eo}`},Oo={borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${Eo}`},ko=[`#0431fa`,`#319331`,`#7b3814`],Ao=[`#ffd700`,`#da70d6`,`#179fff`],jo=e=>{let t=e%ko.length;return`light-dark(${ko[t]}, ${Ao[t]})`},Mo={display:`inline-block`,width:0,overflow:`visible`,whiteSpace:`pre`},No=e=>({display:`inline-block`,transform:`scale(1.15)`,transformOrigin:`center 78%`,opacity:.7,fontWeight:700,color:e}),Po=`var(--sxl-color-error, #d93025)`,Fo=`var(--sxl-color-warning, #b26a00)`,Io={textDecorationLine:`underline`,textDecorationStyle:`wavy`,textDecorationColor:Fo,textDecorationSkipInk:`none`},Lo={matchOf:new Map,depthOf:new Map,unmatched:new Set},Ro=e=>{if(!e)return Lo;let t=new Map,n=new Map,r=new Set,i=[];return e.forEach((e,a)=>{if(e.type===`paren`){if(e.text===`(`)n.set(a,i.length),i.push(a);else if(e.text===`)`){let e=i.pop();e===void 0?r.add(a):(t.set(a,e),t.set(e,a),n.set(a,n.get(e)))}}}),{matchOf:t,depthOf:n,unmatched:r}},zo=(e,t,n,r)=>{let i=r,a=-1,o=-1;for(let t=0;t<e.length;t++){let r=e[t],s=(r.text??``).length;r.type!==`paren`||r.text!==`(`&&r.text!==`)`||(n===i+s?a=t:n===i&&(o=t)),i+=s}let s=a>=0?a:o;if(s<0)return null;let c=t.get(s);return c===void 0?null:s<c?[s,c]:[c,s]},Bo=(e,t)=>e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1],Vo=(e,t,n)=>{let r=new Set;if(e){let t=1/0;for(let r=e.lo;r<=e.hi;r++){let e=n.depthOf.get(r);e!==void 0&&e<t&&(t=e)}if(t===1/0)return r;for(let i=e.lo;i<=e.hi;i++){if(n.depthOf.get(i)!==t)continue;let a=n.matchOf.get(i);if(!(a===void 0||a<e.lo||a>e.hi)){r.add(i),r.add(a);break}}return r}return t&&(r.add(t[0]),r.add(t[1])),r},Ho=`var(--sxl-color-base-content, rgb(37,36,35))`,Uo=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,Wo=`var(--sxl-color-primary, rgb(33,115,70))`,Go=`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,Ko=`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif)`,qo={color:Wo,fontWeight:700},Jo=[],Yo=(e,t)=>{let n=e.length?Math.min(t,e.length-1):-1,r=[];return e.forEach((e,i)=>{let a=e.getName(),o=e.getRepeatingTypes();if(o){let e=o.length,{base:s,n:c}=bo(a),l=Math.max(0,t-i),u=c+Math.floor(l/e),d=i===n?l%e:-1,f=(t,n)=>{let r=`${e===1?s:t.getName()}${n}`;return n>c||t.isOptional()?`[${r}]`:r};o.forEach((t,n)=>{r.push({key:`${i}s${n}`,param:t,descKey:e===1?a:`${a}.${t.getName()}`,isRepeat:!1,optional:u>c||t.isOptional(),active:n===d,label:f(t,u),ellipsisBefore:n===0&&u>c})}),r.push({key:`${i}next`,param:o[0],descKey:e===1?a:`${a}.${o[0].getName()}`,isRepeat:!0,optional:!0,active:!1,label:`[${e===1?s:o[0].getName()}${u+1}]`,ellipsisAfter:!0})}else if(e.isRest()){let{base:o,n:s}=bo(a),c=s+Math.max(0,t-i),l=i===n,u=c>s;r.push({key:`${i}a`,param:e,descKey:a,isRepeat:!1,optional:u,active:l,label:u?`[${o}${c}]`:`${o}${c}`,ellipsisBefore:c>s}),r.push({key:`${i}b`,param:e,descKey:a,isRepeat:!0,optional:!0,active:!1,label:`[${o}${c+1}]`,ellipsisAfter:!0})}else{let t=e.isOptional();r.push({key:`${i}`,label:t?`[${a}]`:a,param:e,descKey:a,isRepeat:!1,optional:t,active:i===n})}}),r},Xo=e=>(0,Z.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,onMouseDown:e=>e.preventDefault(),onClick:e.onClick,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,border:`none`,borderRadius:4,background:`transparent`,color:Uo,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:e.children}),Zo=({up:e})=>(0,Z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,Z.jsx)(`path`,{d:e?`M2.5 7.5 L6 4 L9.5 7.5`:`M2.5 4.5 L6 8 L9.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Qo=()=>(0,Z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,Z.jsx)(`path`,{d:`M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})}),$o={number:C(`functionPreview.typeName.number`),string:C(`functionPreview.typeName.string`),boolean:C(`functionPreview.typeName.boolean`),error:C(`functionPreview.typeName.error`),richData:C(`functionPreview.typeName.richData`),null:C(`functionPreview.typeName.null`)},es=e=>{let t=e.getScalarType();return t&&t!==`*`?$o[t]:C(`functionPreview.anyValue`)},ts=e=>{let{param:t,repeat:n=!1,optional:r=!1,showType:i=!0,size:a=15,style:o}=e,s=je(),c=es(t),l=c===`functionPreview.anyValue`?s(c):s(`functionPreview.type`,{type:s(c)}),u={color:Uo};return(0,Z.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:3,flex:`0 0 auto`,...o},children:[n&&(0,Z.jsx)(M,{iconKey:`Repeat`,title:s(`functionPreview.repeatable`),size:a,style:u}),r&&(0,Z.jsx)(M,{iconKey:`DataArray`,title:s(`functionPreview.optional`),size:a,style:u}),i&&(0,Z.jsx)(M,{iconKey:`DataObject`,title:l,size:a,style:u})]})};ts.displayName=`FunctionArgIcons`;var ns=({hint:e,wrap:t=!1})=>{let n=Yo(e.params,e.argIndex),r=e.argSeparator??`,`,i=[];for(let e of n)e.ellipsisBefore&&i.push({key:`${e.key}-lead`,text:`…`,active:!1}),i.push({key:e.key,text:e.label,active:e.active}),e.ellipsisAfter&&i.push({key:`${e.key}-trail`,text:`…`,active:!1});return(0,Z.jsxs)(`span`,{style:{whiteSpace:t?`normal`:`nowrap`,fontFamily:Go,cursor:`default`},children:[(0,Z.jsx)(`span`,{style:{fontWeight:600,color:Wo},children:e.nameLocal??e.name}),`(`,i.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`span`,{style:{color:Uo},children:`${r} `}):null,(0,Z.jsx)(`span`,{style:e.active?qo:{color:Uo},children:e.text})]},e.key)),`)`]})};ns.displayName=`FunctionSignature`;var rs=({hint:e,descriptor:t,showParameters:n=!0})=>{let r=je(),{name:i,argIndex:a,params:o,warning:s}=e,c=n?Yo(o,a):Jo,l=!!s&&s.argIndex===a,u=t?.name===i,d=u?t.summary:void 0;return d||c.length!==0?(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,padding:`8px 10px 10px`,fontFamily:Ko},children:[d&&(0,Z.jsx)(`div`,{style:{color:Ho},children:d}),c.length>0&&(0,Z.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:c.map(e=>{let n=(e=>u?t.params?.[e.descKey]?.description:void 0)(e);return(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:1,opacity:e.active?1:.6},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,Z.jsx)(`span`,{style:{fontFamily:Go,fontWeight:e.active?700:600,color:e.active?Wo:Ho,whiteSpace:`nowrap`},children:e.label}),(0,Z.jsx)(ts,{param:e.param,repeat:e.isRepeat,optional:e.optional,style:{marginLeft:`auto`}})]}),n&&(0,Z.jsx)(`div`,{style:{color:Uo},children:n}),e.active&&l&&(0,Z.jsx)(`div`,{className:`sxl-function-preview-warning`,style:{color:Fo},children:r(`functionPreview.enumOutOfSet`,{value:s.value,values:s.values})})]},e.key)})})]}):null};rs.displayName=`FunctionPreviewContent`;var is=e=>{let{hint:t,collapsed:n,onToggle:r,onClose:i}=e,a=je(),o=a(n?`functionPreview.expand`:`functionPreview.collapse`);return(0,Z.jsxs)(`div`,{role:`button`,"aria-expanded":!n,onMouseDown:e=>e.preventDefault(),onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 6px 5px 10px`,cursor:`pointer`,borderBottom:n?`none`:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`},children:[(0,Z.jsx)(`div`,{style:{flex:1,minWidth:0,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:(0,Z.jsx)(ns,{hint:t})}),(0,Z.jsx)(Xo,{label:o,onClick:e=>{e.stopPropagation(),r()},children:(0,Z.jsx)(Zo,{up:!n})}),i&&(0,Z.jsx)(Xo,{label:a(`functionPreview.close`),onClick:e=>{e.stopPropagation(),i()},children:(0,Z.jsx)(Qo,{})})]})};is.displayName=`FunctionPreviewHeader`;var as=e=>{let{hint:t,descriptor:n,onClose:r}=e,[i,a]=P(`editor.functionPreview.collapsed`,!1);return(0,Z.jsxs)(`div`,{style:{minWidth:300,maxWidth:460,fontFamily:Ko,fontSize:12,lineHeight:`16px`,color:Ho},children:[(0,Z.jsx)(is,{hint:t,collapsed:i,onToggle:()=>a(e=>!e),onClose:r}),(0,Z.jsx)(`div`,{style:{display:`grid`,gridTemplateRows:i?`0fr`:`1fr`,transition:`grid-template-rows 160ms ease`},children:(0,Z.jsx)(`div`,{style:{overflow:`hidden`,minHeight:0},children:(0,Z.jsx)(rs,{hint:t,descriptor:n})})})]})};as.displayName=`FunctionPreviewPanel`;var os=e=>{let{list:t,preview:n}=e;return t&&t.items.length>0?(0,Z.jsx)(yo,{items:t.items,selectedIndex:t.selectedIndex,selectedSummary:t.selectedSummary,onSelect:t.onSelect,onHighlight:t.onHighlight}):n?(0,Z.jsx)(as,{hint:n.hint,descriptor:n.descriptor}):null};os.displayName=`NamedHintPanel`;var ss=(e,t)=>({name:e,summary:t.getSummary(),params:t.getParameters(),enums:t.getEnums()}),cs=(e,t,n=1)=>{let r=n;for(let n=0;n<e.length;n++){let i=e[n],a=(i.text??``).length;if(a>0&&t>r&&t<=r+a)return{token:i,start:r,index:n};r+=a}return null},ls=e=>{switch(e.type){case`function`:case`named`:case`tableReference`:return!0;case`tableColumn`:case`tableSpecifier`:return!!e.value?.partial;case`parameter`:return!e.value?.declaration;default:return!1}},us=(e,t,n)=>{let r=((e,t,n)=>{let r=n;for(let n=0;n<e.length&&!(r>t);n++){let i=e[n],a=(i.text??``).length;if(a===0&&r===t&&ls(i))return{token:i,start:r,index:n};r+=a}return null})(e,t,n)??cs(e,t,n);if(!r||!ls(r.token))return null;let{token:i,start:a,index:o}=r,s=a+(i.text??``).length;if(i.type===`tableColumn`||i.type===`tableSpecifier`){let t=i.value,n=o-1;for(;n>=0&&(e[n].type!==`paren`||e[n].text!==`[`);)n--;return e[n]?.context?.argIndex===-1?{start:a,end:s,part:t}:{start:a,end:s,part:t,nested:!0}}let c=e[o+1],l=c?.type===`paren`?c.text:void 0;if(l===`(`||i.type===`tableReference`&&l===`[`)return null;let u=i.context?.bound;return u?{start:a,end:s,bound:u}:{start:a,end:s}},ds=(e,t,n)=>n?{name:e,argIndex:t,bound:n}:{name:e,argIndex:t},fs=(e,t,n=1)=>{let r=n;for(let n of e){let e=(n.text??``).length;if(e>0&&t>r&&t<=r+e)return n.type===`function`?ds(n.value,0,n.context?.bound):n.type===`paren`&&n.text===`)`||n.context?.type===`table`?null:n.type===`separator`&&n.context?.name?ds(n.context.name,n.context.argIndex+1,n.context.bound):n.context?.name?ds(n.context.name,Math.max(0,n.context.argIndex),n.context.bound):null;r+=e}return null},ps=(e,t)=>typeof e==`string`?`"${e.replace(/"/g,`""`)}"`:String(e).replace(`.`,t),ms=e=>e.type===`whitespace`||e.type===`empty`,hs=(e,t,n)=>{let r=[],i=[],a=n;for(let e of t)i.push(a),a+=(e.text??``).length;let o=a;for(let n=0;n<t.length;n++){let a=t[n],s=a.context;if(!s?.name||s.type===`table`)continue;let c;if(a.type===`paren`&&a.text===`(`&&s.argIndex===-1)c=0;else{if(a.type!==`separator`)continue;c=s.argIndex+1}let l=n+1;for(;l<t.length&&ms(t[l]);)l++;let u=t[l]?.type===`prefix`&&t[l].text===`-`,d=l;u&&l++;let f=t[l];if(!f||f.type!==`number`&&(f.type!==`string`||u)||f.context?.name!==s.name||f.context.argIndex!==c)continue;let p=l+1;for(;p<t.length&&ms(t[p]);)p++;let m=t[p];if(m&&m.type!==`separator`&&(m.type!==`paren`||m.text!==`)`))continue;let h;try{h=e.getFunctions().getByName(s.name)}catch{continue}if(!h||h.isLambda())continue;let g=xo(h.getDeclaration().getParameters(),c)?.getEnum();if(!g)continue;let _=g.getMembers(),v=_.map(e=>e.getValue()),y;if(f.type===`number`){if(g.getScalarType()!==`number`)continue;let e=(u?-1:1)*f.value;y=v.includes(e)}else{if(g.getScalarType()!==`string`)continue;let e=String(f.value).slice(1,-1).replace(/""/g,`"`).toLowerCase();y=v.some(t=>String(t).toLowerCase()===e)}if(y)continue;let b=u?[d,l]:[l];r.push({name:s.name,argIndex:c,tokens:b,text:b.map(e=>t[e].text??``).join(``),argStart:i[n]+(a.text??``).length,argEnd:m?i[p]:o,values:_.filter(e=>!e.isDeprecated()).map(e=>e.getValue())})}return r},gs=(e,t)=>{let n=e.getFunctions().getByName(t.name);if(n&&!n.isLambda())return{fn:n};let r=t.name.toUpperCase(),i=t.bound?.find(e=>e.name.toUpperCase()===r);return i?i.params?{bound:i}:null:n?{fn:n}:null},_s=e=>{let t=e?.enumOf;return t&&`${t.fn}:${t.id}`},vs=(e,t,n)=>{let r=t.getEnum();if(!r)return[];let i=e.getName(),a=r.getId(),o=Tn(n??`en`).decimal;return r.getMembers().filter(e=>!e.isDeprecated()).map(e=>{let t=e.getName(),n=e.getValue(),r=ps(n,o),s={fn:i,id:a,member:t};return t===String(n)?{name:r,kind:`enum`,enumOf:s}:{name:t,detail:r,insert:r,kind:`enum`,enumOf:s}})},ys=e=>({getName:()=>e.name,isOptional:()=>!0===e.optional,isRest:()=>!1,getRepeatingTypes:()=>null,getScalarType:()=>null,getRangeType:()=>null,getLambda:()=>null,getArrayDepth:()=>0,isAcceptError:()=>!1,isNoLift:()=>!1,isNoFilter:()=>!1,isLazy:()=>!1,isValueOrRange:()=>!1,getDefaultValue:()=>{},getEnum:()=>null}),bs=[[`All`,`all`],[`Data`,`data`],[`Headers`,`headers`],[`Totals`,`totals`]],xs=(e,t,n)=>{try{let{colStart:r,colEnd:i,...a}=t.getCoords(),o={colStart:r,colEnd:i,rowStart:n?.rowStart??a.rowStart,rowEnd:n?.rowEnd??a.rowEnd};return e?$a(e,o,t.getWorksheet().getName()):t.getWorksheet().getRange(o).toString()}catch{return}},Ss=e=>{let t=(0,X.useRef)(e);t.current=e;let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)([]),[c,l]=(0,X.useState)(0),u=(0,X.useRef)(null),[d,f]=(0,X.useState)(null),p=(0,X.useRef)(o);p.current=o;let m=(0,X.useRef)(null),h=(e,t,n)=>{if(m.current!==null){if(m.current===e.text)return null;m.current=null}return us(t,n,Ri(e.text))},g=K(()=>{let e=t.current,n=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!i||!n)return void r(null);let a=e.getCaret(),o=Ri(e.text);if(h(e,i,a))return void r(null);let s=fs(i,a,o),c=s?gs(n,s):null;if(!c||!s)return void r(null);let l=Tn(e.getLocale()??`en`).listSeparator,u=s.argIndex;if(`bound`in c){let{name:e,params:t}=c.bound;r(n=>n?.bound&&n.name===e&&n.argIndex===u&&n.params.length===t.length&&n.params.every((e,n)=>e.getName()===t[n].name&&e.isOptional()===(!0===t[n].optional))?n:{name:e,nameLocal:e,argSeparator:l,argIndex:u,params:t.map(ys),bound:!0});return}let d=c.fn,f=d.getName(),p=jn()?.functions?.[f]??f,m=hs(n,i,o).find(e=>e.name===s.name&&e.argIndex===u&&a>=e.argStart&&a<=e.argEnd),g=Tn(e.getLocale()??`en`).decimal,_=m?{argIndex:u,value:m.text,values:m.values.map(e=>ps(e,g)).join(`${l} `)}:void 0;r(e=>e&&!e.bound&&e.name===f&&e.argIndex===u&&e.warning?.value===_?.value?e:{name:f,nameLocal:p,argSeparator:l,argIndex:u,params:d.getDeclaration().getParameters(),..._?{warning:_}:null})},[]),_=K(()=>{let e=t.current,n=()=>{u.current=null,p.current.length&&s([])},r=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!r)return void n();let a=e.getArgument?.()??null,o=Ri(e.text);if(a&&e.text.slice(o).trim()===``){let t=vs(a.fn,a.param,e.getLocale());t.length===0?n():(u.current={start:o,end:e.text.length},_s(p.current[0])!==_s(t[0])&&(s(t),l(-1)));return}if(!i)return void n();let c=e.getCaret(),d=h(e,i,c),f=d??{start:c,end:c},m;if(d){let t=e.text.slice(f.start,c);m=d.part?((e,t,n,r={})=>{let i=e.toUpperCase(),a=[],o=jn()?.specifiers,s=(e,t)=>{let n=`#`+(o?.[t]?.trim()||e);return{name:n,matches:n.toUpperCase().startsWith(i)||(`#`+e).toUpperCase().startsWith(i)}};try{let e=n.table.toUpperCase(),o=(e?t?.getItems().find(t=>t.getType()===`table`&&t.getName().toUpperCase()===e):null)?.getValue();if(!o)return a;let c=r.home??null,l=o.getRange().getCoords(),u=o.getDataRange().getCoords(),d=c?.getCoords()??null,f=!!d&&o.getWorksheet()?.getName()===c.getWorksheet().getName()&&d.rowIndex>=l.rowStart&&d.rowIndex<=l.rowEnd&&d.colIndex>=l.colStart&&d.colIndex<=l.colEnd,p=(e,t)=>e?xs(c,e,t):void 0,m=d&&d.rowIndex>=u.rowStart&&d.rowIndex<=u.rowEnd?{rowStart:d.rowIndex,rowEnd:d.rowIndex}:void 0;if(n.partial!==`column`){let e=s(`This Row`,`thisRow`);if(e.matches){let t=m?p(o.getDataRange(),m):void 0;a.push(r.nested?{name:e.name,kind:`specifier`,detail:t}:{name:`@ - `+e.name.slice(1),insert:`@`,kind:`specifier`,detail:t})}}if(n.partial!==`specifier`)for(let e of o.getColumns()){let t=e.getName();t.toUpperCase().startsWith(i)&&a.push({name:t,kind:`column`,detail:p(e.getRange(),u)})}if(n.partial===`column`||f)return a;let h={all:o.getRange(),data:o.getDataRange(),headers:o.isShowHeaders()?o.getHeaderRowRange():null,totals:o.isShowTotals()?o.getTotalRowRange():null};for(let[e,t]of bs){let{name:n,matches:r}=s(e,t);r&&a.push({name:n,kind:`specifier`,detail:p(h[t])})}}catch{}return a})(t,e.getNames?.()??null,d.part,{home:e.getCell?.()??null,nested:d.nested}):((e,t,n,r=[])=>{let i=t.toUpperCase(),a=[],o=[];try{let t=jn()?.functions,n=e=>t?.[e]??e,r=e.getFunctions().getItems();o=r.filter(e=>e.isLambda()),a=r.filter(e=>!e.isLambda()).map(e=>({name:n(e.getName()),canonical:e.getName()})).filter(e=>e.name.toUpperCase().startsWith(i)||e.canonical.toUpperCase().startsWith(i)).map(e=>({name:e.name,kind:`function`})).sort((e,t)=>e.name.localeCompare(t.name)).slice(0,50)}catch{a=[]}let s=new Set(a.map(e=>e.name.toUpperCase())),c=(e,t)=>{let n=e.toUpperCase();n.startsWith(i)&&!s.has(n)&&(s.add(n),a.push({name:e,kind:t}))};for(let e of r)c(e.name,e.params?`lambda`:`parameter`);for(let e of o)c(e.getName(),`lambda`);try{for(let e of n?.getItems()??[])c(e.getName(),e.getType()===`table`?`table`:`named`)}catch{}return a.sort((e,t)=>e.name.localeCompare(t.name))})(r,t,e.getNames?.()??null,d.bound)}else m=((e,t,n,r,i)=>{let a=fs(t,n,r);if(!a||!((e,t,n,r)=>{let i=n;for(let n=0;n<e.length&&i<=t;n++){let a=e[n];if(a.type===`empty`&&a.context?.name===r.name&&a.context.argIndex===r.argIndex){let r=i,a=n+1;for(;a<e.length&&e[a].type===`whitespace`;)r+=(e[a++].text??``).length;if(t>=i&&t<=r){let t=e[a];return!t||t.type===`separator`||t.type===`paren`&&t.text===`)`}}i+=(a.text??``).length}return!1})(t,n,r,a))return[];let o=gs(e,a);if(!o||!(`fn`in o))return[];let s=xo(o.fn.getDeclaration().getParameters(),a.argIndex);return s?vs(o.fn,s,i):[]})(r,i,c,Ri(e.text),e.getLocale());if(m.length===0)return void n();u.current=f;let g=p.current;(g.length!==m.length||g.some((e,t)=>e.name!==m[t].name||_s(e)!==_s(m[t])))&&(s(m),l(0))},[]),v=K(()=>{g(),_()},[]),y=K(e=>{let n=t.current,r=u.current;if(!r)return;let i=n.text,a=e.kind??`function`,o=a===`function`||a===`lambda`,c=i[r.end]===`(`,l=(e.insert??e.name)+(o&&!c?`(`:``);a===`column`&&(l=e.name.replace(/['#[\]]/g,`'$&`));let d=i.slice(0,r.start)+l+i.slice(r.end),f=r.start+(o?e.name.length+1:l.length);s([]),m.current=l===`@`?null:d,n.applyText(d,f)},[]),b=K(e=>{let t=p.current.length;if(t===0)return!1;switch(e.which){case Pe.Down:return e.preventDefault(),e.stopPropagation(),l(e=>(e+1)%t),!0;case Pe.Up:return e.preventDefault(),e.stopPropagation(),l(e=>e<=0?t-1:e-1),!0;case Pe.Enter:case Pe.Tab:return!(x.current<0)&&(e.preventDefault(),e.stopPropagation(),y(p.current[Math.min(x.current,t-1)]),!0);case Pe.Escape:return e.preventDefault(),e.stopPropagation(),u.current=null,s([]),!0;default:return!1}},[]),x=(0,X.useRef)(c);x.current=c;let S=K(()=>{u.current=null,m.current=null,p.current.length&&s([]),r(null)},[]),C=(0,X.useCallback)(()=>{let e=t.current,n=e.getCaret(),r=e.getTokens();if(!r)return n;let i=Ri(e.text);if(p.current.length>0&&p.current[0].kind!==`enum`){let e=cs(r,n,i);return e?e.start:n}let a=((e,t,n)=>{let r=n,i=[],a=null;for(let n of e){if(r>=t)break;let e=r;n.type===`function`?a=e:n.type===`paren`&&n.text===`(`?(i.push(a??-1),a=null):(n.type===`paren`&&n.text===`)`&&i.pop(),a=null),r=e+(n.text??``).length}for(let e=i.length-1;e>=0;e--)if(i[e]>=0)return i[e];return null})(r,n,i);if(a!==null)return a;let o=cs(r,n,i);return o?o.start:n},[]),w=(n&&!n.bound?n.name:null)??o[0]?.enumOf?.fn??null;(0,X.useEffect)(()=>{if(!w)return void a(null);let e=!1,n=t.current,r=n.getArgument?.()?.fn;return(r?.getName()===w?r:n.getCalculation()?.getFunctions().getByName(w))?.getDescriptor().then(t=>{e||a(ss(w,t))}).catch(()=>{e||a(null)}),()=>{e=!0}},[w]);let T=o[c]??null,E=T?.name??null,D=T?.kind??`function`;(0,X.useEffect)(()=>{if(!E||D===`column`||D===`specifier`||D===`enum`)return void f(null);if(D!==`function`){let e=t.current.getNames?.()?.getItems()??[];f((e=>{if(!e)return null;let t=e.getComment?.();if(t)return t;try{let t=e.getRanges?.()?.toString();if(t)return t}catch{}let n=e.getValue?.();return typeof n==`string`?n:null})(e.find(e=>e.getName()===E)??null));return}let e=!1;return(t.current.getCalculation()?.getFunctions().getByName(E))?.getDescriptor().then(t=>{e||f(t.getSummary())}).catch(()=>{e||f(null)}),()=>{e=!0}},[E,D]);let{hoveredTokenIndex:O,text:k}=e,A=(0,X.useCallback)(()=>{let e=e=>{let t=e.enumOf;if(t&&i?.name===t.fn)return i.enums?.[t.id]?.members[t.member]},r=o.map(t=>{let n=t.insert===void 0?void 0:e(t);return n?{...t,name:n.nameLocal}:t}),a=o[c],s=a?.kind===`enum`?e(a)?.description:d,u=o.length>0?{items:r,selectedIndex:c,selectedSummary:s??void 0,onSelect:y,onHighlight:l}:null,f=t.current.getTokens(),p=O!=null&&f&&n?((e,t,n,r)=>{if(t<0||t>=e.length)return null;let i=n;for(let n=0;n<=t;n++)i+=(e[n].text??``).length;let a=fs(e,i,n);return a&&a.name===r?a.argIndex:null})(f,O,Ri(k),n.name):null,m=n?{hint:p===null?n:{...n,argIndex:p},descriptor:i}:null;return u||m?(0,Z.jsx)(os,{list:u,preview:m}):null},[o,c,d,n,i,y,O,k]);return{active:!!n||o.length>0,update:v,handleKeyDown:b,dismiss:S,getAnchorOffset:C,renderPanel:A}},Cs={placement:`bottom-start`,followAnchor:!0},ws={placement:`top-start`,followAnchor:!0},Ts=e=>{let t=e.getFormulaText({target:`display`});if(t)return t;let n=e.getText({useFormattingCategory:!0})??``;return e.getStyle().getQuotePrefix()?`'`+n:n},Es=e=>{let{selection:t,fillNone:n}=e,r=e=>{let{open:r,mode:i,clean:a,dirty:o,token:s,autoFocus:c,initialSelection:l,zoom:u,cellSize:d,readOnly:f,onDirtyChange:p,onModeChange:m,onCommit:h,onCancel:_,onNaturalSize:v,editable:y,placeholder:b,maxContentWidth:x,lineHeight:S,inputMode:C,enterKeyHint:T,hintPlacement:E}=e,D=a?a():null,O=o??(D?r?Ts(D):(e=>{if(e.getSpillKind()!==`fixed`)return Ts(e);let t=e.getFormulaText({target:`display`})??e.getSpill()?.getCell().getFormulaText({target:`display`});return t?`{${t}}`:Ts(e)})(D):``),k=Li(O),A=Ri(O),j=(0,X.useRef)(null),M=(0,X.useRef)(null),N=Tt(j,O),P=(0,X.useRef)(D);P.current=D;let[F,I]=(0,X.useState)(!1),[L,R]=(0,X.useState)(0),[ee,te]=(0,X.useState)(void 0),[z,B]=(0,X.useState)(null),[V,H]=(0,X.useState)(0),ne=(0,X.useRef)(null),U=(0,X.useRef)(null),W=(0,X.useRef)(!1),re=(0,X.useRef)(null),ie=wa(),ae=ie.getMode(),G=ae?.dragging??!1,oe=ae?.draggingIndex??null,[se,ce]=(0,X.useState)(null),[le,de]=(0,X.useState)(null),fe=(0,X.useRef)(null),pe=(0,X.useRef)(se);pe.current=se;let me=D?.getType(),he=(me===An.Number||me===An.Null)&&D.getStyle().getNumberFormat().includes(`%`),ge=e=>{if(!he)return null;let t=e.replace(/%/g,``);return t.length===0||isNaN(Number(t))?null:{value:t+`%`,caret:t.length}},_e=(0,X.useRef)(0);(0,X.useLayoutEffect)(()=>{if(!r||!c)return;let e=j.current;if(!e||(e.focus(),_e.current===s))return;_e.current=s;let t=ge(O);if(t&&t.value!==O)return N(t.caret),void p(t.value);let n=e.value.length,i=ie.getMode()?.selection?.getCoords()?.rangeIndex??-1,a=i>=0&&q?Vi(q.tokens,i,A):null,o=a?{start:a.end,end:a.end,direction:`forward`}:l??{start:n,end:n,direction:`forward`};e.setSelectionRange(o.start,o.end,o.direction)},[s,r,c]);let ve=D?D.getStyle():null,ye=ve?ve.getFont():null,be=ye?ye.toCSS(`adaptive`,u):{},Se=ye?ye.toCSS(`adaptive`,1):{},Ce=!n&&ve&&ye&&typeof O==`string`&&O?ve.measureText(O).renderLetterSpacing??0:0;Ce&&(Se.letterSpacing=`${ye.getLetterSpacing()+Ce}px`,be.letterSpacing=(ye.getLetterSpacing()+Ce)*u+`px`),n&&(Se.fontSize=`inherit`,be.fontSize=`inherit`,Se.color=`inherit`,Se.fontStyle=`inherit`,Se.fontWeight=`inherit`,Se.textDecoration=`inherit`,be.color=`inherit`,be.fontStyle=`inherit`,be.fontWeight=`inherit`,be.textDecoration=`inherit`);let we=(D&&O[0]!==`=`?J.toCSSHorizontalTextAlign(D.getRenderHorizontalAlignment()):`left`)??`left`,Te=ve?.getAlignment(),Ee=Te?.getOverflow()===J.Overflow.Wrap,Oe=Te?(e=>{switch(e){case J.VerticalAlignment.Center:return`center`;case J.VerticalAlignment.Bottom:return`flex-end`;default:return`flex-start`}})(Te.getVertical()):`flex-start`,ke=!!d,Ae=(Ee||!ke)&&!k,je=k,Me=ke&&D&&d?D.getTextPlacement(d,k):null,Ne=D?D.getInsets():null,Ie=Me?.lineHeight??S,Le=F?Math.min(V,O.length):O.length,Re=k&&Ii(O,Le),ze=Re&&Le>=O.length;(0,X.useLayoutEffect)(()=>{let e=Ne?Ne.left+Ne.right:4,t,n;if(Ae){let e=j.current;if(!e)return;let r=e.style.height;e.style.height=`auto`,n=e.scrollHeight/u,e.style.height=r,t=0}else{let r=M.current;if(!r)return;n=r.offsetHeight,t=r.offsetWidth+e}R(n),v?.({width:t,height:n})},[O,Ae,u,v,Ne?.left,Ne?.right,je,x,ze]);let Be=lt({mode:i,value:O,onDirtyChange:p,onModeChange:m,onCommit:h,onCancel:_,onNavigate:e=>{t.navigate(e)},onTraverse:(e,n)=>{t.traverse(e,n)},setCaret:N}),Ve=(0,X.useRef)(p);Ve.current=p;let Ue=(0,X.useRef)(null);Ue.current||={insertText:e=>{let t=j.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length;Ve.current(t.value.slice(0,n)+e+t.value.slice(r));let i=n+e.length;requestAnimationFrame(()=>t.setSelectionRange(i,i))},selectAll:()=>{j.current?.select()},setSelection:e=>{j.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{j.current?.focus()},toggleReferences:()=>{let e=j.current,t=P.current;if(!e||!t)return;let n=e.value,r=e.selectionStart??n.length;Ui(t.getWorksheet().getCalculation(),n,r,tt(t)).then(t=>{t&&(Ve.current(t.value),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret)))})}};let We=Ss({text:O,getTokens:()=>mt.current?.tokens??null,active:F,getCaret:()=>j.current?.selectionStart??j.current?.value.length??0,getCalculation:()=>P.current?.getWorksheet().getCalculation()??null,getNames:()=>P.current?.getWorksheet().getNames()??null,getCell:()=>P.current??null,getLocale:()=>P.current?.getWorksheet().getWorkbook()?.getLocale()??null,applyText:(e,t)=>{Ve.current(e),requestAnimationFrame(()=>j.current?.setSelectionRange(t,t))},hoveredTokenIndex:se?.ti??null}),{caretAnchor:Ge}=Fe(j),Ke=(0,X.useMemo)(()=>Ge(We.getAnchorOffset,0),[Ge,We.getAnchorOffset]),qe=(0,X.useRef)(null),Je=(0,X.useCallback)(e=>!!qe.current?.contains(e),[]),Ye=De({label:`formula-editor-hint`,anchor:Ke,autoFocus:!1,disableClickAway:Je,propsPopper:E===`above`?ws:Cs,renderPopupPanel:We.renderPanel}),Xe=Ye.reference,Ze=We.active&&!ie.getMode()?.dragging;(0,X.useEffect)(()=>{Ze?Xe.open(0):Xe.close(0)},[Ze,Xe]);let Qe=ue(),$e=(0,X.useRef)(Qe);$e.current=Qe;let et=()=>{if(y)return y.getSession();let e=$e.current.getMode();return e?.key===`edit`?e.args.editable.getSession():null},tt=e=>({...e.getCoords(),scope:et()?.getCoords().scope??e.getWorksheet().getName()}),nt=ie.getMode(),rt=nt?.selection??null,it=!!nt&&nt.activeInput===Ue.current;(0,X.useEffect)(()=>{if(r)return et()?.registerEditor(Ue.current)},[r,s]),(0,X.useEffect)(()=>{F&&et()?.setActiveEditor(Ue.current)},[F,r,s]);let at=Te?.getVertical(),ot=Me?.bounds.y??Ne?.top??0,st=Me?Me.bounds.y+Me.bounds.height:null,ct=Me&&at===J.VerticalAlignment.Top?ot:Ne?.top??0,ut;ut=st!==null&&at===J.VerticalAlignment.Bottom?st:st!==null&&at===J.VerticalAlignment.Center?st+(ot-ct):d?d.height-(Ne?.bottom??0)+2:0;let dt=!L||L<=ut-ct,ft=ke?{position:`absolute`,left:(Ne?.left??0)*u,top:ct*u,right:(Ne?.right??0)*u,height:Math.max(0,ut-ct)*u,display:`flex`,flexDirection:`column`,justifyContent:dt?Oe:`flex-start`}:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,justifyContent:`flex-start`},pt=(0,X.useRef)(null),q=(0,X.useMemo)(()=>{let e=P.current;if(!e||!k)return null;try{let t=e.getWorksheet().getCalculation().createFormula(O,tt(e),{target:`display`}),n=t.getTokens();if(n.length===0)return{tokens:[],ranges:[],valid:!1};let r=[];try{let i=t.getReferences(),a=et()?.getCoords().scope??e.getWorksheet().getName();r=i?i.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[],r=io(e.getWorksheet(),n,r)}catch{}return{tokens:n,ranges:r,valid:t.isValid()}}catch{return{tokens:[],ranges:[],valid:!1}}},[O]),mt=(0,X.useRef)(q);mt.current=q;let ht=(0,X.useMemo)(()=>q&&q.tokens.map(e=>e.text??``).join(``)===O.slice(A)?q.tokens:null,[q,O,A]),gt=!!ht,_t=(0,X.useMemo)(()=>Ro(ht??null),[ht]),vt=(0,X.useMemo)(()=>{let e=P.current?.getWorksheet().getCalculation();return ht&&e?new Set(hs(e,ht,A).flatMap(e=>e.tokens)):new Set},[ht,A]),yt=(0,X.useMemo)(()=>Vo(se?{lo:se.lo,hi:se.hi}:null,z,_t),[z,se,_t]),bt=K(()=>{let e=j.current?.selectionStart??O.length;H(e);let t=ht;if(!t)return te(void 0),void B(null);let n=Ri(O),r=Bi(t,e,n);te(r>=0?zi(t[r]):void 0);let i=F?zo(t,_t.matchOf,e,n):null;B(e=>Bo(e,i)?e:i)},[ht,O,F,_t]);(0,X.useEffect)(()=>{bt()},[bt,ht,F]);let xt=K(()=>{fe.current=null,ce(null)},[]),St=K(()=>{pe.current?.fromSelection||xt()},[]),Ct=Ra(()=>xt(),()=>Dt()),wt=K(e=>{let t=pt.current;if(!gt||!q||!t)return void xt();if(Ct.blocksHover(e)||za(j.current))return void St();let n=e.clientX,r=e.clientY,i=t.querySelectorAll(`[data-ti]`),a=-1,o=null;for(let e=0;e<i.length;e++){let t=i[e].getBoundingClientRect();if(n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom){a=Number(i[e].getAttribute(`data-ti`)),o=t;break}}let s=q.tokens;if(a<0){let e=t.querySelector(`[data-eq]`),i=e?.getBoundingClientRect();if(!e||!i||n<i.left||n>i.right||r<i.top||r>i.bottom)return void xt();let a=Ha(s);if(!a)return void xt();let o=a.hi;if(fe.current===`root`)return;fe.current=`root`;let c=t.querySelector(`[data-ti="${o}"]`)?.getBoundingClientRect(),l=c&&Math.abs(c.top-i.top)<1?{left:i.left,right:c.right,top:i.top}:{left:i.left,right:i.right,top:i.top};ce({rect:l,evalIndex:0,ti:-1,lo:0,hi:o,overEq:!0});return}let c=s[a];if(!c||c.type===`whitespace`)return void xt();let l=Ba(s,a);if(!l){if(To.has(c.type)&&c.text){let e=`literal:${a}`;if(e===fe.current)return;if(fe.current=e,!o)return void xt();let t={left:o.left,right:o.right,top:o.top};ce({rect:t,evalIndex:-1,ti:a,lo:a,hi:a,literal:c.text})}else xt();return}let u=`${l.evalIndex}:${l.lo}:${l.hi}`;if(u===fe.current)return;fe.current=u;let d=t.querySelector(`[data-ti="${l.lo}"]`),f=t.querySelector(`[data-ti="${l.hi}"]`),p=d?.getBoundingClientRect(),m=f?.getBoundingClientRect(),h=p&&m&&Math.abs(m.top-p.top)<1?{left:p.left,right:m.right,top:p.top}:o?{left:o.left,right:o.right,top:o.top}:null;h?ce({rect:h,evalIndex:l.evalIndex,ti:a,lo:l.lo,hi:l.hi}):xt()},[gt,q]),Et=K(e=>{let t=P.current;if(!t)return!1;try{return t.getWorksheet().getCalculation().createFormula(`=`+e,tt(t),{target:`display`}).isValid()}catch{return!1}},[]),Dt=K(()=>{let e=()=>{pe.current?.fromSelection&&xt()},t=j.current,n=pt.current;if(!(t&&n&&gt&&q&&F))return void e();if(Ct.isDragging())return;let r=t.selectionStart??0,i=t.selectionEnd??0;if(r===i)return void e();let a=Va(q.tokens,A,O,r,i,Et);if(!a)return void e();let o=`sel:${a.lo}:${a.hi}:${a.fragment??a.evalIndex}`;if(o===fe.current)return;fe.current=o;let s=n.querySelector(`[data-ti="${a.lo}"]`)?.getBoundingClientRect(),c=n.querySelector(`[data-ti="${a.hi}"]`)?.getBoundingClientRect(),l=s&&c&&Math.abs(c.top-s.top)<1?{left:s.left,right:c.right,top:s.top}:s?{left:s.left,right:s.right,top:s.top}:null;l?ce({rect:l,ti:-1,lo:a.lo,hi:a.hi,fromSelection:!0,evalIndex:a.fragment===null?a.evalIndex:-1,literal:a.fragment??void 0}):xt()},[gt,q,A,O,F]);(0,X.useEffect)(()=>{F||xt()},[F,xt]);let Ot=se?.evalIndex??null,kt=se?.literal??null;(0,X.useEffect)(()=>{let e=P.current;if(!e||kt===null&&(Ot===null||!Li(O)))return void de(null);let t=!1;try{let n=e.getWorksheet().getCalculation(),r=kt===null?n.createFormula(O,tt(e),{target:`display`}):n.createFormula(`=`+kt,tt(e),{target:`display`});Promise.resolve(kt===null?r.evaluate({evalIndex:Ot}):r.evaluate()).then(e=>{t||de(Ja(e))}).catch(()=>{t||de(null)})}catch{de(null)}return()=>{t=!0}},[Ot,kt,O]),(0,X.useEffect)(()=>{xt()},[O,xt]),(0,X.useLayoutEffect)(()=>{let e=U.current;if(e)return U.current=null,ne.current=null,void j.current?.setSelectionRange(e.start,e.end);let t=ne.current;t!==null&&(ne.current=null,j.current?.setSelectionRange(t,t))},[O]);let At=K((e,t)=>{let n=P.current;if(n&&Li(O))try{let r=n.getWorksheet().getCalculation().createFormula(O,tt(n),{target:`display`}),i=Ri(O),a=Vi(r.getTokens(),e,i);if(!a)return;let o=Hi(r.getTokens(),e)?void 0:r.getReferences()?.getCoords()?.[e],s={colStart:t.colStart,rowStart:t.rowStart,colEnd:t.colEnd,rowEnd:t.rowEnd,$colStart:o?.$colStart,$rowStart:o?.$rowStart,$colEnd:o?.$colEnd,$rowEnd:o?.$rowEnd},c=eo(n,t)??ro(n,t,s)??$a(n,s,t.scope),l=O.slice(0,a.start)+c+O.slice(a.end);if(l!==O){let e=l.length-O.length,t=F?j.current?.selectionStart??O.length:null;ne.current=t===null||t>=a.start&&t<=a.end?a.end+e:t<=a.start?t:t+e}Ve.current(l)}catch{}},[O]),jt=K(e=>{let t=P.current;if(t&&Li(O))try{let n=eo(t,e)??ro(t,e)??$a(t,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},e.scope),r;if(F)r={start:j.current?.selectionStart??O.length,end:j.current?.selectionEnd??O.length};else{let e=re.current;r=e!==null&&e<=O.length?{start:e,end:e}:{start:O.length,end:O.length}}if(q&&r.start===r.end){let e=Ri(O),t=e;for(let n of q.tokens){let i=(n.text??``).length;if(n.referenceIndex!==void 0&&r.start>=t&&r.start<=t+i){let t=Vi(q.tokens,n.referenceIndex,e);t&&(r={start:t.end,end:t.end});break}t+=i}}let i=(r.start>0&&!`/*^&<>=:,+-@( `.includes(O[r.start-1])?`,`:``)+n,a=O.slice(0,r.start)+i+O.slice(r.end);ne.current=r.start+i.length,F||(re.current=r.start+i.length),Ve.current(a)}catch{}},[O,F,q]),Mt=(0,X.useRef)(0);Mt.current=q?.ranges.length??0;let Nt=K(()=>{let e=ie.getMode();if(!e||e.activeInput!==Ue.current||!F)return;let t=e.selection,n=P.current,r=q?.ranges??null,i=j.current?.selectionStart??O.length,a=-1;if(r&&q){let e=Ri(O);for(let t of q.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){a=t.referenceIndex;break}e+=n}a>=r.length&&(a=-1),a>=0&&!r[a]&&(a=-1)}let o=a>=0,s=k&&Ii(O,i)&&!o&&!!q,c=s||o&&!!q;re.current=s?i:null;let l=r??[],u=n?{rowIndex:n.getCoords().rowIndex,colIndex:n.getCoords().colIndex,scope:n.getWorksheet().getName()}:w.EmptyCell,d;if(s)d={cell:u,ranges:l,rangeIndex:-1};else if(l.some(Boolean)){let e=(a>=0?l[a]:null)??l.find(Boolean);d={cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:e.scope},ranges:l,rangeIndex:a}}else d={cell:u,ranges:w.EmptyRanges,rangeIndex:-1};W.current=!0;try{t.updateCoords(d)}finally{W.current=!1}let f=c?`point`:`show`;e.mode!==f&&ie.setMode(e=>e&&e.mode!==f?{...e,mode:f}:e)},[q,O,i,F]),Pt=Qe.getMode()?.key??null;(0,X.useEffect)(()=>{Nt(),We.update()},[Nt,We.update,q,F,O,r,Pt,i,it,rt]),(0,X.useEffect)(()=>{F&&nt&&nt.activeInput!==Ue.current&&ie.setMode(e=>e&&{...e,activeInput:Ue.current})},[F,nt]),(0,X.useEffect)(()=>{r&&nt&&!nt.activeInput&&ie.setMode(e=>e&&!e.activeInput?{...e,activeInput:Ue.current}:e)},[r,nt]),(0,X.useEffect)(()=>{r||(re.current=null)},[r]),(0,X.useEffect)(()=>()=>{ie.setMode(e=>e&&e.activeInput===Ue.current?{...e,activeInput:null}:e)},[]),(0,X.useEffect)(()=>{if(it&&rt)return rt.addListeners({onChange:e=>{if(W.current||Xa())return;let t=e.getCoords(),n=t.rangeIndex??-1;n<0||!t.ranges||n>=t.ranges.length||(n<Mt.current?At(n,t.ranges[n]):jt(t.ranges[n]))}})},[it,rt,At,jt]);let Ft=be.color,It=ke?0:2,Lt={boxSizing:`border-box`,paddingTop:0,paddingBottom:0,paddingLeft:It,paddingRight:gt&&ze?`calc(${It}px + ${Co})`:It,margin:0,whiteSpace:Ae||je?`pre-wrap`:`pre`,wordBreak:je?`break-all`:Ae?`break-word`:`normal`,textAlign:we,...be,...Ie?{lineHeight:Ie*u+`px`}:null};return(0,Z.jsxs)(`div`,{ref:qe,style:{position:`relative`,flex:`1 1 100%`,minWidth:0},onMouseDown:e=>{let t=j.current;if(!t||e.target===t||!Je(e.target))return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.clientY<n.top?0:t.value.length;t.focus(),t.setSelectionRange(r,r),i!==`edit`&&m(`edit`)},onPointerDown:e=>{e.stopPropagation()},children:[(0,Z.jsx)(`div`,{style:ft,children:(0,Z.jsxs)(`div`,{style:{position:`relative`,flex:ke?`0 0 auto`:`1 1 100%`,width:`100%`,minWidth:0,...ve&&!n?ve.getFill()?.toCSS(`adaptive`):g.EmptyObject},children:[!!b&&!O&&(0,Z.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...Lt,color:Ft,opacity:.55},children:b}),gt&&(0,Z.jsxs)(`div`,{ref:pt,"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...Lt},children:[(()=>{let e=G&&oe!==null&&ht.some(e=>e.referenceIndex===oe),t=Re&&!ze?Le:-1,n=A,r=ht.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=A===1?(0,Z.jsx)(`span`,{"data-eq":!0,style:{color:Ft,opacity:e?.5:void 0},children:`=`},`eq`):null,a=ht.map((n,i)=>{let a=_t.unmatched.has(i),o=yt.has(i),s=_t.depthOf.get(i),c=a||s===void 0||n.referenceIndex!==void 0?void 0:jo(s),l=a?Po:c??zi(n),u=e&&n.referenceIndex!==oe,d;(l||o||a||u)&&(d={},l&&(d.color=l),a&&(d.fontWeight=`bold`),u&&(d.opacity=.5),o&&(d.color=`transparent`)),vt.has(i)&&(d={...d,...Io});let f=n.text??``,p=t>=r[i]&&t<r[i]+f.length;return(0,Z.jsxs)(`span`,{"data-ti":i,style:d,children:[o&&(0,Z.jsx)(`span`,{"aria-hidden":!0,style:Mo,children:(0,Z.jsx)(`span`,{style:No(l??Ft??`inherit`),children:n.text})}),p?(0,Z.jsxs)(Z.Fragment,{children:[f.slice(0,t-r[i]),(0,Z.jsx)(wo,{}),f.slice(t-r[i])]}):f]},i)});if(!se)return(0,Z.jsxs)(Z.Fragment,{children:[i,a]});let{lo:o,hi:s,overEq:c}=se,l=se.fromSelection?Oo:Do,u=[...c||!i?[]:[i],...a.slice(0,o)],d=[...c&&i?[i]:[],...a.slice(o,s+1)],f=a.slice(s+1);return(0,Z.jsxs)(Z.Fragment,{children:[u,(0,Z.jsx)(`span`,{className:`sxl-formula-eval-run`,style:l,children:d},`eval-run`),f]})})(),ze&&(0,Z.jsx)(wo,{})]}),(0,Z.jsx)(`textarea`,{ref:j,value:O,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,inputMode:C,enterKeyHint:T,name:`cell-editor`,readOnly:f,style:{position:`relative`,display:`block`,width:`100%`,height:ke?L?L*u:void 0:`100%`,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,userSelect:`text`,...Lt,color:Ft,...gt?{WebkitTextFillColor:`transparent`}:null,caretColor:ee??`auto`,...se&&!se.fromSelection?{[He]:`transparent`}:null},onChange:e=>{let t=ge(e.target.value);if(t)return requestAnimationFrame(()=>j.current?.setSelectionRange(t.caret,t.caret)),void p(t.value);p(e.target.value)},onSelect:()=>{Nt(),We.update(),bt(),Dt()},onScroll:e=>{let t=pt.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft,xt(),Dt())},onMouseMove:wt,onMouseLeave:St,onDragStart:Ct.onDragStart,onPointerDown:e=>{e.stopPropagation(),Ct.begin(e),Ze&&!Ye.isOpen&&Xe.open(0),i!==`edit`&&m(`edit`)},onKeyDown:e=>{if(!We.handleKeyDown(e))return e.which===Pe.Escape&&Ye.isOpen?(e.preventDefault(),e.stopPropagation(),void Xe.close(0)):void((e=>{if(e.which!==Pe.F9||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return!1;let t=j.current,n=P.current;if(!t||!n||f||!k||!q||q.tokens.length===0)return!1;let r=t.selectionStart??0,i=t.selectionEnd??0,a;if(r!==i)a=Va(q.tokens,A,O,r,i,Et);else{let e=Ha(q.tokens);a=e?{...e,...Ua(q.tokens,A,e.lo,e.hi),fragment:null}:null}if(!a)return!1;e.preventDefault(),e.stopPropagation();let o=O,s=n.getWorksheet().getCalculation(),c=tt(n),l=n.getWorksheet().getWorkbook()?.getLocale()??null,u=Wa(Tn(l??`en`).decimal),d=jn(),p={t:d?.booleans?.true??`TRUE`,f:d?.booleans?.false??`FALSE`};return(async()=>{let e=null,t=``;try{if(e=Ka(a.fragment===null?await s.createFormula(o,c,{target:`display`}).evaluate({evalIndex:a.evalIndex}):await s.createFormula(`=`+a.fragment,c,{target:`display`}).evaluate(),u,p),e===null||(t=o.slice(0,a.start)+e+o.slice(a.end),!s.createFormula(t,c,{target:`display`}).isValid()))return}catch{return}let n=j.current;n&&n.value===o&&(U.current={start:a.start,end:a.start+e.length},xe.replaceRangeText(n,a.start,a.end,e))})(),!0})(e)||(e=>{if(i===`edit`||!it||!nt)return!1;let t=P.current?.getWorksheet(),n=(t?.getWorkbook()?.getSelectedWorksheet()??t)?.getName();return!!n&&Za(e,nt,n)})(e)||Be(e))},onFocus:()=>{I(!0),et()?.setActiveEditor(Ue.current)},onBlur:e=>{let t=Xe.floatElement?.();t&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||I(!1)}})]})}),(0,Z.jsxs)(`div`,{ref:M,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,...Se,...Ie?{lineHeight:`${Ie}px`}:null,...je&&x!==void 0?{whiteSpace:`pre-wrap`,wordBreak:`break-all`,width:`max-content`,maxWidth:Math.max(1,x-(Ne?Ne.left+Ne.right:4))}:null},children:[(()=>{if(O.length===0)return` `;if(O.endsWith(`
6
+ `))return O+` `;if(!gt||ze)return O;let e=(O.codePointAt(O.length-2)??0)>65535?2:1;return(0,Z.jsxs)(Z.Fragment,{children:[O.slice(0,-e),(0,Z.jsx)(`span`,{style:{display:`inline-block`,minWidth:Co},children:O.slice(-e)})]})})(),gt&&ze&&(0,Z.jsx)(`span`,{style:{display:`inline-block`,width:`0.6em`,marginLeft:`1px`}})]}),!1,Ye.component,se&&le!==null&&(0,fr.createPortal)((0,Z.jsx)(`div`,{"aria-hidden":!0,style:{...La,left:(se.rect.left+se.rect.right)/2,top:se.rect.top-6},children:le}),document.body)]})};return r.displayName=`SheetCellInput`,r};function Ds(e,t,n={}){let{mode:r=`edit`,initialSelection:i}=n;e.startEdit(e.getAnchor().getCoords(),{dirty:t,mode:r,initialSelection:i})}function Os(e,t){let n=e.getSession()?.getActiveEditor();return!!n&&(n.insertText(t),!0)}function ks(e,t,n={}){Os(e,t)||Ds(e,t,n)}function As(e,t,n,r){let{autoRange:i,direction:a}=function(e){let t=e.getSelectedCell().getCoords(),n=null,r=0,i=t.rowIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex}).getExtended(Y.Direction.Up):null;i&&e.getRange({colStart:t.colIndex,rowStart:i.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowStart}).isContentful()&&(n=Y.Direction.Up,r=t.rowIndex-i.getCoords().rowEnd);let a=t.colIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex-1}).getExtended(Y.Direction.Left):null;if(a&&e.getRange({colStart:a.getCoords().colStart,rowStart:t.rowIndex,colEnd:a.getCoords().colStart,rowEnd:t.rowIndex}).isContentful()){let e=t.colIndex-a.getCoords().colEnd;(e<r||!n)&&(n=Y.Direction.Left,r=e)}let o=null;if(n===Y.Direction.Up&&i){if(o={...i.getCoords()},(o.rowEnd===t.rowIndex||!e.getRange({colIndex:t.colIndex,rowIndex:t.rowIndex-1}).isContentful())&&o.rowStart>0&&e.getRange({colIndex:t.colIndex,rowIndex:o.rowStart-1}).isContentful()){let e=i.getExtended(Y.Direction.Up);o={colStart:t.colIndex,rowStart:e.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowEnd}}o.rowEnd=t.rowIndex-1}else if(n===Y.Direction.Left&&a){if(o={...a.getCoords()},(o.colEnd===t.colIndex||!e.getRange({colIndex:t.colIndex-1,rowIndex:t.rowIndex}).isContentful())&&o.colStart>0&&e.getRange({colIndex:o.colStart-1,rowIndex:t.rowIndex}).isContentful()){let e=a.getExtended(Y.Direction.Left);o={colStart:e.getCoords().colStart,rowStart:t.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:t.rowIndex}}o.colEnd=t.colIndex-1}return{autoRange:o,direction:n}}(t),o=t.getSelectedRange();if(r===`caret`||o.size===1||!a||!i){let a=i?t.getRange(i).toString():``,o=`=${n}(`,s=`${o}${a})`;r===`caret`?Os(e,s):Ds(e,s,{mode:`edit`,initialSelection:{start:o.length,end:o.length+a.length}});return}let{rowStart:s,rowEnd:c,colStart:l,colEnd:u}=o.getCoords(),d=a===Y.Direction.Up;o.doBatch(async()=>{let e=o.createSparseBuilder({axis:Y.Axis.Column}),r={...i};for(let a=l;a<=u;a++){r.colStart=d?a:i.colStart+(a-l),r.colEnd=d?a:i.colEnd+(a-l);for(let o=s;o<=c;o++)r.rowStart=d?i.rowStart+(o-s):o,r.rowEnd=d?i.rowEnd+(o-s):o,e.pushAt(o,a,`=${n}(${t.getRange(r).toString()})`)}e.apply()})}var js=[[`insertFunctionSum`,`SUM`],[`insertFunctionAverage`,`AVERAGE`],[`insertFunctionCount`,`COUNT`],[`insertFunctionMax`,`MAX`],[`insertFunctionMin`,`MIN`]];function Ms(e,t){let{editable:n,sheet:r,flavor:i}=t,a=e=>{e!=null&&(i===`caret`?Os(n,e):Ds(n,e))};e.updateCommand(`insertCurrentTime`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Mn.nowWithPrecision(),style:{numberFormat:`Medium Time`}}).getText())}),e.updateCommand(`insertCurrentDate`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Mn.nowWithPrecision(),style:{numberFormat:`Short Date`}}).getText())}),e.updateCommand(`insertValueAbove`,{tags:[`noTransaction`],callback:()=>{let e=r.getSelectedCell().getCoords();if(!e||e.rowIndex<=0)return;let t=r.getRange({rowIndex:e.rowIndex-1,colIndex:e.colIndex}).getCell();if(!t)return;let n=t.getFormulaText({target:`display`});a(n??t.getText({useFormattingCategory:!0}))}});for(let[t,a]of js)e.updateCommand(t,{tags:[`noTransaction`],callback:()=>As(n,r,a,i)});return()=>{}}function Ns(e,t){let{editable:n}=t;return e.updateCommand(`relativeReferencesToggle`,{callback:()=>{(n.getSession()?.getActiveEditor())?.toggleReferences()}}),e.updateCommand(`toggleEditorFocus`,{callback:()=>{let e=n.getSession();if(!e)return;let t=e.getEditors();if(t.length<2)return;let r=e.getActiveEditor();t[((r?t.indexOf(r):-1)+1)%t.length]?.focus()}}),()=>{}}function Ps(e,t){let{editable:n,sheet:r,active:i=!0}=t;if(!i)return()=>{};let a=Ms(e,{editable:n,sheet:r,flavor:`caret`}),o=Ns(e,{editable:n});return()=>{a(),o()}}var Fs=async(e,t)=>{let n=[];for(let e of t)e.hasPassword()&&!e.isUnlocked()&&n.push(e);return n.length===0||!!e?.showInput&&(await e.showInput({title:j(`dialog.unlockRange.title`),description:n.length===1?j(`dialog.unlockRange.description`,{name:n[0].getName()}):j(`dialog.unlockRange.descriptionMany`),inputType:`password`,options:[{id:`Unlock`,label:()=>j(`dialog.unlock`)},`Cancel`],defaultOption:`Unlock`,cancelOption:`Cancel`,onValidateInput:async(e,t)=>{if(t!==`Unlock`)return{valid:!0};if(!e)return{valid:!1,message:j(`dialog.password.required`)};let r=!1;for(let t of n)await t.unlock(e)&&(r=!0);return r?{valid:!0}:{valid:!1,message:j(`dialog.password.incorrect`)}}}))?.option===`Unlock`},Is=e=>{let t=he(),n=je(),r=(0,X.useRef)(!1);return(0,X.useEffect)(()=>{r.current=!1},[e]),K((i,a)=>{if(e.getProtection().isLocked()){if(i){let n=e.getProtectedRanges().getItems({address:{rowIndex:i.rowIndex,colIndex:i.colIndex}}).filter(e=>e.hasPassword()&&!e.isUnlocked());if(n.length>0)return void Fs(t,n).then(e=>{e&&a?.()})}if(r.current)return;r.current=!0,t?.showMessage?.(n(`error.sheet.protectedSheet`),{type:Te.Error})}else i&&e.getRange({rowIndex:i.rowIndex,colIndex:i.colIndex}).getCell().getSpillKind()===`fixed`&&t?.showMessage?.(n(`error.sheet.changePartOfArray`),{type:Te.Error})},[e,t])},{CommandScopeProvider:Ls}=G,Rs=Object.freeze({x:0,y:0,width:0,height:0}),zs=({alignWidth:e,children:t})=>{let n=ot(),r=e/xe.getDevicePixelRatio();return(0,Z.jsx)(`div`,{style:n?{position:`absolute`,left:n.x-r,top:n.y-r,width:n.width,height:n.height,display:`flex`}:{position:`absolute`,inset:0,display:`flex`},children:t})};function Bs(e){let{sheet:t,editable:n,darkMode:r,alignment:i,alignWidth:a=2,zIndex:o,className:s,style:c,...l}=e,u=bt(),d=(0,X.useMemo)(()=>Es({selection:t.getSelection()}),[t]),f=ze(n,e=>e.getSession()),p=Ae(f,e=>e.getState()),m=!p||!p.coords.scope||p.coords.scope===t.getName(),h=(0,X.useMemo)(()=>({editable:n,sheet:t,active:!!p}),[n,t,p]),[g,_]=(0,X.useState)(null),v=K(e=>{_(t=>t&&t.width===e.width&&t.height===e.height?t:e)},[]),y=K(e=>n.commit(e),[n]),b=K(()=>{n.cancel()},[n]);(0,X.useEffect)(()=>{p&&u&&m&&u.scrollCellCoordsIntoView(p.coords)},[p?.token,m]);let x=p?p.coords:n.getAnchor().getCoords(),S=x?{rowIndex:x.rowIndex,colIndex:x.colIndex}:null,C=(()=>{if(!p||!m)return`left`;let e=p.clean();if((p.dirty??(e?Ts(e):``))[0]===`=`)return`left`;switch(e?.getRenderHorizontalAlignment()){case J.HorizontalAlignment.Right:return`right`;case J.HorizontalAlignment.Center:case J.HorizontalAlignment.CenterContinuous:return`center`;default:return`left`}})(),w=i??C,T=null,E=!1,D=!1;if(u&&S){let e=u.getRangeFromCell(S);if(D=u.toClipBounds(u.getBoundsFromRange({rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowStart,colEnd:e.colStart}))!==null,p){let e=$e(u,S,g,w,a);T=e?.bounds??null,E=e?.inView??!1}else T=u.getBoundsFromRange(e)}let O,k=null;if(u&&S){let e=u.getBoundsFromRange(u.getRangeFromCell(S)),t=u.getZoom()||1;if(e){k={width:e.width/t,height:e.height/t};let n=u.getSurfaceSize();n?.width&&(O=Math.max(e.width,n.width-e.x-a)/t)}}let A=!!p&&!!T&&E&&m,j=`inline:${t.getId()}:${u?.getAnchor()??``}`,M=K(()=>{n.getSession()?.setActiveEditorId(j)},[n,j]),N=f?.getActiveEditorId()??null,P=!N||N===j,F={open:!!p,mode:p?.mode??`enter`,coords:p?.coords??null,clean:p?.clean??null,dirty:p?.dirty,token:p?.token??0,autoFocus:(p?.autoFocus??!0)&&P&&A&&D,initialSelection:p?.initialSelection,zoom:u?.getZoom()??1,cellSize:k,onDirtyChange:e=>f?.setDirty(e),onModeChange:e=>f?.setMode(e),onCommit:y,onCancel:b,onNaturalSize:v},I=!x||x.scope&&x.scope!==t.getName()?`transparent`:Ma(t.getRange(x).getCell(),t,r,`var(--sxl-color-base-100)`);return(0,Z.jsx)(Ls,{spec:{scopeName:{key:`layer:editor`,name:`editor`},contributor:{dynamic:Ps},data:h},order:xt().zIndex,children:(0,Z.jsx)(q,{className:Q(s,`sxl-editor`),children:T||p?(0,Z.jsx)(ut,{...l,bounds:T??Rs,alignWidth:a,keepMounted:!0,onFocus:M,style:{borderColor:`var(--sxl-color-primary, rgb(33, 115, 70))`,...c,display:`flex`,overflow:`hidden`,background:I,boxShadow:A?`2px 2px 6px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.12))`:`none`,opacity:+!!A,pointerEvents:A?`auto`:`none`},children:(0,Z.jsx)(zs,{alignWidth:a,children:(0,Z.jsx)(d,{...F,editable:n,maxContentWidth:O})})}):null})})}Bs.displayName=`SheetCellEditorLayer`;var Vs=(e,t,n,r)=>{if(!e.startEdit(t,n))return!1;let i=r?.isActive()?r.getEditorId():null;return i&&e.getSession()?.setActiveEditorId(i),!0};function Hs(e){let{sheet:t,editable:n,onEditRejected:r}=e,i=bt(),a=ke(),o=Is(t),s=r??o,c=he(),l=K(e=>{if(n.getSession())return;let r=i?.getElement(),o=!!i&&e.target===i.getFocusTarget();if(r&&e.target!==r&&!o)return;let l=n.getAnchor().getCoords();if(!l)return;let u=e.nativeEvent;if(!(u.key.length!==1||u.ctrlKey||u.metaKey||u.altKey||u.key===` `&&u.shiftKey||u.isComposing)){let n=qr({sheet:t,notifier:c,notifyEditRejected:s});if(function(e,t,n){Vr();let r=t.getSelection(),i=r.getCell(),a=r.getRanges(),o=new Map,s=new Set,c=a.getCount();for(let e=0;e<c;e++)for(let t of a.at(e).getControls()){if(s.has(t))continue;s.add(t);let e=t.getType(),n=o.get(e);n?n.push(t):o.set(e,[t])}let l=!1;for(let[a,s]of o)Ur(a)?.onKey?.(e,{sheet:t,selection:r,anchor:i,controls:s},n)&&(l=!0);return Lr.size>0&&i.getType()===An.RichData&&Lr.get(i.getValue().getKind().getName())?.onKey?.(e,{sheet:t,selection:r,anchor:i,controls:[]},n)&&(l=!0),l}(u.key,t,n))return e.preventDefault(),void e.stopPropagation()}let d=nt(e.nativeEvent);if(!d)return;e.nativeEvent.key!==`Process`&&e.nativeEvent.keyCode!==229&&e.preventDefault(),e.stopPropagation();let f=o?a:void 0,p=()=>Vs(n,l,d,f);p()||s(l,()=>{p()})},[n,i,a,s,t,c]),u=K(e=>{let t=e.target;if(!(i&&t===i.getFocusTarget()&&t instanceof HTMLInputElement))return;let r=t.value;if(t.value=``,!r||n.getSession())return;let o=n.getAnchor().getCoords();if(!o)return;let c=()=>Vs(n,o,{mode:`enter`,dirty:r},a);c()||s(o,()=>{c()})},[n,i,a,s]);(0,X.useEffect)(()=>{let e=i?.getElement();if(e)return e.addEventListener(`input`,u),()=>e.removeEventListener(`input`,u)},[i,u]);let d=K(e=>{if(n.getSession())return;let r=i?.getCellFromPointer(e.clientX,e.clientY),a=r?{...r,scope:t.getName()}:n.getAnchor().getCoords();if(!a)return;let o=()=>n.startEdit(a,{mode:`edit`});o()||s(a,()=>{o()})},[i,n,t,s]);return(0,Z.jsx)(q,{className:`sxl-editor-start`,onKeyDown:l,onDoubleClick:d})}Hs.displayName=`SheetCellEditorStartLayer`;function Us(e){return ke().isEnabled()?(0,Z.jsx)(Ws,{...e}):null}function Ws(e){let{editable:t}=e,n=bt(),r=ke(),i=(0,X.useRef)(null),a=n!=null&&n===Jt(n.getAllPanes());(0,X.useEffect)(()=>{if(n)return n.registerFocusTarget(()=>{let e=i.current;return e&&r.isActive()?(e.inputMode=r.getInputMode(),e):null})},[n,r]),(0,X.useEffect)(()=>{let e=n?.getElement();if(!n||!e)return;let t=e=>!!e.target?.closest?.(`input, textarea, [contenteditable]:not([contenteditable="false"])`),i=e=>{!r.isActive()||r.getOptions().keepOnTap||t(e)||r.hide()},a=e.ownerDocument,o=n=>{r.isActive()&&r.getOptions().keepOnTap&&e.contains(n.target)&&!t(n)&&n.preventDefault()},s=t=>{t.target===e&&r.isActive()&&n.focus({preventScroll:!0})};return e.addEventListener(`pointerdown`,i,!0),a.addEventListener(`mousedown`,o),e.addEventListener(`focus`,s),()=>{e.removeEventListener(`pointerdown`,i,!0),a.removeEventListener(`mousedown`,o),e.removeEventListener(`focus`,s)}},[n,r]),(0,X.useEffect)(()=>{if(!n)return;let e=r.isActive();return r.subscribe(()=>{let t=r.isActive();if(t===e)return;e=t;let o=document.activeElement;var s;t?!a||(s=o)&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||!0===s.isContentEditable)||n.focus({preventScroll:!0}):o&&o===i.current&&n.focus({preventScroll:!0})})},[n,r,a]),(0,X.useEffect)(()=>{if(!a||r.getOptions().disabled)return;let e=Ee();return me(()=>{let n=Ee();n!==e&&(e=n,n?t.getSession()&&r.show():r.hide())})},[a,r,t]),(0,X.useEffect)(()=>{if(a)return fe(e=>{e.key===`edit`&&r.hide()})},[a,r]);let o=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!a||!n||r.getOptions().disableScrollIntoView)return;let e=n.getSurfaceSize().height,i=o.current;o.current=e,i===null||e>=i||!Ee()||n.scrollCellCoordsIntoView(t.getAnchor().getCoords())},[a,n,r,t]),(0,X.useEffect)(()=>{if(a&&n&&!r.getOptions().disableScrollIntoView)return Le(()=>{let e=L(),r=n.getElement();if(e===null||!r)return;let i=n.getBoundsFromRange(n.getRangeFromCell(t.getAnchor().getCoords())),a=r.getBoundingClientRect().top+i.y+i.height-e;if(a<=0)return;let{left:o,top:s}=n.getScrollTopLeft();n.scrollTo({left:o,top:s+a+8})})},[a,n,r,t]),(0,Z.jsx)(q,{className:`sxl-virtual-keyboard`,children:(0,Z.jsx)(`input`,{ref:i,className:`sxl-virtual-keyboard-input`,tabIndex:-1,inputMode:`none`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,enterKeyHint:`enter`,onFocus:e=>{e.currentTarget.value=``},style:{position:`absolute`,left:0,top:0,width:`1px`,height:`1px`,padding:0,border:`none`,opacity:0,caretColor:`transparent`,pointerEvents:`none`,fontSize:`16px`}})})}Us.displayName=`VirtualKeyboardLayer`,Ws.displayName=`VirtualKeyboardPaneLayer`;var Gs=class{constructor(e){this._listeners=new Set,this._removeSdkListener=null,this._sel=e}get selection(){return this._sel}getSelection(){return this._sel.getCoords()}setSelection(e){this._sel.updateCoords(e)}navigate(e,t=!1,n=!1,r){this._sel.navigate(e,t,n,r)}traverse(e=v.Row,t=!1,n){this._sel.traverse(e,t,n)}modify(e,t){this._sel.modify(e,t)}append(e,t=e){this._sel.append(e,t)}deselect(e){let t=this._sel.getCoords();if(!t.ranges||t.ranges.length===0)return;let n=[],r=-1,i=t.cell;for(let a of t.ranges){if(w.isRangesIntersect(a,e)){let i=g.subtractRect({top:a.rowStart,left:a.colStart,bottom:a.rowEnd+1,right:a.colEnd+1},{top:e.rowStart,left:e.colStart,bottom:e.rowEnd+1,right:e.colEnd+1});for(let e of i){let i={rowStart:e.top,colStart:e.left,rowEnd:e.bottom-1,colEnd:e.right-1};n.push(i),w.isCellWithinRange(t.cell,i)&&(r=n.length-1)}}else n.push(a);if(n.length>0&&r===-1&&w.isCellWithinRange(t.cell,a)){r=n.length-1;let e=n[n.length-1];i={rowIndex:e.rowStart,colIndex:e.colStart}}}this._sel.updateCoords({cell:i,rangeIndex:r,ranges:n})}getCoords(){return this._sel.getCoords().cell}subscribe(e){return this._listeners.add(e),this._listeners.size===1&&(this._removeSdkListener=this._sel.addListeners({onChange:()=>{this._listeners.forEach(e=>e())}})),()=>{this._listeners.delete(e),this._listeners.size===0&&(this._removeSdkListener?.(),this._removeSdkListener=null)}}};Object.freeze({[Wn.Presets.Copy.id]:C(`autoFill.preset.copy`),[Wn.Presets.Series.id]:C(`autoFill.preset.series`),[Wn.Presets.Linear.id]:C(`autoFill.preset.linear`),[Wn.Presets.Growth.id]:C(`autoFill.preset.growth`),[Wn.Presets.DateYears.id]:C(`autoFill.preset.dateYears`),[Wn.Presets.DateMonthEnd.id]:C(`autoFill.preset.dateMonthEnd`),[Wn.Presets.DateMonths.id]:C(`autoFill.preset.dateMonths`),[Wn.Presets.DateWeekdays.id]:C(`autoFill.preset.dateWeekdays`),[Wn.Presets.DateDays.id]:C(`autoFill.preset.dateDays`),[Wn.Presets.LinearTrend.id]:C(`autoFill.preset.linearTrend`),[Wn.Presets.GrowthTrend.id]:C(`autoFill.preset.growthTrend`)});function Ks(e){let{sheet:t,notifier:n,range:r,byDirection:i,direction:a,presetId:o,onClosed:s}=e,c={range:r,direction:a,offered:e=>i.get(e)?.offered??[],resolve:e=>{let n=i.get(e);return n?{template:t.getRange(n.template).getAddress(),destination:t.getRange(n.destination).getAddress(),templateSize:n.templateSize,size:n.size}:null},preview:e=>{let n=i.get(e.direction);if(!n)return null;try{return t.getRange(n.template).autoFill(n.destination,{...qs(e),preview:!0})}catch{return null}}},l={initialValue:{presetId:o,direction:a},context:()=>c,onInput:e=>{try{let r=e?i.get(e.direction):void 0;if(!e||!r)return;try{t.getRange(r.template).autoFill(r.destination,{...qs(e),autoSelect:!0})}catch(e){n?.showError?.(e)}}finally{s?.()}}};n?.showWindow?.(`fillSeries`,l)}function qs(e){let t=Wn.getPreset(e.presetId);if(!t)throw new k(j(`error.fillSeries.unknownType`));return Wn.toFillOptions(t,{trend:e.trend,stepValue:e.stepValue,stopValue:e.stopValue})}function Js(e){let{sheet:t,template:n,destination:r,notifier:i,onSettled:a}=e,o=t.getRange(n),s=o.getDefaultAutoFillCriteria(void 0,r);if(!s)return null;let c=t.getRange(r),l=!1,u=!1,d=()=>{u||(u=!0,a?.())};return{template:o,destination:c,direction:s.direction,offered:s.offered,fill:async e=>{l=!0;let n=await i?.showBusy?.(j(`op.autoFill`));try{let n=e.presetId===void 0?void 0:Wn.getPreset(e.presetId);if(e.presetId!==void 0&&!n)throw new k(j(`error.fillSeries.unknownType`));let i={...n?Wn.toFillOptions(n):void 0,type:e.type,snap:!0};await t.doBatch(()=>{o.autoFill(r,i),c.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:C(`op.autoFill`),autoSelect:!0})}catch(e){i?.showError?.(e)}finally{n?.(),d()}},series:()=>{l=!0,Ks({sheet:t,notifier:i,range:c,byDirection:new Map([[s.direction,s]]),direction:s.direction,presetId:s.presetId,onClosed:d}),i?.showWindow||d()},cancel:()=>{l||d()}}}function Ys(e,t){let{navigation:n,sheet:r}=t;if(!n)return()=>{};let i=[...n.getBindings().keys()].map(e=>({key:e,callback:()=>{n.invoke(e)}}));r&&(i.push({key:`traverseSelectionCorners`,callback:()=>{r.getSelection().traverseCorners()}}),i.push({key:`selectArray`,callback:()=>{(e=>{let t=e.getSelection(),n=e.getRange(t.getCoords().cell).getCell(),r=n.getSpillKind()===`error`?w.cellToRange(n.getCoords()):n.getSpill()?.getCoords();r&&t.updateCoords({cell:{rowIndex:r.rowStart,colIndex:r.colStart},ranges:[r],rangeIndex:0})})(r)}}));for(let t of i){let{key:n,...r}=t;e.updateCommand(n,r)}return()=>{}}var Xs={top:Y.Direction.Up,bottom:Y.Direction.Down,left:Y.Direction.Left,right:Y.Direction.Right},Zs=({sheet:e,isActive:t=!0,onFillMenu:n,className:r,...i})=>{let a=he(),o=je(),c=ue(),[l,u]=(0,X.useState)(null),d=!!G.useCommandScope(),f=(0,X.useMemo)(()=>({navigation:l,sheet:e}),[l,e]),[p]=G.useCommands([`pasteFormats`]),m=K(async()=>{c.getMode()?.key===`formatPainter`&&(await p?.execute(),c.setMode(null))},[c,p]),h=(0,X.useMemo)(()=>new Gs(e.getSelection()),[e]),g=`selection:${e.getId()}`,_=pt(g),v=K(t=>{let n=e.getSelection();n.setAdjusting(t===`extend`?n.getCoords():null)},[e]),y=K(()=>e.getUsedRange()?.getCoords()??w.EmptyRange,[e]),b=K(t=>{let n=e.getTables().getItems();for(let e=0;e<n.length;e++){let r=n[e];if(w.isCellWithinRange(t,r.getRange().getCoords()))return r.getDataRange().getCoords()}return null},[e]),x=K(t=>{e.scrollTo({colStart:t.colIndex,colEnd:t.colIndex,rowStart:t.rowIndex,rowEnd:t.rowIndex},{})},[e]);s(e,[`onProtectionChange`,`onSelectionChange`]),s(e.getSelection(),[`onAdjustingChange`]);let S=e.getSelection().getAdjusting()!==null,T=c.getMode(),E=T?.key===`edit`,D=T?.key===`copy`||T?.key===`cut`,O=T?.key===`fill`,k=e.getSelectedRanges().getCount(),A=e.getProtection().isLocked(),j=t&&k<=1&&!E&&(!A||e.getSelectedRange().getCell().isEditAllowed()),M=te()===`touch`,N=M&&t&&!E&&k<=1,P=j&&!M&&(!T||D||O),F=T&&ic.has(T.key)?T.cursor:void 0,I=X.useMemo(()=>{if(!M)return;let e=Math.max(2,Math.round(2*xe.getDevicePixelRatio()));return{border:{alignWidth:e},inner:{alignWidth:e}}},[M]),L=(0,X.useRef)(null),R=e=>L.current?{...e,cancel:L.current}:e,ee=K((e,t,n,r)=>{L.current=r,c.setMode(R(ac(n)))},[c]),z=K((e,t,n,r)=>{c.setMode(R(ac(r)))},[c]),B=K(()=>{L.current=null,c.setMode(null)},[c]),V=(t,n,r)=>{let i=e.getRange(t).getMerges(),a=(w.isSingleCell(t)||i.length===1&&w.isEqualRanges(i[0],t)?e.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getMerges().find(e=>!w.isRangeWithinRange(e,t)):void 0)??n;return{to:a,refused:e.getRange(a).getMerges().some(e=>!w.isRangeWithinRange(e,a)&&(!r||w.isRangeWithinRange(e,t)))}},H=K((t,n)=>n.insert?!e.getRange(n.to).canInsertFrom(t,{isCut:!n.copy,axis:n.insert}):V(t,n.to,!n.copy).refused,[e]),ne=K((e,t)=>V(e,t.to,!t.copy).to,[e]),U=K(async(t,n)=>{let r=await a?.showBusy?.(o(`op.autoFill`));try{await e.doBatch(()=>{e.getRange(t).autoFill(n,{snap:!0}),e.getRange(n).autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:C(`op.autoFill`),autoSelect:!0})}catch(e){a?.showError?.(e)}finally{r?.()}},[e,a]),W=K((t,n)=>e.getRange(t).autoFill(n,{preview:!0,snap:!0}).getCoords(),[e]),re=K((e,t,n)=>{L.current=n},[]),ie=K(()=>{c.setMode(R(rc))},[c]),ae=(0,X.useRef)(null),oe=K((t,n,r)=>{let i=Xs[n],a=e.getRange(t).getExtended(i,{basis:`content`,fromBlank:`before`}).getCoords();if(w.isEqualRanges(a,t))return;if(r.shiftKey)return void e.getRange(a).select();let o=e.getSelectedCell().getCoords(),s=n===`top`||n===`bottom`;e.getRange(s?{rowIndex:n===`top`?a.rowStart:a.rowEnd,colIndex:o.colIndex}:{rowIndex:o.rowIndex,colIndex:n===`left`?a.colStart:a.colEnd}).select()},[e]),se=K(t=>e.getRange(t).getExtended(Y.Direction.Down,{basis:`adjacent`}).getCoords(),[e]),ce=K(()=>{L.current=null,c.setMode(null),ae.current=null},[c]),le=K((t,r,i,o)=>{if(!n)return;let s=Js({sheet:e,template:t,destination:r,notifier:a,onSettled:o});if(!s)return o(),void U(t,r);n({clientX:i.clientX,clientY:i.clientY,originalEvent:i},s)},[e,a,n,U]),de=K(async(t,n,r,i)=>{if(w.isEqualRanges(t,n))return;let s=!i.copy,c=!!i.insert,l=e.getRange(n);if(!c&&a?.showOptions&&l.getDifferences(t,{ignoreSpilled:!0})?.isContentful()&&await a.showOptions({title:o(`dialog.confirm.title`),description:o(`selection.replaceData`),options:[{id:`Replace`,label:()=>o(`selection.replace`)},`Cancel`],defaultOption:`Replace`})!==`Replace`)return void h.setSelection({cell:{rowIndex:t.rowStart,colIndex:t.colStart},rangeIndex:0,ranges:[t]});let u=C(c?s?`op.insertMovedCells`:`op.insertCopiedCells`:s?`op.moveCells`:`op.copyCells`),d=await a?.showBusy?.(o(u));try{let n=e.getRange(t);await l.doBatch(async()=>{c?await l.insertFrom(t,{isCut:s,axis:i.insert,undoRange:n}):await l.copyFrom(t,{isCut:s,undoRange:n}),n.autoFit({skipCustomSize:!0,axes:Y.AxisSelection.Row,minContent:!0}),l.autoFit({skipCustomSize:!0,axes:Y.AxisSelection.Row,minContent:!0})},{description:u,autoSelect:!0})}catch(e){a?.showError?.(e)}finally{d?.()}},[e,a,h]);return(0,Z.jsxs)(G.CommandScopeProvider,{spec:{scopeName:{key:`layer:selection`,name:`selection`},contributor:{dynamic:Ys},data:f},order:xt().zIndex,children:[(0,Z.jsx)(Wt,{className:Q(r,`sxl-selection`),selection:h,...i,singleStyle:I,getContentBounds:y,getRegionBounds:b,scrollIntoView:x,enabledMove:j,onMove:de,isDropRefused:H,snapMoveDestination:ne,onMoveStart:ee,onMoveUpdate:z,onMoveEnd:B,moveCursor:F,enableFill:P,snapFillDestination:W,onFill:U,onFillStart:re,onFillPreview:ie,onFillEnd:ce,onFillMenu:n?le:void 0,resolveFillExtent:se,onEdgeDoubleClick:oe,onSelectionEnd:m,onDragModeChange:v,externalDrag:S,renderTip:t=>{if(t.kind===`select`){let{range:n}=t,r=e.getEntireRange().getCoords(),i=n.rowEnd-n.rowStart+1,a=n.colEnd-n.colStart+1,s=n.rowStart<=r.rowStart&&n.rowEnd>=r.rowEnd;return s===(n.colStart<=r.colStart&&n.colEnd>=r.colEnd)?i===1&&a===1?null:o(`selection.tip.size`,{rows:i,cols:a}):s?a===1?null:o(`selection.tip.columns`,{cols:a}):i===1?null:o(`selection.tip.rows`,{rows:i})}return t.kind===`move`?e.getRange(t.to).getAddress():((t,n)=>{if(w.isRangeWithinRange(n,t))return null;let r=[t.rowStart,t.colStart,t.rowEnd,t.colEnd,n.rowStart,n.colStart,n.rowEnd,n.colEnd].join(`,`);if(ae.current?.key===r)return ae.current.text;let i=null;try{let r=Qs(t,n),a=e.getRange(t).autoFill(n,{preview:!0,snap:!0}),o=a.getCell({rowIndex:r===Y.Direction.Up?n.rowStart:n.rowEnd,colIndex:r===Y.Direction.Left?n.colStart:n.colEnd}),s=o.getSpans(),c=s.width>1||s.height>1?o.getExtrusions():null,l=c?a.getCell({rowIndex:c.rowStart,colIndex:c.colStart}):o;l.isEmpty()||(i=l.getText({hideStringPrefix:!0})||null)}catch(e){a?.showError?.(e)}return ae.current={key:r,text:i},i})(t.template,t.destination)},animate:{key:g},disableKeyboard:d,ref:u}),N&&(0,Z.jsx)(Qe,{selection:h,glide:_})]})};Zs.displayName=`SheetSelectionLayer`;var Qs=(e,t)=>t.rowEnd>e.rowEnd?Y.Direction.Down:t.rowStart<e.rowStart?Y.Direction.Up:t.colEnd>e.colEnd?Y.Direction.Right:Y.Direction.Left,$s={key:`dragCut`,description:C(`editMode.dragCut`),cursor:`move`},ec={key:`dragCutInsert`,description:C(`editMode.dragCutInsert`),cursor:`move`},tc={key:`dragCopy`,description:C(`editMode.dragCopy`),cursor:`copy`},nc={key:`dragCopyInsert`,description:C(`editMode.dragCopyInsert`),cursor:`copy`},rc={key:`fill`,description:C(`editMode.fill`),cursor:`crosshair`},ic=new Set([$s,ec,tc,nc].map(e=>e.key)),ac=e=>e.copy?e.insert?nc:tc:e.insert?ec:$s,oc=(e,t)=>Object.assign(Object.create(e),{setSelection:n=>{let r=e.getSelection(),i=n.ranges,a=n.rangeIndex??-1;i&&a>=0&&a<i.length&&i[a]&&i[a]!==r?.ranges?.[a]&&i[a].scope!==t&&(n={...n,ranges:i.map((e,n)=>n===a?{...e,scope:t}:e)}),e.setSelection(n)}});function sc(e){let{sheet:t,sheetView:n,className:r,onKeyDown:i,...a}=e,o=wa(),s=o.getMode(),c=s?.selection??null,l=c?.getWorksheet().getName(),u=t.getName(),d=l===u,f=!!s?.scope&&s.scope!==u,p=Gi(t,(n?.isShowFormulas()??!1)&&!c),m=(0,X.useMemo)(()=>{if(!p||!p.ranges.some(Boolean))return null;let e=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return e.updateCoords({cell:{rowIndex:p.coords.rowIndex,colIndex:p.coords.colIndex,scope:u},ranges:p.ranges,rangeIndex:-1}),new Gs(e)},[t,p,u]),h=K((e,t)=>{o.setMode(n=>n&&{...n,dragging:e,draggingIndex:e&&t!==null?t:void 0})},[]),g=K(e=>{if(i?.(e),e.defaultPrevented)return;let t=o.getMode();if(t?.mode!==`point`||t.scope&&t.scope!==u||Za(e,t,u))return;if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)){if(!t.activeInput||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),t.activeInput.toggleReferences();return}if(!t.onDone)return;let n=e.key;n!==`Enter`&&n!==`Tab`&&n!==`Escape`||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||(e.preventDefault(),e.stopPropagation(),t.onDone({reason:n===`Escape`?`cancel`:`accept`,key:n,shiftKey:e.shiftKey,altKey:e.altKey}))},[i,u]),_=(0,X.useMemo)(()=>c?oc(new Gs(c),u):null,[c,u]),v=Ae(_,e=>e.getSelection()),y=e=>!!e&&(e.scope===void 0&&d||e.scope===u),b=!!v?.ranges?.some(y),x=!f&&s?.mode===`point`,S=b||x;if(!s)return!m||!p?null:(0,Z.jsx)(tt,{className:Q(r,`sxl-reference-picker`,`sxl-formula-view`),selection:m,getRangeStyle:(e,t)=>{let n=p.ranges[e];return n&&n.scope===u?Bt(e):null},...a,animated:!1,disableDraw:!0,allowMulti:!1,anchors:cc,onKeyDown:i});if(!_||!v||!S)return null;let C=!0===s?.readOnly;return(0,Z.jsx)(tt,{className:Q(r,`sxl-reference-picker`,C?`sxl-read-only`:void 0),selection:_,getRangeStyle:(e,t)=>{let n=v.ranges?.[e];return n&&y(n)?Bt(e):null},...a,animated:!C&&(v.rangeIndex??-1)>=0,enabledMove:!C,anchors:C?cc:void 0,disableDraw:!x||C,allowMulti:!1!==s?.allowMulti,onDragActiveChange:h,onKeyDown:g})}sc.displayName=`SheetReferenceLayer`;var cc=[],lc=Object.freeze([]),uc=e=>{let t=qt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n]);o(e,{onTablesChange:()=>r(),onAutoTableChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r()},dc);let a=t.getVisibleRange(),s=(0,X.useMemo)(()=>{if(!a)return lc;let t=e.getTables().getItems({address:a});return t.length>0?t:lc},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]);return(0,X.useEffect)(()=>{if(s.length===0)return;let e=s.map(e=>e.addListeners({onAnyChange:()=>r()},fc));return()=>{for(let t of e)t?.()}},[s]),{visibleTables:s,cacheToken:i}},dc={transactional:!1,ignoreModelChange:!0},fc={transactional:!1},pc=Object.freeze([Pn.Feature.Borders,Pn.Feature.Fill,Pn.Feature.NumberFormat,Pn.Feature.DateFormat,Pn.Feature.AutoTable,Pn.Feature.Table,Pn.Feature.Pivot,Pn.Feature.Merge,Pn.Feature.Hyperlink,Pn.Feature.IgnoredErrors,Pn.Feature.Comments,Pn.Feature.Unlock,Pn.Feature.Formula,Pn.Feature.Spills,Pn.Feature.CalcStatus,Pn.Feature.CalcError,Pn.Feature.Circular,Pn.Feature.DataValidations,Pn.Feature.Conditionals,Pn.Feature.CellControl]),mc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:pc},hc=(e,t)=>{let n=qt(),r=t?.showFormulas??!1,i=t?.showZeros??!0,a=t?.contentOnly??!1,[s,c]=(0,X.useReducer)(e=>e+1,0),l=(0,X.useMemo)(()=>({}),[s,r,i,a]),u=(0,X.useRef)(new Map),d=(0,X.useRef)({showFormulas:r,showZeros:i,contentOnly:a});d.current.showFormulas===r&&d.current.showZeros===i&&d.current.contentOnly===a||(d.current={showFormulas:r,showZeros:i,contentOnly:a},u.current.clear());let f=n.getVisibleRange();pr(e,(0,X.useMemo)(()=>f?{rowStart:f.rowStart,colStart:f.colStart,rowEnd:f.rowEnd,colEnd:f.colEnd}:null,[f?.rowStart,f?.colStart,f?.rowEnd,f?.colEnd]),e=>{e.getTrigger()===`data`&&(u.current.clear(),c())},gc);let p=()=>{u.current.clear(),c()};return o(e,{onStyleChange:p,onLayoutChange:p},{ignoreModelChange:!0}),{getVisibleCells:K((t,n)=>{let o=u.current,s=n??t.getVisibleRange();if(!s)return[];let c=`${s.rowStart}:${s.colStart}:${s.rowEnd}:${s.colEnd}`,l=o.get(c);if(l)return l;let d=[];return e.getRange(s).forEach((e,t)=>{let n=t.getCoords(),o=t.getCell();if(!(e=>{if(e.isEmpty())return!1;if(a){let t=e.getConditionalDecorations();if(!1===t.dataBar?.showValue||!1===t.iconSet?.showValue)return!1}let t=e.getSpans();if(t.width>1||t.height>1||!a&&e.getStyle().hasVisibleStyling()||r&&e.getFormula()!==null)return!0;let n=e.getValue();return!(!a||n!==null||r||!e.getControl()?.isAccepted(n))||n!==null&&!(!i&&n===0&&e.getType()===An.Number)})(o))return;let s=r?null:o.getExtrusions();d.push({cell:n,value:o,range:s??void 0})},mc),o.set(c,d),o.size>12&&o.delete(o.keys().next().value),d},[e,r,i,a]),cacheToken:l}},gc={transactional:!1,anchor:Vn.Type.Absolute},_c=(e,t)=>{let n=qt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t,e]),s=(0,X.useRef)(new Map),c=K(()=>{s.current.clear(),i()},[]);o(e,{onStyleChange:c,onLayoutChange:c,onProtectionChange:c});let l=n.getVisibleRange();return pr(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&c()},vc),{getRegions:K((n,r)=>{let i=r??n.getVisibleRange();if(!i)return[];let a=s.current,o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,c=a.get(o);if(c)return c;let l=[...e.getRange(i).getRegions(t)];return a.set(o,l),a.size>12&&a.delete(a.keys().next().value),l},[e,t]),cacheToken:a}},vc={transactional:!1,anchor:Vn.Type.Absolute},yc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:pc},bc=(e,t)=>{let n=qt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t]),s=(0,X.useRef)(new Map),c=K(()=>{s.current.clear(),i()},[]);o(e,{onConditionalFormatsChange:c},{ignoreModelChange:!0});let l=n.getVisibleRange();return pr(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&c()},Sc),{getVisibleDecorations:K((n,r)=>{let i=s.current,a=r??n.getVisibleRange();if(!a)return xc;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,c=i.get(o);if(c)return c;let l=e.getRange(a),u=xc;if(l.getConditionalFormats().length>0){let e=[];l.forEach((n,r)=>{let i=r.getCell(),a=i.getConditionalDecorations();if(!a[t])return;let o=i.getSpans(),s=o.width>1||o.height>1?i.getRange().getCoords():void 0;e.push({cell:r.getCoords(),value:i,range:s,decorations:a})},yc),e.length>0&&(u=e)}return i.set(o,u),i.size>12&&i.delete(i.keys().next().value),u},[e,t]),cacheToken:a}},xc=[],Sc={transactional:!1,anchor:Vn.Type.Absolute},Cc=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,className:i,style:a,...o}=e,c=qt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=K(r,[r]),u=c.getPaneBounds();if(u.width===0||u.height===0)return null;if(!c.toClipBounds(c.getBoundsFromRange(),-3))return;let d=l(c),f=d?d.length:0;if(f===0)return;let p=null,m=null,h=c.getVisibleRange();for(let e=0;e<f;e++){let t=d[e],r=t.cell;if(!r)continue;let i=t.value,a=t?.range;if(a){let e=i.getSpans();e.height===1&&e.width===1&&(a=null)}let o=i;if(a){let e=`${a.rowStart}:${a.colStart}`;if(m?.has(e))continue;(m??=new Set).add(e),i.isTopLeft()||(o=n.getRange({rowIndex:a.rowStart,colIndex:a.colStart}).getCell())}let s=a?{...a}:w.cellToRange(r);if(!w.isRangesIntersect(s,h)&&!w.isRangeWithinRange(s,h))continue;let c=o.getStyle().getFill();c.hasVisibleStyling()&&(s.value=c,p||=[],p.push(s))}if(!p)return;let g=w.mergeRangeCoordValues(p,2,(e,t)=>{let n=e[0].value,r=e[1].value;if(n.isEqual(r))return t}),_=[],v=g.length;for(let e=0;e<v;e++){let t=g[e],n=t.value,r=n.getType()===_n.Type.Pattern?n.toCSSMask(`adaptive`):null,i,a=null;if(r)i=r.base,a=(0,Z.jsx)(`div`,{className:`sxl-cell-fill-marks`,style:{position:`absolute`,inset:0,...r.marks}});else{let e=c.getBoundsFromRange(t);i=n.toCSS(`adaptive`,e)}_.push((0,Z.jsx)(ut,{className:`sxl-cell-fill`,range:t,clipInsets:-10,coverGridlines:!0,style:{pointerEvents:`none`,...i},children:a},`fill-${e}`))}return(0,Z.jsx)(q,{...o,className:Q(i,`sxl-fills`),children:(0,Z.jsx)(ut,{fill:!0,ref:t,className:`sxl-fills-box`,style:{pointerEvents:`none`,overflow:`visible`,...a},children:_})})})),wc=(e,t)=>{let n=Qn.cellToString(e)??``;return e.scope&&e.scope!==t?Qn.sheetAndRangeToString(Qn.sheetNameToString(e.scope)??e.scope,n):n},Tc=(e,t)=>{let n=t.scope,r=e;if(n&&n!==e.getName())try{r=e.getWorkbook()?.getWorksheet(n)??null}catch{r=null}return r?r.getRange({rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}).select({scrollIntoView:!0}):null},Ec=(e,t)=>{let n=wa();(0,X.useEffect)(()=>{if(!e||!t||n.getMode())return;let r=t.getMembers();if(r.length===0)return;let i=r.map(t=>({rowStart:t.rowIndex,rowEnd:t.rowIndex,colStart:t.colIndex,colEnd:t.colIndex,scope:t.scope??e.getName()})),a=e.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return a.updateCoords({cell:{rowIndex:i[0].rowStart,colIndex:i[0].colStart,scope:i[0].scope},ranges:i,rangeIndex:-1}),n.setMode({mode:`show`,selection:a,activeInput:null,readOnly:!0}),()=>{n.setMode(e=>e?.selection===a?null:e)}},[e,t,n])},Dc=`_panel_14jxb_5`,Oc=`_search_14jxb_16`,kc=`_values_14jxb_24`,Ac=`_empty_14jxb_28`,jc=e=>{let{items:t,currentText:n,onChoose:r,minWidth:i,search:a=!1,onClose:o,style:s,className:c,measureText:l,viewport:u,visibleRows:d}=e,f=je(),p=Ye(),m=(0,X.useRef)(null),[h,g]=(0,X.useState)(``),_=(0,X.useMemo)(()=>a?Kt(t,h):t,[t,h,a]),v=(0,X.useMemo)(()=>n==null?0:Math.max(0,_.findIndex(e=>e.text===n)),[_,n]),y=K((e,t)=>{r(t)},[r]),b=(0,X.useCallback)(e=>{let t=m.current;t&&(e.which===Pe.Down||e.which===Pe.Up?(e.preventDefault(),t.moveHighlight(e.which===Pe.Down?1:-1)):e.which===Pe.Enter&&(e.preventDefault(),t.chooseHighlighted()))},[]),x=a?(0,Z.jsx)(Vt,{className:Oc,value:h,onChange:g,onClose:o,onKeyDown:b,placeholder:f(`picker.search`),clearLabel:f(`picker.clearSearch`),autoFocus:!0}):null;return(0,Z.jsxs)(`div`,{className:Q(Dc,`sxl-cell-picker`,c),style:{minWidth:i,...s},...Ce(`grid`,p),children:[x,_.length===0?(0,Z.jsx)(`div`,{className:Ac,children:f(h?`picker.noMatches`:`picker.noValues`)}):(0,Z.jsx)(Ft,{ref:m,className:kc,items:_,highlightIndex:v,onChoose:y,measureText:l,viewport:u,visibleRows:d,autoFocus:!a})]})};jc.displayName=`PickerPanel`;var Mc=null,Nc=new Set,Pc=e=>(Nc.add(e),()=>{Nc.delete(e)}),Fc=e=>{Mc!==e&&(Mc=e,Nc.forEach(e=>e()))},Ic=e=>(0,X.useSyncExternalStore)(Pc,()=>Mc===e,()=>!1),Lc={placement:`bottom-end`,offsets:[0,1]},Rc=(e,t,n)=>{let r=e.getSession();if(r)return!!w.isEqualCells(r.getCoords(),t)&&(r.setDirty(n),e.commit());if(!e.startEdit(t,{dirty:n,autoFocus:!1}))return!1;let i=()=>{let t=ka();return e.cancel(),t&&Oa(t),!1},a=e.commit();return!0===a||(!1===a?i():a.then(e=>e||i()))},zc=e=>{let{sheet:t,editable:n,resolveItems:r,getCurrentText:i,onChoose:a,search:o,visibleRows:s,label:c=`cell-picker`}=e,[l,u]=(0,X.useState)(null),d=l?.cell??e.cell,f=l?l.anchor:e.anchor,p=l?l.minWidth:e.minWidth,[m,h]=(0,X.useState)([]),[g,_]=(0,X.useState)(null),v=(0,X.useRef)(0),y=(0,X.useMemo)(()=>t.getStyles().getNormal().getFont().toCSS(`adaptive`),[t]),b=(0,X.useMemo)(()=>d?{rowIndex:d.rowIndex,colIndex:d.colIndex,scope:t.getName()}:null,[d,t]),x=K(e=>{b&&(a?a(e,b):n&&Rc(n,b,e.text))},[n,b,a]),S=(0,X.useCallback)(e=>{let{closeFloat:t}=e;return(0,Z.jsx)(jc,{items:m,currentText:g,minWidth:p,search:o,visibleRows:s,style:y,onChoose:e=>{x(e),t?.()},onClose:()=>t?.()})},[m,g,p,o,s,y,x]),C=K(()=>Fc(t),[t]),w=K(()=>Fc(null),[]);(0,X.useEffect)(()=>()=>Fc(null),[]);let T=De({label:c,anchor:f,autoFocus:!1,propsPopper:Lc,renderFloatPanel:gt,renderPopupPanel:S,onOpen:C,onClose:w}),E=T.reference,D=K(async n=>{let a=n?.cell??e.cell;if(!a)return;let o=++v.current,s=await r(a);o===v.current&&(u(n??null),h(s),_(i?i(a):t.getCell(a).getText({hideStringPrefix:!0})),E.open(0))},[e.cell,r,i,t,E]);return{component:T.component,open:D,close:K(()=>{v.current++,E.close(0)},[E]),isOpen:T.isOpen}},Bc={side:`b`,align:`start`},Vc=(e,t,n=6)=>e.getBoundsFromRange(t).width+n,Hc=`_prompt_1qgxn_8`,Uc=`_line_1qgxn_24`,Wc=`_title_1qgxn_28`,Gc=`_message_1qgxn_28`,Kc=`_alert_1qgxn_34`,qc=`_alertRow_1qgxn_52`,Jc=`_alertIcon_1qgxn_58`,Yc=`_alertTitle_1qgxn_63`,Xc=`_alertHint_1qgxn_67`,Zc=(e,t)=>{let n=e.getCell({rowIndex:t.rowIndex,colIndex:t.colIndex}),r=n.getSpans();return r.width>1||r.height>1?n.getRange().getCoords():w.cellToRange(n.getCoords())},Qc=(e,t)=>{if(e.getDataValidations().getSettings().disablePrompts)return null;let n=e.getRange(w.cellToRange(t)).getDataValidations();for(let r=0;r<n.length;r++){let i=n[r];if(!i.isShowPromptMessage())continue;let a=i.getPromptTitle()??``,o=i.getPromptMessage()??``;if(a||o)return{range:Zc(e,t),title:a,message:o,dataValidation:i}}return null},$c=(e,t,n)=>{if(!t)return null;let r=e.getStyles().getNormal().createStyle({font:{family:`Segoe UI`,size:11,weight:n?700:400},alignment:{horizontal:J.HorizontalAlignment.Left,overflow:J.Overflow.Wrap}}),i=r.createTextFrame(t,!0).layout({width:170}),a=i.lines.map(e=>({text:e.runs.map(e=>e.text).join(``).trimEnd(),height:e.bounds.height})),o=r.getFont().toCSS();return{lines:a,width:i.textBounds.width,font:{fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontStyle:o.fontStyle,letterSpacing:o.letterSpacing}}},el=e=>{let{sheet:t,prompt:n,floatProps:r}=e,i=(0,X.useMemo)(()=>$c(t,n.title,!0),[t,n.title]),a=(0,X.useMemo)(()=>$c(t,n.message,!1),[t,n.message]),o=Math.ceil(Math.max(i?.width??0,a?.width??0)),s=(e,t)=>e?(0,Z.jsx)(`div`,{className:t,style:e.font,children:e.lines.map((e,t)=>(0,Z.jsx)(`div`,{className:Uc,style:{height:e.height,lineHeight:`${e.height}px`},children:e.text},t))}):null;return(0,Z.jsxs)(`div`,{...r,className:Hc,style:{...r.style,width:o},role:`note`,children:[s(i,Wc),s(a,Gc)]})},tl=e=>{let{alert:t,floatProps:n}=e,r=je(),i=t.dataValidation,a=i.getAlertTitle(),o=i.getAlertMessage()||r(`validationAlert.default`),s=t.style===Gn.AlertStyle.Stop?r(`validationAlert.hint.stop`):t.style===Gn.AlertStyle.Warning?r(`validationAlert.hint.warning`):null;return(0,Z.jsx)(`div`,{...n,className:Kc,style:{...n.style,borderLeftColor:ol[t.style]},role:`alert`,children:(0,Z.jsxs)(`div`,{className:qc,children:[(0,Z.jsx)(`span`,{className:Jc,children:(0,Z.jsx)(M,{iconKey:sl[t.style],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[a?(0,Z.jsx)(`div`,{className:Yc,children:a}):null,(0,Z.jsx)(`div`,{children:o}),s?(0,Z.jsx)(`div`,{className:Xc,children:s}):null]})]})})},nl=(0,X.memo)(e=>{let{sheet:t,editable:n,offset:r=6,renderPrompt:i,renderAlert:a,className:o,style:s,...c}=e,l=(0,X.useMemo)(()=>new Gs(t.getSelection()),[t]),u=qt(),d=Ic(t),f=Aa(t);(0,X.useEffect)(()=>{if(!f)return;let e=()=>{let e=n?.getSession()??null;e&&w.isEqualCells(e.getCoords(),f.coords)||Oa(null)};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`pointerdown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`pointerdown`,e,!0)}},[f,n]);let p=K((e,n)=>{let i=Qc(t,e);return i?{range:i.range,key:`prompt:${i.range.rowStart},${i.range.colStart}:${i.dataValidation.getIndex()}`,data:{prompt:i},alignOffset:Vc(n,i.range,r)}:null},[t]),m;if(f){let e=Zc(t,f.coords);m={range:e,key:`alert:${e.rowStart},${e.colStart}:${f.dataValidation.getIndex()}:${f.style}`,data:{alert:f},alignOffset:Vc(u,e,r)}}return(0,Z.jsx)(St,{...c,className:Q(o,`sxl-validation-prompt`,f&&`sxl-validation-alert`),style:s,activateOn:`selection`,selection:l,probe:p,target:m,placement:Bc,offset:r,whenOff:`hide`,interactive:`pointer`,dismiss:d,children:({data:e,floatProps:n})=>e.alert===void 0?i===void 0?(0,Z.jsx)(el,{sheet:t,prompt:e.prompt,floatProps:n}):(0,Z.jsx)(ae,{render:i,props:{prompt:e.prompt,floatProps:n}}):a===void 0?(0,Z.jsx)(tl,{alert:e.alert,floatProps:n}):(0,Z.jsx)(ae,{render:a,props:{alert:e.alert,floatProps:n}})})});nl.displayName=`ValidationPromptLayer`;var rl=(e,t,n)=>{let r=null,i=null,a=0;for(let o=0;o<e.length;o++){let s=e[o];s.getAlertAt(t,n)&&(a++,i??=s,!r&&s.isShowAlertMessage()&&(r=s))}return i?r?{state:r.getAlertStyle(),rule:r,others:a-1}:{state:`failed`,rule:i,others:a-1}:null},il={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},al={...il,includeEmpty:!0},ol={failed:`var(--sxl-color-neutral, #9ca3af)`,[Gn.AlertStyle.Information]:`var(--sxl-color-info, #3b82f6)`,[Gn.AlertStyle.Warning]:`var(--sxl-color-warning, #f59e0b)`,[Gn.AlertStyle.Stop]:`var(--sxl-color-error, #ef4444)`},sl={failed:`ValidationFailed`,[Gn.AlertStyle.Information]:`ValidationInformation`,[Gn.AlertStyle.Warning]:`ValidationWarning`,[Gn.AlertStyle.Stop]:`ValidationStop`},cl=({sheet:e,cycle:t})=>(Ec(e,t),null),ll={error:`var(--sxl-color-error, #d32f2f)`,warning:`var(--sxl-color-warning, #ed6c02)`,circular:`var(--sxl-color-error, #d32f2f)`,validation:`var(--sxl-color-error, #d32f2f)`},ul={failed:`var(--sxl-color-neutral, #9e9e9e)`,information:`var(--sxl-color-info, #0288d1)`,warning:`var(--sxl-color-warning, #ed6c02)`,stop:`var(--sxl-color-error, #d32f2f)`},dl=e=>({boxSizing:`border-box`,maxWidth:320,padding:`8px 12px`,fontSize:`var(--sxl-font-size, 13px)`,lineHeight:1.45,color:`var(--sxl-color-base-content, rgba(0, 0, 0, 0.87))`,background:`var(--sxl-color-elevated, #ffffff)`,border:`1px solid var(--sxl-color-base-border, rgba(0, 0, 0, 0.26))`,borderLeft:`4px solid ${e}`,borderRadius:4,boxShadow:`0 4px 16px var(--sxl-color-shadow, rgba(0, 0, 0, 0.2))`,whiteSpace:`pre-line`,cursor:`default`}),fl=e=>({fontWeight:600,color:e}),pl=new Map([[kn.Code.Parse,C(`cellError.description.parse`)],[kn.Code.Null,C(`cellError.description.null`)],[kn.Code.Div0,C(`cellError.description.div0`)],[kn.Code.Value,C(`cellError.description.value`)],[kn.Code.Ref,C(`cellError.description.ref`)],[kn.Code.Name,C(`cellError.description.name`)],[kn.Code.Num,C(`cellError.description.num`)],[kn.Code.NA,C(`cellError.description.nA`)],[kn.Code.GettingData,C(`cellError.description.gettingData`)],[kn.Code.Spill,C(`cellError.description.spill`)],[kn.Code.Connect,C(`cellError.description.connect`)],[kn.Code.Blocked,C(`cellError.description.blocked`)],[kn.Code.Unknown,C(`cellError.description.unknown`)],[kn.Code.Field,C(`cellError.description.field`)],[kn.Code.Calc,C(`cellError.description.calc`)],[kn.Code.Busy,C(`cellError.description.busy`)],[kn.Code.Python,C(`cellError.description.python`)],[kn.Code.Timeout,C(`cellError.description.timeout`)]]),ml={opacity:.75,marginTop:2},hl={display:`inline-flex`,marginTop:2},gl={display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:8,overflow:`hidden`},_l={padding:0,border:0,background:`none`,color:`inherit`,font:`inherit`,textDecoration:`underline`,cursor:`pointer`},vl=(0,X.memo)(e=>{let{sheet:t,placement:n=Bc,offset:r=6,alignOffset:i,openDelay:a,closeDelay:o,renderTip:s,className:c,...l}=e,u=ue(),d=u.getMode()?.key===`edit`,f=je(),p=e=>{let n=u.getMode();if(n?.key===`edit`){let r=n.args?.editable.getSession()?.getState().coords;if(r&&w.isEqualCells({...r,scope:r.scope??t.getName()},{...e,scope:t.getName()}))return null}let r=t.getCell(e),i=r.getRange().getCoords(),a=r.getErrors();if(a.length){let e=r.getValue();if(kn.isError(e)){let t=r.getText(),n=e.message||a.filter(t=>String(t)!==String(e)).join(`
7
+ `),o=pl.get(e.getCode());return{range:i,data:{kind:`error`,message:n,code:t,description:o?f(o):void 0}}}return{range:i,data:{kind:`error`,message:a.join(`
8
+ `)}}}let o=r.getCircularReference();if(o){let e=r.getCoords();return{range:i,data:{kind:`circular`,message:r.getWarnings().join(`
9
+ `),cycle:o,path:o.getPath({rowIndex:e.rowIndex,colIndex:e.colIndex,scope:t.getName()}),representative:o.getRepresentative()}}}let s=((e,t)=>{if(!e.getView().isShowInvalid())return null;let n=e.getCell(t),r=n.getCoords(),i=n.getSpans(),a=i.width>1||i.height>1?n.getRange().getCoords():w.cellToRange(r),o=e.getRange(a).getDataValidations();if(o.length===0)return null;let s=rl(o,r.rowIndex,r.colIndex);if(!s)return null;let c=e.getSelectedCell().getCoords();if(c.rowIndex===r.rowIndex&&c.colIndex===r.colIndex&&Qc(e,r))return null;let l=s.rule,u=s.state===`failed`?[]:[l.getAlertTitle(),l.getAlertMessage()].filter(e=>!!e);return{range:a,message:u.length>0?u.join(`
10
+ `):l.getCondition()?.toString()??``,mark:s}})(t,e);if(s)return{range:i,data:{kind:`validation`,message:s.message,validation:s.mark}};let c=r.getWarnings();return c.length?{range:i,data:{kind:`warning`,message:c.join(`
11
+ `)}}:null},m=K((e,t)=>{let n=p(e);return n&&i===void 0?{...n,alignOffset:Vc(t,n.range,r)}:n},[t,u,f,i,r]),h=e=>{let t=e.validation;return(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`flex-start`},children:[(0,Z.jsx)(`span`,{style:hl,children:(0,Z.jsx)(M,{iconKey:sl[t.state],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{style:gl,children:e.message}),t.others>0?(0,Z.jsx)(`div`,{style:{opacity:.8},children:f(`validationTip.more`,{count:t.others})}):null]})]})},g=(e,n,r,i)=>{let a=t.getName(),o=wc(e,a);return e.rowIndex===n.rowStart&&e.colIndex===n.colStart&&(e.scope??a)===a?(0,Z.jsx)(`span`,{style:i?{color:i}:void 0,children:o},r):(0,Z.jsx)(`button`,{type:`button`,style:i?{..._l,color:i}:_l,onMouseDown:e=>e.preventDefault(),onClick:()=>{Tc(t,e)},children:o},r)},_=(e,t)=>{let n=t.path,r=(e=>{if(!e||At.length===0)return()=>{};let t=e.getMembers();return e=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.rowIndex===e.rowIndex&&r.colIndex===e.colIndex&&(r.scope??null)===(e.scope??null))return At[n%At.length]}}})(t.cycle);if(n&&n.length>0){let i=[];for(let t=0;t<n.length;t++)t>0&&i.push(` → `),i.push(g(n[t],e,t,r(n[t])));return i.push(` → `,g(n[0],e,`back`,r(n[0]))),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{children:i}),v(t)]})}let i=t.representative;return i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{children:[f(`circular.reads`),` `,g(i,e,`rep`,r(i))]}),v(t)]}):(0,Z.jsx)(`div`,{children:t.message})},v=e=>{let t=e.cycle;if(!t?.isIterative())return null;let n=t.getIterationCount();if(t.isConverged())return(0,Z.jsx)(`div`,{children:f(`circular.converged`,{count:n})});let r=t.getLastChange();return(0,Z.jsx)(`div`,{children:Number.isFinite(r)?f(`circular.unconverged`,{count:n,change:r}):f(`circular.unconvergedNoChange`,{count:n})})};return(0,Z.jsx)(it,{...l,className:Q(c,`sxl-cell-error`),interactive:!0,bubble:!1,probe:m,placement:n,offset:r,alignOffset:i,openDelay:a,closeDelay:o,dismiss:d,children:({range:e,data:n,tipProps:r,state:i})=>{let a=n.kind===`circular`&&!!n.cycle?.isConverged(),o=n.validation?ul[n.validation.state]:a?`var(--sxl-color-info, #0288d1)`:ll[n.kind],c=n.kind===`error`?n.code??f(`cellError.error`):n.kind===`warning`?f(`cellError.warning`):n.kind===`circular`?f(`circular.title`):null;return(0,Z.jsxs)(Z.Fragment,{children:[n.kind===`circular`?(0,Z.jsx)(cl,{sheet:t,cycle:n.cycle}):null,s===void 0?(0,Z.jsxs)(`div`,{...r,style:{...dl(o),...r.style},children:[c?(0,Z.jsx)(`div`,{style:fl(o),children:c}):null,n.kind===`circular`?_(e,n):n.kind===`validation`?h(n):(0,Z.jsxs)(Z.Fragment,{children:[n.description?(0,Z.jsx)(`div`,{children:n.description}):null,n.message?(0,Z.jsx)(`div`,{style:n.description?ml:void 0,children:n.message}):null]})]}):(0,Z.jsx)(ae,{render:s,props:{range:e,message:n.message,code:n.code,description:n.description,kind:n.kind,state:i,cycle:n.cycle,path:n.path,representative:n.representative,validation:n.validation}})]})}})});vl.displayName=`CellErrorLayer`;var yl=e=>{let t=e.getProtection();return t.isInsertHyperlinksAllowed()&&t.isFormatCellsAllowed()},bl=`_preview_d64gw_2`,xl=`_previewShown_d64gw_8`,Sl=`_previewSlide_d64gw_12`,Cl=`_previewClip_d64gw_16`,wl=new Map,Tl=new Map,El=(0,X.memo)(e=>{let{sheet:t,renderCard:n,preview:r,placement:i={side:`b`,align:`start`},offset:a=4,className:o,...s}=e,c=ue().getMode()?.key===`edit`,[l]=G.useCommands([`updateHyperlink`]),u=he(),d=K(e=>{let n=t.getCell(e),r=n.getHyperlink();return r?{range:n.getRange().getCoords(),data:{hyperlink:r}}:null},[t]),[f]=zt(Xe,null),p=(0,X.useMemo)(()=>{let e=f?.getMovable(),t=f?.getHyperlink();return f&&e&&t?{range:e.getRange().getCoords(),key:`picture:${e.getId()}:${t.getAddress()}`,data:{hyperlink:t,picture:f}}:null},[f]);return(0,Z.jsx)(it,{...s,className:Q(o,`sxl-hyperlink-card`),probe:d,hoveredOver:p,placement:i,offset:a,interactive:!0,bubble:!1,dismiss:c,children:({range:e,data:{hyperlink:i,picture:a},tipProps:o,state:s})=>{let c={rowIndex:e.rowStart,colIndex:e.colStart},d={sheet:t,coords:c,hyperlink:i,tipProps:o,state:s,open:async()=>{await i.open()},copy:async()=>{await navigator.clipboard?.writeText(i.getAddress())},edit:()=>{a?Ze(a,t,u):(t.getRange(e).select(),l?.execute())},remove:()=>{i.delete()},disabled:i.isReadOnly()||(a?a.isReadOnly():!yl(t))};return(0,Z.jsx)(Dl,{...d,lookup:r,renderCard:n===void 0?Fl:n})}})});El.displayName=`HyperlinkLayer`;var Dl=e=>{let{lookup:t,renderCard:n,...r}=e,i=((e,t)=>{let[,n]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!t||Tl.has(e))return;let r=!1,i=wl.get(e);return i||(i=Promise.resolve().then(()=>t(e)).catch(()=>null).then(t=>(Tl.set(e,t),t)),wl.set(e,i)),i.then(()=>{r||n(e)}),()=>{r=!0}},[e,t]),t?Tl.get(e)??null:null})(r.hyperlink.getAddress(),t);return(0,Z.jsx)(ae,{render:n,props:{...r,preview:i}})},Ol=e=>{let{src:t,expectedWidth:n,width:r=`100%`,style:i}=e,[a,o]=(0,X.useState)(0),[s,c]=(0,X.useState)(null),l=(0,X.useRef)(null),[u,d]=(0,X.useState)(t);t!==u&&(d(t),o(0),c(null));let f=a===0?t:`${t}${t.includes(`?`)?`&`:`?`}retry=${a}`,[p]=(0,X.useState)(()=>new Set);(0,X.useEffect)(()=>()=>{for(let e of p)clearTimeout(e)},[p]);let m=(e,t)=>{if(n==null||e.naturalWidth===n)return void c(e=>e??t);if(a>=8)return;let r=setTimeout(()=>o(e=>e+1),1500);p.add(r)};return(0,X.useLayoutEffect)(()=>{let e=l.current;e&&e.complete&&e.naturalWidth>0&&m(e,`at-once`)},[f]),(0,Z.jsx)(`div`,{className:Q(bl,s&&xl,s===`slide`&&Sl),children:(0,Z.jsx)(`div`,{className:Cl,children:(0,Z.jsx)(`img`,{ref:l,src:f,alt:``,style:{display:`block`,width:r,maxWidth:`100%`,borderRadius:4,...i},onLoad:e=>m(e.currentTarget,`slide`)},a)})})},kl={display:`flex`,flexDirection:`column`,width:320,boxSizing:`border-box`,padding:8,borderRadius:`var(--sxl-radius-box, 6px)`,"--icon-size":`1.25rem`,font:`var(--sxl-font-size, 13px)/1.4 var(--sxl-font-family, system-ui, sans-serif)`,color:`var(--sxl-color-base-content, #222)`,background:`var(--sxl-color-elevated, var(--sxl-color-base-100, white))`,border:`1px solid var(--sxl-color-base-border, rgba(0,0,0,0.26))`,boxShadow:`0 4px 16px var(--sxl-color-shadow, rgba(0,0,0,0.2))`},Al={display:`flex`,alignItems:`center`,gap:6},jl={border:`none`,background:`transparent`,cursor:`pointer`,padding:0,margin:0,font:`inherit`,color:`inherit`,textAlign:`left`,display:`block`,width:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},Ml={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`transparent`,cursor:`pointer`,padding:3,borderRadius:4,color:`inherit`,opacity:.8},Nl={...Ml,cursor:`default`,opacity:.35},Pl=e=>{let{hyperlink:t,open:n,copy:r,edit:i,remove:a,disabled:o,preview:s,tipProps:c}=e,l=je(),u=t.getScreenTip(),d=t.getAddress(),f=()=>{n()},p=s?.title;return(0,Z.jsxs)(`div`,{...c,role:`toolbar`,style:{...kl,...c.style},children:[(0,Z.jsxs)(`div`,{style:Al,children:[(0,Z.jsx)(`button`,{type:`button`,style:Ml,title:l(`hyperlink.open`),"aria-label":l(`hyperlink.open`),onClick:f,children:(0,Z.jsx)(M,{iconKey:`HyperlinkGoto`})}),(0,Z.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[p?(0,Z.jsx)(`button`,{type:`button`,style:{...jl,fontWeight:600,color:`var(--sxl-color-primary, #1976d2)`},title:p,onClick:f,children:p}):null,(0,Z.jsx)(`button`,{type:`button`,title:u??d,onClick:f,style:p?{...jl,opacity:.75}:{...jl,color:`var(--sxl-color-primary, #1976d2)`},children:u??d})]}),(0,Z.jsxs)(`div`,{style:{display:`flex`,gap:2},children:[(0,Z.jsx)(`button`,{type:`button`,style:Ml,title:l(`hyperlink.copy`),"aria-label":l(`hyperlink.copy`),onClick:()=>{r()},children:(0,Z.jsx)(M,{iconKey:`ContentCopy`})}),(0,Z.jsx)(`button`,{type:`button`,style:o?Nl:Ml,title:l(`hyperlink.edit`),"aria-label":l(`hyperlink.edit`),disabled:o,onClick:i,children:(0,Z.jsx)(M,{iconKey:`HyperlinkEdit`})}),(0,Z.jsx)(`button`,{type:`button`,style:o?Nl:Ml,title:l(`hyperlink.remove`),"aria-label":l(`hyperlink.remove`),disabled:o,onClick:a,children:(0,Z.jsx)(M,{iconKey:`HyperlinkDelete`})})]})]}),s?.image?(0,Z.jsx)(`button`,{type:`button`,style:{...jl,whiteSpace:`normal`},onClick:f,tabIndex:-1,children:(0,Z.jsx)(Ol,{src:s.image,expectedWidth:s.imageWidth,style:{marginTop:8}})}):null]})},Fl=e=>(0,Z.jsx)(Pl,{...e}),Il=e=>{let t=e.getStyles().getNormal().getBorders(),[n,r]=Ll(t.getBottom(),yn.Edge.Bottom,t.getTop(),yn.Edge.Top),[i,a]=Ll(t.getRight(),yn.Edge.Right,t.getLeft(),yn.Edge.Left),o=Rl(n,r),s=Rl(i,a),c=(0,X.useMemo)(()=>si(n,r),[o]),l=(0,X.useMemo)(()=>si(i,a),[s]);return(0,X.useMemo)(()=>({rows:c,columns:l}),[c,l])},Ll=(e,t,n,r)=>yn.compareStrokes(e,n)>=0?[e,t]:[n,r],Rl=(e,t)=>e.isNone()?``:`${e.getStyle()}|${e.getColor().toCSS(`adaptive`)}|${t}`,zl=(e,t)=>e.getStyle().getBorders(),Bl=(e,t)=>{let n=e.getSpans();return n.width===1&&n.height===1?null:e.getExtrusions()},Vl=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=qt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=Il(n),{renderLayer:u}=ci({getVisibleCells:r,getBorderAt:zl,getMergeAt:Bl,normalRows:l.rows,normalColumns:l.columns,cache:i});if(c.getPaneBounds().width===0||c.getPaneBounds().height===0)return null;let d=u?.(c);return d&&c?(0,Z.jsx)(q,{...o,className:Q(a,`sxl-borders`),children:(0,Z.jsx)(ut,{fill:!0,className:`sxl-borders-box`,style:{pointerEvents:`none`},children:d})}):null})),Hl=(0,X.memo)(e=>{let{sheet:t,sheetView:n,renderCell:r,propsCellRender:i,editable:a,onEditRejected:o,className:c,...l}=e,u=qt(),d=he(),f=Is(t),p=o??f,m=(0,X.useSyncExternalStore)(Gr,Kr);s(n,[`onZoomScaleChange`]);let h=n.isShowFormulas(),g=n.isShowZeros(),{getVisibleCells:_,cacheToken:v}=hc(t,{showFormulas:h,showZeros:g,contentOnly:!0}),y=(0,X.useMemo)(()=>({}),[v,m]),b=(0,X.useMemo)(()=>qr({sheet:t,notifier:d,notifyEditRejected:p}),[t,d,p]),x=(0,X.useMemo)(()=>{let e=e=>{let{control:n,context:r,interactiveProps:i,Default:a,...o}=e,s=t.getStyles();return(0,Z.jsx)(_r,{docTheme:s.getTheme(),normalStyle:s.getNormal(),showFormulas:h,showZeros:g,...o})};return e.displayName=`DefaultCellContent`,e},[t,h,g]),S=K(e=>{let{value:n,key:r,...a}=e,o=n;if(!o){let n=e.range;if(!n||(o=t.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getCell(),o.isEmpty()))return null}let s=h?null:Wr(o);if(s?.entry.renderer){let e=s.entry.renderer({...a,value:o,control:s.control,context:b,interactiveProps:Lt,Default:x});return(0,X.isValidElement)(e)?(0,X.cloneElement)(e,{key:r}):e}let c;o.getHyperlink()&&(c=async e=>{if(i?.onLinkClick?.(e),e.button===0&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await o.getHyperlink()?.open()}catch(e){d.showError?.(e instanceof Error?e:String(e))}}});let{onColumnButtonMouseDown:l,propsColumnButton:u,renderColumnButton:f,onPivotButtonMouseDown:p,...m}=i??{},_=t.getStyles();return(0,X.createElement)(_r,{...a,key:r,docTheme:_.getTheme(),normalStyle:_.getNormal(),showFormulas:h,showZeros:g,onLinkClick:c,...m,value:o})},[t,h,g]),C=r??S,w=Ae(a,e=>e.getSession()),T=Gi(t,h,y),E=w?.getCoords()??T?.coords??null,D=null;if(T&&!w){let e={rowIndex:T.coords.rowIndex,colIndex:T.coords.colIndex},t=u.getBoundsFromRange(u.getRangeFromCell(e));if(t){let e=u.getZoom()||1;D=(0,Z.jsx)(ut,{bounds:t,className:`sxl-formula-view-anchor`,style:{pointerEvents:`none`},children:(0,Z.jsx)(Wi,{cell:T.cell,tokens:T.tokens,zoom:e,size:{width:t.width/e,height:t.height/e}})})}}let O=K(e=>{l.onPointerDown?.(e),e.isPropagationStopped()||function(e,t,n){if(e.button!==0)return!1;let r=vt(e.target);if(!r)return!1;let i=t.getCell(r),a=Wr(i);a?.entry.onPress&&(e.stopPropagation(),e.preventDefault(),a.entry.onPress(i,n,e))}(e,t,b)},[l.onPointerDown,t,b]),k=K(e=>{l.onDoubleClick?.(e),!e.isPropagationStopped()&&kt(e.target)&&(e.stopPropagation(),e.preventDefault())},[l.onDoubleClick]);return D||_(u).length!==0?(0,Z.jsxs)(q,{...l,className:Q(c,`sxl-cells`),onPointerDown:O,onDoubleClick:k,children:[(0,Z.jsx)(jt,{renderCell:C,getVisibleCells:_,cacheToken:y,suppressCell:E}),D]}):null});Hl.displayName=`SheetCellLayer`;var Ul=(0,X.memo)(e=>{let{sheet:t,onColumnButtonMouseDown:n,propsColumnButton:r,renderColumnButton:i=Yi,...a}=e,{cacheToken:o}=uc(t),s=K((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getTables().getItems({address:r}),a=t.getAutoTable(),o=a&&a.getRange().getIntersect(r)?[...i,a]:i;if(o.length===0)return[];let s=[],c=o.length;for(let e=0;e<c;e++){let n=o[e];if(n.isDeleted())continue;let r=n.getHeaderRowRange()?.getCoords();if(!r)continue;let i=n.getColumns(),a=i.length;for(let e=0;e<a;e++){let n=i[e];if(n.isHiddenButton())continue;let a={rowIndex:r.rowStart,colIndex:r.colStart+n.getIndex()};s.push({cell:a,value:{cell:t.getRange(a).getCell(),column:n}})}}return s},[t]),c=K(e=>{let{value:t,style:a,zoom:o=1,key:s}=e,{cell:c,column:l}=t;if(!a)return null;let u={x:0,y:0,width:a.width,height:a.height},d=(0,Z.jsx)(ae,{render:i,props:{bounds:u,className:`sxl-column-button`,disabled:!c.isEditAllowed(),zoom:o,column:l,onColumnButtonMouseDown:n,...r,style:{pointerEvents:`auto`,...r?.style}}});return(0,Z.jsx)(`div`,{style:{...a,position:`absolute`,display:`flex`,alignItems:`end`},children:d},s)},[n,r,i]);return(0,Z.jsx)(Gt,{...a,className:`sxl-column-buttons`,renderCell:c,getVisibleCells:s,cacheToken:o})});Ul.displayName=`SheetColumnButtonLayer`;var Wl=e=>{let t=[e.getRange().getCoords()],n=e.getPageRange();return n&&t.push(n.getCoords()),t},Gl=e=>{let[t,n]=Wl(e);return n?{rowStart:Math.min(t.rowStart,n.rowStart),colStart:Math.min(t.colStart,n.colStart),rowEnd:Math.max(t.rowEnd,n.rowEnd),colEnd:Math.max(t.colEnd,n.colEnd)}:t},Kl=(e,t)=>{for(let n of e.getPivotTables().getItems())if(!n.isDeleted()){for(let e of Wl(n))if(w.isRangeWithinRange(t,e))return n}return null},ql=e=>{let t=e.getSelection().getCoords()?.cell;return t?Kl(e,{rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}):null},Jl=(e,t)=>{if(!e||!t)return null;let n=e.getProperties(),r=n.headerRow?.fill?.background??n.wholeTable?.borders?.top?.color?.toString();return r?t.getStyles().parseColor(r)?.toCSS(`adaptive`)??null:null},Yl=(e,t)=>Jl(e.getStyle(),t)??`var(--sxl-color-neutral, grey)`,Xl=`_PivotFields_105hs_4`,Zl=`_Search_105hs_15`,Ql=`_FieldList_105hs_30`,$l=`_FieldRow_105hs_41`,eu=`_FieldName_105hs_57`,tu=`_TypeGlyph_105hs_65`,nu=`_FilterMark_105hs_74`,ru=`_Empty_105hs_80`,iu=`_Areas_105hs_86`,au=`_Area_105hs_86`,ou=`_AreaLabel_105hs_100`,su=`_AreaList_105hs_105`,cu=`_AreaHint_105hs_123`,lu=`_Chip_105hs_130`,uu=`_ChipCaption_105hs_144`,du=`_ChipRename_105hs_172`,fu=`_ChipMenuButton_105hs_185`,pu=`_ChipMenu_105hs_185`,mu=`_ChipMenuItem_105hs_220`,hu=`_ChipMenuCheck_105hs_243`,gu=`_ChipMenuDivider_105hs_249`,_u=`_Pane_105hs_255`,vu=`_PaneName_105hs_270`,yu=`_PaneEmpty_105hs_276`,bu=`_EmptyBox_105hs_285`,xu=`_EmptyContent_105hs_292`,Su=`_EmptyName_105hs_302`,Cu=`_EmptyHint_105hs_315`,wu=`_EmptyPicture_105hs_321`,Tu=`_EmptyPicturePaper_105hs_327`,Eu=e=>{let t=qt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n]);o(e,{onPivotTablesChange:()=>r(),onStyleChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r(),onProtectionChange:()=>r()},ku);let a=t.getVisibleRange();return{visibleTables:(0,X.useMemo)(()=>{if(!a)return Au;let t=e.getPivotTables().getItems().filter(e=>!e.isDeleted()&&w.isRangesIntersect(Gl(e),a));return t.length>0?t:Au},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]),cacheToken:i}},Du=(0,X.memo)(e=>{let{sheet:t,onPivotButtonMouseDown:n,...r}=e,{visibleTables:i,cacheToken:a}=Eu(t),o=K((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getPivotTables().getItems(),a=i.length;if(a===0)return[];let o=[];for(let e=0;e<a;e++){let n=i[e];if(n.isDeleted())continue;let a=Ln(n,r),s=a.length;for(let e=0;e<s;e++){let r=a[e],i={rowIndex:r.row,colIndex:r.column};o.push({cell:i,value:{cell:t.getRange(i).getCell(),table:n,control:r}})}}return o},[t]),s=K(e=>{let{value:r,style:i,zoom:a=1,key:o}=e,{cell:s,table:c,control:l}=r;if(!i)return null;let u=!t.getProtection().isPivotTablesAllowed();if(l.kind===`dropdown`){let e=c.getFields(),t={x:0,y:0,width:i.width,height:i.height};return(0,Z.jsx)(`div`,{style:{...i,position:`absolute`,display:`flex`,alignItems:`end`},children:(0,Z.jsx)(ha,{className:`sxl-column-button sxl-pivot-dropdown`,bounds:t,zoom:a,disabled:u,fields:l.fields.map(t=>e[t]),onPivotButtonMouseDown:n,style:{pointerEvents:`auto`}})},o)}let d=s.getStyle(),f=Fn(s);if(!f)return null;let p=Math.max(7,1|Math.round(f.size*a)),m=f.left*a,h=d.getInsets(),g=d.measureText(``),_=i.height/a,v=d.getAlignment().getVertical(),y=((v===J.VerticalAlignment.Top?2*h.top+h.bottom:v===J.VerticalAlignment.Center?(_-g.lineHeight)/2+h.top:_-g.lineHeight-h.bottom)+(g.baseline??g.lineHeight))*a+1,b=y-d.getFont().getSize()*(4/3)*.33*a,x=Math.round(Math.min(y-1,b+p/2))-p+1;return(0,Z.jsx)(`div`,{style:{...i,position:`absolute`,pointerEvents:`none`},children:(0,Z.jsx)(ga,{expanded:l.expanded,size:p,disabled:u,onToggle:()=>{let e=c.getFields()[l.field];(l.name===void 0?null:e?.getItem(l.name))?.setExpanded(!l.expanded)},style:{position:`absolute`,left:m,top:x}})},o)},[t,n]);return i.length===0?null:(0,Z.jsx)(q,{...r,className:`sxl-pivot-controls sxl-cells`,children:(0,Z.jsx)(jt,{renderCell:s,getVisibleCells:o,cacheToken:a})})});Du.displayName=`PivotLayer`;var Ou=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=qt(),{visibleTables:a}=Eu(t),[o,s]=(0,X.useState)(()=>ql(t));(0,X.useEffect)(()=>(s(ql(t)),t.getSelection().addListeners({onChange:()=>s(ql(t))})),[t]);let[c,l]=(0,X.useState)(null),u=K(e=>{let n=i.getCellFromPointer(e.clientX,e.clientY);l(n?Kl(t,w.cellToRange(n)):null)},[i,t]),d=K(()=>l(null),[]),f=je();if(a.length===0)return null;let p=[];for(let e of a){let n=e.getName();if(ju(e)){let t=e.getRange()?.getCoords();t&&p.push((0,Z.jsx)(ut,{range:t,className:bu,"aria-hidden":`true`,children:(0,Z.jsxs)(`div`,{className:xu,children:[(0,Z.jsx)(`div`,{className:Su,children:n}),(0,Z.jsx)(`div`,{className:Cu,children:f(e===o?`pivot.empty.hintInside`:`pivot.empty.hintOutside`)}),(0,Z.jsx)(Mu,{})]})},`empty-${n}`))}let r=e===c,i=e===o,a=r||i?Jl(e.getStyle(),t)??`var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0;Wl(e).forEach((e,t)=>{p.push((0,Z.jsx)(Pt,{className:`sxl-pivot-outline`,range:e,stroke:a??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:i||r?1:0,filter:r?`drop-shadow(0px 0px 1px ${a})`:void 0}}},`outline-${n}-${t}`))})}return(0,Z.jsx)(q,{...r,onMouseMove:u,onMouseLeave:d,className:n??`sxl-pivot-frame`,children:p})});Ou.displayName=`PivotFrameLayer`;var ku={transactional:!1,ignoreModelChange:!0},Au=Object.freeze([]),ju=e=>e.getRowFields().length===0&&e.getColumnFields().length===0&&e.getPageFields().length===0&&e.getDataFields().length===0,Mu=()=>(0,Z.jsxs)(`svg`,{className:wu,viewBox:`0 0 120 92`,focusable:`false`,children:[(0,Z.jsxs)(`g`,{fill:`currentColor`,children:[[0,1,2,3,4,5].map(e=>(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`rect`,{x:4,y:8+6*e,width:10,height:4.5}),(0,Z.jsx)(`rect`,{x:16,y:8+6*e,width:12,height:4.5,fillOpacity:e===0?1:.35}),(0,Z.jsx)(`rect`,{x:30,y:8+6*e,width:12,height:4.5,fillOpacity:e===0?1:.35})]},e)),(0,Z.jsx)(`rect`,{x:62,y:4,width:54,height:84,fillOpacity:.3}),(0,Z.jsx)(`rect`,{x:68,y:10,width:42,height:32,className:Tu}),[0,1,2,3].map(e=>(0,Z.jsx)(`rect`,{x:72,y:15+6*e,width:34,height:1.5,fillOpacity:.6},e)),[0,1].map(e=>[0,1].map(t=>(0,Z.jsx)(`rect`,{x:68+22*t,y:52+18*e,width:20,height:14,className:Tu},`${e}-${t}`)))]}),(0,Z.jsx)(`circle`,{cx:58,cy:56,r:18,className:Tu,stroke:`currentColor`,strokeOpacity:.3}),[0,1,2].map(e=>(0,Z.jsxs)(`g`,{stroke:`currentColor`,strokeOpacity:.7,fill:`none`,children:[(0,Z.jsx)(`rect`,{x:46,y:45+8*e,width:5,height:5,className:Tu}),(0,Z.jsx)(`line`,{x1:54,y1:47.5+8*e,x2:70,y2:47.5+8*e,strokeWidth:2,strokeOpacity:.4})]},e)),(0,Z.jsx)(`path`,{d:`M47 55.5 l1.5 1.8 l3 -3.6`,stroke:`var(--sxl-color-error, #c43e1c)`,strokeWidth:1.2,fill:`none`})]}),Nu={side:`r`,align:`start`},Pu=e=>{let{name:t,sheet:n,hovered:r,rangeOf:i,contains:a,select:o,render:s}=e,c=ue().getMode()?.key===`edit`,[l,u]=(0,X.useState)(!1),d=(0,X.useMemo)(()=>!r||r.isDeleted()?null:{range:i(r),key:r.getName(),data:r},[r,i]);return(0,Z.jsx)(ft,{name:t,hovered:d,group:!1,hold:l,openDelay:0,placement:Nu,offset:6,alignOffset:2,whenOff:`clamp`,interactive:`pointer`,dismiss:c,children:({data:e,floatProps:t,state:r})=>e.isDeleted()?null:(0,Z.jsx)(`div`,{style:{display:`contents`},onPointerDownCapture:t=>{t.button===0&&(e=>{e.isDeleted()||a(e,n.getSelectedCell().getCoords())||o(e)})(e)},children:s(e,{sheet:n,floatProps:t,setHeld:u,state:r})})})},Fu=(e,t,n)=>(0,Z.jsx)(ae,{render:e===void 0?t:e,props:n}),Iu={display:`inline-flex`,boxSizing:`border-box`,height:28,borderRadius:4,overflow:`hidden`,color:`var(--sxl-color-base-content, rgba(0, 0, 0, 0.87))`,background:`var(--sxl-color-elevated, #ffffff)`,border:`1px solid var(--sxl-color-base-border, rgba(0, 0, 0, 0.26))`,boxShadow:`0 2px 8px var(--sxl-color-shadow, rgba(0, 0, 0, 0.2))`},Lu={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,padding:0,border:`none`,background:`transparent`,color:`inherit`,cursor:`pointer`},Ru={display:`block`,width:`100%`,padding:`4px 12px`,border:`none`,background:`transparent`,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,whiteSpace:`nowrap`},zu={...Ru,opacity:.5,cursor:`default`},Bu={placement:`bottom-end`,offsets:{mainAxis:2}},Vu=e=>{let{target:t,commandKeys:n,color:r,iconKey:i,menuName:a,floatProps:o,setHeld:s}=e,c=G.useCommands([...n]),l=c[0],u=K(e=>{let{closeFloat:r}=e;return Se({...e,role:`menu`,style:{...e.style,padding:`4px 0`,fontSize:`var(--sxl-font-size, 13px)`},children:c.map((e,i)=>e?(0,Z.jsx)(`button`,{type:`button`,role:`menuitem`,style:e.disabled()?zu:Ru,disabled:e.disabled(),onClick:()=>{r?.(),e.execute(t)},children:e.getLabel()},n[i]):null)})},[c,t]),[d,f]=(0,X.useState)(null),p=De({label:a,anchor:d,renderFloatPanel:W,propsPopper:Bu,renderPopupPanel:u,onOpen:()=>s(!0),onClose:()=>s(!1)}),m=l?.getLabel()??t.getName();return(0,Z.jsxs)(`div`,{...o,role:`toolbar`,"aria-label":t.getName(),style:{...Iu,...o.style},children:[(0,Z.jsx)(`button`,{type:`button`,title:m,"aria-label":m,style:{...Lu,width:28,color:`white`,background:r},disabled:!l||l.disabled(),onClick:()=>{l?.execute(t)},children:(0,Z.jsx)(M,{iconKey:i,size:20})}),(0,Z.jsx)(`button`,{ref:f,type:`button`,"aria-haspopup":`menu`,"aria-expanded":p.isOpen,style:{...Lu,width:16},onClick:()=>{p.isOpen?p.reference.close(0):p.reference.open(0)},children:(0,Z.jsx)(M,{iconKey:`ExpandMore`,size:14})}),p.component]})},Hu=(e,t)=>Wl(e).some(e=>w.isCellWithinRange(t,e)),Uu=e=>{e.getRange().select()},Wu=(0,X.memo)(e=>{let{sheet:t,renderToolbar:n,className:r,...i}=e,a=qt(),[o,s]=(0,X.useState)(null),c=K(e=>{let n=a.getCellFromPointer(e.clientX,e.clientY);s(n?Kl(t,Gu(n)):null)},[a,t]),l=K(()=>s(null),[]);return(0,Z.jsx)(q,{onMouseMove:c,onMouseLeave:l,className:r??`sxl-pivot-toolbar`,...i,children:(0,Z.jsx)(Pu,{name:`pivot-toolbar`,sheet:t,hovered:o,rangeOf:Gl,contains:Hu,select:Uu,render:(e,t)=>Fu(n,qu,{...t,pivot:e})})})});Wu.displayName=`PivotToolbarLayer`;var Gu=e=>({rowStart:e.rowIndex,colStart:e.colIndex,rowEnd:e.rowIndex,colEnd:e.colIndex}),Ku=[`editPivotTable`,`refreshPivotTable`,`deletePivotTable`],qu=e=>(0,Z.jsx)(Vu,{target:e.pivot,commandKeys:Ku,color:Yl(e.pivot,e.sheet),iconKey:`Pivot`,menuName:`pivot-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),Ju=(0,X.memo)(e=>{let{sheet:t,sheetView:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=qt();s(t,[`onStyleChange`,`onLayoutChange`]),s(n,[`onZoomScaleChange`]);let[,l]=(0,X.useReducer)(e=>e+1,0),u=c.getVisibleRange();pr(t,(0,X.useMemo)(()=>u?{rowStart:u.rowStart,colStart:u.colStart,rowEnd:u.rowEnd,colEnd:u.colEnd}:null,[u?.rowStart,u?.colStart,u?.rowEnd,u?.colEnd]),e=>{e.getTrigger()===`data`&&l()},Xu);let d=(n?.getZoomScale()??100)/100,f=n.isShowRowGridlines()&&d>=.4,p=n.isShowColumnGridlines()&&d>=.4,m=n?.getGridLineColor(),h=t.getStyles().getNormal().getFill().getType()===_n.Type.None,g=Il(t),_=m?.toCSS(`adaptive`)??`var(--sxl-color-base-300)`,v=!!m,y=f&&h&&!g.rows,b=p&&h&&!g.columns,x=(0,X.useMemo)(()=>y?{color:_,dashArray:v?Yu:null}:null,[y,_,v]),S=(0,X.useMemo)(()=>b?{color:_,dashArray:v?Yu:null}:null,[b,_,v]),{renderLayer:C}=ci({mode:`normal`,getVisibleCells:r,getBorderAt:zl,getMergeAt:Bl,normalRows:x,normalColumns:S,cache:i});if(!x&&!S)return null;let w=c.getPaneBounds();if(w.width===0||w.height===0)return null;let T=C?.(c);return T?(0,Z.jsx)(q,{...o,className:Q(a,`sxl-gridlines`),children:(0,Z.jsx)(ut,{fill:!0,className:`sxl-gridlines-box`,style:{pointerEvents:`none`},children:T})}):null});Ju.displayName=`SheetGridLineLayer`;var Yu=Object.freeze([1,1]),Xu={transactional:!1,anchor:Vn.Type.Absolute},Zu=(0,X.lazy)(async()=>({default:(await d(async()=>{let{PictureEditor:e}=await import(`./Dx0pUf3G4Oa3dGOk.js`);return{PictureEditor:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).PictureEditor})),Qu=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i,...a}=e,s=qt(),[c,l]=(0,X.useState)(()=>n.getPicture()),u=(0,X.useMemo)(()=>{let e=n.getStyles();return e.getNormal().getFill().getType()===_n.Type.None?{backgroundColor:`var(--sxl-sys-color-window)`}:e.getNormal().getFill().toCSS(`adaptive`)},[n]);o(n,{onStyleChange:()=>{l(n.getPicture())},onInvalidated:()=>{l(n.getPicture())}});let d=s?.getPaneBounds();if(!s||!d||d.width===0||d.height===0)return null;let f=s.getBoundsFromRange({rowStart:0,colStart:0,rowEnd:0,colEnd:0});return(0,Z.jsx)(q,{...a,className:Q(r,`sxl-background`),children:(0,Z.jsx)(ut,{fill:!0,ref:t,className:`sxl-background-box`,style:{pointerEvents:`none`,...u,...i},children:c?(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(Zu,{picture:c,tile:!0,offsetX:f?.x??0,offsetY:f?.y??0})}):null})})}));Qu.displayName=`SheetBackgroundLayer`;var $u=e=>e.getSelectedRuns().map(e=>`${e.min}-${e.max}:${e.value?`A`:`s`}`).join(`|`),ed=(0,X.memo)(e=>{let{header:t,renderCell:n,invalidateToken:r,className:i,...a}=e,[s,c]=(0,X.useReducer)(e=>e+1,0),l=(0,X.useMemo)(()=>({}),[s,r]);o(t,{onMetricsChange:()=>c()},{ignoreModelChange:!0});let u=(0,X.useRef)($u(t));return o(t.getWorksheet()?.getSelection(),{onChange:()=>{let e=$u(t);e!==u.current&&(u.current=e,c())}}),(0,Z.jsx)(Gt,{...a,className:Q(i,t.getAxis()===`row`?`sxl-headers sxl-axis-row`:`sxl-headers sxl-axis-column`),renderCell:n,cacheToken:l})});ed.displayName=`SheetHeaderCellLayer`;var td=(e,t,n,r)=>{let i=e.getBoundsFromRange(t?{colStart:n,colEnd:r,rowStart:0,rowEnd:0}:{rowStart:n,rowEnd:r,colStart:0,colEnd:0});return t?{start:i.x,size:i.width}:{start:i.y,size:i.height}},nd=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,renderButton:i=fa,laneGap:a=1,bracketGap:s=0,className:c,...l}=e,u=je(),d=t.getOutline(),[f,p]=(0,X.useReducer)(e=>e+1,0);o(d,{onOutlineChange:()=>p()});let m=qt(),h=n===Y.Axis.Column,g=m.getVisibleRange(),_=d.getGroups(n,{from:h?g.colStart:g.rowStart,to:h?g.colEnd:g.rowEnd}),v=m.getPaneBounds(),y=((h?v.height:v.width)-a)/Math.max(1,r),b=ia(y,a),x=Math.max(2,Math.floor(.3*y)),S=h?t.getColumnHeaders():t.getRowHeaders(),C=d.getSummaryDirection(n),w=C===Y.Direction.Down||C===Y.Direction.Right,T=S.getEntireRange().getCoords().max,E=(0,X.useCallback)(e=>{let t=h?e.colIndex:e.rowIndex,n=S.at(t).getOutlineLevel();if(n===0||n>=r)return 0;let i=w?t-1:t+1;return i>=0&&i<=T&&S.at(i).getOutlineLevel()>n?0:n},[S,h,r,w,T]),D=(0,X.useCallback)(e=>E(e)===0,[E]),O=(0,X.useCallback)(e=>{let{key:t,cell:n,style:r,"data-rc":i}=e,o=E(n);if(o===0)return null;let s=Math.floor(rd/2),c=Math.round(a+o*y)+Math.floor((b-1)/2)-s,l=Math.floor(((h?r?.width:r?.height)??0)/2)-s;return(0,Z.jsx)(`div`,{"data-rc":i,style:{position:`absolute`,...r},children:(0,Z.jsx)(`div`,{style:{position:`absolute`,left:h?l:c,top:h?c:l,width:rd,height:rd,boxSizing:`border-box`,border:`1px solid var(--sxl-color-base-border)`,borderRadius:`50%`}})},t)},[E,y,a,b,h]),k=(0,X.useMemo)(()=>({}),[f]),[A]=pe(`outlineToggleGroup`),j=A?.disabled()??!1,M=e=>{let r=e.summary;if(A)return void A.execute({axis:n,index:r,show:e.collapsed});let i=t.getRange(h?{colStart:r,colEnd:r,rowStart:0,rowEnd:0}:{rowStart:r,rowEnd:r,colStart:0,colEnd:0});e.collapsed?i.showGroupDetails(n):i.hideGroupDetails(n)},N=(e,t)=>h?`${e},${t}`:`${t},${e}`,P=[],F=[];for(let e=0;e<_.length;e++){let t=_[e],r=Math.round(a+(t.level-1)*y),o=r+(b-1)/2+.5,c=null;t.summary!==null&&(c=td(m,h,t.summary,t.summary),c.size===0&&(c=null));let l=c?Math.round(c.start+(c.size-b)/2):null;if(!t.collapsed){let e=td(m,h,t.start,t.end);if(e.size>0){let n=t.summary===null||t.summary>t.end,r=n?e.start+1:e.start+e.size-1,i=n?e.start+e.size:e.start;l!==null&&(i=n?l-s:l+b+s),P.push(`M${N(r,o+x)}L${N(r,o)}L${N(i,o)}`)}}l!==null&&F.push((0,Z.jsx)(`div`,{style:{position:`absolute`,left:h?l:r,top:h?r:l,width:b,height:b,display:`flex`,pointerEvents:`auto`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>e.stopPropagation(),children:(0,Z.jsx)(ae,{render:i,props:{axis:n,level:t.level,collapsed:t.collapsed,size:b,title:t.collapsed?u(`outline.expand`):u(`outline.collapse`),onToggle:()=>M(t),disabled:j}})},`${t.level}:${t.start}`))}return(0,Z.jsxs)(q,{...l,className:c??`sxl-outline`,children:[(0,Z.jsx)(jt,{className:`sxl-outline-dots`,style:{pointerEvents:`none`},renderCell:O,hiddenCellAt:D,cacheToken:k}),(0,Z.jsxs)(ut,{fill:!0,style:{pointerEvents:`none`},children:[(0,Z.jsx)(`svg`,{width:`100%`,height:`100%`,style:{position:`absolute`,left:0,top:0,overflow:`visible`},children:(0,Z.jsx)(`path`,{d:P.join(``),fill:`none`,stroke:`var(--sxl-color-base-border)`,strokeWidth:1,shapeRendering:`crispEdges`})}),F]})]})});nd.displayName=`SheetOutlineLayer`;var rd=3,id={ignoreModelChange:!0},ad=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,movable:r,preview:i,onRefLoad:a,onRefUnload:s,onHide:c,onShow:l,adornmentHost:d=null,gesture:f,onUnFocus:m,isDragging:h,dragStart:g,style:_,disabled:v,renderMovable:y,...b}=e,x=qt(),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)(!1),[,E]=(0,X.useReducer)(e=>e+1,0),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=cn(r,x,i),A=k.rotation,{horizontal:j,vertical:M}=k.flip,N=(0,X.useMemo)(()=>({horizontal:j,vertical:M}),[j,M]);o(r,{onBoundsChange:()=>{E()},onAnyChange:()=>{E()},onSelectionChange:()=>{let e=!!D.current&&p.hasFocus(D.current,!0);!w&&!e||r.isSelected()||(x.focus(),m?.())}}),o(r,{onRequestFocus:()=>D.current?p.whenFocus(D.current,!0):Promise.resolve(!1)},id),(0,X.useEffect)(()=>{let e=D.current;if(e)return a(e),()=>{s(e)}},[]);let P=_?.pointerEvents??`auto`,F=x.getZoom()||1,I=(0,X.useMemo)(()=>(0,Z.jsx)(ae,{render:y,props:{movable:r,zoom:F,flip:N,disabled:v,isDragging:h,style:{position:`relative`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:P},onHide:c,onShow:l,onDragZone:e=>{O.current=e},adornmentHost:d,gesture:f}}),[x,r,F,N,v,h,P,d,f]),L=u([D,t]);return(0,Z.jsx)(`div`,{className:`sxl-movable`,tabIndex:0,ref:L,style:{display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,position:`absolute`,maxWidth:`auto`,maxHeight:`auto`,minWidth:`auto`,minHeight:`auto`,left:k.left,top:k.top,width:k.width,height:k.height,transform:A?`rotate(${A}deg)`:void 0,transformOrigin:`center`,..._,pointerEvents:`none`},onPointerDown:async e=>{let t=e.shiftKey||e.ctrlKey,n=Zt(r,e.target,e.currentTarget),i=n.isSelected(),a=e.currentTarget,o=e.nativeEvent;if(t&&i)n.unselect();else{let s=O.current?.(e.nativeEvent)??!0,c=!!e.target.closest?.(`textarea, input, [contenteditable]:not([contenteditable="false"])`),l=async()=>{i&&!t||await n.select({addToSelection:t,autoFocus:!c})},u=()=>{c||a.focus()};if(o.pointerType===`touch`&&!r.isSelected()){let e=a.ownerDocument,t=o.pointerId,n=x.getScrollTopLeft(),r=e=>{if(e.pointerId!==t)return;s();let r=x.getScrollTopLeft();Math.abs(e.clientX-o.clientX)>10||Math.abs(e.clientY-o.clientY)>10||r.left!==n.left||r.top!==n.top||l().then(u)},i=e=>{e.pointerId===t&&s()},s=()=>{e.removeEventListener(`pointerup`,r),e.removeEventListener(`pointercancel`,i)};e.addEventListener(`pointerup`,r),e.addEventListener(`pointercancel`,i);return}await l(),s&&!c&&g(o),u()}},onFocus:e=>{e.relatedTarget&&!S&&C(e.relatedTarget),T(!0)},onBlur:e=>{S&&!D?.current?.contains(e.relatedTarget)&&C(null),e.relatedTarget&&T(!1)},...b,children:I})})),od=(0,X.memo)(({movables:e,width:t,height:n})=>{let r=qt(),[i]=zt(ln,null);if(!i)return null;let a=e.getItems({deep:!0}),o=a.find(e=>e.getId()===i.connector)??null,s=new Set(o?[o]:[]);for(let e=o?.getParent();e;e=e.getParent())s.add(e);let c=[];for(let e of a){if(s.has(e)||e.isHidden()||e.isDeleted())continue;let t=e.getConnectionSites();if(!t)continue;let n=i.target===e.getId()?i.index:null;for(let i of t){let t=r.toPaneBounds({x:i.x,y:i.y,width:0,height:0}),a=i.index===n;c.push((0,Z.jsx)(`circle`,{cx:t.x,cy:t.y,r:a?5:3.5,fill:a?`var(--sxl-handle-color, rgb(33, 115, 70))`:`var(--sxl-color-base-100, white)`,stroke:`var(--sxl-handle-color, rgb(33, 115, 70))`,strokeWidth:1.5},`${e.getId()}:${i.index}`))}}return(0,Z.jsx)(`svg`,{className:`sxl-movable-connection-sites`,width:t,height:n,style:{position:`absolute`,left:0,top:0,overflow:`visible`,pointerEvents:`none`,zIndex:3002},children:c})});od.displayName=`ConnectionSites`;var sd=(e,t)=>((t?Math.round(e/t)*t:e)%360+360)%360,cd=`url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M18.4%208.5A7%207%200%201%200%2019%2013%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M18.4%208.5A7%207%200%201%200%2019%2013%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M20.5%204.5%2019.2%209.6%2014.2%208.1Z%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%221%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") 12 12, crosshair`,ld=(0,X.memo)(({isDragging:e=!1,onStart:t,onRotate:n,onEnd:r,onCancel:i,below:a=!1})=>{let o=(0,X.useRef)(null),s=(0,X.useCallback)(e=>{if(e.button!==0)return;e.stopPropagation(),e.preventDefault();let n=e.currentTarget.parentElement?.getBoundingClientRect();if(!n)return;let r={x:n.left+n.width/2,y:n.top+n.height/2},i=e.currentTarget.getBoundingClientRect();t(Math.hypot(i.left+i.width/2-r.x,i.top+i.height/2-r.y))&&(o.current={pointerId:e.pointerId,center:r,press:{x:e.clientX,y:e.clientY}},e.currentTarget.setPointerCapture(e.pointerId))},[t]),c=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(e.stopPropagation(),n(((e,t,n)=>{let r=Math.atan2(t.y-e.y,t.x-e.x),i=180*(Math.atan2(n.y-e.y,n.x-e.x)-r)/Math.PI%360;return i>180?i-360:i<=-180?i+360:i})(t.center,t.press,{x:e.clientX,y:e.clientY}),e.shiftKey))},[n]),l=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(e.stopPropagation(),o.current=null,r())},[r]),u=(0,X.useCallback)(e=>{let t=o.current;t&&t.pointerId===e.pointerId&&(o.current=null,i())},[i]);return(0,Z.jsx)(`div`,{className:[`sxl-movable-rotate-handle`,e?`sxl-dragging`:null,a?`sxl-below`:null].filter(Boolean).join(` `),style:{cursor:cd},onPointerDown:s,onPointerMove:c,onPointerUp:l,onPointerCancel:u,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`m 12.000001,0.49999989 c -6.0694556,0 -11.00000106,4.93054521 -11.00000106,11.00000111 -1.1e-7,6.069456 4.93054546,11.000001 11.00000106,11 6.046746,0 10.976832,-4.908053 11,-10.955388 v -0.216686 l -2.519506,-0.54384 v 0.715914 c 0,4.665771 -3.814723,8.480494 -8.480494,8.480494 -4.6657716,0 -8.4804952,-3.814723 -8.4804953,-8.480494 1e-7,-4.6657715 3.8147238,-8.4804953 8.4804953,-8.4804953 2.569528,0 4.854074,1.1408648 6.387988,2.9592508 l 0.01275,0.014871 -2.532252,2.0351489 4.33372,0.9092314 0.350521,0.065856 0.860371,0.1826961 1.293743,0.2676709 V 2.5139051 l -2.330438,1.8800696 -0.01275,-0.014871 C 18.366265,2.004373 15.346134,0.49999968 12.000001,0.49999989 Z`})})})});ld.displayName=`RotateHandle`;var ud=`_movable-area_2t5k8_14`,dd=e=>typeof e.getContent().acceptRotation==`function`,fd=e=>{let t=0;for(let n=e.getParent();n;n=n.getParent())t++;return t},pd=()=>{},md=`1px 1px 2px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.15))`,hd={bounds:{x:0,y:0,width:0,height:0}},gd={side:`b`,align:`end`},_d=Math.sin(Math.PI/8),vd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{movables:n,movableSelection:r,renderMovable:i,onUnFocus:a,onFocus:s,disabled:c=!1,disableDrag:l=!1,disableResize:d=!1,className:f,style:m,resizeDirections:h=[`nw`,`n`,`ne`,`w`,`e`,`sw`,`s`,`se`],onFirstRender:_,renderTip:v,...y}=e,b=qt(),x=te()===`touch`,S=b.getPaneBounds(),T=b.getVisibleRange(),E=`${T.rowStart}:${T.colStart}:${T.rowEnd}:${T.colEnd}`,D=K(_,[_]),O=K(a,[a]),k=K(s,[s]),[A,j]=(0,X.useState)(!1),[M,N]=(0,X.useState)(!1),P=(0,X.useRef)(new Map),F=(0,X.useRef)(new Map),I=()=>r.getItems().filter(e=>F.current.has(tn(e))),L=(0,X.useRef)(new Map),R=(0,X.useRef)(new Map),ee=(0,X.useRef)([]),z=(0,X.useRef)(null),[B,V]=zt(`movable-drag`,null),H=(0,X.useRef)(null),ne=(0,X.useRef)(``),U=(0,X.useCallback)(e=>{H.current=e,V(e)},[V]),W=(0,X.useCallback)(e=>{let t=ee.current;if(t.length===0)return e;let n=t=>{let n=e[t.getId()],r=n?.bounds??t.getBounds();return r?{bounds:r,rotation:n?.rotation??(t.getRotation()||0),flip:n?.flip??t.getFlip(),adjustments:n?.content?.adjustments}:null};for(let r of t){if(e[r.getId()])continue;let t=r.getContent().getConnectorFormat()?.getGluedRoute(n);if(!t)continue;let{bounds:i,rotation:a,flip:o}=t.placement;e[r.getId()]={bounds:i,rotation:a,flip:o,content:t.shapeType?{shapeType:t.shapeType,adjustments:t.adjustments}:void 0}}return e},[]),[re]=zt(`movable-hover`,null),ie=(0,X.useRef)(null);ie.current=re;let ae=()=>{let e=b.getVisibleRange(),t=n.getItems({address:e,ignoreHidden:!0,drawn:!0}),i=r.getItems().slice();ie.current&&i.push(ie.current);let a=t;for(let n=0;n<i.length;n++){let r=i[n];!r.isHidden()||r.isDeleted()||a.includes(r)||e&&!w.isRangesIntersect(r.getRange().getCoords(),e)||(a===t&&(a=t.slice()),a.push(r))}return a},[G,oe]=(0,X.useState)(()=>new Map),se=(0,X.useCallback)((e,t)=>{oe(n=>{if((n.get(e)??null)===t)return n;let r=new Map(n);return t?r.set(e,t):r.delete(e),r})},[]),ce=(0,X.useRef)(new Map),le=(0,X.useRef)({onRequestFocus:e=>(_e(e),Promise.resolve(!1))}),ue=(0,X.useRef)(null),[de,fe]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{fe()},[n]),o(n,{onCollectionChange:()=>{let e=ae(),t=ce.current;t.forEach(e=>{e()}),t.clear();let n=le.current,r=e.length;for(let i=0;i<r;i++){let r=e[i];if(r.isDeleted())continue;let a=r.addListeners(n);t.set(r,a)}fe()},onInvalidated:()=>{fe()}}),o(r,{onChange(e){e.isEmpty()&&ue.current&&p.hasFocus(ue.current,!0)&&(b.focus(),O?.()),fe()}});let[pe,me]=(0,X.useState)(!1),he=(0,X.useRef)(null),ge=(0,X.useRef)(null),_e=K(async(e=null)=>{if(e||=r.getActive(),!e)return O?.(),!1;let t=F.current.get(e)??F.current.get(tn(e));return t?(await p.whenFocus(t),t.focus(),ge.current=t,he.current=null,!0):(he.current=e,!1)},[r]);(0,X.useEffect)(()=>{D?.()},[]);let ve=K((e,t)=>{ne.current=e,L.current.clear();let n=t??I();for(let e=0;e<n.length;e++){let t=n[e],r=t.getBounds();r&&L.current.set(t,{movable:t,startBounds:b.toPaneBounds(r),startRotation:t.getRotation()||0,startFlip:t.getFlip()})}R.current.clear();let r=new Set;for(let e of L.current.keys())for(let t of[e,...e.getMovables()?.getItems({deep:!0})??[]])for(let e of t.getGluedConnectors())L.current.has(e)||r.add(e);ee.current=Array.from(r)},[b,r]),ye=(0,X.useCallback)(()=>{let e=H.current,t=L.current,r=R.current;if(L.current=new Map,R.current=new Map,ee.current=[],!e||t.size===0)return void U(null);let i=r.size>0;if(t.forEach(t=>{let n=e[t.movable.getId()];var r,a;n&&(n.bounds&&!g.isEqualBounds(n.bounds,t.movable.getBounds()??void 0)&&(i=!0),n.rotation!==void 0&&n.rotation!==sd(t.movable.getRotation()||0)&&(i=!0),n.flip&&(r=n.flip,a=t.movable.getFlip(),r.horizontal!==a.horizontal||r.vertical!==a.vertical)&&(i=!0))}),i){try{let i=t=>{let n=e[t.getId()];n?.bounds&&t.setBounds(n.bounds),n?.rotation!==void 0&&t.setRotation(n.rotation),n?.flip&&t.setFlip(n.flip),r.get(t)?.(t)},a=Array.from(t.values(),e=>e.movable);a.every(e=>e.isSelected())?n.updateSelected(i,ne.current):a[0].getRange().doBatch(()=>{for(let e of a)i(e)},ne.current)}catch(e){console.warn(e)}U(null)}else U(null)},[n,U]),be=(0,X.useCallback)(()=>{z.current?.(),z.current=null,L.current=new Map,R.current=new Map,ee.current=[],U(null)},[U]),xe=K(()=>{z.current?.(),z.current=null,j(!1),N(!1),L.current.size!==0&&ye()},[ye]),Se=K(()=>{j(!1),N(!1),be()},[be]),Ce=K((e,t,n)=>{if(c||l||e.button!==0)return;z.current?.();let r=e.target?.ownerDocument??document,i=e.pointerId,a={x:e.clientX,y:e.clientY},o=!1,s=null,u=null,d=r.documentElement,f=null,p=e=>{if(e.pointerId!==i)return;if(!(1&e.buttons))return void(o?xe():g());let c=e.clientX-a.x,l=e.clientY-a.y;if(!o){if(Math.hypot(c,l)<3)return;o=!0,f=d.style.userSelect,d.style.userSelect=`none`,r.getSelection()?.removeAllRanges(),ve(C(`op.moveMovable`),n),N(!0);let e=L.current.get(t)??L.current.values().next().value,i=b.getPanePointFromPointer(a.x,a.y);e&&i&&(s=e.movable,u={kind:`move`,at:{x:i.x-e.startBounds.x,y:i.y-e.startBounds.y}})}if(L.current.size===0)return;let p={};L.current.forEach(({movable:e,startBounds:t})=>{let n={bounds:b.toAbsoluteBounds({...t,x:t.x+c,y:t.y+l})};e===s&&u&&(n.grip=u),p[e.getId()]=n}),U(W(p))},m=e=>{e.pointerId===i&&(o?xe():g())},h=e=>{e.pointerId===i&&(g(),o&&Se())},g=()=>{r.removeEventListener(`pointermove`,p),r.removeEventListener(`pointerup`,m),r.removeEventListener(`pointercancel`,h),f!==null&&(d.style.userSelect=f),f=null,z.current===g&&(z.current=null)};r.addEventListener(`pointermove`,p),r.addEventListener(`pointerup`,m),r.addEventListener(`pointercancel`,h),z.current=g},[b,c,l,ve,xe,Se,U]),we=(0,X.useRef)(null),Te=K(e=>!c&&!d&&(ve(C(`op.resizeMovable`),e.isSelected()?void 0:[e]),we.current=e,L.current.has(e)),[c,d,ve]),Ee=K((e,t,n)=>{let r=we.current?L.current.get(we.current):void 0;if(!r)return;j(!0);let[i,a]=((e,t,n)=>{let r=-n*Math.PI/180,i=Math.cos(r),a=Math.sin(r);return[e[0]*(t[0]*i-t[1]*a),e[1]*(t[0]*a+t[1]*i)]})(e,t,r.startRotation),o=b.toPaneBounds({x:0,y:0,width:0,height:0}),s={kind:`resize`,direction:e},c={};L.current.forEach(({movable:t,startBounds:l,startRotation:u,startFlip:d})=>{let f=r.startBounds.width?i*(l.width/r.startBounds.width):i,p=r.startBounds.height?a*(l.height/r.startBounds.height):a;u||(e[0]===-1&&(f=Math.min(f,l.x-o.x)),e[0]===1&&(f=Math.max(f,o.x-l.x-l.width)),e[1]===-1&&(p=Math.min(p,l.y-o.y)),e[1]===1&&(p=Math.max(p,o.y-l.y-l.height)));let m=t.isLockAspectRatio()||n,{bounds:h,crossed:g}=((e,t,n,r,i)=>{let[a,o]=t,s=e.width+(a?n[0]:0),c=e.height+(o?n[1]:0);if(i&&a&&o&&e.width>0&&e.height>0){let t=e.width/e.height,n=s<0?-1:1,r=c<0?-1:1;Math.abs(s)>Math.abs(c)*t?c=r*Math.abs(s)/t:s=n*Math.abs(c)*t}let l=a*(s-e.width)/2,u=o*(c-e.height)/2,d=r*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=e.x+e.width/2+l*f-u*p,h=e.y+e.height/2+l*p+u*f,g=Math.abs(s),_=Math.abs(c);return{bounds:{x:m-g/2,y:h-_/2,width:g,height:_},crossed:[s<0,c<0]}})(l,e,[f,p],u,m),_={bounds:b.toAbsoluteBounds(h),grip:s},v=t.getContent();v.acceptFlip&&(_.flip=v.acceptFlip({horizontal:d.horizontal!==g[0],vertical:d.vertical!==g[1]})),c[t.getId()]=_}),U(W(c))},[b,U,W]),De=(0,X.useRef)(null),Oe=K((e,t)=>(ve(C(`op.rotateMovable`),t.isSelected()?void 0:[t]),De.current={kind:`rotate`,radius:e,below:t.getFlip().vertical},L.current.size>0),[ve]),ke=K((e,t)=>{if(L.current.size===0)return;let n=De.current??void 0,r={};L.current.forEach(({movable:i,startRotation:a})=>{let o=i.getContent();o.acceptRotation&&(r[i.getId()]={rotation:o.acceptRotation(sd(a+e,t?15:void 0)),grip:n})}),U(W(r))},[U,W]),Ae=K((e,t,n)=>!c&&!d&&(ve(t,e.isSelected()?void 0:[e]),we.current=e,!!L.current.has(e)&&(n&&R.current.set(e,n),!0)),[c,d,ve]),je=K((e,t)=>{L.current.has(e)&&(j(!0),U(W({...H.current??{},[e.getId()]:t})))},[U,W]),Me=(0,X.useRef)(new WeakMap),Ne=K(e=>{let t=Me.current.get(e);return t||(t={start:(t,n)=>Ae(e,t,n),preview:t=>je(e,t),finish:xe,cancel:Se},Me.current.set(e,t)),t},[Ae,je,xe,Se]),Fe=(0,X.useMemo)(()=>{let e=ae();if(e.length===0&&P.current.size===0&&!B)return null;let t=[],n=(n,r,a,o=!0)=>{let s=n.isSelected(),u=B?B[n.getId()]??null:null,f=!!u||s&&(M||A),p=s&&o&&!c,m=!!B||M||A,g=e=>{let n=B?B[e.getId()]??null:null,r=n?.flip??e.getFlip(),i={movable:e,flip:r,gesture:Ne(e),directions:d?[]:h,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:xe,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e),children:dd(e)?(0,Z.jsx)(ld,{isDragging:m,below:r.vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:xe,onCancel:Se}):null},a=rn(e.getContent().getType());t.push((0,Z.jsx)(sn,{movable:e,preview:n,onHost:se,children:a?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(nn,{...i}),children:(0,Z.jsx)(a,{...i})}):(0,Z.jsx)(nn,{...i})},`adornment-${e.getId()}`))},_=e=>{let n=B?B[e.getId()]??null:null;t.push((0,Z.jsx)(sn,{movable:e,preview:n,onHost:pd,children:(0,Z.jsx)(nn,{context:!0,directions:d?[]:h,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:xe,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e,[e]),children:dd(e)?(0,Z.jsx)(ld,{isDragging:m,below:(n?.flip??e.getFlip()).vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:xe,onCancel:Se}):null})},`adornment-context-${e.getId()}`))};if(p&&g(n),o&&!c){let e=n.getMovables();if(e){let t=new Set,n=[];for(let r of e.getItems({deep:!0}))if(r.isSelected()&&!r.isHidden()){n.push(r);for(let e=r.getParent();e;e=e.getParent())e.isSelected()||t.add(e)}let r=[...t].sort((e,t)=>fd(e)-fd(t));for(let e of r)_(e);for(let e of n)g(e)}}let v={tabIndex:a,movable:n,preview:u,onRefLoad:e=>{he.current===n&&(e.focus(),ge.current=e,he.current=null),F.current.set(n,e),r.rendered=!0,n.isSelected()&&fe()},onRefUnload:e=>{F.current.delete(n),r.rendered=!1,n.isSelected()&&fe()},onUnFocus:O,onHide:e=>{r.onHide=e},onShow:e=>{r.onShow=e},adornmentHost:p?G.get(n)??null:null,gesture:p?Ne(n):void 0,isDragging:f,disabled:c,renderMovable:i,dragStart:e=>Ce(e,n),style:{opacity:u?.7:o?A&&s?.7:void 0:0,zIndex:f?n.getZIndex()+e.length:void 0,pointerEvents:o?void 0:`none`,cursor:M&&s?`grabbing`:c||l?`initial`:`move`,touchAction:!s||c||l?void 0:`none`,boxShadow:s&&(!M||A)&&an(n.getContent().getType())?md:void 0}};return(0,Z.jsx)(ad,{...v},`movable-${n.getId()}`)},a=P.current,o=new Map,s=[],u=()=>({frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;let n=++t.visibilityRequestId;requestAnimationFrame(()=>{let r=P.current.get(e);r&&n===t.visibilityRequestId&&(t.onShow?.(e),r.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;let n=++t.visibilityRequestId,r=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==r&&(t.shown=!1,P.current.delete(e),fe())},visibilityRequestId:0}),f=e.length;for(let t=0;t<f;t++){let r=e[t];if(r.isDeleted())continue;let i=a.get(r)??u();i.previewOnly=!1,i.frame=n(r,i,t,!0),s.push(i.frame),i.doShow(r,i),a.delete(r),o.set(r,i)}let p=[];return r.getItems().forEach(e=>{if(o.has(e))return;let t=a.get(e),r=!!B?.[e.getId()];if(t){if(t.previewOnly&&!r)return}else{if(!r)return;t=u(),t.previewOnly=!0}t.frame=n(e,t,-1,!1),p.push(t.frame),a.delete(e),o.set(e,t)}),a.forEach((e,t)=>{e.frame=n(t,e,-1,!1),p.push(e.frame),e.doHide(t,e),a.delete(t),o.set(t,e)}),P.current=o,{frames:[...p,...s],adornments:t}},[de,b,E,B,re,i,c,l,d,h,A,M,G,se]),Ie=(0,X.useRef)(null);(0,X.useEffect)(()=>{Ie.current&&(Ie.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[Ie.current]);let Le=I(),Re=Le.map(e=>e.getId()).join(`,`);(0,X.useEffect)(()=>{let e=Le[0]?F.current.get(Le[0]):void 0;pe&&e&&ge.current!==e&&!e.contains(e.ownerDocument.activeElement)&&_e()},[Re]);let ze=Ue(t,()=>({isMovableLayer:()=>!0,focusMovable:_e,focus:()=>{_e()}}),[r]),[Be,Ve]=(0,X.useState)(null),He=(0,X.useCallback)(e=>{e&&Ve(e)},[]),We=null,Ge=null;if(v&&B){let e=Object.keys(B),t=we.current,n=e.find(e=>B[e].grip?.kind===`move`)??(t&&B[t.getId()]?t.getId():e[0]),i=n?Array.from(L.current.keys()).find(e=>e.getId()===n)??r.getItems().find(e=>e.getId()===n):void 0,a=n?B[n]:void 0,o=i?.getBounds();if(i&&a&&o){let e=a.grip??null;We={kind:e?.kind??`move`,movable:i,bounds:a.bounds??o,rotation:a.rotation??sd(i.getRotation()||0)},Ge=((e,t,n,r)=>{let i=n.toPaneBounds(e.bounds);if(!t)return{anchor:{bounds:i},placement:gd};if(t.kind===`move`){let e=i.x+t.at.x,n=i.y+t.at.y;return r?{anchor:{bounds:{x:e,y:n,width:0,height:0}},placement:{side:`t`,align:`center`}}:{anchor:{bounds:{x:e,y:n-10,width:10,height:20}},placement:{side:`b`,align:`start`}}}let[a,o]=t.kind===`resize`?t.direction:[0,t.below?1:-1],s=t.kind===`resize`?a*i.width/2:0,c=t.kind===`resize`?o*i.height/2:o*t.radius,l=e.rotation*Math.PI/180,u=Math.cos(l),d=Math.sin(l),f=i.x+i.width/2+s*u-c*d,p=i.y+i.height/2+s*d+c*u,m=Math.hypot(a,o)||1,h=(a*u-o*d)/m,g=(a*d+o*u)/m,_=e=>e>_d?`start`:e<-_d?`end`:`center`;return{anchor:{bounds:{x:f,y:p,width:0,height:0}},placement:Math.abs(g)>=Math.abs(h)?{side:g<0?`t`:`b`,align:_(h)}:{side:h<0?`l`:`r`,align:_(g)}}})(We,e,b,x)}}let Ke=u([ze,Ie,He]);return Fe?(0,Z.jsxs)(q,{className:Q(f,`sxl-movable-area`),onPointerDown:e=>{e.button!==0&&e.button!==2||r.isEmpty()||(r.clear(),O?.())},children:[(0,Z.jsx)(ut,{fill:!0,className:ud,style:{pointerEvents:`none`,...m,overflow:`hidden`,willChange:`transform`},ref:Ke,...y,children:(0,Z.jsx)(`div`,{className:`sxl-movable-scroll`,style:{position:`absolute`,left:0,top:0,width:S.width,height:S.height},...y,children:(0,Z.jsx)(`div`,{ref:ue,style:{position:`absolute`,pointerEvents:`auto`},onFocus:e=>{k?.(),me(!0)},onBlur:e=>{me(!1)},onKeyDownCapture:e=>{e.isDefaultPrevented()||e.which===Pe.Escape&&L.current.size>0&&(Se(),e.preventDefault(),e.stopPropagation())},onPointerDown:e=>{e.stopPropagation()},onDoubleClick:e=>{e.stopPropagation()},children:(0,Z.jsxs)(on.Provider,{value:G,children:[Fe.frames,Fe.adornments,(0,Z.jsx)(od,{movables:n,width:S.width,height:S.height})]})})})}),v&&(0,Z.jsx)(mt,{name:`movable-gesture`,active:We!==null,anchor:Ge?.anchor??hd,placement:Ge?.placement,offset:x?36:We?.kind===`move`?4:void 0,alignOffset:x||We?.kind!==`move`?void 0:2,children:We?v(We):null})]}):null})),yd=e=>{let{movable:t}=e;if(!t)return(0,Z.jsx)(Z.Fragment,{});let n=Qt(t.getContent().getType());return n?n(e):(0,Z.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,clipPath:`inset(0px)`,display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,pointerEvents:`all`},children:(0,Z.jsx)(dn,{...e})},t.getId())},bd=`workbookToolbars`,xd=new Map;function Sd(e){let t=e.key.toLowerCase(),n=xd.get(t)??0;n===0&&G.DefaultCommandButtonRegistry.register(e,!0),xd.set(t,n+1);let r=!1;return()=>{if(r)return;r=!0;let e=(xd.get(t)??1)-1;e>0?xd.set(t,e):(xd.delete(t),G.DefaultCommandButtonRegistry.get(t)&&G.DefaultCommandButtonRegistry.unregister(t))}}var Cd=e=>`${e}Toolbar`;function wd(e,t){return{key:Cd(e),contributions:{[bd]:{order:1}},getLabel:()=>t,members:[`moveForwardOptions`,`moveBackwardOptions`,`-`,`drawAlignOptions`,`drawGroupOptions`,`drawFlipOptions`,`-`,`drawSizingOptions`,`toggleLockAspectRatio`,`-`,`formatMovable`]}}var Td=!1;function Ed(){if(Td)return;Td=!0;let e=G.DefaultCommandButtonRegistry;e.register({key:`moveForwardOptions`,defaultKey:`moveToFront`,members:[`moveToFront`,`moveForward`]},!0),e.register({key:`moveBackwardOptions`,defaultKey:`moveToBack`,members:[`moveToBack`,`moveBackward`]},!0),e.register({key:`drawAlignOptions`,members:[`formatDrawAlignLeft`,`formatDrawAlignCenter`,`formatDrawAlignRight`,`-`,`formatDrawAlignTop`,`formatDrawAlignMiddle`,`formatDrawAlignBottom`,`-`,`formatDrawDistributeHorz`,`formatDrawDistributeVert`]},!0),e.register({key:`drawFlipOptions`,members:[`formatDrawFlipHorizontal`,`formatDrawFlipVertical`]},!0),e.register({key:`drawGroupOptions`,members:[`groupDrawings`,`ungroupDrawings`]},!0),e.register({key:`drawSizingOptions`,members:[`formatAnchorTypeTwoCell`,`formatAnchorTypeOneCell`,`formatAnchorTypeAbsolute`]},!0),e.register({key:`arrangeOptions`,members:[`moveForwardOptions`,`moveBackwardOptions`,`-`,`drawAlignOptions`,`drawGroupOptions`,`drawFlipOptions`,`-`,`drawSizingOptions`]},!0)}function Dd(e){let{getTitle:t,getIcon:n,key:r}=e;return{...e,getTitle:()=>{let n=(e=>{let t=G.DefaultCommandRegistry.findByKey(e)?.def;return typeof t?.label==`string`?t.label:A.lookup(`cmd.${e}.label`)??void 0})(r);return t?t.call(e,n):n??r},getIcon:()=>{let t=(e=>{let t=G.DefaultCommandRegistry.findByKey(e)?.def;return typeof t?.icon==`string`?t.icon:void 0})(r);return n?n.call(e,t):t}}}var Od=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){let n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw Error(`Task pane with key '${n}' is already registered.`);let r=Dd(e);return this._taskPanes.set(n,r),()=>{this._taskPanes.get(n)===r&&this._taskPanes.delete(n)}}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return g.EmptyArray;let t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,``);for(let n of this._taskPanes.values()){let r=n.contributionPoints;if(r&&r.length!==0)for(let i of r)i=i.toLowerCase().replace(/\/+$/g,``),i.startsWith(e)&&t.push(n)}return t}},kd={FormatCells:`formatCells`,Comments:`comments`,TableDetails:`tableDetails`,ConditionalFormat:`conditionalFormatDetails`,DataValidation:`dataValidationDetails`,Protection:`manageProtection`,Names:`managedNames`,ExternalLinks:`externalLinks`,PivotTable:`pivotTableFields`,CellControl:`formatCellControl`,FormatMovable:`formatMovable`},Ad={TaskPaneArea:`_TaskPaneArea_uwth8_5`,TaskPaneTitle:`_TaskPaneTitle_uwth8_13`,TaskPaneFrame:`_TaskPaneFrame_uwth8_36`,TaskPaneAreaFrames:`_TaskPaneAreaFrames_uwth8_55`,TaskPaneAreaFrameHost:`_TaskPaneAreaFrameHost_uwth8_63`,TaskPaneAreaFrameHidden:`_TaskPaneAreaFrameHidden_uwth8_71`,TaskPaneStrip:`_TaskPaneStrip_uwth8_75`,TaskPaneStripItem:`_TaskPaneStripItem_uwth8_88`,TaskPaneStripItemIcon:`_TaskPaneStripItemIcon_uwth8_117`,TaskPaneStripItemLabel:`_TaskPaneStripItemLabel_uwth8_127`,TaskPaneStripItemLabelOpen:`_TaskPaneStripItemLabelOpen_uwth8_134`,TaskPaneStripItemLabelClip:`_TaskPaneStripItemLabelClip_uwth8_139`,TaskPaneStripItemLabelText:`_TaskPaneStripItemLabelText_uwth8_146`,MovablePane:`_MovablePane_uwth8_152`,MovablePaneKind:`_MovablePaneKind_uwth8_166`,MovablePaneEmpty:`_MovablePaneEmpty_uwth8_171`},jd=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=je(),[,d]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!c)return;let e=c.getView().addListeners({onMovableSelectionChange:d}),t=en(d);return()=>{e(),t()}},[c]);let f=c?.getView().getMovableSelection().getActive()??null,p=f?.getContent(),m=p?.getType(),h=m?$t(m):void 0,g;if((0,X.useEffect)(()=>{m&&!h&&Xt(m)},[m,h]),c&&f&&p){if(h?.pane){let e=h.pane;g=(0,Z.jsx)(e,{movable:f,sheet:c},p.getId())}else g=(0,Z.jsx)(`div`,{className:Ad.MovablePaneEmpty,children:u(`movable.pane.none`,{kind:p.getTypeDescription()})})}else g=(0,Z.jsx)(`div`,{className:Ad.MovablePaneEmpty,children:u(`movable.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-movable-pane`,o,Ad.MovablePane),...s,children:[p?(0,Z.jsx)(`div`,{className:Ad.MovablePaneKind,children:p.getTypeDescription()}):null,g]})};function Md(){Od.getRegisteredTaskPane(kd.FormatMovable)||Od.registerTaskPane({key:kd.FormatMovable,component:jd})}var Nd=e=>{let t=2**53-1,n=2**53-1,r=0,i=0;for(let a of e){let e=a.getBounds();e&&(t=Math.min(e.x,t),n=Math.min(e.y,n),r=Math.max(e.x+e.width,r),i=Math.max(e.y+e.height,i))}return{x:t,y:n,width:r-t,height:i-n}},Pd=(e,t=!0)=>{let n=[],r=t?`x`:`y`,i=t?`y`:`x`,a=t?`width`:`height`,o=0,s=2**53-1,c=0;for(let t of e){let e=t.getBounds();e&&(o+=e[a],s=Math.min(e[r],s),c=Math.max(e[r]+e[a],c),n.push({bounds:e,movable:t}))}let l=(c-s-o)/(e.length-1);n.sort((e,t)=>e.bounds[r]===t.bounds[r]?e.bounds[i]-t.bounds[i]:e.bounds[r]-t.bounds[r]);let u=new Map;u.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){let t=n[e-1].bounds,i={...n[e].bounds};i[r]=t[r]+t[a]+l,n[e].bounds=i,u.set(n[e].movable,i)}return u.set(n[n.length-1].movable,n[n.length-1].bounds),u},Fd=e=>t=>{if(!t.getContent().acceptFlip)return;t.setFlip({[e]:!t.getFlip()[e]});let n=t.getRotation()%360;n&&t.setRotation((360-n)%360)},Id=e=>{let t=e.getContent();return!0===t?.isIGroup?t:null},Ld=(e,t)=>n=>{let r=n.getBounds();r&&n.setBounds({x:r.x+e,y:r.y+t})},Rd=(e,t)=>n=>{let r=n.getBounds();if(!r)return;let i=t?1+e:1/(1+e),a=Math.sqrt(r.width**2+r.height**2),o=Math.atan2(r.height,r.width),s=i*a;if(s<10)return;let c=s*Math.cos(o),l=s*Math.sin(o);n.setBounds({x:r.x+(r.width-c)/2,y:r.y+(r.height-l)/2,width:c,height:l})},zd=e=>t=>{t.setRotation(t.getRotation()+e)};function Bd(e,t){let n=t.sheet;if(!n)return()=>{};let r=t,i=r?.notifier,a=r?.editModeHandler,o=(t,r,o,s)=>{e.updateCommand(t,{tags:[`noTransaction`,`noRepeat`],callback:()=>((e,t,r)=>{let o=n.getView().getMovableSelection();if(!o.isEmpty())try{n.doBatch(()=>{let e=o.getItems();if(e.length===0)return;let n=r?.(e);for(let r of e)t(r,n)},{description:e}),a?.setMode(null)}catch(e){i?.showError?.(e)}})(r,o,s)})},s=null,c=null,l=e=>{e!==s&&(c?.(),c=e?.addListeners({onAnyChange:u,onInvalidated:u},{transactional:!1})??null,s=e)},u=()=>{let t=n.getView().getMovableSelection(),r=t.getItems(),i=t.getActive();l(i),e.updateCommand(`groupDrawings`,{disabledReasons:r.length<2?[C(`reason.groupNeedsTwo`)]:[]}),e.updateCommand(`ungroupDrawings`,{disabledReasons:r.some(e=>Id(e)!==null)?[]:[C(`reason.noGroupSelected`)]});let a=r.some(e=>!!e.getContent().acceptFlip)?[]:[C(`reason.cannotFlip`)];e.updateCommand(`formatDrawFlipHorizontal`,{disabledReasons:a}),e.updateCommand(`formatDrawFlipVertical`,{disabledReasons:a}),e.updateCommand(`formatAnchorTypeTwoCell`,{state:i?.getAnchorType?.()===Vn.Type.TwoCell}),e.updateCommand(`formatAnchorTypeOneCell`,{state:i?.getAnchorType?.()===Vn.Type.OneCell}),e.updateCommand(`formatAnchorTypeAbsolute`,{state:i?.getAnchorType?.()===Vn.Type.Absolute}),e.updateCommand(`toggleLockAspectRatio`,{state:i?.isLockAspectRatio()??!1});let o=i?.getFlip();e.updateCommand(`formatDrawFlipHorizontal`,{state:o?.horizontal??!1}),e.updateCommand(`formatDrawFlipVertical`,{state:o?.vertical??!1}),d()},d=()=>{f&&e.updateCommand(kd.FormatMovable,{state:r.taskPaneArea?.getActive()===kd.FormatMovable})},f=!1,p=()=>{if(n.getView().getMovableSelection().isEmpty())return f&&=(e.remove(),!1),void l(null);f||=((()=>{o(`moveToFront`,C(`op.bringToFront`),e=>e.moveToFront()),o(`moveForward`,C(`op.bringForward`),e=>e.moveForward()),o(`moveToBack`,C(`op.sendToBack`),e=>e.moveToBack()),o(`moveBackward`,C(`op.sendBackward`),e=>e.moveBackward()),o(`toggleLockAspectRatio`,C(`op.lockAspectRatio`),e=>e.setLockAspectRatio(!e.isLockAspectRatio())),o(`formatAnchorTypeTwoCell`,C(`op.anchor`),e=>e.setAnchorType(Vn.Type.TwoCell)),o(`formatAnchorTypeOneCell`,C(`op.anchor`),e=>e.setAnchorType(Vn.Type.OneCell)),o(`formatAnchorTypeAbsolute`,C(`op.anchor`),e=>e.setAnchorType(Vn.Type.Absolute)),o(`formatDrawAlignLeft`,C(`op.alignLeft`),(e,t)=>e.setBounds({x:t.x}),Nd),o(`formatDrawAlignCenter`,C(`op.alignCenter`),(e,t)=>e.setBounds({x:(t.width-e.getBounds().width)/2+t.x}),Nd),o(`formatDrawAlignRight`,C(`op.alignRight`),(e,t)=>e.setBounds({x:t.width-e.getBounds().width+t.x}),Nd),o(`formatDrawAlignTop`,C(`op.alignTop`),(e,t)=>e.setBounds({y:t.y}),Nd),o(`formatDrawAlignMiddle`,C(`op.alignMiddle`),(e,t)=>e.setBounds({y:(t.height-e.getBounds().height)/2+t.y}),Nd),o(`formatDrawAlignBottom`,C(`op.alignBottom`),(e,t)=>e.setBounds({y:t.height-e.getBounds().height+t.y}),Nd),o(`formatDrawDistributeHorz`,C(`op.distributeHorizontally`),(e,t)=>e.setBounds(t.get(e)),e=>Pd(e,!0)),o(`formatDrawDistributeVert`,C(`op.distributeVertically`),(e,t)=>e.setBounds(t.get(e)),e=>Pd(e,!1)),o(`formatDrawNudgeLeft`,C(`op.nudgeMovable`),Ld(-1,0)),o(`formatDrawNudgeRight`,C(`op.nudgeMovable`),Ld(1,0)),o(`formatDrawNudgeUp`,C(`op.nudgeMovable`),Ld(0,-1)),o(`formatDrawNudgeDown`,C(`op.nudgeMovable`),Ld(0,1)),o(`formatDrawNudgeLeftLarge`,C(`op.nudgeMovable`),Ld(-10,0)),o(`formatDrawNudgeRightLarge`,C(`op.nudgeMovable`),Ld(10,0)),o(`formatDrawNudgeUpLarge`,C(`op.nudgeMovable`),Ld(0,-10)),o(`formatDrawNudgeDownLarge`,C(`op.nudgeMovable`),Ld(0,10)),o(`formatDrawSizeIncrease`,C(`op.resizeMovable`),Rd(.1,!0)),o(`formatDrawSizeDecrease`,C(`op.resizeMovable`),Rd(.1,!1)),o(`formatDrawRotateLeft`,C(`op.rotateMovable`),zd(-10)),o(`formatDrawRotateRight`,C(`op.rotateMovable`),zd(10)),o(`formatDrawFlipHorizontal`,C(`op.flipMovable`),Fd(`horizontal`)),o(`formatDrawFlipVertical`,C(`op.flipMovable`),Fd(`vertical`)),e.updateCommand(`groupDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=n.getView().getMovableSelection(),t=e.getItems();if(!(t.length<2))try{await(e.getContainer()?.getMovables()??n.getMovables()).group(t),a?.setMode(null)}catch(e){i?.showError?.(e)}}}),e.updateCommand(`ungroupDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=n.getView().getMovableSelection().getItems().map(Id).filter(e=>!!e);if(e.length!==0)try{await n.doBatch(async()=>{for(let t of e)await t.ungroup()},{description:C(`op.ungroupDrawings`)}),a?.setMode(null)}catch(e){i?.showError?.(e)}}}),o(`deleteDrawings`,C(`op.deleteMovable`),e=>e.getContent().delete()),e.updateCommand(`selectAllDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n.getView().getMovableSelection(),t=n.getMovables().getItems().filter(e=>e.getContent().getType()!==`note`||!e.isHidden()),r=e.getActive(),i=!!r&&t.includes(r);e.select(i?[...t.filter(e=>e!==r),r]:t)}});let t=e=>{n.getView().getMovableSelection().traverse(e).getActive()?.select({scrollIntoView:!0})};e.updateCommand(`selectNextDrawing`,{tags:[`noTransaction`,`noRepeat`],callback:()=>t(!1)}),e.updateCommand(`selectPreviousDrawing`,{tags:[`noTransaction`,`noRepeat`],callback:()=>t(!0)}),e.updateCommand(kd.FormatMovable,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Md(),r.activateTaskPane?.(kd.FormatMovable)}}),e.updateCommand(`clearDrawingSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{n.getView().getMovableSelection().clear()}})})(),!0),u()};p();let m=n.getView().addListeners({onMovableSelectionChange:p}),h=r.taskPaneArea?.addListener({onChange:d});return()=>{m(),h?.(),l(null)}}var Vd=(0,X.createContext)(void 0),Hd={activate(e,t){console.warn(`No TaskPaneArea available to activate task pane`,e,t)},canActivate:e=>!1,getActive:()=>null,getOpen:()=>g.EmptyArray,close:e=>g.DonePromise,addListener:()=>()=>{}},Ud=(e=!1)=>{let t=(0,X.useContext)(Vd),[n,r]=(0,X.useReducer)(e=>e+1,0);return(0,X.useEffect)(()=>{if(!e&&t)return t.addListener({onChange:()=>{r()}})},[t]),t||Hd},Wd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,title:r,icon:i,onClose:a,readOnly:o,focused:s,side:c=`right`,style:l,className:u,...d}=e,f=(0,X.useMemo)(()=>Q(`sxl-taskpane-title`,u,Ad.TaskPaneTitle,{"sxl-focused":s}),[u,s]);return(0,Z.jsxs)(`div`,{ref:t,className:f,style:l,...d,children:[(0,Z.jsx)(`div`,{className:`sxl-title`,style:{flex:`1 1 100%`},children:r}),(0,Z.jsx)(`div`,{"aria-label":`close`,role:`button`,style:{width:24,height:24,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},onPointerDown:e=>{e.stopPropagation()},onPointerUp:()=>{a()},children:(0,Z.jsx)(`div`,{style:{fontSize:`0.7em`},children:`✕`})})]})}));Wd.displayName=`TaskPaneTitle`;var Gd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,entry:r,close:i,listenerContainer:a,model:o,args:s,onMounted:c,onUnmounted:l,wrapperPane:u,propsPane:d,componentTitle:f=Wd,style:p,className:m,...h}=e,[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),b=K(i,[i]),x=ne(),S=(0,X.useRef)(null),C=(0,X.useRef)(null);(0,X.useEffect)(()=>(c?.(r),()=>{l?.(r)}),[r]);let w=(0,X.useRef)([]),T=(0,X.useMemo)(()=>({addListener:e=>{let t=a?.(e)??(()=>{});return w.current.push(t),t},close:()=>{b?.()},focus:e=>{S.current?.focus(e)}}),[a]);(0,X.useEffect)(()=>()=>{for(let e of w.current)e();w.current=[]},[]);let E=(0,X.useMemo)(()=>{let e=r.componentTitle??f;return(0,Z.jsx)(e,{ref:C,title:r.getTitle(),icon:null,readOnly:!1,focused:v!==null,onClose:b,onPointerDown:e=>{}})},[r,f,v,x]),D=(0,X.useMemo)(()=>{let e=r.component,n=u,i=(0,Z.jsx)(e,{entryKey:r.key,model:o,args:s,frame:T,ref:t,...d});return n&&(i=(0,Z.jsx)(n,{children:i})),i},[r,o,s,T,t,u]);return(0,Z.jsxs)(`div`,{className:Q(`sxl-taskpane-frame`,m,Ad.TaskPaneFrame),tabIndex:0,ref:S,style:p,onPointerDown:async e=>{let t=e.currentTarget;t.contains(document.activeElement)||t.focus()},onFocus:e=>{e.relatedTarget&&!g&&_(e.relatedTarget),y(e.currentTarget)},onBlur:e=>{g&&!S?.current?.contains(e.relatedTarget)&&_(null),e.relatedTarget&&y(null)},...h,children:[(0,Z.jsx)(`div`,{style:{flex:`0 0 auto`,display:`flex`,flexDirection:`column`,width:`100%`,alignItems:`stretch`,justifyContent:`stretch`},children:E}),(0,Z.jsx)(`div`,{className:`sxl-taskpane-frame-content`,style:{flex:`1 1 auto`,minHeight:0,width:`100%`,overflow:`auto`,height:`100%`,display:`flex`},children:D})]})}));Gd.displayName=`TaskPaneFrame`;var Kd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,title:r,side:i=`right`,taskPanes:a,onSelect:o,selected:s,registry:c=Od,style:l,iconsOnly:u,className:d,...f}=e,p=ne(),m=(0,X.useMemo)(()=>a.map(e=>{let t=c.getRegisteredTaskPane(e);if(!t)return null;let n=t.getIcon?.();typeof n==`string`&&(n=(0,Z.jsx)(M,{iconKey:n}));let r=t.getTitle(),i=e===s,a=!n||!u&&i;return(0,Z.jsxs)(`div`,{title:a?void 0:r,className:Q(`sxl-taskpane-strip-item`,Ad.TaskPaneStripItem,{"sxl-selected":i}),onClick:()=>o(e),children:[n?(0,Z.jsx)(`span`,{className:Ad.TaskPaneStripItemIcon,children:n}):null,(0,Z.jsx)(`span`,{className:Q(Ad.TaskPaneStripItemLabel,{[Ad.TaskPaneStripItemLabelOpen]:a}),children:(0,Z.jsx)(`span`,{className:Ad.TaskPaneStripItemLabelClip,children:(0,Z.jsx)(`span`,{className:Ad.TaskPaneStripItemLabelText,children:r})})})]},e)}),[a,s,o,c,u,p]),h=Ue(t,()=>({isTaskPaneStrip:()=>!0}),[]),g=(0,X.useMemo)(()=>Q(`sxl-taskpane-strip`,d,Ad.TaskPaneStrip),[d]);return(0,Z.jsx)(`div`,{ref:h,className:g,style:l,...f,children:m})}));Kd.displayName=`TaskPaneStrip`;var qd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n=``,registry:r=Od,model:i,onOpen:a,onClose:o,wrapperPane:s,propsPane:c,wrapperFrame:l,propsFrame:u,componentTitle:d,componentStrip:f=Kd,alwaysShowStrip:p,side:m=`right`,style:h}=e,g=m!==`right`,_=K(a,[a]),v=K(o,[o]),[y,b]=(0,X.useState)(null),x=(0,X.useRef)(null),[S,C]=(0,X.useState)([]),[w,T]=(0,X.useState)({}),E=K((e,t)=>{T(n=>{if(n[e]===t)return n;let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},[]),D=(0,X.useRef)(new Set),O=(0,X.useRef)(new Set),k=K(()=>{let e=Array.from(O.current);for(let t of e)try{t.onChange?.()}catch(e){console.error(`Error in TaskPaneArea listener:`,e)}},[]),A=K(async(e,t=!1)=>{let n=Array.from(D.current),r=n.length,i=!0;for(let e=0;i&&e<r;e++){let t=n[e];if(t.onBeforeHide)try{!1===await Promise.resolve(t.onBeforeHide())&&(i=!1)}catch{i=!1}}return i},[]),j=K(e=>{let t=Array.from(D.current),n=t.length,r=S.findIndex(t=>t.key===e);if(r===-1)return;let i=[...S];if(i.splice(r,1),E(e,void 0),C(i),i.length===0)b(null),x.current=null,v?.();else{let e=i[Math.min(r,i.length-1)];b(e),x.current=e.key,e.keepMounted&&requestAnimationFrame(()=>e.refPaneEl?.current?.focus?.())}for(let e=0;e<n;e++){let n=t[e];try{n.onHide?.()}catch{}}},[v,S]),M=K(async(e,t)=>{let n=r.getRegisteredTaskPane(e);if(!n)return void console.warn(`Invalid taskpane '${e}'`);let a=x.current===e,o=S.find(t=>t.key===e);if(a&&!o)return void E(e,t?.args);if(!a&&y&&!await A(y.key))return;if(o)return E(e,t?.args),b(o),x.current=e,void((o.keepMounted||a)&&requestAnimationFrame(()=>o.refPaneEl?.current?.focus?.()));E(e,t?.args);let l=(0,X.createRef)(),f={current:null},p={key:e,elem:(0,Z.jsx)(Gd,{ref:e=>{f.current=e,e===null&&(x.current=null)},entry:n,model:i,close:async()=>{await A(e)&&j(e)},wrapperPane:s,propsPane:c,componentTitle:d,listenerContainer:e=>(D.current.add(e),()=>{D.current.delete(e)}),onMounted:t=>{t.key===e&&(x.current=null),_?.()},onUnmounted:e=>{},...u}),ref:l,keepMounted:n.keepMounted,refPaneEl:f};C(t=>{if(t.findIndex(t=>t.key===e)!==-1)return t;let n=[...t];return n.push(p),n}),b(p),x.current=e},[y,S,c,d]);(0,X.useEffect)(()=>{y&&!x.current&&M(y.key,{args:w[y.key]}),k()},[u,i,S,y,w]);let N=Ue(t,()=>{let e=Object.freeze(S.map(e=>e.key));return{activate:M,canActivate:e=>r.getRegisteredTaskPane(e)!==null,getActive:()=>y?.key??null,getOpen:()=>e,async close(e){await A(e)&&j(e)},addListener:e=>(O.current.add(e),()=>{O.current.delete(e)})}},[r,c,i,y,S]),P=(0,X.useMemo)(()=>{if(S.length<=1&&!p)return null;let e={className:Ad.TaskPaneAreaStrip,taskPanes:Object.freeze(S.map(e=>e.key)),selected:y?.key,side:m,onSelect:e=>{M(e)},registry:r};return(0,Z.jsx)(f,{...e})},[S,y,r,p,m,f]),F=e=>(0,X.cloneElement)(e.elem,{model:i,args:w[e.key],propsPane:c,wrapperPane:s,componentTitle:d,...u}),I=y?.key??null,L=l,R=S.length===0?null:(0,Z.jsx)(`div`,{className:Ad.TaskPaneAreaFrames,style:{display:`flex`,flex:`1 1 100%`,minWidth:0,minHeight:0,position:`relative`},children:S.map(e=>{let t=e.key===I;return t||e.keepMounted?(0,Z.jsx)(`div`,{className:Q(Ad.TaskPaneAreaFrameHost,!t&&Ad.TaskPaneAreaFrameHidden),style:{display:t?`flex`:`none`,flex:`1 1 100%`,minWidth:0,minHeight:0},children:L?(0,Z.jsx)(L,{children:F(e)}):F(e)},e.key):null})}),ee=g?P:R,te=g?R:P;return(0,Z.jsxs)(`div`,{ref:N,className:Q(`sxl-taskpane-area`,n,Ad.TaskPaneArea),style:h,children:[ee,te]})}));qd.displayName=`TaskPaneArea`;var Jd=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=je(),[,d]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!c)return;let e=c.getSelection().addListeners({onChange:d}),t=c.addListeners({onCellControlsChange:d}),n=Gr(d);return()=>{e(),t(),n()}},[c]);let f=c?(e=>{let t=e.getSelection().getCell(),n=t.getControl();return n?{cell:t,entry:Ur(n.getType())??null,control:n}:{cell:t,entry:Wr(t)?.entry??null,control:null}})(c):null,p;if(c&&f?.entry){if(f.entry.pane){let e=f.entry.pane;p=(0,Z.jsx)(e,{sheet:c,cell:f.cell,control:f.control},f.cell.getAddress())}else p=(0,Z.jsx)(`div`,{className:Ad.MovablePaneEmpty,children:u(`cellControl.pane.none`)})}else p=(0,Z.jsx)(`div`,{className:Ad.MovablePaneEmpty,children:u(`cellControl.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-cell-control-pane`,o,Ad.MovablePane),...s,children:[f?.control?(0,Z.jsx)(`div`,{className:Ad.MovablePaneKind,children:f.control.getType()}):null,p]})};function Yd(){Od.getRegisteredTaskPane(kd.CellControl)||Od.registerTaskPane({key:kd.CellControl,component:Jd})}var Xd=xe.isEditable,Zd=[`copy`,`cut`,`paste`,`selectAll`,`undo`,`redo`];function Qd(e){let{clipboard:t}=e,n=new Set(e.keys??Zd);return(e,r)=>{if(!n.has(e)||!Xd(r))return;let i=r;switch(e){case`copy`:return{callback:()=>async function(e,t){let n=nf(e);n&&await t.writeText(n)}(i,t.getClipboard()),disabledReasons:ef(i)?[]:[C(`reason.noSelection`)]};case`cut`:return{callback:()=>async function(e,t){let n=nf(e);n&&(await t.writeText(n),function(e){if(!(typeof document<`u`&&document.execCommand(`delete`))&&$d(e)){let t=e.selectionStart??0,n=e.selectionEnd??t;if(t===n)return;e.setRangeText(``,t,n,`end`),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}}(e))}(i,t.getClipboard()),disabledReasons:ef(i)?[]:[C(`reason.noSelection`)]};case`paste`:return{callback:()=>async function(e,t){let n=await t.readText();n&&function(e,t){if($d(e)){let n=e.selectionStart??e.value.length;xe.replaceRangeText(e,n,e.selectionEnd??n,t)}else typeof document<`u`&&document.execCommand(`insertText`,!1,t)}(e,n)}(i,t.getClipboard())};case`selectAll`:return{callback:()=>function(e){$d(e)?e.select():typeof document<`u`&&document.execCommand(`selectAll`)}(i),disabledReasons:tf(i)?[]:[C(`reason.nothingToSelect`)]};case`undo`:return{callback:()=>rf(`undo`)};case`redo`:return{callback:()=>rf(`redo`)};default:return}}}function $d(e){let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`}function ef(e){if($d(e))return(e.selectionStart??0)!==(e.selectionEnd??0);let t=typeof window<`u`?window.getSelection():null;return!!t&&!t.isCollapsed&&t.toString().length>0}function tf(e){return $d(e)?e.value.length>0:(e.textContent??``).length>0}function nf(e){return $d(e)?e.value.substring(e.selectionStart??0,e.selectionEnd??0):(typeof window<`u`?window.getSelection()?.toString():``)??``}function rf(e){typeof document<`u`&&document.execCommand(e)}var{useCommandResolver:af}=G,of=()=>{let e=Ie(),t=(0,X.useRef)(e);t.current=e;let n=(0,X.useMemo)(()=>Qd({clipboard:{getClipboard:()=>t.current.getClipboard()}}),[]),r=af();return(0,X.useEffect)(()=>{if(!r)return;let e=r.addResolveInjector(n),t=()=>r.invalidate();return document.addEventListener(`selectionchange`,t),()=>{e(),document.removeEventListener(`selectionchange`,t)}},[r,n]),null};of.displayName=`InputClipboardInjector`;var sf=(0,X.createContext)(null);function cf(){return(0,X.useContext)(sf)}var{CommandScopeContext:lf,CommandChainContext:uf,useCommandScope:df,LayerActivation:ff}=G,pf=({pane:e,children:t})=>{let n=df(),r=e.getAnchor(),i=(0,X.useMemo)(()=>n?new ff(n.createChild(`pane:${r}`)):null,[n,r]);return(0,X.useEffect)(()=>{let e=i?.getBase();return()=>e?.dispose()},[i]),(0,X.useEffect)(()=>{if(i)return G.attachWhenReady({get current(){return e.getElement()??null}},e=>i.getBase().attachElement(e,i))},[e,i]),i?(0,Z.jsx)(uf.Provider,{value:i,children:(0,Z.jsx)(lf.Provider,{value:i.getBase(),children:t})}):t};pf.displayName=`PaneScopeProvider`;var mf={"agent.changes.untitled":`Agent update`,"agent.dismiss":`Dismiss`,"agent.dismissAll":`Dismiss all`,"agent.findings.none":`Nothing to review.`,"agent.findings.stale":`No longer in the workbook`,"agent.findingsOpen":`{count, plural, one {# agent finding} other {# agent findings}}`,"agent.goToCurrent":`Go to the current finding`,"agent.history.clearSearch":`Clear search`,"agent.history.kind.change":`Change`,"agent.history.kind.finding":`Finding`,"agent.history.kind.question":`Question`,"agent.history.noMatches":`Nothing matches.`,"agent.history.none":`Nothing yet.`,"agent.history.search":`Search history`,"agent.meter":`{count, plural, =0 {No tool calls yet} one {# tool call this session} other {# tool calls this session}}`,"agent.needsAttention":`The agent is waiting on you`,"agent.next":`Next finding`,"agent.pane.title":`Agent`,"agent.pin":`Keep open`,"agent.position":`{position} / {total}`,"agent.previous":`Previous finding`,"agent.prompt.acknowledge":`Got it`,"agent.prompt.goto":`Go to {range}`,"agent.prompt.other":`Other`,"agent.prompt.otherPlaceholder":`Type your answer…`,"agent.prompt.stepTab":`Question {step}`,"agent.prompt.submit":`Submit`,"agent.prompt.submitAll":`Submit answers`,"agent.prompt.title":`Agent asks`,"agent.reason.noFindings":`There are no agent highlights.`,"agent.section.findings":`Findings`,"agent.tab.history":`History`,"agent.tab.review":`Review`,"agent.unpin":`Close on mouse leave`,"agent.waitingOnYou":`Waiting on you: {question}`,"agent.working":`The agent is working on {where}`,"autoFill.preset.copy":`Copy Cells`,"autoFill.preset.dateDays":`Day`,"autoFill.preset.dateMonthEnd":`Month End`,"autoFill.preset.dateMonths":`Month`,"autoFill.preset.dateWeekdays":`Weekday`,"autoFill.preset.dateYears":`Year`,"autoFill.preset.growth":`Growth`,"autoFill.preset.growthTrend":`Growth Trend`,"autoFill.preset.linear":`Linear`,"autoFill.preset.linearTrend":`Linear Trend`,"autoFill.preset.series":`AutoFill`,"cellControl.pane.empty":`Select a cell with a control to see its options.`,"cellControl.pane.none":`This control has no options.`,"cellError.description.blocked":`Access to the data was blocked`,"cellError.description.busy":`The value is still being calculated`,"cellError.description.calc":`The formula cannot be calculated, for example an empty array`,"cellError.description.connect":`The data source could not be reached`,"cellError.description.div0":`Dividing by zero or an empty cell`,"cellError.description.field":`The field does not exist in the data type`,"cellError.description.gettingData":`The data is still being retrieved`,"cellError.description.nA":`A value is not available to the formula or function`,"cellError.description.name":`The formula uses a name or function that is not recognized`,"cellError.description.null":`The ranges given do not intersect`,"cellError.description.num":`A number is not valid, or the result is too large or too small`,"cellError.description.parse":`The formula could not be read`,"cellError.description.python":`The Python code returned an error`,"cellError.description.ref":`A reference is not valid, often because its cells were deleted`,"cellError.description.spill":`The result cannot spill: cells in its way are not empty`,"cellError.description.timeout":`The calculation took too long`,"cellError.description.unknown":`The data type is not recognized`,"cellError.description.value":`A value is the wrong type for the formula or function`,"cellError.error":`Error`,"cellError.warning":`Warning`,"cellInsert.columnHere":`Insert column here`,"cellInsert.rowHere":`Insert row here`,"chart.type.area":`Area Chart`,"chart.type.areaStacked":`Stacked Area Chart`,"chart.type.areaStackedPercent":`Percentage Area Chart`,"chart.type.bar":`Bar Chart`,"chart.type.barStacked":`Bar Stacked Chart`,"chart.type.barStackedPercent":`Bar Percent Chart`,"chart.type.bubble":`Bubble Chart`,"chart.type.bubble3D":`3D Bubble Chart`,"chart.type.column":`Column Chart`,"chart.type.columnStacked":`Stacked Column Chart`,"chart.type.columnStackedPercent":`Stacked Percentage Column Chart`,"chart.type.line":`Line Chart`,"chart.type.lineMarkers":`Line with Markers Chart`,"chart.type.lineStacked":`Stacked Line Chart`,"chart.type.lineStackedMarkers":`Line Stacked with Markers Chart`,"chart.type.lineStackedPercent":`Stacked Percentage Line Chart`,"chart.type.lineStackedPercentMarkers":`Line Percentage with Markers Chart`,"chart.type.pie":`Pie Chart`,"chart.type.pieDoughnut":`Pie Doughnut Chart`,"chart.type.scatterLines":`Scatter Chart with Lines`,"chart.type.scatterLinesMarkers":`Scatter Chart with Markers and Lines`,"chart.type.scatterLinesMarkersSmooth":`Scatter Chart with Markers and Smooth Lines`,"chart.type.scatterLinesSmooth":`Scatter Chart with Smooth Lines`,"chart.type.scatterMarkers":`Scatter Chart with Markers`,"checklist.add":`Add "{text}"`,"checklist.byValue":`By value`,"checklist.count":`{checked} / {total}`,"checklist.countFiltered":`{checked} / {total} (filtered)`,"checklist.searchOptions":`Search options`,"checklist.searchOrAdd":`Search or add`,"checklist.selectAll":`Select All`,"checklist.truncated":`(truncated)`,"checklist.truncatedDetail":`Not all unique items are listed.`,"circular.converged":`{count, plural, one {Converged after # iteration} other {Converged after # iterations}}`,"circular.reads":`Reads a circular reference at`,"circular.title":`Circular reference`,"circular.unconverged":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}} (last change {change})`,"circular.unconvergedNoChange":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}}`,"clipboard.pasting":`Pasting...`,"dialog.activate":`Activate`,"dialog.activateTask.inputLabel":`Task Name`,"dialog.activateTask.title":`Activate Task`,"dialog.change":`Change`,"dialog.changePicture.description":`Enter the web address for the picture to show instead.`,"dialog.changePicture.title":`Change Picture from Web`,"dialog.chartSelectData.description":`Enter the address of the cells to plot, with the series names and categories around them.`,"dialog.chartSelectData.inputLabel":`Data range`,"dialog.chartSelectData.title":`Select Data`,"dialog.confirm.title":`Confirm`,"dialog.goTo":`Go To`,"dialog.goTo.inputLabel":`Location`,"dialog.goTo.title":`Go To`,"dialog.insert":`Insert`,"dialog.insertImage.description":`Enter the web address for the image to insert.`,"dialog.insertImage.inputLabel":`Address`,"dialog.insertImage.title":`Insert Image from Web`,"dialog.newCellStyle.description":`Enter a name for the new cell style.`,"dialog.newCellStyle.inputLabel":`Style Name`,"dialog.newCellStyle.title":`New Cell Style`,"dialog.password.description":`Enter the password to unprotect this sheet.`,"dialog.password.incorrect":`That password is incorrect.`,"dialog.password.pauseDescription":`Enter the password to pause protection on this sheet.`,"dialog.password.required":`Enter a password.`,"dialog.password.title":`Password Required`,"dialog.pause":`Pause`,"dialog.select":`Select`,"dialog.sheetBackground.description":`Enter the web address for the background image.`,"dialog.sheetBackground.title":`Sheet Background from Web`,"dialog.unlock":`Unlock`,"dialog.unlockRange.description":`Enter the password to edit ''{name}''.`,"dialog.unlockRange.descriptionMany":`Enter the password for one of the ranges that cover this cell.`,"dialog.unlockRange.title":`Unlock Range`,"dialog.unprotect":`Unprotect`,"editMode.copy":`'Copy' Select destination and press ENTER or choose Paste.`,"editMode.cut":`'Cut' Select destination and press ENTER or choose Paste.`,"editMode.dragCopy":`Drag selection to copy cell contents.`,"editMode.dragCopyInsert":`Drag selection to insert copied cell contents.`,"editMode.dragCut":`Drag selection to move cell contents.`,"editMode.dragCutInsert":`Drag selection to insert cell contents.`,"editMode.edit":`Edit`,"editMode.enter":`Enter`,"editMode.fill":`Drag selection to extend series or fill.`,"editMode.formatPainter":`Use the mouse to apply the copied format to another selection.`,"error.clipboard.perms":`You do not have permissions to access the clipboard.
12
+ All copy and paste operations will be limited to the browser tab.`,"error.clipboard.safari":`The Safari browser does not support advanced copy and paste.
13
+ Copy and paste will be limited to within the browser tab.
14
+
15
+ Please use Chrome or Edge if external copy and paste is required.`,"error.fillSeries.invalidSelection":`Can not fill a series from this selection. Select the values to continue along with the cells to fill.`,"error.fillSeries.multipleRanges":`Can not fill a series across multiple cell ranges. Please select a single range and try again.`,"error.fillSeries.unknownType":`Unknown fill type.`,"error.group.multipleRanges":`Can not group multiple cell ranges. Please select a single range and try again.`,"error.insertImage.unresolved":`Unable to resolve image. {detail}`,"error.removeDuplicates.multipleRanges":`Can not perform Remove Duplicates on multiple cell ranges. Please select a single range and try again.`,"error.sheet.arrayFixedMultipleRanges":`An array formula can't be entered over a multiple selection.`,"error.sort.invalidSelection":`Invalid sort selection. Sort requires a single range with data.`,"error.sort.multipleRanges":`Can not sort on multiple cell ranges. Please select a single range and try again.`,"error.textToColumns.multipleRanges":`Can not perform Text to Columns on multiple cell ranges. Please select a single range and try again.`,"error.ungroup.multipleRanges":`Can not ungroup multiple cell ranges. Please select a single range and try again.`,"findReplace.replaced":`We replaced {count} cells.`,"formulaInput.equalsRequired":`Formula must start with '='.`,"formulaInput.invalid":`Invalid Formula`,"formulaInput.required":`Formula is required`,"formulaTrace.noDependents":`No formulas refer to the selected cells.`,"formulaTrace.noPrecedents":`The selected cells have no formulas that refer to other cells.`,"functionPreview.anyValue":`Any value`,"functionPreview.close":`Close`,"functionPreview.collapse":`Collapse`,"functionPreview.enumOutOfSet":`{value} is not one of this argument's values: {values}`,"functionPreview.expand":`Expand`,"functionPreview.optional":`Optional`,"functionPreview.repeatable":`Repeatable`,"functionPreview.type":`Type: {type}`,"functionPreview.typeName.boolean":`logical`,"functionPreview.typeName.error":`error`,"functionPreview.typeName.null":`empty`,"functionPreview.typeName.number":`number`,"functionPreview.typeName.richData":`data`,"functionPreview.typeName.string":`text`,"hyperlink.copy":`Copy link`,"hyperlink.edit":`Edit link`,"hyperlink.open":`Open link`,"hyperlink.remove":`Remove link`,"movable.contentError":`Unable to show ''{type}'': {message}`,"movable.pane.empty":`Select a drawing to format it.`,"movable.pane.none":`{kind} has no format options.`,"movable.tip.position":`{x}, {y}`,"movable.tip.rotation":`{degrees}°`,"movable.tip.size":`{width} × {height}`,"movable.unsupportedType":`Unsupported type: ''{type}''.`,"namedInput.invalid":`Invalid Name`,"op.alignBottom":`Align Bottom`,"op.alignCenter":`Align Center`,"op.alignLeft":`Align Left`,"op.alignMiddle":`Align Middle`,"op.alignRight":`Align Right`,"op.alignTop":`Align Top`,"op.anchor":`Anchor`,"op.bringForward":`Bring Forward`,"op.bringToFront":`Bring to Front`,"op.convertTableToRange":`Convert Table to Range`,"op.copyCells":`Copy Cells`,"op.deleteMovable":`Delete`,"op.deleteTable":`Delete Table`,"op.distributeHorizontally":`Distribute Horizontally`,"op.distributeVertically":`Distribute Vertically`,"op.findReplace":`Find & Replace`,"op.flipMovable":`Flip`,"op.insertMovedCells":`Insert Moved Cells`,"op.lockAspectRatio":`Lock Aspect Ratio`,"op.mergeCells":`Merge Cells`,"op.moveCells":`Move Cells`,"op.moveMovable":`Move`,"op.nudgeMovable":`Nudge`,"op.pivotValueSettings":`PivotTable Value Settings`,"op.resizeColumnsNamed":`{count, plural, one {Resize Column ''{name}''} other {Resize Columns ''{name}''}}`,"op.resizeMovable":`Resize`,"op.resizeRowsNamed":`{count, plural, one {Resize Row ''{name}''} other {Resize Rows ''{name}''}}`,"op.rotateMovable":`Rotate`,"op.sendBackward":`Send Backward`,"op.sendToBack":`Send to Back`,"op.sortCustom":`Custom Sort`,"op.typeInto":`Type ''{text}'' into {range}`,"op.unmergeCells":`Unmerge Cells`,"op.updateHyperlink":`Update Hyperlink`,"opaqueSheet.carried":`This sheet is kept as it was read and saved unchanged. It can be renamed, moved, hidden, colored or deleted, but not displayed yet.`,"opaqueSheet.kind.chart":`Chart sheet`,"opaqueSheet.kind.dialog":`Dialog sheet (Excel 5)`,"opaqueSheet.kind.macro":`Excel 4.0 macro sheet`,"outline.collapse":`Collapse`,"outline.expand":`Expand`,"outline.showLevel":`Show level {level}`,"picker.clearSearch":`Clear search`,"picker.noMatches":`No matches`,"picker.noValues":`No values`,"picker.search":`Search`,"pivot.area.column":`Columns`,"pivot.area.hint":`Drag fields here`,"pivot.area.page":`Filters`,"pivot.area.row":`Rows`,"pivot.area.values":`Values`,"pivot.chip.filtered":`Filtered`,"pivot.chip.rename":`Name`,"pivot.chip.valuesAsColumns":`Values as columns`,"pivot.chip.valuesAsRows":`Values as rows`,"pivot.empty.hintInside":`To build a report, choose fields from the PivotTable Field List`,"pivot.empty.hintOutside":`Click in this area to work with the PivotTable report`,"pivot.fields.list":`Fields`,"pivot.fields.none":`No field matches.`,"pivot.fields.search":`Search fields`,"pivot.function.average":`Average`,"pivot.function.count":`Count`,"pivot.function.countNums":`Count Numbers`,"pivot.function.max":`Max`,"pivot.function.min":`Min`,"pivot.function.product":`Product`,"pivot.function.stdDev":`StdDev`,"pivot.function.stdDevp":`StdDevp`,"pivot.function.sum":`Sum`,"pivot.function.var":`Var`,"pivot.function.varp":`Varp`,"pivot.menu.button":`Field options`,"pivot.menu.filter":`Filter…`,"pivot.menu.moveDown":`Move down`,"pivot.menu.moveTo.column":`Move to Columns`,"pivot.menu.moveTo.page":`Move to Filters`,"pivot.menu.moveTo.row":`Move to Rows`,"pivot.menu.moveTo.values":`Move to Values`,"pivot.menu.moveToEnd":`Move to end`,"pivot.menu.moveToStart":`Move to beginning`,"pivot.menu.moveUp":`Move up`,"pivot.menu.remove":`Remove`,"pivot.menu.sortAndFilter":`Sort and filter…`,"pivot.menu.valueSettings":`Value settings…`,"pivot.pane.deleted":`This PivotTable was deleted.`,"pivot.pane.empty":`Select a cell in a PivotTable to see its fields.`,"pivot.type.blank":`Blank`,"pivot.type.date":`Dates`,"pivot.type.mixed":`Mixed`,"pivot.type.number":`Numbers`,"pivot.type.text":`Text`,"reason.alreadyTable":`The selection is already in a table.`,"reason.cannotFlip":`None of the selected drawings can be flipped.`,"reason.cellHasNote":`The cell has a note.`,"reason.cellHasThread":`The cell has a threaded comment.`,"reason.chartTypeNotEditable":`A chart of this type cannot be edited yet; its title and legend can.`,"reason.connectorShape":`A line or connector cannot be changed to another shape.`,"reason.continuousSpan":`Not available with continuous / fill alignment.`,"reason.entireColumn":`Not available when entire columns are selected.`,"reason.entireRow":`Not available when entire rows are selected.`,"reason.freezeOrigin":`Select a cell below and/or right of where the panes should freeze.`,"reason.groupNeedsTwo":`Select two or more drawings to group.`,"reason.hyperlinkIsValue":`The link is the cell's value; change its formula to change it.`,"reason.mergeUnavailable":`Merge is not available for this selection.`,"reason.mixedSelection":`Not available for a mixed full / partial selection.`,"reason.noComments":`The sheet has no comments.`,"reason.noCommentsSelected":`No comments in the selection.`,"reason.noFormulasSelected":`No formulas in the selection.`,"reason.noFreeze":`No frozen panes.`,"reason.noGroup":`The selection is not in a group.`,"reason.noGroupSelected":`No group is selected.`,"reason.noHyperlinksSelected":`No hyperlinks in the selection.`,"reason.noMerge":`No merged cells in the selection.`,"reason.noNote":`The cell has no note.`,"reason.noNotes":`The sheet has no notes.`,"reason.noNotesSelected":`No notes in the selection.`,"reason.noPivotStyle":`No PivotTable style to clear.`,"reason.noPreviousSearch":`Nothing has been searched for yet.`,"reason.noSelection":`Nothing is selected.`,"reason.noSheetBackground":`The sheet has no background.`,"reason.noTableStyle":`No table style to clear.`,"reason.noTaskPane":`There is no task pane to show this in.`,"reason.nothingToRedo":`Nothing to redo.`,"reason.nothingToSelect":`Nothing to select.`,"reason.nothingToUndo":`Nothing to undo.`,"reason.notImplemented":`Not yet implemented.`,"reason.outlineTooDeep":`Groups can be nested no more than 7 levels deep.`,"reason.overlap":`Not available for an overlapping selection.`,"reason.pictureCropLocked":`The picture does not allow cropping.`,"reason.pictureNoHyperlink":`The picture has no link.`,"reason.protectionNotPausable":`Pausing needs a protected sheet.`,"reason.sheetLocked":`The sheet is locked.`,"reason.sheetProtected":`The sheet is protected.`,"reason.singleColumn":`Select a single column.`,"reason.sortRange":`Sort requires a single range.`,"reason.sparklineNotLine":`Markers are drawn on line sparklines only.`,"reason.tableAmbiguous":`Select cells within a single table.`,"reason.tableBodyRows":`Select rows within the table body.`,"referenceInput.cancel":`Cancel`,"referenceInput.commit":`Commit`,"referenceInput.crossSheet":`Reference must be on the same sheet`,"referenceInput.invalid":`Invalid Reference`,"referenceInput.required":`Reference is required`,"referenceInput.selectCurrent":`Select Current Range`,"resizeIndicator.height":`Height`,"resizeIndicator.hiddenDisplay":`{label}: Hidden`,"resizeIndicator.sizeDisplay":`{label}: {unit} ({px} pixels)`,"resizeIndicator.sizeDisplayZoomed":`{label}: {unit} ({px} pixels; {screenPx} at {zoom}%)`,"resizeIndicator.width":`Width`,"scrollbar.column":`Column: {title}`,"scrollbar.row":`Row: {title}`,"selection.replace":`Replace`,"selection.replaceData":`There is already data here. Do you want to replace it?`,"selection.tip.columns":`{cols}C`,"selection.tip.rows":`{rows}R`,"selection.tip.size":`{rows}R × {cols}C`,"shape.category.basic":`Basic Shapes`,"shape.category.blockArrows":`Block Arrows`,"shape.category.callouts":`Callouts`,"shape.category.equation":`Equation Shapes`,"shape.category.flowchart":`Flowchart`,"shape.category.lines":`Lines`,"shape.category.more":`More Shapes`,"shape.category.rectangles":`Rectangles`,"shape.category.starsBanners":`Stars and Banners`,"shape.preset.accentBorderCallout1":`Callout: Line with Border and Accent Bar`,"shape.preset.accentBorderCallout2":`Callout: Bent Line with Border and Accent Bar`,"shape.preset.accentBorderCallout3":`Callout: Double Bent Line with Border and Accent Bar`,"shape.preset.accentCallout1":`Callout: Line with Accent Bar`,"shape.preset.accentCallout2":`Callout: Bent Line with Accent Bar`,"shape.preset.accentCallout3":`Callout: Double Bent Line with Accent Bar`,"shape.preset.actionButtonBackPrevious":`Action Button: Back or Previous`,"shape.preset.actionButtonBeginning":`Action Button: Beginning`,"shape.preset.actionButtonBlank":`Action Button: Blank`,"shape.preset.actionButtonDocument":`Action Button: Document`,"shape.preset.actionButtonEnd":`Action Button: End`,"shape.preset.actionButtonForwardNext":`Action Button: Forward or Next`,"shape.preset.actionButtonHelp":`Action Button: Help`,"shape.preset.actionButtonHome":`Action Button: Home`,"shape.preset.actionButtonInformation":`Action Button: Information`,"shape.preset.actionButtonMovie":`Action Button: Movie`,"shape.preset.actionButtonReturn":`Action Button: Return`,"shape.preset.actionButtonSound":`Action Button: Sound`,"shape.preset.arc":`Arc`,"shape.preset.bentArrow":`Arrow: Bent`,"shape.preset.bentConnector3":`Connector: Elbow`,"shape.preset.bentConnector3Arrow":`Connector: Elbow Arrow`,"shape.preset.bentConnector3ArrowDouble":`Connector: Elbow Double-Arrow`,"shape.preset.bentUpArrow":`Arrow: Bent-Up`,"shape.preset.bevel":`Bevel`,"shape.preset.blockArc":`Block Arc`,"shape.preset.borderCallout1":`Callout: Line`,"shape.preset.borderCallout2":`Callout: Bent Line`,"shape.preset.borderCallout3":`Callout: Double Bent Line`,"shape.preset.bracePair":`Double Brace`,"shape.preset.bracketPair":`Double Bracket`,"shape.preset.callout1":`Callout: Line with No Border`,"shape.preset.callout2":`Callout: Bent Line with No Border`,"shape.preset.callout3":`Callout: Double Bent Line with No Border`,"shape.preset.can":`Cylinder`,"shape.preset.chartPlus":`Chart Plus`,"shape.preset.chartStar":`Chart Star`,"shape.preset.chartX":`Chart X`,"shape.preset.chevron":`Arrow: Chevron`,"shape.preset.chord":`Chord`,"shape.preset.circularArrow":`Arrow: Circular`,"shape.preset.cloud":`Cloud`,"shape.preset.cloudCallout":`Thought Bubble: Cloud`,"shape.preset.corner":`L-Shape`,"shape.preset.cornerTabs":`Corner Tabs`,"shape.preset.cube":`Cube`,"shape.preset.curvedConnector3":`Connector: Curved`,"shape.preset.curvedConnector3Arrow":`Connector: Curved Arrow`,"shape.preset.curvedConnector3ArrowDouble":`Connector: Curved Double-Arrow`,"shape.preset.curvedDownArrow":`Arrow: Curved Down`,"shape.preset.curvedLeftArrow":`Arrow: Curved Left`,"shape.preset.curvedRightArrow":`Arrow: Curved Right`,"shape.preset.curvedUpArrow":`Arrow: Curved Up`,"shape.preset.decagon":`Decagon`,"shape.preset.diagStripe":`Diagonal Stripe`,"shape.preset.diamond":`Diamond`,"shape.preset.dodecagon":`Dodecagon`,"shape.preset.donut":`Circle: Hollow`,"shape.preset.doubleWave":`Double Wave`,"shape.preset.downArrow":`Arrow: Down`,"shape.preset.downArrowCallout":`Callout: Down Arrow`,"shape.preset.ellipse":`Oval`,"shape.preset.ellipseRibbon":`Ribbon: Curved and Tilted Down`,"shape.preset.ellipseRibbon2":`Ribbon: Curved and Tilted Up`,"shape.preset.flowChartAlternateProcess":`Flowchart: Alternate Process`,"shape.preset.flowChartCollate":`Flowchart: Collate`,"shape.preset.flowChartConnector":`Flowchart: Connector`,"shape.preset.flowChartDecision":`Flowchart: Decision`,"shape.preset.flowChartDelay":`Flowchart: Delay`,"shape.preset.flowChartDisplay":`Flowchart: Display`,"shape.preset.flowChartDocument":`Flowchart: Document`,"shape.preset.flowChartExtract":`Flowchart: Extract`,"shape.preset.flowChartInputOutput":`Flowchart: Data`,"shape.preset.flowChartInternalStorage":`Flowchart: Internal Storage`,"shape.preset.flowChartMagneticDisk":`Flowchart: Magnetic Disk`,"shape.preset.flowChartMagneticDrum":`Flowchart: Direct Access Storage`,"shape.preset.flowChartMagneticTape":`Flowchart: Sequential Access Storage`,"shape.preset.flowChartManualInput":`Flowchart: Manual Input`,"shape.preset.flowChartManualOperation":`Flowchart: Manual Operation`,"shape.preset.flowChartMerge":`Flowchart: Merge`,"shape.preset.flowChartMultidocument":`Flowchart: Multidocument`,"shape.preset.flowChartOfflineStorage":`Flowchart: Offline Storage`,"shape.preset.flowChartOffpageConnector":`Flowchart: Off-page Connector`,"shape.preset.flowChartOnlineStorage":`Flowchart: Stored Data`,"shape.preset.flowChartOr":`Flowchart: Or`,"shape.preset.flowChartPredefinedProcess":`Flowchart: Predefined Process`,"shape.preset.flowChartPreparation":`Flowchart: Preparation`,"shape.preset.flowChartProcess":`Flowchart: Process`,"shape.preset.flowChartPunchedCard":`Flowchart: Card`,"shape.preset.flowChartPunchedTape":`Flowchart: Punched Tape`,"shape.preset.flowChartSort":`Flowchart: Sort`,"shape.preset.flowChartSummingJunction":`Flowchart: Summing Junction`,"shape.preset.flowChartTerminator":`Flowchart: Terminator`,"shape.preset.foldedCorner":`Folded Corner`,"shape.preset.frame":`Frame`,"shape.preset.funnel":`Funnel`,"shape.preset.gear6":`Gear: 6 Teeth`,"shape.preset.gear9":`Gear: 9 Teeth`,"shape.preset.halfFrame":`Half Frame`,"shape.preset.heart":`Heart`,"shape.preset.heptagon":`Heptagon`,"shape.preset.hexagon":`Hexagon`,"shape.preset.homePlate":`Arrow: Pentagon`,"shape.preset.horizontalScroll":`Scroll: Horizontal`,"shape.preset.irregularSeal1":`Explosion: 8 Points`,"shape.preset.irregularSeal2":`Explosion: 14 Points`,"shape.preset.leftArrow":`Arrow: Left`,"shape.preset.leftArrowCallout":`Callout: Left Arrow`,"shape.preset.leftBrace":`Left Brace`,"shape.preset.leftBracket":`Left Bracket`,"shape.preset.leftCircularArrow":`Arrow: Circular Left`,"shape.preset.leftRightArrow":`Arrow: Left-Right`,"shape.preset.leftRightArrowCallout":`Callout: Left-Right Arrow`,"shape.preset.leftRightCircularArrow":`Arrow: Circular Left-Right`,"shape.preset.leftRightRibbon":`Ribbon: Left-Right`,"shape.preset.leftRightUpArrow":`Arrow: Left-Right-Up`,"shape.preset.leftUpArrow":`Arrow: Left-Up`,"shape.preset.lightningBolt":`Lightning Bolt`,"shape.preset.line":`Line`,"shape.preset.lineArrow":`Line Arrow`,"shape.preset.lineArrowDouble":`Line Arrow: Double`,"shape.preset.mathDivide":`Division Sign`,"shape.preset.mathEqual":`Equals`,"shape.preset.mathMinus":`Minus Sign`,"shape.preset.mathMultiply":`Multiplication Sign`,"shape.preset.mathNotEqual":`Not Equal`,"shape.preset.mathPlus":`Plus Sign`,"shape.preset.moon":`Moon`,"shape.preset.nonIsoscelesTrapezoid":`Trapezoid: Non-Isosceles`,"shape.preset.noSmoking":`"No" Symbol`,"shape.preset.notchedRightArrow":`Arrow: Notched Right`,"shape.preset.octagon":`Octagon`,"shape.preset.parallelogram":`Parallelogram`,"shape.preset.pentagon":`Pentagon`,"shape.preset.pie":`Partial Circle`,"shape.preset.pieWedge":`Pie Wedge`,"shape.preset.plaque":`Plaque`,"shape.preset.plaqueTabs":`Plaque Tabs`,"shape.preset.plus":`Cross`,"shape.preset.quadArrow":`Arrow: Quad`,"shape.preset.quadArrowCallout":`Callout: Quad Arrow`,"shape.preset.rect":`Rectangle`,"shape.preset.ribbon":`Ribbon: Tilted Down`,"shape.preset.ribbon2":`Ribbon: Tilted Up`,"shape.preset.rightArrow":`Arrow: Right`,"shape.preset.rightArrowCallout":`Callout: Right Arrow`,"shape.preset.rightBrace":`Right Brace`,"shape.preset.rightBracket":`Right Bracket`,"shape.preset.round1Rect":`Rectangle: Single Corner Rounded`,"shape.preset.round2DiagRect":`Rectangle: Diagonal Corners Rounded`,"shape.preset.round2SameRect":`Rectangle: Top Corners Rounded`,"shape.preset.roundRect":`Rectangle: Rounded Corners`,"shape.preset.rtTriangle":`Right Triangle`,"shape.preset.smileyFace":`Smiley Face`,"shape.preset.snip1Rect":`Rectangle: Single Corner Snipped`,"shape.preset.snip2DiagRect":`Rectangle: Diagonal Corners Snipped`,"shape.preset.snip2SameRect":`Rectangle: Top Corners Snipped`,"shape.preset.snipRoundRect":`Rectangle: Top Corners One Rounded and One Snipped`,"shape.preset.squareTabs":`Square Tabs`,"shape.preset.star10":`Star: 10 Points`,"shape.preset.star12":`Star: 12 Points`,"shape.preset.star16":`Star: 16 Points`,"shape.preset.star24":`Star: 24 Points`,"shape.preset.star32":`Star: 32 Points`,"shape.preset.star4":`Star: 4 Points`,"shape.preset.star5":`Star: 5 Points`,"shape.preset.star6":`Star: 6 Points`,"shape.preset.star7":`Star: 7 Points`,"shape.preset.star8":`Star: 8 Points`,"shape.preset.stripedRightArrow":`Arrow: Striped Right`,"shape.preset.sun":`Sun`,"shape.preset.swooshArrow":`Arrow: Swoosh`,"shape.preset.teardrop":`Teardrop`,"shape.preset.trapezoid":`Trapezoid`,"shape.preset.triangle":`Isosceles Triangle`,"shape.preset.upArrow":`Arrow: Up`,"shape.preset.upArrowCallout":`Callout: Up Arrow`,"shape.preset.upDownArrow":`Arrow: Up-Down`,"shape.preset.upDownArrowCallout":`Callout: Up-Down Arrow`,"shape.preset.uturnArrow":`Arrow: U-Turn`,"shape.preset.verticalScroll":`Scroll: Vertical`,"shape.preset.wave":`Wave`,"shape.preset.wedgeEllipseCallout":`Speech Bubble: Oval`,"shape.preset.wedgeRectCallout":`Speech Bubble: Rectangle`,"shape.preset.wedgeRoundRectCallout":`Speech Bubble: Rectangle with Corners Rounded`,"sheet.merge":`Merge`,"sheet.mergeCellsWarning":`Merging cells will only keep the upper-left value. Some data will be discarded. Continue?`,"slicer.clearFilter":`Clear Filter`,"slicer.multiSelect":`Multi-Select`,"table.columns.compact":`{count, plural, one{Table Column} other{# Table Columns}}`,"table.convert":`Convert`,"table.convertToRangeWarning":`Converting a table to range with ''{count}'' cells will set a large number of cell styles and may affect performance.
16
+ Continue?`,"table.deleteColumns":`{count, plural, one{Delete Table Column} other{Delete # Table Columns}}`,"table.deleteColumns.description":`Delete the selected table columns, shifting cells left only within the table.`,"table.deleteRows":`{count, plural, one{Delete Table Row} other{Delete # Table Rows}}`,"table.deleteRows.description":`Delete the selected table rows, shifting cells up only within the table.`,"table.insertColumns":`{count, plural, one{Insert Table Column} other{Insert # Table Columns}}`,"table.insertColumns.description":`Insert columns to the left of the selection, shifting cells right only within the table.`,"table.insertRows":`{count, plural, one{Insert Table Row} other{Insert # Table Rows}}`,"table.insertRows.description":`Insert rows above the selection, shifting cells down only within the table.`,"table.rows.compact":`{count, plural, one{Table Row} other{# Table Rows}}`,"table.totals.average":`Average`,"table.totals.count":`Count`,"table.totals.countNumbers":`Count Numbers`,"table.totals.max":`Max`,"table.totals.min":`Min`,"table.totals.moreFunctions":`More Functions...`,"table.totals.none":`None`,"table.totals.stdDev":`StdDev`,"table.totals.sum":`Sum`,"table.totals.var":`Var`,"validationAlert.default":`This value doesn't match the data validation restrictions defined for this cell.`,"validationAlert.hint.stop":`Change the entry, or press Esc to cancel.`,"validationAlert.hint.warning":`Press Enter again to keep it, or Esc to cancel.`,"validationTip.more":`{count, plural, one {# more rule} other {# more rules}}`,"workbook.untitled":`Untitled`,"workbookStrip.newSheet":`New sheet`},hf=[{sourceId:`chart`,catalog:{scope:`chart`,label:`Chart`,tag:`en`,version:1,commands:{chartChangeType:{label:`Change Chart Type`,description:`Draw every series as another type of chart.`,tags:[`mutator`]},chartSwitchRowColumn:{label:`Switch Row/Column`,description:`Plot the data's rows as series instead of its columns, or the other way round.`,tags:[`mutator`]},chartSelectData:{label:`Select Data`,description:`Change the cells the chart plots.`,groupLabels:{contextMenu:`Select Data…`},tags:[`mutator`]},chartAddElement:{label:`Add Chart Element`,description:`Add, move or remove a title, legend, data labels, data table, gridlines, axis titles, trendlines, error bars, lines or up/down bars.`,tags:[`mutator`]},chartTitleToggle:{label:`Chart Title`,description:`Show the chart's title above the chart, or remove it.`,tags:[`mutator`]},chartLegendToggle:{label:`Legend`,description:`Show the legend at the right, or remove it.`,tags:[`mutator`]},chartDataLabelsToggle:{label:`Data Labels`,description:`Label every point with its value, or remove the labels.`,tags:[`mutator`]},chartDataTableToggle:{label:`Data Table`,description:`Show the plotted values in a table under the chart, or remove it.`,tags:[`mutator`]},chartGridlinesToggle:{label:`Gridlines`,description:`Show the value axis's major gridlines, or remove them.`,tags:[`mutator`]},chartAxisTitlesToggle:{label:`Axis Titles`,description:`Show a title on each primary axis, or remove them.`,tags:[`mutator`]}}}},{sourceId:`clipboard`,catalog:{scope:`app`,label:`Application`,tag:`en`,version:1,commands:{cut:{label:`Cut`,description:`Remove the selection and put it on the clipboard so you can paste it somewhere else.`,icon:`cut`,shortcut:[`ctrl+X`,`shift+Delete`]},copy:{label:`Copy`,description:`Put a copy of the selection on the clipboard so you can paste it somewhere else.`,icon:`copy`,shortcut:[`ctrl+C`,`ctrl+Insert`]},paste:{label:`Paste`,description:`Add content on the clipboard to your document.`,icon:`paste.yellow`,shortcut:[`ctrl+V`,`shift+Insert`]}}}},{sourceId:`editor`,catalog:{scope:`editor`,label:`Cell Editor`,tag:`en`,version:1,commands:{relativeReferencesToggle:{label:`Toggle References`,description:`Toggle cell references from relative to absolute, to partially absolute, back to relative again.`,shortcut:`F4`,tags:[`editor`]},toggleEditorFocus:{label:`Toggle Editor Focus`,description:`Move focus between editors such as the formula editor and the inline editor.`,shortcut:`ctrl+F2`,tags:[`editor`]},insertFunctionSum:{label:`Quick Sum`,description:`Quick sum of the cells.`,groupLabels:{insertFunctionSumOptions:`Sum`},icon:`FunctionSum`,shortcut:`alt+=`,tags:[`mutator`],borrow:[`sheet`]},insertFunctionAverage:{label:`Quick Average`,description:`Quick average of the cells.`,groupLabels:{insertFunctionSumOptions:`Average`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionCount:{label:`Quick Count`,description:`Quick count of the cells.`,groupLabels:{insertFunctionSumOptions:`Count Numbers`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMax:{label:`Quick Max`,description:`Quick maximum of the cells.`,groupLabels:{insertFunctionSumOptions:`Max`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMin:{label:`Quick Min`,description:`Quick minimum of the cells.`,groupLabels:{insertFunctionSumOptions:`Min`},tags:[`mutator`],borrow:[`sheet`]},insertCurrentTime:{label:`Current Time`,description:`Insert the current time.`,shortcut:`ctrl+shift+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertCurrentDate:{label:`Current Date`,description:`Insert the current date.`,shortcut:`ctrl+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertValueAbove:{label:`Copy From Above`,description:`Copy the value from the cell above the active cell into the cell or the formula bar.`,shortcut:[`ctrl+Quote`,`ctrl+shift+"`],tags:[`mutator`],borrow:[`sheet`]}}}},{sourceId:`movable`,catalog:{scope:`movable`,label:`Objects`,tag:`en`,version:1,commands:{moveToFront:{label:`Bring to Front`,description:`Move to the front of all of the other drawings.`,icon:`DrawToFront`,shortcut:`ctrl+shift+BracketRight`},moveForward:{label:`Bring Forward`,description:`Move forward one layer in the z order.`,icon:`DrawMoveForward`,shortcut:`ctrl+BracketRight`},moveToBack:{label:`Send to Back`,description:`Move to the back of all of the other drawings.`,icon:`DrawToBack`,shortcut:`ctrl+shift+BracketLeft`},moveBackward:{label:`Send Backward`,description:`Move backwards one layer in the z order.`,icon:`DrawMoveBackward`,shortcut:`ctrl+BracketLeft`},groupDrawings:{label:`Group`,description:`Group the selected drawings into one object.`,icon:`DrawGroup`},ungroupDrawings:{label:`Ungroup`,description:`Break the selected group into its members.`,icon:`DrawUngroup`},deleteDrawings:{label:`Delete`,description:`Delete the selected drawings.`,shortcut:`Delete`},selectAllDrawings:{label:`Select All Drawings`,description:`Select all of the drawings on the sheet.`,shortcut:`ctrl+A`},selectNextDrawing:{label:`Select Next Drawing`,description:`Select the next drawing on the sheet.`,shortcut:`Tab`},selectPreviousDrawing:{label:`Select Previous Drawing`,description:`Select the previous drawing on the sheet.`,shortcut:`shift+Tab`},clearDrawingSelection:{label:`Return to Cells`,description:`Clear the drawing selection and return to the cells.`,shortcut:`Escape`},toggleLockAspectRatio:{label:`Lock Aspect Ratio`,description:`Toggle whether the aspect ratio should be maintained when resizing from corners.`,icon:`DrawAspect`},formatAnchorTypeTwoCell:{label:`Move and size with cells`,description:`Set your drawing to move and resize when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeOneCell:{label:`Move but don't size with cells`,description:`Set your drawing to only move when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeAbsolute:{label:`Don't move or size with cells`,description:`Set your drawing to never move or resize when underling sheet resizes.`,icon:`DrawResize`},formatDrawNudgeLeft:{label:`Nudge Left`,description:`Move the selected drawings 1 pixel left.`,shortcut:`ArrowLeft`},formatDrawNudgeRight:{label:`Nudge Right`,description:`Move the selected drawings 1 pixel right.`,shortcut:`ArrowRight`},formatDrawNudgeUp:{label:`Nudge Up`,description:`Move the selected drawings 1 pixel up.`,shortcut:`ArrowUp`},formatDrawNudgeDown:{label:`Nudge Down`,description:`Move the selected drawings 1 pixel down.`,shortcut:`ArrowDown`},formatDrawNudgeLeftLarge:{label:`Nudge Left (Large)`,description:`Move the selected drawings 10 pixels left.`,shortcut:`ctrl+ArrowLeft`},formatDrawNudgeRightLarge:{label:`Nudge Right (Large)`,description:`Move the selected drawings 10 pixels right.`,shortcut:`ctrl+ArrowRight`},formatDrawNudgeUpLarge:{label:`Nudge Up (Large)`,description:`Move the selected drawings 10 pixels up.`,shortcut:`ctrl+ArrowUp`},formatDrawNudgeDownLarge:{label:`Nudge Down (Large)`,description:`Move the selected drawings 10 pixels down.`,shortcut:`ctrl+ArrowDown`},formatDrawSizeIncrease:{label:`Increase Size`,description:`Grow the selected drawings by 10%.`,shortcut:[`shift+ArrowRight`,`shift+ArrowUp`,`ctrl+shift+ArrowRight`,`ctrl+shift+ArrowUp`]},formatDrawSizeDecrease:{label:`Decrease Size`,description:`Shrink the selected drawings by 10%.`,shortcut:[`shift+ArrowLeft`,`shift+ArrowDown`,`ctrl+shift+ArrowLeft`,`ctrl+shift+ArrowDown`]},formatDrawFlipHorizontal:{label:`Flip Horizontal`,description:`Mirror the selected drawings left to right.`,icon:`DrawFlipHorz`},formatDrawFlipVertical:{label:`Flip Vertical`,description:`Mirror the selected drawings top to bottom.`,icon:`DrawFlipVert`},formatDrawRotateLeft:{label:`Rotate Left`,description:`Rotate the selected drawings 10 degrees counterclockwise.`,shortcut:[`alt+ArrowLeft`,`ctrl+alt+ArrowLeft`]},formatDrawRotateRight:{label:`Rotate Right`,description:`Rotate the selected drawings 10 degrees clockwise.`,shortcut:[`alt+ArrowRight`,`ctrl+alt+ArrowRight`]},formatDrawAlignLeft:{label:`Align Left`,description:`Align the selected drawings to the left.`,icon:`DrawAlignLeft`},formatDrawAlignCenter:{label:`Align Center`,description:`Align the selected drawings vertically relative to each other.`,icon:`DrawAlignCenter`},formatDrawAlignRight:{label:`Align Right`,description:`Align the selected drawings to the right.`,icon:`DrawAlignRight`},formatDrawAlignTop:{label:`Align Top`,description:`Align the selected drawings to the top.`,icon:`DrawAlignTop`},formatDrawAlignMiddle:{label:`Align Middle`,description:`Align the selected drawings horizontally relative to each other.`,icon:`DrawAlignMiddle`},formatDrawAlignBottom:{label:`Align Bottom`,description:`Align the selected drawings to the bottom.`,icon:`DrawAlignBottom`},formatDrawDistributeHorz:{label:`Distribute Horizontally`,description:`Distribute the selected drawings horizontally with equal spacing between each.`,icon:`DrawDistributeHorz`},formatDrawDistributeVert:{label:`Distribute Vertically`,description:`Distribute the selected drawings vertically with equal spacing between each.`,icon:`DrawDistributeVert`},formatDrawFlipHorz:{label:`Flip Horizontally`,description:`Flip the selected drawings horizontally.`},formatDrawFlipVert:{label:`Flip Vertically`,description:`Flip the selected drawings vertically.`},formatDrawGroup:{label:`Group`,description:`Group the selected drawings into a single drawing.`,icon:`DrawGroup`},formatDrawUngroup:{label:`Ungroup`,description:`Break the group of a drawing into individual drawings.`,icon:`DrawUngroup`},formatDrawSwapShapes:{label:`Swap Shapes`,description:`Swap the positions of the swap.`},formatDrawSwapShapesHorz:{label:`Swap Shapes Horizontally`,description:`Swap the positions of the swap horizontally.`},formatDrawSwapShapesVert:{label:`Swap Shapes Vertically`,description:`Swap the positions of the swap vertically.`},formatMovable:{label:`Format`,description:`Show the options for formatting the selected drawing.`,icon:`CellsFormat`,groupLabels:{movableContextMenu:`Format…`}},arrangeOptions:{label:`Arrange`,description:`Order, align, group and anchor the selected drawings.`,icon:`DrawToFront`},drawAlignOptions:{label:`Align`,description:`Quickly change the placement of your drawings.`,icon:`DrawAlignLeft`},drawFlipOptions:{label:`Flip`,description:`Mirror drawings left to right or top to bottom.`,icon:`DrawFlipHorz`},drawGroupOptions:{label:`Group`,description:`Group drawings into one object, or break a group into its members.`,icon:`DrawGroup`},drawSizingOptions:{label:`Sizing`,description:`Determine how the drawing size will adjust as the cell sizes adjust.`,icon:`DrawResize`}}}},{sourceId:`picture`,catalog:{scope:`picture`,label:`Picture`,tag:`en`,version:1,commands:{changePictureFromFile:{label:`Change Picture`,description:`Show another picture from your device in the same frame, keeping its size and formatting.`,groupLabels:{changePictureOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},changePictureFromURL:{label:`Change Picture From Web`,description:`Show another picture from the web in the same frame, keeping its size and formatting.`,groupLabels:{changePictureOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},cropOptions:{label:`Crop`,description:`Crop the picture to a shape or a proportion, or place it in its frame.`,icon:`Crop`},cropToShape:{label:`Crop to Shape`,description:`Clip the picture to the outline of a shape, keeping its size and formatting.`,icon:`Crop`,tags:[`mutator`]},cropAspectOptions:{label:`Aspect Ratio`,description:`Crop the picture to a proportion.`,icon:`DrawAspect`},cropAspect1x1:{label:`1:1`,description:`Crop the picture to a proportion of 1:1, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect2x3:{label:`2:3`,description:`Crop the picture to a proportion of 2:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x4:{label:`3:4`,description:`Crop the picture to a proportion of 3:4, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x5:{label:`3:5`,description:`Crop the picture to a proportion of 3:5, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect4x5:{label:`4:5`,description:`Crop the picture to a proportion of 4:5, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect3x2:{label:`3:2`,description:`Crop the picture to a proportion of 3:2, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect4x3:{label:`4:3`,description:`Crop the picture to a proportion of 4:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect5x3:{label:`5:3`,description:`Crop the picture to a proportion of 5:3, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect5x4:{label:`5:4`,description:`Crop the picture to a proportion of 5:4, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect16x9:{label:`16:9`,description:`Crop the picture to a proportion of 16:9, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropAspect16x10:{label:`16:10`,description:`Crop the picture to a proportion of 16:10, about its center.`,icon:`DrawAspect`,tags:[`mutator`]},cropFill:{label:`Fill`,description:`Cover the whole frame with the picture, keeping its proportions. What overflows is cropped.`,icon:`Crop`,tags:[`mutator`]},cropFit:{label:`Fit`,description:`Show the whole picture inside the frame, keeping its proportions.`,icon:`Crop`,tags:[`mutator`]},pictureHyperlinkOptions:{label:`Link`,description:`Link the picture to a web page, a place in this workbook or an email address.`,icon:`HyperlinkInsert`},updatePictureHyperlink:{label:`Link`,description:`Add or edit the link a click on the picture follows.`,groupLabels:{pictureHyperlinkOptions:`Edit Link…`},icon:`HyperlinkEdit`,tags:[`mutator`]},openPictureHyperlink:{label:`Open Link`,description:`Follow the link on the picture.`,groupLabels:{pictureHyperlinkOptions:`Open Link`},icon:`HyperlinkGoto`},deletePictureHyperlink:{label:`Remove Link`,description:`Remove the link from the picture.`,groupLabels:{pictureHyperlinkOptions:`Remove Link`},icon:`HyperlinkDelete`,tags:[`mutator`]}}}},{sourceId:`pivot`,catalog:{scope:`pivot`,label:`PivotTable`,tag:`en`,version:1,commands:{pivotTableFields:{label:`PivotTable Fields`,icon:`Pivot`},insertSlicer:{label:`Insert Slicer`,description:`Add a slicer that filters the PivotTable by the selected field, or by a field picked from the list.`,icon:`SlicerInsert`,tags:[`mutator`]},pivotStyleOptions:{label:`PivotTable Style Options`,description:`Choose which parts of the PivotTable style show.`,groupLabels:{pivotToolbar:`Style`}},pivotRefreshOptions:{label:`Refresh`,description:`Read the PivotTable's source again and lay it out, or refresh everything the workbook reads.`,icon:`RefreshAll`},pivotShowOptions:{label:`Show`,description:`Choose which of the PivotTable's buttons and headers show.`},pivotDrillIndicatorsToggle:{label:`Toggle PivotTable +/- Buttons`,description:`Show or hide the buttons that expand and collapse the PivotTable's items.`,groupLabels:{pivotShowOptions:`+/- Buttons`}},pivotFieldHeadersToggle:{label:`Toggle PivotTable Field Headers`,description:`Show or hide the captions and filter buttons over the PivotTable's row and column fields.`,groupLabels:{pivotShowOptions:`Field Headers`}},pivotRowHeadersToggle:{label:`Toggle PivotTable Row Headers`,description:`Show special formatting for the first column of the PivotTable.`,groupLabels:{pivotStyleOptions:`Row Headers`}},pivotColumnHeadersToggle:{label:`Toggle PivotTable Column Headers`,description:`Show special formatting for the first row of the PivotTable.`,groupLabels:{pivotStyleOptions:`Column Headers`}},pivotBandedRowsToggle:{label:`Toggle PivotTable Banded Rows`,description:`Show banded rows, even rows formatted differently from odd ones.`,groupLabels:{pivotStyleOptions:`Banded Rows`}},pivotBandedColumnsToggle:{label:`Toggle PivotTable Banded Columns`,description:`Show banded columns, even columns formatted differently from odd ones.`,groupLabels:{pivotStyleOptions:`Banded Columns`}}}}},{sourceId:`selection`,catalog:{scope:`selection`,label:`Selection`,tag:`en`,version:1,commands:{moveToPageDown:{label:`Page Down`,description:`Shift viewport down one page.`,shortcut:`PageDown`,tags:[`selection`]},selectToPageDown:{label:`Select To Page Down`,description:`Shift viewport and select down one page.`,shortcut:`shift+PageDown`,tags:[`selection`]},moveToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`alt+PageDown`,tags:[`selection`]},selectToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`shift+alt+PageDown`,tags:[`selection`]},moveToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`PageUp`,tags:[`selection`]},selectToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`shift+PageUp`,tags:[`selection`]},moveToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`alt+PageUp`,tags:[`selection`]},selectToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`shift+alt+PageUp`,tags:[`selection`]},selectArray:{label:`Select Array`,description:`Select the whole spilled or array-entered block containing the active cell.`,shortcut:`ctrl+shift+?`,tags:[`selection`]},selectColumn:{label:`Select Column`,description:`Select the columns for the selected cells.`,shortcut:`ctrl+Space`,tags:[`selection`]},selectRow:{label:`Select Row`,description:`Select the rows for the selected cells.`,shortcut:`shift+Space`,tags:[`selection`]},selectToColumnStart:{label:`Select To Column Start`,description:`Select the columns to the beginning of the sheet.`,tags:[`selection`]},selectToColumnEnd:{label:`Select To Column End`,description:`Select the columns to the end of the sheet.`,tags:[`selection`]},moveToRowStart:{label:`Move to Row Home`,description:`Move to the beginning of the row.`,shortcut:`Home`,tags:[`selection`]},selectToRowStart:{label:`Select to Row Home`,description:`Select to the beginning of the row.`,shortcut:`shift+Home`,tags:[`selection`]},moveToGridStart:{label:`Move to Grid Home`,description:`Move to the beginning of the grid.`,shortcut:`ctrl+Home`,tags:[`selection`]},selectToGridStart:{label:`Select to Grid Home`,description:`Select to the beginning of the grid.`,shortcut:`ctrl+shift+Home`,tags:[`selection`]},moveToRowEnd:{label:`Move to Row End`,description:`Move to the end of the row.`,shortcut:`End`,tags:[`selection`]},selectToRowEnd:{label:`Select to Row End`,description:`Select to the end of the row.`,shortcut:`shift+End`,tags:[`selection`]},moveToGridEnd:{label:`Move to Grid End`,description:`Move to the end of the grid.`,shortcut:`ctrl+End`,tags:[`selection`]},selectToGridEnd:{label:`Select to Grid End`,description:`Select to the end of the grid.`,shortcut:`ctrl+shift+End`,tags:[`selection`]},scrollToActiveCoords:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell.`,shortcut:`ctrl+Backspace`,tags:[`selection`]},scrollToActiveCoordsClearSelection:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell and clear selection.`,shortcut:`shift+Backspace`,tags:[`selection`]},traverseSelectionRight:{label:`Traverse Right`,description:`Traverse the selection moving rightward.`,shortcut:`Tab`,tags:[`selection`]},traverseSelectionLeft:{label:`Traverse Left`,description:`Traverse the selection moving leftward.`,shortcut:`shift+Tab`,tags:[`selection`]},traverseSelectionDown:{label:`Traverse Down`,description:`Traverse the selection moving downward.`,shortcut:[`Enter`,`NumpadEnter`],tags:[`selection`]},traverseSelectionUp:{label:`Traverse Up`,description:`Traverse the selection moving upward.`,shortcut:[`shift+Enter`,`shift+NumpadEnter`],tags:[`selection`]},moveLeft:{label:`Move Left`,description:`Move active cell to the left.`,shortcut:`ArrowLeft`,tags:[`selection`]},selectLeft:{label:`Select Left`,description:`Extend selection left.`,shortcut:`shift+ArrowLeft`,tags:[`selection`]},moveContentfulLeft:{label:`Move Left Contentful`,description:`Move left to the next cell with content.`,shortcut:`ctrl+ArrowLeft`,tags:[`selection`]},selectContentfulLeft:{label:`Select Left Contentful`,description:`Extend selection left to the next cell with content.`,shortcut:`ctrl+shift+ArrowLeft`,tags:[`selection`]},moveRight:{label:`Move Right`,description:`Move active cell to the right.`,shortcut:`ArrowRight`,tags:[`selection`]},selectRight:{label:`Select Right`,description:`Extend selection right.`,shortcut:`shift+ArrowRight`,tags:[`selection`]},moveContentfulRight:{label:`Move Right Contentful`,description:`Move right to the next cell with content.`,shortcut:`ctrl+ArrowRight`,tags:[`selection`]},selectContentfulRight:{label:`Select Right Contentful`,description:`Extend selection right to the next cell with content.`,shortcut:`ctrl+shift+ArrowRight`,tags:[`selection`]},moveUp:{label:`Move Up`,description:`Move active cell to the up.`,shortcut:`ArrowUp`,tags:[`selection`]},selectUp:{label:`Select Up`,description:`Extend selection up.`,shortcut:`shift+ArrowUp`,tags:[`selection`]},moveContentfulUp:{label:`Move Up Contentful`,description:`Move up to the next cell with content.`,shortcut:`ctrl+ArrowUp`,tags:[`selection`]},selectContentfulUp:{label:`Select Up Contentful`,description:`Extend selection up to the next cell with content.`,shortcut:`ctrl+shift+ArrowUp`,tags:[`selection`]},moveDown:{label:`Move Down`,description:`Move active cell to the down.`,shortcut:`ArrowDown`,tags:[`selection`]},selectDown:{label:`Select Down`,description:`Extend selection down.`,shortcut:`shift+ArrowDown`,tags:[`selection`]},moveContentfulDown:{label:`Move Down Contentful`,description:`Move down to the next cell with content.`,shortcut:`ctrl+ArrowDown`,tags:[`selection`]},selectContentfulDown:{label:`Select Down Contentful`,description:`Extend selection down to the next cell with content.`,shortcut:`ctrl+shift+ArrowDown`,tags:[`selection`]},traverseSelectionPreviousRange:{label:`Traverse Previous Range`,description:`Traverse the selection to the previous range.`,shortcut:`ctrl+alt+ArrowLeft`,tags:[`selection`]},traverseSelectionNextRange:{label:`Traverse Next Range`,description:`Traverse the selection to the next range.`,shortcut:`ctrl+alt+ArrowRight`,tags:[`selection`]},traverseSelectionCorners:{label:`Traverse Corners`,description:`Traverse the selection through the corners of the selected range.`,shortcut:`ctrl+.`,tags:[`selection`]}}}},{sourceId:`shape`,catalog:{scope:`shape`,label:`Shape`,tag:`en`,version:1,commands:{changeShape:{label:`Change Shape`,description:`Change the selected shape to another one, keeping its text and formatting.`,icon:`shape:Shapes`,tags:[`mutator`]}}}},{sourceId:`sheet`,catalog:{scope:`sheet`,label:`Sheet`,tag:`en`,version:1,commands:{gridlinesToggle:{label:`Gridlines`,description:`Toggle whether the lines between rows and columns in the sheet are displayed.`,groupLabels:{view:`Gridlines`}},insertSparkline:{label:`Insert Sparklines`,description:`Draw a sparkline of each row of the selected cells in the column to its right, or of a single column of cells below it.`,icon:`SparklineLine`,tags:[`mutator`]},insertSparklineColumn:{label:`Insert Column Sparklines`,description:`Draw a column sparkline of each row of the selected cells in the column to its right.`,groupLabels:{insertSparklineOptions:`Column`},icon:`SparklineColumn`,tags:[`mutator`]},insertSparklineLine:{label:`Insert Line Sparklines`,description:`Draw a line sparkline of each row of the selected cells in the column to its right.`,groupLabels:{insertSparklineOptions:`Line`},icon:`SparklineLine`,tags:[`mutator`]},insertSparklineWinLoss:{label:`Insert Win/Loss Sparklines`,description:`Draw a win/loss sparkline of each row of the selected cells in the column to its right.`,groupLabels:{insertSparklineOptions:`Win/Loss`},icon:`SparklineWinLoss`,tags:[`mutator`]},sheetViewToggleGridlinesRows:{label:`Row Gridlines`,description:`Toggle whether the lines between rows in the sheet are displayed.`,groupLabels:{view:`Row Gridlines`,gridlinesOptions:`Rows`}},sheetViewToggleGridlinesColumns:{label:`Column Gridlines`,description:`Toggle whether the lines between columns in the sheet are displayed.`,groupLabels:{view:`Columns Gridlines`,gridlinesOptions:`Columns`}},sheetViewFormatGridlinesColor:{label:`Gridlines Color`,description:`Color the rows and column gridlines.`},sheetViewToggleShowHeadings:{label:`Headings`,description:`Toggle whether the row and column headings are displayed.`,groupLabels:{view:`Headings`}},sheetViewToggleShowHeadingRows:{label:`Row Headings`,description:`Toggle whether the row headings are displayed.`,groupLabels:{view:`Row Headings`,headingsOptions:`Rows`}},sheetViewToggleShowHeadingColumns:{label:`Column Headings`,description:`Toggle whether the column headings are displayed.`,groupLabels:{view:`Columns Headings`,headingsOptions:`Columns`}},sheetViewToggleShowHeadingsNumeric:{label:`Numeric Headers`,description:`Toggle whether cell headings show numbers or A1 conventions.`,shortcut:`ctrl+shift+h`},sheetViewToggleFormulaView:{label:`Show Formulas`,description:`Toggle whether cells show formula or values.`,icon:`FormulaView`,shortcut:"ctrl+`"},sheetViewToggleShowZeros:{label:`Show Zeros`,description:`Toggle whether cell with zero value shows '0' or blank.`,icon:`ViewZero`},selectComments:{label:`Select Comments`,description:`Select the cells with comments.`,shortcut:`ctrl+shift+O`},selectAll:{label:`Select All`,description:`Select the closest data or the entire sheet if no data is nearby.`,shortcut:[`ctrl+A`,`ctrl+shift+Space`]},selectRegion:{label:`Select Region`,description:`Select the closest data.`,shortcut:`ctrl+shift+*`},clearHiddenSelection:{label:`Select Visible Cells`,description:`Break the selection around hidden rows and columns, leaving only the visible cells selected.`,shortcut:`alt+Semicolon`},formatTextRotate0:{label:`No Text Rotation`,description:`Remove all text rotation.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotate45:{label:`Angle Clockwise`,description:`Angle text 45 degrees downward.`,icon:`TextRotation45`,tags:[`mutator`]},formatTextRotate90:{label:`Rotate Text Down`,description:`Angle your text so that it aligns with the left.`,icon:`TextRotation90`,tags:[`mutator`]},formatTextRotate270:{label:`Rotate Text Up`,description:`Angle your text so that it aligns with the right.`,icon:`TextRotation2702`,tags:[`mutator`]},formatTextRotate315:{label:`Angle Counterclockwise`,description:`Angle text 45 degrees upward.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotateCustom:{label:`Custom Text Rotation`,description:`Angle your text using a custom angle.`,icon:`TextRotationCustom`,tags:[`mutator`],groupLabels:{textRotateOptions:`Custom`}},formatTextRotateVertical:{label:`Vertical Text`,description:`Stack text vertically.`,icon:`TextRotationVertical`,tags:[`mutator`]},sortAscending:{label:`Sort Ascending`,description:`Lowest to Highest.`,groupLabels:{sortOptions:`Ascending`,sortFilterOptions:`Ascending`},icon:`SortIncrease`,tags:[`mutator`]},sortDescending:{label:`Sort Descending`,description:`Highest to Lowest.`,groupLabels:{sortOptions:`Descending`,sortFilterOptions:`Descending`},icon:`SortDecrease`,tags:[`mutator`]},sortCustom:{label:`Custom Sort…`,description:`Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.`,groupLabels:{sortOptions:`Custom…`,sortFilterOptions:`Custom…`},icon:`SortCustom`,tags:[`mutator`]},protectionSheetToggle:{label:`{locked, select, true{Unprotect Sheet} other{Protect Sheet}}`,description:`Prevent unwanted changes from others by limiting their ability to edit.
17
+ For example, you can prevent people from editing locked cells or making formatting changes.`,groupLabels:{sheet:`{locked, select, true{Unprotect} other{Protect}}`},icon:`Lock`,params:{locked:!1}},protectionSheetPause:{label:`{paused, select, true{Resume Protection} other{Pause Protection}}`,description:`Temporarily lift protection on this sheet without unprotecting it.
18
+ Asks for the sheet password, if there is one. It applies to this session only and is never saved with the file.`,groupLabels:{protectionOptions:`{paused, select, true{Resume Protection} other{Pause Protection}}`},icon:`LockOpen`,params:{paused:!1}},protectionSheetProtectOrPause:{label:`{state, select, paused{Resume Protection} locked{Pause Protection} other{Protect Sheet}}`,description:`Protect the sheet, or pause protection on a protected one.
19
+ Never unprotects: pausing keeps the password and options, and applies to this session only.`,icon:`Lock`,params:{state:`none`}},protectionHighlight:{label:`Highlight Locked Cells`,description:`Shade the cells sheet protection locks, leaving the ranges that stay editable clear.
20
+ A view setting: it changes nothing in the workbook, and works whether or not the sheet is protected.`,groupLabels:{protectionOptions:`Highlight Locked Cells`}},manageProtection:{label:`Manage Protection`,description:`Sheet protection and its options, the ranges that stay editable, and workbook protection - in one place.`,groupLabels:{protectionOptions:`Manage Protection…`,sheetTabMenu:`Manage Protection…`,contextMenu:`Manage Protection…`},icon:`Lock`},protectionUnlockRange:{label:`Unlock Range…`,description:`Let the selected cells stay editable while the rest of the sheet is protected.`,groupLabels:{protectionOptions:`Unlock Range…`},icon:`LockRange`},formatSheetTabColor:{label:`Tab Color`,description:`Color the tab to help differentiate for other sheets.`,icon:`stroke.colored`},formatCellStyle:{label:`Cell Styles`,description:`A colorful style is a great way to make important data stand out on the sheet.`,groupLabels:{cellStyle:`Apply`},icon:`PresetStyles`,tags:[`mutator`]},formatTableStyle:{label:`{hasTable, select, true{Apply Table Style} other{Format as Table}}`,description:`Create a table or apply style to the current table.`,groupLabels:{tableStyleOptions:`Apply (Keep Styles)`},icon:`PresetStyles`,tags:[`mutator`],params:{hasTable:!1}},formatTableStyleClearCellStyles:{label:`Format as Table (Clear Styles)`,description:`Create a table or apply style to the current table and clears all cell styles.`,groupLabels:{tableStyleOptions:`Apply (Clear Styles)`},icon:`PresetStyles`},setDefaultTableStyle:{label:`Set Default Table Style`,description:`Sets the default table style used when a table is inserted.`,groupLabels:{tableStyleOptions:`Set As Default`}},deleteTableStyle:{label:`Delete Table Style`,description:`Remove the current table style.`,groupLabels:{tableStyleOptions:`Delete`}},formatBorder:{label:`Border`,description:`Create an outline border.`,tags:[`mutator`]},formatFillColor:{label:`Fill Color`,description:`Color the background of the cells to make them stand out.`,icon:`fill.colored`,tags:[`mutator`]},formatFontColor:{label:`Font Color`,description:`Change the color of your text.`,icon:`text.colored`,tags:[`mutator`]},formatBoldToggle:{label:`Bold`,description:`Toggle bold formatting of text.`,icon:`TextBold`,shortcut:[`ctrl+B`,`ctrl+2`],tags:[`mutator`]},formatItalicToggle:{label:`Italic`,description:`Toggle italic formatting of text.`,icon:`TextItalic`,shortcut:[`ctrl+I`,`ctrl+3`],tags:[`mutator`]},formatUnderlinedToggle:{label:`Underline`,description:`Underline the text.`,groupLabels:{underlineOptions:`Single`},icon:`TextUnderline`,shortcut:[`ctrl+u`,`ctrl+4`],tags:[`mutator`]},formatUnderlinedDoubleToggle:{label:`Double Underline`,description:`Double underline the text.`,groupLabels:{underlineOptions:`Double`},icon:`TextUnderlineDouble`},formatUnderlinedAccountingToggle:{label:`Accounting Underline`,description:`Use accounting underline for the text.`,groupLabels:{underlineOptions:`Accounting`},icon:`TextUnderlineAccounting`},formatUnderlinedAccountingDoubleToggle:{label:`Double Accounting Underline`,description:`Use accounting double underline the text.`,groupLabels:{underlineOptions:`Double Accounting`},icon:`TextUnderlineAccountingDouble`},formatStrikeThroughToggle:{label:`Strikethrough`,description:`Toggle strike-through formatting of text.`,icon:`TextStrike`,shortcut:`ctrl+5`,tags:[`mutator`]},formatSuperscriptToggle:{label:`Superscript`,description:`Format your text to be smaller and sit at the top of the line.`,icon:`TextSuperscript`,tags:[`mutator`]},formatSubscriptToggle:{label:`Subscript`,description:`Format your text to be smaller and sit at the bottom of the line.`,icon:`TextSubscript`,tags:[`mutator`]},formatAlignTopToggle:{label:`Align Top`,description:`Align text to the top.`,icon:`TextVerticalTop`,tags:[`mutator`]},formatTextOverflowVisibleToggle:{label:`Overflow Text`,description:`Overflow text to the next cells.`,icon:`TextHorizontalOverflow`,tags:[`mutator`]},formatTextOverflowWrapToggle:{label:`Wrap Text`,description:`Wrap text with the existing cell and increase the height as required.`,icon:`TextHorizontalWrap`,tags:[`mutator`]},formatTextOverflowClipToggle:{label:`Clip Text`,description:`Clip text that falls outside of the existing cell.`,icon:`TextHorizontalClip`,tags:[`mutator`]},formatTextOverflowShrinkToggle:{label:`Shrink Text`,description:`Shrink the text font to fit within existing cell.`,icon:`TextHorizontalShrink`,tags:[`mutator`]},formatTextOverflowEllipsisToggle:{label:`Ellipsis Text`,description:`Add a trailing '…' to the text to indicate text is partially hidden.`},formatAlignMiddleToggle:{label:`Align Middle`,description:`Align text so that it is centered between the top and bottom of the cell.`,icon:`TextVerticalCenter`,tags:[`mutator`]},formatAlignBottomToggle:{label:`Align Bottom`,description:`Align text to the bottom.`,icon:`TextVerticalBottom`,tags:[`mutator`]},formatAlignJustifyVerticalToggle:{label:`Justify Vertically`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedVerticalToggle:{label:`Distribute Vertically`,description:`Justify your content vertically.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignLeftToggle:{label:`Align Left`,description:`Align your content to the left.`,icon:`FormatAlignLeft`,tags:[`mutator`]},formatAlignCenterToggle:{label:`Align Center`,description:`Center your content.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignRightToggle:{label:`Align Right`,description:`Align your content to the right.`,icon:`FormatAlignRight`,tags:[`mutator`]},formatAlignJustifyToggle:{label:`Align Justify`,description:`Justify your content.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignCenterContinuousToggle:{label:`Center Across`,description:`Center your content across multiple cells.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignFillToggle:{label:`Fill Across`,description:`Repeat the value to fill the entire cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedHorizontalToggle:{label:`Distribute Horizontally`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatFontSizeIncrease:{label:`Increase Font Size`,description:`Make your text a bit bigger.`,icon:`TextSizeIncrease`,shortcut:`ctrl+shift+>`,tags:[`mutator`,`quickAction`]},formatFontSizeDecrease:{label:`Decrease Font Size`,description:`Make your text a bit smaller.`,icon:`TextSizeDecrease`,shortcut:`ctrl+shift+<`,tags:[`mutator`,`quickAction`]},formatFontFamily:{label:`Font`,description:`Select the font your text.`,tags:[`mutator`]},formatFontSize:{label:`Font Size`,description:`Change the size of your text.`,tags:[`mutator`]},formatCells:{label:`Format Cells`,description:`Open the Format Cells pane — number, alignment, font, fill and borders.`,icon:`CellsFormat`,groupLabels:{numberFormatOptions:`More Number Formats…`,cellsFormatOptions:`Format Cells…`,contextMenu:`Format Cells…`}},formatCellsNumber:{label:`Format Cells: Number`,description:`Open the Format Cells pane on the Number tab.`,icon:`CellsFormat`,shortcut:[`ctrl+1`,`ctrl+alt+1`]},formatCellsFont:{label:`Format Cells: Font`,description:`Open the Format Cells pane on the Font tab.`,icon:`CellsFormat`,shortcut:[`ctrl+shift+F`,`ctrl+alt+F`]},formatNumberFormat:{label:`Number Format`,description:`Choose the format for your cells, such as percentage, currency, date or time.`,tags:[`mutator`]},formatNumberFormatGeneralStyle:{label:`General Style`,description:`Remove all specific formatting.`,shortcut:`ctrl+shift+Backquote`,tags:[`mutator`]},formatNumberFormatNumberStyle:{label:`Number Style`,description:`Format as number with two decimals and comma.`,shortcut:`ctrl+shift+1`,tags:[`mutator`]},formatNumberFormatTimeStyle:{label:`Time Style`,description:`Format as time with hour and minute, and AM or PM.`,shortcut:`ctrl+shift+2`,tags:[`mutator`]},formatNumberFormatDateStyle:{label:`Date Style`,description:`Format as date with day, month, and year.`,shortcut:`ctrl+shift+3`,tags:[`mutator`]},formatNumberFormatAccountingStyle:{label:`Accounting Style`,description:`Format as Dollars, Euros, or other currency.`,icon:`CurrencyDollar`,shortcut:`ctrl+shift+4`,tags:[`mutator`,`quickAction`]},formatNumberFormatPercentStyle:{label:`Percent Style`,description:`Format as a percentage.`,icon:`Percent`,shortcut:`ctrl+shift+5`,tags:[`mutator`,`quickAction`]},formatNumberFormatScientificStyle:{label:`Scientific Style`,description:`Format as a scientific number with two decimal places .`,shortcut:`ctrl+shift+6`,tags:[`mutator`]},formatNumberFormatCommaStyle:{label:`Comma Style`,description:`Format with a thousands separator.`,icon:`Comma`,shortcut:`ctrl+,`,tags:[`mutator`,`quickAction`]},formatNumberFormatIncreaseDecimal:{label:`Increase Decimal`,description:`Show more decimal places for a more precise value.`,icon:`IncreaseDecimal2`,tags:[`mutator`,`quickAction`]},formatNumberFormatDecreaseDecimal:{label:`Decrease Decimal`,description:`Show few decimal places.`,icon:`DecreaseDecimal2`,tags:[`mutator`,`quickAction`]},displayPlaceholdersToggle:{label:`Display Placeholders`,description:`Switch between hiding objects, displaying objects, and displaying placeholders for objects.`,shortcut:`ctrl+6`},noOp:{label:`Do nothing`,description:`Do Nothing.`,shortcut:`ctrl+7`},displayOutlineSymbolsToggle:{label:`Display Outline Symbols`,description:`Display or hide the outline symbols.`,shortcut:`ctrl+8`},hideRows:{label:`{count, plural, one{Hide Row} other{Hide # Rows}}`,description:`Hide the rows.`,icon:`HideRow`,shortcut:`ctrl+9`,tags:[`mutator`],params:{count:1}},unhideRows:{label:`Unhide Rows`,description:`Unhide the rows.`,icon:`ShowRow`,shortcut:`ctrl+shift+(`,tags:[`mutator`]},hideColumns:{label:`{count, plural, one{Hide Column} other{Hide # Columns}}`,description:`Hide the columns.`,icon:`HideColumn`,shortcut:[`ctrl+0`,`ctrl+alt+0`],tags:[`mutator`],params:{count:1}},unhideColumns:{label:`Unhide Columns`,description:`Unhide the columns.`,icon:`ShowColumn`,shortcut:`ctrl+shift+)`,tags:[`mutator`]},group:{label:`{span, select, columns{Group Columns} rows{Group Rows} other{Group}}`,description:`Group the selected rows or columns, or both for a cell selection, so they can be collapsed and expanded together.`,icon:`Group`,tags:[`mutator`],params:{span:`both`}},groupRows:{label:`Group Rows`,description:`Group the selected rows so they can be collapsed and expanded together.`,shortcut:`alt+shift+ArrowDown`,tags:[`mutator`]},groupColumns:{label:`Group Columns`,description:`Group the selected columns so they can be collapsed and expanded together.`,tags:[`mutator`],shortcut:`alt+shift+ArrowRight`},ungroup:{label:`{span, select, columns{Ungroup Columns} rows{Ungroup Rows} other{Ungroup}}`,description:`Remove the selected rows or columns, or both for a cell selection, from their group.`,icon:`Ungroup`,tags:[`mutator`],params:{span:`both`}},ungroupRows:{label:`Ungroup Rows`,description:`Remove the selected rows from their group.`,shortcut:`alt+shift+ArrowUp`,tags:[`mutator`]},ungroupColumns:{label:`Ungroup Columns`,description:`Remove the selected columns from their group.`,tags:[`mutator`],shortcut:`alt+shift+ArrowLeft`},showDetail:{label:`Show Detail`,description:`Expand the group at the selection.`,icon:`OutlineShowDetail`,tags:[`mutator`]},hideDetail:{label:`Hide Detail`,description:`Collapse the group at the selection.`,icon:`OutlineHideDetail`,tags:[`mutator`]},outlineToggleGroup:{label:`Collapse or Expand Group`,description:`Collapse or expand one group from its button in the outline gutter.`,tags:[`mutator`]},outlineShowLevel:{label:`Show Outline Level`,description:`Show the groups down to a level and collapse the rest.`,tags:[`mutator`]},clearOutline:{label:`Clear Outline`,description:`Remove the selected rows and columns from every group.`,tags:[`mutator`]},autoOutline:{label:`Auto Outline`,description:`Group the rows and columns from the sheet's formulas: each total becomes a summary of the cells it adds up.`,tags:[`mutator`]},outlineSettings:{label:`Outline Settings…`,description:`Choose where summary rows and columns sit, and whether the outline styles apply.`,tags:[`mutator`]},calculate:{label:`Calculate Sheet`,description:`Recalculate the formulas on the current sheet.`,icon:`CalculateSheet`,shortcut:[`shift+F9`,`ctrl+=`]},insertFunctionDialog:{label:`Insert Function`,description:`Work with the function in the current cell.`,groupLabels:{insertFunctionSumOptions:`Function…`},icon:`FunctionThin`,shortcut:`shift+F3`,borrow:[`workbook`],tags:[`mutator`]},sheetZoomOut:{label:`Zoom Out`,description:`Zoom out to see less detail but more area.`,shortcut:[`ctrl+alt+-`,`ctrl+alt+NumpadSubtract`]},sheetZoomIn:{label:`Zoom In`,description:`Zoom in to see more detail but less area.`,shortcut:[`ctrl+alt+=`,`ctrl+alt+NumpadAdd`]},sheetZoom100:{label:`Zoom 100%`,description:`Zoom document to 100%.`,shortcut:`ctrl+alt+o`},sheetZoom200:{label:`Zoom 200%`,description:`Zoom document to 200%.`},sheetZoom75:{label:`Zoom 75%`,description:`Zoom document to 75%.`},sheetZoom50:{label:`Zoom 50%`,description:`Zoom document to 50%.`},sheetZoom25:{label:`Zoom 25%`,description:`Zoom document to 25%.`},sheetZoomSelection:{label:`Zoom to Selection`,description:`Zoom so the selected range fills the window.`},sheetZoomCustom:{label:`Custom Zoom`,description:`Zoom document to a custom scale.`,groupLabels:{sheetZoomOptions:`Custom`}},updateHyperlink:{label:`Link`,description:`Create a hyperlink to either another webpage or another location within this document.`,groupLabels:{contextMenu:`Insert Link…`,hyperlinkOptions:`Edit…`},icon:`HyperlinkInsert`,shortcut:[`ctrl+K`,`ctrl+alt+K`]},openContextMenu:{label:`Context Menu`,description:`Open the context menu.`,shortcut:[`shift+F10`,`ContextMenu`]},openHyperlink:{label:`Open Link`,description:`Open the hyperlink or goto another location within this document.`,groupLabels:{hyperlinkOptions:`Open`},icon:`HyperlinkGoto`,shortcut:`ctrl+Enter`},deleteHyperlink:{label:`Delete Link`,description:`Remove the hyperlink.`,groupLabels:{hyperlinkOptions:`Delete`},icon:`HyperlinkDelete`},editNote:{label:`{note, select, yes{Edit Note} other{Insert Note}}`,description:`Add a note to the cell, or edit the one it has.`,icon:`NoteInsert`,shortcut:`shift+F2`,params:{note:`no`},groupLabels:{contextMenu:`{note, select, yes{Edit Note} other{Insert Note…}}`,noteOptions:`Edit`}},showHideNote:{label:`Show Note`,description:`Keep the note on the sheet. Otherwise it shows only while its cell is pointed at.`,groupLabels:{noteOptions:`Show`}},showAllNotes:{label:`Show All Notes`,description:`Keep every note on the sheet. When every note is already shown, hide them all.`},updateComments:{label:`{thread, select, yes{Show Comment} other{Insert Comment}}`,description:`Add a comment to the cell, or reply to the one it has.`,groupLabels:{contextMenu:`{thread, select, yes{Show Comment} other{Insert Comment…}}`},icon:`CommentInsert`,shortcut:`ctrl+alt+M`,params:{thread:`no`}},deleteComments:{label:`Delete Comments`,description:`Remove any comments.`,icon:`CommentDelete`,groupLabels:{noteOptions:`Delete`}},previousComment:{label:`Previous Comment`,description:`Go to the comment before the selected cell.`,icon:`CommentPrevious`},nextComment:{label:`Next Comment`,description:`Go to the comment after the selected cell.`,icon:`CommentNext`},showCommentsPane:{label:`Show Comments`,description:`List every comment on the sheet in a pane.`,icon:`CommentManage`},convertNotesToComments:{label:`Convert to Comments`,description:`Convert every note on the sheet to a comment that can be replied to.`},insertImageFromFile:{label:`Insert Image`,description:`Insert a picture from your device.`,groupLabels:{contextMenu:`Insert Image…`,insertImageOverCellsOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageFromURL:{label:`Insert Image From Web`,description:`Insert a picture from the web.`,groupLabels:{insertImageOverCellsOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},insertImageInCellFromFile:{label:`Insert Image in Cell`,description:`Insert a picture from your device as the value of the selected cell.`,groupLabels:{insertImageInCellOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageInCellFromURL:{label:`Insert Image in Cell From Web`,description:`Insert a picture from the web as the value of the selected cell.`,groupLabels:{insertImageInCellOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},insertShape:{label:`Shapes`,description:`Insert a ready-made shape, such as a rectangle, an arrow, a callout or a flowchart symbol.`,icon:`shape:Shapes`,tags:[`mutator`]},insertChart:{label:`Insert Chart`,description:`Insert a chart of the selected cells.`,groupLabels:{contextMenu:`Insert Chart…`},shortcut:`alt+F1`,tags:[`mutator`]},sheetBackgroundToggle:{label:`Toggle Sheet Background`,description:`Add or remove the picture that is tiled behind the sheet's cells.`,icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromFile:{label:`Sheet Background From Device`,description:`Use a picture from your device as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From Device…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromURL:{label:`Sheet Background From Web`,description:`Use a picture from the web as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From the Web…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundDelete:{label:`Delete Sheet Background`,description:`Remove the sheet's background picture.`,groupLabels:{sheetBackgroundOptions:`Delete Background`},icon:`Delete`,tags:[`mutator`]},manageDataValidation:{label:`Data Validation`,description:`Manage data validation rules to limit the type of data entered in a cell.`,groupLabels:{contextMenu:`Data Validation…`,dataValidationOptions:`Manage Rules…`},icon:`DataValidation`},dataValidationList:{label:`Data Validation List`,description:`Limit the selected cells to a list, seeded with the values already there.`,groupLabels:{dataValidationOptions:`List…`}},dataValidationUnique:{label:`Require Unique Values`,description:`Allow each value only once in the selected cells.`,groupLabels:{dataValidationOptions:`Unique`},tags:[`mutator`]},dataValidationShowInvalid:{label:`Show Invalid Data`,description:`Mark the cells whose value fails a data validation.
21
+ A view setting: it changes nothing in the rules.`,groupLabels:{dataValidationOptions:`Show Invalid`}},dataValidationNewRule:{label:`New Data Validation Rule`,description:`Create a new data validation rule for the selected cells.`,groupLabels:{dataValidationOptions:`New Rule…`}},dataValidationClearSelection:{label:`Clear Data Validation from Selected Cells`,description:`Remove the selected cells from every data validation rule covering them.`,groupLabels:{dataValidationClearOptions:`From Selected Cells`},tags:[`mutator`]},dataValidationClearSheet:{label:`Clear Data Validation from Entire Sheet`,description:`Remove every data validation rule on this sheet.`,groupLabels:{dataValidationClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageConditionalFormat:{label:`Conditional Formatting`,description:`Manage conditional formatting rules to change how cells look based on their values.`,groupLabels:{contextMenu:`Conditional Formatting…`,conditionalFormatOptions:`Manage Rules…`},icon:`ConditionalFormatOptions`},conditionalFormatNewRule:{label:`New Conditional Formatting Rule`,description:`Create a new conditional formatting rule for the selected cells.`,groupLabels:{conditionalFormatOptions:`New Rule…`}},conditionalFormatGreaterThan:{label:`Highlight Cells Greater Than`,description:`Highlight cells whose value is greater than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Greater Than…`},tags:[`mutator`]},conditionalFormatLessThan:{label:`Highlight Cells Less Than`,description:`Highlight cells whose value is less than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Less Than…`},tags:[`mutator`]},conditionalFormatBetween:{label:`Highlight Cells Between`,description:`Highlight cells whose value is between two values you set.`,groupLabels:{conditionalFormatHighlightOptions:`Between…`},tags:[`mutator`]},conditionalFormatEqualTo:{label:`Highlight Cells Equal To`,description:`Highlight cells whose value equals a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Equal To…`},tags:[`mutator`]},conditionalFormatTextContains:{label:`Highlight Cells with Text that Contains`,description:`Highlight cells whose text contains a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Text that Contains…`},tags:[`mutator`]},conditionalFormatDateOccurring:{label:`Highlight Cells with a Date Occurring`,description:`Highlight cells whose date falls in a period you set.`,groupLabels:{conditionalFormatHighlightOptions:`A Date Occurring…`},tags:[`mutator`]},conditionalFormatDuplicateValues:{label:`Highlight Duplicate Values`,description:`Highlight cells whose value appears more than once in the selection.`,groupLabels:{conditionalFormatHighlightOptions:`Duplicate Values…`},tags:[`mutator`]},conditionalFormatTopItems:{label:`Highlight Top 10 Items`,description:`Highlight the highest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10 Items…`},tags:[`mutator`]},conditionalFormatTopPercent:{label:`Highlight Top 10%`,description:`Highlight the top percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10%…`},tags:[`mutator`]},conditionalFormatBottomItems:{label:`Highlight Bottom 10 Items`,description:`Highlight the lowest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10 Items…`},tags:[`mutator`]},conditionalFormatBottomPercent:{label:`Highlight Bottom 10%`,description:`Highlight the bottom percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10%…`},tags:[`mutator`]},conditionalFormatAboveAverage:{label:`Highlight Above Average`,description:`Highlight values above the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Above Average…`},tags:[`mutator`]},conditionalFormatBelowAverage:{label:`Highlight Below Average`,description:`Highlight values below the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Below Average…`},tags:[`mutator`]},conditionalFormatDataBar:{label:`Data Bars`,description:`Add a colored bar to each cell whose length represents its value.`,groupLabels:{conditionalFormatOptions:`Data Bars`},tags:[`mutator`]},conditionalFormatColorScale:{label:`Color Scales`,description:`Color each cell along a gradient according to its value.`,groupLabels:{conditionalFormatOptions:`Color Scales`},tags:[`mutator`]},conditionalFormatIconSet:{label:`Icon Sets`,description:`Show an icon in each cell according to its value.`,groupLabels:{conditionalFormatOptions:`Icon Sets`},tags:[`mutator`]},conditionalFormatClearSelection:{label:`Clear Rules from Selected Cells`,description:`Remove the conditional formatting rules that touch the selected cells.`,groupLabels:{conditionalFormatClearOptions:`From Selected Cells`},tags:[`mutator`]},conditionalFormatClearSheet:{label:`Clear Rules from Entire Sheet`,description:`Remove every conditional formatting rule on this sheet.`,groupLabels:{conditionalFormatClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageProtectedRange:{label:`Allow Edit Ranges`,description:`Manage ranges that stay editable while the sheet is protected.`,groupLabels:{contextMenu:`Allow Edit Ranges…`},icon:`Lock`},dataRemoveDuplicates:{label:`Remove Duplicates`,description:`Remove duplicate rows from a sheet.`,icon:`DataRemoveDuplicates`,tags:[`mutator`]},dataTextToColumns:{label:`Text to Columns`,description:`Split a single columns of text into multiple columns.`,icon:`DataTextToColumns`,tags:[`mutator`]},insertTable:{label:`Insert Table`,description:`Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.`,groupLabels:{contextMenu:`Insert Table…`},icon:`TableInsert`,shortcut:[`ctrl+L`]},insertCheckbox:{label:`Checkbox`,description:`Insert checkboxes in the selected cells. A checked box is TRUE and an unchecked box is FALSE.`,icon:`CheckboxInsert`,tags:[`mutator`]},insertCellControl:{label:`Cell Control`,description:`Insert a cell control of the given type in the selected cells, replacing any control there and keeping the values. A value type, such as a button, replaces the values instead.`,icon:`CheckboxInsert`,tags:[`mutator`]},formatCellControl:{label:`Control Options`,description:`Show the options of the cell control under the active cell.`,icon:`CellsFormat`},editTable:{label:`Edit Table…`,description:`Edit the table to adjust formatting, sorting, filtering, or other advanced features.`,groupLabels:{tableOptions:`Edit…`,namedItem:`Edit…`},icon:`TableInsert`},deleteTable:{label:`Delete Table`,description:`Remove the table.
22
+
23
+ The table and table specific styling will be removed but the values will be preserved.`,groupLabels:{tableOptions:`Delete`,namedItem:`Delete`},icon:`TableInsert`,tags:[`mutator`]},convertTableToRange:{label:`Convert To Range`,description:`Convert the table into a normal range of cells.
24
+
25
+ The values and the formatting are preserved.`,icon:`TableInsert`,tags:[`mutator`]},insertPivotTable:{label:`PivotTable`,description:`Summarize data in a PivotTable. Choose its source and where it goes, then pick its fields.`,groupLabels:{contextMenu:`Insert PivotTable…`},icon:`Pivot`},editPivotTable:{label:`Edit PivotTable…`,description:`Show the PivotTable's fields to choose what it groups and what it computes.`,groupLabels:{pivotToolbar:`Field List`},icon:`Pivot`},refreshPivotTable:{label:`Refresh PivotTable`,description:`Read the PivotTable's source again and lay it out.`,groupLabels:{pivotRefreshOptions:`Refresh`},icon:`RefreshAll`,shortcut:`alt+F5`},deletePivotTable:{label:`Delete PivotTable`,description:`Remove the PivotTable and its cells.`,icon:`Delete`},formatPivotStyle:{label:`PivotTable Styles`,description:`Apply a style to the PivotTable.`,icon:`PresetStyles`},formatPivotStyleClear:{label:`Clear PivotTable Style`,description:`Remove the PivotTable's style.`,icon:`ClearFormats`},tableFilterToggle:{label:`Sort & Filter`,description:`Toggle Auto Table on/off.`,groupLabels:{filterOptions:`Filter`,sortFilterOptions:`Sort & Filter`},icon:`FilterToggle`,shortcut:`ctrl+shift+L`},formatPainterToggle:{label:`Format Painter`,description:`Apply style to another part of your workbook.`,icon:`FormatPaint.yellow`},insertCells:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{{mode, select, copy{Insert Copied Cells} cut{Insert Cut Cells} other{Insert Cells}}{shift, select, right{ (Shift Right)} down{ (Shift Down)} other{}}}}`,description:`Inserts cells at the current selection.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied At Selection} cut{Cut At Selection} other{At Selection}}`},icon:`InsertCells`,shortcut:`ctrl+shift+Equal`,params:{mode:`none`,shift:`none`,span:`none`,count:1}},insertCellsShiftRight:{label:`{span, select, columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{Insert Cells (Shift Right)}}`,description:`Insert cells to the left and shift the current cells to the right.`,groupLabels:{insertCellsOptions:`{span, select, columns{{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}} other{Shift Right}}`},icon:`InsertCellsRight`,params:{mode:`none`,span:`none`,count:1}},insertCellsShiftDown:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} other{Insert Cells (Shift Down)}}`,description:`Insert cells above and shift the current cells downward.`,groupLabels:{insertCellsOptions:`{span, select, rows{{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}} other{Shift Down}}`},icon:`InsertCellsDown`,params:{mode:`none`,span:`none`,count:1}},insertRows:{label:`{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}`,description:`Insert a row above the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}`},icon:`InsertRow`,params:{count:1,mode:`none`}},insertColumns:{label:`{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}`,description:`Insert a column before the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}`},icon:`InsertColumn2`,params:{count:1,mode:`none`}},insertRowsAfter:{label:`{mode, select, copy{Insert Copied Rows Below} cut{Insert Cut Rows Below} other{{count, plural, one{Insert Row Below} other{Insert # Rows Below}}}}`,description:`Insert a row below the current position.`,groupLabels:{insertCellsOptions:`Row Below`},params:{count:1,mode:`none`}},insertColumnsAfter:{label:`{mode, select, copy{Insert Copied Columns After} cut{Insert Cut Columns After} other{{count, plural, one{Insert Column After} other{Insert # Columns After}}}}`,description:`Insert a column after the current position.`,groupLabels:{insertCellsOptions:`Column After`},params:{count:1,mode:`none`}},deleteCells:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells{shift, select, left{ (Shift Left)} up{ (Shift Up)} other{}}}}`,description:`Delete the cells.`,groupLabels:{deleteCellsOptions:`At Selection`},icon:`DeleteCells`,shortcut:`ctrl+Minus`,params:{span:`none`,count:1,shift:`none`}},deleteCellsShiftUp:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} other{Delete Cells (Shift Up)}}`,description:`Delete cells the current current downward.`,groupLabels:{deleteCellsOptions:`{span, select, rows{{count, plural, one{Row} other{# Rows}}} other{Shift up}}`},icon:`DeleteCellsUp`,params:{span:`none`,count:1}},deleteCellsShiftLeft:{label:`{span, select, columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells (Shift Left)}}`,description:`Delete cells the current cells to the right.`,groupLabels:{deleteCellsOptions:`{span, select, columns{{count, plural, one{Column} other{# Columns}}} other{Shift Left}}`},icon:`DeleteCellsLeft`,params:{span:`none`,count:1}},deleteRows:{label:`{count, plural, one{Delete Row} other{Delete # Rows}}`,description:`Delete the rows at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Row} other{# Rows}}`},icon:`DeleteRows`,params:{count:1}},deleteColumns:{label:`{count, plural, one{Delete Column} other{Delete # Columns}}`,description:`Delete the columns at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Column} other{# Columns}}`},icon:`DeleteColumns`,params:{count:1}},flashFill:{label:`Flash Fill`,description:`Do a flash fill.`,shortcut:[`ctrl+e`,`ctrl+alt+e`]},fillDown:{label:`Fill Down`,description:`Copy the top-most value from the selection to the bottom of the selection.`,icon:`FillDown`,shortcut:[`ctrl+d`,`ctrl+alt+d`],tags:[`mutator`]},fillRight:{label:`Fill Right`,description:`Copy the left-most value from the selection to the right of the selection.`,icon:`FillRight`,shortcut:[`ctrl+r`],tags:[`mutator`]},fillUp:{label:`Fill Up`,description:`Copy the bottom-most value from the selection to the top of the selection.`,icon:`FillUp`,tags:[`mutator`]},fillLeft:{label:`Fill Left`,description:`Copy the right-most value from the selection to the left of the selection.`,icon:`FillLeft`,tags:[`mutator`]},fillSeries:{label:`Series…`,description:`Fill the selection with a series of numbers or dates, choosing the type, step value and stop value.`,tags:[`mutator`]},formatBorderAddOutline:{label:`Add Outline Border`,description:`Apply an outline border.`,shortcut:`ctrl+shift+7`,tags:[`mutator`]},formatBorderClearOutline:{label:`Remove Outline Border`,description:`Remove the outline border.`,shortcut:`ctrl+shift+_`,tags:[`mutator`]},formatIndentDecrease:{label:`Decrease Indent`,description:`Move your content closer to the border.`,icon:`FormatIndentDecrease`,tags:[`mutator`,`quickAction`]},formatIndentIncrease:{label:`Increase Indent`,description:`Move your content further from the border.`,icon:`FormatIndentIncrease`,tags:[`mutator`,`quickAction`]},mergeToggle:{label:`Merge`,description:`Combine and center the contents into a single cell.`,icon:`MergeAll`,shortcut:`ctrl+m`},mergeHorizontal:{label:`Merge Horizontally`,description:`Combine the contents into horizontal rows.`,icon:`MergeHorizontal`},mergeVertical:{label:`Merge Vertically`,description:`Combine the contents into vertical columns.`,icon:`MergeVertical`},unmerge:{label:`Unmerge`,description:`Split merged cells into multiple cells.`,icon:`MergeUnMerge`},clearContents:{label:`Clear Contents`,description:`Clear only the contents in the cells.
26
+
27
+ The formatting is not cleared.`,groupLabels:{clearOptions:`Contents`},icon:`ClearContents`,shortcut:`Delete`,tags:[`mutator`]},clearFormulas:{label:`Clear Formulas`,description:`Remove the formulas from the cells and keep the values they show.
28
+
29
+ The same as copying the cells and pasting them as values.`,groupLabels:{clearOptions:`Formulas`}},clearFormats:{label:`Clear Formats`,description:`Clear only the formatting that is applied to the cells.`,groupLabels:{clearOptions:`Formats`},icon:`ClearFormats`,tags:[`mutator`]},clearHyperlinks:{label:`Clear Hyperlinks`,description:`Clear only the hyperlinks in the cells.`,groupLabels:{clearOptions:`Hyperlinks`}},clearComments:{label:`Clear Comments`,description:`Clear the comments from the cells.
30
+
31
+ Notes are not cleared.`,groupLabels:{clearOptions:`Comments`}},clearNotes:{label:`Clear Notes`,description:`Clear the notes from the cells.
32
+
33
+ Comments are not cleared.`,groupLabels:{clearOptions:`Notes`}},clearAll:{label:`Clear All`,description:`Clears everything from the cells.
34
+
35
+ All contents and formatting are removed.`,groupLabels:{clearOptions:`All`},icon:`ClearAll`,shortcut:`ctrl+shift+Delete`,tags:[`mutator`]},freezeToggle:{label:`Freeze Panes`,description:`Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).`,icon:`FreezeBoth`},freezeToggleHorizontal:{label:`Freeze Top Rows`,description:`Keep the top rows visible while scrolling through the rest of the sheet.`,icon:`FreezeRows`},freezeToggleVertical:{label:`Freeze Left Columns`,description:`Keep the left columns visible while scrolling through the rest of the sheet.`,icon:`FreezeColumns`},unfreeze:{label:`Unfreeze Panes`,description:`Unfreeze both the rows and columns.`,icon:`MergeUnMerge`},freezePanesAt:{label:`Move Freeze`,description:`Freeze the rows or columns up to the given one.`},autoFitRows:{label:`Autofit Rows`,description:`Adjust the rows to the best height.`,icon:`RowsResizeAuto`,tags:[`mutator`]},resizeRows:{label:`Resize Rows`,description:`Resize the rows to the specified height.`,icon:`RowsResize`,tags:[`mutator`]},autoFitColumns:{label:`Autofit Columns`,description:`Adjust the columns to the best width.`,icon:`ColumnsResizeAuto`,tags:[`mutator`]},resizeColumns:{label:`Resize Columns`,description:`Resize the columns to the specified width.`,icon:`ColumnsResize`,tags:[`mutator`]},pasteValues:{label:`Paste Values`,description:`Paste only the values of the selected cells.
36
+
37
+ The formatting is not applied.`,groupLabels:{pasteOptions:`Values`},icon:`PasteValues`,shortcut:`ctrl+shift+V`},pasteFormats:{label:`Paste Formatting`,description:`Paste only the formats of the selected cells.
38
+
39
+ The content is not applied.`,groupLabels:{pasteOptions:`Formatting`},icon:`PasteFormats`},pasteFormulas:{label:`Paste Formulas`,description:`Paste only the formulas of the selected cells. The values and formatting is not applied.`,groupLabels:{pasteOptions:`Formulas`},icon:`PasteFormulas`},pasteTranspose:{label:`Paste Transpose`,description:`Paste with the rows and columns flipped.`,groupLabels:{pasteOptions:`Transpose`},icon:`PasteTranspose`},pasteLinks:{label:`Paste Links`,description:`Paste as formula references to the original cells.`,groupLabels:{pasteOptions:`Links`},icon:`PasteLinks`},undo:{label:`Undo`,icon:`Undo`,shortcut:`ctrl+z`,borrow:[`workbook`],description:`{hasAction, select, true{Undo {action}} other{Undo the last action.}}`,params:{hasAction:!1,action:``}},redo:{label:`Redo`,icon:`Redo`,shortcut:[`ctrl+y`,`F4`,`alt+Enter`],borrow:[`workbook`],description:`{hasAction, select, true{Redo {action}} other{Repeat the last action or undo the redo.}}`,params:{hasAction:!1,action:``}}}}},{sourceId:`slicer`,catalog:{scope:`slicer`,label:`Slicer`,tag:`en`,version:1,commands:{formatSlicerStyle:{label:`Slicer Styles`,description:`Change how the slicer and its items look.`,icon:`PresetStyles`,tags:[`mutator`]}}}},{sourceId:`sparkline`,catalog:{scope:`sparkline`,label:`Sparkline`,tag:`en`,version:1,commands:{sparklineEditData:{label:`Edit Data`,description:`Change the cells the active cell's sparkline group draws in, and the cells it draws.`,icon:`NamedRangeEdit`,groupLabels:{sparklineOptions:`Edit Group Location & Data…`},tags:[`mutator`]},sparklineTypeLine:{label:`Line`,description:`Change the selected sparkline groups to line sparklines.`,icon:`SparklineLine`,tags:[`mutator`]},sparklineTypeColumn:{label:`Column`,description:`Change the selected sparkline groups to column sparklines.`,icon:`SparklineColumn`,tags:[`mutator`]},sparklineTypeWinLoss:{label:`Win/Loss`,description:`Change the selected sparkline groups to win/loss sparklines: up for a positive value, down for a negative one.`,icon:`SparklineWinLoss`,tags:[`mutator`]},sparklineShowOptions:{label:`Show`,description:`Choose which points the sparklines highlight.`},sparklineHighPointToggle:{label:`Toggle High Point`,description:`Highlight the highest point of each sparkline.`,groupLabels:{sparklineShowOptions:`High Point`},tags:[`mutator`]},sparklineLowPointToggle:{label:`Toggle Low Point`,description:`Highlight the lowest point of each sparkline.`,groupLabels:{sparklineShowOptions:`Low Point`},tags:[`mutator`]},sparklineNegativePointsToggle:{label:`Toggle Negative Points`,description:`Highlight the negative points of each sparkline.`,groupLabels:{sparklineShowOptions:`Negative Points`},tags:[`mutator`]},sparklineFirstPointToggle:{label:`Toggle First Point`,description:`Highlight the first point of each sparkline.`,groupLabels:{sparklineShowOptions:`First Point`},tags:[`mutator`]},sparklineLastPointToggle:{label:`Toggle Last Point`,description:`Highlight the last point of each sparkline.`,groupLabels:{sparklineShowOptions:`Last Point`},tags:[`mutator`]},sparklineMarkersToggle:{label:`Toggle Markers`,description:`Show a marker on every point of a line sparkline.`,groupLabels:{sparklineShowOptions:`Markers`},tags:[`mutator`]},sparklineColorSeries:{label:`Sparkline Color`,description:`Color the line or columns of the selected sparkline groups.`,icon:`stroke.colored`,tags:[`mutator`]},sparklineColorNegative:{label:`Negative Points Color`,description:`Color the negative points of the selected sparkline groups.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`Negative Points`},tags:[`mutator`]},sparklineColorMarkers:{label:`Markers Color`,description:`Color the markers of the selected line sparkline groups.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`Markers`},tags:[`mutator`]},sparklineColorHigh:{label:`High Point Color`,description:`Color the highest point of each sparkline.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`High Point`},tags:[`mutator`]},sparklineColorLow:{label:`Low Point Color`,description:`Color the lowest point of each sparkline.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`Low Point`},tags:[`mutator`]},sparklineColorFirst:{label:`First Point Color`,description:`Color the first point of each sparkline.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`First Point`},tags:[`mutator`]},sparklineColorLast:{label:`Last Point Color`,description:`Color the last point of each sparkline.`,icon:`fill.colored`,groupLabels:{sparklineMarkerColorOptions:`Last Point`},tags:[`mutator`]},sparklineColorAxis:{label:`Axis Color`,description:`Color the horizontal axis of the selected sparkline groups.`,icon:`stroke.colored`,tags:[`mutator`]},sparklineAxisOptions:{label:`Axis`,description:`Change the axes, the scaling and how empty and hidden cells are drawn.`},sparklineAxisToggle:{label:`Toggle Axis`,description:`Draw a horizontal axis at zero when zero is within the range.`,groupLabels:{sparklineAxisOptions:`Show Axis`},tags:[`mutator`]},sparklineRightToLeftToggle:{label:`Toggle Right-to-Left`,description:`Draw the points from right to left.`,groupLabels:{sparklineAxisOptions:`Plot Data Right-to-Left`},tags:[`mutator`]},sparklineSameMinToggle:{label:`Toggle Same Minimum`,description:`Scale every sparkline of the group to the group's lowest value.`,groupLabels:{sparklineAxisOptions:`Same Minimum for All Sparklines`},tags:[`mutator`]},sparklineSameMaxToggle:{label:`Toggle Same Maximum`,description:`Scale every sparkline of the group to the group's highest value.`,groupLabels:{sparklineAxisOptions:`Same Maximum for All Sparklines`},tags:[`mutator`]},sparklineEmptyCellsGap:{label:`Show Empty Cells as Gaps`,description:`Leave a gap where a cell is empty.`,groupLabels:{sparklineAxisOptions:`Empty Cells as Gaps`},tags:[`mutator`]},sparklineEmptyCellsZero:{label:`Show Empty Cells as Zero`,description:`Draw an empty cell as zero.`,groupLabels:{sparklineAxisOptions:`Empty Cells as Zero`},tags:[`mutator`]},sparklineEmptyCellsSpan:{label:`Connect Over Empty Cells`,description:`Draw the line straight across an empty cell.`,groupLabels:{sparklineAxisOptions:`Connect Data Points with Line`},tags:[`mutator`]},sparklineShowHiddenToggle:{label:`Toggle Hidden Data`,description:`Draw the values of hidden rows and columns.`,groupLabels:{sparklineAxisOptions:`Show Data in Hidden Rows and Columns`},tags:[`mutator`]},sparklineClearOptions:{label:`Clear`,description:`Clear the selected sparklines.`,icon:`ClearAll`},sparklineClear:{label:`Clear Selected Sparklines`,description:`Remove the sparklines from the selected cells. The cells' values stay.`,groupLabels:{sparklineClearOptions:`Clear Selected Sparklines`},icon:`ClearAll`,tags:[`mutator`]},sparklineClearGroups:{label:`Clear Selected Sparkline Groups`,description:`Remove every sparkline of the groups the selection touches.`,groupLabels:{sparklineClearOptions:`Clear Selected Sparkline Groups`},icon:`ClearAll`,tags:[`mutator`]}}}},{sourceId:`table`,catalog:{scope:`table`,label:`Table`,tag:`en`,version:1,commands:{insertSlicer:{label:`Insert Slicer`,description:`Add a slicer that filters the table by the selected column, or by a column picked from the list.`,icon:`SlicerInsert`,tags:[`mutator`]},tableStyleOptions:{label:`Table Style`,description:`Toggle which structural elements (header, total, banded rows/columns, filter) the table shows.`,groupLabels:{tableToolbar:`Style`}},tableTotalRowToggle:{label:`Toggle Table Total Row`,description:`Toggle Total Row on/off.`,groupLabels:{tableStyleOptions:`Total Row`},shortcut:`ctrl+alt+T`},tableHeaderRowToggle:{label:`Toggle Table Header Row`,description:`Toggle Header Row on/off.`,groupLabels:{tableStyleOptions:`Header Row`}},tableBandedRowsToggle:{label:`Toggle Table Banded Rows`,description:`Toggle Banded Rows on/off.`,groupLabels:{tableStyleOptions:`Banded Rows`}},tableFirstColumnToggle:{label:`Toggle Table First Column`,description:`Toggle First Column on/off.`,groupLabels:{tableStyleOptions:`First Column`}},tableLastColumnToggle:{label:`Toggle Table Last Column`,description:`Toggle Last Column on/off.`,groupLabels:{tableStyleOptions:`Last Column`}},tableBandedColumnsToggle:{label:`Toggle Table Banded Columns`,description:`Toggle Banded Columns on/off.`,groupLabels:{tableStyleOptions:`Banded Columns`}},tableFilterRefresh:{label:`Reapply Sort & Filter`,description:`Reapply the sort and filter with the latest changes.`,groupLabels:{filterOptions:`Reapply`,sortFilterOptions:`Reapply`},icon:`FilterReapply`,shortcut:`ctrl+alt+L`},tableFilterClear:{label:`Clear Sort & Filter`,description:`Clear the sort and filters criteria from the current area..`,groupLabels:{filterOptions:`Clear`,sortFilterOptions:`Clear`},icon:`FilterClear`},formatTableStyleClearTableStyle:{label:`Clear Table Style`,description:`Remove all the styling that is specific for the table.`,groupLabels:{tableStyleOptions:`Clear Style`},icon:`ClearFormats`}}}},{sourceId:`workbook`,catalog:{scope:`workbook`,label:`Workbook`,tag:`en`,version:1,commands:{addSheet:{label:`Insert Sheet`,description:`Insert sheet before the current sheet.`,groupLabels:{sheet:`Insert`},shortcut:[`shift+F11`,`shift+alt+F1`]},deleteSheet:{label:`Delete Sheet`,description:`Delete the sheet and all the data.`,groupLabels:{sheet:`Delete`}},duplicateSheet:{label:`Duplicate Sheet`,description:`Duplicate the current sheet.`,groupLabels:{sheet:`Duplicate`}},hideSheet:{label:`Hide Sheet`,description:`Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.`,groupLabels:{sheet:`Hide`},icon:`VisibilityOff`},nextSheet:{label:`Next Sheet`,description:`Activate the next sheet.`,groupLabels:{sheet:`Next`},shortcut:`ctrl+PageDown`},previousSheet:{label:`Previous Sheet`,description:`Activate the previous sheet.`,groupLabels:{sheet:`Previous`},shortcut:`ctrl+PageUp`},selectNextSheet:{label:`Select Next Sheet`,description:`Select the next sheet.`,groupLabels:{sheet:`Select Next`},shortcut:`ctrl+shift+PageDown`},selectPreviousSheet:{label:`Select Previous Sheet`,description:`Select the previous sheet.`,groupLabels:{sheet:`Select Previous`},shortcut:`ctrl+shift+PageUp`},workbookViewToggleShowFormulaBar:{label:`View Formula bar`,description:`Show or hide the formula bar.`,groupLabels:{view:`Formula Bar`}},workbookViewToggleShowTabs:{label:`View Sheet Tabs`,description:`Show or hide the sheet tabs.`,groupLabels:{view:`Sheet Tabs`}},workbookViewToggleShowStatusBar:{label:`View Status Bar`,description:`Show or hide the status bar.`,groupLabels:{view:`Status Bar`}},workbookViewToggleShowHorizontalScrollBar:{label:`View Horizontal Scrollbar`,description:`Show or hide the horizontal scrollbar.`,groupLabels:{view:`Horizontal Scrollbar`}},workbookViewToggleShowVerticalScrollBar:{label:`View Vertical Scrollbar`,description:`Show or hide the vertical scrollbar.`,groupLabels:{view:`Vertical Scrollbar`}},workbookViewToggleExpandFormulaBar:{label:`Toggle Expand Formula bar`,description:`Expand or collapse the formula bar.`,shortcut:`ctrl+shift+U`},locale:{label:`Regional Format`,description:`The regional format used for numbers and dates. This is saved with the workbook.`,icon:`Locale`},newCellStyle:{label:`New Cell Style…`,description:`Create a new named style can can be quickly used later.`,groupLabels:{cellStyle:`New Cell Style`},icon:`NewPresetStyles`},deleteCellStyle:{label:`Delete Cell Style`,description:`Remove a named style that is no longer needed.`,groupLabels:{cellStyle:`Delete`}},modifyCellStyle:{label:`Modify Cell Style`,description:`Update a style with the currently style.`,groupLabels:{cellStyle:`Modify`}},find:{label:`Find`,description:`Open the Find window.`,icon:`Find`,shortcut:[`ctrl+F`,`shift+F5`]},findReplace:{label:`Find & Replace`,description:`Open the Find & Replace window.`,icon:`FindReplace`,shortcut:[`ctrl+H`,`ctrl+alt+H`]},findNext:{label:`Find Next`,description:`Find the next match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`shift+F4`},findPrevious:{label:`Find Previous`,description:`Find the previous match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`ctrl+shift+F4`},goto:{label:`Go To`,description:`Open the 'Go To' window.`,icon:`GoTo`,shortcut:`ctrl+G`},selectNamed:{label:`Select Named`,description:`Select the named item.`},addNamedReference:{label:`Define Named Reference`,description:`Add a new named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Define Name…`},icon:`InsertNamedRange`},editNamedReference:{label:`Edit Named Reference…`,description:`Edit the named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Edit…`},icon:`NamedRangeEdit`},deleteNamedReference:{label:`Delete Named Reference`,description:`Remove the named reference.`,groupLabels:{namedItem:`Delete`},icon:`DeleteNamedRange`},manageExternalLinks:{label:`Workbook Links`,description:`See every workbook this one links to, go to the formulas that cite one, and break a link.`,icon:`ExternalLinked`},insertFunction:{label:`Insert Function`,description:`Insert a function into the current cell.`,icon:`FunctionThin`},selectTheme:{label:`Theme`,description:`Select a theme that coveys a style suitable for your data.`},calculateAll:{label:`Calculate Now`,description:`Recalculate the formulas whose values are out of date, on every sheet.`,icon:`Calculate`,shortcut:`F9`},calculateFull:{label:`Calculate Full`,description:`Recalculate every formula in the workbook, including those already up to date. Use this to replace the values a file was opened with.`,icon:`Calculate`,shortcut:`ctrl+alt+F9`},refreshAll:{label:`Refresh All`,description:`Get the latest data from every source the workbook reads: recalculate every formula, fetch what its functions read from the web again rather than from the copy the workbook keeps, update every external link, and refresh every PivotTable from its source.`,icon:`RefreshAll`,shortcut:`ctrl+alt+F5`},calcModeAutomatic:{label:`Automatic`,description:`Recalculate formulas whenever their inputs change.`},calcModeAutomaticExceptTables:{label:`Automatic Except for Data Tables`,description:`Recalculate formulas whenever their inputs change, except what-if data tables. Without data tables this is the same as Automatic.`},calcModeManual:{label:`Manual`,description:`Recalculate only when you ask (F9). Edits leave dependent formulas out of date until then.`},calcIterativeToggle:{label:`Enable Iterative Calculation`,description:`Resolve circular references by recalculating them repeatedly until they settle or the maximum iterations is reached. Off, a circular reference evaluates to 0.`},selectDirectPrecedents:{label:`Select Direct Precedents`,description:`Select the cells directly referenced by the formulas in the selection.`,shortcut:`ctrl+[`},selectPrecedents:{label:`Select All Precedents`,description:`Select all cells that contribute to the formulas in the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+{`},selectDirectDependents:{label:`Select Direct Dependents`,description:`Select the cells with formulas that directly reference the selection.`,shortcut:`ctrl+]`},selectDependents:{label:`Select All Dependents`,description:`Select all cells that are eventually affected by the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+}`},maximumWorkbookToggle:{label:`Maximize`,description:`Toggle showing the workbook maximized.`,shortcut:`ctrl+F10`},activeNameBox:{label:`Activate Name Box`,description:`Move the focus to the name box.`,shortcut:`alt+F3`},activeNameManager:{label:`Name Manager`,description:`Create, edit, delete, and find all the names used in the workbook.
40
+
41
+ Names can be used as a substitute for cell references.`,shortcut:`ctrl+F3`,icon:`NamedManager`,groupLabels:{namedItem:`Manage Names…`}},createNamedReferenceFromSelection:{label:`Create from Selection`,description:`Automatically generate names from the selected cells.`,shortcut:`ctrl+shift+F3`},spellCheck:{label:`Spell Check`,description:`Check the workbook for spelling mistakes.`,shortcut:`F7`},workbookStatistics:{label:`Workbook Statistics`,description:`Show the workbook statistics.`,icon:`WorkbookStatistics`,shortcut:`ctrl+shift+G`}}}}],{DefaultCommandCatalogService:gf}=G,_f=!1;function vf(){_f||(_f=!0,gf.registerFromManifest(`@sheetxl/react`,import.meta.url,{messages:mf,catalogs:hf}))}vf();var{CommandScope:yf,DefaultCommandRegistry:bf,FocusActivation:xf,CommandRegistryContext:Sf,CommandScopeContext:Cf,CommandAnchorProvider:wf,CommandFallbackProvider:Tf,useCommandScope:Ef}=G,Df=({initialAnchor:e,children:t})=>Ef()?(0,Z.jsx)(Z.Fragment,{children:t}):(0,Z.jsx)(Of,{initialAnchor:e,children:t});Df.displayName=`CommandRootProvider`;var Of=({initialAnchor:e,children:t})=>{let n=(0,X.useRef)(e),{root:r,registry:i,studioTracker:a}=(0,X.useMemo)(()=>{let e=bf,t=new yf(`app`,null,{registry:e});return{root:t,registry:e,studioTracker:new xf(t,n.current)}},[]);(0,X.useEffect)(()=>(r.connect(),()=>r.dispose()),[r]);let o=(0,X.useMemo)(()=>i.getDynamic(r.name),[i,r]);return(0,Z.jsx)(Sf.Provider,{value:i,children:(0,Z.jsx)(sf.Provider,{value:a,children:(0,Z.jsx)(Cf.Provider,{value:r,children:(0,Z.jsxs)(wf,{tracker:a,keyBindings:`synthetic`,debounce:100,children:[(0,Z.jsx)(of,{}),(0,Z.jsxs)(Tf,{children:[o.map((e,t)=>(0,Z.jsx)(e,{scope:r,data:void 0},t)),t]})]})})})})};Of.displayName=`CommandRootProviderOwn`;var{CommandScopeProvider:kf}=G,Af=(0,X.memo)(e=>{let{sheet:t,order:n}=e,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=()=>{let e=(e=>{let t=e.getView().getMovableSelection().getActive()?.getContent();if(!t)return null;let n=t.getType(),r=$t(n);return!r&&Qt(n)?(Xt(n),null):{type:n,label:t.getTypeDescription(),commands:r?.commands,toolbar:r?.toolbar}})(t);i(t=>{return n=t,r=e,n?.type===r?.type&&n?.label===r?.label&&n?.commands===r?.commands&&n?.toolbar===r?.toolbar?t:e;var n,r}),o(e?t.getView().getMovableSelection().getActive():null)};e();let n=t.getView().addListeners({onMovableSelectionChange:e}),r=en(e);return()=>{n(),r()}},[t]);let s=(0,X.useMemo)(()=>r?r.toolbar??wd(r.type,r.label):null,[r]);(0,X.useEffect)(()=>{if(s)return Ed(),Sd(s)},[s]);let c=he(),l=Ud(!0),u=(0,X.useMemo)(()=>a?{sheet:t,movable:a,notifier:c,activateTaskPane:(e,t)=>l.activate(e,t),taskPaneArea:l}:null,[t,a,c,l]);return r&&u?(0,Z.jsx)(kf,{spec:{scopeName:{key:`layer:movable:${r.type}`,name:r.type},contributor:r.commands?{dynamic:r.commands}:void 0,data:u},order:n+.5},r.type):null});Af.displayName=`MovableKindScope`;var{CommandScopeProvider:jf}=G,Mf=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,propsMovable:i,renderMovable:a}=e;s(n,[`onProtectionChange`]);let o=!n.getProtection().isObjectsAllowed();(0,X.useEffect)(()=>{o&&n.getView().getMovableSelection().clear()},[o,n]);let c=he(),l=ue(),u=je(),d=Ud(!0),f=(0,X.useMemo)(()=>({sheet:n,notifier:c,editModeHandler:l,activateTaskPane:(e,t)=>d.activate(e,t),taskPaneArea:d}),[n,c,l,d]),p=xt().zIndex;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jf,{spec:{scopeName:{key:`layer:movable`,name:`movable`},contributor:{dynamic:Bd},data:f},order:p,children:(0,Z.jsx)(vd,{ref:t,className:Q(r,`sxl-movable`),movables:n.getMovables(),disableResize:o,disableDrag:o,disabled:o,movableSelection:n.getView().getMovableSelection(),renderMovable:a,renderTip:e=>{let{kind:t,movable:r,bounds:i,rotation:a}=e;if(t===`rotate`)return u(`movable.tip.rotation`,{degrees:Math.round(a)});if(t===`resize`)return u(`movable.tip.size`,{width:Math.round(i.width),height:Math.round(i.height)});let o=r.getAnchorType?.()??Vn.Type.TwoCell;return o===Vn.Type.Absolute?u(`movable.tip.position`,{x:Math.round(i.x),y:Math.round(i.y)}):o===Vn.Type.OneCell?n.getRangeAtBounds({...i,width:0,height:0}).getAddress():n.getRangeAtBounds(i).getAddress()},...i,onFocus:()=>{i?.onFocus?.()}})}),(0,Z.jsx)(Af,{sheet:n,order:p})]})})),Nf=e=>e.getRange().getCoords(),Pf=(e,t)=>w.isCellWithinRange(t,Nf(e)),Ff=e=>{e.select()},If=e=>{let{sheet:t,hovered:n,renderToolbar:r}=e;return(0,Z.jsx)(Pu,{name:`table-toolbar`,sheet:t,hovered:n,rangeOf:Nf,contains:Pf,select:Ff,render:(e,t)=>Fu(r,Rf,{...t,table:e})})};If.displayName=`TableToolbarFloat`;var Lf=[`editTable`,`convertTableToRange`,`deleteTable`],Rf=e=>(0,Z.jsx)(Vu,{target:e.table,commandKeys:Lf,color:Yl(e.table,e.sheet),iconKey:`Table`,menuName:`table-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),zf=`_dropdown_1bnz9_13`,Bf=`white`,Vf=`black`,Hf=({handleProps:e,size:t,background:n})=>{let r=t/2-1.5,i=t/3;return(0,Z.jsx)(`div`,{...e,style:{...e.style,width:t,height:t},children:(0,Z.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:`block`,overflow:`visible`},children:(0,Z.jsx)(`path`,{shapeRendering:`crispEdges`,d:`M ${r-i} ${r} L ${r} ${r} L ${r} ${r-i}`,stroke:n,strokeWidth:2,strokeLinejoin:`miter`,fill:`none`})})})},Uf=(e,t)=>({rowStart:e.rowStart,colStart:e.colStart,rowEnd:Math.max(e.rowStart,t.rowIndex),colEnd:Math.max(e.colStart,t.colIndex)}),Wf=e=>[{text:e(`table.totals.none`),totals:null},{text:e(`table.totals.average`),totals:101},{text:e(`table.totals.count`),totals:103},{text:e(`table.totals.countNumbers`),totals:102},{text:e(`table.totals.max`),totals:104},{text:e(`table.totals.min`),totals:105},{text:e(`table.totals.stdDev`),totals:107},{text:e(`table.totals.sum`),totals:109},{text:e(`table.totals.var`),totals:110},{text:e(`table.totals.moreFunctions`),totals:`more`}],Gf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${Vf}' fill='${Bf}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`,Kf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Vf}' fill='${Bf}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,qf=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Vf}' fill='${Bf}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Jf=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,renderToolbar:r,className:i,...a}=e,s=qt(),{visibleTables:c,cacheToken:l}=uc(n),[u,d]=(0,X.useState)(()=>n.getSelection()?.getCoords().cell??null),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),b=(0,X.useRef)(!1),x=K(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});r.length===1&&r[0].select()},[s,n]),S=K(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};n.getRange(i).select()}},[s,n]),C=K(e=>{e.preventDefault(),e.stopPropagation();let t=s.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:t.colIndex,rowStart:e.rowStart,colEnd:t.colIndex,rowEnd:e.rowEnd};n.getRange(i).select()}},[s,n]);o(n?.getSelection(),{onChange(e){d(n.getSelection().getCoords().cell)}}),(0,X.useEffect)(()=>{let e=null;if(c&&u){let t=c.length;for(let n=0;n<t&&!e;n++){let t=c[n];if(t.isDeleted())continue;let r=t.getRange().getCoords();w.isCellWithinRange(u,r)&&(e=t)}}p(e)},[u,c]);let T=K(e=>{if(b.current)return;let t=null;if(c){let n=c.length;for(let r=0;!t&&r<n;r++){let n=c[r];if(n.isClosed()||n.isDeleted())continue;let i=n.getRange().getCoords(),a=s.getBoundsFromRange(i),o=s.getPanePointFromPointer(e.clientX,e.clientY);if(!o)continue;let l=o.x,u=o.y;if(l>=a.x&&l<=a.x+a.width&&u>=a.y&&u<=a.y+a.height){let e=s.getSurfaceSize();l<=0||u<=0||l>=e.width||u>=e.height||(t=n)}}}h(t)},[s,c]),E=K(()=>{b.current||h(null)},[]),D=ue().getMode()?.key===`edit`,O=(0,X.useMemo)(()=>{if(!f||!u||D||!f.isShowTotals())return null;let e=f.getTotalRowRange().getCoords();if(!e||u.rowIndex!==e.rowStart)return null;let t=f.getColumnAt(u.colIndex-e.colStart);return t&&n.getCell(u).isEditAllowed()?{cell:u,column:t}:null},[n,f,u,D,l]),k=je(),A=(0,X.useRef)(null);A.current=O;let[j]=G.useCommands([`insertFunctionDialog`]),N=zc({sheet:n,cell:null,anchor:null,resolveItems:K(async()=>Wf(k),[k]),getCurrentText:K(()=>{let e=A.current?.column.getTotalsRowFormula();return Wf(k).find(t=>t.totals===e)?.text??null},[k]),onChoose:K(e=>{let{totals:t}=e;t===`more`?j?.execute():A.current?.column.setTotalsRowFormula(t??void 0)},[j]),visibleRows:10,label:`totals-picker`}),P=(0,X.useRef)(N);P.current=N;let F=dt(!0),I=O?`${O.cell.rowIndex},${O.cell.colIndex}`:null,L=(0,X.useMemo)(()=>({}),[l,I]),R=K((e,t)=>{let n=A.current;return!n||t&&!w.isCellWithinRange(n.cell,t)?[]:[{cell:n.cell,value:n}]},[]),ee=K(e=>{let{value:t,style:n,zoom:r=1,key:i}=e,a=t;if(!n)return null;let o=n.width,s=n.height,c=17*r,l=Math.max(0,(c-s)/2);return(0,Z.jsx)(`div`,{style:{...n,position:`absolute`,top:n.top-l,width:o+c,height:s+2*l},children:(0,Z.jsx)(`div`,{className:zf,style:{position:`absolute`,left:o,top:l+(s-c)/2,width:c,height:c,pointerEvents:`auto`},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{if(e.button!==0)return;F(e),e.stopPropagation(),e.preventDefault();let t=P.current;t.isOpen?t.close():t.open({cell:a.cell,anchor:{range:w.cellToRange(a.cell)},minWidth:o})},children:(0,Z.jsx)(M,{iconKey:`ExpandMore`,size:.75*c})})},i)},[]),te=(0,X.useMemo)(()=>{if(!c||c.length===0)return null;let e=[],t=c.length;for(let r=0;r<t;r++){let t=c[r];if(t.isDeleted())continue;let i=t===m,a=t===f,o=t.getRange().getCoords(),l=s.getBoundsFromRange(o),u;if(i||a){let e=t.getStyle().getProperties(),r=e.headerRow?.fill?.background??e.wholeTable?.borders?.top?.color?.toString();if(r&&n){let e=n.getStyles().parseColor(r);e&&(u=e.toCSS(`adaptive`))}u||=`var(--sxl-color-shadow, rgba(0,0,0,.15))`}e.push((0,Z.jsx)(`div`,{className:`sxl-table-select-row`,style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:l.height,pointerEvents:`all`,cursor:Kf},onMouseDown:S},`table-select-row-${t.getName()}`)),e.push((0,Z.jsx)(`div`,{className:`sxl-table-select-column`,style:{position:`absolute`,left:l.x,top:l.y,width:l.width,height:Math.min(7,l.height),pointerEvents:`all`,cursor:Gf},onMouseDown:C},`table-select-column-${t.getName()}`)),e.push((0,Z.jsx)(`div`,{className:`sxl-table-select-all`,style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:Math.min(16,l.height),pointerEvents:`all`,cursor:qf},onMouseDown:x},`table-select-${t.getName()}`)),e.push((0,Z.jsx)(Pt,{className:`sxl-table-outline`,range:o,stroke:u??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:a||i?1:0,filter:i?`drop-shadow(0px 0px 1px ${u})`:void 0}}},`table-outline-${t.getName()}`))}return e},[n,s,m,f,c,l]),z=s.getVisibleRange(),B=(c??[]).map(e=>{if(e.isDeleted()||e.isHiddenDecorations())return null;let t=e.getRange().getCoords();return w.isCellWithinRange({rowIndex:t.rowEnd,colIndex:t.colEnd},z)?(0,Z.jsx)(_t,{className:`sxl-table-resize-handle`,range:e===v&&g?g:t,anchor:`br`,size:12,background:Yl(e,n),renderHandle:Hf,onDragStart:()=>{b.current=!0,y(e)},onDragMove:(e,n)=>_(Uf(t,n)),onDragEnd:(n,r)=>{b.current=!1,y(null),_(null);let i=Uf(t,r);if(i.rowEnd!==t.rowEnd||i.colEnd!==t.colEnd)try{e.resize(i)}catch{}}},`table-resize-${e.getName()}`):null}),V=v&&g?(0,Z.jsx)(Pt,{className:`sxl-table-resize-preview`,range:g,stroke:Yl(v,n),alignWidth:1}):null;return(0,Z.jsxs)(q,{onMouseMove:T,onMouseLeave:E,className:Q(i,`sxl-tables`),children:[te,V,B,(0,Z.jsx)(If,{sheet:n,hovered:m&&!m.isHiddenDecorations()?m:null,renderToolbar:r}),(0,Z.jsx)(jt,{className:`sxl-table-totals-dropdown`,renderCell:ee,getVisibleCells:R,cacheToken:L}),N.component]})}));function Yf(e,t){let{manager:n,notifier:r}=t;if(!n)return()=>{};let i={undoManager:n},a=()=>{let t=n.getTopUndoDescription(),a=n.getTopRedoDescription();e.updateCommand(`undo`,{tags:[`noTransaction`],context:i,callback:e=>{try{n.undo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasUndo()?[]:[C(`reason.nothingToUndo`)],params:{hasAction:!!t,action:t?j(t):``}}),e.updateCommand(`redo`,{tags:[`noTransaction`],context:i,callback:e=>{try{n.redo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasRedo()?[]:[C(`reason.nothingToRedo`)],params:{hasAction:!!a,action:a?j(a):``}})};a();let o=n.addListener({onStackChange:a});return()=>{o()}}var Xf=(0,X.createContext)(null),Zf=()=>(0,X.useContext)(Xf),Qf={key:`tableStyleOptions`,showLabel:!0,members:[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`,`tableFilterToggle`]},$f={key:`tableToolbar`,contributions:{[bd]:{order:1}},members:[`editTable`,`-`,`insertSlicer`,`-`,`dataRemoveDuplicates`,{key:`convertTableToRange`,showLabel:!0},`-`,`tableStyleOptions`,`-`,`formatTableStyle`]},ep=(e,t)=>e?[t]:[],tp=[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`];function np(e,t){let n=t.sheet;if(!n)return()=>{};let r=t.notifier,i=()=>{let e=n.getSelectedRanges();if(e.getCount()!==1)return null;let t=e.at(0).getCoords();for(let e of n.getTables().getItems()){let n=e.getRange().getCoords();if(t.rowStart>=n.rowStart&&t.rowEnd<=n.rowEnd&&t.colStart>=n.colStart&&t.colEnd<=n.colEnd)return e}return null},a=e=>{if(!e)return null;let t=n.getSelection().getCell().getCoords().colIndex-e.getRange().getCoords().colStart;return e.getColumnAt(t)?.getName()??null},o=()=>{let e={fields:()=>i()?.getColumns().map(e=>e.getName())??[],anchor:()=>a(i())};return()=>e},s=e=>{let t=e.getDataRange().getCoords(),r=n.getSelectedRange().getCoords(),i=Math.min(Math.max(r.rowStart,t.rowStart),t.rowEnd),a=Math.min(Math.max(r.rowEnd,t.rowStart),t.rowEnd);return{index:i-t.rowStart,count:a-i+1,valid:r.rowStart>=t.rowStart&&r.rowEnd<=t.rowEnd}},c=e=>{let t=e.getRange().getCoords(),r=n.getSelectedRange().getCoords(),i=Math.min(Math.max(r.colStart,t.colStart),t.colEnd),a=Math.min(Math.max(r.colEnd,t.colStart),t.colEnd);return{index:i-t.colStart,count:a-i+1}},l=e=>()=>{let t=i(),n=t?s(t):null;return j(e,{count:n?.valid?n.count:1})},u=e=>()=>{let t=i();return j(e,{count:t?c(t).count:1})},d=()=>{let e=i();e&&s(e).valid&&n.getSelectedRange().insert({axis:Y.Axis.Row,span:!0})},f=()=>{let e=i();e&&s(e).valid&&n.getSelectedRange().delete({axis:Y.Axis.Row,span:!0})},p=()=>{i()&&n.getSelectedRange().insert({axis:Y.Axis.Column,span:!0})},m=()=>{i()&&n.getSelectedRange().delete({axis:Y.Axis.Column,span:!0})},h=()=>n.getSelectedRanges().getDefaultShiftAxis()===Y.Axis.Column,g=()=>{let t=i();e.updateCommand(`tableTotalRowToggle`,{state:t?.isShowTotals()??!1}),e.updateCommand(`tableHeaderRowToggle`,{state:t?.isShowHeaders()??!1}),e.updateCommand(`tableBandedRowsToggle`,{state:t?.isShowBandedRows()??!1}),e.updateCommand(`tableFirstColumnToggle`,{state:t?.isShowHighlightFirstColumn()??!1}),e.updateCommand(`tableLastColumnToggle`,{state:t?.isShowHighlightLastColumn()??!1}),e.updateCommand(`tableBandedColumnsToggle`,{state:t?.isShowBandedColumns()??!1});let r=n.getProtection(),a=ep(!r.isFormatCellsAllowed(),C(`reason.sheetProtected`));for(let t of tp)e.updateCommand(t,{disabledReasons:a});let c=ep(!r.isAutoTableAllowed()||!r.isSortAllowed(),C(`reason.sheetProtected`));if(e.updateCommand(`tableFilterRefresh`,{disabledReasons:c}),e.updateCommand(`tableFilterClear`,{disabledReasons:c}),e.updateCommand(`formatTableStyleClearTableStyle`,{disabledReasons:[...a,...ep(!t||t.getStyleOptions().name===null,C(`reason.noTableStyle`))]}),t){let n=ep(!s(t).valid,C(`reason.tableBodyRows`));e.updateCommand(`insertCellsShiftDown`,{disabledReasons:n}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:n});let i=h()?[]:n;e.updateCommand(`insertCells`,{disabledReasons:i}),e.updateCommand(`deleteCells`,{disabledReasons:i}),e.updateCommand(`insertSlicer`,{disabledReasons:ep(!r.isObjectsAllowed(),C(`reason.sheetProtected`)),context:o()})}},_=null,v=null,y=e=>{e!==_&&(v?.(),v=null,_=e,e&&(v=e.addListeners({onAnyChange:()=>{b!==null&&g()}},{transactional:!1})))},b=null,x=null,S=()=>{let s=i();y(s);let c=s?`table`:n.getAutoTable()?`auto`:null;c!==b&&(b!==null&&e.remove(),c!==null&&(e.use(fn({transaction:n,notifier:r,manager:t.manager})),e.updateCommand(`tableTotalRowToggle`,{callback:()=>{let e=i();e&&e.setShowTotals(!e.isShowTotals())}}),e.updateCommand(`tableHeaderRowToggle`,{callback:()=>{let e=i();e&&e.setShowHeaders(!e.isShowHeaders())}}),e.updateCommand(`tableBandedRowsToggle`,{callback:()=>{let e=i();e&&e.setShowBandedRows(!e.isShowBandedRows())}}),e.updateCommand(`tableFirstColumnToggle`,{callback:()=>{let e=i();e&&e.setShowHighlightFirstColumn(!e.isShowHighlightFirstColumn())}}),e.updateCommand(`tableLastColumnToggle`,{callback:()=>{let e=i();e&&e.setShowHighlightLastColumn(!e.isShowHighlightLastColumn())}}),e.updateCommand(`tableBandedColumnsToggle`,{callback:()=>{let e=i();e&&e.setShowBandedColumns(!e.isShowBandedColumns())}}),e.updateCommand(`tableFilterRefresh`,{callback:async()=>{await(i()??n.getAutoTable())?.applySortsAndFilters()}}),e.updateCommand(`tableFilterClear`,{callback:async e=>{if(e)return e.getSort()?.delete(),void await e.getFilter()?.delete();await(i()??n.getAutoTable())?.deleteSortsAndFilters()}}),e.updateCommand(`formatTableStyleClearTableStyle`,{tags:[`noTransaction`],callback:()=>{i()?.updateStyleOptions({name:null})},context:()=>({styles:()=>n.getStyles(),table:()=>i(),getNames:()=>n.getNames(),resolveRanges:e=>(n.getWorkbook()??n).getRanges(e).getFixed(!0)})}),c===`table`&&(e.updateCommand(`insertSlicer`,{tags:[`noTransaction`],callback:async e=>{let t=i(),n=e?.field??a(t);t&&n&&await t.addSlicer(n,{style:e?.style,autoSelect:!0})},context:o()}),e.updateCommand(`insertCellsShiftDown`,{label:l(C(`table.insertRows`)),groupLabels:{insertCellsOptions:l(C(`table.rows.compact`))},description:()=>j(`table.insertRows.description`),icon:`InsertRow`,callback:d}),e.updateCommand(`deleteCellsShiftUp`,{label:l(C(`table.deleteRows`)),groupLabels:{deleteCellsOptions:l(C(`table.rows.compact`))},description:()=>j(`table.deleteRows.description`),icon:`DeleteRows`,callback:f}),e.updateCommand(`insertCellsShiftRight`,{label:u(C(`table.insertColumns`)),groupLabels:{insertCellsOptions:u(C(`table.columns.compact`))},description:()=>j(`table.insertColumns.description`),icon:`InsertColumn2`,callback:p}),e.updateCommand(`deleteCellsShiftLeft`,{label:u(C(`table.deleteColumns`)),groupLabels:{deleteCellsOptions:u(C(`table.columns.compact`))},description:()=>j(`table.deleteColumns.description`),icon:`DeleteColumns`,callback:m}),e.updateCommand(`insertCells`,{label:()=>(h()?u(C(`table.insertColumns`)):l(C(`table.insertRows`)))(),groupLabels:{insertCellsOptions:()=>(h()?u(C(`table.columns.compact`)):l(C(`table.rows.compact`)))()},description:()=>h()?j(`table.insertColumns.description`):j(`table.insertRows.description`),callback:()=>{h()?p():d()}}),e.updateCommand(`deleteCells`,{label:()=>(h()?u(C(`table.deleteColumns`)):l(C(`table.deleteRows`)))(),groupLabels:{deleteCellsOptions:()=>(h()?u(C(`table.columns.compact`)):l(C(`table.rows.compact`)))()},description:()=>h()?j(`table.deleteColumns.description`):j(`table.deleteRows.description`),callback:()=>{h()?m():f()}}))),c===`table`?x??=(()=>{let e=Sd(Qf),t=Sd($f);return()=>{t(),e()}})():(x?.(),x=null),b=c),c!==null&&g()};S();let w=n.getSelection().addListeners({onChange:S}),T=n.addListeners({onTablesChange:S,onAutoTableChange:S,onProtectionChange:S});return()=>{w(),T(),y(null),x?.(),x=null,b=null}}var{CommandScopeProvider:rp}=G,ip=(0,X.memo)(e=>{let{sheet:t}=e,n=he(),r=Zf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(rp,{spec:{scopeName:{key:`layer:table`,name:`table`},contributor:{dynamic:np},data:i},order:xt().zIndex})});ip.displayName=`SheetTableCommandLayer`;var ap=[{key:`sparklineTypeLine`,type:`line`},{key:`sparklineTypeColumn`,type:`column`},{key:`sparklineTypeWinLoss`,type:`winLoss`}],op=[{key:`sparklineHighPointToggle`,property:`high`},{key:`sparklineLowPointToggle`,property:`low`},{key:`sparklineNegativePointsToggle`,property:`negative`},{key:`sparklineFirstPointToggle`,property:`first`},{key:`sparklineLastPointToggle`,property:`last`},{key:`sparklineMarkersToggle`,property:`markers`}],sp=[{key:`sparklineColorSeries`,property:`colorSeries`},{key:`sparklineColorNegative`,property:`colorNegative`},{key:`sparklineColorMarkers`,property:`colorMarkers`},{key:`sparklineColorHigh`,property:`colorHigh`},{key:`sparklineColorLow`,property:`colorLow`},{key:`sparklineColorFirst`,property:`colorFirst`},{key:`sparklineColorLast`,property:`colorLast`},{key:`sparklineColorAxis`,property:`colorAxis`}],cp=[{key:`sparklineEmptyCellsGap`,value:`gap`},{key:`sparklineEmptyCellsZero`,value:`zero`},{key:`sparklineEmptyCellsSpan`,value:`span`}],lp=[{key:`sparklineAxisToggle`,read:e=>!!e.displayXAxis,write:e=>({displayXAxis:e||null})},{key:`sparklineRightToLeftToggle`,read:e=>!!e.rightToLeft,write:e=>({rightToLeft:e||null})},{key:`sparklineSameMinToggle`,read:e=>e.minAxisType===`group`,write:e=>({minAxisType:e?`group`:null})},{key:`sparklineSameMaxToggle`,read:e=>e.maxAxisType===`group`,write:e=>({maxAxisType:e?`group`:null})},{key:`sparklineShowHiddenToggle`,read:e=>!!e.displayHidden,write:e=>({displayHidden:e||null})}],up={key:`sparklineShowOptions`,showLabel:!0,members:op.map(e=>e.key)},dp={key:`sparklineAxisOptions`,showLabel:!0,members:[`sparklineAxisToggle`,`sparklineRightToLeftToggle`,`-`,`sparklineSameMinToggle`,`sparklineSameMaxToggle`,`-`,...cp.map(e=>e.key),`sparklineShowHiddenToggle`]},fp={key:`sparklineClearOptions`,members:[`sparklineClear`,`sparklineClearGroups`]},pp={key:`sparklineToolbar`,contributions:{[bd]:{order:1}},members:[`sparklineEditData`,`-`,...ap.map(e=>e.key),`-`,`sparklineShowOptions`,`-`,`sparklineAxisOptions`,`-`,`sparklineClearOptions`]};function mp(e,t){let n=t.sheet;if(!n)return()=>{};let r=()=>{try{return n.getSelection().getCell().getSparkline()?.getGroup()??null}catch{return null}},i=()=>{let e=new Set,t=n.getSelectedRanges(),i=t.getCount();for(let n=0;n<i;n++)for(let r of t.at(n).getSparklineGroups())e.add(r);let a=r();return a&&e.add(a),[...e]},a=e=>{for(let t of i())t.update(e)},o=()=>{let e=r();if(!e||!t.notifier?.showWindow)return;let i={data:(a=e.getDataRanges(),a.map(e=>{if(e.isInvalid())return`#REF!`;let t=e.getWorksheet(),r=Qn.rangeToString(e.getCoords(),t.getEntireCoords())??`#REF!`;return t===n?r:`${Qn.sheetNameToString(t.getName())}!${r}`}).join(`,`)),location:e.getRanges().getFixed(!0)};var a;let o={initialValue:i,onInput:r=>{(async t=>{let r=t?.data;if(!r||!t.location)return;let i=t.location.getCoords().map(({rowStart:e,rowEnd:t,colStart:n,colEnd:r})=>({rowStart:e,rowEnd:t,colStart:n,colEnd:r}));await n.doBatch(async()=>{e.setRanges(i,r),await n.getRanges(i).select()},{description:C(`op.editSparklineGroup`)})})(r??null).catch(e=>{t.notifier?.showMessage?.(e?.message??String(e),{type:Te.Error})})}};t.notifier.showWindow(`sparklineEdit`,o)},s=()=>{let t=r(),i=t?.getProperties()??{},a=t?.getType()??null;for(let{key:t,type:n}of ap)e.updateCommand(t,{state:a===n});for(let{key:t,property:n}of op)e.updateCommand(t,{state:!!i[n]});let o=i.displayEmptyCellsAs??`zero`;for(let{key:t,value:n}of cp)e.updateCommand(t,{state:o===n});for(let{key:t,read:n}of lp)e.updateCommand(t,{state:n(i)});for(let{key:t,property:r}of sp){let a=i[r],o=null;try{o=a?n.getStyles().parseColor(a):null}catch{o=null}e.updateCommand(t,{state:o})}let s=n.getProtection().isFormatCellsAllowed()?[]:[C(`reason.sheetProtected`)],c=[...ap.map(e=>e.key),...op.map(e=>e.key),...cp.map(e=>e.key),...lp.map(e=>e.key),...sp.map(e=>e.key),`sparklineClear`,`sparklineClearGroups`,`sparklineEditData`];for(let t of c)e.updateCommand(t,{disabledReasons:s});a!==`line`&&(e.updateCommand(`sparklineMarkersToggle`,{disabledReasons:[...s,C(`reason.sparklineNotLine`)]}),e.updateCommand(`sparklineColorMarkers`,{disabledReasons:[...s,C(`reason.sparklineNotLine`)]}))},c=null,l=null,u=e=>{e!==c&&(l?.(),l=null,c=e,e&&(l=e.addListeners({onAnyChange:()=>{d&&s()}},{transactional:!1})))},d=!1,f=null,p=()=>{let c=r();u(c);let l=!!c;l!==d&&(l?((()=>{e.use(fn({transaction:n,notifier:t.notifier,manager:t.manager}));for(let{key:t,type:n}of ap)e.updateCommand(t,{callback:()=>a({type:n})});for(let{key:t,property:n}of op)e.updateCommand(t,{callback:()=>a({[n]:!r()?.getProperties()[n]||null})});for(let{key:t,value:n}of cp)e.updateCommand(t,{callback:()=>a({displayEmptyCellsAs:n})});for(let{key:t,read:n,write:i}of lp)e.updateCommand(t,{callback:()=>{let e=r();a(i(!(e&&n(e.getProperties()))))}});e.updateCommand(`sparklineClear`,{callback:()=>{n.getSelectedRanges().clear(er.Content.Sparklines,{autoSelect:!0})}}),e.updateCommand(`sparklineClearGroups`,{callback:()=>{for(let e of i())e.delete()}});let s=n.getStyles(),c=()=>({schemeLookup:s.schemeLookup(),recentColors:()=>s.recentColors(),addRecentColor:e=>s.addRecentColor(e),clearRecentColors:()=>s.clearRecentColors(),autoColor:null,onColorSelect:()=>{}});for(let{key:t,property:n}of sp)e.updateCommand(t,{callback:e=>{e&&a({[n]:e})},context:c});e.updateCommand(`sparklineEditData`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o()})})(),f??=(()=>{let e=Sd(up),t=Sd(dp),n=Sd(fp),r=Sd(pp);return()=>{r(),n(),t(),e()}})()):(e.remove(),f?.(),f=null),d=l),d&&s()};p();let m=n.getSelection().addListeners({onChange:p}),h=n.addListeners({onSparklineGroupsChange:p,onProtectionChange:p});return()=>{m(),h(),u(null),f?.(),f=null,d=!1}}var{CommandScopeProvider:hp}=G,gp=(0,X.memo)(e=>{let{sheet:t}=e,n=he(),r=Zf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(hp,{spec:{scopeName:{key:`layer:sparkline`,name:`sparkline`},contributor:{dynamic:mp},data:i},order:xt().zIndex})});gp.displayName=`SheetSparklineCommandLayer`;var _p={key:`pivotStyleOptions`,showLabel:!0,members:[`pivotRowHeadersToggle`,`pivotColumnHeadersToggle`,`pivotBandedRowsToggle`,`pivotBandedColumnsToggle`]},vp={key:`pivotShowOptions`,showLabel:!0,members:[`pivotDrillIndicatorsToggle`,`pivotFieldHeadersToggle`]},yp={key:`pivotRefreshOptions`,defaultKey:`refreshPivotTable`,showLabel:!0,members:[`refreshPivotTable`,`refreshAll`]},bp={key:`pivotToolbar`,contributions:{[bd]:{order:1}},members:[`editPivotTable`,`-`,`insertSlicer`,`-`,`pivotRefreshOptions`,`-`,`pivotShowOptions`,`-`,`pivotStyleOptions`,`-`,`formatPivotStyle`]},xp=(e,t)=>e?[t]:[],Sp=[[`pivotRowHeadersToggle`,`showRowHeaders`],[`pivotColumnHeadersToggle`,`showColumnHeaders`],[`pivotBandedRowsToggle`,`showRowStripes`],[`pivotBandedColumnsToggle`,`showColumnStripes`]];function Cp(e,t){let n=t.sheet;if(!n)return()=>{};let r=t.notifier,i=()=>ql(n),a=e=>{let t=n.getSelection().getCoords()?.cell;return e&&t?rr(e,t.rowIndex,t.colIndex)?.getName()??null:null},o=()=>{let e={fields:()=>i()?.getFields().map(e=>e.getName())??[],anchor:()=>a(i())};return()=>e},s=!1,c=null,l=()=>{let l=i()!==null;l!==s&&(s&&e.remove(),l?((()=>{e.use(fn({transaction:n,notifier:r,manager:t.manager}));for(let[t,n]of Sp)e.updateCommand(t,{callback:()=>{let e=i();e&&e.updateStyleOptions({[n]:!e.getStyleOptions()[n]})}});e.updateCommand(`pivotDrillIndicatorsToggle`,{callback:()=>{let e=i();e&&e.setHiddenDrillIndicators(!e.isHiddenDrillIndicators())}}),e.updateCommand(`pivotFieldHeadersToggle`,{callback:async()=>{let e=i();e&&await e.setHiddenFieldHeaders(!e.isHiddenFieldHeaders())}}),e.updateCommand(`insertSlicer`,{tags:[`noTransaction`],callback:async e=>{let t=i(),n=e?.field??a(t);t&&n&&await t.addSlicer(n,{style:e?.style,autoSelect:!0})},context:o()})})(),c??=(()=>{let e=Sd(yp),t=Sd(vp),n=Sd(_p),r=Sd(bp);return()=>{r(),n(),t(),e()}})()):(c?.(),c=null),s=l),s&&(()=>{let t=i(),r=t?.getStyleOptions();for(let[t,n]of Sp)e.updateCommand(t,{state:!0===r?.[n]});let a=xp(!n.getProtection().isPivotTablesAllowed(),C(`reason.sheetProtected`));for(let[t]of Sp)e.updateCommand(t,{disabledReasons:a});e.updateCommand(`pivotDrillIndicatorsToggle`,{state:!!t&&!t.isHiddenDrillIndicators(),disabledReasons:a}),e.updateCommand(`pivotFieldHeadersToggle`,{state:!!t&&!t.isHiddenFieldHeaders(),disabledReasons:a}),e.updateCommand(`insertSlicer`,{disabledReasons:xp(!n.getProtection().isObjectsAllowed(),C(`reason.sheetProtected`)),context:o()})})()};l();let u=n.getSelection().addListeners({onChange:l}),d=n.addListeners({onPivotTablesChange:l,onProtectionChange:l});return()=>{u(),d(),c?.(),c=null,s=!1}}var{CommandScopeProvider:wp}=G,Tp=(0,X.memo)(e=>{let{sheet:t}=e,n=he(),r=Zf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(wp,{spec:{scopeName:{key:`layer:pivot`,name:`pivot`},contributor:{dynamic:Cp},data:i},order:xt().zIndex})});Tp.displayName=`SheetPivotCommandLayer`;var Ep=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,animationTime:r=60,className:i,style:a,...s}=e,c=qt(),[l,u]=(0,X.useState)(null),[d,f]=(0,X.useState)(!1),[p,h]=(0,X.useState)(null),g=(0,X.useRef)(null),_=K(()=>{let e=n.getSelectedCell(),t=e.getSpill()?.getCoords()??null;f(!!t&&e.getSpillKind()===`fixed`),w.isEqualRanges(t,l)||(h(t?{transition:l?`move`:`in`,coords:t}:{transition:`out`,coords:l}),u(t))},[n,c,l]);(0,X.useEffect)(()=>(g.current&&=(clearTimeout(g.current),null),p&&(g.current=setTimeout(()=>{h(null),g.current=null},r)),()=>{g.current&&=(clearTimeout(g.current),null)}),[p,r]);let v=(0,X.useMemo)(()=>m.debounce(m.throttle(_,80),80),[]);if(o(n?.getSelection(),{onChange(e){v()}}),o(n,{onSpillsChange(e){_()},onInvalidated(e){_()}}),!c)return null;let y=l??p?.coords;if(!y)return null;let b=!!l&&n.getRange(l).getValue()instanceof kn.Spill,x=d?`var(--sxl-color-accent)`:`var(--sxl-color-primary)`,S=`color-mix(in srgb, ${x} 70%, black)`;return(0,Z.jsx)(q,{className:Q(i,`sxl-spill-outline`,d&&`sxl-spill-outline-fixed`),children:(0,X.createElement)(Pt,{...s,key:`spill-outline`,className:`sxl-spill-outline-box`,range:y,alignWidth:1,stroke:S,clipInsets:-10,style:{...a,opacity:p?.transition===`out`?0:1},propsStrokePath:{strokeDasharray:b?`6 3`:void 0,style:{filter:`drop-shadow(0px 0px 2px color-mix(in srgb, color-mix(in srgb, ${x} 80%, white) 80%, transparent))`}}})})})),Dp=Object.freeze([{key:`lightRedFillDarkRedText`,style:{font:{color:`#9C0006`},fill:{type:`solid`,color:`#FFC7CE`}}},{key:`yellowFillDarkYellowText`,style:{font:{color:`#9C6500`},fill:{type:`solid`,color:`#FFEB9C`}}},{key:`greenFillDarkGreenText`,style:{font:{color:`#006100`},fill:{type:`solid`,color:`#C6EFCE`}}},{key:`lightRedFill`,style:{fill:{type:`solid`,color:`#FFC7CE`}}},{key:`redText`,style:{font:{color:`#9C0006`}}},{key:`redBorder`,style:{borders:{[yn.Edge.Left]:{style:yn.StrokeStyle.Thin,color:`#9C0006`},[yn.Edge.Top]:{style:yn.StrokeStyle.Thin,color:`#9C0006`},[yn.Edge.Right]:{style:yn.StrokeStyle.Thin,color:`#9C0006`},[yn.Edge.Bottom]:{style:yn.StrokeStyle.Thin,color:`#9C0006`}}}}]),Op=`#F8696B`,kp=`#FFEB84`,Ap=`#63BE7B`,jp=`#FCFCFF`,Mp=`#5A8AC6`,Np=`#FFEF9C`,Pp=e=>{let t=e.map((t,n)=>n===0?{type:$n.ColorStopType.Min,color:t}:n===e.length-1?{type:$n.ColorStopType.Max,color:t}:{type:$n.ColorStopType.Percentile,value:50,color:t});return{type:$n.ScaleType.ColorScale,stops:t}},Fp=Object.freeze([Pp([Ap,kp,Op]),Pp([Op,kp,Ap]),Pp([Ap,jp,Op]),Pp([Op,jp,Ap]),Pp([Mp,jp,Op]),Pp([Op,jp,Mp]),Pp([jp,Op]),Pp([Op,jp]),Pp([Ap,jp]),Pp([jp,Ap]),Pp([Ap,Np]),Pp([Np,Ap])]),Ip=Object.freeze([`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`]),Lp=(e,t)=>({type:$n.ScaleType.DataBar,minPoint:{type:$n.ColorStopType.AutoMin},maxPoint:{type:$n.ColorStopType.AutoMax},color:e,...t?{borderColor:e}:{solidFill:!0}}),Rp=Object.freeze([...Ip.map(e=>Lp(e,!0)),...Ip.map(e=>Lp(e,!1))]),zp=()=>structuredClone(Fp[1]),Bp=()=>structuredClone(Rp[0]),Vp=e=>{let t=[];for(let n=0;n<e;n++)t.push({type:$n.ColorStopType.Percent,value:Math.round(100*n/e)});return t},Hp=()=>({type:$n.ScaleType.IconSet,iconSet:En.IconSet.TrafficLights3,stops:Vp(3)}),Up=Object.freeze([{key:`directional`,rows:[[En.IconSet.Arrows3,En.IconSet.ArrowsGray3],[En.IconSet.Arrows4,En.IconSet.ArrowsGray4],[En.IconSet.Arrows5,En.IconSet.ArrowsGray5],[En.IconSet.Triangles3,null]]},{key:`shapes`,rows:[[En.IconSet.Signs3,En.IconSet.TrafficLights3_2],[En.IconSet.TrafficLights3,En.IconSet.TrafficLights4],[En.IconSet.RedToBlack4,null]]},{key:`indicators`,rows:[[En.IconSet.Symbols3,En.IconSet.Symbols3_2],[En.IconSet.Flags3,null]]},{key:`ratings`,rows:[[En.IconSet.Stars3,En.IconSet.Rating4],[En.IconSet.Quarters5,En.IconSet.Rating5],[En.IconSet.Boxes5,null]]}]);Object.freeze({set:En.IconSet.NoIcons,id:0});var Wp={bad:`var(--sxl-cf-icon-bad)`,lightBad:`var(--sxl-cf-icon-light-bad)`,neutral:`var(--sxl-cf-icon-neutral)`,good:`var(--sxl-cf-icon-good)`,purple:`var(--sxl-cf-icon-purple)`,gold:`var(--sxl-cf-icon-gold)`,gray:`var(--sxl-cf-icon-gray)`,black:`var(--sxl-cf-icon-black)`},Gp=(e,t)=>({iconKey:`cf:${e}`,color:t}),Kp=[`arrowDown`,`arrowRight`,`arrowUp`],qp=[`arrowDown`,`arrowDownRight`,`arrowUpRight`,`arrowUp`],Jp=[`arrowDown`,`arrowDownRight`,`arrowRight`,`arrowUpRight`,`arrowUp`],Yp=[Wp.bad,Wp.neutral,Wp.good],Xp=[Wp.bad,Wp.lightBad,Wp.lightBad,Wp.good],Zp=[Wp.bad,Wp.lightBad,Wp.lightBad,Wp.lightBad,Wp.good],Qp=(e,t)=>e.map((e,n)=>Gp(e,t[n])),$p=(e,t)=>e.map(e=>Gp(e,t)),em=(e,t)=>t.map(t=>Gp(e,t)),tm=[`rating0`,`rating1`,`rating2`,`rating3`,`rating4`],nm={[En.IconSet.Arrows3]:Qp(Kp,Yp),[En.IconSet.ArrowsGray3]:$p(Kp,Wp.gray),[En.IconSet.Flags3]:em(`flag`,Yp),[En.IconSet.Signs3]:Qp([`diamond`,`triangleUp`,`circle`],Yp),[En.IconSet.Symbols3]:Qp([`circleCross`,`circleExclamation`,`circleCheck`],Yp),[En.IconSet.Symbols3_2]:Qp([`cross`,`exclamation`,`check`],Yp),[En.IconSet.TrafficLights3]:em(`circle`,Yp),[En.IconSet.TrafficLights3_2]:em(`circleRimmed`,Yp),[En.IconSet.Triangles3]:Qp([`triangleDownSharp`,`dash`,`triangleUpSharp`],Yp),[En.IconSet.Stars3]:$p([`star0`,`star1`,`star2`],Wp.gold),[En.IconSet.Arrows4]:Qp(qp,Xp),[En.IconSet.ArrowsGray4]:$p(qp,Wp.gray),[En.IconSet.Rating4]:$p(tm.slice(1),Wp.gray),[En.IconSet.RedToBlack4]:em(`circle`,[Wp.black,Wp.gray,Wp.purple,Wp.bad]),[En.IconSet.TrafficLights4]:em(`circleRimmed`,[Wp.black,Wp.bad,Wp.neutral,Wp.good]),[En.IconSet.Arrows5]:Qp(Jp,Zp),[En.IconSet.ArrowsGray5]:$p(Jp,Wp.gray),[En.IconSet.Quarters5]:$p([`quarters0`,`quarters1`,`quarters2`,`quarters3`,`quarters4`],Wp.black),[En.IconSet.Rating5]:$p(tm,Wp.gray),[En.IconSet.Boxes5]:$p([`boxes0`,`boxes1`,`boxes2`,`boxes3`,`boxes4`],Wp.black),[En.IconSet.NoIcons]:[]},rm=(e,t)=>nm[e]?.[t]??null,im=Object.freeze([]);new Map(Object.keys(Wp).map(e=>[Wp[e],e])),(()=>{let e=new Set,t=[];for(let n of Up)for(let r of n.rows)for(let n of r){if(!n)continue;let r=nm[n]??im;for(let i=r.length-1;i>=0;i--){let a=r[i],o=`${a.iconKey}|${a.color}`;e.has(o)||(e.add(o),t.push({set:n,id:i,spec:a}))}}return Object.freeze(t)})();var am=`_bar_6li90_16`,om=`_axis_6li90_23`,sm=(0,X.memo)(e=>{let{sheet:t,margin:n=1,className:r,style:i,...a}=e,o=qt(),{getVisibleDecorations:s,cacheToken:c}=bc(t,`dataBar`),l=(0,X.useMemo)(()=>({}),[c,n]),u=K(e=>{let{value:t,style:r,zoom:i=1,key:a}=e,o=t?.getConditionalDecorations().dataBar;if(!o||!r)return null;let s=Math.max(1,Math.round(n*i)),c=1/xe.getDevicePixelRatio(),l={x:r.left+s+c,y:r.top+s+c,width:r.width-2*s-c,height:r.height-2*(s+c)};return(0,Z.jsx)(cm,{bar:o,track:l,cellTop:r.top,cellHeight:r.height},a)},[n]);return s(o).length===0?null:(0,Z.jsx)(q,{...a,className:Q(r,`sxl-conditional-bars`),children:(0,Z.jsx)(jt,{renderCell:u,getVisibleCells:s,cacheToken:l,style:i})})});sm.displayName=`ConditionalBarLayer`;var cm=({bar:e,track:t,cellTop:n,cellHeight:r})=>{let{value:i,axis:a,solidFill:o,direction:s}=e,c=i<a,l=Math.min(i,a)*t.width,u=Math.abs(i-a)*t.width,d=s===`rightToLeft`,f=(e,n)=>d?t.x+t.width-e-n:t.x+e,p=!!e.axisColor&&a>0&&a<1;if(u<=0&&!p)return null;let m=(c?e.negativeColor:void 0)??e.color,h=(c?e.negativeBorderColor:void 0)??e.borderColor,g=o?m:`linear-gradient(to ${c===d?`right`:`left`}, ${m}, color-mix(in srgb, ${m} var(--sxl-cf-bar-fade), transparent))`;return(0,Z.jsxs)(X.Fragment,{children:[u>0?(0,Z.jsx)(`div`,{className:Q(am,`sxl-conditional-bar`),style:{left:f(l,u),top:t.y,width:u,height:t.height,background:g,border:h?`1px solid ${h}`:void 0}}):null,p?(0,Z.jsx)(`div`,{className:Q(om,`sxl-conditional-bar-axis`),style:{left:f(a*t.width,1),top:n,height:r,background:`repeating-linear-gradient(to bottom, ${e.axisColor} 0 2px, transparent 2px 4px)`,backgroundPositionY:-n%4}}):null]})},lm=`_box_t03y8_41`,um=(0,X.memo)(e=>{let{sheet:t,className:n,style:r,...i}=e,a=qt(),{getVisibleDecorations:o,cacheToken:s}=bc(t,`iconSet`),c=K(e=>{let{value:t,style:n,zoom:r=1,key:i}=e,a=t,o=a?.getConditionalDecorations().iconSet;if(!o||!n)return null;let s=rm(o.set,o.index);if(!s)return null;let c=a.getStyle(),l=c.getInsets(),u=c.measureText(``),d=((u.ascent??u.lineHeight)+(u.descent??0))*r,f=c.getAlignment().getVertical(),p=dm[f]??`flex-end`,m=fm[f]??`center bottom`;return(0,Z.jsx)(M,{className:lm,iconKey:s.iconKey,size:d,style:{left:n.left+l.left*r,top:n.top+l.top*r,width:d,height:n.height-(l.top+l.bottom)*r,minHeight:0,alignItems:p,color:s.color,"--sxl-cf-icon-origin":m}},i)},[]);return o(a).length===0?null:(0,Z.jsx)(q,{...i,className:Q(n,`sxl-conditional-icons`),children:(0,Z.jsx)(jt,{renderCell:c,getVisibleCells:o,cacheToken:s,style:r})})});um.displayName=`ConditionalIconsLayer`;var dm={[J.VerticalAlignment.Top]:`flex-start`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`flex-end`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},fm={[J.VerticalAlignment.Top]:`center top`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`center bottom`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},pm=f(`sparkline:paint`,()=>d(()=>import(`./DknSteOdQ6CdF0RT.js`),__vite__mapDeps([17,18,19]),import.meta.url)),mm=e=>!e.axis&&e.columns.length===0&&e.markers.length===0&&!e.line?.runs.some(e=>e.length>1),hm=new class{constructor(e,t){this._pictures=new Map,this._queue=[],this._scheduled=!1,this._paint=e,this._maxEntries=Math.max(1,t?.maxEntries??2e3),this._budgetMs=Math.max(1,t?.budgetMs??8)}get(e,t){let n=this._pictures.get(e);if(n)return this._pictures.delete(e),this._pictures.set(e,n),n;for(n=new Promise((e,n)=>{this._queue.push({input:t,resolve:e,reject:n})}),n.catch(()=>{this._pictures.get(e)===n&&this._pictures.delete(e)}),this._pictures.set(e,n);this._pictures.size>this._maxEntries;)this._pictures.delete(this._pictures.keys().next().value);return this._schedule(),n}peek(e){return this._pictures.get(e)}clear(){this._pictures.clear()}_schedule(){this._scheduled||(this._scheduled=!0,setTimeout(()=>{this._drain()},0))}async _drain(){let e=Date.now();for(;this._queue.length>0&&Date.now()-e<this._budgetMs;){let e=this._queue.shift();try{e.resolve(await this._paint(e.input))}catch(t){e.reject(t)}}this._scheduled=!1,this._queue.length>0&&this._schedule()}}(async e=>{let{renderSparklineToSVG:t}=await pm.load();return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t(e))}`}),gm=e=>JSON.stringify(e),_m=[],vm={ignoreHidden:!0,reuseContext:!0,features:Object.freeze([Pn.Feature.Sparkline])},ym=(0,X.memo)(e=>{let{sheet:t,darkMode:n=!1,className:r,style:i,...a}=e,s=qt(),[c,l]=(0,X.useReducer)(e=>e+1,0),u=(0,X.useMemo)(()=>({}),[c,n]),d=(0,X.useRef)(new Map),f=K(()=>{d.current.clear(),l()},[]);o(t,{onSparklineGroupsChange:f},{ignoreModelChange:!0});let p=K((e,n)=>{let r=n??e.getVisibleRange();if(!r)return _m;let i=`${r.rowStart}:${r.colStart}:${r.rowEnd}:${r.colEnd}`,a=d.current,o=a.get(i);if(o)return o;let s=_m,c=t.getSparklineGroups().getItems({address:r});return c.length>0&&t.getRange(r).forEach((e,t)=>{let n=t.getCoords(),r=null;for(let e=0;e<c.length&&!r;e++)r=c[e].getSparkline(n);if(!r)return;let i=t.getCell().getSpans(),a=i.width>1||i.height>1?t.getCell().getRange().getCoords():void 0;s===_m&&(s=[]),s.push({cell:{rowIndex:n.rowIndex,colIndex:n.colIndex},range:a,value:r})},vm),a.set(i,s),s},[t]),m=K(e=>{let{value:r,style:i,zoom:a=1,key:o}=e,s=r;if(!s||!i)return null;let c=1/xe.getDevicePixelRatio(),l=i.left+c,u=i.top+c,d=i.width-c,f=i.height-c;return d>=1&&f>=1?(0,Z.jsx)(bm,{sparkline:s,workbook:t.getWorkbook(),bounds:{left:l,top:u,width:d,height:f},zoom:a,darkMode:n},o):null},[t,n]);return p(s).length===0?null:(0,Z.jsx)(q,{...a,className:Q(r,`sxl-sparklines`),children:(0,Z.jsx)(jt,{renderCell:m,getVisibleCells:p,cacheToken:u,style:i})})});ym.displayName=`SparklineLayer`;var bm=e=>{let{sparkline:t,workbook:n,bounds:r,zoom:i,darkMode:a}=e,o=t.getGroup(),[s,c]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>o.addListeners({onLayoutChange:c}),[o]);let l=r.width/i,u=r.height/i,{drawing:d,key:f}=(0,X.useMemo)(()=>{let e=function(e,t){let n=e=>ir.toConcreteCSS(e,t);return{width:e.width,height:e.height,axis:e.axis?{...e.axis,color:n(e.axis.color)}:null,line:e.line?{...e.line,color:n(e.line.color)}:null,columns:e.columns.map(e=>({...e,color:n(e.color)})),markers:e.markers.map(e=>({...e,color:n(e.color)}))}}(t.getLayout({width:l,height:u}),a);return{drawing:e,key:mm(e)?``:gm(e)}},[t,l,u,a,s]),[p,m]=(0,X.useState)(null),[h,g]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!f)return void m({key:f,url:null});let e=!0;return((e,t=gm(e))=>hm.get(t,e))(d,f).then(t=>{e&&m({key:f,url:t})},()=>{e&&m({key:f,url:null})}),()=>{e=!1}},[f]),z(p?.key!==f||!!p?.url&&h!==f,n),p?.url?(0,Z.jsx)(`img`,{src:p.url,alt:``,draggable:!1,onLoad:()=>g(p.key),onError:()=>g(p.key),style:{position:`absolute`,left:r.left,top:r.top,width:r.width,height:r.height,pointerEvents:`none`}}):null},xm=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,className:r,style:i,...a}=e,o=qt(),{getVisibleCells:c,cacheToken:l}=Sm(t),u=(0,X.useMemo)(()=>({}),[l,n]),d=K(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=1/xe.getDevicePixelRatio();return(0,Z.jsx)(_a,{anchorLocation:_.BottomRight,size:n*r,inset:0,cellWidth:t.width+o,cellHeight:t.height+o,fill:ol[a.state],style:{left:t.left,top:t.top}},i)},[n]);return s(t.getView(),`onAnyChange`),t.getView().isShowInvalid()?c(o).length===0?null:(0,Z.jsx)(q,{...a,className:Q(r,`sxl-validation-marks`),children:(0,Z.jsx)(jt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:i})}):null});xm.displayName=`ValidationIndicatorLayer`;var Sm=e=>{let t=qt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=K(()=>{a.current.clear(),r()},[]);o(e,{onDataValidationsChange:s},{ignoreModelChange:!0});let c=t.getVisibleRange();return pr(e,(0,X.useMemo)(()=>c?{rowStart:c.rowStart,colStart:c.colStart,rowEnd:c.rowEnd,colEnd:c.colEnd}:null,[c?.rowStart,c?.colStart,c?.rowEnd,c?.colEnd]),e=>{e.getTrigger()===`data`&&s()},wm),{getVisibleCells:K((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return Cm;let o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=r.get(o);if(s)return s;let c=((e,t)=>{let n=e.getRange(t),r=n.getDataValidations();if(r.length===0)return[];let i=r.some(e=>!!e.getCondition()&&!e.isIncludeBlanks()),a=i?new Set:null,o=[];return n.forEach((e,t)=>{let n=t.getCoords(),i=rl(r,n.rowIndex,n.colIndex);if(!i)return;let s=t.getCell(),c=s.getSpans(),l=c.width>1||c.height>1?s.getRange().getCoords():void 0;if(l&&a){let e=`${l.rowStart}:${l.colStart}`;if(a.has(e))return;a.add(e)}o.push({cell:n,range:l,value:i})},i?al:il),o})(e,i),l=c.length>0?c:Cm;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},Cm=[],wm={transactional:!1,anchor:Vn.Type.Absolute},Tm=async(e,t)=>e.length===0?[]:(e=>{if(e.length===0)return[];if(e.length===1)return e[0];let t=e.slice(1).map(e=>new Set(e.map(e=>e.text)));return e[0].filter(e=>t.every(t=>t.has(e.text)))})(await Promise.all(e.map(e=>e.getListItemsAt(t.rowIndex,t.colIndex)))),Em=(0,X.memo)(e=>{let{sheet:t,editable:n,dropdownWidth:r=17,onOpenDropdown:i,className:a,style:o,...s}=e,c=(0,X.useMemo)(()=>new Gs(t.getSelection()),[t]),l=ue().getMode()?.key===`edit`,u=K((e,n)=>{let r=t.getRange(w.cellToRange(e)).getDataValidations();if(r.length===0)return null;let i=[];for(let e=0;e<r.length;e++)r[e].getRenderHints().includes(`list`)&&i.push(r[e]);if(i.length===0||i[0].isHideDropdown())return null;let a=t.getCell(e),o=a.getCoords();if(!o)return null;let s=a.getSpans(),c=s.width>1||s.height>1?a.getRange().getCoords():void 0;return{range:c??w.cellToRange(o),key:`${o.rowIndex},${o.colIndex}`,data:{dataValidation:i[0],dataValidations:i,cell:o,merge:c}}},[t]);return(0,Z.jsx)(St,{...s,className:Q(a,`sxl-validation-dropdown`),style:o,activateOn:`selection`,selection:c,probe:u,placement:{side:`r`,align:`center`},offset:0,whenOff:`hide`,dismiss:l,children:({data:e,floatProps:a,state:o})=>(0,Z.jsx)(Dm,{sheet:t,editable:n,data:e,floatProps:a,state:o,dropdownWidth:r,onOpenDropdown:i})})});Em.displayName=`ValidationDropdownLayer`;var Dm=e=>{let{sheet:t,editable:n,data:r,floatProps:i,state:a,dropdownWidth:o,onOpenDropdown:s}=e,{pane:c}=a,l=(0,X.useMemo)(()=>({range:r.merge??w.cellToRange(r.cell)}),[r.merge,r.cell]),u=(e=>{let{sheet:t,editable:n,dataValidations:r,cell:i,anchor:a,minWidth:o}=e,s=(0,X.useCallback)(e=>Tm(r,e),[r]);return zc({sheet:t,editable:n,cell:n?i:null,anchor:a,minWidth:o,resolveItems:s,label:`validation-picker`})})({sheet:t,editable:n,dataValidations:r.dataValidations,cell:r.cell,anchor:l,minWidth:a.bounds?.width}),d=o*(c?.getZoom()||1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{...i,className:zf,style:{...i.style,width:d,height:d},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{e.button===0&&(e.preventDefault(),s?s(r.cell,r.dataValidation):u.isOpen?u.close():u.open())},children:(0,Z.jsx)(M,{iconKey:`ExpandMore`,size:.75*d})}),u.component]})};Dm.displayName=`DropdownButton`;var Om=`_mark_p3uld_7`,km=`_unresolved_p3uld_19`,Am={ignoreHidden:!0,reuseContext:!0},jm=(0,X.memo)(e=>{let{sheet:t,markSize:n=11,inset:r=1,className:i,style:a,...o}=e,s=qt(),{getRegions:c,cacheToken:l}=_c(t,Pn.Feature.Circular),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=K((e,n)=>{let r=c(e,n);if(r.length===0)return Mm;let i=t.getName(),a=[];for(let e=0;e<r.length;e++){let n=r[e],o=n.getCell().getCircularReference();if(!o)continue;let s=n.getCoords(),c={rowIndex:s.rowStart,colIndex:s.colStart,scope:i};o.isMember(c)&&t.getRange(s).forEach((e,t)=>{a.push({cell:t.getCoords(),value:t.getCell()})},Am)}return a.length>0?a:Mm},[t,c]),f=K(e=>{let{value:t,style:i,zoom:a=1,key:o}=e,s=t?.getCircularReference();if(!s||!i)return null;let c=n*a,l=r*a;return(0,Z.jsx)(M,{iconKey:`CircularReferenceIndicator`,className:Q(Om,!s.isConverged()&&km),style:{left:i.left+l,top:i.top+l,width:c,height:c},size:c,ariaHidden:!0},o)},[n,r]);return d(s).length===0?null:(0,Z.jsx)(q,{...o,className:Q(i,`sxl-circular-indicators`),children:(0,Z.jsx)(jt,{renderCell:f,getVisibleCells:d,cacheToken:u,style:a})})});jm.displayName=`CircularIndicatorLayer`;var Mm=[],Nm=`_pending_ldaq4_9`,Pm=`_sweep_ldaq4_19`,Fm=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,barHeight:r=2,className:i,style:a,...o}=e,s=qt(),{getVisibleCells:c,cacheToken:l}=Im(t),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=K(e=>{let{style:t,zoom:i=1,key:a,value:o}=e;if(!t||!o)return null;let s=t.left,c=t.top,l=t.width,u=t.height,d=[];return o.error&&d.push((0,Z.jsx)(_a,{anchorLocation:_.TopLeft,size:n*i,inset:0,cellWidth:l,cellHeight:u,style:{left:s,top:c}},`${a}:error`)),o.pending&&d.push((0,Z.jsx)(`div`,{className:Nm,style:{left:s,top:c+u-r,width:l,height:r},children:(0,Z.jsx)(`div`,{className:Pm})},`${a}:pending`)),d},[n,r]);return c(s).length===0?null:(0,Z.jsx)(q,{...o,className:Q(i,`sxl-cell-indicators`),children:(0,Z.jsx)(jt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:a})})});Fm.displayName=`CellIndicatorLayer`;var Im=e=>{let t=qt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=K(()=>{a.current.clear(),r()},[]);o(e,{onMergesChange:s,onLayoutChange:s},{ignoreModelChange:!0});let c=e.getWorkbook()?.getCalculation()??null;o(c,{onPendingChange:s});let l=t.getVisibleRange();return pr(e,(0,X.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.getTrigger()===`data`&&s()},Vm),{getVisibleCells:K((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return zm;let o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=r.get(o);if(s)return s;let c=null;e.getRange(i).forEach((e,n)=>{let r=n.getCell(),i=Lm(r);if(!i)return;let a=n.getCoords(),o=r.getSpans(),s=o.width>1||o.height>1?t.getRangeFromCell(a):void 0;(c??=[]).push({cell:a,range:s,value:i})},Bm);let l=c??zm;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},Lm=e=>{let t=e.getCalculationStatus(),n=t===Nn.ResultStatus.Pending||t===Nn.ResultStatus.Waiting,r=e.getValue(),i=kn.isError(r)?!Rm(r):e.getErrors().length>0;return n||i?{error:i,pending:n}:null},Rm=e=>{let t=e.getCode();return t===kn.Code.Busy||t===kn.Code.GettingData},zm=[],Bm={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:[Pn.Feature.Merge,Pn.Feature.CalcError,Pn.Feature.CalcStatus,Pn.Feature.Circular]},Vm={transactional:!1,anchor:Vn.Type.Absolute},Hm=new WeakMap,Um=new WeakMap,Wm=0,Gm=new WeakMap,Km=e=>{for(let t of[Um.get(e),Gm.get(e)])if(t)for(let e of Array.from(t))e()},qm=(e,t,n)=>{Hm.set(e,{rowIndex:t.rowIndex,colIndex:t.colIndex,focusRequest:!1===n?.autoFocus?0:++Wm}),Km(e)},Jm=e=>{Hm.delete(e)&&Km(e)},Ym=e=>Hm.get(e)??null,Xm=e=>(Um.get(e)?.size??0)>0,Zm=(e,t)=>{let n=Um.get(e);return n||(n=new Set,Um.set(e,n)),n.add(t),()=>{n.delete(t)}},Qm=e=>(0,X.useSyncExternalStore)(t=>{let n=Gm.get(e);return n||(n=new Set,Gm.set(e,n)),n.add(t),()=>{n.delete(t)}},()=>Ym(e),()=>null),$m=e=>(0,X.useSyncExternalStore)(t=>Zm(e,t),()=>Ym(e),()=>null),eh=`var(--sxl-comment-note-indicator, #e53935)`,th=`var(--sxl-comment-thread-indicator, #7e57c2)`,nh=`var(--sxl-comment-resolved-indicator, #9e9e9e)`,rh=`var(--sxl-comment-leader-color, var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))))`,ih=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,openDelay:r=300,closeDelay:i=150,className:a,style:s,...c}=e,l=qt(),u=t.getView(),d=t.getMovables(),{getVisibleCells:f,cacheToken:p}=lh(t),m=(0,X.useMemo)(()=>({}),[p,n]),h=K(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=a!==uh&&a.isNote(),s=o?eh:a!==uh&&a.isResolved()?nh:th,c=1/xe.getDevicePixelRatio();return(0,Z.jsx)(_a,{anchorLocation:_.TopRight,shape:o?`triangle`:`bubble`,size:(o?n:1.15*n)*r,inset:0,cellWidth:t.width+c,cellHeight:t.height,fill:s,style:{left:t.left,top:t.top}},i)},[n]),{open:g,setTarget:v}=Ht({openDelay:r,closeDelay:i,group:!1}),y=(0,X.useRef)(null),[b,x]=(0,X.useState)(null),[S,C]=zt(`movable-hover`,null),w=e=>{e&&(y.current=e);let t=e?e.getId():null;v(t),x(t)},T=K(e=>{let n=l.getCellFromPointer(e.clientX,e.clientY);if(n){let e=t.getComments().getAt(n);if(e?.isNote())return void(y.current!==e&&w(e))}let r=y.current;if(r&&!r.isDeleted()){let n=l.getPanePointFromPointer(e.clientX,e.clientY),i=r.getMovable()?.getBounds();if(n&&i){let e=l.toPaneBounds(i),a=ah(r)!==null&&ch(n,oh(l,t,r,e),5);if(sh(n,e,4)||a)return void w(r)}}w(null)},[l,t]),E=K(()=>{w(null)},[]);(0,X.useEffect)(()=>{let e=y.current;if(g&&e){let t=e.getMovable();t&&C(t)}else g||(b===null&&(y.current=null),C(t=>t&&t.getContent()===e?null:t))},[g,b,C]),(0,X.useEffect)(()=>()=>{let e=y.current;e&&C(t=>t&&t.getContent()===e?null:t)},[C]);let[D,O]=(0,X.useReducer)(e=>e+1,0);o(d,{onCollectionChange:O,onInvalidated:O}),o(t,{onLayoutChange:O}),o(u,{onMovableSelectionChange:O});let[k]=zt(`movable-drag`,null),A=l.getVisibleRange(),j=(0,X.useMemo)(()=>{if(!A)return fh;let e=d.getItems({address:A,ignoreHidden:!0,type:`note`}),n=u.getMovableSelection().getItems().slice();S&&n.push(S);let r=t.getComments().getItems({address:A,ignoreHidden:!0});for(let e=0;e<r.length;e++){let t=r[e].isNote()?r[e].getMovable():null;t&&!t.isHidden()&&n.push(t)}let i=e;for(let t=0;t<n.length;t++){let r=n[t];r.getContent().getType()!==`note`||r.isDeleted()||i.includes(r)||(i===e&&(i=e.slice()),i.push(r))}return i},[d,t,u,S,A?.rowStart,A?.colStart,A?.rowEnd,A?.colEnd,m,D]);(0,X.useEffect)(()=>{let e=[];for(let t=0;t<j.length;t++)e.push(j[t].addListeners({onBoundsChange:O},{transactional:!1})),e.push(j[t].getContent().addListeners({onAnyChange:O},{transactional:!1}));return()=>{for(let t=0;t<e.length;t++)e[t]()}},[j]);let M=`comment-leader-arrow-${(0,X.useId)().replace(/[^\w-]/g,``)}`,N=[],P=[];for(let e=0;e<j.length;e++){let n=j[e],r=n.getContent();if(r.isDeleted())continue;let i=ah(r);if(i===null)continue;let a=k?.[n.getId()]?.bounds??n.getBounds();if(!a)continue;let o=oh(l,t,r,l.toPaneBounds(a)),s=P.indexOf(i);s===-1&&(s=P.push(i)-1),N.push((0,Z.jsx)(`line`,{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,stroke:i,strokeWidth:1,markerEnd:`url(#${M}-${s})`},n.getId()))}let F=f(l).length>0;return F||N.length!==0?(0,Z.jsxs)(q,{...c,className:Q(a,`sxl-comments`),onPointerMove:T,onPointerLeave:E,children:[F?(0,Z.jsx)(jt,{renderCell:h,getVisibleCells:f,cacheToken:m,style:s}):null,N.length>0?(0,Z.jsxs)(`svg`,{className:`sxl-comment-leaders`,style:{position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`},children:[(0,Z.jsx)(`defs`,{children:P.map((e,t)=>(0,Z.jsx)(`marker`,{id:`${M}-${t}`,viewBox:`0 0 7 7`,refX:7,refY:3.5,markerWidth:7,markerHeight:7,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,Z.jsx)(`path`,{d:`M 0 0 L 7 3.5 L 0 7 Z`,fill:e})},t))}),N]}):null]}):null});ih.displayName=`CommentsLayer`;var ah=e=>{let t=e.getStyle(),n=t?.toJSON()?.stroke;if(!t||!n)return rh;let r=t.getStroke();if(!r.isVisible())return null;if(!n.fill)return rh;try{return r.getFill().getColor()?.toCSS(`adaptive`)??rh}catch{return rh}},oh=(e,t,n,r)=>{let i=n.getRange().getCoords(),a=t.getCell({rowIndex:i.rowStart,colIndex:i.colStart}),o=a.getSpans(),s=e.getBoundsFromRange(o.width>1||o.height>1?a.getRange().getCoords():{rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowStart,colEnd:i.colStart}),c=s.x+s.width,l=s.y;return{x1:r.x+r.width<=c?r.x+r.width:r.x,y1:r.y+r.height<=l?r.y+r.height:r.y,x2:c,y2:l}},sh=(e,t,n)=>e.x>=t.x-n&&e.x<=t.x+t.width+n&&e.y>=t.y-n&&e.y<=t.y+t.height+n,ch=(e,t,n)=>{let r=t.x2-t.x1,i=t.y2-t.y1,a=r*r+i*i,o=a===0?0:((e.x-t.x1)*r+(e.y-t.y1)*i)/a;o=Math.max(0,Math.min(1,o));let s=t.x1+o*r-e.x,c=t.y1+o*i-e.y;return s*s+c*c<=n*n},lh=e=>{let[t,n]=(0,X.useReducer)(e=>e+1,0),r=Qm(e),i=r?.rowIndex??-1,a=r?.colIndex??-1,s=(0,X.useRef)(new Map),c=(0,X.useMemo)(()=>(s.current.clear(),{}),[t,e,i,a]),l=K(()=>{s.current.clear(),n()},[]);return o(e,{onCommentsChange:l,onMergesChange:l},{ignoreModelChange:!0}),{getVisibleCells:K((t,n)=>{let r=s.current,o=n??t.getVisibleRange();if(!o)return dh;let c=`${o.rowStart}:${o.colStart}:${o.rowEnd}:${o.colEnd}`,l=r.get(c);if(l)return l;let u=e.getComments().getItems({address:o,ignoreHidden:!0}),d=[],f=(t,n)=>{let r=e.getCell(t),i=r.getSpans(),a=i.width>1||i.height>1?r.getRange().getCoords():void 0;d.push({cell:t,range:a?w.sanitizeRange(a):void 0,value:n})};for(let e=0;e<u.length;e++){let t=u[e].getRange().getCoords();f({rowIndex:t.rowStart,colIndex:t.colStart},u[e])}return i>=o.rowStart&&i<=o.rowEnd&&a>=o.colStart&&a<=o.colEnd&&!e.getComments().getAt({rowStart:i,colStart:a,rowEnd:i,colEnd:a})&&f({rowIndex:i,colIndex:a},uh),r.set(c,d),r.size>12&&r.delete(r.keys().next().value),d},[e,i,a]),cacheToken:c}},uh=Symbol(`comment-draft`),dh=[],fh=[],ph=e=>`${e.rowIndex},${e.colIndex}`,mh=(0,X.memo)(e=>{let{sheet:t,renderCard:n,paneKey:r=kd.Comments,offset:i=18,openDelay:a=300,closeDelay:s=250,className:c,style:l,...u}=e,d=$m(t),f=Ud().getActive()===r,p=ue().getMode()?.key===`edit`,[,m]=(0,X.useReducer)(e=>e+1,0);o(t,{onCommentsChange:m,onMergesChange:m},{ignoreModelChange:!0});let[h,g]=(0,X.useState)(!1);(0,X.useEffect)(()=>{h&&g(!1)},[h]),o(t.getSelection(),{onChange(){let e=d;if(!e)return;let n=t.getSelectedCell().getCoords();n&&n.rowIndex===e.rowIndex&&n.colIndex===e.colIndex||Jm(t)}},{ignoreModelChange:!0}),(0,X.useEffect)(()=>()=>{Jm(t)},[t]);let _=K((e,n,r)=>{let i=t.getCell(e),a=i.getCoords();if(!a)return null;let o=i.getComments();if(o?.isNote())return null;let s=o??null;if(!s&&!r)return null;let c=i.getSpans();return{range:c.width>1||c.height>1?i.getRange().getCoords():w.cellToRange(a),key:ph(a),data:{coords:a,comment:s,focusRequest:n}}},[t]),v=K((e,t)=>_(e,0,!1),[_]),y=K(()=>{Jm(t),g(!0)},[t]),b=f||p,x=d&&!b?_(d,d.focusRequest,!0):null;return(0,Z.jsx)(St,{...u,className:Q(c,`sxl-comment-card`),style:l,activateOn:`hover`,probe:b?void 0:v,target:x??void 0,dismiss:b||h,placement:{side:`r`,align:`start`},offset:i,openDelay:a,closeDelay:s,whenOff:`hide`,interactive:`focus`,onDismiss:y,children:({data:e,floatProps:r})=>(0,Z.jsx)(`div`,{...r,className:`sxl-comment-card-float`,children:(0,Z.jsx)(ae,{render:n,props:{sheet:t,coords:e.coords,comment:e.comment,focusRequest:e.focusRequest,onClose:y}})})})});mh.displayName=`CommentCardLayer`;var hh=(0,X.createContext)(null),gh=hh.Provider,_h=()=>(0,X.useContext)(hh),vh=class{constructor(){this._entries=new Map,this._listeners=new Set,this._version=0,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this.getVersion=()=>this._version}set(e,t){this._entries.set(e,t),this._changed()}delete(e){this._entries.delete(e)&&this._changed()}get(e){return this._entries.get(e)}entries(){return this._entries.entries()}_changed(){this._version++,this._listeners.forEach(e=>e())}},yh=new vh,bh=(0,X.createContext)(null),xh=()=>{let e=(0,X.useContext)(bh),t=(0,X.useRef)(null);return e||(t.current||=new vh,t.current)},Sh=bh.Provider,Ch=(e,t)=>e===void 0||(typeof e==`function`?e(t):Array.isArray(e)?e.includes(t):e===t),wh=(e,t,n,r,i)=>{for(let[a,o]of e.entries())o.surfaces.includes(n)&&Ch(o.sheets,t)&&X.Children.forEach(o.children,e=>{(0,X.isValidElement)(e)&&i.push((0,X.cloneElement)(e,{key:`${r}${a}:${e.key??i.length}`}))})},Th=(e,t,n)=>{let r=(0,X.useContext)(bh),i=n??r,a=(0,X.useSyncExternalStore)(i?.subscribe??Eh,i?.getVersion??Dh),o=(0,X.useSyncExternalStore)(yh.subscribe,yh.getVersion);return(0,X.useMemo)(()=>{let n=[];return e&&(wh(yh,e,t,`plugin:`,n),i&&wh(i,e,t,`declared:`,n)),n},[i,a,o,e,t])},Eh=()=>()=>{},Dh=()=>0,Oh=`_insert_8lp5h_8`,kh=`_button_8lp5h_12`,Ah=`_line_8lp5h_37`,jh=`_row_8lp5h_44`,Mh=`_column_8lp5h_51`,Nh=`_pressed_8lp5h_58`,Ph=e=>`cell-insert:${e}`,Fh=(0,X.memo)(e=>{let t=_h();return t===((e.axis??`row`)===`column`?`columnHeaders`:`rowHeaders`)?(0,Z.jsx)(Ih,{...e}):t===`cells`?(0,Z.jsx)(Rh,{axis:e.axis??`row`,className:e.className}):null});Fh.displayName=`CellInsertLayer`;var Ih=e=>{let{axis:t=`row`,resolve:n,onInsert:r,size:i=16,renderButton:a=Bh,className:o,...s}=e,c=l(),u=qt(),d=t===`column`,[f,p]=(0,X.useState)(null),m=e=>{if(!c)return null;let t=c.getEntireCoords();if(e>(d?t.colEnd:t.rowEnd))return null;let r=c.getRange(d?{...t,colStart:e,colEnd:e}:{...t,rowStart:e,rowEnd:e});if(n)return n(r);let i=c.getProtection();return(d?i.isInsertColumnsAllowed():i.isInsertRowsAllowed())?r:null},h=K(e=>{let t=u.getCellFromPointer(e.clientX,e.clientY,!0),n=u.getPanePointFromPointer(e.clientX,e.clientY),r=null;if(t&&n){let e=u.getBoundsFromRange({rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}),i=d?t.colIndex+ +(n.x-e.x>e.width/2):t.rowIndex+ +(n.y-e.y>e.height/2),a=m(i);if(a){let e=a.getCoords();r={range:d?{rowStart:0,colStart:i,rowEnd:0,colEnd:i}:{rowStart:i,colStart:0,rowEnd:i,colEnd:0},key:`${e.rowStart}:${e.colStart}:${e.rowEnd}:${e.colEnd}`,data:a}}}p(e=>e?.key===r?.key?e:r)},[m]),g=K(()=>{p(null)},[]),_=K(e=>{r?r(e):e.insert(t)},[r,t]);return(0,Z.jsx)(q,{...s,className:Q(o,`sxl-cell-insert`,`sxl-cell-insert-${t}`),onPointerMove:h,onPointerLeave:g,children:(0,Z.jsx)(ft,{hovered:f,group:!1,openDelay:0,placement:{side:d?`b`:`r`,align:`start`},offset:0,boundary:`viewport`,whenPartial:{side:`slide`,align:`hide`},children:e=>(0,Z.jsx)(Lh,{info:e,axis:t,size:i,renderButton:a,onInsert:_,onLeave:g})})})},Lh=e=>{let{info:{data:t,floatProps:n,state:r},axis:i,size:a,renderButton:o,onInsert:s,onLeave:c}=e,l=je(),u=i===`column`,d=a*(r.pane?.getZoom()||1),f=et(Ph(i),null);(0,X.useEffect)(()=>(f({range:t,pressed:!1}),()=>f(e=>e?.range===t?null:e)),[t,f]);let p=e=>{f(n=>n?.range===t&&n.pressed!==e?{range:t,pressed:e}:n)};return(0,Z.jsx)(`div`,{...n,className:Oh,style:{...n.style,width:d,height:d,left:-d/2,top:-d/2},onPointerLeave:()=>{n.onPointerLeave(),p(!1),c()},onPointerDown:()=>p(!0),onPointerUp:()=>p(!1),onPointerCancel:()=>p(!1),children:(0,Z.jsx)(ae,{render:o,props:{axis:i,range:t,size:d,title:l(u?`cellInsert.columnHere`:`cellInsert.rowHere`),onInsert:()=>s(t)}})})},Rh=e=>{let{axis:t,className:n}=e,r=qt(),[i]=zt(Ph(t),null),a=null;if(i){let e=i.range.getCoords(),n=r.getVisibleRange();if(t===`column`){let t=n.rowEnd-n.rowStart+1;a={...e,rowStart:Math.max(e.rowStart,n.rowStart-t),rowEnd:Math.min(e.rowEnd,n.rowEnd+t)}}else{let t=n.colEnd-n.colStart+1;a={...e,colStart:Math.max(e.colStart,n.colStart-t),colEnd:Math.min(e.colEnd,n.colEnd+t)}}}return(0,Z.jsx)(q,{className:Q(n,`sxl-cell-insert-preview`,`sxl-cell-insert-preview-${t}`),children:a?(0,Z.jsx)(ut,{range:a,style:{pointerEvents:`none`,overflow:`visible`},children:(0,Z.jsx)(`div`,{className:Q(Ah,t===`column`?Mh:jh,`sxl-cell-insert-line`,i?.pressed&&[Nh,`sxl-cell-insert-line-pressed`])})}):null})},zh=(0,X.memo)(e=>{let{axis:t,range:n,size:r,title:i,onInsert:a,className:o,...s}=e;return(0,Z.jsx)(`button`,{type:`button`,title:i,"aria-label":i,onClick:a,...s,className:Q(kh,`sxl-cell-insert-button`,o),children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:r,height:r,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`7`}),(0,Z.jsx)(`path`,{d:`M8 4.5v7M4.5 8h7`})]})})});zh.displayName=`CellInsertButton`;var Bh=e=>(0,Z.jsx)(zh,{...e}),Vh=Symbol(`unlock.uniform`),Hh=e=>Vh,Uh=(0,X.memo)(e=>{let{sheet:t,sheetView:n,className:r,...i}=e,a=qt();s(n,[`onAnyChange`]),s(t,[`onProtectionChange`]);let{getRegions:o}=_c(t,Pn.Feature.Unlock),c=(0,X.useId)().replace(/[^a-zA-Z0-9_-]/g,``),l=`sxl-locked-hatch-${c}`,u=`sxl-locked-holes-${c}`;if(!a||!n?.isShowLockedShading()||!t.getProtection().isLocked())return null;let d=a.getPaneBounds(),f=d.width,p=d.height;if(f<=0||p<=0)return null;let m=[];for(let e of(e=>{let t=[];for(let n=0;n<e.length;n++)t.push({...e[n].getCoords(),value:Hh(e[n])});return t.length<=1?t:w.mergeRangeCoordValues(t,2,(e,t)=>e[0].value===e[1].value?t:void 0)})(o(a))){let t=a.getBoundsFromRange(e),n=Math.round(t.x),r=Math.round(t.y),i=Math.round(t.x+t.width),o=Math.round(t.y+t.height);i<=n||o<=r||m.push({x:n,y:r,width:i-n,height:o-r})}return(0,Z.jsx)(q,{...i,className:Q(r,`sxl-locked-hatch`),children:(0,Z.jsx)(ut,{fill:!0,className:`sxl-locked-hatch-box`,style:{pointerEvents:`none`,overflow:`hidden`},children:(0,Z.jsxs)(`svg`,{width:f,height:p,viewBox:`0 0 ${f} ${p}`,style:{display:`block`},"aria-hidden":`true`,focusable:`false`,children:[(0,Z.jsxs)(`defs`,{children:[(0,Z.jsx)(`pattern`,{id:l,patternUnits:`userSpaceOnUse`,width:7,height:7,patternTransform:`rotate(45)`,children:(0,Z.jsx)(`line`,{x1:0,y1:0,x2:0,y2:7,stroke:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0, 0, 0)) 26%, transparent)`,strokeWidth:1})}),(0,Z.jsxs)(`mask`,{id:u,children:[(0,Z.jsx)(`rect`,{x:0,y:0,width:f,height:p,fill:`white`}),m.map((e,t)=>(0,Z.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,fill:`black`},`hole-${t}`))]})]}),(0,Z.jsx)(`rect`,{x:0,y:0,width:f,height:p,fill:`url(#${l})`,mask:`url(#${u})`}),m.map((e,t)=>(0,Z.jsx)(`rect`,{x:e.x+.5,y:e.y+.5,width:Math.max(0,e.width-1),height:Math.max(0,e.height-1),fill:`none`,stroke:`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 90, 158)) 60%, transparent)`,strokeWidth:1},`outline-${t}`))]})})})});Uh.displayName=`ProtectionLayer`;var Wh=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{selection:n,adapter:r,axis:i,entireCoords:a,edgeSize:o=1,edgeColor:s=`var(--sxl-color-base-300)`,scrollIntoView:c,hideAccent:l=!1,preserveFocus:u=!1,replaceActive:d=!1,allowMulti:f=!0,onPointerDownInterceptor:p,onSelectionStart:m,onSelectionEnd:h,zIndex:g,className:_,style:v,...y}=e,b=qt(),x=i===Y.Axis.Column?b.getPaneBounds().height:b.getPaneBounds().width,S=(0,X.useMemo)(()=>r??new Gs(n),[r,n]);Ae(S,e=>e.getSelection());let C=K(()=>{m?.(),n.setAdjusting(n.getCoords())},[n,m]),w=K(()=>{n.setAdjusting(null),h?.()},[n,h]),T=K(()=>{u||b.focus()},[b,u]),E=Ct(S,{axis:i,entireRange:a,scrollIntoView:c,replaceActive:d,allowMulti:f,preserveFocus:u,onPointerDownInterceptor:p,onDragStart:C,onDragEnd:w,onPointerUp:T}),D=l?null:n.getSelectedRuns(i),O=b.getAnchor(),k=[];if(!l){k.push(Gh(`edge:${O}`,i,x,o,s));for(let e=0;D&&e<D.length;e++){let t=D[e],n=qh(t.min,t.max,i,b);n&&k.push(Kh(`selection:${O}:${e}`,n,i,x))}}return(0,Z.jsx)(q,{...y,className:Q(_,`sxl-header-selection`),onPointerDown:E.onPointerDown,onPointerMove:E.onPointerMove,onPointerUp:E.onPointerUp,children:(0,Z.jsx)(ut,{fill:!0,className:`sxl-header-selection-box`,style:{pointerEvents:`none`,...v},ref:t,children:k})})})),Gh=(e,t,n,r,i)=>{let a=xe.getDevicePixelRatio(),o=r/a,s=xe.snapDeviceEdge(n-o,a),c=t===Y.Axis.Column?{position:`absolute`,background:i,pointerEvents:`none`,left:0,width:`100%`,top:`${s}px`,height:`${o}px`}:{position:`absolute`,background:i,pointerEvents:`none`,top:0,height:`100%`,left:`${s}px`,width:`${o}px`};return(0,Z.jsx)(`div`,{className:`sxl-header-selection-edge`,style:c},e)},Kh=(e,t,n,r)=>{if(!t)return;let i=`var(--sxl-color-primary)`,a=xe.getDevicePixelRatio(),o=2/a,s=xe.edgeCenter(r,`leading`,2,a),c;if(n===Y.Axis.Column){let e=xe.edgeCenter(t.x,`leading`,2,a);c={position:`absolute`,background:i,pointerEvents:`none`,top:s-o/2+`px`,height:`${o}px`,left:e-o/2+`px`,width:`${xe.edgeCenter(t.x+t.width,`trailing`,2,a)-e+o}px`}}else{let e=xe.edgeCenter(t.y,`leading`,2,a);c={position:`absolute`,background:i,pointerEvents:`none`,left:s-o/2+`px`,width:`${o}px`,top:e-o/2+`px`,height:`${xe.edgeCenter(t.y+t.height,`trailing`,2,a)-e+o}px`}}return(0,Z.jsx)(`div`,{className:`sxl-header-selection-border`,style:c},e)},qh=(e,t,n,r)=>{let i={x:0,y:0,width:0,height:0};if(n===Y.Axis.Column){let n=r.toClipBounds(r.getBoundsFromRange({colStart:e,rowStart:0,colEnd:t,rowEnd:0}),-10);if(!n)return null;i.x=n.x,i.width=n.width}else{let n=r.toClipBounds(r.getBoundsFromRange({colStart:0,rowStart:e,colEnd:0,rowEnd:t}),-10);if(!n)return null;i.y=n.y,i.height=n.height}return{x:i.x,y:i.y,width:i.width,height:i.height}},Jh=e=>`resize-indicator:`+(e===Y.Axis.Column?`col`:`row`),Yh={side:`b`,align:`center`},Xh={side:`r`,align:`center`},Zh=(0,X.memo)(e=>{let{sheetHeader:t}=e,n=je(),r=t.getAxis(),i=r===Y.Axis.Column,[a]=zt(Jh(r),null),o=!!a&&a.sizePX!==null,s=a?.index??0,c=a?.sizePX??0,l=t.getWorksheet(),u=Math.floor(10*p.getDPI())/10,d=l.getView()?.getZoomScale()??100,f=g.roundAccurately(c/(d/100)*u,0)??0,m=g.roundAccurately(c*u,0)??0,h=(g.roundAccurately(f/(t.getMetrics().getScaleFactor()*p.getDPI()),2)??0).toFixed(2),_=n(i?`resizeIndicator.width`:`resizeIndicator.height`),v=o?c===0?n(`resizeIndicator.hiddenDisplay`,{label:_}):d===100?n(`resizeIndicator.sizeDisplay`,{label:_,unit:h,px:f}):n(`resizeIndicator.sizeDisplayZoomed`,{label:_,unit:h,px:f,screenPx:m,zoom:d}):null;return(0,Z.jsx)(mt,{name:`header-resize`,active:o,anchor:{range:i?{colStart:s,colEnd:s,rowStart:0,rowEnd:0}:{rowStart:s,rowEnd:s,colStart:0,colEnd:0}},placement:i?Yh:Xh,offset:4,boundary:`viewport`,children:v})});Zh.displayName=`ResizeTooltip`;var Qh=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheetHeader:n,isColumn:r,oppositeSize:i=30,onResizeHeadersStart:a,onResizeHeaders:s,onResizeHeadersEnd:c,onResizeHeadersDown:l,onResizeHeadersUp:u,className:d,...f}=e,p=qt(),[h,_]=(0,X.useState)(n.getSelectedRuns()),[v,y]=(0,X.useReducer)(e=>e+1,0),b=je(),x=(0,X.useCallback)(m.debounce(()=>{y()},10),[]);o(n?.getWorksheet(),{onSelectionChange(e){let t=n.getSelectedRuns();_(t),x()},onProtectionChange(){y()},onViewChange(){w(n.getWorksheet().getView().getZoomScale()/100),x()}});let[S,w]=(0,X.useState)(n?.getWorksheet().getView().getZoomScale()/100),T=r?Y.Axis.Column:Y.Axis.Row,E=et(Jh(T),null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=(0,X.useCallback)(()=>{O.current&&=(clearTimeout(O.current),null)},[]);(0,X.useEffect)(()=>k,[k]);let A=(0,X.useCallback)(e=>n.at(e)?.isHidden()||n.at(e)?.getSize()===0,[n]),j=(0,X.useCallback)((e,t)=>n.getMetrics().hiddenHeadersAt(e,t),[A]),M=(0,X.useCallback)(()=>n.getMinSize(),[n]),N=(0,X.useCallback)(()=>n.getMaxSize(),[n]),P=K((e,t,r)=>{t/=S;let i={size:t=Math.max(M(),Math.min(g.roundAccurately(t,M())??t,N())),hidden:!1},a=[];t<=0&&(i.hidden=!0,i.size=r),a.push({address:{min:e,max:e},update:i});let o=p.getMetrics();if(t<0){let n=T===Y.Axis.Column,r=n?o.getColOffset:o.getRowOffset,i=n?o.getColIndex:o.getRowIndex,s=r(e),c=i(s+t),l=r(c);l===s+t?c--:a.push({address:{min:c,max:c},update:{size:s-l+t}}),e-c>1&&a.push({address:{min:c+1,max:e-1},update:{hidden:!0}})}n.updateHeaderPairs(a),E({index:e,sizePX:t*S}),s?.(e,t,r)},[v,p,n,S,s]),F=K((e,t,r)=>{let i=T===Y.Axis.Column,a=null,o={min:e,max:e};if(n.isSelectedAll(e)){let s=n.getSelectedRuns();s.length>1?a=C(i?`op.resizeColumns`:`op.resizeRows`):o=s[0];let c={hidden:t<=0,size:(t<=0?r:t)/S};n.updateHeaderPairs($h(s,c,e))}if(o){let e=o.max-o.min+1,t;t=e===1?n.getRange(o).at(0).getText():n.getRange(o).toString(),a=b(i?`op.resizeColumnsNamed`:`op.resizeRowsNamed`,{count:e,name:t})}D.current?.commit({description:a??void 0}),D.current=null,E(null),c?.(e,t,a)},[v,b,n,c]),I=K((e,t)=>{let r=T===Y.Axis.Column?C(`op.resizeColumns`):C(`op.resizeRows`);D.current=n.getWorksheet().beginCommit(r),k(),E({index:e,sizePX:t}),a?.(e,t,r)},[T,n]),L=K((e,t)=>{k(),O.current=setTimeout(()=>{O.current=null,E({index:e,sizePX:t})},360),l?.(e,t)},[l]),R=K(e=>{k(),E(null),u?.(e)},[u]),ee=K(e=>{let t=n.getMetrics(),r=t.hiddenHeadersAt(e,!0);if(r===0)return;let i=t.hiddenHeadersAt(e);n.getRange({min:e-r+1,max:e+i-1}).setHidden(!1)},[n]),te=K(e=>{let t=!1,r=T===Y.Axis.Column,i=n.getWorksheet().getEntireRange().getCoords(),a=[],o=n.getSelectedRuns(),s=e=>{let t;t=r?{colStart:e.min,rowStart:i.rowStart,colEnd:e.max,rowEnd:i.rowEnd}:{colStart:i.colStart,rowStart:e.min,colEnd:i.colEnd,rowEnd:e.max},a.push(t)},l=o.length;for(let n=0;n<l;n++){let r=o[n];r.value&&(r.min<=e&&r.max>=e&&(t=!0),s(r))}t||s({min:e,max:e}),n.getWorksheet().getRanges(a).autoFit({axes:r?Y.AxisSelection.Column:Y.AxisSelection.Row}),k(),E(null),c?.(e,null,C(`op.resizeColumns`))},[v,n,c,A]),z=n.isProtected(),B=z?void 0:P,V=null,H=(r?p.getVisibleColumns():p.getVisibleRows()).map(e=>e.index),ne=r?p.getPaneRange().colStart:p.getPaneRange().rowStart;H.length>0&&H[0]>ne&&(H=[H[0]-1,...H]);let U=[],W=[],re=H.length;for(let e=0;e<re;e++){let t=H[e],n=e<re-1?H[e+1]:t+j(t+1,!1)+1,r=t+1!==n;(!V||V.max<t)&&(V=h.length>0&&h[h.length-1].max>=t?h[g.findEqualOrGreater(h,t,e=>e.max)]:null);let i=!1,a=!1;if(V&&(V.min<=t||V.min<=n&&!r)&&(i=!0,a=V.value??!1),t===ne){let e=!1,n=!1;V&&V.min<=t&&(e=!0,n=V.value??!1),t>0&&W.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(a&&U.push(W.length),W.push({index:t,isHidden:e===0&&j(t,!1)>0,isNextHidden:r,isSelected:i,isSelectedAll:a,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:B,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:te}),r){let e=!1,r=!1;V&&V.min>=t&&V.max<=n-1&&V.value&&U.push(W.length),V&&V.max>=n||(V=h.length>0&&h[h.length-1].max>=n?h[g.findEqualOrGreater(h,n,e=>e.max)]:null),V&&V.min<=n&&(e=!0,r=V.value??!1),n>0&&W.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:B,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:te})}}if(U.length>0){let e=U.length-1;if(U.length>0){let t=W[U[e]].index,n=null;r?(n=p.getBoundsFromRange({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),n.x+n.width>p.getPaneBounds().width&&(--e,e===0&&(e=-1))):(n=p.getBoundsFromRange({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),n.y+n.height>p.getPaneBounds().height&&(--e,e===0&&(e=-1)))}let t=h?.[h.length-1],n=p.getAnchor();if(n===`t`||n===`l`){let e=W[U[Math.max(0,U.length-1)]];e.showTouchDivider=!!t&&t.max<=e.index}else e>=0&&(W[U[e]].showTouchDivider=!0)}let ie=W.length,ae=at(p,T),G=Array(ie);for(let e=0;e<ie;e++)G[e]=(0,Z.jsx)(st,{...W[e],axis:T,visibleBounds:ae,disabled:z,onDividerUnhide:z?void 0:ee},`divider${e}`);return(0,Z.jsxs)(q,{...f,className:Q(d,`sxl-header-resizer`),children:[G,(0,Z.jsx)(Zh,{sheetHeader:n})]})})),$h=(e,t,n=null)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a];if(!i.value)continue;let o=i.min,s=i.max;o===s&&o===n||r.push({address:{min:o,max:s},update:t})}return r},eg=`var(--sxl-color-primary)`,tg=`var(--sxl-color-base-100)`,ng=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=qt(),[a]=zt(Jh(Y.Axis.Column),null),[o]=zt(Jh(Y.Axis.Row),null),s=!!a,c=a??o,l=Q(n,`sxl-resize-indicator`);if(!c)return(0,Z.jsx)(q,{...r,className:l});let{index:u,sizePX:d}=c,f=d===0,p=t.getEntireRange().getCoords(),m=s?{rowStart:0,rowEnd:p.rowEnd,colStart:u,colEnd:u}:{rowStart:u,rowEnd:u,colStart:0,colEnd:p.colEnd},h=null;if(i.toClipBounds(i.getBoundsFromRange(m))){let e=i.getMetrics(),t=i.getPaneBounds(),n=s?e.getColOffset(u):e.getRowOffset(u),r=d===null?s?e.getColOffset(u+1):e.getRowOffset(u+1):n+Math.max(0,d),a=Math.max(0,n),o=Math.min(s?t.x+t.width:t.y+t.height,r),c,l,p,m;if(s){let e=t.height;c=[0,0,0,e],l=`-0.5px 0px 0px 0px ${tg}`,p={x:a-1,y:0,width:1,height:e},m={x:o,y:0,width:1,height:e}}else{let e=t.width;c=[0,0,e,0],l=`0px -0.5px 0px 0px ${tg}`,p={x:0,y:a-1,width:e,height:1},m={x:0,y:o,width:e,height:1}}let g={style:{boxShadow:l},propsPath:{stroke:eg,strokeWidth:`2px`,strokeDasharray:`0 0 8 4`}};h=(0,Z.jsxs)(X.Fragment,{children:[f?void 0:(0,Z.jsx)(ct,{linePoints:c,bounds:p,propsPath:{stroke:eg,strokeWidth:`2px`}}),(0,Z.jsx)(ct,{linePoints:c,bounds:m,...g})]},`resize-dividers`)}return(0,Z.jsx)(q,{...r,className:l,children:h})});ng.displayName=`ResizeIndicator`;var rg=e=>`freeze-drag:`+(e===Y.Axis.Column?`col`:`row`),ig=e=>`freeze-active:`+(e===Y.Axis.Column?`col`:`row`),ag=`var(--sxl-color-primary)`,og=(e,t,n,r,i,a=0)=>{let o=e.getPanePointFromPointer(t?n:0,t?0:n);if(!o)return null;let s=e.getPaneBounds(),c=(t?o.x:o.y)+a,l=t?s.width:s.height;if(c<-1||c>l+1)return null;let u=t?s.height:s.width;return(0,Z.jsx)(ct,{linePoints:t?[0,0,0,u]:[0,0,u,0],bounds:t?{x:c,y:0,width:1,height:u}:{x:0,y:c,width:u,height:1},propsPath:i},r)},sg={stroke:ag,strokeWidth:`2px`},cg={stroke:ag,strokeWidth:`2px`,strokeDasharray:`4 3`},lg=(0,X.memo)(e=>{let{showStart:t=!1}=e,n=qt(),[r]=zt(rg(Y.Axis.Column),null),[i]=zt(rg(Y.Axis.Row),null),[a]=zt(ig(Y.Axis.Column),!1),[o]=zt(ig(Y.Axis.Row),!1),s=n.getAllPanes(),c=n.getPaneBounds(),l=t&&a&&!s[_.Left]&&c.x===0?ug(n,!0):null,u=t&&o&&!s[_.Top]&&c.y===0?ug(n,!1):null,d=!!r,f=r??i;return(0,Z.jsxs)(Z.Fragment,{children:[l,u,f?.pointerClient===void 0?null:og(n,d,f.pointerClient,`freeze-pointer`,cg),f?og(n,d,f.snapClient,`freeze-snap`,sg,+(f.index===0)):null]})}),ug=(e,t)=>{let n=e.getPaneBounds(),r=t?n.height:n.width;return(0,Z.jsx)(ct,{linePoints:t?[0,0,0,r]:[0,0,r,0],bounds:t?{x:1,y:0,width:1,height:r}:{x:0,y:1,width:r,height:1},propsPath:sg},t?`freeze-start-col`:`freeze-start-row`)};lg.displayName=`FreezeDragLines`;var dg=(e,t,n)=>{let r=t===Y.Axis.Column,i=e.getFreezePanes(),a=i.coords?.colIndex??0,o=i.coords?.rowIndex??0,s=r?n:a,c=r?o:n;if(s===a&&c===o)return;if(s===0&&c===0)return void e.setFreezePanes(null);let l=e.getTopLeft();e.setFreezePanes({coords:{colIndex:s,rowIndex:c},topLeft:{left:a>0?i.topLeft?.left??0:l.left,top:o>0?i.topLeft?.top??0:l.top}})},fg=(e,t)=>{let n=qt(),r=t===Y.Axis.Column,[,i]=(0,X.useReducer)(e=>e+1,0);o(e.getView(),{onFreezePaneChange(){i()}});let a=et(rg(t),null),[s,c]=zt(ig(t),!1),l=(0,X.useRef)(null),u=()=>{let e=l.current;e?.frame&&cancelAnimationFrame(e.frame),l.current=null};(0,X.useEffect)(()=>u,[]);let d=e=>{let t=l.current;if(!t)return;let n=Math.max(0,e-t.time);t.time=e;let r=t.target.snapClient-t.shown;t.shown=Math.abs(r)<.5?t.target.snapClient:t.shown+r*(1-Math.exp(-n/30)),a({...t.target,snapClient:t.shown}),t.frame=t.shown===t.target.snapClient?0:requestAnimationFrame(d)},f=K(e=>{u(),l.current={target:e,shown:e.snapClient,frame:0,time:0},a(e)},[]),p=K(e=>{let t=l.current;t?(t.target=e,t.shown===e.snapClient?a(e):t.frame||=(t.time=performance.now(),requestAnimationFrame(d))):a(e)},[]),m=K(()=>{u(),a(null)},[]),h=G.useCommandScope(),g=()=>h?.resolve(`freezePanesAt`,h),_=K(n=>{u(),a(null);let r={axis:t,index:n.index};h?g()?.execute(r):dg(e.getView(),r.axis,r.index)},[e,t,h]),v=(r?e.getView().getFreezePanes().coords?.colIndex:e.getView().getFreezePanes().coords?.rowIndex)??0,y=!!h&&(g()?.disabled()??!0);if(!y&&v>0){let e=(Jt(n.getAllPanes())??n).getMetrics(),t=r?e.getColOffset(v):e.getRowOffset(v);y=Math.abs(t)>.5}return{disabled:y,isActive:s,onFreezeDragStart:f,onFreezeDrag:p,onFreezeDragEnd:_,onFreezeDragCancel:m,onActiveChange:c}},pg=(0,X.memo)(e=>{let{sheetHeader:t,className:n,...r}=e,i=t.getAxis(),{isActive:a,...o}=fg(t.getWorksheet(),i);return(0,Z.jsxs)(q,{...r,className:Q(n,`sxl-header-freeze`),children:[(0,Z.jsx)(lg,{}),(0,Z.jsx)(ht,{axis:i,highlight:a,...o})]})});pg.displayName=`HeaderFreezeLayer`;var mg=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,{isActive:i,...a}=fg(t,Y.Axis.Column),{isActive:o,...s}=fg(t,Y.Axis.Row);return(0,Z.jsxs)(q,{...r,className:Q(n,`sxl-freeze`),children:[(0,Z.jsx)(lg,{showStart:!0}),(0,Z.jsx)(Mt,{axis:Y.Axis.Column,...a}),(0,Z.jsx)(Mt,{axis:Y.Axis.Row,...s})]})});mg.displayName=`GridFreezeLayer`;var{CommandScopeProvider:hg}=G,gg=(e,t)=>(e.updateCommand(`openContextMenu`,{callback:()=>{t.openAtSelectedCell()}}),()=>{}),_g=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetContextMenu:r,className:i,...a}=e,o=qt(),s=(0,X.useCallback)(e=>{let t=o.getCellFromPointer(e.clientX,e.clientY);t&&r&&(r({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[o,r]),c=K(()=>{if(!o||!r)return;let e=n.getSelection().getCoords().cell;o.scrollCellCoordsIntoView(e).then(t=>{requestAnimationFrame(()=>{let n=o.getMetrics().getColOffset(e.colIndex+1),i=o.getMetrics().getRowOffset(e.rowIndex+1),a=o.getPanePointFromPointer(0,0)||{x:0,y:0};r({clientX:n-a.x-(t.left??0)+6,clientY:i-a.y-(t.top??0)+6})})})},[o,n,r]),l=(0,X.useMemo)(()=>({openAtSelectedCell:c}),[c]);return(0,Z.jsx)(hg,{spec:{scopeName:`layer:contextmenu`,contributor:{dynamic:gg},data:l},order:xt().zIndex,children:(0,Z.jsx)(q,{onContextMenu:s,className:Q(i,`sxl-contextMenu`),...a})})}));function vg(e){let{axis:t,entireCoords:n,scrollIntoView:r,className:i,...a}=e,o=wa().getMode(),s=o?.selection??null,c=l()?.getName(),u=(0,X.useMemo)(()=>{if(!s)return null;let e=new Gs(s);return c?oc(e,c):e},[s,c]);return o&&o.mode===`point`&&s?o.scope&&o.scope!==c?null:(0,Z.jsx)(Wh,{className:Q(i,`sxl-reference-header`),selection:s,adapter:u,axis:t,entireCoords:n,scrollIntoView:r,hideAccent:!0,preserveFocus:!0,replaceActive:!0,allowMulti:!1!==o.allowMulti,...a}):null}_g.displayName=`ContextMenuLayer`,vg.displayName=`SheetReferenceHeaderLayer`;var yg=e=>{let{style:t,...n}=e??{};return(0,Z.jsxs)(`svg`,{style:{width:`135px`,height:`37px`,...t},viewBox:`0 0 135 37`,...n,children:[(0,Z.jsx)(`path`,{d:`M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z`,fill:`#547dbe`,fillRule:`evenodd`}),(0,Z.jsx)(`path`,{d:`M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z`,fill:`#ffffff`,fillRule:`evenodd`}),(0,Z.jsx)(`path`,{d:`m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z`,fill:`#547dbe`,fillRule:`evenodd`,strokeWidth:`0.4`}),(0,Z.jsx)(`path`,{d:`M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z`,fill:`#eb594d`}),(0,Z.jsx)(`path`,{d:`m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z`,stroke:`#eb594d`,strokeWidth:`2`,fill:`#f9cecb`})]})},bg=(0,X.memo)(e=>{let{colorLicensee:t=`blue`,colorError:n=`red`,colorCredits:r=`grey`,credits:i=`All rights reserved - Michael Ford`,feature:a,style:o,...s}=e??{},[c,l]=(0,X.useState)(null);(0,X.useEffect)(()=>{(async()=>{let e=await Kn.getDetails();l(e)})()},[]);let[u,d]=(0,X.useState)(!1),f={opacity:.65},p=(0,X.useMemo)(()=>{let e=c?.getExceptions(),t=e?.length??0;if(t===0)return null;let r=[];for(let i=0;i<t;i++){let t=e[i];r.push((0,Z.jsx)(`div`,{style:{opacity:.8,fontSize:`16px`,textAlign:`left`,color:n},children:t},i))}return r},[c,n]);if(c===null||c.isValidFor(a??``))return null;let m=c.getType(),h=!p&&m.endsWith(`ity`),g=c.getLicensee(),_=h?1.6:1,v=135/_,y=37/_,b=null;return(g?.length??0)>0&&(b=(0,Z.jsx)(`div`,{style:{opacity:.7,fontWeight:`500`,fontSize:`16px`,textAlign:`left`,color:t},children:g})),(0,Z.jsx)(`div`,{style:{pointerEvents:`none`,display:`flex`,flexDirection:`column`,overflow:`hidden`,...o},...s,children:(0,Z.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`},children:[u?(0,Z.jsx)(yg,{style:f}):(0,Z.jsx)(`svg`,{width:v,height:y,style:f,children:(0,Z.jsx)(`image`,{style:{width:v,height:y},href:`https://www.sheetxl.com/watermark.svg`,onError:()=>d(!0)})}),(0,Z.jsxs)(`div`,{children:[b,p,(0,Z.jsx)(`div`,{style:{height:`0px`,fontSize:`16px`,textAlign:`left`,width:`0px`,opacity:.8,color:r},children:i})]})]})})}),xg=e=>{let[t,n]=(0,X.useState)(()=>({header:e,metrics:e.getMetrics()})),r=t;t.header!==e&&(r={header:e,metrics:e.getMetrics()},n(r));let i=K(()=>{let t=e.getMetrics();n(n=>n.header===e&&n.metrics===t?n:{header:e,metrics:t})},[e]);return o(e,{onMetricsChange:i}),[r.metrics,i]},Sg={key:`copy`,description:C(`editMode.copy`)},Cg={key:`cut`,description:C(`editMode.cut`)},wg={type:er.Content.Values},Tg={fitDestination:!0,type:er.Content.Formats},Eg={fitDestination:!0,type:er.Content.Formulas},Dg={transpose:!0},Og={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getAddress({$colIndex:!0,$rowIndex:!0})}`})};function kg(e,t){let n=t.sheet,r=t,{notifier:i,editModeHandler:a,globalClipboard:o,element:s}=t,c={element:s,doCopy:e=>{let t=n.getSelectedRanges().getSnapshot(e);return new or(t)}},l={element:s,importFromExternal:async(e,t)=>{let r=n.getSelectedRange().getTopLeft().getCoords(),i=new lr(n.getRuntime(),e,{colIndex:r.colStart,rowIndex:r.rowStart},t,n.getStyles());return await i.parse()?i:null},doPaste:async(e,t)=>{if(e?.getItemType()!==`range`)return!1;t?.contentsOnly&&delete(t={...t,type:er.Content.Values}).contentsOnly;let r=e.getItem?.();if(!r)return!1;let i=r.getName?.(),a=n.getSelectedRange();if(i===`HTML`&&a.size>1){let e=r.getCoords?.();e&&w.isSingleCell(e)&&(a=a.getResizeTo(1,1))}return await a.doBatch(async()=>{let e=await a.copyFrom(r,{...t});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:i?j(`op.pasteNamed`,{name:i}):C(`op.paste`),autoSelect:!0}),!0}},u=async e=>{if(c.element?.())try{await(async e=>{if(!c.element)return;let t=o.getClipboard(),n=c.doCopy?.(e);typeof n==`string`?await t.writeText(n):await t.writeReference(n)})(e??{})}catch(e){i?.showError(e)}},d=async(e,t,o)=>{try{if(!1===await e.doPaste?.(t,o))return;((e,t)=>{if(e?.getItemType()!==`range`)return;let i=a.getMode()?.key===`cut`||e.isCut?.();if(!i&&a.getMode()?.key===`copy`){let t=e.getItem?.()?.getCoords?.(),r=n.getSelectedRanges().getCoords(),a=!1;if(t&&r&&e.getItem?.()?.getSource?.()===n)for(let e=0;!a&&e<r.length;e++)a=w.isRangesIntersect(t,r[e]);i=a}i&&a.setMode(null),s?.()?.focus(),r.onPaste?.(e,t)})(t,o)}catch(e){i?.showError(e)}},f=async(e,t,n)=>{let r=l.element?.();if(r&&await p.whenFocus(r),!e&&!t)return;let a=await i?.showBusy?.(j(`clipboard.pasting`));if(t)try{await d(l,t,n),a?.();return}catch(e){a?.(),i?.showError(e)}if(!e)return void a?.();let o=l.importFromExternal;o||=()=>({getItemType:()=>`text`,toText:()=>e?.text??``,isClipboardItem:!0});let s=null;try{s=await o(e,{isCut:!1})}catch(e){a?.(),i?.showError(e)}if(s)try{let e=await Promise.resolve(s);await d(l,e,n),a?.()}catch(e){a?.(),i?.showError(e)}else a?.()},m=async e=>{if(!l.element)return;let t=o.getClipboard();try{let n=await t.readReference();if(n)return void await f(null,n,e??{});let r=[];r[0]=await y.readStringFromClipboard(t,O.Plain),r[1]=await y.readHTMLFromClipboard(t,O.Html),r[2]=await y.readBlobFromClipboard(t,O.Png);let i={text:r[0]??null,html:r[1]??null,image:r[2]??null};await f(i,null,e??{})}catch(e){if(e?.message===`Document is not focused.`)return;i?.showError(e)}};e.updateCommand(`copy`,{callback:()=>u()}),e.updateCommand(`cut`,{callback:()=>u({isCut:!0})}),e.updateCommand(`paste`,{callback:()=>m()}),e.updateCommand(`pasteValues`,{callback:e=>m({...wg,...e})}),e.updateCommand(`pasteFormats`,{callback:(e,t)=>m({...Tg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteFormulas`,{callback:(e,t)=>m({...Eg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteTranspose`,{callback:(e,t)=>m({...Dg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteLinks`,{callback:(e,t)=>m({...Og,description:t?.getLabel(),...e})}),e.updateCommand(`formatPainterToggle`,{state:a.getMode()?.key===`formatPainter`,callback:()=>{if(a.getMode()?.key!==`formatPainter`)return u({editMode:{key:`formatPainter`,description:C(`editMode.formatPainter`),cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}});a.setMode(null)}});let h=[`pasteFormats`,`pasteTranspose`,`pasteLinks`,`formatPainterToggle`],g=[`cut`,`paste`,`pasteValues`,`pasteFormulas`],_=()=>{let t=n.getProtection(),r=t.isFormatCellsAllowed()?[]:[C(`reason.sheetProtected`)];for(let t of h)e.updateCommand(t,{disabledReasons:r});let i=t.isLocked()&&!n.getSelectedRange().getCell().isEditAllowed()?[C(`reason.sheetProtected`)]:[];for(let t of g)e.updateCommand(t,{disabledReasons:i})};_();let v=o.getClipboard(),b=async()=>{a.getMode()?.key!==`edit`&&(e=>{let t=e?.getItemType()===`range`?e:null;if(t){let n=e.editMode?.(),r=e?.isCut?.()?Cg:Sg,i=(n?.key??r.key)!==`formatPainter`,s={...r,...n,args:{isClipboard:!0,reference:t,...n?.args},cancel:()=>a.setMode(e=>e===s?null:e),done:i?async()=>{await m(),a.setMode(e=>e===s?null:e)}:void 0,onModeChange:e=>{e?.args?.isClipboard||o.getClipboard().clear(!0),n?.onModeChange?.(e)}};a.setMode(s)}r.onClipboardUpdate?.(t)})(await v.readReference())},x={safari:C(`error.clipboard.safari`),perms:C(`error.clipboard.perms`)},T=e=>i?.showMessage?.(j(x[e.code]),{onceKey:`clipboard.features`}),E=()=>T(S.ErrorMessages.PermsRead),D=()=>T(S.ErrorMessages.PermsWrite);v.addEventListener(`clipboardchange`,b),v.addEventListener(`clipboarderrorread`,E),v.addEventListener(`clipboarderrorwrite`,D);let k=n.addListeners({onProtectionChange:_,onStyleChange:_,onInvalidated:_}),A=n.getSelection().addListeners({onChange:_});return()=>{v.removeEventListener(`clipboardchange`,b),v.removeEventListener(`clipboarderrorread`,E),v.removeEventListener(`clipboarderrorwrite`,D),k(),A()}}var{CommandScopeProvider:Ag,useCommandExecute:jg}=G,Mg=({sheet:e,className:t,...n})=>{let r=he(),i=ue(),a=Ie(),o=qt(),s=jg(),c=i.getMode(),l=K(()=>o.getElement(),[o]),u=(0,X.useMemo)(()=>({sheet:e,notifier:r,editModeHandler:i,globalClipboard:a,element:l}),[e,r,i,a,l]),d=c?.key,f=d===`copy`||d===`cut`||d===`formatPainter`,p=c?.args?.reference,m=p?.getItem?.(),h=m?.getSource()===e,g=m?.getCoords?.();return(0,Z.jsx)(Ag,{spec:{scopeName:`layer:clipboard`,contributor:{dynamic:kg},data:u},order:xt().zIndex,children:(0,Z.jsx)(q,{onKeyDown:async e=>{let t=i.getMode()?.key,n=t===`copy`||t===`cut`;(n||t===`formatPainter`)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),i.setMode(null)):n&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),await s(`paste`),i.setMode(null)))},...n,className:Q(t,`sxl-clipboard`),children:f&&p&&h&&g&&(0,Z.jsx)(Pt,{range:g,alignWidth:2,stroke:p.isCut?.()?`var(--sxl-color-warning)`:`var(--sxl-color-primary)`,animatedStroke:!0,clipInsets:-10})})})};Mg.displayName=`SheetClipboardLayer`;var Ng=`_sheet-scrollbar_104cg_1`,Pg={side:`l`,align:`center`},Fg={side:`t`,align:`center`},Ig=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n=xe.EmptyCssProperties,orientation:r,sheet:i,onScrollOffset:a,showCustomScrollButtons:s,offset:c=0,totalSize:l=0,viewportSize:d=0,className:f,endGap:p,...m}=e;if(!i)throw Error(`SheetScrollbar needs an IWorksheet`);let h=(0,X.useRef)(null),g=u([h,t]),_=r===V.Vertical,v=je(),[y,b]=(0,X.useState)(()=>{let e=(i.getView().getZoomScale()??100)/100,t=i.getView().getTopLeft();return(_?t.top:t.left)*e}),x=()=>{let e=i.getView().getFreezePanes(),t=(i.getView().getZoomScale()??100)/100;if(_){let n=e.coords?.rowIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.top??0;return{shift:(i.getRowHeaders().getMetrics().getOffset(n)-r)*t,scroll:r*t}}{let n=e.coords?.colIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.left??0;return{shift:(i.getColumnHeaders().getMetrics().getOffset(n)-r)*t,scroll:r*t}}},[S,C]=(0,X.useState)(x),[T,E]=(0,X.useState)(null),D=r===V.Vertical?i.getRowHeaders():i.getColumnHeaders(),O=()=>{let e=i.getUsedRange()?.getCoords()??w.EmptyRange,t=i.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[k,A]=(0,X.useState)(O),j=k?(_?k.rowIndex:k.colIndex)+1:0,M=()=>{let e=O();w.isEqualCells(k,e)||A(e)};o(i.getView(),{onFreezePaneChange:()=>{C(x)}}),o(i.getSelection(),{onChange:M}),o(i,{onUsedRangeChange:M}),(0,X.useEffect)(()=>{A(O())},[i]);let N=c-S.scroll,P=d-S.shift,F=l-(S.shift+S.scroll),I=D.getMetrics().getOffset(j)*(i.getView().getZoomScale()/100)-(S.scroll+S.shift),L=K((e,t,n)=>{b(e);let r=e+S.scroll,i=t+S.shift,o=n+S.shift+S.scroll;a?.(r,i,o)},[a,S]),R=K(e=>{E(e.dragging?{element:e.element}:null)},[]),ee=null,te=T?T.element??h.current?.querySelector(`[role="slider"]`)??null:null;if(te){let e=D.getTextAt(D.getMetrics().getIndex(y/(i.getView().getZoomScale()/100)+S.scroll+S.shift));ee=v(_?`scrollbar.row`:`scrollbar.column`,{title:e})}let z=(0,X.useMemo)(()=>(0,Z.jsx)(Ve,{ref:g,className:Q(f,Ng),style:n,offset:N,viewportSize:P,totalSize:F,orientation:r,showCustomScrollButtons:s,onMouseDown:e=>{e.preventDefault()},onScrollOffset:L,minSize:I,onThumbDrag:R,...m}),[f,N,P,F,r,s,n,I,p]);return(0,Z.jsxs)(Z.Fragment,{children:[z,te?(0,Z.jsx)(mt,{name:`scrollbar-thumb`,active:!!T,anchor:{element:te},placement:_?Pg:Fg,children:ee}):null]})}));Ig.displayName=`SheetScrollbar`;var Lg=Object.freeze([]),Rg={style:{display:`none`}},zg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheetHeader:n,oppositeSize:r=30,edgeSize:i=1,edgeColor:a=`var(--sxl-color-base-300)`,headerText:s,freezeStart:c,colorScheme:l,verticalPadding:d,horizontalPadding:f,onSheetContextMenu:p,onResizeHeadersStart:m,onResizeHeaders:h,onResizeHeadersEnd:g,onResizeHeadersDown:_,onResizeHeadersUp:v,viewport:y,onSelectionStart:b,onSelectionEnd:x,propsCellRender:S,style:C,className:w,...T}=e,E=(0,X.useMemo)(()=>n.getAxis(),[n]),D=K(m,[m]),O=K((e,t,n)=>{H(),h?.(e,t,n)},[h]),k=K(g,[g]),A=K(_,[_]),j=K(v,[v]),M=(0,X.useRef)(null),[N,P]=(0,X.useReducer)(e=>e+1,0),F=n?.getWorksheet(),I=(0,X.useRef)(!1);(0,X.useLayoutEffect)(()=>{I.current=!0},[n]);let[L,R]=(0,X.useState)(0),[ee,te]=(0,X.useState)(F?.getView().getZoomScale()/100),[z,B]=(0,X.useState)(()=>F?.getEntireRange().getCoords()??null);o(F,{onViewChange:()=>{te(F.getView().getZoomScale()/100)},onLayoutChange:()=>{let e=F.getEntireRange().getCoords();B(t=>t&&t.rowEnd===e.rowEnd&&t.colEnd===e.colEnd?t:e)}});let[V,H]=xg(n);o(n,{onMetricsChange:()=>{R(n.getEntireRange().getCoords().max+1)}});let ne=(0,X.useCallback)((e,t)=>V.hiddenHeadersAt(e,t),[V]),U=K(e=>n.isSelected(e),[n]),W=K(e=>n.isSelectedAll(e),[n]),re=(0,X.useCallback)(()=>{let e=n.getFilteredRanges();return e.length===0?Lg:e.map(e=>e.getCoords())},[n]),ie=(0,X.useRef)(Lg),[ae,G]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{ie.current=re()},[re]),o(F,{onTablesChange:()=>{let e=ie.current,t=re();ie.current=t,((e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].min!==t[n].min||e[n].max!==t[n].max)return!1;return!0})(e,t)||G()}});let oe=K(e=>{let t=ie.current;for(let n=0;n<t.length;n++)if(e>=t[n].min&&e<=t[n].max)return!0;return!1},[]),se=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return{getColOffset:t=>e?V.getOffset(t):t===0?0:r/ee,getColIndex:t=>e?V.getIndex(t):0,getRowOffset:t=>e?t===0?0:r/ee:V.getOffset(t),getRowIndex:t=>e?0:V.getIndex(t)}},[V,E,r,ee]),ce=(0,X.useMemo)(()=>(0,Z.jsx)(Qh,{sheetHeader:n,isColumn:E===Y.Axis.Column,oppositeSize:r,onResizeHeadersStart:D,onResizeHeaders:O,onResizeHeadersEnd:k,onResizeHeadersDown:A,onResizeHeadersUp:j},`header-resizer-layer-${E}-[${n.getWorksheet().getId()}]`),[n,r,E,N]),le=(0,X.useMemo)(()=>(0,Z.jsx)(pg,{sheetHeader:n},`header-freeze-layer-${E}-[${n.getWorksheet().getId()}]`),[n,E]),de=K(e=>{let t=E===Y.Axis.Column;p?.({...e,rowIndex:t?-1:e.rowIndex,colIndex:t?e.colIndex:-1})},[E,p]),fe=K(e=>{F?.scrollTo({colStart:e.colIndex,colEnd:e.colIndex,rowStart:e.rowIndex,rowEnd:e.rowIndex},{})},[F]),pe=(0,X.useMemo)(()=>(0,Z.jsx)(Wh,{selection:n.getWorksheet().getSelection(),axis:E,entireCoords:z??n.getWorksheet().getEntireRange().getCoords(),edgeSize:i,edgeColor:a,scrollIntoView:fe,onPointerDownInterceptor:(e,t)=>!(e.button===2&&n.isSelectedAll(E===Y.Axis.Column?t.colIndex:t.rowIndex)),onSelectionStart:b,onSelectionEnd:x},`header-selection-layer-${E}-[${n.getWorksheet().getId()}]`),[n,L,z,c,i,a,fe]),me=(0,X.useMemo)(()=>(0,Z.jsx)(vg,{axis:E,entireCoords:z??n.getWorksheet().getEntireRange().getCoords(),scrollIntoView:fe},`header-reference-layer-${E}-[${n.getWorksheet().getId()}]`),[n,L,z,c,E,fe]),he=(0,X.useMemo)(()=>p?(0,Z.jsx)(_g,{sheet:n.getWorksheet(),onSheetContextMenu:de},`context-menu-layer-${E}-[${n.getWorksheet().getId()}]`):null,[n,p,N]),ge=K(e=>s?s(e):n.getTextAt(e),[s,n]),_e=K(e=>{let{range:t,key:r,...i}=e,a=E===Y.Axis.Column?t?.colStart??e.cell.colIndex:t?.rowStart??e.cell.rowIndex,o=n.at(a);return(0,Z.jsx)(ra,{axis:E,index:a,isSelected:U,isSelectedAll:W,isFiltered:oe,zoomScale:100*ee,headerText:ge,verticalPadding:d,horizontalPadding:f,onColumnButtonMouseDown:S?.onColumnButtonMouseDown,propsColumnButton:S?.propsColumnButton,renderColumnButton:S?.renderColumnButton,...i,value:o},`${r}-${E}-[${n.getWorksheet().getId()}]`)},[N,S,L,ee,n]),ve=ue(),ye=Ue(t,()=>({scrollTo:e=>{M.current?.scrollTo(e)},forceRender:()=>{P()},getGridSurface:()=>M.current}),[]),be=(0,X.useMemo)(()=>{if(y)return E===Y.Axis.Column?new Be(y,new Ne,!0,!1,y):new Be(new Ne,y,!1,!0,y)},[y,E]),Se=l===`dark`?`dark`:`light`,we=(0,X.useMemo)(()=>{let e={overflow:`visible`,...(F?.getStyles().getNormal().getFont()).toCSS(`adaptive`,1),...C},t=`white`,n=`black`;if(xe.detectIt().primaryInput!==`touch`){let r=E===Y.Axis.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;ve.getMode()?.key===`formatPainter`&&(r=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),e.cursor=r}e.backgroundColor=`var(--sxl-color-base-100)`;let i=E===Y.Axis.Column;return e.boxSizing=`border-box`,e.width=i?`100%`:r,e.height=i?r:`100%`,e.contain=`size layout style`,e.clipPath=i?`inset(-9999px 0px -9999px 0px)`:`inset(0px -9999px 0px -9999px)`,e},[E,ve,l,C,r,N]),Te=E===Y.Axis.Column?`columnHeaders`:`rowHeaders`,Ee=Th(n.getWorksheet(),Te),De=(0,X.useMemo)(()=>[(0,Z.jsx)(ed,{header:n,renderCell:_e,invalidateToken:ae},`header-cells-${E}-[${n.getWorksheet().getId()}]`),pe,me,ce,le,he,...Ee],[ce,le,pe,me,he,Ee,n,_e,E,ae]),Oe=u([ye,M]),ke=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return(0,Z.jsx)(gh,{value:Te,children:(0,Z.jsx)(rt,{ref:Oe,className:Q(w,`sxl-sheet-header`),style:{touchAction:`none`,...we},...Ce(`header`,Se),viewport:be,columnCount:e?L:1,rowCount:e?1:L,freezeLeft:e?c:void 0,freezeTop:e?void 0:c,propsFreezeLeft:Rg,propsFreezeTop:Rg,hiddenColumnsAt:e?ne:void 0,hiddenRowsAt:e?void 0:ne,metrics:se,...T,children:De})})},[L,De,Te,se,be,we,w,Se,T,Oe]);return(0,X.useEffect)(()=>{I.current=!1,M.current?.invalidate()},[n]),ke})),Bg=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,thickness:i,freezeStart:a,viewport:s,colorScheme:c,renderButton:l,laneGap:u,bracketGap:d,className:f,style:p,...m}=e,h=n===Y.Axis.Column,g=h?t.getColumnHeaders():t.getRowHeaders(),_=()=>(t.getView().getZoomScale()??100)/100,v=()=>g.getEntireRange().getCoords().max+1,[y,b]=(0,X.useState)(_),[x,S]=(0,X.useState)(v),[C]=xg(g);o(t,{onViewChange:()=>b(_())}),o(g,{onMetricsChange:()=>S(v())});let w=(0,X.useMemo)(()=>({getColOffset:e=>h?C.getOffset(e):e===0?0:i/y,getColIndex:e=>h?C.getIndex(e):0,getRowOffset:e=>h?e===0?0:i/y:C.getOffset(e),getRowIndex:e=>h?0:C.getIndex(e)}),[C,h,i,y]),T=(0,X.useCallback)((e,t)=>C.hiddenHeadersAt(e,t),[C]),E=(0,X.useMemo)(()=>{if(s)return h?new Be(s,new Ne,!0,!1,s):new Be(new Ne,s,!1,!0,s)},[s,h]),D=(0,X.useMemo)(()=>({boxSizing:`border-box`,width:h?`100%`:i,height:h?i:`100%`,contain:`size layout style`,...p}),[h,i,p]),O=c===`dark`?`dark`:`light`;return(0,Z.jsx)(rt,{className:Q(f,`sxl-sheet-outline`),style:D,...Ce(`app`,O),viewport:E,columnCount:h?x:1,rowCount:h?1:x,freezeLeft:h?a:void 0,freezeTop:h?void 0:a,hiddenColumnsAt:h?T:void 0,hiddenRowsAt:h?void 0:T,metrics:w,...m,children:(0,Z.jsx)(nd,{sheet:t,axis:n,lanes:r,renderButton:l,laneGap:u,bracketGap:d},`outline-${n}-[${t.getId()}]`)})});Bg.displayName=`SheetOutlineElement`;var Vg=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,laneSize:i,laneGap:a=1,colorScheme:s,renderLevelButton:c=pa,className:l,style:u,...d}=e,f=je(),p=n===Y.Axis.Column,m=ia(i,a),[,h]=(0,X.useReducer)(e=>e+1,0);o(t.getOutline(),{onOutlineChange:()=>h()});let g=Ug(t.getOutline(),n)+1,_=s===`dark`?`dark`:`light`,[v]=pe(`outlineShowLevel`),y=v?.disabled()??!1,b=e=>{v?v.execute({axis:n,level:e}):t.getOutline().setVisibleLevels(p?Y.Axis.Column:Y.Axis.Row,e)},x=[];for(let e=1;e<=r;e++)x.push((0,Z.jsx)(`div`,{style:{width:i,height:i,flex:`none`,display:`flex`,justifyContent:p?`flex-end`:`flex-start`,alignItems:p?`flex-start`:`flex-end`},children:(0,Z.jsx)(`div`,{style:{width:m,height:m,display:`flex`},onMouseDown:e=>e.preventDefault(),children:(0,Z.jsx)(ae,{render:c,props:{axis:n,level:e,shown:e<=g,size:m,title:f(`outline.showLevel`,{level:e}),onShowLevel:()=>b(e),disabled:y}})})},e));return(0,Z.jsx)(`div`,{className:Q(l,`sxl-sheet-outline-levels`),...Ce(`header`,_),...d,style:{display:`flex`,flexDirection:p?`column`:`row`,alignItems:`flex-end`,justifyContent:`flex-start`,paddingLeft:p?0:a,paddingTop:p?a:0,paddingRight:p?Hg:0,paddingBottom:p?0:Hg,boxSizing:`border-box`,width:`100%`,height:`100%`,overflow:`hidden`,...u},children:x})});Vg.displayName=`SheetOutlineLevels`;var Hg=3,Ug=(e,t)=>{let n=[],r=0,i=e.getLevelCount(t);for(let a=1;a<=i;a++){let i=n,o=[],s=0;for(let n of e.getGroups(t,{level:a}))if(!n.collapsed){if(a>1){for(;s<i.length&&i[s].end<n.start;)s++;if(s>=i.length||i[s].start>n.start)continue}o.push(n)}if(o.length===0)break;r=a,n=o}return r},Wg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,colorScheme:r,className:i,style:a,width:s,height:c,onMouseDown:l,...u}=e,[d,f]=(0,X.useState)(n.getSelection().isEntire()),[p,m]=(0,X.useState)(!1),[h]=pe(`selectAll`);o(n?.getSelection(),{onChange:()=>{f(n.getSelection().isEntire()),m(n.getSelection().hasTopOrLeft())}});let g=r===`dark`?`dark`:`light`,_=d?`var(--sxl-color-primary)`:`var(--sxl-color-base-100)`,v=d?`color-mix(in srgb, var(--sxl-color-primary) 20%, transparent)`:`var(--sxl-color-base-hover)`,y=`var(--sxl-color-base-300)`,b=xe.getDevicePixelRatio(),x=e=>e/b+`px`;return(0,Z.jsxs)(`div`,{tabIndex:-1,className:Q(i,`sxl-top-left-corner`),...Ce(`header`,g),...u,onMouseDown:e=>{let t=e.button!==0||!e.ctrlKey&&!n.getSelection().isEntire();h?.execute(t),l?.(e)},style:{gridColumn:`1 / 2`,gridRow:`1 / 2`,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSizing:`border-box`,position:`relative`,cursor:`cell`,zIndex:100,borderRight:`solid ${x(1)} ${y}`,borderBottom:`solid ${x(1)} ${y}`,...a},ref:t,children:[(0,Z.jsx)(`div`,{style:{height:c-5+`px`,width:c-5+`px`,clipPath:`path('M${c-5} 0 L0 ${c-5} L${c-5} ${c-5} L${c-5} 0 Z')`,borderRight:`${x(2)} solid ${_}`,borderBottom:`${x(2)} solid ${_}`,background:`${v}`,boxSizing:`border-box`,position:`absolute`,right:x(2),bottom:x(2)}}),(0,Z.jsx)(`div`,{style:{position:`absolute`,right:x(-2),bottom:x(-2),width:x(p?2:1),height:x(p?2:1),background:p?`var(--sxl-color-primary)`:`var(--sxl-color-base-300)`}})]})}));Wg.displayName=`TopLeftCorner`;var Gg=/^(line|lineInv|straightConnector1|bentConnector\d|curvedConnector\d)$/,Kg=e=>Gg.test(e)?{type:hn.Type.Connector,geometry:e}:e===`rect`?{}:{geometry:e},$=(e,t)=>({key:e,label:t,json:Kg(e)}),qg=(e,t,n,r=!1)=>({key:e,label:n,json:{...Kg(t),stroke:r?{headType:xn.LineEndType.Triangle,tailType:xn.LineEndType.Triangle}:{tailType:xn.LineEndType.Triangle}}});C(`shape.category.lines`),$(`line`,C(`shape.preset.line`)),qg(`lineArrow`,`line`,C(`shape.preset.lineArrow`)),qg(`lineArrowDouble`,`line`,C(`shape.preset.lineArrowDouble`),!0),$(`bentConnector3`,C(`shape.preset.bentConnector3`)),qg(`bentConnector3Arrow`,`bentConnector3`,C(`shape.preset.bentConnector3Arrow`)),qg(`bentConnector3ArrowDouble`,`bentConnector3`,C(`shape.preset.bentConnector3ArrowDouble`),!0),$(`curvedConnector3`,C(`shape.preset.curvedConnector3`)),qg(`curvedConnector3Arrow`,`curvedConnector3`,C(`shape.preset.curvedConnector3Arrow`)),qg(`curvedConnector3ArrowDouble`,`curvedConnector3`,C(`shape.preset.curvedConnector3ArrowDouble`),!0),C(`shape.category.rectangles`),$(`rect`,C(`shape.preset.rect`)),$(`roundRect`,C(`shape.preset.roundRect`)),$(`snip1Rect`,C(`shape.preset.snip1Rect`)),$(`snip2SameRect`,C(`shape.preset.snip2SameRect`)),$(`snip2DiagRect`,C(`shape.preset.snip2DiagRect`)),$(`snipRoundRect`,C(`shape.preset.snipRoundRect`)),$(`round1Rect`,C(`shape.preset.round1Rect`)),$(`round2SameRect`,C(`shape.preset.round2SameRect`)),$(`round2DiagRect`,C(`shape.preset.round2DiagRect`)),C(`shape.category.basic`),$(`ellipse`,C(`shape.preset.ellipse`)),$(`triangle`,C(`shape.preset.triangle`)),$(`rtTriangle`,C(`shape.preset.rtTriangle`)),$(`parallelogram`,C(`shape.preset.parallelogram`)),$(`trapezoid`,C(`shape.preset.trapezoid`)),$(`diamond`,C(`shape.preset.diamond`)),$(`pentagon`,C(`shape.preset.pentagon`)),$(`hexagon`,C(`shape.preset.hexagon`)),$(`heptagon`,C(`shape.preset.heptagon`)),$(`octagon`,C(`shape.preset.octagon`)),$(`decagon`,C(`shape.preset.decagon`)),$(`dodecagon`,C(`shape.preset.dodecagon`)),$(`pie`,C(`shape.preset.pie`)),$(`chord`,C(`shape.preset.chord`)),$(`teardrop`,C(`shape.preset.teardrop`)),$(`frame`,C(`shape.preset.frame`)),$(`halfFrame`,C(`shape.preset.halfFrame`)),$(`corner`,C(`shape.preset.corner`)),$(`diagStripe`,C(`shape.preset.diagStripe`)),$(`plus`,C(`shape.preset.plus`)),$(`plaque`,C(`shape.preset.plaque`)),$(`can`,C(`shape.preset.can`)),$(`cube`,C(`shape.preset.cube`)),$(`bevel`,C(`shape.preset.bevel`)),$(`donut`,C(`shape.preset.donut`)),$(`noSmoking`,C(`shape.preset.noSmoking`)),$(`blockArc`,C(`shape.preset.blockArc`)),$(`foldedCorner`,C(`shape.preset.foldedCorner`)),$(`smileyFace`,C(`shape.preset.smileyFace`)),$(`heart`,C(`shape.preset.heart`)),$(`lightningBolt`,C(`shape.preset.lightningBolt`)),$(`sun`,C(`shape.preset.sun`)),$(`moon`,C(`shape.preset.moon`)),$(`cloud`,C(`shape.preset.cloud`)),$(`arc`,C(`shape.preset.arc`)),$(`bracketPair`,C(`shape.preset.bracketPair`)),$(`bracePair`,C(`shape.preset.bracePair`)),$(`leftBracket`,C(`shape.preset.leftBracket`)),$(`rightBracket`,C(`shape.preset.rightBracket`)),$(`leftBrace`,C(`shape.preset.leftBrace`)),$(`rightBrace`,C(`shape.preset.rightBrace`)),C(`shape.category.blockArrows`),$(`rightArrow`,C(`shape.preset.rightArrow`)),$(`leftArrow`,C(`shape.preset.leftArrow`)),$(`upArrow`,C(`shape.preset.upArrow`)),$(`downArrow`,C(`shape.preset.downArrow`)),$(`leftRightArrow`,C(`shape.preset.leftRightArrow`)),$(`upDownArrow`,C(`shape.preset.upDownArrow`)),$(`quadArrow`,C(`shape.preset.quadArrow`)),$(`leftRightUpArrow`,C(`shape.preset.leftRightUpArrow`)),$(`bentArrow`,C(`shape.preset.bentArrow`)),$(`uturnArrow`,C(`shape.preset.uturnArrow`)),$(`leftUpArrow`,C(`shape.preset.leftUpArrow`)),$(`bentUpArrow`,C(`shape.preset.bentUpArrow`)),$(`curvedRightArrow`,C(`shape.preset.curvedRightArrow`)),$(`curvedLeftArrow`,C(`shape.preset.curvedLeftArrow`)),$(`curvedUpArrow`,C(`shape.preset.curvedUpArrow`)),$(`curvedDownArrow`,C(`shape.preset.curvedDownArrow`)),$(`stripedRightArrow`,C(`shape.preset.stripedRightArrow`)),$(`notchedRightArrow`,C(`shape.preset.notchedRightArrow`)),$(`homePlate`,C(`shape.preset.homePlate`)),$(`chevron`,C(`shape.preset.chevron`)),$(`rightArrowCallout`,C(`shape.preset.rightArrowCallout`)),$(`downArrowCallout`,C(`shape.preset.downArrowCallout`)),$(`leftArrowCallout`,C(`shape.preset.leftArrowCallout`)),$(`upArrowCallout`,C(`shape.preset.upArrowCallout`)),$(`leftRightArrowCallout`,C(`shape.preset.leftRightArrowCallout`)),$(`quadArrowCallout`,C(`shape.preset.quadArrowCallout`)),$(`circularArrow`,C(`shape.preset.circularArrow`)),C(`shape.category.equation`),$(`mathPlus`,C(`shape.preset.mathPlus`)),$(`mathMinus`,C(`shape.preset.mathMinus`)),$(`mathMultiply`,C(`shape.preset.mathMultiply`)),$(`mathDivide`,C(`shape.preset.mathDivide`)),$(`mathEqual`,C(`shape.preset.mathEqual`)),$(`mathNotEqual`,C(`shape.preset.mathNotEqual`)),C(`shape.category.flowchart`),$(`flowChartProcess`,C(`shape.preset.flowChartProcess`)),$(`flowChartAlternateProcess`,C(`shape.preset.flowChartAlternateProcess`)),$(`flowChartDecision`,C(`shape.preset.flowChartDecision`)),$(`flowChartInputOutput`,C(`shape.preset.flowChartInputOutput`)),$(`flowChartPredefinedProcess`,C(`shape.preset.flowChartPredefinedProcess`)),$(`flowChartInternalStorage`,C(`shape.preset.flowChartInternalStorage`)),$(`flowChartDocument`,C(`shape.preset.flowChartDocument`)),$(`flowChartMultidocument`,C(`shape.preset.flowChartMultidocument`)),$(`flowChartTerminator`,C(`shape.preset.flowChartTerminator`)),$(`flowChartPreparation`,C(`shape.preset.flowChartPreparation`)),$(`flowChartManualInput`,C(`shape.preset.flowChartManualInput`)),$(`flowChartManualOperation`,C(`shape.preset.flowChartManualOperation`)),$(`flowChartConnector`,C(`shape.preset.flowChartConnector`)),$(`flowChartOffpageConnector`,C(`shape.preset.flowChartOffpageConnector`)),$(`flowChartPunchedCard`,C(`shape.preset.flowChartPunchedCard`)),$(`flowChartPunchedTape`,C(`shape.preset.flowChartPunchedTape`)),$(`flowChartSummingJunction`,C(`shape.preset.flowChartSummingJunction`)),$(`flowChartOr`,C(`shape.preset.flowChartOr`)),$(`flowChartCollate`,C(`shape.preset.flowChartCollate`)),$(`flowChartSort`,C(`shape.preset.flowChartSort`)),$(`flowChartExtract`,C(`shape.preset.flowChartExtract`)),$(`flowChartMerge`,C(`shape.preset.flowChartMerge`)),$(`flowChartOnlineStorage`,C(`shape.preset.flowChartOnlineStorage`)),$(`flowChartDelay`,C(`shape.preset.flowChartDelay`)),$(`flowChartMagneticTape`,C(`shape.preset.flowChartMagneticTape`)),$(`flowChartMagneticDisk`,C(`shape.preset.flowChartMagneticDisk`)),$(`flowChartMagneticDrum`,C(`shape.preset.flowChartMagneticDrum`)),$(`flowChartDisplay`,C(`shape.preset.flowChartDisplay`)),C(`shape.category.starsBanners`),$(`irregularSeal1`,C(`shape.preset.irregularSeal1`)),$(`irregularSeal2`,C(`shape.preset.irregularSeal2`)),$(`star4`,C(`shape.preset.star4`)),$(`star5`,C(`shape.preset.star5`)),$(`star6`,C(`shape.preset.star6`)),$(`star7`,C(`shape.preset.star7`)),$(`star8`,C(`shape.preset.star8`)),$(`star10`,C(`shape.preset.star10`)),$(`star12`,C(`shape.preset.star12`)),$(`star16`,C(`shape.preset.star16`)),$(`star24`,C(`shape.preset.star24`)),$(`star32`,C(`shape.preset.star32`)),$(`ribbon2`,C(`shape.preset.ribbon2`)),$(`ribbon`,C(`shape.preset.ribbon`)),$(`ellipseRibbon2`,C(`shape.preset.ellipseRibbon2`)),$(`ellipseRibbon`,C(`shape.preset.ellipseRibbon`)),$(`verticalScroll`,C(`shape.preset.verticalScroll`)),$(`horizontalScroll`,C(`shape.preset.horizontalScroll`)),$(`wave`,C(`shape.preset.wave`)),$(`doubleWave`,C(`shape.preset.doubleWave`)),C(`shape.category.callouts`),$(`wedgeRectCallout`,C(`shape.preset.wedgeRectCallout`)),$(`wedgeRoundRectCallout`,C(`shape.preset.wedgeRoundRectCallout`)),$(`wedgeEllipseCallout`,C(`shape.preset.wedgeEllipseCallout`)),$(`cloudCallout`,C(`shape.preset.cloudCallout`)),$(`borderCallout1`,C(`shape.preset.borderCallout1`)),$(`borderCallout2`,C(`shape.preset.borderCallout2`)),$(`borderCallout3`,C(`shape.preset.borderCallout3`)),$(`accentCallout1`,C(`shape.preset.accentCallout1`)),$(`accentCallout2`,C(`shape.preset.accentCallout2`)),$(`accentCallout3`,C(`shape.preset.accentCallout3`)),$(`callout1`,C(`shape.preset.callout1`)),$(`callout2`,C(`shape.preset.callout2`)),$(`callout3`,C(`shape.preset.callout3`)),$(`accentBorderCallout1`,C(`shape.preset.accentBorderCallout1`)),$(`accentBorderCallout2`,C(`shape.preset.accentBorderCallout2`)),$(`accentBorderCallout3`,C(`shape.preset.accentBorderCallout3`)),C(`shape.category.more`),$(`chartPlus`,C(`shape.preset.chartPlus`)),$(`chartStar`,C(`shape.preset.chartStar`)),$(`chartX`,C(`shape.preset.chartX`)),$(`cornerTabs`,C(`shape.preset.cornerTabs`)),$(`squareTabs`,C(`shape.preset.squareTabs`)),$(`plaqueTabs`,C(`shape.preset.plaqueTabs`)),$(`funnel`,C(`shape.preset.funnel`)),$(`gear6`,C(`shape.preset.gear6`)),$(`gear9`,C(`shape.preset.gear9`)),$(`leftCircularArrow`,C(`shape.preset.leftCircularArrow`)),$(`leftRightCircularArrow`,C(`shape.preset.leftRightCircularArrow`)),$(`swooshArrow`,C(`shape.preset.swooshArrow`)),$(`leftRightRibbon`,C(`shape.preset.leftRightRibbon`)),$(`nonIsoscelesTrapezoid`,C(`shape.preset.nonIsoscelesTrapezoid`)),$(`pieWedge`,C(`shape.preset.pieWedge`)),$(`upDownArrowCallout`,C(`shape.preset.upDownArrowCallout`)),$(`flowChartOfflineStorage`,C(`shape.preset.flowChartOfflineStorage`)),$(`actionButtonBlank`,C(`shape.preset.actionButtonBlank`)),$(`actionButtonHome`,C(`shape.preset.actionButtonHome`)),$(`actionButtonHelp`,C(`shape.preset.actionButtonHelp`)),$(`actionButtonInformation`,C(`shape.preset.actionButtonInformation`)),$(`actionButtonBackPrevious`,C(`shape.preset.actionButtonBackPrevious`)),$(`actionButtonForwardNext`,C(`shape.preset.actionButtonForwardNext`)),$(`actionButtonBeginning`,C(`shape.preset.actionButtonBeginning`)),$(`actionButtonEnd`,C(`shape.preset.actionButtonEnd`)),$(`actionButtonReturn`,C(`shape.preset.actionButtonReturn`)),$(`actionButtonDocument`,C(`shape.preset.actionButtonDocument`)),$(`actionButtonSound`,C(`shape.preset.actionButtonSound`)),$(`actionButtonMovie`,C(`shape.preset.actionButtonMovie`));var Jg=e=>{let t=e.getRange().getCoords();return{rowIndex:t.rowStart,colIndex:t.colStart}},Yg=(e,t)=>{let n=e.getRange().getCoords(),r=t.getRange().getCoords();return n.rowStart-r.rowStart||n.colStart-r.colStart},Xg=86400;7*Xg,30*Xg,7*Xg,365*Xg,30*Xg,365*Xg;var Zg=(e,t)=>e?.canActivate(t)?[]:[C(`reason.noTaskPane`)],Qg=class{constructor(e){this._snapshot=null,this._listeners=new Set,this._removeSheetListener=null,this._queue=Promise.resolve(),this._pivot=e}getPivotTable(){return this._pivot}getSnapshot(){return this._removeSheetListener?this._snapshot??=n_(this._pivot):n_(this._pivot)}subscribe(e){return this._listeners.add(e),this._removeSheetListener||=this._pivot.getWorksheet().addListeners({onPivotTablesChange:()=>this._changed()}),()=>{this._listeners.delete(e),this._listeners.size===0&&this._stopListening()}}close(){this._listeners.clear(),this._stopListening()}tick(e){return this._run(async()=>{let t=this._field(this._pivot,e);t_(this._pivot,t)||(t.getDataType()===`number`?await this._pivot.addDataField(t):await t.setAxis(`row`))})}untick(e){return this._run(()=>this._batch(C(`op.movePivotField`),async t=>{let n=this._field(t,e);await n.setAxis(null);for(let e of e_(t,n))await e.delete()}))}place(e,t,n){let r=n===void 0?void 0:n+1;return this._run(async()=>{if(e.kind===`values`){let e=this._pivot.getValuesField();if(!e||t===`page`||t===`values`)return;e.getAxis()===t&&r!==void 0?await e.setPosition(r):await e.setAxis(t,r)}else if(e.kind===`data`){let n=this._data(this._pivot,e.name);if(t===`values`)return void(r!==void 0&&await n.setPosition(r));let i=n.getField().getName();await this._batch(C(`op.movePivotField`),async n=>{await this._data(n,e.name).delete(),await this._toAxis(this._field(n,i),t,r)})}else t===`values`?await this._batch(C(`op.addPivotDataField`),async t=>{let n=await t.addDataField(this._field(t,e.name));r!==void 0&&await n.setPosition(r)}):await this._toAxis(this._field(this._pivot,e.name),t,r)})}remove(e){return this._run(async()=>{e.kind===`values`?await this._pivot.getValuesField()?.setAxis(null):e.kind===`data`?await this._data(this._pivot,e.name).delete():await this._field(this._pivot,e.name).setAxis(null)})}setFunction(e,t){return this._run(()=>this._data(this._pivot,e).setFunction(t))}applyValueSettings(e,t){return this._run(()=>this._batch(C(`op.pivotValueSettings`),async n=>{let r=this._data(n,e);t.function!==void 0&&await r.setFunction(t.function),t.showAs!==void 0&&await r.setShowAs(t.showAs),t.numberFormat!==void 0&&await r.setNumberFormat(t.numberFormat),t.name!==void 0&&await r.setName(t.name)}))}rename(e,t){return this._run(async()=>{e.kind===`values`?await this._pivot.getValuesField()?.setName(t):e.kind===`data`?await this._data(this._pivot,e.name).setName(t):await this._field(this._pivot,e.name).setName(t)})}async _toAxis(e,t,n){e.getAxis()===t?n!==void 0&&await e.setPosition(n):await e.setAxis(t,n)}_field(e,t){let n=e.getField(t);if(!n)throw Error(`'${t}' is not a field of this PivotTable.`);return n}_data(e,t){let n=e.getDataField(t);if(!n)throw Error(`'${t}' is not a value of this PivotTable.`);return n}_run(e){let t=this._queue.then(e);return this._queue=t.catch(()=>{}),t}async _batch(e,t){let n=this._pivot.getWorksheet().getName(),r=this._pivot.getName(),i=this._pivot.getWorksheet().getWorkbook();if(!i)throw Error(`The PivotTable '${r}' is gone.`);await i.doBatch(async(e,i)=>{let a=i.getWorksheets().getByName(n)?.getPivotTables().getByName(r);if(!a)throw Error(`The PivotTable '${r}' is gone.`);await t(a)},{description:e})}_changed(){this._snapshot=null;for(let e of[...this._listeners])e()}_stopListening(){this._removeSheetListener?.(),this._removeSheetListener=null,this._snapshot=null}},$g={row:[],column:[],page:[],values:[]},e_=(e,t)=>e.getDataFields().filter(e=>e.getField().getName()===t.getName()),t_=(e,t)=>t.getAxis()!==null||e_(e,t).length>0,n_=e=>{if(e.isDeleted())return{deleted:!0,name:e.getName(),source:null,location:null,fields:[],areas:$g};let t=new Set(e.getDataFields().map(e=>e.getField().getName())),n=e.getFields().map(e=>({name:e.getName(),dataType:e.getDataType(),ticked:e.getAxis()!==null||t.has(e.getName()),axis:e.getAxis(),filtered:e.isFiltered()})),r=e=>({kind:`field`,name:e.getName(),filtered:e.isFiltered()}),i=(t,n)=>{let i=n.map(r),a=e.getValuesField(),o=a?.getAxis()===t?a.getPosition():null;return a&&o!==null&&i.splice(o-1,0,{kind:`values`,name:a.getName()}),i};return{deleted:!1,name:e.getName(),source:e.getSource(),location:e.getRange().getA1(),fields:n,areas:{row:i(`row`,e.getRowFields()),column:i(`column`,e.getColumnFields()),page:e.getPageFields().map(r),values:e.getDataFields().map(e=>({kind:`data`,name:e.getName(),field:e.getField().getName(),function:e.getFunction()}))}}};function r_(e){let t=(0,X.useMemo)(()=>e?i_(new Qg(e)):null,[e]),n=(0,X.useSyncExternalStore)(t?.subscribe??a_,t?.getVersion??o_),r=(0,X.useMemo)(()=>t?.model.getSnapshot()??null,[t,n]);return t&&r?{model:t.model,snapshot:r}:null}var i_=e=>{let t=0;return{model:e,subscribe:n=>e.subscribe(()=>{t++,n()}),getVersion:()=>t}},a_=()=>()=>{},o_=()=>0,s_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function c_(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function l_(e){return`nodeType`in e}function u_(e){var t;return e?c_(e)?e:l_(e)&&(t=e.ownerDocument?.defaultView)!=null?t:window:window}function d_(e){let{Document:t}=u_(e);return e instanceof t}function f_(e){return!c_(e)&&e instanceof u_(e).HTMLElement}function p_(e){return e instanceof u_(e).SVGElement}function m_(e){return e?c_(e)?e.document:l_(e)?d_(e)?e:f_(e)||p_(e)?e.ownerDocument:document:document:document}var h_=s_?X.useLayoutEffect:X.useEffect;function g_(e){let t=(0,X.useRef)(e);return h_(()=>{t.current=e}),(0,X.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function __(e,t){t===void 0&&(t=[e]);let n=(0,X.useRef)(e);return h_(()=>{n.current!==e&&(n.current=e)},t),n}function v_(e,t){let n=(0,X.useRef)();return(0,X.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function y_(e){let t=g_(e),n=(0,X.useRef)(null);return[n,(0,X.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function b_(e){let t=(0,X.useRef)();return(0,X.useEffect)(()=>{t.current=e},[e]),t.current}var x_={};function S_(e,t){return(0,X.useMemo)(()=>{if(t)return t;let n=x_[e]==null?0:x_[e]+1;return x_[e]=n,e+`-`+n},[e,t])}function C_(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var w_=C_(1),T_=C_(-1);function E_(e){if(!e)return!1;let{KeyboardEvent:t}=u_(e.target);return t&&e instanceof t}function D_(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=u_(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return`clientX`in e&&`clientY`in e}(e)?{x:e.clientX,y:e.clientY}:null}var O_=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[O_.Translate.toString(e),O_.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),k_=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function A_(e){return e.matches(k_)?e:e.querySelector(k_)}var j_={display:`none`};function M_(e){let{id:t,value:n}=e;return X.createElement(`div`,{id:t,style:j_},n)}function N_(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return X.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}var P_=(0,X.createContext)(null),F_,I_={draggable:`
42
+ To pick up a draggable item, press the space bar.
43
+ While dragging, use the arrow keys to move the item.
44
+ Press space again to drop the item in its new position, or press escape to cancel.
45
+ `},L_={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function R_(e){let{announcements:t=L_,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=I_}=e,{announce:a,announcement:o}=function(){let[e,t]=(0,X.useState)(``);return{announce:(0,X.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}(),s=S_(`DndLiveRegion`),[c,l]=(0,X.useState)(!1);if((0,X.useEffect)(()=>{l(!0)},[]),function(e){let t=(0,X.useContext)(P_);(0,X.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}((0,X.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=X.createElement(X.Fragment,null,X.createElement(M_,{id:r,value:i.draggable}),X.createElement(N_,{id:s,announcement:o}));return n?(0,fr.createPortal)(u,n):u}function z_(){}function B_(e,t){return(0,X.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function V_(){var e=[...arguments];return(0,X.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(F_||={});var H_=Object.freeze({x:0,y:0});function U_(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function W_(e,t){let n=D_(e);return n?(n.x-t.left)/t.width*100+`% `+(n.y-t.top)/t.height*100+`%`:`0 0`}function G_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function K_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function q_(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function J_(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Y_(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}var X_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Y_(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=U_(Y_(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(G_)};function Z_(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s;return Number((i/(n+r-i)).toFixed(4))}return 0}var Q_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Z_(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(K_)};function $_(e,t){let{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}function ev(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:H_}function tv(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var nv=tv(1);function rv(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var iv,av={ignoreTransform:!1};function ov(e,t){t===void 0&&(t=av);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=u_(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=rv(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function sv(e){return ov(e,{ignoreTransform:!0})}function cv(e,t){let n=[];return e?function r(i){if(t!=null&&n.length>=t||!i)return n;if(d_(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!f_(i)||p_(i)||n.includes(i))return n;let a=u_(e).getComputedStyle(i);return i!==e&&function(e,t){t===void 0&&(t=u_(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}(i,a)&&n.push(i),function(e,t){return t===void 0&&(t=u_(e).getComputedStyle(e)),t.position===`fixed`}(i,a)?n:r(i.parentNode)}(e):n}function lv(e){let[t]=cv(e,1);return t??null}function uv(e){return s_&&e?c_(e)?e:l_(e)?d_(e)||e===m_(e).scrollingElement?window:f_(e)?e:null:null:null}function dv(e){return c_(e)?e.scrollX:e.scrollLeft}function fv(e){return c_(e)?e.scrollY:e.scrollTop}function pv(e){return{x:dv(e),y:fv(e)}}function mv(e){return!(!s_||!e)&&e===document.scrollingElement}function hv(e){let t={x:0,y:0},n=mv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(iv||={});var gv={x:.2,y:.2};function _v(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=gv);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=hv(e),p={x:0,y:0},m={x:0,y:0},h=t.height*i.y,g=t.width*i.x;return!l&&a<=t.top+h?(p.y=iv.Backward,m.y=r*Math.abs((t.top+h-a)/h)):!u&&c>=t.bottom-h&&(p.y=iv.Forward,m.y=r*Math.abs((t.bottom-h-c)/h)),!f&&s>=t.right-g?(p.x=iv.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!d&&o<=t.left+g&&(p.x=iv.Backward,m.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:m}}function vv(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function yv(e){return e.reduce((e,t)=>w_(e,pv(t)),H_)}function bv(e,t){if(t===void 0&&(t=ov),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);lv(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var xv,Sv,Cv=[[`x`,[`left`,`right`],function(e){return e.reduce((e,t)=>e+dv(t),0)}],[`y`,[`top`,`bottom`],function(e){return e.reduce((e,t)=>e+fv(t),0)}]],wv=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=cv(t),r=yv(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Cv)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Tv=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Ev(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}function Dv(e){e.preventDefault()}function Ov(e){e.stopPropagation()}(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(xv||={}),function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`}(Sv||={});var kv={start:[Sv.Space,Sv.Enter],cancel:[Sv.Esc],end:[Sv.Space,Sv.Enter,Sv.Tab]},Av=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Sv.Right:return{...n,x:n.x+25};case Sv.Left:return{...n,x:n.x-25};case Sv.Down:return{...n,y:n.y+25};case Sv.Up:return{...n,y:n.y-25}}},jv=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Tv(m_(t)),this.windowListeners=new Tv(u_(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xv.Resize,this.handleCancel),this.windowListeners.add(xv.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xv.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&bv(n),t(H_)}handleKeyDown(e){if(E_(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=kv,coordinateGetter:a=Av,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:H_;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=T_(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=hv(n),p=vv(n),m={x:Math.min(i===Sv.Right?p.right-p.width/2:p.right,Math.max(i===Sv.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Sv.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Sv.Down?p.top:p.top+p.height/2,u.y))},h=i===Sv.Right&&!s||i===Sv.Left&&!c,g=i===Sv.Down&&!l||i===Sv.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Sv.Right&&e<=d.x||i===Sv.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=a?n.scrollLeft-e:i===Sv.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Sv.Down&&e<=d.y||i===Sv.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=a?n.scrollTop-e:i===Sv.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,w_(T_(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};function Mv(e){return!!(e&&`distance`in e)}function Nv(e){return!!(e&&`delay`in e)}jv.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=kv,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];var Pv=class{constructor(e,t,n){n===void 0&&(n=function(e){let{EventTarget:t}=u_(e);return e instanceof t?e:m_(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=m_(i),this.documentListeners=new Tv(this.document),this.listeners=new Tv(n),this.windowListeners=new Tv(u_(i)),this.initialCoordinates=D_(r)??H_,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(xv.Resize,this.handleCancel),this.windowListeners.add(xv.DragStart,Dv),this.windowListeners.add(xv.VisibilityChange,this.handleCancel),this.windowListeners.add(xv.ContextMenu,Dv),this.documentListeners.add(xv.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Nv(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Mv(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(xv.Click,Ov,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xv.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=D_(e)??H_,s=T_(n,o);if(!t&&a){if(Mv(a)){if(a.tolerance!=null&&Ev(s,a.tolerance))return this.handleCancel();if(Ev(s,a.distance))return this.handleStart()}return Nv(a)&&Ev(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Sv.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Fv={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Iv=class extends Pv{constructor(e){let{event:t}=e,n=m_(t.target);super(e,Fv,n)}};Iv.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||n.button!==0)&&(r?.({event:n}),!0)}}];var Lv,Rv={move:{name:`mousemove`},end:{name:`mouseup`}};(function(e){e[e.RightClick=2]=`RightClick`})(Lv||={});var zv=class extends Pv{constructor(e){super(e,Rv,m_(e.event.target))}};zv.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Lv.RightClick&&(r?.({event:n}),!0)}}];var Bv,Vv,Hv={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Uv=class extends Pv{constructor(e){super(e,Hv)}static setup(){return window.addEventListener(Hv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Hv.move.name,e)};function e(){}}};function Wv(e){let{acceleration:t,activator:n=Bv.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Vv.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=function(e){let{delta:t,disabled:n}=e,r=b_(t);return v_(e=>{if(n||!r||!e)return qv;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[iv.Backward]:e.x[iv.Backward]||i.x===-1,[iv.Forward]:e.x[iv.Forward]||i.x===1},y:{[iv.Backward]:e.y[iv.Backward]||i.y===-1,[iv.Forward]:e.y[iv.Forward]||i.y===1}}},[n,t,r])}({delta:d,disabled:!a}),[m,h]=function(){let e=(0,X.useRef)(null);return[(0,X.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,X.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}(),g=(0,X.useRef)({x:0,y:0}),_=(0,X.useRef)({x:0,y:0}),v=(0,X.useMemo)(()=>{switch(n){case Bv.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Bv.DraggableRect:return i}},[n,i,c]),y=(0,X.useRef)(null),b=(0,X.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,X.useMemo)(()=>s===Vv.TreeOrder?[...l].reverse():l,[s,l]);(0,X.useEffect)(()=>{if(a&&l.length&&v){for(let e of x){if(!1===r?.(e))continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=_v(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0)return h(),y.current=e,m(b,o),g.current=s,void(_.current=a)}g.current={x:0,y:0},_.current={x:0,y:0},h()}else h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}Uv.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return!(i.length>1)&&(r?.({event:n}),!0)}}],function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`}(Bv||={}),function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`}(Vv||={});var Gv,Kv,qv={x:{[iv.Backward]:!1,[iv.Forward]:!1},y:{[iv.Backward]:!1,[iv.Forward]:!1}};(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Gv||={}),function(e){e.Optimized=`optimized`}(Kv||={});var Jv=new Map;function Yv(e,t){return v_(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Xv(e){let{callback:t,disabled:n}=e,r=g_(t),i=(0,X.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,X.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Zv(e){return new wv(ov(e),e)}function Qv(e,t,n){t===void 0&&(t=Zv);let[r,i]=(0,X.useState)(null);function a(){i(r=>{if(!e)return null;if(!1===e.isConnected)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=function(e){let{callback:t,disabled:n}=e,r=g_(t),i=(0,X.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,X.useEffect)(()=>()=>i?.disconnect(),[i]),i}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Xv({callback:a});return h_(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}var $v=[];function ey(e,t){t===void 0&&(t=[]);let n=(0,X.useRef)(null);return(0,X.useEffect)(()=>{n.current=null},t),(0,X.useEffect)(()=>{let t=e!==H_;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?T_(e,n.current):H_}function ty(e){return(0,X.useMemo)(()=>e?function(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}var ny=[];function ry(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return f_(t)?t:e}var iy=[{sensor:Iv,options:{}},{sensor:jv,options:{}}],ay={current:{}},oy={draggable:{measure:sv},droppable:{measure:sv,strategy:Gv.WhileDragging,frequency:Kv.Optimized},dragOverlay:{measure:ov}},sy=class extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},cy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sy,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:z_},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oy,measureDroppableContainers:z_,windowRect:null,measuringScheduled:!1},ly={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:z_,draggableNodes:new Map,over:null,measureDroppableContainers:z_},uy=(0,X.createContext)(ly),dy=(0,X.createContext)(cy);function fy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sy}}}function py(e,t){switch(t.type){case F_.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case F_.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case F_.DragEnd:case F_.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case F_.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new sy(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case F_.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new sy(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case F_.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new sy(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function my(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,X.useContext)(uy),a=b_(r),o=b_(n?.id);return(0,X.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!E_(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=A_(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function hy(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}var gy,_y=(0,X.createContext)({...H_,scaleX:1,scaleY:1});(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(gy||={});var vy=(0,X.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=iy,collisionDetection:o=Q_,measuring:s,modifiers:c,...l}=e,[u,d]=(0,X.useReducer)(py,void 0,fy),[f,p]=function(){let[e]=(0,X.useState)(()=>new Set),t=(0,X.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,X.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}(),[m,h]=(0,X.useState)(gy.Uninitialized),g=m===gy.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,X.useRef)({initial:null,translated:null}),C=(0,X.useMemo)(()=>_==null?null:{id:_,data:x?.data??ay,rect:S},[_,x]),w=(0,X.useRef)(null),[T,E]=(0,X.useState)(null),[D,O]=(0,X.useState)(null),k=__(l,Object.values(l)),A=S_(`DndDescribedBy`,t),j=(0,X.useMemo)(()=>b.getEnabled(),[b]),M=(0,X.useMemo)(()=>({draggable:{...oy.draggable,...N?.draggable},droppable:{...oy.droppable,...N?.droppable},dragOverlay:{...oy.dragOverlay,...N?.dragOverlay}}),[(N=s)?.draggable,N?.droppable,N?.dragOverlay]);var N;let{droppableRects:P,measureDroppableContainers:F,measuringScheduled:I}=function(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,X.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,X.useRef)(e),d=function(){switch(l){case Gv.Always:return!1;case Gv.BeforeDragging:return n;default:return!n}}(),f=__(d),p=(0,X.useCallback)(function(e){e===void 0&&(e=[]),f.current||o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,X.useRef)(null),h=v_(t=>{if(d&&!n)return Jv;if(!t||t===Jv||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new wv(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,X.useEffect)(()=>{u.current=e},[e]),(0,X.useEffect)(()=>{d||p()},[n,d]),(0,X.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,X.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null}}(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),L=function(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return v_(e=>t==null?null:r??e??null,[r,t])}(v,_),R=(0,X.useMemo)(()=>D?D_(D):null,[D]),ee=function(){let e=!1===T?.autoScrollEnabled,t=typeof r==`object`?!1===r.enabled:!1===r,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}(),te=function(e,t){return Yv(e,t)}(L,M.draggable.measure);(function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,X.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;h_(()=>{if(!o&&!s||!t)return void(a.current=!1);if(a.current||!r)return;let e=t?.node.current;if(!e||!1===e.isConnected)return;let i=ev(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=lv(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])})({activeNode:_==null?null:v.get(_),config:ee.layoutShiftCompensation,initialRect:te,measure:M.draggable.measure});let z=Qv(L,M.draggable.measure,te),B=Qv(L?L.parentElement:null),V=(0,X.useRef)({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),H=b.getNodeFor(V.current.over?.id),ne=function(e){let{measure:t}=e,[n,r]=(0,X.useState)(null),i=Xv({callback:(0,X.useCallback)(e=>{for(let{target:n}of e)if(f_(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=y_((0,X.useCallback)(e=>{let n=ry(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,X.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}({measure:M.dragOverlay.measure}),U=ne.nodeRef.current??L,W=g?ne.rect??z:null,re=!!(ne.nodeRef.current&&ne.rect),ie=ev(ae=re?null:z,Yv(ae));var ae;let G=ty(U?u_(U):null),oe=function(e){let t=(0,X.useRef)(e),n=v_(n=>e?n&&n!==$v&&e&&t.current&&e.parentNode===t.current.parentNode?n:cv(e):$v,[e]);return(0,X.useEffect)(()=>{t.current=e},[e]),n}(g?H??L:null),se=function(e,t){t===void 0&&(t=ov);let[n]=e,r=ty(n?u_(n):null),[i,a]=(0,X.useState)(ny);function o(){a(()=>e.length?e.map(e=>mv(e)?r:new wv(t(e),e)):ny)}let s=Xv({callback:o});return h_(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}(oe),ce=hy(c,{transform:{x:y.x-ie.x,y:y.y-ie.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:z,containerNodeRect:B,draggingNodeRect:W,over:V.current.over,overlayNodeRect:ne.rect,scrollableAncestors:oe,scrollableAncestorRects:se,windowRect:G}),le=R?w_(R,y):null,ue=function(e){let[t,n]=(0,X.useState)(null),r=(0,X.useRef)(e),i=(0,X.useCallback)(e=>{let t=uv(e.target);t&&n(e=>e?(e.set(t,pv(t)),new Map(e)):null)},[]);return(0,X.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=uv(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,pv(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{uv(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,X.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>w_(e,t),H_):yv(e):H_,[e,t])}(oe),de=ey(ue),fe=ey(ue,[z]),pe=w_(ce,de),me=W?nv(W,ce):null,he=C&&me?o({active:C,collisionRect:me,droppableRects:P,droppableContainers:j,pointerCoordinates:le}):null,ge=J_(he,`id`),[_e,ve]=(0,X.useState)(null),ye=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(re?ce:w_(ce,fe),_e?.rect??null,z),be=(0,X.useRef)(null),xe=(0,X.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:V,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,fr.unstable_batchedUpdates)(()=>{r?.(i),h(gy.Initializing),d({type:F_.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(be.current),O(a)})},onMove(e){d({type:F_.DragMove,coordinates:e})},onEnd:s(F_.DragEnd),onCancel:s(F_.DragCancel)});function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=V.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===F_.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=F_.DragCancel)}w.current=null,(0,fr.unstable_batchedUpdates)(()=>{d({type:e}),h(gy.Uninitialized),ve(null),E(null),O(null),be.current=null;let t=e===F_.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}be.current=o},[v]),Se=function(e,t){return(0,X.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(a,(0,X.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};!0===e(n,t.options,o)&&(i.dndKit={capturedBy:t.sensor},w.current=r,xe(n,t))},[v,xe]));(function(e){(0,X.useEffect)(()=>{if(!s_)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))})(a),h_(()=>{z&&m===gy.Initializing&&h(gy.Initialized)},[z,m]),(0,X.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=V.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:pe.x,y:pe.y},over:i};(0,fr.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[pe.x,pe.y]),(0,X.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=V.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(ge),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,fr.unstable_batchedUpdates)(()=>{ve(s),a?.(c),f({type:`onDragOver`,event:c})})},[ge]),h_(()=>{V.current={activatorEvent:D,active:C,activeNode:L,collisionRect:me,collisions:he,droppableRects:P,draggableNodes:v,draggingNode:U,draggingNodeRect:W,droppableContainers:b,over:_e,scrollableAncestors:oe,scrollAdjustedTranslate:pe},S.current={initial:W,translated:me}},[C,L,he,me,v,U,W,P,b,_e,oe,pe]),Wv({...ee,delta:y,draggingRect:me,pointerCoordinates:le,scrollableAncestors:oe,scrollableAncestorRects:se});let Ce=(0,X.useMemo)(()=>({active:C,activeNode:L,activeNodeRect:z,activatorEvent:D,collisions:he,containerNodeRect:B,dragOverlay:ne,draggableNodes:v,droppableContainers:b,droppableRects:P,over:_e,measureDroppableContainers:F,scrollableAncestors:oe,scrollableAncestorRects:se,measuringConfiguration:M,measuringScheduled:I,windowRect:G}),[C,L,z,D,he,B,ne,v,b,P,_e,F,oe,se,M,I,G]),we=(0,X.useMemo)(()=>({activatorEvent:D,activators:Se,active:C,activeNodeRect:z,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:_e,measureDroppableContainers:F}),[D,Se,C,z,d,A,v,_e,F]);return X.createElement(P_.Provider,{value:p},X.createElement(uy.Provider,{value:we},X.createElement(dy.Provider,{value:Ce},X.createElement(_y.Provider,{value:ye},i)),X.createElement(my,{disabled:!1===n?.restoreFocus})),X.createElement(R_,{...n,hiddenTextDescribedById:A}))}),yy=(0,X.createContext)(null),by=`button`;function xy(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=S_(`Draggable`),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,X.useContext)(uy),{role:p=by,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,X.useContext)(g?_y:yy),[v,y]=y_(),[b,x]=y_(),S=function(e,t){return(0,X.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(o,t),C=__(n);return h_(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,X.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||p!==by)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Sy(){return(0,X.useContext)(dy)}var Cy={timeout:25};function wy(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=S_(`Droppable`),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,X.useContext)(uy),u=(0,X.useRef)({disabled:n}),d=(0,X.useRef)(!1),f=(0,X.useRef)(null),p=(0,X.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Cy,...i},_=__(h??r),v=Xv({callback:(0,X.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)):d.current=!0},[g]),disabled:m||!o}),[y,b]=y_((0,X.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=__(t);return(0,X.useEffect)(()=>{v&&y.current&&(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,X.useEffect)(()=>(s({type:F_.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:F_.UnregisterDroppable,key:a,id:r})),[r]),(0,X.useEffect)(()=>{n!==u.current.disabled&&(s({type:F_.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Ty(e){let{animation:t,children:n}=e,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null),s=b_(n);return n||r||!s||i(s),h_(()=>{if(!a)return;let e=r?.key,n=r?.props.id;e!=null&&n!=null?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,r,a]),X.createElement(X.Fragment,null,n,r?(0,X.cloneElement)(r,{ref:o}):null)}var Ey={x:0,y:0,scaleX:1,scaleY:1};function Dy(e){let{children:t}=e;return X.createElement(uy.Provider,{value:ly},X.createElement(_y.Provider,{value:Ey},t))}var Oy={position:`fixed`,touchAction:`none`},ky=e=>E_(e)?`transform 250ms ease`:void 0,Ay=(0,X.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=ky}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Oy,width:s.width,height:s.height,top:s.top,left:s.left,transform:O_.Transform.toString(d),transformOrigin:i&&r?W_(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return X.createElement(n,{className:o,style:f,ref:t},a)}),jy=e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}},My={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:O_.Transform.toString(t)},{transform:O_.Transform.toString(n)}]},sideEffects:jy({styles:{active:{opacity:`0`}}})};function Ny(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return g_((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=ry(a);if(!c)return;let{transform:l}=u_(a).getComputedStyle(a),u=rv(l);if(!u)return;let d=typeof t==`function`?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...My,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}(t);return bv(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}var Py=0;function Fy(e){return(0,X.useMemo)(()=>{if(e!=null)return++Py},[e])}var Iy=X.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=Sy(),S=(0,X.useContext)(_y),C=Fy(d?.id),w=hy(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=Yv(f),E=Ny({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return X.createElement(Dy,null,X.createElement(Ty,{animation:E},d&&C?X.createElement(Ay,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))});function Ly(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Ry(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function zy(e){return e!==null&&e>=0}var By={scaleX:1,scaleY:1},Vy=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r&&(i||a)?n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width):0}(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...By}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...By}:a<r&&a>=i?{x:o.width+s,y:0,...By}:{x:0,y:0,...By}},Hy=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Ly(t,r,n),o=t[i],s=a[i];return s&&o?{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}:null},Uy={scaleX:1,scaleY:1},Wy=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Uy}:null}let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Uy}:r<t&&r>=a?{x:0,y:o.height+s,...Uy}:{x:0,y:0,...Uy}},Gy=`Sortable`,Ky=X.createContext({activeIndex:-1,containerId:Gy,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Hy,disabled:{draggable:!1,droppable:!1}});function qy(e){let{children:t,id:n,items:r,strategy:i=Hy,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Sy(),d=S_(Gy,n),f=s.rect!==null,p=(0,X.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,X.useRef)(p),v=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(p,_.current),y=g!==-1&&h===-1||v,b=function(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}(a);h_(()=>{v&&m&&u(p)},[v,p,m,u]),(0,X.useEffect)(()=>{_.current=p},[p]);let x=(0,X.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Ry(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return X.createElement(Ky.Provider,{value:x},t)}var Jy=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Ly(n,r,i).indexOf(t)},Yy=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!(!l||!r)&&(s===a||i!==o)&&(!!n||o!==i&&t===c)},Xy={duration:200,easing:`ease`},Zy=`transform`,Qy=O_.Transition.toString({property:Zy,duration:0,easing:`linear`}),$y={roleDescription:`sortable`};function eb(e){let{animateLayoutChanges:t=Yy,attributes:n,disabled:r,data:i,getNewIndex:a=Jy,id:o,strategy:s,resizeObserverConfig:c,transition:l=Xy}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,X.useContext)(Ky),y=function(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}(r,p),b=u.indexOf(o),x=(0,X.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,X.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=wy({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=xy({id:o,data:x,attributes:{...$y,...n},disabled:y.draggable}),L=function(){var e=[...arguments];return(0,X.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}(E,j),R=!!D,ee=R&&!m&&zy(f)&&zy(g),te=!_&&N,z=ee?(te&&ee?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,B=zy(f)&&zy(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,V=D?.id,H=(0,X.useRef)({activeId:V,items:u,newIndex:B,containerId:d}),ne=u!==H.current.items,U=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:H.current.newIndex,previousItems:H.current.items,previousContainerId:H.current.containerId,transition:l,wasDragging:H.current.activeId!=null}),W=function(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,X.useState)(null),s=(0,X.useRef)(n);return h_(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ov(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,X.useEffect)(()=>{a&&o(null)},[a]),a}({disabled:!U,index:b,node:w,rect:C});return(0,X.useEffect)(()=>{R&&H.current.newIndex!==B&&(H.current.newIndex=B),d!==H.current.containerId&&(H.current.containerId=d),u!==H.current.items&&(H.current.items=u)},[R,B,d,u]),(0,X.useEffect)(()=>{if(V===H.current.activeId)return;if(V!=null&&H.current.activeId==null)return void(H.current.activeId=V);let e=setTimeout(()=>{H.current.activeId=V},50);return()=>clearTimeout(e)},[V]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:B,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:W??z,transition:function(){if(W||ne&&H.current.newIndex===b)return Qy;if(!(te&&!E_(O)||!l)&&(R||U))return O_.Transition.toString({...l,property:Zy})}()}}function tb(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var nb=[Sv.Down,Sv.Right,Sv.Up,Sv.Left],rb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(nb.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Sv.Down:r.top<a.top&&t.push(n);break;case Sv.Up:r.top>a.top&&t.push(n);break;case Sv.Left:r.left>a.left&&t.push(n);break;case Sv.Right:r.left<a.left&&t.push(n)}});let u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=q_(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=q_(r),o=i.reduce((e,t,r)=>e+U_(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(G_)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),d=J_(u,`id`);if(d===o?.id&&u.length>1&&(d=u[1].id),d!=null){let e=a.get(n.id),t=a.get(d),o=t?i.get(t.id):null,u=t?.node.current;if(u&&o&&e&&t){let n=cv(u).some((e,t)=>s[t]!==e),i=ib(e,t),a=(l=t,!(!tb(c=e)||!tb(l))&&!!ib(c,l)&&c.data.current.sortable.index<l.data.current.sortable.index),d=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},f={x:o.left,y:o.top};return d.x&&d.y?f:T_(f,d)}}}var c,l};function ib(e,t){return!(!tb(e)||!tb(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var ab=(0,X.createContext)(null),ob=()=>{let e=(0,X.useContext)(ab);if(!e)throw Error(`PivotFieldList and PivotAreas must be inside a PivotDragContext.`);return e},sb=`pivot-root`,cb=e=>`pivot-area|${e}`,lb=(e,t)=>`pivot-chip|${e}|${t.kind}|${t.name}`,ub=e=>`pivot-row|${e}`,db={number:C(`pivot.type.number`),date:C(`pivot.type.date`),text:C(`pivot.type.text`),mixed:C(`pivot.type.mixed`),blank:C(`pivot.type.blank`)},fb={number:`DataTypeNumber`,date:`DataTypeDate`,text:`DataTypeText`,mixed:`DataTypeMixed`,blank:`DataTypeBlank`},pb=e=>{let{className:t,...n}=e,{snapshot:r}=ob(),i=je(),[a,o]=(0,X.useState)(``),{setNodeRef:s}=wy({id:`pivot-list`,data:{list:!0}}),c=a.trim().toLocaleLowerCase(),l=c?r.fields.filter(e=>e.name.toLocaleLowerCase().includes(c)):r.fields;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`input`,{type:`search`,className:Zl,placeholder:i(`pivot.fields.search`),"aria-label":i(`pivot.fields.search`),value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(`div`,{ref:s,role:`group`,"aria-label":i(`pivot.fields.list`),className:Q(`sxl-pivot-field-list`,t,Ql),...n,children:[l.map(e=>(0,Z.jsx)(mb,{field:e},e.name)),l.length===0&&c?(0,Z.jsx)(`div`,{className:ru,children:i(`pivot.fields.none`)}):null]})]})},mb=e=>{let{field:t}=e,{model:n,run:r}=ob(),i=je(),a={item:{kind:`field`,name:t.name},area:null},{setNodeRef:o,listeners:s,isDragging:c}=xy({id:ub(t.name),data:a});return(0,Z.jsxs)(`label`,{ref:o,className:Q($l,{"sxl-dragging":c}),onPointerDown:s?.onPointerDown,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:t.ticked,onChange:()=>r(t.ticked?n.untick(t.name):n.tick(t.name))}),(0,Z.jsx)(`span`,{className:eu,title:t.name,children:t.name}),t.filtered?(0,Z.jsx)(M,{iconKey:`FilterToggle`,size:12,className:nu,title:i(`pivot.chip.filtered`)}):null,(0,Z.jsx)(M,{iconKey:fb[t.dataType],size:12,className:tu,title:i(db[t.dataType])})]})},hb=e=>{let{chip:t,area:n,overlay:r,dragging:i,propsCaption:a,menuButton:o,renaming:s,onRename:c,className:l,ref:u,...d}=e,f=je(),p;t.kind===`values`&&(p=f(n===`row`?`pivot.chip.valuesAsRows`:`pivot.chip.valuesAsColumns`));let m=t.kind===`field`&&t.filtered,{ref:h,className:g,..._}=a??{};return(0,Z.jsxs)(`div`,{ref:u,title:p,className:Q(`sxl-pivot-chip`,l,lu,{"sxl-overlay":r,"sxl-dragging":i}),...d,children:[s?(0,Z.jsx)(gb,{name:t.name,label:f(`pivot.chip.rename`),onDone:e=>c?.(e)}):(0,Z.jsx)(`div`,{ref:h,className:Q(uu,g),..._,children:t.name}),m?(0,Z.jsx)(M,{iconKey:`FilterToggle`,size:12,className:nu,title:f(`pivot.chip.filtered`)}):null,o]})},gb=e=>{let{name:t,label:n,onDone:r}=e,i=(0,X.useRef)(!1),a=e=>{if(i.current)return;i.current=!0;let n=e?.trim();r(n&&n!==t?n:null)};return(0,Z.jsx)(`input`,{className:du,defaultValue:t,"aria-label":n,autoFocus:!0,onFocus:e=>e.currentTarget.select(),onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),a(e.currentTarget.value)):e.key===`Escape`&&(e.preventDefault(),a(null))},onBlur:e=>a(e.currentTarget.value)})},_b=`pivotValueSettings`,vb=[`page`,`row`,`column`,`values`],yb={page:C(`pivot.menu.moveTo.page`),row:C(`pivot.menu.moveTo.row`),column:C(`pivot.menu.moveTo.column`),values:C(`pivot.menu.moveTo.values`)},bb={sum:C(`pivot.function.sum`),count:C(`pivot.function.count`),average:C(`pivot.function.average`),max:C(`pivot.function.max`),min:C(`pivot.function.min`),product:C(`pivot.function.product`),countNums:C(`pivot.function.countNums`),stdDev:C(`pivot.function.stdDev`),stdDevp:C(`pivot.function.stdDevp`),var:C(`pivot.function.var`),varp:C(`pivot.function.varp`)},xb=[`sum`,`count`,`average`,`max`,`min`,`product`],Sb=(e,t)=>{let{chip:n,area:r,index:i,count:a}=e,{model:o,run:s,t:c,close:l,focus:u,openValueSettings:d,openFilter:f}=t,p=(e,t,n,r)=>({key:e,label:t,...r,run:()=>{l(),n()}}),m=(e,t)=>{n.kind===`data`&&e!==`values`||u(lb(e,n)),s(o.place(n,e,t))},h=[];if(n.kind===`data`){let e=xb.includes(n.function)?xb:[...xb,n.function];h.push(e.map(e=>p(`function.${e}`,c(bb[e]),()=>{e!==n.function&&s(o.setFunction(n.name,e))},{checked:e===n.function})))}let g=i===0,_=i>=a-1;h.push([p(`moveUp`,c(`pivot.menu.moveUp`),()=>m(r,i-1),{disabled:g}),p(`moveDown`,c(`pivot.menu.moveDown`),()=>m(r,i+1),{disabled:_}),p(`moveToStart`,c(`pivot.menu.moveToStart`),()=>m(r,0),{disabled:g}),p(`moveToEnd`,c(`pivot.menu.moveToEnd`),()=>m(r,a-1),{disabled:_})]);let v=vb.filter(e=>e!==r&&(n.kind!==`values`||e===`row`||e===`column`));if(h.push(v.map(e=>p(`moveTo.${e}`,c(yb[e]),()=>m(e)))),n.kind===`field`&&f){let e=c(r===`page`?`pivot.menu.filter`:`pivot.menu.sortAndFilter`);h.push([p(`filter`,e,()=>f(n.name))])}return n.kind!==`values`&&h.push([p(`remove`,c(`pivot.menu.remove`),()=>s(o.remove(n)))]),n.kind===`data`&&h.push([p(`valueSettings`,c(`pivot.menu.valueSettings`),()=>d(n.name))]),h},Cb=e=>(0,Z.jsx)(`div`,{role:`menu`,className:pu,children:e.groups.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`div`,{role:`separator`,className:gu}):null,e.map(e=>(0,Z.jsxs)(`button`,{type:`button`,role:e.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":e.checked,disabled:e.disabled,className:mu,onClick:e.run,children:[(0,Z.jsx)(`span`,{className:hu,children:e.checked?(0,Z.jsx)(M,{iconKey:`Check`,size:14}):null}),e.label]},e.key))]},t))}),wb=e=>(0,Z.jsx)(Cb,{...e}),Tb={placement:`bottom-end`,offsets:{mainAxis:2}},Eb=[`page`,`column`,`row`,`values`],Db={page:C(`pivot.area.page`),column:C(`pivot.area.column`),row:C(`pivot.area.row`),values:C(`pivot.area.values`)},Ob=e=>{let{className:t,...n}=e,{snapshot:r}=ob(),i=(0,X.useRef)(null),a=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let e=a.current;if(!e)return;a.current=null;let t=i.current?.querySelectorAll(`[data-chip-id]`)??[],n=Array.from(t).find(t=>t.dataset.chipId===e);n&&n!==document.activeElement&&n.focus()},[r]),(0,Z.jsx)(`div`,{ref:i,className:Q(`sxl-pivot-areas`,t,iu),...n,children:Eb.map(e=>(0,Z.jsx)(kb,{area:e,chips:r.areas[e],refocus:e=>{a.current=e}},e))})},kb=e=>{let{area:t,chips:n,refocus:r}=e,i=je(),{setNodeRef:a,isOver:o}=wy({id:cb(t),data:{area:t}}),s=n.map(e=>lb(t,e)),c=i(Db[t]);return(0,Z.jsxs)(`div`,{className:au,children:[(0,Z.jsx)(`div`,{className:ou,children:c}),(0,Z.jsx)(qy,{id:cb(t),items:s,strategy:Wy,children:(0,Z.jsxs)(`div`,{ref:a,role:`list`,"aria-label":c,className:Q(su,{"sxl-over":o}),children:[n.map((e,i)=>(0,Z.jsx)(Ab,{id:s[i],area:t,chip:e,index:i,count:n.length,refocus:r},s[i])),n.length===0?(0,Z.jsx)(`span`,{className:cu,children:i(`pivot.area.hint`)}):null]})})]})},Ab=e=>{let{id:t,area:n,chip:r,index:i,count:a,refocus:o}=e,{model:s,run:c,renderMenu:l,renderFilter:u}=ob(),{attributes:d,listeners:f,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:g,isDragging:_}=eb({id:t,data:{item:r,area:n,index:i}}),v=(e=>{let{place:t,model:n,run:r,renderMenu:i,renderFilter:a,focus:o}=e,s=je(),c=he(),l=K(e=>{let t=n.getPivotTable().getDataField(e);if(!t)return;let i={initialValue:{value:t},onInput:t=>{t?.changes&&r(n.applyValueSettings(e,t.changes))}};c.showWindow?.(_b,i)},[n,r,c]),u=i===void 0?wb:i,[d,f]=(0,X.useState)(null),p=K(e=>{let t=d?n.getPivotTable().getField(d):null;if(!a||!t)return null;let r={fields:[t],floatReference:e.floatReference??y.reference};return Se({...e,children:(0,Z.jsx)(ae,{render:a,props:r})})},[d,n,a]),m=K(e=>{f(e),y.reference.open(0)},[]),h=K(e=>{let i={chip:t.chip,area:t.area,groups:Sb(t,{model:n,run:r,t:s,close:()=>{e.closeFloat?.()},focus:o,openValueSettings:l,openFilter:a?m:null}),floatReference:e.floatReference??v.reference};return Se({...e,children:(0,Z.jsx)(ae,{render:u,props:i})})},[t,n,r,u,s,o,l,m,a]),[g,_]=(0,X.useState)(null),v=De({label:`pivot-chip-menu`,anchor:g,propsPopper:Tb,renderPopupPanel:h}),y=De({label:`pivot-chip-filter`,anchor:g,propsPopper:Tb,renderPopupPanel:p});return u?{button:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{ref:_,type:`button`,className:fu,"aria-label":s(`pivot.menu.button`),title:s(`pivot.menu.button`),"aria-haspopup":`menu`,"aria-expanded":v.isOpen,onClick:()=>{v.isOpen?v.reference.close(0):v.reference.open(0)},children:(0,Z.jsx)(M,{iconKey:`ExpandMore`,size:14})}),v.component,y.component]}),open:()=>v.reference.open(0)}:{button:null,open:()=>{}}})({place:{chip:r,area:n,index:i,count:a},model:s,run:c,renderMenu:l,renderFilter:u,focus:o}),[y,b]=(0,X.useState)(!1),x=(0,X.useRef)(null),S=(0,X.useCallback)(e=>{x.current=e,m(e)},[m]),C=(0,X.useRef)(!1);return(0,X.useLayoutEffect)(()=>{C.current&&!y&&x.current?.focus(),C.current=y},[y]),(0,Z.jsx)(hb,{ref:p,role:`listitem`,chip:r,area:n,dragging:_,style:{transform:O_.Translate.toString(h),transition:g},onContextMenu:e=>{v.button&&(e.preventDefault(),v.open())},propsCaption:{ref:S,"data-chip-id":t,...d,...f,onKeyDown:e=>{if(e.altKey&&(e.key===`ArrowUp`||e.key===`ArrowDown`)){e.preventDefault(),e.stopPropagation();let l=i+(e.key===`ArrowUp`?-1:1);if(l<0||l>=a)return;o(t),c(s.place(r,n,l));return}let l=!e.altKey&&!e.ctrlKey&&!e.metaKey;!l||e.key!==`Delete`&&e.key!==`Backspace`?l&&!e.shiftKey&&e.key===`F2`?(e.preventDefault(),e.stopPropagation(),b(!0)):e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`?(e.preventDefault(),e.stopPropagation(),v.open()):f?.onKeyDown?.(e):(e.preventDefault(),e.stopPropagation(),c(s.remove(r)))},onDoubleClick:()=>b(!0)},menuButton:v.button,renaming:y,onRename:e=>{b(!1),e!==null&&(o(lb(n,{...r,name:e})),c(s.rename(r,e)))}})},jb=e=>{let{fields:t,onError:n,renderMenu:r,renderFilter:i,children:a,...o}=e,{model:s,snapshot:c}=t,l=K(e=>{e.catch(e=>{n?n(e):console.error(e)})},[n]),u=(0,X.useMemo)(()=>({model:s,snapshot:c,run:l,renderMenu:r,renderFilter:i}),[s,c,l,r,i]),d=V_(B_(Iv,{activationConstraint:{distance:4}}),B_(jv,{coordinateGetter:rb})),[f,p]=(0,X.useState)(null),m=null;if(f){let e=f.item.kind!==`field`||`filtered`in f.item?f.item:{kind:`field`,name:f.item.name,filtered:!1};m=(0,Z.jsx)(hb,{chip:e,area:f.area??`row`,overlay:!0})}return(0,Z.jsx)(ab.Provider,{value:u,children:(0,Z.jsx)(vy,{sensors:d,collisionDetection:Pb,onDragStart:e=>{p(e.active.data.current??null)},onDragEnd:e=>{p(null);let t=e.active.data.current;if(!t)return;let n=e.over;if(!n)return void(t.area&&l(s.remove(t.item)));if(n.id===`pivot-root`)return;let r=n.data.current;if(!r||r.list)return void(t.area&&l(s.remove(t.item)));let i=r.area;if(!i)return;let a=r.index;if(a!==void 0&&t.area!==i){let t=e.active.rect.current.translated;t&&t.top+t.height/2>n.rect.top+n.rect.height/2&&a++}(t.area!==i||a!==void 0&&a!==t.index)&&l(s.place(t.item,i,a))},onDragCancel:()=>p(null),children:(0,Z.jsxs)(Mb,{...o,children:[a,(0,Z.jsx)(Iy,{dropAnimation:null,children:m})]})})})},Mb=e=>{let{setNodeRef:t}=wy({id:sb});return(0,Z.jsx)(`div`,{ref:t,...e})},Nb=e=>e===`pivot-root`?2:e===`pivot-list`||String(e).startsWith(`pivot-area|`)?1:0,Pb=e=>e.pointerCoordinates?(e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,a=n.get(t);if(a&&$_(r,a)){let n=q_(a).reduce((e,t)=>e+U_(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(G_)})(e).sort((e,t)=>Nb(e.id)-Nb(t.id)):X_({...e,droppableContainers:e.droppableContainers.filter(e=>e.id!==sb)}),Fb=e=>{let{className:t,...n}=e;return(0,Z.jsxs)(jb,{className:Q(`sxl-pivot-fields`,t,Xl),...n,children:[(0,Z.jsx)(pb,{}),(0,Z.jsx)(Ob,{})]})},Ib=e=>{let{model:t,entryKey:n,args:r,renderMenu:i,renderFilter:a,renderHeader:o,frame:s,ref:c,className:u,...d}=e,f=l(),p=he(),m=je(),[h,g]=(0,X.useState)(()=>r?.pivot??(f?ql(f):null));(0,X.useEffect)(()=>{r?.pivot&&g(r.pivot)},[r?.pivot]),(0,X.useEffect)(()=>{if(f)return f.getSelection().addListeners({onChange:()=>g(ql(f))})},[f]);let _=r_(h),v=e=>{p.showError?.(e instanceof Error?e:String(e))},y;return y=_?_.snapshot.deleted?(0,Z.jsx)(`div`,{className:yu,children:m(`pivot.pane.deleted`)}):(0,Z.jsxs)(Z.Fragment,{children:[o&&h?o({pivot:h,name:_.snapshot.name,source:_.snapshot.source,onError:v}):(0,Z.jsx)(`div`,{className:vu,children:_.snapshot.name}),(0,Z.jsx)(Fb,{fields:_,renderMenu:i,renderFilter:a,onError:v})]}):(0,Z.jsx)(`div`,{className:yu,children:m(`pivot.pane.empty`)}),(0,Z.jsx)(`div`,{ref:c,className:Q(`sxl-pivot-table-pane`,u,_u),...d,children:y})};function Lb(){Od.getRegisteredTaskPane(kd.PivotTable)||Od.registerTaskPane({key:kd.PivotTable,component:Ib})}var Rb=e=>{let t=0;for(let n of(e.getWorkbook()?.getPivotTables()??e.getPivotTables()).getItems()){let e=/^PivotTable(\d+)$/i.exec(n.getName())?.[1];e&&(t=Math.max(t,parseInt(e,10)))}return`PivotTable${t+1}`},zb=(e,t)=>t?.at(0)?.getWorksheet()??e,Bb=(e,t)=>e?[t]:[],Vb=new Set([`formatTextRotate0`,`formatTextRotate45`,`formatTextRotate90`,`formatTextRotate270`,`formatTextRotate315`,`formatTextRotateCustom`,`formatTextRotateVertical`]),Hb={autoSelect:!0,autoFit:{axes:Y.AxisSelection.Column,expandOnly:!0,skipCustomSize:!0}},Ub=new Set([`dataTextToColumns`,`sortAscending`,`sortDescending`,`sheetBackgroundDelete`]),Wb=new Set([`editNote`,`showHideNote`,`showAllNotes`,`deleteComments`,`updateComments`,`convertNotesToComments`,`clearComments`,`clearNotes`]),Gb=[`conditionalFormatGreaterThan`,`conditionalFormatLessThan`,`conditionalFormatBetween`,`conditionalFormatEqualTo`,`conditionalFormatTextContains`,`conditionalFormatDateOccurring`,`conditionalFormatDuplicateValues`,`conditionalFormatTopItems`,`conditionalFormatTopPercent`,`conditionalFormatBottomItems`,`conditionalFormatBottomPercent`,`conditionalFormatAboveAverage`,`conditionalFormatBelowAverage`],Kb=new Set([`fillDown`,`fillRight`,`fillUp`,`fillLeft`,`fillSeries`,`clearContents`,`clearAll`,`insertImageInCellFromFile`,`insertImageInCellFromURL`]);function qb(e,t,n){let r=()=>t.getView();e.updateCommand(`gridlinesToggle`,{callback:()=>{let e=r().isShowColumnGridlines()&&r().isShowRowGridlines();r().update({showColumnGridlines:!e,showRowGridlines:!e})}}),e.updateCommand(`sheetViewToggleGridlinesRows`,{callback:()=>{r().setShowRowGridlines(!r().isShowRowGridlines())}}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{callback:()=>{r().setShowColumnGridlines(!r().isShowColumnGridlines())}}),e.updateCommand(`sheetViewFormatGridlinesColor`,{callback:e=>{r().setGridLineColor(e)},context:()=>({...Yb(t),autoColor:null,onColorSelect:()=>{}})}),e.updateCommand(`sheetViewToggleShowHeadings`,{callback:()=>{let e=r().isShowColumnHeaders()&&r().isShowRowHeaders();r().update({showColumnHeaders:!e,showRowHeaders:!e})}}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{callback:()=>{r().setShowColumnHeaders(!r().isShowColumnHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{callback:()=>{r().setShowRowHeaders(!r().isShowRowHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{callback:()=>{let e=r(),t=e.getColumnHeaderStyle()===In.HeaderTextStyle.Zero&&e.getRowHeaderStyle()===In.HeaderTextStyle.Zero;e.update({columnHeaderStyle:t?In.HeaderTextStyle.A1:In.HeaderTextStyle.Zero,rowHeaderStyle:t?In.HeaderTextStyle.One:In.HeaderTextStyle.Zero})}}),e.updateCommand(`sheetViewToggleFormulaView`,{callback:()=>{r().setShowFormulas(!r().isShowFormulas())}}),e.updateCommand(`sheetViewToggleShowZeros`,{callback:()=>{r().setShowZeros(!r().isShowZeros())}}),e.updateCommand(`displayOutlineSymbolsToggle`,{callback:()=>{r().setShowOutlineSymbols(!r().isShowOutlineSymbols())}}),e.updateCommand(`protectionHighlight`,{callback:()=>{r().setShowLockedShading(!r().isShowLockedShading())}}),e.updateCommand(`dataValidationShowInvalid`,{callback:()=>{r().setShowInvalid(!r().isShowInvalid())}}),e.updateCommand(`calculate`,{callback:()=>{t.calculate()}}),e.updateCommand(`sheetZoomOut`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomOut()}}),e.updateCommand(`sheetZoomIn`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomIn()}}),e.updateCommand(`sheetZoom100`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(100)}}),e.updateCommand(`sheetZoom200`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(200)}}),e.updateCommand(`sheetZoom75`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(75)}}),e.updateCommand(`sheetZoom50`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(50)}}),e.updateCommand(`sheetZoom25`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(25)}}),e.updateCommand(`sheetZoomCustom`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{r().setZoomScale(e??100)}}),e.updateCommand(`sheetZoomSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n?.getClient();if(!e||e.width<=0||e.height<=0)return;let i=r(),a=t.getSelection().getCoords(),o=a.ranges?.[0]??w.cellToRange(a.cell),s=t.getColumnHeaders(),c=t.getRowHeaders(),l=s.getMetrics().getOffset(o.colStart),u=c.getMetrics().getOffset(o.rowStart),d=s.getMetrics().getOffset(o.colEnd+1)-l,f=c.getMetrics().getOffset(o.rowEnd+1)-u,p=i.getFreezePanes().coords,m=p?.colIndex?s.getMetrics().getOffset(p.colIndex):0,h=p?.rowIndex?c.getMetrics().getOffset(p.rowIndex):0,g=l>=m,_=u>=h,v=d>0?d+(g?m:0):0,y=f>0?f+(_?h:0):0,b=Math.min(v>0?e.width/v:1/0,y>0?e.height/y:1/0);if(!isFinite(b))return;let x=Math.min(400,Math.max(10,Math.floor(100*b)));i.setTopLeft({left:g?l-m:0,top:_?u-h:0}),i.setZoomScale(x)}});let i=()=>(r().getFreezePanes().coords?.rowIndex??0)!==0,a=()=>(r().getFreezePanes().coords?.colIndex??0)!==0;e.updateCommand(`freezeToggle`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();i()||a()?r().setFreezePanes(null):r().setFreezePanes({coords:e})}}),e.updateCommand(`freezeToggleHorizontal`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();dg(r(),Y.Axis.Row,i()?0:e.rowIndex)}}),e.updateCommand(`freezeToggleVertical`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();dg(r(),Y.Axis.Column,a()?0:e.colIndex)}}),e.updateCommand(`unfreeze`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setFreezePanes(null)}}),e.updateCommand(`freezePanesAt`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&dg(r(),e.axis,e.index)}});let o=()=>{let n=r(),o=n.getColumnHeaderStyle()===In.HeaderTextStyle.Zero&&n.getRowHeaderStyle()===In.HeaderTextStyle.Zero;e.updateCommand(`gridlinesToggle`,{state:n.isShowColumnGridlines()||n.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{state:n.isShowColumnGridlines()}),e.updateCommand(`sheetViewToggleGridlinesRows`,{state:n.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleShowHeadings`,{state:n.isShowColumnHeaders()||n.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{state:n.isShowColumnHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{state:n.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{state:o}),e.updateCommand(`sheetViewToggleFormulaView`,{state:n.isShowFormulas()}),e.updateCommand(`sheetViewToggleShowZeros`,{state:n.isShowZeros()}),e.updateCommand(`displayOutlineSymbolsToggle`,{state:n.isShowOutlineSymbols()}),e.updateCommand(`protectionHighlight`,{state:n.isShowLockedShading()}),e.updateCommand(`dataValidationShowInvalid`,{state:n.isShowInvalid()}),e.updateCommand(`sheetViewFormatGridlinesColor`,{state:n.getGridLineColor()});let s=n.getZoomScale();e.updateCommand(`sheetZoom200`,{state:s===200}),e.updateCommand(`sheetZoom100`,{state:s===100}),e.updateCommand(`sheetZoom75`,{state:s===75}),e.updateCommand(`sheetZoom50`,{state:s===50}),e.updateCommand(`sheetZoom25`,{state:s===25}),e.updateCommand(`sheetZoomCustom`,{state:s});let c=t.getSelectedCell().getCoords();if(!c)return;let l=i(),u=a(),d=l||u;e.updateCommand(`freezeToggle`,{state:d,disabledReasons:d||c.rowIndex!==0||c.colIndex!==0?[]:[C(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleHorizontal`,{state:l,disabledReasons:l||c.rowIndex!==0?[]:[C(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleVertical`,{state:u,disabledReasons:u||c.colIndex!==0?[]:[C(`reason.freezeOrigin`)]}),e.updateCommand(`unfreeze`,{disabledReasons:d?[]:[C(`reason.noFreeze`)]})};o();let s={onFreezePaneChange:o,onZoomScaleChange:o,onHeaderChange:o},c=r().addListeners(s,{transactional:!1}),l=t.addListeners({onViewChange:()=>{c(),c=r().addListeners(s,{transactional:!1}),o()}}),u=t.getSelection().addListeners({onChange:o});return()=>{c(),l(),u()}}var Jb=new vn(`transparent`);function Yb(e){let t=e.getStyles();return{schemeLookup:t.schemeLookup(),recentColors:()=>t.recentColors(),addRecentColor:e=>t.addRecentColor(e),clearRecentColors:()=>t.clearRecentColors()}}function Xb(e,t,n){let r=()=>t.getSelectedRanges();e.updateCommand(`hideRows`,{callback:()=>{r().getRowHeaders().setHidden(!0)}}),e.updateCommand(`hideColumns`,{callback:()=>{r().getColumnHeaders().setHidden(!0)}}),e.updateCommand(`unhideRows`,{callback:()=>{r().getRowHeaders().setHidden(!1)}}),e.updateCommand(`unhideColumns`,{callback:()=>{r().getColumnHeaders().setHidden(!1)}}),e.updateCommand(`autoFitRows`,{callback:()=>{r().autoFit({axes:Y.AxisSelection.Row})}}),e.updateCommand(`autoFitColumns`,{callback:()=>{r().autoFit({axes:Y.AxisSelection.Column})}});let i=(e,t)=>{let i=r();if(i.getCount()>1){let t=j(e?`error.ungroup.multipleRanges`:`error.group.multipleRanges`);n?.showError(new k(t))}else e?i.at(0).ungroup(t):i.at(0).group(t)};e.updateCommand(`group`,{callback:()=>i(!1)}),e.updateCommand(`groupRows`,{callback:()=>i(!1,Y.Axis.Row)}),e.updateCommand(`groupColumns`,{callback:()=>i(!1,Y.Axis.Column)}),e.updateCommand(`ungroup`,{callback:()=>i(!0)}),e.updateCommand(`ungroupRows`,{callback:()=>i(!0,Y.Axis.Row)}),e.updateCommand(`ungroupColumns`,{callback:()=>i(!0,Y.Axis.Column)});let a=e=>{let n=r().at(0),i=(()=>{let e=r();if(e.isEntireColumns())return[Y.Axis.Column];if(e.isEntireRows())return[Y.Axis.Row];let n=t.getOutline(),i=e.at(0).getCoords(),a=[];for(let e of[Y.Axis.Row,Y.Axis.Column]){let t=e===Y.Axis.Column?i.colStart:i.rowStart,r=e===Y.Axis.Column?i.colEnd:i.rowEnd;n.getGroups(e,{from:t,to:r}).length>0&&a.push(e)}return a})();for(let t=0;t<i.length;t++)e?n.showGroupDetails(i[t]):n.hideGroupDetails(i[t])};e.updateCommand(`showDetail`,{callback:()=>a(!0)}),e.updateCommand(`hideDetail`,{callback:()=>a(!1)}),e.updateCommand(`outlineToggleGroup`,{callback:e=>{if(!e)return;let n=t.getRange(e.axis===Y.Axis.Column?{colStart:e.index,colEnd:e.index,rowStart:0,rowEnd:0}:{rowStart:e.index,rowEnd:e.index,colStart:0,colEnd:0});e.show?n.showGroupDetails(e.axis):n.hideGroupDetails(e.axis)}}),e.updateCommand(`outlineShowLevel`,{callback:e=>{e&&t.getOutline().setVisibleLevels(e.axis,e.level)}}),e.updateCommand(`clearOutline`,{callback:()=>{let e=r();for(let t=0;t<e.getCount();t++)e.at(t).clearGroups()}}),e.updateCommand(`autoOutline`,{callback:()=>{t.getOutline().autoOutline()}}),e.updateCommand(`outlineSettings`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getOutline(),r={initialValue:{summaryBelow:e.getSummaryDirection(Y.Axis.Row)===Y.Direction.Down,summaryRight:e.getSummaryDirection(Y.Axis.Column)===Y.Direction.Right,automaticStyles:e.isAutomaticStyles()},onInput:n=>{n&&t.doBatch(()=>{e.setSummaryDirection(Y.Axis.Row,n.summaryBelow?Y.Direction.Down:Y.Direction.Up),e.setSummaryDirection(Y.Axis.Column,n.summaryRight?Y.Direction.Right:Y.Direction.Left),e.setAutomaticStyles(n.automaticStyles)},{description:C(`op.updateOutline`)})}};n?.showWindow(`outlineSettings`,r)}});let o=(e,i)=>{let a=e===Y.Axis.Row,o=C(a?`op.resizeRows`:`op.resizeColumns`),s={initialValue:{size:i,unit:`Px`},context:()=>({getAxis:()=>e,getUnitText:()=>`Pt`}),onInput:(e,n)=>{if(n===`Autofit`)return void t.doBatch(()=>r().autoFit({axes:a?Y.AxisSelection.Row:Y.AxisSelection.Column}),{description:C(`op.autofit`),autoSelect:!0});if(!e)return;let i=a?r().getRowHeaders():r().getColumnHeaders();t.doBatch(()=>i.setSize(e.size+e.unit),{description:o,autoSelect:!0})}};n?.showWindow(`resizeHeader`,s)};return e.updateCommand(`resizeRows`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(Y.Axis.Row,20)}),e.updateCommand(`resizeColumns`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(Y.Axis.Column,100)}),()=>{}}function Zb(e,t,n){e.updateCommand(`dataRemoveDuplicates`,{callback:async e=>{let r=t.getSelectedRanges();r.getCount()>1?n?.showError(new k(j(`error.removeDuplicates.multipleRanges`))):r.at(0).removeDuplicates({autoSelect:!0,...e})}}),e.updateCommand(`dataTextToColumns`,{callback:async e=>{let r=t.getSelectedRanges();if(r.getCount()>1)return void n?.showError(new k(j(`error.textToColumns.multipleRanges`)));let i=typeof e==`string`?{delimiter:e}:e;r.at(0).textToColumns({autoSelect:!0,...i})}});let r=async(e,r,i,a)=>{let o=r,s=t.getSelectedRange(),c=t.getSelectedCell(),l=c.getCoords(),u,d=null;if(o){let e=o.getRange().getCoords();d=t.getTables().getItems({address:{colIndex:e.colStart,rowIndex:e.rowStart}})[0]??t.getAutoTable(),d&&!d.getRange().getIntersect(e)&&(d=null)}else if(d=t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??t.getAutoTable(),d){let e=d.getRange();e.getIntersect(l)?o=d.getSortAt(l.colIndex-e.getCoords().colStart):d=null}if(o){let e=o,t=d;u=n=>{if(i&&t)return void t.sort({...n,description:a});let r={...n};delete r.sorts,e.setCriteria(r)},c=e.getRange().getCell(),s=t?t.getRange():e.getRange()}else{let n=t.getSelectedRanges();if(n.getCount()>1)throw new k(j(`error.sort.multipleRanges`));let r=n.at(0);r.size===1&&(r=r.getSurrounding({contentOnly:!0})),s=r,u=t=>{r.doBatch(()=>{let n={...t,...e};r.sort(n),r.autoFit({axes:n?.axis===Y.Axis.Column?Y.AxisSelection.Column:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},a)}}let f=async e=>{if(!e)return;let t=await Promise.resolve(n?.showBusy?.(j(a))??null);try{u(e)}catch(e){t?.(),n?.showError?.(e);return}t?.()},p=s.getDefaultSortCriteria(Y.Axis.Row,c);if(!p){if(i)throw new k(j(`error.sort.invalidSelection`));return}if(!i)return void await f({...p.options,...e});let m=s,h=p.options;h.hasHeader&&(m=s.getIntersect(p.sortCoords)),m.select();let g={range:s,cell:c},_={initialValue:h,context:()=>g,onInput:e=>{e&&f(e)}};n?.showWindow?.(`sort`,_)};return e.updateCommand(`sortAscending`,{tags:[`noTransaction`],callback:e=>r({reverse:!1},e,!1,C(`op.sortAscending`))}),e.updateCommand(`sortDescending`,{tags:[`noTransaction`],callback:e=>r({reverse:!0},e,!1,C(`op.sortDescending`))}),e.updateCommand(`sortCustom`,{tags:[`noTransaction`],callback:e=>r({},e,!0,C(`op.sortCustom`))}),()=>{}}function Qb(e,t,n,r){e.updateCommand(`editNote`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell(),n=e.getComments();if(n&&!n.isNote())return;n||=t.getComments().add(e,``,{asNote:!0});let r=n.getMovable();r&&(await r.select({autoFocus:!1}),un(r))}}),e.updateCommand(`showHideNote`,{callback:()=>{let e=t.getSelectedCell().getComments(),n=e?.isNote()?e.getMovable():null;n&&n.setHidden(!n.isHidden())}}),e.updateCommand(`showAllNotes`,{callback:()=>{let e=[],n=t.getComments().getItems({notes:!0});for(let t=0;t<n.length;t++){let r=n[t].getMovable();r&&e.push(r)}let r=e.every(e=>!e.isHidden());for(let t=0;t<e.length;t++)e[t].setHidden(r)}});let i=()=>r?.getActive()===kd.Comments;e.updateCommand(`updateComments`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell(),r=e.getComments();if(r?.isNote())return;if(i()||!Xm(t))return void n?.(kd.Comments,{args:r?{focus:r}:{insert:!0}});let a=e.getCoords();a&&qm(t,a)}});let a=async e=>{let n=t.getComments().getItems({notes:!1}).sort(Yg);if(n.length===0)return;let r=t.getSelectedCell().getCoords(),a=null;for(let t=0;r&&t<n.length;t++){let i=n[e?t:n.length-1-t],o=Jg(i),s=o.rowIndex-r.rowIndex||o.colIndex-r.colIndex;if(e?s>0:s<0){a=i;break}}a??=n[e?0:n.length-1];let o=Jg(a);await t.getRange(w.cellToRange(o)).select(),!i()&&Xm(t)&&qm(t,o,{autoFocus:!1})};e.updateCommand(`previousComment`,{tags:[`noTransaction`,`noRepeat`],callback:()=>a(!1)}),e.updateCommand(`nextComment`,{tags:[`noTransaction`,`noRepeat`],callback:()=>a(!0)}),e.updateCommand(`showCommentsPane`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i()?r.close(kd.Comments):n?.(kd.Comments)}}),e.updateCommand(`convertNotesToComments`,{callback:()=>{let e=t.getComments().getItems({notes:!0});for(let t=0;t<e.length;t++)e[t].update({asNote:!1,content:e[t].getContent()})}});let o=()=>{e.updateCommand(`showCommentsPane`,{state:i(),disabledReasons:Zg(r,kd.Comments)})};o();let s=r?.addListener({onChange:o}),c=()=>{let n=!t.getProtection().isObjectsAllowed(),r=Bb(n,C(`reason.sheetProtected`)),i=t.getSelectedCell().getComments(),a=i?.isNote()?i:null,o=t.getComments().getItems(),s=0;for(let e=0;e<o.length;e++)o[e].isNote()&&s++;e.updateCommand(`updateComments`,{disabledReasons:Bb(!!a,C(`reason.cellHasNote`)),params:{thread:i&&!a?`yes`:`no`}});let c=Bb(o.length===s,C(`reason.noComments`));e.updateCommand(`previousComment`,{disabledReasons:c}),e.updateCommand(`nextComment`,{disabledReasons:c});let l=Bb(s===0,C(`reason.noNotes`));e.updateCommand(`convertNotesToComments`,{disabledReasons:[...r,...l]}),e.updateCommand(`showAllNotes`,{disabledReasons:[...r,...l]});let u=n&&s>0&&t.getComments().getItems({address:t.getSelectedRange(),notes:!0}).length>0;e.updateCommand(`deleteComments`,{disabledReasons:Bb(u,C(`reason.sheetProtected`))});let d=!1,f=!1;if(o.length>0){let e=t.getSelectedRanges().getCoords();for(let n=0;n<e.length&&(!d||!f);n++){let r=t.getComments().getItems({address:e[n]});for(let e=0;e<r.length;e++)r[e].isNote()?f=!0:d=!0}}e.updateCommand(`clearComments`,{disabledReasons:Bb(!d,C(`reason.noCommentsSelected`))}),e.updateCommand(`clearNotes`,{disabledReasons:[...r,...Bb(!f,C(`reason.noNotesSelected`))]}),e.updateCommand(`editNote`,{disabledReasons:[...r,...Bb(!!i&&!a,C(`reason.cellHasThread`))],params:{note:a?`yes`:`no`}}),e.updateCommand(`showHideNote`,{disabledReasons:[...r,...Bb(!a,C(`reason.noNote`))],state:!!a&&!1===a.getMovable()?.isHidden()})};c();let l=t.addListeners({onProtectionChange:c,onCommentsChange:c,onMovablesChange:c}),u=t.getSelection().addListeners({onChange:c});return()=>{l(),u(),s?.()}}function $b(e,t,n,r,i){let a=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null,o=(e,r=!1)=>{let i=a();if(i)return void i.updateStyleOptions(e);let o=t.getSelectedRanges(),s=o.getCount()===1&&o.at(0).size===1?o.at(0).getSurrounding({contentOnly:!0}):null,c=s?t.getRanges(s).getFixed(!0):o.getFixed(!0),l=(s??t.getSelectedRange()).getDefaultSortCriteria(),u={getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0),table:()=>null,styles:()=>null},d={initialValue:{ranges:c,hasHeader:l?.options?.hasHeader??!1},context:()=>u,onInput:n=>{var i;(i=n??null)&&t.doBatch(async()=>{let n=i.ranges.at(0);r&&n.getStyle().clear(),await t.getTables().add(n,{hasHeader:i.hasHeader,properties:{name:i.name,style:e?.name}}).getRange().select()},{description:C(`op.insertTable`)})}};n?.showWindow?.(`tableNew`,d)};e.updateCommand(`insertTable`,{tags:[`noTransaction`],callback:()=>o()});let s=()=>({styles:()=>t.getStyles(),table:()=>a(),getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)});e.updateCommand(`formatTableStyle`,{tags:[`noTransaction`],callback:e=>o(e),context:s}),e.updateCommand(`formatTableStyleClearCellStyles`,{tags:[`noTransaction`],callback:e=>o(e,!0),context:s}),e.updateCommand(`editTable`,{tags:[`noTransaction`,`noRepeat`],callback:async n=>{let i=null,o=!1;if(n?.isITable?i=n:n?.getValue?.()&&(i=n.getValue(),o=!0),!i&&(i=a(),i)){let e=t.getSelectedRange();e.size===1&&(e=e.getSurrounding()),await e.select()}if(!i)return;let s=i;if(o)try{await s.select()}catch{}let c={styles:()=>t.getStyles(),table:()=>s,getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)};e.updateCommand(`editTable`,{context:()=>c}),r?.(kd.TableDetails)}});let c=async(e,r)=>{let i=(e=>e?e.isITable?e:e.getValue?.()??null:a())(e);if(i){if(!r){let e=i.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4&&n?.showOptions&&await n.showOptions({title:j(`dialog.confirm.title`),description:j(`table.convertToRangeWarning`,{count:t}),options:[{id:`Convert`,label:()=>j(`table.convert`)},`Cancel`],defaultOption:`Convert`})!==`Convert`)return}await t.doBatch(()=>{r?i.delete():i.convertToRange()},{description:C(r?`op.deleteTable`:`op.convertTableToRange`)})}};e.updateCommand(`deleteTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>c(e,!0)}),e.updateCommand(`convertTableToRange`,{tags:[`noTransaction`,`noRepeat`],callback:e=>c(e,!1)}),e.updateCommand(`setDefaultTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().setDefault(e)}}),e.updateCommand(`deleteTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().getByName(e)?.delete()}});let l=()=>{let n=a(),r=t.getTables().getItems({address:t.getSelectedRange()}),i=[...Bb(!t.getProtection().isFormatCellsAllowed(),C(`reason.sheetProtected`)),...Bb(r.length>0&&!n,C(`reason.tableAmbiguous`))];e.updateCommand(`formatTableStyle`,{params:{hasTable:!!n},disabledReasons:i}),e.updateCommand(`formatTableStyleClearCellStyles`,{disabledReasons:i}),e.updateCommand(`insertTable`,{disabledReasons:[...i,...Bb(r.length>0,C(`reason.alreadyTable`))]})};l();let u=()=>{e.updateCommand(`editTable`,{state:i?.getActive()===kd.TableDetails,disabledReasons:Zg(i,kd.TableDetails)})};u();let d=i?.addListener({onChange:u}),f=t.getSelection().addListeners({onChange:l}),p=t.addListeners({onTablesChange:l,onProtectionChange:l});return()=>{f(),p(),d?.()}}function ex(e,t,n,r,i){let a=e=>(e&&!e.isDeleted()?e:null)??ql(t),o=e=>{Lb(),r?.(kd.PivotTable,{args:{pivot:e}})},s=(e=>({validateName:(t,n)=>{if(t.length===0||t.length>255)throw new k(j(`error.pivotTable.nameInvalid`));if(zb(e,n).getPivotTables().getByName(t))throw new k(j(`error.pivotTable.nameExists`))},checkLocation:e=>{let t=e.at(0);if(!t)return null;let{rowStart:n,colStart:r}=t.getCoords(),i=t.getWorksheet().getRange({rowStart:n,colStart:r,rowEnd:n+18-1,colEnd:r+3-1});return i.getPivotTables().length>0?C(`error.pivotTable.overlapsPivot`):i.getValues().some(e=>e.some(e=>e!=null))?C(`error.pivotTable.destinationOccupied`):null}}))(t);e.updateCommand(`insertPivotTable`,{tags:[`noTransaction`],callback:()=>{let e=t.getSelectedCell().getCoords(),r=t.getTables().getItems({address:e})[0],i=t.getSelectedRanges(),a=i.getCount()===1&&i.at(0).size===1?i.at(0).getSurrounding({contentOnly:!0}):null,c={initialValue:{source:r?r.getName():(a?t.getRanges(a):i).getFixed(!0),location:null,name:Rb(t)},context:()=>s,onInput:e=>{(async e=>{if(!e?.source||!e.location)return;let n=zb(t,e.location),r=await n.getPivotTables().add(typeof e.source==`string`?e.source:e.source.at(0),e.location.at(0),{name:e.name});n.getName()!==t.getName()&&await n.select(),await r.getRange().select(),o(r)})(e??null).catch(e=>{n?.showMessage?.(e?.message??String(e),{type:Te.Error})})}};n?.showWindow?.(`pivotTableNew`,c)}}),e.updateCommand(`editPivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=a(e);t&&o(t)}}),e.updateCommand(`refreshPivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{await a(e)?.refresh()}}),e.updateCommand(`deletePivotTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{a(e)?.delete()}});let c=()=>({pivot:()=>ql(t),styles:()=>t.getStyles()});e.updateCommand(`formatPivotStyle`,{callback:e=>{e&&ql(t)?.updateStyleOptions(e)},context:c}),e.updateCommand(`formatPivotStyleClear`,{callback:()=>{ql(t)?.updateStyleOptions({name:null})},context:c});let l=()=>{e.updateCommand(`insertPivotTable`,{disabledReasons:Bb(t.getProtection().isLocked(),C(`reason.sheetProtected`))});let n=Bb(!t.getProtection().isPivotTablesAllowed(),C(`reason.sheetProtected`));e.updateCommand(`refreshPivotTable`,{disabledReasons:n}),e.updateCommand(`deletePivotTable`,{disabledReasons:n});let r=ql(t)?.getStyleOptions();e.updateCommand(`formatPivotStyle`,{state:r,disabledReasons:n});let i=r?.name;e.updateCommand(`formatPivotStyleClear`,{disabledReasons:[...n,...Bb(!i,C(`reason.noPivotStyle`))]})};l();let u=()=>{e.updateCommand(`editPivotTable`,{state:i?.getActive()===kd.PivotTable,disabledReasons:Bb(!r,C(`reason.noTaskPane`))})};u();let d=i?.addListener({onChange:u}),f=t.getSelection().addListeners({onChange:l}),p=t.addListeners({onProtectionChange:l,onPivotTablesChange:l});return()=>{f(),p(),d?.()}}function tx(e,t){let n=t.sheet;if(!n)return()=>{};let r=t,i=r?.notifier;e.use(fn({transaction:n,notifier:i,manager:r?.manager})),e.updateCommand(`protectionSheetToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let r=n.getProtection(),a=null;try{if(r.isLocked()||r.isPaused()){let e=null;if(r.hasPassword()){let t=await i?.showInput({title:j(`dialog.password.title`),description:j(`dialog.password.description`),options:[{id:`Unprotect`,label:()=>j(`dialog.unprotect`)},`Cancel`],defaultOption:`Unprotect`,inputType:`password`});if(t?.option!==`Unprotect`)return;e=t.input}a=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.unlock(e??void 0)}else a=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.lock();a?.()}catch(e){a?.(),i?.showError(e)}}});let a=async e=>{let t=n.getProtection();if(t.isPaused())return void t.resume();let r;if(t.hasPassword()){let e=await i?.showInput({title:j(`dialog.password.title`),description:j(`dialog.password.pauseDescription`),options:[{id:`Pause`,label:()=>j(`dialog.pause`)},`Cancel`],defaultOption:`Pause`,inputType:`password`});if(e?.option!==`Pause`)return;r=e.input??void 0}let a=null;try{a=await Promise.resolve(i?.showBusy(e?.getLabel?.())??null),await t.pause(r),a?.()}catch(e){a?.(),i?.showError(e)}};e.updateCommand(`protectionSheetPause`,{tags:[`noTransaction`,`noRepeat`],callback:(e,t)=>a(t)}),e.updateCommand(`protectionSheetProtectOrPause`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let r=n.getProtection();if(r.isLocked()||r.isPaused())return void await a(t);let o=null;try{o=await Promise.resolve(i?.showBusy(t?.getLabel?.())??null),await r.lock(),o?.()}catch(e){o?.(),i?.showError(e)}}}),e.updateCommand(`manageProtection`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`sheet`||e===`ranges`||e===`cells`||e===`workbook`?e:`sheet`;r?.activateTaskPane?.(kd.Protection,{args:{tab:t}})}}),e.updateCommand(`manageDataValidation`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.DataValidation)}}),e.updateCommand(`manageConditionalFormat`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.ConditionalFormat)}}),e.updateCommand(`conditionalFormatNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.ConditionalFormat,{args:{insert:!0}})}});let o=e=>{n.getConditionalFormats().add(n.getSelectedRanges(),{...e,replaceExisting:!0})},s=e=>({tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.ConditionalFormat,{args:{draft:{condition:e,style:structuredClone(Dp[0].style)}}})}}),c=Rn.BuiltInOperatorNames,l=Rn.BuiltInSelectorNames;e.updateCommand(`conditionalFormatGreaterThan`,s({selector:l.Number,operator:c.GreaterThan,param:10})),e.updateCommand(`conditionalFormatLessThan`,s({selector:l.Number,operator:c.LessThan,param:10})),e.updateCommand(`conditionalFormatBetween`,s({selector:l.Number,operator:c.Between,param:{from:10,to:20}})),e.updateCommand(`conditionalFormatEqualTo`,s({selector:l.Number,operator:c.EqualTo,param:10})),e.updateCommand(`conditionalFormatTextContains`,s({selector:l.Text,operator:c.TextContains,param:``})),e.updateCommand(`conditionalFormatDateOccurring`,s({operator:c.TimePeriod,param:{type:Rn.TimePeriodType.Today}})),e.updateCommand(`conditionalFormatDuplicateValues`,s({operator:c.Not,param:{operator:c.Unique}})),e.updateCommand(`conditionalFormatTopItems`,s({operator:c.TopN,param:{top:!0,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatTopPercent`,s({operator:c.TopN,param:{top:!0,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatBottomItems`,s({operator:c.TopN,param:{top:!1,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatBottomPercent`,s({operator:c.TopN,param:{top:!1,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatAboveAverage`,s({operator:c.Average,param:{type:Rn.AverageType.Above}})),e.updateCommand(`conditionalFormatBelowAverage`,s({operator:c.Average,param:{type:Rn.AverageType.Below}})),e.updateCommand(`conditionalFormatDataBar`,{callback:e=>{o({scale:e?structuredClone(e):Bp()})}}),e.updateCommand(`conditionalFormatColorScale`,{callback:e=>{o({scale:e?structuredClone(e):zp()})}}),e.updateCommand(`conditionalFormatIconSet`,{callback:e=>{o({scale:e?structuredClone(e):Hp()})}}),e.updateCommand(`conditionalFormatClearSelection`,{callback:()=>{let e=n.getConditionalFormats(),t=new Set;for(let r of n.getSelectedRanges().getCoords())for(let n of e.getItems({address:r}))t.add(n);for(let e of t)e.delete()}}),e.updateCommand(`conditionalFormatClearSheet`,{callback:()=>{for(let e of n.getConditionalFormats().getItems())e.delete()}}),e.updateCommand(`dataValidationNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.DataValidation,{args:{insert:!0}})}}),e.updateCommand(`dataValidationList`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=zn.BuiltInOperators.InSet,t=e.createDefaultParam(void 0,{ranges:n.getSelectedRanges()});r?.activateTaskPane?.(kd.DataValidation,{args:{draft:{condition:{operator:e.getName(),param:t,includeBlanks:!0}}}})}}),e.updateCommand(`dataValidationUnique`,{callback:()=>{let e=n.getSelectedRanges(),t=e.getCoords();n.getDataValidations().getItems().some(e=>e.getCondition()?.getOperator()?.getName()===c.Unique&&w.isEqualRangesArrays(e.getRanges().getCoords(),t))||n.getDataValidations().add(e,{condition:{operator:c.Unique,includeBlanks:!0},alertStyle:Gn.AlertStyle.Stop,showAlertMessage:!0})}}),e.updateCommand(`dataValidationClearSelection`,{callback:()=>{n.getSelectedRanges().clear(er.Content.DataValidations,{autoSelect:!0})}}),e.updateCommand(`dataValidationClearSheet`,{callback:()=>{for(let e of n.getDataValidations().getItems())e.delete()}}),e.updateCommand(`protectionUnlockRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.Protection,{args:{tab:`ranges`,items:{insert:!0}}})}}),e.updateCommand(`manageProtectedRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.Protection,{args:{tab:`ranges`}})}});let u=async e=>{let t=t=>{n.doBatch(()=>{let r=n.getSelectedRanges();r.merge({axes:e,discardMultipleValues:t}),e===Y.AxisSelection.Both&&r.getStyle().update({alignment:{horizontal:J.HorizontalAlignment.Center}})},{description:C(`op.mergeCells`)})};try{t(!1)}catch(e){if(e?.type===`discardMultipleValues`&&i?.showOptions){if(await i.showOptions({title:j(`dialog.confirm.title`),description:j(`sheet.mergeCellsWarning`),options:[{id:`Merge`,label:()=>j(`sheet.merge`)},`Cancel`],defaultOption:`Merge`})!==`Merge`)return;try{t(!0)}catch(e){i?.showError?.(e)}}else i?.showError?.(e)}},d=()=>{n.doBatch(()=>{let e=n.getSelectedRanges();e.unmerge(),e.getStyle().update({alignment:{horizontal:null}})},{description:C(`op.unmergeCells`)})};e.updateCommand(`mergeToggle`,{tags:[`noTransaction`],callback:()=>{w.isSingleCell(n.getSelectedRange().getCoords())||(n.getSelectedRanges().getMerges().length===0?u(Y.AxisSelection.Both):d())}}),e.updateCommand(`mergeHorizontal`,{tags:[`noTransaction`],callback:()=>{u(Y.AxisSelection.Column)}}),e.updateCommand(`mergeVertical`,{tags:[`noTransaction`],callback:()=>{u(Y.AxisSelection.Row)}}),e.updateCommand(`unmerge`,{tags:[`noTransaction`],callback:()=>d()});let f=e.getKeysByTag(`mutator`),m=()=>{let t=n.getProtection(),i=t.isLocked(),a=!t.isFormatCellsAllowed(),o=Bb(a,C(`reason.sheetProtected`)),s=r?.taskPaneArea,c=Zg(s,kd.ConditionalFormat),l=Zg(s,kd.DataValidation),u=Zg(s,kd.Protection),d=t.isPaused(),p=i||d;e.updateCommand(`protectionSheetToggle`,{state:p,params:{locked:p}}),e.updateCommand(`protectionSheetPause`,{state:d,params:{paused:d},disabledReasons:Bb(!d&&!i,C(`reason.protectionNotPausable`))}),e.updateCommand(`protectionSheetProtectOrPause`,{state:p,params:{state:d?`paused`:i?`locked`:`none`},icon:d?`LockOpen`:`Lock`}),e.updateCommand(`protectionUnlockRange`,{disabledReasons:[...Bb(i,C(`reason.sheetProtected`)),...u]}),e.updateCommand(`conditionalFormatNewRule`,{disabledReasons:[...o,...c]});let m=[...Bb(i,C(`reason.sheetProtected`)),...l];e.updateCommand(`dataValidationNewRule`,{disabledReasons:m}),e.updateCommand(`dataValidationList`,{disabledReasons:m}),e.updateCommand(`manageProtection`,{disabledReasons:u}),e.updateCommand(`manageProtectedRange`,{disabledReasons:u}),e.updateCommand(`manageDataValidation`,{disabledReasons:l}),e.updateCommand(`manageConditionalFormat`,{disabledReasons:c});let h=n.getSelectedRanges(),g=n.getSelectedRange(),_=h.getCoords(),v=h.getMerges().length>0,y=h.isOverlapping(),b=!0;for(let e=0;b&&e<_.length;e++)b=w.isSingleCell(_[e]);let x=_.length===1&&_[0].colStart===_[0].colEnd,S=!(n.getTables().getItems({address:g}).length>0)&&!y&&(v||!b),T=!1,E=!1,D=!1,O=!1;a||(T=h.isEntireRowsAny(),E=T&&!h.isEntireRows(),D=h.isEntireColumnsAny(),O=D&&!h.isEntireColumns());for(let t of f)Vb.has(t)||Ub.has(t)||Wb.has(t)||Kb.has(t)||e.updateCommand(t,{disabledReasons:o});let k=Bb(i&&!g.getCell().isEditAllowed(),C(`reason.sheetProtected`));for(let t of Kb)e.updateCommand(t,{disabledReasons:k});for(let t of Gb)e.updateCommand(t,{disabledReasons:[...o,...c]});let A=n.getSelectedCell().getStyle().getAlignment().getHorizontal(),j=A===J.HorizontalAlignment.CenterContinuous||A===J.HorizontalAlignment.Fill;for(let t of Vb)e.updateCommand(t,{disabledReasons:[...o,...Bb(j,C(`reason.continuousSpan`))]});e.updateCommand(`dataTextToColumns`,{disabledReasons:[...o,...Bb(!x,C(`reason.singleColumn`)),...Bb(i,C(`reason.sheetLocked`))]});let M=[...o,...Bb(h.getCount()!==1,C(`reason.sortRange`))];e.updateCommand(`sortAscending`,{disabledReasons:M}),e.updateCommand(`sortDescending`,{disabledReasons:M}),e.updateCommand(`sheetBackgroundDelete`,{disabledReasons:[...o,...Bb(!n.getPicture(),C(`reason.noSheetBackground`))]});let N=Bb(!S,C(`reason.mergeUnavailable`));e.updateCommand(`mergeToggle`,{state:v,disabledReasons:[...o,...N]}),e.updateCommand(`mergeHorizontal`,{disabledReasons:[...o,...N]}),e.updateCommand(`mergeVertical`,{disabledReasons:[...o,...N]}),e.updateCommand(`unmerge`,{disabledReasons:[...o,...Bb(!v,C(`reason.noMerge`)),...N]});let P=Bb(y,C(`reason.overlap`)),F=[...o,...Bb(D,C(`reason.entireColumn`)),...P,...Bb(E,C(`reason.mixedSelection`))],I=[...o,...Bb(T,C(`reason.entireRow`)),...P,...Bb(O,C(`reason.mixedSelection`))];e.updateCommand(`insertCellsShiftDown`,{disabledReasons:F}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:F}),e.updateCommand(`insertCellsShiftRight`,{disabledReasons:I}),e.updateCommand(`deleteCellsShiftLeft`,{disabledReasons:I});let L=[...o,...Bb(D,C(`reason.entireColumn`)),...P,...Bb(E,C(`reason.mixedSelection`))],R=[...o,...Bb(T,C(`reason.entireRow`)),...P,...Bb(O,C(`reason.mixedSelection`))];for(let t of[`insertRows`,`insertRowsAfter`,`deleteRows`])e.updateCommand(t,{disabledReasons:L});for(let t of[`insertColumns`,`insertColumnsAfter`,`deleteColumns`])e.updateCommand(t,{disabledReasons:R});let ee=n.getOutline(),te=Bb(i,C(`reason.sheetProtected`)),z=(e,t)=>{for(let n=0;n<_.length;n++){let r=_[n],i=e===Y.Axis.Column?r.colStart:r.rowStart,a=e===Y.Axis.Column?r.colEnd:r.rowEnd;if(ee.getGroups(e,{from:i,to:a,level:t}).length>0)return!0}return!1},B=!D||T,V=!T||D,H=z(Y.Axis.Row),ne=z(Y.Axis.Column),U=B&&H||V&&ne,W=D||T?U:H||ne,re=e=>Bb(z(e,7),C(`reason.outlineTooDeep`)),ie=Bb(D,C(`reason.entireColumn`)),ae=Bb(T,C(`reason.entireRow`)),G=T&&D?[...ae,...ie]:[],oe=Bb(B&&z(Y.Axis.Row,7)||V&&z(Y.Axis.Column,7),C(`reason.outlineTooDeep`));e.updateCommand(`group`,{disabledReasons:[...te,...G,...oe]}),e.updateCommand(`groupRows`,{disabledReasons:[...te,...ie,...re(Y.Axis.Row)]}),e.updateCommand(`groupColumns`,{disabledReasons:[...te,...ae,...re(Y.Axis.Column)]}),e.updateCommand(`ungroup`,{disabledReasons:[...te,...G,...Bb(!U,C(`reason.noGroup`))]}),e.updateCommand(`ungroupRows`,{disabledReasons:[...te,...ie,...Bb(!H,C(`reason.noGroup`))]}),e.updateCommand(`ungroupColumns`,{disabledReasons:[...te,...ae,...Bb(!ne,C(`reason.noGroup`))]}),e.updateCommand(`showDetail`,{disabledReasons:[...o,...Bb(!W,C(`reason.noGroup`))]}),e.updateCommand(`hideDetail`,{disabledReasons:[...o,...Bb(!W,C(`reason.noGroup`))]}),e.updateCommand(`clearOutline`,{disabledReasons:[...te,...Bb(!H&&!ne,C(`reason.noGroup`))]}),e.updateCommand(`autoOutline`,{disabledReasons:te}),e.updateCommand(`outlineSettings`,{disabledReasons:te});let se=r?.editModeHandler?.getMode()?.key,ce=se===`copy`?`copy`:se===`cut`?`cut`:`none`,le=y?1:h.getRowCount(),ue=y?1:h.getColumnCount(),de=h.getDefaultShiftAxis()===Y.Axis.Column,fe=T&&!E,pe=D&&!O,me=fe?`rows`:pe?`columns`:`none`,he=pe?ue:le;e.updateCommand(`insertCells`,{params:{mode:ce,shift:de?`right`:`down`,span:me,count:he}}),e.updateCommand(`deleteCells`,{params:{shift:de?`left`:`up`,span:me,count:he}}),e.updateCommand(`insertCellsShiftDown`,{params:{mode:ce,span:fe?`rows`:`none`,count:le}}),e.updateCommand(`deleteCellsShiftUp`,{params:{span:fe?`rows`:`none`,count:le}}),e.updateCommand(`insertCellsShiftRight`,{params:{mode:ce,span:pe?`columns`:`none`,count:ue}}),e.updateCommand(`deleteCellsShiftLeft`,{params:{span:pe?`columns`:`none`,count:ue}});for(let t of[`insertRows`,`insertRowsAfter`])e.updateCommand(t,{params:{mode:ce,count:le}});for(let t of[`insertColumns`,`insertColumnsAfter`])e.updateCommand(t,{params:{mode:ce,count:ue}});e.updateCommand(`deleteRows`,{params:{count:le}}),e.updateCommand(`deleteColumns`,{params:{count:ue}}),e.updateCommand(`hideRows`,{params:{count:h.getRowCount()}}),e.updateCommand(`hideColumns`,{params:{count:h.getColumnCount()}});let ge=T===D?`both`:D?`columns`:`rows`;e.updateCommand(`group`,{params:{span:ge}}),e.updateCommand(`ungroup`,{params:{span:ge}})};m();let h=n.addListeners({onProtectionChange:m,onStyleChange:m,onInvalidated:m,onClose:()=>e.remove()}),_=n.getSelection().addListeners({onChange:m}),v=n.getOutline().addListeners({onOutlineChange:m}),y=qb(e,n,t.viewport),x=function(e,t,n,r,i,a){let o=(e,n=!1,r)=>{let i=r??{autoSelect:!0,autoFit:!0},a=t.getSelectedRanges();n&&a.getStyle().update(null,i),a.getStyle().update(e,i)},s=()=>t.getSelectedCell().getStyle().getFont(),c=()=>t.getSelectedCell().getStyle().getAlignment(),l=()=>{let e=s().getWeight();return!isNaN(e)&&e>500};e.updateCommand(`formatBoldToggle`,{callback:()=>{o({font:{weight:l()?400:700}})}}),e.updateCommand(`formatItalicToggle`,{callback:()=>{o({font:{italic:!s().getItalic()}})}}),e.updateCommand(`formatStrikeThroughToggle`,{callback:()=>{o({font:{strike:s().getStrike()===gn.StrikeStyle.None?gn.StrikeStyle.Single:gn.StrikeStyle.None}})}});let u=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{underline:s().getUnderline()===n?gn.UnderlineStyle.None:n}})}})};u(`formatUnderlinedToggle`,gn.UnderlineStyle.Single),u(`formatUnderlinedDoubleToggle`,gn.UnderlineStyle.Double),u(`formatUnderlinedAccountingToggle`,gn.UnderlineStyle.SingleAccounting),u(`formatUnderlinedAccountingDoubleToggle`,gn.UnderlineStyle.DoubleAccounting);let d=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{baseline:Math.sign(s().getBaseline())===Math.sign(n)?0:n}})}})};d(`formatSuperscriptToggle`,bn.Baseline.Superscript),d(`formatSubscriptToggle`,bn.Baseline.Subscript);let f=(t,n)=>{e.updateCommand(t,{callback:()=>{o({alignment:{overflow:c().getOverflow()===n?J.Overflow.Visible:n}})}})};f(`formatTextOverflowVisibleToggle`,J.Overflow.Visible),f(`formatTextOverflowWrapToggle`,J.Overflow.Wrap),f(`formatTextOverflowClipToggle`,J.Overflow.Clip),f(`formatTextOverflowShrinkToggle`,J.Overflow.Shrink),e.updateCommand(`formatTextOverflowEllipsisToggle`,{callback:()=>{o({alignment:{overflow:c().getOverflow()===J.Overflow.Ellipsis?J.Overflow.Visible:J.Overflow.Ellipsis}})},disabledReasons:[C(`reason.notImplemented`)]});let p=(t,n)=>{e.updateCommand(t,{callback:()=>{o({alignment:{vertical:c().getVertical()===n?J.VerticalAlignment.Bottom:n}})}})};p(`formatAlignTopToggle`,J.VerticalAlignment.Top),p(`formatAlignMiddleToggle`,J.VerticalAlignment.Center),p(`formatAlignBottomToggle`,J.VerticalAlignment.Bottom),p(`formatAlignJustifyVerticalToggle`,J.VerticalAlignment.Justify),p(`formatAlignDistributedVerticalToggle`,J.VerticalAlignment.Distributed);let m=(t,n,r=!1)=>{e.updateCommand(t,{callback:()=>{let e=c().getHorizontal()===n?J.HorizontalAlignment.General:n;o({alignment:r?{horizontal:e,rotation:null,stacked:null}:{horizontal:e}})}})};m(`formatAlignLeftToggle`,J.HorizontalAlignment.Left),m(`formatAlignCenterToggle`,J.HorizontalAlignment.Center),m(`formatAlignCenterContinuousToggle`,J.HorizontalAlignment.CenterContinuous,!0),m(`formatAlignFillToggle`,J.HorizontalAlignment.Fill,!0),m(`formatAlignDistributedHorizontalToggle`,J.HorizontalAlignment.Distributed),m(`formatAlignRightToggle`,J.HorizontalAlignment.Right),m(`formatAlignJustifyToggle`,J.HorizontalAlignment.Justify),e.updateCommand(`formatBorder`,{callback:e=>{o({borders:e})}}),e.updateCommand(`formatFillColor`,{callback:e=>{o({fill:e})}}),e.updateCommand(`formatFontColor`,{callback:e=>{o({font:{color:e}})}}),e.updateCommand(`formatFillColor`,{context:()=>({...Yb(t),autoColor:Jb,quickColor:r?.getLastFillColor?.()??new vn(Dn.Scheme.Bg2,t.getStyles().schemeLookup()),onColorSelect:e=>r?.setLastFillColor?.(e??Jb)})}),e.updateCommand(`formatFontColor`,{context:()=>({...Yb(t),autoColor:t.getStyles().getNormal().getFont().getColor(),quickColor:r?.getLastFontColor?.()??void 0,onColorSelect:e=>r?.setLastFontColor?.(e)})}),e.updateCommand(`formatBorder`,{context:()=>{let e=t.getStyles();return{autoColor:e.getNormal().getFont().getColor(),autoStyle:yn.StrokeStyle.Thin,schemeLookup:e.schemeLookup(),quickBorder:r?.getLastBorder?.()??void 0,createBorder:t=>e.getNormal().createStyle({borders:t}).getBorders(),onBorderSelect:e=>r?.setLastBorder?.(e)}}}),e.updateCommand(`formatFontFamily`,{callback:e=>{o({font:{family:e}})}}),e.updateCommand(`formatFontSize`,{callback:e=>{o({font:{size:e}})}}),e.updateCommand(`formatFontSizeIncrease`,{callback:()=>{o(e=>({font:{size:wn.findNextFontSize(e.getFont().getSize(),!0)}}))}}),e.updateCommand(`formatFontSizeDecrease`,{callback:()=>{o(e=>({font:{size:wn.findNextFontSize(e.getFont().getSize(),!1)}}))}}),e.updateCommand(`formatNumberFormat`,{callback:e=>{o({numberFormat:e})}}),e.updateCommand(`formatNumberFormatGeneralStyle`,{callback:()=>{o({numberFormat:Sn.Type.General})}}),e.updateCommand(`formatNumberFormatNumberStyle`,{callback:()=>{o({numberFormat:4})}}),e.updateCommand(`formatNumberFormatTimeStyle`,{callback:()=>{o({numberFormat:18})}}),e.updateCommand(`formatNumberFormatDateStyle`,{callback:()=>{o({numberFormat:15})}}),e.updateCommand(`formatNumberFormatAccountingStyle`,{callback:e=>{o(e?{numberFormat:e}:{named:En.BuiltInName.Currency})}}),e.updateCommand(`formatNumberFormatPercentStyle`,{callback:()=>{o({named:En.BuiltInName.Percent})}}),e.updateCommand(`formatNumberFormatScientificStyle`,{callback:()=>{o({numberFormat:11})}}),e.updateCommand(`formatNumberFormatCommaStyle`,{callback:()=>{o({named:En.BuiltInName.Comma})}}),e.updateCommand(`formatNumberFormatIncreaseDecimal`,{callback:()=>{o(e=>({numberFormat:Sn.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}}),e.updateCommand(`formatNumberFormatDecreaseDecimal`,{callback:()=>{o(e=>({numberFormat:Sn.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}});let h={style:yn.StrokeStyle.Thin,color:null};e.updateCommand(`formatBorderAddOutline`,{callback:()=>{o({borders:{left:h,top:h,right:h,bottom:h}})}}),e.updateCommand(`formatBorderClearOutline`,{callback:()=>{o({borders:null})}}),e.updateCommand(`formatIndentDecrease`,{callback:()=>{o(e=>{let t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}},!1,Hb)}}),e.updateCommand(`formatIndentIncrease`,{callback:()=>{o(e=>{let t={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===J.HorizontalAlignment.General&&(t.alignment.horizontal=J.HorizontalAlignment.Left),t},!1,Hb)}}),e.updateCommand(`formatCellStyle`,{callback:e=>{t.getSelectedRanges().getStyle().setNamed(e,{autoSelect:!0,autoFit:!0})},context:()=>({styles:()=>t.getStyles(),named:()=>t.getSelectedCell().getStyle().getNamed(),createCell:e=>t.createCell(e)})});let g=e=>{o({alignment:{rotation:e}})};e.updateCommand(`formatTextRotate0`,{callback:()=>g(0)}),e.updateCommand(`formatTextRotate45`,{callback:()=>g(45)}),e.updateCommand(`formatTextRotate90`,{callback:()=>g(90)}),e.updateCommand(`formatTextRotate270`,{callback:()=>g(270)}),e.updateCommand(`formatTextRotate315`,{callback:()=>g(315)}),e.updateCommand(`formatTextRotateCustom`,{callback:e=>g(e??0)}),e.updateCommand(`formatTextRotateVertical`,{callback:()=>{o({alignment:{stacked:!c().getStacked()}})}});let _=e=>{i?.(kd.FormatCells,{args:{tab:e}})};e.updateCommand(`formatCells`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{_(e)}}),e.updateCommand(`formatCellsNumber`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{_(`number`)}}),e.updateCommand(`formatCellsFont`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{_(`font`)}}),e.updateCommand(`formatSheetTabColor`,{callback:e=>{t.setTabColor(e)},state:t.getTabColor()??Jb,context:()=>({...Yb(t),autoColor:Jb,onColorSelect:()=>{}})});let v=()=>{let n=s(),r=n.getUnderline(),i=n.getBaseline();e.updateCommand(`formatBoldToggle`,{state:l()}),e.updateCommand(`formatItalicToggle`,{state:n.getItalic()}),e.updateCommand(`formatStrikeThroughToggle`,{state:n.getStrike()!==gn.StrikeStyle.None}),e.updateCommand(`formatUnderlinedToggle`,{state:r===gn.UnderlineStyle.Single}),e.updateCommand(`formatUnderlinedDoubleToggle`,{state:r===gn.UnderlineStyle.Double}),e.updateCommand(`formatUnderlinedAccountingToggle`,{state:r===gn.UnderlineStyle.SingleAccounting}),e.updateCommand(`formatUnderlinedAccountingDoubleToggle`,{state:r===gn.UnderlineStyle.DoubleAccounting}),e.updateCommand(`formatSuperscriptToggle`,{state:i>0}),e.updateCommand(`formatSubscriptToggle`,{state:i<0}),e.updateCommand(`formatFontFamily`,{state:n.getFamily()}),e.updateCommand(`formatFontSize`,{state:n.getSize()});let a=t.getSelectedCell().getStyle().getNumberFormat();e.updateCommand(`formatNumberFormat`,{state:a,context:()=>t.getSelectedCell()});let o=t.getSelectedCell().getStyle().getFill(),u=null;o?.getType()===_n.Type.Solid?u=o.getColor():o?.getType()===_n.Type.Gradient?u=o.getStops()?.[0]?.getColor()??null:o?.getType()===_n.Type.Pattern&&(u=o.getBackground()),e.updateCommand(`formatFillColor`,{state:u}),e.updateCommand(`formatFontColor`,{state:n.toJSON()?.color?n.getColor():null});let d=c(),f=d.getOverflow();e.updateCommand(`formatTextOverflowVisibleToggle`,{state:f===J.Overflow.Visible}),e.updateCommand(`formatTextOverflowWrapToggle`,{state:f===J.Overflow.Wrap}),e.updateCommand(`formatTextOverflowClipToggle`,{state:f===J.Overflow.Clip}),e.updateCommand(`formatTextOverflowShrinkToggle`,{state:f===J.Overflow.Shrink}),e.updateCommand(`formatTextOverflowEllipsisToggle`,{state:f===J.Overflow.Ellipsis});let p=d.getVertical();e.updateCommand(`formatAlignTopToggle`,{state:p===J.VerticalAlignment.Top}),e.updateCommand(`formatAlignMiddleToggle`,{state:p===J.VerticalAlignment.Center}),e.updateCommand(`formatAlignBottomToggle`,{state:p===J.VerticalAlignment.Bottom}),e.updateCommand(`formatAlignJustifyVerticalToggle`,{state:p===J.VerticalAlignment.Justify}),e.updateCommand(`formatAlignDistributedVerticalToggle`,{state:p===J.VerticalAlignment.Distributed});let m=d.getHorizontal();e.updateCommand(`formatAlignLeftToggle`,{state:m===J.HorizontalAlignment.Left}),e.updateCommand(`formatAlignCenterToggle`,{state:m===J.HorizontalAlignment.Center}),e.updateCommand(`formatAlignCenterContinuousToggle`,{state:m===J.HorizontalAlignment.CenterContinuous}),e.updateCommand(`formatAlignFillToggle`,{state:m===J.HorizontalAlignment.Fill}),e.updateCommand(`formatAlignDistributedHorizontalToggle`,{state:m===J.HorizontalAlignment.Distributed}),e.updateCommand(`formatAlignRightToggle`,{state:m===J.HorizontalAlignment.Right}),e.updateCommand(`formatAlignJustifyToggle`,{state:m===J.HorizontalAlignment.Justify});let h=d.getStacked(),g=h?0:d.getRotation();e.updateCommand(`formatTextRotate0`,{state:g===0&&!h}),e.updateCommand(`formatTextRotate45`,{state:g===45}),e.updateCommand(`formatTextRotate90`,{state:g===90}),e.updateCommand(`formatTextRotate270`,{state:g===270}),e.updateCommand(`formatTextRotate315`,{state:g===315}),e.updateCommand(`formatTextRotateVertical`,{state:h}),e.updateCommand(`formatTextRotateCustom`,{state:g??0})};v();let y=()=>{let t=Zg(a,kd.FormatCells);e.updateCommand(`formatCells`,{state:a?.getActive()===kd.FormatCells,disabledReasons:t}),e.updateCommand(`formatCellsNumber`,{disabledReasons:t}),e.updateCommand(`formatCellsFont`,{disabledReasons:t})};y();let b=a?.addListener({onChange:y}),x=t.addListeners({onStyleChange:v}),S=t.getSelection().addListeners({onChange:v});return()=>{x(),S(),b?.()}}(e,n,0,r?.pickerMemory,r?.activateTaskPane,r?.taskPaneArea),S=function(e,t){let n=e=>{t.getSelectedRanges().clear(e,{autoSelect:!0})};e.updateCommand(`clearContents`,{callback:()=>{n(er.Content.Values)}}),e.updateCommand(`clearFormulas`,{callback:()=>{n(er.Content.Formulas)}}),e.updateCommand(`clearFormats`,{callback:()=>{n(er.Content.Formats)}}),e.updateCommand(`clearHyperlinks`,{callback:()=>{n(er.Content.Hyperlinks)}}),e.updateCommand(`clearComments`,{callback:()=>{n(er.Content.Comments)}}),e.updateCommand(`clearNotes`,{callback:()=>{n(er.Content.Notes)}}),e.updateCommand(`clearAll`,{callback:()=>{n()}}),e.updateCommand(`deleteHyperlink`,{callback:()=>{t.getSelectedRange().setHyperlink(null,{autoSelect:!0})}}),e.updateCommand(`deleteComments`,{callback:()=>{t.getSelectedRange().setComments(null,{autoSelect:!0})}});let r=()=>{let n=Bb(t.getProtection().isLocked()&&!t.getSelectedRange().getCell().isEditAllowed(),C(`reason.sheetProtected`)),r=t.getSelectedRanges().getCounts(`formula`).formula>0;e.updateCommand(`clearFormulas`,{disabledReasons:[...n,...Bb(!r,C(`reason.noFormulasSelected`))]})};r();let i=t.addListeners({onProtectionChange:r,onDataChange:r,onInvalidated:r}),a=t.getSelection().addListeners({onChange:r});return()=>{i(),a()}}(e,n),T=function(e,t){let n=(e,n)=>{t.getSelection().selectRegion({contentOnly:e,entireRegion:n})};return e.updateCommand(`selectAll`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{n(!1,e??!1)}}),e.updateCommand(`selectRegion`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{n(!0,!1)}}),e.updateCommand(`selectComments`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getComments().getItems();e.length!==0&&await t.getRanges(e.map(e=>{let{rowStart:t,colStart:n,rowEnd:r,colEnd:i}=e.getRange().getCoords();return{rowStart:t,colStart:n,rowEnd:r,colEnd:i}})).select()}}),e.updateCommand(`clearHiddenSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.getSelection().clearHidden()}}),()=>{}}(e,n),E=function(e,t){let n=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null;e.updateCommand(`tableFilterToggle`,{callback:()=>{let e=n();if(e)return void e.setHiddenButtons(!e.isHiddenButtons());let r=t.getAutoTable();r?r.delete():t.addAutoTable()}});let r=()=>{let r=n()??t.getAutoTable(),i=t.getProtection(),a=!i.isAutoTableAllowed()||!i.isSortAllowed();e.updateCommand(`tableFilterToggle`,{state:!!r&&!r.isHiddenButtons(),disabledReasons:Bb(a,C(`reason.sheetProtected`))})};r();let i=t.getSelection().addListeners({onChange:r}),a=t.addListeners({onTablesChange:r,onProtectionChange:r});return()=>{i(),a()}}(e,n),D=Xb(e,n,i),O=function(e,t,n){let r=(e,n)=>{let r=t.getSelectedRanges();r.doBatch(()=>{let n=e===Y.Direction.Up||e===Y.Direction.Down,i=e===Y.Direction.Up||e===Y.Direction.Left,a=t.getEntireCoords(),o=n?a.rowEnd:a.colEnd,s=e=>n?[e.rowStart,e.rowEnd]:[e.colStart,e.colEnd],c=(e,t,r)=>n?{...e,rowStart:t,rowEnd:r}:{...e,colStart:t,colEnd:r},l=e=>{let n=e;for(;;){let[e,r]=s(n),i=e,a=r;for(let e of t.getRange(n).getMerges()){let[t,n]=s(e);i=Math.min(i,t),a=Math.max(a,n)}if(i===e&&a===r)return n;n=c(n,i,a)}},u=r.getCoords(),d=u.length===1;for(let e of u){let[n,r]=s(e),a;if(n!==r)a=l(i?c(e,r,r):c(e,n,n));else{if(!d)continue;let t=i?r+1:n-1;if(t<0||t>o)continue;a=l(c(e,t,t))}let[u,f]=s(a),p=c(e,Math.min(n,u),Math.max(r,f));t.getRange(a).autoFill(p,{filler:Wn.Types.Copy}),t.getRange(e).autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:n})};return e.updateCommand(`fillDown`,{callback:()=>r(Y.Direction.Down,`Fill Down`)}),e.updateCommand(`fillRight`,{callback:()=>r(Y.Direction.Right,`Fill Right`)}),e.updateCommand(`fillUp`,{callback:()=>r(Y.Direction.Up,`Fill Up`)}),e.updateCommand(`fillLeft`,{callback:()=>r(Y.Direction.Left,`Fill Left`)}),e.updateCommand(`fillSeries`,{tags:[`noTransaction`],callback:()=>{let e=t.getSelectedRanges();if(e.getCount()>1)throw new k(j(`error.fillSeries.multipleRanges`));let r=e.at(0),i=r.getDefaultAutoFillCriteria(),a=i?.direction!==Y.Direction.Right,o=r.getDefaultAutoFillCriteria(a?Y.Direction.Right:Y.Direction.Down),s=new Map([[Y.Direction.Down,a?i:o],[Y.Direction.Right,a?o:i]]),c=(i?.offered.length?i:null)??(o?.offered.length?o:null);if(!c)throw new k(j(`error.fillSeries.invalidSelection`));Ks({sheet:t,notifier:n,range:r,byDirection:s,direction:c.direction,presetId:c.presetId})}}),()=>{}}(e,n,i),A=function(e,t,n,r){let i=async(e,i=!1,a=!1)=>{let o=t.getSelectedRanges();i&&(e===Y.Axis.Row?o=o.getEntireRows(a):e===Y.Axis.Column&&(o=o.getEntireColumns(a)));let s=null,c=n?.getMode()?.key;if((c===`copy`||c===`cut`)&&r){let e=await r.getClipboard().readReference();e&&e.getItemType()===`range`&&(s=e.getItem?.()??null,s?.getCoords?.()||(s=null))}if(s){let t=await o.insertFrom(s,{...s.getMarkOptions(),axis:e,autoSelect:!0});!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({axes:Y.AxisSelection.Row,skipCustomSize:!0,minContent:!0}),n?.setMode(null)}else o.insert({axis:e,autoSelect:!0})},a=(e,n=!1)=>{let r=t.getSelectedRanges();n&&(e===Y.Axis.Row?r=r.getEntireRows():e===Y.Axis.Column&&(r=r.getEntireColumns())),r.delete(e)};return e.updateCommand(`insertCells`,{callback:()=>i()}),e.updateCommand(`insertCellsShiftRight`,{callback:()=>i(Y.Axis.Column)}),e.updateCommand(`insertCellsShiftDown`,{callback:()=>i(Y.Axis.Row)}),e.updateCommand(`insertRows`,{callback:()=>i(Y.Axis.Row,!0)}),e.updateCommand(`insertColumns`,{callback:()=>i(Y.Axis.Column,!0)}),e.updateCommand(`insertRowsAfter`,{callback:()=>i(Y.Axis.Row,!0,!0)}),e.updateCommand(`insertColumnsAfter`,{callback:()=>i(Y.Axis.Column,!0,!0)}),e.updateCommand(`deleteCells`,{callback:()=>a()}),e.updateCommand(`deleteCellsShiftUp`,{callback:()=>a(Y.Axis.Row)}),e.updateCommand(`deleteCellsShiftLeft`,{callback:()=>a(Y.Axis.Column)}),e.updateCommand(`deleteRows`,{callback:()=>a(Y.Axis.Row,!0)}),e.updateCommand(`deleteColumns`,{callback:()=>a(Y.Axis.Column,!0)}),()=>{}}(e,n,r?.editModeHandler,r?.globalClipboard),M=Zb(e,n,i),N=function(e,t,n){e.updateCommand(`updateHyperlink`,{tags:[`noTransaction`],callback:()=>{let e={disabled:!yl(t),context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setHyperlink(e)},{description:C(`op.updateHyperlink`)})}};n?.showWindow?.(`hyperlink`,e)}}),e.updateCommand(`openHyperlink`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell().getHyperlink();if(e)try{await e.open()}catch(e){n?.showError?.(e)}}});let r=()=>{let n=t.getSelectedCell().getHyperlink(),r=!yl(t),i=Bb(!!n?.isReadOnly(),C(`reason.hyperlinkIsValue`));e.updateCommand(`updateHyperlink`,{disabledReasons:[...i,...Bb(r&&!n,C(`reason.sheetProtected`))]}),e.updateCommand(`deleteHyperlink`,{disabledReasons:[...i,...Bb(r,C(`reason.sheetProtected`))]});let a=t.getSelectedRanges().getCounts(`hyperlink`).hyperlink>0;e.updateCommand(`clearHyperlinks`,{disabledReasons:[...Bb(!t.getProtection().isFormatCellsAllowed(),C(`reason.sheetProtected`)),...Bb(!a,C(`reason.noHyperlinksSelected`))]})};r();let i=t.addListeners({onProtectionChange:r,onDataChange:r,onStyleChange:r,onInvalidated:r}),a=t.getSelection().addListeners({onChange:r});return()=>{i(),a()}}(e,n,i),P=function(e,t,n,r){e.updateCommand(`insertCheckbox`,{callback:()=>{t.getCellControls().add(t.getSelectedRanges(),{type:`checkbox`})}}),e.updateCommand(`insertCellControl`,{callback:e=>{let n=t.getSelectedRanges();e&&!Yn.get(e)&&Xn.get(e)?n.setValue({type:e}):t.getCellControls().add(n,{type:e||`checkbox`})}});let i=()=>{let n=Bb(!t.getProtection().isFormatCellsAllowed(),C(`reason.sheetProtected`));e.updateCommand(`insertCheckbox`,{disabledReasons:n}),e.updateCommand(`insertCellControl`,{disabledReasons:n})};i();let a=t.addListeners({onProtectionChange:i});e.updateCommand(kd.CellControl,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Yd(),n?.(kd.CellControl)}});let o=()=>{e.updateCommand(kd.CellControl,{state:r?.getActive()===kd.CellControl})};o();let s=r?.addListener({onChange:o});return()=>{a(),s?.()}}(e,n,r?.activateTaskPane,r?.taskPaneArea),F=Qb(e,n,r?.activateTaskPane,r?.taskPaneArea),I=function(e,t,n,r){let i=e=>{let t=e;if(typeof t!=`string`){console.warn(e);let n=typeof e?.cause==`string`?e.cause:``,r=typeof e?.message==`string`?e.message:``;n&&(r=r?`${r} (${n})`:n),t=j(`error.insertImage.unresolved`,{detail:r})}n?.showMessage?.(t,{type:Te.Error})},a=async(e,a,o=C(`op.insertImage`))=>{let s=await Promise.resolve(n?.showBusy?.(j(o))??null);try{await t.getMovables().addPicture(e,{autoSelect:!0,...a}),s?.(),r?.setMode(null)}catch(e){s?.(),i(e)}},o=async e=>{let a=C(`op.insertImage`),o=t.getSelectedCell().getRange(),s=`resource:${g.uuidV4()}`,c=await Promise.resolve(n?.showBusy?.(j(a))??null),l;try{l=t.getResources().add({...e,fetchedFrom:s});let n=await l.toBuffer(),{asUrl:r}=await b.loadImageDetails(n,(await l.getType())?.mime);URL.revokeObjectURL(r)}catch(e){c?.(),i(e);return}c?.(),o.setValue(new nr(s,{resource:l}),{description:a}),r?.setMode(null)},s=async()=>{let e=await n?.showInput?.({title:j(`dialog.insertImage.title`),description:j(`dialog.insertImage.description`),inputLabel:j(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>j(`dialog.insert`)}]});return e?.option===`Insert`?e.input:void 0};e.updateCommand(`insertImageFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=null,n=null;if(typeof e==`string`?n=e:t=e?.file?e.file:e??null,!t&&(t=await p.openFileDialog(n??`image/*`),!t))return;let r=await Promise.resolve(t);await a({source:{file:r}},e?.options)}}),e.updateCommand(`insertImageFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e||await s();t&&await a({source:{fetch:t}})}}),e.updateCommand(`insertImageInCellFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e??await p.openFileDialog(`image/*`);t&&await o({source:{file:t}})}}),e.updateCommand(`insertImageInCellFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=e||await s();t&&await o({source:{fetch:t}})}});let c=async e=>{let r=await Promise.resolve(n?.showBusy?.(j(C(`op.setPicture`)))??null);try{let n=t.getResources().add(e);await n.toBuffer(),t.setPicture(n),r?.()}catch(e){r?.(),i(e)}},l=async e=>{let t=null,n=null;typeof e==`string`?n=e:t=e??null,(t||(t=await p.openFileDialog(n??`image/*`),t))&&await c({source:{file:await Promise.resolve(t)}})};e.updateCommand(`sheetBackgroundFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{await l(e)}}),e.updateCommand(`sheetBackgroundFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{if(!e){let t=await n?.showInput?.({title:j(`dialog.sheetBackground.title`),description:j(`dialog.sheetBackground.description`),inputLabel:j(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>j(`dialog.insert`)}]});if(!t||t.option!==`Insert`)return;e=t.input}e&&await c({source:{fetch:e}})}}),e.updateCommand(`sheetBackgroundDelete`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.setPicture(null)}}),e.updateCommand(`sheetBackgroundToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{t.getPicture()?t.setPicture(null):await l()}}),e.updateCommand(`insertChart`,{tags:[`noTransaction`],callback:async e=>{let n=typeof e==`string`?e:e?.type;await t.getCharts().add(t.getSelection().getRanges(),{type:n,autoSelect:!0}),r?.setMode(null)}});let u=async(e=`line`)=>{let r=t.getSelectedRanges(),i=null;if(r.getCount()===1){let e=r.at(0).getCoords(),n=e.colStart===e.colEnd&&e.rowStart!==e.rowEnd?{rowStart:e.rowEnd+1,rowEnd:e.rowEnd+1,colStart:e.colStart,colEnd:e.colStart}:{rowStart:e.rowStart,rowEnd:e.rowEnd,colStart:e.colEnd+1,colEnd:e.colEnd+1},a=t.getEntireCoords();n.rowEnd<=a.rowEnd&&n.colEnd<=a.colEnd&&(i=t.getRanges(n).getFixed(!0))}let a={data:r.getFixed(!0),location:i,type:e},o=async e=>{if(!e?.data||!e.location)return;let n=e.location.at(0),{rowStart:r,rowEnd:i,colStart:a,colEnd:o}=n.getCoords(),s=n.getWorksheet().getRange({rowStart:r,rowEnd:i,colStart:a,colEnd:o});await t.doBatch(async()=>{s.setSparkline(e.data.at(0),{type:e.type}),await s.select()},{description:C(`op.insertSparklines`)})};if(!n?.showWindow){if(r.getCount()!==1)throw new k(j(`error.sparkline.union`));await o(a);return}let s={initialValue:a,onInput:e=>{o(e??null).catch(e=>{n?.showMessage?.(e?.message??String(e),{type:Te.Error})})}};n.showWindow(`sparklineNew`,s)};e.updateCommand(`insertSparkline`,{tags:[`noTransaction`],callback:e=>u(e)});for(let[t,n]of[[`insertSparklineLine`,`line`],[`insertSparklineColumn`,`column`],[`insertSparklineWinLoss`,`winLoss`]])e.updateCommand(t,{tags:[`noTransaction`],callback:()=>u(n)});e.updateCommand(`insertShape`,{tags:[`noTransaction`],callback:async e=>{let n=typeof e==`object`&&e?e:Kg(e??`rect`),i=Cn.withThemeDefaults(n,t.getStyles().getTheme());await t.getMovables().add({type:`shape`,json:i,bounds:{width:96,height:96},autoPlace:`viewport`,autoSelect:!0}),r?.setMode(null)}});let d=()=>{e.updateCommand(`sheetBackgroundToggle`,{state:!!t.getPicture()})};d();let f=t.addListeners({onStyleChange:d,onInvalidated:d});return()=>{f()}}(e,n,i,r?.editModeHandler),L=$b(e,n,i,r?.activateTaskPane,r?.taskPaneArea),R=ex(e,n,i,r?.activateTaskPane,r?.taskPaneArea);return()=>{h(),_(),v(),y(),x(),S(),T(),E(),D(),O(),A(),M(),N(),P(),F(),I(),L(),R()}}var{CommandScopeProvider:nx}=G;vf();var rx={dynamic:(e,t)=>{let n=tx(e,t),r=t.editable&&t.sheet?Ms(e,{editable:t.editable,sheet:t.sheet,flavor:`startEdit`}):void 0,i=t.ownsUndo?Yf(e,{manager:t.manager??null,notifier:t.notifier}):void 0;return()=>{n(),r?.(),i?.()}}},ix=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>G.useCommandScope()?(0,Z.jsx)(ax,{sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a}):(0,Z.jsx)(Z.Fragment,{children:a}),ax=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>{let o=he(),s=Ud(),c=ue(),l=Ie(),u=Zf(),[d,f]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(u||!e)return void f(null);let t=new ur(e.getTransactions());return f(t),()=>t.close()},[u,e]);let p=u??d,m=!u&&!!d,h=(0,X.useMemo)(()=>({serializer:{parse:t=>t?e?.getStyles().parseColor(t)??null:null,stringify:e=>e?e.toString():``}}),[e]),[g,_]=P(`sheet.lastFillColor`,e?.getStyles().parseColor(Dn.Scheme.Bg2),h),[v,y]=P(`sheet.lastFontColor`,e?.getStyles().parseColor(e?.getStyles().getNormal().getFont().getColor()),h),[b,x]=P(`sheet.lastBorder`,null),S=(0,X.useRef)(g);S.current=g;let C=(0,X.useRef)(v);C.current=v;let w=(0,X.useRef)(b);w.current=b;let T=(0,X.useMemo)(()=>({getLastFillColor:()=>S.current,setLastFillColor:_,getLastFontColor:()=>C.current,setLastFontColor:y,getLastBorder:()=>w.current,setLastBorder:x}),[_,y,x]),E=(0,X.useMemo)(()=>({scopeName:`sheet`,contributor:rx,data:{sheet:e,editable:t,ownsUndo:m,notifier:o,manager:p??void 0,activateTaskPane:(e,t)=>s.activate(e,t),taskPaneArea:s,editModeHandler:c,globalClipboard:l,pickerMemory:T,viewport:i}}),[e,t,m,o,p,s,c,l,T,i]);return(0,Z.jsx)(nx,{spec:E,scopeRef:n,elementRef:r,children:(0,Z.jsx)(Xf.Provider,{value:p,children:a})})};ax.displayName=`SheetCommandProviderInner`;var ox=`_loading-panel_bjv3h_1`,sx=`_loading-spinner_bjv3h_10`,cx=e=>{let{transitionDelay:t,transparentBackground:n,onMount:r,onUnmount:i,className:a,style:o,...s}=e;return(0,Z.jsx)(`div`,{className:Q(ox,a),style:{background:n?`transparent`:`var(--sxl-color-base-100, #fff)`,...o},...s,children:(0,Z.jsx)(`div`,{className:sx})})},lx=e=>{let{error:t,style:n,...r}=e;return(0,Z.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,textAlign:`center`,boxSizing:`border-box`,...n},...r,children:t instanceof Error?t.message:String(t)})},ux=`_sheetxl-sheet_zorxx_5`,dx=`_viewport-overlay_zorxx_6`,fx=(0,X.memo)(e=>{let t=ue();return(0,Z.jsx)(Et,{...e,dismiss:t.getMode()?.key===`edit`})});fx.displayName=`SheetRangeTooltipHost`;var px=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i=xe.EmptyCssProperties,ref:a,colorScheme:s,gridColorScheme:l,onSheetContextMenu:d,onFillMenu:f,showColumnHeaders:m,propsColumnHeader:h,showRowHeaders:g,propsRowHeader:v,showScrollbars:y=!0,showCellErrors:b=!0,showCircularReferences:x=!0,propsScrollPane:S,viewport:C,onViewportChange:T,layers:E,renderMovable:D=yd,renderCommentCard:O,renderHyperlinkCard:k,propsHyperlink:A,renderCellErrorTip:j,renderValidationPrompt:M,renderValidationAlert:N,renderTableToolbar:P,renderPivotToolbar:F,propsOutline:I,viewportComponent:L,onFirstRender:R,editable:ee,onFocus:te,onBlur:z,propsGrid:B,propsCellRender:V,children:H,...ne}=e;if((0,X.useEffect)(()=>{Kn._validate(!0)},[]),!n)throw Error(`IWorksheet must be provided.`);let[W,re]=(0,X.useReducer)(e=>e+1,0),[,ie]=(0,X.useReducer)(e=>e+1,0),ae=(0,X.useRef)(null),G=(0,X.useRef)(!1),oe=(0,X.useRef)(null),ce=(0,X.useRef)(null);(0,X.useMemo)(()=>{ce.current!==n&&(oe.current=n?n.getId():null),ce.current=n},[n]);let fe=Ye(l),pe=fe===`dark`,me=Ge();$r();let ge=(0,X.useId)(),_e=(0,X.useMemo)(()=>se(`sheet`,ge),[ge]),ve=(0,X.useMemo)(()=>Nt({scope:`.${_e}`}),[_e]),be=(0,X.useMemo)(()=>ri(`sxl-defaults`,`.${_e}`),[_e]),Se=n.getStyles(),we=Se.getTheme(),Te=Se.getDefaultFontSize(),Ee=(0,X.useMemo)(()=>{let e=Se.getNormal().measureText(``,Te,we.getFontScheme().getMinorFont()).lineHeight;return ai(we,Te,e,`sxl-defaults`,`.${_e}`)},[Se,we,Te,_e]),De=ue(),ke=(0,X.useCallback)(e=>{},[]),[je,Me]=(0,X.useState)(null),Pe=(0,X.useRef)(null),Fe=(0,X.useCallback)(e=>{e&&(Me(e),Pe.current=e)},[]),[Ie,Le]=(0,X.useState)(()=>n?.getView()),Re=(Ie?.getZoomScale()??100)/100,ze=m??Ie?.isShowColumnHeaders(),Be=g??Ie?.isShowRowHeaders(),[Ve,He]=(0,X.useState)({width:0,height:0}),We=Ve.width,Ke=Ve.height,qe=(0,X.useMemo)(()=>{let e=xx,t=bx,r=n?.getStyles().getNormal().getFont();if(Ve.width>0&&Ve.height>0){let n=r?.toCSS()?.fontFamily??`Calibri`,i=r?.getSize()??8.25,a=Jn.getShared().getByName(n).table.measure(``+Math.max(Ve.height,Sx),Math.ceil(i*gn.getDeviceScale()));e=a.width??e,t=(a.ascent??a.lineHeight)+(a.descent??0)}return{width:Math.round(e+2*Cx+1),height:Math.round(t+3)}},[We,Ke,n]),Xe=e=>({width:Be?e*qe.width:1,height:ze?e*qe.height:1}),{width:Ze,height:Qe}=Xe(Re),[,$e]=(0,X.useReducer)(e=>e+1,0);o(n?.getOutline(),{onOutlineChange:()=>$e()});let et=n?.getOutline(),[tt,nt]=(0,X.useState)(()=>n?.getView().isShowOutlineSymbols()??!1);(0,X.useLayoutEffect)(()=>{nt(n?.getView().isShowOutlineSymbols()??!1)},[n]),o(n?.getView(),{onAnyChange:()=>{nt(n.getView().isShowOutlineSymbols())}});let it=tt?et.getLevelCount(Y.Axis.Row):0,at=tt?et.getLevelCount(Y.Axis.Column):0,ot=e=>Math.round((I?.laneSize??wx)*e),st=ot(Re),ct=it>0?it+1:0,lt=at>0?at+1:0,dt=I?.laneGap??1,ft=e=>{let t=ot(e);return{width:ct>0?dt+ct*t:0,height:lt>0?dt+lt*t:0}},{width:pt,height:mt}=ft(Re),ht=e=>{let t=Xe(e),n=ft(e);return{left:t.width+n.width,top:t.height+n.height}},[gt]=xg(n.getColumnHeaders()),[_t]=xg(n.getRowHeaders()),vt=gt.getDefaultSize()+Ze+1,bt=_t.getDefaultSize()+Qe+1,xt=(0,X.useRef)(new Map),St=(0,X.useRef)(null),Ct=(0,X.useMemo)(()=>({getColOffset:e=>gt.getOffset(e),getColIndex:e=>gt.getIndex(e),getRowOffset:e=>_t.getOffset(e),getRowIndex:e=>_t.getIndex(e)}),[gt,_t]),[Tt,Et]=(0,X.useState)(!1),Dt=Ca(),Ot=(0,X.useMemo)(()=>Ia(n,{referenceMode:Dt}),[n.getWorkbook()??n,Dt]),kt=ee??Ot,At=he();(0,X.useEffect)(()=>kt.subscribeCommitError(e=>{At?.showError?.(e instanceof Error?e:String(e))}),[kt,At]),(0,X.useEffect)(()=>{if(!kt)return;let e=kt.getSession();return kt.subscribe(()=>{let t=e;if(e=kt.getSession(),!t||e||!t.getActiveEditorId()?.startsWith(`inline:`))return;let n=Pe.current;n?.contains(document.activeElement)&&n.focus()})},[kt]);let jt=Ae(kt,e=>e.getSession())?.getCoords()??null,[Mt,Pt]=(0,X.useState)();(0,X.useEffect)(()=>{if(n&&!n.isDeleted())return n.getEntireRange().addListener(()=>{cn.current.clear()})},[n]);let Ft=K(e=>{if(Pt(e),!n||oe.current)return;let t=(n.getView().getZoomScale()??100)/100;n.getView().setTopLeft(e?{left:e.left/t,top:e.top/t}:null),T?.(e)},[n,T]),[Lt,Rt]=(0,X.useState)(()=>n?.getView().getTopLeft()),zt=(0,X.useMemo)(()=>{let e=n?.getView().getTopLeft();return new Ne({topLeft:{left:(e?.left??0)*Re,top:(e?.top??0)*Re},zoom:Re})},[]),Bt=C??zt;(0,X.useEffect)(()=>Bt.subscribe(()=>{Bt.isReady()&&Bt.isSettled()&&(G.current?Bt.getScroll():Ft(Bt.getMetrics()))}),[Bt]);let Vt=(0,X.useRef)(Lt);Vt.current=Lt,(0,X.useLayoutEffect)(()=>{let e=Vt.current;Bt.setZoom(Re,(e?.left??0)*Re,(e?.top??0)*Re)},[Bt,Re]),(0,X.useLayoutEffect)(()=>{Lt?.left!=null&&Bt.setTarget(Lt.left*Re,Bt.getTarget().top)},[Bt,Lt?.left,Re]),(0,X.useLayoutEffect)(()=>{Lt?.top!=null&&Bt.setTarget(Bt.getTarget().left,Lt.top*Re)},[Bt,Lt?.top,Re]),(0,X.useLayoutEffect)(()=>{G.current=!1},[Re]);let Ht=(0,X.useRef)(n?.getId()??null);(0,X.useLayoutEffect)(()=>{let e=n?.getId();if(Ht.current===e)return;Ht.current=e;let t=n?.getView().getTopLeft(),r=(n?.getView().getZoomScale()??100)/100;Bt.setTarget((t?.left??0)*r,(t?.top??0)*r)},[Bt,n]);let Wt=K(e=>{let t=w.cellToRange(e);if(oe.current||n.isDeleted())return t;let r=n.getRange(t,{ignoreHidden:!0}).getMerges();return r.length===0?t:r[0]},[n]),Gt=e=>{let t=e?.coords?.colIndex??0,n=e?.coords?.rowIndex??0;if(!e||t===0&&n===0)return null;let r={};return t>0&&(r[_.Left]={index:t,offset:e.topLeft?.left??0}),n>0&&(r[_.Top]={index:n,offset:e.topLeft?.top??0}),r},[Kt,qt]=(0,X.useState)(()=>Gt(n.getView().getFreezePanes())),Jt=Is(n),Yt=K(()=>Mt,[Mt]),[Xt,Zt]=(0,X.useState)(!(Ie?.getMovableSelection().isEmpty()??1)),Qt=jt!==null||Xt,$t=(0,X.useMemo)(()=>{let e=De.getMode();return e?.cursor?e.cursor:null},[null,De]);o(n?.getView(),{onFreezePaneChange:()=>{qt(Gt(n.getView().getFreezePanes()))},onTopLeftChange:()=>{Rt(n.getView().getTopLeft())},onZoomScaleChange:()=>{cn.current.clear(),ie()},onMovableSelectionChange:()=>{Zt(!n.getView().getMovableSelection().isEmpty())}}),o(n,{onViewChange(){Le(n.getView())},onLayoutChange:()=>{let e=n.getEntireRange();He({height:e.getRowCount(),width:e.getColumnCount()}),tn()},onStyleChange:()=>{tn()},onMovablesChange:()=>{},onTablesChange:()=>{tn()},onInvalidated:()=>{tn()}}),o(n,{onRequestScrollIntoView:async(e,t)=>{if(!t)return!1;let n={colIndex:t?.coords?.colStart,rowIndex:t?.coords?.rowStart};return await Pe.current?.scrollCellCoordsIntoView(n,t?.scroll),!0},onRequestFocus:()=>p.whenFocus(en.current),onRequestViewport:async()=>{let e=Yt();return e?{x:e.left,y:e.top,width:e.width,height:e.height}:null}},vx);let en=Ue(t,()=>{let e=e=>{St.current=null,Pe.current?.focus(e)},t=async(e=null)=>{if(e||=n?.getView().getMovableSelection().getActive()??null,!e)return!1;let t=e.getRange().getCoords();if(!t)return!1;let r=Pe.current?.getPaneFromCell({colIndex:t.colStart,rowIndex:t.rowStart});if(!r)return!1;let i=r.getAnchor(),a=n?.getView().getMovableSelection();a&&!a.isSelected(e)&&a.select([e]);let o=xt.current?.get(i);return o?.current?(await o.current.focusMovable(e),!0):(St.current={movable:e,anchor:i},!0)};return{getGridSurface:()=>Pe.current,getRowHeaderElement:()=>yn.current,getColumnHeaderElement:()=>xn.current,focus:r=>{let i=kt.getSession(),a=i?.getCoords().scope;(!i||a&&a!==n.getName())&&(n?.getView().getMovableSelection().isEmpty()??1?e(r):t())},focusSheet:e,focusMovable:t,contains:e=>Pe.current?.contains?.(e)??!1,invalidate:tn,isSheetElement:()=>!0,getWorksheet:()=>n}},[n]),tn=(0,X.useCallback)(()=>{oe.current||(cn.current.clear(),Pe.current?.invalidate(),re?.())},[]),nn=(0,X.useMemo)(()=>L?(0,Z.jsx)(`div`,{className:Q(`sxl-viewport-overlay`,dx),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`},children:L}):(0,Z.jsx)(Z.Fragment,{}),[L]),rn=null;ze&&Be&&(rn=(0,Z.jsx)(Wg,{width:Ze,height:Qe,sheet:n,colorScheme:s,style:{gridColumn:`2 / 3`,gridRow:`2 / 3`},onMouseDown:e=>{e.nativeEvent.which===le.Right?d?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Pe.current?.focus()}}));let an=K(e=>{let t=n?.getView();if(!t)return;let r=t.getZoomScale(),i=Math.min(400,Math.max(10,Math.round(100*e.zoom)));e.phase===`end`&&Math.abs(i-100)<3&&(i=100);let a=e.panX??0,o=e.panY??0;if(i===r){if(a!==0||o!==0){let e=Bt.getTarget();Bt.setTarget(e.left-a,e.top-o)}return}let s=r/100,c=i/100,l=ae.current?.getBoundingClientRect(),u=l?Math.max(0,e.clientX-l.left):0,d=l?Math.max(0,e.clientY-l.top):0,f=t.getTopLeft(),p=ht(s),m=ht(c),h=t.getFreezePanes().coords,g=(h?.colIndex??0)>0,_=(h?.rowIndex??0)>0,v={left:Math.max(0,(f?.left??0)-a/c+(g?0:u/s-u/c+(m.left-p.left)/c)),top:Math.max(0,(f?.top??0)-o/c+(_?0:d/s-d/c+(m.top-p.top)/c))};e.phase,e.zoom,G.current=!0,t.setTopLeft(v),t.setZoomScale(i)},[n]);(0,X.useEffect)(()=>Bt.subscribeZoom(an),[Bt,an]),(0,X.useEffect)(()=>{Le(n.getView()),qt(Gt(n.getView().getFreezePanes())),cn.current.clear(),re()},[je,n?.getView()]);let on=(0,X.useCallback)((e,t)=>_t.hiddenHeadersAt(e,t),[_t]),sn=(0,X.useCallback)((e,t)=>gt.hiddenHeadersAt(e,t),[gt]),cn=(0,X.useRef)(new Map),ln=(0,X.useMemo)(()=>({entries:[]}),[n]),un=K((e,t)=>{if(oe.current)return[];let r=cn.current,i=t??e.getVisibleRange();if(!i)return[];let a=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,o=r.get(a);if(o)return o;let s=[];if(n.getRange(i).forEach((e,t)=>{let n=t.getCoords(),r=t.getCell();if(!(e=>{if(e.isEmpty())return!1;let t=e.getSpans();if(t.width>1||t.height>1||e.getStyle().hasVisibleStyling()||Ie.isShowFormulas()&&e.getFormula()!==null)return!0;let n=e.getValue();return n!==null&&!(!Ie.isShowZeros()&&n===0&&e.getType()===An.Number)})(r))return;let i;Ie.isShowFormulas()||(i=r.getExtrusions()??void 0),s.push({cell:n,value:r,range:i})},yx),r.set(a,s),r.size>12){let e=r.keys().next().value;e!==void 0&&r.delete(e)}return s},[n,Ie.isShowZeros(),Ie.isShowFormulas()]),dn=(0,X.useMemo)(()=>It(),[]),fn=yt(dn,ig(Y.Axis.Column),!1),pn=yt(dn,ig(Y.Axis.Row),!1),mn=(0,X.useMemo)(()=>({...Ce(`app`,me),propsPath:Ex}),[me]),hn=(0,X.useMemo)(()=>({...Ce(`app`,me),propsPath:Dx}),[me]),_n=fn?hn:mn,vn=pn?hn:mn,yn=(0,X.useRef)(null),bn=(0,X.useMemo)(()=>(0,Z.jsx)(zg,{ref:yn,tabIndex:-1,freezeStart:Kt?.[_.Top],oppositeSize:Ze,sheetHeader:n.getRowHeaders(),colorScheme:s,propsCellRender:V,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),viewport:Bt,onSheetContextMenu:d,onFocus:()=>{Pe.current?.focus()},style:{position:`relative`,flex:`0`,gridColumn:`2 / 3`,gridRow:`3 / 4`,zIndex:1}}),[Ze,Qe,n,V,Bt,Kt?.[_.Top],d,v,je]),xn=(0,X.useRef)(null),Sn=(0,X.useMemo)(()=>(0,Z.jsx)(zg,{ref:xn,tabIndex:-1,freezeStart:Kt?.[_.Left],oppositeSize:Qe,sheetHeader:n.getColumnHeaders(),colorScheme:s,propsCellRender:V,viewport:Bt,onSheetContextMenu:d,onFocus:()=>{Pe.current?.focus()},style:{position:`relative`,display:`flex`,gridColumn:`3 / 4`,gridRow:`2 / 3`,zIndex:1}}),[Qe,n,V,Bt,Kt?.[_.Left],d,h,je]),Cn=xh(),J=Th(n,`cells`,Cn),wn=(0,X.useMemo)(()=>{let e=n.getId();return[(0,Z.jsx)(Hs,{sheet:n,editable:kt,onEditRejected:Jt},`editor-start-[${e}]`),(0,Z.jsx)(Us,{editable:kt},`virtual-keyboard-[${e}]`),(0,Z.jsx)(_g,{sheet:n,onSheetContextMenu:d},`context-menu-[${e}]`),(0,Z.jsx)(Qu,{sheet:n},`background-[${e}]`),(0,Z.jsx)(Ju,{sheet:n,sheetView:Ie,getVisibleCells:un,bordersCache:ln},`gridlines-[${e}]`),(0,Z.jsx)(Cc,{getVisibleCells:un,sheet:n},`fills-[${e}]`),(0,Z.jsx)(sm,{sheet:n},`conditional-bars-[${e}]`),(0,Z.jsx)(Hl,{sheet:n,sheetView:Ie,propsCellRender:V,editable:kt,onEditRejected:Jt},`cells-[${e}]`),(0,Z.jsx)(ym,{sheet:n,darkMode:pe},`sparklines-[${e}]`),(0,Z.jsx)(Vl,{getVisibleCells:un,bordersCache:ln,sheet:n},`cell-borders-[${e}]`),(0,Z.jsx)(um,{sheet:n},`conditional-icons-[${e}]`),(0,Z.jsx)(Ep,{sheet:n},`spill-[${e}]`),(0,Z.jsx)(Fm,{sheet:n},`cell-indicators-[${e}]`),(0,Z.jsx)(Uh,{sheet:n,sheetView:Ie},`locked-hatch-[${e}]`),x?(0,Z.jsx)(jm,{sheet:n},`circular-[${e}]`):null,(0,Z.jsx)(Ou,{sheet:n},`pivot-frame-[${e}]`),(0,Z.jsx)(Zs,{sheet:n,onFillMenu:f},`selection-[${e}]`),(0,Z.jsx)(Jf,{sheet:n,renderToolbar:P},`table-[${e}]`),(0,Z.jsx)(ip,{sheet:n},`table-commands-[${e}]`),(0,Z.jsx)(gp,{sheet:n},`sparkline-commands-[${e}]`),(0,Z.jsx)(Tp,{sheet:n},`pivot-commands-[${e}]`),(0,Z.jsx)(sc,{sheet:n,sheetView:Ie,className:`sxl-references`},`ref-picker-[${e}]`),(0,Z.jsx)(Mg,{sheet:n},`clipboard-[${e}]`),(0,Z.jsx)(Ul,{sheet:n,onColumnButtonMouseDown:V?.onColumnButtonMouseDown,propsColumnButton:V?.propsColumnButton,renderColumnButton:V?.renderColumnButton},`column-buttons-[${e}]`),(0,Z.jsx)(Du,{sheet:n,onPivotButtonMouseDown:V?.onPivotButtonMouseDown},`pivot-controls-[${e}]`),(0,Z.jsx)(Wu,{sheet:n,renderToolbar:F},`pivot-toolbar-[${e}]`),(0,Z.jsx)(xm,{sheet:n},`validation-[${e}]`),(0,Z.jsx)(nl,{sheet:n,editable:kt,renderPrompt:M,renderAlert:N},`validation-prompt-[${e}]`),(0,Z.jsx)(Em,{sheet:n,editable:kt},`validation-dropdown-[${e}]`),(0,Z.jsx)(ih,{sheet:n},`comments-[${e}]`),O?(0,Z.jsx)(mh,{sheet:n,renderCard:O},`comment-card-[${e}]`):null,(0,Z.jsx)(Mf,{sheet:n,renderMovable:D},`movable-[${e}]`),(0,Z.jsx)(q,{className:`sxl-grid-border`,children:(0,Z.jsx)(ut,{fill:!0,className:`sxl-grid-border-box`,...Ce(`app`,me),style:Ox})},`grid-border-[${e}]`),(0,Z.jsx)(Bs,{sheet:n,editable:kt,darkMode:pe},`editor-[${e}]`),b?(0,Z.jsx)(vl,{className:`sxl-errors`,sheet:n,renderTip:j},`cell-errors-[${e}]`):null,(0,Z.jsx)(El,{sheet:n,renderCard:k,...A},`hyperlink-card-[${e}]`),(0,Z.jsx)(ng,{sheet:n},`resize-indicator-[${e}]`),(0,Z.jsx)(mg,{sheet:n},`freeze-grip-[${e}]`),E,...J,(0,Z.jsx)(fx,{},`range-tooltips-[${e}]`)]},[n,Se,D,O,k,A,j,M,N,P,F,d,f,E,J,kt,b,x,Ie,pe,me,un,ln,V,Jt]),Tn=(0,X.useCallback)((e,t)=>(0,Z.jsx)(pf,{pane:e,children:t}),[]),[En,Dn]=(0,X.useState)(!1),On=(0,X.useMemo)(()=>{let e=n.getStyles().getNormal(),t=e.getFont(),r=e.getFill();return(0,Z.jsx)(gh,{value:`cells`,children:(0,Z.jsx)(rt,{className:`sheetxl-sheet-primary`,wrapPane:Tn,style:{..._x,cursor:$t??null??`cell`,...r.toCSS(`adaptive`),...t.toCSS(`adaptive`,Re),minWidth:vt,minHeight:bt},ref:Fe,...B,onFirstRender:e=>{Dn(!0),B?.onFirstRender?.(e)},freezeLeft:Kt?.[_.Left],propsFreezeLeft:_n,freezeTop:Kt?.[_.Top],propsFreezeTop:vn,columnCount:Ve.width,rowCount:Ve.height,metrics:Ct,getRangeFromCell:Wt,hiddenRowsAt:on,hiddenColumnsAt:sn,viewport:Bt,children:wn},`grid-main`)})},[We,Ke,$t,null,vt,bt,W,wn,_n,vn]);(0,X.useEffect)(()=>{oe.current||cn.current.clear()},[Kt,Re,B,vt,bt,$t,wn,null]),(0,X.useEffect)(()=>{oe.current||re()},[Kt,Re,Lt?.left,Lt?.top,B,vt,bt,$t,wn,null]);let kn=gx;y||(kn={...kn,...i});let jn=pe?`dark`:`light`,Mn=K(e=>{let{style:t,...r}=e;return(0,Z.jsx)(Ig,{...r,style:{...t,paddingLeft:`4px`,paddingRight:`4px`},sheet:n})},[n]),Nn=(0,X.useMemo)(()=>{let{renderButton:e,renderLevelButton:t,laneSize:r,laneGap:i,bracketGap:a,style:o,...s}=I??{},c=(e,t)=>({...o,gridColumn:e,gridRow:t,position:`relative`}),l=[];return ct>0&&(l.push((0,Z.jsx)(Bg,{...s,sheet:n,axis:Y.Axis.Row,lanes:ct,thickness:pt,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Kt?.[_.Top],viewport:Bt,colorScheme:me,style:c(`1 / 2`,`3 / 4`)},`outline-row`)),ze&&l.push((0,Z.jsx)(Vg,{...s,sheet:n,axis:Y.Axis.Row,lanes:ct,laneSize:st,laneGap:i,renderLevelButton:t,colorScheme:me,style:c(`1 / 2`,`2 / 3`)},`outline-row-levels`))),lt>0&&(l.push((0,Z.jsx)(Bg,{...s,sheet:n,axis:Y.Axis.Column,lanes:lt,thickness:mt,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Kt?.[_.Left],viewport:Bt,colorScheme:me,style:c(`3 / 4`,`1 / 2`)},`outline-column`)),Be&&l.push((0,Z.jsx)(Vg,{...s,sheet:n,axis:Y.Axis.Column,lanes:lt,laneSize:st,laneGap:i,renderLevelButton:t,colorScheme:me,style:c(`2 / 3`,`1 / 2`)},`outline-column-levels`))),l},[n,ct,lt,pt,mt,st,Kt?.[_.Top],Kt?.[_.Left],Bt,me,I,Be,ze]),Pn=(0,Z.jsxs)(`div`,{...Ce(`grid`,jn),style:{gridColumn:`3 / 4`,gridRow:`3 / 4`,overflow:`hidden`,position:`relative`},ref:ae,children:[On,nn,(0,Z.jsx)(bg,{style:{position:`absolute`,right:24,bottom:4},colorLicensee:`var(--sxl-color-primary)`,colorCredits:`var(--sxl-color-base-content)`})]}),Fn=u([en,ke]),In=(0,Z.jsxs)(`div`,{className:_e,style:kn,onTouchStart:()=>{zn()},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(Et(!0),te?.(e))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(Et(!1),z?.(e))},ref:Fn,...ne,children:[(0,Z.jsx)(U,{css:ve}),(0,Z.jsx)(U,{css:be}),(0,Z.jsx)(U,{css:Ee}),(0,Z.jsx)(`div`,{className:Q(r,`sheetxl-sheet`,ux),ref:a,...Ce(`grid`,jn),style:{position:`absolute`,width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`auto auto 1fr`,gridTemplateRows:`auto auto 1fr`,flex:`1 1 100%`},children:(0,Z.jsx)(Ut,{store:dn,children:(0,Z.jsxs)(Sh,{value:Cn,children:[H,Nn,rn,Sn,bn,Pn]})})})]});y&&(In=(0,Z.jsx)(Oe,{style:{flex:`1 1 100%`,width:`100%`,height:`100%`,overflow:`hidden`,background:`var(--sxl-color-base-100)`,minHeight:2*qe.height,minWidth:2*qe.width,...i},viewport:Bt,disableTouch:Qt,zoomable:!0,renderScrollbarHorizontal:Mn,renderScrollbarVertical:Mn,...S,children:In})),(0,X.useEffect)(()=>{oe.current=null,cn.current.clear(),re?.(),Tt&&en.current?.focus()},[n]);let[Ln,Rn]=(0,X.useState)(!1),zn=K(()=>{Ln||Rn(!0)},[Ln]);return(0,X.useEffect)(()=>{if(En)return typeof R==`function`&&R(),xe.detectIt().primaryInput===`touch`&&zn(),()=>{}},[R,En,Ln]),(0,Z.jsx)(ix,{sheet:n,editable:ee,elementRef:en,viewport:Bt,children:(0,Z.jsx)(Je.Provider,{value:fe,children:(0,Z.jsx)(ye,{themeScopeClass:_e,themeSurface:`app`,themeMode:s,children:(0,Z.jsx)(wt,{children:(0,Z.jsx)(c,{sheet:n,children:(0,Z.jsx)(de,{scope:n.getWorkbook(),children:In})})})})})})}));px.displayName=`WorksheetElementBody`;var mx=e=>{let[t,n]=(0,X.useState)(()=>g.isPromiseLike(e)||Jn.getShared().isLoading()?{status:`loading`}:{status:`loaded`,sheet:e});return(0,X.useEffect)(()=>{let t=!0;return(async()=>{try{let r=await e;if(await Jn.getShared().whenReady(),!t)return;n(e=>e.status===`loaded`&&e.sheet===r?e:{status:`loaded`,sheet:r})}catch(e){t&&n({status:`error`,error:e})}})(),()=>{t=!1}},[e]),t},hx=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetChange:r,propsSheetLoading:i,renderSheetLoading:a=cx,renderSheetError:o=lx,...s}=e,c=mx(n),l=c.status===`loaded`?c.sheet:null,u=K(r??(()=>{}),[r]);return(0,X.useEffect)(()=>{u(l)},[l]),l?(0,Z.jsx)(Df,{children:(0,Z.jsx)(px,{...s,sheet:l,ref:t})}):(0,Z.jsx)(`div`,{className:e.className,style:{position:`relative`,...e.style},children:c.status===`error`?(0,Z.jsx)(ae,{render:o,props:{error:c.error}}):(0,Z.jsx)(ae,{render:a,props:{...i}})})}));hx.displayName=`WorksheetElement`;var gx=Object.freeze({flex:`1 1 100%`,width:`100%`,height:`100%`,minWidth:0,minHeight:0,display:`flex`,alignContent:`stretch`,position:`relative`}),_x={position:`absolute`,top:0,left:0,bottom:0,right:0},vx={ignoreModelChange:!0},yx={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:pc},bx=20,xx=40,Sx=100,Cx=4,wx=18,Tx=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,Ex={stroke:`var(--sxl-color-base-border, grey)`},Dx={stroke:`var(--sxl-color-primary)`,strokeWidth:`2px`},Ox={pointerEvents:`none`,borderTop:Tx,borderLeft:Tx,borderRight:Tx,borderBottom:`none`},kx=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),Ax=(0,X.memo)(e=>{let{kind:t,style:n,className:r}=e;return t===`chart`?(0,Z.jsx)(kx,{className:r,style:{width:`1em`,height:`1em`,...n}}):t===`macro`?(0,Z.jsx)(M,{iconKey:`ScriptMacro`,className:r,style:n}):t===`dialog`?(0,Z.jsx)(M,{iconKey:`ValidationInformation`,className:r,style:n}):null});Ax.displayName=`SheetKindIcon`;var jx=(0,X.memo)(e=>{let{sheet:t,onFirstRender:n,style:r,...i}=e,a=je(),[,s]=X.useReducer(e=>e+1,0);o(t,{onNameChange:s}),(0,X.useEffect)(()=>{n?.()},[]);let c=t.getKind(),l=a(c===`chart`?`opaqueSheet.kind.chart`:c===`macro`?`opaqueSheet.kind.macro`:`opaqueSheet.kind.dialog`);return(0,Z.jsxs)(`div`,{role:`region`,"aria-label":t.getName(),style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:`8px`,flex:`1 1 100%`,padding:`24px`,boxSizing:`border-box`,textAlign:`center`,background:`var(--sxl-color-base-100, #fff)`,color:`var(--sxl-color-base-content, inherit)`,...r},...i,children:[(0,Z.jsx)(Ax,{kind:c,style:{width:`48px`,height:`48px`,fontSize:`48px`}}),(0,Z.jsx)(`div`,{style:{fontWeight:600},children:t.getName()}),(0,Z.jsx)(`div`,{children:l}),(0,Z.jsx)(`div`,{style:{opacity:.7,maxWidth:`40em`},children:a(`opaqueSheet.carried`)})]})});jx.displayName=`OpaqueSheetElement`;var Mx=Object.freeze([]),Nx=(e,t)=>t.walk-e.walk||e.index-t.index,Px=e=>e!==`working`,Fx=e=>{let t=e.lastIndexOf(`!`);if(t<0)return``;let n=e.slice(0,t);return n.startsWith(`'`)&&n.endsWith(`'`)?n.slice(1,-1).replace(/''/g,`'`):n},Ix=class{constructor(e){this.workbook=e,this._byId=new Map,this._anchors=new Map,this._listeners=new Set,this._walkSeq=0,this._version=0,this._currentId=null,this._lastId=null,this._hoveredId=null,this._state=null}getState(){if(this._state)return this._state;let e=this._byId.size?Object.freeze([...this._byId.values()].sort(Nx)):Mx,t=e.length?Object.freeze(e.filter(e=>e.status===`open`&&Px(e.intent))):Mx,n=this._currentId?t.findIndex(e=>e.id===this._currentId):-1,r=this._hoveredId?this._byId.get(this._hoveredId)??null:null;return this._state=Object.freeze({annotations:e,navigable:t,current:n>=0?t[n]:null,position:n+1,hovered:r?.status===`open`?r:null,version:this._version}),this._state}get(e){return this._byId.get(e)??null}add(e,t,n){let r=n?.replace??e===`working`,i=n?.source,a=r?this._removeWhere(t=>t.intent===e&&t.source===i):Mx;if(t.length===0)return this._changed({type:`added`,annotations:Mx,replaced:a}),[];let o=++this._walkSeq,s=Date.now(),c=[];return t.forEach((t,r)=>{let i=`${o}:${r}`,a=((e,t,n)=>{let r;try{r=e.getRange(t)}catch{return null}let i={sheet:r.getWorksheet().getName(),range:r.getAddress()},a=i,o=e=>{e?.range===i?.range&&e?.sheet===i?.sheet||(i=e,n(e))},s=r.addListener(e=>{let t=e.getSource();t.isInvalid()?o(null):o({sheet:t.getWorksheet().getName(),range:t.getAddress()})},{ignoreDataChanges:!0}),c=!1;return{initial:a,remove(){c||(c=!0,s())}}})(this.workbook,t.range,e=>this._move(i,e)),l={id:i,intent:e,source:n?.source,sheet:a?.initial.sheet??Fx(t.range),range:a?.initial.range??t.range,label:t.label,walk:o,index:r,createdAt:s,status:a?`open`:`stale`};this._byId.set(i,l),a&&this._anchors.set(i,a),c.push(l)}),this._changed({type:`added`,annotations:Object.freeze([...c]),replaced:a}),c}remove(e){let t=this.getState().navigable,[n]=this._removeWhere(t=>t.id===e);if(!n)return!1;if(this._currentId===e){let n=t.findIndex(t=>t.id===e),r=t.filter(t=>t.id!==e);this._currentId=r.length===0?null:r[n<0||n>=r.length?0:n].id,this._lastId=this._currentId}return this._changed({type:`dismissed`,annotation:n}),!0}clear(e){let t=this._removeWhere(e);return t.length&&(this._currentId&&!this._byId.has(this._currentId)&&(this._currentId=null),this._changed({type:`cleared`,annotations:t})),t.length}setCurrent(e){if(e!==null){let t=this._byId.get(e);if(!t||t.status!==`open`||!Px(t.intent))return}e!==this._currentId&&(this._currentId=e,e!==null&&(this._lastId=e),this._changed({type:`current`,annotation:e===null?null:this._byId.get(e)??null}))}getCurrentId(){return this._currentId}getWalkId(){return this._currentId??this._lastId}setHovered(e){e===null||this._byId.has(e)||(e=null),e!==this._hoveredId&&(this._hoveredId=e,this._changed({type:`hovered`,annotation:e===null?null:this._byId.get(e)??null}))}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}_move(e,t){let n=this._byId.get(e);if(!n)return;let r=t?{...n,sheet:t.sheet,range:t.range,status:`open`}:{...n,status:`stale`};this._byId.set(e,r),this._changed({type:`moved`,annotation:r})}_removeWhere(e){let t=[];for(let[n,r]of this._byId)e(r)&&(this._byId.delete(n),this._anchors.get(n)?.remove(),this._anchors.delete(n),this._hoveredId===n&&(this._hoveredId=null),t.push(r));return t.length?Object.freeze(t.sort(Nx)):Mx}_changed(e){this._version++,this._state=null;for(let t of[...this._listeners])t(e)}},Lx=new WeakMap,Rx=e=>{let t=Lx.get(e);return t||(t=new Ix(e),Lx.set(e,t)),t},zx=Object.freeze({annotations:Mx,navigable:Mx,current:null,position:0,hovered:null,version:0}),Bx=e=>Lx.get(e)?.getState()??zx,Vx=(e,t)=>Lx.get(e)?.remove(t)??!1,Hx=async(e,t)=>{let n=Lx.get(e)?.get(t);if(n&&n.status===`open`)try{let t=e.getRange(n.range),r=t.getWorksheet();r!==e.getSelectedWorksheet()&&await r.select();let i=t.getCoords();await r.scrollTo({rowStart:i.rowStart,rowEnd:i.rowEnd,colStart:i.colStart,colEnd:i.colEnd},{})}catch{}},Ux=(e,t)=>{let n=Lx.get(e);n&&(n.setCurrent(t),t!==null&&n.getCurrentId()===t&&Hx(e,t))},Wx=(e,t,n)=>{let r=Lx.get(e);if(!r)return;let i=r.getState().navigable;if(i.length===0)return;let a=t??r.getWalkId(),o=a?i.findIndex(e=>e.id===a):-1;Ux(e,(n===1?i[(o+1)%i.length]:i[o<=0?i.length-1:o-1]).id)},Gx=(e,t)=>{Lx.get(e)?.setHovered(t)},Kx=(e,t)=>{let n=Lx.get(e);n&&n.getState().hovered?.id===t&&n.setHovered(null)},qx=(e,t)=>Wx(e,t,1),Jx=(e,t)=>Wx(e,t,-1),Yx=(e,t)=>Rx(e).subscribe(t),Xx=e=>(0,X.useSyncExternalStore)(t=>e?Yx(e,t):()=>{},()=>e?Bx(e):zx,()=>zx),Zx={tag:`_tag_12081_17`,pointer:`_pointer_12081_38`,settled:`_settled_12081_50`,leftOf:`_leftOf_12081_66`,badge:`_badge_12081_67`,rightOf:`_rightOf_12081_71`,edgeTop:`_edgeTop_12081_76`,edgeBottom:`_edgeBottom_12081_77`,edgeLeft:`_edgeLeft_12081_78`,edgeRight:`_edgeRight_12081_79`,expanded:`_expanded_12081_104`,num:`_num_12081_112`,dot:`_dot_12081_125`,breathe:`_breathe_12081_1`,more:`_more_12081_140`,card:`_card_12081_153`,cardHead:`_cardHead_12081_188`,place:`_place_12081_196`,total:`_total_12081_208`,address:`_address_12081_219`,controls:`_controls_12081_234`,button:`_button_12081_241`,label:`_label_12081_264`},Qx={t:Zx.edgeTop,b:Zx.edgeBottom,l:Zx.edgeLeft,r:Zx.edgeRight},$x={t:{ux:0,uy:-1},b:{ux:0,uy:1},l:{ux:-1,uy:0},r:{ux:1,uy:0}},eS={t:`b`,b:`t`,l:`r`,r:`l`},tS=e=>{let t=e- -130;return t>180&&(t-=360),Math.round(t)},nS=(e,t)=>Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)),rS=e=>{let t=e.bounds,n=e.pane?.getElement()?.getBoundingClientRect();return t&&n?{left:n.left+t.x,top:n.top+t.y,right:n.left+t.x+t.width,bottom:n.top+t.y+t.height}:null},iS=(e,t,n)=>Math.min(Math.max(e,t),n),aS=(e,t)=>{if(t.onCorner)return{ux:t.side===`left`?1:-1,uy:t.flipped?-1:1};if(t.toward&&!e.outOfView)return $x[t.toward];let n=rS(e);if(n){let t=e.getBoundaryRect(),r=iS(e.anchorPoint.x,t.left,t.right),i=iS(e.anchorPoint.y,t.top,t.bottom),a=iS(r,n.left,n.right)-r,o=iS(i,n.top,n.bottom)-i,s=Math.hypot(a,o);if(s>.5){let e=Math.abs(a/s)<.3?0:a,t=Math.abs(o/s)<.3?0:o,n=Math.hypot(e,t);return{ux:e/n,uy:t/n}}}let r=e.slid;return r&&r.distance>0?{ux:-r.dx/r.distance,uy:-r.dy/r.distance}:$x[eS[e.placement.side]]},oS=(e,t)=>{if(t.onCorner)return t.side===`left`?Zx.leftOf:Zx.rightOf;let n=aS(e,t);return Q(Math.abs(n.ux)>.3&&Qx[n.ux>0?`r`:`l`],Math.abs(n.uy)>.3&&Qx[n.uy>0?`b`:`t`])},sS=(e,t,n,r,i)=>{let a=t-n,o=e,s=iS(r,a,o),c=iS(i-n,a,o);return[s,Math.max(s,c)]},cS=(e,t,n,r,i)=>{let[a,o]=(0,X.useState)(null),s=(0,X.useRef)(i);s.current=i;let{onCorner:c,side:l,flipped:u,toward:d}=r;return(0,X.useLayoutEffect)(()=>{let r=e.current,i=t.current,a=r?.parentElement;if(!r||!i||!a)return;let f=a.closest(`[data-placement]`),p=()=>{let e=aS(n,{onCorner:c,side:l,flipped:u,toward:d}),t=r.offsetWidth,f=r.offsetHeight,p=r.offsetLeft,m=r.offsetTop,h=p+t/2,g=m+f/2,_,v,y;if(c){let e=l===`left`?a.offsetWidth:0,t=u?0:a.offsetHeight;_=tS(180*Math.atan2(t-g,e-h)/Math.PI)}else{let n=Math.min(Math.abs(e.ux)>1e-6?t/2/Math.abs(e.ux):1/0,Math.abs(e.uy)>1e-6?f/2/Math.abs(e.uy):1/0)+19;_=tS(180*Math.atan2(e.uy,e.ux)/Math.PI),v=Math.round(h+n*e.ux-9),y=Math.round(g+n*e.uy-9)}let b=i.offsetWidth,x=i.offsetHeight;s.current?.(b,x);let S=r.getBoundingClientRect(),C=n.getBoundaryRect(),w=((e,t,n,r,i,a)=>{let[o,s]=sS(e.left,e.right,t,r.left+4,r.right-4),[c,l]=sS(e.top,e.bottom,n,r.top+4,r.bottom-4),u=a.ux>.3||!(a.ux<-.3)&&e.right-r.left>=r.right-e.left?o:s,d=a.uy>.3||!(a.uy<-.3)&&e.bottom-r.top>=r.bottom-e.top?c:l,f=[u,o,s],p=[d,c,l];i&&(f.push(iS(i.left-4-t,o,s),iS(i.right+4,o,s)),p.push(iS(i.top-4-n,c,l),iS(i.bottom+4,c,l)));let m=i&&{left:Math.max(i.left,r.left),top:Math.max(i.top,r.top),right:Math.min(i.right,r.right),bottom:Math.min(i.bottom,r.bottom)},h={left:u,top:d,covered:1/0,moved:1/0};for(let e of f)for(let r of p){let i=m?nS({left:e,top:r,right:e+t,bottom:r+n},m):0,a=Math.abs(e-u)+Math.abs(r-d);(i<h.covered||i===h.covered&&a<h.moved)&&(h={left:e,top:r,covered:i,moved:a})}return{left:h.left,top:h.top}})({left:S.left,top:S.top,right:S.right,bottom:S.bottom},b,x,{left:C.left,top:C.top,right:C.right,bottom:C.bottom},rS(n),e),T=Math.round(w.left-(S.left-p)),E=Math.round(w.top-(S.top-m)),D=p-T,O=m-E,k={rotate:_,pointerLeft:v,pointerTop:y,cardLeft:T,cardTop:E,clipClosed:`inset(${O}px ${b-D-t}px ${x-O-f}px ${D}px round 4px)`};o(e=>((e,t)=>!!e&&e.rotate===t.rotate&&e.pointerLeft===t.pointerLeft&&e.pointerTop===t.pointerTop&&e.cardLeft===t.cardLeft&&e.cardTop===t.cardTop&&e.clipClosed===t.clipClosed)(e,k)?e:k)};p();let m=new ResizeObserver(p);m.observe(r),m.observe(i);let h=f?new MutationObserver(p):null;return f&&h.observe(f,{attributes:!0,attributeFilter:[`style`]}),()=>{m.disconnect(),h?.disconnect()}},[e,t,n,c,l,u,d]),a},lS=(e,t,n)=>{(e=>{e.stopPropagation()})(e),Gx(t,null),n()},uS=(e,t)=>{Px(t.intent)?Ux(e,t.id):Hx(e,t.id)},dS=e=>{let{workbook:t,annotation:n,more:r,position:i,total:a,isCurrent:o,isHovered:s,side:c,cornerOff:l,toward:u,style:d,state:f,address:p,onCardSize:m}=e,h=i>0,g=n.label?.trim()||``,_=o||s||!h&&!!g,v=`${h?`${i} of ${a}, `:`Agent cursor, `}${p}${g?`: ${g}`:``}`,y=!(f.outOfView||l),b=(0,X.useRef)(null),x=(0,X.useRef)(null),S=(e=>{let[t,n]=(0,X.useState)(null);return(0,X.useLayoutEffect)(()=>{let t=e.current?.closest(`[data-placement]`);if(!t)return;let r=()=>n(t.getAttribute(`data-placement`));r();let i=new MutationObserver(r);return i.observe(t,{attributes:!0,attributeFilter:[`data-placement`]}),()=>i.disconnect()},[e]),t})(b),C={onCorner:y,side:y&&S?S.endsWith(`-start`)?`right`:S.endsWith(`-end`)?`left`:c:c,flipped:S?.startsWith(`bottom`)??!1,toward:u??null},w=cS(b,x,f,C,m),T=(e=>{let[t,n]=(0,X.useState)(!1);return(0,X.useLayoutEffect)(()=>{if(!e||t)return;let r=0,i=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>n(!0))});return()=>{cancelAnimationFrame(i),cancelAnimationFrame(r)}},[e,t]),t})(!!w&&!!S),E=h&&a>1,D=(0,Z.jsx)(`span`,h?{className:Zx.num,children:i}:{className:Zx.num,children:(0,Z.jsx)(`span`,{className:Zx.dot})}),O=r>0?(0,Z.jsxs)(`span`,{className:Zx.more,children:[`+`,r]}):null;return(0,Z.jsxs)(`div`,{className:Q(Zx.tag,oS(f,C),_&&Zx.expanded,o&&Zx.current,T&&Zx.settled),style:{"--sxl-annotation-color":d.chip,"--tag-rotate":w?`${w.rotate}deg`:void 0,"--card-clip-closed":w?.clipClosed},role:`button`,"aria-label":v,"aria-current":o||void 0,onClick:()=>{(e=>{let t=e?.ownerDocument.getSelection();return!!e&&!!t&&!t.isCollapsed&&!!t.anchorNode&&e.contains(t.anchorNode)})(x.current)||uS(t,n)},children:[(0,Z.jsx)(`svg`,{className:Zx.pointer,viewBox:`-9 -9 18 18`,"aria-hidden":`true`,style:w?.pointerLeft===void 0?void 0:{left:w.pointerLeft,top:w.pointerTop,right:`auto`,bottom:`auto`},children:(0,Z.jsx)(`g`,{transform:`translate(-1.5 -1.2)`,children:(0,Z.jsx)(`path`,{d:`M1.5 1.2 14 8.1l-5.6 1.4-2.6 5.6L1.5 1.2Z`})})}),(0,Z.jsxs)(`div`,{ref:b,className:Zx.badge,children:[D,O]}),(0,Z.jsxs)(`div`,{ref:x,className:Zx.card,style:{left:w?.cardLeft??0,top:w?.cardTop??0},"aria-hidden":!_,children:[(0,Z.jsxs)(`div`,{className:Zx.cardHead,children:[(0,Z.jsxs)(`span`,{className:Zx.place,children:[D,O,E?(0,Z.jsxs)(`span`,{className:Zx.total,children:[`/ `,a]}):null]}),(0,Z.jsx)(`span`,{className:Zx.address,title:p,children:p}),(0,Z.jsxs)(`span`,{className:Zx.controls,children:[E?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,className:Zx.button,"aria-label":`Previous`,tabIndex:-1,onClick:e=>lS(e,t,()=>Jx(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`ArrowUpward`,size:12,ariaHidden:!0})}),(0,Z.jsx)(`button`,{type:`button`,className:Zx.button,"aria-label":`Next`,tabIndex:-1,onClick:e=>lS(e,t,()=>qx(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`ArrowDownward`,size:12,ariaHidden:!0})})]}):null,(0,Z.jsx)(`button`,{type:`button`,className:Zx.button,"aria-label":`Dismiss`,tabIndex:-1,onClick:e=>lS(e,t,()=>Vx(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`Close`,size:12,ariaHidden:!0})})]})]}),g?(0,Z.jsx)(`div`,{className:Zx.label,children:g}):null]})]})};dS.displayName=`RangeAnnotationTag`;var fS=Object.freeze({working:{border:`rgba(64,150,255,0.90)`,fill:`rgba(64,150,255,0.14)`,chip:`rgb(48,128,232)`},finding:{border:`rgba(64,190,120,0.90)`,fill:`rgba(64,190,120,0.14)`,chip:`rgb(38,150,90)`},question:{border:`rgba(240,180,60,0.90)`,fill:`rgba(240,180,60,0.14)`,chip:`rgb(200,140,30)`}}),pS=fS.finding,mS=e=>{e.stopPropagation()},hS={pointerEvents:`auto`,outline:`none`},gS={width:180,height:56},_S=20,vS=18,yS=17,bS=20,xS=(e,t,n,r)=>[Math.max(t-n,4),Math.min(e,r-4-n)],SS=[_.TopLeft,_.Top,_.Left,_.Center],CS=(e,t)=>{let n=e.getAllPanes();for(let e of SS){let r=n[e],i=r?.getVisibleRange();if(r&&i&&t.rowStart<=i.rowEnd&&t.rowEnd>=i.rowStart&&t.colStart<=i.colEnd&&t.colEnd>=i.colStart)return r}return Jt(n)??e},wS=new WeakMap,TS=e=>{let t=wS.get(e);return t||(t={sizes:new Map,listeners:new Set},wS.set(e,t)),t},ES=(0,X.memo)(e=>{let{sheet:t,styles:n,renderChip:r,renderMarker:i,dimOpacity:a=.45,showChip:o=OS,filter:s,className:c,onKeyDown:u,...d}=e,f=l(),p=t??f,m=p?.getWorkbook()??null,{annotations:h,navigable:g,current:_,hovered:v}=Xx(m),y=bt(),b=(0,X.useRef)(new Map),[,x]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!m)return;let{listeners:e}=TS(m);return e.add(x),()=>{e.delete(x)}},[m]);let S=(e,t)=>(n,r)=>{let i=TS(e),a=i.sizes.get(t);if(!a||a.width!==n||a.height!==r){i.sizes.set(t,{width:n,height:r});for(let e of[...i.listeners])e()}},C=(0,X.useMemo)(()=>n?{...fS,...n}:fS,[n]),w=Q(c,`sxl-range-annotations`),T=e=>!(e.key!==`Escape`||e.defaultPrevented||!m||!_&&!v)&&(e.preventDefault(),e.stopPropagation(),Ux(m,null),Gx(m,null),!0),E=e=>{e.stopPropagation(),T(e)&&y?.focus()},D={...d,className:w,onKeyDown:e=>{u?.(e),T(e)}},O=y?.getElement()??null,k=!!_;if((0,X.useEffect)(()=>{if(!k||!m||!O)return;let e=O.ownerDocument,t=e=>{e.target instanceof Node&&O.contains(e.target)&&Ux(m,null)};return e.addEventListener(`pointerdown`,t,!0),()=>e.removeEventListener(`pointerdown`,t,!0)},[k,m,O]),!p||!m||h.length===0)return(0,Z.jsx)(q,{...D});let A=p.getName(),j=g.length,M=[];for(let e of h){if(e.status!==`open`||e.sheet!==A||s&&!s(e))continue;let t=g.indexOf(e)+1,n,r;try{let t=m.getRange(e.range).getCoords();n={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd},r=p.getRange(n).getAddress()}catch{continue}M.push({annotation:e,coords:n,home:y?CS(y,n):null,address:r,isCurrent:e===_,isHovered:e===v,position:t})}if(M.length===0)return(0,Z.jsx)(q,{...D});let N=e=>{let t=e.coords,n=e.home?.getVisibleRange()??null;if(n){let e=t.rowEnd<n.rowStart?`t`:t.rowStart>n.rowEnd?`b`:``,r=t.colEnd<n.colStart?`l`:t.colStart>n.colEnd?`r`:``;if(e&&r)return`${e}${r}`;if(e)return`${e}:c${t.colStart}`;if(r)return`${r}:r${t.rowStart}`}return`${t.rowStart}:${t.colStart}`},P=e=>e.isHovered?2:+!!e.isCurrent;M.sort((e,t)=>P(e)-P(t));let F=new Map;for(let e of M){let t=N(e),n=F.get(t);n?n.push(e):F.set(t,[e])}let I=e=>C[e]??pS;return(0,Z.jsxs)(q,{...D,children:[M.map(e=>{let{annotation:t,coords:n,isCurrent:r,isHovered:i}=e,o=I(t.intent),s=r||i,c=!!_&&!s&&DS(t);return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(Pt,{className:`sxl-range-annotation-box`,range:n,stroke:o.border,alignWidth:2,style:{opacity:c?a:1,transition:`opacity 160ms ease`}}),(0,Z.jsx)(Pt,{className:`sxl-range-annotation-fill`,range:n,fill:o.fill,style:{opacity:+!!s,transition:`opacity 200ms ease`}})]},`box-${t.id}`)}),[...F.values()].map(e=>{let t=e.find(e=>e.isCurrent)??e.find(e=>e.isHovered)??e[0];if(!o(t.annotation)&&e.length===1)return null;let n=e.some(e=>e.isHovered),a={workbook:m,annotation:t.annotation,more:e.length-1,position:t.position,total:j,isCurrent:t.isCurrent,isHovered:n,style:I(t.annotation.intent),address:t.address,onCardSize:S(m,t.annotation.id)},s=t.annotation.id,c=t.home?((e,t,n)=>{let r=e.getBoundsFromRange(t),i=e.getPaneBounds(),a=i.width,o=i.height,s=r.x,c=r.y,l=r.x+r.width,u=r.y+r.height,d=(e,t)=>e>=0&&e<=t,f=d(s,a),p=d(l,a),m=d(c,o),h=d(u,o),g=s<a&&l>0,_=c<o&&u>0,v=(e,t,r,i)=>{let[d,f]=xS(e,t,n.width,a),[p,m]=xS(r,i,n.height,o);return Math.max(0,d-f)+Math.max(0,p-m)+(d<=s-4-n.width||f>=l+4||p<=c-4-n.height||m>=u+4?0:1e5)},y=e.getVisibleRange(),b=y?{colStart:Math.max(t.colStart,y.colStart),colEnd:Math.min(t.colEnd,y.colEnd)}:{},x=y?{rowStart:Math.max(t.rowStart,y.rowStart),rowEnd:Math.min(t.rowEnd,y.rowEnd)}:{};if(!g||!_){let e=u<=0?`b`:`t`,n=l<=0?`r`:`l`,r={inset:0,side:`left`,cornerOff:!0,toward:null};return g?{...r,anchor:{...t,...b},placement:{side:e,align:`center`}}:_?{...r,anchor:{...t,...x},placement:{side:n,align:`center`}}:{...r,anchor:t,placement:{side:e,align:l<=0?`start`:`end`}}}let S=[{x:`l`,y:`t`,ok:f&&m},{x:`r`,y:`t`,ok:p&&m},{x:`l`,y:`b`,ok:f&&h},{x:`r`,y:`b`,ok:p&&h}],C=null;for(let e of S){if(!e.ok)continue;let t=e.x===`l`?s:l,n=e.y===`t`?c:u,[r,i]=e.x===`l`?[t-yS-_S,t-yS]:[t+yS,t+yS+_S],[a,o]=e.y===`t`?[n-yS-vS,n-yS]:[n+yS,n+yS+vS],d=v(r,i,a,o);if((!C||d<C.over)&&(C={x:e.x,y:e.y,over:d}),d===0)break}if(C){let e=C.x===`l`;return{anchor:t,placement:{side:C.y,align:e?`end`:`start`},inset:e?Math.min(l,a)-s:l-Math.max(s,0),side:e?`left`:`right`,cornerOff:!1,toward:null}}let w=Math.max(c,0),T=Math.max(s,0),E=[{ok:f&&_,side:`l`,toward:`r`,anchor:{...t,...x},over:()=>v(s-bS-_S,s-bS,w,w+vS)},{ok:p&&_,side:`r`,toward:`l`,anchor:{...t,...x},over:()=>v(l+bS,l+bS+_S,w,w+vS)},{ok:m&&g,side:`t`,toward:`b`,anchor:{...t,...b},over:()=>v(T,T+_S,c-bS-vS,c-bS)},{ok:h&&g,side:`b`,toward:`t`,anchor:{...t,...b},over:()=>v(T,T+_S,u+bS,u+bS+vS)}],D=null;for(let e of E){if(!e.ok)continue;let t=e.over();if((!D||t<D.over)&&(D={e,over:t}),t===0)break}return D?{anchor:D.e.anchor,placement:{side:D.e.side,align:`start`},inset:0,side:`left`,cornerOff:!0,toward:D.e.toward}:{anchor:t,placement:{side:`t`,align:`start`},inset:0,side:`left`,cornerOff:!0,toward:null}})(t.home,t.coords,TS(m).sizes.get(s)??gS):{anchor:t.coords,placement:{side:`t`,align:`end`},inset:0,side:`left`,cornerOff:!1,toward:null},{side:l,cornerOff:u,toward:d}=c;return(0,Z.jsx)(Dt,{className:`sxl-range-annotation-chip`,anchor:{range:c.anchor},placement:c.placement,alignOffset:c.inset,offset:0,whenOff:`clamp`,zIndex:We(`grid`,n?2:+!!t.isCurrent),children:e=>(0,Z.jsx)(`div`,{style:hS,tabIndex:-1,onKeyDown:E,onKeyUp:mS,onCopy:mS,onCut:mS,onPaste:mS,onPointerDown:mS,onMouseDown:mS,onDoubleClick:mS,onPointerEnter:()=>((e,t)=>{let n=b.current.get(t);n&&(clearTimeout(n),b.current.delete(t)),Gx(e,t)})(m,s),onPointerLeave:()=>((e,t)=>{let n=b.current.get(t);n&&clearTimeout(n),b.current.set(t,setTimeout(()=>{b.current.delete(t),Kx(e,t)},140))})(m,s),children:e.outOfView?(0,Z.jsx)(ae,{render:i??kS,props:{...a,side:l,cornerOff:u,toward:d,state:e}}):(0,Z.jsx)(ae,{render:r??kS,props:{...a,side:l,cornerOff:u,toward:d,state:e}})})},`chip-${s}`)})]})});ES.displayName=`RangeAnnotationLayer`;var DS=e=>e.intent!==`working`,OS=e=>DS(e)||!!e.label,kS=e=>(0,Z.jsx)(dS,{...e});Object.freeze([]),Object.freeze([]),Object.freeze([]),C(`agent.pane.title`),C(`agent.findingsOpen`),C(`agent.needsAttention`),C(`agent.working`),C(`agent.position`),C(`agent.previous`),C(`agent.next`),C(`agent.goToCurrent`),C(`agent.dismiss`),C(`agent.dismissAll`),C(`agent.tab.review`),C(`agent.waitingOnYou`),C(`agent.tab.history`),C(`agent.history.none`),C(`agent.history.search`),C(`agent.history.clearSearch`),C(`agent.history.noMatches`),C(`agent.history.kind.finding`),C(`agent.history.kind.question`),C(`agent.history.kind.change`),C(`agent.section.findings`),C(`agent.findings.none`),C(`agent.findings.stale`),C(`agent.changes.untitled`),C(`agent.prompt.title`),C(`agent.prompt.other`),C(`agent.prompt.submit`),C(`agent.prompt.acknowledge`),C(`agent.prompt.submitAll`),C(`agent.prompt.stepTab`),C(`agent.prompt.otherPlaceholder`),C(`agent.pin`),C(`agent.unpin`),C(`agent.prompt.goto`),C(`agent.meter`);var AS=[`selectedItemWithData`,`unselectedItemWithData`,`selectedItemWithNoData`,`unselectedItemWithNoData`],jS=(0,X.memo)(e=>{let{styleName:t,styles:n,width:r=56,height:i=60,style:a,...o}=e,s=mn(t,n),c=(e,t)=>(0,Z.jsx)(`div`,{style:{width:`${t}%`,height:2,backgroundColor:e.color??`currentColor`,opacity:.85}}),l=pn(s?.headerRow,n);return(0,Z.jsxs)(`div`,{...o,style:{width:r,height:i,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,gap:2,padding:3,overflow:`hidden`,backgroundColor:`var(--sxl-color-base-100, white)`,border:`var(--sxl-color-neutral, grey) solid 1px`,...pn(s?.wholeTable,n),...a},children:[(0,Z.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:7,flex:`none`,...l},children:c(l,45)}),AS.map((e,t)=>{let r=pn(s?.[e],n);return(0,Z.jsx)(`div`,{style:{flex:`1 1 0`,minHeight:0,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid transparent`,...r},children:c(r,40)},t)})]})});jS.displayName=`SlicerStylePreview`,N.register(`shape`,()=>d(()=>import(`./DYJSIlNxrNw8qk-w.js`),[],import.meta.url));var MS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1387 h -469 v -640 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 1131 h -469 v -811 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z`})]}),NS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1515 h -469 v -1195 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 875 h -469 v -555 h 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z`})]}),PS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z`})]}),FS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),IS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1877 299 h -1770 v -43 h 1770 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),LS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z`})]}),RS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z`})]}),zS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z`})]}),BS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z`})]}),VS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z`})]}),HS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1813 277 v 299 h -1706 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1088 v 299 h -810 v -299 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 896 1109 h -795 v -42 h 838 v 322 h -43 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z`})]}),US=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 704 832 v -469 h 640 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1600 v -469 h 811 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z`})]}),WS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 533 832 v -469 h 1195 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1173 1600 v -469 h 555 v 469 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z`})]}),GS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z`})]}),KS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),qS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1941 1941 h -1834 v -1834 h 1834 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z`})]}),JS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`})]}),YS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z`})]}),XS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z`})]}),ZS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z`})]}),QS=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z`}),(0,Z.jsx)(`path`,{className:`styled info`,d:`M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),$S=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),eC=e=>(0,Z.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,Z.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,Z.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,Z.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,Z.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,Z.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,Z.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),tC={themed:`_themed_f2asj_9`,small:`_small_f2asj_36`,medium:`_medium_f2asj_37`,large:`_large_f2asj_38`},nC=(0,X.memo)(e=>{let{size:t=`medium`,className:n,children:r,...i}=e;return(0,Z.jsx)(`span`,{className:Q(`icon`,tC.themed,tC[t],n),...i,children:r})});nC.displayName=`ThemedChartIcon`;var rC={Column:`column`,ColumnStacked:`columnStacked`,ColumnStackedPercent:`columnStackedPercent`,Line:`line`,LineStacked:`lineStacked`,LineStackedPercent:`lineStackedPercent`,LineMarkers:`lineMarkers`,LineStackedMarkers:`lineStackedMarkers`,LineStackedPercentMarkers:`lineStackedPercentMarkers`,Pie:`pie`,PieDoughnut:`pieDoughnut`,Bar:`bar`,BarStacked:`barStacked`,BarStackedPercent:`barStackedPercent`,Area:`area`,AreaStacked:`areaStacked`,AreaStackedPercent:`areaStackedPercent`,ScatterMarkers:`scatterMarkers`,ScatterLinesMarkersSmooth:`scatterLinesMarkersSmooth`,ScatterLinesMarkers:`scatterLinesMarkers`,ScatterLinesSmooth:`scatterLinesSmooth`,ScatterLines:`scatterLines`,Bubble:`bubble`,Bubble3D:`bubble3D`},iC=new Map;iC.set(rC.Column,{Icon:kx,description:C(`chart.type.column`),type:`columnClustered`}),iC.set(rC.ColumnStacked,{Icon:MS,description:C(`chart.type.columnStacked`),type:`columnStacked`}),iC.set(rC.ColumnStackedPercent,{Icon:NS,description:C(`chart.type.columnStackedPercent`),type:`columnStacked100`}),iC.set(rC.Line,{Icon:PS,description:C(`chart.type.line`),type:`line`}),iC.set(rC.LineStacked,{Icon:FS,description:C(`chart.type.lineStacked`),type:`lineStacked`}),iC.set(rC.LineStackedPercent,{Icon:IS,description:C(`chart.type.lineStackedPercent`),type:`lineStacked100`}),iC.set(rC.LineMarkers,{Icon:LS,description:C(`chart.type.lineMarkers`),type:`lineMarkers`}),iC.set(rC.LineStackedMarkers,{Icon:RS,description:C(`chart.type.lineStackedMarkers`),type:`lineMarkersStacked`}),iC.set(rC.LineStackedPercentMarkers,{Icon:zS,description:C(`chart.type.lineStackedPercentMarkers`),type:`lineMarkersStacked100`}),iC.set(rC.Pie,{Icon:BS,description:C(`chart.type.pie`),type:`pie`}),iC.set(rC.PieDoughnut,{Icon:VS,description:C(`chart.type.pieDoughnut`),type:`doughnut`}),iC.set(rC.Bar,{Icon:HS,description:C(`chart.type.bar`),type:`barClustered`}),iC.set(rC.BarStacked,{Icon:US,description:C(`chart.type.barStacked`),type:`barStacked`}),iC.set(rC.BarStackedPercent,{Icon:WS,description:C(`chart.type.barStackedPercent`),type:`barStacked100`}),iC.set(rC.Area,{Icon:GS,description:C(`chart.type.area`),type:`area`}),iC.set(rC.AreaStacked,{Icon:KS,description:C(`chart.type.areaStacked`),type:`areaStacked`}),iC.set(rC.AreaStackedPercent,{Icon:qS,description:C(`chart.type.areaStackedPercent`),type:`areaStacked100`}),iC.set(rC.ScatterMarkers,{Icon:JS,description:C(`chart.type.scatterMarkers`),type:`xyscatter`}),iC.set(rC.ScatterLinesMarkersSmooth,{Icon:YS,description:C(`chart.type.scatterLinesMarkersSmooth`),type:`xyscatterSmooth`}),iC.set(rC.ScatterLinesMarkers,{Icon:ZS,description:C(`chart.type.scatterLinesMarkers`),type:`xyscatterLines`}),iC.set(rC.ScatterLinesSmooth,{Icon:XS,description:C(`chart.type.scatterLinesSmooth`),type:`xyscatterSmoothNoMarkers`}),iC.set(rC.ScatterLines,{Icon:QS,description:C(`chart.type.scatterLines`),type:`xyscatterLinesNoMarkers`}),iC.set(rC.Bubble,{Icon:$S,description:C(`chart.type.bubble`),type:`bubble`}),iC.set(rC.Bubble3D,{Icon:eC,description:C(`chart.type.bubble3D`),type:`bubble3DEffect`});var aC={placement:`bottom-start`,followAnchor:!0},oC=new Set,sC={x:0,y:0,top:0,left:0,bottom:0,right:0,width:0,height:0,toJSON:()=>({})},cC=e=>{let{api:t,grammar:n,disabled:r}=e,i=n===`formula`,a=gr(),o=e.workbook===void 0?a:e.workbook,s=wa().getMode(),c=!!s?.activeInput&&!t.engaged,[l,u]=(0,X.useState)(-1),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(null),h=(0,X.useMemo)(()=>Ro(i?t.tokens:null),[i,t.tokens]),g=(0,X.useMemo)(()=>{if(!i||!t.tokens)return oC;let e;try{e=ao(o)?.getCalculation()??null}catch{e=null}return e?new Set(hs(e,t.tokens,t.tokenBase).flatMap(e=>e.tokens)):oC},[i,t.tokens,t.tokenBase,o]),[_,v]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=t.tokens,n=i&&t.engaged&&e&&l>=0?zo(e,h.matchOf,l,t.tokenBase):null;v(e=>Bo(e,n)?e:n)},[i,t.engaged,t.tokens,t.tokenBase,l,h]);let y=(0,X.useMemo)(()=>Vo(i?d:null,_,h),[i,d,_,h]),b=l>=0?Math.min(l,t.text.length):t.text.length,x=i&&t.engaged&&t.text.length>0&&Ii(t.text,b),S=x&&b>=t.text.length,C=x&&!S?b:-1,w=(0,X.useMemo)(()=>{if(i){let e=t.tokens;if(!e)return null;let n=t.tokenBase,r=e.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=e.map((e,t)=>{let n=h.unmatched.has(t),i=y.has(t),a=h.depthOf.get(t),o=n||a===void 0||e.referenceIndex!==void 0?void 0:jo(a),s=n?Po:o??zi(e),c;(s||i||n)&&(c={},s&&(c.color=s),n&&(c.fontWeight=`bold`),i&&(c.color=`transparent`)),g.has(t)&&(c={...c,...Io});let l=e.text??``,u=C>=r[t]&&C<r[t]+l.length;return(0,Z.jsxs)(`span`,{"data-si":t,style:c,children:[i&&(0,Z.jsx)(`span`,{"aria-hidden":!0,style:Mo,children:(0,Z.jsx)(`span`,{style:No(s??`inherit`),children:e.text})}),u?(0,Z.jsxs)(Z.Fragment,{children:[l.slice(0,C-r[t]),(0,Z.jsx)(wo,{}),l.slice(C-r[t])]}):l]},`t-${t}`)}),a=t.tokenBase>0?(0,Z.jsx)(`span`,{children:t.text.slice(0,t.tokenBase)},`eq`):null,o=S?(0,Z.jsx)(wo,{},`expected`):null;if(!d)return[a,...i,o].filter(Boolean);let{lo:s,hi:c,outline:l}=d,u=l?Oo:Do;return[a,...i.slice(0,s),(0,Z.jsx)(`span`,{className:`sxl-formula-eval-run`,style:u,children:i.slice(s,c+1)},`eval-run`),...i.slice(c+1),o].filter(Boolean)}if(t.segments.length===0)return null;let e=[];return t.segments.forEach((t,n)=>{n>0&&e.push((0,Z.jsx)(`span`,{children:`,`},`sep-${n}`));let r=d&&d.lo===n;e.push((0,Z.jsx)(`span`,{"data-si":n,style:{...t.valid?{color:At[n%At.length]}:null,...r?d.outline?Oo:Do:null},children:t.text},`seg-${n}`))}),e},[i,t.tokens,t.tokenBase,t.text,t.segments,h,y,d,S,C,g]),T=!r&&!c&&!!w,E=(0,X.useRef)(null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),[k,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=D.current;if(!e)return;M(e.ownerDocument.activeElement===e);let t=()=>M(!0),n=()=>M(!1);return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[]),(0,X.useLayoutEffect)(()=>{if(!T)return void A(null);let e=D.current,t=E.current;if(!e||!t)return;let n=()=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.getComputedStyle(e);A({position:`absolute`,left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height,boxSizing:`border-box`,paddingLeft:i.paddingLeft,paddingRight:i.paddingRight,paddingTop:i.paddingTop,paddingBottom:i.paddingBottom,font:i.font,letterSpacing:i.letterSpacing,display:`flex`,alignItems:`center`,whiteSpace:`pre`,overflow:`hidden`,pointerEvents:`none`,textAlign:`left`});let a=O.current;a&&(a.scrollLeft=e.scrollLeft)};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[T,t.text]);let N=Ss({text:t.text,getTokens:()=>i?t.tokens:null,active:i&&t.engaged,getCaret:()=>D.current?.selectionStart??t.text.length,getCalculation:()=>{try{return ao(o)?.getCalculation()??null}catch{return null}},getNames:()=>{try{return ao(o)?.getNames()??null}catch{return null}},getLocale:()=>o?.getLocale()??null,applyText:(e,n)=>{t.replaceText(e,n)},hoveredTokenIndex:p,getArgument:()=>i?e.argument??null:null});(0,X.useEffect)(()=>{N.update()},[N.update,t.text,l,t.engaged]);let P=(0,X.useMemo)(()=>({getBoundingClientRect:()=>D.current?.getBoundingClientRect()??sC}),[]),F=X.useCallback(e=>!!E.current?.contains(e),[]),I=De({label:`formula-field-hint`,anchor:P,autoFocus:!1,disableClickAway:F,propsPopper:aC,renderPopupPanel:N.renderPanel}),L=N.active&&!s?.dragging,R=I.reference;(0,X.useEffect)(()=>{L?R.open(0):R.close(0)},[L,R]);let[ee,te]=(0,X.useState)(null),z=(0,X.useRef)(null),B=(0,X.useRef)(!1),V=()=>{z.current=null,B.current=!1,te(null),f(null),m(null)},H=()=>{B.current||V()},ne=Ra(()=>V(),()=>W()),U=t=>{if(!o)return!1;try{return ao(o)?.getCalculation().createFormula(`=`+t,e.home,{target:`display`}).isValid()??!1}catch{return!1}},W=()=>{let n=D.current,r=O.current,a=()=>{B.current&&V()};if(!n||!r||!T)return void a();if(ne.isDragging())return;let s=n.selectionStart??0,c=n.selectionEnd??0;if(s===c)return void a();let l=null;if(i){let n=o?Va(t.tokens,t.tokenBase,t.text,s,c,U):null;n&&(l={lo:n.lo,hi:n.hi,key:`sel:f:${n.lo}:${n.hi}:${n.fragment??n.evalIndex}`,evaluate:async()=>{let r=ao(o)?.getCalculation();return r?Ja(n.fragment===null?await r.createFormula(t.text,e.home,{target:`display`}).evaluate({evalIndex:n.evalIndex}):await r.createFormula(`=`+n.fragment,e.home,{target:`display`}).evaluate()):null}})}else{let e=0,n=-1;for(let r=0;r<t.segments.length;r++){r>0&&(e+=1);let i=e;if(e+=t.segments[r].text.length,i<c&&e>s){if(n>=0){n=-1;break}n=r}}if(n>=0&&t.segments[n].valid){let e=n;l={lo:e,hi:e,key:`sel:s:${e}:${t.segments[e].text}`,evaluate:()=>t.evaluateSegment(e)}}}if(!l)return void a();if(l.key===z.current)return;z.current=l.key,B.current=!0,te(null),m(null),f({lo:l.lo,hi:l.hi,outline:!0});let u=r.querySelector(`[data-si="${l.lo}"]`)?.getBoundingClientRect(),d=r.querySelector(`[data-si="${l.hi}"]`)?.getBoundingClientRect();if(!u)return void V();let p=d&&Math.abs(d.top-u.top)<1?{left:(u.left+d.right)/2,top:u.top-6}:{left:(u.left+u.right)/2,top:u.top-6},h=l.key;l.evaluate().then(e=>{z.current===h&&e!=null&&te({...p,text:e})}).catch(()=>{})};(0,X.useEffect)(()=>{t.engaged||V()},[t.engaged]);let re=n=>{if(n.which!==Pe.F9||n.shiftKey||n.ctrlKey||n.altKey||n.metaKey)return!1;let a=D.current;if(!i||!a||!o||r||!t.tokens?.length)return!1;let s=a.selectionStart??0,c=a.selectionEnd??0,l;if(s!==c)l=Va(t.tokens,t.tokenBase,t.text,s,c,U);else{let e=Ha(t.tokens);l=e?{...e,...Ua(t.tokens,t.tokenBase,e.lo,e.hi),fragment:null}:null}if(!l)return!1;n.preventDefault(),n.stopPropagation();let u=t.text,d=ao(o)?.getCalculation();if(!d)return!1;let f=Wa(Tn(o.getLocale()??`en`).decimal),p=jn(),m={t:p?.booleans?.true??`TRUE`,f:p?.booleans?.false??`FALSE`};return(async()=>{let t=null,n=``;try{if(t=Ka(l.fragment===null?await d.createFormula(u,e.home,{target:`display`}).evaluate({evalIndex:l.evalIndex}):await d.createFormula(`=`+l.fragment,e.home,{target:`display`}).evaluate(),f,m),t===null||(n=u.slice(0,l.start)+t+u.slice(l.end),!d.createFormula(n,e.home,{target:`display`}).isValid()))return}catch{return}let r=D.current;if(!r||r.value!==u)return;xe.replaceRangeText(r,l.start,l.end,t);let i=l.start,a=l.start+t.length;requestAnimationFrame(()=>{D.current?.value===n&&D.current.setSelectionRange(i,a)})})(),!0};(0,X.useEffect)(()=>{V()},[t.text]);let ie={onScroll:e=>{let t=O.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft),V(),W()},onMouseMove:n=>{let r=O.current;if(!r)return;if(ne.blocksHover(n)||za(D.current))return void H();let a=n.clientX,s=n.clientY,c=r.querySelectorAll(`[data-si]`),l=-1,u=null;for(let e=0;e<c.length;e++){let t=c[e].getBoundingClientRect();if(a>=t.left&&a<=t.right&&s>=t.top&&s<=t.bottom){l=Number(c[e].getAttribute(`data-si`)),u=t;break}}if(l<0||!u)return void V();if(i){let n=t.tokens;if(!n||!o)return void V();let i=Ba(n,l);if(!i)return void V();let a=`f:${i.evalIndex}:${i.lo}:${i.hi}`;if(a===z.current)return;z.current=a,te(null),f({lo:i.lo,hi:i.hi}),m(l);let s=r.querySelector(`[data-si="${i.lo}"]`)?.getBoundingClientRect(),c=r.querySelector(`[data-si="${i.hi}"]`)?.getBoundingClientRect(),d=s&&c&&Math.abs(c.top-s.top)<1?{left:(s.left+c.right)/2,top:s.top-6}:{left:(u.left+u.right)/2,top:u.top-6};try{let n=ao(o)?.getCalculation();if(!n)return;let r=n.createFormula(t.text,e.home,{target:`display`});Promise.resolve(r.evaluate({evalIndex:i.evalIndex})).then(e=>{if(z.current!==a)return;let t=Ja(e);t!=null&&te({...d,text:t})}).catch(()=>{})}catch{}return}if(!t.segments[l]?.valid)return void V();let d=`s:${l}:${t.segments[l].text}`;if(d===z.current)return;z.current=d,te(null),f({lo:l,hi:l});let p={left:(u.left+u.right)/2,top:u.top-6};t.evaluateSegment(l).then(e=>{z.current===d&&e!=null&&te({...p,text:e})})},onMouseLeave:H,onDragStart:ne.onDragStart,onSelect:e=>{u(D.current?.selectionStart??-1),W()},onPointerDown:e=>{ne.begin(e),L&&!I.isOpen&&R.open(0)}},ae=T&&k?(0,Z.jsx)(`div`,{ref:O,"aria-hidden":!0,style:k,children:(0,Z.jsx)(`span`,{style:{whiteSpace:`pre`},children:w})}):null,G=ee?(0,fr.createPortal)((0,Z.jsx)(`div`,{className:`sxl-formula-eval-tip`,style:{...La,left:ee.left,top:ee.top},children:ee.text}),document.body):null;return{containerRef:E,inputElRef:D,overlayActive:T,inputHandlers:ie,inputExpected:x&&j,handleKeyDown:e=>!!N.handleKeyDown(e)||(e.which===Pe.Escape&&I.isOpen?(e.preventDefault(),e.stopPropagation(),R.close(0),!0):!!re(e)),overlayElement:ae,tipElement:G,hintElement:I.component}},lC=e=>{e.button===0&&e.preventDefault()},uC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{grammar:n=`formula`,value:r,onChangeInput:i,onChangeText:a,onDone:o,changeOn:s,workbook:c,apiRef:l,hideAdornment:u,hideError:d,home:f,equals:p,pickAs:m,pickSpills:h,allowMulti:g,allowCrossSheet:_,argument:v,disabled:y,className:b,style:x,onKeyDown:S,onFocus:C,onBlur:w,placeholder:T,...E}=e,D=je(),O=mo({value:r,onChange:i,onChangeText:a,onDone:o,changeOn:s,workbook:c,home:f,equals:p,pickAs:m,pickSpills:h,allowMulti:g,allowCrossSheet:_,disabled:y},n);(0,X.useImperativeHandle)(l,()=>O,[O]);let k=cC({api:O,grammar:n,disabled:y,workbook:c,home:f,argument:v}),A=!!O.error&&!k.inputExpected,j=s===`done`,N={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`none`,padding:`0 2px`,margin:0,cursor:`pointer`,color:`inherit`,opacity:.8},P=u?null:(0,Z.jsx)(`span`,{className:`sxl-input-adornment`,onMouseDown:lC,style:{display:`inline-flex`,alignItems:`center`,flex:`0 0 auto`},children:O.engaged&&j&&O.dirty?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`commit-reference`,title:D(`referenceInput.commit`),style:N,disabled:!!O.error,tabIndex:-1,onMouseDown:lC,onClick:()=>{O.commit()},children:(0,Z.jsx)(M,{iconKey:`CheckSuccess`})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`cancel-reference`,title:D(`referenceInput.cancel`),style:N,tabIndex:-1,onMouseDown:lC,onClick:()=>{O.cancel()},children:(0,Z.jsx)(M,{iconKey:`CloseError`})})]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":`select-current-range`,title:D(`referenceInput.selectCurrent`),style:y||!O.canSelectCurrent?{...N,opacity:.3,cursor:`default`}:N,disabled:y||!O.canSelectCurrent,tabIndex:-1,onMouseDown:lC,onClick:()=>{O.engaged||O.togglePoint(),O.selectCurrent()},children:(0,Z.jsx)(M,{iconKey:`SelectRangeMode`})})});return(0,Z.jsxs)(`div`,{ref:e=>{k.containerRef.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Q(`sxl-formula-input`,b),"data-grammar":n,"data-error":A?``:void 0,"data-engaged":O.engaged?``:void 0,style:{position:`relative`,display:`inline-flex`,flexDirection:`column`,minWidth:0,fontFamily:`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)`,...x},children:[(0,Z.jsxs)(`span`,{style:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`,border:`1px solid `+(A?`var(--sxl-color-error, #d93025)`:`var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))`),borderRadius:`var(--sxl-input-radius, 4px)`,background:`var(--sxl-input-bg, transparent)`},children:[(0,Z.jsx)(`input`,{...E,type:`text`,spellCheck:!1,autoComplete:`off`,placeholder:T,disabled:y,readOnly:y||O.inputProps.readOnly,"aria-invalid":!!A||void 0,value:O.inputProps.value,ref:e=>{k.inputElRef.current=e,O.inputProps.ref(e)},onChange:O.inputProps.onChange,onKeyDown:e=>{k.handleKeyDown(e)||(O.inputProps.onKeyDown(e),e.defaultPrevented||S?.(e))},onPointerDown:k.inputHandlers.onPointerDown,onMouseDown:O.inputProps.onMouseDown,onSelect:e=>{O.inputProps.onSelect(e),k.inputHandlers.onSelect(e)},onFocus:e=>{O.inputProps.onFocus(e),C?.(e)},onBlur:e=>{O.inputProps.onBlur(e),w?.(e)},onScroll:k.inputHandlers.onScroll,onMouseMove:k.inputHandlers.onMouseMove,onMouseLeave:k.inputHandlers.onMouseLeave,onDragStart:k.inputHandlers.onDragStart,onContextMenu:e=>{e.stopPropagation()},style:{flex:`1 1 auto`,minWidth:0,font:`inherit`,color:`inherit`,background:`none`,border:`none`,outline:`none`,padding:`var(--sxl-input-padding, 4px 6px)`,...k.overlayActive?{color:`transparent`,caretColor:`var(--sxl-color-text, light-dark(#000, #fff))`}:null}}),P]}),!d&&(0,Z.jsx)(`span`,{className:`sxl-formula-input-error`,style:{display:`block`,visibility:A?`visible`:`hidden`,color:`var(--sxl-color-error, #d93025)`,fontSize:`0.75em`,paddingTop:`2px`},children:A?D(O.error):`\xA0`}),k.overlayElement,k.tipElement,k.hintElement]})}));uC.displayName=`FormulaInput`;var dC=`_editable-input_1u3oj_6`,fC=e=>(0,Z.jsx)(`input`,{...e}),pC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n={},className:r,value:i=``,onSubmit:a,onChange:o,onCancel:s,renderInput:c=fC,styleHover:l={},dragging:u,maxLength:d,disabled:f=!1,readOnly:p=!1,...m}=e,[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(i);(0,X.useEffect)(()=>{b(i)},[i]);let x=(0,X.useRef)(null),[S,C]=(0,X.useState)(null),w=he(),T=(0,X.useCallback)(function(e){let t=e.message;S!==t&&(w?.showMessage?.(t,{type:Te.Error}),C(t))},[w,S]),E=(0,X.useCallback)(e=>{let t=!1;try{t=a?.(e)??!0}catch(e){T(e)}return t?(x.current=null,v(!1),b(e),t):(setTimeout(()=>{x.current?.focus()},0),t)},[a]),D=K(()=>{b(i),x.current=null,v(!1),s?.()},[s,i]),O=(0,X.useMemo)(()=>{if(!_)return null;let e={className:Q(dC),autoFocus:!0,spellCheck:!1,name:`editable-label`,autoComplete:`off`,maxLength:d,type:`text`,value:y,onFocus:e=>{x.current||(x.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{x.current&&E(y)},onChange:e=>{_&&b(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>e.code===`Escape`?(e.preventDefault(),void D()):e.code===`Enter`?(e.preventDefault(),void E(e.target.value)):void(e.code===`Tab`?E(e.target.value):e.stopPropagation())};return(0,Z.jsx)(ae,{render:c,props:e})},[_,y,E,D,c,f]),[k,A]=(0,X.useState)();(0,X.useLayoutEffect)(()=>{let e=Object.assign({},n);(u||h)&&(e=Object.assign(e,l)),A(e)},[u,h,l,n]),(0,X.useEffect)(()=>{O&&o?.(y)},[O,o,y]);let j=Ue(t,()=>({startEdit(){f||p||v(!0)},cancel(){D()}}),[]);return(0,Z.jsxs)(`div`,{...m,ref:j,style:{flexDirection:`column`,display:`flex`,...k},className:Q(r),children:[(0,Z.jsxs)(`div`,{style:{position:`relative`,boxSizing:`content-box`,whiteSpace:`pre`,userSelect:`none`,display:`flex`,justifyContent:`center`},onDoubleClick:()=>{f||p||v(!0)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[(0,Z.jsx)(`div`,{className:`sxl-editable-label-container`,style:{textAlign:`center`,display:`flex`,minHeight:`1em`,opacity:+!_},children:y}),O]}),(0,Z.jsx)(`div`,{style:{whiteSpace:`pre`,position:`relative`,maxHeight:`0px`,height:`0px`,visibility:`hidden`,marginLeft:`1px`,marginRight:`1px`,overflow:`hidden`,...l},children:y})]})})),mC=e=>{let{transform:t}=e;return{...t,y:0}},hC=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},gC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,style:r,className:i,index:a,editing:o,editable:s,selectedIndex:c,background:l,activeColor:u,borderColor:d,borderWidth:f,dragging:p,...m}=e;return(0,Z.jsxs)(`div`,{ref:t,className:Q(i),style:{...r,display:`flex`,flexDirection:`column`,background:c===a?`white`:l,minHeight:`0px`,fontFamily:`inherit`,fontSize:`16px`,fontWeight:c===a?`700`:`400`,lineHeight:`1`,letterSpacing:`0px`,textTransform:`none`,minWidth:`unset`},...m,children:[(0,Z.jsxs)(`div`,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},children:[(0,Z.jsx)(`div`,{style:{marginLeft:c===a?`0px`:`-1px`,marginTop:c===a?`0px`:`4px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}),n,c===a?(0,Z.jsx)(`div`,{style:{marginLeft:`0px`,marginTop:`0px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}):(0,Z.jsx)(Z.Fragment,{})]}),(0,Z.jsx)(`div`,{style:{flex:`1 1 100%`,background:c===a&&u?u:`none`,minHeight:`2px`}})]})})),_C={Wrapper:`_Wrapper_10yib_21`,fadeIn:`_fadeIn_10yib_29`,dragOverlay:`_dragOverlay_10yib_33`,Item:`_Item_10yib_43`,pop:`_pop_10yib_1`,withHandle:`_withHandle_10yib_57`,dragging:`_dragging_10yib_62`,disabled:`_disabled_10yib_72`},vC=(0,X.memo)((0,X.forwardRef)(({color:e,dragOverlay:t,dragging:n,disabled:r,fadeIn:i,handle:a,height:o,index:s,listeners:c,onRemove:l,renderItem:u,sorting:d,style:f,transition:p,transform:m,value:h,wrapperStyle:g,..._},v)=>{(0,X.useEffect)(()=>{if(t)return document.body.style.cursor=`grabbing`,()=>{document.body.style.cursor=``}},[t]);let y=u?u({dragOverlay:!!t,dragging:!!n,sorting:!!d,index:s,fadeIn:!!i,listeners:c,ref:v,style:f,transform:m,transition:p,value:h}):(0,Z.jsx)(Z.Fragment,{children:h});return(0,Z.jsx)(`div`,{className:Q(`sxl-tab-item`,_C.Wrapper,i&&_C.fadeIn,d&&_C.sorting,t&&_C.dragOverlay),style:{...g,transition:[p,g?.transition].filter(Boolean).join(`, `),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":s},ref:v,children:(0,Z.jsx)(`div`,{className:Q(_C.Item,n&&_C.dragging,a&&_C.withHandle,t&&_C.dragOverlay,r&&_C.disabled,e&&_C.color,`sxl-dragging`),style:f,"data-cypress":`draggable-item`,...a?void 0:c,..._,tabIndex:a?void 0:-1,children:y})})})),yC={Row:`_Row_1kr10_1`},bC=(0,X.memo)((0,X.forwardRef)(({children:e,horizontal:t,style:n},r)=>(0,Z.jsx)(`div`,{ref:r,style:{...n},className:Q(yC.Row,t&&yC.horizontal),children:e}))),xC={...My,sideEffects:jy({styles:{active:{opacity:`0`}}})},SC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n,activationConstraint:r,animateLayoutChanges:i,adjustScale:a=!1,collisionDetection:o=X_,coordinateGetter:s=rb,dropAnimation:c=xC,getItemStyles:l=()=>({}),getNewIndex:u,handle:d=!1,items:f,onMove:p,isDisabled:m=()=>!1,measuring:h,modifiers:g,renderItem:_,renderDivider:v,reorderItems:y=Ly,strategy:b=Hy,style:x,useDragOverlay:S=!0,onDragStart:C,wrapperStyle:w=()=>({})}=e,[T,E]=(0,X.useState)(()=>f);(0,X.useEffect)(()=>{E(f)},[f]);let[D,O]=(0,X.useState)(null),k=V_(B_(zv,{activationConstraint:r}),B_(Uv,{activationConstraint:r}),B_(jv,{scrollBehavior:`Cypress`in window?`auto`:void 0,coordinateGetter:s})),A=T.indexOf.bind(T),j=D?A(String(D)):-1,M=[];T.map((e,t)=>{M.push((0,Z.jsx)(CC,{id:e,handle:d,index:t,style:l,wrapperStyle:w,disabled:m(e),renderItem:_,animateLayoutChanges:i,useDragOverlay:S,getNewIndex:u},e)),v&&M.push((0,Z.jsx)(ae,{render:v,props:{}},`divider-`+e))});let{getPortalContainer:N}=ge(),P=Re()?.themeScope,F={};P?.mode&&(F[`data-sxl-theme-mode`]=P.mode),P?.surface&&(F[`data-sxl-theme-surface`]=P.surface);let I=P?.classes?.join(` `),L=(0,X.useRef)(null),R=(0,X.useRef)(null),ee=()=>{let e=R.current;R.current=null,e&&setTimeout(()=>{let{el:t,start:n,end:r}=e;if(document.activeElement!==t)return;let i=r??t.value.length;try{t.setSelectionRange(n??i,i)}catch{}},80)};return(0,Z.jsxs)(vy,{sensors:k,collisionDetection:o,onDragStart:e=>{let{active:t}=e;t&&(C?.(e),O(t.id))},autoScroll:{canScroll:e=>{if(e===document.scrollingElement||e===document.documentElement||e===document.body)return!1;let t=L.current;return!!t&&e.contains(t)}},onDragEnd:e=>{if(O(null),ee(),e.over){let t=A(String(e.over.id));j!==t&&(p?.(j,t),E(e=>y(e,j,t)))}},onDragCancel:()=>{O(null),ee()},measuring:h,modifiers:g,children:[(0,Z.jsx)(`div`,{ref:L,style:{display:`flex`,justifyContent:`flex-start`,boxSizing:`border-box`,...x},className:Q(n,_C.Wrapper),onMouseDown:e=>{(()=>{let e=document.activeElement;R.current=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?{el:e,start:e.selectionStart,end:e.selectionEnd}:null})();let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable||e.preventDefault()},children:(0,Z.jsx)(qy,{items:T,strategy:b,children:(0,Z.jsx)(bC,{ref:t,children:M})})}),S?(0,fr.createPortal)((0,Z.jsx)(Iy,{adjustScale:a,dropAnimation:c,children:D?(0,Z.jsx)(`div`,{className:I,...F,style:{display:`flex`},children:(0,Z.jsx)(vC,{value:T[j],handle:d,renderItem:_,wrapperStyle:w({index:j,isDragging:!0,id:T[j]}),index:j,dragging:!0,style:l({id:T[j],index:j,isSorting:D!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0})}):null}),N()):null]})}));function CC({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:r,id:i,index:a,onRemove:o,style:s,renderItem:c,useDragOverlay:l,wrapperStyle:u}){let{attributes:d,isDragging:f,isSorting:p,listeners:m,overIndex:h,setNodeRef:g,transform:_,transition:v}=eb({id:i,animateLayoutChanges:t,disabled:e,getNewIndex:n});return(0,Z.jsx)(vC,{ref:g,value:i,disabled:e,dragging:f,sorting:p,handle:r,renderItem:c,index:a,style:s({index:a,id:i,isDragging:f,isSorting:p,overIndex:h}),onRemove:o?()=>o(i):void 0,transform:_,transition:v,wrapperStyle:u({index:a,isDragging:f,id:i}),listeners:m,"data-index":a,"data-id":i,dragOverlay:!l&&f,...d})}var wC=`_TabStrip_3x0dp_1`,TC=`rgb(33, 115, 70)`,EC=`#eee`,DC=e=>(0,Z.jsx)(gC,{...e}),OC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,style:r,className:i,selectedTabIndex:a=0,tabNames:o=[],onSelectedTabIndexChange:s,onTabNameChange:c,onTabMove:l,renderScrollButtonStart:u=ve,renderScrollButtonEnd:d=R,renderScrollButtonEdge:f=_e,renderTabButton:p=DC,renderTabDivider:m,propsEditLabel:h,disabled:g=!1,disableDrag:_=!1,background:v=`white`,activeColor:y=TC,borderColor:b=EC,borderWidth:x=1,seam:S=!0}=e,[C,w]=(0,X.useState)(a),[T,E]=(0,X.useState)(o),D=(0,X.useCallback)(e=>{let t=P.current?.[e]?.closest(`.sxl-tab-item`)??P.current?.[e];if(!t||!H.current)return;let n=H.current,r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom||n.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:`smooth`})},[]);(0,X.useEffect)(()=>{D(a)},[a]);let O=(0,X.useCallback)((e,t)=>{t!==C&&(w(t),s?.(t))},[s,C]),k=(0,X.useCallback)((e,t)=>{l?.(e,t),w(n=>n===e?t:e<n&&t>=n?n-1:e>n&&t<=n?n+1:n)},[l]),A=(0,X.useRef)(null),[j,M]=(0,X.useState)(-1),N=(0,X.useCallback)((e,t)=>{c?.(e,t)},[c]);(0,X.useLayoutEffect)(()=>{w(a)},[a]),(0,X.useLayoutEffect)(()=>{E(o)},[o]);let P=(0,X.useRef)([]),I=(0,X.useRef)(null);(0,X.useImperativeHandle)(t,()=>Object.assign({startEdit(e){P.current?.[e]?.startEdit()},cancel(e){P.current?.[e]?.cancel()}},I.current),[C,j]);let L=(0,X.useCallback)(({value:e,index:t,dragging:n})=>{let{style:r,maxLength:i,...a}=h||{},o=(0,Z.jsx)(pC,{ref:e=>{P.current[t]=e},value:e,disabled:g,maxLength:i,style:{color:C===t&&y?y:`inherit`,flex:`1 1 100%`,paddingTop:`1px`,paddingBottom:`1px`,...r},styleHover:{},onSubmit:e=>(A.current=!1,M(-1),N(t,e)),onCancel:()=>{A.current=!1,M(-1)},onChange:e=>{A.current=!0,M(t)},...a});return(0,Z.jsx)(ae,{render:p,props:{onClick:e=>O(e,t),value:e,index:t,editing:j===t&&A.current,editable:!0,disabled:g,selectedIndex:C,background:v,activeColor:y,borderColor:b,borderWidth:x,dragging:n,children:o}})},[C,N,O,h,g,j,p]),[ee,{width:te}]=F(),[z,{width:B}]=F(),H=(0,X.useRef)(null),[ne,U]=(0,X.useState)({left:0,top:0,width:0,height:0}),[W,re]=(0,X.useState)(null);(0,X.useEffect)(()=>{W!==null&&H.current&&H.current.scrollTo({left:W,behavior:`smooth`})},[W]);let ie=(0,X.useCallback)((e,t=!1)=>{if(!H.current)return 0;let n=H.current.firstChild.getBoundingClientRect(),r=H.current.firstChild.firstChild.children,i=0;return i=t?0:Me.getScrollTo(e,n.left,r,!0,Math.max(0,e-200)),re(i),Math.max(0,i)},[]),G=(0,X.useCallback)((e,t=!1)=>{if(!H.current)return 0;let n=H.current.firstChild.getBoundingClientRect(),r=H.current.firstChild.firstChild.children,i=0,a=Math.ceil(B-te);return i=t?a:Me.getScrollTo(e,n.left,r,!1,Math.max(0,e+200)),re(i),Math.min(a,i)},[B,te]),oe=(0,X.useRef)(null),se=(0,X.useRef)(null),ce=(0,X.useCallback)(()=>{se.current&&(clearTimeout(se.current),se.current=null,oe.current=null)},[]),le=(0,X.useCallback)((e,t,n=260)=>{oe.current=e,se.current=setTimeout(()=>{let n=t?ie(oe.current||e):G(oe.current||e);n===oe.current?ce():le(n,t,120)},n)},[ie,G,ce]);(0,X.useEffect)(()=>()=>ce(),[ce]);let ue=(0,X.useMemo)(()=>({style:{marginLeft:`4px`,marginRight:`6px`},disabled:Math.floor(ne.left)<=0||Math.floor(B-te)===0,orientation:V.Horizontal,isBefore:!0,onMouseUp:ce,onMouseLeave:ce,onMouseDown:e=>{e.preventDefault(),le(H.current.scrollLeft,!0)},onClick:e=>ie(Math.min(H.current.scrollLeft,W??2**53-1),e.ctrlKey)}),[ne,W,B,te]),de=(0,X.useMemo)(()=>({style:{marginLeft:`6px`,marginRight:`4px`},disabled:Math.floor(B-te)<=Math.ceil(ne.left),orientation:V.Horizontal,isBefore:!1,onMouseUp:ce,onMouseLeave:ce,onMouseDown:e=>{e.preventDefault(),le(H.current.scrollLeft,!1)},onClick:e=>G(Math.max(H.current.scrollLeft,W??0),e.ctrlKey)}),[ne,W,B,te]),fe=(0,X.useMemo)(()=>(0,Z.jsxs)(Z.Fragment,{children:[f?(0,Z.jsx)(`div`,{style:{minWidth:`16px`}}):null,n,(0,Z.jsx)(ae,{render:f,props:ue})]}),[ue,de,u,d,n,f]);return(0,Z.jsxs)(`div`,{style:{...r,display:`flex`,alignItems:`stretch`},className:Q(i,wC),ref:I,children:[(0,Z.jsx)(`div`,{style:{borderTop:S?`solid ${b} ${x}px`:void 0,position:`absolute`,width:`100%`}}),(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:fe}),(0,Z.jsx)(`div`,{className:`sxl-Tabs`,ref:ee,style:{flex:`1 1 100%`,display:`flex`,position:`relative`,overflow:`hidden`},children:(0,Z.jsx)(`div`,{style:{position:`relative`,overflowY:`hidden`,overflowX:`hidden`,marginBottom:`3px`},ref:H,onScroll:e=>{U({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:(0,Z.jsx)(SC,{isDisabled:e=>g||_,items:T,strategy:Vy,modifiers:[mC,hC],ref:z,renderItem:L,renderDivider:m,onMove:k,activationConstraint:{distance:15}})})}),(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:(0,Z.jsx)(ae,{render:f,props:de})})]})}));OC.displayName=`TabStrip`;var kC={"sheet-tab":`_sheet-tab_1cbiv_2`,ghost:`_ghost_1cbiv_18`},AC=e=>{let{disabled:t,editing:n,...r}=e;return(0,Z.jsx)(`div`,{...r})},jC=(e,t)=>`color-mix(in srgb, ${e} ${t}%, transparent)`,MC={top:3,right:4.5,bottom:1.5,left:4},NC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,sheet:r,style:i,className:a,value:s,index:c,editing:l,editable:u,disabled:d,selectedIndex:f,dragging:p,borderColor:m,borderWidth:h,activeColor:g,background:_=`white`,tabRadius:v=4,slotSurface:y=AC,inverted:b=!0,...x}=e,S=r?.isIWorksheet?r:null,C=()=>{let e=S?.getProtection();return e?e.isPaused()?`LockOpen`:e.isLocked()?`Lock`:null:null},[w,T]=(0,X.useState)(C),[E,D]=(0,X.useState)(()=>r?r.getTabColor():null);o(r,{onProtectionChange:()=>{T(C())},onTabColorChange:()=>{D(r.getTabColor())},onStyleChange:()=>{D(r.getTabColor())}});let O=f===c,k=Ye(),A=!O&&!p&&!E,j=p&&!E&&!O,N=null,P=null;if(E||p||A){let e=_,t=e,n=e;E?(P=E.toBlackOrWhite().toCSS(),e=E.toCSS(),t=jC(e,75),n=jC(e,10)):O||(e=`var(--sxl-color-base-100)`);let r=`linear-gradient(0deg, ${e} 0%, ${t} 60%, ${n} 90%, transparent 100%)`;N=(0,Z.jsx)(`div`,{className:Q(kC.pill,A&&kC.ghost),style:{position:`absolute`,boxSizing:`border-box`,top:`3px`,left:`4px`,right:`4.5px`,bottom:`1.5px`,opacity:O?.5:1,borderRadius:`4px`,border:A?void 0:j?`1px solid var(--sxl-tab-hover-border)`:O?`${_} solid 1px`:`var(--sxl-color-base-300) solid 1px`,background:A?void 0:j?`linear-gradient(var(--sxl-tab-hover-bg), var(--sxl-tab-hover-bg)), var(--sxl-color-base-100)`:O&&E?r:e}})}let F=m??null,L=O?(0,Z.jsx)(`div`,{style:{width:`100%`,borderRadius:`4px`,minWidth:`4px`,height:`2px`,backgroundColor:`var(--sxl-color-primary)`}}):null,R=O?`var(--sxl-color-primary)`:P||`color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent)`;return(0,Z.jsx)(`div`,{ref:t,className:Q(a),"data-sxl-theme-surface":O?`grid`:void 0,"data-sxl-theme-mode":O?k:void 0,style:{...i,display:`flex`,flexDirection:`column`,minHeight:`0px`,fontFamily:`var(--sxl-font-family)`,fontWeight:O?700:400,fontSize:`0.85rem`,letterSpacing:`0`,lineHeight:`1`,textTransform:`none`,minWidth:`unset`,cursor:p?`grabbing`:void 0,"--sxl-tab-hover-bg":`var(--sxl-color-base-100)`,"--sxl-tab-hover-border":`var(--sxl-color-base-300)`},...x,children:(0,Z.jsx)(I,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},radius:v,variant:O&&b?`tab`:`rounded`,clipInset:O&&b?void 0:MC,strokeColor:O?F:`transparent`,children:(0,Z.jsxs)(y,{className:kC[`sheet-tab`],disabled:d,editing:l,style:{position:`relative`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,textTransform:`none`,borderRadius:`0px`,minHeight:`0px`,paddingLeft:`11px`,paddingRight:`12px`,paddingTop:`3px`,paddingBottom:`3px`,flex:`1 1 100%`,fontWeight:O?700:400,fontSize:`0.85rem`,letterSpacing:`0`,cursor:p?`grabbing`:d?`default`:`pointer`,color:R,backgroundColor:O?_:`transparent`,minWidth:`unset`,"--sxl-sheet-tab-input-color":`var(--sxl-color-base-content)`},children:[N,(0,Z.jsxs)(`div`,{style:{zIndex:1,display:`flex`,flexDirection:`row`,alignItems:`center`},children:[r&&r.getKind()!==`worksheet`?(0,Z.jsx)(Ax,{kind:r.getKind(),style:{width:`14px`,height:`14px`,marginRight:`4px`,flex:`none`}}):null,(0,Z.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,rowGap:`1px`,lineHeight:`1`,marginTop:O?void 0:`1px`},children:[n,L]}),w?(0,Z.jsx)(M,{iconKey:w,style:{scale:`0.80`,marginLeft:`2px`,width:`22px`,height:`22px`}}):(0,Z.jsx)(`div`,{style:{minHeight:`22px`}})]})]},s+`:`+c)})})}));NC.displayName=`SheetTab`;var PC=(0,X.memo)(e=>{let{icons:t,order:n=`ascending`,size:r=16,gap:i=4,style:a,...o}=e,s=n===`descending`?[...t].reverse():t;return(0,Z.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`${i}px`,lineHeight:1,...a},...o,children:s.map((e,t)=>e?(0,Z.jsx)(M,{iconKey:e.iconKey,size:r,style:{color:e.color,flex:`0 0 auto`}},t):(0,Z.jsx)(`span`,{style:{width:`${r}px`,height:`${r}px`,flex:`0 0 auto`}},t))})});PC.displayName=`IconSetGlyphs`,a({FindScopeOptions:()=>FC});var FC={Workbook:`workbook`,Sheet:`sheet`};function IC(e,t){let n=t.workbook;if(!n)return()=>{};let r=t,i=r?.notifier,a=e=>e??n.getSelectedSheetIndex(),o=e=>n.getSheets()[a(e)];e.updateCommand(`addSheet`,{callback:e=>{n.getWorksheets().add({index:e,autoSelect:!0})}}),e.updateCommand(`deleteSheet`,{callback:e=>{o(e)?.delete()}}),e.updateCommand(`duplicateSheet`,{callback:async e=>{let t=o(e);t?.isIWorksheet&&(await t.duplicate())?.select()}}),e.updateCommand(`hideSheet`,{callback:e=>{o(e)?.setVisibility(Bn.Visibility.Hidden)}}),e.updateCommand(`nextSheet`,{callback:e=>{n.getNextSheet(a(e)).select()}}),e.updateCommand(`previousSheet`,{callback:e=>{n.getPreviousSheet(a(e)).select()}}),e.updateCommand(`selectNextSheet`,{callback:e=>{n.getNextSheet(a(e)).select()}}),e.updateCommand(`selectPreviousSheet`,{callback:e=>{n.getPreviousSheet(a(e)).select()}}),r?.focusNameBox&&e.updateCommand(`activeNameBox`,{callback:()=>{r.focusNameBox()}}),e.updateCommand(`activeNameManager`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.Names)}});let s=e=>{if(!e||!r.editable)return;let t=`=${e.getName()}(`;ks(r.editable,`${t})`,{mode:`edit`,initialSelection:{start:t.length,end:t.length}}),r.editable.getSession()?.getActiveEditor()?.focus()},c=async()=>{let e=n.getCalculation();return await e.start(),e.getFunctions()},l=()=>({searchByCategory:async e=>(await c()).search({category:e,type:`formula`}),searchByText:async(e,t)=>e?.trim()?(await c()).search({text:e,category:t?.category,limit:t?.limit,type:`formula`}):g.EmptyArray,getCategories:async()=>(await c()).getCategories({type:`formula`})}),u;e.updateCommand(`insertFunction`,{tags:[`noTransaction`],callback:e=>{s(e)},context:l}),e.updateCommand(`insertFunctionDialog`,{tags:[`noTransaction`],callback:i?.showWindow?()=>{let e=r.editable?.getAnchor().getCoords()??null;i.showWindow(`insertFunction`,{context:l,onInput:t=>{typeof t==`string`?((e,t)=>{let n=r.editable;n&&(Os(n,e)?n.getSession()?.getActiveEditor()?.focus():n.startEdit(t??n.getAnchor().getCoords(),{dirty:e,mode:`edit`,autoFocus:!1})&&n.commit())})(t,e):s(t)}})}:void 0,context:l});let d=()=>{let t=n.getSelectedWorksheet(),r=t&&!t.getProtection().isFormatCellsAllowed()?[C(`reason.sheetProtected`)]:[];e.updateCommand(`insertFunction`,{disabledReasons:r}),e.updateCommand(`insertFunctionDialog`,{disabledReasons:r})},f=()=>{u?.(),u=n.getSelectedWorksheet()?.addListeners({onProtectionChange:d}),d()};f();let p=e=>{let t=n.getCalculation(),r=t.getStatus();t.calculate(e).then(t=>{globalThis.__sxlKeyDebug&&console.log(`[calc] ${e?`calculateFull`:`calculateAll`}: status ${r} -> ${t}`)})};e.updateCommand(`calculateAll`,{callback:()=>{p(!1)}}),e.updateCommand(`calculateFull`,{callback:()=>{p(!0)}}),e.updateCommand(`refreshAll`,{callback:()=>{n.getCalculation().calculate({full:!0,external:!0});let e=n.getPivotTables();e.getItems().length!==0&&e.refreshAll().catch(e=>{i?.showError?.(e)})}});let m=[`noTransaction`,`noRepeat`],h=()=>{let t=n.getCalculation(),r=t.getCalculationMode(),i=[[`calcModeAutomatic`,Nn.CalculationMode.Automatic],[`calcModeAutomaticExceptTables`,Nn.CalculationMode.AutomaticExceptTables],[`calcModeManual`,Nn.CalculationMode.Manual]];for(let[n,a]of i)e.updateCommand(n,{state:r===a,tags:m,callback:()=>{t.setCalculationMode(a)}});e.updateCommand(`calcIterativeToggle`,{state:t.getIterativeCalculation().enabled,tags:[...m,we],callback:()=>{t.setIterativeCalculation(!t.getIterativeCalculation().enabled)}})};h();let _=n.getCalculation().addListeners({onOptionsChange:h});e.updateCommand(`workbookStatistics`,{callback:()=>{i?.showWindow&&i.showWindow(`workbookStatistics`,{context:()=>({getWorkbook:()=>n})})}});let v=async(e,t)=>{let r=n.getSelectedRanges(),a;try{a=await(e?r?.getDependents(t):r?.getPrecedents(t))}catch(e){i?.showError?.(e);return}if(a)try{await a.select()}catch(e){i?.showError?.(e)}else i?.showMessage?.(j(e?`formulaTrace.noDependents`:`formulaTrace.noPrecedents`))};e.updateCommand(`selectDirectPrecedents`,{callback:()=>v(!1,!1)}),e.updateCommand(`selectPrecedents`,{callback:()=>v(!1,!0)}),e.updateCommand(`selectDirectDependents`,{callback:()=>v(!0,!1)}),e.updateCommand(`selectDependents`,{callback:()=>v(!0,!0)}),e.updateCommand(`selectTheme`,{callback:e=>{e&&n.setTheme(e)},...r?.themes?{context:()=>({theme:n.getTheme(),themes:r.themes})}:{}}),e.updateCommand(`deleteCellStyle`,{callback:e=>{e?.delete()}}),e.updateCommand(`modifyCellStyle`,{callback:e=>{let t=e?.named,r=n.getSelectedWorksheet();t&&r&&n.getStyles().getNamedStyles().set({name:t.getName(),style:r.getSelectedRange().getCell().getStyle()})}}),e.updateCommand(`newCellStyle`,{callback:()=>{i?.showInput&&i.showInput({initialValue:(()=>{let e=0;for(;;){e++;let t=`Style ${e}`;try{return n.getStyles().validateStyleName(t,!0),t}catch{}}})(),title:j(`dialog.newCellStyle.title`),description:j(`dialog.newCellStyle.description`),inputLabel:j(`dialog.newCellStyle.inputLabel`),propsInput:{style:{minWidth:`300px`}},options:[`Ok`,`Cancel`],defaultOption:`Ok`,onValidateInput:async e=>{let t=e??``,r=null;try{n.getStyles().validateStyleName(t,!1)}catch(e){r=e.message}let i=n.getStyles().getNamedStyles().getByName(t);return{valid:r===null,message:r??(i?`Update style '${i.getName()}'.`:void 0)}}}).then(({input:e,option:t})=>{let r=n.getSelectedWorksheet()?.getSelectedRange();if(t!==`Ok`||!r)return;let i=n.getStyles().getNamedStyles().set({name:e,style:r.getCell().getStyle()});r.getStyle().update({named:i.getName()})})}});let y=r?.findMemory,b=()=>y?.getLastFind?.()??null,x=async e=>{let t=0,r=null,a=C(`op.findReplace`);e?.replace&&!e?.replaceOptions?.maxCount&&(a=C(`op.replaceAll`));let o=await Promise.resolve(i?.showBusy?.(j(a))??null);try{let a=n.getSelectedWorksheet();if(!a)return 0;let s={from:a.getSelectedCell(),...e.findOptions},c=(e?.scope??`sheet`)===`sheet`?a.find(s):n.find(s);if(e.replace){let i=n.replace(c,e.replaceText,e.replaceOptions);t=i.count,e.replaceOptions?.maxCount&&(r=i.last)}else{let e=c.next();e.done||(t++,r=e.value)}r?.select({scrollIntoView:!0,autoFocus:!1}),o?.(),!e.replaceOptions?.maxCount&&t>1&&i?.showMessage?.(j(`findReplace.replaced`,{count:t}))}catch(e){o?.(),i?.showError?.(e)}return t},S=async e=>{let t=await x(e),n=(e=>{let t=e.findOptions;return t?.text?{text:t.text,matchCase:t.matchCase,matchEntireCell:t.matchEntireCell,useRegex:t.useRegex,fields:t.fields,axis:t.axis,scope:e.scope}:null})(e);return n&&(y?.setLastFind?.(n),E()),t},w=(e=!1)=>{if(!i?.showWindow)return;let t=n.getSelectedCell(),r={initialValue:{findOptions:{text:(t.getFormulaText({target:`display`})??t.getText({useFormattingCategory:!0}))||b()?.text||``},replace:e},context:()=>S,autoFocus:!0,disableAutoDestroy:!0};i.showWindow(`find`,r)};e.updateCommand(`find`,{callback:()=>w(!1)}),e.updateCommand(`findReplace`,{callback:()=>w(!0)});let T=e=>{let t=b();if(!t)return;let{scope:n,...r}=t;return x({findOptions:{...r,reverse:e},scope:n,replace:!1})};function E(){let t=b()?[]:[C(`reason.noPreviousSearch`)];e.updateCommand(`findNext`,{disabledReasons:t}),e.updateCommand(`findPrevious`,{disabledReasons:t})}e.updateCommand(`findNext`,{callback:()=>{T(!1)}}),e.updateCommand(`findPrevious`,{callback:()=>{T(!0)}}),E(),e.updateCommand(`goto`,{callback:()=>{i?.showInput&&i.showInput({title:j(`dialog.goTo.title`),inputLabel:j(`dialog.goTo.inputLabel`),options:[{id:`Go To`,label:()=>j(`dialog.goTo`)}],onInput:async e=>{if(e)try{await n.getRanges(e).select()}catch(e){i.showMessage?.(e.message,{type:Te.Error})}}})}}),e.updateCommand(`selectNamed`,{callback:async e=>{if(e)try{await e.select()}catch(e){i?.showError?.(e)}}}),e.updateCommand(`addNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(kd.Names,{args:{insert:!0}})}}),e.updateCommand(`editNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&r?.activateTaskPane?.(kd.Names,{args:{edit:e}})}}),e.updateCommand(`deleteNamedReference`,{callback:e=>{e?.delete?.()}}),e.updateCommand(`manageExternalLinks`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`settings`?`settings`:`links`;r?.activateTaskPane?.(kd.ExternalLinks,{args:{tab:t}})}}),e.updateCommand(`activateTask`,{callback:()=>{i?.showInput&&i.showInput({title:j(`dialog.activateTask.title`),inputLabel:j(`dialog.activateTask.inputLabel`),options:[{id:`Activate`,label:()=>j(`dialog.activate`)}],onInput:async e=>{if(e)try{r?.activateTaskPane?.(e)}catch(e){i.showError?.(e.message)}}})}});let D=()=>{let t=n.getView();t&&(e.updateCommand(`workbookViewToggleShowFormulaBar`,{state:t.isShowFormulaBar(),callback:()=>{t.setShowFormulaBar(!t.isShowFormulaBar())}}),e.updateCommand(`workbookViewToggleShowTabs`,{state:t.isShowTabs(),callback:()=>{t.setShowTabs(!t.isShowTabs())}}),e.updateCommand(`workbookViewToggleShowStatusBar`,{state:t.isShowStatusBar(),callback:()=>{t.setShowStatusBar(!t.isShowStatusBar())}}),e.updateCommand(`workbookViewToggleShowHorizontalScrollBar`,{state:t.isShowHorizontalScrollbar(),callback:()=>{t.setShowHorizontalScrollbar(!t.isShowHorizontalScrollbar())}}),e.updateCommand(`workbookViewToggleShowVerticalScrollBar`,{state:t.isShowVerticalScrollbar(),callback:()=>{t.setShowVerticalScrollbar(!t.isShowVerticalScrollbar())}}))};D();let O=()=>{e.updateCommand(`locale`,{state:n.getPinnedLocale(),callback:e=>{n.setLocale(e??null)}})};O();let k=()=>{let t=n.getProtection().isStructureAllowed()?[]:[`The workbook structure is protected.`];for(let n of[`addSheet`,`duplicateSheet`,`selectTheme`,`deleteNamedReference`])e.updateCommand(n,{disabledReasons:t});let i=Zg(r.taskPaneArea,kd.Names);for(let n of[`addNamedReference`,`editNamedReference`])e.updateCommand(n,{disabledReasons:[...t,...i]});e.updateCommand(`activeNameManager`,{disabledReasons:i}),e.updateCommand(`manageExternalLinks`,{disabledReasons:Zg(r.taskPaneArea,kd.ExternalLinks)});let a=n.getSheets().length<=1,o=[...t,...a?[`A workbook must have at least one visible sheet.`]:[]];e.updateCommand(`hideSheet`,{disabledReasons:o}),e.updateCommand(`deleteSheet`,{disabledReasons:o})};k();let A=n.addListeners({onSheetsChange:()=>{k()},onViewChange:()=>{D(),O()},onProtectionChange:()=>{k()},onSelectedSheetChange:()=>{f()}});return()=>{A(),_(),u?.()}}var LC={dynamic:(e,t)=>{let n=t.manager?Yf(e,{manager:t.manager,notifier:t.notifier}):void 0,r=IC(e,t);return()=>{n?.(),r()}}},RC=new class{constructor(){this._loadedIO=null,this._loadPromise=null,this._backingStore=null,this._listeners=new Set,this._lazyDefaultStore={write:async e=>(await this._loadIO()).getBackingStore().write?.(e)??null}}async _loadIO(){return this._loadedIO?this._loadedIO:(this._loadPromise||=(async()=>{try{let e=await d(()=>import(`./BnZX0sxceYpvtg3I.js`),__vite__mapDeps([20,8,7,21,22]),import.meta.url);return await ar.install(e.IOPlugin),this._loadedIO=ar,this._loadedIO.addListeners({onRead:(e,t)=>{for(let e of this._listeners)e.onRead?.(this,t)},onWrite:(e,t)=>{for(let e of this._listeners)e.onWrite?.(this,t)}}),this._backingStore&&this._loadedIO.setBackingStore(this._backingStore),this._loadedIO}catch(e){throw this._loadPromise=null,e}})(),this._loadPromise)}async getReadFormats(e){return(await this._loadIO()).getReadFormats(e)}async getWriteFormats(e){return(await this._loadIO()).getWriteFormats(e)}async install(e){return(await this._loadIO()).install(e)}getOrigin(e){return new cr(e)}async read(e){return(await this._loadIO()).read(e)}async writeArrayBuffer(e,t){return(await this._loadIO()).writeArrayBuffer(e,t)}async write(e,t,n){return(await this._loadIO()).write(e,t,n)}async writeAs(e,t,n){return(await this._loadIO()).writeAs(e,t,n)}getBackingStore(){return this._backingStore??(this._loadedIO?this._loadedIO.getBackingStore():this._lazyDefaultStore)}setBackingStore(e){this._backingStore=e??null,this._loadedIO?.setBackingStore(this._backingStore)}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}addListeners(e,t){return this._listeners.add(e),()=>{this._listeners.delete(e)}}addCommitListener(e){return this.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}get isIWorkbookIO(){return!0}},zC=async(e,t={})=>{let{io:n=RC,defaultTheme:r}=t;if(e instanceof sr)return e;if(!e||!g.isPromiseLike(e)&&Object.keys(e).length===0)return new sr({theme:r});let i=await Promise.resolve(e);return i instanceof sr?i:i&&i.source?n.read(i):i},BC=(e,t={})=>{let{io:n,defaultTheme:r,reloadKey:i}=t,a=(0,X.useRef)({io:n,defaultTheme:r});a.current={io:n,defaultTheme:r};let[o,s]=(0,X.useState)(()=>e instanceof sr&&!e.getFonts().isLoading()?{status:`loaded`,workbook:e}:{status:`loading`}),c=(0,X.useRef)(o);return c.current=o,(0,X.useEffect)(()=>{let t=!0;return s(e=>e.status===`loaded`?e:{status:`loading`}),(async()=>{try{let n=await zC(e,a.current);if(!t)return;let r=c.current,i=n??(r.status===`loaded`?r.workbook:new sr({theme:a.current.defaultTheme}));if(await i.whenFontsReady(),!t)return;s(e=>e.status===`loaded`&&e.workbook===i?e:{status:`loaded`,workbook:i})}catch(e){if(!t)return;s({status:`error`,error:e})}})(),()=>{t=!1}},[e,i]),o},VC=!1,HC=null,UC=async e=>{if((await Kn.getDetails()).isEval()){try{let e=top??window;e.SheetXL||=Object.freeze({getSelectedWorkbook:()=>HC?.getWorkbook(),getSelectedWorksheet:()=>HC?.getWorkbook().getSelectedWorksheet()??null,getSelectedRange:()=>HC?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>HC?.getWorkbook().getSelectedRanges(),getRange:e=>HC?.getWorkbook().getRange(e),getSelectedWorkbookElement:()=>HC,getLicenseManager:()=>Kn,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:`Set an array of values.`},"SheetXL.getRange('a1:e5').setValue(100, { autoSelect: true })":{Summary:`Set a single repeating value to a range.`},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:`Get the values as a 2d array (see forEach).`},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:`Set current date/time using Javascript Date.`},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:`Set current date/time using string.`},"SheetXL.getSelectedWorksheet().getUsedRange().getValues()":{Summary:`Get all of the values in a sheet.`},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:`Set fill to theme color 4.`},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:`Set some columns to a modified theme color.`},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:`Set border.`},"SheetXL.getSelectedRange().getStyle().getFill().toCSS()":{Summary:`Get the fill style as css for the selected range.`},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:`Autofill down.`},"SheetXL.getRange('e7:i9').merge({ axis: 'rows' })":{Summary:`Merge cells horizontally.`},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:`Sort selected cells ascending with a header.`},"SheetXL.getSelectedRange().clear('all')":{Summary:`Clear the current range a different way.`},"SheetXL.getSelectedWorksheet().getTables().add('b2:e9')":{Summary:`Create a 4x8 table at b2 for current sheet.`},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:`Copy cells.`},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:`Set the size of columns to 30 pixels.`},"SheetXL.getRange('2:3').delete()":{Summary:`Remove rows 2 and 3 and shift up.`},"SheetXL.getSelectedWorksheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg')":{Summary:`Add an image.`},"SheetXL.getSelectedWorksheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:`Add an image of height 100.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:`Set value to 100 and numberformat to 0% as a single.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:`Set a value and style to Note style and autofit text.`},"SheetXL.getSelectedWorkbook().getNames().addFormula('Small_Range', 'A2:E5');":{Summary:`Add a named range.`},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:`Listen for updates at a range.`}})}})}catch(e){e instanceof DOMException||console.error(e),VC=!0}if(HC!==e&&(HC=e,!VC))try{VC=!0,(top??window).SheetXL&&(await Kn._validate(!0),Kn.wasPrinted()&&(()=>{g.consoleWithNoSource(`%cTip: You can access the API directly in the console.
46
+ Try
47
+ %c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
48
+ >%c SheetXL.moreExamples()`,`color:#ffa726;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`),VC=!0;let e=document.getElementById(`openEditorLink`);e&&e.addEventListener(`click`,e=>{e.preventDefault(),console.log(`openScriptEditor called from console`)})})())}catch(e){e instanceof DOMException||console.error(e)}}},WC=`_add-button_1b4ig_1`,GC=e=>(0,Z.jsx)(NC,{...e}),KC=`var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3)))`,qC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,workbook:r,onBeforeUserChange:i,onUserChange:a,disabled:s=!1,readOnly:c=!1,className:l,style:u,condensed:d=!1,seam:f=!0,renderSheetTab:p=GC,onTabContextMenu:m,renderScrollButtonStart:h,renderScrollButtonEnd:g,renderScrollButtonEdge:_,...v}=e,y=je(),b=f?`solid ${KC} 1px`:void 0,x=d?null:h,S=d?null:g,C=d?null:_,w=(0,X.useRef)(null),T=(0,X.useRef)(null);(0,X.useImperativeHandle)(t,()=>Object.assign({startEdit(e){T.current?.startEdit(e)},cancel(e){T.current?.cancel(e)}},w.current),[]);let[E,D]=(0,X.useState)(r?.getSelectedSheetIndex()),[O,k]=(0,X.useState)(r?.getSheets()??[]),[A,j]=(0,X.useState)(()=>r?.getProtection().isStructureAllowed()??!0);o(r,{onViewChange(e){D(e?.getSelectedSheetIndex())},onSheetsChange:e=>{k(e.getSheets())},onProtectionChange:e=>{j(e?.getProtection().isStructureAllowed()??!0)}});let N=c||!A,P=`var(--sxl-color-base-300)`,F=(0,X.useMemo)(()=>{let e=[];for(let t=0;t<O.length;t++)e.push(O[t].getName());return e},[O]),I=(0,X.useCallback)(e=>{!1!==i?.(e)&&(r.getSheets()[e]?.select(),a?.(e))},[r,i,a]),L=(0,X.useCallback)((e,t)=>{r.getSheets()[e]?.setName(t),a?.(e)},[r,a]),R=(0,X.useCallback)((e,t)=>{r.getSheets()[e]?.setIndex(t),a?.(t)},[r,a]),ee=K(()=>{if(!1===i?.(E))return;let e=E+1;r.getWorksheets().add({name:void 0,index:e,autoSelect:!0}),a?.(e)},[r,i,a,E]),te=K(e=>{let t=r.getSheets()[e.index];return t?p({sheet:t,inverted:!d,onContextMenu:m?t=>{I(e.index),m(t,e.index)}:void 0,...e}):null},[r,d,p,m,I]),z=K(e=>{let{style:t,...n}=e;return(0,Z.jsx)(`div`,{...n,style:{alignSelf:`stretch`,width:`1px`,marginLeft:`-1px`,marginTop:`6px`,marginBottom:`6px`,background:P,...t}})},[P]),B=(0,X.useMemo)(()=>N?null:(0,Z.jsx)(`button`,{type:`button`,className:Q(`sxl-workbook-strip-add`,WC),disabled:s,"aria-label":`addTab`,title:y(`workbookStrip.newSheet`),onMouseDown:e=>{e.button===0&&e.preventDefault()},onClick:()=>ee(),children:(0,Z.jsx)(M,{iconKey:`AddCircle`,style:{width:`18px`,height:`18px`}})}),[s,N,ee,y]);return(0,Z.jsxs)(`div`,{ref:w,className:Q(`sxl-workbook-strip`,l),style:{position:`relative`,display:`flex`,alignItems:`stretch`,flex:`1 1 100%`,maxWidth:`100%`,...u},...v,children:[(0,Z.jsx)(OC,{ref:T,selectedTabIndex:E,tabNames:F,onSelectedTabIndexChange:I,onTabNameChange:L,onTabMove:R,background:`var(--sxl-color-base-100)`,borderColor:KC,seam:f,activeColor:null,disabled:s,disableDrag:N,renderTabButton:te,renderTabDivider:z,renderScrollButtonStart:x,renderScrollButtonEnd:S,renderScrollButtonEdge:C,propsEditLabel:{readOnly:N,maxLength:31,styleHover:{fontWeight:`700`},onKeyPress:e=>{r.isValidSheetNameCharacter(e.key)||e.preventDefault()},onCancel:()=>{a?.(E)}},children:n}),(0,Z.jsx)(`div`,{style:{borderTop:b,minWidth:`4px`}}),(0,Z.jsx)(`div`,{style:{borderTop:b,flex:`none`,display:`flex`,alignItems:`center`},children:B}),(0,Z.jsx)(`div`,{style:{borderTop:b,flex:1,minWidth:`24px`}})]})}));qC.displayName=`WorkbookStrip`;var JC=e=>{let{key:t,...n}=e;return(0,Z.jsx)(hx,{...n},t)},YC=e=>{let{key:t,...n}=e;return(0,Z.jsx)(jx,{...n},t)},XC=e=>(0,Z.jsx)(qC,{...e}),ZC=e=>cx(e),QC={"sheetxl-workbook":`_sheetxl-workbook_ooc7l_11`,"sheetxl-reset":`_sheetxl-reset_ooc7l_40`,viewport:`_viewport_ooc7l_75`},$C={version:1};vf();var ew={ignoreModelChange:!0},tw={flex:`1 1 100%`,display:`flex`,boxSizing:`border-box`},nw=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,rw=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{workbook:n,onWorkbookLoad:r,prefetch:i=`auto`,autoFocus:a=!1,style:s,className:c,onFocus:l,onBlur:d,onKeyDown:f,undoManager:p,focusNameBox:m,showTabs:h,propsTabs:g,renderTabs:_=XC,propsContextMenu:v,renderContextMenu:y,renderColumnMenu:b,renderPivotMenu:x,renderMovableMenu:S,renderFillMenu:C,propsFloatPanel:w,renderFloatPanel:T,renderWorkbookLoading:D=ZC,propsWorkbookLoading:O,propsSheet:k,editable:A,renderWorksheet:j=JC,renderOpaqueSheet:M=YC,wrapperMain:N,children:I,showHorizontalScrollbar:L,showVerticalScrollbar:R,colorScheme:ee,gridColorScheme:te,...z}=e;if(!n)throw Error(`IWorkbook must be provided.`);let B=(0,X.useRef)(null),V=xh(),H=(0,X.useRef)(null),ne=(0,X.useMemo)(()=>(0,Z.jsx)(`div`,{className:Q(`sheetxl-viewport`,QC.viewport),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`,pointerEvents:`none`},ref:H}),[]),[W,oe]=(0,X.useState)(!1),[ce,le]=(0,X.useState)(!1),ue=(0,X.useCallback)(()=>{oe(!0)},[]),de=(0,X.useRef)(null),fe=Ue(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>n,getSheetElement:()=>B.current,getViewportElement:()=>H.current,getCommandScope:()=>de.current,focus(){B&&B.current&&B.current.focus()}}),[n]),[pe,me]=(0,X.useState)(null),ge=(0,X.useCallback)(e=>{e&&me(e)},[]),_e=(0,X.useRef)(null);(0,X.useLayoutEffect)(()=>{W&&pe&&(async()=>{_e.current!==r&&(await r?.({source:pe}),_e.current=r??null),le(!0)})()},[W,pe]),(0,X.useEffect)(()=>{if(!ce||!i)return;Hn.getTypes(),Yt();let e=new AbortController,t=()=>{E.prefetch({signal:e.signal,onlyWhenFast:i===`auto`})};t();let n=navigator.connection;return window.addEventListener(`online`,t),n?.addEventListener?.(`change`,t),()=>{e.abort(),window.removeEventListener(`online`,t),n?.removeEventListener?.(`change`,t)}},[ce,i]);let ve=K(e=>{g?.onUserChange?.(e);let t=document.activeElement;t&&t!==document.body&&!fe.current?.contains(t)||requestAnimationFrame(()=>{B?.current?.focus()})},[g]),[Se,Ce]=(0,X.useState)(n.getSelectedSheet()),we=Se?.isIWorksheet?Se:null,[Te,Ee]=(0,X.useState)(n.getProtection());o(n,{onSheetsChange:e=>{Ce(e?.getSelectedSheet())},onViewChange(e){Ce(e?.getSelectedSheet())},onProtectionChange:e=>{Ee(e?.getProtection())}}),o(n,{onRequestSelect:async(e,t)=>new Promise(e=>{let n=B.current;t.isIWorksheet&&n&&n.getWorksheet()!==t?n.getGridSurface()?.onPaneChangeOnce(()=>{B.current?.getWorksheet()!==t&&e(!1),e(!0)}):e(!0)})},ew);let[ke,Ae]=(0,X.useReducer)(e=>e+1,0),je=n.getView();o(je,{onViewChange:e=>{Ae()}});let[Me]=P(qe.Mode,Ke[qe.Mode]),[Pe]=P(qe.DarkImages,Ke[qe.DarkImages]),{themeMode:Fe}=re({mode:ee??Me??void 0}),Ie=Ye(te),Le=(0,X.useId)(),Re=(0,X.useMemo)(()=>se(`workbook`,Le),[Le]),ze=(0,X.useMemo)(()=>Nt({scope:`.${Re}`}),[Re]),Be=(0,X.useMemo)(()=>ri(`sxl-defaults`,`.${Re}`),[Re]),[Ve,He]=(0,X.useState)({});(0,X.useLayoutEffect)(()=>{if(!pe)return;let e=getComputedStyle(pe),t=t=>e.getPropertyValue(t).trim()||void 0,n=t(`--icon-color`);He({base100:t(`--sxl-color-base-100`),primary:t(`--sxl-color-primary`),icon:n&&n!==`currentColor`?n:e.color||void 0})},[pe,Fe]);let We=(0,X.useMemo)(()=>({backgroundColor:Ve.base100,borderColor:Ve.primary,fillColor:Ve.icon??`grey`}),[Ve]),Ge=(0,X.useMemo)(()=>new Ne,[]),Xe=G.useCommandScope(),Ze=he(),Qe=Ud(),$e=Xr(),[et,tt]=(0,X.useState)(p??null);(0,X.useEffect)(()=>{if(!Xe)return void tt(null);if(p)return void tt(p);if(!n)return void tt(null);let e=new ur(n.getTransactions());return tt(e),()=>e.close()},[Xe,n,p]);let[nt,rt]=P(`workbook.lastFind`,null,$C),it=(0,X.useRef)(nt);it.current=nt;let at=(0,X.useMemo)(()=>({getLastFind:()=>it.current,setLastFind:rt}),[rt]),ot=(0,X.useMemo)(()=>({scopeName:{key:n?`workbook:${n.getId()}`:`workbook`,name:`workbook`},contributor:LC,data:{workbook:n,editable:A,notifier:Ze,manager:et??void 0,activateTaskPane:(e,t)=>Qe.activate(e,t),taskPaneArea:Qe,themes:$e,focusNameBox:m,findMemory:at}}),[n,A,Ze,et,Qe,$e,m,at]),st=h??je?.isShowTabs(),ct=L??je?.isShowHorizontalScrollbar(),lt=R??je?.isShowVerticalScrollbar(),[ut,{width:dt}]=F(),ft=dt===0||dt>560,pt=(0,X.useMemo)(()=>{if(!st||!_)return null;let e=(0,Z.jsx)(ae,{render:_,props:{condensed:!ft,seam:ft||xe.detectIt().primaryInput!==`touch`,workbook:n,...g,onUserChange:ve}});return ft?e:(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`},children:e})},[_,g,n,ft,st]),q=(0,X.useCallback)(e=>{let{style:t,...r}=e,i=null,a=null,o=null;if(ct&&we&&(a=(0,Z.jsx)(`div`,{className:`sxl-workbook-strip-scrollbar`,style:{display:`flex`,flex:`1 1 100%`,borderTop:nw,flexDirection:`column`,justifyContent:`center`},children:(0,Z.jsx)(Ig,{...r,style:{paddingLeft:`4px`,paddingRight:`4px`,...t},propsTouchThumb:We,endGap:700,sheet:we})})),st&&ft&&(o=pt),st&&ft&&!ct&&(o=(0,Z.jsxs)(`div`,{style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`},children:[o,(0,Z.jsx)(`div`,{style:{borderTop:nw,flex:`1`}})]})),o&&ct){let e=Ve.icon??`grey`;i=(0,Z.jsx)(ie,{position:n.getView().getTabRatio()/10+`%`,onPositionChange:({percent:e})=>{n.getView().setTabRatio(Math.round(10*e))},minBefore:`200px`,minAfter:`180px`,propsResizer:{style:{minWidth:`11px`,backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${e}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:`no-repeat`,backgroundPosition:`center`,borderTop:nw,borderBottom:`solid 3px transparent`}},elementBefore:o,elementAfter:a??void 0})}else if(ct)i=a;else{if(!o)return(0,Z.jsx)(`div`,{className:Q(`sxl-workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`,height:`1px`,width:`100%`,borderTop:nw}});i=o}return(0,Z.jsx)(`div`,{className:Q(`sxl-workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,width:`100%`,alignContent:`center`},children:i})},[we,n,st,ct,ft,pt,We,Ve]),[mt,ht]=(0,X.useState)(null),gt=cf(),_t=(0,X.useMemo)(()=>new G.ManualActivation(null),[]),vt=(0,X.useRef)(null),yt=(0,X.useMemo)(()=>({placement:`right-start`,...mt?.propsPopper}),[mt?.propsPopper]),{reference:bt,component:xt}=De({label:`contextMenu`,propsPopper:yt,anchor:mt?.anchor??{getBoundingClientRect:()=>new DOMRect(mt?.clientX||0,mt?.clientY||0)},onOpen:()=>{vt.current=mt},onClose:()=>{let e=vt.current;vt.current=null,e?.onClose?.(),e===mt&&ht(null)},renderPopupPanel:mt?.renderPopupPanel,renderFloatPanel:T});(0,X.useEffect)(()=>{mt?bt.open(0):bt.close(0)},[mt]);let St=K((e,t)=>!!e?.isDefaultPrevented()||!!b&&(e.preventDefault(),e.stopPropagation(),mt&&mt.anchor===e.currentTarget?(ht(null),!0):(_t.setAnchor(gt?.getAnchor()??null),ht({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>b({column:t,floatReference:bt,...v})}),!0)),[b,v,n,mt]),Ct=K((e,t)=>!!e?.isDefaultPrevented()||!!x&&(e.preventDefault(),e.stopPropagation(),mt&&mt.anchor===e.currentTarget?(ht(null),!0):(_t.setAnchor(gt?.getAnchor()??null),ht({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>x({fields:t,floatReference:bt,...v})}),!0)),[x,v,n,mt]),wt=K(e=>!!e.originalEvent?.isDefaultPrevented()||!!y&&(e.originalEvent?.preventDefault(),_t.setAnchor(gt?.getAnchor()??null),ht({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>y({workbook:n,floatReference:bt,...v})}),!0),[y,v,n]),Tt=K((e,t)=>!!C&&(e.originalEvent?.preventDefault(),_t.setAnchor(gt?.getAnchor()??null),ht({clientX:e.clientX,clientY:e.clientY,onClose:()=>{t.cancel()},renderPopupPanel:()=>C({workbook:n,menu:t,floatReference:bt,...v})}),!0),[C,v,n]),Et=K((e,t)=>!!e?.isDefaultPrevented()||!!S&&(e.preventDefault(),_t.setAnchor(gt?.getAnchor()??null),ht({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>S({movable:t,floatReference:bt,...v})}),!0),[S,v,n]),Dt=K(()=>{pe&&UC(pe)},[pe]),Ot=(0,X.useCallback)(e=>{let{style:t,...n}=e;return we?(0,Z.jsx)(Ig,{...n,style:{...t,paddingTop:`4px`,paddingBottom:`4px`},propsTouchThumb:We,sheet:we,endGap:700}):(0,Z.jsx)(Z.Fragment,{})},[we,We]);(0,X.useEffect)(()=>{a&&ce&&B.current&&B.current.focus(typeof a==`object`?a:void 0)},[a,ce]);let kt=(0,X.useRef)(null),At=(0,X.useMemo)(()=>ce||!D?null:(0,Z.jsx)(ae,{render:D,props:{...O}}),[ce,D,O]),jt=(0,X.useMemo)(()=>At?(0,Z.jsx)(`div`,{ref:kt,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,position:`absolute`,boxSizing:`border-box`,pointerEvents:s?.pointerEvents},children:At}):null,[At,s]),Mt=(0,X.useCallback)(e=>{let{movable:t}=e;return t?yd({onContextMenuCapture:e=>{Et(e,t)},...e}):(0,Z.jsx)(Z.Fragment,{})},[]),Pt=(0,X.useMemo)(()=>we?(0,Z.jsx)(ae,{render:j,props:{ref:B,style:tw,colorScheme:Fe,gridColorScheme:Ie,sheet:we,editable:A,onSheetContextMenu:wt,onFillMenu:Tt,viewport:Ge,showScrollbars:!1,viewportComponent:ne,onFirstRender:ue,renderMovable:Mt,...k,propsCellRender:{onColumnButtonMouseDown:(e,t)=>{k?.propsCellRender?.onColumnButtonMouseDown?.(e,t),St(e,t)},onPivotButtonMouseDown:(e,t)=>{k?.propsCellRender?.onPivotButtonMouseDown?.(e,t),Ct(e,t)},...k?.propsCellRender}}}):null,[k,we,Fe,Ie,A]),Ft=(0,X.useMemo)(()=>{if(!we){let e=(0,Z.jsxs)(`div`,{ref:ut,style:{...tw,display:`flex`,flexDirection:`column`},children:[(0,Z.jsx)(ae,{render:M,props:{sheet:Se,onFirstRender:ue}},Se?.getId()),pt?(0,Z.jsx)(`div`,{className:Q(`sxl-workbook-strip-area`),style:{display:`flex`,flex:`none`,width:`100%`,borderTop:nw},children:pt}):null]});return N?N(e):e}let e=(0,Z.jsx)(Oe,{ref:ut,style:tw,viewport:Ge,zoomable:!0,showHorizontalScrollbar:ct||st,showVerticalScrollbar:lt,renderScrollbarHorizontal:q,renderScrollbarVertical:Ot,children:Pt});return ft||dt===0||(e=(0,Z.jsxs)(Z.Fragment,{children:[e,pt]})),N?N(e):e},[ct,st,q,lt,Ge,ft,Pt,pt,N,we,Se,M]),It=(0,X.useMemo)(()=>({boxSizing:`border-box`,fontFamily:`var(--sxl-font-family)`,"--sxl-image-filter":Ie===`dark`&&Pe?`hue-rotate(180deg) invert(1) brightness(95%)`:`none`,...s}),[Ie,Pe,s]),Lt=(0,X.useMemo)(()=>({flex:`1 1 100%`,width:`100%`,display:`flex`,flexDirection:`column`,opacity:!ce&&At?0:void 0}),[ce,At]),Rt=u([fe,ge]);return(0,Z.jsx)(Je.Provider,{value:Ie,children:(0,Z.jsx)(ye,{renderFloatPanel:T,propsFloatPanel:w,themeScopeClass:Re,themeSurface:`app`,themeMode:Fe,children:(0,Z.jsx)(hr,{workbook:n,children:(0,Z.jsx)(G.CommandScopeProvider,{spec:ot,scopeRef:de,elementRef:fe,children:(0,Z.jsx)(Xf.Provider,{value:et,children:(0,Z.jsxs)(`div`,{className:Q(`sheetxl-workbook`,QC[`sheetxl-workbook`],QC[`sheetxl-theme`],be,Re,c),style:It,"data-sxl-theme-mode":Fe,...z,ref:Rt,onFocus:e=>{Dt(),l?.(e)},onBlur:e=>{d?.(e)},onKeyDown:e=>{f?.(e)},children:[(0,Z.jsx)(U,{css:ze}),(0,Z.jsx)(U,{css:Be}),(0,Z.jsxs)(`div`,{className:QC[`sheetxl-reset`],style:Lt,children:[(0,Z.jsxs)(Sh,{value:V,children:[I,Ft]}),(0,Z.jsx)(G.CommandAnchorProvider,{tracker:_t,keyBindings:!1,children:xt})]}),jt]})})})})})})}));rw.displayName=`WorkbookElementBase`;var iw=e=>{let{colorScheme:t,children:n}=e,[r]=P(qe.Mode,Ke[qe.Mode]),{themeMode:i}=re({mode:t??r??void 0}),a=(0,X.useId)(),o=(0,X.useMemo)(()=>se(`workbook`,a),[a]),s=(0,X.useMemo)(()=>Nt({scope:`.${o}`}),[o]);return(0,Z.jsxs)(`div`,{className:o,"data-sxl-theme-mode":i,style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--sxl-color-base-100)`,color:`var(--sxl-color-base-content)`,fontFamily:`var(--sxl-font-family)`},children:[(0,Z.jsx)(U,{css:s}),n]})},aw=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{workbook:n,renderWorkbookError:r=lx,renderWorkbookLoading:i=ZC,propsWorkbookLoading:a,onWorkbookChange:o,...s}=e,c=BC(n),l=c.status===`loaded`?c.workbook:null,u=K(o??(()=>{}),[o]),d;return(0,X.useEffect)(()=>{u(l)},[l]),d=c.status===`error`?(0,Z.jsx)(iw,{colorScheme:s.colorScheme,children:(0,Z.jsx)(ae,{render:r,props:{error:c.error}})}):c.status===`loaded`?(0,Z.jsx)(rw,{ref:t,...s,workbook:c.workbook,renderWorkbookLoading:i,propsWorkbookLoading:a}):(0,Z.jsx)(iw,{colorScheme:s.colorScheme,children:(0,Z.jsx)(ae,{render:i,props:{...a}})}),(0,Z.jsx)(Df,{children:d})}));aw.displayName=`WorkbookElement`;var ow=`/workbook.sxl`,sw=()=>new Promise(e=>requestAnimationFrame(()=>e())),cw=async()=>{await sw(),await sw()},lw=e=>/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`'${e.replace(/'/g,`''`)}'`,uw,dw,fw=new Promise((e,t)=>{uw=e,dw=t}),pw=fetch(ow).then(e=>{if(!e.ok)throw Error(`workbook fetch failed: ${e.status}`);return e.arrayBuffer()}).then(e=>RC.read({source:e,format:`sxl`,calcOnLoad:`none`})).then(e=>{if(!e)throw Error(`The workbook could not be read.`);return e});pw.catch(e=>dw(e));var mw=X.createRef(),hw=null,gw=(e,t)=>{if(t){let n=e.getRange(t);return{sheet:n.getWorksheet(),coords:{...n.getCoords()}}}let n=e.getActiveSheet();if(!n)throw Error(`The workbook has no worksheet to frame.`);let r=n.getUsedRange();return{sheet:n,coords:r?{...r.getCoords()}:{rowStart:0,colStart:0,rowEnd:0,colEnd:0}}},_w=()=>{let e=mw.current?.getSheetElement();if(!e)throw Error(`The sheet has not rendered.`);return e};window.__sheetxlScreenshot={ready:fw,async measure(e){await fw;let t=await pw,{sheet:n,coords:r}=gw(t,e.range);t.getActiveSheet()!==n&&(await n.select(),await cw());let i=n.getView();i.setFreezePanes(null),i.setZoomScale(100),i.setShowRowHeaders(e.headers),i.setShowColumnHeaders(e.headers),i.setShowRowGridlines(e.gridlines),i.setShowColumnGridlines(e.gridlines);let a=n.getRowHeaders().getMetrics(),o=n.getColumnHeaders().getMetrics();i.setTopLeft({left:o.getOffset(r.colStart),top:a.getOffset(r.rowStart)}),await cw(),hw={sheet:n,coords:r,headers:e.headers};let s=_w(),c=e.headers?s.getRowHeaderElement().getBoundingClientRect().width:0,l=e.headers?s.getColumnHeaderElement().getBoundingClientRect().height:0;return{width:Math.ceil(c+o.getOffset(r.colEnd+1)-o.getOffset(r.colStart))+2,height:Math.ceil(l+a.getOffset(r.rowEnd+1)-a.getOffset(r.rowStart))+2,range:`${lw(n.getName())}!${n.getRange(r).getA1()}`}},async clip(){if(!hw)throw Error(`measure() must be called before clip().`);let{sheet:e,coords:t,headers:n}=hw,r=await pw;await r.whenFontsReady(),await cw(),await ce(r),await cw();let i=_w().getGridSurface().getPane(),a=i?.getElement();if(!i||!a)throw Error(`The grid has not rendered.`);let o=a.getBoundingClientRect(),s=i.getBoundsFromRange(t),c=o.left+s.x,l=o.top+s.y,u=e.getRowHeaders().getMetrics(),d=e.getColumnHeaders().getMetrics(),f=(e,t,n,r)=>{let i=t;for(;i<n&&e.getOffset(i+2)-e.getOffset(t)<=r;)i++;return i},p=f(d,t.colStart,t.colEnd,window.innerWidth-c),m=f(u,t.rowStart,t.rowEnd,window.innerHeight-l),h={...t,colEnd:p,rowEnd:m},g=c+d.getOffset(p+1)-d.getOffset(t.colStart),_=l+u.getOffset(m+1)-u.getOffset(t.rowStart),v=n?0:c,y=n?0:l;return{x:v,y,width:Math.ceil(g-v)+1,height:Math.ceil(_-y)+1,shown:`${lw(e.getName())}!${e.getRange(h).getA1()}`}}},dr.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(aw,{ref:mw,workbook:pw,showTabs:!1,showHorizontalScrollbar:!1,showVerticalScrollbar:!1,style:{position:`absolute`,inset:0},onWorkbookLoad:async()=>{await cw(),uw()}}));