ooxml-core 1.8.3 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/dist/PptxHandler-AT7FVG5Q.mjs +2 -0
  2. package/dist/{PptxHandler-BL4B7CZO.mjs → PptxHandler-EX4WBIQQ.mjs} +2 -2
  3. package/dist/PptxHandler-VFSCECPL.cjs +11 -0
  4. package/dist/automation/index.cjs +7380 -4682
  5. package/dist/automation/index.mjs +7380 -4682
  6. package/dist/chunk-AT66SA5M.cjs +44423 -0
  7. package/dist/{chunk-TTPZITQN.mjs → chunk-FIELY5PI.mjs} +1 -1
  8. package/dist/{chunk-ZAP5WLEN.mjs → chunk-IGOA57LE.mjs} +1 -1
  9. package/dist/chunk-LCS3J3QI.mjs +87604 -0
  10. package/dist/{chunk-NIHPA63A.mjs → chunk-M76PHYRR.mjs} +54 -37
  11. package/dist/chunk-OB277ZGE.mjs +44107 -0
  12. package/dist/{chunk-GAGSCAR3.mjs → chunk-OXHMZS7B.mjs} +552 -178
  13. package/dist/chunk-SWF7KVL5.cjs +87610 -0
  14. package/dist/{chunk-Z7IQR4S4.mjs → chunk-WSO4T2LJ.mjs} +246 -21
  15. package/dist/docx/block-parser.d.ts.map +1 -1
  16. package/dist/docx/cell-blocks.d.ts +4 -0
  17. package/dist/docx/cell-blocks.d.ts.map +1 -0
  18. package/dist/docx/document-paragraphs.d.ts.map +1 -1
  19. package/dist/docx/document-parts.d.ts +2 -0
  20. package/dist/docx/document-parts.d.ts.map +1 -1
  21. package/dist/docx/embedded.cjs +189 -20
  22. package/dist/docx/embedded.mjs +189 -20
  23. package/dist/docx/index.cjs +219 -24
  24. package/dist/docx/index.mjs +219 -24
  25. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  26. package/dist/docx/layout/adapter.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-paragraph.d.ts +5 -0
  28. package/dist/docx/layout/flow-paragraph.d.ts.map +1 -1
  29. package/dist/docx/layout/flow-table.d.ts +2 -1
  30. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  31. package/dist/docx/layout/footnote-columns.d.ts +22 -0
  32. package/dist/docx/layout/footnote-columns.d.ts.map +1 -0
  33. package/dist/docx/layout/footnote-flow.d.ts +27 -0
  34. package/dist/docx/layout/footnote-flow.d.ts.map +1 -0
  35. package/dist/docx/layout/footnote-split.d.ts +7 -0
  36. package/dist/docx/layout/footnote-split.d.ts.map +1 -0
  37. package/dist/docx/layout/index.cjs +1099 -92
  38. package/dist/docx/layout/index.mjs +1099 -92
  39. package/dist/docx/layout/input.d.ts +17 -1
  40. package/dist/docx/layout/input.d.ts.map +1 -1
  41. package/dist/docx/layout/legacy-footnote-flow.d.ts +18 -0
  42. package/dist/docx/layout/legacy-footnote-flow.d.ts.map +1 -0
  43. package/dist/docx/layout/line-metrics.d.ts.map +1 -1
  44. package/dist/docx/layout/page-cursor.d.ts +13 -8
  45. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  46. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  47. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  48. package/dist/docx/layout/paragraph-tokens.d.ts +2 -0
  49. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  50. package/dist/docx/layout/reference-footnotes.d.ts +7 -0
  51. package/dist/docx/layout/reference-footnotes.d.ts.map +1 -0
  52. package/dist/docx/layout/result.d.ts +31 -0
  53. package/dist/docx/layout/result.d.ts.map +1 -1
  54. package/dist/docx/layout/section-flow.d.ts +2 -0
  55. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  56. package/dist/docx/layout/table-cell-layout.d.ts +11 -0
  57. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -0
  58. package/dist/docx/layout/table-footnotes.d.ts +27 -0
  59. package/dist/docx/layout/table-footnotes.d.ts.map +1 -0
  60. package/dist/docx/layout/table-layout.d.ts +10 -4
  61. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  62. package/dist/docx/load/index.cjs +194 -25
  63. package/dist/docx/load/index.mjs +194 -25
  64. package/dist/docx/model-run.d.ts +2 -0
  65. package/dist/docx/model-run.d.ts.map +1 -1
  66. package/dist/docx/model.d.ts +7 -0
  67. package/dist/docx/model.d.ts.map +1 -1
  68. package/dist/docx/notes.d.ts +5 -0
  69. package/dist/docx/notes.d.ts.map +1 -1
  70. package/dist/docx/parse-table.d.ts.map +1 -1
  71. package/dist/docx/parse.d.ts.map +1 -1
  72. package/dist/docx/save.d.ts.map +1 -1
  73. package/dist/docx/section-model.d.ts +2 -0
  74. package/dist/docx/section-model.d.ts.map +1 -1
  75. package/dist/docx/sections.d.ts.map +1 -1
  76. package/dist/docx/settings.d.ts +2 -0
  77. package/dist/docx/settings.d.ts.map +1 -1
  78. package/dist/docx/table-model.d.ts +3 -1
  79. package/dist/docx/table-model.d.ts.map +1 -1
  80. package/dist/docx/ui/index.cjs +55 -0
  81. package/dist/docx/ui/index.d.ts +1 -0
  82. package/dist/docx/ui/index.d.ts.map +1 -1
  83. package/dist/docx/ui/index.mjs +55 -1
  84. package/dist/docx/ui/table-structure-guard.d.ts +4 -0
  85. package/dist/docx/ui/table-structure-guard.d.ts.map +1 -0
  86. package/dist/docx/write-footnote-columns.d.ts +3 -0
  87. package/dist/docx/write-footnote-columns.d.ts.map +1 -0
  88. package/dist/docx/write-notes.d.ts.map +1 -1
  89. package/dist/docx/write-run.d.ts.map +1 -1
  90. package/dist/docx/write-sections.d.ts.map +1 -1
  91. package/dist/index.cjs +8 -5
  92. package/dist/index.mjs +8 -5
  93. package/dist/opc/clone-part-graph.d.ts +4 -0
  94. package/dist/opc/clone-part-graph.d.ts.map +1 -1
  95. package/dist/opc/index.cjs +8 -5
  96. package/dist/opc/index.mjs +8 -5
  97. package/dist/pptx/automation/index.cjs +621 -207
  98. package/dist/pptx/automation/index.d.ts +3 -3
  99. package/dist/pptx/automation/index.mjs +5 -5
  100. package/dist/pptx/chunks/{index-Cn-GzYGp.d.ts → index-B4cnSPNz.d.ts} +33 -4
  101. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +1 -0
  102. package/dist/pptx/chunks/{index-CKIUurnd.d.ts → index-BZh-IMkN.d.ts} +14 -9
  103. package/dist/pptx/chunks/{index-CKIUurnd.d.ts.map → index-BZh-IMkN.d.ts.map} +1 -1
  104. package/dist/pptx/chunks/{text-operations-BHfAm5K9.d.ts → text-operations-BLodkuXE.d.ts} +29 -12
  105. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +1 -0
  106. package/dist/pptx/cli/index.cjs +622 -213
  107. package/dist/pptx/cli/index.d.ts +1 -1
  108. package/dist/pptx/cli/index.mjs +4 -4
  109. package/dist/pptx/converter/index.cjs +53 -36
  110. package/dist/pptx/converter/index.d.ts +1 -1
  111. package/dist/pptx/converter/index.mjs +2 -2
  112. package/dist/pptx/editor/render/find-replace.cjs +416 -45
  113. package/dist/pptx/editor/render/find-replace.d.ts +35 -4
  114. package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
  115. package/dist/pptx/editor/render/find-replace.mjs +416 -46
  116. package/dist/pptx/editor/render/slide-operations.cjs +87 -0
  117. package/dist/pptx/editor/render/slide-operations.d.ts +17 -1
  118. package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
  119. package/dist/pptx/editor/render/slide-operations.mjs +83 -1
  120. package/dist/pptx/editor/render/slide-search.cjs +6 -10
  121. package/dist/pptx/editor/render/slide-search.d.ts +1 -1
  122. package/dist/pptx/editor/render/slide-search.mjs +6 -10
  123. package/dist/pptx/editor/render/template-editing.d.ts +1 -1
  124. package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
  125. package/dist/pptx/index.cjs +889 -237
  126. package/dist/pptx/index.d.ts +4 -4
  127. package/dist/pptx/index.mjs +5 -5
  128. package/dist/teams/index.cjs +672 -37
  129. package/dist/teams/index.mjs +672 -37
  130. package/dist/visio/accessibility.d.ts +10 -0
  131. package/dist/visio/accessibility.d.ts.map +1 -0
  132. package/dist/visio/cell-formula.d.ts +2 -0
  133. package/dist/visio/cell-formula.d.ts.map +1 -1
  134. package/dist/visio/connector-curve-aligned.d.ts +5 -0
  135. package/dist/visio/connector-curve-aligned.d.ts.map +1 -0
  136. package/dist/visio/connector-curve-spans.d.ts +14 -0
  137. package/dist/visio/connector-curve-spans.d.ts.map +1 -0
  138. package/dist/visio/connector-jumps.d.ts +5 -0
  139. package/dist/visio/connector-jumps.d.ts.map +1 -0
  140. package/dist/visio/connector-route-walk.d.ts +2 -1
  141. package/dist/visio/connector-route-walk.d.ts.map +1 -1
  142. package/dist/visio/edit-alt-text-scope.d.ts +5 -0
  143. package/dist/visio/edit-alt-text-scope.d.ts.map +1 -0
  144. package/dist/visio/edit-alt-text.d.ts +3 -0
  145. package/dist/visio/edit-alt-text.d.ts.map +1 -0
  146. package/dist/visio/edit-commands.d.ts +7 -2
  147. package/dist/visio/edit-commands.d.ts.map +1 -1
  148. package/dist/visio/edit-formatting-commands.d.ts +5 -0
  149. package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
  150. package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
  151. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  152. package/dist/visio/edit-line-jump-cache.d.ts +4 -0
  153. package/dist/visio/edit-line-jump-cache.d.ts.map +1 -0
  154. package/dist/visio/edit-master-index.d.ts.map +1 -1
  155. package/dist/visio/edit-metadata-commands.d.ts +10 -2
  156. package/dist/visio/edit-metadata-commands.d.ts.map +1 -1
  157. package/dist/visio/edit-metadata.d.ts +3 -1
  158. package/dist/visio/edit-metadata.d.ts.map +1 -1
  159. package/dist/visio/edit-page-alt-text.d.ts +4 -0
  160. package/dist/visio/edit-page-alt-text.d.ts.map +1 -0
  161. package/dist/visio/edit-page-layout.d.ts.map +1 -1
  162. package/dist/visio/edit-page-rename.d.ts.map +1 -1
  163. package/dist/visio/edit-page-setup-commands.d.ts +7 -1
  164. package/dist/visio/edit-page-setup-commands.d.ts.map +1 -1
  165. package/dist/visio/edit-page-size.d.ts.map +1 -1
  166. package/dist/visio/edit-pages.d.ts.map +1 -1
  167. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  168. package/dist/visio/edit-scope.d.ts.map +1 -1
  169. package/dist/visio/edit-shape-create.d.ts.map +1 -1
  170. package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
  171. package/dist/visio/edit-style-admission.d.ts.map +1 -1
  172. package/dist/visio/edit-text.d.ts.map +1 -1
  173. package/dist/visio/edit.d.ts +1 -1
  174. package/dist/visio/edit.d.ts.map +1 -1
  175. package/dist/visio/index.cjs +1091 -233
  176. package/dist/visio/index.d.ts +2 -1
  177. package/dist/visio/index.d.ts.map +1 -1
  178. package/dist/visio/index.mjs +1091 -234
  179. package/dist/visio/line-jumps.d.ts +1 -5
  180. package/dist/visio/line-jumps.d.ts.map +1 -1
  181. package/dist/visio/model.d.ts +13 -0
  182. package/dist/visio/model.d.ts.map +1 -1
  183. package/dist/visio/page-layout.d.ts +11 -2
  184. package/dist/visio/page-layout.d.ts.map +1 -1
  185. package/dist/visio/parser.d.ts.map +1 -1
  186. package/dist/visio/shape-metadata.d.ts +6 -0
  187. package/dist/visio/shape-metadata.d.ts.map +1 -1
  188. package/dist/visio/shapes.d.ts.map +1 -1
  189. package/dist/visio/text-field-case.d.ts +2 -0
  190. package/dist/visio/text-field-case.d.ts.map +1 -0
  191. package/dist/visio/text-field-display.d.ts.map +1 -1
  192. package/dist/visio/text-field-numeric.d.ts +4 -0
  193. package/dist/visio/text-field-numeric.d.ts.map +1 -0
  194. package/dist/visio/ui/connector-preview.d.ts +1 -1
  195. package/dist/visio/ui/connector-preview.d.ts.map +1 -1
  196. package/dist/visio/ui/data-graphic-rules.d.ts +2 -0
  197. package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
  198. package/dist/visio/ui/data-graphics.d.ts +3 -2
  199. package/dist/visio/ui/data-graphics.d.ts.map +1 -1
  200. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  201. package/dist/visio/ui/index.cjs +16898 -15855
  202. package/dist/visio/ui/index.mjs +16898 -15856
  203. package/dist/visio/ui/scene-details.d.ts.map +1 -1
  204. package/dist/visio/ui/scene-validation.d.ts.map +1 -1
  205. package/dist/visio/ui/snapshot-scene.d.ts +2 -1
  206. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  207. package/dist/visio/xml-attribute-whitespace.d.ts +5 -0
  208. package/dist/visio/xml-attribute-whitespace.d.ts.map +1 -0
  209. package/dist/xlsx/edit/index.d.ts +1 -0
  210. package/dist/xlsx/edit/index.d.ts.map +1 -1
  211. package/dist/xlsx/edit/insert-guard.d.ts.map +1 -1
  212. package/dist/xlsx/edit/merge.d.ts.map +1 -1
  213. package/dist/xlsx/edit/page-breaks.d.ts +5 -0
  214. package/dist/xlsx/edit/page-breaks.d.ts.map +1 -0
  215. package/dist/xlsx/edit/pivots.d.ts +8 -0
  216. package/dist/xlsx/edit/pivots.d.ts.map +1 -0
  217. package/dist/xlsx/edit/print-titles.d.ts +7 -0
  218. package/dist/xlsx/edit/print-titles.d.ts.map +1 -0
  219. package/dist/xlsx/edit/session.d.ts.map +1 -1
  220. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  221. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
  222. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
  223. package/dist/xlsx/edit/sparkline-ranges.d.ts +11 -0
  224. package/dist/xlsx/edit/sparkline-ranges.d.ts.map +1 -0
  225. package/dist/xlsx/edit/sparkline-xml.d.ts +13 -0
  226. package/dist/xlsx/edit/sparkline-xml.d.ts.map +1 -0
  227. package/dist/xlsx/edit/sparklines.d.ts +16 -0
  228. package/dist/xlsx/edit/sparklines.d.ts.map +1 -0
  229. package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
  230. package/dist/xlsx/edit/tables.d.ts.map +1 -1
  231. package/dist/xlsx/edit/types.d.ts +22 -1
  232. package/dist/xlsx/edit/types.d.ts.map +1 -1
  233. package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
  234. package/dist/xlsx/index.cjs +3415 -1374
  235. package/dist/xlsx/index.d.ts +1 -0
  236. package/dist/xlsx/index.d.ts.map +1 -1
  237. package/dist/xlsx/index.mjs +3396 -1375
  238. package/dist/xlsx/layout/cell-view.d.ts +2 -0
  239. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  240. package/dist/xlsx/layout/header-footer.d.ts +58 -0
  241. package/dist/xlsx/layout/header-footer.d.ts.map +1 -0
  242. package/dist/xlsx/layout/index.d.ts +5 -0
  243. package/dist/xlsx/layout/index.d.ts.map +1 -1
  244. package/dist/xlsx/layout/print-breaks.d.ts +11 -0
  245. package/dist/xlsx/layout/print-breaks.d.ts.map +1 -0
  246. package/dist/xlsx/layout/print-layout.d.ts +34 -0
  247. package/dist/xlsx/layout/print-layout.d.ts.map +1 -0
  248. package/dist/xlsx/layout/print-merges.d.ts +18 -0
  249. package/dist/xlsx/layout/print-merges.d.ts.map +1 -0
  250. package/dist/xlsx/layout/print-repeat.d.ts +12 -0
  251. package/dist/xlsx/layout/print-repeat.d.ts.map +1 -0
  252. package/dist/xlsx/layout/print-titles.d.ts +20 -0
  253. package/dist/xlsx/layout/print-titles.d.ts.map +1 -0
  254. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -1
  255. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -1
  256. package/dist/xlsx/load/index.cjs +7831 -6961
  257. package/dist/xlsx/load/index.mjs +7831 -6961
  258. package/dist/xlsx/model-pivots.d.ts +46 -0
  259. package/dist/xlsx/model-pivots.d.ts.map +1 -0
  260. package/dist/xlsx/model.d.ts +5 -0
  261. package/dist/xlsx/model.d.ts.map +1 -1
  262. package/dist/xlsx/pivot/admission.d.ts +5 -0
  263. package/dist/xlsx/pivot/admission.d.ts.map +1 -0
  264. package/dist/xlsx/pivot/aggregate.d.ts +19 -0
  265. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -0
  266. package/dist/xlsx/pivot/cache-xml.d.ts +9 -0
  267. package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -0
  268. package/dist/xlsx/pivot/data.d.ts +12 -0
  269. package/dist/xlsx/pivot/data.d.ts.map +1 -0
  270. package/dist/xlsx/pivot/hierarchy.d.ts +7 -0
  271. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -0
  272. package/dist/xlsx/pivot/index.d.ts +3 -0
  273. package/dist/xlsx/pivot/index.d.ts.map +1 -0
  274. package/dist/xlsx/pivot/read.d.ts +5 -0
  275. package/dist/xlsx/pivot/read.d.ts.map +1 -0
  276. package/dist/xlsx/pivot/table-xml.d.ts +5 -0
  277. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -0
  278. package/dist/xlsx/pivot/write.d.ts +11 -0
  279. package/dist/xlsx/pivot/write.d.ts.map +1 -0
  280. package/dist/xlsx/read/load.d.ts.map +1 -1
  281. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  282. package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
  283. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  284. package/dist/xlsx/ui/commands/i18n/pivots.d.ts +3 -0
  285. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -0
  286. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts +3 -0
  287. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -0
  288. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts +3 -0
  289. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts.map +1 -0
  290. package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
  291. package/dist/xlsx/ui/commands/page-breaks.d.ts +3 -0
  292. package/dist/xlsx/ui/commands/page-breaks.d.ts.map +1 -0
  293. package/dist/xlsx/ui/index.cjs +2451 -737
  294. package/dist/xlsx/ui/index.d.ts +1 -0
  295. package/dist/xlsx/ui/index.d.ts.map +1 -1
  296. package/dist/xlsx/ui/index.mjs +2451 -738
  297. package/dist/xlsx/write/chart-cache.d.ts +8 -0
  298. package/dist/xlsx/write/chart-cache.d.ts.map +1 -0
  299. package/dist/xlsx/write/page-setup.d.ts.map +1 -1
  300. package/dist/xlsx/write/save.d.ts.map +1 -1
  301. package/dist/xlsx/write/sheet-parts.d.ts +1 -0
  302. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  303. package/dist/xlsx/write/workbook-part.d.ts +1 -1
  304. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  305. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  306. package/package.json +1 -1
  307. package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
  308. package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +0 -1
