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
@@ -27,19 +27,19 @@ var isCellError = (value2) => typeof value2 === "object" && value2 !== null && "
27
27
  var MAX_ROW = 1048575;
28
28
  var MAX_COL = 16383;
29
29
  function columnLabel(col) {
30
- let label2 = "";
30
+ let label3 = "";
31
31
  let n = col + 1;
32
32
  while (n > 0) {
33
33
  const rem = (n - 1) % 26;
34
- label2 = String.fromCharCode(65 + rem) + label2;
34
+ label3 = String.fromCharCode(65 + rem) + label3;
35
35
  n = Math.floor((n - 1) / 26);
36
36
  }
37
- return label2;
37
+ return label3;
38
38
  }
39
- function columnIndex(label2) {
40
- if (!/^[A-Za-z]{1,3}$/.test(label2)) return -1;
39
+ function columnIndex(label3) {
40
+ if (!/^[A-Za-z]{1,3}$/.test(label3)) return -1;
41
41
  let n = 0;
42
- for (const ch of label2.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
42
+ for (const ch of label3.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
43
43
  return n - 1;
44
44
  }
45
45
  var formatAddress = (address2) => `${columnLabel(address2.col)}${address2.row + 1}`;
@@ -351,23 +351,23 @@ function compact(value2) {
351
351
  for (const [key, entry] of Object.entries(value2)) if (entry !== void 0) out[key] = entry;
352
352
  return out;
353
353
  }
354
- function patchStyle(base, patch) {
354
+ function patchStyle(base, patch2) {
355
355
  const next = {
356
- font: patch.font ? compact({ ...base.font, ...patch.font }) : base.font,
357
- fill: patch.fill ?? base.fill,
358
- border: patch.border ? compact({ ...base.border, ...patch.border }) : base.border,
359
- numFmt: patch.numFmt ?? base.numFmt
356
+ font: patch2.font ? compact({ ...base.font, ...patch2.font }) : base.font,
357
+ fill: patch2.fill ?? base.fill,
358
+ border: patch2.border ? compact({ ...base.border, ...patch2.border }) : base.border,
359
+ numFmt: patch2.numFmt ?? base.numFmt
360
360
  };
361
- const alignment = patch.alignment ? compact({ ...base.alignment, ...patch.alignment }) : base.alignment;
361
+ const alignment = patch2.alignment ? compact({ ...base.alignment, ...patch2.alignment }) : base.alignment;
362
362
  if (alignment && Object.keys(alignment).length) next.alignment = alignment;
363
- const protection = patch.protection ? compact({ ...base.protection, ...patch.protection }) : base.protection;
363
+ const protection = patch2.protection ? compact({ ...base.protection, ...patch2.protection }) : base.protection;
364
364
  if (protection && Object.keys(protection).length) next.protection = protection;
365
- const styleName = "cellStyleName" in patch ? patch.cellStyleName : base.cellStyleName;
365
+ const styleName = "cellStyleName" in patch2 ? patch2.cellStyleName : base.cellStyleName;
366
366
  if (styleName) next.cellStyleName = styleName;
367
367
  return next;
368
368
  }
369
- function applyStylePatch(workbook, styleId, patch) {
370
- return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch));
369
+ function applyStylePatch(workbook, styleId, patch2) {
370
+ return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch2));
371
371
  }
372
372
 
373
373
  // xlsx/cell-styles.ts
@@ -853,7 +853,7 @@ function compileFraction(tokens, slash) {
853
853
  while (isDigit(tokens[denEnd]) || tokens[denEnd]?.t === "num") denEnd++;
854
854
  const denTokens = tokens.slice(slash + 1, denEnd);
855
855
  const fixed2 = denTokens.some((t) => t.t === "num") && denTokens.every((t) => t.t === "num" || isDigit(t) && t.c === "0");
856
- const plan = {
856
+ const plan2 = {
857
857
  tokens: [],
858
858
  intDigits: [],
859
859
  numDigits: [],
@@ -861,31 +861,31 @@ function compileFraction(tokens, slash) {
861
861
  denWidth: denTokens.length
862
862
  };
863
863
  if (fixed2) {
864
- plan.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
864
+ plan2.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
865
865
  }
866
866
  tokens.forEach((tok, i2) => {
867
- if (i2 === slash) plan.tokens.push({ r: "slash" });
867
+ if (i2 === slash) plan2.tokens.push({ r: "slash" });
868
868
  else if (i2 > slash && i2 < denEnd) {
869
869
  if (fixed2) {
870
- if (i2 === slash + 1) plan.tokens.push({ r: "den", index: 0 });
870
+ if (i2 === slash + 1) plan2.tokens.push({ r: "den", index: 0 });
871
871
  } else if (isDigit(tok)) {
872
- plan.tokens.push({ r: "den", index: plan.denDigits.length });
873
- plan.denDigits.push(tok.c);
872
+ plan2.tokens.push({ r: "den", index: plan2.denDigits.length });
873
+ plan2.denDigits.push(tok.c);
874
874
  }
875
875
  } else if (isDigit(tok) && i2 >= numStart && i2 < slash) {
876
- plan.tokens.push({ r: "num", index: plan.numDigits.length });
877
- plan.numDigits.push(tok.c);
876
+ plan2.tokens.push({ r: "num", index: plan2.numDigits.length });
877
+ plan2.numDigits.push(tok.c);
878
878
  } else if (isDigit(tok) && i2 < numStart) {
879
- plan.tokens.push({ r: "int", index: plan.intDigits.length });
880
- plan.intDigits.push(tok.c);
881
- } else if (tok.t === "lit") plan.tokens.push({ r: "lit", v: tok.v });
882
- else if (tok.t === "num") plan.tokens.push({ r: "lit", v: tok.v });
883
- else if (tok.t === "digit") plan.tokens.push({ r: "lit", v: tok.c });
884
- else if (tok.t === "point") plan.tokens.push({ r: "lit", v: "." });
885
- else if (tok.t === "slash") plan.tokens.push({ r: "lit", v: "/" });
886
- else if (tok.t === "percent") plan.tokens.push({ r: "lit", v: "%" });
879
+ plan2.tokens.push({ r: "int", index: plan2.intDigits.length });
880
+ plan2.intDigits.push(tok.c);
881
+ } else if (tok.t === "lit") plan2.tokens.push({ r: "lit", v: tok.v });
882
+ else if (tok.t === "num") plan2.tokens.push({ r: "lit", v: tok.v });
883
+ else if (tok.t === "digit") plan2.tokens.push({ r: "lit", v: tok.c });
884
+ else if (tok.t === "point") plan2.tokens.push({ r: "lit", v: "." });
885
+ else if (tok.t === "slash") plan2.tokens.push({ r: "lit", v: "/" });
886
+ else if (tok.t === "percent") plan2.tokens.push({ r: "lit", v: "%" });
887
887
  });
888
- return plan;
888
+ return plan2;
889
889
  }
890
890
  function approximate(x, maxDen) {
891
891
  if (Number.isInteger(x)) return [x, 1];
@@ -920,29 +920,29 @@ function padRight(s, slots) {
920
920
  for (let i2 = s.length; i2 < slots.length; i2++) suffix += pad(slots[i2] ?? "#");
921
921
  return s + suffix;
922
922
  }
923
- function renderFraction(value2, plan) {
923
+ function renderFraction(value2, plan2) {
924
924
  const x = Math.abs(value2);
925
- const hasInt = plan.intDigits.length > 0;
925
+ const hasInt = plan2.intDigits.length > 0;
926
926
  let ip = hasInt ? Math.floor(x) : 0;
927
927
  const f6 = x - ip;
928
- const maxDen = 10 ** Math.max(1, plan.denDigits.length) - 1;
929
- let [n, d] = plan.fixedDenominator ? [Math.round(f6 * plan.fixedDenominator), plan.fixedDenominator] : approximate(f6, maxDen);
928
+ const maxDen = 10 ** Math.max(1, plan2.denDigits.length) - 1;
929
+ let [n, d] = plan2.fixedDenominator ? [Math.round(f6 * plan2.fixedDenominator), plan2.fixedDenominator] : approximate(f6, maxDen);
930
930
  if (hasInt && n >= d) {
931
931
  ip += 1;
932
932
  n = 0;
933
933
  }
934
934
  const zero = !hasInt && n === 0;
935
935
  const blank = hasInt && n === 0;
936
- const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan.intDigits) : "";
936
+ const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan2.intDigits) : "";
937
937
  const allHash = (slots) => slots.every((c) => c === "#");
938
- const numHash = allHash(plan.numDigits);
939
- const hideFraction = blank && numHash && (plan.fixedDenominator !== void 0 || allHash(plan.denDigits));
938
+ const numHash = allHash(plan2.numDigits);
939
+ const hideFraction = blank && numHash && (plan2.fixedDenominator !== void 0 || allHash(plan2.denDigits));
940
940
  const dropSeparator = hideFraction || hasInt && intText === "" && numHash;
941
- const lastInt = plan.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
942
- const firstNum = plan.tokens.findIndex((t) => t.r === "num");
941
+ const lastInt = plan2.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
942
+ const firstNum = plan2.tokens.findIndex((t) => t.r === "num");
943
943
  let text2 = "";
944
944
  let intDone = false;
945
- plan.tokens.forEach((tok, i2) => {
945
+ plan2.tokens.forEach((tok, i2) => {
946
946
  if (tok.r === "lit") {
947
947
  if (!(dropSeparator && i2 > lastInt && i2 < firstNum)) text2 += tok.v;
948
948
  } else if (tok.r === "int") {
@@ -951,12 +951,12 @@ function renderFraction(value2, plan) {
951
951
  } else if (hideFraction) ; else if (blank) {
952
952
  if (tok.r === "num") text2 += " ";
953
953
  else if (tok.r === "slash") text2 += " ";
954
- else text2 += " ".repeat(plan.fixedDenominator ? plan.denWidth : 1);
954
+ else text2 += " ".repeat(plan2.fixedDenominator ? plan2.denWidth : 1);
955
955
  } else if (tok.r === "num") {
956
- if (tok.index === 0) text2 += padLeft(String(n), plan.numDigits);
956
+ if (tok.index === 0) text2 += padLeft(String(n), plan2.numDigits);
957
957
  } else if (tok.r === "slash") text2 += "/";
958
- else if (plan.fixedDenominator) text2 += String(d);
959
- else if (tok.index === 0) text2 += padRight(String(d), plan.denDigits);
958
+ else if (plan2.fixedDenominator) text2 += String(d);
959
+ else if (tok.index === 0) text2 += padRight(String(d), plan2.denDigits);
960
960
  });
961
961
  return { text: text2, zero };
962
962
  }
@@ -1097,15 +1097,15 @@ function compileNumber(tokens) {
1097
1097
  out.splice(at < 0 ? 0 : at, 0, { r: "int", c: "#", index: 0 });
1098
1098
  intDigits.push("#");
1099
1099
  }
1100
- const plan = {
1100
+ const plan2 = {
1101
1101
  tokens: out,
1102
1102
  intDigits,
1103
1103
  fracDigits,
1104
1104
  grouping,
1105
1105
  shift: 2 * percent - 3 * scaleCommas
1106
1106
  };
1107
- if (exponent) plan.exponent = exponent;
1108
- return plan;
1107
+ if (exponent) plan2.exponent = exponent;
1108
+ return plan2;
1109
1109
  }
1110
1110
  var pad2 = (c) => c === "0" ? "0" : c === "?" ? " " : "";
1111
1111
  function placeIntegers(digits2, slots, grouping) {
@@ -1138,40 +1138,40 @@ function placeFraction(digits2, slots) {
1138
1138
  }
1139
1139
  return out;
1140
1140
  }
1141
- function scientific(v, plan) {
1141
+ function scientific(v, plan2) {
1142
1142
  if (isZero(v)) return { value: v, exp: 0 };
1143
- const n = plan.intDigits.length;
1144
- const engineering = n > 1 && plan.intDigits.some((c) => c !== "0");
1143
+ const n = plan2.intDigits.length;
1144
+ const engineering = n > 1 && plan2.intDigits.some((c) => c !== "0");
1145
1145
  const period = engineering ? n : 1;
1146
1146
  const e = v.point - 1;
1147
1147
  let exp2 = Math.floor(e / period) * period;
1148
- let m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1148
+ let m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1149
1149
  if (m.point > period) {
1150
1150
  exp2 += period;
1151
- m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1151
+ m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1152
1152
  }
1153
1153
  return { value: m, exp: exp2 };
1154
1154
  }
1155
- function renderNumber(value2, plan) {
1156
- const v = shift(toDigits(value2), plan.shift);
1155
+ function renderNumber(value2, plan2) {
1156
+ const v = shift(toDigits(value2), plan2.shift);
1157
1157
  let rounded;
1158
1158
  let exp2 = 0;
1159
- if (plan.exponent) {
1160
- const m = scientific(v, plan);
1159
+ if (plan2.exponent) {
1160
+ const m = scientific(v, plan2);
1161
1161
  rounded = m.value;
1162
1162
  exp2 = m.exp;
1163
- } else rounded = roundDecimals(v, plan.fracDigits.length);
1164
- const ints = plan.exponent && isZero(rounded) ? plan.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan.intDigits, plan.grouping);
1165
- const fracs = placeFraction(fractionPart(rounded, plan.fracDigits.length), plan.fracDigits);
1163
+ } else rounded = roundDecimals(v, plan2.fracDigits.length);
1164
+ const ints = plan2.exponent && isZero(rounded) ? plan2.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan2.intDigits, plan2.grouping);
1165
+ const fracs = placeFraction(fractionPart(rounded, plan2.fracDigits.length), plan2.fracDigits);
1166
1166
  let text2 = "";
1167
- for (const tok of plan.tokens) {
1167
+ for (const tok of plan2.tokens) {
1168
1168
  if (tok.r === "lit") text2 += tok.v;
1169
1169
  else if (tok.r === "int") text2 += ints[tok.index] ?? "";
1170
1170
  else if (tok.r === "frac") text2 += fracs[tok.index] ?? "";
1171
1171
  else if (tok.r === "point") text2 += ".";
1172
- else if (plan.exponent) {
1173
- const sign2 = exp2 < 0 ? "-" : plan.exponent.plus ? "+" : "";
1174
- text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan.exponent.digits, "0")}`;
1172
+ else if (plan2.exponent) {
1173
+ const sign2 = exp2 < 0 ? "-" : plan2.exponent.plus ? "+" : "";
1174
+ text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan2.exponent.digits, "0")}`;
1175
1175
  }
1176
1176
  }
1177
1177
  return { text: text2, zero: isZero(rounded) };
@@ -1864,9 +1864,9 @@ function parseFractionInput(text2) {
1864
1864
  const m = /^([-+]?)(\d+)\s+(\d+)\/(\d+)$/.exec(text2.trim());
1865
1865
  if (!m) return void 0;
1866
1866
  const den = Number(m[4]);
1867
- const num2 = Number(m[3]);
1868
- if (den === 0 || num2 >= den) return void 0;
1869
- const magnitude = Number(m[2]) + num2 / den;
1867
+ const num3 = Number(m[3]);
1868
+ if (den === 0 || num3 >= den) return void 0;
1869
+ const magnitude = Number(m[2]) + num3 / den;
1870
1870
  return {
1871
1871
  value: m[1] === "-" ? -magnitude : magnitude,
1872
1872
  numFmt: den < 10 ? "# ?/?" : "# ??/??"
@@ -11159,13 +11159,27 @@ var TEXT_REGEX_FUNCTIONS = [
11159
11159
  "REGEXEXTRACT",
11160
11160
  C35,
11161
11161
  "REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])",
11162
- "The first part of the text that matches the pattern.",
11162
+ "Extracts the first match (0), all matches (1), or the first match\u2019s capture groups (2).",
11163
11163
  2,
11164
11164
  4,
11165
11165
  (args) => {
11166
- if (optNum(args, 2, 0) !== 0) fail(ERR.VALUE);
11167
- const match2 = compile(str(args[1]), caseMode(args, 3), false).exec(str(args[0]));
11168
- return match2 ? match2[0] : fail(ERR.NA);
11166
+ const mode = optNum(args, 2, 0);
11167
+ if (mode !== 0 && mode !== 1 && mode !== 2) fail(ERR.VALUE);
11168
+ const regex = compile(str(args[1]), caseMode(args, 3), mode === 1);
11169
+ const text2 = str(args[0]);
11170
+ if (mode === 1) {
11171
+ const matches2 = [];
11172
+ for (const match3 of text2.matchAll(regex)) {
11173
+ checkArraySize(matches2.length + 1, 1);
11174
+ matches2.push(match3[0]);
11175
+ }
11176
+ return matches2.length ? new Matrix(matches2.map((match3) => [match3])) : fail(ERR.NA);
11177
+ }
11178
+ const match2 = regex.exec(text2);
11179
+ if (!match2) fail(ERR.NA);
11180
+ if (mode === 0) return match2[0];
11181
+ if (match2.length === 1) fail(ERR.VALUE);
11182
+ return new Matrix([match2.slice(1).map((group) => group ?? "")]);
11169
11183
  }
11170
11184
  ),
11171
11185
  spec(
@@ -11842,7 +11856,7 @@ function makeTemplate(formula, shape2) {
11842
11856
  }
11843
11857
  const { starts } = shape2;
11844
11858
  const slotted = starts.map(() => false);
11845
- const refs = /* @__PURE__ */ new Map();
11859
+ const refs2 = /* @__PURE__ */ new Map();
11846
11860
  let run = 0;
11847
11861
  for (const token of tokens) {
11848
11862
  const end = token.start + token.text.length;
@@ -11856,9 +11870,9 @@ function makeTemplate(formula, shape2) {
11856
11870
  const indexes2 = count2 === 1 ? [at] : [at, at + 1];
11857
11871
  if (indexes2.some((i2) => formula.charCodeAt(starts[i2]) === 48)) continue;
11858
11872
  for (const i2 of indexes2) slotted[i2] = true;
11859
- refs.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11873
+ refs2.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11860
11874
  }
11861
- return { formula, shape: shape2, ast, slotted, refs };
11875
+ return { formula, shape: shape2, ast, slotted, refs: refs2 };
11862
11876
  }
11863
11877
  function rowsFor(t, formula, shape2) {
11864
11878
  if (!sameShape(t.formula, t.shape, formula, shape2)) return void 0;
@@ -11882,11 +11896,11 @@ function rowsFor(t, formula, shape2) {
11882
11896
  return rows2;
11883
11897
  }
11884
11898
  function shiftSpec(spec2, slots, rows2) {
11885
- const startRow = rows2[slots.start];
11886
- const endRow = slots.end === void 0 ? startRow : rows2[slots.end];
11887
- if (startRow === spec2.start.row && endRow === spec2.end.row) return spec2;
11899
+ const startRow2 = rows2[slots.start];
11900
+ const endRow = slots.end === void 0 ? startRow2 : rows2[slots.end];
11901
+ if (startRow2 === spec2.start.row && endRow === spec2.end.row) return spec2;
11888
11902
  const { start: from, end: to } = spec2;
11889
- const start = { row: startRow, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11903
+ const start = { row: startRow2, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11890
11904
  if (slots.end === void 0) return { kind: spec2.kind, start, end: start };
11891
11905
  const end = { row: endRow, col: to.col, rowAbs: to.rowAbs, colAbs: to.colAbs };
11892
11906
  return { kind: spec2.kind, start, end };
@@ -13619,12 +13633,14 @@ function structuredToA1(formula, target2) {
13619
13633
 
13620
13634
  // xml/namespaces.ts
13621
13635
  var NS = {
13636
+ /** SpreadsheetML main. */
13637
+ x: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
13622
13638
  /** SpreadsheetML 2009 extensions (`x14:conditionalFormatting`, `x14:dataBar`). */
13623
13639
  x14: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"};
13624
13640
  function parseXml(xml, options = {}) {
13625
- const label2 = options.label ?? "OOXML";
13641
+ const label3 = options.label ?? "OOXML";
13626
13642
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
13627
- throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
13643
+ throw new Error(`${label3} XML with DTD or entity declarations is not supported`);
13628
13644
  let parseError = "";
13629
13645
  let parsed;
13630
13646
  try {
@@ -13635,12 +13651,12 @@ function parseXml(xml, options = {}) {
13635
13651
  }).parseFromString(xml, "application/xml");
13636
13652
  } catch (error) {
13637
13653
  throw new Error(
13638
- `Invalid ${label2} XML: ${error instanceof Error ? error.message : String(error)}`,
13654
+ `Invalid ${label3} XML: ${error instanceof Error ? error.message : String(error)}`,
13639
13655
  { cause: error }
13640
13656
  );
13641
13657
  }
13642
13658
  if (parseError || !parsed.documentElement)
13643
- throw new Error(`Invalid ${label2} XML: ${parseError || "missing root element"}`);
13659
+ throw new Error(`Invalid ${label3} XML: ${parseError || "missing root element"}`);
13644
13660
  return parsed;
13645
13661
  }
13646
13662
  var buildXml = (node) => new XMLSerializer().serializeToString(node);
@@ -13716,6 +13732,315 @@ function descendants(root, local, ns) {
13716
13732
  return Array.from(root.getElementsByTagNameNS(ns, local));
13717
13733
  }
13718
13734
 
13735
+ // xlsx/edit/sparkline-ranges.ts
13736
+ function checkedSparklineRange(raw) {
13737
+ const range2 = normalizeRange(raw);
13738
+ for (const point of [range2.start, range2.end])
13739
+ if (!Number.isInteger(point.row) || !Number.isInteger(point.col) || point.row < 0 || point.col < 0 || point.row > MAX_ROW || point.col > MAX_COL)
13740
+ throw new RangeError("The reference is not valid.");
13741
+ return range2;
13742
+ }
13743
+ function sparklineDataRange(workbook, sheet, source) {
13744
+ let ast;
13745
+ try {
13746
+ ast = parseFormula(source.trim().replace(/^=/, ""));
13747
+ } catch {
13748
+ throw new Error("The reference is not valid.");
13749
+ }
13750
+ if (ast.type !== "ref" || !ast.ref || !["cell", "area"].includes(ast.ref.kind) || ast.prefix?.book || ast.prefix?.sheet2 || ast.spill)
13751
+ throw new Error("The reference is not valid.");
13752
+ const index2 = ast.prefix ? workbook.sheets.findIndex((ws) => ws.name.toLowerCase() === ast.prefix.sheet.toLowerCase()) : sheet;
13753
+ if (!workbook.sheets[index2]) throw new Error("The reference is not valid.");
13754
+ return { sheet: index2, range: checkedSparklineRange({ start: ast.ref.start, end: ast.ref.end }) };
13755
+ }
13756
+ function newSparklines(workbook, sheet, source, locations) {
13757
+ const data = sparklineDataRange(workbook, sheet, source);
13758
+ const dest = checkedSparklineRange(locations);
13759
+ const rows2 = dest.end.row - dest.start.row + 1;
13760
+ const cols = dest.end.col - dest.start.col + 1;
13761
+ const dr = data.range.end.row - data.range.start.row + 1;
13762
+ const dc = data.range.end.col - data.range.start.col + 1;
13763
+ if (rows2 > 1 && cols > 1 || rows2 === 1 && cols === 1 && dr > 1 && dc > 1 || rows2 > 1 && rows2 !== dr || cols > 1 && cols !== dc)
13764
+ throw new Error("The data range and location range do not match.");
13765
+ if (Math.max(rows2, cols) > 1e5) throw new Error("The sparkline location range is too large.");
13766
+ const prefix = `'${workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!`;
13767
+ const out = [];
13768
+ for (let i2 = 0; i2 < Math.max(rows2, cols); i2++) {
13769
+ const range2 = structuredClone(data.range);
13770
+ if (rows2 > 1) range2.start.row = range2.end.row = data.range.start.row + i2;
13771
+ if (cols > 1) range2.start.col = range2.end.col = data.range.start.col + i2;
13772
+ const host = {
13773
+ row: dest.start.row + (rows2 > 1 ? i2 : 0),
13774
+ col: dest.start.col + (cols > 1 ? i2 : 0)
13775
+ };
13776
+ out.push({ formula: prefix + formatRange(range2), host: { start: host, end: { ...host } } });
13777
+ }
13778
+ return out;
13779
+ }
13780
+
13781
+ // xlsx/pivot/data.ts
13782
+ var PIVOT_AGGREGATES = ["sum", "count", "average", "min", "max"];
13783
+ function pivotSourceData(workbook, sheet, source) {
13784
+ const data = sparklineDataRange(workbook, sheet, source);
13785
+ const ws = workbook.sheets[data.sheet];
13786
+ const { start, end } = data.range;
13787
+ if (end.row <= start.row || (end.row - start.row + 1) * (end.col - start.col + 1) > 1e6)
13788
+ throw new Error("A PivotTable source needs headers and data, with at most one million cells.");
13789
+ const fields = [];
13790
+ for (let col = start.col; col <= end.col; col++) {
13791
+ const value2 = getCell(ws, start.row, col)?.value;
13792
+ if (value2 === void 0 || value2 === null || isCellError(value2) || !String(value2).trim())
13793
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13794
+ fields.push(String(value2));
13795
+ }
13796
+ if (new Set(fields.map((name) => name.toLowerCase())).size !== fields.length)
13797
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13798
+ const records = [];
13799
+ for (let row2 = start.row + 1; row2 <= end.row; row2++) {
13800
+ const record = [];
13801
+ for (let col = start.col; col <= end.col; col++)
13802
+ record.push(getCell(ws, row2, col)?.value ?? null);
13803
+ records.push(record);
13804
+ }
13805
+ return { source: `${quoteSheetName(ws.name)}!${formatRange(data.range)}`, fields, records };
13806
+ }
13807
+ function pivotValueKey(value2) {
13808
+ return value2 === null || value2 === "" ? "blank" : isCellError(value2) ? `error:${value2.error}` : `${typeof value2}:${String(value2).toLowerCase()}`;
13809
+ }
13810
+ function pivotItems(pivot, field) {
13811
+ const index2 = pivot.fields.indexOf(field);
13812
+ const items = /* @__PURE__ */ new Map();
13813
+ for (const record of pivot.records) {
13814
+ const value2 = record[index2] ?? null;
13815
+ const key = pivotValueKey(value2);
13816
+ if (!items.has(key)) items.set(key, value2);
13817
+ }
13818
+ const rank3 = (value2) => value2 === null || value2 === "" ? 4 : isCellError(value2) ? 3 : typeof value2 === "boolean" ? 2 : typeof value2 === "string" ? 1 : 0;
13819
+ return [...items.values()].sort(
13820
+ (a, b) => rank3(a) - rank3(b) || (typeof a === "number" && typeof b === "number" ? a - b : String(pivotItemLabel(a)).localeCompare(String(pivotItemLabel(b)), "en", {
13821
+ sensitivity: "base",
13822
+ numeric: true
13823
+ }))
13824
+ );
13825
+ }
13826
+ function pivotItemLabel(value2) {
13827
+ if (value2 === null || value2 === "") return "(blank)";
13828
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
13829
+ return isCellError(value2) ? value2.error : value2;
13830
+ }
13831
+ function validatePivotFields(pivot) {
13832
+ const used = [
13833
+ pivot.rowField,
13834
+ ...pivot.secondRowField ? [pivot.secondRowField] : [],
13835
+ ...pivot.columnField ? [pivot.columnField] : [],
13836
+ pivot.valueField
13837
+ ];
13838
+ 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")
13839
+ throw new Error("Choose valid PivotTable fields; row and column fields must differ.");
13840
+ }
13841
+ function pivotCaption(aggregate3, field) {
13842
+ return `${aggregate3[0].toUpperCase()}${aggregate3.slice(1)} of ${field}`;
13843
+ }
13844
+
13845
+ // xlsx/pivot/hierarchy.ts
13846
+ var label2 = pivotItemLabel;
13847
+ function hierarchicalPivotGrid(pivot, aggregate3) {
13848
+ const rowItems = pivotItems(pivot, pivot.rowField);
13849
+ const secondRowItems = pivotItems(pivot, pivot.secondRowField);
13850
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13851
+ const outerField = pivot.fields.indexOf(pivot.rowField);
13852
+ const innerField = pivot.fields.indexOf(pivot.secondRowField);
13853
+ const columnField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13854
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13855
+ const layout2 = pivot.layout ?? "tabular";
13856
+ const compact3 = layout2 === "compact";
13857
+ const top = layout2 !== "tabular" && pivot.subtotals !== false && (pivot.subtotalPosition ?? "top") === "top";
13858
+ const bottom = pivot.subtotals !== false && !top;
13859
+ const rowLabelColumns = compact3 ? 1 : 2;
13860
+ const groups = /* @__PURE__ */ new Map();
13861
+ const details = /* @__PURE__ */ new Map();
13862
+ const children2 = /* @__PURE__ */ new Map();
13863
+ const innerIndices = new Map(secondRowItems.map((item, index2) => [pivotValueKey(item), index2]));
13864
+ const buckets = /* @__PURE__ */ new Map();
13865
+ const collect = (map, key, record) => {
13866
+ const list = map.get(key);
13867
+ if (list) list.push(record);
13868
+ else map.set(key, [record]);
13869
+ };
13870
+ for (const record of pivot.records) {
13871
+ const outer = pivotValueKey(record[outerField] ?? null);
13872
+ const inner2 = pivotValueKey(record[innerField] ?? null);
13873
+ collect(groups, outer, record);
13874
+ collect(details, JSON.stringify([outer, inner2]), record);
13875
+ if (!children2.has(outer)) children2.set(outer, /* @__PURE__ */ new Set());
13876
+ children2.get(outer).add(inner2);
13877
+ if (pivot.columnField) {
13878
+ const column = pivotValueKey(record[columnField] ?? null);
13879
+ for (const key of [[], [outer], [outer, inner2]])
13880
+ collect(buckets, JSON.stringify([...key, column]), record);
13881
+ }
13882
+ }
13883
+ const rows2 = details.size + rowItems.length * (Number(layout2 !== "tabular") + Number(bottom)) + 3;
13884
+ if (rows2 * (columnItems.length + 3) > 1e6)
13885
+ throw new Error("The PivotTable result is too large.");
13886
+ const labels = compact3 ? ["Row Labels"] : [pivot.rowField, pivot.secondRowField];
13887
+ const values2 = pivot.columnField ? [
13888
+ [
13889
+ pivot.valueCaption,
13890
+ ...compact3 ? [] : [null],
13891
+ compact3 ? "Column Labels" : pivot.columnField,
13892
+ ...columnItems.slice(1).map(() => null),
13893
+ null
13894
+ ],
13895
+ [...labels, ...columnItems.map(label2), "Grand Total"]
13896
+ ] : [[...labels, pivot.valueCaption]];
13897
+ const indents = values2.map(() => 0);
13898
+ const rowEntries = [];
13899
+ const append = (labels2, numbers4, entry, indent = 0) => {
13900
+ values2.push([...labels2, ...numbers4]);
13901
+ rowEntries.push(entry);
13902
+ indents.push(indent);
13903
+ };
13904
+ const numbers3 = (keys, records) => [
13905
+ ...columnItems.map(
13906
+ (column) => aggregate3(
13907
+ buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [],
13908
+ valueField,
13909
+ pivot.aggregate
13910
+ )
13911
+ ),
13912
+ aggregate3(records, valueField, pivot.aggregate)
13913
+ ];
13914
+ rowItems.forEach((outer, outerIndex) => {
13915
+ const key = pivotValueKey(outer);
13916
+ if (layout2 !== "tabular")
13917
+ append(
13918
+ [label2(outer), ...compact3 ? [] : [null]],
13919
+ top ? numbers3([key], groups.get(key) ?? []) : Array(columnItems.length + 1).fill(null),
13920
+ { indices: [outerIndex] }
13921
+ );
13922
+ let first2 = true;
13923
+ [...children2.get(key)].sort((a, b) => innerIndices.get(a) - innerIndices.get(b)).forEach((innerKey) => {
13924
+ const innerIndex = innerIndices.get(innerKey);
13925
+ const inner2 = secondRowItems[innerIndex];
13926
+ const keys = [key, innerKey];
13927
+ const records = details.get(JSON.stringify(keys));
13928
+ if (!records) return;
13929
+ append(
13930
+ compact3 ? [label2(inner2)] : [
13931
+ pivot.repeatLabels || layout2 === "tabular" && first2 ? label2(outer) : null,
13932
+ label2(inner2)
13933
+ ],
13934
+ numbers3(keys, records),
13935
+ { indices: [outerIndex, innerIndex] },
13936
+ compact3 ? 1 : 0
13937
+ );
13938
+ first2 = false;
13939
+ });
13940
+ if (bottom) {
13941
+ const caption = String(label2(outer));
13942
+ append(
13943
+ [`${caption} Total`, ...compact3 ? [] : [null]],
13944
+ numbers3([key], groups.get(key) ?? []),
13945
+ { indices: [outerIndex], type: "default" }
13946
+ );
13947
+ }
13948
+ });
13949
+ append(["Grand Total", ...compact3 ? [] : [null]], numbers3([], pivot.records), {
13950
+ indices: [0],
13951
+ type: "grand"
13952
+ });
13953
+ return {
13954
+ values: values2,
13955
+ rowItems,
13956
+ secondRowItems,
13957
+ columnItems,
13958
+ rowEntries,
13959
+ firstDataRow: pivot.columnField ? 2 : 1,
13960
+ rowLabelColumns,
13961
+ indents
13962
+ };
13963
+ }
13964
+
13965
+ // xlsx/pivot/aggregate.ts
13966
+ function aggregate2(records, field, type) {
13967
+ if (!records.length) return null;
13968
+ const values2 = records.map((record) => record[field] ?? null);
13969
+ if (type === "count") return values2.filter((value2) => value2 !== null && value2 !== "").length;
13970
+ const error = values2.find(isCellError);
13971
+ if (error) return error;
13972
+ const numbers3 = values2.filter((value2) => typeof value2 === "number");
13973
+ if (!numbers3.length) return type === "average" ? { error: "#DIV/0!" } : 0;
13974
+ if (type === "min") return numbers3.reduce((a, b) => Math.min(a, b));
13975
+ if (type === "max") return numbers3.reduce((a, b) => Math.max(a, b));
13976
+ const sum2 = numbers3.reduce((total2, value2) => total2 + value2, 0);
13977
+ return type === "average" ? sum2 / numbers3.length : sum2;
13978
+ }
13979
+ function pivotGrid(pivot) {
13980
+ validatePivotFields(pivot);
13981
+ if (pivot.secondRowField) return hierarchicalPivotGrid(pivot, aggregate2);
13982
+ const rowItems = pivotItems(pivot, pivot.rowField);
13983
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13984
+ if ((rowItems.length + 3) * (columnItems.length + 2) > 1e6)
13985
+ throw new Error("The PivotTable result is too large.");
13986
+ const rowField = pivot.fields.indexOf(pivot.rowField);
13987
+ const colField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13988
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13989
+ const groups = /* @__PURE__ */ new Map();
13990
+ const cells = /* @__PURE__ */ new Map();
13991
+ const columns = /* @__PURE__ */ new Map();
13992
+ const collect = (map, key, record) => {
13993
+ const found = map.get(key);
13994
+ if (found) found.push(record);
13995
+ else map.set(key, [record]);
13996
+ };
13997
+ for (const record of pivot.records) {
13998
+ const key = pivotValueKey(record[rowField] ?? null);
13999
+ collect(groups, key, record);
14000
+ if (pivot.columnField) {
14001
+ const col = pivotValueKey(record[colField] ?? null);
14002
+ collect(columns, col, record);
14003
+ collect(cells, JSON.stringify([key, col]), record);
14004
+ }
14005
+ }
14006
+ const label3 = pivotItemLabel;
14007
+ const values2 = pivot.columnField ? [
14008
+ [
14009
+ pivot.valueCaption,
14010
+ pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
14011
+ ...columnItems.slice(1).map(() => null),
14012
+ null
14013
+ ],
14014
+ [
14015
+ pivot.layout === "compact" ? "Row Labels" : pivot.rowField,
14016
+ ...columnItems.map(label3),
14017
+ "Grand Total"
14018
+ ]
14019
+ ] : [[pivot.layout === "compact" ? "Row Labels" : pivot.rowField, pivot.valueCaption]];
14020
+ for (const row2 of rowItems) {
14021
+ const records = groups.get(pivotValueKey(row2)) ?? [];
14022
+ values2.push([
14023
+ label3(row2),
14024
+ ...columnItems.map(
14025
+ (col) => aggregate2(
14026
+ cells.get(JSON.stringify([pivotValueKey(row2), pivotValueKey(col)])) ?? [],
14027
+ valueField,
14028
+ pivot.aggregate
14029
+ )
14030
+ ),
14031
+ aggregate2(records, valueField, pivot.aggregate)
14032
+ ]);
14033
+ }
14034
+ values2.push([
14035
+ "Grand Total",
14036
+ ...columnItems.map(
14037
+ (col) => aggregate2(columns.get(pivotValueKey(col)) ?? [], valueField, pivot.aggregate)
14038
+ ),
14039
+ aggregate2(pivot.records, valueField, pivot.aggregate)
14040
+ ]);
14041
+ return { values: values2, rowItems, columnItems, firstDataRow: pivot.columnField ? 2 : 1 };
14042
+ }
14043
+
13719
14044
  // xlsx/read/style-parts.ts
13720
14045
  function parseColor(element2, palette) {
13721
14046
  if (!element2) return void 0;
@@ -13749,6 +14074,23 @@ function parseSqref(sqref) {
13749
14074
  return sqref.split(/\s+/).filter(Boolean).map((part) => parseRange(part)).filter((range2) => range2 !== void 0);
13750
14075
  }
13751
14076
 
14077
+ // xlsx/write/xml-out.ts
14078
+ var CONTROL2 = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
14079
+ var INVALID_XML = new RegExp(`[${CONTROL2}]`, "g");
14080
+ var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
14081
+ 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;");
14082
+ function attrs(values2) {
14083
+ let out = "";
14084
+ for (const [name, value2] of Object.entries(values2)) {
14085
+ if (value2 === void 0) continue;
14086
+ const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
14087
+ out += ` ${name}="${escapeAttr(text2)}"`;
14088
+ }
14089
+ return out;
14090
+ }
14091
+ var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
14092
+ var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
14093
+
13752
14094
  // xlsx/conditional-extensions.ts
13753
14095
  var XM = "http://schemas.microsoft.com/office/excel/2006/main";
13754
14096
  function dataBarLengths(rule, node) {
@@ -14331,6 +14673,17 @@ function shiftFormulaInBand(formula, formulaSheet, sheet, shift2, band) {
14331
14673
  return changed ? tokens.map((t) => t.text).join("") : formula;
14332
14674
  }
14333
14675
 
14676
+ // xlsx/write/style-xml.ts
14677
+ var argb = (rgb2) => (rgb2.length === 6 ? `FF${rgb2}` : rgb2).toUpperCase();
14678
+ function colorXml(color, name = "color") {
14679
+ if (!color) return "";
14680
+ if (color.rgb) return el(name, { rgb: argb(color.rgb), tint: color.tint });
14681
+ if (color.theme !== void 0) return el(name, { theme: color.theme, tint: color.tint });
14682
+ if (color.indexed !== void 0) return el(name, { indexed: color.indexed, tint: color.tint });
14683
+ if (color.auto) return el(name, { auto: true });
14684
+ return "";
14685
+ }
14686
+
14334
14687
  // xlsx/layout/sparkline-view.ts
14335
14688
  var DEFAULTS = {
14336
14689
  colorSeries: "#376092",
@@ -14378,6 +14731,7 @@ function positions(group, data, n) {
14378
14731
  return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
14379
14732
  }
14380
14733
  }
14734
+ if (group.dateAxis) return Array.from({ length: n }, () => null);
14381
14735
  return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
14382
14736
  }
14383
14737
  function pointFacts(values2) {
@@ -14444,7 +14798,8 @@ function sparklineView(group, data, scale2, theme2) {
14444
14798
  });
14445
14799
  if (segment.length) view.lines.push(segment);
14446
14800
  } else {
14447
- const slot = 1 / n;
14801
+ const dates = group.dateAxis && data.dates ? extent(data.dates) : void 0;
14802
+ const slot = dates ? 1 / Math.max(1, dates.max - dates.min + 1) : 1 / n;
14448
14803
  const w = slot * (1 - COLUMN_GAP);
14449
14804
  const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
14450
14805
  values2.forEach((v, i2) => {
@@ -14523,11 +14878,25 @@ function readSparklineValues(sheet, range2, displayHidden) {
14523
14878
  function groupData(workbook, sheet, group) {
14524
14879
  const dateRange = group.dateAxis && group.dateFormula;
14525
14880
  const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
14526
- const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, group.displayHidden) : void 0;
14881
+ const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, true) : void 0;
14527
14882
  return group.sparklines.map((line2) => {
14528
14883
  const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
14884
+ if (group.dateAxis) {
14885
+ if (!source || !dates || !dateValues) return { values: [], dates: [] };
14886
+ const raw = readSparklineValues(source.sheet, source.range, true);
14887
+ if (raw.length !== dateValues.length) return { values: [], dates: [] };
14888
+ const hidden = (ref, i2) => {
14889
+ const columns = ref.range.end.col - ref.range.start.col + 1;
14890
+ return rowHidden(ref.sheet, ref.range.start.row + Math.floor(i2 / columns)) || colHidden(ref.sheet, ref.range.start.col + i2 % columns);
14891
+ };
14892
+ const pairs = dateValues.flatMap(
14893
+ (date, i2) => date === null || !group.displayHidden && (hidden(source, i2) || hidden(dates, i2)) ? [] : [{ date, value: raw[i2] }]
14894
+ );
14895
+ pairs.sort((a, b) => a.date - b.date);
14896
+ return { values: pairs.map((pair) => pair.value), dates: pairs.map((pair) => pair.date) };
14897
+ }
14529
14898
  const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
14530
- return dateValues ? { values: values2, dates: dateValues } : { values: values2 };
14899
+ return { values: values2 };
14531
14900
  });
14532
14901
  }
14533
14902
  function sparklineViewAt(workbook, sheetIndex2, row2, col) {
@@ -14793,6 +15162,13 @@ function rewriteFormulas(workbook, rewrite, formulaCells) {
14793
15162
  }
14794
15163
  function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
14795
15164
  rewritePreservedFormulas(sheet, rewrite);
15165
+ for (const pivot of sheet.pivotTables ?? []) {
15166
+ const next = safe(rewrite, pivot.source, sheet.name);
15167
+ if (next !== pivot.source) {
15168
+ pivot.source = next;
15169
+ pivot.dirty = true;
15170
+ }
15171
+ }
14796
15172
  {
14797
15173
  const name = sheet.name;
14798
15174
  for (const table2 of sheet.tables)
@@ -15145,20 +15521,20 @@ function addRowIntersections(sheet, r, patcher) {
15145
15521
  }
15146
15522
 
15147
15523
  // xlsx/edit/format.ts
15148
- function stylePatcher(workbook, patch) {
15524
+ function stylePatcher(workbook, patch2) {
15149
15525
  const memo = /* @__PURE__ */ new Map();
15150
15526
  return (id) => {
15151
15527
  const key = id ?? 0;
15152
15528
  let next = memo.get(key);
15153
15529
  if (next === void 0) {
15154
- next = applyStylePatch(workbook, id, patch);
15530
+ next = applyStylePatch(workbook, id, patch2);
15155
15531
  memo.set(key, next);
15156
15532
  }
15157
15533
  return next;
15158
15534
  };
15159
15535
  }
15160
- function patchRange(workbook, sheet, range2, patch) {
15161
- patchRangeWith(sheet, range2, stylePatcher(workbook, patch));
15536
+ function patchRange(workbook, sheet, range2, patch2) {
15537
+ patchRangeWith(sheet, range2, stylePatcher(workbook, patch2));
15162
15538
  }
15163
15539
  function patchRangeWith(sheet, range2, patcher) {
15164
15540
  const r = normalizeRange(range2);
@@ -15203,11 +15579,11 @@ function formatScopes(index2, ranges) {
15203
15579
  const whole = ranges.some((r) => isWholeColumns(r) || isWholeRows(r));
15204
15580
  return whole ? [cells, { kind: "parts", sheet: index2, parts: ["columns", "rowInfo"] }] : [cells];
15205
15581
  }
15206
- function applyStyle(ctx, s, ranges, patch) {
15582
+ function applyStyle(ctx, s, ranges, patch2) {
15207
15583
  const sheet = sheetAt(ctx.workbook, s);
15208
15584
  const normalized = ranges.map(normalizeRange);
15209
15585
  if (!normalized.length) return;
15210
- const patcher = stylePatcher(ctx.workbook, patch);
15586
+ const patcher = stylePatcher(ctx.workbook, patch2);
15211
15587
  ctx.run(
15212
15588
  "Format cells",
15213
15589
  "format",
@@ -15258,13 +15634,13 @@ function linearTrend(values2) {
15258
15634
  const n = values2.length;
15259
15635
  const meanX = (n - 1) / 2;
15260
15636
  const meanY = values2.reduce((a, b) => a + b, 0) / n;
15261
- let num2 = 0;
15637
+ let num3 = 0;
15262
15638
  let den = 0;
15263
15639
  values2.forEach((y, x) => {
15264
- num2 += (x - meanX) * (y - meanY);
15640
+ num3 += (x - meanX) * (y - meanY);
15265
15641
  den += (x - meanX) ** 2;
15266
15642
  });
15267
- const slope = den ? num2 / den : 0;
15643
+ const slope = den ? num3 / den : 0;
15268
15644
  return (k) => Number((meanY + slope * (k - meanX)).toPrecision(15));
15269
15645
  }
15270
15646
  var isDigit5 = (ch) => ch !== void 0 && ch >= "0" && ch <= "9";
@@ -15867,6 +16243,17 @@ function setBorders(ctx, s, range2, preset, edge = { style: "thin" }) {
15867
16243
 
15868
16244
  // xlsx/edit/insert-guard.ts
15869
16245
  function assertInsertFits(sheet, shift2, band) {
16246
+ for (const pivot of sheet.pivotTables ?? []) {
16247
+ const start = pivot.location.start[shift2.axis];
16248
+ const end = pivot.location.end[shift2.axis];
16249
+ const other2 = shift2.axis === "row" ? "col" : "row";
16250
+ if (band && (band.hi < pivot.location.start[other2] || band.lo > pivot.location.end[other2]))
16251
+ continue;
16252
+ const partial = band && (band.lo > pivot.location.start[other2] || band.hi < pivot.location.end[other2]);
16253
+ const overlap = shift2.count > 0 ? shift2.at > start && shift2.at <= end : shift2.at <= end && shift2.at - shift2.count > start;
16254
+ if (overlap || partial && shift2.at <= end)
16255
+ throw new Error("Cannot move or remove part of a PivotTable. Delete the PivotTable first.");
16256
+ }
15870
16257
  if (shift2.count <= 0) return;
15871
16258
  const max = shift2.axis === "row" ? MAX_ROW : MAX_COL;
15872
16259
  if (shift2.at + shift2.count > max + 1)
@@ -15934,6 +16321,13 @@ function shiftSheetContent(sheet, shift2, band) {
15934
16321
  return range2 ? [{ ...c, address: range2.start }] : [];
15935
16322
  });
15936
16323
  sheet.tables = sheet.tables.flatMap((t) => shiftTable(sheet, t, shift2, moveRange));
16324
+ for (const pivot of sheet.pivotTables ?? []) {
16325
+ const location = moveRange(pivot.location);
16326
+ if (location) {
16327
+ pivot.location = location;
16328
+ pivot.dirty = true;
16329
+ }
16330
+ }
15937
16331
  for (const drawing of sheet.drawings) shiftAnchor(drawing.anchor, shift2, band);
15938
16332
  if (!band) shiftAxisFormats(sheet, shift2);
15939
16333
  if (sheet.autoFilter) {
@@ -16176,13 +16570,13 @@ function htmlHref(link) {
16176
16570
  const href = link?.target ? `${link.target}${link.location ? `#${link.location}` : ""}` : link?.location ? `#${link.location}` : void 0;
16177
16571
  return href && (href.startsWith("#") || hyperlinkPolicy(href).store) ? href : void 0;
16178
16572
  }
16179
- function hyperlinkFromHtmlAttributes(attrs, range2) {
16180
- const href = attrs?.get("href");
16573
+ function hyperlinkFromHtmlAttributes(attrs2, range2) {
16574
+ const href = attrs2?.get("href");
16181
16575
  if (!href || !href.startsWith("#") && !hyperlinkPolicy(href).store) return void 0;
16182
16576
  const link = { range: range2 };
16183
16577
  if (href.startsWith("#")) link.location = href.slice(1);
16184
16578
  else link.target = href;
16185
- const tooltip = attrs?.get("title");
16579
+ const tooltip = attrs2?.get("title");
16186
16580
  if (tooltip) link.tooltip = tooltip;
16187
16581
  return link;
16188
16582
  }
@@ -16279,21 +16673,21 @@ function toHtml(cells, theme2) {
16279
16673
  for (let c = 0; c < cells.cols; c++) {
16280
16674
  if (covered.has(`${r},${c}`)) continue;
16281
16675
  const cell = cells.data[r]?.[c] ?? null;
16282
- const attrs = [];
16676
+ const attrs2 = [];
16283
16677
  const span4 = spans2.get(`${r},${c}`);
16284
16678
  if (span4 && span4.end.row > span4.start.row)
16285
- attrs.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16679
+ attrs2.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16286
16680
  if (span4 && span4.end.col > span4.start.col)
16287
- attrs.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16288
- if (cell && typeof cell.value === "number") attrs.push(`x:num="${cell.value}"`);
16681
+ attrs2.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16682
+ if (cell && typeof cell.value === "number") attrs2.push(`x:num="${cell.value}"`);
16289
16683
  const css = cssFor(cell?.style, theme2);
16290
- if (css) attrs.push(`style="${escapeHtml(css)}"`);
16684
+ if (css) attrs2.push(`style="${escapeHtml(css)}"`);
16291
16685
  let text2 = escapeHtml(cell?.text ?? "").replace(/\n/g, "<br>");
16292
16686
  const link = links.get(`${r},${c}`);
16293
16687
  const href = htmlHref(link);
16294
16688
  if (href)
16295
16689
  text2 = `<a href="${escapeHtml(href)}"${link?.tooltip ? ` title="${escapeHtml(link.tooltip)}"` : ""}>${text2}</a>`;
16296
- tds.push(`<td${attrs.length ? ` ${attrs.join(" ")}` : ""}>${text2}</td>`);
16690
+ tds.push(`<td${attrs2.length ? ` ${attrs2.join(" ")}` : ""}>${text2}</td>`);
16297
16691
  }
16298
16692
  rows2.push(`<tr>${tds.join("")}</tr>`);
16299
16693
  }
@@ -16353,12 +16747,12 @@ function decodeEntities(text2) {
16353
16747
  });
16354
16748
  }
16355
16749
  function parseAttributes(text2) {
16356
- const attrs = /* @__PURE__ */ new Map();
16750
+ const attrs2 = /* @__PURE__ */ new Map();
16357
16751
  for (const m of text2.matchAll(
16358
16752
  /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
16359
16753
  ))
16360
- attrs.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16361
- return attrs;
16754
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16755
+ return attrs2;
16362
16756
  }
16363
16757
  function parseCss(text2) {
16364
16758
  const out = /* @__PURE__ */ new Map();
@@ -16384,7 +16778,7 @@ var V_ALIGN = {
16384
16778
  bottom: "bottom"
16385
16779
  };
16386
16780
  function stylePatchFromCss(css, inner2) {
16387
- const patch = {};
16781
+ const patch2 = {};
16388
16782
  const font = {};
16389
16783
  const weight = css.get("font-weight");
16390
16784
  if (weight && (weight === "bold" || Number(weight) >= 600) || /<(b|strong)\b/i.test(inner2))
@@ -16400,16 +16794,16 @@ function stylePatchFromCss(css, inner2) {
16400
16794
  if (size) font.size = Number(size[1]) * (size[2] === "px" ? 0.75 : 1);
16401
16795
  const family = css.get("font-family")?.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
16402
16796
  if (family) font.name = family;
16403
- if (Object.keys(font).length) patch.font = font;
16797
+ if (Object.keys(font).length) patch2.font = font;
16404
16798
  const background = css.get("background-color") ?? css.get("background");
16405
16799
  const fill = background && parseCssColor(background.split(/\s+/)[0] ?? "");
16406
- if (fill) patch.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16800
+ if (fill) patch2.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16407
16801
  const h2 = H_ALIGN[css.get("text-align") ?? ""];
16408
16802
  const v = V_ALIGN[css.get("vertical-align") ?? ""];
16409
- if (h2 || v) patch.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16803
+ if (h2 || v) patch2.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16410
16804
  const numFmt = css.get("mso-number-format");
16411
- if (numFmt) patch.numFmt = decodeNumberFormat(numFmt);
16412
- return patch;
16805
+ if (numFmt) patch2.numFmt = decodeNumberFormat(numFmt);
16806
+ return patch2;
16413
16807
  }
16414
16808
  function removeComments(text2) {
16415
16809
  let out = "";
@@ -16484,18 +16878,18 @@ function parseHtmlTable(html, base) {
16484
16878
  /<t([dh])\b([^>]*)>([\s\S]*?)(?:<\/t[dh]>|(?=<t[dh]\b)|$)/gi
16485
16879
  )) {
16486
16880
  while (taken.has(`${r},${c}`)) c++;
16487
- const attrs = parseAttributes(td[2] ?? "");
16881
+ const attrs2 = parseAttributes(td[2] ?? "");
16488
16882
  const inner2 = td[3] ?? "";
16489
16883
  const css = /* @__PURE__ */ new Map();
16490
- for (const name of (attrs.get("class") ?? "").split(/\s+/))
16884
+ for (const name of (attrs2.get("class") ?? "").split(/\s+/))
16491
16885
  for (const [k, v] of parseCss(classes.get(name) ?? "")) css.set(k, v);
16492
- for (const [k, v] of parseCss(attrs.get("style") ?? "")) css.set(k, v);
16493
- const patch = stylePatchFromCss(css, inner2);
16494
- if (td[1]?.toLowerCase() === "h") patch.font = { bold: true, ...patch.font };
16886
+ for (const [k, v] of parseCss(attrs2.get("style") ?? "")) css.set(k, v);
16887
+ const patch2 = stylePatchFromCss(css, inner2);
16888
+ if (td[1]?.toLowerCase() === "h") patch2.font = { bold: true, ...patch2.font };
16495
16889
  const text2 = cellText(inner2);
16496
- row2[c] = text2 === "" && !Object.keys(patch).length ? null : toCell(text2, attrs, patch, base);
16497
- const rowSpan = Math.max(1, Number(attrs.get("rowspan") ?? 1) || 1);
16498
- const colSpan = Math.max(1, Number(attrs.get("colspan") ?? 1) || 1);
16890
+ row2[c] = text2 === "" && !Object.keys(patch2).length ? null : toCell(text2, attrs2, patch2, base);
16891
+ const rowSpan = Math.max(1, Number(attrs2.get("rowspan") ?? 1) || 1);
16892
+ const colSpan = Math.max(1, Number(attrs2.get("colspan") ?? 1) || 1);
16499
16893
  const anchor = /<a\b([^>]*)>/i.exec(inner2);
16500
16894
  const linkAttrs = anchor ? parseAttributes(anchor[1] ?? "") : void 0;
16501
16895
  const link = hyperlinkFromHtmlAttributes(linkAttrs, {
@@ -16525,17 +16919,17 @@ function parseHtmlTable(html, base) {
16525
16919
  );
16526
16920
  return rows2 && cols ? { rows: rows2, cols, data, merges, hyperlinks } : void 0;
16527
16921
  }
16528
- function toCell(text2, attrs, patch, base) {
16922
+ function toCell(text2, attrs2, patch2, base) {
16529
16923
  let value2 = text2;
16530
- const num2 = attrs.get("x:num");
16531
- if (num2 !== void 0 && num2 !== "" && Number.isFinite(Number(num2))) value2 = Number(num2);
16532
- else if (attrs.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16533
- else if (patch.numFmt !== "@" && text2 !== "") {
16924
+ const num3 = attrs2.get("x:num");
16925
+ if (num3 !== void 0 && num3 !== "" && Number.isFinite(Number(num3))) value2 = Number(num3);
16926
+ else if (attrs2.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16927
+ else if (patch2.numFmt !== "@" && text2 !== "") {
16534
16928
  const parsed = parseCellInput(text2);
16535
16929
  if (parsed.formula === void 0) value2 = parsed.value;
16536
- if (!patch.numFmt && parsed.numFmt && typeof value2 === "number") patch.numFmt = parsed.numFmt;
16930
+ if (!patch2.numFmt && parsed.numFmt && typeof value2 === "number") patch2.numFmt = parsed.numFmt;
16537
16931
  }
16538
- return { value: value2, text: text2, style: patchStyle(base, patch) };
16932
+ return { value: value2, text: text2, style: patchStyle(base, patch2) };
16539
16933
  }
16540
16934
 
16541
16935
  // xlsx/edit/clipboard-text.ts
@@ -18082,10 +18476,10 @@ var SessionCalculator = class {
18082
18476
 
18083
18477
  // xlsx/edit/doc-properties.ts
18084
18478
  var same2 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
18085
- function setDocumentProperties(ctx, patch) {
18479
+ function setDocumentProperties(ctx, patch2) {
18086
18480
  const prior = ctx.workbook.properties;
18087
18481
  const next = { ...prior };
18088
- for (const [key, value2] of Object.entries(patch)) {
18482
+ for (const [key, value2] of Object.entries(patch2)) {
18089
18483
  if (value2 === void 0) continue;
18090
18484
  if (value2 === null) delete next[key];
18091
18485
  else next[key] = structuredClone(value2);
@@ -18138,6 +18532,444 @@ function deleteDrawing(ctx, s, index2) {
18138
18532
  );
18139
18533
  }
18140
18534
 
18535
+ // xlsx/edit/sparkline-xml.ts
18536
+ var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
18537
+ var URI = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
18538
+ var COLORS2 = [
18539
+ "colorSeries",
18540
+ "colorNegative",
18541
+ "colorAxis",
18542
+ "colorMarkers",
18543
+ "colorFirst",
18544
+ "colorLast",
18545
+ "colorHigh",
18546
+ "colorLow"
18547
+ ];
18548
+ var SCALARS = [
18549
+ "type",
18550
+ "lineWeight",
18551
+ "markers",
18552
+ "high",
18553
+ "low",
18554
+ "first",
18555
+ "last",
18556
+ "negative",
18557
+ "displayEmptyCellsAs",
18558
+ "displayXAxis",
18559
+ "displayHidden",
18560
+ "rightToLeft",
18561
+ "minAxisType",
18562
+ "maxAxisType",
18563
+ "manualMin",
18564
+ "manualMax"
18565
+ ];
18566
+ function cleanSparklinePatch(patch2) {
18567
+ return Object.fromEntries(
18568
+ [...SCALARS, ...COLORS2].flatMap((key) => patch2[key] === void 0 ? [] : [[key, patch2[key]]])
18569
+ );
18570
+ }
18571
+ function patchSparklineNode(node, patch2) {
18572
+ for (const key of SCALARS) {
18573
+ const value2 = patch2[key];
18574
+ if (value2 === void 0) continue;
18575
+ node.setAttribute(key, typeof value2 === "boolean" ? value2 ? "1" : "0" : String(value2));
18576
+ }
18577
+ if (patch2.minAxisType && patch2.minAxisType !== "custom") node.removeAttribute("manualMin");
18578
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom") node.removeAttribute("manualMax");
18579
+ for (const key of COLORS2) {
18580
+ const color = patch2[key];
18581
+ if (!color) continue;
18582
+ const fresh = parseXml(
18583
+ `<x14:root xmlns:x14="${NS.x14}">${colorXml(color, `x14:${key}`)}</x14:root>`
18584
+ ).documentElement.firstChild;
18585
+ const replacement = node.ownerDocument.importNode(fresh, true);
18586
+ const old = first(node, key, NS.x14);
18587
+ if (old) node.replaceChild(replacement, old);
18588
+ else {
18589
+ const before = elements(node).find((child) => {
18590
+ const index2 = COLORS2.indexOf(child.localName);
18591
+ return index2 > COLORS2.indexOf(key) || child.localName === "f" || child.localName === "sparklines";
18592
+ });
18593
+ node.insertBefore(replacement, before ?? null);
18594
+ }
18595
+ }
18596
+ }
18597
+ function editSparklineXml(sheet, edit) {
18598
+ return (sheet.preserved.get("extLst") ?? []).map((xml) => {
18599
+ if (!xml.includes("sparklineGroup")) return xml;
18600
+ const doc = parseXml(xml);
18601
+ let changed = false;
18602
+ for (const node of Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup"))) {
18603
+ if (!edit(node, readSparklineGroup(node))) continue;
18604
+ changed = true;
18605
+ const lines = first(node, "sparklines", NS.x14);
18606
+ if (!lines || !children(lines, "sparkline", NS.x14).length) {
18607
+ const groups = node.parentNode;
18608
+ groups.removeChild(node);
18609
+ if (!children(groups, "sparklineGroup", NS.x14).length)
18610
+ groups.parentNode.removeChild(groups);
18611
+ }
18612
+ }
18613
+ return changed ? buildXml(doc.documentElement) : xml;
18614
+ });
18615
+ }
18616
+ function appendSparklineXml(sheet, groupXml) {
18617
+ const source = [...sheet.preserved.get("extLst") ?? []];
18618
+ const found = source.findIndex((xml) => xml.includes("sparklineGroups"));
18619
+ const index2 = found >= 0 ? found : 0;
18620
+ const doc = parseXml(source[index2] ?? `<extLst xmlns="${NS.x}"/>`);
18621
+ const root = doc.documentElement;
18622
+ let ext = children(root, "ext", NS.x).find(
18623
+ (node) => node.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
18624
+ );
18625
+ if (!ext) {
18626
+ ext = doc.createElementNS(NS.x, "ext");
18627
+ ext.setAttribute("uri", URI);
18628
+ ext.setAttribute("xmlns:x14", NS.x14);
18629
+ root.appendChild(ext);
18630
+ }
18631
+ ext.setAttribute("uri", URI);
18632
+ let groups = first(ext, "sparklineGroups", NS.x14);
18633
+ if (!groups) {
18634
+ groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
18635
+ groups.setAttribute("xmlns:xm", XM4);
18636
+ ext.appendChild(groups);
18637
+ }
18638
+ const fresh = doc.importNode(parseXml(groupXml).documentElement, true);
18639
+ const revision = "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2";
18640
+ if (Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup")).some(
18641
+ (node) => node.hasAttributeNS(revision, "uid")
18642
+ )) {
18643
+ fresh.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xr2", revision);
18644
+ fresh.setAttributeNS(revision, "xr2:uid", `{${globalThis.crypto.randomUUID().toUpperCase()}}`);
18645
+ }
18646
+ groups.appendChild(fresh);
18647
+ source[index2] = buildXml(root);
18648
+ return source;
18649
+ }
18650
+
18651
+ // xlsx/edit/sparklines.ts
18652
+ function selectedSparklineGroups(sheet, ranges) {
18653
+ return sheetSparklineGroups(sheet).filter(
18654
+ (group) => group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host)))
18655
+ );
18656
+ }
18657
+ function validateSettings(group) {
18658
+ for (const key of [
18659
+ "markers",
18660
+ "high",
18661
+ "low",
18662
+ "first",
18663
+ "last",
18664
+ "negative",
18665
+ "displayXAxis",
18666
+ "displayHidden",
18667
+ "rightToLeft"
18668
+ ])
18669
+ if (typeof group[key] !== "boolean") throw new Error("The sparkline settings are not valid.");
18670
+ 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))
18671
+ throw new Error("The sparkline settings are not valid.");
18672
+ if (!Number.isFinite(group.lineWeight) || group.lineWeight < 0 || group.lineWeight > 1584)
18673
+ throw new Error("The sparkline settings are not valid.");
18674
+ 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)
18675
+ throw new Error("The sparkline axis limits are not valid.");
18676
+ if (group.manualMin !== void 0 && group.minAxisType !== "custom" || group.manualMax !== void 0 && group.maxAxisType !== "custom")
18677
+ throw new Error("The sparkline axis limits are not valid.");
18678
+ for (const key of [
18679
+ "colorSeries",
18680
+ "colorNegative",
18681
+ "colorAxis",
18682
+ "colorMarkers",
18683
+ "colorFirst",
18684
+ "colorLast",
18685
+ "colorHigh",
18686
+ "colorLow"
18687
+ ]) {
18688
+ const color = group[key];
18689
+ if (color !== void 0 && (color === null || typeof color !== "object" || Array.isArray(color) || ![color.rgb, color.theme, color.indexed].some((value2) => value2 !== void 0)))
18690
+ throw new Error("The sparkline settings are not valid.");
18691
+ 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)))
18692
+ throw new Error("The sparkline settings are not valid.");
18693
+ }
18694
+ }
18695
+ function validatePatch(group, patch2) {
18696
+ const next = { ...group, ...patch2 };
18697
+ if (patch2.minAxisType && patch2.minAxisType !== "custom" && patch2.manualMin === void 0)
18698
+ delete next.manualMin;
18699
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom" && patch2.manualMax === void 0)
18700
+ delete next.manualMax;
18701
+ validateSettings(next);
18702
+ }
18703
+ function save(ctx, s, next, label3, ranges) {
18704
+ const sheet = sheetAt(ctx.workbook, s);
18705
+ ctx.run(
18706
+ label3,
18707
+ "annotations",
18708
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
18709
+ () => sheet.preserved.set("extLst", next),
18710
+ { sheet: s, ranges }
18711
+ );
18712
+ }
18713
+ function createSparklineGroup(ctx, s, source, locations, patch2 = {}) {
18714
+ patch2 = cleanSparklinePatch(patch2);
18715
+ locations = checkedSparklineRange(locations);
18716
+ const sheet = sheetAt(ctx.workbook, s);
18717
+ const lines = newSparklines(ctx.workbook, s, source, locations);
18718
+ if (selectedSparklineGroups(sheet, [locations]).length)
18719
+ throw new Error("The location range already contains sparklines.");
18720
+ if (sheet.merges.some((merge2) => lines.some((line2) => rangesIntersect(merge2, line2.host))))
18721
+ throw new Error("Sparklines cannot be created in merged cells.");
18722
+ const body2 = lines.map(
18723
+ (line2) => `<x14:sparkline>${el("xm:f", {}, escapeText(line2.formula))}${el("xm:sqref", {}, formatRange(line2.host))}</x14:sparkline>`
18724
+ ).join("");
18725
+ 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("");
18726
+ const doc = parseXml(
18727
+ `<x14:sparklineGroup xmlns:x14="${NS.x14}" xmlns:xm="${XM4}">${colors}<x14:sparklines>${body2}</x14:sparklines></x14:sparklineGroup>`
18728
+ );
18729
+ const node = doc.documentElement;
18730
+ validatePatch(readSparklineGroup(node), patch2);
18731
+ patchSparklineNode(node, { displayEmptyCellsAs: "gap", ...patch2 });
18732
+ validateSettings({ ...readSparklineGroup(node), ...patch2 });
18733
+ save(ctx, s, appendSparklineXml(sheet, buildXml(node)), "Create sparklines", [locations]);
18734
+ }
18735
+ function setSparklineGroups(ctx, s, ranges, patch2) {
18736
+ patch2 = cleanSparklinePatch(patch2);
18737
+ const sheet = sheetAt(ctx.workbook, s);
18738
+ ranges = ranges.map(checkedSparklineRange);
18739
+ const selected2 = selectedSparklineGroups(sheet, ranges);
18740
+ if (!selected2.length) return;
18741
+ for (const group of selected2) validatePatch(group, patch2);
18742
+ const next = editSparklineXml(sheet, (node, group) => {
18743
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18744
+ return false;
18745
+ patchSparklineNode(node, patch2);
18746
+ return true;
18747
+ });
18748
+ save(ctx, s, next, "Format sparklines", ranges);
18749
+ }
18750
+ function setSparklineDateRange(ctx, s, ranges, source = "") {
18751
+ ranges = ranges.map(checkedSparklineRange);
18752
+ const sheet = sheetAt(ctx.workbook, s);
18753
+ const groups = selectedSparklineGroups(sheet, ranges);
18754
+ if (!groups.length) return;
18755
+ let formula;
18756
+ if (source.trim()) {
18757
+ const data = sparklineDataRange(ctx.workbook, s, source);
18758
+ const length = (range2) => {
18759
+ const rows2 = range2.end.row - range2.start.row + 1;
18760
+ const cols = range2.end.col - range2.start.col + 1;
18761
+ if (rows2 > 1 && cols > 1) throw new Error("The date range must be one row or column.");
18762
+ return Math.max(rows2, cols);
18763
+ };
18764
+ const count2 = length(data.range);
18765
+ if (count2 > 1e4) throw new Error("The sparkline date range is too large.");
18766
+ for (const group of groups)
18767
+ for (const line2 of group.sparklines) {
18768
+ const values2 = sparklineDataRange(ctx.workbook, s, line2.formula ?? "");
18769
+ if (length(values2.range) !== count2)
18770
+ throw new Error("The data range and date range do not match.");
18771
+ }
18772
+ formula = `'${ctx.workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!${formatRange(data.range)}`;
18773
+ }
18774
+ const next = editSparklineXml(sheet, (node, group) => {
18775
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18776
+ return false;
18777
+ for (const old of children(node, "f", XM4)) node.removeChild(old);
18778
+ node.setAttribute("dateAxis", formula ? "1" : "0");
18779
+ if (formula) {
18780
+ const value2 = node.ownerDocument.createElementNS(XM4, "xm:f");
18781
+ value2.textContent = formula;
18782
+ node.insertBefore(value2, first(node, "sparklines", NS.x14) ?? null);
18783
+ }
18784
+ return true;
18785
+ });
18786
+ save(ctx, s, next, "Change sparkline date axis", ranges);
18787
+ }
18788
+ function deleteSparklines(ctx, s, ranges, wholeGroups = false) {
18789
+ ranges = ranges.map(checkedSparklineRange);
18790
+ const sheet = sheetAt(ctx.workbook, s);
18791
+ if (!selectedSparklineGroups(sheet, ranges).length) return;
18792
+ const next = editSparklineXml(sheet, (node, group) => {
18793
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18794
+ return false;
18795
+ const lines = first(node, "sparklines", NS.x14);
18796
+ const nodes = children(lines, "sparkline", NS.x14);
18797
+ for (const line2 of nodes) {
18798
+ const host = parseRange(first(line2, "sqref", XM4)?.textContent ?? "");
18799
+ if (wholeGroups || host && ranges.some((range2) => rangesIntersect(range2, host)))
18800
+ line2.parentNode?.removeChild(line2);
18801
+ }
18802
+ return true;
18803
+ });
18804
+ save(ctx, s, next, "Clear sparklines", ranges);
18805
+ }
18806
+
18807
+ // xlsx/edit/pivots.ts
18808
+ function pivotAt(ctx, sheet, name) {
18809
+ const pivot = sheetAt(ctx.workbook, sheet).pivotTables?.find((entry) => entry.name === name);
18810
+ if (!pivot) throw new Error("The selected PivotTable is not available.");
18811
+ return pivot;
18812
+ }
18813
+ function uniqueName(ctx) {
18814
+ const used = reservedPivotNames(ctx.workbook);
18815
+ for (let i2 = 1; ; i2++) if (!used.has(`pivottable${i2}`)) return `PivotTable${i2}`;
18816
+ }
18817
+ function reservedPivotNames(workbook) {
18818
+ return new Set(
18819
+ workbook.sheets.flatMap((sheet) => [
18820
+ ...(sheet.pivotTables ?? []).map((pivot) => pivot.name),
18821
+ ...sheet.preserved.get("source:unsupportedPivotNames") ?? []
18822
+ ]).map((name) => name.toLowerCase())
18823
+ );
18824
+ }
18825
+ function checkName(ctx, name) {
18826
+ if (!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name) || name.length > 255 || parseAddress(name) || reservedPivotNames(ctx.workbook).has(name.toLowerCase()))
18827
+ throw new Error("A PivotTable name must be unique and cannot look like a cell reference.");
18828
+ }
18829
+ function plan(ctx, s, pivot, old) {
18830
+ const sheet = sheetAt(ctx.workbook, s);
18831
+ const grid6 = pivotGrid(pivot);
18832
+ const start = pivot.location.start;
18833
+ const location = {
18834
+ start,
18835
+ end: {
18836
+ row: start.row + grid6.values.length - 1,
18837
+ col: start.col + (grid6.values[0]?.length ?? 0) - 1
18838
+ }
18839
+ };
18840
+ if (![start.row, start.col].every(Number.isInteger) || start.row < 0 || start.col < 0 || location.end.row > MAX_ROW || location.end.col > MAX_COL)
18841
+ throw new Error("The PivotTable result does not fit on the worksheet.");
18842
+ const source = sparklineDataRange(ctx.workbook, s, pivot.source);
18843
+ 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)))
18844
+ throw new Error("The PivotTable would overlap source data, another table or merged cells.");
18845
+ let occupied = false;
18846
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18847
+ if ((!old || !rangeContains(old.location, { row: row2, col })) && (cell.value !== null || cell.formula !== void 0))
18848
+ occupied = true;
18849
+ });
18850
+ if (occupied) throw new Error("The PivotTable would overwrite existing cell content.");
18851
+ return { grid: grid6, location };
18852
+ }
18853
+ function write(ctx, s, pivot, old) {
18854
+ const sheet = sheetAt(ctx.workbook, s);
18855
+ const { grid: grid6, location } = plan(ctx, s, pivot, old);
18856
+ const ranges = [...old ? [old.location] : [], location];
18857
+ ctx.run(
18858
+ old ? "Refresh PivotTable" : "Create PivotTable",
18859
+ "annotations",
18860
+ [
18861
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18862
+ { kind: "cells", sheet: s, ranges }
18863
+ ],
18864
+ () => {
18865
+ const compact3 = pivot.layout === "compact";
18866
+ const indents = [
18867
+ stylePatcher(ctx.workbook, {
18868
+ alignment: { indent: 0, ...compact3 ? { horizontal: "left" } : {} }
18869
+ }),
18870
+ stylePatcher(ctx.workbook, { alignment: { indent: 1, horizontal: "left" } })
18871
+ ];
18872
+ const styles = /* @__PURE__ */ new Map();
18873
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18874
+ if (cell.styleId !== void 0) styles.set(`${row2}:${col}`, cell.styleId);
18875
+ });
18876
+ if (old)
18877
+ forEachCellInRange(sheet, old.location, (cell, row2, col) => {
18878
+ if (cell.styleId !== void 0)
18879
+ putCell(sheet, row2, col, { value: null, styleId: cell.styleId });
18880
+ else deleteCell(sheet, row2, col);
18881
+ });
18882
+ const next = { ...pivot, location, dirty: true };
18883
+ const list = sheet.pivotTables ?? [];
18884
+ sheet.pivotTables = old ? list.map((entry) => entry === old ? next : entry) : [...list, next];
18885
+ grid6.values.forEach(
18886
+ (line2, row2) => line2.forEach((value2, col) => {
18887
+ const r = startRow(location, row2);
18888
+ const c = location.start.col + col;
18889
+ let styleId = styles.get(`${r}:${c}`);
18890
+ if (col < (grid6.rowLabelColumns ?? 1)) {
18891
+ const indent = col === 0 ? grid6.indents?.[row2] ?? 0 : 0;
18892
+ const alignment = styleAt(ctx.workbook, styleId).alignment;
18893
+ if ((alignment?.indent ?? 0) !== indent || compact3 && alignment?.horizontal !== "left")
18894
+ styleId = indents[indent](styleId);
18895
+ }
18896
+ putCell(sheet, r, c, { value: value2, ...styleId !== void 0 ? { styleId } : {} });
18897
+ })
18898
+ );
18899
+ },
18900
+ { sheet: s, ranges }
18901
+ );
18902
+ }
18903
+ var startRow = (range2, offset2) => range2.start.row + offset2;
18904
+ function createPivotTable(ctx, s, destination, options) {
18905
+ const data = pivotSourceData(ctx.workbook, s, options.source);
18906
+ const name = options.name ?? uniqueName(ctx);
18907
+ checkName(ctx, name);
18908
+ const aggregate3 = options.aggregate ?? "sum";
18909
+ const pivot = {
18910
+ ...data,
18911
+ name,
18912
+ rowField: options.rowField,
18913
+ layout: options.layout ?? "tabular",
18914
+ subtotalPosition: options.subtotalPosition ?? (options.layout && options.layout !== "tabular" ? "top" : "bottom"),
18915
+ ...options.secondRowField ? { secondRowField: options.secondRowField } : {},
18916
+ ...options.subtotals !== void 0 ? { subtotals: options.subtotals } : {},
18917
+ ...options.repeatLabels !== void 0 ? { repeatLabels: options.repeatLabels } : {},
18918
+ valueField: options.valueField,
18919
+ aggregate: aggregate3,
18920
+ valueCaption: pivotCaption(aggregate3, options.valueField),
18921
+ location: { start: { ...destination }, end: { ...destination } },
18922
+ ...options.columnField ? { columnField: options.columnField } : {}
18923
+ };
18924
+ validatePivotFields(pivot);
18925
+ write(ctx, s, pivot);
18926
+ return name;
18927
+ }
18928
+ function refreshPivotTable(ctx, s, name, patch2 = {}) {
18929
+ const old = pivotAt(ctx, s, name);
18930
+ const aggregate3 = patch2.aggregate ?? old.aggregate;
18931
+ const valueField = patch2.valueField ?? old.valueField;
18932
+ const next = {
18933
+ ...old,
18934
+ ...pivotSourceData(ctx.workbook, s, old.source),
18935
+ rowField: patch2.rowField ?? old.rowField,
18936
+ valueField,
18937
+ aggregate: aggregate3,
18938
+ valueCaption: aggregate3 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate3, valueField)
18939
+ };
18940
+ if (patch2.columnField !== void 0) {
18941
+ if (patch2.columnField) next.columnField = patch2.columnField;
18942
+ else delete next.columnField;
18943
+ }
18944
+ if (patch2.secondRowField !== void 0) {
18945
+ if (patch2.secondRowField) next.secondRowField = patch2.secondRowField;
18946
+ else delete next.secondRowField;
18947
+ }
18948
+ if (patch2.subtotals !== void 0) next.subtotals = patch2.subtotals;
18949
+ if (patch2.repeatLabels !== void 0) next.repeatLabels = patch2.repeatLabels;
18950
+ if (patch2.layout !== void 0) next.layout = patch2.layout;
18951
+ if (patch2.subtotalPosition !== void 0) next.subtotalPosition = patch2.subtotalPosition;
18952
+ validatePivotFields(next);
18953
+ write(ctx, s, next, old);
18954
+ }
18955
+ function deletePivotTable(ctx, s, name) {
18956
+ const sheet = sheetAt(ctx.workbook, s);
18957
+ const pivot = pivotAt(ctx, s, name);
18958
+ ctx.run(
18959
+ "Delete PivotTable",
18960
+ "annotations",
18961
+ [
18962
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18963
+ { kind: "cells", sheet: s, ranges: [pivot.location] }
18964
+ ],
18965
+ () => {
18966
+ sheet.pivotTables = sheet.pivotTables.filter((entry) => entry !== pivot);
18967
+ forEachCellInRange(sheet, pivot.location, (_cell, row2, col) => deleteCell(sheet, row2, col));
18968
+ },
18969
+ { sheet: s, ranges: [pivot.location] }
18970
+ );
18971
+ }
18972
+
18141
18973
  // xlsx/edit/cell-style.ts
18142
18974
  function ensureNamedStyle(workbook, name) {
18143
18975
  const lower2 = name.toLowerCase();
@@ -18245,19 +19077,19 @@ function addChart(ctx, s, chart) {
18245
19077
  { sheet: s }
18246
19078
  );
18247
19079
  }
18248
- function updateChart(ctx, s, index2, patch) {
18249
- assertBarClusterOptions(patch);
19080
+ function updateChart(ctx, s, index2, patch2) {
19081
+ assertBarClusterOptions(patch2);
18250
19082
  const sheet = sheetAt(ctx.workbook, s);
18251
19083
  const chart = sheet.drawings[index2];
18252
19084
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index2}`);
18253
- const formatting = patch.elementFills ? chartWithElementFills(chart, patch.elementFills).formatting : void 0;
19085
+ const formatting = patch2.elementFills ? chartWithElementFills(chart, patch2.elementFills).formatting : void 0;
18254
19086
  ctx.run(
18255
19087
  "Edit chart",
18256
19088
  "annotations",
18257
19089
  [{ kind: "sheet", sheet: s }],
18258
19090
  () => {
18259
19091
  const live = sheet.drawings[index2];
18260
- const changes = structuredClone(patch);
19092
+ const changes = structuredClone(patch2);
18261
19093
  delete changes.elementFills;
18262
19094
  if (formatting) live.formatting = formatting;
18263
19095
  changes.series?.forEach((series, i2) => {
@@ -18483,6 +19315,8 @@ function resizeTableIn(workbook, sheet, id, range2) {
18483
19315
  throw new Error("The table range is too small.");
18484
19316
  if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
18485
19317
  throw new Error("A table cannot overlap another table.");
19318
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
19319
+ throw new Error("A table cannot overlap a PivotTable.");
18486
19320
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
18487
19321
  throw new Error("A table cannot contain merged cells.");
18488
19322
  const oldEnd = table2.range.end.row;
@@ -18505,17 +19339,17 @@ var STYLE_KEYS = [
18505
19339
  "showFirstColumn",
18506
19340
  "showLastColumn"
18507
19341
  ];
18508
- function updateTable(ctx, s, ref, patch) {
19342
+ function updateTable(ctx, s, ref, patch2) {
18509
19343
  const { workbook } = ctx;
18510
19344
  const sheet = sheetAt(workbook, s);
18511
19345
  const current = sheet.tables[tableIndex(sheet, ref)];
18512
- const name = patch.name ?? patch.displayName;
19346
+ const name = patch2.name ?? patch2.displayName;
18513
19347
  const renaming = name !== void 0 && name !== current.name;
18514
19348
  if (renaming) {
18515
19349
  const problem = validateTableName(workbook, name, current);
18516
19350
  if (problem) throw new Error(problem);
18517
19351
  }
18518
- const wide = renaming || patch.headerRow !== void 0 || patch.totalsRow !== void 0;
19352
+ const wide = renaming || patch2.headerRow !== void 0 || patch2.totalsRow !== void 0;
18519
19353
  const scope = wide ? { kind: "workbook" } : { kind: "sheet", sheet: s };
18520
19354
  const id = current.id;
18521
19355
  ctx.run(
@@ -18526,25 +19360,25 @@ function updateTable(ctx, s, ref, patch) {
18526
19360
  const table2 = byId(sheet, id);
18527
19361
  if (renaming) renameTableIn(workbook, table2, name);
18528
19362
  for (const key of STYLE_KEYS) {
18529
- if (!(key in patch)) continue;
18530
- const value2 = patch[key];
19363
+ if (!(key in patch2)) continue;
19364
+ const value2 = patch2[key];
18531
19365
  if (value2 === void 0) delete table2[key];
18532
19366
  else table2[key] = value2;
18533
19367
  }
18534
- if (patch.columns) {
19368
+ if (patch2.columns) {
18535
19369
  const width = table2.range.end.col - table2.range.start.col + 1;
18536
- if (patch.columns.length !== width) throw new Error("Give one column per table column.");
19370
+ if (patch2.columns.length !== width) throw new Error("Give one column per table column.");
18537
19371
  const before = table2.columns;
18538
- table2.columns = structuredClone(patch.columns);
19372
+ table2.columns = structuredClone(patch2.columns);
18539
19373
  for (const [index2, column] of table2.columns.entries()) {
18540
19374
  const sourceId = before[index2]?.sourceId;
18541
19375
  if (column.sourceId === void 0 && sourceId !== void 0) column.sourceId = sourceId;
18542
19376
  }
18543
19377
  }
18544
- if (patch.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch.headerRow);
18545
- if (patch.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch.totalsRow);
18546
- else if (patch.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
18547
- if (patch.range) resizeTableIn(workbook, sheet, id, patch.range);
19378
+ if (patch2.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch2.headerRow);
19379
+ if (patch2.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch2.totalsRow);
19380
+ else if (patch2.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
19381
+ if (patch2.range) resizeTableIn(workbook, sheet, id, patch2.range);
18548
19382
  },
18549
19383
  { sheet: s, ranges: [current.range], structural: true }
18550
19384
  );
@@ -18726,28 +19560,28 @@ function compact2(value2) {
18726
19560
  if (value2[key] === void 0) delete value2[key];
18727
19561
  return value2;
18728
19562
  }
18729
- function setPageSetup(ctx, s, patch) {
19563
+ function setPageSetup(ctx, s, patch2) {
18730
19564
  const sheet = sheetAt(ctx.workbook, s);
18731
19565
  ctx.run(
18732
19566
  "Page setup",
18733
19567
  "view",
18734
19568
  [{ kind: "sheet", sheet: s }],
18735
19569
  () => {
18736
- const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch) });
19570
+ const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch2) });
18737
19571
  if (Object.keys(next).length) sheet.pageSetup = next;
18738
19572
  else Reflect.deleteProperty(sheet, "pageSetup");
18739
19573
  },
18740
19574
  { sheet: s }
18741
19575
  );
18742
19576
  }
18743
- function setPrintOptions(ctx, s, patch) {
19577
+ function setPrintOptions(ctx, s, patch2) {
18744
19578
  const sheet = sheetAt(ctx.workbook, s);
18745
19579
  ctx.run(
18746
19580
  "Print options",
18747
19581
  "view",
18748
19582
  [{ kind: "sheet", sheet: s }],
18749
19583
  () => {
18750
- const next = { ...sheet.printOptions, ...patch };
19584
+ const next = { ...sheet.printOptions, ...patch2 };
18751
19585
  for (const key of Object.keys(next))
18752
19586
  if (!next[key]) delete next[key];
18753
19587
  if (Object.keys(next).length) sheet.printOptions = next;
@@ -18758,6 +19592,203 @@ function setPrintOptions(ctx, s, patch) {
18758
19592
  );
18759
19593
  }
18760
19594
 
19595
+ // xlsx/edit/page-breaks.ts
19596
+ function patch(xml, before, present, axis) {
19597
+ const doc = parseXml(xml);
19598
+ const root = doc.documentElement;
19599
+ const breaks = children(root, "brk", NS.x);
19600
+ for (const node of breaks)
19601
+ if (!present && /^(1|true)$/.test(node.getAttribute("man") ?? "") && (before === void 0 || Number(node.getAttribute("id")) === before))
19602
+ root.removeChild(node);
19603
+ if (present && before !== void 0) {
19604
+ const existing = children(root, "brk", NS.x).find(
19605
+ (node2) => Number(node2.getAttribute("id")) === before
19606
+ );
19607
+ const node = existing ?? doc.createElementNS(NS.x, "brk");
19608
+ node.setAttribute("id", String(before));
19609
+ node.setAttribute("min", "0");
19610
+ node.setAttribute("max", String(axis === "row" ? MAX_COL : MAX_ROW));
19611
+ node.setAttribute("man", "1");
19612
+ if (!existing) root.appendChild(node);
19613
+ }
19614
+ const remaining = children(root, "brk", NS.x);
19615
+ if (remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length > 1026)
19616
+ throw new Error("A worksheet can have at most 1026 manual breaks on each axis.");
19617
+ if (!elements(root).length) return void 0;
19618
+ root.setAttribute("count", String(remaining.length));
19619
+ root.setAttribute(
19620
+ "manualBreakCount",
19621
+ String(remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length)
19622
+ );
19623
+ return buildXml(root);
19624
+ }
19625
+ function setPageBreak(ctx, s, axis, before, present = true) {
19626
+ if (typeof present !== "boolean" || !["row", "col"].includes(axis) || !Number.isInteger(before) || before <= 0 || before > (axis === "row" ? MAX_ROW : MAX_COL))
19627
+ throw new RangeError("Choose a row or column after the first to set a page break.");
19628
+ const sheet = sheetAt(ctx.workbook, s);
19629
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19630
+ const source = sheet.preserved.get(key) ?? [`<${key} xmlns="${NS.x}"/>`];
19631
+ const result2 = source.flatMap((xml, index2) => {
19632
+ const next = patch(xml, before, present && index2 === 0, axis);
19633
+ return next ? [next] : [];
19634
+ });
19635
+ ctx.run(
19636
+ present ? "Insert page break" : "Remove page break",
19637
+ "view",
19638
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19639
+ () => {
19640
+ if (result2.length) sheet.preserved.set(key, result2);
19641
+ else sheet.preserved.delete(key);
19642
+ },
19643
+ { sheet: s }
19644
+ );
19645
+ }
19646
+ function resetPageBreaks(ctx, s) {
19647
+ const sheet = sheetAt(ctx.workbook, s);
19648
+ const next = ["row", "col"].map((axis) => {
19649
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19650
+ return {
19651
+ key,
19652
+ xml: (sheet.preserved.get(key) ?? []).flatMap((xml) => {
19653
+ const result2 = patch(xml, void 0, false, axis);
19654
+ return result2 ? [result2] : [];
19655
+ })
19656
+ };
19657
+ });
19658
+ ctx.run(
19659
+ "Reset page breaks",
19660
+ "view",
19661
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19662
+ () => {
19663
+ for (const entry of next) {
19664
+ if (entry.xml.length) sheet.preserved.set(entry.key, entry.xml);
19665
+ else sheet.preserved.delete(entry.key);
19666
+ }
19667
+ },
19668
+ { sheet: s }
19669
+ );
19670
+ }
19671
+
19672
+ // xlsx/layout/print-titles.ts
19673
+ var PRINT_TITLES_NAME = "_xlnm.Print_Titles";
19674
+ function refs(ast) {
19675
+ return ast.type === "binary" && ast.op === "," ? [...refs(ast.left), ...refs(ast.right)] : [ast];
19676
+ }
19677
+ function printTitles(workbook, sheetIndex2) {
19678
+ const name = workbook.definedNames.find(
19679
+ (entry) => entry.name === PRINT_TITLES_NAME && entry.localSheet === sheetIndex2
19680
+ );
19681
+ if (!name) return {};
19682
+ try {
19683
+ const result2 = {};
19684
+ for (const node of refs(parseFormula(`(${name.formula})`))) {
19685
+ 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())
19686
+ throw new Error("Unsupported print title reference");
19687
+ const key = node.ref.kind === "rows" ? "rows" : node.ref.kind === "cols" ? "columns" : void 0;
19688
+ if (!key || result2[key]) throw new Error("Unsupported print title reference");
19689
+ const axis = key === "rows" ? "row" : "col";
19690
+ result2[key] = {
19691
+ start: Math.min(node.ref.start[axis], node.ref.end[axis]),
19692
+ end: Math.max(node.ref.start[axis], node.ref.end[axis])
19693
+ };
19694
+ }
19695
+ return result2;
19696
+ } catch {
19697
+ return { unsupported: true };
19698
+ }
19699
+ }
19700
+ function formatPrintTitleSpan(span4, axis) {
19701
+ return axis === "row" ? `$${span4.start + 1}:$${span4.end + 1}` : `$${columnLabel(span4.start)}:$${columnLabel(span4.end)}`;
19702
+ }
19703
+ function printTitlesFormula(sheet, titles) {
19704
+ return ["rows", "columns"].flatMap((key) => {
19705
+ const span4 = titles[key];
19706
+ if (!span4) return [];
19707
+ const max = key === "rows" ? MAX_ROW : MAX_COL;
19708
+ if (![span4.start, span4.end].every(Number.isInteger) || span4.start < 0 || span4.end < span4.start || span4.end > max)
19709
+ throw new Error("Print titles must be whole rows or whole columns.");
19710
+ return [
19711
+ `${quoteSheetName(sheet)}!${formatPrintTitleSpan(span4, key === "rows" ? "row" : "col")}`
19712
+ ];
19713
+ }).join(",");
19714
+ }
19715
+
19716
+ // xlsx/edit/view.ts
19717
+ function setFreeze(ctx, s, freeze) {
19718
+ const sheet = sheetAt(ctx.workbook, s);
19719
+ const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
19720
+ ctx.run(
19721
+ next ? "Freeze panes" : "Unfreeze panes",
19722
+ "view",
19723
+ [{ kind: "sheet", sheet: s }],
19724
+ () => {
19725
+ if (next) sheet.view.freeze = next;
19726
+ else delete sheet.view.freeze;
19727
+ },
19728
+ { sheet: s, structural: true }
19729
+ );
19730
+ }
19731
+ function setSheetView(ctx, s, patch2) {
19732
+ const sheet = sheetAt(ctx.workbook, s);
19733
+ ctx.run(
19734
+ "Sheet view",
19735
+ "view",
19736
+ [{ kind: "sheet", sheet: s }],
19737
+ () => {
19738
+ const view = { ...sheet.view, ...structuredClone(patch2) };
19739
+ for (const key of Object.keys(view))
19740
+ if (view[key] === void 0) delete view[key];
19741
+ if (patch2.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch2.zoom)));
19742
+ sheet.view = view;
19743
+ },
19744
+ { sheet: s, structural: patch2.zoom !== void 0 || "freeze" in patch2 }
19745
+ );
19746
+ }
19747
+ var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
19748
+ function validateDefinedName(name) {
19749
+ if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
19750
+ if (!NAME_PATTERN.test(name))
19751
+ return "A name must start with a letter, underscore or backslash and contain no spaces.";
19752
+ if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
19753
+ return "A name cannot look like a cell reference.";
19754
+ return void 0;
19755
+ }
19756
+ var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
19757
+ function setDefinedName(ctx, name) {
19758
+ const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
19759
+ if (problem) throw new Error(problem);
19760
+ if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
19761
+ const entry = structuredClone(name);
19762
+ entry.formula = entry.formula.replace(/^=/, "");
19763
+ ctx.run("Define name", "names", [{ kind: "meta" }], () => {
19764
+ const { definedNames } = ctx.workbook;
19765
+ const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
19766
+ if (index2 >= 0) definedNames[index2] = entry;
19767
+ else definedNames.push(entry);
19768
+ });
19769
+ }
19770
+ function deleteDefinedName(ctx, name, localSheet) {
19771
+ const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
19772
+ if (index2 < 0) return;
19773
+ ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
19774
+ ctx.workbook.definedNames.splice(index2, 1);
19775
+ });
19776
+ }
19777
+
19778
+ // xlsx/edit/print-titles.ts
19779
+ function setPrintTitles(ctx, sheet, patch2) {
19780
+ const ws = sheetAt(ctx.workbook, sheet);
19781
+ const existing = printTitles(ctx.workbook, sheet);
19782
+ if (existing.unsupported && !Object.hasOwn(patch2, "rows") && !Object.hasOwn(patch2, "columns"))
19783
+ return;
19784
+ if (existing.unsupported && (!Object.hasOwn(patch2, "rows") || !Object.hasOwn(patch2, "columns")))
19785
+ throw new Error("Replace both print title ranges to change unsupported titles.");
19786
+ const next = { ...existing, ...patch2 };
19787
+ const formula = printTitlesFormula(ws.name, next);
19788
+ if (formula) setDefinedName(ctx, { name: PRINT_TITLES_NAME, formula, localSheet: sheet });
19789
+ else deleteDefinedName(ctx, PRINT_TITLES_NAME, sheet);
19790
+ }
19791
+
18761
19792
  // digest/algorithm-names.ts
18762
19793
  var CANONICAL_BY_LOOKUP_KEY = {
18763
19794
  SHA1: "SHA-1",
@@ -20042,12 +21073,12 @@ function compress3(h2, data, offset2) {
20042
21073
  W3[i2 * 2 + 1] = lo;
20043
21074
  }
20044
21075
  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];
20045
- 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];
21076
+ 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];
20046
21077
  for (let i2 = 0; i2 < 80; i2++) {
20047
- const S1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23);
20048
- const S1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (eh >>> 9 | el << 23);
21078
+ const S1h = (eh >>> 14 | el2 << 18) ^ (eh >>> 18 | el2 << 14) ^ (el2 >>> 9 | eh << 23);
21079
+ const S1l = (el2 >>> 14 | eh << 18) ^ (el2 >>> 18 | eh << 14) ^ (eh >>> 9 | el2 << 23);
20049
21080
  const chh = eh & fh ^ ~eh & gh;
20050
- const chl = el & fl ^ ~el & gl;
21081
+ const chl = el2 & fl ^ ~el2 & gl;
20051
21082
  let t1l = (hl >>> 0) + (S1l >>> 0) + (chl >>> 0) + K4[i2 * 2 + 1] + W3[i2 * 2 + 1];
20052
21083
  const t1h = hh + S1h + chh + K4[i2 * 2] + W3[i2 * 2] + Math.floor(t1l / 4294967296);
20053
21084
  t1l >>>= 0;
@@ -20063,10 +21094,10 @@ function compress3(h2, data, offset2) {
20063
21094
  gh = fh;
20064
21095
  gl = fl;
20065
21096
  fh = eh;
20066
- fl = el;
21097
+ fl = el2;
20067
21098
  let nl = (dl >>> 0) + t1l;
20068
21099
  eh = dh + t1h + Math.floor(nl / 4294967296) >>> 0;
20069
- el = nl >>> 0;
21100
+ el2 = nl >>> 0;
20070
21101
  dh = ch;
20071
21102
  dl = cl;
20072
21103
  ch = bh;
@@ -20086,7 +21117,7 @@ function compress3(h2, data, offset2) {
20086
21117
  add2(2, bh, bl);
20087
21118
  add2(4, ch, cl);
20088
21119
  add2(6, dh, dl);
20089
- add2(8, eh, el);
21120
+ add2(8, eh, el2);
20090
21121
  add2(10, fh, fl);
20091
21122
  add2(12, gh, gl);
20092
21123
  add2(14, hh, hl);
@@ -20637,6 +21668,8 @@ function merge(ctx, s, range2, mode) {
20637
21668
  if (r.start.row === r.end.row && r.start.col === r.end.col) return;
20638
21669
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
20639
21670
  throw new Error("Cells inside a table cannot be merged.");
21671
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
21672
+ throw new Error("Cells inside a PivotTable cannot be merged.");
20640
21673
  const targets = mergeTargets(r, mode);
20641
21674
  if (!targets.length) return;
20642
21675
  ctx.run(
@@ -20880,7 +21913,7 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
20880
21913
  indentPx: indentable ? (alignment.indent ?? 0) * (options.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
20881
21914
  rotation,
20882
21915
  isNumber: isNumber2,
20883
- overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !sheet.merges.some((m) => rangeContains(m, { row: row2, col })),
21916
+ 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 }))),
20884
21917
  hasComment: sheet.comments.some((c) => c.address.row === row2 && c.address.col === col),
20885
21918
  hasHyperlink: false,
20886
21919
  validationList: sheet.dataValidations.some(
@@ -21245,6 +22278,12 @@ function deleteSheet(ctx, index2) {
21245
22278
  const sheet = sheetAt(workbook, index2);
21246
22279
  if (sheet.state === "visible" && visibleCount(workbook) <= 1)
21247
22280
  throw new Error("A workbook must contain at least one visible sheet.");
22281
+ if (workbook.sheets.some(
22282
+ (other) => other !== sheet && other.pivotTables?.some(
22283
+ (pivot) => deleteSheetInFormula(pivot.source, sheet.name, []) !== pivot.source
22284
+ )
22285
+ ))
22286
+ throw new Error("Delete dependent PivotTables before deleting their source worksheet.");
21248
22287
  ctx.run(
21249
22288
  "Delete sheet",
21250
22289
  "sheets",
@@ -21348,6 +22387,17 @@ function duplicateSheet(ctx, index2) {
21348
22387
  copy2.name = copyName(workbook, sheet.name);
21349
22388
  copy2.sheetId = nextSheetId(workbook);
21350
22389
  delete copy2.partName;
22390
+ const pivotNames = reservedPivotNames(workbook);
22391
+ for (const pivot of copy2.pivotTables ?? []) {
22392
+ let suffix = 2;
22393
+ while (pivotNames.has(`${pivot.name}_${suffix}`.toLowerCase())) suffix++;
22394
+ pivot.name = `${pivot.name}_${suffix}`;
22395
+ pivotNames.add(pivot.name.toLowerCase());
22396
+ delete pivot.partName;
22397
+ delete pivot.cacheId;
22398
+ delete pivot.sourceXml;
22399
+ pivot.dirty = true;
22400
+ }
21351
22401
  let nextTableId = Math.max(0, ...workbook.sheets.flatMap((s) => s.tables.map((t) => t.id))) + 1;
21352
22402
  const used = /* @__PURE__ */ new Set();
21353
22403
  const renames = [];
@@ -21424,6 +22474,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
21424
22474
  if (r.start.row === r.end.row && r.start.col === r.end.col) r = currentRegion(sheet, r.start);
21425
22475
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
21426
22476
  throw new Error("A table cannot overlap another table.");
22477
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22478
+ throw new Error("A table cannot overlap a PivotTable.");
21427
22479
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
21428
22480
  throw new Error("A table cannot contain merged cells.");
21429
22481
  return ctx.run(
@@ -21650,68 +22702,6 @@ function failure(dv) {
21650
22702
  return result2;
21651
22703
  }
21652
22704
 
21653
- // xlsx/edit/view.ts
21654
- function setFreeze(ctx, s, freeze) {
21655
- const sheet = sheetAt(ctx.workbook, s);
21656
- const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
21657
- ctx.run(
21658
- next ? "Freeze panes" : "Unfreeze panes",
21659
- "view",
21660
- [{ kind: "sheet", sheet: s }],
21661
- () => {
21662
- if (next) sheet.view.freeze = next;
21663
- else delete sheet.view.freeze;
21664
- },
21665
- { sheet: s, structural: true }
21666
- );
21667
- }
21668
- function setSheetView(ctx, s, patch) {
21669
- const sheet = sheetAt(ctx.workbook, s);
21670
- ctx.run(
21671
- "Sheet view",
21672
- "view",
21673
- [{ kind: "sheet", sheet: s }],
21674
- () => {
21675
- const view = { ...sheet.view, ...structuredClone(patch) };
21676
- for (const key of Object.keys(view))
21677
- if (view[key] === void 0) delete view[key];
21678
- if (patch.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch.zoom)));
21679
- sheet.view = view;
21680
- },
21681
- { sheet: s, structural: patch.zoom !== void 0 || "freeze" in patch }
21682
- );
21683
- }
21684
- var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
21685
- function validateDefinedName(name) {
21686
- if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
21687
- if (!NAME_PATTERN.test(name))
21688
- return "A name must start with a letter, underscore or backslash and contain no spaces.";
21689
- if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
21690
- return "A name cannot look like a cell reference.";
21691
- return void 0;
21692
- }
21693
- var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
21694
- function setDefinedName(ctx, name) {
21695
- const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
21696
- if (problem) throw new Error(problem);
21697
- if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
21698
- const entry = structuredClone(name);
21699
- entry.formula = entry.formula.replace(/^=/, "");
21700
- ctx.run("Define name", "names", [{ kind: "meta" }], () => {
21701
- const { definedNames } = ctx.workbook;
21702
- const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
21703
- if (index2 >= 0) definedNames[index2] = entry;
21704
- else definedNames.push(entry);
21705
- });
21706
- }
21707
- function deleteDefinedName(ctx, name, localSheet) {
21708
- const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
21709
- if (index2 < 0) return;
21710
- ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
21711
- ctx.workbook.definedNames.splice(index2, 1);
21712
- });
21713
- }
21714
-
21715
22705
  // xlsx/edit/session.ts
21716
22706
  function createEditSession(workbook, options = {}) {
21717
22707
  const calc = createCalcEngine(workbook);
@@ -21724,8 +22714,8 @@ function createEditSession(workbook, options = {}) {
21724
22714
  };
21725
22715
  const calculator = new SessionCalculator(workbook, calc, autoRecalc);
21726
22716
  const recalc = (step, mode = "apply") => calculator.afterStep(step, mode);
21727
- const begin = (label2, kind, info) => {
21728
- const step = { label: label2, entries: [], structural: info.structural ?? false };
22717
+ const begin = (label3, kind, info) => {
22718
+ const step = { label: label3, entries: [], structural: info.structural ?? false };
21729
22719
  if (info.calc) step.calc = info.calc;
21730
22720
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
21731
22721
  };
@@ -21749,9 +22739,18 @@ function createEditSession(workbook, options = {}) {
21749
22739
  }
21750
22740
  current.step.entries.length = from;
21751
22741
  };
21752
- const run = (label2, kind, scopes, fn, info = {}) => {
22742
+ const run = (label3, kind, scopes, fn, info = {}) => {
22743
+ if (kind === "cells") {
22744
+ for (const scope of scopes)
22745
+ if (scope.kind === "cells" && workbook.sheets[scope.sheet]?.pivotTables?.some(
22746
+ (pivot) => scope.ranges.some((range2) => rangesIntersect(range2, pivot.location))
22747
+ ))
22748
+ throw new Error(
22749
+ "A PivotTable result cannot be edited directly. Refresh or remove the PivotTable instead."
22750
+ );
22751
+ }
21753
22752
  const outer = !open;
21754
- const current = open ?? begin(label2, kind, info);
22753
+ const current = open ?? begin(label3, kind, info);
21755
22754
  if (!outer) {
21756
22755
  delete current.step.calc;
21757
22756
  if (info.structural) current.step.structural = true;
@@ -21817,7 +22816,7 @@ function createEditSession(workbook, options = {}) {
21817
22816
  setCellValue: (s, r, c, value2) => setCellValue(ctx, s, r, c, value2),
21818
22817
  setRangeValues: (s, at, rows2) => setRangeValues(ctx, s, at, rows2),
21819
22818
  clearRange: (s, range2, what) => clearRange(ctx, s, range2, what),
21820
- applyStyle: (s, ranges, patch) => applyStyle(ctx, s, ranges, patch),
22819
+ applyStyle: (s, ranges, patch2) => applyStyle(ctx, s, ranges, patch2),
21821
22820
  setBorders: (s, range2, preset, edge) => setBorders(ctx, s, range2, preset, edge),
21822
22821
  insertRows: (s, at, count2) => insertRows(ctx, s, at, count2),
21823
22822
  deleteRows: (s, at, count2) => deleteRows(ctx, s, at, count2),
@@ -21855,24 +22854,34 @@ function createEditSession(workbook, options = {}) {
21855
22854
  filterColumn: (s, col, vals) => filterColumn(ctx, s, col, vals),
21856
22855
  sortByColumn: (s, col, descending) => sortByColumn(ctx, s, col, descending ?? false),
21857
22856
  createTable: (s, range2, hasHeader, styleName) => createTable(ctx, s, range2, hasHeader, styleName),
21858
- setSheetView: (s, patch) => setSheetView(ctx, s, patch),
22857
+ setSheetView: (s, patch2) => setSheetView(ctx, s, patch2),
21859
22858
  setDefinedName: (name) => setDefinedName(ctx, name),
21860
22859
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
21861
22860
  setDrawingAnchor: (s, index2, anchor) => setDrawingAnchor(ctx, s, index2, anchor),
22861
+ createPivotTable: (s, destination, options2) => createPivotTable(ctx, s, destination, options2),
22862
+ refreshPivotTable: (s, name, patch2) => refreshPivotTable(ctx, s, name, patch2),
22863
+ deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
21862
22864
  deleteDrawing: (s, index2) => deleteDrawing(ctx, s, index2),
22865
+ createSparklineGroup: (s, source, locations, patch2) => createSparklineGroup(ctx, s, source, locations, patch2),
22866
+ setSparklineGroups: (s, ranges, patch2) => setSparklineGroups(ctx, s, ranges, patch2),
22867
+ setSparklineDateRange: (s, ranges, source) => setSparklineDateRange(ctx, s, ranges, source),
22868
+ deleteSparklines: (s, ranges, wholeGroups) => deleteSparklines(ctx, s, ranges, wholeGroups),
21863
22869
  addChart: (s, chart) => addChart(ctx, s, chart),
21864
- updateChart: (s, index2, patch) => updateChart(ctx, s, index2, patch),
22870
+ updateChart: (s, index2, patch2) => updateChart(ctx, s, index2, patch2),
21865
22871
  addImage: (s, bytes, type, anchor, name) => addImage(ctx, s, bytes, type, anchor, name),
21866
22872
  replaceConditionalFormat: (s, index2, cf) => replaceConditionalFormat(ctx, s, index2, cf),
21867
22873
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
21868
22874
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
21869
22875
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
21870
- updateTable: (s, table2, patch) => updateTable(ctx, s, table2, patch),
22876
+ updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
21871
22877
  resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
21872
22878
  convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
21873
22879
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
21874
- setPageSetup: (s, patch) => setPageSetup(ctx, s, patch),
21875
- setPrintOptions: (s, patch) => setPrintOptions(ctx, s, patch),
22880
+ setPageSetup: (s, patch2) => setPageSetup(ctx, s, patch2),
22881
+ setPageBreak: (s, axis, before, present) => setPageBreak(ctx, s, axis, before, present),
22882
+ resetPageBreaks: (s) => resetPageBreaks(ctx, s),
22883
+ setPrintTitles: (s, patch2) => setPrintTitles(ctx, s, patch2),
22884
+ setPrintOptions: (s, patch2) => setPrintOptions(ctx, s, patch2),
21876
22885
  setSheetProtection: (s, p, password) => setSheetProtection(ctx, s, p, password),
21877
22886
  setWorkbookProtection: (locked, password) => setWorkbookProtection(ctx, locked, password),
21878
22887
  groupRows: (s, from, to) => groupRows(ctx, s, from, to),
@@ -21882,7 +22891,7 @@ function createEditSession(workbook, options = {}) {
21882
22891
  setDefaultColumnWidth: (s, width) => setDefaultColumnWidth(ctx, s, width),
21883
22892
  removeDuplicates: (s, range2, cols, hasHeader) => removeDuplicates(ctx, s, range2, cols, hasHeader),
21884
22893
  setCalcMode: (mode) => setCalcMode(ctx, mode),
21885
- setDocumentProperties: (patch) => setDocumentProperties(ctx, patch),
22894
+ setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
21886
22895
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
21887
22896
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
21888
22897
  calculateNow(options2) {
@@ -21897,12 +22906,12 @@ function createEditSession(workbook, options = {}) {
21897
22906
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
21898
22907
  evaluate: (formula, at) => calc.evaluate(formula, at)
21899
22908
  }),
21900
- batch(label2, fn) {
22909
+ batch(label3, fn) {
21901
22910
  if (open) {
21902
22911
  fn();
21903
22912
  return;
21904
22913
  }
21905
- const current = begin(label2, "batch", {});
22914
+ const current = begin(label3, "batch", {});
21906
22915
  open = current;
21907
22916
  try {
21908
22917
  fn();
@@ -22857,21 +23866,21 @@ function stepFontSize(size, grow) {
22857
23866
  if (grow) return FONT_SIZES.find((s) => s > size) ?? Math.min(409, size + 10);
22858
23867
  return [...FONT_SIZES].reverse().find((s) => s < size) ?? Math.max(1, size - 1);
22859
23868
  }
22860
- var style = (ctx, patch) => {
22861
- withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch));
23869
+ var style = (ctx, patch2) => {
23870
+ withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch2));
22862
23871
  };
22863
23872
  function pickColor(arg) {
22864
23873
  if (arg && typeof arg === "object" && !arg.auto) return arg;
22865
23874
  return null;
22866
23875
  }
22867
- var toggle = (id, label2, glyph, shortcut, read, patch) => editing({
23876
+ var toggle = (id, label3, glyph, shortcut, read, patch2) => editing({
22868
23877
  id,
22869
- label: label2,
23878
+ label: label3,
22870
23879
  icon: icon(glyph),
22871
23880
  shortcut,
22872
23881
  lock: "formatCells",
22873
23882
  checked: read,
22874
- run: (ctx) => style(ctx, patch(!read(ctx)))
23883
+ run: (ctx) => style(ctx, patch2(!read(ctx)))
22875
23884
  });
22876
23885
  var BORDER_PRESETS = [
22877
23886
  ["bottom", "Bottom Border", "borderBottom"],
@@ -23051,10 +24060,10 @@ var mergedAtActive = (ctx) => {
23051
24060
  const t = target(ctx);
23052
24061
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
23053
24062
  };
23054
- function mergeCommand(id, label2, mode) {
24063
+ function mergeCommand(id, label3, mode) {
23055
24064
  return editing({
23056
24065
  id,
23057
- label: label2,
24066
+ label: label3,
23058
24067
  icon: icon("mergeCenter"),
23059
24068
  lock: "formatCells",
23060
24069
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -23069,30 +24078,30 @@ function mergeCommand(id, label2, mode) {
23069
24078
  }
23070
24079
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
23071
24080
  const ok = await ctx.dialogs.open("confirm", {
23072
- heading: label2,
24081
+ heading: label3,
23073
24082
  message: "Merging cells only keeps the upper-left value and discards other values."
23074
24083
  });
23075
24084
  if (ok !== true) return;
23076
24085
  if (ctx.session() !== t.session || ctx.readOnly()) return;
23077
24086
  }
23078
- t.session.batch(label2, () => {
24087
+ t.session.batch(label3, () => {
23079
24088
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
23080
24089
  });
23081
24090
  }
23082
24091
  });
23083
24092
  }
23084
24093
  function alignmentCommands() {
23085
- const valign = (id, label2, value2, glyph) => editing({
24094
+ const valign = (id, label3, value2, glyph) => editing({
23086
24095
  id,
23087
- label: label2,
24096
+ label: label3,
23088
24097
  icon: icon(glyph),
23089
24098
  lock: "formatCells",
23090
24099
  checked: (ctx) => vertical(ctx) === value2,
23091
24100
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
23092
24101
  });
23093
- const halign = (id, label2, value2, glyph) => editing({
24102
+ const halign = (id, label3, value2, glyph) => editing({
23094
24103
  id,
23095
- label: label2,
24104
+ label: label3,
23096
24105
  icon: icon(glyph),
23097
24106
  lock: "formatCells",
23098
24107
  checked: (ctx) => horizontal(ctx) === value2,
@@ -24476,6 +25485,24 @@ var MESSAGE_STRINGS = {
24476
25485
 
24477
25486
  // xlsx/ui/commands/i18n/navigation.ts
24478
25487
  var NAVIGATION_STRINGS = {
25488
+ "Sparklines (create, format and clear)": [
25489
+ "Graphiques sparkline (cr\xE9ation, mise en forme et suppression)",
25490
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
25491
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
25492
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u683C\u5F0F\u8BBE\u7F6E\u548C\u6E05\u9664\uFF09"
25493
+ ],
25494
+ "Worksheet-range PivotTables (one row field, optional column field and one value field)": [
25495
+ "Tableaux crois\xE9s dynamiques de plages (un champ de ligne, un champ de colonne facultatif et un champ de valeur)",
25496
+ "PivotTables aus Arbeitsblattbereichen (ein Zeilenfeld, optionales Spaltenfeld und ein Wertfeld)",
25497
+ "Tablas din\xE1micas de rangos (un campo de fila, columna opcional y un valor)",
25498
+ "\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"
25499
+ ],
25500
+ "Advanced PivotTable layouts, grouping and external data sources (preserved)": [
25501
+ "Dispositions avanc\xE9es, regroupements et sources externes de tableaux crois\xE9s dynamiques (conserv\xE9s)",
25502
+ "Erweiterte PivotTable-Layouts, Gruppierung und externe Datenquellen (erhalten)",
25503
+ "Dise\xF1os avanzados, agrupaci\xF3n y fuentes externas de tablas din\xE1micas (conservados)",
25504
+ "\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u5E03\u5C40\u3001\u5206\u7EC4\u548C\u5916\u90E8\u6570\u636E\u6E90\uFF08\u4FDD\u7559\uFF09"
25505
+ ],
24479
25506
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
24480
25507
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
24481
25508
  Close: ["Fermer", "Schlie\xDFen", "Cerrar", "\u5173\u95ED"],
@@ -26612,6 +27639,149 @@ var RIBBON_TAB_STRINGS = {
26612
27639
 
26613
27640
  // xlsx/ui/commands/i18n/tools.ts
26614
27641
  var TOOLS_STRINGS = {
27642
+ Bold: RIBBON_HOME_STRINGS.Bold,
27643
+ Italic: RIBBON_HOME_STRINGS.Italic,
27644
+ Underline: RIBBON_HOME_STRINGS.Underline,
27645
+ Strikethrough: RIBBON_HOME_STRINGS.Strikethrough,
27646
+ "Insert Formatting": [
27647
+ "Ins\xE9rer une mise en forme",
27648
+ "Formatierung einf\xFCgen",
27649
+ "Insertar formato",
27650
+ "\u63D2\u5165\u683C\u5F0F"
27651
+ ],
27652
+ 'Formatting: &B bold, &I italic, &U underline, &S strike, &18 font size, &KFF0000 RGB color, &"Arial,Regular" font.': [
27653
+ 'Format : &B gras, &I italique, &U soulign\xE9, &S barr\xE9, &18 taille, &KFF0000 couleur RVB, &"Arial,Regular" police.',
27654
+ 'Format: &B fett, &I kursiv, &U unterstrichen, &S durchgestrichen, &18 Schriftgr\xF6\xDFe, &KFF0000 RGB-Farbe, &"Arial,Regular" Schriftart.',
27655
+ 'Formato: &B negrita, &I cursiva, &U subrayado, &S tachado, &18 tama\xF1o, &KFF0000 color RGB, &"Arial,Regular" fuente.',
27656
+ '\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'
27657
+ ],
27658
+ "Date Range (optional):": [
27659
+ "Plage de dates (facultative) :",
27660
+ "Datumsbereich (optional):",
27661
+ "Rango de fechas (opcional):",
27662
+ "\u65E5\u671F\u8303\u56F4\uFF08\u53EF\u9009\uFF09\uFF1A"
27663
+ ],
27664
+ "Leave the date range empty for a general axis.": [
27665
+ "Laissez la plage de dates vide pour un axe g\xE9n\xE9ral.",
27666
+ "F\xFCr eine allgemeine Achse den Datumsbereich leer lassen.",
27667
+ "Deje vac\xEDo el rango de fechas para un eje general.",
27668
+ "\u5C06\u65E5\u671F\u8303\u56F4\u7559\u7A7A\u4EE5\u4F7F\u7528\u5E38\u89C4\u5750\u6807\u8F74\u3002"
27669
+ ],
27670
+ Time: ["Heure", "Zeit", "Hora", "\u65F6\u95F4"],
27671
+ "First Page Header:": [
27672
+ "En-t\xEAte de premi\xE8re page :",
27673
+ "Kopfzeile der ersten Seite:",
27674
+ "Encabezado de primera p\xE1gina:",
27675
+ "\u9996\u9875\u9875\u7709\uFF1A"
27676
+ ],
27677
+ "First Page Footer:": [
27678
+ "Pied de premi\xE8re page :",
27679
+ "Fu\xDFzeile der ersten Seite:",
27680
+ "Pie de primera p\xE1gina:",
27681
+ "\u9996\u9875\u9875\u811A\uFF1A"
27682
+ ],
27683
+ "Even Page Header:": [
27684
+ "En-t\xEAte des pages paires :",
27685
+ "Kopfzeile gerader Seiten:",
27686
+ "Encabezado de p\xE1ginas pares:",
27687
+ "\u5076\u6570\u9875\u9875\u7709\uFF1A"
27688
+ ],
27689
+ "Even Page Footer:": [
27690
+ "Pied des pages paires :",
27691
+ "Fu\xDFzeile gerader Seiten:",
27692
+ "Pie de p\xE1ginas pares:",
27693
+ "\u5076\u6570\u9875\u9875\u811A\uFF1A"
27694
+ ],
27695
+ "Different first page": [
27696
+ "Premi\xE8re page diff\xE9rente",
27697
+ "Erste Seite anders",
27698
+ "Primera p\xE1gina diferente",
27699
+ "\u9996\u9875\u4E0D\u540C"
27700
+ ],
27701
+ "Different odd and even pages": [
27702
+ "Pages paires et impaires diff\xE9rentes",
27703
+ "Gerade und ungerade Seiten unterschiedlich",
27704
+ "P\xE1ginas pares e impares diferentes",
27705
+ "\u5947\u5076\u9875\u4E0D\u540C"
27706
+ ],
27707
+ "Scale header and footer with document": [
27708
+ "Mettre l\u2019en-t\xEAte et le pied \xE0 l\u2019\xE9chelle du document",
27709
+ "Kopf- und Fu\xDFzeile mit Dokument skalieren",
27710
+ "Escalar encabezado y pie con el documento",
27711
+ "\u968F\u6587\u6863\u7F29\u653E\u9875\u7709\u548C\u9875\u811A"
27712
+ ],
27713
+ "Align header and footer with margins": [
27714
+ "Aligner l\u2019en-t\xEAte et le pied sur les marges",
27715
+ "Kopf- und Fu\xDFzeile an R\xE4ndern ausrichten",
27716
+ "Alinear encabezado y pie con los m\xE1rgenes",
27717
+ "\u5C06\u9875\u7709\u548C\u9875\u811A\u4E0E\u9875\u8FB9\u8DDD\u5BF9\u9F50"
27718
+ ],
27719
+ "Insert Field": ["Ins\xE9rer un champ", "Feld einf\xFCgen", "Insertar campo", "\u63D2\u5165\u5B57\u6BB5"],
27720
+ "Page Number": ["Num\xE9ro de page", "Seitenzahl", "N\xFAmero de p\xE1gina", "\u9875\u7801"],
27721
+ "Total Pages": ["Nombre de pages", "Gesamtseitenzahl", "Total de p\xE1ginas", "\u603B\u9875\u6570"],
27722
+ "Sheet Name": ["Nom de feuille", "Blattname", "Nombre de hoja", "\u5DE5\u4F5C\u8868\u540D\u79F0"],
27723
+ "File Name": ["Nom de fichier", "Dateiname", "Nombre de archivo", "\u6587\u4EF6\u540D"],
27724
+ "Rows to repeat at top": [
27725
+ "Lignes \xE0 r\xE9p\xE9ter en haut",
27726
+ "Wiederholungszeilen oben",
27727
+ "Filas a repetir arriba",
27728
+ "\u9876\u7AEF\u6807\u9898\u884C"
27729
+ ],
27730
+ "Columns to repeat at left": [
27731
+ "Colonnes \xE0 r\xE9p\xE9ter \xE0 gauche",
27732
+ "Wiederholungsspalten links",
27733
+ "Columnas a repetir a la izquierda",
27734
+ "\u5DE6\u7AEF\u6807\u9898\u5217"
27735
+ ],
27736
+ "Use first page number": [
27737
+ "Utiliser le premier num\xE9ro de page",
27738
+ "Erste Seitenzahl verwenden",
27739
+ "Usar primer n\xFAmero de p\xE1gina",
27740
+ "\u4F7F\u7528\u8D77\u59CB\u9875\u7801"
27741
+ ],
27742
+ "First page number": [
27743
+ "Premier num\xE9ro de page",
27744
+ "Erste Seitenzahl",
27745
+ "Primer n\xFAmero de p\xE1gina",
27746
+ "\u8D77\u59CB\u9875\u7801"
27747
+ ],
27748
+ "Enter a first page number between 0 and 32767.": [
27749
+ "Entrez un premier num\xE9ro entre 0 et 32767.",
27750
+ "Geben Sie eine erste Seitenzahl zwischen 0 und 32767 ein.",
27751
+ "Introduzca un primer n\xFAmero entre 0 y 32767.",
27752
+ "\u8BF7\u8F93\u5165 0 \u5230 32767 \u4E4B\u95F4\u7684\u8D77\u59CB\u9875\u7801\u3002"
27753
+ ],
27754
+ "Print titles must be whole rows or whole columns.": [
27755
+ "Les titres doivent \xEAtre des lignes ou colonnes enti\xE8res.",
27756
+ "Drucktitel m\xFCssen ganze Zeilen oder Spalten sein.",
27757
+ "Los t\xEDtulos deben ser filas o columnas completas.",
27758
+ "\u6253\u5370\u6807\u9898\u5FC5\u987B\u4E3A\u6574\u884C\u6216\u6574\u5217\u3002"
27759
+ ],
27760
+ "Existing print titles are unsupported. Changing a title range replaces them; leaving the fields unchanged preserves them.": [
27761
+ "Les titres existants ne sont pas pris en charge. Modifier une plage les remplace ; conserver les champs les pr\xE9serve.",
27762
+ "Vorhandene Drucktitel werden nicht unterst\xFCtzt. Eine Bereichs\xE4nderung ersetzt sie; unver\xE4nderte Felder bewahren sie.",
27763
+ "Los t\xEDtulos existentes no son compatibles. Cambiar un rango los reemplaza; dejar los campos sin cambios los conserva.",
27764
+ "\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"
27765
+ ],
27766
+ "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.": [
27767
+ "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.",
27768
+ "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.",
27769
+ "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.",
27770
+ "\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"
27771
+ ],
27772
+ "Page order": ["Ordre des pages", "Seitenreihenfolge", "Orden de p\xE1ginas", "\u9875\u5E8F"],
27773
+ "Down, then over": [
27774
+ "Vers le bas, puis \xE0 droite",
27775
+ "Nach unten, dann nach rechts",
27776
+ "Hacia abajo, luego a la derecha",
27777
+ "\u5148\u5411\u4E0B\uFF0C\u518D\u5411\u53F3"
27778
+ ],
27779
+ "Over, then down": [
27780
+ "\xC0 droite, puis vers le bas",
27781
+ "Nach rechts, dann nach unten",
27782
+ "A la derecha, luego hacia abajo",
27783
+ "\u5148\u5411\u53F3\uFF0C\u518D\u5411\u4E0B"
27784
+ ],
26615
27785
  // Insert Chart
26616
27786
  "Insert Chart": ["Ins\xE9rer un graphique", "Diagramm einf\xFCgen", "Insertar gr\xE1fico", "\u63D2\u5165\u56FE\u8868"],
26617
27787
  "Change Chart Type": [
@@ -27080,6 +28250,508 @@ var TOOLS_STRINGS = {
27080
28250
  ]
27081
28251
  };
27082
28252
 
28253
+ // xlsx/ui/commands/i18n/sparklines.ts
28254
+ var SPARKLINE_STRINGS = {
28255
+ Mixed: ["Mixte", "Gemischt", "Mixto", "\u6DF7\u5408"],
28256
+ "Only changed settings are applied.": [
28257
+ "Seuls les param\xE8tres modifi\xE9s sont appliqu\xE9s.",
28258
+ "Nur ge\xE4nderte Einstellungen werden angewendet.",
28259
+ "Solo se aplica la configuraci\xF3n modificada.",
28260
+ "\u4EC5\u5E94\u7528\u5DF2\u66F4\u6539\u7684\u8BBE\u7F6E\u3002"
28261
+ ],
28262
+ "Colors vary between selected groups.": [
28263
+ "Les couleurs varient entre les groupes s\xE9lectionn\xE9s.",
28264
+ "Die Farben der ausgew\xE4hlten Gruppen unterscheiden sich.",
28265
+ "Los colores var\xEDan entre los grupos seleccionados.",
28266
+ "\u9009\u5B9A\u7EC4\u7684\u989C\u8272\u4E0D\u540C\u3002"
28267
+ ],
28268
+ Markers: ["Marqueurs", "Markierungen", "Marcadores", "\u6807\u8BB0"],
28269
+ Gaps: ["Espaces", "L\xFCcken", "Huecos", "\u95F4\u9699"],
28270
+ Zero: ["Z\xE9ro", "Null", "Cero", "\u96F6"],
28271
+ Axis: ["Axe", "Achse", "Eje", "\u5750\u6807\u8F74"],
28272
+ "Sparklines (create, format and clear)": [
28273
+ "Graphiques sparkline (cr\xE9er, mettre en forme et effacer)",
28274
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
28275
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
28276
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u8BBE\u7F6E\u683C\u5F0F\u548C\u6E05\u9664\uFF09"
28277
+ ],
28278
+ "Charts and sparklines support editing; pivot tables, macros and other unsupported parts are kept in the file but not shown.": [
28279
+ "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.",
28280
+ "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.",
28281
+ "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.",
28282
+ "\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"
28283
+ ],
28284
+ Sparklines: ["Graphiques sparkline", "Sparklines", "Minigr\xE1ficos", "\u8FF7\u4F60\u56FE"],
28285
+ "Line Sparkline": [
28286
+ "Sparkline en courbe",
28287
+ "Linien-Sparkline",
28288
+ "Minigr\xE1fico de l\xEDnea",
28289
+ "\u6298\u7EBF\u8FF7\u4F60\u56FE"
28290
+ ],
28291
+ "Column Sparkline": [
28292
+ "Sparkline en colonnes",
28293
+ "S\xE4ulen-Sparkline",
28294
+ "Minigr\xE1fico de columna",
28295
+ "\u67F1\u5F62\u8FF7\u4F60\u56FE"
28296
+ ],
28297
+ "Win/Loss Sparkline": [
28298
+ "Sparkline gains/pertes",
28299
+ "Gewinn/Verlust-Sparkline",
28300
+ "Minigr\xE1fico de ganancias y p\xE9rdidas",
28301
+ "\u76C8\u4E8F\u8FF7\u4F60\u56FE"
28302
+ ],
28303
+ "Win/Loss": ["Gains/pertes", "Gewinn/Verlust", "Ganancias y p\xE9rdidas", "\u76C8\u4E8F"],
28304
+ "Create Sparklines": [
28305
+ "Cr\xE9er des graphiques sparkline",
28306
+ "Sparklines erstellen",
28307
+ "Crear minigr\xE1ficos",
28308
+ "\u521B\u5EFA\u8FF7\u4F60\u56FE"
28309
+ ],
28310
+ "Sparkline Settings": [
28311
+ "Param\xE8tres des graphiques sparkline",
28312
+ "Sparkline-Einstellungen",
28313
+ "Configuraci\xF3n de minigr\xE1ficos",
28314
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E"
28315
+ ],
28316
+ "Data Range:": ["Plage de donn\xE9es :", "Datenbereich:", "Rango de datos:", "\u6570\u636E\u8303\u56F4\uFF1A"],
28317
+ "Location Range:": [
28318
+ "Plage d\u2019emplacement :",
28319
+ "Positionsbereich:",
28320
+ "Rango de ubicaci\xF3n:",
28321
+ "\u4F4D\u7F6E\u8303\u56F4\uFF1A"
28322
+ ],
28323
+ "Sparkline Type:": [
28324
+ "Type de sparkline :",
28325
+ "Sparkline-Typ:",
28326
+ "Tipo de minigr\xE1fico:",
28327
+ "\u8FF7\u4F60\u56FE\u7C7B\u578B\uFF1A"
28328
+ ],
28329
+ "Line Weight:": ["\xC9paisseur du trait :", "Linienst\xE4rke:", "Grosor de l\xEDnea:", "\u7EBF\u6761\u7C97\u7EC6\uFF1A"],
28330
+ "Changes apply to the entire selected sparkline groups.": [
28331
+ "Les modifications s\u2019appliquent \xE0 tous les groupes de graphiques sparkline s\xE9lectionn\xE9s.",
28332
+ "\xC4nderungen gelten f\xFCr die gesamten ausgew\xE4hlten Sparkline-Gruppen.",
28333
+ "Los cambios se aplican a todos los grupos de minigr\xE1ficos seleccionados.",
28334
+ "\u66F4\u6539\u5E94\u7528\u4E8E\u6574\u4E2A\u9009\u5B9A\u7684\u8FF7\u4F60\u56FE\u7EC4\u3002"
28335
+ ],
28336
+ "High Point": ["Point haut", "H\xF6chstpunkt", "Punto alto", "\u9AD8\u70B9"],
28337
+ "Low Point": ["Point bas", "Tiefstpunkt", "Punto bajo", "\u4F4E\u70B9"],
28338
+ "First Point": ["Premier point", "Erster Punkt", "Primer punto", "\u9996\u70B9"],
28339
+ "Last Point": ["Dernier point", "Letzter Punkt", "\xDAltimo punto", "\u672B\u70B9"],
28340
+ "Negative Points": ["Points n\xE9gatifs", "Negative Punkte", "Puntos negativos", "\u8D1F\u503C\u70B9"],
28341
+ "Sparkline Color:": [
28342
+ "Couleur du sparkline :",
28343
+ "Sparkline-Farbe:",
28344
+ "Color del minigr\xE1fico:",
28345
+ "\u8FF7\u4F60\u56FE\u989C\u8272\uFF1A"
28346
+ ],
28347
+ "Negative Color:": [
28348
+ "Couleur n\xE9gative :",
28349
+ "Farbe f\xFCr negative Werte:",
28350
+ "Color negativo:",
28351
+ "\u8D1F\u503C\u989C\u8272\uFF1A"
28352
+ ],
28353
+ "Minimum Axis:": ["Axe minimum :", "Achsenminimum:", "Eje m\xEDnimo:", "\u6700\u5C0F\u5750\u6807\u8F74\uFF1A"],
28354
+ "Maximum Axis:": ["Axe maximum :", "Achsenmaximum:", "Eje m\xE1ximo:", "\u6700\u5927\u5750\u6807\u8F74\uFF1A"],
28355
+ "Minimum Value:": ["Valeur minimum :", "Mindestwert:", "Valor m\xEDnimo:", "\u6700\u5C0F\u503C\uFF1A"],
28356
+ "Maximum Value:": ["Valeur maximum :", "H\xF6chstwert:", "Valor m\xE1ximo:", "\u6700\u5927\u503C\uFF1A"],
28357
+ Individual: ["Individuel", "Individuell", "Individual", "\u5355\u72EC"],
28358
+ "Same for all sparklines": [
28359
+ "Identique pour tous les graphiques sparkline",
28360
+ "F\xFCr alle Sparklines gleich",
28361
+ "Igual para todos los minigr\xE1ficos",
28362
+ "\u6240\u6709\u8FF7\u4F60\u56FE\u76F8\u540C"
28363
+ ],
28364
+ "Empty Cells:": ["Cellules vides :", "Leere Zellen:", "Celdas vac\xEDas:", "\u7A7A\u5355\u5143\u683C\uFF1A"],
28365
+ "Connect data points": [
28366
+ "Relier les points de donn\xE9es",
28367
+ "Datenpunkte verbinden",
28368
+ "Conectar puntos de datos",
28369
+ "\u8FDE\u63A5\u6570\u636E\u70B9"
28370
+ ],
28371
+ "Show data in hidden rows and columns": [
28372
+ "Afficher les donn\xE9es des lignes et colonnes masqu\xE9es",
28373
+ "Daten in ausgeblendeten Zeilen und Spalten anzeigen",
28374
+ "Mostrar datos en filas y columnas ocultas",
28375
+ "\u663E\u793A\u9690\u85CF\u884C\u548C\u5217\u4E2D\u7684\u6570\u636E"
28376
+ ],
28377
+ "Show horizontal axis": [
28378
+ "Afficher l\u2019axe horizontal",
28379
+ "Horizontale Achse anzeigen",
28380
+ "Mostrar eje horizontal",
28381
+ "\u663E\u793A\u6C34\u5E73\u5750\u6807\u8F74"
28382
+ ],
28383
+ "Plot right to left": [
28384
+ "Tracer de droite \xE0 gauche",
28385
+ "Von rechts nach links zeichnen",
28386
+ "Trazar de derecha a izquierda",
28387
+ "\u4ECE\u53F3\u5411\u5DE6\u7ED8\u5236"
28388
+ ],
28389
+ "Clear Sparklines": [
28390
+ "Effacer les graphiques sparkline",
28391
+ "Sparklines l\xF6schen",
28392
+ "Borrar minigr\xE1ficos",
28393
+ "\u6E05\u9664\u8FF7\u4F60\u56FE"
28394
+ ],
28395
+ "Clear Selected Sparklines": [
28396
+ "Effacer les graphiques sparkline s\xE9lectionn\xE9s",
28397
+ "Ausgew\xE4hlte Sparklines l\xF6schen",
28398
+ "Borrar minigr\xE1ficos seleccionados",
28399
+ "\u6E05\u9664\u9009\u5B9A\u8FF7\u4F60\u56FE"
28400
+ ],
28401
+ "Clear Sparkline Groups": [
28402
+ "Effacer les groupes de graphiques sparkline",
28403
+ "Sparkline-Gruppen l\xF6schen",
28404
+ "Borrar grupos de minigr\xE1ficos",
28405
+ "\u6E05\u9664\u8FF7\u4F60\u56FE\u7EC4"
28406
+ ],
28407
+ "The data range and location range do not match.": [
28408
+ "La plage de donn\xE9es et la plage d\u2019emplacement ne correspondent pas.",
28409
+ "Datenbereich und Positionsbereich stimmen nicht \xFCberein.",
28410
+ "El rango de datos y el rango de ubicaci\xF3n no coinciden.",
28411
+ "\u6570\u636E\u8303\u56F4\u548C\u4F4D\u7F6E\u8303\u56F4\u4E0D\u5339\u914D\u3002"
28412
+ ],
28413
+ "The sparkline location range is too large.": [
28414
+ "La plage d\u2019emplacement des graphiques sparkline est trop grande.",
28415
+ "Der Sparkline-Positionsbereich ist zu gro\xDF.",
28416
+ "El rango de ubicaci\xF3n del minigr\xE1fico es demasiado grande.",
28417
+ "\u8FF7\u4F60\u56FE\u4F4D\u7F6E\u8303\u56F4\u8FC7\u5927\u3002"
28418
+ ],
28419
+ "The location range already contains sparklines.": [
28420
+ "La plage d\u2019emplacement contient d\xE9j\xE0 des graphiques sparkline.",
28421
+ "Der Positionsbereich enth\xE4lt bereits Sparklines.",
28422
+ "El rango de ubicaci\xF3n ya contiene minigr\xE1ficos.",
28423
+ "\u4F4D\u7F6E\u8303\u56F4\u5DF2\u5305\u542B\u8FF7\u4F60\u56FE\u3002"
28424
+ ],
28425
+ "Sparklines cannot be created in merged cells.": [
28426
+ "Impossible de cr\xE9er des graphiques sparkline dans des cellules fusionn\xE9es.",
28427
+ "Sparklines k\xF6nnen nicht in verbundenen Zellen erstellt werden.",
28428
+ "No se pueden crear minigr\xE1ficos en celdas combinadas.",
28429
+ "\u65E0\u6CD5\u5728\u5408\u5E76\u5355\u5143\u683C\u4E2D\u521B\u5EFA\u8FF7\u4F60\u56FE\u3002"
28430
+ ],
28431
+ "The sparkline settings are not valid.": [
28432
+ "Les param\xE8tres des graphiques sparkline ne sont pas valides.",
28433
+ "Die Sparkline-Einstellungen sind ung\xFCltig.",
28434
+ "La configuraci\xF3n del minigr\xE1fico no es v\xE1lida.",
28435
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E\u65E0\u6548\u3002"
28436
+ ],
28437
+ "The sparkline axis limits are not valid.": [
28438
+ "Les limites d\u2019axe des graphiques sparkline ne sont pas valides.",
28439
+ "Die Sparkline-Achsengrenzen sind ung\xFCltig.",
28440
+ "Los l\xEDmites del eje del minigr\xE1fico no son v\xE1lidos.",
28441
+ "\u8FF7\u4F60\u56FE\u5750\u6807\u8F74\u754C\u9650\u65E0\u6548\u3002"
28442
+ ]
28443
+ };
28444
+
28445
+ // xlsx/ui/commands/i18n/pivots.ts
28446
+ var PIVOT_STRINGS = {
28447
+ "Compact Form": ["Forme compacte", "Kompaktformat", "Formato compacto", "\u538B\u7F29\u5F62\u5F0F"],
28448
+ "Outline Form": ["Forme de plan", "Gliederungsformat", "Formato de esquema", "\u5927\u7EB2\u5F62\u5F0F"],
28449
+ "Tabular Form": ["Forme tabulaire", "Tabellenformat", "Formato tabular", "\u8868\u683C\u5F62\u5F0F"],
28450
+ "Report Layout:": [
28451
+ "Disposition du rapport :",
28452
+ "Berichtslayout:",
28453
+ "Dise\xF1o del informe:",
28454
+ "\u62A5\u8868\u5E03\u5C40\uFF1A"
28455
+ ],
28456
+ "Subtotal Position:": [
28457
+ "Position des sous-totaux :",
28458
+ "Position der Teilergebnisse:",
28459
+ "Posici\xF3n de subtotales:",
28460
+ "\u5206\u7C7B\u6C47\u603B\u4F4D\u7F6E\uFF1A"
28461
+ ],
28462
+ "Above each group": [
28463
+ "Au-dessus de chaque groupe",
28464
+ "\xDCber jeder Gruppe",
28465
+ "Encima de cada grupo",
28466
+ "\u6BCF\u7EC4\u4E0A\u65B9"
28467
+ ],
28468
+ "Below each group": [
28469
+ "Sous chaque groupe",
28470
+ "Unter jeder Gruppe",
28471
+ "Debajo de cada grupo",
28472
+ "\u6BCF\u7EC4\u4E0B\u65B9"
28473
+ ],
28474
+ "Show subtotals": [
28475
+ "Afficher les sous-totaux",
28476
+ "Teilergebnisse anzeigen",
28477
+ "Mostrar subtotales",
28478
+ "\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28479
+ ],
28480
+ "Tabular layout displays subtotals below groups.": [
28481
+ "La disposition tabulaire affiche les sous-totaux sous les groupes.",
28482
+ "Das tabellarische Layout zeigt Teilergebnisse unter den Gruppen.",
28483
+ "El dise\xF1o tabular muestra subtotales debajo de los grupos.",
28484
+ "\u8868\u683C\u5E03\u5C40\u5728\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B\u3002"
28485
+ ],
28486
+ "Second Row Field:": [
28487
+ "Deuxi\xE8me champ de ligne :",
28488
+ "Zweites Zeilenfeld:",
28489
+ "Segundo campo de fila:",
28490
+ "\u7B2C\u4E8C\u884C\u5B57\u6BB5\uFF1A"
28491
+ ],
28492
+ "Show subtotals below each group": [
28493
+ "Afficher les sous-totaux sous chaque groupe",
28494
+ "Teilergebnisse unter jeder Gruppe anzeigen",
28495
+ "Mostrar subtotales debajo de cada grupo",
28496
+ "\u5728\u6BCF\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28497
+ ],
28498
+ "Repeat row labels": [
28499
+ "R\xE9p\xE9ter les \xE9tiquettes de ligne",
28500
+ "Zeilenbeschriftungen wiederholen",
28501
+ "Repetir etiquetas de fila",
28502
+ "\u91CD\u590D\u884C\u6807\u7B7E"
28503
+ ],
28504
+ "Charts, sparklines and worksheet-range PivotTables support editing. Advanced PivotTables, macros and other unsupported parts are preserved.": [
28505
+ "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.",
28506
+ "Diagramme, Sparklines und PivotTables aus Arbeitsblattbereichen k\xF6nnen bearbeitet werden. Erweiterte PivotTables, Makros und andere nicht unterst\xFCtzte Teile bleiben erhalten.",
28507
+ "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.",
28508
+ "\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"
28509
+ ],
28510
+ PivotTable: ["Tableau crois\xE9 dynamique", "PivotTable", "Tabla din\xE1mica", "\u6570\u636E\u900F\u89C6\u8868"],
28511
+ "Create PivotTable": [
28512
+ "Cr\xE9er un tableau crois\xE9 dynamique",
28513
+ "PivotTable erstellen",
28514
+ "Crear tabla din\xE1mica",
28515
+ "\u521B\u5EFA\u6570\u636E\u900F\u89C6\u8868"
28516
+ ],
28517
+ "PivotTable Settings": [
28518
+ "Param\xE8tres du tableau crois\xE9 dynamique",
28519
+ "PivotTable-Einstellungen",
28520
+ "Configuraci\xF3n de tabla din\xE1mica",
28521
+ "\u6570\u636E\u900F\u89C6\u8868\u8BBE\u7F6E"
28522
+ ],
28523
+ "Refresh PivotTable": [
28524
+ "Actualiser le tableau crois\xE9 dynamique",
28525
+ "PivotTable aktualisieren",
28526
+ "Actualizar tabla din\xE1mica",
28527
+ "\u5237\u65B0\u6570\u636E\u900F\u89C6\u8868"
28528
+ ],
28529
+ "Delete PivotTable": [
28530
+ "Supprimer le tableau crois\xE9 dynamique",
28531
+ "PivotTable l\xF6schen",
28532
+ "Eliminar tabla din\xE1mica",
28533
+ "\u5220\u9664\u6570\u636E\u900F\u89C6\u8868"
28534
+ ],
28535
+ "Source Range:": ["Plage source :", "Quellbereich:", "Rango de origen:", "\u6E90\u533A\u57DF\uFF1A"],
28536
+ "Destination Cell:": [
28537
+ "Cellule de destination :",
28538
+ "Zielzelle:",
28539
+ "Celda de destino:",
28540
+ "\u76EE\u6807\u5355\u5143\u683C\uFF1A"
28541
+ ],
28542
+ "Row Field:": ["Champ de ligne :", "Zeilenfeld:", "Campo de fila:", "\u884C\u5B57\u6BB5\uFF1A"],
28543
+ "Column Field:": ["Champ de colonne :", "Spaltenfeld:", "Campo de columna:", "\u5217\u5B57\u6BB5\uFF1A"],
28544
+ "Value Field:": ["Champ de valeur :", "Wertfeld:", "Campo de valor:", "\u503C\u5B57\u6BB5\uFF1A"],
28545
+ "Summarize Values By:": [
28546
+ "Synth\xE9tiser les valeurs par :",
28547
+ "Werte zusammenfassen nach:",
28548
+ "Resumir valores por:",
28549
+ "\u503C\u6C47\u603B\u65B9\u5F0F\uFF1A"
28550
+ ],
28551
+ "(None)": ["(Aucun)", "(Keine)", "(Ninguno)", "\uFF08\u65E0\uFF09"]
28552
+ };
28553
+
28554
+ // xlsx/ui/commands/i18n/print-layout.ts
28555
+ var PRINT_LAYOUT_STRINGS = {
28556
+ "Unsupported header/footer codes are preserved but not rendered.": [
28557
+ "Les codes d\u2019en-t\xEAte et pied non pris en charge sont conserv\xE9s mais non rendus.",
28558
+ "Nicht unterst\xFCtzte Kopf- und Fu\xDFzeilencodes bleiben erhalten, werden aber nicht dargestellt.",
28559
+ "Se conservan los c\xF3digos no compatibles del encabezado y pie, pero no se muestran.",
28560
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u4EE3\u7801\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28561
+ ],
28562
+ "Browser printing includes page setup, manual breaks, leading print titles and header/footer fields. Drawings and unsupported formatting are preserved but not rendered.": [
28563
+ "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.",
28564
+ "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.",
28565
+ "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.",
28566
+ "\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"
28567
+ ],
28568
+ "Non-leading or unsupported print titles are preserved but not rendered.": [
28569
+ "Les titres non plac\xE9s en t\xEAte ou non pris en charge sont conserv\xE9s mais non rendus.",
28570
+ "Nicht f\xFChrende oder nicht unterst\xFCtzte Drucktitel bleiben erhalten, werden aber nicht dargestellt.",
28571
+ "Se conservan los t\xEDtulos no iniciales o no compatibles, pero no se muestran.",
28572
+ "\u4FDD\u7559\u975E\u8D77\u59CB\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28573
+ ],
28574
+ "Print title ranges are too large for preview.": [
28575
+ "Les plages de titres sont trop grandes pour l\u2019aper\xE7u.",
28576
+ "Die Drucktitelbereiche sind f\xFCr die Vorschau zu gro\xDF.",
28577
+ "Los rangos de t\xEDtulos son demasiado grandes para la vista previa.",
28578
+ "\u6253\u5370\u6807\u9898\u533A\u57DF\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\u3002"
28579
+ ],
28580
+ "Repeated titles leave no room for worksheet data.": [
28581
+ "Les titres r\xE9p\xE9t\xE9s ne laissent pas de place aux donn\xE9es.",
28582
+ "Wiederholte Titel lassen keinen Platz f\xFCr Arbeitsblattdaten.",
28583
+ "Los t\xEDtulos repetidos no dejan espacio para los datos.",
28584
+ "\u91CD\u590D\u6807\u9898\u672A\u7ED9\u5DE5\u4F5C\u8868\u6570\u636E\u7559\u51FA\u7A7A\u95F4\u3002"
28585
+ ],
28586
+ "Preview does not render drawings.": [
28587
+ "L\u2019aper\xE7u ne rend pas les dessins.",
28588
+ "Die Vorschau stellt Zeichnungen nicht dar.",
28589
+ "La vista previa no muestra dibujos.",
28590
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3002"
28591
+ ],
28592
+ "Unsupported header or footer formatting and image fields are preserved but not rendered.": [
28593
+ "Les formats et champs d\u2019image non pris en charge des en-t\xEAtes et pieds sont conserv\xE9s mais non rendus.",
28594
+ "Nicht unterst\xFCtzte Formatierungen und Bildfelder in Kopf- und Fu\xDFzeilen bleiben erhalten, werden aber nicht dargestellt.",
28595
+ "Se conservan los formatos y campos de imagen no compatibles del encabezado y pie, pero no se muestran.",
28596
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u683C\u5F0F\u53CA\u56FE\u50CF\u5B57\u6BB5\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28597
+ ],
28598
+ "Merged print ranges are too large.": [
28599
+ "Les plages fusionn\xE9es \xE0 imprimer sont trop grandes.",
28600
+ "Die verbundenen Druckbereiche sind zu gro\xDF.",
28601
+ "Los rangos combinados de impresi\xF3n son demasiado grandes.",
28602
+ "\u5408\u5E76\u6253\u5370\u533A\u57DF\u8FC7\u5927\u3002"
28603
+ ],
28604
+ "Multiple or unsupported print areas are preserved; preview uses the worksheet used range.": [
28605
+ "Les zones d\u2019impression multiples ou non prises en charge sont conserv\xE9es ; l\u2019aper\xE7u utilise la plage utilis\xE9e de la feuille.",
28606
+ "Mehrere oder nicht unterst\xFCtzte Druckbereiche bleiben erhalten; die Vorschau verwendet den benutzten Arbeitsblattbereich.",
28607
+ "Se conservan las \xE1reas m\xFAltiples o no compatibles; la vista previa usa el rango utilizado de la hoja.",
28608
+ "\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"
28609
+ ],
28610
+ "Previous Page": ["Page pr\xE9c\xE9dente", "Vorherige Seite", "P\xE1gina anterior", "\u4E0A\u4E00\u9875"],
28611
+ "Next Page": ["Page suivante", "N\xE4chste Seite", "P\xE1gina siguiente", "\u4E0B\u4E00\u9875"],
28612
+ "Actual Size": ["Taille r\xE9elle", "Tats\xE4chliche Gr\xF6\xDFe", "Tama\xF1o real", "\u5B9E\u9645\u5927\u5C0F"],
28613
+ "Fit Page": ["Ajuster \xE0 la page", "Seite einpassen", "Ajustar p\xE1gina", "\u9002\u5408\u9875\u9762"],
28614
+ "Page {page} of {count}": [
28615
+ "Page {page} sur {count}",
28616
+ "Seite {page} von {count}",
28617
+ "P\xE1gina {page} de {count}",
28618
+ "\u7B2C {page} \u9875\uFF0C\u5171 {count} \u9875"
28619
+ ],
28620
+ "Repeated print titles are preserved but not rendered in preview.": [
28621
+ "Les titres d\u2019impression r\xE9p\xE9t\xE9s sont conserv\xE9s mais non rendus dans l\u2019aper\xE7u.",
28622
+ "Wiederholte Drucktitel bleiben erhalten, werden aber in der Vorschau nicht dargestellt.",
28623
+ "Se conservan los t\xEDtulos repetidos, pero no se muestran en la vista previa.",
28624
+ "\u4FDD\u7559\u91CD\u590D\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u663E\u793A\u3002"
28625
+ ],
28626
+ "Merged cells crossing pages are rendered separately on each page.": [
28627
+ "Les cellules fusionn\xE9es sur plusieurs pages sont rendues s\xE9par\xE9ment sur chaque page.",
28628
+ "Seiten\xFCbergreifende verbundene Zellen werden auf jeder Seite getrennt dargestellt.",
28629
+ "Las celdas combinadas entre p\xE1ginas se muestran por separado en cada p\xE1gina.",
28630
+ "\u8DE8\u9875\u5408\u5E76\u5355\u5143\u683C\u5C06\u5728\u6BCF\u9875\u5206\u522B\u663E\u793A\u3002"
28631
+ ],
28632
+ "Browser printing uses paper size, margins, scaling and manual page breaks. Drawings, headers, footers and repeated titles are not rendered.": [
28633
+ "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.",
28634
+ "Der Browserdruck verwendet Papierformat, R\xE4nder, Skalierung und manuelle Seitenumbr\xFCche. Zeichnungen, Kopf- und Fu\xDFzeilen sowie wiederholte Titel werden nicht dargestellt.",
28635
+ "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.",
28636
+ "\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"
28637
+ ],
28638
+ "Print Preview": [
28639
+ "Aper\xE7u avant impression",
28640
+ "Druckvorschau",
28641
+ "Vista previa de impresi\xF3n",
28642
+ "\u6253\u5370\u9884\u89C8"
28643
+ ],
28644
+ Breaks: ["Sauts", "Umbr\xFCche", "Saltos", "\u5206\u9875\u7B26"],
28645
+ "Insert Row Page Break": [
28646
+ "Ins\xE9rer un saut de page de ligne",
28647
+ "Zeilen-Seitenumbruch einf\xFCgen",
28648
+ "Insertar salto de p\xE1gina de fila",
28649
+ "\u63D2\u5165\u884C\u5206\u9875\u7B26"
28650
+ ],
28651
+ "Insert Column Page Break": [
28652
+ "Ins\xE9rer un saut de page de colonne",
28653
+ "Spalten-Seitenumbruch einf\xFCgen",
28654
+ "Insertar salto de p\xE1gina de columna",
28655
+ "\u63D2\u5165\u5217\u5206\u9875\u7B26"
28656
+ ],
28657
+ "Remove Row Page Break": [
28658
+ "Supprimer le saut de page de ligne",
28659
+ "Zeilen-Seitenumbruch entfernen",
28660
+ "Quitar salto de p\xE1gina de fila",
28661
+ "\u5220\u9664\u884C\u5206\u9875\u7B26"
28662
+ ],
28663
+ "Remove Column Page Break": [
28664
+ "Supprimer le saut de page de colonne",
28665
+ "Spalten-Seitenumbruch entfernen",
28666
+ "Quitar salto de p\xE1gina de columna",
28667
+ "\u5220\u9664\u5217\u5206\u9875\u7B26"
28668
+ ],
28669
+ "Reset All Page Breaks": [
28670
+ "R\xE9initialiser tous les sauts de page",
28671
+ "Alle Seitenumbr\xFCche zur\xFCcksetzen",
28672
+ "Restablecer todos los saltos de p\xE1gina",
28673
+ "\u91CD\u7F6E\u6240\u6709\u5206\u9875\u7B26"
28674
+ ],
28675
+ "Pages: {count} | Scale: {scale}%": [
28676
+ "Pages : {count} | \xC9chelle : {scale}%",
28677
+ "Seiten: {count} | Skalierung: {scale}%",
28678
+ "P\xE1ginas: {count} | Escala: {scale}%",
28679
+ "\u9875\u6570\uFF1A{count} | \u7F29\u653E\uFF1A{scale}%"
28680
+ ],
28681
+ "Preview uses worksheet dimensions. Fonts and printer margins may change pagination in Excel.": [
28682
+ "L\u2019aper\xE7u utilise les dimensions de la feuille. Les polices et marges de l\u2019imprimante peuvent modifier la pagination dans Excel.",
28683
+ "Die Vorschau verwendet die Arbeitsblattma\xDFe. Schriftarten und Druckerr\xE4nder k\xF6nnen die Seitenaufteilung in Excel \xE4ndern.",
28684
+ "La vista previa usa las dimensiones de la hoja. Las fuentes y los m\xE1rgenes de impresora pueden cambiar la paginaci\xF3n en Excel.",
28685
+ "\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"
28686
+ ],
28687
+ "Fit to pages ignores manual page breaks.": [
28688
+ "L\u2019ajustement aux pages ignore les sauts manuels.",
28689
+ "Beim Anpassen an Seiten werden manuelle Umbr\xFCche ignoriert.",
28690
+ "Ajustar a p\xE1ginas ignora los saltos manuales.",
28691
+ "\u8C03\u6574\u4E3A\u6307\u5B9A\u9875\u6570\u65F6\u5FFD\u7565\u624B\u52A8\u5206\u9875\u7B26\u3002"
28692
+ ],
28693
+ "Preview does not render drawings, headers or footers.": [
28694
+ "L\u2019aper\xE7u ne rend pas les dessins, en-t\xEAtes ou pieds de page.",
28695
+ "Die Vorschau stellt Zeichnungen, Kopf- und Fu\xDFzeilen nicht dar.",
28696
+ "La vista previa no muestra dibujos, encabezados ni pies de p\xE1gina.",
28697
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u6216\u9875\u811A\u3002"
28698
+ ],
28699
+ "Partial page breaks are preserved but not used in preview.": [
28700
+ "Les sauts de page partiels sont conserv\xE9s mais non utilis\xE9s dans l\u2019aper\xE7u.",
28701
+ "Teilweise Seitenumbr\xFCche bleiben erhalten, werden aber in der Vorschau nicht verwendet.",
28702
+ "Se conservan los saltos parciales, pero no se usan en la vista previa.",
28703
+ "\u4FDD\u7559\u5C40\u90E8\u5206\u9875\u7B26\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u4F7F\u7528\u3002"
28704
+ ],
28705
+ "This paper size is not supported in preview; Letter is used.": [
28706
+ "Ce format n\u2019est pas pris en charge dans l\u2019aper\xE7u ; Letter est utilis\xE9.",
28707
+ "Dieses Papierformat wird in der Vorschau nicht unterst\xFCtzt; Letter wird verwendet.",
28708
+ "Este tama\xF1o no se admite en la vista previa; se usa Carta.",
28709
+ "\u9884\u89C8\u4E0D\u652F\u6301\u6B64\u7EB8\u5F20\u5C3A\u5BF8\uFF0C\u4F7F\u7528 Letter\u3002"
28710
+ ],
28711
+ "The minimum scale prevents fitting the requested number of pages.": [
28712
+ "L\u2019\xE9chelle minimale emp\xEAche l\u2019ajustement au nombre de pages demand\xE9.",
28713
+ "Die minimale Skalierung verhindert die gew\xFCnschte Seitenanzahl.",
28714
+ "La escala m\xEDnima impide ajustar al n\xFAmero de p\xE1ginas solicitado.",
28715
+ "\u6700\u5C0F\u7F29\u653E\u6BD4\u4F8B\u65E0\u6CD5\u6EE1\u8DB3\u6307\u5B9A\u9875\u6570\u3002"
28716
+ ],
28717
+ "Rows or columns larger than a printed page are clipped.": [
28718
+ "Les lignes ou colonnes plus grandes qu\u2019une page sont rogn\xE9es.",
28719
+ "Zeilen oder Spalten, die gr\xF6\xDFer als eine Druckseite sind, werden abgeschnitten.",
28720
+ "Las filas o columnas mayores que una p\xE1gina se recortan.",
28721
+ "\u8D85\u8FC7\u6253\u5370\u9875\u9762\u5927\u5C0F\u7684\u884C\u6216\u5217\u5C06\u88AB\u88C1\u526A\u3002"
28722
+ ],
28723
+ "Margins do not fit the paper size.": [
28724
+ "Les marges ne correspondent pas au format du papier.",
28725
+ "Die R\xE4nder passen nicht zum Papierformat.",
28726
+ "Los m\xE1rgenes no caben en el tama\xF1o de papel.",
28727
+ "\u8FB9\u8DDD\u8D85\u51FA\u7EB8\u5F20\u5C3A\u5BF8\u3002"
28728
+ ],
28729
+ "Print preview supports at most one million cells.": [
28730
+ "L\u2019aper\xE7u prend en charge au maximum un million de cellules.",
28731
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens eine Million Zellen.",
28732
+ "La vista previa admite como m\xE1ximo un mill\xF3n de celdas.",
28733
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301\u4E00\u767E\u4E07\u4E2A\u5355\u5143\u683C\u3002"
28734
+ ],
28735
+ "Print preview supports at most 1000 pages.": [
28736
+ "L\u2019aper\xE7u prend en charge au maximum 1000 pages.",
28737
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens 1000 Seiten.",
28738
+ "La vista previa admite como m\xE1ximo 1000 p\xE1ginas.",
28739
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301 1000 \u9875\u3002"
28740
+ ],
28741
+ "Choose a row or column after the first to set a page break.": [
28742
+ "Choisissez une ligne ou colonne apr\xE8s la premi\xE8re pour d\xE9finir un saut de page.",
28743
+ "W\xE4hlen Sie eine Zeile oder Spalte nach der ersten f\xFCr einen Seitenumbruch.",
28744
+ "Elija una fila o columna despu\xE9s de la primera para establecer un salto.",
28745
+ "\u8BF7\u9009\u62E9\u7B2C\u4E00\u884C\u6216\u7B2C\u4E00\u5217\u4E4B\u540E\u7684\u4F4D\u7F6E\u8BBE\u7F6E\u5206\u9875\u7B26\u3002"
28746
+ ],
28747
+ "A worksheet can have at most 1026 manual breaks on each axis.": [
28748
+ "Une feuille peut contenir au maximum 1026 sauts manuels par axe.",
28749
+ "Ein Arbeitsblatt kann h\xF6chstens 1026 manuelle Umbr\xFCche pro Achse enthalten.",
28750
+ "Una hoja admite como m\xE1ximo 1026 saltos manuales por eje.",
28751
+ "\u5DE5\u4F5C\u8868\u6BCF\u4E2A\u65B9\u5411\u6700\u591A\u652F\u6301 1026 \u4E2A\u624B\u52A8\u5206\u9875\u7B26\u3002"
28752
+ ]
28753
+ };
28754
+
27083
28755
  // xlsx/ui/commands/i18n/types.ts
27084
28756
  var COLUMN = {
27085
28757
  fr: 0,
@@ -27105,7 +28777,10 @@ var COMMAND_TABLES = [
27105
28777
  FORMAT_CELLS_STRINGS,
27106
28778
  RULES_STRINGS,
27107
28779
  CORE_FEATURE_STRINGS,
27108
- CHART_SERIES_STRINGS
28780
+ CHART_SERIES_STRINGS,
28781
+ SPARKLINE_STRINGS,
28782
+ PIVOT_STRINGS,
28783
+ PRINT_LAYOUT_STRINGS
27109
28784
  ];
27110
28785
  var commandStrings = (locale) => flatten2(COMMAND_TABLES, locale);
27111
28786
 
@@ -29282,9 +30957,9 @@ function cellCommands() {
29282
30957
  ["format.hide-columns", "Hide Columns", "col", true],
29283
30958
  ["format.unhide-columns", "Unhide Columns", "col", false]
29284
30959
  ].map(
29285
- ([id, label2, axis, hidden]) => editing({
30960
+ ([id, label3, axis, hidden]) => editing({
29286
30961
  id,
29287
- label: label2,
30962
+ label: label3,
29288
30963
  icon: icon("hide"),
29289
30964
  lock: axis === "row" ? "formatRows" : "formatColumns",
29290
30965
  run: (ctx) => {
@@ -29323,47 +30998,47 @@ function cellCommands() {
29323
30998
  }
29324
30999
 
29325
31000
  // xlsx/ui/commands/cf-presets.ts
29326
- var argb = (hex2) => ({ rgb: `FF${hex2}` });
31001
+ var argb2 = (hex2) => ({ rgb: `FF${hex2}` });
29327
31002
  var HIGHLIGHT_STYLES = [
29328
31003
  [
29329
31004
  "lightRed",
29330
31005
  "Light Red Fill with Dark Red Text",
29331
31006
  {
29332
- font: { color: argb("9C0006") },
29333
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") }
31007
+ font: { color: argb2("9C0006") },
31008
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") }
29334
31009
  }
29335
31010
  ],
29336
31011
  [
29337
31012
  "yellow",
29338
31013
  "Yellow Fill with Dark Yellow Text",
29339
31014
  {
29340
- font: { color: argb("9C5700") },
29341
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFEB9C") }
31015
+ font: { color: argb2("9C5700") },
31016
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFEB9C") }
29342
31017
  }
29343
31018
  ],
29344
31019
  [
29345
31020
  "green",
29346
31021
  "Green Fill with Dark Green Text",
29347
31022
  {
29348
- font: { color: argb("006100") },
29349
- fill: { type: "pattern", pattern: "solid", bgColor: argb("C6EFCE") }
31023
+ font: { color: argb2("006100") },
31024
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("C6EFCE") }
29350
31025
  }
29351
31026
  ],
29352
31027
  [
29353
31028
  "lightRedFill",
29354
31029
  "Light Red Fill",
29355
- { fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") } }
31030
+ { fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") } }
29356
31031
  ],
29357
- ["redText", "Red Text", { font: { color: argb("9C0006") } }],
31032
+ ["redText", "Red Text", { font: { color: argb2("9C0006") } }],
29358
31033
  [
29359
31034
  "redBorder",
29360
31035
  "Red Border",
29361
31036
  {
29362
31037
  border: {
29363
- left: { style: "thin", color: argb("9C0006") },
29364
- right: { style: "thin", color: argb("9C0006") },
29365
- top: { style: "thin", color: argb("9C0006") },
29366
- bottom: { style: "thin", color: argb("9C0006") }
31038
+ left: { style: "thin", color: argb2("9C0006") },
31039
+ right: { style: "thin", color: argb2("9C0006") },
31040
+ top: { style: "thin", color: argb2("9C0006") },
31041
+ bottom: { style: "thin", color: argb2("9C0006") }
29367
31042
  }
29368
31043
  }
29369
31044
  ]
@@ -29420,13 +31095,13 @@ function dataBarRule(hex2) {
29420
31095
  type: "dataBar",
29421
31096
  min: { type: "min" },
29422
31097
  max: { type: "max" },
29423
- color: argb(hex2),
31098
+ color: argb2(hex2),
29424
31099
  priority: 1
29425
31100
  };
29426
31101
  }
29427
31102
  function colorScaleRule(colors) {
29428
31103
  const thresholds = colors.length === 3 ? [{ type: "min" }, { type: "percentile", value: "50" }, { type: "max" }] : [{ type: "min" }, { type: "max" }];
29429
- return { type: "colorScale", thresholds, colors: colors.map(argb), priority: 1 };
31104
+ return { type: "colorScale", thresholds, colors: colors.map(argb2), priority: 1 };
29430
31105
  }
29431
31106
  function iconSetRule(set) {
29432
31107
  return { type: "iconSet", iconSet: set, thresholds: iconThresholds(iconCount(set)), priority: 1 };
@@ -29596,10 +31271,10 @@ function activeChart(ctx) {
29596
31271
  const picked = t.ws.drawings[index2];
29597
31272
  return picked?.kind === "chart" ? { chart: picked, index: index2 } : void 0;
29598
31273
  }
29599
- function editChart(ctx, patch) {
31274
+ function editChart(ctx, patch2) {
29600
31275
  const t = target(ctx);
29601
31276
  const found = activeChart(ctx);
29602
- if (t && found) t.session.updateChart(t.sheet, found.index, patch(found.chart));
31277
+ if (t && found) t.session.updateChart(t.sheet, found.index, patch2(found.chart));
29603
31278
  }
29604
31279
  var TABLE_FLAGS = [
29605
31280
  ["showRowStripes", "table.banded-rows", "Banded Rows"],
@@ -29638,8 +31313,8 @@ function contextualCommands() {
29638
31313
  const t = target(ctx);
29639
31314
  const found = activeChart(ctx);
29640
31315
  if (!t || !found) return;
29641
- const patch = chartColorPalettePatch(found.chart, id);
29642
- if (patch) t.session.updateChart(t.sheet, found.index, patch);
31316
+ const patch2 = chartColorPalettePatch(found.chart, id);
31317
+ if (patch2) t.session.updateChart(t.sheet, found.index, patch2);
29643
31318
  }
29644
31319
  }),
29645
31320
  tableCmd({
@@ -29685,9 +31360,9 @@ function contextualCommands() {
29685
31360
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
29686
31361
  }),
29687
31362
  ...TABLE_FLAGS.map(
29688
- ([flag2, id, label2]) => tableCmd({
31363
+ ([flag2, id, label3]) => tableCmd({
29689
31364
  id,
29690
- label: label2,
31365
+ label: label3,
29691
31366
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
29692
31367
  run: (ctx) => {
29693
31368
  const t = target(ctx);
@@ -30070,9 +31745,9 @@ function fillDirection(ctx, dir) {
30070
31745
  function editingCommands() {
30071
31746
  return [
30072
31747
  ...AUTOSUM_FUNCTIONS.map(
30073
- ([fn, label2]) => editing({
31748
+ ([fn, label3]) => editing({
30074
31749
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
30075
- label: fn === "SUM" ? "AutoSum" : label2,
31750
+ label: fn === "SUM" ? "AutoSum" : label3,
30076
31751
  icon: icon("autoSum"),
30077
31752
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
30078
31753
  run: (ctx) => autoSum(ctx, fn)
@@ -30123,16 +31798,16 @@ function editingCommands() {
30123
31798
  ["comments", "Clear Comments and Notes"],
30124
31799
  ["hyperlinks", "Clear Hyperlinks"]
30125
31800
  ].map(
30126
- ([what, label2]) => editing({
31801
+ ([what, label3]) => editing({
30127
31802
  id: `home.clear-${what}`,
30128
- label: label2,
31803
+ label: label3,
30129
31804
  icon: icon("clear"),
30130
31805
  ...what === "formats" ? { lock: "formatCells" } : {},
30131
31806
  ...what === "contents" ? { shortcut: "Delete" } : {},
30132
31807
  run: (ctx) => {
30133
31808
  const t = target(ctx);
30134
31809
  if (!t) return;
30135
- t.session.batch(label2, () => {
31810
+ t.session.batch(label3, () => {
30136
31811
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
30137
31812
  });
30138
31813
  }
@@ -30173,9 +31848,9 @@ function editingCommands() {
30173
31848
  ["constants", "Constants"],
30174
31849
  ["validation", "Data Validation"]
30175
31850
  ].map(
30176
- ([kind, label2]) => viewing({
31851
+ ([kind, label3]) => viewing({
30177
31852
  id: `home.select-${kind}`,
30178
- label: label2,
31853
+ label: label3,
30179
31854
  icon: icon("findSelect"),
30180
31855
  run: (ctx) => {
30181
31856
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -30446,7 +32121,7 @@ function numberCommands() {
30446
32121
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
30447
32122
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
30448
32123
  ].map(
30449
- ([id, label2, format, shortcut]) => editing({ id, label: label2, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
32124
+ ([id, label3, format, shortcut]) => editing({ id, label: label3, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
30450
32125
  )
30451
32126
  ];
30452
32127
  }
@@ -30477,9 +32152,9 @@ var PAPER_SIZES = [
30477
32152
  [27, "Envelope DL"]
30478
32153
  ];
30479
32154
  var page = (ctx) => target(ctx)?.ws.pageSetup ?? {};
30480
- var setPage = (ctx, patch) => {
32155
+ var setPage = (ctx, patch2) => {
30481
32156
  const t = target(ctx);
30482
- if (t) t.session.setPageSetup(t.sheet, patch);
32157
+ if (t) t.session.setPageSetup(t.sheet, patch2);
30483
32158
  };
30484
32159
  function pageLayoutCommands() {
30485
32160
  return [
@@ -30612,6 +32287,43 @@ function pageLayoutCommands() {
30612
32287
  ];
30613
32288
  }
30614
32289
 
32290
+ // xlsx/ui/commands/page-breaks.ts
32291
+ function pageBreakCommands() {
32292
+ return [
32293
+ viewing({
32294
+ id: "page.preview",
32295
+ label: "Print Preview",
32296
+ icon: icon("pageSetup"),
32297
+ run: (ctx) => void ctx.dialogs.open("print-preview")
32298
+ }),
32299
+ ...["row", "col"].flatMap(
32300
+ (axis) => [true, false].map(
32301
+ (present) => editing({
32302
+ id: `page.break-${axis}-${present ? "insert" : "remove"}`,
32303
+ label: present ? axis === "row" ? "Insert Row Page Break" : "Insert Column Page Break" : axis === "row" ? "Remove Row Page Break" : "Remove Column Page Break",
32304
+ icon: icon("printArea"),
32305
+ lock: false,
32306
+ enabled: (ctx) => (target(ctx)?.active[axis] ?? 0) > 0,
32307
+ run: (ctx) => {
32308
+ const t = target(ctx);
32309
+ if (t) t.session.setPageBreak(t.sheet, axis, t.active[axis], present);
32310
+ }
32311
+ })
32312
+ )
32313
+ ),
32314
+ editing({
32315
+ id: "page.breaks-reset",
32316
+ label: "Reset All Page Breaks",
32317
+ icon: icon("printArea"),
32318
+ lock: false,
32319
+ run: (ctx) => {
32320
+ const t = target(ctx);
32321
+ if (t) t.session.resetPageBreaks(t.sheet);
32322
+ }
32323
+ })
32324
+ ];
32325
+ }
32326
+
30615
32327
  // xlsx/ui/commands/style-presets.ts
30616
32328
  var TABLE_STYLES = [
30617
32329
  ...Array.from({ length: 21 }, (_v, i2) => ({
@@ -30635,9 +32347,9 @@ function tableStyleColor(info, theme2) {
30635
32347
  if (slot === 0) return info.family === "Dark" ? "404040" : "808080";
30636
32348
  return theme2.colors[3 + slot] ?? "4472C4";
30637
32349
  }
30638
- var escapeAttr = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
32350
+ var escapeAttr2 = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
30639
32351
  function tableStylePreview(info, theme2) {
30640
- const c = `#${escapeAttr(tableStyleColor(info, theme2))}`;
32352
+ const c = `#${escapeAttr2(tableStyleColor(info, theme2))}`;
30641
32353
  const dark = info.family === "Dark";
30642
32354
  const header = info.family === "Light" ? "#ffffff" : c;
30643
32355
  const band = dark ? c : info.family === "Medium" ? `${c}55` : `${c}33`;
@@ -32310,13 +34022,13 @@ function searchCommands(ctx, query, isHidden) {
32310
34022
  const seen = /* @__PURE__ */ new Set();
32311
34023
  for (const command of ctx.commands.list()) {
32312
34024
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
32313
- const label2 = ctx.t(command.label).toLocaleLowerCase();
34025
+ const label3 = ctx.t(command.label).toLocaleLowerCase();
32314
34026
  const english = command.label.toLocaleLowerCase();
32315
- const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
34027
+ const haystack = `${label3} ${english} ${command.id.replace(/[.-]/g, " ")}`;
32316
34028
  if (!words2.every((word) => haystack.includes(word))) continue;
32317
- if (seen.has(label2)) continue;
32318
- seen.add(label2);
32319
- const score = label2.startsWith(words2[0]) ? 0 : label2.includes(words2[0]) ? 1 : 2;
34029
+ if (seen.has(label3)) continue;
34030
+ seen.add(label3);
34031
+ const score = label3.startsWith(words2[0]) ? 0 : label3.includes(words2[0]) ? 1 : 2;
32320
34032
  scored.push({ command, score });
32321
34033
  }
32322
34034
  return scored.sort(
@@ -32440,4 +34152,4 @@ function applyThemeColors(host, previous, colors) {
32440
34152
  return Object.keys(vars);
32441
34153
  }
32442
34154
 
32443
- export { ACCOUNTING_FORMATS, ALL_RANGE, AUTOSUM_FUNCTIONS, BORDER_PRESETS, CATEGORIES, COLOR_SCALES, COMMAND_TABLES, CORE_FEATURE_STRINGS, CellViewCache, DATA_BAR_COLORS, DATE_CODES, DEFAULT_OPTIONS, DirtyState, EDITOR_LOCALES, EDITOR_THEME_MODES, FONT_NAMES, FONT_SIZES, FORMAT_CELLS_STRINGS, FRACTION_CODES, FUNCTION_MENUS, GridGeometry, HIGHLIGHT_STYLES, ICON_ACCENTS, ICON_PATHS, ICON_SETS, MARGIN_PRESETS, MESSAGE_STRINGS, MORE_FUNCTION_CATEGORIES, NAVIGATION_STRINGS, ORIENTATIONS, PAPER_SIZES, QUADRANTS, RIBBON_HOME_STRINGS, RIBBON_TAB_STRINGS, RULES_STRINGS, SHEET_ICONS, SPECIAL_CODES, STRINGS, SYMBOLS, SheetSelections, TABLE_STYLES, TEMPLATES, THEME_KEYS, TIME_CODES, TOOLS_STRINGS, UNSET, absoluteReference, activeChart, activeRef, activeStyle, activeTable, addRange, alignItems, alignmentCommands, applyThemeColors, autoSumRange, buildChart, buildCode, buildItems, cellCommands, cellMenu, cellRange3 as cellRange, cellStyleItems, clampAddress, clipState, clipboardCommands, colSelected, colorScaleRule, colsOf, colsRange, columnHeaderHeight, columnHeaderMenu, commandStrings, contextualCommands, createCommandRegistry, createDialogRegistry, createEditBridge, createSelectionModel, createTemplateWorkbook, cssFont, cssFontFamily, darkTheme, dataBarRule, dataCommands, detectCategory, diagonalSvg, dxfCss, edgeCss, editBridge, editChart, editing, editingCommands, evaluateRef, expandForMerges, extendSelection, fillPaint, fillSource, fillTemplate, findDefinedName2 as findDefinedName, findSpecial, fitNumber2 as fitNumber, fontCommands, formatNumber2 as formatNumber, formulaCommands, functionsIn, guessHeader, hasBorders, hasWorkbook, hashes, helpTab, historyOf, icon, iconCount, iconSetRule, iconSvg, iconThresholds, initialSelection, insertFunctionCall, installFormatPainter, isBlankView, isMenuSeparator, isSingleCell, isTabHidden, isWholeCols, isWholeRows2 as isWholeRows, justify, lightTheme, measure, moveWithinSelection, movingEnd, nameForRange, negativeCodes, normalizeEditorLocale, normalizeThemeMode, noteFunctionUse, numberCommands, numberFormatOptions, onRibbonTabsChange, pageLayoutCommands, parseBorderArg, parseSelectionRef, parseSheetReference, pasteWith, patternImage, pickColor, rangeRef, recentFunctions, refresh, regionOf, registerRibbonTabs, repeatToFill, resetRibbonTabs, resolveNameBox, reviewTab, ribbonTabs, rowHeaderMenu, rowHeaderWidth, rowSelected, rowsOf, rowsRange, scrollToReveal, searchCommands, selectCell, selectSpecial, selectTab, selectionCellCount, selectionRef, setTabHidden, sheetBaseName, sheetLocked, sortCommands, span3 as span, spanRange, stepFontSize, structureLocked, style, styleCssFont, tabButton, tabMenu, tableAt, tableStyleColor, tableStylePreview, target, textAlign, textDecoration, themePaletteItems, themeToCssVars, translate, translator, viewTab, viewing, wholeColumns, wholeRows, withTarget };
34155
+ export { ACCOUNTING_FORMATS, ALL_RANGE, AUTOSUM_FUNCTIONS, BORDER_PRESETS, CATEGORIES, COLOR_SCALES, COMMAND_TABLES, CORE_FEATURE_STRINGS, CellViewCache, DATA_BAR_COLORS, DATE_CODES, DEFAULT_OPTIONS, DirtyState, EDITOR_LOCALES, EDITOR_THEME_MODES, FONT_NAMES, FONT_SIZES, FORMAT_CELLS_STRINGS, FRACTION_CODES, FUNCTION_MENUS, GridGeometry, HIGHLIGHT_STYLES, ICON_ACCENTS, ICON_PATHS, ICON_SETS, MARGIN_PRESETS, MESSAGE_STRINGS, MORE_FUNCTION_CATEGORIES, NAVIGATION_STRINGS, ORIENTATIONS, PAPER_SIZES, QUADRANTS, RIBBON_HOME_STRINGS, RIBBON_TAB_STRINGS, RULES_STRINGS, SHEET_ICONS, SPECIAL_CODES, STRINGS, SYMBOLS, SheetSelections, TABLE_STYLES, TEMPLATES, THEME_KEYS, TIME_CODES, TOOLS_STRINGS, UNSET, absoluteReference, activeChart, activeRef, activeStyle, activeTable, addRange, alignItems, alignmentCommands, applyThemeColors, autoSumRange, buildChart, buildCode, buildItems, cellCommands, cellMenu, cellRange3 as cellRange, cellStyleItems, clampAddress, clipState, clipboardCommands, colSelected, colorScaleRule, colsOf, colsRange, columnHeaderHeight, columnHeaderMenu, commandStrings, contextualCommands, createCommandRegistry, createDialogRegistry, createEditBridge, createSelectionModel, createTemplateWorkbook, cssFont, cssFontFamily, darkTheme, dataBarRule, dataCommands, detectCategory, diagonalSvg, dxfCss, edgeCss, editBridge, editChart, editing, editingCommands, evaluateRef, expandForMerges, extendSelection, fillPaint, fillSource, fillTemplate, findDefinedName2 as findDefinedName, findSpecial, fitNumber2 as fitNumber, fontCommands, formatNumber2 as formatNumber, formulaCommands, functionsIn, guessHeader, hasBorders, hasWorkbook, hashes, helpTab, historyOf, icon, iconCount, iconSetRule, iconSvg, iconThresholds, initialSelection, insertFunctionCall, installFormatPainter, isBlankView, isMenuSeparator, isSingleCell, isTabHidden, isWholeCols, isWholeRows2 as isWholeRows, justify, lightTheme, measure, moveWithinSelection, movingEnd, nameForRange, negativeCodes, normalizeEditorLocale, normalizeThemeMode, noteFunctionUse, numberCommands, numberFormatOptions, onRibbonTabsChange, pageBreakCommands, pageLayoutCommands, parseBorderArg, parseSelectionRef, parseSheetReference, pasteWith, patternImage, pickColor, rangeRef, recentFunctions, refresh, regionOf, registerRibbonTabs, repeatToFill, resetRibbonTabs, resolveNameBox, reviewTab, ribbonTabs, rowHeaderMenu, rowHeaderWidth, rowSelected, rowsOf, rowsRange, scrollToReveal, searchCommands, selectCell, selectSpecial, selectTab, selectionCellCount, selectionRef, setTabHidden, sheetBaseName, sheetLocked, sortCommands, span3 as span, spanRange, stepFontSize, structureLocked, style, styleCssFont, tabButton, tabMenu, tableAt, tableStyleColor, tableStylePreview, target, textAlign, textDecoration, themePaletteItems, themeToCssVars, translate, translator, viewTab, viewing, wholeColumns, wholeRows, withTarget };