ooxml-core 1.9.0 → 1.11.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 (202) hide show
  1. package/dist/PptxHandler-DNZHAHUY.cjs +12 -0
  2. package/dist/PptxHandler-E44KDHMQ.mjs +3 -0
  3. package/dist/{PptxHandler-EX4WBIQQ.mjs → PptxHandler-NROFYT2N.mjs} +2 -2
  4. package/dist/automation/index.cjs +3236 -2258
  5. package/dist/automation/index.mjs +3236 -2258
  6. package/dist/{chunk-SWF7KVL5.cjs → chunk-2UVH6RHI.cjs} +1608 -1163
  7. package/dist/{chunk-M76PHYRR.mjs → chunk-7DSZI7S6.mjs} +1 -1
  8. package/dist/{chunk-AT66SA5M.cjs → chunk-7QZGRB3T.cjs} +28 -10
  9. package/dist/chunk-ANZ4Q6I3.cjs +21 -0
  10. package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
  11. package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
  12. package/dist/{chunk-FIELY5PI.mjs → chunk-EC2W2MDY.mjs} +30 -2
  13. package/dist/chunk-EGTRL3QJ.mjs +19 -0
  14. package/dist/chunk-GXHKNSZX.mjs +9 -0
  15. package/dist/{chunk-OXHMZS7B.mjs → chunk-HCXUI5UC.mjs} +943 -273
  16. package/dist/chunk-HDQXPSHY.cjs +17 -0
  17. package/dist/chunk-KTYBFGEY.mjs +14 -0
  18. package/dist/chunk-QOO36KG4.cjs +42 -0
  19. package/dist/chunk-R2KZXD6U.mjs +39 -0
  20. package/dist/{chunk-IGOA57LE.mjs → chunk-U2DF3EGK.mjs} +1 -1
  21. package/dist/{chunk-OB277ZGE.mjs → chunk-UAY26XOI.mjs} +27 -9
  22. package/dist/{chunk-WSO4T2LJ.mjs → chunk-W5ARCUJB.mjs} +26 -3
  23. package/dist/chunk-XZPZHXV4.cjs +12 -0
  24. package/dist/{chunk-LCS3J3QI.mjs → chunk-YB5SRNFS.mjs} +717 -272
  25. package/dist/docx/layout/adapt-table.d.ts +2 -2
  26. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  28. package/dist/docx/layout/index.cjs +554 -83
  29. package/dist/docx/layout/index.mjs +554 -84
  30. package/dist/docx/layout/nested-fragment-edges.d.ts +9 -0
  31. package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -0
  32. package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
  33. package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
  34. package/dist/docx/layout/page-cursor.d.ts +2 -0
  35. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  36. package/dist/docx/layout/result.d.ts +20 -0
  37. package/dist/docx/layout/result.d.ts.map +1 -1
  38. package/dist/docx/layout/table-border-layout.d.ts +16 -0
  39. package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
  40. package/dist/docx/layout/table-cell-layout.d.ts +3 -2
  41. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  42. package/dist/docx/layout/table-content.d.ts +4 -0
  43. package/dist/docx/layout/table-content.d.ts.map +1 -0
  44. package/dist/docx/layout/table-footnotes.d.ts +5 -0
  45. package/dist/docx/layout/table-footnotes.d.ts.map +1 -1
  46. package/dist/docx/layout/table-frames.d.ts +4 -0
  47. package/dist/docx/layout/table-frames.d.ts.map +1 -0
  48. package/dist/docx/layout/table-layout.d.ts +8 -3
  49. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  50. package/dist/docx/layout/table-note-completion.d.ts +5 -0
  51. package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
  52. package/dist/docx/layout/table-note-stories.d.ts +6 -0
  53. package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
  54. package/dist/pptx/automation/index.cjs +801 -296
  55. package/dist/pptx/automation/index.d.ts +5 -4
  56. package/dist/pptx/automation/index.d.ts.map +1 -1
  57. package/dist/pptx/automation/index.mjs +5 -5
  58. package/dist/pptx/chunks/{text-operations-BLodkuXE.d.ts → elements-DD3UGOMd.d.ts} +27 -3248
  59. package/dist/pptx/chunks/elements-DD3UGOMd.d.ts.map +1 -0
  60. package/dist/pptx/chunks/{index-B4cnSPNz.d.ts → index-BZrFyNtU.d.ts} +113 -5
  61. package/dist/pptx/chunks/index-BZrFyNtU.d.ts.map +1 -0
  62. package/dist/pptx/chunks/{index-BZh-IMkN.d.ts → index-DdX02BSm.d.ts} +19 -3
  63. package/dist/pptx/chunks/index-DdX02BSm.d.ts.map +1 -0
  64. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts +1512 -0
  65. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts.map +1 -0
  66. package/dist/pptx/chunks/text-D49FKllA.d.ts +1473 -0
  67. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +1 -0
  68. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts +3261 -0
  69. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts.map +1 -0
  70. package/dist/pptx/cli/index.cjs +801 -296
  71. package/dist/pptx/cli/index.d.ts +1 -1
  72. package/dist/pptx/cli/index.mjs +4 -4
  73. package/dist/pptx/converter/index.cjs +1 -0
  74. package/dist/pptx/converter/index.d.ts +1 -1
  75. package/dist/pptx/converter/index.mjs +2 -2
  76. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
  77. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
  78. package/dist/pptx/editor/render/find-replace.cjs +19 -18
  79. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  80. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  81. package/dist/pptx/editor/render/font-family-update.cjs +14 -0
  82. package/dist/pptx/editor/render/font-family-update.d.ts +17 -0
  83. package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -0
  84. package/dist/pptx/editor/render/font-family-update.mjs +1 -0
  85. package/dist/pptx/editor/render/paragraph-geometry-overrides.cjs +14 -0
  86. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +17 -0
  87. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -0
  88. package/dist/pptx/editor/render/paragraph-geometry-overrides.mjs +12 -0
  89. package/dist/pptx/editor/render/remap-text.cjs +2 -2
  90. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  91. package/dist/pptx/editor/render/remap-text.mjs +1 -1
  92. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  93. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  94. package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
  95. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  96. package/dist/pptx/editor/render/text-content-style.cjs +18 -0
  97. package/dist/pptx/editor/render/text-content-style.d.ts +9 -0
  98. package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -0
  99. package/dist/pptx/editor/render/text-content-style.mjs +5 -0
  100. package/dist/pptx/editor/render/text-runs-style-patch.cjs +17 -0
  101. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +7 -0
  102. package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -0
  103. package/dist/pptx/editor/render/text-runs-style-patch.mjs +15 -0
  104. package/dist/pptx/editor/render/text-style-scope.cjs +173 -0
  105. package/dist/pptx/editor/render/text-style-scope.d.ts +76 -0
  106. package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -0
  107. package/dist/pptx/editor/render/text-style-scope.mjs +164 -0
  108. package/dist/pptx/editor/render/theme-editor-model.cjs +1 -1
  109. package/dist/pptx/editor/render/theme-editor-model.mjs +1 -1
  110. package/dist/pptx/editor/render/update-text-segment-style.cjs +11 -0
  111. package/dist/pptx/editor/render/update-text-segment-style.d.ts +14 -0
  112. package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -0
  113. package/dist/pptx/editor/render/update-text-segment-style.mjs +2 -0
  114. package/dist/pptx/index.cjs +1091 -296
  115. package/dist/pptx/index.d.ts +7 -5
  116. package/dist/pptx/index.mjs +5 -5
  117. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  118. package/dist/teams/index.cjs +590 -122
  119. package/dist/teams/index.mjs +590 -122
  120. package/dist/visio/date-cache.d.ts +3 -0
  121. package/dist/visio/date-cache.d.ts.map +1 -0
  122. package/dist/visio/edit-commands.d.ts +3 -3
  123. package/dist/visio/edit-commands.d.ts.map +1 -1
  124. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  125. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  126. package/dist/visio/edit-text-field-commands.d.ts +15 -0
  127. package/dist/visio/edit-text-field-commands.d.ts.map +1 -1
  128. package/dist/visio/edit-text-field.d.ts +2 -2
  129. package/dist/visio/edit-text-field.d.ts.map +1 -1
  130. package/dist/visio/edit.d.ts +1 -1
  131. package/dist/visio/edit.d.ts.map +1 -1
  132. package/dist/visio/index.cjs +501 -220
  133. package/dist/visio/index.d.ts +1 -1
  134. package/dist/visio/index.d.ts.map +1 -1
  135. package/dist/visio/index.mjs +501 -220
  136. package/dist/visio/model.d.ts +6 -0
  137. package/dist/visio/model.d.ts.map +1 -1
  138. package/dist/visio/shape-metadata.d.ts.map +1 -1
  139. package/dist/visio/shapes.d.ts.map +1 -1
  140. package/dist/visio/style.d.ts +1 -1
  141. package/dist/visio/style.d.ts.map +1 -1
  142. package/dist/visio/text-field-display.d.ts +3 -0
  143. package/dist/visio/text-field-display.d.ts.map +1 -1
  144. package/dist/visio/text-field-editability.d.ts +6 -0
  145. package/dist/visio/text-field-editability.d.ts.map +1 -0
  146. package/dist/visio/text-field-fraction.d.ts +3 -0
  147. package/dist/visio/text-field-fraction.d.ts.map +1 -0
  148. package/dist/visio/text-field-independent.d.ts +4 -0
  149. package/dist/visio/text-field-independent.d.ts.map +1 -0
  150. package/dist/visio/text-field-numeric.d.ts +1 -1
  151. package/dist/visio/text-field-numeric.d.ts.map +1 -1
  152. package/dist/visio/text-field-source.d.ts +6 -0
  153. package/dist/visio/text-field-source.d.ts.map +1 -0
  154. package/dist/visio/text-field-system-date.d.ts +4 -0
  155. package/dist/visio/text-field-system-date.d.ts.map +1 -0
  156. package/dist/visio/text-fields.d.ts +1 -0
  157. package/dist/visio/text-fields.d.ts.map +1 -1
  158. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  159. package/dist/visio/ui/index.cjs +514 -221
  160. package/dist/visio/ui/index.mjs +514 -221
  161. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  162. package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
  163. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  164. package/dist/xlsx/index.cjs +1362 -659
  165. package/dist/xlsx/index.mjs +1361 -660
  166. package/dist/xlsx/load/index.cjs +1091 -430
  167. package/dist/xlsx/load/index.mjs +1091 -430
  168. package/dist/xlsx/model-pivots.d.ts +31 -2
  169. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  170. package/dist/xlsx/pivot/admission.d.ts.map +1 -1
  171. package/dist/xlsx/pivot/aggregate.d.ts +3 -1
  172. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  173. package/dist/xlsx/pivot/data.d.ts +2 -2
  174. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  175. package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
  176. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
  177. package/dist/xlsx/pivot/hierarchy.d.ts +2 -4
  178. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
  179. package/dist/xlsx/pivot/index.d.ts +2 -0
  180. package/dist/xlsx/pivot/index.d.ts.map +1 -1
  181. package/dist/xlsx/pivot/measures.d.ts +13 -0
  182. package/dist/xlsx/pivot/measures.d.ts.map +1 -0
  183. package/dist/xlsx/pivot/page-filter-admission.d.ts +5 -0
  184. package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -0
  185. package/dist/xlsx/pivot/page-filter.d.ts +11 -0
  186. package/dist/xlsx/pivot/page-filter.d.ts.map +1 -0
  187. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  188. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  189. package/dist/xlsx/pivot/values-axis.d.ts +12 -0
  190. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
  191. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  192. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  193. package/dist/xlsx/ui/index.cjs +640 -137
  194. package/dist/xlsx/ui/index.mjs +640 -137
  195. package/package.json +2 -2
  196. package/dist/PptxHandler-AT7FVG5Q.mjs +0 -2
  197. package/dist/PptxHandler-VFSCECPL.cjs +0 -11
  198. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +0 -1
  199. package/dist/pptx/chunks/index-BZh-IMkN.d.ts.map +0 -1
  200. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts +0 -2970
  201. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
  202. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +0 -1
