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
@@ -1,4 +1,4 @@
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';
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, readPathListCommandOrder, 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-EC2W2MDY.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';
@@ -1761,7 +1761,7 @@ function rootRelsXml() {
1761
1761
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
1762
1762
  </Relationships>`;
1763
1763
  }
1764
- function presentationXml(width, height, slideCount) {
1764
+ function presentationXml(width, height, slideCount, firstSlideNumber) {
1765
1765
  const slideIdBase = 256;
1766
1766
  const slideRIdBase = 6;
1767
1767
  const sldIdLst = slideCount > 0 ? ` <p:sldIdLst>
@@ -1770,6 +1770,7 @@ ${Array.from(
1770
1770
  (_, i) => ` <p:sldId id="${slideIdBase + i}" r:id="rId${slideRIdBase + i}"/>`
1771
1771
  ).join("\n")}
1772
1772
  </p:sldIdLst>` : "";
1773
+ const firstSlideNum = firstSlideNumber === void 0 ? "" : ` firstSlideNum="${Math.trunc(firstSlideNumber)}"`;
1773
1774
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1774
1775
  <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
1775
1776
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
@@ -1777,7 +1778,7 @@ ${Array.from(
1777
1778
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1778
1779
  xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
1779
1780
  xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"
1780
- saveSubsetFonts="1">
1781
+ saveSubsetFonts="1"${firstSlideNum}>
1781
1782
  <p:sldMasterIdLst>
1782
1783
  <p:sldMasterId id="2147483648" r:id="rId1"/>
1783
1784
  </p:sldMasterIdLst>
@@ -2014,7 +2015,10 @@ async function buildBlankPresentationArchive(options) {
2014
2015
  const zip = new JSZip5();
2015
2016
  zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
2016
2017
  zip.file("_rels/.rels", rootRelsXml());
2017
- zip.file("ppt/presentation.xml", presentationXml(width, height, initialSlideCount));
2018
+ zip.file(
2019
+ "ppt/presentation.xml",
2020
+ presentationXml(width, height, initialSlideCount, options?.firstSlideNumber)
2021
+ );
2018
2022
  zip.file("ppt/_rels/presentation.xml.rels", presentationRelsXml(layoutCount, initialSlideCount));
2019
2023
  zip.file("ppt/slideMasters/slideMaster1.xml", slideMasterXml(layoutCount));
2020
2024
  zip.file("ppt/slideMasters/_rels/slideMaster1.xml.rels", slideMasterRelsXml(layoutCount));
@@ -10057,7 +10061,7 @@ function parseShapeLockNode(node, spec) {
10057
10061
  return void 0;
10058
10062
  }
10059
10063
  const locks = {};
10060
- let hasAny = false;
10064
+ let hasAny2 = false;
10061
10065
  for (const prop of spec.permitted) {
10062
10066
  const raw = node[LOCK_ATTRIBUTE[prop]];
10063
10067
  if (raw === void 0) {
@@ -10065,9 +10069,9 @@ function parseShapeLockNode(node, spec) {
10065
10069
  }
10066
10070
  const value = String(raw).trim().toLowerCase();
10067
10071
  locks[prop] = value === "1" || value === "true";
10068
- hasAny = true;
10072
+ hasAny2 = true;
10069
10073
  }
10070
- return hasAny ? locks : void 0;
10074
+ return hasAny2 ? locks : void 0;
10071
10075
  }
10072
10076
 
10073
10077
  // pptx/core/core/runtime/shape-lock-containers.ts
@@ -10871,6 +10875,7 @@ var PptxLoadDataBuilder = class {
10871
10875
  modernCommentAuthors;
10872
10876
  conformance;
10873
10877
  embedTrueTypeFonts;
10878
+ firstSlideNumber;
10874
10879
  defaultTextStyle;
10875
10880
  withDimensions(width, height, widthEmu, heightEmu) {
10876
10881
  this.width = width;
@@ -11040,6 +11045,10 @@ var PptxLoadDataBuilder = class {
11040
11045
  this.embedTrueTypeFonts = embedTrueTypeFonts;
11041
11046
  return this;
11042
11047
  }
11048
+ withFirstSlideNumber(firstSlideNumber) {
11049
+ this.firstSlideNumber = firstSlideNumber;
11050
+ return this;
11051
+ }
11043
11052
  withDefaultTextStyle(defaultTextStyle) {
11044
11053
  this.defaultTextStyle = defaultTextStyle;
11045
11054
  return this;
@@ -11091,6 +11100,7 @@ var PptxLoadDataBuilder = class {
11091
11100
  modernCommentAuthors: this.modernCommentAuthors,
11092
11101
  conformance: this.conformance,
11093
11102
  embedTrueTypeFonts: this.embedTrueTypeFonts,
11103
+ firstSlideNumber: this.firstSlideNumber,
11094
11104
  defaultTextStyle: this.defaultTextStyle
11095
11105
  };
11096
11106
  }
@@ -14889,6 +14899,345 @@ async function attachRealMediaDurations(elements2, nativeAnimations, readBytes)
14889
14899
  applyPlainDelayRemap(nativeAnimations, plainDelayRemap);
14890
14900
  }
14891
14901
 
14902
+ // pptx/core/services/editor-animation-entry.ts
14903
+ var DEFAULT_ANIMATION_DURATION_MS = 500;
14904
+ var DEFAULT_ANIMATION_TRIGGER = "onClick";
14905
+ function hasAuthoredAnimationEffect(entry2) {
14906
+ return Boolean(
14907
+ [entry2.entrance, entry2.exit, entry2.emphasis].some((preset) => preset && preset !== "none") || entry2.motionPath
14908
+ );
14909
+ }
14910
+ function hasAnimation(animations, elementId) {
14911
+ const entry2 = animationFor(animations, elementId);
14912
+ return Boolean(entry2 && (entry2.entrance || entry2.exit || entry2.emphasis || entry2.motionPath));
14913
+ }
14914
+ function animationFor(slideAnimations, elementId) {
14915
+ return slideAnimations.find((a) => a.elementId === elementId);
14916
+ }
14917
+ function upsert(anims, elementId, updater) {
14918
+ const idx = anims.findIndex((a) => a.elementId === elementId);
14919
+ if (idx >= 0) {
14920
+ const updated2 = updater({ ...anims[idx] });
14921
+ if (updated2 === null) {
14922
+ return anims.filter((a) => a.elementId !== elementId);
14923
+ }
14924
+ return anims.map((a, i) => i === idx ? updated2 : a);
14925
+ }
14926
+ const created = {
14927
+ elementId,
14928
+ durationMs: DEFAULT_ANIMATION_DURATION_MS,
14929
+ order: anims.length,
14930
+ trigger: DEFAULT_ANIMATION_TRIGGER
14931
+ };
14932
+ const updated = updater(created);
14933
+ if (updated === null) {
14934
+ return [...anims];
14935
+ }
14936
+ return [...anims, updated];
14937
+ }
14938
+
14939
+ // pptx/core/services/native-animation-after-effect.ts
14940
+ function hasAfterEffectFlag(cTn) {
14941
+ const raw = cTn?.["@_afterEffect"];
14942
+ return raw === "1" || raw === "true";
14943
+ }
14944
+ function extractSrgbHex(colorContainer) {
14945
+ const srgb = colorContainer?.["a:srgbClr"];
14946
+ const val = srgb?.["@_val"];
14947
+ return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
14948
+ }
14949
+ function findDimBehaviour(subTnLst) {
14950
+ for (const node of ensureArray3(subTnLst["p:animClr"])) {
14951
+ const cBhvr = node["p:cBhvr"];
14952
+ if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
14953
+ continue;
14954
+ }
14955
+ if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
14956
+ continue;
14957
+ }
14958
+ const toNode = node["p:to"];
14959
+ const color = extractSrgbHex(toNode);
14960
+ if (color) {
14961
+ return { action: "dimToColor", color };
14962
+ }
14963
+ const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
14964
+ return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
14965
+ }
14966
+ return void 0;
14967
+ }
14968
+ function findHideBehaviour(subTnLst) {
14969
+ for (const node of ensureArray3(subTnLst["p:set"])) {
14970
+ const cBhvr = node["p:cBhvr"];
14971
+ if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
14972
+ continue;
14973
+ }
14974
+ const innerCTn = cBhvr?.["p:cTn"];
14975
+ if (!hasAfterEffectFlag(innerCTn)) {
14976
+ continue;
14977
+ }
14978
+ const toNode = node["p:to"];
14979
+ const strVal = toNode?.["p:strVal"]?.["@_val"];
14980
+ if (String(strVal ?? "").toLowerCase() !== "hidden") {
14981
+ continue;
14982
+ }
14983
+ const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
14984
+ return { action };
14985
+ }
14986
+ return void 0;
14987
+ }
14988
+ function extractAfterAnimationFromSubTnLst(cTn) {
14989
+ const subTnLst = cTn["p:subTnLst"];
14990
+ if (!subTnLst) {
14991
+ return void 0;
14992
+ }
14993
+ return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
14994
+ }
14995
+
14996
+ // pptx/core/services/animation-after-effect-write.ts
14997
+ function assertAfterAnimationClearSupported(effectCTn) {
14998
+ const shapeIds = /* @__PURE__ */ new Set();
14999
+ const checkTarget = (value) => {
15000
+ if (Array.isArray(value)) {
15001
+ value.forEach(checkTarget);
15002
+ return;
15003
+ }
15004
+ if (!isXmlObject3(value)) return;
15005
+ const shapeTarget = value["p:spTgt"];
15006
+ if (isXmlObject3(shapeTarget) && shapeTarget["@_spid"] !== void 0)
15007
+ shapeIds.add(String(shapeTarget["@_spid"]));
15008
+ if ([
15009
+ "p:bg",
15010
+ "p:txEl",
15011
+ "p:subSp",
15012
+ "p:graphicEl",
15013
+ "p:oleChartEl",
15014
+ "p:sndTgt",
15015
+ "p:inkTgt",
15016
+ "p:sldTgt"
15017
+ ].some((key2) => value[key2] !== void 0))
15018
+ throw new Error("Clearing after-animation supports whole-shape targets only");
15019
+ Object.values(value).forEach(checkTarget);
15020
+ };
15021
+ checkTarget(effectCTn["p:childTnLst"]);
15022
+ if (shapeIds.size > 1)
15023
+ throw new Error("Editing after-animation supports a single whole-shape target only");
15024
+ const sub = effectCTn["p:subTnLst"];
15025
+ if (!isXmlObject3(sub)) return;
15026
+ const countAfterFlags = (value) => {
15027
+ if (Array.isArray(value))
15028
+ return value.reduce((count, child14) => count + countAfterFlags(child14), 0);
15029
+ if (!isXmlObject3(value)) return 0;
15030
+ return Object.entries(value).reduce(
15031
+ (count, [key2, child14]) => count + (key2 === "@_afterEffect" && ["1", "true"].includes(String(child14)) ? 1 : countAfterFlags(child14)),
15032
+ 0
15033
+ );
15034
+ };
15035
+ for (const [key2, value] of Object.entries(sub)) {
15036
+ for (const node of ensureArray3(value)) {
15037
+ const flags = countAfterFlags(node);
15038
+ if (!flags) continue;
15039
+ if (flags !== 1 || !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } }))
15040
+ throw new Error("Cannot clear an unsupported native after-animation behavior");
15041
+ checkTarget(node);
15042
+ }
15043
+ }
15044
+ if (shapeIds.size > 1)
15045
+ throw new Error("Editing after-animation supports a single whole-shape target only");
15046
+ }
15047
+ function clearAfterAnimationBehavior(effectCTn) {
15048
+ const sub = effectCTn["p:subTnLst"];
15049
+ if (!isXmlObject3(sub)) return;
15050
+ for (const key2 of Object.keys(sub)) {
15051
+ const nodes = ensureArray3(sub[key2]);
15052
+ const remaining = nodes.filter(
15053
+ (node) => !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } })
15054
+ );
15055
+ if (remaining.length === nodes.length) continue;
15056
+ if (remaining.length === 0) delete sub[key2];
15057
+ else sub[key2] = remaining.length === 1 ? remaining[0] : remaining;
15058
+ }
15059
+ if (Object.keys(sub).length === 0) delete effectCTn["p:subTnLst"];
15060
+ }
15061
+ function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
15062
+ if (anim.afterAnimation === void 0) return;
15063
+ if (anim.afterAnimation === "none") {
15064
+ assertAfterAnimationClearSupported(effectCTn);
15065
+ clearAfterAnimationBehavior(effectCTn);
15066
+ return;
15067
+ }
15068
+ assertAfterAnimationClearSupported(effectCTn);
15069
+ clearAfterAnimationBehavior(effectCTn);
15070
+ delete effectCTn["@_afterEffect"];
15071
+ if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
15072
+ appendAfterAnimationBehavior(effectCTn, buildDimSubTnLst(shapeId, anim.afterAnimationColor));
15073
+ return;
15074
+ }
15075
+ if (anim.afterAnimation === "hideAfterAnimation") {
15076
+ const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
15077
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "sameClick", entranceId));
15078
+ return;
15079
+ }
15080
+ if (anim.afterAnimation === "hideOnNextClick") {
15081
+ appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "nextClick"));
15082
+ }
15083
+ }
15084
+ function appendAfterAnimationBehavior(effect, addition) {
15085
+ const sub = isXmlObject3(effect["p:subTnLst"]) ? effect["p:subTnLst"] : {};
15086
+ for (const [key2, value] of Object.entries(addition)) {
15087
+ const nodes = [...ensureArray3(sub[key2]), ...ensureArray3(value)];
15088
+ sub[key2] = nodes.length === 1 ? nodes[0] : nodes;
15089
+ }
15090
+ effect["p:subTnLst"] = sub;
15091
+ }
15092
+ function buildDimSubTnLst(shapeId, colorHex) {
15093
+ const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
15094
+ return {
15095
+ "p:animClr": {
15096
+ "@_clrSpc": "rgb",
15097
+ "@_dir": "cw",
15098
+ "p:cBhvr": {
15099
+ "@_override": "childStyle",
15100
+ "p:cTn": {
15101
+ "@_dur": "1",
15102
+ "@_fill": "hold",
15103
+ "@_display": "0",
15104
+ "@_masterRel": "nextClick",
15105
+ "@_afterEffect": "1"
15106
+ },
15107
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
15108
+ "p:attrNameLst": { "p:attrName": "ppt_c" }
15109
+ },
15110
+ "p:to": { "a:srgbClr": { "@_val": hex3 } }
15111
+ }
15112
+ };
15113
+ }
15114
+ function buildHideSubTnLst(shapeId, masterRel, entranceId) {
15115
+ const cTn = {
15116
+ "@_dur": "1",
15117
+ "@_fill": "hold",
15118
+ "@_display": "0",
15119
+ "@_masterRel": masterRel,
15120
+ "@_afterEffect": "1"
15121
+ };
15122
+ if (masterRel === "sameClick") {
15123
+ cTn["p:stCondLst"] = {
15124
+ "p:cond": {
15125
+ "@_evt": "end",
15126
+ "@_delay": "0",
15127
+ "p:tn": { "@_val": entranceId ?? "0" }
15128
+ }
15129
+ };
15130
+ }
15131
+ return {
15132
+ "p:set": {
15133
+ "p:cBhvr": {
15134
+ "@_override": "childStyle",
15135
+ "p:cTn": cTn,
15136
+ "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
15137
+ "p:attrNameLst": { "p:attrName": "style.visibility" }
15138
+ },
15139
+ "p:to": { "p:strVal": { "@_val": "hidden" } }
15140
+ }
15141
+ };
15142
+ }
15143
+
15144
+ // pptx/core/services/editor-animation-after-effect.ts
15145
+ var AFTER_ANIMATION_VALUES = [
15146
+ "none",
15147
+ "dimToColor",
15148
+ "hideAfterAnimation",
15149
+ "hideOnNextClick"
15150
+ ];
15151
+ var DEFAULT_AFTER_ANIMATION_DIM_COLOR = "#808080";
15152
+ function setAfterAnimation(anims, elementId, action) {
15153
+ return upsert(anims, elementId, (cur) => {
15154
+ const value = action;
15155
+ return {
15156
+ ...cur,
15157
+ afterAnimation: value,
15158
+ afterAnimationColor: value === "dimToColor" ? cur.afterAnimationColor ?? DEFAULT_AFTER_ANIMATION_DIM_COLOR : void 0
15159
+ };
15160
+ });
15161
+ }
15162
+ function setAfterAnimationColor(anims, elementId, color) {
15163
+ const entry2 = animationFor(anims, elementId);
15164
+ if (!entry2 || (entry2.afterAnimation ?? entry2.nativeAfterAnimation) !== "dimToColor") {
15165
+ return [...anims];
15166
+ }
15167
+ return upsert(anims, elementId, (cur) => ({
15168
+ ...cur,
15169
+ afterAnimation: "dimToColor",
15170
+ afterAnimationColor: color
15171
+ }));
15172
+ }
15173
+ function getAfterAnimation(slideAnimations, elementId) {
15174
+ const entry2 = animationFor(slideAnimations, elementId);
15175
+ return entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
15176
+ }
15177
+ function getAfterAnimationState(entry2) {
15178
+ const action = entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
15179
+ return {
15180
+ action,
15181
+ color: action === "dimToColor" ? entry2?.afterAnimationColor ?? entry2?.nativeAfterAnimationColor : void 0,
15182
+ showColor: entry2?.afterAnimation !== void 0 || /^#[0-9a-f]{6}$/iu.test(entry2?.nativeAfterAnimationColor ?? "")
15183
+ };
15184
+ }
15185
+ function isNativeAfterAnimationOnly(entry2) {
15186
+ return Boolean(
15187
+ entry2?.nativeAfterAnimation && !entry2.entrance && !entry2.exit && !entry2.emphasis && !entry2.motionPath
15188
+ );
15189
+ }
15190
+ function mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming) {
15191
+ for (const native of nativeAnimations ?? []) {
15192
+ const existing = native.targetId ? animationFor(animations, native.targetId) : void 0;
15193
+ const action = native.afterAnimationAction ?? (existing?.afterAnimation !== void 0 ? "none" : void 0);
15194
+ if ((nativeAnimations ?? []).filter(
15195
+ (other) => other.targetId === native.targetId && ["entr", "emph"].includes(other.presetClass ?? "")
15196
+ ).length !== 1)
15197
+ continue;
15198
+ if (!native.targetId || !action || !["entr", "emph"].includes(native.presetClass ?? "") || native.textTarget)
15199
+ continue;
15200
+ if (native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
15201
+ continue;
15202
+ try {
15203
+ if (rawTiming && native.target?.type === "shape" && indexEffectNodes(rawTiming).filter(
15204
+ (ref) => ref.spid === (native.target?.type === "shape" ? native.target.shapeId : void 0) && ["entr", "emph"].includes(ref.presetClass)
15205
+ ).length !== 1)
15206
+ continue;
15207
+ const effect = rawTiming ? indexEffectNodes(rawTiming).find(
15208
+ (ref) => String(ref.cTn["@_id"]) === String(native.nodeId) && native.target?.type === "shape" && ref.spid === native.target.shapeId
15209
+ ) : void 0;
15210
+ if (rawTiming && !effect) continue;
15211
+ assertAfterAnimationClearSupported(
15212
+ effect?.cTn ?? { "p:subTnLst": native.cTnAttributes?.["p:subTnLst"] }
15213
+ );
15214
+ } catch {
15215
+ continue;
15216
+ }
15217
+ let entry2 = animationFor(animations, native.targetId);
15218
+ if (!entry2) {
15219
+ entry2 = { elementId: native.targetId };
15220
+ animations.push(entry2);
15221
+ }
15222
+ if (entry2.nativeAfterAnimation !== void 0) continue;
15223
+ entry2.nativeAfterAnimation = action;
15224
+ entry2.nativeAfterAnimationColor = native.afterAnimationColor;
15225
+ }
15226
+ }
15227
+ function isNativeAfterAnimationFallback(entry2) {
15228
+ return entry2.nativeAfterAnimation !== void 0 && Object.entries(entry2).every(
15229
+ ([key2, value]) => value === void 0 || [
15230
+ "elementId",
15231
+ "nativeAfterAnimation",
15232
+ "nativeAfterAnimationColor",
15233
+ "soundRId",
15234
+ "soundPath",
15235
+ "soundName",
15236
+ "stopSound"
15237
+ ].includes(key2)
15238
+ );
15239
+ }
15240
+
14892
15241
  // pptx/core/services/slide-name.ts
14893
15242
  function asNode3(value) {
14894
15243
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -15390,6 +15739,8 @@ var PptxSlideLoaderService = class {
15390
15739
  }
15391
15740
  });
15392
15741
  reconcileAnimationTargets(elements2, nativeAnimations, animations, animationTimelineAnchors);
15742
+ animations ??= [];
15743
+ mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming);
15393
15744
  mergeNativeSoundIntoEditorAnimations(nativeAnimations, animations);
15394
15745
  mergeNativeBuildTemplatesIntoEditorAnimations(nativeAnimations, animations);
15395
15746
  applyHiddenFlagFromRawXml(elements2);
@@ -15815,7 +16166,7 @@ var PptxEditorAnimationService = class {
15815
16166
  * @param animations - Editor animations to serialize.
15816
16167
  */
15817
16168
  applyEditorAnimations(slideNode, animations) {
15818
- const sequenced = [...animations].sort((left, right) => sortOrder(left) - sortOrder(right));
16169
+ const sequenced = animations.filter((entry2) => !isNativeAfterAnimationFallback(entry2)).sort((left, right) => sortOrder(left) - sortOrder(right));
15819
16170
  const sanitizedAnimations = sequenced.map((animation) => {
15820
16171
  const elementId = String(animation.elementId || "").trim();
15821
16172
  if (elementId.length === 0) {
@@ -15829,7 +16180,7 @@ var PptxEditorAnimationService = class {
15829
16180
  const orderIsTreeDerived = animation.orderFromTimeline !== void 0 && animation.order === animation.orderFromTimeline;
15830
16181
  const order = typeof animation.order === "number" && Number.isFinite(animation.order) && !orderIsTreeDerived ? Math.round(animation.order) : void 0;
15831
16182
  const repeatCount = typeof animation.repeatCount === "number" && Number.isFinite(animation.repeatCount) && animation.repeatCount > 0 ? animation.repeatCount : void 0;
15832
- if (!entrance && !exit2 && !emphasis && !animation.motionPath) {
16183
+ if (!entrance && !exit2 && !emphasis && !animation.motionPath && animation.afterAnimation === void 0) {
15833
16184
  return null;
15834
16185
  }
15835
16186
  return {
@@ -16220,109 +16571,6 @@ function collectMediaNodes(node, animations) {
16220
16571
  }
16221
16572
  }
16222
16573
 
16223
- // pptx/core/services/animation-effect-filter-parsing.ts
16224
- var FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
16225
- function parseFilterToken(raw) {
16226
- const trimmed2 = raw.trim();
16227
- if (!trimmed2) {
16228
- return void 0;
16229
- }
16230
- const match = FILTER_TOKEN_RE.exec(trimmed2);
16231
- if (!match) {
16232
- return void 0;
16233
- }
16234
- const family = match[1].toLowerCase();
16235
- const subtypeToken = match[2];
16236
- const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
16237
- return { family, subtype };
16238
- }
16239
- function parseAnimEffectFilter(childTnList) {
16240
- if (!childTnList) {
16241
- return void 0;
16242
- }
16243
- const rawAnimEffect = childTnList["p:animEffect"];
16244
- const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
16245
- if (!animEffect || typeof animEffect !== "object") {
16246
- return void 0;
16247
- }
16248
- const node = animEffect;
16249
- const filterAttr = node["@_filter"];
16250
- if (filterAttr === void 0 || filterAttr === null) {
16251
- return void 0;
16252
- }
16253
- const raw = String(filterAttr);
16254
- const firstToken = raw.split(";")[0] ?? "";
16255
- const parsed = parseFilterToken(firstToken);
16256
- if (!parsed) {
16257
- return void 0;
16258
- }
16259
- const transitionAttr = node["@_transition"];
16260
- const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
16261
- return {
16262
- family: parsed.family,
16263
- subtype: parsed.subtype,
16264
- transition,
16265
- raw
16266
- };
16267
- }
16268
-
16269
- // pptx/core/services/native-animation-after-effect.ts
16270
- function hasAfterEffectFlag(cTn) {
16271
- const raw = cTn?.["@_afterEffect"];
16272
- return raw === "1" || raw === "true";
16273
- }
16274
- function extractSrgbHex(colorContainer) {
16275
- const srgb = colorContainer?.["a:srgbClr"];
16276
- const val = srgb?.["@_val"];
16277
- return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
16278
- }
16279
- function findDimBehaviour(subTnLst) {
16280
- for (const node of ensureArray3(subTnLst["p:animClr"])) {
16281
- const cBhvr = node["p:cBhvr"];
16282
- if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
16283
- continue;
16284
- }
16285
- if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
16286
- continue;
16287
- }
16288
- const toNode = node["p:to"];
16289
- const color = extractSrgbHex(toNode);
16290
- if (color) {
16291
- return { action: "dimToColor", color };
16292
- }
16293
- const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
16294
- return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
16295
- }
16296
- return void 0;
16297
- }
16298
- function findHideBehaviour(subTnLst) {
16299
- for (const node of ensureArray3(subTnLst["p:set"])) {
16300
- const cBhvr = node["p:cBhvr"];
16301
- if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
16302
- continue;
16303
- }
16304
- const innerCTn = cBhvr?.["p:cTn"];
16305
- if (!hasAfterEffectFlag(innerCTn)) {
16306
- continue;
16307
- }
16308
- const toNode = node["p:to"];
16309
- const strVal = toNode?.["p:strVal"]?.["@_val"];
16310
- if (String(strVal ?? "").toLowerCase() !== "hidden") {
16311
- continue;
16312
- }
16313
- const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
16314
- return { action };
16315
- }
16316
- return void 0;
16317
- }
16318
- function extractAfterAnimationFromSubTnLst(cTn) {
16319
- const subTnLst = cTn["p:subTnLst"];
16320
- if (!subTnLst) {
16321
- return void 0;
16322
- }
16323
- return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
16324
- }
16325
-
16326
16574
  // pptx/core/services/native-animation-cbhvr-attrs.ts
16327
16575
  var ADDITIVE_VALUES = /* @__PURE__ */ new Set(["base", "sum", "repl", "mult", "none"]);
16328
16576
  var ACCUMULATE_VALUES = /* @__PURE__ */ new Set(["none", "always"]);
@@ -16393,51 +16641,6 @@ function extractChildCalcMode(childTnList) {
16393
16641
  return void 0;
16394
16642
  }
16395
16643
 
16396
- // pptx/core/services/native-animation-attribute-components.ts
16397
- function extractBounceEndFraction(raw) {
16398
- if (raw === void 0) {
16399
- return void 0;
16400
- }
16401
- const parsed = Number(raw);
16402
- if (!Number.isFinite(parsed)) {
16403
- return void 0;
16404
- }
16405
- return Math.max(0, Math.min(1, parsed / 1e5));
16406
- }
16407
- function extractAttributeAnimations(childTnList) {
16408
- if (!childTnList) {
16409
- return void 0;
16410
- }
16411
- const components = [];
16412
- for (const node of ensureArray3(childTnList["p:anim"])) {
16413
- const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
16414
- const keyframes = extractKeyframes(node);
16415
- const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
16416
- const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
16417
- const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
16418
- const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
16419
- if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
16420
- continue;
16421
- }
16422
- const behavior = node["p:cBhvr"];
16423
- const cTn = behavior?.["p:cTn"];
16424
- const calcMode = normalizeCalcMode(node["@_calcmode"]);
16425
- const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
16426
- components.push({
16427
- attrName,
16428
- keyframes: keyframes ?? [],
16429
- durationMs: readTimingAttr(cTn?.["@_dur"]),
16430
- delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
16431
- ...calcMode ? { calcMode } : {},
16432
- ...from !== void 0 ? { from } : {},
16433
- ...to !== void 0 ? { to } : {},
16434
- ...by !== void 0 ? { by } : {},
16435
- ...bounceEnd !== void 0 ? { bounceEnd } : {}
16436
- });
16437
- }
16438
- return components.length > 0 ? components : void 0;
16439
- }
16440
-
16441
16644
  // pptx/core/services/native-animation-behaviors.ts
16442
16645
  var BEHAVIOR_TAGS = [
16443
16646
  "p:set",
@@ -16465,6 +16668,16 @@ function readTiming(cTn) {
16465
16668
  return {};
16466
16669
  }
16467
16670
  const timing = {};
16671
+ const starts = ensureArray3(cTn["p:stCondLst"]?.["p:cond"]);
16672
+ 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(
16673
+ (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"
16674
+ )) {
16675
+ timing.unsupportedSetTiming = true;
16676
+ }
16677
+ const fill = cTn["@_fill"];
16678
+ if (fill === "remove" || fill === "freeze" || fill === "hold" || fill === "transition") {
16679
+ timing.fill = fill;
16680
+ }
16468
16681
  const durationMs = readTimingAttr(cTn["@_dur"]);
16469
16682
  if (durationMs !== void 0) {
16470
16683
  timing.durationMs = durationMs;
@@ -16621,6 +16834,199 @@ function extractBehaviors(childTnList) {
16621
16834
  return behaviors.length > 0 ? behaviors : void 0;
16622
16835
  }
16623
16836
 
16837
+ // pptx/core/services/native-animation-visibility-timing.ts
16838
+ var neutralTiming = (node) => [
16839
+ "@_repeatDur",
16840
+ "@_tmFilter",
16841
+ "@_endSync",
16842
+ "@_evtFilter",
16843
+ "@_display",
16844
+ "@_masterRel",
16845
+ "@_syncBehavior",
16846
+ "@_nodePh",
16847
+ "@_progress",
16848
+ "@_p14:presetBounceEnd",
16849
+ "p:endCondLst",
16850
+ "p:endSync",
16851
+ "p:iterate"
16852
+ ].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");
16853
+ function hasNativeVisibilitySet(node) {
16854
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0") return false;
16855
+ const children5 = node["p:childTnLst"];
16856
+ if (!isXmlObject3(children5)) return false;
16857
+ return ensureArray3(children5["p:set"]).some((set) => {
16858
+ const common = set["p:cBhvr"];
16859
+ const list = isXmlObject3(common) ? common["p:attrNameLst"] : void 0;
16860
+ const names = isXmlObject3(list) ? list["p:attrName"] : void 0;
16861
+ return (Array.isArray(names) ? names : [names]).some(
16862
+ (name) => String(isXmlObject3(name) ? name["#text"] : name).trim().toLowerCase() === "style.visibility"
16863
+ );
16864
+ });
16865
+ }
16866
+ function simpleStarts(node, clickGate = false) {
16867
+ const list = node["p:stCondLst"];
16868
+ if (list === void 0) return true;
16869
+ if (!isXmlObject3(list) || Object.keys(list).some((key2) => key2 !== "p:cond")) return false;
16870
+ const conditions = ensureArray3(list["p:cond"]);
16871
+ return conditions.length === 1 && conditions.every(
16872
+ (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")
16873
+ );
16874
+ }
16875
+ function unsupportedVisibilityContainerTiming(node) {
16876
+ if (node["@_presetClass"] !== void 0) return false;
16877
+ const structuralRoot = ["tmRoot", "mainSeq"].includes(String(node["@_nodeType"] ?? ""));
16878
+ return !neutralTiming(node) || !simpleStarts(node, true) || ensureArray3(isXmlObject3(node["p:stCondLst"]) ? node["p:stCondLst"]["p:cond"] : void 0).some(
16879
+ (condition) => /^\d+$/u.test(String(condition["@_delay"])) && Number(condition["@_delay"]) > 0
16880
+ ) || node["@_dur"] !== void 0 && !(structuralRoot && node["@_dur"] === "indefinite") || node["@_fill"] !== void 0 && node["@_fill"] !== "hold" || node["p:subTnLst"] !== void 0;
16881
+ }
16882
+ function extractVisibilitySetTiming(node) {
16883
+ if (node["@_presetClass"] !== "entr" || String(node["@_presetID"]) !== "0" || String(node["@_presetSubtype"] ?? "0") !== "0" || node["@_dur"] !== void 0 || node["@_fill"] !== "hold" || !neutralTiming(node) || !simpleStarts(node))
16884
+ return void 0;
16885
+ const children5 = node["p:childTnLst"];
16886
+ if (!isXmlObject3(children5) || Object.keys(children5).length !== 1 || !children5["p:set"])
16887
+ return void 0;
16888
+ const sets = ensureArray3(children5["p:set"]);
16889
+ if (sets.length !== 1) return void 0;
16890
+ if (Object.keys(sets[0]).some((key2) => !["p:cBhvr", "p:to"].includes(key2))) return void 0;
16891
+ const to = sets[0]["p:to"];
16892
+ if (!isXmlObject3(to) || Object.keys(to).length !== 1 || !isXmlObject3(to["p:strVal"]) || Object.keys(to["p:strVal"]).some((key2) => key2 !== "@_val") || to["p:strVal"]["@_val"] !== "visible")
16893
+ return void 0;
16894
+ const common = sets[0]["p:cBhvr"];
16895
+ if (!isXmlObject3(common) || Object.keys(common).some(
16896
+ (key2) => !["p:cTn", "p:tgtEl", "p:attrNameLst", "@_additive"].includes(key2)
16897
+ ) || common["@_additive"] !== void 0 && !["base", "repl", "none"].includes(String(common["@_additive"])))
16898
+ return void 0;
16899
+ const target = common["p:tgtEl"];
16900
+ if (!isXmlObject3(target) || Object.keys(target).length !== 1 || !isXmlObject3(target["p:spTgt"]) || Object.keys(target["p:spTgt"]).some((key2) => key2 !== "@_spid") || !/^\d+$/u.test(String(target["p:spTgt"]["@_spid"])))
16901
+ return void 0;
16902
+ const child14 = common["p:cTn"];
16903
+ if (!isXmlObject3(child14) || !neutralTiming(child14) || !simpleStarts(child14) || String(child14["@_dur"]) !== "1" || child14["@_fill"] !== "hold")
16904
+ return void 0;
16905
+ const behavior = extractBehaviors(children5)?.[0];
16906
+ if (!behavior || behavior.kind !== "set" || behavior.value !== "visible" || behavior.attrNames.length !== 1 || behavior.attrNames[0] !== "style.visibility" || behavior.timing.unsupportedSetTiming)
16907
+ return void 0;
16908
+ try {
16909
+ assertAfterAnimationClearSupported(node);
16910
+ } catch {
16911
+ return void 0;
16912
+ }
16913
+ const sub = node["p:subTnLst"];
16914
+ if (sub !== void 0) {
16915
+ if (!isXmlObject3(sub)) return void 0;
16916
+ for (const [key2, raw] of Object.entries(sub)) {
16917
+ for (const value of ensureArray3(raw)) {
16918
+ if (!extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: value } }))
16919
+ return void 0;
16920
+ }
16921
+ }
16922
+ }
16923
+ const delayMs = behavior.timing.delayMs ?? 0;
16924
+ if (!Number.isSafeInteger(delayMs) || delayMs < 0 || delayMs >= 2147483647) return void 0;
16925
+ return { delayMs, durationMs: 1 };
16926
+ }
16927
+ function resolveVisibilitySetTiming(anim) {
16928
+ const timing = anim.visibilitySetTiming;
16929
+ if (!timing || anim.presetClass !== "entr" || anim.presetId !== 0 || (anim.presetSubtype ?? 0) !== 0 || anim.fill !== "hold" || anim.seqConcurrent !== true || anim.seqNextAction !== "seek" || !["onClick", "withPrevious"].includes(anim.trigger ?? "") || anim.textTarget || !anim.target || anim.target.type !== "shape" || anim.target.backgroundOnly || anim.target.subShapeId || anim.target.graphicElement || anim.target.oleChartElement || anim.autoReverse || (anim.accel ?? 0) !== 0 || (anim.decel ?? 0) !== 0 || (anim.startConditions?.length ?? 0) > 1 || anim.startConditions?.some(
16930
+ (condition) => Object.entries(condition).some(([key2, value]) => value !== void 0 && key2 !== "delay") || condition.delay !== void 0 && (!Number.isSafeInteger(condition.delay) || condition.delay < 0)
16931
+ ) || (anim.repeatCount ?? 1) !== 1 || anim.repeatDurMs !== void 0 || (anim.speedPct ?? 100) !== 100 || anim.unsupportedOpacitySetTiming || anim.unsupportedVisibilitySet || anim.endConditions?.length || anim.rawEndCondLst !== void 0 || anim.cTnAttributes?.["@_tmFilter"] !== void 0 || anim.cTnAttributes?.["@_endSync"] !== void 0 || Object.keys(anim.cTnAttributes ?? {}).some((key2) => key2 !== "p:subTnLst") || !Number.isSafeInteger(timing.delayMs) || timing.delayMs < 0 || timing.delayMs >= 2147483647 || timing.durationMs !== 1 || anim.durationMs !== timing.delayMs + 1)
16932
+ return void 0;
16933
+ const behavior = anim.behaviors?.[0];
16934
+ if (anim.behaviors?.length !== 1 || !behavior || behavior.kind !== "set" || behavior.value !== "visible" || behavior.attrNames.length !== 1 || behavior.attrNames[0] !== "style.visibility" || behavior.timing.unsupportedSetTiming || behavior.timing.autoReverse || (behavior.timing.repeatCount ?? 1) !== 1 || behavior.timing.tmFilter !== void 0 || (behavior.timing.accel ?? 0) !== 0 || (behavior.timing.decel ?? 0) !== 0 || behavior.additive !== void 0 && !["base", "repl", "none"].includes(behavior.additive) || behavior.timing.fill !== "hold" || behavior.timing.durationMs !== 1 || (behavior.timing.delayMs ?? 0) !== timing.delayMs)
16935
+ return void 0;
16936
+ return timing;
16937
+ }
16938
+
16939
+ // pptx/core/services/animation-effect-filter-parsing.ts
16940
+ var FILTER_TOKEN_RE = /^([A-Za-z]+)(?:\(([^)]*)\))?$/;
16941
+ function parseFilterToken(raw) {
16942
+ const trimmed2 = raw.trim();
16943
+ if (!trimmed2) {
16944
+ return void 0;
16945
+ }
16946
+ const match = FILTER_TOKEN_RE.exec(trimmed2);
16947
+ if (!match) {
16948
+ return void 0;
16949
+ }
16950
+ const family = match[1].toLowerCase();
16951
+ const subtypeToken = match[2];
16952
+ const subtype = subtypeToken !== void 0 && subtypeToken !== "" ? subtypeToken : void 0;
16953
+ return { family, subtype };
16954
+ }
16955
+ function parseAnimEffectFilter(childTnList) {
16956
+ if (!childTnList) {
16957
+ return void 0;
16958
+ }
16959
+ const rawAnimEffect = childTnList["p:animEffect"];
16960
+ const animEffect = Array.isArray(rawAnimEffect) ? rawAnimEffect[0] : rawAnimEffect;
16961
+ if (!animEffect || typeof animEffect !== "object") {
16962
+ return void 0;
16963
+ }
16964
+ const node = animEffect;
16965
+ const filterAttr = node["@_filter"];
16966
+ if (filterAttr === void 0 || filterAttr === null) {
16967
+ return void 0;
16968
+ }
16969
+ const raw = String(filterAttr);
16970
+ const firstToken = raw.split(";")[0] ?? "";
16971
+ const parsed = parseFilterToken(firstToken);
16972
+ if (!parsed) {
16973
+ return void 0;
16974
+ }
16975
+ const transitionAttr = node["@_transition"];
16976
+ const transition = transitionAttr === "in" || transitionAttr === "out" || transitionAttr === "none" ? transitionAttr : void 0;
16977
+ return {
16978
+ family: parsed.family,
16979
+ subtype: parsed.subtype,
16980
+ transition,
16981
+ raw
16982
+ };
16983
+ }
16984
+
16985
+ // pptx/core/services/native-animation-attribute-components.ts
16986
+ function extractBounceEndFraction(raw) {
16987
+ if (raw === void 0) {
16988
+ return void 0;
16989
+ }
16990
+ const parsed = Number(raw);
16991
+ if (!Number.isFinite(parsed)) {
16992
+ return void 0;
16993
+ }
16994
+ return Math.max(0, Math.min(1, parsed / 1e5));
16995
+ }
16996
+ function extractAttributeAnimations(childTnList) {
16997
+ if (!childTnList) {
16998
+ return void 0;
16999
+ }
17000
+ const components = [];
17001
+ for (const node of ensureArray3(childTnList["p:anim"])) {
17002
+ const attrName = extractAttrNameFromCBhvr(node["p:cBhvr"]);
17003
+ const keyframes = extractKeyframes(node);
17004
+ const from = node["@_from"] !== void 0 ? String(node["@_from"]) : void 0;
17005
+ const to = node["@_to"] !== void 0 ? String(node["@_to"]) : void 0;
17006
+ const by = node["@_by"] !== void 0 ? String(node["@_by"]) : void 0;
17007
+ const hasKeyframes = Boolean(keyframes && keyframes.length > 0);
17008
+ if (!attrName || !hasKeyframes && from === void 0 && to === void 0 && by === void 0) {
17009
+ continue;
17010
+ }
17011
+ const behavior = node["p:cBhvr"];
17012
+ const cTn = behavior?.["p:cTn"];
17013
+ const calcMode = normalizeCalcMode(node["@_calcmode"]);
17014
+ const bounceEnd = extractBounceEndFraction(node["@_p14:bounceEnd"]);
17015
+ components.push({
17016
+ attrName,
17017
+ keyframes: keyframes ?? [],
17018
+ durationMs: readTimingAttr(cTn?.["@_dur"]),
17019
+ delayMs: cTn ? extractStartConditionDelayMs(cTn) : void 0,
17020
+ ...calcMode ? { calcMode } : {},
17021
+ ...from !== void 0 ? { from } : {},
17022
+ ...to !== void 0 ? { to } : {},
17023
+ ...by !== void 0 ? { by } : {},
17024
+ ...bounceEnd !== void 0 ? { bounceEnd } : {}
17025
+ });
17026
+ }
17027
+ return components.length > 0 ? components : void 0;
17028
+ }
17029
+
16624
17030
  // pptx/core/services/native-animation-child-timing.ts
16625
17031
  var PRIMARY_BEHAVIOUR_FAMILIES = [
16626
17032
  ["p:animMotion", "p:animRot", "p:animScale"],
@@ -16737,12 +17143,13 @@ function resolveNodeTrigger(cTn, currentTrigger) {
16737
17143
  }
16738
17144
  return trigger;
16739
17145
  }
16740
- function buildTimingNodeAnimation(cTn, trigger, group) {
17146
+ function buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor = false) {
16741
17147
  const presetClass = cTn["@_presetClass"];
16742
- const presetId = cTn["@_presetID"] ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
17148
+ const presetId = cTn["@_presetID"] !== void 0 ? Number.parseInt(String(cTn["@_presetID"]), 10) : void 0;
16743
17149
  const presetSubtype = cTn["@_presetSubtype"] !== void 0 ? Number.parseInt(String(cTn["@_presetSubtype"]), 10) : void 0;
16744
17150
  const childAutoReverseTiming = extractChildAutoReverseTiming(cTn, ensureArray3);
16745
- const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray3);
17151
+ const visibilitySetTiming = !unsupportedVisibilityAncestor && group.seqConcurrent === true && group.seqNextAction === "seek" && ["onClick", "withPrevious"].includes(trigger) ? extractVisibilitySetTiming(cTn) : void 0;
17152
+ const durationMs = readTimingAttr(cTn["@_dur"]) ?? childAutoReverseTiming?.durationMs ?? extractChildBehaviourDurationMs(cTn, ensureArray3) ?? (visibilitySetTiming ? visibilitySetTiming.delayMs + visibilitySetTiming.durationMs : void 0);
16746
17153
  const delayMs = readTimingAttr(cTn["@_delay"]) ?? extractStartConditionDelayMs(cTn);
16747
17154
  const accel = parseTimingPercentFraction(cTn["@_accel"]);
16748
17155
  const decel = parseTimingPercentFraction(cTn["@_decel"]);
@@ -16793,6 +17200,8 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
16793
17200
  presetId,
16794
17201
  presetSubtype,
16795
17202
  durationMs,
17203
+ visibilitySetTiming,
17204
+ unsupportedVisibilitySet: hasNativeVisibilitySet(cTn) && !visibilitySetTiming || void 0,
16796
17205
  delayMs,
16797
17206
  accel,
16798
17207
  decel,
@@ -16841,6 +17250,7 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
16841
17250
  commandString: cmdInfo.commandString,
16842
17251
  textTarget: textTarget ?? void 0,
16843
17252
  cTnAttributes: roundTripAttrs,
17253
+ unsupportedOpacitySetTiming: cTn["@_dur"] === "indefinite" || cTn["p:endSync"] !== void 0 || void 0,
16844
17254
  afterEffect: afterEffectFlag,
16845
17255
  afterAnimationAction: parsedAfterAnimation?.action,
16846
17256
  afterAnimationColor: parsedAfterAnimation?.color,
@@ -16876,17 +17286,18 @@ function extractTextTargetFromCTn(cTn) {
16876
17286
  }
16877
17287
 
16878
17288
  // pptx/core/services/native-animation-timing-walk.ts
16879
- function walkTimingTree(node, animations, currentTrigger, group, ctx) {
17289
+ function walkTimingTree(node, animations, currentTrigger, group, ctx, unsupportedVisibilityAncestor = false) {
16880
17290
  if (!node) {
16881
17291
  return;
16882
17292
  }
16883
17293
  const cTn = node["p:cTn"];
16884
17294
  if (cTn) {
16885
17295
  const trigger = resolveNodeTrigger(cTn, currentTrigger);
16886
- const animation = buildTimingNodeAnimation(cTn, trigger, group);
17296
+ const animation = buildTimingNodeAnimation(cTn, trigger, group, unsupportedVisibilityAncestor);
16887
17297
  if (animation) {
16888
17298
  animations.push(animation);
16889
17299
  }
17300
+ const unsupportedChildVisibility = unsupportedVisibilityAncestor || unsupportedVisibilityContainerTiming(cTn);
16890
17301
  const childTnList = cTn["p:childTnLst"];
16891
17302
  if (childTnList) {
16892
17303
  const isClickLevel = isMainSequence(cTn);
@@ -16906,7 +17317,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
16906
17317
  id: String(mainSequenceId)
16907
17318
  } : void 0
16908
17319
  }),
16909
- ctx
17320
+ ctx,
17321
+ unsupportedChildVisibility
16910
17322
  );
16911
17323
  }
16912
17324
  for (const sequence of sequences) {
@@ -16914,11 +17326,18 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
16914
17326
  continue;
16915
17327
  }
16916
17328
  const seqAttrs = extractSeqAttrs(sequence);
16917
- walkTimingTree(sequence, animations, trigger, { ...group, ...seqAttrs }, ctx);
17329
+ walkTimingTree(
17330
+ sequence,
17331
+ animations,
17332
+ trigger,
17333
+ { ...group, ...seqAttrs },
17334
+ ctx,
17335
+ unsupportedChildVisibility
17336
+ );
16918
17337
  }
16919
17338
  for (const excl of exclusives) {
16920
17339
  const exclAnims = [];
16921
- walkTimingTree(excl, exclAnims, trigger, group, ctx);
17340
+ walkTimingTree(excl, exclAnims, trigger, group, ctx, true);
16922
17341
  const exclGroupId = ctx.allocateExclGroupId();
16923
17342
  for (const a of exclAnims) {
16924
17343
  a.exclusive = true;
@@ -16938,7 +17357,8 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
16938
17357
  childGroupContext(group, parallel["p:cTn"], {
16939
17358
  isClickLevelGroup: false
16940
17359
  }),
16941
- ctx
17360
+ ctx,
17361
+ unsupportedVisibilityAncestor
16942
17362
  );
16943
17363
  }
16944
17364
  for (const sequence of directSequences) {
@@ -16946,7 +17366,14 @@ function walkTimingTree(node, animations, currentTrigger, group, ctx) {
16946
17366
  continue;
16947
17367
  }
16948
17368
  const seqAttrs = extractSeqAttrs(sequence);
16949
- walkTimingTree(sequence, animations, currentTrigger, { ...group, ...seqAttrs }, ctx);
17369
+ walkTimingTree(
17370
+ sequence,
17371
+ animations,
17372
+ currentTrigger,
17373
+ { ...group, ...seqAttrs },
17374
+ ctx,
17375
+ unsupportedVisibilityAncestor
17376
+ );
16950
17377
  }
16951
17378
  }
16952
17379
 
@@ -17578,75 +18005,6 @@ function isTransitionElementName(localName15) {
17578
18005
  return P14_TRANSITION_TYPES.has(localName15) || localName15 === "prstTrans" || localName15 === "morph";
17579
18006
  }
17580
18007
 
17581
- // pptx/core/services/animation-after-effect-write.ts
17582
- function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
17583
- delete effectCTn["p:subTnLst"];
17584
- delete effectCTn["@_afterEffect"];
17585
- if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
17586
- effectCTn["p:subTnLst"] = buildDimSubTnLst(shapeId, anim.afterAnimationColor);
17587
- return;
17588
- }
17589
- if (anim.afterAnimation === "hideAfterAnimation") {
17590
- const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
17591
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "sameClick", entranceId);
17592
- return;
17593
- }
17594
- if (anim.afterAnimation === "hideOnNextClick") {
17595
- effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "nextClick");
17596
- }
17597
- }
17598
- function buildDimSubTnLst(shapeId, colorHex) {
17599
- const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
17600
- return {
17601
- "p:animClr": {
17602
- "@_clrSpc": "rgb",
17603
- "@_dir": "cw",
17604
- "p:cBhvr": {
17605
- "@_override": "childStyle",
17606
- "p:cTn": {
17607
- "@_dur": "1",
17608
- "@_fill": "hold",
17609
- "@_display": "0",
17610
- "@_masterRel": "nextClick",
17611
- "@_afterEffect": "1"
17612
- },
17613
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
17614
- "p:attrNameLst": { "p:attrName": "ppt_c" }
17615
- },
17616
- "p:to": { "a:srgbClr": { "@_val": hex3 } }
17617
- }
17618
- };
17619
- }
17620
- function buildHideSubTnLst(shapeId, masterRel, entranceId) {
17621
- const cTn = {
17622
- "@_dur": "1",
17623
- "@_fill": "hold",
17624
- "@_display": "0",
17625
- "@_masterRel": masterRel,
17626
- "@_afterEffect": "1"
17627
- };
17628
- if (masterRel === "sameClick") {
17629
- cTn["p:stCondLst"] = {
17630
- "p:cond": {
17631
- "@_evt": "end",
17632
- "@_delay": "0",
17633
- "p:tn": { "@_val": entranceId ?? "0" }
17634
- }
17635
- };
17636
- }
17637
- return {
17638
- "p:set": {
17639
- "p:cBhvr": {
17640
- "@_override": "childStyle",
17641
- "p:cTn": cTn,
17642
- "p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
17643
- "p:attrNameLst": { "p:attrName": "style.visibility" }
17644
- },
17645
- "p:to": { "p:strVal": { "@_val": "hidden" } }
17646
- }
17647
- };
17648
- }
17649
-
17650
18008
  // pptx/core/services/animation-behavior-captures.json
17651
18009
  var animation_behavior_captures_default = {
17652
18010
  entr: {
@@ -35706,6 +36064,33 @@ function updateEffectNodeAttributes(cTn, anim, presetClass, shapeId, allocateId)
35706
36064
  applySoundToEffectCTn(cTn, anim);
35707
36065
  }
35708
36066
  function surgicallyUpdateTimingTree(rawTiming, animations) {
36067
+ const sourceRefs = indexEffectNodes(rawTiming);
36068
+ for (const entry2 of animations.filter((animation) => animation.afterAnimation !== void 0)) {
36069
+ if (sourceRefs.filter(
36070
+ (ref) => ref.spid === entry2.elementId && ["entr", "emph"].includes(ref.presetClass)
36071
+ ).length > 1)
36072
+ throw new Error(
36073
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
36074
+ );
36075
+ }
36076
+ const explicitClears = new Map(
36077
+ animations.filter((a) => a.afterAnimation !== void 0 && !hasAuthoredAnimationEffect(a)).map((a) => [a.elementId, a])
36078
+ );
36079
+ const clearRefs = sourceRefs.filter(
36080
+ (ref) => ref.spid && explicitClears.has(ref.spid) && (ref.presetClass === "entr" || ref.presetClass === "emph")
36081
+ );
36082
+ for (const target of explicitClears.keys()) {
36083
+ if (!clearRefs.some((ref) => ref.spid === target))
36084
+ throw new Error("Cannot edit after-animation without a supported native effect");
36085
+ if (clearRefs.filter((ref) => ref.spid === target).length > 1)
36086
+ throw new Error(
36087
+ "Cannot clear an ambiguous native after-animation target with multiple effects"
36088
+ );
36089
+ }
36090
+ clearRefs.forEach((ref) => assertAfterAnimationClearSupported(ref.cTn));
36091
+ clearRefs.forEach(
36092
+ (ref) => applyAfterAnimationBehavior(ref.cTn, explicitClears.get(ref.spid), ref.spid)
36093
+ );
35709
36094
  const desired = collectDesiredEffects(animations);
35710
36095
  const previouslyOwned = readOwnedEffectKeys(rawTiming);
35711
36096
  if (desired.length === 0 && previouslyOwned.size === 0) {
@@ -35800,9 +36185,11 @@ var PptxAnimationWriteService = class {
35800
36185
  const validAnimations = animations.filter((a) => a.entrance || a.exit || a.emphasis || a.motionPath).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
35801
36186
  if (existingRawTiming) {
35802
36187
  const cloned = typeof structuredClone === "function" ? structuredClone(existingRawTiming) : JSON.parse(JSON.stringify(existingRawTiming));
35803
- return surgicallyUpdateTimingTree(cloned, validAnimations);
36188
+ return surgicallyUpdateTimingTree(cloned, animations);
35804
36189
  }
35805
36190
  if (validAnimations.length === 0) {
36191
+ if (animations.some((entry2) => entry2.afterAnimation !== void 0))
36192
+ throw new Error("Cannot edit after-animation without a supported native effect");
35806
36193
  return void 0;
35807
36194
  }
35808
36195
  this.nextId = 1;
@@ -35977,6 +36364,151 @@ function capturedPresetNativeAnimation(presetClass, presetId, presetSubtype, dur
35977
36364
  return parsed ? { ...parsed } : void 0;
35978
36365
  }
35979
36366
 
36367
+ // pptx/core/services/editor-animation-after-effect-precedence.ts
36368
+ function applyAfterAnimationFromEditorList(nativeAnimations, editorAnimations) {
36369
+ if (!editorAnimations || editorAnimations.length === 0) {
36370
+ return [...nativeAnimations];
36371
+ }
36372
+ const byElement = /* @__PURE__ */ new Map();
36373
+ for (const ea of editorAnimations) {
36374
+ if (ea.afterAnimation !== void 0) {
36375
+ byElement.set(ea.elementId, ea);
36376
+ }
36377
+ }
36378
+ if (byElement.size === 0) {
36379
+ return [...nativeAnimations];
36380
+ }
36381
+ for (const [id, editor] of byElement) {
36382
+ const matches = nativeAnimations.filter(
36383
+ (native) => native.targetId === id && ["entr", "emph"].includes(native.presetClass ?? "")
36384
+ );
36385
+ if (matches.length > 1)
36386
+ throw new Error(
36387
+ "Cannot edit an ambiguous native after-animation target with multiple effects"
36388
+ );
36389
+ if (matches.length === 0 && !hasAuthoredAnimationEffect(editor))
36390
+ throw new Error("Cannot edit after-animation without a supported native effect");
36391
+ for (const native of matches) {
36392
+ if (native.textTarget || native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
36393
+ throw new Error("Editing after-animation supports whole-shape targets only");
36394
+ assertAfterAnimationClearSupported({
36395
+ "p:subTnLst": native.cTnAttributes?.["p:subTnLst"]
36396
+ });
36397
+ }
36398
+ }
36399
+ return nativeAnimations.map((anim) => {
36400
+ if (!anim.targetId || !["entr", "emph"].includes(anim.presetClass ?? "")) {
36401
+ return anim;
36402
+ }
36403
+ const ea = byElement.get(anim.targetId);
36404
+ if (!ea) {
36405
+ return anim;
36406
+ }
36407
+ return {
36408
+ ...anim,
36409
+ afterAnimationAction: ea.afterAnimation === "none" ? void 0 : ea.afterAnimation,
36410
+ afterAnimationColor: ea.afterAnimationColor,
36411
+ // The editor's own model has no theme-colour-ref concept (it always
36412
+ // writes a concrete hex); clear a native scheme ref so a stale one
36413
+ // never survives an edit that overrides the colour.
36414
+ afterAnimationColorRef: void 0
36415
+ };
36416
+ });
36417
+ }
36418
+
36419
+ // pptx/core/services/animation-opacity-set.ts
36420
+ var holds = (fill) => fill === "hold" || fill === "freeze";
36421
+ function resolveOpacitySet(anim) {
36422
+ if (anim.unsupportedOpacitySetTiming || anim.endConditions?.length || anim.rawEndCondLst !== void 0 || anim.cTnAttributes?.["@_tmFilter"] !== void 0 || anim.cTnAttributes?.["@_endSync"] !== void 0)
36423
+ return void 0;
36424
+ if (anim.afterAnimationAction !== void 0) return void 0;
36425
+ if (anim.target?.type === "shape" && (anim.target.backgroundOnly || anim.target.subShapeId || anim.target.graphicElement || anim.target.oleChartElement))
36426
+ return void 0;
36427
+ if (anim.textTarget || anim.target && anim.target.type !== "shape" || anim.trigger === "onHover")
36428
+ return void 0;
36429
+ if (anim.presetClass !== "emph" || anim.autoReverse || (anim.repeatCount ?? 1) !== 1 || anim.repeatDurMs !== void 0)
36430
+ return void 0;
36431
+ const behaviors = anim.behaviors;
36432
+ if (!behaviors?.length || behaviors.some(
36433
+ (b) => b.kind !== "set" && !(b.kind === "animEffect" && b.filter === "image" && (b.transition === void 0 || b.transition === "none"))
36434
+ ))
36435
+ return void 0;
36436
+ const sets = behaviors.filter((b) => b.kind === "set");
36437
+ if (sets.length !== 1) return void 0;
36438
+ const hints = behaviors.filter((b) => b.kind === "animEffect");
36439
+ if (hints.length > 1) return void 0;
36440
+ const hint = hints[0];
36441
+ if (hint && (hint.timing.unsupportedSetTiming || hint.timing.autoReverse || (hint.timing.repeatCount ?? 1) !== 1 || hint.timing.tmFilter !== void 0))
36442
+ return void 0;
36443
+ const set = sets[0];
36444
+ if (set.attrNames.length !== 1 || set.attrNames[0] !== "style.opacity" || set.additive !== void 0 && !["base", "repl", "none"].includes(set.additive))
36445
+ return void 0;
36446
+ const raw = set.value;
36447
+ if (typeof raw !== "number" && (typeof raw !== "string" || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/u.test(raw.trim())))
36448
+ return void 0;
36449
+ const value = Number(raw);
36450
+ const { timing } = set;
36451
+ if (timing.unsupportedSetTiming) return void 0;
36452
+ if (anim.fill === "transition" || timing.fill === "transition") return void 0;
36453
+ if (!Number.isFinite(value) || value < 0 || value > 1 || timing.autoReverse || (timing.repeatCount ?? 1) !== 1 || timing.tmFilter !== void 0)
36454
+ return void 0;
36455
+ const delayMs = timing.delayMs ?? 0;
36456
+ const durationMs = timing.durationMs;
36457
+ if (!Number.isFinite(delayMs) || delayMs < 0 || durationMs === void 0 || !Number.isFinite(durationMs) || durationMs < 0)
36458
+ return void 0;
36459
+ const effectDuration = anim.durationMs ?? delayMs + durationMs;
36460
+ if (!Number.isFinite(effectDuration) || effectDuration < delayMs || (anim.speedPct ?? 100) !== 100)
36461
+ return void 0;
36462
+ const holdEndState = holds(anim.fill) && holds(timing.fill);
36463
+ return {
36464
+ value,
36465
+ delayMs,
36466
+ durationMs: holds(timing.fill) ? effectDuration - delayMs : Math.min(durationMs, effectDuration - delayMs),
36467
+ holdEndState
36468
+ };
36469
+ }
36470
+
36471
+ // pptx/core/services/animation-effect-timing.ts
36472
+ function applySpeedToDuration(speedPct, baseDurationMs) {
36473
+ if (speedPct === void 0 || !Number.isFinite(speedPct) || speedPct <= 0) {
36474
+ return baseDurationMs;
36475
+ }
36476
+ return Math.max(1, Math.round(baseDurationMs / (speedPct / 100)));
36477
+ }
36478
+ function resolveIterationCount(repeatCount, repeatDurMs, adjustedDurationMs) {
36479
+ if (repeatCount !== void 0) {
36480
+ return repeatCount;
36481
+ }
36482
+ if (repeatDurMs === void 0) {
36483
+ return 1;
36484
+ }
36485
+ if (repeatDurMs === Infinity) {
36486
+ return Infinity;
36487
+ }
36488
+ if (adjustedDurationMs <= 0) {
36489
+ return 1;
36490
+ }
36491
+ return Math.max(1, Math.round(repeatDurMs / adjustedDurationMs));
36492
+ }
36493
+ function shouldHoldEndState(anim) {
36494
+ if (anim.presetClass !== "emph" && anim.presetClass !== "path") {
36495
+ return false;
36496
+ }
36497
+ return anim.fill === "hold" || anim.fill === "freeze" || anim.fill === "transition";
36498
+ }
36499
+ function resolveEffectTiming(anim, baseDurationMs) {
36500
+ const durationMs = applySpeedToDuration(anim.speedPct, baseDurationMs);
36501
+ const authoredIterations = resolveIterationCount(anim.repeatCount, anim.repeatDurMs, durationMs);
36502
+ const iterationCount = anim.autoReverse && anim.repeatDurMs === void 0 ? authoredIterations * 2 : authoredIterations;
36503
+ const activeDurationMs = Number.isFinite(iterationCount) ? durationMs * iterationCount : durationMs;
36504
+ return {
36505
+ durationMs,
36506
+ iterationCount,
36507
+ activeDurationMs,
36508
+ holdEndState: shouldHoldEndState(anim)
36509
+ };
36510
+ }
36511
+
35980
36512
  // pptx/core/utils/xml-namespace-declarations.ts
35981
36513
  var WELL_KNOWN_NAMESPACES = {
35982
36514
  a: "http://schemas.openxmlformats.org/drawingml/2006/main",
@@ -50465,8 +50997,8 @@ function buildDefRPr(style, existing, resolveColor2) {
50465
50997
  return rPr;
50466
50998
  }
50467
50999
  function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveColor2) {
50468
- const hasAny = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
50469
- if (!hasAny) {
51000
+ const hasAny2 = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
51001
+ if (!hasAny2) {
50470
51002
  return;
50471
51003
  }
50472
51004
  const titleKey = findKey(axisNode, "title", getLocalName2);
@@ -52185,8 +52717,8 @@ function applyRotationFlipToRawNode(node, rotation, flipH, flipV) {
52185
52717
  const spPrKey = findChildKey(node, "spPr");
52186
52718
  const container = spPrKey ? node[spPrKey] ?? node : node;
52187
52719
  const xfrmKey = findChildKey(container, "xfrm");
52188
- const hasAny = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
52189
- if (!xfrmKey && !hasAny) {
52720
+ const hasAny2 = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
52721
+ if (!xfrmKey && !hasAny2) {
52190
52722
  return;
52191
52723
  }
52192
52724
  const xfrm = xfrmKey ? container[xfrmKey] : {};
@@ -52223,24 +52755,24 @@ function hexVal(hex3) {
52223
52755
  }
52224
52756
  function buildRunProps(para) {
52225
52757
  const rPr = {};
52226
- let hasAny = false;
52758
+ let hasAny2 = false;
52227
52759
  if (para.fontSize !== void 0) {
52228
52760
  rPr["@_sz"] = String(Math.round(para.fontSize * 100));
52229
- hasAny = true;
52761
+ hasAny2 = true;
52230
52762
  }
52231
52763
  if (para.bold) {
52232
52764
  rPr["@_b"] = "1";
52233
- hasAny = true;
52765
+ hasAny2 = true;
52234
52766
  }
52235
52767
  if (para.italic) {
52236
52768
  rPr["@_i"] = "1";
52237
- hasAny = true;
52769
+ hasAny2 = true;
52238
52770
  }
52239
52771
  if (para.color) {
52240
52772
  rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hexVal(para.color) } };
52241
- hasAny = true;
52773
+ hasAny2 = true;
52242
52774
  }
52243
- return hasAny ? rPr : void 0;
52775
+ return hasAny2 ? rPr : void 0;
52244
52776
  }
52245
52777
  function buildParagraphNode(para) {
52246
52778
  const node = {};
@@ -54132,7 +54664,7 @@ function forceSvgStretchFill(svgText) {
54132
54664
 
54133
54665
  // pptx/core/core/runtime/image-a14-effects-model.ts
54134
54666
  function applyA14ExtensionToEffects(effects, a14) {
54135
- let hasAny = false;
54667
+ let hasAny2 = false;
54136
54668
  if (a14.artisticEffect !== void 0) {
54137
54669
  effects.artisticEffect = a14.artisticEffect;
54138
54670
  if (a14.originalImageRelId !== void 0) {
@@ -54144,15 +54676,15 @@ function applyA14ExtensionToEffects(effects, a14) {
54144
54676
  if (a14.artisticParams) {
54145
54677
  effects.artisticParams = a14.artisticParams;
54146
54678
  }
54147
- hasAny = true;
54679
+ hasAny2 = true;
54148
54680
  }
54149
54681
  if (a14.backgroundRemoval) {
54150
54682
  effects.backgroundRemoval = a14.backgroundRemoval;
54151
- hasAny = true;
54683
+ hasAny2 = true;
54152
54684
  }
54153
54685
  if (a14.originalImageRelId !== void 0) {
54154
54686
  effects.originalImageRelId = a14.originalImageRelId;
54155
- hasAny = true;
54687
+ hasAny2 = true;
54156
54688
  }
54157
54689
  const corrections = {};
54158
54690
  if (a14.sharpenSoften) {
@@ -54175,9 +54707,9 @@ function applyA14ExtensionToEffects(effects, a14) {
54175
54707
  if (a14.originalImageRelId !== void 0) {
54176
54708
  effects.prerenderedCorrections = corrections;
54177
54709
  }
54178
- hasAny = true;
54710
+ hasAny2 = true;
54179
54711
  }
54180
- return hasAny;
54712
+ return hasAny2;
54181
54713
  }
54182
54714
 
54183
54715
  // pptx/core/core/runtime/template-element-baselines.ts
@@ -55461,13 +55993,13 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55461
55993
  return null;
55462
55994
  }
55463
55995
  const effects = {};
55464
- let hasAny = false;
55996
+ let hasAny2 = false;
55465
55997
  const brightRaw = blip["@_bright"] ?? blip["@_brt"];
55466
55998
  if (brightRaw !== null) {
55467
55999
  const val = parseInt(String(brightRaw));
55468
56000
  if (Number.isFinite(val)) {
55469
56001
  effects.brightness = val / 1e3;
55470
- hasAny = true;
56002
+ hasAny2 = true;
55471
56003
  }
55472
56004
  }
55473
56005
  const contrastRaw = blip["@_contrast"] ?? blip["@_cont"];
@@ -55475,7 +56007,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55475
56007
  const val = parseInt(String(contrastRaw));
55476
56008
  if (Number.isFinite(val)) {
55477
56009
  effects.contrast = val / 1e3;
55478
- hasAny = true;
56010
+ hasAny2 = true;
55479
56011
  }
55480
56012
  }
55481
56013
  const colorEffects = parseImageColorEffects(
@@ -55485,12 +56017,12 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55485
56017
  );
55486
56018
  Object.assign(effects, colorEffects);
55487
56019
  if (Object.keys(colorEffects).length > 0) {
55488
- hasAny = true;
56020
+ hasAny2 = true;
55489
56021
  }
55490
56022
  const alphaEffects = parseImageAlphaEffects(blip, (node) => this.parseColor(node));
55491
56023
  Object.assign(effects, alphaEffects);
55492
56024
  if (Object.keys(alphaEffects).length > 0) {
55493
- hasAny = true;
56025
+ hasAny2 = true;
55494
56026
  }
55495
56027
  const lumNode = blip["a:lum"];
55496
56028
  if (lumNode) {
@@ -55510,7 +56042,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55510
56042
  }
55511
56043
  }
55512
56044
  effects.lum = lumEffect;
55513
- hasAny = true;
56045
+ hasAny2 = true;
55514
56046
  }
55515
56047
  const hslNode = blip["a:hsl"];
55516
56048
  if (hslNode) {
@@ -55537,7 +56069,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55537
56069
  }
55538
56070
  }
55539
56071
  effects.hsl = hslEffect;
55540
- hasAny = true;
56072
+ hasAny2 = true;
55541
56073
  }
55542
56074
  const tintNode = blip["a:tint"];
55543
56075
  if (tintNode) {
@@ -55557,7 +56089,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55557
56089
  }
55558
56090
  }
55559
56091
  effects.tint = tintEffect;
55560
- hasAny = true;
56092
+ hasAny2 = true;
55561
56093
  }
55562
56094
  const fillOverlay = blip["a:fillOverlay"];
55563
56095
  if (fillOverlay) {
@@ -55584,7 +56116,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55584
56116
  ...resolvedGradient ? { resolvedGradient } : {},
55585
56117
  ...resolvedPattern ? { resolvedPattern } : {}
55586
56118
  };
55587
- hasAny = true;
56119
+ hasAny2 = true;
55588
56120
  }
55589
56121
  const blurNode = blip["a:blur"];
55590
56122
  if (blurNode) {
@@ -55602,16 +56134,16 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
55602
56134
  blurEffect.grow = s === "1" || s === "true";
55603
56135
  }
55604
56136
  effects.blur = blurEffect;
55605
- hasAny = true;
56137
+ hasAny2 = true;
55606
56138
  }
55607
56139
  const extLst = xmlChild(blip, "a:extLst");
55608
56140
  if (extLst) {
55609
56141
  const a14 = parseA14ImageExtension(this.ensureArray(extLst["a:ext"]));
55610
56142
  if (a14 && applyA14ExtensionToEffects(effects, a14)) {
55611
- hasAny = true;
56143
+ hasAny2 = true;
55612
56144
  }
55613
56145
  }
55614
- return hasAny ? effects : null;
56146
+ return hasAny2 ? effects : null;
55615
56147
  }
55616
56148
  /**
55617
56149
  * Resolve a blip `a:fillOverlay/a:gradFill` to the structured gradient a
@@ -57189,8 +57721,8 @@ function buildTextRunEffectListXml(style, parseColor) {
57189
57721
  const hasTextHsl = typeof style.textHslHue === "number" || typeof style.textHslSaturation === "number" || typeof style.textHslLuminance === "number";
57190
57722
  const hasTextClrChange = Boolean(style.textClrChangeFrom) && Boolean(style.textClrChangeTo);
57191
57723
  const hasTextDuotone = Boolean(style.textDuotone);
57192
- const hasAny = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
57193
- if (!hasAny) {
57724
+ const hasAny2 = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
57725
+ if (!hasAny2) {
57194
57726
  return void 0;
57195
57727
  }
57196
57728
  const effectLst = {};
@@ -61335,6 +61867,82 @@ function writeTableColumnWidths(tbl, columnWidths) {
61335
61867
  }
61336
61868
  }
61337
61869
 
61870
+ // pptx/core/core/runtime/table-style-change-cell-clear.ts
61871
+ var FILL_KEYS = [
61872
+ "a:noFill",
61873
+ "a:solidFill",
61874
+ "a:gradFill",
61875
+ "a:blipFill",
61876
+ "a:pattFill",
61877
+ "a:grpFill"
61878
+ ];
61879
+ var LINE_KEYS = [
61880
+ ["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
61881
+ ["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
61882
+ ["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
61883
+ ["a:lnB", ["borderBottomWidth", "borderBottomColor", "borderBottomDash"]],
61884
+ ["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
61885
+ ["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
61886
+ ];
61887
+ var FILL_FIELDS = [
61888
+ "fillMode",
61889
+ "backgroundColor",
61890
+ "gradientFillStops",
61891
+ "patternFillPreset",
61892
+ "backgroundImageFillPath",
61893
+ "backgroundImageFillData"
61894
+ ];
61895
+ function normaliseStyleId(id) {
61896
+ const text = typeof id === "string" || typeof id === "number" ? String(id) : "";
61897
+ const trimmed2 = text.trim().toUpperCase();
61898
+ if (!trimmed2) {
61899
+ return "";
61900
+ }
61901
+ return trimmed2.startsWith("{") ? trimmed2 : `{${trimmed2}}`;
61902
+ }
61903
+ function xmlTableStyleId(tblPr) {
61904
+ if (!tblPr || typeof tblPr !== "object") {
61905
+ return "";
61906
+ }
61907
+ const props = tblPr;
61908
+ const node = props["a:tableStyleId"];
61909
+ const spec = normaliseStyleId(
61910
+ node && typeof node === "object" ? node["#text"] : node
61911
+ );
61912
+ if (spec) {
61913
+ return spec;
61914
+ }
61915
+ const legacy = props["a:tblStyle"];
61916
+ return normaliseStyleId(legacy?.["@_val"] || props["@_tblStyle"]);
61917
+ }
61918
+ function tableStyleIdChanged(tblPr, nextStyleId) {
61919
+ if (nextStyleId === void 0) {
61920
+ return false;
61921
+ }
61922
+ return normaliseStyleId(nextStyleId) !== xmlTableStyleId(tblPr);
61923
+ }
61924
+ var hasAny = (style, keys) => keys.some((key2) => style?.[key2] !== void 0);
61925
+ function clearCellFormattingForStyleChange(xmlCell, style) {
61926
+ const tcPr = xmlCell["a:tcPr"];
61927
+ if (!tcPr || typeof tcPr !== "object") {
61928
+ return;
61929
+ }
61930
+ const props = tcPr;
61931
+ if (!hasAny(style, FILL_FIELDS)) {
61932
+ for (const key2 of FILL_KEYS) {
61933
+ delete props[key2];
61934
+ }
61935
+ }
61936
+ for (const [key2, fields] of LINE_KEYS) {
61937
+ if (!hasAny(style, fields)) {
61938
+ delete props[key2];
61939
+ }
61940
+ }
61941
+ if (!style?.cell3D) {
61942
+ delete props["a:cell3D"];
61943
+ }
61944
+ }
61945
+
61338
61946
  // pptx/core/core/runtime/table-paragraph-save-order.ts
61339
61947
  var CONTENT_TAGS = /* @__PURE__ */ new Set(["a:r", "a:br", "a:fld"]);
61340
61948
  var paragraphOrders = /* @__PURE__ */ new WeakMap();
@@ -62267,6 +62875,7 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62267
62875
  if (!tbl) {
62268
62876
  return;
62269
62877
  }
62878
+ const styleChanged = tableData.clearDirectCellFormatting === true || tableStyleIdChanged(tbl["a:tblPr"], tableData.tableStyleId);
62270
62879
  serializeTablePropertyFlags(tbl, tableData);
62271
62880
  writeTablePropertiesOwnFillAndEffects(tbl["a:tblPr"], tableData);
62272
62881
  const xmlRows = this.ensureArray(tbl["a:tr"]);
@@ -62298,6 +62907,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62298
62907
  if (cell.text !== void 0) {
62299
62908
  this.writeTableCellText(xmlCell, cell.text);
62300
62909
  }
62910
+ if (styleChanged) {
62911
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
62912
+ }
62301
62913
  if (cell.style) {
62302
62914
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
62303
62915
  }
@@ -62321,6 +62933,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
62321
62933
  if (cell.text !== void 0) {
62322
62934
  this.writeTableCellText(xmlCell, cell.text);
62323
62935
  }
62936
+ if (styleChanged) {
62937
+ clearCellFormattingForStyleChange(xmlCell, cell.style);
62938
+ }
62324
62939
  if (cell.style) {
62325
62940
  this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
62326
62941
  }
@@ -72618,6 +73233,10 @@ var PptxHandlerRuntime60 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
72618
73233
  const pathLst = custGeom["a:pathLst"];
72619
73234
  if (isNonEmpty(pathLst)) {
72620
73235
  result.pathLstXml = pathLst;
73236
+ const pathCommandOrder = readPathListCommandOrder(pathLst);
73237
+ if (pathCommandOrder) {
73238
+ result.pathCommandOrder = pathCommandOrder;
73239
+ }
72621
73240
  }
72622
73241
  return Object.keys(result).length > 0 ? result : void 0;
72623
73242
  }
@@ -73491,7 +74110,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
73491
74110
  return void 0;
73492
74111
  }
73493
74112
  const locks = {};
73494
- let hasAny = false;
74113
+ let hasAny2 = false;
73495
74114
  const boolAttr2 = (attr5) => {
73496
74115
  const raw = spLocks[attr5];
73497
74116
  if (raw === void 0) {
@@ -73504,7 +74123,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
73504
74123
  const val = boolAttr2(attr5);
73505
74124
  if (val !== void 0) {
73506
74125
  fn(val);
73507
- hasAny = true;
74126
+ hasAny2 = true;
73508
74127
  }
73509
74128
  };
73510
74129
  set("@_noGrp", (v) => {
@@ -73543,7 +74162,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
73543
74162
  set("@_noCrop", (v) => {
73544
74163
  locks.noCrop = v;
73545
74164
  });
73546
- return hasAny ? locks : void 0;
74165
+ return hasAny2 ? locks : void 0;
73547
74166
  }
73548
74167
  /**
73549
74168
  * Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
@@ -73824,6 +74443,36 @@ var PptxHandlerRuntime65 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
73824
74443
  )
73825
74444
  );
73826
74445
  const pPr = this.mergeXmlObjects(lstStyleParagraphDefaults, directPPr);
74446
+ if (!textStyle.inheritedParagraphSpacing) {
74447
+ textStyle.inheritedParagraphSpacing = {};
74448
+ for (let spacingLevel = 0; spacingLevel < 9; spacingLevel++) {
74449
+ const key2 = `a:lvl${spacingLevel + 1}pPr`;
74450
+ const defaults = this.mergeXmlObjects(
74451
+ this.mergeXmlObjects(
74452
+ inheritedLstStyle?.["a:defPPr"],
74453
+ inheritedLstStyle?.[key2]
74454
+ ),
74455
+ this.mergeXmlObjects(
74456
+ ownLstStyle?.["a:defPPr"],
74457
+ ownLstStyle?.[key2]
74458
+ )
74459
+ );
74460
+ const inherited = this.mergeXmlObjects(
74461
+ defaults,
74462
+ inheritedParagraph?.["a:pPr"]
74463
+ );
74464
+ const spacing = this.extractParagraphOwnProperties({ "a:pPr": inherited }, textStyle.fontSize) ?? {};
74465
+ const phLevel = ctx.effectiveLevelStyles?.[spacingLevel];
74466
+ const phBase = ctx.effectiveLevelStyles?.[-1];
74467
+ if (phLevel) this.applyPlaceholderLevelDefaults(spacing, phLevel);
74468
+ if (phBase) this.applyPlaceholderLevelDefaults(spacing, phBase);
74469
+ textStyle.inheritedParagraphSpacing[spacingLevel] = {
74470
+ paragraphSpacingBefore: spacing.paragraphSpacingBefore ?? 0,
74471
+ paragraphSpacingAfter: spacing.paragraphSpacingAfter ?? 0,
74472
+ ...spacing.lineSpacingExactPt !== void 0 ? { lineSpacingExactPt: spacing.lineSpacingExactPt } : { lineSpacing: spacing.lineSpacing ?? 1 }
74473
+ };
74474
+ }
74475
+ }
73827
74476
  const paragraphRtl = this.parseOptionalBooleanAttr(pPr?.["@_rtl"]);
73828
74477
  if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
73829
74478
  textStyle.rtl = paragraphRtl;
@@ -81809,6 +82458,8 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
81809
82458
  };
81810
82459
 
81811
82460
  // pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
82461
+ var XSD_INT_MIN = -2147483648;
82462
+ var XSD_INT_MAX = 2147483647;
81812
82463
  var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
81813
82464
  parseEditorAnimations(slideXml3) {
81814
82465
  return this.editorAnimationService.parseEditorAnimations(slideXml3);
@@ -81991,6 +82642,22 @@ var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
81991
82642
  const lexical = String(raw).trim().toLowerCase();
81992
82643
  return lexical !== "0" && lexical !== "false";
81993
82644
  }
82645
+ /**
82646
+ * Extract `p:presentation/@firstSlideNum` (ECMA-376 §19.2.1.26, an
82647
+ * `xsd:int`). `undefined` when absent, not an integer, or outside the
82648
+ * `xsd:int` range (-2147483648 to 2147483647, which also rejects digit
82649
+ * strings too long to parse), so the spec default (`1`) is never forced
82650
+ * onto the typed model.
82651
+ */
82652
+ extractFirstSlideNumber() {
82653
+ const pres = this.presentationData?.["p:presentation"];
82654
+ const lexical = String(pres?.["@_firstSlideNum"] ?? "").trim();
82655
+ if (!/^[+-]?\d+$/.test(lexical)) {
82656
+ return void 0;
82657
+ }
82658
+ const value = Number(lexical);
82659
+ return value >= XSD_INT_MIN && value <= XSD_INT_MAX ? value : void 0;
82660
+ }
81994
82661
  };
81995
82662
 
81996
82663
  // pptx/core/core/runtime/PptxHandlerRuntimeEmbeddedFonts.ts
@@ -82623,7 +83290,7 @@ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
82623
83290
  this.commentAuthorDetails.size > 0 ? Array.from(this.commentAuthorDetails.values()) : void 0
82624
83291
  ).withModernCommentAuthors(
82625
83292
  this.modernCommentAuthors.size > 0 ? Array.from(this.modernCommentAuthors.values()) : void 0
82626
- ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withDefaultTextStyle(defaultTextStyle).build();
83293
+ ).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withFirstSlideNumber(this.extractFirstSlideNumber()).withDefaultTextStyle(defaultTextStyle).build();
82627
83294
  }
82628
83295
  /**
82629
83296
  * Walk the raw XML of every slide to find the highest numeric `@_id`
@@ -86679,7 +87346,10 @@ var PptxHandler = class extends PptxHandlerCore {
86679
87346
  const imported = deserializePptxFromJson(text);
86680
87347
  const blankBytes = await buildBlankPresentationArchive({
86681
87348
  width: imported.widthEmu,
86682
- height: imported.heightEmu
87349
+ height: imported.heightEmu,
87350
+ // Saving writes presentation.xml from the loaded archive, not from
87351
+ // the overlaid model, so the archive must carry the value itself.
87352
+ firstSlideNumber: imported.firstSlideNumber
86683
87353
  });
86684
87354
  const base = await super.load(blankBytes, options);
86685
87355
  return applyImportedPptxData(base, imported);
@@ -86737,4 +87407,4 @@ var PptxHandler = class extends PptxHandlerCore {
86737
87407
  * `<p:extLst>` (optional)
86738
87408
  */
86739
87409
 
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 };
87410
+ export { AFTER_ANIMATION_VALUES, ConnectorXmlFactory, DEFAULT_AFTER_ANIMATION_DIM_COLOR, DEFAULT_ANIMATION_DURATION_MS, DEFAULT_ANIMATION_TRIGGER, 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, animationFor, applyAfterAnimationBehavior, applyAfterAnimationFromEditorList, applyConnectorShapeIds, applySoundToEffectCTn, applySpeedToDuration, 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, getAfterAnimation, getAfterAnimationState, getCapturedPreset, getCapturedTree, hasAnimation, isEncryptedLegacyPpt, isLegacyPpt, isNativeAfterAnimationOnly, mergeNativeAfterAnimationIntoEditorAnimations, mergeNativeSoundIntoEditorAnimations, nextAutoNumber, nextRelationshipId, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseCondition, parseConditionList, parseFilterToken, parseRelationships, parseTimeTargetElement, parseXml, rebuildTableStructureInRawXml, reconcileAnimationTargets, relationshipsPartFor, relativePartTarget, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveEffectTiming, resolveIterationCount, resolveOoxmlPresetMapping, resolveOpacitySet, resolvePartPath, resolveVisibilitySetTiming, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setAfterAnimation, setAfterAnimationColor, setChartAreaFormat, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, shouldHoldEndState, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, upsert, validateSeriesIndex };