@sheetxl/mcp 0.8.0-beta.16 → 0.8.0-beta.18
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/agent/instructions.md +15 -4
- package/assets/{CAMrW5ypKhgn105y.js → 10d0ZbYF23zeF8_1.js} +1 -1
- package/assets/{BsFWmVYPrLyh5Dre.js → 8hZAYFV_v2KmJ_NL.js} +4 -4
- package/assets/{BiGm1tKvxUh8oWbD.js → 9rJMq-cyOmajlBEQ.js} +1 -1
- package/assets/{CoIjAX2gECGb3Wxl.js → ARPN5UhoadZC1yqE.js} +1 -1
- package/assets/{BZbxPclVVopktv3l.js → B-6CmVJvxPNZB9bE.js} +1 -1
- package/assets/{Di4ehJD7muvtcrN3.js → B2C5njsdPylyQOCM.js} +32 -32
- package/assets/{C95HXhZkkhnUx_aE.js → B74Ls4nlmyBxWanf.js} +2 -2
- package/assets/{AjWB-QdIkr07kToW.js → B7GE-6NROw0onnLD.js} +257 -257
- package/assets/{CsjjeeOHE2624pGt.js → BCeSyFXflYgNP_ES.js} +1 -1
- package/assets/{Z01wJImjl6lBMpf4.js → BDNqot_JWBuVW_pC.js} +1 -1
- package/assets/{DMhtIFfkX-DZT_e3.js → BEtUOCupmeICfGE1.js} +3 -3
- package/assets/{C-gN7uBg-MWHRo4g.js → BFGVZsstQm2MWi7Y.js} +1 -1
- package/assets/{CW-ivE6pl3V7vKuT.js → BFcxaubQp1WMeknL.js} +33 -33
- package/assets/{Ci7-PIIhZwb2mVv5.js → BM-ax5N1GzF9KkI4.js} +1 -1
- package/assets/{BR66nPIzyzlOcP10.js → BMc-Hsrp_iifxzG_.js} +1 -1
- package/assets/{C75i_5ip7OhGkuiF.js → BOdkvYo03yZ96iZt.js} +1 -1
- package/assets/{DFn_thWGK0_EZI5k.js → BQ76ntZm9YFicjXj.js} +1 -1
- package/assets/{4vS8pASPZSU7QcRZ.js → BQeb2zXfAs5lRoGt.js} +3 -3
- package/assets/{DFvs1LVzXKm1N5M2.js → BQsLqKWy17wy3znE.js} +2 -2
- package/assets/{DmLbqbAez7Dzwyl7.js → BQzUK7KiJeJpu-rK.js} +1 -1
- package/assets/{3t-I20nDzFHBd5UJ.js → BRQd_GNkeaBTl3Zr.js} +1 -1
- package/assets/{8NrxfSWBHDaEJvhz.js → BSvHkSY0R0EU0gC4.js} +1 -1
- package/assets/{DFAqI-o57Kd_Azlt.js → BV11qLZKVWxFwVGV.js} +1 -1
- package/assets/{pQUJKbHGetb7dcOr.js → BatIfPAYElNTXVzb.js} +1 -1
- package/assets/{C-AIgWmHugqMcl9J.js → BedBCvJP064ZYuO8.js} +2 -2
- package/assets/{BdMebk9YSA0oxQ_d.js → BgGFX6QJ30T3seyX.js} +104 -104
- package/assets/{W2FU69Pfo4chpqtk.js → BhHneZZ7gq4dRaEJ.js} +1 -1
- package/assets/{Ct5VTtdW77k-WcP_.js → BhJ1mH7pUONJScU7.js} +38 -38
- package/assets/{BbDKWV_FQAICqZjP.js → Bi4pI6e3AwTjn-lQ.js} +1 -1
- package/assets/{BbXlmp8W_cbr75FN.js → Bi8ct8GYvMDKHCE3.js} +5 -5
- package/assets/{B3MqN3t5naY3moOk.js → Bqq5Sl5E9ytcPJ3J.js} +1 -1
- package/assets/{BiE9M6RctwQ339_7.js → BrwNVveK5LvYkoGk.js} +1 -1
- package/assets/{BrtLeTsrulaU6osB.js → BsYVa-oRhTLH6wnH.js} +1 -1
- package/assets/{DJdRl2yX9DP_D8kh.js → BwQM6Q6HHQTXznpy.js} +2 -2
- package/assets/{D7iU4kaxzl_PojNt.js → BxizypreLEtLqpIc.js} +1 -1
- package/assets/{POdlv6cpSx6ftJxx.js → Byd5zSRU6LWfL2No.js} +1 -1
- package/assets/{DEIkGoOZ_WeuY0Lj.js → Bz5ioWvl-Xl3xspC.js} +1 -1
- package/assets/{CX-6eYkcr5y0VmQm.js → C3PZVWI_SEXYrzVk.js} +3 -3
- package/assets/{CrwtgrD7BbXyCkx0.js → CDqOifqA400y7KQY.js} +1 -1
- package/assets/{BNrpvJZtIL0Ex_wE.js → CGGpkGg85FZsnYHc.js} +15 -15
- package/assets/{DfzLOnWTNL_2J90y.js → CJoWPN_DsFbaGAiE.js} +1 -1
- package/assets/{h6EQSu5n2vTsu2yd.js → CL4BYdfIXgFQA8nY.js} +1 -1
- package/assets/{BuhHuKVWppW4L8AV.js → CLBxNjtPjuGX1KnU.js} +1 -1
- package/assets/{-PtBguqpLi7Nr4Df.js → CLsD7YwSKAsliRZy.js} +1 -1
- package/assets/{BCSRsSAEPlwR59H5.js → CMXukie7sxP12H2E.js} +4 -4
- package/assets/{CIqJdIUKSLZkNwHy.js → CNE-erNKNIT7bUb1.js} +104 -104
- package/assets/{Co_y6GfwJTYtOmlt.js → CPa4og3WQ7BgHrsO.js} +3 -3
- package/assets/{CJa8JVvKGVBz8Q7q.js → CPkGFumcwSKh5zea.js} +2 -2
- package/assets/{D7ibkNIu_Pn4TeBD.js → CQBFUsemb94zMBo6.js} +3 -3
- package/assets/{TNQaiw20sEAEUiK5.js → CT6kRDlkfvKq8XGZ.js} +1 -1
- package/assets/{D2YdqNWXwSHJMPbA.js → CWuPUrDsnBxboJ02.js} +4 -4
- package/assets/{LwFDS0HxPZKiiEnN.js → CYUerpa6WB0Hc3fs.js} +1 -1
- package/assets/{CK9h6iDOreaI8GEt.js → CYcb-DojX92VNGzd.js} +3 -3
- package/assets/{iqQWGoJaPha0_8lU.js → C_UAskmm-u2Iw9Nl.js} +1 -1
- package/assets/{C0JSC9gVwR1QxopD.js → CcB4xmoUFWBbSISF.js} +1 -1
- package/assets/{BlIrJwQGEASCgJdZ.js → CiKd3BnRjhac2Hik.js} +1 -1
- package/assets/{DaILIYfy-jPVTXjz.js → CkO0JR629W2kcDMd.js} +2 -2
- package/assets/{DR9xHYH6v5G0lOqf.js → CmlxzZYM5hOAAcx5.js} +3 -3
- package/assets/{DNhfziNrJGdL8BYs.js → CnCtLKkz0bdXIxn2.js} +92 -92
- package/assets/{CVRc6jQcH155Z89u.js → CnLLwj7OCz4U71wa.js} +1 -1
- package/assets/{3_NofB4A4Qhl-4YY.js → CoQFpWEh4CUgcdwe.js} +1 -1
- package/assets/{soSlr334Fv1j5t2m.js → Ct8BhGWuqN5yOpUF.js} +1 -1
- package/assets/{BRLA4pJWiYdpW-69.js → Cv8UXBL7O7h1uMR8.js} +20 -20
- package/assets/{B16N6VSLY5HPgVkD.js → CvkibaXI8SOD22pw.js} +1 -1
- package/assets/{Dd8CHUZz7xuYTfp-.js → CzoexWLhnn08u05j.js} +579 -579
- package/assets/{SB2aKOIVln0EkgXR.js → D0-I0aLr6w8IvxFD.js} +1 -1
- package/assets/{CVbRpT7QPHOMgwTx.js → D1pD8u8nRprUvn-u.js} +1 -1
- package/assets/{BUAq-ENCmL0XGLIu.js → D2IMjoGcj5oz1Kr7.js} +1 -1
- package/assets/{BlWfQ5HPEehB_lPz.js → D2sRTakzE5POMnhF.js} +2214 -2108
- package/assets/{2GLqCzpAJP6jbaRx.js → D49iRcrfnODORRNC.js} +5 -5
- package/assets/{CAEhAL7-0FG7jdzN.js → D5nleqRNvTcmN5_9.js} +1 -1
- package/assets/{BtNRIFE92ka4hATo.js → D5wI7O_L6QVNXj5I.js} +1 -1
- package/assets/{BpgPKKZwxXklRyo7.js → DCHjwIx59QhiV2Zx.js} +2 -2
- package/assets/{DdrsYdX3bLixdb_9.js → DH7Rur7rNOYzv35r.js} +1 -1
- package/assets/{C3Wibs7QGFZ1FI7W.js → DI_SAQ7hesioI9TW.js} +1 -1
- package/assets/{Cl98sBOj9GM2XnFe.js → DKnwIboAj_Sg9aVP.js} +2 -2
- package/assets/{CL1-ziDI0aAaVbhJ.js → DL3ms6Hf2uEGaMgH.js} +2 -2
- package/assets/{DLhlBqwsDnmscAuL.js → DMGq2icilGiyfBTM.js} +1 -1
- package/assets/{CZepo1lDTQp1myg6.js → DMnhlFBJ2AlVx2_t.js} +1 -1
- package/assets/{5B_tapYOcjOv1wGO.js → DN4zv4AjDxTsLFsA.js} +10945 -8959
- package/assets/{DBANZf_eAzaCFdIj.js → DP-FzazhSKAvylUa.js} +1135 -1070
- package/assets/{C2dG4GHThf9O-IJy.js → DSDlxGN059KmkCxT.js} +1 -1
- package/assets/{D1g6IOzdvInVLV-x.js → DWK-OKV0MErx-IrU.js} +6 -6
- package/assets/{DKRa_Oc4XqB3DABB.js → DY1x1ZN7ZyE4OR1-.js} +8 -8
- package/assets/{iULnLPcNKVpz00r7.js → DafqFM-FGeZJ_fzg.js} +1 -1
- package/assets/{QVWayvB03YMyTKt3.js → DbwDQlhCuGoasVUz.js} +2 -2
- package/assets/{CDqG64rXHp9-2tXr.js → DcjJ_zTfdh6RqmVZ.js} +1 -1
- package/assets/{BBPjYcS8XKQREith.js → Del35nO_1HyjItI0.js} +46 -46
- package/assets/{C_0RM0w6Pw70Bx_Y.js → Dh2iae-q0IngEeyH.js} +1 -1
- package/assets/{CG8zvnxueimOY7wm.js → Dhg0yeTmVfmRV5rK.js} +1 -1
- package/assets/{rfwqMukKbJBeJBuC.js → DjoFujVwGRAxviCF.js} +2 -2
- package/assets/{Dg4JXbd1yPGNZOtL.js → DlWRvc1pLGPCRMwi.js} +1 -1
- package/assets/{B2YEEPHIkNcezk9T.js → DmCRCUmmkoRNCS9J.js} +2 -2
- package/assets/{DBMZF6PRHCko9K9R.js → DmUCKxOYIBM6DX64.js} +1 -1
- package/assets/{B_nQLUWaxp-Q1IfV.js → Du9_Ajy9KvnwHApK.js} +2 -2
- package/assets/{DOZ40EyxD3m0gCos.js → DwOPJ5TXttTx69oF.js} +343 -342
- package/assets/{CvJkwRgwm80S2bcd.js → DzEJwSC-_aavYiFd.js} +1 -1
- package/assets/{Gqh12ggLm5KlvN3v.js → EDEUvF-L72a6fMCK.js} +1 -1
- package/assets/{BIUUGUhypimIDg2a.js → F0HGXXl9AizCAcFy.js} +1 -1
- package/assets/{9MXt8KXdWlbEJNc2.js → Iv_Zbm3pMLOK2uxf.js} +1 -1
- package/assets/LLdkCOYvtc1-vOsy.js +14 -0
- package/assets/{DTLbKr_XIJMwQJmk.js → MfkAFluI0ZyU0UDV.js} +15 -15
- package/assets/{D-irgQZ2WmkP9dnK.js → NZeFs1MV5h-uMZqJ.js} +1 -1
- package/assets/{CFdJvXLSbUrvNera.js → Rpi4k7hMH8wPAIcB.js} +14 -14
- package/assets/{DQcus4X_kTKIIyX6.js → SCOKwiDu6SYiQrQ0.js} +1 -1
- package/assets/{Bdt9nQs8gDIzu_IG.js → VL-vwx7Pyw1zqIx9.js} +1 -1
- package/assets/{DfWWAHOjmhqvN3m_.js → VcmpHRbBIrw6av3U.js} +1303 -1276
- package/assets/{Dp-dLoOaBndV2N5i.js → XDQBri0_cS5paHej.js} +2 -2
- package/assets/{BYqyNLuwXl7GKuzh.js → gAg9rL3U8fWUDeEb.js} +21 -21
- package/assets/{DvFwVzuc5YfagNnH.js → hLMlKg3lU36xZ6G6.js} +1 -1
- package/assets/{BjDsx_FHl0mShqHX.js → hvCnPO_Fu7Nqz0rs.js} +1 -1
- package/assets/{JC8UUcu6m23qqrr3.js → nPoObUd0MvWI-j0F.js} +1 -1
- package/assets/{SaCo3me4_hw2b1L4.js → nnqtgWxMIc_Nc-IP.js} +556 -556
- package/assets/{DzkccbbE6iXMqQDO.js → o9G5KuG1VkSazTvI.js} +367 -367
- package/assets/{YXC__Myl-BuIFW6s.js → pg7E7B7ouG2qdZve.js} +1 -1
- package/assets/{D3bxrF1Ys2GSVfQH.js → r9WSFw3a-_a5hlPm.js} +1 -1
- package/assets/{CBPkPTmeaEokFPSI.js → rIReGgfQ90pzLAbU.js} +1 -1
- package/assets/{nDmE2I07HvkpRdR0.js → vXZw1AmMzswOZMiP.js} +1 -1
- package/assets/{nmB0nnkFQf5NWo0i.js → wZ-GQhOhikv-_3iQ.js} +2 -2
- package/assets/{Dy67BUF2yd8VRPwL.js → yBFl0kPv-nwFtG4Z.js} +1 -1
- package/index.js +1112 -1041
- package/lib.js +1 -1
- package/licenses/dependencies.txt +35 -35
- package/package.json +2 -2
- package/resources/locales/@sheetxl/sdk/de/model.msg.json +15 -0
- package/resources/locales/@sheetxl/sdk/en/model.msg.json +15 -0
- package/screenshot-page/assets/2XWoSsrRz2kognCK.js +1 -0
- package/screenshot-page/assets/{rOzyaU7hqchMbhRL.js → 5TxlmdZxlCDkawVW.js} +1 -1
- package/screenshot-page/assets/{Bir0SSOHX0w2yo8h.js → B7u12-Sf0HF7g4wI.js} +1 -1
- package/screenshot-page/assets/BCOjWc-VhkuVoCVf.js +1 -0
- package/screenshot-page/assets/BqQ2A9WL6mcRxbSt.js +2 -0
- package/screenshot-page/assets/Bw4kRw8JKyNRlLE2.js +1 -0
- package/screenshot-page/assets/{UKFgEuwI1UMhPqKF.js → BwF-LAYFu91KqvJ8.js} +2 -2
- package/screenshot-page/assets/{D_rtIYQ7FDC2CoEn.js → Bwk0ScujWaYYqx5G.js} +1 -1
- package/screenshot-page/assets/ByehV0cOs5aIySS-.js +13 -0
- package/screenshot-page/assets/{BIrVK5hdDCUYmxGO.js → C0F9BL11dkgzjp7Y.js} +1 -1
- package/screenshot-page/assets/{Dq7wGcTrNIshovlT.js → C1lrvl0Ad1-NjWKG.js} +2 -2
- package/screenshot-page/assets/{CQFj5AGXfIA9z9zI.js → C3KvRJ_eXd6xnmlO.js} +1 -1
- package/screenshot-page/assets/C3QIYFX-vF_1DVmi.js +586 -0
- package/screenshot-page/assets/C6vseMcEu3To1U6k.js +4 -0
- package/screenshot-page/assets/CM9cBiCjJIY64PWg.js +1 -0
- package/screenshot-page/assets/{BJ2r2WfEL3SgkBAX.js → CNFMt4XhKy4tlsUn.js} +1 -1
- package/screenshot-page/assets/COpZTXe_J1mSpeYD.js +5 -0
- package/screenshot-page/assets/{BMwQInar0xVS5FRu.js → CafJ2T5GCjkumgLh.js} +1 -1
- package/screenshot-page/assets/CaiPDssAQqXac5AG.js +3 -0
- package/screenshot-page/assets/Cfs_rQCXBMVhJgat.js +1 -0
- package/screenshot-page/assets/CijzqW2bsxOQdDxl.js +2 -0
- package/screenshot-page/assets/{BU5S8KEzPmIA_Flm.js → CpZHZoz3xpJMDWI0.js} +1 -1
- package/screenshot-page/assets/{CguXw0IcKNPbmAbj.js → Csjis_Fk8q4mSqdp.js} +2 -2
- package/screenshot-page/assets/{DDkL9PZPXAggW2Yr.js → D1TqM0Bt65K6svMS.js} +19 -19
- package/screenshot-page/assets/D5kEl0N4l6MzdmTG.js +1 -0
- package/screenshot-page/assets/{B8qybUclSjEYP5FJ.js → D6WTzLygjgK85siu.js} +2 -2
- package/screenshot-page/assets/D7e00cCBTtcIRmjV.js +1 -0
- package/screenshot-page/assets/{-N4OYIMgf6f5vgNy.js → DGB9wBuDWt0bzTNE.js} +1 -1
- package/screenshot-page/assets/{CfkssmHURDicfYvR.js → DNoZea7QMO9zB6D5.js} +1 -1
- package/screenshot-page/assets/DZ2zDgzt-mnhg3Kd.js +1 -0
- package/screenshot-page/assets/DaVBDkeZxbXnuyGz.js +42 -0
- package/screenshot-page/assets/DgNbqKuVd-Q170VZ.js +2 -0
- package/screenshot-page/assets/{C71ZZMVLfHdPl441.js → Di8Yn8O-rD9idC2h.js} +1 -1
- package/screenshot-page/assets/DjtXY9uxB3QP6hU3.js +1 -0
- package/screenshot-page/assets/DknSteOdQ6CdF0RT.js +1 -0
- package/screenshot-page/assets/Dv-4mfeFKIoD5jaY.js +3 -0
- package/screenshot-page/assets/DzlbsQ0qqdQEl80f.js +1 -0
- package/screenshot-page/assets/F6yLCIlSWZ1lAUEp.js +2 -0
- package/screenshot-page/assets/HZAIE0lHXXFqlb2v.js +1 -0
- package/screenshot-page/assets/Lr2MYBmoCKMLBl_6.js +5 -0
- package/screenshot-page/assets/{CZa1rha3RnQUWyOk.js → NDzpWLUA0pbyI-Rd.js} +4 -4
- package/screenshot-page/assets/O-S3tcMip6iXUjQF.js +1 -0
- package/screenshot-page/assets/eV_6j-vFozPgfcjz.js +1 -0
- package/screenshot-page/assets/{CqyMYduWKFvmMs_Z.js → iAWaCU0XkY0ktnNk.js} +1 -1
- package/screenshot-page/assets/it1wnIFQtbJ4Dm8N.js +1 -0
- package/screenshot-page/assets/mCyh2440vZi8s1uY.js +39 -0
- package/screenshot-page/assets/{CRsTnamLrPN5-Dsi.js → t4FRkJl27a0itCt6.js} +1 -1
- package/screenshot-page/assets/{lgeNUp9cU20IAotv.js → tPEJNcr51GaPfk3O.js} +1 -1
- package/screenshot-page/assets/zEVoxCTt-ZW8Aowg.js +16 -0
- package/screenshot-page/index.html +10 -9
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +15 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +15 -0
- package/types/scripting-api.json +11445 -11299
- package/types/scripting-enums.json +22 -1
- package/types/scripting.d.ts +623 -0
- package/assets/DsTi7zHk_Xl37bAD.js +0 -14
- package/screenshot-page/assets/B7eQ3rE-7Vayb_4O.js +0 -2
- package/screenshot-page/assets/B8i4Sr2kMQAXp0rb.js +0 -4
- package/screenshot-page/assets/BIHbD4jMsk3NetOd.js +0 -1
- package/screenshot-page/assets/BJviQwDXR5L6l1DA.js +0 -1
- package/screenshot-page/assets/BM78thqEW6HwXFAK.js +0 -13
- package/screenshot-page/assets/C2H2lX8eyKpxpP6M.js +0 -2
- package/screenshot-page/assets/CFfgJlXaIS8QMx5O.js +0 -1
- package/screenshot-page/assets/CN8u05DjKwNHbUHN.js +0 -5
- package/screenshot-page/assets/CYfkL98Zu43S8-50.js +0 -42
- package/screenshot-page/assets/ClzJdxlUDDtBYjH8.js +0 -1
- package/screenshot-page/assets/CzsoLbEIUVK5ia1C.js +0 -1
- package/screenshot-page/assets/D2IHCJ1QWDKwmhge.js +0 -1
- package/screenshot-page/assets/D7biuwkvm3zAwsBa.js +0 -39
- package/screenshot-page/assets/D8s3sJnhFxbI3Dqn.js +0 -1
- package/screenshot-page/assets/DLFFFQjTi5Ji1940.js +0 -1
- package/screenshot-page/assets/DMxrNtfw275en7pm.js +0 -1
- package/screenshot-page/assets/DRncpwDkZZX8rL9S.js +0 -20
- package/screenshot-page/assets/D_kJ3WunvjIINcHC.js +0 -1
- package/screenshot-page/assets/Db6bZVJ-184DJIoe.js +0 -2
- package/screenshot-page/assets/DhB6GjSJIeTmIODk.js +0 -1
- package/screenshot-page/assets/Dn5PwRw7rrTKNnql.js +0 -586
- package/screenshot-page/assets/DyiVrm8mEnEaoZHa.js +0 -3
- package/screenshot-page/assets/LYyM_ig973jLdOU0.js +0 -2
- package/screenshot-page/assets/TilS2JSBGVkd1za3.js +0 -3
- package/screenshot-page/assets/Tph2vYqw17-NBCtd.js +0 -1
- package/screenshot-page/assets/cTMKPkmZF8FWQaMn.js +0 -1
- package/screenshot-page/assets/hlxJ87-H830aSZBQ.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.18
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { p as e, tt as t } from "./
|
|
8
|
-
import { d as n, en as s, f as r, vt as o } from "./
|
|
9
|
-
import { d as a } from "./
|
|
10
|
-
import { $ as
|
|
11
|
-
import { a as K, i as
|
|
12
|
-
var
|
|
7
|
+
import { p as e, tt as t } from "./CDqOifqA400y7KQY.js";
|
|
8
|
+
import { d as n, en as s, f as r, vt as o } from "./CGGpkGg85FZsnYHc.js";
|
|
9
|
+
import { d as a } from "./r9WSFw3a-_a5hlPm.js";
|
|
10
|
+
import { $a as l, $i as i, A as d, Bi as u, Dn as c, E as f, Er as m, Fn as p, H as h, I as g, Ji as w, Li as v, Na as F, Nr as b, Sa as y, Ta as I, Un as x, Ur as A, Wa as C, Wt as E, Xr as S, Yi as P, _a as k, d as M, di as T, ea as R, f as N, fn as O, gr as $, hi as L, jr as _, n as D, ni as V, nt as U, ot as H, ra as B, ri as j, u as z, xt as G, y as q } from "./DN4zv4AjDxTsLFsA.js";
|
|
11
|
+
import { a as K, i as W, n as J, o as Q, r as X } from "./B2C5njsdPylyQOCM.js";
|
|
12
|
+
var Y = [
|
|
13
13
|
"Jan",
|
|
14
14
|
"Feb",
|
|
15
15
|
"Mar",
|
|
@@ -61,15 +61,15 @@ var X = [
|
|
|
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 = P(e.records, n.length);
|
|
65
|
+
if (!n.some(B)) return s;
|
|
66
|
+
const r = P(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 l = n[e];
|
|
69
|
+
if (!B(l)) continue;
|
|
70
|
+
const i = l.group, d = s[i.base] ?? [], u = r[i.base] ?? [], c = new Int32Array(u.length);
|
|
71
71
|
for (let e = 0; e < u.length; e++) {
|
|
72
|
-
const n =
|
|
72
|
+
const n = i.range ? ee(i.range, i.items.length, T(u[e]), t) : i.discrete?.[e] ?? null;
|
|
73
73
|
c[e] = n ?? -1;
|
|
74
74
|
}
|
|
75
75
|
const f = new Array(o);
|
|
@@ -92,17 +92,17 @@ var X = [
|
|
|
92
92
|
e < o && (o = e), e > a && (a = e);
|
|
93
93
|
}
|
|
94
94
|
if (0 === t.length) return e;
|
|
95
|
-
const
|
|
96
|
-
s.fixedStart || (
|
|
97
|
-
const { inner:
|
|
98
|
-
const { start: n, end: s } = e, o = e.interval ?? 1, a = se(s, t),
|
|
95
|
+
const l = { ...s };
|
|
96
|
+
s.fixedStart || (l.start = o), s.fixedEnd || (l.end = "numbers" !== s.by && Number.isInteger(a) ? a + 1 : a);
|
|
97
|
+
const { inner: i, endText: d } = ((e, t) => {
|
|
98
|
+
const { start: n, end: s } = e, o = e.interval ?? 1, a = se(s, t), l = (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(((s - n) / o).toPrecision(12)))), t = Number.isInteger(Number(((s - n) / o).toPrecision(12))), r = Number.isInteger(n) && Number.isInteger(o);
|
|
102
102
|
return {
|
|
103
|
-
inner:
|
|
104
|
-
const
|
|
105
|
-
return `${ne(
|
|
103
|
+
inner: l(e, (a) => {
|
|
104
|
+
const l = n + a * o, i = a === e - 1 && t ? s : r ? l + o - 1 : l + o;
|
|
105
|
+
return `${ne(l)}-${ne(i)}`;
|
|
106
106
|
}),
|
|
107
107
|
endText: ne(t ? s : n + e * o)
|
|
108
108
|
};
|
|
@@ -111,21 +111,21 @@ var X = [
|
|
|
111
111
|
if (1 === o) {
|
|
112
112
|
const e = [];
|
|
113
113
|
return Z.forEach((t, n) => {
|
|
114
|
-
for (let s = 1; s <= t; s++) e.push(`${s}-${
|
|
114
|
+
for (let s = 1; s <= t; s++) e.push(`${s}-${Y[n]}`);
|
|
115
115
|
}), {
|
|
116
116
|
inner: e,
|
|
117
117
|
endText: a
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
return {
|
|
121
|
-
inner:
|
|
121
|
+
inner: l(Math.max(1, Math.ceil((s - n) / o)), (e) => {
|
|
122
122
|
const r = n + e * o;
|
|
123
123
|
return `${se(r, t)} - ${se(Math.min(r + o - 1, s), t)}`;
|
|
124
124
|
}),
|
|
125
125
|
endText: a
|
|
126
126
|
};
|
|
127
127
|
case "months": return {
|
|
128
|
-
inner:
|
|
128
|
+
inner: Y.slice(),
|
|
129
129
|
endText: a
|
|
130
130
|
};
|
|
131
131
|
case "quarters": return {
|
|
@@ -140,26 +140,26 @@ var X = [
|
|
|
140
140
|
case "years": {
|
|
141
141
|
const e = r(n, t)?.year ?? 0;
|
|
142
142
|
return {
|
|
143
|
-
inner:
|
|
143
|
+
inner: l((r(s, 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: l(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: l(60, (e) => `:${String(e).padStart(2, "0")}`),
|
|
153
153
|
endText: a
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
})(
|
|
156
|
+
})(l, n), u = "numbers" === l.by ? ne(l.start) : se(l.start, n);
|
|
157
157
|
return {
|
|
158
158
|
...e,
|
|
159
|
-
range:
|
|
159
|
+
range: l,
|
|
160
160
|
items: [
|
|
161
161
|
`<${u}`,
|
|
162
|
-
...
|
|
162
|
+
...i,
|
|
163
163
|
`>${d}`
|
|
164
164
|
]
|
|
165
165
|
};
|
|
@@ -191,68 +191,68 @@ var X = [
|
|
|
191
191
|
n += t, s += t.length;
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
|
-
const a = "'" === o,
|
|
195
|
-
if (!a && !
|
|
194
|
+
const a = "'" === o, l = a ? null : /^[\p{L}_][\p{L}\p{N}_.]*/u.exec(e.slice(s))?.[0];
|
|
195
|
+
if (!a && !l) {
|
|
196
196
|
n += o, s++;
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
|
-
const
|
|
200
|
-
if (a || (s +=
|
|
199
|
+
const i = a ? r() : l;
|
|
200
|
+
if (a || (s += i.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(i, 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(i, null) ?? (a ? `'${i.replace(/'/g, "''")}'` : i);
|
|
212
|
+
} else n += i;
|
|
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
|
+
}, le = (e, t) => ({
|
|
220
220
|
rowStart: 0,
|
|
221
221
|
colStart: e,
|
|
222
222
|
rowEnd: t - 1,
|
|
223
223
|
colEnd: e
|
|
224
|
-
}),
|
|
224
|
+
}), ie = (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;
|
|
228
228
|
}, de = (e, t) => {
|
|
229
|
-
const n = t.fields ?? [], s = [], r = [], o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(),
|
|
229
|
+
const n = t.fields ?? [], s = [], r = [], o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = (e, t) => {
|
|
230
230
|
if (o.has(e)) return !0;
|
|
231
231
|
if (t.includes(e)) return !1;
|
|
232
|
-
const
|
|
232
|
+
const i = [];
|
|
233
233
|
oe(n[e].formula, (e) => {
|
|
234
|
-
const t = n.findIndex((t) =>
|
|
235
|
-
return t >= 0 &&
|
|
234
|
+
const t = n.findIndex((t) => h(t.name, e));
|
|
235
|
+
return t >= 0 && i.push(t), t >= 0 ? "" : null;
|
|
236
236
|
});
|
|
237
|
-
for (const r of
|
|
238
|
-
if (!
|
|
237
|
+
for (const r of i) if (L(n[r])) {
|
|
238
|
+
if (!l(r, [...t, e])) return !1;
|
|
239
239
|
} else s.includes(r) || s.push(r);
|
|
240
240
|
return o.set(e, r.length), a.set(e, n[e].formula), r.push({
|
|
241
241
|
field: e,
|
|
242
242
|
expression: ""
|
|
243
243
|
}), !0;
|
|
244
|
-
},
|
|
245
|
-
for (const [t, s] of (e.dataFields ?? []).entries()) if (
|
|
246
|
-
if (!
|
|
247
|
-
|
|
244
|
+
}, i = [];
|
|
245
|
+
for (const [t, s] of (e.dataFields ?? []).entries()) if (L(n[s.field])) {
|
|
246
|
+
if (!l(s.field, [])) return null;
|
|
247
|
+
i.push({
|
|
248
248
|
data: t,
|
|
249
249
|
formula: o.get(s.field)
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
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) => h(t.name, e));
|
|
255
|
+
return r >= 0 ? ae(L(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) {
|
|
@@ -263,7 +263,7 @@ var X = [
|
|
|
263
263
|
return {
|
|
264
264
|
operands: s,
|
|
265
265
|
formulas: r,
|
|
266
|
-
measures:
|
|
266
|
+
measures: i
|
|
267
267
|
};
|
|
268
268
|
}, ue = /* @__PURE__ */ new Set([
|
|
269
269
|
"sum",
|
|
@@ -343,71 +343,71 @@ var X = [
|
|
|
343
343
|
percent: 13,
|
|
344
344
|
percentDiff: 14
|
|
345
345
|
}, Ie = (e, t, n, s) => {
|
|
346
|
-
const r =
|
|
346
|
+
const r = U.peek(), o = e.fields, a = t.fields;
|
|
347
347
|
if (!r || !o || !a || o.length !== a.length) return null;
|
|
348
|
-
if (
|
|
348
|
+
if (k(e)) return {
|
|
349
349
|
cells: [],
|
|
350
|
-
...
|
|
350
|
+
...O,
|
|
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
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
360
|
+
const l = b(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:
|
|
367
|
+
const f = xe(e, t, n, d?.calculatedRecords, c.operands);
|
|
368
|
+
if (!f) return null;
|
|
369
|
+
const { items: m, records: p, values: h, 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) {
|
|
373
373
|
t.push({
|
|
374
374
|
field: n,
|
|
375
|
-
form:
|
|
375
|
+
form: F
|
|
376
376
|
});
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
379
|
const e = o[n], s = e?.subtotals;
|
|
380
|
-
if (!e || !
|
|
381
|
-
if (
|
|
380
|
+
if (!e || !v(a[n])) return null;
|
|
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"
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
return t;
|
|
388
|
-
},
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
return
|
|
388
|
+
}, I = y(e.rowFields), x = y(e.columnFields), A = e.pageFields ?? [];
|
|
389
|
+
if (!I || !x || A.some((e) => !v(a[e.field]))) return null;
|
|
390
|
+
const C = g(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, h, 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 = N(t);
|
|
394
394
|
if (!t.records) return null;
|
|
395
|
-
const
|
|
396
|
-
if (!
|
|
397
|
-
const
|
|
398
|
-
const s = !t.fields?.[e]?.noRecords, r = s ? u[e] :
|
|
399
|
-
for (let e = 0; e < c; e++)
|
|
400
|
-
for (let e = 0; e < f; e++)
|
|
401
|
-
return
|
|
402
|
-
},
|
|
395
|
+
const l = te(t, n.isDate1904());
|
|
396
|
+
if (!l) return null;
|
|
397
|
+
const i = !0 === t.fields?.some(B), d = i ? P(t.items, o) : a, u = i ? P(t.records, o) : l, c = t.recordCount ?? 0, f = s?.count ?? 0, m = c + f, p = (e, n) => {
|
|
398
|
+
const s = !t.fields?.[e]?.noRecords, r = s ? u[e] : l[e] ?? [], o = s ? d[e] : a[e], i = new Array(m);
|
|
399
|
+
for (let e = 0; e < c; e++) i[e] = T(o[r[e]]);
|
|
400
|
+
for (let e = 0; e < f; e++) i[c + e] = n?.[e] ?? null;
|
|
401
|
+
return i;
|
|
402
|
+
}, h = [...(e.dataFields ?? []).map((e, t) => p(e.field, s?.values[t])), ...r.map((e) => p(e))];
|
|
403
403
|
return {
|
|
404
404
|
items: a,
|
|
405
|
-
records: s ?
|
|
406
|
-
values:
|
|
407
|
-
n:
|
|
405
|
+
records: s ? l.map((e, t) => e.concat(s.ids[t] ?? [])) : l,
|
|
406
|
+
values: h,
|
|
407
|
+
n: m
|
|
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, l, i) => {
|
|
410
|
+
const d = U.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;
|
|
@@ -428,39 +428,39 @@ var X = [
|
|
|
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 = l ? {
|
|
432
|
+
...l,
|
|
433
|
+
values: [l.values[r] ?? []]
|
|
434
|
+
} : l, I = de(b, t);
|
|
435
|
+
if (!I || I.measures.length > 0 && !i) 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, P = b.rowFields.map((e) => ({
|
|
439
439
|
field: e,
|
|
440
440
|
form: "compact"
|
|
441
441
|
}));
|
|
442
|
-
let
|
|
442
|
+
let k;
|
|
443
443
|
if (a) {
|
|
444
444
|
const e = 0 === f ? 1 : 2;
|
|
445
|
-
|
|
446
|
-
for (let t = 0; t <
|
|
445
|
+
k = new Uint8Array(S);
|
|
446
|
+
for (let t = 0; t < S; t++) {
|
|
447
447
|
const n = a[t];
|
|
448
|
-
|
|
448
|
+
k[t] = (n & e ? 1 : 0) | (3 === n ? 2 : 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
return
|
|
451
|
+
const M = I.measures.length > 0 ? await Ee(d, I, b, A, C, E, P, [], S, o, k, i) : void 0, T = Se(d, b, A, C, E, P, [], S, o, k, I.operands.length, M), R = (t, n) => e.fields[t].items?.[n]?.item ?? n, N = /* @__PURE__ */ new Map(), O = T.columns.length;
|
|
452
|
+
return T.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(T.values[t * O]);
|
|
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 X = [
|
|
|
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, l, i, d, u, c, f) => {
|
|
477
|
+
const { request: m, errors: p } = Pe(e, n, s, r, o, l, i, d, u, c, t.operands.length);
|
|
478
478
|
let h = 0;
|
|
479
479
|
const g = [];
|
|
480
480
|
try {
|
|
@@ -485,7 +485,7 @@ var X = [
|
|
|
485
485
|
t.operands.forEach((t, n) => {
|
|
486
486
|
const o = s.values(r + n);
|
|
487
487
|
try {
|
|
488
|
-
const t =
|
|
488
|
+
const t = W(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 X = [
|
|
|
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: ie(o, r),
|
|
508
508
|
formulas: e.formulas.map(({ expression: e }, n) => ({
|
|
509
509
|
expression: e,
|
|
510
|
-
coords:
|
|
510
|
+
coords: le(t.length + n, r)
|
|
511
511
|
}))
|
|
512
|
-
}),
|
|
512
|
+
}), l = /* @__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
|
+
l.set(t, e);
|
|
517
517
|
}
|
|
518
|
-
return
|
|
518
|
+
return l;
|
|
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, l, i, d, u, c = 0, f, m = !1) => {
|
|
521
|
+
const { request: p, errors: h } = Pe(e, t, n, s, r, o, l, i, 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 i = W(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] ? i(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, ...l]) : []
|
|
533
533
|
};
|
|
534
534
|
} finally {
|
|
535
535
|
a.free();
|
|
@@ -537,14 +537,14 @@ var X = [
|
|
|
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, l, i, d, u = 0, c, f = !1) => {
|
|
541
|
+
const m = t.fields, p = new e.LayoutRequest(l), 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], l = a.subtotals, i = (!l || l.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, i), 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 X = [
|
|
|
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 l = "previous" === e.baseItem ? 4294967294 : "next" === e.baseItem ? 4294967295 : e.baseItem ?? 0;
|
|
573
|
+
p.set_show_as(t, n, s, Math.max(r, 0), l);
|
|
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 X = [
|
|
|
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, l).set(d.subarray(0, l));
|
|
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), l).set(s[r].slice(0, l));
|
|
589
|
+
const { ranks: a, flags: d } = Ce(m[r], o, i?.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), l).set(s[e.field].slice(0, l));
|
|
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 ? i?.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 J();
|
|
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, l),
|
|
605
|
+
ints: new Int32Array(x, e, 2 * l),
|
|
606
|
+
types: new Uint8Array(x, e + 8 * l, l)
|
|
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 < l; 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 = {
|
|
@@ -619,7 +619,7 @@ var X = [
|
|
|
619
619
|
ok: !0,
|
|
620
620
|
numeric: !0
|
|
621
621
|
};
|
|
622
|
-
for (let t = 0; t < n; t++)
|
|
622
|
+
for (let t = 0; t < n; t++) X(s, t, e[t], A, r);
|
|
623
623
|
}
|
|
624
624
|
return {
|
|
625
625
|
request: p,
|
|
@@ -649,57 +649,57 @@ var X = [
|
|
|
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, r, o,
|
|
653
|
-
const
|
|
652
|
+
}, Te = (e, t, n, r, o, l, d, u, c) => {
|
|
653
|
+
const f = e.fields, p = t.fields, h = e.dataFields ?? [], g = (t) => t === ce ? e.valuesCaption ?? "Values" : f[t].name ?? p[t].name, v = (e, t) => {
|
|
654
654
|
if (e === ce) return h[t]?.name ?? "";
|
|
655
|
-
const s =
|
|
655
|
+
const s = f[e].items?.[t];
|
|
656
656
|
if (void 0 !== s?.name) return s.name;
|
|
657
|
-
const r =
|
|
658
|
-
return null === r ?
|
|
657
|
+
const r = T(n[e][s?.item ?? t]);
|
|
658
|
+
return null === r ? S : r;
|
|
659
659
|
}, F = (e, t) => {
|
|
660
660
|
const n = v(e, t);
|
|
661
661
|
if ("number" == typeof n) {
|
|
662
|
-
const r =
|
|
663
|
-
return s(
|
|
662
|
+
const r = f[e].items?.[t]?.item ?? t, o = void 0 === (f[e].numberFormat ?? p[e].numberFormat) && A(p[e], r);
|
|
663
|
+
return s(d, o ? j(C(p[e], r), d) : ((e) => j(f[e].numberFormat ?? p[e].numberFormat, d))(e), n);
|
|
664
664
|
}
|
|
665
665
|
return a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
666
|
-
},
|
|
666
|
+
}, b = (e) => {
|
|
667
667
|
if (void 0 !== e.item) return v(e.field, e.item);
|
|
668
|
-
const t =
|
|
668
|
+
const t = f[e.field].items ?? [];
|
|
669
669
|
if (!t.some((e) => e.hidden)) return "(All)";
|
|
670
|
-
const n = t.flatMap((e, t) =>
|
|
670
|
+
const n = t.flatMap((e, t) => m(e) && !e.hidden ? [t] : []);
|
|
671
671
|
return 1 === n.length ? v(e.field, n[0]) : "(Multiple Items)";
|
|
672
|
-
}, I = e.grandTotalCaption ?? "Grand Total", x = u ? /* @__PURE__ */ new Map() : null,
|
|
672
|
+
}, I = e.grandTotalCaption ?? "Grand Total", x = u ? /* @__PURE__ */ new Map() : null, E = (e, t) => e === ce ? {
|
|
673
673
|
kind: "dataCaption",
|
|
674
674
|
data: t
|
|
675
675
|
} : {
|
|
676
676
|
kind: "item",
|
|
677
677
|
field: e,
|
|
678
678
|
rank: t
|
|
679
|
-
},
|
|
679
|
+
}, P = (e) => e === ce ? null : {
|
|
680
680
|
kind: "fieldCaption",
|
|
681
681
|
field: e
|
|
682
|
-
},
|
|
682
|
+
}, k = (e, t) => 2 === e.kind && t === I ? { kind: "grandTotal" } : null, M = 0 === r.length && 0 === o.length && 0 === h.length, R = M ? {
|
|
683
683
|
firstHeaderRow: 0,
|
|
684
684
|
firstDataRow: 0,
|
|
685
685
|
firstDataCol: 0
|
|
686
|
-
} :
|
|
686
|
+
} : i(e), N = M ? [] : Me(l.rows, l.functions), O = M ? [] : Me(l.columns, l.functions), $ = y({
|
|
687
687
|
...e,
|
|
688
|
-
header:
|
|
689
|
-
rowLines:
|
|
690
|
-
columnLines:
|
|
691
|
-
}), L =
|
|
688
|
+
header: R,
|
|
689
|
+
rowLines: N,
|
|
690
|
+
columnLines: O
|
|
691
|
+
}), L = l.columns.length, _ = (e) => "row" === e ? r : o, V = (t) => {
|
|
692
692
|
switch (t.kind) {
|
|
693
693
|
case "pageCaption": {
|
|
694
694
|
const n = e.pageFields[t.page].field;
|
|
695
|
-
return [
|
|
695
|
+
return [g(n), {
|
|
696
696
|
kind: "fieldCaption",
|
|
697
697
|
field: n
|
|
698
698
|
}];
|
|
699
699
|
}
|
|
700
700
|
case "pageItem": {
|
|
701
701
|
const n = e.pageFields[t.page];
|
|
702
|
-
return [
|
|
702
|
+
return [b(n), {
|
|
703
703
|
kind: "pageItem",
|
|
704
704
|
page: t.page
|
|
705
705
|
}];
|
|
@@ -712,29 +712,29 @@ var X = [
|
|
|
712
712
|
case "columnHeader": return [e.columnHeaderCaption ?? "Column Labels", { kind: "columnHeader" }];
|
|
713
713
|
case "fieldCaption": {
|
|
714
714
|
const e = _(t.axis)[t.level].field;
|
|
715
|
-
return [
|
|
715
|
+
return [g(e), P(e)];
|
|
716
716
|
}
|
|
717
717
|
case "label": {
|
|
718
718
|
const e = _(t.axis)[t.level].field, n = t.line.path[t.level];
|
|
719
|
-
return [v(e, n),
|
|
719
|
+
return [v(e, n), E(e, n)];
|
|
720
720
|
}
|
|
721
721
|
case "total": {
|
|
722
|
-
const e = ("row" === t.axis ?
|
|
722
|
+
const e = ("row" === t.axis ? l.rows : l.columns)[t.line.index], n = ((e, t) => {
|
|
723
723
|
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ? h[t.data]?.name ?? "" : "";
|
|
724
724
|
if (2 === t.kind) return n ? `Total ${s}` : I;
|
|
725
725
|
const r = t.path.length - 1, o = e[r].field, a = F(o, t.path[r]);
|
|
726
726
|
if (null !== t.function) {
|
|
727
|
-
const e = we[
|
|
728
|
-
return (n || t.across) && null !== t.data ? `${a} ${e} of ${
|
|
727
|
+
const e = we[l.functions[t.function]];
|
|
728
|
+
return (n || t.across) && null !== t.data ? `${a} ${e} of ${g(h[t.data].field)}` : `${a} ${e}`;
|
|
729
729
|
}
|
|
730
|
-
return
|
|
730
|
+
return f[o]?.subtotalCaption ?? (n ? `${a} ${s}` : `${a} Total`);
|
|
731
731
|
})(_(t.axis), e);
|
|
732
|
-
return [n,
|
|
732
|
+
return [n, k(e, n)];
|
|
733
733
|
}
|
|
734
734
|
case "value": {
|
|
735
|
-
const n = t.row.index * L + t.column.index, s =
|
|
735
|
+
const n = t.row.index * L + t.column.index, s = l.states[n];
|
|
736
736
|
let r = null;
|
|
737
|
-
return 0 === s ? (r =
|
|
737
|
+
return 0 === s ? (r = l.values[n], e.showError && a.isError(r) && (r = e.errorCaption ?? "")) : 1 === s && (r = !1 === e.showEmpty ? 0 : ((e) => {
|
|
738
738
|
if (void 0 === e) return null;
|
|
739
739
|
const t = e.trim();
|
|
740
740
|
if (!/^[+-]?\d*(?:\.\d*)?$/.test(t)) return e;
|
|
@@ -743,30 +743,30 @@ var X = [
|
|
|
743
743
|
})(e.emptyCaption)), [r, null];
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
},
|
|
747
|
-
const n =
|
|
746
|
+
}, U = new w.Builder(), H = $.top, B = $.pages.reduce((e, t) => Math.max(e, t.column + 2), 0), G = (e, t) => {
|
|
747
|
+
const n = z($, e, t);
|
|
748
748
|
if (!n) return;
|
|
749
|
-
const [s, r] =
|
|
749
|
+
const [s, r] = V(n);
|
|
750
750
|
((e, t, n) => {
|
|
751
751
|
x && n && x.set(e + "," + t, n);
|
|
752
|
-
})(e -
|
|
752
|
+
})(e - H, t, r), null !== s && (c ? U.pushAt(t, e - H, s) : U.pushAt(e - H, t, s));
|
|
753
753
|
};
|
|
754
|
-
if (
|
|
755
|
-
const e = Math.max(
|
|
756
|
-
for (let t = 0; t < e; t++) for (let e = 0; e < $.rows.length; e++) t < (e <
|
|
754
|
+
if (c) {
|
|
755
|
+
const e = Math.max(B, $.columns.length);
|
|
756
|
+
for (let t = 0; t < e; t++) for (let e = 0; e < $.rows.length; e++) t < (e < H ? B : $.columns.length) && G(e, t);
|
|
757
757
|
} else for (let e = 0; e < $.rows.length; e++) {
|
|
758
|
-
const t = e <
|
|
759
|
-
for (let n = 0; n < t; n++)
|
|
758
|
+
const t = e < H ? B : $.columns.length;
|
|
759
|
+
for (let n = 0; n < t; n++) G(e, n);
|
|
760
760
|
}
|
|
761
|
-
if (
|
|
762
|
-
const t =
|
|
761
|
+
if (M) {
|
|
762
|
+
const t = D(e);
|
|
763
763
|
return {
|
|
764
|
-
cells:
|
|
764
|
+
cells: U.build()?.tuples ?? [],
|
|
765
765
|
rows: 1,
|
|
766
766
|
columns: 1,
|
|
767
767
|
rowPageCount: t.rows,
|
|
768
768
|
columnPageCount: t.columns,
|
|
769
|
-
header:
|
|
769
|
+
header: R,
|
|
770
770
|
rowLines: [],
|
|
771
771
|
columnLines: [],
|
|
772
772
|
viewValues: [],
|
|
@@ -774,52 +774,52 @@ var X = [
|
|
|
774
774
|
...x ? { roles: x } : {}
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
|
-
const
|
|
777
|
+
const q = (e, t) => {
|
|
778
778
|
const n = [];
|
|
779
779
|
return e.forEach((e, s) => {
|
|
780
780
|
e.field !== ce && n.push(s < t.path.length ? t.path[s] : -1);
|
|
781
781
|
}), n;
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
3 === t.kind || Z(t) || (
|
|
785
|
-
const o =
|
|
782
|
+
}, W = (e, t) => K(e.data ?? t.data ?? 0, [...q(r, e), ...q(o, t)]), [J] = l.rows, [Q] = l.columns, X = J && Q && 3 !== J.kind && 3 !== Q.kind ? W(J, Q) : null, Y = [], Z = (e) => 1 === e.kind && null !== e.function;
|
|
783
|
+
l.rows.forEach((t, n) => {
|
|
784
|
+
3 === t.kind || Z(t) || (q(r, t), l.columns.forEach((s, r) => {
|
|
785
|
+
const o = l.states[n * L + r];
|
|
786
786
|
if (3 === s.kind || Z(s) || 0 !== o && 1 !== o) return;
|
|
787
|
-
let
|
|
788
|
-
e.showError && a.isError(
|
|
787
|
+
let i = 0 === o ? l.values[n * L + r] : 0;
|
|
788
|
+
e.showError && a.isError(i) && (i = e.errorCaption || 0), Y.push([W(t, s), i]);
|
|
789
789
|
}));
|
|
790
790
|
});
|
|
791
|
-
const ee =
|
|
791
|
+
const ee = D(e);
|
|
792
792
|
return {
|
|
793
|
-
cells:
|
|
794
|
-
rows: $.rows.length -
|
|
793
|
+
cells: U.build()?.tuples ?? [],
|
|
794
|
+
rows: $.rows.length - H,
|
|
795
795
|
columns: $.columns.length,
|
|
796
796
|
rowPageCount: ee.rows,
|
|
797
797
|
columnPageCount: ee.columns,
|
|
798
|
-
header:
|
|
799
|
-
rowLines:
|
|
800
|
-
columnLines:
|
|
801
|
-
viewValues:
|
|
802
|
-
firstKey:
|
|
798
|
+
header: R,
|
|
799
|
+
rowLines: N,
|
|
800
|
+
columnLines: O,
|
|
801
|
+
viewValues: Y,
|
|
802
|
+
firstKey: X,
|
|
803
803
|
...x ? { roles: x } : {}
|
|
804
804
|
};
|
|
805
|
-
}, Re = (e, t, n, r, o = !1,
|
|
805
|
+
}, Re = (e, t, n, r, o = !1, l, i) => {
|
|
806
806
|
const d = Ie(e, t, r, {
|
|
807
|
-
filters:
|
|
808
|
-
slicerFields:
|
|
807
|
+
filters: l,
|
|
808
|
+
slicerFields: i
|
|
809
809
|
});
|
|
810
810
|
if (!d) return null;
|
|
811
811
|
const u = d.rowPageCount > 0 ? d.rowPageCount + 1 : 0, c = d.rowPageCount > 0 ? 3 * d.columnPageCount - 1 : 0, { rowStart: f, colStart: m } = n;
|
|
812
812
|
if (f - u < 0) return null;
|
|
813
|
-
const
|
|
813
|
+
const p = {
|
|
814
814
|
rowStart: f - u,
|
|
815
815
|
colStart: m,
|
|
816
816
|
rowEnd: f + d.rows - 1,
|
|
817
817
|
colEnd: m + Math.max(d.columns, c) - 1
|
|
818
|
-
},
|
|
819
|
-
const n =
|
|
820
|
-
const n =
|
|
818
|
+
}, h = e.fields, g = t.fields, w = N(t), v = (e, t) => {
|
|
819
|
+
const n = h[e], o = n.numberFormat ?? g[e].numberFormat, l = j(o, r), i = 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) => {
|
|
820
|
+
const n = T(d[t.item]), u = A(g[e], t.item), c = null === n ? "(blank)" : "number" == typeof n ? s(r, u ? (f = t.item, void 0 === o ? j(C(g[e], f), r) : l) : l, n) : a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
821
821
|
var f;
|
|
822
|
-
const m =
|
|
822
|
+
const m = i && u ? c : n;
|
|
823
823
|
return void 0 !== t.name ? {
|
|
824
824
|
value: m,
|
|
825
825
|
text: c,
|
|
@@ -829,7 +829,7 @@ var X = [
|
|
|
829
829
|
text: c
|
|
830
830
|
};
|
|
831
831
|
}), m = {
|
|
832
|
-
name: n.name ??
|
|
832
|
+
name: n.name ?? g[e].name,
|
|
833
833
|
items: f
|
|
834
834
|
};
|
|
835
835
|
if (t) {
|
|
@@ -837,18 +837,18 @@ var X = [
|
|
|
837
837
|
m.page = void 0 !== e ? c.findIndex((t) => t.item === e) : -1;
|
|
838
838
|
}
|
|
839
839
|
return m;
|
|
840
|
-
},
|
|
840
|
+
}, F = (e) => (e ?? []).filter((e) => -2 !== e);
|
|
841
841
|
return {
|
|
842
842
|
view: {
|
|
843
|
-
range:
|
|
843
|
+
range: p,
|
|
844
844
|
dataFields: (e.dataFields ?? []).map((e) => ({
|
|
845
845
|
name: e.name,
|
|
846
|
-
sourceName:
|
|
846
|
+
sourceName: g[e.field].name
|
|
847
847
|
})),
|
|
848
848
|
fields: [
|
|
849
|
-
...
|
|
850
|
-
...
|
|
851
|
-
...(e.pageFields ?? []).map((e) =>
|
|
849
|
+
...F(e.rowFields).map((e) => v(e)),
|
|
850
|
+
...F(e.columnFields).map((e) => v(e)),
|
|
851
|
+
...(e.pageFields ?? []).map((e) => v(e.field, e))
|
|
852
852
|
],
|
|
853
853
|
values: d.viewValues,
|
|
854
854
|
block: {
|
|
@@ -865,85 +865,85 @@ var X = [
|
|
|
865
865
|
columns: d.columns
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
|
-
},
|
|
869
|
-
const o = /* @__PURE__ */ new Map(),
|
|
870
|
-
if (0 ===
|
|
871
|
-
const
|
|
872
|
-
for (const s of
|
|
873
|
-
const a = s.field,
|
|
874
|
-
if (!
|
|
875
|
-
const
|
|
876
|
-
for (let e = 0; e <
|
|
877
|
-
const
|
|
878
|
-
if (f) for (let e = 0; e <
|
|
879
|
-
else o.set(a,
|
|
868
|
+
}, Ne = async (e, t, n, r) => {
|
|
869
|
+
const o = /* @__PURE__ */ new Map(), l = (e.filters ?? []).filter((t) => V(t) || e.rowFields?.includes(t.field) || e.columnFields?.includes(t.field)), i = e.fields?.some((e) => e.items?.some((e) => e.calculated)), d = e.dataFields?.some((e) => L(t.fields?.[e.field]));
|
|
870
|
+
if (0 === l.length && !i && !d) return { keep: o };
|
|
871
|
+
const u = N(t);
|
|
872
|
+
for (const s of l.filter(V)) {
|
|
873
|
+
const a = s.field, l = u[a];
|
|
874
|
+
if (!l) continue;
|
|
875
|
+
const i = R(s.condition) ? Le(e, t, l, a, n) : null, d = new Array(l.length);
|
|
876
|
+
for (let e = 0; e < l.length; e++) d[e] = i ? i[e] : T(l[e]);
|
|
877
|
+
const c = await $e(s.condition, d, n, r), f = o.get(a);
|
|
878
|
+
if (f) for (let e = 0; e < c.length; e++) f[e] &= c[e];
|
|
879
|
+
else o.set(a, c);
|
|
880
880
|
}
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
if (1 !==
|
|
884
|
-
const
|
|
885
|
-
if (!
|
|
886
|
-
const
|
|
881
|
+
const c = i && r ? await (async (e, t, n, r, o) => {
|
|
882
|
+
const l = t.fields ?? [], i = e.fields ?? [], d = l.flatMap((e, t) => e.calculatedItems?.length ? [t] : []), u = e.dataFields ?? [];
|
|
883
|
+
if (1 !== d.length || u.some((e) => L(l[e.field]) || !ue.has(e.subtotal ?? "sum"))) return null;
|
|
884
|
+
const c = d[0], f = l[c].calculatedItems, m = te(t, n.isDate1904());
|
|
885
|
+
if (!m) return null;
|
|
886
|
+
const p = N(t), g = N({
|
|
887
887
|
...t,
|
|
888
|
-
fields:
|
|
889
|
-
}),
|
|
890
|
-
if (!
|
|
891
|
-
const
|
|
892
|
-
const n =
|
|
888
|
+
fields: l.map(({ group: e, ...t }) => t)
|
|
889
|
+
}), w = (e.rowFields ?? []).filter((e) => e >= 0), v = (e.columnFields ?? []).filter((e) => e >= 0), F = w.includes(c) ? w : v.includes(c) ? v : null;
|
|
890
|
+
if (!F) return null;
|
|
891
|
+
const b = F.slice(0, F.indexOf(c)), y = [...F.slice(F.indexOf(c) + 1), ...F === w ? v : w], I = [...b, ...y], x = t.recordCount ?? 0, C = (e, t) => {
|
|
892
|
+
const n = i[e]?.items, s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
893
893
|
return !(n && (!s || s.hidden) || o?.get(e) && 0 === o.get(e)[t]);
|
|
894
|
-
},
|
|
895
|
-
const n =
|
|
894
|
+
}, E = (e, t) => {
|
|
895
|
+
const n = i[e.field]?.items;
|
|
896
896
|
if (void 0 !== e.item) return n?.[e.item]?.item === t;
|
|
897
897
|
const s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
898
898
|
return !n || !!s && !s.hidden;
|
|
899
|
-
}, P = e.pageFields ?? [], k =
|
|
900
|
-
const o =
|
|
901
|
-
return "number" == typeof o && (
|
|
902
|
-
}), R = /* @__PURE__ */ new Map(),
|
|
899
|
+
}, P = e.pageFields ?? [], k = j(l[c].numberFormat ?? 14, n), M = (e) => p[c].findIndex((t, r) => {
|
|
900
|
+
const o = T(t);
|
|
901
|
+
return "number" == typeof o && (l[c].dates || A(l[c], r)) ? h(s(n, k, o), e) : h(null === o ? S : G(o), e);
|
|
902
|
+
}), R = /* @__PURE__ */ new Map(), O = new Map(f.map((e) => [e.item, e.formula])), $ = (e) => {
|
|
903
903
|
let t = R.get(e);
|
|
904
904
|
return void 0 === t && R.set(e, t = R.size), t;
|
|
905
905
|
};
|
|
906
|
-
for (const e of
|
|
907
|
-
if (null === t || !
|
|
906
|
+
for (const e of f) if (null === oe(e.formula, (e, t) => {
|
|
907
|
+
if (null === t || !h(l[c].name, e)) return null;
|
|
908
908
|
const n = M(t);
|
|
909
|
-
return n < 0 ? null : (
|
|
909
|
+
return n < 0 ? null : (O.has(n) || $(n), "");
|
|
910
910
|
})) return null;
|
|
911
|
-
const
|
|
912
|
-
column:
|
|
913
|
-
values:
|
|
911
|
+
const _ = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), V = u.map((e) => ({
|
|
912
|
+
column: m[e.field],
|
|
913
|
+
values: g[e.field],
|
|
914
914
|
fold: e.subtotal ?? "sum"
|
|
915
|
-
})),
|
|
916
|
-
for (let e = 0; e <
|
|
917
|
-
if (!P.every((t) =>
|
|
918
|
-
if (!
|
|
915
|
+
})), U = R.size;
|
|
916
|
+
for (let e = 0; e < x; e++) {
|
|
917
|
+
if (!P.every((t) => E(t, m[t.field][e]))) continue;
|
|
918
|
+
if (!I.every((t) => C(t, m[t][e]))) continue;
|
|
919
919
|
let t = "";
|
|
920
|
-
for (const n of
|
|
921
|
-
|
|
922
|
-
const n = R.get(
|
|
920
|
+
for (const n of b) t += m[n][e] + ",";
|
|
921
|
+
D.has(t) || D.set(t, e);
|
|
922
|
+
const n = R.get(m[c][e]);
|
|
923
923
|
if (void 0 === n) continue;
|
|
924
924
|
let s = t;
|
|
925
|
-
for (const t of
|
|
926
|
-
let r =
|
|
925
|
+
for (const t of y) s += m[t][e] + ",";
|
|
926
|
+
let r = _.get(s);
|
|
927
927
|
r || (r = {
|
|
928
|
-
sums:
|
|
929
|
-
errors:
|
|
930
|
-
},
|
|
931
|
-
const { sums: o, errors:
|
|
932
|
-
|
|
933
|
-
const d =
|
|
934
|
-
"sum" === r ? "number" == typeof d ? o[
|
|
928
|
+
sums: u.map(() => new Array(U).fill(0)),
|
|
929
|
+
errors: u.map(() => new Array(U).fill(void 0))
|
|
930
|
+
}, _.set(s, r));
|
|
931
|
+
const { sums: o, errors: l } = r;
|
|
932
|
+
V.forEach(({ column: t, values: s, fold: r }, i) => {
|
|
933
|
+
const d = T(s[t[e]]);
|
|
934
|
+
"sum" === r ? "number" == typeof d ? o[i][n] += d : a.isError(d) && (l[i][n] ??= d) : ("countNums" === r ? "number" == typeof d : null !== d) && (o[i][n] += 1);
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
|
-
const
|
|
938
|
-
const t =
|
|
939
|
-
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing &&
|
|
937
|
+
const H = y.map((e) => {
|
|
938
|
+
const t = i[e]?.items;
|
|
939
|
+
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing && C(e, t.item) ? [t.item] : []) : p[e].map((e, t) => t);
|
|
940
940
|
});
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
for (const [e, t] of
|
|
941
|
+
if (H.reduce((e, t) => e * t.length, D.size) > 5e5) return null;
|
|
942
|
+
const B = [];
|
|
943
|
+
for (const [e, t] of D) {
|
|
944
944
|
const n = (e, s, r) => {
|
|
945
|
-
if (e !==
|
|
946
|
-
else
|
|
945
|
+
if (e !== H.length) for (const t of H[e]) n(e + 1, [...s, t], r + t + ",");
|
|
946
|
+
else B.push({
|
|
947
947
|
exemplar: t,
|
|
948
948
|
path: s,
|
|
949
949
|
key: r
|
|
@@ -951,103 +951,103 @@ var X = [
|
|
|
951
951
|
};
|
|
952
952
|
n(0, [], e);
|
|
953
953
|
}
|
|
954
|
-
const
|
|
955
|
-
if (0 ===
|
|
954
|
+
const z = B.length;
|
|
955
|
+
if (0 === z) return {
|
|
956
956
|
count: 0,
|
|
957
|
-
ids:
|
|
958
|
-
values:
|
|
957
|
+
ids: l.map(() => []),
|
|
958
|
+
values: u.map(() => [])
|
|
959
959
|
};
|
|
960
|
-
const q =
|
|
961
|
-
for (let e = 0; e <
|
|
962
|
-
const s =
|
|
960
|
+
const q = u.length * U, K = (e, t) => e * U + t, W = (e, t) => q + e * f.length + t, J = [];
|
|
961
|
+
for (let e = 0; e < u.length; e++) for (let t = 0; t < U; t++) J.push(B.map(({ key: n }) => {
|
|
962
|
+
const s = _.get(n);
|
|
963
963
|
return s ? s.errors[e][t] ?? s.sums[e][t] : 0;
|
|
964
964
|
}));
|
|
965
|
-
const
|
|
966
|
-
for (let e = 0; e <
|
|
967
|
-
const n = oe(
|
|
965
|
+
const Q = [];
|
|
966
|
+
for (let e = 0; e < u.length; e++) for (let t = 0; t < f.length; t++) {
|
|
967
|
+
const n = oe(f[t].formula, (t, n) => {
|
|
968
968
|
if (null === n) return null;
|
|
969
|
-
const s = M(n), r =
|
|
970
|
-
return ae(r >= 0 ?
|
|
969
|
+
const s = M(n), r = f.findIndex((e) => e.item === s);
|
|
970
|
+
return ae(r >= 0 ? W(e, r) : K(e, R.get(s)));
|
|
971
971
|
});
|
|
972
972
|
if (null === n) return null;
|
|
973
|
-
|
|
973
|
+
Q.push({
|
|
974
974
|
expression: n,
|
|
975
|
-
coords:
|
|
975
|
+
coords: le(W(e, t), z)
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
|
-
const
|
|
979
|
-
values:
|
|
980
|
-
formulas:
|
|
981
|
-
}),
|
|
982
|
-
|
|
983
|
-
const r =
|
|
984
|
-
|
|
978
|
+
const X = await r.evaluateBatch({
|
|
979
|
+
values: ie(J, z),
|
|
980
|
+
formulas: Q
|
|
981
|
+
}), Y = l.map(() => []), Z = u.map(() => []), ee = (e, t, n, s) => {
|
|
982
|
+
m.forEach((n, s) => {
|
|
983
|
+
const r = y.indexOf(s);
|
|
984
|
+
Y[s].push(s === c ? t : r >= 0 ? e.path[r] : n[e.exemplar] ?? 0);
|
|
985
985
|
}), Z.forEach((e, t) => {
|
|
986
986
|
e.push(t === n ? s : null);
|
|
987
987
|
});
|
|
988
988
|
};
|
|
989
|
-
return
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
const a =
|
|
989
|
+
return B.forEach((e, t) => {
|
|
990
|
+
f.forEach(({ item: n }, s) => {
|
|
991
|
+
u.forEach((r, o) => {
|
|
992
|
+
const a = X[o * f.length + s].getValueAt(t, 0) ?? 0;
|
|
993
993
|
if ("sum" !== (r.subtotal ?? "sum") && "number" == typeof a) for (let t = 0; t < Math.round(a); t++) ee(e, n, o, 1);
|
|
994
994
|
else ee(e, n, o, a);
|
|
995
995
|
});
|
|
996
996
|
});
|
|
997
997
|
}), {
|
|
998
|
-
count:
|
|
999
|
-
ids:
|
|
998
|
+
count: Y[0]?.length ?? 0,
|
|
999
|
+
ids: Y,
|
|
1000
1000
|
values: Z
|
|
1001
1001
|
};
|
|
1002
|
-
})(e, t, n, r, o) : void 0,
|
|
1002
|
+
})(e, t, n, r, o) : void 0, f = l.filter((e) => !V(e)).map((e, t) => ({
|
|
1003
1003
|
filter: e,
|
|
1004
1004
|
index: t
|
|
1005
|
-
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index),
|
|
1006
|
-
let
|
|
1007
|
-
const
|
|
1008
|
-
for (const { filter: s } of
|
|
1009
|
-
const a = await Ae(e, t, n, s.field, s.dataField, o,
|
|
1005
|
+
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index), m = (t.recordCount ?? 0) + (c?.count ?? 0);
|
|
1006
|
+
let p;
|
|
1007
|
+
const g = e.rowFields ?? [];
|
|
1008
|
+
for (const { filter: s } of f) {
|
|
1009
|
+
const a = await Ae(e, t, n, s.field, s.dataField, o, p, c, r);
|
|
1010
1010
|
if (!a) continue;
|
|
1011
|
-
const
|
|
1011
|
+
const l = /* @__PURE__ */ new Set();
|
|
1012
1012
|
for (const [e, t] of a.groups) {
|
|
1013
1013
|
const o = await $e(s.condition, t.totals, n, r);
|
|
1014
1014
|
t.ids.forEach((t, n) => {
|
|
1015
|
-
o[n] ||
|
|
1015
|
+
o[n] || l.add(`${e}|${t}`);
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
|
-
if (0 ===
|
|
1019
|
-
|
|
1020
|
-
const
|
|
1021
|
-
for (let e = 0; e <
|
|
1022
|
-
if (!(
|
|
1018
|
+
if (0 === l.size) continue;
|
|
1019
|
+
p ??= new Uint8Array(m).fill(3);
|
|
1020
|
+
const i = a.outer.map((e) => a.records[e]), d = a.records[s.field], u = g.includes(s.field) ? 1 : 2;
|
|
1021
|
+
for (let e = 0; e < m; e++) {
|
|
1022
|
+
if (!(p[e] & u)) continue;
|
|
1023
1023
|
let t = "";
|
|
1024
|
-
for (let n = 0; n <
|
|
1025
|
-
|
|
1024
|
+
for (let n = 0; n < i.length; n++) t += (n > 0 ? "," : "") + i[n][e];
|
|
1025
|
+
l.has(`${t}|${d[e]}`) && (p[e] &= ~u);
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
const
|
|
1029
|
-
const
|
|
1030
|
-
if (!
|
|
1031
|
-
const d = xe(e, t, n, a,
|
|
1028
|
+
const w = d && r ? await (async (e, t, n, s, r, o, a) => {
|
|
1029
|
+
const l = U.peek(), i = de(e, t);
|
|
1030
|
+
if (!l || !i) return null;
|
|
1031
|
+
const d = xe(e, t, n, a, i.operands);
|
|
1032
1032
|
if (!d) return null;
|
|
1033
1033
|
const u = (t) => (t ?? []).map((t) => ({
|
|
1034
1034
|
field: t,
|
|
1035
1035
|
form: t === ce ? e.form ?? "compact" : e.fields?.[t]?.form ?? "compact"
|
|
1036
1036
|
}));
|
|
1037
|
-
return Ee(
|
|
1038
|
-
})(e, t, n, r, o,
|
|
1037
|
+
return Ee(l, i, e, d.items, d.records, d.values, u(e.rowFields), u(e.columnFields), d.n, r, o, s);
|
|
1038
|
+
})(e, t, n, r, o, p, c) : void 0;
|
|
1039
1039
|
return {
|
|
1040
1040
|
keep: o,
|
|
1041
|
-
...
|
|
1042
|
-
...
|
|
1043
|
-
...
|
|
1041
|
+
...p ? { records: p } : {},
|
|
1042
|
+
...c ? { calculatedRecords: c } : {},
|
|
1043
|
+
...w ? { fieldValues: w } : {}
|
|
1044
1044
|
};
|
|
1045
|
-
},
|
|
1045
|
+
}, Oe = (e, t) => {
|
|
1046
1046
|
const n = e.filters;
|
|
1047
1047
|
if (!n) return e;
|
|
1048
1048
|
let s = !1;
|
|
1049
1049
|
const r = n.map((e) => {
|
|
1050
|
-
const n = e.condition &&
|
|
1050
|
+
const n = e.condition && _(e.condition, t);
|
|
1051
1051
|
return n === e.condition ? e : (s = !0, {
|
|
1052
1052
|
...e,
|
|
1053
1053
|
condition: n
|
|
@@ -1060,10 +1060,10 @@ var X = [
|
|
|
1060
1060
|
}, $e = async (e, t, n, s) => {
|
|
1061
1061
|
const r = t.length, o = new Uint8Array(r);
|
|
1062
1062
|
if (0 === r) return o;
|
|
1063
|
-
const a = new
|
|
1063
|
+
const a = new f();
|
|
1064
1064
|
for (let e = 0; e < r; e++) null !== t[e] && a.setValueAt(e, 0, t[e]);
|
|
1065
1065
|
let l = !1;
|
|
1066
|
-
return await
|
|
1066
|
+
return await M({
|
|
1067
1067
|
conditions: [e],
|
|
1068
1068
|
runtime: n,
|
|
1069
1069
|
calculation: s ?? null,
|
|
@@ -1086,19 +1086,19 @@ var X = [
|
|
|
1086
1086
|
}
|
|
1087
1087
|
}), l || o.fill(1), o;
|
|
1088
1088
|
}, Le = (e, t, n, r, o) => {
|
|
1089
|
-
const
|
|
1090
|
-
for (const e of
|
|
1091
|
-
const
|
|
1089
|
+
const l = e.fields?.[r], i = /* @__PURE__ */ new Map();
|
|
1090
|
+
for (const e of l?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name && i.set(e.item, e.name);
|
|
1091
|
+
const d = l?.numberFormat ?? t.fields?.[r]?.numberFormat, u = j(d, o), c = (e) => void 0 === d ? j(C(t.fields?.[r], e), o) : u, f = new Array(n.length);
|
|
1092
1092
|
for (let e = 0; e < n.length; e++) {
|
|
1093
|
-
const
|
|
1094
|
-
if (void 0 !==
|
|
1095
|
-
|
|
1093
|
+
const l = i.get(e);
|
|
1094
|
+
if (void 0 !== l) {
|
|
1095
|
+
f[e] = l;
|
|
1096
1096
|
continue;
|
|
1097
1097
|
}
|
|
1098
|
-
const
|
|
1099
|
-
null ===
|
|
1098
|
+
const d = T(n[e]);
|
|
1099
|
+
null === d ? f[e] = S : "number" == typeof d ? f[e] = s(o, A(t.fields?.[r], e) ? c(e) : u, d) : "boolean" == typeof d ? f[e] = d ? "TRUE" : "FALSE" : a.isError(d) ? f[e] = d.getLabel() : f[e] = String(d);
|
|
1100
1100
|
}
|
|
1101
|
-
return
|
|
1101
|
+
return f;
|
|
1102
1102
|
}, _e = (e) => {
|
|
1103
1103
|
const t = e.getCoords(), n = t.colEnd - t.colStart + 1, s = t.rowEnd - t.rowStart, r = e.getWorksheet(), o = r.getRange({
|
|
1104
1104
|
rowStart: t.rowStart,
|
|
@@ -1107,8 +1107,8 @@ var X = [
|
|
|
1107
1107
|
colEnd: t.colEnd
|
|
1108
1108
|
}).getValues()[0] ?? [], a = [];
|
|
1109
1109
|
for (let e = 0; e < n; e++) {
|
|
1110
|
-
const n = o[e] ?? null,
|
|
1111
|
-
let d, u, c = !1, f =
|
|
1110
|
+
const n = o[e] ?? null, l = new Q(), i = new Uint32Array(s);
|
|
1111
|
+
let d, u, c = !1, f = l.values;
|
|
1112
1112
|
if (s > 0) {
|
|
1113
1113
|
const n = r.getRange({
|
|
1114
1114
|
rowStart: t.rowStart + 1,
|
|
@@ -1116,13 +1116,13 @@ var X = [
|
|
|
1116
1116
|
colStart: t.colStart + e,
|
|
1117
1117
|
colEnd: t.colStart + e
|
|
1118
1118
|
});
|
|
1119
|
-
|
|
1120
|
-
const o = Ue(n, t.rowStart + 1,
|
|
1119
|
+
l.fill(n.getValuesRange(), i), d = Ve(n, s);
|
|
1120
|
+
const o = Ue(n, t.rowStart + 1, i, l.values);
|
|
1121
1121
|
c = o.dates, u = o.dateIds, f = o.values;
|
|
1122
1122
|
}
|
|
1123
1123
|
a.push({
|
|
1124
1124
|
header: De(n),
|
|
1125
|
-
ids:
|
|
1125
|
+
ids: i,
|
|
1126
1126
|
values: f,
|
|
1127
1127
|
numberFormat: d,
|
|
1128
1128
|
dates: c,
|
|
@@ -1155,17 +1155,17 @@ var X = [
|
|
|
1155
1155
|
dates: o,
|
|
1156
1156
|
values: s
|
|
1157
1157
|
};
|
|
1158
|
-
const
|
|
1158
|
+
const l = s.slice(), i = /* @__PURE__ */ new Map();
|
|
1159
1159
|
for (let e = 0; e < n.length; e++) {
|
|
1160
1160
|
const t = n[e];
|
|
1161
1161
|
if ("number" != typeof s[t] || !He(r, e)) continue;
|
|
1162
|
-
let o =
|
|
1163
|
-
void 0 === o && (o =
|
|
1162
|
+
let o = i.get(t);
|
|
1163
|
+
void 0 === o && (o = l.length, l.push(s[t]), i.set(t, o)), n[e] = o;
|
|
1164
1164
|
}
|
|
1165
1165
|
return {
|
|
1166
1166
|
dates: !1,
|
|
1167
|
-
dateIds: new Set(
|
|
1168
|
-
values:
|
|
1167
|
+
dateIds: new Set(i.values()),
|
|
1168
|
+
values: l
|
|
1169
1169
|
};
|
|
1170
1170
|
}, He = (e, t) => {
|
|
1171
1171
|
let n = 0, s = e.length - 1;
|
|
@@ -1184,8 +1184,8 @@ var X = [
|
|
|
1184
1184
|
} : a.isError(e) ? {
|
|
1185
1185
|
t: "e",
|
|
1186
1186
|
v: e.getCode()
|
|
1187
|
-
} : e,
|
|
1188
|
-
const r = e.fields ?? [], o =
|
|
1187
|
+
} : e, je = (e, t) => (t && "number" == typeof e ? "date:" : "") + v(T(e)), ze = (e, t, n, s = !1) => {
|
|
1188
|
+
const r = e.fields ?? [], o = P(e.items, r.length), a = /\smissingItemsLimit="0"/.test(e.rest ?? ""), l = ((e) => {
|
|
1189
1189
|
const t = /* @__PURE__ */ new Set();
|
|
1190
1190
|
return e.map((e, n) => {
|
|
1191
1191
|
const s = "" === e ? `Field${n + 1}` : e;
|
|
@@ -1193,13 +1193,13 @@ var X = [
|
|
|
1193
1193
|
for (let e = 2; t.has(r.toLocaleLowerCase()); e++) r = `${s}${e}`;
|
|
1194
1194
|
return t.add(r.toLocaleLowerCase()), r;
|
|
1195
1195
|
});
|
|
1196
|
-
})(t.columns.map((e) => e.header)),
|
|
1196
|
+
})(t.columns.map((e) => e.header)), i = /* @__PURE__ */ new Map();
|
|
1197
1197
|
r.forEach((e, t) => {
|
|
1198
1198
|
const n = e.name.toLocaleLowerCase();
|
|
1199
|
-
e.noRecords ||
|
|
1199
|
+
e.noRecords || i.has(n) || i.set(n, t);
|
|
1200
1200
|
});
|
|
1201
|
-
const d = t.recordCount, u = r.map(() => -1), c = r.map((e, t) => o[t].map(() => -1)),
|
|
1202
|
-
|
|
1201
|
+
const d = t.recordCount, u = r.map(() => -1), c = r.map((e, t) => o[t].map(() => -1)), f = [], m = [], p = [], h = [], g = [], w = [], v = [], F = (e, t, n) => {
|
|
1202
|
+
h[t] = n.items, w[t] = n.items.length, v[t] = !0, c[e] = ((e, t) => {
|
|
1203
1203
|
const n = /* @__PURE__ */ new Map();
|
|
1204
1204
|
return t.forEach((e, t) => {
|
|
1205
1205
|
n.set(e, t);
|
|
@@ -1207,109 +1207,109 @@ var X = [
|
|
|
1207
1207
|
})(r[e].group.items, n.items);
|
|
1208
1208
|
};
|
|
1209
1209
|
t.columns.forEach((e, t) => {
|
|
1210
|
-
const n =
|
|
1211
|
-
void 0 !== n && (
|
|
1212
|
-
const
|
|
1210
|
+
const n = i.get(l[t].toLocaleLowerCase());
|
|
1211
|
+
void 0 !== n && (i.delete(l[t].toLocaleLowerCase()), u[n] = t);
|
|
1212
|
+
const b = new Int32Array(e.values.length).fill(-1), y = [], I = [], x = new Array(d);
|
|
1213
1213
|
for (let t = 0; t < d; t++) {
|
|
1214
1214
|
const n = e.ids[t];
|
|
1215
|
-
let s =
|
|
1216
|
-
s < 0 && (s =
|
|
1215
|
+
let s = b[n];
|
|
1216
|
+
s < 0 && (s = b[n] = y.length, y.push(Be(e.values[n])), I.push(e.dates || !!e.dateIds?.has(n))), x[t] = s;
|
|
1217
1217
|
}
|
|
1218
|
-
const C = (e) => void 0 !== n && (!!r[n].dates ||
|
|
1218
|
+
const C = (e) => void 0 !== n && (!!r[n].dates || A(r[n], e)), E = y.length, S = void 0 !== n ? !0 === r[n].inline : y.every((e) => "number" == typeof e || "object" == typeof e && "z" === e?.t), P = [];
|
|
1219
1219
|
if (void 0 !== n && S) {
|
|
1220
1220
|
const e = /* @__PURE__ */ new Map();
|
|
1221
|
-
for (let t = 0; t < E; t++) e.set(
|
|
1221
|
+
for (let t = 0; t < E; t++) e.set(je(y[t], I[t]), t);
|
|
1222
1222
|
o[n].forEach((t, s) => {
|
|
1223
|
-
c[n][s] = e.get(
|
|
1223
|
+
c[n][s] = e.get(je(t, C(s))) ?? -1;
|
|
1224
1224
|
});
|
|
1225
1225
|
} else if (void 0 !== n) {
|
|
1226
1226
|
const e = /* @__PURE__ */ new Map();
|
|
1227
|
-
for (let t = 0; t < E; t++) e.set(
|
|
1227
|
+
for (let t = 0; t < E; t++) e.set(je(y[t], I[t]), t);
|
|
1228
1228
|
const t = new Set(r[n].calculatedItems?.map((e) => e.item));
|
|
1229
1229
|
o[n].forEach((s, r) => {
|
|
1230
1230
|
if (t.has(r)) return;
|
|
1231
|
-
const o =
|
|
1232
|
-
let
|
|
1233
|
-
void 0 !==
|
|
1231
|
+
const o = je(s, C(r));
|
|
1232
|
+
let l = e.get(o);
|
|
1233
|
+
void 0 !== l || a || C(r) || (l = y.length, y.push(s), I.push(C(r)), P.push(l), e.set(o, l)), c[n][r] = l ?? -1;
|
|
1234
1234
|
});
|
|
1235
1235
|
}
|
|
1236
|
-
const k = { name:
|
|
1236
|
+
const k = { name: l[t] };
|
|
1237
1237
|
S && (k.inline = !0), void 0 !== e.numberFormat && (k.numberFormat = e.numberFormat);
|
|
1238
1238
|
const M = [];
|
|
1239
1239
|
let R = !1;
|
|
1240
|
-
|
|
1241
|
-
"number" == typeof e && (
|
|
1242
|
-
}), M.length > 0 && !R ? k.dates = !0 : M.length > 0 && (k.dateItems = M),
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
const s =
|
|
1248
|
-
return
|
|
1240
|
+
y.forEach((e, t) => {
|
|
1241
|
+
"number" == typeof e && (I[t] ? M.push(t) : R = !0);
|
|
1242
|
+
}), M.length > 0 && !R ? k.dates = !0 : M.length > 0 && (k.dateItems = M), g[t] = k.dateItems ? new Set(k.dateItems) : void 0, P.length > 0 && (k.unused = P);
|
|
1243
|
+
const N = void 0 !== n ? r[n].rest : void 0;
|
|
1244
|
+
N && (k.rest = N);
|
|
1245
|
+
const O = void 0 !== n ? r[n].calculatedItems : void 0;
|
|
1246
|
+
O?.length && (k.calculatedItems = O.map(({ item: e, formula: t }) => {
|
|
1247
|
+
const s = y.length;
|
|
1248
|
+
return y.push(o[n][e]), c[n][e] = s, {
|
|
1249
1249
|
item: s,
|
|
1250
1250
|
formula: t
|
|
1251
1251
|
};
|
|
1252
|
-
})),
|
|
1252
|
+
})), f.push(k), m.push([t, [[0, y]]]), p.push([t, [[0, x]]]), h.push(y), w.push(E), v.push(!1);
|
|
1253
1253
|
const $ = void 0 !== n ? r[n].group : void 0;
|
|
1254
1254
|
if ($?.range && $.base === n) {
|
|
1255
|
-
const e = re($,
|
|
1255
|
+
const e = re($, y.slice(0, E).map(T), s);
|
|
1256
1256
|
e ? (k.group = {
|
|
1257
1257
|
...e,
|
|
1258
1258
|
base: t
|
|
1259
|
-
},
|
|
1260
|
-
} else $ && !
|
|
1259
|
+
}, F(n, t, e)) : c[n] = o[n].map(() => -1);
|
|
1260
|
+
} else $ && !B(r[n]) && (k.group = $);
|
|
1261
1261
|
}), r.forEach((e, t) => {
|
|
1262
1262
|
if (!e.noRecords) return;
|
|
1263
|
-
if (
|
|
1263
|
+
if (L(e)) return u[t] = f.length, f.push(e), h.push([]), w.push(0), void v.push(!1);
|
|
1264
1264
|
const n = e.group;
|
|
1265
1265
|
if (!n) return;
|
|
1266
1266
|
const r = u[n.base];
|
|
1267
1267
|
if (void 0 === r || r < 0) return;
|
|
1268
|
-
const o =
|
|
1269
|
-
let a,
|
|
1270
|
-
if (n.range) a = re(n, o.slice(0,
|
|
1268
|
+
const o = h[r];
|
|
1269
|
+
let a, l = [];
|
|
1270
|
+
if (n.range) a = re(n, o.slice(0, w[r]).map(T), s);
|
|
1271
1271
|
else {
|
|
1272
|
-
const e = Ge(n, c[n.base], o,
|
|
1273
|
-
a = e.group,
|
|
1272
|
+
const e = Ge(n, c[n.base], o, f[r]);
|
|
1273
|
+
a = e.group, l = e.itemMap;
|
|
1274
1274
|
}
|
|
1275
1275
|
if (!a) return;
|
|
1276
|
-
const
|
|
1277
|
-
u[t] =
|
|
1276
|
+
const i = f.length;
|
|
1277
|
+
u[t] = i, f.push({
|
|
1278
1278
|
...e,
|
|
1279
1279
|
group: {
|
|
1280
1280
|
...a,
|
|
1281
1281
|
base: r
|
|
1282
1282
|
}
|
|
1283
|
-
}),
|
|
1284
|
-
}),
|
|
1283
|
+
}), h.push(a.items), g[i] = a.dateItems ? new Set(a.dateItems) : void 0, w.push(a.items.length), v.push(!1), n.range ? F(t, i, a) : c[t] = l;
|
|
1284
|
+
}), f.forEach((e, t) => {
|
|
1285
1285
|
const n = e.group;
|
|
1286
1286
|
if (void 0 === n?.parent) return;
|
|
1287
1287
|
const s = u[n.parent], { parent: r, ...o } = n;
|
|
1288
1288
|
void 0 !== s && s >= 0 ? e.group = {
|
|
1289
1289
|
...n,
|
|
1290
1290
|
parent: s
|
|
1291
|
-
} :
|
|
1291
|
+
} : B(e) ? e.group = o : delete e.group, e.group && !B(e) && (e.group = {
|
|
1292
1292
|
...e.group,
|
|
1293
1293
|
base: t
|
|
1294
1294
|
});
|
|
1295
1295
|
});
|
|
1296
|
-
const { cacheId:
|
|
1296
|
+
const { cacheId: b, part: y, partFormats: I, fields: x, items: C, records: E, ...S } = e;
|
|
1297
1297
|
return {
|
|
1298
1298
|
model: {
|
|
1299
|
-
...
|
|
1299
|
+
...S,
|
|
1300
1300
|
source: n ?? e.source,
|
|
1301
|
-
fields:
|
|
1302
|
-
items:
|
|
1303
|
-
records:
|
|
1301
|
+
fields: f,
|
|
1302
|
+
items: m,
|
|
1303
|
+
records: p,
|
|
1304
1304
|
recordCount: d
|
|
1305
1305
|
},
|
|
1306
1306
|
remap: {
|
|
1307
1307
|
fields: u,
|
|
1308
1308
|
items: c,
|
|
1309
|
-
newItems:
|
|
1310
|
-
usedCounts:
|
|
1311
|
-
inItemOrder:
|
|
1312
|
-
dateItems:
|
|
1309
|
+
newItems: h,
|
|
1310
|
+
usedCounts: w,
|
|
1311
|
+
inItemOrder: v,
|
|
1312
|
+
dateItems: g
|
|
1313
1313
|
}
|
|
1314
1314
|
};
|
|
1315
1315
|
}, Ge = (e, t, n, s) => {
|
|
@@ -1318,13 +1318,13 @@ var X = [
|
|
|
1318
1318
|
const s = t?.[n] ?? -1;
|
|
1319
1319
|
s < 0 || (o[s] = e, r.add(e));
|
|
1320
1320
|
});
|
|
1321
|
-
const a = [],
|
|
1321
|
+
const a = [], l = [], i = new Set(e.dateItems), d = e.items.map((e, t) => r.has(t) ? (i.has(t) && l.push(a.length), a.push(e), a.length - 1) : -1), u = o.map((e, t) => e >= 0 ? d[e] : ((s.dates || A(s, t)) && l.push(a.length), a.push(n[t]), a.length - 1)), { dateItems: c, ...f } = e;
|
|
1322
1322
|
return {
|
|
1323
1323
|
group: {
|
|
1324
1324
|
...f,
|
|
1325
1325
|
items: a,
|
|
1326
1326
|
discrete: u,
|
|
1327
|
-
...
|
|
1327
|
+
...l.length > 0 ? { dateItems: l } : {}
|
|
1328
1328
|
},
|
|
1329
1329
|
itemMap: d
|
|
1330
1330
|
};
|
|
@@ -1332,15 +1332,15 @@ var X = [
|
|
|
1332
1332
|
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);
|
|
1333
1333
|
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;
|
|
1334
1334
|
}, Ke = (e, t) => {
|
|
1335
|
-
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
|
+
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 ?? [], l = [], i = [];
|
|
1336
1336
|
a.forEach((e) => {
|
|
1337
|
-
if (!o(e.field)) return void
|
|
1338
|
-
|
|
1337
|
+
if (!o(e.field)) return void l.push(-1);
|
|
1338
|
+
l.push(i.length);
|
|
1339
1339
|
const t = {
|
|
1340
1340
|
...e,
|
|
1341
1341
|
field: r(e.field)
|
|
1342
1342
|
};
|
|
1343
|
-
void 0 !== e.baseField && (o(e.baseField) ? t.baseField = r(e.baseField) : delete t.baseField),
|
|
1343
|
+
void 0 !== e.baseField && (o(e.baseField) ? t.baseField = r(e.baseField) : delete t.baseField), i.push(t);
|
|
1344
1344
|
});
|
|
1345
1345
|
const d = n.map(() => null), u = [];
|
|
1346
1346
|
for (let e = 0; e < s; e++) u.push({});
|
|
@@ -1349,14 +1349,14 @@ var X = [
|
|
|
1349
1349
|
if (s < 0) return;
|
|
1350
1350
|
const o = { ...e };
|
|
1351
1351
|
if (void 0 !== e.sort?.dataField) {
|
|
1352
|
-
const t =
|
|
1352
|
+
const t = l[e.sort.dataField];
|
|
1353
1353
|
o.sort = t >= 0 ? {
|
|
1354
1354
|
...e.sort,
|
|
1355
1355
|
dataField: t
|
|
1356
1356
|
} : { order: e.sort.order };
|
|
1357
1357
|
}
|
|
1358
1358
|
if (e.items) {
|
|
1359
|
-
const { items: r, positions: a } =
|
|
1359
|
+
const { items: r, positions: a } = Je(e, t.items[n], t.newItems[s], t.usedCounts[s], t.inItemOrder[s], t.dateItems[s]);
|
|
1360
1360
|
o.items = r, d[n] = a;
|
|
1361
1361
|
}
|
|
1362
1362
|
u[s] = o;
|
|
@@ -1378,27 +1378,27 @@ var X = [
|
|
|
1378
1378
|
const c = (e) => {
|
|
1379
1379
|
if (!e) return;
|
|
1380
1380
|
let t = e.filter(o).map(r);
|
|
1381
|
-
return
|
|
1381
|
+
return i.length < 2 && (t = t.filter((e) => -2 !== e)), t.length > 0 ? t : void 0;
|
|
1382
1382
|
}, f = {
|
|
1383
1383
|
...e,
|
|
1384
1384
|
fields: u
|
|
1385
1385
|
};
|
|
1386
|
-
|
|
1387
|
-
const n =
|
|
1386
|
+
We(f, "rowFields", c(e.rowFields)), We(f, "columnFields", c(e.columnFields)), We(f, "dataFields", i.length > 0 ? i : void 0), a.forEach((e, t) => {
|
|
1387
|
+
const n = l[t];
|
|
1388
1388
|
if (n < 0 || void 0 === e.baseField || "number" != typeof e.baseItem) return;
|
|
1389
1389
|
const s = d[e.baseField]?.[e.baseItem];
|
|
1390
|
-
void 0 !== s && s >= 0 && (
|
|
1390
|
+
void 0 !== s && s >= 0 && (i[n].baseItem = s);
|
|
1391
1391
|
});
|
|
1392
1392
|
const m = (e.pageFields ?? []).flatMap((e) => {
|
|
1393
1393
|
if (!o(e.field)) return [];
|
|
1394
1394
|
const t = { field: r(e.field) };
|
|
1395
1395
|
if (void 0 !== e.item) {
|
|
1396
|
-
const n =
|
|
1396
|
+
const n = Xe(u[t.field].items ?? [], d[e.field]?.[e.item] ?? -1);
|
|
1397
1397
|
void 0 !== n && (t.item = n);
|
|
1398
1398
|
}
|
|
1399
1399
|
return [t];
|
|
1400
1400
|
});
|
|
1401
|
-
|
|
1401
|
+
We(f, "pageFields", m.length > 0 ? m : void 0);
|
|
1402
1402
|
const p = (e.filters ?? []).flatMap((e) => {
|
|
1403
1403
|
if (!o(e.field)) return [];
|
|
1404
1404
|
const t = {
|
|
@@ -1406,21 +1406,21 @@ var X = [
|
|
|
1406
1406
|
field: r(e.field)
|
|
1407
1407
|
};
|
|
1408
1408
|
if (void 0 !== e.dataField) {
|
|
1409
|
-
const n =
|
|
1409
|
+
const n = l[e.dataField];
|
|
1410
1410
|
if (void 0 === n || n < 0) return [];
|
|
1411
1411
|
t.dataField = n;
|
|
1412
1412
|
}
|
|
1413
1413
|
return [t];
|
|
1414
1414
|
});
|
|
1415
|
-
|
|
1416
|
-
const h = (e) =>
|
|
1415
|
+
We(f, "filters", p.length > 0 ? p : void 0);
|
|
1416
|
+
const h = (e) => Ye(e, r, o, d, l), g = (e.formats ?? []).flatMap((e) => {
|
|
1417
1417
|
const t = h(e.area);
|
|
1418
1418
|
return t ? [{
|
|
1419
1419
|
...e,
|
|
1420
1420
|
area: t
|
|
1421
1421
|
}] : [];
|
|
1422
1422
|
});
|
|
1423
|
-
|
|
1423
|
+
We(f, "formats", g.length > 0 ? g : void 0);
|
|
1424
1424
|
const w = (e.conditionalFormats ?? []).flatMap((e) => {
|
|
1425
1425
|
const t = e.areas.flatMap((e) => {
|
|
1426
1426
|
const t = h(e);
|
|
@@ -1431,19 +1431,19 @@ var X = [
|
|
|
1431
1431
|
areas: t
|
|
1432
1432
|
}] : [];
|
|
1433
1433
|
});
|
|
1434
|
-
return
|
|
1435
|
-
},
|
|
1434
|
+
return We(f, "conditionalFormats", w.length > 0 ? w : void 0), f;
|
|
1435
|
+
}, We = (e, t, n) => {
|
|
1436
1436
|
void 0 === n ? delete e[t] : e[t] = n;
|
|
1437
|
-
},
|
|
1438
|
-
const a = e.items ?? [],
|
|
1437
|
+
}, Je = (e, t, n, s, r = !1, o) => {
|
|
1438
|
+
const a = e.items ?? [], l = [], i = [], d = /* @__PURE__ */ new Set();
|
|
1439
1439
|
for (const e of a) {
|
|
1440
|
-
if (!
|
|
1441
|
-
|
|
1440
|
+
if (!m(e)) {
|
|
1441
|
+
i.push(l.length), l.push(e);
|
|
1442
1442
|
continue;
|
|
1443
1443
|
}
|
|
1444
1444
|
const n = t[e.item] ?? -1;
|
|
1445
1445
|
if (n < 0) {
|
|
1446
|
-
|
|
1446
|
+
i.push(-1);
|
|
1447
1447
|
continue;
|
|
1448
1448
|
}
|
|
1449
1449
|
d.add(n);
|
|
@@ -1451,15 +1451,15 @@ var X = [
|
|
|
1451
1451
|
...e,
|
|
1452
1452
|
item: n
|
|
1453
1453
|
};
|
|
1454
|
-
n >= s && !e.calculated ? r.missing = !0 : delete r.missing,
|
|
1454
|
+
n >= s && !e.calculated ? r.missing = !0 : delete r.missing, i.push(l.length), l.push(r);
|
|
1455
1455
|
}
|
|
1456
1456
|
const u = [];
|
|
1457
1457
|
for (let e = 0; e < n.length; e++) d.has(e) || u.push(e);
|
|
1458
1458
|
if (r) {
|
|
1459
|
-
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s =
|
|
1459
|
+
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s = l.map((e, t) => ({
|
|
1460
1460
|
item: e,
|
|
1461
1461
|
at: t
|
|
1462
|
-
})), r = s.filter((e) => !
|
|
1462
|
+
})), r = s.filter((e) => !m(e.item)), o = [...[...s.filter((e) => m(e.item)), ...u.map((e) => ({
|
|
1463
1463
|
item: n ? {
|
|
1464
1464
|
item: e,
|
|
1465
1465
|
hidden: !0
|
|
@@ -1468,43 +1468,43 @@ var X = [
|
|
|
1468
1468
|
}))].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]));
|
|
1469
1469
|
return {
|
|
1470
1470
|
items: o.map((e) => e.item),
|
|
1471
|
-
positions:
|
|
1471
|
+
positions: i.map((e) => e < 0 ? e : d.get(e) ?? -1)
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
1474
|
if (0 === u.length) return {
|
|
1475
|
-
items:
|
|
1476
|
-
positions:
|
|
1475
|
+
items: l,
|
|
1476
|
+
positions: i
|
|
1477
1477
|
};
|
|
1478
|
-
const
|
|
1478
|
+
const f = !e.includeNewItemsInFilter && a.some((e) => e.hidden), p = (e) => f ? {
|
|
1479
1479
|
item: e,
|
|
1480
1480
|
hidden: !0
|
|
1481
1481
|
} : { item: e };
|
|
1482
1482
|
if (e.sort && void 0 === e.sort.dataField) {
|
|
1483
|
-
const t = "descending" === e.sort.order, s = (e, t) => qe(
|
|
1483
|
+
const t = "descending" === e.sort.order, s = (e, t) => qe(c(e, n), T(n[t]), void 0 === e.name && o?.has(e.item), o?.has(t));
|
|
1484
1484
|
for (const e of u) {
|
|
1485
|
-
const n =
|
|
1486
|
-
let r =
|
|
1487
|
-
r < 0 && (r =
|
|
1488
|
-
for (let e = 0; e <
|
|
1485
|
+
const n = p(e);
|
|
1486
|
+
let r = l.findIndex((n) => m(n) && (t ? s(n, e) < 0 : s(n, e) > 0));
|
|
1487
|
+
r < 0 && (r = Qe(l)), l.splice(r, 0, n);
|
|
1488
|
+
for (let e = 0; e < i.length; e++) i[e] >= r && i[e]++;
|
|
1489
1489
|
}
|
|
1490
1490
|
} else {
|
|
1491
|
-
const e =
|
|
1492
|
-
|
|
1493
|
-
for (let t = 0; t <
|
|
1491
|
+
const e = Qe(l);
|
|
1492
|
+
l.splice(e, 0, ...u.map(p));
|
|
1493
|
+
for (let t = 0; t < i.length; t++) i[t] >= e && (i[t] += u.length);
|
|
1494
1494
|
}
|
|
1495
1495
|
return {
|
|
1496
|
-
items:
|
|
1497
|
-
positions:
|
|
1496
|
+
items: l,
|
|
1497
|
+
positions: i
|
|
1498
1498
|
};
|
|
1499
|
-
},
|
|
1500
|
-
const t = e.findIndex((e) => !
|
|
1499
|
+
}, Qe = (e) => {
|
|
1500
|
+
const t = e.findIndex((e) => !m(e));
|
|
1501
1501
|
return t < 0 ? e.length : t;
|
|
1502
|
-
},
|
|
1502
|
+
}, Xe = (e, t) => {
|
|
1503
1503
|
if (!(t < 0)) for (let n = 0; n < e.length; n++) {
|
|
1504
1504
|
const s = (t + n) % e.length, r = e[s];
|
|
1505
|
-
if (
|
|
1505
|
+
if (m(r) && !r.missing) return s;
|
|
1506
1506
|
}
|
|
1507
|
-
},
|
|
1507
|
+
}, Ye = (e, t, n, s, r) => {
|
|
1508
1508
|
const o = { ...e };
|
|
1509
1509
|
if (void 0 !== e.field) {
|
|
1510
1510
|
if (!n(e.field)) return null;
|
|
@@ -1545,7 +1545,7 @@ var X = [
|
|
|
1545
1545
|
};
|
|
1546
1546
|
const a = e.sort?.scope;
|
|
1547
1547
|
if (!a?.items.some((e) => e.field === t)) return e;
|
|
1548
|
-
const
|
|
1548
|
+
const l = a.items.map((e) => e.field === t ? {
|
|
1549
1549
|
...e,
|
|
1550
1550
|
item: o[e.item] ?? e.item
|
|
1551
1551
|
} : e);
|
|
@@ -1555,7 +1555,7 @@ var X = [
|
|
|
1555
1555
|
...e.sort,
|
|
1556
1556
|
scope: {
|
|
1557
1557
|
...a,
|
|
1558
|
-
items:
|
|
1558
|
+
items: l
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
};
|
|
@@ -1568,7 +1568,7 @@ var X = [
|
|
|
1568
1568
|
...e,
|
|
1569
1569
|
baseItem: o[e.baseItem] ?? e.baseItem
|
|
1570
1570
|
} : e));
|
|
1571
|
-
const
|
|
1571
|
+
const l = s.map((e, n) => n === t ? o : null), i = (e.dataFields ?? []).map((e, t) => t), d = (e) => Ye(e, (e) => e, () => !0, l, i) ?? e;
|
|
1572
1572
|
return e.formats && (a.formats = e.formats.map((e) => ({
|
|
1573
1573
|
...e,
|
|
1574
1574
|
area: d(e.area)
|
|
@@ -1577,43 +1577,43 @@ var X = [
|
|
|
1577
1577
|
areas: e.areas.map(d)
|
|
1578
1578
|
}))), a;
|
|
1579
1579
|
}, et = (e, t, n, s) => {
|
|
1580
|
-
const r = (e.fields ?? [])[n]?.items ?? [], o =
|
|
1580
|
+
const r = (e.fields ?? [])[n]?.items ?? [], o = N(t)[n] ?? [], a = t.fields?.[n], l = void 0 !== a?.group?.range, i = (e) => void 0 === e.name && A(a, e.item), d = r.map((e, t) => ({
|
|
1581
1581
|
item: e,
|
|
1582
1582
|
at: t
|
|
1583
|
-
})), u = d.filter((e) =>
|
|
1584
|
-
u.sort((e, t) =>
|
|
1585
|
-
let
|
|
1586
|
-
const
|
|
1583
|
+
})), u = d.filter((e) => m(e.item));
|
|
1584
|
+
u.sort((e, t) => l ? e.item.item - t.item.item : qe(c(e.item, o), c(t.item, o), i(e.item), i(t.item))), "descending" === s && u.reverse();
|
|
1585
|
+
let f = 0;
|
|
1586
|
+
const p = Ze(e, n, d.map((e) => m(e.item) ? u[f++] : e).map((e) => e.at));
|
|
1587
1587
|
return {
|
|
1588
|
-
...
|
|
1589
|
-
fields:
|
|
1588
|
+
...p,
|
|
1589
|
+
fields: p.fields.map((e, t) => t === n ? {
|
|
1590
1590
|
...e,
|
|
1591
1591
|
sort: { order: s }
|
|
1592
1592
|
} : e)
|
|
1593
1593
|
};
|
|
1594
1594
|
}, tt = (n, s, r) => {
|
|
1595
1595
|
const o = n.fields?.[s]?.items?.[r];
|
|
1596
|
-
if (!o || !
|
|
1596
|
+
if (!o || !m(o)) throw new t(e("error.pivotTable.changePart"));
|
|
1597
1597
|
return o;
|
|
1598
1598
|
}, nt = (n, s, r, o, a) => {
|
|
1599
|
-
const
|
|
1600
|
-
const t =
|
|
1601
|
-
return null === t ?
|
|
1599
|
+
const l = tt(n, r, o), i = n.fields[r].items, d = N(s)[r] ?? [], u = (e) => {
|
|
1600
|
+
const t = T(d[e.item]);
|
|
1601
|
+
return null === t ? S : G(t);
|
|
1602
1602
|
};
|
|
1603
|
-
if (
|
|
1604
|
-
const { name:
|
|
1605
|
-
...
|
|
1603
|
+
if (i.some((e, t) => t !== o && m(e) && h(e.name ?? u(e), a))) throw new t(e("error.pivotTable.itemNameExists", { name: a }));
|
|
1604
|
+
const { name: c, ...f } = l, p = a === u(l) ? f : {
|
|
1605
|
+
...l,
|
|
1606
1606
|
name: a
|
|
1607
1607
|
};
|
|
1608
|
-
if (p.name ===
|
|
1609
|
-
const
|
|
1608
|
+
if (p.name === l.name) return n;
|
|
1609
|
+
const g = {
|
|
1610
1610
|
...n,
|
|
1611
1611
|
fields: n.fields.map((e, t) => t === r ? {
|
|
1612
1612
|
...e,
|
|
1613
|
-
items:
|
|
1613
|
+
items: i.map((e, t) => t === o ? p : e)
|
|
1614
1614
|
} : e)
|
|
1615
|
-
},
|
|
1616
|
-
return
|
|
1615
|
+
}, w = n.fields[r].sort;
|
|
1616
|
+
return w && void 0 === w.dataField ? et(g, s, r, w.order) : g;
|
|
1617
1617
|
}, st = (e, t, n, s) => {
|
|
1618
1618
|
tt(e, t, n);
|
|
1619
1619
|
const r = e.fields[t].items.map((e, t) => t).filter((e) => e !== n);
|
|
@@ -1630,36 +1630,36 @@ var X = [
|
|
|
1630
1630
|
})
|
|
1631
1631
|
} : a;
|
|
1632
1632
|
}, rt = (n, s, r, o) => {
|
|
1633
|
-
const a =
|
|
1633
|
+
const a = G(o), l = n.fields, i = s.fields, d = n.dataFields ?? [], u = N(s), c = (e, t) => {
|
|
1634
1634
|
if (void 0 !== t.name) return t.name;
|
|
1635
|
-
const n =
|
|
1636
|
-
return null === n ?
|
|
1637
|
-
},
|
|
1638
|
-
if (void 0 !== r.field && a === (
|
|
1635
|
+
const n = T(u[e][t.item]);
|
|
1636
|
+
return null === n ? S : G(n);
|
|
1637
|
+
}, f = (r) => {
|
|
1638
|
+
if (void 0 !== r.field && a === (l[r.field].name ?? i[r.field].name)) return;
|
|
1639
1639
|
const o = void 0 === r.field ? n : {
|
|
1640
1640
|
...n,
|
|
1641
|
-
fields:
|
|
1641
|
+
fields: l.map((e, t) => t === r.field ? {
|
|
1642
1642
|
...e,
|
|
1643
1643
|
name: "\0"
|
|
1644
1644
|
} : e)
|
|
1645
1645
|
};
|
|
1646
|
-
if (
|
|
1646
|
+
if (H(o, s, a, r.data) !== a) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1647
1647
|
};
|
|
1648
1648
|
switch (r.kind) {
|
|
1649
1649
|
case "item": {
|
|
1650
1650
|
const { field: e, rank: t } = r;
|
|
1651
1651
|
tt(n, e, t);
|
|
1652
|
-
const o =
|
|
1652
|
+
const o = l[e].items.findIndex((n, s) => s !== t && m(n) && h(c(e, n), a));
|
|
1653
1653
|
return o >= 0 ? st(n, e, o, t) : nt(n, s, e, t, a);
|
|
1654
1654
|
}
|
|
1655
1655
|
case "fieldCaption": {
|
|
1656
1656
|
const { field: e } = r;
|
|
1657
|
-
return
|
|
1657
|
+
return f({ field: e }), ((e, t) => ({
|
|
1658
1658
|
...n,
|
|
1659
|
-
fields:
|
|
1659
|
+
fields: l.map((n, s) => s === e ? t(n) : n)
|
|
1660
1660
|
}))(e, (t) => {
|
|
1661
1661
|
const { name: n, ...s } = t;
|
|
1662
|
-
return a ===
|
|
1662
|
+
return a === i[e].name ? s : {
|
|
1663
1663
|
...t,
|
|
1664
1664
|
name: a
|
|
1665
1665
|
};
|
|
@@ -1667,9 +1667,9 @@ var X = [
|
|
|
1667
1667
|
}
|
|
1668
1668
|
case "dataCaption": {
|
|
1669
1669
|
const { data: e } = r;
|
|
1670
|
-
return
|
|
1670
|
+
return f({ data: e }), {
|
|
1671
1671
|
...n,
|
|
1672
|
-
dataFields:
|
|
1672
|
+
dataFields: d.map((t, n) => n === e ? {
|
|
1673
1673
|
...t,
|
|
1674
1674
|
name: a
|
|
1675
1675
|
} : t)
|
|
@@ -1689,19 +1689,19 @@ var X = [
|
|
|
1689
1689
|
};
|
|
1690
1690
|
case "pageItem": {
|
|
1691
1691
|
const s = n.pageFields, o = s[r.page];
|
|
1692
|
-
let
|
|
1693
|
-
if (!
|
|
1694
|
-
const { item: d, ...u } = o,
|
|
1692
|
+
let i;
|
|
1693
|
+
if (!h(a, "(All)") && (i = (l[o.field].items ?? []).findIndex((e) => m(e) && h(c(o.field, e), a)), i < 0)) throw new t(e("error.pivotTable.notAnItem", { name: a }));
|
|
1694
|
+
const { item: d, ...u } = o, f = void 0 === i ? u : {
|
|
1695
1695
|
...o,
|
|
1696
|
-
item:
|
|
1696
|
+
item: i
|
|
1697
1697
|
};
|
|
1698
1698
|
return {
|
|
1699
1699
|
...n,
|
|
1700
|
-
pageFields: s.map((e, t) => t === r.page ?
|
|
1700
|
+
pageFields: s.map((e, t) => t === r.page ? f : e)
|
|
1701
1701
|
};
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
|
-
}, ot = (e, t, n) =>
|
|
1704
|
+
}, ot = (e, t, n) => ze({
|
|
1705
1705
|
cacheId: 0,
|
|
1706
1706
|
fields: []
|
|
1707
1707
|
}, e, t, n).model, at = (e, t) => t.some((t) => e.fields?.[t]?.inline) ? {
|
|
@@ -1711,13 +1711,13 @@ var X = [
|
|
|
1711
1711
|
const { inline: s, ...r } = e;
|
|
1712
1712
|
return r;
|
|
1713
1713
|
})
|
|
1714
|
-
} : e,
|
|
1714
|
+
} : e, lt = (e) => [
|
|
1715
1715
|
...e.rowFields ?? [],
|
|
1716
1716
|
...e.columnFields ?? [],
|
|
1717
1717
|
...(e.pageFields ?? []).map((e) => e.field)
|
|
1718
|
-
].filter((e) => e >= 0),
|
|
1719
|
-
const n = e.fields[t], s =
|
|
1720
|
-
|
|
1718
|
+
].filter((e) => e >= 0), it = (e, t) => {
|
|
1719
|
+
const n = e.fields[t], s = N(e)[t], r = s.map((e, t) => t);
|
|
1720
|
+
B(n) || r.sort((e, t) => qe(T(s[e]), T(s[t]), A(n, e), A(n, t)));
|
|
1721
1721
|
const o = new Set(n.calculatedItems?.map((e) => e.item)), a = new Set(n.unused);
|
|
1722
1722
|
return [...r.map((e) => ({
|
|
1723
1723
|
item: e,
|
|
@@ -1727,39 +1727,39 @@ var X = [
|
|
|
1727
1727
|
}, dt = (s) => {
|
|
1728
1728
|
if (!("number" == typeof s ? void 0 !== o(s) : "" !== s && n.isValidFormat(s))) throw new t(e("error.pivotTable.notANumberFormat", { name: String(s) }));
|
|
1729
1729
|
}, ut = (n, s, r, o) => {
|
|
1730
|
-
const a = o?.function ?? ((e, t) => "number" ===
|
|
1730
|
+
const a = o?.function ?? ((e, t) => "number" === d(e, t) ? "sum" : "count")(s.fields[r], N(s)[r]), i = E[a];
|
|
1731
1731
|
if (!i) throw new t(e("error.pivotTable.notAFunction", { name: a }));
|
|
1732
|
-
let
|
|
1733
|
-
if (void 0 ===
|
|
1734
|
-
else if (
|
|
1735
|
-
const
|
|
1736
|
-
name:
|
|
1732
|
+
let u = o?.name;
|
|
1733
|
+
if (void 0 === u) u = H(n, s, `${i} of ${l(n, s, r)}`);
|
|
1734
|
+
else if (H(n, s, u) !== u) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1735
|
+
const c = {
|
|
1736
|
+
name: u,
|
|
1737
1737
|
field: r,
|
|
1738
1738
|
baseField: 0,
|
|
1739
1739
|
baseItem: 0
|
|
1740
1740
|
};
|
|
1741
|
-
return "sum" !== a && (
|
|
1741
|
+
return "sum" !== a && (c.subtotal = a), void 0 !== o?.numberFormat && (dt(o.numberFormat), c.numberFormat = o.numberFormat), c;
|
|
1742
1742
|
}, ct = (n, s) => {
|
|
1743
1743
|
const r = n.fields ?? [], o = (n) => {
|
|
1744
|
-
const s = r.findIndex((e) =>
|
|
1744
|
+
const s = r.findIndex((e) => h(e.name, n));
|
|
1745
1745
|
if (s < 0) throw new t(e("error.pivotTable.notAField", { name: n }));
|
|
1746
1746
|
return s;
|
|
1747
|
-
}, a = /* @__PURE__ */ new Map(),
|
|
1747
|
+
}, a = /* @__PURE__ */ new Map(), l = (e, t) => {
|
|
1748
1748
|
for (const n of e ?? []) {
|
|
1749
1749
|
const e = o(n);
|
|
1750
1750
|
a.delete(e), a.set(e, t);
|
|
1751
1751
|
}
|
|
1752
1752
|
};
|
|
1753
|
-
|
|
1754
|
-
const
|
|
1753
|
+
l(s?.rows, "row"), l(s?.columns, "column"), l(s?.pages, "page");
|
|
1754
|
+
const i = (e) => [...a].filter(([, t]) => t === e).map(([e]) => e), d = [];
|
|
1755
1755
|
for (const e of s?.values ?? []) {
|
|
1756
1756
|
const { field: t, ...s } = "string" == typeof e ? { field: e } : e;
|
|
1757
1757
|
d.push(ut({ dataFields: d }, n, o(t), s));
|
|
1758
1758
|
}
|
|
1759
1759
|
const u = new Set(d.map((e) => e.field)), c = s?.form && "compact" !== s.form ? s.form : void 0, f = r.map((e, t) => {
|
|
1760
1760
|
const s = {}, r = a.get(t);
|
|
1761
|
-
return r && (s.axis = r, s.items =
|
|
1762
|
-
}), m =
|
|
1761
|
+
return r && (s.axis = r, s.items = it(n, t)), u.has(t) && (s.dataField = !0), c && (s.form = c), e.dates && void 0 !== e.numberFormat && (s.numberFormat = e.numberFormat), s;
|
|
1762
|
+
}), m = i("column");
|
|
1763
1763
|
d.length > 1 && m.push(-2);
|
|
1764
1764
|
const p = {
|
|
1765
1765
|
fields: f,
|
|
@@ -1771,14 +1771,14 @@ var X = [
|
|
|
1771
1771
|
showColumnStripes: !1,
|
|
1772
1772
|
showLastColumn: !0
|
|
1773
1773
|
}
|
|
1774
|
-
},
|
|
1775
|
-
|
|
1776
|
-
const
|
|
1777
|
-
return
|
|
1774
|
+
}, g = i("row");
|
|
1775
|
+
g.length > 0 && (p.rowFields = g), m.length > 0 && (p.columnFields = m);
|
|
1776
|
+
const w = i("page");
|
|
1777
|
+
return w.length > 0 && (p.pageFields = w.map((e) => ({ field: e }))), d.length > 0 && (p.dataFields = d), c && (p.form = c), p;
|
|
1778
1778
|
}, ft = (e, t) => t.map((t) => {
|
|
1779
1779
|
const n = t.sort?.scope;
|
|
1780
1780
|
if (!n) return t;
|
|
1781
|
-
const s = ((t.axis ===
|
|
1781
|
+
const s = ((t.axis === $.Axis.Row ? e.columnFields : t.axis === $.Axis.Column ? e.rowFields : void 0) ?? []).filter((e) => -2 !== e);
|
|
1782
1782
|
if (!n.items.every((e, t) => s[t] === e.field)) {
|
|
1783
1783
|
const { sort: e, ...n } = t;
|
|
1784
1784
|
return n;
|
|
@@ -1795,37 +1795,37 @@ var X = [
|
|
|
1795
1795
|
}
|
|
1796
1796
|
};
|
|
1797
1797
|
}), mt = (n, s, r, o, a) => {
|
|
1798
|
-
const
|
|
1799
|
-
if (o ===
|
|
1798
|
+
const l = $.Axis, i = s.fields?.[r], d = n.fields?.[r]?.axis ?? null;
|
|
1799
|
+
if (o === l.Values) throw new t(e("error.pivotTable.valuesNotAnAxis"));
|
|
1800
1800
|
if (null === o) {
|
|
1801
|
-
if (null ===
|
|
1802
|
-
} else if (void 0 !==
|
|
1803
|
-
const c = o ?
|
|
1801
|
+
if (null === d) return n;
|
|
1802
|
+
} else if (void 0 !== i?.formula || o === l.Page && (i?.calculatedItems?.length ?? 0) > 0) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
1803
|
+
const c = o ? F(n, o).filter((e) => e !== r) : [];
|
|
1804
1804
|
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a > c.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
1805
1805
|
const f = (a ?? c.length + 1) - 1;
|
|
1806
|
-
if (o ===
|
|
1806
|
+
if (o === d && (void 0 === a || F(n, o)[f] === r)) return n;
|
|
1807
1807
|
c.splice(f, 0, r);
|
|
1808
|
-
const { rowFields: m, columnFields: p, pageFields: h, ...g } = n, w = {}, v = (e) => (e ?? []).filter((e) => e !== r),
|
|
1809
|
-
|
|
1810
|
-
let
|
|
1808
|
+
const { rowFields: m, columnFields: p, pageFields: h, ...g } = n, w = {}, v = (e) => (e ?? []).filter((e) => e !== r), b = o === l.Row ? c : v(n.rowFields), y = o === l.Column ? c : v(n.columnFields), x = o === l.Page ? c.map((e) => n.pageFields?.find((t) => t.field === e) ?? { field: e }) : (n.pageFields ?? []).filter((e) => e.field !== r);
|
|
1809
|
+
b.length > 0 && (w.rowFields = b), y.length > 0 && (w.columnFields = y), x.length > 0 && (w.pageFields = x);
|
|
1810
|
+
let A = {
|
|
1811
1811
|
...g,
|
|
1812
1812
|
...w
|
|
1813
1813
|
};
|
|
1814
|
-
o ===
|
|
1815
|
-
const
|
|
1816
|
-
o ?
|
|
1817
|
-
const
|
|
1818
|
-
if (
|
|
1819
|
-
...
|
|
1820
|
-
fields: ft(
|
|
1814
|
+
o === l.Page && d !== l.Page && (A = u(A, r, () => !0));
|
|
1815
|
+
const C = { ...n.fields?.[r] };
|
|
1816
|
+
o ? C.axis = o : delete C.axis, o && !C.items && i && (C.items = I(it(s, r), C.subtotals)), o && void 0 === C.numberFormat && i?.dates && void 0 !== i.numberFormat && (C.numberFormat = i.numberFormat), o === l.Page && C.items?.some((e) => e.hidden) && (C.multipleItemSelection = !0);
|
|
1817
|
+
const E = (n.fields ?? []).map((e, t) => t === r ? C : e);
|
|
1818
|
+
if (A = {
|
|
1819
|
+
...A,
|
|
1820
|
+
fields: ft(A, E)
|
|
1821
1821
|
}, null === o && n.formats?.some((e) => e.area.references?.some((e) => e.field === r))) {
|
|
1822
|
-
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } =
|
|
1823
|
-
|
|
1822
|
+
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } = A;
|
|
1823
|
+
A = e.length > 0 ? {
|
|
1824
1824
|
...s,
|
|
1825
1825
|
formats: e
|
|
1826
1826
|
} : s;
|
|
1827
1827
|
}
|
|
1828
|
-
return
|
|
1828
|
+
return A;
|
|
1829
1829
|
}, pt = -2, ht = /* @__PURE__ */ new Set([
|
|
1830
1830
|
"percentOfTotal",
|
|
1831
1831
|
"percentOfRow",
|
|
@@ -1888,7 +1888,7 @@ var X = [
|
|
|
1888
1888
|
} : n;
|
|
1889
1889
|
}
|
|
1890
1890
|
return r;
|
|
1891
|
-
}), { dataFields: o, filters: a, formats:
|
|
1891
|
+
}), { dataFields: o, filters: a, formats: l, conditionalFormats: i, ...d } = e, u = {
|
|
1892
1892
|
...d,
|
|
1893
1893
|
fields: r
|
|
1894
1894
|
};
|
|
@@ -1902,7 +1902,7 @@ var X = [
|
|
|
1902
1902
|
}];
|
|
1903
1903
|
});
|
|
1904
1904
|
c.length > 0 && (u.filters = c);
|
|
1905
|
-
const f = (e) =>
|
|
1905
|
+
const f = (e) => Ye(e, (e) => e, () => !0, [], n), m = (e.formats ?? []).flatMap((e) => {
|
|
1906
1906
|
const t = f(e.area);
|
|
1907
1907
|
return t ? [{
|
|
1908
1908
|
...e,
|
|
@@ -1920,11 +1920,11 @@ var X = [
|
|
|
1920
1920
|
return p.length > 0 && (u.conditionalFormats = p), ((e) => {
|
|
1921
1921
|
const t = e.dataFields?.length ?? 0, n = e.rowFields?.includes(pt), s = e.columnFields?.includes(pt), { valuesPosition: r, ...o } = e;
|
|
1922
1922
|
if (t < 2 && (n || s)) {
|
|
1923
|
-
const t = n ? "rowFields" : "columnFields", s = e[t], r = s.indexOf(pt), a = s.filter((e) => e !== pt),
|
|
1923
|
+
const t = n ? "rowFields" : "columnFields", s = e[t], r = s.indexOf(pt), a = s.filter((e) => e !== pt), l = {
|
|
1924
1924
|
...o,
|
|
1925
1925
|
...r < a.length ? { valuesPosition: r } : {}
|
|
1926
1926
|
};
|
|
1927
|
-
return a.length > 0 ?
|
|
1927
|
+
return a.length > 0 ? l[t] = a : delete l[t], l;
|
|
1928
1928
|
}
|
|
1929
1929
|
if (t >= 2 && !n && !s) {
|
|
1930
1930
|
const t = e.valuesOnRows ? "rowFields" : "columnFields", n = [...e[t] ?? []];
|
|
@@ -1949,12 +1949,12 @@ var X = [
|
|
|
1949
1949
|
if (r - 1 === s) return n;
|
|
1950
1950
|
const a = o.map((e, t) => t).filter((e) => e !== s);
|
|
1951
1951
|
a.splice(r - 1, 0, s);
|
|
1952
|
-
const
|
|
1952
|
+
const l = [];
|
|
1953
1953
|
return a.forEach((e, t) => {
|
|
1954
|
-
|
|
1955
|
-
}), It(n, a.map((e) => o[e]),
|
|
1954
|
+
l[e] = t;
|
|
1955
|
+
}), It(n, a.map((e) => o[e]), l);
|
|
1956
1956
|
}, Et = (e, t, n, s) => {
|
|
1957
|
-
const r =
|
|
1957
|
+
const r = x(e, t, n, s);
|
|
1958
1958
|
return (e.dataFields[n].subtotal ?? "sum") === s ? e : bt(e, n, (e) => {
|
|
1959
1959
|
const { subtotal: t, ...n } = e, o = {
|
|
1960
1960
|
...n,
|
|
@@ -1963,40 +1963,40 @@ var X = [
|
|
|
1963
1963
|
return "sum" !== s && (o.subtotal = s), o;
|
|
1964
1964
|
});
|
|
1965
1965
|
}, St = (n, s, r, o) => {
|
|
1966
|
-
const a = n.dataFields[r], i = a.showDataAs ?? "normal",
|
|
1966
|
+
const a = n.dataFields[r], i = a.showDataAs ?? "normal", d = o?.kind ?? "normal";
|
|
1967
1967
|
if (o && !wt.has(o.kind)) throw new t(e("error.pivotTable.notAShowAs", { name: o.kind }));
|
|
1968
|
-
const { showDataAs:
|
|
1969
|
-
"normal" !==
|
|
1970
|
-
let
|
|
1968
|
+
const { showDataAs: u, baseField: c, baseItem: f, ...m } = a, g = { ...m };
|
|
1969
|
+
"normal" !== d && (g.showDataAs = d);
|
|
1970
|
+
let w = a.baseField, v = a.baseItem;
|
|
1971
1971
|
if (void 0 !== o?.baseField) {
|
|
1972
|
-
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) =>
|
|
1972
|
+
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) => h(l(n, s, t), r));
|
|
1973
1973
|
if (a < 0) throw new t(e("error.pivotTable.notAField", { name: r }));
|
|
1974
|
-
a !==
|
|
1974
|
+
a !== w && (w = a, v = 0);
|
|
1975
1975
|
}
|
|
1976
1976
|
if (void 0 !== o?.baseItem) {
|
|
1977
|
-
const r =
|
|
1978
|
-
if (
|
|
1979
|
-
else if (
|
|
1977
|
+
const r = w ?? 0;
|
|
1978
|
+
if (h(o.baseItem, "(previous)")) v = "previous";
|
|
1979
|
+
else if (h(o.baseItem, "(next)")) v = "next";
|
|
1980
1980
|
else {
|
|
1981
1981
|
const a = n.fields?.[r]?.items ? n : { fields: (n.fields ?? []).map((e, t) => t === r ? {
|
|
1982
1982
|
...e,
|
|
1983
|
-
items:
|
|
1984
|
-
} : e) },
|
|
1985
|
-
if (
|
|
1986
|
-
|
|
1983
|
+
items: it(s, r)
|
|
1984
|
+
} : e) }, l = q(a, s, r).findIndex((e) => null !== e && h(e, o.baseItem));
|
|
1985
|
+
if (l < 0) throw new t(e("error.pivotTable.notAnItem", { name: o.baseItem }));
|
|
1986
|
+
v = l;
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
if (void 0 !==
|
|
1990
|
-
const
|
|
1989
|
+
if (void 0 !== w && (g.baseField = w), void 0 !== v && (g.baseItem = v), d === i) return g.baseField === a.baseField && g.baseItem === a.baseItem ? n : bt(n, r, () => g);
|
|
1990
|
+
const F = ((e, t, n) => {
|
|
1991
1991
|
if (gt.has(n)) return gt.has(t) ? e : void 0;
|
|
1992
|
-
const s = ((e) =>
|
|
1992
|
+
const s = ((e) => p(e).replace(/"[^"]*"|\\./g, "").includes("%"))(e);
|
|
1993
1993
|
return ht.has(n) ? ht.has(t) || s ? e : 10 : ht.has(t) && s ? void 0 : e;
|
|
1994
|
-
})(a.numberFormat, i,
|
|
1995
|
-
return
|
|
1994
|
+
})(a.numberFormat, i, d);
|
|
1995
|
+
return F === a.numberFormat ? bt(n, r, () => g) : bt(Ft(n, r), r, () => yt(g, F));
|
|
1996
1996
|
}, Pt = (e, t, n) => {
|
|
1997
1997
|
dt(n);
|
|
1998
|
-
const s =
|
|
1999
|
-
if (
|
|
1998
|
+
const s = p(n), r = e.dataFields[t], o = e.formats?.[e.formats.length - 1];
|
|
1999
|
+
if (p(r.numberFormat) === s && o && vt(o.area, t) && o.style.numberFormat === s) return e;
|
|
2000
2000
|
const a = bt(Ft(e, t), t, (e) => yt(e, "General" === s ? void 0 : n));
|
|
2001
2001
|
return {
|
|
2002
2002
|
...a,
|
|
@@ -2013,27 +2013,27 @@ var X = [
|
|
|
2013
2013
|
};
|
|
2014
2014
|
}, kt = (n, s, r) => {
|
|
2015
2015
|
if (null === s) return At(n);
|
|
2016
|
-
const o =
|
|
2016
|
+
const o = $.Axis;
|
|
2017
2017
|
if (s !== o.Row && s !== o.Column) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
2018
2018
|
const a = n.rowFields?.includes(pt) ? o.Row : n.columnFields?.includes(pt) ? o.Column : null;
|
|
2019
2019
|
if (!a) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2020
|
-
const
|
|
2021
|
-
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r >
|
|
2022
|
-
const
|
|
2023
|
-
if (s === a && (void 0 === r ||
|
|
2024
|
-
|
|
2025
|
-
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m =
|
|
2020
|
+
const l = F(n, s).filter((e) => e !== pt);
|
|
2021
|
+
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r > l.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2022
|
+
const i = (r ?? l.length + 1) - 1;
|
|
2023
|
+
if (s === a && (void 0 === r || F(n, s)[i] === pt)) return n;
|
|
2024
|
+
l.splice(i, 0, pt);
|
|
2025
|
+
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m = F(n, s === o.Row ? o.Column : o.Row).filter((e) => e !== pt), p = { ...f }, h = s === o.Row ? l : m, g = s === o.Column ? l : m;
|
|
2026
2026
|
return h.length > 0 && (p.rowFields = [...h]), g.length > 0 && (p.columnFields = [...g]), s === o.Row && (p.valuesOnRows = !0), p;
|
|
2027
2027
|
}, Mt = (n, s, r) => {
|
|
2028
2028
|
if (r === (n.valuesCaption ?? "Values")) return n;
|
|
2029
|
-
const { valuesCaption: o, ...a } = n,
|
|
2029
|
+
const { valuesCaption: o, ...a } = n, l = {
|
|
2030
2030
|
...a,
|
|
2031
2031
|
valuesCaption: "\0"
|
|
2032
2032
|
};
|
|
2033
|
-
if (
|
|
2033
|
+
if (H(l, s, r) !== r) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
2034
2034
|
return "Values" === r ? a : {
|
|
2035
2035
|
...a,
|
|
2036
2036
|
valuesCaption: r
|
|
2037
2037
|
};
|
|
2038
2038
|
};
|
|
2039
|
-
export { xt as addPivotDataField,
|
|
2039
|
+
export { xt as addPivotDataField, Oe as anchorPivotPeriods, dt as assertNumberFormat, lt as axisFieldsOf, Re as buildPivotView, Ne as evaluatePivotFilters, V as isItemFilter, Ie as layOutPivot, it as listedItemsOf, Ct as movePivotDataField, mt as movePivotField, st as movePivotItem, kt as movePivotValues, ot as newPivotCache, ct as newPivotTable, _e as readPivotSource, ze as refreshPivotCache, Ke as remapPivotTable, At as removePivotDataField, nt as renamePivotItem, Mt as renamePivotValues, Ze as reorderPivotItems, Et as setPivotDataFunction, Pt as setPivotDataNumberFormat, St as setPivotDataShowAs, et as sortPivotItemsByLabel, rt as typeOverPivot, at as withListedFields };
|