@sheetxl/sdk 0.7.27 → 0.7.28-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (601) hide show
  1. package/README.md +3 -0
  2. package/THIRD-PARTY-NOTICES.md +34 -0
  3. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +1 -0
  4. package/browser/cjs/BG7YDVxiC4ErxvF1.cjs +1 -0
  5. package/browser/cjs/BREMLtxkQhtNSVra.cjs +1 -0
  6. package/browser/cjs/CQf4zxkBmheTVbjX.cjs +57 -0
  7. package/browser/cjs/DoemwsUQoGCk0vBK.cjs +33 -0
  8. package/browser/cjs/Dv3x6zut1ZRUt3IF.cjs +10 -0
  9. package/browser/cjs/_c2uwwpr03Y7lzIj.cjs +1 -0
  10. package/browser/cjs/index.cjs +3 -6
  11. package/browser/esm/BxIOX1TojvA-1ZZP.mjs +14 -0
  12. package/browser/esm/CB_4gdPPPruwremH.mjs +49989 -0
  13. package/browser/esm/CZO1RubmqnJV96rq.mjs +503 -0
  14. package/browser/esm/DN4d5bDBkti28wuc.mjs +818 -0
  15. package/browser/esm/DPOelA1J3WHbMXyh.mjs +109 -0
  16. package/browser/esm/DRWu3TmcE9JFf78V.mjs +4436 -0
  17. package/browser/esm/index.mjs +3225 -62
  18. package/browser/esm/vHWuKF-ftK7LM1uw.mjs +24 -0
  19. package/licenses/dependencies.txt +74 -193
  20. package/node/esm/B-tgcZihStNV9CbZ.mjs +22 -0
  21. package/node/esm/C8tfYGL3wHy9IDDc.mjs +114 -0
  22. package/node/esm/XQhP3dYwF_tEuswB.mjs +837 -0
  23. package/node/esm/index.mjs +53604 -23262
  24. package/package.json +19 -14
  25. package/resources/contents.json +21 -0
  26. package/resources/locales/contents.json +19 -0
  27. package/resources/locales/de/grammar.json +16 -0
  28. package/resources/locales/de/model.msg.json +510 -0
  29. package/resources/locales/en/model.msg.json +525 -0
  30. package/types/index.d.ts +2 -21294
  31. package/types/scripting-enums.json +1009 -0
  32. package/types/scripting.d.ts +26540 -31455
  33. package/types/src/address/AddressUtils.d.ts +252 -0
  34. package/types/src/address/_AddressMessages.d.ts +7 -0
  35. package/types/src/address/index.d.ts +35 -0
  36. package/types/src/anchored/AbstractAnchored.d.ts +200 -0
  37. package/types/src/anchored/Anchored.d.ts +154 -0
  38. package/types/src/anchored/AnchoredMap.d.ts +178 -0
  39. package/types/src/anchored/IAnchored.d.ts +118 -0
  40. package/types/src/anchored/IAnchoredMap.d.ts +207 -0
  41. package/types/src/anchored/_AnchorMessages.d.ts +3 -0
  42. package/types/src/anchored/index.d.ts +2 -0
  43. package/types/src/autoFill/AutoFill.d.ts +161 -0
  44. package/types/src/autoFill/IAutoFill.d.ts +117 -0
  45. package/types/src/autoFill/index.d.ts +3 -0
  46. package/types/src/border/IBorder.d.ts +284 -0
  47. package/types/src/border/index.d.ts +2 -0
  48. package/types/src/calculation/Calculation.d.ts +440 -0
  49. package/types/src/calculation/FormulaLiterals.d.ts +18 -0
  50. package/types/src/calculation/ICalculation.d.ts +1016 -0
  51. package/types/src/calculation/INamedFormulasCollection.d.ts +141 -0
  52. package/types/src/calculation/NamedFormulaCollection.d.ts +671 -0
  53. package/types/src/calculation/TokenType.d.ts +117 -0
  54. package/types/src/calculation/Types.d.ts +110 -0
  55. package/types/src/calculation/_CalculationMessages.d.ts +3 -0
  56. package/types/src/calculation/builtInNames.d.ts +2 -0
  57. package/types/src/calculation/compiler/ASTTypes.d.ts +180 -0
  58. package/types/src/calculation/compiler/CompilerLocale.d.ts +69 -0
  59. package/types/src/calculation/compiler/CompilerUtils.d.ts +331 -0
  60. package/types/src/calculation/compiler/FormulaCompiler.d.ts +69 -0
  61. package/types/src/calculation/compiler/FormulaLexer.d.ts +85 -0
  62. package/types/src/calculation/compiler/FormulaParser.d.ts +270 -0
  63. package/types/src/calculation/compiler/FormulaSeparators.d.ts +35 -0
  64. package/types/src/calculation/compiler/LiteTransform.d.ts +15 -0
  65. package/types/src/calculation/compiler/ParserUtils.d.ts +167 -0
  66. package/types/src/calculation/compiler/SRLexer.d.ts +19 -0
  67. package/types/src/calculation/compiler/SRParser.d.ts +38 -0
  68. package/types/src/calculation/compiler/Types.d.ts +274 -0
  69. package/types/src/calculation/compiler/index.d.ts +3 -0
  70. package/types/src/calculation/executor/CalcExecutor.d.ts +115 -0
  71. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +11 -0
  72. package/types/src/calculation/executor/index.d.ts +3 -0
  73. package/types/src/calculation/formula/Formula.d.ts +168 -0
  74. package/types/src/calculation/formula/FormulaBlock.d.ts +207 -0
  75. package/types/src/calculation/formula/IFormulaBlock.d.ts +181 -0
  76. package/types/src/calculation/formula/LambdaValue.d.ts +166 -0
  77. package/types/src/calculation/formula/TokenUtils.d.ts +26 -0
  78. package/types/src/calculation/formula/index.d.ts +4 -0
  79. package/types/src/calculation/functions/Operators.d.ts +30 -0
  80. package/types/src/calculation/functions/index.d.ts +2 -0
  81. package/types/src/calculation/functions/initializeFunctions.d.ts +22 -0
  82. package/types/src/calculation/grid/CalcGrid.d.ts +205 -0
  83. package/types/src/calculation/grid/CalcGridUtils.d.ts +172 -0
  84. package/types/src/calculation/grid/ICalcGrid.d.ts +500 -0
  85. package/types/src/calculation/grid/index.d.ts +3 -0
  86. package/types/src/calculation/index.d.ts +5 -0
  87. package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +25 -0
  88. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +120 -0
  89. package/types/src/calculation/spatial/PrecedentSpatialValue.d.ts +115 -0
  90. package/types/src/calculation/spatial/SpillEntry.d.ts +40 -0
  91. package/types/src/calculation/spatial/index.d.ts +5 -0
  92. package/types/src/calculation/state/CalcNode.d.ts +71 -0
  93. package/types/src/calculation/state/CalcScope.d.ts +35 -0
  94. package/types/src/calculation/state/CalcState.d.ts +28 -0
  95. package/types/src/calculation/state/CalculationContext.d.ts +125 -0
  96. package/types/src/calculation/state/IContextContainer.d.ts +320 -0
  97. package/types/src/calculation/state/index.d.ts +6 -0
  98. package/types/src/calculation/symbol/FunctionSymbolProvider.d.ts +44 -0
  99. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +93 -0
  100. package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +144 -0
  101. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +18 -0
  102. package/types/src/calculation/symbol/SymbolRegistry.d.ts +19 -0
  103. package/types/src/calculation/symbol/TableColumnSymbolProvider.d.ts +21 -0
  104. package/types/src/calculation/symbol/TableSymbolProvider.d.ts +19 -0
  105. package/types/src/calculation/symbol/index.d.ts +9 -0
  106. package/types/src/cell/ICell.d.ts +672 -0
  107. package/types/src/cell/ICellHeader.d.ts +142 -0
  108. package/types/src/cell/ICellProtection.d.ts +41 -0
  109. package/types/src/cell/index.d.ts +4 -0
  110. package/types/src/cellRange/ICellHeaderRange.d.ts +306 -0
  111. package/types/src/cellRange/ICellHeaderRanges.d.ts +107 -0
  112. package/types/src/cellRange/ICellRange.d.ts +2509 -0
  113. package/types/src/cellRange/ICellRanges.d.ts +407 -0
  114. package/types/src/cellRange/ICellRegion.d.ts +133 -0
  115. package/types/src/cellRange/_GraphNode.d.ts +38 -0
  116. package/types/src/cellRange/index.d.ts +6 -0
  117. package/types/src/chart/Chart.d.ts +53 -0
  118. package/types/src/chart/IChart.d.ts +42 -0
  119. package/types/src/chart/index.d.ts +5 -0
  120. package/types/src/collections/ArraysGrid.d.ts +72 -0
  121. package/types/src/collections/BooleanList.d.ts +67 -0
  122. package/types/src/collections/GridMap.d.ts +47 -0
  123. package/types/src/collections/HashMap.d.ts +15 -0
  124. package/types/src/collections/IGrid.d.ts +278 -0
  125. package/types/src/collections/IList.d.ts +89 -0
  126. package/types/src/collections/IMap.d.ts +45 -0
  127. package/types/src/collections/IReadableList.d.ts +120 -0
  128. package/types/src/collections/ISortedMap.d.ts +171 -0
  129. package/types/src/collections/ISparseGrid.d.ts +61 -0
  130. package/types/src/collections/ISparseList.d.ts +103 -0
  131. package/types/src/collections/ISpatialMap.d.ts +515 -0
  132. package/types/src/collections/ISpatialMap3D.d.ts +116 -0
  133. package/types/src/collections/IWritableList.d.ts +41 -0
  134. package/types/src/collections/ImmutableList.d.ts +52 -0
  135. package/types/src/collections/IteratorUtils.d.ts +91 -0
  136. package/types/src/collections/MixedTypedArrayList.d.ts +140 -0
  137. package/types/src/collections/OverlappingRangeIterator.d.ts +91 -0
  138. package/types/src/collections/RTree.d.ts +111 -0
  139. package/types/src/collections/RepeatingList.d.ts +20 -0
  140. package/types/src/collections/SortedMap.d.ts +396 -0
  141. package/types/src/collections/SparseGrid.d.ts +99 -0
  142. package/types/src/collections/SparseList.d.ts +90 -0
  143. package/types/src/collections/SpatialMap.d.ts +102 -0
  144. package/types/src/collections/SpatialMap3D.d.ts +64 -0
  145. package/types/src/collections/Tuple.d.ts +160 -0
  146. package/types/src/collections/_CollectionUtils.d.ts +25 -0
  147. package/types/src/collections/_GridUtils.d.ts +268 -0
  148. package/types/src/collections/_RunUtils.d.ts +170 -0
  149. package/types/src/collections/_SpatialUtils.d.ts +115 -0
  150. package/types/src/collections/index.d.ts +21 -0
  151. package/types/src/color/Color.d.ts +120 -0
  152. package/types/src/color/ColorSpace.d.ts +45 -0
  153. package/types/src/color/IColor.d.ts +1110 -0
  154. package/types/src/color/_BuiltInIndexDefs.d.ts +4 -0
  155. package/types/src/color/_BuiltInNamedDefs.d.ts +29 -0
  156. package/types/src/color/_BuiltInSchemeDefs.d.ts +7 -0
  157. package/types/src/color/_ColorUtils.d.ts +93 -0
  158. package/types/src/color/index.d.ts +3 -0
  159. package/types/src/comment/IComment.d.ts +108 -0
  160. package/types/src/comment/index.d.ts +2 -0
  161. package/types/src/condition/AnchoredConditional.d.ts +263 -0
  162. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +83 -0
  163. package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +8 -0
  164. package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +8 -0
  165. package/types/src/condition/BuiltInOperators/AndOperator.d.ts +12 -0
  166. package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +12 -0
  167. package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +8 -0
  168. package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +8 -0
  169. package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +12 -0
  170. package/types/src/condition/BuiltInOperators/BlankOperator.d.ts +9 -0
  171. package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +8 -0
  172. package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +8 -0
  173. package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +8 -0
  174. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +11 -0
  175. package/types/src/condition/BuiltInOperators/ErrorOperator.d.ts +9 -0
  176. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +17 -0
  177. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +8 -0
  178. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +8 -0
  179. package/types/src/condition/BuiltInOperators/IconOperator.d.ts +8 -0
  180. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +14 -0
  181. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +8 -0
  182. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +8 -0
  183. package/types/src/condition/BuiltInOperators/NotOperator.d.ts +12 -0
  184. package/types/src/condition/BuiltInOperators/OrOperator.d.ts +12 -0
  185. package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +8 -0
  186. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +13 -0
  187. package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +12 -0
  188. package/types/src/condition/BuiltInOperators/UniqueOperator.d.ts +8 -0
  189. package/types/src/condition/BuiltInOperators/ValidEmailOperator.d.ts +8 -0
  190. package/types/src/condition/BuiltInOperators/ValidUrlOperator.d.ts +8 -0
  191. package/types/src/condition/BuiltInOperators/index.d.ts +59 -0
  192. package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +43 -0
  193. package/types/src/condition/BuiltinSelectors/DateSelector.d.ts +14 -0
  194. package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +12 -0
  195. package/types/src/condition/BuiltinSelectors/TextLengthSelector.d.ts +16 -0
  196. package/types/src/condition/BuiltinSelectors/TimeSelector.d.ts +14 -0
  197. package/types/src/condition/BuiltinSelectors/WholeSelector.d.ts +14 -0
  198. package/types/src/condition/BuiltinSelectors/index.d.ts +18 -0
  199. package/types/src/condition/Condition.d.ts +123 -0
  200. package/types/src/condition/ICondition.d.ts +915 -0
  201. package/types/src/condition/_ConditionUtils.d.ts +190 -0
  202. package/types/src/condition/index.d.ts +3 -0
  203. package/types/src/conditionalFormat/ConditionalEntry.d.ts +20 -0
  204. package/types/src/conditionalFormat/ConditionalFormat.d.ts +190 -0
  205. package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +20 -0
  206. package/types/src/conditionalFormat/IConditionalFormat.d.ts +518 -0
  207. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +70 -0
  208. package/types/src/conditionalFormat/_ConditionalMessages.d.ts +2 -0
  209. package/types/src/conditionalFormat/index.d.ts +3 -0
  210. package/types/src/dataValidation/DataValidation.d.ts +121 -0
  211. package/types/src/dataValidation/DataValidationCollection.d.ts +20 -0
  212. package/types/src/dataValidation/IDataValidation.d.ts +327 -0
  213. package/types/src/dataValidation/IDataValidationCollection.d.ts +63 -0
  214. package/types/src/dataValidation/_DataValidationMessages.d.ts +2 -0
  215. package/types/src/dataValidation/_Utils.d.ts +10 -0
  216. package/types/src/dataValidation/index.d.ts +3 -0
  217. package/types/src/date/DateUtils.d.ts +8 -0
  218. package/types/src/date/_DateUtils.d.ts +122 -0
  219. package/types/src/date/index.d.ts +2 -0
  220. package/types/src/externalBook/ExternalBookCollection.d.ts +36 -0
  221. package/types/src/externalBook/IExternalBook.d.ts +97 -0
  222. package/types/src/externalBook/IExternalBookCollection.d.ts +29 -0
  223. package/types/src/externalBook/index.d.ts +3 -0
  224. package/types/src/fill/IEffect.d.ts +389 -0
  225. package/types/src/fill/IFill.d.ts +597 -0
  226. package/types/src/fill/IStroke.d.ts +265 -0
  227. package/types/src/fill/_BuiltInPatterns.d.ts +27 -0
  228. package/types/src/fill/index.d.ts +4 -0
  229. package/types/src/filter/IFilter.d.ts +83 -0
  230. package/types/src/filter/index.d.ts +2 -0
  231. package/types/src/font/CanvasFontMeasurer.d.ts +25 -0
  232. package/types/src/font/ExtendedTextMetrics.d.ts +1 -0
  233. package/types/src/font/Font.d.ts +19 -0
  234. package/types/src/font/FontKitFontMeasurer.d.ts +11 -0
  235. package/types/src/font/FontUtils.d.ts +9 -0
  236. package/types/src/font/IFont.d.ts +261 -0
  237. package/types/src/font/IFontCollection.d.ts +31 -0
  238. package/types/src/font/SimpleFontMeasurer.d.ts +4 -0
  239. package/types/src/font/_FontUtils.d.ts +22 -0
  240. package/types/src/font/index.d.ts +5 -0
  241. package/types/src/history/IHistory.d.ts +110 -0
  242. package/types/src/history/index.d.ts +2 -0
  243. package/types/src/hyperlink/IHyperlink.d.ts +96 -0
  244. package/types/src/hyperlink/_Hyperlink.d.ts +21 -0
  245. package/types/src/hyperlink/index.d.ts +2 -0
  246. package/types/src/i18n/LanguagePack.d.ts +97 -0
  247. package/types/src/i18n/LocaleProfile.d.ts +15 -0
  248. package/types/src/i18n/_CurrencyData.d.ts +20 -0
  249. package/types/src/i18n/functionLocales.d.ts +6 -0
  250. package/types/src/i18n/index.d.ts +4 -0
  251. package/types/src/i18n/locales.d.ts +3 -0
  252. package/types/src/index.d.ts +71 -0
  253. package/types/src/io/AbstractBackingStore.d.ts +53 -0
  254. package/types/src/io/ArrayBackingStore.d.ts +34 -0
  255. package/types/src/io/IWorkbookIO.d.ts +1322 -0
  256. package/types/src/io/WorkbookIO.d.ts +91 -0
  257. package/types/src/io/WorkbookOrigin.d.ts +114 -0
  258. package/types/src/io/WorkbookRegistry.d.ts +49 -0
  259. package/types/src/io/index.d.ts +5 -0
  260. package/types/src/lib/file/file.browser.d.ts +41 -0
  261. package/types/src/lib/file/file.node.d.ts +25 -0
  262. package/types/src/lib/utils/_Utils.d.ts +20 -0
  263. package/types/src/lib/utils/banner.d.ts +6 -0
  264. package/types/src/lib/utils/utils.browser.d.ts +28 -0
  265. package/types/src/lib/utils/utils.node.d.ts +42 -0
  266. package/types/src/license/LicenseDetails.d.ts +22 -0
  267. package/types/src/license/LicenseManager.d.ts +63 -0
  268. package/types/src/license/index.d.ts +3 -0
  269. package/types/src/license/license-key.d.ts +33 -0
  270. package/types/src/listener/IListener.d.ts +62 -0
  271. package/types/src/listener/ListenerEmitter.d.ts +47 -0
  272. package/types/src/listener/index.d.ts +2 -0
  273. package/types/src/model/AbstractModel.d.ts +90 -0
  274. package/types/src/model/IModel.d.ts +108 -0
  275. package/types/src/model/_ModelMessages.d.ts +2 -0
  276. package/types/src/model/index.d.ts +3 -0
  277. package/types/src/movable/CustomElement.d.ts +42 -0
  278. package/types/src/movable/ICustomElement.d.ts +29 -0
  279. package/types/src/movable/IGroup.d.ts +30 -0
  280. package/types/src/movable/IMovable.d.ts +327 -0
  281. package/types/src/movable/IMovableCollection.d.ts +129 -0
  282. package/types/src/movable/IMovableSelection.d.ts +49 -0
  283. package/types/src/movable/Movable.d.ts +221 -0
  284. package/types/src/movable/MovableCollection.d.ts +29 -0
  285. package/types/src/movable/_MovableUtils.d.ts +4 -0
  286. package/types/src/movable/index.d.ts +4 -0
  287. package/types/src/named/AbstractNamed.d.ts +41 -0
  288. package/types/src/named/INamed.d.ts +225 -0
  289. package/types/src/named/INamedCollection.d.ts +230 -0
  290. package/types/src/named/NamedCollection.d.ts +302 -0
  291. package/types/src/named/_BuiltInNamed.d.ts +6 -0
  292. package/types/src/named/index.d.ts +3 -0
  293. package/types/src/numFmt/BuiltInFormats.d.ts +49 -0
  294. package/types/src/numFmt/IFormatEngine.d.ts +149 -0
  295. package/types/src/numFmt/NumberFormatBuilder.d.ts +46 -0
  296. package/types/src/numFmt/NumberFormatParser.d.ts +168 -0
  297. package/types/src/numFmt/NumberFormatStyles.d.ts +43 -0
  298. package/types/src/numFmt/NumberFormatType.d.ts +79 -0
  299. package/types/src/numFmt/NumfmtFormatEngine.d.ts +33 -0
  300. package/types/src/numFmt/_BuiltInNumberFormats.d.ts +12 -0
  301. package/types/src/numFmt/_FormatCell.d.ts +52 -0
  302. package/types/src/numFmt/_NumFmtUtils.d.ts +102 -0
  303. package/types/src/numFmt/index.d.ts +105 -0
  304. package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +15 -0
  305. package/types/src/numFmt/vendor/numfmt/index.d.ts +721 -0
  306. package/types/src/picture/IPicture.d.ts +69 -0
  307. package/types/src/picture/Picture.d.ts +67 -0
  308. package/types/src/picture/index.d.ts +2 -0
  309. package/types/src/primitives/CompositeRangeStats.d.ts +63 -0
  310. package/types/src/primitives/Criteria.d.ts +35 -0
  311. package/types/src/primitives/FormulaContext.d.ts +2 -0
  312. package/types/src/primitives/PrimitiveUtils.d.ts +255 -0
  313. package/types/src/primitives/Range.d.ts +221 -0
  314. package/types/src/primitives/RangeStats.d.ts +48 -0
  315. package/types/src/primitives/ReferenceRange.d.ts +19 -0
  316. package/types/src/primitives/Runtime.d.ts +55 -0
  317. package/types/src/primitives/ScalarCollation.d.ts +174 -0
  318. package/types/src/primitives/TextFold.d.ts +62 -0
  319. package/types/src/primitives/_PrimitiveMessages.d.ts +3 -0
  320. package/types/src/primitives/index.d.ts +7 -0
  321. package/types/src/primitives/stats/AggregateStats.d.ts +119 -0
  322. package/types/src/primitives/stats/Cancellation.d.ts +43 -0
  323. package/types/src/primitives/stats/FrequencyStats.d.ts +94 -0
  324. package/types/src/primitives/stats/Ranked.d.ts +26 -0
  325. package/types/src/primitives/stats/ScalarOrder.d.ts +18 -0
  326. package/types/src/primitives/stats/SortedNumbers.d.ts +48 -0
  327. package/types/src/primitives/stats/index.d.ts +7 -0
  328. package/types/src/print/IPrint.d.ts +234 -0
  329. package/types/src/print/index.d.ts +2 -0
  330. package/types/src/protectedRange/IProtectedRange.d.ts +239 -0
  331. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +73 -0
  332. package/types/src/protectedRange/ProtectedRange.d.ts +101 -0
  333. package/types/src/protectedRange/ProtectedRangeCollection.d.ts +21 -0
  334. package/types/src/protectedRange/index.d.ts +3 -0
  335. package/types/src/protection/DefaultProtection.d.ts +43 -0
  336. package/types/src/protection/IProtection.d.ts +170 -0
  337. package/types/src/protection/PasswordHasher.d.ts +35 -0
  338. package/types/src/protection/index.d.ts +6 -0
  339. package/types/src/resource/IResource.d.ts +98 -0
  340. package/types/src/resource/IResourceCollection.d.ts +96 -0
  341. package/types/src/resource/Resource.d.ts +39 -0
  342. package/types/src/resource/ResourceCollection.d.ts +19 -0
  343. package/types/src/resource/_ResourceMessages.d.ts +4 -0
  344. package/types/src/resource/index.d.ts +5 -0
  345. package/types/src/resource/resourceKinds.d.ts +23 -0
  346. package/types/src/richData/index.d.ts +1 -0
  347. package/types/src/scripting/FunctionCollection.d.ts +88 -0
  348. package/types/src/scripting/IFunctionCollection.d.ts +208 -0
  349. package/types/src/scripting/IModule.d.ts +82 -0
  350. package/types/src/scripting/IModuleCollection.d.ts +79 -0
  351. package/types/src/scripting/IScript.d.ts +289 -0
  352. package/types/src/scripting/ITypedFunction.d.ts +61 -0
  353. package/types/src/scripting/MacroFunction.d.ts +15 -0
  354. package/types/src/scripting/Module.d.ts +39 -0
  355. package/types/src/scripting/ModuleCollection.d.ts +56 -0
  356. package/types/src/scripting/Runtime.d.ts +16 -0
  357. package/types/src/scripting/Scripts.d.ts +79 -0
  358. package/types/src/scripting/TypedFunction.d.ts +161 -0
  359. package/types/src/scripting/_FunctionIndex.d.ts +111 -0
  360. package/types/src/scripting/_FunctionMessages.d.ts +6 -0
  361. package/types/src/scripting/_ModuleUtils.d.ts +5 -0
  362. package/types/src/scripting/_ScriptUtils.d.ts +18 -0
  363. package/types/src/scripting/enumManifest.browser.d.ts +9 -0
  364. package/types/src/scripting/enumManifest.node.d.ts +13 -0
  365. package/types/src/scripting/index.d.ts +4 -0
  366. package/types/src/selection/IRangeSelection.d.ts +307 -0
  367. package/types/src/selection/RangeSelection.d.ts +144 -0
  368. package/types/src/selection/_RangeSelectionUtils.d.ts +32 -0
  369. package/types/src/selection/index.d.ts +2 -0
  370. package/types/src/shape/IShape.d.ts +279 -0
  371. package/types/src/shape/Shape.d.ts +54 -0
  372. package/types/src/shape/index.d.ts +2 -0
  373. package/types/src/sheet/CellRegion.d.ts +106 -0
  374. package/types/src/sheet/ICellContainerOptions.d.ts +97 -0
  375. package/types/src/sheet/ISheet.d.ts +1074 -0
  376. package/types/src/sheet/ISheetCollection.d.ts +70 -0
  377. package/types/src/sheet/NamedCellRange.d.ts +45 -0
  378. package/types/src/sheet/NamedRange.d.ts +30 -0
  379. package/types/src/sheet/Sheet.d.ts +1068 -0
  380. package/types/src/sheet/SheetCell.d.ts +335 -0
  381. package/types/src/sheet/SheetCollection.d.ts +18 -0
  382. package/types/src/sheet/SheetRange.d.ts +362 -0
  383. package/types/src/sheet/SheetRanges.d.ts +225 -0
  384. package/types/src/sheet/_CopyUtils.d.ts +33 -0
  385. package/types/src/sheet/_InvalidSheetRange.d.ts +70 -0
  386. package/types/src/sheet/_SheetAutoFitUtils.d.ts +18 -0
  387. package/types/src/sheet/_SheetCoords.d.ts +54 -0
  388. package/types/src/sheet/_SheetFilterUtils.d.ts +9 -0
  389. package/types/src/sheet/_SheetMessages.d.ts +11 -0
  390. package/types/src/sheet/_SheetMutations.d.ts +137 -0
  391. package/types/src/sheet/_SheetSortUtils.d.ts +9 -0
  392. package/types/src/sheet/_SheetStateReader.d.ts +161 -0
  393. package/types/src/sheet/_SheetStateTypes.d.ts +446 -0
  394. package/types/src/sheet/_SheetUtils.d.ts +265 -0
  395. package/types/src/sheet/clipboard/IHTMLParser.d.ts +92 -0
  396. package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +55 -0
  397. package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +29 -0
  398. package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +46 -0
  399. package/types/src/sheet/clipboard/_ClipboardUtils.d.ts +10 -0
  400. package/types/src/sheet/clipboard/index.d.ts +2 -0
  401. package/types/src/sheet/index.d.ts +6 -0
  402. package/types/src/sheet/listener/RangesListener.d.ts +32 -0
  403. package/types/src/sheet/listener/RangesListenerEntry.d.ts +19 -0
  404. package/types/src/sheet/listener/index.d.ts +3 -0
  405. package/types/src/sheet/spatial/MergeEntry.d.ts +17 -0
  406. package/types/src/sheet/spatial/index.d.ts +2 -0
  407. package/types/src/sheet/style/SheetCellStyle.d.ts +540 -0
  408. package/types/src/sheet/style/SheetDirectStyle.d.ts +130 -0
  409. package/types/src/sheet/style/SheetNamedStyle.d.ts +47 -0
  410. package/types/src/sheet/style/SheetTableStyle.d.ts +47 -0
  411. package/types/src/sheet/style/UsedRangeSpatialMap.d.ts +80 -0
  412. package/types/src/sheet/style/_Resolvers.d.ts +41 -0
  413. package/types/src/sheet/style/_StyleUtils.d.ts +69 -0
  414. package/types/src/sheet/style/index.d.ts +1 -0
  415. package/types/src/sheetHeader/ISheetHeader.d.ts +217 -0
  416. package/types/src/sheetHeader/SheetCellHeader.d.ts +61 -0
  417. package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +54 -0
  418. package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +46 -0
  419. package/types/src/sheetHeader/SheetHeader.d.ts +257 -0
  420. package/types/src/sheetHeader/_HeaderUtils.d.ts +94 -0
  421. package/types/src/sheetHeader/_InvalidSheetHeaderRange.d.ts +7 -0
  422. package/types/src/sheetHeader/index.d.ts +2 -0
  423. package/types/src/sheetProtection/ISheetProtection.d.ts +150 -0
  424. package/types/src/sheetProtection/SheetProtection.d.ts +39 -0
  425. package/types/src/sheetProtection/index.d.ts +2 -0
  426. package/types/src/sheetView/ISheetView.d.ts +439 -0
  427. package/types/src/sheetView/SheetView.d.ts +113 -0
  428. package/types/src/sheetView/_SheetViewUtils.d.ts +19 -0
  429. package/types/src/sheetView/index.d.ts +2 -0
  430. package/types/src/slicer/ISlicer.d.ts +38 -0
  431. package/types/src/slicer/Slicer.d.ts +41 -0
  432. package/types/src/slicer/index.d.ts +2 -0
  433. package/types/src/sort/ISort.d.ts +318 -0
  434. package/types/src/sort/Sort.d.ts +48 -0
  435. package/types/src/sort/_SortUtils.d.ts +12 -0
  436. package/types/src/sort/index.d.ts +3 -0
  437. package/types/src/string/IStringCollection.d.ts +50 -0
  438. package/types/src/string/StringCollection.d.ts +26 -0
  439. package/types/src/string/index.d.ts +3 -0
  440. package/types/src/style/IStyle.d.ts +485 -0
  441. package/types/src/style/IStyleCollection.d.ts +292 -0
  442. package/types/src/style/StyleCollection.d.ts +125 -0
  443. package/types/src/style/_BuiltInStyleDefs.d.ts +18 -0
  444. package/types/src/style/_BuiltInStyleNames.d.ts +20 -0
  445. package/types/src/style/index.d.ts +5 -0
  446. package/types/src/table/AnchoredTable.d.ts +349 -0
  447. package/types/src/table/AutoTable.d.ts +64 -0
  448. package/types/src/table/ITable.d.ts +714 -0
  449. package/types/src/table/ITableCollection.d.ts +88 -0
  450. package/types/src/table/ITableStyle.d.ts +318 -0
  451. package/types/src/table/Table.d.ts +8 -0
  452. package/types/src/table/TableCollection.d.ts +20 -0
  453. package/types/src/table/_AutoTableColumn.d.ts +27 -0
  454. package/types/src/table/_BuiltInTableStyles.d.ts +9 -0
  455. package/types/src/table/_FilterField.d.ts +30 -0
  456. package/types/src/table/_NamedTable.d.ts +84 -0
  457. package/types/src/table/_NamedTableSource.d.ts +57 -0
  458. package/types/src/table/_SortField.d.ts +29 -0
  459. package/types/src/table/_TableColumn.d.ts +51 -0
  460. package/types/src/table/_TableMessages.d.ts +5 -0
  461. package/types/src/table/_TableUtils.d.ts +94 -0
  462. package/types/src/table/index.d.ts +5 -0
  463. package/types/src/text/AutoNumberingScheme.d.ts +175 -0
  464. package/types/src/text/Bullet.d.ts +34 -0
  465. package/types/src/text/IText.d.ts +53 -0
  466. package/types/src/text/ITextFrame.d.ts +313 -0
  467. package/types/src/text/TextBoxAlignment.d.ts +141 -0
  468. package/types/src/text/TextFrame.d.ts +43 -0
  469. package/types/src/text/TextLine.d.ts +24 -0
  470. package/types/src/text/TextParagraph.d.ts +61 -0
  471. package/types/src/text/TextRotation.d.ts +106 -0
  472. package/types/src/text/TextRun.d.ts +85 -0
  473. package/types/src/text/TextUtils.d.ts +165 -0
  474. package/types/src/text/TextVisitor.d.ts +11 -0
  475. package/types/src/text/TextWrapper.d.ts +78 -0
  476. package/types/src/text/_TextUtils.d.ts +90 -0
  477. package/types/src/text/impl/Phrase.d.ts +3 -0
  478. package/types/src/text/impl/TabStrategy.d.ts +9 -0
  479. package/types/src/text/impl/WordWrapUtils.d.ts +6 -0
  480. package/types/src/text/index.d.ts +7 -0
  481. package/types/src/text/richtext/IStyledFont.d.ts +330 -0
  482. package/types/src/text/richtext/index.d.ts +2 -0
  483. package/types/src/theme/ITheme.d.ts +252 -0
  484. package/types/src/theme/IThemeCollection.d.ts +84 -0
  485. package/types/src/theme/ThemeCollection.d.ts +62 -0
  486. package/types/src/theme/_BuiltInColorSchemes.d.ts +3 -0
  487. package/types/src/theme/_BuiltInFontSchemes.d.ts +3 -0
  488. package/types/src/theme/_BuiltInThemeDefs.d.ts +3 -0
  489. package/types/src/theme/_ThemeMessages.d.ts +3 -0
  490. package/types/src/theme/_ThemeUtils.d.ts +3 -0
  491. package/types/src/theme/index.d.ts +4 -0
  492. package/types/src/transaction/ITransaction.d.ts +594 -0
  493. package/types/src/transaction/Transaction.d.ts +184 -0
  494. package/types/src/transaction/TransactionSaveStateManager.d.ts +85 -0
  495. package/types/src/transaction/TransactionUndoManager.d.ts +60 -0
  496. package/types/src/transaction/index.d.ts +5 -0
  497. package/types/src/type/ICollection.d.ts +110 -0
  498. package/types/src/type/IProperties.d.ts +51 -0
  499. package/types/src/type/ITypes.d.ts +69 -0
  500. package/types/src/type/Registry.d.ts +66 -0
  501. package/types/src/type/index.d.ts +5 -0
  502. package/types/src/utils/GeomUtils.d.ts +61 -0
  503. package/types/src/utils/ObjectPath.d.ts +9 -0
  504. package/types/src/utils/Profiler.d.ts +38 -0
  505. package/types/src/utils/_CSSUtils.d.ts +156 -0
  506. package/types/src/utils/_GeomUtils.d.ts +14 -0
  507. package/types/src/utils/_RangeCoordUtils.d.ts +84 -0
  508. package/types/src/utils/_RangeSetUtils.d.ts +55 -0
  509. package/types/src/utils/index.d.ts +2 -0
  510. package/types/src/workbook/IWorkbook.d.ts +711 -0
  511. package/types/src/workbook/Workbook.d.ts +342 -0
  512. package/types/src/workbook/WorkbookRange.d.ts +25 -0
  513. package/types/src/workbook/WorkbookRanges.d.ts +39 -0
  514. package/types/src/workbook/_WorkbookMessages.d.ts +8 -0
  515. package/types/src/workbook/_WorkbookUtils.d.ts +35 -0
  516. package/types/src/workbook/index.d.ts +3 -0
  517. package/types/src/workbookProtection/IWorkbookProtection.d.ts +57 -0
  518. package/types/src/workbookProtection/WorkbookProtection.d.ts +14 -0
  519. package/types/src/workbookProtection/index.d.ts +2 -0
  520. package/types/src/workbookView/IWorkbookView.d.ts +134 -0
  521. package/types/src/workbookView/WorkbookView.d.ts +49 -0
  522. package/types/src/workbookView/index.d.ts +3 -0
  523. package/browser/cjs/-P9BHlnCf8OF6D_m.cjs +0 -6
  524. package/browser/cjs/4kU87sIrnTEoJHwl.cjs +0 -6
  525. package/browser/cjs/B8mBx-uU2X9Qvdnr.cjs +0 -6
  526. package/browser/cjs/BD9lJn7w8OVsIwgC.cjs +0 -6
  527. package/browser/cjs/BI57E6P5MbZI3G2Z.cjs +0 -6
  528. package/browser/cjs/BRgYzaAY9tLpJe7C.cjs +0 -6
  529. package/browser/cjs/BdoGTvcTjso5IcRq.cjs +0 -15
  530. package/browser/cjs/C3ScwpfBnQ8JeHF-.cjs +0 -6
  531. package/browser/cjs/CI8H5FLYtzy-Y2TO.cjs +0 -55
  532. package/browser/cjs/ClUc2Qdf-BFmgsJR.cjs +0 -6
  533. package/browser/cjs/CsEmF6ZwF-2A9AvC.cjs +0 -6
  534. package/browser/cjs/D6eH4loatnriRosn.cjs +0 -124
  535. package/browser/cjs/DJTioC8laMAxiW-z.cjs +0 -6
  536. package/browser/cjs/DN6U4mb4Jt2b37q-.cjs +0 -7
  537. package/browser/cjs/DfNwTsshId9JPwTK.cjs +0 -6
  538. package/browser/cjs/DnQwOaG_1n5GvCnM.cjs +0 -6
  539. package/browser/cjs/DtOYNHcDq5p3S21C.cjs +0 -6
  540. package/browser/cjs/Dy2xo5nrA4OFe7w4.cjs +0 -6
  541. package/browser/cjs/EzhtX7d4GOngN0Se.cjs +0 -6
  542. package/browser/cjs/FBky5iT5me5H1I0-.cjs +0 -6
  543. package/browser/cjs/JcziJrpVHeAEo8Iv.cjs +0 -6
  544. package/browser/cjs/LABm2VcP5Duieabc.cjs +0 -6
  545. package/browser/cjs/OZxxkm3CI5jiE3O-.cjs +0 -6
  546. package/browser/cjs/W8_0e_fQB-spiB55.cjs +0 -6
  547. package/browser/cjs/nS_oDgpzBeOV487v.cjs +0 -6
  548. package/browser/cjs/srhqHYaGNtcM9evy.cjs +0 -6
  549. package/browser/cjs/v2J4J4s0rRAvsx4v.cjs +0 -6
  550. package/browser/esm/8Cdp6eg5fQM4U0CD.mjs +0 -10
  551. package/browser/esm/BvtSjnucMGltTjeM.mjs +0 -426
  552. package/browser/esm/Bzw2Xms8ZtifZcAF.mjs +0 -10
  553. package/browser/esm/C9ojFSLlGrdG3EDE.mjs +0 -10
  554. package/browser/esm/CPxdCZqGhuQENst8.mjs +0 -10
  555. package/browser/esm/CQXqHgLFDd57bQSy.mjs +0 -10
  556. package/browser/esm/CRlsrdZLcL-QKyo2.mjs +0 -12
  557. package/browser/esm/CUqge0vhYI_M8Hpg.mjs +0 -10
  558. package/browser/esm/C__wCYJcwKkBqp8t.mjs +0 -10
  559. package/browser/esm/Cou0jxSdkKrqQBPA.mjs +0 -10
  560. package/browser/esm/CtGy0C3HHvNhQ3j5.mjs +0 -10
  561. package/browser/esm/Ctol2MswJyCxIJcQ.mjs +0 -10
  562. package/browser/esm/D7tUJDQqPM4e3FEC.mjs +0 -10
  563. package/browser/esm/DB5Wpq1m-bJ7gpBF.mjs +0 -10
  564. package/browser/esm/DLXAhFMo3NyECo8b.mjs +0 -23842
  565. package/browser/esm/DTlPJulnTLqG3WSw.mjs +0 -10
  566. package/browser/esm/DwfM2tfEPAzMl86c.mjs +0 -10
  567. package/browser/esm/Dx0TIy0V5EVTNOEZ.mjs +0 -10
  568. package/browser/esm/Dxfd2MfY8kHHUtnu.mjs +0 -4022
  569. package/browser/esm/E0SwR3N6qggAhdBh.mjs +0 -10
  570. package/browser/esm/JGdZf2WBzvkRao7-.mjs +0 -10
  571. package/browser/esm/NAcqiYlYK4mm9q_F.mjs +0 -10
  572. package/browser/esm/NGg21AIVBhRCHoOh.mjs +0 -10
  573. package/browser/esm/PjtmxdNFMVskYmPB.mjs +0 -10
  574. package/browser/esm/a_LQ18tLbXq3N9hu.mjs +0 -10
  575. package/browser/esm/hXx5ZKLpc4RvmCjH.mjs +0 -10
  576. package/browser/esm/zoqPtKWJmGQs1ZUb.mjs +0 -5653
  577. package/node/esm/7QlvuodPxz-B25P9.mjs +0 -10
  578. package/node/esm/8Cdp6eg5fQM4U0CD.mjs +0 -10
  579. package/node/esm/B94PecmbGgqY0k9O.mjs +0 -13
  580. package/node/esm/BpvIVwL4NNRKuaD7.mjs +0 -10
  581. package/node/esm/Bzw2Xms8ZtifZcAF.mjs +0 -10
  582. package/node/esm/C9ojFSLlGrdG3EDE.mjs +0 -10
  583. package/node/esm/CQXqHgLFDd57bQSy.mjs +0 -10
  584. package/node/esm/CSg2ysafDv5h1zz2.mjs +0 -2458
  585. package/node/esm/CUqge0vhYI_M8Hpg.mjs +0 -10
  586. package/node/esm/C__wCYJcwKkBqp8t.mjs +0 -10
  587. package/node/esm/Cou0jxSdkKrqQBPA.mjs +0 -10
  588. package/node/esm/CtlHMovXY4x1NgI6.mjs +0 -10
  589. package/node/esm/Ctol2MswJyCxIJcQ.mjs +0 -10
  590. package/node/esm/Cv3hTIkdeILrJGYc.mjs +0 -10
  591. package/node/esm/D7tUJDQqPM4e3FEC.mjs +0 -10
  592. package/node/esm/DTlPJulnTLqG3WSw.mjs +0 -10
  593. package/node/esm/Dvg1Ay14DLNhMgmD.mjs +0 -10
  594. package/node/esm/DwfM2tfEPAzMl86c.mjs +0 -10
  595. package/node/esm/Dx0TIy0V5EVTNOEZ.mjs +0 -10
  596. package/node/esm/F5A4vdvxqRt8hFAs.mjs +0 -10
  597. package/node/esm/NGg21AIVBhRCHoOh.mjs +0 -10
  598. package/node/esm/PjtmxdNFMVskYmPB.mjs +0 -10
  599. package/node/esm/a_LQ18tLbXq3N9hu.mjs +0 -10
  600. package/node/esm/hXx5ZKLpc4RvmCjH.mjs +0 -10
  601. package/node/esm/lUsLEOryW9viP9g7.mjs +0 -1072
