ooxml-core 1.8.3 → 1.9.0

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 (308) hide show
  1. package/dist/PptxHandler-AT7FVG5Q.mjs +2 -0
  2. package/dist/{PptxHandler-BL4B7CZO.mjs → PptxHandler-EX4WBIQQ.mjs} +2 -2
  3. package/dist/PptxHandler-VFSCECPL.cjs +11 -0
  4. package/dist/automation/index.cjs +7380 -4682
  5. package/dist/automation/index.mjs +7380 -4682
  6. package/dist/chunk-AT66SA5M.cjs +44423 -0
  7. package/dist/{chunk-TTPZITQN.mjs → chunk-FIELY5PI.mjs} +1 -1
  8. package/dist/{chunk-ZAP5WLEN.mjs → chunk-IGOA57LE.mjs} +1 -1
  9. package/dist/chunk-LCS3J3QI.mjs +87604 -0
  10. package/dist/{chunk-NIHPA63A.mjs → chunk-M76PHYRR.mjs} +54 -37
  11. package/dist/chunk-OB277ZGE.mjs +44107 -0
  12. package/dist/{chunk-GAGSCAR3.mjs → chunk-OXHMZS7B.mjs} +552 -178
  13. package/dist/chunk-SWF7KVL5.cjs +87610 -0
  14. package/dist/{chunk-Z7IQR4S4.mjs → chunk-WSO4T2LJ.mjs} +246 -21
  15. package/dist/docx/block-parser.d.ts.map +1 -1
  16. package/dist/docx/cell-blocks.d.ts +4 -0
  17. package/dist/docx/cell-blocks.d.ts.map +1 -0
  18. package/dist/docx/document-paragraphs.d.ts.map +1 -1
  19. package/dist/docx/document-parts.d.ts +2 -0
  20. package/dist/docx/document-parts.d.ts.map +1 -1
  21. package/dist/docx/embedded.cjs +189 -20
  22. package/dist/docx/embedded.mjs +189 -20
  23. package/dist/docx/index.cjs +219 -24
  24. package/dist/docx/index.mjs +219 -24
  25. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  26. package/dist/docx/layout/adapter.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-paragraph.d.ts +5 -0
  28. package/dist/docx/layout/flow-paragraph.d.ts.map +1 -1
  29. package/dist/docx/layout/flow-table.d.ts +2 -1
  30. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  31. package/dist/docx/layout/footnote-columns.d.ts +22 -0
  32. package/dist/docx/layout/footnote-columns.d.ts.map +1 -0
  33. package/dist/docx/layout/footnote-flow.d.ts +27 -0
  34. package/dist/docx/layout/footnote-flow.d.ts.map +1 -0
  35. package/dist/docx/layout/footnote-split.d.ts +7 -0
  36. package/dist/docx/layout/footnote-split.d.ts.map +1 -0
  37. package/dist/docx/layout/index.cjs +1099 -92
  38. package/dist/docx/layout/index.mjs +1099 -92
  39. package/dist/docx/layout/input.d.ts +17 -1
  40. package/dist/docx/layout/input.d.ts.map +1 -1
  41. package/dist/docx/layout/legacy-footnote-flow.d.ts +18 -0
  42. package/dist/docx/layout/legacy-footnote-flow.d.ts.map +1 -0
  43. package/dist/docx/layout/line-metrics.d.ts.map +1 -1
  44. package/dist/docx/layout/page-cursor.d.ts +13 -8
  45. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  46. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  47. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  48. package/dist/docx/layout/paragraph-tokens.d.ts +2 -0
  49. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  50. package/dist/docx/layout/reference-footnotes.d.ts +7 -0
  51. package/dist/docx/layout/reference-footnotes.d.ts.map +1 -0
  52. package/dist/docx/layout/result.d.ts +31 -0
  53. package/dist/docx/layout/result.d.ts.map +1 -1
  54. package/dist/docx/layout/section-flow.d.ts +2 -0
  55. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  56. package/dist/docx/layout/table-cell-layout.d.ts +11 -0
  57. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -0
  58. package/dist/docx/layout/table-footnotes.d.ts +27 -0
  59. package/dist/docx/layout/table-footnotes.d.ts.map +1 -0
  60. package/dist/docx/layout/table-layout.d.ts +10 -4
  61. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  62. package/dist/docx/load/index.cjs +194 -25
  63. package/dist/docx/load/index.mjs +194 -25
  64. package/dist/docx/model-run.d.ts +2 -0
  65. package/dist/docx/model-run.d.ts.map +1 -1
  66. package/dist/docx/model.d.ts +7 -0
  67. package/dist/docx/model.d.ts.map +1 -1
  68. package/dist/docx/notes.d.ts +5 -0
  69. package/dist/docx/notes.d.ts.map +1 -1
  70. package/dist/docx/parse-table.d.ts.map +1 -1
  71. package/dist/docx/parse.d.ts.map +1 -1
  72. package/dist/docx/save.d.ts.map +1 -1
  73. package/dist/docx/section-model.d.ts +2 -0
  74. package/dist/docx/section-model.d.ts.map +1 -1
  75. package/dist/docx/sections.d.ts.map +1 -1
  76. package/dist/docx/settings.d.ts +2 -0
  77. package/dist/docx/settings.d.ts.map +1 -1
  78. package/dist/docx/table-model.d.ts +3 -1
  79. package/dist/docx/table-model.d.ts.map +1 -1
  80. package/dist/docx/ui/index.cjs +55 -0
  81. package/dist/docx/ui/index.d.ts +1 -0
  82. package/dist/docx/ui/index.d.ts.map +1 -1
  83. package/dist/docx/ui/index.mjs +55 -1
  84. package/dist/docx/ui/table-structure-guard.d.ts +4 -0
  85. package/dist/docx/ui/table-structure-guard.d.ts.map +1 -0
  86. package/dist/docx/write-footnote-columns.d.ts +3 -0
  87. package/dist/docx/write-footnote-columns.d.ts.map +1 -0
  88. package/dist/docx/write-notes.d.ts.map +1 -1
  89. package/dist/docx/write-run.d.ts.map +1 -1
  90. package/dist/docx/write-sections.d.ts.map +1 -1
  91. package/dist/index.cjs +8 -5
  92. package/dist/index.mjs +8 -5
  93. package/dist/opc/clone-part-graph.d.ts +4 -0
  94. package/dist/opc/clone-part-graph.d.ts.map +1 -1
  95. package/dist/opc/index.cjs +8 -5
  96. package/dist/opc/index.mjs +8 -5
  97. package/dist/pptx/automation/index.cjs +621 -207
  98. package/dist/pptx/automation/index.d.ts +3 -3
  99. package/dist/pptx/automation/index.mjs +5 -5
  100. package/dist/pptx/chunks/{index-Cn-GzYGp.d.ts → index-B4cnSPNz.d.ts} +33 -4
  101. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +1 -0
  102. package/dist/pptx/chunks/{index-CKIUurnd.d.ts → index-BZh-IMkN.d.ts} +14 -9
  103. package/dist/pptx/chunks/{index-CKIUurnd.d.ts.map → index-BZh-IMkN.d.ts.map} +1 -1
  104. package/dist/pptx/chunks/{text-operations-BHfAm5K9.d.ts → text-operations-BLodkuXE.d.ts} +29 -12
  105. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +1 -0
  106. package/dist/pptx/cli/index.cjs +622 -213
  107. package/dist/pptx/cli/index.d.ts +1 -1
  108. package/dist/pptx/cli/index.mjs +4 -4
  109. package/dist/pptx/converter/index.cjs +53 -36
  110. package/dist/pptx/converter/index.d.ts +1 -1
  111. package/dist/pptx/converter/index.mjs +2 -2
  112. package/dist/pptx/editor/render/find-replace.cjs +416 -45
  113. package/dist/pptx/editor/render/find-replace.d.ts +35 -4
  114. package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
  115. package/dist/pptx/editor/render/find-replace.mjs +416 -46
  116. package/dist/pptx/editor/render/slide-operations.cjs +87 -0
  117. package/dist/pptx/editor/render/slide-operations.d.ts +17 -1
  118. package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
  119. package/dist/pptx/editor/render/slide-operations.mjs +83 -1
  120. package/dist/pptx/editor/render/slide-search.cjs +6 -10
  121. package/dist/pptx/editor/render/slide-search.d.ts +1 -1
  122. package/dist/pptx/editor/render/slide-search.mjs +6 -10
  123. package/dist/pptx/editor/render/template-editing.d.ts +1 -1
  124. package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
  125. package/dist/pptx/index.cjs +889 -237
  126. package/dist/pptx/index.d.ts +4 -4
  127. package/dist/pptx/index.mjs +5 -5
  128. package/dist/teams/index.cjs +672 -37
  129. package/dist/teams/index.mjs +672 -37
  130. package/dist/visio/accessibility.d.ts +10 -0
  131. package/dist/visio/accessibility.d.ts.map +1 -0
  132. package/dist/visio/cell-formula.d.ts +2 -0
  133. package/dist/visio/cell-formula.d.ts.map +1 -1
  134. package/dist/visio/connector-curve-aligned.d.ts +5 -0
  135. package/dist/visio/connector-curve-aligned.d.ts.map +1 -0
  136. package/dist/visio/connector-curve-spans.d.ts +14 -0
  137. package/dist/visio/connector-curve-spans.d.ts.map +1 -0
  138. package/dist/visio/connector-jumps.d.ts +5 -0
  139. package/dist/visio/connector-jumps.d.ts.map +1 -0
  140. package/dist/visio/connector-route-walk.d.ts +2 -1
  141. package/dist/visio/connector-route-walk.d.ts.map +1 -1
  142. package/dist/visio/edit-alt-text-scope.d.ts +5 -0
  143. package/dist/visio/edit-alt-text-scope.d.ts.map +1 -0
  144. package/dist/visio/edit-alt-text.d.ts +3 -0
  145. package/dist/visio/edit-alt-text.d.ts.map +1 -0
  146. package/dist/visio/edit-commands.d.ts +7 -2
  147. package/dist/visio/edit-commands.d.ts.map +1 -1
  148. package/dist/visio/edit-formatting-commands.d.ts +5 -0
  149. package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
  150. package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
  151. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  152. package/dist/visio/edit-line-jump-cache.d.ts +4 -0
  153. package/dist/visio/edit-line-jump-cache.d.ts.map +1 -0
  154. package/dist/visio/edit-master-index.d.ts.map +1 -1
  155. package/dist/visio/edit-metadata-commands.d.ts +10 -2
  156. package/dist/visio/edit-metadata-commands.d.ts.map +1 -1
  157. package/dist/visio/edit-metadata.d.ts +3 -1
  158. package/dist/visio/edit-metadata.d.ts.map +1 -1
  159. package/dist/visio/edit-page-alt-text.d.ts +4 -0
  160. package/dist/visio/edit-page-alt-text.d.ts.map +1 -0
  161. package/dist/visio/edit-page-layout.d.ts.map +1 -1
  162. package/dist/visio/edit-page-rename.d.ts.map +1 -1
  163. package/dist/visio/edit-page-setup-commands.d.ts +7 -1
  164. package/dist/visio/edit-page-setup-commands.d.ts.map +1 -1
  165. package/dist/visio/edit-page-size.d.ts.map +1 -1
  166. package/dist/visio/edit-pages.d.ts.map +1 -1
  167. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  168. package/dist/visio/edit-scope.d.ts.map +1 -1
  169. package/dist/visio/edit-shape-create.d.ts.map +1 -1
  170. package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
  171. package/dist/visio/edit-style-admission.d.ts.map +1 -1
  172. package/dist/visio/edit-text.d.ts.map +1 -1
  173. package/dist/visio/edit.d.ts +1 -1
  174. package/dist/visio/edit.d.ts.map +1 -1
  175. package/dist/visio/index.cjs +1091 -233
  176. package/dist/visio/index.d.ts +2 -1
  177. package/dist/visio/index.d.ts.map +1 -1
  178. package/dist/visio/index.mjs +1091 -234
  179. package/dist/visio/line-jumps.d.ts +1 -5
  180. package/dist/visio/line-jumps.d.ts.map +1 -1
  181. package/dist/visio/model.d.ts +13 -0
  182. package/dist/visio/model.d.ts.map +1 -1
  183. package/dist/visio/page-layout.d.ts +11 -2
  184. package/dist/visio/page-layout.d.ts.map +1 -1
  185. package/dist/visio/parser.d.ts.map +1 -1
  186. package/dist/visio/shape-metadata.d.ts +6 -0
  187. package/dist/visio/shape-metadata.d.ts.map +1 -1
  188. package/dist/visio/shapes.d.ts.map +1 -1
  189. package/dist/visio/text-field-case.d.ts +2 -0
  190. package/dist/visio/text-field-case.d.ts.map +1 -0
  191. package/dist/visio/text-field-display.d.ts.map +1 -1
  192. package/dist/visio/text-field-numeric.d.ts +4 -0
  193. package/dist/visio/text-field-numeric.d.ts.map +1 -0
  194. package/dist/visio/ui/connector-preview.d.ts +1 -1
  195. package/dist/visio/ui/connector-preview.d.ts.map +1 -1
  196. package/dist/visio/ui/data-graphic-rules.d.ts +2 -0
  197. package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
  198. package/dist/visio/ui/data-graphics.d.ts +3 -2
  199. package/dist/visio/ui/data-graphics.d.ts.map +1 -1
  200. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  201. package/dist/visio/ui/index.cjs +16898 -15855
  202. package/dist/visio/ui/index.mjs +16898 -15856
  203. package/dist/visio/ui/scene-details.d.ts.map +1 -1
  204. package/dist/visio/ui/scene-validation.d.ts.map +1 -1
  205. package/dist/visio/ui/snapshot-scene.d.ts +2 -1
  206. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  207. package/dist/visio/xml-attribute-whitespace.d.ts +5 -0
  208. package/dist/visio/xml-attribute-whitespace.d.ts.map +1 -0
  209. package/dist/xlsx/edit/index.d.ts +1 -0
  210. package/dist/xlsx/edit/index.d.ts.map +1 -1
  211. package/dist/xlsx/edit/insert-guard.d.ts.map +1 -1
  212. package/dist/xlsx/edit/merge.d.ts.map +1 -1
  213. package/dist/xlsx/edit/page-breaks.d.ts +5 -0
  214. package/dist/xlsx/edit/page-breaks.d.ts.map +1 -0
  215. package/dist/xlsx/edit/pivots.d.ts +8 -0
  216. package/dist/xlsx/edit/pivots.d.ts.map +1 -0
  217. package/dist/xlsx/edit/print-titles.d.ts +7 -0
  218. package/dist/xlsx/edit/print-titles.d.ts.map +1 -0
  219. package/dist/xlsx/edit/session.d.ts.map +1 -1
  220. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  221. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
  222. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
  223. package/dist/xlsx/edit/sparkline-ranges.d.ts +11 -0
  224. package/dist/xlsx/edit/sparkline-ranges.d.ts.map +1 -0
  225. package/dist/xlsx/edit/sparkline-xml.d.ts +13 -0
  226. package/dist/xlsx/edit/sparkline-xml.d.ts.map +1 -0
  227. package/dist/xlsx/edit/sparklines.d.ts +16 -0
  228. package/dist/xlsx/edit/sparklines.d.ts.map +1 -0
  229. package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
  230. package/dist/xlsx/edit/tables.d.ts.map +1 -1
  231. package/dist/xlsx/edit/types.d.ts +22 -1
  232. package/dist/xlsx/edit/types.d.ts.map +1 -1
  233. package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
  234. package/dist/xlsx/index.cjs +3415 -1374
  235. package/dist/xlsx/index.d.ts +1 -0
  236. package/dist/xlsx/index.d.ts.map +1 -1
  237. package/dist/xlsx/index.mjs +3396 -1375
  238. package/dist/xlsx/layout/cell-view.d.ts +2 -0
  239. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  240. package/dist/xlsx/layout/header-footer.d.ts +58 -0
  241. package/dist/xlsx/layout/header-footer.d.ts.map +1 -0
  242. package/dist/xlsx/layout/index.d.ts +5 -0
  243. package/dist/xlsx/layout/index.d.ts.map +1 -1
  244. package/dist/xlsx/layout/print-breaks.d.ts +11 -0
  245. package/dist/xlsx/layout/print-breaks.d.ts.map +1 -0
  246. package/dist/xlsx/layout/print-layout.d.ts +34 -0
  247. package/dist/xlsx/layout/print-layout.d.ts.map +1 -0
  248. package/dist/xlsx/layout/print-merges.d.ts +18 -0
  249. package/dist/xlsx/layout/print-merges.d.ts.map +1 -0
  250. package/dist/xlsx/layout/print-repeat.d.ts +12 -0
  251. package/dist/xlsx/layout/print-repeat.d.ts.map +1 -0
  252. package/dist/xlsx/layout/print-titles.d.ts +20 -0
  253. package/dist/xlsx/layout/print-titles.d.ts.map +1 -0
  254. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -1
  255. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -1
  256. package/dist/xlsx/load/index.cjs +7831 -6961
  257. package/dist/xlsx/load/index.mjs +7831 -6961
  258. package/dist/xlsx/model-pivots.d.ts +46 -0
  259. package/dist/xlsx/model-pivots.d.ts.map +1 -0
  260. package/dist/xlsx/model.d.ts +5 -0
  261. package/dist/xlsx/model.d.ts.map +1 -1
  262. package/dist/xlsx/pivot/admission.d.ts +5 -0
  263. package/dist/xlsx/pivot/admission.d.ts.map +1 -0
  264. package/dist/xlsx/pivot/aggregate.d.ts +19 -0
  265. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -0
  266. package/dist/xlsx/pivot/cache-xml.d.ts +9 -0
  267. package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -0
  268. package/dist/xlsx/pivot/data.d.ts +12 -0
  269. package/dist/xlsx/pivot/data.d.ts.map +1 -0
  270. package/dist/xlsx/pivot/hierarchy.d.ts +7 -0
  271. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -0
  272. package/dist/xlsx/pivot/index.d.ts +3 -0
  273. package/dist/xlsx/pivot/index.d.ts.map +1 -0
  274. package/dist/xlsx/pivot/read.d.ts +5 -0
  275. package/dist/xlsx/pivot/read.d.ts.map +1 -0
  276. package/dist/xlsx/pivot/table-xml.d.ts +5 -0
  277. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -0
  278. package/dist/xlsx/pivot/write.d.ts +11 -0
  279. package/dist/xlsx/pivot/write.d.ts.map +1 -0
  280. package/dist/xlsx/read/load.d.ts.map +1 -1
  281. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  282. package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
  283. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  284. package/dist/xlsx/ui/commands/i18n/pivots.d.ts +3 -0
  285. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -0
  286. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts +3 -0
  287. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -0
  288. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts +3 -0
  289. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts.map +1 -0
  290. package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
  291. package/dist/xlsx/ui/commands/page-breaks.d.ts +3 -0
  292. package/dist/xlsx/ui/commands/page-breaks.d.ts.map +1 -0
  293. package/dist/xlsx/ui/index.cjs +2451 -737
  294. package/dist/xlsx/ui/index.d.ts +1 -0
  295. package/dist/xlsx/ui/index.d.ts.map +1 -1
  296. package/dist/xlsx/ui/index.mjs +2451 -738
  297. package/dist/xlsx/write/chart-cache.d.ts +8 -0
  298. package/dist/xlsx/write/chart-cache.d.ts.map +1 -0
  299. package/dist/xlsx/write/page-setup.d.ts.map +1 -1
  300. package/dist/xlsx/write/save.d.ts.map +1 -1
  301. package/dist/xlsx/write/sheet-parts.d.ts +1 -0
  302. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  303. package/dist/xlsx/write/workbook-part.d.ts +1 -1
  304. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  305. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  306. package/package.json +1 -1
  307. package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
  308. package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +0 -1
@@ -29,19 +29,19 @@ var isCellError = (value2) => typeof value2 === "object" && value2 !== null && "
29
29
  var MAX_ROW = 1048575;
30
30
  var MAX_COL = 16383;
31
31
  function columnLabel(col) {
32
- let label2 = "";
32
+ let label3 = "";
33
33
  let n = col + 1;
34
34
  while (n > 0) {
35
35
  const rem = (n - 1) % 26;
36
- label2 = String.fromCharCode(65 + rem) + label2;
36
+ label3 = String.fromCharCode(65 + rem) + label3;
37
37
  n = Math.floor((n - 1) / 26);
38
38
  }
39
- return label2;
39
+ return label3;
40
40
  }
