@sheetxl/sdk 0.8.0-beta.10 → 0.8.0-beta.12

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.
Files changed (522) hide show
  1. package/README.md +1 -1
  2. package/browser/esm/{CYyv6uGjo10ig5FP.mjs → -Jx-jNHmtIQQfLvK.mjs} +1 -1
  3. package/browser/esm/{CdLZWVcH8cncBUPJ.mjs → 2WuhYrIpYmOR5H73.mjs} +110 -261
  4. package/browser/esm/{Cqr3knDsBvoVZ6MN.mjs → 2mIwPy2D2JUX-9wx.mjs} +2 -2
  5. package/browser/esm/B3wf5vZCsWfWsDbj.mjs +12 -0
  6. package/browser/esm/{BzLfNyc6OOShIErH.mjs → BIHrHjRGWVlJglcp.mjs} +2 -2
  7. package/browser/esm/{C9B0djuUarfNdoj0.mjs → BTFBedJMRWGvZyCE.mjs} +1 -1
  8. package/browser/esm/{Btg43M1Bf-ENDreu.mjs → BdCJNawfifyPupCP.mjs} +1 -1
  9. package/browser/esm/{ClB5ix51roQOpZEr.mjs → Bg5Di9GLNAkbqQ1P.mjs} +2877 -2067
  10. package/browser/esm/BnC4-27Igwb8oDf2.mjs +1552 -0
  11. package/browser/esm/{DhKkrCVASZ6Isvz6.mjs → Bt8_m94tBdks209L.mjs} +1 -1
  12. package/browser/esm/{zqJOaweiXE9D8RY1.mjs → BudSIfXBAsTxvu-K.mjs} +31835 -40812
  13. package/browser/esm/C9u8FUewte5ugUjH.mjs +5132 -0
  14. package/browser/esm/{Di58Ji1n--3Mgc_2.mjs → CBYMTDzMf1Vh7pkw.mjs} +1 -1
  15. package/browser/esm/CNdjyofiRu6CYOrr.mjs +12835 -0
  16. package/browser/esm/{Dtoyt8q5RyGAlxCp.mjs → CRkYR-siY2C994KV.mjs} +1 -1
  17. package/browser/esm/CTe2qfmIUEad6FJv.mjs +199 -0
  18. package/browser/esm/CUzYuYTTGsChC_kZ.mjs +8422 -0
  19. package/browser/esm/CdEO8CEee6lEhabA.mjs +117 -0
  20. package/browser/esm/CfRqiPDg6RBTg1EN.mjs +367 -0
  21. package/browser/esm/CndRBvVfQUJIYRRj.mjs +193 -0
  22. package/browser/esm/{Y79I7Sm8kjaYexhf.mjs → CwOPLXU3-9ZHGyOT.mjs} +1 -1
  23. package/browser/esm/{CjsUGJEQSbGjnH6R.mjs → Cxjxk0ncRKx80I-w.mjs} +1 -1
  24. package/browser/esm/D2RZh0O9neOsyLAE.mjs +281 -0
  25. package/browser/esm/{De175LygU7ot4nQm.mjs → D64dM68B1pKYFzdP.mjs} +2 -2
  26. package/browser/esm/{o8MFgcVXns987D6_.mjs → D9xNz46kAfXMZzp4.mjs} +6 -6
  27. package/browser/esm/{BcHmrKHwMMOlzc9_.mjs → DK899HhWX1HINMC1.mjs} +55 -55
  28. package/browser/esm/DPhGQLNGmDZwODwJ.mjs +395 -0
  29. package/browser/esm/DVroRnhi-5IDXNgM.mjs +210 -0
  30. package/browser/esm/{Bk7xxbdDpa7-sIwd.mjs → DZiivy0NmO1Vnyzk.mjs} +2 -2
  31. package/browser/esm/{CZ5oa92wZEAXebgk.mjs → DgrAuRD2qr2DvFeJ.mjs} +78 -68
  32. package/browser/esm/{D4uVlrG0xEFctsSM.mjs → DobHLF6VjHr7Xi40.mjs} +285 -67
  33. package/browser/esm/{CSx9ed1JOs7K5BXO.mjs → DwZCT7DZiiXoTweg.mjs} +2 -2
  34. package/browser/esm/DwwR3O2sEZApPSTF.mjs +86 -0
  35. package/browser/esm/Tah7cnFb_HNZdLtj.mjs +128 -0
  36. package/browser/esm/{BEAY9XgKNx-bakXW.mjs → fXWUMDhZ5yMSO629.mjs} +1 -1
  37. package/browser/esm/{BqskM7wA8oPfFQue.mjs → hCQJcmIzPDxDEv2q.mjs} +2 -2
  38. package/browser/esm/index.mjs +1294 -1008
  39. package/browser/esm/{Cgd5BnM3hg9RyUel.mjs → qO-ujUrgq6H3TQix.mjs} +1 -1
  40. package/browser/esm/w6Jea0TiclPrYZ2M.mjs +1703 -0
  41. package/browser/esm/yuhcOYw6SHQ-RCm3.mjs +114 -0
  42. package/licenses/dependencies.txt +75 -75
  43. package/node/esm/-TA0MneBDKdGhsib.mjs +8668 -0
  44. package/node/esm/B-HUPAcqvK0eeeCz.mjs +134 -0
  45. package/node/esm/BL2iiEoqxDEV2Xrg.mjs +8320 -0
  46. package/node/esm/{C6ZXsNyLXI6zA63X.mjs → BNXLOEddJ6O9gYws.mjs} +9 -9
  47. package/node/esm/{BH1v-E4Ro3bR7Znw.mjs → BSvOluusoDM4z_dx.mjs} +151 -302
  48. package/node/esm/{CD9wbvufChVYYkrI.mjs → BskP3b8vUoIOGLY6.mjs} +2 -2
  49. package/node/esm/{CnSQ7MTXAUAyBOoS.mjs → Btw4148Ot8ifhNc1.mjs} +285 -64
  50. package/node/esm/{B6D7sSetrcOWLsKj.mjs → C14-R6tifRh7pc0p.mjs} +1 -1
  51. package/node/esm/C99zzq8DImQXi4BQ.mjs +133 -0
  52. package/node/esm/{BtuY37FumvLE7EBo.mjs → CBuEu5Jk-LfaDy-H.mjs} +176 -166
  53. package/node/esm/{DdFgXl-Ux2cMBTs_.mjs → CG-qBU5BAaVz7e-P.mjs} +1 -1
  54. package/node/esm/CPI58duc0j0a-HpJ.mjs +115 -0
  55. package/node/esm/CRt3vXe6YmXzqk3H.mjs +406 -0
  56. package/node/esm/{CUUoseJmFsCf82bb.mjs → C_aL7CGS1lrNn1Ng.mjs} +1 -1
  57. package/node/esm/{D7MfcID2Wf6l6VpC.mjs → C_xf5Bz30VqiJjXn.mjs} +1 -1
  58. package/node/esm/CiIymQN6aJCul62g.mjs +610 -0
  59. package/node/esm/{B9ljpEIZg6wOTzRE.mjs → Ci_zLYmCD7e-C79O.mjs} +1 -1
  60. package/node/esm/{Bqd62L8KFgdS0Vou.mjs → CkRYLed8Mmn3giNg.mjs} +2 -2
  61. package/node/esm/D3ptRKzASqBut1DE.mjs +117 -0
  62. package/node/esm/{DefYISWfdZJFx57m.mjs → D4ROK9UwDpS6jO3Z.mjs} +1 -1
  63. package/node/esm/D8hO07ToAibIuniw.mjs +13014 -0
  64. package/node/esm/{Bh4dv6tMjXX3X4nI.mjs → DUTmDHbFbhLDT4F3.mjs} +1 -1
  65. package/node/esm/{DCplLG93GfTs1vNw.mjs → DV5CU37aEbFbWFL0.mjs} +1 -1
  66. package/node/esm/{CUQi5ZtMO02nhG0W.mjs → DdoiuKg9BKubtF1V.mjs} +1 -1
  67. package/node/esm/DggQ23jKMpwhENfa.mjs +372 -0
  68. package/node/esm/DhS6yWjrrSNIJMsn.mjs +1033 -0
  69. package/node/esm/{DMD12JUh7HJw2-jl.mjs → DhTya_mhmN53vskv.mjs} +1 -1
  70. package/node/esm/Dn1M7YWi25DeeYUb.mjs +210 -0
  71. package/node/esm/DrCf6ITcBhVOFpRj.mjs +86 -0
  72. package/node/esm/{BN9j8V9gCExMjVtJ.mjs → DxazKtROyaI51dWl.mjs} +1 -1
  73. package/node/esm/{MiU4rDOiocmJ-9Ry.mjs → Q_S1g46ZOTrdhTae.mjs} +1 -1
  74. package/node/esm/Vocy-I9dKzZMr0Ct.mjs +59323 -0
  75. package/node/esm/ZXPFcsT2zrALCZux.mjs +289 -0
  76. package/node/esm/eimUGjiIP-b8HiM6.mjs +199 -0
  77. package/node/esm/icn2nX5Z8e_3mNAv.mjs +12 -0
  78. package/node/esm/index.mjs +2808 -65678
  79. package/node/esm/lGJ42sHqg5if2bba.mjs +1770 -0
  80. package/node/esm/{Bsx9uijd4X_SKV3L.mjs → pYtP7wPyS96NQyXS.mjs} +51 -51
  81. package/package.json +6 -7
  82. package/resources/contents.json +120 -0
  83. package/resources/fonts/arial-bold-italic.hinted.json +125 -0
  84. package/resources/fonts/arial-bold-italic.metrics.json +13 -13
  85. package/resources/fonts/arial-bold-italic.rows.json +9 -0
  86. package/resources/fonts/arial-bold.hinted.json +125 -0
  87. package/resources/fonts/arial-bold.metrics.json +12 -12
  88. package/resources/fonts/arial-bold.rows.json +9 -0
  89. package/resources/fonts/arial-italic.hinted.json +125 -0
  90. package/resources/fonts/arial-italic.metrics.json +13 -13
  91. package/resources/fonts/arial-italic.rows.json +9 -0
  92. package/resources/fonts/arial-regular.hinted.json +125 -0
  93. package/resources/fonts/arial-regular.metrics.json +12 -12
  94. package/resources/fonts/arial-regular.rows.json +9 -0
  95. package/resources/fonts/calibri-bold-italic.hinted.json +122 -0
  96. package/resources/fonts/calibri-bold-italic.metrics.json +2 -2
  97. package/resources/fonts/calibri-bold-italic.rows.json +9 -0
  98. package/resources/fonts/calibri-bold.hinted.json +122 -0
  99. package/resources/fonts/calibri-bold.metrics.json +1 -1
  100. package/resources/fonts/calibri-bold.rows.json +9 -0
  101. package/resources/fonts/calibri-italic.hinted.json +121 -0
  102. package/resources/fonts/calibri-italic.metrics.json +2 -2
  103. package/resources/fonts/calibri-italic.rows.json +9 -0
  104. package/resources/fonts/calibri-regular.hinted.json +121 -0
  105. package/resources/fonts/calibri-regular.metrics.json +1 -1
  106. package/resources/fonts/calibri-regular.rows.json +9 -0
  107. package/resources/fonts/cambria-bold-italic.hinted.json +105 -0
  108. package/resources/fonts/cambria-bold-italic.metrics.json +26 -26
  109. package/resources/fonts/cambria-bold-italic.rows.json +9 -0
  110. package/resources/fonts/cambria-bold.hinted.json +108 -0
  111. package/resources/fonts/cambria-bold.metrics.json +19 -19
  112. package/resources/fonts/cambria-bold.rows.json +9 -0
  113. package/resources/fonts/cambria-italic.hinted.json +102 -0
  114. package/resources/fonts/cambria-italic.metrics.json +23 -23
  115. package/resources/fonts/cambria-italic.rows.json +9 -0
  116. package/resources/fonts/cambria-regular.hinted.json +110 -0
  117. package/resources/fonts/cambria-regular.metrics.json +18 -18
  118. package/resources/fonts/cambria-regular.rows.json +9 -0
  119. package/resources/fonts/contents.json +280 -0
  120. package/resources/fonts/courier-new-bold-italic.hinted.json +11 -0
  121. package/resources/fonts/courier-new-bold-italic.metrics.json +12 -12
  122. package/resources/fonts/courier-new-bold-italic.rows.json +9 -0
  123. package/resources/fonts/courier-new-bold.hinted.json +11 -0
  124. package/resources/fonts/courier-new-bold.metrics.json +12 -12
  125. package/resources/fonts/courier-new-bold.rows.json +9 -0
  126. package/resources/fonts/courier-new-italic.hinted.json +11 -0
  127. package/resources/fonts/courier-new-italic.metrics.json +12 -12
  128. package/resources/fonts/courier-new-italic.rows.json +9 -0
  129. package/resources/fonts/courier-new-regular.hinted.json +11 -0
  130. package/resources/fonts/courier-new-regular.metrics.json +12 -12
  131. package/resources/fonts/courier-new-regular.rows.json +9 -0
  132. package/resources/fonts/times-new-roman-bold-italic.hinted.json +125 -0
  133. package/resources/fonts/times-new-roman-bold-italic.metrics.json +15 -15
  134. package/resources/fonts/times-new-roman-bold-italic.rows.json +9 -0
  135. package/resources/fonts/times-new-roman-bold.hinted.json +125 -0
  136. package/resources/fonts/times-new-roman-bold.metrics.json +12 -12
  137. package/resources/fonts/times-new-roman-bold.rows.json +9 -0
  138. package/resources/fonts/times-new-roman-italic.hinted.json +125 -0
  139. package/resources/fonts/times-new-roman-italic.metrics.json +16 -16
  140. package/resources/fonts/times-new-roman-italic.rows.json +9 -0
  141. package/resources/fonts/times-new-roman-regular.hinted.json +125 -0
  142. package/resources/fonts/times-new-roman-regular.metrics.json +16 -16
  143. package/resources/fonts/times-new-roman-regular.rows.json +9 -0
  144. package/resources/locales/de/model.msg.json +93 -9
  145. package/resources/locales/en/model.msg.json +95 -10
  146. package/types/scripting-api.json +10809 -8021
  147. package/types/scripting-enums.json +201 -44
  148. package/types/scripting.d.ts +17030 -8666
  149. package/types/src/.generated/wasm/fonts.d.ts +161 -0
  150. package/types/src/.generated/wasm/fonts_bg.inline.d.ts +3 -0
  151. package/types/src/.generated/wasm/sdk.d.ts +122 -0
  152. package/types/src/.generated/wasm/sdk_bg.inline.d.ts +3 -0
  153. package/types/src/address/AddressUtils.d.ts +10 -1
  154. package/types/src/address/_StructuredAddress.d.ts +58 -0
  155. package/types/src/anomalies/_Anomalies.d.ts +109 -0
  156. package/types/src/anomalies/_FocusTable.d.ts +11 -0
  157. package/types/src/anomalies/_FormulaChecks.d.ts +133 -0
  158. package/types/src/anomalies/_LabelChecks.d.ts +21 -0
  159. package/types/src/anomalies/_LiteralChecks.d.ts +35 -0
  160. package/types/src/anomalies/_SeriesChecks.d.ts +13 -0
  161. package/types/src/border/IBorders.d.ts +16 -0
  162. package/types/src/calculation/Calculation.d.ts +139 -371
  163. package/types/src/calculation/ExternalBookBindings.d.ts +2 -3
  164. package/types/src/calculation/FormulaLiterals.d.ts +2 -1
  165. package/types/src/calculation/FormulaText.d.ts +18 -2
  166. package/types/src/calculation/ICalculation.d.ts +133 -18
  167. package/types/src/calculation/INamedFormulasCollection.d.ts +4 -0
  168. package/types/src/calculation/NamedFormulaCollection.d.ts +293 -22
  169. package/types/src/calculation/_CloneBoundary.d.ts +1 -1
  170. package/types/src/calculation/_FormulaToolkit.d.ts +9 -0
  171. package/types/src/calculation/_TableExtent.d.ts +60 -0
  172. package/types/src/calculation/compiler/ASTTypes.d.ts +6 -2
  173. package/types/src/calculation/compiler/CompilerUtils.d.ts +17 -0
  174. package/types/src/calculation/compiler/ParserUtils.d.ts +16 -0
  175. package/types/src/calculation/compiler/Types.d.ts +9 -1
  176. package/types/src/calculation/engine/CalcBackend.d.ts +953 -0
  177. package/types/src/calculation/engine/index.d.ts +10 -0
  178. package/types/src/calculation/executor/CalcExecutor.d.ts +94 -24
  179. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +23 -1
  180. package/types/src/calculation/executor/_WhatIf.d.ts +50 -0
  181. package/types/src/calculation/formula/Formula.d.ts +9 -0
  182. package/types/src/calculation/formula/FormulaBlock.d.ts +10 -3
  183. package/types/src/calculation/formula/IFormulaBlock.d.ts +21 -0
  184. package/types/src/calculation/formula/LambdaValue.d.ts +5 -3
  185. package/types/src/calculation/functions/FunctionDeclarations.d.ts +5 -1
  186. package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
  187. package/types/src/calculation/functions/expandDeclaration.d.ts +15 -0
  188. package/types/src/calculation/functions/initializeFunctions.d.ts +0 -12
  189. package/types/src/calculation/grid/CalcGrid.d.ts +44 -10
  190. package/types/src/calculation/grid/CalcGridBackend.d.ts +35 -27
  191. package/types/src/calculation/grid/CalcGridProxy.d.ts +2 -2
  192. package/types/src/calculation/grid/CalcGridUtils.d.ts +12 -3
  193. package/types/src/calculation/grid/FormulaHost.d.ts +51 -6
  194. package/types/src/calculation/grid/ICalcGrid.d.ts +48 -15
  195. package/types/src/calculation/grid/_CalcRequest.d.ts +28 -6
  196. package/types/src/calculation/grid/_CellValueRun.d.ts +21 -0
  197. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +29 -2
  198. package/types/src/calculation/spatial/SpillEntry.d.ts +16 -2
  199. package/types/src/calculation/state/CalcNode.d.ts +0 -1
  200. package/types/src/calculation/state/CalcScope.d.ts +44 -6
  201. package/types/src/calculation/state/CalcState.d.ts +36 -4
  202. package/types/src/calculation/state/CalculationContext.d.ts +30 -3
  203. package/types/src/calculation/state/DeferredCalls.d.ts +260 -0
  204. package/types/src/calculation/state/IContextContainer.d.ts +32 -0
  205. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +6 -0
  206. package/types/src/calculation/state/_WhatIfLayer.d.ts +91 -0
  207. package/types/src/calculation/toolkit/FormulaLiteralReader.d.ts +4 -0
  208. package/types/src/calculation/toolkit/FormulaTextParser.d.ts +10 -0
  209. package/types/src/calculation/toolkit/FunctionDeclarationTable.d.ts +4 -0
  210. package/types/src/calculation/toolkit/index.d.ts +12 -0
  211. package/types/src/cell/ICell.d.ts +302 -34
  212. package/types/src/cell/ICellHeader.d.ts +7 -6
  213. package/types/src/cell/ICellProtection.d.ts +1 -1
  214. package/types/src/cellControl/CellControl.d.ts +67 -0
  215. package/types/src/cellControl/CellControlCollection.d.ts +29 -0
  216. package/types/src/cellControl/CellControlRegistry.d.ts +47 -0
  217. package/types/src/cellControl/ICellControl.d.ts +99 -0
  218. package/types/src/cellControl/ICellControlCollection.d.ts +67 -0
  219. package/types/src/cellControl/index.d.ts +4 -0
  220. package/types/src/cellRange/ICellHeaderRange.d.ts +6 -9
  221. package/types/src/cellRange/ICellHeaderRanges.d.ts +5 -0
  222. package/types/src/cellRange/ICellRange.d.ts +525 -110
  223. package/types/src/cellRange/ICellRanges.d.ts +12 -6
  224. package/types/src/chart/Chart.d.ts +217 -15
  225. package/types/src/chart/ChartCollection.d.ts +7 -2
  226. package/types/src/chart/IChart.d.ts +1921 -35
  227. package/types/src/chart/IChartCollection.d.ts +27 -2
  228. package/types/src/chart/_ChartParts.d.ts +1066 -0
  229. package/types/src/chart/_ChartSource.d.ts +47 -0
  230. package/types/src/chart/createChart.d.ts +26 -0
  231. package/types/src/chart/index.d.ts +4 -0
  232. package/types/src/chart/kinds/ChartKind.d.ts +252 -0
  233. package/types/src/chart/kinds/_Area.d.ts +3 -0
  234. package/types/src/chart/kinds/_Bar.d.ts +4 -0
  235. package/types/src/chart/kinds/_BoxWhisker.d.ts +4 -0
  236. package/types/src/chart/kinds/_Bubble.d.ts +3 -0
  237. package/types/src/chart/kinds/_Funnel.d.ts +4 -0
  238. package/types/src/chart/kinds/_Hierarchy.d.ts +31 -0
  239. package/types/src/chart/kinds/_Histogram.d.ts +4 -0
  240. package/types/src/chart/kinds/_HitKinds.d.ts +23 -0
  241. package/types/src/chart/kinds/_Line.d.ts +4 -0
  242. package/types/src/chart/kinds/_OfPie.d.ts +4 -0
  243. package/types/src/chart/kinds/_Pie.d.ts +4 -0
  244. package/types/src/chart/kinds/_Placeholder.d.ts +6 -0
  245. package/types/src/chart/kinds/_Radar.d.ts +4 -0
  246. package/types/src/chart/kinds/_Scatter.d.ts +8 -0
  247. package/types/src/chart/kinds/_Sunburst.d.ts +4 -0
  248. package/types/src/chart/kinds/_Surface.d.ts +4 -0
  249. package/types/src/chart/kinds/_Treemap.d.ts +4 -0
  250. package/types/src/chart/kinds/_Waterfall.d.ts +18 -0
  251. package/types/src/chart/kinds/_builtIns.d.ts +11 -0
  252. package/types/src/chart/layout/ChartLayout.d.ts +829 -0
  253. package/types/src/chart/layout/TextMeasurer.d.ts +38 -0
  254. package/types/src/chart/layout/_HitGeometry.d.ts +50 -0
  255. package/types/src/chart/layout/_HitTest.d.ts +36 -0
  256. package/types/src/chart/layout/_Layout.d.ts +25 -0
  257. package/types/src/chart/layout/_LayoutUtils.d.ts +97 -0
  258. package/types/src/chart/math/BoxStats.d.ts +35 -0
  259. package/types/src/chart/math/DateUnitCalcs.d.ts +80 -0
  260. package/types/src/chart/math/DisplayUnits.d.ts +53 -0
  261. package/types/src/chart/math/Histogram.d.ts +48 -0
  262. package/types/src/chart/math/OrdUnitCalcs.d.ts +166 -0
  263. package/types/src/chart/math/Treemap.d.ts +28 -0
  264. package/types/src/chart/math/Trendlines.d.ts +71 -0
  265. package/types/src/chart/math/UnitCalcs.d.ts +98 -0
  266. package/types/src/chart/model/ChartModel.d.ts +681 -0
  267. package/types/src/chart/model/_ChartType.d.ts +14 -0
  268. package/types/src/chart/model/_Edits.d.ts +489 -0
  269. package/types/src/chart/model/_Grouping.d.ts +83 -0
  270. package/types/src/chart/model/_Inference.d.ts +52 -0
  271. package/types/src/chart/model/_ModelFacts.d.ts +112 -0
  272. package/types/src/chart/model/_NewChart.d.ts +208 -0
  273. package/types/src/chart/model/_OfPie.d.ts +18 -0
  274. package/types/src/chart/resolve/_LegacyStyles.d.ts +48 -0
  275. package/types/src/chart/resolve/_Resolve.d.ts +61 -0
  276. package/types/src/chart/resolve/_ResolvedChart.d.ts +447 -0
  277. package/types/src/collections/ISparseGrid.d.ts +11 -2
  278. package/types/src/collections/MixedTypedArrayList.d.ts +8 -2
  279. package/types/src/collections/RTree.d.ts +116 -36
  280. package/types/src/collections/SparseGrid.d.ts +9 -11
  281. package/types/src/collections/SpatialMap.d.ts +2 -8
  282. package/types/src/collections/SpatialMap3D.d.ts +2 -0
  283. package/types/src/collections/index.d.ts +1 -1
  284. package/types/src/comment/Comment.d.ts +32 -9
  285. package/types/src/comment/IComment.d.ts +41 -4
  286. package/types/src/comment/_NoteBox.d.ts +19 -2
  287. package/types/src/condition/AnchoredConditional.d.ts +30 -4
  288. package/types/src/condition/ICondition.d.ts +3 -2
  289. package/types/src/conditionalFormat/ConditionalFormat.d.ts +9 -3
  290. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -3
  291. package/types/src/dataValidation/DataValidation.d.ts +1 -1
  292. package/types/src/dataValidation/DataValidationCollection.d.ts +4 -1
  293. package/types/src/dataValidation/IDataValidation.d.ts +1 -1
  294. package/types/src/dataValidation/IDataValidationCollection.d.ts +24 -0
  295. package/types/src/documentProperties/DocumentProperties.d.ts +66 -0
  296. package/types/src/documentProperties/ICustomProperty.d.ts +69 -0
  297. package/types/src/documentProperties/IDocumentProperties.d.ts +110 -0
  298. package/types/src/documentProperties/index.d.ts +3 -0
  299. package/types/src/externalBook/IExternalBook.d.ts +3 -4
  300. package/types/src/fetch/Fetcher.d.ts +15 -0
  301. package/types/src/fetch/IFetcher.d.ts +47 -0
  302. package/types/src/fetch/_WorkbookFetch.d.ts +43 -0
  303. package/types/src/fetch/index.d.ts +3 -0
  304. package/types/src/fill/IFill.d.ts +7 -0
  305. package/types/src/fill/IFillable.d.ts +47 -0
  306. package/types/src/fill/IStroke.d.ts +15 -1
  307. package/types/src/fill/PaintUtils.d.ts +24 -0
  308. package/types/src/fill/index.d.ts +2 -0
  309. package/types/src/font/AdvanceBuilder.d.ts +34 -0
  310. package/types/src/font/AdvanceTable.d.ts +128 -14
  311. package/types/src/font/CanvasAdvanceBuilder.d.ts +54 -0
  312. package/types/src/font/FontCapture.d.ts +4 -0
  313. package/types/src/font/FontCollection.d.ts +53 -2
  314. package/types/src/font/FontPlatform.d.ts +20 -0
  315. package/types/src/font/FontUtils.d.ts +5 -0
  316. package/types/src/font/IFont.d.ts +191 -61
  317. package/types/src/font/IFontCollection.d.ts +20 -14
  318. package/types/src/font/IFontStyle.d.ts +207 -0
  319. package/types/src/font/TableFileAdvanceBuilder.d.ts +9 -0
  320. package/types/src/font/_FontUtils.d.ts +11 -4
  321. package/types/src/font/_FontsVersion.d.ts +7 -0
  322. package/types/src/font/index.d.ts +1 -3
  323. package/types/src/font/platform.browser.d.ts +15 -0
  324. package/types/src/font/platform.node.d.ts +5 -0
  325. package/types/src/group/Group.d.ts +5 -0
  326. package/types/src/group/GroupMovableCollection.d.ts +4 -0
  327. package/types/src/history/IHistory.d.ts +19 -2
  328. package/types/src/hyperlink/IHyperlink.d.ts +17 -1
  329. package/types/src/hyperlink/_Hyperlink.d.ts +4 -1
  330. package/types/src/index.d.ts +4 -0
  331. package/types/src/license/LicenseManager.d.ts +21 -0
  332. package/types/src/license/_Utils.d.ts +18 -1
  333. package/types/src/license/runtime.browser.d.ts +5 -0
  334. package/types/src/license/runtime.node.d.ts +10 -0
  335. package/types/src/listener/IListener.d.ts +14 -2
  336. package/types/src/listener/ListenerEmitter.d.ts +11 -3
  337. package/types/src/movable/IMovable.d.ts +28 -15
  338. package/types/src/movable/IMovableCollection.d.ts +1 -1
  339. package/types/src/movable/Movable.d.ts +12 -1
  340. package/types/src/movable/MovableCollection.d.ts +7 -3
  341. package/types/src/movable/_InsertableCollection.d.ts +16 -5
  342. package/types/src/named/INamed.d.ts +30 -0
  343. package/types/src/named/INamedCollection.d.ts +38 -2
  344. package/types/src/named/NamedCollection.d.ts +34 -4
  345. package/types/src/numFmt/NumberFormatParser.d.ts +5 -0
  346. package/types/src/outline/IOutline.d.ts +1 -1
  347. package/types/src/outline/Outline.d.ts +2 -2
  348. package/types/src/picture/IPicture.d.ts +98 -1
  349. package/types/src/picture/Picture.d.ts +15 -7
  350. package/types/src/pivot/IPivotTable.d.ts +2 -2
  351. package/types/src/pivot/PivotTable.d.ts +5 -5
  352. package/types/src/primitives/AsyncValue.d.ts +58 -0
  353. package/types/src/primitives/ReferenceRange.d.ts +2 -2
  354. package/types/src/print/IPageLayout.d.ts +635 -0
  355. package/types/src/print/PageLayout.d.ts +258 -0
  356. package/types/src/print/index.d.ts +1 -1
  357. package/types/src/protectedRange/IProtectedRange.d.ts +2 -2
  358. package/types/src/protection/IProtection.d.ts +6 -0
  359. package/types/src/protection/PasswordHasher.d.ts +13 -0
  360. package/types/src/resource/IResource.d.ts +9 -0
  361. package/types/src/resource/IResourceCollection.d.ts +4 -0
  362. package/types/src/resource/Resource.d.ts +2 -0
  363. package/types/src/resource/_AddResource.d.ts +13 -0
  364. package/types/src/richData/CellImage.d.ts +95 -0
  365. package/types/src/richData/Hyperlink.d.ts +49 -0
  366. package/types/src/richData/IRichDataCollection.d.ts +76 -0
  367. package/types/src/richData/IRichDataKind.d.ts +66 -0
  368. package/types/src/richData/RichArray.d.ts +42 -0
  369. package/types/src/richData/RichDataCollection.d.ts +23 -0
  370. package/types/src/richData/RichDataRegistry.d.ts +89 -0
  371. package/types/src/richData/RichDataValues.d.ts +20 -0
  372. package/types/src/richData/RichRecord.d.ts +68 -0
  373. package/types/src/richData/RichText.d.ts +59 -0
  374. package/types/src/richData/index.d.ts +9 -0
  375. package/types/src/scripting/FunctionArguments.d.ts +17 -1
  376. package/types/src/scripting/FunctionCollection.d.ts +8 -0
  377. package/types/src/scripting/IModule.d.ts +3 -3
  378. package/types/src/scripting/IScript.d.ts +2 -2
  379. package/types/src/scripting/ITypedFunction.d.ts +1 -1
  380. package/types/src/scripting/Scripts.d.ts +10 -0
  381. package/types/src/scripting/TypedFunction.d.ts +2 -0
  382. package/types/src/scripting/declarations.d.ts +3 -0
  383. package/types/src/selection/ChartElementSelection.d.ts +39 -0
  384. package/types/src/selection/IChartElementSelection.d.ts +103 -0
  385. package/types/src/selection/IItemSelection.d.ts +131 -0
  386. package/types/src/selection/IMovableSelection.d.ts +6 -34
  387. package/types/src/selection/IRangeSelection.d.ts +4 -4
  388. package/types/src/selection/ItemSelection.d.ts +49 -0
  389. package/types/src/selection/MovableSelection.d.ts +11 -30
  390. package/types/src/selection/RangeSelection.d.ts +4 -4
  391. package/types/src/selection/index.d.ts +3 -0
  392. package/types/src/shape/IShape.d.ts +2 -1
  393. package/types/src/shape/IShapeStyle.d.ts +5 -31
  394. package/types/src/shape/ITextBoxStyle.d.ts +85 -0
  395. package/types/src/shape/ShapeStyleUtils.d.ts +13 -1
  396. package/types/src/shape/_Connectors.d.ts +9 -9
  397. package/types/src/shape/_ShapeStyle.d.ts +9 -0
  398. package/types/src/shape/index.d.ts +1 -0
  399. package/types/src/sheet/CellRegion.d.ts +37 -3
  400. package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
  401. package/types/src/sheet/IOpaqueSheet.d.ts +46 -0
  402. package/types/src/sheet/ISheet.d.ts +81 -1078
  403. package/types/src/sheet/IWorksheet.d.ts +1521 -0
  404. package/types/src/sheet/{ISheetCollection.d.ts → IWorksheetCollection.d.ts} +37 -12
  405. package/types/src/sheet/NamedCellRange.d.ts +2 -2
  406. package/types/src/sheet/NamedRange.d.ts +2 -2
  407. package/types/src/sheet/OpaqueSheet.d.ts +114 -0
  408. package/types/src/sheet/SheetCell.d.ts +40 -27
  409. package/types/src/sheet/SheetRange.d.ts +50 -13
  410. package/types/src/sheet/SheetRanges.d.ts +14 -12
  411. package/types/src/sheet/{Sheet.d.ts → Worksheet.d.ts} +591 -171
  412. package/types/src/sheet/WorksheetCollection.d.ts +39 -0
  413. package/types/src/sheet/_CellBuffer.d.ts +11 -1
  414. package/types/src/sheet/_CopyUtils.d.ts +13 -6
  415. package/types/src/sheet/_IgnoredErrors.d.ts +46 -0
  416. package/types/src/sheet/_InvalidSheetRange.d.ts +3 -2
  417. package/types/src/sheet/_Kinds.d.ts +34 -0
  418. package/types/src/sheet/_Labels.d.ts +38 -0
  419. package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
  420. package/types/src/sheet/_RangeStateSweep.d.ts +2 -3
  421. package/types/src/sheet/_ScalarListFactory.d.ts +55 -7
  422. package/types/src/sheet/_SheetAutoFillUtils.d.ts +3 -3
  423. package/types/src/sheet/_SheetAutoFitUtils.d.ts +3 -3
  424. package/types/src/sheet/_SheetChangeEvent.d.ts +72 -0
  425. package/types/src/sheet/_SheetCoords.d.ts +3 -3
  426. package/types/src/sheet/_SheetEvents.d.ts +1 -1
  427. package/types/src/sheet/_SheetFilterUtils.d.ts +6 -6
  428. package/types/src/sheet/_SheetIntents.d.ts +32 -14
  429. package/types/src/sheet/_SheetMessages.d.ts +1 -1
  430. package/types/src/sheet/_SheetMutations.d.ts +11 -9
  431. package/types/src/sheet/_SheetSortUtils.d.ts +2 -2
  432. package/types/src/sheet/_SheetStateReader.d.ts +18 -0
  433. package/types/src/sheet/_SheetStateTypes.d.ts +80 -9
  434. package/types/src/sheet/_SheetUtils.d.ts +20 -19
  435. package/types/src/sheet/_WatchAnchor.d.ts +15 -2
  436. package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +4 -4
  437. package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +3 -3
  438. package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +3 -3
  439. package/types/src/sheet/index.d.ts +5 -2
  440. package/types/src/sheet/style/SheetCellStyle.d.ts +67 -86
  441. package/types/src/sheet/style/SheetDirectStyle.d.ts +3 -3
  442. package/types/src/sheet/style/SheetNamedStyle.d.ts +2 -0
  443. package/types/src/sheet/style/_DigitWidth.d.ts +7 -0
  444. package/types/src/sheet/style/_Resolvers.d.ts +3 -2
  445. package/types/src/sheet/style/_StyleUtils.d.ts +7 -43
  446. package/types/src/sheetHeader/ISheetHeader.d.ts +2 -2
  447. package/types/src/sheetHeader/SheetCellHeader.d.ts +2 -0
  448. package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +2 -0
  449. package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +2 -0
  450. package/types/src/sheetHeader/SheetHeader.d.ts +7 -6
  451. package/types/src/sheetHeader/_HeaderUtils.d.ts +2 -3
  452. package/types/src/sheetProtection/{ISheetProtection.d.ts → IWorksheetProtection.d.ts} +28 -28
  453. package/types/src/sheetProtection/WorksheetProtection.d.ts +51 -0
  454. package/types/src/sheetProtection/index.d.ts +1 -1
  455. package/types/src/sheetView/{ISheetView.d.ts → IWorksheetView.d.ts} +168 -61
  456. package/types/src/sheetView/WorksheetView.d.ts +139 -0
  457. package/types/src/sheetView/_SheetViewUtils.d.ts +5 -3
  458. package/types/src/sheetView/index.d.ts +1 -1
  459. package/types/src/slicer/ISlicer.d.ts +2 -2
  460. package/types/src/sort/ISort.d.ts +35 -5
  461. package/types/src/style/ICellStyle.d.ts +56 -44
  462. package/types/src/style/_BuiltInStyleDefs.d.ts +4 -3
  463. package/types/src/table/AnchoredTable.d.ts +23 -7
  464. package/types/src/table/AutoTable.d.ts +1 -1
  465. package/types/src/table/ITable.d.ts +32 -19
  466. package/types/src/table/_NamedTable.d.ts +3 -3
  467. package/types/src/table/_NamedTableSource.d.ts +2 -2
  468. package/types/src/text/IText.d.ts +4 -51
  469. package/types/src/text/TextEngine.d.ts +34 -0
  470. package/types/src/text/TextFrame.d.ts +4 -2
  471. package/types/src/text/TextRun.d.ts +3 -2
  472. package/types/src/text/TextWrapper.d.ts +32 -26
  473. package/types/src/text/_TextUtils.d.ts +5 -5
  474. package/types/src/text/_TextWrapperFallback.d.ts +49 -0
  475. package/types/src/text/impl/TabStrategy.d.ts +3 -1
  476. package/types/src/text/richtext/IRichText.d.ts +16 -2
  477. package/types/src/text/richtext/index.d.ts +0 -1
  478. package/types/src/theme/ITheme.d.ts +108 -7
  479. package/types/src/theme/ThemeCollection.d.ts +5 -0
  480. package/types/src/theme/_OfficeFontScheme.d.ts +8 -0
  481. package/types/src/transaction/ITransaction.d.ts +20 -1
  482. package/types/src/transaction/Transaction.d.ts +8 -1
  483. package/types/src/transaction/_BatchHandle.d.ts +118 -0
  484. package/types/src/type/AbstractCollection.d.ts +4 -13
  485. package/types/src/type/ICollection.d.ts +17 -4
  486. package/types/src/type/IProperties.d.ts +1 -1
  487. package/types/src/utils/_CSSUtils.d.ts +1 -1
  488. package/types/src/wasm/_fontsWasm.d.ts +7 -0
  489. package/types/src/wasm/_sdkWasm.d.ts +1 -1
  490. package/types/src/wasm/fontsWasm.d.ts +32 -0
  491. package/types/src/wasm/index.d.ts +1 -0
  492. package/types/src/wasm/loader.browser.d.ts +9 -0
  493. package/types/src/wasm/loader.node.d.ts +9 -0
  494. package/types/src/wasm/sdkWasm.d.ts +6 -3
  495. package/types/src/workbook/IWorkbook.d.ts +269 -39
  496. package/types/src/workbook/Workbook.d.ts +102 -25
  497. package/types/src/workbook/WorkbookRange.d.ts +2 -2
  498. package/types/src/workbook/WorkbookRanges.d.ts +3 -3
  499. package/types/src/workbook/_WorkbookIntents.d.ts +2 -2
  500. package/types/src/workbook/_WorkbookMessages.d.ts +5 -0
  501. package/types/src/workbookView/IWorkbookView.d.ts +82 -0
  502. package/types/src/workbookView/WorkbookView.d.ts +21 -0
  503. package/browser/esm/BbSmt62FpFIpoVzu.mjs +0 -392
  504. package/browser/esm/BgcZ-CoTbMfmyDJL.mjs +0 -412
  505. package/browser/esm/DOMHmhYzPcLVcpAW.mjs +0 -7
  506. package/browser/esm/DUvUK61b2_4pf4tG.mjs +0 -484
  507. package/node/esm/CCouEwT37f08qO3V.mjs +0 -7
  508. package/node/esm/CImNvdz1iP-lUlro.mjs +0 -610
  509. package/node/esm/CT0CN82y0_Qgoryk.mjs +0 -7568
  510. package/node/esm/DHUADiCmxNQS1ARz.mjs +0 -417
  511. package/node/esm/Ds0d8zXzmgOu3MGx.mjs +0 -403
  512. package/types/src/chart/_ChartXml.d.ts +0 -70
  513. package/types/src/collections/OverlappingRangeIterator.d.ts +0 -87
  514. package/types/src/collections/_RangeSweep.d.ts +0 -97
  515. package/types/src/font/CanvasFontMeasurer.d.ts +0 -25
  516. package/types/src/font/FontKitFontMeasurer.d.ts +0 -11
  517. package/types/src/font/SimpleFontMeasurer.d.ts +0 -4
  518. package/types/src/print/IPrint.d.ts +0 -212
  519. package/types/src/sheet/SheetCollection.d.ts +0 -29
  520. package/types/src/sheetProtection/SheetProtection.d.ts +0 -51
  521. package/types/src/sheetView/SheetView.d.ts +0 -122
  522. package/types/src/text/richtext/IStyledFont.d.ts +0 -330
