@sheetxl/mcp 0.8.0-beta.19 → 0.8.0-beta.21
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/{ArL5bPq60ZcPcwU9.js → -NFft0E2Wj6WH3X9.js} +1 -1
- package/assets/{CE4VYOniMmY8sXQ_.js → 0ewqK5X66DZmbhVR.js} +1 -1
- package/assets/{Bk6A5eONxLTBIA_p.js → 1bSTbCnkTWvsV82p.js} +4 -4
- package/assets/{CqvcgwQ0UcKndrhO.js → 4-DOIpV6Hjaymwy7.js} +2 -2
- package/assets/{BgVW1icycJewsx77.js → 69EXDk0YRdjdM86i.js} +1 -1
- package/assets/{D1kI9nJRL1RUF3-E.js → 8wMcuw3b1CFk-D5A.js} +1 -1
- package/assets/{DAnSdO8615XsOPNe.js → AGdlSbOsXWO1oZAE.js} +1 -1
- package/assets/{CjrzyKFdie6KYfsG.js → B1l0k4ErELObdQKE.js} +3 -3
- package/assets/{CIOlYUuBZat8FhHa.js → B4Z_YneQya9mUTN5.js} +1 -1
- package/assets/{D990KjcBrCaAEz5k.js → B8NDzDM0Gpwmkylq.js} +1 -1
- package/assets/{Bpf9jHj5AFY9543y.js → B8URptQcztz4DRvS.js} +39 -39
- package/assets/{CIxf9Y_JsuEEO7Nu.js → BABP2ffkRrOs7_Ym.js} +1 -1
- package/assets/{BPctZbHQFoqJNYzC.js → BAqvmoeYqG6dwX3I.js} +2 -2
- package/assets/{Bl77DvFa09DuVVuj.js → BC2Y5XPkMBKS6jQX.js} +383 -379
- package/assets/{D_6TeeMN5zmoQPTm.js → BEOwJnsyIuMC4SaI.js} +4 -4
- package/assets/{Bgi6ubwGkGYsILci.js → BJo3edG_rqch-Kw2.js} +78 -78
- package/assets/{DT_kCIZ600UsFy4t.js → BM9zwvBRXNbO_uD-.js} +2 -2
- package/assets/{DXe8SG12UJoGbbWR.js → BMkhJwKP7goV0vlJ.js} +1 -1
- package/assets/{iP-shs7tsDGMVvQh.js → BRiLNigzVwOBIxBy.js} +1 -1
- package/assets/{CcGrcjoI12MaDmwV.js → BU7t2vK3_DH_BbMd.js} +2 -2
- package/assets/{CkMXAUkUuJ2LJUBE.js → BVDaUnmVOSaDw9e3.js} +1 -1
- package/assets/{Bw2Nxye4Qj10uA3o.js → BWqKV3QuZX31WPsa.js} +1 -1
- package/assets/{D1nQ_BminCM0cyH0.js → BZJvWc-5DdAyHXFk.js} +1 -1
- package/assets/{CubwsTFIaEVf039H.js → B_RppF41PrYlelc_.js} +1 -1
- package/assets/{BgUHR-HVjZDY4SaH.js → B_n6s7Kj4_5BWn1q.js} +2 -2
- package/assets/{D1ZekPxeTGzhFy2L.js → Bagfe_VVU6NyQNS6.js} +1 -1
- package/assets/{CWHuM2GYuKmi0rZx.js → BbsMdXiRzPW9BCEK.js} +1 -1
- package/assets/{Bbky1A_gIgE8i0Oy.js → BeMLPoHRWacCbpl2.js} +1 -1
- package/assets/{DLJH6ppG9VHjHe_z.js → BneTvtEMcBoSiQnw.js} +3 -3
- package/assets/{C06iKc7jZ6affk2m.js → BrgptoFtJepXL46Z.js} +1 -1
- package/assets/{D06A3fKIe3WCTFru.js → BtiRDaBbNpPpKelt.js} +3 -3
- package/assets/{CKvP54bJ4GkUqcZi.js → BtjG4s0StUieGI5b.js} +3 -3
- package/assets/{DSNaHPvgqymqpsko.js → C0pbMKm0FzhOek9r.js} +1 -1
- package/assets/{DxTzG7VM8v4WJ6cI.js → C1ZP9W2tiVQUwLqZ.js} +1 -1
- package/assets/{1bm0Yqgfehw1Z2QU.js → C1xe-BzKWT17OO8a.js} +13 -13
- package/assets/{7MIo82Ay8jEFMBH-.js → C27330XswujHKrLu.js} +1 -1
- package/assets/{DrkfG324qZRPckuC.js → C2YOx4ianxuIIeMP.js} +1 -1
- package/assets/{CA_22AL82sRhLAko.js → C8huq6_Gvbeyf6Zy.js} +2 -2
- package/assets/{Cgf5GQVN-D8SlQ7A.js → CB9TsE5n0FEyFnAz.js} +15 -15
- package/assets/{Bj1WHx6LIEq6RVGw.js → CBTQ8dknYY7RVQgL.js} +8 -8
- package/assets/{C17Wflhw5IFSgFFY.js → CBqpH_MpBSmQRaGE.js} +1 -1
- package/assets/{BTnTQBSbzYU7cwra.js → CC2hfzradb2KOvtU.js} +1 -1
- package/assets/{D6fQheA4qCS5CxYQ.js → CDKZI2IIZ9boo7zG.js} +1 -1
- package/assets/{CQZq4cA5kbES6htE.js → CDYMLTHkkpRV9igv.js} +1 -1
- package/assets/{BHsQeg6najGesUM4.js → CL348305B-kpRYzz.js} +1 -1
- package/assets/{Cj4MYfqHewu8IOOL.js → CLT0k5UJYPmi8ked.js} +1 -1
- package/assets/{zkoJXSxpRzqfbG8k.js → CME1jbwnNlBD66aW.js} +189 -189
- package/assets/{2nx2Wljhbuct4aKx.js → CPmMYI4DPQcXrZ-g.js} +1 -1
- package/assets/{Bbxkz6vmyZJftTd-.js → CSd5XfU4JBASIwTI.js} +1 -1
- package/assets/{C7Q4V5mU0wsErspO.js → CTLGMulzw-oFbgHy.js} +3 -3
- package/assets/{Ds6LQkRDwXsJ-CFR.js → CVlsdN5C8QL-Kljv.js} +1 -1
- package/assets/{CBSSZrizrucIG_9i.js → CXb2mlCk1s1VFPHU.js} +577 -577
- package/assets/{BfIJP4H3I51jnIVR.js → CZ5v2vTWktJ7qAj1.js} +1 -1
- package/assets/{Gd_0grQd-3D1VPXW.js → CcaH1FoDC8o3dzqp.js} +1 -1
- package/assets/{Se9JmvmEtu4MfXJh.js → Cg05U6rbXUnaz0rA.js} +34 -34
- package/assets/{D4p9Pv82ECKCOlua.js → ChpUbgXIWuQFoXyL.js} +1 -1
- package/assets/{D005GbIBowRGfwed.js → ChwSFUzi5mMzUwdW.js} +6 -6
- package/assets/{CoXgI3MEnvkXeshj.js → CkGQV_x1SpyzePln.js} +262 -258
- package/assets/{DXORLAVmseFlsxkG.js → CmUz8bVbJgWVT-OB.js} +2 -2
- package/assets/{D5OYqo56iGB-5gFG.js → CpLUgqgBDtlfFRj3.js} +1 -1
- package/assets/{DppU35gFSUPaiCQH.js → CrLDmJU84Dbwl6DZ.js} +1 -1
- package/assets/{mrif6ZBbTbZKYaLJ.js → CudjOMo6X7FRW6ME.js} +1 -1
- package/assets/{Cz7tKgNBbnr4DZCb.js → CzQ2o7qoMm0K7KSb.js} +4 -4
- package/assets/{DIPDNtbm8FAru-FQ.js → D-INtJnS1lCrEs8s.js} +105 -105
- package/assets/{DS9HD6_BPxzdun0X.js → D1HLIgumuUqrSyYB.js} +4 -4
- package/assets/{CQiv3YkDRDxTjy0r.js → D2XmpdMAe0SAuQWo.js} +51 -51
- package/assets/{BcYdUKmFOf5rn2VZ.js → D3RuKyCyAzvT0bGL.js} +1 -1
- package/assets/{bJ-XKvDf7IkAafUI.js → D5mfuGSeGXSDHj9-.js} +1 -1
- package/assets/{C53f6C0pAU7_9FI-.js → D7WSYqvuwNQjOIuO.js} +1 -1
- package/assets/{Bk6SeqUJkn7ft1y1.js → D9F0224gK4j4Iuq9.js} +1 -1
- package/assets/{BSNegq0YcivZJmkf.js → DBgOeiZg40MS63pB.js} +14 -14
- package/assets/{Di_C31GTbBJ_xVOK.js → DG3hKZ75iK2wrCcz.js} +1 -1
- package/assets/{rT5f4v0Q_61nHkff.js → DITcEcZJ58z5yOx7.js} +1 -1
- package/assets/{Bq6ocyztkvzKxMMC.js → DO86fHS3WYzHN_Rv.js} +1 -1
- package/assets/{DxKZjKyewqvj46S2.js → DO9RVxvm9vQh8A_j.js} +2 -2
- package/assets/{EkavVNuGWG95UggH.js → DOYXEbY_WslpyqXW.js} +5 -5
- package/assets/{BGLlbVFS6J3lt9Lw.js → DP-m2vK0GTaYqQZM.js} +1 -1
- package/assets/{Curuj_knAdRpMy1L.js → DRiAktGToP73uwgm.js} +208 -208
- package/assets/{DtD0J-7IetHv5o6E.js → DRqBWzdn9KKN68o8.js} +11 -11
- package/assets/{Cur_-XiBPijLpwxX.js → DX0znk3xZmL1AyX8.js} +1 -1
- package/assets/{D-LrOz3Yvp17bUT8.js → Deu2acNFlgo__Mcd.js} +2 -2
- package/assets/{GZJ4AFFt8qKRADOa.js → DjCHmGw-ixoQ6ZTA.js} +2 -2
- package/assets/{B7vRFm79CUJ1VvFw.js → DjbBTiei0H-BIJaN.js} +1 -1
- package/assets/{DngcuWO2cSuMCMu1.js → DmJc5VoPPwBBtLIG.js} +1 -1
- package/assets/{BiOrM24CFYL1JGFE.js → DnQM29yv6KQQOVfl.js} +2 -2
- package/assets/{LV6tvjnxRzrWaFb8.js → Dnn8laImZHy8LouL.js} +1 -1
- package/assets/{CrjUfkCuRaXUC8X8.js → DpgBOcByebrqzUrC.js} +3 -3
- package/assets/{BUHEmX1fseJVV65_.js → DqxW6EBLDV_6Eegk.js} +1 -1
- package/assets/DrgkN0g7OHuD4iD6.js +14 -0
- package/assets/{BQkQNqRh5xxYhBy4.js → DsK1Adz0vo-1zPkp.js} +1 -1
- package/assets/{CiJq0zSDKpaKhL3y.js → Dt5rA9gefJFLoaeI.js} +2 -2
- package/assets/{Bz1lp0mtNAoPuPve.js → DuCNecyIYfZL27SV.js} +1 -1
- package/assets/{CYTPpV3lqNGOwme7.js → DwqgvpYiTLOQd5wm.js} +2 -2
- package/assets/{DHL-ZmN5GzB4pIrM.js → Dzxe5kLF5GOfh0_l.js} +1 -1
- package/assets/{ht0UxaAlRnuYUvpx.js → FOKynZCiA0wU2Spf.js} +1 -1
- package/assets/{DwcKSqV5YEBBA8hY.js → H1ICg_-K5ADFNHJj.js} +1 -1
- package/assets/{DnMDfty7pU96BIEJ.js → H89MX09YsAj7NAk3.js} +1 -1
- package/assets/{C_v4hb9WXIt639Cm.js → I-GZ5PL9n_Sv5yAJ.js} +1 -1
- package/assets/{Ln7XTzksutZHFpml.js → IEmEQHg895CUpAQq.js} +1 -1
- package/assets/{DNtWf9lfGjzoB9Hy.js → I_yb1hhLA5bYPpWx.js} +1 -1
- package/assets/{B6A2URH-mIs7J54h.js → KQGPPHM486XPeClF.js} +2 -2
- package/assets/{DFlL4pAqxaQ_hVe1.js → KSE7OWDMxhbfYt82.js} +30 -30
- package/assets/{DOg_zvSkhsKmw4q1.js → M62BqR7TbmgOzAEW.js} +3 -3
- package/assets/{udbHvSLquJ5xGK3R.js → NEzc406_2k2MuiE3.js} +2 -2
- package/assets/{zEyWjY3NhC8w_spQ.js → Q2j8yQZX1kL_MbbB.js} +573 -572
- package/assets/{BbvOmnXrmBNjeWjQ.js → QMCI00ZCedkNJd8C.js} +1 -1
- package/assets/{-iaCg5U9jrEDEl_O.js → RFPO1vKnkkgwx5Bs.js} +1 -1
- package/assets/{0hHP9xpWzhkDrCTL.js → VcTnn2qw_4tmyctb.js} +1 -1
- package/assets/{BkhdNc3LdmcyAjwk.js → Vo34QvIefEN595xl.js} +8726 -8652
- package/assets/{vb-L2Q2jyjjgDvJy.js → _l84VPWmScznS-9F.js} +11 -11
- package/assets/{jPim6WG_KS-ZDker.js → _oaPA65Bm2idKW7f.js} +1 -1
- package/assets/{B8Z4-80QEORmYOJ9.js → bpjLDXWxL6nDt4Mv.js} +1 -1
- package/assets/{CjoRkjB9NzS4LaFy.js → fUmGsmpgGhd8eZn2.js} +1 -1
- package/assets/{DwWcXC4pUR3U2WXU.js → pg0OaBJVRnW7uSz5.js} +1 -1
- package/assets/{HVm22OJ1gEeY8kii.js → rIQ1pzaGFqvCfzOk.js} +1 -1
- package/assets/{BzkTa7l_e7R--ejo.js → raa4clZOm0L5A0zR.js} +540 -540
- package/assets/{exNO4fmccU8Aq8cE.js → rejXA2fTAujW3QRv.js} +276 -276
- package/assets/{b6GPrIkdzfTW4f2j.js → rhT64BvdSLOEwglQ.js} +1 -1
- package/assets/{CNPUPTd9h7hwijpZ.js → vItpZkDtFsjwsJzb.js} +60 -60
- package/assets/{CqOzqRIQFCnEegoB.js → vXmCJwJaPhkPVhy8.js} +1 -1
- package/index.js +1775 -1712
- package/lib.js +1 -1
- package/licenses/dependencies.txt +46 -46
- package/package.json +2 -2
- package/screenshot-page/assets/{DwNHMH9f_lQyn50d.js → 1s5we6Eqz8n3o0X_.js} +1 -1
- package/screenshot-page/assets/9WplgXo__vp3e1Su.js +2 -0
- package/screenshot-page/assets/B2oadmu_j6WfNbZ1.js +1 -0
- package/screenshot-page/assets/{BU5vg917ZnXC04e-.js → B5ujsbfF1ZBkPI4d.js} +2 -2
- package/screenshot-page/assets/BEzCH6tp_dlxe7BH.js +1 -0
- package/screenshot-page/assets/BJvuevnsIw3DXQds.js +2 -0
- package/screenshot-page/assets/BLON9pILfrgdZqAM.js +5 -0
- package/screenshot-page/assets/BVx7CEdRItIR30Fz.js +1 -0
- package/screenshot-page/assets/{CLcTX_nmvaVPsxDl.js → Bdt92xZzFotX0vdt.js} +1 -1
- package/screenshot-page/assets/{BF6igzahAW9pl35p.js → Ble2ESZnJzZnd3cc.js} +1 -1
- package/screenshot-page/assets/{DeGMS3crYErjsRrw.js → Blg5f-jAtZfGnZ71.js} +1 -1
- package/screenshot-page/assets/Bozva6Wr4B8Q5QZN.js +2 -0
- package/screenshot-page/assets/{Chq6rvtA5qZAwYG4.js → Brp37MPC60tt9V3N.js} +1 -1
- package/screenshot-page/assets/Bs65RHirk11sxOB9.js +39 -0
- package/screenshot-page/assets/{MzJpKWgPrxR1UN-Y.js → BtydzT-AjL_LBr8x.js} +1 -1
- package/screenshot-page/assets/Bu5h0ACtvNxDBmqw.js +1 -0
- package/screenshot-page/assets/BwFvwFIcX0dmcBt7.js +1 -0
- package/screenshot-page/assets/C0rOvlmOfLDpClJ_.js +1 -0
- package/screenshot-page/assets/{Cpwg3bWAqBBcgBmv.js → CBuH_YHDn7A9E_hX.js} +2 -2
- package/screenshot-page/assets/CHZ1925OpIa8ssZn.js +1 -0
- package/screenshot-page/assets/{BuzI4z8RJGOw8BZD.js → CN3dPtUjDVvcnA4e.js} +1 -1
- package/screenshot-page/assets/COO3CwHTbCgxybBd.js +1 -0
- package/screenshot-page/assets/CR8Rj_GpSbIqbaEO.js +13 -0
- package/screenshot-page/assets/{EY31tFQrw7iYFrr6.js → CV9T0juyAiRmwTR-.js} +2 -2
- package/screenshot-page/assets/ClC7zkHPp6egPrjL.js +2 -0
- package/screenshot-page/assets/{Dt1A-DUBfvyouz_T.js → CtS8qZB4_3skg_zL.js} +1 -1
- package/screenshot-page/assets/CwutTi2EnNm_hyVj.js +1 -0
- package/screenshot-page/assets/{BqlVqRKpsFGl-elI.js → CxithxkenssFkfTT.js} +23 -23
- package/screenshot-page/assets/{DjVxI3p3ssmCtYky.js → CzZu7Fd_VeHHL-4i.js} +1 -1
- package/screenshot-page/assets/CzijGQrSoteeqwmH.js +2 -0
- package/screenshot-page/assets/{RutPv2GFWmeBiWvn.js → D4VgxwLDPUfCxPS9.js} +2 -2
- package/screenshot-page/assets/DG6q1MKITeSM4XMx.js +1 -0
- package/screenshot-page/assets/DHTXoT_pArB1opyI.js +48 -0
- package/screenshot-page/assets/{Cx9lvo3Q1xOwYkRK.js → DHUomRu_S2zcBWwt.js} +4 -4
- package/screenshot-page/assets/DP2wwd1IM_gQtEaG.js +1 -0
- package/screenshot-page/assets/DQeIWKasFD3DnWL7.js +586 -0
- package/screenshot-page/assets/Ja-xcEStEdmh2Gwb.js +2 -0
- package/screenshot-page/assets/ODq-dKb9mTtqEIJl.js +1 -0
- package/screenshot-page/assets/VF7dro9jrDEAX6kD.js +3 -0
- package/screenshot-page/assets/{BWDqL5_mwspr6CjI.js → Yz4ksf-M05RGdHO3.js} +1 -1
- package/screenshot-page/assets/Z7Av7oqfaK7wy7Eb.js +1 -0
- package/screenshot-page/assets/{CrUIo7hXByCWY7in.js → bdWMVOcMKRI8kCDE.js} +1 -1
- package/screenshot-page/assets/kJwY8fmEeWlAtTAc.js +1 -0
- package/screenshot-page/assets/{ClWDZixRy4DFZdI5.js → p9abCAJQdpScjZVK.js} +1 -1
- package/screenshot-page/index.html +8 -8
- package/types/scripting-api.json +9338 -9337
- package/types/scripting.d.ts +24 -3
- package/assets/gCkru9Vv-Ban4DCD.js +0 -14
- package/screenshot-page/assets/1yHlU53ypZZelMPx.js +0 -1
- package/screenshot-page/assets/A_-Jwzwmm3lkcm2f.js +0 -586
- package/screenshot-page/assets/BX9VkTqZoroo08EG.js +0 -13
- package/screenshot-page/assets/BdDouZl3VrM4yBP5.js +0 -2
- package/screenshot-page/assets/CJmdRzGWq0FZMrp5.js +0 -1
- package/screenshot-page/assets/C_vPl50T1L5HWnhv.js +0 -1
- package/screenshot-page/assets/CaTGa2NvuuE3qJAV.js +0 -1
- package/screenshot-page/assets/Cb8ORg9ENgscK6yl.js +0 -2
- package/screenshot-page/assets/CmNlzN3DCl87wNU2.js +0 -1
- package/screenshot-page/assets/CoPUxkU9zZy0dXti.js +0 -2
- package/screenshot-page/assets/CqogMOf7MzkOk7as.js +0 -2
- package/screenshot-page/assets/Cv-YUArreXqhafcU.js +0 -2
- package/screenshot-page/assets/D0nZlczIH0ULuSyL.js +0 -3
- package/screenshot-page/assets/D1ZZiOS7_HFjpZCA.js +0 -1
- package/screenshot-page/assets/D23_69pojBfIh4nV.js +0 -5
- package/screenshot-page/assets/D24UBy2L73pOCPPw.js +0 -1
- package/screenshot-page/assets/D2q4M3I5Jmxm85P2.js +0 -1
- package/screenshot-page/assets/D6LmZnV2h3Kg7G3e.js +0 -1
- package/screenshot-page/assets/DAkSmFRVds51vhiy.js +0 -1
- package/screenshot-page/assets/DUFPgv-3CtD_sCVO.js +0 -1
- package/screenshot-page/assets/DegZKTNqt1LRnSxY.js +0 -1
- package/screenshot-page/assets/DwuLl9Ua1k8m9KcK.js +0 -1
- package/screenshot-page/assets/fQ13z3k3bntY-jfw.js +0 -1
- package/screenshot-page/assets/oO6aFwepb3DDkGYF.js +0 -39
- package/screenshot-page/assets/pH9rKZYDE8xrhkC4.js +0 -2
- package/screenshot-page/assets/w7IQEh1FiqZA6o5y.js +0 -42
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{F as e,G as t,I as n,L as r,_ as i}from"./ChSvXfVMLxZsP9zG.js";import{C as a,D as o,K as s,Kt as c,Ot as l,R as u,X as d,Yt as f,Z as p,ht as m,t as h,v as g}from"./DuYb_otrRZZDq6-f.js";import{c as _,i as v,r as y,t as b}from"./CQukCzhuewMuFOlO.js";import{Bn as x,Br as S,Ot as C,Q as w,Ta as T,Xt as E,Zn as D,en as O,f as k,fa as ee,ia as A,lt as j,m as M,yn as te}from"./A_-Jwzwmm3lkcm2f.js";import{r as ne,s as N}from"./EY31tFQrw7iYFrr6.js";import{$ as re,$n as ie,$t as ae,A as P,B as oe,Bt as F,C as se,Ct as ce,D as le,Dn as ue,Dr as I,E as de,Er as L,F as fe,Fr as pe,Ft as me,G as he,Gn as ge,Gt as _e,Hn as ve,Hr as ye,Ht as be,I as xe,In as Se,It as Ce,J as we,Jn as Te,Jt as Ee,Kn as De,Mt as Oe,Nt as ke,O as Ae,On as je,Ot as Me,P as Ne,Pn as Pe,Pr as Fe,Pt as Ie,Qn as Le,Rn as Re,Rt as ze,Sn as Be,Sr as Ve,St as He,Tn as Ue,Tr as We,Tt as Ge,U as Ke,Un as qe,Ut as Je,Vn as Ye,Vr as Xe,Vt as Ze,Wn as Qe,Wt as R,X as $e,Xn as et,Y as tt,Yt as nt,Z as rt,Zn as it,_r as at,a as ot,an as st,at as ct,bn as lt,cn as ut,cr as dt,d as ft,dn as pt,dr as mt,dt as ht,er as gt,f as _t,fn as vt,fr as yt,ft as bt,g as xt,gr as St,gt as Ct,hn as wt,ht as Tt,ir as Et,j as Dt,jn as Ot,jr as kt,kn as At,kr as jt,kt as Mt,l as Nt,lr as Pt,m as Ft,mn as It,mr as Lt,mt as Rt,n as zt,nn as Bt,nr as Vt,nt as Ht,o as Ut,p as Wt,pr as Gt,pt as Kt,q as qt,rn as Jt,rr as Yt,rt as Xt,sr as Zt,st as Qt,t as $t,tr as en,tt as tn,u as nn,un as rn,ur as an,ut as on,v as sn,vr as cn,vt as ln,wn as z,wr as un,xt as dn,y as fn,yr as pn,yt as B,zn as mn,zr as hn}from"./oO6aFwepb3DDkGYF.js";import{a as gn,c as _n,i as vn,l as yn,n as bn,r as xn}from"./BWDqL5_mwspr6CjI.js";import{t as Sn}from"./Cpwg3bWAqBBcgBmv.js";var Cn=[[`%EntityServiceId`,`i`],[`_DisplayString`,`s`],[`%EntityId`,`s`],[`%EntityCulture`,`s`],[`_Icon`,`s`]],wn=[[`%cvi`,`r`]],Tn=[[`ShowInCardView`,`0`],[`ShowInDotNotation`,`0`],[`ShowInAutoComplete`,`0`],[`ExcludeFromCalcComparison`,`1`]],En=e=>{let t=e.getName(),n=t.lastIndexOf(`:`);return n>0?t.substring(0,n):t},Dn=e=>e instanceof E&&En(e.getKind())===`#spb`,On=e=>``+e,kn=(e,t)=>{let n=[];return e?.cardView&&n.push([`ShowInCardView`,`0`]),e?.dotNotation&&n.push([`ShowInDotNotation`,`0`]),e?.autoComplete&&n.push([`ShowInAutoComplete`,`0`]),t&&e?.calcCompare&&n.push([`ExcludeFromCalcComparison`,`1`]),n},An=`resourcesById`,V=class{constructor(e){this._kind=e.kind,this._contentType=e.contentType,this._relTypeUri=e.relTypeUri,this._path=e.path,this._regeneratesRelationships=e.regeneratesRelationships??!1}regeneratesRelationships(){return this._regeneratesRelationships}getKind(){return this._kind}getContentType(e){return this._contentType}getRelTypeUri(e){return this._relTypeUri}getPath(e){return typeof this._path==`function`?this._path(e):this._path}},jn=class e{constructor(e,t,n){this.zipWriter=e,this.outputKind=t,this.outWritable=n}static createUint8Array(t){let n=new Lt,r=new zt(n,t);return new e(r,`uint8array`)}static createBlob(t){let n=new mt(`application/zip`),r=new zt(n,t);return new e(r,`blob`)}static createWritableStream(t,n){let r=new zt(t,n);return new e(r,`writable`,t)}async add(e,t,n){let r=function(e){let t=e.replace(/\\/g,`/`).trim();for(;t.startsWith(`/`);)t=t.slice(1);return t}(e),i={level:n?.level,password:n?.password,encryptionStrength:n?.encryptionStrength,zipCrypto:n?.zipCrypto,lastModDate:n?.lastModDate,keepOrder:n?.keepOrder,uncompressedSize:n?.uncompressedSize,dataDescriptor:n?.dataDescriptor,passThrough:n?.passThrough,compressionMethod:n?.compressionMethod,crc32:n?.signature};if(typeof t==`string`)return void await this.zipWriter.add(r,new At(t),i);if(t instanceof Uint8Array||ArrayBuffer.isView(t)||t&&typeof t.byteLength==`number`&&typeof t.byteOffset==`number`){try{await this.zipWriter.add(r,new Le(t),i)}catch(e){throw console.log(`Error adding Uint8Array source to zip:`,r,i),e}return}let a=(o=t)&&typeof o.getReader==`function`?t:function(e){let t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let{value:n,done:r}=await t.next();r?e.close():e.enqueue(n)},async cancel(e){if(typeof t.return==`function`)try{await t.return(e)}catch{}}})}(t);var o;await this.zipWriter.add(r,a,i)}async close(e){let t=e?.comment,n=await this.zipWriter.close(t,{});return this.outputKind===`writable`?this.outWritable??n:n}};function Mn(e){let t=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),n=e=>t(e).replace(/"/g,`"`),r=e=>{if(!e)return``;let t=``;for(let[r,i]of Object.entries(e))i!==void 0&&!1!==i&&(t+=!0===i?` ${r}="1"`:` ${r}="${n(String(i))}"`);return t},i=new TextEncoder,a=``,o=()=>{a&&=(e.write(i.encode(a)),``)},s=e=>{a+=e,a.length>65536&&o()},c=[],l=null,u=[],d=!0;return{decl(){s(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`)},pushDefaultNamespace(e){c.push(e),l=e},getDefaultNamespace:()=>c.length>0?c[c.length-1]:null,popDefaultNamespace(){c.length>0&&(c.pop(),l=c.length>0?c[c.length-1]:null)},start(e,t){d&&u.push({tag:e,attrs:t,bufferPos:a.length});let n=e;l&&e.indexOf(`:`)===-1&&(n=`${l}:${e}`),s(`<${n}${r(t)}>`)},empty(e,t){let n=e;l&&e.indexOf(`:`)===-1&&(n=`${l}:${e}`),s(`<${n}${r(t)}/>`)},text(e){s(t(String(e)))},raw(e){s(e)},end(e){let t;if(d){if(u.length===0)throw Error(`XML Writer: Unexpected end tag </${e}> - no matching start tag`);if(t=u[u.length-1],t.tag!==e)throw Error(`XML Writer: End tag </${e}> does not match start tag <${t.tag}>`)}let n=e;if(l&&e.indexOf(`:`)===-1&&(n=`${l}:${e}`),d){let e=a.length,i=`<${n}${r(t.attrs)}>`.length;e===t.bufferPos+i?(a=a.slice(0,t.bufferPos),s(`<${n}${r(t.attrs)}/>`)):s(`</${n}>`),u.pop()}else s(`</${n}>`)},close(){o()},setValidationDisabled(e){d=!e}}}function Nn(e){switch(e.kind){case`bytes`:return e.bytes;case`text`:return e.text;case`stream`:return e.stream;case`xmlStream`:{let t=[],n=Mn({write:e=>t.push(e)});return e.writeXml(n),n.close(),function(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}(t)}case`xmlStreamed`:return e.write()}}function Pn(e){let t=Fn(e);if(!t)return`_rels/.rels`;let n=t.lastIndexOf(`/`),r=n>=0?t.slice(0,n):``;return`${r?`${r}/_rels`:`_rels`}/${n>=0?t.slice(n+1):t}.rels`}function Fn(e){let t=(e??``).replace(/\\/g,`/`).trim();for(;t.startsWith(`/`);)t=t.slice(1);return t}function In(e){let t=(e??``).replace(/\\/g,`/`).trim();return t.startsWith(`/`)||(t=`/`+t),t}function Ln(e){let t=/^rId(\d+)$/.exec(e);return t?parseInt(t[1],10):2**53-1}function Rn(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/"/g,`"`).replace(/>/g,`>`)}function zn(e,t,n,r=!1){let i=t;if(t.startsWith(`/`))i=t.slice(1);else{if(!e)throw Error(`Relative path "${t}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);i=(e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)+1):``)+t}if(i=Bn(i),!i.includes(`{n}`)){if(!r&&n.has(i))throw Error(`Path already existing path: ${i}`);return i}let a,o=1;do if(a=i.replace(/{n}/g,String(o)),o++,o>1e4)throw Error(`Failed to resolve path template "${t}" after 10000 attempts. This likely indicates a bug or an impossible constraint.`);while(n.has(a));return a}function Bn(e){let t=e.split(`/`),n=[];for(let r of t)if(r!==``&&r!==`.`){if(r===`..`){if(n.length===0)throw Error(`Invalid path: too many ".." segments in "${e}"`);n.pop()}else n.push(r)}return n.join(`/`)}function Vn(e,t){if(!e)return t;let n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``,r=n?n.split(`/`):[],i=t.split(`/`),a=0,o=Math.min(r.length,i.length-1);for(let e=0;e<o&&r[e]===i[e];e++)a++;let s=r.length-a;return`../`.repeat(s)+i.slice(a).join(`/`)}function Hn(e){return new TextEncoder().encode(e)}function Un(e,t){return function(e,t=` `){let n=``,r=0,i=e.split(/(<[^>]+>)/g).filter(Boolean);for(let e=0;e<i.length;e++){let a=i[e];if(a.trim()){if(a.startsWith(`<?`))n+=a+`
|
|
2
|
-
`;else if(a.startsWith(`</`))r--,r<0&&console.warn(`XML formatting warning: negative indentation depth: ${a}`),n+=t.repeat(Math.max(r,0))+a+`
|
|
3
|
-
`;else if(a.startsWith(`<`)){let e=a.endsWith(`/>`);n+=t.repeat(r)+a+`
|
|
4
|
-
`,e||r++}else n+=t.repeat(r)+a.trim()+`
|
|
5
|
-
`}}return n}(function(e){return new TextDecoder(`utf-8`).decode(e)}(e),t)}var Wn=class{constructor(e){this.rels=[],this.usedIds=new Set,this.reservedIds=new Set,this.nextId=1,this.sourcePart=Fn(e)}add(e,t,n){let r=n?.idHint&&!this.usedIds.has(n.idHint)?n.idHint:void 0;if(!r)do r=`rId`+this.nextId++;while(this.usedIds.has(r)||this.reservedIds.has(r));let i=/^rId(\d+)$/.exec(r);return i&&(this.nextId=Math.max(this.nextId,parseInt(i[1],10)+1)),this.usedIds.add(r),this.rels.push({id:r,type:e,target:t,targetMode:n?.external?`External`:void 0}),r}reserve(e){for(let t of e){if(!t)continue;this.reservedIds.add(t);let e=/^rId(\d+)$/.exec(t);e&&(this.nextId=Math.max(this.nextId,parseInt(e[1],10)+1))}}list(){return this.rels}toXmlBytes(){let e=[...this.rels].sort((e,t)=>Ln(t.id)-Ln(e.id)||e.id.localeCompare(t.id)),t=[];t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`),t.push(`<Relationships xmlns="${Gn}">`);for(let n of e){let e=[`Id="${Rn(n.id)}"`,`Type="${Rn(n.type)}"`,`Target="${Rn(n.target)}"`];n.targetMode===`External`&&e.push(`TargetMode="External"`),t.push(`<Relationship ${e.join(` `)}/>`)}return t.push(`</Relationships>`),Hn(t.join(``))}},Gn=`http://schemas.openxmlformats.org/package/2006/relationships`,Kn=class{constructor(){this._defaultsSet=new Set,this._overridesSet=new Set,this._defaults=[],this._overrides=[]}addDefault(e,t){let n=function(e){let t=(e??``).trim().toLowerCase();return t.startsWith(`.`)&&(t=t.slice(1)),t}(e);this._defaultsSet.has(n)||(this._defaultsSet.add(n),this._defaults.push({key:n,content:t}))}addOverride(e,t){let n=In(e);this._overridesSet.has(n)||(this._overridesSet.add(n),this._overrides.push({key:n,content:t}))}replaceOverride(e,t){let n=In(e);if(!this._overridesSet.has(n))return;let r=this._overrides.find(e=>e.key===n);r&&(r.content=t)}toXmlBytes(){let e=[];e.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`),e.push(`<Types xmlns="${qn}">`);let t=this._defaults.reverse();this.addDefault(`rels`,`application/vnd.openxmlformats-package.relationships+xml`),this.addDefault(`xml`,`application/xml`);for(let{key:n,content:r}of t)e.push(`<Default Extension="${Rn(n)}" ContentType="${Rn(r)}"/>`);let n=this._overrides;for(let{key:t,content:r}of n)e.push(`<Override PartName="${Rn(t)}" ContentType="${Rn(r)}"/>`);return e.push(`</Types>`),Hn(e.join(``))}},qn=`http://schemas.openxmlformats.org/package/2006/content-types`,Jn=class{constructor(e){this.parts=[],this.relsRoot=new Wn(``),this.relsByPart=new Map,this.contentTypes=new Kn,this.zip=e}addContentType(e,t){let n=Fn(e);this.contentTypes.addOverride(`/`+n,t)}addDefaultType(e,t){this.contentTypes.addDefault(e,t)}replaceContentType(e,t){this.contentTypes.replaceOverride(`/`+Fn(e),t)}addPart(e,t,n,r){let i=Fn(e);this.parts.push({path:i,body:t,optionsZip:r}),n&&this.contentTypes.addOverride(`/`+i,n)}rels(e){let t=Fn(e||``);if(!t)return this.relsRoot;let n=this.relsByPart.get(t);return n||(n=new Wn(t),this.relsByPart.set(t,n)),n}async emit(){let e=[...this.parts].sort((e,t)=>e.path.localeCompare(t.path));for(let t of e){let e=Nn(t.body);await this.zip.add(t.path,e,t.optionsZip)}let t=this.relsRoot.toXmlBytes();await this.zip.add(`_rels/.rels`,t,{});let n=[...this.relsByPart.values()].sort((e,t)=>e.sourcePart.localeCompare(t.sourcePart));for(let e of n){let t=Pn(e.sourcePart),n=e.toXmlBytes();await this.zip.add(t,n,{})}let r=this.contentTypes.toXmlBytes();await this.zip.add(`[Content_Types].xml`,r,{})}async build(e){return await this.emit(),await this.zip.close(e)}},Yn=new Set([`xl/calcChain.xml`]),Xn=`xl/workbook.xml`,Zn=[];function Qn(e){return e===`[Content_Types].xml`||$n.test(e)}var $n=/^(?:(.*)\/)?_rels\/(.*)\.rels$/;function er(e){if(e===`_rels/.rels`)return``;let t=$n.exec(e);if(!t)return null;let n=t[1]??``,r=t[2];return n?`${n}/${r}`:r}function tr(e){return e.startsWith(`#`)}function nr(e,t){if(t.startsWith(`/`))return Bn(t);let n=e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;return Bn((n?n+`/`:``)+t)}var rr=class{constructor(e,t,n){this._queue=[],this._scheduledByNodeKey=new Map,this._nodesByPath=new Map,this._writtenPaths=new Set,this._regeneratedPaths=new Set,this._explicitRelTargets=new Set,this._partWriter=new Jn(e),this._registry=t,this._options=n??{},this._mapState=this._options.mapState??new Map,this._sourcePackage=this._options.sourcePackage??null,this._macroEnabled=this._options.macroEnabled??!1,this._template=this._options.template??!1,this._reserveSourceRelIds(``)}_isSourcePartCarried(e){let t=this._sourcePackage;return!(!t||!t.has(e))&&!Yn.has(e)&&!t.isAbsorbed(e)&&!(!this._macroEnabled&&e===`xl/vbaProject.bin`)&&!Qn(e)&&(!t.hasStructuralChange()||!function(e){return Zn.some(t=>t.test(e))}(e))}_reserveSourceRelIds(e){let t=this._sourcePackage?.getPart(Pn(e));t&&this._partWriter.rels(e).reserve(xt(t.data).map(e=>e.id))}async waitEmit(){let e=this._queue;for(;e.length;){let t=e.shift();await this._processPart(t)}}async build(e){return await this.waitEmit(),this._passthroughSourceParts(),this._applyWorkbookContentTypeVariant(),await this._partWriter.build(e??{})}_passthroughSourceParts(){let e=this._sourcePackage;if(!e)return;let t=new Set(this._writtenPaths),n=[];for(let r of e.getNames())t.has(r)||this._isSourcePartCarried(r)&&n.push(r);let r=new Set(t);for(let e of n)r.add(e);let i=e.getPart(`[Content_Types].xml`),a=i?Ge(i.data):null;if(a)for(let{ext:e,contentType:t}of a.defaults)this._partWriter.addDefaultType(e,t);for(let t of n){let n=e.getPart(t),r=a?.overrides.get(`/`+t);n.raw?this._partWriter.addPart(t,{kind:`bytes`,bytes:n.raw.compressedData},r,{passThrough:!0,compressionMethod:n.raw.compressionMethod,signature:n.raw.signature,uncompressedSize:n.uncompressedSize}):this._partWriter.addPart(t,{kind:`bytes`,bytes:n.data},r),this._writtenPaths.add(t)}for(let n of e.getNames()){if(n===`[Content_Types].xml`||!Qn(n))continue;let i=er(n);i!==null&&(i===``||r.has(i))&&(e.isAbsorbed(i)||this._regeneratedPaths.has(i)||this._mergeSourceRelsInto(i,e.getPart(n).data,t,r))}}_applyWorkbookContentTypeVariant(){if(this._template){let e=this._macroEnabled?`application/vnd.ms-excel.template.macroEnabled.main+xml`:`application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml`;this._partWriter.replaceContentType(Xn,e)}else this._macroEnabled&&this._partWriter.replaceContentType(Xn,`application/vnd.ms-excel.sheet.macroEnabled.main+xml`)}_mergeSourceRelsInto(e,t,n,r){let i=this._partWriter.rels(e),a=e===``||n.has(e);for(let o of xt(t)){if(o.external||tr(o.target)){i.add(o.type,o.target,{external:o.external,idHint:o.id});continue}let t=nr(e,o.target);a&&(n.has(t)||this._explicitRelTargets.has(`${e}::${t}`))||(r.has(t)?i.add(o.type,o.target,{idHint:o.id}):this._registry.ownsRelType(o.type)||Yn.has(t)||this._sourcePackage?.isAbsorbed(t)||console.warn(`Dropping preserved relationship to missing part '${t}'`,e||`(root)`))}}addPart(e,t,n,r){return this._addPartInternal(``,e,t,n,r)}_addPartInternal(e,t,n,r,i){let a=this._registry.get(t);if(!a)throw Error(`No emitter registered for kind '${t}'.`);let o=a.getContentType(n),s=a.getRelTypeUri(n),c=r??a.getPath?.(n);if(!c)throw Error(`No path provided in either argument or emitter.`);let l=this._writtenPaths,u=zn(e,c,l),d=`${t}:${u}`,f=this._scheduledByNodeKey.get(d);if(!f){let e;a.regeneratesRelationships?.()?this._regeneratedPaths.add(u):this._reserveSourceRelIds(u),f={kind:t,key:d,payload:n,path:u,contentType:o,promise:new Promise(t=>{e=t}),resolve:e},this._scheduledByNodeKey.set(d,f),this._queue.push(f)}let p=this._nodesByPath.get(e);p||(p=new Set,this._nodesByPath.set(e,p)),p.add(d),!o||s||e||this._partWriter.rels(``).add(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,u);let m=null;if(s){let t=Vn(e,f.path);m=this._partWriter.rels(e).add(s,t,{idHint:i})}return l.add(u),{path:u,contentTypeUri:o,relId:m}}addBinary(e,t,n,r,i=!1,a){return this._addBinaryInternal(``,e,t,n,r,i,a)}_addBinaryInternal(e,t,n,r,i,a=!1,o){if(!i)throw Error(`No path provided for binary.`);if(!n)throw Error(`No content type provided for binary.`);let s=this._writtenPaths,c=zn(e,i,s,a),l=null;if(r){let t=Vn(e,c);l=this._partWriter.rels(e).add(r,t,{idHint:o})}if(e||this._partWriter.rels(``).add(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,c),!s.has(c)){let e=c.split(`.`).pop()||``;e&&this._partWriter.addDefaultType(e,n),this._partWriter.addPart(c,{kind:`bytes`,bytes:t},void 0,{level:0,uncompressedSize:t.byteLength,dataDescriptor:!1}),s.add(c)}return{path:c,contentTypeUri:n,relId:l}}async _waitForDescendants(e){let t=this._nodesByPath.get(e);if(!t||t.size===0)return;let n=[];for(let e of t){let t=this._scheduledByNodeKey.get(e);t&&n.push(this._processPart(t).then(()=>this._waitForDescendants(t.path)))}await Promise.all(n),this._nodesByPath.delete(e)}async _processPart(e){if(e.processed)return e.promise;e.processed=!0;let t=this._registry.get(e.kind),n=e.path;this._partWriter.addContentType(e.path,e.contentType);try{let r=[],i={write:e=>{r.push(e)}},a;await t.emit(e.payload,{getXMLWriter:()=>a||(a=Mn(i),a),addPart:(e,t,r,i)=>this._addPartInternal(n,e,t,r,i),addBinary:(e,t,r,i,a=!1,o)=>this._addBinaryInternal(n,e,t,r,i,a,o),addExternal:(e,t,r)=>({path:t,contentTypeUri:null,relId:this._partWriter.rels(n).add(e,t,{external:!tr(t),idHint:r})}),addRelationship:(e,t,r)=>{if(!this._writtenPaths.has(t)&&!this._isSourcePartCarried(t))return null;let i=Vn(n,t),a=this._partWriter.rels(n).add(e,i,{idHint:r});return this._explicitRelTargets.add(`${n}::${t}`),a},carriesSourcePart:e=>!this._writtenPaths.has(e)&&this._isSourcePartCarried(e),waitEmit:()=>this._waitForDescendants(e.path),getPath:()=>e.path,getSharedStates:()=>this._mapState,warn:(t,n,r)=>{let i=n??e.path,a=this._options.onWarning;a?a(t,i,r):console.warn(t,i)},log:(t,n)=>{console.warn(t,n??e.path)}});let o=function(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}(r),s=this._options.onPartEmitted;s&&await s(e.kind,e.path,o),ir&&(console.log(`\n=== ${e.path} ===`),console.log(Un(o))),this._partWriter.addPart(e.path,{kind:`bytes`,bytes:o},e.contentType)}catch(t){throw this._options.onPartError?.(e.kind,e.path,t),t}finally{this._scheduledByNodeKey.delete(e.key),e.resolve()}}},ir=!1,ar=class{constructor(){this.map=new Map}register(e){let t=e.getKind();if(this.map.has(t))throw Error(`Duplicate part kind: ${t}`);this.map.set(t,e)}get(e){let t=this.map.get(e);if(!t)throw Error(`Unknown part kind: ${e}`);return t}has(e){return this.map.has(e)}ownsRelType(e){for(let t of this.map.values())if(t.getRelTypeUri()===e)return!0;return!1}};function or(e,t,n){e&&(e.algorithm&&(t[n?`${n}AlgorithmName`:`algorithmName`]=e.algorithm),e.hash&&(t[n?`${n}HashValue`:`hashValue`]=e.hash),e.salt&&(t[n?`${n}SaltValue`:`saltValue`]=e.salt),e.spinCount!==void 0&&(t[n?`${n}SpinCount`:`spinCount`]=e.spinCount),e.legacyHash&&(t[n?`${n}Password`:`password`]=e.legacyHash))}var sr=`xfVariants`,cr=class{constructor(e,t){this._variants=new Map,this._userKeys=new WeakMap,this._sources=[],this._shown=new Map,this._json=e,this._styles=t,this._directCount=Math.max(1,e?.direct?.length??0)}getXf(t,n,r,i=null,a=null,o=null){n&&this._isShown(t)&&(n=!1);let s=this._json?.direct?.[t];if(i===null||s?.alignment?.horizontal===void 0&&s?.alignment?.indent===void 0||(i=null),a!==null&&s?.numberFormat!==void 0&&(a=null),!n&&!r&&i===null&&a===null&&o===null)return t;let c=``;o&&(c=this._userKeys.get(o)??e.JSONStableStringify(o),this._userKeys.set(o,c));let l=`${t}|${+!!n}${+!!r}|${i??``}|${a??``}|${c}`,u=this._variants.get(l);return u!==void 0||(u=this._directCount+this._sources.length,this._sources.push({xf:t,hidden:n,pivotButton:r,labelIndent:i,numberFormat:a,user:o}),this._variants.set(l,u)),u}getSources(){return this._sources}_isShown(e){let t=this._shown.get(e);if(t!==void 0)return t;let n=this._json?.direct?.[e];if(t=n?.protection?.showFormulas,t===void 0){let r=(e===0?void 0:n?.named)??h.BuiltInName.Normal;t=this._styles.getNamedStyles().getByName(r)?.toJSON().style?.protection?.showFormulas??!1}return this._shown.set(e,t),t}},lr=`cellControlComplements`,ur=class{constructor(){this._controls=[],this._xfComplements=[]}getComplement(e){if(e?.type!==`checkbox`)return null;let t=this._controls.findIndex(t=>t.type===e.type);return t===-1&&(t=this._controls.length,this._controls.push({type:e.type})),t}getControls(){return this._controls}setXfComplements(e){this._xfComplements=e}getXfComplement(e){return this._xfComplements[e]??null}},dr=class{constructor(e){this._byKey=new Map,this.list=[],this.complements=[],this.getElementID(e??{})}getElementJSON(e){return this.list[e]??null}getElementComplement(e){return this.complements[e]}getElementID(t,n){t??={};let r=e.JSONStableStringify(t);n!==void 0&&(r+=`|xfComplement:${n}`);let i=this._byKey.get(r);return i!==void 0||(i=this.list.length,this._byKey.set(r,i),this.list.push(t),this.complements.push(n)),i}};function fr(e,t,n,r){let i=e.cellControls;if(!i||i.length===0)return[];let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=Array.isArray(o)?o[0]:o.r,c=Array.isArray(o)?o[1]:o.v,l=n.getComplement(c);if(l===null){r(`Cell controls of type '${c?.type}' have no Excel form; their cells are written without them.`,`xlsx.cellControl.type.${c?.type}`);continue}let u=t.getRanges(s).getCoords();for(let e=0;e<u.length;e++)a.push({...u[e],value:l})}return a}function pr(e,n,a,o,s){let c=e,l=e.directStyles??[];if(l.length===0&&s.length===0)return c;let u=n.getEntireRange().getCoords(),d=[],f=[],p=l.length;for(let e=0;e<p;e++){let t=n.getRange(l[e][0]).getCoords(),r=a[l[e][1]];if(f.push([t,r]),r?.borders&&!i.isSingleCell(t)){let e=gr(t,r,u);for(let t=0;t<e.length;t++)d.push([e[t][0],o.getElementID(e[t][1])])}else d.push([t,o.getElementID(r)])}let m=function(e,t){let n=[],r=[],i=(e,n,r)=>{let i=Math.max(n,t.rowStart),a=Math.min(r,t.rowEnd);i<=a&&e.push({min:i,max:a})};for(let t=0;t<e.length;t++){let a=e[t][1]?.borders;if(!a)continue;let{rowStart:o,rowEnd:s}=e[t][0],c=yr(a.top);c>=vr&&i(n,o,o),c>=_r&&i(r,o-1,o-1);let l=yr(a.bottom);if(l>=_r&&i(r,s,s),l>=vr&&i(n,s+1,s+1),s>o){let e=yr(a.horizontal);e>=_r&&i(r,o,s-1),e>=vr&&i(n,o+1,s)}}return{top:br(n),bottom:br(r)}}(f,u);d=function(e,n,i){if(n.length===0)return e;let a=[];for(let[t,n]of e)a.push({...t,value:{styleId:n}});for(let e of n)a.push({...e,value:{complement:e.value}});let o=(e,t)=>i.getElementID(i.getElementJSON(e),t),s=[],c=new t.IteratorInstance(a,{axis:r.Column});for(let e=c.next();!e.done;e=c.next()){let t=e.value.overlaps,n,r;for(let e=0;e<t.length;e++){let i=t[e].value;i.styleId!==void 0&&(n=i.styleId),i.complement!==void 0&&(r=i.complement)}let i={...e.value.range};r===void 0?n!==void 0&&s.push([i,n]):s.push([i,o(n??0,r)])}return s}(d,s,o);let h=function(e,n,a){if(!e.cells||e.cells.length===0)return e;let o=e.cells.map(([e,t])=>({...e,value:t}));o.sort((e,t)=>e.value-t.value);let s=jr(o,n,null,e.cols,!0),c=Array(o[o.length-1].value+1).fill(0),l=Math.floor((n.colEnd-n.colStart+1)/2),u;for(let e=0;u===void 0&&e<s.length;e++){let t=s[e],n=t.value.s,r=c[n]+(t.max-t.min+1);r>l&&(u=n),c[n]=r}let d=jr(o,n,u,e.rows,!1);if(e.cols===s&&e.rows===d)return e;let f=[],p=xr(s,n,!0),m=xr(d,n,!1),h=o;for(let e of p)h.push(e),h.push({...e,value:0});for(let e of m)h.push(e),h.push({...e,value:0});let g=new t.IteratorInstance(h,{axis:r.Column}),_=n.rowEnd,v=n.colEnd,y=(e,t)=>{e.rowStart>=_||e.colStart>=v||f.push([e,t])},b=new Map,x=e=>{let t=b.get(e);if(t===void 0){let n=a.getElementJSON(e);t=n?.borders?n:null,b.set(e,t)}return t},S=(e,t,n)=>{let r=x(t);if(!r||i.isEqualRanges(e,n))return t;let o=hr(r.borders,e,n,!0);o&&=hr(o,e,n,!1);let s={...r};return o?s.borders=o:delete s.borders,a.getElementID(s,a.getElementComplement?.(t))??t},C=(e,t,n,r,i)=>t===r&&(!x(r)||S(e,t,i)===S(n,r,i)),w=new Map,T=(e,t)=>{if(t.rowStart>=_||t.colStart>=v)return;let n=w.get(e);n?n.push(t):w.set(e,[t])},E=[],D=[],O=g.next();for(;!O.done;){let e=O.value;O=g.next();let t=e.overlaps,n=e.range,r=t.length;if(r===1){t[0].value&&T(t[0],n);continue}let i,a,o,s,c,l;for(let e=0;e<r;e++){let n=t[e],r=n.value;typeof r==`number`?r===0&&i!==void 0||(i=r,a=n):n.rowStart===0&&n.rowEnd===_?(c=r.s,l=n):n.colStart===0&&n.colEnd===v&&(o=r.s,s=n)}o===void 0?c===void 0?(i!==0||r!==2&&r!==4)&&T(a,n):C(l,c,a,i,n)?D.push({...n,value:c,header:l}):i===0?E.push({...n,value:0}):T(a,n):C(s,o,a,i,n)||T(a,n)}for(let[e,t]of w){let n=Sr(t);for(let t=0;t<n.length;t++){let r={rowStart:n[t].rowStart,colStart:n[t].colStart,rowEnd:n[t].rowEnd,colEnd:n[t].colEnd};f.push([r,S(e,e.value,r)])}}let k=d;if(E.length>0){let e=Or(E,D,n);for(let t of e)k=wr(k??[],t.min,t.max,0);for(let t of E)kr(t,e,null,e=>y(e,0));for(let t of D)kr(t,e,e=>y(e,S(t.header,t.value,e)),null)}return f.sort((e,t)=>{let n=e[0],r=t[0];return n.rowStart===r.rowStart?n.colStart-r.colStart:n.rowStart-r.rowStart}),{cols:s,rows:k,cells:f}}({cells:d,cols:c.cols?S.refsToRuns(c.cols,!0):[],rows:c.rows?S.refsToRuns(c.rows,!1):[]},u,o),g={...e};h.cols.length>0?g.cols=S.runsToRefs(h.cols,!0):delete g.cols;let _=function(e,t,n){if(t.length===0&&n.length===0)return e;let r=[],i=e=>{for(let t=0;t<e.length;t++)r.push(e[t].min,e[t].max+1)};i(e),i(t),i(n),r.sort((e,t)=>e-t);let a=[],o=null,s=0,c=0,l=0,u=0;for(let i=0;i<r.length-1;i++){let d=r[i],f=r[i+1]-1;if(f<d)continue;for(;c<e.length&&e[c].max<d;)c++;for(;l<t.length&&t[l].max<d;)l++;for(;u<n.length&&n[u].max<d;)u++;let p=c<e.length&&e[c].min<=d?e[c]:null,m=+(l<t.length&&t[l].min<=d)|(u<n.length&&n[u].min<=d?2:0);if(!p&&m===0)continue;let h=a[a.length-1];if(h&&h.max+1===d&&p===o&&m===s){h.max=f;continue}let g=p?.value??{};m!==0&&(g={...g},1&m&&(g.tt=!0),2&m&&(g.tb=!0)),a.push({min:d,max:f,value:g}),o=p,s=m}return a}(h.rows,m.top,m.bottom);_.length>0?g.rows=S.runsToRefs(_,!1):delete g.rows;let v=h.cells;return v.length>0?g.directStyles=v.map(([e,t])=>[S.rangeToString(e,u),t]):delete g.directStyles,g}function mr(e,t){if(!e||!t)return e===t;if(e===t)return!0;if(e.style!==t.style)return!1;if(e.color===t.color)return!0;let n=e.color;e.color?.isIColor&&(n=e.color.toString());let r=t.color;return t.color?.isIColor&&(r=t.color.toString()),n===r}function hr(e,t,n,r){let i=r?l.Edge.Left:l.Edge.Top,a=r?l.Edge.Right:l.Edge.Bottom,o=r?l.Edge.Vertical:l.Edge.Horizontal,s=r?t.colStart:t.rowStart,c=r?t.colEnd:t.rowEnd,u=r?n.colStart:n.rowStart,d=r?n.colEnd:n.rowEnd,f=s===u,p=c===d,m={...e};return f&&p?e:(delete m[i],delete m[a],delete m[o],f?e[i]!==void 0&&(m[i]=e[i]):e[o]!==void 0&&(m[i]=e[o]),p?e[a]!==void 0&&(m[a]=e[a]):e[o]!==void 0&&(m[a]=e[o]),d-u>0&&e[o]!==void 0&&(m[o]=e[o]),Object.keys(m).length===0?null:m)}function gr(e,t,n){let r=e.colEnd-e.colStart+1,i=e.rowEnd-e.rowStart+1,a=t.borders;if(r===1&&i===1||!a)return[[e,t]];let o=n!==void 0&&e.colEnd>=n.colEnd,s=n!==void 0&&e.rowEnd>=n.rowEnd;if((o||s)&&(a={...a},o&&(a[l.Edge.Vertical]===void 0?delete a[l.Edge.Right]:a[l.Edge.Right]=a[l.Edge.Vertical]),s&&(a[l.Edge.Horizontal]===void 0?delete a[l.Edge.Bottom]:a[l.Edge.Bottom]=a[l.Edge.Horizontal]),Object.keys(a).length===0)){let n={...t};return delete n.borders,Object.keys(n).length>0?[[e,n]]:[]}let c=r===1||mr(a[l.Edge.Left],a[l.Edge.Vertical])&&mr(a[l.Edge.Right],a[l.Edge.Vertical]),u=i===1||mr(a[l.Edge.Top],a[l.Edge.Horizontal])&&mr(a[l.Edge.Bottom],a[l.Edge.Horizontal]);if(c&&u)return[[e,a===t.borders?t:{...t,borders:a}]];let d=[],f=(e,t,n,r,a)=>{let o=hr(n,e,t,a);o&&(a&&i!==1?(f(t,{colStart:t.colStart,rowStart:t.rowStart,colEnd:t.colEnd,rowEnd:t.rowStart},o,r,!1),(i>2||s)&&f(t,{colStart:t.colStart,rowStart:t.rowStart+1,colEnd:t.colEnd,rowEnd:s?t.rowEnd:t.rowEnd-1},o,r,!1),s||f(t,{colStart:t.colStart,rowStart:t.rowEnd,colEnd:t.colEnd,rowEnd:t.rowEnd},o,r,!1)):d.push([t,{...r,borders:o}]))};return r===1?f(e,e,a,t,!0):(f(e,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colStart,rowEnd:e.rowEnd},a,t,!0),(r>2||o)&&f(e,{colStart:e.colStart+1,rowStart:e.rowStart,colEnd:o?e.colEnd:e.colEnd-1,rowEnd:e.rowEnd},a,t,!0),o||f(e,{colStart:e.colEnd,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},a,t,!0)),d}var _r=2,vr=3,yr=e=>{let t=e?.style;return t?l.BuiltInDefinitions.get(t)?.width??0:0};function br(e){e.sort((e,t)=>e.min-t.min);let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=t[t.length-1];i&&r.min<=i.max+1?r.max>i.max&&(i.max=r.max):t.push({min:r.min,max:r.max})}return t}function xr(e,t,n){let r=n?t.rowStart:t.colStart,i=n?t.rowEnd:t.colEnd;return e.map(e=>{let t={colStart:n?e.min:r,rowStart:n?r:e.min,colEnd:n?e.max:i,rowEnd:n?i:e.max};return e.value!==void 0&&(t.value=e.value),t})}function Sr(e){let t=[...e];if(e.length<=1)return t;let n=!0,a=0;do{let e=t.sort(i.createRangeComparator(n?r.Row:r.Column));t=[e[0]];let o=!1;for(let r=1;r<e.length;r++){let i=e[r],a=t[t.length-1];(n?a.rowStart!==i.rowStart||a.rowEnd!==i.rowEnd||a.colEnd+1!==i.colStart:a.colStart!==i.colStart||a.colEnd!==i.colEnd||a.rowEnd+1!==i.rowStart)?t.push(i):(t[t.length-1]={...a,colEnd:n?i.colEnd:a.colEnd,rowEnd:n?a.rowEnd:i.rowEnd},o=!0)}a=o?0:a+1,n=!n}while(a<2&&t.length>1);return t}var Cr=(e,t)=>e.s===t.s&&n.deepEqual(e,t);function wr(e,t,n,r){let i=0;for(;i<e.length&&e[i].max<t;)i++;let a=e.slice(0,i),o=[],s=[],c=t,l=i;for(;l<e.length&&e[l].min<=n;l++){let i=e[l];i.min<t&&o.push({min:i.min,max:t-1,value:i.value});let a=Math.max(i.min,t);c<a&&o.push({min:c,max:a-1,value:{s:r}});let u=Math.min(i.max,n);o.push({min:a,max:u,value:{...i.value,s:r}}),c=u+1,i.max>n&&s.push({min:n+1,max:i.max,value:i.value})}for(c<=n&&o.push({min:c,max:n,value:{s:r}});l<e.length;l++)s.push(e[l]);let u=[];a.length>0&&u.push(a.pop()),u.push(...o),s.length>0&&u.push(s.shift());let d=[];for(let e=0;e<u.length;e++){let t=u[e],n=d[d.length-1];n&&t.min<=n.max+1&&Cr(n.value,t.value)?n.max=Math.max(n.max,t.max):d.push({...t})}let f=d.filter(e=>e.value&&Object.keys(e.value).length>0);return[...a,...f,...s]}var Tr=[9,99,999,9999,99999,999999],Er=(e,t)=>{let n=(n,r)=>Math.max(0,Math.min(t,r)-Math.max(e,n)+1);return n(0,25)+2*n(26,701)+3*n(702,16383)},Dr=e=>{let t=[];for(let n of e){let e=n.colEnd-n.colStart+1,r=Er(n.colStart,n.colEnd);t.push([n.rowStart,e,r],[n.rowEnd+1,-e,-r])}t.sort((e,t)=>e[0]-t[0]);let n=[],r=0,i=0;for(let e=0;e<t.length;){let a=t[e][0];for(;e<t.length&&t[e][0]===a;)r+=t[e][1],i+=t[e][2],e++;e<t.length&&r>0&&n.push({min:a,max:t[e][0]-1,count:r,letters:i})}return n},Or=(e,t,n)=>{let r=Dr(e);if(r.length===0)return[];let i=Dr(t),a=[...Tr];for(let e of r)a.push(e.min,e.max+1);for(let e of i)a.push(e.min,e.max+1);a.sort((e,t)=>e-t);let o=n.rowEnd-1,s=[],c=0,l=0;for(let e=0;e<a.length-1;e++){let t=a[e],n=Math.min(a[e+1]-1,o);if(n<t)continue;for(;c<r.length&&r[c].max<t;)c++;if(c>=r.length||r[c].min>t)continue;for(;l<i.length&&i[l].max<t;)l++;let u=l<i.length&&i[l].min<=t?i[l]:null,d=String(t+1).length,f=r[c].count*(7+d)+r[c].letters;if(23+(u?u.count*(17+d)+u.letters:0)>=f)continue;let p=s[s.length-1];p&&p.max+1===t?p.max=n:s.push({min:t,max:n})}return s},kr=(e,t,n,r)=>{let i=e.rowStart;for(let a=0;a<t.length&&i<=e.rowEnd;a++){let o=t[a];if(o.max<i||o.min>e.rowEnd)continue;o.min>i&&r?.({...e,rowStart:i,rowEnd:o.min-1});let s=Math.min(o.max,e.rowEnd);n?.({...e,rowStart:Math.max(o.min,i),rowEnd:s}),i=s+1}i<=e.rowEnd&&r?.({...e,rowStart:i})},Ar=(e,t,n,r)=>{let i=t,a=[],o=e[i],s=o.value;for(;o;)r?a.push({min:o.colStart,max:o.colEnd,value:o.rowEnd-o.rowStart+1,touchMax:o.rowEnd}):a.push({min:o.rowStart,max:o.rowEnd,value:o.colEnd-o.colStart+1,touchMax:o.colEnd}),i++,o=e[i],o&&o.value!==s&&(o=null);let c=a.length;if(c===0)return i;if(c===1)return n.push(a[0]),i;a.sort((e,t)=>e.min===t.min?e.max-t.max:e.min-t.min);let l={...a[0]};for(let e=1;e<c;e++){let t=a[e],r=l.max,i=t.min;if(i<=r+1){if(i<=r){let e=t.max,a=t.value,o=l.value,s=l.min,c=Math.min(r,e);i>s&&n.push({min:s,max:i-1,value:o,touchMax:l.touchMax});let u=o+a,d=Math.max(l.touchMax,t.touchMax);c<Math.max(r,e)?(n.push({min:i,max:c,value:u,touchMax:d}),l=e>c?{min:c+1,max:e,value:a,touchMax:t.touchMax}:{min:c+1,max:r,value:o,touchMax:l.touchMax}):l={min:i,max:c,value:u,touchMax:d}}else n.push(l),l={...t}}else n.push(l),l={...t}}return n.push(l),i},jr=(e,t,n,r,i)=>{let a=t.rowEnd,o=i?a-t.rowStart+1:t.colEnd-t.colStart+1,s=Math.floor(.5*o),c=i?a:t.colEnd,l=0;do{let t=e[l].value,o=[];l=Ar(e,l,o,i);for(let e=0;e<o.length;e++){let l=o[e];l.value<s||l.touchMax<c||!i&&l.min>=a||(i||n===null||n!==t)&&(r=wr(r??[],l.min,l.max,t))}}while(l<e.length);return r},Mr=class{constructor(){this._daprFMBks=[],this._daprFMBkMap=new Map,this._rvFMBks=[],this._rvFMBkMap=new Map,this._valueMeta=[]}registerArrayCell(e){let t=+!!e,n=`1,${t}`,r=this._daprFMBkMap.get(n);return r===void 0&&(r=this._daprFMBks.length,this._daprFMBks.push({fDynamic:1,fCollapsed:t}),this._daprFMBkMap.set(n,r)),r+1}registerRichValueCell(e){let t=this._rvFMBkMap.get(e);t===void 0&&(t=this._rvFMBks.length,this._rvFMBks.push(e),this._rvFMBkMap.set(e,t));let n=this._valueMeta.length;return this._valueMeta.push(t),n+1}hasCellMeta(){return this._daprFMBks.length>0}hasValueMeta(){return this._valueMeta.length>0}hasAny(){return this.hasCellMeta()||this.hasValueMeta()}getDAPRFutureMetadataBlocks(){return this._daprFMBks}getRVFutureMetadataBlocks(){return this._rvFMBks}getValueMeta(){return this._valueMeta}},Nr=class{constructor(e,t,n=console.warn){this._entries=[],this._keyMap=new Map,this._writers=new Map,this._structureIndex=new Map,this._structures=new Map,this._arrays=[],this._arrayKeys=new Map,this._bagStructures=[],this._bagStructureKeys=new Map,this._bags=[],this._bagKeys=new Map,this._bagArrays=[],this._bagArrayKeys=new Map,this._richStyles=[],this._richStyleKeys=new Map,this._keyFlags=new Map,this._records=(e=>{let t=n=>{let r=[],a=[];for(let o of n.getKind().getProperties()){let s=n.getValues()[o.name];switch(o.valueType){case`rich`:r.push([o.name,`spb`]),a.push(Dn(s)?``+t(s):``);break;case`array`:r.push([o.name,`spba`]),a.push(s instanceof M?``+e.addBagArray(i(s)):``);break;case`integer`:r.push([o.name,`i`]),a.push(s==null?`0`:``+s);break;case`boolean`:r.push([o.name,`b`]),a.push(s?`1`:`0`);break;default:r.push([o.name,`s`]),a.push(s==null?``:``+s)}}return e.addBag(r,a)},n=(t,n)=>e.addBag(t.map(([e])=>[he(e),n]),t.map(([,e])=>e)),r=e=>e==null?[`s`,``]:v.isError(e)?[`e`,e.getLabel()]:!0===e.isIRichData?[`r`,``+o(e,void 0)]:typeof e==`boolean`?[`b`,e?`1`:`0`]:typeof e==`number`?[void 0,On(e)]:[`s`,``+e],i=e=>e.getElements().flat().map(r),a=t=>{let n=t.getElements(),r=Math.max(1,...n.map(e=>e.length));return e.addArray(n.length,r,i(t))},o=(t,r)=>{if(t instanceof E)return c(t);if(t instanceof M)return e.addValue(e.structureFor(`_array`,[[`array`,`a`]]),[``+a(t)]);if(t instanceof T)return e.addValue(e.structureFor(`_hyperlink`,[[`Address`,`s`],[`Text`,`s`]]),[t.getAddress()??``,``+(t.getFriendlyName()??t.getAddress()??``)]);if(typeof t==`number`){let i=r?[[`_Self`,``+e.addRichStyle({numberFormat:r})]]:[];return e.addValue(e.structureFor(`_formattednumber`,[[`_Format`,`spb`]]),[``+n(i,`i`)],On(t))}let i=e.addHandled(t);return i===null?e.addHandled(v.BuiltIn.Value):i},s=r=>{let i=r.getKind(),s=En(i),c=i.getMeta(),l=c?.card,u=r.getOwnMeta()??{},d=r.getValues(),f=[],p=[];for(let r of i.getProperties()){let{name:m}=r;if(be.has(m)){switch(f.push([m,m===`_Icon`?`s`:`spb`]),m){case`_Icon`:p.push(c?.icon??``);break;case`_Display`:{let t=[],n=[];l?.order&&(t.push([`^Order`,`spba`]),n.push(``+e.addBagArray(l.order.map(e=>[`s`,e])))),l?.title&&(t.push([`TitleProperty`,`s`]),n.push(l.title)),l?.subTitle&&(t.push([`SubTitleProperty`,`s`]),n.push(l.subTitle)),p.push(``+e.addBag(t,n));break}case`_Format`:{let t=[];for(let n of i.getProperties()){let r=n.valueType===`rich`?void 0:u[n.name]?.numberFormat,i=l?.title===n.name,a=l?.mainImage===n.name;(r||i||a)&&t.push([n.name,``+e.addRichStyle({...r?{numberFormat:r}:{},...i?{isTitle:i}:{},...a?{isHero:a}:{}})])}p.push(``+n(t,`i`));break}case`_SubLabel`:{let e=i.getProperties().filter(e=>u[e.name]?.sublabel).map(e=>[e.name,u[e.name].sublabel]);p.push(``+n(e,`s`));break}case`_Flags`:{let t=[];for(let n of i.getProperties()){let r=kn(u[n.name]?.excludeFrom,!1);r.length!==0&&t.push([n.name,``+e.addBag(r.map(([e])=>[e,`b`]),r.map(([,e])=>e))])}p.push(``+n(t,`spb`));break}}continue}if(!m.startsWith(`_`)){let t=kn(r.meta?.excludeFrom,!0);t.length>0&&e.addKeyFlags(s,m,t)}let h=d[m];switch(r.valueType){case`rich`:Dn(h)?(f.push([m,`spb`]),p.push(``+t(h))):(f.push([m,`r`]),p.push(h==null?``:``+o(h,u[m]?.numberFormat)));break;case`array`:f.push([m,`a`]),p.push(h instanceof M?``+a(h):``);break;case`string`:f.push([m,`s`]),p.push(h==null?``:``+h);break;case`integer`:f.push([m,`i`]),p.push(h==null?`0`:``+h);break;case`boolean`:f.push([m,`b`]),p.push(h?`1`:`0`);break;case`error`:f.push([m,`e`]),p.push(v.isError(h)?h.getLabel():v.BuiltIn.Value.getLabel());break;default:f.push([m]),p.push(typeof h==`number`?On(h):h==null?``:``+h)}}return e.addValue(e.structureFor(s,f),p)},c=t=>{let n=En(t.getKind());if(n===`_linkedentitycore`)return e.addKeyFlags(`_linkedentity`,`%cvi`,Tn),e.addValue(e.structureFor(`_linkedentity`,wn),[``+s(t)]);if(n===`_linkedentity2core`){s(t);let n=e=>{let n=t.getProperty(e);return n==null?``:``+n};return e.addValue(e.structureFor(`_linkedentity2`,Cn),[n(`%EntityServiceId`),n(`_DisplayString`),n(`%EntityId`),n(`%EntityCulture`),t.getKind().getMeta()?.icon??``])}return s(t)};return{writeCell:e=>e instanceof E&&!Dn(e)?c(e):e instanceof M?o(e,void 0):null}})(this),this._metaCollector=e,this._workbook=t,this._onWarn=n}add(e,t=null){let n=this._records.writeCell(e);if(n!==null)return this._metaCollector.registerRichValueCell(n);let r=this._addHandled(e,t);return r===null?(this._onWarn?.(`RichValueCollector.add: unsupported rich value — falling back to #UNKNOWN!`,e),this._metaCollector.registerRichValueCell(this._addHandled(v.BuiltIn.Unknown,null))):this._metaCollector.registerRichValueCell(r)}addHandled(e){return this._addHandled(e,null)}_addHandled(e,t){let n=e==null?null:ae.getForValue(e);if(!n)return null;let r=this._writerFor(n),i=r.write(e,t);return i?this.addValue(r,i):null}_writerFor(e){let t=this._writers.get(e);return t||(t=e.beginWrite({workbook:this._workbook}),this._writers.set(e,t)),t}structureFor(e,t){let n=e+JSON.stringify(t),r=this._structures.get(n);return r||(r={structure:e,props:t},this._structures.set(n,r)),r}addValue(e,t,n){let r=this._structureIndex.get(e);r===void 0&&(r=this._structureIndex.size,this._structureIndex.set(e,r));let i=r+JSON.stringify(t)+(n??``),a=this._keyMap.get(i);return a===void 0&&(a=this._entries.length,this._entries.push(n===void 0?{structure:e,values:t}:{structure:e,values:t,fb:n}),this._keyMap.set(i,a)),a}addArray(e,t,n){return this._intern(this._arrays,this._arrayKeys,{rows:e,columns:t,items:n})}addBag(e,t){let n=this._intern(this._bagStructures,this._bagStructureKeys,e);return this._intern(this._bags,this._bagKeys,{s:n,values:t})}addBagArray(e){return this._intern(this._bagArrays,this._bagArrayKeys,e)}addRichStyle(e){return this._intern(this._richStyles,this._richStyleKeys,e)+1}addKeyFlags(e,t,n){let r=this._keyFlags.get(e);r||this._keyFlags.set(e,r=new Map);let i=r.get(t);i||r.set(t,i=new Map);for(let[e,t]of n)i.set(e,t)}_intern(e,t,n){let r=JSON.stringify(n),i=t.get(r);return i===void 0&&(i=e.length,e.push(n),t.set(r,i)),i}getCount(){return this._entries.length}hasAny(){return this._entries.length>0}getEntries(){return this._entries}getStructures(){return[...this._structureIndex.keys()]}getStructureIndex(e){return this._structureIndex.get(e)??-1}getArrays(){return this._arrays}getBags(){return{structures:this._bagStructures,bags:this._bags,arrays:this._bagArrays}}getRichStyles(){return this._richStyles}getKeyFlags(){let e=new Map,t=(t,n,r)=>{let i=e.get(t);i||e.set(t,i=new Map);let a=i.get(n);a||i.set(n,a=new Map);for(let[e,t]of r)a.set(e,t)};for(let e of this._writers.values())if(this._structureIndex.has(e))for(let[n,r]of e.getKeyFlags?.()??[])t(e.structure,n,r);for(let[e,n]of this._keyFlags)for(let[r,i]of n)t(e,r,i);let n=[];for(let[t,r]of e)n.push([t,[...r].map(([e,t])=>[e,[...t]])]);return n}addParts(e){for(let t of this._writers.values())this._structureIndex.has(t)&&t.addParts?.(e);this._arrays.length>0&&e.addPart(`richValueArray`,this),this._bags.length>0&&(e.addPart(`richValueBagStructure`,this),e.addPart(`richValueBag`,this)),this._richStyles.length>0&&e.addPart(`richValueStyles`,this)}},Pr=`application/xml`,Fr=async(e,t)=>{let n=e.parts,r=n?n.length:0;for(let i=0;i<r;i++){let r=n[i];try{await Ir(r,t)}catch(n){t.log(`Unable to write the part '${r.name??r.id}' referenced by '${e.name??e.id}'`,n)}}},Ir=async(e,t,n)=>{let r=e.resId===void 0?void 0:t.getSharedStates().get(An)?.get(e.resId);if(!r)return e.resId===void 0?t.addPart(`embeddedPart`,e,n,e.id):(t.log(`The part '${e.name??e.id}' cites resource ${e.resId}, which is not in the workbook.`),null);let i=await r.getExternalURI();if(i){let n=t.addExternal(e.type,i,e.id);return n.relId!==e.id&&t.log(`The external reference '${e.id}' was written as '${n.relId}'; the markup will not find it.`),n}let a=await r.toBuffer();return t.addBinary(new Uint8Array(a),e.contentType||Pr,e.type,n??`./${Lr(e.name)}`,!1,e.id)},Lr=e=>{let t=e&&/^[\w.\-~%]+$/.test(e)?e:`part.xml`,n=t.lastIndexOf(`.`),r=n>0?t.slice(0,n):t,i=n>0?t.slice(n):``;return`${r.replace(/\d+$/,``)}{n}${i}`};function H(e,t,n,r){if(!n)return;let i=typeof n==`string`?t.parseColor(n):n;r&&e.start(r);let a=i.getType(),o=i.getVal(),s=i.getAdjustments(),l=s&&s.length>0;switch(a){case`scheme`:l?(e.start(`schemeClr`,{val:o}),U(e,s),e.end(`schemeClr`)):e.empty(`schemeClr`,{val:o});break;case`named`:if(c.isSystem(o)){let t=i.getLastColor()??i.getBaseColor().toHex().toString(!1).replace(`#`,``);l?(e.start(`sysClr`,{val:o,lastClr:t}),U(e,s),e.end(`sysClr`)):e.empty(`sysClr`,{val:o,lastClr:t})}else l?(e.start(`prstClr`,{val:o}),U(e,s),e.end(`prstClr`)):e.empty(`prstClr`,{val:o});break;case`auto`:{let t=i.getLastColor()??i.getBaseColor().toHex().toString(!1).replace(`#`,``);l?(e.start(`sysClr`,{val:`windowText`,lastClr:t}),U(e,s),e.end(`sysClr`)):e.empty(`sysClr`,{val:`windowText`,lastClr:t});break}case`index`:l?(e.start(`srgbClr`,{val:o}),U(e,s),e.end(`srgbClr`)):e.empty(`srgbClr`,{val:o});break;case`hsl`:let t=i.toHex().toString();l?(e.start(`srgbClr`,{val:t}),U(e,s),e.end(`srgbClr`)):e.empty(`srgbClr`,{val:t});break;case`lrgb`:{let t=/^lrgba?\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)/i.exec(String(o));if(t){let n={r:String(Math.round(1e3*parseFloat(t[1]))),g:String(Math.round(1e3*parseFloat(t[2]))),b:String(Math.round(1e3*parseFloat(t[3])))};l?(e.start(`scrgbClr`,n),U(e,s),e.end(`scrgbClr`)):e.empty(`scrgbClr`,n);break}}case`rgb`:let n=i.toHex().toString();l?(e.start(`srgbClr`,{val:n}),U(e,s),e.end(`srgbClr`)):e.empty(`srgbClr`,{val:n});break;case`hex`:let r=o.replace(`#`,``).toUpperCase();l?(e.start(`srgbClr`,{val:r}),U(e,s),e.end(`srgbClr`)):e.empty(`srgbClr`,{val:r});break;default:let a=o.replace(`#`,``).toUpperCase();e.empty(`srgbClr`,{val:a})}r&&e.end(r)}function U(e,t){if(t&&t.length!==0)for(let n of t)for(let[t,r]of Object.entries(n)){if(r==null)continue;let n=t;if(n){if(typeof r==`boolean`)e.empty(n);else{let i;if(t===`alpha`||t===`alphaOff`||t===`alphaMod`)i=Math.round(1e5*r);else{if(t===`eTint`){if(r<0){e.empty(`shade`,{val:Math.round(1e5*(1+r)).toString()});continue}e.empty(`tint`,{val:Math.round(1e5*r).toString()});continue}i=Math.round(1e3*r)}e.empty(n,{val:i.toString()})}}}}function W(e,t,n,r,i=!1,a=!1){if(!n)return;let o=typeof n==`string`?t.parseColor(n):n,s=()=>{e.empty(r,{rgb:Gr(o.toHex().toString(!0))})},c=o.getAdjustments(),l=c&&c.length>0,u=o.getType();if(u!==g.Type.Auto){if(u===g.Type.Scheme){let t=o.getVal(),n=Rr[t]??t,i=Vr.get(n);if(i===void 0&&n!==`phClr`)return console.warn(`Color scheme not in theme. schemeVal=${t} themeKey=${n}`),s();let a={};if(a.theme=i,l){if(!function(e){for(let t of e)switch(Object.keys(t)[0]){case g.AdjustmentType.Tint:case g.AdjustmentType.ETint:case g.AdjustmentType.Shade:case g.AdjustmentType.Lum:case g.AdjustmentType.LumOff:case g.AdjustmentType.LumMod:case g.AdjustmentType.Alpha:case g.AdjustmentType.AlphaOff:case g.AdjustmentType.AlphaMod:continue;default:return!1}return!0}(c))return s();let e=c.length===1?c[0][g.AdjustmentType.ETint]:void 0,t;if(e!==void 0)t=Ur(e);else{let e=o.getBaseColor().toHex().toString(!0),n=o.toHex().toString(!0);t=Ur(function(e,t){let n=Hr(e,0,255),r=Hr(t,0,255);return Math.abs(r-n)<1e-9?0:r<n?n<=1e-9?-1:Hr(r/n-1,-1,0):255-n<=1e-9?0:Hr((r-n)/(255-n),0,1)}(Wr(e),Wr(n)))}t!==0&&(a.tint=t)}e.empty(r,a);return}if(u===g.Type.Index){let t=o.getVal(),n=t.substring(5,t.length);e.empty(r,{indexed:Number(n)});return}return s()}e.empty(r,{auto:1})}var Rr={bg1:`lt1`,tx1:`dk1`,bg2:`lt2`,tx2:`dk2`,accent1:`accent1`,accent2:`accent2`,accent3:`accent3`,accent4:`accent4`,accent5:`accent5`,accent6:`accent6`,hlink:`hlink`,folHlink:`folHlink`},zr=Object.freeze([`lt1`,`dk1`,`lt2`,`dk2`,`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`,`hlink`,`folHlink`]),Br=Object.freeze([`dk1`,`lt1`,`dk2`,`lt2`,`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`,`hlink`,`folHlink`]),Vr=new Map(zr.map((e,t)=>[e,t]));function Hr(e,t,n){return Math.max(t,Math.min(n,e))}function Ur(e){let t=Hr(e,-1,1);return Math.abs(t)<1e-12?0:t}function Wr(e){let t=function(e){let t=e.replace(/^#/,``).toUpperCase();if(t.length===8)return t.slice(2);if(t.length===6)return t;throw Error(`Invalid hex: ${e}`)}(e),n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255;return(Math.max(n,r,i)+Math.min(n,r,i))/2*255}function Gr(e){let t=e.replace(/^#/,``).toUpperCase();if(t.length===8)return t;if(t.length===6)return`FF`+t;throw Error(`Invalid hex: ${e}`)}function Kr(e,t=!1){let n=e;return n.length===8&&(n=n.substring(2,8)),n.length===6&&(n=(t?`00`:`FF`)+n),n.toUpperCase()}var qr=`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,Jr=(e,t,n,r)=>{if(!r)return;let i=typeof r==`string`?{address:r}:r,a={"xmlns:r":qr};i.address&&(a[`r:id`]=e.addExternal(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,i.address).relId??void 0),a.action=i.action,a.tgtFrame=i.target,a.tooltip=i.screenTip,i.history!==void 0&&(a.history=i.history?`1`:`0`),t.empty(n,a)};function Yr(e,t,r,i,a=!1,o=!1){let c=i.getTheme();if(a&&t.start(`fill`),typeof r==`string`&&(r={type:s.Type.Solid,color:r}),r.type!==s.Type.Image||a){if(r.type!==s.Type.Group||a){if(r.type===s.Type.None||r.type===s.Type.Image||r.type===s.Type.Group)a?t.empty(`patternFill`,{patternType:`none`}):t.empty(`noFill`);else if(r.type===s.Type.Solid){let e=r;a?t.start(`patternFill`,{patternType:`solid`}):t.start(`solidFill`),e.color&&(a?W(t,c,e.color,`fgColor`):H(t,c,e.color)),a?t.end(`patternFill`):t.end(`solidFill`)}else if(r.type===s.Type.Pattern){let e=r,n=e.patternType||`solid`;t.start(`patternFill`,{patternType:n});let i=o?e.background:e.foreground,s=o?e.foreground:e.background;i&&(a?W(t,c,i,`fgColor`):H(t,c,i)),s&&(a?W(t,c,s,`bgColor`):H(t,c,s)),t.end(`patternFill`)}else if(r.type===s.Type.Gradient&&a){let e=r,n={},i=e.gradientType;if(i!==s.GradientType.Path&&i!==s.GradientType.Linear||(n.type=i),e.angle!==void 0){let t=(e.angle-90)%360;t!==0&&(n.degree=String(t))}let a=e.focus;a&&(a.left&&(n.left=String(a.left)),a.right&&(n.right=String(a.right)),a.top&&(n.top=String(a.top)),a.bottom&&(n.bottom=String(a.bottom))),t.start(`gradientFill`,n);let o=e.stops;if(o&&o.length>0)for(let e of o){let n,r=0;if(typeof e==`string`||typeof e==`object`&&!(`offset`in e))n=e,r=0;else{let t=e;r=t.offset||0,n=t.color}t.start(`stop`,{position:String(r)}),n&&W(t,c,n,`color`),t.end(`stop`)}t.end(`gradientFill`)}else if(r.type===s.Type.Gradient){let e=r,i={};e.flip!==void 0&&(i.flip=e.flip),e.isRotatedWithShape!==void 0&&(i.rotWithShape=e.isRotatedWithShape?`1`:`0`),t.start(`gradFill`,i),t.start(`gsLst`);let a=e.stops;if(a&&a.length>0){let e=a.length-1;for(let r=0;r<a.length;r++){let i=a[r],o,s=e>0?r/e:0;if(typeof i==`string`||typeof i==`object`&&!(`offset`in i))o=i;else{let e=i;s=e.offset??s,o=e.color}t.start(`gs`,{pos:String(n.roundAccurately(1e5*s,0))}),o&&H(t,c,o),t.end(`gs`)}}t.end(`gsLst`);let o=e.gradientType;if(o&&o!==s.GradientType.Linear){let r=o===s.GradientType.Path||o===`radial`?`circle`:o;t.start(`path`,{path:r});let i=e.focus;if(i){let e=(e,t)=>{if(typeof e==`number`)return String(n.roundAccurately(1e5*(t?1-e:e),0))},r={l:e(i.left,!1),t:e(i.top,!1),r:e(i.right,!0),b:e(i.bottom,!0)};t.empty(`fillToRect`,r)}t.end(`path`)}else{let r={};if(e.angle!==void 0){let t=((e.angle-90)%360+360)%360;r.ang=String(n.roundAccurately(6e4*t,0))}r.scaled=e.scaled??1?`1`:`0`,t.empty(`lin`,r)}e.tileRect&&t.empty(`tileRect`,li(e.tileRect)),t.end(`gradFill`)}else a?t.empty(`patternFill`,{patternType:`none`}):t.empty(`noFill`)}else t.empty(`grpFill`)}else ui(e,t,r);a&&t.end(`fill`)}var Xr=(e,t,r,i)=>{if(!r)return t.start(`ln`),t.empty(`noFill`),void t.end(`ln`);let a=typeof r==`string`?{fill:r}:r,o={};if(a.width!==void 0&&(o.w=String(G(a.width))),a.lineCap!==void 0&&(o.cap=Zr(a.lineCap)),a.compound!==void 0&&(o.cmpd=a.compound),a.align!==void 0&&(o.algn=a.align),t.start(`ln`,o),a.fill!==void 0&&Yr(e,t,a.fill??ti,i),Array.isArray(a.dash)){t.start(`custDash`);for(let e=0;e<a.dash.length;e+=2)t.empty(`ds`,{d:String(n.roundAccurately(1e3*a.dash[e],0)),sp:String(n.roundAccurately(1e3*(a.dash[e+1]??0),0))});t.end(`custDash`)}else typeof a.dash==`string`&&t.empty(`prstDash`,{val:a.dash});if(a.lineJoin===d.LineJoin.Round)t.empty(`round`);else if(a.lineJoin===d.LineJoin.Bevel)t.empty(`bevel`);else if(a.lineJoin===d.LineJoin.Miter){let e={};a.miterLimit!==void 0&&(e.lim=String(n.roundAccurately(1e5*a.miterLimit,0))),t.empty(`miter`,e)}for(let[e,n,r,i]of[[`headEnd`,a.headType,a.headWidth,a.headLength],[`tailEnd`,a.tailType,a.tailWidth,a.tailLength]]){if(n===void 0&&r===void 0&&i===void 0)continue;let a={};n!==void 0&&(a.type=n),r!==void 0&&(a.w=r),i!==void 0&&(a.len=i),t.empty(e,a)}typeof a.extLst==`string`&&t.raw(a.extLst),t.end(`ln`)},Zr=e=>e===`round`?`rnd`:e===`butt`?`flat`:e===`square`?`sq`:e,Qr=(e,t,n,r=void 0,i=!1)=>{if(!n||!(n.fill||n.stroke||n.effects||i))return;let a=e.getXMLWriter();r&&a.start(r),a.pushDefaultNamespace(`a`),n.fill&&Yr(e,a,n.fill,t),n.stroke&&Xr(e,a,n.stroke,t),n.effects?.length?$r(e,a,t.getTheme(),n.effects):(i||n.effects)&&a.empty(`effectLst`),a.popDefaultNamespace(),r&&a.end(r)},$r=(e,t,n,r)=>{t.start(`effectLst`);for(let e of r)ei(t,n,e);t.end(`effectLst`)},ei=(e,t,r)=>{switch(r.type){case u.Type.OuterShadow:{let i={};r.blur!==void 0&&(i.blurRad=String(G(r.blur))),r.distance!==void 0&&(i.dist=String(G(r.distance))),r.angle!==void 0&&(i.dir=String(q(r.angle))),r.alignment!==void 0&&(i.algn=r.alignment),r.isRotatedWithShape!==void 0&&(i.rotWithShape=r.isRotatedWithShape?`1`:`0`),r.scaleX!==void 0&&(i.sx=String(n.roundAccurately(1e3*r.scaleX,0))),r.scaleY!==void 0&&(i.sy=String(n.roundAccurately(1e3*r.scaleY,0))),r.skewX!==void 0&&(i.kx=String(q(r.skewX))),r.skewY!==void 0&&(i.ky=String(q(r.skewY))),e.start(`outerShdw`,i),H(e,t,r.color),e.end(`outerShdw`);break}case u.Type.InnerShadow:{let n={};r.blur!==void 0&&(n.blurRad=String(G(r.blur))),r.distance!==void 0&&(n.dist=String(G(r.distance))),r.angle!==void 0&&(n.dir=String(q(r.angle))),e.start(`innerShdw`,n),H(e,t,r.color),e.end(`innerShdw`);break}case u.Type.PresetShadow:{let n={prst:r.preset};r.distance!==void 0&&(n.dist=String(G(r.distance))),r.angle!==void 0&&(n.dir=String(q(r.angle))),e.start(`prstShdw`,n),H(e,t,r.color),e.end(`prstShdw`);break}case u.Type.Glow:{let n={};r.radius!==void 0&&(n.rad=String(G(r.radius))),e.start(`glow`,n),H(e,t,r.color),e.end(`glow`);break}case u.Type.SoftEdge:{let t={};r.radius!==void 0&&(t.rad=String(G(r.radius))),e.empty(`softEdge`,t);break}case u.Type.Reflection:{let t={};r.blur!==void 0&&(t.blurRad=String(G(r.blur))),r.distance!==void 0&&(t.dist=String(G(r.distance))),r.angle!==void 0&&(t.dir=String(q(r.angle))),r.fadeAngle!==void 0&&(t.fadeDir=String(q(r.fadeAngle))),r.startAlpha!==void 0&&(t.stA=String(n.roundAccurately(1e3*r.startAlpha,0))),r.startPosition!==void 0&&(t.stPos=String(n.roundAccurately(1e3*r.startPosition,0))),r.endAlpha!==void 0&&(t.endA=String(n.roundAccurately(1e3*r.endAlpha,0))),r.endPosition!==void 0&&(t.endPos=String(n.roundAccurately(1e3*r.endPosition,0))),r.scaleX!==void 0&&(t.sx=String(n.roundAccurately(1e3*r.scaleX,0))),r.scaleY!==void 0&&(t.sy=String(n.roundAccurately(1e3*r.scaleY,0))),r.skewX!==void 0&&(t.kx=String(q(r.skewX))),r.skewY!==void 0&&(t.ky=String(q(r.skewY))),r.alignment!==void 0&&(t.algn=r.alignment),r.isRotatedWithShape!==void 0&&(t.rotWithShape=r.isRotatedWithShape?`1`:`0`),e.empty(`reflection`,t);break}}},ti={type:`none`},ni=`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,ri=`imagesWritten`,ii=new WeakMap,ai=async(e,t)=>{let n=ii.get(e);n||(n=new Map,ii.set(e,n));let r=n.get(t);if(r)return r;let i=await t.getExternalURI(),a;if(i)a={relId:e.addExternal(ni,i).relId,external:!0};else{let n=e.getSharedStates(),r=n.get(ri);r||(r=new Map,n.set(ri,r));let i=r.get(t);if(!i){let e=await t.toBuffer();i={bytes:new Uint8Array(e),type:await t.getType()??fi,index:r.size+1},r.set(t,i)}a={relId:e.addBinary(i.bytes,i.type.mime,ni,`../media/image${i.index}.${i.type.ext}`,!0).relId,external:!1}}return n.set(t,a),a},oi=(e,t)=>t===void 0?void 0:e.getSharedStates().get(An)?.get(t),si=async(e,t)=>{if(!t)return;let n=t.fill;if(n?.type===s.Type.Image){let t=oi(e,n.resId);t&&await ai(e,t)}},ci=e=>String(Math.round(1e3*e)),li=e=>{let t={};return e.left!==void 0&&(t.l=ci(e.left)),e.top!==void 0&&(t.t=ci(e.top)),e.right!==void 0&&(t.r=ci(e.right)),e.bottom!==void 0&&(t.b=ci(e.bottom)),t},ui=(e,t,n)=>{let r=oi(e,n.resId),i=r?((e,t)=>ii.get(e)?.get(t))(e,r):void 0;if(!i)return e.warn(`An image fill names no image in the workbook; the shape is written with no fill.`,void 0,`xlsx.drawing.imageFill.noResource`),void t.empty(`noFill`);let a={};n.dpi!==void 0&&(a.dpi=String(n.dpi)),n.isRotatedWithShape!==void 0&&(a.rotWithShape=n.isRotatedWithShape?`1`:`0`),t.start(`blipFill`,a),di(t,n,i),t.end(`blipFill`)},di=(e,t,n)=>{let r={"xmlns:r":qr};if(r[n.external?`r:link`:`r:embed`]=n.relId,t.compressionState!==void 0&&(r.cstate=t.compressionState),t.imageEffects||t.extLst?(e.start(`blip`,r),t.imageEffects&&e.raw(t.imageEffects),t.extLst&&e.raw(t.extLst),e.end(`blip`)):e.empty(`blip`,r),t.sourceRect&&e.empty(`srcRect`,li(t.sourceRect)),t.tile){let n=t.tile,r={};n.offsetX!==void 0&&(r.tx=String(K(n.offsetX))),n.offsetY!==void 0&&(r.ty=String(K(n.offsetY))),n.scaleX!==void 0&&(r.sx=ci(n.scaleX)),n.scaleY!==void 0&&(r.sy=ci(n.scaleY)),n.flip!==void 0&&(r.flip=n.flip),n.alignment!==void 0&&(r.algn=n.alignment),e.empty(`tile`,r)}else t.stretch&&(e.start(`stretch`),e.empty(`fillRect`,li(t.stretch)),e.end(`stretch`))},fi={mime:`image/png`,ext:`png`},G=(e=0)=>n.roundAccurately(12700*e,0),K=(e=0)=>n.roundAccurately(9525*e,0),q=e=>n.roundAccurately(6e4*e,0),pi=(e=0)=>n.roundAccurately(100*e,2),mi=class{constructor(){this._dxfs=[],this._byKey=new Map}add(e){let t=JSON.stringify(e),n=this._byKey.get(t);return n===void 0&&(n=this._dxfs.length,this._dxfs.push(e),this._byKey.set(t,n)),n}getDxfs(){return this._dxfs}getCount(){return this._dxfs.length}},hi=`dxfs`,gi=e=>{let t=e.get(hi);return t||(t=new mi,e.set(hi,t)),t},_i=`stylesLayout`,vi=(e,t)=>{let n=function(e,t){let n=t?.direct;n&&n.length!==0||(n=[{}]);let r=n.length,i=Array(r);for(let t=0;t<r;t++){let r=t===0?{...n[t],named:h.BuiltInName.Normal}:n[t],a=e.resolve(r),o={};r.named!==void 0&&(o.named=r.named),r.quotePrefix!==void 0&&(o.quotePrefix=r.quotePrefix),r.protection!==void 0&&(o.protection=r.protection);for(let e=0;e<yi.length;e++){let t=yi[e];if(r[t]===void 0&&t!==`alignment`)continue;let n=a?.[t]??r[t];n!==void 0&&(o[t]=n)}i[t]=o}return i}(e,t);return{styles:e,directXfs:n,denormalized:bi(e,t,n)}},yi=[`font`,`fill`,`borders`,`numberFormat`,`alignment`];function bi(t,r,i){let a={fontMap:new Map,fonts:[],fillMap:new Map,fills:[],borderMap:new Map,borders:[],numFmtMap:new Map,numFmtsCustom:[],namedStyleMap:new Map,namedStyles:[]};(function(t,n){let r=(t.getNamedStyles().getByName(h.BuiltInName.Normal).toJSON().style??{}).font??{};n.fontMap.set(e.JSONStableStringify(r),`0`),n.fonts.push(r)})(t,a),function(t){let n={type:`none`};t.fillMap.set(e.JSONStableStringify(n),`0`),t.fills.push(n);let r={type:`pattern`,patternType:`gray125`};t.fillMap.set(e.JSONStableStringify(r),`1`),t.fills.push(r)}(a),function(t){let n={bottom:{style:`none`},left:{style:`none`},right:{style:`none`},top:{style:`none`}};t.borderMap.set(e.JSONStableStringify(n),`0`),t.borders.push(n)}(a),function(e,t){Ci(e,e.getNamedStyles().getByName(h.BuiltInName.Normal).toJSON(),t)}(t,a);let o=r?.named??n.EmptyArray;for(let e of o)Ci(t,e,a);for(let e of i)Si(t,e,a);return a}function xi(e,t,n){if(!t)return;let r=f.toBuiltInID(t),i=n.numFmtMap;if(!i.has(t)){let e=0;typeof r==`number`?e=r:(e=n.numFmtsCustom.length+Pi,n.numFmtsCustom.push(r)),i.set(t,``+e)}}function Si(t,r,i){if(r){if(r.named){let e=r.named,a=e.toLowerCase(),o=i.namedStyleMap;if(!o.has(a)){o.set(a,``+o.size);let r=t.getNamedStyles().getByName(e).toJSON();Si(t,r.style??n.EmptyObject,i),i.namedStyles.push(r)}}r.font&&function(t,n,r){if(!n)return;let i=e.JSONStableStringify(n),a=r.fontMap;if(!a.has(i)){let e=a.size;a.set(i,``+e),r.fonts.push(n)}}(0,r.font,i),r.fill&&function(t,n,r){if(!n)return;let i=e.JSONStableStringify(n),a=r.fillMap;if(!a.has(i)&&typeof n==`object`&&n.type){let e=a.size;a.set(i,``+e),r.fills.push(n)}}(0,r.fill,i),r.borders&&function(t,n,r){if(!n)return;let i=e.JSONStableStringify(n),a=r.borderMap;if(!a.has(i)){let e=a.size;a.set(i,``+e),r.borders.push(n)}}(0,r.borders,i),r.numberFormat!==void 0&&xi(0,r.numberFormat,i)}}function Ci(e,t,n){if(!t)return;let r=t.name.toLowerCase();n.namedStyleMap.has(r)||(n.namedStyleMap.set(r,``+n.namedStyleMap.size),n.namedStyles.push(t),Si(e,t.style,n))}function wi(e,t,n,r,i=!1){let a=r.getDefaultFontSize(),o=r.getNormal().getFont().getColor();t.start(`font`),n.weight&&n.weight>=700&&t.empty(`b`),n.style&&n.style!==`normal`&&t.empty(`i`),P(n.strike)&&t.empty(`strike`);let s=Xe(n.underline);s&&t.empty(`u`,{val:s}),n.outline&&t.empty(`outline`),n.shadow&&t.empty(`shadow`);let c=$e(n.letterSpacing);c&&t.empty(c);let l=ct(n.baseline,i);l&&t.empty(`vertAlign`,{val:l}),i?n.size!==void 0&&t.empty(`sz`,{val:String(n.size)}):t.empty(`sz`,{val:String(n.size??a)}),W(t,r.getTheme(),n.color??o,`color`,!i);let{name:u,scheme:d}=Pe(n.family,n.fallbacks,r.getTheme(),!i),f=u!==void 0&&(!i||u!==r.getTheme().getFontScheme().getMinorFont());if(f&&(t.empty(`name`,{val:u}),n.fallbacks&&n.fallbacks.length>0)){let e=n.fallbacks;e.includes(`serif`)?t.empty(`family`,{val:1}):e.includes(`sans-serif`)?t.empty(`family`,{val:2}):e.includes(`monospace`)?t.empty(`family`,{val:3}):e.includes(`cursive`)?t.empty(`family`,{val:4}):e.includes(`fantasy`)&&t.empty(`family`,{val:5})}n.charset!==void 0&&n.charset!==null&&t.empty(`charset`,{val:String(n.charset)}),f&&d&&t.empty(`scheme`,{val:d}),t.end(`font`)}function Ti(e,t,n,r,i,a=!1){if(!i||i.style===`none`||!i.style)return void(a&&!i||t.empty(r));t.start(r,{style:i.style});let o=i.color;o&&W(t,n,o,`color`,!a,a),t.end(r)}function Ei(e,t,n,r,i=!1){let a={},o=e=>!!e?.style&&e.style!==`none`,s=o(n.diagonalUp)?n.diagonalUp:void 0,c=o(n.diagonalDown)?n.diagonalDown:void 0;i?(a.diagonalUp=`0`,a.diagonalDown=`0`):(s&&(a.diagonalUp=`1`),c&&(a.diagonalDown=`1`)),t.start(`border`,a),Ti(0,t,r,`left`,n.left,i),Ti(0,t,r,`right`,n.right,i),Ti(0,t,r,`top`,n.top,i),Ti(0,t,r,`bottom`,n.bottom,i),i?(Ti(0,t,r,`vertical`,n.vertical,i),Ti(0,t,r,`horizontal`,n.horizontal,i)):(s&&c&&(s.style!==c.style||Di(s.color)!==Di(c.color))&&e.warn(`A cell has diagonal borders in two different line styles or colors; an xlsx cell holds one diagonal line, so both are saved in the up diagonal's.`,void 0,`xlsx.border.diagonalMismatch`),Ti(0,t,r,`diagonal`,s??c,i)),t.end(`border`)}var Di=e=>e==null?null:typeof e==`string`?e:JSON.stringify(e);function Oi(e,t,n,r=!1){let i={};n.horizontal&&n.horizontal!==m.HorizontalAlignment.General&&(i.horizontal=n.horizontal),n.vertical&&n.vertical!==m.VerticalAlignment.Bottom&&(i.vertical=n.vertical);let a=n.rotation;n.stacked&&(i.textRotation=`255`,a=0),a&&(a>=270&&a<360?a=360-a:a>0&&a<=90&&(a+=90),i.textRotation=String(a));let o=n.overflow;switch(o===m.Overflow.Wrap&&(i.wrapText=`1`),n.indent&&(i.indent=``+n.indent),n.relativeIndent&&(i.relativeIndent=``+n.relativeIndent),n.justifyLastLine&&(i.justifyLastLine=`1`),o===m.Overflow.Shrink&&(i.shrinkToFit=`1`),n.readingDirection){case m.ReadingDirection.Auto:break;case m.ReadingDirection.LeftToRight:i.readingOrder=`1`;break;case m.ReadingDirection.RightToLeft:i.readingOrder=`2`}return Object.keys(i).length>0?i:null}var ki=65490;function Ai(t,n,r,i,a,o,s=!1,c=!1,l=null){let u={},d=null,f=i.named;f&&(d=r.getNamedStyles().getByName(f).toJSON().style);let p=i.font??d?.font,m=p?a.fontMap.get(e.JSONStableStringify(p))??0:0,g=i.fill??d?.fill,_=g?a.fillMap.get(e.JSONStableStringify(g))??0:0,v=i.borders??d?.borders,y=v?a.borderMap.get(e.JSONStableStringify(v))??0:0,b=i.numberFormat??d?.numberFormat;if(u.numFmtId=(b===void 0?void 0:a.numFmtMap.get(b))??`0`,u.fontId=String(m),u.fillId=String(_),u.borderId=String(y),o){let e=i.named??h.BuiltInName.Normal;u.xfId=a.namedStyleMap.get(e.toLowerCase())}let x=null,S=i.alignment??d?.alignment;S&&(x=Oi(0,0,S)),i.font&&(u.applyFont=`1`),i.fill&&(u.applyFill=`1`),i.numberFormat&&(u.applyNumberFormat=`1`),i.borders&&(u.applyBorder=`1`),x&&(u.applyAlignment=`1`);let C=null,w=i.protection?.alwaysUnlocked??d?.protection?.alwaysUnlocked??!1;(w||s)&&(C={},w&&(C.locked=`0`),s&&(C.hidden=`1`),u.applyProtection=`1`),i.quotePrefix&&(u.quotePrefix=`1`),c&&(u.pivotButton=`1`),x||C||l!==null?(n.start(`xf`,u),x&&n.empty(`alignment`,x),C&&n.empty(`protection`,C),l!==null&&(n.start(`extLst`),n.start(`ext`,{uri:ji,"xmlns:xfpb":Mi}),n.empty(`xfpb:xfComplement`,{i:String(l)}),n.end(`ext`),n.end(`extLst`)),n.end(`xf`)):n.empty(`xf`,u)}var ji=`{C7286773-470A-42A8-94C5-96B5CB345126}`,Mi=`http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag`;function Ni(e,t,n,r,i,a=`dxf`,o=Pi){if(t.start(a),n.font&&wi(0,t,n.font,r,!0),n.numberFormat!==void 0&&n.numberFormat!==null){let e=f.toBuiltInID(n.numberFormat),r=typeof e==`number`,i=r?f.builtInFormat(e):String(e);i&&t.empty(`numFmt`,{numFmtId:String(r?e:o++),formatCode:i})}if(n.fill&&Yr(e,t,n.fill,r,!0,!0),n.alignment){let e=Oi(0,0,n.alignment,!0);e&&t.empty(`alignment`,e)}return n.borders&&Ei(e,t,n.borders,i,!0),t.end(a),o}var Pi=164,Fi=Object.freeze([`unselectedItemWithData`,`unselectedItemWithNoData`,`selectedItemWithData`,`selectedItemWithNoData`,`hoveredUnselectedItemWithData`,`hoveredSelectedItemWithData`,`hoveredUnselectedItemWithNoData`,`hoveredSelectedItemWithNoData`]),Ii=Object.freeze(`wholeTable.headerRow.totalRow.firstColumn.lastColumn.firstRowStripe.secondRowStripe.firstColumnStripe.secondColumnStripe.firstHeaderCell.lastHeaderCell.firstTotalCell.lastTotalCell.firstSubtotalColumn.secondSubtotalColumn.thirdSubtotalColumn.firstSubtotalRow.secondSubtotalRow.thirdSubtotalRow.blankRow.firstColumnSubheading.secondColumnSubheading.thirdColumnSubheading.firstRowSubheading.secondRowSubheading.thirdRowSubheading.pageFieldLabels.pageFieldValues`.split(`.`)),Li=`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,Ri=`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,zi=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
|
|
6
|
-
`,Bi=`rId1`,Vi=`${zi}<pivotCacheDefinition xmlns="${Li}" createdVersion="8" refreshedVersion="8" minRefreshableVersion="3"><cacheSource type="worksheet"><worksheetSource/></cacheSource></pivotCacheDefinition>`,Hi=(e,t)=>{if(!t)return e;let n=Xt(e,`cacheSource`);if(!n)return e;let r=e.slice(n.contentStart,n.contentEnd),i=tt(r,`worksheetSource`,{ref:t.ref,sheet:t.sheet,name:t.name});return i===r?e:e.slice(0,n.contentStart)+i+e.slice(n.contentEnd)},Ui=(e,t,n)=>{let{fields:r,rest:i=Vi}=e;if(!r)return null;let a=Wi(e.items,r.length),o=Wi(e.records,r.length),s=e.recordCount??0,c=[];for(let e=0;e<r.length;e++)c.push(Ki(r[e],a[e],t,n));let l=i,u=/<pivotCacheDefinition((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)/.exec(l);if(!u)return null;let d=e.records!==void 0&&!/\ssaveData\s*=\s*["']0["']/.test(u[1]),f=!d||/\sxmlns:r\s*=/.test(u[1])?void 0:Ri;l=l.replace(u[0],()=>`<pivotCacheDefinition`+u[1]+B([[`xmlns:r`,f],[`r:id`,d?Bi:void 0],[`refreshOnLoad`,e.refreshOnLoad?`1`:void 0],[`recordCount`,s]]));let p=e.source??{},m=/<worksheetSource((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)/.exec(l);if(!m)return null;l=l.replace(m[0],()=>`<worksheetSource`+B([[`ref`,p.ref],[`sheet`,p.sheet],[`name`,p.name]])+m[1]);let h=Xt(l,`cacheSource`);if(!h)return null;if(l=l.substring(0,h.end)+`<cacheFields count="${r.length}">${c.join(``)}</cacheFields>`+Gi(r)+l.substring(h.end),!d)return{id:``,type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,name:`pivotCacheDefinition1.xml`,xml:l};let g=[];for(let e=0;e<r.length;e++)r[e].noRecords||g.push(e);let _=[zi,`<pivotCacheRecords xmlns="${Li}" xmlns:r="${Ri}" count="${s}">`];for(let e=0;e<s;e++){_.push(`<r>`);for(let n of g){let i=o[n][e];_.push(r[n].inline?Yi(a[n][i],!!r[n].dates||!!r[n].dateItems?.includes(i),!1,t):`<x v="${i}"/>`)}_.push(`</r>`)}return _.push(`</pivotCacheRecords>`),{id:``,type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,name:`pivotCacheDefinition1.xml`,xml:l,parts:[{id:Bi,type:yn,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`,name:`pivotCacheRecords1.xml`,xml:_.join(``)}]}},Wi=(e,t)=>{let n=[];for(let e=0;e<t;e++)n.push([]);for(let[t,r]of e??[]){let e=n[t];if(e)for(let[t,n]of r){let r=n.length;for(let i=0;i<r;i++)e[t+i]=n.at(i)}}return n},Gi=e=>{let t=e.flatMap((e,t)=>(e.calculatedItems??[]).map(({item:e,formula:n})=>`<calculatedItem${B([[`formula`,n]])}><pivotArea cacheIndex="1" outline="0" fieldPosition="0"><references count="1"><reference field="${t}" count="1"><x v="${e}"/></reference></references></pivotArea></calculatedItem>`));return t.length>0?`<calculatedItems count="${t.length}">${t.join(``)}</calculatedItems>`:``},Ki=(e,t,n,r)=>{let i=``,a=``;if(e.rest){let t=/^<cacheField((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/.exec(e.rest);t&&(i=t[1],t[2]!==`/`&&(a=e.rest.substring(t[0].length,e.rest.length-13)))}let o=B([[`name`,e.name],[`numFmtId`,e.numberFormat===void 0?0:r.numFmtId(e.numberFormat)],[`formula`,e.formula],[`databaseField`,e.noRecords?`0`:void 0]])+i,s=(e.noRecords?``:qi(e,t,n))+(e.group?((e,t)=>{let{range:n,discrete:r}=e,i=n!==void 0||r!==void 0,a=B([[`par`,e.parent],[`base`,i?e.base:void 0]]);if(!i)return`<fieldGroup${a}/>`;let o=``;if(n){let e=n.by!==`numbers`,r=n=>e?ke(n,t):n;o+=`<rangePr${B([[`autoStart`,n.fixedStart?`0`:void 0],[`autoEnd`,n.fixedEnd?`0`:void 0],[`groupBy`,e?n.by:void 0],[`startNum`,e?void 0:n.start],[`endNum`,e?void 0:n.end],[`startDate`,e?r(n.start):void 0],[`endDate`,e?r(n.end):void 0],[`groupInterval`,n.interval]])}/>`}r&&(o+=`<discretePr count="${r.length}">${r.map(e=>`<x v="${e}"/>`).join(``)}</discretePr>`);let s=new Set(e.dateItems);return o+=`<groupItems count="${e.items.length}">${e.items.map((e,n)=>Yi(e,s.has(n),!1,t)).join(``)}</groupItems>`,`<fieldGroup${a}>${o}</fieldGroup>`})(e.group,n):``)+a;return s?`<cacheField${o}>${s}</cacheField>`:`<cacheField${o}/>`},qi=(e,t,n)=>{let r=Ji(e,t),i=r.string||r.boolean||r.error,a=[r.string||r.boolean,r.error,r.number,r.date].filter(Boolean).length,o=r.number&&!r.date,s=B([[`containsSemiMixedTypes`,i||r.blank?void 0:`0`],[`containsNonDate`,i||r.number&&(!r.date||r.numberInUse)?void 0:`0`],[`containsDate`,r.date?`1`:void 0],[`containsString`,i?void 0:`0`],[`containsBlank`,r.blank?`1`:void 0],[`containsMixedTypes`,a>1?`1`:void 0],[`containsNumber`,o?`1`:void 0],[`containsInteger`,o&&r.integer?`1`:void 0],[`minValue`,o?r.minValue:void 0],[`maxValue`,o?r.maxValue:void 0],[`minDate`,r.date?ke(r.minDate,n):void 0],[`maxDate`,r.date?ke(Number.isInteger(r.maxDate)?r.maxDate+1:r.maxDate,n):void 0],[`count`,e.inline?void 0:t.length],[`longText`,r.longText?`1`:void 0]]);if(e.inline||t.length===0)return`<sharedItems${s}/>`;let c=new Set(e.unused),l=new Set(e.calculatedItems?.map(e=>e.item)),u=``,d=new Set(e.dateItems);for(let r=0;r<t.length;r++)u+=Yi(t[r],e.dates||d.has(r),c.has(r),n,l.has(r));return`<sharedItems${s}>${u}</sharedItems>`},Ji=(e,t)=>{let n={string:!1,boolean:!1,error:!1,blank:!1,number:!1,numberInUse:!1,date:!1,integer:!0,longText:!1,minValue:1/0,maxValue:-1/0,minDate:1/0,maxDate:-1/0},r=new Set(e.dateItems),i=new Set(e.unused);for(let a=0;a<t.length;a++){let o=t[a];typeof o==`number`?e.dates||r.has(a)?(n.date=!0,o<n.minDate&&(n.minDate=o),o>n.maxDate&&(n.maxDate=o)):(n.number=!0,i.has(a)||(n.numberInUse=!0),Number.isInteger(o)||(n.integer=!1),o<n.minValue&&(n.minValue=o),o>n.maxValue&&(n.maxValue=o)):typeof o==`string`?(n.string=!0,o.length>255&&(n.longText=!0)):typeof o==`boolean`?n.boolean=!0:o?.t===`e`?n.error=!0:n.blank=!0}return n},Yi=(e,t,n,r,i=!1)=>{let a=(n?` u="1"`:``)+(i?` f="1"`:``);if(typeof e==`number`)return t?`<d v="${ke(e,r)}"${a}/>`:`<n v="${e}"${a}/>`;if(typeof e==`string`)return`<s v="${oe(e)}"${a}/>`;if(typeof e==`boolean`)return`<b v="${+!!e}"${a}/>`;if(e?.t===`e`){let t=v.getBuiltInByCode(e.v)?.getLabel()??`#N/A`;return`<e v="${oe(t)}"${a}/>`}return`<m${a}/>`},Xi=`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`,Zi=`slicerPivotCacheIds`,Qi=(e,t)=>e.getSharedStates().get(Zi)?.get(t)??null,$i=/<\w+:pivotCacheDefinition\b[^>]*?\spivotCacheId="(\d+)"/,ea=(e,t)=>{let n=e.search(/<(?:\w+:)?ext\s[^>]*uri="\{725AE2AE-9491-48be-B2B4-4EB974FC3084\}"/i),r=n>=0?$i.exec(e.substring(n)):null;if(r)return{xml:e,id:r[1]};let i=t();if(n>=0){let t=e.substring(n),r=/<(\w+):pivotCacheDefinition\b/.exec(t);if(r){let t=n+r.index+r[0].length;return{xml:e.substring(0,t)+` pivotCacheId="${i}"`+e.substring(t),id:i}}}let a=`<ext uri="{725AE2AE-9491-48be-B2B4-4EB974FC3084}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:pivotCacheDefinition pivotCacheId="${i}"/></ext>`,o=e.lastIndexOf(`</pivotCacheDefinition>`);if(o<0)return{xml:e,id:i};let s=e.substring(0,o).trimEnd();if(s.endsWith(`</extLst>`)){let t=s.length-9;return{xml:e.substring(0,t)+a+e.substring(t),id:i}}return{xml:e.substring(0,o)+`<extLst>${a}</extLst>`+e.substring(o),id:i}},ta=(e,t)=>{if(!/<(?:\w+:)?conditionalFormats\b/.test(e))return e;let n=e.replace(/<((?:\w+:)?)conditionalFormat\b([^>]*?)(\/>|>[\s\S]*?<\/\1conditionalFormat>)/g,(e,n,r)=>{let i=/\spriority="(\d+)"/.exec(r)?.[1],a=i===void 0?void 0:t.get(parseInt(i,10));return a===void 0?``:e.replace(/(\spriority=")\d+"/,`$1${a}"`)});return n=n.replace(/<((?:\w+:)?)conditionalFormats\b([^>]*?)>([\s\S]*?)<\/\1conditionalFormats>/g,(e,t,n,r)=>{let i=(r.match(RegExp(`<${t}conditionalFormat\\b`,`g`))??[]).length;return i===0?``:e.replace(/(<(?:\w+:)?conditionalFormats\b[^>]*?\scount=")\d+"/,`$1${i}"`)}),n},na=e=>{let t=e.getSharedStates(),n=t.get(_i);if(!n)throw Error(`The styles are laid out before the pivot parts are written.`);let r=gi(t);return{numFmtId:e=>((e,t)=>(xi(e.styles,t,e.denormalized),parseInt(e.denormalized.numFmtMap.get(t)??`0`,10)))(n,e),dxfId:e=>r.add(e)}},ra=(e,t)=>e.getSharedStates().get(`pivotCachePaths`)?.get(t)??null,ia=`date1904`,aa=e=>!0===e.getSharedStates().get(ia),oa=0,sa=x.BuiltInOperatorNames,ca=(e,t,n,r,i,a,o)=>{let s=r.sorts,c=s?s.length:0;if(c===0)return;let l={};if(c>0){let e=s[0].criteria?.collatorOptions;e&&(l.caseSensitive=typeof e!=`object`||Array.isArray(e)||e.sensitivity!==`case`&&e.sensitivity!==`variant`?`0`:`1`)}let u=r.extent,d=n.getRange().getCoords(),f=(u?Me(d,u.range):null)??a;l.ref=S.rangeToString(f),l[`xmlns:xlrd2`]=`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2`,t.start(`sortState`,l);for(let n=0;n<c;n++){let r=s[n],i=r.criteria??{},c=r.index+a.colStart,l={};i.reverse&&(l.descending=`1`);let p=u?.sorts?.[n],m=(p?Me(d,p):null)??(u?{...f,colStart:c,colEnd:c}:{rowStart:Math.min(a.rowStart+o,a.rowEnd),rowEnd:a.rowEnd,colStart:c,colEnd:c});l.ref=S.rangeToString(m);let h=jt(i.sortOn);h&&(l.sortBy=h),i.style!==void 0&&(l.dxfId=gi(e.getSharedStates()).add(i.style)),i.iconSet!==void 0&&(l.iconSet=i.iconSet),i.customList!==void 0&&(l.customList=i.customList),t.empty(`sortCondition`,l)}t.end(`sortState`)},la=(e,t,n,r,i=!1)=>{let a=n.getRange();n.isShowTotals()&&(a=a.getResizeBy(-1,0));let o=a.getCoords(),s=r.sort,c=r.filter,l=c?c.conditions:void 0,u=l?l.length:0,d=r.hiddenButtons,f={};f.ref=a.toString();let p,m=[];for(let e=0;e<u;e++){let t=l[e];m[t.index]={...t}}if(Array.isArray(d)&&d.length>0){let e=d.length;p=Array(d[e-1]);for(let t=0;t<e;t++)p[d[t]]=!0}if(m||d||p||i){let c=0;r.columns?c=r.columns.length:i&&(c=a.getColumnCount()),t.start(`autoFilter`,f);for(let r=0;r<c;r++){let i=!0===d||!0===p?.[r],a=m[r];(a||i)&&pa(e,t,r,a,i,n.getColumnAt(r)?.getFilter()??null)}s&&i&&ca(e,t,n,s,0,o,i||n.isShowHeaders()?1:0),t.end(`autoFilter`)}else t.empty(`autoFilter`,f);s&&!i&&ca(e,t,n,s,0,o,i||n.isShowHeaders()?1:0)},ua=(e,t,n)=>{let r=He(n,t=>e.warn(t,n));if(!r)return;let i={operator:r.operator};r.val!==void 0&&(i.val=r.val),t.empty(`customFilter`,i)},da=new Set([x.BuiltInSelectorNames.Display,x.BuiltInSelectorNames.Date,x.BuiltInSelectorNames.Time]),fa=(e,t,n,r)=>{let i=[],a=[];for(let e=0;e<n.length;e++){let t=n[e];typeof t==`string`?a.push(t):i.push(t)}if(!r)return e.warn(`A values list by value has no column to read; its typed items are written as General text`,t),n;let o=r.getDisplayTexts(i);o.length===0&&i.length>0&&e.warn(`A values list by value names values no cell holds; they are not written`,t);for(let e=0;e<o.length;e++)a.push(o[e]);return a},pa=(e,t,n,r,i,a=null)=>{let o={};o.colId=``+n,i&&(o.hiddenButton=`1`),r?(t.start(`filterColumn`,o),((e,t,n,r=null)=>{let i=n.operator,a=typeof n.selector==`string`?n.selector:n.selector?.getName?.();if(a&&!da.has(a)&&e.warn(`A '${a}' selector has no OOXML form in a Table AutoFilter; the rule is written without it`,n),!0===n.includeBlanks&&i!==x.BuiltInOperatorNames.InSet&&i!==sa.Blank&&e.warn(`Ignore Blank has no OOXML form in a Table AutoFilter outside a values list; Excel will hide the blank rows`,n),i===x.BuiltInOperatorNames.Expression)return void e.warn(`Expression conditions not supported in Table AutoFilters`,n);if(i===x.BuiltInOperatorNames.Unique)return void e.warn(`Unique conditions not supported in Table AutoFilters`,n);if(i===x.BuiltInOperatorNames.Color){let r=n.param,i={};r.cellColor!==void 0&&(i.cellColor=r.cellColor?`1`:`0`),r.style!==void 0&&(i.dxfId=gi(e.getSharedStates()).add(r.style)),t.empty(`colorFilter`,i)}let o=_t(n);if(o!==null)return void ma(t,o===``?[]:[o],[],o===``||!0===n.includeBlanks);let s=Fe(n);if(s){t.start(`customFilters`,s.and?{and:`1`}:{});for(let e of s.filters)t.empty(`customFilter`,{operator:e.operator,val:e.val});t.end(`customFilters`)}else if(i!==sa.Blank){if(i===x.BuiltInOperatorNames.InSet){let i=n.param??{},a=Array.isArray(i.items)?i.items:[];n.selector!==x.BuiltInSelectorNames.Display&&a.some(e=>typeof e!=`string`)&&(a=fa(e,n,a,r)),i.source!==void 0&&i.source!==null&&e.warn(`A list read from a formula has no OOXML form in a Table AutoFilter; the filter is written without it`,n);let o=i.additions??[];o.length>0&&(e.warn(`Typed list values in a Table AutoFilter are written as items matched by displayed text`,n),a=[...a,...o]),(i.subtractions?.length??0)>0&&e.warn(`Exclusions from a list have no OOXML form in a Table AutoFilter; they are not written`,n),ma(t,a,i.dateGroups??[],!0===n.includeBlanks||!0===i.blank,i.calendarType);return}if(i===sa.And||i===sa.Or){let r=n.param??[],a=r.length;if(a>0){let n={};i===sa.And&&a>1&&(n.and=`1`),t.start(`customFilters`,n);for(let n=0;n<a;n++){let i=r[n];Qe(i)?ua(e,t,i):e.warn(`Only comparison and text criteria are supported in combined Table AutoFilters`,i)}t.end(`customFilters`)}}else Qe(n)?(t.start(`customFilters`),ua(e,t,n),t.end(`customFilters`)):i===sa.Not&&e.warn(`Not rule with non-comparison criteria not supported in OOXML`,n.param);if(i===x.BuiltInOperatorNames.TimePeriod){let r=n.param,i=r?.type;if(i&&bt.has(i)){let n=r.anchorDate,a=typeof n==`number`&&Number.isFinite(n)?pn(i,Math.floor(n),aa(e)):null;t.empty(`dynamicFilter`,a?{type:i,val:a.val,maxVal:a.maxVal}:{type:i})}else e.warn(`TimePeriod '${i}' has no OOXML dynamicFilter type; not written`,n.param)}if(i===x.BuiltInOperatorNames.Average){let r=n.param,i=r?.type===x.AverageType.Below?`belowAverage`:`aboveAverage`;r?.stdDevs&&e.warn(`Average with stdDevs has no OOXML spelling; written as ${i}`,n.param),t.empty(`dynamicFilter`,{type:i})}if(i===x.BuiltInOperatorNames.Icon){let e=n.param,r={};e.iconSet!==void 0&&(r.iconSet=e.iconSet),e.iconId!==void 0&&(r.iconId=``+e.iconId),t.empty(`iconFilter`,r)}if(i===x.BuiltInOperatorNames.TopN){let r=n.param;if(r.sum)return void e.warn(`Top N by sum has no OOXML form in a Table AutoFilter; it is not written`,n);let i={};r.percent&&(i.percent=`1`),r.top!==void 0&&(i.top=r.top?`1`:`0`),r.limit!==void 0&&(i.val=``+r.limit),r.filterVal!==void 0&&(i.filterVal=``+r.filterVal),t.empty(`top10`,i)}}else ma(t,[],[],!0)})(e,t,r,a),t.end(`filterColumn`)):t.empty(`filterColumn`,o)},ma=(e,t,n,r,i)=>{let a=t.length,o=n.length;if(a===0&&o===0&&!r)return;let s={};if(r&&(s.blank=`1`),i!==void 0&&(s.calendarType=i),a!==0||o!==0){e.start(`filters`,s);for(let n=0;n<a;n++){let r=I(t[n]);r!==void 0&&e.empty(`filter`,{val:r})}for(let t=0;t<o;t++){let r=n[t],i={};r.year!==void 0&&(i.year=``+r.year),r.month!==void 0&&(i.month=``+r.month),r.day!==void 0&&(i.day=``+r.day),r.hour!==void 0&&(i.hour=``+r.hour),r.minute!==void 0&&(i.minute=``+r.minute),r.second!==void 0&&(i.second=``+r.second),i.dateTimeGrouping=r.group,e.empty(`dateGroupItem`,i)}e.end(`filters`)}else e.empty(`filters`,s)},ha=`tableIds`,ga=e=>{let t=e.getSharedStates(),n=t.get(ha);return n||(n=new Map,t.set(ha,n)),n},_a=(e,t)=>{let n=ga(e),r=n.get(t);return r===void 0&&(r=++oa,n.set(t,r)),r},va=(e,t,n,r)=>{let i=r.columns,a=i?i.length:0;if(a!==0){t.start(`tableColumns`,{count:a});for(let o=0;o<a;o++){let a=i[o];typeof a==`string`&&(a={name:a});let s={};s.id=o+1,s.name=a.name??`Column${o+1}`;let c=null,l=a.totalsRowFormula;if(typeof l==`number`){let e=xa.get(l);e?s.totalsRowFunction=e:c=`SUBTOTAL(${l},${r.name?.trim()}[${s.name}])`}else l&&(c=ya(e,n,o,l.startsWith(`=`)?l.substring(1):l));c&&(s.totalsRowFunction=`custom`),a.totalsRowLabel&&(s.totalsRowLabel=a.totalsRowLabel);let u=a.calculatedColumnFormula?ya(e,n,o,a.calculatedColumnFormula):null;(c||u)&&(t.start(`tableColumn`,s),u&&(t.start(`calculatedColumnFormula`),t.text(u),t.end(`calculatedColumnFormula`))),c&&(t.start(`totalsRowFormula`),t.text(c),t.end(`totalsRowFormula`)),c||u?t.end(`tableColumn`):t.empty(`tableColumn`,s)}t.end(`tableColumns`)}},ya=(e,t,n,r)=>{let i=e.getSharedStates().get(L);if(!i)return r;try{let e=t.getDataRange().getCoords(),a={rowIndex:e.rowStart,colIndex:e.colStart+n},o=i.parse(r,a);return o&&A.image(i.spell(o,!1,t.getName()),{at:a})||r}catch{return r}},ba=(e,t,n,r)=>{let i={name:n.getStyle().getName(),showFirstColumn:n.isShowHighlightFirstColumn()?`1`:`0`,showLastColumn:n.isShowHighlightLastColumn()?`1`:`0`,showRowStripes:n.isShowBandedRows()?`1`:`0`,showColumnStripes:n.isShowBandedColumns()?`1`:`0`};t.empty(`tableStyleInfo`,i)},xa=new Map([[101,`average`],[102,`countNums`],[103,`count`],[104,`max`],[105,`min`],[107,`stdDev`],[109,`sum`],[110,`var`]]),Sa=`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,Ca=`http://schemas.openxmlformats.org/markup-compatibility/2006`,wa=`http://schemas.microsoft.com/office/spreadsheetml/2016/revision10`,Ta=`ascending`,Ea=`showItemsWithDataAtTop`,Da={ascending:`ascending`,descending:`descending`,dataSource:`natural`},Oa={xmlns:R,"xmlns:mc":Ca,"mc:Ignorable":`x xr10`,"xmlns:x":Sa,"xmlns:xr10":wa},J=e=>e.toJSON()?.pivot??null,ka=e=>J(e)?.timeline!==void 0,Aa=e=>{let t=[],n=e.getMovables().getItems();for(let e=0;e<n.length;e++){let r=n[e].getContent();r?.isISlicer&&!r.isDeleted?.()&&(r.getTable?.()||J(r))&&t.push(r)}return t},ja=(e,t,n,r)=>{let i=n._getPivotItems?.(),a=i?Qi(e,i.cacheId):null;if(!i||a===null)return void e.log(`The slicer '${n.getName?.()??``}' indexes a pivot cache that was not written; Excel repairs it.`);let o=n.toJSON(),s=n.getSortOrder(),c=n.getCrossFilter();t.start(`data`),t.start(`tabular`,{pivotCacheId:a,sortOrder:s===Ta?void 0:Da[s],customListSort:o?.disabledCustomListSort?`0`:void 0,showMissing:r.tabular?.hideMissing?`0`:void 0,crossFilter:c===Ea?void 0:c}),t.start(`items`,{count:i.items.length});for(let e=0;e<i.items.length;e++){let n=i.items[e];t.empty(`i`,{x:n.id,s:n.isSelected?`1`:void 0,nd:n.missing?`1`:void 0})}t.end(`items`),t.end(`tabular`),t.end(`data`)},Ma=(e,t,n)=>{let r=Pa(e),i=n._getPivotTables?.()??[],a=[];for(let e=0;e<i.length;e++){let t=r.get(i[e].getWorksheet());t!==void 0&&a.push({tabId:t,name:i[e].getName()})}if(a.length!==0){t.start(`pivotTables`);for(let e=0;e<a.length;e++)t.empty(`pivotTable`,{tabId:a[e].tabId,name:a[e].name});t.end(`pivotTables`)}},Na={xmlns:et,"xmlns:mc":Ca,"xmlns:xr10":wa},Pa=e=>e.getSharedStates().get(`sheetIdsBySheet`)??new Map,Fa=`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink`,Ia=`fileVersion`;function La(e,t){let n=t.rels;for(let t of n)if(t.target===null||!t.external&&!e.carriesSourcePart(t.target))return null;let r=new Map;for(let t of n){let n=t.external?e.addExternal(t.type,t.target,t.id).relId:e.addRelationship(t.type,t.target,t.id);if(n===null)return null;r.set(t.id,n)}return r.size===0?t.xml:t.xml.replace(/(\sr:id=")([^"]*)"/g,(e,t,n)=>{let i=r.get(n);return i===void 0?e:`${t}${i}"`})}var Ra=`sheetParts`,za=`macroEnabled`;function Ba(e,t,n,r,i,a){let o=r.part;if(!o?.xml)return null;let s=we(o.xml,i),c=Ze(s),l=c?le(e=>c.get(e)):void 0,u=r.tabColor;(u??void 0)!==l&&(s=xe(s,u?function(e,t){let n=[],r=Mn({write:e=>{n.push(e)}});return r.setValidationDisabled(!0),W(r,e.getTheme(),t,`tabColor`,!1),r.close(),new TextDecoder(`utf-8`).decode(function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}(n))||null}(t,u):null));let d=Dt[n],f=ye(o.type)===n?o.type:d.relType,p=o.contentType??d.contentType;return n!==`macro`||a||(s=Pt(s),d=on,f=on.relType,p=on.contentType),e.addPart(`embeddedPart`,{...o,xml:s,type:f,contentType:p},`/xl/${d.folder}/sheet{n}.xml`).relId??null}var Va=`externalLinkParts`,Ha={auto:`auto`,automaticExceptTables:`autoNoTable`,manual:`manual`},Ua=[`location`,`pivotFields`,`rowFields`,`rowItems`,`colFields`,`colItems`,`pageFields`,`dataFields`,`formats`,`conditionalFormats`,`chartFormats`,`pivotHierarchies`,`pivotTableStyleInfo`,`filters`,`rowHierarchiesUsage`,`colHierarchiesUsage`,`extLst`],Wa=`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,Ga=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<pivotTableDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" updatedVersion="8" minRefreshableVersion="3" itemPrintTitles="1" createdVersion="8"><extLst><ext uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}" xmlns:x14="${Wa}"><x14:pivotTableDefinition hideValuesRow="1" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"/></ext></extLst></pivotTableDefinition>`,Ka={compact:[[`outline`,`1`],[`outlineData`,`1`]],outline:[[`compact`,`0`],[`compactData`,`0`],[`outline`,`1`],[`outlineData`,`1`]],tabular:[[`compact`,`0`],[`compactData`,`0`]]},qa=e=>{let t=[e.rowFields,e.columnFields].find(e=>e?.includes(-2));if(!t)return e.valuesPosition;let n=t.indexOf(-2);return n<t.length-1?n:void 0},Ja=(e,t,n,r=!1)=>{let{fields:i,rest:a=Ga}=e;if(!i)return null;let o=/<pivotTableDefinition((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)/.exec(a);if(!o)return null;let s=e=>e?`1`:void 0,c=a.replace(o[0],()=>`<pivotTableDefinition`+B([[`name`,e.name??``],[`cacheId`,e.cacheId],[`dataOnRows`,s(e.valuesOnRows)],[`dataPosition`,qa(e)],[`dataCaption`,e.valuesCaption??`Values`],[`grandTotalCaption`,e.grandTotalCaption],[`errorCaption`,e.errorCaption],[`showError`,s(e.showError)],[`missingCaption`,e.emptyCaption],[`showMissing`,!1===e.showEmpty?`0`:void 0],[`pageWrap`,e.pageWrap],[`pageOverThenDown`,s(e.pageOverThenDown)],[`rowGrandTotals`,!1===e.rowGrandTotals?`0`:void 0],[`colGrandTotals`,!1===e.columnGrandTotals?`0`:void 0],[`indent`,e.indent??0],...Ka[e.form??`compact`],[`multipleFieldFilters`,e.multipleFiltersPerField?void 0:`0`],[`rowHeaderCaption`,e.rowHeaderCaption],[`colHeaderCaption`,e.columnHeaderCaption],[`preserveFormatting`,!1===e.preserveFormatting?`0`:void 0],[`useAutoFormatting`,!1===e.autoFitColumns?void 0:`1`],[`showDrill`,e.hiddenDrillIndicators?`0`:void 0],[`showHeaders`,e.hiddenFieldHeaders?`0`:void 0]])+o[1]),l=e.header??{firstHeaderRow:1,firstDataRow:1,firstDataCol:1},u=en(e);c=Y(c,`location`,`<location${B([[`ref`,e.location],[`firstHeaderRow`,l.firstHeaderRow],[`firstDataRow`,l.firstDataRow],[`firstDataCol`,l.firstDataCol],[`rowPageCount`,u?.rows],[`colPageCount`,u?.columns]])}/>`);let d=new Set((e.filters??[]).filter(e=>e.dataField!==void 0).map(e=>e.field));c=Y(c,`pivotFields`,`<pivotFields count="${i.length}">${i.map((e,n)=>$a(e,d.has(n),t)).join(``)}</pivotFields>`);let f=(e,t)=>{t&&t.length!==0&&(c=Y(c,e,`<${e} count="${t.length}">${t.map(e=>`<field x="${e}"/>`).join(``)}</${e}>`))},p=(e,t)=>{t&&t.length!==0&&(c=Y(c,e,`<${e} count="${t.length}">${t.map(Xa).join(``)}</${e}>`))};f(`rowFields`,e.rowFields),f(`colFields`,e.columnFields),p(`rowItems`,e.rowLines),p(`colItems`,e.columnLines);let m=e.pageFields;if(m&&m.length>0){let e=m.map(e=>`<pageField${B([[`fld`,e.field],[`item`,e.item],[`hier`,-1]])}/>`).join(``);c=Y(c,`pageFields`,`<pageFields count="${m.length}">${e}</pageFields>`)}let h=e.dataFields;h&&h.length>0&&(c=Y(c,`dataFields`,`<dataFields count="${h.length}">${h.map(e=>Za(e,t)).join(``)}</dataFields>`));let g=e.formats;g&&g.length>0&&(c=Y(c,`formats`,Et(g,t)));let _=e.conditionalFormats;if(_&&_.length>0){let e=_.map(e=>`<conditionalFormat${B([[`scope`,e.scope],[`type`,e.type],[`priority`,e.priority]])}><pivotAreas count="${e.areas.length}">${e.areas.map(wt).join(``)}</pivotAreas></conditionalFormat>`).join(``);c=Y(c,`conditionalFormats`,`<conditionalFormats count="${_.length}">${e}</conditionalFormats>`)}let v=e.style;v&&(c=Y(c,`pivotTableStyleInfo`,`<pivotTableStyleInfo${B([[`name`,v.name],[`showRowHeaders`,Ya(v.showRowHeaders)],[`showColHeaders`,Ya(v.showColumnHeaders)],[`showRowStripes`,Ya(v.showRowStripes)],[`showColStripes`,Ya(v.showColumnStripes)],[`showLastColumn`,Ya(v.showLastColumn)]])}/>`));let y=(e.filters??[]).map((e,t)=>Kt(e,t,n,r)).filter(e=>e!==null);return y.length>0&&(c=Y(c,`filters`,`<filters count="${y.length}">${y.join(``)}</filters>`)),c},Ya=e=>e===void 0?void 0:e?`1`:`0`,Xa=e=>{let t=B([[`t`,e.type],[`r`,e.repeat||void 0],[`i`,e.dataField||void 0]]);return e.items.length===0?`<i${t}/>`:`<i${t}>${e.items.map(e=>e===0?`<x/>`:`<x v="${e}"/>`).join(``)}</i>`},Y=(e,t,n)=>{let r=/<pivotTableDefinition\b(?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*\s*>/.exec(e);if(!r)return e;let i=r.index+r[0].length,a=Ua.slice(0,Ua.indexOf(t));for(let t of a){let n=Xt(e,t,r.index+r[0].length);n&&n.end>i&&(i=n.end)}return e.substring(0,i)+n+e.substring(i)},Za=(e,t)=>{let n=e.showDataAs!==void 0&&de.has(e.showDataAs),r=e.baseItem===`previous`?kt:e.baseItem===`next`?Mt:e.baseItem,i=B([[`name`,e.name],[`fld`,e.field],[`subtotal`,e.subtotal],[`showDataAs`,n?void 0:e.showDataAs],[`baseField`,e.baseField],[`baseItem`,r],[`numFmtId`,e.numberFormat===void 0?void 0:t.numFmtId(e.numberFormat)]]);return n?`<dataField${i}><extLst><ext uri="${fn}" xmlns:x14="${Wa}"><x14:dataField${B([[`pivotShowAs`,e.showDataAs]])}/></ext></extLst></dataField>`:`<dataField${i}/>`},Qa={outline:[[`compact`,`0`]],tabular:[[`compact`,`0`],[`outline`,`0`]]},$a=(e,t,n)=>{let r=/^<pivotField((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)/.exec(e.rest??``)?.[1]??``,i=e.subtotals,a=e=>e?`1`:void 0,o=B([[`name`,e.name],[`axis`,e.axis?pe[e.axis]:void 0],[`dataField`,a(e.dataField)],...e.form?Qa[e.form]:[],[`numFmtId`,e.numberFormat===void 0?void 0:n.numFmtId(e.numberFormat)],[`subtotalCaption`,e.subtotalCaption],[`showAll`,e.showItemsWithNoData?void 0:`0`],[`measureFilter`,a(t)],[`includeNewItemsInFilter`,a(e.includeNewItemsInFilter)],[`multipleItemSelectionAllowed`,a(e.multipleItemSelection)],[`sortType`,e.sort?.order],[`subtotalTop`,!1===e.subtotalsOnTop?`0`:void 0],[`insertBlankRow`,a(e.blankRowAfter)],[`defaultSubtotal`,i?.length===0?`0`:void 0],...Ft.map(e=>[`${e}Subtotal`,i?.includes(e)?`1`:void 0])])+r,s=e.items,c=s?`<items count="${s.length}">${s.map(e=>`<item${B([[`n`,e.name],[`t`,e.type],[`h`,a(e.hidden)],[`sd`,e.collapsed?`0`:void 0],[`f`,a(e.calculated)],[`m`,a(e.missing)],[`x`,e.item]])}/>`).join(``)}</items>`:``;return e.sort?.dataField!==void 0&&(c+=nn(e.sort.dataField,e.sort.scope)),e.repeatLabels&&(c+=`<extLst><ext uri="{2946ED86-A175-432a-8AC1-64E0C546D7DE}" xmlns:x14="${Wa}"><x14:pivotField fillDownLabels="1"/></ext></extLst>`),c?`<pivotField${o}>${c}</pivotField>`:`<pivotField${o}/>`};function eo(e){let t=`[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${e.getContent()}`,n=e.getReplies();for(let e=0;e<n.length;e++)t+=`\nReply:\n ${n[e].getContent()}`;return t}function to(e,t,n){if(typeof t==`string`)return void io(e,t);let r=t.runs;for(let t=0;t<r.length;t++){let i=r[t];e.start(`r`),i.font&&ro(e,i.font,n),io(e,i.text??``),e.end(`r`)}}var no={serif:1,"sans-serif":2,monospace:3,cursive:4,fantasy:5};function ro(e,t,n){e.start(`rPr`);let r=(t,n)=>{n!==void 0&&e.empty(t,n?void 0:{val:0})};r(`b`,t.weight===void 0?void 0:t.weight>=700),r(`i`,t.style===void 0?void 0:t.style!==o.Style.Normal),r(`strike`,P(t.strike));let i=$e(t.letterSpacing);i&&r(i,!0),r(`outline`,t.outline),r(`shadow`,t.shadow);let a=Xe(t.underline);a&&e.empty(`u`,a===o.UnderlineStyle.Single?void 0:{val:a});let s=ct(t.baseline,!0);s&&e.empty(`vertAlign`,{val:s}),t.size!==void 0&&e.empty(`sz`,{val:t.size}),t.color&&function(e,t,n){let r=/^index(\d+)$/.exec(t);if(r)return void e.empty(`color`,{indexed:Number(r[1])});W(e,n,t,`color`)}(e,t.color,n);let{name:c,scheme:l}=Pe(t.family,t.fallbacks,n,!1);c&&e.empty(`rFont`,{val:c});let u=t.fallbacks;if(u)for(let t=0;t<u.length;t++){let n=no[u[t]];if(n!==void 0){e.empty(`family`,{val:n});break}}t.charset!==void 0&&e.empty(`charset`,{val:t.charset}),l&&e.empty(`scheme`,{val:l}),e.end(`rPr`)}function io(e,t){e.start(`t`,Re.test(t)||/[\n\r]/.test(t)?Nt:void 0),e.text(t),e.end(`t`)}function ao(e){let t=e.getRanges();if(t.isInvalid())return null;let n=t.getCoords()[0];return n?{ref:S.cellToString({rowIndex:n.rowStart,colIndex:n.colStart}),row:n.rowStart,col:n.colStart}:null}var oo=e=>!(!e||!(e.sz===void 0||e.sz>0)||e.csz||e.h||e.s!==void 0||e.l||e.cl),so={names:new Set,perFormula:[],affects:()=>!1},co=e=>``+y.flushSubnormal(e),lo=e=>Number.isInteger(e)&&Math.abs(e)<0x38d7ea4c68000?``+e:``+Number(y.flushSubnormal(e).toPrecision(15));function uo(e,t){let n=new Set,r=e.getGroups(t),i=e.getSummaryDirection(t),a=i===_.Direction.Down||i===_.Direction.Right;for(let e=0;e<r.length;e++){let t=r[e];t.collapsed&&n.add(t.summary??(a?t.end:t.start))}return n}var fo=e=>{let t=e?.[e.length-1];if(!t||t.max<1048575)return null;let n=t.value;return!n?.h||n.s!==void 0||n.l||n.cl||n.csz||n.sz!==void 0&&n.sz!==-1?null:1048575-t.min+1>t.min?t.min:null},po=1048576,mo=(e,t,n)=>{if(!n)return[];let r=0;for(let i=0;i<n.length;i++){let a=n[i][0],o=t.getRange(a).getCoords();if(r+=(o.rowEnd-o.rowStart+1)*(o.colEnd-o.colStart+1),r>po)return e.warn(`Direct styles cover more than ${po} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`),n.slice(0,i)}return n},ho=/^\s*=?\s*TABLE\s*\(/i;function go(e,t,n,r){let i=null,a=[];for(let r=t.rowStart;r<=t.rowEnd;r++)for(let o=t.colStart;o<=t.colEnd;o++){let s=n;r===t.rowStart&&o===t.colStart||(i||(i=[],S.normalizeA1ToR1C1(n,t.rowStart,t.colStart,i)),s=S.resolveRelativeToA1(i,r,o));let c=ce(s,{rowIndex:r,colIndex:o});if(!c)return!1;let l=e.getRange(S.cellToString({rowIndex:r,colIndex:o})).getCell().getValue();v.isError(l,v.Code.Spill)||a.push([{rowStart:r,colStart:o,rowEnd:r,colEnd:o},Wt(c)])}for(let e=0;e<a.length;e++)r.push(a[e]);return!0}function _o(e,t){let n=t.type;n===O.ColorStopType.AutoMin?n=O.ColorStopType.Min:n===O.ColorStopType.AutoMax&&(n=O.ColorStopType.Max),e.empty(`cfvo`,{type:n,val:t.value,gte:t.exclusive?`0`:void 0})}function vo(e,t){let n={type:t.type,gte:t.exclusive?`0`:void 0};t.value===void 0?e.empty(`x14:cfvo`,n):(e.start(`x14:cfvo`,n),e.start(`xm:f`),e.text(t.value),e.end(`xm:f`),e.end(`x14:cfvo`))}var yo=new Set([h.IconSet.Arrows3,h.IconSet.ArrowsGray3,h.IconSet.Flags3,h.IconSet.Signs3,h.IconSet.Symbols3,h.IconSet.Symbols3_2,h.IconSet.TrafficLights3,h.IconSet.TrafficLights3_2,h.IconSet.Arrows4,h.IconSet.ArrowsGray4,h.IconSet.Rating4,h.IconSet.RedToBlack4,h.IconSet.TrafficLights4,h.IconSet.Arrows5,h.IconSet.ArrowsGray5,h.IconSet.Quarters5,h.IconSet.Rating5]);function bo(e){return(e.icon?.length??0)>0||e.iconSet!==void 0&&!yo.has(e.iconSet)}function xo(e,t,r,i,a,o,s,c,l){let u=i.scale;i.ext&&e.warn(`Conditional format extension payload is not written to xlsx; it will be lost.`);let d={type:a.type,dxfId:i.style&&Object.keys(i.style).length>0?c.add(i.style):void 0,priority:s,stopIfTrue:X(i.stopIfTrue),aboveAverage:X(a.aboveAverage),equalAverage:X(a.equalAverage),stdDev:a.stdDev,bottom:X(a.bottom),percent:X(a.percent),rank:a.rank,operator:a.operator,text:a.text,timePeriod:a.timePeriod},f;u?.type===O.ScaleType.DataBar&&function(e){if(e.gradient||e.borderColor||e.negativeFillColor||e.negativeBorderColor||e.axisColor||e.axisPosition||e.direction)return!0;let t=e.stops,n=t?t.length:0;for(let e=0;e<n;e++){let n=t[e].type;if(n===O.ColorStopType.AutoMin||n===O.ColorStopType.AutoMax)return!0}return!1}(u)&&(f=z(n.uuidV4),l.push({guid:f,sqref:o,priority:s,scale:u}));let p=a.formulas,m=p?p.length:0;if(m!==0||u){t.start(`cfRule`,d);for(let e=0;e<m;e++)t.start(`formula`),t.text(p[e]),t.end(`formula`);if(u?.type===O.ScaleType.ColorScale){let e=u.stops??[];t.start(`colorScale`);for(let n=0;n<e.length;n++)_o(t,e[n]);for(let n=0;n<e.length;n++)W(t,r,e[n].color,`color`);t.end(`colorScale`)}else if(u?.type===O.ScaleType.DataBar){let e=u.stops??[];t.start(`dataBar`,{minLength:u.minLength,maxLength:u.maxLength,showValue:X(u.showValue)});for(let n=0;n<e.length;n++)_o(t,e[n]);u.color&&W(t,r,u.color,`color`),t.end(`dataBar`)}else if(u?.type===O.ScaleType.IconSet){let e=u.stops??[];t.start(`iconSet`,{iconSet:u.iconSet,reverse:X(u.reverse),showValue:X(u.showValue)});for(let n=0;n<e.length;n++)_o(t,e[n]);t.end(`iconSet`)}f&&(t.start(`extLst`),t.start(`ext`,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),t.start(`x14:id`),t.text(f),t.end(`x14:id`),t.end(`ext`),t.end(`extLst`)),t.end(`cfRule`)}else t.empty(`cfRule`,d)}function So(e){let t=2**53-1,n=2**53-1,r=e.split(` `);for(let e=0;e<r.length;e++){if(!r[e])continue;let i=S.fastStringToRange(r[e]);i.rowStart<t&&(t=i.rowStart),i.colStart<n&&(n=i.colStart)}return S.cellToString({rowIndex:t,colIndex:n})}function Co(e){if(typeof e==`string`)return e.split(`,`).join(` `);if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=S.rangeToString(e[n]);r&&t.push(r)}return t.length>0?t.join(` `):null}return S.rangeToString(e)}function X(e){if(e!==void 0)return e?`1`:`0`}function wo(e){if(typeof e!=`string`)return!1;let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`)t=!t;else if(r===`!`&&!t)return!0}return!1}function To(e){let t=e.formulas,n=t?t.length:0;for(let e=0;e<n;e++)if(wo(t[e]))return!0;return!1}function Eo(e){let t=2**53-1,n=2**53-1,r=e.split(` `);for(let e=0;e<r.length;e++){if(!r[e])continue;let i=S.fastStringToRange(r[e]);i.rowStart<t&&(t=i.rowStart),i.colStart<n&&(n=i.colStart)}return t===2**53-1?null:{rowIndex:t,colIndex:n}}function Do(e,t,n){if(typeof e!=`string`||!e||!t||!n)return e;try{let r=n.parse(e,t);return r&&A.image(n.spell(r,!0),{at:t})||e}catch{return e}}function Oo(e,t,n){let r=e?.stops;if(!r||!n)return e;let i;for(let e=0;e<r.length;e++){let a=r[e]?.value;if(typeof a!=`string`)continue;let o=Do(a,t,n);o!==a&&(i||=[...r],i[e]={...r[e],value:o})}return i?{...e,stops:i}:e}function ko(e){let t=e.getDataValidations().getSettings(),n={};return t.disablePrompts&&(n.disablePrompts=`1`),t.windowX!==void 0&&(n.xWindow=t.windowX),t.windowY!==void 0&&(n.yWindow=t.windowY),n}var Ao=`application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings`;function jo(e,t,n){if(!n||n.length===0)return;let r=n.filter(e=>!e.automatic).length;e.start(t,{count:String(n.length),manualBreakCount:String(r)});for(let t of n){let n={id:String(t.index)};t.min!==void 0&&(n.min=String(t.min)),t.max!==void 0&&(n.max=String(t.max)),n.man=t.automatic?`0`:`1`,t.pivot&&(n.pt=`1`),e.empty(`brk`,n)}e.end(t)}function Mo(e,t,n,r){if(!r?.xml)return;let i=e.addPart(`legacyDrawing`,r);t.empty(n,{"r:id":i.relId})}var No=(e,t,n,r)=>{let i=(t,n)=>{let r=e.getRangeAtBounds({x:t,y:n,width:0,height:0}),i=r.getCoords(),a=r.getBounds();return[i.colStart,t-a.x,i.rowStart,n-a.y]},a=t.getMovable()?.getBounds()??null,o=a?t.toJSON()?.box?.anchor:void 0;if(a&&o?.tl&&o.br){let t=e.getEntireRange().getCoords(),i=e=>[Math.min(t.colEnd,Math.max(0,r+(e.c??0))),e.x??0,Math.min(t.rowEnd,Math.max(0,n+(e.r??0))),e.y??0];return{bounds:a,anchor:[...i(o.tl),...i(o.br)]}}if(!a){let t=e.getRange({rowStart:n,colStart:r,rowEnd:n,colEnd:r}).getBounds();a={x:t.x+t.width+15,y:Math.max(2,t.y-10),width:144,height:79}}return{bounds:a,anchor:[...i(a.x,a.y),...i(a.x+a.width,a.y+a.height)]}},Po=(e,t)=>{if(!t)return e;let n=e?.xml??null,r=at(n??``),i=[],a=t.comments;for(let e=0;e<a.length;e++){let{comment:n,row:o,col:s}=a[e],c=n.isNote()?n.toJSON():null,{bounds:l,anchor:u}=No(t.sheet,n,o,s),d=c?.box,f=d?.fill||d?.stroke?Ht(d.xml??$t,{fill:d.fill,stroke:d.stroke},e=>t.sheet.getStyles().parseColor(e)):d?.xml;i.push(gt(f,{shapeId:++r,zIndex:e+1,row:o,col:s,anchor:u,bounds:l,visible:!!c?.shown,alt:c?.description}))}let o=vt(n,i,r);return o?o===n?e:e?{...e,xml:o}:{xml:o}:e},Fo=Je+1,Io=(e,t)=>{if(t.length===0)return;let n=at(e.legacyDrawing?.xml??``),r=t.length;for(let e=0;e<r;e++){let r=t[e].jsonMovable.content?.json?.shapeId;typeof r==`number`&&r>n&&(n=r)}let i=new Set;for(let e=0;e<r;e++){let r=t[e].jsonMovable.content,a=r.json??={};(typeof a.shapeId!=`number`||i.has(a.shapeId))&&(a.shapeId=++n),i.add(a.shapeId)}},Lo=(e,t,n)=>{if(n.length===0)return t;let r=(t,n)=>e.getRange({rowStart:n,colStart:t,rowEnd:n,colEnd:t}).getBounds(),i=[],a=0,o=n.length;for(let e=0;e<o;e++){let t=n[e].jsonMovable,o=t.content.json??{},s=o.shapeId,{tl:c,br:l}=n[e].anchor,u=[c.c??0,Math.round(c.x??0),c.r??0,Math.round(c.y??0),l.c??0,Math.round(l.x??0),l.r??0,Math.round(l.y??0)],d=r(u[0],u[2]),f=r(u[4],u[6]),p=d.x+u[1],m=d.y+u[3],h=ln(t.content.type,o,{shapeId:s,zIndex:i.length+1,anchor:u,bounds:{x:p,y:m,width:Math.max(0,f.x+u[5]-p),height:Math.max(0,f.y+u[7]-m)},anchorType:n[e].anchorType});h&&(i.push(h),s>a&&(a=s))}if(i.length===0)return t;let s=vt(t?.xml??null,i,a,Ce);return s?t?{...t,xml:s}:{xml:s}:t},Ro=(e,t,n)=>{e.start(t),e.start(`xdr:col`),e.text(n.c??0),e.end(`xdr:col`),e.start(`xdr:colOff`),e.text(K(n.x)),e.end(`xdr:colOff`),e.start(`xdr:row`),e.text(n.r??0),e.end(`xdr:row`),e.start(`xdr:rowOff`),e.text(K(n.y)),e.end(`xdr:rowOff`),e.end(t)},zo={r:void 0,s:void 0,t:void 0,cm:void 0,vm:void 0},Bo={r:void 0,s:void 0,customFormat:void 0,hidden:void 0,ht:void 0,customHeight:void 0,"x14ac:dyDescent":`0.25`,outlineLevel:void 0,collapsed:void 0,thickTop:void 0,thickBot:void 0},Vo={t:void 0,aca:void 0,ref:void 0,ca:void 0,si:void 0},Ho={t:`shared`,aca:void 0,ref:void 0,ca:void 0,si:void 0},Uo={t:`array`,aca:void 0,ref:void 0,ca:void 0,si:void 0};function Wo(e,t){let n=Re.test(t)?Nt:void 0;e.start(`t`,n),e.text(sn(t)),e.end(`t`)}var Go=e=>String(Math.round(1e3*e)),Z=e=>e===void 0?void 0:e?`1`:`0`,Ko=new Set(`text.runs.paragraphs.field.color.size.kern.weight.style.b.i.spc.baseline.italic.underline.strike.font.eastAsianFont.complexScriptFont.symbolFont.language.alternateLanguage.kerning.spacing.letterSpacing.capitals.normalizeHeight.highlight.hyperlink.outline.effects.fill.stroke`.split(`.`)),qo={latin:`lt`,ea:`ea`,cs:`cs`,sym:`lt`,buFont:`lt`},Jo=(e,t,n)=>{if(!n)return;let r=n.scheme!==void 0&&n.scheme!==o.Scheme.None?`+${n.scheme===o.Scheme.Major?`mj`:`mn`}-${qo[t]}`:n.family;r!==void 0&&e.empty(t,{typeface:r,panose:n.panose,pitchFamily:n.pitch,charset:ge(n.charset)})},Yo=(e,t,r,i,a=n.EmptyObject)=>{let o=e.getXMLWriter(),s=((e,t,r=n.EmptyArray)=>{if(!t)return{...r};let i={...r};for(let e of Object.keys(t))Ko.has(e)||t[e]===void 0||(i[e]=t[e]);let{size:a,kern:o,weight:s,style:c,b:l,i:u,spc:d,baseline:f}=t,p=t;return p.language!==void 0&&(i.lang=p.language),p.alternateLanguage!==void 0&&(i.altLang=p.alternateLanguage),a!==void 0&&(i.sz=``+pi(a)),l!==void 0&&(i.b=l?`1`:`0`),s!==void 0&&(i.b=s>500?`1`:`0`),u!==void 0&&(i.i=u?`1`:`0`),c!==void 0&&(i.i=c===`italic`?`1`:`0`),t.italic!==void 0&&(i.i=t.italic?`1`:`0`),p.underline!==void 0&&(i.u=mn.write(p.underline)),p.strike!==void 0&&(i.strike=Ve.write(p.strike)),o!==void 0&&(i.kern=``+pi(o)),p.kerning!==void 0&&(i.kern=``+pi(p.kerning)),d!==void 0&&(i.spc=``+pi(d)),p.letterSpacing!==void 0&&(i.spc=``+pi(p.letterSpacing)),f!==void 0&&(i.baseline=Go(f)),p.capitals!==void 0&&(i.cap=p.capitals),p.normalizeHeight!==void 0&&(i.normalizeH=Z(p.normalizeHeight)),i})(0,i??{},a);i?.outline||i?.color||i?.effects?.length||i?.highlight||i?.font||i?.eastAsianFont||i?.complexScriptFont||i?.symbolFont||i?.hyperlink?(o.start(r,s),i.outline&&Xr(e,o,i.outline,t),i.color&&Yr(e,o,i.color,t),i.effects?.length&&$r(e,o,t.getTheme(),i.effects),i.highlight&&(o.start(`highlight`),H(o,t.getTheme(),i.highlight),o.end(`highlight`)),Jo(o,`latin`,i.font),Jo(o,`ea`,i.eastAsianFont),Jo(o,`cs`,i.complexScriptFont),Jo(o,`sym`,i.symbolFont),Jr(e,o,`hlinkClick`,i.hyperlink),o.end(r)):o.empty(r,s)},Xo=(e,t,n)=>{n&&(e.start(t),`percent`in n?e.empty(`spcPct`,{val:Go(n.percent)}):e.empty(`spcPts`,{val:String(Math.round(100*n.points))}),e.end(t))},Zo=(e,t,n,r)=>{let i=e.getXMLWriter(),a={marL:r.marginLeft===void 0?void 0:String(K(r.marginLeft)),marR:r.marginRight===void 0?void 0:String(K(r.marginRight)),lvl:r.level===void 0?void 0:String(r.level),indent:r.indent===void 0?void 0:String(K(r.indent)),algn:it.write(r.align),defTabSz:r.defaultTabSize===void 0?void 0:String(K(r.defaultTabSize)),rtl:Z(r.rightToLeft),eaLnBrk:Z(r.eastAsianLineBreak),fontAlgn:Gt.write(r.fontAlign),latinLnBrk:Z(r.latinLineBreak),hangingPunct:Z(r.hangingPunctuation)},o=r.bullet;if(r.lineSpacing||r.spaceBefore||r.spaceAfter||o||r.tabs||r.defaultRun){if(i.start(n,a),Xo(i,`lnSpc`,r.lineSpacing),Xo(i,`spcBef`,r.spaceBefore),Xo(i,`spcAft`,r.spaceAfter),o)switch(o.colorFollowsText?i.empty(`buClrTx`):o.color&&(i.start(`buClr`),H(i,t.getTheme(),o.color),i.end(`buClr`)),o.sizeFollowsText?i.empty(`buSzTx`):o.size&&(`percent`in o.size?i.empty(`buSzPct`,{val:Go(o.size.percent)}):i.empty(`buSzPts`,{val:String(Math.round(100*o.size.points))})),o.fontFollowsText?i.empty(`buFontTx`):Jo(i,`buFont`,o.font),o.type){case`none`:i.empty(`buNone`);break;case`auto`:i.empty(`buAutoNum`,{type:o.autoType??`arabicPeriod`,startAt:o.startAt===void 0?void 0:String(o.startAt)});break;case`char`:i.empty(`buChar`,{char:o.char??``})}if(r.tabs){i.start(`tabLst`);for(let e of r.tabs)i.empty(`tab`,{pos:String(K(e.position)),algn:Vt.write(e.align)});i.end(`tabLst`)}r.defaultRun&&Yo(e,t,`defRPr`,r.defaultRun),i.end(n)}else i.empty(n,a)},Qo=e=>e===m.Overflow.Visible?void 0:lt.write(e),$o=(e,t)=>{let n=t.body??{},r=n.insets,i={rot:t.rotation===void 0?void 0:String(Math.round(6e4*t.rotation)),spcFirstLastPara:Z(n.spaceFirstLastParagraph),vertOverflow:Qo(n.verticalOverflow??p.TEXT_DEFAULTS.verticalOverflow),horzOverflow:Qo(n.horizontalOverflow??p.TEXT_DEFAULTS.horizontalOverflow),vert:It.write(n.vertical),wrap:n.wrap,lIns:r?.left===void 0?void 0:String(K(r.left)),tIns:r?.top===void 0?void 0:String(K(r.top)),rIns:r?.right===void 0?void 0:String(K(r.right)),bIns:r?.bottom===void 0?void 0:String(K(r.bottom)),numCol:n.columns===void 0?void 0:String(n.columns),spcCol:n.columnSpacing===void 0?void 0:String(K(n.columnSpacing)),rtlCol:Z(n.rightToLeftColumns),fromWordArt:Z(n.fromWordArt),anchor:rn.write(n.anchor),anchorCtr:Z(n.anchorCenter),forceAA:Z(n.forceAntiAlias),upright:Z(n.upright),compatLnSpc:Z(n.compatibleLineSpacing)};if(n.warp||n.autoFit||n.extLst){if(e.start(`bodyPr`,i),n.warp){let t=Object.entries(n.warp.adjustments??{});if(e.start(`prstTxWarp`,{prst:n.warp.preset}),t.length===0)e.empty(`avLst`);else{e.start(`avLst`);for(let[n,r]of t)e.empty(`gd`,{name:n,fmla:`val ${Math.round(r)}`});e.end(`avLst`)}e.end(`prstTxWarp`)}switch(n.autoFit){case m.Autofit.None:e.empty(`noAutofit`);break;case m.Autofit.Shape:e.empty(`spAutoFit`);break;case m.Autofit.Normal:e.empty(`normAutofit`,{fontScale:n.fontScale===void 0?void 0:Go(n.fontScale),lnSpcReduction:n.lineSpacingReduction===void 0?void 0:Go(n.lineSpacingReduction)})}n.extLst&&e.raw(n.extLst),e.end(`bodyPr`)}else e.empty(`bodyPr`,i)},es=(e,t,n)=>{let r=e.getXMLWriter();n&&(n.default||n.levels?.some(e=>e))?(r.start(`lstStyle`),n.default&&Zo(e,t,`defPPr`,n.default),n.levels?.forEach((n,r)=>{n&&Zo(e,t,`lvl${r+1}pPr`,n)}),r.end(`lstStyle`)):r.empty(`lstStyle`)},ts=(e,t,n,r)=>{let i=e.getXMLWriter();i.pushDefaultNamespace(`a`),i.start(`p`);let{runs:a,endRun:o,...s}=r,c=p.inheritedTextSize(n,r)===void 0?e=>e.size===void 0?{...e,size:p.TEXT_DEFAULTS.size}:e:e=>e;(e=>!!e&&Object.keys(e).some(t=>t!==`runs`&&t!==`endRun`&&e[t]!==void 0))(s)&&Zo(e,t,`pPr`,s);for(let n of a??[]){if(n?.text===`
|
|
7
|
-
`){i.empty(`br`);continue}let{text:r,field:a,...o}=n,s=a?`fld`:`r`;i.start(s,a?{id:a.id,type:a.type}:{}),Yo(e,t,`rPr`,c(o)),i.start(`t`),i.text(r??``),i.end(`t`),i.end(s)}!o&&a?.length||Yo(e,t,`endParaRPr`,c(o??{})),i.end(`p`),i.popDefaultNamespace()},ns=(e,t,n)=>{if(!n)return;let r=e.getXMLWriter(),i=(e=>typeof e==`string`?{paragraphs:[{runs:[{text:e}]}]}:Array.isArray(e?.paragraphs)?e:{paragraphs:[e]})(n);r.start(`txBody`),r.pushDefaultNamespace(`a`),$o(r,i),es(e,t,i.listStyle);let a=i.paragraphs.length===0?[{runs:[]}]:i.paragraphs;for(let n of a)ts(e,t,i,n);r.popDefaultNamespace(),r.end(`txBody`)},rs=(e,t,n)=>{let r=e.getXMLWriter();if(!n)return r.empty(`bodyPr`),void r.empty(`lstStyle`);$o(r,n),es(e,t,n.listStyle)};function is(e,t,n,r){e.start(r);let i={typeface:t.latin||n};t.panose&&(i.panose=t.panose),e.empty(`latin`,i),e.empty(`ea`,{typeface:t.eastAsian??``}),e.empty(`cs`,{typeface:t.complexScript??``});let a=t.scripts;if(a)for(let t of Object.keys(a))e.empty(`font`,{script:t,typeface:a[t]});e.end(r)}var as=[[`shape`,`spDef`],[`line`,`lnDef`],[`text`,`txDef`]],os={checkbox:`Checkbox`},ss=[[`dc:title`,`title`],[`dc:subject`,`subject`],[`dc:creator`,`author`],[`cp:keywords`,`keywords`],[`dc:description`,`comments`],[`cp:lastModifiedBy`,`lastAuthor`],[`cp:lastPrinted`,`lastPrinted`],[`dcterms:created`,`creationDate`,!0],[`dcterms:modified`,`lastModifiedDate`,!0],[`cp:category`,`category`],[`cp:contentStatus`,`contentStatus`],[`cp:revision`,`revisionNumber`]],cs=e=>e.toISOString().split(`.`)[0]+`Z`,Q=(e,t,n,r)=>{t.start(n),t.text(r),t.end(n)},ls=(e,t,n)=>{let r=[{heading:`Worksheets`,names:[]},{heading:`Excel 4.0 Macros`,names:[]},{heading:`Charts`,names:[]},{heading:`Dialogs`,names:[]}],i={worksheet:0,macro:+(!0===e.getSharedStates().get(za)),chart:2,dialog:3};for(let e of n.getSheets({visibility:D.Visibility.Hidden}))r[i[e.getKind()]??0].names.push(e.getName());let a=n.getNames().getItems({type:`formula`}).filter(e=>!!e.getRanges?.());r.push({heading:`Named Ranges`,names:a.map(e=>{let t=e.getScope();return t?`${S.sheetNameToString(t)}!${e.getName()}`:e.getName()})});let o=r.filter((e,t)=>t===0||e.names.length>0),s=0;for(let e of o)s+=e.names.length;t.start(`HeadingPairs`),t.start(`vt:vector`,{size:``+2*o.length,baseType:`variant`});for(let e of o)t.start(`vt:variant`),t.start(`vt:lpstr`),t.text(e.heading),t.end(`vt:lpstr`),t.end(`vt:variant`),t.start(`vt:variant`),t.start(`vt:i4`),t.text(``+e.names.length),t.end(`vt:i4`),t.end(`vt:variant`);t.end(`vt:vector`),t.end(`HeadingPairs`),t.start(`TitlesOfParts`),t.start(`vt:vector`,{size:``+s,baseType:`lpstr`});for(let e of o)for(let n of e.names)t.start(`vt:lpstr`),t.text(n),t.end(`vt:lpstr`);t.end(`vt:vector`),t.end(`TitlesOfParts`)},us={[N.Type.String]:`vt:lpwstr`,[N.Type.Number]:`vt:i4`,[N.Type.Float]:`vt:r8`,[N.Type.Boolean]:`vt:bool`,[N.Type.Date]:`vt:filetime`},ds=e=>e.split(`.`)[0]+`Z`,fs={minSupportedVersion:`120000`,copy:`1`,pasteAll:`1`,pasteValues:`1`,merge:`1`,splitFirst:`1`,rowColShift:`1`,clearFormats:`1`,clearComments:`1`,assign:`1`,coerce:`1`},ps=`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2`,ms=(e,t)=>{for(let[n,r]of t)e.start(`v`,n?{t:n}:void 0),e.text(r),e.end(`v`)},$=e=>e===void 0||e===`_`?void 0:e,hs=(e,t)=>{let n=t.indexOf(` `);n<0||e.empty(`gd`,{name:t.slice(0,n),fmla:t.slice(n+1).trim()})},gs=(e,t,n)=>{e.empty(`pos`,{x:t,y:n})},_s=(e,t)=>{let n=t.split(` `);n[0]===`xy`?(e.start(`ahXY`,{gdRefX:$(n[1]),minX:$(n[5]),maxX:$(n[6]),gdRefY:$(n[2]),minY:$(n[7]),maxY:$(n[8])}),gs(e,n[3],n[4]),e.end(`ahXY`)):n[0]===`polar`&&(e.start(`ahPolar`,{gdRefR:$(n[1]),minR:$(n[5]),maxR:$(n[6]),gdRefAng:$(n[2]),minAng:$(n[7]),maxAng:$(n[8])}),gs(e,n[3],n[4]),e.end(`ahPolar`))},vs={M:[`moveTo`,1],L:[`lnTo`,1],Q:[`quadBezTo`,2],C:[`cubicBezTo`,3]},ys=(e,t)=>{e.start(`path`,{w:t.w,h:t.h,fill:t.f,stroke:t.s===0?`0`:void 0});let n=t.d.split(/\s+/).filter(e=>e!==``),r=0;for(;r<n.length;){let t=n[r++];if(t===`Z`)e.empty(`close`);else if(t===`A`)e.empty(`arcTo`,{wR:n[r],hR:n[r+1],stAng:n[r+2],swAng:n[r+3]}),r+=4;else{let i=vs[t];if(!i)break;e.start(i[0]);for(let t=0;t<i[1];t++,r+=2)e.empty(`pt`,{x:n[r],y:n[r+1]});e.end(i[0])}}e.end(`path`)},bs={type:`http://schemas.microsoft.com/office/2011/relationships/chartStyle`,contentType:`application/vnd.ms-office.chartstyle+xml`,name:`style1.xml`,xml:`<cs:chartStyle xmlns:cs="http://schemas.microsoft.com/office/drawing/2012/chartStyle" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" id="395"><cs:axisTitle><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="900"/></cs:axisTitle><cs:categoryAxis><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz="900"/></cs:categoryAxis><cs:chartArea mods="allowNoFillOverride allowNoLineOverride"><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="bg1"/></a:solidFill><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz="1000"/></cs:chartArea><cs:dataLabel><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="900"/></cs:dataLabel><cs:dataLabelCallout><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="dk1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="lt1"/></a:solidFill><a:ln><a:solidFill><a:schemeClr val="dk1"><a:lumMod val="25000"/><a:lumOff val="75000"/></a:schemeClr></a:solidFill></a:ln></cs:spPr><cs:defRPr sz="900"/><cs:bodyPr rot="0" spcFirstLastPara="1" vertOverflow="clip" horzOverflow="clip" vert="horz" wrap="square" lIns="36576" tIns="18288" rIns="36576" bIns="18288" anchor="ctr" anchorCtr="1"><a:spAutoFit/></cs:bodyPr></cs:dataLabelCallout><cs:dataPoint><cs:lnRef idx="0"/><cs:fillRef idx="0"><cs:styleClr val="auto"/></cs:fillRef><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></cs:spPr></cs:dataPoint><cs:dataPoint3D><cs:lnRef idx="0"/><cs:fillRef idx="0"><cs:styleClr val="auto"/></cs:fillRef><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></cs:spPr></cs:dataPoint3D><cs:dataPointLine><cs:lnRef idx="0"><cs:styleClr val="auto"/></cs:lnRef><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="28575" cap="rnd"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:dataPointLine><cs:dataPointMarker><cs:lnRef idx="0"/><cs:fillRef idx="0"><cs:styleClr val="auto"/></cs:fillRef><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:ln w="9525"><a:solidFill><a:schemeClr val="lt1"/></a:solidFill></a:ln></cs:spPr></cs:dataPointMarker><cs:dataPointMarkerLayout symbol="circle" size="5"/><cs:dataPointWireframe><cs:lnRef idx="0"><cs:styleClr val="auto"/></cs:lnRef><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="28575" cap="rnd"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:dataPointWireframe><cs:dataTable><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w="9525"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill></a:ln></cs:spPr><cs:defRPr sz="900"/></cs:dataTable><cs:downBar><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="dk1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="dk1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></a:solidFill><a:ln w="9525"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></a:solidFill></a:ln></cs:spPr></cs:downBar><cs:dropLine><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="35000"/><a:lumOff val="65000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:dropLine><cs:errorBar><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:errorBar><cs:floor><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef></cs:floor><cs:gridlineMajor><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:gridlineMajor><cs:gridlineMinor><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:gridlineMinor><cs:hiLoLine><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="75000"/><a:lumOff val="25000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:hiLoLine><cs:leaderLine><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="35000"/><a:lumOff val="65000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr></cs:leaderLine><cs:legend><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="900"/></cs:legend><cs:plotArea mods="allowNoFillOverride allowNoLineOverride"><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef></cs:plotArea><cs:plotArea3D mods="allowNoFillOverride allowNoLineOverride"><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef></cs:plotArea3D><cs:seriesAxis><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></cs:spPr><cs:defRPr sz="900"/></cs:seriesAxis><cs:seriesLine><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="9525" cap="flat"><a:solidFill><a:srgbClr val="D9D9D9"/></a:solidFill><a:round/></a:ln></cs:spPr></cs:seriesLine><cs:title><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="1400"/></cs:title><cs:trendline><cs:lnRef idx="0"><cs:styleClr val="auto"/></cs:lnRef><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef><cs:spPr><a:ln w="19050" cap="rnd"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="sysDash"/></a:ln></cs:spPr></cs:trendline><cs:trendlineLabel><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="900"/></cs:trendlineLabel><cs:upBar><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="dk1"/></cs:fontRef><cs:spPr><a:solidFill><a:schemeClr val="lt1"/></a:solidFill><a:ln w="9525"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill></a:ln></cs:spPr></cs:upBar><cs:valueAxis><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></cs:fontRef><cs:defRPr sz="900"/></cs:valueAxis><cs:wall><cs:lnRef idx="0"/><cs:fillRef idx="0"/><cs:effectRef idx="0"/><cs:fontRef idx="minor"><a:schemeClr val="tx1"/></cs:fontRef></cs:wall></cs:chartStyle>`},xs={type:`http://schemas.microsoft.com/office/2011/relationships/chartColorStyle`,contentType:`application/vnd.ms-office.chartcolorstyle+xml`,name:`colors1.xml`,xml:`<cs:colorStyle xmlns:cs="http://schemas.microsoft.com/office/drawing/2012/chartStyle" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" meth="cycle" id="10"><a:schemeClr val="accent1"/><a:schemeClr val="accent2"/><a:schemeClr val="accent3"/><a:schemeClr val="accent4"/><a:schemeClr val="accent5"/><a:schemeClr val="accent6"/><cs:variation/><cs:variation><a:lumMod val="60000"/></cs:variation><cs:variation><a:lumMod val="80000"/><a:lumOff val="20000"/></cs:variation><cs:variation><a:lumMod val="80000"/></cs:variation><cs:variation><a:lumMod val="60000"/><a:lumOff val="40000"/></cs:variation><cs:variation><a:lumMod val="50000"/></cs:variation><cs:variation><a:lumMod val="70000"/><a:lumOff val="30000"/></cs:variation><cs:variation><a:lumMod val="70000"/></cs:variation><cs:variation><a:lumMod val="50000"/><a:lumOff val="50000"/></cs:variation></cs:colorStyle>`},Ss=(e,t)=>{let n={};t.unlocked&&(n.fLocksWithSheet=`0`),t.noPrint&&(n.fPrintsWithSheet=`0`),e.empty(`clientData`,n)},Cs=e=>e.content?.json?.members??[],ws=e=>({x:e.anchor?.tl?.x??0,y:e.anchor?.tl?.y??0,width:e.anchor?.br?.x??0,height:e.anchor?.br?.y??0}),Ts=async(e,t)=>{let n=t.content;if(n?.type!==`shape`&&n?.type!==`picture`||await si(e,n.json),n?.type===`group`){await si(e,n.json);for(let n of Cs(t))await Ts(e,n)}},Es=async(e,t,n,r,i,a)=>{let o=await ai(e,a),c=r.content?.json,l=c?.image??{},u=l.extLst??(o.external?void 0:Ds),d={...l,type:s.Type.Image,extLst:u,stretch:l.tile?void 0:l.stretch??{}},f={};c?.macro!==void 0&&(f.macro=c.macro),c?.published!==void 0&&(f.fPublished=c.published?`1`:`0`);let p={};l.dpi!==void 0&&(p.dpi=String(l.dpi)),l.isRotatedWithShape!==void 0&&(p.rotWithShape=l.isRotatedWithShape?`1`:`0`);let m=e.getXMLWriter();m.start(`pic`,f),m.start(`nvPicPr`),Us(e,m,n,r,t),m.start(`cNvPicPr`,c?.noRelativeResize?{preferRelativeResize:`0`}:{}),m.empty(`a:picLocks`,qs(r)),m.end(`cNvPicPr`),m.end(`nvPicPr`),m.start(`blipFill`,p),m.pushDefaultNamespace(`a`),di(m,d,o),m.popDefaultNamespace(),m.end(`blipFill`),Vs(e,t,n,r,i),m.end(`pic`)},Ds=`<a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/></a:ext></a:extLst>`,Os=async(e,t,n,r,i)=>{let a=r.content?.json,o=a?.model,s=a?.part,c=()=>i??n?.getBounds()??{x:0,y:0,width:0,height:0},l=vn(s?.type),u=o?.chart?.plotArea?.groups??[],d,f;if(o){let n=xn(o,{family:l,xml:s?.xml});if(n.leftOut.length>0){let i=r.content?.name??``;if(n.leftOut.length===u.length)return e.warn(`The chart '${i}' is of a type an xlsx file cannot hold (${n.leftOut.join(`, `)}); it is saved as a placeholder.`,void 0,`xlsx.chart.unplaced`),Bs(e,t,r,c());e.warn(`The chart '${i}' combines types one xlsx chart cannot hold together; it is saved without its ${n.leftOut.join(`, `)} series.`,void 0,`xlsx.chart.leftOut`)}d=n.family,f=n.xml}else{if(!s?.xml||!l)return Bs(e,t,r,c());d=l,f=s.xml}let p=bn[d],m=[...s?.parts??[]];if(d===`chartEx`)for(let e of[bs,xs])m.some(t=>t.type===e.type)||m.push({id:``,...e});let h=await Ir({...s,id:s?.id??``,type:p.relType,contentType:p.contentType,xml:f,parts:m},e,p.path);if(!h?.relId)return Bs(e,t,r,c());let g=e.getXMLWriter();if(d===`chart`)return void ks(e,t,n,r,d,h.relId,i);let _=(e=>{let t=new Set(e.map(e=>e.type));return t.has(`regionMap`)?{prefix:`cx4`,uri:`http://schemas.microsoft.com/office/drawing/2016/5/10/chartex`}:t.has(`funnel`)?{prefix:`cx2`,uri:`http://schemas.microsoft.com/office/drawing/2015/10/21/chartex`}:{prefix:`cx1`,uri:`http://schemas.microsoft.com/office/drawing/2015/9/8/chartex`}})(u);g.start(`mc:AlternateContent`,{"xmlns:mc":Ps}),g.start(`mc:Choice`,{[`xmlns:${_.prefix}`]:_.uri,Requires:_.prefix}),ks(e,t,n,r,d,h.relId,i),g.end(`mc:Choice`),g.start(`mc:Fallback`),Rs(g,c(),`This chart isn't available in your version of Excel.
|
|
8
|
-
|
|
9
|
-
Editing this shape or saving this workbook into a different file format will permanently break the chart.`),g.end(`mc:Fallback`),g.end(`mc:AlternateContent`)},ks=(e,t,n,r,i,a,o)=>{let s=e.getXMLWriter(),c=o??{x:0,y:0,width:0,height:0},l=i===`chartEx`?`cx`:`c`,u=bn[i].graphicUri;s.start(`graphicFrame`,{macro:``}),s.start(`nvGraphicFramePr`),Us(e,s,n,r,t),r.lockAspect?(s.start(`cNvGraphicFramePr`),s.empty(`a:graphicFrameLocks`,{noChangeAspect:`1`}),s.end(`cNvGraphicFramePr`)):s.empty(`cNvGraphicFramePr`),s.end(`nvGraphicFramePr`),s.start(`xfrm`),s.empty(`a:off`,{x:K(c.x),y:K(c.y)}),s.empty(`a:ext`,{cx:K(c.width),cy:K(c.height)}),s.end(`xfrm`),s.start(`a:graphic`),s.start(`a:graphicData`,{uri:u}),s.empty(`${l}:chart`,{[`xmlns:${l}`]:u,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":a}),s.end(`a:graphicData`),s.end(`a:graphic`),s.end(`graphicFrame`)},As=async(e,t,n,r,i)=>{let a=e.getXMLWriter(),o=r.content?.json,s=t.getStyles();a.start(`grpSp`),a.start(`nvGrpSpPr`),Us(e,a,n,r,t);let c=Gs(r);c?(a.start(`cNvGrpSpPr`),a.empty(`a:grpSpLocks`,c),a.end(`cNvGrpSpPr`)):a.empty(`cNvGrpSpPr`),a.end(`nvGrpSpPr`),a.start(`grpSpPr`),a.pushDefaultNamespace(`a`),Js(a,i,r,o?.childBounds??i),Qr(e,s,o),o?.scene3d&&a.raw(o.scene3d),o?.extLst?.properties&&a.raw(o.extLst.properties),a.popDefaultNamespace(),a.end(`grpSpPr`);for(let n of Cs(r))await js(e,t,n,ws(n));a.end(`grpSp`)},js=async(e,t,n,r)=>{switch(n.content?.type){case`picture`:{let i=oi(e,n.content.json?.resId);return i?Es(e,t,null,n,r,i):void e.warn(`The picture '${n.content.name??``}' in a group names no image in the workbook; the group is saved without it.`,void 0,`xlsx.drawing.group.picture`)}case`chart`:return Os(e,t,null,n,r);case`shape`:return Ms(e,t,null,n,r);case`group`:return As(e,t,null,n,r);default:return Ue(n.content?.type)?void Xs(e.getXMLWriter(),n,r):Bs(e,t,n,r)}},Ms=async(e,t,n,r,i)=>{let o=e.getXMLWriter(),s={},c=r.content?.json,l=c?.type??a.Type.Shape,u=t.getStyles();l===a.Type.Connector?(c?.macro!==void 0&&(s.macro=c.macro),c?.published!==void 0&&(s.fPublished=c.published?`1`:`0`),o.start(`cxnSp`,s),o.start(`nvCxnSpPr`),Us(e,o,n,r,t),Ks(e,o,n,r,t),o.end(`nvCxnSpPr`),Vs(e,t,n,r,i),Hs(e,t,n,r),ns(e,u,c?.text),o.end(`cxnSp`)):(c?.macro!==void 0&&(s.macro=c.macro),c?.textLink!==void 0&&(s.textlink=c.textLink),c?.locksText!==void 0&&(s.fLocksText=c.locksText?`1`:`0`),c?.published!==void 0&&(s.fPublished=c.published?`1`:`0`),o.start(`sp`,s),o.start(`nvSpPr`),Us(e,o,n,r,t),Ks(e,o,n,r,t),o.end(`nvSpPr`),Vs(e,t,n,r,i),Hs(e,t,n,r),ns(e,u,c?.text),o.end(`sp`))},Ns=async(e,t,n,r)=>Bs(e,t,r,n.getBounds()),Ps=`http://schemas.openxmlformats.org/markup-compatibility/2006`,Fs=`http://schemas.microsoft.com/office/drawing/2010/slicer`,Is=`http://schemas.microsoft.com/office/drawing/2012/timeslicer`,Ls=async(e,t,n,r)=>{let i=e.getXMLWriter(),a=r.content?.name??``,o=J(n.getContent()),s=o?.timeline!==void 0,c=s?{"xmlns:tsle":Is,Requires:`tsle`}:o?{"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`,Requires:`a14`}:{"xmlns:sle15":`http://schemas.microsoft.com/office/drawing/2012/slicer`,Requires:`sle15`},l=s?`Timeline: Works in Excel 2013 or higher. Do not move or resize.`:o?`This shape represents a slicer. Slicers are supported in Excel 2010 or later.
|
|
10
|
-
|
|
11
|
-
If the shape was modified in an earlier version of Excel, or if the workbook was saved in Excel 2003 or earlier, the slicer cannot be used.`:`This shape represents a table slicer. Table slicers are not supported in this version of Excel.
|
|
12
|
-
|
|
13
|
-
If the shape was modified in an earlier version of Excel, or if the workbook was saved in Excel 2007 or earlier, the slicer can't be used.`;i.start(`mc:AlternateContent`,{"xmlns:mc":Ps}),i.start(`mc:Choice`,c),i.start(`graphicFrame`,{macro:``}),i.start(`nvGraphicFramePr`),Us(e,i,n,r,t),i.empty(`cNvGraphicFramePr`),i.end(`nvGraphicFramePr`),i.start(`xfrm`),i.empty(`a:off`,{x:`0`,y:`0`}),i.empty(`a:ext`,{cx:`0`,cy:`0`}),i.end(`xfrm`),i.start(`a:graphic`),s?(i.start(`a:graphicData`,{uri:Is}),i.empty(`tsle:timeslicer`,{"xmlns:tsle":Is,name:a}),i.end(`a:graphicData`)):(i.start(`a:graphicData`,{uri:Fs}),i.empty(`sle:slicer`,{"xmlns:sle":Fs,name:a}),i.end(`a:graphicData`)),i.end(`a:graphic`),i.end(`graphicFrame`),i.end(`mc:Choice`),i.start(`mc:Fallback`),Rs(i,n.getBounds(),l),i.end(`mc:Fallback`),i.end(`mc:AlternateContent`)},Rs=(e,t,n)=>{e.start(`sp`,{macro:``,textlink:``}),e.start(`nvSpPr`),e.empty(`cNvPr`,{id:`0`,name:``}),e.start(`cNvSpPr`),e.empty(`a:spLocks`,{noTextEdit:`1`}),e.end(`cNvSpPr`),e.end(`nvSpPr`),e.start(`spPr`),e.start(`a:xfrm`),e.empty(`a:off`,{x:K(t.x),y:K(t.y)}),e.empty(`a:ext`,{cx:K(t.width),cy:K(t.height)}),e.end(`a:xfrm`),e.start(`a:prstGeom`,{prst:`rect`}),e.empty(`a:avLst`),e.end(`a:prstGeom`),e.start(`a:solidFill`),e.empty(`a:prstClr`,{val:`white`}),e.end(`a:solidFill`),e.start(`a:ln`,{w:`1`}),e.start(`a:solidFill`),e.empty(`a:prstClr`,{val:`green`}),e.end(`a:solidFill`),e.end(`a:ln`),e.end(`spPr`),e.start(`txBody`),e.empty(`a:bodyPr`,{vertOverflow:`clip`,horzOverflow:`clip`}),e.empty(`a:lstStyle`),e.start(`a:p`),e.start(`a:r`),e.empty(`a:rPr`,{lang:`en-US`,sz:`1100`}),e.start(`a:t`),e.text(n),e.end(`a:t`),e.end(`a:r`),e.end(`a:p`),e.end(`txBody`),e.end(`sp`)},zs=async(e,t,n,r)=>Bs(e,t,r,n.getBounds()),Bs=async(e,t,n,r)=>{Ms(e,t,null,{...n,content:{type:`shape`,name:n.content?.name,description:n.content?.description,json:{fill:`bg1`,stroke:{width:2,fill:`red`},text:{runs:[{text:`Unsupported Type: `+(n.content?.type??`unknown`),color:`tx1`}]}}}},r)},Vs=(e,t,n,r,i)=>{let a=e.getXMLWriter(),o=r.content?.json,s=o?.geometry,c=t.getStyles();if(a.start(`spPr`),a.pushDefaultNamespace(`a`),Js(a,i,r),typeof s==`object`&&s)((e,t)=>{e.start(`custGeom`),e.start(`avLst`);for(let n of t.av??[])hs(e,n);e.end(`avLst`),e.start(`gdLst`);for(let n of t.gd??[])hs(e,n);e.end(`gdLst`),e.start(`ahLst`);for(let n of t.ah??[])_s(e,n);e.end(`ahLst`),e.start(`cxnLst`);for(let n of Array.isArray(t.cxn)?t.cxn:[]){let t=n.split(` `);e.start(`cxn`,{ang:t[0]}),gs(e,t[1],t[2]),e.end(`cxn`)}if(e.end(`cxnLst`),t.rect){let n=t.rect.split(` `);e.empty(`rect`,{l:n[0],t:n[1],r:n[2],b:n[3]})}e.start(`pathLst`);for(let n of t.paths)ys(e,n);e.end(`pathLst`),e.end(`custGeom`)})(a,s);else{a.start(`prstGeom`,{prst:typeof s==`string`?s:`rect`});let e=(e=>e?Object.keys(e).filter(t=>Number.isFinite(e[t])).map(t=>[t,`val ${Math.round(e[t])}`]):[])(o?.adjustments);if(e.length===0)a.empty(`avLst`);else{a.start(`avLst`);for(let[t,n]of e)a.empty(`gd`,{name:t,fmla:n});a.end(`avLst`)}a.end(`prstGeom`)}Qr(e,c,o),o?.scene3d&&a.raw(o.scene3d),o?.shape3d&&a.raw(o.shape3d),o?.extLst?.properties&&a.raw(o.extLst.properties),a.popDefaultNamespace(),a.end(`spPr`)},Hs=(e,t,n,r)=>{let i=e.getXMLWriter(),a=r.content?.json?.style;if(a===null)return;let o=t.getStyles().getTheme(),s=p.defaultStyleRefs(r.content?.json),c=(e,t)=>{t&&(i.start(e,{idx:String(t.index)}),t.color&&H(i,o,t.color),i.end(e))};i.start(`style`),i.pushDefaultNamespace(`a`),c(`lnRef`,a?.stroke??s.stroke),c(`fillRef`,a?.fill??s.fill),c(`effectRef`,a?.effect??s.effect),c(`fontRef`,a?.font??s.font),i.popDefaultNamespace(),i.end(`style`)},Us=(e,t,n,r,i)=>{let a=Ws(e,i).assigned.get(r);if(a===void 0){let t=e.getSharedStates(),n=t.get(`uniqueIdCounter`);n||(n=new Map,t.set(`uniqueIdCounter`,n)),a=(n.get(i)??1)+1,n.set(i,a)}let o=r.content?.json,s={id:``+a,name:r.content?.name};r.content?.description&&(s.descr=r.content.description),r.hidden&&(s.hidden=`1`),o?.title&&(s.title=o.title),t.start(`cNvPr`,s),Jr(e,t,`a:hlinkClick`,o?.hyperlink),Jr(e,t,`a:hlinkHover`,o?.hoverHyperlink),o?.extLst?.nonVisual&&t.raw(o.extLst.nonVisual),t.end(`cNvPr`)},Ws=(e,t)=>{let n=e.getSharedStates(),r=n.get(`drawingIds`);r||(r=new Map,n.set(`drawingIds`,r));let i=r.get(t);return i||(i={assigned:new Map,bySource:new Map},r.set(t,i)),i},Gs=e=>{let t={...e.content?.json?.locks};e.lockAspect!==void 0&&t.noChangeAspect===void 0&&(t.noChangeAspect=e.lockAspect);let n={};for(let e of Object.keys(t))t[e]&&(n[e]=`1`);return Object.keys(n).length>0?n:null},Ks=(e,t,n,r,i)=>{let o=r.content?.json,s=Gs(r);if(o?.type===a.Type.Connector){let n=o.connectorEnds;if(!s&&!n)return void t.empty(`cNvCxnSpPr`);let r=Ws(e,i);t.start(`cNvCxnSpPr`),s&&t.empty(`a:cxnSpLocks`,s),n?.start&&t.empty(`a:stCxn`,{id:String(r.bySource.get(n.start.id)??n.start.id),idx:String(n.start.index)}),n?.end&&t.empty(`a:endCxn`,{id:String(r.bySource.get(n.end.id)??n.end.id),idx:String(n.end.index)}),t.end(`cNvCxnSpPr`);return}let c={txBox:o?.textBox?`1`:void 0};s?(t.start(`cNvSpPr`,c),t.empty(`a:spLocks`,s),t.end(`cNvSpPr`)):t.empty(`cNvSpPr`,c)},qs=e=>{let t={...e.content?.json?.locks};e.lockAspect===void 0?t.noChangeAspect??=!0:t.noChangeAspect=e.lockAspect;let n={};for(let e of Object.keys(t))t[e]&&(n[e]=`1`);return n},Js=(e,t,n,r)=>{let i={},a=n.rotation;a!==void 0&&a!==0&&(i.rot=``+q(a)),n.flipH&&(i.flipH=`1`),n.flipV&&(i.flipV=`1`),e.start(`xfrm`,i),e.empty(`off`,{x:K(t.x),y:K(t.y)}),e.empty(`ext`,{cx:K(t.width),cy:K(t.height)}),r&&(e.empty(`chOff`,{x:K(r.x),y:K(r.y)}),e.empty(`chExt`,{cx:K(r.width),cy:K(r.height)})),e.end(`xfrm`)},Ys=(e,t,n)=>{e.start(t),e.start(`col`),e.text(n.c??0),e.end(`col`),e.start(`colOff`),e.text(K(n.x)),e.end(`colOff`),e.start(`row`),e.text(n.r??0),e.end(`row`),e.start(`rowOff`),e.text(K(n.y)),e.end(`rowOff`),e.end(t)},Xs=(e,t,n)=>{let r=t.content.json;if(e.start(`mc:AlternateContent`,Ke),e.start(`mc:Choice`,re),n)return e.raw(tn(t.content.type,r,t.content?.name,n)),e.end(`mc:Choice`),e.empty(`mc:Fallback`),void e.end(`mc:AlternateContent`);e.start(`twoCellAnchor`,{editAs:t.anchorType||`twoCell`}),Ys(e,`from`,t.anchor.tl),Ys(e,`to`,t.anchor.br),e.raw(tn(t.content.type,r,t.content?.name)),e.empty(`clientData`,{fPrintsWithSheet:`0`}),e.end(`twoCellAnchor`),e.end(`mc:Choice`),e.empty(`mc:Fallback`),e.end(`mc:AlternateContent`)},Zs=async(e,t,n)=>{let r=await n.getExternalURI();if(r)return void e.addExternal(ni,r);let i=e.getSharedStates(),a=i.get(ri);a||(a=new Map,i.set(ri,a));let o=a.get(n);if(!o){let e=await n.toBuffer();o={bytes:new Uint8Array(e),type:await n.getType()??fi,index:a.size+1},a.set(n,o)}let s=e.addBinary(o.bytes,o.type.mime,ni,`../media/image${o.index}.${o.type.ext}`,!0,t);s.relId!==t&&e.log(`Legacy drawing image '${t}' was written as '${s.relId}'; the markup will not find it.`)};function Qs(e){return e.toISOString().substring(0,22)}function $s(e,t,n,r,i,a,o,s,c){let l={ref:t,dT:Qs(i??new Date),personId:r?ec(r):void 0,id:ec(n),parentId:o?ec(o):void 0,done:s?`1`:void 0};if(e.start(`threadedComment`,l),e.start(`text`,Re.test(a)||/[\n\r]/.test(a)?Nt:void 0),e.text(a),e.end(`text`),c&&c.length>0){e.start(`mentions`);for(let t=0;t<c.length;t++){let n=c[t];e.empty(`mention`,{mentionpersonId:ec(n.personId),mentionId:ec(n.id),startIndex:n.startIndex??0,length:n.length??0})}e.end(`mentions`)}e.end(`threadedComment`)}function ec(e){return`{${e.replace(/^\{|\}$/g,``).toUpperCase()}}`}var tc={rowIndex:0,colIndex:0};function nc(e,t,n,r){if(r==null)return;tc.rowIndex=t,tc.colIndex=n;let i=S.cellToString(tc),a,o;switch(typeof r){case`number`:o=``+r;break;case`boolean`:a=`b`,o=r?`1`:`0`;break;case`string`:a=`str`,o=r;break;default:{let e=r;if(e.t!==`e`)return;a=`e`,o=v.getBuiltInByCode(e.v)?.getLabel()??v.BuiltIn.Value.getLabel()}}e.start(`cell`,a?{r:i,t:a}:{r:i}),e.start(`v`),e.text(o),e.end(`v`),e.end(`cell`)}var rc=[new class extends V{constructor(){super({kind:`workbook`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,path:`/xl/workbook.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`workbook`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15 xr xr6 xr10 xr2`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr6":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision6`,"xmlns:xr10":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision10`,"xmlns:xr2":`http://schemas.microsoft.com/office/spreadsheetml/2015/revision2`});let r=t.getSharedStates().get(An),i=await e.toJSON({ignoreData:!0,resources:(e,t)=>(r?.set(t,e),null)}),a=new ur;t.getSharedStates().set(lr,a);let o=function(e,t,n=new ur,r=()=>{}){let i=new Map,a=e.styles?.direct,o=new dr(a?.[0]),s=e.sheets??[],c=!1;for(let e=0;e<s.length;e++){let l=rt(s[e]),u=t[e];if(!l||!u)continue;let d=fr(l,u,n,r);d.length>0&&(c=!0),i.set(l,pr(l,u,a??[],o,d))}return(a||c)&&(e.styles={...e.styles,direct:o.list}),n.setXfComplements(o.complements),i}(i,e.getSheets({visibility:D.Visibility.VeryHidden}),a,(e,n)=>{t.warn(e,void 0,n)});t.getSharedStates().set(L,st(i.names,function(e){let t=[],n=e.sheets??[];for(let e=0;e<n.length;e++){let r=n[e],i=rt(r)?.tables;if(i)for(let e=0;e<i.length;e++){let n=i[e],r=Array.isArray(n)?n[1]?.name:n?.v?.name;r&&t.push(String(r))}}return t}(i),function(e,t){let n=t.externalBooks?.length??0,r=new Set;return{count:n,onDangling:t=>{r.has(t)||(r.add(t),e.log(`External link [${t}] is cited but this workbook has ${n===0?`none`:`only ${n}`}; each citation is written as #REF! so Excel can open the file.`))}}}(t,i))),function(e,t){let n=e.getSharedStates().get(Ia);n&&t.empty(`fileVersion`,n)}(t,n),function(e,t,n,r){let i={},a=n.getCodeName();a&&(i.codeName=a),n.getRuntime().isDate1904()&&(i.date1904=`1`),r.updateLinks&&(i.updateLinks=r.updateLinks),r.hiddenPivotFieldList&&(i.hidePivotFieldList=`1`),t.empty(`workbookPr`,i)}(0,n,e,i),function(e,t,n,r){let i=r.protection;if(!i||i.workbook)return;let a={};or(i.password??{},a,`workbook`),or(i.revisionsPassword??{},a,`revisions`);for(let e of ze){let t=me(e,i[e.key]);t!==null&&(a[e.attribute]=t)}t.empty(`workbookProtection`,a)}(0,n,0,i),function(e,t,n){t.start(`bookViews`);let r=n.getView(),i={},a=r.getVisibility();a!==ne.Visibility.Visible&&(i.visibility=a),r.isMinimized()&&(i.minimized=`1`),r.isShowHorizontalScrollbar()||(i.showHorizontalScroll=`0`),r.isShowVerticalScrollbar()||(i.showVerticalScroll=`0`),r.isShowTabs()||(i.showSheetTabs=`0`);let o=r.getWindowBounds();o&&(i.xWindow=``+Math.round(o.left),i.yWindow=``+Math.round(o.top),i.windowWidth=``+Math.round(o.width),i.windowHeight=``+Math.round(o.height));let s=r.getTabRatio();s!==600&&(i.tabRatio=s);let c=Math.min(r.getFirstTab(),n.getSheets({visibility:D.Visibility.VeryHidden}).length-1);c>0&&(i.firstSheet=``+c);let l=n.getSelectedSheet().getIndex();l!==0&&(i.activeTab=``+l),r.isAutoFilterDateGrouping()||(i.autoFilterDateGrouping=`0`),t.empty(`workbookView`,i),t.end(`bookViews`)}(0,n,e,i.view),t.getSharedStates().set(_i,vi(e.getStyles(),i.styles??{})),((e,t)=>{e.getSharedStates().set(ia,t)})(t,!0===i.date1904);let s=await(async(e,t,n=!1,r=new Set)=>{let i=[],a=t?t.length:0;if(a===0)return i;let o=new Map;e.getSharedStates().set(`pivotCachePaths`,o);let s=new Map;e.getSharedStates().set(Zi,s);let c=new Set;for(let e=0;e<a;e++){let n=$i.exec(t[e].part?.xml??t[e].rest??``);n&&c.add(n[1])}let l=1,u=()=>{for(;c.has(String(l));)l++;return c.add(String(l)),String(l)},d=na(e);for(let c=0;c<a;c++){let a=t[c],l=a.cacheId,f=a.part,p=f?f.xml?{...f,xml:Hi(ut(f.xml,a,d),a.source)}:f:Ui(a,n,d);if(p?.xml&&!o.has(l)){if(r.has(l)){let e=ea(p.xml,u);p={...p,xml:e.xml},s.set(l,e.id)}try{let t=await Ir({...p,type:p.type||`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,contentType:p.contentType||`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`},e,`/xl/pivotCache/pivotCacheDefinition{n}.xml`);if(!t?.relId)continue;o.set(l,t.path),i.push({cacheId:l,relId:t.relId})}catch(t){e.log(`Unable to write the pivot cache ${l}; the pivot tables on it will be dropped.`,t)}}}return i})(t,i.pivotCaches,!0===i.date1904,(e=>{let t=new Set,n=e.getWorksheets().getItems({visibility:D.Visibility.VeryHidden});for(let e=0;e<n.length;e++){let r=Aa(n[e]);for(let e=0;e<r.length;e++){let n=J(r[e]);n?.tabular&&n.cacheId!==void 0&&t.add(n.cacheId)}}return t})(e));(function(e,t){t.getComments().some(e=>!e.isNote())&&e.addPart(`persons`,t.getPeople())})(t,e),n.start(`sheets`);let c=t.getSharedStates(),l=e.getStrings().beginPersist();c.set(`persistStrings`,l);let u=new Mr;c.set(`metaCollector`,u);let d=new Nr(u,e,t.log.bind(t));c.set(`persistRichTypes`,d),c.set(sr,new cr(i.styles,e.getStyles()));let f={table:[],pivot:[],timeline:[],cacheNames:[]};try{let r=e.getSheets({visibility:D.Visibility.VeryHidden}),s=i.sheets,u=e.getSelectedSheet(),d=r.length,p=((e,t)=>{let n=Array(t),r=new Set,i=1;for(let a=0;a<t;a++){let t=e?.[a]?.sheetId;t===void 0||!Number.isInteger(t)||t<1||r.has(t)||(r.add(t),n[a]=t,t>=i&&(i=t+1))}for(let e=0;e<t;e++)if(n[e]===void 0){for(;r.has(i);)i++;r.add(i),n[e]=i++}return n})(s,d);c.set(`sheetIdsBySheet`,new Map(r.map((e,t)=>[e,p[t]])));let m=((e,t,n)=>{let r=t.length,i=Array(r),a=new Set(n?.values()??[]),o=new Set;for(let a=0;a<r;a++){if(dn(e?.[a]))continue;let r=e?.[a]?.sheetId;if(r===void 0||t[a]!==r)continue;let s=n?.get(r);s&&!o.has(s)&&(o.add(s),i[a]=s)}let s=1;for(let t=0;t<r;t++){if(i[t]||dn(e?.[t]))continue;let n;do n=`xl/worksheets/sheet${s++}.xml`;while(a.has(n)||o.has(n));o.add(n),i[t]=n}return i})(s,p,c.get(Ra)),h=Array(d).fill(null);for(let e=0;e<d;e++){let n=s[e];if(dn(n))continue;let i=r[e],a=rt(n),c=t.addPart(`worksheet`,{model:i,isSelected:u===i,json:(a&&o.get(a))??a,persistStrings:l},`/`+m[e]);h[e]=c.relId??null}let g=!0===c.get(za);for(let n=0;n<d;n++){let i=dn(s[n]);i&&(h[n]=Ba(t,e,s[n].kind,i,u===r[n],g))}for(let e=0;e<d;e++){let i=r[e];if(!h[e]){t.log(`The sheet '${i.getName()}' could not be written and is being dropped.`);continue}let a={name:i.getName(),sheetId:``+p[e]},o=i.getVisibility();o===`hidden`?a.state=`hidden`:o===`veryHidden`&&(a.state=`veryHidden`),a[`r:id`]=h[e],n.empty(`sheet`,a)}await t.waitEmit(),f=((e,t)=>{let n={table:[],pivot:[],timeline:[],cacheNames:[]},r=ga(e),i=t.getWorksheets().getItems({visibility:D.Visibility.VeryHidden});for(let t=0;t<i.length;t++){let a=Aa(i[t]);for(let t=0;t<a.length;t++){let i=a[t],o=J(i)!==null;if(!o&&!r.has(i.getTable())){e.log(`The slicer '${i.getName?.()??``}' names a table that was not written; its cache was dropped.`);continue}if(ka(i)){let t=e.addPart(`timelineCache`,i);t.relId&&n.timeline.push(t.relId);continue}let s=e.addPart(`slicerCache`,i);s.relId&&((o?n.pivot:n.table).push(s.relId),n.cacheNames.push(i.getCacheName()))}}return n})(t,e),await t.waitEmit();let _=e.getTheme();t.addPart(`theme`,{model:_,json:i.theme}),await t.waitEmit(),t.addPart(`styles`,{styles:e.getStyles(),theme:e.getTheme(),json:i.styles}),await t.waitEmit(),a.getControls().length>0&&(t.addPart(`featurePropertyBag`,a),await t.waitEmit());let v=await l.toJSONAsync();v&&v.length>0&&(t.addPart(`sharedStrings`,{model:v,json:v,theme:e.getTheme()}),await t.waitEmit());let y=c.get(`persistRichTypes`);y?.hasAny()&&(t.addPart(`richValue`,y),t.addPart(`richValueStructure`,y),t.addPart(`richValueTypes`,y),y.addParts(t),await t.waitEmit());let b=c.get(`metaCollector`);b?.hasAny()&&(t.addPart(`metadata`,b),await t.waitEmit()),c.delete(`persistRichTypes`),c.delete(`metaCollector`),c.delete(`persistStrings`)}catch(e){throw e}finally{l.endPersist()}n.end(`sheets`),function(e,t,n){let r=n.externalBooks,i=r?r.length:0;if(i===0)return;let a=e.getSharedStates().get(Va),o=new Set;if(a)for(let e=0;e<i;e++)!r[e]&&a[e]&&o.add(a[e]);let s=[],c=1;for(let t=0;t<i;t++){let n=r[t];if(n){let t;do t=`xl/externalLinks/externalLink${c++}.xml`;while(o.has(t));s.push(e.addPart(`externalLink`,n,`/`+t).relId);continue}let i=a?.[t],l=i?e.addRelationship(Fa,i):null;l?s.push(l):e.log(`External link [${t+1}] cannot be written and is being dropped; later links will renumber.`)}if(s.length!==0){t.start(`externalReferences`);for(let e=0;e<s.length;e++)t.empty(`externalReference`,{"r:id":s[e]});t.end(`externalReferences`)}}(t,n,i),function(e,t,n,r,i){let a=e.getSharedStates().get(L),o=r.names,s=o?o.length:0,c=new Set((o??[]).filter(e=>!e.scope).map(e=>e.name.toLowerCase())),l=i.filter(e=>!c.has(e.toLowerCase()));if(s===0&&l.length===0)return;let u=new Map,d=n.getSheets({visibility:D.Visibility.VeryHidden});for(let e=0;e<d.length;e++)u.set(d[e].getName().toLowerCase(),e);t.start(`definedNames`);for(let n=0;n<s;n++){let r=o[n],i={name:r.name};r.comment&&(i.comment=r.comment);let s=r.fileAttributes;if(s)for(let e of gn)e!==`shortcutKey`&&s[e]&&(i[e]=s[e]);if(r.scope){let t=u.get(r.scope.toLowerCase());t===void 0?e.log(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`):i.localSheetId=``+t}if(r.hidden&&(i.hidden=`1`),s)for(let e of _n)s[e]&&(i[e]=`1`),e===`xlm`&&(s.functionGroupId!==void 0&&(i.functionGroupId=``+s.functionGroupId),s.shortcutKey&&(i.shortcutKey=s.shortcutKey));let c=a.writeName(r.ref);t.start(`definedName`,i),t.text(c),t.end(`definedName`)}for(let e of l)t.start(`definedName`,{name:e}),t.text(`#N/A`),t.end(`definedName`);t.end(`definedNames`)}(t,n,e,i,f.cacheNames),function(e,t,n){let r=n.getCalculation().toJSON(),i={calcId:e.getSharedStates().get(`calcId`)??`191029`},a=(e,t)=>{let n=r[e];typeof n==`boolean`&&(i[t]=n?`1`:`0`)};if(r.calcMode){let e=Ha[r.calcMode];e&&e!==`auto`&&(i.calcMode=e)}a(`fullCalcOnLoad`,`fullCalcOnLoad`),a(`calcOnSave`,`calcOnSave`),a(`calcCompleted`,`calcCompleted`),a(`fullPrecision`,`fullPrecision`),a(`forceFullCalc`,`forceFullCalc`),a(`concurrentCalc`,`concurrentCalc`),r.concurrentManualCount!==void 0&&(i.concurrentManualCount=String(r.concurrentManualCount)),r.refMode&&(i.refMode=r.refMode),r.iterate&&(i.iterate=`1`),r.maxIteration!==void 0&&(i.iterateCount=String(r.maxIteration)),r.maxIterateChange!==void 0&&(i.iterateDelta=String(r.maxIterateChange)),t.empty(`calcPr`,i)}(t,n,e),function(e,t){if(t.length!==0){e.start(`pivotCaches`);for(let n=0;n<t.length;n++)e.empty(`pivotCache`,{cacheId:t[n].cacheId,"r:id":t[n].relId});e.end(`pivotCaches`)}}(n,s),function(e,t,n){let r=e.getSharedStates().get(`workbookExts`)??[],i=je(St),a=new Map([[je(ie),()=>((e,t)=>{if(t.length!==0){e.start(`ext`,{uri:ie,"xmlns:x14":R}),e.start(`x14:slicerCaches`);for(let n=0;n<t.length;n++)e.empty(`x14:slicerCache`,{"r:id":t[n]});e.end(`x14:slicerCaches`),e.end(`ext`)}})(t,n.pivot)],[je(Jt),()=>((e,t)=>{if(t.length!==0){e.start(`ext`,{uri:Jt,"xmlns:x15":et}),e.start(`x15:slicerCaches`,{"xmlns:x14":R});for(let n=0;n<t.length;n++)e.empty(`x14:slicerCache`,{"r:id":t[n]});e.end(`x15:slicerCaches`),e.end(`ext`)}})(t,n.table)],[je(Ye),()=>((e,t)=>{if(t.length!==0){e.start(`ext`,{uri:Ye,"xmlns:x15":et}),e.start(`x15:timelineCacheRefs`);for(let n=0;n<t.length;n++)e.empty(`x15:timelineCacheRef`,{"r:id":t[n]});e.end(`x15:timelineCacheRefs`),e.end(`ext`)}})(t,n.timeline)]]),o=new Set,s=e=>{o.has(e)||(o.add(e),a.get(e)())};t.start(`extLst`);for(let e of a.keys())r.some(t=>je(t.uri)===e)||s(e);let c=!1;for(let n of r){let r=je(n.uri);if(a.has(r))s(r);else if(r===i)c||t.raw(n.xml),c=!0;else{let r=La(e,n);r===null?e.warn(`Workbook extension ${n.uri} was not written: a part it cites is not carried by this save.`,void 0,`xlsx.workbook.extNotCarried`):t.raw(r)}}c||t.raw(`<ext uri="{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}" xmlns:xcalcf="http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures"><xcalcf:calcFeatures><xcalcf:feature name="microsoft.com:RD"/><xcalcf:feature name="microsoft.com:Single"/><xcalcf:feature name="microsoft.com:FV"/><xcalcf:feature name="microsoft.com:CNMTM"/><xcalcf:feature name="microsoft.com:LET_WF"/><xcalcf:feature name="microsoft.com:LAMBDA_WF"/><xcalcf:feature name="microsoft.com:ARRAYTEXT_WF"/></xcalcf:calcFeatures></ext>`),t.end(`extLst`)}(t,n,f),n.end(`workbook`),n.close()}},new class extends V{constructor(){super({kind:`worksheet`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,path:()=>`/xl/worksheets/sheet{n}.xml`})}async emit(e,t){let r=t.getXMLWriter(),a=e.model,s=e.json,c=ht(a,s);Io(s,c),r.decl(),r.start(`worksheet`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`}),function(e,t,n,r){let i=n.getTabColor(),a=n.getCodeName(),o={},s=n.getSyncScroll();s?.horizontal&&(o.syncHorizontal=`1`),s?.vertical&&(o.syncVertical=`1`),s?.anchor&&(o.syncRef=s.anchor),n.isTransitionFormulaEvaluation()&&(o.transitionEvaluation=`1`),n.isTransitionFormulaEntry()&&(o.transitionEntry=`1`),n.isExcludedFromPublishing()&&(o.published=`0`),a&&(o.codeName=a);let c=r.autoTable;(c?Array.isArray(c)?c[1]:c.v:void 0)?.filter?.conditions?.some(e=>!!e)&&(o.filterMode=`1`),n.isConditionalFormatCalculationEnabled()||(o.enableFormatConditionsCalculation=`0`);let l=n.getOutline(),u={};l.getSummaryDirection(_.Axis.Row)===_.Direction.Up&&(u.summaryBelow=`0`),l.getSummaryDirection(_.Axis.Column)===_.Direction.Left&&(u.summaryRight=`0`),n.getView().isShowOutlineSymbols()||(u.showOutlineSymbols=`0`),l.isAutomaticStyles()&&(u.applyStyles=`1`);let d=Object.keys(u).length>0,f=r.pageLayout,p={};f?.hideAutoPageBreaks&&(p.autoPageBreaks=`0`),f?.fitToPage&&(p.fitToPage=`1`);let m=Object.keys(p).length>0,h=!!i||d||m;if(h||Object.keys(o).length!==0){if(!h)return void t.empty(`sheetPr`,o);t.start(`sheetPr`,o),i&&W(t,n.getStyles().getTheme(),i,`tabColor`,!1),d&&t.empty(`outlinePr`,u),m&&t.empty(`pageSetUpPr`,p),t.end(`sheetPr`)}}(0,r,a,s),function(e,t,n,r){let a=n.getUsedRange({features:[]}),o=a?a.getCoords():null,s=_e,c=Je,l=r.directStyles,u=l?l.length:0;for(let e=0;e<u;e++){let t=n.getRange(l[e][0]).getCoords();if(t.colEnd===c){let e=o?.colStart??0;t={...t,colStart:e,colEnd:e}}if(t.rowEnd===s){let e=o?.rowStart??0;t={...t,rowStart:e,rowEnd:e}}o=i.unionRanges(o,t)}let d=r.merges,f=d?d.length:0;for(let e=0;e<f;e++){let t=n.getRange(d[e]).getCoords();t.colEnd===c&&(t={...o},t.colStart=o?.colStart??0,t.colEnd=t.colStart),t.rowEnd===s&&(t={...t},t.rowStart=o?.rowStart??0,t.rowEnd=t.rowStart),o=i.unionRanges(o,t)}let p=`A1`;o&&(a=n.getRange(o),p=o.colStart===o.colEnd&&o.rowStart===o.rowEnd?a.getAddress():`${a.getIntersect({colStart:o.colStart,rowStart:o.rowStart,colEnd:o.colStart,rowEnd:o.rowStart}).getAddress()}:${a.getIntersect({colStart:o.colEnd,rowStart:o.rowEnd,colEnd:o.colEnd,rowEnd:o.rowEnd}).getAddress()}`),t.empty(`dimension`,{ref:p})}(0,r,a,s),function(e,t,n,r,i){let a=n.getView(),o=a.getTopLeft(),s=n.getRowHeaders().getMetrics().getIndex(o.top),c=n.getColumnHeaders().getMetrics().getIndex(o.left),l=S.cellToString({colIndex:c,rowIndex:s});t.start(`sheetViews`);let u={};a.isShowFormulas()&&(u.showFormulas=`1`),a.isShowColumnGridlines()||a.isShowRowGridlines()||(u.showGridLines=`0`),a.isShowColumnHeaders()||a.isShowRowHeaders()||(u.showRowColHeaders=`0`),a.isShowZeros()||(u.showZeros=`0`),a.isRightToLeft()&&(u.rightToLeft=`1`),a.isShowOutlineSymbols()||(u.showOutlineSymbols=`0`),i&&(u.tabSelected=`1`),l!==`A1`&&(u.topLeftCell=l),a.isShowRuler()||(u.showRuler=`0`),a.isShowWhitespace()||(u.showWhiteSpace=`0`);let d=a.getViewMode();d!==k.ViewMode.Normal&&(u.view=d);let f=a.getZoomScale();f!==100&&(u.zoomScale=f);let p=a.toJSON(),m=p?.zoomScales??{};for(let[e,t]of F){let n=m[e];n&&(u[t]=n)}p?.windowProtection&&(u.windowProtection=`1`);let h=a.getGridLineColor();if(h){u.defaultGridColor=`0`;let e=h.toRGBA(),t=e.red,r=e.green,i=e.blue,a=n.getStyles().getIndexedColors(),o=a.length,s=0,c=Number.MAX_VALUE;for(let e=0;e<o;e++){let n=a[e].toRGBA(),o=(t-n.red)**2+(r-n.green)**2+(i-n.blue)**2;o<c&&(c=o,s=e)}u.colorId=``+s}u.workbookViewId=`0`;let g=n.getSelection().getCoords(),_=S.cellToString(g.cell),v={},y=a.getFreezePanes(),b=y.coords??{},x=b.colIndex??0,C=b.rowIndex??0;if(x>0||C>0){let e=y.topLeft??{},r=e.top??0,i=e.left??0,a=n.getRowHeaders().getMetrics().getIndex(r),s=n.getColumnHeaders().getMetrics().getIndex(i),c=x-s,l=C-a,d=Math.max(x,n.getColumnHeaders().getMetrics().getIndex(o.left+n.getColumnHeaders().getMetrics().getOffset(x)-i)),f=Math.max(C,n.getRowHeaders().getMetrics().getIndex(o.top+n.getRowHeaders().getMetrics().getOffset(C)-r)),p=S.cellToString({colIndex:s,rowIndex:a});p===`A1`?delete u.topLeftCell:u.topLeftCell=p,t.start(`sheetView`,u);let m={};c>0&&(m.xSplit=c),l>0&&(m.ySplit=l),m.topLeftCell=S.cellToString({colIndex:d,rowIndex:f}),m.state=`frozen`;let h=y.paneSelections,g=(e,n,r)=>{let i=h?.[e];if(!i&&!r&&n===`A1`)return;let a=i?.activeCell??n;t.empty(`selection`,{...e===`topLeft`?{}:{pane:e},activeCell:a,sqref:i?.sqref??a})};x===0?(m.activePane=`bottomLeft`,t.empty(`pane`,m),g(`topLeft`,S.cellToString({colIndex:d,rowIndex:a}),!1),v.pane=`bottomLeft`):C===0?(m.activePane=`topRight`,t.empty(`pane`,m),g(`topLeft`,S.cellToString({colIndex:s,rowIndex:f}),!1),v.pane=`topRight`):(m.activePane=`bottomRight`,t.empty(`pane`,m),g(`topLeft`,p,!1),g(`topRight`,S.cellToString({colIndex:d,rowIndex:a}),!0),g(`bottomLeft`,S.cellToString({colIndex:s,rowIndex:f}),!0),v.pane=`bottomRight`)}else t.start(`sheetView`,u);v.activeCell=_;let w=g.ranges,T=w?w.length:0;if(T>0){let e=``;for(let t=0;t<T;t++){let n=w[t];t>0&&(e+=` `),e+=S.rangeToString(n)}v.sqref=e,(g.rangeIndex??0)>0&&(v.activeCellId=``+g.rangeIndex)}else _===`A1`?v=null:v.sqref=_;v&&t.empty(`selection`,v),t.end(`sheetView`),t.end(`sheetViews`)}(0,r,a,0,e.isSelected);let l=((e,t,n)=>{let r=(e,n)=>{let r=!!n?.value?.tt,i=!!n?.value?.tb,a=t+.75*(+!!r+ +!!i);return{height:e,custom:Math.abs(e-a)>=.01,thickTop:r,thickBottom:i,run:n}},i=e.defaultRowSize??t,a=e.rows?S.refsToRuns(e.rows,!1):null,o=null,s=0,c=a?a.length:0;for(let e=0;e<c;e++){let t=a[e];s+=t.max-t.min+1,oo(t.value)&&(!o||t.max-t.min>o.max-o.min)&&(o=t)}return o&&o.max-o.min+1>n-s?r(o.value.sz??i,o):e.defaultRowSize===void 0?null:r(e.defaultRowSize,null)})(s,.75*a.getStyles().getNormal().getBestFit().height,a.getEntireRange().getRowEnd()+1);(function(e,t,n,r,i){let a=r.defaultColSize,o=r.defaultRowSize,s={};r.baseColSize!==void 0&&(s.baseColWidth=r.baseColSize),a!==void 0&&(s.defaultColWidth=a),i?(s.defaultRowHeight=i.height,i.custom&&(s.customHeight=`1`)):(s.defaultRowHeight=o??.75*n.getRowHeaders().getMetrics().getDefaultSize(),o!==void 0&&(s.customHeight=`1`)),r.rows&&fo(S.refsToRuns(r.rows,!1))!==null&&(s.zeroHeight=`1`),i?.thickTop&&(s.thickTop=`1`),i?.thickBottom&&(s.thickBottom=`1`);let c=n.getOutline(),l=c.getLevelCount(_.Axis.Row);l>0&&(s.outlineLevelRow=l);let u=c.getLevelCount(_.Axis.Column);u>0&&(s.outlineLevelCol=u),s[`x14ac:dyDescent`]=`0.25`,t.empty(`sheetFormatPr`,s)})(0,r,a,s,l);let u=!1===s.protection?.showFormulas?t.getSharedStates().get(`xfVariants`)??null:null;(function(e,t,n,r,i){let a=r.cols?S.refsToRuns(r.cols,!0):null,o=a?a.length:0;n.getEntireRange().getColumnEnd();let s=n.getColumnHeaders().getDefaultSizeNative(),c=i?i.getXf(0,!0,!1):0,l=1,u=e=>{c!==0&&e>=l&&t.empty(`col`,{min:l,max:e,width:s,style:c})};if(o>0||c!==0){let e=uo(n.getOutline(),_.Axis.Column);t.start(`cols`);for(let n=0;n<o;n++){let r=a[n],o=r.min+1,c=Je+1;if(o>c)continue;let d=Math.min(r.max+1,c);u(o-1),l=d+1;let f={min:o,max:d},p=r.value,m=p.sz;m===void 0?f.width=s:m!==0&&(f.width=Math.round(256*m)/256);let h=i?i.getXf(p.s??0,!0,!1):p.s;h&&(f.style=h),p.h!==void 0&&(f.hidden=1),p.bf&&(f.bestFit=1),p.csz&&(f.customWidth=1),p.l&&(f.outlineLevel=p.l),(r.min===r.max?e.has(r.min):p.cl)&&(f.collapsed=1),t.empty(`col`,f)}u(Je+1),t.end(`cols`)}})(0,r,a,s,u),function(e,t,n,r,a,s,c){let l=e.getSharedStates(),u=l.get(`persistStrings`),d=l.get(`metaCollector`),f=l.get(`persistRichTypes`),p=l.get(sr),m=function(e){let t=null;for(let n of e.pivotTables??[]){let e=n.buttons?.length?cn(n):null;if(e)for(let r of n.buttons){let n=S.fastStringToRange(r);for(let r=n.rowStart;r<=n.rowEnd;r++)for(let i=n.colStart;i<=n.colEnd;i++)(t??=new Set).add((e.rowStart+r)*Fo+e.colStart+i)}}return t}(r),h=function(e){let t=null;for(let n of e.getPivotTables().getItems()){let e=n.toJSON(),r=e?.header?cn(e):n.getRange()?.getCoords();r&&(t??=[]).push({table:n,coords:r,formats:e?.header?j(e):null})}return t}(n),g=0,y=0,x=n.getUsedRange(),C=0,w=c?.run,E=r.rows?S.refsToRuns(r.rows,!1):null,D=r.defaultRowSize??.75*n.getStyles().getNormal().getBestFit().height,O=E&&w?((e,t,n,r)=>{let i=[],a=0,o=(e,t)=>{e<=t&&i.push({min:e,max:t,value:{sz:n}})};for(let n=0;n<e.length;n++){let r=e[n];o(a,r.min-1),a=r.max+1,r.min===t.min&&r.max===t.max||i.push(r)}return o(a,r-1),i})(E,w,D,n.getEntireRange().getRowEnd()+1):E,k=O?O.length:0,M=fo(O),te=M===null?O?.[k-1]?.max??-1:M-1,ne=r.cols?S.refsToRuns(r.cols,!0):null,N=ne?ne.length:0,re=ne?.[N-1]?.max??-1;if(x||k>0){let l=.75,x=r.defaultRowSize??n.getRowHeaders().getMetrics().getDefaultSize()*l,w=n.getStyles().getNormal().getBestFit().height*l,E=uo(n.getOutline(),_.Axis.Row),D=(e,t)=>{let n=Bo;if(n.r=``+(e+1),n.s=void 0,n.customFormat=void 0,n.hidden=void 0,n.ht=void 0,n.customHeight=void 0,n.outlineLevel=void 0,n.collapsed=void 0,n.thickTop=void 0,n.thickBot=void 0,!t)return n;let r=t.value;r.s!==void 0&&(n.s=``+(s?s.getXf(r.s,!0,!1):r.s),n.customFormat=`1`),r.h&&(n.hidden=`1`);let i=r.csz??!1,a=r.sz??x;return(a!==(c?.height??w)||i)&&(n.ht=``+a),i&&(n.customHeight=`1`),r.l&&(n.outlineLevel=``+r.l),E.has(e)&&(n.collapsed=`1`),r.tt&&(n.thickTop=`1`),r.tb&&(n.thickBot=`1`),n},k=0,j=O?.[k]??null,N=j?.min??2**53-1,ie=j?.max??2**53-1,ae=j?.value?.s,P=-1,oe=0,F=ne?.[oe]??null,se=F?.min??2**53-1,ce=F?.max??2**53-1,le=F?.value?.s,ue=(e,n=!1)=>{if(P!==e){for(P!==-1&&(t.end(`row`),oe!==0&&(oe=0,F=ne?.[oe]??null,se=F?.min??2**53-1,ce=F?.max??2**53-1,le=F?.value?.s));P+1<=e;){P++,j&&P>ie&&(j=O[++k]??null,j?(N=j.min,ie=j.max,ae=j.value?.s):(N=2**53-1,ie=2**53-1,ae=void 0)),P<N&&P<e&&M===null&&(P=j?Math.min(N,e):e),M!==null&&P>=M&&P<e&&(P=e);let r=P<e||n&&P===e,i=D(P,j&&P>=N&&P<=ie?j:null);r?t.empty(`row`,i):t.start(`row`,i)}if(e<P){let n=D(e,null);t.start(`row`,n)}}};t.setValidationDisabled(!0),t.start(`sheetData`);let I=[];I.push(mo(e,n,r.directStyles));let de=r.formulas,L=de?de.length:0,fe=[];if(L>0){let t=new Map;if(a.names.size>0&&r.formulaArray)for(let e of r.formulaArray)try{let r=n.getRange(e[0]).getCoords();t.set(`${r.rowStart},${r.colStart}`,r)}catch{}let o=[];if(r.formulaArray)for(let e of r.formulaArray)try{o.push(n.getRange(e[0]).getCoords())}catch{}let s=e=>{for(let t=0;t<o.length;t++){let n=o[t];if(n.rowStart<=e.rowEnd&&n.rowEnd>=e.rowStart&&n.colStart<=e.colEnd&&n.colEnd>=e.colStart)return!0}return!1},c=e.getSharedStates().get(`xlsxFormulaDialect`)??st(n.getCalculation().getNamedFormulas().toJSON(),n.getTables().getItems().map(e=>e.getName()),{count:n.getWorkbook()?.getExternalBooks().toJSON()?.length??0}),l=n.getEntireRange().getCoords(),u=[];for(let e of n.getTables().getItems())u.push([e.getRange().getCoords(),e.getName()]);let d=(e,t)=>{for(let n=0;n<u.length;n++){let r=u[n][0];if(e>=r.rowStart&&e<=r.rowEnd&&t>=r.colStart&&t<=r.colEnd)return u[n][1]}return null},f=new Set;for(let e=0;e<o.length;e++)f.add(`${o[e].rowStart},${o[e].colStart}`);let p=[];for(let r=0;r<L;r++){let o=de[r];try{let e=o[0],u=n.getRange(e),m=u.getCoords(),h=o[1];if(ho.test(h)&&go(n,m,h,fe))continue;let g=null,_={rowIndex:m.rowStart,colIndex:m.colStart},v=c.parse(h,_),y=v?c.annotate(v):void 0,b=v?c.spell(v,f.has(`${m.rowStart},${m.colStart}`),d(m.rowStart,m.colStart)):null,x=b?A.imager(b,{entireCoords:l}):null;if(x)h=x(_);else if(!i.isSingleCell(m)){let e=[];S.normalizeA1ToR1C1(h,_.rowIndex,_.colIndex,e),x=t=>{let n=t??_;return S.resolveRelativeToA1(e,n.rowIndex,n.colIndex)}}let w=!0===y?.cm,T=!0===y?.ca;if(a.affects(r)){g=null,w=!1;let e=(e,t,n)=>{let r={rowStart:e,colStart:t,rowEnd:e,colEnd:t};p.push([r,{coords:r,formula:n,sharedId:null,ref:S.rangeToString(r),isDynamicRange:!1,isWrapped:!0}])},r=t.get(`${m.rowStart},${m.colStart}`),i=r!==void 0&&(r.rowEnd>r.rowStart||r.colEnd>r.colStart),a=!1;if(i){let t=Yt(h,u.getCell().getValue());if(t!==null)for(let i=r.rowStart;i<=r.rowEnd;i++)for(let o=r.colStart;o<=r.colEnd;o++){if(i===r.rowStart&&o===r.colStart){e(i,o,t),a=!0;continue}let s=n.getRange(S.rangeToString({rowStart:i,colStart:o,rowEnd:i,colEnd:o})),c=De(s.getCell().getValue());c!==null&&e(i,o,c)}}else u.forEach((t,n)=>{let r=n.getCoords(),i=x?.(r)??h,o=Yt(i,n.getCell().getValue());o!==null&&(e(r.rowIndex,r.colIndex,o),a=!0)},{includeEmpty:!0});if(a)continue}let E=h.indexOf(`!`)!==-1||h.indexOf(`[`)!==-1;w||u.isSingleCell()||E||s(m)||(g=``+C++);let D=g!==null||u.isSingleCell()?null:x,O=[m,{coords:m,formula:h,sharedId:g,ref:e,isDynamicRange:w,isExcelVolatile:T,memberImage:D}];p.push(O)}catch(t){e.log(`Could not write the formula '${o[1]}' over '${o[0]}'; those cells are written as values only. ${t}`);continue}}I.push(p)}else I.push([]);let pe=r.volatile,me=pe?pe.length:0;if(me>0){let e=Array(me);for(let t=0;t<me;t++){let r=pe[t];try{let i=n.getRange(r).getCoords();e[t]=[i,!0]}catch(e){console.warn(`Failed to parse volatile: ${r}`,e);continue}}I.push(e)}else I.push([]);let he=r.formulaArray,ge=he?he.length:0;if(ge>0){let e=Array(ge);for(let t=0;t<ge;t++){let r=he[t];try{let i=r[0],a=n.getRange(i).getCoords();e[t]=[a,{ref:i,kind:r[1]??`dynamic`}]}catch(e){console.warn(`Failed to parse formula array: ${r}`,e);continue}}I.push(e)}else I.push([]);let _e=new Map;I.push(fe),I.push(h?.flatMap(({coords:e,formats:t})=>t?.empty?[[e,!0]]:[])??[]);let ve=e.getSharedStates().get(Ia)?.lastEdited,ye=ve===`3`||ve===`4`?lo:co;n.getEntireRange().forEach((n,r)=>{let i=r.getCoords(),a=i.rowIndex,c=i.colIndex;P!==a&&ue(a);let l=r.getInjectedReference(0);if(l===void 0&&ae!==void 0&&a>=N&&a<=ie&&(l=ae),l===void 0){for(;c<=re&&c>ce;)oe++,F=ne?.[oe]??null,se=F?.min??2**53-1,ce=F?.max??2**53-1,le=F?.value?.s;le!==void 0&&c>=se&&c<=ce&&(l=le)}let _=r.getType(),x=null;L>0&&(x=r.getInjectedReference(1)??null);let S=!1;me>0&&(S=r.getInjectedReference(2)??!1);let C=null;ge>0&&(C=r.getInjectedReference(3)??null);let w=C?.kind===`error`,E=C?.kind===`fixed`,D=zo;D.r=r.getAddress(),D.s=void 0,D.t=void 0,D.cm=void 0,D.vm=void 0;let O=m!==null&&m.has(a*Fo+c),k=h===null?null:function(e,t,n){for(let{table:r,coords:i,formats:a}of e){if(t<i.rowStart||t>i.rowEnd||n<i.colStart||n>i.colEnd)continue;let e=r.getStyleAt(t,n),o=e.getAlignment(),s=o.getHorizontal()===`left`?o.getIndent():null,c=e.getNumberFormat(),l=c&&c!==`General`?c:null,u=a?.formatAt(t-i.rowStart,n-i.colStart).user??null;return s===null&&l===null&&u===null?null:{labelIndent:s,numberFormat:l,user:u}}return null}(h,a,c);(s||O||k!==null)&&(l=p.getXf(l??0,s!==null,O,k?.labelIndent??null,k?.numberFormat??null,k?.user??null)),l!==void 0&&l!==0&&(D.s=``+l);let A=fe.length>0?r.getInjectedReference(4)??null:null,j=null,M=null;switch(_){case b.Boolean:j=n?`1`:`0`,M=`b`;break;case b.Error:let e=n.getCode();if(M=`e`,e>7)j=v.BuiltIn.Value.getLabel(),D.vm=``+f.add(n);else if(e<1){let e;M=`s`,x?(e=`=`+x.formula,x=null):e=``+n.getLabel(),j=``+u.add(e),g++}else j=``+n.getLabel();break;case b.Number:j=ye(n),M=null;break;case b.String:j=n,x||A?(M=`str`,j=n):(M=`s`,j=``+u.add(j),g++);break;case b.RichData:if(n instanceof ee){x||A?(M=`str`,j=n.getText()):(M=`s`,j=``+u.add(function(e,t,n){let r=e.getRuns(),i=t.getCell().getRichText();if(!i)return e.getText();let a=Array(r.length);for(let e=0;e<r.length;e++){if(!r[e].font){a[e]={text:r[e].text};continue}let t={...i.runs[e].font};t.weight!==void 0&&t.weight<700&&delete t.weight,t.style===o.Style.Normal&&delete t.style,t.underline===o.UnderlineStyle.None&&delete t.underline,t.strike===o.StrikeStyle.None&&delete t.strike,t.baseline===0&&delete t.baseline,a[e]={text:r[e].text,font:t}}let s=JSON.stringify(a),c=n.get(s);return c===void 0&&(c=new ee(a),n.set(s,c)),c}(n,r,_e)),g++);break}if(n instanceof T){let e=n.toPrimitive();typeof e==`number`?j=ye(e):typeof e==`boolean`?(M=`b`,j=e?`1`:`0`):x||A?(M=`str`,j=e):(M=`s`,j=``+u.add(e),g++);break}M=`e`,j=v.BuiltIn.Value.getLabel(),D.vm=``+f.add(n,x?.formula??(A?``:null))}M&&(D.t=M);let te=!x?.isWrapped&&(C!==null||(x?.isDynamicRange??!1));if(x!==null||j!==null||A!==null){if(te&&x!==null&&!E&&(D.cm=``+d.registerArrayCell(w)),t.start(`c`,D),x){let e=a===x.coords.rowStart&&c===x.coords.colStart,n=x.formula;x.memberImage&&!e&&(n=x.memberImage({rowIndex:a,colIndex:c}));let r,i=null,o=x.sharedId;if(o){r=Ho;let e=x.coords;e.colStart===c&&e.rowStart===a?(r.ref=x.ref,r.si=o,i=x.formula):(r.ref=void 0,r.si=o)}else te?(r=Uo,r.aca=w?`1`:void 0,r.ref=w?D.r:C?.ref??D.r,i=n):(r=Vo,i=n);r.ca=S||w||x.isExcelVolatile?`1`:void 0,i?(t.start(`f`,r),t.text(i),t.end(`f`)):t.empty(`f`,r)}else A&&t.empty(`f`,S?{...A,ca:`1`}:A);j!==null&&(M===`str`&&j?(t.start(`v`,Re.test(j)?Nt:void 0),t.text(sn(j))):(t.start(`v`),j&&t.text(j)),t.end(`v`)),t.end(`c`)}else y++<po?t.empty(`c`,D):y===1048577&&e.warn(`Reached ${po} style-only cells at '${D.r}'; not writing the rest.`)},{injectReferences:I,features:[]}),P!==-1&&P>=te?t.end(`row`):ue(te,!0),t.end(`sheetData`),t.setValidationDisabled(!1)}else t.empty(`sheetData`);if(g>0){let e=l.get(`stringsCount`)??0;l.set(`stringsCount`,e+g)}}(t,r,a,s,await(async(e,t)=>{let n=t?t.length:0;if(n===0)return so;let r=new Set,i=Array(n);for(let e=0;e<n;e++){i[e]=null;try{let n=A.parse(t[e][1]);if(!n)continue;let a=null,o=e=>{let t=null;e.type===`function`?t=String(e.value):e.type===`call`&&e.inputs?.[0]?.type===`named`&&(t=String(e.inputs[0].value?.name??``)),t&&(t=t.toUpperCase(),r.add(t),(a??=new Set).add(t));let n=e.inputs;if(n)for(let e=0;e<n.length;e++)n[e]&&o(n[e])};o(n),i[e]=a}catch{}}let a=e.getWorkbook();if(!a)return so;let o=await ue(a,r);return o.size===0?so:{names:o,perFormula:i,affects:e=>{let t=i[e];if(!t)return!1;for(let e of t)if(o.has(e))return!0;return!1}}})(a,s.formulas),u,l),function(e,t,n,r){let i=r.protection;if(!i)return;let a={};i.sheet||or(i.password??{},a);for(let e of ft){let t=me(e,i[e.key]);t!==null&&(a[e.attribute]=t)}t.empty(`sheetProtection`,a)}(0,r,0,s),function(e,t,n,r){let i=r.protectedRanges,a=i?i.length:0;if(a===0)return;let o=[];for(let t=0;t<a;t++){let n=i[t],r,a;Array.isArray(n)?(r=n[0],a=n[1]):(r=n.r,a=n.v);let s=Co(r);if(!s||!a){e.log(`Skipping protectedRange with no range.`);continue}if(!a.name){e.log(`Skipping protectedRange with no name.`);continue}let c={};or(a.password??{},c),c.sqref=s,c.name=a.name,a.securityDescriptor&&(c.securityDescriptor=a.securityDescriptor),o.push(c)}if(o.length!==0){t.start(`protectedRanges`);for(let e=0;e<o.length;e++)t.empty(`protectedRange`,o[e]);t.end(`protectedRanges`)}}(t,r,0,s);let d=s.autoTable;if(d){let e,n=d;e=Array.isArray(n)?n[1]:n.v,la(t,r,a.getAutoTable(),e,!0)}(function(e,t,n,r){let i=r.merges?r.merges.length:0;if(i>0){t.start(`mergeCells`,{count:i});for(let e=0;e<i;e++){let n=r.merges[e],i=typeof n==`string`?n:S.rangeToString(n);t.empty(`mergeCell`,{ref:i})}t.end(`mergeCells`)}})(0,r,0,s);let f=new Map,p=function(e,t,r,i,a){let o=[],s=i.conditionals,c=s?s.length:0;if(c===0)return o;let l=e.getSharedStates(),u=gi(l),d=r.getStyles().getTheme(),f=l.get(L),p=null,m=0,h=e=>{typeof e.pivotKey!=`number`||a.has(e.pivotKey)||a.set(e.pivotKey,m)};for(let r=0;r<c;r++){let i=s[r],a,c;Array.isArray(i)?(a=i[0],c=i[1]):(a=i.r,c=i.v);let l=Co(a);if(!l||!c){e.log(`Skipping conditionalFormatting with no range.`);continue}let g=Eo(l),_=Oo(c.scale,g,f);_!==c.scale&&(c={...c,scale:_});let v=_?{type:_.type}:se(c.condition,So(l),(t,n)=>e.warn(t,void 0,n));v?(v.formulas&&=v.formulas.map(e=>Do(e,g,f)),_?.type===O.ScaleType.IconSet&&bo(_)?(m++,h(c),o.push({guid:z(n.uuidV4),sqref:l,priority:m,scale:_})):_||!To(v)?(l!==p&&(p!==null&&t.end(`conditionalFormatting`),t.start(`conditionalFormatting`,{sqref:l,pivot:typeof c.pivotKey==`number`?`1`:void 0}),p=l),m++,h(c),xo(e,t,d,c,v,l,m,u,o)):(m++,h(c),o.push({guid:z(n.uuidV4),sqref:l,priority:m,rule:v,style:c.style,stopIfTrue:c.stopIfTrue}))):c.condition||e.log(`Skipping conditional format with neither a condition nor a scale.`)}return p!==null&&t.end(`conditionalFormatting`),o}(t,r,a,s,f),m=function(e,t,n,r){let i=[],a=e.getSharedStates().get(L),o=r.validations,s=o?o.length:0;if(s===0)return i;let c=[];for(let t=0;t<s;t++){let n=o[t],r,s;Array.isArray(n)?(r=n[0],s=n[1]):(r=n.r,s=n.v);let l=Co(r);if(!l||!s){e.log(`Skipping dataValidation with no range.`);continue}s.ext&&e.warn(`DataValidation extension payload is not written to xlsx; it will be lost.`);let u=(t,n)=>e.warn(t,void 0,n),d=Ne(s.condition,u),{type:f,operator:p}=d??{},m=Eo(l),h=Do(d?.formula1,m,a),g=Do(d?.formula2,m,a),_={type:f,operator:p,allowBlank:X(s.condition?.includeBlanks??!1),showDropDown:s.hideDropdown?`1`:void 0,showInputMessage:X(s.showPromptMessage),showErrorMessage:X(s.showAlertMessage),errorStyle:s.alertStyle??`stop`,errorTitle:Ie(s.alertTitle,`errorTitle`,u),error:Ie(s.alert,`error`,u),promptTitle:Ie(s.promptTitle,`promptTitle`,u),prompt:Ie(s.prompt,`prompt`,u),imeMode:s.imeMode};wo(h)||wo(g)?i.push({attrs:_,formula1:h,formula2:g,sqref:l}):(_.sqref=l,c.push({attrs:_,formula1:h,formula2:g}))}if(c.length===0)return i;t.start(`dataValidations`,{...ko(n),count:c.length});for(let e=0;e<c.length;e++){let{attrs:n,formula1:r,formula2:i}=c[e];r!==void 0||i!==void 0?(t.start(`dataValidation`,n),r!==void 0&&(t.start(`formula1`),t.text(r),t.end(`formula1`)),i!==void 0&&(t.start(`formula2`),t.text(i),t.end(`formula2`)),t.end(`dataValidation`)):t.empty(`dataValidation`,n)}return t.end(`dataValidations`),i}(t,r,a,s);(function(e,t,n,r){let i=r.hyperlinks,a=i?i.length:0;if(a!==0){t.start(`hyperlinks`);for(let n=0;n<a;n++){let r,a,o=i[n];Array.isArray(o)?(a=o[0],r=o[1]):(a=o.r,r=o.v),typeof r==`string`&&(r={address:r});let s=r.address??``,c=s.indexOf(`#`),l=c===-1?s:s.substring(0,c),u=c===-1?``:s.substring(c+1),d={};d.ref=a,l&&(d[`r:id`]=e.addExternal(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,l).relId),u&&(d.location=u),r.screenTip&&(d.tooltip=r.screenTip),r.display&&(d.display=r.display),t.empty(`hyperlink`,d)}t.end(`hyperlinks`)}})(t,r,0,s),await async function(e,t,n){let r={};n?.centerHorizontally&&(r.horizontalCentered=`1`),n?.centerVertically&&(r.verticalCentered=`1`),n?.printHeadings&&(r.headings=`1`),n?.printGridlines&&(r.gridLines=`1`),Object.keys(r).length>0&&t.empty(`printOptions`,r);let i=n?.margins;if(t.empty(`pageMargins`,{left:i?.left??.7,right:i?.right??.7,top:i?.top??.75,bottom:i?.bottom??.75,header:i?.header??.3,footer:i?.footer??.3}),!n)return;let a={},o=(e,t)=>{t!==void 0&&(a[e]=String(t))};o(`paperSize`,n.paperSize),n.paperHeight&&(a.paperHeight=n.paperHeight),n.paperWidth&&(a.paperWidth=n.paperWidth),o(`scale`,n.scale),o(`firstPageNumber`,n.firstPageNumber),o(`fitToWidth`,n.fitToWidth),o(`fitToHeight`,n.fitToHeight),n.printOrder===`overThenDown`&&(a.pageOrder=`overThenDown`),n.orientation&&(a.orientation=n.orientation),n.ignorePrinterDefaults&&(a.usePrinterDefaults=`0`),n.blackAndWhite&&(a.blackAndWhite=`1`),n.draftMode&&(a.draft=`1`);let s=fe.find(([,e])=>e===n.printComments)?.[0];s&&(a.cellComments=s),n.useFirstPageNumber&&(a.useFirstPageNumber=`1`);let c=qt.find(([,e])=>e===n.printErrors)?.[0];c&&(a.errors=c),o(`horizontalDpi`,n.horizontalDpi),o(`verticalDpi`,n.verticalDpi),o(`copies`,n.copies);let l=n.printerSettings;if(l){let t=await Ir({...l,contentType:l.contentType||Ao},e,`../printerSettings/printerSettings{n}.bin`);t?.relId&&(a[`r:id`]=t.relId)}Object.keys(a).length>0&&t.empty(`pageSetup`,a);let u=n.headerFooter;if(u){let e={};u.differentOddEven&&(e.differentOddEven=`1`),u.differentFirst&&(e.differentFirst=`1`),u.ignoreSheetScale&&(e.scaleWithDoc=`0`),u.ignoreSheetMargins&&(e.alignWithMargins=`0`);let n=dt.filter(e=>!!u[e]);if(n.length===0)Object.keys(e).length>0&&t.empty(`headerFooter`,e);else{t.start(`headerFooter`,e);for(let e of n){let n=sn(u[e]);t.start(e,Re.test(n)?Nt:void 0),t.text(n),t.end(e)}t.end(`headerFooter`)}}jo(t,`rowBreaks`,n.rowBreaks),jo(t,`colBreaks`,n.columnBreaks)}(t,r,s.pageLayout),function(e,t){if(!t?.length)return;let n=new Map;for(let e of t){let t=Array.isArray(e)?e[0]:e.r,r=Array.isArray(e)?e[1]:e.v,i=Ct.filter(e=>r?.includes(e));if(i.length===0)continue;let a=typeof t==`string`?t:Co(t);if(!a)continue;let o=i.join(`,`),s=n.get(o);s||(s={checks:i,areas:[]},n.set(o,s)),s.areas.push(a)}if(n.size!==0){e.start(`ignoredErrors`);for(let{checks:t,areas:r}of n.values()){let n={sqref:r.join(` `)};for(let e of t)n[e]=`1`;e.empty(`ignoredError`,n)}e.end(`ignoredErrors`)}}(r,s.ignoredErrors),function(e,t,n,r){let i=r.movables;if((i?i.length:0)===0||!i.some(e=>{let t=e.content?.type;return t===`picture`||t===`chart`||t===`shape`||t===`group`||t===`slicer`||Ue(t)}))return;let a=n.getMovables().getItems().filter(e=>e.getContent().getType()!==`note`),o=e=>{let t=e.getContent();return t._getSavedType?.()??t.getType()},s=[],c=0;for(let e of i){for(;c<a.length&&o(a[c])!==e.content?.type;)c++;s.push(a[c++])}let l=e.addPart(`drawing`,{sheet:n,movables:s,jsonMovables:i,resources:n.getResources()});t.empty(`drawing`,{"r:id":l.relId})}(t,r,a,s);let h=function(e){let t=e.getComments().toArray();if(t.length===0)return null;let n=[];for(let e=0;e<t.length;e++){let r=t[e],i=ao(r);i&&n.push({comment:r,...i})}return n.length===0?null:(n.sort((e,t)=>e.row-t.row||e.col-t.col),{sheet:e,comments:n})}(a);Mo(t,r,`legacyDrawing`,Po(Lo(a,s.legacyDrawing??null,c),h)),Mo(t,r,`legacyDrawingHF`,s.legacyDrawingHF??null),await async function(e,t,n){let r=n.getPicture();if(!r)return;let i=r.getResource(),a=await i.getExternalURI(),o;if(a)o=e.addExternal(ni,a);else{let t=e.getSharedStates(),n=t.get(ri);n||(n=new Map,t.set(ri,n));let r=n.get(i);if(!r){let e=await i.toBuffer();r={bytes:new Uint8Array(e),type:await i.getType()??fi,index:n.size+1},n.set(i,r)}o=e.addBinary(r.bytes,r.type.mime,ni,`../media/image${r.index}.${r.type.ext}`,!0)}t.empty(`picture`,{"r:id":o.relId})}(t,r,a),await async function(e,t,n){if(n.length===0)return;let r=[],i=n.length;for(let t=0;t<i;t++){let i=n[t],a=i.jsonMovable,o=a.content?.json??{},s;try{let t={id:``,type:We,name:`ctrlProp.xml`,contentType:ve,xml:Ae(a.content.type,o)};s=e.addPart(`embeddedPart`,t,`../ctrlProps/ctrlProp{n}.xml`).relId??void 0}catch(t){e.log(`Unable to write the properties of the control '${a.content?.name}'`,t)}s&&r.push({control:i,jsonControl:o,relId:s})}if(r.length===0)return;t.start(`mc:AlternateContent`,{"xmlns:x14":R,"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`}),t.start(`mc:Choice`,{Requires:`x14`}),t.start(`controls`);let a=r.length;for(let e=0;e<a;e++){let{control:n,jsonControl:i,relId:a}=r[e],o=n.jsonMovable;t.start(`mc:AlternateContent`),t.start(`mc:Choice`,{Requires:`x14`}),t.start(`control`,{shapeId:i.shapeId,"r:id":a,name:o.content?.name??void 0});let s=n.anchorType;t.start(`controlPr`,Qt(i)),t.start(`anchor`,{moveWithCells:s===`absolute`?void 0:`1`,sizeWithCells:s===`twoCell`?`1`:void 0}),Ro(t,`from`,n.anchor.tl),Ro(t,`to`,n.anchor.br),t.end(`anchor`),i.xml&&t.raw(i.xml),t.end(`controlPr`),t.end(`control`),t.end(`mc:Choice`),t.end(`mc:AlternateContent`)}t.end(`controls`),t.end(`mc:Choice`),t.end(`mc:AlternateContent`)}(t,r,c),function(e,t,n,r){let i=r.tables,a=i?i.length:0;if(a===0)return;let o=n.getTables().getItems();t.start(`tableParts`,{count:a});for(let n=0;n<a;n++){let r,a,s=i[n];Array.isArray(s)?(a=s[0],r=s[1]):(a=s.r,r=s.v),_a(e,o[n]);let c=e.addPart(`table`,{json:r,model:o[n],ref:a}),l={};l[`r:id`]=c.relId,t.empty(`tablePart`,l)}t.end(`tableParts`)}(t,r,a,s),function(e,t,n,r,i){let a=Aa(n),o=n.getSparklineGroups().getItems(),s=o.length>0;if(r.length===0&&i.length===0&&a.length===0&&!s)return;let c=n.getStyles(),l=c.getTheme();if(t.start(`extLst`),r.length>0){t.start(`ext`,{uri:ot,"xmlns:x14":R}),t.start(`x14:conditionalFormattings`);for(let n=0;n<r.length;n++){let{guid:i,sqref:a,priority:o,scale:s,rule:u,style:d,stopIfTrue:f}=r[n];if(t.start(`x14:conditionalFormatting`,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),s){if(s.type===O.ScaleType.DataBar){t.start(`x14:cfRule`,{type:`dataBar`,id:i}),t.start(`x14:dataBar`,{minLength:s.minLength,maxLength:s.maxLength,gradient:s.gradient?void 0:`0`,border:s.borderColor?`1`:void 0,direction:s.direction,negativeBarColorSameAsPositive:s.negativeFillColor?`0`:`1`,negativeBarBorderColorSameAsPositive:s.negativeBorderColor?`0`:void 0,axisPosition:s.axisPosition});let e=s.stops??[];if(e.length===0)vo(t,{type:O.ColorStopType.AutoMin}),vo(t,{type:O.ColorStopType.AutoMax});else for(let n=0;n<e.length;n++)vo(t,e[n]);s.borderColor&&W(t,l,s.borderColor,`x14:borderColor`),s.negativeFillColor&&W(t,l,s.negativeFillColor,`x14:negativeFillColor`),s.negativeBorderColor&&W(t,l,s.negativeBorderColor,`x14:negativeBorderColor`),s.axisColor&&W(t,l,s.axisColor,`x14:axisColor`),t.end(`x14:dataBar`),t.end(`x14:cfRule`)}else{t.start(`x14:cfRule`,{type:`iconSet`,priority:o,id:i}),t.start(`x14:iconSet`,{iconSet:s.iconSet,reverse:X(s.reverse),showValue:X(s.showValue),custom:(s.icon?.length??0)>0?`1`:void 0});let e=s.stops??[];for(let n=0;n<e.length;n++)vo(t,e[n]);let n=s.icon??[];for(let e=0;e<n.length;e++)t.empty(`x14:cfIcon`,{iconSet:n[e].set,iconId:n[e].id});t.end(`x14:iconSet`),t.end(`x14:cfRule`)}}else{t.start(`x14:cfRule`,{type:u.type,priority:o,stopIfTrue:X(f),aboveAverage:X(u.aboveAverage),equalAverage:X(u.equalAverage),stdDev:u.stdDev,bottom:X(u.bottom),percent:X(u.percent),rank:u.rank,operator:u.operator,text:u.text,timePeriod:u.timePeriod,id:i});let n=u.formulas??[];for(let e=0;e<n.length;e++)t.start(`xm:f`),t.text(n[e]),t.end(`xm:f`);d&&Object.keys(d).length>0&&Ni(e,t,d,c,l,`x14:dxf`),t.end(`x14:cfRule`)}t.start(`xm:sqref`),t.text(a),t.end(`xm:sqref`),t.end(`x14:conditionalFormatting`)}t.end(`x14:conditionalFormattings`),t.end(`ext`)}if(i.length>0){t.start(`ext`,{uri:Tt,"xmlns:x14":R}),t.start(`x14:dataValidations`,{"xmlns:xm":nt,...ko(n),count:i.length});for(let e=0;e<i.length;e++){let{attrs:n,formula1:r,formula2:a,sqref:o}=i[e];t.start(`x14:dataValidation`,n),r!==void 0&&(t.start(`x14:formula1`),t.start(`xm:f`),t.text(r),t.end(`xm:f`),t.end(`x14:formula1`)),a!==void 0&&(t.start(`x14:formula2`),t.start(`xm:f`),t.text(a),t.end(`xm:f`),t.end(`x14:formula2`)),t.start(`xm:sqref`),t.text(o),t.end(`xm:sqref`),t.end(`x14:dataValidation`)}t.end(`x14:dataValidations`),t.end(`ext`)}s&&function(e,t,n,r){let i=t.getName(),a=[];for(let e=0;e<r.length;e++){let t=an(r[e],i);t.length>0&&a.push({group:r[e].getProperties(),sparklines:t})}if(a.length!==0){e.start(`ext`,{uri:`{05C60535-1F16-4fd2-B633-F4F36F0B64E0}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),e.start(`x14:sparklineGroups`,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`});for(let t=0;t<a.length;t++){let{group:r,sparklines:o}=a[t];e.start(`x14:sparklineGroup`,Rt(r));for(let t of Zt){let i=r[t];i&&W(e,n,i,`x14:${t}`)}r.dateRange&&(e.start(`xm:f`),e.text(Te(r.dateRange,i)),e.end(`xm:f`)),e.start(`x14:sparklines`);for(let t=0;t<o.length;t++)e.start(`x14:sparkline`),o[t].f&&(e.start(`xm:f`),e.text(o[t].f),e.end(`xm:f`)),e.start(`xm:sqref`),e.text(o[t].sqref),e.end(`xm:sqref`),e.end(`x14:sparkline`);e.end(`x14:sparklines`),e.end(`x14:sparklineGroup`)}e.end(`x14:sparklineGroups`),e.end(`ext`)}}(t,n,l,o),((e,t,n)=>{let r=[],i=[],a=[];for(let e=0;e<n.slicers.length;e++){let t=n.slicers[e];(ka(t)?a:J(t)?r:i).push(t)}if(r.length>0){let i=e.addPart(`slicers`,{sheet:n.sheet,slicers:r});t.start(`ext`,{uri:yt,"xmlns:x14":R}),t.start(`x14:slicerList`),t.empty(`x14:slicer`,{"r:id":i.relId}),t.end(`x14:slicerList`),t.end(`ext`)}if(i.length>0){let r=e.addPart(`slicers`,{sheet:n.sheet,slicers:i});t.start(`ext`,{uri:Ot,"xmlns:x15":et}),t.start(`x14:slicerList`,{"xmlns:x14":R}),t.empty(`x14:slicer`,{"r:id":r.relId}),t.end(`x14:slicerList`),t.end(`ext`)}if(a.length>0){let r=e.addPart(`timelines`,{sheet:n.sheet,slicers:a});t.start(`ext`,{uri:pt,"xmlns:x15":et}),t.start(`x15:timelineRefs`),t.empty(`x15:timelineRef`,{"r:id":r.relId}),t.end(`x15:timelineRefs`),t.end(`ext`)}})(e,t,{sheet:n,slicers:a}),t.end(`extLst`)}(t,r,a,p,m),function(e,t,n){let r=t.pivotTables,i=r?r.length:0;if(i===0)return;let a=na(e);for(let t=0;t<i;t++){let i=r[t],o=i.part,s=!!o;if(!o){let t=Ja(i,a,t=>e.warn(t,i),aa(e));if(t===null)continue;o={id:``,type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`,name:`pivotTable1.xml`,xml:t},i={...i,part:o}}if(!o.xml)continue;if(!ra(e,i.cacheId)){e.log(`The pivot table '${o.name??``}' has no cache with id ${i.cacheId} and was dropped.`);continue}let c=ta(o.xml,n);s&&(c=hn(c,i,a),c=tt(c,`location`,{ref:i.location})),e.addPart(`pivotTable`,c===o.xml?i:{...i,part:{...o,xml:c}})}}(t,s,f),function(e,t){t&&(e.addPart(`comments`,t),t.comments.some(e=>!e.comment.isNote())&&e.addPart(`threadedComments`,t))}(t,h),r.end(`worksheet`),r.close()}},new class extends V{constructor(){super({kind:`sharedStrings`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,path:`/xl/sharedStrings.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.json,i=r?r.length:0,a=t.getSharedStates().get(`stringsCount`)??0;n.decl(),n.start(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:a,uniqueCount:i});let o=e.theme;for(let e=0;e<i;e++){let t=r[e];if(n.start(`si`),t instanceof ee){let e=t.getRuns();for(let t=0;t<e.length;t++){let r=e[t];n.start(`r`),r.font&&o&&ro(n,r.font,o),Wo(n,r.text),n.end(`r`)}}else Wo(n,t);n.end(`si`)}n.end(`sst`),n.close()}},new class extends V{constructor(){super({kind:`theme`,contentType:`application/vnd.openxmlformats-officedocument.theme+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,path:`/xl/theme/theme{n}.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.model,i=e.json;n.decl(),n.pushDefaultNamespace(`a`),n.start(`theme`,{"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`,name:r.getName()||`Office Theme`}),n.start(`themeElements`),function(e,t,n,r){let i=n?.getColorScheme();if(i){t.start(r,{name:i.getName()||`Office`});for(let e of Br)t.start(e),H(t,n,i[`get`+e.charAt(0).toUpperCase()+e.slice(1)]()),t.end(e);t.end(r)}}(0,n,r,`clrScheme`),function(e,t,n,r){n&&(t.start(r,{name:n.getName()||`Office`}),is(t,n.getMajor()??{},`Calibri Light`,`majorFont`),is(t,n.getMinor()??{},`Calibri`,`minorFont`),t.end(r))}(0,n,r.getFontScheme(),`fontScheme`),function(e,t,n,r,i){if(i?.formatSchemeXml)return void t.raw(i.formatSchemeXml);(function(e,t,n,r,i){let a={getTheme:()=>r};t.start(n,{name:`Office`}),t.start(`fillStyleLst`);for(let n of i.fillStyleLst)Yr(e,t,n,a);t.end(`fillStyleLst`),t.start(`lnStyleLst`);for(let n of i.lnStyleLst)Xr(e,t,n,a);t.end(`lnStyleLst`),t.start(`effectStyleLst`);for(let n of i.effectStyleLst)t.start(`effectStyle`),n.length>0?$r(e,t,r,n):t.empty(`effectLst`),t.end(`effectStyle`);t.end(`effectStyleLst`),t.start(`bgFillStyleLst`);for(let n of i.bgFillStyleLst)Yr(e,t,n,a);t.end(`bgFillStyleLst`),t.end(n)})(e,t,n,r,r.getFormatScheme())}(t,n,`fmtScheme`,r,i),n.end(`themeElements`),function(e,t,n){let r=n.getObjectDefaults();if(!as.some(([e])=>r[e]))return void t.empty(`objectDefaults`);let i={getTheme:()=>n};t.start(`objectDefaults`);for(let[a,o]of as){let s=r[a];if(!s)continue;t.start(o),t.start(`spPr`),Qr(e,i,s),t.end(`spPr`),rs(e,i,s.text);let c=s.style;if(c){let e=(e,r)=>{r&&(t.start(e,{idx:String(r.index)}),r.color&&H(t,n,r.color),t.end(e))};t.start(`style`),e(`lnRef`,c.stroke),e(`fillRef`,c.fill),e(`effectRef`,c.effect),e(`fontRef`,c.font),t.end(`style`)}t.end(o)}t.end(`objectDefaults`)}(t,n,r),n.start(`extraClrSchemeLst`),n.end(`extraClrSchemeLst`);let a=i?.customColors;if(a?.length){n.start(`custClrLst`);for(let e of a)n.start(`custClr`,e.name===void 0?void 0:{name:e.name}),H(n,r,e.color),n.end(`custClr`);n.end(`custClrLst`)}let o=i?.family;if(o){n.start(`extLst`),n.start(`ext`,{uri:Ut});let e={"xmlns:thm15":`http://schemas.microsoft.com/office/thememl/2012/main`,name:o.name,id:o.id};o.vid&&(e.vid=o.vid),n.empty(`thm15:themeFamily`,e),n.end(`ext`),n.end(`extLst`)}n.end(`theme`),n.close()}},new class extends V{constructor(){super({kind:`styles`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,path:`/xl/styles.xml`})}async emit(e,t){let r=t.getXMLWriter(),i=e.json??{},a=(e.theme,e.styles);r.decl(),r.start(`styleSheet`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2 xr`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`});let{directXfs:o,denormalized:s}=t.getSharedStates().get(`stylesLayout`)??vi(a,i),c=t.getSharedStates().get(hi),l=function(e){let t=e?.slicers?.styles;if(!t)return e;let n={...e.tables?.styles};for(let e of Object.keys(t)){let{wholeTable:r,headerRow:i}=t[e],a={name:e,table:!1,pivot:!1};r&&(a.wholeTable=r),i&&(a.headerRow=i),n[e]=a}return{...e,tables:{...e.tables,styles:n}}}(i),u=function(e,t=0){let n=e?.tables;if(!n)return null;let r=n.styles;if(!r)return null;let i=[],a=new Map,o=Object.keys(r),s=[...Ii].reverse();for(let e of o){let n=r[e];for(let r of s){let o=n[r];if(!o)continue;let s={};if(o.font&&(s.font=o.font),o.fill&&(s.fill=o.fill),o.borders&&(s.borders=o.borders),o.numberFormat!==void 0&&(s.numberFormat=o.numberFormat),Object.keys(s).length===0)continue;let c=t+i.length;i.push(s);let l=`${e}:${r}`;a.set(l,c)}}return{dxfs:i,dxfIndexMap:a}}(l,c?.getCount()??0),d=t.getSharedStates().get(sr),f=(d?.getSources()??[]).map(e=>function(e,t,r){let i=t[e.xf];if(e.user){let{numberFormat:t,...a}=e.user;i=n.deepMerge(i,a);let o=r.direct?.[e.xf];if(o){let{named:e,...t}=o;i=n.deepMerge(i,t)}}if(e.labelIndent!==null){let{indent:t,...n}=i.alignment??{};i={...i,alignment:{...n,horizontal:m.HorizontalAlignment.Left,...e.labelIndent>0?{indent:e.labelIndent}:{}}}}return e.numberFormat!==null&&(i={...i,numberFormat:e.numberFormat}),i}(e,o,i));for(let e of f)Si(a,e,s);(function(e,t,n){let r=n.numFmtsCustom,i=r.length;if(i!==0){t.start(`numFmts`,{count:String(i)});for(let e=0;e<i;e++){let n=r[e];t.empty(`numFmt`,{numFmtId:String(e+Pi),formatCode:n})}t.end(`numFmts`)}})(0,r,s),function(e,t,n,r){let i=r.fonts,a=i.length,o=n.getTheme(),s=w.getShared(),c=Be(i.map(e=>({...e,family:Pe(e.family,e.fallbacks,o,!0).name}))).every(e=>qe(s,e));t.start(`fonts`,{count:String(a),...c?{"x14ac:knownFonts":`1`}:{}});for(let r of i)wi(e,t,r,n);t.end(`fonts`)}(t,r,a,s),function(e,t,n,r){let i=r.fills,a=i.length;t.start(`fills`,{count:String(a)});for(let r of i)Yr(e,t,r,n,!0);t.end(`fills`)}(t,r,a,s),function(e,t,n,r){let i=r.borders,a=i.length;t.start(`borders`,{count:String(a)});let o=n.getTheme();for(let n of i)Ei(e,t,n,o,!1);t.end(`borders`)}(t,r,a,s),function(e,t,r,i,a){let o=a.namedStyles,s=o.length;t.start(`cellStyleXfs`,{count:String(s)});for(let i of o)Ai(e,t,r,i.style??n.EmptyObject,a,!1);t.end(`cellStyleXfs`)}(t,r,a,0,s),function(e,t,n,r,i,a,o,s){let c=r.length,l=a?.getSources()??[],u=c+l.length;u>ki&&e.warn(`The workbook has ${u.toLocaleString()} unique cell formats; Excel opens at most ${ki.toLocaleString()}.`,void 0,`xlsx.styles.cellXfsLimit`),t.start(`cellXfs`,{count:String(u)});for(let a=0;a<c;a++)Ai(e,t,n,r[a],i,!0,!1,!1,s?.getXfComplement(a)??null);for(let r=0;r<l.length;r++){let a=l[r];Ai(e,t,n,o[r],i,!0,a.hidden,a.pivotButton,s?.getXfComplement(a.xf)??null)}t.end(`cellXfs`)}(t,r,a,o,s,d,f,t.getSharedStates().get(lr)),function(e,t,n,r,i){let a=i.namedStyles,o=a.length;t.start(`cellStyles`,{count:String(o)});let s=i.namedStyleMap;for(let e=0;e<o;e++){let r=a[e],i=r.name,o=i.toLowerCase(),c={name:i,xfId:s.get(o)};r.hidden&&(c.hidden=`1`),r.iLevel&&(c.iLevel=String(r.iLevel));let l=null;l=o===h.BuiltInName.Normal.toLowerCase()?0:n.getNamedStyles().getByName(i).getBuiltInID(),l!==null&&(c.builtinId=String(l),r.customized&&(c.customBuiltin=`1`)),t.empty(`cellStyle`,c)}t.end(`cellStyles`)}(0,r,a,0,s),function(e,t,n,r,i){let a=[...i?.getDxfs()??[],...r?.dxfs??[]];if(a.length===0)return void t.empty(`dxfs`,{count:`0`});let o=n.getTheme();t.start(`dxfs`,{count:String(a.length)});let s=Pi;for(let r of a)s=Ni(e,t,r,n,o,`dxf`,s);t.end(`dxfs`)}(t,r,a,u,c),function(e,t,n,r,i,a){let o=r?.tables,s=o?.styles??null,c=s?Object.keys(s):null,l=c?c.length:0,u={count:String(l),defaultTableStyle:o?.defaultTableStyle??`TableStyleMedium2`,defaultPivotStyle:o?.defaultPivotStyle??`PivotStyleLight16`};if(l===0)return void t.empty(`tableStyles`,u);t.start(`tableStyles`,u);for(let e of c){let n=s[e],r=[];for(let e of Ii){let t=n[e];t&&r.push([e,t])}let o=a?.styles?.[e],c=o?Fi.filter(e=>o[e]).length:0,l={name:e,pivot:n.pivot?`1`:`0`,table:!1===n.table?`0`:void 0,count:String(r.length+c)};t.start(`tableStyle`,l);for(let[n,a]of r){let r=`${e}:${n}`,o=i?.dxfIndexMap.get(r)??`0`,s={};s.type=n,a.size!==void 0&&(s.size=String(a.size)),s.dxfId=String(o),t.empty(`tableStyleElement`,s)}t.end(`tableStyle`)}t.end(`tableStyles`)}(0,r,0,l,u,i?.slicers),function(e,t,n,r){let i=r?.indexedColors&&r.indexedColors.length>0,a=r?.mruColors&&r.mruColors.length>0;if(i||a){if(t.start(`colors`),i){t.start(`indexedColors`);for(let e of r.indexedColors){let n=Kr(e,!0);t.empty(`rgbColor`,{rgb:n})}t.end(`indexedColors`)}if(a){t.start(`mruColors`);for(let e of r.mruColors){let n=Kr(e);t.empty(`color`,{rgb:n})}t.end(`mruColors`)}t.end(`colors`)}}(0,r,0,i),function(e,t,n,r){let i=r?.slicers?.styles??{},a=[],o=[];for(let e of Object.keys(i)){let t=i[e],n=[];for(let e of Fi){let r=t[e];r&&(n.push({type:e,dxfId:a.length}),a.push(r))}o.push({name:e,elements:n})}if(t.start(`extLst`),a.length>0){t.start(`ext`,{uri:`{46F421CA-312F-682f-3DD2-61675219B42D}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),t.start(`x14:dxfs`,{count:String(a.length)});let r=n.getTheme(),i=Pi;for(let o of a)i=Ni(e,t,o,n,r,`dxf`,i);t.end(`x14:dxfs`),t.end(`ext`)}t.start(`ext`,{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`});let s={defaultSlicerStyle:r?.slicers?.defaultSlicerStyle??`SlicerStyleLight1`};if(o.length===0)t.empty(`x14:slicerStyles`,s);else{t.start(`x14:slicerStyles`,s);for(let e of o)if(e.elements.length!==0){t.start(`x14:slicerStyle`,{name:e.name}),t.start(`x14:slicerStyleElements`);for(let n of e.elements)t.empty(`x14:slicerStyleElement`,{type:n.type,dxfId:String(n.dxfId)});t.end(`x14:slicerStyleElements`),t.end(`x14:slicerStyle`)}else t.empty(`x14:slicerStyle`,{name:e.name});t.end(`x14:slicerStyles`)}t.end(`ext`),t.start(`ext`,{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}),t.empty(`x15:timelineStyles`,{defaultTimelineStyle:`TimeSlicerStyleLight1`}),t.end(`ext`),t.end(`extLst`)}(t,r,a,i),r.end(`styleSheet`),r.close()}},new class extends V{constructor(){super({kind:`featurePropertyBag`,contentType:`application/vnd.ms-excel.featurepropertybag+xml`,relTypeUri:`http://schemas.microsoft.com/office/2022/11/relationships/FeaturePropertyBag`,path:`/xl/featurePropertyBag/featurePropertyBag.xml`})}emit(e,t){let n=t.getXMLWriter(),r=e.getControls();n.decl(),n.start(`FeaturePropertyBags`,{xmlns:Mi});let i=[],a=0;for(let e=0;e<r.length;e++){let t=a++;n.empty(`bag`,{type:os[r[e].type]??r[e].type});let o=a++;n.start(`bag`,{type:`XFControls`}),n.start(`bagId`,{k:`CellControl`}),n.text(String(t)),n.end(`bagId`),n.end(`bag`),i.push(a++),n.start(`bag`,{type:`XFComplement`}),n.start(`bagId`,{k:`XFControls`}),n.text(String(o)),n.end(`bagId`),n.end(`bag`)}n.start(`bag`,{type:`XFComplements`,extRef:`XFComplementsMapperExtRef`}),n.start(`a`,{k:`MappedFeaturePropertyBags`});for(let e=0;e<i.length;e++)n.start(`bagId`),n.text(String(i[e])),n.end(`bagId`);n.end(`a`),n.end(`bag`),n.end(`FeaturePropertyBags`),n.close()}},new class extends V{constructor(){super({kind:`propsCore`,contentType:`application/vnd.openxmlformats-package.core-properties+xml`,relTypeUri:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,path:`/docProps/core.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`cp:coreProperties`,{"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`});let r=cs(new Date),i={author:`SheetXL`,lastAuthor:`SheetXL`,creationDate:r,...e.model.getProperties().toJSON(),lastModifiedDate:r};for(let[e,t,r]of ss){let a=i[t];a!=null&&a!==``&&(n.start(e,r?{"xsi:type":`dcterms:W3CDTF`}:void 0),n.text(String(a)),n.end(e))}n.end(`cp:coreProperties`),n.close()}},new class extends V{constructor(){super({kind:`propsApp`,contentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,path:`/docProps/app.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.model,i=(await te.getDetails()).getBuildVersion(),a=Ee(i),o=r.getProperties();n.setValidationDisabled(!0),n.decl(),n.start(`Properties`,{xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}),Q(t,n,`Application`,`SheetXL`),Q(t,n,`DocSecurity`,`0`),Q(t,n,`ScaleCrop`,`false`),ls(t,n,r);let s=o.getManager();s&&Q(t,n,`Manager`,s);let c=o.getCompany();c&&Q(t,n,`Company`,c),Q(t,n,`LinksUpToDate`,`false`),Q(t,n,`SharedDoc`,`false`),Q(t,n,`HyperlinksChanged`,`false`),Q(t,n,`AppVersion`,a),n.end(`Properties`),n.close()}},new class extends V{constructor(){super({kind:`propsCustom`,contentType:`application/vnd.openxmlformats-officedocument.custom-properties+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties`,path:`/docProps/custom.xml`})}async emit(e,t){let n=t.getXMLWriter();n.setValidationDisabled(!0),n.decl(),n.start(`Properties`,{xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/custom-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`});let r=e.model.getProperties().getCustom();for(let e=0;e<r.length;e++){let{key:t,type:i,value:a,linkTarget:o}=r[e].toJSON(),s={fmtid:`{D5CDD505-2E9C-101B-9397-08002B2CF9AE}`,pid:String(e+2),name:t};o&&(s.linkTarget=o),n.start(`property`,s);let c=us[i];n.start(c),n.text(i===N.Type.Date?ds(a):String(a)),n.end(c),n.end(`property`)}n.end(`Properties`),n.close()}},new class extends V{constructor(){super({kind:`metadata`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata`,path:`/xl/metadata.xml`})}emit(e,t){let n=t.getXMLWriter(),r=e.hasCellMeta(),i=e.hasValueMeta(),a=e.getDAPRFutureMetadataBlocks(),o=e.getRVFutureMetadataBlocks(),s=e.getValueMeta(),c=0,l=0,u=0;r&&(c=++u),i&&(l=++u);let d={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`};if(r&&(d[`xmlns:xda`]=`http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray`),i&&(d[`xmlns:xlrd`]=`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata`),n.decl(),n.start(`metadata`,d),n.start(`metadataTypes`,{count:u}),r&&n.empty(`metadataType`,{name:`XLDAPR`,...fs,cellMeta:`1`}),i&&n.empty(`metadataType`,{name:`XLRICHVALUE`,...fs}),n.end(`metadataTypes`),r){n.start(`futureMetadata`,{name:`XLDAPR`,count:a.length});for(let e of a)n.start(`bk`),n.start(`extLst`),n.start(`ext`,{uri:`{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}`}),n.empty(`xda:dynamicArrayProperties`,{fDynamic:e.fDynamic,fCollapsed:e.fCollapsed}),n.end(`ext`),n.end(`extLst`),n.end(`bk`);n.end(`futureMetadata`)}if(i){n.start(`futureMetadata`,{name:`XLRICHVALUE`,count:o.length});for(let e of o)n.start(`bk`),n.start(`extLst`),n.start(`ext`,{uri:`{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}`}),n.empty(`xlrd:rvb`,{i:e}),n.end(`ext`),n.end(`extLst`),n.end(`bk`);n.end(`futureMetadata`)}if(r){n.start(`cellMetadata`,{count:a.length});for(let e=0;e<a.length;e++)n.start(`bk`),n.empty(`rc`,{t:c,v:e}),n.end(`bk`);n.end(`cellMetadata`)}if(i){n.start(`valueMetadata`,{count:s.length});for(let e of s)n.start(`bk`),n.empty(`rc`,{t:l,v:e}),n.end(`bk`);n.end(`valueMetadata`)}n.end(`metadata`),n.close()}},new class extends V{constructor(){super({kind:`richValue`,contentType:`application/vnd.ms-excel.rdrichvalue+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue`,path:`./richData/rdrichvalue.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.getEntries(),i=r.length;n.decl(),n.start(`rvData`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata`,count:i});for(let t of r){n.start(`rv`,{s:e.getStructureIndex(t.structure)}),t.fb!==void 0&&(n.start(`fb`),n.text(t.fb),n.end(`fb`));for(let e of t.values)n.start(`v`),n.text(e),n.end(`v`);n.end(`rv`)}n.end(`rvData`),n.close()}},new class extends V{constructor(){super({kind:`richValueStructure`,contentType:`application/vnd.ms-excel.rdrichvaluestructure+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure`,path:`./richData/rdrichvaluestructure.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.getStructures(),i=r.length;n.decl(),n.start(`rvStructures`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata`,count:i});for(let e of r){n.start(`s`,{t:e.structure});for(let[t,r]of e.props)n.empty(`k`,{n:t,t:r});n.end(`s`)}n.end(`rvStructures`),n.close()}},new class extends V{constructor(){super({kind:`richValueTypes`,contentType:`application/vnd.ms-excel.rdrichvaluetypes+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes`,path:`./richData/rdRichValueTypes.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`rvTypesInfo`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x`,"xmlns:x":`http://schemas.openxmlformats.org/spreadsheetml/2006/main`});let r=[[`_Self`,[`ExcludeFromFile`,`ExcludeFromCalcComparison`]],[`_DisplayString`,[`ExcludeFromCalcComparison`]],[`_Flags`,[`ExcludeFromCalcComparison`]],[`_Format`,[`ExcludeFromCalcComparison`]],[`_SubLabel`,[`ExcludeFromCalcComparison`]],[`_Attribution`,[`ExcludeFromCalcComparison`]],[`_Icon`,[`ExcludeFromCalcComparison`]],[`_Display`,[`ExcludeFromCalcComparison`]],[`_CanonicalPropertyNames`,[`ExcludeFromCalcComparison`]],[`_ClassificationId`,[`ExcludeFromCalcComparison`]]];n.start(`global`),n.start(`keyFlags`);for(let[e,t]of r){n.start(`key`,{name:e});for(let e of t)n.empty(`flag`,{name:e,value:`1`});n.end(`key`)}n.end(`keyFlags`),n.end(`global`);let i=e?.getKeyFlags()??[];if(i.length>0){n.start(`types`);for(let[e,t]of i){n.start(`type`,{name:e}),n.start(`keyFlags`);for(let[e,r]of t){n.start(`key`,{name:e});for(let[e,t]of r)n.empty(`flag`,{name:e,value:t});n.end(`key`)}n.end(`keyFlags`),n.end(`type`)}n.end(`types`)}n.end(`rvTypesInfo`),n.close()}},new class extends V{constructor(){super({kind:`richValueWebImage`,contentType:`application/vnd.ms-excel.rdrichvaluewebimage+xml`,relTypeUri:`http://schemas.microsoft.com/office/2020/07/relationships/rdRichValueWebImage`,path:`./richData/rdRichValueWebImage.xml`})}async emit(e,t){let n=[];for(let{source:r,resource:i}of e.images){let a=t.addExternal(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,r).relId,o=null;try{let n=i&&!i.isClosed()?i:null;if(!n){let t=await e.workbook.fetch(r);t.ok&&t.headers.get(`content-type`)?.startsWith(`image/`)&&(n=new C({source:{buffer:await t.arrayBuffer()}}))}n&&(o=(await ai(t,n)).relId)}catch{}n.push({address:a,blip:o})}let r=t.getXMLWriter();r.decl(),r.start(`webImagesSrd`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2020/richdatawebimage`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`});for(let{address:e,blip:t}of n)r.start(`webImageSrd`),r.empty(`address`,{"r:id":e}),t&&r.empty(`blip`,{"r:id":t}),r.end(`webImageSrd`);r.end(`webImagesSrd`),r.close()}},new class extends V{constructor(){super({kind:`richValueRel`,contentType:`application/vnd.ms-excel.richvaluerel+xml`,relTypeUri:`http://schemas.microsoft.com/office/2022/10/relationships/richValueRel`,path:`./richData/richValueRel.xml`})}async emit(e,t){let n=[];for(let r of e)n.push((await ai(t,r)).relId);let r=t.getXMLWriter();r.decl(),r.start(`richValueRels`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`});for(let e of n)r.empty(`rel`,{"r:id":e});r.end(`richValueRels`),r.close()}},new class extends V{constructor(){super({kind:`richValueArray`,contentType:`application/vnd.ms-excel.rdarray+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdArray`,path:`./richData/rdarray.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.getArrays();n.decl(),n.start(`arrayData`,{xmlns:ps,count:r.length});for(let e of r)n.start(`a`,{r:e.rows,c:e.columns>1?e.columns:void 0}),ms(n,e.items),n.end(`a`);n.end(`arrayData`),n.close()}},new class extends V{constructor(){super({kind:`richValueBagStructure`,contentType:`application/vnd.ms-excel.rdsupportingpropertybagstructure+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdSupportingPropertyBagStructure`,path:`./richData/rdsupportingpropertybagstructure.xml`})}async emit(e,t){let n=t.getXMLWriter(),{structures:r}=e.getBags();n.decl(),n.start(`spbStructures`,{xmlns:ps,count:r.length});for(let e of r){n.start(`s`);for(let[t,r]of e)n.empty(`k`,{n:t,t:r});n.end(`s`)}n.end(`spbStructures`),n.close()}},new class extends V{constructor(){super({kind:`richValueBag`,contentType:`application/vnd.ms-excel.rdsupportingpropertybag+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/rdSupportingPropertyBag`,path:`./richData/rdsupportingpropertybag.xml`})}async emit(e,t){let n=t.getXMLWriter(),{bags:r,arrays:i}=e.getBags();if(n.decl(),n.start(`supportingPropertyBags`,{xmlns:ps}),i.length>0){n.start(`spbArrays`,{count:i.length});for(let e of i)n.start(`a`,{count:e.length}),ms(n,e),n.end(`a`);n.end(`spbArrays`)}n.start(`spbData`,{count:r.length});for(let e of r){n.start(`spb`,{s:e.s});for(let t of e.values)n.start(`v`),n.text(t),n.end(`v`);n.end(`spb`)}n.end(`spbData`),n.end(`supportingPropertyBags`),n.close()}},new class extends V{constructor(){super({kind:`richValueStyles`,contentType:`application/vnd.ms-excel.richstyles+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/06/relationships/richStyles`,path:`./richData/richStyles.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.getRichStyles();n.decl(),n.start(`richStyleSheet`,{xmlns:ps,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x`,"xmlns:x":`http://schemas.openxmlformats.org/spreadsheetml/2006/main`});let i=[...new Set(r.map(e=>e.numberFormat).filter(e=>!!e))],a=new Map(i.map((e,t)=>[e,t]));i.length>0&&(n.start(`dxfs`,{count:i.length}),i.forEach((e,t)=>{n.start(`x:dxf`),n.empty(`x:numFmt`,{numFmtId:164+t,formatCode:e}),n.end(`x:dxf`)}),n.end(`dxfs`)),n.start(`richProperties`),n.empty(`rPr`,{n:`NumberFormat`,t:`s`}),n.empty(`rPr`,{n:`IsTitleField`,t:`b`}),n.empty(`rPr`,{n:`IsHeroField`,t:`b`}),n.end(`richProperties`),n.start(`richStyles`);for(let e of r){n.start(`rSty`,e.numberFormat?{dxfid:a.get(e.numberFormat)}:void 0);let t=[];e.numberFormat&&t.push([0,e.numberFormat]),e.isTitle&&t.push([1,`1`]),e.isHero&&t.push([2,`1`]);for(let[e,r]of t)n.start(`rpv`,{i:e}),n.text(r),n.end(`rpv`);n.end(`rSty`)}n.end(`richStyles`),n.end(`richStyleSheet`),n.close()}},new class extends V{constructor(){super({kind:`drawing`,contentType:`application/vnd.openxmlformats-officedocument.drawing+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,path:`../drawings/drawing{n}.xml`,regeneratesRelationships:!0})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.pushDefaultNamespace(`xdr`),n.start(`wsDr`,{"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`});let r=e.sheet,i=e.movables,a=e.jsonMovables,o=a?a.length:0,s=0,c=e=>{let t=e.content,n=Ue(t?.type)?t.json?.shapeId:t?.json?.sourceId;if(typeof n==`number`&&n>s&&(s=n),t?.type===`group`)for(let t of Cs(e))c(t)};for(let e=0;e<o;e++)c(a[e]);let l=new Map,u=t.getSharedStates(),d=u.get(`uniqueIdCounter`);if(d||(d=new Map,u.set(`uniqueIdCounter`,d)),s>0){d.set(r,Math.max(d.get(r)??1,s));let e=new Set;for(let t=0;t<o;t++){let n=a[t].content?.json?.sourceId;if(typeof n==`number`){if(e.has(n)){let e=d.get(r)+1;d.set(r,e),l.set(a[t],e)}else e.add(n)}}}let f=Ws(t,r),p=()=>{let e=(d.get(r)??1)+1;return d.set(r,e),e},m=e=>{for(let t of Cs(e)){let e=t.content?.json?.sourceId,n=typeof e==`number`&&!f.bySource.has(e),r=n?e:p();f.assigned.set(t,r),n&&f.bySource.set(e,r),t.content?.type===`group`&&m(t)}};for(let e=0;e<o;e++){let t=a[e],n=t.content?.json?.sourceId,r=l.get(t)??(typeof n==`number`?n:void 0);r===void 0&&(r=p()),f.assigned.set(t,r),typeof n!=`number`||f.bySource.has(n)||f.bySource.set(n,r),t.content?.type===`group`&&m(t)}for(let e=0;e<o;e++)await Ts(t,a[e]);for(let e=0;e<o;e++){let o=a[e],s=i[e],c=o.content?.type;if(Ue(c))Xs(n,o);else{if(c===`slicer`){let e=s.getContent();if(!e.getTable?.()&&!J(e))continue}switch(n.start(`twoCellAnchor`,{editAs:o.anchorType||`twoCell`}),Ys(n,`from`,o.anchor.tl),Ys(n,`to`,o.anchor.br),c){case`picture`:await Es(t,r,s,o,s.getBounds(),s.getContent().getResource());break;case`chart`:await Os(t,r,s,o);break;case`shape`:await Ms(t,r,s,o,s.getBounds());break;case`group`:await As(t,r,s,o,s.getBounds());break;case`smartArt`:await Ns(t,r,s,o);break;case`slicer`:await Ls(t,r,s,o);break;case`graphicFrame`:await zs(t,r,s,o);break;default:await Bs(t,r,o,s.getBounds())}Ss(n,o),n.end(`twoCellAnchor`)}}n.end(`wsDr`),n.close()}},new class extends V{constructor(){super({kind:`legacyDrawing`,contentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,path:`../drawings/vmlDrawing{n}.vml`})}async emit(e,t){let n=e.images,r=n?n.length:0;if(r>0){let e=t.getSharedStates().get(An);for(let i=0;i<r;i++){let r=n[i],a=e?.get(r.resId);if(a)try{await Zs(t,r.id,a)}catch(e){t.log(`Unable to write legacy drawing image '${r.id}'`,e)}else t.log(`Legacy drawing image '${r.id}' has no resource ${r.resId} and was not written.`)}}let i=t.getXMLWriter();i.setValidationDisabled(!0),i.raw(e.xml),i.close()}},new class extends V{constructor(){super({kind:`embeddedPart`,contentType:Pr,relTypeUri:``})}getContentType(e){return e?.contentType||Pr}getRelTypeUri(e){return e?.type??``}getPath(e){return`./${Lr(e.name)}`}async emit(e,t){await Fr(e,t);let n=t.getXMLWriter();n.setValidationDisabled(!0),n.raw(e.xml??``),n.close()}},new class extends V{constructor(){super({kind:`pivotTable`,contentType:Xi,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`,path:`../pivotTables/pivotTable{n}.xml`})}getContentType(e){return e?.part?.contentType||Xi}async emit(e,t){let n=e.part;await Fr(n,t);let r=ra(t,e.cacheId);if(!r||!t.addRelationship(`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,r))throw Error(`Pivot table '${n.name??``}' has no cache with id ${e.cacheId}.`);let i=t.getXMLWriter();i.setValidationDisabled(!0),i.raw(n.xml??``),i.close()}},new class extends V{constructor(){super({kind:`comments`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,path:`../comments{n}.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`comments`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`});let r=[],i=new Map,a=e=>{let t=i.get(e);return t===void 0&&(t=r.length,r.push(e),i.set(e,t)),t},o=e.comments,s=[];for(let e=0;e<o.length;e++){let{comment:t,ref:n}=o[e];t.isNote()?s.push({ref:n,authorId:a(t.getAuthor()?.getDisplayName()??``),content:t.getRichContent()??t.getContent()}):s.push({ref:n,authorId:a(`tc={${t.getId().toUpperCase()}}`),content:eo(t)})}n.start(`authors`);for(let e=0;e<r.length;e++)n.start(`author`),n.text(r[e]),n.end(`author`);n.end(`authors`);let c=e.sheet.getStyles().getTheme();n.start(`commentList`);for(let e=0;e<s.length;e++){let t=s[e];n.start(`comment`,{ref:t.ref,authorId:t.authorId,shapeId:0}),n.start(`text`),to(n,t.content,c),n.end(`text`),n.end(`comment`)}n.end(`commentList`),n.end(`comments`),n.close()}},new class extends V{constructor(){super({kind:`threadedComments`,contentType:`application/vnd.ms-excel.threadedcomments+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/10/relationships/threadedComment`,path:`../threadedComments/threadedComment{n}.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`ThreadedComments`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments`,"xmlns:x":`http://schemas.openxmlformats.org/spreadsheetml/2006/main`});let r=e.comments;for(let e=0;e<r.length;e++){let{comment:t,ref:i}=r[e];if(t.isNote())continue;$s(n,i,t.getId(),t.getAuthor()?.getId(),t.getCreationDate(),t.getContent(),null,t.isResolved(),t.toJSON()?.mentions);let a=t.getReplies();for(let e=0;e<a.length;e++){let r=a[e];$s(n,i,r.getId(),r.getAuthor()?.getId(),r.getCreationDate(),r.getContent(),t.getId(),!1,r.toJSON().mentions)}}n.end(`ThreadedComments`),n.close()}},new class extends V{constructor(){super({kind:`persons`,contentType:`application/vnd.ms-excel.person+xml`,relTypeUri:`http://schemas.microsoft.com/office/2017/10/relationships/person`,path:`persons/person.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl(),n.start(`personList`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments`,"xmlns:x":`http://schemas.openxmlformats.org/spreadsheetml/2006/main`});let r=e.toArray();for(let e=0;e<r.length;e++){let t=r[e];n.empty(`person`,{displayName:t.getDisplayName(),id:ec(t.getId()),userId:t.getUserId()??t.getDisplayName(),providerId:t.getProviderId()??`None`})}n.end(`personList`),n.close()}},new class extends V{constructor(){super({kind:`table`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,path:`../tables/table{n}.xml`})}async emit(e,t){let n=t.getXMLWriter();n.decl();let r={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`},i=e.json,a=e.model;a.isShowHeaders(),r.id=_a(t,a),r.name=i.name?.trim(),r.displayName=i.name?.trim(),i.description&&(r.comment=i.description),r.ref=e.ref,i.headerRowCount!==1&&(r.headerRowCount=i.headerRowCount),i.totalsRowCount!==0&&(r.totalsRowCount=i.totalsRowCount),i.totalsRowShown||a.isShowTotals()||(r.totalsRowShown=`0`),n.start(`table`,r),a.isShowHeaders()&&la(t,n,a,i),va(t,n,a,i),ba(t,n,a,i),n.end(`table`),n.close()}},new class extends V{constructor(){super({kind:`slicers`,contentType:`application/vnd.ms-excel.slicer+xml`,relTypeUri:`http://schemas.microsoft.com/office/2007/relationships/slicer`,path:`../slicers/slicer{n}.xml`})}async emit(e,t){let r=t.getXMLWriter();r.decl(),r.start(`slicers`,Oa);let i=e.slicers;for(let e=0;e<i.length;e++){let t=i[e],a=t.toJSON(),o=t.getColumnCount(),s=t.getStyle();r.empty(`slicer`,{name:t.getName?.()??t.getCaption(),"xr10:uid":a?.uid??z(n.uuidV4),cache:t.getCacheName(),caption:t.getCaption(),startItem:a?.startItem||void 0,columnCount:o===1?void 0:o,showCaption:t.isShowCaption()?void 0:`0`,level:a?.level,style:s===`SlicerStyleLight1`?void 0:s,lockedPosition:t.isLockedPosition()?`1`:void 0,rowHeight:K(t.getRowHeight())})}r.end(`slicers`),r.close()}},new class extends V{constructor(){super({kind:`slicerCache`,contentType:`application/vnd.ms-excel.slicerCache+xml`,relTypeUri:`http://schemas.microsoft.com/office/2007/relationships/slicerCache`,path:`/xl/slicerCaches/slicerCache{n}.xml`})}async emit(e,t){let r=J(e);if(r)return void this.emitPivot(e,r,t);let i=e.getTable(),a=e.getColumn(),o=i?ga(t).get(i):void 0;if(!i||!a||o===void 0)throw Error(`The slicer '${e.getName?.()??``}' names a table that was not written.`);let s=e.toJSON(),c=e.getSortOrder(),l=e.getCrossFilter(),u=t.getXMLWriter();u.decl(),u.start(`slicerCacheDefinition`,{...Oa,name:e.getCacheName(),"xr10:uid":z(n.uuidV4),sourceName:a.getName()}),u.start(`extLst`),u.start(`x:ext`,{uri:un,"xmlns:x15":et}),u.empty(`x15:tableSlicerCache`,{tableId:o,column:a.getIndex()+1,sortOrder:c===Ta?void 0:Da[c],customListSort:s?.disabledCustomListSort?`0`:void 0,crossFilter:l===Ea?void 0:l}),u.end(`x:ext`),u.end(`extLst`),u.end(`slicerCacheDefinition`),u.close()}emitPivot(e,t,r){let i=r.getXMLWriter();i.decl(),i.start(`slicerCacheDefinition`,{...Oa,name:e.getCacheName(),"xr10:uid":z(n.uuidV4),sourceName:t.sourceName}),Ma(r,i,e),t.tabular&&ja(r,i,e,t),i.raw(t.body),i.end(`slicerCacheDefinition`),i.close()}},new class extends V{constructor(){super({kind:`timelines`,contentType:`application/vnd.ms-excel.timeline+xml`,relTypeUri:`http://schemas.microsoft.com/office/2011/relationships/timeline`,path:`../timelines/timeline{n}.xml`})}async emit(e,t){let r=t.getXMLWriter();r.decl(),r.start(`timelines`,{...Na,"mc:Ignorable":`x xr10`,"xmlns:x":Sa});let i=e.slicers;for(let e=0;e<i.length;e++){let t=i[e],a=t.toJSON(),o=a?.pivot?.timeline,s={name:t.getName?.()??t.getCaption(),"xr10:uid":a?.uid??z(n.uuidV4),cache:t.getCacheName(),caption:t.getCaption(),...o?.attributes};o?.body?(r.start(`timeline`,s),r.raw(o.body),r.end(`timeline`)):r.empty(`timeline`,s)}r.end(`timelines`),r.close()}},new class extends V{constructor(){super({kind:`timelineCache`,contentType:`application/vnd.ms-excel.timelineCache+xml`,relTypeUri:`http://schemas.microsoft.com/office/2011/relationships/timelineCache`,path:`/xl/timelineCaches/timelineCache{n}.xml`})}async emit(e,t){let r=J(e),i=t.getXMLWriter();i.decl(),i.start(`timelineCacheDefinition`,{...Na,"xmlns:x15":et,"mc:Ignorable":`xr10`,name:e.getCacheName(),"xr10:uid":z(n.uuidV4),sourceName:r.sourceName}),Ma(t,i,e),r.tabular&&((e,t,n)=>{let r=n._getTimelineState?.(),i=r?Qi(e,r.cacheId):null;if(!r||i===null)return void e.log(`The timeline '${n.getName?.()??``}' names a pivot cache that was not written; Excel repairs it.`);let a=aa(e),o=e=>ke(Math.floor(e),a),s=r.dates??r.range??{start:1,end:1},c=e=>Number(o(e).substring(0,4));t.start(`state`,{minimalRefreshVersion:6,lastRefreshVersion:6,pivotCacheId:i,filterType:r.range?`dateBetween`:`unknown`}),r.range&&t.empty(`selection`,{startDate:o(r.range.start),endDate:o(r.range.end)}),t.empty(`bounds`,{startDate:`${c(s.start)}-01-01T00:00:00`,endDate:`${c(s.end)+1}-01-01T00:00:00`}),t.end(`state`)})(t,i,e),i.raw(r.body),i.end(`timelineCacheDefinition`),i.close()}},new class extends V{constructor(){super({kind:`externalLink`,contentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml`,relTypeUri:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink`,path:`../externalLinks/externalLink{n}.xml`})}async emit(e,t){let n=t.getXMLWriter(),r=e.sources??[],i=r.findIndex(e=>e.role===`book`);i<0&&r.length>0&&(i=0);let a=null,o=null;for(let e=0;e<r.length;e++){let n=r[e],s=t.addExternal(n.type||`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath`,n.target).relId;e===i?a=s:n.role===`absoluteUrl`&&(o=s)}a||t.log(`External book has no path relationship; Excel cannot locate its source.`,e.sheetNames),n.decl();let s={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`};(e.mceIgnorable||o)&&(s[`xmlns:mc`]=`http://schemas.openxmlformats.org/markup-compatibility/2006`,s[`mc:Ignorable`]=`x14 xxl21`,s[`xmlns:x14`]=`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,s[`xmlns:xxl21`]=`http://schemas.microsoft.com/office/spreadsheetml/2021/extlinks2021`),n.start(`externalLink`,s);let c={"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`};a&&(c[`r:id`]=a),n.start(`externalBook`,c),o&&(n.start(`xxl21:alternateUrls`),n.empty(`xxl21:absoluteUrl`,{"r:id":o}),n.end(`xxl21:alternateUrls`)),function(e,t){let n=t.sheetNames,r=n?n.length:0;if(r!==0){e.start(`sheetNames`);for(let t=0;t<r;t++)e.empty(`sheetName`,{val:n[t]});e.end(`sheetNames`)}}(n,e),function(e,t){let n=t.definedNames,r=n?n.length:0;if(r!==0){e.start(`definedNames`);for(let t=0;t<r;t++){let r=n[t],i={name:r.name,refersTo:r.refersTo};r.sheetIndex!==void 0&&(i.sheetId=``+r.sheetIndex),e.empty(`definedName`,i)}e.end(`definedNames`)}}(n,e),function(e,t){let n=t.sheetDataSet,r=n?n.length:0;if(r!==0){e.start(`sheetDataSet`);for(let t=0;t<r;t++){let r=n[t],i={sheetId:``+r.sheetIndex};r.refreshError&&(i.refreshError=`1`);let a=r.data,o=a?a.length:0;if(o!==0){e.start(`sheetData`,i);for(let t=0;t<o;t++){let[n,r]=a[t];e.start(`row`,{r:``+(n+1)});let i=r.length;for(let t=0;t<i;t++){let[i,a]=r[t],o=a.length;for(let t=0;t<o;t++)nc(e,n,i+t,a.at(t))}e.end(`row`)}e.end(`sheetData`)}else e.empty(`sheetData`,i)}e.end(`sheetDataSet`)}}(n,e),n.end(`externalBook`),n.end(`externalLink`),n.close()}}],ic=`SheetXL Evaluation`,ac=`xl/worksheets/sheetSheetXLEvaluation.xml`,oc=`rIdSheetXLEvaluation`,sc=[`This workbook was exported from an unlicensed evaluation of SheetXL.`,`Your own sheets follow this one, unchanged.`,`To license SheetXL, visit https://www.sheetxl.com`],cc=e=>{let t=[...e.matchAll(/<sheet\b[^>]*\bsheetId="(\d+)"/g)].map(e=>parseInt(e[1],10)),n=new Set([...e.matchAll(/<sheet\b[^>]*\bname="([^"]*)"/g)].map(e=>e[1].toLowerCase())),r=ic;for(let e=2;n.has(r.toLowerCase());e++)r=`${ic} (${e})`;let i=`<sheet name="${r}" sheetId="${Math.max(0,...t)+1}" r:id="${oc}"/>`;return e.replace(/<sheets>/,`<sheets>${i}`).replace(/\blocalSheetId="(\d+)"/g,(e,t)=>`localSheetId="${parseInt(t,10)+1}"`).replace(/<workbookView\b([^>]*?)(\/?)>/,(e,t,n)=>{let r=/\bactiveTab="(\d+)"/.exec(t);return`<workbookView${(r?t.replace(/\bactiveTab="\d+"/,`activeTab="${parseInt(r[1],10)+1}"`):`${t} activeTab="1"`).replace(/\s*\bfirstTab="\d+"/,``)}${n}>`})},lc=async e=>{let t=new Oe(new Le(e)),n=new Lt,r=new zt(n,{lastModDate:new Date(1899,11,29,19,0,0)});try{for(let e of await t.getEntries()){if(e.directory||!(`getData`in e))continue;let t=e.filename;if(t===`xl/workbook.xml`)await r.add(t,new Le(new TextEncoder().encode(cc(await e.getData(new Bt)))));else if(t===`xl/_rels/workbook.xml.rels`){let n=await e.getData(new Bt),i=`<Relationship Id="${oc}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="${ac.slice(3)}"/>`;await r.add(t,new Le(new TextEncoder().encode(n.replace(`</Relationships>`,`${i}</Relationships>`))))}else if(t===`[Content_Types].xml`){let n=await e.getData(new Bt),i=`<Override PartName="/${ac}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`;await r.add(t,new Le(new TextEncoder().encode(n.replace(`</Types>`,`${i}</Types>`))))}else await r.add(t,new Le(await e.getData(new Lt)))}return await r.add(ac,new Le(new TextEncoder().encode(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetViews><sheetView workbookViewId="0"/></sheetViews><cols><col min="1" max="1" width="80" customWidth="1"/></cols><sheetData>${sc.map((e,t)=>`<row r="${t+1}"><c r="A${t+1}" t="inlineStr"><is><t>${e}</t></is></c></row>`).join(``)}</sheetData></worksheet>`))),await r.close(),await n.getData()}finally{await t.close()}},uc=e=>{let t=e.getPart(`xl/_rels/workbook.xml.rels`);if(!t)return null;let n=new Map;for(let e of xt(t.data)){if(!e.id)continue;let t=e.external?e.target:Bn(e.target.startsWith(`/`)?e.target:`xl/`+e.target);n.set(e.id,{type:e.type,target:t,external:e.external})}return n},dc=e=>{let t=e.getPart(`xl/workbook.xml`);return t?new TextDecoder(`utf-8`).decode(t.data):null},fc=e=>{let t=[],n=/<(\/?)ext(?=[\s/>])[^>]*?(\/?)>/g,r=0,i=0;for(let a=n.exec(e);a;a=n.exec(e))a[1]?(r--,r===0&&t.push(e.slice(i,a.index+a[0].length))):a[2]?r===0&&t.push(a[0]):(r===0&&(i=a.index),r++);return t},pc=e=>{let t=mc.get(e);if(t!==void 0)return t;let n=e.getPart(`xl/workbook.xml`),r=n?new TextDecoder(`utf-8`).decode(n.data):null;return mc.set(e,r),r},mc=new WeakMap,hc=async(e,t)=>{await A.load();let n=new ar;for(let e of rc)n.register(e);let r=gc,i=jn.createUint8Array({lastModDate:new Date(1899,11,29,19,0,0),level:r}),a=Sn.includes(t?.format)?Se(e):null,o=new Map,s=a?(e=>{let t=e.getPart(`xl/workbook.xml`);if(!t)return null;let n=new TextDecoder(`utf-8`).decode(t.data.subarray(0,4096)).match(/<fileVersion\b([^>]*)\/?>/);if(!n)return null;let r={};for(let e of n[1].matchAll(/([\w:]+)="([^"]*)"/g))r[e[1]]=e[2];return Object.keys(r).length>0?r:null})(a):null;s&&(t?.macroEnabled||delete s.codeName,o.set(Ia,s));let c=a?(e=>{let t=pc(e)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);return t?t[1]:null})(a):null;c!==null&&o.set(`calcId`,c);let l=a?(e=>{let t=pc(e);if(!t)return null;let n=t.lastIndexOf(`<extLst>`);if(n===-1)return null;let r=t.indexOf(`</extLst>`,n);if(r===-1||!/^<\/extLst>\s*<\/workbook>/.test(t.slice(r)))return null;let i=t.slice(n+8,r),a=uc(e),o=[];for(let e of fc(i)){let t=/^<ext\b[^>]*?\buri="([^"]*)"/.exec(e)?.[1]??``,n=[];for(let t of e.matchAll(/\sr:id="([^"]*)"/g)){if(n.some(e=>e.id===t[1]))continue;let e=a?.get(t[1]);n.push({id:t[1],type:e?.type??``,target:e?.target??null,external:e?.external??!1})}o.push({uri:t,xml:e,rels:n})}return o.length>0?o:null})(a):null;l!==null&&o.set(`workbookExts`,l);let u=a?(e=>{let t=dc(e);if(!t)return null;let n=/<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(t);if(!n)return null;let r=[...n[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map(e=>e[1]);if(r.length===0)return null;let i=uc(e);return i?r.map(e=>{let t=i.get(e);return t&&!t.external?t.target:null}):null})(a):null;u&&o.set(Va,u);let d=a?(e=>{let t=dc(e),n=t?uc(e):null;if(!t||!n)return null;let r=new Map;for(let e of t.matchAll(/<sheet\b([^>]*)\/?>/g)){let t=/\bsheetId="(\d+)"/.exec(e[1])?.[1],i=/\br:id="([^"]*)"/.exec(e[1])?.[1];if(!t||!i)continue;let a=n.get(i);a&&!a.external&&a.type===`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`&&r.set(parseInt(t,10),a.target)}return r.size>0?r:null})(a):null;d&&o.set(Ra,d),o.set(An,new Map),o.set(za,t?.macroEnabled??!1);let f=[],p=new rr(i,n,{strictDuplicateChildren:!0,onPartEmitted:t?.onPartEmitted,onWarning:(e,t,n)=>{f.push([e,t,n])},mapState:o,sourcePackage:a,macroEnabled:t?.macroEnabled??!1,template:t?.template??!1});p.addPart(`workbook`,e,`/xl/workbook.xml`),await p.waitEmit(),p.addPart(`propsCore`,{model:e}),p.addPart(`propsApp`,{model:e}),e.getProperties().getCustom().length>0&&p.addPart(`propsCustom`,{model:e});let m=await p.build();await te.isWatermarked()&&(m=await lc(m));let h=t?.progress?.onWarning;if(f.length&&h){let e=new Set;for(let[n,r,i]of f){let a=i??n;e.has(a)||(e.add(a),h.call(t.progress,n,r))}}return m.byteOffset===0&&m.byteLength===m.buffer.byteLength?m.buffer:m.slice().buffer},gc=1;export{hc as writeXLSX};
|