@@ -816,6 +816,7 @@ var init_presentation_field_keys = __esm({
816
816
  modernCommentAuthors: true,
817
817
  conformance: true,
818
818
  embedTrueTypeFonts: true,
819
+ firstSlideNumber: true,
819
820
  defaultTextStyle: true
820
821
  };
821
822
  PRESENTATION_FIELD_NAMES = Object.keys(PRESENTATION_FIELD_KEYS);
@@ -1288,6 +1289,32 @@ function inheritCustomGeometryCommandOrder(target, ...sources) {
1288
1289
  }
1289
1290
  }
1290
1291
  }
1292
+ function pathListPaths(pathLst) {
1293
+ if (!pathLst || typeof pathLst !== "object") {
1294
+ return [];
1295
+ }
1296
+ return ensureArrayLocal(childByLocalName(pathLst, "path")).filter(
1297
+ (path2) => Boolean(path2) && typeof path2 === "object"
1298
+ );
1299
+ }
1300
+ function readPathListCommandOrder(pathLst) {
1301
+ const orders = pathListPaths(pathLst).map((path2) => [...commandOrder.get(path2) ?? []]);
1302
+ return orders.some((order) => order.length > 0) ? orders : void 0;
1303
+ }
1304
+ function restorePathListCommandOrder(pathLst, orders) {
1305
+ if (!orders || orders.length === 0) {
1306
+ return;
1307
+ }
1308
+ pathListPaths(pathLst).forEach((path2, index) => {
1309
+ const order = orders[index];
1310
+ if (!order || order.length === 0 || commandOrder.has(path2)) {
1311
+ return;
1312
+ }
1313
+ if (orderSignature([...order]) === pathSignature(path2)) {
1314
+ commandOrder.set(path2, [...order]);
1315
+ }
1316
+ });
1317
+ }
1291
1318
  function orderedXmlKey(baseName, order) {
1292
1319
  return `${baseName}${ORDER_SUFFIX}${order}`;
1293
1320
  }
