@sheetxl/mcp 0.8.0-beta.16 → 0.8.0-beta.17
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/{B_nQLUWaxp-Q1IfV.js → -cMvbaW1kvHslPKX.js} +2 -2
- package/assets/{D1g6IOzdvInVLV-x.js → 0kfwZuOHUkJmVjg6.js} +6 -6
- package/assets/{Gqh12ggLm5KlvN3v.js → 1feDuXw6tBXu2XFg.js} +1 -1
- package/assets/{DmLbqbAez7Dzwyl7.js → 4qMP71Fe1Ep8kbOX.js} +1 -1
- package/assets/{AjWB-QdIkr07kToW.js → 7TRx0dMYnL2i4tqL.js} +193 -193
- package/assets/{iqQWGoJaPha0_8lU.js → 8cVPexxAVrFJ9QLX.js} +1 -1
- package/assets/{C-AIgWmHugqMcl9J.js → APP8AzsNgQXHTalA.js} +2 -2
- package/assets/{Cl98sBOj9GM2XnFe.js → AnF1Kh3Vo2AniIYO.js} +2 -2
- package/assets/{B2YEEPHIkNcezk9T.js → B2BfjRdJGZs6afVL.js} +2 -2
- package/assets/{DEIkGoOZ_WeuY0Lj.js → B2UxLSteMiPlg8Uu.js} +1 -1
- package/assets/{BiGm1tKvxUh8oWbD.js → B3mh2tuvP-lMP6f_.js} +1 -1
- package/assets/{CG8zvnxueimOY7wm.js → B6NnxkSmEzCGZEZA.js} +1 -1
- package/assets/{DFAqI-o57Kd_Azlt.js → B7Nqa7V-v0cxGBux.js} +1 -1
- package/assets/{DTLbKr_XIJMwQJmk.js → B7OyFSpBb1eBvMVd.js} +13 -13
- package/assets/{CFdJvXLSbUrvNera.js → B8JX7a6VZlBNA_Bd.js} +8 -8
- package/assets/{Z01wJImjl6lBMpf4.js → B9J8nV-dh6jHpzZI.js} +1 -1
- package/assets/{C75i_5ip7OhGkuiF.js → B9M_sgHpoc-op6FF.js} +1 -1
- package/assets/{POdlv6cpSx6ftJxx.js → BBC_WF8BcAH-k_cQ.js} +1 -1
- package/assets/{DdrsYdX3bLixdb_9.js → BGZ_ltNFYvnAmbVR.js} +1 -1
- package/assets/{BNrpvJZtIL0Ex_wE.js → BJBoygm-gY68bLAP.js} +15 -15
- package/assets/{SaCo3me4_hw2b1L4.js → BJdWgj1hv57eGVl4.js} +389 -389
- package/assets/{Co_y6GfwJTYtOmlt.js → BKRLtOdVOUTrLjQN.js} +3 -3
- package/assets/{DNhfziNrJGdL8BYs.js → BKjovBsLpX2Fkhov.js} +6 -6
- package/assets/{pQUJKbHGetb7dcOr.js → BMJhHHX2LWgOJWGz.js} +1 -1
- package/assets/{D-irgQZ2WmkP9dnK.js → BOx4Ut_Rme7NH34X.js} +1 -1
- package/assets/{DfzLOnWTNL_2J90y.js → BQYpVYbvfWuUJgdx.js} +1 -1
- package/assets/{BtNRIFE92ka4hATo.js → BS4ZsfH5D6aemSpO.js} +1 -1
- package/assets/{CZepo1lDTQp1myg6.js → BSAdmOdx3brRE9LW.js} +1 -1
- package/assets/{DFn_thWGK0_EZI5k.js → BSY9Tbmz6VEY_F_x.js} +1 -1
- package/assets/{Dd8CHUZz7xuYTfp-.js → BT8AGlSg2t7V1QNj.js} +488 -488
- package/assets/{SB2aKOIVln0EkgXR.js → BUV7BlOZcuPgDZ__.js} +1 -1
- package/assets/{BbXlmp8W_cbr75FN.js → BX5xFncPLyeN7TqA.js} +5 -5
- package/assets/{3t-I20nDzFHBd5UJ.js → Bcak_hZpcIkB2gJD.js} +1 -1
- package/assets/{C0JSC9gVwR1QxopD.js → BdijGsy5W7yZ_I_n.js} +1 -1
- package/assets/{QVWayvB03YMyTKt3.js → BebXDUnlrDDRGW60.js} +2 -2
- package/assets/{D7iU4kaxzl_PojNt.js → BgldX21zhey2aR9D.js} +1 -1
- package/assets/{DQcus4X_kTKIIyX6.js → BhCbCEPpDzhg5nqL.js} +1 -1
- package/assets/{BZbxPclVVopktv3l.js → Bj4BFLBC9Tf6SGSt.js} +1 -1
- package/assets/{Di4ehJD7muvtcrN3.js → BjhAYfsKC8iEbtgn.js} +40 -40
- package/assets/{Ct5VTtdW77k-WcP_.js → BjnQVl1lb1KEbt2D.js} +51 -51
- package/assets/{CAEhAL7-0FG7jdzN.js → BlbxiLf1zD6_fWZs.js} +1 -1
- package/assets/{JC8UUcu6m23qqrr3.js → BmM-nHMAAuNatCcN.js} +1 -1
- package/assets/{BlWfQ5HPEehB_lPz.js → Bni-y4FJS4rkFYtn.js} +107 -107
- package/assets/{C2dG4GHThf9O-IJy.js → BodrfKIAhDFD-X3t.js} +1 -1
- package/assets/{C_0RM0w6Pw70Bx_Y.js → BvDcHHJvQMRHthm-.js} +1 -1
- package/assets/{4vS8pASPZSU7QcRZ.js → Bw_FtA-1886HMCLJ.js} +3 -3
- package/assets/{2GLqCzpAJP6jbaRx.js → Bxkx8QokmRNyXbOI.js} +5 -5
- package/assets/{B3MqN3t5naY3moOk.js → Bz1ImBvJwPwBrA5j.js} +1 -1
- package/assets/{BpgPKKZwxXklRyo7.js → C2NPIWe0pLs3PAZM.js} +2 -2
- package/assets/{DzkccbbE6iXMqQDO.js → C2ZX6ffXsMaEr2d2.js} +305 -305
- package/assets/{nmB0nnkFQf5NWo0i.js → C3Q-fjiZZ15waCq_.js} +2 -2
- package/assets/{CsjjeeOHE2624pGt.js → C46RpMrfF6FiEFI7.js} +1 -1
- package/assets/{LwFDS0HxPZKiiEnN.js → C4deMY87Q_haYyLF.js} +1 -1
- package/assets/{CW-ivE6pl3V7vKuT.js → C7iHn3y3HVBHflpA.js} +4 -4
- package/assets/{CVRc6jQcH155Z89u.js → CJF3P7U7yBQVF2Cg.js} +1 -1
- package/assets/{B16N6VSLY5HPgVkD.js → CLgvdaqeFlESLvbF.js} +1 -1
- package/assets/{BUAq-ENCmL0XGLIu.js → CLze192iF2o-aETZ.js} +1 -1
- package/assets/{CX-6eYkcr5y0VmQm.js → CMRLNLqYkiqCLMRa.js} +3 -3
- package/assets/{CAMrW5ypKhgn105y.js → COa691om4fLN4CUy.js} +1 -1
- package/assets/CSLLHl-zum7m1CJl.js +14 -0
- package/assets/{DJdRl2yX9DP_D8kh.js → CUbCBf24Ie4A2l4R.js} +2 -2
- package/assets/{CDqG64rXHp9-2tXr.js → CWLleOolFzyT0COW.js} +1 -1
- package/assets/{C3Wibs7QGFZ1FI7W.js → CaJ9j3l0cERnYqDS.js} +1 -1
- package/assets/{CrwtgrD7BbXyCkx0.js → CfA8o-FNret9-D6Y.js} +1 -1
- package/assets/{BbDKWV_FQAICqZjP.js → Cl7HHR6Vc9S4n3AP.js} +1 -1
- package/assets/{DKRa_Oc4XqB3DABB.js → CqjNsZ2OB4Kx6J3s.js} +8 -8
- package/assets/{soSlr334Fv1j5t2m.js → CqwEHSKivMYw7tRZ.js} +1 -1
- package/assets/{Dg4JXbd1yPGNZOtL.js → Cr6lm0oXZJaaoAmD.js} +1 -1
- package/assets/{Dp-dLoOaBndV2N5i.js → CshK6Ew7OQ7mngI3.js} +2 -2
- package/assets/{DBMZF6PRHCko9K9R.js → CsiIgnb_L2x2Go6g.js} +1 -1
- package/assets/{BYqyNLuwXl7GKuzh.js → CtmrBbpapaNwjwNB.js} +28 -28
- package/assets/{DvFwVzuc5YfagNnH.js → CwRhhoL5ynbe78dB.js} +1 -1
- package/assets/{C95HXhZkkhnUx_aE.js → CyI1eGGzJX8nJXaT.js} +2 -2
- package/assets/{DMhtIFfkX-DZT_e3.js → Cz4H3Qge2u8er3Ny.js} +3 -3
- package/assets/{BrtLeTsrulaU6osB.js → D0OQ6ka8so0BWPwL.js} +1 -1
- package/assets/{CJa8JVvKGVBz8Q7q.js → D336KioeSjd-T8n3.js} +2 -2
- package/assets/{DBANZf_eAzaCFdIj.js → D5L35C8cbX16BSCF.js} +227 -227
- package/assets/{DOZ40EyxD3m0gCos.js → D5VFuX1h50V2jLmZ.js} +305 -305
- package/assets/{5B_tapYOcjOv1wGO.js → D6ON3ZLcTAXV3fO6.js} +8353 -8352
- package/assets/{BsFWmVYPrLyh5Dre.js → DDhPOQPc-lpyZrUJ.js} +4 -4
- package/assets/{iULnLPcNKVpz00r7.js → DE4xC78p5UtS7wH6.js} +1 -1
- package/assets/{-PtBguqpLi7Nr4Df.js → DF7-oRscXc_vkMo8.js} +1 -1
- package/assets/{BIUUGUhypimIDg2a.js → DMuOMpgIhVgB3eG8.js} +1 -1
- package/assets/{TNQaiw20sEAEUiK5.js → DPKeRb9GKmh_WCPv.js} +1 -1
- package/assets/{9MXt8KXdWlbEJNc2.js → DSsH28SW8CMrSL-q.js} +1 -1
- package/assets/{D2YdqNWXwSHJMPbA.js → DV6WSFmSEKfb3d2s.js} +4 -4
- package/assets/{Bdt9nQs8gDIzu_IG.js → DYJcfrNUUJQtxXWX.js} +1 -1
- package/assets/{DLhlBqwsDnmscAuL.js → D_peM8fbRgGaWvpq.js} +1 -1
- package/assets/{D7ibkNIu_Pn4TeBD.js → DeEZvPW-VvlE28oE.js} +3 -3
- package/assets/{CL1-ziDI0aAaVbhJ.js → Dgi2xwb2DN2Gybj3.js} +2 -2
- package/assets/{BiE9M6RctwQ339_7.js → DidhZpf9qJAei29Y.js} +1 -1
- package/assets/{BlIrJwQGEASCgJdZ.js → Dkg-LQVsZlrHk7A8.js} +1 -1
- package/assets/{BBPjYcS8XKQREith.js → DnTfXqCnRCe-1QYI.js} +61 -61
- package/assets/{CVbRpT7QPHOMgwTx.js → DoBvgI3Ry8DlGzwQ.js} +1 -1
- package/assets/{BjDsx_FHl0mShqHX.js → DrHVew6gwOB6oxCn.js} +1 -1
- package/assets/{BRLA4pJWiYdpW-69.js → Dre79rTMoYYikNuB.js} +19 -19
- package/assets/{DaILIYfy-jPVTXjz.js → DsCNtBR5jCeqmLBS.js} +2 -2
- package/assets/{W2FU69Pfo4chpqtk.js → Dzz3yrKbECzg6caR.js} +1 -1
- package/assets/{nDmE2I07HvkpRdR0.js → FvxN6PPps-rNPDo8.js} +1 -1
- package/assets/{DfWWAHOjmhqvN3m_.js → G2Wjyx_ETCAcofwm.js} +130 -130
- package/assets/{YXC__Myl-BuIFW6s.js → IGAV8DdYH32cW8XU.js} +1 -1
- package/assets/{C-gN7uBg-MWHRo4g.js → Jd71-QCmFEcDcYSw.js} +1 -1
- package/assets/{CBPkPTmeaEokFPSI.js → Ljri8sTW3dWT4clD.js} +1 -1
- package/assets/{D3bxrF1Ys2GSVfQH.js → MW2nt7se27FlH9Yb.js} +1 -1
- package/assets/{8NrxfSWBHDaEJvhz.js → Mgs_OJP41a-Nfac3.js} +1 -1
- package/assets/{CvJkwRgwm80S2bcd.js → OHBzl-tZOi9Ni8YV.js} +1 -1
- package/assets/{BR66nPIzyzlOcP10.js → PbBzI4PlKpCgULLd.js} +1 -1
- package/assets/{DR9xHYH6v5G0lOqf.js → UH_biJmLrI9SvckA.js} +3 -3
- package/assets/{DFvs1LVzXKm1N5M2.js → Xe7sA_mEwDQpJjcF.js} +2 -2
- package/assets/{Dy67BUF2yd8VRPwL.js → YFiGplEq1G4XdCJ2.js} +1 -1
- package/assets/{BuhHuKVWppW4L8AV.js → YQtUMMGmb1_WFsh_.js} +1 -1
- package/assets/{BCSRsSAEPlwR59H5.js → dcvgOfBmWFTsXoT8.js} +4 -4
- package/assets/{Ci7-PIIhZwb2mVv5.js → iBgLe32XErisaUSr.js} +1 -1
- package/assets/{rfwqMukKbJBeJBuC.js → kpS1vY0DcE9p8JnI.js} +2 -2
- package/assets/{BdMebk9YSA0oxQ_d.js → lcIaYgz4tQGBlzlo.js} +67 -67
- package/assets/{CK9h6iDOreaI8GEt.js → nQbVdQrfdz3osBdi.js} +3 -3
- package/assets/{CoIjAX2gECGb3Wxl.js → oJNJQJEDQCsjHSmo.js} +1 -1
- package/assets/{3_NofB4A4Qhl-4YY.js → qgW-p2sFhMtuu5yw.js} +1 -1
- package/assets/{h6EQSu5n2vTsu2yd.js → z24-oIqP_fu2hsOt.js} +1 -1
- package/assets/{CIqJdIUKSLZkNwHy.js → z7nDK_gfX7G37XbZ.js} +34 -34
- package/index.js +205 -205
- package/lib.js +1 -1
- package/licenses/dependencies.txt +35 -35
- package/package.json +2 -2
- package/screenshot-page/assets/{D8s3sJnhFxbI3Dqn.js → 7Xk_eQAcM_HgWrOC.js} +1 -1
- package/screenshot-page/assets/{CQFj5AGXfIA9z9zI.js → B1W17rc9ilPFCh31.js} +1 -1
- package/screenshot-page/assets/B8UkvH0o9n_G5UO9.js +3 -0
- package/screenshot-page/assets/{CZa1rha3RnQUWyOk.js → BD96fN2dSVuoME09.js} +4 -4
- package/screenshot-page/assets/BE8ea8S0Q-qogeEs.js +2 -0
- package/screenshot-page/assets/{BU5S8KEzPmIA_Flm.js → BKwVcuWOKeH2xREA.js} +1 -1
- package/screenshot-page/assets/BNMBa8EZgWX2Eb3c.js +1 -0
- package/screenshot-page/assets/{Db6bZVJ-184DJIoe.js → BQCyH9YbEgnH78Ke.js} +2 -2
- package/screenshot-page/assets/BcDxaEii3arJqOym.js +1 -0
- package/screenshot-page/assets/Be-rukvcufhLamH5.js +1 -0
- package/screenshot-page/assets/{Dq7wGcTrNIshovlT.js → Bh33WyohJvbKZVQN.js} +2 -2
- package/screenshot-page/assets/C2ty_K_uix4ooip6.js +1 -0
- package/screenshot-page/assets/C9mUKjQ3yEzRu9j2.js +2 -0
- package/screenshot-page/assets/{DDkL9PZPXAggW2Yr.js → CB2mQ5rbaSw2W4ik.js} +23 -23
- package/screenshot-page/assets/{DLFFFQjTi5Ji1940.js → CCVAsuUimIJOkBnk.js} +1 -1
- package/screenshot-page/assets/{D7biuwkvm3zAwsBa.js → COoMVTzF50qBNFEu.js} +3 -3
- package/screenshot-page/assets/{Bir0SSOHX0w2yo8h.js → CSMEGhAHxl5-4FxB.js} +1 -1
- package/screenshot-page/assets/{rOzyaU7hqchMbhRL.js → CT7cY57t9j1sBhAy.js} +1 -1
- package/screenshot-page/assets/{BJ2r2WfEL3SgkBAX.js → CTjUtxDw6Z2I9OGc.js} +1 -1
- package/screenshot-page/assets/{BIrVK5hdDCUYmxGO.js → CUZobZ3mfNAdEisS.js} +1 -1
- package/screenshot-page/assets/{ClzJdxlUDDtBYjH8.js → C_OuKbe6z1it80cj.js} +1 -1
- package/screenshot-page/assets/Cbcv49b9jWyY4HKj.js +2 -0
- package/screenshot-page/assets/CtZFqwLoeJOvwFrl.js +42 -0
- package/screenshot-page/assets/Cz6KFmsp267l_VZS.js +1 -0
- package/screenshot-page/assets/{lgeNUp9cU20IAotv.js → D0koRjO2KnWQ1fNV.js} +1 -1
- package/screenshot-page/assets/{cTMKPkmZF8FWQaMn.js → DCP8JXEeiwAMiVD2.js} +1 -1
- package/screenshot-page/assets/DQAZPADvH5lhlMnK.js +1 -0
- package/screenshot-page/assets/DQBUH0j44Vtrykua.js +13 -0
- package/screenshot-page/assets/{DyiVrm8mEnEaoZHa.js → DSKOOgcJQeqIc9Us.js} +1 -1
- package/screenshot-page/assets/{CguXw0IcKNPbmAbj.js → DXaM3CulPA3aPGV1.js} +2 -2
- package/screenshot-page/assets/{CqyMYduWKFvmMs_Z.js → DcUOAH274IbYOuK1.js} +1 -1
- package/screenshot-page/assets/{CRsTnamLrPN5-Dsi.js → DdXSKhFUAsKUsQ1u.js} +1 -1
- package/screenshot-page/assets/Djl40tfWoPJSvqtv.js +1 -0
- package/screenshot-page/assets/TCImIYUUdVD4Z35I.js +1 -0
- package/screenshot-page/assets/dQsis-90Up-pIkSq.js +4 -0
- package/screenshot-page/assets/{Dn5PwRw7rrTKNnql.js → dXn1GWWjYmuLb1HF.js} +8 -8
- package/screenshot-page/index.html +5 -5
- 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/CYfkL98Zu43S8-50.js +0 -42
- package/screenshot-page/assets/CzsoLbEIUVK5ia1C.js +0 -1
- package/screenshot-page/assets/D2IHCJ1QWDKwmhge.js +0 -1
- package/screenshot-page/assets/DMxrNtfw275en7pm.js +0 -1
- package/screenshot-page/assets/D_kJ3WunvjIINcHC.js +0 -1
- package/screenshot-page/assets/DhB6GjSJIeTmIODk.js +0 -1
- package/screenshot-page/assets/TilS2JSBGVkd1za3.js +0 -3
- package/screenshot-page/assets/UKFgEuwI1UMhPqKF.js +0 -2
- 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.17
|
|
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 { r as e } from "./
|
|
8
|
-
import { B as t, D as s, I as r, J as i, S as o, T as n, Z as a, bt as l, ct as h, ht as c, i as u, ot as d, p as g, tt as
|
|
9
|
-
import { a as p, c as w, s as y } from "./
|
|
10
|
-
import { At as S, C as b, E as k, F as C, G as v, I, Jt as R, L as N, U as O, Ut as x, Vt as L, Xt as V, Y as E, bt as A, ht as T, lt as P, qt as F, ut as B, v as W } from "./
|
|
11
|
-
import { d as j, p as M } from "./
|
|
12
|
-
import { $n as D,
|
|
7
|
+
import { r as e } from "./BMJhHHX2LWgOJWGz.js";
|
|
8
|
+
import { B as t, D as s, I as r, J as i, S as o, T as n, Z as a, bt as l, ct as h, ht as c, i as u, ot as d, p as g, tt as _, u as f, xt as m } from "./CfA8o-FNret9-D6Y.js";
|
|
9
|
+
import { a as p, c as w, s as y } from "./DsCNtBR5jCeqmLBS.js";
|
|
10
|
+
import { At as S, C as b, E as k, F as C, G as v, I, Jt as R, L as N, U as O, Ut as x, Vt as L, Xt as V, Y as E, bt as A, ht as T, lt as P, qt as F, ut as B, v as W } from "./BJBoygm-gY68bLAP.js";
|
|
11
|
+
import { d as j, p as M } from "./MW2nt7se27FlH9Yb.js";
|
|
12
|
+
import { $n as D, $t as z, An as H, B as $, Br as U, C as J, Ci as q, D as K, Da as G, Di as X, Fa as Z, Ga as Q, Gn as Y, In as ee, J as te, Jn as se, Kr as re, Lr as ie, Mi as oe, Na as ne, Ni as ae, On as le, P as he, Pi as ce, Pn as ue, Rt as de, Ta as ge, Ui as _e, Un as fe, Ur as me, V as pe, Xi as we, Xn as ye, Xr as Se, Yr as be, Zi as ke, Zt as Ce, _n as ve, aa as Ie, ao as Re, ba as Ne, da as Oe, do as xe, er as Le, fo as Ve, g as Ee, gr as Ae, hi as Te, j as Pe, jn as Fe, ln as Be, lo as We, lt as je, ni as Me, oi as De, oo as ze, p as He, pi as $e, pr as Ue, qa as Je, qt as qe, ri as Ke, sn as Ge, ta as Xe, tr as Ze, ui as Qe, uo as Ye, va as et, vr as tt, x as st, xt as rt, y as it } from "./D6ON3ZLcTAXV3fO6.js";
|
|
13
13
|
var ot, nt, at = class extends r {
|
|
14
14
|
constructor(e, t = 50) {
|
|
15
15
|
super(t), this._transactions = e, this._floorId = e ? e.getCurrentCommit(!1).getId() : null, this._removeListener = e?.addListener({ onCommitChange: () => this._notifyOnStackChange() });
|
|
@@ -172,7 +172,7 @@ var ut = class e {
|
|
|
172
172
|
getName() {
|
|
173
173
|
if (null !== this._name && void 0 !== this._name) return this._name;
|
|
174
174
|
const e = this._cleanPath();
|
|
175
|
-
return e &&
|
|
175
|
+
return e && fe(e) || null;
|
|
176
176
|
}
|
|
177
177
|
getPath() {
|
|
178
178
|
return this._path;
|
|
@@ -183,7 +183,7 @@ var ut = class e {
|
|
|
183
183
|
getExtension() {
|
|
184
184
|
const e = this._cleanPath();
|
|
185
185
|
if (!e) return null;
|
|
186
|
-
const t =
|
|
186
|
+
const t = Te(e);
|
|
187
187
|
return t ? t.toLowerCase() : null;
|
|
188
188
|
}
|
|
189
189
|
getEncryption() {
|
|
@@ -233,7 +233,7 @@ var ut = class e {
|
|
|
233
233
|
];
|
|
234
234
|
return `${t} ${(s / Math.pow(1024, r)).toFixed(2)}${i[Math.min(r, i.length - 1)]}`;
|
|
235
235
|
}
|
|
236
|
-
}, dt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new Set(),
|
|
236
|
+
}, dt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new Set(), _t = (e) => dt.get(e) ?? null, ft = class e {
|
|
237
237
|
constructor(t) {
|
|
238
238
|
this._released = !1, e._assertFree(t), this._emitter = new y(this), this._origin = t, dt.set(t, this), gt.add(this);
|
|
239
239
|
}
|
|
@@ -272,10 +272,10 @@ var ut = class e {
|
|
|
272
272
|
}
|
|
273
273
|
switch (n) {
|
|
274
274
|
case "file": {
|
|
275
|
-
const e = s, r = e?.name, n = r ? `${
|
|
275
|
+
const e = s, r = e?.name, n = r ? `${fe(r)}` : "";
|
|
276
276
|
a = await e.arrayBuffer(), l = {
|
|
277
277
|
format: o,
|
|
278
|
-
ext:
|
|
278
|
+
ext: Te(r),
|
|
279
279
|
name: n,
|
|
280
280
|
absolutePath: r,
|
|
281
281
|
size: e.size,
|
|
@@ -315,7 +315,7 @@ var ut = class e {
|
|
|
315
315
|
t = e.input, r = e.init, i = e.timeout;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
const n = i || 3e4, h = new AbortController(), c = setTimeout(() => h.abort(), n), u = "string" == typeof t ? t : t.toString(), d =
|
|
318
|
+
const n = i || 3e4, h = new AbortController(), c = setTimeout(() => h.abort(), n), u = "string" == typeof t ? t : t.toString(), d = Te(u);
|
|
319
319
|
try {
|
|
320
320
|
const e = await fetch(t, {
|
|
321
321
|
...r,
|
|
@@ -327,7 +327,7 @@ var ut = class e {
|
|
|
327
327
|
a = s, l = {
|
|
328
328
|
format: o,
|
|
329
329
|
ext: d,
|
|
330
|
-
name:
|
|
330
|
+
name: fe(u, !0),
|
|
331
331
|
absolutePath: u
|
|
332
332
|
};
|
|
333
333
|
} catch (e) {
|
|
@@ -444,7 +444,7 @@ var ut = class e {
|
|
|
444
444
|
), r = e.origin.getPath(), i = !(!r || !e.origin.canWrite()), o = i ? r : e.origin.getName() ? e.suggestedName : null;
|
|
445
445
|
if (!o) throw new Error("No file name provided to write to.");
|
|
446
446
|
const n = s.resolve(o.replace(/\\/g, "/")), a = this.findOpenPath(n, e.workbook?.getOrigin?.());
|
|
447
|
-
if (a) throw new
|
|
447
|
+
if (a) throw new _(g("error.io.openElsewhere", { name: a.getName() ?? n }));
|
|
448
448
|
const l = i ? e.origin : new ut(n, {
|
|
449
449
|
format: e.format.key,
|
|
450
450
|
canWrite: !0
|
|
@@ -488,28 +488,28 @@ var wt, yt, St, bt, kt = {
|
|
|
488
488
|
Bottom: "b",
|
|
489
489
|
BottomRight: "br"
|
|
490
490
|
}, Ct = W.BuiltInName, vt = {
|
|
491
|
-
[Ct.Normal]:
|
|
492
|
-
[Ct.Comma]:
|
|
493
|
-
[Ct.Currency]:
|
|
494
|
-
[Ct.Percent]:
|
|
495
|
-
[Ct.Comma0]:
|
|
496
|
-
[Ct.Currency0]:
|
|
497
|
-
[Ct.Hyperlink]:
|
|
498
|
-
[Ct.FollowedHyperlink]:
|
|
499
|
-
[Ct.Note]:
|
|
500
|
-
[Ct.WarningText]:
|
|
501
|
-
[Ct.Title]:
|
|
502
|
-
[Ct.Input]:
|
|
503
|
-
[Ct.Output]:
|
|
504
|
-
[Ct.Calculation]:
|
|
505
|
-
[Ct.CheckCell]:
|
|
506
|
-
[Ct.LinkedCell]:
|
|
507
|
-
[Ct.Total]:
|
|
508
|
-
[Ct.Good]:
|
|
509
|
-
[Ct.Bad]:
|
|
510
|
-
[Ct.Neutral]:
|
|
511
|
-
[Ct.ExplanatoryText]:
|
|
512
|
-
}, It =
|
|
491
|
+
[Ct.Normal]: f("style.builtin.normal"),
|
|
492
|
+
[Ct.Comma]: f("style.builtin.comma"),
|
|
493
|
+
[Ct.Currency]: f("style.builtin.currency"),
|
|
494
|
+
[Ct.Percent]: f("style.builtin.percent"),
|
|
495
|
+
[Ct.Comma0]: f("style.builtin.comma0"),
|
|
496
|
+
[Ct.Currency0]: f("style.builtin.currency0"),
|
|
497
|
+
[Ct.Hyperlink]: f("style.builtin.hyperlink"),
|
|
498
|
+
[Ct.FollowedHyperlink]: f("style.builtin.followedHyperlink"),
|
|
499
|
+
[Ct.Note]: f("style.builtin.note"),
|
|
500
|
+
[Ct.WarningText]: f("style.builtin.warningText"),
|
|
501
|
+
[Ct.Title]: f("style.builtin.title"),
|
|
502
|
+
[Ct.Input]: f("style.builtin.input"),
|
|
503
|
+
[Ct.Output]: f("style.builtin.output"),
|
|
504
|
+
[Ct.Calculation]: f("style.builtin.calculation"),
|
|
505
|
+
[Ct.CheckCell]: f("style.builtin.checkCell"),
|
|
506
|
+
[Ct.LinkedCell]: f("style.builtin.linkedCell"),
|
|
507
|
+
[Ct.Total]: f("style.builtin.total"),
|
|
508
|
+
[Ct.Good]: f("style.builtin.good"),
|
|
509
|
+
[Ct.Bad]: f("style.builtin.bad"),
|
|
510
|
+
[Ct.Neutral]: f("style.builtin.neutral"),
|
|
511
|
+
[Ct.ExplanatoryText]: f("style.builtin.explanatoryText")
|
|
512
|
+
}, It = f("style.builtin.heading"), Rt = f("style.builtin.accent"), Nt = f("style.builtin.accentTint"), Ot = /^Heading ([1-4])$/, xt = /^Accent([1-6])$/, Lt = /^(20|40|60)% - Accent([1-6])$/;
|
|
513
513
|
function Vt(e) {
|
|
514
514
|
const t = vt[e];
|
|
515
515
|
if (t) return { key: t };
|
|
@@ -593,7 +593,7 @@ var Et, At = (e, t, s, r, i) => {
|
|
|
593
593
|
var Tt = null;
|
|
594
594
|
function Pt() {
|
|
595
595
|
if (!Tt) {
|
|
596
|
-
const e = import("./
|
|
596
|
+
const e = import("./B8JX7a6VZlBNA_Bd.js").then(({ initializeFunctions: e }) => {
|
|
597
597
|
const t = e(() => null);
|
|
598
598
|
return Object.freeze(Array.from(t.keys()));
|
|
599
599
|
});
|
|
@@ -604,7 +604,7 @@ function Pt() {
|
|
|
604
604
|
return Tt;
|
|
605
605
|
}
|
|
606
606
|
function Ft(e) {
|
|
607
|
-
return
|
|
607
|
+
return Q.peek()?.readFormulaLiteral(e);
|
|
608
608
|
}
|
|
609
609
|
function Bt(e, t) {
|
|
610
610
|
const s = Wt(e), r = Wt(t);
|
|
@@ -621,7 +621,7 @@ function Wt(e) {
|
|
|
621
621
|
}
|
|
622
622
|
(function(e) {
|
|
623
623
|
function t(e) {
|
|
624
|
-
return
|
|
624
|
+
return Q.peek()?.getFunctionDeclaration(e) ?? null;
|
|
625
625
|
}
|
|
626
626
|
e.get = t, e.has = function(e) {
|
|
627
627
|
return null !== t(e);
|
|
@@ -675,19 +675,19 @@ var jt, Mt = class {
|
|
|
675
675
|
const s = t[e].getSortedNumbers().getValues();
|
|
676
676
|
s.length > 0 && r.push(s);
|
|
677
677
|
}
|
|
678
|
-
e = new
|
|
678
|
+
e = new Be(function(e) {
|
|
679
679
|
const t = e.length;
|
|
680
680
|
if (0 === t) return Dt;
|
|
681
681
|
if (1 === t) return e[0];
|
|
682
682
|
let s = e[0];
|
|
683
|
-
for (let r = 1; r < t; r++) s =
|
|
683
|
+
for (let r = 1; r < t; r++) s = zt(s, e[r]);
|
|
684
684
|
return Object.freeze(s);
|
|
685
685
|
}(r)), this._sortedNumbers = e;
|
|
686
686
|
}
|
|
687
687
|
return e;
|
|
688
688
|
}
|
|
689
689
|
getRanked(e) {
|
|
690
|
-
return
|
|
690
|
+
return he(this._children, e, Bt)[Symbol.iterator]();
|
|
691
691
|
}
|
|
692
692
|
getFrequencies(e) {
|
|
693
693
|
if (e) return this._mergeFrequencies(e);
|
|
@@ -695,7 +695,7 @@ var jt, Mt = class {
|
|
|
695
695
|
return t || (t = this._mergeFrequencies(), this._frequencies = t), t;
|
|
696
696
|
}
|
|
697
697
|
_mergeFrequencies(e) {
|
|
698
|
-
const t = e?.keyFn ??
|
|
698
|
+
const t = e?.keyFn ?? we, s = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, o = i.length;
|
|
699
699
|
let n = 0, a = 0, l = !1;
|
|
700
700
|
for (let h = 0; h < o; h++) {
|
|
701
701
|
const o = i[h].getFrequencies(e);
|
|
@@ -710,7 +710,7 @@ var jt, Mt = class {
|
|
|
710
710
|
}) : l = !0, u = c.next();
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
return
|
|
713
|
+
return me.fromGroups(r, t, e, Bt, n, a, l);
|
|
714
714
|
}
|
|
715
715
|
getTypedCounts(e) {
|
|
716
716
|
let t = this._typedCounts;
|
|
@@ -760,10 +760,10 @@ var jt, Mt = class {
|
|
|
760
760
|
const o = s.numericalCount;
|
|
761
761
|
o <= 0 || (r.numericalCount += o, r.sum += s.sum, r.sumSq += s.varP * o + s.sum * s.sum / o, (void 0 === r.min || s.min < r.min) && (r.min = s.min), (void 0 === r.max || s.max > r.max) && (r.max = s.max));
|
|
762
762
|
}
|
|
763
|
-
return
|
|
763
|
+
return ge(r);
|
|
764
764
|
}
|
|
765
765
|
}, Dt = Object.freeze([]);
|
|
766
|
-
function
|
|
766
|
+
function zt(e, t) {
|
|
767
767
|
const s = e.length, r = t.length, i = new Array(s + r);
|
|
768
768
|
let o = 0, n = 0, a = 0;
|
|
769
769
|
for (; o < s && n < r;) i[a++] = e[o] <= t[n] ? e[o++] : t[n++];
|
|
@@ -771,7 +771,7 @@ function Ht(e, t) {
|
|
|
771
771
|
for (; n < r;) i[a++] = t[n++];
|
|
772
772
|
return i;
|
|
773
773
|
}
|
|
774
|
-
var
|
|
774
|
+
var Ht, $t = class e {
|
|
775
775
|
constructor(e, t) {
|
|
776
776
|
this._source = null, this._fresh = /* @__PURE__ */ new WeakSet(), this._unwatch = null, this.cacheId = e, this._store = t, this._fresh.add(t.get());
|
|
777
777
|
}
|
|
@@ -820,7 +820,7 @@ var zt, $t = class e {
|
|
|
820
820
|
if (this._source) return;
|
|
821
821
|
const { ref: s, sheet: r, name: i } = this._sourceAsRead() ?? {};
|
|
822
822
|
let o = null, n = null;
|
|
823
|
-
if (s && r && !s.includes("#REF!") ? (o = e(r), n = `${
|
|
823
|
+
if (s && r && !s.includes("#REF!") ? (o = e(r), n = `${Fe(r)}!${se(s)}`) : !i || s || r ? i && r && !s && (o = e(r), n = `${Fe(r)}!${i}`) : (o = t(i), n = `${i}[#All]`), !o || !n) return;
|
|
824
824
|
const a = {
|
|
825
825
|
formula: null,
|
|
826
826
|
wired: null,
|
|
@@ -874,17 +874,17 @@ var zt, $t = class e {
|
|
|
874
874
|
if (null === t || t === e.wired) return null;
|
|
875
875
|
const s = this._sourceAsRead();
|
|
876
876
|
if (s?.name && s.sheet) {
|
|
877
|
-
const e =
|
|
877
|
+
const e = st(t)?.sheet;
|
|
878
878
|
return e ? { sheet: e } : null;
|
|
879
879
|
}
|
|
880
880
|
const r = /^(.+)\[#All\]$/.exec(t)?.[1];
|
|
881
881
|
if (r) return { name: r };
|
|
882
|
-
const i =
|
|
882
|
+
const i = st(t);
|
|
883
883
|
return i ? {
|
|
884
884
|
name: null,
|
|
885
|
-
ref:
|
|
885
|
+
ref: We(i.reference),
|
|
886
886
|
sheet: i.sheet
|
|
887
|
-
} : { ref:
|
|
887
|
+
} : { ref: We(t) };
|
|
888
888
|
}
|
|
889
889
|
_getSource() {
|
|
890
890
|
const e = this._sourceAsRead();
|
|
@@ -948,7 +948,7 @@ var zt, $t = class e {
|
|
|
948
948
|
get isIPerson() {
|
|
949
949
|
return !0;
|
|
950
950
|
}
|
|
951
|
-
}, Jt = class extends
|
|
951
|
+
}, Jt = class extends ee {
|
|
952
952
|
constructor(e) {
|
|
953
953
|
super(), this._byId = /* @__PURE__ */ new Map(), this._byDisplayName = /* @__PURE__ */ new Map(), this._items = null, this._current = null, e && this.fromJSON(e);
|
|
954
954
|
}
|
|
@@ -1032,22 +1032,22 @@ var zt, $t = class e {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
async createModule(e) {
|
|
1035
|
-
const t = await (await import("./
|
|
1035
|
+
const t = await (await import("./Xe7sA_mEwDQpJjcF.js")).ScriptCompiler.compile({
|
|
1036
1036
|
builtInNames: this._builtInNames(),
|
|
1037
1037
|
minify: !0,
|
|
1038
1038
|
...e
|
|
1039
1039
|
});
|
|
1040
|
-
return t.module ? await
|
|
1040
|
+
return t.module ? await ae(ie.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
|
|
1041
1041
|
}
|
|
1042
1042
|
addModule(e, t, s) {
|
|
1043
1043
|
this._modules.add(e, t, s);
|
|
1044
1044
|
}
|
|
1045
1045
|
async addModuleFromJSON(e, t, s) {
|
|
1046
|
-
const r = await
|
|
1046
|
+
const r = await ae(e, t);
|
|
1047
1047
|
return this.addModule(e, r, s), r;
|
|
1048
1048
|
}
|
|
1049
1049
|
async executeMacro(e, t, s) {
|
|
1050
|
-
await
|
|
1050
|
+
await Z.assertUsable("scripts");
|
|
1051
1051
|
const r = this._modules.getItems({ name: t }), i = r.length;
|
|
1052
1052
|
for (let t = 0; t < i; t++) {
|
|
1053
1053
|
const i = r[t].getFunctions().getByName(e);
|
|
@@ -1060,8 +1060,8 @@ var zt, $t = class e {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
async run(e, t) {
|
|
1062
1062
|
try {
|
|
1063
|
-
await
|
|
1064
|
-
const s = "string" == typeof e ? await this.createModule({ source: e }) : await
|
|
1063
|
+
await Z.assertUsable("scripts");
|
|
1064
|
+
const s = "string" == typeof e ? await this.createModule({ source: e }) : await ae(ie.DEFAULT_MODULE, e), r = "string" == typeof e ? e : e?.source ?? "";
|
|
1065
1065
|
return await this._runModule(s, r, t);
|
|
1066
1066
|
} catch (e) {
|
|
1067
1067
|
return {
|
|
@@ -1143,7 +1143,7 @@ var zt, $t = class e {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
if (!i || 0 === i.length) return c.EmptyArray;
|
|
1145
1145
|
const n = e?.text ? e.text.trim().toUpperCase() : null;
|
|
1146
|
-
return n ?
|
|
1146
|
+
return n ? Ue(i, n) : i.sort((e, t) => {
|
|
1147
1147
|
const s = e.getName().toUpperCase(), r = t.getName().toUpperCase();
|
|
1148
1148
|
return s < r ? -1 : s > r ? 1 : 0;
|
|
1149
1149
|
}), void 0 !== s && i.length > s ? i.slice(0, s) : i;
|
|
@@ -1182,13 +1182,13 @@ var zt, $t = class e {
|
|
|
1182
1182
|
for (let o = 0; o < r.length; o++) {
|
|
1183
1183
|
const n = r[o], a = t[n];
|
|
1184
1184
|
try {
|
|
1185
|
-
s[n] = await
|
|
1185
|
+
s[n] = await ae(n, a, !1, [], "workbook" === a?.scope ? e : null);
|
|
1186
1186
|
} catch (e) {
|
|
1187
1187
|
i.error(`Could not load script '${n}'; it will be unavailable.`, e);
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
|
-
const r = this, o = new
|
|
1191
|
+
const r = this, o = new Ie({
|
|
1192
1192
|
transactions: this._options?.transactions,
|
|
1193
1193
|
initial: s,
|
|
1194
1194
|
isReadOnly: () => r.isReadOnly(),
|
|
@@ -1219,7 +1219,7 @@ var zt, $t = class e {
|
|
|
1219
1219
|
}, Kt = /^([a-z][a-z0-9+.-]*):/i, Gt = (e) => {
|
|
1220
1220
|
const t = e.toLowerCase();
|
|
1221
1221
|
return t.endsWith(":") ? t : t + ":";
|
|
1222
|
-
},
|
|
1222
|
+
}, Xt = async (e, t) => {
|
|
1223
1223
|
try {
|
|
1224
1224
|
return await globalThis.fetch(e, t);
|
|
1225
1225
|
} catch (s) {
|
|
@@ -1241,9 +1241,9 @@ var zt, $t = class e {
|
|
|
1241
1241
|
})(e, t)) throw new j.Blocked("This site is restricted: it doesn't allow web apps to read its data, so the browser blocked the request for security.", { cause: s });
|
|
1242
1242
|
throw s;
|
|
1243
1243
|
}
|
|
1244
|
-
},
|
|
1244
|
+
}, Zt = class {
|
|
1245
1245
|
constructor() {
|
|
1246
|
-
this._handlers = /* @__PURE__ */ new Map([["http:",
|
|
1246
|
+
this._handlers = /* @__PURE__ */ new Map([["http:", Xt], ["https:", Xt]]);
|
|
1247
1247
|
}
|
|
1248
1248
|
fetch(e, t) {
|
|
1249
1249
|
const s = Kt.exec(e)?.[1], r = this._handlers.get(s ? Gt(s) : "https:");
|
|
@@ -1334,14 +1334,14 @@ var zt, $t = class e {
|
|
|
1334
1334
|
body: r
|
|
1335
1335
|
};
|
|
1336
1336
|
if (s.ok && r && r.byteLength > 0) {
|
|
1337
|
-
const t = await new
|
|
1337
|
+
const t = await new ve({ source: { buffer: r } }).getType();
|
|
1338
1338
|
t?.mime.startsWith("image/") ? (o.headers = i.filter(([e]) => "content-type" !== e.toLowerCase()), o.headers.push(["content-type", t.mime])) : this._cached.set(e, o);
|
|
1339
1339
|
}
|
|
1340
1340
|
return o;
|
|
1341
1341
|
}
|
|
1342
1342
|
}, ts = class {
|
|
1343
1343
|
constructor(e, t, s, r) {
|
|
1344
|
-
this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = s, this._topLeft = t ?? d.EmptyCell, this._sheet = new
|
|
1344
|
+
this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = s, this._topLeft = t ?? d.EmptyCell, this._sheet = new Re({
|
|
1345
1345
|
runtime: e,
|
|
1346
1346
|
styles: this._styles,
|
|
1347
1347
|
calcOnLoad: "none",
|
|
@@ -1552,15 +1552,15 @@ var zt, $t = class e {
|
|
|
1552
1552
|
let e, t = this._native?.text, s = this._native.html;
|
|
1553
1553
|
if (null === s && t && t.includes("<table")) try {
|
|
1554
1554
|
const e = new DOMParser().parseFromString(t, n.Html), r = e.querySelector("parsererror");
|
|
1555
|
-
if (r) throw new
|
|
1555
|
+
if (r) throw new _("Unable to parse: " + r);
|
|
1556
1556
|
s = e, t = null;
|
|
1557
1557
|
} catch (e) {
|
|
1558
1558
|
console.warn("Discovered text as html table but could could not parse.");
|
|
1559
1559
|
}
|
|
1560
1560
|
try {
|
|
1561
|
-
const r = new ts(this._runtime, this._topLeft, this._styles, s ? "HTML" : "Text"), i = await Promise.resolve(t ?
|
|
1561
|
+
const r = new ts(this._runtime, this._topLeft, this._styles, s ? "HTML" : "Text"), i = await Promise.resolve(t ? ye(t) : [[]]);
|
|
1562
1562
|
let o;
|
|
1563
|
-
if (
|
|
1563
|
+
if (Y(s, i, r) ? (e = r.sheet(), o = e.getUsedRange()) : s = null, o) {
|
|
1564
1564
|
const t = o.getSnapshot();
|
|
1565
1565
|
return this._parsed = {
|
|
1566
1566
|
prepare: (e, s) => t.prepare?.(e, s),
|
|
@@ -1583,7 +1583,7 @@ var zt, $t = class e {
|
|
|
1583
1583
|
sheet: i,
|
|
1584
1584
|
options: await i.getMovables()._preparePicture({ source: { buffer: e } }, {
|
|
1585
1585
|
type: "picture",
|
|
1586
|
-
description:
|
|
1586
|
+
description: f("op.copyImageFromClipboard"),
|
|
1587
1587
|
autoSelect: !0,
|
|
1588
1588
|
...t && { bounds: t }
|
|
1589
1589
|
})
|
|
@@ -1619,11 +1619,11 @@ var zt, $t = class e {
|
|
|
1619
1619
|
return this._assertOpen(), this._container.setName(e, t), this;
|
|
1620
1620
|
}
|
|
1621
1621
|
getVisibility() {
|
|
1622
|
-
return this._closed ?
|
|
1622
|
+
return this._closed ? Ae.Visibility.VeryHidden : this._container.getVisibility();
|
|
1623
1623
|
}
|
|
1624
1624
|
setVisibility(e = !0, t) {
|
|
1625
1625
|
let s;
|
|
1626
|
-
return this._assertOpen(), s = !0 === e ?
|
|
1626
|
+
return this._assertOpen(), s = !0 === e ? Ae.Visibility.Visible : !1 === e ? Ae.Visibility.Hidden : e, this._container.setVisibility(s, t), this;
|
|
1627
1627
|
}
|
|
1628
1628
|
getIndex() {
|
|
1629
1629
|
return this._container.getIndex();
|
|
@@ -1650,7 +1650,7 @@ var zt, $t = class e {
|
|
|
1650
1650
|
try {
|
|
1651
1651
|
this._notify("onBeforeDelete");
|
|
1652
1652
|
} catch (e) {
|
|
1653
|
-
throw e instanceof Error ? e : new
|
|
1653
|
+
throw e instanceof Error ? e : new _(e?.message ?? g("error.sheet.modelDelete"));
|
|
1654
1654
|
}
|
|
1655
1655
|
this._notify("onDelete"), e.commit();
|
|
1656
1656
|
} catch (t) {
|
|
@@ -1831,7 +1831,7 @@ var os = {
|
|
|
1831
1831
|
revision: !0,
|
|
1832
1832
|
password: null,
|
|
1833
1833
|
revisionsPassword: null
|
|
1834
|
-
}), ls = class extends
|
|
1834
|
+
}), ls = class extends Pe {
|
|
1835
1835
|
isWindowsAllowed() {
|
|
1836
1836
|
return this._isPropertyAllowed("windows");
|
|
1837
1837
|
}
|
|
@@ -1865,7 +1865,7 @@ var os = {
|
|
|
1865
1865
|
return !0;
|
|
1866
1866
|
}
|
|
1867
1867
|
};
|
|
1868
|
-
(
|
|
1868
|
+
(Ht || (Ht = {})).Type = {
|
|
1869
1869
|
Number: "number",
|
|
1870
1870
|
Boolean: "boolean",
|
|
1871
1871
|
Date: "date",
|
|
@@ -1874,24 +1874,24 @@ var os = {
|
|
|
1874
1874
|
};
|
|
1875
1875
|
var hs = (e) => {
|
|
1876
1876
|
if ("string" == typeof e) return {
|
|
1877
|
-
type:
|
|
1877
|
+
type: Ht.Type.String,
|
|
1878
1878
|
value: e
|
|
1879
1879
|
};
|
|
1880
1880
|
if ("boolean" == typeof e) return {
|
|
1881
|
-
type:
|
|
1881
|
+
type: Ht.Type.Boolean,
|
|
1882
1882
|
value: e
|
|
1883
1883
|
};
|
|
1884
1884
|
if ("number" == typeof e) {
|
|
1885
1885
|
if (!Number.isFinite(e)) throw new Error("A custom property value must be a finite number.");
|
|
1886
1886
|
return {
|
|
1887
|
-
type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ?
|
|
1887
|
+
type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ? Ht.Type.Number : Ht.Type.Float,
|
|
1888
1888
|
value: e
|
|
1889
1889
|
};
|
|
1890
1890
|
}
|
|
1891
1891
|
if (e instanceof Date) {
|
|
1892
1892
|
if (isNaN(e.getTime())) throw new Error("A custom property value must be a valid date.");
|
|
1893
1893
|
return {
|
|
1894
|
-
type:
|
|
1894
|
+
type: Ht.Type.Date,
|
|
1895
1895
|
value: e.toISOString()
|
|
1896
1896
|
};
|
|
1897
1897
|
}
|
|
@@ -1911,7 +1911,7 @@ var hs = (e) => {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
getValue() {
|
|
1913
1913
|
const { type: e, value: t } = this._json;
|
|
1914
|
-
return e ===
|
|
1914
|
+
return e === Ht.Type.Date ? new Date(t) : t;
|
|
1915
1915
|
}
|
|
1916
1916
|
setValue(e) {
|
|
1917
1917
|
this._owner._assertCustomEditable(this), this._json = {
|
|
@@ -2045,13 +2045,13 @@ function ds(e) {
|
|
|
2045
2045
|
function gs(e) {
|
|
2046
2046
|
return g("error.workbook.sheetNameNotFound", { sheetName: e });
|
|
2047
2047
|
}
|
|
2048
|
-
function
|
|
2048
|
+
function _s(e, t) {
|
|
2049
2049
|
return g("chart" === t ? "error.workbook.sheetIsChart" : "macro" === t ? "error.workbook.sheetIsMacro" : "error.workbook.sheetIsDialog", { sheetName: e });
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function fs(e, t) {
|
|
2052
2052
|
return "chart" === t ? g("error.workbook.selectedIsChart", { sheetName: e }) : "macro" === t ? g("error.workbook.selectedIsMacro", { sheetName: e }) : "dialog" === t ? g("error.workbook.selectedIsDialog", { sheetName: e }) : g("error.workbook.noWorksheet");
|
|
2053
2053
|
}
|
|
2054
|
-
var ms = class extends
|
|
2054
|
+
var ms = class extends ee {
|
|
2055
2055
|
constructor(e, t, s, r) {
|
|
2056
2056
|
super(), this._add = e, this._get = t, this._addListeners = s, this._getSelected = r;
|
|
2057
2057
|
}
|
|
@@ -2084,14 +2084,14 @@ var ms = class extends Be {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
}, ps = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), ws = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
|
|
2086
2086
|
function ys(e) {
|
|
2087
|
-
const t = g(
|
|
2087
|
+
const t = g(f("workbook.defaultSheetName"), { n: e + 1 });
|
|
2088
2088
|
return "workbook.defaultSheetName" === t ? `Sheet${e + 1}` : t;
|
|
2089
2089
|
}
|
|
2090
2090
|
function Ss(e, t) {
|
|
2091
2091
|
return {
|
|
2092
|
-
...
|
|
2092
|
+
...Me,
|
|
2093
2093
|
getWorksheet: () => null,
|
|
2094
|
-
toString: () =>
|
|
2094
|
+
toString: () => U(e, t)
|
|
2095
2095
|
};
|
|
2096
2096
|
}
|
|
2097
2097
|
function bs(e, t = !1) {
|
|
@@ -2114,7 +2114,7 @@ function bs(e, t = !1) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
return e;
|
|
2116
2116
|
}
|
|
2117
|
-
var ks, Cs = "workbook.activeSheet", vs = class e extends
|
|
2117
|
+
var ks, Cs = "workbook.activeSheet", vs = class e extends Ze {
|
|
2118
2118
|
constructor(e, t, s, r) {
|
|
2119
2119
|
super(e, t, r), this._workbook = s;
|
|
2120
2120
|
}
|
|
@@ -2125,24 +2125,24 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2125
2125
|
let r = this._options;
|
|
2126
2126
|
return s && (r = {
|
|
2127
2127
|
...this._options,
|
|
2128
|
-
getOptions:
|
|
2128
|
+
getOptions: Ye(this._options?.getOptions, s)
|
|
2129
2129
|
}), new e(t, this._internal, this._workbook, r);
|
|
2130
2130
|
}
|
|
2131
2131
|
_createRange(e, t) {
|
|
2132
|
-
const s = e ? { ...e } : null, r = this._workbook, i = s ? r._getSheetRef(s.scope,
|
|
2133
|
-
if (i && !i.sheet.isIWorksheet) throw new
|
|
2132
|
+
const s = e ? { ...e } : null, r = this._workbook, i = s ? r._getSheetRef(s.scope, Ae.Visibility.VeryHidden) : null;
|
|
2133
|
+
if (i && !i.sheet.isIWorksheet) throw new _(_s(i.name, i.sheet.getKind()));
|
|
2134
2134
|
if (!i) {
|
|
2135
2135
|
const e = r._anchorWorksheet();
|
|
2136
2136
|
return delete s?.scope, Ss(s, s ? {
|
|
2137
|
-
scope:
|
|
2137
|
+
scope: ze,
|
|
2138
2138
|
...e.getEntireRange().getCoords()
|
|
2139
2139
|
} : null);
|
|
2140
2140
|
}
|
|
2141
2141
|
let o = this._options;
|
|
2142
2142
|
return t && (o = {
|
|
2143
2143
|
...this._options,
|
|
2144
|
-
getOptions:
|
|
2145
|
-
}), new Is(e,
|
|
2144
|
+
getOptions: Ye(this._options.getOptions, t)
|
|
2145
|
+
}), new Is(e, ce(i.sheet), this._workbook, o);
|
|
2146
2146
|
}
|
|
2147
2147
|
async select(e) {
|
|
2148
2148
|
const t = [];
|
|
@@ -2168,15 +2168,15 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2168
2168
|
}
|
|
2169
2169
|
getAddress(e) {
|
|
2170
2170
|
const t = this._internal.getSheet(), s = t.getEntireRange().getCoords();
|
|
2171
|
-
return
|
|
2171
|
+
return tt(this.getCoords(), {
|
|
2172
2172
|
...s,
|
|
2173
2173
|
scope: t.getName()
|
|
2174
|
-
},
|
|
2174
|
+
}, U, Xe, e);
|
|
2175
2175
|
}
|
|
2176
2176
|
toString() {
|
|
2177
2177
|
return this.getAddress();
|
|
2178
2178
|
}
|
|
2179
|
-
}, Is = class e extends
|
|
2179
|
+
}, Is = class e extends X {
|
|
2180
2180
|
constructor(e, t, s, r) {
|
|
2181
2181
|
super(e, t, r), this._workbook = s;
|
|
2182
2182
|
}
|
|
@@ -2184,17 +2184,17 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2184
2184
|
let s = this._options;
|
|
2185
2185
|
return t && (s = {
|
|
2186
2186
|
...this._options,
|
|
2187
|
-
getOptions:
|
|
2187
|
+
getOptions: Ye(this._options?.getOptions, t)
|
|
2188
2188
|
}), new vs(e, this._internal, this._workbook, s);
|
|
2189
2189
|
}
|
|
2190
2190
|
_createRange(t, s) {
|
|
2191
2191
|
const r = this._internal;
|
|
2192
|
-
if (!t) return
|
|
2193
|
-
if (r.validateCoords(t), r.getSheet().isClosed()) return
|
|
2192
|
+
if (!t) return Ge(r.getSheet(), r.getSheet().getEntireCoords());
|
|
2193
|
+
if (r.validateCoords(t), r.getSheet().isClosed()) return Ge(null, r.getSheet().getEntireCoords(), t);
|
|
2194
2194
|
let i = this._options;
|
|
2195
2195
|
return s && (i = {
|
|
2196
2196
|
...this._options,
|
|
2197
|
-
getOptions:
|
|
2197
|
+
getOptions: Ye(this._options?.getOptions, s)
|
|
2198
2198
|
}), new e(t, this._internal, this._workbook, i);
|
|
2199
2199
|
}
|
|
2200
2200
|
addListener(e, t) {
|
|
@@ -2207,7 +2207,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
getAddress(e) {
|
|
2209
2209
|
const t = this._internal.getSheet(), s = t?.getEntireRange().getCoords() ?? null;
|
|
2210
|
-
return
|
|
2210
|
+
return U(this.getCoords(), {
|
|
2211
2211
|
...s,
|
|
2212
2212
|
scope: t.getName()
|
|
2213
2213
|
});
|
|
@@ -2217,13 +2217,13 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2217
2217
|
}
|
|
2218
2218
|
}, Rs = (e) => !!e && "object" == typeof e && "function" == typeof e.getOrigin, Ns = class {
|
|
2219
2219
|
constructor(t) {
|
|
2220
|
-
this._isLoadingSheets = !1, this._lastTransactionUUID = null, this._starting = null, this._closed = !1, this._listenerOriginProvider = null, this._listenerOrigin = null, this._lastOriginName = null, this._initializing = !0, this._pivotCaches = [], this._pivotTableCollection = new
|
|
2220
|
+
this._isLoadingSheets = !1, this._lastTransactionUUID = null, this._starting = null, this._closed = !1, this._listenerOriginProvider = null, this._listenerOrigin = null, this._lastOriginName = null, this._initializing = !0, this._pivotCaches = [], this._pivotTableCollection = new Qe(() => {
|
|
2221
2221
|
const e = [];
|
|
2222
|
-
for (const t of this.getWorksheets().getItems({ visibility:
|
|
2222
|
+
for (const t of this.getWorksheets().getItems({ visibility: Ae.Visibility.VeryHidden })) e.push(...t.getPivotTables());
|
|
2223
2223
|
return e;
|
|
2224
|
-
}, (e, t) => this.doBatch(e, t)), this._people = new Jt(), this._commentCollection = new
|
|
2224
|
+
}, (e, t) => this.doBatch(e, t)), this._people = new Jt(), this._commentCollection = new $(null, (e, t, s) => {
|
|
2225
2225
|
const r = [];
|
|
2226
|
-
for (const i of this.getWorksheets().getItems({ visibility:
|
|
2226
|
+
for (const i of this.getWorksheets().getItems({ visibility: Ae.Visibility.VeryHidden })) r.push(...i.getComments().getItems(e ? {
|
|
2227
2227
|
address: e,
|
|
2228
2228
|
ignoreHidden: t,
|
|
2229
2229
|
fullyContained: s
|
|
@@ -2238,21 +2238,21 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2238
2238
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2239
2239
|
}), this._locale = null, this._localeOverrides = null, this._startModules = /* @__PURE__ */ new WeakSet();
|
|
2240
2240
|
const s = "string" == typeof t ? { origin: t } : { ...t }, r = s.origin;
|
|
2241
|
-
this._ownOriginProvider = !Rs(r), this._originProvider = Rs(r) ? r : new
|
|
2241
|
+
this._ownOriginProvider = !Rs(r), this._originProvider = Rs(r) ? r : new ft("string" == typeof r ? new ut(null, { name: r }) : r ?? new ut(null)), delete s.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
|
|
2242
2242
|
const i = s.json;
|
|
2243
|
-
delete s.json, this._transactions = s.transactions ?? new p(), this._id = this._transactions.create(), this._ownTransactions = !s.transactions, this._emitter = new y(this, this._transactions), this._runtime = s.runtime ?? new
|
|
2243
|
+
delete s.json, this._transactions = s.transactions ?? new p(), this._id = this._transactions.create(), this._ownTransactions = !s.transactions, this._emitter = new y(this, this._transactions), this._runtime = s.runtime ?? new ke("Workbook Runtime", {
|
|
2244
2244
|
isDate1904: () => this._isDate1904,
|
|
2245
2245
|
getNow: () => this._transactions.getCurrentCommit().getTimestamp(),
|
|
2246
|
-
getLocale: () => this._locale ??
|
|
2246
|
+
getLocale: () => this._locale ?? re() ?? J(),
|
|
2247
2247
|
getLocaleOverrides: () => this._localeOverrides
|
|
2248
2248
|
}), this._listenerLanguage = o.addChangeListener(() => {
|
|
2249
2249
|
this._closed || this._notifyAllChange();
|
|
2250
2250
|
});
|
|
2251
|
-
const n = this, a = this._beginCommit({ description:
|
|
2251
|
+
const n = this, a = this._beginCommit({ description: f(i ? "op.openWorkbook" : "op.newWorkbook") });
|
|
2252
2252
|
try {
|
|
2253
|
-
this._strings = s.strings ?? new
|
|
2253
|
+
this._strings = s.strings ?? new qe(), this._ownStrings = !s.strings, this._richValues = s.richData ?? new _e(), this._resources = s.resources ?? new je(), this._ownResources = !s.resources, this._fetch = new es(this._resources, s.fetcher ?? new Zt()), this._createSheetName = s.createSheetNameCallback ?? ys;
|
|
2254
2254
|
let t = s.createWorksheetCallback;
|
|
2255
|
-
t || (t = (e) => new
|
|
2255
|
+
t || (t = (e) => new Re(e)), this._sheetOnNameChange = /* @__PURE__ */ new Map(), this._sheetOnVisibilityChange = /* @__PURE__ */ new Map(), this._sheetOnIndexChange = /* @__PURE__ */ new Map(), this._createSheet = (e, s, r, i, o, a, l) => {
|
|
2256
2256
|
let h = null;
|
|
2257
2257
|
const c = {
|
|
2258
2258
|
runtime: n._runtime,
|
|
@@ -2273,7 +2273,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2273
2273
|
h = t, n._addSheetRef({
|
|
2274
2274
|
name: s,
|
|
2275
2275
|
id: e,
|
|
2276
|
-
visibility: r ??
|
|
2276
|
+
visibility: r ?? Ae.Visibility.Visible,
|
|
2277
2277
|
sheetId: o,
|
|
2278
2278
|
sheet: t
|
|
2279
2279
|
}, i);
|
|
@@ -2290,7 +2290,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2290
2290
|
},
|
|
2291
2291
|
getVisibility: () => {
|
|
2292
2292
|
const e = n._getSheetRef(h);
|
|
2293
|
-
return e ? e.visibility :
|
|
2293
|
+
return e ? e.visibility : Ae.Visibility.Visible;
|
|
2294
2294
|
},
|
|
2295
2295
|
setVisibility: (e, t) => {
|
|
2296
2296
|
n._setSheetVisibility(h, e, t);
|
|
@@ -2301,10 +2301,10 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2301
2301
|
duplicate: () => n._duplicateSheet(h),
|
|
2302
2302
|
getIndex: () => {
|
|
2303
2303
|
const e = n._getSheetRef(h);
|
|
2304
|
-
return e ? n._getOffsetForId(e.id, n._getSheetRefs(
|
|
2304
|
+
return e ? n._getOffsetForId(e.id, n._getSheetRefs(Ae.Visibility.VeryHidden)) : i;
|
|
2305
2305
|
},
|
|
2306
2306
|
setIndex: (e, t) => {
|
|
2307
|
-
const s = n._getSheetRef(h,
|
|
2307
|
+
const s = n._getSheetRef(h, Ae.Visibility.VeryHidden);
|
|
2308
2308
|
return !!s && (n._moveSheet(s, e, t), !0);
|
|
2309
2309
|
},
|
|
2310
2310
|
setIndexCallback: (t) => {
|
|
@@ -2314,16 +2314,16 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
};
|
|
2316
2316
|
return a && (c.json = a), void 0 !== l && (c.uid = () => l), h = t(c, s, i, r), h;
|
|
2317
|
-
}, this._namedTableSource = new
|
|
2318
|
-
getSheets: () => n._sheets ? n.getWorksheets().getItems({ visibility:
|
|
2317
|
+
}, this._namedTableSource = new De({
|
|
2318
|
+
getSheets: () => n._sheets ? n.getWorksheets().getItems({ visibility: Ae.Visibility.VeryHidden }) : c.EmptyArray,
|
|
2319
2319
|
addSheetsListener: (e, t) => n.addListeners({ onSheetsChange: e }, t)
|
|
2320
|
-
}), this._names = s.names ?? new
|
|
2320
|
+
}), this._names = s.names ?? new le({
|
|
2321
2321
|
addressToRanges: (e) => n.getRanges(e),
|
|
2322
2322
|
getCurrentScope: () => n.getSelectedWorksheet()?.getName() ?? null,
|
|
2323
2323
|
isReadOnly: () => (n._options.readonly ?? !1) || n._isStructureProtected(),
|
|
2324
2324
|
transactions: n._transactions,
|
|
2325
2325
|
getSources: () => n._calculation ? [n._calculation.getNamedFormulas(), n._namedTableSource] : c.EmptyArray
|
|
2326
|
-
}), this._ownNames = !s.names, this._calculation = s.calculation ?? new
|
|
2326
|
+
}), this._ownNames = !s.names, this._calculation = s.calculation ?? new Le({
|
|
2327
2327
|
runtime: n._runtime,
|
|
2328
2328
|
functions: s.functions,
|
|
2329
2329
|
json: i?.calc,
|
|
@@ -2342,9 +2342,9 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2342
2342
|
getSheetIndex: (e) => {
|
|
2343
2343
|
if (void 0 === e) {
|
|
2344
2344
|
const e = n.getSelectedSheet();
|
|
2345
|
-
return e ? this._getSheetRefs(
|
|
2345
|
+
return e ? this._getSheetRefs(Ae.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
|
|
2346
2346
|
}
|
|
2347
|
-
const t = this._getSheetRefs(
|
|
2347
|
+
const t = this._getSheetRefs(Ae.Visibility.VeryHidden);
|
|
2348
2348
|
e = e.toLowerCase();
|
|
2349
2349
|
const s = t.length;
|
|
2350
2350
|
for (let r = 0; r < s; r++) if (t[r].name.toLowerCase() === e) return r;
|
|
@@ -2354,7 +2354,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2354
2354
|
if (!t || 0 === t.length) return -1;
|
|
2355
2355
|
let s = (t[0].getRanges?.()?.getCoords()?.[0])?.scope;
|
|
2356
2356
|
if (!s) return -1;
|
|
2357
|
-
const r = this._getSheetRefs(
|
|
2357
|
+
const r = this._getSheetRefs(Ae.Visibility.VeryHidden);
|
|
2358
2358
|
s = s.toLowerCase();
|
|
2359
2359
|
const i = r.length;
|
|
2360
2360
|
for (let e = 0; e < i; e++) if (r[e].name.toLowerCase() === s) return e;
|
|
@@ -2363,7 +2363,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2363
2363
|
}
|
|
2364
2364
|
return -1;
|
|
2365
2365
|
},
|
|
2366
|
-
getSheetCount: () => n._getSheetRefs(
|
|
2366
|
+
getSheetCount: () => n._getSheetRefs(Ae.Visibility.VeryHidden).length,
|
|
2367
2367
|
externalBooks: i?.externalBooks,
|
|
2368
2368
|
externalBookResolver: s.externalBookResolver,
|
|
2369
2369
|
namedCollection: n._names,
|
|
@@ -2373,7 +2373,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2373
2373
|
},
|
|
2374
2374
|
fetch: (e, t) => n._fetch.fetch(e, t),
|
|
2375
2375
|
parseText: (t, s) => (async (t, s, r) => {
|
|
2376
|
-
const i = await import("./
|
|
2376
|
+
const i = await import("./C3Q-fjiZZ15waCq_.js").then((t) => e(t.default, 1)), o = (i.default ?? i).parse(s, {
|
|
2377
2377
|
delimiter: r?.delimiter ?? ",",
|
|
2378
2378
|
skipEmptyLines: !1
|
|
2379
2379
|
}).data;
|
|
@@ -2387,7 +2387,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2387
2387
|
const s = o[e], r = new Array(l);
|
|
2388
2388
|
for (let e = 0; e < l; e++) {
|
|
2389
2389
|
const i = s[e];
|
|
2390
|
-
r[e] = void 0 === i || "" === i ? null :
|
|
2390
|
+
r[e] = void 0 === i || "" === i ? null : rt(t, i).value;
|
|
2391
2391
|
}
|
|
2392
2392
|
h[e] = r;
|
|
2393
2393
|
}
|
|
@@ -2399,7 +2399,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2399
2399
|
}), this._ownCalculation = !s.calculation, this._scripts = this._createScripts(i?.modules), this._ownNames = !s.names, this._options = Object.freeze({ ...s });
|
|
2400
2400
|
const r = i?.sheets?.length ? i.sheets.map((e) => e.name) : [this._createSheetName(0)], o = r.map((e) => e + "-" + c.uuidV4()), l = (e) => {
|
|
2401
2401
|
const t = i?.sheets?.[e]?.kind;
|
|
2402
|
-
return !!t && t !==
|
|
2402
|
+
return !!t && t !== Ae.Kind.Worksheet;
|
|
2403
2403
|
};
|
|
2404
2404
|
this._calculation._setSheets(r.map((e, t) => l(t) ? [
|
|
2405
2405
|
o[t],
|
|
@@ -2445,7 +2445,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2445
2445
|
let e = this._getSheetRefs();
|
|
2446
2446
|
for (let t = (e ? e.length : 0) - 1; t >= 0; t--);
|
|
2447
2447
|
const t = this._options;
|
|
2448
|
-
this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new
|
|
2448
|
+
this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new de().getDefaultTheme(), this._styles = t?.styles ?? new ue(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new ns()), this._listenerProtection?.(), this._protection = new ls(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
|
|
2449
2449
|
s._emitter.notify("onProtectionChange");
|
|
2450
2450
|
} });
|
|
2451
2451
|
const s = this;
|
|
@@ -2508,7 +2508,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2508
2508
|
}
|
|
2509
2509
|
setView(e) {
|
|
2510
2510
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2511
|
-
if (!e) throw new
|
|
2511
|
+
if (!e) throw new _(g("error.sheet.emptyView"));
|
|
2512
2512
|
this._listenerWorkbookView?.();
|
|
2513
2513
|
const t = this;
|
|
2514
2514
|
let s = -1;
|
|
@@ -2563,10 +2563,10 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2563
2563
|
return this._transactions;
|
|
2564
2564
|
}
|
|
2565
2565
|
getChanges(e) {
|
|
2566
|
-
const t = this._transactions, [s, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], o = this.getWorksheets().getItems({ visibility:
|
|
2566
|
+
const t = this._transactions, [s, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], o = this.getWorksheets().getItems({ visibility: Ae.Visibility.VeryHidden });
|
|
2567
2567
|
for (let e = 0; e < o.length; e++) {
|
|
2568
2568
|
const t = o[e];
|
|
2569
|
-
t instanceof
|
|
2569
|
+
t instanceof Re && i.push(...t._changeEventsOf(s, r ?? null));
|
|
2570
2570
|
}
|
|
2571
2571
|
return i;
|
|
2572
2572
|
}
|
|
@@ -2597,7 +2597,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
setTheme(e) {
|
|
2599
2599
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2600
|
-
if (!e) throw new
|
|
2600
|
+
if (!e) throw new _(g("error.workbook.notSetValue"));
|
|
2601
2601
|
const t = this._theme;
|
|
2602
2602
|
return this._theme = e, this.getStyles().setTheme(e), this._emitter.notify("onThemeChange"), t;
|
|
2603
2603
|
}
|
|
@@ -2619,7 +2619,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2619
2619
|
return this.getSelectedWorksheet();
|
|
2620
2620
|
}
|
|
2621
2621
|
getSheets(e) {
|
|
2622
|
-
const t = this._getSheetRefs(e?.visibility ??
|
|
2622
|
+
const t = this._getSheetRefs(e?.visibility ?? Ae.Visibility.Visible), s = new Array(t.length);
|
|
2623
2623
|
for (let e = 0; e < t.length; e++) s[e] = t[e].sheet;
|
|
2624
2624
|
return s;
|
|
2625
2625
|
}
|
|
@@ -2630,16 +2630,16 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2630
2630
|
if (!t) throw new a(gs(e));
|
|
2631
2631
|
return t.sheet;
|
|
2632
2632
|
}
|
|
2633
|
-
getWorksheet(e, t =
|
|
2633
|
+
getWorksheet(e, t = Ae.Visibility.Visible) {
|
|
2634
2634
|
if ("number" == typeof e) return this.getWorksheetAt(e, t);
|
|
2635
2635
|
if (void 0 === e) return this._requireSelectedWorksheet();
|
|
2636
2636
|
if (!e) throw new Error(g("error.workbook.sheetNameNotProvided"));
|
|
2637
2637
|
const s = this._getSheetRef(e, t);
|
|
2638
2638
|
if (!s) throw new a(gs(e));
|
|
2639
|
-
if (!xs(s)) throw new a(
|
|
2639
|
+
if (!xs(s)) throw new a(_s(s.name, s.sheet.getKind()));
|
|
2640
2640
|
return s.sheet;
|
|
2641
2641
|
}
|
|
2642
|
-
getWorksheetAt(e, t =
|
|
2642
|
+
getWorksheetAt(e, t = Ae.Visibility.Visible) {
|
|
2643
2643
|
const s = this._getWorksheets(t)[e];
|
|
2644
2644
|
if (!s) throw new a(function(e) {
|
|
2645
2645
|
return g("error.workbook.sheetIndexNotFound", { index: e });
|
|
@@ -2650,10 +2650,10 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2650
2650
|
const e = this.getSelectedWorksheet();
|
|
2651
2651
|
if (e) return e;
|
|
2652
2652
|
const t = this.getSelectedSheet();
|
|
2653
|
-
throw new
|
|
2653
|
+
throw new _(fs(t?.getName() ?? "", t?.getKind() ?? Ae.Kind.Worksheet));
|
|
2654
2654
|
}
|
|
2655
2655
|
_anchorWorksheet() {
|
|
2656
|
-
return this.getSelectedWorksheet() || (this._getWorksheets(
|
|
2656
|
+
return this.getSelectedWorksheet() || (this._getWorksheets(Ae.Visibility.VeryHidden)[0] ?? null);
|
|
2657
2657
|
}
|
|
2658
2658
|
getWorksheets() {
|
|
2659
2659
|
return this._sheets;
|
|
@@ -2661,7 +2661,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2661
2661
|
addWorksheet(e) {
|
|
2662
2662
|
return this.getWorksheets().add(e);
|
|
2663
2663
|
}
|
|
2664
|
-
_getWorksheets(e =
|
|
2664
|
+
_getWorksheets(e = Ae.Visibility.Visible) {
|
|
2665
2665
|
const t = this._getSheetRefs(e), s = [], r = t.length;
|
|
2666
2666
|
for (let e = 0; e < r; e++) {
|
|
2667
2667
|
const r = t[e];
|
|
@@ -2669,17 +2669,17 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2669
2669
|
}
|
|
2670
2670
|
return s;
|
|
2671
2671
|
}
|
|
2672
|
-
_getSheetRefs(e =
|
|
2672
|
+
_getSheetRefs(e = Ae.Visibility.Visible) {
|
|
2673
2673
|
const t = this._getState();
|
|
2674
|
-
return t ? e ===
|
|
2674
|
+
return t ? e === Ae.Visibility.Visible ? t.sheetRefsVisible : e === Ae.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === Ae.Visibility.VeryHidden ? t.sheetRefsAll : c.EmptyArray : [];
|
|
2675
2675
|
}
|
|
2676
|
-
_getSheetRef(e, t =
|
|
2676
|
+
_getSheetRef(e, t = Ae.Visibility.Visible) {
|
|
2677
2677
|
let s = null;
|
|
2678
2678
|
return "number" == typeof e ? this._getSheetRefs(t)[e] : ("string" == typeof e ? s = this._getState().refsByLowerCaseName.get(e.toLowerCase()) : !0 === e?.isISheet ? s = this._getState().refsByInstance.get(e) : void 0 !== e?.id && (s = this._getState().refsById.get(e.id)), s);
|
|
2679
2679
|
}
|
|
2680
2680
|
_validateNewSheetName(e, t = !0) {
|
|
2681
2681
|
if (null == e) return e;
|
|
2682
|
-
if (bs(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new
|
|
2682
|
+
if (bs(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new _(g("error.workbook.nameTaken"));
|
|
2683
2683
|
return e.substring(0, 31);
|
|
2684
2684
|
}
|
|
2685
2685
|
findValidSheetName(e) {
|
|
@@ -2715,7 +2715,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2715
2715
|
let s, r = null;
|
|
2716
2716
|
s = "string" == typeof e ? { name: e } : "number" == typeof e ? { index: e } : e, s = {
|
|
2717
2717
|
...s,
|
|
2718
|
-
description: s?.description ??
|
|
2718
|
+
description: s?.description ?? f("op.addSheet")
|
|
2719
2719
|
};
|
|
2720
2720
|
const i = this.beginCommit(s);
|
|
2721
2721
|
try {
|
|
@@ -2734,7 +2734,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2734
2734
|
_nextSheetName(e = null) {
|
|
2735
2735
|
let t = e ? e.toLowerCase() : null;
|
|
2736
2736
|
const s = this._getState(), r = s.sheetsByLowerCaseName;
|
|
2737
|
-
if (e && r.has(t)) throw new
|
|
2737
|
+
if (e && r.has(t)) throw new _(function(e) {
|
|
2738
2738
|
return g("error.workbook.nameDuplicate", { sheetName: e });
|
|
2739
2739
|
}(e));
|
|
2740
2740
|
t = (e = this._validateNewSheetName(e)) ? e.toLowerCase() : null;
|
|
@@ -2747,8 +2747,8 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2747
2747
|
}
|
|
2748
2748
|
_addSheet(e, t = null, s = null, r) {
|
|
2749
2749
|
t = this._nextSheetName(t);
|
|
2750
|
-
const i = this._getState(), o = this._createSheet(i.lastId, t,
|
|
2751
|
-
if (!o) throw new
|
|
2750
|
+
const i = this._getState(), o = this._createSheet(i.lastId, t, Ae.Visibility.Visible, s, void 0, null, r);
|
|
2751
|
+
if (!o) throw new _(g("error.workbook.sheetNameBlank"));
|
|
2752
2752
|
return e && (this._tellSheets(), this._emitter.notify("onSheetsChange")), o;
|
|
2753
2753
|
}
|
|
2754
2754
|
_createOpaqueSheet(e, t, s, r, i, o, n, a, l) {
|
|
@@ -2767,25 +2767,25 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2767
2767
|
setName: (e, t) => {
|
|
2768
2768
|
h._setSheetName(u, e, t);
|
|
2769
2769
|
},
|
|
2770
|
-
getVisibility: () => h._getSheetRef(u,
|
|
2770
|
+
getVisibility: () => h._getSheetRef(u, Ae.Visibility.VeryHidden)?.visibility ?? Ae.Visibility.Visible,
|
|
2771
2771
|
setVisibility: (e, t) => {
|
|
2772
2772
|
h._setSheetVisibility(u, e, t);
|
|
2773
2773
|
},
|
|
2774
2774
|
getIndex: () => {
|
|
2775
|
-
const e = h._getSheetRef(u,
|
|
2776
|
-
return e ? h._getOffsetForId(e.id, h._getSheetRefs(
|
|
2775
|
+
const e = h._getSheetRef(u, Ae.Visibility.VeryHidden);
|
|
2776
|
+
return e ? h._getOffsetForId(e.id, h._getSheetRefs(Ae.Visibility.VeryHidden)) : -1;
|
|
2777
2777
|
},
|
|
2778
2778
|
setIndex: (e, t) => {
|
|
2779
|
-
const s = h._getSheetRef(u,
|
|
2779
|
+
const s = h._getSheetRef(u, Ae.Visibility.VeryHidden);
|
|
2780
2780
|
s && h._moveSheet(s, e, t);
|
|
2781
2781
|
},
|
|
2782
2782
|
requestSelect: () => h._requestSelect(u),
|
|
2783
|
-
isAttached: () => !!h._getSheetRef(u,
|
|
2783
|
+
isAttached: () => !!h._getSheetRef(u, Ae.Visibility.VeryHidden)
|
|
2784
2784
|
}
|
|
2785
2785
|
}), this._sheetOnNameChange.set(e, () => u._notify("onNameChange")), this._sheetOnVisibilityChange.set(e, () => u._notify("onVisibilityChange")), this._sheetOnIndexChange.set(e, () => u._notify("onIndexChange")), this._addSheetRef({
|
|
2786
2786
|
name: t,
|
|
2787
2787
|
id: e,
|
|
2788
|
-
visibility: s ??
|
|
2788
|
+
visibility: s ?? Ae.Visibility.Visible,
|
|
2789
2789
|
sheetId: i,
|
|
2790
2790
|
sheet: u
|
|
2791
2791
|
}, r), u;
|
|
@@ -2801,7 +2801,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2801
2801
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2802
2802
|
if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new t(g("error.workbook.protection"));
|
|
2803
2803
|
const s = e, r = [], i = [], o = s.length;
|
|
2804
|
-
for (let e = 0; e < o; e++) s[e].visibility ===
|
|
2804
|
+
for (let e = 0; e < o; e++) s[e].visibility === Ae.Visibility.Visible ? (r.push(s[e]), i.push(s[e])) : s[e].visibility === Ae.Visibility.Hidden && i.push(s[e]);
|
|
2805
2805
|
this._updateState({
|
|
2806
2806
|
sheetRefsAll: s,
|
|
2807
2807
|
sheetRefsVisible: r,
|
|
@@ -2835,21 +2835,21 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2835
2835
|
u.set(e.id, n);
|
|
2836
2836
|
const d = new Map(s.sheetsByLowerCaseName);
|
|
2837
2837
|
d.set(a, n);
|
|
2838
|
-
const
|
|
2839
|
-
let
|
|
2838
|
+
const _ = this;
|
|
2839
|
+
let f = s.listenersSheets;
|
|
2840
2840
|
if (void 0 !== n) {
|
|
2841
2841
|
const t = n.addListeners({
|
|
2842
2842
|
onBeforeDelete: (e) => {
|
|
2843
|
-
|
|
2843
|
+
_._validateDeleteSheet(e);
|
|
2844
2844
|
},
|
|
2845
2845
|
onDelete(e) {
|
|
2846
|
-
let t =
|
|
2846
|
+
let t = _._getSheetRef(e, Ae.Visibility.VeryHidden);
|
|
2847
2847
|
if (!t) return;
|
|
2848
|
-
const s =
|
|
2848
|
+
const s = _._beginCommit({ description: g("op.deleteSheet", { name: t.name }) });
|
|
2849
2849
|
try {
|
|
2850
|
-
const r =
|
|
2850
|
+
const r = _._getState(), i = r.sheetRefsAll, o = _._getOffsetForId(t.id, i);
|
|
2851
2851
|
let a = [...i];
|
|
2852
|
-
a.splice(o, 1),
|
|
2852
|
+
a.splice(o, 1), _._updateSheetRefStates(a);
|
|
2853
2853
|
const l = new Map(r.refsById);
|
|
2854
2854
|
l.delete(t.id);
|
|
2855
2855
|
const h = new Map(r.sheetsById);
|
|
@@ -2860,31 +2860,31 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2860
2860
|
d.delete(c);
|
|
2861
2861
|
const g = new Map(r.refsByInstance);
|
|
2862
2862
|
g.delete(e), r.listenersSheets.get(t.id)();
|
|
2863
|
-
const
|
|
2864
|
-
|
|
2863
|
+
const f = new Map(r.listenersSheets);
|
|
2864
|
+
f.delete(t.id), _._adjustRemoveSelectionIfRequired(o, t.id), _._adjustSheetNamesIfRequired(), _._sheetOnNameChange.delete(t.id), _._sheetOnVisibilityChange.delete(t.id), _._sheetOnIndexChange.delete(t.id), _._tellSheets(), _._emitter.notify("onSheetsChange");
|
|
2865
2865
|
const m = new Set(r.sheetsCreated);
|
|
2866
|
-
m.has(n) && m.delete(n),
|
|
2866
|
+
m.has(n) && m.delete(n), _._updateState({
|
|
2867
2867
|
refsById: l,
|
|
2868
2868
|
sheetsById: h,
|
|
2869
2869
|
refsByLowerCaseName: u,
|
|
2870
2870
|
sheetsByLowerCaseName: d,
|
|
2871
2871
|
refsByInstance: g,
|
|
2872
2872
|
sheetsCreated: m,
|
|
2873
|
-
listenersSheets:
|
|
2873
|
+
listenersSheets: f
|
|
2874
2874
|
}), s.commit();
|
|
2875
2875
|
} catch (e) {
|
|
2876
2876
|
throw s.rollback(), e;
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
}, { transactional: !0 }), r = xs(e) ? e.sheet.addListeners({ onSelectionChange: (e) => {
|
|
2880
|
-
|
|
2881
|
-
source:
|
|
2880
|
+
_.getView().getActiveSheetId() === _._getSheetRef(e)?.id && _._emitter.notify("onSelectionChange", {
|
|
2881
|
+
source: _,
|
|
2882
2882
|
params: e
|
|
2883
2883
|
});
|
|
2884
2884
|
} }, { transactional: !1 }) : null, i = () => {
|
|
2885
2885
|
t(), r?.();
|
|
2886
2886
|
};
|
|
2887
|
-
|
|
2887
|
+
f = new Map(s.listenersSheets), f.set(e.id, i);
|
|
2888
2888
|
}
|
|
2889
2889
|
let m = s.lastId;
|
|
2890
2890
|
-1 !== m && (m = Math.max(m, e.id)), this._updateState({ lastId: m }), this._updateState({
|
|
@@ -2893,7 +2893,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2893
2893
|
refsByInstance: c,
|
|
2894
2894
|
sheetsById: u,
|
|
2895
2895
|
sheetsByLowerCaseName: d,
|
|
2896
|
-
listenersSheets:
|
|
2896
|
+
listenersSheets: f
|
|
2897
2897
|
}), this._adjustSheetNamesIfRequired();
|
|
2898
2898
|
const p = new Set(this._getState().sheetsCreated);
|
|
2899
2899
|
return p.add(e.sheet), this._updateState({ sheetsCreated: p }), this._tellSheets(), e;
|
|
@@ -2932,27 +2932,27 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2932
2932
|
let s = this._view.getActiveSheetId();
|
|
2933
2933
|
s ?? (this._view.setActiveSheetId(t), s = t);
|
|
2934
2934
|
let r = e.refsById.get(s);
|
|
2935
|
-
r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), s = t), r.visibility ===
|
|
2935
|
+
r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), s = t), r.visibility === Ae.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(s, e.sheetRefsVisible));
|
|
2936
2936
|
}
|
|
2937
2937
|
_validateDeleteSheet(e) {
|
|
2938
2938
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2939
2939
|
if (!this.getProtection().isStructureAllowed()) throw new t(g("error.workbook.protection"));
|
|
2940
2940
|
let s = this._getSheetRef(e);
|
|
2941
|
-
if (!s) throw new
|
|
2941
|
+
if (!s) throw new _(function(e) {
|
|
2942
2942
|
return g("error.workbook.deleteKey", { key: e });
|
|
2943
2943
|
}(e));
|
|
2944
2944
|
const r = this._getState().sheetRefsVisible;
|
|
2945
|
-
if (1 === r.length && r[0].id === s.id) throw new
|
|
2945
|
+
if (1 === r.length && r[0].id === s.id) throw new _(g("error.workbook.sheetOne"));
|
|
2946
2946
|
}
|
|
2947
2947
|
_getOffsetForId(e, t) {
|
|
2948
2948
|
const s = t.length;
|
|
2949
2949
|
for (let r = 0; r < s; r++) if (t[r].id === e) return r;
|
|
2950
|
-
throw new
|
|
2950
|
+
throw new _(g("error.workbook.noVisibleRefs"));
|
|
2951
2951
|
}
|
|
2952
2952
|
find(e) {
|
|
2953
2953
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
2954
2954
|
const t = this._getWorksheets();
|
|
2955
|
-
if (0 === t.length) return { next: () =>
|
|
2955
|
+
if (0 === t.length) return { next: () => te };
|
|
2956
2956
|
if (1 === t.length) return t[0].find(e);
|
|
2957
2957
|
"string" == typeof e && (e = { text: e });
|
|
2958
2958
|
const s = !e?.reverse;
|
|
@@ -2971,24 +2971,24 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2971
2971
|
rowIndex: t[0].rowStart
|
|
2972
2972
|
};
|
|
2973
2973
|
}
|
|
2974
|
-
const
|
|
2974
|
+
const _ = d.createCellComparator(e?.axis, e?.reverse);
|
|
2975
2975
|
delete (e = { ...e }).from;
|
|
2976
|
-
const
|
|
2976
|
+
const f = () => {
|
|
2977
2977
|
if (!u && c.done && (a && o === i ? u = !0 : s ? (o++, o > t.length - 1 && (o = 0, a = !0)) : (o--, o < 0 && (o = t.length - 1, a = !0)), r && a && (u = !0), u || l || !a || o !== i || (u = !0), !u)) {
|
|
2978
2978
|
n = t[o], h = n.find(e);
|
|
2979
2979
|
const s = c;
|
|
2980
2980
|
return c = h.next(), s;
|
|
2981
2981
|
}
|
|
2982
|
-
if (!u && a && o === i && (c.done || !l || !c.done &&
|
|
2982
|
+
if (!u && a && o === i && (c.done || !l || !c.done && _(c.value.getCoords(), l) >= 0) && (u = !0), u) {
|
|
2983
2983
|
const e = c;
|
|
2984
|
-
return c =
|
|
2984
|
+
return c = te, e;
|
|
2985
2985
|
}
|
|
2986
2986
|
const d = c;
|
|
2987
2987
|
return c = h.next(), d;
|
|
2988
2988
|
};
|
|
2989
2989
|
return { next: () => {
|
|
2990
|
-
let e =
|
|
2991
|
-
for (; !u && e.done;) e =
|
|
2990
|
+
let e = f();
|
|
2991
|
+
for (; !u && e.done;) e = f();
|
|
2992
2992
|
return e;
|
|
2993
2993
|
} };
|
|
2994
2994
|
}
|
|
@@ -2996,24 +2996,24 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
2996
2996
|
let r = 0, i = null;
|
|
2997
2997
|
const o = "function" == typeof t, n = s?.maxCount ?? Number.MAX_SAFE_INTEGER, a = !s?.maxCount;
|
|
2998
2998
|
let l = "";
|
|
2999
|
-
const h = "string" == typeof t ?
|
|
3000
|
-
let c = s?.description ??
|
|
2999
|
+
const h = "string" == typeof t ? G(t) : null;
|
|
3000
|
+
let c = s?.description ?? f("op.replace");
|
|
3001
3001
|
const u = this._transactions.beginCommit({ description: c });
|
|
3002
3002
|
try {
|
|
3003
|
-
let c = null, d = null,
|
|
3004
|
-
for (; !
|
|
3005
|
-
const n =
|
|
3003
|
+
let c = null, d = null, _ = e.next();
|
|
3004
|
+
for (; !_.done && r < n;) {
|
|
3005
|
+
const n = _.value, a = n.getWorksheet();
|
|
3006
3006
|
a !== c && (c = a, null !== d && d.apply(), d = c.getEntireRange().createSparseBuilder({
|
|
3007
3007
|
axis: s?.axis,
|
|
3008
3008
|
allowUnorderedWrites: !0
|
|
3009
3009
|
}));
|
|
3010
3010
|
const l = o ? t(n) : t;
|
|
3011
|
-
void 0 !== l && l !== n && (d.push(n, l), r++, i = n),
|
|
3011
|
+
void 0 !== l && l !== n && (d.push(n, l), r++, i = n), _ = e.next();
|
|
3012
3012
|
}
|
|
3013
|
-
d?.apply(), 1 === r && 1 === n && i && (l = i.getAddress()), 0 === r ? u.rollback() : u.commit({ description: s?.description ?? (a ? null !== h ? g("op.replaceAllWith", { value: h }) :
|
|
3013
|
+
d?.apply(), 1 === r && 1 === n && i && (l = i.getAddress()), 0 === r ? u.rollback() : u.commit({ description: s?.description ?? (a ? null !== h ? g("op.replaceAllWith", { value: h }) : f("op.replaceAll") : l ? null !== h ? g("op.replaceAtWith", {
|
|
3014
3014
|
address: l,
|
|
3015
3015
|
value: h
|
|
3016
|
-
}) : g("op.replaceAt", { address: l }) : null !== h ? g("op.replaceWith", { value: h }) :
|
|
3016
|
+
}) : g("op.replaceAt", { address: l }) : null !== h ? g("op.replaceWith", { value: h }) : f("op.replace")) });
|
|
3017
3017
|
} catch (e) {
|
|
3018
3018
|
throw u.rollback(), e;
|
|
3019
3019
|
}
|
|
@@ -3056,92 +3056,92 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3056
3056
|
const s = this._getSheetRefs(), r = this.getSelectedSheetIndex();
|
|
3057
3057
|
let i = null;
|
|
3058
3058
|
if (e) {
|
|
3059
|
-
if (i = this._getSheetRef(e), !i) throw new
|
|
3059
|
+
if (i = this._getSheetRef(e), !i) throw new _(ds(i));
|
|
3060
3060
|
} else i = s[r];
|
|
3061
3061
|
if (!i) return null;
|
|
3062
|
-
if (!xs(i)) throw new
|
|
3062
|
+
if (!xs(i)) throw new _((o = i.name, g("error.workbook.sheetNotDuplicable", { sheetName: o })));
|
|
3063
3063
|
var o;
|
|
3064
3064
|
const n = i.sheet, a = s.indexOf(i), l = this._strings.beginPersist(), h = this.getResources().beginPersist(), c = this.getStyles().beginPersist(), u = this._richValues.beginPersist();
|
|
3065
3065
|
let d = null;
|
|
3066
|
-
const
|
|
3066
|
+
const f = this.beginCommit(g("op.duplicateNamed", { name: n.getName() }));
|
|
3067
3067
|
try {
|
|
3068
3068
|
const e = this._getState().refsByInstance.get(n), t = await n.toJSON(), r = s.length + 1, i = this.findValidSheetName(e.name), o = this._createSheet(r, i, e.visibility, a, void 0, t);
|
|
3069
|
-
this._tellSheets(), this._emitter.notify("onSheetsChange"), d = o,
|
|
3069
|
+
this._tellSheets(), this._emitter.notify("onSheetsChange"), d = o, f.commit();
|
|
3070
3070
|
} catch (e) {
|
|
3071
|
-
throw
|
|
3071
|
+
throw f.rollback(), e;
|
|
3072
3072
|
} finally {
|
|
3073
3073
|
u.endPersist(), c.endPersist(), h.endPersist(), l.endPersist();
|
|
3074
3074
|
}
|
|
3075
3075
|
return d;
|
|
3076
3076
|
}
|
|
3077
3077
|
_createRange(e, t) {
|
|
3078
|
-
const s = e ? { ...e } : null, r = s ? this._getSheetRef(s.scope,
|
|
3079
|
-
if (r && !xs(r)) throw new
|
|
3078
|
+
const s = e ? { ...e } : null, r = s ? this._getSheetRef(s.scope, Ae.Visibility.VeryHidden) : null;
|
|
3079
|
+
if (r && !xs(r)) throw new _(_s(r.name, r.sheet.getKind()));
|
|
3080
3080
|
if (!r) {
|
|
3081
3081
|
const e = this._anchorWorksheet();
|
|
3082
3082
|
return e ? (delete s?.scope, Ss(s, s ? {
|
|
3083
|
-
scope:
|
|
3083
|
+
scope: ze,
|
|
3084
3084
|
...e.getEntireRange().getCoords()
|
|
3085
3085
|
} : null)) : void console.warn(g("error.workbook.noVisibleRefs"));
|
|
3086
3086
|
}
|
|
3087
3087
|
const i = r.sheet;
|
|
3088
3088
|
let o = null;
|
|
3089
|
-
return t && (o = { getOptions: t }), new Is(e,
|
|
3089
|
+
return t && (o = { getOptions: t }), new Is(e, ce(i), this, o);
|
|
3090
3090
|
}
|
|
3091
3091
|
_createRanges(e, t) {
|
|
3092
3092
|
const s = this._anchorWorksheet();
|
|
3093
|
-
if (!s) throw new
|
|
3093
|
+
if (!s) throw new _(fs("", Ae.Kind.Worksheet));
|
|
3094
3094
|
let r = null;
|
|
3095
|
-
return t && (r = { getOptions: t }), new vs(e,
|
|
3095
|
+
return t && (r = { getOptions: t }), new vs(e, ce(s), this, r);
|
|
3096
3096
|
}
|
|
3097
3097
|
getRange(e, t) {
|
|
3098
3098
|
if (void 0 === e) return this.getSelectedRange(t);
|
|
3099
|
-
"number" == typeof e && (e =
|
|
3099
|
+
"number" == typeof e && (e = Se(arguments), t = void 0);
|
|
3100
3100
|
try {
|
|
3101
3101
|
const s = this._rangesAddressToCoords(e);
|
|
3102
|
-
if (1 !== s.length) throw new
|
|
3102
|
+
if (1 !== s.length) throw new _(g("error.address.singleRangeOnlyAlt"));
|
|
3103
3103
|
return this._createRange(s[0], t);
|
|
3104
3104
|
} catch (t) {
|
|
3105
3105
|
if (t instanceof a) throw new a(t.message);
|
|
3106
|
-
throw new
|
|
3106
|
+
throw new _(t.message ?? pe(e));
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
3109
|
getCell(e) {
|
|
3110
3110
|
if (void 0 === e) return this.getSelectedCell();
|
|
3111
3111
|
const t = this.getRange(e);
|
|
3112
|
-
if (t.size > 1) throw new
|
|
3112
|
+
if (t.size > 1) throw new _(g("error.address.singleCellOnly"));
|
|
3113
3113
|
return t.getCell();
|
|
3114
3114
|
}
|
|
3115
3115
|
getRanges(e, t) {
|
|
3116
3116
|
const s = this._rangesAddressToCoords(e);
|
|
3117
|
-
if (0 === s.length) throw new
|
|
3117
|
+
if (0 === s.length) throw new _(pe(e));
|
|
3118
3118
|
return this._createRanges(s, t);
|
|
3119
3119
|
}
|
|
3120
3120
|
_createGraphRanges(e, t) {
|
|
3121
3121
|
const s = [], r = this.getCalculation()?.getNamedFormulas() ?? null;
|
|
3122
3122
|
for (let e = 0; e < t.length; e++) {
|
|
3123
|
-
const i = t[e], o = i.sheetName ? this._getSheetRef(i.sheetName,
|
|
3124
|
-
n && s.push(new
|
|
3123
|
+
const i = t[e], o = i.sheetName ? this._getSheetRef(i.sheetName, Ae.Visibility.VeryHidden) : null, n = o && xs(o) ? o.sheet : this._anchorWorksheet();
|
|
3124
|
+
n && s.push(new be(i, r, ce(n), null));
|
|
3125
3125
|
}
|
|
3126
3126
|
for (let t = 0; t < e.length; t++) s.push(e[t]);
|
|
3127
3127
|
const i = this._anchorWorksheet();
|
|
3128
|
-
return 0 !== s.length && i ? new vs(s,
|
|
3128
|
+
return 0 !== s.length && i ? new vs(s, ce(i), this, null) : null;
|
|
3129
3129
|
}
|
|
3130
3130
|
getAnomalies(e) {
|
|
3131
3131
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3132
|
-
const t =
|
|
3133
|
-
const t =
|
|
3132
|
+
const t = Oe(e), s = this._getWorksheets(Ae.Visibility.VeryHidden).map((e) => {
|
|
3133
|
+
const t = ce(e);
|
|
3134
3134
|
return {
|
|
3135
3135
|
bounds: t.getSheet().getEntireCoords(),
|
|
3136
3136
|
internal: t,
|
|
3137
3137
|
qualified: !0
|
|
3138
3138
|
};
|
|
3139
3139
|
});
|
|
3140
|
-
return new
|
|
3140
|
+
return new et(s, () => (this.getSelectedWorksheet() ?? this._getWorksheets(Ae.Visibility.VeryHidden)[0]).getEntireRange(), t);
|
|
3141
3141
|
}
|
|
3142
3142
|
getStats(e) {
|
|
3143
3143
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3144
|
-
const t = this._getWorksheets(
|
|
3144
|
+
const t = this._getWorksheets(Ae.Visibility.VeryHidden), s = t.length;
|
|
3145
3145
|
if (1 === s) return t[0].getStats(e);
|
|
3146
3146
|
const r = new Array(s);
|
|
3147
3147
|
for (let i = 0; i < s; i++) r[i] = t[i].getStats(e);
|
|
@@ -3170,8 +3170,8 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3170
3170
|
getSelectedCell() {
|
|
3171
3171
|
return this._requireSelectedWorksheet().getSelectedCell();
|
|
3172
3172
|
}
|
|
3173
|
-
_rangesAddressToCoords(e, t = !0, s =
|
|
3174
|
-
if (!e) throw new
|
|
3173
|
+
_rangesAddressToCoords(e, t = !0, s = Ae.Visibility.Hidden) {
|
|
3174
|
+
if (!e) throw new _(g("error.address.noAddress"));
|
|
3175
3175
|
const r = this.getSelectedWorksheet(), i = { ...(r ?? this._anchorWorksheet())?.getEntireRange().getCoords() }, o = r?.getName();
|
|
3176
3176
|
if (o && (i.scope = o), "string" == typeof e) {
|
|
3177
3177
|
const t = e.trim().toLowerCase();
|
|
@@ -3180,11 +3180,11 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3180
3180
|
"r" === t ? r.rowStart = r.rowEnd = s.rowIndex : r.colStart = r.colEnd = s.colIndex, e = r;
|
|
3181
3181
|
}
|
|
3182
3182
|
}
|
|
3183
|
-
const n = this, a =
|
|
3183
|
+
const n = this, a = ne(e, i, Ne, (e) => {
|
|
3184
3184
|
if (!t) return null;
|
|
3185
3185
|
if ("string" == typeof e) {
|
|
3186
|
-
const t =
|
|
3187
|
-
getTable: (e) =>
|
|
3186
|
+
const t = $e(e, {
|
|
3187
|
+
getTable: (e) => xe(n.getNames().getByName(e)),
|
|
3188
3188
|
getAnchor: () => r ? {
|
|
3189
3189
|
sheet: r,
|
|
3190
3190
|
coords: r.getSelectedCell().getCoords()
|
|
@@ -3194,16 +3194,16 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3194
3194
|
const s = n.getNames().getByName(e)?.getRanges?.();
|
|
3195
3195
|
if (s) return s.getCoords();
|
|
3196
3196
|
}
|
|
3197
|
-
throw new
|
|
3197
|
+
throw new _(`Invalid sheet reference '${e}'.`);
|
|
3198
3198
|
}), l = a.length;
|
|
3199
3199
|
for (let e = 0; e < l; e++) this._validateCoords(a[e], s);
|
|
3200
3200
|
return a;
|
|
3201
3201
|
}
|
|
3202
|
-
_validateCoords(e, t =
|
|
3202
|
+
_validateCoords(e, t = Ae.Visibility.Visible, s = g("error.sheet.oobRange")) {
|
|
3203
3203
|
if (null === e) return;
|
|
3204
3204
|
const r = this.getWorksheet(e.scope ?? void 0, t).getEntireRange().getCoords();
|
|
3205
3205
|
if (!d.isRangeWithinRange(e, r)) throw new a(s);
|
|
3206
|
-
if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new
|
|
3206
|
+
if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new _(g("error.address.invalidRangeInverted"));
|
|
3207
3207
|
}
|
|
3208
3208
|
_updateSheetRef(e, t) {
|
|
3209
3209
|
const s = this._getState();
|
|
@@ -3228,15 +3228,15 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3228
3228
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3229
3229
|
if (!this.getProtection().isStructureAllowed()) throw new t(g("error.workbook.protection"));
|
|
3230
3230
|
const i = this._getSheetRef(e);
|
|
3231
|
-
if (!i) throw new
|
|
3231
|
+
if (!i) throw new _(ds(e));
|
|
3232
3232
|
if (s === i.name) return i.sheet;
|
|
3233
|
-
if (null == (s = this._validateNewSheetName(s))) throw new
|
|
3233
|
+
if (null == (s = this._validateNewSheetName(s))) throw new _(g("error.workbook.sheetNameNotProvided"));
|
|
3234
3234
|
const o = Object.freeze({
|
|
3235
3235
|
...i,
|
|
3236
3236
|
name: s
|
|
3237
3237
|
});
|
|
3238
3238
|
let n = null;
|
|
3239
|
-
const a = this.beginCommit(
|
|
3239
|
+
const a = this.beginCommit(f("op.renameSheet"));
|
|
3240
3240
|
try {
|
|
3241
3241
|
const e = this._updateSheetRef(i, o);
|
|
3242
3242
|
this._adjustSheetNamesIfRequired(), this._sheetOnNameChange.forEach((e, t) => {
|
|
@@ -3247,24 +3247,24 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3247
3247
|
}
|
|
3248
3248
|
return n;
|
|
3249
3249
|
}
|
|
3250
|
-
_setSheetVisibility(e, s =
|
|
3250
|
+
_setSheetVisibility(e, s = Ae.Visibility.Visible, r) {
|
|
3251
3251
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3252
3252
|
if (!this.getProtection().isStructureAllowed()) throw new t(g("error.workbook.protection"));
|
|
3253
|
-
const i = this._getSheetRef(e,
|
|
3253
|
+
const i = this._getSheetRef(e, Ae.Visibility.VeryHidden);
|
|
3254
3254
|
if (!i) return null;
|
|
3255
3255
|
if (s === i.visibility) return;
|
|
3256
3256
|
let o = null, n = "";
|
|
3257
|
-
s ===
|
|
3257
|
+
s === Ae.Visibility.Visible ? n = f("op.unhideSheet") : s === Ae.Visibility.Hidden ? n = f("op.hideSheet") : s === Ae.Visibility.VeryHidden && (n = f("op.veryHideSheet"));
|
|
3258
3258
|
const a = this.beginCommit(n);
|
|
3259
3259
|
try {
|
|
3260
3260
|
const e = this._getState().sheetRefsVisible;
|
|
3261
|
-
if (s !==
|
|
3261
|
+
if (s !== Ae.Visibility.Visible && 1 === e.length && e[0].id === i.id) throw new _(g("error.workbook.sheetOne"));
|
|
3262
3262
|
const t = {
|
|
3263
3263
|
...i,
|
|
3264
3264
|
visibility: s
|
|
3265
3265
|
};
|
|
3266
3266
|
let n = -1;
|
|
3267
|
-
s !==
|
|
3267
|
+
s !== Ae.Visibility.Visible && (n = this._getOffsetForId(i.id, e)), o = this._updateSheetRef(i, t).sheet, s !== Ae.Visibility.Visible && this._adjustRemoveSelectionIfRequired(n, i.id), this._adjustSheetNamesIfRequired(), a.commit(r);
|
|
3268
3268
|
} catch (e) {
|
|
3269
3269
|
throw a.rollback(), e;
|
|
3270
3270
|
}
|
|
@@ -3279,7 +3279,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3279
3279
|
const o = this.beginCommit(g("op.moveSheetNamed", { name: e.name }));
|
|
3280
3280
|
try {
|
|
3281
3281
|
const t = this._getState(), n = t.sheetRefsVisible;
|
|
3282
|
-
if (s < 0 || s > n.length - 1) throw new
|
|
3282
|
+
if (s < 0 || s > n.length - 1) throw new _(`Invalid to index: ${s}`);
|
|
3283
3283
|
const a = this.getView().getActiveSheetId(), l = t.sheetRefsAll, h = this._getOffsetForId(e.id, l), c = this._getOffsetForId(n[s].id, l);
|
|
3284
3284
|
if (h === c) return;
|
|
3285
3285
|
const u = l[h];
|
|
@@ -3295,9 +3295,9 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3295
3295
|
_setSelectedSheet(e) {
|
|
3296
3296
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3297
3297
|
const t = this._getSheetRef(e);
|
|
3298
|
-
if (!t) throw new
|
|
3298
|
+
if (!t) throw new _(ds(e));
|
|
3299
3299
|
let s = null;
|
|
3300
|
-
return t.visibility !==
|
|
3300
|
+
return t.visibility !== Ae.Visibility.Visible && this._setSheetVisibility(t, Ae.Visibility.Visible), this._view.setActiveSheetId(t.id), s = t.sheet, s;
|
|
3301
3301
|
}
|
|
3302
3302
|
getProtection() {
|
|
3303
3303
|
return this._protection;
|
|
@@ -3315,7 +3315,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3315
3315
|
return this._calculation;
|
|
3316
3316
|
}
|
|
3317
3317
|
getFonts() {
|
|
3318
|
-
return
|
|
3318
|
+
return H.getShared();
|
|
3319
3319
|
}
|
|
3320
3320
|
createFormula(e, t, s) {
|
|
3321
3321
|
return this.getCalculation().createFormula(e, t, s);
|
|
@@ -3385,7 +3385,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3385
3385
|
const t = this._getSheetRef(e), s = t && xs(t) ? t.sheet : null;
|
|
3386
3386
|
return s ? s._contentAddWatch(() => null) : null;
|
|
3387
3387
|
}, s = (e) => {
|
|
3388
|
-
for (const t of this._getSheetRefs(
|
|
3388
|
+
for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) {
|
|
3389
3389
|
if (!xs(t)) continue;
|
|
3390
3390
|
const s = t.sheet;
|
|
3391
3391
|
if (s.getTables().getByName(e)) return s._contentAddWatch(() => null);
|
|
@@ -3395,14 +3395,14 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3395
3395
|
const s = this._getSheetRef(e);
|
|
3396
3396
|
return s && xs(s) ? s.sheet.getRange(t) : null;
|
|
3397
3397
|
}, i = (e) => {
|
|
3398
|
-
for (const t of this._getSheetRefs(
|
|
3398
|
+
for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) {
|
|
3399
3399
|
if (!xs(t)) continue;
|
|
3400
3400
|
const s = t.sheet.getTables().getByName(e);
|
|
3401
3401
|
if (s) return s;
|
|
3402
3402
|
}
|
|
3403
3403
|
return null;
|
|
3404
3404
|
}, o = (e, t) => {
|
|
3405
|
-
const s = this._pivotSourceNamed(e, t)?.getValue(), i = "string" == typeof s ?
|
|
3405
|
+
const s = this._pivotSourceNamed(e, t)?.getValue(), i = "string" == typeof s ? st(s) : null;
|
|
3406
3406
|
return i && /^\$?[A-Za-z]+\$?\d+(?::\$?[A-Za-z]+\$?\d+)?$/.test(i.reference) ? r(i.sheet, i.reference.replaceAll("$", "")) : null;
|
|
3407
3407
|
};
|
|
3408
3408
|
for (let n = 0; n < e.length; n++) this._getState().pivotCacheData.has(e[n].cacheId) && (e[n]._hold(t, s), e[n]._watchSource(r, i, o));
|
|
@@ -3414,7 +3414,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3414
3414
|
this._updateState((s) => ({
|
|
3415
3415
|
...s,
|
|
3416
3416
|
pivotCacheData: new Map(s.pivotCacheData).set(e, t)
|
|
3417
|
-
}),
|
|
3417
|
+
}), f("op.refreshPivotTable"));
|
|
3418
3418
|
}
|
|
3419
3419
|
};
|
|
3420
3420
|
}
|
|
@@ -3425,25 +3425,25 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3425
3425
|
if (e.isITable) return { name: e.getName() };
|
|
3426
3426
|
let s = null;
|
|
3427
3427
|
if ("string" == typeof e) {
|
|
3428
|
-
for (const t of this._getSheetRefs(
|
|
3428
|
+
for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) if (xs(t) && t.sheet.getTables().getByName(e)) return { name: e };
|
|
3429
3429
|
if (this.getNames().getByName(e)) return { name: e };
|
|
3430
3430
|
if (t.getNames().getByName(e)?.getScope()) return {
|
|
3431
3431
|
name: e,
|
|
3432
3432
|
sheet: t.getName()
|
|
3433
3433
|
};
|
|
3434
|
-
const r =
|
|
3434
|
+
const r = st(e), i = r ? this._getSheetRef(r.sheet) : null;
|
|
3435
3435
|
if (r && (!i || !xs(i))) return null;
|
|
3436
3436
|
try {
|
|
3437
3437
|
s = r ? i.sheet.getRange(r.reference) : t.getRange(e);
|
|
3438
3438
|
} catch (e) {
|
|
3439
|
-
if (!(e instanceof
|
|
3439
|
+
if (!(e instanceof _)) throw e;
|
|
3440
3440
|
return null;
|
|
3441
3441
|
}
|
|
3442
3442
|
} else s = e.isICellRange ? e : t.getRange(e);
|
|
3443
3443
|
if (!s || s.isInvalid()) return null;
|
|
3444
3444
|
const { rowStart: r, colStart: i, rowEnd: o, colEnd: n } = s.getCoords();
|
|
3445
3445
|
return {
|
|
3446
|
-
ref:
|
|
3446
|
+
ref: Ve({
|
|
3447
3447
|
rowStart: r,
|
|
3448
3448
|
colStart: i,
|
|
3449
3449
|
rowEnd: o,
|
|
@@ -3473,15 +3473,15 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3473
3473
|
}
|
|
3474
3474
|
async _refreshPivotCaches(e, t) {
|
|
3475
3475
|
const s = [];
|
|
3476
|
-
for (const t of this._getSheetRefs(
|
|
3476
|
+
for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) if (xs(t)) for (const r of t.sheet.getPivotTables().getItems()) e.has(r.getCacheId()) && s.push(r);
|
|
3477
3477
|
for (const e of s) e._assertRefreshAllowed();
|
|
3478
3478
|
for (const r of e) {
|
|
3479
3479
|
const e = this._getPivotCache(r), i = e ? await this._pivotSourceRangeOf(e._getSource()) : null;
|
|
3480
|
-
if (!e || !i) throw new
|
|
3481
|
-
if (i.getRowCount() < 2) throw new
|
|
3480
|
+
if (!e || !i) throw new _(g("error.pivotTable.refreshSourceUnsupported"));
|
|
3481
|
+
if (i.getRowCount() < 2) throw new _(g("error.pivotTable.refreshSourceTooSmall"));
|
|
3482
3482
|
i.getWorksheet()._cellBuffer?.release();
|
|
3483
3483
|
const o = e.toJSON();
|
|
3484
|
-
if (!o.fields) throw new
|
|
3484
|
+
if (!o.fields) throw new _(g("error.pivotTable.refreshSourceUnsupported"));
|
|
3485
3485
|
const { model: n, remap: a } = t.refreshPivotCache(o, t.readPivotSource(i), e._getSource() ?? void 0, this._isDate1904);
|
|
3486
3486
|
e._replace(n);
|
|
3487
3487
|
for (const e of s) e.getCacheId() === r && e._remapCache(a, t);
|
|
@@ -3492,13 +3492,13 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3492
3492
|
async _refreshPivotCachesOnLoad() {
|
|
3493
3493
|
const e = this._pivotCaches.filter((e) => !!e._getData().model?.refreshOnLoad);
|
|
3494
3494
|
if (0 === e.length) return;
|
|
3495
|
-
const s = await
|
|
3495
|
+
const s = await He.load();
|
|
3496
3496
|
for (const r of e) {
|
|
3497
3497
|
if (this._closed) return;
|
|
3498
3498
|
try {
|
|
3499
3499
|
await this._transactions.doBatch(() => this._refreshPivotCaches(/* @__PURE__ */ new Set([r.cacheId]), s));
|
|
3500
3500
|
} catch (e) {
|
|
3501
|
-
if (!(e instanceof
|
|
3501
|
+
if (!(e instanceof _ || e instanceof t)) throw e;
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
3504
3504
|
}
|
|
@@ -3510,7 +3510,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3510
3510
|
return t && xs(t) ? t.sheet.getRange(e.ref) : null;
|
|
3511
3511
|
}
|
|
3512
3512
|
if (!e.name) return null;
|
|
3513
|
-
if (!e.sheet) for (const t of this._getSheetRefs(
|
|
3513
|
+
if (!e.sheet) for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) {
|
|
3514
3514
|
if (!xs(t)) continue;
|
|
3515
3515
|
const s = t.sheet.getTables().getByName(e.name);
|
|
3516
3516
|
if (!s || s.isDeleted()) continue;
|
|
@@ -3537,7 +3537,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3537
3537
|
const s = this._getSheetRef(e);
|
|
3538
3538
|
return (s && xs(s) ? s.sheet : null)?.getPivotTables().getByName(t) ?? null;
|
|
3539
3539
|
};
|
|
3540
|
-
for (const t of this._getSheetRefs(
|
|
3540
|
+
for (const t of this._getSheetRefs(Ae.Visibility.VeryHidden)) {
|
|
3541
3541
|
if (!xs(t)) continue;
|
|
3542
3542
|
const s = t.sheet.getMovables().getItems();
|
|
3543
3543
|
for (let t = 0; t < s.length; t++) {
|
|
@@ -3547,8 +3547,8 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3547
3547
|
}
|
|
3548
3548
|
}
|
|
3549
3549
|
_fromJSON(e, t) {
|
|
3550
|
-
if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || 0 === e.sheets.length) throw new
|
|
3551
|
-
e.theme && (this._theme = new
|
|
3550
|
+
if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || 0 === e.sheets.length) throw new _(g("error.workbook.sheetOne"));
|
|
3551
|
+
e.theme && (this._theme = new q(e.theme), this._styles.setTheme(this._theme));
|
|
3552
3552
|
const s = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist(), o = this._richValues.beginPersist();
|
|
3553
3553
|
try {
|
|
3554
3554
|
s.fromJSON(e.strings), r.fromJSON(e.resources), this._fetch.adopt(this._resources.getItems()), i.fromJSON(e.styles), o.fromJSON(e.richData, {
|
|
@@ -3570,16 +3570,16 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3570
3570
|
const h = e.sheets, c = h.length;
|
|
3571
3571
|
let u = e.view.activeSheetId ?? null;
|
|
3572
3572
|
null !== u && (u = Math.min(Math.max(0, u), c - 1));
|
|
3573
|
-
let d = null,
|
|
3573
|
+
let d = null, f = null;
|
|
3574
3574
|
this._isLoadingSheets = !0;
|
|
3575
3575
|
for (let s = 0; s < c; s++) {
|
|
3576
|
-
const i = h[s], o = i.visibility ||
|
|
3577
|
-
|
|
3576
|
+
const i = h[s], o = i.visibility || Ae.Visibility.Visible, n = s;
|
|
3577
|
+
f = n, o === Ae.Visibility.Visible ? null === d && (d = n) : null !== u && u === n && (u = null);
|
|
3578
3578
|
try {
|
|
3579
|
-
const e = i.kind ??
|
|
3580
|
-
if (e !==
|
|
3579
|
+
const e = i.kind ?? Ae.Kind.Worksheet;
|
|
3580
|
+
if (e !== Ae.Kind.Worksheet) {
|
|
3581
3581
|
const a = i.sheet, l = D.fromJSON(a?.part, r.fromResourceId.bind(r));
|
|
3582
|
-
if (!l) throw new
|
|
3582
|
+
if (!l) throw new _(g("error.workbook.sheetPartMissing", { sheetName: i.name }));
|
|
3583
3583
|
this._createOpaqueSheet(n, i.name, o, s, i.sheetId, e, l, a?.tabColor ?? null, t?.[s]);
|
|
3584
3584
|
} else this._createSheet(n, i.name, o, s, i.sheetId, i.sheet, t?.[s]);
|
|
3585
3585
|
} catch (e) {
|
|
@@ -3587,8 +3587,8 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3587
3587
|
}
|
|
3588
3588
|
}
|
|
3589
3589
|
this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._holdPivotSlicers();
|
|
3590
|
-
for (const e of this._getSheetRefs(
|
|
3591
|
-
this._updateState({ lastId:
|
|
3590
|
+
for (const e of this._getSheetRefs(Ae.Visibility.VeryHidden)) xs(e) && e.sheet._tellPivots();
|
|
3591
|
+
this._updateState({ lastId: f }), e.view.activeSheetId = u ?? d, this.setView(new ns({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
|
|
3592
3592
|
const m = this;
|
|
3593
3593
|
this._protection = new ls(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
|
|
3594
3594
|
m._emitter.notify("onProtectionChange", { source: e });
|
|
@@ -3617,7 +3617,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3617
3617
|
getBuiltInFunctions: () => t._calculation?.getFunctions(),
|
|
3618
3618
|
onAdd: (e, s) => {
|
|
3619
3619
|
const r = t._calculation;
|
|
3620
|
-
r.getStatus() !==
|
|
3620
|
+
r.getStatus() !== oe.Status.Off && r.start().then(async () => {
|
|
3621
3621
|
if (t._startModules.has(s)) return;
|
|
3622
3622
|
const e = s.getFunctions().getItems({
|
|
3623
3623
|
type: "formula",
|
|
@@ -3640,7 +3640,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3640
3640
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
3641
3641
|
await Promise.resolve(this._starting);
|
|
3642
3642
|
const t = this.getCalculation();
|
|
3643
|
-
t.getStatus() !==
|
|
3643
|
+
t.getStatus() !== oe.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
|
|
3644
3644
|
const s = { sheets: [] }, r = e?.ignoreStyles ?? !1;
|
|
3645
3645
|
if (!r) {
|
|
3646
3646
|
const e = this._theme.toJSON();
|
|
@@ -3657,11 +3657,11 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3657
3657
|
try {
|
|
3658
3658
|
const t = this._getSheetRef(this.getSelectedSheetIndex()).id;
|
|
3659
3659
|
let i = t, u = null;
|
|
3660
|
-
const d = this._getState(), g = d.sheetRefsAll,
|
|
3661
|
-
for (let r = 0; r <
|
|
3660
|
+
const d = this._getState(), g = d.sheetRefsAll, _ = d.sheetsById, f = g.length;
|
|
3661
|
+
for (let r = 0; r < f; r++) {
|
|
3662
3662
|
const o = g[r], n = r + 1;
|
|
3663
3663
|
let a;
|
|
3664
|
-
const h =
|
|
3664
|
+
const h = _.get(o.id);
|
|
3665
3665
|
if (xs(o)) a = {
|
|
3666
3666
|
name: o.name,
|
|
3667
3667
|
sheet: await o.sheet.toJSON(e)
|
|
@@ -3674,7 +3674,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3674
3674
|
sheet: s
|
|
3675
3675
|
};
|
|
3676
3676
|
}
|
|
3677
|
-
void 0 !== o.sheetId && (a.sheetId = o.sheetId), o.visibility ===
|
|
3677
|
+
void 0 !== o.sheetId && (a.sheetId = o.sheetId), o.visibility === Ae.Visibility.Visible ? null === u && (u = n) : a.visibility = o.visibility, o.id === t && (i = n), s.sheets.push(a);
|
|
3678
3678
|
}
|
|
3679
3679
|
if (!r) {
|
|
3680
3680
|
const e = h.toJSON();
|
|
@@ -3698,7 +3698,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3698
3698
|
if (b.length > 0) {
|
|
3699
3699
|
const e = l ? l.toResourceId.bind(l) : () => null, t = /* @__PURE__ */ new Set();
|
|
3700
3700
|
for (const e of this.getPivotTables()) t.add(e.getCacheId());
|
|
3701
|
-
const r =
|
|
3701
|
+
const r = Ce(this);
|
|
3702
3702
|
for (let e = 0; e < r.length; e++) {
|
|
3703
3703
|
const s = r[e].toJSON()?.pivot?.cacheId;
|
|
3704
3704
|
void 0 !== s && t.add(s);
|
|
@@ -3737,7 +3737,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3737
3737
|
} catch (e) {
|
|
3738
3738
|
console.warn("error on close", e);
|
|
3739
3739
|
}
|
|
3740
|
-
this._ownResources, this._ownNames && this._names.close(), this._ownCalculation && this._calculation.close(), this._ownStyles, this._transactionsRemoveListener?.(), this._listenerLanguage?.(), this._listenerOrigin?.(), this._listenerOriginProvider?.(), this._ownOriginProvider && this._originProvider instanceof
|
|
3740
|
+
this._ownResources, this._ownNames && this._names.close(), this._ownCalculation && this._calculation.close(), this._ownStyles, this._transactionsRemoveListener?.(), this._listenerLanguage?.(), this._listenerOrigin?.(), this._listenerOriginProvider?.(), this._ownOriginProvider && this._originProvider instanceof ft && this._originProvider.release(), this._closed = !0;
|
|
3741
3741
|
}
|
|
3742
3742
|
beginCommit(e) {
|
|
3743
3743
|
if (this._closed) throw new Error(g("error.workbook.modelClosed"));
|
|
@@ -3746,7 +3746,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3746
3746
|
doBatch(e, t) {
|
|
3747
3747
|
const s = this;
|
|
3748
3748
|
t = "string" == typeof t ? { description: t } : {
|
|
3749
|
-
description:
|
|
3749
|
+
description: f("op.updateWorkbook"),
|
|
3750
3750
|
...t
|
|
3751
3751
|
};
|
|
3752
3752
|
const r = w.bind(this._transactions, this, e);
|
|
@@ -3766,7 +3766,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3766
3766
|
_getState() {
|
|
3767
3767
|
return this._transactions.getState(this._id);
|
|
3768
3768
|
}
|
|
3769
|
-
_updateState(e, t =
|
|
3769
|
+
_updateState(e, t = f("op.updateWorkbook"), s) {
|
|
3770
3770
|
if (!e) return;
|
|
3771
3771
|
const r = this._beginCommit(t);
|
|
3772
3772
|
try {
|
|
@@ -3787,7 +3787,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3787
3787
|
get isIWorkbook() {
|
|
3788
3788
|
return !0;
|
|
3789
3789
|
}
|
|
3790
|
-
}, Os = { address: null }, xs = (e) => e.sheet.getKind() ===
|
|
3790
|
+
}, Os = { address: null }, xs = (e) => e.sheet.getKind() === Ae.Kind.Worksheet, Ls = class {
|
|
3791
3791
|
constructor() {
|
|
3792
3792
|
this._readFormats = [], this._writeFormats = [], this._encryptions = [];
|
|
3793
3793
|
}
|
|
@@ -3909,7 +3909,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3909
3909
|
else if (Es(e)) {
|
|
3910
3910
|
const s = e.getPath();
|
|
3911
3911
|
if (!s) throw new Error("Cannot read from an unbound origin (no path).");
|
|
3912
|
-
|
|
3912
|
+
_t(e) ? e = {
|
|
3913
3913
|
source: s,
|
|
3914
3914
|
asCopy: !0
|
|
3915
3915
|
} : (t = e, e = { source: s });
|
|
@@ -3925,7 +3925,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
3925
3925
|
const i = t.format, o = t.ext;
|
|
3926
3926
|
if (!i && !o) throw new Error("Either format or file extension must be provided to determine read type.");
|
|
3927
3927
|
const n = (await this._registry.getReadFormats(i ? { search: i } : { ext: o }))[0];
|
|
3928
|
-
if (!n) throw new
|
|
3928
|
+
if (!n) throw new _(g("error.io.readFormatUnavailable", { format: i ?? o }));
|
|
3929
3929
|
const a = s?.typedCreateWorkbookOptions, l = a ? Object.keys(a).find((e) => e.toLowerCase() === n.key.toLowerCase()) : void 0;
|
|
3930
3930
|
let h = {
|
|
3931
3931
|
...s,
|
|
@@ -4013,7 +4013,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4013
4013
|
async writeArrayBuffer(e, t) {
|
|
4014
4014
|
if (!t?.format) throw new Error("A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).");
|
|
4015
4015
|
const s = (await this._registry.getWriteFormats({ search: t.format }))[0];
|
|
4016
|
-
if (!s) throw new
|
|
4016
|
+
if (!s) throw new _(g("error.io.writeFormatUnavailable", { format: t.format }));
|
|
4017
4017
|
return this._writeArrayBuffer(e, s, t);
|
|
4018
4018
|
}
|
|
4019
4019
|
async write(e, t, s) {
|
|
@@ -4029,13 +4029,13 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4029
4029
|
let i = "string" == typeof t ? this.getOrigin(t) : t;
|
|
4030
4030
|
const o = i.getFormat();
|
|
4031
4031
|
let n;
|
|
4032
|
-
if ((r?.format || o) && (n = (await this._registry.getWriteFormats({ search: r?.format ?? o ?? void 0 }))[0]), n || i.getPath() && i.canWrite() && i.getExtension() || (n = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !n) throw new
|
|
4032
|
+
if ((r?.format || o) && (n = (await this._registry.getWriteFormats({ search: r?.format ?? o ?? void 0 }))[0]), n || i.getPath() && i.canWrite() && i.getExtension() || (n = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !n) throw new _(g("error.io.writeFormatUnresolved"));
|
|
4033
4033
|
const a = i.getExtension();
|
|
4034
4034
|
if (r?.format && a && i.getPath() && i.canWrite() && !n.exts.includes(a)) {
|
|
4035
4035
|
const e = (await this._registry.getWriteFormats({ ext: a }))[0];
|
|
4036
4036
|
if (e && e.key !== n.key) {
|
|
4037
4037
|
const e = i.getPath().split(/[/\\]/).pop();
|
|
4038
|
-
throw new
|
|
4038
|
+
throw new _(g("error.io.writeFormatMismatch", {
|
|
4039
4039
|
format: r.format,
|
|
4040
4040
|
file: e
|
|
4041
4041
|
}));
|
|
@@ -4043,16 +4043,16 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4043
4043
|
}
|
|
4044
4044
|
if ("string" == typeof t) {
|
|
4045
4045
|
const e = i.getPath();
|
|
4046
|
-
i = new ut(
|
|
4046
|
+
i = new ut(Te(e) ? e : `${e}.${n.exts[0]}`, { format: n.key });
|
|
4047
4047
|
}
|
|
4048
|
-
const h = i.getEncryption(), c = e.getOrigin?.(), u = (i instanceof ut ? i.getPassword() : null) ?? (c instanceof ut ? c.getPassword() : null), d = i.isEncrypted() || (c?.isEncrypted() ?? !1),
|
|
4048
|
+
const h = i.getEncryption(), c = e.getOrigin?.(), u = (i instanceof ut ? i.getPassword() : null) ?? (c instanceof ut ? c.getPassword() : null), d = i.isEncrypted() || (c?.isEncrypted() ?? !1), f = void 0 !== r?.password ? r.password : u ?? (d ? void 0 : null);
|
|
4049
4049
|
let m = null;
|
|
4050
|
-
if (void 0 ===
|
|
4050
|
+
if (void 0 === f) {
|
|
4051
4051
|
if (d) {
|
|
4052
4052
|
const e = i.getName();
|
|
4053
4053
|
throw new l(e ? g("error.io.passwordRequiredSave", { name: e }) : g("error.io.passwordRequiredSaveUnnamed"));
|
|
4054
4054
|
}
|
|
4055
|
-
} else if (null !==
|
|
4055
|
+
} else if (null !== f && (m = await this._registry.getEncryption(h), !m)) throw new _(g("error.io.encryptionUnavailable"));
|
|
4056
4056
|
const p = `${i.getName() ?? g("workbook.defaultName")}.${n.exts[0]}`, w = r?.progress, y = !i.getPath() || !i.canWrite() || !!r?.prompt;
|
|
4057
4057
|
let S = !1;
|
|
4058
4058
|
const b = this;
|
|
@@ -4093,7 +4093,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4093
4093
|
}));
|
|
4094
4094
|
if (!y && !1 === t) return null;
|
|
4095
4095
|
}
|
|
4096
|
-
return C = h, m ? m.encode(u,
|
|
4096
|
+
return C = h, m ? m.encode(u, f) : u;
|
|
4097
4097
|
}
|
|
4098
4098
|
};
|
|
4099
4099
|
let I = null;
|
|
@@ -4101,12 +4101,12 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4101
4101
|
const t = this.getBackingStore();
|
|
4102
4102
|
if (!t.write) throw new Error("The active backing store is read-only (no write implementation).");
|
|
4103
4103
|
if (I = await t.write(v), I) {
|
|
4104
|
-
if (void 0 !==
|
|
4104
|
+
if (void 0 !== f && I instanceof ut && (I.setPassword(f), I.update({ encryption: m ? m.key : null })), C.length) {
|
|
4105
4105
|
const e = Vs.get(I) ?? /* @__PURE__ */ new Set();
|
|
4106
4106
|
for (const t of C) e.add(t.message);
|
|
4107
4107
|
Vs.set(I, e);
|
|
4108
4108
|
}
|
|
4109
|
-
s && I !== e.getOrigin() &&
|
|
4109
|
+
s && I !== e.getOrigin() && _t(e.getOrigin())?.setOrigin(I);
|
|
4110
4110
|
const t = k ?? e.getTransactions?.()?.getCurrentCommit() ?? null;
|
|
4111
4111
|
this._emitter.notify("onWrite", {
|
|
4112
4112
|
params: {
|
|
@@ -4121,13 +4121,13 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4121
4121
|
w?.onComplete && await Promise.resolve(w.onComplete(I));
|
|
4122
4122
|
} catch (e) {
|
|
4123
4123
|
const t = e instanceof Error ? e : new Error(String(e));
|
|
4124
|
-
if (w?.onError && await Promise.resolve(w.onError(t)), w?.onComplete && await Promise.resolve(w.onComplete(null)), t instanceof
|
|
4124
|
+
if (w?.onError && await Promise.resolve(w.onError(t)), w?.onComplete && await Promise.resolve(w.onComplete(null)), t instanceof _) throw t;
|
|
4125
4125
|
throw new Error(g("error.io.writeFailed", { reason: t.message }), { cause: e });
|
|
4126
4126
|
}
|
|
4127
4127
|
return I;
|
|
4128
4128
|
}
|
|
4129
4129
|
_stripExtension(e) {
|
|
4130
|
-
const t =
|
|
4130
|
+
const t = Te(e);
|
|
4131
4131
|
return t ? e.slice(0, e.length - t.length - 1) : e;
|
|
4132
4132
|
}
|
|
4133
4133
|
_baseName(e) {
|
|
@@ -4139,7 +4139,7 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4139
4139
|
if (!t) throw new Error("A write format must be provided.");
|
|
4140
4140
|
const r = t.handler;
|
|
4141
4141
|
if (!r) throw new Error(`Unable to resolve a write handler for '${t.key}'.`);
|
|
4142
|
-
return
|
|
4142
|
+
return z(t.key) || await Z.assertUsable("exports", 0), r(e, {
|
|
4143
4143
|
...s,
|
|
4144
4144
|
format: t.key
|
|
4145
4145
|
});
|
|
@@ -4154,13 +4154,13 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4154
4154
|
try {
|
|
4155
4155
|
i = await r(e, s);
|
|
4156
4156
|
} catch (e) {
|
|
4157
|
-
if (e instanceof
|
|
4158
|
-
throw new
|
|
4157
|
+
if (e instanceof _) throw e;
|
|
4158
|
+
throw new _(g("error.io.readFailed", {
|
|
4159
4159
|
format: t.description ?? t.key,
|
|
4160
4160
|
reason: e?.message ?? String(e)
|
|
4161
4161
|
}), { cause: e });
|
|
4162
4162
|
}
|
|
4163
|
-
return await
|
|
4163
|
+
return await K(), i;
|
|
4164
4164
|
}
|
|
4165
4165
|
get isIWorkbookIO() {
|
|
4166
4166
|
return !0;
|
|
@@ -4246,20 +4246,20 @@ var ks, Cs = "workbook.activeSheet", vs = class e extends Ue {
|
|
|
4246
4246
|
...js
|
|
4247
4247
|
]
|
|
4248
4248
|
}];
|
|
4249
|
-
async function
|
|
4250
|
-
const { Chart: s } = await import("./
|
|
4249
|
+
async function zs(e, t) {
|
|
4250
|
+
const { Chart: s } = await import("./B7OyFSpBb1eBvMVd.js");
|
|
4251
4251
|
return new s({
|
|
4252
4252
|
json: e,
|
|
4253
4253
|
getStyles: t?.getStyles
|
|
4254
4254
|
});
|
|
4255
4255
|
}
|
|
4256
|
-
var
|
|
4256
|
+
var Hs = {
|
|
4257
4257
|
showRowHeaders: !0,
|
|
4258
4258
|
showColumnHeaders: !0,
|
|
4259
4259
|
showRowStripes: !1,
|
|
4260
4260
|
showColumnStripes: !1,
|
|
4261
4261
|
showLastColumn: !0
|
|
4262
|
-
}, $s = class extends
|
|
4262
|
+
}, $s = class extends Ke {
|
|
4263
4263
|
constructor(e, t, s, r) {
|
|
4264
4264
|
super(e, t?.getProperties() ?? { name: "" }, {
|
|
4265
4265
|
rowStart: 0,
|
|
@@ -4280,11 +4280,11 @@ var zs = {
|
|
|
4280
4280
|
return "firstRowSubheading" === s ? `${e}` : "";
|
|
4281
4281
|
}
|
|
4282
4282
|
}, Us = (e, t, s, r = 5) => {
|
|
4283
|
-
const i = Math.max(3, Math.floor(r)), o = new $s(e, t, s ??
|
|
4283
|
+
const i = Math.max(3, Math.floor(r)), o = new $s(e, t, s ?? Hs, i);
|
|
4284
4284
|
return {
|
|
4285
4285
|
rows: i,
|
|
4286
4286
|
columns: 5,
|
|
4287
|
-
getStyleAt: (t, s) =>
|
|
4287
|
+
getStyleAt: (t, s) => Je(void 0, e, o, {
|
|
4288
4288
|
rowStart: t,
|
|
4289
4289
|
colStart: s,
|
|
4290
4290
|
rowEnd: t,
|
|
@@ -4294,24 +4294,24 @@ var zs = {
|
|
|
4294
4294
|
};
|
|
4295
4295
|
ks || (ks = {});
|
|
4296
4296
|
var Js, qs, Ks, Gs = null;
|
|
4297
|
-
function
|
|
4297
|
+
function Xs() {
|
|
4298
4298
|
if (!Gs) {
|
|
4299
|
-
const e = import("./
|
|
4299
|
+
const e = import("./Cl7HHR6Vc9S4n3AP.js").then((e) => e.loadScriptingDeclarations());
|
|
4300
4300
|
e.catch(() => {
|
|
4301
4301
|
Gs = null;
|
|
4302
4302
|
}), Gs = e;
|
|
4303
4303
|
}
|
|
4304
4304
|
return Gs;
|
|
4305
4305
|
}
|
|
4306
|
-
var
|
|
4306
|
+
var Zs = null;
|
|
4307
4307
|
function Qs() {
|
|
4308
|
-
if (!
|
|
4309
|
-
const e = import("./
|
|
4308
|
+
if (!Zs) {
|
|
4309
|
+
const e = import("./Cl7HHR6Vc9S4n3AP.js").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
|
|
4310
4310
|
e.catch(() => {
|
|
4311
|
-
|
|
4312
|
-
}),
|
|
4311
|
+
Zs = null;
|
|
4312
|
+
}), Zs = e;
|
|
4313
4313
|
}
|
|
4314
|
-
return
|
|
4314
|
+
return Zs;
|
|
4315
4315
|
}
|
|
4316
4316
|
Js || (Js = {}), (qs || (qs = {})).Type = {
|
|
4317
4317
|
Button: "button",
|
|
@@ -4331,7 +4331,7 @@ Js || (Js = {}), (qs || (qs = {})).Type = {
|
|
|
4331
4331
|
ComboEdit: "comboEdit",
|
|
4332
4332
|
Simple: "simple"
|
|
4333
4333
|
};
|
|
4334
|
-
var Ys = class extends
|
|
4334
|
+
var Ys = class extends Ee {
|
|
4335
4335
|
constructor(e) {
|
|
4336
4336
|
super(e);
|
|
4337
4337
|
}
|
|
@@ -4344,8 +4344,8 @@ var Ys = class extends De {
|
|
|
4344
4344
|
colEnd: (e?.size?.width ?? 5) - 1,
|
|
4345
4345
|
rowEnd: (e?.size?.height ?? 5) - 1
|
|
4346
4346
|
},
|
|
4347
|
-
getRanges: (e) => new
|
|
4347
|
+
getRanges: (e) => new it(null)
|
|
4348
4348
|
}, super._initializeOptions(e);
|
|
4349
4349
|
}
|
|
4350
|
-
}, er = "0.8.0-beta.
|
|
4351
|
-
export { jt as A, ks as C, Fs as D, qs as E, bt as F, St as I, Us as L, As as M, Et as N, Ft as O, Jt as P, rs as R, yt as S, Bs as T, at as _, ut as a, Pt as b, tr as c, Ns as d, wt as f,
|
|
4350
|
+
}, er = "0.8.0-beta.17", tr = "2026-11-05T20:39:45.590Z";
|
|
4351
|
+
export { jt as A, ks as C, Fs as D, qs as E, bt as F, St as I, Us as L, As as M, Et as N, Ft as O, Jt as P, rs as R, yt as S, Bs as T, at as _, ut as a, Pt as b, tr as c, Ns as d, wt as f, Ht as g, ct as h, ot as i, Ts as j, zs as k, ss as l, Xs as m, Ks as n, Qs as o, Ys as p, Zt as r, er as s, ns as t, nt as u, Vt as v, Ds as w, Js as x, Ps as y, kt as z };
|