ooxml-core 1.8.4 → 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 (306) 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 +6652 -4002
  5. package/dist/automation/index.mjs +6652 -4002
  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 +593 -34
  129. package/dist/teams/index.mjs +593 -34
  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 +3159 -1164
  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 +3140 -1165
  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 +7784 -6976
  257. package/dist/xlsx/load/index.mjs +7784 -6976
  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 +2001 -288
  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 +2001 -289
  297. package/dist/xlsx/write/page-setup.d.ts.map +1 -1
  298. package/dist/xlsx/write/save.d.ts.map +1 -1
  299. package/dist/xlsx/write/sheet-parts.d.ts +1 -0
  300. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  301. package/dist/xlsx/write/workbook-part.d.ts +1 -1
  302. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  303. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  304. package/package.json +1 -1
  305. package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
  306. 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,6 +14675,17 @@ function shiftFormulaInBand(formula, formulaSheet, sheet, shift2, band) {
14333
14675
  return changed ? tokens.map((t) => t.text).join("") : formula;
14334
14676
  }
14335
14677
 
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 "";
14687
+ }
14688
+
14336
14689
  // xlsx/layout/sparkline-view.ts
14337
14690
  var DEFAULTS = {
14338
14691
  colorSeries: "#376092",
@@ -14380,6 +14733,7 @@ function positions(group, data, n) {
14380
14733
  return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
14381
14734
  }
14382
14735
  }
14736
+ if (group.dateAxis) return Array.from({ length: n }, () => null);
14383
14737
  return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
14384
14738
  }
14385
14739
  function pointFacts(values2) {
@@ -14446,7 +14800,8 @@ function sparklineView(group, data, scale2, theme2) {
14446
14800
  });
14447
14801
  if (segment.length) view.lines.push(segment);