@@ -4412,7 +4439,7 @@ function rootRelsXml() {
4412
4439
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
4413
4440
  </Relationships>`;
4414
4441
  }
4415
- function presentationXml(width, height, slideCount) {
4442
+ function presentationXml(width, height, slideCount, firstSlideNumber) {
4416
4443
  const slideIdBase = 256;
4417
4444
  const slideRIdBase = 6;
4418
4445
  const sldIdLst = slideCount > 0 ? ` <p:sldIdLst>
@@ -4421,6 +4448,7 @@ ${Array.from(
4421
4448
  (_, i2) => ` <p:sldId id="${slideIdBase + i2}" r:id="rId${slideRIdBase + i2}"/>`
4422
4449
  ).join("\n")}
4423
4450
  </p:sldIdLst>` : "";
4451
+ const firstSlideNum = firstSlideNumber === void 0 ? "" : ` firstSlideNum="${Math.trunc(firstSlideNumber)}"`;
4424
4452
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4425
4453
  <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
4426
4454
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
@@ -4428,7 +4456,7 @@ ${Array.from(
4428
4456
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
4429
4457
  xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
4430
4458
  xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"
4431
- saveSubsetFonts="1">
4459
+ saveSubsetFonts="1"${firstSlideNum}>
4432
4460
  <p:sldMasterIdLst>
4433
4461
  <p:sldMasterId id="2147483648" r:id="rId1"/>
4434
4462
  </p:sldMasterIdLst>
@@ -4665,7 +4693,10 @@ async function buildBlankPresentationArchive(options) {
4665
4693
  const zip = new JSZip3__default.default();
4666
4694
  zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
4667
4695
  zip.file("_rels/.rels", rootRelsXml());
4668
- zip.file("ppt/presentation.xml", presentationXml(width, height, initialSlideCount));
4696
+ zip.file(
4697
+ "ppt/presentation.xml",
4698
+ presentationXml(width, height, initialSlideCount, options?.firstSlideNumber)
4699
+ );
4669
4700
  zip.file("ppt/_rels/presentation.xml.rels", presentationRelsXml(layoutCount, initialSlideCount));
4670
4701
  zip.file("ppt/slideMasters/slideMaster1.xml", slideMasterXml(layoutCount));
4671
4702
  zip.file("ppt/slideMasters/_rels/slideMaster1.xml.rels", slideMasterRelsXml(layoutCount));
@@ -58471,6 +58502,7 @@ var init_custom_geometry_parser = __esm({
58471
58502
  // pptx/core/geometry/custom-geometry-live-eval.ts
58472
58503
  function pathNodesOf(rawData) {
58473
58504
  const pathLst = rawData?.pathLstXml;
58505
+ restorePathListCommandOrder(pathLst, rawData?.pathCommandOrder);
58474
58506
  return ensureArrayValue(pathLst?.["a:path"]);
58475
58507
  }
58476
58508
  function evaluateCustomGeometryPaths(rawData, pathWidth, pathHeight, overrides) {
@@ -58510,6 +58542,7 @@ var init_custom_geometry_live_eval = __esm({
58510
58542
  "pptx/core/geometry/custom-geometry-live-eval.ts"() {
58511
58543
  init_utils();
58512
58544
  init_custom_geometry();
58545
+ init_custom_geometry_command_order();
58513
58546
  init_custom_geometry_guides();
58514
58547
  init_custom_geometry_parser();
58515
58548
  ensureArray8 = (value) => ensureArrayValue(value);
@@ -65836,7 +65869,7 @@ function parseShapeLockNode(node, spec) {
65836
65869
  return void 0;
65837
65870
  }
65838
65871
  const locks = {};
65839
- let hasAny = false;
65872
+ let hasAny2 = false;
65840
65873
  for (const prop of spec.permitted) {
65841
65874
  const raw = node[LOCK_ATTRIBUTE[prop]];
65842
65875
  if (raw === void 0) {
@@ -65844,9 +65877,9 @@ function parseShapeLockNode(node, spec) {
65844
65877
  }
65845
65878
  const value = String(raw).trim().toLowerCase();
65846
65879
  locks[prop] = value === "1" || value === "true";
65847
- hasAny = true;
65880
+ hasAny2 = true;
65848
65881
  }
65849
- return hasAny ? locks : void 0;
65882
+ return hasAny2 ? locks : void 0;
65850
65883
  }
65851
65884
  var LOCK_ATTRIBUTE, MODELLED_ATTRIBUTES, CARRIED_WHEN_UNSET;
65852
65885
  var init_shape_lock_node = __esm({
@@ -66713,6 +66746,7 @@ var init_PptxLoadDataBuilder = __esm({
66713
66746
  modernCommentAuthors;
66714
66747
  conformance;
66715
66748
  embedTrueTypeFonts;
66749
+ firstSlideNumber;
66716
66750
  defaultTextStyle;
66717
66751
  withDimensions(width, height, widthEmu, heightEmu) {
66718
66752
  this.width = width;
@@ -66882,6 +66916,10 @@ var init_PptxLoadDataBuilder = __esm({
66882
66916
  this.embedTrueTypeFonts = embedTrueTypeFonts;
66883
66917
  return this;
66884
66918
  }
66919
+ withFirstSlideNumber(firstSlideNumber) {
66920
+ this.firstSlideNumber = firstSlideNumber;
66921
+ return this;
66922
+ }
66885
66923
  withDefaultTextStyle(defaultTextStyle) {
66886
66924
  this.defaultTextStyle = defaultTextStyle;
66887
66925
  return this;
@@ -66933,6 +66971,7 @@ var init_PptxLoadDataBuilder = __esm({
66933
66971
  modernCommentAuthors: this.modernCommentAuthors,
66934
66972
  conformance: this.conformance,
66935
66973
  embedTrueTypeFonts: this.embedTrueTypeFonts,
66974
+ firstSlideNumber: this.firstSlideNumber,
66936
66975
  defaultTextStyle: this.defaultTextStyle
66937
66976
  };
66938
66977
  }
@@ -70837,6 +70876,297 @@ var init_native_animation_media_duration = __esm({
70837
70876
  }
70838
70877
  });
70839
70878
 
70879
+ // pptx/core/services/editor-animation-entry.ts
70880
+ function hasAuthoredAnimationEffect(entry2) {
70881
+ return Boolean(
70882
+ [entry2.entrance, entry2.exit, entry2.emphasis].some((preset) => preset && preset !== "none") || entry2.motionPath
70883
+ );
70884
+ }
70885
+ function animationFor(slideAnimations, elementId) {
70886
+ return slideAnimations.find((a) => a.elementId === elementId);
70887
+ }
70888
+ var init_editor_animation_entry = __esm({
70889
+ "pptx/core/services/editor-animation-entry.ts"() {
70890
+ }
70891
+ });
70892
+
70893
+ // pptx/core/services/native-animation-after-effect.ts
70894
+ function hasAfterEffectFlag(cTn) {
70895
+ const raw = cTn?.["@_afterEffect"];
70896
+ return raw === "1" || raw === "true";
70897
+ }
70898
+ function extractSrgbHex(colorContainer) {
70899
+ const srgb = colorContainer?.["a:srgbClr"];
70900
+ const val = srgb?.["@_val"];
70901
+ return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
70902
+ }
70903
+ function findDimBehaviour(subTnLst) {
70904
+ for (const node of ensureArray11(subTnLst["p:animClr"])) {
70905
+ const cBhvr = node["p:cBhvr"];
70906
+ if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
70907
+ continue;
70908
+ }
70909
+ if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
70910
+ continue;
70911
+ }
70912
+ const toNode = node["p:to"];
70913
+ const color2 = extractSrgbHex(toNode);
70914
+ if (color2) {
70915
+ return { action: "dimToColor", color: color2 };
70916
+ }
70917
+ const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
70918
+ return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
70919
+ }
70920
+ return void 0;
70921
+ }
70922
+ function findHideBehaviour(subTnLst) {
70923
+ for (const node of ensureArray11(subTnLst["p:set"])) {
70924
+ const cBhvr = node["p:cBhvr"];
70925
+ if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
70926
+ continue;
70927
+ }
70928
+ const innerCTn = cBhvr?.["p:cTn"];
70929
+ if (!hasAfterEffectFlag(innerCTn)) {
70930
+ continue;
70931
+ }
70932
+ const toNode = node["p:to"];
70933
+ const strVal = toNode?.["p:strVal"]?.["@_val"];
70934
+ if (String(strVal ?? "").toLowerCase() !== "hidden") {
70935
+ continue;
70936
+ }
70937
+ const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
70938
+ return { action };
70939
+ }
70940
+ return void 0;
70941
+ }
70942
+ function extractAfterAnimationFromSubTnLst(cTn) {
70943
+ const subTnLst = cTn["p:subTnLst"];
70944
+ if (!subTnLst) {
70945
+ return void 0;
70946
+ }
70947
+ return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
70948
+ }
70949
+ var init_native_animation_after_effect = __esm({
70950
+ "pptx/core/services/native-animation-after-effect.ts"() {
70951
+ init_theme_color_ref();
70952
+ init_native_animation_attr_name();
70953
+ init_native_animation_helpers();
70954
+ }
70955
+ });
70956
+
70957
+ // pptx/core/services/animation-after-effect-write.ts
70958
+ function assertAfterAnimationClearSupported(effectCTn) {
70959
+ const shapeIds = /* @__PURE__ */ new Set();
70960
+ const checkTarget = (value) => {
70961
+ if (Array.isArray(value)) {
70962
+ value.forEach(checkTarget);
70963
+ return;
70964
+ }
70965
+ if (!isXmlObject5(value)) return;
70966
+ const shapeTarget = value["p:spTgt"];
70967
+ if (isXmlObject5(shapeTarget) && shapeTarget["@_spid"] !== void 0)
70968
+ shapeIds.add(String(shapeTarget["@_spid"]));
70969
+ if ([
70970
+ "p:bg",
70971
+ "p:txEl",
70972
+ "p:subSp",
70973
+ "p:graphicEl",
70974
+ "p:oleChartEl",
70975
+ "p:sndTgt",
70976
+ "p:inkTgt",
70977
+ "p:sldTgt"
70978
+ ].some((key2) => value[key2] !== void 0))
70979
+ throw new Error("Clearing after-animation supports whole-shape targets only");
70980
+ Object.values(value).forEach(checkTarget);
70981
+ };
70982
+ checkTarget(effectCTn["p:childTnLst"]);
70983
+ if (shapeIds.size > 1)
70984
+ throw new Error("Editing after-animation supports a single whole-shape target only");
70985
+ const sub = effectCTn["p:subTnLst"];
70986
+ if (!isXmlObject5(sub)) return;
70987
+ const countAfterFlags = (value) => {
70988
+ if (Array.isArray(value))
70989
+ return value.reduce((count, child30) => count + countAfterFlags(child30), 0);
70990
+ if (!isXmlObject5(value)) return 0;
70991
+ return Object.entries(value).reduce(
70992
+ (count, [key2, child30]) => count + (key2 === "@_afterEffect" && ["1", "true"].includes(String(child30)) ? 1 : countAfterFlags(child30)),
70993
+ 0
70994
+ );
70995
+ };
70996
+ for (const [key2, value] of Object.entries(sub)) {
70997
+ for (const node of ensureArray11(value)) {
70998
+ const flags = countAfterFlags(node);
70999
+ if (!flags) continue;
71000
+ if (flags !== 1 || !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } }))
71001
+ throw new Error("Cannot clear an unsupported native after-animation behavior");
71002
+ checkTarget(node);
71003
+ }
71004
+ }
71005
+ if (shapeIds.size > 1)
71006
+ throw new Error("Editing after-animation supports a single whole-shape target only");
71007
+ }
71008
+ function clearAfterAnimationBehavior(effectCTn) {
71009
+ const sub = effectCTn["p:subTnLst"];
71010
+ if (!isXmlObject5(sub)) return;
71011
+ for (const key2 of Object.keys(sub)) {
71012
+ const nodes = ensureArray11(sub[key2]);
71013
+ const remaining = nodes.filter(
71014
+ (node) => !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } })
71015
+ );
71016
+ if (remaining.length === nodes.length) continue;
71017
+ if (remaining.length === 0) delete sub[key2];
71018
+ else sub[key2] = remaining.length === 1 ? remaining[0] : remaining;
71019
+ }
71020
+ if (Object.keys(sub).length === 0) delete effectCTn["p:subTnLst"];
71021
+ }
71022
+ function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
71023
+ if (anim.afterAnimation === void 0) return;
71024
+ if (anim.afterAnimation === "none") {
71025
+ assertAfterAnimationClearSupported(effectCTn);
71026
+ clearAfterAnimationBehavior(effectCTn);
71027
+ return;
71028
+ }
71029
+ assertAfterAnimationClearSupported(effectCTn);
71030
+ clearAfterAnimationBehavior(effectCTn);
71031
+ delete effectCTn["@_afterEffect"];
71032
+ if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
71033
+ appendAfterAnimationBehavior(effectCTn, buildDimSubTnLst(shapeId, anim.afterAnimationColor));
71034
+ return;
71035
+ }
71036
+ if (anim.afterAnimation === "hideAfterAnimation") {
71037
+ const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
71038
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "sameClick", entranceId));
71039
+ return;
71040
+ }
71041
+ if (anim.afterAnimation === "hideOnNextClick") {
71042
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "nextClick"));
71043
+ }
71044
+ }
71045
+ function appendAfterAnimationBehavior(effect, addition) {
71046
+ const sub = isXmlObject5(effect["p:subTnLst"]) ? effect["p:subTnLst"] : {};
71047
+ for (const [key2, value] of Object.entries(addition)) {
71048
+ const nodes = [...ensureArray11(sub[key2]), ...ensureArray11(value)];
71049
+ sub[key2] = nodes.length === 1 ? nodes[0] : nodes;
71050
+ }
71051
+ effect["p:subTnLst"] = sub;
71052
+ }
71053
+ function buildDimSubTnLst(shapeId, colorHex) {
71054
+ const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
71055
+ return {
71056
+ "p:animClr": {
71057
+ "@_clrSpc": "rgb",
71058
+ "@_dir": "cw",
71059
+ "p:cBhvr": {
71060
+ "@_override": "childStyle",
71061
+ "p:cTn": {
71062
+ "@_dur": "1",
71063
+ "@_fill": "hold",
71064
+ "@_display": "0",
71065
+ "@_masterRel": "nextClick",
71066
+ "@_afterEffect": "1"
71067
+ },
71068
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
71069
+ "p:attrNameLst": { "p:attrName": "ppt_c" }
71070
+ },
71071
+ "p:to": { "a:srgbClr": { "@_val": hex3 } }
71072
+ }
71073
+ };
71074
+ }
71075
+ function buildHideSubTnLst(shapeId, masterRel, entranceId) {
71076
+ const cTn = {
71077
+ "@_dur": "1",
71078
+ "@_fill": "hold",
71079
+ "@_display": "0",
71080
+ "@_masterRel": masterRel,
71081
+ "@_afterEffect": "1"
71082
+ };
71083
+ if (masterRel === "sameClick") {
71084
+ cTn["p:stCondLst"] = {
71085
+ "p:cond": {
71086
+ "@_evt": "end",
71087
+ "@_delay": "0",
71088
+ "p:tn": { "@_val": entranceId ?? "0" }
71089
+ }
71090
+ };
71091
+ }
71092
+ return {
71093
+ "p:set": {
71094
+ "p:cBhvr": {
71095
+ "@_override": "childStyle",
71096
+ "p:cTn": cTn,
71097
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
71098
+ "p:attrNameLst": { "p:attrName": "style.visibility" }
71099
+ },
71100
+ "p:to": { "p:strVal": { "@_val": "hidden" } }
71101
+ }
71102
+ };
71103
+ }
71104
+ var init_animation_after_effect_write = __esm({
71105
+ "pptx/core/services/animation-after-effect-write.ts"() {
71106
+ init_native_animation_after_effect();
71107
+ init_native_animation_helpers();
71108
+ }
71109
+ });
71110
+
71111
+ // pptx/core/services/editor-animation-after-effect.ts
71112
+ function mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming) {
71113
+ for (const native of nativeAnimations ?? []) {
71114
+ const existing = native.targetId ? animationFor(animations, native.targetId) : void 0;
71115
+ const action = native.afterAnimationAction ?? (existing?.afterAnimation !== void 0 ? "none" : void 0);
71116
+ if ((nativeAnimations ?? []).filter(
71117
+ (other) => other.targetId === native.targetId && ["entr", "emph"].includes(other.presetClass ?? "")
71118
+ ).length !== 1)
71119
+ continue;
71120
+ if (!native.targetId || !action || !["entr", "emph"].includes(native.presetClass ?? "") || native.textTarget)
71121
+ continue;
71122
+ if (native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
71123
+ continue;
71124
+ try {
71125
+ if (rawTiming && native.target?.type === "shape" && indexEffectNodes(rawTiming).filter(
71126
+ (ref) => ref.spid === (native.target?.type === "shape" ? native.target.shapeId : void 0) && ["entr", "emph"].includes(ref.presetClass)
71127
+ ).length !== 1)
71128
+ continue;
71129
+ const effect = rawTiming ? indexEffectNodes(rawTiming).find(
71130
+ (ref) => String(ref.cTn["@_id"]) === String(native.nodeId) && native.target?.type === "shape" && ref.spid === native.target.shapeId
71131
+ ) : void 0;
71132
+ if (rawTiming && !effect) continue;
71133
+ assertAfterAnimationClearSupported(
71134
+ effect?.cTn ?? { "p:subTnLst": native.cTnAttributes?.["p:subTnLst"] }
71135
+ );
71136
+ } catch {
71137
+ continue;
71138
+ }
71139
+ let entry2 = animationFor(animations, native.targetId);
71140
+ if (!entry2) {
71141
+ entry2 = { elementId: native.targetId };
71142
+ animations.push(entry2);
71143
+ }
71144
+ if (entry2.nativeAfterAnimation !== void 0) continue;
71145
+ entry2.nativeAfterAnimation = action;
71146
+ entry2.nativeAfterAnimationColor = native.afterAnimationColor;
71147
+ }
71148
+ }
71149
+ function isNativeAfterAnimationFallback(entry2) {
71150
+ return entry2.nativeAfterAnimation !== void 0 && Object.entries(entry2).every(
71151
+ ([key2, value]) => value === void 0 || [
71152
+ "elementId",
71153
+ "nativeAfterAnimation",
71154
+ "nativeAfterAnimationColor",
71155
+ "soundRId",
71156
+ "soundPath",
71157
+ "soundName",
71158
+ "stopSound"
71159
+ ].includes(key2)
71160
+ );
71161
+ }
71162
+ var init_editor_animation_after_effect = __esm({
71163
+ "pptx/core/services/editor-animation-after-effect.ts"() {
71164
+ init_editor_animation_entry();
71165
+ init_animation_after_effect_write();
71166
+ init_animation_timing_tree();
71167
+ }
71168
+ });
71169
+
70840
71170
  // pptx/core/services/slide-name.ts
70841
71171
  function asNode3(value) {
70842
71172
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -71167,6 +71497,7 @@ var init_PptxSlideLoaderService = __esm({
71167
71497
  init_animation_target_reconcile();
71168
71498
  init_animation_timeline_anchors();
71169
71499
  init_native_animation_media_duration();
71500
+ init_editor_animation_after_effect();
71170
71501
  init_slide_name();
71171
71502
  init_slide_transition_envelope();
71172
71503
  PptxSlideLoaderService = class {
@@ -71378,6 +71709,8 @@ var init_PptxSlideLoaderService = __esm({
71378
71709
  }
71379
71710
  });
71380
71711
  reconcileAnimationTargets(elements3, nativeAnimations, animations, animationTimelineAnchors);
71712
+ animations ??= [];
71713
+ mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming);
71381
71714
  mergeNativeSoundIntoEditorAnimations(nativeAnimations, animations);
71382
71715
  mergeNativeBuildTemplatesIntoEditorAnimations(nativeAnimations, animations);
71383
71716
  applyHiddenFlagFromRawXml(elements3);
@@ -71720,6 +72053,7 @@ function sortOrder(animation) {
71720
72053
  var PptxEditorAnimationService;
71721
72054
  var init_PptxEditorAnimationService = __esm({
71722
72055
  "pptx/core/services/PptxEditorAnimationService.ts"() {
72056
+ init_editor_animation_after_effect();
71723
72057
  init_editor_animation_normalizers();
71724
72058
  init_editor_animation_trigger_meta();
71725
72059
  PptxEditorAnimationService = class {
@@ -71818,7 +72152,7 @@ var init_PptxEditorAnimationService = __esm({
71818
72152
  * @param animations - Editor animations to serialize.
71819
72153
  */
71820
72154
  applyEditorAnimations(slideNode, animations) {
71821
- const sequenced = [...animations].sort((left, right) => sortOrder(left) - sortOrder(right));
72155
+ const sequenced = animations.filter((entry2) => !isNativeAfterAnimationFallback(entry2)).sort((left, right) => sortOrder(left) - sortOrder(right));
71822
72156
  const sanitizedAnimations = sequenced.map((animation) => {
71823
72157
  const elementId = String(animation.elementId || "").trim();
71824
72158
  if (elementId.length === 0) {
@@ -71832,7 +72166,7 @@ var init_PptxEditorAnimationService = __esm({
71832
72166
  const orderIsTreeDerived = animation.orderFromTimeline !== void 0 && animation.order === animation.orderFromTimeline;
71833
72167
  const order = typeof animation.order === "number" && Number.isFinite(animation.order) && !orderIsTreeDerived ? Math.round(animation.order) : void 0;
71834
72168
  const repeatCount = typeof animation.repeatCount === "number" && Number.isFinite(animation.repeatCount) && animation.repeatCount > 0 ? animation.repeatCount : void 0;
71835
- if (!entrance && !exit2 && !emphasis && !animation.motionPath) {
72169
+ if (!entrance && !exit2 && !emphasis && !animation.motionPath && animation.afterAnimation === void 0) {
71836
72170
  return null;
71837
72171
  }
71838
72172
  return {
@@ -72266,121 +72600,6 @@ var init_native_animation_media_walk = __esm({
72266
72600
  }
72267
72601
  });
72268
72602
 
72269
- // pptx/core/services/animation-effect-filter-parsing.ts
72270
- function parseFilterToken(raw) {
72271
- const trimmed2 = raw.trim();
72272
- if (!trimmed2) {
72273
- return void 0;
72274
- }
72275
- const match = FILTER_TOKEN_RE.exec(trimmed2);
72276
- if (!match) {
72277
- return void 0;
72278
- }
72279
- const family = match[1].toLowerCase();
72280
- const subtypeToken = match[2];
72281
- const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
72282
- return { family, subtype };
72283
- }
72284
- function parseAnimEffectFilter(childTnList) {
72285
- if (!childTnList) {
72286
- return void 0;
72287
- }
72288
- const rawAnimEffect = childTnList["p:animEffect"];
72289
- const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
72290
- if (!animEffect || typeof animEffect !== "object") {
72291
- return void 0;
72292
- }
72293
- const node = animEffect;
72294
- const filterAttr = node["@_filter"];
72295
- if (filterAttr === void 0 || filterAttr === null) {
72296
- return void 0;
72297
- }
72298
- const raw = String(filterAttr);
72299
- const firstToken = raw.split(";")[0] ?? "";
72300
- const parsed = parseFilterToken(firstToken);
72301
- if (!parsed) {
72302
- return void 0;
72303
- }
72304
- const transitionAttr = node["@_transition"];
72305
- const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
72306
- return {
72307
- family: parsed.family,
72308
- subtype: parsed.subtype,
72309
- transition,
72310
- raw
72311
- };
72312
- }
72313
- var FILTER_TOKEN_RE;
72314
- var init_animation_effect_filter_parsing = __esm({
72315
- "pptx/core/services/animation-effect-filter-parsing.ts"() {
72316
- FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
72317
- }
72318
- });
72319
-
72320
- // pptx/core/services/native-animation-after-effect.ts
72321
- function hasAfterEffectFlag(cTn) {
72322
- const raw = cTn?.["@_afterEffect"];
72323
- return raw === "1" || raw === "true";
72324
- }
72325
- function extractSrgbHex(colorContainer) {
72326
- const srgb = colorContainer?.["a:srgbClr"];
72327
- const val = srgb?.["@_val"];
72328
- return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
72329
- }
72330
- function findDimBehaviour(subTnLst) {
72331
- for (const node of ensureArray11(subTnLst["p:animClr"])) {
72332
- const cBhvr = node["p:cBhvr"];
72333
- if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
72334
- continue;
72335
- }
72336
- if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
72337
- continue;
72338
- }
72339
- const toNode = node["p:to"];
72340
- const color2 = extractSrgbHex(toNode);
72341
- if (color2) {
72342
- return { action: "dimToColor", color: color2 };
72343
- }
72344
- const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
72345
- return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
72346
- }
72347
- return void 0;
72348
- }
72349
- function findHideBehaviour(subTnLst) {
72350
- for (const node of ensureArray11(subTnLst["p:set"])) {
72351
- const cBhvr = node["p:cBhvr"];
72352
- if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
72353
- continue;
72354
- }
72355
- const innerCTn = cBhvr?.["p:cTn"];
72356
- if (!hasAfterEffectFlag(innerCTn)) {
72357
- continue;
72358
- }
72359
- const toNode = node["p:to"];
72360
- const strVal = toNode?.["p:strVal"]?.["@_val"];
72361
- if (String(strVal ?? "").toLowerCase() !== "hidden") {
72362
- continue;
72363
- }
72364
- const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
72365
- return { action };
72366
- }
72367
- return void 0;
72368
- }
72369
- function extractAfterAnimationFromSubTnLst(cTn) {
72370
- const subTnLst = cTn["p:subTnLst"];
72371
- if (!subTnLst) {
72372
- return void 0;
72373
- }
72374
- return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
72375
- }
72376
- var init_native_animation_after_effect = __esm({
72377
- "pptx/core/services/native-animation-after-effect.ts"() {
72378
- init_theme_color_ref();
72379
- init_native_animation_attr_name();
72380
- init_native_animation_helpers();
72381
- }
72382
- });
72383
-
72384
72603
  // pptx/core/services/native-animation-cbhvr-attrs.ts
72385
72604
  function extractCBhvrAttrs(cBhvr) {
72386
72605
  if (!cBhvr) {
@@ -72457,59 +72676,6 @@ var init_native_animation_cbhvr_attrs = __esm({
72457
72676
  }
72458
72677
  });
72459
72678
 
72460
- // pptx/core/services/native-animation-attribute-components.ts
72461
- function extractBounceEndFraction(raw) {
72462
- if (raw === void 0) {
72463
- return void 0;
72464
- }
72465
- const parsed = Number(raw);
72466
- if (!Number.isFinite(parsed)) {
72467
- return void 0;
72468
- }
72469
- return Math.max(0, Math.min(1, parsed / 1e5));
72470
- }
72471
- function extractAttributeAnimations(childTnList) {
72472
- if (!childTnList) {
72473
- return void 0;
72474
- }
72475
- const components = [];
72476
- for (const node of ensureArray11(childTnList["p:anim"])) {
72477
- const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
72478
- const keyframes = extractKeyframes(node);
72479
- const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
72480
- const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
72481
- const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
72482
- const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
72483
- if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
72484
- continue;
72485
- }
72486
- const behavior = node["p:cBhvr"];
72487
- const cTn = behavior?.["p:cTn"];
72488
- const calcMode = normalizeCalcMode(node["@_calcmode"]);
72489
- const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
72490
- components.push({
72491
- attrName,
72492
- keyframes: keyframes ?? [],
72493
- durationMs: readTimingAttr(cTn?.["@_dur"]),
72494
- delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
72495
- ...calcMode ? { calcMode } : {},
72496
- ...from !== void 0 ? { from } : {},
72497
- ...to !== void 0 ? { to } : {},
72498
- ...by !== void 0 ? { by } : {},
72499
- ...bounceEnd !== void 0 ? { bounceEnd } : {}
72500
- });
72501
- }
72502
- return components.length > 0 ? components : void 0;
72503
- }
72504
- var init_native_animation_attribute_components = __esm({
72505
- "pptx/core/services/native-animation-attribute-components.ts"() {
72506
- init_native_animation_attr_name();
72507
- init_native_animation_cbhvr_attrs();
72508
- init_native_animation_extended_helpers();
72509
- init_native_animation_helpers();
72510
- }
72511
- });
72512
-
72513
72679
  // pptx/core/services/native-animation-behaviors.ts
72514
72680
  function attrText(raw) {
72515
72681
  if (raw === void 0 || raw === null) {
@@ -72529,6 +72695,16 @@ function readTiming(cTn) {
72529
72695
  return {};
72530
72696
  }
72531
72697
  const timing = {};
72698
+ const starts = ensureArray11(cTn["p:stCondLst"]?.["p:cond"]);
72699
+ if (starts.length > 1 || cTn["@_dur"] === "indefinite" || cTn["@_repeatCount"] === "indefinite" || cTn["@_repeatDur"] !== void 0 || cTn["p:endCondLst"] !== void 0 || cTn["p:endSync"] !== void 0 || starts.some(
72700
+ (condition) => condition === null || typeof condition !== "object" || condition["@_evt"] !== void 0 || condition["@_tn"] !== void 0 || condition["@_rtn"] !== void 0 || condition["p:tn"] !== void 0 || condition["p:rtn"] !== void 0 || condition["p:tgtEl"] !== void 0 || condition["@_delay"] !== void 0 && !/^\d+$/u.test(String(condition["@_delay"])) || condition["@_delay"] === "indefinite"
72701
+ )) {
72702
+ timing.unsupportedSetTiming = true;
72703
+ }
72704
+ const fill = cTn["@_fill"];
72705
+ if (fill === "remove" || fill === "freeze" || fill === "hold" || fill === "transition") {
72706
+ timing.fill = fill;
72707
+ }
72532
72708
  const durationMs = readTimingAttr(cTn["@_dur"]);
72533
72709
  if (durationMs !== void 0) {
72534
72710
  timing.durationMs = durationMs;
@@ -72701,6 +72877,210 @@ var init_native_animation_behaviors = __esm({
72701
72877
  }
72702
72878
  });
72703
72879
 
72880
+ // pptx/core/services/native-animation-visibility-timing.ts
72881
+ function hasNativeVisibilitySet(node) {
72882
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0") return false;
72883
+ const children15 = node["p:childTnLst"];
72884
+ if (!isXmlObject5(children15)) return false;
72885
+ return ensureArray11(children15["p:set"]).some((set2) => {
72886
+ const common = set2["p:cBhvr"];
72887
+ const list2 = isXmlObject5(common) ? common["p:attrNameLst"] : void 0;
72888
+ const names = isXmlObject5(list2) ? list2["p:attrName"] : void 0;
72889
+ return (Array.isArray(names) ? names : [names]).some(
72890
+ (name) => String(isXmlObject5(name) ? name["#text"] : name).trim().toLowerCase() === "style.visibility"
72891
+ );
72892
+ });
72893
+ }
72894
+ function simpleStarts(node, clickGate = false) {
72895
+ const list2 = node["p:stCondLst"];
72896
+ if (list2 === void 0) return true;
72897
+ if (!isXmlObject5(list2) || Object.keys(list2).some((key2) => key2 !== "p:cond")) return false;
72898
+ const conditions = ensureArray11(list2["p:cond"]);
72899
+ return conditions.length === 1 && conditions.every(
72900
+ (condition) => Object.keys(condition).every((key2) => key2 === "@_delay") && (condition["@_delay"] === void 0 || /^\d+$/u.test(String(condition["@_delay"])) && Number.isSafeInteger(Number(condition["@_delay"])) && Number(condition["@_delay"]) <= 2147483647 || clickGate && condition["@_delay"] === "indefinite")
72901
+ );
72902
+ }
72903
+ function unsupportedVisibilityContainerTiming(node) {
72904
+ if (node["@_presetClass"] !== void 0) return false;
72905
+ const structuralRoot = ["tmRoot", "mainSeq"].includes(String(node["@_nodeType"] ?? ""));
72906
+ return !neutralTiming(node) || !simpleStarts(node, true) || ensureArray11(isXmlObject5(node["p:stCondLst"]) ? node["p:stCondLst"]["p:cond"] : void 0).some(
72907
+ (condition) => /^\d+$/u.test(String(condition["@_delay"])) && Number(condition["@_delay"]) > 0
72908
+ ) || node["@_dur"] !== void 0 && !(structuralRoot && node["@_dur"] === "indefinite") || node["@_fill"] !== void 0 && node["@_fill"] !== "hold" || node["p:subTnLst"] !== void 0;
72909
+ }
72910
+ function extractVisibilitySetTiming(node) {
72911
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0" || String(node["@_presetSubtype"] ?? "0") !== "0" || node["@_dur"] !== void 0 || node["@_fill"] !== "hold" || !neutralTiming(node) || !simpleStarts(node))
72912
+ return void 0;
72913
+ const children15 = node["p:childTnLst"];
72914
+ if (!isXmlObject5(children15) || Object.keys(children15).length !== 1 || !children15["p:set"])
72915
+ return void 0;
72916
+ const sets = ensureArray11(children15["p:set"]);
72917
+ if (sets.length !== 1) return void 0;
72918
+ if (Object.keys(sets[0]).some((key2) => !["p:cBhvr", "p:to"].includes(key2))) return void 0;
72919
+ const to = sets[0]["p:to"];
72920
+ if (!isXmlObject5(to) || Object.keys(to).length !== 1 || !isXmlObject5(to["p:strVal"]) || Object.keys(to["p:strVal"]).some((key2) => key2 !== "@_val") || to["p:strVal"]["@_val"] !== "visible")
72921
+ return void 0;
72922
+ const common = sets[0]["p:cBhvr"];
72923
+ if (!isXmlObject5(common) || Object.keys(common).some(
72924
+ (key2) => !["p:cTn", "p:tgtEl", "p:attrNameLst", "@_additive"].includes(key2)
72925
+ ) || common["@_additive"] !== void 0 && !["base", "repl", "none"].includes(String(common["@_additive"])))
72926
+ return void 0;
72927
+ const target = common["p:tgtEl"];
72928
+ if (!isXmlObject5(target) || Object.keys(target).length !== 1 || !isXmlObject5(target["p:spTgt"]) || Object.keys(target["p:spTgt"]).some((key2) => key2 !== "@_spid") || !/^\d+$/u.test(String(target["p:spTgt"]["@_spid"])))
72929
+ return void 0;
72930
+ const child30 = common["p:cTn"];
72931
+ if (!isXmlObject5(child30) || !neutralTiming(child30) || !simpleStarts(child30) || String(child30["@_dur"]) !== "1" || child30["@_fill"] !== "hold")
72932
+ return void 0;
72933
+ const behavior = extractBehaviors(children15)?.[0];
72934
+ if (!behavior || behavior.kind !== "set" || behavior.value !== "visible" || behavior.attrNames.length !== 1 || behavior.attrNames[0] !== "style.visibility" || behavior.timing.unsupportedSetTiming)
72935
+ return void 0;
72936
+ try {
72937
+ assertAfterAnimationClearSupported(node);
72938
+ } catch {
72939
+ return void 0;
72940
+ }
72941
+ const sub = node["p:subTnLst"];
72942
+ if (sub !== void 0) {
72943
+ if (!isXmlObject5(sub)) return void 0;
72944
+ for (const [key2, raw] of Object.entries(sub)) {
72945
+ for (const value of ensureArray11(raw)) {
72946
+ if (!extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: value } }))
72947
+ return void 0;
72948
+ }
72949
+ }
72950
+ }
72951
+ const delayMs = behavior.timing.delayMs ?? 0;
72952
+ if (!Number.isSafeInteger(delayMs) || delayMs < 0 || delayMs >= 2147483647) return void 0;
72953
+ return { delayMs, durationMs: 1 };
72954
+ }
72955
+ var neutralTiming;
72956
+ var init_native_animation_visibility_timing = __esm({
72957
+ "pptx/core/services/native-animation-visibility-timing.ts"() {
72958
+ init_native_animation_behaviors();
72959
+ init_animation_after_effect_write();
72960
+ init_native_animation_after_effect();
72961
+ init_native_animation_helpers();
72962
+ neutralTiming = (node) => [
72963
+ "@_repeatDur",
72964
+ "@_tmFilter",
72965
+ "@_endSync",
72966
+ "@_evtFilter",
72967
+ "@_display",
72968
+ "@_masterRel",
72969
+ "@_syncBehavior",
72970
+ "@_nodePh",
72971
+ "@_progress",
72972
+ "@_p14:presetBounceEnd",
72973
+ "p:endCondLst",
72974
+ "p:endSync",
72975
+ "p:iterate"
72976
+ ].every((key2) => node[key2] === void 0) && (node["@_repeatCount"] === void 0 || String(node["@_repeatCount"]) === "1000") && (node["@_autoRev"] === void 0 || ["0", "false"].includes(String(node["@_autoRev"]))) && (node["@_spd"] === void 0 || String(node["@_spd"]) === "100000") && (node["@_accel"] === void 0 || String(node["@_accel"]) === "0") && (node["@_decel"] === void 0 || String(node["@_decel"]) === "0");
72977
+ }
72978
+ });
72979
+
72980
+ // pptx/core/services/animation-effect-filter-parsing.ts
72981
+ function parseFilterToken(raw) {
72982
+ const trimmed2 = raw.trim();
72983
+ if (!trimmed2) {
72984
+ return void 0;
72985
+ }
72986
+ const match = FILTER_TOKEN_RE.exec(trimmed2);
72987
+ if (!match) {
72988
+ return void 0;
72989
+ }
72990
+ const family = match[1].toLowerCase();
72991
+ const subtypeToken = match[2];
72992
+ const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
72993
+ return { family, subtype };
72994
+ }
72995
+ function parseAnimEffectFilter(childTnList) {
72996
+ if (!childTnList) {
72997
+ return void 0;
72998
+ }
72999
+ const rawAnimEffect = childTnList["p:animEffect"];
73000
+ const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
73001
+ if (!animEffect || typeof animEffect !== "object") {
73002
+ return void 0;
73003
+ }
73004
+ const node = animEffect;
73005
+ const filterAttr = node["@_filter"];
73006
+ if (filterAttr === void 0 || filterAttr === null) {
73007
+ return void 0;
73008
+ }
73009
+ const raw = String(filterAttr);
73010
+ const firstToken = raw.split(";")[0] ?? "";
73011
+ const parsed = parseFilterToken(firstToken);
73012
+ if (!parsed) {
73013
+ return void 0;
73014
+ }
73015
+ const transitionAttr = node["@_transition"];
73016
+ const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
73017
+ return {
73018
+ family: parsed.family,
73019
+ subtype: parsed.subtype,
73020
+ transition,
73021
+ raw
73022
+ };
73023
+ }
73024
+ var FILTER_TOKEN_RE;
73025
+ var init_animation_effect_filter_parsing = __esm({
73026
+ "pptx/core/services/animation-effect-filter-parsing.ts"() {
73027
+ FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
73028
+ }
73029
+ });
73030
+
73031
+ // pptx/core/services/native-animation-attribute-components.ts
73032
+ function extractBounceEndFraction(raw) {
73033
+ if (raw === void 0) {
73034
+ return void 0;
73035
+ }
73036
+ const parsed = Number(raw);
73037
+ if (!Number.isFinite(parsed)) {
73038
+ return void 0;
73039
+ }
73040
+ return Math.max(0, Math.min(1, parsed / 1e5));
73041
+ }
73042
+ function extractAttributeAnimations(childTnList) {
73043
+ if (!childTnList) {
73044
+ return void 0;
73045
+ }
73046
+ const components = [];
73047
+ for (const node of ensureArray11(childTnList["p:anim"])) {
73048
+ const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
73049
+ const keyframes = extractKeyframes(node);
73050
+ const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
73051
+ const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
73052
+ const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
73053
+ const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
73054
+ if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
73055
+ continue;
73056
+ }
73057
+ const behavior = node["p:cBhvr"];
73058
+ const cTn = behavior?.["p:cTn"];
73059
+ const calcMode = normalizeCalcMode(node["@_calcmode"]);
73060
+ const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
73061
+ components.push({
73062
+ attrName,
73063
+ keyframes: keyframes ?? [],
73064
+ durationMs: readTimingAttr(cTn?.["@_dur"]),
73065
+ delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
73066
+ ...calcMode ? { calcMode } : {},
73067
+ ...from !== void 0 ? { from } : {},
73068
+ ...to !== void 0 ? { to } : {},
73069
+ ...by !== void 0 ? { by } : {},
73070
+ ...bounceEnd !== void 0 ? { bounceEnd } : {}
73071
+ });
73072
+ }
73073
+ return components.length > 0 ? components : void 0;
73074
+ }
73075
+ var init_native_animation_attribute_components = __esm({
73076
+ "pptx/core/services/native-animation-attribute-components.ts"() {
73077
+ init_native_animation_attr_name();
73078
+ init_native_animation_cbhvr_attrs();
73079
+ init_native_animation_extended_helpers();
73080
+ init_native_animation_helpers();
73081
+ }
73082
+ });
73083
+
72704
73084
  // pptx/core/services/native-animation-child-timing.ts
72705
73085
  function isEnabled(value) {
72706
73086
  return value === true || value === 1 || value === "1" || value === "true";
@@ -72830,12 +73210,13 @@ function resolveNodeTrigger(cTn, currentTrigger) {
72830
73210
  }
72831
73211
  return trigger;
72832
73212
  }
72833
- function buildTimingNodeAnimation(cTn, trigger, group) {
73213
+ function buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor = false) {
72834
73214
  const presetClass = cTn["@_presetClass"];
72835
- const presetId = cTn["@_presetID"] ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
73215
+ const presetId = cTn["@_presetID"] !== void 0 ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
72836
73216
  const presetSubtype = cTn["@_presetSubtype"] !== void 0 ? Number.parseInt(String(cTn["@_presetSubtype"]), 10) : void 0;
72837
73217
  const childAutoReverseTiming = extractChildAutoReverseTiming(cTn, ensureArray11);
72838
- const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray11);
73218
+ const visibilitySetTiming = !unsupportedVisibilityAncestor && group.seqConcurrent === true && group.seqNextAction === "seek" && ["onClick", "withPrevious"].includes(trigger) ? extractVisibilitySetTiming(cTn) : void 0;
73219
+ const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray11) ?? (visibilitySetTiming ? visibilitySetTiming.delayMs + visibilitySetTiming.durationMs : void 0);
72839
73220
  const delayMs = readTimingAttr(cTn["@_delay"]) ?? extractStartConditionDelayMs(cTn);
72840
73221
  const accel = parseTimingPercentFraction(cTn["@_accel"]);
72841
73222
  const decel = parseTimingPercentFraction(cTn["@_decel"]);
@@ -72886,6 +73267,8 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
72886
73267
  presetId,
72887
73268
  presetSubtype,
72888
73269
  durationMs,
73270
+ visibilitySetTiming,
73271
+ unsupportedVisibilitySet: hasNativeVisibilitySet(cTn) && !visibilitySetTiming || void 0,
72889
73272
  delayMs,
72890
73273
  accel,
72891
73274
  decel,
@@ -72934,6 +73317,7 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
72934
73317
  commandString: cmdInfo.commandString,
72935
73318
  textTarget: textTarget ?? void 0,
72936
73319
  cTnAttributes: roundTripAttrs,
73320
+ unsupportedOpacitySetTiming: cTn["@_dur"] === "indefinite" || cTn["p:endSync"] !== void 0 || void 0,
72937
73321
  afterEffect: afterEffectFlag,
72938
73322
  afterAnimationAction: parsedAfterAnimation?.action,
72939
73323
  afterAnimationColor: parsedAfterAnimation?.color,
@@ -72980,22 +73364,24 @@ var init_native_animation_timing_node_extract = __esm({
72980
73364
  init_native_animation_child_timing();
72981
73365
  init_native_animation_extended_helpers();
72982
73366
  init_native_animation_helpers();
73367
+ init_native_animation_visibility_timing();
72983
73368
  init_native_animation_set_components();
72984
73369
  }
72985
73370
  });
72986
73371
 
72987
73372
  // pptx/core/services/native-animation-timing-walk.ts
72988
- function walkTimingTree(node, animations, currentTrigger, group, ctx) {
73373
+ function walkTimingTree(node, animations, currentTrigger, group, ctx, unsupportedVisibilityAncestor = false) {
72989
73374
  if (!node) {
72990
73375
  return;
72991
73376
  }
72992
73377
  const cTn = node["p:cTn"];
72993
73378
  if (cTn) {
72994
73379
  const trigger = resolveNodeTrigger(cTn, currentTrigger);
72995
- const animation = buildTimingNodeAnimation(cTn, trigger, group);
73380
+ const animation = buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor);
72996
73381
  if (animation) {
72997
73382
  animations.push(animation);
72998
73383
  }
73384
+ const unsupportedChildVisibility = unsupportedVisibilityAncestor || unsupportedVisibilityContainerTiming(cTn);
72999
73385
  const childTnList = cTn["p:childTnLst"];
73000
73386
  if (childTnList) {
73001
73387
  const isClickLevel = isMainSequence(cTn);
@@ -73015,7 +73401,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
73015
73401
  id: String(mainSequenceId)
73016
73402
  } : void 0
73017
73403
  }),
73018
- ctx
73404
+ ctx,
73405
+ unsupportedChildVisibility
73019
73406
  );
73020
73407
  }
73021
73408
  for (const sequence of sequences) {
@@ -73023,11 +73410,18 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
73023
73410
  continue;
73024
73411
  }
73025
73412
  const seqAttrs = extractSeqAttrs(sequence);
73026
- walkTimingTree(sequence, animations, trigger, { ...group, ...seqAttrs }, ctx);
73413
+ walkTimingTree(
73414
+ sequence,
73415
+ animations,
73416
+ trigger,
73417
+ { ...group, ...seqAttrs },
73418
+ ctx,
73419
+ unsupportedChildVisibility
73420
+ );
73027
73421
  }
73028
73422
  for (const excl of exclusives) {
73029
73423
  const exclAnims = [];
73030
- walkTimingTree(excl, exclAnims, trigger, group, ctx);
73424
+ walkTimingTree(excl, exclAnims, trigger, group, ctx, true);
73031
73425
  const exclGroupId = ctx.allocateExclGroupId();
73032
73426
  for (const a of exclAnims) {
73033
73427
  a.exclusive = true;
@@ -73047,7 +73441,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
73047
73441
  childGroupContext(group, parallel["p:cTn"], {
73048
73442
  isClickLevelGroup: false
73049
73443
  }),
73050
- ctx
73444
+ ctx,
73445
+ unsupportedVisibilityAncestor
73051
73446
  );
73052
73447
  }
73053
73448
  for (const sequence of directSequences) {
@@ -73055,7 +73450,14 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
73055
73450
  continue;
73056
73451
  }
73057
73452
  const seqAttrs = extractSeqAttrs(sequence);
73058
- walkTimingTree(sequence, animations, currentTrigger, { ...group, ...seqAttrs }, ctx);
73453
+ walkTimingTree(
73454
+ sequence,
73455
+ animations,
73456
+ currentTrigger,
73457
+ { ...group, ...seqAttrs },
73458
+ ctx,
73459
+ unsupportedVisibilityAncestor
73460
+ );
73059
73461
  }
73060
73462
  }
73061
73463
  var init_native_animation_timing_walk = __esm({
@@ -73063,6 +73465,7 @@ var init_native_animation_timing_walk = __esm({
73063
73465
  init_animation_group_context();
73064
73466
  init_animation_timing_attrs();
73065
73467
  init_native_animation_helpers();
73468
+ init_native_animation_visibility_timing();
73066
73469
  init_native_animation_interactive_predicate();
73067
73470
  init_native_animation_timing_node_extract();
73068
73471
  }
@@ -73737,79 +74140,6 @@ var init_PptxSlideTransitionService = __esm({
73737
74140
  }
73738
74141
  });
73739
74142
 
73740
- // pptx/core/services/animation-after-effect-write.ts
73741
- function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
73742
- delete effectCTn["p:subTnLst"];
73743
- delete effectCTn["@_afterEffect"];
73744
- if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
73745
- effectCTn["p:subTnLst"] = buildDimSubTnLst(shapeId, anim.afterAnimationColor);
73746
- return;
73747
- }
73748
- if (anim.afterAnimation === "hideAfterAnimation") {
73749
- const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
73750
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "sameClick", entranceId);
73751
- return;
73752
- }
73753
- if (anim.afterAnimation === "hideOnNextClick") {
73754
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "nextClick");
73755
- }
73756
- }
73757
- function buildDimSubTnLst(shapeId, colorHex) {
73758
- const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
73759
- return {
73760
- "p:animClr": {
73761
- "@_clrSpc": "rgb",
73762
- "@_dir": "cw",
73763
- "p:cBhvr": {
73764
- "@_override": "childStyle",
73765
- "p:cTn": {
73766
- "@_dur": "1",
73767
- "@_fill": "hold",
73768
- "@_display": "0",
73769
- "@_masterRel": "nextClick",
73770
- "@_afterEffect": "1"
73771
- },
73772
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
73773
- "p:attrNameLst": { "p:attrName": "ppt_c" }
73774
- },
73775
- "p:to": { "a:srgbClr": { "@_val": hex3 } }
73776
- }
73777
- };
73778
- }
73779
- function buildHideSubTnLst(shapeId, masterRel, entranceId) {
73780
- const cTn = {
73781
- "@_dur": "1",
73782
- "@_fill": "hold",
73783
- "@_display": "0",
73784
- "@_masterRel": masterRel,
73785
- "@_afterEffect": "1"
73786
- };
73787
- if (masterRel === "sameClick") {
73788
- cTn["p:stCondLst"] = {
73789
- "p:cond": {
73790
- "@_evt": "end",
73791
- "@_delay": "0",
73792
- "p:tn": { "@_val": entranceId ?? "0" }
73793
- }
73794
- };
73795
- }
73796
- return {
73797
- "p:set": {
73798
- "p:cBhvr": {
73799
- "@_override": "childStyle",
73800
- "p:cTn": cTn,
73801
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
73802
- "p:attrNameLst": { "p:attrName": "style.visibility" }
73803
- },
73804
- "p:to": { "p:strVal": { "@_val": "hidden" } }
73805
- }
73806
- };
73807
- }
73808
- var init_animation_after_effect_write = __esm({
73809
- "pptx/core/services/animation-after-effect-write.ts"() {
73810
- }
73811
- });
73812
-
73813
74143
  // pptx/core/services/animation-behavior-captures.json
73814
74144
  var animation_behavior_captures_default;
73815
74145
  var init_animation_behavior_captures = __esm({
@@ -92024,6 +92354,33 @@ function updateEffectNodeAttributes(cTn, anim, presetClass, shapeId, allocateId)
92024
92354
  applySoundToEffectCTn(cTn, anim);
92025
92355
  }
92026
92356
  function surgicallyUpdateTimingTree(rawTiming, animations) {
92357
+ const sourceRefs = indexEffectNodes(rawTiming);
92358
+ for (const entry2 of animations.filter((animation) => animation.afterAnimation !== void 0)) {
92359
+ if (sourceRefs.filter(
92360
+ (ref) => ref.spid === entry2.elementId && ["entr", "emph"].includes(ref.presetClass)
92361
+ ).length > 1)
92362
+ throw new Error(
92363
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
92364
+ );
92365
+ }
92366
+ const explicitClears = new Map(
92367
+ animations.filter((a) => a.afterAnimation !== void 0 && !hasAuthoredAnimationEffect(a)).map((a) => [a.elementId, a])
92368
+ );
92369
+ const clearRefs = sourceRefs.filter(
92370
+ (ref) => ref.spid && explicitClears.has(ref.spid) && (ref.presetClass === "entr" || ref.presetClass === "emph")
92371
+ );
92372
+ for (const target of explicitClears.keys()) {
92373
+ if (!clearRefs.some((ref) => ref.spid === target))
92374
+ throw new Error("Cannot edit after-animation without a supported native effect");
92375
+ if (clearRefs.filter((ref) => ref.spid === target).length > 1)
92376
+ throw new Error(
92377
+ "Cannot clear an ambiguous native after-animation target with multiple effects"
92378
+ );
92379
+ }
92380
+ clearRefs.forEach((ref) => assertAfterAnimationClearSupported(ref.cTn));
92381
+ clearRefs.forEach(
92382
+ (ref) => applyAfterAnimationBehavior(ref.cTn, explicitClears.get(ref.spid), ref.spid)
92383
+ );
92027
92384
  const desired = collectDesiredEffects(animations);
92028
92385
  const previouslyOwned = readOwnedEffectKeys(rawTiming);
92029
92386
  if (desired.length === 0 && previouslyOwned.size === 0) {
@@ -92090,6 +92447,7 @@ function surgicallyUpdateTimingTree(rawTiming, animations) {
92090
92447
  }
92091
92448
  var init_animation_timing_surgical = __esm({
92092
92449
  "pptx/core/services/animation-timing-surgical.ts"() {
92450
+ init_editor_animation_entry();
92093
92451
  init_animation_after_effect_write();
92094
92452
  init_animation_behavior_captured();
92095
92453
  init_animation_timing_build_surgical();
@@ -92140,9 +92498,11 @@ var init_PptxAnimationWriteService = __esm({
92140
92498
  const validAnimations = animations.filter((a) => a.entrance || a.exit || a.emphasis || a.motionPath).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
92141
92499
  if (existingRawTiming) {
92142
92500
  const cloned = typeof structuredClone === "function" ? structuredClone(existingRawTiming) : JSON.parse(JSON.stringify(existingRawTiming));
92143
- return surgicallyUpdateTimingTree(cloned, validAnimations);
92501
+ return surgicallyUpdateTimingTree(cloned, animations);
92144
92502
  }
92145
92503
  if (validAnimations.length === 0) {
92504
+ if (animations.some((entry2) => entry2.afterAnimation !== void 0))
92505
+ throw new Error("Cannot edit after-animation without a supported native effect");
92146
92506
  return void 0;
92147
92507
  }
92148
92508
  this.nextId = 1;
@@ -108300,8 +108660,8 @@ function buildDefRPr(style, existing, resolveColor2) {
108300
108660
  return rPr;
108301
108661
  }
108302
108662
  function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveColor2) {
108303
- const hasAny = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
108304
- if (!hasAny) {
108663
+ const hasAny2 = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
108664
+ if (!hasAny2) {
108305
108665
  return;
108306
108666
  }
108307
108667
  const titleKey = findKey7(axisNode, "title", getLocalName2);
@@ -110155,8 +110515,8 @@ function applyRotationFlipToRawNode(node, rotation, flipH, flipV) {
110155
110515
  const spPrKey = findChildKey2(node, "spPr");
110156
110516
  const container2 = spPrKey ? node[spPrKey] ?? node : node;
110157
110517
  const xfrmKey = findChildKey2(container2, "xfrm");
110158
- const hasAny = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
110159
- if (!xfrmKey && !hasAny) {
110518
+ const hasAny2 = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
110519
+ if (!xfrmKey && !hasAny2) {
110160
110520
  return;
110161
110521
  }
110162
110522
  const xfrm = xfrmKey ? container2[xfrmKey] : {};
@@ -110191,24 +110551,24 @@ function hexVal(hex3) {
110191
110551
  }
110192
110552
  function buildRunProps(para) {
110193
110553
  const rPr = {};
110194
- let hasAny = false;
110554
+ let hasAny2 = false;
110195
110555
  if (para.fontSize !== void 0) {
110196
110556
  rPr["@_sz"] = String(Math.round(para.fontSize * 100));
110197
- hasAny = true;
110557
+ hasAny2 = true;
110198
110558
  }
110199
110559
  if (para.bold) {
110200
110560
  rPr["@_b"] = "1";
110201
- hasAny = true;
110561
+ hasAny2 = true;
110202
110562
  }
110203
110563
  if (para.italic) {
110204
110564
  rPr["@_i"] = "1";
110205
- hasAny = true;
110565
+ hasAny2 = true;
110206
110566
  }
110207
110567
  if (para.color) {
110208
110568
  rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hexVal(para.color) } };
110209
- hasAny = true;
110569
+ hasAny2 = true;
110210
110570
  }
110211
- return hasAny ? rPr : void 0;
110571
+ return hasAny2 ? rPr : void 0;
110212
110572
  }
110213
110573
  function buildParagraphNode(para) {
110214
110574
  const node = {};
@@ -112251,7 +112611,7 @@ var init_blob_url_to_data_url = __esm({
112251
112611
 
112252
112612
  // pptx/core/core/runtime/image-a14-effects-model.ts
112253
112613
  function applyA14ExtensionToEffects(effects, a14) {
112254
- let hasAny = false;
112614
+ let hasAny2 = false;
112255
112615
  if (a14.artisticEffect !== void 0) {
112256
112616
  effects.artisticEffect = a14.artisticEffect;
112257
112617
  if (a14.originalImageRelId !== void 0) {
@@ -112263,15 +112623,15 @@ function applyA14ExtensionToEffects(effects, a14) {
112263
112623
  if (a14.artisticParams) {
112264
112624
  effects.artisticParams = a14.artisticParams;
112265
112625
  }
112266
- hasAny = true;
112626
+ hasAny2 = true;
112267
112627
  }
112268
112628
  if (a14.backgroundRemoval) {
112269
112629
  effects.backgroundRemoval = a14.backgroundRemoval;
112270
- hasAny = true;
112630
+ hasAny2 = true;
112271
112631
  }
112272
112632
  if (a14.originalImageRelId !== void 0) {
112273
112633
  effects.originalImageRelId = a14.originalImageRelId;
112274
- hasAny = true;
112634
+ hasAny2 = true;
112275
112635
  }
112276
112636
  const corrections = {};
112277
112637
  if (a14.sharpenSoften) {
@@ -112294,9 +112654,9 @@ function applyA14ExtensionToEffects(effects, a14) {
112294
112654
  if (a14.originalImageRelId !== void 0) {
112295
112655
  effects.prerenderedCorrections = corrections;
112296
112656
  }
112297
- hasAny = true;
112657
+ hasAny2 = true;
112298
112658
  }
112299
- return hasAny;
112659
+ return hasAny2;
112300
112660
  }
112301
112661
  var init_image_a14_effects_model = __esm({
112302
112662
  "pptx/core/core/runtime/image-a14-effects-model.ts"() {
@@ -114567,13 +114927,13 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114567
114927
  return null;
114568
114928
  }
114569
114929
  const effects = {};
114570
- let hasAny = false;
114930
+ let hasAny2 = false;
114571
114931
  const brightRaw = blip["@_bright"] ?? blip["@_brt"];
114572
114932
  if (brightRaw !== null) {
114573
114933
  const val = parseInt(String(brightRaw));
114574
114934
  if (Number.isFinite(val)) {
114575
114935
  effects.brightness = val / 1e3;
114576
- hasAny = true;
114936
+ hasAny2 = true;
114577
114937
  }
114578
114938
  }
114579
114939
  const contrastRaw = blip["@_contrast"] ?? blip["@_cont"];
@@ -114581,7 +114941,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114581
114941
  const val = parseInt(String(contrastRaw));
114582
114942
  if (Number.isFinite(val)) {
114583
114943
  effects.contrast = val / 1e3;
114584
- hasAny = true;
114944
+ hasAny2 = true;
114585
114945
  }
114586
114946
  }
114587
114947
  const colorEffects = parseImageColorEffects(
@@ -114591,12 +114951,12 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114591
114951
  );
114592
114952
  Object.assign(effects, colorEffects);
114593
114953
  if (Object.keys(colorEffects).length > 0) {
114594
- hasAny = true;
114954
+ hasAny2 = true;
114595
114955
  }
114596
114956
  const alphaEffects = parseImageAlphaEffects(blip, (node) => this.parseColor(node));
114597
114957
  Object.assign(effects, alphaEffects);
114598
114958
  if (Object.keys(alphaEffects).length > 0) {
114599
- hasAny = true;
114959
+ hasAny2 = true;
114600
114960
  }
114601
114961
  const lumNode = blip["a:lum"];
114602
114962
  if (lumNode) {
@@ -114616,7 +114976,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114616
114976
  }
114617
114977
  }
114618
114978
  effects.lum = lumEffect;
114619
- hasAny = true;
114979
+ hasAny2 = true;
114620
114980
  }
114621
114981
  const hslNode = blip["a:hsl"];
114622
114982
  if (hslNode) {
@@ -114643,7 +115003,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114643
115003
  }
114644
115004
  }
114645
115005
  effects.hsl = hslEffect;
114646
- hasAny = true;
115006
+ hasAny2 = true;
114647
115007
  }
114648
115008
  const tintNode = blip["a:tint"];
114649
115009
  if (tintNode) {
@@ -114663,7 +115023,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114663
115023
  }
114664
115024
  }
114665
115025
  effects.tint = tintEffect;
114666
- hasAny = true;
115026
+ hasAny2 = true;
114667
115027
  }
114668
115028
  const fillOverlay = blip["a:fillOverlay"];
114669
115029
  if (fillOverlay) {
@@ -114690,7 +115050,7 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114690
115050
  ...resolvedGradient ? { resolvedGradient } : {},
114691
115051
  ...resolvedPattern ? { resolvedPattern } : {}
114692
115052
  };
114693
- hasAny = true;
115053
+ hasAny2 = true;
114694
115054
  }
114695
115055
  const blurNode = blip["a:blur"];
114696
115056
  if (blurNode) {
@@ -114708,16 +115068,16 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
114708
115068
  blurEffect.grow = s === "1" || s === "true";
114709
115069
  }
114710
115070
  effects.blur = blurEffect;
114711
- hasAny = true;
115071
+ hasAny2 = true;
114712
115072
  }
114713
115073
  const extLst = xmlChild(blip, "a:extLst");
114714
115074
  if (extLst) {
114715
115075
  const a14 = parseA14ImageExtension(this.ensureArray(extLst["a:ext"]));
114716
115076
  if (a14 && applyA14ExtensionToEffects(effects, a14)) {
114717
- hasAny = true;
115077
+ hasAny2 = true;
114718
115078
  }
114719
115079
  }
114720
- return hasAny ? effects : null;
115080
+ return hasAny2 ? effects : null;
114721
115081
  }
114722
115082
  /**
114723
115083
  * Resolve a blip `a:fillOverlay/a:gradFill` to the structured gradient a
@@ -116370,8 +116730,8 @@ function buildTextRunEffectListXml(style, parseColor) {
116370
116730
  const hasTextHsl = typeof style.textHslHue === "number" || typeof style.textHslSaturation === "number" || typeof style.textHslLuminance === "number";
116371
116731
  const hasTextClrChange = Boolean(style.textClrChangeFrom) && Boolean(style.textClrChangeTo);
116372
116732
  const hasTextDuotone = Boolean(style.textDuotone);
116373
- const hasAny = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
116374
- if (!hasAny) {
116733
+ const hasAny2 = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
116734
+ if (!hasAny2) {
116375
116735
  return void 0;
116376
116736
  }
116377
116737
  const effectLst = {};
@@ -120695,6 +121055,87 @@ var init_table_column_width_save = __esm({
120695
121055
  }
120696
121056
  });
120697
121057
 
121058
+ // pptx/core/core/runtime/table-style-change-cell-clear.ts
121059
+ function normaliseStyleId(id) {
121060
+ const text2 = typeof id === "string" || typeof id === "number" ? String(id) : "";
121061
+ const trimmed2 = text2.trim().toUpperCase();
121062
+ if (!trimmed2) {
121063
+ return "";
121064
+ }
121065
+ return trimmed2.startsWith("{") ? trimmed2 : `{${trimmed2}}`;
121066
+ }
121067
+ function xmlTableStyleId(tblPr) {
121068
+ if (!tblPr || typeof tblPr !== "object") {
121069
+ return "";
121070
+ }
121071
+ const props = tblPr;
121072
+ const node = props["a:tableStyleId"];
121073
+ const spec = normaliseStyleId(
121074
+ node && typeof node === "object" ? node["#text"] : node
121075
+ );
121076
+ if (spec) {
121077
+ return spec;
121078
+ }
121079
+ const legacy = props["a:tblStyle"];
121080
+ return normaliseStyleId(legacy?.["@_val"] || props["@_tblStyle"]);
121081
+ }
121082
+ function tableStyleIdChanged(tblPr, nextStyleId) {
121083
+ if (nextStyleId === void 0) {
121084
+ return false;
121085
+ }
121086
+ return normaliseStyleId(nextStyleId) !== xmlTableStyleId(tblPr);
121087
+ }
121088
+ function clearCellFormattingForStyleChange(xmlCell, style) {
121089
+ const tcPr = xmlCell["a:tcPr"];
121090
+ if (!tcPr || typeof tcPr !== "object") {
121091
+ return;
121092
+ }
121093
+ const props = tcPr;
121094
+ if (!hasAny(style, FILL_FIELDS)) {
121095
+ for (const key2 of FILL_KEYS) {
121096
+ delete props[key2];
121097
+ }
121098
+ }
121099
+ for (const [key2, fields] of LINE_KEYS) {
121100
+ if (!hasAny(style, fields)) {
121101
+ delete props[key2];
121102
+ }
121103
+ }
121104
+ if (!style?.cell3D) {
121105
+ delete props["a:cell3D"];
121106
+ }
121107
+ }
121108
+ var FILL_KEYS, LINE_KEYS, FILL_FIELDS, hasAny;
121109
+ var init_table_style_change_cell_clear = __esm({
121110
+ "pptx/core/core/runtime/table-style-change-cell-clear.ts"() {
121111
+ FILL_KEYS = [
121112
+ "a:noFill",
121113
+ "a:solidFill",
121114
+ "a:gradFill",
121115
+ "a:blipFill",
121116
+ "a:pattFill",
121117
+ "a:grpFill"
121118
+ ];
121119
+ LINE_KEYS = [
121120
+ ["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
121121
+ ["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
121122
+ ["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
121123
+ ["a:lnB", ["borderBottomWidth", "borderBottomColor", "borderBottomDash"]],
121124
+ ["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
121125
+ ["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
121126
+ ];
121127
+ FILL_FIELDS = [
121128
+ "fillMode",
121129
+ "backgroundColor",
121130
+ "gradientFillStops",
121131
+ "patternFillPreset",
121132
+ "backgroundImageFillPath",
121133
+ "backgroundImageFillData"
121134
+ ];
121135
+ hasAny = (style, keys) => keys.some((key2) => style?.[key2] !== void 0);
121136
+ }
121137
+ });
121138
+
120698
121139
  // pptx/core/core/runtime/table-paragraph-save-order.ts
120699
121140
  function runTag(run) {
120700
121141
  return run.isLineBreak ? "a:br" : run.isField ? "a:fld" : "a:r";
@@ -121421,6 +121862,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
121421
121862
  init_PptxHandlerRuntimeChartUserShapes();
121422
121863
  init_save_table_merge_helpers();
121423
121864
  init_table_column_width_save();
121865
+ init_table_style_change_cell_clear();
121424
121866
  init_table_paragraph_save_order();
121425
121867
  init_table_structural_ops();
121426
121868
  init_table_tblpr_save();
@@ -121442,6 +121884,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
121442
121884
  if (!tbl) {
121443
121885
  return;
121444
121886
  }
121887
+ const styleChanged = tableData.clearDirectCellFormatting === true || tableStyleIdChanged(tbl["a:tblPr"], tableData.tableStyleId);
121445
121888
  serializeTablePropertyFlags(tbl, tableData);
121446
121889
  writeTablePropertiesOwnFillAndEffects(tbl["a:tblPr"], tableData);
121447
121890
  const xmlRows = this.ensureArray(tbl["a:tr"]);
@@ -121473,6 +121916,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
121473
121916
  if (cell.text !== void 0) {
121474
121917
  this.writeTableCellText(xmlCell, cell.text);
121475
121918
  }
121919
+ if (styleChanged) {
121920
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
121921
+ }
121476
121922
  if (cell.style) {
121477
121923
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
121478
121924
  }
@@ -121496,6 +121942,9 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
121496
121942
  if (cell.text !== void 0) {
121497
121943
  this.writeTableCellText(xmlCell, cell.text);
121498
121944
  }
121945
+ if (styleChanged) {
121946
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
121947
+ }
121499
121948
  if (cell.style) {
121500
121949
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
121501
121950
  }
@@ -132170,6 +132619,7 @@ var PptxHandlerRuntime60;
132170
132619
  var init_PptxHandlerRuntimeGeometryParsing = __esm({
132171
132620
  "pptx/core/core/runtime/PptxHandlerRuntimeGeometryParsing.ts"() {
132172
132621
  init_color_primitives();
132622
+ init_custom_geometry_command_order();
132173
132623
  init_custom_geometry_parser();
132174
132624
  init_guide_formula();
132175
132625
  init_PptxHandlerRuntimePlaceholderLookup();
@@ -132331,6 +132781,10 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
132331
132781
  const pathLst = custGeom["a:pathLst"];
132332
132782
  if (isNonEmpty(pathLst)) {
132333
132783
  result.pathLstXml = pathLst;
132784
+ const pathCommandOrder = readPathListCommandOrder(pathLst);
132785
+ if (pathCommandOrder) {
132786
+ result.pathCommandOrder = pathCommandOrder;
132787
+ }
132334
132788
  }
132335
132789
  return Object.keys(result).length > 0 ? result : void 0;
132336
132790
  }
@@ -133241,7 +133695,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
133241
133695
  return void 0;
133242
133696
  }
133243
133697
  const locks = {};
133244
- let hasAny = false;
133698
+ let hasAny2 = false;
133245
133699
  const boolAttr2 = (attr6) => {
133246
133700
  const raw = spLocks[attr6];
133247
133701
  if (raw === void 0) {
@@ -133254,7 +133708,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
133254
133708
  const val = boolAttr2(attr6);
133255
133709
  if (val !== void 0) {
133256
133710
  fn(val);
133257
- hasAny = true;
133711
+ hasAny2 = true;
133258
133712
  }
133259
133713
  };
133260
133714
  set2("@_noGrp", (v) => {
@@ -133293,7 +133747,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
133293
133747
  set2("@_noCrop", (v) => {
133294
133748
  locks.noCrop = v;
133295
133749
  });
133296
- return hasAny ? locks : void 0;
133750
+ return hasAny2 ? locks : void 0;
133297
133751
  }
133298
133752
  /**
133299
133753
  * Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
@@ -133582,6 +134036,36 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
133582
134036
  )
133583
134037
  );
133584
134038
  const pPr = this.mergeXmlObjects(lstStyleParagraphDefaults, directPPr);
134039
+ if (!textStyle.inheritedParagraphSpacing) {
134040
+ textStyle.inheritedParagraphSpacing = {};
134041
+ for (let spacingLevel = 0; spacingLevel < 9; spacingLevel++) {
134042
+ const key2 = `a:lvl${spacingLevel + 1}pPr`;
134043
+ const defaults = this.mergeXmlObjects(
134044
+ this.mergeXmlObjects(
134045
+ inheritedLstStyle?.["a:defPPr"],
134046
+ inheritedLstStyle?.[key2]
134047
+ ),
134048
+ this.mergeXmlObjects(
134049
+ ownLstStyle?.["a:defPPr"],
134050
+ ownLstStyle?.[key2]
134051
+ )
134052
+ );
134053
+ const inherited = this.mergeXmlObjects(
134054
+ defaults,
134055
+ inheritedParagraph?.["a:pPr"]
134056
+ );
134057
+ const spacing = this.extractParagraphOwnProperties({ "a:pPr": inherited }, textStyle.fontSize) ?? {};
134058
+ const phLevel = ctx.effectiveLevelStyles?.[spacingLevel];
134059
+ const phBase = ctx.effectiveLevelStyles?.[-1];
134060
+ if (phLevel) this.applyPlaceholderLevelDefaults(spacing, phLevel);
134061
+ if (phBase) this.applyPlaceholderLevelDefaults(spacing, phBase);
134062
+ textStyle.inheritedParagraphSpacing[spacingLevel] = {
134063
+ paragraphSpacingBefore: spacing.paragraphSpacingBefore ?? 0,
134064
+ paragraphSpacingAfter: spacing.paragraphSpacingAfter ?? 0,
134065
+ ...spacing.lineSpacingExactPt !== void 0 ? { lineSpacingExactPt: spacing.lineSpacingExactPt } : { lineSpacing: spacing.lineSpacing ?? 1 }
134066
+ };
134067
+ }
134068
+ }
133585
134069
  const paragraphRtl = this.parseOptionalBooleanAttr(pPr?.["@_rtl"]);
133586
134070
  if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
133587
134071
  textStyle.rtl = paragraphRtl;
@@ -141921,13 +142405,15 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
141921
142405
  });
141922
142406
 
141923
142407
  // pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
141924
- var PptxHandlerRuntime96;
142408
+ var XSD_INT_MIN, XSD_INT_MAX, PptxHandlerRuntime96;
141925
142409
  var init_PptxHandlerRuntimePresentationStructure = __esm({
141926
142410
  "pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts"() {
141927
142411
  init_kinsoku_parser();
141928
142412
  init_presentation_section_parser();
141929
142413
  init_header_footer_parts();
141930
142414
  init_PptxHandlerRuntimeChartParsing();
142415
+ XSD_INT_MIN = -2147483648;
142416
+ XSD_INT_MAX = 2147483647;
141931
142417
  PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
141932
142418
  parseEditorAnimations(slideXml3) {
141933
142419
  return this.editorAnimationService.parseEditorAnimations(slideXml3);
@@ -142110,6 +142596,22 @@ var init_PptxHandlerRuntimePresentationStructure = __esm({
142110
142596
  const lexical = String(raw).trim().toLowerCase();
142111
142597
  return lexical !== "0" && lexical !== "false";
142112
142598
  }
142599
+ /**
142600
+ * Extract `p:presentation/@firstSlideNum` (ECMA-376 §19.2.1.26, an
142601
+ * `xsd:int`). `undefined` when absent, not an integer, or outside the
142602
+ * `xsd:int` range (-2147483648 to 2147483647, which also rejects digit
142603
+ * strings too long to parse), so the spec default (`1`) is never forced
142604
+ * onto the typed model.
142605
+ */
142606
+ extractFirstSlideNumber() {
142607
+ const pres = this.presentationData?.["p:presentation"];
142608
+ const lexical = String(pres?.["@_firstSlideNum"] ?? "").trim();
142609
+ if (!/^[+-]?\d+$/.test(lexical)) {
142610
+ return void 0;
142611
+ }
142612
+ const value = Number(lexical);
142613
+ return value >= XSD_INT_MIN && value <= XSD_INT_MAX ? value : void 0;
142614
+ }
142113
142615
  };
142114
142616
  }
142115
142617
  });
@@ -142780,7 +143282,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
142780
143282
  this.commentAuthorDetails.size > 0 ? Array.from(this.commentAuthorDetails.values()) : void 0
142781
143283
  ).withModernCommentAuthors(
142782
143284
  this.modernCommentAuthors.size > 0 ? Array.from(this.modernCommentAuthors.values()) : void 0
142783
- ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withDefaultTextStyle(defaultTextStyle).build();
143285
+ ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withFirstSlideNumber(this.extractFirstSlideNumber()).withDefaultTextStyle(defaultTextStyle).build();
142784
143286
  }
142785
143287
  /**
142786
143288
  * Walk the raw XML of every slide to find the highest numeric `@_id`
@@ -147187,7 +147689,10 @@ var init_PptxHandler = __esm({
147187
147689
  const imported = deserializePptxFromJson(text2);
147188
147690
  const blankBytes = await buildBlankPresentationArchive({
147189
147691
  width: imported.widthEmu,
147190
- height: imported.heightEmu
147692
+ height: imported.heightEmu,
147693
+ // Saving writes presentation.xml from the loaded archive, not from
147694
+ // the overlaid model, so the archive must carry the value itself.
147695
+ firstSlideNumber: imported.firstSlideNumber
147191
147696
  });
147192
147697
  const base = await super.load(blankBytes, options);
147193
147698
  return applyImportedPptxData(base, imported);