@@ -1,1072 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.7.27
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { c as e, t, g as n, a as r, b as s, d as i, e as o, r as a, m as l, f as u } from "./index.mjs";
8
- import { FormulaError as c, ScalarType as p } from "@sheetxl/primitives";
9
- import { CoordUtils as f, CommonUtils as h } from "@sheetxl/utils";
10
- import { Lexer as g, createToken as d, EmbeddedActionsParser as m } from "chevrotain";
11
- const E = d({ name: "WhiteSpace", pattern: /\s+/, group: g.SKIPPED }), A = d({ name: "String", pattern: /"(""|[^"])*"/ }), N = d({ name: "SingleQuotedString", pattern: /'(''|[^'])*'/ }), I = d({ name: "SheetQuoted", pattern: /'((?![\\/[\]*?:]).)+?'!/ }), O = d({ name: "FunctionToken", pattern: /[A-Za-z_]+[A-Za-z_0-9.]*\(/ }), x = d({ name: "NamedTableReference", pattern: /[A-Za-z_]+[A-Za-z_0-9.]*\[/ }), S = d({ name: "BracketedString", pattern: /\[([^[\]]*)\]/, longer_alt: [x, A] }), L = d({ name: "LiteralError", pattern: /#PARSE!|#NULL!|#DIV\/0!|#VALUE!|#NUM!|#FIELD!|#N\/A|#GETTING_DATA|#SPILL!|#CONNECT!|#BLOCKED!|#UNKNOWN!|#FIELD!|#CALC!|#BUSY!|#PYTHON!|#TIMEOUT!/ }), T = d({ name: "RefError", pattern: /#REF!|#NAME\?/ }), R = d({ name: "Sheet", pattern: /[A-Za-z_.\d\u007F-\uFFFF]+!/ }), v = /^[a-zA-Z_][a-zA-Z0-9_.?]*:?/, U = d({ name: "Name", pattern: { exec: (e2, t2) => {
12
- try {
13
- const n2 = v.exec(e2.substring(t2));
14
- if (n2) {
15
- const e3 = n2[0];
16
- if (e3.endsWith(":")) {
17
- const t3 = e3.length;
18
- return "." === e3[t3 - 2] ? [e3.substring(0, t3 - 2)] : [e3.substring(0, t3 - 1)];
19
- }
20
- return [e3];
21
- }
22
- } catch (e3) {
23
- console.warn("Error parsing name", e3);
24
- }
25
- return null;
26
- } }, line_breaks: false, start_chars_hint: (() => {
27
- const e2 = [];
28
- for (let t2 = 65; t2 <= 90; t2++) e2.push(t2);
29
- for (let t2 = 97; t2 <= 122; t2++) e2.push(t2);
30
- for (let t2 = 48; t2 <= 57; t2++) e2.push(t2);
31
- return e2;
32
- })() }), y = d({ name: "Cell", pattern: /[$]?[A-Za-z]{1,3}[$]?[1-9][0-9]*/, longer_alt: U }), w = d({ name: "Column", pattern: /[$]?[A-Za-z]{1,3}/, longer_alt: U }), C = d({ name: "AbsRow", pattern: /[$][0-9]+/, longer_alt: U }), _ = d({ name: "NumberToken", pattern: /[0-9]+[.]?[0-9]*([eE][+-][0-9]+)?/ }), M = d({ name: "Boolean", pattern: /TRUE|FALSE/i }), b = d({ name: "Comma", pattern: /,/ }), P = d({ name: "RangeUnion", pattern: /:/ }), B = d({ name: "RangeTrimFull", pattern: /\.:\./ }), F = d({ name: "RangeTrimLeading", pattern: /\.:/ }), $ = d({ name: "RangeTrimTrailing", pattern: /:\./ }), W = d({ name: "Semicolon", pattern: /;/ }), z = d({ name: "OpenParen", pattern: /\(/ }), k = d({ name: "CloseParen", pattern: /\)/ }), V = d({ name: "OpenSquareParen", pattern: /\[/ }), G = d({ name: "CloseSquareParen", pattern: /]/ });
33
- d({ name: "exclamationMark", pattern: /!/ });
34
- const q = d({ name: "OpenCurlyParen", pattern: /{/ }), j = d({ name: "CloseCurlyParen", pattern: /}/ }), Y = d({ name: "QuoteS", pattern: /'/ }), D = d({ name: "MulOp", pattern: /\*/ }), Z = d({ name: "PlusOp", pattern: /\+/ }), H = d({ name: "DivOp", pattern: /\// }), K = d({ name: "MinOp", pattern: /-/ }), Q = d({ name: "ImplicitIntersectOp", pattern: /@/ }), X = d({ name: "ConcatOp", pattern: /&/ }), J = d({ name: "ExOp", pattern: /\^/ }), ee = d({ name: "PercentOp", pattern: /%/ }), te = d({ name: "TableSpecifier", pattern: /#(All|Data|Headers|Totals|This Row)/i }), ne = d({ name: "ArrayAnchorOp", pattern: /#/, longer_alt: [te, L, T] }), re = d({ name: "GtOp", pattern: />/ }), se = d({ name: "EqOp", pattern: /=/ }), ie = d({ name: "LtOp", pattern: /</ }), oe = [E, A, I, N, O, x, S, L, T, R, y, M, w, C, te, ne, Q, U, _, b, B, F, $, P, W, z, k, V, G, q, j, Y, D, Z, H, K, X, J, D, ee, d({ name: "NeqOp", pattern: /<>/ }), d({ name: "GteOp", pattern: />=/ }), d({ name: "LteOp", pattern: /<=/ }), re, se, ie], ae = new g(oe, { ensureOptimizations: true }), le = {};
35
- oe.forEach((e2) => {
36
- le[e2.name] = e2;
37
- });
38
- const ue = { boolean: 3, string: 2, number: 1 }, ce = (e2, t2) => {
39
- let n2 = e2 + t2;
40
- return n2 = Math.abs(n2) < 99e-14 ? 0 : n2, isFinite(n2) ? n2 : Number.NaN;
41
- }, pe = (e2, t2) => {
42
- let n2 = e2 - t2;
43
- return n2 = Math.abs(n2) < 99e-14 ? 0 : n2, isFinite(n2) ? n2 : Number.NaN;
44
- }, fe = (e2, t2) => {
45
- let n2 = e2 * t2;
46
- return n2 = Math.abs(n2) < 99e-14 ? 0 : n2, isFinite(n2) ? n2 : Number.NaN;
47
- }, he = (e2, t2) => {
48
- if (0 === t2) return 1 / 0;
49
- let n2 = e2 / t2;
50
- return n2 = Math.abs(n2) < 99e-14 ? 0 : n2, isFinite(n2) ? n2 : Number.NaN;
51
- }, ge = (e2, t2) => {
52
- const n2 = e2 ** t2;
53
- return isFinite(n2) ? n2 : Number.NaN;
54
- }, de = (e2 = "", t2 = "") => {
55
- null === e2 && (e2 = ""), null === t2 && (t2 = "");
56
- return "boolean" === typeof e2 && (e2 = e2 ? "TRUE" : "FALSE"), "boolean" === typeof t2 && (t2 = t2 ? "TRUE" : "FALSE"), "" + e2 + t2;
57
- }, me = (e2 = null, t2 = null) => typeof e2 === typeof t2 && e2 === t2, Ee = (e2 = null, t2 = null) => typeof e2 !== typeof t2 || e2 !== t2, Ae = (e2 = null, t2 = null) => {
58
- const n2 = typeof e2, r2 = typeof t2;
59
- return n2 === r2 ? e2 > t2 : ue[n2] > ue[r2];
60
- }, Ne = (e2 = null, t2 = null) => {
61
- const n2 = typeof e2, r2 = typeof t2;
62
- return n2 === r2 ? e2 >= t2 : ue[n2] >= ue[r2];
63
- }, Ie = (e2 = null, t2 = null) => {
64
- const n2 = typeof e2, r2 = typeof t2;
65
- return n2 === r2 ? e2 < t2 : ue[n2] < ue[r2];
66
- }, Oe = (e2 = null, t2 = null) => {
67
- const n2 = typeof e2, r2 = typeof t2;
68
- return n2 === r2 ? e2 <= t2 : ue[n2] <= ue[r2];
69
- }, xe = { type: p.Number, coerce: true, includeBoolean: true, includeMistyped: true, mismatchFill: c.BuiltIn.NA }, Se = { type: p.String, coerce: true, includeMistyped: true, mismatchFill: c.BuiltIn.NA }, Le = { type: null, coerce: true, includeMistyped: true, mismatchFill: c.BuiltIn.NA }, Te = (n2, r2, s2, i2) => {
70
- if (null !== r2 && void 0 !== r2.colStart && (r2 = n2.getValueAt(r2.rowStart, r2.colStart)), null !== s2 && void 0 !== s2.colStart && (s2 = n2.getValueAt(s2.rowStart, s2.colStart)), "number" == typeof r2 && "number" == typeof s2) return i2(r2, s2);
71
- let o2, a2;
72
- if (r2?.isIRange ? o2 = r2 : s2?.isIRange && (a2 = s2), !o2 && !a2) {
73
- const n3 = false;
74
- return r2 = e(r2, t(r2, true), p.Number, true, n3), s2 = e(s2, t(s2, true), p.Number, true, n3), r2 instanceof c.Value ? r2 : s2 instanceof c.Value ? s2 : i2(r2, s2);
75
- }
76
- return o2 || (o2 = n2.getRange(r2)), o2.broadcast(s2, i2, xe).fillEmpty(0);
77
- }, Re = (e2, t2, n2, r2) => {
78
- let s2, i2;
79
- return null !== t2 && void 0 !== t2.colStart && (t2 = e2.getValueAt(t2.rowStart, t2.colStart)), null !== n2 && void 0 !== n2.colStart && (n2 = e2.getValueAt(n2.rowStart, n2.colStart)), t2?.isIRange ? (s2 = t2, i2 = n2) : n2?.isIRange && (s2 = n2, i2 = t2), s2 ? s2.broadcast(i2, r2, Le) : r2(t2, n2);
80
- }, ve = (n2, r2) => {
81
- null == r2 && (r2 = 0);
82
- let s2, i2 = 1;
83
- if ("+" === n2) return r2;
84
- if ("-" !== n2) throw new c.Value(`Unrecognized prefix: ${n2}`);
85
- return i2 = -i2, r2?.isIRange && (s2 = r2), s2 ? s2.broadcast(i2, fe, Le) : "number" != typeof (r2 = e(r2, t(r2, true), p.Number)) || isNaN(r2) ? c.BuiltIn.Value : r2 * i2;
86
- }, Ue = (e2, t2, n2, r2) => {
87
- if (!t2) return c.BuiltIn.Ref;
88
- if (t2.isIReferenceRange && (t2 = t2.getCoords()), void 0 === t2.colStart) return c.BuiltIn.Ref;
89
- if (n2.isIReferenceRange && (n2 = n2.getCoords()), void 0 === n2.colStart) return c.BuiltIn.Ref;
90
- const s2 = r2(t2, n2);
91
- return s2 ? e2.getReference(s2) : c.BuiltIn.Null;
92
- }, ye = { "+": (e2, t2, n2) => Te(e2, t2, n2, ce), "-": (e2, t2, n2) => Te(e2, t2, n2, pe), "*": (e2, t2, n2) => Te(e2, t2, n2, fe), "/": (e2, t2, n2) => Te(e2, t2, n2, he), "^": (e2, t2, n2) => Te(e2, t2, n2, ge), " ": (e2, t2, n2, r2) => Ue(e2, t2, n2, f.intersectRanges), ":": (e2, t2, n2, r2) => Ue(e2, t2, n2, f.unionRanges), ".:.": (e2, t2, n2, r2) => {
93
- const s2 = Ue(e2, t2, n2, f.unionRanges);
94
- return e2.getFunction("TRIMRANGE").execute(s2, 3, 3);
95
- }, ".:": (e2, t2, n2, r2) => {
96
- const s2 = Ue(e2, t2, n2, f.unionRanges);
97
- return e2.getFunction("TRIMRANGE").execute(s2, 1, 1);
98
- }, ":.": (e2, t2, n2, r2) => {
99
- const s2 = Ue(e2, t2, n2, f.unionRanges);
100
- return e2.getFunction("TRIMRANGE").execute(s2, 2, 2);
101
- }, "&": (n2, r2, s2) => ((n3, r3, s3, i2) => {
102
- if (null !== r3 && void 0 !== r3.colStart && (r3 = n3.getValueAt(r3.rowStart, r3.colStart)), null !== s3 && void 0 !== s3.colStart && (s3 = n3.getValueAt(s3.rowStart, s3.colStart)), "string" == typeof r3 && "string" == typeof s3) return i2(r3, s3);
103
- let o2, a2;
104
- return r3?.isIRange ? o2 = r3 : s3?.isIRange && (a2 = s3), o2 || a2 ? (o2 || (o2 = n3.getRange(r3)), o2.broadcast(s3, i2, Se)) : i2(r3 = e(r3, t(r3, true), p.String), s3 = e(s3, t(s3, true), p.String));
105
- })(n2, r2, s2, de), "=": (e2, t2, n2) => Re(e2, t2, n2, me), "<>": (e2, t2, n2) => Re(e2, t2, n2, Ee), ">": (e2, t2, n2) => Re(e2, t2, n2, Ae), "<": (e2, t2, n2) => Re(e2, t2, n2, Ie), ">=": (e2, t2, n2) => Re(e2, t2, n2, Ne), "<=": (e2, t2, n2) => Re(e2, t2, n2, Oe) }, we = { "-": (e2, t2) => ve("-", t2), "+": (e2, t2) => ve("+", t2), "@": (e2, t2) => {
106
- if (!t2 || !t2.isIReferenceRange) return t2;
107
- const n2 = t2.getCoords(), r2 = t2, s2 = e2.getPosition(), i2 = r2.getHeight(), o2 = r2.getWidth();
108
- if (o2 > 1 && i2 > 1) return c.BuiltIn.Value;
109
- if (i2 > 1) {
110
- const e3 = s2.rowIndex - n2.rowStart;
111
- if (e3 >= 0 && e3 < i2) return r2.getValueAt(e3, 0);
112
- } else {
113
- if (!(o2 > 1)) return r2.getValueAt(0, 0);
114
- {
115
- const e3 = s2.colIndex - n2.colStart;
116
- if (e3 >= 0 && e3 < o2) return r2.getValueAt(0, e3);
117
- }
118
- }
119
- return c.BuiltIn.Value;
120
- } }, Ce = { "%": (e2, t2) => Te(e2, t2, 100, he), "#": (e2, t2) => {
121
- const n2 = e2.getSpillAt(t2.rowStart, t2.colStart);
122
- return n2 || c.BuiltIn.Ref;
123
- } };
124
- function _e(e2) {
125
- const t2 = (e2 = e2.toUpperCase()).length;
126
- let n2 = 0;
127
- for (let r2 = 0; r2 < t2; r2++) {
128
- const s2 = e2.charCodeAt(r2);
129
- isNaN(s2) || (n2 += (s2 - 64) * 26 ** (t2 - r2 - 1));
130
- }
131
- return n2;
132
- }
133
- function Me(e2) {
134
- return { type: "cell", value: Object.freeze({ colIndex: e2.colIndex, rowIndex: e2.rowIndex, $colIndex: e2.$colIndex || false, $rowIndex: e2.$rowIndex || false }), inputs: null, isReference: true };
135
- }
136
- function be(e2, t2) {
137
- const n2 = e2.startsWith("$");
138
- n2 && (e2 = e2.substring(1));
139
- let r2 = parseInt(e2) - 1;
140
- return n2 || r2 === Number.MIN_SAFE_INTEGER || (r2 -= t2.colIndex), { type: "cell", value: Object.freeze({ colIndex: Number.MIN_SAFE_INTEGER, $colIndex: false, rowIndex: r2, $rowIndex: n2 }), inputs: null, isReference: true };
141
- }
142
- function Pe(e2, t2) {
143
- return { type: "function", value: e2 = e2.toUpperCase(), inputs: t2 };
144
- }
145
- function Be(e2, t2) {
146
- return { type: "tableReference", value: e2, inputs: t2 };
147
- }
148
- function Fe(e2) {
149
- return { type: "tableSpecifier", value: e2, inputs: null, isReference: true };
150
- }
151
- function $e(e2, t2, n2, r2 = false) {
152
- const s2 = { type: "infix", value: e2, inputs: [t2, n2] };
153
- return r2 && (s2.isReference = true), s2;
154
- }
155
- function We(e2, t2, n2 = false) {
156
- const r2 = { type: "postfix", value: e2, inputs: [t2] };
157
- return n2 && (r2.isReference = true), r2;
158
- }
159
- function ze(e2, t2, n2 = false) {
160
- const r2 = { type: "prefix", value: e2, inputs: [t2] };
161
- return n2 && (r2.isReference = true), r2;
162
- }
163
- function ke(e2) {
164
- return { type: "named", value: e2, inputs: null, isReference: true };
165
- }
166
- function Ve(e2) {
167
- return { type: "number", value: Number(e2), isLiteral: true };
168
- }
169
- function Ge(e2) {
170
- let t2 = e2;
171
- const n2 = e2 && e2.length > 1 && '"' === e2[0] && '"' === e2[e2.length - 1];
172
- return n2 && (t2 = e2.substring(1, e2.length - 1)), { type: n2 ? "quotedString" : "string", value: t2, isLiteral: true };
173
- }
174
- function qe(e2) {
175
- return { type: "boolean", value: "TRUE" === e2 || "TRUE" === e2.toUpperCase(), isLiteral: true };
176
- }
177
- function je(e2) {
178
- return { type: "error", value: c.getBuiltInByLabel(e2.toUpperCase()), isLiteral: true };
179
- }
180
- function Ye(e2) {
181
- return { type: "error", value: e2 ? c.getBuiltInByLabel(e2.toUpperCase()) : c.BuiltIn.Ref, inputs: null, isReference: true };
182
- }
183
- function De(e2, t2) {
184
- const n2 = (function e3(n3, r2) {
185
- const s2 = n3.inputs;
186
- let i2;
187
- if (s2) {
188
- const t3 = s2.length;
189
- for (let r3 = 0; r3 < t3; r3++) {
190
- const t4 = s2[r3], o3 = e3(t4, n3);
191
- o3 !== t4 && (i2 || (i2 = [...s2]), i2[r3] = o3);
192
- }
193
- }
194
- const o2 = i2 ? { ...n3, inputs: i2 } : n3, a2 = t2(o2, r2);
195
- return void 0 === a2 ? o2 : a2;
196
- })(e2, void 0);
197
- return n2 || this;
198
- }
199
- function Ze(e2, t2) {
200
- let r2 = 0, s2 = De(e2, (e3) => {
201
- const t3 = { ...e3 };
202
- return t3.evalIndex = r2++, t3;
203
- });
204
- const i2 = new Array(r2), o2 = /* @__PURE__ */ new Set(), a2 = /* @__PURE__ */ new Map();
205
- let l2;
206
- const u2 = /* @__PURE__ */ new Map(), c2 = [], p2 = [];
207
- s2 = De(s2, (e3, t3) => {
208
- const r3 = e3.type, s3 = e3.evalIndex;
209
- if (i2[s3] = null, e3.isReference) {
210
- const t4 = e3, n2 = { node: e3, index: u2.size, op: null, value: null, inputs: null };
211
- if (u2.set(t4, n2), "cell" === r3) {
212
- const r4 = t4.value;
213
- return r4.$colIndex && (n2.hasHorizontalAbs = true), r4.$rowIndex && (n2.hasVerticalAbs = true), n2.value = a2.size, a2.set(t4, a2.size), o2.add(n2), e3.refIndex = p2.length, void p2.push(n2.index);
214
- }
215
- if ("infix" === r3 || "prefix" === r3 || "postfix" === r3 || "spill" === r3) {
216
- const r4 = t4.inputs, s4 = r4.length, i3 = e3.value;
217
- n2.op = i3;
218
- const a3 = new Array(s4);
219
- n2.inputs = a3;
220
- for (let e4 = 0; e4 < s4; e4++) {
221
- const t5 = r4[e4], s5 = u2.get(t5);
222
- s5 && (s5.hasHorizontalAbs && (n2.hasHorizontalAbs = true), s5.hasVerticalAbs && (n2.hasVerticalAbs = true)), a3[e4] = s5 ? s5.index : -1, o2.delete(s5);
223
- }
224
- if (o2.add(n2), Je.includes(i3)) {
225
- const t5 = r4[0], s5 = !!t5 && "cell" === t5.type, i4 = r4[1], o3 = !!i4 && "cell" === i4.type;
226
- s5 && o3 && (p2.splice(i4.refIndex, 1), i4.refIndex = t5.refIndex, e3.refIndex = t5.refIndex, p2[t5.refIndex] = n2.index);
227
- } else "#" === i3 && (e3.refIndex = r4[0].refIndex);
228
- return void c2.push(e3);
229
- }
230
- if ("error" === r3 || "named" === r3) {
231
- l2 || (l2 = /* @__PURE__ */ new Map());
232
- const s4 = t4.value;
233
- let i3 = l2.get(s4);
234
- return n2.op = r3, void 0 === i3 && (i3 = l2.size, l2.set(s4, i3)), n2.value = i3, o2.add(n2), e3.refIndex = p2.length, void p2.push(n2.index);
235
- }
236
- "tableReference" === r3 && (n2.op = r3), "tableSpecifier" === r3 && (n2.op = r3), "structuredArg" === r3 && (n2.op = r3);
237
- } else if (t3 && t3.isReference) {
238
- const t4 = e3, n2 = { node: e3, index: u2.size, op: "function", value: e3.value, inputs: null };
239
- u2.set(t4, n2);
240
- }
241
- if (e3.isLiteral) if ("array" !== r3) i2[s3] = e3.value;
242
- else {
243
- const t4 = e3.value, r4 = t4.length, o3 = new Array(r4);
244
- for (let e4 = 0; e4 < r4; e4++) {
245
- const n2 = t4[e4].value, r5 = n2.length, s4 = new Array(r5);
246
- for (let e5 = 0; e5 < r5; e5++) {
247
- const t5 = n2[e5];
248
- let r6 = t5.value;
249
- if ("prefix" === t5.type) {
250
- const e6 = t5.value;
251
- r6 = t5.inputs[0].value, "-" === e6 && (r6 = -r6);
252
- }
253
- s4[e5] = r6;
254
- }
255
- o3[e4] = s4;
256
- }
257
- i2[s3] = n(o3);
258
- }
259
- else {
260
- if ("empty" !== r3) return c2.push(e3), e3;
261
- i2[s3] = void 0;
262
- }
263
- });
264
- const f2 = new Array(a2.size);
265
- a2.forEach((e3, t3) => {
266
- const n2 = t3.value, r3 = n2.colIndex, s3 = n2.rowIndex, i3 = n2.$colIndex, o3 = n2.$rowIndex, a3 = { colStart: r3, rowStart: s3, colEnd: r3, rowEnd: s3, $colStart: i3, $rowStart: o3, $colEnd: i3, $rowEnd: o3 };
267
- r3 === Number.MIN_SAFE_INTEGER && (a3.colEnd = Number.MAX_SAFE_INTEGER), s3 === Number.MIN_SAFE_INTEGER && (a3.rowEnd = Number.MAX_SAFE_INTEGER), n2.sheetName && (a3.sheetName = n2.sheetName), f2[e3] = a3;
268
- });
269
- const h2 = f2.length, g2 = new Array(h2);
270
- for (let e3 = 0; e3 < h2; e3++) g2[e3] = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0, sheetName: null };
271
- const d2 = new Array(u2.size);
272
- let m2;
273
- u2.forEach((e3) => {
274
- d2[e3.index] = e3;
275
- }), l2 && (m2 = [], l2.forEach((e3, t3) => {
276
- m2.push(t3);
277
- }));
278
- const E2 = [];
279
- o2.forEach((e3) => {
280
- E2.push(e3.index);
281
- });
282
- const A2 = c2.length;
283
- for (let e3 = 0; e3 < A2; e3++) {
284
- const t3 = c2[e3], n2 = t3.type;
285
- if ("infix" === n2) {
286
- const e4 = t3.value;
287
- t3.fn = ye[e4];
288
- } else if ("prefix" === n2) {
289
- const e4 = t3.value;
290
- t3.fn = we[e4];
291
- } else if ("postfix" === n2) {
292
- const e4 = t3.value;
293
- t3.fn = Ce[e4];
294
- }
295
- }
296
- const N2 = (function(e3) {
297
- const t3 = [], n2 = (e4, n3) => {
298
- const r4 = { type: e4.type, value: e4.value };
299
- void 0 !== e4.evalIndex && (r4.evalIndex = e4.evalIndex), void 0 !== e4.refIndex && (r4.refIndex = e4.refIndex), n3 && (r4.ctx = n3), t3.push(r4);
300
- }, r3 = (e4, n3, r4, s4) => {
301
- if (null == n3) return;
302
- if (t3.length > 1 && "whitespace" === e4 && "whitespace" === t3[t3.length - 1].type) return;
303
- const i3 = { type: e4, value: n3 };
304
- r4 && (i3.ctx = r4), void 0 !== s4 && (i3.evalIndex = s4), t3.push(i3);
305
- };
306
- !(function e4(t4, s4, i3) {
307
- const o3 = t4.evalIndex ?? i3 ?? 0, a3 = t4.type, l3 = (t5, n3, s5) => {
308
- if (!t5) return;
309
- const i4 = t5.length;
310
- for (let o4 = 0; o4 < i4; o4++) e4(t5[o4], n3, s5), o4 < i4 - 1 && r3("comma", ",", n3);
311
- };
312
- if (t4.isLiteral) {
313
- if (r3("whitespace", t4.wsBefore, s4), "array" === a3) {
314
- r3("type", "{", s4);
315
- const n3 = t4.value, i4 = n3.length;
316
- for (let t5 = 0; t5 < i4; t5++) {
317
- const a4 = n3[t5], l4 = a4.value, u3 = l4.length;
318
- for (let t6 = 0; t6 < u3; t6++) {
319
- const n4 = l4[t6];
320
- r3("whitespace", n4.wsBefore, s4), e4(n4, s4, o3), r3("whitespace", n4.wsAfter, s4), t6 < u3 - 1 && r3("comma", ",", s4);
321
- }
322
- t5 < i4 - 1 && (r3("whitespace", a4.wsBefore, s4), r3("comma", ";", s4), r3("whitespace", a4.wsAfter, s4));
323
- }
324
- t4.error || r3("type", "}", s4);
325
- } else "quotedString" === a3 ? (t4 = { type: a3, value: '"' + t4.value + '"' }, n2(t4, s4)) : n2(t4, s4);
326
- r3("whitespace", t4.wsAfter, s4);
327
- } else if ("infix" === a3) e4(t4.inputs[0], s4, o3), r3("whitespace", t4.wsBefore, s4), n2(t4, s4), r3("whitespace", t4.wsAfter, s4), e4(t4.inputs[1], s4, o3);
328
- else if ("prefix" === a3) r3("whitespace", t4.wsBefore, s4), n2(t4, s4), r3("whitespace", t4.wsAfter, s4), e4(t4.inputs[0], s4, o3);
329
- else if ("postfix" === a3) e4(t4.inputs[0], s4, o3), r3("whitespace", t4.wsBefore, s4), n2(t4, s4), r3("whitespace", t4.wsAfter, s4);
330
- else {
331
- r3("whitespace", t4.wsBefore, s4);
332
- const i4 = t4.inputs;
333
- switch (a3) {
334
- case "function":
335
- n2(t4, s4);
336
- const u3 = { name: String(t4.value), argIndex: -1 };
337
- if (r3("paren", "(", u3, t4.evalIndex), i4) {
338
- const t5 = i4.length;
339
- for (let n3 = 0; n3 < t5; n3++) {
340
- const s5 = { ...u3, argIndex: n3 };
341
- e4(i4[n3], s5, o3), n3 < t5 - 1 && r3("comma", ",", s5);
342
- }
343
- }
344
- t4.error || r3("paren", ")", u3, t4.evalIndex);
345
- break;
346
- case "cell":
347
- n2(t4, s4);
348
- break;
349
- case "paren":
350
- r3(a3, "(", s4, o3), l3(i4, s4, o3), t4.error || r3(a3, ")", s4, o3);
351
- break;
352
- case "squareParen":
353
- r3(a3, "[", s4, o3), l3(i4, s4, o3), t4.error || r3(a3, "]", s4, o3);
354
- break;
355
- case "tableReference":
356
- n2(t4, s4);
357
- const c3 = { name: String(t4.value), argIndex: -1 };
358
- if (r3("paren", "[", c3), i4) {
359
- const t5 = i4.length;
360
- for (let n3 = 0; n3 < t5; n3++) {
361
- const s5 = { ...c3, argIndex: n3 };
362
- e4(i4[n3], s5, o3), n3 < t5 - 1 && r3("comma", ",", s5);
363
- }
364
- }
365
- t4.error || r3("paren", "]", c3);
366
- break;
367
- default:
368
- void 0 !== t4.value && n2(t4, s4), i4 && i4.forEach((t5) => e4(t5, s4, o3));
369
- }
370
- r3("whitespace", t4.wsAfter, s4);
371
- }
372
- })(e3);
373
- const s3 = t3.length;
374
- for (let e4 = 0; e4 < s3; e4++) {
375
- const n3 = t3[e4];
376
- if ("whitespace" === n3.type && void 0 === n3.evalIndex) {
377
- const r4 = t3[e4 + 1];
378
- r4 && void 0 !== r4.evalIndex && (n3.evalIndex = r4.evalIndex);
379
- }
380
- }
381
- return t3;
382
- })(s2);
383
- return { ast: s2, evaluations: i2, executions: c2, precedentsAbsolute: g2, precedentsExecute: d2, precedentsNamed: m2, precedentsRelative: f2, precedentsRoot: E2, references: p2, tokens: N2, error: t2 };
384
- }
385
- function He(e2, t2) {
386
- let n2, r2 = -1, s2 = "";
387
- Number.isSafeInteger(e2.previousToken?.startLine) ? (r2 = e2.previousToken.startLine, n2 = e2.previousToken.endColumn + 1) : Number.isSafeInteger(e2.token?.startLine) && (r2 = e2.token.startLine, n2 = e2.token.startColumn), -1 !== r2 ? (s2 += "\n" + t2.split("\n")[r2 - 1] + "\n", s2 += Array(n2 - 1).fill(" ").join("") + "^\n", s2 += `Error at position ${r2}:${n2}
388
- ` + e2.message, e2.errorLocation = { line: r2, column: n2 }) : s2 = t2 + "\n" + e2.message;
389
- const i2 = new c.Parse(s2);
390
- return i2.details = e2, i2;
391
- }
392
- const Ke = function(e2, t2) {
393
- return t2.wsBefore && (e2.wsBefore = t2.wsBefore), t2.wsAfter && (e2.wsAfter = t2.wsAfter), t2.image && (e2.image = t2.image), e2;
394
- }, Qe = "_XLFN.", Xe = Object.freeze([[":", ".:.", ".:", , ":."], ["^"], ["*", "/"], ["+", "-"], ["&"], ["<", ">", "=", "<>", "<=", ">="]]), Je = Object.freeze([":", ".:.", ".:", , ":."]), et = Object.freeze([":", " ", ".:.", ".:", , ":."]), tt = Object.freeze(["@"]), nt = Object.freeze(["#"]), rt = Object.freeze(et.concat(tt).concat(nt)), { String: st, SheetQuoted: it, SingleQuotedString: ot, FunctionToken: at, NamedTableReference: lt, LiteralError: ut, RefError: ct, Cell: pt, Sheet: ft, Name: ht, NumberToken: gt, Boolean: dt, Column: mt, AbsRow: Et, ImplicitIntersectOp: At, Comma: Nt, RangeUnion: It, RangeTrimFull: Ot, RangeTrimLeading: xt, RangeTrimTrailing: St, Semicolon: Lt, OpenParen: Tt, CloseParen: Rt, OpenSquareParen: vt, CloseSquareParen: Ut, OpenCurlyParen: yt, CloseCurlyParen: wt, MulOp: Ct, PlusOp: _t, DivOp: Mt, MinOp: bt, ConcatOp: Pt, ExOp: Bt, PercentOp: Ft, ArrayAnchorOp: $t, TableSpecifier: Wt, BracketedString: zt, NeqOp: kt, GteOp: Vt, LteOp: Gt, GtOp: qt, EqOp: jt, LtOp: Yt } = le;
395
- class Dt extends m {
396
- constructor() {
397
- super(le, { nodeLocationTracking: "full", maxLookahead: 1, skipValidations: true, recoveryEnabled: true }), this.position = { colIndex: 0, rowIndex: 0 }, this.astErrors = [];
398
- const e2 = this, t2 = (t3, n2, r2) => {
399
- let s2;
400
- e2.CONSUME(n2);
401
- const i2 = e2.getLexerPosition();
402
- s2 = e2.ACTION(() => (s2 = { type: t3, value: null, inputs: null }, this._ensureWhitespace(s2, i2, true)));
403
- const o2 = [], a2 = e2.SUBRULE(e2.intersectOp);
404
- a2 && o2.push(a2);
405
- const l2 = e2.SUBRULE(e2.group), u2 = e2.OPTION(() => this.CONSUME(r2));
406
- return s2 = e2.ACTION(() => {
407
- if (l2) for (let e3 = 0; e3 < l2.length; e3++) o2.push(l2[e3]);
408
- return s2 && (u2 || this._reportError(s2, "Missing closing parenthesis", i2), s2.inputs = o2), this._ensureWhitespace(s2, e2.getLexerPosition(), false, true);
409
- }), s2;
410
- };
411
- e2.RULE("infixOp", () => {
412
- const t3 = [], n2 = [e2.SUBRULE(e2.postfixOp)];
413
- return e2.MANY(() => {
414
- const r2 = e2.OR(e2.c1 || (e2.c1 = [{ ALT: () => e2.CONSUME(It).image }, { ALT: () => e2.CONSUME(_t).image }, { ALT: () => e2.CONSUME(bt).image }, { ALT: () => e2.CONSUME(Ct).image }, { ALT: () => e2.CONSUME(Mt).image }, { ALT: () => e2.CONSUME(Bt).image }, { ALT: () => e2.CONSUME(Pt).image }, { ALT: () => e2.CONSUME(qt).image }, { ALT: () => e2.CONSUME(jt).image }, { ALT: () => e2.CONSUME(Yt).image }, { ALT: () => e2.CONSUME(kt).image }, { ALT: () => e2.CONSUME(Vt).image }, { ALT: () => e2.CONSUME(Gt).image }, { ALT: () => e2.CONSUME(Ot).image }, { ALT: () => e2.CONSUME(xt).image }, { ALT: () => e2.CONSUME(St).image }]));
415
- t3.push([r2, e2.getLexerPosition(), rt.includes(r2)]), n2.push(e2.SUBRULE2(e2.postfixOp));
416
- }), e2.ACTION(() => {
417
- let e3 = t3.length;
418
- const r2 = Xe.length;
419
- for (let s2 = 0; e3 > 0 && s2 < r2; s2++) {
420
- const r3 = Xe[s2];
421
- let i2 = t3.length;
422
- for (let s3 = 0; s3 < i2; s3++) {
423
- const o2 = t3[s3], a2 = o2[0];
424
- if (!r3.includes(a2)) continue;
425
- let l2 = $e(a2, n2[s3], n2[s3 + 1], o2[2]);
426
- l2 = this._ensureWhitespace(l2, o2[1]), t3.splice(s3, 1), n2.splice(s3, 2, l2), s3--, i2--, e3--;
427
- }
428
- }
429
- }), n2[0];
430
- }), e2.RULE("plusMinusOp", () => e2.OR([{ ALT: () => e2.CONSUME(_t).image }, { ALT: () => e2.CONSUME(bt).image }])), e2.RULE("postfixOp", () => {
431
- let t3 = e2.SUBRULE(e2.prefixOp);
432
- const n2 = [];
433
- return e2.MANY(() => {
434
- const t4 = e2.OR([{ ALT: () => e2.CONSUME(Ft).image }, { ALT: () => e2.CONSUME($t).image }]);
435
- e2.ACTION(() => {
436
- n2.push([t4, e2.getLexerPosition()]);
437
- });
438
- }), e2.ACTION(() => {
439
- const e3 = n2.length;
440
- if (0 !== e3) for (let r2 = 0; r2 < e3; r2++) {
441
- const e4 = n2[r2], s2 = e4[0], i2 = e4[1], o2 = rt.includes(s2);
442
- t3 = We(s2, t3, o2), t3 = this._ensureWhitespace(t3, i2);
443
- }
444
- }), t3;
445
- }), e2.RULE("prefixOp", () => {
446
- const t3 = [];
447
- e2.MANY(() => {
448
- const n3 = e2.OR([{ ALT: () => e2.CONSUME(_t).image }, { ALT: () => e2.CONSUME(bt).image }, { ALT: () => e2.CONSUME(At).image }]);
449
- e2.ACTION(() => {
450
- t3.push([n3, e2.getLexerPosition()]);
451
- });
452
- });
453
- let n2 = e2.SUBRULE(e2.formula);
454
- return e2.ACTION(() => {
455
- const e3 = t3.length;
456
- if (0 !== e3) for (let r2 = e3 - 1; r2 >= 0; r2--) {
457
- const e4 = t3[r2], s2 = e4[0], i2 = e4[1], o2 = rt.includes(s2);
458
- n2 = ze(s2, n2, o2), n2 = this._ensureWhitespace(n2, i2);
459
- }
460
- }), n2;
461
- }), e2.RULE("intersectOp", () => {
462
- const t3 = [e2.SUBRULE(e2.infixOp)];
463
- return e2.MANY(() => {
464
- e2.OPTION({ GATE: () => {
465
- const t4 = e2.LA(0);
466
- return e2.LA(1).startOffset > t4.endOffset + 1;
467
- }, DEF: () => {
468
- t3.push(e2.SUBRULE3(e2.infixOp));
469
- } });
470
- }), e2.ACTION(() => {
471
- for (; t3.length > 1; ) {
472
- let e3 = t3.length - 1;
473
- for (let n2 = 0; n2 < e3; n2++) {
474
- const r2 = t3[n2], s2 = t3[n2 + 1], i2 = $e(" ", r2, s2, true);
475
- if (delete r2.wsAfter, s2.wsBefore) {
476
- const e4 = s2.wsBefore.slice(0, -1), t4 = e4.length;
477
- delete s2.wsBefore, t4 > 0 && (i2.wsBefore = e4);
478
- }
479
- n2 + 1 < e3 && delete s2.wsAfter, t3.splice(n2, 2, i2), n2--, e3--;
480
- }
481
- }
482
- }), t3[0];
483
- }), e2.RULE("formula", () => e2.OR9([{ ALT: () => e2.SUBRULE(e2.referenceWithoutInfix) }, { ALT: () => e2.SUBRULE(e2.function) }, { ALT: () => e2.SUBRULE(e2.paren) }, { ALT: () => e2.SUBRULE(e2.namedTableReference) }, { ALT: () => e2.SUBRULE(e2.bracketedString) }, { ALT: () => e2.SUBRULE(e2.squareParen) }, { ALT: () => e2.SUBRULE(e2.literal) }, { ALT: () => e2.SUBRULE(e2.literalArray) }])), e2.RULE("group", () => {
484
- const t3 = [];
485
- return e2.MANY(() => {
486
- e2.CONSUME(Nt);
487
- const n2 = e2.SUBRULE2(e2.intersectOp);
488
- e2.ACTION(() => {
489
- t3.push(n2);
490
- });
491
- }), t3;
492
- }), e2.RULE("paren", () => t2("paren", Tt, Rt)), e2.RULE("literalArray", () => {
493
- let t3 = { type: "row", value: [], isLiteral: true };
494
- e2.CONSUME(yt);
495
- const n2 = e2.getLexerPosition();
496
- let r2 = e2.ACTION(() => this._ensureWhitespace({ type: "array", value: [t3], isLiteral: true }, n2, true));
497
- const s2 = e2.SUBRULE(e2.literalForArray);
498
- e2.ACTION(() => {
499
- t3.value.push(s2);
500
- }), e2.MANY(() => {
501
- const n3 = e2.OR([{ ALT: () => e2.CONSUME(Nt).image }, { ALT: () => e2.CONSUME(Lt).image }]), s3 = e2.SUBRULE2(e2.literalForArray);
502
- e2.ACTION(() => {
503
- "," === n3 || (t3 = { type: "row", value: [], isLiteral: true }, r2.value.push(t3)), t3.value.push(s3);
504
- });
505
- });
506
- const i2 = e2.OPTION(() => this.CONSUME(wt));
507
- return r2 = e2.ACTION(() => (i2 || this._reportError(r2, "Missing closing parenthesis '}'", n2), this._ensureWhitespace(r2, e2.getLexerPosition(), false, true))), r2;
508
- }), e2.RULE("literalForArray", () => e2.OR([{ ALT: () => {
509
- const t3 = e2.OPTION(() => e2.SUBRULE(e2.plusMinusOp)), n2 = e2.CONSUME(gt), r2 = e2.ACTION(() => this._ensureWhitespace(Ve(n2.image), e2.getLexerPosition()));
510
- return t3 ? e2.ACTION(() => /* @__PURE__ */ (function(e3, t4) {
511
- return { type: "prefix", value: e3, inputs: [t4] };
512
- })(t3, r2)) : r2;
513
- } }, { ALT: () => {
514
- const t3 = e2.CONSUME(st);
515
- return e2.ACTION(() => this._ensureWhitespace(Ge(t3.image), e2.getLexerPosition()));
516
- } }, { ALT: () => {
517
- const t3 = e2.CONSUME(dt);
518
- return e2.ACTION(() => this._ensureWhitespace(qe(t3.image), e2.getLexerPosition()));
519
- } }, { ALT: () => {
520
- const t3 = e2.CONSUME(ut);
521
- return e2.ACTION(() => this._ensureWhitespace(je(t3.image), e2.getLexerPosition()));
522
- } }, { ALT: () => {
523
- const t3 = e2.CONSUME(ct);
524
- return e2.ACTION(() => this._ensureWhitespace(Ye(t3.image), e2.getLexerPosition()));
525
- } }])), e2.RULE("literal", () => e2.OR([{ ALT: () => {
526
- const t3 = e2.CONSUME(gt);
527
- return e2.ACTION(() => this._ensureWhitespace(Ve(t3.image), e2.getLexerPosition()));
528
- } }, { ALT: () => {
529
- const t3 = e2.CONSUME(st);
530
- return e2.ACTION(() => this._ensureWhitespace(Ge(t3.image), e2.getLexerPosition()));
531
- } }, { ALT: () => {
532
- const t3 = e2.CONSUME(dt);
533
- return e2.ACTION(() => this._ensureWhitespace(qe(t3.image), e2.getLexerPosition()));
534
- } }, { ALT: () => {
535
- const t3 = e2.CONSUME(ut);
536
- return e2.ACTION(() => this._ensureWhitespace(je(t3.image), e2.getLexerPosition()));
537
- } }])), e2.RULE("function", () => {
538
- const t3 = e2.CONSUME(at).image.slice(0, -1), n2 = e2.getLexerPosition(), r2 = e2.SUBRULE(e2.functionArguments);
539
- let s2 = e2.ACTION(() => this._ensureWhitespace(Pe(t3, r2), n2, true));
540
- const i2 = e2.OPTION(() => this.CONSUME(Rt));
541
- return s2 = e2.ACTION(() => (i2 || this._reportError(s2, "Missing closing parenthesis ')'", n2), this._ensureWhitespace(s2, e2.getLexerPosition(), false, true))), s2;
542
- }), e2.RULE("functionArguments", () => {
543
- const t3 = [];
544
- return e2.MANY2(() => {
545
- let n2;
546
- e2.CONSUME2(Nt), n2 = e2.ACTION(() => this._ensureWhitespace({ type: "empty", value: "" }, e2.getLexerPosition(), false, true)), t3.push(n2);
547
- }), e2.OPTION(() => {
548
- t3.push(e2.SUBRULE(e2.intersectOp)), e2.MANY(() => {
549
- let n2;
550
- e2.CONSUME1(Nt), n2 = e2.ACTION(() => this._ensureWhitespace({ type: "empty", value: "" }, e2.getLexerPosition(), false, true)), t3.push(n2), e2.OPTION3(() => {
551
- t3.pop(), t3.push(e2.SUBRULE2(e2.intersectOp));
552
- });
553
- });
554
- }), t3;
555
- }), e2.RULE("bracketedString", () => {
556
- const t3 = e2.CONSUME(zt), n2 = e2.getLexerPosition();
557
- return e2.ACTION(() => {
558
- const r2 = t3.image;
559
- let s2 = Be("", [Fe(r2.substring(1, r2.length - 1))]);
560
- return s2 = this._ensureWhitespace(s2, n2, true, false), s2 = this._ensureWhitespace(s2, e2.getLexerPosition(), false, true), s2;
561
- });
562
- }), e2.RULE("squareParen", () => {
563
- e2.CONSUME(vt);
564
- const t3 = e2.getLexerPosition();
565
- let n2 = Be("", [e2.SUBRULE(e2.structuredArgument)]);
566
- const r2 = e2.OPTION(() => this.CONSUME(Ut));
567
- return e2.ACTION(() => {
568
- r2 || this._reportError(n2, "Missing closing parenthesis ']'", t3), n2 = this._ensureWhitespace(n2, t3, true, false), n2 = this._ensureWhitespace(n2, e2.getLexerPosition(), false, true);
569
- }), n2;
570
- }), e2.RULE("namedTableReference", () => {
571
- const t3 = e2.CONSUME(lt).image.slice(0, -1), n2 = e2.getLexerPosition(), r2 = e2.SUBRULE(e2.structuredArguments);
572
- let s2 = e2.ACTION(() => this._ensureWhitespace(Be(t3, r2), n2, true));
573
- const i2 = e2.OPTION(() => this.CONSUME(Ut));
574
- return s2 = e2.ACTION(() => (i2 || this._reportError(s2, "Missing closing parenthesis ']'", n2), this._ensureWhitespace(s2, e2.getLexerPosition(), false, true))), s2;
575
- }), e2.RULE("structuredArguments", () => {
576
- const t3 = [];
577
- return e2.MANY2(() => {
578
- e2.CONSUME2(Nt), e2.ACTION(() => {
579
- t3.push(this._ensureWhitespace({ type: "empty", value: "" }, e2.getLexerPosition(), false, true));
580
- });
581
- }), e2.OPTION(() => {
582
- const n2 = e2.SUBRULE(e2.structuredArgument);
583
- e2.ACTION(() => {
584
- n2 && t3.push(n2);
585
- }), e2.MANY(() => {
586
- e2.CONSUME1(Nt), e2.OPTION3(() => {
587
- let n3 = e2.SUBRULE2(e2.structuredArgument);
588
- e2.ACTION(() => {
589
- n3 || (n3 = this._ensureWhitespace({ type: "empty", value: "" }, e2.getLexerPosition(), false, true)), t3.push(n3);
590
- });
591
- });
592
- });
593
- }), t3;
594
- }), e2.RULE("structuredArgument", () => {
595
- const t3 = e2.OPTION(() => e2.CONSUME(At)), n2 = e2.getLexerPosition(), r2 = e2.OPTION2(() => this.CONSUME(vt));
596
- let s2 = e2.OR([{ ALT: () => {
597
- const t4 = e2.CONSUME(Wt);
598
- return e2.ACTION(() => this._ensureWhitespace(Fe(t4.image), e2.getLexerPosition()));
599
- } }, { ALT: () => {
600
- const t4 = e2.CONSUME(zt);
601
- return e2.ACTION(() => this._ensureWhitespace(Fe(t4.image), e2.getLexerPosition()));
602
- } }, { ALT: () => {
603
- const t4 = e2.CONSUME(ht);
604
- return e2.ACTION(() => this._ensureWhitespace(ke(t4.image), e2.getLexerPosition()));
605
- } }, { ALT: () => {
606
- const t4 = e2.CONSUME(ot);
607
- return e2.ACTION(() => this._ensureWhitespace(Ge(t4.image), e2.getLexerPosition()));
608
- } }]);
609
- if (r2) {
610
- const t4 = e2.OPTION3(() => this.CONSUME(Rt));
611
- e2.ACTION(() => (t4 || this._reportError(s2, "Missing closing parenthesis ']'", n2), this._ensureWhitespace(s2, e2.getLexerPosition(), false, true))), s2 = { type: "structuredArg", value: null, inputs: [s2] };
612
- }
613
- return e2.ACTION(() => {
614
- t3 && (s2 = ze(t3.image, s2, true), s2 = this._ensureWhitespace(s2, e2.getLexerPosition()));
615
- }), s2;
616
- }), e2.RULE("referenceWithoutInfix", () => e2.OR([{ ALT: () => e2.SUBRULE(e2.reference) }, { ALT: () => {
617
- const t3 = e2.SUBRULE(e2.prefixSheetName), n2 = e2.SUBRULE2(e2.formula);
618
- return e2.ACTION(() => {
619
- if ((e3 = n2) && e3.isFormulaError) return n2;
620
- var e3;
621
- n2.ref && (n2.ref.sheet = t3);
622
- }), n2;
623
- } }])), e2.RULE("reference", () => {
624
- const t3 = e2.OPTION4(() => e2.CONSUME(At));
625
- let n2 = e2.OR([{ ALT: () => {
626
- const t4 = e2.CONSUME(pt), n3 = e2.getLexerPosition(), r2 = e2.OPTION(() => e2.CONSUME($t));
627
- return e2.ACTION(() => {
628
- const s2 = this._ensureWhitespace((function(e3, t5) {
629
- const n4 = e3.match(/([$]?)([A-Za-z]{1,3})([$]?)([1-9][0-9]*)/);
630
- let r3 = _e(n4[2]) - 1;
631
- const s3 = 1 === n4[1].length;
632
- let i2 = +n4[4] - 1;
633
- const o2 = 1 === n4[3].length;
634
- return s3 || r3 === Number.MIN_SAFE_INTEGER || (r3 -= t5.colIndex), o2 || i2 === Number.MIN_SAFE_INTEGER || (i2 -= t5.rowIndex), { type: "cell", value: Object.freeze({ colIndex: r3, rowIndex: i2, $colIndex: s3, $rowIndex: o2 }), inputs: null, isReference: true };
635
- })(t4.image, e2.position), n3);
636
- return r2 ? this._ensureWhitespace(We("#", s2, true), n3) : s2;
637
- });
638
- } }, { ALT: () => {
639
- const t4 = e2.CONSUME(ht);
640
- return e2.ACTION(() => this._ensureWhitespace(ke(t4.image), e2.getLexerPosition()));
641
- } }, { ALT: () => {
642
- const t4 = e2.CONSUME(mt);
643
- return e2.ACTION(() => this._ensureWhitespace((function(e3, t5) {
644
- const n3 = e3.startsWith("$");
645
- n3 && (e3 = e3.substring(1));
646
- let r2 = _e(e3) - 1;
647
- return n3 || r2 === Number.MIN_SAFE_INTEGER || (r2 -= t5.colIndex), { type: "cell", value: Object.freeze({ colIndex: r2, rowIndex: Number.MIN_SAFE_INTEGER, $colIndex: n3, $rowIndex: false }), inputs: null, isReference: true };
648
- })(t4.image, e2.position), e2.getLexerPosition()));
649
- } }, { ALT: () => {
650
- const t4 = e2.CONSUME(Et);
651
- return e2.ACTION(() => this._ensureWhitespace(be(t4.image, e2.position), e2.getLexerPosition()));
652
- } }, { ALT: () => {
653
- const t4 = e2.CONSUME(ct);
654
- return e2.ACTION(() => this._ensureWhitespace(Ye(t4.image), e2.getLexerPosition()));
655
- } }]);
656
- return e2.ACTION(() => {
657
- t3 && (n2 = ze(t3, n2, true), n2 = this._ensureWhitespace(n2, e2.getLexerPosition()));
658
- }), n2;
659
- }), e2.RULE("prefixSheetName", () => e2.OR([{ ALT: () => e2.CONSUME(ft).image.slice(0, -1) }, { ALT: () => e2.CONSUME(it).image.slice(1, -2).replace(/''/g, "'") }])), e2.performSelfAnalysis();
660
- }
661
- _reportError(e2, t2, n2 = void 0, r2 = "SyntaxError") {
662
- void 0 === n2 && (n2 = this.getLexerPosition()), e2.error = true, this.astErrors.push({ name: r2, message: t2, previousToken: this.input[n2], ast: e2 });
663
- }
664
- _ensureWhitespace(e2, t2, n2 = false, r2 = false) {
665
- if (!e2) return console.warn("node is null"), e2;
666
- const s2 = this.input, i2 = s2[t2];
667
- if (e2.image || (e2.image = i2.image), !r2) {
668
- const n3 = i2.startOffset, r3 = s2[t2 - 1], o2 = r3?.endOffset ?? -1;
669
- o2 + 1 < n3 && (e2.wsBefore = " ".repeat(n3 - o2 - 1));
670
- }
671
- if (!n2) {
672
- const n3 = i2.endOffset, r3 = s2[t2 + 1], o2 = r3?.startOffset ?? this.inputTextLength;
673
- n3 + 1 < o2 && (e2.wsAfter = " ".repeat(o2 - n3 - 1));
674
- }
675
- return e2;
676
- }
677
- _createAST(e2, t2) {
678
- const n2 = (function(e3) {
679
- const t3 = ae.tokenize(e3);
680
- if (t3.errors.length > 0) {
681
- const n3 = t3.errors[0], r3 = n3.line, s3 = n3.column;
682
- let i3 = "\n" + e3.split("\n")[r3 - 1] + "\n";
683
- throw i3 += Array(s3 - 1).fill(" ").join("") + "^\n", n3.message = i3 + `Error at position ${r3}:${s3}
684
- ` + n3.message, n3.errorLocation = { line: r3, column: s3 }, new c.Parse(n3.message, { line: r3, column: s3, offset: n3.offset, length: n3.length });
685
- }
686
- return t3;
687
- })(t2);
688
- let r2;
689
- if (!n2) return r2 = { type: "text", value: t2 }, r2;
690
- const s2 = n2.tokens;
691
- this.input = s2, this.inputTextLength = t2.length;
692
- const i2 = e2.getPosition();
693
- return this.position = i2, this.astErrors = [], this.reset(), r2 = this.intersectOp(), r2 = De(r2, (e3, t3) => {
694
- let n3 = e3.type;
695
- if ("function" === n3 && e3.value && e3.value.toUpperCase().startsWith(Qe)) {
696
- const t4 = e3.value.substring(6);
697
- let r4 = e3.image.substring(6), s3 = e3;
698
- "ANCHORARRAY" === t4 ? (s3 = We("#", e3.inputs[0], true), r4 = "#") : "SINGLE" === t4 ? (s3 = ze("@", e3.inputs[0], true), r4 = "@") : s3 = Pe(t4, e3.inputs), Ke(s3, e3), s3.image = r4, n3 = (e3 = s3).type;
699
- }
700
- const r3 = t3?.isReference;
701
- if (r3) {
702
- const n4 = t3.value;
703
- if ((":" === n4 || ".:." === n4 || ".:" === n4 || ":." === n4) && Number.isInteger(e3.value)) {
704
- const n5 = t3.inputs[0] === e3 ? t3.inputs[1] : t3.inputs[0];
705
- if (n5 && Number.isInteger(n5.value)) {
706
- const t4 = be(e3.image, i2);
707
- return Ke(t4, e3), t4;
708
- }
709
- }
710
- } else if ("cell" === n3) {
711
- const t4 = e3.value;
712
- if (t4.rowIndex === Number.MIN_SAFE_INTEGER || t4.colIndex >= 16384) {
713
- const t5 = ke(e3.image);
714
- return Ke(t5, e3), t5;
715
- }
716
- }
717
- return e3;
718
- }), r2;
719
- }
720
- build(e2, t2) {
721
- if (0 === t2.length) throw Error("Input must not be empty.");
722
- let n2, r2, s2;
723
- try {
724
- n2 = this._createAST(e2, t2);
725
- } catch (e3) {
726
- s2 = e3 instanceof c.Parse ? e3 : new c.Parse(e3.message, e3);
727
- }
728
- const i2 = this.errors;
729
- if (i2.length > 0) {
730
- s2 = He(i2[0], t2);
731
- }
732
- const o2 = this.astErrors;
733
- if (o2.length > 0) {
734
- s2 = He(o2[0], t2);
735
- }
736
- return r2 = n2 ? Ze(n2, s2) : { ast: null, evaluations: h.EmptyArray, executions: h.EmptyArray, precedentsAbsolute: h.EmptyArray, precedentsExecute: h.EmptyArray, precedentsNamed: null, precedentsRelative: h.EmptyArray, precedentsRoot: h.EmptyArray, references: h.EmptyArray, tokens: h.EmptyArray, error: s2 }, r2;
737
- }
738
- }
739
- class Zt {
740
- constructor(e2, t2) {
741
- this._options = e2, this._compiled = t2;
742
- }
743
- getTextAt(e2, t2, n2 = false) {
744
- return n2 ? s(this._compiled.tokens) : r(this._compiled.tokens, e2, t2);
745
- }
746
- getTokens() {
747
- return this._compiled.tokens;
748
- }
749
- getError() {
750
- return this._compiled.error ?? null;
751
- }
752
- isEquals(e2) {
753
- if (!(e2 && e2 instanceof Zt)) return false;
754
- if (this === e2) return true;
755
- const t2 = this._compiled.tokens, n2 = e2._compiled.tokens;
756
- if (t2.length !== n2.length) return false;
757
- return s(t2) === s(n2);
758
- }
759
- getReferences() {
760
- const e2 = this._compiled, t2 = e2.references, n2 = t2.length;
761
- if (0 === n2) return h.EmptyArray;
762
- const r2 = e2.precedentsExecute, s2 = e2.precedentsRelative, i2 = new Array(n2);
763
- for (let o2 = 0; o2 < n2; o2++) {
764
- const n3 = r2[t2[o2]], a2 = n3.inputs;
765
- if (a2 && 2 === a2.length) {
766
- const e3 = s2[r2[a2[0]].value], t3 = s2[r2[a2[1]].value];
767
- i2[o2] = { colStart: e3.colStart, rowStart: e3.rowStart, colEnd: t3.colEnd, rowEnd: t3.rowEnd, $colStart: e3.$colStart, $rowStart: e3.$rowStart, $colEnd: t3.$colEnd, $rowEnd: t3.$rowEnd, sheetName: e3.sheetName };
768
- } else if ("cell" === n3.node.type) {
769
- const e3 = s2[n3.value];
770
- i2[o2] = { ...e3 };
771
- } else if ("named" === n3.op) {
772
- const t3 = e2.precedentsNamed;
773
- i2[o2] = t3[n3.value];
774
- } else "error" === n3.op && (i2[o2] = n3.node.value);
775
- }
776
- return i2;
777
- }
778
- setReferenceAt(e2, t2) {
779
- const n2 = this._compiled, r2 = n2.references;
780
- if (0 === r2.length) return h.EmptyArray;
781
- const s2 = n2.precedentsExecute, i2 = r2[e2];
782
- if (void 0 === i2) throw new Error(`Invalid reference index: ${e2}`);
783
- const o2 = s2[i2], a2 = o2.node, l2 = a2.inputs ?? h.EmptyArray;
784
- let u2, c2, p2 = false;
785
- t2 && (u2 = { colIndex: t2.colStart, rowIndex: t2.rowStart, $colIndex: t2.$colStart ?? false, $rowIndex: t2.$rowStart ?? false }, t2.sheetName && (u2.sheetName = t2.sheetName), p2 = !f.isSingleCell(t2), p2 && (c2 = { colIndex: t2.colEnd, rowIndex: t2.rowEnd, $colIndex: t2.$colEnd ?? false, $rowIndex: t2.$rowEnd ?? false }, t2.colEnd === Number.MAX_SAFE_INTEGER && (c2.colIndex = Number.MIN_SAFE_INTEGER), t2.rowEnd === Number.MAX_SAFE_INTEGER && (c2.rowIndex = Number.MIN_SAFE_INTEGER)));
786
- const g2 = 2 === l2.length;
787
- let d2 = -1, m2 = -1;
788
- if (g2) d2 = l2[0].evalIndex, m2 = l2[1].evalIndex;
789
- else {
790
- if ("cell" !== a2.type) throw "named" === o2.op ? new Error("Cannot setReference for a named reference") : new Error(`Invalidate reference index: ${e2}`);
791
- d2 = a2.evalIndex;
792
- }
793
- const E2 = this._compiled.ast, A2 = De(E2, (e3) => {
794
- if (!e3 || !e3.isReference) return;
795
- const n3 = e3.type;
796
- if (!t2 && Je.includes(e3.value)) {
797
- const e4 = l2[0], t3 = l2[1];
798
- let n4 = e4.evalIndex === d2, r4 = t3.evalIndex === m2;
799
- if (n4 || r4) {
800
- const e5 = Ye();
801
- return e5.image = "#REF!", e5;
802
- }
803
- }
804
- if (!("cell" === n3 || "error" === n3)) return;
805
- const r3 = e3.evalIndex;
806
- let s3, i3 = r3 === d2;
807
- if (i3 || r3 === m2) {
808
- if (t2) if (g2 === p2) {
809
- let t3 = i3 ? u2 : c2;
810
- s3 = { ...e3 }, s3.value = t3, s3.image = null;
811
- } else s3 = p2 ? $e(":", Me(u2), Me(c2), true) : Me(u2);
812
- else s3 = Ye(), s3.image = "#REF!";
813
- return s3;
814
- }
815
- });
816
- if (A2 === E2) return this;
817
- const N2 = Ze(A2, this._compiled.error), I2 = this._options;
818
- return new Zt(I2, N2);
819
- }
820
- _resolveNamed(e2, t2, n2, r2) {
821
- const s2 = this._options?.getNamed;
822
- if (!s2) return c.BuiltIn.Name;
823
- let o2 = s2?.(e2, this._options.getSheetName?.())?.[0];
824
- return o2 ? (o2.isFormulaError || (o2 = i(o2, t2, n2, r2)), o2) : c.BuiltIn.Name;
825
- }
826
- getDirectPrecedentsAt(e2, t2, n2 = false, r2, s2) {
827
- const o2 = this._compiled, a2 = o2.precedentsRoot, l2 = a2.length;
828
- if (0 === l2) return h.EmptyArray;
829
- const u2 = o2.precedentsRelative, p2 = o2.precedentsAbsolute, g2 = u2.length;
830
- for (let n3 = 0; n3 < g2; n3++) {
831
- const r3 = u2[n3];
832
- let s3 = p2[n3], o3 = i(r3, e2, t2, s3);
833
- p2[n3] = o3;
834
- }
835
- let d2 = false;
836
- const m2 = o2.precedentsExecute, E2 = m2.length, A2 = Ht;
837
- for (let n3 = 0; n3 < E2; n3++) {
838
- const r3 = m2[n3], s3 = r3.op;
839
- if (!s3) {
840
- const e3 = p2[r3.value];
841
- A2[r3.index] = e3;
842
- continue;
843
- }
844
- if ("named" === s3) {
845
- d2 = true, A2[r3.index] = this._resolveNamed(r3.node.value, e2, t2);
846
- continue;
847
- }
848
- if ("error" === s3) {
849
- A2[r3.index] = r3.node.value;
850
- continue;
851
- }
852
- if ("@" === s3 || "#" === s3) {
853
- A2[r3.index] = A2[r3.inputs[0]];
854
- continue;
855
- }
856
- const i2 = r3.inputs;
857
- if (!i2) continue;
858
- let o3 = A2[i2[0]];
859
- if (void 0 === o3) {
860
- A2[r3.index] = c.BuiltIn.Value;
861
- continue;
862
- }
863
- if (o3.isFormulaError) {
864
- A2[r3.index] = o3;
865
- continue;
866
- }
867
- let a3, l3 = A2[i2[1]];
868
- void 0 !== l3 ? l3.isFormulaError ? A2[r3.index] = l3 : (" " === s3 ? a3 = f.intersectRanges(o3, l3) : ":" !== s3 && ".:." !== s3 && ":." !== s3 && ".:" !== s3 || (a3 = A2[r3.index] = f.unionRanges(o3, l3)), A2[r3.index] = a3 ?? c.BuiltIn.Null) : A2[r3.index] = c.BuiltIn.Value;
869
- }
870
- const N2 = new Array(l2);
871
- for (let e3 = 0; e3 < l2; e3++) {
872
- const t3 = a2[e3], n3 = A2[t3];
873
- if (N2[e3] = void 0 !== n3?.rowStart ? { ...n3 } : n3, r2 || s2) {
874
- const i2 = m2[t3];
875
- d2 && "named" === i2.op ? (r2 && (r2[e3] = n3.$colStart || n3.$colEnd), s2 && (s2[e3] = n3.$rowStart || n3.$rowEnd)) : (r2 && (r2[e3] = i2.hasVerticalAbs), s2 && (s2[e3] = i2.hasHorizontalAbs));
876
- }
877
- }
878
- return N2;
879
- }
880
- evaluate(e2, t2, n2) {
881
- const r2 = e2.getPosition(), s2 = r2?.rowIndex ?? 0, o2 = r2?.colIndex ?? 0;
882
- let a2 = this._compiled;
883
- if (void 0 !== t2) {
884
- let e3;
885
- if (De(a2.ast, (n3) => {
886
- n3.evalIndex === t2 && (e3 = n3);
887
- }), !e3) throw new Error(`Invalid evalIndex: ${t2}`);
888
- a2 = Ze(e3, a2.error);
889
- }
890
- if (a2.error) return a2.error;
891
- const u2 = a2.evaluations, p2 = a2.executions;
892
- let f2, h2;
893
- n2 || (n2 = this._resolvePrecedents(e2));
894
- const g2 = a2.precedentsExecute, d2 = a2.precedentsRelative, m2 = a2.precedentsAbsolute, E2 = g2.length;
895
- for (let t3 = 0; t3 < E2; t3++) {
896
- const n3 = g2[t3], r3 = n3.op;
897
- if (r3) {
898
- if ("named" === r3) {
899
- const t4 = n3.node;
900
- let r4 = this._resolveNamed(n3.node.value, s2, o2);
901
- void 0 !== r4?.colStart && (r4 = e2.getReference(r4)), u2[t4.evalIndex] = r4;
902
- } else if ("error" === r3) {
903
- const e3 = n3.node;
904
- u2[e3.evalIndex] = n3.node.value;
905
- }
906
- } else {
907
- const e3 = d2[n3.value];
908
- let r4 = m2[t3];
909
- const a3 = i(e3, s2, o2, r4), l2 = n3.node;
910
- u2[l2.evalIndex] = a3;
911
- }
912
- }
913
- const A2 = a2.precedentsRoot, N2 = A2.length;
914
- if (N2 !== n2.length) return c.BuiltIn.Parse;
915
- for (let e3 = 0; e3 < N2; e3++) {
916
- const t3 = g2[A2[e3]].node;
917
- let r3 = n2[e3];
918
- r3.isIRange && "cell" === t3.type && r3.size > 1 && (r3 = r3.getValueAt(0, 0) ?? null), u2[t3.evalIndex] = r3;
919
- }
920
- let I2;
921
- const O2 = (t3) => {
922
- const n3 = t3.inputs, r3 = n3 ? n3.length : 0;
923
- let s3;
924
- switch (t3.type) {
925
- case "infix":
926
- const i2 = t3.value;
927
- let o3 = u2[n3[0].evalIndex], a3 = u2[n3[1].evalIndex];
928
- if ("+" === i2 && "number" == typeof o3 && "number" == typeof a3) {
929
- const e3 = o3 + a3;
930
- return Math.abs(e3) < 99e-14 ? 0 : e3;
931
- }
932
- if ("-" === i2 && "number" == typeof o3 && "number" == typeof a3) {
933
- const e3 = o3 - a3;
934
- return Math.abs(e3) < 99e-14 ? 0 : e3;
935
- }
936
- if (o3 && o3.isFormulaError) return o3;
937
- if (a3 && a3.isFormulaError) return a3;
938
- const p3 = t3.fn;
939
- return s3 = p3 ? p3(e2, o3, a3) : c.BuiltIn.Value, s3 = l(s3, null), s3;
940
- case "function":
941
- I2 || (I2 = new Array(r3)), I2.length !== r3 && (I2.length = r3);
942
- for (let e3 = 0; e3 < r3; e3++) I2[e3] = u2[n3[e3].evalIndex];
943
- return s3 = this._callFunction(e2, t3, I2), s3 && "function" == typeof s3.then ? s3.then((n4) => {
944
- n4 = l(n4, e2), s3 instanceof c.Known && (h2 = s3), u2[t3.evalIndex] = n4;
945
- }).catch((e3) => {
946
- const n4 = e3 instanceof c.Known ? e3 : new c.Value("Uncaught error", { cause: e3 });
947
- u2[t3.evalIndex] = n4;
948
- }) : s3 instanceof c.Known && (h2 = s3), s3;
949
- case "prefix":
950
- case "postfix":
951
- let f3 = u2[n3[0].evalIndex];
952
- if (f3 && f3.isFormulaError) return f3;
953
- const g3 = t3.fn;
954
- return s3 = g3 ? g3(e2, f3) : c.BuiltIn.Value, s3;
955
- case "paren":
956
- if (1 === r3) return u2[n3[0].evalIndex];
957
- {
958
- const e3 = new Array(r3);
959
- for (let t4 = 0; t4 < r3; t4++) e3[t4] = u2[n3[t4].evalIndex];
960
- return e3;
961
- }
962
- case "named":
963
- return null;
964
- case "empty":
965
- return;
966
- }
967
- };
968
- let x2 = p2.length;
969
- for (let e3 = 0; e3 < x2; e3++) {
970
- const t3 = p2[e3];
971
- if (h2) return h2;
972
- if (f2) f2 = f2.then(() => {
973
- const e4 = O2(t3);
974
- return u2[t3.evalIndex] = e4, e4;
975
- });
976
- else {
977
- const e4 = O2(t3);
978
- u2[t3.evalIndex] = e4, e4 && "function" == typeof e4.then && (f2 = e4);
979
- }
980
- }
981
- if (f2) return f2.then(() => {
982
- const t3 = u2[u2.length - 1];
983
- return this._finalizeReturnValue(e2, t3);
984
- });
985
- const S2 = u2[u2.length - 1];
986
- return this._finalizeReturnValue(e2, S2);
987
- }
988
- _resolvePrecedents(e2) {
989
- const t2 = e2.getPosition(), n2 = t2?.rowIndex ?? 0, r2 = t2?.colIndex ?? 0;
990
- const s2 = this.getDirectPrecedentsAt(n2, r2), i2 = s2.length;
991
- let o2;
992
- if (i2 > 0) {
993
- o2 = new Array(i2);
994
- for (let t3 = 0; t3 < i2; t3++) {
995
- const n3 = s2[t3];
996
- if (n3 instanceof c.Known) o2[t3] = n3;
997
- else if (Array.isArray(n3)) {
998
- const r3 = new Array(n3.length);
999
- for (let t4 = 0; t4 < n3.length; t4++) r3[t4] = e2.getReference(n3[t4]);
1000
- o2[t3] = r3;
1001
- } else o2[t3] = e2.getReference(n3);
1002
- }
1003
- } else o2 = h.EmptyArray;
1004
- return o2;
1005
- }
1006
- wrapImplicit(e2, t2, n2) {
1007
- const r2 = this._compiled.ast;
1008
- if (!r2 || !r2.isReference) return this;
1009
- if ("cell" === r2.type) return this;
1010
- if ("@" === r2.value) return this;
1011
- if (!n2) return this;
1012
- const s2 = o(t2) + a(e2);
1013
- if (n2.has(s2)) return this;
1014
- const i2 = Ze(ze("@", r2, true), this._compiled.error);
1015
- return new Zt(this._options, i2);
1016
- }
1017
- _callFunction(e2, t2, n2) {
1018
- const r2 = t2?.cacheFn ?? e2.getFunction(t2.value);
1019
- if (!r2) return new c.Parse();
1020
- const s2 = r2.isBuiltIn();
1021
- let i2;
1022
- s2 ? t2.cacheFn = r2 : this._context = e2;
1023
- try {
1024
- i2 = r2.execute(...n2);
1025
- } catch (e3) {
1026
- i2 = e3 instanceof c.Known ? e3 : new c.Value(e3.message, { cause: e3 });
1027
- }
1028
- return s2 || (this._context = null), void 0 === i2 ? new c.Parse() : i2;
1029
- }
1030
- _finalizeReturnValue(e2, t2) {
1031
- if (t2 && void 0 !== t2.colStart && (t2 = e2.getValueAt(t2.rowStart, t2.colStart)), Array.isArray(t2)) if (1 === t2.length && Array.isArray(t2[0]) && 1 === t2[0].length) t2 = t2[0][0], Array.isArray(t2) && (t2 = c.BuiltIn.Value);
1032
- else try {
1033
- t2 = e2.getRange(t2);
1034
- } catch (e3) {
1035
- t2 = c.BuiltIn.Value;
1036
- }
1037
- return t2?.isIRange ? 1 === t2.size ? (t2 = t2.getValueAt(0, 0, Kt), null === (t2 = l(t2, e2)) && (t2 = 0)) : t2 = t2.fillEmpty(0) : null === (t2 = l(t2, e2)) && (t2 = 0), t2;
1038
- }
1039
- get [Symbol.toStringTag]() {
1040
- return "[FormulaBlock]";
1041
- }
1042
- toString() {
1043
- const e2 = this._compiled;
1044
- if (e2.error) return e2.error.toString();
1045
- const t2 = this._context;
1046
- if (t2) {
1047
- const e3 = t2.getPosition();
1048
- return this.getTextAt(e3.rowIndex, e3.colIndex);
1049
- }
1050
- return s(e2.tokens);
1051
- }
1052
- }
1053
- const Ht = new Array(20);
1054
- for (let e2 = 0; e2 < Ht.length; e2++) Ht[e2] = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0, sheetName: null };
1055
- const Kt = { type: null };
1056
- class Qt {
1057
- constructor(e2) {
1058
- this._options = { getEntireCoords: u, ...e2 }, this._astBuilder = new Dt();
1059
- }
1060
- parse(e2, t2) {
1061
- const n2 = e2.getPosition();
1062
- n2.sheetName;
1063
- const r2 = this._astBuilder.build(e2, t2);
1064
- return new Zt(this._options, r2);
1065
- }
1066
- eval(e2, t2) {
1067
- return this.parse(e2, t2).evaluate(e2);
1068
- }
1069
- }
1070
- export {
1071
- Qt as FormulaParser
1072
- };