@sheetxl/mcp 0.8.0-beta.23 → 0.8.0-beta.24
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.
- package/assets/{CSisGJ4hiDhTi19U.js → 2YT_wstXIH6UIigi.js} +1 -1
- package/assets/{E-KM5RFByUxjlkId.js → 3VycPrqi6qgLOgGY.js} +6 -6
- package/assets/{B2zUUqxAJ1RiM7YI.js → 6CBUVbF01Bedq0e2.js} +43 -43
- package/assets/{BVUfaOAGhdMim8yB.js → 76dPHG5RYA7MUV_g.js} +3 -3
- package/assets/{CtlrxXVgZDIOcuc1.js → 7IzItpr7MkdnaAwh.js} +169 -169
- package/assets/{BBuB6ffvyg2Cd7V5.js → 7vPlH3_rhJxmmBvG.js} +1 -1
- package/assets/{aTxgpOOxLenli4af.js → 9GnbVPKozgrJpeLW.js} +1 -1
- package/assets/{DuQU8JjPLBIK804w.js → B-5mBXpY9i6-eCrZ.js} +29 -29
- package/assets/{CH8DNTUgM79xk8Tt.js → B-t1q2NS61c2B8E4.js} +1 -1
- package/assets/{BomatnedZsGMF7MW.js → B16G2473LTkZP6Mq.js} +150 -131
- package/assets/{DoP6myQHGI-X1gNy.js → B4uS01J0mrSJSftQ.js} +84 -84
- package/assets/{CC7EfXPwp7_nSBIz.js → B6caaQsfOpFEgYQ4.js} +1 -1
- package/assets/{2xkoVdiI70Gpaxoc.js → B7lATTNffVTrDsKE.js} +2 -2
- package/assets/{DgLQfXTWavoBetna.js → B8bEJ65vQRqsfBlS.js} +5 -5
- package/assets/{BGxwDpW8DkO8W0Ig.js → BAVltO4Xf7lC0Xr6.js} +1 -1
- package/assets/{CgYef9dYxY8YyUTE.js → BH7ctzMzOYVTGxzA.js} +1 -1
- package/assets/{CBMMHYgUAhgiJhJE.js → BJqo8c5bFKjnq69G.js} +11 -11
- package/assets/{CQCPJBQD0qv9y8qE.js → BJwiwzwx4Bl5L4Vq.js} +1 -1
- package/assets/{BJMeWtr7TiLNpt17.js → BPNLZ07Bu_B8Yhf1.js} +1 -1
- package/assets/{BWeaY19OpTJK5v0n.js → BWLavTnANLUerdS0.js} +2 -2
- package/assets/{gver5Sz7ZO6ZyrOi.js → BXWGS09xFG81nnIT.js} +1 -1
- package/assets/{DvkBNkPyR5kuS0Uo.js → BaYk1vO2hP2S3_1w.js} +2 -2
- package/assets/{PVGDjdR9C4stMNpM.js → BifwlrCmEVtjh_1U.js} +1 -1
- package/assets/{BPtf3_nlovO4r9Bm.js → BjyXkr-CzV8mVx0t.js} +1 -1
- package/assets/{DACd4ZjYwzNE7Koc.js → BkHeIMSE7-LehRCs.js} +1 -1
- package/assets/{DLuQ_rdu0XjYF7Jq.js → BkekCZ17YTtd07_C.js} +2 -2
- package/assets/{BDSNdgf_hbhX1DhN.js → BnNB_ejvNaLu6B3o.js} +1 -1
- package/assets/{f_dBJuakO_BJ7Tvm.js → BrJd9jVVv9SQzZol.js} +335 -335
- package/assets/{1J1R3dclFOh322Yr.js → BrYc6PLonux_gI6b.js} +209 -209
- package/assets/{CrTLWpsRNBSyTLor.js → BxwB3iTNSE1TgHkb.js} +1 -1
- package/assets/{Cx1bc-Dsja7W3GlB.js → By1QPrSxtnRiJu0R.js} +2 -2
- package/assets/{jKIDENA_QP4bEX49.js → ByYJTTTUuu67hDF-.js} +4 -4
- package/assets/{DXmebUOAhtW4V6BO.js → C-nA4SXN5hWHaxV6.js} +556 -556
- package/assets/{BNEBXKAh-N4Tygk7.js → C0uu0vLKQh0S508B.js} +23 -23
- package/assets/{Bjk1Twm0RFO_3fS8.js → C6PNMev7cs5JLgwy.js} +1 -1
- package/assets/{Cl04_aSpBHTwfsQR.js → C9iFJ52KwQTePQ81.js} +10248 -10246
- package/assets/{dep8oZGwBmUpxjHl.js → CCF6CwJ6cbeLRl23.js} +1 -1
- package/assets/{Cg1tSmK_AGJa2VeI.js → CEk658HeLJk2cAjM.js} +3 -3
- package/assets/{DiJexWBIzdGj1H0H.js → CFNtPYPfDPH-3BXK.js} +1 -1
- package/assets/CFT_tDogP98gTbh7.js +304 -0
- package/assets/{BKpicdc9H5WnZPb-.js → CFWwwr74qRKOBrg9.js} +1 -1
- package/assets/{5MnsnJcajdtAujE2.js → CIY_RiLu1_FmRLAA.js} +1 -1
- package/assets/{DcO0gub7cRKVw4xB.js → CIw6ZC3K9x-ccacl.js} +1 -1
- package/assets/{KhdF512BKcJXZMvq.js → CJ2hV-9ipqOEkLSG.js} +1 -1
- package/assets/{wKkW4LO-iUp92LVC.js → CKD460cQOgwF6uSV.js} +1 -1
- package/assets/{NDe-uS1n_Q7u1H3m.js → CM-q_J5aF6YXmjeu.js} +3 -3
- package/assets/{a9lvcAd7rWsWSWAo.js → CR1aLf7CWEfPTO9a.js} +1 -1
- package/assets/{BlhJHu9ni2T9IaM1.js → CSXmTA6w6Pnbtqvb.js} +1 -1
- package/assets/{DfBERTJjS9LP0RSp.js → CT4czEKWIj1GeQN8.js} +1 -1
- package/assets/{Dg5QmWm0uBTEjZy4.js → CUYQlZz5zWsUdmRy.js} +1 -1
- package/assets/{ChbkkN_JqbAGrUwB.js → CbJWbjmv4bz4ppIZ.js} +303 -303
- package/assets/{C8G_px4dGuR2KjJh.js → Cf0zmfQYfJ7zM0Ya.js} +1 -1
- package/assets/{2XwVsSfo5wF5K-HA.js → Ch9w7xFxVMrvGuC_.js} +1 -1
- package/assets/{BZaXHnsJ6RkCZsnz.js → CmkgQ5-IG0BSCM3R.js} +3 -3
- package/assets/{DZt1ONN8CTTfmHGn.js → CmwNIrRssYuLN2fn.js} +606 -606
- package/assets/{t4qTfgdlstczTs2z.js → CnI4Nli8vtWdFKvf.js} +21 -21
- package/assets/{BdUFL3lVdwifHrf0.js → CnKX5SPVE2iuSK42.js} +1 -1
- package/assets/{DPjWOMoJ-elAAOmS.js → CpvJUGg9ckuCIpIS.js} +1 -1
- package/assets/{DN1RRp4qQfCq3JAO.js → Cxzowsi6ASdZtzeI.js} +1 -1
- package/assets/{BYbzf-TVwbKQPCyK.js → CzRvg04_TIbwBH5C.js} +3 -3
- package/assets/{D7oYfHgO0kEqAnPV.js → D-vo2bQyAmStQmD9.js} +1 -1
- package/assets/{Cl8_HMhRgzPzqFc7.js → D6d1DKL15m52ZCuC.js} +1 -1
- package/assets/{DUytcsu0MV3GnsrM.js → D8k9de_hen-KqBWe.js} +1 -1
- package/assets/{B3YRTBFhX61z6rJv.js → DE7G34oYbvrfXbJ7.js} +385 -380
- package/assets/{YtxPcFPURJF6CxWu.js → DFVQIZ2zZyAphhCF.js} +1 -1
- package/assets/{BynbAjhJnLjyP7HH.js → DGI_8HyNF0eAv0P5.js} +1 -1
- package/assets/{DtETpSxSR8C1voac.js → DGOgx3-IyO8bjF_t.js} +94 -94
- package/assets/{CyhngJo16o7G18lq.js → DIgPlkEabQdKNUQn.js} +1 -1
- package/assets/{KMTTqSwDthnXnD4F.js → DJGYlGr2Zj7SkYqc.js} +1 -1
- package/assets/{BazhmjGvrL7pqVQP.js → DJfpKncnYnrr28G0.js} +1 -1
- package/assets/{DV3PnM9lo0AW-YOA.js → DL8pez0eKo8arYPj.js} +3 -3
- package/assets/{BcWSfKJ9Atkc0X_p.js → DM-yGHahbfA_uarn.js} +1 -1
- package/assets/{DIAQ_WlBCWhgHt-z.js → DMDTS0LH9Ke9t-3z.js} +1 -1
- package/assets/{D5O3m16KeyU_oXqH.js → DNSWaXblwhTtI3w7.js} +1 -1
- package/assets/{D-PYDPXobSWiPh1D.js → DOSWSyKkK4eSi4PD.js} +2 -2
- package/assets/{Bbmh8_bdk_HrQ5Y6.js → DPLTGglaPovTg9e5.js} +1 -1
- package/assets/{WuKVkvMPAOmRaCDY.js → DPYFRLJbHGlrcrJq.js} +2 -2
- package/assets/{CqP4H_-kRRjcxO91.js → DRq6lQLndj73WT35.js} +1 -1
- package/assets/{BI8kb-rd9dW85XJs.js → DRzZ4bEyLRGVOLzV.js} +1 -1
- package/assets/{CnUYevzhUJYNqLad.js → DUbIxDAzW1dzrtdI.js} +1 -1
- package/assets/{Dawi8y7JWn6A9gAx.js → DXCTHw-ZutNIuo_2.js} +1 -1
- package/assets/{CEsRqYMd5IjnAzzX.js → D_tdoUtUe7cApQJn.js} +4 -4
- package/assets/{WH1Vl-MDWX3vSMn1.js → DaF9L7No8h8a-cqb.js} +2 -2
- package/assets/{BULbMlvQuB2WFBFE.js → DaHD9SY75O8wDy3p.js} +2 -2
- package/assets/{C6_KHS3-ROddeSbS.js → Daaro0HbHkKXkBP-.js} +2 -2
- package/assets/{CE-9VKh5-Xwxnxmu.js → DczQhB3mRSUw6GCf.js} +1 -1
- package/assets/Dfv_T_PQVL0O3lu5.js +14 -0
- package/assets/{Cidwv57sKqhIrpHP.js → Dhy6iU_09lrQnOAV.js} +28 -28
- package/assets/{DL8wUEe2Kx7bjDYP.js → Dk9zYXO3VoBhTdex.js} +1 -1
- package/assets/{DrKr8dXQEQ3Aukmt.js → DkQ4kxEKhKYQgfjK.js} +1 -1
- package/assets/{BLr8y5StL65VZQxG.js → Dlqk7XqKnAZ8Pcj3.js} +89 -89
- package/assets/{CwrOCbcS4IHLsERQ.js → DqSBb1HmgeU7eg_i.js} +84 -84
- package/assets/{D60N4r1a2YsNEwqj.js → Ds4TB1hn56-RK6_f.js} +1 -1
- package/assets/{L9RIicOHtZd2Rx8g.js → DtVSjxL6N_7WyM8Z.js} +1 -1
- package/assets/{CGLapmkNccH1g_ZJ.js → DuEtCJEnG_GnJzTX.js} +1 -1
- package/assets/{DJ2jlogB1DWlGM-J.js → DwNcvKM47ZHfvQM6.js} +1 -1
- package/assets/{DbbNJyL67KdOK7nc.js → DyiH3LlinD-38bG7.js} +1 -1
- package/assets/{DSyZaCML62gSnudE.js → Jy-_0a72nn5Iv1NK.js} +1 -1
- package/assets/{CPZgEZ2jKoo7hS6g.js → KMzONx2Ps841nJHj.js} +8 -8
- package/assets/{CndRpNCcV89ncnqz.js → LM2rVDHdB0jVUFcT.js} +1 -1
- package/assets/{D5PpcRuJYSv0i2y9.js → MosMza0-rXD8uHX_.js} +2 -2
- package/assets/{sIWsnPhnHm_MeeM9.js → NAWWzA_hk4wYtsPP.js} +2 -2
- package/assets/{BbU6aT_c6-4tkcCw.js → P6V3JAiRpC3BWceC.js} +1 -1
- package/assets/{CzoRlNMlpFz4iax3.js → TZnuVwhVjkOBax9F.js} +2 -2
- package/assets/{BEsnJS5jYwkHNcZd.js → TdDTOcC1TYhk6UuR.js} +1 -1
- package/assets/{CE5DhB5As59VJ-Ig.js → Xccc6oxtlSvJUDsC.js} +1 -1
- package/assets/{BPorbjbkH-VoV1M0.js → a2e_g9YI3J-lUD7-.js} +1 -1
- package/assets/{MzfM7zDcnyOFK1lK.js → b8yACuWy67eIj_j2.js} +1 -1
- package/assets/{CpyybSV2kR6b-SIB.js → bv3fZLUPzd14I58C.js} +263 -263
- package/assets/{DAliB9N1z6qnw4NO.js → doqBmhonQlHp-1Ud.js} +1 -1
- package/assets/{CCBQDcCHI47PZ0YQ.js → fEfisM0E2fUYKIyU.js} +5 -5
- package/assets/{q1rCdlJA6Z7tA6om.js → flby0g5gyZ9P2Wu2.js} +1 -1
- package/assets/{DKKLWACR9GsidnkS.js → g2Nu44uuSJFMzxEV.js} +2 -2
- package/assets/{Bz08KxFupjbdsoFx.js → mZt9BTEejCJZ4YK4.js} +1 -1
- package/assets/{Dol52NFQzLCbObuC.js → qc7rA-Z3a4rkVQPx.js} +225 -225
- package/assets/{DL7_uGw6KiZhlvR8.js → sJVPCrgeh0U6LbAK.js} +1 -1
- package/assets/{CHG4ZuzhyjGRuKBg.js → suLYEZBtGUhSYeB7.js} +1 -1
- package/assets/{qjyVXZeVSr_qZfX5.js → tWO-mE87mAuj1qih.js} +2 -2
- package/assets/{PiFW6uPRJABzK3V1.js → xD41vsQY6h60lCqz.js} +14 -14
- package/assets/{CeVCLRwjkH3_OXJu.js → yz2PTfYm_8EGJPM5.js} +1 -1
- package/index.js +191 -191
- package/lib.js +1 -1
- package/licenses/dependencies.txt +114 -114
- package/package.json +2 -2
- package/screenshot-page/assets/{Ce8b0lOBuWKlfLzJ.js → B-0-chiwq4MIUQy9.js} +1 -1
- package/screenshot-page/assets/{C9a-cNha8mBw5q-l.js → B7pXfEVkcbaMBMhc.js} +1 -1
- package/screenshot-page/assets/{CAQ7QWes7j7Fq8o5.js → BDRMUi2BsnBqytIq.js} +1 -1
- package/screenshot-page/assets/{DrnzLCa7NIirMxno.js → BEjJHVSbtlsNtoq7.js} +3 -3
- package/screenshot-page/assets/{JM0_BaBZ3yF6lnHC.js → BIuMiduMHSsTGacU.js} +2 -2
- package/screenshot-page/assets/{DvRXbyteeo_8sy8T.js → BKwDvElKinpn1IK0.js} +1 -1
- package/screenshot-page/assets/{Cbbl3H042tb0krfe.js → BTJ1NNUzHotNDiDe.js} +2 -2
- package/screenshot-page/assets/BbT5KRhoeAKLzy54.js +2 -0
- package/screenshot-page/assets/{BAxPBeFudRJ3OqIC.js → BcZPWw18bdj_ZvA9.js} +1 -1
- package/screenshot-page/assets/{B2PWru6Ty7ODc2Ie.js → Bfq6-treWd_rRiWl.js} +1 -1
- package/screenshot-page/assets/{Bml69dFBVggmVWda.js → Bg9UyX4yrB2mSdJt.js} +23 -23
- package/screenshot-page/assets/Bxq4FCQhyPbVhhaR.js +2 -0
- package/screenshot-page/assets/{DEAD_MduPNVoT_T6.js → CNB6WmYfGVZjlCKV.js} +1 -1
- package/screenshot-page/assets/{DtQFcMvZesaQ4xRf.js → CSFFMEKyxEFaykqL.js} +1 -1
- package/screenshot-page/assets/{DXbOBAxx4_2rt5KM.js → CXeJV1BW2CVemhPE.js} +1 -1
- package/screenshot-page/assets/{DMbFr7oWja7Qpsm6.js → C_YKEkTsGB_5gFNg.js} +2 -2
- package/screenshot-page/assets/{D7Y0npF3FMsGUjgO.js → CkxmJxdtjBIxYoMq.js} +1 -1
- package/screenshot-page/assets/CtiTwHzd_ZSzd3W2.js +1 -0
- package/screenshot-page/assets/{ONNSfQ8RDOqBDsvw.js → CwCu_r0BW41uLt3P.js} +2 -2
- package/screenshot-page/assets/{CEL5lzj2NDYwJ-HC.js → Cx9eq2x1gIXGki3Q.js} +1 -1
- package/screenshot-page/assets/D43IayseD2Cy8OZo.js +4 -0
- package/screenshot-page/assets/{CaOsWPeN_FXseSNg.js → D6Ciix7JAZtdKqmj.js} +1 -1
- package/screenshot-page/assets/{D4hvW_TF7vwc-Xlq.js → D6EXAYU-ZH8hjx_7.js} +2 -2
- package/screenshot-page/assets/D7Yt7xmUlA6-Lq0Q.js +48 -0
- package/screenshot-page/assets/{B3yyoGGGl8ICyeoC.js → D8KyhLvfyjLZW92H.js} +6 -6
- package/screenshot-page/assets/DBxAatsD6aWk7Zb6.js +586 -0
- package/screenshot-page/assets/{BjJ_nnNDZEPLpapa.js → DGkaCFHx4PsOJkFu.js} +1 -1
- package/screenshot-page/assets/{CGx-ZSMV9cPOzbu4.js → DM6hr-bvWV50-Oex.js} +2 -2
- package/screenshot-page/assets/{C5-sm7wuk62Nzm_p.js → DOVt9zHz7FQ2KUQM.js} +1 -1
- package/screenshot-page/assets/{Cengqc8q8BTmNfb_.js → DR-og7vslxlOZd8j.js} +1 -1
- package/screenshot-page/assets/{CaP_vH0sJFjNrSkW.js → DSTlKGmqncM7XHeW.js} +1 -1
- package/screenshot-page/assets/Dh14XQinAphjZOKC.js +1 -0
- package/screenshot-page/assets/{CiFaOHqsDQTE4RRi.js → DmDFKv_3APEWI-IY.js} +2 -2
- package/screenshot-page/assets/{DgLZb-StwCd9ftop.js → Dt8JxbBBr2TeDflQ.js} +1 -1
- package/screenshot-page/assets/Dxi-bXNjS-CpC5Qr.js +1 -0
- package/screenshot-page/assets/{BT2nkqpteSR9booH.js → DynKB5GH-vfFMJEy.js} +1 -1
- package/screenshot-page/assets/{C-n8BDiksNjX6Orz.js → FqdZRM336KMEcsbU.js} +1 -1
- package/screenshot-page/assets/Oay0yGsGYgJDzy8r.js +1 -0
- package/screenshot-page/assets/{Cv0zGWEBpmC07Jps.js → Pt9ne0xkE2icD3Ih.js} +1 -1
- package/screenshot-page/assets/{EOw6vVvEfYNga9b4.js → QZg76Jflu3Q808W3.js} +1 -1
- package/screenshot-page/assets/{BJct69niPZc8L_gZ.js → WTrYzPnMQhYDILMR.js} +1 -1
- package/screenshot-page/assets/{BTKdl-XR9TlWaFe7.js → a3fvt1Klg1uGE7p6.js} +5 -5
- package/screenshot-page/assets/{Be1S5czBx0lxhYLW.js → clrFU8i-0wNkmbs7.js} +1 -1
- package/screenshot-page/assets/r2HZG9_SMzF3__ID.js +13 -0
- package/screenshot-page/index.html +7 -7
- package/types/scripting-api.json +5745 -5743
- package/types/scripting.d.ts +22 -3
- package/assets/DU2Dzzu0oY_eDN6i.js +0 -14
- package/assets/bsnhRuD-K-qhW-y5.js +0 -304
- package/screenshot-page/assets/37LAUhU1_yKtsBlH.js +0 -2
- package/screenshot-page/assets/B3c6NBI22E5SZWG-.js +0 -1
- package/screenshot-page/assets/B56KxTxcAXDom0g4.js +0 -13
- package/screenshot-page/assets/Bh2DVAOWvWfylt77.js +0 -1
- package/screenshot-page/assets/BoiQQ-37KQn6NcLT.js +0 -1
- package/screenshot-page/assets/CcVllJMjVF6SvVVq.js +0 -2
- package/screenshot-page/assets/CyfTQE0Z76Rp4Fbt.js +0 -586
- package/screenshot-page/assets/D2CxEHjkPQMAxzWl.js +0 -1
- package/screenshot-page/assets/DVQnEWIisXaOXb_G.js +0 -4
- package/screenshot-page/assets/_zzVe2R8R4vwuc5q.js +0 -48
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B3c6NBI22E5SZWG-.js","./BoiQQ-37KQn6NcLT.js","./CbXtAM7H-Jg_J0dk.js","./gU2zeJaXoNh7QI_e.js","./CQ-33-es3XJ56pR4.js","./Bdb0azxGoCh6NBDk.js","./CI3Z1f4amZ9G2rPD.js","./ChSvXfVMLxZsP9zG.js","./HclGiUj8dZXDFmoM.js","./0UZBKpOOsp7P-DkP.js","./J73KTOmdZGNmnq-z.js","./DACSL7FA_J91Z_H7.js","./DgLZb-StwCd9ftop.js","./CAQ7QWes7j7Fq8o5.js","./3Ls_kOvlQseMV8Q0.js","./nHThFXCAZFOM_npq.js","./CaOsWPeN_FXseSNg.js","./DknSteOdQ6CdF0RT.js","./zEVoxCTt-ZW8Aowg.js","./DKVB6ddRfDJatYid.js","./JM0_BaBZ3yF6lnHC.js","./Cbbl3H042tb0krfe.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"./gU2zeJaXoNh7QI_e.js";import{n as a}from"./DKVB6ddRfDJatYid.js";import{n as o,t as s}from"./CQ-33-es3XJ56pR4.js";import{n as c,t as l}from"./Bdb0azxGoCh6NBDk.js";import{t as u}from"./YH1wNXzhQbkuWxeS.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"./0UZBKpOOsp7P-DkP.js";import{$ as P,A as F,B as I,D as L,F as R,G as z,H as ee,I as B,J as V,K as H,L as U,M as W,N as te,O as G,P as ne,Q as re,R as K,S as ie,U as ae,V as oe,X as se,Y as ce,Z as le,_ as ue,a as de,at as fe,b as pe,c as me,ct as he,d as ge,dt as _e,et as ve,f as ye,ft as be,g as xe,h as q,i as Se,it as Ce,j as we,k as Te,l as Ee,lt as De,m as Oe,n as ke,nt as Ae,ot as je,p as Me,q as Ne,r as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,w as Ve,x as He,y as Ue,z as We}from"./CI3Z1f4amZ9G2rPD.js";import{a as Ge,i as Ke,n as qe,o as Je,r as Ye}from"./CGx-ZSMV9cPOzbu4.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 mt,Q as ht,R as gt,S as _t,T as vt,U as yt,V as bt,W as xt,X as St,Y as Ct,Z as wt,_ as Tt,a as Et,b as Dt,c as Ot,d as kt,et as At,g as jt,h as Mt,i as Nt,j as Pt,k as Ft,m as It,n as Lt,o as Rt,p as zt,q as Bt,r as Vt,s as Ht,t as Ut,u as Wt,v as Gt,w as Kt,x as qt,y as Jt,z as Yt}from"./DACSL7FA_J91Z_H7.js";import{a as Xt,c as Zt,d as Qt,f as $t,i as en,l as tn,m as nn,n as rn,o as an,r as on,s as sn,t as cn,u as ln}from"./ONNSfQ8RDOqBDsvw.js";import{t as un}from"./BTOQaSn9DDyJPUlX.js";import{t as dn}from"./CBP4y6KFPu24xhDT.js";import{n as fn}from"./Dkf51CnZh2zPEGMd.js";import{t as pn}from"./C9SC-cEIt6gdhZRw.js";import{n as mn,r as hn}from"./BowRIybLgENunTOT.js";import{C as gn,D as _n,K as vn,Kt as yn,Ot as bn,W as xn,X as Sn,Yt as Cn,Z as wn,ht as J,kt as Tn,lt as En,t as Dn,v as On,wt as kn}from"./CAQ7QWes7j7Fq8o5.js";import{c as Y,i as An,t as jn}from"./CQukCzhuewMuFOlO.js";import{$ as Mn,A as Nn,Ca as Pn,Ci as Fn,Cn as In,E as Ln,Fn as Rn,Gi as zn,Ji as Bn,Ln as Vn,Lt as Hn,M as Un,Rt as Wn,c as Gn,ca as Kn,en as qn,ft as Jn,h as Yn,ji as Xn,l as Zn,la as Qn,m as $n,mt as er,n as tr,qt as nr,sn as rr,t as ir}from"./CyfTQE0Z76Rp4Fbt.js";import{r as ar}from"./CaOsWPeN_FXseSNg.js";import{f as or,i as sr,l as cr,n as lr,o as ur,r as dr}from"./DVQnEWIisXaOXb_G.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 fr=e(n(),1),X=e(t(),1),Z=i(),pr=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 mr=(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])},hr=(0,X.createContext)(null);function gr(e){let{workbook:t,children:n}=e;return s(t,[`onSelectedSheetChange`]),(0,Z.jsx)(hr.Provider,{value:t,children:(0,Z.jsx)(c,{sheet:t?t.getSelectedWorksheet():null,children:n})})}function _r(){return(0,X.useContext)(hr)}var vr=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()===jn.RichData,x=b?Yn.toPrimitive(y)??Yn.toDisplayText(y)??y:y,S=b?Yn.layoutTypeOf(y):v.getType(),C=y instanceof Ln,w=t.getStyle(),T=null,E=null,D=An.isError(y)&&y instanceof An.Parse,O=l||D;if(O){if(v.isSpillOverflow())E=``;else{let e=v.getFormulaText({target:`display`});e?E=e:T=v.getNumberFormat(Cn.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()&&(bn.BuiltInDefinitions.get(e.getStyle())?.width??0)>1&&(L=1);let t=w.getBorders().getBottom();!t.isNone()&&(bn.BuiltInDefinitions.get(t.getStyle())?.width??0)>1&&(R=1)}let z=w.getFont(),ee=z.getUnderline()===_n.UnderlineStyle.SingleAccounting||z.getUnderline()===_n.UnderlineStyle.DoubleAccounting,B=T?.conditionalColor??null,V=w.getAlignment(),H=V.getHorizontal()===J.HorizontalAlignment.Fill,U=V.getHorizontal()===J.HorizontalAlignment.CenterContinuous||H,W=!U&&!O&&V.getStacked(),te=U||O||W?0:V.getRotation(),G=v.getInsets(),ne=G.top+G.bottom,re=G.left,K=G.right,ie=A-1-(re+K),ae={...a,left:a.left-1,top:a.top-1,width:a.width+1+L,height:a.height+1+R},oe=!br&&!(p||C||i||(F?.runs.length??0)>1||k||te%360!=0||W||ee),se=U||!(!k||!(k.rightIndex>0||k.leftIndex>0||k.colSpan>1));if(!se){let e=v.getSpans();(e.width>1||e.height>1)&&(se=!0)}let ce={...ae};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&&(ie>0||te||W)){let o=ie,l=H||U||T&&(T.repeatChars.length>0||T.spacingChars.length>0),u=!(te||W||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!==jn.String&&Math.floor(t.width)>o){if(w.getNumberFormat()===`General`&&S===jn.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+re+K,height:t.height},f&&(n={...f.bounds});let ae=b!==null&&u&&!I&&!L;f||y||(ae?(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?V.getVertical()===J.VerticalAlignment.Center?n.y=(h-n.height)/2:V.getVertical()===J.VerticalAlignment.Bottom?n.y=h-n.height-ne:n.y=ne:n.y=b));let ce=oe?{...m}:void 0,le={style:{left:a.left-1,top:a.top-1,width:a.width+1,height:a.height+1,transform:te&&!f?`rotate(${te}deg)`:void 0,cursor:p?`pointer`:void 0,pointerEvents:p?`auto`:void 0,zIndex:se?1:void 0},...p?Ut:void 0,onClick:p,...ce};D&&(le.style.textDecorationStyle=`wavy`,le.style.textDecorationColor=`light-dark(red, rgb(0, 255, 255))`,le.style.textDecorationLine=`underline`);let ue=z.getSize(),de=z.toCSS(`adaptive`,s,!0),fe=z.getStrike(),pe=!!fe&&fe!==_n.StrikeStyle.None;if(C){de.color||=`var(--sxl-doc-color-hlink, #467886)`;let e=z.getUnderline();e&&e!==_n.UnderlineStyle.None||(de.textDecoration=pe?`underline line-through`:`underline`)}ee&&(de.textDecoration=pe?`line-through`:void 0);let me=(e,i,a,c,l,u,d,f=null)=>{let p,m=ue*s,h=a;if(d?.runs)p=d.runs;else{let t=w.measureText(e,m);p=[{type:Cn.ParseRunType.Text,text:e,width:t.width,letterSpacing:(t.renderLetterSpacing??0)/s}]}d&&d?.width!==t.width&&(t={...t,width:d?.width});let g=ae?0:re;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:Cn.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=z.getBaseline(),D=E<0;(D||E>0)&&(m*=Tn.SuperSubScale,w*=Tn.SuperSubScale);let O={textAlign:_,textAlignLast:_,...y,...de,fontSize:m*_n.getDeviceScale()};e.letterSpacing&&(O.letterSpacing=(z.getLetterSpacing()+e.letterSpacing)*s+`px`),oe||(O.background=yr?`pink`:void 0),B&&(O.color=B.toCSS(`adaptive`));let k=g+t,A=(b===null?G.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=oe?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(V.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===Cn.ParseRunType.Text||r.type===Cn.ParseRunType.Repeat)&&(r.type,Cn.ParseRunType.Repeat,_(r,v,e,i,l===J.HorizontalAlignment.Justify||l===J.HorizontalAlignment.Distributed||d&&d.lastRepeatIndex>=0?o:h.width,oe,{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=$n.layoutColumns($n.toColumns(I??L??``,!1,2**53-1),e,d.content,P,V.getVertical()));let n={lineHeight:e*s+`px`,textAlign:`center`,...de,fontSize:ue*s*_n.getDeviceScale()};B&&(n.color=B.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:se?1:void 0,background:yr?`pink`:void 0},...p?Ut:void 0,onClick:le.onClick,children:i},`text-stacked`))}else if(f){let e=f.angle,n=d.lineHeight,i=ue*s,a=V.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:se?1:void 0,...de,fontSize:i*_n.getDeviceScale()};u&&(d.letterSpacing=(z.getLetterSpacing()+u)*s+`px`),yr&&(d.background=`pink`),B&&(d.color=B.toCSS(`adaptive`)),r.push((0,Z.jsx)(`div`,{className:`sxl-text-line`,style:d,...p?Ut:void 0,onClick:le.onClick,children:c},`text-rot-${t}`))},l=(t,r)=>qn.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:Cn.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!==Cn.ParseRunType.Text&&n.type!==Cn.ParseRunType.Repeat||!n.text||a.push((0,Z.jsx)(`span`,{style:{position:`absolute`,left:i*s,top:0,whiteSpace:`pre`,letterSpacing:n.letterSpacing?(z.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,me(I??L??``,0,{...t,x:t.x??0,y:t.y??0},R.lines[0].baseline,P,!0,null,le)):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&&(V.getVertical()===J.VerticalAlignment.Distributed||V.getVertical()===J.VerticalAlignment.Justify)&&(u=Math.max(0,(h-(ne+3)-e.bounds.height*r)/(r-1)*n)),V.getVertical()===J.VerticalAlignment.Distributed&&te&&te%90==0&&te%180!=0&&(l=J.HorizontalAlignment.Distributed),l!==J.HorizontalAlignment.Justify&&l!==J.HorizontalAlignment.Distributed&&l!==J.HorizontalAlignment.Fill||(t={...t,width:o});let d=H||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,me(a,n,f,c.lines[0].baseline,l,s,r===1?F:null,oe&&n>0?{...le,style:{...le.style,background:void 0}}:le)}});if(ee&&!f&&!y&&!O&&r.length>0){let e=w.measureText(``),t=Math.max(1,Math.round(z.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===Cn.ParseRunType.Spacing;)c+=e[t].width,t++;let n=e.length-1;for(;n>=t&&e[n].type===Cn.ParseRunType.Spacing;)l-=e[n].width,n--}if(l>c){let e=n.y+(b===null?G.top:0)+i+a,o=z.getUnderline()===_n.UnderlineStyle.DoubleAccounting?[e,e+2*t]:[e],u=(B??z.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:se?1:void 0}},`accounting-underline-${e}`))}}}r.length>0&&(I=r),yr&&!oe&&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(oe)return I&&I.length>0?I:ie<=0?null:(0,Z.jsx)(`div`,{style:ce,...m});let le=null;if(br){let e=v.getTextPlacement({width:_,height:h},O);e&&(le=(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 ue=[I,i,le];return(0,Z.jsx)(`div`,{style:{...ae,zIndex:se?1:void 0},...m,children:ue})},yr=!1,br=!1,xr=Object.freeze({top:0,right:0,bottom:0,left:0}),Sr={text:`flex-start`,number:`flex-end`,boolean:`center`},Cr=(e,t)=>e===J.HorizontalAlignment.General?Sr[t]:e===J.HorizontalAlignment.Left?`flex-start`:e===J.HorizontalAlignment.Right?`flex-end`:`center`,wr=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():xr,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:Cr(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})};wr.displayName=`CellContent`;var Tr=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)(wr,{...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})})},Er=e=>{let t=e.getControl();return!!t&&t.getType()===`checkbox`&&t.isAccepted(e.getValue())&&e.getFormula()===null},Dr=Object.freeze([Gn.Feature.CellControl,Gn.Feature.Formula,Gn.Feature.Kind]),Or=Object.freeze({renderer:Tr,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(Dr))Er(t.getCell())&&o.push(t.getRange());if(o.length===0)return!1;let s=!0!==(Er(r)?r:o[0].getCell()).getValue();return t.sheet.doBatch(()=>{for(let e of o)t.setRangeValue(e,s)}),!0})(t,n)}),kr=new WeakMap,Ar=new Map,jr=new WeakMap,Mr=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`}`},Nr=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=jr.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)}`})(),jr.set(n,e)),e}let r=t.getSource(),i=Ar;e&&(i=kr.get(e)??new Map,kr.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(le(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===rr.Sizing.Fit||f===rr.Sizing.Fill)p.width=`100%`,p.height=`100%`,p.objectFit=f===rr.Sizing.Fit?`contain`:`fill`,p.objectPosition=i;else if(f===rr.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===rr.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)})},Pr=Object.freeze({renderer:e=>{let t=e.value.getValue();return(0,Z.jsx)(wr,{...e,alignAs:`text`,inset:!1,children:(0,Z.jsx)(Nr,{image:t,workbook:e.context.sheet.getWorkbook(),zoom:e.zoom??1,position:Mr(e.value)})})},insertable:!1}),Fr=new Map,Ir=new Map,Lr=new Map,Rr=new Map,zr=new Set,Br=0,Vr=!1,Hr=()=>{Vr||(Vr=!0,Fr.set(`checkbox`,Or),Lr.set(`image`,Pr))};function Ur(e){return Hr(),Rr.get(e)??Lr.get(e)}function Wr(e){return Hr(),Ir.get(e)??Fr.get(e)}function Gr(e){Hr();let t=e.getControl();if(t){let n=e.getValue();if(t.isAccepted(n)){let e=Wr(t.getType());if(e)return{entry:e,control:t}}}if(e.getType()===jn.RichData){let t=Ur(e.getValue().getKind().getName());if(t)return{entry:t,control:null}}return null}function Kr(e){return zr.add(e),()=>{zr.delete(e)}}function qr(){return Br}function Jr(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 Yr(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=Yr(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=Yr(e))&&(r&&(r+=` `),r+=t);return r}var Xr=(0,X.createContext)(null);Xr.displayName=`DocThemesContext`;var Zr=()=>{let e=(0,X.useContext)(Xr),[t]=(0,X.useState)(()=>new Un);return(0,X.useMemo)(()=>e||t,[e])},Qr=[[On.Named.Window,`var(--sxl-color-base-100)`],[On.Named.Menu,`var(--sxl-color-base-100)`],[On.Named.BtnFace,`var(--sxl-color-base-100)`],[On.Named.ScrollBar,`var(--sxl-color-base-100)`],[On.Named.AppWorkspace,`var(--sxl-color-base-100)`],[On.Named.Background,`var(--sxl-color-base-100)`],[On.Named.InfoBk,`color-mix(in srgb, var(--sxl-color-base-100) 88%, #ffeb3b)`],[On.Named.WindowText,`var(--sxl-color-base-content)`],[On.Named.MenuText,`var(--sxl-color-base-content)`],[On.Named.BtnText,`var(--sxl-color-base-content)`],[On.Named.InfoText,`var(--sxl-color-base-content)`],[On.Named.CaptionText,`var(--sxl-color-base-content)`],[On.Named.GrayText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[On.Named.InactiveCaptionText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[On.Named.Highlight,`var(--sxl-color-primary)`],[On.Named.ActiveCaption,`var(--sxl-color-primary)`],[On.Named.HotLight,`var(--sxl-color-primary)`],[On.Named.HighlightText,`var(--sxl-color-primary-content)`],[On.Named.BtnHighlight,`var(--sxl-color-base-200)`],[On.Named.Light3d,`var(--sxl-color-base-200)`],[On.Named.InactiveCaption,`var(--sxl-color-base-200)`],[On.Named.ActiveBorder,`var(--sxl-color-base-300)`],[On.Named.InactiveBorder,`var(--sxl-color-base-300)`],[On.Named.WindowFrame,`var(--sxl-color-base-300)`],[On.Named.BtnShadow,`var(--sxl-color-neutral)`],[On.Named.DkShadow3d,`var(--sxl-color-neutral)`]],$r={};for(let[e,t]of Qr)$r[`sys-color-${e.toLowerCase()}`]=t;var ei={light:$r,dark:$r},ti=(0,X.memo)(({scopeClass:e,tokens:t})=>{let n=`.${e}`,r=(0,X.useMemo)(()=>Tt({scope:n}),[n]),i=(0,X.useMemo)(()=>((e=`sxl-defaults`,t)=>ye({app:ei,surfaces:{grid:ei,header:ei},layer:e,scope:t}))(`sxl-defaults`,n),[n]),a=(0,X.useMemo)(()=>t?((e,t)=>{let n=(t,n)=>e[t]?.[n]??{};return ye({app:{light:n(`light`,`app`),dark:n(`dark`,`app`)},surfaces:{grid:{light:n(`light`,`grid`),dark:n(`dark`,`grid`)},header:{light:n(`light`,`header`),dark:n(`dark`,`header`)}},layer:`sxl-overrides`,scope:t,baseline:!1})})(t,n):null,[t,n]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{css:r}),(0,Z.jsx)(W,{css:i}),a?(0,Z.jsx)(W,{css:a}):null]})});ti.displayName=`ThemeRootStyles`;var ni=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=P.getDevicePixelRatio(),h=(e,t,n,r)=>{let i=P.snapLineCenter(e,r/m,m),a=P.snapDeviceEdge(t,m),o=P.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]})},ri=(e,t)=>{if(!e||e.isNone())return null;let n=bn.BuiltInDefinitions.get(e.getStyle());return n?{color:e.getColor().toCSS(`adaptive`),width:n.width,dashArray:n.pattern,isDouble:n.style===bn.StrokeStyle.Double,edge:bi(t)}:null},ii=({getBorderAt:e,getMergeAt:t,rendererBorder:n=xi,getVisibleCells:r,forceThinBorder:i=!1,defaultColor:a=`black`,mode:o=`direct`,normalRows:s=null,normalColumns:c=null,cache:l})=>{let u=q(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:ui(n,si(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=si(l,r,p,e,t,a),{mergedRows:h,mergedColumns:g,diagonals:_,crossings:v}=m,y=ci(r,m,s,c,f.current,!0);if(g.length===0&&h.length===0&&_.length===0&&!y.dH&&!y.dV)return null;let b=P.getDevicePixelRatio(),x=r.getMetrics(),S=(e,t,n)=>P.edgeCenter(e,bi(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()===bn.StrokeStyle.Double,l=!i&&a.stroke.getStyle()===bn.StrokeStyle.Double,u=o&&c&&!l,d=s&&l&&!c;if(!(o&&s||u||d))continue;let f=bn.BuiltInDefinitions.get(a.stroke.getStyle())?.width??1,p=bn.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?bn.Edge.Top:bn.Edge.Left),u=e[c-1],d=u?.ordinal!==s.ordinal||a(u.to+1)!==r||yi(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?bn.Edge.Bottom:bn.Edge.Right),u=e[c+1],d=u?.ordinal!==s.ordinal||a(u.from)!==n||yi(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()===bn.StrokeStyle.Double,N=bn.BuiltInDefinitions.get(bn.StrokeStyle.Double).width,F=[],I=[],L=``,R=``,z=[],ee=(e,t,n)=>{if(!e||!t)return;let r=li(e,t,b,n);t.isDouble&&!i?(I.push(r),L+=e,R+=e):z.push(r)};ee(y.dH,s,`normal-rows`),ee(y.dV,c,`normal-columns`);let B=(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 F.push({stroke:e.stroke,node:d});I.push(d);let f=t?s:c,p=t?c:s,m=t?u:l;L+=fi(f,p,m,t,e.edge,b),R+=pi(f,p-r,m+a,t,e.edge,b)};for(let e=0;e<w;e++)B(g[e],!0,D[e],O[e]);for(let e=0;e<C;e++)B(h[e],!1,T[e],E[e]);F.sort((e,t)=>bn.compareStrokes(e.stroke,t.stroke));let V=[],H=[],U=[],W=``,te=_.length;for(let e=0;e<te;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:di(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}`;U.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)?(H.push(s),W+=`M ${a[0]} ${a[1]} L ${a[2]} ${a[3]} `):V.push(s)};a&&!a.isNone()&&S(a,bn.Edge.DiagonalDown,[h,g,v,y]),r&&!r.isNone()&&S(r,bn.Edge.DiagonalUp,[h,y,v,g])}let G=o.width,ne=o.height,re=`${d}-edges`,K=`${d}-plain`,ie=`${d}-diagonals`,ae=L||W||U.length>0;return(0,Z.jsxs)(`svg`,{width:`${G}`,height:`${ne}`,viewBox:`0 0 ${G} ${ne}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:`0px`,top:`0px`,width:`${G}px`,height:`${ne}px`,pointerEvents:`none`,willChange:`left, top, width, height, stroke-dashoffset`,overflow:`visible`},children:[ae?(0,Z.jsxs)(`defs`,{children:[L?hi(re,L,1/b,G,ne):null,R?hi(K,R,N/b,G,ne):null,W?hi(ie,W,1/b,G,ne):null,U]}):null,(0,Z.jsxs)(`g`,{mask:R?`url(#${K})`:void 0,children:[z,F.map(e=>e.node)]}),I.length>0?(0,Z.jsx)(`g`,{mask:`url(#${re})`,children:I}):null,V,H.length>0?(0,Z.jsx)(`g`,{mask:`url(#${ie})`,children:H}):null]},`borders`)},[e,t,n,i,a,o,s,c,d])}},ai=(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&&bn.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,z=O;P.isNone()||S(_,R,z,E,P,bn.Edge.Left,1),F.isNone()||S(v,z,R,T,F,bn.Edge.Top,1),I.isNone()||S(_,R+1,z,E,I,bn.Edge.Right,1),L.isNone()||S(v,z+1,R,T,L,bn.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:oi(k,O),diagonals:l,rangesH:s,rangesV:c,sigRangesH:vi(s),sigRangesV:vi(c),breaksRows:gi(k,null,m),breaksRowsNone:gi(k,b,m),breaksColumns:gi(O,null,p),breaksColumnsNone:gi(O,y,p),columns:_,rows:v,colOrdinal:h,rowOrdinal:g}},oi=(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},si=(e,t,n,r,i,a)=>{if(!e)return ai(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=ai(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},ci=(e,t,n,r,i,a)=>{if(!n&&!r)return{dH:null,dV:null};let{rangesH:o,rangesV:s}=t,c=P.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,_=P.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=pt(e,r,p,{width:m,shift:_,breaksAt:d.byTrail.size>0?t=>_i(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}},li=(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),ui=(e,t,n,r,i,a)=>{let{dH:o,dV:s}=ci(e,t,n,r,i,!1);if(!o&&!s)return null;let c=P.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:hi(h,d,1/c,p,m)}):null,d?(0,Z.jsxs)(`g`,{mask:`url(#${h})`,children:[l?li(l,n,c):null,u?li(u,r,c):null]}):null,o&&!l?li(o,n,c):null,s&&!u?li(s,r,c):null]})},di=(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||bn.compareStrokes(e.stroke,a.stroke)>0)&&(a=e)}),a){let e=a;return{width:bn.BuiltInDefinitions.get(e.stroke.getStyle())?.width??1,kind:bi(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=P.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)}},fi=(e,t,n,r,i,a)=>{let o=mi(e,i,a),s=.5/a,c=P.snapLineCenter(t,1/a,a)-s,l=P.snapLineCenter(n,1/a,a)+s;return r?`M ${o} ${c} L ${o} ${l} `:`M ${c} ${o} L ${l} ${o} `},pi=(e,t,n,r,i,a)=>{let o=mi(e,i,a),s=P.snapDeviceEdge(t,a),c=P.snapDeviceEdge(n,a);return r?`M ${o} ${s} L ${o} ${c} `:`M ${s} ${o} L ${c} ${o} `},mi=(e,t,n)=>{let r=bn.BuiltInDefinitions.get(bn.StrokeStyle.Double).width;return P.snapLineCenter(e+P.edgeTrailingShift(bi(t),r,n),r/n,n)},hi=(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),gi=(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}},_i=(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},vi=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},yi=(e,t,n,r)=>{if(!r){let n=e.getStyle()===bn.StrokeStyle.Double;if(n!==(t.getStyle()===bn.StrokeStyle.Double))return!n}let i=bn.compareStrokes(e,t);return i===0?n:i>0},bi=e=>e===bn.Edge.Right||e===bn.Edge.Bottom?`trailing`:`leading`,xi=e=>{let{key:t,points:n,stroke:r,forceThinBorder:i=!1,isVertical:a=!1,edge:o,startExtend:s=0,endExtend:c=0}=e,l=bn.BuiltInDefinitions.get(i?bn.StrokeStyle.Thin:r.getStyle());if(!l)return null;let u=P.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===bn.Edge.DiagonalUp||o===bn.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=P.edgeTrailingShift(bi(o),l.width,u),b=a?-l.width/2/u+y:-_,x=a?-_:-l.width/2/u+y;return(0,Z.jsx)(ni,{offsetX:d+b,offsetY:f+x,length:v+_,isVertical:a,stroke:h,width:l.width,dashArray:l.pattern,isAngled:g},t)},Si=_.Center,Ci=Object.freeze({horizontal:!1,vertical:!1}),wi=D.EmptyTopLeft,Ti=(e,t)=>w.EmptyCell,Ei=(e,t)=>new Promise((e,t)=>{t(`StaticBorderRenderer does not support scrolling`)}),Di=(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}]=ge(),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}=ii({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},F={width:y,height:b},I={addReactEventListener:()=>()=>{},getElement:()=>h.current,focus:e=>{h.current?.focus(e)},registerFocusTarget:()=>Oi,getFocusTarget:()=>null,invalidate:Oi,setPointerCapture(e){h.current?.setPointerCapture(e)},releasePointerCapture(e){h.current?.releasePointerCapture(e)},getTotalSize:()=>P,getSurfaceSize:()=>F,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:()=>({[Si]:I}),getAnchor:()=>Si,getZoom:()=>1,scrollTo:(e,t)=>Promise.resolve(D.EmptyTopLeft),scrollCellCoordsIntoView:Ei,getCellFromPointer:Ti,getPaneFromPointer:()=>I,getScrollOrientation:()=>Ci,getScrollTopLeft:()=>wi,getFreezeTopLeft:()=>wi},L=S(I);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}),L]})}),Oi=()=>{},ki=e=>{switch(e){case`right`:return`flex-end`;case`center`:return`center`;default:return`flex-start`}},Ai=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`}},ji=(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!==Cn.ParseRunType.Text),k=O?E.formattedRuns.lastRepeatIndex??-1:-1,A=O?D.map((e,t)=>{if(e.type===Cn.ParseRunType.Spacing)return(0,Z.jsx)(`span`,{style:{visibility:`hidden`,whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t);if(e.type===Cn.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)(Di,{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:Ai(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?ki(w):void 0,transform:b?`rotate(${-b}deg)`:void 0,writingMode:x?`vertical-rl`:void 0,textOrientation:x?`upright`:void 0,...g},children:A})})})})});ji.displayName=`StaticCellRenderer`;var Mi=(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])},Ni=e=>e.length>0&&`=+-`.includes(e[0]),Pi=e=>+(e[0]===`=`),Fi=e=>e.referenceIndex===void 0?e.type===`error`?`var(--sxl-color-error, light-dark(#a31515, #ce9178))`:void 0:Gt[e.referenceIndex%Gt.length],Ii=(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},Li=(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}},Ri=(e,t)=>{for(let n of e)if(n.referenceIndex===t&&n.type===`tableReference`)return!0;return!1},zi=async(e,t,n,r)=>{if(!Ni(t))return null;try{let i=e.createFormula(t,r,{target:`display`}),a=-1,o=`self`,s=-1,c=Pi(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,Pi(t))+l.getExpression({target:`display`});return{value:u,caret:s+(u.length-t.length)}}catch{return null}},Bi=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=Fi(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*_n.getDeviceScale(),...u?{lineHeight:u.lineHeight*r+`px`}:null,...h?{letterSpacing:(c.getLetterSpacing()+h)*r+`px`}:null,...a},children:[`=`,m]})};Bi.displayName=`CellFormulaRenderer`;var Vi=(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])},Hi=`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`,Ui=`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`,Wi=e=>{let{bounds:t,zoom:n,disabled:r,path:i,onPress:a,style:o,...s}=e,[c,l]=(0,X.useState)(!1),u=Bt(!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, ${ie(`color-primary`)} 80%, ${ie(`color-base-100`)})`:ie(`color-base-300`)}`,backgroundColor:ie(`color-base-100`),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})})})},Gi=e=>{let{column:t,onColumnButtonMouseDown:n,...r}=e;s(t.getTable(),[`onAnyChange`]);let i=Hi,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?Ui:Hi,(0,Z.jsx)(Wi,{path:i,onPress:e=>n?.(e,t),...r})},Ki=`_header_vt581_7`,qi=`_hover_vt581_18`,Ji=`_filtered_vt581_25`,Yi=`_selected_vt581_33`,Xi=`_selectedAll_vt581_42`,Zi=(e,t,n)=>e===n||t.contains(e),Qi=()=>!1,$i=(0,X.memo)(e=>{let{index:t,value:n,zoomScale:r=100,headerText:i=e=>`${e}`,verticalPadding:a=0,horizontalPadding:o=0,isSelected:s=Qi,isSelectedAll:c=Qi,isFiltered:l=Qi,cell:u,bounds:d,range:f,axis:p,zoom:m=1,onColumnButtonMouseDown:h,propsColumnButton:g,renderColumnButton:_=Gi,className:y,style:b={},...x}=e,S=jt(),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=Zi(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();(!Zi(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)(We,{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,Ki,{[qi]:E,[Ji]:M,[Yi]:k&&!A,[Xi]: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]})});$i.displayName=`SheetHeaderRenderer`;var ea=(e,t)=>Math.max(1,Math.floor(e-t)),ta=(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`})})});ta.displayName=`OutlineGlyph`;var na={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`},ra={opacity:.5,cursor:`default`},ia={border:`1px solid var(--sxl-color-base-100)`,background:`var(--sxl-color-base-hover)`},aa=e=>({fontSize:Math.max(8,e-4),lineHeight:e-2+`px`,textAlign:`center`,fontVariantNumeric:`tabular-nums`}),oa=(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?{...na,...ra}:na,onClick:a?void 0:i,children:(0,Z.jsx)(ta,{collapsed:t,size:n-2})})});oa.displayName=`OutlineButton`;var sa=(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:{...na,...ia,...aa(r),...o?ra:null},onClick:o?void 0:a,children:t})});sa.displayName=`OutlineLevelButton`;var ca=e=>(0,Z.jsx)(oa,{...e}),la=e=>(0,Z.jsx)(sa,{...e}),ua=e=>e.getCurrentPage()!==null||e.getItems().some(e=>!e.isVisible()),da=e=>{let{fields:t,onPivotButtonMouseDown:n,...r}=e;return(0,Z.jsx)(Wi,{path:t.some(ua)?Ui:Hi,onPress:e=>n?.(e,t),...r})},fa=e=>{let{expanded:t,size:n,disabled:r,title:i,onToggle:a,style:o}=e,s=Bt(!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)(ta,{collapsed:!t,size:n-2})})},pa=(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=[],m=[];return t===_.TopLeft?(p.push(f),m.push(f),p.push(f+d),m.push(f),p.push(f),m.push(f+d)):t===_.TopRight?(p.push(n-f),m.push(f),p.push(n-(f+d)),m.push(f),p.push(n-f),m.push(f+d)):t===_.BottomRight?(p.push(n-f),m.push(r-f),p.push(n-(f+d)),m.push(r-f),p.push(n-f),m.push(r-(f+d))):t===_.BottomLeft&&(p.push(f),m.push(r-f),p.push(f+d),m.push(r-f),p.push(f),m.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},fill:s??ie(`color-neutral`),...u,children:(0,Z.jsx)(`path`,{d:o===`bubble`&&t===_.TopRight?ma(n-f-d,f,d):`M ${p[0]} ${m[0]} L ${p[1]} ${m[1]} L ${p[2]} ${m[2]} L ${p[0]} ${m[0]} Z`,...c})})}),ma=(e,t,n)=>`M ${e} ${t} H ${e+n} V ${t+n} L ${e+.45*n} ${t+.5*n} H ${e} Z`,ha=(()=>{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)})}})(),ga=()=>ha.getMode(),_a=e=>ha.setMode(e),va=(0,X.createContext)(null),ya=()=>(0,X.useContext)(va)??ha,ba=()=>{let e=ya();return(0,X.useSyncExternalStore)(e.subscribe,e.getMode,e.getMode),e},xa=null,Sa=new Set,Ca=e=>(Sa.add(e),()=>{Sa.delete(e)}),wa=e=>{xa!==e&&(xa=e,Sa.forEach(e=>e()))},Ta=()=>xa,Ea=e=>(0,X.useSyncExternalStore)(Ca,()=>xa?.sheet===e?xa:null,()=>null),Da=e=>!e||e===`none`||e===`transparent`,Oa=(e,t,n,r)=>{let i=e.getStyle().getFill()?.toCSS(n)?.background;return Da(i)&&(i=t.getStyles().getNormal().getFill().toCSS(n)?.background),Da(i)&&(i=r??`#ffffff`),i},ka=(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}},Aa=(e,t,n)=>{if(!e||!t)return n;try{return e.getWorksheet(t)??n}catch{return n}},ja=(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=Aa(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=ka(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=ka(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=Ta();return c===zn.AlertStyle.Warning&&l?.dataValidation===s&&l.dirty===n&&l.sheet===e&&w.isEqualCells(l.coords,t)?(wa(null),!0):(wa({sheet:e,coords:t,dirty:n,dataValidation:s,style:c}),c===zn.AlertStyle.Information)}return wa(null),!0})()})(r,l,e)}},Ma=(e,t)=>{let n=e.getWorkbook(),r=t?.referenceMode??{getMode:ga,setMode:_a},i,{anchor:a,notifySessionChange:o}=((e,t,n)=>{let r=()=>{let r=n();return r?Aa(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 Ft(a,ja(e,n),{revertAnchor:t=>{Aa(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;Ie(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=Ta();t&&!e(t)&&wa(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===zn.AlertStyle.Information)})})(i),((e,t,n,r)=>{e.subscribe(()=>{let i=e.getSession(),a=r.getMode();if(i){if(!a){let a=Aa(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},Na={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))`},Pa=(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=Ue(),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])},Fa=e=>!!e&&e.selectionStart!==null&&e.selectionEnd!==null&&e.selectionStart!==e.selectionEnd,Ia=(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}},La=(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=Ia(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=za(e,t,p.lo,p.hi);return{lo:p.lo,hi:p.hi,start:m.start,end:m.end,fragment:null,evalIndex:p.evalIndex}},Ra=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}},za=(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}},Ba=e=>e===`,`?{decimal:`,`,column:`;`,row:`|`}:{decimal:`.`,column:`,`,row:`;`},Va=(e,t,n)=>{if(e==null)return`0`;if(An.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},Ha=(e,t,n={t:`TRUE`,f:`FALSE`})=>{if(An.isError(e,An.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 Va(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=Va(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 Va(e,t,n)},Ua=e=>e==null?``:(An.isError(e),String(e)),Wa=e=>{if(e==null)return`0`;if(An.isError(e,An.Code.Parse))return null;if(An.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 Ua(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(Ua(n.getValueAt(r,i)));i.push(e.join(`, `))}return`{${i.join(`; `)}}`}return String(e)},Ga=!1,Ka=()=>Ga,qa=(e,t,n)=>{if(e.nativeEvent.isComposing||t?.mode!==`point`)return!1;let r=t.selection;if(!r)return!1;let i=e.which===oe.Left?T.Left:e.which===oe.Right?T.Right:e.which===oe.Up?T.Up:e.which===oe.Down?T.Down:null,a=e.ctrlKey||e.metaKey,o=e.which===oe.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;Ga=!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{Ga=!1}return o===null?r.navigate(i,e.shiftKey,a):r.selectRegion({axis:o,contentOnly:!1}),!0},Ja=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=q(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=q(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=q(()=>{C(l.current)},[]),T=q(()=>{C(u.current)},[]),E=q((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=q(()=>{u.current=c.current,m.current=!1,_.current=null},[]),O=q(()=>{h.current=!1},[]),k=q(()=>{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:q(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:q(e=>!!Ae.isCaretKey(e)&&(e.stopPropagation(),!0),[]),resetBlurGuard:O,consumeBlurGuard:k,commit:q(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`accept`}):S({reason:`accept`})},[]),cancel:q(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`cancel`}):(w(),S({reason:`cancel`}))},[])}},Ya=(e,t,n)=>{let r=e.getWorksheet(),i=r.getRange(t).toString();return n&&n!==r.getName()?Pn.sheetAndRangeToString(Pn.sheetNameToString(n),i):i},Xa=(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}},Za=(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},Qa=(e,t)=>{if(t.rowStart===t.rowEnd&&t.colStart===t.colEnd)return!1;try{let n=Za(e,t);return n?.kind===`dynamic`&&n.coords.rowEnd===t.rowEnd&&n.coords.colEnd===t.colEnd}catch{return!1}},$a=(e,t,n)=>{try{return Qa(e.getWorksheet(),t)?Ya(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}},eo=(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=Za(e,a);if(!i)continue;r??=n.slice(),r[t]={...a,rowEnd:i.coords.rowEnd,colEnd:i.coords.colEnd}}catch{}}return r??n},to=e=>e?e.getSelectedWorksheet()??e.getWorksheets().getItems({visibility:Zn.Visibility.VeryHidden})[0]??null:null,no=e=>e.length>Wn.MAX_EXPRESSION_LENGTH,ro=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},io=(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=to(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});return t&&t.isValid()&&t.isReferenceOnly()?i(t.getReferences()):null}catch{return null}},ao=(e,t,n,r)=>{let i=t.trim();if(!i)return null;let a=!Ni(i);if(a&&!r)return null;try{let r=to(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=eo(r,o,s)}catch{}return{tokens:o,ranges:s}}catch{return{tokens:[],ranges:[]}}},oo=(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()}},so=(e,t)=>{let n=e.trim();if(!n)return e;let r=(Ni(n)?n.slice(Pi(n)):n).trim();return r?t?r:`=`+r:e},co=(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?so(e,s):e;try{if(e.isICellRanges){let t=oo(n,e,a);return o?so(t,s):t}if(!o){let t=e.getReferences();return t?oo(n,t,a):``}let t=e.getExpression({target:`display`});return t?so(t,s):``}catch{return``}},lo=(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=_r(),g=e.workbook===void 0?h:e.workbook,_=t===`formula`,v=f!==`required`&&f!==`literal`,y=ba(),[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)(()=>co(n,t,g??null,d,f)),L=Ja({initialText:I,parse:e=>oe(e),changeOn:a,onChange:r,onChangeText:i,onDone:u,session:{isActive:()=>j.current,end:e=>ge(e)}}),{text:R,error:z,dirty:ee,textRef:B,committedTextRef:V,baselineTextRef:H,dirtyRef:U,errorRef:W,lastValidRef:te,setText:G,setError:ne,liveChange:re,notifyDone:K}=L,ie=()=>N.current?.scope??M.current?.getSelectedWorksheet()?.getName()??null,ae=e=>{let t=ie();if(!t)return!0;try{return(e.getReferences()?.getCoords()??[]).every(e=>!e||(e.scope??t)===t)}catch{return!0}},oe=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=to(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||ae(e)?{value:e,error:null}:{error:C(`referenceInput.crossSheet`)}}catch{}return{error:C(`referenceInput.invalid`)}}if(f===`required`&&!Ni(t))return{error:C(`formulaInput.equalsRequired`)};if(f===`literal`&&!Ni(t))return{error:null};let a=Ni(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||ae(e)?{value:e,error:null}:{error:C(`referenceInput.crossSheet`)}}catch{return{error:C(`formulaInput.invalid`)}}};(0,X.useEffect)(()=>{if(P===0)return;let e=B.current;if(!e.trim())return;if(U.current)return void re(e);let{value:t,error:n}=oe(e);ne(n),t&&(te.current=t)},[P]);let se=no(R),ce=se?(e=>{let t=e.slice(0,Wn.MAX_EXPRESSION_LENGTH),n=t.lastIndexOf(`,`);return`${n>0?t.slice(0,n):t}…`})(R):R,le=(0,X.useMemo)(()=>_&&!se&&g?ao(g,R,N.current,v):null,[_,se,g,R,P,v]),ue=_?Pi(R):0,de=(0,X.useMemo)(()=>le&&le.tokens.length!==0&&le.tokens.map(e=>e.text??``).join(``)===R.slice(ue)?le.tokens:null,[le,R,ue]),fe=q(()=>{let e=k.current;if(!e||!g)return;let t=B.current;if(no(t))return;if(_){let n=ao(g,t,N.current,v),r=n?.ranges??[],i=O.current?.selectionStart??t.length,a=-1;if(n){let e=Pi(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()?ro(t):[],r=n.map(e=>io(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,_]),pe=(e,t)=>{let n=M.current,r=e.scope??N.current?.scope??null,i=to(n);if(m&&i&&r&&Qa(i,{...e,scope:r})){let n=me({...e,rowEnd:e.rowStart,colEnd:e.colStart},t);return n===null?null:n+`#`}return me(e,t)},me=(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=to(e)?.getCalculation().createFormula(`=`+r,n,{target:`display`});if(!t||!t.isValid()||!t.isReferenceOnly()||Ri(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||Ka())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=B.current,i=O.current,a=ao(g,r,N.current,v),o=a?.ranges.length??0,s=a&&n<o?Li(a.tokens,n,Pi(r)):null,c=pe(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}G(l),Se(!0),re(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),fe()});return}if(!r)return;let i=B.current,a=i.trim()?ro(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=pe(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;G(l),Se(!0),re(l),requestAnimationFrame(()=>{O.current?.setSelectionRange?.(u,u),fe()})}})},[S,g,o,_,p,m,f,re,fe]);let he=()=>{if(!_)return;let e=B.current.trim();if(!e||!v&&!Ni(e))return;let t=e.startsWith(`=`);if(!t&&Ni(e))return;let n=to(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}G(r),re(r)},ge=q(e=>{if(e.reason===`cancel`?L.revertToBaseline():he(),we(),K(e),e.key===`Tab`)return;let t=O.current;t&&typeof document<`u`&&(document.activeElement===t?Ce():t.focus())},[K,re]),_e=(0,X.useRef)(null);_e.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);G(i),re(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||no(B.current))return;let n=e.value,r=e.selectionStart??n.length;try{let i=to(t)?.getCalculation();if(!i)return;if(_){if(!Ni(n))return;let t=await zi(i,n,r,N.current);if(!t)return;G(t.value),re(t.value),j.current&&fe(),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret));return}let a=ro(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 zi(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);G(d),re(d),j.current&&fe(),requestAnimationFrame(()=>e.setSelectionRange(f,f))}catch{}})()}};let ve=(0,X.useRef)(!1),ye=()=>{ve.current||(ve.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.`))},be=()=>{let e=B.current,t=O.current?.selectionStart??e.length;if(!e.trim())return{kind:`insert`,at:t};if(!v&&!Ni(e.trimStart()))return null;let n=M.current;if(n){let r=ao(n,e,N.current,v);if(r){let n=Pi(e);for(let e=0;e<r.ranges.length;e++){if(!r.ranges[e])continue;let i=Li(r.tokens,e,n);if(i&&t>=i.start&&t<=i.end)return{kind:`replace`,start:i.start,end:i.end}}}}return Mi(e,t)?{kind:`insert`,at:t}:null},xe=()=>!(f===`literal`&&!B.current.trim())&&be()!==null,Se=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)},Ce=q(()=>{if(l||j.current||no(B.current))return;if(!g)return void ye();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=!_||xe();D(r),y.setMode({mode:r?`point`:`show`,selection:n,activeInput:_e.current,allowMulti:_?e.allowMulti??!0:o,scope:s?void 0:ie()??void 0,onDone:ge}),fe()},[l,g,o,e.allowMulti,s,_]),we=q(()=>{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)},[]),Te=y.getMode();(0,X.useEffect)(()=>{j.current&&k.current&&Te?.selection!==k.current&&(j.current=!1,x(!1),T(null),k.current=null)},[Te]),(0,X.useEffect)(()=>()=>{we()},[we]),(0,X.useEffect)(()=>{let e=co(n,t,M.current,N.current,f),r=oe(e),i=n==null||typeof n==`string`||n.isICellRanges?r.value??null:n;L.resetCommitted(e,i)&&(ne(r.error??null),j.current&&fe())},[n]);let Ee=q(e=>{j.current||Ce(),G(e.target.value),_?Se(xe()):a===`done`&&D(!1),re(e.target.value),j.current&&fe()},[Ce,re,fe,a]),De=q(e=>{if(L.resetBlurGuard(),!(e.key!==`F2`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Se(!E);if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void _e.current?.toggleReferences();if(j.current&&E){let t=y.getMode(),n=g?.getSelectedWorksheet()?.getName();if(t&&n&&qa(e,t,n))return}if(e.key===`Escape`&&j.current&&!L.touchedRef.current)return e.preventDefault(),e.stopPropagation(),void we();L.handleDoneKeys(e)||L.handleTextKeys(e)},[E,g]),Oe=q(e=>{L.resetBlurGuard(),Ce()},[Ce]),ke=q(e=>{let t=L.consumeBlurGuard(),n=e.relatedTarget;(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||_&&!E)&&(we(),t||he(),!t&&U.current&&K({reason:`accept`}))},[we,K,_,E]),Ae=q(e=>{j.current&&a===`done`&&!_&&D(!1)},[a,_]),je=q(e=>{j.current&&(_&&Se(xe()),fe())},[fe,_]),Me=q((e,t)=>{j.current||Ce(),G(e),re(e),j.current&&fe(),t!==void 0&&requestAnimationFrame(()=>O.current?.setSelectionRange?.(t,t))},[Ce,re,fe]),Ne=q(()=>{j.current?ge({reason:`accept`}):(O.current?.focus(),Ce())},[Ce,ge]),Pe=q(()=>{if(!g)return void ye();let e=g.getSelectedWorksheet();if(!e)return;let t=e.getSelectedRanges(),n=t?.getCount()??0;if(!n)return;if(_){let e=be();if(!e)return;let n=O.current,r=B.current,i=t.at(0),a=i.getCoords(),o=pe({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;G(s),re(s),j.current&&fe(),requestAnimationFrame(()=>n?.setSelectionRange?.(c,c));return}let r=[];for(let e=0;e<n;e++){let n=t.at(e),i=n.getCoords(),a=pe({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];G(i),re(i),j.current&&fe()},[g,o,_,p,m,f,re,fe]),Fe=q(()=>{L.revertToCommitted(),j.current&&fe()},[fe]),Ie=(0,X.useMemo)(()=>_||se||!R.trim()||!g?[]:ro(R).map(e=>({text:e.text,start:e.start,end:e.end,valid:!!io(g,e.text,N.current)})),[_,se,R,g,P]),Le=q(async e=>{let t=g,n=Ie[e]?.text.trim();if(!t||!n)return null;try{let e=to(t)?.getCalculation();return e?Wa(await e.createFormula(`=`+n,void 0,{target:`display`}).evaluate()):null}catch{return null}},[g,Ie]),Re=q(()=>{try{return te.current?.getReferences()??null}catch{return null}},[]);return{inputProps:{value:ce,readOnly:se,onChange:Ee,onKeyDown:De,onFocus:Oe,onBlur:ke,onMouseDown:Ae,onSelect:je,ref:e=>{O.current=e}},text:R,overLength:se,segments:Ie,tokens:de,tokenBase:ue,error:z,dirty:ee,engaged:b,pointArmed:E,togglePoint:Ne,engage:Ce,replaceText:Me,selectCurrent:Pe,canSelectCurrent:!_||be()!==null,revert:Fe,commit:L.commit,cancel:L.cancel,getRanges:Re,evaluateSegment:Le}},uo={function:`Function`,named:`NamedRange`,lambda:`FormulaCustom`,table:`Table`,parameter:`Named`,column:`Table`,specifier:`Table`,enum:`DataValidation`},fo=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,po=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??uo[t.kind??`function`],size:16,style:{color:fo,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:fo},children:t.category})]}),n&&(0,Z.jsx)(`div`,{title:r?void 0:n,style:{padding:`0 10px 4px 34px`,fontSize:11,lineHeight:`14px`,color:fo,...r?{whiteSpace:`normal`}:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`}},children:n})]})};po.displayName=`NamedItemLabel`;var mo=8,ho=e=>{let{items:t,selectedIndex:n,selectedSummary:r,onSelect:i,onHighlight:a,maxVisibleRows:o=mo}=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)(po,{item:e,summary:o?r:null,rowHeight:22})},`${t}:${e.name}`)})})};ho.displayName=`NamedItemsPanel`;var go=e=>{let t=/(\d+)$/.exec(e);return t?{base:e.slice(0,-t[1].length),n:parseInt(t[1],10)}:{base:e,n:1}},_o=(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},vo=`0.6em`,yo=`calc(${vo} + 1px)`,bo=()=>{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:vo,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:ie(`color-neutral`),strokeWidth:1,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})})})})},xo=new Set([`number`,`string`,`boolean`]),So=`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 45%, transparent)`,Co={backgroundColor:H,borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${So}`},wo={borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${So}`},To=e=>ie(`color-bracket`,e),Eo={display:`inline-block`,width:0,overflow:`visible`,whiteSpace:`pre`},Do=e=>({display:`inline-block`,transform:`scale(1.15)`,transformOrigin:`center 78%`,opacity:.7,fontWeight:700,color:e}),Oo=`var(--sxl-color-error, #d93025)`,ko=`var(--sxl-color-warning, #b26a00)`,Ao={textDecorationLine:`underline`,textDecorationStyle:`wavy`,textDecorationColor:ko,textDecorationSkipInk:`none`},jo={matchOf:new Map,depthOf:new Map,unmatched:new Set},Mo=e=>{if(!e)return jo;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}},No=(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]},Po=(e,t)=>e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1],Fo=(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},Io=`var(--sxl-color-base-content, rgb(37,36,35))`,Lo=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,Ro=`var(--sxl-color-primary, rgb(33,115,70))`,zo=`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,Bo=`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif)`,Vo={color:Ro,fontWeight:700},Ho=[],Uo=(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}=go(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}=go(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},Wo=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:Lo,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}),Go=({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`})}),Ko=()=>(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`})}),qo={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`)},Jo=e=>{let t=e.getScalarType();return t&&t!==`*`?qo[t]:C(`functionPreview.anyValue`)},Yo=e=>{let{param:t,repeat:n=!1,optional:r=!1,showType:i=!0,size:a=15,style:o}=e,s=K(),c=Jo(t),l=c===`functionPreview.anyValue`?s(c):s(`functionPreview.type`,{type:s(c)}),u={color:Lo};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})]})};Yo.displayName=`FunctionArgIcons`;var Xo=({hint:e,wrap:t=!1})=>{let n=Uo(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:zo,cursor:`default`},children:[(0,Z.jsx)(`span`,{style:{fontWeight:600,color:Ro},children:e.nameLocal??e.name}),`(`,i.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`span`,{style:{color:Lo},children:`${r} `}):null,(0,Z.jsx)(`span`,{style:e.active?Vo:{color:Lo},children:e.text})]},e.key)),`)`]})};Xo.displayName=`FunctionSignature`;var Zo=({hint:e,descriptor:t,showParameters:n=!0})=>{let r=K(),{name:i,argIndex:a,params:o,warning:s}=e,c=n?Uo(o,a):Ho,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:Bo},children:[d&&(0,Z.jsx)(`div`,{style:{color:Io},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:zo,fontWeight:e.active?700:600,color:e.active?Ro:Io,whiteSpace:`nowrap`},children:e.label}),(0,Z.jsx)(Yo,{param:e.param,repeat:e.isRepeat,optional:e.optional,style:{marginLeft:`auto`}})]}),n&&(0,Z.jsx)(`div`,{style:{color:Lo},children:n}),e.active&&l&&(0,Z.jsx)(`div`,{className:`sxl-function-preview-warning`,style:{color:ko},children:r(`functionPreview.enumOutOfSet`,{value:s.value,values:s.values})})]},e.key)})})]}):null};Zo.displayName=`FunctionPreviewContent`;var Qo=e=>{let{hint:t,collapsed:n,onToggle:r,onClose:i}=e,a=K(),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)(Xo,{hint:t})}),(0,Z.jsx)(Wo,{label:o,onClick:e=>{e.stopPropagation(),r()},children:(0,Z.jsx)(Go,{up:!n})}),i&&(0,Z.jsx)(Wo,{label:a(`functionPreview.close`),onClick:e=>{e.stopPropagation(),i()},children:(0,Z.jsx)(Ko,{})})]})};Qo.displayName=`FunctionPreviewHeader`;var $o=e=>{let{hint:t,descriptor:n,onClose:r}=e,[i,a]=re(`editor.functionPreview.collapsed`,!1);return(0,Z.jsxs)(`div`,{style:{minWidth:300,maxWidth:460,fontFamily:Bo,fontSize:12,lineHeight:`16px`,color:Io},children:[(0,Z.jsx)(Qo,{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)(Zo,{hint:t,descriptor:n})})})]})};$o.displayName=`FunctionPreviewPanel`;var es=e=>{let{list:t,preview:n}=e;return t&&t.items.length>0?(0,Z.jsx)(ho,{items:t.items,selectedIndex:t.selectedIndex,selectedSummary:t.selectedSummary,onSelect:t.onSelect,onHighlight:t.onHighlight}):n?(0,Z.jsx)($o,{hint:n.hint,descriptor:n.descriptor}):null};es.displayName=`NamedHintPanel`;var ts=(e,t)=>({name:e,summary:t.getSummary(),params:t.getParameters(),enums:t.getEnums()}),ns=(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},rs=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}},is=(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&&rs(i))return{token:i,start:r,index:n};r+=a}return null})(e,t,n)??ns(e,t,n);if(!r||!rs(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}},as=(e,t,n)=>n?{name:e,argIndex:t,bound:n}:{name:e,argIndex:t},os=(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`?as(n.value,0,n.context?.bound):n.type===`paren`&&n.text===`)`||n.context?.type===`table`?null:n.type===`separator`&&n.context?.name?as(n.context.name,n.context.argIndex+1,n.context.bound):n.context?.name?as(n.context.name,Math.max(0,n.context.argIndex),n.context.bound):null;r+=e}return null},ss=(e,t)=>typeof e==`string`?`"${e.replace(/"/g,`""`)}"`:String(e).replace(`.`,t),cs=e=>e.type===`whitespace`||e.type===`empty`,ls=(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&&cs(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&&cs(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=_o(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},us=(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},ds=e=>{let t=e?.enumOf;return t&&`${t.fn}:${t.id}`},fs=(e,t,n)=>{let r=t.getEnum();if(!r)return[];let i=e.getName(),a=r.getId(),o=En(n??`en`).decimal;return r.getMembers().filter(e=>!e.isDeprecated()).map(e=>{let t=e.getName(),n=e.getValue(),r=ss(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}})},ps=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}),ms=[[`All`,`all`],[`Data`,`data`],[`Headers`,`headers`],[`Totals`,`totals`]],hs=(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?Ya(e,o,t.getWorksheet().getName()):t.getWorksheet().getRange(o).toString()}catch{return}},gs=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 is(t,n,Pi(e.text))},g=q(()=>{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=Pi(e.text);if(h(e,i,a))return void r(null);let s=os(i,a,o),c=s?us(n,s):null;if(!c||!s)return void r(null);let l=En(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(ps),bound:!0});return}let d=c.fn,f=d.getName(),p=Fn()?.functions?.[f]??f,m=ls(n,i,o).find(e=>e.name===s.name&&e.argIndex===u&&a>=e.argStart&&a<=e.argEnd),g=En(e.getLocale()??`en`).decimal,_=m?{argIndex:u,value:m.text,values:m.values.map(e=>ss(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})},[]),_=q(()=>{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=Pi(e.text);if(a&&e.text.slice(o).trim()===``){let t=fs(a.fn,a.param,e.getLocale());t.length===0?n():(u.current={start:o,end:e.text.length},ds(p.current[0])!==ds(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=Fn()?.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?hs(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 ms){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=Fn()?.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=os(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=us(e,a);if(!o||!(`fn`in o))return[];let s=_o(o.fn.getDeclaration().getParameters(),a.argIndex);return s?fs(o.fn,s,i):[]})(r,i,c,Pi(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||ds(e)!==ds(m[t])))&&(s(m),l(0))},[]),v=q(()=>{g(),_()},[]),y=q(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=q(e=>{let t=p.current.length;if(t===0)return!1;switch(e.which){case oe.Down:return e.preventDefault(),e.stopPropagation(),l(e=>(e+1)%t),!0;case oe.Up:return e.preventDefault(),e.stopPropagation(),l(e=>e<=0?t-1:e-1),!0;case oe.Enter:case oe.Tab:return!(x.current<0)&&(e.preventDefault(),e.stopPropagation(),y(p.current[Math.min(x.current,t-1)]),!0);case oe.Escape:return e.preventDefault(),e.stopPropagation(),u.current=null,s([]),!0;default:return!1}},[]),x=(0,X.useRef)(c);x.current=c;let S=q(()=>{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=Pi(e.text);if(p.current.length>0&&p.current[0].kind!==`enum`){let e=ns(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=ns(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(ts(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=os(e,i,n);return a&&a.name===r?a.argIndex:null})(f,O,Pi(k),n.name):null,m=n?{hint:p===null?n:{...n,argIndex:p},descriptor:i}:null;return u||m?(0,Z.jsx)(es,{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}},_s={placement:`bottom-start`,followAnchor:!0},vs={placement:`top-start`,followAnchor:!0},ys=e=>{let t=e.getFormulaText({target:`display`});if(t)return t;let n=e.getText({useFormattingCategory:!0})??``;return e.getStyle().getQuotePrefix()?`'`+n:n},bs=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?ys(D):(e=>{if(e.getSpillKind()!==`fixed`)return ys(e);let t=e.getFormulaText({target:`display`})??e.getSpill()?.getCell().getFormulaText({target:`display`});return t?`{${t}}`:ys(e)})(D):``),k=Ni(O),A=Pi(O),j=(0,X.useRef)(null),M=(0,X.useRef)(null),N=zt(j,O),I=(0,X.useRef)(D);I.current=D;let[L,R]=(0,X.useState)(!1),[z,ee]=(0,X.useState)(0),[B,V]=(0,X.useState)(void 0),[H,U]=(0,X.useState)(null),[W,te]=(0,X.useState)(0),G=(0,X.useRef)(null),ne=(0,X.useRef)(null),re=(0,X.useRef)(!1),K=(0,X.useRef)(null),ie=ba(),ae=ie.getMode(),ce=ae?.dragging??!1,le=ae?.draggingIndex??null,[ue,de]=(0,X.useState)(null),[fe,pe]=(0,X.useState)(null),me=(0,X.useRef)(null),he=(0,X.useRef)(ue);he.current=ue;let ge=D?.getType(),_e=(ge===jn.Number||ge===jn.Null)&&D.getStyle().getNumberFormat().includes(`%`),ve=e=>{if(!_e)return null;let t=e.replace(/%/g,``);return t.length===0||isNaN(Number(t))?null:{value:t+`%`,caret:t.length}},ye=(0,X.useRef)(0);(0,X.useLayoutEffect)(()=>{if(!r||!c)return;let e=j.current;if(!e||(e.focus(),ye.current===s))return;ye.current=s;let t=ve(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&&ft?Li(ft.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 be=D?D.getStyle():null,xe=be?be.getFont():null,Se=xe?xe.toCSS(`adaptive`,u):{},Ce=xe?xe.toCSS(`adaptive`,1):{},we=!n&&be&&xe&&typeof O==`string`&&O?be.measureText(O).renderLetterSpacing??0:0;we&&(Ce.letterSpacing=`${xe.getLetterSpacing()+we}px`,Se.letterSpacing=(xe.getLetterSpacing()+we)*u+`px`),n&&(Ce.fontSize=`inherit`,Se.fontSize=`inherit`,Ce.color=`inherit`,Ce.fontStyle=`inherit`,Ce.fontWeight=`inherit`,Ce.textDecoration=`inherit`,Se.color=`inherit`,Se.fontStyle=`inherit`,Se.fontWeight=`inherit`,Se.textDecoration=`inherit`);let Te=(D&&O[0]!==`=`?J.toCSSHorizontalTextAlign(D.getRenderHorizontalAlignment()):`left`)??`left`,Ee=be?.getAlignment(),De=Ee?.getOverflow()===J.Overflow.Wrap,Oe=Ee?(e=>{switch(e){case J.VerticalAlignment.Center:return`center`;case J.VerticalAlignment.Bottom:return`flex-end`;default:return`flex-start`}})(Ee.getVertical()):`flex-start`,Ae=!!d,je=(De||!Ae)&&!k,Me=k,Ne=Ae&&D&&d?D.getTextPlacement(d,k):null,Pe=D?D.getInsets():null,Fe=Ne?.lineHeight??S,Ie=L?Math.min(W,O.length):O.length,Le=k&&Mi(O,Ie),Re=Le&&Ie>=O.length;(0,X.useLayoutEffect)(()=>{let e=Pe?Pe.left+Pe.right:4,t,n;if(je){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}ee(n),v?.({width:t,height:n})},[O,je,u,v,Pe?.left,Pe?.right,Me,x,Re]);let Be=kt({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 He=(0,X.useRef)(null);He.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=I.current;if(!e||!t)return;let n=e.value,r=e.selectionStart??n.length;zi(t.getWorksheet().getCalculation(),n,r,et(t)).then(t=>{t&&(Ve.current(t.value),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret)))})}};let Ue=gs({text:O,getTokens:()=>pt.current?.tokens??null,active:L,getCaret:()=>j.current?.selectionStart??j.current?.value.length??0,getCalculation:()=>I.current?.getWorksheet().getCalculation()??null,getNames:()=>I.current?.getWorksheet().getNames()??null,getCell:()=>I.current??null,getLocale:()=>I.current?.getWorksheet().getWorkbook()?.getLocale()??null,applyText:(e,t)=>{Ve.current(e),requestAnimationFrame(()=>j.current?.setSelectionRange(t,t))},hoveredTokenIndex:ue?.ti??null}),{caretAnchor:We}=F(j),Ge=(0,X.useMemo)(()=>We(Ue.getAnchorOffset,0),[We,Ue.getAnchorOffset]),Ke=(0,X.useRef)(null),qe=(0,X.useCallback)(e=>!!Ke.current?.contains(e),[]),Je=ze({label:`formula-editor-hint`,anchor:Ge,autoFocus:!1,disableClickAway:qe,propsPopper:E===`above`?vs:_s,renderPopupPanel:Ue.renderPanel}),Ye=Je.reference,Xe=Ue.active&&!ie.getMode()?.dragging;(0,X.useEffect)(()=>{Xe?Ye.open(0):Ye.close(0)},[Xe,Ye]);let Ze=se(),Qe=(0,X.useRef)(Ze);Qe.current=Ze;let $e=()=>{if(y)return y.getSession();let e=Qe.current.getMode();return e?.key===`edit`?e.args.editable.getSession():null},et=e=>({...e.getCoords(),scope:$e()?.getCoords().scope??e.getWorksheet().getName()}),tt=ie.getMode(),nt=tt?.selection??null,rt=!!tt&&tt.activeInput===He.current;(0,X.useEffect)(()=>{if(r)return $e()?.registerEditor(He.current)},[r,s]),(0,X.useEffect)(()=>{L&&$e()?.setActiveEditor(He.current)},[L,r,s]);let it=Ee?.getVertical(),at=Ne?.bounds.y??Pe?.top??0,ot=Ne?Ne.bounds.y+Ne.bounds.height:null,st=Ne&&it===J.VerticalAlignment.Top?at:Pe?.top??0,ct;ct=ot!==null&&it===J.VerticalAlignment.Bottom?ot:ot!==null&&it===J.VerticalAlignment.Center?ot+(at-st):d?d.height-(Pe?.bottom??0)+2:0;let lt=!z||z<=ct-st,ut=Ae?{position:`absolute`,left:(Pe?.left??0)*u,top:st*u,right:(Pe?.right??0)*u,height:Math.max(0,ct-st)*u,display:`flex`,flexDirection:`column`,justifyContent:lt?Oe:`flex-start`}:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,justifyContent:`flex-start`},dt=(0,X.useRef)(null),ft=(0,X.useMemo)(()=>{let e=I.current;if(!e||!k)return null;try{let t=e.getWorksheet().getCalculation().createFormula(O,et(e),{target:`display`}),n=t.getTokens();if(n.length===0)return{tokens:[],ranges:[],valid:!1};let r=[];try{let i=t.getReferences(),a=$e()?.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=eo(e.getWorksheet(),n,r)}catch{}return{tokens:n,ranges:r,valid:t.isValid()}}catch{return{tokens:[],ranges:[],valid:!1}}},[O]),pt=(0,X.useRef)(ft);pt.current=ft;let mt=(0,X.useMemo)(()=>ft&&ft.tokens.map(e=>e.text??``).join(``)===O.slice(A)?ft.tokens:null,[ft,O,A]),ht=!!mt,gt=(0,X.useMemo)(()=>Mo(mt??null),[mt]),_t=(0,X.useMemo)(()=>{let e=I.current?.getWorksheet().getCalculation();return mt&&e?new Set(ls(e,mt,A).flatMap(e=>e.tokens)):new Set},[mt,A]),vt=(0,X.useMemo)(()=>Fo(ue?{lo:ue.lo,hi:ue.hi}:null,H,gt),[H,ue,gt]),yt=q(()=>{let e=j.current?.selectionStart??O.length;te(e);let t=mt;if(!t)return V(void 0),void U(null);let n=Pi(O),r=Ii(t,e,n);V(r>=0?Fi(t[r]):void 0);let i=L?No(t,gt.matchOf,e,n):null;U(e=>Po(e,i)?e:i)},[mt,O,L,gt]);(0,X.useEffect)(()=>{yt()},[yt,mt,L]);let bt=q(()=>{me.current=null,de(null)},[]),xt=q(()=>{he.current?.fromSelection||bt()},[]),St=Pa(()=>bt(),()=>Tt()),Ct=q(e=>{let t=dt.current;if(!ht||!ft||!t)return void bt();if(St.blocksHover(e)||Fa(j.current))return void xt();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=ft.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 bt();let a=Ra(s);if(!a)return void bt();let o=a.hi;if(me.current===`root`)return;me.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};de({rect:l,evalIndex:0,ti:-1,lo:0,hi:o,overEq:!0});return}let c=s[a];if(!c||c.type===`whitespace`)return void bt();let l=Ia(s,a);if(!l){if(xo.has(c.type)&&c.text){let e=`literal:${a}`;if(e===me.current)return;if(me.current=e,!o)return void bt();let t={left:o.left,right:o.right,top:o.top};de({rect:t,evalIndex:-1,ti:a,lo:a,hi:a,literal:c.text})}else bt();return}let u=`${l.evalIndex}:${l.lo}:${l.hi}`;if(u===me.current)return;me.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?de({rect:h,evalIndex:l.evalIndex,ti:a,lo:l.lo,hi:l.hi}):bt()},[ht,ft]),wt=q(e=>{let t=I.current;if(!t)return!1;try{return t.getWorksheet().getCalculation().createFormula(`=`+e,et(t),{target:`display`}).isValid()}catch{return!1}},[]),Tt=q(()=>{let e=()=>{he.current?.fromSelection&&bt()},t=j.current,n=dt.current;if(!(t&&n&&ht&&ft&&L))return void e();if(St.isDragging())return;let r=t.selectionStart??0,i=t.selectionEnd??0;if(r===i)return void e();let a=La(ft.tokens,A,O,r,i,wt);if(!a)return void e();let o=`sel:${a.lo}:${a.hi}:${a.fragment??a.evalIndex}`;if(o===me.current)return;me.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?de({rect:l,ti:-1,lo:a.lo,hi:a.hi,fromSelection:!0,evalIndex:a.fragment===null?a.evalIndex:-1,literal:a.fragment??void 0}):bt()},[ht,ft,A,O,L]);(0,X.useEffect)(()=>{L||bt()},[L,bt]);let Et=ue?.evalIndex??null,Dt=ue?.literal??null;(0,X.useEffect)(()=>{let e=I.current;if(!e||Dt===null&&(Et===null||!Ni(O)))return void pe(null);let t=!1;try{let n=e.getWorksheet().getCalculation(),r=Dt===null?n.createFormula(O,et(e),{target:`display`}):n.createFormula(`=`+Dt,et(e),{target:`display`});Promise.resolve(Dt===null?r.evaluate({evalIndex:Et}):r.evaluate()).then(e=>{t||pe(Wa(e))}).catch(()=>{t||pe(null)})}catch{pe(null)}return()=>{t=!0}},[Et,Dt,O]),(0,X.useEffect)(()=>{bt()},[O,bt]),(0,X.useLayoutEffect)(()=>{let e=ne.current;if(e)return ne.current=null,G.current=null,void j.current?.setSelectionRange(e.start,e.end);let t=G.current;t!==null&&(G.current=null,j.current?.setSelectionRange(t,t))},[O]);let Ot=q((e,t)=>{let n=I.current;if(n&&Ni(O))try{let r=n.getWorksheet().getCalculation().createFormula(O,et(n),{target:`display`}),i=Pi(O),a=Li(r.getTokens(),e,i);if(!a)return;let o=Ri(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=Xa(n,t)??$a(n,t,s)??Ya(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=L?j.current?.selectionStart??O.length:null;G.current=t===null||t>=a.start&&t<=a.end?a.end+e:t<=a.start?t:t+e}Ve.current(l)}catch{}},[O]),At=q(e=>{let t=I.current;if(t&&Ni(O))try{let n=Xa(t,e)??$a(t,e)??Ya(t,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},e.scope),r;if(L)r={start:j.current?.selectionStart??O.length,end:j.current?.selectionEnd??O.length};else{let e=K.current;r=e!==null&&e<=O.length?{start:e,end:e}:{start:O.length,end:O.length}}if(ft&&r.start===r.end){let e=Pi(O),t=e;for(let n of ft.tokens){let i=(n.text??``).length;if(n.referenceIndex!==void 0&&r.start>=t&&r.start<=t+i){let t=Li(ft.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);G.current=r.start+i.length,L||(K.current=r.start+i.length),Ve.current(a)}catch{}},[O,L,ft]),jt=(0,X.useRef)(0);jt.current=ft?.ranges.length??0;let Mt=q(()=>{let e=ie.getMode();if(!e||e.activeInput!==He.current||!L)return;let t=e.selection,n=I.current,r=ft?.ranges??null,i=j.current?.selectionStart??O.length,a=-1;if(r&&ft){let e=Pi(O);for(let t of ft.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&&Mi(O,i)&&!o&&!!ft,c=s||o&&!!ft;K.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};re.current=!0;try{t.updateCoords(d)}finally{re.current=!1}let f=c?`point`:`show`;e.mode!==f&&ie.setMode(e=>e&&e.mode!==f?{...e,mode:f}:e)},[ft,O,i,L]),Nt=Ze.getMode()?.key??null;(0,X.useEffect)(()=>{Mt(),Ue.update()},[Mt,Ue.update,ft,L,O,r,Nt,i,rt,nt]),(0,X.useEffect)(()=>{L&&tt&&tt.activeInput!==He.current&&ie.setMode(e=>e&&{...e,activeInput:He.current})},[L,tt]),(0,X.useEffect)(()=>{r&&tt&&!tt.activeInput&&ie.setMode(e=>e&&!e.activeInput?{...e,activeInput:He.current}:e)},[r,tt]),(0,X.useEffect)(()=>{r||(K.current=null)},[r]),(0,X.useEffect)(()=>()=>{ie.setMode(e=>e&&e.activeInput===He.current?{...e,activeInput:null}:e)},[]),(0,X.useEffect)(()=>{if(rt&&nt)return nt.addListeners({onChange:e=>{if(re.current||Ka())return;let t=e.getCoords(),n=t.rangeIndex??-1;n<0||!t.ranges||n>=t.ranges.length||(n<jt.current?Ot(n,t.ranges[n]):At(t.ranges[n]))}})},[rt,nt,Ot,At]);let Pt=Se.color,Ft=Ae?0:2,It={boxSizing:`border-box`,paddingTop:0,paddingBottom:0,paddingLeft:Ft,paddingRight:ht&&Re?`calc(${Ft}px + ${yo})`:Ft,margin:0,whiteSpace:je||Me?`pre-wrap`:`pre`,wordBreak:Me?`break-all`:je?`break-word`:`normal`,textAlign:Te,...Se,...Fe?{lineHeight:Fe*u+`px`}:null};return(0,Z.jsxs)(`div`,{ref:Ke,style:{position:`relative`,flex:`1 1 100%`,minWidth:0},onMouseDown:e=>{let t=j.current;if(!t||e.target===t||!qe(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:ut,children:(0,Z.jsxs)(`div`,{style:{position:`relative`,flex:Ae?`0 0 auto`:`1 1 100%`,width:`100%`,minWidth:0,...be&&!n?be.getFill()?.toCSS(`adaptive`):g.EmptyObject},children:[!!b&&!O&&(0,Z.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...It,color:Pt,opacity:.55},children:b}),ht&&(0,Z.jsxs)(`div`,{ref:dt,"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...It},children:[(()=>{let e=ce&&le!==null&&mt.some(e=>e.referenceIndex===le),t=Le&&!Re?Ie:-1,n=A,r=mt.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=A===1?(0,Z.jsx)(`span`,{"data-eq":!0,style:{color:Pt,opacity:e?.5:void 0},children:`=`},`eq`):null,a=mt.map((n,i)=>{let a=gt.unmatched.has(i),o=vt.has(i),s=gt.depthOf.get(i),c=a||s===void 0||n.referenceIndex!==void 0?void 0:To(s),l=a?Oo:c??Fi(n),u=e&&n.referenceIndex!==le,d;(l||o||a||u)&&(d={},l&&(d.color=l),a&&(d.fontWeight=`bold`),u&&(d.opacity=.5),o&&(d.color=`transparent`)),_t.has(i)&&(d={...d,...Ao});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:Eo,children:(0,Z.jsx)(`span`,{style:Do(l??Pt??`inherit`),children:n.text})}),p?(0,Z.jsxs)(Z.Fragment,{children:[f.slice(0,t-r[i]),(0,Z.jsx)(bo,{}),f.slice(t-r[i])]}):f]},i)});if(!ue)return(0,Z.jsxs)(Z.Fragment,{children:[i,a]});let{lo:o,hi:s,overEq:c}=ue,l=ue.fromSelection?wo:Co,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]})})(),Re&&(0,Z.jsx)(bo,{})]}),(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:Ae?z?z*u:void 0:`100%`,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,userSelect:`text`,...It,color:Pt,...ht?{WebkitTextFillColor:`transparent`}:null,caretColor:B??`auto`,...ue&&!ue.fromSelection?{[ke]:`transparent`}:null},onChange:e=>{let t=ve(e.target.value);if(t)return requestAnimationFrame(()=>j.current?.setSelectionRange(t.caret,t.caret)),void p(t.value);p(e.target.value)},onSelect:()=>{Mt(),Ue.update(),yt(),Tt()},onScroll:e=>{let t=dt.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft,bt(),Tt())},onMouseMove:Ct,onMouseLeave:xt,onDragStart:St.onDragStart,onPointerDown:e=>{e.stopPropagation(),St.begin(e),Xe&&!Je.isOpen&&Ye.open(0),i!==`edit`&&m(`edit`)},onKeyDown:e=>{if(!Ue.handleKeyDown(e))return e.which===oe.Escape&&Je.isOpen?(e.preventDefault(),e.stopPropagation(),void Ye.close(0)):void((e=>{if(e.which!==oe.F9||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return!1;let t=j.current,n=I.current;if(!t||!n||f||!k||!ft||ft.tokens.length===0)return!1;let r=t.selectionStart??0,i=t.selectionEnd??0,a;if(r!==i)a=La(ft.tokens,A,O,r,i,wt);else{let e=Ra(ft.tokens);a=e?{...e,...za(ft.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=et(n),l=n.getWorksheet().getWorkbook()?.getLocale()??null,u=Ba(En(l??`en`).decimal),d=Fn(),p={t:d?.booleans?.true??`TRUE`,f:d?.booleans?.false??`FALSE`};return(async()=>{let e=null,t=``;try{if(e=Ha(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&&(ne.current={start:a.start,end:a.start+e.length},P.replaceRangeText(n,a.start,a.end,e))})(),!0})(e)||(e=>{if(i===`edit`||!rt||!tt)return!1;let t=I.current?.getWorksheet(),n=(t?.getWorkbook()?.getSelectedWorksheet()??t)?.getName();return!!n&&qa(e,tt,n)})(e)||Be(e))},onFocus:()=>{R(!0),$e()?.setActiveEditor(He.current)},onBlur:e=>{let t=Ye.floatElement?.();t&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||R(!1)}})]})}),(0,Z.jsxs)(`div`,{ref:M,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,...Ce,...Fe?{lineHeight:`${Fe}px`}:null,...Me&&x!==void 0?{whiteSpace:`pre-wrap`,wordBreak:`break-all`,width:`max-content`,maxWidth:Math.max(1,x-(Pe?Pe.left+Pe.right:4))}:null},children:[(()=>{if(O.length===0)return` `;if(O.endsWith(`
|
|
6
|
-
`))return O+` `;if(!ht||Re)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:yo},children:O.slice(-e)})]})})(),ht&&Re&&(0,Z.jsx)(`span`,{style:{display:`inline-block`,width:`0.6em`,marginLeft:`1px`}})]}),!1,Je.component,ue&&fe!==null&&(0,pr.createPortal)((0,Z.jsx)(`div`,{"aria-hidden":!0,style:{...Na,left:(ue.rect.left+ue.rect.right)/2,top:ue.rect.top-6},children:fe}),document.body)]})};return r.displayName=`SheetCellInput`,r};function xs(e,t,n={}){let{mode:r=`edit`,initialSelection:i}=n;e.startEdit(e.getAnchor().getCoords(),{dirty:t,mode:r,initialSelection:i})}function Ss(e,t){let n=e.getSession()?.getActiveEditor();return!!n&&(n.insertText(t),!0)}function Cs(e,t,n={}){Ss(e,t)||xs(e,t,n)}function ws(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`?Ss(e,s):xs(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 Ts=[[`insertFunctionSum`,`SUM`],[`insertFunctionAverage`,`AVERAGE`],[`insertFunctionCount`,`COUNT`],[`insertFunctionMax`,`MAX`],[`insertFunctionMin`,`MIN`]];function Es(e,t){let{editable:n,sheet:r,flavor:i}=t,a=e=>{e!=null&&(i===`caret`?Ss(n,e):xs(n,e))};e.updateCommand(`insertCurrentTime`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Bn.nowWithPrecision(),style:{numberFormat:`Medium Time`}}).getText())}),e.updateCommand(`insertCurrentDate`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:Bn.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 Ts)e.updateCommand(t,{tags:[`noTransaction`],callback:()=>ws(n,r,a,i)});return()=>{}}function Ds(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 Os(e,t){let{editable:n,sheet:r,active:i=!0}=t;if(!i)return()=>{};let a=Es(e,{editable:n,sheet:r,flavor:`caret`}),o=Ds(e,{editable:n});return()=>{a(),o()}}var ks=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`},As=e=>{let t=U(),n=K(),r=(0,X.useRef)(!1);return(0,X.useEffect)(()=>{r.current=!1},[e]),q((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 ks(t,n).then(e=>{e&&a?.()})}if(r.current)return;r.current=!0,t?.showMessage?.(n(`error.sheet.protectedSheet`),{type:ce.Error})}else i&&e.getRange({rowIndex:i.rowIndex,colIndex:i.colIndex}).getCell().getSpillKind()===`fixed`&&t?.showMessage?.(n(`error.sheet.changePartOfArray`),{type:ce.Error})},[e,t])},{CommandScopeProvider:js}=Ae,Ms=`2px 2px 6px 2px color-mix(in srgb, ${ie(`color-base-content`)} 14%, transparent)`,Ns=Object.freeze({x:0,y:0,width:0,height:0}),Ps=({alignWidth:e,children:t})=>{let n=lt(),r=e/P.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 Fs(e){let{sheet:t,editable:n,darkMode:r,alignment:i,alignWidth:a=2,zIndex:o,className:s,style:c,...l}=e,u=ot(),d=(0,X.useMemo)(()=>bs({selection:t.getSelection()}),[t]),f=I(n,e=>e.getSession()),p=Te(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=q(e=>{_(t=>t&&t.width===e.width&&t.height===e.height?t:e)},[]),y=q(e=>n.commit(e),[n]),b=q(()=>{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?ys(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=nt(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=q(()=>{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},L=!x||x.scope&&x.scope!==t.getName()?`transparent`:Oa(t.getRange(x).getCell(),t,r,`var(--sxl-color-base-100)`);return(0,Z.jsx)(js,{spec:{scopeName:{key:`layer:editor`,name:`editor`},contributor:{dynamic:Os},data:h},order:ft().zIndex,children:(0,Z.jsx)(Yt,{className:Q(s,`sxl-editor`),children:T||p?(0,Z.jsx)(bt,{...l,bounds:T??Ns,alignWidth:a,keepMounted:!0,onFocus:M,style:{borderColor:ie(`color-primary`),...c,display:`flex`,overflow:`hidden`,background:L,boxShadow:A?Ms:`none`,opacity:+!!A,pointerEvents:A?`auto`:`none`},children:(0,Z.jsx)(Ps,{alignWidth:a,children:(0,Z.jsx)(d,{...F,editable:n,maxContentWidth:O})})}):null})})}Fs.displayName=`SheetCellEditorLayer`;var Is=(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 Ls(e){let{sheet:t,editable:n,onEditRejected:r}=e,i=ot(),a=ue(),o=As(t),s=r??o,c=U(),l=q(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=Jr({sheet:t,notifier:c,notifyEditRejected:s});if(function(e,t,n){Hr();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)Wr(a)?.onKey?.(e,{sheet:t,selection:r,anchor:i,controls:s},n)&&(l=!0);return Rr.size>0&&i.getType()===jn.RichData&&Rr.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=Rt(e.nativeEvent);if(!d)return;e.nativeEvent.key!==`Process`&&e.nativeEvent.keyCode!==229&&e.preventDefault(),e.stopPropagation();let f=o?a:void 0,p=()=>Is(n,l,d,f);p()||s(l,()=>{p()})},[n,i,a,s,t,c]),u=q(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=()=>Is(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=q(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)(Yt,{className:`sxl-editor-start`,onKeyDown:l,onDoubleClick:d})}Ls.displayName=`SheetCellEditorStartLayer`;function Rs(e){return ue().isEnabled()?(0,Z.jsx)(zs,{...e}):null}function zs(e){let{editable:t}=e,n=ot(),r=ue(),i=(0,X.useRef)(null),a=n!=null&&n===it(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=te();return Oe(()=>{let n=te();n!==e&&(e=n,n?t.getSession()&&r.show():r.hide())})},[a,r,t]),(0,X.useEffect)(()=>{if(a)return ve(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||!te()||n.scrollCellCoordsIntoView(t.getAnchor().getCoords())},[a,n,r,t]),(0,X.useEffect)(()=>{if(a&&n&&!r.getOptions().disableScrollIntoView)return Le(()=>{let e=Ve(),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)(Yt,{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`}})})}Rs.displayName=`VirtualKeyboardLayer`,zs.displayName=`VirtualKeyboardPaneLayer`;var Bs=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({[Qn.Presets.Copy.id]:C(`autoFill.preset.copy`),[Qn.Presets.Series.id]:C(`autoFill.preset.series`),[Qn.Presets.Linear.id]:C(`autoFill.preset.linear`),[Qn.Presets.Growth.id]:C(`autoFill.preset.growth`),[Qn.Presets.DateYears.id]:C(`autoFill.preset.dateYears`),[Qn.Presets.DateMonthEnd.id]:C(`autoFill.preset.dateMonthEnd`),[Qn.Presets.DateMonths.id]:C(`autoFill.preset.dateMonths`),[Qn.Presets.DateWeekdays.id]:C(`autoFill.preset.dateWeekdays`),[Qn.Presets.DateDays.id]:C(`autoFill.preset.dateDays`),[Qn.Presets.LinearTrend.id]:C(`autoFill.preset.linearTrend`),[Qn.Presets.GrowthTrend.id]:C(`autoFill.preset.growthTrend`)});function Vs(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,{...Hs(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,{...Hs(e),autoSelect:!0})}catch(e){n?.showError?.(e)}}finally{s?.()}}};n?.showWindow?.(`fillSeries`,l)}function Hs(e){let t=Qn.getPreset(e.presetId);if(!t)throw new k(j(`error.fillSeries.unknownType`));return Qn.toFillOptions(t,{trend:e.trend,stepValue:e.stepValue,stopValue:e.stopValue})}function Us(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:Qn.getPreset(e.presetId);if(e.presetId!==void 0&&!n)throw new k(j(`error.fillSeries.unknownType`));let i={...n?Qn.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,Vs({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 Ws(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 Gs={top:Y.Direction.Up,bottom:Y.Direction.Down,left:Y.Direction.Left,right:Y.Direction.Right},Ks=({sheet:e,isActive:t=!0,onFillMenu:n,className:r,...i})=>{let a=U(),o=K(),c=se(),[l,u]=(0,X.useState)(null),d=!!Ae.useCommandScope(),f=(0,X.useMemo)(()=>({navigation:l,sheet:e}),[l,e]),[p]=Ae.useCommands([`pasteFormats`]),m=q(async()=>{c.getMode()?.key===`formatPainter`&&(await p?.execute(),c.setMode(null))},[c,p]),h=(0,X.useMemo)(()=>new Bs(e.getSelection()),[e]),g=`selection:${e.getId()}`,_=It(g),v=q(t=>{let n=e.getSelection();n.setAdjusting(t===`extend`?n.getCoords():null)},[e]),y=q(()=>e.getUsedRange()?.getCoords()??w.EmptyRange,[e]),b=q(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=q(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=xe()===`touch`,N=M&&t&&!E&&k<=1,F=j&&!M&&(!T||D||O),I=T&&$s.has(T.key)?T.cursor:void 0,L=X.useMemo(()=>{if(!M)return;let e=Math.max(2,Math.round(2*P.getDevicePixelRatio()));return{border:{alignWidth:e},inner:{alignWidth:e}}},[M]),R=(0,X.useRef)(null),z=e=>R.current?{...e,cancel:R.current}:e,ee=q((e,t,n,r)=>{R.current=r,c.setMode(z(ec(n)))},[c]),B=q((e,t,n,r)=>{c.setMode(z(ec(r)))},[c]),V=q(()=>{R.current=null,c.setMode(null)},[c]),H=(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)))}},W=q((t,n)=>n.insert?!e.getRange(n.to).canInsertFrom(t,{isCut:!n.copy,axis:n.insert}):H(t,n.to,!n.copy).refused,[e]),te=q((e,t)=>H(e,t.to,!t.copy).to,[e]),G=q(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]),ne=q((t,n)=>e.getRange(t).autoFill(n,{preview:!0,snap:!0}).getCoords(),[e]),re=q((e,t,n)=>{R.current=n},[]),ie=q(()=>{c.setMode(z(Qs))},[c]),ae=(0,X.useRef)(null),oe=q((t,n,r)=>{let i=Gs[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]),ce=q(t=>e.getRange(t).getExtended(Y.Direction.Down,{basis:`adjacent`}).getCoords(),[e]),le=q(()=>{R.current=null,c.setMode(null),ae.current=null},[c]),ue=q((t,r,i,o)=>{if(!n)return;let s=Us({sheet:e,template:t,destination:r,notifier:a,onSettled:o});if(!s)return o(),void G(t,r);n({clientX:i.clientX,clientY:i.clientY,originalEvent:i},s)},[e,a,n,G]),de=q(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)(Ae.CommandScopeProvider,{spec:{scopeName:{key:`layer:selection`,name:`selection`},contributor:{dynamic:Ws},data:f},order:ft().zIndex,children:[(0,Z.jsx)(Wt,{className:Q(r,`sxl-selection`),selection:h,...i,singleStyle:L,getContentBounds:y,getRegionBounds:b,scrollIntoView:x,enabledMove:j,onMove:de,isDropRefused:W,snapMoveDestination:te,onMoveStart:ee,onMoveUpdate:B,onMoveEnd:V,moveCursor:I,enableFill:F,snapFillDestination:ne,onFill:G,onFillStart:re,onFillPreview:ie,onFillEnd:le,onFillMenu:n?ue:void 0,resolveFillExtent:ce,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)(ht,{selection:h,glide:_})]})};Ks.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,Js={key:`dragCut`,description:C(`editMode.dragCut`),cursor:`move`},Ys={key:`dragCutInsert`,description:C(`editMode.dragCutInsert`),cursor:`move`},Xs={key:`dragCopy`,description:C(`editMode.dragCopy`),cursor:`copy`},Zs={key:`dragCopyInsert`,description:C(`editMode.dragCopyInsert`),cursor:`copy`},Qs={key:`fill`,description:C(`editMode.fill`),cursor:`crosshair`},$s=new Set([Js,Ys,Xs,Zs].map(e=>e.key)),ec=e=>e.copy?e.insert?Zs:Xs:e.insert?Ys:Js,tc=(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 nc(e){let{sheet:t,sheetView:n,className:r,onKeyDown:i,...a}=e,o=ba(),s=o.getMode(),c=s?.selection??null,l=c?.getWorksheet().getName(),u=t.getName(),d=l===u,f=!!s?.scope&&s.scope!==u,p=Vi(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 Bs(e)},[t,p,u]),h=q((e,t)=>{o.setMode(n=>n&&{...n,dragging:e,draggingIndex:e&&t!==null?t:void 0})},[]),g=q(e=>{if(i?.(e),e.defaultPrevented)return;let t=o.getMode();if(t?.mode!==`point`||t.scope&&t.scope!==u||qa(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?tc(new Bs(c),u):null,[c,u]),v=Te(_,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)(Ot,{className:Q(r,`sxl-reference-picker`,`sxl-formula-view`),selection:m,getRangeStyle:(e,t)=>{let n=p.ranges[e];return n&&n.scope===u?tt(e):null},...a,animated:!1,disableDraw:!0,allowMulti:!1,anchors:rc,onKeyDown:i});if(!_||!v||!S)return null;let C=!0===s?.readOnly;return(0,Z.jsx)(Ot,{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)?tt(e):null},...a,animated:!C&&(v.rangeIndex??-1)>=0,enabledMove:!C,anchors:C?rc:void 0,disableDraw:!x||C,allowMulti:!1!==s?.allowMulti,onDragActiveChange:h,onKeyDown:g})}nc.displayName=`SheetReferenceLayer`;var rc=[],ic=Object.freeze([]),ac=e=>{let t=jt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n]);o(e,{onTablesChange:()=>r(),onAutoTableChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r()},oc);let a=t.getVisibleRange(),s=(0,X.useMemo)(()=>{if(!a)return ic;let t=e.getTables().getItems({address:a});return t.length>0?t:ic},[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()},sc));return()=>{for(let t of e)t?.()}},[s]),{visibleTables:s,cacheToken:i}},oc={transactional:!1,ignoreModelChange:!0},sc={transactional:!1},cc=Object.freeze([Gn.Feature.Borders,Gn.Feature.Fill,Gn.Feature.NumberFormat,Gn.Feature.DateFormat,Gn.Feature.AutoTable,Gn.Feature.Table,Gn.Feature.Pivot,Gn.Feature.Merge,Gn.Feature.Hyperlink,Gn.Feature.IgnoredErrors,Gn.Feature.Comments,Gn.Feature.Unlock,Gn.Feature.Formula,Gn.Feature.Spills,Gn.Feature.CalcStatus,Gn.Feature.CalcError,Gn.Feature.Circular,Gn.Feature.DataValidations,Gn.Feature.Conditionals,Gn.Feature.CellControl]),lc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:cc},uc=(e,t)=>{let n=jt(),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();mr(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())},dc);let p=()=>{u.current.clear(),c()};return o(e,{onStyleChange:p,onLayoutChange:p},{ignoreModelChange:!0}),{getVisibleCells:q((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()===jn.Number)})(o))return;let s=r?null:o.getExtrusions();d.push({cell:n,value:o,range:s??void 0})},lc),o.set(c,d),o.size>12&&o.delete(o.keys().next().value),d},[e,r,i,a]),cacheToken:l}},dc={transactional:!1,anchor:Jn.Type.Absolute},fc=(e,t)=>{let n=jt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t,e]),s=(0,X.useRef)(new Map),c=q(()=>{s.current.clear(),i()},[]);o(e,{onStyleChange:c,onLayoutChange:c,onProtectionChange:c});let l=n.getVisibleRange();return mr(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()},pc),{getRegions:q((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}},pc={transactional:!1,anchor:Jn.Type.Absolute},mc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:cc},hc=(e,t)=>{let n=jt(),[r,i]=(0,X.useReducer)(e=>e+1,0),a=(0,X.useMemo)(()=>({}),[r,t]),s=(0,X.useRef)(new Map),c=q(()=>{s.current.clear(),i()},[]);o(e,{onConditionalFormatsChange:c},{ignoreModelChange:!0});let l=n.getVisibleRange();return mr(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()},_c),{getVisibleDecorations:q((n,r)=>{let i=s.current,a=r??n.getVisibleRange();if(!a)return gc;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,c=i.get(o);if(c)return c;let l=e.getRange(a),u=gc;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})},mc),e.length>0&&(u=e)}return i.set(o,u),i.size>12&&i.delete(i.keys().next().value),u},[e,t]),cacheToken:a}},gc=[],_c={transactional:!1,anchor:Jn.Type.Absolute},vc=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,className:i,style:a,...o}=e,c=jt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=q(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()===vn.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)(bt,{className:`sxl-cell-fill`,range:t,clipInsets:-10,coverGridlines:!0,style:{pointerEvents:`none`,...i},children:a},`fill-${e}`))}return(0,Z.jsx)(Yt,{...o,className:Q(i,`sxl-fills`),children:(0,Z.jsx)(bt,{fill:!0,ref:t,className:`sxl-fills-box`,style:{pointerEvents:`none`,overflow:`visible`,...a},children:_})})})),yc=(e,t)=>{let n=Pn.cellToString(e)??``;return e.scope&&e.scope!==t?Pn.sheetAndRangeToString(Pn.sheetNameToString(e.scope)??e.scope,n):n},bc=(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},xc=(e,t)=>{let n=ba();(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])},Sc=`_panel_14jxb_5`,Cc=`_search_14jxb_16`,wc=`_values_14jxb_24`,Tc=`_empty_14jxb_28`,Ec=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=K(),p=Ye(),m=(0,X.useRef)(null),[h,g]=(0,X.useState)(``),_=(0,X.useMemo)(()=>a?Nt(t,h):t,[t,h,a]),v=(0,X.useMemo)(()=>n==null?0:Math.max(0,_.findIndex(e=>e.text===n)),[_,n]),y=q((e,t)=>{r(t)},[r]),b=(0,X.useCallback)(e=>{let t=m.current;t&&(e.which===oe.Down||e.which===oe.Up?(e.preventDefault(),t.moveHighlight(e.which===oe.Down?1:-1)):e.which===oe.Enter&&(e.preventDefault(),t.chooseHighlighted()))},[]),x=a?(0,Z.jsx)(xt,{className:Cc,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(Sc,`sxl-cell-picker`,c),style:{minWidth:i,...s},...be(`grid`,p),children:[x,_.length===0?(0,Z.jsx)(`div`,{className:Tc,children:f(h?`picker.noMatches`:`picker.noValues`)}):(0,Z.jsx)(At,{ref:m,className:wc,items:_,highlightIndex:v,onChoose:y,measureText:l,viewport:u,visibleRows:d,autoFocus:!a})]})};Ec.displayName=`PickerPanel`;var Dc=null,Oc=new Set,kc=e=>(Oc.add(e),()=>{Oc.delete(e)}),Ac=e=>{Dc!==e&&(Dc=e,Oc.forEach(e=>e()))},jc=e=>(0,X.useSyncExternalStore)(kc,()=>Dc===e,()=>!1),Mc={placement:`bottom-end`,offsets:[0,1]},Nc=(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=Ta();return e.cancel(),t&&wa(t),!1},a=e.commit();return!0===a||(!1===a?i():a.then(e=>e||i()))},Pc=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=q(e=>{b&&(a?a(e,b):n&&Nc(n,b,e.text))},[n,b,a]),S=(0,X.useCallback)(e=>{let{closeFloat:t}=e;return(0,Z.jsx)(Ec,{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=q(()=>Ac(t),[t]),w=q(()=>Ac(null),[]);(0,X.useEffect)(()=>()=>Ac(null),[]);let T=ze({label:c,anchor:f,autoFocus:!1,propsPopper:Mc,renderFloatPanel:Ht,renderPopupPanel:S,onOpen:C,onClose:w}),E=T.reference,D=q(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:q(()=>{v.current++,E.close(0)},[E]),isOpen:T.isOpen}},Fc={side:`b`,align:`start`},Ic=(e,t,n=6)=>e.getBoundsFromRange(t).width+n,Lc=`_prompt_1qgxn_8`,Rc=`_line_1qgxn_24`,zc=`_title_1qgxn_28`,Bc=`_message_1qgxn_28`,Vc=`_alert_1qgxn_34`,Hc=`_alertRow_1qgxn_52`,Uc=`_alertIcon_1qgxn_58`,Wc=`_alertTitle_1qgxn_63`,Gc=`_alertHint_1qgxn_67`,Kc=(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:Kc(e,t),title:a,message:o,dataValidation:i}}return null},Jc=(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}}},Yc=e=>{let{sheet:t,prompt:n,floatProps:r}=e,i=(0,X.useMemo)(()=>Jc(t,n.title,!0),[t,n.title]),a=(0,X.useMemo)(()=>Jc(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:Rc,style:{height:e.height,lineHeight:`${e.height}px`},children:e.text},t))}):null;return(0,Z.jsxs)(`div`,{...r,className:Lc,style:{...r.style,width:o},role:`note`,children:[s(i,zc),s(a,Bc)]})},Xc=e=>{let{alert:t,floatProps:n}=e,r=K(),i=t.dataValidation,a=i.getAlertTitle(),o=i.getAlertMessage()||r(`validationAlert.default`),s=t.style===zn.AlertStyle.Stop?r(`validationAlert.hint.stop`):t.style===zn.AlertStyle.Warning?r(`validationAlert.hint.warning`):null;return(0,Z.jsx)(`div`,{...n,className:Vc,style:{...n.style,borderLeftColor:tl[t.style]},role:`alert`,children:(0,Z.jsxs)(`div`,{className:Hc,children:[(0,Z.jsx)(`span`,{className:Uc,children:(0,Z.jsx)(M,{iconKey:nl[t.style],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[a?(0,Z.jsx)(`div`,{className:Wc,children:a}):null,(0,Z.jsx)(`div`,{children:o}),s?(0,Z.jsx)(`div`,{className:Gc,children:s}):null]})]})})},Zc=(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 Bs(t.getSelection()),[t]),u=jt(),d=jc(t),f=Ea(t);(0,X.useEffect)(()=>{if(!f)return;let e=()=>{let e=n?.getSession()??null;e&&w.isEqualCells(e.getCoords(),f.coords)||wa(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=q((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:Ic(n,i.range,r)}:null},[t]),m;if(f){let e=Kc(t,f.coords);m={range:e,key:`alert:${e.rowStart},${e.colStart}:${f.dataValidation.getIndex()}:${f.style}`,data:{alert:f},alignOffset:Ic(u,e,r)}}return(0,Z.jsx)(mt,{...c,className:Q(o,`sxl-validation-prompt`,f&&`sxl-validation-alert`),style:s,activateOn:`selection`,selection:l,probe:p,target:m,placement:Fc,offset:r,whenOff:`hide`,interactive:`pointer`,dismiss:d,children:({data:e,floatProps:n})=>e.alert===void 0?i===void 0?(0,Z.jsx)(Yc,{sheet:t,prompt:e.prompt,floatProps:n}):(0,Z.jsx)(We,{render:i,props:{prompt:e.prompt,floatProps:n}}):a===void 0?(0,Z.jsx)(Xc,{alert:e.alert,floatProps:n}):(0,Z.jsx)(We,{render:a,props:{alert:e.alert,floatProps:n}})})});Zc.displayName=`ValidationPromptLayer`;var Qc=(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},$c={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},el={...$c,includeEmpty:!0},tl={failed:`var(--sxl-color-neutral, #9ca3af)`,[zn.AlertStyle.Information]:`var(--sxl-color-info, #3b82f6)`,[zn.AlertStyle.Warning]:`var(--sxl-color-warning, #f59e0b)`,[zn.AlertStyle.Stop]:`var(--sxl-color-error, #ef4444)`},nl={failed:`ValidationFailed`,[zn.AlertStyle.Information]:`ValidationInformation`,[zn.AlertStyle.Warning]:`ValidationWarning`,[zn.AlertStyle.Stop]:`ValidationStop`},rl=({sheet:e,cycle:t})=>(xc(e,t),null),il={error:`var(--sxl-color-error, #d32f2f)`,warning:`var(--sxl-color-warning, #ed6c02)`,circular:`var(--sxl-color-error, #d32f2f)`,validation:`var(--sxl-color-error, #d32f2f)`},al={failed:`var(--sxl-color-neutral, #9e9e9e)`,information:`var(--sxl-color-info, #0288d1)`,warning:`var(--sxl-color-warning, #ed6c02)`,stop:`var(--sxl-color-error, #d32f2f)`},ol=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`}),sl=e=>({fontWeight:600,color:e}),cl=new Map([[An.Code.Parse,C(`cellError.description.parse`)],[An.Code.Null,C(`cellError.description.null`)],[An.Code.Div0,C(`cellError.description.div0`)],[An.Code.Value,C(`cellError.description.value`)],[An.Code.Ref,C(`cellError.description.ref`)],[An.Code.Name,C(`cellError.description.name`)],[An.Code.Num,C(`cellError.description.num`)],[An.Code.NA,C(`cellError.description.nA`)],[An.Code.GettingData,C(`cellError.description.gettingData`)],[An.Code.Spill,C(`cellError.description.spill`)],[An.Code.Connect,C(`cellError.description.connect`)],[An.Code.Blocked,C(`cellError.description.blocked`)],[An.Code.Unknown,C(`cellError.description.unknown`)],[An.Code.Field,C(`cellError.description.field`)],[An.Code.Calc,C(`cellError.description.calc`)],[An.Code.Busy,C(`cellError.description.busy`)],[An.Code.Python,C(`cellError.description.python`)],[An.Code.Timeout,C(`cellError.description.timeout`)]]),ll={opacity:.75,marginTop:2},ul={display:`inline-flex`,marginTop:2},dl={display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:8,overflow:`hidden`},fl={padding:0,border:0,background:`none`,color:`inherit`,font:`inherit`,textDecoration:`underline`,cursor:`pointer`},pl=(0,X.memo)(e=>{let{sheet:t,placement:n=Fc,offset:r=6,alignOffset:i,openDelay:a,closeDelay:o,renderTip:s,className:c,...l}=e,u=se(),d=u.getMode()?.key===`edit`,f=K(),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(An.isError(e)){let t=r.getText(),n=e.message||a.filter(t=>String(t)!==String(e)).join(`
|
|
7
|
-
`),o=cl.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=Qc(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=q((e,t)=>{let n=p(e);return n&&i===void 0?{...n,alignOffset:Ic(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:ul,children:(0,Z.jsx)(M,{iconKey:nl[t.state],size:14,ariaHidden:!0})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{style:dl,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=yc(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?{...fl,color:i}:fl,onMouseDown:e=>e.preventDefault(),onClick:()=>{bc(t,e)},children:o},r)},_=(e,t)=>{let n=t.path,r=(e=>{if(!e||Gt.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 Gt[n%Gt.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)(yt,{...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?al[n.validation.state]:a?`var(--sxl-color-info, #0288d1)`:il[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)(rl,{sheet:t,cycle:n.cycle}):null,s===void 0?(0,Z.jsxs)(`div`,{...r,style:{...ol(o),...r.style},children:[c?(0,Z.jsx)(`div`,{style:sl(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?ll:void 0,children:n.message}):null]})]}):(0,Z.jsx)(We,{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}})]})}})});pl.displayName=`CellErrorLayer`;var ml=e=>{let t=e.getProtection();return t.isInsertHyperlinksAllowed()&&t.isFormatCellsAllowed()},hl=`_preview_d64gw_2`,gl=`_previewShown_d64gw_8`,_l=`_previewSlide_d64gw_12`,vl=`_previewClip_d64gw_16`,yl=new Map,bl=new Map,xl=(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=se().getMode()?.key===`edit`,[l]=Ae.useCommands([`updateHyperlink`]),u=U(),d=q(e=>{let n=t.getCell(e),r=n.getHyperlink();return r?{range:n.getRange().getCoords(),data:{hyperlink:r}}:null},[t]),[f]=ut(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)(yt,{...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():!ml(t))};return(0,Z.jsx)(Sl,{...d,lookup:r,renderCard:n===void 0?Al:n})}})});xl.displayName=`HyperlinkLayer`;var Sl=e=>{let{lookup:t,renderCard:n,...r}=e,i=((e,t)=>{let[,n]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!t||bl.has(e))return;let r=!1,i=yl.get(e);return i||(i=Promise.resolve().then(()=>t(e)).catch(()=>null).then(t=>(bl.set(e,t),t)),yl.set(e,i)),i.then(()=>{r||n(e)}),()=>{r=!0}},[e,t]),t?bl.get(e)??null:null})(r.hyperlink.getAddress(),t);return(0,Z.jsx)(We,{render:n,props:{...r,preview:i}})},Cl=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(hl,s&&gl,s===`slide`&&_l),children:(0,Z.jsx)(`div`,{className:vl,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)})})},wl={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))`},Tl={display:`flex`,alignItems:`center`,gap:6},El={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`},Dl={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`transparent`,cursor:`pointer`,padding:3,borderRadius:4,color:`inherit`,opacity:.8},Ol={...Dl,cursor:`default`,opacity:.35},kl=e=>{let{hyperlink:t,open:n,copy:r,edit:i,remove:a,disabled:o,preview:s,tipProps:c}=e,l=K(),u=t.getScreenTip(),d=t.getAddress(),f=()=>{n()},p=s?.title;return(0,Z.jsxs)(`div`,{...c,role:`toolbar`,style:{...wl,...c.style},children:[(0,Z.jsxs)(`div`,{style:Tl,children:[(0,Z.jsx)(`button`,{type:`button`,style:Dl,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:{...El,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?{...El,opacity:.75}:{...El,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:Dl,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?Ol:Dl,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?Ol:Dl,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:{...El,whiteSpace:`normal`},onClick:f,tabIndex:-1,children:(0,Z.jsx)(Cl,{src:s.image,expectedWidth:s.imageWidth,style:{marginTop:8}})}):null]})},Al=e=>(0,Z.jsx)(kl,{...e}),jl=e=>{let t=e.getStyles().getNormal().getBorders(),[n,r]=Ml(t.getBottom(),bn.Edge.Bottom,t.getTop(),bn.Edge.Top),[i,a]=Ml(t.getRight(),bn.Edge.Right,t.getLeft(),bn.Edge.Left),o=Nl(n,r),s=Nl(i,a),c=(0,X.useMemo)(()=>ri(n,r),[o]),l=(0,X.useMemo)(()=>ri(i,a),[s]);return(0,X.useMemo)(()=>({rows:c,columns:l}),[c,l])},Ml=(e,t,n,r)=>bn.compareStrokes(e,n)>=0?[e,t]:[n,r],Nl=(e,t)=>e.isNone()?``:`${e.getStyle()}|${e.getColor().toCSS(`adaptive`)}|${t}`,Pl=(e,t)=>e.getStyle().getBorders(),Fl=(e,t)=>{let n=e.getSpans();return n.width===1&&n.height===1?null:e.getExtrusions()},Il=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=jt();s(n,[`onStyleChange`,`onLayoutChange`]);let l=jl(n),{renderLayer:u}=ii({getVisibleCells:r,getBorderAt:Pl,getMergeAt:Fl,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)(Yt,{...o,className:Q(a,`sxl-borders`),children:(0,Z.jsx)(bt,{fill:!0,className:`sxl-borders-box`,style:{pointerEvents:`none`},children:d})}):null})),Ll=(0,X.memo)(e=>{let{sheet:t,sheetView:n,renderCell:r,propsCellRender:i,editable:a,onEditRejected:o,className:c,...l}=e,u=jt(),d=U(),f=As(t),p=o??f,m=(0,X.useSyncExternalStore)(Kr,qr);s(n,[`onZoomScaleChange`]);let h=n.isShowFormulas(),g=n.isShowZeros(),{getVisibleCells:_,cacheToken:v}=uc(t,{showFormulas:h,showZeros:g,contentOnly:!0}),y=(0,X.useMemo)(()=>({}),[v,m]),b=(0,X.useMemo)(()=>Jr({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)(vr,{docTheme:s.getTheme(),normalStyle:s.getNormal(),showFormulas:h,showZeros:g,...o})};return e.displayName=`DefaultCellContent`,e},[t,h,g]),S=q(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:Gr(o);if(s?.entry.renderer){let e=s.entry.renderer({...a,value:o,control:s.control,context:b,interactiveProps:Ut,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)(vr,{...a,key:r,docTheme:_.getTheme(),normalStyle:_.getNormal(),showFormulas:h,showZeros:g,onLinkClick:c,...m,value:o})},[t,h,g]),C=r??S,w=Te(a,e=>e.getSession()),T=Vi(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)(bt,{bounds:t,className:`sxl-formula-view-anchor`,style:{pointerEvents:`none`},children:(0,Z.jsx)(Bi,{cell:T.cell,tokens:T.tokens,zoom:e,size:{width:t.width/e,height:t.height/e}})})}}let O=q(e=>{l.onPointerDown?.(e),e.isPropagationStopped()||function(e,t,n){if(e.button!==0)return!1;let r=Mt(e.target);if(!r)return!1;let i=t.getCell(r),a=Gr(i);a?.entry.onPress&&(e.stopPropagation(),e.preventDefault(),a.entry.onPress(i,n,e))}(e,t,b)},[l.onPointerDown,t,b]),k=q(e=>{l.onDoubleClick?.(e),!e.isPropagationStopped()&>(e.target)&&(e.stopPropagation(),e.preventDefault())},[l.onDoubleClick]);return D||_(u).length!==0?(0,Z.jsxs)(Yt,{...l,className:Q(c,`sxl-cells`),onPointerDown:O,onDoubleClick:k,children:[(0,Z.jsx)(qt,{renderCell:C,getVisibleCells:_,cacheToken:y,suppressCell:E}),D]}):null});Ll.displayName=`SheetCellLayer`;var Rl=(0,X.memo)(e=>{let{sheet:t,onColumnButtonMouseDown:n,propsColumnButton:r,renderColumnButton:i=Gi,...a}=e,{cacheToken:o}=ac(t),s=q((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=q(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)(We,{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)(rt,{...a,className:`sxl-column-buttons`,renderCell:c,getVisibleCells:s,cacheToken:o})});Rl.displayName=`SheetColumnButtonLayer`;var zl=e=>{let t=[e.getRange().getCoords()],n=e.getPageRange();return n&&t.push(n.getCoords()),t},Bl=e=>{let[t,n]=zl(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},Vl=(e,t)=>{for(let n of e.getPivotTables().getItems())if(!n.isDeleted()){for(let e of zl(n))if(w.isRangeWithinRange(t,e))return n}return null},Hl=e=>{let t=e.getSelection().getCoords()?.cell;return t?Vl(e,{rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}):null},Ul=(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},Wl=(e,t)=>Ul(e.getStyle(),t)??`var(--sxl-color-neutral, grey)`,Gl=`_PivotFields_105hs_4`,Kl=`_Search_105hs_15`,ql=`_FieldList_105hs_30`,Jl=`_FieldRow_105hs_41`,Yl=`_FieldName_105hs_57`,Xl=`_TypeGlyph_105hs_65`,Zl=`_FilterMark_105hs_74`,Ql=`_Empty_105hs_80`,$l=`_Areas_105hs_86`,eu=`_Area_105hs_86`,tu=`_AreaLabel_105hs_100`,nu=`_AreaList_105hs_105`,ru=`_AreaHint_105hs_123`,iu=`_Chip_105hs_130`,au=`_ChipCaption_105hs_144`,ou=`_ChipRename_105hs_172`,su=`_ChipMenuButton_105hs_185`,cu=`_ChipMenu_105hs_185`,lu=`_ChipMenuItem_105hs_220`,uu=`_ChipMenuCheck_105hs_243`,du=`_ChipMenuDivider_105hs_249`,fu=`_Pane_105hs_255`,pu=`_PaneName_105hs_270`,mu=`_PaneEmpty_105hs_276`,hu=`_EmptyBox_105hs_285`,gu=`_EmptyContent_105hs_292`,_u=`_EmptyName_105hs_302`,vu=`_EmptyHint_105hs_315`,yu=`_EmptyPicture_105hs_321`,bu=`_EmptyPicturePaper_105hs_327`,xu=e=>{let t=jt(),[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()},wu);let a=t.getVisibleRange();return{visibleTables:(0,X.useMemo)(()=>{if(!a)return Tu;let t=e.getPivotTables().getItems().filter(e=>!e.isDeleted()&&w.isRangesIntersect(Bl(e),a));return t.length>0?t:Tu},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]),cacheToken:i}},Su=(0,X.memo)(e=>{let{sheet:t,onPivotButtonMouseDown:n,...r}=e,{visibleTables:i,cacheToken:a}=xu(t),o=q((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=In(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=q(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)(da,{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=tr(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)(fa,{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)(Yt,{...r,className:`sxl-pivot-controls sxl-cells`,children:(0,Z.jsx)(qt,{renderCell:s,getVisibleCells:o,cacheToken:a})})});Su.displayName=`PivotLayer`;var Cu=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=jt(),{visibleTables:a}=xu(t),[o,s]=(0,X.useState)(()=>Hl(t));(0,X.useEffect)(()=>(s(Hl(t)),t.getSelection().addListeners({onChange:()=>s(Hl(t))})),[t]);let[c,l]=(0,X.useState)(null),u=q(e=>{let n=i.getCellFromPointer(e.clientX,e.clientY);l(n?Vl(t,w.cellToRange(n)):null)},[i,t]),d=q(()=>l(null),[]),f=K();if(a.length===0)return null;let p=[];for(let e of a){let n=e.getName();if(Eu(e)){let t=e.getRange()?.getCoords();t&&p.push((0,Z.jsx)(bt,{range:t,className:hu,"aria-hidden":`true`,children:(0,Z.jsxs)(`div`,{className:gu,children:[(0,Z.jsx)(`div`,{className:_u,children:n}),(0,Z.jsx)(`div`,{className:vu,children:f(e===o?`pivot.empty.hintInside`:`pivot.empty.hintOutside`)}),(0,Z.jsx)(Du,{})]})},`empty-${n}`))}let r=e===c,i=e===o,a=r||i?Ul(e.getStyle(),t)??`var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0;zl(e).forEach((e,t)=>{p.push((0,Z.jsx)(at,{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)(Yt,{...r,onMouseMove:u,onMouseLeave:d,className:n??`sxl-pivot-frame`,children:p})});Cu.displayName=`PivotFrameLayer`;var wu={transactional:!1,ignoreModelChange:!0},Tu=Object.freeze([]),Eu=e=>e.getRowFields().length===0&&e.getColumnFields().length===0&&e.getPageFields().length===0&&e.getDataFields().length===0,Du=()=>(0,Z.jsxs)(`svg`,{className:yu,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:bu}),[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:bu},`${e}-${t}`)))]}),(0,Z.jsx)(`circle`,{cx:58,cy:56,r:18,className:bu,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:bu}),(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`})]}),Ou={side:`r`,align:`start`},ku=e=>{let{name:t,sheet:n,hovered:r,rangeOf:i,contains:a,select:o,render:s}=e,c=se().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)(St,{name:t,hovered:d,group:!1,hold:l,openDelay:0,placement:Ou,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})})})},Au=(e,t,n)=>(0,Z.jsx)(We,{render:e===void 0?t:e,props:n}),ju={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))`},Mu={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,padding:0,border:`none`,background:`transparent`,color:`inherit`,cursor:`pointer`},Nu={display:`block`,width:`100%`,padding:`4px 12px`,border:`none`,background:`transparent`,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,whiteSpace:`nowrap`},Pu={...Nu,opacity:.5,cursor:`default`},Fu={placement:`bottom-end`,offsets:{mainAxis:2}},Iu=e=>{let{target:t,commandKeys:n,color:r,iconKey:i,menuName:a,floatProps:o,setHeld:s}=e,c=Ae.useCommands([...n]),l=c[0],u=q(e=>{let{closeFloat:r}=e;return Me({...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()?Pu:Nu,disabled:e.disabled(),onClick:()=>{r?.(),e.execute(t)},children:e.getLabel()},n[i]):null)})},[c,t]),[d,f]=(0,X.useState)(null),p=ze({label:a,anchor:d,renderFloatPanel:de,propsPopper:Fu,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:{...ju,...o.style},children:[(0,Z.jsx)(`button`,{type:`button`,title:m,"aria-label":m,style:{...Mu,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:{...Mu,width:16},onClick:()=>{p.isOpen?p.reference.close(0):p.reference.open(0)},children:(0,Z.jsx)(M,{iconKey:`ExpandMore`,size:14})}),p.component]})},Lu=(e,t)=>zl(e).some(e=>w.isCellWithinRange(t,e)),Ru=e=>{e.getRange().select()},zu=(0,X.memo)(e=>{let{sheet:t,renderToolbar:n,className:r,...i}=e,a=jt(),[o,s]=(0,X.useState)(null),c=q(e=>{let n=a.getCellFromPointer(e.clientX,e.clientY);s(n?Vl(t,Bu(n)):null)},[a,t]),l=q(()=>s(null),[]);return(0,Z.jsx)(Yt,{onMouseMove:c,onMouseLeave:l,className:r??`sxl-pivot-toolbar`,...i,children:(0,Z.jsx)(ku,{name:`pivot-toolbar`,sheet:t,hovered:o,rangeOf:Bl,contains:Lu,select:Ru,render:(e,t)=>Au(n,Hu,{...t,pivot:e})})})});zu.displayName=`PivotToolbarLayer`;var Bu=e=>({rowStart:e.rowIndex,colStart:e.colIndex,rowEnd:e.rowIndex,colEnd:e.colIndex}),Vu=[`editPivotTable`,`refreshPivotTable`,`deletePivotTable`],Hu=e=>(0,Z.jsx)(Iu,{target:e.pivot,commandKeys:Vu,color:Wl(e.pivot,e.sheet),iconKey:`Pivot`,menuName:`pivot-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),Uu=(0,X.memo)(e=>{let{sheet:t,sheetView:n,getVisibleCells:r,bordersCache:i,className:a,...o}=e,c=jt();s(t,[`onStyleChange`,`onLayoutChange`]),s(n,[`onZoomScaleChange`]);let[,l]=(0,X.useReducer)(e=>e+1,0),u=c.getVisibleRange();mr(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()},Gu);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()===vn.Type.None,g=jl(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?Wu:null}:null,[y,_,v]),S=(0,X.useMemo)(()=>b?{color:_,dashArray:v?Wu:null}:null,[b,_,v]),{renderLayer:C}=ii({mode:`normal`,getVisibleCells:r,getBorderAt:Pl,getMergeAt:Fl,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)(Yt,{...o,className:Q(a,`sxl-gridlines`),children:(0,Z.jsx)(bt,{fill:!0,className:`sxl-gridlines-box`,style:{pointerEvents:`none`},children:T})}):null});Uu.displayName=`SheetGridLineLayer`;var Wu=Object.freeze([1,1]),Gu={transactional:!1,anchor:Jn.Type.Absolute},Ku=(0,X.lazy)(async()=>({default:(await d(async()=>{let{PictureEditor:e}=await import(`./B3c6NBI22E5SZWG-.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=jt(),[c,l]=(0,X.useState)(()=>n.getPicture()),u=(0,X.useMemo)(()=>{let e=n.getStyles();return e.getNormal().getFill().getType()===vn.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)(Yt,{...a,className:Q(r,`sxl-background`),children:(0,Z.jsx)(bt,{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)(Ku,{picture:c,tile:!0,offsetX:f?.x??0,offsetY:f?.y??0})}):null})})}));qu.displayName=`SheetBackgroundLayer`;var Ju=e=>e.getSelectedRuns().map(e=>`${e.min}-${e.max}:${e.value?`A`:`s`}`).join(`|`),Yu=(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)(Ju(t));return o(t.getWorksheet()?.getSelection(),{onChange:()=>{let e=Ju(t);e!==u.current&&(u.current=e,c())}}),(0,Z.jsx)(rt,{...a,className:Q(i,t.getAxis()===`row`?`sxl-headers sxl-axis-row`:`sxl-headers sxl-axis-column`),renderCell:n,cacheToken:l})});Yu.displayName=`SheetHeaderCellLayer`;var Xu=(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}},Zu=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,renderButton:i=ca,laneGap:a=1,bracketGap:s=0,className:c,...l}=e,u=K(),d=t.getOutline(),[f,p]=(0,X.useReducer)(e=>e+1,0);o(d,{onOutlineChange:()=>p()});let m=jt(),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=ea(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(Qu/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:Qu,height:Qu,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]=fe(`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=Xu(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=Xu(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)(We,{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)(Yt,{...l,className:c??`sxl-outline`,children:[(0,Z.jsx)(qt,{className:`sxl-outline-dots`,style:{pointerEvents:`none`},renderCell:O,hiddenCellAt:D,cacheToken:k}),(0,Z.jsxs)(bt,{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]})]})});Zu.displayName=`SheetOutlineLayer`;var Qu=3,$u={ignoreModelChange:!0},ed=(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=jt(),[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=(0,X.useRef)(null),A=ln(r,x,i),j=A.rotation,{horizontal:M,vertical:N}=A.flip,P=(0,X.useMemo)(()=>({horizontal:M,vertical:N}),[M,N]);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)},$u),(0,X.useEffect)(()=>{let e=D.current;if(e)return a(e),()=>{s(e)}},[]);let F=_?.pointerEvents??`auto`,I=x.getZoom()||1,L=(0,X.useMemo)(()=>(0,Z.jsx)(We,{render:y,props:{movable:r,zoom:I,flip:P,disabled:v,isDragging:h,style:{position:`relative`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:F},onHide:c,onShow:l,onDragZone:e=>{O.current=e},onTap:e=>{k.current=e},adornmentHost:d,gesture:f}}),[x,r,I,P,v,h,F,d,f]),R=u([D,t]);return(0,Z.jsx)(`div`,{className:`sxl-movable`,tabIndex:0,ref:R,style:{display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,position:`absolute`,maxWidth:`auto`,maxHeight:`auto`,minWidth:`auto`,minHeight:`auto`,left:A.left,top:A.top,width:A.width,height:A.height,transform:j?`rotate(${j}deg)`:void 0,transformOrigin:`center`,..._,pointerEvents:`none`},onPointerDownCapture:e=>{let t=e.nativeEvent;if(t.pointerType!==`touch`||r.isSelected())return;e.stopPropagation();let n=Qt(r,e.target,e.currentTarget),i=!!e.target.closest?.(`textarea, input, [contenteditable]:not([contenteditable="false"])`),a=e.currentTarget,o=a.ownerDocument,s=t.pointerId,c=x.getScrollTopLeft(),l=e=>{if(e.pointerId!==s)return;d();let r=x.getScrollTopLeft();Math.abs(e.clientX-t.clientX)>10||Math.abs(e.clientY-t.clientY)>10||r.left!==c.left||r.top!==c.top||k.current?.(e)||(n.isSelected()?Promise.resolve():n.select({autoFocus:!i})).then(()=>{i||a.focus()})},u=e=>{e.pointerId===s&&d()},d=()=>{o.removeEventListener(`pointerup`,l),o.removeEventListener(`pointercancel`,u)};o.addEventListener(`pointerup`,l),o.addEventListener(`pointercancel`,u)},onPointerDown:async e=>{let t=e.shiftKey||e.ctrlKey,n=Qt(r,e.target,e.currentTarget),i=n.isSelected(),a=e.currentTarget,o=e.nativeEvent;if(t&&i)n.unselect();else{let r=O.current?.(e.nativeEvent)??!0,s=!!e.target.closest?.(`textarea, input, [contenteditable]:not([contenteditable="false"])`);await(async()=>{i&&!t||await n.select({addToSelection:t,autoFocus:!s})})(),r&&!s&&g(o),s||a.focus()}},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:L})})),td=(0,X.memo)(({movables:e,width:t,height:n})=>{let r=jt(),[i]=ut(un,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})});td.displayName=`ConnectionSites`;var nd=(e,t)=>((t?Math.round(e/t)*t:e)%360+360)%360,rd=`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`,id=(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:rd},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`})})})});id.displayName=`RotateHandle`;var ad=`_movable-area_2t5k8_14`,od=e=>typeof e.getContent().acceptRotation==`function`,sd=e=>{let t=0;for(let n=e.getParent();n;n=n.getParent())t++;return t},cd=()=>{},ld=`1px 1px 2px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.15))`,ud={bounds:{x:0,y:0,width:0,height:0}},dd={side:`b`,align:`end`},fd=Math.sin(Math.PI/8),pd=(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=jt(),x=xe()===`touch`,S=b.getPaneBounds(),T=b.getVisibleRange(),E=`${T.rowStart}:${T.colStart}:${T.rowEnd}:${T.colEnd}`,D=q(_,[_]),O=q(a,[a]),k=q(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(nn(e))),L=(0,X.useRef)(new Map),R=(0,X.useRef)(new Map),z=(0,X.useRef)([]),ee=(0,X.useRef)(null),[B,V]=ut(`movable-drag`,null),H=(0,X.useRef)(null),U=(0,X.useRef)(``),W=(0,X.useCallback)(e=>{H.current=e,V(e)},[V]),te=(0,X.useCallback)(e=>{let t=z.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},[]),[G]=ut(`movable-hover`,null),ne=(0,X.useRef)(null);ne.current=G;let re=()=>{let e=b.getVisibleRange(),t=n.getItems({address:e,ignoreHidden:!0,drawn:!0}),i=r.getItems().slice();ne.current&&i.push(ne.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},[K,ie]=(0,X.useState)(()=>new Map),ae=(0,X.useCallback)((e,t)=>{ie(n=>{if((n.get(e)??null)===t)return n;let r=new Map(n);return t?r.set(e,t):r.delete(e),r})},[]),se=(0,X.useRef)(new Map),ce=(0,X.useRef)({onRequestFocus:e=>(ge(e),Promise.resolve(!1))}),le=(0,X.useRef)(null),[ue,de]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{de()},[n]),o(n,{onCollectionChange:()=>{let e=re(),t=se.current;t.forEach(e=>{e()}),t.clear();let n=ce.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)}de()},onInvalidated:()=>{de()}}),o(r,{onChange(e){e.isEmpty()&&le.current&&p.hasFocus(le.current,!0)&&(b.focus(),O?.()),de()}});let[fe,pe]=(0,X.useState)(!1),me=(0,X.useRef)(null),he=(0,X.useRef)(null),ge=q(async(e=null)=>{if(e||=r.getActive(),!e)return O?.(),!1;let t=F.current.get(e)??F.current.get(nn(e));return t?(await p.whenFocus(t),t.focus(),he.current=t,me.current=null,!0):(me.current=e,!1)},[r]);(0,X.useEffect)(()=>{D?.()},[]);let _e=q((e,t)=>{U.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);z.current=Array.from(r)},[b,r]),ve=(0,X.useCallback)(()=>{let e=H.current,t=L.current,r=R.current;if(L.current=new Map,R.current=new Map,z.current=[],!e||t.size===0)return void W(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!==nd(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,U.current):a[0].getRange().doBatch(()=>{for(let e of a)i(e)},U.current)}catch(e){console.warn(e)}W(null)}else W(null)},[n,W]),ye=(0,X.useCallback)(()=>{ee.current?.(),ee.current=null,L.current=new Map,R.current=new Map,z.current=[],W(null)},[W]),be=q(()=>{ee.current?.(),ee.current=null,j(!1),N(!1),L.current.size!==0&&ve()},[ve]),Se=q(()=>{j(!1),N(!1),ye()},[ye]),Ce=q((e,t,n)=>{if(c||l||e.button!==0)return;ee.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?be():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(),_e(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}),W(te(p))},m=e=>{e.pointerId===i&&(o?be():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,ee.current===g&&(ee.current=null)};r.addEventListener(`pointermove`,p),r.addEventListener(`pointerup`,m),r.addEventListener(`pointercancel`,h),ee.current=g},[b,c,l,_e,be,Se,W]),we=(0,X.useRef)(null),Te=q(e=>!c&&!d&&(_e(C(`op.resizeMovable`),e.isSelected()?void 0:[e]),we.current=e,L.current.has(e)),[c,d,_e]),Ee=q((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()]=_}),W(te(c))},[b,W,te]),De=(0,X.useRef)(null),Oe=q((e,t)=>(_e(C(`op.rotateMovable`),t.isSelected()?void 0:[t]),De.current={kind:`rotate`,radius:e,below:t.getFlip().vertical},L.current.size>0),[_e]),ke=q((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(nd(a+e,t?15:void 0)),grip:n})}),W(te(r))},[W,te]),Ae=q((e,t,n)=>!c&&!d&&(_e(t,e.isSelected()?void 0:[e]),we.current=e,!!L.current.has(e)&&(n&&R.current.set(e,n),!0)),[c,d,_e]),je=q((e,t)=>{L.current.has(e)&&(j(!0),W(te({...H.current??{},[e.getId()]:t})))},[W,te]),Me=(0,X.useRef)(new WeakMap),Pe=q(e=>{let t=Me.current.get(e);return t||(t={start:(t,n)=>Ae(e,t,n),preview:t=>je(e,t),finish:be,cancel:Se},Me.current.set(e,t)),t},[Ae,je,be,Se]),Fe=(0,X.useMemo)(()=>{let e=re();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:Pe(e),directions:d?[]:h,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:be,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e),children:od(e)?(0,Z.jsx)(id,{isDragging:m,below:r.vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:be,onCancel:Se}):null},a=an(e.getContent().getType());t.push((0,Z.jsx)(cn,{movable:e,preview:n,onHost:ae,children:a?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(rn,{...i}),children:(0,Z.jsx)(a,{...i})}):(0,Z.jsx)(rn,{...i})},`adornment-${e.getId()}`))},_=e=>{let n=B?B[e.getId()]??null:null;t.push((0,Z.jsx)(cn,{movable:e,preview:n,onHost:cd,children:(0,Z.jsx)(rn,{context:!0,directions:d?[]:h,rotation:n?.rotation??(e.getRotation()||0),isDragging:m,onResizeStart:()=>Te(e),onResize:Ee,onResizeEnd:be,onResizeCancel:Se,onMoveStart:l?void 0:t=>Ce(t,e,[e]),children:od(e)?(0,Z.jsx)(id,{isDragging:m,below:(n?.flip??e.getFlip()).vertical,onStart:t=>Oe(t,e),onRotate:ke,onEnd:be,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)=>sd(e)-sd(t));for(let e of r)_(e);for(let e of n)g(e)}}let v={tabIndex:a,movable:n,preview:u,onRefLoad:e=>{me.current===n&&(e.focus(),he.current=e,me.current=null),F.current.set(n,e),r.rendered=!0,n.isSelected()&&de()},onRefUnload:e=>{F.current.delete(n),r.rendered=!1,n.isSelected()&&de()},onUnFocus:O,onHide:e=>{r.onHide=e},onShow:e=>{r.onShow=e},adornmentHost:p?K.get(n)??null:null,gesture:p?Pe(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)&&on(n.getContent().getType())?ld:void 0}};return(0,Z.jsx)(ed,{...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),de())},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}},[ue,b,E,B,G,i,c,l,d,h,A,M,K,ae]),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;fe&&e&&he.current!==e&&!e.contains(e.ownerDocument.activeElement)&&ge()},[Re]);let ze=Ne(t,()=>({isMovableLayer:()=>!0,focusMovable:ge,focus:()=>{ge()}}),[r]),[Be,Ve]=(0,X.useState)(null),He=(0,X.useCallback)(e=>{e&&Ve(e)},[]),Ue=null,We=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;Ue={kind:e?.kind??`move`,movable:i,bounds:a.bounds??o,rotation:a.rotation??nd(i.getRotation()||0)},We=((e,t,n,r)=>{let i=n.toPaneBounds(e.bounds);if(!t)return{anchor:{bounds:i},placement:dd};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>fd?`start`:e<-fd?`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)}}})(Ue,e,b,x)}}let Ge=u([ze,Ie,He]);return Fe?(0,Z.jsxs)(Yt,{className:Q(f,`sxl-movable-area`),onPointerDown:e=>{e.button!==0&&e.button!==2||r.isEmpty()||(r.clear(),O?.())},children:[(0,Z.jsx)(bt,{fill:!0,className:ad,style:{pointerEvents:`none`,...m,overflow:`hidden`,willChange:`transform`},ref:Ge,...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:le,style:{position:`absolute`,pointerEvents:`auto`},onFocus:e=>{k?.(),pe(!0)},onBlur:e=>{pe(!1)},onKeyDownCapture:e=>{e.isDefaultPrevented()||e.which===oe.Escape&&L.current.size>0&&(Se(),e.preventDefault(),e.stopPropagation())},onPointerDown:e=>{e.stopPropagation()},onDoubleClick:e=>{e.stopPropagation()},children:(0,Z.jsxs)(sn.Provider,{value:K,children:[Fe.frames,Fe.adornments,(0,Z.jsx)(td,{movables:n,width:S.width,height:S.height})]})})})}),v&&(0,Z.jsx)(Vt,{name:`movable-gesture`,active:Ue!==null,anchor:We?.anchor??ud,placement:We?.placement,offset:x?36:Ue?.kind===`move`?4:void 0,alignOffset:x||Ue?.kind!==`move`?void 0:2,children:Ue?v(Ue):null})]}):null})),md=e=>{let{movable:t}=e;if(!t)return(0,Z.jsx)(Z.Fragment,{});let n=$t(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)(fn,{...e})},t.getId())},hd=`workbookToolbars`,gd=new Map;function _d(e){let t=e.key.toLowerCase(),n=gd.get(t)??0;n===0&&Ae.DefaultCommandButtonRegistry.register(e,!0),gd.set(t,n+1);let r=!1;return()=>{if(r)return;r=!0;let e=(gd.get(t)??1)-1;e>0?gd.set(t,e):(gd.delete(t),Ae.DefaultCommandButtonRegistry.get(t)&&Ae.DefaultCommandButtonRegistry.unregister(t))}}var vd=e=>`${e}Toolbar`;function yd(e,t){return{key:vd(e),contributions:{[hd]:{order:1}},getLabel:()=>t,members:[`moveForwardOptions`,`moveBackwardOptions`,`-`,`drawAlignOptions`,`drawGroupOptions`,`drawFlipOptions`,`-`,`drawSizingOptions`,`toggleLockAspectRatio`,`-`,`formatMovable`]}}var bd=!1;function xd(){if(bd)return;bd=!0;let e=Ae.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 Sd(e){let{getTitle:t,getIcon:n,key:r}=e;return{...e,getTitle:()=>{let n=(e=>{let t=Ae.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=Ae.DefaultCommandRegistry.findByKey(e)?.def;return typeof t?.icon==`string`?t.icon:void 0})(r);return n?n.call(e,t):t}}}var Cd=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=Sd(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}},wd={FormatCells:`formatCells`,Comments:`comments`,TableDetails:`tableDetails`,ConditionalFormat:`conditionalFormatDetails`,DataValidation:`dataValidationDetails`,Protection:`manageProtection`,Names:`managedNames`,ExternalLinks:`externalLinks`,PivotTable:`pivotTableFields`,CellControl:`formatCellControl`,FormatMovable:`formatMovable`},Td={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`},Ed=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=K(),[,d]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!c)return;let e=c.getView().addListeners({onMovableSelectionChange:d}),t=tn(d);return()=>{e(),t()}},[c]);let f=c?.getView().getMovableSelection().getActive()??null,p=f?.getContent(),m=p?.getType(),h=m?en(m):void 0,g;if((0,X.useEffect)(()=>{m&&!h&&Zt(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:Td.MovablePaneEmpty,children:u(`movable.pane.none`,{kind:p.getTypeDescription()})})}else g=(0,Z.jsx)(`div`,{className:Td.MovablePaneEmpty,children:u(`movable.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-movable-pane`,o,Td.MovablePane),...s,children:[p?(0,Z.jsx)(`div`,{className:Td.MovablePaneKind,children:p.getTypeDescription()}):null,g]})};function Dd(){Cd.getRegisteredTaskPane(wd.FormatMovable)||Cd.registerTaskPane({key:wd.FormatMovable,component:Ed})}var Od=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}},kd=(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},Ad=e=>t=>{if(!t.getContent().acceptFlip)return;t.setFlip({[e]:!t.getFlip()[e]});let n=t.getRotation()%360;n&&t.setRotation((360-n)%360)},jd=e=>{let t=e.getContent();return!0===t?.isIGroup?t:null},Md=(e,t)=>n=>{let r=n.getBounds();r&&n.setBounds({x:r.x+e,y:r.y+t})},Nd=(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})},Pd=e=>t=>{t.setRotation(t.getRotation()+e)};function Fd(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=>jd(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?.()===Jn.Type.TwoCell}),e.updateCommand(`formatAnchorTypeOneCell`,{state:i?.getAnchorType?.()===Jn.Type.OneCell}),e.updateCommand(`formatAnchorTypeAbsolute`,{state:i?.getAnchorType?.()===Jn.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(wd.FormatMovable,{state:r.taskPaneArea?.getActive()===wd.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(Jn.Type.TwoCell)),o(`formatAnchorTypeOneCell`,C(`op.anchor`),e=>e.setAnchorType(Jn.Type.OneCell)),o(`formatAnchorTypeAbsolute`,C(`op.anchor`),e=>e.setAnchorType(Jn.Type.Absolute)),o(`formatDrawAlignLeft`,C(`op.alignLeft`),(e,t)=>e.setBounds({x:t.x}),Od),o(`formatDrawAlignCenter`,C(`op.alignCenter`),(e,t)=>e.setBounds({x:(t.width-e.getBounds().width)/2+t.x}),Od),o(`formatDrawAlignRight`,C(`op.alignRight`),(e,t)=>e.setBounds({x:t.width-e.getBounds().width+t.x}),Od),o(`formatDrawAlignTop`,C(`op.alignTop`),(e,t)=>e.setBounds({y:t.y}),Od),o(`formatDrawAlignMiddle`,C(`op.alignMiddle`),(e,t)=>e.setBounds({y:(t.height-e.getBounds().height)/2+t.y}),Od),o(`formatDrawAlignBottom`,C(`op.alignBottom`),(e,t)=>e.setBounds({y:t.height-e.getBounds().height+t.y}),Od),o(`formatDrawDistributeHorz`,C(`op.distributeHorizontally`),(e,t)=>e.setBounds(t.get(e)),e=>kd(e,!0)),o(`formatDrawDistributeVert`,C(`op.distributeVertically`),(e,t)=>e.setBounds(t.get(e)),e=>kd(e,!1)),o(`formatDrawNudgeLeft`,C(`op.nudgeMovable`),Md(-1,0)),o(`formatDrawNudgeRight`,C(`op.nudgeMovable`),Md(1,0)),o(`formatDrawNudgeUp`,C(`op.nudgeMovable`),Md(0,-1)),o(`formatDrawNudgeDown`,C(`op.nudgeMovable`),Md(0,1)),o(`formatDrawNudgeLeftLarge`,C(`op.nudgeMovable`),Md(-10,0)),o(`formatDrawNudgeRightLarge`,C(`op.nudgeMovable`),Md(10,0)),o(`formatDrawNudgeUpLarge`,C(`op.nudgeMovable`),Md(0,-10)),o(`formatDrawNudgeDownLarge`,C(`op.nudgeMovable`),Md(0,10)),o(`formatDrawSizeIncrease`,C(`op.resizeMovable`),Nd(.1,!0)),o(`formatDrawSizeDecrease`,C(`op.resizeMovable`),Nd(.1,!1)),o(`formatDrawRotateLeft`,C(`op.rotateMovable`),Pd(-10)),o(`formatDrawRotateRight`,C(`op.rotateMovable`),Pd(10)),o(`formatDrawFlipHorizontal`,C(`op.flipMovable`),Ad(`horizontal`)),o(`formatDrawFlipVertical`,C(`op.flipMovable`),Ad(`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(jd).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(wd.FormatMovable,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Dd(),r.activateTaskPane?.(wd.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 Id=(0,X.createContext)(void 0),Ld={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:()=>()=>{}},Rd=(e=!1)=>{let t=(0,X.useContext)(Id),[n,r]=(0,X.useReducer)(e=>e+1,0);return(0,X.useEffect)(()=>{if(!e&&t)return t.addListener({onChange:()=>{r()}})},[t]),t||Ld},zd=(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,Td.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:`✕`})})]})}));zd.displayName=`TaskPaneTitle`;var Bd=(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=zd,style:p,className:m,...h}=e,[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),b=q(i,[i]),x=z(),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,Td.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})]})}));Bd.displayName=`TaskPaneFrame`;var Vd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{children:n,title:r,side:i=`right`,taskPanes:a,onSelect:o,selected:s,registry:c=Cd,style:l,iconsOnly:u,className:d,...f}=e,p=z(),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`,Td.TaskPaneStripItem,{"sxl-selected":i}),onClick:()=>o(e),children:[n?(0,Z.jsx)(`span`,{className:Td.TaskPaneStripItemIcon,children:n}):null,(0,Z.jsx)(`span`,{className:Q(Td.TaskPaneStripItemLabel,{[Td.TaskPaneStripItemLabelOpen]:a}),children:(0,Z.jsx)(`span`,{className:Td.TaskPaneStripItemLabelClip,children:(0,Z.jsx)(`span`,{className:Td.TaskPaneStripItemLabelText,children:r})})})]},e)}),[a,s,o,c,u,p]),h=Ne(t,()=>({isTaskPaneStrip:()=>!0}),[]),g=(0,X.useMemo)(()=>Q(`sxl-taskpane-strip`,d,Td.TaskPaneStrip),[d]);return(0,Z.jsx)(`div`,{ref:h,className:g,style:l,...f,children:m})}));Vd.displayName=`TaskPaneStrip`;var Hd=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n=``,registry:r=Cd,model:i,onOpen:a,onClose:o,wrapperPane:s,propsPane:c,wrapperFrame:l,propsFrame:u,componentTitle:d,componentStrip:f=Vd,alwaysShowStrip:p,side:m=`right`,style:h}=e,g=m!==`right`,_=q(a,[a]),v=q(o,[o]),[y,b]=(0,X.useState)(null),x=(0,X.useRef)(null),[S,C]=(0,X.useState)([]),[w,T]=(0,X.useState)({}),E=q((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=q(()=>{let e=Array.from(O.current);for(let t of e)try{t.onChange?.()}catch(e){console.error(`Error in TaskPaneArea listener:`,e)}},[]),A=q(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=q(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=q(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)(Bd,{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=Ne(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:Td.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:Td.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(Td.TaskPaneAreaFrameHost,!t&&Td.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})}),z=g?P:R,ee=g?R:P;return(0,Z.jsxs)(`div`,{ref:N,className:Q(`sxl-taskpane-area`,n,Td.TaskPaneArea),style:h,children:[z,ee]})}));Hd.displayName=`TaskPaneArea`;var Ud=e=>{let{model:t,entryKey:n,args:r,frame:i,ref:a,className:o,...s}=e,c=l(),u=K(),[,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=Kr(d);return()=>{e(),t(),n()}},[c]);let f=c?(e=>{let t=e.getSelection().getCell(),n=t.getControl();return n?{cell:t,entry:Wr(n.getType())??null,control:n}:{cell:t,entry:Gr(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:Td.MovablePaneEmpty,children:u(`cellControl.pane.none`)})}else p=(0,Z.jsx)(`div`,{className:Td.MovablePaneEmpty,children:u(`cellControl.pane.empty`)});return(0,Z.jsxs)(`div`,{ref:a,className:Q(`sxl-cell-control-pane`,o,Td.MovablePane),...s,children:[f?.control?(0,Z.jsx)(`div`,{className:Td.MovablePaneKind,children:f.control.getType()}):null,p]})};function Wd(){Cd.getRegisteredTaskPane(wd.CellControl)||Cd.registerTaskPane({key:wd.CellControl,component:Ud})}var Gd=P.isEditable,Kd=[`copy`,`cut`,`paste`,`selectAll`,`undo`,`redo`];function qd(e){let{clipboard:t}=e,n=new Set(e.keys??Kd);return(e,r)=>{if(!n.has(e)||!Gd(r))return;let i=r;switch(e){case`copy`:return{callback:()=>async function(e,t){let n=Zd(e);n&&await t.writeText(n)}(i,t.getClipboard()),disabledReasons:Yd(i)?[]:[C(`reason.noSelection`)]};case`cut`:return{callback:()=>async function(e,t){let n=Zd(e);n&&(await t.writeText(n),function(e){if(!(typeof document<`u`&&document.execCommand(`delete`))&&Jd(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:Yd(i)?[]:[C(`reason.noSelection`)]};case`paste`:return{callback:()=>async function(e,t){let n=await t.readText();n&&function(e,t){if(Jd(e)){let n=e.selectionStart??e.value.length;P.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){Jd(e)?e.select():typeof document<`u`&&document.execCommand(`selectAll`)}(i),disabledReasons:Xd(i)?[]:[C(`reason.nothingToSelect`)]};case`undo`:return{callback:()=>Qd(`undo`)};case`redo`:return{callback:()=>Qd(`redo`)};default:return}}}function Jd(e){let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`}function Yd(e){if(Jd(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 Xd(e){return Jd(e)?e.value.length>0:(e.textContent??``).length>0}function Zd(e){return Jd(e)?e.value.substring(e.selectionStart??0,e.selectionEnd??0):(typeof window<`u`?window.getSelection()?.toString():``)??``}function Qd(e){typeof document<`u`&&document.execCommand(e)}var{useCommandResolver:$d}=Ae,ef=()=>{let e=Fe(),t=(0,X.useRef)(e);t.current=e;let n=(0,X.useMemo)(()=>qd({clipboard:{getClipboard:()=>t.current.getClipboard()}}),[]),r=$d();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};ef.displayName=`InputClipboardInjector`;var tf=(0,X.createContext)(null);function nf(){return(0,X.useContext)(tf)}var{CommandScopeContext:rf,CommandChainContext:af,useCommandScope:of,LayerActivation:sf}=Ae,cf=({pane:e,children:t})=>{let n=of(),r=e.getAnchor(),i=(0,X.useMemo)(()=>n?new sf(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 Ae.attachWhenReady({get current(){return e.getElement()??null}},e=>i.getBase().attachElement(e,i))},[e,i]),i?(0,Z.jsx)(af.Provider,{value:i,children:(0,Z.jsx)(rf.Provider,{value:i.getBase(),children:t})}):t};cf.displayName=`PaneScopeProvider`;var lf={"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`},uf=[{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:df}=Ae,ff=!1;function pf(){ff||(ff=!0,df.registerFromManifest(`@sheetxl/react`,import.meta.url,{messages:lf,catalogs:uf}))}pf();var{CommandScope:mf,DefaultCommandRegistry:hf,FocusActivation:gf,CommandRegistryContext:_f,CommandScopeContext:vf,CommandAnchorProvider:yf,CommandFallbackProvider:bf,useCommandScope:xf}=Ae,Sf=({initialAnchor:e,children:t})=>xf()?(0,Z.jsx)(Z.Fragment,{children:t}):(0,Z.jsx)(Cf,{initialAnchor:e,children:t});Sf.displayName=`CommandRootProvider`;var Cf=({initialAnchor:e,children:t})=>{let n=(0,X.useRef)(e),{root:r,registry:i,studioTracker:a}=(0,X.useMemo)(()=>{let e=hf,t=new mf(`app`,null,{registry:e});return{root:t,registry:e,studioTracker:new gf(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)(_f.Provider,{value:i,children:(0,Z.jsx)(tf.Provider,{value:a,children:(0,Z.jsx)(vf.Provider,{value:r,children:(0,Z.jsxs)(yf,{tracker:a,keyBindings:`synthetic`,debounce:100,children:[(0,Z.jsx)(ef,{}),(0,Z.jsxs)(bf,{children:[o.map((e,t)=>(0,Z.jsx)(e,{scope:r,data:void 0},t)),t]})]})})})})};Cf.displayName=`CommandRootProviderOwn`;var{CommandScopeProvider:wf}=Ae,Tf=(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=en(n);return!r&&$t(n)?(Zt(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=tn(e);return()=>{n(),r()}},[t]);let s=(0,X.useMemo)(()=>r?r.toolbar??yd(r.type,r.label):null,[r]);(0,X.useEffect)(()=>{if(s)return xd(),_d(s)},[s]);let c=U(),l=Rd(!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)(wf,{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});Tf.displayName=`MovableKindScope`;var{CommandScopeProvider:Ef}=Ae,Df=(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=U(),l=se(),u=K(),d=Rd(!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=ft().zIndex;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ef,{spec:{scopeName:{key:`layer:movable`,name:`movable`},contributor:{dynamic:Fd},data:f},order:p,children:(0,Z.jsx)(pd,{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?.()??Jn.Type.TwoCell;return o===Jn.Type.Absolute?u(`movable.tip.position`,{x:Math.round(i.x),y:Math.round(i.y)}):o===Jn.Type.OneCell?n.getRangeAtBounds({...i,width:0,height:0}).getAddress():n.getRangeAtBounds(i).getAddress()},...i,onFocus:()=>{i?.onFocus?.()}})}),(0,Z.jsx)(Tf,{sheet:n,order:p})]})})),Of=e=>e.getRange().getCoords(),kf=(e,t)=>w.isCellWithinRange(t,Of(e)),Af=e=>{e.select()},jf=e=>{let{sheet:t,hovered:n,renderToolbar:r}=e;return(0,Z.jsx)(ku,{name:`table-toolbar`,sheet:t,hovered:n,rangeOf:Of,contains:kf,select:Af,render:(e,t)=>Au(r,Nf,{...t,table:e})})};jf.displayName=`TableToolbarFloat`;var Mf=[`editTable`,`convertTableToRange`,`deleteTable`],Nf=e=>(0,Z.jsx)(Iu,{target:e.table,commandKeys:Mf,color:Wl(e.table,e.sheet),iconKey:`Table`,menuName:`table-toolbar-menu`,floatProps:e.floatProps,setHeld:e.setHeld}),Pf=`_dropdown_1bnz9_13`,Ff=`white`,If=`black`,Lf=({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`})})})},Rf=(e,t)=>({rowStart:e.rowStart,colStart:e.colStart,rowEnd:Math.max(e.rowStart,t.rowIndex),colEnd:Math.max(e.colStart,t.colIndex)}),zf=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`}],Bf=`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='${If}' fill='${Ff}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`,Vf=`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='${If}' fill='${Ff}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Hf=`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='${If}' fill='${Ff}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Uf=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,renderToolbar:r,className:i,...a}=e,s=jt(),{visibleTables:c,cacheToken:l}=ac(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=q(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=q(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=q(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=q(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=q(()=>{b.current||h(null)},[]),D=se().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=K(),A=(0,X.useRef)(null);A.current=O;let[j]=Ae.useCommands([`insertFunctionDialog`]),N=Pc({sheet:n,cell:null,anchor:null,resolveItems:q(async()=>zf(k),[k]),getCurrentText:q(()=>{let e=A.current?.column.getTotalsRowFormula();return zf(k).find(t=>t.totals===e)?.text??null},[k]),onChoose:q(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=Bt(!0),I=O?`${O.cell.rowIndex},${O.cell.colIndex}`:null,L=(0,X.useMemo)(()=>({}),[l,I]),R=q((e,t)=>{let n=A.current;return!n||t&&!w.isCellWithinRange(n.cell,t)?[]:[{cell:n.cell,value:n}]},[]),z=q(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:Pf,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)},[]),ee=(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:Vf},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:Bf},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:Hf},onMouseDown:x},`table-select-${t.getName()}`)),e.push((0,Z.jsx)(at,{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]),B=s.getVisibleRange(),V=(c??[]).map(e=>{if(e.isDeleted()||e.isHiddenDecorations())return null;let t=e.getRange().getCoords();return w.isCellWithinRange({rowIndex:t.rowEnd,colIndex:t.colEnd},B)?(0,Z.jsx)(dt,{className:`sxl-table-resize-handle`,range:e===v&&g?g:t,anchor:`br`,size:12,background:Wl(e,n),renderHandle:Lf,onDragStart:()=>{b.current=!0,y(e)},onDragMove:(e,n)=>_(Rf(t,n)),onDragEnd:(n,r)=>{b.current=!1,y(null),_(null);let i=Rf(t,r);if(i.rowEnd!==t.rowEnd||i.colEnd!==t.colEnd)try{e.resize(i)}catch{}}},`table-resize-${e.getName()}`):null}),H=v&&g?(0,Z.jsx)(at,{className:`sxl-table-resize-preview`,range:g,stroke:Wl(v,n),alignWidth:1}):null;return(0,Z.jsxs)(Yt,{onMouseMove:T,onMouseLeave:E,className:Q(i,`sxl-tables`),children:[ee,H,V,(0,Z.jsx)(jf,{sheet:n,hovered:m&&!m.isHiddenDecorations()?m:null,renderToolbar:r}),(0,Z.jsx)(qt,{className:`sxl-table-totals-dropdown`,renderCell:z,getVisibleCells:R,cacheToken:L}),N.component]})}));function Wf(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 Gf=(0,X.createContext)(null),Kf=()=>(0,X.useContext)(Gf),qf={key:`tableStyleOptions`,showLabel:!0,members:[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`,`tableFilterToggle`]},Jf={key:`tableToolbar`,contributions:{[hd]:{order:1}},members:[`editTable`,`-`,`insertSlicer`,`-`,`dataRemoveDuplicates`,{key:`convertTableToRange`,showLabel:!0},`-`,`tableStyleOptions`,`-`,`formatTableStyle`]},Yf=(e,t)=>e?[t]:[],Xf=[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`];function Zf(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=Yf(!r.isFormatCellsAllowed(),C(`reason.sheetProtected`));for(let t of Xf)e.updateCommand(t,{disabledReasons:a});let c=Yf(!r.isAutoTableAllowed()||!r.isSortAllowed(),C(`reason.sheetProtected`));if(e.updateCommand(`tableFilterRefresh`,{disabledReasons:c}),e.updateCommand(`tableFilterClear`,{disabledReasons:c}),e.updateCommand(`formatTableStyleClearTableStyle`,{disabledReasons:[...a,...Yf(!t||t.getStyleOptions().name===null,C(`reason.noTableStyle`))]}),t){let n=Yf(!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:Yf(!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(pn({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=_d(qf),t=_d(Jf);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:Qf}=Ae,$f=(0,X.memo)(e=>{let{sheet:t}=e,n=U(),r=Kf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(Qf,{spec:{scopeName:{key:`layer:table`,name:`table`},contributor:{dynamic:Zf},data:i},order:ft().zIndex})});$f.displayName=`SheetTableCommandLayer`;var ep=[{key:`sparklineTypeLine`,type:`line`},{key:`sparklineTypeColumn`,type:`column`},{key:`sparklineTypeWinLoss`,type:`winLoss`}],tp=[{key:`sparklineHighPointToggle`,property:`high`},{key:`sparklineLowPointToggle`,property:`low`},{key:`sparklineNegativePointsToggle`,property:`negative`},{key:`sparklineFirstPointToggle`,property:`first`},{key:`sparklineLastPointToggle`,property:`last`},{key:`sparklineMarkersToggle`,property:`markers`}],np=[{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`}],rp=[{key:`sparklineEmptyCellsGap`,value:`gap`},{key:`sparklineEmptyCellsZero`,value:`zero`},{key:`sparklineEmptyCellsSpan`,value:`span`}],ip=[{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})}],ap={key:`sparklineShowOptions`,showLabel:!0,members:tp.map(e=>e.key)},op={key:`sparklineAxisOptions`,showLabel:!0,members:[`sparklineAxisToggle`,`sparklineRightToLeftToggle`,`-`,`sparklineSameMinToggle`,`sparklineSameMaxToggle`,`-`,...rp.map(e=>e.key),`sparklineShowHiddenToggle`]},sp={key:`sparklineClearOptions`,members:[`sparklineClear`,`sparklineClearGroups`]},cp={key:`sparklineToolbar`,contributions:{[hd]:{order:1}},members:[`sparklineEditData`,`-`,...ep.map(e=>e.key),`-`,`sparklineShowOptions`,`-`,`sparklineAxisOptions`,`-`,`sparklineClearOptions`]};function lp(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=Pn.rangeToString(e.getCoords(),t.getEntireCoords())??`#REF!`;return t===n?r:`${Pn.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:ce.Error})})}};t.notifier.showWindow(`sparklineEdit`,o)},s=()=>{let t=r(),i=t?.getProperties()??{},a=t?.getType()??null;for(let{key:t,type:n}of ep)e.updateCommand(t,{state:a===n});for(let{key:t,property:n}of tp)e.updateCommand(t,{state:!!i[n]});let o=i.displayEmptyCellsAs??`zero`;for(let{key:t,value:n}of rp)e.updateCommand(t,{state:o===n});for(let{key:t,read:n}of ip)e.updateCommand(t,{state:n(i)});for(let{key:t,property:r}of np){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=[...ep.map(e=>e.key),...tp.map(e=>e.key),...rp.map(e=>e.key),...ip.map(e=>e.key),...np.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(pn({transaction:n,notifier:t.notifier,manager:t.manager}));for(let{key:t,type:n}of ep)e.updateCommand(t,{callback:()=>a({type:n})});for(let{key:t,property:n}of tp)e.updateCommand(t,{callback:()=>a({[n]:!r()?.getProperties()[n]||null})});for(let{key:t,value:n}of rp)e.updateCommand(t,{callback:()=>a({displayEmptyCellsAs:n})});for(let{key:t,read:n,write:i}of ip)e.updateCommand(t,{callback:()=>{let e=r();a(i(!(e&&n(e.getProperties()))))}});e.updateCommand(`sparklineClear`,{callback:()=>{n.getSelectedRanges().clear(ir.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 np)e.updateCommand(t,{callback:e=>{e&&a({[n]:e})},context:c});e.updateCommand(`sparklineEditData`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o()})})(),f??=(()=>{let e=_d(ap),t=_d(op),n=_d(sp),r=_d(cp);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:up}=Ae,dp=(0,X.memo)(e=>{let{sheet:t}=e,n=U(),r=Kf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(up,{spec:{scopeName:{key:`layer:sparkline`,name:`sparkline`},contributor:{dynamic:lp},data:i},order:ft().zIndex})});dp.displayName=`SheetSparklineCommandLayer`;var fp={key:`pivotStyleOptions`,showLabel:!0,members:[`pivotRowHeadersToggle`,`pivotColumnHeadersToggle`,`pivotBandedRowsToggle`,`pivotBandedColumnsToggle`]},pp={key:`pivotShowOptions`,showLabel:!0,members:[`pivotDrillIndicatorsToggle`,`pivotFieldHeadersToggle`]},mp={key:`pivotRefreshOptions`,defaultKey:`refreshPivotTable`,showLabel:!0,members:[`refreshPivotTable`,`refreshAll`]},hp={key:`pivotToolbar`,contributions:{[hd]:{order:1}},members:[`editPivotTable`,`-`,`insertSlicer`,`-`,`pivotRefreshOptions`,`-`,`pivotShowOptions`,`-`,`pivotStyleOptions`,`-`,`formatPivotStyle`]},gp=(e,t)=>e?[t]:[],_p=[[`pivotRowHeadersToggle`,`showRowHeaders`],[`pivotColumnHeadersToggle`,`showColumnHeaders`],[`pivotBandedRowsToggle`,`showRowStripes`],[`pivotBandedColumnsToggle`,`showColumnStripes`]];function vp(e,t){let n=t.sheet;if(!n)return()=>{};let r=t.notifier,i=()=>Hl(n),a=e=>{let t=n.getSelection().getCoords()?.cell;return e&&t?Vn(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(pn({transaction:n,notifier:r,manager:t.manager}));for(let[t,n]of _p)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=_d(mp),t=_d(pp),n=_d(fp),r=_d(hp);return()=>{r(),n(),t(),e()}})()):(c?.(),c=null),s=l),s&&(()=>{let t=i(),r=t?.getStyleOptions();for(let[t,n]of _p)e.updateCommand(t,{state:!0===r?.[n]});let a=gp(!n.getProtection().isPivotTablesAllowed(),C(`reason.sheetProtected`));for(let[t]of _p)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:gp(!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:yp}=Ae,bp=(0,X.memo)(e=>{let{sheet:t}=e,n=U(),r=Kf(),i=(0,X.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,Z.jsx)(yp,{spec:{scopeName:{key:`layer:pivot`,name:`pivot`},contributor:{dynamic:vp},data:i},order:ft().zIndex})});bp.displayName=`SheetPivotCommandLayer`;var xp=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,animationTime:r=60,className:i,style:a,...s}=e,c=jt(),[l,u]=(0,X.useState)(null),[d,f]=(0,X.useState)(!1),[p,h]=(0,X.useState)(null),g=(0,X.useRef)(null),_=q(()=>{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 An.Spill,x=ie(d?`color-accent`:`color-primary`),S=`color-mix(in srgb, ${x} 70%, ${ie(`color-base-content`)})`;return(0,Z.jsx)(Yt,{className:Q(i,`sxl-spill-outline`,d&&`sxl-spill-outline-fixed`),children:(0,X.createElement)(at,{...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%, ${ie(`color-base-100`)}) 80%, transparent))`}}})})})),Sp=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:{[bn.Edge.Left]:{style:bn.StrokeStyle.Thin,color:`#9C0006`},[bn.Edge.Top]:{style:bn.StrokeStyle.Thin,color:`#9C0006`},[bn.Edge.Right]:{style:bn.StrokeStyle.Thin,color:`#9C0006`},[bn.Edge.Bottom]:{style:bn.StrokeStyle.Thin,color:`#9C0006`}}}}]),Cp=`#F8696B`,wp=`#FFEB84`,Tp=`#63BE7B`,Ep=`#FCFCFF`,Dp=`#5A8AC6`,Op=`#FFEF9C`,kp=e=>{let t=e.map((t,n)=>n===0?{type:Nn.ColorStopType.Min,color:t}:n===e.length-1?{type:Nn.ColorStopType.Max,color:t}:{type:Nn.ColorStopType.Percentile,value:50,color:t});return{type:Nn.ScaleType.ColorScale,stops:t}},Ap=Object.freeze([kp([Tp,wp,Cp]),kp([Cp,wp,Tp]),kp([Tp,Ep,Cp]),kp([Cp,Ep,Tp]),kp([Dp,Ep,Cp]),kp([Cp,Ep,Dp]),kp([Ep,Cp]),kp([Cp,Ep]),kp([Tp,Ep]),kp([Ep,Tp]),kp([Tp,Op]),kp([Op,Tp])]),jp=Object.freeze([`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`]),Mp=(e,t)=>({type:Nn.ScaleType.DataBar,minPoint:{type:Nn.ColorStopType.AutoMin},maxPoint:{type:Nn.ColorStopType.AutoMax},color:e,...t?{borderColor:e}:{solidFill:!0}}),Np=Object.freeze([...jp.map(e=>Mp(e,!0)),...jp.map(e=>Mp(e,!1))]),Pp=()=>structuredClone(Ap[1]),Fp=()=>structuredClone(Np[0]),Ip=e=>{let t=[];for(let n=0;n<e;n++)t.push({type:Nn.ColorStopType.Percent,value:Math.round(100*n/e)});return t},Lp=()=>({type:Nn.ScaleType.IconSet,iconSet:Dn.IconSet.TrafficLights3,stops:Ip(3)}),Rp=Object.freeze([{key:`directional`,rows:[[Dn.IconSet.Arrows3,Dn.IconSet.ArrowsGray3],[Dn.IconSet.Arrows4,Dn.IconSet.ArrowsGray4],[Dn.IconSet.Arrows5,Dn.IconSet.ArrowsGray5],[Dn.IconSet.Triangles3,null]]},{key:`shapes`,rows:[[Dn.IconSet.Signs3,Dn.IconSet.TrafficLights3_2],[Dn.IconSet.TrafficLights3,Dn.IconSet.TrafficLights4],[Dn.IconSet.RedToBlack4,null]]},{key:`indicators`,rows:[[Dn.IconSet.Symbols3,Dn.IconSet.Symbols3_2],[Dn.IconSet.Flags3,null]]},{key:`ratings`,rows:[[Dn.IconSet.Stars3,Dn.IconSet.Rating4],[Dn.IconSet.Quarters5,Dn.IconSet.Rating5],[Dn.IconSet.Boxes5,null]]}]);Object.freeze({set:Dn.IconSet.NoIcons,id:0});var zp={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)`},Bp=(e,t)=>({iconKey:`cf:${e}`,color:t}),Vp=[`arrowDown`,`arrowRight`,`arrowUp`],Hp=[`arrowDown`,`arrowDownRight`,`arrowUpRight`,`arrowUp`],Up=[`arrowDown`,`arrowDownRight`,`arrowRight`,`arrowUpRight`,`arrowUp`],Wp=[zp.bad,zp.neutral,zp.good],Gp=[zp.bad,zp.lightBad,zp.lightBad,zp.good],Kp=[zp.bad,zp.lightBad,zp.lightBad,zp.lightBad,zp.good],qp=(e,t)=>e.map((e,n)=>Bp(e,t[n])),Jp=(e,t)=>e.map(e=>Bp(e,t)),Yp=(e,t)=>t.map(t=>Bp(e,t)),Xp=[`rating0`,`rating1`,`rating2`,`rating3`,`rating4`],Zp={[Dn.IconSet.Arrows3]:qp(Vp,Wp),[Dn.IconSet.ArrowsGray3]:Jp(Vp,zp.gray),[Dn.IconSet.Flags3]:Yp(`flag`,Wp),[Dn.IconSet.Signs3]:qp([`diamond`,`triangleUp`,`circle`],Wp),[Dn.IconSet.Symbols3]:qp([`circleCross`,`circleExclamation`,`circleCheck`],Wp),[Dn.IconSet.Symbols3_2]:qp([`cross`,`exclamation`,`check`],Wp),[Dn.IconSet.TrafficLights3]:Yp(`circle`,Wp),[Dn.IconSet.TrafficLights3_2]:Yp(`circleRimmed`,Wp),[Dn.IconSet.Triangles3]:qp([`triangleDownSharp`,`dash`,`triangleUpSharp`],Wp),[Dn.IconSet.Stars3]:Jp([`star0`,`star1`,`star2`],zp.gold),[Dn.IconSet.Arrows4]:qp(Hp,Gp),[Dn.IconSet.ArrowsGray4]:Jp(Hp,zp.gray),[Dn.IconSet.Rating4]:Jp(Xp.slice(1),zp.gray),[Dn.IconSet.RedToBlack4]:Yp(`circle`,[zp.black,zp.gray,zp.purple,zp.bad]),[Dn.IconSet.TrafficLights4]:Yp(`circleRimmed`,[zp.black,zp.bad,zp.neutral,zp.good]),[Dn.IconSet.Arrows5]:qp(Up,Kp),[Dn.IconSet.ArrowsGray5]:Jp(Up,zp.gray),[Dn.IconSet.Quarters5]:Jp([`quarters0`,`quarters1`,`quarters2`,`quarters3`,`quarters4`],zp.black),[Dn.IconSet.Rating5]:Jp(Xp,zp.gray),[Dn.IconSet.Boxes5]:Jp([`boxes0`,`boxes1`,`boxes2`,`boxes3`,`boxes4`],zp.black),[Dn.IconSet.NoIcons]:[]},Qp=(e,t)=>Zp[e]?.[t]??null,$p=Object.freeze([]);new Map(Object.keys(zp).map(e=>[zp[e],e])),(()=>{let e=new Set,t=[];for(let n of Rp)for(let r of n.rows)for(let n of r){if(!n)continue;let r=Zp[n]??$p;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 em=`_bar_6li90_16`,tm=`_axis_6li90_23`,nm=(0,X.memo)(e=>{let{sheet:t,margin:n=1,className:r,style:i,...a}=e,o=jt(),{getVisibleDecorations:s,cacheToken:c}=hc(t,`dataBar`),l=(0,X.useMemo)(()=>({}),[c,n]),u=q(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/P.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)(rm,{bar:o,track:l,cellTop:r.top,cellHeight:r.height},a)},[n]);return s(o).length===0?null:(0,Z.jsx)(Yt,{...a,className:Q(r,`sxl-conditional-bars`),children:(0,Z.jsx)(qt,{renderCell:u,getVisibleCells:s,cacheToken:l,style:i})})});nm.displayName=`ConditionalBarLayer`;var rm=({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(em,`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(tm,`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]})},im=`_box_t03y8_41`,am=(0,X.memo)(e=>{let{sheet:t,className:n,style:r,...i}=e,a=jt(),{getVisibleDecorations:o,cacheToken:s}=hc(t,`iconSet`),c=q(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=Qp(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=om[f]??`flex-end`,m=sm[f]??`center bottom`;return(0,Z.jsx)(M,{className:im,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)(Yt,{...i,className:Q(n,`sxl-conditional-icons`),children:(0,Z.jsx)(qt,{renderCell:c,getVisibleCells:o,cacheToken:s,style:r})})});am.displayName=`ConditionalIconsLayer`;var om={[J.VerticalAlignment.Top]:`flex-start`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`flex-end`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},sm={[J.VerticalAlignment.Top]:`center top`,[J.VerticalAlignment.Center]:`center`,[J.VerticalAlignment.Bottom]:`center bottom`,[J.VerticalAlignment.Justify]:`center`,[J.VerticalAlignment.Distributed]:`center`},cm=f(`sparkline:paint`,()=>d(()=>import(`./DknSteOdQ6CdF0RT.js`),__vite__mapDeps([17,18,19]),import.meta.url)),lm=e=>!e.axis&&e.columns.length===0&&e.markers.length===0&&!e.line?.runs.some(e=>e.length>1),um=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 cm.load();return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t(e))}`}),dm=e=>JSON.stringify(e),fm=[],pm={ignoreHidden:!0,reuseContext:!0,features:Object.freeze([Gn.Feature.Sparkline])},mm=(0,X.memo)(e=>{let{sheet:t,darkMode:n=!1,className:r,style:i,...a}=e,s=jt(),[c,l]=(0,X.useReducer)(e=>e+1,0),u=(0,X.useMemo)(()=>({}),[c,n]),d=(0,X.useRef)(new Map),f=q(()=>{d.current.clear(),l()},[]);o(t,{onSparklineGroupsChange:f},{ignoreModelChange:!0});let p=q((e,n)=>{let r=n??e.getVisibleRange();if(!r)return fm;let i=`${r.rowStart}:${r.colStart}:${r.rowEnd}:${r.colEnd}`,a=d.current,o=a.get(i);if(o)return o;let s=fm,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===fm&&(s=[]),s.push({cell:{rowIndex:n.rowIndex,colIndex:n.colIndex},range:a,value:r})},pm),a.set(i,s),s},[t]),m=q(e=>{let{value:r,style:i,zoom:a=1,key:o}=e,s=r;if(!s||!i)return null;let c=1/P.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)(hm,{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)(Yt,{...a,className:Q(r,`sxl-sparklines`),children:(0,Z.jsx)(qt,{renderCell:m,getVisibleCells:p,cacheToken:u,style:i})})});mm.displayName=`SparklineLayer`;var hm=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=>ar.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:lm(e)?``:dm(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=dm(e))=>um.get(t,e))(d,f).then(t=>{e&&m({key:f,url:t})},()=>{e&&m({key:f,url:null})}),()=>{e=!1}},[f]),le(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},gm=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,className:r,style:i,...a}=e,o=jt(),{getVisibleCells:c,cacheToken:l}=_m(t),u=(0,X.useMemo)(()=>({}),[l,n]),d=q(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=1/P.getDevicePixelRatio();return(0,Z.jsx)(pa,{className:`sxl-cell-mark sxl-cell-mark-invalid sxl-cell-mark-invalid-${a.state}`,anchorLocation:_.BottomRight,size:n*r,inset:0,cellWidth:t.width+o,cellHeight:t.height+o,fill:tl[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)(Yt,{...a,className:Q(r,`sxl-validation-marks`),children:(0,Z.jsx)(qt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:i})}):null});gm.displayName=`ValidationIndicatorLayer`;var _m=e=>{let t=jt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=q(()=>{a.current.clear(),r()},[]);o(e,{onDataValidationsChange:s},{ignoreModelChange:!0});let c=t.getVisibleRange();return mr(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()},ym),{getVisibleCells:q((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return vm;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=Qc(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?el:$c),o})(e,i),l=c.length>0?c:vm;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},vm=[],ym={transactional:!1,anchor:Jn.Type.Absolute},bm=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)))),xm=(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 Bs(t.getSelection()),[t]),l=se().getMode()?.key===`edit`,u=q((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)(mt,{...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)(Sm,{sheet:t,editable:n,data:e,floatProps:a,state:o,dropdownWidth:r,onOpenDropdown:i})})});xm.displayName=`ValidationDropdownLayer`;var Sm=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=>bm(r,e),[r]);return Pc({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:Pf,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]})};Sm.displayName=`DropdownButton`;var Cm=`_mark_p3uld_7`,wm=`_unresolved_p3uld_19`,Tm={ignoreHidden:!0,reuseContext:!0},Em=(0,X.memo)(e=>{let{sheet:t,markSize:n=11,inset:r=1,className:i,style:a,...o}=e,s=jt(),{getRegions:c,cacheToken:l}=fc(t,Gn.Feature.Circular),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=q((e,n)=>{let r=c(e,n);if(r.length===0)return Dm;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()})},Tm)}return a.length>0?a:Dm},[t,c]),f=q(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(Cm,!s.isConverged()&&wm),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)(Yt,{...o,className:Q(i,`sxl-circular-indicators`),children:(0,Z.jsx)(qt,{renderCell:f,getVisibleCells:d,cacheToken:u,style:a})})});Em.displayName=`CircularIndicatorLayer`;var Dm=[],Om=`_pending_ldaq4_9`,km=`_sweep_ldaq4_19`,Am=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,barHeight:r=2,className:i,style:a,...o}=e,s=jt(),{getVisibleCells:c,cacheToken:l}=jm(t),u=(0,X.useMemo)(()=>({}),[l,n,r]),d=q(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)(pa,{className:`sxl-cell-mark sxl-cell-mark-error`,anchorLocation:_.TopLeft,fill:ie(`color-warning`),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:Om,style:{left:s,top:c+u-r,width:l,height:r},children:(0,Z.jsx)(`div`,{className:km})},`${a}:pending`)),d},[n,r]);return c(s).length===0?null:(0,Z.jsx)(Yt,{...o,className:Q(i,`sxl-cell-indicators`),children:(0,Z.jsx)(qt,{renderCell:d,getVisibleCells:c,cacheToken:u,style:a})})});Am.displayName=`CellIndicatorLayer`;var jm=e=>{let t=jt(),[n,r]=(0,X.useReducer)(e=>e+1,0),i=(0,X.useMemo)(()=>({}),[n,e]),a=(0,X.useRef)(new Map),s=q(()=>{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 mr(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()},Im),{getVisibleCells:q((t,n)=>{let r=a.current,i=n??t.getVisibleRange();if(!i)return Pm;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=Mm(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})},Fm);let l=c??Pm;return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:i}},Mm=e=>{let t=e.getCalculationStatus(),n=t===Wn.ResultStatus.Pending||t===Wn.ResultStatus.Waiting,r=e.getValue(),i=An.isError(r)?!Nm(r):e.getErrors().length>0;return n||i?{error:i,pending:n}:null},Nm=e=>{let t=e.getCode();return t===An.Code.Busy||t===An.Code.GettingData},Pm=[],Fm={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:[Gn.Feature.Merge,Gn.Feature.CalcError,Gn.Feature.CalcStatus,Gn.Feature.Circular]},Im={transactional:!1,anchor:Jn.Type.Absolute},Lm=new WeakMap,Rm=new WeakMap,zm=0,Bm=new WeakMap,Vm=e=>{for(let t of[Rm.get(e),Bm.get(e)])if(t)for(let e of Array.from(t))e()},Hm=(e,t,n)=>{Lm.set(e,{rowIndex:t.rowIndex,colIndex:t.colIndex,focusRequest:!1===n?.autoFocus?0:++zm}),Vm(e)},Um=e=>{Lm.delete(e)&&Vm(e)},Wm=e=>Lm.get(e)??null,Gm=e=>(Rm.get(e)?.size??0)>0,Km=(e,t)=>{let n=Rm.get(e);return n||(n=new Set,Rm.set(e,n)),n.add(t),()=>{n.delete(t)}},qm=e=>(0,X.useSyncExternalStore)(t=>{let n=Bm.get(e);return n||(n=new Set,Bm.set(e,n)),n.add(t),()=>{n.delete(t)}},()=>Wm(e),()=>null),Jm=e=>(0,X.useSyncExternalStore)(t=>Km(e,t),()=>Wm(e),()=>null),Ym={note:ie(`color-error`),thread:ie(`color-accent`),resolved:ie(`color-neutral`)},Xm=`var(--sxl-comment-leader-color, var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))))`,Zm=(0,X.memo)(e=>{let{sheet:t,markSize:n=7,openDelay:r=300,closeDelay:i=150,className:a,style:s,...c}=e,l=jt(),u=t.getView(),d=t.getMovables(),{getVisibleCells:f,cacheToken:p}=nh(t),m=(0,X.useMemo)(()=>({}),[p,n]),h=q(e=>{let{style:t,zoom:r=1,key:i,value:a}=e;if(!t||!a)return null;let o=a!==rh&&a.isNote(),s=o?`note`:a!==rh&&a.isResolved()?`resolved`:`thread`,c=1/P.getDevicePixelRatio();return(0,Z.jsx)(pa,{className:`sxl-cell-mark sxl-cell-mark-${s}`,anchorLocation:_.TopRight,shape:o?`triangle`:`bubble`,size:(o?n:1.15*n)*r,inset:0,cellWidth:t.width+c,cellHeight:t.height,fill:Ym[s],style:{left:t.left,top:t.top}},i)},[n]),{open:g,setTarget:v}=Ct({openDelay:r,closeDelay:i,group:!1}),y=(0,X.useRef)(null),[b,x]=(0,X.useState)(null),[S,C]=ut(`movable-hover`,null),w=e=>{e&&(y.current=e);let t=e?e.getId():null;v(t),x(t)},T=q(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=Qm(r)!==null&&th(n,$m(l,t,r,e),5);if(eh(n,e,4)||a)return void w(r)}}w(null)},[l,t]),E=q(()=>{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]=ut(`movable-drag`,null),A=l.getVisibleRange(),j=(0,X.useMemo)(()=>{if(!A)return ah;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=[],F=[];for(let e=0;e<j.length;e++){let n=j[e],r=n.getContent();if(r.isDeleted())continue;let i=Qm(r);if(i===null)continue;let a=k?.[n.getId()]?.bounds??n.getBounds();if(!a)continue;let o=$m(l,t,r,l.toPaneBounds(a)),s=F.indexOf(i);s===-1&&(s=F.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 I=f(l).length>0;return I||N.length!==0?(0,Z.jsxs)(Yt,{...c,className:Q(a,`sxl-comments`),onPointerMove:T,onPointerLeave:E,children:[I?(0,Z.jsx)(qt,{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:F.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});Zm.displayName=`CommentsLayer`;var Qm=e=>{let t=e.getStyle(),n=t?.toJSON()?.stroke;if(!t||!n)return Xm;let r=t.getStroke();if(!r.isVisible())return null;if(!n.fill)return Xm;try{return r.getFill().getColor()?.toCSS(`adaptive`)??Xm}catch{return Xm}},$m=(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}},eh=(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,th=(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},nh=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=q(()=>{s.current.clear(),n()},[]);return o(e,{onCommentsChange:l,onMergesChange:l},{ignoreModelChange:!0}),{getVisibleCells:q((t,n)=>{let r=s.current,o=n??t.getVisibleRange();if(!o)return ih;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},rh),r.set(c,d),r.size>12&&r.delete(r.keys().next().value),d},[e,i,a]),cacheToken:c}},rh=Symbol(`comment-draft`),ih=[],ah=[],oh=e=>`${e.rowIndex},${e.colIndex}`,sh=(0,X.memo)(e=>{let{sheet:t,renderCard:n,paneKey:r=wd.Comments,offset:i=18,openDelay:a=300,closeDelay:s=250,className:c,style:l,...u}=e,d=Jm(t),f=Rd().getActive()===r,p=se().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||Um(t)}},{ignoreModelChange:!0}),(0,X.useEffect)(()=>()=>{Um(t)},[t]);let _=q((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:oh(a),data:{coords:a,comment:s,focusRequest:n}}},[t]),v=q((e,t)=>_(e,0,!1),[_]),y=q(()=>{Um(t),g(!0)},[t]),b=f||p,x=d&&!b?_(d,d.focusRequest,!0):null;return(0,Z.jsx)(mt,{...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)(We,{render:n,props:{sheet:t,coords:e.coords,comment:e.comment,focusRequest:e.focusRequest,onClose:y}})})})});sh.displayName=`CommentCardLayer`;var ch=(0,X.createContext)(null),lh=ch.Provider,uh=()=>(0,X.useContext)(ch),dh=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())}},fh=new dh,ph=(0,X.createContext)(null),mh=()=>{let e=(0,X.useContext)(ph),t=(0,X.useRef)(null);return e||(t.current||=new dh,t.current)},hh=ph.Provider,gh=(e,t)=>e===void 0||(typeof e==`function`?e(t):Array.isArray(e)?e.includes(t):e===t),_h=(e,t,n,r,i)=>{for(let[a,o]of e.entries())o.surfaces.includes(n)&&gh(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}`}))})},vh=(e,t,n)=>{let r=(0,X.useContext)(ph),i=n??r,a=(0,X.useSyncExternalStore)(i?.subscribe??yh,i?.getVersion??bh),o=(0,X.useSyncExternalStore)(fh.subscribe,fh.getVersion);return(0,X.useMemo)(()=>{let n=[];return e&&(_h(fh,e,t,`plugin:`,n),i&&_h(i,e,t,`declared:`,n)),n},[i,a,o,e,t])},yh=()=>()=>{},bh=()=>0,xh=`_insert_8lp5h_8`,Sh=`_button_8lp5h_12`,Ch=`_line_8lp5h_37`,wh=`_row_8lp5h_44`,Th=`_column_8lp5h_51`,Eh=`_pressed_8lp5h_58`,Dh=e=>`cell-insert:${e}`,Oh=(0,X.memo)(e=>{let t=uh();return t===((e.axis??`row`)===`column`?`columnHeaders`:`rowHeaders`)?(0,Z.jsx)(kh,{...e}):t===`cells`?(0,Z.jsx)(jh,{axis:e.axis??`row`,className:e.className}):null});Oh.displayName=`CellInsertLayer`;var kh=e=>{let{axis:t=`row`,resolve:n,onInsert:r,size:i=16,renderButton:a=Nh,className:o,...s}=e,c=l(),u=jt(),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=q(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=q(()=>{p(null)},[]),_=q(e=>{r?r(e):e.insert(t)},[r,t]);return(0,Z.jsx)(Yt,{...s,className:Q(o,`sxl-cell-insert`,`sxl-cell-insert-${t}`),onPointerMove:h,onPointerLeave:g,children:(0,Z.jsx)(St,{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)(Ah,{info:e,axis:t,size:i,renderButton:a,onInsert:_,onLeave:g})})})},Ah=e=>{let{info:{data:t,floatProps:n,state:r},axis:i,size:a,renderButton:o,onInsert:s,onLeave:c}=e,l=K(),u=i===`column`,d=a*(r.pane?.getZoom()||1),f=$e(Dh(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:xh,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)(We,{render:o,props:{axis:i,range:t,size:d,title:l(u?`cellInsert.columnHere`:`cellInsert.rowHere`),onInsert:()=>s(t)}})})},jh=e=>{let{axis:t,className:n}=e,r=jt(),[i]=ut(Dh(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)(Yt,{className:Q(n,`sxl-cell-insert-preview`,`sxl-cell-insert-preview-${t}`),children:a?(0,Z.jsx)(bt,{range:a,style:{pointerEvents:`none`,overflow:`visible`},children:(0,Z.jsx)(`div`,{className:Q(Ch,t===`column`?Th:wh,`sxl-cell-insert-line`,i?.pressed&&[Eh,`sxl-cell-insert-line-pressed`])})}):null})},Mh=(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(Sh,`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`})]})})});Mh.displayName=`CellInsertButton`;var Nh=e=>(0,Z.jsx)(Mh,{...e}),Ph=Symbol(`unlock.uniform`),Fh=e=>Ph,Ih=(0,X.memo)(e=>{let{sheet:t,sheetView:n,className:r,...i}=e,a=jt();s(n,[`onAnyChange`]),s(t,[`onProtectionChange`]);let{getRegions:o}=fc(t,Gn.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:Fh(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)(Yt,{...i,className:Q(r,`sxl-locked-hatch`),children:(0,Z.jsx)(bt,{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}`))]})})})});Ih.displayName=`ProtectionLayer`;var Lh=(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=jt(),x=i===Y.Axis.Column?b.getPaneBounds().height:b.getPaneBounds().width,S=(0,X.useMemo)(()=>r??new Bs(n),[r,n]);Te(S,e=>e.getSelection());let C=q(()=>{m?.(),n.setAdjusting(n.getCoords())},[n,m]),w=q(()=>{n.setAdjusting(null),h?.()},[n,h]),T=q(()=>{u||b.focus()},[b,u]),E=Jt(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(Rh(`edge:${O}`,i,x,o,s));for(let e=0;D&&e<D.length;e++){let t=D[e],n=Bh(t.min,t.max,i,b);n&&k.push(zh(`selection:${O}:${e}`,n,i,x))}}return(0,Z.jsx)(Yt,{...y,className:Q(_,`sxl-header-selection`),onPointerDown:E.onPointerDown,onPointerMove:E.onPointerMove,onPointerUp:E.onPointerUp,children:(0,Z.jsx)(bt,{fill:!0,className:`sxl-header-selection-box`,style:{pointerEvents:`none`,...v},ref:t,children:k})})})),Rh=(e,t,n,r,i)=>{let a=P.getDevicePixelRatio(),o=r/a,s=P.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)},zh=(e,t,n,r)=>{if(!t)return;let i=`var(--sxl-color-primary)`,a=P.getDevicePixelRatio(),o=2/a,s=P.edgeCenter(r,`leading`,2,a),c;if(n===Y.Axis.Column){let e=P.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:`${P.edgeCenter(t.x+t.width,`trailing`,2,a)-e+o}px`}}else{let e=P.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:`${P.edgeCenter(t.y+t.height,`trailing`,2,a)-e+o}px`}}return(0,Z.jsx)(`div`,{className:`sxl-header-selection-border`,style:c},e)},Bh=(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}},Vh=e=>`resize-indicator:`+(e===Y.Axis.Column?`col`:`row`),Hh={side:`b`,align:`center`},Uh={side:`r`,align:`center`},Wh=(0,X.memo)(e=>{let{sheetHeader:t}=e,n=K(),r=t.getAxis(),i=r===Y.Axis.Column,[a]=ut(Vh(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)(Vt,{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?Hh:Uh,offset:4,boundary:`viewport`,children:v})});Wh.displayName=`ResizeTooltip`;var Gh=(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=jt(),[h,_]=(0,X.useState)(n.getSelectedRuns()),[v,y]=(0,X.useReducer)(e=>e+1,0),b=K(),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=$e(Vh(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=q((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=q((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(Kh(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=q((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=q((e,t)=>{k(),O.current=setTimeout(()=>{O.current=null,E({index:e,sizePX:t})},360),l?.(e,t)},[l]),R=q(e=>{k(),E(null),u?.(e)},[u]),z=q(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]),ee=q(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]),B=n.isProtected(),V=B?void 0:P,H=null,U=(r?p.getVisibleColumns():p.getVisibleRows()).map(e=>e.index),W=r?p.getPaneRange().colStart:p.getPaneRange().rowStart;U.length>0&&U[0]>W&&(U=[U[0]-1,...U]);let te=[],G=[],ne=U.length;for(let e=0;e<ne;e++){let t=U[e],n=e<ne-1?U[e+1]:t+j(t+1,!1)+1,r=t+1!==n;(!H||H.max<t)&&(H=h.length>0&&h[h.length-1].max>=t?h[g.findEqualOrGreater(h,t,e=>e.max)]:null);let i=!1,a=!1;if(H&&(H.min<=t||H.min<=n&&!r)&&(i=!0,a=H.value??!1),t===W){let e=!1,n=!1;H&&H.min<=t&&(e=!0,n=H.value??!1),t>0&&G.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(a&&te.push(G.length),G.push({index:t,isHidden:e===0&&j(t,!1)>0,isNextHidden:r,isSelected:i,isSelectedAll:a,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:V,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:ee}),r){let e=!1,r=!1;H&&H.min>=t&&H.max<=n-1&&H.value&&te.push(G.length),H&&H.max>=n||(H=h.length>0&&h[h.length-1].max>=n?h[g.findEqualOrGreater(h,n,e=>e.max)]:null),H&&H.min<=n&&(e=!0,r=H.value??!1),n>0&&G.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:L,onDividerResizeStart:I,onDividerResize:V,onDividerMouseUp:R,onDividerResizeEnd:F,onDividerAutoFit:ee})}}if(te.length>0){let e=te.length-1;if(te.length>0){let t=G[te[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=G[te[Math.max(0,te.length-1)]];e.showTouchDivider=!!t&&t.max<=e.index}else e>=0&&(G[te[e]].showTouchDivider=!0)}let re=G.length,ie=st(p,T),ae=Array(re);for(let e=0;e<re;e++)ae[e]=(0,Z.jsx)(et,{...G[e],axis:T,visibleBounds:ie,disabled:B,onDividerUnhide:B?void 0:z},`divider${e}`);return(0,Z.jsxs)(Yt,{...f,className:Q(d,`sxl-header-resizer`),children:[ae,(0,Z.jsx)(Wh,{sheetHeader:n})]})})),Kh=(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},qh=`var(--sxl-color-primary)`,Jh=`var(--sxl-color-base-100)`,Yh=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,i=jt(),[a]=ut(Vh(Y.Axis.Column),null),[o]=ut(Vh(Y.Axis.Row),null),s=!!a,c=a??o,l=Q(n,`sxl-resize-indicator`);if(!c)return(0,Z.jsx)(Yt,{...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 ${Jh}`,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 ${Jh}`,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:qh,strokeWidth:`2px`,strokeDasharray:`0 0 8 4`}};h=(0,Z.jsxs)(X.Fragment,{children:[f?void 0:(0,Z.jsx)(Pt,{linePoints:c,bounds:p,propsPath:{stroke:qh,strokeWidth:`2px`}}),(0,Z.jsx)(Pt,{linePoints:c,bounds:m,...g})]},`resize-dividers`)}return(0,Z.jsx)(Yt,{...r,className:l,children:h})});Yh.displayName=`ResizeIndicator`;var Xh=e=>`freeze-drag:`+(e===Y.Axis.Column?`col`:`row`),Zh=e=>`freeze-active:`+(e===Y.Axis.Column?`col`:`row`),Qh=`var(--sxl-color-primary)`,$h=(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)(Pt,{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)},eg={stroke:Qh,strokeWidth:`2px`},tg={stroke:Qh,strokeWidth:`2px`,strokeDasharray:`4 3`},ng=(0,X.memo)(e=>{let{showStart:t=!1}=e,n=jt(),[r]=ut(Xh(Y.Axis.Column),null),[i]=ut(Xh(Y.Axis.Row),null),[a]=ut(Zh(Y.Axis.Column),!1),[o]=ut(Zh(Y.Axis.Row),!1),s=n.getAllPanes(),c=n.getPaneBounds(),l=t&&a&&!s[_.Left]&&c.x===0?rg(n,!0):null,u=t&&o&&!s[_.Top]&&c.y===0?rg(n,!1):null,d=!!r,f=r??i;return(0,Z.jsxs)(Z.Fragment,{children:[l,u,f?.pointerClient===void 0?null:$h(n,d,f.pointerClient,`freeze-pointer`,tg),f?$h(n,d,f.snapClient,`freeze-snap`,eg,+(f.index===0)):null]})}),rg=(e,t)=>{let n=e.getPaneBounds(),r=t?n.height:n.width;return(0,Z.jsx)(Pt,{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:eg},t?`freeze-start-col`:`freeze-start-row`)};ng.displayName=`FreezeDragLines`;var ig=(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}})},ag=(e,t)=>{let n=jt(),r=t===Y.Axis.Column,[,i]=(0,X.useReducer)(e=>e+1,0);o(e.getView(),{onFreezePaneChange(){i()}});let a=$e(Xh(t),null),[s,c]=ut(Zh(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=q(e=>{u(),l.current={target:e,shown:e.snapClient,frame:0,time:0},a(e)},[]),p=q(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=q(()=>{u(),a(null)},[]),h=Ae.useCommandScope(),g=()=>h?.resolve(`freezePanesAt`,h),_=q(n=>{u(),a(null);let r={axis:t,index:n.index};h?g()?.execute(r):ig(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=(it(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}},og=(0,X.memo)(e=>{let{sheetHeader:t,className:n,...r}=e,i=t.getAxis(),{isActive:a,...o}=ag(t.getWorksheet(),i);return(0,Z.jsxs)(Yt,{...r,className:Q(n,`sxl-header-freeze`),children:[(0,Z.jsx)(ng,{}),(0,Z.jsx)(wt,{axis:i,highlight:a,...o})]})});og.displayName=`HeaderFreezeLayer`;var sg=(0,X.memo)(e=>{let{sheet:t,className:n,...r}=e,{isActive:i,...a}=ag(t,Y.Axis.Column),{isActive:o,...s}=ag(t,Y.Axis.Row);return(0,Z.jsxs)(Yt,{...r,className:Q(n,`sxl-freeze`),children:[(0,Z.jsx)(ng,{showStart:!0}),(0,Z.jsx)(Qe,{axis:Y.Axis.Column,...a}),(0,Z.jsx)(Qe,{axis:Y.Axis.Row,...s})]})});sg.displayName=`GridFreezeLayer`;var{CommandScopeProvider:cg}=Ae,lg=(e,t)=>(e.updateCommand(`openContextMenu`,{callback:()=>{t.openAtSelectedCell()}}),()=>{}),ug=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetContextMenu:r,className:i,...a}=e,o=jt(),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=q(()=>{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)(cg,{spec:{scopeName:`layer:contextmenu`,contributor:{dynamic:lg},data:l},order:ft().zIndex,children:(0,Z.jsx)(Yt,{onContextMenu:s,className:Q(i,`sxl-contextMenu`),...a})})}));function dg(e){let{axis:t,entireCoords:n,scrollIntoView:r,className:i,...a}=e,o=ba().getMode(),s=o?.selection??null,c=l()?.getName(),u=(0,X.useMemo)(()=>{if(!s)return null;let e=new Bs(s);return c?tc(e,c):e},[s,c]);return o&&o.mode===`point`&&s?o.scope&&o.scope!==c?null:(0,Z.jsx)(Lh,{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}ug.displayName=`ContextMenuLayer`,dg.displayName=`SheetReferenceHeaderLayer`;var fg=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`})]})},pg=(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 Mn.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)(fg,{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})]})]})})}),mg=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=q(()=>{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]},hg={key:`copy`,description:C(`editMode.copy`)},gg={key:`cut`,description:C(`editMode.cut`)},_g={type:ir.Content.Values},vg={fitDestination:!0,type:ir.Content.Formats},yg={fitDestination:!0,type:ir.Content.Formulas},bg={transpose:!0},xg={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getAddress({$colIndex:!0,$rowIndex:!0})}`})};function Sg(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 sr(t)}},l={element:s,importFromExternal:async(e,t)=>{let r=n.getSelectedRange().getTopLeft().getCoords(),i=new ur(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:ir.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({..._g,...e})}),e.updateCommand(`pasteFormats`,{callback:(e,t)=>m({...vg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteFormulas`,{callback:(e,t)=>m({...yg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteTranspose`,{callback:(e,t)=>m({...bg,description:t?.getLabel(),...e})}),e.updateCommand(`pasteLinks`,{callback:(e,t)=>m({...xg,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?.()?gg:hg,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:Cg,useCommandExecute:wg}=Ae,Tg=({sheet:e,className:t,...n})=>{let r=U(),i=se(),a=Fe(),o=jt(),s=wg(),c=i.getMode(),l=q(()=>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)(Cg,{spec:{scopeName:`layer:clipboard`,contributor:{dynamic:Sg},data:u},order:ft().zIndex,children:(0,Z.jsx)(Yt,{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)(at,{range:g,alignWidth:2,stroke:p.isCut?.()?`var(--sxl-color-warning)`:`var(--sxl-color-primary)`,animatedStroke:!0,clipInsets:-10})})})};Tg.displayName=`SheetClipboardLayer`;var Eg=`sxl-system-colors`,Dg=()=>{(0,X.useMemo)(()=>{(()=>{if(typeof document>`u`||document.getElementById(Eg))return;let e=yn.getSystemColorDefaults(),t=Object.keys(e).map(t=>`${kn}${t}:${e[t]};`).join(``),n=document.createElement(`style`);n.id=Eg,n.textContent=`:root{${t}}`,document.head.appendChild(n)})()},[])},Og=(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":_n.toCSSFontFamily(a.getMajorFont(),a.getMajorFallbacks()),"doc-font-minor":_n.toCSSFontFamily(a.getMinorFont(),a.getMinorFallbacks()),"doc-font-size":`${t}pt`,"doc-line-height":`${n}px`}},kg=`_sheet-scrollbar_104cg_1`,Ag={side:`l`,align:`center`},jg={side:`t`,align:`center`},Mg=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n=P.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===B.Vertical,v=K(),[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===B.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,F=d-S.shift,I=l-(S.shift+S.scroll),L=D.getMetrics().getOffset(j)*(i.getView().getZoomScale()/100)-(S.scroll+S.shift),R=q((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]),z=q(e=>{E(e.dragging?{element:e.element}:null)},[]),ee=null,V=T?T.element??h.current?.querySelector(`[role="slider"]`)??null:null;if(V){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 H=(0,X.useMemo)(()=>(0,Z.jsx)(_e,{ref:g,className:Q(f,kg),style:n,offset:N,viewportSize:F,totalSize:I,orientation:r,showCustomScrollButtons:s,onMouseDown:e=>{e.preventDefault()},onScrollOffset:R,minSize:L,onThumbDrag:z,...m}),[f,N,F,I,r,s,n,L,p]);return(0,Z.jsxs)(Z.Fragment,{children:[H,V?(0,Z.jsx)(Vt,{name:`scrollbar-thumb`,active:!!T,anchor:{element:V},placement:_?Ag:jg,children:ee}):null]})}));Mg.displayName=`SheetScrollbar`;var Ng=Object.freeze([]),Pg={style:{display:`none`}},Fg=(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=q(m,[m]),O=q((e,t,n)=>{W(),h?.(e,t,n)},[h]),k=q(g,[g]),A=q(_,[_]),j=q(v,[v]),M=(0,X.useRef)(null),[N,F]=(0,X.useReducer)(e=>e+1,0),I=n?.getWorksheet(),L=(0,X.useRef)(!1);(0,X.useLayoutEffect)(()=>{L.current=!0},[n]);let[R,z]=(0,X.useState)(0),[ee,B]=(0,X.useState)(I?.getView().getZoomScale()/100),[V,H]=(0,X.useState)(()=>I?.getEntireRange().getCoords()??null);o(I,{onViewChange:()=>{B(I.getView().getZoomScale()/100)},onLayoutChange:()=>{let e=I.getEntireRange().getCoords();H(t=>t&&t.rowEnd===e.rowEnd&&t.colEnd===e.colEnd?t:e)}});let[U,W]=mg(n);o(n,{onMetricsChange:()=>{z(n.getEntireRange().getCoords().max+1)}});let te=(0,X.useCallback)((e,t)=>U.hiddenHeadersAt(e,t),[U]),G=q(e=>n.isSelected(e),[n]),ne=q(e=>n.isSelectedAll(e),[n]),re=(0,X.useCallback)(()=>{let e=n.getFilteredRanges();return e.length===0?Ng:e.map(e=>e.getCoords())},[n]),K=(0,X.useRef)(Ng),[ie,ae]=(0,X.useReducer)(e=>e+1,0);(0,X.useLayoutEffect)(()=>{K.current=re()},[re]),o(I,{onTablesChange:()=>{let e=K.current,t=re();K.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)||ae()}});let oe=q(e=>{let t=K.current;for(let n=0;n<t.length;n++)if(e>=t[n].min&&e<=t[n].max)return!0;return!1},[]),ce=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return{getColOffset:t=>e?U.getOffset(t):t===0?0:r/ee,getColIndex:t=>e?U.getIndex(t):0,getRowOffset:t=>e?t===0?0:r/ee:U.getOffset(t),getRowIndex:t=>e?0:U.getIndex(t)}},[U,E,r,ee]),le=(0,X.useMemo)(()=>(0,Z.jsx)(Gh,{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]),ue=(0,X.useMemo)(()=>(0,Z.jsx)(og,{sheetHeader:n},`header-freeze-layer-${E}-[${n.getWorksheet().getId()}]`),[n,E]),de=q(e=>{let t=E===Y.Axis.Column;p?.({...e,rowIndex:t?-1:e.rowIndex,colIndex:t?e.colIndex:-1})},[E,p]),fe=q(e=>{I?.scrollTo({colStart:e.colIndex,colEnd:e.colIndex,rowStart:e.rowIndex,rowEnd:e.rowIndex},{})},[I]),pe=(0,X.useMemo)(()=>(0,Z.jsx)(Lh,{selection:n.getWorksheet().getSelection(),axis:E,entireCoords:V??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,R,V,c,i,a,fe]),me=(0,X.useMemo)(()=>(0,Z.jsx)(dg,{axis:E,entireCoords:V??n.getWorksheet().getEntireRange().getCoords(),scrollIntoView:fe},`header-reference-layer-${E}-[${n.getWorksheet().getId()}]`),[n,R,V,c,E,fe]),ge=(0,X.useMemo)(()=>p?(0,Z.jsx)(ug,{sheet:n.getWorksheet(),onSheetContextMenu:de},`context-menu-layer-${E}-[${n.getWorksheet().getId()}]`):null,[n,p,N]),_e=q(e=>s?s(e):n.getTextAt(e),[s,n]),ve=q(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)($i,{axis:E,index:a,isSelected:G,isSelectedAll:ne,isFiltered:oe,zoomScale:100*ee,headerText:_e,verticalPadding:d,horizontalPadding:f,onColumnButtonMouseDown:S?.onColumnButtonMouseDown,propsColumnButton:S?.propsColumnButton,renderColumnButton:S?.renderColumnButton,...i,value:o},`${r}-${E}-[${n.getWorksheet().getId()}]`)},[N,S,R,ee,n]),ye=se(),xe=Ne(t,()=>({scrollTo:e=>{M.current?.scrollTo(e)},forceRender:()=>{F()},getGridSurface:()=>M.current}),[]),Se=(0,X.useMemo)(()=>{if(y)return E===Y.Axis.Column?new He(y,new he,!0,!1,y):new He(new he,y,!1,!0,y)},[y,E]),Ce=l===`dark`?`dark`:`light`,we=(0,X.useMemo)(()=>{let e={overflow:`visible`,...(I?.getStyles().getNormal().getFont()).toCSS(`adaptive`,1),...C},t=`white`,n=`black`;if(P.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`;ye.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,ye,l,C,r,N]),Te=E===Y.Axis.Column?`columnHeaders`:`rowHeaders`,Ee=vh(n.getWorksheet(),Te),De=(0,X.useMemo)(()=>[(0,Z.jsx)(Yu,{header:n,renderCell:ve,invalidateToken:ie},`header-cells-${E}-[${n.getWorksheet().getId()}]`),pe,me,le,ue,ge,...Ee],[le,ue,pe,me,ge,Ee,n,ve,E,ie]),Oe=u([xe,M]),ke=(0,X.useMemo)(()=>{let e=E===Y.Axis.Column;return(0,Z.jsx)(lh,{value:Te,children:(0,Z.jsx)(Et,{ref:Oe,className:Q(w,`sxl-sheet-header`),style:{touchAction:`none`,...we},...be(`header`,Ce),viewport:Se,columnCount:e?R:1,rowCount:e?1:R,freezeLeft:e?c:void 0,freezeTop:e?void 0:c,propsFreezeLeft:Pg,propsFreezeTop:Pg,hiddenColumnsAt:e?te:void 0,hiddenRowsAt:e?void 0:te,metrics:ce,...T,children:De})})},[R,De,Te,ce,Se,we,w,Ce,T,Oe]);return(0,X.useEffect)(()=>{L.current=!1,M.current?.invalidate()},[n]),ke})),Ig=(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]=mg(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 He(s,new he,!0,!1,s):new He(new he,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)(Et,{className:Q(f,`sxl-sheet-outline`),style:D,...be(`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)(Zu,{sheet:t,axis:n,lanes:r,renderButton:l,laneGap:u,bracketGap:d},`outline-${n}-[${t.getId()}]`)})});Ig.displayName=`SheetOutlineElement`;var Lg=(0,X.memo)(e=>{let{sheet:t,axis:n,lanes:r,laneSize:i,laneGap:a=1,colorScheme:s,renderLevelButton:c=la,className:l,style:u,...d}=e,f=K(),p=n===Y.Axis.Column,m=ea(i,a),[,h]=(0,X.useReducer)(e=>e+1,0);o(t.getOutline(),{onOutlineChange:()=>h()});let g=zg(t.getOutline(),n)+1,_=s===`dark`?`dark`:`light`,[v]=fe(`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)(We,{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`),...be(`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?Rg:0,paddingBottom:p?0:Rg,boxSizing:`border-box`,width:`100%`,height:`100%`,overflow:`hidden`,...u},children:x})});Lg.displayName=`SheetOutlineLevels`;var Rg=3,zg=(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},Bg=(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]=fe(`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=P.getDevicePixelRatio(),x=e=>e/b+`px`;return(0,Z.jsxs)(`div`,{tabIndex:-1,className:Q(i,`sxl-top-left-corner`),...be(`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)`}})]})}));Bg.displayName=`TopLeftCorner`;var Vg=/^(line|lineInv|straightConnector1|bentConnector\d|curvedConnector\d)$/,Hg=e=>Vg.test(e)?{type:gn.Type.Connector,geometry:e}:e===`rect`?{}:{geometry:e},$=(e,t)=>({key:e,label:t,json:Hg(e)}),Ug=(e,t,n,r=!1)=>({key:e,label:n,json:{...Hg(t),stroke:r?{headType:Sn.LineEndType.Triangle,tailType:Sn.LineEndType.Triangle}:{tailType:Sn.LineEndType.Triangle}}});C(`shape.category.lines`),$(`line`,C(`shape.preset.line`)),Ug(`lineArrow`,`line`,C(`shape.preset.lineArrow`)),Ug(`lineArrowDouble`,`line`,C(`shape.preset.lineArrowDouble`),!0),$(`bentConnector3`,C(`shape.preset.bentConnector3`)),Ug(`bentConnector3Arrow`,`bentConnector3`,C(`shape.preset.bentConnector3Arrow`)),Ug(`bentConnector3ArrowDouble`,`bentConnector3`,C(`shape.preset.bentConnector3ArrowDouble`),!0),$(`curvedConnector3`,C(`shape.preset.curvedConnector3`)),Ug(`curvedConnector3Arrow`,`curvedConnector3`,C(`shape.preset.curvedConnector3Arrow`)),Ug(`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 Wg=e=>{let t=e.getRange().getCoords();return{rowIndex:t.rowStart,colIndex:t.colStart}},Gg=(e,t)=>{let n=e.getRange().getCoords(),r=t.getRange().getCoords();return n.rowStart-r.rowStart||n.colStart-r.colStart},Kg=86400;7*Kg,30*Kg,7*Kg,365*Kg,30*Kg,365*Kg;var qg=(e,t)=>e?.canActivate(t)?[]:[C(`reason.noTaskPane`)],Jg=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??=Qg(this._pivot):Qg(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);Zg(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 Xg(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}},Yg={row:[],column:[],page:[],values:[]},Xg=(e,t)=>e.getDataFields().filter(e=>e.getField().getName()===t.getName()),Zg=(e,t)=>t.getAxis()!==null||Xg(e,t).length>0,Qg=e=>{if(e.isDeleted())return{deleted:!0,name:e.getName(),source:null,location:null,fields:[],areas:Yg};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 $g(e){let t=(0,X.useMemo)(()=>e?e_(new Jg(e)):null,[e]),n=(0,X.useSyncExternalStore)(t?.subscribe??t_,t?.getVersion??n_),r=(0,X.useMemo)(()=>t?.model.getSnapshot()??null,[t,n]);return t&&r?{model:t.model,snapshot:r}:null}var e_=e=>{let t=0;return{model:e,subscribe:n=>e.subscribe(()=>{t++,n()}),getVersion:()=>t}},t_=()=>()=>{},n_=()=>0,r_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function i_(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function a_(e){return`nodeType`in e}function o_(e){var t;return e?i_(e)?e:a_(e)&&(t=e.ownerDocument?.defaultView)!=null?t:window:window}function s_(e){let{Document:t}=o_(e);return e instanceof t}function c_(e){return!i_(e)&&e instanceof o_(e).HTMLElement}function l_(e){return e instanceof o_(e).SVGElement}function u_(e){return e?i_(e)?e.document:a_(e)?s_(e)?e:c_(e)||l_(e)?e.ownerDocument:document:document:document}var d_=r_?X.useLayoutEffect:X.useEffect;function f_(e){let t=(0,X.useRef)(e);return d_(()=>{t.current=e}),(0,X.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function p_(e,t){t===void 0&&(t=[e]);let n=(0,X.useRef)(e);return d_(()=>{n.current!==e&&(n.current=e)},t),n}function m_(e,t){let n=(0,X.useRef)();return(0,X.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function h_(e){let t=f_(e),n=(0,X.useRef)(null);return[n,(0,X.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function g_(e){let t=(0,X.useRef)();return(0,X.useEffect)(()=>{t.current=e},[e]),t.current}var __={};function v_(e,t){return(0,X.useMemo)(()=>{if(t)return t;let n=__[e]==null?0:__[e]+1;return __[e]=n,e+`-`+n},[e,t])}function y_(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 b_=y_(1),x_=y_(-1);function S_(e){if(!e)return!1;let{KeyboardEvent:t}=o_(e.target);return t&&e instanceof t}function C_(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=o_(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 w_=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[w_.Translate.toString(e),w_.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),T_=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function E_(e){return e.matches(T_)?e:e.querySelector(T_)}var D_={display:`none`};function O_(e){let{id:t,value:n}=e;return X.createElement(`div`,{id:t,style:D_},n)}function k_(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 A_=(0,X.createContext)(null),j_,M_={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
|
-
`},N_={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 P_(e){let{announcements:t=N_,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=M_}=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=v_(`DndLiveRegion`),[c,l]=(0,X.useState)(!1);if((0,X.useEffect)(()=>{l(!0)},[]),function(e){let t=(0,X.useContext)(A_);(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(O_,{id:r,value:i.draggable}),X.createElement(k_,{id:s,announcement:o}));return n?(0,pr.createPortal)(u,n):u}function F_(){}function I_(e,t){return(0,X.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function L_(){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`})(j_||={});var R_=Object.freeze({x:0,y:0});function z_(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function B_(e,t){let n=C_(e);return n?(n.x-t.left)/t.width*100+`% `+(n.y-t.top)/t.height*100+`%`:`0 0`}function V_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function H_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function U_(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 W_(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function G_(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 K_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=G_(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=z_(G_(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(V_)};function q_(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 J_=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=q_(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(H_)};function Y_(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 X_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:R_}function Z_(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 Q_=Z_(1);function $_(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 ev,tv={ignoreTransform:!1};function nv(e,t){t===void 0&&(t=tv);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=o_(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=$_(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 rv(e){return nv(e,{ignoreTransform:!0})}function iv(e,t){let n=[];return e?function r(i){if(t!=null&&n.length>=t||!i)return n;if(s_(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!c_(i)||l_(i)||n.includes(i))return n;let a=o_(e).getComputedStyle(i);return i!==e&&function(e,t){t===void 0&&(t=o_(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=o_(e).getComputedStyle(e)),t.position===`fixed`}(i,a)?n:r(i.parentNode)}(e):n}function av(e){let[t]=iv(e,1);return t??null}function ov(e){return r_&&e?i_(e)?e:a_(e)?s_(e)||e===u_(e).scrollingElement?window:c_(e)?e:null:null:null}function sv(e){return i_(e)?e.scrollX:e.scrollLeft}function cv(e){return i_(e)?e.scrollY:e.scrollTop}function lv(e){return{x:sv(e),y:cv(e)}}function uv(e){return!(!r_||!e)&&e===document.scrollingElement}function dv(e){let t={x:0,y:0},n=uv(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`})(ev||={});var fv={x:.2,y:.2};function pv(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=fv);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=dv(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=ev.Backward,m.y=r*Math.abs((t.top+h-a)/h)):!u&&c>=t.bottom-h&&(p.y=ev.Forward,m.y=r*Math.abs((t.bottom-h-c)/h)),!f&&s>=t.right-g?(p.x=ev.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!d&&o<=t.left+g&&(p.x=ev.Backward,m.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:m}}function mv(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 hv(e){return e.reduce((e,t)=>b_(e,lv(t)),R_)}function gv(e,t){if(t===void 0&&(t=nv),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);av(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var _v,vv,yv=[[`x`,[`left`,`right`],function(e){return e.reduce((e,t)=>e+sv(t),0)}],[`y`,[`top`,`bottom`],function(e){return e.reduce((e,t)=>e+cv(t),0)}]],bv=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=iv(t),r=hv(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of yv)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})}},xv=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 Sv(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 Cv(e){e.preventDefault()}function wv(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`})(_v||={}),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`}(vv||={});var Tv={start:[vv.Space,vv.Enter],cancel:[vv.Esc],end:[vv.Space,vv.Enter,vv.Tab]},Ev=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case vv.Right:return{...n,x:n.x+25};case vv.Left:return{...n,x:n.x-25};case vv.Down:return{...n,y:n.y+25};case vv.Up:return{...n,y:n.y-25}}},Dv=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 xv(u_(t)),this.windowListeners=new xv(o_(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_v.Resize,this.handleCancel),this.windowListeners.add(_v.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_v.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&gv(n),t(R_)}handleKeyDown(e){if(S_(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Tv,coordinateGetter:a=Ev,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}:R_;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=x_(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}=dv(n),p=mv(n),m={x:Math.min(i===vv.Right?p.right-p.width/2:p.right,Math.max(i===vv.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===vv.Down?p.bottom-p.height/2:p.bottom,Math.max(i===vv.Down?p.top:p.top+p.height/2,u.y))},h=i===vv.Right&&!s||i===vv.Left&&!c,g=i===vv.Down&&!l||i===vv.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===vv.Right&&e<=d.x||i===vv.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=a?n.scrollLeft-e:i===vv.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===vv.Down&&e<=d.y||i===vv.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=a?n.scrollTop-e:i===vv.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,b_(x_(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 Ov(e){return!!(e&&`distance`in e)}function kv(e){return!!(e&&`delay`in e)}Dv.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Tv,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 Av=class{constructor(e,t,n){n===void 0&&(n=function(e){let{EventTarget:t}=o_(e);return e instanceof t?e:u_(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=u_(i),this.documentListeners=new xv(this.document),this.listeners=new xv(n),this.windowListeners=new xv(o_(i)),this.initialCoordinates=C_(r)??R_,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(_v.Resize,this.handleCancel),this.windowListeners.add(_v.DragStart,Cv),this.windowListeners.add(_v.VisibilityChange,this.handleCancel),this.windowListeners.add(_v.ContextMenu,Cv),this.documentListeners.add(_v.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(kv(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Ov(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(_v.Click,wv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_v.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=C_(e)??R_,s=x_(n,o);if(!t&&a){if(Ov(a)){if(a.tolerance!=null&&Sv(s,a.tolerance))return this.handleCancel();if(Sv(s,a.distance))return this.handleStart()}return kv(a)&&Sv(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===vv.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},jv={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Mv=class extends Av{constructor(e){let{event:t}=e,n=u_(t.target);super(e,jv,n)}};Mv.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||n.button!==0)&&(r?.({event:n}),!0)}}];var Nv,Pv={move:{name:`mousemove`},end:{name:`mouseup`}};(function(e){e[e.RightClick=2]=`RightClick`})(Nv||={});var Fv=class extends Av{constructor(e){super(e,Pv,u_(e.event.target))}};Fv.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Nv.RightClick&&(r?.({event:n}),!0)}}];var Iv,Lv,Rv={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},zv=class extends Av{constructor(e){super(e,Rv)}static setup(){return window.addEventListener(Rv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Rv.move.name,e)};function e(){}}};function Bv(e){let{acceleration:t,activator:n=Iv.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Lv.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=function(e){let{delta:t,disabled:n}=e,r=g_(t);return m_(e=>{if(n||!r||!e)return Uv;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ev.Backward]:e.x[ev.Backward]||i.x===-1,[ev.Forward]:e.x[ev.Forward]||i.x===1},y:{[ev.Backward]:e.y[ev.Backward]||i.y===-1,[ev.Forward]:e.y[ev.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 Iv.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Iv.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===Lv.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}=pv(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)])}zv.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`}(Iv||={}),function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`}(Lv||={});var Vv,Hv,Uv={x:{[ev.Backward]:!1,[ev.Forward]:!1},y:{[ev.Backward]:!1,[ev.Forward]:!1}};(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Vv||={}),function(e){e.Optimized=`optimized`}(Hv||={});var Wv=new Map;function Gv(e,t){return m_(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Kv(e){let{callback:t,disabled:n}=e,r=f_(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 qv(e){return new bv(nv(e),e)}function Jv(e,t,n){t===void 0&&(t=qv);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=f_(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=Kv({callback:a});return d_(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}var Yv=[];function Xv(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!==R_;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?x_(e,n.current):R_}function Zv(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 Qv=[];function $v(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return c_(t)?t:e}var ey=[{sensor:Mv,options:{}},{sensor:Dv,options:{}}],ty={current:{}},ny={draggable:{measure:rv},droppable:{measure:rv,strategy:Vv.WhileDragging,frequency:Hv.Optimized},dragOverlay:{measure:nv}},ry=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}},iy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ry,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:F_},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ny,measureDroppableContainers:F_,windowRect:null,measuringScheduled:!1},ay={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:F_,draggableNodes:new Map,over:null,measureDroppableContainers:F_},oy=(0,X.createContext)(ay),sy=(0,X.createContext)(iy);function cy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ry}}}function ly(e,t){switch(t.type){case j_.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case j_.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 j_.DragEnd:case j_.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case j_.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new ry(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case j_.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 ry(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case j_.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new ry(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function uy(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,X.useContext)(oy),a=g_(r),o=g_(n?.id);return(0,X.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!S_(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=E_(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function dy(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}var fy,py=(0,X.createContext)({...R_,scaleX:1,scaleY:1});(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(fy||={});var my=(0,X.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=ey,collisionDetection:o=J_,measuring:s,modifiers:c,...l}=e,[u,d]=(0,X.useReducer)(ly,void 0,cy),[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)(fy.Uninitialized),g=m===fy.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??ty,rect:S},[_,x]),w=(0,X.useRef)(null),[T,E]=(0,X.useState)(null),[D,O]=(0,X.useState)(null),k=p_(l,Object.values(l)),A=v_(`DndDescribedBy`,t),j=(0,X.useMemo)(()=>b.getEnabled(),[b]),M=(0,X.useMemo)(()=>({draggable:{...ny.draggable,...N?.draggable},droppable:{...ny.droppable,...N?.droppable},dragOverlay:{...ny.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 Vv.Always:return!1;case Vv.BeforeDragging:return n;default:return!n}}(),f=p_(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=m_(t=>{if(d&&!n)return Wv;if(!t||t===Wv||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 bv(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 m_(e=>t==null?null:r??e??null,[r,t])}(v,_),R=(0,X.useMemo)(()=>D?C_(D):null,[D]),z=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}}(),ee=function(e,t){return Gv(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;d_(()=>{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=X_(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=av(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])})({activeNode:_==null?null:v.get(_),config:z.layoutShiftCompensation,initialRect:ee,measure:M.draggable.measure});let B=Jv(L,M.draggable.measure,ee),V=Jv(L?L.parentElement:null),H=(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}),U=b.getNodeFor(H.current.over?.id),W=function(e){let{measure:t}=e,[n,r]=(0,X.useState)(null),i=Kv({callback:(0,X.useCallback)(e=>{for(let{target:n}of e)if(c_(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=h_((0,X.useCallback)(e=>{let n=$v(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}),te=W.nodeRef.current??L,G=g?W.rect??B:null,ne=!!(W.nodeRef.current&&W.rect),re=X_(K=ne?null:B,Gv(K));var K;let ie=Zv(te?o_(te):null),ae=function(e){let t=(0,X.useRef)(e),n=m_(n=>e?n&&n!==Yv&&e&&t.current&&e.parentNode===t.current.parentNode?n:iv(e):Yv,[e]);return(0,X.useEffect)(()=>{t.current=e},[e]),n}(g?U??L:null),oe=function(e,t){t===void 0&&(t=nv);let[n]=e,r=Zv(n?o_(n):null),[i,a]=(0,X.useState)(Qv);function o(){a(()=>e.length?e.map(e=>uv(e)?r:new bv(t(e),e)):Qv)}let s=Kv({callback:o});return d_(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}(ae),se=dy(c,{transform:{x:y.x-re.x,y:y.y-re.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:B,containerNodeRect:V,draggingNodeRect:G,over:H.current.over,overlayNodeRect:W.rect,scrollableAncestors:ae,scrollableAncestorRects:oe,windowRect:ie}),ce=R?b_(R,y):null,le=function(e){let[t,n]=(0,X.useState)(null),r=(0,X.useRef)(e),i=(0,X.useCallback)(e=>{let t=ov(e.target);t&&n(e=>e?(e.set(t,lv(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=ov(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,lv(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=>{ov(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,X.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>b_(e,t),R_):hv(e):R_,[e,t])}(ae),ue=Xv(le),de=Xv(le,[B]),fe=b_(se,ue),pe=G?Q_(G,se):null,me=C&&pe?o({active:C,collisionRect:pe,droppableRects:P,droppableContainers:j,pointerCoordinates:ce}):null,he=W_(me,`id`),[ge,_e]=(0,X.useState)(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ne?se:b_(se,de),ge?.rect??null,B),ye=(0,X.useRef)(null),be=(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:H,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,pr.unstable_batchedUpdates)(()=>{r?.(i),h(fy.Initializing),d({type:j_.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ye.current),O(a)})},onMove(e){d({type:j_.DragMove,coordinates:e})},onEnd:s(j_.DragEnd),onCancel:s(j_.DragCancel)});function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=H.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===j_.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=j_.DragCancel)}w.current=null,(0,pr.unstable_batchedUpdates)(()=>{d({type:e}),h(fy.Uninitialized),_e(null),E(null),O(null),ye.current=null;let t=e===j_.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}ye.current=o},[v]),xe=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,be(n,t))},[v,be]));(function(e){(0,X.useEffect)(()=>{if(!r_)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),d_(()=>{B&&m===fy.Initializing&&h(fy.Initialized)},[B,m]),(0,X.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=H.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:fe.x,y:fe.y},over:i};(0,pr.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[fe.x,fe.y]),(0,X.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=H.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(he),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,pr.unstable_batchedUpdates)(()=>{_e(s),a?.(c),f({type:`onDragOver`,event:c})})},[he]),d_(()=>{H.current={activatorEvent:D,active:C,activeNode:L,collisionRect:pe,collisions:me,droppableRects:P,draggableNodes:v,draggingNode:te,draggingNodeRect:G,droppableContainers:b,over:ge,scrollableAncestors:ae,scrollAdjustedTranslate:fe},S.current={initial:G,translated:pe}},[C,L,me,pe,v,te,G,P,b,ge,ae,fe]),Bv({...z,delta:y,draggingRect:pe,pointerCoordinates:ce,scrollableAncestors:ae,scrollableAncestorRects:oe});let q=(0,X.useMemo)(()=>({active:C,activeNode:L,activeNodeRect:B,activatorEvent:D,collisions:me,containerNodeRect:V,dragOverlay:W,draggableNodes:v,droppableContainers:b,droppableRects:P,over:ge,measureDroppableContainers:F,scrollableAncestors:ae,scrollableAncestorRects:oe,measuringConfiguration:M,measuringScheduled:I,windowRect:ie}),[C,L,B,D,me,V,W,v,b,P,ge,F,ae,oe,M,I,ie]),Se=(0,X.useMemo)(()=>({activatorEvent:D,activators:xe,active:C,activeNodeRect:B,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:ge,measureDroppableContainers:F}),[D,xe,C,B,d,A,v,ge,F]);return X.createElement(A_.Provider,{value:p},X.createElement(oy.Provider,{value:Se},X.createElement(sy.Provider,{value:q},X.createElement(py.Provider,{value:ve},i)),X.createElement(uy,{disabled:!1===n?.restoreFocus})),X.createElement(P_,{...n,hiddenTextDescribedById:A}))}),hy=(0,X.createContext)(null),gy=`button`;function _y(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=v_(`Draggable`),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,X.useContext)(oy),{role:p=gy,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,X.useContext)(g?py:hy),[v,y]=h_(),[b,x]=h_(),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=p_(n);return d_(()=>(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!==gy)||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 vy(){return(0,X.useContext)(sy)}var yy={timeout:25};function by(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=v_(`Droppable`),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,X.useContext)(oy),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}={...yy,...i},_=p_(h??r),v=Kv({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]=h_((0,X.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=p_(t);return(0,X.useEffect)(()=>{v&&y.current&&(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,X.useEffect)(()=>(s({type:j_.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:j_.UnregisterDroppable,key:a,id:r})),[r]),(0,X.useEffect)(()=>{n!==u.current.disabled&&(s({type:j_.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 xy(e){let{animation:t,children:n}=e,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null),s=g_(n);return n||r||!s||i(s),d_(()=>{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 Sy={x:0,y:0,scaleX:1,scaleY:1};function Cy(e){let{children:t}=e;return X.createElement(oy.Provider,{value:ay},X.createElement(py.Provider,{value:Sy},t))}var wy={position:`fixed`,touchAction:`none`},Ty=e=>S_(e)?`transform 250ms ease`:void 0,Ey=(0,X.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Ty}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...wy,width:s.width,height:s.height,top:s.top,left:s.left,transform:w_.Transform.toString(d),transformOrigin:i&&r?B_(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return X.createElement(n,{className:o,style:f,ref:t},a)}),Dy=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)}},Oy={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:w_.Transform.toString(t)},{transform:w_.Transform.toString(n)}]},sideEffects:Dy({styles:{active:{opacity:`0`}}})};function ky(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return f_((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=$v(a);if(!c)return;let{transform:l}=o_(a).getComputedStyle(a),u=$_(l);if(!u)return;let d=typeof t==`function`?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Oy,...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 gv(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 Ay=0;function jy(e){return(0,X.useMemo)(()=>{if(e!=null)return++Ay},[e])}var My=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}=vy(),S=(0,X.useContext)(py),C=jy(d?.id),w=dy(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=Gv(f),E=ky({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return X.createElement(Cy,null,X.createElement(xy,{animation:E},d&&C?X.createElement(Ey,{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 Ny(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Py(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Fy(e){return e!==null&&e>=0}var Iy={scaleX:1,scaleY:1},Ly=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,...Iy}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...Iy}:a<r&&a>=i?{x:o.width+s,y:0,...Iy}:{x:0,y:0,...Iy}},Ry=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Ny(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},zy={scaleX:1,scaleY:1},By=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,...zy}: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,...zy}:r<t&&r>=a?{x:0,y:o.height+s,...zy}:{x:0,y:0,...zy}},Vy=`Sortable`,Hy=X.createContext({activeIndex:-1,containerId:Vy,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ry,disabled:{draggable:!1,droppable:!1}});function Uy(e){let{children:t,id:n,items:r,strategy:i=Ry,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=vy(),d=v_(Vy,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);d_(()=>{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:Py(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return X.createElement(Hy.Provider,{value:x},t)}var Wy=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Ny(n,r,i).indexOf(t)},Gy=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)},Ky={duration:200,easing:`ease`},qy=`transform`,Jy=w_.Transition.toString({property:qy,duration:0,easing:`linear`}),Yy={roleDescription:`sortable`};function Xy(e){let{animateLayoutChanges:t=Gy,attributes:n,disabled:r,data:i,getNewIndex:a=Wy,id:o,strategy:s,resizeObserverConfig:c,transition:l=Ky}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,X.useContext)(Hy),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}=by({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}=_y({id:o,data:x,attributes:{...Yy,...n},disabled:y.draggable}),L=function(){var e=[...arguments];return(0,X.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}(E,j),R=!!D,z=R&&!m&&Fy(f)&&Fy(g),ee=!_&&N,B=z?(ee&&z?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,V=Fy(f)&&Fy(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,H=D?.id,U=(0,X.useRef)({activeId:H,items:u,newIndex:V,containerId:d}),W=u!==U.current.items,te=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:l,wasDragging:U.current.activeId!=null}),G=function(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,X.useState)(null),s=(0,X.useRef)(n);return d_(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=nv(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:!te,index:b,node:w,rect:C});return(0,X.useEffect)(()=>{R&&U.current.newIndex!==V&&(U.current.newIndex=V),d!==U.current.containerId&&(U.current.containerId=d),u!==U.current.items&&(U.current.items=u)},[R,V,d,u]),(0,X.useEffect)(()=>{if(H===U.current.activeId)return;if(H!=null&&U.current.activeId==null)return void(U.current.activeId=H);let e=setTimeout(()=>{U.current.activeId=H},50);return()=>clearTimeout(e)},[H]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:V,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:G??B,transition:function(){if(G||W&&U.current.newIndex===b)return Jy;if(!(ee&&!S_(O)||!l)&&(R||te))return w_.Transition.toString({...l,property:qy})}()}}function Zy(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 Qy=[vv.Down,vv.Right,vv.Up,vv.Left],$y=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Qy.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 vv.Down:r.top<a.top&&t.push(n);break;case vv.Up:r.top>a.top&&t.push(n);break;case vv.Left:r.left>a.left&&t.push(n);break;case vv.Right:r.left<a.left&&t.push(n)}});let u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=U_(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=U_(r),o=i.reduce((e,t,r)=>e+z_(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(V_)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),d=W_(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=iv(u).some((e,t)=>s[t]!==e),i=eb(e,t),a=(l=t,!(!Zy(c=e)||!Zy(l))&&!!eb(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:x_(f,d)}}}var c,l};function eb(e,t){return!(!Zy(e)||!Zy(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var tb=(0,X.createContext)(null),nb=()=>{let e=(0,X.useContext)(tb);if(!e)throw Error(`PivotFieldList and PivotAreas must be inside a PivotDragContext.`);return e},rb=`pivot-root`,ib=e=>`pivot-area|${e}`,ab=(e,t)=>`pivot-chip|${e}|${t.kind}|${t.name}`,ob=e=>`pivot-row|${e}`,sb={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`)},cb={number:`DataTypeNumber`,date:`DataTypeDate`,text:`DataTypeText`,mixed:`DataTypeMixed`,blank:`DataTypeBlank`},lb=e=>{let{className:t,...n}=e,{snapshot:r}=nb(),i=K(),[a,o]=(0,X.useState)(``),{setNodeRef:s}=by({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:Kl,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)(ub,{field:e},e.name)),l.length===0&&c?(0,Z.jsx)(`div`,{className:Ql,children:i(`pivot.fields.none`)}):null]})]})},ub=e=>{let{field:t}=e,{model:n,run:r}=nb(),i=K(),a={item:{kind:`field`,name:t.name},area:null},{setNodeRef:o,listeners:s,isDragging:c}=_y({id:ob(t.name),data:a});return(0,Z.jsxs)(`label`,{ref:o,className:Q(Jl,{"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:Yl,title:t.name,children:t.name}),t.filtered?(0,Z.jsx)(M,{iconKey:`FilterToggle`,size:12,className:Zl,title:i(`pivot.chip.filtered`)}):null,(0,Z.jsx)(M,{iconKey:cb[t.dataType],size:12,className:Xl,title:i(sb[t.dataType])})]})},db=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=K(),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,iu,{"sxl-overlay":r,"sxl-dragging":i}),...d,children:[s?(0,Z.jsx)(fb,{name:t.name,label:f(`pivot.chip.rename`),onDone:e=>c?.(e)}):(0,Z.jsx)(`div`,{ref:h,className:Q(au,g),..._,children:t.name}),m?(0,Z.jsx)(M,{iconKey:`FilterToggle`,size:12,className:Zl,title:f(`pivot.chip.filtered`)}):null,o]})},fb=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:ou,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)})},pb=`pivotValueSettings`,mb=[`page`,`row`,`column`,`values`],hb={page:C(`pivot.menu.moveTo.page`),row:C(`pivot.menu.moveTo.row`),column:C(`pivot.menu.moveTo.column`),values:C(`pivot.menu.moveTo.values`)},gb={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`)},_b=[`sum`,`count`,`average`,`max`,`min`,`product`],vb=(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(ab(e,n)),s(o.place(n,e,t))},h=[];if(n.kind===`data`){let e=_b.includes(n.function)?_b:[..._b,n.function];h.push(e.map(e=>p(`function.${e}`,c(gb[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=mb.filter(e=>e!==r&&(n.kind!==`values`||e===`row`||e===`column`));if(h.push(v.map(e=>p(`moveTo.${e}`,c(hb[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},yb=e=>(0,Z.jsx)(`div`,{role:`menu`,className:cu,children:e.groups.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(`div`,{role:`separator`,className:du}):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:lu,onClick:e.run,children:[(0,Z.jsx)(`span`,{className:uu,children:e.checked?(0,Z.jsx)(M,{iconKey:`Check`,size:14}):null}),e.label]},e.key))]},t))}),bb=e=>(0,Z.jsx)(yb,{...e}),xb={placement:`bottom-end`,offsets:{mainAxis:2}},Sb=[`page`,`column`,`row`,`values`],Cb={page:C(`pivot.area.page`),column:C(`pivot.area.column`),row:C(`pivot.area.row`),values:C(`pivot.area.values`)},wb=e=>{let{className:t,...n}=e,{snapshot:r}=nb(),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,$l),...n,children:Sb.map(e=>(0,Z.jsx)(Tb,{area:e,chips:r.areas[e],refocus:e=>{a.current=e}},e))})},Tb=e=>{let{area:t,chips:n,refocus:r}=e,i=K(),{setNodeRef:a,isOver:o}=by({id:ib(t),data:{area:t}}),s=n.map(e=>ab(t,e)),c=i(Cb[t]);return(0,Z.jsxs)(`div`,{className:eu,children:[(0,Z.jsx)(`div`,{className:tu,children:c}),(0,Z.jsx)(Uy,{id:ib(t),items:s,strategy:By,children:(0,Z.jsxs)(`div`,{ref:a,role:`list`,"aria-label":c,className:Q(nu,{"sxl-over":o}),children:[n.map((e,i)=>(0,Z.jsx)(Eb,{id:s[i],area:t,chip:e,index:i,count:n.length,refocus:r},s[i])),n.length===0?(0,Z.jsx)(`span`,{className:ru,children:i(`pivot.area.hint`)}):null]})})]})},Eb=e=>{let{id:t,area:n,chip:r,index:i,count:a,refocus:o}=e,{model:s,run:c,renderMenu:l,renderFilter:u}=nb(),{attributes:d,listeners:f,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:g,isDragging:_}=Xy({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=K(),c=U(),l=q(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?.(pb,i)},[n,r,c]),u=i===void 0?bb:i,[d,f]=(0,X.useState)(null),p=q(e=>{let t=d?n.getPivotTable().getField(d):null;if(!a||!t)return null;let r={fields:[t],floatReference:e.floatReference??y.reference};return Me({...e,children:(0,Z.jsx)(We,{render:a,props:r})})},[d,n,a]),m=q(e=>{f(e),y.reference.open(0)},[]),h=q(e=>{let i={chip:t.chip,area:t.area,groups:vb(t,{model:n,run:r,t:s,close:()=>{e.closeFloat?.()},focus:o,openValueSettings:l,openFilter:a?m:null}),floatReference:e.floatReference??v.reference};return Me({...e,children:(0,Z.jsx)(We,{render:u,props:i})})},[t,n,r,u,s,o,l,m,a]),[g,_]=(0,X.useState)(null),v=ze({label:`pivot-chip-menu`,anchor:g,propsPopper:xb,renderPopupPanel:h}),y=ze({label:`pivot-chip-filter`,anchor:g,propsPopper:xb,renderPopupPanel:p});return u?{button:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{ref:_,type:`button`,className:su,"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)(db,{ref:p,role:`listitem`,chip:r,area:n,dragging:_,style:{transform:w_.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(ab(n,{...r,name:e})),c(s.rename(r,e)))}})},Db=e=>{let{fields:t,onError:n,renderMenu:r,renderFilter:i,children:a,...o}=e,{model:s,snapshot:c}=t,l=q(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=L_(I_(Mv,{activationConstraint:{distance:4}}),I_(Dv,{coordinateGetter:$y})),[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)(db,{chip:e,area:f.area??`row`,overlay:!0})}return(0,Z.jsx)(tb.Provider,{value:u,children:(0,Z.jsx)(my,{sensors:d,collisionDetection:Ab,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)(Ob,{...o,children:[a,(0,Z.jsx)(My,{dropAnimation:null,children:m})]})})})},Ob=e=>{let{setNodeRef:t}=by({id:rb});return(0,Z.jsx)(`div`,{ref:t,...e})},kb=e=>e===`pivot-root`?2:e===`pivot-list`||String(e).startsWith(`pivot-area|`)?1:0,Ab=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&&Y_(r,a)){let n=U_(a).reduce((e,t)=>e+z_(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(V_)})(e).sort((e,t)=>kb(e.id)-kb(t.id)):K_({...e,droppableContainers:e.droppableContainers.filter(e=>e.id!==rb)}),jb=e=>{let{className:t,...n}=e;return(0,Z.jsxs)(Db,{className:Q(`sxl-pivot-fields`,t,Gl),...n,children:[(0,Z.jsx)(lb,{}),(0,Z.jsx)(wb,{})]})},Mb=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=U(),m=K(),[h,g]=(0,X.useState)(()=>r?.pivot??(f?Hl(f):null));(0,X.useEffect)(()=>{r?.pivot&&g(r.pivot)},[r?.pivot]),(0,X.useEffect)(()=>{if(f)return f.getSelection().addListeners({onChange:()=>g(Hl(f))})},[f]);let _=$g(h),v=e=>{p.showError?.(e instanceof Error?e:String(e))},y;return y=_?_.snapshot.deleted?(0,Z.jsx)(`div`,{className:mu,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:pu,children:_.snapshot.name}),(0,Z.jsx)(jb,{fields:_,renderMenu:i,renderFilter:a,onError:v})]}):(0,Z.jsx)(`div`,{className:mu,children:m(`pivot.pane.empty`)}),(0,Z.jsx)(`div`,{ref:c,className:Q(`sxl-pivot-table-pane`,u,fu),...d,children:y})};function Nb(){Cd.getRegisteredTaskPane(wd.PivotTable)||Cd.registerTaskPane({key:wd.PivotTable,component:Mb})}var Pb=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}`},Fb=(e,t)=>t?.at(0)?.getWorksheet()??e,Ib=(e,t)=>e?[t]:[],Lb=new Set([`formatTextRotate0`,`formatTextRotate45`,`formatTextRotate90`,`formatTextRotate270`,`formatTextRotate315`,`formatTextRotateCustom`,`formatTextRotateVertical`]),Rb={autoSelect:!0,autoFit:{axes:Y.AxisSelection.Column,expandOnly:!0,skipCustomSize:!0}},zb=new Set([`dataTextToColumns`,`sortAscending`,`sortDescending`,`sheetBackgroundDelete`]),Bb=new Set([`editNote`,`showHideNote`,`showAllNotes`,`deleteComments`,`updateComments`,`convertNotesToComments`,`clearComments`,`clearNotes`]),Vb=[`conditionalFormatGreaterThan`,`conditionalFormatLessThan`,`conditionalFormatBetween`,`conditionalFormatEqualTo`,`conditionalFormatTextContains`,`conditionalFormatDateOccurring`,`conditionalFormatDuplicateValues`,`conditionalFormatTopItems`,`conditionalFormatTopPercent`,`conditionalFormatBottomItems`,`conditionalFormatBottomPercent`,`conditionalFormatAboveAverage`,`conditionalFormatBelowAverage`],Hb=new Set([`fillDown`,`fillRight`,`fillUp`,`fillLeft`,`fillSeries`,`clearContents`,`clearAll`,`insertImageInCellFromFile`,`insertImageInCellFromURL`]);function Ub(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:()=>({...Gb(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()===er.HeaderTextStyle.Zero&&e.getRowHeaderStyle()===er.HeaderTextStyle.Zero;e.update({columnHeaderStyle:t?er.HeaderTextStyle.A1:er.HeaderTextStyle.Zero,rowHeaderStyle:t?er.HeaderTextStyle.One:er.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();ig(r(),Y.Axis.Row,i()?0:e.rowIndex)}}),e.updateCommand(`freezeToggleVertical`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();ig(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&&ig(r(),e.axis,e.index)}});let o=()=>{let n=r(),o=n.getColumnHeaderStyle()===er.HeaderTextStyle.Zero&&n.getRowHeaderStyle()===er.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 Wb=new yn(`transparent`);function Gb(e){let t=e.getStyles();return{schemeLookup:t.schemeLookup(),recentColors:()=>t.recentColors(),addRecentColor:e=>t.addRecentColor(e),clearRecentColors:()=>t.clearRecentColors()}}function Kb(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 qb(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 Jb(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}),dn(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()===wd.Comments;e.updateCommand(`updateComments`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell(),r=e.getComments();if(r?.isNote())return;if(i()||!Gm(t))return void n?.(wd.Comments,{args:r?{focus:r}:{insert:!0}});let a=e.getCoords();a&&Hm(t,a)}});let a=async e=>{let n=t.getComments().getItems({notes:!1}).sort(Gg);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=Wg(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=Wg(a);await t.getRange(w.cellToRange(o)).select(),!i()&&Gm(t)&&Hm(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(wd.Comments):n?.(wd.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:qg(r,wd.Comments)})};o();let s=r?.addListener({onChange:o}),c=()=>{let n=!t.getProtection().isObjectsAllowed(),r=Ib(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:Ib(!!a,C(`reason.cellHasNote`)),params:{thread:i&&!a?`yes`:`no`}});let c=Ib(o.length===s,C(`reason.noComments`));e.updateCommand(`previousComment`,{disabledReasons:c}),e.updateCommand(`nextComment`,{disabledReasons:c});let l=Ib(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:Ib(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:Ib(!d,C(`reason.noCommentsSelected`))}),e.updateCommand(`clearNotes`,{disabledReasons:[...r,...Ib(!f,C(`reason.noNotesSelected`))]}),e.updateCommand(`editNote`,{disabledReasons:[...r,...Ib(!!i&&!a,C(`reason.cellHasThread`))],params:{note:a?`yes`:`no`}}),e.updateCommand(`showHideNote`,{disabledReasons:[...r,...Ib(!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 Yb(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?.(wd.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=[...Ib(!t.getProtection().isFormatCellsAllowed(),C(`reason.sheetProtected`)),...Ib(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,...Ib(r.length>0,C(`reason.alreadyTable`))]})};l();let u=()=>{e.updateCommand(`editTable`,{state:i?.getActive()===wd.TableDetails,disabledReasons:qg(i,wd.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 Xb(e,t,n,r,i){let a=e=>(e&&!e.isDeleted()?e:null)??Hl(t),o=e=>{Nb(),r?.(wd.PivotTable,{args:{pivot:e}})},s=(e=>({validateName:(t,n)=>{if(t.length===0||t.length>255)throw new k(j(`error.pivotTable.nameInvalid`));if(Fb(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:Pb(t)},context:()=>s,onInput:e=>{(async e=>{if(!e?.source||!e.location)return;let n=Fb(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:ce.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:()=>Hl(t),styles:()=>t.getStyles()});e.updateCommand(`formatPivotStyle`,{callback:e=>{e&&Hl(t)?.updateStyleOptions(e)},context:c}),e.updateCommand(`formatPivotStyleClear`,{callback:()=>{Hl(t)?.updateStyleOptions({name:null})},context:c});let l=()=>{e.updateCommand(`insertPivotTable`,{disabledReasons:Ib(t.getProtection().isLocked(),C(`reason.sheetProtected`))});let n=Ib(!t.getProtection().isPivotTablesAllowed(),C(`reason.sheetProtected`));e.updateCommand(`refreshPivotTable`,{disabledReasons:n}),e.updateCommand(`deletePivotTable`,{disabledReasons:n});let r=Hl(t)?.getStyleOptions();e.updateCommand(`formatPivotStyle`,{state:r,disabledReasons:n});let i=r?.name;e.updateCommand(`formatPivotStyleClear`,{disabledReasons:[...n,...Ib(!i,C(`reason.noPivotStyle`))]})};l();let u=()=>{e.updateCommand(`editPivotTable`,{state:i?.getActive()===wd.PivotTable,disabledReasons:Ib(!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 Zb(e,t){let n=t.sheet;if(!n)return()=>{};let r=t,i=r?.notifier;e.use(pn({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?.(wd.Protection,{args:{tab:t}})}}),e.updateCommand(`manageDataValidation`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(wd.DataValidation)}}),e.updateCommand(`manageConditionalFormat`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(wd.ConditionalFormat)}}),e.updateCommand(`conditionalFormatNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(wd.ConditionalFormat,{args:{insert:!0}})}});let o=e=>{n.getConditionalFormats().add(n.getSelectedRanges(),{...e,replaceExisting:!0})},s=e=>({tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(wd.ConditionalFormat,{args:{draft:{condition:e,style:structuredClone(Sp[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):Fp()})}}),e.updateCommand(`conditionalFormatColorScale`,{callback:e=>{o({scale:e?structuredClone(e):Pp()})}}),e.updateCommand(`conditionalFormatIconSet`,{callback:e=>{o({scale:e?structuredClone(e):Lp()})}}),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?.(wd.DataValidation,{args:{insert:!0}})}}),e.updateCommand(`dataValidationList`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=Hn.BuiltInOperators.InSet,t=e.createDefaultParam(void 0,{ranges:n.getSelectedRanges()});r?.activateTaskPane?.(wd.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:zn.AlertStyle.Stop,showAlertMessage:!0})}}),e.updateCommand(`dataValidationClearSelection`,{callback:()=>{n.getSelectedRanges().clear(ir.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?.(wd.Protection,{args:{tab:`ranges`,items:{insert:!0}}})}}),e.updateCommand(`manageProtectedRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r?.activateTaskPane?.(wd.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=Ib(a,C(`reason.sheetProtected`)),s=r?.taskPaneArea,c=qg(s,wd.ConditionalFormat),l=qg(s,wd.DataValidation),u=qg(s,wd.Protection),d=t.isPaused(),p=i||d;e.updateCommand(`protectionSheetToggle`,{state:p,params:{locked:p}}),e.updateCommand(`protectionSheetPause`,{state:d,params:{paused:d},disabledReasons:Ib(!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:[...Ib(i,C(`reason.sheetProtected`)),...u]}),e.updateCommand(`conditionalFormatNewRule`,{disabledReasons:[...o,...c]});let m=[...Ib(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)Lb.has(t)||zb.has(t)||Bb.has(t)||Hb.has(t)||e.updateCommand(t,{disabledReasons:o});let k=Ib(i&&!g.getCell().isEditAllowed(),C(`reason.sheetProtected`));for(let t of Hb)e.updateCommand(t,{disabledReasons:k});for(let t of Vb)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 Lb)e.updateCommand(t,{disabledReasons:[...o,...Ib(j,C(`reason.continuousSpan`))]});e.updateCommand(`dataTextToColumns`,{disabledReasons:[...o,...Ib(!x,C(`reason.singleColumn`)),...Ib(i,C(`reason.sheetLocked`))]});let M=[...o,...Ib(h.getCount()!==1,C(`reason.sortRange`))];e.updateCommand(`sortAscending`,{disabledReasons:M}),e.updateCommand(`sortDescending`,{disabledReasons:M}),e.updateCommand(`sheetBackgroundDelete`,{disabledReasons:[...o,...Ib(!n.getPicture(),C(`reason.noSheetBackground`))]});let N=Ib(!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,...Ib(!v,C(`reason.noMerge`)),...N]});let P=Ib(y,C(`reason.overlap`)),F=[...o,...Ib(D,C(`reason.entireColumn`)),...P,...Ib(E,C(`reason.mixedSelection`))],I=[...o,...Ib(T,C(`reason.entireRow`)),...P,...Ib(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,...Ib(D,C(`reason.entireColumn`)),...P,...Ib(E,C(`reason.mixedSelection`))],R=[...o,...Ib(T,C(`reason.entireRow`)),...P,...Ib(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 z=n.getOutline(),ee=Ib(i,C(`reason.sheetProtected`)),B=(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(z.getGroups(e,{from:i,to:a,level:t}).length>0)return!0}return!1},V=!D||T,H=!T||D,U=B(Y.Axis.Row),W=B(Y.Axis.Column),te=V&&U||H&&W,G=D||T?te:U||W,ne=e=>Ib(B(e,7),C(`reason.outlineTooDeep`)),re=Ib(D,C(`reason.entireColumn`)),K=Ib(T,C(`reason.entireRow`)),ie=T&&D?[...K,...re]:[],ae=Ib(V&&B(Y.Axis.Row,7)||H&&B(Y.Axis.Column,7),C(`reason.outlineTooDeep`));e.updateCommand(`group`,{disabledReasons:[...ee,...ie,...ae]}),e.updateCommand(`groupRows`,{disabledReasons:[...ee,...re,...ne(Y.Axis.Row)]}),e.updateCommand(`groupColumns`,{disabledReasons:[...ee,...K,...ne(Y.Axis.Column)]}),e.updateCommand(`ungroup`,{disabledReasons:[...ee,...ie,...Ib(!te,C(`reason.noGroup`))]}),e.updateCommand(`ungroupRows`,{disabledReasons:[...ee,...re,...Ib(!U,C(`reason.noGroup`))]}),e.updateCommand(`ungroupColumns`,{disabledReasons:[...ee,...K,...Ib(!W,C(`reason.noGroup`))]}),e.updateCommand(`showDetail`,{disabledReasons:[...o,...Ib(!G,C(`reason.noGroup`))]}),e.updateCommand(`hideDetail`,{disabledReasons:[...o,...Ib(!G,C(`reason.noGroup`))]}),e.updateCommand(`clearOutline`,{disabledReasons:[...ee,...Ib(!U&&!W,C(`reason.noGroup`))]}),e.updateCommand(`autoOutline`,{disabledReasons:ee}),e.updateCommand(`outlineSettings`,{disabledReasons:ee});let oe=r?.editModeHandler?.getMode()?.key,se=oe===`copy`?`copy`:oe===`cut`?`cut`:`none`,ce=y?1:h.getRowCount(),le=y?1:h.getColumnCount(),ue=h.getDefaultShiftAxis()===Y.Axis.Column,de=T&&!E,fe=D&&!O,pe=de?`rows`:fe?`columns`:`none`,me=fe?le:ce;e.updateCommand(`insertCells`,{params:{mode:se,shift:ue?`right`:`down`,span:pe,count:me}}),e.updateCommand(`deleteCells`,{params:{shift:ue?`left`:`up`,span:pe,count:me}}),e.updateCommand(`insertCellsShiftDown`,{params:{mode:se,span:de?`rows`:`none`,count:ce}}),e.updateCommand(`deleteCellsShiftUp`,{params:{span:de?`rows`:`none`,count:ce}}),e.updateCommand(`insertCellsShiftRight`,{params:{mode:se,span:fe?`columns`:`none`,count:le}}),e.updateCommand(`deleteCellsShiftLeft`,{params:{span:fe?`columns`:`none`,count:le}});for(let t of[`insertRows`,`insertRowsAfter`])e.updateCommand(t,{params:{mode:se,count:ce}});for(let t of[`insertColumns`,`insertColumnsAfter`])e.updateCommand(t,{params:{mode:se,count:le}});e.updateCommand(`deleteRows`,{params:{count:ce}}),e.updateCommand(`deleteColumns`,{params:{count:le}}),e.updateCommand(`hideRows`,{params:{count:h.getRowCount()}}),e.updateCommand(`hideColumns`,{params:{count:h.getColumnCount()}});let he=T===D?`both`:D?`columns`:`rows`;e.updateCommand(`group`,{params:{span:he}}),e.updateCommand(`ungroup`,{params:{span:he}})};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=Ub(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()===_n.StrikeStyle.None?_n.StrikeStyle.Single:_n.StrikeStyle.None}})}});let u=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{underline:s().getUnderline()===n?_n.UnderlineStyle.None:n}})}})};u(`formatUnderlinedToggle`,_n.UnderlineStyle.Single),u(`formatUnderlinedDoubleToggle`,_n.UnderlineStyle.Double),u(`formatUnderlinedAccountingToggle`,_n.UnderlineStyle.SingleAccounting),u(`formatUnderlinedAccountingDoubleToggle`,_n.UnderlineStyle.DoubleAccounting);let d=(t,n)=>{e.updateCommand(t,{callback:()=>{o({font:{baseline:Math.sign(s().getBaseline())===Math.sign(n)?0:n}})}})};d(`formatSuperscriptToggle`,xn.Baseline.Superscript),d(`formatSubscriptToggle`,xn.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:()=>({...Gb(t),autoColor:Wb,quickColor:r?.getLastFillColor?.()??new yn(On.Scheme.Bg2,t.getStyles().schemeLookup()),onColorSelect:e=>r?.setLastFillColor?.(e??Wb)})}),e.updateCommand(`formatFontColor`,{context:()=>({...Gb(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:bn.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:Tn.findNextFontSize(e.getFont().getSize(),!0)}}))}}),e.updateCommand(`formatFontSizeDecrease`,{callback:()=>{o(e=>({font:{size:Tn.findNextFontSize(e.getFont().getSize(),!1)}}))}}),e.updateCommand(`formatNumberFormat`,{callback:e=>{o({numberFormat:e})}}),e.updateCommand(`formatNumberFormatGeneralStyle`,{callback:()=>{o({numberFormat:Cn.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:Dn.BuiltInName.Currency})}}),e.updateCommand(`formatNumberFormatPercentStyle`,{callback:()=>{o({named:Dn.BuiltInName.Percent})}}),e.updateCommand(`formatNumberFormatScientificStyle`,{callback:()=>{o({numberFormat:11})}}),e.updateCommand(`formatNumberFormatCommaStyle`,{callback:()=>{o({named:Dn.BuiltInName.Comma})}}),e.updateCommand(`formatNumberFormatIncreaseDecimal`,{callback:()=>{o(e=>({numberFormat:Cn.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}}),e.updateCommand(`formatNumberFormatDecreaseDecimal`,{callback:()=>{o(e=>({numberFormat:Cn.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}});let h={style:bn.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,Rb)}}),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,Rb)}}),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?.(wd.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()??Wb,context:()=>({...Gb(t),autoColor:Wb,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()!==_n.StrikeStyle.None}),e.updateCommand(`formatUnderlinedToggle`,{state:r===_n.UnderlineStyle.Single}),e.updateCommand(`formatUnderlinedDoubleToggle`,{state:r===_n.UnderlineStyle.Double}),e.updateCommand(`formatUnderlinedAccountingToggle`,{state:r===_n.UnderlineStyle.SingleAccounting}),e.updateCommand(`formatUnderlinedAccountingDoubleToggle`,{state:r===_n.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()===vn.Type.Solid?u=o.getColor():o?.getType()===vn.Type.Gradient?u=o.getStops()?.[0]?.getColor()??null:o?.getType()===vn.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=qg(a,wd.FormatCells);e.updateCommand(`formatCells`,{state:a?.getActive()===wd.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(ir.Content.Values)}}),e.updateCommand(`clearFormulas`,{callback:()=>{n(ir.Content.Formulas)}}),e.updateCommand(`clearFormats`,{callback:()=>{n(ir.Content.Formats)}}),e.updateCommand(`clearHyperlinks`,{callback:()=>{n(ir.Content.Hyperlinks)}}),e.updateCommand(`clearComments`,{callback:()=>{n(ir.Content.Comments)}}),e.updateCommand(`clearNotes`,{callback:()=>{n(ir.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=Ib(t.getProtection().isLocked()&&!t.getSelectedRange().getCell().isEditAllowed(),C(`reason.sheetProtected`)),r=t.getSelectedRanges().getCounts(`formula`).formula>0;e.updateCommand(`clearFormulas`,{disabledReasons:[...n,...Ib(!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:Ib(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=Kb(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:Qn.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`));Vs({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=qb(e,n,i),N=function(e,t,n){e.updateCommand(`updateHyperlink`,{tags:[`noTransaction`],callback:()=>{let e={disabled:!ml(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=!ml(t),i=Ib(!!n?.isReadOnly(),C(`reason.hyperlinkIsValue`));e.updateCommand(`updateHyperlink`,{disabledReasons:[...i,...Ib(r&&!n,C(`reason.sheetProtected`))]}),e.updateCommand(`deleteHyperlink`,{disabledReasons:[...i,...Ib(r,C(`reason.sheetProtected`))]});let a=t.getSelectedRanges().getCounts(`hyperlink`).hyperlink>0;e.updateCommand(`clearHyperlinks`,{disabledReasons:[...Ib(!t.getProtection().isFormatCellsAllowed(),C(`reason.sheetProtected`)),...Ib(!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&&!Xn.get(e)&&Yn.get(e)?n.setValue({type:e}):t.getCellControls().add(n,{type:e||`checkbox`})}});let i=()=>{let n=Ib(!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(wd.CellControl,{tags:[`noTransaction`,`noRepeat`],callback:()=>{Wd(),n?.(wd.CellControl)}});let o=()=>{e.updateCommand(wd.CellControl,{state:r?.getActive()===wd.CellControl})};o();let s=r?.addListener({onChange:o});return()=>{a(),s?.()}}(e,n,r?.activateTaskPane,r?.taskPaneArea),F=Jb(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:ce.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 rr(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:ce.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:Hg(e??`rect`),i=wn.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=Yb(e,n,i,r?.activateTaskPane,r?.taskPaneArea),R=Xb(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:Qb}=Ae;pf();var $b={dynamic:(e,t)=>{let n=Zb(e,t),r=t.editable&&t.sheet?Es(e,{editable:t.editable,sheet:t.sheet,flavor:`startEdit`}):void 0,i=t.ownsUndo?Wf(e,{manager:t.manager??null,notifier:t.notifier}):void 0;return()=>{n(),r?.(),i?.()}}},ex=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>Ae.useCommandScope()?(0,Z.jsx)(tx,{sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a}):(0,Z.jsx)(Z.Fragment,{children:a}),tx=({sheet:e,editable:t,scopeRef:n,elementRef:r,viewport:i,children:a})=>{let o=U(),s=Rd(),c=se(),l=Fe(),u=Kf(),[d,f]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(u||!e)return void f(null);let t=new dr(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,_]=re(`sheet.lastFillColor`,e?.getStyles().parseColor(On.Scheme.Bg2),h),[v,y]=re(`sheet.lastFontColor`,e?.getStyles().parseColor(e?.getStyles().getNormal().getFont().getColor()),h),[b,x]=re(`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:$b,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)(Qb,{spec:E,scopeRef:n,elementRef:r,children:(0,Z.jsx)(Gf.Provider,{value:p,children:a})})};tx.displayName=`SheetCommandProviderInner`;var nx=`_loading-panel_bjv3h_1`,rx=`_loading-spinner_bjv3h_10`,ix=e=>{let{transitionDelay:t,transparentBackground:n,onMount:r,onUnmount:i,className:a,style:o,...s}=e;return(0,Z.jsx)(`div`,{className:Q(nx,a),style:{background:n?`transparent`:`var(--sxl-color-base-100, #fff)`,...o},...s,children:(0,Z.jsx)(`div`,{className:rx})})},ax=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)})},ox=`_sheetxl-sheet_zorxx_5`,sx=`_viewport-overlay_zorxx_6`,cx=(0,X.memo)(e=>{let t=se();return(0,Z.jsx)(vt,{...e,dismiss:t.getMode()?.key===`edit`})});cx.displayName=`SheetRangeTooltipHost`;var lx=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i=P.EmptyCssProperties,ref:a,colorScheme:s,gridColorScheme:l,tokens:d,onSheetContextMenu:f,onFillMenu:m,showColumnHeaders:h,propsColumnHeader:g,showRowHeaders:v,propsRowHeader:y,showScrollbars:b=!0,showCellErrors:x=!0,showCircularReferences:S=!0,propsScrollPane:C,viewport:T,onViewportChange:E,layers:D,renderMovable:O=md,renderCommentCard:k,renderHyperlinkCard:A,propsHyperlink:j,renderCellErrorTip:M,renderValidationPrompt:N,renderValidationAlert:F,renderTableToolbar:I,renderPivotToolbar:R,propsOutline:z,viewportComponent:ee,onFirstRender:B,editable:H,onFocus:te,onBlur:G,propsGrid:re,propsCellRender:K,children:ie,...ae}=e;if((0,X.useEffect)(()=>{Mn._validate(!0)},[]),!n)throw Error(`IWorksheet must be provided.`);let[oe,ce]=(0,X.useReducer)(e=>e+1,0),[,le]=(0,X.useReducer)(e=>e+1,0),ue=(0,X.useRef)(null),de=(0,X.useRef)(!1),fe=(0,X.useRef)(null),pe=(0,X.useRef)(null);(0,X.useMemo)(()=>{pe.current!==n&&(fe.current=n?n.getId():null),pe.current=n},[n]);let me=Ye(l),ge=me===`dark`,_e=Ge(s);Dg();let ve=(0,X.useId)(),xe=(0,X.useMemo)(()=>Se(`sheet`,ve),[ve]),Ce=n.getStyles(),we=Ce.getTheme(),Ee=Ce.getDefaultFontSize(),De=(0,X.useMemo)(()=>{let e=Ce.getNormal().measureText(``,Ee,we.getFontScheme().getMinorFont()).lineHeight;return((e,t,n,r=`sxl-defaults`,i)=>ye({app:{light:Og(e,t,n,!1),dark:Og(e,t,n,!0)},layer:r,scope:i}))(we,Ee,e,`sxl-defaults`,`.${xe}`)},[Ce,we,Ee,xe]),Oe=se(),ke=(0,X.useCallback)(e=>{},[]),[Ae,je]=(0,X.useState)(null),Me=(0,X.useRef)(null),Pe=(0,X.useCallback)(e=>{e&&(je(e),Me.current=e)},[]),[Fe,Ie]=(0,X.useState)(()=>n?.getView()),Le=(Fe?.getZoomScale()??100)/100,ze=h??Fe?.isShowColumnHeaders(),Be=v??Fe?.isShowRowHeaders(),[Ve,He]=(0,X.useState)({width:0,height:0}),Ue=Ve.width,We=Ve.height,Ke=(0,X.useMemo)(()=>{let e=_x,t=gx,r=n?.getStyles().getNormal().getFont();if(Ve.width>0&&Ve.height>0){let n=r?.toCSS()?.fontFamily??`Calibri`,i=r?.getSize()??8.25,a=nr.getShared().getByName(n).table.measure(``+Math.max(Ve.height,vx),Math.ceil(i*_n.getDeviceScale()));e=a.width??e,t=(a.ascent??a.lineHeight)+(a.descent??0)}return{width:Math.round(e+2*yx+1),height:Math.round(t+3)}},[Ue,We,n]),qe=e=>({width:Be?e*Ke.width:1,height:ze?e*Ke.height:1}),{width:Xe,height:Ze}=qe(Le),[,Qe]=(0,X.useReducer)(e=>e+1,0);o(n?.getOutline(),{onOutlineChange:()=>Qe()});let $e=n?.getOutline(),[et,tt]=(0,X.useState)(()=>n?.getView().isShowOutlineSymbols()??!1);(0,X.useLayoutEffect)(()=>{tt(n?.getView().isShowOutlineSymbols()??!1)},[n]),o(n?.getView(),{onAnyChange:()=>{tt(n.getView().isShowOutlineSymbols())}});let nt=et?$e.getLevelCount(Y.Axis.Row):0,rt=et?$e.getLevelCount(Y.Axis.Column):0,it=e=>Math.round((z?.laneSize??bx)*e),at=it(Le),ot=nt>0?nt+1:0,st=rt>0?rt+1:0,lt=z?.laneGap??1,ut=e=>{let t=it(e);return{width:ot>0?lt+ot*t:0,height:st>0?lt+st*t:0}},{width:dt,height:ft}=ut(Le),pt=e=>{let t=qe(e),n=ut(e);return{left:t.width+n.width,top:t.height+n.height}},[mt]=mg(n.getColumnHeaders()),[ht]=mg(n.getRowHeaders()),gt=mt.getDefaultSize()+Xe+1,vt=ht.getDefaultSize()+Ze+1,yt=(0,X.useRef)(new Map),xt=(0,X.useRef)(null),St=(0,X.useMemo)(()=>({getColOffset:e=>mt.getOffset(e),getColIndex:e=>mt.getIndex(e),getRowOffset:e=>ht.getOffset(e),getRowIndex:e=>ht.getIndex(e)}),[mt,ht]),[Ct,wt]=(0,X.useState)(!1),Tt=ya(),Ot=(0,X.useMemo)(()=>Ma(n,{referenceMode:Tt}),[n.getWorkbook()??n,Tt]),kt=H??Ot,At=U();(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=Me.current;n?.contains(document.activeElement)&&n.focus()})},[kt]);let jt=Te(kt,e=>e.getSession())?.getCoords()??null,[Mt,Nt]=(0,X.useState)();(0,X.useEffect)(()=>{if(n&&!n.isDeleted())return n.getEntireRange().addListener(()=>{sn.current.clear()})},[n]);let Pt=q(e=>{if(Nt(e),!n||fe.current)return;let t=(n.getView().getZoomScale()??100)/100;n.getView().setTopLeft(e?{left:e.left/t,top:e.top/t}:null),E?.(e)},[n,E]),[Ft,It]=(0,X.useState)(()=>n?.getView().getTopLeft()),Rt=(0,X.useMemo)(()=>{let e=n?.getView().getTopLeft();return new he({topLeft:{left:(e?.left??0)*Le,top:(e?.top??0)*Le},zoom:Le})},[]),zt=T??Rt;(0,X.useEffect)(()=>zt.subscribe(()=>{zt.isReady()&&zt.isSettled()&&(de.current?zt.getScroll():Pt(zt.getMetrics()))}),[zt]);let Bt=(0,X.useRef)(Ft);Bt.current=Ft,(0,X.useLayoutEffect)(()=>{let e=Bt.current;zt.setZoom(Le,(e?.left??0)*Le,(e?.top??0)*Le)},[zt,Le]),(0,X.useLayoutEffect)(()=>{Ft?.left!=null&&zt.setTarget(Ft.left*Le,zt.getTarget().top)},[zt,Ft?.left,Le]),(0,X.useLayoutEffect)(()=>{Ft?.top!=null&&zt.setTarget(zt.getTarget().left,Ft.top*Le)},[zt,Ft?.top,Le]),(0,X.useLayoutEffect)(()=>{de.current=!1},[Le]);let Vt=(0,X.useRef)(n?.getId()??null);(0,X.useLayoutEffect)(()=>{let e=n?.getId();if(Vt.current===e)return;Vt.current=e;let t=n?.getView().getTopLeft(),r=(n?.getView().getZoomScale()??100)/100;zt.setTarget((t?.left??0)*r,(t?.top??0)*r)},[zt,n]);let Ht=q(e=>{let t=w.cellToRange(e);if(fe.current||n.isDeleted())return t;let r=n.getRange(t,{ignoreHidden:!0}).getMerges();return r.length===0?t:r[0]},[n]),Ut=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},[Wt,Gt]=(0,X.useState)(()=>Ut(n.getView().getFreezePanes())),Kt=As(n),qt=q(()=>Mt,[Mt]),[Jt,Xt]=(0,X.useState)(!(Fe?.getMovableSelection().isEmpty()??1)),Zt=jt!==null||Jt,Qt=(0,X.useMemo)(()=>{let e=Oe.getMode();return e?.cursor?e.cursor:null},[null,Oe]);o(n?.getView(),{onFreezePaneChange:()=>{Gt(Ut(n.getView().getFreezePanes()))},onTopLeftChange:()=>{It(n.getView().getTopLeft())},onZoomScaleChange:()=>{sn.current.clear(),le()},onMovableSelectionChange:()=>{Xt(!n.getView().getMovableSelection().isEmpty())}}),o(n,{onViewChange(){Ie(n.getView())},onLayoutChange:()=>{let e=n.getEntireRange();He({height:e.getRowCount(),width:e.getColumnCount()}),en()},onStyleChange:()=>{en()},onMovablesChange:()=>{},onTablesChange:()=>{en()},onInvalidated:()=>{en()}}),o(n,{onRequestScrollIntoView:async(e,t)=>{if(!t)return!1;let n={colIndex:t?.coords?.colStart,rowIndex:t?.coords?.rowStart};return await Me.current?.scrollCellCoordsIntoView(n,t?.scroll),!0},onRequestFocus:()=>p.whenFocus($t.current),onRequestViewport:async()=>{let e=qt();return e?{x:e.left,y:e.top,width:e.width,height:e.height}:null}},mx);let $t=Ne(t,()=>{let e=e=>{xt.current=null,Me.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=Me.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=yt.current?.get(i);return o?.current?(await o.current.focusMovable(e),!0):(xt.current={movable:e,anchor:i},!0)};return{getGridSurface:()=>Me.current,getRowHeaderElement:()=>vn.current,getColumnHeaderElement:()=>bn.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=>Me.current?.contains?.(e)??!1,invalidate:en,isSheetElement:()=>!0,getWorksheet:()=>n}},[n]),en=(0,X.useCallback)(()=>{fe.current||(sn.current.clear(),Me.current?.invalidate(),ce?.())},[]),tn=(0,X.useMemo)(()=>ee?(0,Z.jsx)(`div`,{className:Q(`sxl-viewport-overlay`,sx),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`},children:ee}):(0,Z.jsx)(Z.Fragment,{}),[ee]),nn=null;ze&&Be&&(nn=(0,Z.jsx)(Bg,{width:Xe,height:Ze,sheet:n,colorScheme:_e,style:{gridColumn:`2 / 3`,gridRow:`2 / 3`},onMouseDown:e=>{e.nativeEvent.which===V.Right?f?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Me.current?.focus()}}));let rn=q(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=zt.getTarget();zt.setTarget(e.left-a,e.top-o)}return}let s=r/100,c=i/100,l=ue.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=pt(s),m=pt(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,de.current=!0,t.setTopLeft(v),t.setZoomScale(i)},[n]);(0,X.useEffect)(()=>zt.subscribeZoom(rn),[zt,rn]),(0,X.useEffect)(()=>{Ie(n.getView()),Gt(Ut(n.getView().getFreezePanes())),sn.current.clear(),ce()},[Ae,n?.getView()]);let an=(0,X.useCallback)((e,t)=>ht.hiddenHeadersAt(e,t),[ht]),on=(0,X.useCallback)((e,t)=>mt.hiddenHeadersAt(e,t),[mt]),sn=(0,X.useRef)(new Map),cn=(0,X.useMemo)(()=>({entries:[]}),[n]),ln=q((e,t)=>{if(fe.current)return[];let r=sn.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()||Fe.isShowFormulas()&&e.getFormula()!==null)return!0;let n=e.getValue();return n!==null&&!(!Fe.isShowZeros()&&n===0&&e.getType()===jn.Number)})(r))return;let i;Fe.isShowFormulas()||(i=r.getExtrusions()??void 0),s.push({cell:n,value:r,range:i})},hx),r.set(a,s),r.size>12){let e=r.keys().next().value;e!==void 0&&r.delete(e)}return s},[n,Fe.isShowZeros(),Fe.isShowFormulas()]),un=(0,X.useMemo)(()=>_t(),[]),dn=ct(un,Zh(Y.Axis.Column),!1),fn=ct(un,Zh(Y.Axis.Row),!1),pn=(0,X.useMemo)(()=>({...be(`app`,_e),propsPath:Sx}),[_e]),mn=(0,X.useMemo)(()=>({...be(`app`,_e),propsPath:Cx}),[_e]),hn=dn?mn:pn,gn=fn?mn:pn,vn=(0,X.useRef)(null),yn=(0,X.useMemo)(()=>(0,Z.jsx)(Fg,{ref:vn,tabIndex:-1,freezeStart:Wt?.[_.Top],oppositeSize:Xe,sheetHeader:n.getRowHeaders(),colorScheme:_e,propsCellRender:K,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),viewport:zt,onSheetContextMenu:f,onFocus:()=>{Me.current?.focus()},style:{position:`relative`,flex:`0`,gridColumn:`2 / 3`,gridRow:`3 / 4`,zIndex:1}}),[Xe,Ze,n,K,zt,Wt?.[_.Top],f,y,Ae,_e]),bn=(0,X.useRef)(null),xn=(0,X.useMemo)(()=>(0,Z.jsx)(Fg,{ref:bn,tabIndex:-1,freezeStart:Wt?.[_.Left],oppositeSize:Ze,sheetHeader:n.getColumnHeaders(),colorScheme:_e,propsCellRender:K,viewport:zt,onSheetContextMenu:f,onFocus:()=>{Me.current?.focus()},style:{position:`relative`,display:`flex`,gridColumn:`3 / 4`,gridRow:`2 / 3`,zIndex:1}}),[Ze,n,K,zt,Wt?.[_.Left],f,g,Ae,_e]),Sn=mh(),Cn=vh(n,`cells`,Sn),wn=(0,X.useMemo)(()=>{let e=n.getId();return[(0,Z.jsx)(Ls,{sheet:n,editable:kt,onEditRejected:Kt},`editor-start-[${e}]`),(0,Z.jsx)(Rs,{editable:kt},`virtual-keyboard-[${e}]`),(0,Z.jsx)(ug,{sheet:n,onSheetContextMenu:f},`context-menu-[${e}]`),(0,Z.jsx)(qu,{sheet:n},`background-[${e}]`),(0,Z.jsx)(Uu,{sheet:n,sheetView:Fe,getVisibleCells:ln,bordersCache:cn},`gridlines-[${e}]`),(0,Z.jsx)(vc,{getVisibleCells:ln,sheet:n},`fills-[${e}]`),(0,Z.jsx)(nm,{sheet:n},`conditional-bars-[${e}]`),(0,Z.jsx)(Ll,{sheet:n,sheetView:Fe,propsCellRender:K,editable:kt,onEditRejected:Kt},`cells-[${e}]`),(0,Z.jsx)(mm,{sheet:n,darkMode:ge},`sparklines-[${e}]`),(0,Z.jsx)(Il,{getVisibleCells:ln,bordersCache:cn,sheet:n},`cell-borders-[${e}]`),(0,Z.jsx)(am,{sheet:n},`conditional-icons-[${e}]`),(0,Z.jsx)(xp,{sheet:n},`spill-[${e}]`),(0,Z.jsx)(Am,{sheet:n},`cell-indicators-[${e}]`),(0,Z.jsx)(Ih,{sheet:n,sheetView:Fe},`locked-hatch-[${e}]`),S?(0,Z.jsx)(Em,{sheet:n},`circular-[${e}]`):null,(0,Z.jsx)(Cu,{sheet:n},`pivot-frame-[${e}]`),(0,Z.jsx)(Ks,{sheet:n,onFillMenu:m},`selection-[${e}]`),(0,Z.jsx)(Uf,{sheet:n,renderToolbar:I},`table-[${e}]`),(0,Z.jsx)($f,{sheet:n},`table-commands-[${e}]`),(0,Z.jsx)(dp,{sheet:n},`sparkline-commands-[${e}]`),(0,Z.jsx)(bp,{sheet:n},`pivot-commands-[${e}]`),(0,Z.jsx)(nc,{sheet:n,sheetView:Fe,className:`sxl-references`},`ref-picker-[${e}]`),(0,Z.jsx)(Tg,{sheet:n},`clipboard-[${e}]`),(0,Z.jsx)(Rl,{sheet:n,onColumnButtonMouseDown:K?.onColumnButtonMouseDown,propsColumnButton:K?.propsColumnButton,renderColumnButton:K?.renderColumnButton},`column-buttons-[${e}]`),(0,Z.jsx)(Su,{sheet:n,onPivotButtonMouseDown:K?.onPivotButtonMouseDown},`pivot-controls-[${e}]`),(0,Z.jsx)(zu,{sheet:n,renderToolbar:R},`pivot-toolbar-[${e}]`),(0,Z.jsx)(gm,{sheet:n},`validation-[${e}]`),(0,Z.jsx)(Zc,{sheet:n,editable:kt,renderPrompt:N,renderAlert:F},`validation-prompt-[${e}]`),(0,Z.jsx)(xm,{sheet:n,editable:kt},`validation-dropdown-[${e}]`),(0,Z.jsx)(Zm,{sheet:n},`comments-[${e}]`),k?(0,Z.jsx)(sh,{sheet:n,renderCard:k},`comment-card-[${e}]`):null,(0,Z.jsx)(Df,{sheet:n,renderMovable:O},`movable-[${e}]`),(0,Z.jsx)(Yt,{className:`sxl-grid-border`,children:(0,Z.jsx)(bt,{fill:!0,className:`sxl-grid-border-box`,...be(`app`,_e),style:wx})},`grid-border-[${e}]`),(0,Z.jsx)(Fs,{sheet:n,editable:kt,darkMode:ge},`editor-[${e}]`),x?(0,Z.jsx)(pl,{className:`sxl-errors`,sheet:n,renderTip:M},`cell-errors-[${e}]`):null,(0,Z.jsx)(xl,{sheet:n,renderCard:A,...j},`hyperlink-card-[${e}]`),(0,Z.jsx)(Yh,{sheet:n},`resize-indicator-[${e}]`),(0,Z.jsx)(sg,{sheet:n},`freeze-grip-[${e}]`),D,...Cn,(0,Z.jsx)(cx,{},`range-tooltips-[${e}]`)]},[n,Ce,O,k,A,j,M,N,F,I,R,f,m,D,Cn,kt,x,S,Fe,ge,_e,ln,cn,K,Kt]),J=(0,X.useCallback)((e,t)=>(0,Z.jsx)(cf,{pane:e,children:t}),[]),[Tn,En]=(0,X.useState)(!1),Dn=(0,X.useMemo)(()=>{let e=n.getStyles().getNormal(),t=e.getFont(),r=e.getFill();return(0,Z.jsx)(lh,{value:`cells`,children:(0,Z.jsx)(Et,{className:`sheetxl-sheet-primary`,wrapPane:J,style:{...px,cursor:Qt??null??`cell`,...r.toCSS(`adaptive`),...t.toCSS(`adaptive`,Le),minWidth:gt,minHeight:vt},ref:Pe,...re,onFirstRender:e=>{En(!0),re?.onFirstRender?.(e)},freezeLeft:Wt?.[_.Left],propsFreezeLeft:hn,freezeTop:Wt?.[_.Top],propsFreezeTop:gn,columnCount:Ve.width,rowCount:Ve.height,metrics:St,getRangeFromCell:Ht,hiddenRowsAt:an,hiddenColumnsAt:on,viewport:zt,children:wn},`grid-main`)})},[Ue,We,Qt,null,gt,vt,oe,wn,hn,gn]);(0,X.useEffect)(()=>{fe.current||sn.current.clear()},[Wt,Le,re,gt,vt,Qt,wn,null]),(0,X.useEffect)(()=>{fe.current||ce()},[Wt,Le,Ft?.left,Ft?.top,re,gt,vt,Qt,wn,null]);let On=fx;b||(On={...On,...i});let kn=ge?`dark`:`light`,An=q(e=>{let{style:t,...r}=e;return(0,Z.jsx)(Mg,{...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}=z??{},c=(e,t)=>({...o,gridColumn:e,gridRow:t,position:`relative`}),l=[];return ot>0&&(l.push((0,Z.jsx)(Ig,{...s,sheet:n,axis:Y.Axis.Row,lanes:ot,thickness:dt,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Wt?.[_.Top],viewport:zt,colorScheme:_e,style:c(`1 / 2`,`3 / 4`)},`outline-row`)),ze&&l.push((0,Z.jsx)(Lg,{...s,sheet:n,axis:Y.Axis.Row,lanes:ot,laneSize:at,laneGap:i,renderLevelButton:t,colorScheme:_e,style:c(`1 / 2`,`2 / 3`)},`outline-row-levels`))),st>0&&(l.push((0,Z.jsx)(Ig,{...s,sheet:n,axis:Y.Axis.Column,lanes:st,thickness:ft,renderButton:e,laneGap:i,bracketGap:a,freezeStart:Wt?.[_.Left],viewport:zt,colorScheme:_e,style:c(`3 / 4`,`1 / 2`)},`outline-column`)),Be&&l.push((0,Z.jsx)(Lg,{...s,sheet:n,axis:Y.Axis.Column,lanes:st,laneSize:at,laneGap:i,renderLevelButton:t,colorScheme:_e,style:c(`2 / 3`,`1 / 2`)},`outline-column-levels`))),l},[n,ot,st,dt,ft,at,Wt?.[_.Top],Wt?.[_.Left],zt,_e,z,Be,ze]),Pn=(0,Z.jsxs)(`div`,{...be(`grid`,kn),style:{gridColumn:`3 / 4`,gridRow:`3 / 4`,overflow:`hidden`,position:`relative`},ref:ue,children:[Dn,tn,(0,Z.jsx)(pg,{style:{position:`absolute`,right:24,bottom:4},colorLicensee:`var(--sxl-color-primary)`,colorCredits:`var(--sxl-color-base-content)`})]}),Fn=u([$t,ke]),In=(0,Z.jsxs)(`div`,{className:xe,style:On,onTouchStart:()=>{zn()},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(wt(!0),te?.(e))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(wt(!1),G?.(e))},ref:Fn,...ae,children:[(0,Z.jsx)(ti,{scopeClass:xe,tokens:d}),(0,Z.jsx)(W,{css:De}),(0,Z.jsx)(`div`,{className:Q(r,`sheetxl-sheet`,ox),ref:a,...be(`grid`,kn),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)(Dt,{store:un,children:(0,Z.jsxs)(hh,{value:Sn,children:[ie,Nn,nn,xn,yn,Pn]})})})]});b&&(In=(0,Z.jsx)(L,{style:{flex:`1 1 100%`,width:`100%`,height:`100%`,overflow:`hidden`,background:`var(--sxl-color-base-100)`,minHeight:2*Ke.height,minWidth:2*Ke.width,...i},viewport:zt,disableTouch:Zt,zoomable:!0,renderScrollbarHorizontal:An,renderScrollbarVertical:An,...C,children:In})),(0,X.useEffect)(()=>{fe.current=null,sn.current.clear(),ce?.(),Ct&&$t.current?.focus()},[n]);let[Ln,Rn]=(0,X.useState)(!1),zn=q(()=>{Ln||Rn(!0)},[Ln]);return(0,X.useEffect)(()=>{if(Tn)return typeof B==`function`&&B(),P.detectIt().primaryInput===`touch`&&zn(),()=>{}},[B,Tn,Ln]),(0,Z.jsx)(ex,{sheet:n,editable:H,elementRef:$t,viewport:zt,children:(0,Z.jsx)(Je.Provider,{value:me,children:(0,Z.jsx)(ne,{themeScopeClass:xe,themeSurface:`app`,themeMode:_e,children:(0,Z.jsx)(Lt,{children:(0,Z.jsx)(c,{sheet:n,children:(0,Z.jsx)(Re,{scope:n.getWorkbook(),children:In})})})})})})}));lx.displayName=`WorksheetElementBody`;var ux=e=>{let[t,n]=(0,X.useState)(()=>g.isPromiseLike(e)||nr.getShared().isLoading()?{status:`loading`}:{status:`loaded`,sheet:e});return(0,X.useEffect)(()=>{let t=!0;return(async()=>{try{let r=await e;if(await nr.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},dx=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{sheet:n,onSheetChange:r,propsSheetLoading:i,renderSheetLoading:a=ix,renderSheetError:o=ax,...s}=e,c=ux(n),l=c.status===`loaded`?c.sheet:null,u=q(r??(()=>{}),[r]);return(0,X.useEffect)(()=>{u(l)},[l]),l?(0,Z.jsx)(Sf,{children:(0,Z.jsx)(lx,{...s,sheet:l,ref:t})}):(0,Z.jsx)(`div`,{className:e.className,style:{position:`relative`,...e.style},children:c.status===`error`?(0,Z.jsx)(We,{render:o,props:{error:c.error}}):(0,Z.jsx)(We,{render:a,props:{...i}})})}));dx.displayName=`WorksheetElement`;var fx=Object.freeze({flex:`1 1 100%`,width:`100%`,height:`100%`,minWidth:0,minHeight:0,display:`flex`,alignContent:`stretch`,position:`relative`}),px={position:`absolute`,top:0,left:0,bottom:0,right:0},mx={ignoreModelChange:!0},hx={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0,features:cc},gx=20,_x=40,vx=100,yx=4,bx=18,xx=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,Sx={stroke:`var(--sxl-color-base-border, grey)`},Cx={stroke:`var(--sxl-color-primary)`,strokeWidth:`2px`},wx={pointerEvents:`none`,borderTop:xx,borderLeft:xx,borderRight:xx,borderBottom:`none`},Tx=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`})]}),Ex=(0,X.memo)(e=>{let{kind:t,style:n,className:r}=e;return t===`chart`?(0,Z.jsx)(Tx,{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});Ex.displayName=`SheetKindIcon`;var Dx=(0,X.memo)(e=>{let{sheet:t,onFirstRender:n,style:r,...i}=e,a=K(),[,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)(Ex,{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`)})]})});Dx.displayName=`OpaqueSheetElement`;var Ox=Object.freeze([]),kx=(e,t)=>t.walk-e.walk||e.index-t.index,Ax=e=>e!==`working`,jx=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},Mx=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(kx)):Ox,t=e.length?Object.freeze(e.filter(e=>e.status===`open`&&Ax(e.intent))):Ox,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):Ox;if(t.length===0)return this._changed({type:`added`,annotations:Ox,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??jx(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`||!Ax(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(kx)):Ox}_changed(e){this._version++,this._state=null;for(let t of[...this._listeners])t(e)}},Nx=new WeakMap,Px=e=>{let t=Nx.get(e);return t||(t=new Mx(e),Nx.set(e,t)),t},Fx=Object.freeze({annotations:Ox,navigable:Ox,current:null,position:0,hovered:null,version:0}),Ix=e=>Nx.get(e)?.getState()??Fx,Lx=(e,t)=>Nx.get(e)?.remove(t)??!1,Rx=async(e,t)=>{let n=Nx.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{}},zx=(e,t)=>{let n=Nx.get(e);n&&(n.setCurrent(t),t!==null&&n.getCurrentId()===t&&Rx(e,t))},Bx=(e,t,n)=>{let r=Nx.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;zx(e,(n===1?i[(o+1)%i.length]:i[o<=0?i.length-1:o-1]).id)},Vx=(e,t)=>{Nx.get(e)?.setHovered(t)},Hx=(e,t)=>{let n=Nx.get(e);n&&n.getState().hovered?.id===t&&n.setHovered(null)},Ux=(e,t)=>Bx(e,t,1),Wx=(e,t)=>Bx(e,t,-1),Gx=(e,t)=>Px(e).subscribe(t),Kx=e=>(0,X.useSyncExternalStore)(t=>e?Gx(e,t):()=>{},()=>e?Ix(e):Fx,()=>Fx),qx={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`},Jx={t:qx.edgeTop,b:qx.edgeBottom,l:qx.edgeLeft,r:qx.edgeRight},Yx={t:{ux:0,uy:-1},b:{ux:0,uy:1},l:{ux:-1,uy:0},r:{ux:1,uy:0}},Xx={t:`b`,b:`t`,l:`r`,r:`l`},Zx=e=>{let t=e- -130;return t>180&&(t-=360),Math.round(t)},Qx=(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)),$x=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},eS=(e,t,n)=>Math.min(Math.max(e,t),n),tS=(e,t)=>{if(t.onCorner)return{ux:t.side===`left`?1:-1,uy:t.flipped?-1:1};if(t.toward&&!e.outOfView)return Yx[t.toward];let n=$x(e);if(n){let t=e.getBoundaryRect(),r=eS(e.anchorPoint.x,t.left,t.right),i=eS(e.anchorPoint.y,t.top,t.bottom),a=eS(r,n.left,n.right)-r,o=eS(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}:Yx[Xx[e.placement.side]]},nS=(e,t)=>{if(t.onCorner)return t.side===`left`?qx.leftOf:qx.rightOf;let n=tS(e,t);return Q(Math.abs(n.ux)>.3&&Jx[n.ux>0?`r`:`l`],Math.abs(n.uy)>.3&&Jx[n.uy>0?`b`:`t`])},rS=(e,t,n,r,i)=>{let a=t-n,o=e,s=eS(r,a,o),c=eS(i-n,a,o);return[s,Math.max(s,c)]},iS=(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=tS(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;_=Zx(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;_=Zx(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]=rS(e.left,e.right,t,r.left+4,r.right-4),[c,l]=rS(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(eS(i.left-4-t,o,s),eS(i.right+4,o,s)),p.push(eS(i.top-4-n,c,l),eS(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?Qx({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},$x(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},aS=(e,t,n)=>{(e=>{e.stopPropagation()})(e),Vx(t,null),n()},oS=(e,t)=>{Ax(t.intent)?zx(e,t.id):Rx(e,t.id)},sS=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=iS(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:qx.num,children:i}:{className:qx.num,children:(0,Z.jsx)(`span`,{className:qx.dot})}),O=r>0?(0,Z.jsxs)(`span`,{className:qx.more,children:[`+`,r]}):null;return(0,Z.jsxs)(`div`,{className:Q(qx.tag,nS(f,C),_&&qx.expanded,o&&qx.current,T&&qx.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)||oS(t,n)},children:[(0,Z.jsx)(`svg`,{className:qx.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:qx.badge,children:[D,O]}),(0,Z.jsxs)(`div`,{ref:x,className:qx.card,style:{left:w?.cardLeft??0,top:w?.cardTop??0},"aria-hidden":!_,children:[(0,Z.jsxs)(`div`,{className:qx.cardHead,children:[(0,Z.jsxs)(`span`,{className:qx.place,children:[D,O,E?(0,Z.jsxs)(`span`,{className:qx.total,children:[`/ `,a]}):null]}),(0,Z.jsx)(`span`,{className:qx.address,title:p,children:p}),(0,Z.jsxs)(`span`,{className:qx.controls,children:[E?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,className:qx.button,"aria-label":`Previous`,tabIndex:-1,onClick:e=>aS(e,t,()=>Wx(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`ArrowUpward`,size:12,ariaHidden:!0})}),(0,Z.jsx)(`button`,{type:`button`,className:qx.button,"aria-label":`Next`,tabIndex:-1,onClick:e=>aS(e,t,()=>Ux(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`ArrowDownward`,size:12,ariaHidden:!0})})]}):null,(0,Z.jsx)(`button`,{type:`button`,className:qx.button,"aria-label":`Dismiss`,tabIndex:-1,onClick:e=>aS(e,t,()=>Lx(t,n.id)),children:(0,Z.jsx)(M,{iconKey:`Close`,size:12,ariaHidden:!0})})]})]}),g?(0,Z.jsx)(`div`,{className:qx.label,children:g}):null]})]})};sS.displayName=`RangeAnnotationTag`;var cS=e=>({border:`color-mix(in srgb, ${e} 90%, transparent)`,fill:`color-mix(in srgb, ${e} 14%, transparent)`,chip:e}),lS=Object.freeze({working:cS(ie(`color-info`)),finding:cS(ie(`color-success`)),question:cS(ie(`color-warning`))}),uS=lS.finding,dS=e=>{e.stopPropagation()},fS={pointerEvents:`auto`,outline:`none`},pS={width:180,height:56},mS=20,hS=18,gS=17,_S=20,vS=(e,t,n,r)=>[Math.max(t-n,4),Math.min(e,r-4-n)],yS=[_.TopLeft,_.Top,_.Left,_.Center],bS=(e,t)=>{let n=e.getAllPanes();for(let e of yS){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 it(n)??e},xS=new WeakMap,SS=e=>{let t=xS.get(e);return t||(t={sizes:new Map,listeners:new Set},xS.set(e,t)),t},CS=(0,X.memo)(e=>{let{sheet:t,styles:n,renderChip:r,renderMarker:i,dimOpacity:a=.45,showChip:o=TS,filter:s,className:c,onKeyDown:u,...d}=e,f=l(),p=t??f,m=p?.getWorkbook()??null,{annotations:h,navigable:g,current:_,hovered:v}=Kx(m),y=ot(),b=(0,X.useRef)(new Map),[,x]=(0,X.useReducer)(e=>e+1,0);(0,X.useEffect)(()=>{if(!m)return;let{listeners:e}=SS(m);return e.add(x),()=>{e.delete(x)}},[m]);let S=(e,t)=>(n,r)=>{let i=SS(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?{...lS,...n}:lS,[n]),w=Q(c,`sxl-range-annotations`),T=e=>!(e.key!==`Escape`||e.defaultPrevented||!m||!_&&!v)&&(e.preventDefault(),e.stopPropagation(),zx(m,null),Vx(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)&&zx(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)(Yt,{...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?bS(y,n):null,address:r,isCurrent:e===_,isHovered:e===v,position:t})}if(M.length===0)return(0,Z.jsx)(Yt,{...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]??uS;return(0,Z.jsxs)(Yt,{...D,children:[M.map(e=>{let{annotation:t,coords:n,isCurrent:r,isHovered:i}=e,o=I(t.intent),s=r||i,c=!!_&&!s&&wS(t);return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(at,{className:`sxl-range-annotation-box`,range:n,stroke:o.border,alignWidth:2,style:{opacity:c?a:1,transition:`opacity 160ms ease`}}),(0,Z.jsx)(at,{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]=vS(e,t,n.width,a),[p,m]=vS(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-gS-mS,t-gS]:[t+gS,t+gS+mS],[a,o]=e.y===`t`?[n-gS-hS,n-gS]:[n+gS,n+gS+hS],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-_S-mS,s-_S,w,w+hS)},{ok:p&&_,side:`r`,toward:`l`,anchor:{...t,...x},over:()=>v(l+_S,l+_S+mS,w,w+hS)},{ok:m&&g,side:`t`,toward:`b`,anchor:{...t,...b},over:()=>v(T,T+mS,c-_S-hS,c-_S)},{ok:h&&g,side:`b`,toward:`t`,anchor:{...t,...b},over:()=>v(T,T+mS,u+_S,u+_S+hS)}],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,SS(m).sizes.get(s)??pS):{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)(Kt,{className:`sxl-range-annotation-chip`,anchor:{range:c.anchor},placement:c.placement,alignOffset:c.inset,offset:0,whenOff:`clamp`,zIndex:Be(`grid`,n?2:+!!t.isCurrent),children:e=>(0,Z.jsx)(`div`,{style:fS,tabIndex:-1,onKeyDown:E,onKeyUp:dS,onCopy:dS,onCut:dS,onPaste:dS,onPointerDown:dS,onMouseDown:dS,onDoubleClick:dS,onPointerEnter:()=>((e,t)=>{let n=b.current.get(t);n&&(clearTimeout(n),b.current.delete(t)),Vx(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),Hx(e,t)},140))})(m,s),children:e.outOfView?(0,Z.jsx)(We,{render:i??ES,props:{...a,side:l,cornerOff:u,toward:d,state:e}}):(0,Z.jsx)(We,{render:r??ES,props:{...a,side:l,cornerOff:u,toward:d,state:e}})})},`chip-${s}`)})]})});CS.displayName=`RangeAnnotationLayer`;var wS=e=>e.intent!==`working`,TS=e=>wS(e)||!!e.label,ES=e=>(0,Z.jsx)(sS,{...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 DS=[`selectedItemWithData`,`unselectedItemWithData`,`selectedItemWithNoData`,`unselectedItemWithNoData`],OS=(0,X.memo)(e=>{let{styleName:t,styles:n,width:r=56,height:i=60,style:a,...o}=e,s=hn(t,n),c=(e,t)=>(0,Z.jsx)(`div`,{style:{width:`${t}%`,height:2,backgroundColor:e.color??`currentColor`,opacity:.85}}),l=mn(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`,...mn(s?.wholeTable,n),...a},children:[(0,Z.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:7,flex:`none`,...l},children:c(l,45)}),DS.map((e,t)=>{let r=mn(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)})]})});OS.displayName=`SlicerStylePreview`,N.register(`shape`,()=>d(()=>import(`./DYJSIlNxrNw8qk-w.js`),[],import.meta.url));var kS=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`})]}),AS=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`})]}),jS=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`})]}),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 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`})]}),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 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`})]}),PS=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`})]}),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 -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`})]}),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 -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`})]}),LS=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`})]}),RS=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`})]}),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 -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`})]}),BS=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`})]}),VS=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`})]}),HS=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`})]}),US=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`})]}),WS=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`})]}),GS=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`})]}),KS=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`})]}),qS=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`})]}),JS=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`})]}),YS=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`})]}),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 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`})]}),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 -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`})]}),QS={themed:`_themed_f2asj_9`,small:`_small_f2asj_36`,medium:`_medium_f2asj_37`,large:`_large_f2asj_38`},$S=(0,X.memo)(e=>{let{size:t=`medium`,className:n,children:r,...i}=e;return(0,Z.jsx)(`span`,{className:Q(`icon`,QS.themed,QS[t],n),...i,children:r})});$S.displayName=`ThemedChartIcon`;var eC={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`},tC=new Map;tC.set(eC.Column,{Icon:Tx,description:C(`chart.type.column`),type:`columnClustered`}),tC.set(eC.ColumnStacked,{Icon:kS,description:C(`chart.type.columnStacked`),type:`columnStacked`}),tC.set(eC.ColumnStackedPercent,{Icon:AS,description:C(`chart.type.columnStackedPercent`),type:`columnStacked100`}),tC.set(eC.Line,{Icon:jS,description:C(`chart.type.line`),type:`line`}),tC.set(eC.LineStacked,{Icon:MS,description:C(`chart.type.lineStacked`),type:`lineStacked`}),tC.set(eC.LineStackedPercent,{Icon:NS,description:C(`chart.type.lineStackedPercent`),type:`lineStacked100`}),tC.set(eC.LineMarkers,{Icon:PS,description:C(`chart.type.lineMarkers`),type:`lineMarkers`}),tC.set(eC.LineStackedMarkers,{Icon:FS,description:C(`chart.type.lineStackedMarkers`),type:`lineMarkersStacked`}),tC.set(eC.LineStackedPercentMarkers,{Icon:IS,description:C(`chart.type.lineStackedPercentMarkers`),type:`lineMarkersStacked100`}),tC.set(eC.Pie,{Icon:LS,description:C(`chart.type.pie`),type:`pie`}),tC.set(eC.PieDoughnut,{Icon:RS,description:C(`chart.type.pieDoughnut`),type:`doughnut`}),tC.set(eC.Bar,{Icon:zS,description:C(`chart.type.bar`),type:`barClustered`}),tC.set(eC.BarStacked,{Icon:BS,description:C(`chart.type.barStacked`),type:`barStacked`}),tC.set(eC.BarStackedPercent,{Icon:VS,description:C(`chart.type.barStackedPercent`),type:`barStacked100`}),tC.set(eC.Area,{Icon:HS,description:C(`chart.type.area`),type:`area`}),tC.set(eC.AreaStacked,{Icon:US,description:C(`chart.type.areaStacked`),type:`areaStacked`}),tC.set(eC.AreaStackedPercent,{Icon:WS,description:C(`chart.type.areaStackedPercent`),type:`areaStacked100`}),tC.set(eC.ScatterMarkers,{Icon:GS,description:C(`chart.type.scatterMarkers`),type:`xyscatter`}),tC.set(eC.ScatterLinesMarkersSmooth,{Icon:KS,description:C(`chart.type.scatterLinesMarkersSmooth`),type:`xyscatterSmooth`}),tC.set(eC.ScatterLinesMarkers,{Icon:JS,description:C(`chart.type.scatterLinesMarkers`),type:`xyscatterLines`}),tC.set(eC.ScatterLinesSmooth,{Icon:qS,description:C(`chart.type.scatterLinesSmooth`),type:`xyscatterSmoothNoMarkers`}),tC.set(eC.ScatterLines,{Icon:YS,description:C(`chart.type.scatterLines`),type:`xyscatterLinesNoMarkers`}),tC.set(eC.Bubble,{Icon:XS,description:C(`chart.type.bubble`),type:`bubble`}),tC.set(eC.Bubble3D,{Icon:ZS,description:C(`chart.type.bubble3D`),type:`bubble3DEffect`});var nC={placement:`bottom-start`,followAnchor:!0},rC=new Set,iC={x:0,y:0,top:0,left:0,bottom:0,right:0,width:0,height:0,toJSON:()=>({})},aC=e=>{let{api:t,grammar:n,disabled:r}=e,i=n===`formula`,a=_r(),o=e.workbook===void 0?a:e.workbook,s=ba().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)(()=>Mo(i?t.tokens:null),[i,t.tokens]),g=(0,X.useMemo)(()=>{if(!i||!t.tokens)return rC;let e;try{e=to(o)?.getCalculation()??null}catch{e=null}return e?new Set(ls(e,t.tokens,t.tokenBase).flatMap(e=>e.tokens)):rC},[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?No(e,h.matchOf,l,t.tokenBase):null;v(e=>Po(e,n)?e:n)},[i,t.engaged,t.tokens,t.tokenBase,l,h]);let y=(0,X.useMemo)(()=>Fo(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&&Mi(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:To(a),s=n?Oo:o??Fi(e),c;(s||i||n)&&(c={},s&&(c.color=s),n&&(c.fontWeight=`bold`),i&&(c.color=`transparent`)),g.has(t)&&(c={...c,...Ao});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:Eo,children:(0,Z.jsx)(`span`,{style:Do(s??`inherit`),children:e.text})}),u?(0,Z.jsxs)(Z.Fragment,{children:[l.slice(0,C-r[t]),(0,Z.jsx)(bo,{}),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)(bo,{},`expected`):null;if(!d)return[a,...i,o].filter(Boolean);let{lo:s,hi:c,outline:l}=d,u=l?wo:Co;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:Gt[n%Gt.length]}:null,...r?d.outline?wo:Co: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=gs({text:t.text,getTokens:()=>i?t.tokens:null,active:i&&t.engaged,getCaret:()=>D.current?.selectionStart??t.text.length,getCalculation:()=>{try{return to(o)?.getCalculation()??null}catch{return null}},getNames:()=>{try{return to(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 F=(0,X.useMemo)(()=>({getBoundingClientRect:()=>D.current?.getBoundingClientRect()??iC}),[]),I=X.useCallback(e=>!!E.current?.contains(e),[]),L=ze({label:`formula-field-hint`,anchor:F,autoFocus:!1,disableClickAway:I,propsPopper:nC,renderPopupPanel:N.renderPanel}),R=N.active&&!s?.dragging,z=L.reference;(0,X.useEffect)(()=>{R?z.open(0):z.close(0)},[R,z]);let[ee,B]=(0,X.useState)(null),V=(0,X.useRef)(null),H=(0,X.useRef)(!1),U=()=>{V.current=null,H.current=!1,B(null),f(null),m(null)},W=()=>{H.current||U()},te=Pa(()=>U(),()=>ne()),G=t=>{if(!o)return!1;try{return to(o)?.getCalculation().createFormula(`=`+t,e.home,{target:`display`}).isValid()??!1}catch{return!1}},ne=()=>{let n=D.current,r=O.current,a=()=>{H.current&&U()};if(!n||!r||!T)return void a();if(te.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?La(t.tokens,t.tokenBase,t.text,s,c,G):null;n&&(l={lo:n.lo,hi:n.hi,key:`sel:f:${n.lo}:${n.hi}:${n.fragment??n.evalIndex}`,evaluate:async()=>{let r=to(o)?.getCalculation();return r?Wa(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===V.current)return;V.current=l.key,H.current=!0,B(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 U();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=>{V.current===h&&e!=null&&B({...p,text:e})}).catch(()=>{})};(0,X.useEffect)(()=>{t.engaged||U()},[t.engaged]);let re=n=>{if(n.which!==oe.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=La(t.tokens,t.tokenBase,t.text,s,c,G);else{let e=Ra(t.tokens);l=e?{...e,...za(t.tokens,t.tokenBase,e.lo,e.hi),fragment:null}:null}if(!l)return!1;n.preventDefault(),n.stopPropagation();let u=t.text,d=to(o)?.getCalculation();if(!d)return!1;let f=Ba(En(o.getLocale()??`en`).decimal),p=Fn(),m={t:p?.booleans?.true??`TRUE`,f:p?.booleans?.false??`FALSE`};return(async()=>{let t=null,n=``;try{if(t=Ha(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;P.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)(()=>{U()},[t.text]);let K={onScroll:e=>{let t=O.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft),U(),ne()},onMouseMove:n=>{let r=O.current;if(!r)return;if(te.blocksHover(n)||Fa(D.current))return void W();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 U();if(i){let n=t.tokens;if(!n||!o)return void U();let i=Ia(n,l);if(!i)return void U();let a=`f:${i.evalIndex}:${i.lo}:${i.hi}`;if(a===V.current)return;V.current=a,B(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=to(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(V.current!==a)return;let t=Wa(e);t!=null&&B({...d,text:t})}).catch(()=>{})}catch{}return}if(!t.segments[l]?.valid)return void U();let d=`s:${l}:${t.segments[l].text}`;if(d===V.current)return;V.current=d,B(null),f({lo:l,hi:l});let p={left:(u.left+u.right)/2,top:u.top-6};t.evaluateSegment(l).then(e=>{V.current===d&&e!=null&&B({...p,text:e})})},onMouseLeave:W,onDragStart:te.onDragStart,onSelect:e=>{u(D.current?.selectionStart??-1),ne()},onPointerDown:e=>{te.begin(e),R&&!L.isOpen&&z.open(0)}},ie=T&&k?(0,Z.jsx)(`div`,{ref:O,"aria-hidden":!0,style:k,children:(0,Z.jsx)(`span`,{style:{whiteSpace:`pre`},children:w})}):null,ae=ee?(0,pr.createPortal)((0,Z.jsx)(`div`,{className:`sxl-formula-eval-tip`,style:{...Na,left:ee.left,top:ee.top},children:ee.text}),document.body):null;return{containerRef:E,inputElRef:D,overlayActive:T,inputHandlers:K,inputExpected:x&&j,handleKeyDown:e=>!!N.handleKeyDown(e)||(e.which===oe.Escape&&L.isOpen?(e.preventDefault(),e.stopPropagation(),z.close(0),!0):!!re(e)),overlayElement:ie,tipElement:ae,hintElement:L.component}},oC=e=>{e.button===0&&e.preventDefault()},sC=(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=K(),O=lo({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=aC({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:oC,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:oC,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:oC,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:oC,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:ie(`color-base-content`)}: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]})}));sC.displayName=`FormulaInput`;var cC=`_editable-input_1u3oj_6`,lC=e=>(0,Z.jsx)(`input`,{...e}),uC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{style:n={},className:r,value:i=``,onSubmit:a,onChange:o,onCancel:s,renderInput:c=lC,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=U(),T=(0,X.useCallback)(function(e){let t=e.message;S!==t&&(w?.showMessage?.(t,{type:ce.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=q(()=>{b(i),x.current=null,v(!1),s?.()},[s,i]),O=(0,X.useMemo)(()=>{if(!_)return null;let e={className:Q(cC),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)(We,{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=Ne(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})]})})),dC=e=>{let{transform:t}=e;return{...t,y:0}},fC=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},pC=(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`}})]})})),mC={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`},hC=(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`,mC.Wrapper,i&&mC.fadeIn,d&&mC.sorting,t&&mC.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(mC.Item,n&&mC.dragging,a&&mC.withHandle,t&&mC.dragOverlay,r&&mC.disabled,e&&mC.color,`sxl-dragging`),style:f,"data-cypress":`draggable-item`,...a?void 0:c,..._,tabIndex:a?void 0:-1,children:y})})})),gC={Row:`_Row_1kr10_1`},_C=(0,X.memo)((0,X.forwardRef)(({children:e,horizontal:t,style:n},r)=>(0,Z.jsx)(`div`,{ref:r,style:{...n},className:Q(gC.Row,t&&gC.horizontal),children:e}))),vC={...Oy,sideEffects:Dy({styles:{active:{opacity:`0`}}})},yC=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{className:n,activationConstraint:r,animateLayoutChanges:i,adjustScale:a=!1,collisionDetection:o=K_,coordinateGetter:s=$y,dropAnimation:c=vC,getItemStyles:l=()=>({}),getNewIndex:u,handle:d=!1,items:f,onMove:p,isDisabled:m=()=>!1,measuring:h,modifiers:g,renderItem:_,renderDivider:v,reorderItems:y=Ny,strategy:b=Ry,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=L_(I_(Fv,{activationConstraint:r}),I_(zv,{activationConstraint:r}),I_(Dv,{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)(bC,{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)(We,{render:v,props:{}},`divider-`+e))});let{getPortalContainer:N}=pe(),P=ae()?.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),z=()=>{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)(my,{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),z(),e.over){let t=A(String(e.over.id));j!==t&&(p?.(j,t),E(e=>y(e,j,t)))}},onDragCancel:()=>{O(null),z()},measuring:h,modifiers:g,children:[(0,Z.jsx)(`div`,{ref:L,style:{display:`flex`,justifyContent:`flex-start`,boxSizing:`border-box`,...x},className:Q(n,mC.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)(Uy,{items:T,strategy:b,children:(0,Z.jsx)(_C,{ref:t,children:M})})}),S?(0,pr.createPortal)((0,Z.jsx)(My,{adjustScale:a,dropAnimation:c,children:D?(0,Z.jsx)(`div`,{className:I,...F,style:{display:`flex`},children:(0,Z.jsx)(hC,{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 bC({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}=Xy({id:i,animateLayoutChanges:t,disabled:e,getNewIndex:n});return(0,Z.jsx)(hC,{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 xC=`_TabStrip_3x0dp_1`,SC=e=>(0,Z.jsx)(pC,{...e}),CC=(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=me,renderScrollButtonEnd:d=De,renderScrollButtonEdge:f=we,renderTabButton:p=SC,renderTabDivider:m,propsEditLabel:h,disabled:g=!1,disableDrag:_=!1,background:v=ie(`color-base-100`),activeColor:y=ie(`color-accent`),borderColor:b=ie(`color-base-300`),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||!V.current)return;let n=V.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)([]),F=(0,X.useRef)(null);(0,X.useImperativeHandle)(t,()=>Object.assign({startEdit(e){P.current?.[e]?.startEdit()},cancel(e){P.current?.[e]?.cancel()}},F.current),[C,j]);let I=(0,X.useCallback)(({value:e,index:t,dragging:n})=>{let{style:r,maxLength:i,...a}=h||{},o=(0,Z.jsx)(uC,{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)(We,{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]),[L,{width:R}]=ge(),[z,{width:ee}]=ge(),V=(0,X.useRef)(null),[H,U]=(0,X.useState)({left:0,top:0,width:0,height:0}),[W,te]=(0,X.useState)(null);(0,X.useEffect)(()=>{W!==null&&V.current&&V.current.scrollTo({left:W,behavior:`smooth`})},[W]);let G=(0,X.useCallback)((e,t=!1)=>{if(!V.current)return 0;let n=V.current.firstChild.getBoundingClientRect(),r=V.current.firstChild.firstChild.children,i=0;return i=t?0:je.getScrollTo(e,n.left,r,!0,Math.max(0,e-200)),te(i),Math.max(0,i)},[]),ne=(0,X.useCallback)((e,t=!1)=>{if(!V.current)return 0;let n=V.current.firstChild.getBoundingClientRect(),r=V.current.firstChild.firstChild.children,i=0,a=Math.ceil(ee-R);return i=t?a:je.getScrollTo(e,n.left,r,!1,Math.max(0,e+200)),te(i),Math.min(a,i)},[ee,R]),re=(0,X.useRef)(null),K=(0,X.useRef)(null),ae=(0,X.useCallback)(()=>{K.current&&(clearTimeout(K.current),K.current=null,re.current=null)},[]),oe=(0,X.useCallback)((e,t,n=260)=>{re.current=e,K.current=setTimeout(()=>{let n=t?G(re.current||e):ne(re.current||e);n===re.current?ae():oe(n,t,120)},n)},[G,ne,ae]);(0,X.useEffect)(()=>()=>ae(),[ae]);let se=(0,X.useMemo)(()=>({style:{marginLeft:`4px`,marginRight:`6px`},disabled:Math.floor(H.left)<=0||Math.floor(ee-R)===0,orientation:B.Horizontal,isBefore:!0,onMouseUp:ae,onMouseLeave:ae,onMouseDown:e=>{e.preventDefault(),oe(V.current.scrollLeft,!0)},onClick:e=>G(Math.min(V.current.scrollLeft,W??2**53-1),e.ctrlKey)}),[H,W,ee,R]),ce=(0,X.useMemo)(()=>({style:{marginLeft:`6px`,marginRight:`4px`},disabled:Math.floor(ee-R)<=Math.ceil(H.left),orientation:B.Horizontal,isBefore:!1,onMouseUp:ae,onMouseLeave:ae,onMouseDown:e=>{e.preventDefault(),oe(V.current.scrollLeft,!1)},onClick:e=>ne(Math.max(V.current.scrollLeft,W??0),e.ctrlKey)}),[H,W,ee,R]),le=(0,X.useMemo)(()=>(0,Z.jsxs)(Z.Fragment,{children:[f?(0,Z.jsx)(`div`,{style:{minWidth:`16px`}}):null,n,(0,Z.jsx)(We,{render:f,props:se})]}),[se,ce,u,d,n,f]);return(0,Z.jsxs)(`div`,{style:{...r,display:`flex`,alignItems:`stretch`},className:Q(i,xC),ref:F,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:le}),(0,Z.jsx)(`div`,{className:`sxl-Tabs`,ref:L,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:V,onScroll:e=>{U({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:(0,Z.jsx)(yC,{isDisabled:e=>g||_,items:T,strategy:Ly,modifiers:[dC,fC],ref:z,renderItem:I,renderDivider:m,onMove:k,activationConstraint:{distance:15}})})}),(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:(0,Z.jsx)(We,{render:f,props:ce})})]})}));CC.displayName=`TabStrip`;var wC={"sheet-tab":`_sheet-tab_1cbiv_2`,ghost:`_ghost_1cbiv_18`},TC=e=>{let{disabled:t,editing:n,...r}=e;return(0,Z.jsx)(`div`,{...r})},EC=(e,t)=>`color-mix(in srgb, ${e} ${t}%, transparent)`,DC={top:3,right:4.5,bottom:1.5,left:4},OC=(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=TC,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=EC(e,75),n=EC(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(wC.pill,A&&wC.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,I=O?(0,Z.jsx)(`div`,{style:{width:`100%`,borderRadius:`4px`,minWidth:`4px`,height:`2px`,backgroundColor:`var(--sxl-color-primary)`}}):null,L=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)(Ce,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},radius:v,variant:O&&b?`tab`:`rounded`,clipInset:O&&b?void 0:DC,strokeColor:O?F:`transparent`,children:(0,Z.jsxs)(y,{className:wC[`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:L,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)(Ex,{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,I]}),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)})})}));OC.displayName=`SheetTab`;var kC=(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))})});kC.displayName=`IconSetGlyphs`,a({FindScopeOptions:()=>AC});var AC={Workbook:`workbook`,Sheet:`sheet`};function jC(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(Zn.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?.(wd.Names)}});let s=e=>{if(!e||!r.editable)return;let t=`=${e.getName()}(`;Cs(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&&(Ss(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`,Wn.CalculationMode.Automatic],[`calcModeAutomaticExceptTables`,Wn.CalculationMode.AutomaticExceptTables],[`calcModeManual`,Wn.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,G],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:ce.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?.(wd.Names,{args:{insert:!0}})}}),e.updateCommand(`editNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&r?.activateTaskPane?.(wd.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?.(wd.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=qg(r.taskPaneArea,wd.Names);for(let n of[`addNamedReference`,`editNamedReference`])e.updateCommand(n,{disabledReasons:[...t,...i]});e.updateCommand(`activeNameManager`,{disabledReasons:i}),e.updateCommand(`manageExternalLinks`,{disabledReasons:qg(r.taskPaneArea,wd.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 MC={dynamic:(e,t)=>{let n=t.manager?Wf(e,{manager:t.manager,notifier:t.notifier}):void 0,r=jC(e,t);return()=>{n?.(),r()}}},NC=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(`./JM0_BaBZ3yF6lnHC.js`),__vite__mapDeps([20,8,7,21,22]),import.meta.url);return await or.install(e.IOPlugin),this._loadedIO=or,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 lr(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}},PC=async(e,t={})=>{let{io:n=NC,defaultTheme:r}=t;if(e instanceof cr)return e;if(!e||!g.isPromiseLike(e)&&Object.keys(e).length===0)return new cr({theme:r});let i=await Promise.resolve(e);return i instanceof cr?i:i&&i.source?n.read(i):i},FC=(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 cr&&!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 PC(e,a.current);if(!t)return;let r=c.current,i=n??(r.status===`loaded`?r.workbook:new cr({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},IC=!1,LC=null,RC=async e=>{if((await Mn.getDetails()).isEval()){try{let e=top??window;e.SheetXL||=Object.freeze({getSelectedWorkbook:()=>LC?.getWorkbook(),getSelectedWorksheet:()=>LC?.getWorkbook().getSelectedWorksheet()??null,getSelectedRange:()=>LC?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>LC?.getWorkbook().getSelectedRanges(),getRange:e=>LC?.getWorkbook().getRange(e),getSelectedWorkbookElement:()=>LC,getLicenseManager:()=>Mn,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),IC=!0}if(LC!==e&&(LC=e,!IC))try{IC=!0,(top??window).SheetXL&&(await Mn._validate(!0),Mn.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;`),IC=!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)}}},zC=`_add-button_1b4ig_1`,BC=e=>(0,Z.jsx)(OC,{...e}),VC=`var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3)))`,HC=(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=BC,onTabContextMenu:m,renderScrollButtonStart:h,renderScrollButtonEnd:g,renderScrollButtonEdge:_,...v}=e,y=K(),b=f?`solid ${VC} 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]),z=q(()=>{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]),ee=q(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]),B=q(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]),V=(0,X.useMemo)(()=>N?null:(0,Z.jsx)(`button`,{type:`button`,className:Q(`sxl-workbook-strip-add`,zC),disabled:s,"aria-label":`addTab`,title:y(`workbookStrip.newSheet`),onMouseDown:e=>{e.button===0&&e.preventDefault()},onClick:()=>z(),children:(0,Z.jsx)(M,{iconKey:`AddCircle`,style:{width:`18px`,height:`18px`}})}),[s,N,z,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)(CC,{ref:T,selectedTabIndex:E,tabNames:F,onSelectedTabIndexChange:I,onTabNameChange:L,onTabMove:R,background:`var(--sxl-color-base-100)`,borderColor:VC,seam:f,activeColor:null,disabled:s,disableDrag:N,renderTabButton:ee,renderTabDivider:B,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:V}),(0,Z.jsx)(`div`,{style:{borderTop:b,flex:1,minWidth:`24px`}})]})}));HC.displayName=`WorkbookStrip`;var UC=e=>{let{key:t,...n}=e;return(0,Z.jsx)(dx,{...n},t)},WC=e=>{let{key:t,...n}=e;return(0,Z.jsx)(Dx,{...n},t)},GC=e=>(0,Z.jsx)(HC,{...e}),KC=e=>ix(e),qC={"sheetxl-workbook":`_sheetxl-workbook_ooc7l_11`,"sheetxl-reset":`_sheetxl-reset_ooc7l_40`,viewport:`_viewport_ooc7l_75`},JC={version:1};pf();var YC={ignoreModelChange:!0},XC={flex:`1 1 100%`,display:`flex`,boxSizing:`border-box`},ZC=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,QC=(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:_=GC,propsContextMenu:v,renderContextMenu:y,renderColumnMenu:b,renderPivotMenu:x,renderMovableMenu:S,renderFillMenu:C,propsFloatPanel:w,renderFloatPanel:T,renderWorkbookLoading:D=KC,propsWorkbookLoading:O,propsSheet:k,editable:A,renderWorksheet:j=UC,renderOpaqueSheet:M=WC,wrapperMain:N,children:F,showHorizontalScrollbar:I,showVerticalScrollbar:z,colorScheme:ee,gridColorScheme:B,tokens:V,...H}=e;if(!n)throw Error(`IWorkbook must be provided.`);let W=(0,X.useRef)(null),te=mh(),G=(0,X.useRef)(null),K=(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:G}),[]),[ie,ae]=(0,X.useState)(!1),[oe,se]=(0,X.useState)(!1),ce=(0,X.useCallback)(()=>{ae(!0)},[]),le=(0,X.useRef)(null),ue=Ne(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>n,getSheetElement:()=>W.current,getViewportElement:()=>G.current,getCommandScope:()=>le.current,focus(){W&&W.current&&W.current.focus()}}),[n]),[de,fe]=(0,X.useState)(null),pe=(0,X.useCallback)(e=>{e&&fe(e)},[]),me=(0,X.useRef)(null);(0,X.useLayoutEffect)(()=>{ie&&de&&(async()=>{me.current!==r&&(await r?.({source:de}),me.current=r??null),se(!0)})()},[ie,de]),(0,X.useEffect)(()=>{if(!oe||!i)return;Kn.getTypes(),Xt();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)}},[oe,i]);let _e=q(e=>{g?.onUserChange?.(e);let t=document.activeElement;t&&t!==document.body&&!ue.current?.contains(t)||requestAnimationFrame(()=>{W?.current?.focus()})},[g]),[ve,ye]=(0,X.useState)(n.getSelectedSheet()),be=ve?.isIWorksheet?ve:null,[xe,Ce]=(0,X.useState)(n.getProtection());o(n,{onSheetsChange:e=>{ye(e?.getSelectedSheet())},onViewChange(e){ye(e?.getSelectedSheet())},onProtectionChange:e=>{Ce(e?.getProtection())}}),o(n,{onRequestSelect:async(e,t)=>new Promise(n=>{let r=W.current;if(!t.isIWorksheet||!r||r.getWorksheet()===t)return void n(!0);if(e.getSelectedSheet()!==t)return void n(!1);let i=r.getGridSurface();i?i.onPaneChangeOnce(()=>{n(W.current?.getWorksheet()===t)}):n(!1)})},YC);let[we,Te]=(0,X.useReducer)(e=>e+1,0),De=n.getView();o(De,{onViewChange:e=>{Te()}});let[Oe]=re(qe.Mode,Ke[qe.Mode]),[ke]=re(qe.DarkImages,Ke[qe.DarkImages]),{themeMode:je}=Ee({mode:ee??Oe??void 0}),Me=Ye(B),Fe=(0,X.useId)(),Ie=(0,X.useMemo)(()=>Se(`workbook`,Fe),[Fe]),[Le,Re]=(0,X.useState)({});(0,X.useLayoutEffect)(()=>{if(!de)return;let e=getComputedStyle(de),t=t=>e.getPropertyValue(t).trim()||void 0,n=t(`--icon-color`);Re({base100:t(`--sxl-color-base-100`),primary:t(`--sxl-color-primary`),icon:n&&n!==`currentColor`?n:e.color||void 0})},[de,je]);let Be=(0,X.useMemo)(()=>({backgroundColor:Le.base100,borderColor:Le.primary,fillColor:Le.icon??`grey`}),[Le]),Ve=(0,X.useMemo)(()=>new he,[]),He=Ae.useCommandScope(),Ue=U(),Ge=Rd(),Xe=Zr(),[Ze,Qe]=(0,X.useState)(p??null);(0,X.useEffect)(()=>{if(!He)return void Qe(null);if(p)return void Qe(p);if(!n)return void Qe(null);let e=new dr(n.getTransactions());return Qe(e),()=>e.close()},[He,n,p]);let[$e,et]=re(`workbook.lastFind`,null,JC),tt=(0,X.useRef)($e);tt.current=$e;let nt=(0,X.useMemo)(()=>({getLastFind:()=>tt.current,setLastFind:et}),[et]),rt=(0,X.useMemo)(()=>({scopeName:{key:n?`workbook:${n.getId()}`:`workbook`,name:`workbook`},contributor:MC,data:{workbook:n,editable:A,notifier:Ue,manager:Ze??void 0,activateTaskPane:(e,t)=>Ge.activate(e,t),taskPaneArea:Ge,themes:Xe,focusNameBox:m,findMemory:nt}}),[n,A,Ue,Ze,Ge,Xe,m,nt]),it=h??De?.isShowTabs(),at=I??De?.isShowHorizontalScrollbar(),ot=z??De?.isShowVerticalScrollbar(),[st,{width:ct}]=ge(),lt=ct===0||ct>560,ut=(0,X.useMemo)(()=>{if(!it||!_)return null;let e=(0,Z.jsx)(We,{render:_,props:{condensed:!lt,seam:lt||P.detectIt().primaryInput!==`touch`,workbook:n,...g,onUserChange:_e}});return lt?e:(0,Z.jsx)(`div`,{style:{flex:`none`,display:`flex`},children:e})},[_,g,n,lt,it]),dt=(0,X.useCallback)(e=>{let{style:t,...r}=e,i=null,a=null,o=null;if(at&&be&&(a=(0,Z.jsx)(`div`,{className:`sxl-workbook-strip-scrollbar`,style:{display:`flex`,flex:`1 1 100%`,borderTop:ZC,flexDirection:`column`,justifyContent:`center`},children:(0,Z.jsx)(Mg,{...r,style:{paddingLeft:`4px`,paddingRight:`4px`,...t},propsTouchThumb:Be,endGap:700,sheet:be})})),it&<&&(o=ut),it&<&&!at&&(o=(0,Z.jsxs)(`div`,{style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`},children:[o,(0,Z.jsx)(`div`,{style:{borderTop:ZC,flex:`1`}})]})),o&&at){let e=Le.icon??`grey`;i=(0,Z.jsx)(R,{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:ZC,borderBottom:`solid 3px transparent`}},elementBefore:o,elementAfter:a??void 0})}else if(at)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:ZC}});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})},[be,n,it,at,lt,ut,Be,Le]),[ft,pt]=(0,X.useState)(null),mt=nf(),ht=(0,X.useMemo)(()=>new Ae.ManualActivation(null),[]),gt=(0,X.useRef)(null),_t=(0,X.useMemo)(()=>({placement:`right-start`,...ft?.propsPopper}),[ft?.propsPopper]),{reference:vt,component:yt}=ze({label:`contextMenu`,propsPopper:_t,anchor:ft?.anchor??{getBoundingClientRect:()=>new DOMRect(ft?.clientX||0,ft?.clientY||0)},onOpen:()=>{gt.current=ft},onClose:()=>{let e=gt.current;gt.current=null,e?.onClose?.(),e===ft&&pt(null)},renderPopupPanel:ft?.renderPopupPanel,renderFloatPanel:T});(0,X.useEffect)(()=>{ft?vt.open(0):vt.close(0)},[ft]);let bt=q((e,t)=>!!e?.isDefaultPrevented()||!!b&&(e.preventDefault(),e.stopPropagation(),ft&&ft.anchor===e.currentTarget?(pt(null),!0):(ht.setAnchor(mt?.getAnchor()??null),pt({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>b({column:t,floatReference:vt,...v})}),!0)),[b,v,n,ft]),xt=q((e,t)=>!!e?.isDefaultPrevented()||!!x&&(e.preventDefault(),e.stopPropagation(),ft&&ft.anchor===e.currentTarget?(pt(null),!0):(ht.setAnchor(mt?.getAnchor()??null),pt({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},renderPopupPanel:()=>x({fields:t,floatReference:vt,...v})}),!0)),[x,v,n,ft]),St=q(e=>!!e.originalEvent?.isDefaultPrevented()||!!y&&(e.originalEvent?.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>y({workbook:n,floatReference:vt,...v})}),!0),[y,v,n]),Ct=q((e,t)=>!!C&&(e.originalEvent?.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,onClose:()=>{t.cancel()},renderPopupPanel:()=>C({workbook:n,menu:t,floatReference:vt,...v})}),!0),[C,v,n]),wt=q((e,t)=>!!e?.isDefaultPrevented()||!!S&&(e.preventDefault(),ht.setAnchor(mt?.getAnchor()??null),pt({clientX:e.clientX,clientY:e.clientY,renderPopupPanel:()=>S({movable:t,floatReference:vt,...v})}),!0),[S,v,n]),Tt=q(()=>{de&&RC(de)},[de]),Et=(0,X.useCallback)(e=>{let{style:t,...n}=e;return be?(0,Z.jsx)(Mg,{...n,style:{...t,paddingTop:`4px`,paddingBottom:`4px`},propsTouchThumb:Be,sheet:be,endGap:700}):(0,Z.jsx)(Z.Fragment,{})},[be,Be]);(0,X.useEffect)(()=>{a&&oe&&W.current&&W.current.focus(typeof a==`object`?a:void 0)},[a,oe]);let Dt=(0,X.useRef)(null),Ot=(0,X.useMemo)(()=>oe||!D?null:(0,Z.jsx)(We,{render:D,props:{...O}}),[oe,D,O]),kt=(0,X.useMemo)(()=>Ot?(0,Z.jsx)(`div`,{ref:Dt,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,position:`absolute`,boxSizing:`border-box`,pointerEvents:s?.pointerEvents},children:Ot}):null,[Ot,s]),At=(0,X.useCallback)(e=>{let{movable:t}=e;return t?md({onContextMenuCapture:e=>{wt(e,t)},...e}):(0,Z.jsx)(Z.Fragment,{})},[]),jt=(0,X.useMemo)(()=>be?(0,Z.jsx)(We,{render:j,props:{ref:W,style:XC,colorScheme:je,gridColorScheme:Me,sheet:be,editable:A,onSheetContextMenu:St,onFillMenu:Ct,viewport:Ve,showScrollbars:!1,viewportComponent:K,onFirstRender:ce,renderMovable:At,...k,propsCellRender:{onColumnButtonMouseDown:(e,t)=>{k?.propsCellRender?.onColumnButtonMouseDown?.(e,t),bt(e,t)},onPivotButtonMouseDown:(e,t)=>{k?.propsCellRender?.onPivotButtonMouseDown?.(e,t),xt(e,t)},...k?.propsCellRender}}}):null,[k,be,je,Me,A]),Mt=(0,X.useMemo)(()=>{if(!be){let e=(0,Z.jsxs)(`div`,{ref:st,style:{...XC,display:`flex`,flexDirection:`column`},children:[(0,Z.jsx)(We,{render:M,props:{sheet:ve,onFirstRender:ce}},ve?.getId()),ut?(0,Z.jsx)(`div`,{className:Q(`sxl-workbook-strip-area`),style:{display:`flex`,flex:`none`,width:`100%`,borderTop:ZC},children:ut}):null]});return N?N(e):e}let e=(0,Z.jsx)(L,{ref:st,style:XC,viewport:Ve,zoomable:!0,showHorizontalScrollbar:at||it,showVerticalScrollbar:ot,renderScrollbarHorizontal:dt,renderScrollbarVertical:Et,children:jt});return lt||ct===0||(e=(0,Z.jsxs)(Z.Fragment,{children:[e,ut]})),N?N(e):e},[at,it,dt,ot,Ve,lt,jt,ut,N,be,ve,M]),Nt=(0,X.useMemo)(()=>({boxSizing:`border-box`,fontFamily:`var(--sxl-font-family)`,"--_sxl-image-filter":Me===`dark`&&ke?`hue-rotate(180deg) invert(1) brightness(95%)`:`none`,...s}),[Me,ke,s]),Pt=(0,X.useMemo)(()=>({flex:`1 1 100%`,width:`100%`,display:`flex`,flexDirection:`column`,opacity:!oe&&Ot?0:void 0}),[oe,Ot]),Ft=u([ue,pe]);return(0,Z.jsx)(Je.Provider,{value:Me,children:(0,Z.jsx)(ne,{renderFloatPanel:T,propsFloatPanel:w,themeScopeClass:Ie,themeSurface:`app`,themeMode:je,children:(0,Z.jsx)(gr,{workbook:n,children:(0,Z.jsx)(Ae.CommandScopeProvider,{spec:rt,scopeRef:le,elementRef:ue,children:(0,Z.jsx)(Gf.Provider,{value:Ze,children:(0,Z.jsxs)(`div`,{className:Q(`sheetxl-workbook`,qC[`sheetxl-workbook`],qC[`sheetxl-theme`],Pe,Ie,c),style:Nt,"data-sxl-theme-mode":je,...H,ref:Ft,onFocus:e=>{Tt(),l?.(e)},onBlur:e=>{d?.(e)},onKeyDown:e=>{f?.(e)},children:[(0,Z.jsx)(ti,{scopeClass:Ie,tokens:V}),(0,Z.jsxs)(`div`,{className:qC[`sheetxl-reset`],style:Pt,children:[(0,Z.jsxs)(hh,{value:te,children:[F,Mt]}),(0,Z.jsx)(Ae.CommandAnchorProvider,{tracker:ht,keyBindings:!1,children:yt})]}),kt]})})})})})})}));QC.displayName=`WorkbookElementBase`;var $C=e=>{let{colorScheme:t,tokens:n,children:r}=e,[i]=re(qe.Mode,Ke[qe.Mode]),{themeMode:a}=Ee({mode:t??i??void 0}),o=(0,X.useId)(),s=(0,X.useMemo)(()=>Se(`workbook`,o),[o]);return(0,Z.jsxs)(`div`,{className:s,"data-sxl-theme-mode":a,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)(ti,{scopeClass:s,tokens:n}),r]})},ew=(0,X.memo)((0,X.forwardRef)((e,t)=>{let{workbook:n,renderWorkbookError:r=ax,renderWorkbookLoading:i=KC,propsWorkbookLoading:a,onWorkbookChange:o,...s}=e,c=FC(n),l=c.status===`loaded`?c.workbook:null,u=q(o??(()=>{}),[o]),d;return(0,X.useEffect)(()=>{u(l)},[l]),d=c.status===`error`?(0,Z.jsx)($C,{colorScheme:s.colorScheme,tokens:s.tokens,children:(0,Z.jsx)(We,{render:r,props:{error:c.error}})}):c.status===`loaded`?(0,Z.jsx)(QC,{ref:t,...s,workbook:c.workbook,renderWorkbookLoading:i,propsWorkbookLoading:a}):(0,Z.jsx)($C,{colorScheme:s.colorScheme,tokens:s.tokens,children:(0,Z.jsx)(We,{render:i,props:{...a}})}),(0,Z.jsx)(Sf,{children:d})}));ew.displayName=`WorkbookElement`;var tw=`/workbook.sxl`,nw=()=>new Promise(e=>requestAnimationFrame(()=>e())),rw=async()=>{await nw(),await nw()},iw=e=>/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`'${e.replace(/'/g,`''`)}'`,aw,ow,sw=new Promise((e,t)=>{aw=e,ow=t}),cw=fetch(tw).then(e=>{if(!e.ok)throw Error(`workbook fetch failed: ${e.status}`);return e.arrayBuffer()}).then(e=>NC.read({source:e,format:`sxl`,calcOnLoad:`none`})).then(e=>{if(!e)throw Error(`The workbook could not be read.`);return e});cw.catch(e=>ow(e));var lw=X.createRef(),uw=null,dw=(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}}},fw=()=>{let e=lw.current?.getSheetElement();if(!e)throw Error(`The sheet has not rendered.`);return e};window.__sheetxlScreenshot={ready:sw,async measure(e){await sw;let t=await cw,{sheet:n,coords:r}=dw(t,e.range);t.getActiveSheet()!==n&&(await n.select(),await rw());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 rw(),uw={sheet:n,coords:r,headers:e.headers};let s=fw(),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:`${iw(n.getName())}!${n.getRange(r).getA1()}`}},async clip(){if(!uw)throw Error(`measure() must be called before clip().`);let{sheet:e,coords:t,headers:n}=uw,r=await cw;await r.whenFontsReady(),await rw(),await ee(r),await rw();let i=fw().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:`${iw(e.getName())}!${e.getRange(h).getA1()}`}}},fr.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(ew,{ref:lw,workbook:cw,showTabs:!1,showHorizontalScrollbar:!1,showVerticalScrollbar:!1,style:{position:`absolute`,inset:0},onWorkbookLoad:async()=>{await rw(),aw()}}));
|