@@ -1,9 +1,9 @@
1
- import { SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, XML_PROLOG, DGM_XMLNS, xmlEscape, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, preservesSpreadsheetXmlWhitespace, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, escAttr, escText, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, OOXML_PERCENT_UNITS, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, emu, extractGuidFromPartName, deobfuscateFont, detectFontFormat, gradFill, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesTrendlines, parseSeriesErrBars, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, readChartManualLayoutValues, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-TTPZITQN.mjs';
1
+ import { SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, XML_PROLOG, DGM_XMLNS, xmlEscape, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, preservesSpreadsheetXmlWhitespace, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, escAttr, escText, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, OOXML_PERCENT_UNITS, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, emu, extractGuidFromPartName, deobfuscateFont, detectFontFormat, gradFill, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesTrendlines, parseSeriesErrBars, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, readChartManualLayoutValues, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-FIELY5PI.mjs';
2
2
  import { DIGITAL_SIGNATURE_ORIGIN_REL_TYPE } from './chunk-KBIJI6P5.mjs';
3
3
  import { resolveSmartArtLayoutCategory } from './chunk-3GXV5MPC.mjs';
4
4
  import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-54S5A5PZ.mjs';
5
5
  import { themeColorRefFromColorChoice, parseOoxmlPercent, themeColorRefToSolidFillWithOpacity, applyDrawingColorTransforms, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, themeColorRefFromSchemeClr, blendColorOntoWhite } from './chunk-KII4AAYH.mjs';
6
- import JSZip4 from 'jszip';
6
+ import JSZip5 from 'jszip';
7
7
  import { DOMParser, XMLSerializer } from '@xmldom/xmldom';
8
8
  import { XMLParser, XMLBuilder } from 'fast-xml-parser';
9
9
  import { decompressEotFont } from 'mtx-decompressor';
@@ -2011,7 +2011,7 @@ async function buildBlankPresentationArchive(options) {
2011
2011
  const layoutCount = STANDARD_LAYOUTS.length;
2012
2012
  const initialSlideCount = Math.max(0, options?.initialSlideCount ?? 0);
2013
2013
  const blankLayoutIdx = STANDARD_LAYOUTS.findIndex((l) => l.type === "blank") + 1 || 7;
2014
- const zip = new JSZip4();
2014
+ const zip = new JSZip5();
2015
2015
  zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
2016
2016
  zip.file("_rels/.rels", rootRelsXml());
2017
2017
  zip.file("ppt/presentation.xml", presentationXml(width, height, initialSlideCount));
@@ -2260,6 +2260,11 @@ function relationshipsPartFor(partName) {
2260
2260
  const slash = partName.lastIndexOf("/");
2261
2261
  return `${partName.slice(0, slash + 1)}_rels/${partName.slice(slash + 1)}.rels`;
2262
2262
  }
2263
+ function nextRelationshipId(used) {
2264
+ let index = 1;
2265
+ while (used.has(`rId${index}`)) index++;
2266
+ return `rId${index}`;
2267
+ }
2263
2268
 
2264
2269
  // opc/content-types.ts
2265
2270
  function parseContentTypes(xml) {
@@ -2279,6 +2284,13 @@ function parseContentTypes(xml) {
2279
2284
  }
2280
2285
  return { defaults, overrides };
2281
2286
  }
2287
+ function contentTypeForPart(types, partName) {
2288
+ const overridePath = partName.startsWith("/") ? partName : `/${partName}`;
2289
+ const override = types.overrides.get(overridePath);
2290
+ if (override) return override;
2291
+ const extension = partName.split(".").pop()?.toLowerCase();
2292
+ return extension ? types.defaults.get(extension) : void 0;
2293
+ }
2282
2294
 
2283
2295
  // opc/package.ts
2284
2296
  var CONTENT_TYPES_PATH = "[Content_Types].xml";
@@ -2308,10 +2320,13 @@ function relativePartTarget(basePart, targetPart) {
2308
2320
  }
2309
2321
  async function clonePartGraph(options) {
2310
2322
  const { zip, sourcePart, targetPart, shouldClone } = options;
2311
- const copies = /* @__PURE__ */ new Map([[sourcePart, targetPart]]);
2312
- const types = parseContentTypes(await zip.file("[Content_Types].xml")?.async("string"));
2323
+ const sourceZip = options.sourceZip ?? zip;
2324
+ const copies = options.copies ?? /* @__PURE__ */ new Map();
2325
+ copies.set(sourcePart, targetPart);
2326
+ const types = parseContentTypes(await sourceZip.file("[Content_Types].xml")?.async("string"));
2313
2327
  const reserved = new Set(Object.keys(zip.files));
2314
2328
  reserved.add(targetPart);
2329
+ for (const target of copies.values()) reserved.add(target);
2315
2330
  const allocate = (source) => {
2316
2331
  const match = /^(?<stem>.*?)(?:\d+)?(?<extension>\.[^/.]+)$/u.exec(source);
2317
2332
  const stem = match?.groups?.stem ?? source;
@@ -2323,9 +2338,9 @@ async function clonePartGraph(options) {
2323
2338
  return path2;
2324
2339
  };
2325
2340
  const copyRelationships = async (source, destination) => {
2326
- const contentType = types.overrides.get(`/${source}`);
2341
+ const contentType = contentTypeForPart(types, source);
2327
2342
  if (contentType) await ensureContentTypeOverride(zip, destination, contentType);
2328
- const xml = await zip.file(relationshipsPartFor(source))?.async("string");
2343
+ const xml = await sourceZip.file(relationshipsPartFor(source))?.async("string");
2329
2344
  if (!xml) return;
2330
2345
  const relationships2 = parseRelationships(xml);
2331
2346
  for (const relationship of relationships2.values()) {
@@ -2333,7 +2348,7 @@ async function clonePartGraph(options) {
2333
2348
  const originalTarget = resolvePartPath(source, relationship.target);
2334
2349
  let newTarget = copies.get(originalTarget);
2335
2350
  if (!newTarget && shouldClone(relationship, originalTarget)) {
2336
- const file = zip.file(originalTarget);
2351
+ const file = sourceZip.file(originalTarget);
2337
2352
  if (!file) throw new Error(`Cannot clone missing package part: ${originalTarget}`);
2338
2353
  newTarget = allocate(originalTarget);
2339
2354
  copies.set(originalTarget, newTarget);
@@ -4541,7 +4556,7 @@ var PptxPresentationSlidesReconciler = class {
4541
4556
  }
4542
4557
  staticRelationships.push(relationship);
4543
4558
  }
4544
- const nextRelationshipId4 = () => {
4559
+ const nextRelationshipId5 = () => {
4545
4560
  let index = 1;
4546
4561
  while (usedRIds.has(`rId${index}`)) {
4547
4562
  index += 1;
@@ -4585,7 +4600,7 @@ var PptxPresentationSlidesReconciler = class {
4585
4600
  const existingSlideXml = input.slideMap.get(slide.id);
4586
4601
  if (existingSlideXml) {
4587
4602
  if (!slide.rId || slide.rId.length === 0 || !slideTargetByRid.has(slide.rId)) {
4588
- slide.rId = nextRelationshipId4();
4603
+ slide.rId = nextRelationshipId5();
4589
4604
  } else {
4590
4605
  usedRIds.add(slide.rId);
4591
4606
  }
@@ -4604,7 +4619,7 @@ var PptxPresentationSlidesReconciler = class {
4604
4619
  sourceSlidePath,
4605
4620
  usedRIds,
4606
4621
  slideTargetByRid,
4607
- nextRelationshipId: nextRelationshipId4
4622
+ nextRelationshipId: nextRelationshipId5
4608
4623
  });
4609
4624
  attachedPaths.set(originalId, slide.id);
4610
4625
  }
@@ -5554,7 +5569,13 @@ var PptxSlideNotesPartUpdater = class {
5554
5569
  init.slideNotesRelationshipType,
5555
5570
  `../notesSlides/${fileName}`
5556
5571
  );
5557
- init.zip.file(notesPath, init.xmlBuilder.build(this.buildNotesSlide(init.slide, strict)));
5572
+ const notesXmlObject = this.buildNotesSlide(init.slide, strict);
5573
+ init.updateNotesXmlText(
5574
+ notesXmlObject,
5575
+ init.slide.notes ?? init.slide.notesSegments?.map((segment) => segment.text).join("") ?? "",
5576
+ init.slide.notesSegments
5577
+ );
5578
+ init.zip.file(notesPath, init.xmlBuilder.build(notesXmlObject));
5558
5579
  init.zip.file(
5559
5580
  `ppt/notesSlides/_rels/${fileName}.rels`,
5560
5581
  init.xmlBuilder.build({
@@ -37295,6 +37316,323 @@ function applyHeaderFooterToMaster(masterRoot, headerFooter) {
37295
37316
  }
37296
37317
  }
37297
37318
 
37319
+ // pptx/core/utils/chart-xlsx-write-validation.ts
37320
+ function unsupported(reason) {
37321
+ throw new Error(`Chart label replacement requires direct literal workbook cells: ${reason}.`);
37322
+ }
37323
+ async function validateAtomicChartWorkbookWrites(zip, parser, paths, writes, requireCurrentValues = false) {
37324
+ const relationships2 = xmlChild(
37325
+ parser.parse(
37326
+ await zip.file("xl/_rels/workbook.xml.rels")?.async("string") ?? ""
37327
+ ),
37328
+ "Relationships"
37329
+ );
37330
+ for (const rel of xmlChildren(relationships2, "Relationship")) {
37331
+ if (xmlAttr(rel, "TargetMode") === "External") {
37332
+ unsupported("external worksheet relationships are not supported");
37333
+ }
37334
+ }
37335
+ const sheets = /* @__PURE__ */ new Map();
37336
+ const cellsByPath = /* @__PURE__ */ new Map();
37337
+ for (const path2 of new Set(paths.values())) {
37338
+ const file = zip.file(path2);
37339
+ if (!file) {
37340
+ unsupported("a referenced worksheet is missing");
37341
+ }
37342
+ let tree;
37343
+ try {
37344
+ tree = parser.parse(await file.async("string"));
37345
+ } catch {
37346
+ unsupported("a worksheet cannot be parsed");
37347
+ }
37348
+ const data = xmlChild(xmlChild(tree, "worksheet"), "sheetData");
37349
+ if (!data) {
37350
+ unsupported("a worksheet has no cell data");
37351
+ }
37352
+ if (Object.keys(data).some((key2) => key2.includes(":"))) {
37353
+ unsupported("prefixed worksheet cell nodes are not supported");
37354
+ }
37355
+ const cells2 = /* @__PURE__ */ new Map();
37356
+ for (const row of xmlChildren(data, "row")) {
37357
+ if (Object.keys(row).some((key2) => key2.includes(":"))) {
37358
+ unsupported("prefixed worksheet cell nodes are not supported");
37359
+ }
37360
+ for (const cell of xmlChildren(row, "c")) {
37361
+ const ref = xmlAttr(cell, "r");
37362
+ if (!ref || cells2.has(ref)) {
37363
+ unsupported("duplicate or unidentified worksheet cells are not supported");
37364
+ }
37365
+ cells2.set(ref, cell);
37366
+ if (Object.keys(cell).some((key2) => key2 === "f" || key2.endsWith(":f"))) {
37367
+ unsupported("formula-dependent workbooks are not supported");
37368
+ }
37369
+ }
37370
+ }
37371
+ sheets.set(path2, data);
37372
+ cellsByPath.set(path2, cells2);
37373
+ }
37374
+ const sharedFile = zip.file("xl/sharedStrings.xml");
37375
+ const shared = sharedFile ? xmlChildren(
37376
+ xmlChild(parser.parse(await sharedFile.async("string")), "sst"),
37377
+ "si"
37378
+ ) : [];
37379
+ const destinations = /* @__PURE__ */ new Map();
37380
+ for (const write of writes) {
37381
+ const range = parseChartFormulaRange(write.formula);
37382
+ if (!range || /[\[\]:!]/u.test(range.sheetName)) {
37383
+ unsupported("a range is not a direct local reference");
37384
+ }
37385
+ if ([range.start, range.end].some(
37386
+ (cell) => cell.row < 0 || cell.row >= 1048576 || cell.col < 0 || cell.col >= 16384
37387
+ )) {
37388
+ unsupported("a source cell lies outside the worksheet limits");
37389
+ }
37390
+ const addresses = expandRangeAddresses(range, write.values.length);
37391
+ const path2 = paths.get(range.sheetName.toLowerCase());
37392
+ const data = path2 ? sheets.get(path2) : void 0;
37393
+ if (!addresses || !path2 || !data) {
37394
+ unsupported("a source range cannot be resolved");
37395
+ }
37396
+ for (const [index, address] of addresses.entries()) {
37397
+ const value = write.values[index];
37398
+ const key2 = `${path2}!${address}`;
37399
+ const prior = destinations.get(key2);
37400
+ if (prior && (prior.value !== value || prior.numeric !== write.isNumeric)) {
37401
+ unsupported("overlapping source ranges request conflicting values");
37402
+ }
37403
+ destinations.set(key2, { value, numeric: write.isNumeric });
37404
+ const cell = cellsByPath.get(path2)?.get(address);
37405
+ if (!cell) {
37406
+ unsupported("a source cell is missing");
37407
+ }
37408
+ const type = xmlAttr(cell, "t") ?? "n";
37409
+ const text = type === "s" ? shared[Number(xmlText(cell.v))] : xmlChild(cell, "is");
37410
+ if (text && Object.keys(text).some((node) => !node.startsWith("@_") && node !== "t" && node !== "#text")) {
37411
+ unsupported("rich worksheet strings require source-workbook editing");
37412
+ }
37413
+ if (requireCurrentValues) {
37414
+ const current = text ? xmlText(text.t) : xmlText(cell.v);
37415
+ const equal = write.isNumeric ? current !== void 0 && Number(current) === Number(value) : current === value;
37416
+ if (!equal) {
37417
+ unsupported("the workbook and chart caches disagree");
37418
+ }
37419
+ }
37420
+ if (write.isNumeric && !Number.isFinite(Number(value))) {
37421
+ unsupported("a numeric cache value is not finite");
37422
+ }
37423
+ if (!["n", "s", "inlineStr", "str"].includes(type)) {
37424
+ unsupported("a source cell has an unsupported value type");
37425
+ }
37426
+ }
37427
+ }
37428
+ }
37429
+
37430
+ // pptx/core/utils/chart-xlsx-writer.ts
37431
+ function collectChartWorkbookWrite(xmlLookupService, container, isNumeric2, values) {
37432
+ if (!container) {
37433
+ return void 0;
37434
+ }
37435
+ const refNode = xmlLookupService.getChildByLocalName(container, isNumeric2 ? "numRef" : "strRef");
37436
+ const formula = refNode ? xmlLookupService.getScalarChildByLocalName(refNode, "f") : void 0;
37437
+ return formula ? { formula, isNumeric: isNumeric2, values } : void 0;
37438
+ }
37439
+ function createSpreadsheetXmlParser() {
37440
+ return new XMLParser({
37441
+ ignoreAttributes: false,
37442
+ attributeNamePrefix: "@_",
37443
+ trimValues: false,
37444
+ parseTagValue: false,
37445
+ tagValueProcessor: (tagName, tagValue) => preservesSpreadsheetXmlWhitespace(tagName) ? tagValue : tagValue.trim()
37446
+ });
37447
+ }
37448
+ function createSpreadsheetXmlBuilder() {
37449
+ return new XMLBuilder({
37450
+ ignoreAttributes: false,
37451
+ attributeNamePrefix: "@_",
37452
+ suppressBooleanAttributes: false,
37453
+ format: false
37454
+ });
37455
+ }
37456
+ async function resolveWorksheetPathsByName(xlsxZip, parser) {
37457
+ const result = /* @__PURE__ */ new Map();
37458
+ const workbookFile = xlsxZip.file("xl/workbook.xml");
37459
+ const relsFile = xlsxZip.file("xl/_rels/workbook.xml.rels");
37460
+ if (!workbookFile || !relsFile) {
37461
+ return result;
37462
+ }
37463
+ try {
37464
+ const workbookTree = parser.parse(await workbookFile.async("string"));
37465
+ const relsTree = parser.parse(await relsFile.async("string"));
37466
+ const targetByRelId = /* @__PURE__ */ new Map();
37467
+ const relationships2 = xmlChild(relsTree, "Relationships");
37468
+ for (const rel of xmlChildren(relationships2, "Relationship")) {
37469
+ const id = xmlAttr(rel, "Id");
37470
+ const target = xmlAttr(rel, "Target");
37471
+ if (id && target) {
37472
+ targetByRelId.set(id, target);
37473
+ }
37474
+ }
37475
+ const workbookRoot = xmlChild(workbookTree, "workbook");
37476
+ const sheets = xmlChild(workbookRoot, "sheets");
37477
+ for (const sheet of xmlChildren(sheets, "sheet")) {
37478
+ const name = xmlAttr(sheet, "name");
37479
+ const relId = xmlAttr(sheet, "r:id") ?? xmlAttr(sheet, "id");
37480
+ const target = relId ? targetByRelId.get(relId) : void 0;
37481
+ if (name && target) {
37482
+ result.set(name.toLowerCase(), resolveWorkbookPartPath(target));
37483
+ }
37484
+ }
37485
+ } catch {
37486
+ }
37487
+ return result;
37488
+ }
37489
+ function resolveWorkbookPartPath(target) {
37490
+ return target.startsWith("/") ? target.slice(1) : `xl/${target}`;
37491
+ }
37492
+ async function writeChartWorkbookUpdates(xlsxBytes, writes, options = {}) {
37493
+ if (writes.length === 0) {
37494
+ return { unresolved: 0 };
37495
+ }
37496
+ let xlsxZip;
37497
+ try {
37498
+ xlsxZip = await JSZip5.loadAsync(xlsxBytes);
37499
+ } catch {
37500
+ if (options.atomic) {
37501
+ throw new Error("Chart label replacement requires a readable embedded workbook.");
37502
+ }
37503
+ return { unresolved: writes.length };
37504
+ }
37505
+ const parser = createSpreadsheetXmlParser();
37506
+ const sheetPathByName = await resolveWorksheetPathsByName(xlsxZip, parser);
37507
+ if (options.atomic) {
37508
+ await validateAtomicChartWorkbookWrites(
37509
+ xlsxZip,
37510
+ parser,
37511
+ sheetPathByName,
37512
+ writes,
37513
+ options.requireCurrentValues ?? false
37514
+ );
37515
+ }
37516
+ const writesBySheetPath = /* @__PURE__ */ new Map();
37517
+ let unresolved = 0;
37518
+ for (const write of writes) {
37519
+ const range = parseChartFormulaRange(write.formula);
37520
+ const sheetPath = range ? sheetPathByName.get(range.sheetName.toLowerCase()) : void 0;
37521
+ const refs = range ? expandRangeAddresses(range, write.values.length) : void 0;
37522
+ if (!range || !sheetPath || !refs) {
37523
+ unresolved += 1;
37524
+ continue;
37525
+ }
37526
+ const bucket = writesBySheetPath.get(sheetPath) ?? [];
37527
+ bucket.push({ refs, values: write.values, isNumeric: write.isNumeric });
37528
+ writesBySheetPath.set(sheetPath, bucket);
37529
+ }
37530
+ const builder = createSpreadsheetXmlBuilder();
37531
+ let changedAny = false;
37532
+ for (const [sheetPath, resolvedWrites] of writesBySheetPath) {
37533
+ const sheetFile = xlsxZip.file(sheetPath);
37534
+ if (!sheetFile) {
37535
+ unresolved += resolvedWrites.length;
37536
+ continue;
37537
+ }
37538
+ try {
37539
+ const sheetTree = parser.parse(await sheetFile.async("string"));
37540
+ const cellWrites = resolvedWrites.flatMap(
37541
+ ({ refs, values, isNumeric: isNumeric2 }) => refs.map((ref, i) => ({ ref, isNumeric: isNumeric2, value: values[i] }))
37542
+ );
37543
+ if (applyCellWritesToWorksheet(sheetTree, cellWrites)) {
37544
+ xlsxZip.file(sheetPath, builder.build(sheetTree));
37545
+ changedAny = true;
37546
+ }
37547
+ } catch {
37548
+ unresolved += resolvedWrites.length;
37549
+ }
37550
+ }
37551
+ if (options.atomic && unresolved > 0) {
37552
+ throw new Error("Chart label replacement could not update every source range.");
37553
+ }
37554
+ if (!changedAny) {
37555
+ return { unresolved };
37556
+ }
37557
+ const bytes = await xlsxZip.generateAsync({
37558
+ type: "uint8array",
37559
+ compression: "DEFLATE",
37560
+ compressionOptions: { level: 6 }
37561
+ });
37562
+ return { bytes, unresolved };
37563
+ }
37564
+
37565
+ // pptx/core/utils/chart-label-source.ts
37566
+ function formulaCount(value) {
37567
+ if (!value || typeof value !== "object") return 0;
37568
+ if (Array.isArray(value)) return value.reduce((total, item) => total + formulaCount(item), 0);
37569
+ return Object.entries(value).reduce(
37570
+ (total, [key2, child14]) => total + (key2 === "f" || key2.endsWith(":f") ? 1 : formulaCount(child14)),
37571
+ 0
37572
+ );
37573
+ }
37574
+ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes, series, categories, external, chartPartPath, resolve) {
37575
+ if (!chartSpace || seriesNodes.length !== series.length || !categories.length || external?.isExternal)
37576
+ return false;
37577
+ if (formulaCount(chartSpace) !== seriesNodes.reduce((sum, node) => sum + formulaCount(node), 0))
37578
+ return false;
37579
+ const writes = [];
37580
+ const labelOwners = /* @__PURE__ */ new Map();
37581
+ for (const [index, node] of seriesNodes.entries()) {
37582
+ const entry2 = series[index];
37583
+ for (const [name, numeric, values] of [
37584
+ ["tx", false, [entry2.name]],
37585
+ ["cat", false, [...categories]],
37586
+ ["val", true, entry2.values.map(String)]
37587
+ ]) {
37588
+ const container = xml.getChildByLocalName(node, name);
37589
+ if (!container) return false;
37590
+ const write = collectChartWorkbookWrite(xml, container, numeric, [...values]);
37591
+ if (write) {
37592
+ writes.push(write);
37593
+ if (!numeric) {
37594
+ const range = parseChartFormulaRange(write.formula);
37595
+ const addresses = range ? expandRangeAddresses(range, values.length) : void 0;
37596
+ if (!range || !addresses) return false;
37597
+ for (const [point, address] of addresses.entries()) {
37598
+ const key2 = `${range.sheetName.toLowerCase()}!${address}`;
37599
+ const owner = name === "tx" ? `series:${index}` : `category:${point}`;
37600
+ if (labelOwners.has(key2) && labelOwners.get(key2) !== owner) return false;
37601
+ labelOwners.set(key2, owner);
37602
+ }
37603
+ }
37604
+ } else if (external || !xml.getChildByLocalName(container, numeric ? "numLit" : "strLit") && !(name === "tx" && xml.getScalarChildByLocalName(container, "v") !== void 0))
37605
+ return false;
37606
+ }
37607
+ }
37608
+ if (formulaCount(chartSpace) !== writes.length) return false;
37609
+ if (!external) return writes.length === 0;
37610
+ if (!external.targetPath || !external.embeddedWorkbookData) return false;
37611
+ const target = resolve(chartPartPath, external.targetPath);
37612
+ let references = 0;
37613
+ const parser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
37614
+ try {
37615
+ for (const path2 of Object.keys(zip.files)) {
37616
+ if (!path2.endsWith(".rels") || !path2.includes("/_rels/")) continue;
37617
+ const source = path2.replace("/_rels/", "/").slice(0, -5);
37618
+ const tree = parser.parse(await zip.file(path2).async("string"));
37619
+ for (const rel of xmlChildren(xmlChild(tree, "Relationships"), "Relationship")) {
37620
+ const relationshipTarget2 = xmlAttr(rel, "Target");
37621
+ if (relationshipTarget2 && xmlAttr(rel, "TargetMode") !== "External" && resolve(source, relationshipTarget2) === target)
37622
+ references++;
37623
+ }
37624
+ }
37625
+ if (references !== 1) return false;
37626
+ await writeChartWorkbookUpdates(external.embeddedWorkbookData, writes, {
37627
+ atomic: true,
37628
+ requireCurrentValues: true
37629
+ });
37630
+ return true;
37631
+ } catch {
37632
+ return false;
37633
+ }
37634
+ }
37635
+
37298
37636
  // pptx/core/utils/chart-band-fmts.ts
37299
37637
  function safeUnsignedInt(val) {
37300
37638
  const n = Number(val);
@@ -42485,7 +42823,7 @@ function saveModernSlideComments(init) {
42485
42823
  rawXml: init.slide.modernCommentPart?.rawXml
42486
42824
  };
42487
42825
  }
42488
- var nextRelationshipId = (relationships2) => {
42826
+ var nextRelationshipId2 = (relationships2) => {
42489
42827
  const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] || "")));
42490
42828
  let index = 1;
42491
42829
  while (used.has(`rId${index}`)) {
@@ -42528,7 +42866,7 @@ async function persistModernCommentPackage(init) {
42528
42866
  authorPath,
42529
42867
  init.xmlBuilder.build(buildModernAuthorPart(init.authors, init.authorRoot))
42530
42868
  );
42531
- relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") || nextRelationshipId(retained);
42869
+ relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") || nextRelationshipId2(retained);
42532
42870
  retained.push({
42533
42871
  ...existing || {},
42534
42872
  "@_Id": relationshipId,
@@ -43950,7 +44288,7 @@ function buildContentTypesXml(overrides) {
43950
44288
  }
43951
44289
  async function buildMetroBlobPackage(input) {
43952
44290
  const root = ROOT[input.kind];
43953
- const zip = new JSZip4();
44291
+ const zip = new JSZip5();
43954
44292
  const overrides = new Map([
43955
44293
  [root.path, root.contentType],
43956
44294
  ...input.parts.contentTypes,
@@ -44239,7 +44577,7 @@ async function buildOne(zip, slidePath, slideXml3, element) {
44239
44577
  });
44240
44578
  }
44241
44579
  async function buildMetroBlobs(pptxBytes, slides) {
44242
- const zip = await JSZip4.loadAsync(pptxBytes);
44580
+ const zip = await JSZip5.loadAsync(pptxBytes);
44243
44581
  const slidePaths = await orderedSlidePaths(zip);
44244
44582
  const out = /* @__PURE__ */ new Map();
44245
44583
  for (let i = 0; i < slides.length; i++) {
@@ -46856,7 +47194,7 @@ function withDeclaration(xml) {
46856
47194
  ${body}`;
46857
47195
  }
46858
47196
  async function zipParts(parts) {
46859
- const zip = new JSZip4();
47197
+ const zip = new JSZip5();
46860
47198
  for (const [name, text] of parts) {
46861
47199
  zip.file(name, text);
46862
47200
  }
@@ -46903,7 +47241,7 @@ async function buildMasterRoundTrip(source) {
46903
47241
  };
46904
47242
  }
46905
47243
  async function buildDeckMasterRoundTripsFromPptx(pptxBytes) {
46906
- const zip = await JSZip4.loadAsync(pptxBytes);
47244
+ const zip = await JSZip5.loadAsync(pptxBytes);
46907
47245
  const slidePaths = await readSlideMasterPaths(zip);
46908
47246
  const masterPaths = [...new Set(slidePaths)];
46909
47247
  if (masterPaths.length === 0) {
@@ -49541,7 +49879,7 @@ function upsertRelationship(relationships2, entry2, target) {
49541
49879
  (item) => String(item["@_Id"] ?? "") === entry2.relId && isCustomXmlRelationship(item["@_Type"])
49542
49880
  );
49543
49881
  if (!relationship) {
49544
- entry2.relId = nextRelationshipId2(relationships2);
49882
+ entry2.relId = nextRelationshipId3(relationships2);
49545
49883
  relationship = {};
49546
49884
  relationships2.push(relationship);
49547
49885
  }
@@ -49609,7 +49947,7 @@ function relativeTarget2(source, target) {
49609
49947
  }
49610
49948
  return [...from.map(() => ".."), ...to].join("/");
49611
49949
  }
49612
- function nextRelationshipId2(relationships2) {
49950
+ function nextRelationshipId3(relationships2) {
49613
49951
  const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
49614
49952
  let index = 1;
49615
49953
  while (used.has(`rId${index}`)) {
@@ -49855,7 +50193,7 @@ async function upsertTagRelationship(zip, codec, collection) {
49855
50193
  (entry2) => String(entry2["@_Id"] ?? "") === collection.relationshipId && String(entry2["@_Type"] ?? "") === TAG_RELATIONSHIP_TYPE
49856
50194
  );
49857
50195
  if (!relationship) {
49858
- collection.relationshipId = nextRelationshipId3(relationships2);
50196
+ collection.relationshipId = nextRelationshipId4(relationships2);
49859
50197
  relationship = {};
49860
50198
  relationships2.push(relationship);
49861
50199
  }
@@ -49914,7 +50252,7 @@ function relativeTarget3(source, target) {
49914
50252
  }
49915
50253
  return [...from.map(() => ".."), ...to].join("/");
49916
50254
  }
49917
- function nextRelationshipId3(relationships2) {
50255
+ function nextRelationshipId4(relationships2) {
49918
50256
  const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
49919
50257
  let index = 1;
49920
50258
  while (used.has(`rId${index}`)) {
@@ -49932,6 +50270,14 @@ function ensureArray9(value) {
49932
50270
  return Array.isArray(value) ? value : [value];
49933
50271
  }
49934
50272
 
50273
+ // pptx/core/utils/chart-workbook-data-signature.ts
50274
+ function chartWorkbookDataSignature(data) {
50275
+ return JSON.stringify({
50276
+ categories: data.dateCategories?.values ?? data.categories,
50277
+ series: data.series.map((series) => ({ name: series.name, values: series.values }))
50278
+ });
50279
+ }
50280
+
49935
50281
  // pptx/core/utils/chart-axis-deleted.ts
49936
50282
  function authoredDeleted(node) {
49937
50283
  if (node === void 0) {
@@ -50961,6 +51307,28 @@ function realignOrCollapseTitleRuns(staleRuns, newTitle) {
50961
51307
  return [{ ...staleRuns[0], text: newTitle }];
50962
51308
  }
50963
51309
 
51310
+ // pptx/core/utils/chart-title-text-edit.ts
51311
+ function patchChartTitleRunText(title, runs, local) {
51312
+ const tx = title[findKey(title, "tx", local) ?? ""];
51313
+ const rich = tx?.[findKey(tx, "rich", local) ?? ""];
51314
+ const raw = rich?.[findKey(rich, "p", local) ?? ""];
51315
+ const paragraphs = Array.isArray(raw) ? raw : raw ? [raw] : [];
51316
+ if (paragraphs.length !== 1) return false;
51317
+ const paragraph = paragraphs[0];
51318
+ if (findKey(paragraph, "br", local) || findKey(paragraph, "fld", local)) return false;
51319
+ const rawRuns = paragraph[findKey(paragraph, "r", local) ?? ""];
51320
+ const original = Array.isArray(rawRuns) ? rawRuns : rawRuns ? [rawRuns] : [];
51321
+ if (original.length !== runs.length) return false;
51322
+ const keys = original.map((run) => findKey(run, "t", local));
51323
+ if (keys.some((key2) => !key2)) return false;
51324
+ for (const [index, value] of original.entries()) {
51325
+ const run = value, key2 = keys[index];
51326
+ const text = run[key2];
51327
+ run[key2] = text && typeof text === "object" && !Array.isArray(text) ? { ...text, "#text": runs[index].text } : runs[index].text;
51328
+ }
51329
+ return true;
51330
+ }
51331
+
50964
51332
  // pptx/core/utils/chart-title-serializer.ts
50965
51333
  function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefix: "c" }) {
50966
51334
  const { prefix } = options;
@@ -50986,11 +51354,18 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
50986
51354
  runs = realignOrCollapseTitleRuns(staleRuns, model.title);
50987
51355
  }
50988
51356
  let titleNode = existingKey ? chartRoot[existingKey] : void 0;
51357
+ const textOnlyStylesMatch = Boolean(
51358
+ runs && model.titleTextOnlyStyles?.length === runs.length && runs.every(
51359
+ (run, index) => ["bold", "italic", "fontSize", "color"].every(
51360
+ (key2) => run[key2] === model.titleTextOnlyStyles[index][key2]
51361
+ )
51362
+ )
51363
+ );
50989
51364
  if (runs && titleNode && typeof titleNode === "object") {
50990
51365
  const existingTexts = [];
50991
51366
  collectAllText(titleNode, getLocalName2, existingTexts);
50992
51367
  const newTexts = runs.map((run) => run.text);
50993
- if (existingTexts.length === newTexts.length && existingTexts.every((text, index) => text === newTexts[index])) {
51368
+ if ((!model.titleTextOnly || textOnlyStylesMatch) && existingTexts.length === newTexts.length && existingTexts.every((text, index) => text === newTexts[index])) {
50994
51369
  runs = void 0;
50995
51370
  }
50996
51371
  }
@@ -51002,6 +51377,12 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
51002
51377
  insertAt(chartRoot, 0, `${prefix}:title`, titleNode);
51003
51378
  }
51004
51379
  } else if (runs) {
51380
+ if (model.titleTextOnly && textOnlyStylesMatch) {
51381
+ if (!patchChartTitleRunText(titleNode, runs, getLocalName2))
51382
+ throw new Error("This chart title cannot be replaced without changing its text source");
51383
+ if (prefix === "c") setAutoTitleDeleted(chartRoot, false, getLocalName2);
51384
+ return true;
51385
+ }
51005
51386
  const txKey = findKey(titleNode, "tx", getLocalName2);
51006
51387
  if (txKey) {
51007
51388
  titleNode[txKey] = buildTitleTextFromRuns(prefix, runs);
@@ -51171,123 +51552,6 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
51171
51552
  }
51172
51553
  chartRoot[titleKey] = title;
51173
51554
  }
51174
- function collectChartWorkbookWrite(xmlLookupService, container, isNumeric2, values) {
51175
- if (!container) {
51176
- return void 0;
51177
- }
51178
- const refNode = xmlLookupService.getChildByLocalName(container, isNumeric2 ? "numRef" : "strRef");
51179
- const formula = refNode ? xmlLookupService.getScalarChildByLocalName(refNode, "f") : void 0;
51180
- return formula ? { formula, isNumeric: isNumeric2, values } : void 0;
51181
- }
51182
- function createSpreadsheetXmlParser() {
51183
- return new XMLParser({
51184
- ignoreAttributes: false,
51185
- attributeNamePrefix: "@_",
51186
- trimValues: false,
51187
- tagValueProcessor: (tagName, tagValue) => preservesSpreadsheetXmlWhitespace(tagName) ? tagValue : tagValue.trim()
51188
- });
51189
- }
51190
- function createSpreadsheetXmlBuilder() {
51191
- return new XMLBuilder({
51192
- ignoreAttributes: false,
51193
- attributeNamePrefix: "@_",
51194
- suppressBooleanAttributes: false,
51195
- format: false
51196
- });
51197
- }
51198
- async function resolveWorksheetPathsByName(xlsxZip, parser) {
51199
- const result = /* @__PURE__ */ new Map();
51200
- const workbookFile = xlsxZip.file("xl/workbook.xml");
51201
- const relsFile = xlsxZip.file("xl/_rels/workbook.xml.rels");
51202
- if (!workbookFile || !relsFile) {
51203
- return result;
51204
- }
51205
- try {
51206
- const workbookTree = parser.parse(await workbookFile.async("string"));
51207
- const relsTree = parser.parse(await relsFile.async("string"));
51208
- const targetByRelId = /* @__PURE__ */ new Map();
51209
- const relationships2 = xmlChild(relsTree, "Relationships");
51210
- for (const rel of xmlChildren(relationships2, "Relationship")) {
51211
- const id = xmlAttr(rel, "Id");
51212
- const target = xmlAttr(rel, "Target");
51213
- if (id && target) {
51214
- targetByRelId.set(id, target);
51215
- }
51216
- }
51217
- const workbookRoot = xmlChild(workbookTree, "workbook");
51218
- const sheets = xmlChild(workbookRoot, "sheets");
51219
- for (const sheet of xmlChildren(sheets, "sheet")) {
51220
- const name = xmlAttr(sheet, "name");
51221
- const relId = xmlAttr(sheet, "r:id") ?? xmlAttr(sheet, "id");
51222
- const target = relId ? targetByRelId.get(relId) : void 0;
51223
- if (name && target) {
51224
- result.set(name.toLowerCase(), resolveWorkbookPartPath(target));
51225
- }
51226
- }
51227
- } catch {
51228
- }
51229
- return result;
51230
- }
51231
- function resolveWorkbookPartPath(target) {
51232
- return target.startsWith("/") ? target.slice(1) : `xl/${target}`;
51233
- }
51234
- async function writeChartWorkbookUpdates(xlsxBytes, writes) {
51235
- if (writes.length === 0) {
51236
- return { unresolved: 0 };
51237
- }
51238
- let xlsxZip;
51239
- try {
51240
- xlsxZip = await JSZip4.loadAsync(xlsxBytes);
51241
- } catch {
51242
- return { unresolved: writes.length };
51243
- }
51244
- const parser = createSpreadsheetXmlParser();
51245
- const sheetPathByName = await resolveWorksheetPathsByName(xlsxZip, parser);
51246
- const writesBySheetPath = /* @__PURE__ */ new Map();
51247
- let unresolved = 0;
51248
- for (const write of writes) {
51249
- const range = parseChartFormulaRange(write.formula);
51250
- const sheetPath = range ? sheetPathByName.get(range.sheetName.toLowerCase()) : void 0;
51251
- const refs = range ? expandRangeAddresses(range, write.values.length) : void 0;
51252
- if (!range || !sheetPath || !refs) {
51253
- unresolved += 1;
51254
- continue;
51255
- }
51256
- const bucket = writesBySheetPath.get(sheetPath) ?? [];
51257
- bucket.push({ refs, values: write.values, isNumeric: write.isNumeric });
51258
- writesBySheetPath.set(sheetPath, bucket);
51259
- }
51260
- const builder = createSpreadsheetXmlBuilder();
51261
- let changedAny = false;
51262
- for (const [sheetPath, resolvedWrites] of writesBySheetPath) {
51263
- const sheetFile = xlsxZip.file(sheetPath);
51264
- if (!sheetFile) {
51265
- unresolved += resolvedWrites.length;
51266
- continue;
51267
- }
51268
- try {
51269
- const sheetTree = parser.parse(await sheetFile.async("string"));
51270
- const cellWrites = resolvedWrites.flatMap(
51271
- ({ refs, values, isNumeric: isNumeric2 }) => refs.map((ref, i) => ({ ref, isNumeric: isNumeric2, value: values[i] }))
51272
- );
51273
- if (applyCellWritesToWorksheet(sheetTree, cellWrites)) {
51274
- xlsxZip.file(sheetPath, builder.build(sheetTree));
51275
- changedAny = true;
51276
- }
51277
- } catch {
51278
- unresolved += resolvedWrites.length;
51279
- }
51280
- }
51281
- if (!changedAny) {
51282
- return { unresolved };
51283
- }
51284
- const bytes = await xlsxZip.generateAsync({
51285
- type: "uint8array",
51286
- compression: "DEFLATE",
51287
- compressionOptions: { level: 6 }
51288
- });
51289
- return { bytes, unresolved };
51290
- }
51291
51555
 
51292
51556
  // pptx/core/core/runtime/chart-cx-update-data.ts
51293
51557
  function findKey20(node, localName15, getLocalName2) {
@@ -51605,13 +51869,19 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
51605
51869
  }
51606
51870
 
51607
51871
  // pptx/core/core/runtime/chart-external-workbook-save.ts
51608
- async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath, externalData, writes) {
51872
+ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath, externalData, writes, atomic = false) {
51873
+ if (atomic && externalData && (!externalData.targetPath || externalData.isExternal)) {
51874
+ throw new Error("Chart label replacement cannot update an external or missing workbook.");
51875
+ }
51609
51876
  if (writes.length === 0 || !externalData?.targetPath) {
51610
- return;
51877
+ return writes.length === 0;
51611
51878
  }
51612
51879
  const embeddingPath = deps.resolveImagePath(chartPartPath, externalData.targetPath);
51613
51880
  const looksEmbedded = embeddingPath.includes("embeddings/") && /\.xlsx$/iu.test(embeddingPath);
51614
- if (!looksEmbedded) {
51881
+ if (!looksEmbedded || externalData.isExternal) {
51882
+ if (atomic) {
51883
+ throw new Error("Chart label replacement requires an embedded .xlsx workbook.");
51884
+ }
51615
51885
  deps.reportWarning({
51616
51886
  code: "CHART_EXTERNAL_DATA_WRITEBACK_UNSUPPORTED",
51617
51887
  message: "Chart data changes were saved to the cached values only: the linked data source is external or not an embedded .xlsx workbook, so it was not updated.",
@@ -51620,10 +51890,13 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
51620
51890
  slideId: slidePath,
51621
51891
  xmlPath: chartPartPath
51622
51892
  });
51623
- return;
51893
+ return false;
51624
51894
  }
51625
51895
  const xlsxFile = deps.zip.file(embeddingPath);
51626
51896
  if (!xlsxFile) {
51897
+ if (atomic) {
51898
+ throw new Error("Chart label replacement workbook is missing.");
51899
+ }
51627
51900
  deps.reportWarning({
51628
51901
  code: "CHART_EMBEDDED_WORKBOOK_MISSING",
51629
51902
  message: "Chart data changes were saved to the cached values only: the referenced embedded workbook was not found in the package.",
@@ -51632,12 +51905,15 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
51632
51905
  slideId: slidePath,
51633
51906
  xmlPath: embeddingPath
51634
51907
  });
51635
- return;
51908
+ return false;
51636
51909
  }
51637
51910
  let xlsxBytes;
51638
51911
  try {
51639
51912
  xlsxBytes = await xlsxFile.async("uint8array");
51640
51913
  } catch {
51914
+ if (atomic) {
51915
+ throw new Error("Chart label replacement workbook cannot be read.");
51916
+ }
51641
51917
  deps.reportWarning({
51642
51918
  code: "CHART_EMBEDDED_WORKBOOK_UNREADABLE",
51643
51919
  message: "Chart data changes were saved to the cached values only: the referenced embedded workbook could not be read.",
@@ -51646,9 +51922,9 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
51646
51922
  slideId: slidePath,
51647
51923
  xmlPath: embeddingPath
51648
51924
  });
51649
- return;
51925
+ return false;
51650
51926
  }
51651
- const result = await writeChartWorkbookUpdates(xlsxBytes, writes);
51927
+ const result = await writeChartWorkbookUpdates(xlsxBytes, writes, { atomic });
51652
51928
  if (result.bytes) {
51653
51929
  deps.zip.file(embeddingPath, result.bytes);
51654
51930
  }
@@ -51662,6 +51938,7 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
51662
51938
  xmlPath: embeddingPath
51663
51939
  });
51664
51940
  }
51941
+ return result.unresolved === 0;
51665
51942
  }
51666
51943
 
51667
51944
  // pptx/core/core/runtime/chart-part-registration.ts
@@ -54007,7 +54284,7 @@ var PptxHandlerRuntime = class {
54007
54284
  */
54008
54285
  savedSlideFingerprints = /* @__PURE__ */ new Map();
54009
54286
  /**
54010
- * `chartData` exactly as it stood right after `enrichChartData` parsed it,
54287
+ * `chartData` as parsed or last serialized into the current ZIP,
54011
54288
  * serialized to JSON and keyed by `chartPartPath`. The save pipeline used
54012
54289
  * to re-serialize EVERY chart part on any slide rewrite regardless of
54013
54290
  * whether the chart itself was touched, which materializes the load-time
@@ -54020,6 +54297,10 @@ var PptxHandlerRuntime = class {
54020
54297
  * untouched chart part pass through byte-for-byte instead.
54021
54298
  */
54022
54299
  chartDataBaselines = /* @__PURE__ */ new Map();
54300
+ /** Pending chart requests also retain warned workbook writes for later retry. */
54301
+ pendingChartUpdates;
54302
+ /** Last fully reconciled workbook data plus whether a write-back needs retry. */
54303
+ chartWorkbookDataBaselines = /* @__PURE__ */ new Map();
54023
54304
  /** Per-slide relationship maps: slide path -> (rId -> target path). */
54024
54305
  slideRelsMap = /* @__PURE__ */ new Map();
54025
54306
  /** Tracks relationship IDs with TargetMode="External" per slide/part path. */
@@ -62051,8 +62332,6 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62051
62332
  console.warn("Failed to serialize table data:", e);
62052
62333
  }
62053
62334
  }
62054
- /** Pending chart data updates to process in the async save method. */
62055
- pendingChartUpdates;
62056
62335
  /**
62057
62336
  * Record `chartData` as parsed, straight off `enrichChartData`, as this
62058
62337
  * chart's load-time baseline. See {@link chartDataBaselines}.
@@ -62062,6 +62341,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62062
62341
  return;
62063
62342
  }
62064
62343
  this.chartDataBaselines.set(chartData.chartPartPath, JSON.stringify(chartData));
62344
+ this.chartWorkbookDataBaselines.set(chartData.chartPartPath, {
62345
+ signature: chartWorkbookDataSignature(chartData),
62346
+ pending: false
62347
+ });
62065
62348
  }
62066
62349
  /**
62067
62350
  * Collect chart data for deferred async processing during save.
@@ -62078,12 +62361,28 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62078
62361
  /**
62079
62362
  * Process all pending chart data updates (called from the async save method).
62080
62363
  */
62081
- async processPendingChartUpdates() {
62364
+ async processPendingChartUpdates(slides) {
62082
62365
  if (!this.pendingChartUpdates || this.pendingChartUpdates.length === 0) {
62083
62366
  return;
62084
62367
  }
62368
+ if (slides) {
62369
+ const current = /* @__PURE__ */ new Map();
62370
+ const visit = (elements2, slidePath) => {
62371
+ for (const element of elements2) {
62372
+ if (element.type === "group") visit(element.children, slidePath);
62373
+ else if (element.type === "chart" && element.chartData?.chartPartPath) {
62374
+ current.set(element.chartData.chartPartPath, {
62375
+ chartData: element.chartData,
62376
+ slidePath
62377
+ });
62378
+ }
62379
+ }
62380
+ };
62381
+ for (const slide of slides) visit(slide.elements, slide.id);
62382
+ this.pendingChartUpdates = [...current.values()];
62383
+ }
62085
62384
  for (const { chartData, slidePath } of this.pendingChartUpdates) {
62086
- if (chartData.chartPartPath && this.chartDataBaselines.get(chartData.chartPartPath) === JSON.stringify(chartData)) {
62385
+ if (chartData.chartPartPath && !this.chartWorkbookDataBaselines.get(chartData.chartPartPath)?.pending && this.chartDataBaselines.get(chartData.chartPartPath) === JSON.stringify(chartData)) {
62087
62386
  continue;
62088
62387
  }
62089
62388
  if (chartData.colorPalette && chartData.colorStylePartPath) {
@@ -62502,7 +62801,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62502
62801
  {
62503
62802
  title: chartData.title,
62504
62803
  hasTitle: chartData.style?.hasTitle,
62505
- titleRuns: chartData.titleRuns
62804
+ titleRuns: chartData.titleRuns,
62805
+ titleTextOnly: chartData.titleTextOnly,
62806
+ titleTextOnlyStyles: chartData.titleTextOnlyStyles
62506
62807
  },
62507
62808
  (key2) => this.compatibilityService.getXmlLocalName(key2)
62508
62809
  );
@@ -62694,23 +62995,41 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62694
62995
  }
62695
62996
  }
62696
62997
  await this.syncChartUserShapesToXml(chartSpace, chartData, chartPartPath);
62998
+ const serializedBaseline = this.chartDataBaselines.get(chartPartPath);
62999
+ const signature = chartWorkbookDataSignature(chartData);
63000
+ const workbookBaseline = this.chartWorkbookDataBaselines.get(chartPartPath);
63001
+ const previousSignature = workbookBaseline?.signature ?? (serializedBaseline ? chartWorkbookDataSignature(JSON.parse(serializedBaseline)) : void 0);
63002
+ const workbookDataChanged = workbookBaseline?.pending || signature !== previousSignature;
63003
+ if (workbookDataChanged) {
63004
+ const complete = await saveChartExternalWorkbookUpdates(
63005
+ {
63006
+ zip: this.zip,
63007
+ resolveImagePath: (basePath, target) => this.resolveImagePath(basePath, target),
63008
+ reportWarning: (warning) => this.compatibilityService.reportWarning(warning)
63009
+ },
63010
+ chartPartPath,
63011
+ slidePath,
63012
+ chartData.externalData,
63013
+ workbookWrites,
63014
+ chartData.dataLabelTextOnly ?? false
63015
+ );
63016
+ this.chartWorkbookDataBaselines.set(chartPartPath, {
63017
+ signature: complete ? signature : previousSignature ?? signature,
63018
+ pending: !complete
63019
+ });
63020
+ }
62697
63021
  this.zip.file(chartPartPath, this.builder.build(chartXmlData));
62698
- await saveChartExternalWorkbookUpdates(
62699
- {
62700
- zip: this.zip,
62701
- resolveImagePath: (basePath, target) => this.resolveImagePath(basePath, target),
62702
- reportWarning: (warning) => this.compatibilityService.reportWarning(warning)
62703
- },
62704
- chartPartPath,
62705
- slidePath,
62706
- chartData.externalData,
62707
- workbookWrites
62708
- );
63022
+ this.chartDataBaselines.set(chartPartPath, JSON.stringify(chartData));
62709
63023
  } catch (e) {
63024
+ if (chartData.dataLabelTextOnly) {
63025
+ throw e;
63026
+ }
62710
63027
  console.warn(`[pptx-save] Failed to serialize chart data for ${chartPartPath}:`, e);
62711
63028
  }
62712
63029
  }
62713
- this.pendingChartUpdates = void 0;
63030
+ this.pendingChartUpdates = this.pendingChartUpdates.filter(
63031
+ ({ chartData }) => chartData.chartPartPath && this.chartWorkbookDataBaselines.get(chartData.chartPartPath)?.pending
63032
+ );
62714
63033
  }
62715
63034
  /**
62716
63035
  * Route a chart save that the 2006 `c:*Chart` update loop cannot handle:
@@ -70474,16 +70793,37 @@ var PptxHandlerRuntime50 = class extends PptxHandlerRuntime49 {
70474
70793
  /** Ensure authored notes have the global notes-master OPC infrastructure. */
70475
70794
  async ensureNotesMasterForAuthoredNotes(slides, constants) {
70476
70795
  const needsNotes = slides.some(
70477
- (slide) => slide.notes !== void 0 || Boolean(slide.notesSegments?.length)
70796
+ (slide) => Boolean(slide.notes) || Boolean(slide.notesSegments?.some((segment) => segment.text))
70478
70797
  );
70479
70798
  if (!needsNotes || Object.keys(this.zip.files).some(
70480
70799
  (path2) => /^ppt\/notesMasters\/notesMaster\d+\.xml$/u.test(path2)
70481
70800
  )) {
70482
70801
  return;
70483
70802
  }
70803
+ const relsPath2 = "ppt/_rels/presentation.xml.rels";
70804
+ const relsXml = await this.zip.file(relsPath2)?.async("string");
70805
+ if (!relsXml || !this.presentationData) return;
70806
+ if (Array.from(parseRelationships(relsXml).values()).some(
70807
+ (relationship) => relationship.type.endsWith("/notesMaster") && relationship.mode !== "External" && this.zip.file(resolvePartPath("ppt/presentation.xml", relationship.target))
70808
+ ))
70809
+ return;
70484
70810
  const strict = constants.conformance === "strict";
70485
70811
  const masterPath = "ppt/notesMasters/notesMaster1.xml";
70486
- const themePath = Object.keys(this.zip.files).find((path2) => /^ppt\/theme\/theme\d+\.xml$/u.test(path2)) ?? "ppt/theme/theme1.xml";
70812
+ const sourceThemePath = Object.keys(this.zip.files).find((path2) => /^ppt\/theme\/theme\d+\.xml$/u.test(path2)) ?? "ppt/theme/theme1.xml";
70813
+ let themeIndex = 1;
70814
+ while (this.zip.file(`ppt/theme/theme${themeIndex}.xml`)) themeIndex += 1;
70815
+ const themePath = `ppt/theme/theme${themeIndex}.xml`;
70816
+ const themeBytes = await this.zip.file(sourceThemePath)?.async("uint8array");
70817
+ const theme = themeBytes ?? this.buildThemeXml(themePath, void 0);
70818
+ if (!theme) throw new Error("Cannot create a notes theme from the presentation state");
70819
+ this.zip.file(themePath, theme);
70820
+ const themeRelationships = await this.zip.file(`ppt/theme/_rels/${sourceThemePath.slice(sourceThemePath.lastIndexOf("/") + 1)}.rels`)?.async("uint8array");
70821
+ if (themeRelationships)
70822
+ this.zip.file(`ppt/theme/_rels/theme${themeIndex}.xml.rels`, themeRelationships);
70823
+ await this.addContentTypeOverride(
70824
+ `/${themePath}`,
70825
+ "application/vnd.openxmlformats-officedocument.theme+xml"
70826
+ );
70487
70827
  this.zip.file(masterPath, this.builder.build(this.buildDefaultNotesMaster(strict)));
70488
70828
  this.zip.file(
70489
70829
  "ppt/notesMasters/_rels/notesMaster1.xml.rels",
@@ -70498,11 +70838,6 @@ var PptxHandlerRuntime50 = class extends PptxHandlerRuntime49 {
70498
70838
  }
70499
70839
  })
70500
70840
  );
70501
- const relsPath2 = "ppt/_rels/presentation.xml.rels";
70502
- const relsXml = await this.zip.file(relsPath2)?.async("string");
70503
- if (!relsXml || !this.presentationData) {
70504
- return;
70505
- }
70506
70841
  const relsData = this.parser.parse(relsXml);
70507
70842
  const relsRoot = relsData["Relationships"] ?? {};
70508
70843
  const relationships2 = asArray7(relsRoot["Relationship"]);
@@ -71200,7 +71535,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
71200
71535
  saveSession,
71201
71536
  saveConstants
71202
71537
  );
71203
- await this.processPendingChartUpdates();
71538
+ await this.processPendingChartUpdates(slides);
71204
71539
  await this.ensureChartPartContentTypes();
71205
71540
  await this.ensureOleEmbeddingContentTypes();
71206
71541
  await this.processPendingOleContentUpdates();
@@ -80800,6 +81135,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
80800
81135
  );
80801
81136
  const autoUpdateAttr = externalDataNode["@_autoUpdate"];
80802
81137
  const autoUpdate = autoUpdateNode?.["@_val"] === "1" || autoUpdateNode?.["@_val"] === "true" || autoUpdateAttr === "1" || autoUpdateAttr === "true" || false;
81138
+ let isExternal = false;
80803
81139
  let targetPath;
80804
81140
  try {
80805
81141
  const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
@@ -80814,6 +81150,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
80814
81150
  for (const rel of rels) {
80815
81151
  if (String(rel?.["@_Id"] || "") === relId) {
80816
81152
  targetPath = String(rel?.["@_Target"] || "").trim() || void 0;
81153
+ isExternal = String(rel?.["@_TargetMode"] || "") === "External";
80817
81154
  break;
80818
81155
  }
80819
81156
  }
@@ -80822,7 +81159,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
80822
81159
  } catch {
80823
81160
  }
80824
81161
  let embeddedWorkbookData;
80825
- if (targetPath) {
81162
+ if (targetPath && !isExternal) {
80826
81163
  try {
80827
81164
  const embeddingPath = this.resolveImagePath(chartPartPath, targetPath);
80828
81165
  if (embeddingPath.includes("embeddings/") && embeddingPath.endsWith(".xlsx")) {
@@ -80836,6 +81173,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
80836
81173
  }
80837
81174
  return {
80838
81175
  relId,
81176
+ ...isExternal ? { isExternal: true } : {},
80839
81177
  targetPath,
80840
81178
  autoUpdate,
80841
81179
  ...embeddedWorkbookData ? { embeddedWorkbookData } : {}
@@ -81187,6 +81525,8 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
81187
81525
  ...result.categoryLevels ? { categoryLevels: result.categoryLevels } : {},
81188
81526
  series: result.series,
81189
81527
  title: cxTitleText,
81528
+ titleTextEditable: false,
81529
+ dataLabelTextEditable: false,
81190
81530
  style: chartStyle2,
81191
81531
  chartPartPath,
81192
81532
  chartRelationshipId,
@@ -81380,12 +81720,34 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
81380
81720
  colorAdapter
81381
81721
  );
81382
81722
  const style = chartStyleFromNeutral(neutral, this.extractChartStyle(chartSpace, chartRoot));
81723
+ const titleTx = reader.xml.getChildByLocalName(
81724
+ reader.xml.getChildByLocalName(chartRoot, "title"),
81725
+ "tx"
81726
+ );
81727
+ const titleRich = reader.xml.getChildByLocalName(titleTx, "rich");
81728
+ const titleParagraphs = reader.xml.getChildrenArrayByLocalName(titleRich, "p");
81729
+ const titleTextEditable = Boolean(
81730
+ titleRuns?.length && titleParagraphs.length === 1 && !Object.keys(titleParagraphs[0] ?? {}).some(
81731
+ (key2) => ["br", "fld"].includes(reader.localName(key2))
81732
+ )
81733
+ );
81383
81734
  const groupOptions = groupOptionsFromNeutral(groups[0]?.group, chartType);
81384
81735
  const linesAndChrome = this.readChartLinesAndChrome(neutral, tree, groups, reader);
81385
81736
  const facts = await this.readChartPartFacts(chartSpace, chartRoot, chartPartPath);
81386
81737
  const workbook = facts.embeddedWorkbookData;
81387
81738
  const dateCategories = rawDateCategories ? { ...rawDateCategories, date1904: neutral.date1904 ?? workbook?.date1904 ?? false } : void 0;
81388
81739
  const filled = applyEmbeddedWorkbookFallback(chartType, categories, built.series, workbook);
81740
+ const dataLabelTextEditable = !categoryLevels && !dateCategories && await chartLabelsHaveEditableSources(
81741
+ reader.xml,
81742
+ this.zip,
81743
+ chartSpace,
81744
+ built.seriesNodes,
81745
+ filled.series,
81746
+ filled.categories,
81747
+ facts.externalData,
81748
+ chartPartPath,
81749
+ this.resolveImagePath.bind(this)
81750
+ );
81389
81751
  const hasPicture = filled.series.some(
81390
81752
  (entry2) => entry2.picture || entry2.impliedPicture || entry2.dataPoints?.some((point) => point.picture || point.impliedPicture)
81391
81753
  );
@@ -81418,6 +81780,14 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
81418
81780
  ...built.filtered,
81419
81781
  title: neutralTitleText(neutral.title),
81420
81782
  ...titleRuns ? { titleRuns } : {},
81783
+ titleTextEditable,
81784
+ dataLabelTextEditable,
81785
+ ...dataLabelTextEditable ? {
81786
+ dataLabelSourceShape: {
81787
+ categoryCount: filled.categories.length,
81788
+ seriesValueCounts: filled.series.map((series) => series.values.length)
81789
+ }
81790
+ } : {},
81421
81791
  style,
81422
81792
  grouping: groupOptions.grouping,
81423
81793
  ...groupOptions,
@@ -81847,7 +82217,7 @@ var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
81847
82217
  );
81848
82218
  }
81849
82219
  try {
81850
- this.zip = await JSZip4.loadAsync(data);
82220
+ this.zip = await JSZip5.loadAsync(data);
81851
82221
  this.documentPropertiesUpdater = this.dependencyFactory.createDocumentPropertiesUpdater(
81852
82222
  this.zip,
81853
82223
  this.parser,
@@ -81885,6 +82255,8 @@ var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
81885
82255
  this.slideMap.clear();
81886
82256
  this.savedSlideFingerprints.clear();
81887
82257
  this.chartDataBaselines.clear();
82258
+ this.chartWorkbookDataBaselines.clear();
82259
+ this.pendingChartUpdates = void 0;
81888
82260
  this.layoutCache.clear();
81889
82261
  this.masterCache.clear();
81890
82262
  this.templateElementBaselines.reset();
@@ -82357,6 +82729,8 @@ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
82357
82729
  this.slideMap.clear();
82358
82730
  this.savedSlideFingerprints.clear();
82359
82731
  this.chartDataBaselines.clear();
82732
+ this.chartWorkbookDataBaselines.clear();
82733
+ this.pendingChartUpdates = void 0;
82360
82734
  this.slideRelsMap.clear();
82361
82735
  this.externalRelsMap.clear();
82362
82736
  this.layoutCache.clear();
@@ -82741,7 +83115,7 @@ var PptxHandlerRuntime101 = class _PptxHandlerRuntime extends PptxHandlerRuntime
82741
83115
  constructor(dependencyFactory = new PptxRuntimeDependencyFactory()) {
82742
83116
  super();
82743
83117
  this.dependencyFactory = dependencyFactory;
82744
- this.zip = new JSZip4();
83118
+ this.zip = new JSZip5();
82745
83119
  this.parser = this.dependencyFactory.createParser();
82746
83120
  this.builder = this.dependencyFactory.createBuilder();
82747
83121
  this.elementXmlBuilder = new PptxElementXmlBuilder({
@@ -85513,7 +85887,7 @@ function collectPictureIndexes(slide) {
85513
85887
  return indexes;
85514
85888
  }
85515
85889
  async function buildPptxPackage(deck) {
85516
- const zip = new JSZip4();
85890
+ const zip = new JSZip5();
85517
85891
  const usage = { fileNumbers: /* @__PURE__ */ new Map() };
85518
85892
  let mediaCounter = 0;
85519
85893
  for (const slide of deck.slides) {
@@ -86363,4 +86737,4 @@ var PptxHandler = class extends PptxHandlerCore {
86363
86737
  * `<p:extLst>` (optional)
86364
86738
  */
86365
86739
 
86366
- export { ConnectorXmlFactory, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_POWERPOINT_TABLE_STYLE_ID, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MAX_ZIP_ENTRY_COUNT, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime102 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, PresentationBuilder, STANDARD_LAYOUTS, SlideBuilder, TABLE_STYLE_PART_SEQUENCE, TextShapeXmlFactory, ZipBombError, addChartCategory, addChartSeries, addTableStyleToMap, applyAfterAnimationBehavior, applyConnectorShapeIds, applySoundToEffectCTn, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive, buildSingleEffectNode, buildSlideReferenceRemap, capturedPresetIds, capturedPresetNativeAnimation, capturedSubtypes, convertPptToPptx, createAutoNumberSequence, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createFreeformElement, createGroupElement, createImageElement, createMediaElement, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTableStyleEntry, createTextElement, deleteTableStyleFromMap, ensureChartData, ensureDataPoint, extractAfterAnimationFromSubTnLst, extractGraphicBuilds, extractTableCellTextRuns, generateTableStyleGuid, getCapturedPreset, getCapturedTree, isEncryptedLegacyPpt, isLegacyPpt, mergeNativeSoundIntoEditorAnimations, nextAutoNumber, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseCondition, parseConditionList, parseFilterToken, parseTimeTargetElement, rebuildTableStructureInRawXml, reconcileAnimationTargets, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveOoxmlPresetMapping, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setChartAreaFormat, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, validateSeriesIndex };
86740
+ export { ConnectorXmlFactory, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_POWERPOINT_TABLE_STYLE_ID, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MAX_ZIP_ENTRY_COUNT, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime102 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, PresentationBuilder, STANDARD_LAYOUTS, SlideBuilder, TABLE_STYLE_PART_SEQUENCE, TextShapeXmlFactory, ZipBombError, addChartCategory, addChartSeries, addTableStyleToMap, applyAfterAnimationBehavior, applyConnectorShapeIds, applySoundToEffectCTn, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive, buildRelationshipsXml, buildSingleEffectNode, buildSlideReferenceRemap, buildXml, capturedPresetIds, capturedPresetNativeAnimation, capturedSubtypes, clonePartGraph, convertPptToPptx, createAutoNumberSequence, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createFreeformElement, createGroupElement, createImageElement, createMediaElement, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTableStyleEntry, createTextElement, deleteTableStyleFromMap, elements, ensureChartData, ensureDataPoint, extractAfterAnimationFromSubTnLst, extractGraphicBuilds, extractTableCellTextRuns, first, generateTableStyleGuid, getCapturedPreset, getCapturedTree, isEncryptedLegacyPpt, isLegacyPpt, mergeNativeSoundIntoEditorAnimations, nextAutoNumber, nextRelationshipId, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseCondition, parseConditionList, parseFilterToken, parseRelationships, parseTimeTargetElement, parseXml, rebuildTableStructureInRawXml, reconcileAnimationTargets, relationshipsPartFor, relativePartTarget, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveOoxmlPresetMapping, resolvePartPath, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setChartAreaFormat, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, validateSeriesIndex };