@sheetxl/mcp 0.8.0-beta.21 → 0.8.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{DO86fHS3WYzHN_Rv.js → 0jPw8-AyT6VbPuGO.js} +1 -1
- package/assets/{BAqvmoeYqG6dwX3I.js → 1U3DwsqHnOBwiGWn.js} +2 -2
- package/assets/{C1ZP9W2tiVQUwLqZ.js → 1dUPpOVZSeeylKHv.js} +1 -1
- package/assets/{DG3hKZ75iK2wrCcz.js → 3N6hsbh2WLceyO6T.js} +1 -1
- package/assets/{C2YOx4ianxuIIeMP.js → 4zyHb1mmcFfqwpjO.js} +1 -1
- package/assets/{BZJvWc-5DdAyHXFk.js → 8csqJ8aGOdnKlrLl.js} +1 -1
- package/assets/{CkGQV_x1SpyzePln.js → 91BKH9obG4IfBzhy.js} +440 -435
- package/assets/{FOKynZCiA0wU2Spf.js → 9AosCdy_xtdhLjN1.js} +1 -1
- package/assets/{BEOwJnsyIuMC4SaI.js → B5VTjL9m0R-Icfaz.js} +4 -4
- package/assets/{D2XmpdMAe0SAuQWo.js → B6pXiayrnDoDbQt1.js} +62 -62
- package/assets/{CL348305B-kpRYzz.js → BDq4iVyBh5lwX8pE.js} +1 -1
- package/assets/{vXmCJwJaPhkPVhy8.js → BHsqPfJZrdKTbPLP.js} +1 -1
- package/assets/{DP-m2vK0GTaYqQZM.js → BI5L_Ysr8s0TQxdg.js} +1 -1
- package/assets/{raa4clZOm0L5A0zR.js → BPZWfwUvFCLQInXN.js} +548 -548
- package/assets/{BC2Y5XPkMBKS6jQX.js → BRVEVVhj-8ZPrNyQ.js} +335 -334
- package/assets/{CB9TsE5n0FEyFnAz.js → BSdRn3B8QeJFflY6.js} +15 -15
- package/assets/{D5mfuGSeGXSDHj9-.js → BUGEQS5WdiLcI_0X.js} +1 -1
- package/assets/{IEmEQHg895CUpAQq.js → BUIjRIGTum7VuRFk.js} +1 -1
- package/assets/{B4Z_YneQya9mUTN5.js → BV49J63s68Mj6lgF.js} +1 -1
- package/assets/{BbsMdXiRzPW9BCEK.js → BXean6K6oDUxkzyd.js} +1 -1
- package/assets/{DOYXEbY_WslpyqXW.js → BZxJKqVEO7B23XwE.js} +5 -5
- package/assets/{D1HLIgumuUqrSyYB.js → BaaVzb7xXROiWUhT.js} +4 -4
- package/assets/{CC2hfzradb2KOvtU.js → Bf7Irm8Ua4s1T4xH.js} +1 -1
- package/assets/{DITcEcZJ58z5yOx7.js → BgwCdHyXKQYFAl1M.js} +1 -1
- package/assets/{8wMcuw3b1CFk-D5A.js → Bi65BKwwiZYYZprq.js} +1 -1
- package/assets/{BeMLPoHRWacCbpl2.js → BiC09_YKQPmlUklQ.js} +1 -1
- package/assets/{Q2j8yQZX1kL_MbbB.js → BkqENH8xJ3_NQnD5.js} +413 -413
- package/assets/{rejXA2fTAujW3QRv.js → BlxrCp7d-SeM-2DW.js} +266 -266
- package/assets/{CzQ2o7qoMm0K7KSb.js → BnGNMsqG5CzUzmX7.js} +4 -4
- package/assets/{DRiAktGToP73uwgm.js → BnK6HEqT4rf1RoOG.js} +223 -223
- package/assets/{bpjLDXWxL6nDt4Mv.js → BrfsWImwRtf54LUU.js} +1 -1
- package/assets/{BRiLNigzVwOBIxBy.js → BvKzhnweVF6GhjXh.js} +1 -1
- package/assets/{69EXDk0YRdjdM86i.js → Bx592y6pyOwTS2x7.js} +1 -1
- package/assets/{VcTnn2qw_4tmyctb.js → BygXDW3XTdtR38aA.js} +1 -1
- package/assets/{0ewqK5X66DZmbhVR.js → BzFIkeB_lheiTR7z.js} +1 -1
- package/assets/{CBTQ8dknYY7RVQgL.js → Bzp3UtK_6fqEVlV8.js} +8 -8
- package/assets/{Vo34QvIefEN595xl.js → C1PTfp7kVu3DqqZh.js} +5650 -5644
- package/assets/{B8URptQcztz4DRvS.js → C1yAmXrOu3iHV2cu.js} +24 -24
- package/assets/{CmUz8bVbJgWVT-OB.js → C4-0s3Udk3v4ytSn.js} +2 -2
- package/assets/{BMkhJwKP7goV0vlJ.js → C7zManFR1LEJXiwb.js} +1 -1
- package/assets/{CrLDmJU84Dbwl6DZ.js → C9wlvcFyjQA59G-_.js} +1 -1
- package/assets/{BneTvtEMcBoSiQnw.js → CAgQJrDxGEfoa7jn.js} +3 -3
- package/assets/{CME1jbwnNlBD66aW.js → CGB4xgirbgEIN3tg.js} +312 -312
- package/assets/{CpLUgqgBDtlfFRj3.js → CGxhgXj5qKj_Ubcp.js} +1 -1
- package/assets/{BJo3edG_rqch-Kw2.js → CHG9Q0uLAZdLXYVz.js} +73 -73
- package/assets/{BtiRDaBbNpPpKelt.js → CHnaSM8aMnQ2_VWW.js} +3 -3
- package/assets/{C0pbMKm0FzhOek9r.js → CHpBOpoM9bCvQyn0.js} +1 -1
- package/assets/{BABP2ffkRrOs7_Ym.js → CHqnRMWNpLKcAWWn.js} +1 -1
- package/assets/{CDKZI2IIZ9boo7zG.js → CKhbbbjQ-_auMp3n.js} +1 -1
- package/assets/{Deu2acNFlgo__Mcd.js → COVhUB0EotytQDHg.js} +2 -2
- package/assets/{KSE7OWDMxhbfYt82.js → CSGN4rAf7CYnBDEa.js} +22 -22
- package/assets/{KQGPPHM486XPeClF.js → CSKjFDYwiwn5XNnH.js} +2 -2
- package/assets/{DqxW6EBLDV_6Eegk.js → CT99WREgkKGpcDTO.js} +1 -1
- package/assets/{pg0OaBJVRnW7uSz5.js → CV729JV1mNyYCmrq.js} +1 -1
- package/assets/{CXb2mlCk1s1VFPHU.js → CXk5vwFfosghrTKo.js} +506 -506
- package/assets/{BU7t2vK3_DH_BbMd.js → CXqqaFgNeUVRGvEb.js} +2 -2
- package/assets/{_oaPA65Bm2idKW7f.js → CYCqMEoWsry6_hrc.js} +1 -1
- package/assets/{CDYMLTHkkpRV9igv.js → Cahhn5OLNqRYy-n8.js} +1 -1
- package/assets/{D7WSYqvuwNQjOIuO.js → CdtVv8YQ8PTmS4dz.js} +1 -1
- package/assets/{DjCHmGw-ixoQ6ZTA.js → CpYgsvYMxV5SbRp3.js} +2 -2
- package/assets/{CVlsdN5C8QL-Kljv.js → Cu4VAHfmjXWfTMPu.js} +1 -1
- package/assets/{DX0znk3xZmL1AyX8.js → CufFcGwo5x95LSb7.js} +1 -1
- package/assets/{C8huq6_Gvbeyf6Zy.js → CwNKcoA7na7Ess3a.js} +2 -2
- package/assets/{DpgBOcByebrqzUrC.js → D-MsUF59BhikcNZt.js} +3 -3
- package/assets/{Dzxe5kLF5GOfh0_l.js → D-N87jCOShDKTFDh.js} +1 -1
- package/assets/{CLT0k5UJYPmi8ked.js → D1tShC5iBlUoT2V2.js} +1 -1
- package/assets/{H89MX09YsAj7NAk3.js → D89TE5n8VKre9Gmp.js} +1 -1
- package/assets/{B8NDzDM0Gpwmkylq.js → D8dNiNpu9_L0NjGP.js} +1 -1
- package/assets/{BVDaUnmVOSaDw9e3.js → D9ja7F9irHf9Iovx.js} +1 -1
- package/assets/{CZ5v2vTWktJ7qAj1.js → DAqaOCEQLmZRjcdR.js} +1 -1
- package/assets/{Dnn8laImZHy8LouL.js → DEOkcuqKBFyRnY18.js} +1 -1
- package/assets/{D9F0224gK4j4Iuq9.js → DFQLoYLUO4TgDZPK.js} +1 -1
- package/assets/{DjbBTiei0H-BIJaN.js → DHHYGjNwlLvja3dS.js} +1 -1
- package/assets/{DsK1Adz0vo-1zPkp.js → DLbzfP7OOWhafkTq.js} +1 -1
- package/assets/{BWqKV3QuZX31WPsa.js → DQIQR1t3IkC9wshP.js} +1 -1
- package/assets/{fUmGsmpgGhd8eZn2.js → DRd8gdwcr3EqtGkb.js} +1 -1
- package/assets/{B_n6s7Kj4_5BWn1q.js → DawLBAaNAAmo_P3Y.js} +2 -2
- package/assets/{ChpUbgXIWuQFoXyL.js → Dbh-XVDw294AVLtl.js} +1 -1
- package/assets/{Dt5rA9gefJFLoaeI.js → DdDKDqtpIkzd-mXi.js} +2 -2
- package/assets/{DBgOeiZg40MS63pB.js → DdXp_iPwTOHAOvlL.js} +8 -8
- package/assets/{I-GZ5PL9n_Sv5yAJ.js → DdnALoxd3b8TLNla.js} +1 -1
- package/assets/{RFPO1vKnkkgwx5Bs.js → DevKDvFONeJ9euEq.js} +1 -1
- package/assets/{C1xe-BzKWT17OO8a.js → DgVCjvTw9Df1DV1x.js} +14 -14
- package/assets/{BM9zwvBRXNbO_uD-.js → DgYcOz0M0pmZf9x_.js} +2 -2
- package/assets/{-NFft0E2Wj6WH3X9.js → DmVQgN-N_HhYvakk.js} +1 -1
- package/assets/{vItpZkDtFsjwsJzb.js → DoScYrfTJOHXe-Ko.js} +70 -70
- package/assets/{D-INtJnS1lCrEs8s.js → DrLUi6vduqDLmQjl.js} +82 -82
- package/assets/{C27330XswujHKrLu.js → Ds5pLAwSN4lSbao6.js} +1 -1
- package/assets/{BrgptoFtJepXL46Z.js → DsBXjYAgTUXAAWZZ.js} +1 -1
- package/assets/{ChwSFUzi5mMzUwdW.js → DtvJg63vbDd6B7sD.js} +6 -6
- package/assets/{CBqpH_MpBSmQRaGE.js → Dvsld01DkmiNLjfP.js} +1 -1
- package/assets/{CudjOMo6X7FRW6ME.js → DxNK3HVEzFdUou54.js} +1 -1
- package/assets/{Bagfe_VVU6NyQNS6.js → DzGpZ2CQ1St9BF0y.js} +1 -1
- package/assets/{DuCNecyIYfZL27SV.js → E9mta1q4VtVUusy5.js} +1 -1
- package/assets/{CTLGMulzw-oFbgHy.js → GGcMgq3ScY7Tv0PE.js} +3 -3
- package/assets/{DRqBWzdn9KKN68o8.js → HVwvDMZh0ZGR-hRT.js} +11 -11
- package/assets/{AGdlSbOsXWO1oZAE.js → OfjHqYH31KqC5gVM.js} +1 -1
- package/assets/{1bSTbCnkTWvsV82p.js → OtMeAlbq6tyW5Hnc.js} +4 -4
- package/assets/{DnQM29yv6KQQOVfl.js → UgDy0WNXuV1sEnFW.js} +2 -2
- package/assets/{Cg05U6rbXUnaz0rA.js → VSbzBtGH0cA8VBsM.js} +34 -34
- package/assets/{CcaH1FoDC8o3dzqp.js → VWEaItb0XvCoRiCT.js} +1 -1
- package/assets/{4-DOIpV6Hjaymwy7.js → WSiEiaP-NUEr9UaB.js} +2 -2
- package/assets/{QMCI00ZCedkNJd8C.js → Z5tQQ6IW5YBjblWX.js} +1 -1
- package/assets/{DO9RVxvm9vQh8A_j.js → b-xk3WtCPBkC4E-Z.js} +2 -2
- package/assets/{NEzc406_2k2MuiE3.js → coTH4ab6CTEzw87b.js} +2 -2
- package/assets/{DwqgvpYiTLOQd5wm.js → do_DTptu6c_xHJoZ.js} +2 -2
- package/assets/{I_yb1hhLA5bYPpWx.js → hAVtdK6u2tlLI2cB.js} +1 -1
- package/assets/{_l84VPWmScznS-9F.js → hhpAcu3tINDLk7Ov.js} +5 -5
- package/assets/{H1ICg_-K5ADFNHJj.js → nSzQt54CIADky_tF.js} +1 -1
- package/assets/r-pk3RNq_HjMQFqr.js +14 -0
- package/assets/{CSd5XfU4JBASIwTI.js → ryaMyh_8KvmXVSJd.js} +1 -1
- package/assets/{B1l0k4ErELObdQKE.js → sYakw2x8dcnpUlsX.js} +3 -3
- package/assets/{M62BqR7TbmgOzAEW.js → tIoHMgrZeRHWyxos.js} +3 -3
- package/assets/{DmJc5VoPPwBBtLIG.js → tPa3RpqYRqCCCYf1.js} +1 -1
- package/assets/{B_RppF41PrYlelc_.js → v5XZSqLd9ZV3kqcA.js} +1 -1
- package/assets/{rhT64BvdSLOEwglQ.js → vazKaFOkHRriv7tX.js} +1 -1
- package/assets/{rIQ1pzaGFqvCfzOk.js → wWgI0JPoe_Wv0ceW.js} +1 -1
- package/assets/{CPmMYI4DPQcXrZ-g.js → xDx1vaNa2aCMs4_e.js} +1 -1
- package/assets/{BtjG4s0StUieGI5b.js → zJoBN2CJdxEV7vdh.js} +3 -3
- package/assets/{D3RuKyCyAzvT0bGL.js → ze6Q8BiEw9RClBzZ.js} +1 -1
- package/index.js +84 -84
- package/lib.js +1 -1
- package/licenses/dependencies.txt +56 -56
- package/package.json +2 -2
- package/screenshot-page/assets/0buGanYjZDNd9qAK.js +39 -0
- package/screenshot-page/assets/{Z7Av7oqfaK7wy7Eb.js → B668_VaGrdcWRbkC.js} +1 -1
- package/screenshot-page/assets/BGWgIYge30MP6Xhz.js +48 -0
- package/screenshot-page/assets/{CxithxkenssFkfTT.js → BGh5K-hHzy8mSVDr.js} +3 -3
- package/screenshot-page/assets/{CN3dPtUjDVvcnA4e.js → BIQ7KK-buzeddVA9.js} +1 -1
- package/screenshot-page/assets/BPRDGSNh0kvXRFUY.js +1 -0
- package/screenshot-page/assets/{1s5we6Eqz8n3o0X_.js → BRemww1df2HKLd_k.js} +1 -1
- package/screenshot-page/assets/{Yz4ksf-M05RGdHO3.js → Bm9-R9keVK5Sx-8o.js} +1 -1
- package/screenshot-page/assets/{B5ujsbfF1ZBkPI4d.js → BnZX0sxceYpvtg3I.js} +2 -2
- package/screenshot-page/assets/Bv2MgCMkg3EIQ6iE.js +13 -0
- package/screenshot-page/assets/BvaiwYJ5zZ0d5NRP.js +1 -0
- package/screenshot-page/assets/CAlTfQ_Gh-dURmUc.js +1 -0
- package/screenshot-page/assets/{C0rOvlmOfLDpClJ_.js → CCFxspvs5VzbYCfl.js} +1 -1
- package/screenshot-page/assets/CCqTTfzZokVHIzs2.js +1 -0
- package/screenshot-page/assets/CPs_ARK8JCyz-yZg.js +1 -0
- package/screenshot-page/assets/{DHUomRu_S2zcBWwt.js → CQ9C0-FcDZxrgC3T.js} +4 -4
- package/screenshot-page/assets/CUeMb48Ucrm5dK5u.js +1 -0
- package/screenshot-page/assets/CcOIj8c4N9KaWnD7.js +1 -0
- package/screenshot-page/assets/CjrHeIdacavAT_Ud.js +3 -0
- package/screenshot-page/assets/{D4VgxwLDPUfCxPS9.js → Cmv8bpHaTWZ7Lmbt.js} +1 -1
- package/screenshot-page/assets/CqccUqSMYlwlf2ZU.js +2 -0
- package/screenshot-page/assets/CvmImq-Kbg9srxNr.js +4 -0
- package/screenshot-page/assets/D-3wYBqe4SWdE6bx.js +2 -0
- package/screenshot-page/assets/D-FWnGDbZ9BRDzPR.js +1 -0
- package/screenshot-page/assets/D717DArr-KKL0U6R.js +1 -0
- package/screenshot-page/assets/{p9abCAJQdpScjZVK.js → D8-mayyvvVE1a4JB.js} +1 -1
- package/screenshot-page/assets/DM27mE98BNk1T18I.js +1 -0
- package/screenshot-page/assets/DN-T1DyRMKvxEJSK.js +1 -0
- package/screenshot-page/assets/DRdL1GN4SP7P8lSP.js +2 -0
- package/screenshot-page/assets/DcnhaY93LQd7kVdH.js +2 -0
- package/screenshot-page/assets/{CzZu7Fd_VeHHL-4i.js → DdusmeEPaU7CWT6e.js} +1 -1
- package/screenshot-page/assets/{Bdt92xZzFotX0vdt.js → DfT1DMR1b5kiyYiV.js} +1 -1
- package/screenshot-page/assets/DigI6jhjHePzLgg1.js +1 -0
- package/screenshot-page/assets/DrDLCC0R2IV5VJd7.js +1 -0
- package/screenshot-page/assets/{BtydzT-AjL_LBr8x.js → Dwv5Z_c2XS-hm-5y.js} +1 -1
- package/screenshot-page/assets/Dx0pUf3G4Oa3dGOk.js +1 -0
- package/screenshot-page/assets/JcgNMFaj_uqHSFxr.js +1 -0
- package/screenshot-page/assets/{DQeIWKasFD3DnWL7.js → U_8_wApwfA7KmIG3.js} +11 -11
- package/screenshot-page/assets/WZprjN2sb7HlraOb.js +2 -0
- package/screenshot-page/assets/{CBuH_YHDn7A9E_hX.js → adhmz3N2Kgq5eW66.js} +2 -2
- package/screenshot-page/assets/qjoaeEBxfKWCHmqK.js +2 -0
- package/screenshot-page/assets/{Blg5f-jAtZfGnZ71.js → zALFdtoGJBN6m2Bn.js} +1 -1
- package/screenshot-page/assets/{BLON9pILfrgdZqAM.js → zd1Z2E1NjFp2EWC7.js} +3 -3
- package/screenshot-page/index.html +8 -8
- package/types/scripting-api.json +7065 -7064
- package/types/scripting.d.ts +29 -9
- package/assets/DrgkN0g7OHuD4iD6.js +0 -14
- package/screenshot-page/assets/9WplgXo__vp3e1Su.js +0 -2
- package/screenshot-page/assets/BEzCH6tp_dlxe7BH.js +0 -1
- package/screenshot-page/assets/BJvuevnsIw3DXQds.js +0 -2
- package/screenshot-page/assets/BVx7CEdRItIR30Fz.js +0 -1
- package/screenshot-page/assets/Ble2ESZnJzZnd3cc.js +0 -1
- package/screenshot-page/assets/Bozva6Wr4B8Q5QZN.js +0 -2
- package/screenshot-page/assets/Brp37MPC60tt9V3N.js +0 -1
- package/screenshot-page/assets/Bs65RHirk11sxOB9.js +0 -39
- package/screenshot-page/assets/Bu5h0ACtvNxDBmqw.js +0 -1
- package/screenshot-page/assets/BwFvwFIcX0dmcBt7.js +0 -1
- package/screenshot-page/assets/CHZ1925OpIa8ssZn.js +0 -1
- package/screenshot-page/assets/COO3CwHTbCgxybBd.js +0 -1
- package/screenshot-page/assets/CR8Rj_GpSbIqbaEO.js +0 -13
- package/screenshot-page/assets/CV9T0juyAiRmwTR-.js +0 -4
- package/screenshot-page/assets/ClC7zkHPp6egPrjL.js +0 -2
- package/screenshot-page/assets/CtS8qZB4_3skg_zL.js +0 -1
- package/screenshot-page/assets/CwutTi2EnNm_hyVj.js +0 -1
- package/screenshot-page/assets/CzijGQrSoteeqwmH.js +0 -2
- package/screenshot-page/assets/DG6q1MKITeSM4XMx.js +0 -1
- package/screenshot-page/assets/DHTXoT_pArB1opyI.js +0 -48
- package/screenshot-page/assets/DP2wwd1IM_gQtEaG.js +0 -1
- package/screenshot-page/assets/Ja-xcEStEdmh2Gwb.js +0 -2
- package/screenshot-page/assets/ODq-dKb9mTtqEIJl.js +0 -1
- package/screenshot-page/assets/VF7dro9jrDEAX6kD.js +0 -3
- package/screenshot-page/assets/bdWMVOcMKRI8kCDE.js +0 -1
- package/screenshot-page/assets/kJwY8fmEeWlAtTAc.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.22
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { p as e, tt as t } from "./
|
|
8
|
-
import { d as n, en as s, f as r, vt as o } from "./
|
|
9
|
-
import { u as a } from "./
|
|
10
|
-
import { $
|
|
11
|
-
import { a as K, i as Q, n as J, o as W, r as X } from "./
|
|
7
|
+
import { p as e, tt as t } from "./DHHYGjNwlLvja3dS.js";
|
|
8
|
+
import { d as n, en as s, f as r, vt as o } from "./BSdRn3B8QeJFflY6.js";
|
|
9
|
+
import { u as a } from "./BUGEQS5WdiLcI_0X.js";
|
|
10
|
+
import { $ as l, $r as i, B as d, Da as u, E as c, Ir as f, Ji as m, Nr as p, P as h, Qi as g, Rt as w, Sa as v, Ta as F, Ti as b, Ua as y, Vn as I, Xr as x, aa as A, br as C, ca as E, ci as S, da as P, eo as k, f as M, h as T, ht as R, ia as O, ja as N, jn as $, k as L, kr as _, la as D, m as V, mi as U, n as H, rn as B, rt as j, wn as z, x as G, xi as q } from "./C1PTfp7kVu3DqqZh.js";
|
|
11
|
+
import { a as K, i as Q, n as J, o as W, r as X } from "./sYakw2x8dcnpUlsX.js";
|
|
12
12
|
var Y = [
|
|
13
13
|
"Jan",
|
|
14
14
|
"Feb",
|
|
@@ -61,24 +61,24 @@ var Y = [
|
|
|
61
61
|
default: return null;
|
|
62
62
|
}
|
|
63
63
|
}, te = (e, t) => {
|
|
64
|
-
const n = e.fields ?? [], s =
|
|
65
|
-
if (!n.some(
|
|
66
|
-
const r =
|
|
64
|
+
const n = e.fields ?? [], s = A(e.records, n.length);
|
|
65
|
+
if (!n.some(P)) return s;
|
|
66
|
+
const r = A(e.items, n.length), o = e.recordCount ?? 0, a = s.slice();
|
|
67
67
|
for (let e = 0; e < n.length; e++) {
|
|
68
68
|
const l = n[e];
|
|
69
|
-
if (!
|
|
69
|
+
if (!P(l)) continue;
|
|
70
70
|
const i = l.group, d = s[i.base] ?? [], u = r[i.base] ?? [], c = new Int32Array(u.length);
|
|
71
71
|
for (let e = 0; e < u.length; e++) {
|
|
72
|
-
const n = i.range ? ee(i.range, i.items.length,
|
|
72
|
+
const n = i.range ? ee(i.range, i.items.length, q(u[e]), t) : i.discrete?.[e] ?? null;
|
|
73
73
|
c[e] = n ?? -1;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const f = new Array(o);
|
|
76
76
|
for (let e = 0; e < o; e++) {
|
|
77
77
|
const t = c[d[e]];
|
|
78
78
|
if (void 0 === t || t < 0) return null;
|
|
79
|
-
|
|
79
|
+
f[e] = t;
|
|
80
80
|
}
|
|
81
|
-
a[e] =
|
|
81
|
+
a[e] = f;
|
|
82
82
|
}
|
|
83
83
|
return a;
|
|
84
84
|
}, ne = (e) => String(Number(e.toPrecision(12))), se = (e, t) => {
|
|
@@ -231,10 +231,10 @@ var Y = [
|
|
|
231
231
|
if (t.includes(e)) return !1;
|
|
232
232
|
const i = [];
|
|
233
233
|
oe(n[e].formula, (e) => {
|
|
234
|
-
const t = n.findIndex((t) =>
|
|
234
|
+
const t = n.findIndex((t) => d(t.name, e));
|
|
235
235
|
return t >= 0 && i.push(t), t >= 0 ? "" : null;
|
|
236
236
|
});
|
|
237
|
-
for (const r of i) if (
|
|
237
|
+
for (const r of i) if (b(n[r])) {
|
|
238
238
|
if (!l(r, [...t, e])) return !1;
|
|
239
239
|
} else s.includes(r) || s.push(r);
|
|
240
240
|
return o.set(e, r.length), a.set(e, n[e].formula), r.push({
|
|
@@ -242,21 +242,21 @@ var Y = [
|
|
|
242
242
|
expression: ""
|
|
243
243
|
}), !0;
|
|
244
244
|
}, i = [];
|
|
245
|
-
for (const [t, s] of (e.dataFields ?? []).entries()) if (
|
|
245
|
+
for (const [t, s] of (e.dataFields ?? []).entries()) if (b(n[s.field])) {
|
|
246
246
|
if (!l(s.field, [])) return null;
|
|
247
247
|
i.push({
|
|
248
248
|
data: t,
|
|
249
249
|
formula: o.get(s.field)
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const u = (e, t) => {
|
|
253
253
|
if (null !== t) return null;
|
|
254
|
-
const r = n.findIndex((t) =>
|
|
255
|
-
return r >= 0 ? ae(
|
|
254
|
+
const r = n.findIndex((t) => d(t.name, e));
|
|
255
|
+
return r >= 0 ? ae(b(n[a = r]) ? s.length + o.get(a) : s.indexOf(a)) : null;
|
|
256
256
|
var a;
|
|
257
257
|
};
|
|
258
258
|
for (const e of r) {
|
|
259
|
-
const t = oe(a.get(e.field),
|
|
259
|
+
const t = oe(a.get(e.field), u);
|
|
260
260
|
if (null === t) return null;
|
|
261
261
|
e.expression = t;
|
|
262
262
|
}
|
|
@@ -343,41 +343,41 @@ var Y = [
|
|
|
343
343
|
percent: 13,
|
|
344
344
|
percentDiff: 14
|
|
345
345
|
}, Ie = (e, t, n, s) => {
|
|
346
|
-
const r =
|
|
346
|
+
const r = l.peek(), o = e.fields, a = t.fields;
|
|
347
347
|
if (!r || !o || !a || o.length !== a.length) return null;
|
|
348
|
-
if (
|
|
348
|
+
if (v(e)) return {
|
|
349
349
|
cells: [],
|
|
350
|
-
...
|
|
350
|
+
...B,
|
|
351
351
|
rowPageCount: 0,
|
|
352
352
|
columnPageCount: 0,
|
|
353
|
-
header:
|
|
353
|
+
header: E(e),
|
|
354
354
|
rowLines: [],
|
|
355
355
|
columnLines: [],
|
|
356
356
|
viewValues: [],
|
|
357
357
|
firstKey: null,
|
|
358
358
|
...s?.roles ? { roles: /* @__PURE__ */ new Map() } : {}
|
|
359
359
|
};
|
|
360
|
-
const i =
|
|
360
|
+
const i = f(e, a), d = i ? s?.filters : null;
|
|
361
361
|
if (i && !d) return null;
|
|
362
362
|
const u = o.some((e) => e.items?.some((e) => e.calculated));
|
|
363
363
|
if (u && !d?.calculatedRecords) return null;
|
|
364
364
|
const c = de(e, t);
|
|
365
365
|
if (!c || c.measures.length > 0 && !d?.fieldValues) return null;
|
|
366
366
|
if ((e.dataFields ?? []).some((e) => void 0 === ye[e.showDataAs ?? "normal"] || void 0 === pe[e.subtotal ?? "sum"])) return null;
|
|
367
|
-
const
|
|
368
|
-
if (!
|
|
369
|
-
const { items:
|
|
367
|
+
const m = xe(e, t, n, d?.calculatedRecords, c.operands);
|
|
368
|
+
if (!m) return null;
|
|
369
|
+
const { items: p, records: g, values: w, n: F } = m, b = (e) => !!e && (!e.noRecords || P(e)), y = e.form ?? "compact", I = (e) => {
|
|
370
370
|
const t = [];
|
|
371
371
|
for (const n of e ?? []) {
|
|
372
372
|
if (n === ce) {
|
|
373
373
|
t.push({
|
|
374
374
|
field: n,
|
|
375
|
-
form:
|
|
375
|
+
form: y
|
|
376
376
|
});
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
379
|
const e = o[n], s = e?.subtotals;
|
|
380
|
-
if (!e || !
|
|
380
|
+
if (!e || !b(a[n])) return null;
|
|
381
381
|
if (u && s && s.some((e) => "default" !== e)) return null;
|
|
382
382
|
t.push({
|
|
383
383
|
field: n,
|
|
@@ -385,33 +385,33 @@ var Y = [
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
return t;
|
|
388
|
-
},
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
return
|
|
388
|
+
}, x = I(e.rowFields), A = I(e.columnFields), C = e.pageFields ?? [];
|
|
389
|
+
if (!x || !A || C.some((e) => !b(a[e.field]))) return null;
|
|
390
|
+
const S = h(e, s?.slicerFields);
|
|
391
|
+
return S.pageFields?.some((e) => !b(a[e.field])) ? null : Te(e, t, p, x, A, Se(r, S, p, g, w, x, A, F, d?.keep, d?.records, c.operands.length, d?.fieldValues, !0), n, !0 === s?.roles, "columns" === s?.cellOrder);
|
|
392
392
|
}, xe = (e, t, n, s, r = []) => {
|
|
393
|
-
const o = t.fields?.length ?? 0, a =
|
|
393
|
+
const o = t.fields?.length ?? 0, a = T(t);
|
|
394
394
|
if (!t.records) return null;
|
|
395
395
|
const l = te(t, n.isDate1904());
|
|
396
396
|
if (!l) return null;
|
|
397
|
-
const i = !0 === t.fields?.some(
|
|
398
|
-
const s = !t.fields?.[e]?.noRecords, r = s ? u[e] : l[e] ?? [], o = s ? d[e] : a[e], i = new Array(
|
|
399
|
-
for (let e = 0; e < c; e++) i[e] =
|
|
400
|
-
for (let e = 0; e <
|
|
397
|
+
const i = !0 === t.fields?.some(P), d = i ? A(t.items, o) : a, u = i ? A(t.records, o) : l, c = t.recordCount ?? 0, f = s?.count ?? 0, m = c + f, p = (e, n) => {
|
|
398
|
+
const s = !t.fields?.[e]?.noRecords, r = s ? u[e] : l[e] ?? [], o = s ? d[e] : a[e], i = new Array(m);
|
|
399
|
+
for (let e = 0; e < c; e++) i[e] = q(o[r[e]]);
|
|
400
|
+
for (let e = 0; e < f; e++) i[c + e] = n?.[e] ?? null;
|
|
401
401
|
return i;
|
|
402
|
-
},
|
|
402
|
+
}, h = [...(e.dataFields ?? []).map((e, t) => p(e.field, s?.values[t])), ...r.map((e) => p(e))];
|
|
403
403
|
return {
|
|
404
404
|
items: a,
|
|
405
405
|
records: s ? l.map((e, t) => e.concat(s.ids[t] ?? [])) : l,
|
|
406
|
-
values:
|
|
407
|
-
n:
|
|
406
|
+
values: h,
|
|
407
|
+
n: m
|
|
408
408
|
};
|
|
409
|
-
}, Ae = async (e, t, n, s, r, o, a,
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
414
|
-
const
|
|
409
|
+
}, Ae = async (e, t, n, s, r, o, a, i, d) => {
|
|
410
|
+
const u = l.peek(), c = e.dataFields?.[r];
|
|
411
|
+
if (!u || !e.fields || !c || void 0 === pe[c.subtotal ?? "sum"]) return null;
|
|
412
|
+
const f = [e.rowFields, e.columnFields].map((e) => (e ?? []).filter((e) => e !== ce)), m = f.findIndex((e) => e.includes(s)), p = f[m];
|
|
413
|
+
if (!p) return null;
|
|
414
|
+
const h = p.slice(0, p.indexOf(s)), g = e.fields.map((e) => {
|
|
415
415
|
const { blankRowAfter: t, showItemsWithNoData: n, sort: s, ...r } = e;
|
|
416
416
|
return {
|
|
417
417
|
...r,
|
|
@@ -421,46 +421,46 @@ var Y = [
|
|
|
421
421
|
return n;
|
|
422
422
|
})
|
|
423
423
|
};
|
|
424
|
-
}), { columnGrandTotals:
|
|
425
|
-
...
|
|
426
|
-
fields:
|
|
427
|
-
rowFields: [...
|
|
424
|
+
}), { columnGrandTotals: w, ...v } = e, { showDataAs: F, ...b } = c, y = {
|
|
425
|
+
...v,
|
|
426
|
+
fields: g,
|
|
427
|
+
rowFields: [...h, s],
|
|
428
428
|
columnFields: [],
|
|
429
|
-
dataFields: [
|
|
429
|
+
dataFields: [b],
|
|
430
430
|
rowGrandTotals: !1
|
|
431
|
-
},
|
|
432
|
-
...
|
|
433
|
-
values: [
|
|
434
|
-
} :
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
438
|
-
const { items:
|
|
431
|
+
}, I = i ? {
|
|
432
|
+
...i,
|
|
433
|
+
values: [i.values[r] ?? []]
|
|
434
|
+
} : i, x = de(y, t);
|
|
435
|
+
if (!x || x.measures.length > 0 && !d) return null;
|
|
436
|
+
const A = xe(y, t, n, I, x.operands);
|
|
437
|
+
if (!A) return null;
|
|
438
|
+
const { items: C, records: E, values: S, n: P } = A, k = y.rowFields.map((e) => ({
|
|
439
439
|
field: e,
|
|
440
440
|
form: "compact"
|
|
441
441
|
}));
|
|
442
442
|
let M;
|
|
443
443
|
if (a) {
|
|
444
|
-
const e = 0 ===
|
|
445
|
-
M = new Uint8Array(
|
|
446
|
-
for (let t = 0; t <
|
|
444
|
+
const e = 0 === m ? 1 : 2;
|
|
445
|
+
M = new Uint8Array(P);
|
|
446
|
+
for (let t = 0; t < P; t++) {
|
|
447
447
|
const n = a[t];
|
|
448
448
|
M[t] = (n & e ? 1 : 0) | (3 === n ? 2 : 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const T =
|
|
452
|
-
return
|
|
453
|
-
if (0 !== e.kind || e.path.length !==
|
|
454
|
-
const n =
|
|
451
|
+
const T = x.measures.length > 0 ? await Ee(u, x, y, C, E, S, k, [], P, o, M, d) : void 0, R = Se(u, y, C, E, S, k, [], P, o, M, x.operands.length, T), O = (t, n) => e.fields[t].items?.[n]?.item ?? n, N = /* @__PURE__ */ new Map(), $ = R.columns.length;
|
|
452
|
+
return R.rows.forEach((e, t) => {
|
|
453
|
+
if (0 !== e.kind || e.path.length !== h.length + 1) return;
|
|
454
|
+
const n = h.map((t, n) => O(t, e.path[n])).join(",");
|
|
455
455
|
let r = N.get(n);
|
|
456
456
|
r || N.set(n, r = {
|
|
457
457
|
ids: [],
|
|
458
458
|
totals: []
|
|
459
|
-
}), r.ids.push(
|
|
459
|
+
}), r.ids.push(O(s, e.path[h.length])), r.totals.push(R.values[t * $]);
|
|
460
460
|
}), {
|
|
461
|
-
outer:
|
|
461
|
+
outer: h,
|
|
462
462
|
groups: N,
|
|
463
|
-
records:
|
|
463
|
+
records: E
|
|
464
464
|
};
|
|
465
465
|
}, Ce = (e, t, n) => {
|
|
466
466
|
const s = new Uint32Array(t).fill(fe), r = new Uint8Array(t), o = e.items;
|
|
@@ -650,62 +650,62 @@ var Y = [
|
|
|
650
650
|
return null !== e.data && e.data > 0 && (s.dataField = e.data), s;
|
|
651
651
|
});
|
|
652
652
|
}, Te = (e, t, n, r, o, l, d, u, c) => {
|
|
653
|
-
const f = e.fields,
|
|
654
|
-
if (e === ce) return
|
|
653
|
+
const f = e.fields, m = t.fields, p = e.dataFields ?? [], h = (t) => t === ce ? e.valuesCaption ?? "Values" : f[t].name ?? m[t].name, g = (e, t) => {
|
|
654
|
+
if (e === ce) return p[t]?.name ?? "";
|
|
655
655
|
const s = f[e].items?.[t];
|
|
656
656
|
if (void 0 !== s?.name) return s.name;
|
|
657
|
-
const r =
|
|
658
|
-
return null === r ?
|
|
659
|
-
},
|
|
660
|
-
const n =
|
|
657
|
+
const r = q(n[e][s?.item ?? t]);
|
|
658
|
+
return null === r ? S : r;
|
|
659
|
+
}, w = (e, t) => {
|
|
660
|
+
const n = g(e, t);
|
|
661
661
|
if ("number" == typeof n) {
|
|
662
|
-
const o = f[e].items?.[t]?.item ?? t, a = void 0 === (f[e].numberFormat ??
|
|
663
|
-
return s(d, a ?
|
|
662
|
+
const o = f[e].items?.[t]?.item ?? t, a = void 0 === (f[e].numberFormat ?? m[e].numberFormat) && i(m[e], o);
|
|
663
|
+
return s(d, a ? x(y(m[e], o), d) : x(f[r = e].numberFormat ?? m[r].numberFormat, d), n);
|
|
664
664
|
}
|
|
665
665
|
var r;
|
|
666
666
|
return a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
667
|
-
},
|
|
668
|
-
if (void 0 !== e.item) return
|
|
667
|
+
}, v = (e) => {
|
|
668
|
+
if (void 0 !== e.item) return g(e.field, e.item);
|
|
669
669
|
const t = f[e.field].items ?? [];
|
|
670
670
|
if (!t.some((e) => e.hidden)) return "(All)";
|
|
671
|
-
const n = t.flatMap((e, t) =>
|
|
672
|
-
return 1 === n.length ?
|
|
673
|
-
},
|
|
671
|
+
const n = t.flatMap((e, t) => _(e) && !e.hidden ? [t] : []);
|
|
672
|
+
return 1 === n.length ? g(e.field, n[0]) : "(Multiple Items)";
|
|
673
|
+
}, b = e.grandTotalCaption ?? "Grand Total", I = u ? /* @__PURE__ */ new Map() : null, A = (e, t) => e === ce ? {
|
|
674
674
|
kind: "dataCaption",
|
|
675
675
|
data: t
|
|
676
676
|
} : {
|
|
677
677
|
kind: "item",
|
|
678
678
|
field: e,
|
|
679
679
|
rank: t
|
|
680
|
-
},
|
|
680
|
+
}, C = (e) => e === ce ? null : {
|
|
681
681
|
kind: "fieldCaption",
|
|
682
682
|
field: e
|
|
683
|
-
},
|
|
683
|
+
}, P = (e, t) => 2 === e.kind && t === b ? { kind: "grandTotal" } : null, k = 0 === r.length && 0 === o.length && 0 === p.length, T = k ? {
|
|
684
684
|
firstHeaderRow: 0,
|
|
685
685
|
firstDataRow: 0,
|
|
686
686
|
firstDataCol: 0
|
|
687
|
-
} :
|
|
687
|
+
} : E(e), R = k ? [] : Me(l.rows, l.functions), N = k ? [] : Me(l.columns, l.functions), $ = F({
|
|
688
688
|
...e,
|
|
689
|
-
header:
|
|
690
|
-
rowLines:
|
|
691
|
-
columnLines:
|
|
692
|
-
}),
|
|
689
|
+
header: T,
|
|
690
|
+
rowLines: R,
|
|
691
|
+
columnLines: N
|
|
692
|
+
}), L = l.columns.length, D = (e) => "row" === e ? r : o, V = (t) => {
|
|
693
693
|
switch (t.kind) {
|
|
694
694
|
case "pageCaption": {
|
|
695
695
|
const n = e.pageFields[t.page].field;
|
|
696
|
-
return [
|
|
696
|
+
return [h(n), {
|
|
697
697
|
kind: "fieldCaption",
|
|
698
698
|
field: n
|
|
699
699
|
}];
|
|
700
700
|
}
|
|
701
701
|
case "pageItem": {
|
|
702
702
|
const n = e.pageFields[t.page];
|
|
703
|
-
return [
|
|
703
|
+
return [v(n), {
|
|
704
704
|
kind: "pageItem",
|
|
705
705
|
page: t.page
|
|
706
706
|
}];
|
|
707
707
|
}
|
|
708
|
-
case "dataCaption": return [
|
|
708
|
+
case "dataCaption": return [p[t.data]?.name ?? null, {
|
|
709
709
|
kind: "dataCaption",
|
|
710
710
|
data: t.data
|
|
711
711
|
}];
|
|
@@ -713,27 +713,27 @@ var Y = [
|
|
|
713
713
|
case "columnHeader": return [e.columnHeaderCaption ?? "Column Labels", { kind: "columnHeader" }];
|
|
714
714
|
case "fieldCaption": {
|
|
715
715
|
const e = D(t.axis)[t.level].field;
|
|
716
|
-
return [
|
|
716
|
+
return [h(e), C(e)];
|
|
717
717
|
}
|
|
718
718
|
case "label": {
|
|
719
719
|
const e = D(t.axis)[t.level].field, n = t.line.path[t.level];
|
|
720
|
-
return [
|
|
720
|
+
return [g(e, n), A(e, n)];
|
|
721
721
|
}
|
|
722
722
|
case "total": {
|
|
723
723
|
const e = ("row" === t.axis ? l.rows : l.columns)[t.line.index], n = ((e, t) => {
|
|
724
|
-
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ?
|
|
725
|
-
if (2 === t.kind) return n ? `Total ${s}` :
|
|
726
|
-
const r = t.path.length - 1, o = e[r].field, a =
|
|
724
|
+
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ? p[t.data]?.name ?? "" : "";
|
|
725
|
+
if (2 === t.kind) return n ? `Total ${s}` : b;
|
|
726
|
+
const r = t.path.length - 1, o = e[r].field, a = w(o, t.path[r]);
|
|
727
727
|
if (null !== t.function) {
|
|
728
728
|
const e = we[l.functions[t.function]];
|
|
729
|
-
return (n || t.across) && null !== t.data ? `${a} ${e} of ${
|
|
729
|
+
return (n || t.across) && null !== t.data ? `${a} ${e} of ${h(p[t.data].field)}` : `${a} ${e}`;
|
|
730
730
|
}
|
|
731
731
|
return f[o]?.subtotalCaption ?? (n ? `${a} ${s}` : `${a} Total`);
|
|
732
732
|
})(D(t.axis), e);
|
|
733
|
-
return [n,
|
|
733
|
+
return [n, P(e, n)];
|
|
734
734
|
}
|
|
735
735
|
case "value": {
|
|
736
|
-
const n = t.row.index *
|
|
736
|
+
const n = t.row.index * L + t.column.index, s = l.states[n];
|
|
737
737
|
let r = null;
|
|
738
738
|
return 0 === s ? (r = l.values[n], e.showError && a.isError(r) && (r = e.errorCaption ?? "")) : 1 === s && (r = !1 === e.showEmpty ? 0 : ((e) => {
|
|
739
739
|
if (void 0 === e) return null;
|
|
@@ -744,90 +744,90 @@ var Y = [
|
|
|
744
744
|
})(e.emptyCaption)), [r, null];
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
}, U = new
|
|
748
|
-
const n =
|
|
747
|
+
}, U = new O.Builder(), B = $.top, j = $.pages.reduce((e, t) => Math.max(e, t.column + 2), 0), z = (e, t) => {
|
|
748
|
+
const n = M($, e, t);
|
|
749
749
|
if (!n) return;
|
|
750
750
|
const [s, r] = V(n);
|
|
751
751
|
((e, t, n) => {
|
|
752
|
-
|
|
753
|
-
})(e -
|
|
752
|
+
I && n && I.set(e + "," + t, n);
|
|
753
|
+
})(e - B, t, r), null !== s && (c ? U.pushAt(t, e - B, s) : U.pushAt(e - B, t, s));
|
|
754
754
|
};
|
|
755
755
|
if (c) {
|
|
756
|
-
const e = Math.max(
|
|
757
|
-
for (let t = 0; t < e; t++) for (let e = 0; e <
|
|
758
|
-
} else for (let e = 0; e <
|
|
759
|
-
const t = e <
|
|
760
|
-
for (let n = 0; n < t; n++)
|
|
756
|
+
const e = Math.max(j, $.columns.length);
|
|
757
|
+
for (let t = 0; t < e; t++) for (let e = 0; e < $.rows.length; e++) t < (e < B ? j : $.columns.length) && z(e, t);
|
|
758
|
+
} else for (let e = 0; e < $.rows.length; e++) {
|
|
759
|
+
const t = e < B ? j : $.columns.length;
|
|
760
|
+
for (let n = 0; n < t; n++) z(e, n);
|
|
761
761
|
}
|
|
762
|
-
if (
|
|
763
|
-
const t =
|
|
762
|
+
if (k) {
|
|
763
|
+
const t = H(e);
|
|
764
764
|
return {
|
|
765
765
|
cells: U.build()?.tuples ?? [],
|
|
766
766
|
rows: 1,
|
|
767
767
|
columns: 1,
|
|
768
768
|
rowPageCount: t.rows,
|
|
769
769
|
columnPageCount: t.columns,
|
|
770
|
-
header:
|
|
770
|
+
header: T,
|
|
771
771
|
rowLines: [],
|
|
772
772
|
columnLines: [],
|
|
773
773
|
viewValues: [],
|
|
774
774
|
firstKey: null,
|
|
775
|
-
...
|
|
775
|
+
...I ? { roles: I } : {}
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
const
|
|
778
|
+
const G = (e, t) => {
|
|
779
779
|
const n = [];
|
|
780
780
|
return e.forEach((e, s) => {
|
|
781
781
|
e.field !== ce && n.push(s < t.path.length ? t.path[s] : -1);
|
|
782
782
|
}), n;
|
|
783
|
-
}, Q = (e, t) => K(e.data ?? t.data ?? 0, [...
|
|
783
|
+
}, Q = (e, t) => K(e.data ?? t.data ?? 0, [...G(r, e), ...G(o, t)]), [J] = l.rows, [W] = l.columns, X = J && W && 3 !== J.kind && 3 !== W.kind ? Q(J, W) : null, Y = [], Z = (e) => 1 === e.kind && null !== e.function;
|
|
784
784
|
l.rows.forEach((t, n) => {
|
|
785
|
-
3 === t.kind || Z(t) || (
|
|
786
|
-
const o = l.states[n *
|
|
785
|
+
3 === t.kind || Z(t) || (G(r, t), l.columns.forEach((s, r) => {
|
|
786
|
+
const o = l.states[n * L + r];
|
|
787
787
|
if (3 === s.kind || Z(s) || 0 !== o && 1 !== o) return;
|
|
788
|
-
let i = 0 === o ? l.values[n *
|
|
788
|
+
let i = 0 === o ? l.values[n * L + r] : 0;
|
|
789
789
|
e.showError && a.isError(i) && (i = e.errorCaption || 0), Y.push([Q(t, s), i]);
|
|
790
790
|
}));
|
|
791
791
|
});
|
|
792
|
-
const ee =
|
|
792
|
+
const ee = H(e);
|
|
793
793
|
return {
|
|
794
794
|
cells: U.build()?.tuples ?? [],
|
|
795
|
-
rows:
|
|
796
|
-
columns:
|
|
795
|
+
rows: $.rows.length - B,
|
|
796
|
+
columns: $.columns.length,
|
|
797
797
|
rowPageCount: ee.rows,
|
|
798
798
|
columnPageCount: ee.columns,
|
|
799
|
-
header:
|
|
800
|
-
rowLines:
|
|
801
|
-
columnLines:
|
|
799
|
+
header: T,
|
|
800
|
+
rowLines: R,
|
|
801
|
+
columnLines: N,
|
|
802
802
|
viewValues: Y,
|
|
803
803
|
firstKey: X,
|
|
804
|
-
...
|
|
804
|
+
...I ? { roles: I } : {}
|
|
805
805
|
};
|
|
806
|
-
},
|
|
807
|
-
const
|
|
806
|
+
}, Re = (e, t, n, r, o = !1, l, d) => {
|
|
807
|
+
const u = Ie(e, t, r, {
|
|
808
808
|
filters: l,
|
|
809
|
-
slicerFields:
|
|
809
|
+
slicerFields: d
|
|
810
810
|
});
|
|
811
|
-
if (!
|
|
812
|
-
const
|
|
813
|
-
if (m -
|
|
811
|
+
if (!u) return null;
|
|
812
|
+
const c = u.rowPageCount > 0 ? u.rowPageCount + 1 : 0, f = u.rowPageCount > 0 ? 3 * u.columnPageCount - 1 : 0, { rowStart: m, colStart: p } = n;
|
|
813
|
+
if (m - c < 0) return null;
|
|
814
814
|
const h = {
|
|
815
|
-
rowStart: m -
|
|
815
|
+
rowStart: m - c,
|
|
816
816
|
colStart: p,
|
|
817
|
-
rowEnd: m +
|
|
818
|
-
colEnd: p + Math.max(
|
|
819
|
-
}, g = e.fields, w = t.fields, v =
|
|
820
|
-
const n = g[e], o = n.numberFormat ?? w[e].numberFormat, l =
|
|
821
|
-
const n =
|
|
822
|
-
var
|
|
823
|
-
const
|
|
817
|
+
rowEnd: m + u.rows - 1,
|
|
818
|
+
colEnd: p + Math.max(u.columns, f) - 1
|
|
819
|
+
}, g = e.fields, w = t.fields, v = T(t), F = (e, t) => {
|
|
820
|
+
const n = g[e], o = n.numberFormat ?? w[e].numberFormat, l = x(o, r), d = P(w[e]), u = v[e], c = (n.items ?? []).filter((e) => void 0 !== e.item && void 0 === e.type), f = c.length > 0 ? c : u.map((e, t) => ({ item: t })), m = f.map((t) => {
|
|
821
|
+
const n = q(u[t.item]), c = i(w[e], t.item), f = null === n ? "(blank)" : "number" == typeof n ? s(r, c ? (m = t.item, void 0 === o ? x(y(w[e], m), r) : l) : l, n) : a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
822
|
+
var m;
|
|
823
|
+
const p = d && c ? f : n;
|
|
824
824
|
return void 0 !== t.name ? {
|
|
825
|
-
value:
|
|
826
|
-
text:
|
|
825
|
+
value: p,
|
|
826
|
+
text: f,
|
|
827
827
|
name: t.name
|
|
828
828
|
} : {
|
|
829
|
-
value:
|
|
830
|
-
text:
|
|
829
|
+
value: p,
|
|
830
|
+
text: f
|
|
831
831
|
};
|
|
832
832
|
}), p = {
|
|
833
833
|
name: n.name ?? w[e].name,
|
|
@@ -835,7 +835,7 @@ var Y = [
|
|
|
835
835
|
};
|
|
836
836
|
if (t) {
|
|
837
837
|
const e = void 0 !== t.item ? (n.items ?? [])[t.item]?.item : void 0;
|
|
838
|
-
p.page = void 0 !== e ?
|
|
838
|
+
p.page = void 0 !== e ? f.findIndex((t) => t.item === e) : -1;
|
|
839
839
|
}
|
|
840
840
|
return p;
|
|
841
841
|
}, b = (e) => (e ?? []).filter((e) => -2 !== e);
|
|
@@ -851,100 +851,100 @@ var Y = [
|
|
|
851
851
|
...b(e.columnFields).map((e) => F(e)),
|
|
852
852
|
...(e.pageFields ?? []).map((e) => F(e.field, e))
|
|
853
853
|
],
|
|
854
|
-
values:
|
|
854
|
+
values: u.viewValues,
|
|
855
855
|
block: {
|
|
856
856
|
anchor: {
|
|
857
857
|
row: m,
|
|
858
858
|
column: p
|
|
859
859
|
},
|
|
860
860
|
...o ? { blocked: !0 } : {},
|
|
861
|
-
...null !==
|
|
861
|
+
...null !== u.firstKey ? { first: u.firstKey } : {}
|
|
862
862
|
}
|
|
863
863
|
},
|
|
864
864
|
size: {
|
|
865
|
-
rows:
|
|
866
|
-
columns:
|
|
865
|
+
rows: u.rows,
|
|
866
|
+
columns: u.columns
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
|
-
},
|
|
870
|
-
const o = /* @__PURE__ */ new Map(),
|
|
871
|
-
if (0 ===
|
|
872
|
-
const
|
|
873
|
-
for (const s of
|
|
874
|
-
const a = s.field, l =
|
|
869
|
+
}, Oe = async (e, t, n, r) => {
|
|
870
|
+
const o = /* @__PURE__ */ new Map(), u = (e.filters ?? []).filter((t) => U(t) || e.rowFields?.includes(t.field) || e.columnFields?.includes(t.field)), c = e.fields?.some((e) => e.items?.some((e) => e.calculated)), f = e.dataFields?.some((e) => b(t.fields?.[e.field]));
|
|
871
|
+
if (0 === u.length && !c && !f) return { keep: o };
|
|
872
|
+
const m = T(t);
|
|
873
|
+
for (const s of u.filter(U)) {
|
|
874
|
+
const a = s.field, l = m[a];
|
|
875
875
|
if (!l) continue;
|
|
876
|
-
const i =
|
|
877
|
-
for (let e = 0; e < l.length; e++) d[e] = i ? i[e] :
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
else o.set(a,
|
|
876
|
+
const i = D(s.condition) ? Le(e, t, l, a, n) : null, d = new Array(l.length);
|
|
877
|
+
for (let e = 0; e < l.length; e++) d[e] = i ? i[e] : q(l[e]);
|
|
878
|
+
const u = await $e(s.condition, d, n, r), c = o.get(a);
|
|
879
|
+
if (c) for (let e = 0; e < u.length; e++) c[e] &= u[e];
|
|
880
|
+
else o.set(a, u);
|
|
881
881
|
}
|
|
882
|
-
const
|
|
883
|
-
const l = t.fields ?? [],
|
|
884
|
-
if (1 !==
|
|
885
|
-
const
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
882
|
+
const p = c && r ? await (async (e, t, n, r, o) => {
|
|
883
|
+
const l = t.fields ?? [], u = e.fields ?? [], c = l.flatMap((e, t) => e.calculatedItems?.length ? [t] : []), f = e.dataFields ?? [];
|
|
884
|
+
if (1 !== c.length || f.some((e) => b(l[e.field]) || !ue.has(e.subtotal ?? "sum"))) return null;
|
|
885
|
+
const m = c[0], p = l[m].calculatedItems, h = te(t, n.isDate1904());
|
|
886
|
+
if (!h) return null;
|
|
887
|
+
const g = T(t), w = T({
|
|
888
888
|
...t,
|
|
889
889
|
fields: l.map(({ group: e, ...t }) => t)
|
|
890
|
-
}),
|
|
891
|
-
if (!
|
|
892
|
-
const
|
|
893
|
-
const n =
|
|
890
|
+
}), v = (e.rowFields ?? []).filter((e) => e >= 0), F = (e.columnFields ?? []).filter((e) => e >= 0), y = v.includes(m) ? v : F.includes(m) ? F : null;
|
|
891
|
+
if (!y) return null;
|
|
892
|
+
const I = y.slice(0, y.indexOf(m)), A = [...y.slice(y.indexOf(m) + 1), ...y === v ? F : v], C = [...I, ...A], E = t.recordCount ?? 0, P = (e, t) => {
|
|
893
|
+
const n = u[e]?.items, s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
894
894
|
return !(n && (!s || s.hidden) || o?.get(e) && 0 === o.get(e)[t]);
|
|
895
|
-
},
|
|
896
|
-
const n =
|
|
895
|
+
}, k = (e, t) => {
|
|
896
|
+
const n = u[e.field]?.items;
|
|
897
897
|
if (void 0 !== e.item) return n?.[e.item]?.item === t;
|
|
898
898
|
const s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
899
899
|
return !n || !!s && !s.hidden;
|
|
900
|
-
},
|
|
901
|
-
const o =
|
|
902
|
-
return "number" == typeof o && (l[
|
|
903
|
-
}),
|
|
904
|
-
let t =
|
|
905
|
-
return void 0 === t &&
|
|
900
|
+
}, M = e.pageFields ?? [], O = x(l[m].numberFormat ?? 14, n), N = (e) => g[m].findIndex((t, r) => {
|
|
901
|
+
const o = q(t);
|
|
902
|
+
return "number" == typeof o && (l[m].dates || i(l[m], r)) ? d(s(n, O, o), e) : d(null === o ? S : R(o), e);
|
|
903
|
+
}), $ = /* @__PURE__ */ new Map(), L = new Map(p.map((e) => [e.item, e.formula])), _ = (e) => {
|
|
904
|
+
let t = $.get(e);
|
|
905
|
+
return void 0 === t && $.set(e, t = $.size), t;
|
|
906
906
|
};
|
|
907
|
-
for (const e of
|
|
908
|
-
if (null === t || !
|
|
909
|
-
const n =
|
|
910
|
-
return n < 0 ? null : (
|
|
907
|
+
for (const e of p) if (null === oe(e.formula, (e, t) => {
|
|
908
|
+
if (null === t || !d(l[m].name, e)) return null;
|
|
909
|
+
const n = N(t);
|
|
910
|
+
return n < 0 ? null : (L.has(n) || _(n), "");
|
|
911
911
|
})) return null;
|
|
912
|
-
const
|
|
913
|
-
column:
|
|
914
|
-
values:
|
|
912
|
+
const D = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), U = f.map((e) => ({
|
|
913
|
+
column: h[e.field],
|
|
914
|
+
values: w[e.field],
|
|
915
915
|
fold: e.subtotal ?? "sum"
|
|
916
|
-
})),
|
|
917
|
-
for (let e = 0; e <
|
|
918
|
-
if (!
|
|
919
|
-
if (!
|
|
916
|
+
})), H = $.size;
|
|
917
|
+
for (let e = 0; e < E; e++) {
|
|
918
|
+
if (!M.every((t) => k(t, h[t.field][e]))) continue;
|
|
919
|
+
if (!C.every((t) => P(t, h[t][e]))) continue;
|
|
920
920
|
let t = "";
|
|
921
|
-
for (const n of
|
|
922
|
-
|
|
923
|
-
const n =
|
|
921
|
+
for (const n of I) t += h[n][e] + ",";
|
|
922
|
+
V.has(t) || V.set(t, e);
|
|
923
|
+
const n = $.get(h[m][e]);
|
|
924
924
|
if (void 0 === n) continue;
|
|
925
925
|
let s = t;
|
|
926
|
-
for (const t of
|
|
927
|
-
let r =
|
|
926
|
+
for (const t of A) s += h[t][e] + ",";
|
|
927
|
+
let r = D.get(s);
|
|
928
928
|
r || (r = {
|
|
929
|
-
sums:
|
|
930
|
-
errors:
|
|
931
|
-
},
|
|
929
|
+
sums: f.map(() => new Array(H).fill(0)),
|
|
930
|
+
errors: f.map(() => new Array(H).fill(void 0))
|
|
931
|
+
}, D.set(s, r));
|
|
932
932
|
const { sums: o, errors: l } = r;
|
|
933
|
-
|
|
934
|
-
const d =
|
|
933
|
+
U.forEach(({ column: t, values: s, fold: r }, i) => {
|
|
934
|
+
const d = q(s[t[e]]);
|
|
935
935
|
"sum" === r ? "number" == typeof d ? o[i][n] += d : a.isError(d) && (l[i][n] ??= d) : ("countNums" === r ? "number" == typeof d : null !== d) && (o[i][n] += 1);
|
|
936
936
|
});
|
|
937
937
|
}
|
|
938
|
-
const
|
|
939
|
-
const t =
|
|
940
|
-
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing &&
|
|
938
|
+
const B = A.map((e) => {
|
|
939
|
+
const t = u[e]?.items;
|
|
940
|
+
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing && P(e, t.item) ? [t.item] : []) : g[e].map((e, t) => t);
|
|
941
941
|
});
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
for (const [e, t] of
|
|
942
|
+
if (B.reduce((e, t) => e * t.length, V.size) > 5e5) return null;
|
|
943
|
+
const j = [];
|
|
944
|
+
for (const [e, t] of V) {
|
|
945
945
|
const n = (e, s, r) => {
|
|
946
|
-
if (e !==
|
|
947
|
-
else
|
|
946
|
+
if (e !== B.length) for (const t of B[e]) n(e + 1, [...s, t], r + t + ",");
|
|
947
|
+
else j.push({
|
|
948
948
|
exemplar: t,
|
|
949
949
|
path: s,
|
|
950
950
|
key: r
|
|
@@ -952,45 +952,45 @@ var Y = [
|
|
|
952
952
|
};
|
|
953
953
|
n(0, [], e);
|
|
954
954
|
}
|
|
955
|
-
const
|
|
956
|
-
if (0 ===
|
|
955
|
+
const z = j.length;
|
|
956
|
+
if (0 === z) return {
|
|
957
957
|
count: 0,
|
|
958
958
|
ids: l.map(() => []),
|
|
959
|
-
values:
|
|
959
|
+
values: f.map(() => [])
|
|
960
960
|
};
|
|
961
|
-
const
|
|
962
|
-
for (let e = 0; e <
|
|
963
|
-
const s =
|
|
961
|
+
const G = f.length * H, K = (e, t) => e * H + t, Q = (e, t) => G + e * p.length + t, J = [];
|
|
962
|
+
for (let e = 0; e < f.length; e++) for (let t = 0; t < H; t++) J.push(j.map(({ key: n }) => {
|
|
963
|
+
const s = D.get(n);
|
|
964
964
|
return s ? s.errors[e][t] ?? s.sums[e][t] : 0;
|
|
965
965
|
}));
|
|
966
966
|
const W = [];
|
|
967
|
-
for (let e = 0; e <
|
|
968
|
-
const n = oe(
|
|
967
|
+
for (let e = 0; e < f.length; e++) for (let t = 0; t < p.length; t++) {
|
|
968
|
+
const n = oe(p[t].formula, (t, n) => {
|
|
969
969
|
if (null === n) return null;
|
|
970
|
-
const s =
|
|
971
|
-
return ae(r >= 0 ? Q(e, r) : K(e,
|
|
970
|
+
const s = N(n), r = p.findIndex((e) => e.item === s);
|
|
971
|
+
return ae(r >= 0 ? Q(e, r) : K(e, $.get(s)));
|
|
972
972
|
});
|
|
973
973
|
if (null === n) return null;
|
|
974
974
|
W.push({
|
|
975
975
|
expression: n,
|
|
976
|
-
coords: le(Q(e, t),
|
|
976
|
+
coords: le(Q(e, t), z)
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
const X = await r.evaluateBatch({
|
|
980
|
-
values: ie(J,
|
|
980
|
+
values: ie(J, z),
|
|
981
981
|
formulas: W
|
|
982
|
-
}), Y = l.map(() => []), Z =
|
|
983
|
-
|
|
984
|
-
const r =
|
|
985
|
-
Y[s].push(s ===
|
|
982
|
+
}), Y = l.map(() => []), Z = f.map(() => []), ee = (e, t, n, s) => {
|
|
983
|
+
h.forEach((n, s) => {
|
|
984
|
+
const r = A.indexOf(s);
|
|
985
|
+
Y[s].push(s === m ? t : r >= 0 ? e.path[r] : n[e.exemplar] ?? 0);
|
|
986
986
|
}), Z.forEach((e, t) => {
|
|
987
987
|
e.push(t === n ? s : null);
|
|
988
988
|
});
|
|
989
989
|
};
|
|
990
|
-
return
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const a = X[o *
|
|
990
|
+
return j.forEach((e, t) => {
|
|
991
|
+
p.forEach(({ item: n }, s) => {
|
|
992
|
+
f.forEach((r, o) => {
|
|
993
|
+
const a = X[o * p.length + s].getValueAt(t, 0) ?? 0;
|
|
994
994
|
if ("sum" !== (r.subtotal ?? "sum") && "number" == typeof a) for (let t = 0; t < Math.round(a); t++) ee(e, n, o, 1);
|
|
995
995
|
else ee(e, n, o, a);
|
|
996
996
|
});
|
|
@@ -1000,14 +1000,14 @@ var Y = [
|
|
|
1000
1000
|
ids: Y,
|
|
1001
1001
|
values: Z
|
|
1002
1002
|
};
|
|
1003
|
-
})(e, t, n, r, o) : void 0,
|
|
1003
|
+
})(e, t, n, r, o) : void 0, h = u.filter((e) => !U(e)).map((e, t) => ({
|
|
1004
1004
|
filter: e,
|
|
1005
1005
|
index: t
|
|
1006
|
-
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index),
|
|
1007
|
-
let
|
|
1008
|
-
const
|
|
1009
|
-
for (const { filter: s } of
|
|
1010
|
-
const a = await Ae(e, t, n, s.field, s.dataField, o,
|
|
1006
|
+
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index), g = (t.recordCount ?? 0) + (p?.count ?? 0);
|
|
1007
|
+
let w;
|
|
1008
|
+
const v = e.rowFields ?? [];
|
|
1009
|
+
for (const { filter: s } of h) {
|
|
1010
|
+
const a = await Ae(e, t, n, s.field, s.dataField, o, w, p, r);
|
|
1011
1011
|
if (!a) continue;
|
|
1012
1012
|
const l = /* @__PURE__ */ new Set();
|
|
1013
1013
|
for (const [e, t] of a.groups) {
|
|
@@ -1017,38 +1017,38 @@ var Y = [
|
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
if (0 === l.size) continue;
|
|
1020
|
-
|
|
1021
|
-
const i = a.outer.map((e) => a.records[e]), d = a.records[s.field], u =
|
|
1022
|
-
for (let e = 0; e <
|
|
1023
|
-
if (!(
|
|
1020
|
+
w ??= new Uint8Array(g).fill(3);
|
|
1021
|
+
const i = a.outer.map((e) => a.records[e]), d = a.records[s.field], u = v.includes(s.field) ? 1 : 2;
|
|
1022
|
+
for (let e = 0; e < g; e++) {
|
|
1023
|
+
if (!(w[e] & u)) continue;
|
|
1024
1024
|
let t = "";
|
|
1025
1025
|
for (let n = 0; n < i.length; n++) t += (n > 0 ? "," : "") + i[n][e];
|
|
1026
|
-
l.has(`${t}|${d[e]}`) && (
|
|
1026
|
+
l.has(`${t}|${d[e]}`) && (w[e] &= ~u);
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1030
|
-
const
|
|
1031
|
-
if (!
|
|
1032
|
-
const
|
|
1033
|
-
if (!
|
|
1034
|
-
const
|
|
1029
|
+
const F = f && r ? await (async (e, t, n, s, r, o, a) => {
|
|
1030
|
+
const i = l.peek(), d = de(e, t);
|
|
1031
|
+
if (!i || !d) return null;
|
|
1032
|
+
const u = xe(e, t, n, a, d.operands);
|
|
1033
|
+
if (!u) return null;
|
|
1034
|
+
const c = (t) => (t ?? []).map((t) => ({
|
|
1035
1035
|
field: t,
|
|
1036
1036
|
form: t === ce ? e.form ?? "compact" : e.fields?.[t]?.form ?? "compact"
|
|
1037
1037
|
}));
|
|
1038
|
-
return Ee(
|
|
1039
|
-
})(e, t, n, r, o,
|
|
1038
|
+
return Ee(i, d, e, u.items, u.records, u.values, c(e.rowFields), c(e.columnFields), u.n, r, o, s);
|
|
1039
|
+
})(e, t, n, r, o, w, p) : void 0;
|
|
1040
1040
|
return {
|
|
1041
1041
|
keep: o,
|
|
1042
|
-
...
|
|
1043
|
-
...
|
|
1044
|
-
...
|
|
1042
|
+
...w ? { records: w } : {},
|
|
1043
|
+
...p ? { calculatedRecords: p } : {},
|
|
1044
|
+
...F ? { fieldValues: F } : {}
|
|
1045
1045
|
};
|
|
1046
1046
|
}, Ne = (e, t) => {
|
|
1047
1047
|
const n = e.filters;
|
|
1048
1048
|
if (!n) return e;
|
|
1049
1049
|
let s = !1;
|
|
1050
1050
|
const r = n.map((e) => {
|
|
1051
|
-
const n = e.condition &&
|
|
1051
|
+
const n = e.condition && p(e.condition, t);
|
|
1052
1052
|
return n === e.condition ? e : (s = !0, {
|
|
1053
1053
|
...e,
|
|
1054
1054
|
condition: n
|
|
@@ -1061,10 +1061,10 @@ var Y = [
|
|
|
1061
1061
|
}, $e = async (e, t, n, s) => {
|
|
1062
1062
|
const r = t.length, o = new Uint8Array(r);
|
|
1063
1063
|
if (0 === r) return o;
|
|
1064
|
-
const a = new
|
|
1064
|
+
const a = new c();
|
|
1065
1065
|
for (let e = 0; e < r; e++) null !== t[e] && a.setValueAt(e, 0, t[e]);
|
|
1066
1066
|
let l = !1;
|
|
1067
|
-
return await
|
|
1067
|
+
return await V({
|
|
1068
1068
|
conditions: [e],
|
|
1069
1069
|
runtime: n,
|
|
1070
1070
|
calculation: s ?? null,
|
|
@@ -1087,19 +1087,19 @@ var Y = [
|
|
|
1087
1087
|
}
|
|
1088
1088
|
}), l || o.fill(1), o;
|
|
1089
1089
|
}, Le = (e, t, n, r, o) => {
|
|
1090
|
-
const l = e.fields?.[r],
|
|
1091
|
-
for (const e of l?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name &&
|
|
1092
|
-
const
|
|
1090
|
+
const l = e.fields?.[r], d = /* @__PURE__ */ new Map();
|
|
1091
|
+
for (const e of l?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name && d.set(e.item, e.name);
|
|
1092
|
+
const u = l?.numberFormat ?? t.fields?.[r]?.numberFormat, c = x(u, o), f = (e) => void 0 === u ? x(y(t.fields?.[r], e), o) : c, m = new Array(n.length);
|
|
1093
1093
|
for (let e = 0; e < n.length; e++) {
|
|
1094
|
-
const l =
|
|
1094
|
+
const l = d.get(e);
|
|
1095
1095
|
if (void 0 !== l) {
|
|
1096
|
-
|
|
1096
|
+
m[e] = l;
|
|
1097
1097
|
continue;
|
|
1098
1098
|
}
|
|
1099
|
-
const
|
|
1100
|
-
null ===
|
|
1099
|
+
const u = q(n[e]);
|
|
1100
|
+
null === u ? m[e] = S : "number" == typeof u ? m[e] = s(o, i(t.fields?.[r], e) ? f(e) : c, u) : "boolean" == typeof u ? m[e] = u ? "TRUE" : "FALSE" : a.isError(u) ? m[e] = u.getLabel() : m[e] = String(u);
|
|
1101
1101
|
}
|
|
1102
|
-
return
|
|
1102
|
+
return m;
|
|
1103
1103
|
}, _e = (e) => {
|
|
1104
1104
|
const t = e.getCoords(), n = t.colEnd - t.colStart + 1, s = t.rowEnd - t.rowStart, r = e.getWorksheet(), o = r.getRange({
|
|
1105
1105
|
rowStart: t.rowStart,
|
|
@@ -1185,8 +1185,8 @@ var Y = [
|
|
|
1185
1185
|
} : a.isError(e) ? {
|
|
1186
1186
|
t: "e",
|
|
1187
1187
|
v: e.getCode()
|
|
1188
|
-
} : e,
|
|
1189
|
-
const r = e.fields ?? [], o =
|
|
1188
|
+
} : e, je = (e, t) => (t && "number" == typeof e ? "date:" : "") + m(q(e)), ze = (e, t, n, s = !1) => {
|
|
1189
|
+
const r = e.fields ?? [], o = A(e.items, r.length), a = /\smissingItemsLimit="0"/.test(e.rest ?? ""), l = ((e) => {
|
|
1190
1190
|
const t = /* @__PURE__ */ new Set();
|
|
1191
1191
|
return e.map((e, n) => {
|
|
1192
1192
|
const s = "" === e ? `Field${n + 1}` : e;
|
|
@@ -1194,13 +1194,13 @@ var Y = [
|
|
|
1194
1194
|
for (let e = 2; t.has(r.toLocaleLowerCase()); e++) r = `${s}${e}`;
|
|
1195
1195
|
return t.add(r.toLocaleLowerCase()), r;
|
|
1196
1196
|
});
|
|
1197
|
-
})(t.columns.map((e) => e.header)),
|
|
1197
|
+
})(t.columns.map((e) => e.header)), d = /* @__PURE__ */ new Map();
|
|
1198
1198
|
r.forEach((e, t) => {
|
|
1199
1199
|
const n = e.name.toLocaleLowerCase();
|
|
1200
|
-
e.noRecords ||
|
|
1200
|
+
e.noRecords || d.has(n) || d.set(n, t);
|
|
1201
1201
|
});
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1202
|
+
const u = t.recordCount, c = r.map(() => -1), f = r.map((e, t) => o[t].map(() => -1)), m = [], p = [], h = [], g = [], w = [], v = [], F = [], y = (e, t, n) => {
|
|
1203
|
+
g[t] = n.items, v[t] = n.items.length, F[t] = !0, f[e] = ((e, t) => {
|
|
1204
1204
|
const n = /* @__PURE__ */ new Map();
|
|
1205
1205
|
return t.forEach((e, t) => {
|
|
1206
1206
|
n.set(e, t);
|
|
@@ -1208,109 +1208,109 @@ var Y = [
|
|
|
1208
1208
|
})(r[e].group.items, n.items);
|
|
1209
1209
|
};
|
|
1210
1210
|
t.columns.forEach((e, t) => {
|
|
1211
|
-
const n =
|
|
1212
|
-
void 0 !== n && (
|
|
1213
|
-
const
|
|
1214
|
-
for (let t = 0; t <
|
|
1211
|
+
const n = d.get(l[t].toLocaleLowerCase());
|
|
1212
|
+
void 0 !== n && (d.delete(l[t].toLocaleLowerCase()), c[n] = t);
|
|
1213
|
+
const b = new Int32Array(e.values.length).fill(-1), I = [], x = [], A = new Array(u);
|
|
1214
|
+
for (let t = 0; t < u; t++) {
|
|
1215
1215
|
const n = e.ids[t];
|
|
1216
|
-
let s =
|
|
1217
|
-
s < 0 && (s =
|
|
1216
|
+
let s = b[n];
|
|
1217
|
+
s < 0 && (s = b[n] = I.length, I.push(Be(e.values[n])), x.push(e.dates || !!e.dateIds?.has(n))), A[t] = s;
|
|
1218
1218
|
}
|
|
1219
|
-
const
|
|
1220
|
-
if (void 0 !== n &&
|
|
1219
|
+
const C = (e) => void 0 !== n && (!!r[n].dates || i(r[n], e)), E = I.length, S = void 0 !== n ? !0 === r[n].inline : I.every((e) => "number" == typeof e || "object" == typeof e && "z" === e?.t), k = [];
|
|
1220
|
+
if (void 0 !== n && S) {
|
|
1221
1221
|
const e = /* @__PURE__ */ new Map();
|
|
1222
|
-
for (let t = 0; t <
|
|
1222
|
+
for (let t = 0; t < E; t++) e.set(je(I[t], x[t]), t);
|
|
1223
1223
|
o[n].forEach((t, s) => {
|
|
1224
|
-
|
|
1224
|
+
f[n][s] = e.get(je(t, C(s))) ?? -1;
|
|
1225
1225
|
});
|
|
1226
1226
|
} else if (void 0 !== n) {
|
|
1227
1227
|
const e = /* @__PURE__ */ new Map();
|
|
1228
|
-
for (let t = 0; t <
|
|
1228
|
+
for (let t = 0; t < E; t++) e.set(je(I[t], x[t]), t);
|
|
1229
1229
|
const t = new Set(r[n].calculatedItems?.map((e) => e.item));
|
|
1230
1230
|
o[n].forEach((s, r) => {
|
|
1231
1231
|
if (t.has(r)) return;
|
|
1232
|
-
const o =
|
|
1232
|
+
const o = je(s, C(r));
|
|
1233
1233
|
let l = e.get(o);
|
|
1234
|
-
void 0 !== l || a ||
|
|
1234
|
+
void 0 !== l || a || C(r) || (l = I.length, I.push(s), x.push(C(r)), k.push(l), e.set(o, l)), f[n][r] = l ?? -1;
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1237
|
+
const M = { name: l[t] };
|
|
1238
|
+
S && (M.inline = !0), void 0 !== e.numberFormat && (M.numberFormat = e.numberFormat);
|
|
1239
|
+
const T = [];
|
|
1240
1240
|
let R = !1;
|
|
1241
1241
|
I.forEach((e, t) => {
|
|
1242
|
-
"number" == typeof e && (x[t] ?
|
|
1243
|
-
}),
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1242
|
+
"number" == typeof e && (x[t] ? T.push(t) : R = !0);
|
|
1243
|
+
}), T.length > 0 && !R ? M.dates = !0 : T.length > 0 && (M.dateItems = T), w[t] = M.dateItems ? new Set(M.dateItems) : void 0, k.length > 0 && (M.unused = k);
|
|
1244
|
+
const O = void 0 !== n ? r[n].rest : void 0;
|
|
1245
|
+
O && (M.rest = O);
|
|
1246
|
+
const N = void 0 !== n ? r[n].calculatedItems : void 0;
|
|
1247
|
+
N?.length && (M.calculatedItems = N.map(({ item: e, formula: t }) => {
|
|
1248
1248
|
const s = I.length;
|
|
1249
|
-
return I.push(o[n][e]),
|
|
1249
|
+
return I.push(o[n][e]), f[n][e] = s, {
|
|
1250
1250
|
item: s,
|
|
1251
1251
|
formula: t
|
|
1252
1252
|
};
|
|
1253
|
-
})), m.push(
|
|
1254
|
-
const
|
|
1255
|
-
if (
|
|
1256
|
-
const e = re(
|
|
1257
|
-
e ? (
|
|
1253
|
+
})), m.push(M), p.push([t, [[0, I]]]), h.push([t, [[0, A]]]), g.push(I), v.push(E), F.push(!1);
|
|
1254
|
+
const $ = void 0 !== n ? r[n].group : void 0;
|
|
1255
|
+
if ($?.range && $.base === n) {
|
|
1256
|
+
const e = re($, I.slice(0, E).map(q), s);
|
|
1257
|
+
e ? (M.group = {
|
|
1258
1258
|
...e,
|
|
1259
1259
|
base: t
|
|
1260
|
-
}, y(n, t, e)) :
|
|
1261
|
-
} else
|
|
1260
|
+
}, y(n, t, e)) : f[n] = o[n].map(() => -1);
|
|
1261
|
+
} else $ && !P(r[n]) && (M.group = $);
|
|
1262
1262
|
}), r.forEach((e, t) => {
|
|
1263
1263
|
if (!e.noRecords) return;
|
|
1264
|
-
if (
|
|
1264
|
+
if (b(e)) return c[t] = m.length, m.push(e), g.push([]), v.push(0), void F.push(!1);
|
|
1265
1265
|
const n = e.group;
|
|
1266
1266
|
if (!n) return;
|
|
1267
|
-
const r =
|
|
1267
|
+
const r = c[n.base];
|
|
1268
1268
|
if (void 0 === r || r < 0) return;
|
|
1269
|
-
const o =
|
|
1269
|
+
const o = g[r];
|
|
1270
1270
|
let a, l = [];
|
|
1271
|
-
if (n.range) a = re(n, o.slice(0,
|
|
1271
|
+
if (n.range) a = re(n, o.slice(0, v[r]).map(q), s);
|
|
1272
1272
|
else {
|
|
1273
|
-
const e = Ge(n,
|
|
1273
|
+
const e = Ge(n, f[n.base], o, m[r]);
|
|
1274
1274
|
a = e.group, l = e.itemMap;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (!a) return;
|
|
1277
1277
|
const i = m.length;
|
|
1278
|
-
|
|
1278
|
+
c[t] = i, m.push({
|
|
1279
1279
|
...e,
|
|
1280
1280
|
group: {
|
|
1281
1281
|
...a,
|
|
1282
1282
|
base: r
|
|
1283
1283
|
}
|
|
1284
|
-
}),
|
|
1284
|
+
}), g.push(a.items), w[i] = a.dateItems ? new Set(a.dateItems) : void 0, v.push(a.items.length), F.push(!1), n.range ? y(t, i, a) : f[t] = l;
|
|
1285
1285
|
}), m.forEach((e, t) => {
|
|
1286
1286
|
const n = e.group;
|
|
1287
1287
|
if (void 0 === n?.parent) return;
|
|
1288
|
-
const s =
|
|
1288
|
+
const s = c[n.parent], { parent: r, ...o } = n;
|
|
1289
1289
|
void 0 !== s && s >= 0 ? e.group = {
|
|
1290
1290
|
...n,
|
|
1291
1291
|
parent: s
|
|
1292
|
-
} :
|
|
1292
|
+
} : P(e) ? e.group = o : delete e.group, e.group && !P(e) && (e.group = {
|
|
1293
1293
|
...e.group,
|
|
1294
1294
|
base: t
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
1297
|
-
const { cacheId: I, part: x, partFormats:
|
|
1297
|
+
const { cacheId: I, part: x, partFormats: C, fields: E, items: S, records: k, ...M } = e;
|
|
1298
1298
|
return {
|
|
1299
1299
|
model: {
|
|
1300
|
-
...
|
|
1300
|
+
...M,
|
|
1301
1301
|
source: n ?? e.source,
|
|
1302
1302
|
fields: m,
|
|
1303
1303
|
items: p,
|
|
1304
1304
|
records: h,
|
|
1305
|
-
recordCount:
|
|
1305
|
+
recordCount: u
|
|
1306
1306
|
},
|
|
1307
1307
|
remap: {
|
|
1308
|
-
fields:
|
|
1309
|
-
items:
|
|
1310
|
-
newItems:
|
|
1311
|
-
usedCounts:
|
|
1312
|
-
inItemOrder:
|
|
1313
|
-
dateItems:
|
|
1308
|
+
fields: c,
|
|
1309
|
+
items: f,
|
|
1310
|
+
newItems: g,
|
|
1311
|
+
usedCounts: v,
|
|
1312
|
+
inItemOrder: F,
|
|
1313
|
+
dateItems: w
|
|
1314
1314
|
}
|
|
1315
1315
|
};
|
|
1316
1316
|
}, Ge = (e, t, n, s) => {
|
|
@@ -1319,17 +1319,17 @@ var Y = [
|
|
|
1319
1319
|
const s = t?.[n] ?? -1;
|
|
1320
1320
|
s < 0 || (o[s] = e, r.add(e));
|
|
1321
1321
|
});
|
|
1322
|
-
const a = [], l = [],
|
|
1322
|
+
const a = [], l = [], d = new Set(e.dateItems), u = e.items.map((e, t) => r.has(t) ? (d.has(t) && l.push(a.length), a.push(e), a.length - 1) : -1), c = o.map((e, t) => e >= 0 ? u[e] : ((s.dates || i(s, t)) && l.push(a.length), a.push(n[t]), a.length - 1)), { dateItems: f, ...m } = e;
|
|
1323
1323
|
return {
|
|
1324
1324
|
group: {
|
|
1325
|
-
...
|
|
1325
|
+
...m,
|
|
1326
1326
|
items: a,
|
|
1327
|
-
discrete:
|
|
1327
|
+
discrete: c,
|
|
1328
1328
|
...l.length > 0 ? { dateItems: l } : {}
|
|
1329
1329
|
},
|
|
1330
|
-
itemMap:
|
|
1330
|
+
itemMap: u
|
|
1331
1331
|
};
|
|
1332
|
-
},
|
|
1332
|
+
}, qe = (e, t, n = !1, s = !1) => {
|
|
1333
1333
|
const r = (e, t) => null === e ? 5 : "number" == typeof e ? t ? 3 : 0 : "string" == typeof e ? 1 : "boolean" == typeof e ? 2 : 4, o = r(e, n), a = r(t, s);
|
|
1334
1334
|
return o !== a ? o - a : 0 === o || 3 === o ? e - t : 1 === o ? e.localeCompare(t, void 0, { sensitivity: "base" }) : 2 === o ? Number(e) - Number(t) : 4 === o ? e.getCode() - t.getCode() : 0;
|
|
1335
1335
|
}, Ke = (e, t) => {
|
|
@@ -1438,7 +1438,7 @@ var Y = [
|
|
|
1438
1438
|
}, Je = (e, t, n, s, r = !1, o) => {
|
|
1439
1439
|
const a = e.items ?? [], l = [], i = [], d = /* @__PURE__ */ new Set();
|
|
1440
1440
|
for (const e of a) {
|
|
1441
|
-
if (!
|
|
1441
|
+
if (!_(e)) {
|
|
1442
1442
|
i.push(l.length), l.push(e);
|
|
1443
1443
|
continue;
|
|
1444
1444
|
}
|
|
@@ -1460,7 +1460,7 @@ var Y = [
|
|
|
1460
1460
|
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s = l.map((e, t) => ({
|
|
1461
1461
|
item: e,
|
|
1462
1462
|
at: t
|
|
1463
|
-
})), r = s.filter((e) => !
|
|
1463
|
+
})), r = s.filter((e) => !_(e.item)), o = [...[...s.filter((e) => _(e.item)), ...u.map((e) => ({
|
|
1464
1464
|
item: n ? {
|
|
1465
1465
|
item: e,
|
|
1466
1466
|
hidden: !0
|
|
@@ -1481,10 +1481,10 @@ var Y = [
|
|
|
1481
1481
|
hidden: !0
|
|
1482
1482
|
} : { item: e };
|
|
1483
1483
|
if (e.sort && void 0 === e.sort.dataField) {
|
|
1484
|
-
const t = "descending" === e.sort.order, s = (e, t) =>
|
|
1484
|
+
const t = "descending" === e.sort.order, s = (e, t) => qe(z(e, n), q(n[t]), void 0 === e.name && o?.has(e.item), o?.has(t));
|
|
1485
1485
|
for (const e of u) {
|
|
1486
1486
|
const n = f(e);
|
|
1487
|
-
let r = l.findIndex((n) =>
|
|
1487
|
+
let r = l.findIndex((n) => _(n) && (t ? s(n, e) < 0 : s(n, e) > 0));
|
|
1488
1488
|
r < 0 && (r = We(l)), l.splice(r, 0, n);
|
|
1489
1489
|
for (let e = 0; e < i.length; e++) i[e] >= r && i[e]++;
|
|
1490
1490
|
}
|
|
@@ -1498,12 +1498,12 @@ var Y = [
|
|
|
1498
1498
|
positions: i
|
|
1499
1499
|
};
|
|
1500
1500
|
}, We = (e) => {
|
|
1501
|
-
const t = e.findIndex((e) => !
|
|
1501
|
+
const t = e.findIndex((e) => !_(e));
|
|
1502
1502
|
return t < 0 ? e.length : t;
|
|
1503
1503
|
}, Xe = (e, t) => {
|
|
1504
1504
|
if (!(t < 0)) for (let n = 0; n < e.length; n++) {
|
|
1505
1505
|
const s = (t + n) % e.length, r = e[s];
|
|
1506
|
-
if (
|
|
1506
|
+
if (_(r) && !r.missing) return s;
|
|
1507
1507
|
}
|
|
1508
1508
|
}, Ye = (e, t, n, s, r) => {
|
|
1509
1509
|
const o = { ...e };
|
|
@@ -1578,43 +1578,43 @@ var Y = [
|
|
|
1578
1578
|
areas: e.areas.map(d)
|
|
1579
1579
|
}))), a;
|
|
1580
1580
|
}, et = (e, t, n, s) => {
|
|
1581
|
-
const r = (e.fields ?? [])[n]?.items ?? [], o =
|
|
1581
|
+
const r = (e.fields ?? [])[n]?.items ?? [], o = T(t)[n] ?? [], a = t.fields?.[n], l = void 0 !== a?.group?.range, d = (e) => void 0 === e.name && i(a, e.item), u = r.map((e, t) => ({
|
|
1582
1582
|
item: e,
|
|
1583
1583
|
at: t
|
|
1584
|
-
})),
|
|
1585
|
-
|
|
1586
|
-
let
|
|
1587
|
-
const
|
|
1584
|
+
})), c = u.filter((e) => _(e.item));
|
|
1585
|
+
c.sort((e, t) => l ? e.item.item - t.item.item : qe(z(e.item, o), z(t.item, o), d(e.item), d(t.item))), "descending" === s && c.reverse();
|
|
1586
|
+
let f = 0;
|
|
1587
|
+
const m = Ze(e, n, u.map((e) => _(e.item) ? c[f++] : e).map((e) => e.at));
|
|
1588
1588
|
return {
|
|
1589
|
-
...
|
|
1590
|
-
fields:
|
|
1589
|
+
...m,
|
|
1590
|
+
fields: m.fields.map((e, t) => t === n ? {
|
|
1591
1591
|
...e,
|
|
1592
1592
|
sort: { order: s }
|
|
1593
1593
|
} : e)
|
|
1594
1594
|
};
|
|
1595
1595
|
}, tt = (n, s, r) => {
|
|
1596
1596
|
const o = n.fields?.[s]?.items?.[r];
|
|
1597
|
-
if (!o || !
|
|
1597
|
+
if (!o || !_(o)) throw new t(e("error.pivotTable.changePart"));
|
|
1598
1598
|
return o;
|
|
1599
1599
|
}, nt = (n, s, r, o, a) => {
|
|
1600
|
-
const l = tt(n, r, o), i = n.fields[r].items,
|
|
1601
|
-
const t =
|
|
1602
|
-
return null === t ?
|
|
1600
|
+
const l = tt(n, r, o), i = n.fields[r].items, u = T(s)[r] ?? [], c = (e) => {
|
|
1601
|
+
const t = q(u[e.item]);
|
|
1602
|
+
return null === t ? S : R(t);
|
|
1603
1603
|
};
|
|
1604
|
-
if (i.some((e, t) => t !== o &&
|
|
1605
|
-
const { name:
|
|
1604
|
+
if (i.some((e, t) => t !== o && _(e) && d(e.name ?? c(e), a))) throw new t(e("error.pivotTable.itemNameExists", { name: a }));
|
|
1605
|
+
const { name: f, ...m } = l, p = a === c(l) ? m : {
|
|
1606
1606
|
...l,
|
|
1607
1607
|
name: a
|
|
1608
1608
|
};
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1609
|
+
if (p.name === l.name) return n;
|
|
1610
|
+
const h = {
|
|
1611
1611
|
...n,
|
|
1612
1612
|
fields: n.fields.map((e, t) => t === r ? {
|
|
1613
1613
|
...e,
|
|
1614
|
-
items: i.map((e, t) => t === o ?
|
|
1614
|
+
items: i.map((e, t) => t === o ? p : e)
|
|
1615
1615
|
} : e)
|
|
1616
1616
|
}, g = n.fields[r].sort;
|
|
1617
|
-
return g && void 0 === g.dataField ? et(
|
|
1617
|
+
return g && void 0 === g.dataField ? et(h, s, r, g.order) : h;
|
|
1618
1618
|
}, st = (e, t, n, s) => {
|
|
1619
1619
|
tt(e, t, n);
|
|
1620
1620
|
const r = e.fields[t].items.map((e, t) => t).filter((e) => e !== n);
|
|
@@ -1631,11 +1631,11 @@ var Y = [
|
|
|
1631
1631
|
})
|
|
1632
1632
|
} : a;
|
|
1633
1633
|
}, rt = (n, s, r, o) => {
|
|
1634
|
-
const a =
|
|
1634
|
+
const a = R(o), l = n.fields, i = s.fields, u = n.dataFields ?? [], c = T(s), f = (e, t) => {
|
|
1635
1635
|
if (void 0 !== t.name) return t.name;
|
|
1636
|
-
const n =
|
|
1637
|
-
return null === n ?
|
|
1638
|
-
},
|
|
1636
|
+
const n = q(c[e][t.item]);
|
|
1637
|
+
return null === n ? S : R(n);
|
|
1638
|
+
}, m = (r) => {
|
|
1639
1639
|
if (void 0 !== r.field && a === (l[r.field].name ?? i[r.field].name)) return;
|
|
1640
1640
|
const o = void 0 === r.field ? n : {
|
|
1641
1641
|
...n,
|
|
@@ -1644,18 +1644,18 @@ var Y = [
|
|
|
1644
1644
|
name: "\0"
|
|
1645
1645
|
} : e)
|
|
1646
1646
|
};
|
|
1647
|
-
if (
|
|
1647
|
+
if (j(o, s, a, r.data) !== a) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1648
1648
|
};
|
|
1649
1649
|
switch (r.kind) {
|
|
1650
1650
|
case "item": {
|
|
1651
1651
|
const { field: e, rank: t } = r;
|
|
1652
1652
|
tt(n, e, t);
|
|
1653
|
-
const o = l[e].items.findIndex((n, s) => s !== t &&
|
|
1653
|
+
const o = l[e].items.findIndex((n, s) => s !== t && _(n) && d(f(e, n), a));
|
|
1654
1654
|
return o >= 0 ? st(n, e, o, t) : nt(n, s, e, t, a);
|
|
1655
1655
|
}
|
|
1656
1656
|
case "fieldCaption": {
|
|
1657
1657
|
const { field: e } = r;
|
|
1658
|
-
return
|
|
1658
|
+
return m({ field: e }), ((e, t) => ({
|
|
1659
1659
|
...n,
|
|
1660
1660
|
fields: l.map((n, s) => s === e ? t(n) : n)
|
|
1661
1661
|
}))(e, (t) => {
|
|
@@ -1668,9 +1668,9 @@ var Y = [
|
|
|
1668
1668
|
}
|
|
1669
1669
|
case "dataCaption": {
|
|
1670
1670
|
const { data: e } = r;
|
|
1671
|
-
return
|
|
1671
|
+
return m({ data: e }), {
|
|
1672
1672
|
...n,
|
|
1673
|
-
dataFields:
|
|
1673
|
+
dataFields: u.map((t, n) => n === e ? {
|
|
1674
1674
|
...t,
|
|
1675
1675
|
name: a
|
|
1676
1676
|
} : t)
|
|
@@ -1691,14 +1691,14 @@ var Y = [
|
|
|
1691
1691
|
case "pageItem": {
|
|
1692
1692
|
const s = n.pageFields, o = s[r.page];
|
|
1693
1693
|
let i;
|
|
1694
|
-
if (!
|
|
1695
|
-
const { item:
|
|
1694
|
+
if (!d(a, "(All)") && (i = (l[o.field].items ?? []).findIndex((e) => _(e) && d(f(o.field, e), a)), i < 0)) throw new t(e("error.pivotTable.notAnItem", { name: a }));
|
|
1695
|
+
const { item: u, ...c } = o, m = void 0 === i ? c : {
|
|
1696
1696
|
...o,
|
|
1697
1697
|
item: i
|
|
1698
1698
|
};
|
|
1699
1699
|
return {
|
|
1700
1700
|
...n,
|
|
1701
|
-
pageFields: s.map((e, t) => t === r.page ?
|
|
1701
|
+
pageFields: s.map((e, t) => t === r.page ? m : e)
|
|
1702
1702
|
};
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
@@ -1717,8 +1717,8 @@ var Y = [
|
|
|
1717
1717
|
...e.columnFields ?? [],
|
|
1718
1718
|
...(e.pageFields ?? []).map((e) => e.field)
|
|
1719
1719
|
].filter((e) => e >= 0), it = (e, t) => {
|
|
1720
|
-
const n = e.fields[t], s =
|
|
1721
|
-
|
|
1720
|
+
const n = e.fields[t], s = T(e)[t], r = s.map((e, t) => t);
|
|
1721
|
+
P(n) || r.sort((e, t) => qe(q(s[e]), q(s[t]), i(n, e), i(n, t)));
|
|
1722
1722
|
const o = new Set(n.calculatedItems?.map((e) => e.item)), a = new Set(n.unused);
|
|
1723
1723
|
return [...r.map((e) => ({
|
|
1724
1724
|
item: e,
|
|
@@ -1728,11 +1728,11 @@ var Y = [
|
|
|
1728
1728
|
}, dt = (s) => {
|
|
1729
1729
|
if (!("number" == typeof s ? void 0 !== o(s) : "" !== s && n.isValidFormat(s))) throw new t(e("error.pivotTable.notANumberFormat", { name: String(s) }));
|
|
1730
1730
|
}, ut = (n, s, r, o) => {
|
|
1731
|
-
const a = o?.function ?? ((e, t) => "number" ===
|
|
1731
|
+
const a = o?.function ?? ((e, t) => "number" === L(e, t) ? "sum" : "count")(s.fields[r], T(s)[r]), l = w[a];
|
|
1732
1732
|
if (!l) throw new t(e("error.pivotTable.notAFunction", { name: a }));
|
|
1733
1733
|
let i = o?.name;
|
|
1734
|
-
if (void 0 === i) i =
|
|
1735
|
-
else if (
|
|
1734
|
+
if (void 0 === i) i = j(n, s, `${l} of ${k(n, s, r)}`);
|
|
1735
|
+
else if (j(n, s, i) !== i) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1736
1736
|
const d = {
|
|
1737
1737
|
name: i,
|
|
1738
1738
|
field: r,
|
|
@@ -1742,7 +1742,7 @@ var Y = [
|
|
|
1742
1742
|
return "sum" !== a && (d.subtotal = a), void 0 !== o?.numberFormat && (dt(o.numberFormat), d.numberFormat = o.numberFormat), d;
|
|
1743
1743
|
}, ct = (n, s) => {
|
|
1744
1744
|
const r = n.fields ?? [], o = (n) => {
|
|
1745
|
-
const s = r.findIndex((e) =>
|
|
1745
|
+
const s = r.findIndex((e) => d(e.name, n));
|
|
1746
1746
|
if (s < 0) throw new t(e("error.pivotTable.notAField", { name: n }));
|
|
1747
1747
|
return s;
|
|
1748
1748
|
}, a = /* @__PURE__ */ new Map(), l = (e, t) => {
|
|
@@ -1752,18 +1752,18 @@ var Y = [
|
|
|
1752
1752
|
}
|
|
1753
1753
|
};
|
|
1754
1754
|
l(s?.rows, "row"), l(s?.columns, "column"), l(s?.pages, "page");
|
|
1755
|
-
const i = (e) => [...a].filter(([, t]) => t === e).map(([e]) => e),
|
|
1755
|
+
const i = (e) => [...a].filter(([, t]) => t === e).map(([e]) => e), u = [];
|
|
1756
1756
|
for (const e of s?.values ?? []) {
|
|
1757
1757
|
const { field: t, ...s } = "string" == typeof e ? { field: e } : e;
|
|
1758
|
-
|
|
1758
|
+
u.push(ut({ dataFields: u }, n, o(t), s));
|
|
1759
1759
|
}
|
|
1760
|
-
const
|
|
1760
|
+
const c = new Set(u.map((e) => e.field)), f = s?.form && "compact" !== s.form ? s.form : void 0, m = r.map((e, t) => {
|
|
1761
1761
|
const s = {}, r = a.get(t);
|
|
1762
|
-
return r && (s.axis = r, s.items = it(n, t)),
|
|
1763
|
-
}),
|
|
1764
|
-
|
|
1765
|
-
const
|
|
1766
|
-
fields:
|
|
1762
|
+
return r && (s.axis = r, s.items = it(n, t)), c.has(t) && (s.dataField = !0), f && (s.form = f), e.dates && void 0 !== e.numberFormat && (s.numberFormat = e.numberFormat), s;
|
|
1763
|
+
}), p = i("column");
|
|
1764
|
+
u.length > 1 && p.push(-2);
|
|
1765
|
+
const h = {
|
|
1766
|
+
fields: m,
|
|
1767
1767
|
style: {
|
|
1768
1768
|
name: s?.style ?? "PivotStyleLight16",
|
|
1769
1769
|
showRowHeaders: !0,
|
|
@@ -1773,13 +1773,13 @@ var Y = [
|
|
|
1773
1773
|
showLastColumn: !0
|
|
1774
1774
|
}
|
|
1775
1775
|
}, g = i("row");
|
|
1776
|
-
g.length > 0 && (
|
|
1776
|
+
g.length > 0 && (h.rowFields = g), p.length > 0 && (h.columnFields = p);
|
|
1777
1777
|
const w = i("page");
|
|
1778
|
-
return w.length > 0 && (
|
|
1778
|
+
return w.length > 0 && (h.pageFields = w.map((e) => ({ field: e }))), u.length > 0 && (h.dataFields = u), f && (h.form = f), h;
|
|
1779
1779
|
}, ft = (e, t) => t.map((t) => {
|
|
1780
1780
|
const n = t.sort?.scope;
|
|
1781
1781
|
if (!n) return t;
|
|
1782
|
-
const s = ((t.axis ===
|
|
1782
|
+
const s = ((t.axis === C.Axis.Row ? e.columnFields : t.axis === C.Axis.Column ? e.rowFields : void 0) ?? []).filter((e) => -2 !== e);
|
|
1783
1783
|
if (!n.items.every((e, t) => s[t] === e.field)) {
|
|
1784
1784
|
const { sort: e, ...n } = t;
|
|
1785
1785
|
return n;
|
|
@@ -1796,37 +1796,37 @@ var Y = [
|
|
|
1796
1796
|
}
|
|
1797
1797
|
};
|
|
1798
1798
|
}), mt = (n, s, r, o, a) => {
|
|
1799
|
-
const l =
|
|
1799
|
+
const l = C.Axis, i = s.fields?.[r], d = n.fields?.[r]?.axis ?? null;
|
|
1800
1800
|
if (o === l.Values) throw new t(e("error.pivotTable.valuesNotAnAxis"));
|
|
1801
1801
|
if (null === o) {
|
|
1802
1802
|
if (null === d) return n;
|
|
1803
1803
|
} else if (void 0 !== i?.formula || o === l.Page && (i?.calculatedItems?.length ?? 0) > 0) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
1804
|
-
const c = o ?
|
|
1804
|
+
const c = o ? N(n, o).filter((e) => e !== r) : [];
|
|
1805
1805
|
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a > c.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
1806
1806
|
const f = (a ?? c.length + 1) - 1;
|
|
1807
|
-
if (o === d && (void 0 === a ||
|
|
1807
|
+
if (o === d && (void 0 === a || N(n, o)[f] === r)) return n;
|
|
1808
1808
|
c.splice(f, 0, r);
|
|
1809
|
-
const { rowFields: m, columnFields: p, pageFields: h, ...
|
|
1810
|
-
|
|
1811
|
-
let
|
|
1812
|
-
...
|
|
1813
|
-
...
|
|
1809
|
+
const { rowFields: m, columnFields: p, pageFields: h, ...w } = n, v = {}, F = (e) => (e ?? []).filter((e) => e !== r), b = o === l.Row ? c : F(n.rowFields), y = o === l.Column ? c : F(n.columnFields), I = o === l.Page ? c.map((e) => n.pageFields?.find((t) => t.field === e) ?? { field: e }) : (n.pageFields ?? []).filter((e) => e.field !== r);
|
|
1810
|
+
b.length > 0 && (v.rowFields = b), y.length > 0 && (v.columnFields = y), I.length > 0 && (v.pageFields = I);
|
|
1811
|
+
let x = {
|
|
1812
|
+
...w,
|
|
1813
|
+
...v
|
|
1814
1814
|
};
|
|
1815
|
-
o === l.Page && d !== l.Page && (
|
|
1816
|
-
const
|
|
1817
|
-
o ?
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
...
|
|
1821
|
-
fields: ft(
|
|
1815
|
+
o === l.Page && d !== l.Page && (x = g(x, r, () => !0));
|
|
1816
|
+
const A = { ...n.fields?.[r] };
|
|
1817
|
+
o ? A.axis = o : delete A.axis, o && !A.items && i && (A.items = u(it(s, r), A.subtotals)), o && void 0 === A.numberFormat && i?.dates && void 0 !== i.numberFormat && (A.numberFormat = i.numberFormat), o === l.Page && A.items?.some((e) => e.hidden) && (A.multipleItemSelection = !0);
|
|
1818
|
+
const E = (n.fields ?? []).map((e, t) => t === r ? A : e);
|
|
1819
|
+
if (x = {
|
|
1820
|
+
...x,
|
|
1821
|
+
fields: ft(x, E)
|
|
1822
1822
|
}, null === o && n.formats?.some((e) => e.area.references?.some((e) => e.field === r))) {
|
|
1823
|
-
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } =
|
|
1824
|
-
|
|
1823
|
+
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } = x;
|
|
1824
|
+
x = e.length > 0 ? {
|
|
1825
1825
|
...s,
|
|
1826
1826
|
formats: e
|
|
1827
1827
|
} : s;
|
|
1828
1828
|
}
|
|
1829
|
-
return
|
|
1829
|
+
return x;
|
|
1830
1830
|
}, pt = -2, ht = /* @__PURE__ */ new Set([
|
|
1831
1831
|
"percentOfTotal",
|
|
1832
1832
|
"percentOfRow",
|
|
@@ -1955,7 +1955,7 @@ var Y = [
|
|
|
1955
1955
|
l[e] = t;
|
|
1956
1956
|
}), It(n, a.map((e) => o[e]), l);
|
|
1957
1957
|
}, Et = (e, t, n, s) => {
|
|
1958
|
-
const r =
|
|
1958
|
+
const r = I(e, t, n, s);
|
|
1959
1959
|
return (e.dataFields[n].subtotal ?? "sum") === s ? e : bt(e, n, (e) => {
|
|
1960
1960
|
const { subtotal: t, ...n } = e, o = {
|
|
1961
1961
|
...n,
|
|
@@ -1966,38 +1966,38 @@ var Y = [
|
|
|
1966
1966
|
}, St = (n, s, r, o) => {
|
|
1967
1967
|
const a = n.dataFields[r], l = a.showDataAs ?? "normal", i = o?.kind ?? "normal";
|
|
1968
1968
|
if (o && !wt.has(o.kind)) throw new t(e("error.pivotTable.notAShowAs", { name: o.kind }));
|
|
1969
|
-
const { showDataAs:
|
|
1970
|
-
"normal" !== i && (
|
|
1971
|
-
let
|
|
1969
|
+
const { showDataAs: u, baseField: c, baseItem: f, ...m } = a, p = { ...m };
|
|
1970
|
+
"normal" !== i && (p.showDataAs = i);
|
|
1971
|
+
let h = a.baseField, g = a.baseItem;
|
|
1972
1972
|
if (void 0 !== o?.baseField) {
|
|
1973
|
-
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) =>
|
|
1973
|
+
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) => d(k(n, s, t), r));
|
|
1974
1974
|
if (a < 0) throw new t(e("error.pivotTable.notAField", { name: r }));
|
|
1975
|
-
a !==
|
|
1975
|
+
a !== h && (h = a, g = 0);
|
|
1976
1976
|
}
|
|
1977
1977
|
if (void 0 !== o?.baseItem) {
|
|
1978
|
-
const r =
|
|
1979
|
-
if (
|
|
1980
|
-
else if (
|
|
1978
|
+
const r = h ?? 0;
|
|
1979
|
+
if (d(o.baseItem, "(previous)")) g = "previous";
|
|
1980
|
+
else if (d(o.baseItem, "(next)")) g = "next";
|
|
1981
1981
|
else {
|
|
1982
1982
|
const a = n.fields?.[r]?.items ? n : { fields: (n.fields ?? []).map((e, t) => t === r ? {
|
|
1983
1983
|
...e,
|
|
1984
1984
|
items: it(s, r)
|
|
1985
|
-
} : e) }, l =
|
|
1985
|
+
} : e) }, l = G(a, s, r).findIndex((e) => null !== e && d(e, o.baseItem));
|
|
1986
1986
|
if (l < 0) throw new t(e("error.pivotTable.notAnItem", { name: o.baseItem }));
|
|
1987
1987
|
g = l;
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
-
if (void 0 !==
|
|
1991
|
-
const
|
|
1990
|
+
if (void 0 !== h && (p.baseField = h), void 0 !== g && (p.baseItem = g), i === l) return p.baseField === a.baseField && p.baseItem === a.baseItem ? n : bt(n, r, () => p);
|
|
1991
|
+
const w = ((e, t, n) => {
|
|
1992
1992
|
if (gt.has(n)) return gt.has(t) ? e : void 0;
|
|
1993
|
-
const s = ((e) =>
|
|
1993
|
+
const s = ((e) => $(e).replace(/"[^"]*"|\\./g, "").includes("%"))(e);
|
|
1994
1994
|
return ht.has(n) ? ht.has(t) || s ? e : 10 : ht.has(t) && s ? void 0 : e;
|
|
1995
1995
|
})(a.numberFormat, l, i);
|
|
1996
|
-
return
|
|
1996
|
+
return w === a.numberFormat ? bt(n, r, () => p) : bt(Ft(n, r), r, () => yt(p, w));
|
|
1997
1997
|
}, Pt = (e, t, n) => {
|
|
1998
1998
|
dt(n);
|
|
1999
|
-
const s =
|
|
2000
|
-
if (
|
|
1999
|
+
const s = $(n), r = e.dataFields[t], o = e.formats?.[e.formats.length - 1];
|
|
2000
|
+
if ($(r.numberFormat) === s && o && vt(o.area, t) && o.style.numberFormat === s) return e;
|
|
2001
2001
|
const a = bt(Ft(e, t), t, (e) => yt(e, "General" === s ? void 0 : n));
|
|
2002
2002
|
return {
|
|
2003
2003
|
...a,
|
|
@@ -2014,16 +2014,16 @@ var Y = [
|
|
|
2014
2014
|
};
|
|
2015
2015
|
}, kt = (n, s, r) => {
|
|
2016
2016
|
if (null === s) return At(n);
|
|
2017
|
-
const o =
|
|
2017
|
+
const o = C.Axis;
|
|
2018
2018
|
if (s !== o.Row && s !== o.Column) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
2019
2019
|
const a = n.rowFields?.includes(pt) ? o.Row : n.columnFields?.includes(pt) ? o.Column : null;
|
|
2020
2020
|
if (!a) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2021
|
-
const l =
|
|
2021
|
+
const l = N(n, s).filter((e) => e !== pt);
|
|
2022
2022
|
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r > l.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2023
2023
|
const i = (r ?? l.length + 1) - 1;
|
|
2024
|
-
if (s === a && (void 0 === r ||
|
|
2024
|
+
if (s === a && (void 0 === r || N(n, s)[i] === pt)) return n;
|
|
2025
2025
|
l.splice(i, 0, pt);
|
|
2026
|
-
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m =
|
|
2026
|
+
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m = N(n, s === o.Row ? o.Column : o.Row).filter((e) => e !== pt), p = { ...f }, h = s === o.Row ? l : m, g = s === o.Column ? l : m;
|
|
2027
2027
|
return h.length > 0 && (p.rowFields = [...h]), g.length > 0 && (p.columnFields = [...g]), s === o.Row && (p.valuesOnRows = !0), p;
|
|
2028
2028
|
}, Mt = (n, s, r) => {
|
|
2029
2029
|
if (r === (n.valuesCaption ?? "Values")) return n;
|
|
@@ -2031,10 +2031,10 @@ var Y = [
|
|
|
2031
2031
|
...a,
|
|
2032
2032
|
valuesCaption: "\0"
|
|
2033
2033
|
};
|
|
2034
|
-
if (
|
|
2034
|
+
if (j(l, s, r) !== r) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
2035
2035
|
return "Values" === r ? a : {
|
|
2036
2036
|
...a,
|
|
2037
2037
|
valuesCaption: r
|
|
2038
2038
|
};
|
|
2039
2039
|
};
|
|
2040
|
-
export { xt as addPivotDataField, Ne as anchorPivotPeriods, dt as assertNumberFormat, lt as axisFieldsOf,
|
|
2040
|
+
export { xt as addPivotDataField, Ne as anchorPivotPeriods, dt as assertNumberFormat, lt as axisFieldsOf, Re as buildPivotView, Oe as evaluatePivotFilters, U as isItemFilter, Ie as layOutPivot, it as listedItemsOf, Ct as movePivotDataField, mt as movePivotField, st as movePivotItem, kt as movePivotValues, ot as newPivotCache, ct as newPivotTable, _e as readPivotSource, ze as refreshPivotCache, Ke as remapPivotTable, At as removePivotDataField, nt as renamePivotItem, Mt as renamePivotValues, Ze as reorderPivotItems, Et as setPivotDataFunction, Pt as setPivotDataNumberFormat, St as setPivotDataShowAs, et as sortPivotItemsByLabel, rt as typeOverPivot, at as withListedFields };
|