41
- function columnIndex(label2) {
42
- if (!/^[A-Za-z]{1,3}$/.test(label2)) return -1;
41
+ function columnIndex(label3) {
42
+ if (!/^[A-Za-z]{1,3}$/.test(label3)) return -1;
43
43
  let n = 0;
44
- for (const ch of label2.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
44
+ for (const ch of label3.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
45
45
  return n - 1;
46
46
  }
47
47
  var formatAddress = (address2) => `${columnLabel(address2.col)}${address2.row + 1}`;
@@ -353,23 +353,23 @@ function compact(value2) {
353
353
  for (const [key, entry] of Object.entries(value2)) if (entry !== void 0) out[key] = entry;
354
354
  return out;
355
355
  }
356
- function patchStyle(base, patch) {
356
+ function patchStyle(base, patch2) {
357
357
  const next = {
358
- font: patch.font ? compact({ ...base.font, ...patch.font }) : base.font,
359
- fill: patch.fill ?? base.fill,
360
- border: patch.border ? compact({ ...base.border, ...patch.border }) : base.border,
361
- numFmt: patch.numFmt ?? base.numFmt
358
+ font: patch2.font ? compact({ ...base.font, ...patch2.font }) : base.font,
359
+ fill: patch2.fill ?? base.fill,
360
+ border: patch2.border ? compact({ ...base.border, ...patch2.border }) : base.border,
361
+ numFmt: patch2.numFmt ?? base.numFmt
362
362
  };
363
- const alignment = patch.alignment ? compact({ ...base.alignment, ...patch.alignment }) : base.alignment;
363
+ const alignment = patch2.alignment ? compact({ ...base.alignment, ...patch2.alignment }) : base.alignment;
364
364
  if (alignment && Object.keys(alignment).length) next.alignment = alignment;
365
- const protection = patch.protection ? compact({ ...base.protection, ...patch.protection }) : base.protection;
365
+ const protection = patch2.protection ? compact({ ...base.protection, ...patch2.protection }) : base.protection;
366
366
  if (protection && Object.keys(protection).length) next.protection = protection;
367
- const styleName = "cellStyleName" in patch ? patch.cellStyleName : base.cellStyleName;
367
+ const styleName = "cellStyleName" in patch2 ? patch2.cellStyleName : base.cellStyleName;
368
368
  if (styleName) next.cellStyleName = styleName;
369
369
  return next;
370
370
  }
371
- function applyStylePatch(workbook, styleId, patch) {
372
- return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch));
371
+ function applyStylePatch(workbook, styleId, patch2) {
372
+ return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch2));
373
373
  }
374
374
 
375
375
  // xlsx/cell-styles.ts
@@ -855,7 +855,7 @@ function compileFraction(tokens, slash) {
855
855
  while (isDigit(tokens[denEnd]) || tokens[denEnd]?.t === "num") denEnd++;
856
856
  const denTokens = tokens.slice(slash + 1, denEnd);
857
857
  const fixed2 = denTokens.some((t) => t.t === "num") && denTokens.every((t) => t.t === "num" || isDigit(t) && t.c === "0");
858
- const plan = {
858
+ const plan2 = {
859
859
  tokens: [],
860
860
  intDigits: [],
861
861
  numDigits: [],
@@ -863,31 +863,31 @@ function compileFraction(tokens, slash) {
863
863
  denWidth: denTokens.length
864
864
  };
865
865
  if (fixed2) {
866
- plan.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
866
+ plan2.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
867
867
  }
868
868
  tokens.forEach((tok, i2) => {
869
- if (i2 === slash) plan.tokens.push({ r: "slash" });
869
+ if (i2 === slash) plan2.tokens.push({ r: "slash" });
870
870
  else if (i2 > slash && i2 < denEnd) {
871
871
  if (fixed2) {
872
- if (i2 === slash + 1) plan.tokens.push({ r: "den", index: 0 });
872
+ if (i2 === slash + 1) plan2.tokens.push({ r: "den", index: 0 });
873
873
  } else if (isDigit(tok)) {
874
- plan.tokens.push({ r: "den", index: plan.denDigits.length });
875
- plan.denDigits.push(tok.c);
874
+ plan2.tokens.push({ r: "den", index: plan2.denDigits.length });
875
+ plan2.denDigits.push(tok.c);
876
876
  }
877
877
  } else if (isDigit(tok) && i2 >= numStart && i2 < slash) {
878
- plan.tokens.push({ r: "num", index: plan.numDigits.length });
879
- plan.numDigits.push(tok.c);
878
+ plan2.tokens.push({ r: "num", index: plan2.numDigits.length });
879
+ plan2.numDigits.push(tok.c);
880
880
  } else if (isDigit(tok) && i2 < numStart) {
881
- plan.tokens.push({ r: "int", index: plan.intDigits.length });
882
- plan.intDigits.push(tok.c);
883
- } else if (tok.t === "lit") plan.tokens.push({ r: "lit", v: tok.v });
884
- else if (tok.t === "num") plan.tokens.push({ r: "lit", v: tok.v });
885
- else if (tok.t === "digit") plan.tokens.push({ r: "lit", v: tok.c });
886
- else if (tok.t === "point") plan.tokens.push({ r: "lit", v: "." });
887
- else if (tok.t === "slash") plan.tokens.push({ r: "lit", v: "/" });
888
- else if (tok.t === "percent") plan.tokens.push({ r: "lit", v: "%" });
881
+ plan2.tokens.push({ r: "int", index: plan2.intDigits.length });
882
+ plan2.intDigits.push(tok.c);
883
+ } else if (tok.t === "lit") plan2.tokens.push({ r: "lit", v: tok.v });
884
+ else if (tok.t === "num") plan2.tokens.push({ r: "lit", v: tok.v });
885
+ else if (tok.t === "digit") plan2.tokens.push({ r: "lit", v: tok.c });
886
+ else if (tok.t === "point") plan2.tokens.push({ r: "lit", v: "." });
887
+ else if (tok.t === "slash") plan2.tokens.push({ r: "lit", v: "/" });
888
+ else if (tok.t === "percent") plan2.tokens.push({ r: "lit", v: "%" });
889
889
  });
890
- return plan;
890
+ return plan2;
891
891
  }
892
892
  function approximate(x, maxDen) {
893
893
  if (Number.isInteger(x)) return [x, 1];
@@ -922,29 +922,29 @@ function padRight(s, slots) {
922
922
  for (let i2 = s.length; i2 < slots.length; i2++) suffix += pad(slots[i2] ?? "#");
923
923
  return s + suffix;
924
924
  }
925
- function renderFraction(value2, plan) {
925
+ function renderFraction(value2, plan2) {
926
926
  const x = Math.abs(value2);
927
- const hasInt = plan.intDigits.length > 0;
927
+ const hasInt = plan2.intDigits.length > 0;
928
928
  let ip = hasInt ? Math.floor(x) : 0;
929
929
  const f6 = x - ip;
930
- const maxDen = 10 ** Math.max(1, plan.denDigits.length) - 1;
931
- let [n, d] = plan.fixedDenominator ? [Math.round(f6 * plan.fixedDenominator), plan.fixedDenominator] : approximate(f6, maxDen);
930
+ const maxDen = 10 ** Math.max(1, plan2.denDigits.length) - 1;
931
+ let [n, d] = plan2.fixedDenominator ? [Math.round(f6 * plan2.fixedDenominator), plan2.fixedDenominator] : approximate(f6, maxDen);
932
932
  if (hasInt && n >= d) {
933
933
  ip += 1;
934
934
  n = 0;
935
935
  }
936
936
  const zero = !hasInt && n === 0;
937
937
  const blank = hasInt && n === 0;
938
- const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan.intDigits) : "";
938
+ const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan2.intDigits) : "";
939
939
  const allHash = (slots) => slots.every((c) => c === "#");
940
- const numHash = allHash(plan.numDigits);
941
- const hideFraction = blank && numHash && (plan.fixedDenominator !== void 0 || allHash(plan.denDigits));
940
+ const numHash = allHash(plan2.numDigits);
941
+ const hideFraction = blank && numHash && (plan2.fixedDenominator !== void 0 || allHash(plan2.denDigits));
942
942
  const dropSeparator = hideFraction || hasInt && intText === "" && numHash;
943
- const lastInt = plan.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
944
- const firstNum = plan.tokens.findIndex((t) => t.r === "num");
943
+ const lastInt = plan2.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
944
+ const firstNum = plan2.tokens.findIndex((t) => t.r === "num");
945
945
  let text2 = "";
946
946
  let intDone = false;
947
- plan.tokens.forEach((tok, i2) => {
947
+ plan2.tokens.forEach((tok, i2) => {
948
948
  if (tok.r === "lit") {
949
949
  if (!(dropSeparator && i2 > lastInt && i2 < firstNum)) text2 += tok.v;
950
950
  } else if (tok.r === "int") {
@@ -953,12 +953,12 @@ function renderFraction(value2, plan) {
953
953
  } else if (hideFraction) ; else if (blank) {
954
954
  if (tok.r === "num") text2 += " ";
955
955
  else if (tok.r === "slash") text2 += " ";
956
- else text2 += " ".repeat(plan.fixedDenominator ? plan.denWidth : 1);
956
+ else text2 += " ".repeat(plan2.fixedDenominator ? plan2.denWidth : 1);
957
957
  } else if (tok.r === "num") {
958
- if (tok.index === 0) text2 += padLeft(String(n), plan.numDigits);
958
+ if (tok.index === 0) text2 += padLeft(String(n), plan2.numDigits);
959
959
  } else if (tok.r === "slash") text2 += "/";
960
- else if (plan.fixedDenominator) text2 += String(d);
961
- else if (tok.index === 0) text2 += padRight(String(d), plan.denDigits);
960
+ else if (plan2.fixedDenominator) text2 += String(d);
961
+ else if (tok.index === 0) text2 += padRight(String(d), plan2.denDigits);
962
962
  });
963
963
  return { text: text2, zero };
964
964
  }
@@ -1099,15 +1099,15 @@ function compileNumber(tokens) {
1099
1099
  out.splice(at < 0 ? 0 : at, 0, { r: "int", c: "#", index: 0 });
1100
1100
  intDigits.push("#");
1101
1101
  }
1102
- const plan = {
1102
+ const plan2 = {
1103
1103
  tokens: out,
1104
1104
  intDigits,
1105
1105
  fracDigits,
1106
1106
  grouping,
1107
1107
  shift: 2 * percent - 3 * scaleCommas
1108
1108
  };
1109
- if (exponent) plan.exponent = exponent;
1110
- return plan;
1109
+ if (exponent) plan2.exponent = exponent;
1110
+ return plan2;
1111
1111
  }
1112
1112
  var pad2 = (c) => c === "0" ? "0" : c === "?" ? " " : "";
1113
1113
  function placeIntegers(digits2, slots, grouping) {
@@ -1140,40 +1140,40 @@ function placeFraction(digits2, slots) {
1140
1140
  }
1141
1141
  return out;
1142
1142
  }
1143
- function scientific(v, plan) {
1143
+ function scientific(v, plan2) {
1144
1144
  if (isZero(v)) return { value: v, exp: 0 };
1145
- const n = plan.intDigits.length;
1146
- const engineering = n > 1 && plan.intDigits.some((c) => c !== "0");
1145
+ const n = plan2.intDigits.length;
1146
+ const engineering = n > 1 && plan2.intDigits.some((c) => c !== "0");
1147
1147
  const period = engineering ? n : 1;
1148
1148
  const e = v.point - 1;
1149
1149
  let exp2 = Math.floor(e / period) * period;
1150
- let m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1150
+ let m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1151
1151
  if (m.point > period) {
1152
1152
  exp2 += period;
1153
- m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1153
+ m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1154
1154
  }
1155
1155
  return { value: m, exp: exp2 };
1156
1156
  }
1157
- function renderNumber(value2, plan) {
1158
- const v = shift(toDigits(value2), plan.shift);
1157
+ function renderNumber(value2, plan2) {
1158
+ const v = shift(toDigits(value2), plan2.shift);
1159
1159
  let rounded;
1160
1160
  let exp2 = 0;
1161
- if (plan.exponent) {
1162
- const m = scientific(v, plan);
1161
+ if (plan2.exponent) {
1162
+ const m = scientific(v, plan2);
1163
1163
  rounded = m.value;
1164
1164
  exp2 = m.exp;
1165
- } else rounded = roundDecimals(v, plan.fracDigits.length);
1166
- const ints = plan.exponent && isZero(rounded) ? plan.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan.intDigits, plan.grouping);
1167
- const fracs = placeFraction(fractionPart(rounded, plan.fracDigits.length), plan.fracDigits);
1165
+ } else rounded = roundDecimals(v, plan2.fracDigits.length);
1166
+ const ints = plan2.exponent && isZero(rounded) ? plan2.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan2.intDigits, plan2.grouping);
1167
+ const fracs = placeFraction(fractionPart(rounded, plan2.fracDigits.length), plan2.fracDigits);
1168
1168
  let text2 = "";
1169
- for (const tok of plan.tokens) {
1169
+ for (const tok of plan2.tokens) {
1170
1170
  if (tok.r === "lit") text2 += tok.v;
1171
1171
  else if (tok.r === "int") text2 += ints[tok.index] ?? "";
1172
1172
  else if (tok.r === "frac") text2 += fracs[tok.index] ?? "";
1173
1173
  else if (tok.r === "point") text2 += ".";
1174
- else if (plan.exponent) {
1175
- const sign2 = exp2 < 0 ? "-" : plan.exponent.plus ? "+" : "";
1176
- text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan.exponent.digits, "0")}`;
1174
+ else if (plan2.exponent) {
1175
+ const sign2 = exp2 < 0 ? "-" : plan2.exponent.plus ? "+" : "";
1176
+ text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan2.exponent.digits, "0")}`;
1177
1177
  }
1178
1178
  }
1179
1179
  return { text: text2, zero: isZero(rounded) };
@@ -1866,9 +1866,9 @@ function parseFractionInput(text2) {
1866
1866
  const m = /^([-+]?)(\d+)\s+(\d+)\/(\d+)$/.exec(text2.trim());
1867
1867
  if (!m) return void 0;
1868
1868
  const den = Number(m[4]);
1869
- const num2 = Number(m[3]);
1870
- if (den === 0 || num2 >= den) return void 0;
1871
- const magnitude = Number(m[2]) + num2 / den;
1869
+ const num3 = Number(m[3]);
1870
+ if (den === 0 || num3 >= den) return void 0;
1871
+ const magnitude = Number(m[2]) + num3 / den;
1872
1872
  return {
1873
1873
  value: m[1] === "-" ? -magnitude : magnitude,
1874
1874
  numFmt: den < 10 ? "# ?/?" : "# ??/??"
@@ -11161,13 +11161,27 @@ var TEXT_REGEX_FUNCTIONS = [
11161
11161
  "REGEXEXTRACT",
11162
11162
  C35,
11163
11163
  "REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])",
11164
- "The first part of the text that matches the pattern.",
11164
+ "Extracts the first match (0), all matches (1), or the first match\u2019s capture groups (2).",
11165
11165
  2,
11166
11166
  4,
11167
11167
  (args) => {
11168
- if (optNum(args, 2, 0) !== 0) fail(ERR.VALUE);
11169
- const match2 = compile(str(args[1]), caseMode(args, 3), false).exec(str(args[0]));
11170
- return match2 ? match2[0] : fail(ERR.NA);
11168
+ const mode = optNum(args, 2, 0);
11169
+ if (mode !== 0 && mode !== 1 && mode !== 2) fail(ERR.VALUE);
11170
+ const regex = compile(str(args[1]), caseMode(args, 3), mode === 1);
11171
+ const text2 = str(args[0]);
11172
+ if (mode === 1) {
11173
+ const matches2 = [];
11174
+ for (const match3 of text2.matchAll(regex)) {
11175
+ checkArraySize(matches2.length + 1, 1);
11176
+ matches2.push(match3[0]);
11177
+ }
11178
+ return matches2.length ? new Matrix(matches2.map((match3) => [match3])) : fail(ERR.NA);
11179
+ }
11180
+ const match2 = regex.exec(text2);
11181
+ if (!match2) fail(ERR.NA);
11182
+ if (mode === 0) return match2[0];
11183
+ if (match2.length === 1) fail(ERR.VALUE);
11184
+ return new Matrix([match2.slice(1).map((group) => group ?? "")]);
11171
11185
  }
11172
11186
  ),
11173
11187
  spec(
@@ -11844,7 +11858,7 @@ function makeTemplate(formula, shape2) {
11844
11858
  }
11845
11859
  const { starts } = shape2;
11846
11860
  const slotted = starts.map(() => false);
11847
- const refs = /* @__PURE__ */ new Map();
11861
+ const refs2 = /* @__PURE__ */ new Map();
11848
11862
  let run = 0;
11849
11863
  for (const token of tokens) {
11850
11864
  const end = token.start + token.text.length;
@@ -11858,9 +11872,9 @@ function makeTemplate(formula, shape2) {
11858
11872
  const indexes2 = count2 === 1 ? [at] : [at, at + 1];
11859
11873
  if (indexes2.some((i2) => formula.charCodeAt(starts[i2]) === 48)) continue;
11860
11874
  for (const i2 of indexes2) slotted[i2] = true;
11861
- refs.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11875
+ refs2.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11862
11876
  }
11863
- return { formula, shape: shape2, ast, slotted, refs };
11877
+ return { formula, shape: shape2, ast, slotted, refs: refs2 };
11864
11878
  }
11865
11879
  function rowsFor(t, formula, shape2) {
11866
11880
  if (!sameShape(t.formula, t.shape, formula, shape2)) return void 0;
@@ -11884,11 +11898,11 @@ function rowsFor(t, formula, shape2) {
11884
11898
  return rows2;
11885
11899
  }
11886
11900
  function shiftSpec(spec2, slots, rows2) {
11887
- const startRow = rows2[slots.start];
11888
- const endRow = slots.end === void 0 ? startRow : rows2[slots.end];
11889
- if (startRow === spec2.start.row && endRow === spec2.end.row) return spec2;
11901
+ const startRow2 = rows2[slots.start];
11902
+ const endRow = slots.end === void 0 ? startRow2 : rows2[slots.end];
11903
+ if (startRow2 === spec2.start.row && endRow === spec2.end.row) return spec2;
11890
11904
  const { start: from, end: to } = spec2;
11891
- const start = { row: startRow, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11905
+ const start = { row: startRow2, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11892
11906
  if (slots.end === void 0) return { kind: spec2.kind, start, end: start };
11893
11907
  const end = { row: endRow, col: to.col, rowAbs: to.rowAbs, colAbs: to.colAbs };
11894
11908
  return { kind: spec2.kind, start, end };
@@ -13621,12 +13635,14 @@ function structuredToA1(formula, target2) {
13621
13635
 
13622
13636
  // xml/namespaces.ts
13623
13637
  var NS = {
13638
+ /** SpreadsheetML main. */
13639
+ x: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
13624
13640
  /** SpreadsheetML 2009 extensions (`x14:conditionalFormatting`, `x14:dataBar`). */
13625
13641
  x14: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"};
13626
13642
  function parseXml(xml, options = {}) {
13627
- const label2 = options.label ?? "OOXML";
13643
+ const label3 = options.label ?? "OOXML";
13628
13644
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
13629
- throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
13645
+ throw new Error(`${label3} XML with DTD or entity declarations is not supported`);
13630
13646
  let parseError = "";
13631
13647
  let parsed;
13632
13648
  try {
@@ -13637,12 +13653,12 @@ function parseXml(xml, options = {}) {
13637
13653
  }).parseFromString(xml, "application/xml");
13638
13654
  } catch (error) {
13639
13655
  throw new Error(
13640
- `Invalid ${label2} XML: ${error instanceof Error ? error.message : String(error)}`,
13656
+ `Invalid ${label3} XML: ${error instanceof Error ? error.message : String(error)}`,
13641
13657
  { cause: error }
13642
13658
  );
13643
13659
  }
13644
13660
  if (parseError || !parsed.documentElement)
13645
- throw new Error(`Invalid ${label2} XML: ${parseError || "missing root element"}`);
13661
+ throw new Error(`Invalid ${label3} XML: ${parseError || "missing root element"}`);
13646
13662
  return parsed;
13647
13663
  }
13648
13664
  var buildXml = (node) => new xmldom.XMLSerializer().serializeToString(node);
@@ -13718,6 +13734,315 @@ function descendants(root, local, ns) {
13718
13734
  return Array.from(root.getElementsByTagNameNS(ns, local));
13719
13735
  }
13720
13736
 
13737
+ // xlsx/edit/sparkline-ranges.ts
13738
+ function checkedSparklineRange(raw) {
13739
+ const range2 = normalizeRange(raw);
13740
+ for (const point of [range2.start, range2.end])
13741
+ if (!Number.isInteger(point.row) || !Number.isInteger(point.col) || point.row < 0 || point.col < 0 || point.row > MAX_ROW || point.col > MAX_COL)
13742
+ throw new RangeError("The reference is not valid.");
13743
+ return range2;
13744
+ }
13745
+ function sparklineDataRange(workbook, sheet, source) {
13746
+ let ast;
13747
+ try {
13748
+ ast = parseFormula(source.trim().replace(/^=/, ""));
13749
+ } catch {
13750
+ throw new Error("The reference is not valid.");
13751
+ }
13752
+ if (ast.type !== "ref" || !ast.ref || !["cell", "area"].includes(ast.ref.kind) || ast.prefix?.book || ast.prefix?.sheet2 || ast.spill)
13753
+ throw new Error("The reference is not valid.");
13754
+ const index2 = ast.prefix ? workbook.sheets.findIndex((ws) => ws.name.toLowerCase() === ast.prefix.sheet.toLowerCase()) : sheet;
13755
+ if (!workbook.sheets[index2]) throw new Error("The reference is not valid.");
13756
+ return { sheet: index2, range: checkedSparklineRange({ start: ast.ref.start, end: ast.ref.end }) };
13757
+ }
13758
+ function newSparklines(workbook, sheet, source, locations) {
13759
+ const data = sparklineDataRange(workbook, sheet, source);
13760
+ const dest = checkedSparklineRange(locations);
13761
+ const rows2 = dest.end.row - dest.start.row + 1;
13762
+ const cols = dest.end.col - dest.start.col + 1;
13763
+ const dr = data.range.end.row - data.range.start.row + 1;
13764
+ const dc = data.range.end.col - data.range.start.col + 1;
13765
+ if (rows2 > 1 && cols > 1 || rows2 === 1 && cols === 1 && dr > 1 && dc > 1 || rows2 > 1 && rows2 !== dr || cols > 1 && cols !== dc)
13766
+ throw new Error("The data range and location range do not match.");
13767
+ if (Math.max(rows2, cols) > 1e5) throw new Error("The sparkline location range is too large.");
13768
+ const prefix = `'${workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!`;
13769
+ const out = [];
13770
+ for (let i2 = 0; i2 < Math.max(rows2, cols); i2++) {
13771
+ const range2 = structuredClone(data.range);
13772
+ if (rows2 > 1) range2.start.row = range2.end.row = data.range.start.row + i2;
13773
+ if (cols > 1) range2.start.col = range2.end.col = data.range.start.col + i2;
13774
+ const host = {
13775
+ row: dest.start.row + (rows2 > 1 ? i2 : 0),
13776
+ col: dest.start.col + (cols > 1 ? i2 : 0)
13777
+ };
13778
+ out.push({ formula: prefix + formatRange(range2), host: { start: host, end: { ...host } } });
13779
+ }
13780
+ return out;
13781
+ }
13782
+
13783
+ // xlsx/pivot/data.ts
13784
+ var PIVOT_AGGREGATES = ["sum", "count", "average", "min", "max"];
13785
+ function pivotSourceData(workbook, sheet, source) {
13786
+ const data = sparklineDataRange(workbook, sheet, source);
13787
+ const ws = workbook.sheets[data.sheet];
13788
+ const { start, end } = data.range;
13789
+ if (end.row <= start.row || (end.row - start.row + 1) * (end.col - start.col + 1) > 1e6)
13790
+ throw new Error("A PivotTable source needs headers and data, with at most one million cells.");
13791
+ const fields = [];
13792
+ for (let col = start.col; col <= end.col; col++) {
13793
+ const value2 = getCell(ws, start.row, col)?.value;
13794
+ if (value2 === void 0 || value2 === null || isCellError(value2) || !String(value2).trim())
13795
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13796
+ fields.push(String(value2));
13797
+ }
13798
+ if (new Set(fields.map((name) => name.toLowerCase())).size !== fields.length)
13799
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13800
+ const records = [];
13801
+ for (let row2 = start.row + 1; row2 <= end.row; row2++) {
13802
+ const record = [];
13803
+ for (let col = start.col; col <= end.col; col++)
13804
+ record.push(getCell(ws, row2, col)?.value ?? null);
13805
+ records.push(record);
13806
+ }
13807
+ return { source: `${quoteSheetName(ws.name)}!${formatRange(data.range)}`, fields, records };
13808
+ }
13809
+ function pivotValueKey(value2) {
13810
+ return value2 === null || value2 === "" ? "blank" : isCellError(value2) ? `error:${value2.error}` : `${typeof value2}:${String(value2).toLowerCase()}`;
13811
+ }
13812
+ function pivotItems(pivot, field) {
13813
+ const index2 = pivot.fields.indexOf(field);
13814
+ const items = /* @__PURE__ */ new Map();
13815
+ for (const record of pivot.records) {
13816
+ const value2 = record[index2] ?? null;
13817
+ const key = pivotValueKey(value2);
13818
+ if (!items.has(key)) items.set(key, value2);
13819
+ }
13820
+ const rank3 = (value2) => value2 === null || value2 === "" ? 4 : isCellError(value2) ? 3 : typeof value2 === "boolean" ? 2 : typeof value2 === "string" ? 1 : 0;
13821
+ return [...items.values()].sort(
13822
+ (a, b) => rank3(a) - rank3(b) || (typeof a === "number" && typeof b === "number" ? a - b : String(pivotItemLabel(a)).localeCompare(String(pivotItemLabel(b)), "en", {
13823
+ sensitivity: "base",
13824
+ numeric: true
13825
+ }))
13826
+ );
13827
+ }
13828
+ function pivotItemLabel(value2) {
13829
+ if (value2 === null || value2 === "") return "(blank)";
13830
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
13831
+ return isCellError(value2) ? value2.error : value2;
13832
+ }
13833
+ function validatePivotFields(pivot) {
13834
+ const used = [
13835
+ pivot.rowField,
13836
+ ...pivot.secondRowField ? [pivot.secondRowField] : [],
13837
+ ...pivot.columnField ? [pivot.columnField] : [],
13838
+ pivot.valueField
13839
+ ];
13840
+ if (pivot.layout !== void 0 && !["tabular", "compact", "outline"].includes(pivot.layout) || pivot.subtotalPosition !== void 0 && !["top", "bottom"].includes(pivot.subtotalPosition) || !PIVOT_AGGREGATES.includes(pivot.aggregate) || used.some((field) => !pivot.fields.includes(field)) || new Set([pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean)).size !== [pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean).length || pivot.subtotals !== void 0 && typeof pivot.subtotals !== "boolean" || pivot.repeatLabels !== void 0 && typeof pivot.repeatLabels !== "boolean")
13841
+ throw new Error("Choose valid PivotTable fields; row and column fields must differ.");
13842
+ }
13843
+ function pivotCaption(aggregate3, field) {
13844
+ return `${aggregate3[0].toUpperCase()}${aggregate3.slice(1)} of ${field}`;
13845
+ }
13846
+
13847
+ // xlsx/pivot/hierarchy.ts
13848
+ var label2 = pivotItemLabel;
13849
+ function hierarchicalPivotGrid(pivot, aggregate3) {
13850
+ const rowItems = pivotItems(pivot, pivot.rowField);
13851
+ const secondRowItems = pivotItems(pivot, pivot.secondRowField);
13852
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13853
+ const outerField = pivot.fields.indexOf(pivot.rowField);
13854
+ const innerField = pivot.fields.indexOf(pivot.secondRowField);
13855
+ const columnField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13856
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13857
+ const layout2 = pivot.layout ?? "tabular";
13858
+ const compact3 = layout2 === "compact";
13859
+ const top = layout2 !== "tabular" && pivot.subtotals !== false && (pivot.subtotalPosition ?? "top") === "top";
13860
+ const bottom = pivot.subtotals !== false && !top;
13861
+ const rowLabelColumns = compact3 ? 1 : 2;
13862
+ const groups = /* @__PURE__ */ new Map();
13863
+ const details = /* @__PURE__ */ new Map();
13864
+ const children2 = /* @__PURE__ */ new Map();
13865
+ const innerIndices = new Map(secondRowItems.map((item, index2) => [pivotValueKey(item), index2]));
13866
+ const buckets = /* @__PURE__ */ new Map();
13867
+ const collect = (map, key, record) => {
13868
+ const list = map.get(key);
13869
+ if (list) list.push(record);
13870
+ else map.set(key, [record]);
13871
+ };
13872
+ for (const record of pivot.records) {
13873
+ const outer = pivotValueKey(record[outerField] ?? null);
13874
+ const inner2 = pivotValueKey(record[innerField] ?? null);
13875
+ collect(groups, outer, record);
13876
+ collect(details, JSON.stringify([outer, inner2]), record);
13877
+ if (!children2.has(outer)) children2.set(outer, /* @__PURE__ */ new Set());
13878
+ children2.get(outer).add(inner2);
13879
+ if (pivot.columnField) {
13880
+ const column = pivotValueKey(record[columnField] ?? null);
13881
+ for (const key of [[], [outer], [outer, inner2]])
13882
+ collect(buckets, JSON.stringify([...key, column]), record);
13883
+ }
13884
+ }
13885
+ const rows2 = details.size + rowItems.length * (Number(layout2 !== "tabular") + Number(bottom)) + 3;
13886
+ if (rows2 * (columnItems.length + 3) > 1e6)
13887
+ throw new Error("The PivotTable result is too large.");
13888
+ const labels = compact3 ? ["Row Labels"] : [pivot.rowField, pivot.secondRowField];
13889
+ const values2 = pivot.columnField ? [
13890
+ [
13891
+ pivot.valueCaption,
13892
+ ...compact3 ? [] : [null],
13893
+ compact3 ? "Column Labels" : pivot.columnField,
13894
+ ...columnItems.slice(1).map(() => null),
13895
+ null
13896
+ ],
13897
+ [...labels, ...columnItems.map(label2), "Grand Total"]
13898
+ ] : [[...labels, pivot.valueCaption]];
13899
+ const indents = values2.map(() => 0);
13900
+ const rowEntries = [];
13901
+ const append = (labels2, numbers4, entry, indent = 0) => {
13902
+ values2.push([...labels2, ...numbers4]);
13903
+ rowEntries.push(entry);
13904
+ indents.push(indent);
13905
+ };
13906
+ const numbers3 = (keys, records) => [
13907
+ ...columnItems.map(
13908
+ (column) => aggregate3(
13909
+ buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [],
13910
+ valueField,
13911
+ pivot.aggregate
13912
+ )
13913
+ ),
13914
+ aggregate3(records, valueField, pivot.aggregate)
13915
+ ];
13916
+ rowItems.forEach((outer, outerIndex) => {
13917
+ const key = pivotValueKey(outer);
13918
+ if (layout2 !== "tabular")
13919
+ append(
13920
+ [label2(outer), ...compact3 ? [] : [null]],
13921
+ top ? numbers3([key], groups.get(key) ?? []) : Array(columnItems.length + 1).fill(null),
13922
+ { indices: [outerIndex] }
13923
+ );
13924
+ let first2 = true;
13925
+ [...children2.get(key)].sort((a, b) => innerIndices.get(a) - innerIndices.get(b)).forEach((innerKey) => {
13926
+ const innerIndex = innerIndices.get(innerKey);
13927
+ const inner2 = secondRowItems[innerIndex];
13928
+ const keys = [key, innerKey];
13929
+ const records = details.get(JSON.stringify(keys));
13930
+ if (!records) return;
13931
+ append(
13932
+ compact3 ? [label2(inner2)] : [
13933
+ pivot.repeatLabels || layout2 === "tabular" && first2 ? label2(outer) : null,
13934
+ label2(inner2)
13935
+ ],
13936
+ numbers3(keys, records),
13937
+ { indices: [outerIndex, innerIndex] },
13938
+ compact3 ? 1 : 0
13939
+ );
13940
+ first2 = false;
13941
+ });
13942
+ if (bottom) {
13943
+ const caption = String(label2(outer));
13944
+ append(
13945
+ [`${caption} Total`, ...compact3 ? [] : [null]],
13946
+ numbers3([key], groups.get(key) ?? []),
13947
+ { indices: [outerIndex], type: "default" }
13948
+ );
13949
+ }
13950
+ });
13951
+ append(["Grand Total", ...compact3 ? [] : [null]], numbers3([], pivot.records), {
13952
+ indices: [0],
13953
+ type: "grand"
13954
+ });
13955
+ return {
13956
+ values: values2,
13957
+ rowItems,
13958
+ secondRowItems,
13959
+ columnItems,
13960
+ rowEntries,
13961
+ firstDataRow: pivot.columnField ? 2 : 1,
13962
+ rowLabelColumns,
13963
+ indents
13964
+ };
13965
+ }
13966
+
13967
+ // xlsx/pivot/aggregate.ts
13968
+ function aggregate2(records, field, type) {
13969
+ if (!records.length) return null;
13970
+ const values2 = records.map((record) => record[field] ?? null);
13971
+ if (type === "count") return values2.filter((value2) => value2 !== null && value2 !== "").length;
13972
+ const error = values2.find(isCellError);
13973
+ if (error) return error;
13974
+ const numbers3 = values2.filter((value2) => typeof value2 === "number");
13975
+ if (!numbers3.length) return type === "average" ? { error: "#DIV/0!" } : 0;
13976
+ if (type === "min") return numbers3.reduce((a, b) => Math.min(a, b));
13977
+ if (type === "max") return numbers3.reduce((a, b) => Math.max(a, b));
13978
+ const sum2 = numbers3.reduce((total2, value2) => total2 + value2, 0);
13979
+ return type === "average" ? sum2 / numbers3.length : sum2;
13980
+ }
13981
+ function pivotGrid(pivot) {
13982
+ validatePivotFields(pivot);
13983
+ if (pivot.secondRowField) return hierarchicalPivotGrid(pivot, aggregate2);
13984
+ const rowItems = pivotItems(pivot, pivot.rowField);
13985
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13986
+ if ((rowItems.length + 3) * (columnItems.length + 2) > 1e6)
13987
+ throw new Error("The PivotTable result is too large.");
13988
+ const rowField = pivot.fields.indexOf(pivot.rowField);
13989
+ const colField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13990
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13991
+ const groups = /* @__PURE__ */ new Map();
13992
+ const cells = /* @__PURE__ */ new Map();
13993
+ const columns = /* @__PURE__ */ new Map();
13994
+ const collect = (map, key, record) => {
13995
+ const found = map.get(key);
13996
+ if (found) found.push(record);
13997
+ else map.set(key, [record]);
13998
+ };
13999
+ for (const record of pivot.records) {
14000
+ const key = pivotValueKey(record[rowField] ?? null);
14001
+ collect(groups, key, record);
14002
+ if (pivot.columnField) {
14003
+ const col = pivotValueKey(record[colField] ?? null);
14004
+ collect(columns, col, record);
14005
+ collect(cells, JSON.stringify([key, col]), record);
14006
+ }
14007
+ }
14008
+ const label3 = pivotItemLabel;
14009
+ const values2 = pivot.columnField ? [
14010
+ [
14011
+ pivot.valueCaption,
14012
+ pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
14013
+ ...columnItems.slice(1).map(() => null),
14014
+ null
14015
+ ],
14016
+ [
14017
+ pivot.layout === "compact" ? "Row Labels" : pivot.rowField,
14018
+ ...columnItems.map(label3),
14019
+ "Grand Total"
14020
+ ]
14021
+ ] : [[pivot.layout === "compact" ? "Row Labels" : pivot.rowField, pivot.valueCaption]];
14022
+ for (const row2 of rowItems) {
14023
+ const records = groups.get(pivotValueKey(row2)) ?? [];
14024
+ values2.push([
14025
+ label3(row2),
14026
+ ...columnItems.map(
14027
+ (col) => aggregate2(
14028
+ cells.get(JSON.stringify([pivotValueKey(row2), pivotValueKey(col)])) ?? [],
14029
+ valueField,
14030
+ pivot.aggregate
14031
+ )
14032
+ ),
14033
+ aggregate2(records, valueField, pivot.aggregate)
14034
+ ]);
14035
+ }
14036
+ values2.push([
14037
+ "Grand Total",
14038
+ ...columnItems.map(
14039
+ (col) => aggregate2(columns.get(pivotValueKey(col)) ?? [], valueField, pivot.aggregate)
14040
+ ),
14041
+ aggregate2(pivot.records, valueField, pivot.aggregate)
14042
+ ]);
14043
+ return { values: values2, rowItems, columnItems, firstDataRow: pivot.columnField ? 2 : 1 };
14044
+ }
14045
+
13721
14046
  // xlsx/read/style-parts.ts
13722
14047
  function parseColor(element2, palette) {
13723
14048
  if (!element2) return void 0;
@@ -13751,6 +14076,23 @@ function parseSqref(sqref) {
13751
14076
  return sqref.split(/\s+/).filter(Boolean).map((part) => parseRange(part)).filter((range2) => range2 !== void 0);
13752
14077
  }
13753
14078
 
14079
+ // xlsx/write/xml-out.ts
14080
+ var CONTROL2 = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
14081
+ var INVALID_XML = new RegExp(`[${CONTROL2}]`, "g");
14082
+ var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
14083
+ var escapeAttr = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
14084
+ function attrs(values2) {
14085
+ let out = "";
14086
+ for (const [name, value2] of Object.entries(values2)) {
14087
+ if (value2 === void 0) continue;
14088
+ const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
14089
+ out += ` ${name}="${escapeAttr(text2)}"`;
14090
+ }
14091
+ return out;
14092
+ }
14093
+ var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
14094
+ var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
14095
+
13754
14096
  // xlsx/conditional-extensions.ts
13755
14097
  var XM = "http://schemas.microsoft.com/office/excel/2006/main";
13756
14098
  function dataBarLengths(rule, node) {
@@ -14333,143 +14675,386 @@ function shiftFormulaInBand(formula, formulaSheet, sheet, shift2, band) {
14333
14675
  return changed ? tokens.map((t) => t.text).join("") : formula;
14334
14676
  }
14335
14677
 
14336
- // xlsx/edit/context.ts
14337
- function sheetAt(workbook, index2) {
14338
- const sheet = Number.isInteger(index2) ? workbook.sheets[index2] : void 0;
14339
- if (!sheet) throw new RangeError(`No sheet at index ${index2}`);
14340
- return sheet;
14678
+ // xlsx/write/style-xml.ts
14679
+ var argb = (rgb2) => (rgb2.length === 6 ? `FF${rgb2}` : rgb2).toUpperCase();
14680
+ function colorXml(color, name = "color") {
14681
+ if (!color) return "";
14682
+ if (color.rgb) return el(name, { rgb: argb(color.rgb), tint: color.tint });
14683
+ if (color.theme !== void 0) return el(name, { theme: color.theme, tint: color.tint });
14684
+ if (color.indexed !== void 0) return el(name, { indexed: color.indexed, tint: color.tint });
14685
+ if (color.auto) return el(name, { auto: true });
14686
+ return "";
14341
14687
  }
14342
- function baseStyleId(sheet, row2, col) {
14343
- const rowStyle = sheet.rowInfo.get(row2)?.styleId;
14344
- if (rowStyle) return rowStyle;
14345
- const column = sheet.columns.find((c) => col >= c.min && col <= c.max);
14346
- return column?.styleId || void 0;
14688
+
14689
+ // xlsx/layout/sparkline-view.ts
14690
+ var DEFAULTS = {
14691
+ colorSeries: "#376092",
14692
+ colorNegative: "#D00000",
14693
+ colorAxis: "#000000",
14694
+ colorMarkers: "#D00000",
14695
+ colorFirst: "#D00000",
14696
+ colorLast: "#D00000",
14697
+ colorHigh: "#D00000",
14698
+ colorLow: "#D00000"
14699
+ };
14700
+ var COLUMN_GAP = 0.2;
14701
+ function extent(values2) {
14702
+ let min = Infinity;
14703
+ let max = -Infinity;
14704
+ for (const v of values2) {
14705
+ if (v === null) continue;
14706
+ if (v < min) min = v;
14707
+ if (v > max) max = v;
14708
+ }
14709
+ return min <= max ? { min, max } : void 0;
14347
14710
  }
14348
- function ensureCell(sheet, row2, col) {
14349
- const existing = getCell(sheet, row2, col);
14350
- if (existing) return existing;
14351
- const cell = { value: null };
14352
- const styleId = baseStyleId(sheet, row2, col);
14353
- if (styleId) cell.styleId = styleId;
14354
- putCell(sheet, row2, col, cell);
14355
- return cell;
14711
+ function sparklineValues(group, values2) {
14712
+ return group.displayEmptyCellsAs === "zero" ? values2.map((v) => v ?? 0) : [...values2];
14356
14713
  }
14357
- var isWholeColumns = (range2) => range2.start.row === 0 && range2.end.row >= MAX_ROW;
14358
- var isWholeRows = (range2) => range2.start.col === 0 && range2.end.col >= MAX_COL;
14359
- function clipToUsed(sheet, range2) {
14360
- const r = normalizeRange(range2);
14361
- const used = usedRange(sheet);
14362
- if (!used) return void 0;
14363
- const start = {
14364
- row: Math.max(r.start.row, used.start.row),
14365
- col: Math.max(r.start.col, used.start.col)
14714
+ function sparklineScale(group, all2, index2) {
14715
+ const own = extent(sparklineValues(group, all2[index2]?.values ?? []));
14716
+ const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
14717
+ const shared = needsGroup ? extent(all2.flatMap((data) => sparklineValues(group, data.values))) : void 0;
14718
+ const end = (type, manual, key) => {
14719
+ if (type === "custom" && manual !== void 0) return manual;
14720
+ if (type === "group" && shared) return shared[key];
14721
+ return own?.[key];
14366
14722
  };
14367
- const end = { row: Math.min(r.end.row, used.end.row), col: Math.min(r.end.col, used.end.col) };
14368
- return start.row > end.row || start.col > end.col ? void 0 : { start, end };
14369
- }
14370
- var DENSE_LIMIT = 25e4;
14371
- function forEachPosition(sheet, range2, visit2) {
14372
- let r = normalizeRange(range2);
14373
- const size = (r.end.row - r.start.row + 1) * (r.end.col - r.start.col + 1);
14374
- if (size > DENSE_LIMIT) r = clipToUsed(sheet, r);
14375
- if (!r) return;
14376
- for (let row2 = r.start.row; row2 <= r.end.row; row2++)
14377
- for (let col = r.start.col; col <= r.end.col; col++) visit2(row2, col);
14378
- }
14379
- function rawText(value2) {
14380
- if (value2 === null) return "";
14381
- if (isCellError(value2)) return value2.error;
14382
- if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
14383
- return String(value2);
14384
- }
14385
- function pruneCell(sheet, row2, col) {
14386
- const cell = getCell(sheet, row2, col);
14387
- if (!cell) return;
14388
- if (cell.value === null && cell.formula === void 0 && !cell.styleId && !cell.richText) {
14389
- const cells = sheet.rows.get(row2);
14390
- cells?.delete(col);
14391
- if (cells && cells.size === 0) sheet.rows.delete(row2);
14392
- }
14723
+ const min = end(group.minAxisType, group.manualMin, "min");
14724
+ const max = end(group.maxAxisType, group.manualMax, "max");
14725
+ return min === void 0 || max === void 0 ? void 0 : { min, max };
14393
14726
  }
14394
-
14395
- // xlsx/edit/shift-preserved.ts
14396
- var XM3 = "http://schemas.microsoft.com/office/excel/2006/main";
14397
- function hasPreservedOverflow(sheet, shift2, clipped, banded) {
14398
- const keys = banded ? ["extLst"] : [shift2.axis === "row" ? "rowBreaks" : "colBreaks", "extLst"];
14399
- for (const key of keys)
14400
- for (const xml of sheet.preserved.get(key) ?? []) {
14401
- if (!xml.includes(key === "extLst" ? "sqref" : "brk")) continue;
14402
- let root;
14403
- try {
14404
- root = parseXml(xml).documentElement;
14405
- } catch {
14406
- continue;
14407
- }
14408
- if (key === "extLst") {
14409
- if (descendants2(root, XM3, "sqref").some(
14410
- (node) => parseSqref(node.textContent ?? "").some(clipped)
14411
- ))
14412
- return true;
14413
- } else if (elements(root).some(
14414
- (node) => node.localName === "brk" && shiftIndex(Number(node.getAttribute("id") ?? "0"), shift2) === void 0
14415
- ))
14416
- return true;
14727
+ function positions(group, data, n) {
14728
+ const dates = data.dates;
14729
+ if (group.dateAxis && dates && dates.length === n) {
14730
+ const span4 = extent(dates);
14731
+ if (span4) {
14732
+ const width = span4.max - span4.min;
14733
+ return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
14417
14734
  }
14418
- return false;
14735
+ }
14736
+ if (group.dateAxis) return Array.from({ length: n }, () => null);
14737
+ return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
14419
14738
  }
14420
- function descendants2(root, ns, local) {
14421
- return Array.from(root.getElementsByTagNameNS(ns, local));
14739
+ function pointFacts(values2) {
14740
+ const numbers3 = values2.filter((x) => x !== null);
14741
+ let last = values2.length - 1;
14742
+ while (last >= 0 && values2[last] === null) last--;
14743
+ return {
14744
+ high: Math.max(...numbers3),
14745
+ low: Math.min(...numbers3),
14746
+ first: values2.findIndex((x) => x !== null),
14747
+ last
14748
+ };
14422
14749
  }
14423
- function editEntries(sheet, key, edit, quick) {
14424
- const list = sheet.preserved.get(key);
14425
- if (!list) return;
14426
- const next = [];
14427
- for (const xml of list) {
14428
- if (!quick(xml)) {
14429
- next.push(xml);
14430
- continue;
14431
- }
14432
- let doc;
14433
- try {
14434
- doc = parseXml(xml);
14435
- } catch {
14436
- next.push(xml);
14437
- continue;
14438
- }
14439
- const outcome = edit(doc.documentElement);
14440
- if (outcome === "same") next.push(xml);
14441
- else if (outcome === "changed") next.push(buildXml(doc));
14442
- }
14443
- if (next.length) sheet.preserved.set(key, next);
14444
- else sheet.preserved.delete(key);
14750
+ function pointColor(group, v, i2, facts, colors, markers) {
14751
+ let color = markers && group.markers ? colors.colorMarkers : void 0;
14752
+ if (group.negative && v < 0) color = colors.colorNegative;
14753
+ if (group.high && v === facts.high) color = colors.colorHigh;
14754
+ if (group.low && v === facts.low) color = colors.colorLow;
14755
+ if (group.first && i2 === facts.first) color = colors.colorFirst;
14756
+ if (group.last && i2 === facts.last) color = colors.colorLast;
14757
+ return color;
14445
14758
  }
14446
- function shiftBreaks(root, shift2) {
14447
- let changed = false;
14448
- for (const brk of elements(root).filter((e) => e.localName === "brk")) {
14449
- const id = Number(brk.getAttribute("id") ?? "0");
14450
- const moved = shiftIndex(id, shift2);
14451
- if (moved === id) continue;
14452
- changed = true;
14453
- if (moved === void 0 || moved === 0) root.removeChild(brk);
14454
- else brk.setAttribute("id", String(moved));
14455
- }
14456
- if (!changed) return "same";
14457
- const left2 = elements(root).filter((e) => e.localName === "brk");
14458
- if (!left2.length) return "drop";
14459
- if (root.hasAttribute("count")) root.setAttribute("count", String(left2.length));
14460
- if (root.hasAttribute("manualBreakCount")) {
14461
- const manual = left2.filter((b) => /^(1|true)$/.test(b.getAttribute("man") ?? "")).length;
14462
- root.setAttribute("manualBreakCount", String(manual));
14759
+ function resolveColors(group, theme2) {
14760
+ const out = { ...DEFAULTS };
14761
+ for (const key of Object.keys(DEFAULTS)) {
14762
+ const color = group[key];
14763
+ out[key] = resolveColor(color, theme2, DEFAULTS[key]) ?? DEFAULTS[key];
14463
14764
  }
14464
- return "changed";
14765
+ return out;
14465
14766
  }
14466
- function removeUpwards(node, root) {
14467
- let current = node;
14468
- while (current && current !== root) {
14469
- const parent = current.parentNode;
14470
- parent?.removeChild(current);
14471
- if (!parent) break;
14472
- const emptied = elements(parent).length === 0 || parent.localName === "sparklineGroup" && !elements(parent).some((e) => e.localName === "sparklines");
14767
+ function sparklineView(group, data, scale2, theme2) {
14768
+ const colors = resolveColors(group, theme2);
14769
+ const view = {
14770
+ type: group.type,
14771
+ color: colors.colorSeries,
14772
+ lineWeightPt: group.lineWeight,
14773
+ lines: [],
14774
+ markers: [],
14775
+ columns: []
14776
+ };
14777
+ const values2 = sparklineValues(group, data.values);
14778
+ const n = values2.length;
14779
+ if (!n || !scale2) return view;
14780
+ const facts = pointFacts(values2);
14781
+ const xs = positions(group, data, n);
14782
+ const flip = (x) => group.rightToLeft ? 1 - x : x;
14783
+ const range2 = scale2.max - scale2.min;
14784
+ const yOf = (v) => range2 ? Math.max(0, Math.min(1, (scale2.max - v) / range2)) : 0.5;
14785
+ if (group.type === "line") {
14786
+ let segment = [];
14787
+ values2.forEach((v, i2) => {
14788
+ const x = xs[i2];
14789
+ if (v === null || x === null || x === void 0) {
14790
+ if (group.displayEmptyCellsAs === "gap" && segment.length) {
14791
+ view.lines.push(segment);
14792
+ segment = [];
14793
+ }
14794
+ return;
14795
+ }
14796
+ const point = { x: flip(x), y: yOf(v) };
14797
+ segment.push(point);
14798
+ const color = pointColor(group, v, i2, facts, colors, true);
14799
+ if (color) view.markers.push({ ...point, color });
14800
+ });
14801
+ if (segment.length) view.lines.push(segment);
14802
+ } else {
14803
+ const dates = group.dateAxis && data.dates ? extent(data.dates) : void 0;
14804
+ const slot = dates ? 1 / Math.max(1, dates.max - dates.min + 1) : 1 / n;
14805
+ const w = slot * (1 - COLUMN_GAP);
14806
+ const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
14807
+ values2.forEach((v, i2) => {
14808
+ const position = xs[i2];
14809
+ if (v === null || position === null || position === void 0) return;
14810
+ if (v === 0) return;
14811
+ let top;
14812
+ let bottom;
14813
+ if (group.type === "stacked") [top, bottom] = v > 0 ? [0, 0.5] : [0.5, 1];
14814
+ else if (!range2) [top, bottom] = [0, 1];
14815
+ else [top, bottom] = [Math.min(base, yOf(v)), Math.max(base, yOf(v))];
14816
+ const centre = flip(slot / 2 + position * (1 - slot));
14817
+ const color = pointColor(group, v, i2, facts, colors, false) ?? view.color;
14818
+ view.columns.push({ x: centre - w / 2, y: top, w, h: bottom - top, color });
14819
+ });
14820
+ }
14821
+ if (group.type === "stacked") {
14822
+ if (group.displayXAxis) view.axis = { y: 0.5, color: colors.colorAxis };
14823
+ } else if (group.displayXAxis && range2 && scale2.min <= 0 && scale2.max >= 0)
14824
+ view.axis = { y: yOf(0), color: colors.colorAxis };
14825
+ return view;
14826
+ }
14827
+
14828
+ // xlsx/layout/sparkline-data.ts
14829
+ var MAX_POINTS = 1e4;
14830
+ var hostIndex = /* @__PURE__ */ new WeakMap();
14831
+ function hosts(sheet) {
14832
+ const groups = sheetSparklineGroups(sheet);
14833
+ let index2 = hostIndex.get(groups);
14834
+ if (!index2) {
14835
+ index2 = /* @__PURE__ */ new Map();
14836
+ for (const group of groups)
14837
+ group.sparklines.forEach((line2, i2) => {
14838
+ const key = cellKey(line2.host.start.row, line2.host.start.col);
14839
+ if (!index2.has(key)) index2.set(key, { group, index: i2 });
14840
+ });
14841
+ hostIndex.set(groups, index2);
14842
+ }
14843
+ return index2;
14844
+ }
14845
+ function hasSparklineAt(sheet, row2, col) {
14846
+ return hosts(sheet).has(cellKey(row2, col));
14847
+ }
14848
+ function resolveSparklineRange(workbook, sheet, formula) {
14849
+ const ref = formula.trim().replace(/^=/, "");
14850
+ const bang = ref.lastIndexOf("!");
14851
+ let target2 = sheet;
14852
+ if (bang >= 0) {
14853
+ const raw = ref.slice(0, bang);
14854
+ const name = /^'.*'$/.test(raw) ? raw.slice(1, -1).replace(/''/g, "'") : raw;
14855
+ target2 = sheetByName(workbook, name);
14856
+ }
14857
+ const range2 = parseRange(ref.slice(bang + 1).replace(/\$/g, ""));
14858
+ return target2 && range2 ? { sheet: target2, range: normalizeRange(range2) } : void 0;
14859
+ }
14860
+ var rowHidden = (sheet, row2) => sheet.rowInfo.get(row2)?.hidden === true;
14861
+ var colHidden = (sheet, col) => sheet.columns.some((c) => c.hidden === true && col >= c.min && col <= c.max);
14862
+ function readSparklineValues(sheet, range2, displayHidden) {
14863
+ let endRow = range2.end.row;
14864
+ if (endRow - range2.start.row >= MAX_POINTS) {
14865
+ let lastRow = range2.start.row;
14866
+ for (const row2 of sheet.rows.keys()) if (row2 > lastRow) lastRow = row2;
14867
+ endRow = Math.min(endRow, lastRow);
14868
+ }
14869
+ const out = [];
14870
+ for (let row2 = range2.start.row; row2 <= endRow && out.length < MAX_POINTS; row2++) {
14871
+ if (!displayHidden && rowHidden(sheet, row2)) continue;
14872
+ for (let col = range2.start.col; col <= range2.end.col && out.length < MAX_POINTS; col++) {
14873
+ if (!displayHidden && colHidden(sheet, col)) continue;
14874
+ const value2 = getCell(sheet, row2, col)?.value;
14875
+ out.push(typeof value2 === "number" && Number.isFinite(value2) ? value2 : null);
14876
+ }
14877
+ }
14878
+ return out;
14879
+ }
14880
+ function groupData(workbook, sheet, group) {
14881
+ const dateRange = group.dateAxis && group.dateFormula;
14882
+ const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
14883
+ const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, true) : void 0;
14884
+ return group.sparklines.map((line2) => {
14885
+ const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
14886
+ if (group.dateAxis) {
14887
+ if (!source || !dates || !dateValues) return { values: [], dates: [] };
14888
+ const raw = readSparklineValues(source.sheet, source.range, true);
14889
+ if (raw.length !== dateValues.length) return { values: [], dates: [] };
14890
+ const hidden = (ref, i2) => {
14891
+ const columns = ref.range.end.col - ref.range.start.col + 1;
14892
+ return rowHidden(ref.sheet, ref.range.start.row + Math.floor(i2 / columns)) || colHidden(ref.sheet, ref.range.start.col + i2 % columns);
14893
+ };
14894
+ const pairs = dateValues.flatMap(
14895
+ (date, i2) => date === null || !group.displayHidden && (hidden(source, i2) || hidden(dates, i2)) ? [] : [{ date, value: raw[i2] }]
14896
+ );
14897
+ pairs.sort((a, b) => a.date - b.date);
14898
+ return { values: pairs.map((pair) => pair.value), dates: pairs.map((pair) => pair.date) };
14899
+ }
14900
+ const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
14901
+ return { values: values2 };
14902
+ });
14903
+ }
14904
+ function sparklineViewAt(workbook, sheetIndex2, row2, col) {
14905
+ const sheet = workbook.sheets[sheetIndex2];
14906
+ if (!sheet) return void 0;
14907
+ const entry = hosts(sheet).get(cellKey(row2, col));
14908
+ if (!entry) return void 0;
14909
+ const { group, index: index2 } = entry;
14910
+ const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
14911
+ const data = needsGroup ? groupData(workbook, sheet, group) : groupData(workbook, sheet, { ...group, sparklines: [group.sparklines[index2]] });
14912
+ const at = needsGroup ? index2 : 0;
14913
+ return sparklineView(
14914
+ group,
14915
+ data[at] ?? { values: [] },
14916
+ sparklineScale(group, data, at),
14917
+ workbook.theme
14918
+ );
14919
+ }
14920
+
14921
+ // xlsx/edit/context.ts
14922
+ function sheetAt(workbook, index2) {
14923
+ const sheet = Number.isInteger(index2) ? workbook.sheets[index2] : void 0;
14924
+ if (!sheet) throw new RangeError(`No sheet at index ${index2}`);
14925
+ return sheet;
14926
+ }
14927
+ function baseStyleId(sheet, row2, col) {
14928
+ const rowStyle = sheet.rowInfo.get(row2)?.styleId;
14929
+ if (rowStyle) return rowStyle;
14930
+ const column = sheet.columns.find((c) => col >= c.min && col <= c.max);
14931
+ return column?.styleId || void 0;
14932
+ }
14933
+ function ensureCell(sheet, row2, col) {
14934
+ const existing = getCell(sheet, row2, col);
14935
+ if (existing) return existing;
14936
+ const cell = { value: null };
14937
+ const styleId = baseStyleId(sheet, row2, col);
14938
+ if (styleId) cell.styleId = styleId;
14939
+ putCell(sheet, row2, col, cell);
14940
+ return cell;
14941
+ }
14942
+ var isWholeColumns = (range2) => range2.start.row === 0 && range2.end.row >= MAX_ROW;
14943
+ var isWholeRows = (range2) => range2.start.col === 0 && range2.end.col >= MAX_COL;
14944
+ function clipToUsed(sheet, range2) {
14945
+ const r = normalizeRange(range2);
14946
+ const used = usedRange(sheet);
14947
+ if (!used) return void 0;
14948
+ const start = {
14949
+ row: Math.max(r.start.row, used.start.row),
14950
+ col: Math.max(r.start.col, used.start.col)
14951
+ };
14952
+ const end = { row: Math.min(r.end.row, used.end.row), col: Math.min(r.end.col, used.end.col) };
14953
+ return start.row > end.row || start.col > end.col ? void 0 : { start, end };
14954
+ }
14955
+ var DENSE_LIMIT = 25e4;
14956
+ function forEachPosition(sheet, range2, visit2) {
14957
+ let r = normalizeRange(range2);
14958
+ const size = (r.end.row - r.start.row + 1) * (r.end.col - r.start.col + 1);
14959
+ if (size > DENSE_LIMIT) r = clipToUsed(sheet, r);
14960
+ if (!r) return;
14961
+ for (let row2 = r.start.row; row2 <= r.end.row; row2++)
14962
+ for (let col = r.start.col; col <= r.end.col; col++) visit2(row2, col);
14963
+ }
14964
+ function rawText(value2) {
14965
+ if (value2 === null) return "";
14966
+ if (isCellError(value2)) return value2.error;
14967
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
14968
+ return String(value2);
14969
+ }
14970
+ function pruneCell(sheet, row2, col) {
14971
+ const cell = getCell(sheet, row2, col);
14972
+ if (!cell) return;
14973
+ if (cell.value === null && cell.formula === void 0 && !cell.styleId && !cell.richText) {
14974
+ const cells = sheet.rows.get(row2);
14975
+ cells?.delete(col);
14976
+ if (cells && cells.size === 0) sheet.rows.delete(row2);
14977
+ }
14978
+ }
14979
+
14980
+ // xlsx/edit/shift-preserved.ts
14981
+ var XM3 = "http://schemas.microsoft.com/office/excel/2006/main";
14982
+ function hasPreservedOverflow(sheet, shift2, clipped, banded) {
14983
+ const keys = banded ? ["extLst"] : [shift2.axis === "row" ? "rowBreaks" : "colBreaks", "extLst"];
14984
+ for (const key of keys)
14985
+ for (const xml of sheet.preserved.get(key) ?? []) {
14986
+ if (!xml.includes(key === "extLst" ? "sqref" : "brk")) continue;
14987
+ let root;
14988
+ try {
14989
+ root = parseXml(xml).documentElement;
14990
+ } catch {
14991
+ continue;
14992
+ }
14993
+ if (key === "extLst") {
14994
+ if (descendants2(root, XM3, "sqref").some(
14995
+ (node) => parseSqref(node.textContent ?? "").some(clipped)
14996
+ ))
14997
+ return true;
14998
+ } else if (elements(root).some(
14999
+ (node) => node.localName === "brk" && shiftIndex(Number(node.getAttribute("id") ?? "0"), shift2) === void 0
15000
+ ))
15001
+ return true;
15002
+ }
15003
+ return false;
15004
+ }
15005
+ function descendants2(root, ns, local) {
15006
+ return Array.from(root.getElementsByTagNameNS(ns, local));
15007
+ }
15008
+ function editEntries(sheet, key, edit, quick) {
15009
+ const list = sheet.preserved.get(key);
15010
+ if (!list) return;
15011
+ const next = [];
15012
+ for (const xml of list) {
15013
+ if (!quick(xml)) {
15014
+ next.push(xml);
15015
+ continue;
15016
+ }
15017
+ let doc;
15018
+ try {
15019
+ doc = parseXml(xml);
15020
+ } catch {
15021
+ next.push(xml);
15022
+ continue;
15023
+ }
15024
+ const outcome = edit(doc.documentElement);
15025
+ if (outcome === "same") next.push(xml);
15026
+ else if (outcome === "changed") next.push(buildXml(doc));
15027
+ }
15028
+ if (next.length) sheet.preserved.set(key, next);
15029
+ else sheet.preserved.delete(key);
15030
+ }
15031
+ function shiftBreaks(root, shift2) {
15032
+ let changed = false;
15033
+ for (const brk of elements(root).filter((e) => e.localName === "brk")) {
15034
+ const id = Number(brk.getAttribute("id") ?? "0");
15035
+ const moved = shiftIndex(id, shift2);
15036
+ if (moved === id) continue;
15037
+ changed = true;
15038
+ if (moved === void 0 || moved === 0) root.removeChild(brk);
15039
+ else brk.setAttribute("id", String(moved));
15040
+ }
15041
+ if (!changed) return "same";
15042
+ const left2 = elements(root).filter((e) => e.localName === "brk");
15043
+ if (!left2.length) return "drop";
15044
+ if (root.hasAttribute("count")) root.setAttribute("count", String(left2.length));
15045
+ if (root.hasAttribute("manualBreakCount")) {
15046
+ const manual = left2.filter((b) => /^(1|true)$/.test(b.getAttribute("man") ?? "")).length;
15047
+ root.setAttribute("manualBreakCount", String(manual));
15048
+ }
15049
+ return "changed";
15050
+ }
15051
+ function removeUpwards(node, root) {
15052
+ let current = node;
15053
+ while (current && current !== root) {
15054
+ const parent = current.parentNode;
15055
+ parent?.removeChild(current);
15056
+ if (!parent) break;
15057
+ const emptied = elements(parent).length === 0 || parent.localName === "sparklineGroup" && !elements(parent).some((e) => e.localName === "sparklines");
14473
15058
  if (!emptied) break;
14474
15059
  current = parent;
14475
15060
  }
@@ -14579,6 +15164,13 @@ function rewriteFormulas(workbook, rewrite, formulaCells) {
14579
15164
  }
14580
15165
  function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
14581
15166
  rewritePreservedFormulas(sheet, rewrite);
15167
+ for (const pivot of sheet.pivotTables ?? []) {
15168
+ const next = safe(rewrite, pivot.source, sheet.name);
15169
+ if (next !== pivot.source) {
15170
+ pivot.source = next;
15171
+ pivot.dirty = true;
15172
+ }
15173
+ }
14582
15174
  {
14583
15175
  const name = sheet.name;
14584
15176
  for (const table2 of sheet.tables)
@@ -14931,20 +15523,20 @@ function addRowIntersections(sheet, r, patcher) {
14931
15523
  }
14932
15524
 
14933
15525
  // xlsx/edit/format.ts
14934
- function stylePatcher(workbook, patch) {
15526
+ function stylePatcher(workbook, patch2) {
14935
15527
  const memo = /* @__PURE__ */ new Map();
14936
15528
  return (id) => {
14937
15529
  const key = id ?? 0;
14938
15530
  let next = memo.get(key);
14939
15531
  if (next === void 0) {
14940
- next = applyStylePatch(workbook, id, patch);
15532
+ next = applyStylePatch(workbook, id, patch2);
14941
15533
  memo.set(key, next);
14942
15534
  }
14943
15535
  return next;
14944
15536
  };
14945
15537
  }
14946
- function patchRange(workbook, sheet, range2, patch) {
14947
- patchRangeWith(sheet, range2, stylePatcher(workbook, patch));
15538
+ function patchRange(workbook, sheet, range2, patch2) {
15539
+ patchRangeWith(sheet, range2, stylePatcher(workbook, patch2));
14948
15540
  }
14949
15541
  function patchRangeWith(sheet, range2, patcher) {
14950
15542
  const r = normalizeRange(range2);
@@ -14989,11 +15581,11 @@ function formatScopes(index2, ranges) {
14989
15581
  const whole = ranges.some((r) => isWholeColumns(r) || isWholeRows(r));
14990
15582
  return whole ? [cells, { kind: "parts", sheet: index2, parts: ["columns", "rowInfo"] }] : [cells];
14991
15583
  }
14992
- function applyStyle(ctx, s, ranges, patch) {
15584
+ function applyStyle(ctx, s, ranges, patch2) {
14993
15585
  const sheet = sheetAt(ctx.workbook, s);
14994
15586
  const normalized = ranges.map(normalizeRange);
14995
15587
  if (!normalized.length) return;
14996
- const patcher = stylePatcher(ctx.workbook, patch);
15588
+ const patcher = stylePatcher(ctx.workbook, patch2);
14997
15589
  ctx.run(
14998
15590
  "Format cells",
14999
15591
  "format",
@@ -15044,13 +15636,13 @@ function linearTrend(values2) {
15044
15636
  const n = values2.length;
15045
15637
  const meanX = (n - 1) / 2;
15046
15638
  const meanY = values2.reduce((a, b) => a + b, 0) / n;
15047
- let num2 = 0;
15639
+ let num3 = 0;
15048
15640
  let den = 0;
15049
15641
  values2.forEach((y, x) => {
15050
- num2 += (x - meanX) * (y - meanY);
15642
+ num3 += (x - meanX) * (y - meanY);
15051
15643
  den += (x - meanX) ** 2;
15052
15644
  });
15053
- const slope = den ? num2 / den : 0;
15645
+ const slope = den ? num3 / den : 0;
15054
15646
  return (k) => Number((meanY + slope * (k - meanX)).toPrecision(15));
15055
15647
  }
15056
15648
  var isDigit5 = (ch) => ch !== void 0 && ch >= "0" && ch <= "9";
@@ -15653,6 +16245,17 @@ function setBorders(ctx, s, range2, preset, edge = { style: "thin" }) {
15653
16245
 
15654
16246
  // xlsx/edit/insert-guard.ts
15655
16247
  function assertInsertFits(sheet, shift2, band) {
16248
+ for (const pivot of sheet.pivotTables ?? []) {
16249
+ const start = pivot.location.start[shift2.axis];
16250
+ const end = pivot.location.end[shift2.axis];
16251
+ const other2 = shift2.axis === "row" ? "col" : "row";
16252
+ if (band && (band.hi < pivot.location.start[other2] || band.lo > pivot.location.end[other2]))
16253
+ continue;
16254
+ const partial = band && (band.lo > pivot.location.start[other2] || band.hi < pivot.location.end[other2]);
16255
+ const overlap = shift2.count > 0 ? shift2.at > start && shift2.at <= end : shift2.at <= end && shift2.at - shift2.count > start;
16256
+ if (overlap || partial && shift2.at <= end)
16257
+ throw new Error("Cannot move or remove part of a PivotTable. Delete the PivotTable first.");
16258
+ }
15656
16259
  if (shift2.count <= 0) return;
15657
16260
  const max = shift2.axis === "row" ? MAX_ROW : MAX_COL;
15658
16261
  if (shift2.at + shift2.count > max + 1)
@@ -15720,6 +16323,13 @@ function shiftSheetContent(sheet, shift2, band) {
15720
16323
  return range2 ? [{ ...c, address: range2.start }] : [];
15721
16324
  });
15722
16325
  sheet.tables = sheet.tables.flatMap((t) => shiftTable(sheet, t, shift2, moveRange));
16326
+ for (const pivot of sheet.pivotTables ?? []) {
16327
+ const location = moveRange(pivot.location);
16328
+ if (location) {
16329
+ pivot.location = location;
16330
+ pivot.dirty = true;
16331
+ }
16332
+ }
15723
16333
  for (const drawing of sheet.drawings) shiftAnchor(drawing.anchor, shift2, band);
15724
16334
  if (!band) shiftAxisFormats(sheet, shift2);
15725
16335
  if (sheet.autoFilter) {
@@ -15962,13 +16572,13 @@ function htmlHref(link) {
15962
16572
  const href = link?.target ? `${link.target}${link.location ? `#${link.location}` : ""}` : link?.location ? `#${link.location}` : void 0;
15963
16573
  return href && (href.startsWith("#") || hyperlinkPolicy(href).store) ? href : void 0;
15964
16574
  }
15965
- function hyperlinkFromHtmlAttributes(attrs, range2) {
15966
- const href = attrs?.get("href");
16575
+ function hyperlinkFromHtmlAttributes(attrs2, range2) {
16576
+ const href = attrs2?.get("href");
15967
16577
  if (!href || !href.startsWith("#") && !hyperlinkPolicy(href).store) return void 0;
15968
16578
  const link = { range: range2 };
15969
16579
  if (href.startsWith("#")) link.location = href.slice(1);
15970
16580
  else link.target = href;
15971
- const tooltip = attrs?.get("title");
16581
+ const tooltip = attrs2?.get("title");
15972
16582
  if (tooltip) link.tooltip = tooltip;
15973
16583
  return link;
15974
16584
  }
@@ -16065,21 +16675,21 @@ function toHtml(cells, theme2) {
16065
16675
  for (let c = 0; c < cells.cols; c++) {
16066
16676
  if (covered.has(`${r},${c}`)) continue;
16067
16677
  const cell = cells.data[r]?.[c] ?? null;
16068
- const attrs = [];
16678
+ const attrs2 = [];
16069
16679
  const span4 = spans2.get(`${r},${c}`);
16070
16680
  if (span4 && span4.end.row > span4.start.row)
16071
- attrs.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16681
+ attrs2.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16072
16682
  if (span4 && span4.end.col > span4.start.col)
16073
- attrs.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16074
- if (cell && typeof cell.value === "number") attrs.push(`x:num="${cell.value}"`);
16683
+ attrs2.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16684
+ if (cell && typeof cell.value === "number") attrs2.push(`x:num="${cell.value}"`);
16075
16685
  const css = cssFor(cell?.style, theme2);
16076
- if (css) attrs.push(`style="${escapeHtml(css)}"`);
16686
+ if (css) attrs2.push(`style="${escapeHtml(css)}"`);
16077
16687
  let text2 = escapeHtml(cell?.text ?? "").replace(/\n/g, "<br>");
16078
16688
  const link = links.get(`${r},${c}`);
16079
16689
  const href = htmlHref(link);
16080
16690
  if (href)
16081
16691
  text2 = `<a href="${escapeHtml(href)}"${link?.tooltip ? ` title="${escapeHtml(link.tooltip)}"` : ""}>${text2}</a>`;
16082
- tds.push(`<td${attrs.length ? ` ${attrs.join(" ")}` : ""}>${text2}</td>`);
16692
+ tds.push(`<td${attrs2.length ? ` ${attrs2.join(" ")}` : ""}>${text2}</td>`);
16083
16693
  }
16084
16694
  rows2.push(`<tr>${tds.join("")}</tr>`);
16085
16695
  }
@@ -16139,12 +16749,12 @@ function decodeEntities(text2) {
16139
16749
  });
16140
16750
  }
16141
16751
  function parseAttributes(text2) {
16142
- const attrs = /* @__PURE__ */ new Map();
16752
+ const attrs2 = /* @__PURE__ */ new Map();
16143
16753
  for (const m of text2.matchAll(
16144
16754
  /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
16145
16755
  ))
16146
- attrs.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16147
- return attrs;
16756
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16757
+ return attrs2;
16148
16758
  }
16149
16759
  function parseCss(text2) {
16150
16760
  const out = /* @__PURE__ */ new Map();
@@ -16170,7 +16780,7 @@ var V_ALIGN = {
16170
16780
  bottom: "bottom"
16171
16781
  };
16172
16782
  function stylePatchFromCss(css, inner2) {
16173
- const patch = {};
16783
+ const patch2 = {};
16174
16784
  const font = {};
16175
16785
  const weight = css.get("font-weight");
16176
16786
  if (weight && (weight === "bold" || Number(weight) >= 600) || /<(b|strong)\b/i.test(inner2))
@@ -16186,16 +16796,16 @@ function stylePatchFromCss(css, inner2) {
16186
16796
  if (size) font.size = Number(size[1]) * (size[2] === "px" ? 0.75 : 1);
16187
16797
  const family = css.get("font-family")?.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
16188
16798
  if (family) font.name = family;
16189
- if (Object.keys(font).length) patch.font = font;
16799
+ if (Object.keys(font).length) patch2.font = font;
16190
16800
  const background = css.get("background-color") ?? css.get("background");
16191
16801
  const fill = background && parseCssColor(background.split(/\s+/)[0] ?? "");
16192
- if (fill) patch.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16802
+ if (fill) patch2.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16193
16803
  const h2 = H_ALIGN[css.get("text-align") ?? ""];
16194
16804
  const v = V_ALIGN[css.get("vertical-align") ?? ""];
16195
- if (h2 || v) patch.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16805
+ if (h2 || v) patch2.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16196
16806
  const numFmt = css.get("mso-number-format");
16197
- if (numFmt) patch.numFmt = decodeNumberFormat(numFmt);
16198
- return patch;
16807
+ if (numFmt) patch2.numFmt = decodeNumberFormat(numFmt);
16808
+ return patch2;
16199
16809
  }
16200
16810
  function removeComments(text2) {
16201
16811
  let out = "";
@@ -16270,18 +16880,18 @@ function parseHtmlTable(html, base) {
16270
16880
  /<t([dh])\b([^>]*)>([\s\S]*?)(?:<\/t[dh]>|(?=<t[dh]\b)|$)/gi
16271
16881
  )) {
16272
16882
  while (taken.has(`${r},${c}`)) c++;
16273
- const attrs = parseAttributes(td[2] ?? "");
16883
+ const attrs2 = parseAttributes(td[2] ?? "");
16274
16884
  const inner2 = td[3] ?? "";
16275
16885
  const css = /* @__PURE__ */ new Map();
16276
- for (const name of (attrs.get("class") ?? "").split(/\s+/))
16886
+ for (const name of (attrs2.get("class") ?? "").split(/\s+/))
16277
16887
  for (const [k, v] of parseCss(classes.get(name) ?? "")) css.set(k, v);
16278
- for (const [k, v] of parseCss(attrs.get("style") ?? "")) css.set(k, v);
16279
- const patch = stylePatchFromCss(css, inner2);
16280
- if (td[1]?.toLowerCase() === "h") patch.font = { bold: true, ...patch.font };
16888
+ for (const [k, v] of parseCss(attrs2.get("style") ?? "")) css.set(k, v);
16889
+ const patch2 = stylePatchFromCss(css, inner2);
16890
+ if (td[1]?.toLowerCase() === "h") patch2.font = { bold: true, ...patch2.font };
16281
16891
  const text2 = cellText(inner2);
16282
- row2[c] = text2 === "" && !Object.keys(patch).length ? null : toCell(text2, attrs, patch, base);
16283
- const rowSpan = Math.max(1, Number(attrs.get("rowspan") ?? 1) || 1);
16284
- const colSpan = Math.max(1, Number(attrs.get("colspan") ?? 1) || 1);
16892
+ row2[c] = text2 === "" && !Object.keys(patch2).length ? null : toCell(text2, attrs2, patch2, base);
16893
+ const rowSpan = Math.max(1, Number(attrs2.get("rowspan") ?? 1) || 1);
16894
+ const colSpan = Math.max(1, Number(attrs2.get("colspan") ?? 1) || 1);
16285
16895
  const anchor = /<a\b([^>]*)>/i.exec(inner2);
16286
16896
  const linkAttrs = anchor ? parseAttributes(anchor[1] ?? "") : void 0;
16287
16897
  const link = hyperlinkFromHtmlAttributes(linkAttrs, {
@@ -16311,17 +16921,17 @@ function parseHtmlTable(html, base) {
16311
16921
  );
16312
16922
  return rows2 && cols ? { rows: rows2, cols, data, merges, hyperlinks } : void 0;
16313
16923
  }
16314
- function toCell(text2, attrs, patch, base) {
16924
+ function toCell(text2, attrs2, patch2, base) {
16315
16925
  let value2 = text2;
16316
- const num2 = attrs.get("x:num");
16317
- if (num2 !== void 0 && num2 !== "" && Number.isFinite(Number(num2))) value2 = Number(num2);
16318
- else if (attrs.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16319
- else if (patch.numFmt !== "@" && text2 !== "") {
16926
+ const num3 = attrs2.get("x:num");
16927
+ if (num3 !== void 0 && num3 !== "" && Number.isFinite(Number(num3))) value2 = Number(num3);
16928
+ else if (attrs2.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16929
+ else if (patch2.numFmt !== "@" && text2 !== "") {
16320
16930
  const parsed = parseCellInput(text2);
16321
16931
  if (parsed.formula === void 0) value2 = parsed.value;
16322
- if (!patch.numFmt && parsed.numFmt && typeof value2 === "number") patch.numFmt = parsed.numFmt;
16932
+ if (!patch2.numFmt && parsed.numFmt && typeof value2 === "number") patch2.numFmt = parsed.numFmt;
16323
16933
  }
16324
- return { value: value2, text: text2, style: patchStyle(base, patch) };
16934
+ return { value: value2, text: text2, style: patchStyle(base, patch2) };
16325
16935
  }
16326
16936
 
16327
16937
  // xlsx/edit/clipboard-text.ts
@@ -17868,10 +18478,10 @@ var SessionCalculator = class {
17868
18478
 
17869
18479
  // xlsx/edit/doc-properties.ts
17870
18480
  var same2 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
17871
- function setDocumentProperties(ctx, patch) {
18481
+ function setDocumentProperties(ctx, patch2) {
17872
18482
  const prior = ctx.workbook.properties;
17873
18483
  const next = { ...prior };
17874
- for (const [key, value2] of Object.entries(patch)) {
18484
+ for (const [key, value2] of Object.entries(patch2)) {
17875
18485
  if (value2 === void 0) continue;
17876
18486
  if (value2 === null) delete next[key];
17877
18487
  else next[key] = structuredClone(value2);
@@ -17924,6 +18534,444 @@ function deleteDrawing(ctx, s, index2) {
17924
18534
  );
17925
18535
  }
17926
18536
 
18537
+ // xlsx/edit/sparkline-xml.ts
18538
+ var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
18539
+ var URI = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
18540
+ var COLORS2 = [
18541
+ "colorSeries",
18542
+ "colorNegative",
18543
+ "colorAxis",
18544
+ "colorMarkers",
18545
+ "colorFirst",
18546
+ "colorLast",
18547
+ "colorHigh",
18548
+ "colorLow"
18549
+ ];
18550
+ var SCALARS = [
18551
+ "type",
18552
+ "lineWeight",
18553
+ "markers",
18554
+ "high",
18555
+ "low",
18556
+ "first",
18557
+ "last",
18558
+ "negative",
18559
+ "displayEmptyCellsAs",
18560
+ "displayXAxis",
18561
+ "displayHidden",
18562
+ "rightToLeft",
18563
+ "minAxisType",
18564
+ "maxAxisType",
18565
+ "manualMin",
18566
+ "manualMax"
18567
+ ];
18568
+ function cleanSparklinePatch(patch2) {
18569
+ return Object.fromEntries(
18570
+ [...SCALARS, ...COLORS2].flatMap((key) => patch2[key] === void 0 ? [] : [[key, patch2[key]]])
18571
+ );
18572
+ }
18573
+ function patchSparklineNode(node, patch2) {
18574
+ for (const key of SCALARS) {
18575
+ const value2 = patch2[key];
18576
+ if (value2 === void 0) continue;
18577
+ node.setAttribute(key, typeof value2 === "boolean" ? value2 ? "1" : "0" : String(value2));
18578
+ }
18579
+ if (patch2.minAxisType && patch2.minAxisType !== "custom") node.removeAttribute("manualMin");
18580
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom") node.removeAttribute("manualMax");
18581
+ for (const key of COLORS2) {
18582
+ const color = patch2[key];
18583
+ if (!color) continue;
18584
+ const fresh = parseXml(
18585
+ `<x14:root xmlns:x14="${NS.x14}">${colorXml(color, `x14:${key}`)}</x14:root>`
18586
+ ).documentElement.firstChild;
18587
+ const replacement = node.ownerDocument.importNode(fresh, true);
18588
+ const old = first(node, key, NS.x14);
18589
+ if (old) node.replaceChild(replacement, old);
18590
+ else {
18591
+ const before = elements(node).find((child) => {
18592
+ const index2 = COLORS2.indexOf(child.localName);
18593
+ return index2 > COLORS2.indexOf(key) || child.localName === "f" || child.localName === "sparklines";
18594
+ });
18595
+ node.insertBefore(replacement, before ?? null);
18596
+ }
18597
+ }
18598
+ }
18599
+ function editSparklineXml(sheet, edit) {
18600
+ return (sheet.preserved.get("extLst") ?? []).map((xml) => {
18601
+ if (!xml.includes("sparklineGroup")) return xml;
18602
+ const doc = parseXml(xml);
18603
+ let changed = false;
18604
+ for (const node of Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup"))) {
18605
+ if (!edit(node, readSparklineGroup(node))) continue;
18606
+ changed = true;
18607
+ const lines = first(node, "sparklines", NS.x14);
18608
+ if (!lines || !children(lines, "sparkline", NS.x14).length) {
18609
+ const groups = node.parentNode;
18610
+ groups.removeChild(node);
18611
+ if (!children(groups, "sparklineGroup", NS.x14).length)
18612
+ groups.parentNode.removeChild(groups);
18613
+ }
18614
+ }
18615
+ return changed ? buildXml(doc.documentElement) : xml;
18616
+ });
18617
+ }
18618
+ function appendSparklineXml(sheet, groupXml) {
18619
+ const source = [...sheet.preserved.get("extLst") ?? []];
18620
+ const found = source.findIndex((xml) => xml.includes("sparklineGroups"));
18621
+ const index2 = found >= 0 ? found : 0;
18622
+ const doc = parseXml(source[index2] ?? `<extLst xmlns="${NS.x}"/>`);
18623
+ const root = doc.documentElement;
18624
+ let ext = children(root, "ext", NS.x).find(
18625
+ (node) => node.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
18626
+ );
18627
+ if (!ext) {
18628
+ ext = doc.createElementNS(NS.x, "ext");
18629
+ ext.setAttribute("uri", URI);
18630
+ ext.setAttribute("xmlns:x14", NS.x14);
18631
+ root.appendChild(ext);
18632
+ }
18633
+ ext.setAttribute("uri", URI);
18634
+ let groups = first(ext, "sparklineGroups", NS.x14);
18635
+ if (!groups) {
18636
+ groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
18637
+ groups.setAttribute("xmlns:xm", XM4);
18638
+ ext.appendChild(groups);
18639
+ }
18640
+ const fresh = doc.importNode(parseXml(groupXml).documentElement, true);
18641
+ const revision = "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2";
18642
+ if (Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup")).some(
18643
+ (node) => node.hasAttributeNS(revision, "uid")
18644
+ )) {
18645
+ fresh.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xr2", revision);
18646
+ fresh.setAttributeNS(revision, "xr2:uid", `{${globalThis.crypto.randomUUID().toUpperCase()}}`);
18647
+ }
18648
+ groups.appendChild(fresh);
18649
+ source[index2] = buildXml(root);
18650
+ return source;
18651
+ }
18652
+
18653
+ // xlsx/edit/sparklines.ts
18654
+ function selectedSparklineGroups(sheet, ranges) {
18655
+ return sheetSparklineGroups(sheet).filter(
18656
+ (group) => group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host)))
18657
+ );
18658
+ }
18659
+ function validateSettings(group) {
18660
+ for (const key of [
18661
+ "markers",
18662
+ "high",
18663
+ "low",
18664
+ "first",
18665
+ "last",
18666
+ "negative",
18667
+ "displayXAxis",
18668
+ "displayHidden",
18669
+ "rightToLeft"
18670
+ ])
18671
+ if (typeof group[key] !== "boolean") throw new Error("The sparkline settings are not valid.");
18672
+ if (!["line", "column", "stacked"].includes(group.type) || !["gap", "zero", "span"].includes(group.displayEmptyCellsAs) || !["individual", "group", "custom"].includes(group.minAxisType) || !["individual", "group", "custom"].includes(group.maxAxisType))
18673
+ throw new Error("The sparkline settings are not valid.");
18674
+ if (!Number.isFinite(group.lineWeight) || group.lineWeight < 0 || group.lineWeight > 1584)
18675
+ throw new Error("The sparkline settings are not valid.");
18676
+ if (group.minAxisType === "custom" && !Number.isFinite(group.manualMin) || group.maxAxisType === "custom" && !Number.isFinite(group.manualMax) || group.minAxisType === "custom" && group.maxAxisType === "custom" && group.manualMin > group.manualMax)
18677
+ throw new Error("The sparkline axis limits are not valid.");
18678
+ if (group.manualMin !== void 0 && group.minAxisType !== "custom" || group.manualMax !== void 0 && group.maxAxisType !== "custom")
18679
+ throw new Error("The sparkline axis limits are not valid.");
18680
+ for (const key of [
18681
+ "colorSeries",
18682
+ "colorNegative",
18683
+ "colorAxis",
18684
+ "colorMarkers",
18685
+ "colorFirst",
18686
+ "colorLast",
18687
+ "colorHigh",
18688
+ "colorLow"
18689
+ ]) {
18690
+ const color = group[key];
18691
+ if (color !== void 0 && (color === null || typeof color !== "object" || Array.isArray(color) || ![color.rgb, color.theme, color.indexed].some((value2) => value2 !== void 0)))
18692
+ throw new Error("The sparkline settings are not valid.");
18693
+ if (color && (color.auto || color.rgb !== void 0 && !/^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(color.rgb) || color.theme !== void 0 && (!Number.isInteger(color.theme) || color.theme < 0 || color.theme > 11) || color.indexed !== void 0 && (!Number.isInteger(color.indexed) || color.indexed < 0 || color.indexed > 65) || color.tint !== void 0 && (!Number.isFinite(color.tint) || color.tint < -1 || color.tint > 1)))
18694
+ throw new Error("The sparkline settings are not valid.");
18695
+ }
18696
+ }
18697
+ function validatePatch(group, patch2) {
18698
+ const next = { ...group, ...patch2 };
18699
+ if (patch2.minAxisType && patch2.minAxisType !== "custom" && patch2.manualMin === void 0)
18700
+ delete next.manualMin;
18701
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom" && patch2.manualMax === void 0)
18702
+ delete next.manualMax;
18703
+ validateSettings(next);
18704
+ }
18705
+ function save(ctx, s, next, label3, ranges) {
18706
+ const sheet = sheetAt(ctx.workbook, s);
18707
+ ctx.run(
18708
+ label3,
18709
+ "annotations",
18710
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
18711
+ () => sheet.preserved.set("extLst", next),
18712
+ { sheet: s, ranges }
18713
+ );
18714
+ }
18715
+ function createSparklineGroup(ctx, s, source, locations, patch2 = {}) {
18716
+ patch2 = cleanSparklinePatch(patch2);
18717
+ locations = checkedSparklineRange(locations);
18718
+ const sheet = sheetAt(ctx.workbook, s);
18719
+ const lines = newSparklines(ctx.workbook, s, source, locations);
18720
+ if (selectedSparklineGroups(sheet, [locations]).length)
18721
+ throw new Error("The location range already contains sparklines.");
18722
+ if (sheet.merges.some((merge2) => lines.some((line2) => rangesIntersect(merge2, line2.host))))
18723
+ throw new Error("Sparklines cannot be created in merged cells.");
18724
+ const body2 = lines.map(
18725
+ (line2) => `<x14:sparkline>${el("xm:f", {}, escapeText(line2.formula))}${el("xm:sqref", {}, formatRange(line2.host))}</x14:sparkline>`
18726
+ ).join("");
18727
+ const colors = '<x14:colorSeries theme="4"/><x14:colorNegative rgb="FFD00000"/><x14:colorAxis rgb="FF000000"/>' + ["Markers", "First", "Last", "High", "Low"].map((name) => `<x14:color${name} rgb="FFD00000"/>`).join("");
18728
+ const doc = parseXml(
18729
+ `<x14:sparklineGroup xmlns:x14="${NS.x14}" xmlns:xm="${XM4}">${colors}<x14:sparklines>${body2}</x14:sparklines></x14:sparklineGroup>`
18730
+ );
18731
+ const node = doc.documentElement;
18732
+ validatePatch(readSparklineGroup(node), patch2);
18733
+ patchSparklineNode(node, { displayEmptyCellsAs: "gap", ...patch2 });
18734
+ validateSettings({ ...readSparklineGroup(node), ...patch2 });
18735
+ save(ctx, s, appendSparklineXml(sheet, buildXml(node)), "Create sparklines", [locations]);
18736
+ }
18737
+ function setSparklineGroups(ctx, s, ranges, patch2) {
18738
+ patch2 = cleanSparklinePatch(patch2);
18739
+ const sheet = sheetAt(ctx.workbook, s);
18740
+ ranges = ranges.map(checkedSparklineRange);
18741
+ const selected2 = selectedSparklineGroups(sheet, ranges);
18742
+ if (!selected2.length) return;
18743
+ for (const group of selected2) validatePatch(group, patch2);
18744
+ const next = editSparklineXml(sheet, (node, group) => {
18745
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18746
+ return false;
18747
+ patchSparklineNode(node, patch2);
18748
+ return true;
18749
+ });
18750
+ save(ctx, s, next, "Format sparklines", ranges);
18751
+ }
18752
+ function setSparklineDateRange(ctx, s, ranges, source = "") {
18753
+ ranges = ranges.map(checkedSparklineRange);
18754
+ const sheet = sheetAt(ctx.workbook, s);
18755
+ const groups = selectedSparklineGroups(sheet, ranges);
18756
+ if (!groups.length) return;
18757
+ let formula;
18758
+ if (source.trim()) {
18759
+ const data = sparklineDataRange(ctx.workbook, s, source);
18760
+ const length = (range2) => {
18761
+ const rows2 = range2.end.row - range2.start.row + 1;
18762
+ const cols = range2.end.col - range2.start.col + 1;
18763
+ if (rows2 > 1 && cols > 1) throw new Error("The date range must be one row or column.");
18764
+ return Math.max(rows2, cols);
18765
+ };
18766
+ const count2 = length(data.range);
18767
+ if (count2 > 1e4) throw new Error("The sparkline date range is too large.");
18768
+ for (const group of groups)
18769
+ for (const line2 of group.sparklines) {
18770
+ const values2 = sparklineDataRange(ctx.workbook, s, line2.formula ?? "");
18771
+ if (length(values2.range) !== count2)
18772
+ throw new Error("The data range and date range do not match.");
18773
+ }
18774
+ formula = `'${ctx.workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!${formatRange(data.range)}`;
18775
+ }
18776
+ const next = editSparklineXml(sheet, (node, group) => {
18777
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18778
+ return false;
18779
+ for (const old of children(node, "f", XM4)) node.removeChild(old);
18780
+ node.setAttribute("dateAxis", formula ? "1" : "0");
18781
+ if (formula) {
18782
+ const value2 = node.ownerDocument.createElementNS(XM4, "xm:f");
18783
+ value2.textContent = formula;
18784
+ node.insertBefore(value2, first(node, "sparklines", NS.x14) ?? null);
18785
+ }
18786
+ return true;
18787
+ });
18788
+ save(ctx, s, next, "Change sparkline date axis", ranges);
18789
+ }
18790
+ function deleteSparklines(ctx, s, ranges, wholeGroups = false) {
18791
+ ranges = ranges.map(checkedSparklineRange);
18792
+ const sheet = sheetAt(ctx.workbook, s);
18793
+ if (!selectedSparklineGroups(sheet, ranges).length) return;
18794
+ const next = editSparklineXml(sheet, (node, group) => {
18795
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18796
+ return false;
18797
+ const lines = first(node, "sparklines", NS.x14);
18798
+ const nodes = children(lines, "sparkline", NS.x14);
18799
+ for (const line2 of nodes) {
18800
+ const host = parseRange(first(line2, "sqref", XM4)?.textContent ?? "");
18801
+ if (wholeGroups || host && ranges.some((range2) => rangesIntersect(range2, host)))
18802
+ line2.parentNode?.removeChild(line2);
18803
+ }
18804
+ return true;
18805
+ });
18806
+ save(ctx, s, next, "Clear sparklines", ranges);
18807
+ }
18808
+
18809
+ // xlsx/edit/pivots.ts
18810
+ function pivotAt(ctx, sheet, name) {
18811
+ const pivot = sheetAt(ctx.workbook, sheet).pivotTables?.find((entry) => entry.name === name);
18812
+ if (!pivot) throw new Error("The selected PivotTable is not available.");
18813
+ return pivot;
18814
+ }
18815
+ function uniqueName(ctx) {
18816
+ const used = reservedPivotNames(ctx.workbook);
18817
+ for (let i2 = 1; ; i2++) if (!used.has(`pivottable${i2}`)) return `PivotTable${i2}`;
18818
+ }
18819
+ function reservedPivotNames(workbook) {
18820
+ return new Set(
18821
+ workbook.sheets.flatMap((sheet) => [
18822
+ ...(sheet.pivotTables ?? []).map((pivot) => pivot.name),
18823
+ ...sheet.preserved.get("source:unsupportedPivotNames") ?? []
18824
+ ]).map((name) => name.toLowerCase())
18825
+ );
18826
+ }
18827
+ function checkName(ctx, name) {
18828
+ if (!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name) || name.length > 255 || parseAddress(name) || reservedPivotNames(ctx.workbook).has(name.toLowerCase()))
18829
+ throw new Error("A PivotTable name must be unique and cannot look like a cell reference.");
18830
+ }
18831
+ function plan(ctx, s, pivot, old) {
18832
+ const sheet = sheetAt(ctx.workbook, s);
18833
+ const grid6 = pivotGrid(pivot);
18834
+ const start = pivot.location.start;
18835
+ const location = {
18836
+ start,
18837
+ end: {
18838
+ row: start.row + grid6.values.length - 1,
18839
+ col: start.col + (grid6.values[0]?.length ?? 0) - 1
18840
+ }
18841
+ };
18842
+ if (![start.row, start.col].every(Number.isInteger) || start.row < 0 || start.col < 0 || location.end.row > MAX_ROW || location.end.col > MAX_COL)
18843
+ throw new Error("The PivotTable result does not fit on the worksheet.");
18844
+ const source = sparklineDataRange(ctx.workbook, s, pivot.source);
18845
+ if (source.sheet === s && rangesIntersect(source.range, location) || sheet.merges.some((range2) => rangesIntersect(range2, location)) || sheet.tables.some((table2) => rangesIntersect(table2.range, location)) || sheet.pivotTables?.some((other) => other !== old && rangesIntersect(other.location, location)))
18846
+ throw new Error("The PivotTable would overlap source data, another table or merged cells.");
18847
+ let occupied = false;
18848
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18849
+ if ((!old || !rangeContains(old.location, { row: row2, col })) && (cell.value !== null || cell.formula !== void 0))
18850
+ occupied = true;
18851
+ });
18852
+ if (occupied) throw new Error("The PivotTable would overwrite existing cell content.");
18853
+ return { grid: grid6, location };
18854
+ }
18855
+ function write(ctx, s, pivot, old) {
18856
+ const sheet = sheetAt(ctx.workbook, s);
18857
+ const { grid: grid6, location } = plan(ctx, s, pivot, old);
18858
+ const ranges = [...old ? [old.location] : [], location];
18859
+ ctx.run(
18860
+ old ? "Refresh PivotTable" : "Create PivotTable",
18861
+ "annotations",
18862
+ [
18863
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18864
+ { kind: "cells", sheet: s, ranges }
18865
+ ],
18866
+ () => {
18867
+ const compact3 = pivot.layout === "compact";
18868
+ const indents = [
18869
+ stylePatcher(ctx.workbook, {
18870
+ alignment: { indent: 0, ...compact3 ? { horizontal: "left" } : {} }
18871
+ }),
18872
+ stylePatcher(ctx.workbook, { alignment: { indent: 1, horizontal: "left" } })
18873
+ ];
18874
+ const styles = /* @__PURE__ */ new Map();
18875
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18876
+ if (cell.styleId !== void 0) styles.set(`${row2}:${col}`, cell.styleId);
18877
+ });
18878
+ if (old)
18879
+ forEachCellInRange(sheet, old.location, (cell, row2, col) => {
18880
+ if (cell.styleId !== void 0)
18881
+ putCell(sheet, row2, col, { value: null, styleId: cell.styleId });
18882
+ else deleteCell(sheet, row2, col);
18883
+ });
18884
+ const next = { ...pivot, location, dirty: true };
18885
+ const list = sheet.pivotTables ?? [];
18886
+ sheet.pivotTables = old ? list.map((entry) => entry === old ? next : entry) : [...list, next];
18887
+ grid6.values.forEach(
18888
+ (line2, row2) => line2.forEach((value2, col) => {
18889
+ const r = startRow(location, row2);
18890
+ const c = location.start.col + col;
18891
+ let styleId = styles.get(`${r}:${c}`);
18892
+ if (col < (grid6.rowLabelColumns ?? 1)) {
18893
+ const indent = col === 0 ? grid6.indents?.[row2] ?? 0 : 0;
18894
+ const alignment = styleAt(ctx.workbook, styleId).alignment;
18895
+ if ((alignment?.indent ?? 0) !== indent || compact3 && alignment?.horizontal !== "left")
18896
+ styleId = indents[indent](styleId);
18897
+ }
18898
+ putCell(sheet, r, c, { value: value2, ...styleId !== void 0 ? { styleId } : {} });
18899
+ })
18900
+ );
18901
+ },
18902
+ { sheet: s, ranges }
18903
+ );
18904
+ }
18905
+ var startRow = (range2, offset2) => range2.start.row + offset2;
18906
+ function createPivotTable(ctx, s, destination, options) {
18907
+ const data = pivotSourceData(ctx.workbook, s, options.source);
18908
+ const name = options.name ?? uniqueName(ctx);
18909
+ checkName(ctx, name);
18910
+ const aggregate3 = options.aggregate ?? "sum";
18911
+ const pivot = {
18912
+ ...data,
18913
+ name,
18914
+ rowField: options.rowField,
18915
+ layout: options.layout ?? "tabular",
18916
+ subtotalPosition: options.subtotalPosition ?? (options.layout && options.layout !== "tabular" ? "top" : "bottom"),
18917
+ ...options.secondRowField ? { secondRowField: options.secondRowField } : {},
18918
+ ...options.subtotals !== void 0 ? { subtotals: options.subtotals } : {},
18919
+ ...options.repeatLabels !== void 0 ? { repeatLabels: options.repeatLabels } : {},
18920
+ valueField: options.valueField,
18921
+ aggregate: aggregate3,
18922
+ valueCaption: pivotCaption(aggregate3, options.valueField),
18923
+ location: { start: { ...destination }, end: { ...destination } },
18924
+ ...options.columnField ? { columnField: options.columnField } : {}
18925
+ };
18926
+ validatePivotFields(pivot);
18927
+ write(ctx, s, pivot);
18928
+ return name;
18929
+ }
18930
+ function refreshPivotTable(ctx, s, name, patch2 = {}) {
18931
+ const old = pivotAt(ctx, s, name);
18932
+ const aggregate3 = patch2.aggregate ?? old.aggregate;
18933
+ const valueField = patch2.valueField ?? old.valueField;
18934
+ const next = {
18935
+ ...old,
18936
+ ...pivotSourceData(ctx.workbook, s, old.source),
18937
+ rowField: patch2.rowField ?? old.rowField,
18938
+ valueField,
18939
+ aggregate: aggregate3,
18940
+ valueCaption: aggregate3 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate3, valueField)
18941
+ };
18942
+ if (patch2.columnField !== void 0) {
18943
+ if (patch2.columnField) next.columnField = patch2.columnField;
18944
+ else delete next.columnField;
18945
+ }
18946
+ if (patch2.secondRowField !== void 0) {
18947
+ if (patch2.secondRowField) next.secondRowField = patch2.secondRowField;
18948
+ else delete next.secondRowField;
18949
+ }
18950
+ if (patch2.subtotals !== void 0) next.subtotals = patch2.subtotals;
18951
+ if (patch2.repeatLabels !== void 0) next.repeatLabels = patch2.repeatLabels;
18952
+ if (patch2.layout !== void 0) next.layout = patch2.layout;
18953
+ if (patch2.subtotalPosition !== void 0) next.subtotalPosition = patch2.subtotalPosition;
18954
+ validatePivotFields(next);
18955
+ write(ctx, s, next, old);
18956
+ }
18957
+ function deletePivotTable(ctx, s, name) {
18958
+ const sheet = sheetAt(ctx.workbook, s);
18959
+ const pivot = pivotAt(ctx, s, name);
18960
+ ctx.run(
18961
+ "Delete PivotTable",
18962
+ "annotations",
18963
+ [
18964
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18965
+ { kind: "cells", sheet: s, ranges: [pivot.location] }
18966
+ ],
18967
+ () => {
18968
+ sheet.pivotTables = sheet.pivotTables.filter((entry) => entry !== pivot);
18969
+ forEachCellInRange(sheet, pivot.location, (_cell, row2, col) => deleteCell(sheet, row2, col));
18970
+ },
18971
+ { sheet: s, ranges: [pivot.location] }
18972
+ );
18973
+ }
18974
+
17927
18975
  // xlsx/edit/cell-style.ts
17928
18976
  function ensureNamedStyle(workbook, name) {
17929
18977
  const lower2 = name.toLowerCase();
@@ -18031,19 +19079,19 @@ function addChart(ctx, s, chart) {
18031
19079
  { sheet: s }
18032
19080
  );
18033
19081
  }
18034
- function updateChart(ctx, s, index2, patch) {
18035
- assertBarClusterOptions(patch);
19082
+ function updateChart(ctx, s, index2, patch2) {
19083
+ assertBarClusterOptions(patch2);
18036
19084
  const sheet = sheetAt(ctx.workbook, s);
18037
19085
  const chart = sheet.drawings[index2];
18038
19086
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index2}`);
18039
- const formatting = patch.elementFills ? chartWithElementFills(chart, patch.elementFills).formatting : void 0;
19087
+ const formatting = patch2.elementFills ? chartWithElementFills(chart, patch2.elementFills).formatting : void 0;
18040
19088
  ctx.run(
18041
19089
  "Edit chart",
18042
19090
  "annotations",
18043
19091
  [{ kind: "sheet", sheet: s }],
18044
19092
  () => {
18045
19093
  const live = sheet.drawings[index2];
18046
- const changes = structuredClone(patch);
19094
+ const changes = structuredClone(patch2);
18047
19095
  delete changes.elementFills;
18048
19096
  if (formatting) live.formatting = formatting;
18049
19097
  changes.series?.forEach((series, i2) => {
@@ -18269,6 +19317,8 @@ function resizeTableIn(workbook, sheet, id, range2) {
18269
19317
  throw new Error("The table range is too small.");
18270
19318
  if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
18271
19319
  throw new Error("A table cannot overlap another table.");
19320
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
19321
+ throw new Error("A table cannot overlap a PivotTable.");
18272
19322
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
18273
19323
  throw new Error("A table cannot contain merged cells.");
18274
19324
  const oldEnd = table2.range.end.row;
@@ -18291,17 +19341,17 @@ var STYLE_KEYS = [
18291
19341
  "showFirstColumn",
18292
19342
  "showLastColumn"
18293
19343
  ];
18294
- function updateTable(ctx, s, ref, patch) {
19344
+ function updateTable(ctx, s, ref, patch2) {
18295
19345
  const { workbook } = ctx;
18296
19346
  const sheet = sheetAt(workbook, s);
18297
19347
  const current = sheet.tables[tableIndex(sheet, ref)];
18298
- const name = patch.name ?? patch.displayName;
19348
+ const name = patch2.name ?? patch2.displayName;
18299
19349
  const renaming = name !== void 0 && name !== current.name;
18300
19350
  if (renaming) {
18301
19351
  const problem = validateTableName(workbook, name, current);
18302
19352
  if (problem) throw new Error(problem);
18303
19353
  }
18304
- const wide = renaming || patch.headerRow !== void 0 || patch.totalsRow !== void 0;
19354
+ const wide = renaming || patch2.headerRow !== void 0 || patch2.totalsRow !== void 0;
18305
19355
  const scope = wide ? { kind: "workbook" } : { kind: "sheet", sheet: s };
18306
19356
  const id = current.id;
18307
19357
  ctx.run(
@@ -18312,25 +19362,25 @@ function updateTable(ctx, s, ref, patch) {
18312
19362
  const table2 = byId(sheet, id);
18313
19363
  if (renaming) renameTableIn(workbook, table2, name);
18314
19364
  for (const key of STYLE_KEYS) {
18315
- if (!(key in patch)) continue;
18316
- const value2 = patch[key];
19365
+ if (!(key in patch2)) continue;
19366
+ const value2 = patch2[key];
18317
19367
  if (value2 === void 0) delete table2[key];
18318
19368
  else table2[key] = value2;
18319
19369
  }
18320
- if (patch.columns) {
19370
+ if (patch2.columns) {
18321
19371
  const width = table2.range.end.col - table2.range.start.col + 1;
18322
- if (patch.columns.length !== width) throw new Error("Give one column per table column.");
19372
+ if (patch2.columns.length !== width) throw new Error("Give one column per table column.");
18323
19373
  const before = table2.columns;
18324
- table2.columns = structuredClone(patch.columns);
19374
+ table2.columns = structuredClone(patch2.columns);
18325
19375
  for (const [index2, column] of table2.columns.entries()) {
18326
19376
  const sourceId = before[index2]?.sourceId;
18327
19377
  if (column.sourceId === void 0 && sourceId !== void 0) column.sourceId = sourceId;
18328
19378
  }
18329
19379
  }
18330
- if (patch.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch.headerRow);
18331
- if (patch.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch.totalsRow);
18332
- else if (patch.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
18333
- if (patch.range) resizeTableIn(workbook, sheet, id, patch.range);
19380
+ if (patch2.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch2.headerRow);
19381
+ if (patch2.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch2.totalsRow);
19382
+ else if (patch2.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
19383
+ if (patch2.range) resizeTableIn(workbook, sheet, id, patch2.range);
18334
19384
  },
18335
19385
  { sheet: s, ranges: [current.range], structural: true }
18336
19386
  );
@@ -18512,36 +19562,233 @@ function compact2(value2) {
18512
19562
  if (value2[key] === void 0) delete value2[key];
18513
19563
  return value2;
18514
19564
  }
18515
- function setPageSetup(ctx, s, patch) {
19565
+ function setPageSetup(ctx, s, patch2) {
18516
19566
  const sheet = sheetAt(ctx.workbook, s);
18517
19567
  ctx.run(
18518
19568
  "Page setup",
18519
19569
  "view",
18520
19570
  [{ kind: "sheet", sheet: s }],
18521
19571
  () => {
18522
- const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch) });
19572
+ const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch2) });
18523
19573
  if (Object.keys(next).length) sheet.pageSetup = next;
18524
19574
  else Reflect.deleteProperty(sheet, "pageSetup");
18525
19575
  },
18526
19576
  { sheet: s }
18527
19577
  );
18528
19578
  }
18529
- function setPrintOptions(ctx, s, patch) {
18530
- const sheet = sheetAt(ctx.workbook, s);
18531
- ctx.run(
18532
- "Print options",
18533
- "view",
18534
- [{ kind: "sheet", sheet: s }],
18535
- () => {
18536
- const next = { ...sheet.printOptions, ...patch };
18537
- for (const key of Object.keys(next))
18538
- if (!next[key]) delete next[key];
18539
- if (Object.keys(next).length) sheet.printOptions = next;
18540
- else Reflect.deleteProperty(sheet, "printOptions");
18541
- sheet.preserved.delete("printOptions");
18542
- },
18543
- { sheet: s }
18544
- );
19579
+ function setPrintOptions(ctx, s, patch2) {
19580
+ const sheet = sheetAt(ctx.workbook, s);
19581
+ ctx.run(
19582
+ "Print options",
19583
+ "view",
19584
+ [{ kind: "sheet", sheet: s }],
19585
+ () => {
19586
+ const next = { ...sheet.printOptions, ...patch2 };
19587
+ for (const key of Object.keys(next))
19588
+ if (!next[key]) delete next[key];
19589
+ if (Object.keys(next).length) sheet.printOptions = next;
19590
+ else Reflect.deleteProperty(sheet, "printOptions");
19591
+ sheet.preserved.delete("printOptions");
19592
+ },
19593
+ { sheet: s }
19594
+ );
19595
+ }
19596
+
19597
+ // xlsx/edit/page-breaks.ts
19598
+ function patch(xml, before, present, axis) {
19599
+ const doc = parseXml(xml);
19600
+ const root = doc.documentElement;
19601
+ const breaks = children(root, "brk", NS.x);
19602
+ for (const node of breaks)
19603
+ if (!present && /^(1|true)$/.test(node.getAttribute("man") ?? "") && (before === void 0 || Number(node.getAttribute("id")) === before))
19604
+ root.removeChild(node);
19605
+ if (present && before !== void 0) {
19606
+ const existing = children(root, "brk", NS.x).find(
19607
+ (node2) => Number(node2.getAttribute("id")) === before
19608
+ );
19609
+ const node = existing ?? doc.createElementNS(NS.x, "brk");
19610
+ node.setAttribute("id", String(before));
19611
+ node.setAttribute("min", "0");
19612
+ node.setAttribute("max", String(axis === "row" ? MAX_COL : MAX_ROW));
19613
+ node.setAttribute("man", "1");
19614
+ if (!existing) root.appendChild(node);
19615
+ }
19616
+ const remaining = children(root, "brk", NS.x);
19617
+ if (remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length > 1026)
19618
+ throw new Error("A worksheet can have at most 1026 manual breaks on each axis.");
19619
+ if (!elements(root).length) return void 0;
19620
+ root.setAttribute("count", String(remaining.length));
19621
+ root.setAttribute(
19622
+ "manualBreakCount",
19623
+ String(remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length)
19624
+ );
19625
+ return buildXml(root);
19626
+ }
19627
+ function setPageBreak(ctx, s, axis, before, present = true) {
19628
+ if (typeof present !== "boolean" || !["row", "col"].includes(axis) || !Number.isInteger(before) || before <= 0 || before > (axis === "row" ? MAX_ROW : MAX_COL))
19629
+ throw new RangeError("Choose a row or column after the first to set a page break.");
19630
+ const sheet = sheetAt(ctx.workbook, s);
19631
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19632
+ const source = sheet.preserved.get(key) ?? [`<${key} xmlns="${NS.x}"/>`];
19633
+ const result2 = source.flatMap((xml, index2) => {
19634
+ const next = patch(xml, before, present && index2 === 0, axis);
19635
+ return next ? [next] : [];
19636
+ });
19637
+ ctx.run(
19638
+ present ? "Insert page break" : "Remove page break",
19639
+ "view",
19640
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19641
+ () => {
19642
+ if (result2.length) sheet.preserved.set(key, result2);
19643
+ else sheet.preserved.delete(key);
19644
+ },
19645
+ { sheet: s }
19646
+ );
19647
+ }
19648
+ function resetPageBreaks(ctx, s) {
19649
+ const sheet = sheetAt(ctx.workbook, s);
19650
+ const next = ["row", "col"].map((axis) => {
19651
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19652
+ return {
19653
+ key,
19654
+ xml: (sheet.preserved.get(key) ?? []).flatMap((xml) => {
19655
+ const result2 = patch(xml, void 0, false, axis);
19656
+ return result2 ? [result2] : [];
19657
+ })
19658
+ };
19659
+ });
19660
+ ctx.run(
19661
+ "Reset page breaks",
19662
+ "view",
19663
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19664
+ () => {
19665
+ for (const entry of next) {
19666
+ if (entry.xml.length) sheet.preserved.set(entry.key, entry.xml);
19667
+ else sheet.preserved.delete(entry.key);
19668
+ }
19669
+ },
19670
+ { sheet: s }
19671
+ );
19672
+ }
19673
+
19674
+ // xlsx/layout/print-titles.ts
19675
+ var PRINT_TITLES_NAME = "_xlnm.Print_Titles";
19676
+ function refs(ast) {
19677
+ return ast.type === "binary" && ast.op === "," ? [...refs(ast.left), ...refs(ast.right)] : [ast];
19678
+ }
19679
+ function printTitles(workbook, sheetIndex2) {
19680
+ const name = workbook.definedNames.find(
19681
+ (entry) => entry.name === PRINT_TITLES_NAME && entry.localSheet === sheetIndex2
19682
+ );
19683
+ if (!name) return {};
19684
+ try {
19685
+ const result2 = {};
19686
+ for (const node of refs(parseFormula(`(${name.formula})`))) {
19687
+ if (node.type !== "ref" || !node.ref || node.prefix?.book || node.prefix?.sheet2 || node.spill || node.prefix && node.prefix.sheet.toLowerCase() !== workbook.sheets[sheetIndex2]?.name.toLowerCase())
19688
+ throw new Error("Unsupported print title reference");
19689
+ const key = node.ref.kind === "rows" ? "rows" : node.ref.kind === "cols" ? "columns" : void 0;
19690
+ if (!key || result2[key]) throw new Error("Unsupported print title reference");
19691
+ const axis = key === "rows" ? "row" : "col";
19692
+ result2[key] = {
19693
+ start: Math.min(node.ref.start[axis], node.ref.end[axis]),
19694
+ end: Math.max(node.ref.start[axis], node.ref.end[axis])
19695
+ };
19696
+ }
19697
+ return result2;
19698
+ } catch {
19699
+ return { unsupported: true };
19700
+ }
19701
+ }
19702
+ function formatPrintTitleSpan(span4, axis) {
19703
+ return axis === "row" ? `$${span4.start + 1}:$${span4.end + 1}` : `$${columnLabel(span4.start)}:$${columnLabel(span4.end)}`;
19704
+ }
19705
+ function printTitlesFormula(sheet, titles) {
19706
+ return ["rows", "columns"].flatMap((key) => {
19707
+ const span4 = titles[key];
19708
+ if (!span4) return [];
19709
+ const max = key === "rows" ? MAX_ROW : MAX_COL;
19710
+ if (![span4.start, span4.end].every(Number.isInteger) || span4.start < 0 || span4.end < span4.start || span4.end > max)
19711
+ throw new Error("Print titles must be whole rows or whole columns.");
19712
+ return [
19713
+ `${quoteSheetName(sheet)}!${formatPrintTitleSpan(span4, key === "rows" ? "row" : "col")}`
19714
+ ];
19715
+ }).join(",");
19716
+ }
19717
+
19718
+ // xlsx/edit/view.ts
19719
+ function setFreeze(ctx, s, freeze) {
19720
+ const sheet = sheetAt(ctx.workbook, s);
19721
+ const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
19722
+ ctx.run(
19723
+ next ? "Freeze panes" : "Unfreeze panes",
19724
+ "view",
19725
+ [{ kind: "sheet", sheet: s }],
19726
+ () => {
19727
+ if (next) sheet.view.freeze = next;
19728
+ else delete sheet.view.freeze;
19729
+ },
19730
+ { sheet: s, structural: true }
19731
+ );
19732
+ }
19733
+ function setSheetView(ctx, s, patch2) {
19734
+ const sheet = sheetAt(ctx.workbook, s);
19735
+ ctx.run(
19736
+ "Sheet view",
19737
+ "view",
19738
+ [{ kind: "sheet", sheet: s }],
19739
+ () => {
19740
+ const view = { ...sheet.view, ...structuredClone(patch2) };
19741
+ for (const key of Object.keys(view))
19742
+ if (view[key] === void 0) delete view[key];
19743
+ if (patch2.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch2.zoom)));
19744
+ sheet.view = view;
19745
+ },
19746
+ { sheet: s, structural: patch2.zoom !== void 0 || "freeze" in patch2 }
19747
+ );
19748
+ }
19749
+ var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
19750
+ function validateDefinedName(name) {
19751
+ if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
19752
+ if (!NAME_PATTERN.test(name))
19753
+ return "A name must start with a letter, underscore or backslash and contain no spaces.";
19754
+ if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
19755
+ return "A name cannot look like a cell reference.";
19756
+ return void 0;
19757
+ }
19758
+ var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
19759
+ function setDefinedName(ctx, name) {
19760
+ const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
19761
+ if (problem) throw new Error(problem);
19762
+ if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
19763
+ const entry = structuredClone(name);
19764
+ entry.formula = entry.formula.replace(/^=/, "");
19765
+ ctx.run("Define name", "names", [{ kind: "meta" }], () => {
19766
+ const { definedNames } = ctx.workbook;
19767
+ const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
19768
+ if (index2 >= 0) definedNames[index2] = entry;
19769
+ else definedNames.push(entry);
19770
+ });
19771
+ }
19772
+ function deleteDefinedName(ctx, name, localSheet) {
19773
+ const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
19774
+ if (index2 < 0) return;
19775
+ ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
19776
+ ctx.workbook.definedNames.splice(index2, 1);
19777
+ });
19778
+ }
19779
+
19780
+ // xlsx/edit/print-titles.ts
19781
+ function setPrintTitles(ctx, sheet, patch2) {
19782
+ const ws = sheetAt(ctx.workbook, sheet);
19783
+ const existing = printTitles(ctx.workbook, sheet);
19784
+ if (existing.unsupported && !Object.hasOwn(patch2, "rows") && !Object.hasOwn(patch2, "columns"))
19785
+ return;
19786
+ if (existing.unsupported && (!Object.hasOwn(patch2, "rows") || !Object.hasOwn(patch2, "columns")))
19787
+ throw new Error("Replace both print title ranges to change unsupported titles.");
19788
+ const next = { ...existing, ...patch2 };
19789
+ const formula = printTitlesFormula(ws.name, next);
19790
+ if (formula) setDefinedName(ctx, { name: PRINT_TITLES_NAME, formula, localSheet: sheet });
19791
+ else deleteDefinedName(ctx, PRINT_TITLES_NAME, sheet);
18545
19792
  }
18546
19793
 
18547
19794
  // digest/algorithm-names.ts
@@ -19828,12 +21075,12 @@ function compress3(h2, data, offset2) {
19828
21075
  W3[i2 * 2 + 1] = lo;
19829
21076
  }
19830
21077
  let ah = h2[0], al = h2[1], bh = h2[2], bl = h2[3], ch = h2[4], cl = h2[5], dh = h2[6], dl = h2[7];
19831
- let eh = h2[8], el = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
21078
+ let eh = h2[8], el2 = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
19832
21079
  for (let i2 = 0; i2 < 80; i2++) {
19833
- const S1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23);
19834
- const S1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (eh >>> 9 | el << 23);
21080
+ const S1h = (eh >>> 14 | el2 << 18) ^ (eh >>> 18 | el2 << 14) ^ (el2 >>> 9 | eh << 23);
21081
+ const S1l = (el2 >>> 14 | eh << 18) ^ (el2 >>> 18 | eh << 14) ^ (eh >>> 9 | el2 << 23);
19835
21082
  const chh = eh & fh ^ ~eh & gh;
19836
- const chl = el & fl ^ ~el & gl;
21083
+ const chl = el2 & fl ^ ~el2 & gl;
19837
21084
  let t1l = (hl >>> 0) + (S1l >>> 0) + (chl >>> 0) + K4[i2 * 2 + 1] + W3[i2 * 2 + 1];
19838
21085
  const t1h = hh + S1h + chh + K4[i2 * 2] + W3[i2 * 2] + Math.floor(t1l / 4294967296);
19839
21086
  t1l >>>= 0;
@@ -19849,10 +21096,10 @@ function compress3(h2, data, offset2) {
19849
21096
  gh = fh;
19850
21097
  gl = fl;
19851
21098
  fh = eh;
19852
- fl = el;
21099
+ fl = el2;
19853
21100
  let nl = (dl >>> 0) + t1l;
19854
21101
  eh = dh + t1h + Math.floor(nl / 4294967296) >>> 0;
19855
- el = nl >>> 0;
21102
+ el2 = nl >>> 0;
19856
21103
  dh = ch;
19857
21104
  dl = cl;
19858
21105
  ch = bh;
@@ -19872,7 +21119,7 @@ function compress3(h2, data, offset2) {
19872
21119
  add2(2, bh, bl);
19873
21120
  add2(4, ch, cl);
19874
21121
  add2(6, dh, dl);
19875
- add2(8, eh, el);
21122
+ add2(8, eh, el2);
19876
21123
  add2(10, fh, fl);
19877
21124
  add2(12, gh, gl);
19878
21125
  add2(14, hh, hl);
@@ -20423,6 +21670,8 @@ function merge(ctx, s, range2, mode) {
20423
21670
  if (r.start.row === r.end.row && r.start.col === r.end.col) return;
20424
21671
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
20425
21672
  throw new Error("Cells inside a table cannot be merged.");
21673
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
21674
+ throw new Error("Cells inside a PivotTable cannot be merged.");
20426
21675
  const targets = mergeTargets(r, mode);
20427
21676
  if (!targets.length) return;
20428
21677
  ctx.run(
@@ -20473,322 +21722,106 @@ function unmerge(ctx, s, range2) {
20473
21722
  "Unmerge cells",
20474
21723
  "format",
20475
21724
  [{ kind: "parts", sheet: s, parts: ["merges"] }],
20476
- () => {
20477
- sheet.merges = sheet.merges.filter((m) => !rangesIntersect(m, r));
20478
- },
20479
- { sheet: s, ranges: [r] }
20480
- );
20481
- }
20482
-
20483
- // xlsx/layout/style-view.ts
20484
- var BLACK = "#000000";
20485
- var WHITE = "#FFFFFF";
20486
- var PX_PER_PT = 96 / 72;
20487
- function mergeFont(base, font) {
20488
- if (!font) return base;
20489
- const out = { ...base };
20490
- for (const [key, value2] of Object.entries(font))
20491
- if (value2 !== void 0) out[key] = value2;
20492
- return out;
20493
- }
20494
- function fontView(font, theme2) {
20495
- const family = font.scheme === "major" ? theme2.majorFont || font.name || "Calibri Light" : font.scheme === "minor" ? theme2.minorFont || font.name || "Calibri" : font.name || theme2.minorFont || "Calibri";
20496
- const view = {
20497
- family,
20498
- sizePx: (font.size && font.size > 0 ? font.size : 11) * PX_PER_PT,
20499
- bold: font.bold === true,
20500
- italic: font.italic === true,
20501
- strike: font.strike === true,
20502
- color: resolveColor(font.color, theme2, BLACK) ?? BLACK
20503
- };
20504
- if (font.underline)
20505
- view.underline = font.underline === "double" || font.underline === "doubleAccounting" ? "double" : "single";
20506
- if (font.vertAlign === "superscript") view.vertAlign = "super";
20507
- else if (font.vertAlign === "subscript") view.vertAlign = "sub";
20508
- return view;
20509
- }
20510
- function fillView(fill, theme2, differential = false) {
20511
- if (!fill) return void 0;
20512
- if (fill.type === "gradient") {
20513
- const stops = [...fill.stops].sort((a, b) => a.position - b.position).map((stop) => `${resolveColor(stop.color, theme2, WHITE)} ${round2(stop.position * 100)}%`);
20514
- if (stops.length === 0) return void 0;
20515
- if (stops.length === 1) stops.push(stops[0] ?? WHITE);
20516
- const css = fill.gradient === "path" ? `radial-gradient(circle, ${stops.join(", ")})` : `linear-gradient(${round2(((fill.degree ?? 0) + 90) % 360)}deg, ${stops.join(", ")})`;
20517
- return { gradient: css };
20518
- }
20519
- if (fill.pattern === "none") {
20520
- if (differential && fill.bgColor)
20521
- return { background: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE };
20522
- return void 0;
20523
- }
20524
- if (fill.pattern === "solid") {
20525
- const color = differential ? fill.bgColor ?? fill.fgColor : fill.fgColor ?? fill.bgColor;
20526
- return { background: resolveColor(color, theme2, BLACK) ?? BLACK };
20527
- }
20528
- return {
20529
- pattern: fill.pattern,
20530
- fg: resolveColor(fill.fgColor, theme2, BLACK) ?? BLACK,
20531
- bg: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE
20532
- };
20533
- }
20534
- var round2 = (n) => Math.round(n * 100) / 100;
20535
- var BORDER_STYLES = {
20536
- hair: { widthPx: 1, style: "dotted" },
20537
- thin: { widthPx: 1, style: "solid" },
20538
- dotted: { widthPx: 1, style: "dotted" },
20539
- dashed: { widthPx: 1, style: "dashed" },
20540
- dashDot: { widthPx: 1, style: "dashed" },
20541
- dashDotDot: { widthPx: 1, style: "dashed" },
20542
- medium: { widthPx: 2, style: "solid" },
20543
- mediumDashed: { widthPx: 2, style: "dashed" },
20544
- mediumDashDot: { widthPx: 2, style: "dashed" },
20545
- mediumDashDotDot: { widthPx: 2, style: "dashed" },
20546
- slantDashDot: { widthPx: 2, style: "dashed" },
20547
- thick: { widthPx: 3, style: "solid" },
20548
- double: { widthPx: 3, style: "double" }
20549
- };
20550
- function edgeView(edge, theme2) {
20551
- if (!edge) return void 0;
20552
- const style2 = BORDER_STYLES[edge.style];
20553
- if (!style2) return void 0;
20554
- return { ...style2, color: resolveColor(edge.color, theme2, BLACK) ?? BLACK };
20555
- }
20556
- function mergeBorder(base, border) {
20557
- if (!border) return base;
20558
- const out = { ...base };
20559
- for (const [key, value2] of Object.entries(border))
20560
- if (value2 !== void 0) out[key] = value2;
20561
- return out;
20562
- }
20563
- function bordersView(border, theme2) {
20564
- const out = {};
20565
- const set = (key, edge) => {
20566
- const view = edgeView(edge, theme2);
20567
- if (view) out[key] = view;
20568
- };
20569
- set("top", border.top);
20570
- set("right", border.right);
20571
- set("bottom", border.bottom);
20572
- set("left", border.left);
20573
- if (border.diagonalUp) set("diagonalUp", border.diagonal);
20574
- if (border.diagonalDown) set("diagonalDown", border.diagonal);
20575
- return out;
20576
- }
20577
-
20578
- // xlsx/layout/sparkline-view.ts
20579
- var DEFAULTS = {
20580
- colorSeries: "#376092",
20581
- colorNegative: "#D00000",
20582
- colorAxis: "#000000",
20583
- colorMarkers: "#D00000",
20584
- colorFirst: "#D00000",
20585
- colorLast: "#D00000",
20586
- colorHigh: "#D00000",
20587
- colorLow: "#D00000"
20588
- };
20589
- var COLUMN_GAP = 0.2;
20590
- function extent(values2) {
20591
- let min = Infinity;
20592
- let max = -Infinity;
20593
- for (const v of values2) {
20594
- if (v === null) continue;
20595
- if (v < min) min = v;
20596
- if (v > max) max = v;
20597
- }
20598
- return min <= max ? { min, max } : void 0;
20599
- }
20600
- function sparklineValues(group, values2) {
20601
- return group.displayEmptyCellsAs === "zero" ? values2.map((v) => v ?? 0) : [...values2];
20602
- }
20603
- function sparklineScale(group, all2, index2) {
20604
- const own = extent(sparklineValues(group, all2[index2]?.values ?? []));
20605
- const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
20606
- const shared = needsGroup ? extent(all2.flatMap((data) => sparklineValues(group, data.values))) : void 0;
20607
- const end = (type, manual, key) => {
20608
- if (type === "custom" && manual !== void 0) return manual;
20609
- if (type === "group" && shared) return shared[key];
20610
- return own?.[key];
20611
- };
20612
- const min = end(group.minAxisType, group.manualMin, "min");
20613
- const max = end(group.maxAxisType, group.manualMax, "max");
20614
- return min === void 0 || max === void 0 ? void 0 : { min, max };
20615
- }
20616
- function positions(group, data, n) {
20617
- const dates = data.dates;
20618
- if (group.dateAxis && dates && dates.length === n) {
20619
- const span4 = extent(dates);
20620
- if (span4) {
20621
- const width = span4.max - span4.min;
20622
- return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
20623
- }
20624
- }
20625
- return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
20626
- }
20627
- function pointFacts(values2) {
20628
- const numbers3 = values2.filter((x) => x !== null);
20629
- let last = values2.length - 1;
20630
- while (last >= 0 && values2[last] === null) last--;
20631
- return {
20632
- high: Math.max(...numbers3),
20633
- low: Math.min(...numbers3),
20634
- first: values2.findIndex((x) => x !== null),
20635
- last
20636
- };
20637
- }
20638
- function pointColor(group, v, i2, facts, colors, markers) {
20639
- let color = markers && group.markers ? colors.colorMarkers : void 0;
20640
- if (group.negative && v < 0) color = colors.colorNegative;
20641
- if (group.high && v === facts.high) color = colors.colorHigh;
20642
- if (group.low && v === facts.low) color = colors.colorLow;
20643
- if (group.first && i2 === facts.first) color = colors.colorFirst;
20644
- if (group.last && i2 === facts.last) color = colors.colorLast;
20645
- return color;
20646
- }
20647
- function resolveColors(group, theme2) {
20648
- const out = { ...DEFAULTS };
20649
- for (const key of Object.keys(DEFAULTS)) {
20650
- const color = group[key];
20651
- out[key] = resolveColor(color, theme2, DEFAULTS[key]) ?? DEFAULTS[key];
20652
- }
20653
- return out;
20654
- }
20655
- function sparklineView(group, data, scale2, theme2) {
20656
- const colors = resolveColors(group, theme2);
20657
- const view = {
20658
- type: group.type,
20659
- color: colors.colorSeries,
20660
- lineWeightPt: group.lineWeight,
20661
- lines: [],
20662
- markers: [],
20663
- columns: []
20664
- };
20665
- const values2 = sparklineValues(group, data.values);
20666
- const n = values2.length;
20667
- if (!n || !scale2) return view;
20668
- const facts = pointFacts(values2);
20669
- const xs = positions(group, data, n);
20670
- const flip = (x) => group.rightToLeft ? 1 - x : x;
20671
- const range2 = scale2.max - scale2.min;
20672
- const yOf = (v) => range2 ? Math.max(0, Math.min(1, (scale2.max - v) / range2)) : 0.5;
20673
- if (group.type === "line") {
20674
- let segment = [];
20675
- values2.forEach((v, i2) => {
20676
- const x = xs[i2];
20677
- if (v === null || x === null || x === void 0) {
20678
- if (group.displayEmptyCellsAs === "gap" && segment.length) {
20679
- view.lines.push(segment);
20680
- segment = [];
20681
- }
20682
- return;
20683
- }
20684
- const point = { x: flip(x), y: yOf(v) };
20685
- segment.push(point);
20686
- const color = pointColor(group, v, i2, facts, colors, true);
20687
- if (color) view.markers.push({ ...point, color });
20688
- });
20689
- if (segment.length) view.lines.push(segment);
20690
- } else {
20691
- const slot = 1 / n;
20692
- const w = slot * (1 - COLUMN_GAP);
20693
- const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
20694
- values2.forEach((v, i2) => {
20695
- const position = xs[i2];
20696
- if (v === null || position === null || position === void 0) return;
20697
- if (v === 0) return;
20698
- let top;
20699
- let bottom;
20700
- if (group.type === "stacked") [top, bottom] = v > 0 ? [0, 0.5] : [0.5, 1];
20701
- else if (!range2) [top, bottom] = [0, 1];
20702
- else [top, bottom] = [Math.min(base, yOf(v)), Math.max(base, yOf(v))];
20703
- const centre = flip(slot / 2 + position * (1 - slot));
20704
- const color = pointColor(group, v, i2, facts, colors, false) ?? view.color;
20705
- view.columns.push({ x: centre - w / 2, y: top, w, h: bottom - top, color });
20706
- });
20707
- }
20708
- if (group.type === "stacked") {
20709
- if (group.displayXAxis) view.axis = { y: 0.5, color: colors.colorAxis };
20710
- } else if (group.displayXAxis && range2 && scale2.min <= 0 && scale2.max >= 0)
20711
- view.axis = { y: yOf(0), color: colors.colorAxis };
20712
- return view;
21725
+ () => {
21726
+ sheet.merges = sheet.merges.filter((m) => !rangesIntersect(m, r));
21727
+ },
21728
+ { sheet: s, ranges: [r] }
21729
+ );
20713
21730
  }
20714
21731
 
20715
- // xlsx/layout/sparkline-data.ts
20716
- var MAX_POINTS = 1e4;
20717
- var hostIndex = /* @__PURE__ */ new WeakMap();
20718
- function hosts(sheet) {
20719
- const groups = sheetSparklineGroups(sheet);
20720
- let index2 = hostIndex.get(groups);
20721
- if (!index2) {
20722
- index2 = /* @__PURE__ */ new Map();
20723
- for (const group of groups)
20724
- group.sparklines.forEach((line2, i2) => {
20725
- const key = cellKey(line2.host.start.row, line2.host.start.col);
20726
- if (!index2.has(key)) index2.set(key, { group, index: i2 });
20727
- });
20728
- hostIndex.set(groups, index2);
20729
- }
20730
- return index2;
21732
+ // xlsx/layout/style-view.ts
21733
+ var BLACK = "#000000";
21734
+ var WHITE = "#FFFFFF";
21735
+ var PX_PER_PT = 96 / 72;
21736
+ function mergeFont(base, font) {
21737
+ if (!font) return base;
21738
+ const out = { ...base };
21739
+ for (const [key, value2] of Object.entries(font))
21740
+ if (value2 !== void 0) out[key] = value2;
21741
+ return out;
20731
21742
  }
20732
- function hasSparklineAt(sheet, row2, col) {
20733
- return hosts(sheet).has(cellKey(row2, col));
21743
+ function fontView(font, theme2) {
21744
+ const family = font.scheme === "major" ? theme2.majorFont || font.name || "Calibri Light" : font.scheme === "minor" ? theme2.minorFont || font.name || "Calibri" : font.name || theme2.minorFont || "Calibri";
21745
+ const view = {
21746
+ family,
21747
+ sizePx: (font.size && font.size > 0 ? font.size : 11) * PX_PER_PT,
21748
+ bold: font.bold === true,
21749
+ italic: font.italic === true,
21750
+ strike: font.strike === true,
21751
+ color: resolveColor(font.color, theme2, BLACK) ?? BLACK
21752
+ };
21753
+ if (font.underline)
21754
+ view.underline = font.underline === "double" || font.underline === "doubleAccounting" ? "double" : "single";
21755
+ if (font.vertAlign === "superscript") view.vertAlign = "super";
21756
+ else if (font.vertAlign === "subscript") view.vertAlign = "sub";
21757
+ return view;
20734
21758
  }
20735
- function resolveSparklineRange(workbook, sheet, formula) {
20736
- const ref = formula.trim().replace(/^=/, "");
20737
- const bang = ref.lastIndexOf("!");
20738
- let target2 = sheet;
20739
- if (bang >= 0) {
20740
- const raw = ref.slice(0, bang);
20741
- const name = /^'.*'$/.test(raw) ? raw.slice(1, -1).replace(/''/g, "'") : raw;
20742
- target2 = sheetByName(workbook, name);
21759
+ function fillView(fill, theme2, differential = false) {
21760
+ if (!fill) return void 0;
21761
+ if (fill.type === "gradient") {
21762
+ const stops = [...fill.stops].sort((a, b) => a.position - b.position).map((stop) => `${resolveColor(stop.color, theme2, WHITE)} ${round2(stop.position * 100)}%`);
21763
+ if (stops.length === 0) return void 0;
21764
+ if (stops.length === 1) stops.push(stops[0] ?? WHITE);
21765
+ const css = fill.gradient === "path" ? `radial-gradient(circle, ${stops.join(", ")})` : `linear-gradient(${round2(((fill.degree ?? 0) + 90) % 360)}deg, ${stops.join(", ")})`;
21766
+ return { gradient: css };
20743
21767
  }
20744
- const range2 = parseRange(ref.slice(bang + 1).replace(/\$/g, ""));
20745
- return target2 && range2 ? { sheet: target2, range: normalizeRange(range2) } : void 0;
20746
- }
20747
- var rowHidden = (sheet, row2) => sheet.rowInfo.get(row2)?.hidden === true;
20748
- var colHidden = (sheet, col) => sheet.columns.some((c) => c.hidden === true && col >= c.min && col <= c.max);
20749
- function readSparklineValues(sheet, range2, displayHidden) {
20750
- let endRow = range2.end.row;
20751
- if (endRow - range2.start.row >= MAX_POINTS) {
20752
- let lastRow = range2.start.row;
20753
- for (const row2 of sheet.rows.keys()) if (row2 > lastRow) lastRow = row2;
20754
- endRow = Math.min(endRow, lastRow);
21768
+ if (fill.pattern === "none") {
21769
+ if (differential && fill.bgColor)
21770
+ return { background: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE };
21771
+ return void 0;
20755
21772
  }
20756
- const out = [];
20757
- for (let row2 = range2.start.row; row2 <= endRow && out.length < MAX_POINTS; row2++) {
20758
- if (!displayHidden && rowHidden(sheet, row2)) continue;
20759
- for (let col = range2.start.col; col <= range2.end.col && out.length < MAX_POINTS; col++) {
20760
- if (!displayHidden && colHidden(sheet, col)) continue;
20761
- const value2 = getCell(sheet, row2, col)?.value;
20762
- out.push(typeof value2 === "number" && Number.isFinite(value2) ? value2 : null);
20763
- }
21773
+ if (fill.pattern === "solid") {
21774
+ const color = differential ? fill.bgColor ?? fill.fgColor : fill.fgColor ?? fill.bgColor;
21775
+ return { background: resolveColor(color, theme2, BLACK) ?? BLACK };
20764
21776
  }
20765
- return out;
21777
+ return {
21778
+ pattern: fill.pattern,
21779
+ fg: resolveColor(fill.fgColor, theme2, BLACK) ?? BLACK,
21780
+ bg: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE
21781
+ };
20766
21782
  }
20767
- function groupData(workbook, sheet, group) {
20768
- const dateRange = group.dateAxis && group.dateFormula;
20769
- const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
20770
- const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, group.displayHidden) : void 0;
20771
- return group.sparklines.map((line2) => {
20772
- const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
20773
- const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
20774
- return dateValues ? { values: values2, dates: dateValues } : { values: values2 };
20775
- });
21783
+ var round2 = (n) => Math.round(n * 100) / 100;
21784
+ var BORDER_STYLES = {
21785
+ hair: { widthPx: 1, style: "dotted" },
21786
+ thin: { widthPx: 1, style: "solid" },
21787
+ dotted: { widthPx: 1, style: "dotted" },
21788
+ dashed: { widthPx: 1, style: "dashed" },
21789
+ dashDot: { widthPx: 1, style: "dashed" },
21790
+ dashDotDot: { widthPx: 1, style: "dashed" },
21791
+ medium: { widthPx: 2, style: "solid" },
21792
+ mediumDashed: { widthPx: 2, style: "dashed" },
21793
+ mediumDashDot: { widthPx: 2, style: "dashed" },
21794
+ mediumDashDotDot: { widthPx: 2, style: "dashed" },
21795
+ slantDashDot: { widthPx: 2, style: "dashed" },
21796
+ thick: { widthPx: 3, style: "solid" },
21797
+ double: { widthPx: 3, style: "double" }
21798
+ };
21799
+ function edgeView(edge, theme2) {
21800
+ if (!edge) return void 0;
21801
+ const style2 = BORDER_STYLES[edge.style];
21802
+ if (!style2) return void 0;
21803
+ return { ...style2, color: resolveColor(edge.color, theme2, BLACK) ?? BLACK };
20776
21804
  }
20777
- function sparklineViewAt(workbook, sheetIndex2, row2, col) {
20778
- const sheet = workbook.sheets[sheetIndex2];
20779
- if (!sheet) return void 0;
20780
- const entry = hosts(sheet).get(cellKey(row2, col));
20781
- if (!entry) return void 0;
20782
- const { group, index: index2 } = entry;
20783
- const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
20784
- const data = needsGroup ? groupData(workbook, sheet, group) : groupData(workbook, sheet, { ...group, sparklines: [group.sparklines[index2]] });
20785
- const at = needsGroup ? index2 : 0;
20786
- return sparklineView(
20787
- group,
20788
- data[at] ?? { values: [] },
20789
- sparklineScale(group, data, at),
20790
- workbook.theme
20791
- );
21805
+ function mergeBorder(base, border) {
21806
+ if (!border) return base;
21807
+ const out = { ...base };
21808
+ for (const [key, value2] of Object.entries(border))
21809
+ if (value2 !== void 0) out[key] = value2;
21810
+ return out;
21811
+ }
21812
+ function bordersView(border, theme2) {
21813
+ const out = {};
21814
+ const set = (key, edge) => {
21815
+ const view = edgeView(edge, theme2);
21816
+ if (view) out[key] = view;
21817
+ };
21818
+ set("top", border.top);
21819
+ set("right", border.right);
21820
+ set("bottom", border.bottom);
21821
+ set("left", border.left);
21822
+ if (border.diagonalUp) set("diagonalUp", border.diagonal);
21823
+ if (border.diagonalDown) set("diagonalDown", border.diagonal);
21824
+ return out;
20792
21825
  }
20793
21826
 
20794
21827
  // xlsx/layout/units.ts
@@ -20882,7 +21915,7 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
20882
21915
  indentPx: indentable ? (alignment.indent ?? 0) * (options.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
20883
21916
  rotation,
20884
21917
  isNumber: isNumber2,
20885
- overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !sheet.merges.some((m) => rangeContains(m, { row: row2, col })),
21918
+ overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !(options.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
20886
21919
  hasComment: sheet.comments.some((c) => c.address.row === row2 && c.address.col === col),
20887
21920
  hasHyperlink: false,
20888
21921
  validationList: sheet.dataValidations.some(
@@ -21247,6 +22280,12 @@ function deleteSheet(ctx, index2) {
21247
22280
  const sheet = sheetAt(workbook, index2);
21248
22281
  if (sheet.state === "visible" && visibleCount(workbook) <= 1)
21249
22282
  throw new Error("A workbook must contain at least one visible sheet.");
22283
+ if (workbook.sheets.some(
22284
+ (other) => other !== sheet && other.pivotTables?.some(
22285
+ (pivot) => deleteSheetInFormula(pivot.source, sheet.name, []) !== pivot.source
22286
+ )
22287
+ ))
22288
+ throw new Error("Delete dependent PivotTables before deleting their source worksheet.");
21250
22289
  ctx.run(
21251
22290
  "Delete sheet",
21252
22291
  "sheets",
@@ -21350,6 +22389,17 @@ function duplicateSheet(ctx, index2) {
21350
22389
  copy2.name = copyName(workbook, sheet.name);
21351
22390
  copy2.sheetId = nextSheetId(workbook);
21352
22391
  delete copy2.partName;
22392
+ const pivotNames = reservedPivotNames(workbook);
22393
+ for (const pivot of copy2.pivotTables ?? []) {
22394
+ let suffix = 2;
22395
+ while (pivotNames.has(`${pivot.name}_${suffix}`.toLowerCase())) suffix++;
22396
+ pivot.name = `${pivot.name}_${suffix}`;
22397
+ pivotNames.add(pivot.name.toLowerCase());
22398
+ delete pivot.partName;
22399
+ delete pivot.cacheId;
22400
+ delete pivot.sourceXml;
22401
+ pivot.dirty = true;
22402
+ }
21353
22403
  let nextTableId = Math.max(0, ...workbook.sheets.flatMap((s) => s.tables.map((t) => t.id))) + 1;
21354
22404
  const used = /* @__PURE__ */ new Set();
21355
22405
  const renames = [];
@@ -21361,13 +22411,14 @@ function duplicateSheet(ctx, index2) {
21361
22411
  delete next.partName;
21362
22412
  return next;
21363
22413
  });
21364
- if (renames.length)
21365
- rewriteSheetFormulas(
21366
- copy2,
21367
- (formula) => renames.reduce((f6, [from, to]) => renameTableInFormula(f6, from, to), formula)
21368
- );
22414
+ const rewrite = (formula) => renames.reduce(
22415
+ (f6, [from, to]) => renameTableInFormula(f6, from, to),
22416
+ renameSheetInFormula(formula, sheet.name, copy2.name)
22417
+ );
22418
+ rewriteSheetFormulas(copy2, rewrite);
21369
22419
  for (const drawing of copy2.drawings) if (drawing.kind === "chart") delete drawing.partName;
21370
22420
  const copiedNames = namesForCopy(workbook, index2, sheet.name, copy2.name);
22421
+ for (const name of copiedNames) name.formula = rewrite(name.formula);
21371
22422
  workbook.sheets.splice(at, 0, copy2);
21372
22423
  remapSheets(workbook, (i2) => i2 >= at ? i2 + 1 : i2);
21373
22424
  for (const n of copiedNames) workbook.definedNames.push({ ...n, localSheet: at });
@@ -21425,6 +22476,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
21425
22476
  if (r.start.row === r.end.row && r.start.col === r.end.col) r = currentRegion(sheet, r.start);
21426
22477
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
21427
22478
  throw new Error("A table cannot overlap another table.");
22479
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22480
+ throw new Error("A table cannot overlap a PivotTable.");
21428
22481
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
21429
22482
  throw new Error("A table cannot contain merged cells.");
21430
22483
  return ctx.run(
@@ -21651,68 +22704,6 @@ function failure(dv) {
21651
22704
  return result2;
21652
22705
  }
21653
22706
 
21654
- // xlsx/edit/view.ts
21655
- function setFreeze(ctx, s, freeze) {
21656
- const sheet = sheetAt(ctx.workbook, s);
21657
- const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
21658
- ctx.run(
21659
- next ? "Freeze panes" : "Unfreeze panes",
21660
- "view",
21661
- [{ kind: "sheet", sheet: s }],
21662
- () => {
21663
- if (next) sheet.view.freeze = next;
21664
- else delete sheet.view.freeze;
21665
- },
21666
- { sheet: s, structural: true }
21667
- );
21668
- }
21669
- function setSheetView(ctx, s, patch) {
21670
- const sheet = sheetAt(ctx.workbook, s);
21671
- ctx.run(
21672
- "Sheet view",
21673
- "view",
21674
- [{ kind: "sheet", sheet: s }],
21675
- () => {
21676
- const view = { ...sheet.view, ...structuredClone(patch) };
21677
- for (const key of Object.keys(view))
21678
- if (view[key] === void 0) delete view[key];
21679
- if (patch.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch.zoom)));
21680
- sheet.view = view;
21681
- },
21682
- { sheet: s, structural: patch.zoom !== void 0 || "freeze" in patch }
21683
- );
21684
- }
21685
- var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
21686
- function validateDefinedName(name) {
21687
- if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
21688
- if (!NAME_PATTERN.test(name))
21689
- return "A name must start with a letter, underscore or backslash and contain no spaces.";
21690
- if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
21691
- return "A name cannot look like a cell reference.";
21692
- return void 0;
21693
- }
21694
- var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
21695
- function setDefinedName(ctx, name) {
21696
- const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
21697
- if (problem) throw new Error(problem);
21698
- if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
21699
- const entry = structuredClone(name);
21700
- entry.formula = entry.formula.replace(/^=/, "");
21701
- ctx.run("Define name", "names", [{ kind: "meta" }], () => {
21702
- const { definedNames } = ctx.workbook;
21703
- const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
21704
- if (index2 >= 0) definedNames[index2] = entry;
21705
- else definedNames.push(entry);
21706
- });
21707
- }
21708
- function deleteDefinedName(ctx, name, localSheet) {
21709
- const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
21710
- if (index2 < 0) return;
21711
- ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
21712
- ctx.workbook.definedNames.splice(index2, 1);
21713
- });
21714
- }
21715
-
21716
22707
  // xlsx/edit/session.ts
21717
22708
  function createEditSession(workbook, options = {}) {
21718
22709
  const calc = createCalcEngine(workbook);
@@ -21725,8 +22716,8 @@ function createEditSession(workbook, options = {}) {
21725
22716
  };
21726
22717
  const calculator = new SessionCalculator(workbook, calc, autoRecalc);
21727
22718
  const recalc = (step, mode = "apply") => calculator.afterStep(step, mode);
21728
- const begin = (label2, kind, info) => {
21729
- const step = { label: label2, entries: [], structural: info.structural ?? false };
22719
+ const begin = (label3, kind, info) => {
22720
+ const step = { label: label3, entries: [], structural: info.structural ?? false };
21730
22721
  if (info.calc) step.calc = info.calc;
21731
22722
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
21732
22723
  };
@@ -21750,9 +22741,18 @@ function createEditSession(workbook, options = {}) {
21750
22741
  }
21751
22742
  current.step.entries.length = from;
21752
22743
  };
21753
- const run = (label2, kind, scopes, fn, info = {}) => {
22744
+ const run = (label3, kind, scopes, fn, info = {}) => {
22745
+ if (kind === "cells") {
22746
+ for (const scope of scopes)
22747
+ if (scope.kind === "cells" && workbook.sheets[scope.sheet]?.pivotTables?.some(
22748
+ (pivot) => scope.ranges.some((range2) => rangesIntersect(range2, pivot.location))
22749
+ ))
22750
+ throw new Error(
22751
+ "A PivotTable result cannot be edited directly. Refresh or remove the PivotTable instead."
22752
+ );
22753
+ }
21754
22754
  const outer = !open;
21755
- const current = open ?? begin(label2, kind, info);
22755
+ const current = open ?? begin(label3, kind, info);
21756
22756
  if (!outer) {
21757
22757
  delete current.step.calc;
21758
22758
  if (info.structural) current.step.structural = true;
@@ -21818,7 +22818,7 @@ function createEditSession(workbook, options = {}) {
21818
22818
  setCellValue: (s, r, c, value2) => setCellValue(ctx, s, r, c, value2),
21819
22819
  setRangeValues: (s, at, rows2) => setRangeValues(ctx, s, at, rows2),
21820
22820
  clearRange: (s, range2, what) => clearRange(ctx, s, range2, what),
21821
- applyStyle: (s, ranges, patch) => applyStyle(ctx, s, ranges, patch),
22821
+ applyStyle: (s, ranges, patch2) => applyStyle(ctx, s, ranges, patch2),
21822
22822
  setBorders: (s, range2, preset, edge) => setBorders(ctx, s, range2, preset, edge),
21823
22823
  insertRows: (s, at, count2) => insertRows(ctx, s, at, count2),
21824
22824
  deleteRows: (s, at, count2) => deleteRows(ctx, s, at, count2),
@@ -21856,24 +22856,34 @@ function createEditSession(workbook, options = {}) {
21856
22856
  filterColumn: (s, col, vals) => filterColumn(ctx, s, col, vals),
21857
22857
  sortByColumn: (s, col, descending) => sortByColumn(ctx, s, col, descending ?? false),
21858
22858
  createTable: (s, range2, hasHeader, styleName) => createTable(ctx, s, range2, hasHeader, styleName),
21859
- setSheetView: (s, patch) => setSheetView(ctx, s, patch),
22859
+ setSheetView: (s, patch2) => setSheetView(ctx, s, patch2),
21860
22860
  setDefinedName: (name) => setDefinedName(ctx, name),
21861
22861
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
21862
22862
  setDrawingAnchor: (s, index2, anchor) => setDrawingAnchor(ctx, s, index2, anchor),
22863
+ createPivotTable: (s, destination, options2) => createPivotTable(ctx, s, destination, options2),
22864
+ refreshPivotTable: (s, name, patch2) => refreshPivotTable(ctx, s, name, patch2),
22865
+ deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
21863
22866
  deleteDrawing: (s, index2) => deleteDrawing(ctx, s, index2),
22867
+ createSparklineGroup: (s, source, locations, patch2) => createSparklineGroup(ctx, s, source, locations, patch2),
22868
+ setSparklineGroups: (s, ranges, patch2) => setSparklineGroups(ctx, s, ranges, patch2),
22869
+ setSparklineDateRange: (s, ranges, source) => setSparklineDateRange(ctx, s, ranges, source),
22870
+ deleteSparklines: (s, ranges, wholeGroups) => deleteSparklines(ctx, s, ranges, wholeGroups),
21864
22871
  addChart: (s, chart) => addChart(ctx, s, chart),
21865
- updateChart: (s, index2, patch) => updateChart(ctx, s, index2, patch),
22872
+ updateChart: (s, index2, patch2) => updateChart(ctx, s, index2, patch2),
21866
22873
  addImage: (s, bytes, type, anchor, name) => addImage(ctx, s, bytes, type, anchor, name),
21867
22874
  replaceConditionalFormat: (s, index2, cf) => replaceConditionalFormat(ctx, s, index2, cf),
21868
22875
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
21869
22876
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
21870
22877
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
21871
- updateTable: (s, table2, patch) => updateTable(ctx, s, table2, patch),
22878
+ updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
21872
22879
  resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
21873
22880
  convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
21874
22881
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
21875
- setPageSetup: (s, patch) => setPageSetup(ctx, s, patch),
21876
- setPrintOptions: (s, patch) => setPrintOptions(ctx, s, patch),
22882
+ setPageSetup: (s, patch2) => setPageSetup(ctx, s, patch2),
22883
+ setPageBreak: (s, axis, before, present) => setPageBreak(ctx, s, axis, before, present),
22884
+ resetPageBreaks: (s) => resetPageBreaks(ctx, s),
22885
+ setPrintTitles: (s, patch2) => setPrintTitles(ctx, s, patch2),
22886
+ setPrintOptions: (s, patch2) => setPrintOptions(ctx, s, patch2),
21877
22887
  setSheetProtection: (s, p, password) => setSheetProtection(ctx, s, p, password),
21878
22888
  setWorkbookProtection: (locked, password) => setWorkbookProtection(ctx, locked, password),
21879
22889
  groupRows: (s, from, to) => groupRows(ctx, s, from, to),
@@ -21883,7 +22893,7 @@ function createEditSession(workbook, options = {}) {
21883
22893
  setDefaultColumnWidth: (s, width) => setDefaultColumnWidth(ctx, s, width),
21884
22894
  removeDuplicates: (s, range2, cols, hasHeader) => removeDuplicates(ctx, s, range2, cols, hasHeader),
21885
22895
  setCalcMode: (mode) => setCalcMode(ctx, mode),
21886
- setDocumentProperties: (patch) => setDocumentProperties(ctx, patch),
22896
+ setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
21887
22897
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
21888
22898
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
21889
22899
  calculateNow(options2) {
@@ -21898,12 +22908,12 @@ function createEditSession(workbook, options = {}) {
21898
22908
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
21899
22909
  evaluate: (formula, at) => calc.evaluate(formula, at)
21900
22910
  }),
21901
- batch(label2, fn) {
22911
+ batch(label3, fn) {
21902
22912
  if (open) {
21903
22913
  fn();
21904
22914
  return;
21905
22915
  }
21906
- const current = begin(label2, "batch", {});
22916
+ const current = begin(label3, "batch", {});
21907
22917
  open = current;
21908
22918
  try {
21909
22919
  fn();
@@ -22858,21 +23868,21 @@ function stepFontSize(size, grow) {
22858
23868
  if (grow) return FONT_SIZES.find((s) => s > size) ?? Math.min(409, size + 10);
22859
23869
  return [...FONT_SIZES].reverse().find((s) => s < size) ?? Math.max(1, size - 1);
22860
23870
  }
22861
- var style = (ctx, patch) => {
22862
- withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch));
23871
+ var style = (ctx, patch2) => {
23872
+ withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch2));
22863
23873
  };
22864
23874
  function pickColor(arg) {
22865
23875
  if (arg && typeof arg === "object" && !arg.auto) return arg;
22866
23876
  return null;
22867
23877
  }
22868
- var toggle = (id, label2, glyph, shortcut, read, patch) => editing({
23878
+ var toggle = (id, label3, glyph, shortcut, read, patch2) => editing({
22869
23879
  id,
22870
- label: label2,
23880
+ label: label3,
22871
23881
  icon: icon(glyph),
22872
23882
  shortcut,
22873
23883
  lock: "formatCells",
22874
23884
  checked: read,
22875
- run: (ctx) => style(ctx, patch(!read(ctx)))
23885
+ run: (ctx) => style(ctx, patch2(!read(ctx)))
22876
23886
  });
22877
23887
  var BORDER_PRESETS = [
22878
23888
  ["bottom", "Bottom Border", "borderBottom"],
@@ -23052,10 +24062,10 @@ var mergedAtActive = (ctx) => {
23052
24062
  const t = target(ctx);
23053
24063
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
23054
24064
  };
23055
- function mergeCommand(id, label2, mode) {
24065
+ function mergeCommand(id, label3, mode) {
23056
24066
  return editing({
23057
24067
  id,
23058
- label: label2,
24068
+ label: label3,
23059
24069
  icon: icon("mergeCenter"),
23060
24070
  lock: "formatCells",
23061
24071
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -23070,30 +24080,30 @@ function mergeCommand(id, label2, mode) {
23070
24080
  }
23071
24081
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
23072
24082
  const ok = await ctx.dialogs.open("confirm", {
23073
- heading: label2,
24083
+ heading: label3,
23074
24084
  message: "Merging cells only keeps the upper-left value and discards other values."
23075
24085
  });
23076
24086
  if (ok !== true) return;
23077
24087
  if (ctx.session() !== t.session || ctx.readOnly()) return;
23078
24088
  }
23079
- t.session.batch(label2, () => {
24089
+ t.session.batch(label3, () => {
23080
24090
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
23081
24091
  });
23082
24092
  }
23083
24093
  });
23084
24094
  }
23085
24095
  function alignmentCommands() {
23086
- const valign = (id, label2, value2, glyph) => editing({
24096
+ const valign = (id, label3, value2, glyph) => editing({
23087
24097
  id,
23088
- label: label2,
24098
+ label: label3,
23089
24099
  icon: icon(glyph),
23090
24100
  lock: "formatCells",
23091
24101
  checked: (ctx) => vertical(ctx) === value2,
23092
24102
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
23093
24103
  });
23094
- const halign = (id, label2, value2, glyph) => editing({
24104
+ const halign = (id, label3, value2, glyph) => editing({
23095
24105
  id,
23096
- label: label2,
24106
+ label: label3,
23097
24107
  icon: icon(glyph),
23098
24108
  lock: "formatCells",
23099
24109
  checked: (ctx) => horizontal(ctx) === value2,
@@ -24477,6 +25487,24 @@ var MESSAGE_STRINGS = {
24477
25487
 
24478
25488
  // xlsx/ui/commands/i18n/navigation.ts
24479
25489
  var NAVIGATION_STRINGS = {
25490
+ "Sparklines (create, format and clear)": [
25491
+ "Graphiques sparkline (cr\xE9ation, mise en forme et suppression)",
25492
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
25493
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
25494
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u683C\u5F0F\u8BBE\u7F6E\u548C\u6E05\u9664\uFF09"
25495
+ ],
25496
+ "Worksheet-range PivotTables (one row field, optional column field and one value field)": [
25497
+ "Tableaux crois\xE9s dynamiques de plages (un champ de ligne, un champ de colonne facultatif et un champ de valeur)",
25498
+ "PivotTables aus Arbeitsblattbereichen (ein Zeilenfeld, optionales Spaltenfeld und ein Wertfeld)",
25499
+ "Tablas din\xE1micas de rangos (un campo de fila, columna opcional y un valor)",
25500
+ "\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\uFF08\u4E00\u4E2A\u884C\u5B57\u6BB5\u3001\u53EF\u9009\u5217\u5B57\u6BB5\u548C\u4E00\u4E2A\u503C\u5B57\u6BB5\uFF09"
25501
+ ],
25502
+ "Advanced PivotTable layouts, grouping and external data sources (preserved)": [
25503
+ "Dispositions avanc\xE9es, regroupements et sources externes de tableaux crois\xE9s dynamiques (conserv\xE9s)",
25504
+ "Erweiterte PivotTable-Layouts, Gruppierung und externe Datenquellen (erhalten)",
25505
+ "Dise\xF1os avanzados, agrupaci\xF3n y fuentes externas de tablas din\xE1micas (conservados)",
25506
+ "\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u5E03\u5C40\u3001\u5206\u7EC4\u548C\u5916\u90E8\u6570\u636E\u6E90\uFF08\u4FDD\u7559\uFF09"
25507
+ ],
24480
25508
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
24481
25509
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
24482
25510
  Close: ["Fermer", "Schlie\xDFen", "Cerrar", "\u5173\u95ED"],
@@ -26613,6 +27641,149 @@ var RIBBON_TAB_STRINGS = {
26613
27641
 
26614
27642
  // xlsx/ui/commands/i18n/tools.ts
26615
27643
  var TOOLS_STRINGS = {
27644
+ Bold: RIBBON_HOME_STRINGS.Bold,
27645
+ Italic: RIBBON_HOME_STRINGS.Italic,
27646
+ Underline: RIBBON_HOME_STRINGS.Underline,
27647
+ Strikethrough: RIBBON_HOME_STRINGS.Strikethrough,
27648
+ "Insert Formatting": [
27649
+ "Ins\xE9rer une mise en forme",
27650
+ "Formatierung einf\xFCgen",
27651
+ "Insertar formato",
27652
+ "\u63D2\u5165\u683C\u5F0F"
27653
+ ],
27654
+ 'Formatting: &B bold, &I italic, &U underline, &S strike, &18 font size, &KFF0000 RGB color, &"Arial,Regular" font.': [
27655
+ 'Format : &B gras, &I italique, &U soulign\xE9, &S barr\xE9, &18 taille, &KFF0000 couleur RVB, &"Arial,Regular" police.',
27656
+ 'Format: &B fett, &I kursiv, &U unterstrichen, &S durchgestrichen, &18 Schriftgr\xF6\xDFe, &KFF0000 RGB-Farbe, &"Arial,Regular" Schriftart.',
27657
+ 'Formato: &B negrita, &I cursiva, &U subrayado, &S tachado, &18 tama\xF1o, &KFF0000 color RGB, &"Arial,Regular" fuente.',
27658
+ '\u683C\u5F0F\uFF1A&B \u7C97\u4F53\u3001&I \u659C\u4F53\u3001&U \u4E0B\u5212\u7EBF\u3001&S \u5220\u9664\u7EBF\u3001&18 \u5B57\u53F7\u3001&KFF0000 RGB \u989C\u8272\u3001&"Arial,Regular" \u5B57\u4F53\u3002'
27659
+ ],
27660
+ "Date Range (optional):": [
27661
+ "Plage de dates (facultative) :",
27662
+ "Datumsbereich (optional):",
27663
+ "Rango de fechas (opcional):",
27664
+ "\u65E5\u671F\u8303\u56F4\uFF08\u53EF\u9009\uFF09\uFF1A"
27665
+ ],
27666
+ "Leave the date range empty for a general axis.": [
27667
+ "Laissez la plage de dates vide pour un axe g\xE9n\xE9ral.",
27668
+ "F\xFCr eine allgemeine Achse den Datumsbereich leer lassen.",
27669
+ "Deje vac\xEDo el rango de fechas para un eje general.",
27670
+ "\u5C06\u65E5\u671F\u8303\u56F4\u7559\u7A7A\u4EE5\u4F7F\u7528\u5E38\u89C4\u5750\u6807\u8F74\u3002"
27671
+ ],
27672
+ Time: ["Heure", "Zeit", "Hora", "\u65F6\u95F4"],
27673
+ "First Page Header:": [
27674
+ "En-t\xEAte de premi\xE8re page :",
27675
+ "Kopfzeile der ersten Seite:",
27676
+ "Encabezado de primera p\xE1gina:",
27677
+ "\u9996\u9875\u9875\u7709\uFF1A"
27678
+ ],
27679
+ "First Page Footer:": [
27680
+ "Pied de premi\xE8re page :",
27681
+ "Fu\xDFzeile der ersten Seite:",
27682
+ "Pie de primera p\xE1gina:",
27683
+ "\u9996\u9875\u9875\u811A\uFF1A"
27684
+ ],
27685
+ "Even Page Header:": [
27686
+ "En-t\xEAte des pages paires :",
27687
+ "Kopfzeile gerader Seiten:",
27688
+ "Encabezado de p\xE1ginas pares:",
27689
+ "\u5076\u6570\u9875\u9875\u7709\uFF1A"
27690
+ ],
27691
+ "Even Page Footer:": [
27692
+ "Pied des pages paires :",
27693
+ "Fu\xDFzeile gerader Seiten:",
27694
+ "Pie de p\xE1ginas pares:",
27695
+ "\u5076\u6570\u9875\u9875\u811A\uFF1A"
27696
+ ],
27697
+ "Different first page": [
27698
+ "Premi\xE8re page diff\xE9rente",
27699
+ "Erste Seite anders",
27700
+ "Primera p\xE1gina diferente",
27701
+ "\u9996\u9875\u4E0D\u540C"
27702
+ ],
27703
+ "Different odd and even pages": [
27704
+ "Pages paires et impaires diff\xE9rentes",
27705
+ "Gerade und ungerade Seiten unterschiedlich",
27706
+ "P\xE1ginas pares e impares diferentes",
27707
+ "\u5947\u5076\u9875\u4E0D\u540C"
27708
+ ],
27709
+ "Scale header and footer with document": [
27710
+ "Mettre l\u2019en-t\xEAte et le pied \xE0 l\u2019\xE9chelle du document",
27711
+ "Kopf- und Fu\xDFzeile mit Dokument skalieren",
27712
+ "Escalar encabezado y pie con el documento",
27713
+ "\u968F\u6587\u6863\u7F29\u653E\u9875\u7709\u548C\u9875\u811A"
27714
+ ],
27715
+ "Align header and footer with margins": [
27716
+ "Aligner l\u2019en-t\xEAte et le pied sur les marges",
27717
+ "Kopf- und Fu\xDFzeile an R\xE4ndern ausrichten",
27718
+ "Alinear encabezado y pie con los m\xE1rgenes",
27719
+ "\u5C06\u9875\u7709\u548C\u9875\u811A\u4E0E\u9875\u8FB9\u8DDD\u5BF9\u9F50"
27720
+ ],
27721
+ "Insert Field": ["Ins\xE9rer un champ", "Feld einf\xFCgen", "Insertar campo", "\u63D2\u5165\u5B57\u6BB5"],
27722
+ "Page Number": ["Num\xE9ro de page", "Seitenzahl", "N\xFAmero de p\xE1gina", "\u9875\u7801"],
27723
+ "Total Pages": ["Nombre de pages", "Gesamtseitenzahl", "Total de p\xE1ginas", "\u603B\u9875\u6570"],
27724
+ "Sheet Name": ["Nom de feuille", "Blattname", "Nombre de hoja", "\u5DE5\u4F5C\u8868\u540D\u79F0"],
27725
+ "File Name": ["Nom de fichier", "Dateiname", "Nombre de archivo", "\u6587\u4EF6\u540D"],
27726
+ "Rows to repeat at top": [
27727
+ "Lignes \xE0 r\xE9p\xE9ter en haut",
27728
+ "Wiederholungszeilen oben",
27729
+ "Filas a repetir arriba",
27730
+ "\u9876\u7AEF\u6807\u9898\u884C"
27731
+ ],
27732
+ "Columns to repeat at left": [
27733
+ "Colonnes \xE0 r\xE9p\xE9ter \xE0 gauche",
27734
+ "Wiederholungsspalten links",
27735
+ "Columnas a repetir a la izquierda",
27736
+ "\u5DE6\u7AEF\u6807\u9898\u5217"
27737
+ ],
27738
+ "Use first page number": [
27739
+ "Utiliser le premier num\xE9ro de page",
27740
+ "Erste Seitenzahl verwenden",
27741
+ "Usar primer n\xFAmero de p\xE1gina",
27742
+ "\u4F7F\u7528\u8D77\u59CB\u9875\u7801"
27743
+ ],
27744
+ "First page number": [
27745
+ "Premier num\xE9ro de page",
27746
+ "Erste Seitenzahl",
27747
+ "Primer n\xFAmero de p\xE1gina",
27748
+ "\u8D77\u59CB\u9875\u7801"
27749
+ ],
27750
+ "Enter a first page number between 0 and 32767.": [
27751
+ "Entrez un premier num\xE9ro entre 0 et 32767.",
27752
+ "Geben Sie eine erste Seitenzahl zwischen 0 und 32767 ein.",
27753
+ "Introduzca un primer n\xFAmero entre 0 y 32767.",
27754
+ "\u8BF7\u8F93\u5165 0 \u5230 32767 \u4E4B\u95F4\u7684\u8D77\u59CB\u9875\u7801\u3002"
27755
+ ],
27756
+ "Print titles must be whole rows or whole columns.": [
27757
+ "Les titres doivent \xEAtre des lignes ou colonnes enti\xE8res.",
27758
+ "Drucktitel m\xFCssen ganze Zeilen oder Spalten sein.",
27759
+ "Los t\xEDtulos deben ser filas o columnas completas.",
27760
+ "\u6253\u5370\u6807\u9898\u5FC5\u987B\u4E3A\u6574\u884C\u6216\u6574\u5217\u3002"
27761
+ ],
27762
+ "Existing print titles are unsupported. Changing a title range replaces them; leaving the fields unchanged preserves them.": [
27763
+ "Les titres existants ne sont pas pris en charge. Modifier une plage les remplace ; conserver les champs les pr\xE9serve.",
27764
+ "Vorhandene Drucktitel werden nicht unterst\xFCtzt. Eine Bereichs\xE4nderung ersetzt sie; unver\xE4nderte Felder bewahren sie.",
27765
+ "Los t\xEDtulos existentes no son compatibles. Cambiar un rango los reemplaza; dejar los campos sin cambios los conserva.",
27766
+ "\u4E0D\u652F\u6301\u73B0\u6709\u6253\u5370\u6807\u9898\u3002\u66F4\u6539\u6807\u9898\u533A\u57DF\u4F1A\u66FF\u6362\u5B83\u4EEC\uFF1B\u4FDD\u6301\u5B57\u6BB5\u4E0D\u53D8\u53EF\u4FDD\u7559\u5B83\u4EEC\u3002"
27767
+ ],
27768
+ "Use &L, &C and &R for sections. Fields: &P page, &N total pages, &A sheet, &F file, &D date, &T time. Use && for an ampersand. Unsupported formatting codes are preserved.": [
27769
+ "Utilisez &L, &C et &R pour les sections. Champs : &P page, &N total, &A feuille, &F fichier, &D date, &T heure. && affiche une esperluette. Les codes non pris en charge sont conserv\xE9s.",
27770
+ "Verwenden Sie &L, &C und &R f\xFCr Abschnitte. Felder: &P Seite, &N Gesamtseiten, &A Blatt, &F Datei, &D Datum, &T Zeit. && ergibt ein Und-Zeichen. Nicht unterst\xFCtzte Formatcodes bleiben erhalten.",
27771
+ "Use &L, &C y &R para secciones. Campos: &P p\xE1gina, &N total, &A hoja, &F archivo, &D fecha, &T hora. && muestra un ampersand. Se conservan los c\xF3digos no compatibles.",
27772
+ "\u4F7F\u7528 &L\u3001&C\u3001&R \u6307\u5B9A\u533A\u57DF\u3002\u5B57\u6BB5\uFF1A&P \u9875\u7801\u3001&N \u603B\u9875\u6570\u3001&A \u5DE5\u4F5C\u8868\u3001&F \u6587\u4EF6\u3001&D \u65E5\u671F\u3001&T \u65F6\u95F4\u3002&& \u8868\u793A &\u3002\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u683C\u5F0F\u4EE3\u7801\u3002"
27773
+ ],
27774
+ "Page order": ["Ordre des pages", "Seitenreihenfolge", "Orden de p\xE1ginas", "\u9875\u5E8F"],
27775
+ "Down, then over": [
27776
+ "Vers le bas, puis \xE0 droite",
27777
+ "Nach unten, dann nach rechts",
27778
+ "Hacia abajo, luego a la derecha",
27779
+ "\u5148\u5411\u4E0B\uFF0C\u518D\u5411\u53F3"
27780
+ ],
27781
+ "Over, then down": [
27782
+ "\xC0 droite, puis vers le bas",
27783
+ "Nach rechts, dann nach unten",
27784
+ "A la derecha, luego hacia abajo",
27785
+ "\u5148\u5411\u53F3\uFF0C\u518D\u5411\u4E0B"
27786
+ ],
26616
27787
  // Insert Chart
26617
27788
  "Insert Chart": ["Ins\xE9rer un graphique", "Diagramm einf\xFCgen", "Insertar gr\xE1fico", "\u63D2\u5165\u56FE\u8868"],
26618
27789
  "Change Chart Type": [
@@ -27081,6 +28252,508 @@ var TOOLS_STRINGS = {
27081
28252
  ]
27082
28253
  };
27083
28254
 
28255
+ // xlsx/ui/commands/i18n/sparklines.ts
28256
+ var SPARKLINE_STRINGS = {
28257
+ Mixed: ["Mixte", "Gemischt", "Mixto", "\u6DF7\u5408"],
28258
+ "Only changed settings are applied.": [
28259
+ "Seuls les param\xE8tres modifi\xE9s sont appliqu\xE9s.",
28260
+ "Nur ge\xE4nderte Einstellungen werden angewendet.",
28261
+ "Solo se aplica la configuraci\xF3n modificada.",
28262
+ "\u4EC5\u5E94\u7528\u5DF2\u66F4\u6539\u7684\u8BBE\u7F6E\u3002"
28263
+ ],
28264
+ "Colors vary between selected groups.": [
28265
+ "Les couleurs varient entre les groupes s\xE9lectionn\xE9s.",
28266
+ "Die Farben der ausgew\xE4hlten Gruppen unterscheiden sich.",
28267
+ "Los colores var\xEDan entre los grupos seleccionados.",
28268
+ "\u9009\u5B9A\u7EC4\u7684\u989C\u8272\u4E0D\u540C\u3002"
28269
+ ],
28270
+ Markers: ["Marqueurs", "Markierungen", "Marcadores", "\u6807\u8BB0"],
28271
+ Gaps: ["Espaces", "L\xFCcken", "Huecos", "\u95F4\u9699"],
28272
+ Zero: ["Z\xE9ro", "Null", "Cero", "\u96F6"],
28273
+ Axis: ["Axe", "Achse", "Eje", "\u5750\u6807\u8F74"],
28274
+ "Sparklines (create, format and clear)": [
28275
+ "Graphiques sparkline (cr\xE9er, mettre en forme et effacer)",
28276
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
28277
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
28278
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u8BBE\u7F6E\u683C\u5F0F\u548C\u6E05\u9664\uFF09"
28279
+ ],
28280
+ "Charts and sparklines support editing; pivot tables, macros and other unsupported parts are kept in the file but not shown.": [
28281
+ "Les graphiques et graphiques sparkline peuvent \xEAtre modifi\xE9s ; les tableaux crois\xE9s dynamiques, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s dans le fichier mais ne sont pas affich\xE9s.",
28282
+ "Diagramme und Sparklines k\xF6nnen bearbeitet werden; Pivot-Tabellen, Makros und andere nicht unterst\xFCtzte Teile bleiben in der Datei erhalten, werden aber nicht angezeigt.",
28283
+ "Los gr\xE1ficos y minigr\xE1ficos se pueden editar; las tablas din\xE1micas, macros y otras partes no compatibles se conservan en el archivo pero no se muestran.",
28284
+ "\u56FE\u8868\u548C\u8FF7\u4F60\u56FE\u652F\u6301\u7F16\u8F91\uFF1B\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u90E8\u5206\u4FDD\u5B58\u5728\u6587\u4EF6\u4E2D\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28285
+ ],
28286
+ Sparklines: ["Graphiques sparkline", "Sparklines", "Minigr\xE1ficos", "\u8FF7\u4F60\u56FE"],
28287
+ "Line Sparkline": [
28288
+ "Sparkline en courbe",
28289
+ "Linien-Sparkline",
28290
+ "Minigr\xE1fico de l\xEDnea",
28291
+ "\u6298\u7EBF\u8FF7\u4F60\u56FE"
28292
+ ],
28293
+ "Column Sparkline": [
28294
+ "Sparkline en colonnes",
28295
+ "S\xE4ulen-Sparkline",
28296
+ "Minigr\xE1fico de columna",
28297
+ "\u67F1\u5F62\u8FF7\u4F60\u56FE"
28298
+ ],
28299
+ "Win/Loss Sparkline": [
28300
+ "Sparkline gains/pertes",
28301
+ "Gewinn/Verlust-Sparkline",
28302
+ "Minigr\xE1fico de ganancias y p\xE9rdidas",
28303
+ "\u76C8\u4E8F\u8FF7\u4F60\u56FE"
28304
+ ],
28305
+ "Win/Loss": ["Gains/pertes", "Gewinn/Verlust", "Ganancias y p\xE9rdidas", "\u76C8\u4E8F"],
28306
+ "Create Sparklines": [
28307
+ "Cr\xE9er des graphiques sparkline",
28308
+ "Sparklines erstellen",
28309
+ "Crear minigr\xE1ficos",
28310
+ "\u521B\u5EFA\u8FF7\u4F60\u56FE"
28311
+ ],
28312
+ "Sparkline Settings": [
28313
+ "Param\xE8tres des graphiques sparkline",
28314
+ "Sparkline-Einstellungen",
28315
+ "Configuraci\xF3n de minigr\xE1ficos",
28316
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E"
28317
+ ],
28318
+ "Data Range:": ["Plage de donn\xE9es :", "Datenbereich:", "Rango de datos:", "\u6570\u636E\u8303\u56F4\uFF1A"],
28319
+ "Location Range:": [
28320
+ "Plage d\u2019emplacement :",
28321
+ "Positionsbereich:",
28322
+ "Rango de ubicaci\xF3n:",
28323
+ "\u4F4D\u7F6E\u8303\u56F4\uFF1A"
28324
+ ],
28325
+ "Sparkline Type:": [
28326
+ "Type de sparkline :",
28327
+ "Sparkline-Typ:",
28328
+ "Tipo de minigr\xE1fico:",
28329
+ "\u8FF7\u4F60\u56FE\u7C7B\u578B\uFF1A"
28330
+ ],
28331
+ "Line Weight:": ["\xC9paisseur du trait :", "Linienst\xE4rke:", "Grosor de l\xEDnea:", "\u7EBF\u6761\u7C97\u7EC6\uFF1A"],
28332
+ "Changes apply to the entire selected sparkline groups.": [
28333
+ "Les modifications s\u2019appliquent \xE0 tous les groupes de graphiques sparkline s\xE9lectionn\xE9s.",
28334
+ "\xC4nderungen gelten f\xFCr die gesamten ausgew\xE4hlten Sparkline-Gruppen.",
28335
+ "Los cambios se aplican a todos los grupos de minigr\xE1ficos seleccionados.",
28336
+ "\u66F4\u6539\u5E94\u7528\u4E8E\u6574\u4E2A\u9009\u5B9A\u7684\u8FF7\u4F60\u56FE\u7EC4\u3002"
28337
+ ],
28338
+ "High Point": ["Point haut", "H\xF6chstpunkt", "Punto alto", "\u9AD8\u70B9"],
28339
+ "Low Point": ["Point bas", "Tiefstpunkt", "Punto bajo", "\u4F4E\u70B9"],
28340
+ "First Point": ["Premier point", "Erster Punkt", "Primer punto", "\u9996\u70B9"],
28341
+ "Last Point": ["Dernier point", "Letzter Punkt", "\xDAltimo punto", "\u672B\u70B9"],
28342
+ "Negative Points": ["Points n\xE9gatifs", "Negative Punkte", "Puntos negativos", "\u8D1F\u503C\u70B9"],
28343
+ "Sparkline Color:": [
28344
+ "Couleur du sparkline :",
28345
+ "Sparkline-Farbe:",
28346
+ "Color del minigr\xE1fico:",
28347
+ "\u8FF7\u4F60\u56FE\u989C\u8272\uFF1A"
28348
+ ],
28349
+ "Negative Color:": [
28350
+ "Couleur n\xE9gative :",
28351
+ "Farbe f\xFCr negative Werte:",
28352
+ "Color negativo:",
28353
+ "\u8D1F\u503C\u989C\u8272\uFF1A"
28354
+ ],
28355
+ "Minimum Axis:": ["Axe minimum :", "Achsenminimum:", "Eje m\xEDnimo:", "\u6700\u5C0F\u5750\u6807\u8F74\uFF1A"],
28356
+ "Maximum Axis:": ["Axe maximum :", "Achsenmaximum:", "Eje m\xE1ximo:", "\u6700\u5927\u5750\u6807\u8F74\uFF1A"],
28357
+ "Minimum Value:": ["Valeur minimum :", "Mindestwert:", "Valor m\xEDnimo:", "\u6700\u5C0F\u503C\uFF1A"],
28358
+ "Maximum Value:": ["Valeur maximum :", "H\xF6chstwert:", "Valor m\xE1ximo:", "\u6700\u5927\u503C\uFF1A"],
28359
+ Individual: ["Individuel", "Individuell", "Individual", "\u5355\u72EC"],
28360
+ "Same for all sparklines": [
28361
+ "Identique pour tous les graphiques sparkline",
28362
+ "F\xFCr alle Sparklines gleich",
28363
+ "Igual para todos los minigr\xE1ficos",
28364
+ "\u6240\u6709\u8FF7\u4F60\u56FE\u76F8\u540C"
28365
+ ],
28366
+ "Empty Cells:": ["Cellules vides :", "Leere Zellen:", "Celdas vac\xEDas:", "\u7A7A\u5355\u5143\u683C\uFF1A"],
28367
+ "Connect data points": [
28368
+ "Relier les points de donn\xE9es",
28369
+ "Datenpunkte verbinden",
28370
+ "Conectar puntos de datos",
28371
+ "\u8FDE\u63A5\u6570\u636E\u70B9"
28372
+ ],
28373
+ "Show data in hidden rows and columns": [
28374
+ "Afficher les donn\xE9es des lignes et colonnes masqu\xE9es",
28375
+ "Daten in ausgeblendeten Zeilen und Spalten anzeigen",
28376
+ "Mostrar datos en filas y columnas ocultas",
28377
+ "\u663E\u793A\u9690\u85CF\u884C\u548C\u5217\u4E2D\u7684\u6570\u636E"
28378
+ ],
28379
+ "Show horizontal axis": [
28380
+ "Afficher l\u2019axe horizontal",
28381
+ "Horizontale Achse anzeigen",
28382
+ "Mostrar eje horizontal",
28383
+ "\u663E\u793A\u6C34\u5E73\u5750\u6807\u8F74"
28384
+ ],
28385
+ "Plot right to left": [
28386
+ "Tracer de droite \xE0 gauche",
28387
+ "Von rechts nach links zeichnen",
28388
+ "Trazar de derecha a izquierda",
28389
+ "\u4ECE\u53F3\u5411\u5DE6\u7ED8\u5236"
28390
+ ],
28391
+ "Clear Sparklines": [
28392
+ "Effacer les graphiques sparkline",
28393
+ "Sparklines l\xF6schen",
28394
+ "Borrar minigr\xE1ficos",
28395
+ "\u6E05\u9664\u8FF7\u4F60\u56FE"
28396
+ ],
28397
+ "Clear Selected Sparklines": [
28398
+ "Effacer les graphiques sparkline s\xE9lectionn\xE9s",
28399
+ "Ausgew\xE4hlte Sparklines l\xF6schen",
28400
+ "Borrar minigr\xE1ficos seleccionados",
28401
+ "\u6E05\u9664\u9009\u5B9A\u8FF7\u4F60\u56FE"
28402
+ ],
28403
+ "Clear Sparkline Groups": [
28404
+ "Effacer les groupes de graphiques sparkline",
28405
+ "Sparkline-Gruppen l\xF6schen",
28406
+ "Borrar grupos de minigr\xE1ficos",
28407
+ "\u6E05\u9664\u8FF7\u4F60\u56FE\u7EC4"
28408
+ ],
28409
+ "The data range and location range do not match.": [
28410
+ "La plage de donn\xE9es et la plage d\u2019emplacement ne correspondent pas.",
28411
+ "Datenbereich und Positionsbereich stimmen nicht \xFCberein.",
28412
+ "El rango de datos y el rango de ubicaci\xF3n no coinciden.",
28413
+ "\u6570\u636E\u8303\u56F4\u548C\u4F4D\u7F6E\u8303\u56F4\u4E0D\u5339\u914D\u3002"
28414
+ ],
28415
+ "The sparkline location range is too large.": [
28416
+ "La plage d\u2019emplacement des graphiques sparkline est trop grande.",
28417
+ "Der Sparkline-Positionsbereich ist zu gro\xDF.",
28418
+ "El rango de ubicaci\xF3n del minigr\xE1fico es demasiado grande.",
28419
+ "\u8FF7\u4F60\u56FE\u4F4D\u7F6E\u8303\u56F4\u8FC7\u5927\u3002"
28420
+ ],
28421
+ "The location range already contains sparklines.": [
28422
+ "La plage d\u2019emplacement contient d\xE9j\xE0 des graphiques sparkline.",
28423
+ "Der Positionsbereich enth\xE4lt bereits Sparklines.",
28424
+ "El rango de ubicaci\xF3n ya contiene minigr\xE1ficos.",
28425
+ "\u4F4D\u7F6E\u8303\u56F4\u5DF2\u5305\u542B\u8FF7\u4F60\u56FE\u3002"
28426
+ ],
28427
+ "Sparklines cannot be created in merged cells.": [
28428
+ "Impossible de cr\xE9er des graphiques sparkline dans des cellules fusionn\xE9es.",
28429
+ "Sparklines k\xF6nnen nicht in verbundenen Zellen erstellt werden.",
28430
+ "No se pueden crear minigr\xE1ficos en celdas combinadas.",
28431
+ "\u65E0\u6CD5\u5728\u5408\u5E76\u5355\u5143\u683C\u4E2D\u521B\u5EFA\u8FF7\u4F60\u56FE\u3002"
28432
+ ],
28433
+ "The sparkline settings are not valid.": [
28434
+ "Les param\xE8tres des graphiques sparkline ne sont pas valides.",
28435
+ "Die Sparkline-Einstellungen sind ung\xFCltig.",
28436
+ "La configuraci\xF3n del minigr\xE1fico no es v\xE1lida.",
28437
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E\u65E0\u6548\u3002"
28438
+ ],
28439
+ "The sparkline axis limits are not valid.": [
28440
+ "Les limites d\u2019axe des graphiques sparkline ne sont pas valides.",
28441
+ "Die Sparkline-Achsengrenzen sind ung\xFCltig.",
28442
+ "Los l\xEDmites del eje del minigr\xE1fico no son v\xE1lidos.",
28443
+ "\u8FF7\u4F60\u56FE\u5750\u6807\u8F74\u754C\u9650\u65E0\u6548\u3002"
28444
+ ]
28445
+ };
28446
+
28447
+ // xlsx/ui/commands/i18n/pivots.ts
28448
+ var PIVOT_STRINGS = {
28449
+ "Compact Form": ["Forme compacte", "Kompaktformat", "Formato compacto", "\u538B\u7F29\u5F62\u5F0F"],
28450
+ "Outline Form": ["Forme de plan", "Gliederungsformat", "Formato de esquema", "\u5927\u7EB2\u5F62\u5F0F"],
28451
+ "Tabular Form": ["Forme tabulaire", "Tabellenformat", "Formato tabular", "\u8868\u683C\u5F62\u5F0F"],
28452
+ "Report Layout:": [
28453
+ "Disposition du rapport :",
28454
+ "Berichtslayout:",
28455
+ "Dise\xF1o del informe:",
28456
+ "\u62A5\u8868\u5E03\u5C40\uFF1A"
28457
+ ],
28458
+ "Subtotal Position:": [
28459
+ "Position des sous-totaux :",
28460
+ "Position der Teilergebnisse:",
28461
+ "Posici\xF3n de subtotales:",
28462
+ "\u5206\u7C7B\u6C47\u603B\u4F4D\u7F6E\uFF1A"
28463
+ ],
28464
+ "Above each group": [
28465
+ "Au-dessus de chaque groupe",
28466
+ "\xDCber jeder Gruppe",
28467
+ "Encima de cada grupo",
28468
+ "\u6BCF\u7EC4\u4E0A\u65B9"
28469
+ ],
28470
+ "Below each group": [
28471
+ "Sous chaque groupe",
28472
+ "Unter jeder Gruppe",
28473
+ "Debajo de cada grupo",
28474
+ "\u6BCF\u7EC4\u4E0B\u65B9"
28475
+ ],
28476
+ "Show subtotals": [
28477
+ "Afficher les sous-totaux",
28478
+ "Teilergebnisse anzeigen",
28479
+ "Mostrar subtotales",
28480
+ "\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28481
+ ],
28482
+ "Tabular layout displays subtotals below groups.": [
28483
+ "La disposition tabulaire affiche les sous-totaux sous les groupes.",
28484
+ "Das tabellarische Layout zeigt Teilergebnisse unter den Gruppen.",
28485
+ "El dise\xF1o tabular muestra subtotales debajo de los grupos.",
28486
+ "\u8868\u683C\u5E03\u5C40\u5728\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B\u3002"
28487
+ ],
28488
+ "Second Row Field:": [
28489
+ "Deuxi\xE8me champ de ligne :",
28490
+ "Zweites Zeilenfeld:",
28491
+ "Segundo campo de fila:",
28492
+ "\u7B2C\u4E8C\u884C\u5B57\u6BB5\uFF1A"
28493
+ ],
28494
+ "Show subtotals below each group": [
28495
+ "Afficher les sous-totaux sous chaque groupe",
28496
+ "Teilergebnisse unter jeder Gruppe anzeigen",
28497
+ "Mostrar subtotales debajo de cada grupo",
28498
+ "\u5728\u6BCF\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28499
+ ],
28500
+ "Repeat row labels": [
28501
+ "R\xE9p\xE9ter les \xE9tiquettes de ligne",
28502
+ "Zeilenbeschriftungen wiederholen",
28503
+ "Repetir etiquetas de fila",
28504
+ "\u91CD\u590D\u884C\u6807\u7B7E"
28505
+ ],
28506
+ "Charts, sparklines and worksheet-range PivotTables support editing. Advanced PivotTables, macros and other unsupported parts are preserved.": [
28507
+ "Les graphiques, graphiques sparkline et tableaux crois\xE9s dynamiques de plages prennent en charge la modification. Les tableaux avanc\xE9s, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s.",
28508
+ "Diagramme, Sparklines und PivotTables aus Arbeitsblattbereichen k\xF6nnen bearbeitet werden. Erweiterte PivotTables, Makros und andere nicht unterst\xFCtzte Teile bleiben erhalten.",
28509
+ "Los gr\xE1ficos, minigr\xE1ficos y tablas din\xE1micas de rangos admiten edici\xF3n. Se conservan las tablas avanzadas, macros y otros elementos no compatibles.",
28510
+ "\u652F\u6301\u7F16\u8F91\u56FE\u8868\u3001\u8FF7\u4F60\u56FE\u548C\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\u3002\u4FDD\u7559\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u5185\u5BB9\u3002"
28511
+ ],
28512
+ PivotTable: ["Tableau crois\xE9 dynamique", "PivotTable", "Tabla din\xE1mica", "\u6570\u636E\u900F\u89C6\u8868"],
28513
+ "Create PivotTable": [
28514
+ "Cr\xE9er un tableau crois\xE9 dynamique",
28515
+ "PivotTable erstellen",
28516
+ "Crear tabla din\xE1mica",
28517
+ "\u521B\u5EFA\u6570\u636E\u900F\u89C6\u8868"
28518
+ ],
28519
+ "PivotTable Settings": [
28520
+ "Param\xE8tres du tableau crois\xE9 dynamique",
28521
+ "PivotTable-Einstellungen",
28522
+ "Configuraci\xF3n de tabla din\xE1mica",
28523
+ "\u6570\u636E\u900F\u89C6\u8868\u8BBE\u7F6E"
28524
+ ],
28525
+ "Refresh PivotTable": [
28526
+ "Actualiser le tableau crois\xE9 dynamique",
28527
+ "PivotTable aktualisieren",
28528
+ "Actualizar tabla din\xE1mica",
28529
+ "\u5237\u65B0\u6570\u636E\u900F\u89C6\u8868"
28530
+ ],
28531
+ "Delete PivotTable": [
28532
+ "Supprimer le tableau crois\xE9 dynamique",
28533
+ "PivotTable l\xF6schen",
28534
+ "Eliminar tabla din\xE1mica",
28535
+ "\u5220\u9664\u6570\u636E\u900F\u89C6\u8868"
28536
+ ],
28537
+ "Source Range:": ["Plage source :", "Quellbereich:", "Rango de origen:", "\u6E90\u533A\u57DF\uFF1A"],
28538
+ "Destination Cell:": [
28539
+ "Cellule de destination :",
28540
+ "Zielzelle:",
28541
+ "Celda de destino:",
28542
+ "\u76EE\u6807\u5355\u5143\u683C\uFF1A"
28543
+ ],
28544
+ "Row Field:": ["Champ de ligne :", "Zeilenfeld:", "Campo de fila:", "\u884C\u5B57\u6BB5\uFF1A"],
28545
+ "Column Field:": ["Champ de colonne :", "Spaltenfeld:", "Campo de columna:", "\u5217\u5B57\u6BB5\uFF1A"],
28546
+ "Value Field:": ["Champ de valeur :", "Wertfeld:", "Campo de valor:", "\u503C\u5B57\u6BB5\uFF1A"],
28547
+ "Summarize Values By:": [
28548
+ "Synth\xE9tiser les valeurs par :",
28549
+ "Werte zusammenfassen nach:",
28550
+ "Resumir valores por:",
28551
+ "\u503C\u6C47\u603B\u65B9\u5F0F\uFF1A"
28552
+ ],
28553
+ "(None)": ["(Aucun)", "(Keine)", "(Ninguno)", "\uFF08\u65E0\uFF09"]
28554
+ };
28555
+
28556
+ // xlsx/ui/commands/i18n/print-layout.ts
28557
+ var PRINT_LAYOUT_STRINGS = {
28558
+ "Unsupported header/footer codes are preserved but not rendered.": [
28559
+ "Les codes d\u2019en-t\xEAte et pied non pris en charge sont conserv\xE9s mais non rendus.",
28560
+ "Nicht unterst\xFCtzte Kopf- und Fu\xDFzeilencodes bleiben erhalten, werden aber nicht dargestellt.",
28561
+ "Se conservan los c\xF3digos no compatibles del encabezado y pie, pero no se muestran.",
28562
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u4EE3\u7801\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28563
+ ],
28564
+ "Browser printing includes page setup, manual breaks, leading print titles and header/footer fields. Drawings and unsupported formatting are preserved but not rendered.": [
28565
+ "L\u2019impression du navigateur inclut la mise en page, les sauts manuels, les titres en t\xEAte et les champs d\u2019en-t\xEAte et pied. Les dessins et formats non pris en charge sont conserv\xE9s mais non rendus.",
28566
+ "Der Browserdruck umfasst Seiteneinrichtung, manuelle Umbr\xFCche, f\xFChrende Drucktitel sowie Kopf- und Fu\xDFzeilenfelder. Zeichnungen und nicht unterst\xFCtzte Formatierung bleiben erhalten, werden aber nicht dargestellt.",
28567
+ "La impresi\xF3n del navegador incluye configuraci\xF3n de p\xE1gina, saltos manuales, t\xEDtulos iniciales y campos de encabezado y pie. Se conservan dibujos y formatos no compatibles, pero no se muestran.",
28568
+ "\u6D4F\u89C8\u5668\u6253\u5370\u5305\u542B\u9875\u9762\u8BBE\u7F6E\u3001\u624B\u52A8\u5206\u9875\u7B26\u3001\u8D77\u59CB\u6253\u5370\u6807\u9898\u548C\u9875\u7709\u9875\u811A\u5B57\u6BB5\u3002\u4FDD\u7559\u7ED8\u56FE\u548C\u4E0D\u652F\u6301\u7684\u683C\u5F0F\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28569
+ ],
28570
+ "Non-leading or unsupported print titles are preserved but not rendered.": [
28571
+ "Les titres non plac\xE9s en t\xEAte ou non pris en charge sont conserv\xE9s mais non rendus.",
28572
+ "Nicht f\xFChrende oder nicht unterst\xFCtzte Drucktitel bleiben erhalten, werden aber nicht dargestellt.",
28573
+ "Se conservan los t\xEDtulos no iniciales o no compatibles, pero no se muestran.",
28574
+ "\u4FDD\u7559\u975E\u8D77\u59CB\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28575
+ ],
28576
+ "Print title ranges are too large for preview.": [
28577
+ "Les plages de titres sont trop grandes pour l\u2019aper\xE7u.",
28578
+ "Die Drucktitelbereiche sind f\xFCr die Vorschau zu gro\xDF.",
28579
+ "Los rangos de t\xEDtulos son demasiado grandes para la vista previa.",
28580
+ "\u6253\u5370\u6807\u9898\u533A\u57DF\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\u3002"
28581
+ ],
28582
+ "Repeated titles leave no room for worksheet data.": [
28583
+ "Les titres r\xE9p\xE9t\xE9s ne laissent pas de place aux donn\xE9es.",
28584
+ "Wiederholte Titel lassen keinen Platz f\xFCr Arbeitsblattdaten.",
28585
+ "Los t\xEDtulos repetidos no dejan espacio para los datos.",
28586
+ "\u91CD\u590D\u6807\u9898\u672A\u7ED9\u5DE5\u4F5C\u8868\u6570\u636E\u7559\u51FA\u7A7A\u95F4\u3002"
28587
+ ],
28588
+ "Preview does not render drawings.": [
28589
+ "L\u2019aper\xE7u ne rend pas les dessins.",
28590
+ "Die Vorschau stellt Zeichnungen nicht dar.",
28591
+ "La vista previa no muestra dibujos.",
28592
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3002"
28593
+ ],
28594
+ "Unsupported header or footer formatting and image fields are preserved but not rendered.": [
28595
+ "Les formats et champs d\u2019image non pris en charge des en-t\xEAtes et pieds sont conserv\xE9s mais non rendus.",
28596
+ "Nicht unterst\xFCtzte Formatierungen und Bildfelder in Kopf- und Fu\xDFzeilen bleiben erhalten, werden aber nicht dargestellt.",
28597
+ "Se conservan los formatos y campos de imagen no compatibles del encabezado y pie, pero no se muestran.",
28598
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u683C\u5F0F\u53CA\u56FE\u50CF\u5B57\u6BB5\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28599
+ ],
28600
+ "Merged print ranges are too large.": [
28601
+ "Les plages fusionn\xE9es \xE0 imprimer sont trop grandes.",
28602
+ "Die verbundenen Druckbereiche sind zu gro\xDF.",
28603
+ "Los rangos combinados de impresi\xF3n son demasiado grandes.",
28604
+ "\u5408\u5E76\u6253\u5370\u533A\u57DF\u8FC7\u5927\u3002"
28605
+ ],
28606
+ "Multiple or unsupported print areas are preserved; preview uses the worksheet used range.": [
28607
+ "Les zones d\u2019impression multiples ou non prises en charge sont conserv\xE9es ; l\u2019aper\xE7u utilise la plage utilis\xE9e de la feuille.",
28608
+ "Mehrere oder nicht unterst\xFCtzte Druckbereiche bleiben erhalten; die Vorschau verwendet den benutzten Arbeitsblattbereich.",
28609
+ "Se conservan las \xE1reas m\xFAltiples o no compatibles; la vista previa usa el rango utilizado de la hoja.",
28610
+ "\u4FDD\u7559\u591A\u4E2A\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u533A\u57DF\uFF1B\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5DF2\u7528\u533A\u57DF\u3002"
28611
+ ],
28612
+ "Previous Page": ["Page pr\xE9c\xE9dente", "Vorherige Seite", "P\xE1gina anterior", "\u4E0A\u4E00\u9875"],
28613
+ "Next Page": ["Page suivante", "N\xE4chste Seite", "P\xE1gina siguiente", "\u4E0B\u4E00\u9875"],
28614
+ "Actual Size": ["Taille r\xE9elle", "Tats\xE4chliche Gr\xF6\xDFe", "Tama\xF1o real", "\u5B9E\u9645\u5927\u5C0F"],
28615
+ "Fit Page": ["Ajuster \xE0 la page", "Seite einpassen", "Ajustar p\xE1gina", "\u9002\u5408\u9875\u9762"],
28616
+ "Page {page} of {count}": [
28617
+ "Page {page} sur {count}",
28618
+ "Seite {page} von {count}",
28619
+ "P\xE1gina {page} de {count}",
28620
+ "\u7B2C {page} \u9875\uFF0C\u5171 {count} \u9875"
28621
+ ],
28622
+ "Repeated print titles are preserved but not rendered in preview.": [
28623
+ "Les titres d\u2019impression r\xE9p\xE9t\xE9s sont conserv\xE9s mais non rendus dans l\u2019aper\xE7u.",
28624
+ "Wiederholte Drucktitel bleiben erhalten, werden aber in der Vorschau nicht dargestellt.",
28625
+ "Se conservan los t\xEDtulos repetidos, pero no se muestran en la vista previa.",
28626
+ "\u4FDD\u7559\u91CD\u590D\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u663E\u793A\u3002"
28627
+ ],
28628
+ "Merged cells crossing pages are rendered separately on each page.": [
28629
+ "Les cellules fusionn\xE9es sur plusieurs pages sont rendues s\xE9par\xE9ment sur chaque page.",
28630
+ "Seiten\xFCbergreifende verbundene Zellen werden auf jeder Seite getrennt dargestellt.",
28631
+ "Las celdas combinadas entre p\xE1ginas se muestran por separado en cada p\xE1gina.",
28632
+ "\u8DE8\u9875\u5408\u5E76\u5355\u5143\u683C\u5C06\u5728\u6BCF\u9875\u5206\u522B\u663E\u793A\u3002"
28633
+ ],
28634
+ "Browser printing uses paper size, margins, scaling and manual page breaks. Drawings, headers, footers and repeated titles are not rendered.": [
28635
+ "L\u2019impression du navigateur utilise le format du papier, les marges, l\u2019\xE9chelle et les sauts manuels. Les dessins, en-t\xEAtes, pieds de page et titres r\xE9p\xE9t\xE9s ne sont pas rendus.",
28636
+ "Der Browserdruck verwendet Papierformat, R\xE4nder, Skalierung und manuelle Seitenumbr\xFCche. Zeichnungen, Kopf- und Fu\xDFzeilen sowie wiederholte Titel werden nicht dargestellt.",
28637
+ "La impresi\xF3n del navegador usa tama\xF1o de papel, m\xE1rgenes, escala y saltos manuales. No muestra dibujos, encabezados, pies ni t\xEDtulos repetidos.",
28638
+ "\u6D4F\u89C8\u5668\u6253\u5370\u4F7F\u7528\u7EB8\u5F20\u5C3A\u5BF8\u3001\u8FB9\u8DDD\u3001\u7F29\u653E\u548C\u624B\u52A8\u5206\u9875\u7B26\u3002\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u3001\u9875\u811A\u6216\u91CD\u590D\u6807\u9898\u3002"
28639
+ ],
28640
+ "Print Preview": [
28641
+ "Aper\xE7u avant impression",
28642
+ "Druckvorschau",
28643
+ "Vista previa de impresi\xF3n",
28644
+ "\u6253\u5370\u9884\u89C8"
28645
+ ],
28646
+ Breaks: ["Sauts", "Umbr\xFCche", "Saltos", "\u5206\u9875\u7B26"],
28647
+ "Insert Row Page Break": [
28648
+ "Ins\xE9rer un saut de page de ligne",
28649
+ "Zeilen-Seitenumbruch einf\xFCgen",
28650
+ "Insertar salto de p\xE1gina de fila",
28651
+ "\u63D2\u5165\u884C\u5206\u9875\u7B26"
28652
+ ],
28653
+ "Insert Column Page Break": [
28654
+ "Ins\xE9rer un saut de page de colonne",
28655
+ "Spalten-Seitenumbruch einf\xFCgen",
28656
+ "Insertar salto de p\xE1gina de columna",
28657
+ "\u63D2\u5165\u5217\u5206\u9875\u7B26"
28658
+ ],
28659
+ "Remove Row Page Break": [
28660
+ "Supprimer le saut de page de ligne",
28661
+ "Zeilen-Seitenumbruch entfernen",
28662
+ "Quitar salto de p\xE1gina de fila",
28663
+ "\u5220\u9664\u884C\u5206\u9875\u7B26"
28664
+ ],
28665
+ "Remove Column Page Break": [
28666
+ "Supprimer le saut de page de colonne",
28667
+ "Spalten-Seitenumbruch entfernen",
28668
+ "Quitar salto de p\xE1gina de columna",
28669
+ "\u5220\u9664\u5217\u5206\u9875\u7B26"
28670
+ ],
28671
+ "Reset All Page Breaks": [
28672
+ "R\xE9initialiser tous les sauts de page",
28673
+ "Alle Seitenumbr\xFCche zur\xFCcksetzen",
28674
+ "Restablecer todos los saltos de p\xE1gina",
28675
+ "\u91CD\u7F6E\u6240\u6709\u5206\u9875\u7B26"
28676
+ ],
28677
+ "Pages: {count} | Scale: {scale}%": [
28678
+ "Pages : {count} | \xC9chelle : {scale}%",
28679
+ "Seiten: {count} | Skalierung: {scale}%",
28680
+ "P\xE1ginas: {count} | Escala: {scale}%",
28681
+ "\u9875\u6570\uFF1A{count} | \u7F29\u653E\uFF1A{scale}%"
28682
+ ],
28683
+ "Preview uses worksheet dimensions. Fonts and printer margins may change pagination in Excel.": [
28684
+ "L\u2019aper\xE7u utilise les dimensions de la feuille. Les polices et marges de l\u2019imprimante peuvent modifier la pagination dans Excel.",
28685
+ "Die Vorschau verwendet die Arbeitsblattma\xDFe. Schriftarten und Druckerr\xE4nder k\xF6nnen die Seitenaufteilung in Excel \xE4ndern.",
28686
+ "La vista previa usa las dimensiones de la hoja. Las fuentes y los m\xE1rgenes de impresora pueden cambiar la paginaci\xF3n en Excel.",
28687
+ "\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5C3A\u5BF8\u3002\u5B57\u4F53\u548C\u6253\u5370\u673A\u8FB9\u8DDD\u53EF\u80FD\u6539\u53D8 Excel \u4E2D\u7684\u5206\u9875\u3002"
28688
+ ],
28689
+ "Fit to pages ignores manual page breaks.": [
28690
+ "L\u2019ajustement aux pages ignore les sauts manuels.",
28691
+ "Beim Anpassen an Seiten werden manuelle Umbr\xFCche ignoriert.",
28692
+ "Ajustar a p\xE1ginas ignora los saltos manuales.",
28693
+ "\u8C03\u6574\u4E3A\u6307\u5B9A\u9875\u6570\u65F6\u5FFD\u7565\u624B\u52A8\u5206\u9875\u7B26\u3002"
28694
+ ],
28695
+ "Preview does not render drawings, headers or footers.": [
28696
+ "L\u2019aper\xE7u ne rend pas les dessins, en-t\xEAtes ou pieds de page.",
28697
+ "Die Vorschau stellt Zeichnungen, Kopf- und Fu\xDFzeilen nicht dar.",
28698
+ "La vista previa no muestra dibujos, encabezados ni pies de p\xE1gina.",
28699
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u6216\u9875\u811A\u3002"
28700
+ ],
28701
+ "Partial page breaks are preserved but not used in preview.": [
28702
+ "Les sauts de page partiels sont conserv\xE9s mais non utilis\xE9s dans l\u2019aper\xE7u.",
28703
+ "Teilweise Seitenumbr\xFCche bleiben erhalten, werden aber in der Vorschau nicht verwendet.",
28704
+ "Se conservan los saltos parciales, pero no se usan en la vista previa.",
28705
+ "\u4FDD\u7559\u5C40\u90E8\u5206\u9875\u7B26\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u4F7F\u7528\u3002"
28706
+ ],
28707
+ "This paper size is not supported in preview; Letter is used.": [
28708
+ "Ce format n\u2019est pas pris en charge dans l\u2019aper\xE7u ; Letter est utilis\xE9.",
28709
+ "Dieses Papierformat wird in der Vorschau nicht unterst\xFCtzt; Letter wird verwendet.",
28710
+ "Este tama\xF1o no se admite en la vista previa; se usa Carta.",
28711
+ "\u9884\u89C8\u4E0D\u652F\u6301\u6B64\u7EB8\u5F20\u5C3A\u5BF8\uFF0C\u4F7F\u7528 Letter\u3002"
28712
+ ],
28713
+ "The minimum scale prevents fitting the requested number of pages.": [
28714
+ "L\u2019\xE9chelle minimale emp\xEAche l\u2019ajustement au nombre de pages demand\xE9.",
28715
+ "Die minimale Skalierung verhindert die gew\xFCnschte Seitenanzahl.",
28716
+ "La escala m\xEDnima impide ajustar al n\xFAmero de p\xE1ginas solicitado.",
28717
+ "\u6700\u5C0F\u7F29\u653E\u6BD4\u4F8B\u65E0\u6CD5\u6EE1\u8DB3\u6307\u5B9A\u9875\u6570\u3002"
28718
+ ],
28719
+ "Rows or columns larger than a printed page are clipped.": [
28720
+ "Les lignes ou colonnes plus grandes qu\u2019une page sont rogn\xE9es.",
28721
+ "Zeilen oder Spalten, die gr\xF6\xDFer als eine Druckseite sind, werden abgeschnitten.",
28722
+ "Las filas o columnas mayores que una p\xE1gina se recortan.",
28723
+ "\u8D85\u8FC7\u6253\u5370\u9875\u9762\u5927\u5C0F\u7684\u884C\u6216\u5217\u5C06\u88AB\u88C1\u526A\u3002"
28724
+ ],
28725
+ "Margins do not fit the paper size.": [
28726
+ "Les marges ne correspondent pas au format du papier.",
28727
+ "Die R\xE4nder passen nicht zum Papierformat.",
28728
+ "Los m\xE1rgenes no caben en el tama\xF1o de papel.",
28729
+ "\u8FB9\u8DDD\u8D85\u51FA\u7EB8\u5F20\u5C3A\u5BF8\u3002"
28730
+ ],
28731
+ "Print preview supports at most one million cells.": [
28732
+ "L\u2019aper\xE7u prend en charge au maximum un million de cellules.",
28733
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens eine Million Zellen.",
28734
+ "La vista previa admite como m\xE1ximo un mill\xF3n de celdas.",
28735
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301\u4E00\u767E\u4E07\u4E2A\u5355\u5143\u683C\u3002"
28736
+ ],
28737
+ "Print preview supports at most 1000 pages.": [
28738
+ "L\u2019aper\xE7u prend en charge au maximum 1000 pages.",
28739
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens 1000 Seiten.",
28740
+ "La vista previa admite como m\xE1ximo 1000 p\xE1ginas.",
28741
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301 1000 \u9875\u3002"
28742
+ ],
28743
+ "Choose a row or column after the first to set a page break.": [
28744
+ "Choisissez une ligne ou colonne apr\xE8s la premi\xE8re pour d\xE9finir un saut de page.",
28745
+ "W\xE4hlen Sie eine Zeile oder Spalte nach der ersten f\xFCr einen Seitenumbruch.",
28746
+ "Elija una fila o columna despu\xE9s de la primera para establecer un salto.",
28747
+ "\u8BF7\u9009\u62E9\u7B2C\u4E00\u884C\u6216\u7B2C\u4E00\u5217\u4E4B\u540E\u7684\u4F4D\u7F6E\u8BBE\u7F6E\u5206\u9875\u7B26\u3002"
28748
+ ],
28749
+ "A worksheet can have at most 1026 manual breaks on each axis.": [
28750
+ "Une feuille peut contenir au maximum 1026 sauts manuels par axe.",
28751
+ "Ein Arbeitsblatt kann h\xF6chstens 1026 manuelle Umbr\xFCche pro Achse enthalten.",
28752
+ "Una hoja admite como m\xE1ximo 1026 saltos manuales por eje.",
28753
+ "\u5DE5\u4F5C\u8868\u6BCF\u4E2A\u65B9\u5411\u6700\u591A\u652F\u6301 1026 \u4E2A\u624B\u52A8\u5206\u9875\u7B26\u3002"
28754
+ ]
28755
+ };
28756
+
27084
28757
  // xlsx/ui/commands/i18n/types.ts
27085
28758
  var COLUMN = {
27086
28759
  fr: 0,
@@ -27106,7 +28779,10 @@ var COMMAND_TABLES = [
27106
28779
  FORMAT_CELLS_STRINGS,
27107
28780
  RULES_STRINGS,
27108
28781
  CORE_FEATURE_STRINGS,
27109
- CHART_SERIES_STRINGS
28782
+ CHART_SERIES_STRINGS,
28783
+ SPARKLINE_STRINGS,
28784
+ PIVOT_STRINGS,
28785
+ PRINT_LAYOUT_STRINGS
27110
28786
  ];
27111
28787
  var commandStrings = (locale) => flatten2(COMMAND_TABLES, locale);
27112
28788
 
@@ -29283,9 +30959,9 @@ function cellCommands() {
29283
30959
  ["format.hide-columns", "Hide Columns", "col", true],
29284
30960
  ["format.unhide-columns", "Unhide Columns", "col", false]
29285
30961
  ].map(
29286
- ([id, label2, axis, hidden]) => editing({
30962
+ ([id, label3, axis, hidden]) => editing({
29287
30963
  id,
29288
- label: label2,
30964
+ label: label3,
29289
30965
  icon: icon("hide"),
29290
30966
  lock: axis === "row" ? "formatRows" : "formatColumns",
29291
30967
  run: (ctx) => {
@@ -29324,47 +31000,47 @@ function cellCommands() {
29324
31000
  }
29325
31001
 
29326
31002
  // xlsx/ui/commands/cf-presets.ts
29327
- var argb = (hex2) => ({ rgb: `FF${hex2}` });
31003
+ var argb2 = (hex2) => ({ rgb: `FF${hex2}` });
29328
31004
  var HIGHLIGHT_STYLES = [
29329
31005
  [
29330
31006
  "lightRed",
29331
31007
  "Light Red Fill with Dark Red Text",
29332
31008
  {
29333
- font: { color: argb("9C0006") },
29334
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") }
31009
+ font: { color: argb2("9C0006") },
31010
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") }
29335
31011
  }
29336
31012
  ],
29337
31013
  [
29338
31014
  "yellow",
29339
31015
  "Yellow Fill with Dark Yellow Text",
29340
31016
  {
29341
- font: { color: argb("9C5700") },
29342
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFEB9C") }
31017
+ font: { color: argb2("9C5700") },
31018
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFEB9C") }
29343
31019
  }
29344
31020
  ],
29345
31021
  [
29346
31022
  "green",
29347
31023
  "Green Fill with Dark Green Text",
29348
31024
  {
29349
- font: { color: argb("006100") },
29350
- fill: { type: "pattern", pattern: "solid", bgColor: argb("C6EFCE") }
31025
+ font: { color: argb2("006100") },
31026
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("C6EFCE") }
29351
31027
  }
29352
31028
  ],
29353
31029
  [
29354
31030
  "lightRedFill",
29355
31031
  "Light Red Fill",
29356
- { fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") } }
31032
+ { fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") } }
29357
31033
  ],
29358
- ["redText", "Red Text", { font: { color: argb("9C0006") } }],
31034
+ ["redText", "Red Text", { font: { color: argb2("9C0006") } }],
29359
31035
  [
29360
31036
  "redBorder",
29361
31037
  "Red Border",
29362
31038
  {
29363
31039
  border: {
29364
- left: { style: "thin", color: argb("9C0006") },
29365
- right: { style: "thin", color: argb("9C0006") },
29366
- top: { style: "thin", color: argb("9C0006") },
29367
- bottom: { style: "thin", color: argb("9C0006") }
31040
+ left: { style: "thin", color: argb2("9C0006") },
31041
+ right: { style: "thin", color: argb2("9C0006") },
31042
+ top: { style: "thin", color: argb2("9C0006") },
31043
+ bottom: { style: "thin", color: argb2("9C0006") }
29368
31044
  }
29369
31045
  }
29370
31046
  ]
@@ -29421,13 +31097,13 @@ function dataBarRule(hex2) {
29421
31097
  type: "dataBar",
29422
31098
  min: { type: "min" },
29423
31099
  max: { type: "max" },
29424
- color: argb(hex2),
31100
+ color: argb2(hex2),
29425
31101
  priority: 1
29426
31102
  };
29427
31103
  }
29428
31104
  function colorScaleRule(colors) {
29429
31105
  const thresholds = colors.length === 3 ? [{ type: "min" }, { type: "percentile", value: "50" }, { type: "max" }] : [{ type: "min" }, { type: "max" }];
29430
- return { type: "colorScale", thresholds, colors: colors.map(argb), priority: 1 };
31106
+ return { type: "colorScale", thresholds, colors: colors.map(argb2), priority: 1 };
29431
31107
  }
29432
31108
  function iconSetRule(set) {
29433
31109
  return { type: "iconSet", iconSet: set, thresholds: iconThresholds(iconCount(set)), priority: 1 };
@@ -29597,10 +31273,10 @@ function activeChart(ctx) {
29597
31273
  const picked = t.ws.drawings[index2];
29598
31274
  return picked?.kind === "chart" ? { chart: picked, index: index2 } : void 0;
29599
31275
  }
29600
- function editChart(ctx, patch) {
31276
+ function editChart(ctx, patch2) {
29601
31277
  const t = target(ctx);
29602
31278
  const found = activeChart(ctx);
29603
- if (t && found) t.session.updateChart(t.sheet, found.index, patch(found.chart));
31279
+ if (t && found) t.session.updateChart(t.sheet, found.index, patch2(found.chart));
29604
31280
  }
29605
31281
  var TABLE_FLAGS = [
29606
31282
  ["showRowStripes", "table.banded-rows", "Banded Rows"],
@@ -29639,8 +31315,8 @@ function contextualCommands() {
29639
31315
  const t = target(ctx);
29640
31316
  const found = activeChart(ctx);
29641
31317
  if (!t || !found) return;
29642
- const patch = chartColorPalettePatch(found.chart, id);
29643
- if (patch) t.session.updateChart(t.sheet, found.index, patch);
31318
+ const patch2 = chartColorPalettePatch(found.chart, id);
31319
+ if (patch2) t.session.updateChart(t.sheet, found.index, patch2);
29644
31320
  }
29645
31321
  }),
29646
31322
  tableCmd({
@@ -29686,9 +31362,9 @@ function contextualCommands() {
29686
31362
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
29687
31363
  }),
29688
31364
  ...TABLE_FLAGS.map(
29689
- ([flag2, id, label2]) => tableCmd({
31365
+ ([flag2, id, label3]) => tableCmd({
29690
31366
  id,
29691
- label: label2,
31367
+ label: label3,
29692
31368
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
29693
31369
  run: (ctx) => {
29694
31370
  const t = target(ctx);
@@ -30071,9 +31747,9 @@ function fillDirection(ctx, dir) {
30071
31747
  function editingCommands() {
30072
31748
  return [
30073
31749
  ...AUTOSUM_FUNCTIONS.map(
30074
- ([fn, label2]) => editing({
31750
+ ([fn, label3]) => editing({
30075
31751
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
30076
- label: fn === "SUM" ? "AutoSum" : label2,
31752
+ label: fn === "SUM" ? "AutoSum" : label3,
30077
31753
  icon: icon("autoSum"),
30078
31754
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
30079
31755
  run: (ctx) => autoSum(ctx, fn)
@@ -30124,16 +31800,16 @@ function editingCommands() {
30124
31800
  ["comments", "Clear Comments and Notes"],
30125
31801
  ["hyperlinks", "Clear Hyperlinks"]
30126
31802
  ].map(
30127
- ([what, label2]) => editing({
31803
+ ([what, label3]) => editing({
30128
31804
  id: `home.clear-${what}`,
30129
- label: label2,
31805
+ label: label3,
30130
31806
  icon: icon("clear"),
30131
31807
  ...what === "formats" ? { lock: "formatCells" } : {},
30132
31808
  ...what === "contents" ? { shortcut: "Delete" } : {},
30133
31809
  run: (ctx) => {
30134
31810
  const t = target(ctx);
30135
31811
  if (!t) return;
30136
- t.session.batch(label2, () => {
31812
+ t.session.batch(label3, () => {
30137
31813
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
30138
31814
  });
30139
31815
  }
@@ -30174,9 +31850,9 @@ function editingCommands() {
30174
31850
  ["constants", "Constants"],
30175
31851
  ["validation", "Data Validation"]
30176
31852
  ].map(
30177
- ([kind, label2]) => viewing({
31853
+ ([kind, label3]) => viewing({
30178
31854
  id: `home.select-${kind}`,
30179
- label: label2,
31855
+ label: label3,
30180
31856
  icon: icon("findSelect"),
30181
31857
  run: (ctx) => {
30182
31858
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -30447,7 +32123,7 @@ function numberCommands() {
30447
32123
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
30448
32124
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
30449
32125
  ].map(
30450
- ([id, label2, format, shortcut]) => editing({ id, label: label2, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
32126
+ ([id, label3, format, shortcut]) => editing({ id, label: label3, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
30451
32127
  )
30452
32128
  ];
30453
32129
  }
@@ -30478,9 +32154,9 @@ var PAPER_SIZES = [
30478
32154
  [27, "Envelope DL"]
30479
32155
  ];
30480
32156
  var page = (ctx) => target(ctx)?.ws.pageSetup ?? {};
30481
- var setPage = (ctx, patch) => {
32157
+ var setPage = (ctx, patch2) => {
30482
32158
  const t = target(ctx);
30483
- if (t) t.session.setPageSetup(t.sheet, patch);
32159
+ if (t) t.session.setPageSetup(t.sheet, patch2);
30484
32160
  };
30485
32161
  function pageLayoutCommands() {
30486
32162
  return [
@@ -30613,6 +32289,43 @@ function pageLayoutCommands() {
30613
32289
  ];
30614
32290
  }
30615
32291
 
32292
+ // xlsx/ui/commands/page-breaks.ts
32293
+ function pageBreakCommands() {
32294
+ return [
32295
+ viewing({
32296
+ id: "page.preview",
32297
+ label: "Print Preview",
32298
+ icon: icon("pageSetup"),
32299
+ run: (ctx) => void ctx.dialogs.open("print-preview")
32300
+ }),
32301
+ ...["row", "col"].flatMap(
32302
+ (axis) => [true, false].map(
32303
+ (present) => editing({
32304
+ id: `page.break-${axis}-${present ? "insert" : "remove"}`,
32305
+ label: present ? axis === "row" ? "Insert Row Page Break" : "Insert Column Page Break" : axis === "row" ? "Remove Row Page Break" : "Remove Column Page Break",
32306
+ icon: icon("printArea"),
32307
+ lock: false,
32308
+ enabled: (ctx) => (target(ctx)?.active[axis] ?? 0) > 0,
32309
+ run: (ctx) => {
32310
+ const t = target(ctx);
32311
+ if (t) t.session.setPageBreak(t.sheet, axis, t.active[axis], present);
32312
+ }
32313
+ })
32314
+ )
32315
+ ),
32316
+ editing({
32317
+ id: "page.breaks-reset",
32318
+ label: "Reset All Page Breaks",
32319
+ icon: icon("printArea"),
32320
+ lock: false,
32321
+ run: (ctx) => {
32322
+ const t = target(ctx);
32323
+ if (t) t.session.resetPageBreaks(t.sheet);
32324
+ }
32325
+ })
32326
+ ];
32327
+ }
32328
+
30616
32329
  // xlsx/ui/commands/style-presets.ts
30617
32330
  var TABLE_STYLES = [
30618
32331
  ...Array.from({ length: 21 }, (_v, i2) => ({
@@ -30636,9 +32349,9 @@ function tableStyleColor(info, theme2) {
30636
32349
  if (slot === 0) return info.family === "Dark" ? "404040" : "808080";
30637
32350
  return theme2.colors[3 + slot] ?? "4472C4";
30638
32351
  }
30639
- var escapeAttr = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
32352
+ var escapeAttr2 = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
30640
32353
  function tableStylePreview(info, theme2) {
30641
- const c = `#${escapeAttr(tableStyleColor(info, theme2))}`;
32354
+ const c = `#${escapeAttr2(tableStyleColor(info, theme2))}`;
30642
32355
  const dark = info.family === "Dark";
30643
32356
  const header = info.family === "Light" ? "#ffffff" : c;
30644
32357
  const band = dark ? c : info.family === "Medium" ? `${c}55` : `${c}33`;
@@ -32311,13 +34024,13 @@ function searchCommands(ctx, query, isHidden) {
32311
34024
  const seen = /* @__PURE__ */ new Set();
32312
34025
  for (const command of ctx.commands.list()) {
32313
34026
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
32314
- const label2 = ctx.t(command.label).toLocaleLowerCase();
34027
+ const label3 = ctx.t(command.label).toLocaleLowerCase();
32315
34028
  const english = command.label.toLocaleLowerCase();
32316
- const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
34029
+ const haystack = `${label3} ${english} ${command.id.replace(/[.-]/g, " ")}`;
32317
34030
  if (!words2.every((word) => haystack.includes(word))) continue;
32318
- if (seen.has(label2)) continue;
32319
- seen.add(label2);
32320
- const score = label2.startsWith(words2[0]) ? 0 : label2.includes(words2[0]) ? 1 : 2;
34031
+ if (seen.has(label3)) continue;
34032
+ seen.add(label3);
34033
+ const score = label3.startsWith(words2[0]) ? 0 : label3.includes(words2[0]) ? 1 : 2;
32321
34034
  scored.push({ command, score });
32322
34035
  }
32323
34036
  return scored.sort(
@@ -32579,6 +34292,7 @@ exports.noteFunctionUse = noteFunctionUse;
32579
34292
  exports.numberCommands = numberCommands;
32580
34293
  exports.numberFormatOptions = numberFormatOptions;
32581
34294
  exports.onRibbonTabsChange = onRibbonTabsChange;
34295
+ exports.pageBreakCommands = pageBreakCommands;
32582
34296
  exports.pageLayoutCommands = pageLayoutCommands;
32583
34297
  exports.parseBorderArg = parseBorderArg;
32584
34298
  exports.parseSelectionRef = parseSelectionRef;