@@ -1,19 +1,19 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.10
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.12
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { n as e } from "./BEAY9XgKNx-bakXW.mjs";
8
- import { a as t, o as n, s as r, t as i } from "./D4uVlrG0xEFctsSM.mjs";
9
- import { $ as a, $t as o, A as s, An as c, At as l, B as u, Bt as d, C as f, Cn as p, Ct as m, D as h, Dn as g, E as _, En as v, Ft as y, G as b, Gt as x, H as S, Ht as ee, I as te, It as ne, Jt as re, K as ie, Kt as ae, L as oe, Lt as se, M as ce, Mn as le, Mt as ue, N as de, Nn as fe, Nt as pe, O as me, On as he, Pn as ge, Q as _e, Qt as ve, Rt as ye, S as be, Sn as xe, St as Se, T as Ce, Tn as we, U as Te, Ut as Ee, V as De, Vt as Oe, W as ke, Wt as Ae, Xt as je, Yt as Me, Zt as Ne, _ as Pe, _n as Fe, a as C, an as Ie, b as Le, bn as Re, bt as ze, c as Be, cn as Ve, d as He, dn as w, en as Ue, et as We, f as Ge, fn as Ke, g as qe, gn as Je, h as Ye, hn as Xe, i as Ze, in as Qe, j as $e, jn as T, jt as et, k as tt, kn as nt, kt as rt, l as it, ln as at, m as ot, n as st, nn as ct, o as E, on as D, p as lt, pn as ut, qt as dt, r as ft, rn as pt, s as mt, sn as ht, t as gt, tn as _t, u as O, un as vt, vn as yt, vt as bt, w as xt, wn as St, wt as Ct, x as wt, xn as Tt, xt as Et, yn as Dt, yt as Ot, z as kt, zt as At } from "./zqJOaweiXE9D8RY1.mjs";
10
- import { B as k, F as jt, Gt as Mt, H as Nt, Ht as Pt, I as Ft, Kt as A, L as It, P as Lt, R as Rt, Ut as j, Wt as zt, at as Bt, ct as Vt, it as Ht, lt as M, ot as N, rt as Ut, st as P, tt as Wt, ut as F, z as Gt } from "./ClB5ix51roQOpZEr.mjs";
11
- import { n as Kt, o as qt, t as Jt } from "./DUvUK61b2_4pf4tG.mjs";
7
+ import { a as e, l as t, o as n, t as r, u as i } from "./DobHLF6VjHr7Xi40.mjs";
8
+ import { $t as a, A as o, Ai as s, Ar as c, Br as l, Bt as u, C as d, Ci as f, Cr as p, Ct as m, D as h, Di as g, Dt as _, E as v, Ei as y, Et as b, F as x, Fi as S, Fr as C, Ft as w, Gr as ee, Hr as te, Ht as ne, I as re, Ii as ie, Ir as ae, It as oe, Jr as se, Jt as ce, Kr as le, Kt as ue, L as de, Li as fe, Lr as pe, Mi as me, Mn as he, Mr as ge, Ni as _e, Nn as ve, Nr as ye, Nt as be, O as xe, Oi as Se, Ot as Ce, P as we, Pi as Te, Pr as Ee, Pt as De, Qt as Oe, Ri as ke, Rr as Ae, Rt as je, S as Me, Si as Ne, Sr as Pe, T as Fe, Ti as Ie, Tn as Le, Tt as Re, Ur as ze, Ut as Be, Vr as Ve, Vt as He, Wr as Ue, Wt as We, Xt as Ge, Yr as Ke, Yt as qe, Zt as Je, _a as Ye, _i as T, a as Xe, b as E, bi as Ze, ca as Qe, cn as D, da as $e, di as et, dn as tt, en as nt, fa as rt, fi as it, fn as at, ga as O, ha as ot, i as st, j as ct, jn as lt, jr as ut, k as dt, ki as ft, kr as pt, kt as mt, la as ht, ma as gt, nn as _t, oa as vt, on as yt, pa as bt, pn as xt, qr as St, qt as Ct, r as wt, ri as Tt, si as Et, sn as Dt, ta as Ot, ti as kt, tn as k, ua as At, ui as jt, un as Mt, v as Nt, va as Pt, vi as Ft, w as A, wi as It, wn as Lt, wt as Rt, x as zt, xi as Bt, xr as Vt, y as j, ya as Ht, yi as Ut, zi as Wt, zr as Gt, zt as Kt } from "./BudSIfXBAsTxvu-K.mjs";
9
+ import { $t as qt, B as Jt, Ct as Yt, E as Xt, Gt as Zt, H as Qt, I as $t, Kt as en, L as tn, O as nn, Qt as rn, R as an, St as on, V as sn, W as cn, Yt as M, at as ln, ct as un, dt as dn, en as N, ft as P, lt as fn, ot as pn, qt as F, rt as mn, st as hn, ut as gn, z as _n } from "./Bg5Di9GLNAkbqQ1P.mjs";
10
+ import { n as vn, t as yn } from "./DwwR3O2sEZApPSTF.mjs";
11
+ import { t as bn } from "./DVroRnhi-5IDXNgM.mjs";
12
12
  import { FormulaError as I, ScalarType as L } from "@sheetxl/primitives";
13
- import { BufferUtils as Yt, CommonUtils as R, CoordUtils as z, DOMUtils as Xt, DefaultLanguagePackService as Zt, ExpectedError as B, InvalidPasswordError as Qt, MimeType as $t, Notifier as V, NullNotAllowedError as en, OutOfBoundsError as H, PasswordRequiredError as tn, ProtectedError as U, UndoManager as nn, loadResource as rn, messageKey as W, t as G } from "@sheetxl/utils";
13
+ import { BufferUtils as xn, CommonUtils as R, CoordUtils as z, DOMUtils as Sn, DefaultLanguagePackService as Cn, ExpectedError as B, InvalidPasswordError as wn, MimeType as Tn, Notifier as En, NullNotAllowedError as Dn, OutOfBoundsError as V, PasswordRequiredError as On, ProtectedError as H, UndoManager as kn, messageKey as U, t as W } from "@sheetxl/utils";
14
14
  export * from "@sheetxl/primitives";
15
15
  export * from "@sheetxl/utils";
