@sheetxl/mcp 0.8.0-beta.25 → 1.0.2
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/{CDiutOsLAzu4c0Ej.js → 1d-8AAcf1UmC2qIz.js} +1 -1
- package/assets/{V4pGXJr6fe-CPg7i.js → 30KXHiLfwl0cbsxL.js} +1 -1
- package/assets/{CCOaNx5_BfWCc9yz.js → 3o7I8loKRGynHrNq.js} +1 -1
- package/assets/{Brlza6Jd2oGGX9vB.js → 648qV0v861jvyZWm.js} +1 -1
- package/assets/{GfAXkT_vctdRX_9f.js → 7khlPnFFCrE8gnT_.js} +12 -12
- package/assets/{CX-KrjVgXM-7o--S.js → 8hUUTZ62hbxY0TOp.js} +2 -2
- package/assets/{DaB9iRVJj3TmKH92.js → B1Vm5y0E-TPSYFya.js} +3 -3
- package/assets/{B6e_DsVO4i91IYEO.js → B6ToyMcYe9lyaeDk.js} +3 -3
- package/assets/{DB2MrmDLZ-OzVRQu.js → B6pS096VwbWaj1Zz.js} +2 -2
- package/assets/{DwmlBb640xWfAMV2.js → B9V6AFTTnbPscv11.js} +2 -2
- package/assets/{DHCl7HWDbT3xqx8W.js → BESu-5sZSIJqkrWN.js} +2 -2
- package/assets/{BSJ_L1gNOejEih6N.js → BHhPtFpb3YfV6_44.js} +32 -32
- package/assets/{u8xtjHo43n-S_O6j.js → BMAAmO8LPIe4VJ77.js} +1 -1
- package/assets/{C9DvPNfuz_0hun6C.js → BMVu89mdcVSqJDDE.js} +1 -1
- package/assets/{DBgHcEP-FcgSHLvx.js → BRB5-fXJFU7Kq2wm.js} +314 -314
- package/assets/{CD2yoEhIT8DyXBou.js → BRI3D42tlMkZdYb2.js} +37 -37
- package/assets/{DgE30NwKzEjZI1W6.js → BVzogMoyaicBEKBk.js} +3 -3
- package/assets/{DXDhH3F4N4OOigqN.js → BWpLQNKC3n8bXJUk.js} +1 -1
- package/assets/{Cmf4eJow6AIuPH_w.js → Baa8cmJsilboM0DW.js} +1 -1
- package/assets/{irrAIfw6CnCOHmPE.js → BcDNXTGASDvptqc-.js} +1 -1
- package/assets/{Djl7cjJyCIS_Qvbd.js → Bme_PT3UqwTbGLWd.js} +1 -1
- package/assets/{DZTVTdrwu05fNZk_.js → BnxajOeIasx1G3OB.js} +1 -1
- package/assets/{cTLYCAhDs2fR2ITC.js → BousX61zAjBfjlsV.js} +1 -1
- package/assets/{DAnTpFc2vx3CmP8e.js → Bp73VL7f5DEt88Cn.js} +26 -26
- package/assets/{DLW76uSURiQM07DD.js → BppAvnmuJbbYBQUy.js} +1 -1
- package/assets/{DvkgborRc2vRq8E-.js → BtoBfR_4n1u37HmC.js} +1 -1
- package/assets/{H40qXR3Gazmnq4Mv.js → BuLAeGM4AvHCge4x.js} +1 -1
- package/assets/{45FAgD1JyG2a1Rti.js → Buxo11Ux7uxzoy_7.js} +2 -2
- package/assets/{u9le-qZ3tbYKK1kU.js → BwTF2TRqzXsf0H1I.js} +2 -2
- package/assets/{m9BgbF-NgPIYW4kc.js → BzCwrG3Zdv-Trzi_.js} +1 -1
- package/assets/{H_6CBe3t27jHlBHk.js → C00qhh0-m0B0JP9Y.js} +140 -140
- package/assets/{C6Vsz4e_ASJdx3LP.js → C5VvbPUAfrVKmXXs.js} +1 -1
- package/assets/{Cu4ok_jTnQif8QtX.js → C85xBYGjAzNmVNwL.js} +1 -1
- package/assets/{Duw8QQGcrPmesb-M.js → C880pTyOMof_fzPO.js} +1 -1
- package/assets/{70weNsvW2LMx5QcW.js → C88UXFOnR1Uc-nw2.js} +1 -1
- package/assets/{CYtkZMCX6dyEqjb9.js → C8G6iJz_vsgbNYq9.js} +4 -4
- package/assets/{DX94YgmfoL_ngS60.js → CAQgJMpje7ORQ5lt.js} +1 -1
- package/assets/CBSyNN4Fk5WsVStK.js +14 -0
- package/assets/{BktUuVP0Jew8_-ff.js → CCeqR45x9p-GG8Pi.js} +1 -1
- package/assets/{xSUMX6J9-MJIGgmG.js → CEDsCeYCSlY7wYe1.js} +2 -2
- package/assets/{CfWSdzSpbErVA_1h.js → CFWHwEc3dKMmNzUp.js} +338 -338
- package/assets/{CGS7apShLtnlmF8D.js → CK9LWUZdZ93t3GkS.js} +1 -1
- package/assets/{V_VVW06vjWkmlbdh.js → CL-BRusnISEAzebz.js} +527 -527
- package/assets/{C-FJab2sVwBbOTiA.js → CLvFlk5-KU2jnQ5r.js} +1 -1
- package/assets/{ClRgSo0axU3lAOwR.js → CUhCIQjymULgXquN.js} +1 -1
- package/assets/{Cb7FKT3S78r6IYHi.js → CboWvqCV0yix3-yP.js} +1 -1
- package/assets/{COZ-bhj463kGINFA.js → Ci4AUhBajQMJs1Ty.js} +1 -1
- package/assets/{eCD6fmcTsgv76IZm.js → CkQT1G_6bvMixZ8e.js} +4 -4
- package/assets/{DFd0JAiw5dkbnULM.js → CkqsYktaMF9p014y.js} +1 -1
- package/assets/{CSMsn9bKgR9kWG0m.js → CkuL4Ed6oRGAhIS9.js} +1 -1
- package/assets/{COXWiXy3DCfmXSm5.js → Cm41HVr6Xyz53jHz.js} +1 -1
- package/assets/{DQlLgxA592HvgKzh.js → CoY2sE2RG-Nd8TMR.js} +1 -1
- package/assets/{DZOzgVEOXfHTE3YC.js → CuRvGO_2tG0PUhCM.js} +1 -1
- package/assets/{ckvxz2tZRlY1UPpg.js → CvqpsTll6ngbdHgx.js} +9731 -9750
- package/assets/{BAowTO-7Utmg0UvM.js → Cvs9i2VUl7wXWZup.js} +3 -3
- package/assets/{CFrOPd_UcD7qclCq.js → Cy2uazuc6KpkbYg-.js} +1 -1
- package/assets/{cU78RT4WJKAp5mU_.js → CybNjXi6cOFKyGuH.js} +1 -1
- package/assets/{BHIi-cAKnh_sAifV.js → CzPMiqbNDm6TDPGJ.js} +1 -1
- package/assets/{D6qQAWN_5p3FAshK.js → CzYXLEVIoCfQ1AMM.js} +157 -157
- package/assets/{D7NjohknztgMLqhT.js → D-BWtxIGXTCMLoio.js} +2 -2
- package/assets/{C-Vt758qtn8QeCrw.js → D0Ly34TqieVSOIbh.js} +1 -1
- package/assets/{Abkx7KJ6_X5avkR4.js → D0M0EWP28g5rQaei.js} +3 -3
- package/assets/{D053O1kZ7JtMwiqh.js → D4NBYfzSZ3cU-3ao.js} +1 -1
- package/assets/{DG9KGapq8eHlcTC7.js → D4NcXlPRmR6NaoGS.js} +1 -1
- package/assets/{DRvzD5Tkcb2OU0G2.js → D4jXxO1LUEQ6erA9.js} +1 -1
- package/assets/{DfaQvLAaU7HHPnSe.js → DAx-VOBmi1xAMhhX.js} +29 -29
- package/assets/{BbfSzxx5EzAvn-_F.js → DBcXAdUaNGrlah12.js} +15 -15
- package/assets/{DQBqVPRLkZFb2P_x.js → DFdAxnoXGn_8ge3l.js} +2 -2
- package/assets/{BtNEVWQWEp_Ie1nT.js → DFjfZCMPfQfwC4cF.js} +581 -581
- package/assets/{Cplall3oc-_3AhCB.js → DG0Dzgf1kAxN3AIk.js} +1 -1
- package/assets/{CcTDxlAqw6HuYmmm.js → DGv-dTePYQ8_yif4.js} +66 -66
- package/assets/{HLtC2gb8SfNmJU5q.js → DIaD0BL0JLTaJTS3.js} +5 -5
- package/assets/{C2kYWrsx5mg4XOES.js → DIimDQiJDW-4lkZT.js} +1 -1
- package/assets/{BzU8BhgrkSoh-XJF.js → DK8DWNMTOmCg6zAI.js} +8 -8
- package/assets/{DlOCT6DI5bhPtQ8j.js → DKox8guOumZMOdq8.js} +29 -29
- package/assets/{BNvsIyBwweYnfUz3.js → DMHiZKWwm6puHV6p.js} +1 -1
- package/assets/{BzLwCwXsh7eXQpeK.js → DMyq3L2ibjMlHuDa.js} +1 -1
- package/assets/{UdhH9UX9jQ4IV11J.js → DOKXQpGyzXCoSLdJ.js} +1 -1
- package/assets/{D8wjcRGgRdU34Ata.js → DOXriXo-7WmTAKbN.js} +1 -1
- package/assets/{CJubVukzHBNJb_Wf.js → DRfsB4kS28fPXv6K.js} +105 -105
- package/assets/{DkS3EQvuEuPDvCws.js → DSmARJ0owmwmr2FA.js} +2 -2
- package/assets/{DYx_I-o0yjx056Dq.js → DUM6h3BEreCilg32.js} +1 -1
- package/assets/{DpGFb3hbAT5Murcv.js → DXp5V2__VY2opctz.js} +1 -1
- package/assets/{TqxFLhPz3zbgi95t.js → D_YBc6vHBL-ajwvB.js} +1 -1
- package/assets/{D5aWcMLJ2wyLm9Ws.js → Dc8BQsPlwN6i6OU7.js} +1 -1
- package/assets/{B_GZxEqqpKtEPbWC.js → DcnNIdrilJHfl_CQ.js} +1 -1
- package/assets/{B0FfnXdiZxExcdjB.js → DdIufax_qSuWVGQK.js} +2 -2
- package/assets/{DkT0-_t9Xgp4l-Mh.js → DeNqXaM_dHSswRuE.js} +1 -1
- package/assets/{O8YGVK4vtz39jQ84.js → DfVHW5vbnRNXHrCi.js} +1 -1
- package/assets/{D8cqT2lbcP5Yp1Or.js → Dfc9_XsqSeh48YeK.js} +11 -11
- package/assets/{DbHVXEt9qwlb8Gou.js → DiXodb_hLvUDIGb6.js} +29 -29
- package/assets/{CVWoX7wNwrZwm5XB.js → Dn531BWCDZ2noJix.js} +2 -2
- package/assets/{B940vbTfpMYACpDE.js → DnAuLAqQLmAf9Gls.js} +2 -2
- package/assets/{BV13tLgNXZ8MDaE_.js → Do8K2GlFXIiMX9TB.js} +1 -1
- package/assets/{DXVfJfT6ftWk5kYi.js → Dt8hWBnnqlpJOazW.js} +138 -138
- package/assets/{DUfrvQDZKh_22F91.js → DuBbSpdXZuAFvxpr.js} +1 -1
- package/assets/{ixHQtoul8ubEJfWS.js → DvAq2cPI7-lfSn0x.js} +1 -1
- package/assets/{CGdayif_qNMtoATI.js → DzCZGtlg3pJO91l9.js} +1 -1
- package/assets/{DcHvH_I64hbnNh9G.js → DzRBnJpz972o277m.js} +1 -1
- package/assets/{LQNEL4KjDxwZNwWq.js → EohzUi0uCnSF2q2D.js} +156 -156
- package/assets/{Bwk-CZuGiTRT2ox_.js → KSagTSkIvZSpUF1c.js} +4 -4
- package/assets/{BD3Bc7ZHxenj4S7Q.js → LOFAyr5OoT3oZGMV.js} +1 -1
- package/assets/{BBccc8pDH-6AJdoT.js → LbZNDu6C9XPMEXCN.js} +5 -5
- package/assets/{DJlQxf99HCszeCCD.js → NwtEz6ZaVT8p8wOh.js} +1 -1
- package/assets/{VkeNTI1TMsA1ZbGz.js → PD_i17-cebq3-_Gn.js} +3 -3
- package/assets/{Bb7ZxgjHwiKgARXs.js → Q-BvS_P_qM8EvP92.js} +1 -1
- package/assets/{BW8ReYzx-CEJ-lAG.js → YRKAYjRpPkjhxGSS.js} +1 -1
- package/assets/{kmiMiNIUc6rS8DG8.js → _-kNP8Q4FxBYPY4u.js} +4 -4
- package/assets/{Ci3R5B7bLke8NZRo.js → aEDyynzUuzMysLwT.js} +6 -6
- package/assets/{DunKnm-bQd0oHn9n.js → cTnKNFayqlXisspN.js} +2 -2
- package/assets/{DZBfVpnngvY9Ra3C.js → eEh1r_BS7Y0FXPqk.js} +1 -1
- package/assets/{BHeXL-Lo390ZSNV0.js → g4vz4gc43eat7Hd2.js} +1 -1
- package/assets/{CAI8p60cuWlgnlko.js → jUzhn1PeDLWXOuJO.js} +14 -14
- package/assets/{DbXqd8hGNQEyS-s0.js → kIzQWtiHNHvh8HLF.js} +1 -1
- package/assets/{BXxUz-sB48Z9nSFi.js → mIM-JksHd3Zl5INF.js} +1 -1
- package/assets/{s56uiNHMGbBV6xgZ.js → mirSoZ8QDsYUMjYu.js} +1 -1
- package/assets/{APcHum0Riw3QhLBQ.js → ooSNLnHLIYTBL5JD.js} +1 -1
- package/assets/{BFKj2ik7h-yM6oCR.js → tp75fiKc1r-jdPPN.js} +1 -1
- package/assets/{DcHo7BC8Ny3hWq0j.js → xltGcIbWkjqNtCty.js} +2 -2
- package/assets/{xMi-tFxI2s6e18L1.js → zbOvcGIPi-MDlJKE.js} +1 -1
- package/index.js +118 -118
- package/lib.js +1 -1
- package/licenses/dependencies.txt +35 -35
- package/package.json +17 -2
- package/screenshot-page/assets/{Da_VIghRFdNrmfZT.js → 37HIsN_8LEsOWyOO.js} +1 -1
- package/screenshot-page/assets/4I9gFq1IdumstDHq.js +2 -0
- package/screenshot-page/assets/6j6xGn4csAcfcFMQ.js +1 -0
- package/screenshot-page/assets/{hB5riGkPy0wXVIig.js → 7N8xCpYVBHFqfoAg.js} +1 -1
- package/screenshot-page/assets/{D8EmNst-H2v0eWcf.js → 97qOXULGlJqaTCIL.js} +1 -1
- package/screenshot-page/assets/B6dFVtErFelDd62E.js +2 -0
- package/screenshot-page/assets/{BCmGLxQEUabeee6Q.js → B6i6Xi9OafEvNRAm.js} +2 -2
- package/screenshot-page/assets/B7uNU6WWjJaco6ho.js +1 -0
- package/screenshot-page/assets/{DqOrgSpuJhQRhMoG.js → BGoGxqwlpgXt8CMd.js} +2 -2
- package/screenshot-page/assets/{0P0DnZolMnjPhiea.js → BXss42mPBQnnt0Rh.js} +1 -1
- package/screenshot-page/assets/{D53hpXNHxIgSWl80.js → BbhwsC3eMdzP2PeH.js} +1 -1
- package/screenshot-page/assets/Beaq1eo3pAjlfcba.js +1 -0
- package/screenshot-page/assets/Bf3eJLndwyxuVR-_.js +1 -0
- package/screenshot-page/assets/{CKdQfdZJGJFgnrr9.js → BqJRJVrx7XkIPgo7.js} +11 -11
- package/screenshot-page/assets/C-qNpEaGV5amWPml.js +13 -0
- package/screenshot-page/assets/{CCYEWK5QyGSnUAfh.js → CB-bJVu0a2zAElNH.js} +1 -1
- package/screenshot-page/assets/CGvyz3VVFiHbYHM0.js +3 -0
- package/screenshot-page/assets/{DTAKTGn53yF_B621.js → CKbXhNyUiI18JA_C.js} +1 -1
- package/screenshot-page/assets/{DkTX5ZjGNQ5SrwJa.js → CVEUOXnI1pTa-GKp.js} +1 -1
- package/screenshot-page/assets/C_RHXqyejSa8gd9x.js +1 -0
- package/screenshot-page/assets/{Bt7fKk5ZupUuo_xD.js → CbTBuiF_Jn72hoj1.js} +2 -2
- package/screenshot-page/assets/{C-2hBFk27roWkIrQ.js → CraI-__UdtaIvbNn.js} +1 -1
- package/screenshot-page/assets/{CMryHLEhCyKGuRSW.js → Cyu6g5rRtEGOHaQS.js} +4 -4
- package/screenshot-page/assets/{CL_hAngRQwm_KGdR.js → D1KqgZwk5MjDhk5i.js} +1 -1
- package/screenshot-page/assets/DGr8M07ioDfKXLHD.js +57 -0
- package/screenshot-page/assets/DMbhlzvflyxF5Clt.js +39 -0
- package/screenshot-page/assets/{D-jd_TJCN7AAn125.js → DQxI7bShZ7TKpL0V.js} +9 -9
- package/screenshot-page/assets/{BpJaTpbR_CQzXj9M.js → DSB_SKy2lKI_VGik.js} +1 -1
- package/screenshot-page/assets/DWkISZdhmV2PBk-k.js +1 -0
- package/screenshot-page/assets/{BVnzv_sY_58zEJyM.js → DfmEx82r_NbillHk.js} +1 -1
- package/screenshot-page/assets/{MqGbtsji4DVGCAMR.js → DsZcJUWTmqcp2aI-.js} +1 -1
- package/screenshot-page/assets/{jteb4n23QwBT9m_4.js → DszZ1A807YzTc0ek.js} +1 -1
- package/screenshot-page/assets/{DJebrQ5mu8uxpX3b.js → DwHci99xcnRTEcv5.js} +2 -2
- package/screenshot-page/assets/Ojp2B5i2-AJeD4mV.js +1 -0
- package/screenshot-page/assets/{CRtk9ixuBWxhPfPU.js → PRYQO22Y2LgMUg77.js} +1 -1
- package/screenshot-page/assets/{CZaKvnrRdlLj1_X8.js → RHcyaEfxJB7O3alo.js} +1 -1
- package/screenshot-page/assets/TA9YjsgX-_8fRRdZ.js +1 -0
- package/screenshot-page/assets/cUY9GpQPVTLSprfW.js +1 -0
- package/screenshot-page/assets/{Bne-AygyF1USkPAy.js → m48xmzGgNgwXSEgQ.js} +1 -1
- package/screenshot-page/assets/mVfCz3bXIjqEVPEo.js +1 -0
- package/screenshot-page/assets/{CFS0h-wE9YlZRk_1.js → putBhJCWgRos_Fmk.js} +1 -1
- package/screenshot-page/assets/{DbnmgPTSEii4OGkB.js → uyInkZWFnMwX-BSC.js} +1 -1
- package/screenshot-page/assets/{D98PlIA4qQ_6ciCu.js → xiJthTXsasYVOHWE.js} +2 -2
- package/screenshot-page/index.html +8 -8
- package/types/scripting.d.ts +1 -1
- package/assets/CehVpkp73IfWGN_b.js +0 -14
- package/screenshot-page/assets/3L7CY5dA_kT2UBjv.js +0 -1
- package/screenshot-page/assets/B6UwT0pG4sQeG7fA.js +0 -3
- package/screenshot-page/assets/BH2IWQ-8AfNbhYZJ.js +0 -39
- package/screenshot-page/assets/BkU12U7IqW7qjopk.js +0 -13
- package/screenshot-page/assets/Bs-IXwX9BKsCxwcJ.js +0 -2
- package/screenshot-page/assets/C7MXfx6zf_uTwcpu.js +0 -1
- package/screenshot-page/assets/CUQsrLir5jYpnRPM.js +0 -1
- package/screenshot-page/assets/CUgX7ETRCJsvqa2x.js +0 -1
- package/screenshot-page/assets/CfD1bn6b-NM38iZV.js +0 -1
- package/screenshot-page/assets/Ck5onwb1w_19WrtG.js +0 -1
- package/screenshot-page/assets/CvBPH5c-gnUG8Jen.js +0 -1
- package/screenshot-page/assets/DmIjTb4kKfUHxWaF.js +0 -57
- package/screenshot-page/assets/Dz_yLNMXKWGx1O6V.js +0 -2
- package/screenshot-page/assets/eR9_DaySoB72PvMo.js +0 -1
- package/screenshot-page/assets/hHvAGynpTvAb97GX.js +0 -1
- package/screenshot-page/assets/x1O923k1mN-CduO_.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. -
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v1.0.2
|
|
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 { Dt as n, Et as s, _t as r, d as o } from "./
|
|
9
|
-
import { u as a } from "./
|
|
10
|
-
import {
|
|
11
|
-
import { a as
|
|
7
|
+
import { p as e, tt as t } from "./DvAq2cPI7-lfSn0x.js";
|
|
8
|
+
import { Dt as n, Et as s, _t as r, d as o } from "./DBcXAdUaNGrlah12.js";
|
|
9
|
+
import { u as a } from "./3o7I8loKRGynHrNq.js";
|
|
10
|
+
import { Aa as i, Ba as l, Cn as d, Da as u, Di as c, Ea as f, Er as m, Hi as p, Ir as h, Ji as g, K as w, Ka as v, Ln as F, Na as b, Nr as y, Sr as I, T as x, Ti as A, Xt as C, Ya as E, Zr as S, _t as P, ao as k, b as M, di as T, dr as O, ei as R, eo as N, ii as _, in as L, ja as $, la as D, mi as V, pa as U, pi as H, pn as B, ut as j, vi as z, xi as G, xt as K } from "./CvqpsTll6ngbdHgx.js";
|
|
11
|
+
import { a as q, i as J, n as Q, o as W, r as X } from "./BHhPtFpb3YfV6_44.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 = u(e.records, n.length);
|
|
65
|
+
if (!n.some(b)) return s;
|
|
66
|
+
const r = u(e.items, n.length), o = e.recordCount ?? 0, a = s.slice();
|
|
67
67
|
for (let e = 0; e < n.length; e++) {
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
70
|
-
const
|
|
68
|
+
const i = n[e];
|
|
69
|
+
if (!b(i)) continue;
|
|
70
|
+
const l = i.group, d = s[l.base] ?? [], u = r[l.base] ?? [], c = new Int32Array(u.length);
|
|
71
71
|
for (let e = 0; e < u.length; e++) {
|
|
72
|
-
const n =
|
|
73
|
-
|
|
72
|
+
const n = l.range ? ee(l.range, l.items.length, j(u[e]), t) : l.discrete?.[e] ?? null;
|
|
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
|
-
const t =
|
|
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) => {
|
|
@@ -92,17 +92,17 @@ var Y = [
|
|
|
92
92
|
e < o && (o = e), e > a && (a = e);
|
|
93
93
|
}
|
|
94
94
|
if (0 === t.length) return e;
|
|
95
|
-
const
|
|
96
|
-
r.fixedStart || (
|
|
97
|
-
const { inner:
|
|
98
|
-
const { start: s, end: r } = e, o = e.interval ?? 1, a = se(r, t),
|
|
95
|
+
const i = { ...r };
|
|
96
|
+
r.fixedStart || (i.start = o), r.fixedEnd || (i.end = "numbers" !== r.by && Number.isInteger(a) ? a + 1 : a);
|
|
97
|
+
const { inner: l, endText: d } = ((e, t) => {
|
|
98
|
+
const { start: s, end: r } = e, o = e.interval ?? 1, a = se(r, t), i = (e, t) => Array.from({ length: e }, (e, n) => t(n));
|
|
99
99
|
switch (e.by) {
|
|
100
100
|
case "numbers": {
|
|
101
101
|
const e = Math.max(1, Math.ceil(Number(((r - s) / o).toPrecision(12)))), t = Number.isInteger(Number(((r - s) / o).toPrecision(12))), n = Number.isInteger(s) && Number.isInteger(o);
|
|
102
102
|
return {
|
|
103
|
-
inner:
|
|
104
|
-
const
|
|
105
|
-
return `${ne(
|
|
103
|
+
inner: i(e, (a) => {
|
|
104
|
+
const i = s + a * o, l = a === e - 1 && t ? r : n ? i + o - 1 : i + o;
|
|
105
|
+
return `${ne(i)}-${ne(l)}`;
|
|
106
106
|
}),
|
|
107
107
|
endText: ne(t ? r : s + e * o)
|
|
108
108
|
};
|
|
@@ -118,7 +118,7 @@ var Y = [
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
return {
|
|
121
|
-
inner:
|
|
121
|
+
inner: i(Math.max(1, Math.ceil((r - s) / o)), (e) => {
|
|
122
122
|
const n = s + e * o;
|
|
123
123
|
return `${se(n, t)} - ${se(Math.min(n + o - 1, r), t)}`;
|
|
124
124
|
}),
|
|
@@ -140,26 +140,26 @@ var Y = [
|
|
|
140
140
|
case "years": {
|
|
141
141
|
const e = n(s, t)?.year ?? 0;
|
|
142
142
|
return {
|
|
143
|
-
inner:
|
|
143
|
+
inner: i((n(r, t)?.year ?? e) - e + 1, (t) => String(e + t)),
|
|
144
144
|
endText: a
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
case "hours": return {
|
|
148
|
-
inner:
|
|
148
|
+
inner: i(24, (e) => `${e % 12 == 0 ? 12 : e % 12} ${e < 12 ? "AM" : "PM"}`),
|
|
149
149
|
endText: a
|
|
150
150
|
};
|
|
151
151
|
default: return {
|
|
152
|
-
inner:
|
|
152
|
+
inner: i(60, (e) => `:${String(e).padStart(2, "0")}`),
|
|
153
153
|
endText: a
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
})(
|
|
156
|
+
})(i, s), u = "numbers" === i.by ? ne(i.start) : se(i.start, s);
|
|
157
157
|
return {
|
|
158
158
|
...e,
|
|
159
|
-
range:
|
|
159
|
+
range: i,
|
|
160
160
|
items: [
|
|
161
161
|
`<${u}`,
|
|
162
|
-
...
|
|
162
|
+
...l,
|
|
163
163
|
`>${d}`
|
|
164
164
|
]
|
|
165
165
|
};
|
|
@@ -191,37 +191,37 @@ var Y = [
|
|
|
191
191
|
n += t, s += t.length;
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
|
-
const a = "'" === o,
|
|
195
|
-
if (!a && !
|
|
194
|
+
const a = "'" === o, i = a ? null : /^[\p{L}_][\p{L}\p{N}_.]*/u.exec(e.slice(s))?.[0];
|
|
195
|
+
if (!a && !i) {
|
|
196
196
|
n += o, s++;
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
|
-
const
|
|
200
|
-
if (a || (s +=
|
|
199
|
+
const l = a ? r() : i;
|
|
200
|
+
if (a || (s += l.length), "(" !== e[s]) {
|
|
201
201
|
if ("[" === e[s]) {
|
|
202
202
|
s++;
|
|
203
203
|
let o = "";
|
|
204
204
|
for ("'" === e[s] && (o = r()); s < e.length && "]" !== e[s];) o += e[s++];
|
|
205
205
|
s++;
|
|
206
|
-
const a = t(
|
|
206
|
+
const a = t(l, o);
|
|
207
207
|
if (null === a) return null;
|
|
208
208
|
n += a;
|
|
209
209
|
continue;
|
|
210
210
|
}
|
|
211
|
-
n += t(
|
|
212
|
-
} else n +=
|
|
211
|
+
n += t(l, null) ?? (a ? `'${l.replace(/'/g, "''")}'` : l);
|
|
212
|
+
} else n += l;
|
|
213
213
|
}
|
|
214
214
|
return n;
|
|
215
215
|
}, ae = (e) => {
|
|
216
216
|
let t = "";
|
|
217
217
|
for (let n = e + 1; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
218
218
|
return `${t}1`;
|
|
219
|
-
},
|
|
219
|
+
}, ie = (e, t) => ({
|
|
220
220
|
rowStart: 0,
|
|
221
221
|
colStart: e,
|
|
222
222
|
rowEnd: t - 1,
|
|
223
223
|
colEnd: e
|
|
224
|
-
}),
|
|
224
|
+
}), le = (e, t) => {
|
|
225
225
|
const n = [];
|
|
226
226
|
for (let s = 0; s < t; s++) n.push([s, [[0, e.map((e) => e[s] ?? null)]]]);
|
|
227
227
|
return n;
|
|
@@ -229,41 +229,41 @@ var Y = [
|
|
|
229
229
|
const n = t.fields ?? [], s = [], r = [], o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (e, t) => {
|
|
230
230
|
if (o.has(e)) return !0;
|
|
231
231
|
if (t.includes(e)) return !1;
|
|
232
|
-
const
|
|
232
|
+
const l = [];
|
|
233
233
|
oe(n[e].formula, (e) => {
|
|
234
|
-
const t = n.findIndex((t) =>
|
|
235
|
-
return t >= 0 &&
|
|
234
|
+
const t = n.findIndex((t) => I(t.name, e));
|
|
235
|
+
return t >= 0 && l.push(t), t >= 0 ? "" : null;
|
|
236
236
|
});
|
|
237
|
-
for (const r of
|
|
237
|
+
for (const r of l) if (m(n[r])) {
|
|
238
238
|
if (!i(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({
|
|
241
241
|
field: e,
|
|
242
242
|
expression: ""
|
|
243
243
|
}), !0;
|
|
244
|
-
},
|
|
245
|
-
for (const [t, s] of (e.dataFields ?? []).entries()) if (
|
|
244
|
+
}, l = [];
|
|
245
|
+
for (const [t, s] of (e.dataFields ?? []).entries()) if (m(n[s.field])) {
|
|
246
246
|
if (!i(s.field, [])) return null;
|
|
247
|
-
|
|
247
|
+
l.push({
|
|
248
248
|
data: t,
|
|
249
249
|
formula: o.get(s.field)
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const d = (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) => I(t.name, e));
|
|
255
|
+
return r >= 0 ? ae(m(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), d);
|
|
260
260
|
if (null === t) return null;
|
|
261
261
|
e.expression = t;
|
|
262
262
|
}
|
|
263
263
|
return {
|
|
264
264
|
operands: s,
|
|
265
265
|
formulas: r,
|
|
266
|
-
measures:
|
|
266
|
+
measures: l
|
|
267
267
|
};
|
|
268
268
|
}, ue = /* @__PURE__ */ new Set([
|
|
269
269
|
"sum",
|
|
@@ -343,30 +343,30 @@ var Y = [
|
|
|
343
343
|
percent: 13,
|
|
344
344
|
percentDiff: 14
|
|
345
345
|
}, Ie = (e, t, n, s) => {
|
|
346
|
-
const r =
|
|
346
|
+
const r = P.peek(), o = e.fields, a = t.fields;
|
|
347
347
|
if (!r || !o || !a || o.length !== a.length) return null;
|
|
348
|
-
if (
|
|
348
|
+
if (O(e)) return {
|
|
349
349
|
cells: [],
|
|
350
|
-
...
|
|
350
|
+
...L,
|
|
351
351
|
rowPageCount: 0,
|
|
352
352
|
columnPageCount: 0,
|
|
353
|
-
header:
|
|
353
|
+
header: i(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 l =
|
|
361
|
-
if (l && !
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
360
|
+
const l = h(e, a), d = l ? s?.filters : null;
|
|
361
|
+
if (l && !d) return null;
|
|
362
|
+
const u = o.some((e) => e.items?.some((e) => e.calculated));
|
|
363
|
+
if (u && !d?.calculatedRecords) return null;
|
|
364
|
+
const c = de(e, t);
|
|
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: m, records: p, values:
|
|
367
|
+
const f = xe(e, t, n, d?.calculatedRecords, c.operands);
|
|
368
|
+
if (!f) return null;
|
|
369
|
+
const { items: m, records: p, values: g, n: w } = f, v = (e) => !!e && (!e.noRecords || b(e)), F = e.form ?? "compact", y = (e) => {
|
|
370
370
|
const t = [];
|
|
371
371
|
for (const n of e ?? []) {
|
|
372
372
|
if (n === ce) {
|
|
@@ -378,7 +378,7 @@ var Y = [
|
|
|
378
378
|
}
|
|
379
379
|
const e = o[n], s = e?.subtotals;
|
|
380
380
|
if (!e || !v(a[n])) return null;
|
|
381
|
-
if (
|
|
381
|
+
if (u && s && s.some((e) => "default" !== e)) return null;
|
|
382
382
|
t.push({
|
|
383
383
|
field: n,
|
|
384
384
|
form: e.form ?? "compact"
|
|
@@ -387,27 +387,27 @@ var Y = [
|
|
|
387
387
|
return t;
|
|
388
388
|
}, I = y(e.rowFields), x = y(e.columnFields), A = e.pageFields ?? [];
|
|
389
389
|
if (!I || !x || A.some((e) => !v(a[e.field]))) return null;
|
|
390
|
-
const C =
|
|
391
|
-
return C.pageFields?.some((e) => !v(a[e.field])) ? null : Te(e, t, m, I, x, Se(r, C, m, p,
|
|
390
|
+
const C = N(e, s?.slicerFields);
|
|
391
|
+
return C.pageFields?.some((e) => !v(a[e.field])) ? null : Te(e, t, m, I, x, Se(r, C, m, p, g, I, x, w, 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 = V(t);
|
|
394
394
|
if (!t.records) return null;
|
|
395
|
-
const
|
|
396
|
-
if (!
|
|
397
|
-
const
|
|
398
|
-
const s = !t.fields?.[e]?.noRecords, r = s ?
|
|
399
|
-
for (let e = 0; e < f; e++)
|
|
400
|
-
for (let e = 0; e < m; e++)
|
|
401
|
-
return
|
|
395
|
+
const i = te(t, n.isDate1904());
|
|
396
|
+
if (!i) return null;
|
|
397
|
+
const l = !0 === t.fields?.some(b), d = l ? u(t.items, o) : a, c = l ? u(t.records, o) : i, f = t.recordCount ?? 0, m = s?.count ?? 0, p = f + m, h = (e, n) => {
|
|
398
|
+
const s = !t.fields?.[e]?.noRecords, r = s ? c[e] : i[e] ?? [], o = s ? d[e] : a[e], l = new Array(p);
|
|
399
|
+
for (let e = 0; e < f; e++) l[e] = j(o[r[e]]);
|
|
400
|
+
for (let e = 0; e < m; e++) l[f + e] = n?.[e] ?? null;
|
|
401
|
+
return l;
|
|
402
402
|
}, g = [...(e.dataFields ?? []).map((e, t) => h(e.field, s?.values[t])), ...r.map((e) => h(e))];
|
|
403
403
|
return {
|
|
404
404
|
items: a,
|
|
405
|
-
records: s ?
|
|
405
|
+
records: s ? i.map((e, t) => e.concat(s.ids[t] ?? [])) : i,
|
|
406
406
|
values: g,
|
|
407
407
|
n: p
|
|
408
408
|
};
|
|
409
|
-
}, Ae = async (e, t, n, s, r, o, a,
|
|
410
|
-
const d =
|
|
409
|
+
}, Ae = async (e, t, n, s, r, o, a, i, l) => {
|
|
410
|
+
const d = P.peek(), u = e.dataFields?.[r];
|
|
411
411
|
if (!d || !e.fields || !u || void 0 === pe[u.subtotal ?? "sum"]) return null;
|
|
412
412
|
const c = [e.rowFields, e.columnFields].map((e) => (e ?? []).filter((e) => e !== ce)), f = c.findIndex((e) => e.includes(s)), m = c[f];
|
|
413
413
|
if (!m) return null;
|
|
@@ -421,46 +421,46 @@ var Y = [
|
|
|
421
421
|
return n;
|
|
422
422
|
})
|
|
423
423
|
};
|
|
424
|
-
}), { columnGrandTotals: g, ...w } = e, { showDataAs: v, ...F } = u,
|
|
424
|
+
}), { columnGrandTotals: g, ...w } = e, { showDataAs: v, ...F } = u, b = {
|
|
425
425
|
...w,
|
|
426
426
|
fields: h,
|
|
427
427
|
rowFields: [...p, s],
|
|
428
428
|
columnFields: [],
|
|
429
429
|
dataFields: [F],
|
|
430
430
|
rowGrandTotals: !1
|
|
431
|
-
},
|
|
432
|
-
...
|
|
433
|
-
values: [
|
|
434
|
-
} :
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
438
|
-
const { items:
|
|
431
|
+
}, y = i ? {
|
|
432
|
+
...i,
|
|
433
|
+
values: [i.values[r] ?? []]
|
|
434
|
+
} : i, I = de(b, t);
|
|
435
|
+
if (!I || I.measures.length > 0 && !l) return null;
|
|
436
|
+
const x = xe(b, t, n, y, I.operands);
|
|
437
|
+
if (!x) return null;
|
|
438
|
+
const { items: A, records: C, values: E, n: S } = x, k = b.rowFields.map((e) => ({
|
|
439
439
|
field: e,
|
|
440
440
|
form: "compact"
|
|
441
441
|
}));
|
|
442
442
|
let M;
|
|
443
443
|
if (a) {
|
|
444
444
|
const e = 0 === f ? 1 : 2;
|
|
445
|
-
M = new Uint8Array(
|
|
446
|
-
for (let t = 0; t <
|
|
445
|
+
M = new Uint8Array(S);
|
|
446
|
+
for (let t = 0; t < S; 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
|
|
451
|
+
const T = I.measures.length > 0 ? await Ee(d, I, b, A, C, E, k, [], S, o, M, l) : void 0, O = Se(d, b, A, C, E, k, [], S, o, M, I.operands.length, T), R = (t, n) => e.fields[t].items?.[n]?.item ?? n, N = /* @__PURE__ */ new Map(), _ = O.columns.length;
|
|
452
|
+
return O.rows.forEach((e, t) => {
|
|
453
453
|
if (0 !== e.kind || e.path.length !== p.length + 1) return;
|
|
454
|
-
const n = p.map((t, n) =>
|
|
454
|
+
const n = p.map((t, n) => R(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(R(s, e.path[p.length])), r.totals.push(O.values[t * _]);
|
|
460
460
|
}), {
|
|
461
461
|
outer: p,
|
|
462
462
|
groups: N,
|
|
463
|
-
records:
|
|
463
|
+
records: C
|
|
464
464
|
};
|
|
465
465
|
}, Ce = (e, t, n) => {
|
|
466
466
|
const s = new Uint32Array(t).fill(fe), r = new Uint8Array(t), o = e.items;
|
|
@@ -473,8 +473,8 @@ var Y = [
|
|
|
473
473
|
ranks: s,
|
|
474
474
|
flags: r
|
|
475
475
|
};
|
|
476
|
-
}, Ee = async (e, t, n, s, r, o,
|
|
477
|
-
const { request: m, errors: p } = Pe(e, n, s, r, o,
|
|
476
|
+
}, Ee = async (e, t, n, s, r, o, i, l, d, u, c, f) => {
|
|
477
|
+
const { request: m, errors: p } = Pe(e, n, s, r, o, i, l, d, u, c, t.operands.length);
|
|
478
478
|
let h = 0;
|
|
479
479
|
const g = [];
|
|
480
480
|
try {
|
|
@@ -485,7 +485,7 @@ var Y = [
|
|
|
485
485
|
t.operands.forEach((t, n) => {
|
|
486
486
|
const o = s.values(r + n);
|
|
487
487
|
try {
|
|
488
|
-
const t =
|
|
488
|
+
const t = J(e.wasm_memory().buffer, o, p), n = new Array(h);
|
|
489
489
|
for (let e = 0; e < h; e++) n[e] = t(e);
|
|
490
490
|
g.push(n);
|
|
491
491
|
} finally {
|
|
@@ -504,32 +504,32 @@ var Y = [
|
|
|
504
504
|
for (let s = 0; s < n; s++) t[s] = e[s] ?? 0;
|
|
505
505
|
return t[n] = 0, t;
|
|
506
506
|
}), a = await s.evaluateBatch({
|
|
507
|
-
values:
|
|
507
|
+
values: le(o, r),
|
|
508
508
|
formulas: e.formulas.map(({ expression: e }, n) => ({
|
|
509
509
|
expression: e,
|
|
510
|
-
coords:
|
|
510
|
+
coords: ie(t.length + n, r)
|
|
511
511
|
}))
|
|
512
|
-
}),
|
|
512
|
+
}), i = /* @__PURE__ */ new Map();
|
|
513
513
|
for (const { data: t, formula: n } of e.measures) {
|
|
514
514
|
const e = new Array(r);
|
|
515
515
|
for (let t = 0; t < r; t++) e[t] = a[n].getValueAt(t, 0) ?? 0;
|
|
516
|
-
|
|
516
|
+
i.set(t, e);
|
|
517
517
|
}
|
|
518
|
-
return
|
|
518
|
+
return i;
|
|
519
519
|
})(t, g, h, f);
|
|
520
|
-
}, Se = (e, t, n, s, r, o,
|
|
521
|
-
const { request: p, errors: h } = Pe(e, t, n, s, r, o,
|
|
520
|
+
}, Se = (e, t, n, s, r, o, i, l, d, u, c = 0, f, m = !1) => {
|
|
521
|
+
const { request: p, errors: h } = Pe(e, t, n, s, r, o, i, l, d, u, c, f, m), g = h.codeOf(a.BuiltIn.NA), w = h.codeOf(a.BuiltIn.Null), v = p.lay_out(0, g, w);
|
|
522
522
|
try {
|
|
523
523
|
const n = ke(v.row_lines(), v.row_stride()), s = ke(v.column_lines(), v.column_stride()), r = v.states(), a = v.values();
|
|
524
524
|
try {
|
|
525
|
-
const
|
|
526
|
-
for (let e = 0; e < r.length; e++) d[e] = 0 === r[e] ?
|
|
525
|
+
const l = J(e.wasm_memory().buffer, a, h), d = new Array(r.length);
|
|
526
|
+
for (let e = 0; e < r.length; e++) d[e] = 0 === r[e] ? l(e) : null;
|
|
527
527
|
return {
|
|
528
528
|
rows: n,
|
|
529
529
|
columns: s,
|
|
530
530
|
states: r,
|
|
531
531
|
values: d,
|
|
532
|
-
functions: m ? Fe(t, [...o, ...
|
|
532
|
+
functions: m ? Fe(t, [...o, ...i]) : []
|
|
533
533
|
};
|
|
534
534
|
} finally {
|
|
535
535
|
a.free();
|
|
@@ -537,14 +537,14 @@ var Y = [
|
|
|
537
537
|
} finally {
|
|
538
538
|
v.free(), p.free();
|
|
539
539
|
}
|
|
540
|
-
}, Pe = (e, t, n, s, r, o, a,
|
|
541
|
-
const m = t.fields, p = new e.LayoutRequest(
|
|
540
|
+
}, Pe = (e, t, n, s, r, o, a, i, l, d, u = 0, c, f = !1) => {
|
|
541
|
+
const m = t.fields, p = new e.LayoutRequest(i), h = f ? Fe(t, [...o, ...a]) : [], g = [], w = (e, s) => {
|
|
542
542
|
for (const { field: r, form: o } of s) {
|
|
543
543
|
if (r === ce) {
|
|
544
544
|
p.add_values_slot(e, "tabular" === o);
|
|
545
545
|
continue;
|
|
546
546
|
}
|
|
547
|
-
const a = m[r],
|
|
547
|
+
const a = m[r], i = a.subtotals, l = (!i || i.includes("default") ? 1 : 0) | (!1 !== a.subtotalsOnTop ? 2 : 0) | (a.blankRowAfter ? 4 : 0) | (a.showItemsWithNoData ? 8 : 0) | ("tabular" === o ? 16 : 0), d = p.add_field(e, n[r].length, l), u = a.sort;
|
|
548
548
|
void 0 !== u?.dataField && p.set_field_sort(e, d, u.dataField, "descending" === u.order, new Uint32Array((u.scope?.items ?? []).map((e) => e.item)));
|
|
549
549
|
const c = f ? ve(a) : [];
|
|
550
550
|
if (c.length > 0) {
|
|
@@ -569,8 +569,8 @@ var Y = [
|
|
|
569
569
|
if (!n) return;
|
|
570
570
|
let s = 2, r = o.findIndex((t) => t.field === e.baseField);
|
|
571
571
|
r >= 0 ? s = 0 : (r = a.findIndex((t) => t.field === e.baseField), r >= 0 && (s = 1));
|
|
572
|
-
const
|
|
573
|
-
p.set_show_as(t, n, s, Math.max(r, 0),
|
|
572
|
+
const i = "previous" === e.baseItem ? 4294967294 : "next" === e.baseItem ? 4294967295 : e.baseItem ?? 0;
|
|
573
|
+
p.set_show_as(t, n, s, Math.max(r, 0), i);
|
|
574
574
|
});
|
|
575
575
|
for (let e = 0; e < u; e++) p.add_measure(b.length + e, pe.sum);
|
|
576
576
|
u > 0 && p.set_operand_measures(u);
|
|
@@ -582,33 +582,33 @@ var Y = [
|
|
|
582
582
|
}));
|
|
583
583
|
p.set_grand(!1 !== t.rowGrandTotals, !1 !== t.columnGrandTotals);
|
|
584
584
|
const I = d ? p.record_keep() : null, x = e.wasm_memory().buffer;
|
|
585
|
-
d && null !== I && new Uint8Array(x, I,
|
|
585
|
+
d && null !== I && new Uint8Array(x, I, i).set(d.subarray(0, i));
|
|
586
586
|
for (const { axis: e, slot: t, field: r } of g) {
|
|
587
587
|
const o = n[r].length;
|
|
588
|
-
new Uint32Array(x, p.field_ids(e, t),
|
|
589
|
-
const { ranks: a, flags: d } = Ce(m[r], o,
|
|
588
|
+
new Uint32Array(x, p.field_ids(e, t), i).set(s[r].slice(0, i));
|
|
589
|
+
const { ranks: a, flags: d } = Ce(m[r], o, l?.get(r));
|
|
590
590
|
new Uint32Array(x, p.field_ranks(e, t), o).set(a), new Uint8Array(x, p.field_flags(e, t), o).set(d);
|
|
591
591
|
}
|
|
592
592
|
for (const { page: e, index: t } of v) {
|
|
593
593
|
const r = n[e.field].length;
|
|
594
|
-
new Uint32Array(x, p.page_ids(t),
|
|
595
|
-
const { ranks: o, flags: a } = Ce(m[e.field], r), d = new Uint8Array(x, p.page_keep(t), r), u = void 0 !== e.item ? m[e.field].items?.[e.item]?.item : void 0, c = e.slicer ?
|
|
594
|
+
new Uint32Array(x, p.page_ids(t), i).set(s[e.field].slice(0, i));
|
|
595
|
+
const { ranks: o, flags: a } = Ce(m[e.field], r), d = new Uint8Array(x, p.page_keep(t), r), u = void 0 !== e.item ? m[e.field].items?.[e.item]?.item : void 0, c = e.slicer ? l?.get(e.field) : void 0;
|
|
596
596
|
for (let t = 0; t < r; t++) {
|
|
597
597
|
const n = void 0 !== u ? t === u : !(o[t] === fe && m[e.field].items || 1 & a[t]);
|
|
598
598
|
d[t] = !n || c && 0 === c[t] ? 0 : 1;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
const A = new
|
|
601
|
+
const A = new Q();
|
|
602
602
|
F.forEach((e, t) => {
|
|
603
603
|
const n = {
|
|
604
|
-
doubles: new Float64Array(x, e,
|
|
605
|
-
ints: new Int32Array(x, e, 2 *
|
|
606
|
-
types: new Uint8Array(x, e + 8 *
|
|
604
|
+
doubles: new Float64Array(x, e, i),
|
|
605
|
+
ints: new Int32Array(x, e, 2 * i),
|
|
606
|
+
types: new Uint8Array(x, e + 8 * i, i)
|
|
607
607
|
}, s = {
|
|
608
608
|
ok: !0,
|
|
609
609
|
numeric: !0
|
|
610
610
|
}, o = r[t];
|
|
611
|
-
for (let e = 0; e <
|
|
611
|
+
for (let e = 0; e < i; e++) X(n, e, o[e], A, s);
|
|
612
612
|
});
|
|
613
613
|
for (const { column: e, ptr: t } of y) {
|
|
614
614
|
const n = e.length, s = {
|
|
@@ -649,93 +649,93 @@ var Y = [
|
|
|
649
649
|
} else s.type = 1 === e.kind ? null !== e.function ? t[e.function] : "default" : 2 === e.kind ? "grand" : "blank", s.items = 2 === e.kind ? [0] : e.path.slice();
|
|
650
650
|
return null !== e.data && e.data > 0 && (s.dataField = e.data), s;
|
|
651
651
|
});
|
|
652
|
-
}, Te = (e, t, n, s, r,
|
|
653
|
-
const
|
|
654
|
-
if (e === ce) return
|
|
655
|
-
const s =
|
|
652
|
+
}, Te = (e, t, n, s, r, d, u, c, m) => {
|
|
653
|
+
const p = e.fields, h = t.fields, g = e.dataFields ?? [], w = (t) => t === ce ? e.valuesCaption ?? "Values" : p[t].name ?? h[t].name, v = (e, t) => {
|
|
654
|
+
if (e === ce) return g[t]?.name ?? "";
|
|
655
|
+
const s = p[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 = j(n[e][s?.item ?? t]);
|
|
658
|
+
return null === r ? D : r;
|
|
659
|
+
}, F = (e, t) => {
|
|
660
|
+
const n = v(e, t);
|
|
661
661
|
if ("number" == typeof n) {
|
|
662
|
-
const r =
|
|
663
|
-
return o(
|
|
662
|
+
const r = p[e].items?.[t]?.item ?? t, a = void 0 === (p[e].numberFormat ?? h[e].numberFormat) && G(h[e], r);
|
|
663
|
+
return o(u, a ? z(x(h[e], r), u) : z(p[s = e].numberFormat ?? h[s].numberFormat, u), n);
|
|
664
664
|
}
|
|
665
665
|
var s;
|
|
666
666
|
return a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
667
|
-
},
|
|
668
|
-
if (void 0 !== e.item) return
|
|
669
|
-
const t =
|
|
667
|
+
}, b = (e) => {
|
|
668
|
+
if (void 0 !== e.item) return v(e.field, e.item);
|
|
669
|
+
const t = p[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) => M(e) && !e.hidden ? [t] : []);
|
|
672
|
+
return 1 === n.length ? v(e.field, n[0]) : "(Multiple Items)";
|
|
673
|
+
}, y = e.grandTotalCaption ?? "Grand Total", I = c ? /* @__PURE__ */ new Map() : null, C = (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
|
+
}, E = (e) => e === ce ? null : {
|
|
681
681
|
kind: "fieldCaption",
|
|
682
682
|
field: e
|
|
683
|
-
},
|
|
683
|
+
}, S = (e, t) => 2 === e.kind && t === y ? { kind: "grandTotal" } : null, P = 0 === s.length && 0 === r.length && 0 === g.length, k = P ? {
|
|
684
684
|
firstHeaderRow: 0,
|
|
685
685
|
firstDataRow: 0,
|
|
686
686
|
firstDataCol: 0
|
|
687
|
-
} :
|
|
687
|
+
} : i(e), O = P ? [] : Me(d.rows, d.functions), R = P ? [] : Me(d.columns, d.functions), N = A({
|
|
688
688
|
...e,
|
|
689
|
-
header:
|
|
690
|
-
rowLines:
|
|
691
|
-
columnLines:
|
|
692
|
-
}), _ =
|
|
689
|
+
header: k,
|
|
690
|
+
rowLines: O,
|
|
691
|
+
columnLines: R
|
|
692
|
+
}), _ = d.columns.length, L = (e) => "row" === e ? s : r, $ = (t) => {
|
|
693
693
|
switch (t.kind) {
|
|
694
694
|
case "pageCaption": {
|
|
695
695
|
const n = e.pageFields[t.page].field;
|
|
696
|
-
return [
|
|
696
|
+
return [w(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 [b(n), {
|
|
704
704
|
kind: "pageItem",
|
|
705
705
|
page: t.page
|
|
706
706
|
}];
|
|
707
707
|
}
|
|
708
|
-
case "dataCaption": return [
|
|
708
|
+
case "dataCaption": return [g[t.data]?.name ?? null, {
|
|
709
709
|
kind: "dataCaption",
|
|
710
710
|
data: t.data
|
|
711
711
|
}];
|
|
712
712
|
case "rowHeader": return [s.every((e) => e.field === ce) ? e.valuesCaption ?? "Values" : e.rowHeaderCaption ?? "Row Labels", { kind: "rowHeader" }];
|
|
713
713
|
case "columnHeader": return [e.columnHeaderCaption ?? "Column Labels", { kind: "columnHeader" }];
|
|
714
714
|
case "fieldCaption": {
|
|
715
|
-
const e =
|
|
716
|
-
return [
|
|
715
|
+
const e = L(t.axis)[t.level].field;
|
|
716
|
+
return [w(e), E(e)];
|
|
717
717
|
}
|
|
718
718
|
case "label": {
|
|
719
|
-
const e =
|
|
720
|
-
return [
|
|
719
|
+
const e = L(t.axis)[t.level].field, n = t.line.path[t.level];
|
|
720
|
+
return [v(e, n), C(e, n)];
|
|
721
721
|
}
|
|
722
722
|
case "total": {
|
|
723
|
-
const e = ("row" === t.axis ?
|
|
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 =
|
|
723
|
+
const e = ("row" === t.axis ? d.rows : d.columns)[t.line.index], n = ((e, t) => {
|
|
724
|
+
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ? g[t.data]?.name ?? "" : "";
|
|
725
|
+
if (2 === t.kind) return n ? `Total ${s}` : y;
|
|
726
|
+
const r = t.path.length - 1, o = e[r].field, a = F(o, t.path[r]);
|
|
727
727
|
if (null !== t.function) {
|
|
728
|
-
const e = we[
|
|
729
|
-
return (n || t.across) && null !== t.data ? `${a} ${e} of ${
|
|
728
|
+
const e = we[d.functions[t.function]];
|
|
729
|
+
return (n || t.across) && null !== t.data ? `${a} ${e} of ${w(g[t.data].field)}` : `${a} ${e}`;
|
|
730
730
|
}
|
|
731
|
-
return
|
|
732
|
-
})(
|
|
733
|
-
return [n,
|
|
731
|
+
return p[o]?.subtotalCaption ?? (n ? `${a} ${s}` : `${a} Total`);
|
|
732
|
+
})(L(t.axis), e);
|
|
733
|
+
return [n, S(e, n)];
|
|
734
734
|
}
|
|
735
735
|
case "value": {
|
|
736
|
-
const n = t.row.index * _ + t.column.index, s =
|
|
736
|
+
const n = t.row.index * _ + t.column.index, s = d.states[n];
|
|
737
737
|
let r = null;
|
|
738
|
-
return 0 === s ? (r =
|
|
738
|
+
return 0 === s ? (r = d.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;
|
|
740
740
|
const t = e.trim();
|
|
741
741
|
if (!/^[+-]?\d*(?:\.\d*)?$/.test(t)) return e;
|
|
@@ -744,118 +744,118 @@ var Y = [
|
|
|
744
744
|
})(e.emptyCaption)), [r, null];
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
},
|
|
748
|
-
const n =
|
|
747
|
+
}, V = new f.Builder(), U = N.top, H = N.pages.reduce((e, t) => Math.max(e, t.column + 2), 0), B = (e, t) => {
|
|
748
|
+
const n = T(N, e, t);
|
|
749
749
|
if (!n) return;
|
|
750
|
-
const [s, r] =
|
|
750
|
+
const [s, r] = $(n);
|
|
751
751
|
((e, t, n) => {
|
|
752
|
-
|
|
753
|
-
})(e -
|
|
752
|
+
I && n && I.set(e + "," + t, n);
|
|
753
|
+
})(e - U, t, r), null !== s && (m ? V.pushAt(t, e - U, s) : V.pushAt(e - U, t, s));
|
|
754
754
|
};
|
|
755
|
-
if (
|
|
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++)
|
|
755
|
+
if (m) {
|
|
756
|
+
const e = Math.max(H, N.columns.length);
|
|
757
|
+
for (let t = 0; t < e; t++) for (let e = 0; e < N.rows.length; e++) t < (e < U ? H : N.columns.length) && B(e, t);
|
|
758
|
+
} else for (let e = 0; e < N.rows.length; e++) {
|
|
759
|
+
const t = e < U ? H : N.columns.length;
|
|
760
|
+
for (let n = 0; n < t; n++) B(e, n);
|
|
761
761
|
}
|
|
762
|
-
if (
|
|
763
|
-
const t =
|
|
762
|
+
if (P) {
|
|
763
|
+
const t = l(e);
|
|
764
764
|
return {
|
|
765
|
-
cells:
|
|
765
|
+
cells: V.build()?.tuples ?? [],
|
|
766
766
|
rows: 1,
|
|
767
767
|
columns: 1,
|
|
768
768
|
rowPageCount: t.rows,
|
|
769
769
|
columnPageCount: t.columns,
|
|
770
|
-
header:
|
|
770
|
+
header: k,
|
|
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 K = (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
|
-
},
|
|
784
|
-
|
|
785
|
-
3 === t.kind || Z(t) || (
|
|
786
|
-
const o =
|
|
783
|
+
}, J = (e, t) => q(e.data ?? t.data ?? 0, [...K(s, e), ...K(r, t)]), [Q] = d.rows, [W] = d.columns, X = Q && W && 3 !== Q.kind && 3 !== W.kind ? J(Q, W) : null, Y = [], Z = (e) => 1 === e.kind && null !== e.function;
|
|
784
|
+
d.rows.forEach((t, n) => {
|
|
785
|
+
3 === t.kind || Z(t) || (K(s, t), d.columns.forEach((s, r) => {
|
|
786
|
+
const o = d.states[n * _ + r];
|
|
787
787
|
if (3 === s.kind || Z(s) || 0 !== o && 1 !== o) return;
|
|
788
|
-
let i = 0 === o ?
|
|
789
|
-
e.showError && a.isError(i) && (i = e.errorCaption || 0), Y.push([
|
|
788
|
+
let i = 0 === o ? d.values[n * _ + r] : 0;
|
|
789
|
+
e.showError && a.isError(i) && (i = e.errorCaption || 0), Y.push([J(t, s), i]);
|
|
790
790
|
}));
|
|
791
791
|
});
|
|
792
|
-
const ee =
|
|
792
|
+
const ee = l(e);
|
|
793
793
|
return {
|
|
794
|
-
cells:
|
|
795
|
-
rows:
|
|
796
|
-
columns:
|
|
794
|
+
cells: V.build()?.tuples ?? [],
|
|
795
|
+
rows: N.rows.length - U,
|
|
796
|
+
columns: N.columns.length,
|
|
797
797
|
rowPageCount: ee.rows,
|
|
798
798
|
columnPageCount: ee.columns,
|
|
799
|
-
header:
|
|
800
|
-
rowLines:
|
|
801
|
-
columnLines:
|
|
799
|
+
header: k,
|
|
800
|
+
rowLines: O,
|
|
801
|
+
columnLines: R,
|
|
802
802
|
viewValues: Y,
|
|
803
803
|
firstKey: X,
|
|
804
|
-
...
|
|
804
|
+
...I ? { roles: I } : {}
|
|
805
805
|
};
|
|
806
|
-
},
|
|
806
|
+
}, Oe = (e, t, n, s, r = !1, i, l) => {
|
|
807
807
|
const d = Ie(e, t, s, {
|
|
808
|
-
filters:
|
|
809
|
-
slicerFields:
|
|
808
|
+
filters: i,
|
|
809
|
+
slicerFields: l
|
|
810
810
|
});
|
|
811
811
|
if (!d) return null;
|
|
812
|
-
const u = d.rowPageCount > 0 ? d.rowPageCount + 1 : 0,
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
rowStart:
|
|
816
|
-
colStart:
|
|
817
|
-
rowEnd:
|
|
818
|
-
colEnd:
|
|
819
|
-
},
|
|
820
|
-
const n =
|
|
821
|
-
const n =
|
|
822
|
-
var
|
|
823
|
-
const
|
|
812
|
+
const u = d.rowPageCount > 0 ? d.rowPageCount + 1 : 0, c = d.rowPageCount > 0 ? 3 * d.columnPageCount - 1 : 0, { rowStart: f, colStart: m } = n;
|
|
813
|
+
if (f - u < 0) return null;
|
|
814
|
+
const p = {
|
|
815
|
+
rowStart: f - u,
|
|
816
|
+
colStart: m,
|
|
817
|
+
rowEnd: f + d.rows - 1,
|
|
818
|
+
colEnd: m + Math.max(d.columns, c) - 1
|
|
819
|
+
}, h = e.fields, g = t.fields, w = V(t), v = (e, t) => {
|
|
820
|
+
const n = h[e], r = n.numberFormat ?? g[e].numberFormat, i = z(r, s), l = b(g[e]), d = w[e], u = (n.items ?? []).filter((e) => void 0 !== e.item && void 0 === e.type), c = u.length > 0 ? u : d.map((e, t) => ({ item: t })), f = c.map((t) => {
|
|
821
|
+
const n = j(d[t.item]), u = G(g[e], t.item), c = null === n ? "(blank)" : "number" == typeof n ? o(s, u ? (f = t.item, void 0 === r ? z(x(g[e], f), s) : i) : i, n) : a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
822
|
+
var f;
|
|
823
|
+
const m = l && u ? c : n;
|
|
824
824
|
return void 0 !== t.name ? {
|
|
825
|
-
value:
|
|
826
|
-
text:
|
|
825
|
+
value: m,
|
|
826
|
+
text: c,
|
|
827
827
|
name: t.name
|
|
828
828
|
} : {
|
|
829
|
-
value:
|
|
830
|
-
text:
|
|
829
|
+
value: m,
|
|
830
|
+
text: c
|
|
831
831
|
};
|
|
832
|
-
}),
|
|
833
|
-
name: n.name ??
|
|
834
|
-
items:
|
|
832
|
+
}), m = {
|
|
833
|
+
name: n.name ?? g[e].name,
|
|
834
|
+
items: f
|
|
835
835
|
};
|
|
836
836
|
if (t) {
|
|
837
837
|
const e = void 0 !== t.item ? (n.items ?? [])[t.item]?.item : void 0;
|
|
838
|
-
|
|
838
|
+
m.page = void 0 !== e ? c.findIndex((t) => t.item === e) : -1;
|
|
839
839
|
}
|
|
840
|
-
return
|
|
841
|
-
},
|
|
840
|
+
return m;
|
|
841
|
+
}, F = (e) => (e ?? []).filter((e) => -2 !== e);
|
|
842
842
|
return {
|
|
843
843
|
view: {
|
|
844
|
-
range:
|
|
844
|
+
range: p,
|
|
845
845
|
dataFields: (e.dataFields ?? []).map((e) => ({
|
|
846
846
|
name: e.name,
|
|
847
|
-
sourceName:
|
|
847
|
+
sourceName: g[e.field].name
|
|
848
848
|
})),
|
|
849
849
|
fields: [
|
|
850
|
-
...
|
|
851
|
-
...
|
|
852
|
-
...(e.pageFields ?? []).map((e) =>
|
|
850
|
+
...F(e.rowFields).map((e) => v(e)),
|
|
851
|
+
...F(e.columnFields).map((e) => v(e)),
|
|
852
|
+
...(e.pageFields ?? []).map((e) => v(e.field, e))
|
|
853
853
|
],
|
|
854
854
|
values: d.viewValues,
|
|
855
855
|
block: {
|
|
856
856
|
anchor: {
|
|
857
|
-
row:
|
|
858
|
-
column:
|
|
857
|
+
row: f,
|
|
858
|
+
column: m
|
|
859
859
|
},
|
|
860
860
|
...r ? { blocked: !0 } : {},
|
|
861
861
|
...null !== d.firstKey ? { first: d.firstKey } : {}
|
|
@@ -866,85 +866,85 @@ var Y = [
|
|
|
866
866
|
columns: d.columns
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
|
-
},
|
|
870
|
-
const r = /* @__PURE__ */ new Map(),
|
|
871
|
-
if (0 ===
|
|
872
|
-
const
|
|
873
|
-
for (const o of
|
|
874
|
-
const a = o.field,
|
|
875
|
-
if (!
|
|
876
|
-
const
|
|
877
|
-
for (let e = 0; e <
|
|
878
|
-
const
|
|
879
|
-
if (f) for (let e = 0; e <
|
|
880
|
-
else r.set(a,
|
|
869
|
+
}, Re = async (e, t, n, s) => {
|
|
870
|
+
const r = /* @__PURE__ */ new Map(), i = (e.filters ?? []).filter((t) => g(t) || e.rowFields?.includes(t.field) || e.columnFields?.includes(t.field)), l = e.fields?.some((e) => e.items?.some((e) => e.calculated)), d = e.dataFields?.some((e) => m(t.fields?.[e.field]));
|
|
871
|
+
if (0 === i.length && !l && !d) return { keep: r };
|
|
872
|
+
const u = V(t);
|
|
873
|
+
for (const o of i.filter(g)) {
|
|
874
|
+
const a = o.field, i = u[a];
|
|
875
|
+
if (!i) continue;
|
|
876
|
+
const l = $(o.condition) ? Le(e, t, i, a, n) : null, d = new Array(i.length);
|
|
877
|
+
for (let e = 0; e < i.length; e++) d[e] = l ? l[e] : j(i[e]);
|
|
878
|
+
const c = await _e(o.condition, d, n, s), f = r.get(a);
|
|
879
|
+
if (f) for (let e = 0; e < c.length; e++) f[e] &= c[e];
|
|
880
|
+
else r.set(a, c);
|
|
881
881
|
}
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
if (1 !==
|
|
885
|
-
const
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
882
|
+
const c = l && s ? await (async (e, t, n, s, r) => {
|
|
883
|
+
const i = t.fields ?? [], l = e.fields ?? [], d = i.flatMap((e, t) => e.calculatedItems?.length ? [t] : []), u = e.dataFields ?? [];
|
|
884
|
+
if (1 !== d.length || u.some((e) => m(i[e.field]) || !ue.has(e.subtotal ?? "sum"))) return null;
|
|
885
|
+
const c = d[0], f = i[c].calculatedItems, p = te(t, n.isDate1904());
|
|
886
|
+
if (!p) return null;
|
|
887
|
+
const h = V(t), g = V({
|
|
888
888
|
...t,
|
|
889
|
-
fields:
|
|
890
|
-
}),
|
|
891
|
-
if (!
|
|
892
|
-
const
|
|
893
|
-
const n =
|
|
889
|
+
fields: i.map(({ group: e, ...t }) => t)
|
|
890
|
+
}), w = (e.rowFields ?? []).filter((e) => e >= 0), v = (e.columnFields ?? []).filter((e) => e >= 0), F = w.includes(c) ? w : v.includes(c) ? v : null;
|
|
891
|
+
if (!F) return null;
|
|
892
|
+
const b = F.slice(0, F.indexOf(c)), y = [...F.slice(F.indexOf(c) + 1), ...F === w ? v : w], x = [...b, ...y], A = t.recordCount ?? 0, C = (e, t) => {
|
|
893
|
+
const n = l[e]?.items, s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
894
894
|
return !(n && (!s || s.hidden) || r?.get(e) && 0 === r.get(e)[t]);
|
|
895
|
-
},
|
|
896
|
-
const n =
|
|
895
|
+
}, E = (e, t) => {
|
|
896
|
+
const n = l[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 r =
|
|
902
|
-
return "number" == typeof r && (
|
|
903
|
-
}),
|
|
904
|
-
let t =
|
|
905
|
-
return void 0 === t &&
|
|
900
|
+
}, S = e.pageFields ?? [], P = z(i[c].numberFormat ?? 14, n), k = (e) => h[c].findIndex((t, s) => {
|
|
901
|
+
const r = j(t);
|
|
902
|
+
return "number" == typeof r && (i[c].dates || G(i[c], s)) ? I(o(n, P, r), e) : I(null === r ? D : U(r), e);
|
|
903
|
+
}), M = /* @__PURE__ */ new Map(), T = new Map(f.map((e) => [e.item, e.formula])), O = (e) => {
|
|
904
|
+
let t = M.get(e);
|
|
905
|
+
return void 0 === t && M.set(e, t = M.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 f) if (null === oe(e.formula, (e, t) => {
|
|
908
|
+
if (null === t || !I(i[c].name, e)) return null;
|
|
909
|
+
const n = k(t);
|
|
910
|
+
return n < 0 ? null : (T.has(n) || O(n), "");
|
|
911
911
|
})) return null;
|
|
912
|
-
const
|
|
913
|
-
column:
|
|
914
|
-
values:
|
|
912
|
+
const R = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), _ = u.map((e) => ({
|
|
913
|
+
column: p[e.field],
|
|
914
|
+
values: g[e.field],
|
|
915
915
|
fold: e.subtotal ?? "sum"
|
|
916
|
-
})),
|
|
917
|
-
for (let e = 0; e <
|
|
918
|
-
if (!
|
|
919
|
-
if (!
|
|
916
|
+
})), L = M.size;
|
|
917
|
+
for (let e = 0; e < A; e++) {
|
|
918
|
+
if (!S.every((t) => E(t, p[t.field][e]))) continue;
|
|
919
|
+
if (!x.every((t) => C(t, p[t][e]))) continue;
|
|
920
920
|
let t = "";
|
|
921
|
-
for (const n of
|
|
922
|
-
|
|
923
|
-
const n =
|
|
921
|
+
for (const n of b) t += p[n][e] + ",";
|
|
922
|
+
N.has(t) || N.set(t, e);
|
|
923
|
+
const n = M.get(p[c][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 y) s += p[t][e] + ",";
|
|
927
|
+
let r = R.get(s);
|
|
928
928
|
r || (r = {
|
|
929
|
-
sums:
|
|
930
|
-
errors:
|
|
931
|
-
},
|
|
932
|
-
const { sums: o, errors:
|
|
933
|
-
|
|
934
|
-
const d =
|
|
935
|
-
"sum" === r ? "number" == typeof d ? o[
|
|
929
|
+
sums: u.map(() => new Array(L).fill(0)),
|
|
930
|
+
errors: u.map(() => new Array(L).fill(void 0))
|
|
931
|
+
}, R.set(s, r));
|
|
932
|
+
const { sums: o, errors: i } = r;
|
|
933
|
+
_.forEach(({ column: t, values: s, fold: r }, l) => {
|
|
934
|
+
const d = j(s[t[e]]);
|
|
935
|
+
"sum" === r ? "number" == typeof d ? o[l][n] += d : a.isError(d) && (i[l][n] ??= d) : ("countNums" === r ? "number" == typeof d : null !== d) && (o[l][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 $ = y.map((e) => {
|
|
939
|
+
const t = l[e]?.items;
|
|
940
|
+
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing && C(e, t.item) ? [t.item] : []) : h[e].map((e, t) => t);
|
|
941
941
|
});
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
for (const [e, t] of
|
|
942
|
+
if ($.reduce((e, t) => e * t.length, N.size) > 5e5) return null;
|
|
943
|
+
const H = [];
|
|
944
|
+
for (const [e, t] of N) {
|
|
945
945
|
const n = (e, s, r) => {
|
|
946
|
-
if (e !==
|
|
947
|
-
else
|
|
946
|
+
if (e !== $.length) for (const t of $[e]) n(e + 1, [...s, t], r + t + ",");
|
|
947
|
+
else H.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 B = H.length;
|
|
956
|
+
if (0 === B) return {
|
|
957
957
|
count: 0,
|
|
958
|
-
ids:
|
|
959
|
-
values:
|
|
958
|
+
ids: i.map(() => []),
|
|
959
|
+
values: u.map(() => [])
|
|
960
960
|
};
|
|
961
|
-
const
|
|
962
|
-
for (let e = 0; e <
|
|
963
|
-
const s =
|
|
961
|
+
const K = u.length * L, q = (e, t) => e * L + t, J = (e, t) => K + e * f.length + t, Q = [];
|
|
962
|
+
for (let e = 0; e < u.length; e++) for (let t = 0; t < L; t++) Q.push(H.map(({ key: n }) => {
|
|
963
|
+
const s = R.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 < u.length; e++) for (let t = 0; t < f.length; t++) {
|
|
968
|
+
const n = oe(f[t].formula, (t, n) => {
|
|
969
969
|
if (null === n) return null;
|
|
970
|
-
const s =
|
|
971
|
-
return ae(r >= 0 ?
|
|
970
|
+
const s = k(n), r = f.findIndex((e) => e.item === s);
|
|
971
|
+
return ae(r >= 0 ? J(e, r) : q(e, M.get(s)));
|
|
972
972
|
});
|
|
973
973
|
if (null === n) return null;
|
|
974
974
|
W.push({
|
|
975
975
|
expression: n,
|
|
976
|
-
coords:
|
|
976
|
+
coords: ie(J(e, t), B)
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
const X = await s.evaluateBatch({
|
|
980
|
-
values:
|
|
980
|
+
values: le(Q, B),
|
|
981
981
|
formulas: W
|
|
982
|
-
}), Y =
|
|
983
|
-
|
|
984
|
-
const r =
|
|
985
|
-
Y[s].push(s ===
|
|
982
|
+
}), Y = i.map(() => []), Z = u.map(() => []), ee = (e, t, n, s) => {
|
|
983
|
+
p.forEach((n, s) => {
|
|
984
|
+
const r = y.indexOf(s);
|
|
985
|
+
Y[s].push(s === c ? 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 H.forEach((e, t) => {
|
|
991
|
+
f.forEach(({ item: n }, s) => {
|
|
992
|
+
u.forEach((r, o) => {
|
|
993
|
+
const a = X[o * f.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,55 +1000,55 @@ var Y = [
|
|
|
1000
1000
|
ids: Y,
|
|
1001
1001
|
values: Z
|
|
1002
1002
|
};
|
|
1003
|
-
})(e, t, n, s, r) : void 0,
|
|
1003
|
+
})(e, t, n, s, r) : void 0, f = i.filter((e) => !g(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: o } of
|
|
1010
|
-
const a = await Ae(e, t, n, o.field, o.dataField, r,
|
|
1006
|
+
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index), p = (t.recordCount ?? 0) + (c?.count ?? 0);
|
|
1007
|
+
let h;
|
|
1008
|
+
const w = e.rowFields ?? [];
|
|
1009
|
+
for (const { filter: o } of f) {
|
|
1010
|
+
const a = await Ae(e, t, n, o.field, o.dataField, r, h, c, s);
|
|
1011
1011
|
if (!a) continue;
|
|
1012
|
-
const
|
|
1012
|
+
const i = /* @__PURE__ */ new Set();
|
|
1013
1013
|
for (const [e, t] of a.groups) {
|
|
1014
|
-
const r = await
|
|
1014
|
+
const r = await _e(o.condition, t.totals, n, s);
|
|
1015
1015
|
t.ids.forEach((t, n) => {
|
|
1016
|
-
r[n] ||
|
|
1016
|
+
r[n] || i.add(`${e}|${t}`);
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
|
-
if (0 ===
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1022
|
-
for (let e = 0; e <
|
|
1023
|
-
if (!(
|
|
1019
|
+
if (0 === i.size) continue;
|
|
1020
|
+
h ??= new Uint8Array(p).fill(3);
|
|
1021
|
+
const l = a.outer.map((e) => a.records[e]), d = a.records[o.field], u = w.includes(o.field) ? 1 : 2;
|
|
1022
|
+
for (let e = 0; e < p; e++) {
|
|
1023
|
+
if (!(h[e] & u)) continue;
|
|
1024
1024
|
let t = "";
|
|
1025
|
-
for (let n = 0; n <
|
|
1026
|
-
|
|
1025
|
+
for (let n = 0; n < l.length; n++) t += (n > 0 ? "," : "") + l[n][e];
|
|
1026
|
+
i.has(`${t}|${d[e]}`) && (h[e] &= ~u);
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1030
|
-
const
|
|
1031
|
-
if (!
|
|
1032
|
-
const d = xe(e, t, n, a,
|
|
1029
|
+
const v = d && s ? await (async (e, t, n, s, r, o, a) => {
|
|
1030
|
+
const i = P.peek(), l = de(e, t);
|
|
1031
|
+
if (!i || !l) return null;
|
|
1032
|
+
const d = xe(e, t, n, a, l.operands);
|
|
1033
1033
|
if (!d) return null;
|
|
1034
1034
|
const u = (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, s, r,
|
|
1038
|
+
return Ee(i, l, e, d.items, d.records, d.values, u(e.rowFields), u(e.columnFields), d.n, r, o, s);
|
|
1039
|
+
})(e, t, n, s, r, h, c) : void 0;
|
|
1040
1040
|
return {
|
|
1041
1041
|
keep: r,
|
|
1042
|
-
...
|
|
1043
|
-
...
|
|
1044
|
-
...
|
|
1042
|
+
...h ? { records: h } : {},
|
|
1043
|
+
...c ? { calculatedRecords: c } : {},
|
|
1044
|
+
...v ? { fieldValues: v } : {}
|
|
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 && y(e.condition, t);
|
|
1052
1052
|
return n === e.condition ? e : (s = !0, {
|
|
1053
1053
|
...e,
|
|
1054
1054
|
condition: n
|
|
@@ -1058,13 +1058,13 @@ var Y = [
|
|
|
1058
1058
|
...e,
|
|
1059
1059
|
filters: r
|
|
1060
1060
|
} : e;
|
|
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 R();
|
|
1065
1065
|
for (let e = 0; e < r; e++) null !== t[e] && a.setValueAt(e, 0, t[e]);
|
|
1066
|
-
let
|
|
1067
|
-
return await
|
|
1066
|
+
let i = !1;
|
|
1067
|
+
return await H({
|
|
1068
1068
|
conditions: [e],
|
|
1069
1069
|
runtime: n,
|
|
1070
1070
|
calculation: s ?? null,
|
|
@@ -1076,31 +1076,31 @@ var Y = [
|
|
|
1076
1076
|
colEnd: 0
|
|
1077
1077
|
},
|
|
1078
1078
|
onTrue: (e) => {
|
|
1079
|
-
|
|
1079
|
+
i = !0, o[e.rowIndex] = 1;
|
|
1080
1080
|
},
|
|
1081
1081
|
onFalse: () => {
|
|
1082
|
-
|
|
1082
|
+
i = !0;
|
|
1083
1083
|
},
|
|
1084
1084
|
onBlank: (e) => {
|
|
1085
|
-
|
|
1085
|
+
i = !0;
|
|
1086
1086
|
for (let n = 0; n < r; n++) null === t[n] && e(n, 0) && (o[n] = 1);
|
|
1087
1087
|
}
|
|
1088
|
-
}),
|
|
1088
|
+
}), i || o.fill(1), o;
|
|
1089
1089
|
}, Le = (e, t, n, s, r) => {
|
|
1090
|
-
const
|
|
1091
|
-
for (const e of
|
|
1092
|
-
const
|
|
1090
|
+
const i = e.fields?.[s], l = /* @__PURE__ */ new Map();
|
|
1091
|
+
for (const e of i?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name && l.set(e.item, e.name);
|
|
1092
|
+
const d = i?.numberFormat ?? t.fields?.[s]?.numberFormat, u = z(d, r), c = (e) => void 0 === d ? z(x(t.fields?.[s], e), r) : u, f = new Array(n.length);
|
|
1093
1093
|
for (let e = 0; e < n.length; e++) {
|
|
1094
|
-
const
|
|
1095
|
-
if (void 0 !==
|
|
1096
|
-
|
|
1094
|
+
const i = l.get(e);
|
|
1095
|
+
if (void 0 !== i) {
|
|
1096
|
+
f[e] = i;
|
|
1097
1097
|
continue;
|
|
1098
1098
|
}
|
|
1099
|
-
const
|
|
1100
|
-
null ===
|
|
1099
|
+
const d = j(n[e]);
|
|
1100
|
+
null === d ? f[e] = D : "number" == typeof d ? f[e] = o(r, G(t.fields?.[s], e) ? c(e) : u, d) : "boolean" == typeof d ? f[e] = d ? "TRUE" : "FALSE" : a.isError(d) ? f[e] = d.getLabel() : f[e] = String(d);
|
|
1101
1101
|
}
|
|
1102
|
-
return
|
|
1103
|
-
},
|
|
1102
|
+
return f;
|
|
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,
|
|
1106
1106
|
rowEnd: t.rowStart,
|
|
@@ -1108,8 +1108,8 @@ var Y = [
|
|
|
1108
1108
|
colEnd: t.colEnd
|
|
1109
1109
|
}).getValues()[0] ?? [], a = [];
|
|
1110
1110
|
for (let e = 0; e < n; e++) {
|
|
1111
|
-
const n = o[e] ?? null,
|
|
1112
|
-
let d, u, c = !1, f =
|
|
1111
|
+
const n = o[e] ?? null, i = new W(), l = new Uint32Array(s);
|
|
1112
|
+
let d, u, c = !1, f = i.values;
|
|
1113
1113
|
if (s > 0) {
|
|
1114
1114
|
const n = r.getRange({
|
|
1115
1115
|
rowStart: t.rowStart + 1,
|
|
@@ -1117,13 +1117,13 @@ var Y = [
|
|
|
1117
1117
|
colStart: t.colStart + e,
|
|
1118
1118
|
colEnd: t.colStart + e
|
|
1119
1119
|
});
|
|
1120
|
-
|
|
1121
|
-
const o = Ue(n, t.rowStart + 1,
|
|
1120
|
+
i.fill(n.getValuesRange(), l), d = Ve(n, s);
|
|
1121
|
+
const o = Ue(n, t.rowStart + 1, l, i.values);
|
|
1122
1122
|
c = o.dates, u = o.dateIds, f = o.values;
|
|
1123
1123
|
}
|
|
1124
1124
|
a.push({
|
|
1125
1125
|
header: De(n),
|
|
1126
|
-
ids:
|
|
1126
|
+
ids: l,
|
|
1127
1127
|
values: f,
|
|
1128
1128
|
numberFormat: d,
|
|
1129
1129
|
dates: c,
|
|
@@ -1156,17 +1156,17 @@ var Y = [
|
|
|
1156
1156
|
dates: o,
|
|
1157
1157
|
values: s
|
|
1158
1158
|
};
|
|
1159
|
-
const
|
|
1159
|
+
const i = s.slice(), l = /* @__PURE__ */ new Map();
|
|
1160
1160
|
for (let e = 0; e < n.length; e++) {
|
|
1161
1161
|
const t = n[e];
|
|
1162
1162
|
if ("number" != typeof s[t] || !He(r, e)) continue;
|
|
1163
|
-
let o =
|
|
1164
|
-
void 0 === o && (o =
|
|
1163
|
+
let o = l.get(t);
|
|
1164
|
+
void 0 === o && (o = i.length, i.push(s[t]), l.set(t, o)), n[e] = o;
|
|
1165
1165
|
}
|
|
1166
1166
|
return {
|
|
1167
1167
|
dates: !1,
|
|
1168
|
-
dateIds: new Set(
|
|
1169
|
-
values:
|
|
1168
|
+
dateIds: new Set(l.values()),
|
|
1169
|
+
values: i
|
|
1170
1170
|
};
|
|
1171
1171
|
}, He = (e, t) => {
|
|
1172
1172
|
let n = 0, s = e.length - 1;
|
|
@@ -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:" : "") + v(j(e)), ze = (e, t, n, s = !1) => {
|
|
1189
|
+
const r = e.fields ?? [], o = u(e.items, r.length), a = /\smissingItemsLimit="0"/.test(e.rest ?? ""), i = ((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)), l = /* @__PURE__ */ new Map();
|
|
1198
1198
|
r.forEach((e, t) => {
|
|
1199
1199
|
const n = e.name.toLocaleLowerCase();
|
|
1200
|
-
e.noRecords ||
|
|
1200
|
+
e.noRecords || l.has(n) || l.set(n, t);
|
|
1201
1201
|
});
|
|
1202
|
-
const d = t.recordCount,
|
|
1203
|
-
w[t] = n.items,
|
|
1202
|
+
const d = t.recordCount, c = r.map(() => -1), f = r.map((e, t) => o[t].map(() => -1)), p = [], h = [], g = [], w = [], v = [], F = [], y = [], I = (e, t, n) => {
|
|
1203
|
+
w[t] = n.items, F[t] = n.items.length, y[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,88 +1208,88 @@ 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 u = new Int32Array(e.values.length).fill(-1),
|
|
1211
|
+
const n = l.get(i[t].toLocaleLowerCase());
|
|
1212
|
+
void 0 !== n && (l.delete(i[t].toLocaleLowerCase()), c[n] = t);
|
|
1213
|
+
const u = new Int32Array(e.values.length).fill(-1), m = [], x = [], A = new Array(d);
|
|
1214
1214
|
for (let t = 0; t < d; t++) {
|
|
1215
1215
|
const n = e.ids[t];
|
|
1216
1216
|
let s = u[n];
|
|
1217
|
-
s < 0 && (s = u[n] =
|
|
1217
|
+
s < 0 && (s = u[n] = m.length, m.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 || G(r[n], e)), E = m.length, S = void 0 !== n ? !0 === r[n].inline : m.every((e) => "number" == typeof e || "object" == typeof e && "z" === e?.t), P = [];
|
|
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(m[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(m[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 =
|
|
1233
|
-
let
|
|
1234
|
-
void 0 !==
|
|
1232
|
+
const o = je(s, C(r));
|
|
1233
|
+
let i = e.get(o);
|
|
1234
|
+
void 0 !== i || a || C(r) || (i = m.length, m.push(s), x.push(C(r)), P.push(i), e.set(o, i)), f[n][r] = i ?? -1;
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
|
|
1242
|
-
"number" == typeof e && (
|
|
1243
|
-
}),
|
|
1237
|
+
const k = { name: i[t] };
|
|
1238
|
+
S && (k.inline = !0), void 0 !== e.numberFormat && (k.numberFormat = e.numberFormat);
|
|
1239
|
+
const M = [];
|
|
1240
|
+
let T = !1;
|
|
1241
|
+
m.forEach((e, t) => {
|
|
1242
|
+
"number" == typeof e && (x[t] ? M.push(t) : T = !0);
|
|
1243
|
+
}), M.length > 0 && !T ? k.dates = !0 : M.length > 0 && (k.dateItems = M), v[t] = k.dateItems ? new Set(k.dateItems) : void 0, P.length > 0 && (k.unused = P);
|
|
1244
1244
|
const O = void 0 !== n ? r[n].rest : void 0;
|
|
1245
|
-
O && (
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const s =
|
|
1249
|
-
return
|
|
1245
|
+
O && (k.rest = O);
|
|
1246
|
+
const R = void 0 !== n ? r[n].calculatedItems : void 0;
|
|
1247
|
+
R?.length && (k.calculatedItems = R.map(({ item: e, formula: t }) => {
|
|
1248
|
+
const s = m.length;
|
|
1249
|
+
return m.push(o[n][e]), f[n][e] = s, {
|
|
1250
1250
|
item: s,
|
|
1251
1251
|
formula: t
|
|
1252
1252
|
};
|
|
1253
|
-
})), p.push(
|
|
1254
|
-
const
|
|
1255
|
-
if (
|
|
1256
|
-
const e = re(
|
|
1257
|
-
e ? (
|
|
1253
|
+
})), p.push(k), h.push([t, [[0, m]]]), g.push([t, [[0, A]]]), w.push(m), F.push(E), y.push(!1);
|
|
1254
|
+
const N = void 0 !== n ? r[n].group : void 0;
|
|
1255
|
+
if (N?.range && N.base === n) {
|
|
1256
|
+
const e = re(N, m.slice(0, E).map(j), s);
|
|
1257
|
+
e ? (k.group = {
|
|
1258
1258
|
...e,
|
|
1259
1259
|
base: t
|
|
1260
|
-
}, I(n, t, e)) :
|
|
1261
|
-
} else
|
|
1260
|
+
}, I(n, t, e)) : f[n] = o[n].map(() => -1);
|
|
1261
|
+
} else N && !b(r[n]) && (k.group = N);
|
|
1262
1262
|
}), r.forEach((e, t) => {
|
|
1263
1263
|
if (!e.noRecords) return;
|
|
1264
|
-
if (
|
|
1264
|
+
if (m(e)) return c[t] = p.length, p.push(e), w.push([]), F.push(0), void y.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
1269
|
const o = w[r];
|
|
1270
|
-
let a,
|
|
1271
|
-
if (n.range) a = re(n, o.slice(0,
|
|
1270
|
+
let a, i = [];
|
|
1271
|
+
if (n.range) a = re(n, o.slice(0, F[r]).map(j), s);
|
|
1272
1272
|
else {
|
|
1273
|
-
const e =
|
|
1274
|
-
a = e.group,
|
|
1273
|
+
const e = Ge(n, f[n.base], o, p[r]);
|
|
1274
|
+
a = e.group, i = e.itemMap;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (!a) return;
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1277
|
+
const l = p.length;
|
|
1278
|
+
c[t] = l, p.push({
|
|
1279
1279
|
...e,
|
|
1280
1280
|
group: {
|
|
1281
1281
|
...a,
|
|
1282
1282
|
base: r
|
|
1283
1283
|
}
|
|
1284
|
-
}), w.push(a.items),
|
|
1284
|
+
}), w.push(a.items), v[l] = a.dateItems ? new Set(a.dateItems) : void 0, F.push(a.items.length), y.push(!1), n.range ? I(t, l, a) : f[t] = i;
|
|
1285
1285
|
}), p.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
|
+
} : b(e) ? e.group = o : delete e.group, e.group && !b(e) && (e.group = {
|
|
1293
1293
|
...e.group,
|
|
1294
1294
|
base: t
|
|
1295
1295
|
});
|
|
@@ -1305,43 +1305,43 @@ var Y = [
|
|
|
1305
1305
|
recordCount: d
|
|
1306
1306
|
},
|
|
1307
1307
|
remap: {
|
|
1308
|
-
fields:
|
|
1309
|
-
items:
|
|
1308
|
+
fields: c,
|
|
1309
|
+
items: f,
|
|
1310
1310
|
newItems: w,
|
|
1311
|
-
usedCounts:
|
|
1311
|
+
usedCounts: F,
|
|
1312
1312
|
inItemOrder: y,
|
|
1313
|
-
dateItems:
|
|
1313
|
+
dateItems: v
|
|
1314
1314
|
}
|
|
1315
1315
|
};
|
|
1316
|
-
},
|
|
1316
|
+
}, Ge = (e, t, n, s) => {
|
|
1317
1317
|
const r = /* @__PURE__ */ new Set(), o = new Array(n.length).fill(-1);
|
|
1318
1318
|
(e.discrete ?? []).forEach((e, n) => {
|
|
1319
1319
|
const s = t?.[n] ?? -1;
|
|
1320
1320
|
s < 0 || (o[s] = e, r.add(e));
|
|
1321
1321
|
});
|
|
1322
|
-
const a = [],
|
|
1322
|
+
const a = [], i = [], l = new Set(e.dateItems), d = e.items.map((e, t) => r.has(t) ? (l.has(t) && i.push(a.length), a.push(e), a.length - 1) : -1), u = o.map((e, t) => e >= 0 ? d[e] : ((s.dates || G(s, t)) && i.push(a.length), a.push(n[t]), a.length - 1)), { dateItems: c, ...f } = e;
|
|
1323
1323
|
return {
|
|
1324
1324
|
group: {
|
|
1325
1325
|
...f,
|
|
1326
1326
|
items: a,
|
|
1327
1327
|
discrete: u,
|
|
1328
|
-
...
|
|
1328
|
+
...i.length > 0 ? { dateItems: i } : {}
|
|
1329
1329
|
},
|
|
1330
1330
|
itemMap: d
|
|
1331
1331
|
};
|
|
1332
|
-
},
|
|
1332
|
+
}, Ke = (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
|
-
},
|
|
1336
|
-
const n = e.fields ?? [], s = t.newItems.length, r = (e) => e < 0 ? e : t.fields[e] ?? -1, o = (e) => e < 0 || r(e) >= 0, a = e.dataFields ?? [],
|
|
1335
|
+
}, qe = (e, t) => {
|
|
1336
|
+
const n = e.fields ?? [], s = t.newItems.length, r = (e) => e < 0 ? e : t.fields[e] ?? -1, o = (e) => e < 0 || r(e) >= 0, a = e.dataFields ?? [], i = [], l = [];
|
|
1337
1337
|
a.forEach((e) => {
|
|
1338
|
-
if (!o(e.field)) return void
|
|
1339
|
-
|
|
1338
|
+
if (!o(e.field)) return void i.push(-1);
|
|
1339
|
+
i.push(l.length);
|
|
1340
1340
|
const t = {
|
|
1341
1341
|
...e,
|
|
1342
1342
|
field: r(e.field)
|
|
1343
1343
|
};
|
|
1344
|
-
void 0 !== e.baseField && (o(e.baseField) ? t.baseField = r(e.baseField) : delete t.baseField),
|
|
1344
|
+
void 0 !== e.baseField && (o(e.baseField) ? t.baseField = r(e.baseField) : delete t.baseField), l.push(t);
|
|
1345
1345
|
});
|
|
1346
1346
|
const d = n.map(() => null), u = [];
|
|
1347
1347
|
for (let e = 0; e < s; e++) u.push({});
|
|
@@ -1350,14 +1350,14 @@ var Y = [
|
|
|
1350
1350
|
if (s < 0) return;
|
|
1351
1351
|
const o = { ...e };
|
|
1352
1352
|
if (void 0 !== e.sort?.dataField) {
|
|
1353
|
-
const t =
|
|
1353
|
+
const t = i[e.sort.dataField];
|
|
1354
1354
|
o.sort = t >= 0 ? {
|
|
1355
1355
|
...e.sort,
|
|
1356
1356
|
dataField: t
|
|
1357
1357
|
} : { order: e.sort.order };
|
|
1358
1358
|
}
|
|
1359
1359
|
if (e.items) {
|
|
1360
|
-
const { items: r, positions: a } =
|
|
1360
|
+
const { items: r, positions: a } = Qe(e, t.items[n], t.newItems[s], t.usedCounts[s], t.inItemOrder[s], t.dateItems[s]);
|
|
1361
1361
|
o.items = r, d[n] = a;
|
|
1362
1362
|
}
|
|
1363
1363
|
u[s] = o;
|
|
@@ -1379,16 +1379,16 @@ var Y = [
|
|
|
1379
1379
|
const c = (e) => {
|
|
1380
1380
|
if (!e) return;
|
|
1381
1381
|
let t = e.filter(o).map(r);
|
|
1382
|
-
return
|
|
1382
|
+
return l.length < 2 && (t = t.filter((e) => -2 !== e)), t.length > 0 ? t : void 0;
|
|
1383
1383
|
}, f = {
|
|
1384
1384
|
...e,
|
|
1385
1385
|
fields: u
|
|
1386
1386
|
};
|
|
1387
|
-
|
|
1388
|
-
const n =
|
|
1387
|
+
Je(f, "rowFields", c(e.rowFields)), Je(f, "columnFields", c(e.columnFields)), Je(f, "dataFields", l.length > 0 ? l : void 0), a.forEach((e, t) => {
|
|
1388
|
+
const n = i[t];
|
|
1389
1389
|
if (n < 0 || void 0 === e.baseField || "number" != typeof e.baseItem) return;
|
|
1390
1390
|
const s = d[e.baseField]?.[e.baseItem];
|
|
1391
|
-
void 0 !== s && s >= 0 && (
|
|
1391
|
+
void 0 !== s && s >= 0 && (l[n].baseItem = s);
|
|
1392
1392
|
});
|
|
1393
1393
|
const m = (e.pageFields ?? []).flatMap((e) => {
|
|
1394
1394
|
if (!o(e.field)) return [];
|
|
@@ -1399,7 +1399,7 @@ var Y = [
|
|
|
1399
1399
|
}
|
|
1400
1400
|
return [t];
|
|
1401
1401
|
});
|
|
1402
|
-
|
|
1402
|
+
Je(f, "pageFields", m.length > 0 ? m : void 0);
|
|
1403
1403
|
const p = (e.filters ?? []).flatMap((e) => {
|
|
1404
1404
|
if (!o(e.field)) return [];
|
|
1405
1405
|
const t = {
|
|
@@ -1407,21 +1407,21 @@ var Y = [
|
|
|
1407
1407
|
field: r(e.field)
|
|
1408
1408
|
};
|
|
1409
1409
|
if (void 0 !== e.dataField) {
|
|
1410
|
-
const n =
|
|
1410
|
+
const n = i[e.dataField];
|
|
1411
1411
|
if (void 0 === n || n < 0) return [];
|
|
1412
1412
|
t.dataField = n;
|
|
1413
1413
|
}
|
|
1414
1414
|
return [t];
|
|
1415
1415
|
});
|
|
1416
|
-
|
|
1417
|
-
const h = (e) => Ye(e, r, o, d,
|
|
1416
|
+
Je(f, "filters", p.length > 0 ? p : void 0);
|
|
1417
|
+
const h = (e) => Ye(e, r, o, d, i), g = (e.formats ?? []).flatMap((e) => {
|
|
1418
1418
|
const t = h(e.area);
|
|
1419
1419
|
return t ? [{
|
|
1420
1420
|
...e,
|
|
1421
1421
|
area: t
|
|
1422
1422
|
}] : [];
|
|
1423
1423
|
});
|
|
1424
|
-
|
|
1424
|
+
Je(f, "formats", g.length > 0 ? g : void 0);
|
|
1425
1425
|
const w = (e.conditionalFormats ?? []).flatMap((e) => {
|
|
1426
1426
|
const t = e.areas.flatMap((e) => {
|
|
1427
1427
|
const t = h(e);
|
|
@@ -1432,19 +1432,19 @@ var Y = [
|
|
|
1432
1432
|
areas: t
|
|
1433
1433
|
}] : [];
|
|
1434
1434
|
});
|
|
1435
|
-
return
|
|
1436
|
-
},
|
|
1435
|
+
return Je(f, "conditionalFormats", w.length > 0 ? w : void 0), f;
|
|
1436
|
+
}, Je = (e, t, n) => {
|
|
1437
1437
|
void 0 === n ? delete e[t] : e[t] = n;
|
|
1438
|
-
},
|
|
1439
|
-
const a = e.items ?? [],
|
|
1438
|
+
}, Qe = (e, t, n, s, r = !1, o) => {
|
|
1439
|
+
const a = e.items ?? [], i = [], l = [], d = /* @__PURE__ */ new Set();
|
|
1440
1440
|
for (const e of a) {
|
|
1441
|
-
if (!
|
|
1442
|
-
|
|
1441
|
+
if (!M(e)) {
|
|
1442
|
+
l.push(i.length), i.push(e);
|
|
1443
1443
|
continue;
|
|
1444
1444
|
}
|
|
1445
1445
|
const n = t[e.item] ?? -1;
|
|
1446
1446
|
if (n < 0) {
|
|
1447
|
-
|
|
1447
|
+
l.push(-1);
|
|
1448
1448
|
continue;
|
|
1449
1449
|
}
|
|
1450
1450
|
d.add(n);
|
|
@@ -1452,15 +1452,15 @@ var Y = [
|
|
|
1452
1452
|
...e,
|
|
1453
1453
|
item: n
|
|
1454
1454
|
};
|
|
1455
|
-
n >= s && !e.calculated ? r.missing = !0 : delete r.missing,
|
|
1455
|
+
n >= s && !e.calculated ? r.missing = !0 : delete r.missing, l.push(i.length), i.push(r);
|
|
1456
1456
|
}
|
|
1457
1457
|
const u = [];
|
|
1458
1458
|
for (let e = 0; e < n.length; e++) d.has(e) || u.push(e);
|
|
1459
1459
|
if (r) {
|
|
1460
|
-
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s =
|
|
1460
|
+
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s = i.map((e, t) => ({
|
|
1461
1461
|
item: e,
|
|
1462
1462
|
at: t
|
|
1463
|
-
})), r = s.filter((e) => !
|
|
1463
|
+
})), r = s.filter((e) => !M(e.item)), o = [...[...s.filter((e) => M(e.item)), ...u.map((e) => ({
|
|
1464
1464
|
item: n ? {
|
|
1465
1465
|
item: e,
|
|
1466
1466
|
hidden: !0
|
|
@@ -1469,41 +1469,41 @@ var Y = [
|
|
|
1469
1469
|
}))].sort((e, n) => t ? n.item.item - e.item.item : e.item.item - n.item.item), ...r], d = new Map(o.map((e, t) => [e.at, t]));
|
|
1470
1470
|
return {
|
|
1471
1471
|
items: o.map((e) => e.item),
|
|
1472
|
-
positions:
|
|
1472
|
+
positions: l.map((e) => e < 0 ? e : d.get(e) ?? -1)
|
|
1473
1473
|
};
|
|
1474
1474
|
}
|
|
1475
1475
|
if (0 === u.length) return {
|
|
1476
|
-
items:
|
|
1477
|
-
positions:
|
|
1476
|
+
items: i,
|
|
1477
|
+
positions: l
|
|
1478
1478
|
};
|
|
1479
|
-
const
|
|
1479
|
+
const c = !e.includeNewItemsInFilter && a.some((e) => e.hidden), f = (e) => c ? {
|
|
1480
1480
|
item: e,
|
|
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) => Ke(B(e, n), j(n[t]), void 0 === e.name && o?.has(e.item), o?.has(t));
|
|
1485
1485
|
for (const e of u) {
|
|
1486
|
-
const n =
|
|
1487
|
-
let r =
|
|
1488
|
-
r < 0 && (r = We(
|
|
1489
|
-
for (let e = 0; e <
|
|
1486
|
+
const n = f(e);
|
|
1487
|
+
let r = i.findIndex((n) => M(n) && (t ? s(n, e) < 0 : s(n, e) > 0));
|
|
1488
|
+
r < 0 && (r = We(i)), i.splice(r, 0, n);
|
|
1489
|
+
for (let e = 0; e < l.length; e++) l[e] >= r && l[e]++;
|
|
1490
1490
|
}
|
|
1491
1491
|
} else {
|
|
1492
|
-
const e = We(
|
|
1493
|
-
|
|
1494
|
-
for (let t = 0; t <
|
|
1492
|
+
const e = We(i);
|
|
1493
|
+
i.splice(e, 0, ...u.map(f));
|
|
1494
|
+
for (let t = 0; t < l.length; t++) l[t] >= e && (l[t] += u.length);
|
|
1495
1495
|
}
|
|
1496
1496
|
return {
|
|
1497
|
-
items:
|
|
1498
|
-
positions:
|
|
1497
|
+
items: i,
|
|
1498
|
+
positions: l
|
|
1499
1499
|
};
|
|
1500
1500
|
}, We = (e) => {
|
|
1501
|
-
const t = e.findIndex((e) => !
|
|
1501
|
+
const t = e.findIndex((e) => !M(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 (M(r) && !r.missing) return s;
|
|
1507
1507
|
}
|
|
1508
1508
|
}, Ye = (e, t, n, s, r) => {
|
|
1509
1509
|
const o = { ...e };
|
|
@@ -1546,7 +1546,7 @@ var Y = [
|
|
|
1546
1546
|
};
|
|
1547
1547
|
const a = e.sort?.scope;
|
|
1548
1548
|
if (!a?.items.some((e) => e.field === t)) return e;
|
|
1549
|
-
const
|
|
1549
|
+
const i = a.items.map((e) => e.field === t ? {
|
|
1550
1550
|
...e,
|
|
1551
1551
|
item: o[e.item] ?? e.item
|
|
1552
1552
|
} : e);
|
|
@@ -1556,7 +1556,7 @@ var Y = [
|
|
|
1556
1556
|
...e.sort,
|
|
1557
1557
|
scope: {
|
|
1558
1558
|
...a,
|
|
1559
|
-
items:
|
|
1559
|
+
items: i
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
@@ -1569,7 +1569,7 @@ var Y = [
|
|
|
1569
1569
|
...e,
|
|
1570
1570
|
baseItem: o[e.baseItem] ?? e.baseItem
|
|
1571
1571
|
} : e));
|
|
1572
|
-
const
|
|
1572
|
+
const i = s.map((e, n) => n === t ? o : null), l = (e.dataFields ?? []).map((e, t) => t), d = (e) => Ye(e, (e) => e, () => !0, i, l) ?? e;
|
|
1573
1573
|
return e.formats && (a.formats = e.formats.map((e) => ({
|
|
1574
1574
|
...e,
|
|
1575
1575
|
area: d(e.area)
|
|
@@ -1578,13 +1578,13 @@ 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 = V(t)[n] ?? [], a = t.fields?.[n], i = void 0 !== a?.group?.range, l = (e) => void 0 === e.name && G(a, e.item), d = r.map((e, t) => ({
|
|
1582
1582
|
item: e,
|
|
1583
1583
|
at: t
|
|
1584
|
-
})), u = d.filter((e) =>
|
|
1585
|
-
u.sort((e, t) =>
|
|
1584
|
+
})), u = d.filter((e) => M(e.item));
|
|
1585
|
+
u.sort((e, t) => i ? e.item.item - t.item.item : Ke(B(e.item, o), B(t.item, o), l(e.item), l(t.item))), "descending" === s && u.reverse();
|
|
1586
1586
|
let c = 0;
|
|
1587
|
-
const f = Ze(e, n, d.map((e) =>
|
|
1587
|
+
const f = Ze(e, n, d.map((e) => M(e.item) ? u[c++] : e).map((e) => e.at));
|
|
1588
1588
|
return {
|
|
1589
1589
|
...f,
|
|
1590
1590
|
fields: f.fields.map((e, t) => t === n ? {
|
|
@@ -1594,27 +1594,27 @@ var Y = [
|
|
|
1594
1594
|
};
|
|
1595
1595
|
}, tt = (n, s, r) => {
|
|
1596
1596
|
const o = n.fields?.[s]?.items?.[r];
|
|
1597
|
-
if (!o || !
|
|
1597
|
+
if (!o || !M(o)) throw new t(e("error.pivotTable.changePart"));
|
|
1598
1598
|
return o;
|
|
1599
1599
|
}, nt = (n, s, r, o, a) => {
|
|
1600
|
-
const
|
|
1601
|
-
const t =
|
|
1602
|
-
return null === t ?
|
|
1600
|
+
const i = tt(n, r, o), l = n.fields[r].items, d = V(s)[r] ?? [], u = (e) => {
|
|
1601
|
+
const t = j(d[e.item]);
|
|
1602
|
+
return null === t ? D : U(t);
|
|
1603
1603
|
};
|
|
1604
|
-
if (
|
|
1605
|
-
const { name:
|
|
1606
|
-
...
|
|
1604
|
+
if (l.some((e, t) => t !== o && M(e) && I(e.name ?? u(e), a))) throw new t(e("error.pivotTable.itemNameExists", { name: a }));
|
|
1605
|
+
const { name: c, ...f } = i, m = a === u(i) ? f : {
|
|
1606
|
+
...i,
|
|
1607
1607
|
name: a
|
|
1608
1608
|
};
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1609
|
+
if (m.name === i.name) return n;
|
|
1610
|
+
const p = {
|
|
1611
1611
|
...n,
|
|
1612
1612
|
fields: n.fields.map((e, t) => t === r ? {
|
|
1613
1613
|
...e,
|
|
1614
|
-
items:
|
|
1614
|
+
items: l.map((e, t) => t === o ? m : e)
|
|
1615
1615
|
} : e)
|
|
1616
|
-
},
|
|
1617
|
-
return
|
|
1616
|
+
}, h = n.fields[r].sort;
|
|
1617
|
+
return h && void 0 === h.dataField ? et(p, s, r, h.order) : p;
|
|
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,36 +1631,36 @@ var Y = [
|
|
|
1631
1631
|
})
|
|
1632
1632
|
} : a;
|
|
1633
1633
|
}, rt = (n, s, r, o) => {
|
|
1634
|
-
const a =
|
|
1634
|
+
const a = U(o), i = n.fields, l = s.fields, d = n.dataFields ?? [], u = V(s), c = (e, t) => {
|
|
1635
1635
|
if (void 0 !== t.name) return t.name;
|
|
1636
|
-
const n =
|
|
1637
|
-
return null === n ?
|
|
1638
|
-
},
|
|
1639
|
-
if (void 0 !== r.field && a === (
|
|
1636
|
+
const n = j(u[e][t.item]);
|
|
1637
|
+
return null === n ? D : U(n);
|
|
1638
|
+
}, f = (r) => {
|
|
1639
|
+
if (void 0 !== r.field && a === (i[r.field].name ?? l[r.field].name)) return;
|
|
1640
1640
|
const o = void 0 === r.field ? n : {
|
|
1641
1641
|
...n,
|
|
1642
|
-
fields:
|
|
1642
|
+
fields: i.map((e, t) => t === r.field ? {
|
|
1643
1643
|
...e,
|
|
1644
1644
|
name: "\0"
|
|
1645
1645
|
} : e)
|
|
1646
1646
|
};
|
|
1647
|
-
if (
|
|
1647
|
+
if (K(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 =
|
|
1653
|
+
const o = i[e].items.findIndex((n, s) => s !== t && M(n) && I(c(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 f({ field: e }), ((e, t) => ({
|
|
1659
1659
|
...n,
|
|
1660
|
-
fields:
|
|
1660
|
+
fields: i.map((n, s) => s === e ? t(n) : n)
|
|
1661
1661
|
}))(e, (t) => {
|
|
1662
1662
|
const { name: n, ...s } = t;
|
|
1663
|
-
return a ===
|
|
1663
|
+
return a === l[e].name ? s : {
|
|
1664
1664
|
...t,
|
|
1665
1665
|
name: a
|
|
1666
1666
|
};
|
|
@@ -1668,9 +1668,9 @@ var Y = [
|
|
|
1668
1668
|
}
|
|
1669
1669
|
case "dataCaption": {
|
|
1670
1670
|
const { data: e } = r;
|
|
1671
|
-
return
|
|
1671
|
+
return f({ data: e }), {
|
|
1672
1672
|
...n,
|
|
1673
|
-
dataFields:
|
|
1673
|
+
dataFields: d.map((t, n) => n === e ? {
|
|
1674
1674
|
...t,
|
|
1675
1675
|
name: a
|
|
1676
1676
|
} : t)
|
|
@@ -1690,11 +1690,11 @@ var Y = [
|
|
|
1690
1690
|
};
|
|
1691
1691
|
case "pageItem": {
|
|
1692
1692
|
const s = n.pageFields, o = s[r.page];
|
|
1693
|
-
let
|
|
1694
|
-
if (!
|
|
1695
|
-
const { item:
|
|
1693
|
+
let l;
|
|
1694
|
+
if (!I(a, "(All)") && (l = (i[o.field].items ?? []).findIndex((e) => M(e) && I(c(o.field, e), a)), l < 0)) throw new t(e("error.pivotTable.notAnItem", { name: a }));
|
|
1695
|
+
const { item: d, ...u } = o, f = void 0 === l ? u : {
|
|
1696
1696
|
...o,
|
|
1697
|
-
item:
|
|
1697
|
+
item: l
|
|
1698
1698
|
};
|
|
1699
1699
|
return {
|
|
1700
1700
|
...n,
|
|
@@ -1712,13 +1712,13 @@ var Y = [
|
|
|
1712
1712
|
const { inline: s, ...r } = e;
|
|
1713
1713
|
return r;
|
|
1714
1714
|
})
|
|
1715
|
-
} : e,
|
|
1715
|
+
} : e, it = (e) => [
|
|
1716
1716
|
...e.rowFields ?? [],
|
|
1717
1717
|
...e.columnFields ?? [],
|
|
1718
1718
|
...(e.pageFields ?? []).map((e) => e.field)
|
|
1719
|
-
].filter((e) => e >= 0),
|
|
1720
|
-
const n = e.fields[t], s =
|
|
1721
|
-
|
|
1719
|
+
].filter((e) => e >= 0), lt = (e, t) => {
|
|
1720
|
+
const n = e.fields[t], s = V(e)[t], r = s.map((e, t) => t);
|
|
1721
|
+
b(n) || r.sort((e, t) => Ke(j(s[e]), j(s[t]), G(n, e), G(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,21 +1728,21 @@ var Y = [
|
|
|
1728
1728
|
}, dt = (n) => {
|
|
1729
1729
|
if (!("number" == typeof n ? void 0 !== r(n) : "" !== n && s.isValidFormat(n))) throw new t(e("error.pivotTable.notANumberFormat", { name: String(n) }));
|
|
1730
1730
|
}, ut = (n, s, r, o) => {
|
|
1731
|
-
const a = o?.function ?? ((e, t) => "number" ===
|
|
1732
|
-
if (!
|
|
1733
|
-
let
|
|
1734
|
-
if (void 0 ===
|
|
1735
|
-
else if (
|
|
1736
|
-
const
|
|
1737
|
-
name:
|
|
1731
|
+
const a = o?.function ?? ((e, t) => "number" === _(e, t) ? "sum" : "count")(s.fields[r], V(s)[r]), i = F[a];
|
|
1732
|
+
if (!i) throw new t(e("error.pivotTable.notAFunction", { name: a }));
|
|
1733
|
+
let l = o?.name;
|
|
1734
|
+
if (void 0 === l) l = K(n, s, `${i} of ${d(n, s, r)}`);
|
|
1735
|
+
else if (K(n, s, l) !== l) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1736
|
+
const u = {
|
|
1737
|
+
name: l,
|
|
1738
1738
|
field: r,
|
|
1739
1739
|
baseField: 0,
|
|
1740
1740
|
baseItem: 0
|
|
1741
1741
|
};
|
|
1742
|
-
return "sum" !== a && (
|
|
1742
|
+
return "sum" !== a && (u.subtotal = a), void 0 !== o?.numberFormat && (dt(o.numberFormat), u.numberFormat = o.numberFormat), u;
|
|
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) => I(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(), i = (e, t) => {
|
|
@@ -1752,18 +1752,18 @@ var Y = [
|
|
|
1752
1752
|
}
|
|
1753
1753
|
};
|
|
1754
1754
|
i(s?.rows, "row"), i(s?.columns, "column"), i(s?.pages, "page");
|
|
1755
|
-
const
|
|
1755
|
+
const l = (e) => [...a].filter(([, t]) => t === e).map(([e]) => e), d = [];
|
|
1756
1756
|
for (const e of s?.values ?? []) {
|
|
1757
1757
|
const { field: t, ...s } = "string" == typeof e ? { field: e } : e;
|
|
1758
|
-
|
|
1758
|
+
d.push(ut({ dataFields: d }, n, o(t), s));
|
|
1759
1759
|
}
|
|
1760
|
-
const
|
|
1760
|
+
const u = new Set(d.map((e) => e.field)), c = s?.form && "compact" !== s.form ? s.form : void 0, f = r.map((e, t) => {
|
|
1761
1761
|
const s = {}, r = a.get(t);
|
|
1762
|
-
return r && (s.axis = r, s.items =
|
|
1763
|
-
}),
|
|
1764
|
-
|
|
1765
|
-
const
|
|
1766
|
-
fields:
|
|
1762
|
+
return r && (s.axis = r, s.items = lt(n, t)), u.has(t) && (s.dataField = !0), c && (s.form = c), e.dates && void 0 !== e.numberFormat && (s.numberFormat = e.numberFormat), s;
|
|
1763
|
+
}), m = l("column");
|
|
1764
|
+
d.length > 1 && m.push(-2);
|
|
1765
|
+
const p = {
|
|
1766
|
+
fields: f,
|
|
1767
1767
|
style: {
|
|
1768
1768
|
name: s?.style ?? "PivotStyleLight16",
|
|
1769
1769
|
showRowHeaders: !0,
|
|
@@ -1772,14 +1772,14 @@ var Y = [
|
|
|
1772
1772
|
showColumnStripes: !1,
|
|
1773
1773
|
showLastColumn: !0
|
|
1774
1774
|
}
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
const
|
|
1778
|
-
return
|
|
1775
|
+
}, h = l("row");
|
|
1776
|
+
h.length > 0 && (p.rowFields = h), m.length > 0 && (p.columnFields = m);
|
|
1777
|
+
const g = l("page");
|
|
1778
|
+
return g.length > 0 && (p.pageFields = g.map((e) => ({ field: e }))), d.length > 0 && (p.dataFields = d), c && (p.form = c), p;
|
|
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 === S.Axis.Row ? e.columnFields : t.axis === S.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
|
|
1800
|
-
if (o ===
|
|
1799
|
+
const i = S.Axis, l = s.fields?.[r], d = n.fields?.[r]?.axis ?? null;
|
|
1800
|
+
if (o === i.Values) throw new t(e("error.pivotTable.valuesNotAnAxis"));
|
|
1801
1801
|
if (null === o) {
|
|
1802
|
-
if (null ===
|
|
1803
|
-
} else if (void 0 !==
|
|
1804
|
-
const
|
|
1805
|
-
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a >
|
|
1806
|
-
const f = (a ??
|
|
1807
|
-
if (o ===
|
|
1808
|
-
|
|
1809
|
-
const { rowFields: m, columnFields:
|
|
1810
|
-
|
|
1811
|
-
let
|
|
1812
|
-
...
|
|
1813
|
-
...
|
|
1802
|
+
if (null === d) return n;
|
|
1803
|
+
} else if (void 0 !== l?.formula || o === i.Page && (l?.calculatedItems?.length ?? 0) > 0) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
1804
|
+
const u = o ? p(n, o).filter((e) => e !== r) : [];
|
|
1805
|
+
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a > u.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
1806
|
+
const f = (a ?? u.length + 1) - 1;
|
|
1807
|
+
if (o === d && (void 0 === a || p(n, o)[f] === r)) return n;
|
|
1808
|
+
u.splice(f, 0, r);
|
|
1809
|
+
const { rowFields: m, columnFields: h, pageFields: g, ...w } = n, v = {}, F = (e) => (e ?? []).filter((e) => e !== r), b = o === i.Row ? u : F(n.rowFields), y = o === i.Column ? u : F(n.columnFields), I = o === i.Page ? u.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 ===
|
|
1816
|
-
const
|
|
1817
|
-
o ?
|
|
1818
|
-
const C = (n.fields ?? []).map((e, t) => t === r ?
|
|
1819
|
-
if (
|
|
1820
|
-
...
|
|
1821
|
-
fields: ft(
|
|
1815
|
+
o === i.Page && d !== i.Page && (x = E(x, r, () => !0));
|
|
1816
|
+
const A = { ...n.fields?.[r] };
|
|
1817
|
+
o ? A.axis = o : delete A.axis, o && !A.items && l && (A.items = c(lt(s, r), A.subtotals)), o && void 0 === A.numberFormat && l?.dates && void 0 !== l.numberFormat && (A.numberFormat = l.numberFormat), o === i.Page && A.items?.some((e) => e.hidden) && (A.multipleItemSelection = !0);
|
|
1818
|
+
const C = (n.fields ?? []).map((e, t) => t === r ? A : e);
|
|
1819
|
+
if (x = {
|
|
1820
|
+
...x,
|
|
1821
|
+
fields: ft(x, C)
|
|
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",
|
|
@@ -1889,7 +1889,7 @@ var Y = [
|
|
|
1889
1889
|
} : n;
|
|
1890
1890
|
}
|
|
1891
1891
|
return r;
|
|
1892
|
-
}), { dataFields: o, filters: a, formats:
|
|
1892
|
+
}), { dataFields: o, filters: a, formats: i, conditionalFormats: l, ...d } = e, u = {
|
|
1893
1893
|
...d,
|
|
1894
1894
|
fields: r
|
|
1895
1895
|
};
|
|
@@ -1921,11 +1921,11 @@ var Y = [
|
|
|
1921
1921
|
return p.length > 0 && (u.conditionalFormats = p), ((e) => {
|
|
1922
1922
|
const t = e.dataFields?.length ?? 0, n = e.rowFields?.includes(pt), s = e.columnFields?.includes(pt), { valuesPosition: r, ...o } = e;
|
|
1923
1923
|
if (t < 2 && (n || s)) {
|
|
1924
|
-
const t = n ? "rowFields" : "columnFields", s = e[t], r = s.indexOf(pt), a = s.filter((e) => e !== pt),
|
|
1924
|
+
const t = n ? "rowFields" : "columnFields", s = e[t], r = s.indexOf(pt), a = s.filter((e) => e !== pt), i = {
|
|
1925
1925
|
...o,
|
|
1926
1926
|
...r < a.length ? { valuesPosition: r } : {}
|
|
1927
1927
|
};
|
|
1928
|
-
return a.length > 0 ?
|
|
1928
|
+
return a.length > 0 ? i[t] = a : delete i[t], i;
|
|
1929
1929
|
}
|
|
1930
1930
|
if (t >= 2 && !n && !s) {
|
|
1931
1931
|
const t = e.valuesOnRows ? "rowFields" : "columnFields", n = [...e[t] ?? []];
|
|
@@ -1950,12 +1950,12 @@ var Y = [
|
|
|
1950
1950
|
if (r - 1 === s) return n;
|
|
1951
1951
|
const a = o.map((e, t) => t).filter((e) => e !== s);
|
|
1952
1952
|
a.splice(r - 1, 0, s);
|
|
1953
|
-
const
|
|
1953
|
+
const i = [];
|
|
1954
1954
|
return a.forEach((e, t) => {
|
|
1955
|
-
|
|
1956
|
-
}), It(n, a.map((e) => o[e]),
|
|
1955
|
+
i[e] = t;
|
|
1956
|
+
}), It(n, a.map((e) => o[e]), i);
|
|
1957
1957
|
}, Et = (e, t, n, s) => {
|
|
1958
|
-
const r =
|
|
1958
|
+
const r = C(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,
|
|
@@ -1964,40 +1964,40 @@ var Y = [
|
|
|
1964
1964
|
return "sum" !== s && (o.subtotal = s), o;
|
|
1965
1965
|
});
|
|
1966
1966
|
}, St = (n, s, r, o) => {
|
|
1967
|
-
const a = n.dataFields[r], i = a.showDataAs ?? "normal",
|
|
1967
|
+
const a = n.dataFields[r], i = a.showDataAs ?? "normal", l = o?.kind ?? "normal";
|
|
1968
1968
|
if (o && !wt.has(o.kind)) throw new t(e("error.pivotTable.notAShowAs", { name: o.kind }));
|
|
1969
1969
|
const { showDataAs: u, baseField: c, baseItem: f, ...m } = a, p = { ...m };
|
|
1970
|
-
"normal" !==
|
|
1970
|
+
"normal" !== l && (p.showDataAs = l);
|
|
1971
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) => I(d(n, s, t), r));
|
|
1974
1974
|
if (a < 0) throw new t(e("error.pivotTable.notAField", { name: r }));
|
|
1975
1975
|
a !== h && (h = a, g = 0);
|
|
1976
1976
|
}
|
|
1977
1977
|
if (void 0 !== o?.baseItem) {
|
|
1978
1978
|
const r = h ?? 0;
|
|
1979
|
-
if (
|
|
1980
|
-
else if (
|
|
1979
|
+
if (I(o.baseItem, "(previous)")) g = "previous";
|
|
1980
|
+
else if (I(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
|
-
items:
|
|
1985
|
-
} : e) }, i =
|
|
1984
|
+
items: lt(s, r)
|
|
1985
|
+
} : e) }, i = k(a, s, r).findIndex((e) => null !== e && I(e, o.baseItem));
|
|
1986
1986
|
if (i < 0) throw new t(e("error.pivotTable.notAnItem", { name: o.baseItem }));
|
|
1987
1987
|
g = i;
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
-
if (void 0 !== h && (p.baseField = h), void 0 !== g && (p.baseItem = g),
|
|
1991
|
-
const
|
|
1990
|
+
if (void 0 !== h && (p.baseField = h), void 0 !== g && (p.baseItem = g), l === i) return p.baseField === a.baseField && p.baseItem === a.baseItem ? n : bt(n, r, () => p);
|
|
1991
|
+
const v = ((e, t, n) => {
|
|
1992
1992
|
if (gt.has(n)) return gt.has(t) ? e : void 0;
|
|
1993
|
-
const s = ((e) =>
|
|
1993
|
+
const s = ((e) => w(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
|
-
})(a.numberFormat, i,
|
|
1996
|
-
return
|
|
1995
|
+
})(a.numberFormat, i, l);
|
|
1996
|
+
return v === a.numberFormat ? bt(n, r, () => p) : bt(Ft(n, r), r, () => yt(p, v));
|
|
1997
1997
|
}, Pt = (e, t, n) => {
|
|
1998
1998
|
dt(n);
|
|
1999
|
-
const s =
|
|
2000
|
-
if (
|
|
1999
|
+
const s = w(n), r = e.dataFields[t], o = e.formats?.[e.formats.length - 1];
|
|
2000
|
+
if (w(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,27 +2014,27 @@ var Y = [
|
|
|
2014
2014
|
};
|
|
2015
2015
|
}, kt = (n, s, r) => {
|
|
2016
2016
|
if (null === s) return At(n);
|
|
2017
|
-
const o =
|
|
2017
|
+
const o = S.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
|
|
2022
|
-
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r >
|
|
2023
|
-
const
|
|
2024
|
-
if (s === a && (void 0 === r ||
|
|
2025
|
-
|
|
2026
|
-
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m =
|
|
2027
|
-
return
|
|
2021
|
+
const i = p(n, s).filter((e) => e !== pt);
|
|
2022
|
+
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r > i.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2023
|
+
const l = (r ?? i.length + 1) - 1;
|
|
2024
|
+
if (s === a && (void 0 === r || p(n, s)[l] === pt)) return n;
|
|
2025
|
+
i.splice(l, 0, pt);
|
|
2026
|
+
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m = p(n, s === o.Row ? o.Column : o.Row).filter((e) => e !== pt), h = { ...f }, g = s === o.Row ? i : m, w = s === o.Column ? i : m;
|
|
2027
|
+
return g.length > 0 && (h.rowFields = [...g]), w.length > 0 && (h.columnFields = [...w]), s === o.Row && (h.valuesOnRows = !0), h;
|
|
2028
2028
|
}, Mt = (n, s, r) => {
|
|
2029
2029
|
if (r === (n.valuesCaption ?? "Values")) return n;
|
|
2030
|
-
const { valuesCaption: o, ...a } = n,
|
|
2030
|
+
const { valuesCaption: o, ...a } = n, i = {
|
|
2031
2031
|
...a,
|
|
2032
2032
|
valuesCaption: "\0"
|
|
2033
2033
|
};
|
|
2034
|
-
if (
|
|
2034
|
+
if (K(i, 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,
|
|
2040
|
+
export { xt as addPivotDataField, Ne as anchorPivotPeriods, dt as assertNumberFormat, it as axisFieldsOf, Oe as buildPivotView, Re as evaluatePivotFilters, g as isItemFilter, Ie as layOutPivot, lt 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, qe 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 };
|