14448
14802
  } else {
14449
- const slot = 1 / n;
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;
14450
14805
  const w = slot * (1 - COLUMN_GAP);
14451
14806
  const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
14452
14807
  values2.forEach((v, i2) => {
@@ -14525,11 +14880,25 @@ function readSparklineValues(sheet, range2, displayHidden) {
14525
14880
  function groupData(workbook, sheet, group) {
14526
14881
  const dateRange = group.dateAxis && group.dateFormula;
14527
14882
  const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
14528
- const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, group.displayHidden) : void 0;
14883
+ const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, true) : void 0;
14529
14884
  return group.sparklines.map((line2) => {
14530
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
+ }
14531
14900
  const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
14532
- return dateValues ? { values: values2, dates: dateValues } : { values: values2 };
14901
+ return { values: values2 };
14533
14902
  });
14534
14903
  }
14535
14904
  function sparklineViewAt(workbook, sheetIndex2, row2, col) {
@@ -14795,6 +15164,13 @@ function rewriteFormulas(workbook, rewrite, formulaCells) {
14795
15164
  }
14796
15165
  function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
14797
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
+ }
14798
15174
  {
14799
15175
  const name = sheet.name;
14800
15176
  for (const table2 of sheet.tables)
@@ -15147,20 +15523,20 @@ function addRowIntersections(sheet, r, patcher) {
15147
15523
  }
15148
15524
 
15149
15525
  // xlsx/edit/format.ts
15150
- function stylePatcher(workbook, patch) {
15526
+ function stylePatcher(workbook, patch2) {
15151
15527
  const memo = /* @__PURE__ */ new Map();
15152
15528
  return (id) => {
15153
15529
  const key = id ?? 0;
15154
15530
  let next = memo.get(key);
15155
15531
  if (next === void 0) {
15156
- next = applyStylePatch(workbook, id, patch);
15532
+ next = applyStylePatch(workbook, id, patch2);
15157
15533
  memo.set(key, next);
15158
15534
  }
15159
15535
  return next;
15160
15536
  };
15161
15537
  }
15162
- function patchRange(workbook, sheet, range2, patch) {
15163
- patchRangeWith(sheet, range2, stylePatcher(workbook, patch));
15538
+ function patchRange(workbook, sheet, range2, patch2) {
15539
+ patchRangeWith(sheet, range2, stylePatcher(workbook, patch2));
15164
15540
  }
15165
15541
  function patchRangeWith(sheet, range2, patcher) {
15166
15542
  const r = normalizeRange(range2);
@@ -15205,11 +15581,11 @@ function formatScopes(index2, ranges) {
15205
15581
  const whole = ranges.some((r) => isWholeColumns(r) || isWholeRows(r));
15206
15582
  return whole ? [cells, { kind: "parts", sheet: index2, parts: ["columns", "rowInfo"] }] : [cells];
15207
15583
  }
15208
- function applyStyle(ctx, s, ranges, patch) {
15584
+ function applyStyle(ctx, s, ranges, patch2) {
15209
15585
  const sheet = sheetAt(ctx.workbook, s);
15210
15586
  const normalized = ranges.map(normalizeRange);
15211
15587
  if (!normalized.length) return;
15212
- const patcher = stylePatcher(ctx.workbook, patch);
15588
+ const patcher = stylePatcher(ctx.workbook, patch2);
15213
15589
  ctx.run(
15214
15590
  "Format cells",
15215
15591
  "format",
@@ -15260,13 +15636,13 @@ function linearTrend(values2) {
15260
15636
  const n = values2.length;
15261
15637
  const meanX = (n - 1) / 2;
15262
15638
  const meanY = values2.reduce((a, b) => a + b, 0) / n;
15263
- let num2 = 0;
15639
+ let num3 = 0;
15264
15640
  let den = 0;
15265
15641
  values2.forEach((y, x) => {
15266
- num2 += (x - meanX) * (y - meanY);
15642
+ num3 += (x - meanX) * (y - meanY);
15267
15643
  den += (x - meanX) ** 2;
15268
15644
  });
15269
- const slope = den ? num2 / den : 0;
15645
+ const slope = den ? num3 / den : 0;
15270
15646
  return (k) => Number((meanY + slope * (k - meanX)).toPrecision(15));
15271
15647
  }
15272
15648
  var isDigit5 = (ch) => ch !== void 0 && ch >= "0" && ch <= "9";
@@ -15869,6 +16245,17 @@ function setBorders(ctx, s, range2, preset, edge = { style: "thin" }) {
15869
16245
 
15870
16246
  // xlsx/edit/insert-guard.ts
15871
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
+ }
15872
16259
  if (shift2.count <= 0) return;
15873
16260
  const max = shift2.axis === "row" ? MAX_ROW : MAX_COL;
15874
16261
  if (shift2.at + shift2.count > max + 1)
@@ -15936,6 +16323,13 @@ function shiftSheetContent(sheet, shift2, band) {
15936
16323
  return range2 ? [{ ...c, address: range2.start }] : [];
15937
16324
  });
15938
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
+ }
15939
16333
  for (const drawing of sheet.drawings) shiftAnchor(drawing.anchor, shift2, band);
15940
16334
  if (!band) shiftAxisFormats(sheet, shift2);
15941
16335
  if (sheet.autoFilter) {
@@ -16178,13 +16572,13 @@ function htmlHref(link) {
16178
16572
  const href = link?.target ? `${link.target}${link.location ? `#${link.location}` : ""}` : link?.location ? `#${link.location}` : void 0;
16179
16573
  return href && (href.startsWith("#") || hyperlinkPolicy(href).store) ? href : void 0;
16180
16574
  }
16181
- function hyperlinkFromHtmlAttributes(attrs, range2) {
16182
- const href = attrs?.get("href");
16575
+ function hyperlinkFromHtmlAttributes(attrs2, range2) {
16576
+ const href = attrs2?.get("href");
16183
16577
  if (!href || !href.startsWith("#") && !hyperlinkPolicy(href).store) return void 0;
16184
16578
  const link = { range: range2 };
16185
16579
  if (href.startsWith("#")) link.location = href.slice(1);
16186
16580
  else link.target = href;
16187
- const tooltip = attrs?.get("title");
16581
+ const tooltip = attrs2?.get("title");
16188
16582
  if (tooltip) link.tooltip = tooltip;
16189
16583
  return link;
16190
16584
  }
@@ -16281,21 +16675,21 @@ function toHtml(cells, theme2) {
16281
16675
  for (let c = 0; c < cells.cols; c++) {
16282
16676
  if (covered.has(`${r},${c}`)) continue;
16283
16677
  const cell = cells.data[r]?.[c] ?? null;
16284
- const attrs = [];
16678
+ const attrs2 = [];
16285
16679
  const span4 = spans2.get(`${r},${c}`);
16286
16680
  if (span4 && span4.end.row > span4.start.row)
16287
- attrs.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16681
+ attrs2.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16288
16682
  if (span4 && span4.end.col > span4.start.col)
16289
- attrs.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16290
- 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}"`);
16291
16685
  const css = cssFor(cell?.style, theme2);
16292
- if (css) attrs.push(`style="${escapeHtml(css)}"`);
16686
+ if (css) attrs2.push(`style="${escapeHtml(css)}"`);
16293
16687
  let text2 = escapeHtml(cell?.text ?? "").replace(/\n/g, "<br>");
16294
16688
  const link = links.get(`${r},${c}`);
16295
16689
  const href = htmlHref(link);
16296
16690
  if (href)
16297
16691
  text2 = `<a href="${escapeHtml(href)}"${link?.tooltip ? ` title="${escapeHtml(link.tooltip)}"` : ""}>${text2}</a>`;
16298
- tds.push(`<td${attrs.length ? ` ${attrs.join(" ")}` : ""}>${text2}</td>`);
16692
+ tds.push(`<td${attrs2.length ? ` ${attrs2.join(" ")}` : ""}>${text2}</td>`);
16299
16693
  }
16300
16694
  rows2.push(`<tr>${tds.join("")}</tr>`);
16301
16695
  }
@@ -16355,12 +16749,12 @@ function decodeEntities(text2) {
16355
16749
  });
16356
16750
  }
16357
16751
  function parseAttributes(text2) {
16358
- const attrs = /* @__PURE__ */ new Map();
16752
+ const attrs2 = /* @__PURE__ */ new Map();
16359
16753
  for (const m of text2.matchAll(
16360
16754
  /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
16361
16755
  ))
16362
- attrs.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16363
- return attrs;
16756
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16757
+ return attrs2;
16364
16758
  }
16365
16759
  function parseCss(text2) {
16366
16760
  const out = /* @__PURE__ */ new Map();
@@ -16386,7 +16780,7 @@ var V_ALIGN = {
16386
16780
  bottom: "bottom"
16387
16781
  };
16388
16782
  function stylePatchFromCss(css, inner2) {
16389
- const patch = {};
16783
+ const patch2 = {};
16390
16784
  const font = {};
16391
16785
  const weight = css.get("font-weight");
16392
16786
  if (weight && (weight === "bold" || Number(weight) >= 600) || /<(b|strong)\b/i.test(inner2))
@@ -16402,16 +16796,16 @@ function stylePatchFromCss(css, inner2) {
16402
16796
  if (size) font.size = Number(size[1]) * (size[2] === "px" ? 0.75 : 1);
16403
16797
  const family = css.get("font-family")?.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
16404
16798
  if (family) font.name = family;
16405
- if (Object.keys(font).length) patch.font = font;
16799
+ if (Object.keys(font).length) patch2.font = font;
16406
16800
  const background = css.get("background-color") ?? css.get("background");
16407
16801
  const fill = background && parseCssColor(background.split(/\s+/)[0] ?? "");
16408
- if (fill) patch.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16802
+ if (fill) patch2.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16409
16803
  const h2 = H_ALIGN[css.get("text-align") ?? ""];
16410
16804
  const v = V_ALIGN[css.get("vertical-align") ?? ""];
16411
- if (h2 || v) patch.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16805
+ if (h2 || v) patch2.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16412
16806
  const numFmt = css.get("mso-number-format");
16413
- if (numFmt) patch.numFmt = decodeNumberFormat(numFmt);
16414
- return patch;
16807
+ if (numFmt) patch2.numFmt = decodeNumberFormat(numFmt);
16808
+ return patch2;
16415
16809
  }
16416
16810
  function removeComments(text2) {
16417
16811
  let out = "";
@@ -16486,18 +16880,18 @@ function parseHtmlTable(html, base) {
16486
16880
  /<t([dh])\b([^>]*)>([\s\S]*?)(?:<\/t[dh]>|(?=<t[dh]\b)|$)/gi
16487
16881
  )) {
16488
16882
  while (taken.has(`${r},${c}`)) c++;
16489
- const attrs = parseAttributes(td[2] ?? "");
16883
+ const attrs2 = parseAttributes(td[2] ?? "");
16490
16884
  const inner2 = td[3] ?? "";
16491
16885
  const css = /* @__PURE__ */ new Map();
16492
- for (const name of (attrs.get("class") ?? "").split(/\s+/))
16886
+ for (const name of (attrs2.get("class") ?? "").split(/\s+/))
16493
16887
  for (const [k, v] of parseCss(classes.get(name) ?? "")) css.set(k, v);
16494
- for (const [k, v] of parseCss(attrs.get("style") ?? "")) css.set(k, v);
16495
- const patch = stylePatchFromCss(css, inner2);
16496
- 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 };
16497
16891
  const text2 = cellText(inner2);
16498
- row2[c] = text2 === "" && !Object.keys(patch).length ? null : toCell(text2, attrs, patch, base);
16499
- const rowSpan = Math.max(1, Number(attrs.get("rowspan") ?? 1) || 1);
16500
- 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);
16501
16895
  const anchor = /<a\b([^>]*)>/i.exec(inner2);
16502
16896
  const linkAttrs = anchor ? parseAttributes(anchor[1] ?? "") : void 0;
16503
16897
  const link = hyperlinkFromHtmlAttributes(linkAttrs, {
@@ -16527,17 +16921,17 @@ function parseHtmlTable(html, base) {
16527
16921
  );
16528
16922
  return rows2 && cols ? { rows: rows2, cols, data, merges, hyperlinks } : void 0;
16529
16923
  }
16530
- function toCell(text2, attrs, patch, base) {
16924
+ function toCell(text2, attrs2, patch2, base) {
16531
16925
  let value2 = text2;
16532
- const num2 = attrs.get("x:num");
16533
- if (num2 !== void 0 && num2 !== "" && Number.isFinite(Number(num2))) value2 = Number(num2);
16534
- else if (attrs.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16535
- 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 !== "") {
16536
16930
  const parsed = parseCellInput(text2);
16537
16931
  if (parsed.formula === void 0) value2 = parsed.value;
16538
- 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;
16539
16933
  }
16540
- return { value: value2, text: text2, style: patchStyle(base, patch) };
16934
+ return { value: value2, text: text2, style: patchStyle(base, patch2) };
16541
16935
  }
16542
16936
 
16543
16937
  // xlsx/edit/clipboard-text.ts
@@ -18084,10 +18478,10 @@ var SessionCalculator = class {
18084
18478
 
18085
18479
  // xlsx/edit/doc-properties.ts
18086
18480
  var same2 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
18087
- function setDocumentProperties(ctx, patch) {
18481
+ function setDocumentProperties(ctx, patch2) {
18088
18482
  const prior = ctx.workbook.properties;
18089
18483
  const next = { ...prior };
18090
- for (const [key, value2] of Object.entries(patch)) {
18484
+ for (const [key, value2] of Object.entries(patch2)) {
18091
18485
  if (value2 === void 0) continue;
18092
18486
  if (value2 === null) delete next[key];
18093
18487
  else next[key] = structuredClone(value2);
@@ -18140,6 +18534,444 @@ function deleteDrawing(ctx, s, index2) {
18140
18534
  );
18141
18535
  }
18142
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
+
18143
18975
  // xlsx/edit/cell-style.ts
18144
18976
  function ensureNamedStyle(workbook, name) {
18145
18977
  const lower2 = name.toLowerCase();
@@ -18247,19 +19079,19 @@ function addChart(ctx, s, chart) {
18247
19079
  { sheet: s }
18248
19080
  );
18249
19081
  }
18250
- function updateChart(ctx, s, index2, patch) {
18251
- assertBarClusterOptions(patch);
19082
+ function updateChart(ctx, s, index2, patch2) {
19083
+ assertBarClusterOptions(patch2);
18252
19084
  const sheet = sheetAt(ctx.workbook, s);
18253
19085
  const chart = sheet.drawings[index2];
18254
19086
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index2}`);
18255
- const formatting = patch.elementFills ? chartWithElementFills(chart, patch.elementFills).formatting : void 0;
19087
+ const formatting = patch2.elementFills ? chartWithElementFills(chart, patch2.elementFills).formatting : void 0;
18256
19088
  ctx.run(
18257
19089
  "Edit chart",
18258
19090
  "annotations",
18259
19091
  [{ kind: "sheet", sheet: s }],
18260
19092
  () => {
18261
19093
  const live = sheet.drawings[index2];
18262
- const changes = structuredClone(patch);
19094
+ const changes = structuredClone(patch2);
18263
19095
  delete changes.elementFills;
18264
19096
  if (formatting) live.formatting = formatting;
18265
19097
  changes.series?.forEach((series, i2) => {
@@ -18485,6 +19317,8 @@ function resizeTableIn(workbook, sheet, id, range2) {
18485
19317
  throw new Error("The table range is too small.");
18486
19318
  if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
18487
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.");
18488
19322
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
18489
19323
  throw new Error("A table cannot contain merged cells.");
18490
19324
  const oldEnd = table2.range.end.row;
@@ -18507,17 +19341,17 @@ var STYLE_KEYS = [
18507
19341
  "showFirstColumn",
18508
19342
  "showLastColumn"
18509
19343
  ];
18510
- function updateTable(ctx, s, ref, patch) {
19344
+ function updateTable(ctx, s, ref, patch2) {
18511
19345
  const { workbook } = ctx;
18512
19346
  const sheet = sheetAt(workbook, s);
18513
19347
  const current = sheet.tables[tableIndex(sheet, ref)];
18514
- const name = patch.name ?? patch.displayName;
19348
+ const name = patch2.name ?? patch2.displayName;
18515
19349
  const renaming = name !== void 0 && name !== current.name;
18516
19350
  if (renaming) {
18517
19351
  const problem = validateTableName(workbook, name, current);
18518
19352
  if (problem) throw new Error(problem);
18519
19353
  }
18520
- const wide = renaming || patch.headerRow !== void 0 || patch.totalsRow !== void 0;
19354
+ const wide = renaming || patch2.headerRow !== void 0 || patch2.totalsRow !== void 0;
18521
19355
  const scope = wide ? { kind: "workbook" } : { kind: "sheet", sheet: s };
18522
19356
  const id = current.id;
18523
19357
  ctx.run(
@@ -18528,25 +19362,25 @@ function updateTable(ctx, s, ref, patch) {
18528
19362
  const table2 = byId(sheet, id);
18529
19363
  if (renaming) renameTableIn(workbook, table2, name);
18530
19364
  for (const key of STYLE_KEYS) {
18531
- if (!(key in patch)) continue;
18532
- const value2 = patch[key];
19365
+ if (!(key in patch2)) continue;
19366
+ const value2 = patch2[key];
18533
19367
  if (value2 === void 0) delete table2[key];
18534
19368
  else table2[key] = value2;
18535
19369
  }
18536
- if (patch.columns) {
19370
+ if (patch2.columns) {
18537
19371
  const width = table2.range.end.col - table2.range.start.col + 1;
18538
- 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.");
18539
19373
  const before = table2.columns;
18540
- table2.columns = structuredClone(patch.columns);
19374
+ table2.columns = structuredClone(patch2.columns);
18541
19375
  for (const [index2, column] of table2.columns.entries()) {
18542
19376
  const sourceId = before[index2]?.sourceId;
18543
19377
  if (column.sourceId === void 0 && sourceId !== void 0) column.sourceId = sourceId;
18544
19378
  }
18545
19379
  }
18546
- if (patch.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch.headerRow);
18547
- if (patch.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch.totalsRow);
18548
- else if (patch.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
18549
- 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);
18550
19384
  },
18551
19385
  { sheet: s, ranges: [current.range], structural: true }
18552
19386
  );
@@ -18728,28 +19562,28 @@ function compact2(value2) {
18728
19562
  if (value2[key] === void 0) delete value2[key];
18729
19563
  return value2;
18730
19564
  }
18731
- function setPageSetup(ctx, s, patch) {
19565
+ function setPageSetup(ctx, s, patch2) {
18732
19566
  const sheet = sheetAt(ctx.workbook, s);
18733
19567
  ctx.run(
18734
19568
  "Page setup",
18735
19569
  "view",
18736
19570
  [{ kind: "sheet", sheet: s }],
18737
19571
  () => {
18738
- const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch) });
19572
+ const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch2) });
18739
19573
  if (Object.keys(next).length) sheet.pageSetup = next;
18740
19574
  else Reflect.deleteProperty(sheet, "pageSetup");
18741
19575
  },
18742
19576
  { sheet: s }
18743
19577
  );
18744
19578
  }
18745
- function setPrintOptions(ctx, s, patch) {
19579
+ function setPrintOptions(ctx, s, patch2) {
18746
19580
  const sheet = sheetAt(ctx.workbook, s);
18747
19581
  ctx.run(
18748
19582
  "Print options",
18749
19583
  "view",
18750
19584
  [{ kind: "sheet", sheet: s }],
18751
19585
  () => {
18752
- const next = { ...sheet.printOptions, ...patch };
19586
+ const next = { ...sheet.printOptions, ...patch2 };
18753
19587
  for (const key of Object.keys(next))
18754
19588
  if (!next[key]) delete next[key];
18755
19589
  if (Object.keys(next).length) sheet.printOptions = next;
@@ -18760,6 +19594,203 @@ function setPrintOptions(ctx, s, patch) {
18760
19594
  );
18761
19595
  }
18762
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);
19792
+ }
19793
+
18763
19794
  // digest/algorithm-names.ts
18764
19795
  var CANONICAL_BY_LOOKUP_KEY = {
18765
19796
  SHA1: "SHA-1",
@@ -20044,12 +21075,12 @@ function compress3(h2, data, offset2) {
20044
21075
  W3[i2 * 2 + 1] = lo;
20045
21076
  }
20046
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];
20047
- 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];
20048
21079
  for (let i2 = 0; i2 < 80; i2++) {
20049
- const S1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23);
20050
- 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);
20051
21082
  const chh = eh & fh ^ ~eh & gh;
20052
- const chl = el & fl ^ ~el & gl;
21083
+ const chl = el2 & fl ^ ~el2 & gl;
20053
21084
  let t1l = (hl >>> 0) + (S1l >>> 0) + (chl >>> 0) + K4[i2 * 2 + 1] + W3[i2 * 2 + 1];
20054
21085
  const t1h = hh + S1h + chh + K4[i2 * 2] + W3[i2 * 2] + Math.floor(t1l / 4294967296);
20055
21086
  t1l >>>= 0;
@@ -20065,10 +21096,10 @@ function compress3(h2, data, offset2) {
20065
21096
  gh = fh;
20066
21097
  gl = fl;
20067
21098
  fh = eh;
20068
- fl = el;
21099
+ fl = el2;
20069
21100
  let nl = (dl >>> 0) + t1l;
20070
21101
  eh = dh + t1h + Math.floor(nl / 4294967296) >>> 0;
20071
- el = nl >>> 0;
21102
+ el2 = nl >>> 0;
20072
21103
  dh = ch;
20073
21104
  dl = cl;
20074
21105
  ch = bh;
@@ -20088,7 +21119,7 @@ function compress3(h2, data, offset2) {
20088
21119
  add2(2, bh, bl);
20089
21120
  add2(4, ch, cl);
20090
21121
  add2(6, dh, dl);
20091
- add2(8, eh, el);
21122
+ add2(8, eh, el2);
20092
21123
  add2(10, fh, fl);
20093
21124
  add2(12, gh, gl);
20094
21125
  add2(14, hh, hl);
@@ -20639,6 +21670,8 @@ function merge(ctx, s, range2, mode) {
20639
21670
  if (r.start.row === r.end.row && r.start.col === r.end.col) return;
20640
21671
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
20641
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.");
20642
21675
  const targets = mergeTargets(r, mode);
20643
21676
  if (!targets.length) return;
20644
21677
  ctx.run(
@@ -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 = [];
@@ -21426,6 +22476,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
21426
22476
  if (r.start.row === r.end.row && r.start.col === r.end.col) r = currentRegion(sheet, r.start);
21427
22477
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
21428
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.");
21429
22481
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
21430
22482
  throw new Error("A table cannot contain merged cells.");
21431
22483
  return ctx.run(
@@ -21652,68 +22704,6 @@ function failure(dv) {
21652
22704
  return result2;
21653
22705
  }
21654
22706
 
21655
- // xlsx/edit/view.ts
21656
- function setFreeze(ctx, s, freeze) {
21657
- const sheet = sheetAt(ctx.workbook, s);
21658
- const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
21659
- ctx.run(
21660
- next ? "Freeze panes" : "Unfreeze panes",
21661
- "view",
21662
- [{ kind: "sheet", sheet: s }],
21663
- () => {
21664
- if (next) sheet.view.freeze = next;
21665
- else delete sheet.view.freeze;
21666
- },
21667
- { sheet: s, structural: true }
21668
- );
21669
- }
21670
- function setSheetView(ctx, s, patch) {
21671
- const sheet = sheetAt(ctx.workbook, s);
21672
- ctx.run(
21673
- "Sheet view",
21674
- "view",
21675
- [{ kind: "sheet", sheet: s }],
21676
- () => {
21677
- const view = { ...sheet.view, ...structuredClone(patch) };
21678
- for (const key of Object.keys(view))
21679
- if (view[key] === void 0) delete view[key];
21680
- if (patch.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch.zoom)));
21681
- sheet.view = view;
21682
- },
21683
- { sheet: s, structural: patch.zoom !== void 0 || "freeze" in patch }
21684
- );
21685
- }
21686
- var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
21687
- function validateDefinedName(name) {
21688
- if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
21689
- if (!NAME_PATTERN.test(name))
21690
- return "A name must start with a letter, underscore or backslash and contain no spaces.";
21691
- if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
21692
- return "A name cannot look like a cell reference.";
21693
- return void 0;
21694
- }
21695
- var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
21696
- function setDefinedName(ctx, name) {
21697
- const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
21698
- if (problem) throw new Error(problem);
21699
- if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
21700
- const entry = structuredClone(name);
21701
- entry.formula = entry.formula.replace(/^=/, "");
21702
- ctx.run("Define name", "names", [{ kind: "meta" }], () => {
21703
- const { definedNames } = ctx.workbook;
21704
- const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
21705
- if (index2 >= 0) definedNames[index2] = entry;
21706
- else definedNames.push(entry);
21707
- });
21708
- }
21709
- function deleteDefinedName(ctx, name, localSheet) {
21710
- const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
21711
- if (index2 < 0) return;
21712
- ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
21713
- ctx.workbook.definedNames.splice(index2, 1);
21714
- });
21715
- }
21716
-
21717
22707
  // xlsx/edit/session.ts
21718
22708
  function createEditSession(workbook, options = {}) {
21719
22709
  const calc = createCalcEngine(workbook);
@@ -21726,8 +22716,8 @@ function createEditSession(workbook, options = {}) {
21726
22716
  };
21727
22717
  const calculator = new SessionCalculator(workbook, calc, autoRecalc);
21728
22718
  const recalc = (step, mode = "apply") => calculator.afterStep(step, mode);
21729
- const begin = (label2, kind, info) => {
21730
- 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 };
21731
22721
  if (info.calc) step.calc = info.calc;
21732
22722
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
21733
22723
  };
@@ -21751,9 +22741,18 @@ function createEditSession(workbook, options = {}) {
21751
22741
  }
21752
22742
  current.step.entries.length = from;
21753
22743
  };
21754
- 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
+ }
21755
22754
  const outer = !open;
21756
- const current = open ?? begin(label2, kind, info);
22755
+ const current = open ?? begin(label3, kind, info);
21757
22756
  if (!outer) {
21758
22757
  delete current.step.calc;
21759
22758
  if (info.structural) current.step.structural = true;
@@ -21819,7 +22818,7 @@ function createEditSession(workbook, options = {}) {
21819
22818
  setCellValue: (s, r, c, value2) => setCellValue(ctx, s, r, c, value2),
21820
22819
  setRangeValues: (s, at, rows2) => setRangeValues(ctx, s, at, rows2),
21821
22820
  clearRange: (s, range2, what) => clearRange(ctx, s, range2, what),
21822
- applyStyle: (s, ranges, patch) => applyStyle(ctx, s, ranges, patch),
22821
+ applyStyle: (s, ranges, patch2) => applyStyle(ctx, s, ranges, patch2),
21823
22822
  setBorders: (s, range2, preset, edge) => setBorders(ctx, s, range2, preset, edge),
21824
22823
  insertRows: (s, at, count2) => insertRows(ctx, s, at, count2),
21825
22824
  deleteRows: (s, at, count2) => deleteRows(ctx, s, at, count2),
@@ -21857,24 +22856,34 @@ function createEditSession(workbook, options = {}) {
21857
22856
  filterColumn: (s, col, vals) => filterColumn(ctx, s, col, vals),
21858
22857
  sortByColumn: (s, col, descending) => sortByColumn(ctx, s, col, descending ?? false),
21859
22858
  createTable: (s, range2, hasHeader, styleName) => createTable(ctx, s, range2, hasHeader, styleName),
21860
- setSheetView: (s, patch) => setSheetView(ctx, s, patch),
22859
+ setSheetView: (s, patch2) => setSheetView(ctx, s, patch2),
21861
22860
  setDefinedName: (name) => setDefinedName(ctx, name),
21862
22861
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
21863
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),
21864
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),
21865
22871
  addChart: (s, chart) => addChart(ctx, s, chart),
21866
- updateChart: (s, index2, patch) => updateChart(ctx, s, index2, patch),
22872
+ updateChart: (s, index2, patch2) => updateChart(ctx, s, index2, patch2),
21867
22873
  addImage: (s, bytes, type, anchor, name) => addImage(ctx, s, bytes, type, anchor, name),
21868
22874
  replaceConditionalFormat: (s, index2, cf) => replaceConditionalFormat(ctx, s, index2, cf),
21869
22875
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
21870
22876
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
21871
22877
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
21872
- updateTable: (s, table2, patch) => updateTable(ctx, s, table2, patch),
22878
+ updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
21873
22879
  resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
21874
22880
  convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
21875
22881
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
21876
- setPageSetup: (s, patch) => setPageSetup(ctx, s, patch),
21877
- 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),
21878
22887
  setSheetProtection: (s, p, password) => setSheetProtection(ctx, s, p, password),
21879
22888
  setWorkbookProtection: (locked, password) => setWorkbookProtection(ctx, locked, password),
21880
22889
  groupRows: (s, from, to) => groupRows(ctx, s, from, to),
@@ -21884,7 +22893,7 @@ function createEditSession(workbook, options = {}) {
21884
22893
  setDefaultColumnWidth: (s, width) => setDefaultColumnWidth(ctx, s, width),
21885
22894
  removeDuplicates: (s, range2, cols, hasHeader) => removeDuplicates(ctx, s, range2, cols, hasHeader),
21886
22895
  setCalcMode: (mode) => setCalcMode(ctx, mode),
21887
- setDocumentProperties: (patch) => setDocumentProperties(ctx, patch),
22896
+ setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
21888
22897
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
21889
22898
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
21890
22899
  calculateNow(options2) {
@@ -21899,12 +22908,12 @@ function createEditSession(workbook, options = {}) {
21899
22908
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
21900
22909
  evaluate: (formula, at) => calc.evaluate(formula, at)
21901
22910
  }),
21902
- batch(label2, fn) {
22911
+ batch(label3, fn) {
21903
22912
  if (open) {
21904
22913
  fn();
21905
22914
  return;
21906
22915
  }
21907
- const current = begin(label2, "batch", {});
22916
+ const current = begin(label3, "batch", {});
21908
22917
  open = current;
21909
22918
  try {
21910
22919
  fn();
@@ -22859,21 +23868,21 @@ function stepFontSize(size, grow) {
22859
23868
  if (grow) return FONT_SIZES.find((s) => s > size) ?? Math.min(409, size + 10);
22860
23869
  return [...FONT_SIZES].reverse().find((s) => s < size) ?? Math.max(1, size - 1);
22861
23870
  }
22862
- var style = (ctx, patch) => {
22863
- 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));
22864
23873
  };
22865
23874
  function pickColor(arg) {
22866
23875
  if (arg && typeof arg === "object" && !arg.auto) return arg;
22867
23876
  return null;
22868
23877
  }
22869
- var toggle = (id, label2, glyph, shortcut, read, patch) => editing({
23878
+ var toggle = (id, label3, glyph, shortcut, read, patch2) => editing({
22870
23879
  id,
22871
- label: label2,
23880
+ label: label3,
22872
23881
  icon: icon(glyph),
22873
23882
  shortcut,
22874
23883
  lock: "formatCells",
22875
23884
  checked: read,
22876
- run: (ctx) => style(ctx, patch(!read(ctx)))
23885
+ run: (ctx) => style(ctx, patch2(!read(ctx)))
22877
23886
  });
22878
23887
  var BORDER_PRESETS = [
22879
23888
  ["bottom", "Bottom Border", "borderBottom"],
@@ -23053,10 +24062,10 @@ var mergedAtActive = (ctx) => {
23053
24062
  const t = target(ctx);
23054
24063
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
23055
24064
  };
23056
- function mergeCommand(id, label2, mode) {
24065
+ function mergeCommand(id, label3, mode) {
23057
24066
  return editing({
23058
24067
  id,
23059
- label: label2,
24068
+ label: label3,
23060
24069
  icon: icon("mergeCenter"),
23061
24070
  lock: "formatCells",
23062
24071
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -23071,30 +24080,30 @@ function mergeCommand(id, label2, mode) {
23071
24080
  }
23072
24081
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
23073
24082
  const ok = await ctx.dialogs.open("confirm", {
23074
- heading: label2,
24083
+ heading: label3,
23075
24084
  message: "Merging cells only keeps the upper-left value and discards other values."
23076
24085
  });
23077
24086
  if (ok !== true) return;
23078
24087
  if (ctx.session() !== t.session || ctx.readOnly()) return;
23079
24088
  }
23080
- t.session.batch(label2, () => {
24089
+ t.session.batch(label3, () => {
23081
24090
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
23082
24091
  });
23083
24092
  }
23084
24093
  });
23085
24094
  }
23086
24095
  function alignmentCommands() {
23087
- const valign = (id, label2, value2, glyph) => editing({
24096
+ const valign = (id, label3, value2, glyph) => editing({
23088
24097
  id,
23089
- label: label2,
24098
+ label: label3,
23090
24099
  icon: icon(glyph),
23091
24100
  lock: "formatCells",
23092
24101
  checked: (ctx) => vertical(ctx) === value2,
23093
24102
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
23094
24103
  });
23095
- const halign = (id, label2, value2, glyph) => editing({
24104
+ const halign = (id, label3, value2, glyph) => editing({
23096
24105
  id,
23097
- label: label2,
24106
+ label: label3,
23098
24107
  icon: icon(glyph),
23099
24108
  lock: "formatCells",
23100
24109
  checked: (ctx) => horizontal(ctx) === value2,
@@ -24478,6 +25487,24 @@ var MESSAGE_STRINGS = {
24478
25487
 
24479
25488
  // xlsx/ui/commands/i18n/navigation.ts
24480
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
+ ],
24481
25508
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
24482
25509
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
24483
25510
  Close: ["Fermer", "Schlie\xDFen", "Cerrar", "\u5173\u95ED"],
@@ -26614,6 +27641,149 @@ var RIBBON_TAB_STRINGS = {
26614
27641
 
26615
27642
  // xlsx/ui/commands/i18n/tools.ts
26616
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
+ ],
26617
27787
  // Insert Chart
26618
27788
  "Insert Chart": ["Ins\xE9rer un graphique", "Diagramm einf\xFCgen", "Insertar gr\xE1fico", "\u63D2\u5165\u56FE\u8868"],
26619
27789
  "Change Chart Type": [
@@ -27082,6 +28252,508 @@ var TOOLS_STRINGS = {
27082
28252
  ]
27083
28253
  };
27084
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
+
27085
28757
  // xlsx/ui/commands/i18n/types.ts
27086
28758
  var COLUMN = {
27087
28759
  fr: 0,
@@ -27107,7 +28779,10 @@ var COMMAND_TABLES = [
27107
28779
  FORMAT_CELLS_STRINGS,
27108
28780
  RULES_STRINGS,
27109
28781
  CORE_FEATURE_STRINGS,
27110
- CHART_SERIES_STRINGS
28782
+ CHART_SERIES_STRINGS,
28783
+ SPARKLINE_STRINGS,
28784
+ PIVOT_STRINGS,
28785
+ PRINT_LAYOUT_STRINGS
27111
28786
  ];
27112
28787
  var commandStrings = (locale) => flatten2(COMMAND_TABLES, locale);
27113
28788
 
@@ -29284,9 +30959,9 @@ function cellCommands() {
29284
30959
  ["format.hide-columns", "Hide Columns", "col", true],
29285
30960
  ["format.unhide-columns", "Unhide Columns", "col", false]
29286
30961
  ].map(
29287
- ([id, label2, axis, hidden]) => editing({
30962
+ ([id, label3, axis, hidden]) => editing({
29288
30963
  id,
29289
- label: label2,
30964
+ label: label3,
29290
30965
  icon: icon("hide"),
29291
30966
  lock: axis === "row" ? "formatRows" : "formatColumns",
29292
30967
  run: (ctx) => {
@@ -29325,47 +31000,47 @@ function cellCommands() {
29325
31000
  }
29326
31001
 
29327
31002
  // xlsx/ui/commands/cf-presets.ts
29328
- var argb = (hex2) => ({ rgb: `FF${hex2}` });
31003
+ var argb2 = (hex2) => ({ rgb: `FF${hex2}` });
29329
31004
  var HIGHLIGHT_STYLES = [
29330
31005
  [
29331
31006
  "lightRed",
29332
31007
  "Light Red Fill with Dark Red Text",
29333
31008
  {
29334
- font: { color: argb("9C0006") },
29335
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") }
31009
+ font: { color: argb2("9C0006") },
31010
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") }
29336
31011
  }
29337
31012
  ],
29338
31013
  [
29339
31014
  "yellow",
29340
31015
  "Yellow Fill with Dark Yellow Text",
29341
31016
  {
29342
- font: { color: argb("9C5700") },
29343
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFEB9C") }
31017
+ font: { color: argb2("9C5700") },
31018
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFEB9C") }
29344
31019
  }
29345
31020
  ],
29346
31021
  [
29347
31022
  "green",
29348
31023
  "Green Fill with Dark Green Text",
29349
31024
  {
29350
- font: { color: argb("006100") },
29351
- fill: { type: "pattern", pattern: "solid", bgColor: argb("C6EFCE") }
31025
+ font: { color: argb2("006100") },
31026
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("C6EFCE") }
29352
31027
  }
29353
31028
  ],
29354
31029
  [
29355
31030
  "lightRedFill",
29356
31031
  "Light Red Fill",
29357
- { fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") } }
31032
+ { fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") } }
29358
31033
  ],
29359
- ["redText", "Red Text", { font: { color: argb("9C0006") } }],
31034
+ ["redText", "Red Text", { font: { color: argb2("9C0006") } }],
29360
31035
  [
29361
31036
  "redBorder",
29362
31037
  "Red Border",
29363
31038
  {
29364
31039
  border: {
29365
- left: { style: "thin", color: argb("9C0006") },
29366
- right: { style: "thin", color: argb("9C0006") },
29367
- top: { style: "thin", color: argb("9C0006") },
29368
- 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") }
29369
31044
  }
29370
31045
  }
29371
31046
  ]
@@ -29422,13 +31097,13 @@ function dataBarRule(hex2) {
29422
31097
  type: "dataBar",
29423
31098
  min: { type: "min" },
29424
31099
  max: { type: "max" },
29425
- color: argb(hex2),
31100
+ color: argb2(hex2),
29426
31101
  priority: 1
29427
31102
  };
29428
31103
  }
29429
31104
  function colorScaleRule(colors) {
29430
31105
  const thresholds = colors.length === 3 ? [{ type: "min" }, { type: "percentile", value: "50" }, { type: "max" }] : [{ type: "min" }, { type: "max" }];
29431
- return { type: "colorScale", thresholds, colors: colors.map(argb), priority: 1 };
31106
+ return { type: "colorScale", thresholds, colors: colors.map(argb2), priority: 1 };
29432
31107
  }
29433
31108
  function iconSetRule(set) {
29434
31109
  return { type: "iconSet", iconSet: set, thresholds: iconThresholds(iconCount(set)), priority: 1 };
@@ -29598,10 +31273,10 @@ function activeChart(ctx) {
29598
31273
  const picked = t.ws.drawings[index2];
29599
31274
  return picked?.kind === "chart" ? { chart: picked, index: index2 } : void 0;
29600
31275
  }
29601
- function editChart(ctx, patch) {
31276
+ function editChart(ctx, patch2) {
29602
31277
  const t = target(ctx);
29603
31278
  const found = activeChart(ctx);
29604
- 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));
29605
31280
  }
29606
31281
  var TABLE_FLAGS = [
29607
31282
  ["showRowStripes", "table.banded-rows", "Banded Rows"],
@@ -29640,8 +31315,8 @@ function contextualCommands() {
29640
31315
  const t = target(ctx);
29641
31316
  const found = activeChart(ctx);
29642
31317
  if (!t || !found) return;
29643
- const patch = chartColorPalettePatch(found.chart, id);
29644
- 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);
29645
31320
  }
29646
31321
  }),
29647
31322
  tableCmd({
@@ -29687,9 +31362,9 @@ function contextualCommands() {
29687
31362
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
29688
31363
  }),
29689
31364
  ...TABLE_FLAGS.map(
29690
- ([flag2, id, label2]) => tableCmd({
31365
+ ([flag2, id, label3]) => tableCmd({
29691
31366
  id,
29692
- label: label2,
31367
+ label: label3,
29693
31368
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
29694
31369
  run: (ctx) => {
29695
31370
  const t = target(ctx);
@@ -30072,9 +31747,9 @@ function fillDirection(ctx, dir) {
30072
31747
  function editingCommands() {
30073
31748
  return [
30074
31749
  ...AUTOSUM_FUNCTIONS.map(
30075
- ([fn, label2]) => editing({
31750
+ ([fn, label3]) => editing({
30076
31751
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
30077
- label: fn === "SUM" ? "AutoSum" : label2,
31752
+ label: fn === "SUM" ? "AutoSum" : label3,
30078
31753
  icon: icon("autoSum"),
30079
31754
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
30080
31755
  run: (ctx) => autoSum(ctx, fn)
@@ -30125,16 +31800,16 @@ function editingCommands() {
30125
31800
  ["comments", "Clear Comments and Notes"],
30126
31801
  ["hyperlinks", "Clear Hyperlinks"]
30127
31802
  ].map(
30128
- ([what, label2]) => editing({
31803
+ ([what, label3]) => editing({
30129
31804
  id: `home.clear-${what}`,
30130
- label: label2,
31805
+ label: label3,
30131
31806
  icon: icon("clear"),
30132
31807
  ...what === "formats" ? { lock: "formatCells" } : {},
30133
31808
  ...what === "contents" ? { shortcut: "Delete" } : {},
30134
31809
  run: (ctx) => {
30135
31810
  const t = target(ctx);
30136
31811
  if (!t) return;
30137
- t.session.batch(label2, () => {
31812
+ t.session.batch(label3, () => {
30138
31813
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
30139
31814
  });
30140
31815
  }
@@ -30175,9 +31850,9 @@ function editingCommands() {
30175
31850
  ["constants", "Constants"],
30176
31851
  ["validation", "Data Validation"]
30177
31852
  ].map(
30178
- ([kind, label2]) => viewing({
31853
+ ([kind, label3]) => viewing({
30179
31854
  id: `home.select-${kind}`,
30180
- label: label2,
31855
+ label: label3,
30181
31856
  icon: icon("findSelect"),
30182
31857
  run: (ctx) => {
30183
31858
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -30448,7 +32123,7 @@ function numberCommands() {
30448
32123
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
30449
32124
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
30450
32125
  ].map(
30451
- ([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) })
30452
32127
  )
30453
32128
  ];
30454
32129
  }
@@ -30479,9 +32154,9 @@ var PAPER_SIZES = [
30479
32154
  [27, "Envelope DL"]
30480
32155
  ];
30481
32156
  var page = (ctx) => target(ctx)?.ws.pageSetup ?? {};
30482
- var setPage = (ctx, patch) => {
32157
+ var setPage = (ctx, patch2) => {
30483
32158
  const t = target(ctx);
30484
- if (t) t.session.setPageSetup(t.sheet, patch);
32159
+ if (t) t.session.setPageSetup(t.sheet, patch2);
30485
32160
  };
30486
32161
  function pageLayoutCommands() {
30487
32162
  return [
@@ -30614,6 +32289,43 @@ function pageLayoutCommands() {
30614
32289
  ];
30615
32290
  }
30616
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
+
30617
32329
  // xlsx/ui/commands/style-presets.ts
30618
32330
  var TABLE_STYLES = [
30619
32331
  ...Array.from({ length: 21 }, (_v, i2) => ({
@@ -30637,9 +32349,9 @@ function tableStyleColor(info, theme2) {
30637
32349
  if (slot === 0) return info.family === "Dark" ? "404040" : "808080";
30638
32350
  return theme2.colors[3 + slot] ?? "4472C4";
30639
32351
  }
30640
- var escapeAttr = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
32352
+ var escapeAttr2 = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
30641
32353
  function tableStylePreview(info, theme2) {
30642
- const c = `#${escapeAttr(tableStyleColor(info, theme2))}`;
32354
+ const c = `#${escapeAttr2(tableStyleColor(info, theme2))}`;
30643
32355
  const dark = info.family === "Dark";
30644
32356
  const header = info.family === "Light" ? "#ffffff" : c;
30645
32357
  const band = dark ? c : info.family === "Medium" ? `${c}55` : `${c}33`;
@@ -32312,13 +34024,13 @@ function searchCommands(ctx, query, isHidden) {
32312
34024
  const seen = /* @__PURE__ */ new Set();
32313
34025
  for (const command of ctx.commands.list()) {
32314
34026
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
32315
- const label2 = ctx.t(command.label).toLocaleLowerCase();
34027
+ const label3 = ctx.t(command.label).toLocaleLowerCase();
32316
34028
  const english = command.label.toLocaleLowerCase();
32317
- const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
34029
+ const haystack = `${label3} ${english} ${command.id.replace(/[.-]/g, " ")}`;
32318
34030
  if (!words2.every((word) => haystack.includes(word))) continue;
32319
- if (seen.has(label2)) continue;
32320
- seen.add(label2);
32321
- 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;
32322
34034
  scored.push({ command, score });
32323
34035
  }
32324
34036
  return scored.sort(
@@ -32580,6 +34292,7 @@ exports.noteFunctionUse = noteFunctionUse;
32580
34292
  exports.numberCommands = numberCommands;
32581
34293
  exports.numberFormatOptions = numberFormatOptions;
32582
34294
  exports.onRibbonTabsChange = onRibbonTabsChange;
34295
+ exports.pageBreakCommands = pageBreakCommands;
32583
34296
  exports.pageLayoutCommands = pageLayoutCommands;
32584
34297
  exports.parseBorderArg = parseBorderArg;
32585
34298
  exports.parseSelectionRef = parseSelectionRef;