16
- var an, on = class extends nn {
16
+ var An, jn = class extends kn {
17
17
  constructor(e, t = 50) {
18
18
  super(t), this._transactions = e, this._floorId = e ? e.getCurrentCommit(!1).getId() : null, this._removeListener = e?.addListener({ onCommitChange: () => this._notifyOnStackChange() });
19
19
  }
@@ -98,14 +98,14 @@ var an, on = class extends nn {
98
98
  return e.length === 0 && this._repeatOperation !== null && e.push(this._repeatOperation.description), Object.freeze(e);
99
99
  }
100
100
  getUndoEntries() {
101
- return this._undoCommits().map(cn);
101
+ return this._undoCommits().map(Nn);
102
102
  }
103
103
  getRedoEntries() {
104
- let e = this._redoCommits().map(cn);
104
+ let e = this._redoCommits().map(Nn);
105
105
  return e.length === 0 && this._repeatOperation !== null && e.push({
106
106
  description: this._repeatOperation.description,
107
107
  author: null,
108
- meta: sn
108
+ meta: Mn
109
109
  }), Object.freeze(e);
110
110
  }
111
111
  addUndoOperation() {
@@ -117,15 +117,15 @@ var an, on = class extends nn {
117
117
  close() {
118
118
  this._removeListener?.();
119
119
  }
120
- }, sn = Object.freeze({}), cn = (e) => ({
120
+ }, Mn = Object.freeze({}), Nn = (e) => ({
121
121
  description: e.getDescription(),
122
122
  author: e.getAuthor(),
123
- meta: e.getMeta() ?? sn
124
- }), ln = class {
125
- constructor(e, n) {
126
- this._dirty = !1, this._store = e, this._savedCommitId = e.getCurrentCommit()?.getId() ?? null, this._emitter = new t(this);
123
+ meta: e.getMeta() ?? Mn
124
+ }), Pn = class {
125
+ constructor(t, n) {
126
+ this._dirty = !1, this._store = t, this._savedCommitId = t.getCurrentCommit()?.getId() ?? null, this._emitter = new e(this);
127
127
  let r = this;
128
- this._removeStoreListener = e.addListener({
128
+ this._removeStoreListener = t.addListener({
129
129
  onCommitEnd() {
130
130
  r._recompute();
131
131
  },
@@ -159,10 +159,10 @@ var an, on = class extends nn {
159
159
  this._removeStoreListener?.(), this._removeCommitListener?.(), this._emitter.close();
160
160
  }
161
161
  };
162
- an ||= {};
163
- var K = class e {
162
+ An ||= {};
163
+ var Fn, G = class t {
164
164
  constructor(n, r = {}) {
165
- this._password = null, this._emitter = new t(this), this._path = n ?? null, this._name = r.name ?? null, this._format = r.format ?? null, this._size = r.size ?? null, this._lastModified = r.lastModified ?? null, this._canWrite = r.canWrite ?? e._defaultCanWrite(this._path), this._encryption = r.encryption ?? null;
165
+ this._password = null, this._emitter = new e(this), this._path = n ?? null, this._name = r.name ?? null, this._format = r.format ?? null, this._size = r.size ?? null, this._lastModified = r.lastModified ?? null, this._canWrite = r.canWrite ?? t._defaultCanWrite(this._path), this._encryption = r.encryption ?? null;
166
166
  }
167
167
  static _defaultCanWrite(e) {
168
168
  return !!e && !/^(https?:|data:|blob:)/i.test(e);
@@ -173,7 +173,7 @@ var K = class e {
173
173
  getName() {
174
174
  if (this._name !== null && this._name !== void 0) return this._name;
175
175
  let e = this._cleanPath();
176
- return e && c(e) || null;
176
+ return e && ot(e) || null;
177
177
  }
178
178
  getPath() {
179
179
  return this._path;
@@ -184,7 +184,7 @@ var K = class e {
184
184
  getExtension() {
185
185
  let e = this._cleanPath();
186
186
  if (!e) return null;
187
- let t = T(e);
187
+ let t = O(e);
188
188
  return t ? t.toLowerCase() : null;
189
189
  }
190
190
  getEncryption() {
@@ -234,26 +234,26 @@ var K = class e {
234
234
  ];
235
235
  return `${t} ${(n / 1024 ** r).toFixed(2)}${i[Math.min(r, i.length - 1)]}`;
236
236
  }
237
- }, q = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new Set(), dn = (e) => q.get(e) ?? null, fn = () => Array.from(un, (e) => e.getOrigin()), pn = class e {
237
+ }, K = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new Set(), Ln = (e) => K.get(e) ?? null, Rn = () => Array.from(In, (e) => e.getOrigin()), zn = class t {
238
238
  constructor(n) {
239
- this._released = !1, e._assertFree(n), this._emitter = new t(this), this._origin = n, q.set(n, this), un.add(this);
239
+ this._released = !1, t._assertFree(n), this._emitter = new e(this), this._origin = n, K.set(n, this), In.add(this);
240
240
  }
241
241
  getOrigin() {
242
242
  return this._origin;
243
243
  }
244
- setOrigin(t) {
245
- t !== this._origin && (e._assertFree(t), this._released || (q.delete(this._origin), q.set(t, this)), this._origin = t, this._emitter.notify("onOriginChange"));
244
+ setOrigin(e) {
245
+ e !== this._origin && (t._assertFree(e), this._released || (K.delete(this._origin), K.set(e, this)), this._origin = e, this._emitter.notify("onOriginChange"));
246
246
  }
247
247
  release() {
248
- this._released || (this._released = !0, q.get(this._origin) === this && q.delete(this._origin), un.delete(this));
248
+ this._released || (this._released = !0, K.get(this._origin) === this && K.delete(this._origin), In.delete(this));
249
249
  }
250
250
  addListeners(e, t) {
251
251
  return this._emitter.addListeners(e, t);
252
252
  }
253
253
  static _assertFree(e) {
254
- if (q.has(e)) throw Error("This origin already backs an open workbook; an origin backs one workbook at a time.");
254
+ if (K.has(e)) throw Error("This origin already backs an open workbook; an origin backs one workbook at a time.");
255
255
  }
256
- }, mn = class {
256
+ }, Bn = class {
257
257
  constructor() {
258
258
  this._defaultStringSourceType = "filepath";
259
259
  }
@@ -264,28 +264,28 @@ var K = class e {
264
264
  i && (n = i);
265
265
  let a = t.format, o = this._detectSourceType(n);
266
266
  if (!o) throw Error("Unable to detect source type from provided input.");
267
- let s, l, u = !1;
267
+ let s, c, l = !1;
268
268
  if (o === "filepath") {
269
269
  let e = typeof n == "string" && n.startsWith("file://") ? n.slice(7) : n;
270
- n = await this.filePathToFile(e), o = "file", u = !0;
270
+ n = await this.filePathToFile(e), o = "file", l = !0;
271
271
  }
272
272
  switch (o) {
273
273
  case "file": {
274
- let e = n, r = e?.name, o = r ? `${c(r)}` : "";
275
- s = await e.arrayBuffer(), l = {
274
+ let e = n, r = e?.name, o = r ? `${ot(r)}` : "";
275
+ s = await e.arrayBuffer(), c = {
276
276
  format: a,
277
- ext: T(r),
277
+ ext: O(r),
278
278
  name: o,
279
279
  absolutePath: r,
280
280
  size: e.size,
281
281
  lastModified: e.lastModified,
282
- canWrite: !t.asCopy && (!!i || u && this._canWriteLocalPath())
282
+ canWrite: !t.asCopy && (!!i || l && this._canWriteLocalPath())
283
283
  };
284
284
  break;
285
285
  }
286
286
  case "blob": {
287
287
  let e = n;
288
- s = await e.arrayBuffer(), l = {
288
+ s = await e.arrayBuffer(), c = {
289
289
  format: a,
290
290
  size: e.size
291
291
  };
@@ -298,7 +298,7 @@ var K = class e {
298
298
  let [, t] = n.split(",");
299
299
  e = t;
300
300
  } else e = n;
301
- s = Yt.base64ToArrayBuffer(e), l = {
301
+ s = xn.base64ToArrayBuffer(e), c = {
302
302
  format: a,
303
303
  size: e.length
304
304
  };
@@ -314,28 +314,28 @@ var K = class e {
314
314
  e = i.input, t = i.init, r = i.timeout;
315
315
  }
316
316
  }
317
- let i = r || 3e4, o = new AbortController(), u = setTimeout(() => o.abort(), i), d = typeof e == "string" ? e : e.toString(), f = T(d);
317
+ let i = r || 3e4, o = new AbortController(), l = setTimeout(() => o.abort(), i), u = typeof e == "string" ? e : e.toString(), d = O(u);
318
318
  try {
319
319
  let n = await fetch(e, {
320
320
  ...t,
321
321
  signal: o.signal
322
322
  });
323
- if (clearTimeout(u), !n.ok) throw Error(`Failed to fetch: ${n.status} ${n.statusText}`);
323
+ if (clearTimeout(l), !n.ok) throw Error(`Failed to fetch: ${n.status} ${n.statusText}`);
324
324
  let r = await n.arrayBuffer();
325
- if (!r) throw Error(`Unable to fetched content: ${d}`);
326
- s = r, l = {
325
+ if (!r) throw Error(`Unable to fetched content: ${u}`);
326
+ s = r, c = {
327
327
  format: a,
328
- ext: f,
329
- name: c(d, !0),
330
- absolutePath: d
328
+ ext: d,
329
+ name: ot(u, !0),
330
+ absolutePath: u
331
331
  };
332
332
  } catch (e) {
333
- throw clearTimeout(u), e.name === "AbortError" ? Error(`Fetch timeout after ${i}ms: ${d}`) : e;
333
+ throw clearTimeout(l), e.name === "AbortError" ? Error(`Fetch timeout after ${i}ms: ${u}`) : e;
334
334
  }
335
335
  break;
336
336
  }
337
337
  case "buffer":
338
- s = n, l = { format: a };
338
+ s = n, c = { format: a };
339
339
  break;
340
340
  case "stream": {
341
341
  let e = n.getReader(), t = [], r = 0;
@@ -348,25 +348,25 @@ var K = class e {
348
348
  } finally {
349
349
  e.releaseLock();
350
350
  }
351
- let i = new ArrayBuffer(r), o = new Uint8Array(i), c = 0;
352
- for (let e of t) o.set(e, c), c += e.length;
353
- s = i, l = { format: a };
351
+ let i = new ArrayBuffer(r), o = new Uint8Array(i), l = 0;
352
+ for (let e of t) o.set(e, l), l += e.length;
353
+ s = i, c = { format: a };
354
354
  break;
355
355
  }
356
356
  default: throw Error(`Unsupported source type: ${o}`);
357
357
  }
358
- l.canWrite && await this.findOpenOrigin(r, l) && (l.canWrite = !1);
359
- let d = await e.decode(s, {
358
+ c.canWrite && await this.findOpenOrigin(r, c) && (c.canWrite = !1);
359
+ let u = await e.decode(s, {
360
360
  sourceType: o,
361
- ...l
361
+ ...c
362
362
  });
363
- return d ? (await this.onWorkbookRead(d, r), d) : null;
363
+ return u ? (await this.onWorkbookRead(u, r), u) : null;
364
364
  }
365
365
  async findOpenOrigin(e, t) {
366
366
  return t.absolutePath ? this.findOpenPath(t.absolutePath) : null;
367
367
  }
368
368
  findOpenPath(e, t) {
369
- return fn().find((n) => {
369
+ return Rn().find((n) => {
370
370
  if (n === t || !n.canWrite()) return !1;
371
371
  let r = n.getPath();
372
372
  return !!r && this.isSamePath(r, e);
@@ -397,21 +397,21 @@ var K = class e {
397
397
  }
398
398
  if (typeof File < "u" && e instanceof File) return "file";
399
399
  if (typeof Blob < "u" && e instanceof Blob) return "blob";
400
- let t = e instanceof ArrayBuffer || Object.prototype.toString.call(e) === "[object ArrayBuffer]", n = ArrayBuffer.isView(e), r = Yt.isNodeBuffer(e);
400
+ let t = e instanceof ArrayBuffer || Object.prototype.toString.call(e) === "[object ArrayBuffer]", n = ArrayBuffer.isView(e), r = xn.isNodeBuffer(e);
401
401
  return t || n || r ? "buffer" : typeof ReadableStream < "u" && e instanceof ReadableStream || Object.prototype.toString.call(e) === "[object ReadableStream]" || e && typeof e.getReader == "function" && e.locked !== void 0 ? "stream" : null;
402
402
  }
403
- }, hn = class extends mn {
403
+ }, Vn = class extends Bn {
404
404
  constructor(e, t) {
405
405
  super(), this._getWriteFormats = e, this._getReadFormats = t, this._defaultStringSourceType = "fetch", this._handleCache = /* @__PURE__ */ new WeakMap();
406
406
  }
407
407
  async fileFromHandle(e) {
408
- return _n(e) ? e.getFile() : null;
408
+ return Un(e) ? e.getFile() : null;
409
409
  }
410
410
  async resolveSource() {
411
411
  let e = await this._getReadFormats?.() ?? [];
412
412
  if (typeof globalThis.showOpenFilePicker == "function") try {
413
413
  let t = function(e) {
414
- let t = gn(e);
414
+ let t = Hn(e);
415
415
  if (t.length <= 1) return t;
416
416
  let n = /* @__PURE__ */ new Set(), r = {};
417
417
  for (let e of t) for (let [t, i] of Object.entries(e.accept)) for (let e of i) n.has(e) || (n.add(e), (r[t] ??= []).push(e));
@@ -426,13 +426,13 @@ var K = class e {
426
426
  throw e;
427
427
  }
428
428
  let t = e.flatMap((e) => e.exts.map((e) => "." + e)).join(", ");
429
- return Xt.openFileDialog(t);
429
+ return Sn.openFileDialog(t);
430
430
  }
431
431
  async findOpenOrigin(e) {
432
- return _n(e) ? this._findOpenHandle(e) : null;
432
+ return Un(e) ? this._findOpenHandle(e) : null;
433
433
  }
434
434
  async _findOpenHandle(e, t) {
435
- for (let n of fn()) {
435
+ for (let n of Rn()) {
436
436
  if (n === t || !n.canWrite()) continue;
437
437
  let r = this._handleCache.get(n);
438
438
  if (r && typeof r.isSameEntry == "function" && await r.isSameEntry(e)) return n;
@@ -440,7 +440,7 @@ var K = class e {
440
440
  return null;
441
441
  }
442
442
  async onWorkbookRead(e, t) {
443
- if (!_n(t)) return;
443
+ if (!Un(t)) return;
444
444
  let n = e.getOrigin?.();
445
445
  n?.canWrite() && this._handleCache.set(n, t);
446
446
  }
@@ -467,18 +467,18 @@ var K = class e {
467
467
  if (!a) {
468
468
  c = await globalThis.showSaveFilePicker({
469
469
  suggestedName: n,
470
- types: gn(o)
470
+ types: Hn(o)
471
471
  });
472
472
  let t = await this._findOpenHandle(c, e.workbook?.getOrigin?.());
473
- if (t) throw new B(G("error.io.openElsewhere", { name: t.getName() ?? c.name ?? "" }));
473
+ if (t) throw new B(W("error.io.openElsewhere", { name: t.getName() ?? c.name ?? "" }));
474
474
  }
475
- let s = yn(c.name ?? n), l = o.find((e) => e.exts.some((e) => e.toLowerCase() === s)) ?? r, u = a ? t : new K(c.name ?? n, {
475
+ let s = Gn(c.name ?? n), l = o.find((e) => e.exts.some((e) => e.toLowerCase() === s)) ?? r, u = a ? t : new G(c.name ?? n, {
476
476
  format: l.key,
477
477
  canWrite: !0
478
478
  }), d = await i(l.key, u);
479
479
  if (!d) return null;
480
- let f = new Blob([vn(d)], { type: l.mimeType || "application/octet-stream" }), p = await c.createWritable();
481
- if (await p.write(f), await p.close(), this._handleCache.set(u, c), u instanceof K) {
480
+ let f = new Blob([Wn(d)], { type: l.mimeType || "application/octet-stream" }), p = await c.createWritable();
481
+ if (await p.write(f), await p.close(), this._handleCache.set(u, c), u instanceof G) {
482
482
  let e = await Promise.resolve(c.getFile?.()).then((e) => e?.lastModified ?? null, () => null);
483
483
  u.update({
484
484
  size: f.size,
@@ -490,19 +490,19 @@ var K = class e {
490
490
  if (e?.name === "AbortError") return null;
491
491
  if (e instanceof B) throw e;
492
492
  }
493
- let l = t.getPath(), u = l ? l.split(/[/\\]/).pop() : null, d = u && r.exts.some((e) => e.toLowerCase() === yn(u)) ? u : n, f = l !== d || t.canWrite() ? new K(d, {
493
+ let l = t.getPath(), u = l ? l.split(/[/\\]/).pop() : null, d = u && r.exts.some((e) => e.toLowerCase() === Gn(u)) ? u : n, f = l !== d || t.canWrite() ? new G(d, {
494
494
  format: r.key,
495
495
  canWrite: !1
496
496
  }) : t, p = await i(r.key, f);
497
497
  if (!p) return null;
498
- let m = new Blob([vn(p)], { type: r.mimeType || "application/octet-stream" });
498
+ let m = new Blob([Wn(p)], { type: r.mimeType || "application/octet-stream" });
499
499
  return function(e, t) {
500
500
  let n = URL.createObjectURL(e), r = document.createElement("a");
501
501
  r.style.display = "none", r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
502
- }(m, d), f instanceof K && f.update({ size: m.size }), f;
502
+ }(m, d), f instanceof G && f.update({ size: m.size }), f;
503
503
  }
504
504
  };
505
- function gn(e) {
505
+ function Hn(e) {
506
506
  return e.map((e) => {
507
507
  let t = e.mimeType && e.mimeType.includes("/") ? e.mimeType : "application/octet-stream";
508
508
  return {
@@ -511,402 +511,27 @@ function gn(e) {
511
511
  };
512
512
  });
513
513
  }
514
- function _n(e) {
514
+ function Un(e) {
515
515
  return !!e && e.kind === "file" && typeof e.getFile == "function";
516
516
  }
517
- function vn(e) {
517
+ function Wn(e) {
518
518
  if (typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) {
519
519
  let t = new ArrayBuffer(e.byteLength);
520
520
  return new Uint8Array(t).set(new Uint8Array(e)), t;
521
521
  }
522
522
  return e;
523
523
  }
524
- function yn(e) {
524
+ function Gn(e) {
525
525
  let t = e.lastIndexOf(".");
526
526
  return t >= 0 ? e.slice(t + 1).toLowerCase() : "";
527
527
  }
528
- var bn = class {
529
- constructor(e) {
530
- this._private = { input: e }, typeof e == "string" ? this._private.name = e : Object.assign(this._private, e);
531
- }
532
- toJSON() {
533
- return this._private.input;
534
- }
535
- getFamily() {
536
- return this._private.name;
537
- }
538
- getPitch() {
539
- return this._private.pitch;
540
- }
541
- getPanose() {
542
- return this._private.panose;
543
- }
544
- toString() {
545
- return typeof this._private.input == "string" ? this._private.input : JSON.stringify(this._private.input);
546
- }
547
- get isIFont() {
548
- return !0;
549
- }
550
- }, xn = /^\p{White_Space}$/u, Sn = (e) => Math.max(0, Math.floor(e + .5)) || 0, J = class e {
551
- constructor(e, t) {
552
- this._perEm = /* @__PURE__ */ new Map(), this.family = e.family, this.weight = e.weight, this.italic = e.italic, this._vertical = t;
553
- }
554
- static fromJSON(t) {
555
- if (t?.format !== e.FORMAT) throw Error(`Not a font metrics table: format '${t?.format}', expected '${e.FORMAT}'.`);
556
- let n = Math.max(1, t.unitsPerEm), r = (e) => e ? {
557
- position: e[0] / n,
558
- thickness: e[1] / n
559
- } : null, i = new e({
560
- family: t.family,
561
- weight: t.weight,
562
- italic: t.italic
563
- }, {
564
- ascent: t.winAscent / n,
565
- descent: t.winDescent / n,
566
- underline: r(t.underline),
567
- strikeout: r(t.strikeout)
568
- }), a = i._perEm;
569
- for (let [e, r] of t.advances) for (let t = 0; t < r.length; t++) a.set(e + t, r[t] / n);
570
- return i;
571
- }
572
- get size() {
573
- return this._perEm.size;
574
- }
575
- advance(e) {
576
- return this._perEm.get(e);
577
- }
578
- set(e) {
579
- for (let [t, n] of e) this._perEm.set(t, n);
580
- }
581
- missing(e) {
582
- let t = /* @__PURE__ */ new Set();
583
- for (let n of e) this._perEm.has(n.codePointAt(0)) || t.add(n);
584
- return [...t];
585
- }
586
- width(e, t, n) {
587
- let r = this._perEm, i = r.get(32) ?? 0, a = 0, o = 0;
588
- for (let t of e) a += r.get(t.codePointAt(0)) ?? (xn.test(t) ? i : 0), o++;
589
- return a * t * (n?.superSub ? .6 : 1) + (n?.letterSpacing ?? 0) * Math.max(0, o - 1);
590
- }
591
- metrics(e) {
592
- let t = Sn(e), n = Sn(this._vertical.ascent * t), r = Sn(this._vertical.descent * t), i = n + r + 2;
593
- return {
594
- ascent: n,
595
- descent: r,
596
- lineHeight: i,
597
- baseline: Math.floor((i - (n + r)) / 2) + n,
598
- lineGap: 2
599
- };
600
- }
601
- underline(e) {
602
- return Cn(this._vertical.underline, e);
603
- }
604
- strikeout(e) {
605
- return Cn(this._vertical.strikeout, e);
606
- }
607
- measure(e, t, n) {
608
- return {
609
- width: this.width(e, t, n),
610
- ...this.metrics(t)
611
- };
612
- }
613
- };
614
- function Cn(e, t) {
615
- return e ? {
616
- position: e.position * t,
617
- thickness: e.thickness * t
618
- } : null;
619
- }
620
- (J ||= {}).FORMAT = "sheetxl-font-metrics/1";
621
- var wn = class {
622
- constructor(e = null) {
623
- this.name = "table-file", this.kind = "table", this._pending = /* @__PURE__ */ new Map(), this._base = e;
624
- }
625
- build(e) {
626
- let t = function(e) {
627
- let t = e.family.trim().toLowerCase().replace(/\s+/g, "-"), n = e.weight >= 600;
628
- return `${t}-${n && e.italic ? "bold-italic" : n ? "bold" : e.italic ? "italic" : "regular"}.metrics.json`;
629
- }(e), n = this._pending.get(t);
630
- return n || (n = this._load(t), this._pending.set(t, n)), n;
631
- }
632
- async _load(e) {
633
- let t;
634
- try {
635
- t = await rn("fonts", "@sheetxl/sdk", e, this._base, import.meta.url);
636
- } catch {
637
- return null;
638
- }
639
- return J.fromJSON(t);
640
- }
641
- }, Tn = "{\n \"format\": \"sheetxl-font-metrics/1\",\n \"family\": \"Arial\",\n \"weight\": 700,\n \"italic\": false,\n \"source\": { \"family\": \"Liberation Sans\", \"version\": \"Version 2.1.5\", \"license\": \"OFL-1.1\", \"notice\": \"Licensed under the SIL Open Font License, Version 1.1\" },\n \"unitsPerEm\": 2048,\n \"winAscent\": 1854,\n \"winDescent\": 434,\n \"underline\": [-2, 215],\n \"strikeout\": [530, 102],\n \"advances\": [\n [32, [569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1997,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,797,573,797,1196]],\n [160, [569,682,1139,1139,1139,1139,573,1139,682,1509,758,1139,1196,682,1509,1131,819,1124,682,682,682,1180,1139,682,682,682,748,1139,1708,1708,1708,1251,1479,1479,1479,1479,1479,1479,2048,1479,1366,1366,1366,1366,569,569,569,569,1479,1479,1593,1593,1593,1593,1593,1196,1593,1479,1479,1479,1479,1366,1366,1251,1139,1139,1139,1139,1139,1139,1821,1139,1139,1139,1139,1139,569,569,569,569,1251,1251,1251,1251,1251,1251,1251,1124,1251,1251,1251,1251,1251,1139,1251,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1472,1479,1251,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1593,1251,1593,1251,1593,1251,1593,1251,1479,1251,1479,1251,569,569,569,569,569,569,569,569,569,569,1607,1139,1139,569,1479,1139,1139,1251,569,1251,569,1251,789,1251,981,1251,569,1479,1251,1479,1251,1479,1251,1451,1481,1251,1593,1251,1593,1251,1593,1251,2048,1933,1479,797,1479,797,1479,797,1366,1139,1366,1139,1366,1139,1366,1139,1251,682,1251,981,1251,682,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,1933,1593,1366,1139,1366,1251,1024,1251,1024,1251,1024,569,1251,1713,1472,1251,1472,1251,1479,1479,1139,1479,1715,1472,1251,1242,1366,1487,1283,1251,1139,1593,1304,1906,569,569,1479,1139,569,1139,2031,1479,1251,1593,1747,1456,1816,1523,1601,1251,1366,1366,1139,1229,737,682,1251,682,1251,1699,1483,1642,1479,1577,1139,1251,1024,1251,1251,1078,1078,1139,1139,1018,1186,1251,573,1019,1197,682,2730,2503,2275,2390,1820,1138,2618,2048,1820,1479,1139,569,569,1593,1251,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,1139,1479,1139,1479,1139,2048,1821,1593,1251,1593,1251,1479,1139,1593,1251,1593,1251,1251,1078,569,2730,2503,2275,1593,1251,2115,1362,1479,1251,1479,1139,2048,1821,1593,1251,1479,1139,1479,1139,1366,1139,1366,1139,569,569,569,569,1593,1251,1593,1251,1479,797,1479,797,1479,1251,1479,1251,1366,1139,1251,682,1182,1065,1479,1251,1439,1715,1292,1292,1251,1024,1479,1139,1366,1139,1593,1251,1593,1251,1593,1251,1593,1251,1366,1139,1022,1707,1036,569,1953,1953,1479,1479,1139,1251,1251,1139,1024,1321,991,1479,1479,1366,1366,1139,1139,569,1587,1251,1479,797,1366,1139,1139,1251,1251,1251,1139,1139,1251,1251,1139,1139,1601,1018,1018,1415,1162,682,1251,1251,1200,1139,1230,1251,1251,1251,569,569,830,680,729,569,1236,1821,1821,1821,1251,1251,1259,1251,1707,1730,1535,797,797,797,797,797,797,797,1195,1195,1139,682,682,682,1105,682,682,1251,1272,1192,1139,1593,1139,1169,1024,1392,1078,1078,1139,1139,1139,1139,1593,1259,1162,1200,1237,939,1139,926,1251,1139,1139,2111,1929,2479,1666,1094,1688,1780,1589,1418,1093,1154,1494,1494,753,753,398,516,516,516,768,1071,738,487,971,569,569,569,682,682,768,768,1196,1196,1196,1196,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,749,289,770,750,768,784,784,784,784,784,682,682,682,682,1024,682,682,682,682,682,682,682,682,682,682,682,682,682,682,814,814,682,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [884, [682,682]],\n [890, [682,1139,1139,1139,682]],\n [900, [682,952,1479,682,1747,1855,970]],\n [908, [1689]],\n [910, [1899,1716,569,1479,1479,1231,1472,1366,1251,1479,1593,569,1479,1366,1706,1479,1318,1593,1479,1366]],\n [931, [1229,1251,1366,1681,1366,1657,1642,569,1366,1259,924,1251,569,1192,1259,1250,1139,1242,972,943,1251,1107,569,1142,1139,1253,1139,912,1251,1568,1267,1065,1401,914,1192,1465,1179,1543,1730,569,1192,1251,1192,1730]],\n [976, [1250,1192,1577,2050,1577,1535,1730,1385,1593,1251,1479,1139,1251,926,1539,1084,1647,1250,2031,1821,1439,1251,1439,1239,1366,1366,1316,1236,1505,1184,1038,900,1385,1265,1139,569,1593,980,980,1366,1251,1479,1706,1515,1267,1479,1479,1479,1366,1370,1813,1161,1457,1366,569,565,1139,2240,2176,1792,1250,1472,1274,1472,1479,1472,1479,1161,1459,1366,1851,1283,1472,1472,1250,1437,1706,1479,1593,1472,1366,1479,1251,1274,1748,1366,1496,1439,2058,2087,1781,2005,1472,1457,2112,1472,1139,1265,1259,853,1300,1139,1452,1018,1259,1259,1025,1301,1515,1237,1251,1237,1251,1139,1003,1139,1792,1139,1259,1189,1707,1728,1493,1749,1259,1131,1749,1195,1139,1139,1251,853,1131,1139,569,576,569,1984,1856,1251,1025,1259,1139,1237,2621,1594,1780,1439,1998,1630,1366,1139,1896,1639,1657,1543,2206,2008,1283,1018,1657,1543,1593,1251,1669,1324,1669,1324,2294,1995,1668,1306,2621,1845,2621,1594,1479,1139,1196,0,0,0,0,0,0,0,1472,1259,1472,1259,1366,1251,997,915,1161,853,1439,1225,1851,1452,1283,1018,1250,1025,1250,1025,1250,1025,1559,1276,1479,1237,1801,1462,2306,1887,1479,1183,1479,1139,1251,1003,1139,1139,1139,1139,1366,1139,1746,1411,1439,1189,1439,1189,1439,1251,1754,1389,1754,1389,569,1851,1452,1437,1224,1437,1301,1479,1237,1479,1237,1439,1189,1706,1515,569,1479,1139,1479,1139,2048,1821,1366,1139,1487,1139,1487,1139,1851,1452,1283,1018,1283,1078,1472,1259,1472,1259,1593,1251,1593,1251,1593,1251,1457,1131,1274,1139,1274,1139,1274,1139,1439,1189,1161,853,2005,1749,1161,853,1366,1139,1366,1139,1472,1251,2110,1914,1965,1732,1347,1098,2074,1957,2115,1894,1593,1200,1568,1435,1283,1018,1437,1301]],\n [1306, [1593,1251,1933,1593]],\n [1425, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784,0,1153,0,0,682,0,0,862,0]],\n [1488, [1397,1311,981,1192,1384,618,748,1434,1409,618,1180,1133,1171,1475,1487,618,883,1430,1266,1382,1335,1128,1247,1339,1180,1649,1470]],\n [1520, [1237,1237,1237,831,1278]],\n [7424, [1205,1589,1821,1259,1139,1177,1177,1025,1018,569,1039,1142,926,1515,1259,1251,1139,1265,1265,1265,1933,1170,1251,1251,1257,1195,1195,1003,1192,1251,1572,1248,1139,1593,1024,991,1010,1260,853,1139,1237,1257,1543,1301,995,1425,930,930,931,853,853,1027,892,370,734,944,798,1058,887,888,1062,890,859,940,887,891,1300,773,773,801,1206,801,801,770,770,719,719,800,289,714,1156,754,840,778,841,841,800,444,754,834,1156,745,844,795,745,835,986,776,289,516,754,745,795,745,834,986,776,1888,1251,1251,682,1821,1251,1251,797,797,1139,682,1024,1251,752,1244,1787,569,569,1251,1192,1272,1251,1251,682,1573,1139,569,1821,1251,1251,797,1139,954,1139,1139,1024,1139,1251,1251,1139,1018,1018,1342,569,1139,682,1251,1078,801,778,778,840,719,496,496,800,753,372,289,289,372,630,398,336,585,1156,1156,863,863,762,840,1027,770,569,444,832,862,746,746,745,740,740,958,778,744,0,0,0,0,0,0,0,0,0,0,0]],\n [7678, [0,0,1479,1139,1479,1251,1479,1251,1479,1251,1479,1139,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1251,682,1593,1251,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,569,569,569,569,1479,1139,1479,1139,1479,1139,1251,569,1251,569,1251,569,1251,569,1706,1821,1706,1821,1706,1821,1479,1251,1479,1251,1479,1251,1479,1251,1593,1251,1593,1251,1593,1251,1593,1251,1366,1251,1366,1251,1479,797,1479,797,1479,797,1479,797,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1251,682,1251,682,1251,682,1251,682,1479,1251,1479,1251,1479,1251,1479,1251,1479,1251,1366,1139,1366,1139,1933,1593,1933,1593,1933,1593,1933,1593,1933,1593,1366,1139,1366,1139,1366,1139,1251,1024,1251,1024,1251,1024,1251,682,1593,1139,1139,569]],\n [7838, [1465]],\n [7840, [1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,569,569,569,569,1593,1251,1593,1251,1593,1251,1593,1251,1593,1251,1593,1251,1593,1251,1747,1456,1747,1456,1747,1456,1747,1456,1747,1456,1479,1251,1479,1251,1699,1483,1699,1483,1699,1483,1699,1483,1699,1483,1366,1139,1366,1139,1366,1139,1366,1139]],\n [7936, [1259,1259,1259,1259,1259,1259,1259,1259,1479,1479,1779,1779,1779,1779,1779,1779,972,972,972,972,972,972]],\n [7960, [1566,1566,1966,1966,1966,1966]],\n [7968, [1251,1251,1251,1251,1251,1251,1251,1251,1679,1679,2079,2079,2079,2079,2079,2079,569,569,569,569,569,569,569,569,769,769,1169,1169,1169,1169,1169,1169,1251,1251,1251,1251,1251,1251]],\n [8008, [1693,1693,2133,2133,1993,1993]],\n [8016, [1192,1192,1192,1192,1192,1192,1192,1192]],\n [8025, [1666]],\n [8027, [2046]],\n [8029, [2146]],\n [8031, [1966,1730,1730,1730,1730,1730,1730,1730,1730,1742,1742,2182,2182,2042,2042,2042,2042,1259,1259,972,972,1251,1251,569,569,1251,1251,1192,1192,1730,1730]],\n [8064, [1259,1259,1259,1259,1259,1259,1259,1259,1479,1479,1779,1779,1779,1779,1779,1779,1251,1251,1251,1251,1251,1251,1251,1251,1679,1679,2079,2079,2079,2079,2079,2079,1730,1730,1730,1730,1730,1730,1730,1730,1742,1742,2182,2182,2042,2042,2042,2042,1259,1259,1259,1259,1259]],\n [8118, [1259,1259,1479,1479,1479,1479,1479,682,682,682,682,682,1251,1251,1251]],\n [8134, [1251,1251,1766,1766,1879,1879,1479,682,682,682,569,569,569,569]],\n [8150, [569,569,569,569,969,969]],\n [8157, [682,682,682,1192,1192,1192,1192,1267,1267,1192,1192,1366,1366,1766,1866,1566,952,952,682]],\n [8178, [1730,1730,1730]],\n [8182, [1730,1730,1893,1693,1942,1742,1642,682,682]],\n [8192, [1024,2048,1024,2048,683,512,341,1139,569,410,171,0,0,0,0,0,682]],\n [8210, [1139,1139,2048,2048,1019,1131,569,569,569,569,1024,1024,1024,1024,1139,1139,717]],\n [8230, [2048]],\n [8234, [0,0,0,0,0,410,2048]],\n [8242, [491,981,981]],\n [8249, [682,682]],\n [8252, [1237]],\n [8254, [682]],\n [8260, [342]],\n [8286, [682]],\n [8298, [0,0,0,0,0,0]],\n [8308, [1013,962,943,845,968,972]],\n [8319, [811,923,847,910,947,976,939,930,819,959,922]],\n [8336, [773,770,840,750,770]],\n [8352, [1139,1479,1479,1139,1139,1821,1479,2240,2509,1933,1810,1051,1139,1479,1251,2224,1139,1366,1593,1479,1366,1479]],\n [8383, [1669]],\n [8432, [0]],\n [8453, [1813]],\n [8467, [1001]],\n [8470, [2283,1509]],\n [8482, [2048]],\n [8486, [1573]],\n [8494, [1229]],\n [8525, [2048,1025]],\n [8531, [1708,1708]],\n [8539, [1708,1708,1708,1708]],\n [8580, [1139]],\n [8592, [2048,1024,2048,1024,2048,1024]],\n [8616, [1024]],\n [8660, [2048]],\n [8706, [1012]],\n [8710, [1253]],\n [8719, [1686]],\n [8721, [1460,1196]],\n [8725, [342]],\n [8729, [569,1124]],\n [8734, [1460,2005]],\n [8745, [1479]],\n [8747, [561]],\n [8776, [1124]],\n [8800, [1124,1195,2048]],\n [8804, [1124,1124]],\n [8962, [1237]],\n [8976, [1196]],\n [8992, [1237,1237]],\n [9472, [1451]],\n [9474, [1280]],\n [9484, [1451]],\n [9488, [1451]],\n [9492, [1451]],\n [9496, [1451]],\n [9500, [1451]],\n [9508, [1451]],\n [9516, [1451]],\n [9524, [1451]],\n [9532, [1451]],\n [9552, [1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451]],\n [9600, [1451]],\n [9604, [1451]],\n [9608, [1451]],\n [9612, [1451]],\n [9616, [1451,1451,1451,1493]],\n [9632, [1237,1237]],\n [9642, [726,726,2048]],\n [9650, [2027]],\n [9658, [2027]],\n [9660, [2027]],\n [9668, [2027]],\n [9674, [1012,1237,1217]],\n [9679, [1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237]],\n [9702, [726]],\n [9786, [2091,2155,1877]],\n [9791, [1536,1536,1536,1536,1536,1536,1536,1536,1536]],\n [9824, [1088]],\n [9827, [1344]],\n [9829, [1216,1045]],\n [9833, [2048,1024,1536,2048]],\n [9839, [1024]],\n [11360, [1251,569,1251,1366,1479,1139,682,1479,1251,1479,1139,1251,1024,1563]],\n [11377, [1241,2139,1758,1139,1108,892,1465]],\n [11799, [682]],\n [42775, [0,0,0,0,1024,1024,682,682,682,0,0]],\n [42888, [682,682,796,487,487]],\n [64257, [1251,1251]],\n [64285, [618,0,1237,1266,1397,1192,1384,1133,1171,1475,1180,1470,1237,1649,1649,1649,1649,1397,1397,1397,1311,981,1192,1384,618,748]],\n [64312, [1409,618,1180,1133,1171]],\n [64318, [1487]],\n [64320, [883,1430]],\n [64323, [1382,1335]],\n [64326, [1247,1339,1180,1649,1470,618,1311,1133,1335,1368]],\n [65056, [0,0,0,0]],\n [65532, [2048]]\n ]\n}\n", En = "{\n \"format\": \"sheetxl-font-metrics/1\",\n \"family\": \"Arial\",\n \"weight\": 400,\n \"italic\": false,\n \"source\": { \"family\": \"Liberation Sans\", \"version\": \"Version 2.1.5\", \"license\": \"OFL-1.1\", \"notice\": \"Licensed under the SIL Open Font License, Version 1.1\" },\n \"unitsPerEm\": 2048,\n \"winAscent\": 1854,\n \"winDescent\": 434,\n \"underline\": [-67, 150],\n \"strikeout\": [530, 102],\n \"advances\": [\n [32, [569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196]],\n [160, [569,682,1139,1139,1139,1139,532,1139,682,1509,758,1139,1196,682,1509,1131,819,1124,682,682,682,1180,1100,682,682,682,748,1139,1708,1708,1708,1251,1366,1366,1366,1366,1366,1366,2048,1479,1366,1366,1366,1366,569,569,569,569,1479,1479,1593,1593,1593,1593,1593,1196,1593,1479,1479,1479,1479,1366,1366,1251,1139,1139,1139,1139,1139,1139,1821,1024,1139,1139,1139,1139,569,569,569,569,1139,1139,1139,1139,1139,1139,1139,1124,1251,1139,1139,1139,1139,1024,1139,1024,1366,1139,1366,1139,1366,1139,1479,1024,1479,1024,1479,1024,1479,1024,1479,1259,1479,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1593,1139,1593,1139,1593,1139,1593,1139,1479,1139,1479,1139,569,569,569,569,569,569,569,455,569,569,1505,909,1024,455,1366,1024,1024,1139,455,1139,455,1139,597,1139,684,1139,455,1479,1139,1479,1139,1479,1139,1237,1481,1139,1593,1139,1593,1139,1593,1139,2048,1933,1479,682,1479,682,1479,682,1366,1024,1366,1024,1366,1024,1366,1024,1251,569,1251,768,1251,569,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1933,1479,1366,1024,1366,1251,1024,1251,1024,1251,1024,455,1139,1553,1344,1139,1344,1139,1479,1479,1024,1479,1658,1344,1139,1140,1366,1541,1237,1251,1139,1593,1278,1804,455,569,1366,1024,455,1024,1824,1479,1139,1593,1756,1343,1778,1367,1545,1139,1366,1366,1024,1266,779,569,1251,569,1251,1749,1371,1531,1479,1582,1024,1251,1024,1251,1251,1116,1116,1139,1139,939,997,1139,532,846,1196,569,2730,2503,2148,2175,1706,924,2503,1934,1579,1366,1139,569,455,1593,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1139,1366,1139,1366,1139,2048,1821,1593,1139,1593,1139,1366,1024,1593,1139,1593,1139,1251,1116,455,2730,2503,2148,1593,1139,2118,1266,1479,1139,1366,1139,2048,1821,1593,1251,1366,1139,1366,1139,1366,1139,1366,1139,569,569,569,569,1593,1139,1593,1139,1479,682,1479,682,1479,1139,1479,1139,1366,1024,1251,569,1116,894,1479,1139,1446,1396,1238,1158,1251,1024,1366,1139,1366,1139,1593,1139,1593,1139,1593,1139,1593,1139,1366,1024,715,1402,752,455,1816,1816,1366,1479,1024,1139,1251,1024,1024,1189,928,1366,1479,1368,1366,1139,1024,455,1510,1139,1479,682,1366,1024,1139,1139,1139,1139,1024,1024,1139,1139,1139,1139,1513,939,939,1293,1039,569,1139,1139,1144,1026,1263,1139,1139,1139,455,455,729,670,622,455,1171,1706,1706,1706,1139,1139,1132,1139,1619,1599,1126,682,682,682,682,682,682,682,1109,1109,1024,455,532,455,715,569,569,1139,1164,1120,1024,1479,1024,1064,1024,1108,1116,1116,1024,1024,1024,1024,1593,1088,1039,1144,1131,814,1024,827,1139,1024,1024,1975,1856,2059,1459,879,1472,1564,1354,1295,994,1080,1407,1407,785,785,326,491,491,491,746,985,657,391,727,455,455,455,682,682,714,714,1196,1196,1196,1196,682,682,682,682,682,682,682,682,682,682,569,569,682,682,682,682,682,682,682,682,682,682,682,682,682,682,660,322,696,672,714,784,784,784,784,784,682,682,682,682,682,682,682,682,682,682,682,682,682,682,569,682,682,682,682,814,814,682,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [884, [682,682]],\n [890, [682,1024,1024,1024,569]],\n [900, [682,682,1367,569,1606,1716,786]],\n [908, [1586]],\n [910, [1752,1541,455,1366,1366,1128,1368,1366,1251,1479,1593,569,1366,1368,1706,1479,1331,1593,1479,1366]],\n [931, [1266,1251,1366,1634,1366,1711,1531,569,1366,1184,913,1139,455,1120,1184,1178,1024,1140,913,903,1139,1139,455,1024,1024,1180,1024,917,1139,1413,1165,987,1264,809,1120,1328,1075,1460,1599,455,1120,1139,1120,1599]],\n [976, [1178,1120,1582,1962,1582,1147,1599,1231,1593,1139,1479,1024,1251,827,1279,1084,1549,1181,1824,1706,1381,1139,1380,1024,1366,1366,1248,1221,1509,1134,950,839,1231,1173,1024,455,1593,905,905,1366,1139,1479,1706,1408,1165,1479,1479,1479,1366,1367,1771,1109,1472,1366,569,569,1024,2165,2069,1749,1193,1472,1301,1472,1366,1344,1366,1109,1387,1366,1891,1237,1472,1472,1193,1344,1706,1479,1593,1472,1366,1479,1251,1301,1557,1366,1515,1365,1877,1920,1621,1813,1344,1472,2069,1479,1139,1173,1088,747,1195,1139,1370,939,1144,1144,896,1195,1408,1131,1139,1109,1139,1024,938,1024,1685,1024,1173,1067,1643,1685,1280,1472,1067,1045,1536,1109,1139,1139,1139,747,1045,1024,455,569,455,1856,1664,1139,896,1144,1024,1131,2740,1278,1593,1255,1945,1461,1368,1024,1838,1424,1697,1403,2157,1776,1237,939,1631,1410,1593,1139,1645,1292,1645,1292,2200,1836,1706,1254,2439,1744,2740,1278,1479,1024,1031,0,0,0,0,0,0,0,1472,1144,1344,1067,1366,1139,1001,842,1109,747,1373,1124,1891,1370,1237,939,1193,896,1193,896,1193,896,1519,1097,1479,1131,1801,1327,2328,1782,1542,1067,1479,1024,1251,938,1139,1024,1139,1024,1366,1024,1895,1415,1365,1067,1365,1067,1365,1139,1764,1364,1764,1364,569,1891,1370,1367,1128,1344,1195,1479,1131,1479,1131,1365,1067,1706,1408,455,1366,1139,1366,1139,2048,1821,1366,1139,1541,1139,1541,1139,1891,1370,1237,939,1237,1116,1472,1144,1472,1144,1593,1139,1593,1139,1593,1139,1472,1045,1301,1024,1301,1024,1301,1024,1365,1067,1109,747,1813,1472,1109,747,1366,1024,1366,1024,1344,1139,1983,1795,1958,1670,1357,1043,1987,1863,2118,1799,1593,1144,1529,1363,1237,939,1344,1195]],\n [1306, [1593,1139,1933,1479]],\n [1425, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784,0,1153,0,0,569,0,0,776,0]],\n [1488, [1286,1225,866,1135,1298,532,662,1348,1337,532,1094,1075,1085,1389,1407,532,797,1343,1192,1276,1249,1032,1116,1208,1094,1495,1415]],\n [1520, [1042,1042,1042,788,1235]],\n [7424, [1016,1531,1821,1088,1024,1129,1129,1003,939,455,865,1024,822,1408,1144,1139,1024,1246,1246,1246,1933,936,1139,1139,1067,1109,1109,938,1120,1222,1502,1222,1024,1479,1024,939,875,1243,747,1024,1109,1067,1460,1195,928,1359,849,849,920,840,840,1016,878,342,644,870,720,1045,881,879,1048,783,857,924,886,879,1275,762,762,772,1228,773,773,761,761,652,652,772,322,694,1173,783,773,725,773,773,774,450,783,834,1173,658,800,789,658,774,901,703,322,491,783,658,789,658,777,901,703,1860,1139,1139,569,1706,1139,1139,682,682,1024,569,1024,1139,779,1140,1609,455,455,1139,1120,1164,1139,1139,569,1460,1024,455,1706,1139,1139,682,1024,792,1024,1024,1024,1139,1139,1139,1139,939,939,1332,455,1024,455,1139,1116,772,725,713,764,652,469,469,772,785,322,322,322,322,554,322,322,563,1171,1171,783,783,782,773,768,696,322,450,783,794,774,724,658,734,734,734,756,746,0,0,0,0,0,0,0,0,0,0,0]],\n [7678, [0,0,1366,1139,1366,1139,1366,1139,1366,1139,1479,1024,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1251,569,1593,1139,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,569,455,569,569,1366,1024,1366,1024,1366,1024,1139,455,1139,455,1139,455,1139,455,1706,1706,1706,1706,1706,1706,1479,1139,1479,1139,1479,1139,1479,1139,1593,1139,1593,1139,1593,1139,1593,1139,1366,1139,1366,1139,1479,682,1479,682,1479,682,1479,682,1366,1024,1366,1024,1366,1024,1366,1024,1366,1024,1251,569,1251,569,1251,569,1251,569,1479,1139,1479,1139,1479,1139,1479,1139,1479,1139,1366,1024,1366,1024,1933,1479,1933,1479,1933,1479,1933,1479,1933,1479,1366,1024,1366,1024,1366,1024,1251,1024,1251,1024,1251,1024,1139,569,1479,1024,1139,455]],\n [7838, [1439]],\n [7840, [1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,1366,1139,569,455,569,455,1593,1139,1593,1139,1593,1139,1593,1139,1593,1139,1593,1139,1593,1139,1756,1343,1756,1343,1756,1343,1756,1343,1756,1343,1479,1139,1479,1139,1749,1371,1749,1371,1749,1371,1749,1371,1749,1371,1366,1024,1366,1024,1366,1024,1366,1024]],\n [7936, [1184,1184,1184,1184,1184,1184,1184,1184,1366,1366,1666,1666,1666,1666,1666,1666,913,913,913,913,913,913]],\n [7960, [1566,1566,1900,1900,1900,1900]],\n [7968, [1139,1139,1139,1139,1139,1139,1139,1139,1679,1679,2079,2079,2079,2079,2079,2079,455,455,455,455,455,455,455,455,769,769,1169,1169,1169,1169,1169,1169,1139,1139,1139,1139,1139,1139]],\n [8008, [1693,1693,2093,2093,1993,1993]],\n [8016, [1120,1120,1120,1120,1120,1120,1120,1120]],\n [8025, [1666]],\n [8027, [1966]],\n [8029, [2066]],\n [8031, [1966,1599,1599,1599,1599,1599,1599,1599,1599,1631,1631,2031,2031,1931,1931,1931,1931,1184,1184,913,913,1139,1139,455,455,1139,1139,1120,1120,1599,1599]],\n [8064, [1184,1184,1184,1184,1184,1184,1184,1184,1366,1366,1666,1666,1666,1666,1666,1666,1139,1139,1139,1139,1139,1139,1139,1139,1679,1679,2079,2079,2079,2079,2079,2079,1599,1599,1599,1599,1599,1599,1599,1599,1631,1631,2031,2031,1931,1931,1931,1931,1184,1184,1184,1184,1184]],\n [8118, [1184,1184,1366,1366,1366,1366,1366,682,682,682,682,682,1139,1139,1139]],\n [8134, [1139,1139,1666,1666,1779,1779,1479,682,682,682,455,455,455,455]],\n [8150, [455,455,569,569,869,869]],\n [8157, [682,682,682,1120,1120,1120,1120,1165,1165,1120,1120,1366,1366,1766,1816,1566,682,682,682]],\n [8178, [1599,1599,1599]],\n [8182, [1599,1599,1893,1693,1831,1631,1531,682,682]],\n [8192, [1024,2048,1024,2048,683,512,341,1139,569,410,171,0,0,0,0,0,682]],\n [8210, [1139,1139,2048,2048,846,1131,455,455,455,455,682,682,682,682,1139,1139,717]],\n [8230, [2048]],\n [8234, [0,0,0,0,0,410,2048]],\n [8242, [384,725,725]],\n [8249, [682,682]],\n [8252, [1024]],\n [8254, [682]],\n [8260, [342]],\n [8286, [569]],\n [8298, [0,0,0,0,0,0]],\n [8308, [880,849,843,741,864,877]],\n [8319, [747,850,691,795,834,836,825,826,704,849,812]],\n [8336, [762,761,773,672,761]],\n [8352, [1139,1479,1479,1139,1139,1706,1479,2240,2384,1933,1739,1051,1139,1366,1251,2048,1067,1366,1593,1366,1139,1479]],\n [8383, [1516]],\n [8432, [0]],\n [8453, [1813]],\n [8467, [662]],\n [8470, [2197,1509]],\n [8482, [2048]],\n [8486, [1573]],\n [8494, [1229]],\n [8525, [1931,1003]],\n [8531, [1708,1708]],\n [8539, [1708,1708,1708,1708]],\n [8580, [1024]],\n [8592, [2048,1024,2048,1024,2048,1024]],\n [8616, [1024]],\n [8660, [2048]],\n [8706, [1012]],\n [8710, [1253]],\n [8719, [1686]],\n [8721, [1460,1196]],\n [8725, [342]],\n [8729, [569,1124]],\n [8734, [1460,2005]],\n [8745, [1472]],\n [8747, [561]],\n [8776, [1124]],\n [8800, [1124,1195,2048]],\n [8804, [1124,1124]],\n [8962, [1237]],\n [8976, [1196]],\n [8992, [1237,1237]],\n [9472, [1451]],\n [9474, [1280]],\n [9484, [1451]],\n [9488, [1451]],\n [9492, [1451]],\n [9496, [1451]],\n [9500, [1451]],\n [9508, [1451]],\n [9516, [1451]],\n [9524, [1451]],\n [9532, [1451]],\n [9552, [1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451]],\n [9600, [1451]],\n [9604, [1451]],\n [9608, [1451]],\n [9612, [1451]],\n [9616, [1451,1451,1451,1493]],\n [9632, [1237,1237]],\n [9642, [726,726,2048]],\n [9650, [2027]],\n [9658, [2027]],\n [9660, [2027]],\n [9668, [2027]],\n [9674, [1012,1237,1217]],\n [9679, [1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237]],\n [9702, [726]],\n [9786, [2091,2155,1877]],\n [9791, [1536,1536,1536,1536,1536,1536,1536,1536,1536]],\n [9824, [1088]],\n [9827, [1344]],\n [9829, [1216,1045]],\n [9833, [2048,1024,1536,2048]],\n [9839, [1024]],\n [11360, [1139,455,1139,1366,1479,1139,569,1479,1139,1366,1024,1251,1024,1500]],\n [11377, [1222,2124,1722,1024,1182,871,1328]],\n [11799, [682]],\n [42775, [0,0,0,0,1024,1024,569,569,569,0,0]],\n [42888, [682,569,896,391,391]],\n [64257, [1024,1024]],\n [64285, [532,0,1042,1192,1286,1135,1298,1075,1085,1389,1094,1415,1151,1495,1495,1495,1495,1286,1286,1286,1225,866,1135,1298,532,662]],\n [64312, [1337,532,1094,1075,1085]],\n [64318, [1407]],\n [64320, [797,1343]],\n [64323, [1276,1249]],\n [64326, [1116,1208,1094,1495,1415,532,1225,1075,1249,1286]],\n [65056, [0,0,0,0]],\n [65532, [2048]]\n ]\n}\n", Dn = "{\n \"format\": \"sheetxl-font-metrics/1\",\n \"family\": \"Calibri\",\n \"weight\": 700,\n \"italic\": false,\n \"source\": { \"family\": \"Carlito\", \"version\": \"Version 1.103\", \"license\": \"OFL-1.1\", \"notice\": \"Copyright (c) 2010-2013 by tyPoland Lukasz Dziedzic (http://www.typoland.com/) with Reserved Font Name \\\"Carlito\\\". Licensed under the SIL Open Font License, Version 1.1 (http://scripts.sil.org/OFL).\" },\n \"unitsPerEm\": 2048,\n \"winAscent\": 1950,\n \"winDescent\": 550,\n \"underline\": [-103, 194],\n \"strikeout\": [512, 134],\n \"advances\": [\n [0, [0]],\n [13, [0]],\n [32, [463,667,898,1020,1038,1493,1443,478,638,638,1020,1020,528,627,547,880,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,565,565,1020,1020,1020,949,1840,1241,1148,1084,1291,999,940,1305,1292,546,678,1120,866,1790,1349,1385,1090,1405,1153,968,1014,1337,1211,1856,1128,1064,979,665,880,665,1020,1020,615,1011,1099,857,1099,1031,648,971,1099,503,523,983,503,1666,1099,1101,1099,1099,728,817,710,1099,969,1526,941,970,814,704,973,704,1020]],\n [161, [667,1020,1038,1020,1038,1020,1020,849,1709,852,1103,1020]],\n [174, [1038,799,701,1020,692,688,616,1154,1224,548,621,517,891,1103,1347,1415,1437,949,1241,1241,1241,1241,1241,1241,1588,1084,999,999,999,999,546,546,546,546,1309,1349,1385,1385,1385,1385,1385,1020,1394,1337,1337,1337,1337,1064,1090,1136,1011,1011,1011,1011,1011,1011,1587,857,1031,1031,1031,1031,503,503,503,503,1099,1099,1101,1101,1101,1101,1101,1020,1114,1099,1099,1099,1099,970,1099,970,1241,1011,1241,1011,1241,1011,1084,857,1084,857,1084,857,1084,857,1291,1222,1309,1165,999,1031,999,1031,999,1031,999,1031,999,1031,1305,971,1305,971,1305,971,1305,971,1292,1099,1347,1121,546,503,546,503,546,503,546,503,546,503,1225,1027,678,523,1120,983,983,866,503,866,503,881,627,1150,865,886,540,1349,1099,1349,1099,1349,1099,1274,1313,1099,1385,1101,1385,1101,1385,1101,1790,1726,1153,728,1153,728,1153,728,968,817,968,817,968,817,968,817,1014,710,1014,744,1014,726,1337,1099,1337,1099,1337,1099,1337,1099,1337,1099,1337,1099,1856,1526,1064,970,1064,979,814,979,814,979,814,529,1170,1368,1138,1099,1171,1119,1075,1243,950,1309,1511,1138,1099,1091,999,1347,1009,940,1020,1395,1210,1646,614,616,1124,983,641,996,1820,1349,1099,1385,1566,1296,1642,1415,1310,1099,1153,975,826,962,913,749,1116,710,1014,1559,1326,1394,1337,1125,1052,979,814,1003,1009,981,884,1038,1038,866,805,1099,541,985,1203,667,2270,2105,1913,1577,1389,1026,2027,1872,1622,1241,1011,546,503,1385,1101,1337,1099,1337,1099,1337,1099,1337,1099,1337,1099,1031,1241,1011,1241,1011,1588,1587,1321,1140,1305,971,1120,983,1385,1101,1385,1101,1003,937,523,2245,2105,1913,1305,971,1812,1254,1349,1099,1241,1011,1588,1587,1394,1114,1241,1011,1241,1011,999,1031,999,1031,546,503,546,503,1385,1101,1385,1101,1153,728,1153,728,1337,1099,1337,1099,968,817,1014,710,1003,937,1292,1099,1315,1243,1081,1055,1004,826,1241,1011,999,1031,1385,1101,1385,1101,1385,1101,1385,1101,1064,970,676,1276,719,523,1693,1695,1241,1094,866,901,1034,817,814,898,890,1174,1374,1216,1000,1019,707,608,1295,1099,1181,776,1204,1010,1011,1099,1100,1099,867,904,1099,1121,1031,1031,1316,874,874,1103,1079,597,1118,1098,1098,980,992,1099,1099,1099,619,586,503,807,824,516,1195,1666,1666,1666,1099,1099,1128,1097,1473,1447,1432,728,728,729,728,728,672,672,1002,1002,817,494,582,494,671,710,710,1201,1197,1089,969,1526,970,948,824,981,937,942,898,898,898,857,1325,1013,1079,1108,1117,676,983,828,1120,898,898,1716,1789,1883,1314,1030,1439,1634,1268,1214,1075,1007,1117,1118,763,763,388,512,502,524,692,1051,678,439]],\n [699, [528,528,528,462,462,665,665,1020,1020,1099,1099,822,822,593]],\n [715, [615,593,807,615,616,569,569,462,462,682,682,682,682,788,482,671,646,910,995,682,682,682,374,570,681,665,784,784,784,784,784,682,682,822,1178,891,682,682,682,682,671]],\n [757, [961]],\n [759, [910,565,682,682,682,682,1088,1088,770]],\n [773, [0]],\n [781, [0,0,0,0,0]],\n [787, [0,0,508]],\n [792, [0,0,0,682,0,0,0,0,0,0,0]],\n [805, [0]],\n [809, [0,0,0]],\n [815, [0]],\n [818, [0,0]],\n [822, [0]],\n [825, [0,0,0,0,0,0,0]],\n [835, [0]],\n [838, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [857, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [884, [528,528]],\n [890, [562,867,857,867,565]],\n [900, [649,1012,1241,548,999,1292,546]],\n [908, [1385]],\n [910, [1064,1394,586,1241,1148,839,1183,999,979,1292,1385,546,1120,1216,1790,1349,1008,1385,1292,1090]],\n [931, [962,1014,1064,1641,1128,1654,1394,546,1064,1210,937,1114,586,1123,1210,1117,957,1091,937,746,1114,1116,586,983,996,1154,965,789,1101,1186,1086,833,1115,804,1123,1432,923,1511,1470,586,1123,1101,1123,1470]],\n [976, [1098,1208,1071,1071,1071,1441,1733,1252,1385,1101,1075,839,940,914,1131,967,1228,1232,1809,1666,1117,1081,1148,1067,1038,860,1190,974,1368,1105,1031,826,1239,1082,857,523,1385,916,916,1090,1119,1084,1470,1262,1086,1110,1084,1110,999,999,1302,885,1103,968,546,546,678,1834,1836,1295,1153,1335,1121,1287,1241,1138,1148,885,1378,999,1705,987,1335,1335,1153,1288,1790,1292,1385,1290,1090,1084,1014,1121,1482,1128,1347,1166,1837,1898,1309,1635,1133,1103,1871,1176,1011,1090,1013,726,1192,1031,1509,874,1140,1140,1013,1077,1461,1117,1101,1094,1099,857,798,970,1383,941,1151,1000,1563,1616,1143,1458,1013,895,1542,1020,1031,1031,1133,726,896,817,503,503,523,1590,1626,1121,1013,1140,970,1100,1938,1473,1306,1089,1599,1337,1333,1173,1832,1615,1490,1282,1960,1722,1010,870,1654,1511,1385,1097,1253,1017]],\n [1143, [1017,2250,1960,1465,1200,1938,1628,1938,1473,1060,834,1248,0,0,0,0]],\n [1160, [2018,1944,1416,1206,1163,1031,1090,1099,889,752,903,774,1135,935,1818,1598,987,874,1268,1099,1203,1083,1180,1047,1323,1165,1378,1172,1490,1269,1880,1524,1351,1155,1084,857,1014,797,1064,975,1064,975,1239,1026,1541,1254,1227,1086,1166,1030,1166,1030,1597,1285,1597,1285,546,1705,1509,1196,1040,1368,1143,1292,1116,1373,1182,1166,1030,1871,1505,546,1241,1011,1241,1011,1588,1587,999,1031,1347,1031,1347,1031,1705,1509,987,874,1003,937,1335,1140,1335,1140,1385,1101,1385,1101,1385,1101,1103,895,1121,970,1121,970,1121,970,1166,1000,874,726,1635,1458,903,774,1223,1022,1128,941,1133,1099,1673,1595,1536,1395,1078,970,1808,1584,1812,1623,1318,1117,1299,1157,1009,874,1348,1134]],\n [3647, [1038]],\n [7424, [1063,1399,1587,1061,955,1122,1122,864]],\n [7433, [503,621,994,762,1461,1140,1192,955,1162,1161,1320,1726,953,1101,1101,987,1014,1014,853,1158,1135,1507,1175,1033,1595,878,860,817,1012,780,1003,1141,987,1444,1098,787,1047,778,807,875,695,695,892,871,432,517,756,615,1178,914,909,929,761,756,781,688,888,1185,703,684,757,1068,757,757,711,696,635,631,668,378,704,1132,761,757,580,742,742,757,506,763]],\n [7514, [1132,677,679,754,638,732,977,706,378,512,763,677,754,638,749,977,706,1691,1247,1242,813,1907,1362,1212,870,829,1004,813,880,971,813,994,1711,620,669,1140,1250,1236,1099,1198,680,1461,1131,583,1751,1184,1099,728,941,876,979,1070,850,1208,1234,1130,1041,904,874,1041,630,867,494,1224,907,741,580,622,736,631,464,449,668,763,503,434,378,504,557,444,435,584,1132,1132,812,812,802,757,951,570,522,531,855,816,747,740,705,570,670,714,674,790,0,0,0,0,0,0,0,0,0,0,0]],\n [7678, [0,0,1241,1011,1148,1099,1148,1099,1148,1099,1084,857,1291,1099,1291,1099,1291,1099,1291,1099,1291,1099,999,1031,999,1031,999,1031,999,1031,999,1031,940,648,1305,971,1292,1099,1292,1099,1292,1099,1292,1099,1292,1099,546,503,546,503,1120,983,1120,983,1120,983,866,503,866,503,866,503,866,503,1790,1666,1790,1666,1790,1666,1349,1099,1349,1099,1349,1099,1349,1099,1385,1101,1385,1101,1385,1101,1385,1101,1090,1099,1090,1099,1153,728,1153,728,1153,728,1153,728,968,817,968,817,968,817,968,817,968,817,1014,710,1014,710,1014,710,1014,710,1337,1099,1337,1099,1337,1099,1337,1099,1337,1099,1211,969,1211,969,1856,1526,1856,1526,1856,1526,1856,1526,1856,1526,1128,941,1128,941,1064,970,979,814,979,814,979,814,1099,710,1526,970,1011,529]],\n [7838, [1173]],\n [7840, [1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,1241,1011,999,1031,999,1031,999,1031,999,1031,999,1031,999,1031,999,1031,999,1031,546,503,546,503,1385,1101,1385,1101,1385,1101,1385,1101,1385,1101,1385,1101,1385,1101,1428,1296,1428,1296,1428,1296,1428,1296,1428,1296,1337,1099,1337,1099,1559,1326,1559,1326,1559,1326,1559,1326,1559,1326,1064,970,1064,970,1064,970,1064,970]],\n [7936, [1210,1210,1210,1210,1210,1210,1210,1210,1241,1241,1241,1241,1241,1241,1241,1241,937,937,937,937,937,937]],\n [7960, [999,999,1258,1258,1258,1258]],\n [7968, [1114,1114,1114,1114,1114,1114,1114,1114,1292,1292,1551,1551,1551,1551,1479,1479,586,586,586,586,586,586,586,586,546,546,805,805,805,805,733,546,1101,1101,1101,1101,1101,1101]],\n [8008, [1385,1385,1590,1590,1590,1590]],\n [8016, [1123,1123,1123,1123,1123,1123,1123,1123]],\n [8025, [1064]],\n [8027, [1425]],\n [8029, [1425]],\n [8031, [1425,1470,1470,1470,1470,1470,1470,1470,1470,1394,1394,1598,1598,1598,1598,1523,1530,1210,1210,937,937,1114,1114,586,586,1101,1101,1123,1123,1470,1470]],\n [8064, [1210,1210,1210,1210,1210,1210,1210,1210,1241,1241,1241,1241,1241,1241,1241,1241,1114,1114,1114,1114,1114,1114,1114,1114,1292,1292,1551,1551,1551,1551,1479,1479,1470,1470,1470,1470,1470,1470,1470,1470,1394,1394,1598,1598,1598,1598,1530,1530,1210,1210,1210,1210,1210]],\n [8118, [1210,1210,1241,1241,1241,1241,1241,473]],\n [8127, [473,922,804,1114,1114,1114]],\n [8134, [1114,1114,999,999,1292,1292,1292,809,809,804,586,586,586,586]],\n [8150, [586,586,546,546,546,546]],\n [8157, [809,809,804,1123,1123,1123,1123,1086,1086,1123,1123,1064,1064,1064,1064,1090,1012,1012,649]],\n [8178, [1470,1470,1470]],\n [8182, [1470,1470,1385,1385,1394,1394,1394,649,473]],\n [8192, [1024,2048,1024,2048,687,512,341,1038,444,409,256,0,0,0,0,0]],\n [8210, [1038,1020,1854,1854,985,1022,528,528,528,528,891,891,891,891,1020,1020,1020]],\n [8230, [1457]],\n [8239, [463,2174]],\n [8243, [835,1221]],\n [8249, [705,705]],\n [8252, [1202,1034,1020]],\n [8260, [728]],\n [8286, [601,455]],\n [8304, [815,378]],\n [8308, [749,690,740,669,749,740,727,720,711,455,455,761,815,517,692,688,749,690,740,669,749,740,727,720,711,455,455,652,703,696,757,681,711]],\n [8352, [1323,1114,1084,950,1038,1666,1411,1884,1563,1945,1565,1165,1038,1148,1014,2286,1149,1211,1249,1274,1063,1084]],\n [8376, [1038,1038]],\n [8413, [2036]],\n [8453, [1589]],\n [8467, [1081]],\n [8470, [2142,1709]],\n [8480, [1497]],\n [8482, [1475]],\n [8486, [1394]],\n [8494, [1513]],\n [8498, [940]],\n [8525, [1569,750]],\n [8531, [1428,1530,1428,1530,1515,1543,1370,1457,1426,1512,1512,1392,812]],\n [8579, [1084,867]],\n [8592, [1854,1854,1854,1854,2683,1574,1719,1719,1719,1719]],\n [8616, [967]],\n [8706, [1100]],\n [8710, [1183]],\n [8719, [1602]],\n [8721, [1127,1020]],\n [8725, [780]],\n [8730, [1020]],\n [8734, [1716,1400]],\n [8745, [1437]],\n [8747, [769]],\n [8776, [1020]],\n [8800, [1020,1020]],\n [8804, [1020,1020]],\n [8962, [1793]],\n [8976, [1020]],\n [8992, [1106,1106]],\n [9312, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [9450, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [9471, [2720,1024]],\n [9474, [1024]],\n [9484, [1024]],\n [9488, [1024]],\n [9492, [1024]],\n [9496, [1024]],\n [9633, [1237]],\n [9642, [725,725]],\n [9674, [1093,1126,1217]],\n [9679, [1237]],\n [9702, [725]],\n [9728, [1506]],\n [9788, [1506]],\n [9833, [0]],\n [10102, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [11360, [912,656,996,1123,1153,1011,761,1378,1160,1228,1069,1013,829]],\n [11380, [1012,1001,846,1433]],\n [11799, [656]],\n [42775, [807,807,804,682]],\n [42784, [1810,1810]],\n [63743, [1522]],\n [64256, [1230,1135,1135,1718,1718]],\n [65056, [0,0,0,0]],\n [65279, [0]]\n ]\n}\n", On = "{\n \"format\": \"sheetxl-font-metrics/1\",\n \"family\": \"Calibri\",\n \"weight\": 400,\n \"italic\": false,\n \"source\": { \"family\": \"Carlito\", \"version\": \"Version 1.103\", \"license\": \"OFL-1.1\", \"notice\": \"Copyright (c) 2010-2013 by tyPoland Lukasz Dziedzic (http://www.typoland.com/) with Reserved Font Name \\\"Carlito\\\". Licensed under the SIL Open Font License, Version 1.1 (http://scripts.sil.org/OFL).\" },\n \"unitsPerEm\": 2048,\n \"winAscent\": 1950,\n \"winDescent\": 550,\n \"underline\": [-103, 194],\n \"strikeout\": [512, 134],\n \"advances\": [\n [0, [0]],\n [13, [0]],\n [32, [463,667,821,1020,1038,1464,1397,452,621,621,1020,1020,511,627,517,791,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,548,548,1020,1020,1020,949,1831,1185,1114,1092,1260,1000,941,1292,1276,516,653,1064,861,1751,1322,1356,1058,1378,1112,941,998,1314,1162,1822,1063,998,959,628,791,628,1020,1020,596,981,1076,866,1076,1019,625,964,1076,470,490,931,470,1636,1076,1080,1076,1076,714,801,686,1076,925,1464,887,927,809,644,943,644,1020]],\n [161, [667,1020,1038,1020,1038,1020,1020,804,1709,824,1049,1020]],\n [174, [1038,807,694,1020,688,685,598,1126,1200,517,629,504,865,1049,1303,1375,1383,949,1185,1185,1185,1185,1185,1185,1563,1092,1000,1000,1000,1000,516,516,516,516,1279,1322,1356,1356,1356,1356,1356,1020,1359,1314,1314,1314,1314,998,1058,1080,981,981,981,981,981,981,1583,866,1019,1019,1019,1019,470,470,470,470,1076,1076,1080,1080,1080,1080,1080,1020,1084,1076,1076,1076,1076,927,1076,927,1185,981,1185,981,1185,981,1092,866,1092,866,1092,866,1092,866,1260,1164,1279,1130,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,1292,964,1292,964,1292,964,1292,964,1276,1076,1344,1091,516,470,516,470,516,470,516,470,516,470,1170,960,653,490,1064,931,931,861,470,861,470,866,540,1118,765,880,507,1322,1076,1322,1076,1322,1076,1186,1287,1076,1356,1080,1356,1080,1356,1080,1775,1740,1112,714,1112,714,1112,714,941,801,941,801,941,801,941,801,998,686,998,708,998,700,1314,1076,1314,1076,1314,1076,1314,1076,1314,1076,1314,1076,1822,1464,998,927,998,959,809,959,809,959,809,497,1130,1260,1101,1076,1088,1076,1122,1181,947,1279,1406,1101,1076,1072,1000,1317,970,941,1020,1294,1162,1603,592,550,1064,931,577,948,1801,1322,1100,1356,1428,1184,1583,1342,1252,1076,1112,941,801,939,882,736,1087,686,998,1478,1234,1360,1314,1090,1020,959,809,970,970,970,870,1038,1038,872,801,1076,499,809,1175,667,2219,2069,1885,1539,1351,960,1975,1812,1566,1185,981,516,470,1356,1080,1314,1076,1314,1076,1314,1076,1314,1076,1314,1076,1019,1185,981,1185,981,1563,1583,1292,1100,1292,964,1064,931,1356,1080,1356,1080,970,970,490,2197,2069,1885,1292,964,1832,1236,1322,1076,1185,981,1563,1583,1359,1084,1185,981,1185,981,1000,1019,1000,1019,516,470,516,470,1356,1080,1356,1080,1112,714,1112,714,1314,1076,1314,1076,941,801,998,686,970,970,1276,1076,1316,1229,1038,1038,1007,844,1185,981,1000,1019,1356,1080,1356,1080,1356,1080,1356,1080,998,927,649,1259,686,490,1683,1682,1185,1092,866,861,998,801,809,916,916,1131,1349,1173,1000,1019,673,576,1290,1076,1129,767,1184,994,981,1076,1076,1076,866,923,1076,1076,1019,1019,1307,866,866,1077,1083,577,1076,1076,1105,925,976,1075,1076,1076,577,562,470,743,761,470,1158,1635,1635,1636,1076,1076,1107,1080,1459,1426,1334,714,714,714,714,714,654,654,920,920,801,490,578,490,650,686,686,1188,1142,1109,925,1464,927,849,809,979,956,955,916,916,916,866,1287,981,1083,1131,1095,650,931,793,1076,916,916,1647,1748,1817,1267,964,1402,1548,1198,1129,1007,1007,1076,1101,745,745,365,502,502,515,651,1007,646,452]],\n [699, [511,511,511,462,462,665,665,1020,1020,1099,1099,809,809,593]],\n [715, [596,593,807,596,598,569,569,462,462,682,682,682,682,780,462,657,639,922,961,682,682,609,350,560,638,665,784,784,784,784,784,682,682,809,1178,857,682,682,682,682,657]],\n [757, [961]],\n [759, [922,548,682,682,682,682,1088,1088,770]],\n [773, [0]],\n [781, [0,0,0,0,0]],\n [787, [0,0,511]],\n [792, [0,0,0,682,0,0,0,0,0,0,0]],\n [805, [0]],\n [809, [0,0,0]],\n [815, [0]],\n [818, [0,0]],\n [822, [0]],\n [825, [0,0,0,0,0,0,0]],\n [835, [0]],\n [838, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [857, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n [884, [511,511]],\n [890, [562,866,866,866,548]],\n [900, [649,1012,1185,517,1000,1276,516]],\n [908, [1356]],\n [910, [998,1360,562,1185,1114,851,1156,1000,959,1276,1356,516,1064,1173,1751,1322,1007,1356,1276,1058]],\n [931, [939,998,998,1555,1063,1536,1360,516,998,1162,933,1100,562,1109,1162,1088,914,1072,933,712,1100,1089,562,931,948,1126,919,770,1080,1132,1042,841,1089,793,1109,1334,873,1449,1426,562,1109,1080,1109,1426]],\n [976, [1074,1144,998,1110,998,1339,1668,1239,1356,1080,1092,841,941,888,1117,921,1186,1186,1801,1636,1116,1071,1138,1048,1092,858,1232,1035,1378,1089,969,806,1239,1042,866,490,1356,885,885,1058,1142,1092,1431,1221,1042,1092,1092,1092,1000,1000,1279,880,1121,941,516,516,653,1786,1795,1266,1112,1314,1080,1269,1185,1101,1114,880,1319,1000,1640,970,1314,1314,1112,1251,1751,1276,1356,1273,1058,1092,998,1080,1428,1063,1308,1138,1778,1822,1259,1560,1088,1122,1800,1137,981,1091,981,708,1143,1019,1411,866,1107,1107,950,1045,1385,1095,1080,1066,1076,866,793,927,1278,887,1109,960,1492,1534,1098,1364,962,907,1478,971,1019,1019,1107,708,909,801,470,470,490,1538,1576,1091,950,1107,927,1075,1900,1386,1284,1063,1601,1332,1291,1075,1703,1455,1480,1152,1855,1547,970,846,1536,1449,1356,1073,1208,978]],\n [1143, [978,2140,1861,1356,1180,1900,1602,1900,1386,1092,866,1248,0,0,0,0]],\n [1160, [2018,1944,1358,1119,1088,991,1058,1076,886,725,870,761,1089,927,1714,1472,970,866,1189,1012,1112,950,1130,1003,1292,1095,1316,1137,1457,1240,1848,1521,1323,1135,1092,866,998,793,998,925,998,925,1142,946,1490,1221,1178,1002,1138,960,1138,960,1526,1224,1526,1224,516,1640,1411,1119,975,1294,1057,1276,1095,1276,1108,1138,960,1799,1462,516,1185,981,1185,981,1563,1583,1000,1019,1317,1019,1317,1019,1640,1411,970,866,970,956,1314,1107,1314,1107,1356,1080,1356,1073,1356,1073,1122,907,1080,927,1080,927,1080,927,1138,960,851,708,1560,1364,870,761,1157,945,1063,887,1088,1076,1629,1621,1565,1435,1050,954,1807,1567,1832,1616,1301,1093,1313,1153,970,866,1289,1067]],\n [3647, [1038]],\n [7424, [982,1295,1583,1042,971,1092,1113,831]],\n [7433, [470,551,913,752,1385,1107,1140,971,1193,1192,1320,1740,872,1080,1080,936,975,975,831,1130,1125,1479,1636,990,1550,847,815,801,976,754,990,1104,936,1327,1038,757,1009,743,763,843,680,680,836,859,422,459,736,603,1133,885,885,885,690,728,667,599,788,1093,684,684,741,1067,741,741,696,696,631,631,663,355,663,1110,742,742,590,742,742,741,483,745]],\n [7514, [1110,645,586,702,582,643,869,607,355,502,745,645,702,582,741,869,607,1684,1211,1213,778,1692,1204,1214,850,794,925,783,809,964,772,964,1672,577,617,1128,1243,1220,1076,1105,625,1356,1054,496,1663,1105,1076,714,891,762,925,1005,828,1148,1240,1076,1019,866,866,1019,470,866,563,1240,886,741,590,622,690,631,449,449,663,745,402,426,355,402,485,404,379,548,1110,1110,795,796,772,742,822,560,365,484,745,696,742,742,645,567,660,678,626,742,0,0,0,0,0,0,0,0,0,0,0]],\n [7678, [0,0,1185,981,1114,1076,1114,1076,1114,1076,1092,866,1260,1076,1260,1076,1260,1076,1260,1076,1260,1076,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,941,625,1292,964,1276,1076,1276,1076,1276,1076,1276,1076,1276,1076,516,470,516,470,1064,931,1064,931,1064,931,861,470,861,470,861,470,861,470,1751,1636,1751,1636,1751,1636,1322,1076,1322,1076,1322,1076,1322,1076,1356,1080,1356,1080,1356,1080,1356,1080,1058,1076,1058,1076,1112,714,1112,714,1112,714,1112,714,941,801,941,801,941,801,941,801,941,801,998,686,998,686,998,686,998,686,1314,1076,1314,1076,1314,1076,1314,1076,1314,1076,1162,925,1162,925,1822,1464,1822,1464,1822,1464,1822,1464,1822,1464,1063,887,1063,887,998,927,959,809,959,809,959,809,1076,686,1464,927,981,497]],\n [7838, [1149]],\n [7840, [1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1185,981,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,1000,1019,516,470,516,470,1356,1080,1356,1080,1356,1080,1356,1080,1356,1080,1356,1080,1356,1080,1428,1184,1428,1184,1428,1184,1428,1184,1428,1184,1314,1076,1314,1076,1478,1234,1478,1234,1478,1234,1478,1234,1478,1234,998,927,998,927,998,927,998,927]],\n [7936, [1162,1162,1162,1162,1162,1162,1162,1162,1185,1185,1185,1185,1185,1185,1185,1185,933,933,933,933,933,933]],\n [7960, [1000,1000,1213,1213,1213,1217]],\n [7968, [1100,1100,1100,1100,1100,1100,1100,1100,1276,1276,1489,1489,1489,1489,1369,1369,562,562,562,562,562,562,562,562,516,516,729,729,729,729,609,609,1080,1080,1080,1080,1080,1080]],\n [8008, [1356,1356,1548,1541,1525,1522]],\n [8016, [1109,1109,1109,1109,1109,1109,1109,1109]],\n [8025, [998]],\n [8027, [1299]],\n [8029, [1303]],\n [8031, [1183,1426,1426,1426,1426,1426,1426,1426,1426,1360,1360,1549,1553,1522,1522,1433,1433,1162,1162,933,933,1100,1100,562,562,1080,1080,1109,1109,1426,1426]],\n [8064, [1162,1162,1162,1162,1162,1162,1162,1162,1185,1185,1185,1185,1185,1185,1185,1185,1100,1100,1100,1100,1100,1100,1100,1100,1276,1276,1489,1489,1489,1489,1369,1369,1426,1426,1426,1426,1426,1426,1426,1426,1360,1360,1549,1553,1522,1522,1433,1433,1162,1162,1162,1162,1162]],\n [8118, [1162,1162,1185,1185,1185,1185,1185,473]],\n [8127, [473,922,804,1100,1100,1100]],\n [8134, [1100,1100,1000,1000,1276,1276,1276,809,809,804,562,562,562,562]],\n [8150, [562,562,516,516,516,516]],\n [8157, [809,809,804,1109,1109,1109,1109,1042,1042,1109,1109,998,998,998,998,1058,1012,1012,649]],\n [8178, [1426,1426,1426]],\n [8182, [1426,1426,1356,1356,1360,1360,1360,649,473]],\n [8192, [1024,2048,1024,2048,687,512,341,1104,444,409,256,0,0,0,0,0]],\n [8210, [1038,1020,1854,1854,809,1020,511,511,511,511,857,857,857,856,1020,1020,1020]],\n [8230, [1414]],\n [8239, [463,2126]],\n [8243, [820,1188]],\n [8249, [694,694]],\n [8252, [1142,990,1020]],\n [8260, [689]],\n [8286, [548,455]],\n [8304, [801,355]],\n [8308, [731,678,735,657,737,735,746,735,720,444,444,742,801,504,688,685,731,678,735,657,737,735,746,735,720,444,444,631,684,696,742,638,696]],\n [8352, [1262,1092,1092,941,1038,1636,1322,1888,1608,1822,1525,1130,1038,1064,998,2216,1082,1154,1202,1173,941,1092]],\n [8376, [1038,1038]],\n [8413, [2036]],\n [8453, [1569]],\n [8467, [1029]],\n [8470, [2099,1709]],\n [8480, [1452]],\n [8482, [1444]],\n [8486, [1360]],\n [8494, [1513]],\n [8498, [941]],\n [8525, [1569,750]],\n [8531, [1385,1481,1385,1481,1463,1485,1326,1405,1363,1442,1442,1322,787]],\n [8579, [1092,866]],\n [8592, [1854,1854,1854,1854,2638,1592,1806,1806,1806,1806]],\n [8616, [967]],\n [8706, [1091]],\n [8710, [1156]],\n [8719, [1637]],\n [8721, [1108,1020]],\n [8725, [689]],\n [8730, [1020]],\n [8734, [1747,1400]],\n [8745, [1437]],\n [8747, [749]],\n [8776, [1020]],\n [8800, [1020,1020]],\n [8804, [1020,1020]],\n [8962, [1793]],\n [8976, [1020]],\n [8992, [1106,1106]],\n [9312, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [9450, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [9471, [2720,1024]],\n [9474, [1024]],\n [9484, [1024]],\n [9488, [1024]],\n [9492, [1024]],\n [9496, [1024]],\n [9633, [1237]],\n [9642, [725,725]],\n [9674, [1046,1126,1217]],\n [9679, [1237]],\n [9702, [725]],\n [9728, [1500]],\n [9788, [1500]],\n [9833, [0]],\n [10102, [2720,2720,2720,2720,2720,2720,2720,2720,2720,2720]],\n [11360, [861,577,962,1075,1112,981,686,1316,1123,1137,987,994,836]],\n [11380, [962,949,793,1339]],\n [11799, [627]],\n [42775, [807,807,804,682]],\n [42784, [1810,1810]],\n [63743, [1522]],\n [64256, [1195,1084,1084,1654,1654]],\n [65056, [0,0,0,0]],\n [65279, [0]]\n ]\n}\n", kn, An, jn = [
642
- "Arial",
643
- "Arial Black",
644
- "Brush Script MT",
645
- "Calibri",
646
- "Comic Sans MS",
647
- "Courier New",
648
- "Garamond",
649
- "Georgia",
650
- "Impact",
651
- "Luminari",
652
- "Palatino Linotype",
653
- "Tahoma",
654
- "Times New Roman",
655
- "Trebuchet MS",
656
- "Verdana"
657
- ], Mn = /* @__PURE__ */ new Map([
658
- [j.GenericName.Serif, ["Tahoma"]],
659
- [j.GenericName.SanSerif, ["Calibri"]],
660
- [j.GenericName.MonoSpace, ["Courier New"]],
661
- [j.GenericName.Cursive, ["Comic Sans MS"]],
662
- [j.GenericName.Fantasy, ["Luminari"]],
663
- [j.GenericName.UISystem, ["Arial"]],
664
- [j.GenericName.UISerif, ["Tahoma"]],
665
- [j.GenericName.UISanSerif, ["Arial"]],
666
- [j.GenericName.UIMonoSpace, ["Courier New"]],
667
- [j.GenericName.UIRounded, ["Arial"]],
668
- [j.GenericName.Math, []],
669
- [j.GenericName.Emoji, []],
670
- [j.GenericName.Fangsong, []]
671
- ]), Nn = /* @__PURE__ */ new Map([
672
- ["aptos", "calibri"],
673
- ["aptos narrow", "calibri"],
674
- ["aptos display", "calibri"],
675
- ["carlito", "calibri"],
676
- ["caladea", "cambria"],
677
- ["helvetica", "arial"],
678
- ["helvetica neue", "arial"],
679
- ["arial nova", "arial"],
680
- ["liberation sans", "arial"],
681
- ["arimo", "arial"],
682
- ["times", "times new roman"],
683
- ["liberation serif", "times new roman"],
684
- ["tinos", "times new roman"],
685
- ["courier", "courier new"],
686
- ["liberation mono", "courier new"],
687
- ["cousine", "courier new"],
688
- ["sans-serif", "calibri"],
689
- ["serif", "times new roman"],
690
- ["monospace", "courier new"],
691
- ["system-ui", "arial"],
692
- ["ui-system", "arial"],
693
- ["ui-sans-serif", "arial"],
694
- ["ui-rounded", "arial"],
695
- ["ui-serif", "times new roman"],
696
- ["ui-monospace", "courier new"]
697
- ]), Pn = /* @__PURE__ */ new Set([
698
- "serif",
699
- "sans-serif",
700
- "monospace",
701
- "cursive",
702
- "fantasy",
703
- "system-ui",
704
- "ui-system",
705
- "ui-serif",
706
- "ui-sans-serif",
707
- "ui-monospace",
708
- "ui-rounded",
709
- "math",
710
- "emoji",
711
- "fangsong"
712
- ]), Fn = (e) => e.trim().replace(/\s+/g, " ").toLowerCase(), Y = (e, t, n) => `${Fn(e)}|${t ? "b" : ""}${n ? "i" : ""}`, In = eval, Ln = (e) => {
713
- try {
714
- return In(`document.fonts.check('12px ${e}')`);
715
- } catch {
716
- return !0;
717
- }
718
- }, Rn = class e {
719
- static {
720
- this._shared = null;
721
- }
722
- static getShared() {
723
- return e._shared ??= new e([new wn()]), e._shared;
724
- }
725
- constructor(e) {
726
- this._entries = /* @__PURE__ */ new Map(), this._resolutions = /* @__PURE__ */ new Map(), this._loading = /* @__PURE__ */ new Set(), this._builtins = /* @__PURE__ */ new Map(), this._fontList = [], this._fontsByFamily = /* @__PURE__ */ new Map(), this._bestMatches = /* @__PURE__ */ new Map(), this._builders = e, this._emitter = new t(this), this._seedBuiltins(), this.setFontList(null);
727
- }
728
- getByName(e, t) {
729
- let n = t?.bold ?? !1, r = t?.italic ?? !1, i = Y(e, n, r), a = this._resolutions.get(i);
730
- if (a) return a;
731
- let o = this._resolve(e, n, r);
732
- return this._resolutions.set(i, o), o;
733
- }
734
- load(e) {
735
- let t = e.map((e) => {
736
- let t = typeof e == "string" ? { family: e } : e, n = Fn(t.family);
737
- return Pn.has(n) ? void 0 : this._ensure(n, t.bold ?? !1, t.italic ?? !1).done;
738
- });
739
- return Promise.all(t).then(() => {});
740
- }
741
- async whenReady() {
742
- for (; this._loading.size > 0;) await Promise.all(this._loading);
743
- }
744
- isLoading() {
745
- return this._loading.size > 0;
746
- }
747
- setAdvanceBuilders(e) {
748
- this._builders = e, this._entries.clear(), this._seedBuiltins(), this._changed();
749
- }
750
- getFontList() {
751
- return this._fontList;
752
- }
753
- setFontList(e) {
754
- let t = [];
755
- this._fontsByFamily.clear(), this._bestMatches.clear();
756
- for (let n of e ?? jn) {
757
- let e = typeof n == "string" ? new bn(n) : n, r = {
758
- fontRef: e,
759
- loaded: Ln(e.getFamily())
760
- };
761
- t.push(r), this._fontsByFamily.set(e.getFamily(), r);
762
- }
763
- this._fontList = Object.freeze(t);
764
- }
765
- findBestMatch(e, t) {
766
- let n = this._bestMatches.get(e);
767
- if (n) return n.fontRef ? n : null;
768
- let r = null;
769
- for (let n of [e, ...t?.fallbacks ?? []]) {
770
- r = this._fontsByFamily.get(n) ?? null;
771
- for (let e of r ? [] : Mn.get(n) ?? []) if (r = this._fontsByFamily.get(e) ?? null, r) break;
772
- if (r) break;
773
- }
774
- return this._bestMatches.set(e, r ?? {
775
- fontRef: null,
776
- loaded: !1
777
- }), r;
778
- }
779
- addListeners(e, t) {
780
- return this._emitter.addListeners(e, t);
781
- }
782
- get isIFontCollection() {
783
- return !0;
784
- }
785
- _seedBuiltins() {
786
- this._builtins = /* @__PURE__ */ new Map();
787
- for (let e of [
788
- On,
789
- Dn,
790
- En,
791
- Tn
792
- ].map((e) => J.fromJSON(JSON.parse(e)))) {
793
- let t = Y(e.family, e.weight >= 700, e.italic);
794
- this._builtins.set(t, e), this._entries.set(t, {
795
- state: "loaded",
796
- table: e,
797
- kind: "table",
798
- done: Promise.resolve()
799
- });
800
- }
801
- }
802
- _resolve(e, t, n) {
803
- let r = {
804
- family: e,
805
- weight: t ? 700 : 400,
806
- italic: n
807
- }, i = Fn(e), a = Pn.has(i) ? void 0 : this._ensure(i, t, n);
808
- if (a?.state === "loaded") return {
809
- table: a.table,
810
- kind: a.kind,
811
- status: "loaded",
812
- requested: r
813
- };
814
- let o = a?.state === "loading", s = Nn.get(i);
815
- if (s) {
816
- let e = this._ensure(s, t, n);
817
- if (e.state === "loaded") return {
818
- table: e.table,
819
- kind: "classified",
820
- status: o ? "loading" : "loaded",
821
- requested: r
822
- };
823
- o ||= e.state === "loading";
824
- }
825
- let c = s === "arial" || i === "arial" ? "arial" : "calibri";
826
- return {
827
- table: this._builtins.get(Y(c, t, !1)),
828
- kind: "generic",
829
- status: o ? "loading" : a?.state === "error" ? "error" : "loaded",
830
- requested: r
831
- };
832
- }
833
- _ensure(e, t, n) {
834
- let r = Y(e, t, n), i = this._entries.get(r);
835
- if (i) return i;
836
- let a = {
837
- state: "loading",
838
- done: Promise.resolve()
839
- }, o = {
840
- family: e,
841
- weight: t ? 700 : 400,
842
- italic: n
843
- }, s = this._builders, c = (async () => {
844
- try {
845
- for (let e of s) {
846
- let t = await e.build(o);
847
- if (t) return a.table = t, a.kind = e.kind, void (a.state = "loaded");
848
- }
849
- a.state = "missing";
850
- } catch {
851
- a.state = "error";
852
- }
853
- })().finally(() => {
854
- this._loading.delete(c), this._entries.get(r) === a && this._changed();
855
- });
856
- return a.done = c, this._entries.set(r, a), this._loading.add(c), a;
857
- }
858
- _changed() {
859
- this._resolutions.clear(), this._emitter.notify("onCollectionChange");
860
- }
861
- };
862
- (An = kn ||= {}).getShared = function() {
863
- return Rn.getShared();
864
- }, An.ResolutionKind = {
865
- Table: "table",
866
- Exact: "exact",
867
- Classified: "classified",
868
- Generic: "generic"
869
- }, An.FontStatus = {
870
- Loading: "loading",
871
- Loaded: "loaded",
872
- Error: "error"
873
- };
874
- var zn, Bn = e({
875
- DefaultFontSizes: () => Vn,
876
- findNextFontSize: () => Hn
877
- }), Vn = Object.freeze([
878
- 8,
879
- 9,
880
- 10,
881
- 11,
882
- 12,
883
- 14,
884
- 16,
885
- 18,
886
- 20,
887
- 22,
888
- 24,
889
- 26,
890
- 28,
891
- 30,
892
- 36,
893
- 48,
894
- 72
895
- ]);
896
- function Hn(e, t = !0, n = Vn) {
897
- if (!n || n.length === 0) return e;
898
- if (e === void 0) return n[0];
899
- if (t && e >= n[n.length - 1] || !t && e <= n[0]) return e;
900
- let r = R.findEqualOrGreater(n, e);
901
- return t ? (n[r] === e && (r += 1), n[r] || --r, n[r]) : (--r, n[r]);
902
- }
903
- (zn ||= {}).SortOn = {
528
+ (Fn ||= {}).SortOn = {
904
529
  Value: "value",
905
530
  FillColor: "fillColor",
906
531
  FontColor: "fontColor",
907
532
  Icon: "icon"
908
533
  };
909
- var Un = {
534
+ var Kn = {
910
535
  TopLeft: "tl",
911
536
  Top: "t",
912
537
  TopRight: "tr",
@@ -916,53 +541,53 @@ var Un = {
916
541
  BottomLeft: "bl",
917
542
  Bottom: "b",
918
543
  BottomRight: "br"
919
- }, X = Ut.BuiltInName, Wn = {
920
- [X.Normal]: W("style.builtin.normal"),
921
- [X.Comma]: W("style.builtin.comma"),
922
- [X.Currency]: W("style.builtin.currency"),
923
- [X.Percent]: W("style.builtin.percent"),
924
- [X.Comma0]: W("style.builtin.comma0"),
925
- [X.Currency0]: W("style.builtin.currency0"),
926
- [X.Hyperlink]: W("style.builtin.hyperlink"),
927
- [X.FollowedHyperlink]: W("style.builtin.followedHyperlink"),
928
- [X.Note]: W("style.builtin.note"),
929
- [X.WarningText]: W("style.builtin.warningText"),
930
- [X.Title]: W("style.builtin.title"),
931
- [X.Input]: W("style.builtin.input"),
932
- [X.Output]: W("style.builtin.output"),
933
- [X.Calculation]: W("style.builtin.calculation"),
934
- [X.CheckCell]: W("style.builtin.checkCell"),
935
- [X.LinkedCell]: W("style.builtin.linkedCell"),
936
- [X.Total]: W("style.builtin.total"),
937
- [X.Good]: W("style.builtin.good"),
938
- [X.Bad]: W("style.builtin.bad"),
939
- [X.Neutral]: W("style.builtin.neutral"),
940
- [X.ExplanatoryText]: W("style.builtin.explanatoryText")
941
- }, Gn = W("style.builtin.heading"), Kn = W("style.builtin.accent"), qn = W("style.builtin.accentTint"), Jn = /^Heading ([1-4])$/, Yn = /^Accent([1-6])$/, Xn = /^(20|40|60)% - Accent([1-6])$/;
942
- function Zn(e) {
943
- let t = Wn[e];
544
+ }, q = ln.BuiltInName, qn = {
545
+ [q.Normal]: U("style.builtin.normal"),
546
+ [q.Comma]: U("style.builtin.comma"),
547
+ [q.Currency]: U("style.builtin.currency"),
548
+ [q.Percent]: U("style.builtin.percent"),
549
+ [q.Comma0]: U("style.builtin.comma0"),
550
+ [q.Currency0]: U("style.builtin.currency0"),
551
+ [q.Hyperlink]: U("style.builtin.hyperlink"),
552
+ [q.FollowedHyperlink]: U("style.builtin.followedHyperlink"),
553
+ [q.Note]: U("style.builtin.note"),
554
+ [q.WarningText]: U("style.builtin.warningText"),
555
+ [q.Title]: U("style.builtin.title"),
556
+ [q.Input]: U("style.builtin.input"),
557
+ [q.Output]: U("style.builtin.output"),
558
+ [q.Calculation]: U("style.builtin.calculation"),
559
+ [q.CheckCell]: U("style.builtin.checkCell"),
560
+ [q.LinkedCell]: U("style.builtin.linkedCell"),
561
+ [q.Total]: U("style.builtin.total"),
562
+ [q.Good]: U("style.builtin.good"),
563
+ [q.Bad]: U("style.builtin.bad"),
564
+ [q.Neutral]: U("style.builtin.neutral"),
565
+ [q.ExplanatoryText]: U("style.builtin.explanatoryText")
566
+ }, Jn = U("style.builtin.heading"), Yn = U("style.builtin.accent"), Xn = U("style.builtin.accentTint"), Zn = /^Heading ([1-4])$/, Qn = /^Accent([1-6])$/, $n = /^(20|40|60)% - Accent([1-6])$/;
567
+ function er(e) {
568
+ let t = qn[e];
944
569
  if (t) return { key: t };
945
- let n = Jn.exec(e);
570
+ let n = Zn.exec(e);
946
571
  return n ? {
947
- key: Gn,
572
+ key: Jn,
948
573
  params: { n: +n[1] }
949
- } : (n = Yn.exec(e), n ? {
950
- key: Kn,
574
+ } : (n = Qn.exec(e), n ? {
575
+ key: Yn,
951
576
  params: { n: +n[1] }
952
- } : (n = Xn.exec(e), n ? {
953
- key: qn,
577
+ } : (n = $n.exec(e), n ? {
578
+ key: Xn,
954
579
  params: {
955
580
  pct: +n[1],
956
581
  n: +n[2]
957
582
  }
958
583
  } : null));
959
584
  }
960
- var Qn, $n, er, tr, nr = (e, t, n, r, i) => {
585
+ var tr, nr, rr, ir, ar = (e, t, n, r, i) => {
961
586
  let a = JSON.parse(JSON.stringify(e.definition));
962
587
  a.adjs ||= [];
963
588
  let o = "", s = 0, c = 0;
964
- t > 0 ? (c = t, s = 100 - t, o = G("op.lighterPercent", { percent: t })) : t < 0 && (s = 100 + t, o = G("op.darkerPercent", { percent: -t })), s && a.adjs.push({ [M.AdjustmentType.LumMod]: s }), c && a.adjs.push({ [M.AdjustmentType.LumOff]: c });
965
- let l = new P({
589
+ t > 0 ? (c = t, s = 100 - t, o = W("op.lighterPercent", { percent: t })) : t < 0 && (s = 100 + t, o = W("op.darkerPercent", { percent: -t })), s && a.adjs.push({ [dn.AdjustmentType.LumMod]: s }), c && a.adjs.push({ [dn.AdjustmentType.LumOff]: c });
590
+ let l = new fn({
966
591
  val: a.val,
967
592
  adjs: a.adjs
968
593
  }, n), u = l.toString();
@@ -973,14 +598,14 @@ var Qn, $n, er, tr, nr = (e, t, n, r, i) => {
973
598
  definition: a
974
599
  };
975
600
  };
976
- function rr(e, t, n, r) {
601
+ function or(e, t, n, r) {
977
602
  let i = [];
978
603
  for (let a = 0; a < e.length; a++) {
979
604
  let o = [];
980
605
  i.push(o);
981
606
  let s = (i) => {
982
- for (let s = 0; s < i.length; s++) o.push(nr(e[a], i[s], t, n, r));
983
- }, c = new P({
607
+ for (let s = 0; s < i.length; s++) o.push(ar(e[a], i[s], t, n, r));
608
+ }, c = new fn({
984
609
  val: e[a].definition.val,
985
610
  adjs: e[a].definition.adjs
986
611
  }, t).toHSLA().lum;
@@ -1018,61 +643,28 @@ function rr(e, t, n, r) {
1018
643
  }
1019
644
  return i;
1020
645
  }
1021
- (Qn ||= {}).buildPalette = rr, $n ||= {}, er ||= {}, tr ||= {};
1022
- var Z = null;
1023
- function ir() {
1024
- if (!Z) {
1025
- let e = import("./DOMHmhYzPcLVcpAW.mjs").then(({ initializeFunctions: e }) => {
646
+ (tr ||= {}).buildPalette = or, nr ||= {}, rr ||= {}, ir ||= {};
647
+ var sr, J = null;
648
+ function cr() {
649
+ if (!J) {
650
+ let e = import("./Tah7cnFb_HNZdLtj.mjs").then(({ initializeFunctions: e }) => {
1026
651
  let t = e(() => null);
1027
652
  return Object.freeze(Array.from(t.keys()));
1028
653
  });
1029
654
  e.catch(() => {
1030
- Z = null;
1031
- }), Z = e;
655
+ J = null;
656
+ }), J = e;
1032
657
  }
1033
- return Z;
658
+ return J;
1034
659
  }
1035
- function ar(e) {
1036
- let t = e.trim();
1037
- if (!t) return;
1038
- let n;
1039
- try {
1040
- let e = pe.shared().tokenize(t, !1);
1041
- if (e.errors.length > 0) return;
1042
- n = e.tokens;
1043
- } catch {
1044
- return;
1045
- }
1046
- let r = 0, i = 0;
1047
- if (n.length === 2) {
1048
- let e = n[0].tokenType?.name;
1049
- e === "MinOp" ? (r = -1, i = 1) : e === "PlusOp" && (r = 1, i = 1);
1050
- }
1051
- if (n.length - i !== 1) return;
1052
- let a = n[i], o = a.image;
1053
- try {
1054
- switch (a.tokenType?.name) {
1055
- case "NumberToken":
1056
- case "ScientificDigit":
1057
- case "DigitToken": {
1058
- let e = et(o).value;
1059
- return r === 0 ? e : r * e;
1060
- }
1061
- case "StringToken": return r === 0 ? ue(o).value : void 0;
1062
- case "BooleanToken": return r === 0 ? rt(o).value : void 0;
1063
- case "LiteralError":
1064
- case "RefError": return r === 0 ? l(o).value : void 0;
1065
- default: return;
1066
- }
1067
- } catch {
1068
- return;
1069
- }
660
+ function lr(e) {
661
+ return ve.peek()?.readFormulaLiteral(e);
1070
662
  }
1071
- function or(e, t) {
1072
- let n = sr(e), r = sr(t);
663
+ function ur(e, t) {
664
+ let n = dr(e), r = dr(t);
1073
665
  return n === r ? e === t ? 0 : typeof e == "number" && typeof t == "number" ? e < t ? -1 : 1 : typeof e == "string" && typeof t == "string" ? e < t ? -1 : +(e > t) : typeof e == "boolean" ? e ? 1 : -1 : I.isError(e) && I.isError(t) ? e.getCode() - t.getCode() : 0 : n - r;
1074
666
  }
1075
- function sr(e) {
667
+ function dr(e) {
1076
668
  if (e === null) return 0;
1077
669
  switch (typeof e) {
1078
670
  case "number": return 1;
@@ -1081,7 +673,15 @@ function sr(e) {
1081
673
  default: return I.isError(e) ? 4 : 5;
1082
674
  }
1083
675
  }
1084
- var cr = class {
676
+ (function(e) {
677
+ function t(e) {
678
+ return ve.peek()?.getFunctionDeclaration(e) ?? null;
679
+ }
680
+ e.get = t, e.has = function(e) {
681
+ return t(e) !== null;
682
+ };
683
+ })(sr ||= {});
684
+ var fr = class {
1085
685
  constructor(e) {
1086
686
  this._children = e;
1087
687
  }
@@ -1126,19 +726,19 @@ var cr = class {
1126
726
  let n = t[e].getSortedNumbers().getValues();
1127
727
  n.length > 0 && r.push(n);
1128
728
  }
1129
- e = new gt(function(e) {
729
+ e = new wt(function(e) {
1130
730
  let t = e.length;
1131
- if (t === 0) return lr;
731
+ if (t === 0) return pr;
1132
732
  if (t === 1) return e[0];
1133
733
  let n = e[0];
1134
- for (let r = 1; r < t; r++) n = ur(n, e[r]);
734
+ for (let r = 1; r < t; r++) n = mr(n, e[r]);
1135
735
  return Object.freeze(n);
1136
736
  }(r)), this._sortedNumbers = e;
1137
737
  }
1138
738
  return e;
1139
739
  }
1140
740
  getRanked(e) {
1141
- return st(this._children, e, or)[Symbol.iterator]();
741
+ return st(this._children, e, ur)[Symbol.iterator]();
1142
742
  }
1143
743
  getFrequencies(e) {
1144
744
  if (e) return this._mergeFrequencies(e);
@@ -1146,7 +746,7 @@ var cr = class {
1146
746
  return t || (t = this._mergeFrequencies(), this._frequencies = t), t;
1147
747
  }
1148
748
  _mergeFrequencies(e) {
1149
- let t = e?.keyFn ?? se, n = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, a = i.length, o = 0, s = 0, c = !1;
749
+ let t = e?.keyFn ?? p, n = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, a = i.length, o = 0, s = 0, c = !1;
1150
750
  for (let l = 0; l < a; l++) {
1151
751
  let a = i[l].getFrequencies(e);
1152
752
  o += a.getVisitedCount(), s += a.getTotalCount(), c ||= a.isTruncated();
@@ -1159,7 +759,7 @@ var cr = class {
1159
759
  }) : c = !0, d = u.next();
1160
760
  }
1161
761
  }
1162
- return ne.fromGroups(r, t, e, or, o, s, c);
762
+ return Pe.fromGroups(r, t, e, ur, o, s, c);
1163
763
  }
1164
764
  getTypedCounts(e) {
1165
765
  let t = this._typedCounts;
@@ -1209,24 +809,24 @@ var cr = class {
1209
809
  let a = n.numericalCount;
1210
810
  a <= 0 || (r.numericalCount += a, r.sum += n.sum, r.sumSq += n.varP * a + n.sum * n.sum / a, (r.min === void 0 || n.min < r.min) && (r.min = n.min), (r.max === void 0 || n.max > r.max) && (r.max = n.max));
1211
811
  }
1212
- return ft(r);
812
+ return Xe(r);
1213
813
  }
1214
- }, lr = Object.freeze([]);
1215
- function ur(e, t) {
814
+ }, pr = Object.freeze([]);
815
+ function mr(e, t) {
1216
816
  let n = e.length, r = t.length, i = Array(n + r), a = 0, o = 0, s = 0;
1217
817
  for (; a < n && o < r;) i[s++] = e[a] <= t[o] ? e[a++] : t[o++];
1218
818
  for (; a < n;) i[s++] = e[a++];
1219
819
  for (; o < r;) i[s++] = t[o++];
1220
820
  return i;
1221
821
  }
1222
- var dr = class {
822
+ var hr, gr = class {
1223
823
  constructor(e, t) {
1224
824
  this._source = null, this.cacheId = e, this.part = t;
1225
825
  }
1226
826
  _hold(e) {
1227
827
  let t = this.part?.xml;
1228
828
  if (!t || this._source) return;
1229
- let n = s(t, "worksheetSource", "ref"), r = s(t, "worksheetSource", "sheet");
829
+ let n = Oe(t, "worksheetSource", "ref"), r = Oe(t, "worksheetSource", "sheet");
1230
830
  if (!n || !r || n.includes("#REF!")) return;
1231
831
  let i = e(r);
1232
832
  if (!i) return;
@@ -1235,7 +835,7 @@ var dr = class {
1235
835
  wired: null,
1236
836
  last: null
1237
837
  };
1238
- this._source = a, i(`${at(r)}!${tt(n)}`, (e) => {
838
+ this._source = a, i(`${et(r)}!${Je(n)}`, (e) => {
1239
839
  a.formula = e.formula;
1240
840
  let t = e.formula.getExpression();
1241
841
  a.wired ??= t, e.formula.hasRefError() || (a.last = t);
@@ -1246,18 +846,18 @@ var dr = class {
1246
846
  if (!e || !t?.formula) return e;
1247
847
  let n = t.formula.hasRefError() ? t.last : t.formula.getExpression();
1248
848
  if (n === null || n === t.wired) return e;
1249
- let r = Ge(n);
1250
- return r ? ce(ce(e, "worksheetSource", "ref", $e(r.reference)), "worksheetSource", "sheet", r.sheet) : ce(e, "worksheetSource", "ref", $e(n));
849
+ let r = v(n);
850
+ return r ? nt(nt(e, "worksheetSource", "ref", a(r.reference)), "worksheetSource", "sheet", r.sheet) : nt(e, "worksheetSource", "ref", a(n));
1251
851
  }
1252
852
  toJSON(e) {
1253
- let t = { cacheId: this.cacheId }, n = de.toJSON(this.part, e);
853
+ let t = { cacheId: this.cacheId }, n = k.toJSON(this.part, e);
1254
854
  if (n) {
1255
855
  let e = this.getXML();
1256
856
  e !== null && (n.xml = e), t.part = n;
1257
857
  }
1258
858
  return t;
1259
859
  }
1260
- }, fr = class {
860
+ }, _r = class {
1261
861
  constructor(e, t) {
1262
862
  this._deleted = !1, this._json = { ...e }, this._deleteFromCollection = t ?? null;
1263
863
  }
@@ -1291,7 +891,7 @@ var dr = class {
1291
891
  get isIPerson() {
1292
892
  return !0;
1293
893
  }
1294
- }, pr = class extends ge {
894
+ }, vr = class extends Ht {
1295
895
  constructor(e) {
1296
896
  super(), this._byId = /* @__PURE__ */ new Map(), this._byDisplayName = /* @__PURE__ */ new Map(), this._items = null, this._current = null, e && this.fromJSON(e);
1297
897
  }
@@ -1312,7 +912,7 @@ var dr = class {
1312
912
  let e = this._byDisplayName.get(r);
1313
913
  if (e) return e;
1314
914
  }
1315
- let i = new fr({
915
+ let i = new _r({
1316
916
  ...t,
1317
917
  displayName: r,
1318
918
  id: n ?? R.uuidV4().toUpperCase()
@@ -1355,7 +955,7 @@ var dr = class {
1355
955
  get isIPersonCollection() {
1356
956
  return !0;
1357
957
  }
1358
- }, mr = (e, t) => {
958
+ }, yr = (e, t) => {
1359
959
  let n = [0];
1360
960
  for (let t = 0; t < e.length; t++) e[t] === "\n" && n.push(t + 1);
1361
961
  let r = t.map((e) => ` ${((e) => {
@@ -1367,9 +967,9 @@ var dr = class {
1367
967
  return `${t + 1}:${e - n[t] + 1}`;
1368
968
  })(e.start)} ${e.code}: ${e.message}`), i = t.length;
1369
969
  return `Script has ${i} compile error${i === 1 ? "" : "s"}:\n${r.join("\n")}`;
1370
- }, hr = class {
1371
- constructor(e) {
1372
- this._options = e, this._emitter = new t(this), this._initState();
970
+ }, br = class {
971
+ constructor(t) {
972
+ this._options = t, this._emitter = new e(this), this._initState();
1373
973
  }
1374
974
  _initState() {}
1375
975
  getModules() {
@@ -1392,13 +992,13 @@ var dr = class {
1392
992
  minify: !0,
1393
993
  ...e
1394
994
  });
1395
- return t.module ? await u(S.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
995
+ return t.module ? await D(tt.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
1396
996
  }
1397
997
  addModule(e, t, n) {
1398
998
  this._modules.add(e, t, n);
1399
999
  }
1400
1000
  async addModuleFromJSON(e, t, n) {
1401
- let r = await u(e, t);
1001
+ let r = await D(e, t);
1402
1002
  return this.addModule(e, r, n), r;
1403
1003
  }
1404
1004
  executeMacro(e, t, n) {
@@ -1414,7 +1014,7 @@ var dr = class {
1414
1014
  }
1415
1015
  async run(e, t) {
1416
1016
  try {
1417
- let n = typeof e == "string" ? await this.createModule({ source: e }) : await u(S.DEFAULT_MODULE, e), r = typeof e == "string" ? e : e?.source ?? "";
1017
+ let n = typeof e == "string" ? await this.createModule({ source: e }) : await D(tt.DEFAULT_MODULE, e), r = typeof e == "string" ? e : e?.source ?? "";
1418
1018
  return await this._runModule(n, r, t);
1419
1019
  } catch (e) {
1420
1020
  return {
@@ -1431,7 +1031,7 @@ var dr = class {
1431
1031
  };
1432
1032
  let i = e.getDiagnostics(), a = i.filter((e) => e.severity === "error");
1433
1033
  if (a.length > 0) {
1434
- let e = Error(mr(t, a));
1034
+ let e = Error(yr(t, a));
1435
1035
  return e.diagnostics = a, {
1436
1036
  ok: !1,
1437
1037
  error: e,
@@ -1447,7 +1047,7 @@ var dr = class {
1447
1047
  })[0] ?? null;
1448
1048
  if (!s) return {
1449
1049
  ok: !1,
1450
- error: /* @__PURE__ */ Error("The script has no runnable entry. Export a default function taking the script context, e.g. `export default function run(ctx: IScript.ScriptContext) { ... }` (the workbook is `ctx.wb`; a macro may instead take its target first, e.g. `(sheet: ISheet, ctx)`).")
1050
+ error: /* @__PURE__ */ Error("The script has no runnable entry. Export a default function taking the script context, e.g. `export default function run(ctx: IScript.ScriptContext) { ... }` (the workbook is `ctx.wb`; a macro may instead take its target first, e.g. `(sheet: IWorksheet, ctx)`).")
1451
1051
  };
1452
1052
  let c = await s.execute(r, n);
1453
1053
  return {
@@ -1482,30 +1082,51 @@ var dr = class {
1482
1082
  }
1483
1083
  if (!i || i.length === 0) return R.EmptyArray;
1484
1084
  let o = e?.text ? e.text.trim().toUpperCase() : null;
1485
- return o ? De(i, o) : i.sort((e, t) => {
1085
+ return o ? Mt(i, o) : i.sort((e, t) => {
1486
1086
  let n = e.getName().toUpperCase(), r = t.getName().toUpperCase();
1487
1087
  return n < r ? -1 : +(n > r);
1488
1088
  }), n !== void 0 && i.length > n ? i.slice(0, n) : i;
1489
1089
  }
1490
1090
  async start() {
1491
- if (!this._modules) return this._startPromise || (this._startPromise = this._doStart(), this._startPromise.catch(() => {
1091
+ return this._startPromise || (this._startPromise = this._doStart(), this._startPromise.catch(() => {
1492
1092
  this._startPromise = void 0;
1493
1093
  })), this._startPromise;
1494
1094
  }
1095
+ _load() {
1096
+ return this._loadPromise || (this._loadPromise = this._doLoad(), this._loadPromise.catch(() => {
1097
+ this._loadPromise = void 0;
1098
+ })), this._loadPromise;
1099
+ }
1495
1100
  async _doStart() {
1101
+ await this._load();
1102
+ let e = this._options?.workbook, t = this._modules.getItems(), n = t.length;
1103
+ for (let r = 0; r < n; r++) {
1104
+ let n = t[r];
1105
+ try {
1106
+ let t = n.getFunctions().getItems({
1107
+ type: "autoRun",
1108
+ includeHidden: !0
1109
+ }), r = t.length;
1110
+ for (let n = 0; n < r; n++) await t[n].execute(e);
1111
+ } catch (e) {
1112
+ En.error("Error executing autoRun script:", e);
1113
+ }
1114
+ }
1115
+ }
1116
+ async _doLoad() {
1496
1117
  let e = this._options?.workbook, t = this._options?.json, n = {};
1497
1118
  if (t) {
1498
1119
  let r = Object.keys(t);
1499
1120
  for (let i = 0; i < r.length; i++) {
1500
1121
  let a = r[i], o = t[a];
1501
1122
  try {
1502
- n[a] = await u(a, o, !1, [], o?.scope === "workbook" ? e : null);
1123
+ n[a] = await D(a, o, !1, [], o?.scope === "workbook" ? e : null);
1503
1124
  } catch (e) {
1504
- V.error(`Could not load script '${a}'; it will be unavailable.`, e);
1125
+ En.error(`Could not load script '${a}'; it will be unavailable.`, e);
1505
1126
  }
1506
1127
  }
1507
1128
  }
1508
- let r = this, i = new b({
1129
+ let r = this, i = new Lt({
1509
1130
  transactions: this._options?.transactions,
1510
1131
  initial: n,
1511
1132
  isReadOnly: () => r.isReadOnly(),
@@ -1517,21 +1138,6 @@ var dr = class {
1517
1138
  }
1518
1139
  });
1519
1140
  this._modules = i;
1520
- let a = i.getItems();
1521
- if (a.length === 0) return Promise.resolve(R.EmptyArray);
1522
- let o = a.length;
1523
- for (let t = 0; t < o; t++) {
1524
- let n = a[t];
1525
- try {
1526
- let t = n.getFunctions().getItems({
1527
- type: "autoRun",
1528
- includeHidden: !0
1529
- }), r = t.length;
1530
- for (let n = 0; n < r; n++) await t[n].execute(e);
1531
- } catch (e) {
1532
- V.error("Error executing autoRun script:", e);
1533
- }
1534
- }
1535
1141
  }
1536
1142
  addListeners(e, t) {
1537
1143
  return this._emitter.addListeners(e, t);
@@ -1548,9 +1154,110 @@ var dr = class {
1548
1154
  get isIScript() {
1549
1155
  return !0;
1550
1156
  }
1551
- }, gr = class {
1157
+ }, xr = /^([a-z][a-z0-9+.-]*):/i, Sr = (e) => {
1158
+ let t = e.toLowerCase();
1159
+ return t.endsWith(":") ? t : t + ":";
1160
+ }, Cr = (e, t) => globalThis.fetch(e, t), wr = class {
1161
+ constructor() {
1162
+ this._handlers = /* @__PURE__ */ new Map([["http:", Cr], ["https:", Cr]]);
1163
+ }
1164
+ fetch(e, t) {
1165
+ let n = xr.exec(e)?.[1], r = this._handlers.get(n ? Sr(n) : "https:");
1166
+ if (!r) return Promise.reject(/* @__PURE__ */ TypeError(`No fetcher serves '${n}:'.`));
1167
+ try {
1168
+ return r(e, t);
1169
+ } catch (e) {
1170
+ return Promise.reject(e);
1171
+ }
1172
+ }
1173
+ register(e, t) {
1174
+ let n = Sr(e), r = this._handlers.get(n);
1175
+ return this._handlers.set(n, t), () => {
1176
+ this._handlers.get(n) === t && (r ? this._handlers.set(n, r) : this._handlers.delete(n));
1177
+ };
1178
+ }
1179
+ get isIFetcher() {
1180
+ return !0;
1181
+ }
1182
+ }, Tr = /* @__PURE__ */ new Set([
1183
+ 101,
1184
+ 103,
1185
+ 204,
1186
+ 205,
1187
+ 304
1188
+ ]), Y = (e) => new Response(Tr.has(e.status) ? null : e.body, {
1189
+ status: e.status,
1190
+ statusText: e.statusText,
1191
+ headers: e.headers
1192
+ }), Er = class {
1193
+ constructor(e, t) {
1194
+ this._kept = /* @__PURE__ */ new Map(), this._cached = /* @__PURE__ */ new Map(), this._inFlight = /* @__PURE__ */ new Map(), this._resources = e, this._fetcher = t;
1195
+ }
1196
+ getFetcher() {
1197
+ return this._fetcher;
1198
+ }
1199
+ async fetch(e, t) {
1200
+ if (((e) => !e || (!e.method || e.method.toUpperCase() === "GET") && !e.body)(t) && t?.cache !== "reload") {
1201
+ let n = this._kept.get(e) ?? this._findHeld(e);
1202
+ if (n && !n.isClosed()) return this._fromKept(n);
1203
+ let r = this._cached.get(e);
1204
+ if (r) return Y(r);
1205
+ let i = this._inFlight.get(e);
1206
+ return i || (i = this._request(e, {
1207
+ ...t,
1208
+ signal: void 0
1209
+ }).finally(() => {
1210
+ this._inFlight.delete(e);
1211
+ }), this._inFlight.set(e, i)), Y(await ((e, t) => t ? t.aborted ? Promise.reject(t.reason) : new Promise((n, r) => {
1212
+ let i = () => r(t.reason);
1213
+ t.addEventListener("abort", i, { once: !0 }), e.then(n, r).finally(() => t.removeEventListener("abort", i));
1214
+ }) : e)(i, t?.signal));
1215
+ }
1216
+ return Y(await this._request(e, t));
1217
+ }
1218
+ adopt(e) {
1219
+ for (let t of e) {
1220
+ let e = t.getFetchedFrom();
1221
+ e && !t.isClosed() && this.keep(e, t);
1222
+ }
1223
+ }
1224
+ keep(e, t) {
1225
+ let n = this._kept.get(e);
1226
+ n !== t && (t.addReference(this), this._kept.set(e, t), n && !n.isClosed() && n.deleteReference(this));
1227
+ }
1228
+ _findHeld(e) {
1229
+ for (let t of this._resources.getItems()) if (t.getFetchedFrom() === e && !t.isClosed()) return this.keep(e, t), t;
1230
+ return null;
1231
+ }
1232
+ async _fromKept(e) {
1233
+ let [t, n] = await Promise.all([e.toBuffer(), e.getType()]);
1234
+ return Y({
1235
+ status: 200,
1236
+ statusText: "OK",
1237
+ headers: n ? [["content-type", n.mime]] : [],
1238
+ body: t
1239
+ });
1240
+ }
1241
+ async _request(e, t) {
1242
+ let n = await this._fetcher.fetch(e, t), r = Tr.has(n.status) ? null : await n.arrayBuffer(), i = [];
1243
+ n.headers.forEach((e, t) => {
1244
+ i.push([t, e]);
1245
+ });
1246
+ let a = {
1247
+ status: n.status,
1248
+ statusText: n.statusText,
1249
+ headers: i,
1250
+ body: r
1251
+ };
1252
+ if (n.ok && r && r.byteLength > 0) {
1253
+ let t = await new C({ source: { buffer: r } }).getType();
1254
+ t?.mime.startsWith("image/") ? (a.headers = i.filter(([e]) => e.toLowerCase() !== "content-type"), a.headers.push(["content-type", t.mime])) : this._cached.set(e, a);
1255
+ }
1256
+ return a;
1257
+ }
1258
+ }, Dr = class {
1552
1259
  constructor(e, t, n, r) {
1553
- this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = n, this._topLeft = t ?? z.EmptyCell, this._sheet = new O({
1260
+ this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = n, this._topLeft = t ?? z.EmptyCell, this._sheet = new A({
1554
1261
  runtime: e,
1555
1262
  styles: this._styles,
1556
1263
  calcOnLoad: "none",
@@ -1571,28 +1278,32 @@ var dr = class {
1571
1278
  e.includes(r) && delete i[r];
1572
1279
  }
1573
1280
  }
1574
- let a = Gt(i.fontFamily);
1281
+ let a = sn(i.fontFamily);
1575
1282
  r.font = {}, a && (r.font.family = a.family, r.font.fallbacks = a.fallbacks, r.font.size = a.size), r.font.size = i.fontSize, r.font.weight = i.fontWeight, r.font.style = i.fontStyle, r.font.color = i.color;
1576
- let o = Ft(i.textDecoration);
1577
- r.font.underline = o.underline, r.font.strike = o.strike, i.textUnderlineStyle && (r.font.underline = It(i.textUnderlineStyle)), r.alignment = {}, i?.textAlign && (r.alignment.horizontal = jt(i.textAlign)), i?.textAlign && !r.alignment.horizontal && i?.textAlign !== "general" && (i.textAlign === "center-across" ? r.alignment.horizontal = A.HorizontalAlignment.CenterContinuous : i.textAlign === "fill" ? r.alignment.horizontal = A.HorizontalAlignment.Fill : i.textAlign === "121" || i.textAlign === "010" ? (r.alignment.horizontal = A.HorizontalAlignment.Distributed, r.alignment.justifyLastLine = i.textAlign === "121") : console.warn("unknown text-align", i.textAlign)), i.verticalAlign && (i.verticalAlign.toLowerCase() === "super" ? r.font.verticalAlign = j.VerticalAlignment.Super : i.verticalAlign.toLowerCase() === "sup" ? r.font.verticalAlign = j.VerticalAlignment.Sub : r.alignment.vertical = Rt(i.verticalAlign), r.alignment.vertical || (i.verticalAlign === "121" ? r.alignment.vertical = A.VerticalAlignment.Distributed : console.warn("unknown vertical-align", i.verticalAlign))), i.msoCharIndentCount && (r.alignment.indent = i.msoCharIndentCount), i.whiteSpace && (r.alignment.overflow = i.whiteSpace === "no-wrap" || i.whiteSpace === "nowrap" ? A.Overflow.Visible : A.Overflow.Wrap), i.msoTextControl === "shrinktofit" && (r.alignment.overflow = A.Overflow.Shrink);
1283
+ let o = an(i.textDecoration);
1284
+ r.font.underline = o.underline, r.font.strike = o.strike ? M.StrikeStyle.Single : M.StrikeStyle.None, i.textUnderlineStyle && (r.font.underline = _n(i.textUnderlineStyle)), r.alignment = {}, i?.textAlign && (r.alignment.horizontal = tn(i.textAlign)), i?.textAlign && !r.alignment.horizontal && i?.textAlign !== "general" && (i.textAlign === "center-across" ? r.alignment.horizontal = N.HorizontalAlignment.CenterContinuous : i.textAlign === "fill" ? r.alignment.horizontal = N.HorizontalAlignment.Fill : i.textAlign === "121" || i.textAlign === "010" ? (r.alignment.horizontal = N.HorizontalAlignment.Distributed, r.alignment.justifyLastLine = i.textAlign === "121") : console.warn("unknown text-align", i.textAlign)), i.verticalAlign && (i.verticalAlign.toLowerCase() === "super" ? r.font.baseline = F.Baseline.Superscript : i.verticalAlign.toLowerCase() === "sub" ? r.font.baseline = F.Baseline.Subscript : r.alignment.vertical = Jt(i.verticalAlign), r.alignment.vertical || (i.verticalAlign === "121" ? r.alignment.vertical = N.VerticalAlignment.Distributed : console.warn("unknown vertical-align", i.verticalAlign))), i.msoCharIndentCount && (r.alignment.indent = i.msoCharIndentCount), i.whiteSpace && (r.alignment.overflow = i.whiteSpace === "no-wrap" || i.whiteSpace === "nowrap" ? N.Overflow.Visible : N.Overflow.Wrap), i.msoTextControl === "shrinktofit" && (r.alignment.overflow = N.Overflow.Shrink);
1578
1285
  let s = null;
1579
1286
  if (i.background ? s = i.background : i.backgroundColor && (s = i.backgroundColor), s && (r.fill = { color: s }), i.msoPattern) {
1580
- let e = Nt(i.msoPattern);
1581
- e && (e.patternType === N.BuiltInSheetPattern.Solid ? r.fill = { color: e.foreground } : e.patternType !== N.BuiltInSheetPattern.None && (s && (e.background = s), r.fill = e));
1287
+ let e = cn(i.msoPattern);
1288
+ e && (e.patternType === un.BuiltInSheetPattern.Solid ? r.fill = { color: e.foreground } : e.patternType !== un.BuiltInSheetPattern.None && (s && (e.background = s), r.fill = e));
1582
1289
  }
1583
- i.layoutFlow === "vertical" || i.layoutFlow === "vertical-ideographic" ? r.alignment.stacked = !0 : i.msoRotate !== void 0 && (r.alignment.rotation = Lt(i.msoRotate));
1290
+ i.layoutFlow === "vertical" || i.layoutFlow === "vertical-ideographic" ? r.alignment.stacked = !0 : i.msoRotate !== void 0 && (r.alignment.rotation = $t(i.msoRotate));
1584
1291
  let c = (e, t) => {
1585
1292
  e && (r.borders ||= {}, r.borders[e] = t);
1586
1293
  };
1587
1294
  i.border && i.border !== "none" && (c("top", i.border), c("left", i.border), c("right", i.border), c("bottom", i.border)), i.borderTop && c("top", i.borderTop), i.borderLeft && c("left", i.borderLeft), i.borderRight && c("right", i.borderRight), i.borderBottom && c("bottom", i.borderBottom), i.msoDiagonalUp && c("diagonalUp", i.msoDiagonalUp), i.msoDiagonalDown && c("diagonalDown", i.msoDiagonalDown);
1588
1295
  let l = r.numberFormat;
1589
- i.msoNumberFormat && (l = Wt(i.msoNumberFormat), l.includes("\\") ? l = null : l === "Fixed" ? l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Number ? null : F.Type.Number : l === "Percent" && (l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Percentage ? null : F.Type.Percentage)), l && (r.numberFormat = l), e.style = this._styles.normalize(r), n && Object.keys(e.style).length === 0 && delete e.style;
1296
+ i.msoNumberFormat && (l = mn(i.msoNumberFormat), l.includes("\\") ? l = null : l === "Fixed" ? l = P.Styles.lookupStyle(r.numberFormat).formatType === P.Type.Number ? null : P.Type.Number : l === "Percent" && (l = P.Styles.lookupStyle(r.numberFormat).formatType === P.Type.Percentage ? null : P.Type.Percentage)), l && (r.numberFormat = l), e.style = this._styles.normalize(r), n && Object.keys(e.style).length === 0 && delete e.style;
1590
1297
  }
1591
1298
  onCell(e, t, n, r, i) {
1592
1299
  let a = r(i), o = { value: t === void 0 ? n ?? "" : t };
1593
- if (typeof o.value == "string" && o.value.length === 0 && (o.value = void 0), a && this.applyCSSStyle(o, a), i?.tagName.toUpperCase() === "TD") {
1300
+ if (typeof o.value == "string" && o.value.length === 0 && (o.value = void 0), a && this.applyCSSStyle(o, a), typeof o.value == "string" && /^#+$/.test(o.value)) {
1301
+ let e = o.style?.numberFormat;
1302
+ e && (on(e) || Yt(e)) && (o.value = I.BuiltIn.Num);
1303
+ }
1304
+ if (i?.tagName.toUpperCase() === "TD") {
1594
1305
  let e = o.style, t = e?.font ?? {};
1595
- (i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike = !0), i.querySelectorAll("sub").length > 0 && (t.verticalAlign = j.VerticalAlignment.Sub), i.querySelectorAll("sup").length > 0 && (t.verticalAlign = j.VerticalAlignment.Super), (i.querySelectorAll("b").length > 0 || i.querySelectorAll("strong").length > 0) && (t.weight = 700), i.querySelectorAll("i").length > 0 && (t.style = j.Style.Italic), i.querySelectorAll("u").length > 0 && (t.underline = j.UnderlineStyle.Single), Object.keys(t).length > 0 && (e || (e = {}, o.style = e), e.font || (e.font = t));
1306
+ (i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike = M.StrikeStyle.Single), i.querySelectorAll("sub").length > 0 && (t.baseline = F.Baseline.Subscript), i.querySelectorAll("sup").length > 0 && (t.baseline = F.Baseline.Superscript), (i.querySelectorAll("b").length > 0 || i.querySelectorAll("strong").length > 0) && (t.weight = 700), i.querySelectorAll("i").length > 0 && (t.style = M.Style.Italic), i.querySelectorAll("u").length > 0 && (t.underline = M.UnderlineStyle.Single), Object.keys(t).length > 0 && (e || (e = {}, o.style = e), e.font || (e.font = t));
1596
1307
  let n = i.querySelectorAll("a");
1597
1308
  if (n.length > 0) {
1598
1309
  let e = n[0].getAttribute("href");
@@ -1639,8 +1350,8 @@ var dr = class {
1639
1350
  let i = n(r);
1640
1351
  if (i.msoHeightSource !== "userset" || !r) return;
1641
1352
  let a = r.getAttribute("height") ?? i.height, o = null;
1642
- if (a && (o = k(a, this._styles.getNormal().getFont().getSize(), "px")), o === null) for (let e = 0; e < r.cells.length; e++) {
1643
- let t = r.cells[e], i = t.getAttribute("height") ?? n(t).height, a = k(i, this._styles.getNormal().getFont().getSize(), "px");
1353
+ if (a && (o = Qt(a, this._styles.getNormal().getFont().getSize(), "px")), o === null) for (let e = 0; e < r.cells.length; e++) {
1354
+ let t = r.cells[e], i = t.getAttribute("height") ?? n(t).height, a = Qt(i, this._styles.getNormal().getFont().getSize(), "px");
1644
1355
  a !== null && (o = Math.max(a, o ?? 0));
1645
1356
  }
1646
1357
  o !== null && this._rowsReading.push({
@@ -1648,19 +1359,19 @@ var dr = class {
1648
1359
  min: this._topLeft.rowIndex + e,
1649
1360
  max: this._topLeft.rowIndex + e + t - 1
1650
1361
  },
1651
- update: { size: o * j.getDeviceScale() }
1362
+ update: { size: o * M.getDeviceScale() }
1652
1363
  });
1653
1364
  }
1654
1365
  onColumn(e, t, n, r) {
1655
1366
  let i = n(r);
1656
1367
  if (i.msoWidthSource !== "userset" || !r) return;
1657
1368
  let a = r.getAttribute("width") ?? i.width, o = null;
1658
- a && (o = k(a, this._styles.getNormal().getFont().getSize(), "px")), o !== null && this._colsReading.push({
1369
+ a && (o = Qt(a, this._styles.getNormal().getFont().getSize(), "px")), o !== null && this._colsReading.push({
1659
1370
  address: {
1660
1371
  min: this._topLeft.colIndex + e,
1661
1372
  max: this._topLeft.colIndex + e + t - 1
1662
1373
  },
1663
- update: { size: o * j.getDeviceScale() }
1374
+ update: { size: o * M.getDeviceScale() }
1664
1375
  });
1665
1376
  }
1666
1377
  onDone() {
@@ -1671,9 +1382,9 @@ var dr = class {
1671
1382
  sheet() {
1672
1383
  return this._sheet;
1673
1384
  }
1674
- }, _r = class {
1385
+ }, Or = class {
1675
1386
  constructor(e) {
1676
- if (!e) throw new en("snapshot is required.");
1387
+ if (!e) throw new Dn("snapshot is required.");
1677
1388
  this._snapshot = e;
1678
1389
  }
1679
1390
  getItemType() {
@@ -1703,9 +1414,9 @@ var dr = class {
1703
1414
  get isClipboardItem() {
1704
1415
  return !0;
1705
1416
  }
1706
- }, vr = class {
1417
+ }, kr = class {
1707
1418
  constructor(e, t, n, r, i) {
1708
- if (this._parsed = void 0, this._runtime = e, !t) throw new en("nativeItems are required.");
1419
+ if (this._parsed = void 0, this._runtime = e, !t) throw new Dn("nativeItems are required.");
1709
1420
  this._topLeft = n ?? z.EmptyCell, this._native = t, this._markOptions = Object.freeze(r ?? {}), this._styles = i;
1710
1421
  }
1711
1422
  getItemType() {
@@ -1730,6 +1441,10 @@ var dr = class {
1730
1441
  if (this._snapshot) return this._snapshot;
1731
1442
  let t = this;
1732
1443
  return this._snapshot = {
1444
+ prepare: (n, r) => e.prepare?.(n, {
1445
+ ...t._markOptions,
1446
+ ...r
1447
+ }),
1733
1448
  copyTo: (n, r) => e.copyTo(n, {
1734
1449
  ...t._markOptions,
1735
1450
  ...r
@@ -1747,33 +1462,45 @@ var dr = class {
1747
1462
  async parse() {
1748
1463
  let e, t = this._native?.text, n = this._native.html;
1749
1464
  if (n === null && t && t.includes("<table")) try {
1750
- let e = new DOMParser().parseFromString(t, $t.Html), r = e.querySelector("parsererror");
1465
+ let e = new DOMParser().parseFromString(t, Tn.Html), r = e.querySelector("parsererror");
1751
1466
  if (r) throw new B("Unable to parse: " + r);
1752
1467
  n = e, t = null;
1753
1468
  } catch {
1754
1469
  console.warn("Discovered text as html table but could could not parse.");
1755
1470
  }
1756
1471
  try {
1757
- let r = new gr(this._runtime, this._topLeft, this._styles, n ? "HTML" : "Text"), i = await Promise.resolve(t ? qe(t) : [[]]), a;
1758
- if (Ye(n, i, r) ? (e = r.sheet(), a = e.getUsedRange()) : n = null, a) return this._parsed = {
1759
- copyTo: async (e, t) => (await e.copyFrom(a, t))?.getCoords() ?? null,
1760
- getCoords: () => a.getCoords(),
1761
- getSource: () => e,
1762
- getName: () => e.getName()
1763
- }, !0;
1472
+ let r = new Dr(this._runtime, this._topLeft, this._styles, n ? "HTML" : "Text"), i = await Promise.resolve(t ? re(t) : [[]]), a;
1473
+ if (x(n, i, r) ? (e = r.sheet(), a = e.getUsedRange()) : n = null, a) {
1474
+ let t = a.getSnapshot();
1475
+ return this._parsed = {
1476
+ prepare: (e, n) => t.prepare?.(e, n),
1477
+ copyTo: (e, n) => t.copyTo(e, n),
1478
+ getCoords: () => a.getCoords(),
1479
+ getSource: () => e,
1480
+ getName: () => e.getName()
1481
+ }, !0;
1482
+ }
1764
1483
  } catch (e) {
1765
1484
  throw e;
1766
1485
  }
1767
1486
  if (!t && !n && this._native.image) {
1768
- let e = this;
1487
+ let e = await this._native.image.arrayBuffer(), t = null;
1769
1488
  return this._parsed = {
1770
- async copyTo(t, n) {
1771
- let r = t.getSheet(), i = await e._native.image.arrayBuffer();
1772
- return await r.getMovables().addPicture({ source: { buffer: i } }, {
1773
- type: "picture",
1774
- description: W("op.copyImageFromClipboard"),
1775
- autoSelect: !0
1776
- }), null;
1489
+ async prepare(n) {
1490
+ let r = n.getWorksheet();
1491
+ t = {
1492
+ sheet: r,
1493
+ options: await r.getMovables()._preparePicture({ source: { buffer: e } }, {
1494
+ type: "picture",
1495
+ description: U("op.copyImageFromClipboard"),
1496
+ autoSelect: !0
1497
+ })
1498
+ };
1499
+ },
1500
+ copyTo(e, n) {
1501
+ let r = e.getWorksheet();
1502
+ if (t?.sheet !== r) throw Error("The image was not prepared for this sheet.");
1503
+ return r.getMovables()._insertNow(t.options), null;
1777
1504
  },
1778
1505
  getName: () => "Image"
1779
1506
  }, !0;
@@ -1783,17 +1510,116 @@ var dr = class {
1783
1510
  get isClipboardItem() {
1784
1511
  return !0;
1785
1512
  }
1786
- }, yr = {
1513
+ }, Ar = class {
1514
+ constructor(t) {
1515
+ this._closed = !1, this._kind = t.kind, this._id = t.id, this._part = t.part, this._styles = t.styles, this._tabColor = t.tabColor ? this._styles.parseColor(t.tabColor) : null, this._transactions = t.transactions, this._workbook = t.workbook ?? null, this._container = t.container, this._emitter = new e(this, this._transactions);
1516
+ }
1517
+ getKind() {
1518
+ return this._kind;
1519
+ }
1520
+ getId() {
1521
+ return this._id;
1522
+ }
1523
+ getName() {
1524
+ return this._container.getName();
1525
+ }
1526
+ setName(e, t) {
1527
+ return this._assertOpen(), this._container.setName(e, t), this;
1528
+ }
1529
+ getVisibility() {
1530
+ return this._closed ? T.Visibility.VeryHidden : this._container.getVisibility();
1531
+ }
1532
+ setVisibility(e = !0, t) {
1533
+ let n;
1534
+ return this._assertOpen(), n = !0 === e ? T.Visibility.Visible : !1 === e ? T.Visibility.Hidden : e, this._container.setVisibility(n, t), this;
1535
+ }
1536
+ getIndex() {
1537
+ return this._container.getIndex();
1538
+ }
1539
+ setIndex(e, t) {
1540
+ return this._assertOpen(), this._container.setIndex(e, t), this;
1541
+ }
1542
+ getTabColor() {
1543
+ return this._tabColor;
1544
+ }
1545
+ setTabColor(e) {
1546
+ return this._assertOpen(), this._tabColor = typeof e == "string" ? this._styles.parseColor(e) : e ?? null, this._notify("onTabColorChange"), this;
1547
+ }
1548
+ getWorkbook() {
1549
+ return this._workbook;
1550
+ }
1551
+ async select(e) {
1552
+ return await this._container.requestSelect(e), this;
1553
+ }
1554
+ delete() {
1555
+ if (this._closed) return;
1556
+ let e = this._transactions.beginCommit({ description: W("op.deleteSheet", { name: this.getName() }) });
1557
+ try {
1558
+ try {
1559
+ this._notify("onBeforeDelete");
1560
+ } catch (e) {
1561
+ throw e instanceof Error ? e : new B(e?.message ?? W("error.sheet.modelDelete"));
1562
+ }
1563
+ this._notify("onDelete"), e.commit();
1564
+ } catch (t) {
1565
+ throw e.rollback(), t;
1566
+ }
1567
+ }
1568
+ isDeleted() {
1569
+ return !this._container.isAttached();
1570
+ }
1571
+ addListeners(e, t) {
1572
+ return this._emitter.addListeners(e, t);
1573
+ }
1574
+ close() {
1575
+ this._closed ||= (this._notify("onClose"), this._emitter.close(), !0);
1576
+ }
1577
+ isClosed() {
1578
+ return this._closed;
1579
+ }
1580
+ _getPart() {
1581
+ return this._part;
1582
+ }
1583
+ _notify(e) {
1584
+ this._emitter.notify(e);
1585
+ }
1586
+ _assertOpen() {
1587
+ if (this._closed) throw Error(W("error.sheet.modelClosed"));
1588
+ }
1589
+ get [Symbol.toStringTag]() {
1590
+ return "[OpaqueSheet]";
1591
+ }
1592
+ toString() {
1593
+ return `[${this.getName() ?? "(untitled)"}]`;
1594
+ }
1595
+ get isISheet() {
1596
+ return !0;
1597
+ }
1598
+ get isIOpaqueSheet() {
1599
+ return !0;
1600
+ }
1601
+ };
1602
+ (hr ||= {}).Visibility = {
1603
+ Visible: "visible",
1604
+ Hidden: "hidden",
1605
+ VeryHidden: "veryHidden"
1606
+ };
1607
+ var X, jr = {
1787
1608
  showFormulaBar: !0,
1788
1609
  showTabs: !0,
1789
1610
  tabRatio: 600,
1790
1611
  showHorizontalScrollbar: !0,
1791
1612
  showVerticalScrollbar: !0,
1792
1613
  showStatusBar: !0,
1793
- activeSheetId: 0
1794
- }, br = class {
1795
- constructor(e) {
1796
- this._id = R.uuidV4(), this._emitter = new t(this), this._state = { ...yr }, e?.json && this._fromJSON(e?.json);
1614
+ activeSheetId: 0,
1615
+ firstTab: 0,
1616
+ windowBounds: null,
1617
+ minimized: !1,
1618
+ visibility: hr.Visibility.Visible,
1619
+ autoFilterDateGrouping: !0
1620
+ }, Mr = class {
1621
+ constructor(t) {
1622
+ this._id = R.uuidV4(), this._emitter = new e(this), this._state = { ...jr }, t?.json && this._fromJSON(t?.json);
1797
1623
  }
1798
1624
  getId() {
1799
1625
  return this._id;
@@ -1841,6 +1667,39 @@ var dr = class {
1841
1667
  let t = this._state, n = t.activeSheetId;
1842
1668
  return t.activeSheetId = e, n !== e && this._emitter.notify("onViewChange"), this;
1843
1669
  }
1670
+ getFirstTab() {
1671
+ return this._state.firstTab;
1672
+ }
1673
+ setFirstTab(e) {
1674
+ return this._set("firstTab", Math.max(0, Math.trunc(e)));
1675
+ }
1676
+ getWindowBounds() {
1677
+ return this._state.windowBounds;
1678
+ }
1679
+ setWindowBounds(e) {
1680
+ return this._set("windowBounds", e ? Object.freeze({ ...e }) : null);
1681
+ }
1682
+ isMinimized() {
1683
+ return this._state.minimized;
1684
+ }
1685
+ setMinimized(e) {
1686
+ return this._set("minimized", e);
1687
+ }
1688
+ getVisibility() {
1689
+ return this._state.visibility;
1690
+ }
1691
+ setVisibility(e) {
1692
+ return this._set("visibility", e);
1693
+ }
1694
+ isAutoFilterDateGrouping() {
1695
+ return this._state.autoFilterDateGrouping;
1696
+ }
1697
+ setAutoFilterDateGrouping(e) {
1698
+ return this._set("autoFilterDateGrouping", e);
1699
+ }
1700
+ _set(e, t) {
1701
+ return this._state[e] === t || (this._state[e] = t, this._emitter.notify("onViewChange")), this;
1702
+ }
1844
1703
  addListeners(e, t) {
1845
1704
  return this._emitter.addListeners(e, t);
1846
1705
  }
@@ -1848,7 +1707,7 @@ var dr = class {
1848
1707
  let e = {}, t = Object.keys(this._state), n = t.length;
1849
1708
  for (let r = 0; r < n; r++) {
1850
1709
  let n = t[r], i = this._state[n];
1851
- i != null && i !== yr[n] && (e[n] = i);
1710
+ i != null && i !== jr[n] && (e[n] = i);
1852
1711
  }
1853
1712
  return Object.keys(e).length === 0 && (e = null), e;
1854
1713
  }
@@ -1858,7 +1717,7 @@ var dr = class {
1858
1717
  }
1859
1718
  update(e, t = !0) {
1860
1719
  this._state = {
1861
- ...yr,
1720
+ ...jr,
1862
1721
  ...this._state,
1863
1722
  ...e
1864
1723
  }, t && this._emitter.notify("onViewChange");
@@ -1873,18 +1732,18 @@ var dr = class {
1873
1732
  get isIWorkbookView() {
1874
1733
  return !0;
1875
1734
  }
1876
- }, xr = Object.freeze({
1735
+ }, Nr = Object.freeze({
1877
1736
  structure: !1,
1878
1737
  windows: !1,
1879
- revision: !1,
1738
+ revision: !0,
1880
1739
  password: null,
1881
1740
  revisionsPassword: null
1882
- }), Sr = class extends dt {
1741
+ }), Pr = class extends Ae {
1883
1742
  isWindowsAllowed() {
1884
1743
  return this._isPropertyAllowed("windows");
1885
1744
  }
1886
1745
  isRevisionAllowed() {
1887
- return this._isPropertyAllowed("revision");
1746
+ return this.isLocked() && this._properties?.revision === void 0 ? !this._isReadOnly : this._isPropertyAllowed("revision");
1888
1747
  }
1889
1748
  isStructureAllowed() {
1890
1749
  return this._isPropertyAllowed("structure");
@@ -1901,7 +1760,7 @@ var dr = class {
1901
1760
  let n = Object.keys(t), r = n.length;
1902
1761
  for (let i = 0; i < r; i++) {
1903
1762
  let r = n[i], a = t[r];
1904
- a != null && a !== xr[r] && (e[r] = a);
1763
+ a != null && a !== Nr[r] && (e[r] = a);
1905
1764
  }
1906
1765
  }
1907
1766
  return super._toJSON(e);
@@ -1913,12 +1772,207 @@ var dr = class {
1913
1772
  return !0;
1914
1773
  }
1915
1774
  };
1916
- function Cr(e) {
1917
- return G("error.workbook.invalidSheetKey", { key: e });
1775
+ (X ||= {}).Type = {
1776
+ Number: "number",
1777
+ Boolean: "boolean",
1778
+ Date: "date",
1779
+ String: "string",
1780
+ Float: "float"
1781
+ };
1782
+ var Fr = (e) => {
1783
+ if (typeof e == "string") return {
1784
+ type: X.Type.String,
1785
+ value: e
1786
+ };
1787
+ if (typeof e == "boolean") return {
1788
+ type: X.Type.Boolean,
1789
+ value: e
1790
+ };
1791
+ if (typeof e == "number") {
1792
+ if (!Number.isFinite(e)) throw Error("A custom property value must be a finite number.");
1793
+ return {
1794
+ type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ? X.Type.Number : X.Type.Float,
1795
+ value: e
1796
+ };
1797
+ }
1798
+ if (e instanceof Date) {
1799
+ if (isNaN(e.getTime())) throw Error("A custom property value must be a valid date.");
1800
+ return {
1801
+ type: X.Type.Date,
1802
+ value: e.toISOString()
1803
+ };
1804
+ }
1805
+ throw Error("A custom property value must be a string, number, boolean or Date.");
1806
+ }, Ir = class {
1807
+ constructor(e, t) {
1808
+ this._json = e, this._owner = t;
1809
+ }
1810
+ getKey() {
1811
+ return this._json.key;
1812
+ }
1813
+ getType() {
1814
+ return this._json.type;
1815
+ }
1816
+ getLinkTarget() {
1817
+ return this._json.linkTarget ?? null;
1818
+ }
1819
+ getValue() {
1820
+ let { type: e, value: t } = this._json;
1821
+ return e === X.Type.Date ? new Date(t) : t;
1822
+ }
1823
+ setValue(e) {
1824
+ this._owner._assertCustomEditable(this), this._json = {
1825
+ ...this._json,
1826
+ ...Fr(e)
1827
+ };
1828
+ }
1829
+ delete() {
1830
+ this._owner._removeCustom(this);
1831
+ }
1832
+ toJSON() {
1833
+ return { ...this._json };
1834
+ }
1835
+ }, Lr = class {
1836
+ constructor(e) {
1837
+ this._json = {}, this._custom = [], this._assertOpen = e;
1838
+ }
1839
+ _text(e) {
1840
+ return this._json[e] ?? null;
1841
+ }
1842
+ _setText(e, t) {
1843
+ return this._assertOpen(), t == null || t === "" ? delete this._json[e] : this._json[e] = t, this;
1844
+ }
1845
+ getAuthor() {
1846
+ return this._text("author");
1847
+ }
1848
+ setAuthor(e) {
1849
+ return this._setText("author", e);
1850
+ }
1851
+ getCategory() {
1852
+ return this._text("category");
1853
+ }
1854
+ setCategory(e) {
1855
+ return this._setText("category", e);
1856
+ }
1857
+ getComments() {
1858
+ return this._text("comments");
1859
+ }
1860
+ setComments(e) {
1861
+ return this._setText("comments", e);
1862
+ }
1863
+ getCompany() {
1864
+ return this._text("company");
1865
+ }
1866
+ setCompany(e) {
1867
+ return this._setText("company", e);
1868
+ }
1869
+ getContentStatus() {
1870
+ return this._text("contentStatus");
1871
+ }
1872
+ setContentStatus(e) {
1873
+ return this._setText("contentStatus", e);
1874
+ }
1875
+ getCreationDate() {
1876
+ let e = this._json.creationDate;
1877
+ if (!e) return null;
1878
+ let t = new Date(e);
1879
+ return isNaN(t.getTime()) ? null : t;
1880
+ }
1881
+ getKeywords() {
1882
+ return this._text("keywords");
1883
+ }
1884
+ setKeywords(e) {
1885
+ return this._setText("keywords", e);
1886
+ }
1887
+ getLastAuthor() {
1888
+ return this._json.lastAuthor ?? null;
1889
+ }
1890
+ getManager() {
1891
+ return this._text("manager");
1892
+ }
1893
+ setManager(e) {
1894
+ return this._setText("manager", e);
1895
+ }
1896
+ getRevisionNumber() {
1897
+ return this._json.revisionNumber ?? null;
1898
+ }
1899
+ setRevisionNumber(e) {
1900
+ return this._assertOpen(), e != null && Number.isFinite(e) ? this._json.revisionNumber = e : delete this._json.revisionNumber, this;
1901
+ }
1902
+ getSubject() {
1903
+ return this._text("subject");
1904
+ }
1905
+ setSubject(e) {
1906
+ return this._setText("subject", e);
1907
+ }
1908
+ getTitle() {
1909
+ return this._text("title");
1910
+ }
1911
+ setTitle(e) {
1912
+ return this._setText("title", e);
1913
+ }
1914
+ getCustom() {
1915
+ return this._custom.slice();
1916
+ }
1917
+ getCustomProperty(e) {
1918
+ let t = e.toLowerCase();
1919
+ return this._custom.find((e) => e.getKey().toLowerCase() === t);
1920
+ }
1921
+ addCustomProperty(e, t) {
1922
+ if (this._assertOpen(), typeof e != "string" || e === "") throw Error("A custom property needs a name.");
1923
+ let n = this.getCustomProperty(e);
1924
+ if (n) return n.setValue(t), n;
1925
+ let r = new Ir({
1926
+ key: e,
1927
+ ...Fr(t)
1928
+ }, this);
1929
+ return this._custom.push(r), r;
1930
+ }
1931
+ deleteAllCustomProperties() {
1932
+ this._assertOpen(), this._custom = [];
1933
+ }
1934
+ _assertCustomEditable(e) {
1935
+ if (this._assertOpen(), !this._custom.includes(e)) throw Error("The custom property has been deleted.");
1936
+ }
1937
+ _removeCustom(e) {
1938
+ this._assertCustomEditable(e), this._custom = this._custom.filter((t) => t !== e);
1939
+ }
1940
+ fromJSON(e) {
1941
+ let { custom: t, ...n } = e ?? {};
1942
+ this._json = n, this._custom = (t ?? []).map((e) => new Ir({ ...e }, this));
1943
+ }
1944
+ toJSON() {
1945
+ let e = { ...this._json };
1946
+ return this._custom.length > 0 && (e.custom = this._custom.map((e) => e.toJSON())), e;
1947
+ }
1948
+ };
1949
+ function Rr(e) {
1950
+ return W("error.workbook.invalidSheetKey", { key: e });
1951
+ }
1952
+ function zr(e) {
1953
+ return W("error.workbook.sheetNameNotFound", { sheetName: e });
1918
1954
  }
1919
- var wr = class extends ge {
1920
- constructor(e, t, n) {
1921
- super(), this._add = e, this._get = t, this._addListeners = n;
1955
+ function Br(e, t) {
1956
+ return W(t === "chart" ? "error.workbook.sheetIsChart" : t === "macro" ? "error.workbook.sheetIsMacro" : "error.workbook.sheetIsDialog", { sheetName: e });
1957
+ }
1958
+ function Vr(e, t) {
1959
+ return t === "chart" ? W("error.workbook.selectedIsChart", { sheetName: e }) : t === "macro" ? W("error.workbook.selectedIsMacro", { sheetName: e }) : t === "dialog" ? W("error.workbook.selectedIsDialog", { sheetName: e }) : W("error.workbook.noWorksheet");
1960
+ }
1961
+ var Hr = class extends Ht {
1962
+ constructor(e, t, n, r) {
1963
+ super(), this._add = e, this._get = t, this._addListeners = n, this._getSelected = r;
1964
+ }
1965
+ getActive() {
1966
+ return this._getSelected();
1967
+ }
1968
+ getAt(e) {
1969
+ return this.getItems()[e] ?? null;
1970
+ }
1971
+ getByIndex(e) {
1972
+ return this.getItems()[e] ?? null;
1973
+ }
1974
+ getAll() {
1975
+ return this.getItems();
1922
1976
  }
1923
1977
  add(e) {
1924
1978
  return this._add(e);
@@ -1932,42 +1986,42 @@ var wr = class extends ge {
1932
1986
  addListeners(e, t) {
1933
1987
  return this._addListeners(e, t);
1934
1988
  }
1935
- get isISheetCollection() {
1989
+ get isIWorksheetCollection() {
1936
1990
  return !0;
1937
1991
  }
1938
- }, Tr = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), Er = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
1939
- function Dr(e) {
1940
- let t = G(W("workbook.defaultSheetName"), { n: e + 1 });
1992
+ }, Ur = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), Wr = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
1993
+ function Gr(e) {
1994
+ let t = W(U("workbook.defaultSheetName"), { n: e + 1 });
1941
1995
  return t === "workbook.defaultSheetName" ? `Sheet${e + 1}` : t;
1942
1996
  }
1943
- function Or(e, t) {
1997
+ function Kr(e, t) {
1944
1998
  return {
1945
- ...mt,
1946
- getSheet: () => null,
1947
- toString: () => D(e, t)
1999
+ ...zt,
2000
+ getWorksheet: () => null,
2001
+ toString: () => Tt(e, t)
1948
2002
  };
1949
2003
  }
1950
- function kr(e, t = !1) {
1951
- if (!e) throw Error(G("error.workbook.sheetNameBlank"));
1952
- if (Tr.test(e)) {
2004
+ function qr(e, t = !1) {
2005
+ if (!e) throw Error(W("error.workbook.sheetNameBlank"));
2006
+ if (Ur.test(e)) {
1953
2007
  if (!t) throw Error(function(e) {
1954
- return e ? G("error.workbook.sheetNameInvalidCharsNamed", { sheetName: e }) : G("error.workbook.sheetNameInvalidChars");
2008
+ return e ? W("error.workbook.sheetNameInvalidCharsNamed", { sheetName: e }) : W("error.workbook.sheetNameInvalidChars");
1955
2009
  }(e));
1956
- e = e.replace(Tr, "");
2010
+ e = e.replace(Ur, "");
1957
2011
  }
1958
- if (e.length === 0) throw Error(G("error.workbook.sheetNameBlank"));
2012
+ if (e.length === 0) throw Error(W("error.workbook.sheetNameBlank"));
1959
2013
  let n = e.length;
1960
2014
  if (n > 31) {
1961
- if (!t) throw Error(G("error.workbook.sheetNameTooLong"));
2015
+ if (!t) throw Error(W("error.workbook.sheetNameTooLong"));
1962
2016
  e = e.substring(0, 31);
1963
2017
  }
1964
2018
  if (e.charAt(0) === "'" || e.charAt(n - 1) === "'") {
1965
- if (!t) throw Error(G("error.workbook.sheetNameQuotes"));
2019
+ if (!t) throw Error(W("error.workbook.sheetNameQuotes"));
1966
2020
  e = e.replace(/^'|'$/g, "");
1967
2021
  }
1968
2022
  return e;
1969
2023
  }
1970
- var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2024
+ var Jr, Yr = "workbook.activeSheet", Xr = class e extends d {
1971
2025
  constructor(e, t, n, r) {
1972
2026
  super(e, t, r), this._workbook = n;
1973
2027
  }
@@ -1982,19 +2036,20 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
1982
2036
  }), new e(t, this._internal, this._workbook, r);
1983
2037
  }
1984
2038
  _createRange(e, t) {
1985
- let n = e ? { ...e } : null, r = n ? this._workbook._getSheetRef(n.scope, w.Visibility.VeryHidden) : null;
1986
- if (!r) {
1987
- let e = this._workbook.getSelectedSheet();
1988
- return delete n?.scope, Or(n, n ? {
1989
- scope: Qe,
2039
+ let n = e ? { ...e } : null, r = this._workbook, i = n ? r._getSheetRef(n.scope, T.Visibility.VeryHidden) : null;
2040
+ if (i && !i.sheet.isIWorksheet) throw new B(Br(i.name, i.sheet.getKind()));
2041
+ if (!i) {
2042
+ let e = r._anchorWorksheet();
2043
+ return delete n?.scope, Kr(n, n ? {
2044
+ scope: Ke,
1990
2045
  ...e.getEntireRange().getCoords()
1991
2046
  } : null);
1992
2047
  }
1993
- let i = this._options;
1994
- return t && (i = {
2048
+ let a = this._options;
2049
+ return t && (a = {
1995
2050
  ...this._options,
1996
2051
  getOptions: E(this._options.getOptions, t)
1997
- }), new Pr(e, C(r.sheet), this._workbook, i);
2052
+ }), new Zr(e, j(i.sheet), this._workbook, a);
1998
2053
  }
1999
2054
  async select(e) {
2000
2055
  let t = [], n = null, r = this.getCoords();
@@ -2002,8 +2057,8 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2002
2057
  let i = r[e];
2003
2058
  i && (n ||= i.scope, i && i.scope === n && t.push(i));
2004
2059
  }
2005
- n ||= this._workbook.getSelectedSheet().getName();
2006
- let i = this._workbook.getSheets().getByName(n);
2060
+ n ||= this._workbook.getWorksheet().getName();
2061
+ let i = this._workbook.getWorksheets().getByName(n);
2007
2062
  if (!i) return;
2008
2063
  let a = await i.getRanges(t).select(e), o = this._workbook._rangesAddressToCoords(a.getCoords());
2009
2064
  return this._createRanges(o);
@@ -2018,15 +2073,15 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2018
2073
  }
2019
2074
  getAddress(e) {
2020
2075
  let t = this._internal.getSheet(), n = t.getEntireRange().getCoords();
2021
- return Ie(this.getCoords(), {
2076
+ return kt(this.getCoords(), {
2022
2077
  ...n,
2023
2078
  scope: t.getName()
2024
- }, D, Ve, e);
2079
+ }, Tt, jt, e);
2025
2080
  }
2026
2081
  toString() {
2027
2082
  return this.getAddress();
2028
2083
  }
2029
- }, Pr = class e extends wt {
2084
+ }, Zr = class e extends De {
2030
2085
  constructor(e, t, n, r) {
2031
2086
  super(e, t, r), this._workbook = n;
2032
2087
  }
@@ -2035,12 +2090,12 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2035
2090
  return t && (n = {
2036
2091
  ...this._options,
2037
2092
  getOptions: E(this._options?.getOptions, t)
2038
- }), new Nr(e, this._internal, this._workbook, n);
2093
+ }), new Xr(e, this._internal, this._workbook, n);
2039
2094
  }
2040
2095
  _createRange(t, n) {
2041
2096
  let r = this._internal;
2042
- if (!t) return Ze(r.getSheet(), r.getSheet().getEntireCoords());
2043
- if (r.validateCoords(t), r.getSheet().isClosed()) return Ze(null, r.getSheet().getEntireCoords(), t);
2097
+ if (!t) return Nt(r.getSheet(), r.getSheet().getEntireCoords());
2098
+ if (r.validateCoords(t), r.getSheet().isClosed()) return Nt(null, r.getSheet().getEntireCoords(), t);
2044
2099
  let i = this._options;
2045
2100
  return n && (i = {
2046
2101
  ...this._options,
@@ -2057,7 +2112,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2057
2112
  }
2058
2113
  getAddress(e) {
2059
2114
  let t = this._internal.getSheet(), n = t?.getEntireRange().getCoords() ?? null;
2060
- return D(this.getCoords(), {
2115
+ return Tt(this.getCoords(), {
2061
2116
  ...n,
2062
2117
  scope: t.getName()
2063
2118
  });
@@ -2065,15 +2120,15 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2065
2120
  toString() {
2066
2121
  return this.getAddress();
2067
2122
  }
2068
- }, Fr = (e) => !!e && typeof e == "object" && typeof e.getOrigin == "function", Ir = class {
2069
- constructor(e) {
2070
- 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 me(() => {
2123
+ }, Qr = (e) => !!e && typeof e == "object" && typeof e.getOrigin == "function", $r = class {
2124
+ constructor(t) {
2125
+ 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 Ge(() => {
2071
2126
  let e = [];
2072
- for (let t of this.getSheets()) e.push(...t.getPivotTables());
2127
+ for (let t of this.getWorksheets()) e.push(...t.getPivotTables());
2073
2128
  return e;
2074
- }), this._people = new pr(), this._commentCollection = new f(null, (e, t, n) => {
2129
+ }), this._people = new vr(), this._commentCollection = new Kt(null, (e, t, n) => {
2075
2130
  let r = [];
2076
- for (let i of this.getSheets()) r.push(...i.getComments().getItems(e ? {
2131
+ for (let i of this.getWorksheets()) r.push(...i.getComments().getItems(e ? {
2077
2132
  address: e,
2078
2133
  ignoreHidden: t,
2079
2134
  fullyContained: n
@@ -2084,23 +2139,25 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2084
2139
  return r;
2085
2140
  }, (e, t) => this.addListeners({ onSheetsChange: e.onCollectionChange ? () => {
2086
2141
  e.onCollectionChange(this._commentCollection);
2087
- } : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._locale = null, this._localeOverrides = null;
2088
- let n = typeof e == "string" ? { origin: e } : { ...e }, i = n.origin;
2089
- this._ownOriginProvider = !Fr(i), this._originProvider = Fr(i) ? i : new pn(typeof i == "string" ? new K(null, { name: i }) : i ?? new K(null)), delete n.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
2142
+ } : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._documentProperties = new Lr(() => {
2143
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2144
+ }), this._locale = null, this._localeOverrides = null, this._startModules = /* @__PURE__ */ new WeakSet();
2145
+ let n = typeof t == "string" ? { origin: t } : { ...t }, r = n.origin;
2146
+ this._ownOriginProvider = !Qr(r), this._originProvider = Qr(r) ? r : new zn(typeof r == "string" ? new G(null, { name: r }) : r ?? new G(null)), delete n.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
2090
2147
  let a = n.json;
2091
- delete n.json, this._transactions = n.transactions ?? new r(), this._id = this._transactions.create(), this._ownTransactions = !n.transactions, this._emitter = new t(this, this._transactions), this._runtime = n.runtime ?? new p("Workbook Runtime", {
2148
+ delete n.json, this._transactions = n.transactions ?? new i(), this._id = this._transactions.create(), this._ownTransactions = !n.transactions, this._emitter = new e(this, this._transactions), this._runtime = n.runtime ?? new Qe("Workbook Runtime", {
2092
2149
  isDate1904: () => this._isDate1904,
2093
2150
  getNow: () => this._transactions.getCurrentCommit().getTimestamp(),
2094
- getLocale: () => this._locale ?? we() ?? St(),
2151
+ getLocale: () => this._locale ?? At() ?? ht(),
2095
2152
  getLocaleOverrides: () => this._localeOverrides
2096
- }), this._listenerLanguage = Zt.addChangeListener(() => {
2153
+ }), this._listenerLanguage = Cn.addChangeListener(() => {
2097
2154
  this._closed || this._notifyAllChange();
2098
2155
  });
2099
- let o = this, s = this._beginCommit({ description: W(a ? "op.openWorkbook" : "op.newWorkbook") });
2156
+ let o = this, s = this._beginCommit({ description: U(a ? "op.openWorkbook" : "op.newWorkbook") });
2100
2157
  try {
2101
- this._strings = n.strings ?? new ee(), this._ownStrings = !n.strings, this._resources = n.resources ?? new Ee(), this._ownResources = !n.resources, this._createSheetName = n.createSheetNameCallback ?? Dr;
2102
- let e = n.createSheetCallback;
2103
- e ||= (e) => new O(e), this._sheetOnNameChange = /* @__PURE__ */ new Map(), this._sheetOnVisibilityChange = /* @__PURE__ */ new Map(), this._sheetOnIndexChange = /* @__PURE__ */ new Map(), this._createSheet = (t, n, r, i, a, s, c) => {
2158
+ this._strings = n.strings ?? new ye(), this._ownStrings = !n.strings, this._richValues = n.richData ?? new ue(), this._resources = n.resources ?? new Ee(), this._ownResources = !n.resources, this._fetch = new Er(this._resources, n.fetcher ?? new wr()), this._createSheetName = n.createSheetNameCallback ?? Gr;
2159
+ let e = n.createWorksheetCallback;
2160
+ e ||= (e) => new A(e), this._sheetOnNameChange = /* @__PURE__ */ new Map(), this._sheetOnVisibilityChange = /* @__PURE__ */ new Map(), this._sheetOnIndexChange = /* @__PURE__ */ new Map(), this._createSheet = (t, n, r, i, a, s, c) => {
2104
2161
  let l = null, u = {
2105
2162
  runtime: o._runtime,
2106
2163
  readonly: o._options.readonly ?? !1,
@@ -2109,6 +2166,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2109
2166
  transactions: o._transactions,
2110
2167
  styles: o._styles,
2111
2168
  strings: o._strings,
2169
+ richData: o._richValues,
2112
2170
  resources: o._resources,
2113
2171
  names: o._names,
2114
2172
  workbook: o,
@@ -2119,7 +2177,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2119
2177
  l = e, o._addSheetRef({
2120
2178
  name: n,
2121
2179
  id: t,
2122
- visibility: r ?? w.Visibility.Visible,
2180
+ visibility: r ?? T.Visibility.Visible,
2123
2181
  sheetId: a,
2124
2182
  sheet: e
2125
2183
  }, i);
@@ -2136,7 +2194,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2136
2194
  },
2137
2195
  getVisibility: () => {
2138
2196
  let e = o._getSheetRef(l);
2139
- return e ? e.visibility : w.Visibility.Visible;
2197
+ return e ? e.visibility : T.Visibility.Visible;
2140
2198
  },
2141
2199
  setVisibility: (e, t) => {
2142
2200
  o._setSheetVisibility(l, e, t);
@@ -2147,40 +2205,36 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2147
2205
  duplicate: () => o._duplicateSheet(l),
2148
2206
  getIndex: () => {
2149
2207
  let e = o._getSheetRef(l);
2150
- return e ? o._getOffsetForId(e.id, o._getSheetRefs(w.Visibility.VeryHidden)) : i;
2208
+ return e ? o._getOffsetForId(e.id, o._getSheetRefs(T.Visibility.VeryHidden)) : i;
2151
2209
  },
2152
2210
  setIndex: (e, t) => {
2153
- let n = o._getSheetRef(l, w.Visibility.VeryHidden);
2211
+ let n = o._getSheetRef(l, T.Visibility.VeryHidden);
2154
2212
  return !!n && (o._moveSheet(n, e, t), !0);
2155
2213
  },
2156
2214
  setIndexCallback: (e) => {
2157
2215
  o._sheetOnIndexChange.set(t, e);
2158
2216
  },
2159
- requestSelect: async () => (o._setSelectedSheet(l), await this._emitter.notify("onRequestSelect", {
2160
- source: o,
2161
- params: l,
2162
- async: !0
2163
- }), o.getSelectedSheet() === l)
2217
+ requestSelect: () => o._requestSelect(l)
2164
2218
  }
2165
2219
  };
2166
2220
  return s && (u.json = s), c !== void 0 && (u.uid = () => c), l = e(u, n, i, r), l;
2167
- }, this._namedTableSource = new d({
2168
- getSheets: () => o._sheets ? o.getSheets().getItems() : R.EmptyArray,
2221
+ }, this._namedTableSource = new ut({
2222
+ getSheets: () => o._sheets ? o.getWorksheets().getItems() : R.EmptyArray,
2169
2223
  addSheetsListener: (e, t) => o.addListeners({ onSheetsChange: e }, t)
2170
- }), this._names = n.names ?? new oe({
2224
+ }), this._names = n.names ?? new _t({
2171
2225
  addressToRanges: (e) => o.getRanges(e),
2172
- getCurrentScope: () => o.getSelectedSheet().getName(),
2226
+ getCurrentScope: () => o.getSelectedWorksheet()?.getName() ?? null,
2173
2227
  isReadOnly: () => (o._options.readonly ?? !1) || o._isStructureProtected(),
2174
2228
  transactions: o._transactions,
2175
2229
  getSources: () => o._calculation ? [o._calculation.getNamedFormulas(), o._namedTableSource] : R.EmptyArray
2176
- }), this._ownNames = !n.names, this._calculation = n.calculation ?? new lt({
2230
+ }), this._ownNames = !n.names, this._calculation = n.calculation ?? new h({
2177
2231
  runtime: o._runtime,
2178
2232
  functions: n.functions,
2179
2233
  json: a?.calc,
2180
2234
  isNamesReadOnly: () => o._isStructureProtected(),
2181
2235
  getActiveCell: () => {
2182
- let e = o.getSelectedSheet(), t = e?.getSelectedRange()?.getCoords();
2183
- return t ? {
2236
+ let e = o.getSelectedWorksheet(), t = e?.getSelectedRange()?.getCoords();
2237
+ return e && t ? {
2184
2238
  rowIndex: t.rowStart,
2185
2239
  colIndex: t.colStart,
2186
2240
  scope: e.getId()
@@ -2192,19 +2246,19 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2192
2246
  getSheetIndex: (e) => {
2193
2247
  if (e === void 0) {
2194
2248
  let e = o.getSelectedSheet();
2195
- return e ? this._getSheetRefs(w.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
2249
+ return e ? this._getSheetRefs(T.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
2196
2250
  }
2197
- let t = this._getSheetRefs(w.Visibility.VeryHidden);
2251
+ let t = this._getSheetRefs(T.Visibility.VeryHidden);
2198
2252
  e = e.toLowerCase();
2199
2253
  let n = t.length;
2200
2254
  for (let r = 0; r < n; r++) if (t[r].name.toLowerCase() === e) return r;
2201
2255
  try {
2202
- Lr.address = e;
2203
- let t = this._names.getItems(Lr);
2256
+ ei.address = e;
2257
+ let t = this._names.getItems(ei);
2204
2258
  if (!t || t.length === 0) return -1;
2205
2259
  let n = t[0].getRanges?.()?.getCoords()?.[0]?.scope;
2206
2260
  if (!n) return -1;
2207
- let r = this._getSheetRefs(w.Visibility.VeryHidden);
2261
+ let r = this._getSheetRefs(T.Visibility.VeryHidden);
2208
2262
  n = n.toLowerCase();
2209
2263
  let i = r.length;
2210
2264
  for (let e = 0; e < i; e++) if (r[e].name.toLowerCase() === n) return e;
@@ -2213,30 +2267,42 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2213
2267
  }
2214
2268
  return -1;
2215
2269
  },
2216
- getSheetCount: () => o.getSheets().getItems({ visibility: w.Visibility.VeryHidden }).length,
2270
+ getSheetCount: () => o._getSheetRefs(T.Visibility.VeryHidden).length,
2217
2271
  externalBooks: a?.externalBooks,
2218
2272
  externalBookResolver: n.externalBookResolver,
2219
2273
  namedCollection: o._names,
2220
2274
  strings: o._strings,
2275
+ get resources() {
2276
+ return o._resources;
2277
+ },
2278
+ fetch: (e, t) => o._fetch.fetch(e, t),
2279
+ startFunctions: () => o._startFunctions(),
2221
2280
  transactions: o._transactions,
2222
2281
  names: a?.names
2223
2282
  }), this._ownCalculation = !n.calculation, this._scripts = this._createScripts(a?.modules), this._ownNames = !n.names, this._options = Object.freeze({ ...n });
2224
- let t = a?.sheets?.length ? a.sheets.map((e) => e.name) : [this._createSheetName(0)], r = t.map((e) => e + "-" + R.uuidV4());
2225
- this._calculation._setSheets(t.map((e, t) => [r[t], e]));
2226
- let i = n.calcOnLoad ?? "auto", c = !1, l = (async () => {
2283
+ let t = a?.sheets?.length ? a.sheets.map((e) => e.name) : [this._createSheetName(0)], r = t.map((e) => e + "-" + R.uuidV4()), i = (e) => {
2284
+ let t = a?.sheets?.[e]?.kind;
2285
+ return !!t && t !== T.Kind.Worksheet;
2286
+ };
2287
+ this._calculation._setSheets(t.map((e, t) => i(t) ? [
2288
+ r[t],
2289
+ e,
2290
+ !0
2291
+ ] : [r[t], e]));
2292
+ let c = n.calcOnLoad ?? "auto", l = !1, u = (async () => {
2227
2293
  try {
2228
- if (this._ownCalculation && i !== "none" && (i === "full" || i === "auto" && !0 === a?.calc?.fullCalcOnLoad ? await this._calculation.calculate({ full: !0 }) : await this._calculation.start(), this._closed)) return;
2294
+ if (this._ownCalculation && c !== "none" && (c === "full" || c === "auto" && !0 === a?.calc?.fullCalcOnLoad ? await this._calculation.calculate({ full: !0 }) : await this._calculation.start(), this._closed)) return;
2229
2295
  await this._scripts.start();
2230
2296
  } finally {
2231
- c = !0, this._starting = null;
2297
+ l = !0, this._starting = null;
2232
2298
  }
2233
2299
  })();
2234
- c || (this._starting = l), this._starting?.catch(() => {}), a ? this._fromJSON(a, r) : (this._initState(), this._addSheet(!1, t[0], null, r[0])), this._sheets = new wr((e) => o._addSheetOptions(e), (e, t) => {
2300
+ l || (this._starting = u), this._starting?.catch(() => {}), a ? this._fromJSON(a, r) : (this._initState(), this._addSheet(!1, t[0], null, r[0])), this._sheets = new Hr((e) => o._addSheetOptions(e), (e, t) => {
2235
2301
  if (e) {
2236
2302
  let n = this._getSheetRef(e, t);
2237
- return n ? [n.sheet] : R.EmptyArray;
2303
+ return n && Z(n) ? [n.sheet] : R.EmptyArray;
2238
2304
  }
2239
- return this._getSheets(t);
2305
+ return this._getWorksheets(t);
2240
2306
  }, (e, t) => {
2241
2307
  let n = e.onCollectionChange, r = e.onInvalidated;
2242
2308
  return o._emitter.addListeners({
@@ -2247,7 +2313,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2247
2313
  r(o._sheets);
2248
2314
  } : void 0
2249
2315
  }, t);
2250
- }), this._ownCalculation && (n.calcOnLoad ?? "auto") !== "none" && this._calculation.hydrateNames(), this._emitter.notify("onLoad"), this._ownTransactions ? s.amend() : s.commit();
2316
+ }, () => o.getSelectedWorksheet()), this._ownCalculation && (n.calcOnLoad ?? "auto") !== "none" && this._calculation.hydrateNames(), this._emitter.notify("onLoad"), this._ownTransactions ? s.amend() : s.commit();
2251
2317
  } catch (e) {
2252
2318
  throw s.rollback(), e;
2253
2319
  }
@@ -2257,13 +2323,13 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2257
2323
  let e = this._getSheetRefs();
2258
2324
  for (let t = (e ? e.length : 0) - 1; t >= 0; t--);
2259
2325
  let t = this._options;
2260
- this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new ct().getDefaultTheme(), this._styles = t?.styles ?? new re(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new br()), this._listenerProtection?.(), this._protection = new Sr(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
2326
+ this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new St().getDefaultTheme(), this._styles = t?.styles ?? new Gt(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new Mr()), this._listenerProtection?.(), this._protection = new Pr(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
2261
2327
  n._emitter.notify("onProtectionChange");
2262
2328
  } });
2263
2329
  let n = this;
2264
2330
  this._transactionsRemoveListener = this._transactions.addStateListener(this._id, {
2265
2331
  async onAfterStateChange(e, t, r, i, a) {
2266
- let o = n._view, s = a?.[Mr], c = r ? s?.before : s?.after, l = s?.viewId === o.getId() && c != null, u = l ? c : o.getActiveSheetId(), d = l && t.getId() === n._lastTransactionUUID ? n._getSheetRef({ id: u }) : null;
2332
+ let o = n._view, s = a?.[Yr], c = r ? s?.before : s?.after, l = s?.viewId === o.getId() && c != null, u = l ? c : o.getActiveSheetId(), d = l && t.getId() === n._lastTransactionUUID ? n._getSheetRef({ id: u }) : null;
2267
2333
  d ? await d.sheet.select() : n._resyncActiveSheet(u, e), n._lastTransactionUUID = t.getId(), (r || i) && n._emitter.notify("onSheetsChange"), n._emitter.notify("onSelectedSheetChange"), n._emitter.notify("onViewChange");
2268
2334
  },
2269
2335
  onRestoreOrRevert() {
@@ -2318,8 +2384,8 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2318
2384
  return this._view;
2319
2385
  }
2320
2386
  setView(e) {
2321
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2322
- if (!e) throw new B(G("error.sheet.emptyView"));
2387
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2388
+ if (!e) throw new B(W("error.sheet.emptyView"));
2323
2389
  this._listenerWorkbookView?.();
2324
2390
  let t = this, n = -1;
2325
2391
  return this._listenerWorkbookView = e.addListeners({ onViewChange: (e) => {
@@ -2331,7 +2397,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2331
2397
  return this._runtime;
2332
2398
  }
2333
2399
  setDate1904(e) {
2334
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2400
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2335
2401
  return this._isDate1904 === e || (this._isDate1904 = e, this._emitter.notify("onRegionalChange")), this;
2336
2402
  }
2337
2403
  getLocale() {
@@ -2341,11 +2407,11 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2341
2407
  return this._locale;
2342
2408
  }
2343
2409
  setLocale(e) {
2344
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2410
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2345
2411
  if (e) try {
2346
2412
  new Intl.Locale(e);
2347
2413
  } catch {
2348
- throw Error(G("error.workbook.invalidLocale", { locale: e }));
2414
+ throw Error(W("error.workbook.invalidLocale", { locale: e }));
2349
2415
  }
2350
2416
  return this._locale === e || (this._locale = e, this._emitter.notify("onRegionalChange")), this;
2351
2417
  }
@@ -2353,7 +2419,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2353
2419
  return this._localeOverrides;
2354
2420
  }
2355
2421
  setLocaleOverrides(e) {
2356
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2422
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2357
2423
  let t = e && Object.keys(e).length > 0 ? e : null;
2358
2424
  return this._localeOverrides = t, this._emitter.notify("onRegionalChange"), this;
2359
2425
  }
@@ -2363,9 +2429,23 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2363
2429
  getResources() {
2364
2430
  return this._resources;
2365
2431
  }
2432
+ getFetcher() {
2433
+ return this._fetch.getFetcher();
2434
+ }
2435
+ fetch(e, t) {
2436
+ return this._fetch.fetch(e, t);
2437
+ }
2366
2438
  getTransactions() {
2367
2439
  return this._transactions;
2368
2440
  }
2441
+ getChanges(e) {
2442
+ let t = this._transactions, [n, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], a = this.getWorksheets().getItems({ visibility: T.Visibility.VeryHidden });
2443
+ for (let e = 0; e < a.length; e++) {
2444
+ let t = a[e];
2445
+ t instanceof A && i.push(...t._changeEventsOf(n, r ?? null));
2446
+ }
2447
+ return i;
2448
+ }
2369
2449
  getStrings() {
2370
2450
  return this._strings;
2371
2451
  }
@@ -2376,7 +2456,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2376
2456
  return this._updateLinks;
2377
2457
  }
2378
2458
  setUpdateLinks(e) {
2379
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2459
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2380
2460
  return this._updateLinks = e, this;
2381
2461
  }
2382
2462
  getPivotTables() {
@@ -2392,8 +2472,8 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2392
2472
  return this._theme;
2393
2473
  }
2394
2474
  setTheme(e) {
2395
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2396
- if (!e) throw new B(G("error.workbook.notSetValue"));
2475
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2476
+ if (!e) throw new B(W("error.workbook.notSetValue"));
2397
2477
  let t = this._theme;
2398
2478
  return this._theme = e, this.getStyles().setTheme(e), this._emitter.notify("onThemeChange"), t;
2399
2479
  }
@@ -2402,54 +2482,90 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2402
2482
  }
2403
2483
  getSelectedSheet() {
2404
2484
  let e = this._getSheetRef(this.getSelectedSheetIndex());
2405
- return e ? e?.sheet : null;
2485
+ return e ? e.sheet : null;
2486
+ }
2487
+ getSelectedWorksheet() {
2488
+ let e = this._getSheetRef(this.getSelectedSheetIndex());
2489
+ return e && Z(e) ? e.sheet : null;
2490
+ }
2491
+ getActiveSheet() {
2492
+ return this.getSelectedWorksheet();
2406
2493
  }
2407
- getSheet(e, t = w.Visibility.Visible) {
2494
+ getActiveWorksheet() {
2495
+ return this.getSelectedWorksheet();
2496
+ }
2497
+ getSheets(e) {
2498
+ let t = this._getSheetRefs(e?.visibility ?? T.Visibility.Visible), n = Array(t.length);
2499
+ for (let e = 0; e < t.length; e++) n[e] = t[e].sheet;
2500
+ return n;
2501
+ }
2502
+ getSheet(e) {
2408
2503
  if (e === void 0) return this.getSelectedSheet();
2409
- if (!e) throw Error(G("error.workbook.sheetNameNotProvided"));
2504
+ if (!e) throw Error(W("error.workbook.sheetNameNotProvided"));
2505
+ let t = this._getSheetRef(e);
2506
+ if (!t) throw new V(zr(e));
2507
+ return t.sheet;
2508
+ }
2509
+ getWorksheet(e, t = T.Visibility.Visible) {
2510
+ if (typeof e == "number") return this.getWorksheetAt(e, t);
2511
+ if (e === void 0) return this._requireSelectedWorksheet();
2512
+ if (!e) throw Error(W("error.workbook.sheetNameNotProvided"));
2410
2513
  let n = this._getSheetRef(e, t);
2411
- if (!n) throw new H(G("error.workbook.sheetNameNotFound", { sheetName: e }));
2514
+ if (!n) throw new V(zr(e));
2515
+ if (!Z(n)) throw new V(Br(n.name, n.sheet.getKind()));
2412
2516
  return n.sheet;
2413
2517
  }
2414
- getSheetAt(e, t = w.Visibility.Visible) {
2415
- let n = this._getSheetRef(e, t);
2416
- if (!n) throw new H(function(e) {
2417
- return G("error.workbook.sheetIndexNotFound", { index: e });
2518
+ getWorksheetAt(e, t = T.Visibility.Visible) {
2519
+ let n = this._getWorksheets(t)[e];
2520
+ if (!n) throw new V(function(e) {
2521
+ return W("error.workbook.sheetIndexNotFound", { index: e });
2418
2522
  }(e));
2419
- return n.sheet;
2523
+ return n;
2524
+ }
2525
+ _requireSelectedWorksheet() {
2526
+ let e = this.getSelectedWorksheet();
2527
+ if (e) return e;
2528
+ let t = this.getSelectedSheet();
2529
+ throw new B(Vr(t?.getName() ?? "", t?.getKind() ?? T.Kind.Worksheet));
2420
2530
  }
2421
- getSheets() {
2531
+ _anchorWorksheet() {
2532
+ return this.getSelectedWorksheet() || (this._getWorksheets(T.Visibility.VeryHidden)[0] ?? null);
2533
+ }
2534
+ getWorksheets() {
2422
2535
  return this._sheets;
2423
2536
  }
2424
- addSheet(e) {
2425
- return this.getSheets().add(e);
2537
+ addWorksheet(e) {
2538
+ return this.getWorksheets().add(e);
2426
2539
  }
2427
- _getSheets(e = w.Visibility.Visible) {
2540
+ _getWorksheets(e = T.Visibility.Visible) {
2428
2541
  let t = this._getSheetRefs(e), n = [], r = t.length;
2429
- for (let e = 0; e < r; e++) n.push(t[e].sheet);
2542
+ for (let e = 0; e < r; e++) {
2543
+ let r = t[e];
2544
+ Z(r) && n.push(r.sheet);
2545
+ }
2430
2546
  return n;
2431
2547
  }
2432
- _getSheetRefs(e = w.Visibility.Visible) {
2548
+ _getSheetRefs(e = T.Visibility.Visible) {
2433
2549
  let t = this._getState();
2434
- return t ? e === w.Visibility.Visible ? t.sheetRefsVisible : e === w.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === w.Visibility.VeryHidden ? t.sheetRefsAll : R.EmptyArray : [];
2550
+ return t ? e === T.Visibility.Visible ? t.sheetRefsVisible : e === T.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === T.Visibility.VeryHidden ? t.sheetRefsAll : R.EmptyArray : [];
2435
2551
  }
2436
- _getSheetRef(e, t = w.Visibility.Visible) {
2552
+ _getSheetRef(e, t = T.Visibility.Visible) {
2437
2553
  let n = null;
2438
- return typeof e == "number" ? this._getSheetRefs(t)[e] : (typeof e == "string" ? n = this._getState().refsByLowerCaseName.get(e.toLowerCase()) : e instanceof O ? n = this._getState().refsByInstance.get(e) : e?.id !== void 0 && (n = this._getState().refsById.get(e.id)), n);
2554
+ return typeof e == "number" ? this._getSheetRefs(t)[e] : (typeof e == "string" ? n = this._getState().refsByLowerCaseName.get(e.toLowerCase()) : !0 === e?.isISheet ? n = this._getState().refsByInstance.get(e) : e?.id !== void 0 && (n = this._getState().refsById.get(e.id)), n);
2439
2555
  }
2440
2556
  _validateNewSheetName(e, t = !0) {
2441
2557
  if (e == null) return e;
2442
- if (kr(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new B(G("error.workbook.nameTaken"));
2558
+ if (qr(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new B(W("error.workbook.nameTaken"));
2443
2559
  return e.substring(0, 31);
2444
2560
  }
2445
2561
  findValidSheetName(e) {
2446
- e &&= kr(e, !0);
2562
+ e &&= qr(e, !0);
2447
2563
  try {
2448
2564
  return function(e, t) {
2449
2565
  try {
2450
2566
  if (t(e)) return e;
2451
2567
  } catch {}
2452
- let n, r, i = Er.exec(e);
2568
+ let n, r, i = Wr.exec(e);
2453
2569
  for (i === null ? (n = e + " ", r = 1) : (n = e.substring(0, i.index), r = parseFloat(i[1])); r < 256;) {
2454
2570
  r++;
2455
2571
  let e = "(" + r + ")", i = n.substring(0, 31 - e.length) + e;
@@ -2464,25 +2580,25 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2464
2580
  }
2465
2581
  }
2466
2582
  isValidSheetNameCharacter(e) {
2467
- return !Tr.test(e);
2583
+ return !Ur.test(e);
2468
2584
  }
2469
2585
  _isStructureProtected() {
2470
2586
  return !this._initializing && !this.getProtection().isStructureAllowed();
2471
2587
  }
2472
2588
  _addSheetOptions(e) {
2473
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2474
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2589
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2590
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2475
2591
  let t, n = null;
2476
2592
  t = typeof e == "string" ? { name: e } : typeof e == "number" ? { index: e } : e, t = {
2477
2593
  ...t,
2478
- description: t?.description ?? W("op.addSheet")
2594
+ description: t?.description ?? U("op.addSheet")
2479
2595
  };
2480
2596
  let r = this.beginCommit(t);
2481
2597
  try {
2482
2598
  let e = t?.autoSelect ?? !1;
2483
2599
  n = this._addSheet(!0, t.name, t.index ?? null);
2484
2600
  let i = this.getView().getActiveSheetId();
2485
- if (e && this._recordActiveSheet(r, i, this._getSheetRef(n).id), r.commit({ description: G("op.addSheetNamed", { name: n.getName() }) }), !1 !== e) {
2601
+ if (e && this._recordActiveSheet(r, i, this._getSheetRef(n).id), r.commit({ description: W("op.addSheetNamed", { name: n.getName() }) }), !1 !== e) {
2486
2602
  let t = typeof e == "boolean" ? void 0 : e;
2487
2603
  n.select(t);
2488
2604
  }
@@ -2494,7 +2610,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2494
2610
  _nextSheetName(e = null) {
2495
2611
  let t = e ? e.toLowerCase() : null, n = this._getState(), r = n.sheetsByLowerCaseName;
2496
2612
  if (e && r.has(t)) throw new B(function(e) {
2497
- return G("error.workbook.nameDuplicate", { sheetName: e });
2613
+ return W("error.workbook.nameDuplicate", { sheetName: e });
2498
2614
  }(e));
2499
2615
  t = (e = this._validateNewSheetName(e)) ? e.toLowerCase() : null;
2500
2616
  let i = n.lastId + 1;
@@ -2506,15 +2622,60 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2506
2622
  }
2507
2623
  _addSheet(e, t = null, n = null, r) {
2508
2624
  t = this._nextSheetName(t);
2509
- let i = this._getState(), a = this._createSheet(i.lastId, t, w.Visibility.Visible, n, void 0, null, r);
2510
- if (!a) throw new B(G("error.workbook.sheetNameBlank"));
2625
+ let i = this._getState(), a = this._createSheet(i.lastId, t, T.Visibility.Visible, n, void 0, null, r);
2626
+ if (!a) throw new B(W("error.workbook.sheetNameBlank"));
2511
2627
  return e && (this._tellSheets(), this._emitter.notify("onSheetsChange")), a;
2512
2628
  }
2629
+ _createOpaqueSheet(e, t, n, r, i, a, o, s, c) {
2630
+ let l = this, u = null;
2631
+ return u = new Ar({
2632
+ kind: a,
2633
+ id: c ?? t + "-" + R.uuidV4(),
2634
+ part: o,
2635
+ tabColor: s,
2636
+ styles: this._styles,
2637
+ transactions: this._transactions,
2638
+ workbook: this,
2639
+ container: {
2640
+ getName: () => l._getSheetRef(u)?.name ?? t,
2641
+ setName: (e, t) => {
2642
+ l._setSheetName(u, e, t);
2643
+ },
2644
+ getVisibility: () => l._getSheetRef(u, T.Visibility.VeryHidden)?.visibility ?? T.Visibility.Visible,
2645
+ setVisibility: (e, t) => {
2646
+ l._setSheetVisibility(u, e, t);
2647
+ },
2648
+ getIndex: () => {
2649
+ let e = l._getSheetRef(u, T.Visibility.VeryHidden);
2650
+ return e ? l._getOffsetForId(e.id, l._getSheetRefs(T.Visibility.VeryHidden)) : -1;
2651
+ },
2652
+ setIndex: (e, t) => {
2653
+ let n = l._getSheetRef(u, T.Visibility.VeryHidden);
2654
+ n && l._moveSheet(n, e, t);
2655
+ },
2656
+ requestSelect: () => l._requestSelect(u),
2657
+ isAttached: () => !!l._getSheetRef(u, T.Visibility.VeryHidden)
2658
+ }
2659
+ }), this._sheetOnNameChange.set(e, () => u._notify("onNameChange")), this._sheetOnVisibilityChange.set(e, () => u._notify("onVisibilityChange")), this._sheetOnIndexChange.set(e, () => u._notify("onIndexChange")), this._addSheetRef({
2660
+ name: t,
2661
+ id: e,
2662
+ visibility: n ?? T.Visibility.Visible,
2663
+ sheetId: i,
2664
+ sheet: u
2665
+ }, r), u;
2666
+ }
2667
+ async _requestSelect(e) {
2668
+ return this._setSelectedSheet(e), await this._emitter.notify("onRequestSelect", {
2669
+ source: this,
2670
+ params: e,
2671
+ async: !0
2672
+ }), this.getSelectedSheet() === e;
2673
+ }
2513
2674
  _updateSheetRefStates(e) {
2514
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2515
- if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2675
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2676
+ if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2516
2677
  let t = e, n = [], r = [], i = t.length;
2517
- for (let e = 0; e < i; e++) t[e].visibility === w.Visibility.Visible ? (n.push(t[e]), r.push(t[e])) : t[e].visibility === w.Visibility.Hidden && r.push(t[e]);
2678
+ for (let e = 0; e < i; e++) t[e].visibility === T.Visibility.Visible ? (n.push(t[e]), r.push(t[e])) : t[e].visibility === T.Visibility.Hidden && r.push(t[e]);
2518
2679
  this._updateState({
2519
2680
  sheetRefsAll: t,
2520
2681
  sheetRefsVisible: n,
@@ -2524,7 +2685,11 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2524
2685
  _tellSheets() {
2525
2686
  if (this._isLoadingSheets) return;
2526
2687
  let e = this._getState().sheetRefsAll;
2527
- this._calculation._setSheets(e.map((e) => [e.sheet.getId(), e.name]));
2688
+ this._calculation._setSheets(e.map((e) => Z(e) ? [e.sheet.getId(), e.name] : [
2689
+ e.sheet.getId(),
2690
+ e.name,
2691
+ !0
2692
+ ]));
2528
2693
  }
2529
2694
  _addSheetRef(e, t = null) {
2530
2695
  let n = this._getState(), r = n.sheetRefsAll, i = Math.max(0, Math.min(r.length, t ?? r.length)), a = [
@@ -2550,9 +2715,9 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2550
2715
  p._validateDeleteSheet(e);
2551
2716
  },
2552
2717
  onDelete(e) {
2553
- let t = p._getSheetRef(e, w.Visibility.VeryHidden);
2718
+ let t = p._getSheetRef(e, T.Visibility.VeryHidden);
2554
2719
  if (!t) return;
2555
- let n = p._beginCommit({ description: G("op.deleteSheet", { name: t.name }) });
2720
+ let n = p._beginCommit({ description: W("op.deleteSheet", { name: t.name }) });
2556
2721
  try {
2557
2722
  let r = p._getState(), i = r.sheetRefsAll, a = p._getOffsetForId(t.id, i), s = [...i];
2558
2723
  s.splice(a, 1), p._updateSheetRefStates(s);
@@ -2582,14 +2747,14 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2582
2747
  throw n.rollback(), e;
2583
2748
  }
2584
2749
  }
2585
- }), r = o.addListeners({ onSelectionChange: (e) => {
2750
+ }, { transactional: !0 }), r = Z(e) ? e.sheet.addListeners({ onSelectionChange: (e) => {
2586
2751
  p.getView().getActiveSheetId() === p._getSheetRef(e)?.id && p._emitter.notify("onSelectionChange", {
2587
2752
  source: p,
2588
2753
  params: e
2589
2754
  });
2590
- } }, { transactional: !1 });
2755
+ } }, { transactional: !1 }) : null;
2591
2756
  m = new Map(n.listenersSheets), m.set(e.id, () => {
2592
- t(), r();
2757
+ t(), r?.();
2593
2758
  });
2594
2759
  }
2595
2760
  let h = n.lastId;
@@ -2606,7 +2771,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2606
2771
  }
2607
2772
  _recordActiveSheet(e, t, n) {
2608
2773
  let r = this.getView().getId();
2609
- e.setIntent(Mr, (e) => ({
2774
+ e.setIntent(Yr, (e) => ({
2610
2775
  viewId: r,
2611
2776
  before: e?.before ?? t,
2612
2777
  after: n
@@ -2636,29 +2801,30 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2636
2801
  let n = this._view.getActiveSheetId();
2637
2802
  n ??= (this._view.setActiveSheetId(t), t);
2638
2803
  let r = e.refsById.get(n);
2639
- r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), n = t), r.visibility === w.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(n, e.sheetRefsVisible));
2804
+ r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), n = t), r.visibility === T.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(n, e.sheetRefsVisible));
2640
2805
  }
2641
2806
  _validateDeleteSheet(e) {
2642
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2643
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2807
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2808
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2644
2809
  let t = this._getSheetRef(e);
2645
2810
  if (!t) throw new B(function(e) {
2646
- return G("error.workbook.deleteKey", { key: e });
2811
+ return W("error.workbook.deleteKey", { key: e });
2647
2812
  }(e));
2648
2813
  let n = this._getState().sheetRefsVisible;
2649
- if (n.length === 1 && n[0].id === t.id) throw new B(G("error.workbook.sheetOne"));
2814
+ if (n.length === 1 && n[0].id === t.id) throw new B(W("error.workbook.sheetOne"));
2650
2815
  }
2651
2816
  _getOffsetForId(e, t) {
2652
2817
  let n = t.length;
2653
2818
  for (let r = 0; r < n; r++) if (t[r].id === e) return r;
2654
- throw new B(G("error.workbook.noVisibleRefs"));
2819
+ throw new B(W("error.workbook.noVisibleRefs"));
2655
2820
  }
2656
2821
  find(e) {
2657
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2658
- let t = this._getSheets();
2822
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2823
+ let t = this._getWorksheets();
2824
+ if (t.length === 0) return { next: () => vt };
2659
2825
  if (t.length === 1) return t[0].find(e);
2660
2826
  typeof e == "string" && (e = { text: e });
2661
- let n = !e?.reverse, r = e?.disableWrap ?? !1, i = this.getSelectedSheetIndex(), a = i, o = t[a], s = !1;
2827
+ let n = !e?.reverse, r = e?.disableWrap ?? !1, i = this._worksheetOffsetFrom(this.getSelectedSheetIndex(), t), a = i, o = t[a], s = !1;
2662
2828
  e = {
2663
2829
  ...e,
2664
2830
  disableWrap: !0
@@ -2681,7 +2847,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2681
2847
  }
2682
2848
  if (!d && s && a === i && (u.done || !c || !u.done && f(u.value.getCoords(), c) >= 0) && (d = !0), d) {
2683
2849
  let e = u;
2684
- return u = xe, e;
2850
+ return u = vt, e;
2685
2851
  }
2686
2852
  let p = u;
2687
2853
  return u = l.next(), p;
@@ -2693,11 +2859,11 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2693
2859
  } };
2694
2860
  }
2695
2861
  replace(e, t, n) {
2696
- let r = 0, i = null, a = typeof t == "function", o = n?.maxCount ?? 2 ** 53 - 1, s = !n?.maxCount, c = "", l = typeof t == "string" ? nt(t) : null, u = n?.description ?? W("op.replace"), d = this._transactions.beginCommit({ description: u });
2862
+ let r = 0, i = null, a = typeof t == "function", o = n?.maxCount ?? 2 ** 53 - 1, s = !n?.maxCount, c = "", l = typeof t == "string" ? gt(t) : null, u = n?.description ?? U("op.replace"), d = this._transactions.beginCommit({ description: u });
2697
2863
  try {
2698
2864
  let u = null, f = null, p = e.next();
2699
2865
  for (; !p.done && r < o;) {
2700
- let o = p.value, s = o.getSheet();
2866
+ let o = p.value, s = o.getWorksheet();
2701
2867
  s !== u && (u = s, f !== null && f.apply(), f = u.getEntireRange().createSparseBuilder({
2702
2868
  axis: n?.axis,
2703
2869
  allowUnorderedWrites: !0
@@ -2705,10 +2871,10 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2705
2871
  let c = a ? t(o) : t;
2706
2872
  c !== void 0 && c !== o && (f.push(o, c), r++, i = o), p = e.next();
2707
2873
  }
2708
- f?.apply(), r === 1 && o === 1 && i && (c = i.getAddress()), r === 0 ? d.rollback() : d.commit({ description: n?.description ?? (s ? l === null ? W("op.replaceAll") : G("op.replaceAllWith", { value: l }) : c ? l === null ? G("op.replaceAt", { address: c }) : G("op.replaceAtWith", {
2874
+ f?.apply(), r === 1 && o === 1 && i && (c = i.getAddress()), r === 0 ? d.rollback() : d.commit({ description: n?.description ?? (s ? l === null ? U("op.replaceAll") : W("op.replaceAllWith", { value: l }) : c ? l === null ? W("op.replaceAt", { address: c }) : W("op.replaceAtWith", {
2709
2875
  address: c,
2710
2876
  value: l
2711
- }) : l === null ? W("op.replace") : G("op.replaceWith", { value: l })) });
2877
+ }) : l === null ? U("op.replace") : W("op.replaceWith", { value: l })) });
2712
2878
  } catch (e) {
2713
2879
  throw d.rollback(), e;
2714
2880
  }
@@ -2725,91 +2891,119 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2725
2891
  let n = t.length;
2726
2892
  return n === 1 ? 0 : (e === void 0 && (e = this.getSelectedSheetIndex()), (e = Math.max(0, Math.min(e, n - 1))) <= 0 ? n - 1 : e - 1);
2727
2893
  }
2894
+ _worksheetOffsetFrom(e, t) {
2895
+ let n = this._getSheetRefs(), r = n.length;
2896
+ for (let i = 0; i < r; i++) {
2897
+ let a = n[(e + i) % r];
2898
+ if (!Z(a)) continue;
2899
+ let o = t.indexOf(a.sheet);
2900
+ if (o !== -1) return o;
2901
+ }
2902
+ return 0;
2903
+ }
2728
2904
  getNextSheet(e) {
2729
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2905
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2730
2906
  let t = this._getSheetRefs();
2731
2907
  return t[this._nextSheetIndex(e, t)]?.sheet ?? null;
2732
2908
  }
2733
2909
  getPreviousSheet(e) {
2734
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2910
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2735
2911
  let t = this._getSheetRefs();
2736
2912
  return t[this._prevSheetIndex(e, t)]?.sheet ?? null;
2737
2913
  }
2738
2914
  async _duplicateSheet(e) {
2739
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2740
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2915
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2916
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2741
2917
  let t = this._getSheetRefs(), n = this.getSelectedSheetIndex(), r = null;
2742
2918
  if (e) {
2743
- if (r = this._getSheetRef(e), !r) throw new B(Cr(r));
2919
+ if (r = this._getSheetRef(e), !r) throw new B(Rr(r));
2744
2920
  } else r = t[n];
2745
2921
  if (!r) return null;
2746
- let i = r.sheet, a = this._strings.beginPersist(), o = this.getResources().beginPersist(), s = this.getStyles().beginPersist(), c = null, l = this.beginCommit(G("op.duplicateNamed", { name: i.getName() }));
2922
+ if (!Z(r)) throw new B((i = r.name, W("error.workbook.sheetNotDuplicable", { sheetName: i })));
2923
+ var i;
2924
+ let a = r.sheet, o = this._strings.beginPersist(), s = this.getResources().beginPersist(), c = this.getStyles().beginPersist(), l = this._richValues.beginPersist(), u = null, d = this.beginCommit(W("op.duplicateNamed", { name: a.getName() }));
2747
2925
  try {
2748
- let e = this._getState().refsByInstance.get(i), r = await i.toJSON(), a = t.length + 1, o = this.findValidSheetName(e.name), s = this._createSheet(a, o, e.visibility, n, void 0, r);
2749
- this._tellSheets(), this._emitter.notify("onSheetsChange"), c = s, l.commit();
2926
+ let e = this._getState().refsByInstance.get(a), r = await a.toJSON(), i = t.length + 1, o = this.findValidSheetName(e.name), s = this._createSheet(i, o, e.visibility, n, void 0, r);
2927
+ this._tellSheets(), this._emitter.notify("onSheetsChange"), u = s, d.commit();
2750
2928
  } catch (e) {
2751
- throw l.rollback(), e;
2929
+ throw d.rollback(), e;
2752
2930
  } finally {
2753
- s.endPersist(), o.endPersist(), a.endPersist();
2931
+ l.endPersist(), c.endPersist(), s.endPersist(), o.endPersist();
2754
2932
  }
2755
- return c;
2933
+ return u;
2756
2934
  }
2757
2935
  _createRange(e, t) {
2758
- let n = e ? { ...e } : null, r = n ? this._getSheetRef(n.scope, w.Visibility.VeryHidden) : null;
2936
+ let n = e ? { ...e } : null, r = n ? this._getSheetRef(n.scope, T.Visibility.VeryHidden) : null;
2937
+ if (r && !Z(r)) throw new B(Br(r.name, r.sheet.getKind()));
2759
2938
  if (!r) {
2760
- let e = this.getSelectedSheet();
2761
- return e ? (delete n?.scope, Or(n, n ? {
2762
- scope: Qe,
2939
+ let e = this._anchorWorksheet();
2940
+ return e ? (delete n?.scope, Kr(n, n ? {
2941
+ scope: Ke,
2763
2942
  ...e.getEntireRange().getCoords()
2764
- } : null)) : void console.warn(G("error.workbook.noVisibleRefs"));
2943
+ } : null)) : void console.warn(W("error.workbook.noVisibleRefs"));
2765
2944
  }
2766
2945
  let i = r.sheet, a = null;
2767
- return t && (a = { getOptions: t }), new Pr(e, C(i), this, a);
2946
+ return t && (a = { getOptions: t }), new Zr(e, j(i), this, a);
2768
2947
  }
2769
2948
  _createRanges(e, t) {
2770
- let n = this.getSelectedSheet(), r = null;
2771
- return t && (r = { getOptions: t }), new Nr(e, C(n), this, r);
2949
+ let n = this._anchorWorksheet();
2950
+ if (!n) throw new B(Vr("", T.Kind.Worksheet));
2951
+ let r = null;
2952
+ return t && (r = { getOptions: t }), new Xr(e, j(n), this, r);
2772
2953
  }
2773
2954
  getRange(e, t) {
2774
2955
  if (e === void 0) return this.getSelectedRange(t);
2775
2956
  try {
2776
2957
  let n = this._rangesAddressToCoords(e);
2777
- if (n.length !== 1) throw new B(G("error.address.singleRangeOnlyAlt"));
2958
+ if (n.length !== 1) throw new B(W("error.address.singleRangeOnlyAlt"));
2778
2959
  return this._createRange(n[0], t);
2779
2960
  } catch (t) {
2780
- throw t instanceof H ? new H(t.message) : new B(t.message ?? ae(e));
2961
+ throw t instanceof V ? new V(t.message) : new B(t.message ?? pe(e));
2781
2962
  }
2782
2963
  }
2783
2964
  getCell(e) {
2784
2965
  if (e === void 0) return this.getSelectedCell();
2785
2966
  let t = this.getRange(e);
2786
- if (t.size > 1) throw new B(G("error.address.singleCellOnly"));
2967
+ if (t.size > 1) throw new B(W("error.address.singleCellOnly"));
2787
2968
  return t.getCell();
2788
2969
  }
2789
2970
  getRanges(e, t) {
2790
2971
  let n = this._rangesAddressToCoords(e);
2791
- if (n.length === 0) throw new B(ae(e));
2972
+ if (n.length === 0) throw new B(pe(e));
2792
2973
  return this._createRanges(n, t);
2793
2974
  }
2794
2975
  _createGraphRanges(e, t) {
2795
2976
  let n = [], r = this.getCalculation()?.getNamedFormulas() ?? null;
2796
2977
  for (let e = 0; e < t.length; e++) {
2797
- let i = t[e], a = (i.sheetName ? this._getSheetRef(i.sheetName, w.Visibility.VeryHidden) : null)?.sheet ?? this.getSelectedSheet();
2798
- a && n.push(new Le(i, r, C(a), null));
2978
+ let i = t[e], a = i.sheetName ? this._getSheetRef(i.sheetName, T.Visibility.VeryHidden) : null, o = a && Z(a) ? a.sheet : this._anchorWorksheet();
2979
+ o && n.push(new be(i, r, j(o), null));
2799
2980
  }
2800
2981
  for (let t = 0; t < e.length; t++) n.push(e[t]);
2801
- return n.length === 0 ? null : new Nr(n, C(this.getSelectedSheet()), this, null);
2982
+ let i = this._anchorWorksheet();
2983
+ return n.length !== 0 && i ? new Xr(n, j(i), this, null) : null;
2984
+ }
2985
+ getAnomalies(e) {
2986
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2987
+ let t = oe(e), n = this._getWorksheets(T.Visibility.VeryHidden).map((e) => {
2988
+ let t = j(e);
2989
+ return {
2990
+ bounds: t.getSheet().getEntireCoords(),
2991
+ internal: t,
2992
+ qualified: !0
2993
+ };
2994
+ });
2995
+ return new w(n, () => (this.getSelectedWorksheet() ?? this._getWorksheets(T.Visibility.VeryHidden)[0]).getEntireRange(), t);
2802
2996
  }
2803
2997
  getStats(e) {
2804
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2805
- let t = this._getSheets(w.Visibility.VeryHidden), n = t.length;
2998
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2999
+ let t = this._getWorksheets(T.Visibility.VeryHidden), n = t.length;
2806
3000
  if (n === 1) return t[0].getStats(e);
2807
3001
  let r = Array(n);
2808
3002
  for (let i = 0; i < n; i++) r[i] = t[i].getStats(e);
2809
- return new cr(r);
3003
+ return new fr(r);
2810
3004
  }
2811
3005
  _activeRangeCoords() {
2812
- let e = this.getSelectedSheet(), t = e.getSelection().getRanges().getCoords(), n = e.getName(), r = t.length, i = Array(r);
3006
+ let e = this._requireSelectedWorksheet(), t = e.getSelection().getRanges().getCoords(), n = e.getName(), r = t.length, i = Array(r);
2813
3007
  for (let e = 0; e < r; e++) {
2814
3008
  let r = t[e];
2815
3009
  i[e] = {
@@ -2829,11 +3023,11 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2829
3023
  return this.getRanges(this._activeRangeCoords(), e);
2830
3024
  }
2831
3025
  getSelectedCell() {
2832
- return this.getSelectedSheet().getSelectedCell();
3026
+ return this._requireSelectedWorksheet().getSelectedCell();
2833
3027
  }
2834
- _rangesAddressToCoords(e, t = !0, n = w.Visibility.Hidden) {
2835
- if (!e) throw new B(G("error.address.noAddress"));
2836
- let r = this.getSelectedSheet(), i = { ...r?.getEntireRange().getCoords() }, a = r?.getName();
3028
+ _rangesAddressToCoords(e, t = !0, n = T.Visibility.Hidden) {
3029
+ if (!e) throw new B(W("error.address.noAddress"));
3030
+ let r = this.getSelectedWorksheet(), i = { ...(r ?? this._anchorWorksheet())?.getEntireRange().getCoords() }, a = r?.getName();
2837
3031
  if (a && (i.scope = a), typeof e == "string") {
2838
3032
  let t = e.trim().toLowerCase();
2839
3033
  if (t === "r" || t === "c") {
@@ -2841,22 +3035,30 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2841
3035
  t === "r" ? r.rowStart = r.rowEnd = n.rowIndex : r.colStart = r.colEnd = n.colIndex, e = r;
2842
3036
  }
2843
3037
  }
2844
- let o = this, s = ht(e, i, vt, (e) => {
3038
+ let s = this, c = Et(e, i, it, (e) => {
2845
3039
  if (!t) return null;
2846
3040
  if (typeof e == "string") {
2847
- let t = o.getNames().getByName(e)?.getRanges?.();
2848
- if (t) return t.getCoords();
3041
+ let t = ct(e, {
3042
+ getTable: (e) => o(s.getNames().getByName(e)),
3043
+ getAnchor: () => r ? {
3044
+ sheet: r,
3045
+ coords: r.getSelectedCell().getCoords()
3046
+ } : null
3047
+ });
3048
+ if (t) return [t];
3049
+ let n = s.getNames().getByName(e)?.getRanges?.();
3050
+ if (n) return n.getCoords();
2849
3051
  }
2850
3052
  throw new B(`Invalid sheet reference '${e}'.`);
2851
- }), c = s.length;
2852
- for (let e = 0; e < c; e++) this._validateCoords(s[e], n);
2853
- return s;
3053
+ }), l = c.length;
3054
+ for (let e = 0; e < l; e++) this._validateCoords(c[e], n);
3055
+ return c;
2854
3056
  }
2855
- _validateCoords(e, t = w.Visibility.Visible, n = G("error.sheet.oobRange")) {
3057
+ _validateCoords(e, t = T.Visibility.Visible, n = W("error.sheet.oobRange")) {
2856
3058
  if (e === null) return;
2857
- let r = this.getSheet(e.scope, t).getEntireRange().getCoords();
2858
- if (!z.isRangeWithinRange(e, r)) throw new H(n);
2859
- if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new B(G("error.address.invalidRangeInverted"));
3059
+ let r = this.getWorksheet(e.scope ?? void 0, t).getEntireRange().getCoords();
3060
+ if (!z.isRangeWithinRange(e, r)) throw new V(n);
3061
+ if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new B(W("error.address.invalidRangeInverted"));
2860
3062
  }
2861
3063
  _updateSheetRef(e, t) {
2862
3064
  let n = this._getState(), r = [...n.sheetRefsAll];
@@ -2876,16 +3078,16 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2876
3078
  }), this._tellSheets(), t;
2877
3079
  }
2878
3080
  _setSheetName(e, t, n) {
2879
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2880
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
3081
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
3082
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2881
3083
  let r = this._getSheetRef(e);
2882
- if (!r) throw new B(Cr(e));
3084
+ if (!r) throw new B(Rr(e));
2883
3085
  if (t === r.name) return r.sheet;
2884
- if ((t = this._validateNewSheetName(t)) == null) throw new B(G("error.workbook.sheetNameNotProvided"));
3086
+ if ((t = this._validateNewSheetName(t)) == null) throw new B(W("error.workbook.sheetNameNotProvided"));
2885
3087
  let i = Object.freeze({
2886
3088
  ...r,
2887
3089
  name: t
2888
- }), a = null, o = this.beginCommit(W("op.renameSheet"));
3090
+ }), a = null, o = this.beginCommit(U("op.renameSheet"));
2889
3091
  try {
2890
3092
  let e = this._updateSheetRef(r, i);
2891
3093
  this._adjustSheetNamesIfRequired(), this._sheetOnNameChange.forEach((e, t) => {
@@ -2896,23 +3098,23 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2896
3098
  }
2897
3099
  return a;
2898
3100
  }
2899
- _setSheetVisibility(e, t = w.Visibility.Visible, n) {
2900
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2901
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2902
- let r = this._getSheetRef(e, w.Visibility.VeryHidden);
3101
+ _setSheetVisibility(e, t = T.Visibility.Visible, n) {
3102
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
3103
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3104
+ let r = this._getSheetRef(e, T.Visibility.VeryHidden);
2903
3105
  if (!r) return null;
2904
3106
  if (t === r.visibility) return;
2905
3107
  let i = null, a = "";
2906
- t === w.Visibility.Visible ? a = W("op.unhideSheet") : t === w.Visibility.Hidden ? a = W("op.hideSheet") : t === w.Visibility.VeryHidden && (a = W("op.veryHideSheet"));
3108
+ t === T.Visibility.Visible ? a = U("op.unhideSheet") : t === T.Visibility.Hidden ? a = U("op.hideSheet") : t === T.Visibility.VeryHidden && (a = U("op.veryHideSheet"));
2907
3109
  let o = this.beginCommit(a);
2908
3110
  try {
2909
3111
  let e = this._getState().sheetRefsVisible;
2910
- if (t !== w.Visibility.Visible && e.length === 1 && e[0].id === r.id) throw new B(G("error.workbook.sheetOne"));
3112
+ if (t !== T.Visibility.Visible && e.length === 1 && e[0].id === r.id) throw new B(W("error.workbook.sheetOne"));
2911
3113
  let a = {
2912
3114
  ...r,
2913
3115
  visibility: t
2914
3116
  }, s = -1;
2915
- t !== w.Visibility.Visible && (s = this._getOffsetForId(r.id, e)), i = this._updateSheetRef(r, a).sheet, t !== w.Visibility.Visible && this._adjustRemoveSelectionIfRequired(s, r.id), this._adjustSheetNamesIfRequired(), o.commit(n);
3117
+ t !== T.Visibility.Visible && (s = this._getOffsetForId(r.id, e)), i = this._updateSheetRef(r, a).sheet, t !== T.Visibility.Visible && this._adjustRemoveSelectionIfRequired(s, r.id), this._adjustSheetNamesIfRequired(), o.commit(n);
2916
3118
  } catch (e) {
2917
3119
  throw o.rollback(), e;
2918
3120
  }
@@ -2921,9 +3123,9 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2921
3123
  }), this._emitter.notify("onSheetsChange"), i;
2922
3124
  }
2923
3125
  _moveSheet(e, t, n) {
2924
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
2925
- if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2926
- let r = null, i = this.beginCommit(G("op.moveSheetNamed", { name: e.name }));
3126
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
3127
+ if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3128
+ let r = null, i = this.beginCommit(W("op.moveSheetNamed", { name: e.name }));
2927
3129
  try {
2928
3130
  let a = this._getState(), o = a.sheetRefsVisible;
2929
3131
  if (t < 0 || t > o.length - 1) throw new B(`Invalid to index: ${t}`);
@@ -2939,15 +3141,18 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2939
3141
  return r;
2940
3142
  }
2941
3143
  _setSelectedSheet(e) {
2942
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
3144
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
2943
3145
  let t = this._getSheetRef(e);
2944
- if (!t) throw new B(Cr(e));
3146
+ if (!t) throw new B(Rr(e));
2945
3147
  let n = null;
2946
- return t.visibility !== w.Visibility.Visible && this._setSheetVisibility(t, w.Visibility.Visible), this._view.setActiveSheetId(t.id), n = t.sheet, n;
3148
+ return t.visibility !== T.Visibility.Visible && this._setSheetVisibility(t, T.Visibility.Visible), this._view.setActiveSheetId(t.id), n = t.sheet, n;
2947
3149
  }
2948
3150
  getProtection() {
2949
3151
  return this._protection;
2950
3152
  }
3153
+ getProperties() {
3154
+ return this._documentProperties;
3155
+ }
2951
3156
  getCodeName() {
2952
3157
  return this._codeName;
2953
3158
  }
@@ -2958,7 +3163,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2958
3163
  return this._calculation;
2959
3164
  }
2960
3165
  getFonts() {
2961
- return kn.getShared();
3166
+ return me.getShared();
2962
3167
  }
2963
3168
  createFormula(e, t, n) {
2964
3169
  return this.getCalculation().createFormula(e, t, n);
@@ -2970,6 +3175,12 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2970
3175
  let e = this._starting;
2971
3176
  return e ? e.then(() => this.getCalculation().ready()) : this.getCalculation().ready();
2972
3177
  }
3178
+ whenFontsReady() {
3179
+ return this.getFonts().whenReady();
3180
+ }
3181
+ async whenReady() {
3182
+ await Promise.all([this.whenCalculationReady(), this.whenFontsReady()]);
3183
+ }
2973
3184
  getScripts() {
2974
3185
  return this._scripts ||= this._createScripts(), this._scripts;
2975
3186
  }
@@ -2983,40 +3194,35 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
2983
3194
  return this._emitter.addListeners(e, t);
2984
3195
  }
2985
3196
  _sheetToWBEvent(e) {
2986
- let t = this;
2987
- return (n) => {
2988
- let r = () => {
2989
- let e = n.getSource();
2990
- if (e.isInvalid()) return e;
2991
- if (e.isICellRanges) {
2992
- let n = [...e.getCoords()], r = n.length;
2993
- for (let t = 0; t < r; t++) {
2994
- let r = n[t];
2995
- !r.scope && e.getSheet().getName() && (n[t] = {
2996
- ...r,
2997
- scope: e.getSheet().getName()
2998
- });
2999
- }
3000
- return t.getRanges(n);
3001
- }
3002
- if (e.isICellRange) {
3003
- let n = e.getCoords(), r = e.getSheet().getName();
3004
- return t.getRange({
3005
- ...n,
3006
- scope: r
3007
- });
3008
- }
3009
- };
3197
+ let t = this, n = (e) => {
3198
+ if (e.isInvalid()) return e;
3199
+ let n = e.getWorksheet().getName();
3200
+ if (e.isICellRanges) {
3201
+ let r = e.getCoords().map((e) => e.scope ? e : {
3202
+ ...e,
3203
+ scope: n
3204
+ });
3205
+ return t.getRanges(r);
3206
+ }
3207
+ let r = e.getCoords();
3208
+ return t.getRange(r.scope ? r : {
3209
+ ...r,
3210
+ scope: n
3211
+ });
3212
+ };
3213
+ return (t) => {
3010
3214
  e({
3011
- getSource: r,
3012
- trigger: n.trigger,
3013
- getFrom: () => t.getRanges(n.getFrom()),
3014
- getTo: () => t.getRange(n.getTo()),
3015
- isDataChange: n.isDataChange,
3016
- getTransactionId: n.getTransactionId,
3017
- isUndo: n.isUndo,
3018
- toString: () => `WorkbookRangeEvent: ('${n.trigger}', ${r().toString()})`,
3019
- timeStamp: Date.now()
3215
+ getSource: () => n(t.getSource()),
3216
+ getRanges: () => {
3217
+ let e = t.getRanges();
3218
+ return e ? n(e) : null;
3219
+ },
3220
+ getPreviousAddress: () => t.getPreviousAddress(),
3221
+ getTrigger: () => t.getTrigger(),
3222
+ isUndo: () => t.isUndo(),
3223
+ getCommit: () => t.getCommit(),
3224
+ toString: () => `WorkbookRangeEvent: ('${t.getTrigger()}', ${n(t.getSource()).toString()})`,
3225
+ getTimeStamp: () => t.getTimeStamp()
3020
3226
  });
3021
3227
  };
3022
3228
  }
@@ -3024,68 +3230,89 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3024
3230
  let e = this._pivotCaches;
3025
3231
  if (e.length === 0) return;
3026
3232
  let t = (e) => {
3027
- let t = this._getSheetRef(e)?.sheet;
3028
- return t ? t._contentAddWatch(() => null) : null;
3233
+ let t = this._getSheetRef(e), n = t && Z(t) ? t.sheet : null;
3234
+ return n ? n._contentAddWatch(() => null) : null;
3029
3235
  };
3030
3236
  for (let n = 0; n < e.length; n++) e[n]._hold(t);
3031
3237
  }
3032
3238
  _fromJSON(e, t) {
3033
- if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || e.sheets.length === 0) throw new B(G("error.workbook.sheetOne"));
3034
- e.theme && (this._theme = new _t(e.theme), this._styles.setTheme(this._theme));
3035
- let n = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist();
3239
+ if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || e.sheets.length === 0) throw new B(W("error.workbook.sheetOne"));
3240
+ e.theme && (this._theme = new le(e.theme), this._styles.setTheme(this._theme));
3241
+ let n = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist(), a = this._richValues.beginPersist();
3036
3242
  try {
3037
- n.fromJSON(e.strings), r.fromJSON(e.resources), i.fromJSON(e.styles), e.date1904 && (this._isDate1904 = !0), this._codeName = e.codeName ?? null, this._updateLinks = e.updateLinks ?? null, e.locale && (this._locale = e.locale), e.localeOverrides && (this._localeOverrides = e.localeOverrides), e.view ||= {};
3038
- let a = [], o = e.pivotCaches;
3039
- if (o) {
3243
+ n.fromJSON(e.strings), r.fromJSON(e.resources), this._fetch.adopt(this._resources.getItems()), i.fromJSON(e.styles), a.fromJSON(e.richData, {
3244
+ resources: this._resources,
3245
+ strings: this._strings,
3246
+ fromResourceId: (e) => r.fromResourceId(e) ?? null
3247
+ }, e.richTypes), e.date1904 && (this._isDate1904 = !0), this._codeName = e.codeName ?? null, this._updateLinks = e.updateLinks ?? null, this._documentProperties.fromJSON(e.properties), e.locale && (this._locale = e.locale), e.localeOverrides && (this._localeOverrides = e.localeOverrides), e.view ||= {};
3248
+ let o = [], s = e.pivotCaches;
3249
+ if (s) {
3040
3250
  let e = r.fromResourceId.bind(r);
3041
- for (let t = 0; t < o.length; t++) {
3042
- let n = o[t];
3043
- n && typeof n.cacheId == "number" && a.push(new dr(n.cacheId, de.fromJSON(n.part, e)));
3251
+ for (let t = 0; t < s.length; t++) {
3252
+ let n = s[t];
3253
+ n && typeof n.cacheId == "number" && o.push(new gr(n.cacheId, k.fromJSON(n.part, e)));
3044
3254
  }
3045
3255
  }
3046
- this._pivotCaches = a, this._people.fromJSON(e.people);
3047
- let s = e.sheets, c = s.length, l = e.view.activeSheetId ?? null;
3048
- l !== null && (l = Math.min(Math.max(0, l), c - 1));
3049
- let u = null, d = null;
3256
+ this._pivotCaches = o, this._people.fromJSON(e.people);
3257
+ let c = e.sheets, l = c.length, u = e.view.activeSheetId ?? null;
3258
+ u !== null && (u = Math.min(Math.max(0, u), l - 1));
3259
+ let d = null, f = null;
3050
3260
  this._isLoadingSheets = !0;
3051
- for (let e = 0; e < c; e++) {
3052
- let n = s[e], r = n.visibility || w.Visibility.Visible, i = e;
3053
- d = i, r === w.Visibility.Visible ? u === null && (u = i) : l !== null && l === i && (l = null);
3261
+ for (let e = 0; e < l; e++) {
3262
+ let n = c[e], i = n.visibility || T.Visibility.Visible, a = e;
3263
+ f = a, i === T.Visibility.Visible ? d === null && (d = a) : u !== null && u === a && (u = null);
3054
3264
  try {
3055
- this._createSheet(i, n.name, r, e, n.sheetId, n.sheet, t?.[e]);
3265
+ let o = n.kind ?? T.Kind.Worksheet;
3266
+ if (o !== T.Kind.Worksheet) {
3267
+ let s = n.sheet, c = k.fromJSON(s?.part, r.fromResourceId.bind(r));
3268
+ if (!c) throw new B(W("error.workbook.sheetPartMissing", { sheetName: n.name }));
3269
+ this._createOpaqueSheet(a, n.name, i, e, n.sheetId, o, c, s?.tabColor ?? null, t?.[e]);
3270
+ } else this._createSheet(a, n.name, i, e, n.sheetId, n.sheet, t?.[e]);
3056
3271
  } catch (e) {
3057
3272
  throw this._isLoadingSheets = !1, e;
3058
3273
  }
3059
3274
  }
3060
- this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._updateState({ lastId: d }), e.view.activeSheetId = l ?? u, this.setView(new br({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
3061
- let f = this;
3062
- this._protection = new Sr(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
3063
- f._emitter.notify("onProtectionChange", { source: e });
3275
+ this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._updateState({ lastId: f }), e.view.activeSheetId = u ?? d, this.setView(new Mr({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
3276
+ let p = this;
3277
+ this._protection = new Pr(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
3278
+ p._emitter.notify("onProtectionChange", { source: e });
3064
3279
  } }), this._emitter.notify("onLoad");
3065
3280
  } finally {
3066
- i.endPersist(), r.endPersist(), n.endPersist();
3281
+ a.endPersist(), i.endPersist(), r.endPersist(), n.endPersist();
3067
3282
  }
3068
3283
  }
3284
+ async _startFunctions() {
3285
+ let e = this._scripts;
3286
+ if (!e) return R.EmptyArray;
3287
+ await e._load();
3288
+ let t = [];
3289
+ for (let n of e.getModules().getItems()) this._startModules.add(n), t.push(...n.getFunctions().getItems({
3290
+ type: "formula",
3291
+ includeHidden: !0
3292
+ }));
3293
+ return t;
3294
+ }
3069
3295
  _createScripts(e) {
3070
3296
  let t = this;
3071
- return new hr({
3297
+ return new br({
3072
3298
  transactions: this._transactions,
3073
3299
  json: e,
3074
3300
  workbook: t,
3075
3301
  getBuiltInFunctions: () => t._calculation?.getFunctions(),
3076
3302
  onAdd: (e, n) => {
3077
3303
  let r = t._calculation;
3078
- r.getStatus() !== y.Status.Off && r.start().then(async () => {
3304
+ r.getStatus() !== Vt.Status.Off && r.start().then(async () => {
3305
+ if (t._startModules.has(n)) return;
3079
3306
  let e = n.getFunctions().getItems({
3080
3307
  type: "formula",
3081
3308
  includeHidden: !0
3082
- }), t = e.length;
3083
- for (let n = 0; n < t; n++) {
3084
- let t = e[n];
3309
+ }), r = e.length;
3310
+ for (let t = 0; t < r; t++) {
3311
+ let n = e[t];
3085
3312
  try {
3086
- await this._calculation.getFunctions().add(t);
3313
+ await this._calculation.getFunctions().add(n);
3087
3314
  } catch (e) {
3088
- V.error(e?.message ?? String(e), e);
3315
+ En.error(e?.message ?? String(e), e);
3089
3316
  }
3090
3317
  }
3091
3318
  }).catch(() => {});
@@ -3094,10 +3321,10 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3094
3321
  });
3095
3322
  }
3096
3323
  async toJSON(e) {
3097
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
3324
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
3098
3325
  await Promise.resolve(this._starting);
3099
3326
  let t = this.getCalculation();
3100
- t.getStatus() !== y.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
3327
+ t.getStatus() !== Vt.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
3101
3328
  let n = { sheets: [] }, r = e?.ignoreStyles ?? !1;
3102
3329
  if (!r) {
3103
3330
  let e = this._theme.toJSON();
@@ -3107,48 +3334,65 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3107
3334
  let e = this._scripts.toJSON();
3108
3335
  e && Object.keys(e).length > 0 && (n.modules = e);
3109
3336
  }
3110
- this._isDate1904 && (n.date1904 = !0), this._codeName && (n.codeName = this._codeName), this._updateLinks && (n.updateLinks = this._updateLinks), this._locale && (n.locale = this._locale), this._localeOverrides && (n.localeOverrides = this._localeOverrides);
3111
- let i = e?.resources ?? "embed", a = i === "ignore", o = this._strings.beginPersist(), s = a ? null : this._resources.beginPersist(), c = this._styles.beginPersist();
3337
+ this._isDate1904 && (n.date1904 = !0), this._codeName && (n.codeName = this._codeName), this._updateLinks && (n.updateLinks = this._updateLinks);
3338
+ let i = this._documentProperties.toJSON();
3339
+ Object.keys(i).length > 0 && (n.properties = i), this._locale && (n.locale = this._locale), this._localeOverrides && (n.localeOverrides = this._localeOverrides);
3340
+ let a = e?.resources ?? "embed", o = a === "ignore", s = this._strings.beginPersist(), c = o ? null : this._resources.beginPersist(), l = this._styles.beginPersist(), u = this._richValues.beginPersist();
3112
3341
  try {
3113
- let t = this._getSheetRef(this.getSelectedSheetIndex()).id, l = t, u = null, d = this._getState(), f = d.sheetRefsAll, p = d.sheetsById, m = f.length;
3114
- for (let r = 0; r < m; r++) {
3115
- let i = f[r], a = r + 1, o = await p.get(i.id).toJSON(e), s = {
3116
- name: i.name,
3117
- sheet: o
3342
+ let t = this._getSheetRef(this.getSelectedSheetIndex()).id, i = t, d = null, f = this._getState(), p = f.sheetRefsAll, m = f.sheetsById, h = p.length;
3343
+ for (let r = 0; r < h; r++) {
3344
+ let a = p[r], o = r + 1, s, l = m.get(a.id);
3345
+ if (Z(a)) s = {
3346
+ name: a.name,
3347
+ sheet: await a.sheet.toJSON(e)
3118
3348
  };
3119
- i.sheetId !== void 0 && (s.sheetId = i.sheetId), i.visibility === w.Visibility.Visible ? u === null && (u = a) : s.visibility = i.visibility, i.id === t && (l = a), n.sheets.push(s);
3349
+ else {
3350
+ let e = l, t = c ? c.toResourceId.bind(c) : () => null, n = { part: k.toJSON(e._getPart(), t) }, r = e.getTabColor();
3351
+ r && (n.tabColor = r.toString()), s = {
3352
+ name: a.name,
3353
+ kind: e.getKind(),
3354
+ sheet: n
3355
+ };
3356
+ }
3357
+ a.sheetId !== void 0 && (s.sheetId = a.sheetId), a.visibility === T.Visibility.Visible ? d === null && (d = o) : s.visibility = a.visibility, a.id === t && (i = o), n.sheets.push(s);
3120
3358
  }
3121
3359
  if (!r) {
3122
- let e = c.toJSON();
3360
+ let e = l.toJSON();
3123
3361
  e && Object.keys(e).length > 0 && (n.styles = e);
3124
3362
  }
3125
- let h = this.getProtection().toJSON();
3126
- h && (n.protection = h);
3127
- let g = this._calculation.toJSON();
3128
- Object.keys(g).length > 0 && (n.calc = g);
3129
- let _ = await o.toJSONAsync();
3130
- _ && _.length > 0 && (n.strings = _);
3131
- let v = this._calculation.getExternalBooks().toJSON();
3132
- v && (n.externalBooks = v);
3133
- let y = this._pivotCaches;
3363
+ let g = this.getProtection().toJSON();
3364
+ g && (n.protection = g);
3365
+ let _ = this._calculation.toJSON();
3366
+ Object.keys(_).length > 0 && (n.calc = _);
3367
+ let v = await s.toJSONAsync();
3368
+ v && v.length > 0 && (n.strings = v);
3369
+ let y = await u.toJSONAsync(c ? c.toResourceId.bind(c) : void 0);
3134
3370
  if (y.length > 0) {
3135
- let e = s ? s.toResourceId.bind(s) : () => null, t = /* @__PURE__ */ new Set();
3371
+ n.richData = y;
3372
+ let e = u.toKindsJSON();
3373
+ e.length > 0 && (n.richTypes = e);
3374
+ }
3375
+ let b = this._calculation.getExternalBooks().toJSON();
3376
+ b && (n.externalBooks = b);
3377
+ let x = this._pivotCaches;
3378
+ if (x.length > 0) {
3379
+ let e = c ? c.toResourceId.bind(c) : () => null, t = /* @__PURE__ */ new Set();
3136
3380
  for (let e of this.getPivotTables()) t.add(e.getCacheId());
3137
3381
  let r = [];
3138
- for (let n = 0; n < y.length; n++) t.has(y[n].cacheId) && r.push(y[n].toJSON(e));
3382
+ for (let n = 0; n < x.length; n++) t.has(x[n].cacheId) && r.push(x[n].toJSON(e));
3139
3383
  r.length > 0 && (n.pivotCaches = r);
3140
3384
  }
3141
- let b = this._people.toJSON();
3142
- if (b && (n.people = b), !a) {
3143
- let e = await s.toJSONAsync(typeof i == "function" ? i : void 0);
3385
+ let S = this._people.toJSON();
3386
+ if (S && (n.people = S), !o) {
3387
+ let e = await c.toJSONAsync(typeof a == "function" ? a : void 0);
3144
3388
  e && e.length > 0 && (n.resources = e);
3145
3389
  }
3146
- let x = this._calculation.getNamedFormulas().toJSON();
3147
- x && x.length > 0 && (n.names = x);
3148
- let S = this._view.toJSON();
3149
- S && (l === u ? delete S.activeSheetId : S.activeSheetId = l, Object.keys(S).length > 0 && (n.view = S));
3390
+ let C = this._calculation.getNamedFormulas().toJSON();
3391
+ C && C.length > 0 && (n.names = C);
3392
+ let w = this._view.toJSON();
3393
+ w && (i === d ? delete w.activeSheetId : w.activeSheetId = i, Object.keys(w).length > 0 && (n.view = w));
3150
3394
  } finally {
3151
- c.endPersist(), a || s.endPersist(), o.endPersist();
3395
+ u.endPersist(), l.endPersist(), o || c.endPersist(), s.endPersist();
3152
3396
  }
3153
3397
  return this._emitter.notify("onSave", { params: n }), n;
3154
3398
  }
@@ -3168,19 +3412,24 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3168
3412
  } catch (e) {
3169
3413
  console.warn("error on close", e);
3170
3414
  }
3171
- 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 pn && this._originProvider.release(), this._closed = !0;
3415
+ 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 zn && this._originProvider.release(), this._closed = !0;
3172
3416
  }
3173
3417
  beginCommit(e) {
3174
- if (this._closed) throw Error(G("error.workbook.modelClosed"));
3418
+ if (this._closed) throw Error(W("error.workbook.modelClosed"));
3175
3419
  return this._beginCommit(typeof e == "string" ? { description: e } : e);
3176
3420
  }
3177
3421
  doBatch(e, t) {
3178
- let n = this;
3179
- return t = typeof t == "string" ? { description: t } : {
3180
- description: W("op.updateWorkbook"),
3422
+ let r = this;
3423
+ t = typeof t == "string" ? { description: t } : {
3424
+ description: U("op.updateWorkbook"),
3181
3425
  ...t
3182
- }, this._transactions.doBatch(e, t, (e, t) => {
3183
- e.getDepth() === 0 && (n._lastTransactionUUID = e.getId());
3426
+ };
3427
+ let i = n.bind(this._transactions, this, e);
3428
+ return this._transactions.doBatch(i.callback, {
3429
+ ...t,
3430
+ onChildCommit: i.onChildCommit
3431
+ }, (e, t) => {
3432
+ i.close(), e.getDepth() === 0 && (r._lastTransactionUUID = e.getId());
3184
3433
  });
3185
3434
  }
3186
3435
  _beginCommit(e) {
@@ -3192,7 +3441,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3192
3441
  _getState() {
3193
3442
  return this._transactions.getState(this._id);
3194
3443
  }
3195
- _updateState(e, t = W("op.updateWorkbook"), n) {
3444
+ _updateState(e, t = U("op.updateWorkbook"), n) {
3196
3445
  if (!e) return;
3197
3446
  let r = this._beginCommit(t);
3198
3447
  try {
@@ -3213,7 +3462,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3213
3462
  get isIWorkbook() {
3214
3463
  return !0;
3215
3464
  }
3216
- }, Lr = { address: null }, Rr = class {
3465
+ }, ei = { address: null }, Z = (e) => e.sheet.getKind() === T.Kind.Worksheet, ti = class {
3217
3466
  constructor() {
3218
3467
  this._readFormats = [], this._writeFormats = [], this._encryptions = [];
3219
3468
  }
@@ -3287,9 +3536,9 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3287
3536
  return !0;
3288
3537
  });
3289
3538
  }
3290
- }, zr = /* @__PURE__ */ new WeakMap(), Br = (e) => !!e && typeof e == "object" && typeof e.getPath == "function" && typeof e.canWrite == "function", Vr = class {
3539
+ }, ni = /* @__PURE__ */ new WeakMap(), ri = (e) => !!e && typeof e == "object" && typeof e.getPath == "function" && typeof e.canWrite == "function", ii = class {
3291
3540
  constructor() {
3292
- this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new t(this), this._registry = new Rr(), this._defaultStore = new hn(() => this.getWriteFormats(), () => this.getReadFormats());
3541
+ this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new e(this), this._registry = new ti(), this._defaultStore = new Vn(() => this.getWriteFormats(), () => this.getReadFormats());
3293
3542
  }
3294
3543
  getBackingStore() {
3295
3544
  return this._backingStore ?? this._defaultStore;
@@ -3324,15 +3573,15 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3324
3573
  return this._registry.getWriteFormats(e);
3325
3574
  }
3326
3575
  getOrigin(e) {
3327
- return new K(e);
3576
+ return new G(e);
3328
3577
  }
3329
3578
  async read(e) {
3330
3579
  let t = null;
3331
3580
  if (typeof e == "string") e = { source: e };
3332
- else if (Br(e)) {
3581
+ else if (ri(e)) {
3333
3582
  let n = e.getPath();
3334
3583
  if (!n) throw Error("Cannot read from an unbound origin (no path).");
3335
- dn(e) ? e = {
3584
+ Ln(e) ? e = {
3336
3585
  source: n,
3337
3586
  asCopy: !0
3338
3587
  } : (t = e, e = { source: n });
@@ -3351,20 +3600,20 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3351
3600
  search: i,
3352
3601
  ext: a
3353
3602
  }))[0];
3354
- if (!o) throw new B(G("error.io.readFormatUnavailable", { format: i ?? a }));
3603
+ if (!o) throw new B(W("error.io.readFormatUnavailable", { format: i ?? a }));
3355
3604
  let s = n?.typedCreateWorkbookOptions, c = s ? Object.keys(s).find((e) => e.toLowerCase() === o.key.toLowerCase()) : void 0, l = {
3356
3605
  ...n,
3357
3606
  ...c === void 0 ? void 0 : s[c]
3358
3607
  };
3359
3608
  delete l.typedCreateWorkbookOptions, delete l.source, delete l.asCopy;
3360
- let u = r ?? new K(t.absolutePath ?? null, {
3609
+ let u = r ?? new G(t.absolutePath ?? null, {
3361
3610
  name: t.name ?? null,
3362
3611
  format: o.key,
3363
3612
  size: t.size ?? null,
3364
3613
  lastModified: t.lastModified ?? null,
3365
3614
  canWrite: t.canWrite ?? !1
3366
3615
  });
3367
- r instanceof K && r.update({
3616
+ r instanceof G && r.update({
3368
3617
  format: o.key,
3369
3618
  size: t.size ?? null,
3370
3619
  lastModified: t.lastModified ?? null
@@ -3398,7 +3647,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3398
3647
  }
3399
3648
  async _decrypt(e, t, n) {
3400
3649
  let r = await this._registry.detectEncryption(e);
3401
- if (t instanceof K && t.update({ encryption: r ? r.key : null }), !r) return {
3650
+ if (t instanceof G && t.update({ encryption: r ? r.key : null }), !r) return {
3402
3651
  bytes: e,
3403
3652
  password: null
3404
3653
  };
@@ -3406,7 +3655,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3406
3655
  try {
3407
3656
  return i = await r.decode(e, t), !0;
3408
3657
  } catch (e) {
3409
- if (!(e instanceof Qt)) throw e;
3658
+ if (!(e instanceof wn)) throw e;
3410
3659
  return !1;
3411
3660
  }
3412
3661
  };
@@ -3416,7 +3665,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3416
3665
  };
3417
3666
  if (!n?.onPassword) {
3418
3667
  let e = t.getName();
3419
- throw new tn(e ? G("error.io.passwordRequired", { name: e }) : G("error.io.passwordRequiredUnnamed"));
3668
+ throw new On(e ? W("error.io.passwordRequired", { name: e }) : W("error.io.passwordRequiredUnnamed"));
3420
3669
  }
3421
3670
  let o = await Promise.resolve(n.onPassword({
3422
3671
  origin: t,
@@ -3428,16 +3677,16 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3428
3677
  bytes: i,
3429
3678
  password: o
3430
3679
  };
3431
- throw new Qt(G("error.io.passwordIncorrect"));
3680
+ throw new wn(W("error.io.passwordIncorrect"));
3432
3681
  }
3433
3682
  async writeArrayBuffer(e, t) {
3434
3683
  if (!t?.format) throw Error("A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).");
3435
3684
  let n = (await this._registry.getWriteFormats({ search: t.format }))[0];
3436
- if (!n) throw new B(G("error.io.writeFormatUnavailable", { format: t.format }));
3685
+ if (!n) throw new B(W("error.io.writeFormatUnavailable", { format: t.format }));
3437
3686
  return this._writeArrayBuffer(e, n, t);
3438
3687
  }
3439
3688
  async write(e, t, n) {
3440
- return typeof t == "string" || Br(t) ? this._write(e, t, !1, n) : this._write(e, e?.getOrigin?.(), !0, t ?? n);
3689
+ return typeof t == "string" || ri(t) ? this._write(e, t, !1, n) : this._write(e, e?.getOrigin?.(), !0, t ?? n);
3441
3690
  }
3442
3691
  async writeAs(e, t, n) {
3443
3692
  if (!t) throw Error("A target must be provided for writeAs (use write(workbook) for a plain save).");
@@ -3447,13 +3696,13 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3447
3696
  if (!e) throw Error("Workbook must be provided.");
3448
3697
  if (!e.isIWorkbook) throw Error("Invalid workbook model provided. Must be an instance of IWorkbook.");
3449
3698
  let i = typeof t == "string" ? this.getOrigin(t) : t, a = i.getFormat(), o;
3450
- if ((r?.format || a) && (o = (await this._registry.getWriteFormats({ search: r?.format ?? a ?? void 0 }))[0]), o || i.getPath() && i.canWrite() && i.getExtension() || (o = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !o) throw new B(G("error.io.writeFormatUnresolved"));
3699
+ if ((r?.format || a) && (o = (await this._registry.getWriteFormats({ search: r?.format ?? a ?? void 0 }))[0]), o || i.getPath() && i.canWrite() && i.getExtension() || (o = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !o) throw new B(W("error.io.writeFormatUnresolved"));
3451
3700
  let s = i.getExtension();
3452
3701
  if (r?.format && s && i.getPath() && i.canWrite() && !o.exts.includes(s)) {
3453
3702
  let e = (await this._registry.getWriteFormats({ ext: s }))[0];
3454
3703
  if (e && e.key !== o.key) {
3455
3704
  let e = i.getPath().split(/[/\\]/).pop();
3456
- throw new B(G("error.io.writeFormatMismatch", {
3705
+ throw new B(W("error.io.writeFormatMismatch", {
3457
3706
  format: r.format,
3458
3707
  file: e
3459
3708
  }));
@@ -3461,16 +3710,16 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3461
3710
  }
3462
3711
  if (typeof t == "string") {
3463
3712
  let e = i.getPath();
3464
- i = new K(T(e) ? e : `${e}.${o.exts[0]}`, { format: o.key });
3713
+ i = new G(O(e) ? e : `${e}.${o.exts[0]}`, { format: o.key });
3465
3714
  }
3466
- let c = i.getEncryption(), l = e.getOrigin?.(), u = (i instanceof K ? i.getPassword() : null) ?? (l instanceof K ? l.getPassword() : null), d = i.isEncrypted() || (l?.isEncrypted() ?? !1), f = r?.password === void 0 ? u ?? (d ? void 0 : null) : r.password, p = null;
3715
+ let c = i.getEncryption(), l = e.getOrigin?.(), u = (i instanceof G ? i.getPassword() : null) ?? (l instanceof G ? l.getPassword() : null), d = i.isEncrypted() || (l?.isEncrypted() ?? !1), f = r?.password === void 0 ? u ?? (d ? void 0 : null) : r.password, p = null;
3467
3716
  if (f === void 0) {
3468
3717
  if (d) {
3469
3718
  let e = i.getName();
3470
- throw new tn(e ? G("error.io.passwordRequiredSave", { name: e }) : G("error.io.passwordRequiredSaveUnnamed"));
3719
+ throw new On(e ? W("error.io.passwordRequiredSave", { name: e }) : W("error.io.passwordRequiredSaveUnnamed"));
3471
3720
  }
3472
- } else if (f !== null && (p = await this._registry.getEncryption(c), !p)) throw new B(G("error.io.encryptionUnavailable"));
3473
- let m = `${i.getName() ?? G("workbook.defaultName")}.${o.exts[0]}`, h = r?.progress, g = !i.getPath() || !i.canWrite() || !!r?.prompt, _ = !1, v = this, y = null, b = [], x = {
3721
+ } else if (f !== null && (p = await this._registry.getEncryption(c), !p)) throw new B(W("error.io.encryptionUnavailable"));
3722
+ let m = `${i.getName() ?? W("workbook.defaultName")}.${o.exts[0]}`, h = r?.progress, g = !i.getPath() || !i.canWrite() || !!r?.prompt, _ = !1, v = this, y = null, b = [], x = {
3474
3723
  workbook: e,
3475
3724
  format: o,
3476
3725
  origin: i,
@@ -3495,7 +3744,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3495
3744
  }))(h, l), d = await v._writeArrayBuffer(e, c, {
3496
3745
  ...r,
3497
3746
  progress: u
3498
- }), m = zr.get(s);
3747
+ }), m = ni.get(s);
3499
3748
  if (l.some((e) => !m?.has(e.message)) && r?.onWarnings) {
3500
3749
  let t = await Promise.resolve(r.onWarnings({
3501
3750
  workbook: e,
@@ -3513,12 +3762,12 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3513
3762
  let t = this.getBackingStore();
3514
3763
  if (!t.write) throw Error("The active backing store is read-only (no write implementation).");
3515
3764
  if (S = await t.write(x), S) {
3516
- if (f !== void 0 && S instanceof K && (S.setPassword(f), S.update({ encryption: p ? p.key : null })), b.length) {
3517
- let e = zr.get(S) ?? /* @__PURE__ */ new Set();
3765
+ if (f !== void 0 && S instanceof G && (S.setPassword(f), S.update({ encryption: p ? p.key : null })), b.length) {
3766
+ let e = ni.get(S) ?? /* @__PURE__ */ new Set();
3518
3767
  for (let t of b) e.add(t.message);
3519
- zr.set(S, e);
3768
+ ni.set(S, e);
3520
3769
  }
3521
- n && S !== e.getOrigin() && dn(e.getOrigin())?.setOrigin(S);
3770
+ n && S !== e.getOrigin() && Ln(e.getOrigin())?.setOrigin(S);
3522
3771
  let t = y ?? e.getTransactions?.()?.getCurrentCommit() ?? null;
3523
3772
  this._emitter.notify("onWrite", {
3524
3773
  params: {
@@ -3533,12 +3782,12 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3533
3782
  h?.onComplete && await Promise.resolve(h.onComplete(S));
3534
3783
  } catch (e) {
3535
3784
  let t = e instanceof Error ? e : Error(String(e));
3536
- throw h?.onError && await Promise.resolve(h.onError(t)), h?.onComplete && await Promise.resolve(h.onComplete(null)), t instanceof B ? t : Error(G("error.io.writeFailed", { reason: t.message }), { cause: e });
3785
+ throw h?.onError && await Promise.resolve(h.onError(t)), h?.onComplete && await Promise.resolve(h.onComplete(null)), t instanceof B ? t : Error(W("error.io.writeFailed", { reason: t.message }), { cause: e });
3537
3786
  }
3538
3787
  return S;
3539
3788
  }
3540
3789
  _stripExtension(e) {
3541
- let t = T(e);
3790
+ let t = O(e);
3542
3791
  return t ? e.slice(0, e.length - t.length - 1) : e;
3543
3792
  }
3544
3793
  _baseName(e) {
@@ -3558,24 +3807,24 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3558
3807
  async _readArrayBuffer(e, t, n) {
3559
3808
  if (!e) throw Error("ArrayBuffer must be specified.");
3560
3809
  if (!t) throw Error("format must be specified.");
3561
- if (e.byteLength === 0) return new Ir(n?.createWorkbookOptions);
3810
+ if (e.byteLength === 0) return new $r(n?.createWorkbookOptions);
3562
3811
  let r = t.handler;
3563
3812
  if (!r) throw Error(`Unable to resolve a read handler for '${t.key}'.`);
3564
3813
  let i;
3565
3814
  try {
3566
3815
  i = await r(e, n);
3567
3816
  } catch (e) {
3568
- throw e instanceof B ? e : new B(G("error.io.readFailed", {
3817
+ throw e instanceof B ? e : new B(W("error.io.readFailed", {
3569
3818
  format: t.description ?? t.key,
3570
3819
  reason: e?.message ?? String(e)
3571
3820
  }), { cause: e });
3572
3821
  }
3573
- return await kt(), i;
3822
+ return await yt(), i;
3574
3823
  }
3575
3824
  get isIWorkbookIO() {
3576
3825
  return !0;
3577
3826
  }
3578
- }, Hr = new Vr(), Ur = class {
3827
+ }, ai = new ii(), oi = class {
3579
3828
  constructor() {
3580
3829
  this._buffer = null, this._formatKey = null;
3581
3830
  }
@@ -3589,7 +3838,7 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3589
3838
  async read(e) {
3590
3839
  return this._buffer ? e.decode(this._buffer, { format: this._formatKey ?? void 0 }) : null;
3591
3840
  }
3592
- }, Wr = "locales", Gr = "fonts", Kr = {
3841
+ }, si = "locales", ci = "fonts", li = {
3593
3842
  suffix: ".msg.json",
3594
3843
  async extract(e) {
3595
3844
  let t = e.relPath.split("/");
@@ -3599,55 +3848,92 @@ var Ar, jr, Mr = "workbook.activeSheet", Nr = class e extends it {
3599
3848
  } : null;
3600
3849
  },
3601
3850
  place: (e, t) => t ? `${t}/${e}` : null
3602
- }, qr = [
3851
+ }, ui = [
3603
3852
  ".woff2",
3604
3853
  ".woff",
3605
3854
  ".ttf",
3606
3855
  ".otf",
3607
- ".ttc"
3856
+ ".ttc",
3857
+ ".otc"
3608
3858
  ].map((e) => ({
3609
3859
  suffix: e,
3610
3860
  place: (e, t) => t ? `${t}/${e}` : e
3611
- })), Jr = [{
3612
- kind: Wr,
3613
- files: [Kr]
3861
+ })), di = {
3862
+ suffix: ".metrics.json",
3863
+ async extract(e) {
3864
+ let t = await e.readJson();
3865
+ return t?.format === "sheetxl-font-metrics/1" ? {
3866
+ family: t.family,
3867
+ weight: t.weight,
3868
+ italic: t.italic
3869
+ } : null;
3870
+ },
3871
+ place: (e, t) => t ? `${t}/${e}` : e
3872
+ }, fi = [{
3873
+ kind: si,
3874
+ files: [li]
3614
3875
  }, {
3615
- kind: Gr,
3616
- files: [{
3617
- suffix: ".metrics.json",
3618
- async extract(e) {
3619
- let t = await e.readJson();
3620
- return t?.format === "sheetxl-font-metrics/1" ? {
3621
- family: t.family,
3622
- weight: t.weight,
3623
- italic: t.italic
3624
- } : null;
3876
+ kind: ci,
3877
+ files: [
3878
+ di,
3879
+ {
3880
+ suffix: ".hinted.json",
3881
+ async extract(e) {
3882
+ let t = await e.readJson();
3883
+ return t?.format === "sheetxl-font-hinting/1" ? {
3884
+ family: t.family,
3885
+ weight: t.weight,
3886
+ italic: t.italic,
3887
+ hinted: !0
3888
+ } : null;
3889
+ },
3890
+ place: di.place
3891
+ },
3892
+ {
3893
+ suffix: ".rows.json",
3894
+ async extract(e) {
3895
+ let t = await e.readJson();
3896
+ return t?.format === "sheetxl-font-rows/1" ? {
3897
+ family: t.family,
3898
+ weight: t.weight,
3899
+ italic: t.italic,
3900
+ rows: !0
3901
+ } : null;
3902
+ },
3903
+ place: di.place
3625
3904
  },
3626
- place: (e, t) => t ? `${t}/${e}` : e
3627
- }, ...qr]
3905
+ ...ui
3906
+ ]
3628
3907
  }];
3629
- Ar ||= {}, jr ||= {};
3908
+ async function pi(e, t) {
3909
+ let { Chart: n } = await import("./CNdjyofiRu6CYOrr.mjs");
3910
+ return new n({
3911
+ json: e,
3912
+ getStyles: t?.getStyles
3913
+ });
3914
+ }
3915
+ Jr ||= {};
3630
3916
  var Q = null;
3631
- function Yr() {
3917
+ function mi() {
3632
3918
  if (!Q) {
3633
- let e = import("./BqskM7wA8oPfFQue.mjs").then((e) => e.loadScriptingDeclarations());
3919
+ let e = import("./hCQJcmIzPDxDEv2q.mjs").then((e) => e.loadScriptingDeclarations());
3634
3920
  e.catch(() => {
3635
3921
  Q = null;
3636
3922
  }), Q = e;
3637
3923
  }
3638
3924
  return Q;
3639
3925
  }
3640
- var Xr, Zr, Qr, $ = null;
3641
- function $r() {
3926
+ var hi, gi, _i, $ = null;
3927
+ function vi() {
3642
3928
  if (!$) {
3643
- let e = import("./BqskM7wA8oPfFQue.mjs").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
3929
+ let e = import("./hCQJcmIzPDxDEv2q.mjs").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
3644
3930
  e.catch(() => {
3645
3931
  $ = null;
3646
3932
  }), $ = e;
3647
3933
  }
3648
3934
  return $;
3649
3935
  }
3650
- Xr ||= {}, (Zr ||= {}).Type = {
3936
+ hi ||= {}, (gi ||= {}).Type = {
3651
3937
  Button: "button",
3652
3938
  CheckBox: "checkBox",
3653
3939
  OptionButton: "optionButton",
@@ -3660,12 +3946,12 @@ Xr ||= {}, (Zr ||= {}).Type = {
3660
3946
  EditBox: "editBox",
3661
3947
  Dialog: "dialog",
3662
3948
  Unknown: "formControl"
3663
- }, (Qr ||= {}).DropStyle = {
3949
+ }, (_i ||= {}).DropStyle = {
3664
3950
  Combo: "combo",
3665
3951
  ComboEdit: "comboEdit",
3666
3952
  Simple: "simple"
3667
3953
  };
3668
- var ei = class extends ie {
3954
+ var yi = class extends Le {
3669
3955
  constructor(e) {
3670
3956
  super(e);
3671
3957
  }
@@ -3678,8 +3964,8 @@ var ei = class extends ie {
3678
3964
  colEnd: (e?.size?.width ?? 5) - 1,
3679
3965
  rowEnd: (e?.size?.height ?? 5) - 1
3680
3966
  },
3681
- getRanges: (e) => new Be(null)
3967
+ getRanges: (e) => new Me(null)
3682
3968
  }, super._initializeOptions(e);
3683
3969
  }
3684
- }, ti = "0.8.0-beta.10", ni = "2026-10-16T12:44:53.600Z";
3685
- export { ge as AbstractCollection, i as AbstractMovableContent, _ as AddressUtils, J as AdvanceTable, Ur as ArrayBackingStore, ot as AutoFill, ni as BUILD_DATE, P as Color, _e as Condition, Ke as DateUtils, Vr as DefaultWorkbookIO, bt as EXTERNAL_LINK_PATH_REL_TYPE, vr as ExternalRangeClipboardItem, Gr as FONTS_KIND, Bn as FontUtils, a as FormulaText, We as FunctionDeclarations, Pe as GeomUtils, Oe as IAnchored, Pt as IBorders, y as ICalculation, h as ICell, tr as ICellHeaderRange, At as ICellRange, er as ICellRanges, Ut as ICellStyle, M as IColor, ye as ICondition, Ce as IConditionalFormat, xt as IDataValidation, Qr as IDropDown, Ht as IEffect, N as IFill, j as IFont, kn as IFontCollection, Zr as IFormControl, Jt as IGeometry, Xr as IMovable, jr as IPicture, Ar as IPrint, $n as IResource, S as IScript, qt as IShape, w as ISheet, be as ISheetView, Me as ISlicerStyle, zn as ISort, Bt as IStroke, Ue as ITable, o as ITableStyle, le as IText, A as ITextFrame, Qn as ITheme, pt as IThemeCollection, an as IWorkbookIO, Wr as LOCALES_KIND, x as LicenseManager, te as MovableContentRegistry, ve as NamedStyleCollection, F as NumberFormat, pr as PersonCollection, _r as RangeClipboardItem, Un as RectAlignment, fe as Registry, Ae as Resource, Ee as ResourceCollection, Jr as SHEETXL_RESOURCE_KINDS, Vt as SYSTEM_COLOR_CSS_PREFIX, Kt as ShapeStyleUtils, O as Sheet, bn as SimpleFontFace, je as SlicerStyleCollection, ut as Sort, ee as StringCollection, re as StyleCollection, ei as Table, wn as TableFileAdvanceBuilder, Ne as TableStyleCollection, g as TextRotation, v as TextStacked, he as TextUtils, _t as Theme, ct as ThemeCollection, n as TransactionConflictError, ln as TransactionSaveStateManager, r as TransactionStore, on as TransactionUndoManager, Tt as Tuple, ti as VERSION, Ir as Workbook, Hr as WorkbookIO, K as WorkbookOrigin, br as WorkbookView, Zn as builtInStyleNameDisplay, He as createCellRangeCounts, Ot as externalBookClosedName, ze as externalBookFileName, Et as externalBookLocation, Se as externalBookOpenName, ir as getBuiltInFunctionNames, Je as getLanguagePack, zt as getLocaleProfile, Te as getScriptRuntime, $r as getScriptingApi, Yr as getScriptingDeclarations, Fe as localizeBoolean, yt as localizeErrorLabel, Mt as makeLocaleProfile, Dt as parseBooleanLocal, Re as parseErrorLocal, m as parseExternalScope, ar as parseFormulaLiteral, Xe as registerSdkLocales, Ct as sourceEntryFromPath, ke as withScriptRuntime };
3970
+ }, bi = "0.8.0-beta.12", xi = "2026-10-29T20:28:05.246Z";
3971
+ export { Ht as AbstractCollection, r as AbstractMovableContent, We as AddressUtils, oi as ArrayBackingStore, we as AutoFill, xi as BUILD_DATE, u as CellControlRegistry, It as CellImage, Ie as CellImageKind, dt as ChartElementSelection, yn as ChartKinds, He as CheckboxKind, fn as Color, lt as Condition, Ft as DateUtils, ii as DefaultWorkbookIO, m as EXTERNAL_LINK_PATH_REL_TYPE, kr as ExternalRangeClipboardItem, ci as FONTS_KIND, wr as Fetcher, en as FontUtils, he as FormulaText, sr as FunctionDeclarations, de as GeomUtils, y as Hyperlink, g as HyperlinkKind, ge as IAnchored, Zt as IBorders, Vt as ICalculation, qe as ICell, ir as ICellHeaderRange, c as ICellRange, rr as ICellRanges, ln as ICellStyle, dn as IColor, pt as ICondition, Be as IConditionalFormat, X as ICustomProperty, ne as IDataValidation, _i as IDropDown, pn as IEffect, un as IFill, M as IFont, me as IFontCollection, F as IFontStyle, gi as IFormControl, bn as IGeometry, hi as IMovable, xe as IPageLayout, Jr as IPicture, nr as IResource, s as IRichDataKind, tt as IScript, nn as IShape, T as ISheet, l as ISlicerStyle, Fn as ISort, hn as IStroke, ee as ITable, Ue as ITableStyle, Ye as IText, N as ITextFrame, tr as ITheme, se as IThemeCollection, An as IWorkbookIO, hr as IWorkbookView, je as IWorksheetView, si as LOCALES_KIND, ae as LicenseManager, Dt as MovableContentRegistry, ze as NamedStyleCollection, P as NumberFormat, vn as PaintUtils, vr as PersonCollection, Or as RangeClipboardItem, Kn as RectAlignment, Pt as Registry, C as Resource, Ee as ResourceCollection, Ne as RichArray, f as RichArrayKind, ue as RichDataCollection, Ze as RichDataRegistry, Bt as RichRecord, Se as RichText, ft as RichTextKind, fi as SHEETXL_RESOURCE_KINDS, gn as SYSTEM_COLOR_CSS_PREFIX, Xt as ShapeStyleUtils, _e as SimpleFontFace, Ve as SlicerStyleCollection, Ut as Sort, ye as StringCollection, Gt as StyleCollection, yi as Table, te as TableStyleCollection, rt as TextRotation, $e as TextStacked, bt as TextUtils, le as Theme, St as ThemeCollection, t as TransactionConflictError, Pn as TransactionSaveStateManager, i as TransactionStore, jn as TransactionUndoManager, Ot as Tuple, bi as VERSION, $r as Workbook, ai as WorkbookIO, G as WorkbookOrigin, Mr as WorkbookView, A as Worksheet, er as builtInStyleNameDisplay, Fe as createCellRangeCounts, pi as createChart, Rt as externalBookClosedName, Re as externalBookFileName, b as externalBookLocation, _ as externalBookOpenName, Ct as findLabel, cr as getBuiltInFunctionNames, S as getLanguagePack, rn as getLocaleProfile, at as getScriptRuntime, vi as getScriptingApi, mi as getScriptingDeclarations, ie as localizeBoolean, fe as localizeErrorLabel, qt as makeLocaleProfile, ce as normalizeLabel, ke as parseBooleanLocal, Wt as parseErrorLocal, Ce as parseExternalScope, lr as parseFormulaLiteral, Te as registerSdkLocales, mt as sourceEntryFromPath, xt as withScriptRuntime };