pptx-react-viewer 4.0.0 → 4.1.1

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 (192) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/{AiChatPanel-WMVQFNDC.js → AiChatPanel-N2FVAQRP.js} +25 -25
  3. package/dist/AiChatPanel-N2FVAQRP.js.br +0 -0
  4. package/dist/AiChatPanel-N2FVAQRP.js.gz +0 -0
  5. package/dist/{AiChatPanel-MHURGN6G.mjs → AiChatPanel-VINTTAOW.mjs} +4 -4
  6. package/dist/AiChatPanel-VINTTAOW.mjs.br +0 -0
  7. package/dist/AiChatPanel-VINTTAOW.mjs.gz +0 -0
  8. package/dist/{Area3DChartScene-IMGZEZNU.js → Area3DChartScene-TI3GRA4Y.js} +2 -2
  9. package/dist/Area3DChartScene-TI3GRA4Y.js.br +0 -0
  10. package/dist/Area3DChartScene-TI3GRA4Y.js.gz +0 -0
  11. package/dist/{Area3DChartScene-LKOWSMAU.mjs → Area3DChartScene-WNEHMOG2.mjs} +1 -1
  12. package/dist/Area3DChartScene-WNEHMOG2.mjs.br +0 -0
  13. package/dist/Area3DChartScene-WNEHMOG2.mjs.gz +0 -0
  14. package/dist/{Bar3DChartScene-VLSYVFRT.js → Bar3DChartScene-CRN5WPCZ.js} +2 -2
  15. package/dist/Bar3DChartScene-CRN5WPCZ.js.br +0 -0
  16. package/dist/Bar3DChartScene-CRN5WPCZ.js.gz +0 -0
  17. package/dist/{Bar3DChartScene-NQNSIMUL.mjs → Bar3DChartScene-E53RZRI4.mjs} +1 -1
  18. package/dist/Bar3DChartScene-E53RZRI4.mjs.br +0 -0
  19. package/dist/Bar3DChartScene-E53RZRI4.mjs.gz +0 -0
  20. package/dist/{Line3DChartScene-IWZHA563.js → Line3DChartScene-DGPE4GDN.js} +2 -2
  21. package/dist/Line3DChartScene-DGPE4GDN.js.br +0 -0
  22. package/dist/Line3DChartScene-DGPE4GDN.js.gz +0 -0
  23. package/dist/{Line3DChartScene-ANZBJYQI.mjs → Line3DChartScene-YJ2POVES.mjs} +1 -1
  24. package/dist/Line3DChartScene-YJ2POVES.mjs.br +0 -0
  25. package/dist/Line3DChartScene-YJ2POVES.mjs.gz +0 -0
  26. package/dist/{Model3DScene-Y34HTZXK.mjs → Model3DScene-MYODSOVU.mjs} +1 -1
  27. package/dist/Model3DScene-MYODSOVU.mjs.br +0 -0
  28. package/dist/Model3DScene-MYODSOVU.mjs.gz +0 -0
  29. package/dist/{Model3DScene-2L3YRAMR.js → Model3DScene-O4IOWE5S.js} +2 -2
  30. package/dist/Model3DScene-O4IOWE5S.js.br +0 -0
  31. package/dist/Model3DScene-O4IOWE5S.js.gz +0 -0
  32. package/dist/{PieChart3DScene-NE3GN5VG.js → PieChart3DScene-4S4MZENR.js} +2 -2
  33. package/dist/PieChart3DScene-4S4MZENR.js.br +0 -0
  34. package/dist/PieChart3DScene-4S4MZENR.js.gz +0 -0
  35. package/dist/{PieChart3DScene-FBRPLHLG.mjs → PieChart3DScene-YYBYC5AM.mjs} +1 -1
  36. package/dist/PieChart3DScene-YYBYC5AM.mjs.br +0 -0
  37. package/dist/PieChart3DScene-YYBYC5AM.mjs.gz +0 -0
  38. package/dist/{SmartArt3DScene-QZGIABOK.mjs → SmartArt3DScene-D4VNNPHS.mjs} +124 -19
  39. package/dist/SmartArt3DScene-D4VNNPHS.mjs.br +0 -0
  40. package/dist/SmartArt3DScene-D4VNNPHS.mjs.gz +0 -0
  41. package/dist/{SmartArt3DScene-T236GYUT.js → SmartArt3DScene-NHD7CZJ5.js} +123 -18
  42. package/dist/SmartArt3DScene-NHD7CZJ5.js.br +0 -0
  43. package/dist/SmartArt3DScene-NHD7CZJ5.js.gz +0 -0
  44. package/dist/{SurfaceChart3DScene-7HE5DA3X.mjs → SurfaceChart3DScene-FFYG6CNE.mjs} +1 -1
  45. package/dist/SurfaceChart3DScene-FFYG6CNE.mjs.br +0 -0
  46. package/dist/SurfaceChart3DScene-FFYG6CNE.mjs.gz +0 -0
  47. package/dist/{SurfaceChart3DScene-OSMAVZJC.js → SurfaceChart3DScene-RNBXINNV.js} +2 -2
  48. package/dist/SurfaceChart3DScene-RNBXINNV.js.br +0 -0
  49. package/dist/SurfaceChart3DScene-RNBXINNV.js.gz +0 -0
  50. package/dist/{chunk-I5F3XLVR.js → chunk-3LIWTQSG.js} +1961 -2161
  51. package/dist/chunk-3LIWTQSG.js.br +0 -0
  52. package/dist/chunk-3LIWTQSG.js.gz +0 -0
  53. package/dist/{chunk-L6I73WMO.js → chunk-45JD3XEM.js} +2164 -1646
  54. package/dist/chunk-45JD3XEM.js.br +0 -0
  55. package/dist/chunk-45JD3XEM.js.gz +0 -0
  56. package/dist/{chunk-33YE6E2O.mjs → chunk-7X6UCEYM.mjs} +2225 -582
  57. package/dist/chunk-7X6UCEYM.mjs.br +0 -0
  58. package/dist/chunk-7X6UCEYM.mjs.gz +0 -0
  59. package/dist/{chunk-IWHZ2DUD.mjs → chunk-FOXGVZ4A.mjs} +647 -135
  60. package/dist/chunk-FOXGVZ4A.mjs.br +0 -0
  61. package/dist/chunk-FOXGVZ4A.mjs.gz +0 -0
  62. package/dist/{chunk-GITM3RKP.mjs → chunk-ILVWZ7TN.mjs} +2 -2
  63. package/dist/chunk-ILVWZ7TN.mjs.br +0 -0
  64. package/dist/chunk-ILVWZ7TN.mjs.gz +0 -0
  65. package/dist/{chunk-LAAXFMRE.js → chunk-JLQWPRIM.js} +2231 -581
  66. package/dist/chunk-JLQWPRIM.js.br +0 -0
  67. package/dist/chunk-JLQWPRIM.js.gz +0 -0
  68. package/dist/{chunk-ZOB6ITIM.js → chunk-MVLYI7C2.js} +5 -5
  69. package/dist/chunk-MVLYI7C2.js.br +0 -0
  70. package/dist/chunk-MVLYI7C2.js.gz +0 -0
  71. package/dist/{chunk-NKACTGK5.js → chunk-NKXILGP5.js} +182 -182
  72. package/dist/chunk-NKXILGP5.js.br +0 -0
  73. package/dist/chunk-NKXILGP5.js.gz +0 -0
  74. package/dist/{chunk-M24DEOP6.js → chunk-NXGUR2DO.js} +2 -0
  75. package/dist/chunk-NXGUR2DO.js.br +0 -0
  76. package/dist/chunk-NXGUR2DO.js.gz +0 -0
  77. package/dist/{chunk-R664EPDC.mjs → chunk-PC7H3C5W.mjs} +2 -0
  78. package/dist/chunk-PC7H3C5W.mjs.br +0 -0
  79. package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
  80. package/dist/{chunk-5F426BCZ.mjs → chunk-Q7MONAI4.mjs} +1 -1
  81. package/dist/chunk-Q7MONAI4.mjs.br +0 -0
  82. package/dist/chunk-Q7MONAI4.mjs.gz +0 -0
  83. package/dist/{chunk-H7J4EYXS.mjs → chunk-VC4GPWZS.mjs} +131 -329
  84. package/dist/chunk-VC4GPWZS.mjs.br +0 -0
  85. package/dist/chunk-VC4GPWZS.mjs.gz +0 -0
  86. package/dist/i18n/de.cjs +2 -0
  87. package/dist/i18n/de.cjs.br +0 -0
  88. package/dist/i18n/de.cjs.gz +0 -0
  89. package/dist/i18n/de.mjs +2 -0
  90. package/dist/i18n/de.mjs.br +0 -0
  91. package/dist/i18n/de.mjs.gz +0 -0
  92. package/dist/i18n/es.cjs +2 -0
  93. package/dist/i18n/es.cjs.br +0 -0
  94. package/dist/i18n/es.cjs.gz +0 -0
  95. package/dist/i18n/es.mjs +2 -0
  96. package/dist/i18n/es.mjs.br +0 -0
  97. package/dist/i18n/es.mjs.gz +0 -0
  98. package/dist/i18n/fr.cjs +2 -0
  99. package/dist/i18n/fr.cjs.br +0 -0
  100. package/dist/i18n/fr.cjs.gz +0 -0
  101. package/dist/i18n/fr.mjs +2 -0
  102. package/dist/i18n/fr.mjs.br +0 -0
  103. package/dist/i18n/fr.mjs.gz +0 -0
  104. package/dist/i18n/zh-CN.cjs +2 -0
  105. package/dist/i18n/zh-CN.cjs.br +0 -0
  106. package/dist/i18n/zh-CN.cjs.gz +0 -0
  107. package/dist/i18n/zh-CN.mjs +2 -0
  108. package/dist/i18n/zh-CN.mjs.br +0 -0
  109. package/dist/i18n/zh-CN.mjs.gz +0 -0
  110. package/dist/i18n.js +4 -4
  111. package/dist/i18n.js.br +0 -0
  112. package/dist/i18n.js.gz +0 -0
  113. package/dist/i18n.mjs +1 -1
  114. package/dist/i18n.mjs.br +0 -0
  115. package/dist/i18n.mjs.gz +0 -0
  116. package/dist/index.d.ts +586 -7
  117. package/dist/index.js +52 -48
  118. package/dist/index.js.br +0 -0
  119. package/dist/index.js.gz +0 -0
  120. package/dist/index.mjs +6 -6
  121. package/dist/index.mjs.br +0 -0
  122. package/dist/index.mjs.gz +0 -0
  123. package/dist/internals.d.ts +447 -13
  124. package/dist/internals.js +105 -105
  125. package/dist/internals.js.br +0 -0
  126. package/dist/internals.js.gz +0 -0
  127. package/dist/internals.mjs +4 -4
  128. package/dist/internals.mjs.br +0 -0
  129. package/dist/internals.mjs.gz +0 -0
  130. package/dist/viewer/index.js +32 -32
  131. package/dist/viewer/index.js.br +0 -0
  132. package/dist/viewer/index.js.gz +0 -0
  133. package/dist/viewer/index.mjs +6 -6
  134. package/dist/viewer/index.mjs.br +0 -0
  135. package/dist/viewer/index.mjs.gz +0 -0
  136. package/package.json +2 -2
  137. package/dist/AiChatPanel-MHURGN6G.mjs.br +0 -0
  138. package/dist/AiChatPanel-MHURGN6G.mjs.gz +0 -0
  139. package/dist/AiChatPanel-WMVQFNDC.js.br +0 -0
  140. package/dist/AiChatPanel-WMVQFNDC.js.gz +0 -0
  141. package/dist/Area3DChartScene-IMGZEZNU.js.br +0 -0
  142. package/dist/Area3DChartScene-IMGZEZNU.js.gz +0 -0
  143. package/dist/Area3DChartScene-LKOWSMAU.mjs.br +0 -0
  144. package/dist/Area3DChartScene-LKOWSMAU.mjs.gz +0 -0
  145. package/dist/Bar3DChartScene-NQNSIMUL.mjs.br +0 -0
  146. package/dist/Bar3DChartScene-NQNSIMUL.mjs.gz +0 -0
  147. package/dist/Bar3DChartScene-VLSYVFRT.js.br +0 -0
  148. package/dist/Bar3DChartScene-VLSYVFRT.js.gz +0 -0
  149. package/dist/Line3DChartScene-ANZBJYQI.mjs.br +0 -0
  150. package/dist/Line3DChartScene-ANZBJYQI.mjs.gz +0 -0
  151. package/dist/Line3DChartScene-IWZHA563.js.br +0 -0
  152. package/dist/Line3DChartScene-IWZHA563.js.gz +0 -0
  153. package/dist/Model3DScene-2L3YRAMR.js.br +0 -0
  154. package/dist/Model3DScene-2L3YRAMR.js.gz +0 -0
  155. package/dist/Model3DScene-Y34HTZXK.mjs.br +0 -0
  156. package/dist/Model3DScene-Y34HTZXK.mjs.gz +0 -0
  157. package/dist/PieChart3DScene-FBRPLHLG.mjs.br +0 -0
  158. package/dist/PieChart3DScene-FBRPLHLG.mjs.gz +0 -0
  159. package/dist/PieChart3DScene-NE3GN5VG.js.br +0 -0
  160. package/dist/PieChart3DScene-NE3GN5VG.js.gz +0 -0
  161. package/dist/SmartArt3DScene-QZGIABOK.mjs.br +0 -0
  162. package/dist/SmartArt3DScene-QZGIABOK.mjs.gz +0 -0
  163. package/dist/SmartArt3DScene-T236GYUT.js.br +0 -0
  164. package/dist/SmartArt3DScene-T236GYUT.js.gz +0 -0
  165. package/dist/SurfaceChart3DScene-7HE5DA3X.mjs.br +0 -0
  166. package/dist/SurfaceChart3DScene-7HE5DA3X.mjs.gz +0 -0
  167. package/dist/SurfaceChart3DScene-OSMAVZJC.js.br +0 -0
  168. package/dist/SurfaceChart3DScene-OSMAVZJC.js.gz +0 -0
  169. package/dist/chunk-33YE6E2O.mjs.br +0 -0
  170. package/dist/chunk-33YE6E2O.mjs.gz +0 -0
  171. package/dist/chunk-5F426BCZ.mjs.br +0 -0
  172. package/dist/chunk-5F426BCZ.mjs.gz +0 -0
  173. package/dist/chunk-GITM3RKP.mjs.br +0 -0
  174. package/dist/chunk-GITM3RKP.mjs.gz +0 -0
  175. package/dist/chunk-H7J4EYXS.mjs.br +0 -0
  176. package/dist/chunk-H7J4EYXS.mjs.gz +0 -0
  177. package/dist/chunk-I5F3XLVR.js.br +0 -0
  178. package/dist/chunk-I5F3XLVR.js.gz +0 -0
  179. package/dist/chunk-IWHZ2DUD.mjs.br +0 -0
  180. package/dist/chunk-IWHZ2DUD.mjs.gz +0 -0
  181. package/dist/chunk-L6I73WMO.js.br +0 -0
  182. package/dist/chunk-L6I73WMO.js.gz +0 -0
  183. package/dist/chunk-LAAXFMRE.js.br +0 -0
  184. package/dist/chunk-LAAXFMRE.js.gz +0 -0
  185. package/dist/chunk-M24DEOP6.js.br +0 -0
  186. package/dist/chunk-M24DEOP6.js.gz +0 -0
  187. package/dist/chunk-NKACTGK5.js.br +0 -0
  188. package/dist/chunk-NKACTGK5.js.gz +0 -0
  189. package/dist/chunk-R664EPDC.mjs.br +0 -0
  190. package/dist/chunk-R664EPDC.mjs.gz +0 -0
  191. package/dist/chunk-ZOB6ITIM.js.br +0 -0
  192. package/dist/chunk-ZOB6ITIM.js.gz +0 -0
@@ -1,10 +1,10 @@
1
- import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, DEFAULT_FILL_COLOR, getCropShapeClipPath, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getImageSurfaceMaskStyle, getImageTilingStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, MIN_ELEMENT_SIZE, buildTextBody3DSceneStyle, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, HYPERLINK_COLOR, cloneHistorySnapshot, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromTiledImageData, buildNotesPdf, GRID_SIZE } from './chunk-GITM3RKP.mjs';
2
- import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, getSelectionControlArtworkStyle, hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getSelectionOutlineColor, connectorWrapperTransform, getAriaRoleDescription, getAriaLabel, getAriaRole, resolveElementInteractivity, isEditableTextElement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, shouldRenderHitTarget, elementHitTargetStyle, getImageEffectsOpacity, getImageEffectsFilter, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, getGroupChildParentFill, getElementLabel, getResizeHandleHitAreaStyle, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, getElementTransform, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, isImageLikeElement, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, isImageTiled, getImageColorWashStyle, readEditableText, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, resolveChartKind, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, attachRotateHandlePlacement, elementIdSelector, createRotationDrag, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, DEFAULT_PALETTE2, resolvePalette, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, findChartPartTarget, buildSurfaceChart3DDataForElement, buildBarChart3DDataForElement, buildLineChart3DDataForElement, buildAreaChart3DDataForElement, buildPieChart3DDataForElement, withChartTitle, buildSmartArt3DModel, collectCoherent3DOffNodeIds, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, hasGlyphEnvelope, buildGlyphEnvelope, getWarpPath, isWedgeCalloutPresetShape, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, groupIntoParagraphs, substituteFieldText, computeInlineEditorRect, withChartPointValue, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, partitionTemplateElements, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canInteractWithElement, prepareExportClone, normalizeColorsForCapture, preprocessCssForCapture, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, resolveImageResolutionScale, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, stopAllPersistentAudio, guidePxToEmu, buildSaveSlides, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, mapSlideShowStartKey, mapEditorKey, isEditorTextInputTarget, prepareElementForInsertion, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, openPptxFile, readBackstageRecentFile, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, savedPresentationFileName, downloadBlob, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, resolveViewportFitOptions, calculateViewportFit, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, remapTextToSegments, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterResultToPngBlob, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, canvasToJpegData, rasterizeElementTiledToCanvas, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterizeElement, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-33YE6E2O.mjs';
3
- import { translationsEn } from './chunk-R664EPDC.mjs';
4
- import React18, { createContext, useMemo, useState, useCallback, useEffect, Suspense, useRef, useLayoutEffect, useContext, useSyncExternalStore, useImperativeHandle } from 'react';
1
+ import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, DEFAULT_FILL_COLOR, getCropShapeClipPath, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getImageSurfaceMaskStyle, getImageTilingStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, MIN_ELEMENT_SIZE, buildTextBody3DSceneStyle, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, HYPERLINK_COLOR, cloneHistorySnapshot, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromTiledImageData, GRID_SIZE, buildNotesPdf } from './chunk-ILVWZ7TN.mjs';
2
+ import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, getSelectionControlArtworkStyle, hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getSelectionOutlineColor, connectorWrapperTransform, getAriaRoleDescription, getAriaLabel, getAriaRole, resolveElementInteractivity, isEditableTextElement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, shouldRenderHitTarget, elementHitTargetStyle, getImageEffectsOpacity, getImageEffectsFilter, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, getGroupChildParentFill, getElementLabel, getResizeHandleHitAreaStyle, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, getElementTransform, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, isImageLikeElement, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, isImageTiled, getImageColorWashStyle, readEditableText, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, resolveChartKind, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, attachRotateHandlePlacement, elementIdSelector, createRotationDrag, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, DEFAULT_PALETTE2, resolvePalette, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, findChartPartTarget, buildSurfaceChart3DDataForElement, buildBarChart3DDataForElement, buildLineChart3DDataForElement, buildAreaChart3DDataForElement, buildPieChart3DDataForElement, withChartTitle, resolveSmartArt3DLayout, buildSmartArt3DModel, collectCoherent3DOffNodeIds, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, hasGlyphEnvelope, buildGlyphEnvelope, getWarpPath, isWedgeCalloutPresetShape, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, groupIntoParagraphs, substituteFieldText, computeInlineEditorRect, withChartPointValue, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, partitionTemplateElements, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canInteractWithElement, prepareExportClone, normalizeColorsForCapture, preprocessCssForCapture, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, resolveImageResolutionScale, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, stopAllPersistentAudio, guidePxToEmu, buildSaveSlides, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, mapSlideShowStartKey, mapEditorKey, isEditorTextInputTarget, prepareElementForInsertion, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, savedPresentationFileName, downloadBlob, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, resolveViewportFitOptions, calculateViewportFit, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, remapTextToSegments, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterResultToPngBlob, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, canvasToJpegData, createSnapshotTextPositions, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterizeElement, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-7X6UCEYM.mjs';
3
+ import { translationsEn } from './chunk-PC7H3C5W.mjs';
4
+ import React20, { createContext, useMemo, useState, useCallback, useEffect, Suspense, useRef, useLayoutEffect, useContext, useSyncExternalStore, useImperativeHandle } from 'react';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
6
  import { useTranslation } from 'react-i18next';
6
7
  import { flushSync } from 'react-dom';
7
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
8
  import { LuRotateCw } from 'react-icons/lu';
9
9
 
10
10
  function useVirtualizedSlides({
@@ -507,19 +507,104 @@ function useCollaborativeState({
507
507
  canvasHeight
508
508
  });
509
509
  const connectedCount = status === "connected" ? remoteUsers.length + 1 : remoteUsers.length;
510
- if (!config) {
510
+ return useMemo(
511
+ () => config ? { status, remoteUsers, broadcastPresence, connectedCount, config, doc, synced, retry } : null,
512
+ [status, remoteUsers, broadcastPresence, connectedCount, config, doc, synced, retry]
513
+ );
514
+ }
515
+ var CollaborationContext = createContext(null);
516
+ function useCollaboration() {
517
+ return useContext(CollaborationContext);
518
+ }
519
+ function CollaborationProvider({
520
+ config,
521
+ canvasWidth,
522
+ canvasHeight,
523
+ children
524
+ }) {
525
+ const value = useCollaborativeState({
526
+ config,
527
+ canvasWidth,
528
+ canvasHeight
529
+ });
530
+ return /* @__PURE__ */ jsx(CollaborationContext.Provider, { value, children });
531
+ }
532
+ function RemoteUserCursors({
533
+ remoteUsers,
534
+ activeSlideIndex,
535
+ canvasWidth,
536
+ canvasHeight
537
+ }) {
538
+ const visibleUsers = remoteUsers.filter((u) => u.activeSlideIndex === activeSlideIndex);
539
+ if (visibleUsers.length === 0) {
511
540
  return null;
512
541
  }
513
- return {
514
- status,
515
- remoteUsers,
516
- broadcastPresence,
517
- connectedCount,
518
- config,
519
- doc,
520
- synced,
521
- retry
522
- };
542
+ return /* @__PURE__ */ jsx(
543
+ "svg",
544
+ {
545
+ "data-testid": "remote-user-cursors",
546
+ "data-export-ignore": "true",
547
+ className: "absolute inset-0 pointer-events-none",
548
+ style: { zIndex: 9999 },
549
+ width: canvasWidth,
550
+ height: canvasHeight,
551
+ viewBox: `0 0 ${canvasWidth} ${canvasHeight}`,
552
+ "aria-hidden": "true",
553
+ children: visibleUsers.map((user) => /* @__PURE__ */ jsxs(
554
+ "g",
555
+ {
556
+ style: {
557
+ transform: `translate(${user.cursorX}px, ${user.cursorY}px)`,
558
+ transition: "transform 90ms linear",
559
+ willChange: "transform"
560
+ },
561
+ "data-testid": `remote-cursor-${user.clientId}`,
562
+ "data-pptx-remote-cursor": user.clientId,
563
+ children: [
564
+ /* @__PURE__ */ jsx(
565
+ "path",
566
+ {
567
+ d: "M0 0 L0 16 L4.5 12.5 L8 20 L10.5 19 L7 11.5 L12 11 Z",
568
+ fill: user.userColor,
569
+ stroke: "#fff",
570
+ strokeWidth: 1,
571
+ opacity: 0.9
572
+ }
573
+ ),
574
+ /* @__PURE__ */ jsxs("g", { transform: "translate(14, 18)", children: [
575
+ /* @__PURE__ */ jsx(
576
+ "rect",
577
+ {
578
+ rx: 3,
579
+ ry: 3,
580
+ x: -2,
581
+ y: -10,
582
+ width: Math.min(user.userName.length * 7 + 8, 150),
583
+ height: 16,
584
+ fill: user.userColor,
585
+ opacity: 0.85
586
+ }
587
+ ),
588
+ /* @__PURE__ */ jsx(
589
+ "text",
590
+ {
591
+ fill: "#fff",
592
+ fontSize: 10,
593
+ fontFamily: "system-ui, sans-serif",
594
+ fontWeight: 500,
595
+ dominantBaseline: "central",
596
+ y: -2,
597
+ x: 2,
598
+ children: user.userName.length > 20 ? `${user.userName.slice(0, 18)}...` : user.userName
599
+ }
600
+ )
601
+ ] })
602
+ ]
603
+ },
604
+ user.clientId
605
+ ))
606
+ }
607
+ );
523
608
  }
524
609
  function useSheetDismissDrag(onClose, threshold = 120) {
525
610
  const [dragY, setDragY] = useState(0);
@@ -560,12 +645,31 @@ function useSheetDismissDrag(onClose, threshold = 120) {
560
645
  }
561
646
 
562
647
  // src/viewer/hooks/explicit-slide-history.ts
648
+ function historyElementContent(element) {
649
+ return {
650
+ ...element,
651
+ // Saving refreshes these archive-only fields in place. They are needed by
652
+ // serialization, but neither one represents a user edit.
653
+ rawXml: void 0,
654
+ shapeId: void 0,
655
+ ...element.type === "group" ? { children: element.children.map(historyElementContent) } : {}
656
+ };
657
+ }
563
658
  function serializeHistoryDocument(snapshot) {
564
659
  return JSON.stringify({
565
660
  width: snapshot.width,
566
661
  height: snapshot.height,
567
- slides: snapshot.slides,
568
- templateElementsBySlideId: snapshot.templateElementsBySlideId
662
+ slides: snapshot.slides.map((slide) => ({
663
+ ...slide,
664
+ rawXml: void 0,
665
+ elements: slide.elements.map(historyElementContent)
666
+ })),
667
+ templateElementsBySlideId: Object.fromEntries(
668
+ Object.entries(snapshot.templateElementsBySlideId).map(([slideId, elements]) => [
669
+ slideId,
670
+ elements.map(historyElementContent)
671
+ ])
672
+ )
569
673
  });
570
674
  }
571
675
  function recordExplicitSlideUpdate(past, future, previous, before, label, maxDepth) {
@@ -806,19 +910,19 @@ function useEditorHistory(input) {
806
910
  }
807
911
  const previousSnapshot = lastHistorySnapshotRef.current;
808
912
  if (!previousSnapshot) {
809
- lastHistorySnapshotRef.current = cloneHistorySnapshot(snapshot);
913
+ lastHistorySnapshotRef.current = snapshot;
810
914
  lastHistorySerializedRef.current = serialized;
811
915
  lastCheapHashRef.current = cheapHash;
812
916
  updateHistoryAvailability();
813
917
  return;
814
918
  }
815
919
  onDirtyRef.current?.();
816
- historyPastRef.current.push(cloneHistorySnapshot(previousSnapshot));
920
+ historyPastRef.current.push(previousSnapshot);
817
921
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
818
922
  historyPastRef.current.shift();
819
923
  }
820
924
  historyFutureRef.current = [];
821
- lastHistorySnapshotRef.current = cloneHistorySnapshot(snapshot);
925
+ lastHistorySnapshotRef.current = snapshot;
822
926
  lastHistorySerializedRef.current = serialized;
823
927
  lastCheapHashRef.current = cheapHash;
824
928
  updateHistoryAvailability();
@@ -3837,6 +3941,17 @@ function useInlineEditingState(onTextChange) {
3837
3941
  const inlineEditingElementIdRef = useRef(null);
3838
3942
  const inlineEditingTextRef = useRef("");
3839
3943
  const inlineEditingSnapshotRef = useRef(void 0);
3944
+ const inlineEditingReaderRef = useRef(void 0);
3945
+ const registerInlineEditReader = useCallback(
3946
+ (elementId, read) => {
3947
+ const entry = { elementId, read };
3948
+ inlineEditingReaderRef.current = entry;
3949
+ return () => {
3950
+ if (inlineEditingReaderRef.current === entry) inlineEditingReaderRef.current = void 0;
3951
+ };
3952
+ },
3953
+ []
3954
+ );
3840
3955
  const [inlineEditingElementId, setElementId] = useState(null);
3841
3956
  const [inlineEditingText, setText] = useState("");
3842
3957
  const setInlineEditingElementId = useCallback(
@@ -3867,7 +3982,9 @@ function useInlineEditingState(onTextChange) {
3867
3982
  setInlineEditingText,
3868
3983
  inlineEditingElementIdRef,
3869
3984
  inlineEditingTextRef,
3870
- inlineEditingSnapshotRef
3985
+ inlineEditingSnapshotRef,
3986
+ inlineEditingReaderRef,
3987
+ registerInlineEditReader
3871
3988
  };
3872
3989
  }
3873
3990
  function useSlideState() {
@@ -5530,6 +5647,7 @@ function useCanvasInteractions(input) {
5530
5647
  inlineEditingText,
5531
5648
  inlineEditingTextRef,
5532
5649
  inlineEditingSnapshotRef,
5650
+ inlineEditingReaderRef,
5533
5651
  ops,
5534
5652
  history,
5535
5653
  presentationHandleAction,
@@ -5546,12 +5664,15 @@ function useCanvasInteractions(input) {
5546
5664
  }
5547
5665
  const el = elementLookup.get(editId);
5548
5666
  if (el && hasTextProperties(el)) {
5549
- const liveText = inlineEditingTextRef?.current ?? inlineEditingText;
5667
+ const reader = inlineEditingReaderRef?.current;
5668
+ const read = reader?.elementId === editId ? reader.read() : void 0;
5669
+ if (read?.kind === "unsupported") return;
5670
+ const liveText = read?.snapshot.text ?? inlineEditingTextRef?.current ?? inlineEditingText;
5550
5671
  const committedText = transformCommittedText ? transformCommittedText(liveText) : liveText;
5551
5672
  const textPatch = buildInlineTextCommitPatch(
5552
5673
  el,
5553
5674
  committedText,
5554
- inlineEditingSnapshotRef?.current
5675
+ read?.snapshot ?? inlineEditingSnapshotRef?.current
5555
5676
  );
5556
5677
  if (!textPatch) {
5557
5678
  setInlineEditingElementId(null);
@@ -7870,6 +7991,7 @@ function useExportMediaHandlers(input) {
7870
7991
  setExportProgress,
7871
7992
  setExportStatusMessage
7872
7993
  } = input;
7994
+ const slideCount = slides.length;
7873
7995
  const handleExportVideo = useCallback(async () => {
7874
7996
  if (!canvasStageRef.current) {
7875
7997
  return;
@@ -7884,7 +8006,7 @@ function useExportMediaHandlers(input) {
7884
8006
  const { scale } = resolveExportCaptureDecision(imageResolutionScale, "video");
7885
8007
  const blob = await exportAllSlidesAsVideo(
7886
8008
  canvasStageRef,
7887
- slides.length,
8009
+ slideCount,
7888
8010
  setActiveSlideIndex,
7889
8011
  activeSlideIndex,
7890
8012
  {
@@ -7915,7 +8037,7 @@ function useExportMediaHandlers(input) {
7915
8037
  }
7916
8038
  }, [
7917
8039
  canvasStageRef,
7918
- slides.length,
8040
+ slideCount,
7919
8041
  setActiveSlideIndex,
7920
8042
  activeSlideIndex,
7921
8043
  imageResolutionScale,
@@ -7942,7 +8064,7 @@ function useExportMediaHandlers(input) {
7942
8064
  );
7943
8065
  const blob = await exportAllSlidesAsGif(
7944
8066
  canvasStageRef,
7945
- slides.length,
8067
+ slideCount,
7946
8068
  setActiveSlideIndex,
7947
8069
  activeSlideIndex,
7948
8070
  {
@@ -7970,7 +8092,7 @@ function useExportMediaHandlers(input) {
7970
8092
  }
7971
8093
  }, [
7972
8094
  canvasStageRef,
7973
- slides.length,
8095
+ slideCount,
7974
8096
  setActiveSlideIndex,
7975
8097
  activeSlideIndex,
7976
8098
  imageResolutionScale,
@@ -7982,6 +8104,75 @@ function useExportMediaHandlers(input) {
7982
8104
  ]);
7983
8105
  return { handleExportVideo, handleExportGif };
7984
8106
  }
8107
+ function useExportNotesPdf(input) {
8108
+ const {
8109
+ slides,
8110
+ activeSlideIndex,
8111
+ canvasStageRef,
8112
+ setActiveSlideIndex,
8113
+ imageExportScale,
8114
+ exportAbortRef,
8115
+ setExportModalOpen,
8116
+ setExportModalTitle,
8117
+ setExportProgress,
8118
+ setExportStatusMessage
8119
+ } = input;
8120
+ return useCallback(async () => {
8121
+ if (!canvasStageRef.current) {
8122
+ return;
8123
+ }
8124
+ const abortCtrl = new AbortController();
8125
+ exportAbortRef.current = abortCtrl;
8126
+ setExportModalTitle("Export as PDF (Notes)");
8127
+ setExportStatusMessage("Capturing slides...");
8128
+ setExportProgress(0);
8129
+ setExportModalOpen(true);
8130
+ try {
8131
+ const slideNotes = slides.map((s) => s.notes);
8132
+ await exportAllSlidesAsNotesPdf(
8133
+ canvasStageRef,
8134
+ slides.length,
8135
+ setActiveSlideIndex,
8136
+ activeSlideIndex,
8137
+ slideNotes,
8138
+ "presentation-notes.pdf",
8139
+ {
8140
+ scale: imageExportScale,
8141
+ onProgress: (current, total) => {
8142
+ setExportProgress(slideProgressPercent(current, total));
8143
+ setExportStatusMessage(slideStatusLabel("Rendering", current, total));
8144
+ },
8145
+ signal: abortCtrl.signal
8146
+ }
8147
+ );
8148
+ setExportProgress(EXPORT_ASSEMBLING_PERCENT);
8149
+ setExportStatusMessage("Building PDF...");
8150
+ await new Promise((r) => {
8151
+ setTimeout(r, 100);
8152
+ });
8153
+ setExportProgress(EXPORT_DONE_PERCENT);
8154
+ setExportStatusMessage("Done!");
8155
+ } catch (err) {
8156
+ if (!isExportAbortError(err)) {
8157
+ console.error("[PowerPointViewer] Notes PDF export failed:", err);
8158
+ }
8159
+ } finally {
8160
+ exportAbortRef.current = null;
8161
+ setExportModalOpen(false);
8162
+ }
8163
+ }, [
8164
+ canvasStageRef,
8165
+ slides,
8166
+ setActiveSlideIndex,
8167
+ activeSlideIndex,
8168
+ imageExportScale,
8169
+ exportAbortRef,
8170
+ setExportModalOpen,
8171
+ setExportModalTitle,
8172
+ setExportProgress,
8173
+ setExportStatusMessage
8174
+ ]);
8175
+ }
7985
8176
 
7986
8177
  // src/viewer/hooks/useExportHandlers.ts
7987
8178
  function useExportHandlers(input) {
@@ -8010,11 +8201,25 @@ function useExportHandlers(input) {
8010
8201
  imageExportScale,
8011
8202
  imageResolutionScale
8012
8203
  } = input;
8204
+ const slideCount = slides.length;
8205
+ const backgroundColor = activeSlide?.backgroundColor;
8013
8206
  const [exportModalOpen, setExportModalOpen] = useState(false);
8014
8207
  const [exportModalTitle, setExportModalTitle] = useState("");
8015
8208
  const [exportProgress, setExportProgress] = useState(0);
8016
8209
  const [exportStatusMessage, setExportStatusMessage] = useState("");
8017
8210
  const exportAbortRef = useRef(null);
8211
+ const handleExportNotesPdf = useExportNotesPdf({
8212
+ slides,
8213
+ activeSlideIndex,
8214
+ canvasStageRef,
8215
+ setActiveSlideIndex,
8216
+ imageExportScale,
8217
+ exportAbortRef,
8218
+ setExportModalOpen,
8219
+ setExportModalTitle,
8220
+ setExportProgress,
8221
+ setExportStatusMessage
8222
+ });
8018
8223
  const { handleExportVideo, handleExportGif } = useExportMediaHandlers({
8019
8224
  slides,
8020
8225
  activeSlideIndex,
@@ -8060,13 +8265,13 @@ function useExportHandlers(input) {
8060
8265
  }
8061
8266
  try {
8062
8267
  await exportSlideAsPng(stageEl, activeSlideIndex, {
8063
- backgroundColor: activeSlide?.backgroundColor,
8268
+ backgroundColor,
8064
8269
  scale: imageExportScale
8065
8270
  });
8066
8271
  } catch (err) {
8067
8272
  console.error("[PowerPointViewer] PNG export failed:", err);
8068
8273
  }
8069
- }, [canvasStageRef, activeSlideIndex, activeSlide?.backgroundColor, imageExportScale]);
8274
+ }, [canvasStageRef, activeSlideIndex, backgroundColor, imageExportScale]);
8070
8275
  const handleExportPdf = useCallback(async () => {
8071
8276
  if (!canvasStageRef.current) {
8072
8277
  return;
@@ -8080,7 +8285,7 @@ function useExportHandlers(input) {
8080
8285
  try {
8081
8286
  await exportAllSlidesAsPdf(
8082
8287
  canvasStageRef,
8083
- slides.length,
8288
+ slideCount,
8084
8289
  setActiveSlideIndex,
8085
8290
  activeSlideIndex,
8086
8291
  "presentation.pdf",
@@ -8108,51 +8313,7 @@ function useExportHandlers(input) {
8108
8313
  exportAbortRef.current = null;
8109
8314
  setExportModalOpen(false);
8110
8315
  }
8111
- }, [canvasStageRef, slides.length, setActiveSlideIndex, activeSlideIndex, imageExportScale]);
8112
- const handleExportNotesPdf = useCallback(async () => {
8113
- if (!canvasStageRef.current) {
8114
- return;
8115
- }
8116
- const abortCtrl = new AbortController();
8117
- exportAbortRef.current = abortCtrl;
8118
- setExportModalTitle("Export as PDF (Notes)");
8119
- setExportStatusMessage("Capturing slides...");
8120
- setExportProgress(0);
8121
- setExportModalOpen(true);
8122
- try {
8123
- const slideNotes = slides.map((s) => s.notes);
8124
- await exportAllSlidesAsNotesPdf(
8125
- canvasStageRef,
8126
- slides.length,
8127
- setActiveSlideIndex,
8128
- activeSlideIndex,
8129
- slideNotes,
8130
- "presentation-notes.pdf",
8131
- {
8132
- scale: imageExportScale,
8133
- onProgress: (current, total) => {
8134
- setExportProgress(slideProgressPercent(current, total));
8135
- setExportStatusMessage(slideStatusLabel("Rendering", current, total));
8136
- },
8137
- signal: abortCtrl.signal
8138
- }
8139
- );
8140
- setExportProgress(EXPORT_ASSEMBLING_PERCENT);
8141
- setExportStatusMessage("Building PDF...");
8142
- await new Promise((r) => {
8143
- setTimeout(r, 100);
8144
- });
8145
- setExportProgress(EXPORT_DONE_PERCENT);
8146
- setExportStatusMessage("Done!");
8147
- } catch (err) {
8148
- if (!isExportAbortError(err)) {
8149
- console.error("[PowerPointViewer] Notes PDF export failed:", err);
8150
- }
8151
- } finally {
8152
- exportAbortRef.current = null;
8153
- setExportModalOpen(false);
8154
- }
8155
- }, [canvasStageRef, slides, setActiveSlideIndex, activeSlideIndex, imageExportScale]);
8316
+ }, [canvasStageRef, slideCount, setActiveSlideIndex, activeSlideIndex, imageExportScale]);
8156
8317
  const handleCopySlideAsImage = useCallback(async () => {
8157
8318
  const stageEl = canvasStageRef.current;
8158
8319
  if (!stageEl) {
@@ -8160,13 +8321,13 @@ function useExportHandlers(input) {
8160
8321
  }
8161
8322
  try {
8162
8323
  await copySlideToClipboard(stageEl, {
8163
- backgroundColor: activeSlide?.backgroundColor,
8324
+ backgroundColor,
8164
8325
  scale: imageExportScale
8165
8326
  });
8166
8327
  } catch (err) {
8167
8328
  console.error("[PowerPointViewer] Copy slide as image failed:", err);
8168
8329
  }
8169
- }, [canvasStageRef, activeSlide?.backgroundColor, imageExportScale]);
8330
+ }, [canvasStageRef, backgroundColor, imageExportScale]);
8170
8331
  const handleCancelExport = useCallback(() => {
8171
8332
  exportAbortRef.current?.abort();
8172
8333
  exportAbortRef.current = null;
@@ -9289,6 +9450,7 @@ function useSerialize(input) {
9289
9450
  inlineEditingElementIdRef,
9290
9451
  inlineEditingTextRef,
9291
9452
  inlineEditingSnapshotRef,
9453
+ inlineEditingReaderRef,
9292
9454
  transformCommittedText,
9293
9455
  password,
9294
9456
  embedFonts = true,
@@ -9301,8 +9463,11 @@ function useSerialize(input) {
9301
9463
  return null;
9302
9464
  }
9303
9465
  const pendingEditId = inlineEditingElementIdRef.current;
9304
- const pendingEditText = inlineEditingTextRef.current;
9305
- const pendingSnapshot = inlineEditingSnapshotRef?.current;
9466
+ const reader = inlineEditingReaderRef?.current;
9467
+ const read = reader?.elementId === pendingEditId ? reader.read() : void 0;
9468
+ if (read?.kind === "unsupported") return null;
9469
+ const pendingEditText = read?.snapshot.text ?? inlineEditingTextRef.current;
9470
+ const pendingSnapshot = read?.snapshot ?? inlineEditingSnapshotRef?.current;
9306
9471
  const pending = overlayPendingInlineEdit(
9307
9472
  {
9308
9473
  slides,
@@ -9387,6 +9552,7 @@ function useSerialize(input) {
9387
9552
  inlineEditingElementIdRef,
9388
9553
  inlineEditingTextRef,
9389
9554
  inlineEditingSnapshotRef,
9555
+ inlineEditingReaderRef,
9390
9556
  transformCommittedText,
9391
9557
  password,
9392
9558
  embedFonts,
@@ -9730,6 +9896,7 @@ function useEditorOperations(input) {
9730
9896
  inlineEditingSnapshotRef: state.inlineEditingSnapshotRef,
9731
9897
  ops,
9732
9898
  inlineEditingTextRef: state.inlineEditingTextRef,
9899
+ inlineEditingReaderRef: state.inlineEditingReaderRef,
9733
9900
  history,
9734
9901
  presentationHandleAction: presentation.handlePresentationAction,
9735
9902
  setEditingEquationOmml: dialogs.setEditingEquationOmml,
@@ -10223,6 +10390,7 @@ function useContentLifecycle(input) {
10223
10390
  inlineEditingElementIdRef: state.inlineEditingElementIdRef,
10224
10391
  inlineEditingTextRef: state.inlineEditingTextRef,
10225
10392
  inlineEditingSnapshotRef: state.inlineEditingSnapshotRef,
10393
+ inlineEditingReaderRef: state.inlineEditingReaderRef,
10226
10394
  transformCommittedText: input.transformCommittedText,
10227
10395
  password,
10228
10396
  embedFonts
@@ -11034,7 +11202,15 @@ function useExternalDocumentSync(input, scheduleWriteBack) {
11034
11202
  const factories = {
11035
11203
  createMap: () => new Y.Map(),
11036
11204
  createArray: () => new Y.Array(),
11037
- createText: () => new Y.Text()
11205
+ createText: () => new Y.Text(),
11206
+ createTextPositions: (text) => createSnapshotTextPositions(text, {
11207
+ read: () => Y.snapshot(doc),
11208
+ equal: Y.equalSnapshots,
11209
+ subscribeBeforeObservers: (listener) => {
11210
+ doc.on("beforeObserverCalls", listener);
11211
+ return () => doc.off("beforeObserverCalls", listener);
11212
+ }
11213
+ })
11038
11214
  };
11039
11215
  publish.current = (nextSlides) => {
11040
11216
  const slides = nextSlides ?? latest.current.slides;
@@ -11285,8 +11461,12 @@ function useCollaborationLivePatch({
11285
11461
  doc,
11286
11462
  isConnected,
11287
11463
  isSynced = true,
11288
- externalSession
11464
+ externalSession,
11465
+ onBeforeDetach
11289
11466
  }) {
11467
+ const latestDetach = useRef(onBeforeDetach);
11468
+ latestDetach.current = onBeforeDetach;
11469
+ const [initialized, setInitialized] = useState(null);
11290
11470
  useEffect(() => {
11291
11471
  if (externalSession) {
11292
11472
  return;
@@ -11309,15 +11489,28 @@ function useCollaborationLivePatch({
11309
11489
  factories = {
11310
11490
  createMap: () => new Y.Map(),
11311
11491
  createArray: () => new Y.Array(),
11312
- createText: () => new Y.Text()
11492
+ createText: () => new Y.Text(),
11493
+ createTextPositions: (text) => createSnapshotTextPositions(text, {
11494
+ read: () => Y.snapshot(doc),
11495
+ equal: Y.equalSnapshots,
11496
+ subscribeBeforeObservers: (listener) => {
11497
+ doc.on("beforeObserverCalls", listener);
11498
+ return () => doc.off("beforeObserverCalls", listener);
11499
+ }
11500
+ })
11313
11501
  };
11314
11502
  configure();
11503
+ setInitialized({ doc, patcher });
11315
11504
  })();
11316
11505
  return () => {
11317
11506
  cancelled = true;
11507
+ if (factories) {
11508
+ latestDetach.current?.(doc);
11509
+ }
11318
11510
  patcher.configure(null, null);
11319
11511
  };
11320
11512
  }, [patcher, doc, isConnected, isSynced, externalSession]);
11513
+ return initialized?.doc === doc && initialized?.patcher === patcher;
11321
11514
  }
11322
11515
  function useLayoutSwitching(input) {
11323
11516
  const { handler, slides, activeSlideIndex, ops, history, onTemplateElementsChanged } = input;
@@ -11653,6 +11846,8 @@ function buildCanvasProps(input) {
11653
11846
  openExternalUrl(url, target);
11654
11847
  };
11655
11848
  return {
11849
+ livePatcher: s.livePatcher,
11850
+ registerInlineEditReader: s.registerInlineEditReader,
11656
11851
  imagePaste: insertHandlers.imagePaste,
11657
11852
  activeSlide: effectiveSlide,
11658
11853
  templateElements: effectiveTemplateElements,
@@ -12062,6 +12257,218 @@ function buildToolbarProps(input) {
12062
12257
  hiddenActions
12063
12258
  };
12064
12259
  }
12260
+ function CollaborationCursorOverlay({
12261
+ collaboration,
12262
+ activeSlideIndex,
12263
+ canvasWidth,
12264
+ canvasHeight,
12265
+ selectedElementId
12266
+ }) {
12267
+ const context = useCollaboration();
12268
+ const collab = collaboration === void 0 ? context : collaboration;
12269
+ const broadcastPresence = collab?.broadcastPresence;
12270
+ const containerRef = useRef(null);
12271
+ useEffect(() => {
12272
+ broadcastPresence?.({
12273
+ selectedElementId: selectedElementId ?? void 0,
12274
+ activeSlideIndex
12275
+ });
12276
+ }, [broadcastPresence, selectedElementId, activeSlideIndex]);
12277
+ useEffect(() => {
12278
+ if (!broadcastPresence) {
12279
+ return;
12280
+ }
12281
+ const parent = containerRef.current?.parentElement;
12282
+ if (!parent) {
12283
+ return;
12284
+ }
12285
+ const handler = (e) => {
12286
+ const rect = parent.getBoundingClientRect();
12287
+ const x = (e.clientX - rect.left) / rect.width * canvasWidth;
12288
+ const y = (e.clientY - rect.top) / rect.height * canvasHeight;
12289
+ broadcastPresence({
12290
+ cursorX: x,
12291
+ cursorY: y,
12292
+ activeSlideIndex
12293
+ });
12294
+ };
12295
+ parent.addEventListener("pointermove", handler);
12296
+ return () => parent.removeEventListener("pointermove", handler);
12297
+ }, [broadcastPresence, canvasWidth, canvasHeight, activeSlideIndex]);
12298
+ if (!collab) {
12299
+ return null;
12300
+ }
12301
+ return /* @__PURE__ */ jsx(
12302
+ "div",
12303
+ {
12304
+ ref: containerRef,
12305
+ "data-testid": "collab-pointer-tracker",
12306
+ "data-export-ignore": "true",
12307
+ style: { display: "contents" },
12308
+ children: /* @__PURE__ */ jsx(
12309
+ RemoteUserCursors,
12310
+ {
12311
+ remoteUsers: collab.remoteUsers,
12312
+ activeSlideIndex,
12313
+ canvasWidth,
12314
+ canvasHeight
12315
+ }
12316
+ )
12317
+ }
12318
+ );
12319
+ }
12320
+ function RemoteSelectionOverlay({
12321
+ collaboration,
12322
+ elements,
12323
+ activeSlideIndex
12324
+ }) {
12325
+ const context = useCollaboration();
12326
+ const collab = collaboration === void 0 ? context : collaboration;
12327
+ if (!collab) {
12328
+ return null;
12329
+ }
12330
+ const elementMap = /* @__PURE__ */ new Map();
12331
+ for (const el of elements) {
12332
+ elementMap.set(el.id, el);
12333
+ }
12334
+ const selections = [];
12335
+ for (const user of collab.remoteUsers) {
12336
+ if (user.activeSlideIndex === activeSlideIndex && user.selectedElementId) {
12337
+ const el = elementMap.get(user.selectedElementId);
12338
+ if (el) {
12339
+ selections.push({
12340
+ userName: user.userName,
12341
+ userColor: user.userColor,
12342
+ element: el
12343
+ });
12344
+ }
12345
+ }
12346
+ }
12347
+ if (selections.length === 0) {
12348
+ return null;
12349
+ }
12350
+ return /* @__PURE__ */ jsx(Fragment, { children: selections.map((sel) => /* @__PURE__ */ jsx(
12351
+ "div",
12352
+ {
12353
+ "data-testid": `remote-selection-${sel.element.id}`,
12354
+ "data-pptx-remote-selection": sel.element.id,
12355
+ "data-export-ignore": "true",
12356
+ className: "absolute pointer-events-none",
12357
+ style: {
12358
+ left: sel.element.x,
12359
+ top: sel.element.y,
12360
+ width: sel.element.width,
12361
+ height: sel.element.height,
12362
+ zIndex: 9997,
12363
+ border: `2px solid ${sel.userColor}`,
12364
+ borderRadius: 2
12365
+ },
12366
+ children: /* @__PURE__ */ jsx(
12367
+ "span",
12368
+ {
12369
+ className: "absolute -top-5 left-0 px-1 py-0.5 text-[9px] font-medium text-white rounded-sm whitespace-nowrap leading-none",
12370
+ style: { backgroundColor: sel.userColor },
12371
+ children: sel.userName
12372
+ }
12373
+ )
12374
+ },
12375
+ `remote-sel-${sel.element.id}`
12376
+ )) });
12377
+ }
12378
+ function useCollaborationDocumentSync(input) {
12379
+ const { collaboration, ...state } = input;
12380
+ const latest = useRef(input);
12381
+ latest.current = input;
12382
+ const getSourceBytes = useCallback(() => {
12383
+ const bytes = latest.current.content;
12384
+ return bytes instanceof Uint8Array ? bytes : bytes ? new Uint8Array(bytes) : null;
12385
+ }, []);
12386
+ const getSaveOptions = useCallback(() => buildDeckSaveOptions(latest.current.deckSaveState), []);
12387
+ const config = collaboration?.config;
12388
+ const doc = collaboration?.doc;
12389
+ const status = collaboration?.status;
12390
+ const preserveAcceptedEdits = useCallback((detachingDoc) => {
12391
+ const current = latest.current;
12392
+ const session = current.collaboration;
12393
+ if (session?.doc === detachingDoc && !session.config.externalSession && (session.status !== "connected" || !session.synced || session.config.role === "viewer")) {
12394
+ current.setSlides(readSlidesFromYDoc(detachingDoc));
12395
+ }
12396
+ }, []);
12397
+ const isConnected = config?.externalSession ? Boolean(collaboration?.doc) : collaboration?.status === "connected";
12398
+ useYjsDocumentSync({
12399
+ ...state,
12400
+ doc: collaboration?.doc ?? null,
12401
+ isConnected,
12402
+ isSynced: collaboration?.synced ?? false,
12403
+ config,
12404
+ livePatcher: state.livePatcher,
12405
+ getSourceBytes,
12406
+ getSaveOptions
12407
+ });
12408
+ const initialized = useCollaborationLivePatch({
12409
+ patcher: state.livePatcher,
12410
+ externalSession: config?.externalSession,
12411
+ doc: collaboration?.doc ?? null,
12412
+ isConnected: isConnected && config?.role !== "viewer",
12413
+ isSynced: collaboration?.synced ?? false,
12414
+ onBeforeDetach: preserveAcceptedEdits
12415
+ });
12416
+ useEffect(() => {
12417
+ if (!config?.externalSession || !doc) {
12418
+ latest.current.onReadOnlyChange?.(
12419
+ config?.externalSession ? status !== "error" : Boolean(config) && status !== "error" && (!initialized || Boolean(doc) && config?.role === "viewer")
12420
+ );
12421
+ }
12422
+ }, [doc, config, status, initialized]);
12423
+ }
12424
+ function useViewerBuildingBlocksCollaboration(input) {
12425
+ const { state, activeSlideIndex } = input.core;
12426
+ const collaboration = useCollaborativeState({
12427
+ config: input.config,
12428
+ canvasWidth: state.canvasSize.width,
12429
+ canvasHeight: state.canvasSize.height
12430
+ });
12431
+ useCollaborationDocumentSync({
12432
+ collaboration,
12433
+ content: input.content,
12434
+ slides: state.slides,
12435
+ setSlides: state.setSlides,
12436
+ templateElementsBySlideId: state.templateElementsBySlideId,
12437
+ loadVersion: input.loadVersion,
12438
+ loadOrigin: input.loadOrigin,
12439
+ livePatcher: state.livePatcher,
12440
+ onReadOnlyChange: input.onReadOnlyChange,
12441
+ deckSaveState: {
12442
+ ...state,
12443
+ embedFonts: input.embedFonts,
12444
+ slideSize: resolveSlideSizeSelection({
12445
+ current: state.slideSizeEmu,
12446
+ canvas: state.canvasSize
12447
+ }).size
12448
+ }
12449
+ });
12450
+ const overlay = collaboration ? /* @__PURE__ */ jsxs(Fragment, { children: [
12451
+ /* @__PURE__ */ jsx(
12452
+ RemoteSelectionOverlay,
12453
+ {
12454
+ collaboration,
12455
+ elements: state.slides[activeSlideIndex]?.elements ?? [],
12456
+ activeSlideIndex
12457
+ }
12458
+ ),
12459
+ /* @__PURE__ */ jsx(
12460
+ CollaborationCursorOverlay,
12461
+ {
12462
+ collaboration,
12463
+ activeSlideIndex,
12464
+ selectedElementId: state.selectedElementId,
12465
+ canvasWidth: state.canvasSize.width,
12466
+ canvasHeight: state.canvasSize.height
12467
+ }
12468
+ )
12469
+ ] }) : void 0;
12470
+ return { collaboration, overlay };
12471
+ }
12065
12472
  function useViewerBuildingBlocksCore(input) {
12066
12473
  const { content} = input;
12067
12474
  const state = useViewerState();
@@ -12488,6 +12895,7 @@ function useViewerBuildingBlocksState(input) {
12488
12895
  setShowGuides: state.setShowGuides
12489
12896
  });
12490
12897
  return {
12898
+ loadVersion,
12491
12899
  dialogs,
12492
12900
  editorOps,
12493
12901
  exportHandlers,
@@ -12505,7 +12913,7 @@ function useViewerBuildingBlocksState(input) {
12505
12913
  function useViewerBuildingBlocks(input) {
12506
12914
  const {
12507
12915
  content: incomingContent,
12508
- canEdit = false,
12916
+ canEdit: requestedCanEdit = false,
12509
12917
  filePath,
12510
12918
  fileName,
12511
12919
  autosaveEnabled = true,
@@ -12523,15 +12931,19 @@ function useViewerBuildingBlocks(input) {
12523
12931
  onOpenHeaderFooter,
12524
12932
  onOpenShareDialog
12525
12933
  } = input;
12934
+ const [collaborationReadOnly, setCollaborationReadOnly] = useState(Boolean(input.collaboration));
12526
12935
  const { t } = useTranslation();
12527
12936
  const [content, setContent] = useState(incomingContent ?? null);
12937
+ const [loadOrigin, setLoadOrigin] = useState("bootstrap");
12528
12938
  useEffect(() => {
12529
12939
  setContent(incomingContent ?? null);
12940
+ setLoadOrigin("bootstrap");
12530
12941
  }, [incomingContent]);
12531
12942
  const onOpenFile = useCallback(() => {
12532
12943
  void (async () => {
12533
12944
  const picked = await openPptxFile();
12534
12945
  if (picked) {
12946
+ setLoadOrigin("user");
12535
12947
  setContent(picked.buffer);
12536
12948
  }
12537
12949
  })();
@@ -12540,6 +12952,7 @@ function useViewerBuildingBlocks(input) {
12540
12952
  void (async () => {
12541
12953
  const bytes = await readBackstageRecentFile(key);
12542
12954
  if (bytes) {
12955
+ setLoadOrigin("user");
12543
12956
  setContent(bytes);
12544
12957
  }
12545
12958
  })();
@@ -12565,8 +12978,16 @@ function useViewerBuildingBlocks(input) {
12565
12978
  gridSpacingPx,
12566
12979
  viewerOptions
12567
12980
  } = core;
12981
+ const canEdit = resolveCollaborationShellEditability({
12982
+ authorizedCanEdit: requestedCanEdit,
12983
+ configured: Boolean(input.collaboration),
12984
+ readOnly: collaborationReadOnly,
12985
+ sourcePending: Boolean(content) && loading,
12986
+ sourceError: Boolean(error)
12987
+ });
12568
12988
  const {
12569
12989
  dialogs,
12990
+ loadVersion,
12570
12991
  editorOps,
12571
12992
  exportHandlers,
12572
12993
  printHandlers,
@@ -12593,6 +13014,15 @@ function useViewerBuildingBlocks(input) {
12593
13014
  onSelectionChange,
12594
13015
  onSlideCountChange
12595
13016
  });
13017
+ const { collaboration, overlay } = useViewerBuildingBlocksCollaboration({
13018
+ core,
13019
+ config: input.collaboration,
13020
+ content,
13021
+ loadOrigin,
13022
+ loadVersion,
13023
+ embedFonts: dialogs.embedFontsEnabled,
13024
+ onReadOnlyChange: setCollaborationReadOnly
13025
+ });
12596
13026
  const toolbarProps = buildToolbarProps({
12597
13027
  mode,
12598
13028
  canEdit,
@@ -12647,7 +13077,38 @@ function useViewerBuildingBlocks(input) {
12647
13077
 
12648
13078
  ${url}`
12649
13079
  });
12650
- return { toolbarProps, canvasProps, mode, loading, error, autosaveStatus };
13080
+ canvasProps.collaborationOverlay = overlay;
13081
+ const shellState = useMemo(
13082
+ () => resolveCollaborationShellState({
13083
+ authorizedCanEdit: requestedCanEdit,
13084
+ configured: Boolean(input.collaboration),
13085
+ readOnly: collaborationReadOnly,
13086
+ sourcePending: Boolean(content) && loading,
13087
+ sourceError: Boolean(error),
13088
+ status: collaboration?.status ?? "disconnected",
13089
+ remoteUsers: collaboration?.remoteUsers ?? []
13090
+ }),
13091
+ [
13092
+ requestedCanEdit,
13093
+ input.collaboration,
13094
+ collaborationReadOnly,
13095
+ content,
13096
+ loading,
13097
+ error,
13098
+ collaboration?.status,
13099
+ collaboration?.remoteUsers
13100
+ ]
13101
+ );
13102
+ return {
13103
+ toolbarProps,
13104
+ canvasProps,
13105
+ mode,
13106
+ loading,
13107
+ error,
13108
+ autosaveStatus,
13109
+ collaboration,
13110
+ shellState
13111
+ };
12651
13112
  }
12652
13113
  function ColorChangedImage({
12653
13114
  src,
@@ -12965,16 +13426,16 @@ function LoadingState({ className }) {
12965
13426
  function FailedToLoad() {
12966
13427
  return null;
12967
13428
  }
12968
- var LazyArea3DChartScene = React18.lazy(
13429
+ var LazyArea3DChartScene = React20.lazy(
12969
13430
  async () => {
12970
13431
  try {
12971
- return await import('./Area3DChartScene-LKOWSMAU.mjs');
13432
+ return await import('./Area3DChartScene-WNEHMOG2.mjs');
12972
13433
  } catch {
12973
13434
  return { default: FailedToLoad };
12974
13435
  }
12975
13436
  }
12976
13437
  );
12977
- var SceneErrorBoundary = class extends React18.Component {
13438
+ var SceneErrorBoundary = class extends React20.Component {
12978
13439
  constructor(props) {
12979
13440
  super(props);
12980
13441
  this.state = { hasError: false };
@@ -13034,16 +13495,16 @@ var BarChart3DContext = createContext(false);
13034
13495
  function FailedToLoad2() {
13035
13496
  return null;
13036
13497
  }
13037
- var LazyBar3DChartScene = React18.lazy(
13498
+ var LazyBar3DChartScene = React20.lazy(
13038
13499
  async () => {
13039
13500
  try {
13040
- return await import('./Bar3DChartScene-NQNSIMUL.mjs');
13501
+ return await import('./Bar3DChartScene-E53RZRI4.mjs');
13041
13502
  } catch {
13042
13503
  return { default: FailedToLoad2 };
13043
13504
  }
13044
13505
  }
13045
13506
  );
13046
- var SceneErrorBoundary2 = class extends React18.Component {
13507
+ var SceneErrorBoundary2 = class extends React20.Component {
13047
13508
  constructor(props) {
13048
13509
  super(props);
13049
13510
  this.state = { hasError: false };
@@ -13137,16 +13598,16 @@ var LineChart3DContext = createContext(false);
13137
13598
  function FailedToLoad3() {
13138
13599
  return null;
13139
13600
  }
13140
- var LazyLine3DChartScene = React18.lazy(
13601
+ var LazyLine3DChartScene = React20.lazy(
13141
13602
  async () => {
13142
13603
  try {
13143
- return await import('./Line3DChartScene-ANZBJYQI.mjs');
13604
+ return await import('./Line3DChartScene-YJ2POVES.mjs');
13144
13605
  } catch {
13145
13606
  return { default: FailedToLoad3 };
13146
13607
  }
13147
13608
  }
13148
13609
  );
13149
- var SceneErrorBoundary3 = class extends React18.Component {
13610
+ var SceneErrorBoundary3 = class extends React20.Component {
13150
13611
  constructor(props) {
13151
13612
  super(props);
13152
13613
  this.state = { hasError: false };
@@ -13206,16 +13667,16 @@ var PieChart3DContext = createContext(false);
13206
13667
  function FailedToLoad4() {
13207
13668
  return null;
13208
13669
  }
13209
- var LazyPieChart3DScene = React18.lazy(
13670
+ var LazyPieChart3DScene = React20.lazy(
13210
13671
  async () => {
13211
13672
  try {
13212
- return await import('./PieChart3DScene-FBRPLHLG.mjs');
13673
+ return await import('./PieChart3DScene-YYBYC5AM.mjs');
13213
13674
  } catch {
13214
13675
  return { default: FailedToLoad4 };
13215
13676
  }
13216
13677
  }
13217
13678
  );
13218
- var SceneErrorBoundary4 = class extends React18.Component {
13679
+ var SceneErrorBoundary4 = class extends React20.Component {
13219
13680
  constructor(props) {
13220
13681
  super(props);
13221
13682
  this.state = { hasError: false };
@@ -13273,16 +13734,16 @@ var SurfaceChart3DContext = createContext(false);
13273
13734
  function FailedToLoad5() {
13274
13735
  return null;
13275
13736
  }
13276
- var LazySurfaceChart3DScene = React18.lazy(
13737
+ var LazySurfaceChart3DScene = React20.lazy(
13277
13738
  async () => {
13278
13739
  try {
13279
- return await import('./SurfaceChart3DScene-7HE5DA3X.mjs');
13740
+ return await import('./SurfaceChart3DScene-FFYG6CNE.mjs');
13280
13741
  } catch {
13281
13742
  return { default: FailedToLoad5 };
13282
13743
  }
13283
13744
  }
13284
13745
  );
13285
- var SceneErrorBoundary5 = class extends React18.Component {
13746
+ var SceneErrorBoundary5 = class extends React20.Component {
13286
13747
  constructor(props) {
13287
13748
  super(props);
13288
13749
  this.state = { hasError: false };
@@ -14051,7 +14512,7 @@ function ResizeHandles({
14051
14512
  ))
14052
14513
  ] });
14053
14514
  }
14054
- var ConnectorElementRenderer = React18.memo(
14515
+ var ConnectorElementRenderer = React20.memo(
14055
14516
  // oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
14056
14517
  function ConnectorElementRendererInner({
14057
14518
  el,
@@ -14438,7 +14899,7 @@ function shapeParams(element) {
14438
14899
  const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
14439
14900
  return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
14440
14901
  }
14441
- var Extrusion3DOverlay = React18.memo(
14902
+ var Extrusion3DOverlay = React20.memo(
14442
14903
  // oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
14443
14904
  function Extrusion3DOverlayInner({ data }) {
14444
14905
  if (!data.hasExtrusion || data.panels.length === 0) {
@@ -14672,7 +15133,7 @@ function ShapeEffectOverlay({
14672
15133
  ) : null
14673
15134
  ] });
14674
15135
  }
14675
- var ElementRenderer = React18.memo(
15136
+ var ElementRenderer = React20.memo(
14676
15137
  // oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
14677
15138
  function ElementRendererInner({
14678
15139
  element: el,
@@ -15363,7 +15824,11 @@ function renderOleBadge(oleType) {
15363
15824
  )
15364
15825
  ] });
15365
15826
  }
15827
+ var InlineCollaborationContext = createContext(void 0);
15828
+
15829
+ // src/viewer/components/elements/useInlineListEditor.tsx
15366
15830
  function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15831
+ const collaboration = useContext(InlineCollaborationContext);
15367
15832
  const initial = useRef(null);
15368
15833
  let activationMismatch = false;
15369
15834
  if (!initial.current?.seed) {
@@ -15371,7 +15836,8 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15371
15836
  const modelBody = inlineListBodyText(
15372
15837
  "textSegments" in element ? element.textSegments : void 0
15373
15838
  );
15374
- const candidate = createInlineListSeed(element);
15839
+ const connected = collaboration?.elementIds.has(element.id) && collaboration.patcher.isActive() && collaboration.patcher.beginTextEdit ? collaboration : void 0;
15840
+ const candidate = createInlineListSeed(element, { includePlain: Boolean(connected) });
15375
15841
  activationMismatch = Boolean(candidate && liveRoot && readEditableText(liveRoot) !== modelBody);
15376
15842
  const seed = activationMismatch ? void 0 : candidate;
15377
15843
  const activationSelection = initial.current && seed && rootRef.current ? readListActivationSelection(
@@ -15380,10 +15846,12 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15380
15846
  ) : void 0;
15381
15847
  if (!initial.current || seed) {
15382
15848
  initial.current = {
15849
+ element,
15383
15850
  seed,
15851
+ collaboration: connected,
15384
15852
  model: createInlineListModelObserver(element),
15385
15853
  activationSelection,
15386
- children: seed ? renderTextSegments(
15854
+ children: seed && !connected ? renderTextSegments(
15387
15855
  element,
15388
15856
  DEFAULT_TEXT_COLOR,
15389
15857
  void 0,
@@ -15420,6 +15888,38 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15420
15888
  return;
15421
15889
  }
15422
15890
  retiredRef.current = false;
15891
+ if (session.collaboration) {
15892
+ const context = session.collaboration;
15893
+ const controller2 = attachCollaborationInlineEditor(root, session.element, {
15894
+ patcher: context.patcher,
15895
+ slideId: context.slideId,
15896
+ onSnapshot: (snapshot) => onChangeRef.current(snapshot.text, snapshot),
15897
+ onCancel: () => {
15898
+ retiredRef.current = true;
15899
+ onModelReplacementRef.current();
15900
+ }
15901
+ });
15902
+ if (!controller2) {
15903
+ retiredRef.current = true;
15904
+ onModelReplacementRef.current();
15905
+ return;
15906
+ }
15907
+ controllerRef.current = controller2;
15908
+ const releaseReader = context.registerReader?.(session.element.id, controller2.read);
15909
+ return () => {
15910
+ retiredRef.current = true;
15911
+ const current = context.readReadOnlyElement?.(session.element.id);
15912
+ const accepted = current && controller2.checkModel(current) && controller2.readAccepted();
15913
+ if (accepted) {
15914
+ onChangeRef.current(accepted.text, accepted);
15915
+ }
15916
+ releaseReader?.();
15917
+ controller2.dispose();
15918
+ if (controllerRef.current === controller2) {
15919
+ controllerRef.current = null;
15920
+ }
15921
+ };
15922
+ }
15423
15923
  for (const paragraph of seed.paragraphs) {
15424
15924
  const block = root.querySelector(`[data-pptx-list-paragraph="${paragraph.token}"]`);
15425
15925
  if (block) {
@@ -15462,6 +15962,12 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15462
15962
  if (!controller) {
15463
15963
  return;
15464
15964
  }
15965
+ if (controller.checkModel) {
15966
+ const owner = session.collaboration;
15967
+ const sameOwner = owner?.patcher === collaboration?.patcher && owner?.slideId === collaboration?.slideId;
15968
+ controller.checkModel(sameOwner ? element : void 0);
15969
+ return;
15970
+ }
15465
15971
  const change = session.model.check(element, controller.read());
15466
15972
  if (change.kind === "current") {
15467
15973
  return;
@@ -15473,10 +15979,12 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
15473
15979
  controller.dispose();
15474
15980
  controllerRef.current = null;
15475
15981
  onModelReplacementRef.current();
15476
- }, [element, session]);
15982
+ }, [element, session, collaboration?.patcher, collaboration?.slideId]);
15477
15983
  return {
15478
15984
  ...session,
15479
- canCommit: () => !retiredRef.current,
15985
+ connected: Boolean(session.collaboration),
15986
+ mutate: (range, apply) => controllerRef.current?.mutate?.(range, apply) ?? false,
15987
+ canCommit: () => !retiredRef.current && (!session.collaboration || controllerRef.current?.read().kind === "supported"),
15480
15988
  retire: () => {
15481
15989
  retiredRef.current = true;
15482
15990
  controllerRef.current?.dispose();
@@ -15549,8 +16057,12 @@ function InlineTextEditor({
15549
16057
  const trimRange = document.createRange();
15550
16058
  trimRange.setStart(startContainer, startOffset - 1);
15551
16059
  trimRange.setEnd(startContainer, startOffset);
15552
- trimRange.deleteContents();
15553
- }, []);
16060
+ if (list.connected) {
16061
+ list.mutate(trimRange, () => trimRange.deleteContents());
16062
+ } else {
16063
+ trimRange.deleteContents();
16064
+ }
16065
+ }, [list]);
15554
16066
  useEffect(() => {
15555
16067
  const el = editorRef.current;
15556
16068
  if (!el) {
@@ -15676,10 +16188,10 @@ function InlineTextEditor({
15676
16188
  function FailedToLoad6() {
15677
16189
  return null;
15678
16190
  }
15679
- var LazyModel3DScene = React18.lazy(
16191
+ var LazyModel3DScene = React20.lazy(
15680
16192
  async () => {
15681
16193
  try {
15682
- return await import('./Model3DScene-Y34HTZXK.mjs');
16194
+ return await import('./Model3DScene-MYODSOVU.mjs');
15683
16195
  } catch {
15684
16196
  return { default: FailedToLoad6 };
15685
16197
  }
@@ -15741,7 +16253,7 @@ function PosterFallback({
15741
16253
  }
15742
16254
  );
15743
16255
  }
15744
- var Model3DErrorBoundary = class extends React18.Component {
16256
+ var Model3DErrorBoundary = class extends React20.Component {
15745
16257
  constructor(props) {
15746
16258
  super(props);
15747
16259
  this.state = { hasError: false };
@@ -15950,10 +16462,10 @@ function SmartArtInlineNodeEditor({
15950
16462
  onCancel
15951
16463
  }) {
15952
16464
  const { t } = useTranslation();
15953
- const ref = React18.useRef(null);
15954
- const [value, setValue] = React18.useState(initialText);
15955
- const settled = React18.useRef(false);
15956
- React18.useEffect(() => {
16465
+ const ref = React20.useRef(null);
16466
+ const [value, setValue] = React20.useState(initialText);
16467
+ const settled = React20.useRef(false);
16468
+ React20.useEffect(() => {
15957
16469
  const el = ref.current;
15958
16470
  if (el) {
15959
16471
  el.focus();
@@ -16046,16 +16558,16 @@ function findNodeIdFromEvent(target) {
16046
16558
  return null;
16047
16559
  }
16048
16560
  function useSmartArtHoverState(containerRef, measureNodeRect = measureScreenNodeRect) {
16049
- const [hoveredNodeId, setHoveredNodeId] = React18.useState(null);
16050
- const [hoveredNodeRect, setHoveredNodeRect] = React18.useState(null);
16051
- const hideTimeoutRef = React18.useRef(null);
16052
- const cancelPendingHide = React18.useCallback(() => {
16561
+ const [hoveredNodeId, setHoveredNodeId] = React20.useState(null);
16562
+ const [hoveredNodeRect, setHoveredNodeRect] = React20.useState(null);
16563
+ const hideTimeoutRef = React20.useRef(null);
16564
+ const cancelPendingHide = React20.useCallback(() => {
16053
16565
  if (hideTimeoutRef.current !== null) {
16054
16566
  window.clearTimeout(hideTimeoutRef.current);
16055
16567
  hideTimeoutRef.current = null;
16056
16568
  }
16057
16569
  }, []);
16058
- const handleMouseMove = React18.useCallback(
16570
+ const handleMouseMove = React20.useCallback(
16059
16571
  (e, ignoreRef) => {
16060
16572
  const nodeEl = findNodeIdFromEvent(e.target);
16061
16573
  const container = containerRef.current;
@@ -16078,12 +16590,12 @@ function useSmartArtHoverState(containerRef, measureNodeRect = measureScreenNode
16078
16590
  },
16079
16591
  [containerRef, cancelPendingHide, measureNodeRect]
16080
16592
  );
16081
- const clearHover = React18.useCallback(() => {
16593
+ const clearHover = React20.useCallback(() => {
16082
16594
  cancelPendingHide();
16083
16595
  setHoveredNodeId(null);
16084
16596
  setHoveredNodeRect(null);
16085
16597
  }, [cancelPendingHide]);
16086
- React18.useEffect(() => cancelPendingHide, [cancelPendingHide]);
16598
+ React20.useEffect(() => cancelPendingHide, [cancelPendingHide]);
16087
16599
  return { hoveredNodeId, hoveredNodeRect, handleMouseMove, clearHover };
16088
16600
  }
16089
16601
  var EDITOR_PADDING = 4;
@@ -16099,14 +16611,14 @@ function SmartArtEditableLayer({
16099
16611
  measureNodeRect = measureScreenNodeRect,
16100
16612
  children
16101
16613
  }) {
16102
- const containerRef = React18.useRef(null);
16103
- const styleBarRef = React18.useRef(null);
16104
- const [edit, setEdit] = React18.useState(null);
16614
+ const containerRef = React20.useRef(null);
16615
+ const styleBarRef = React20.useRef(null);
16616
+ const [edit, setEdit] = React20.useState(null);
16105
16617
  const { hoveredNodeId, hoveredNodeRect, handleMouseMove, clearHover } = useSmartArtHoverState(
16106
16618
  containerRef,
16107
16619
  measureNodeRect
16108
16620
  );
16109
- const openEditor = React18.useCallback(
16621
+ const openEditor = React20.useCallback(
16110
16622
  (target) => {
16111
16623
  const nodeEl = findNodeIdFromEvent(target);
16112
16624
  const container = containerRef.current;
@@ -16721,20 +17233,20 @@ function sameDiagramReveal(prev, next) {
16721
17233
  }
16722
17234
  return true;
16723
17235
  }
16724
- var SmartArtRenderer = React18.memo(SmartArtRendererImpl, arePropsEqual);
17236
+ var SmartArtRenderer = React20.memo(SmartArtRendererImpl, arePropsEqual);
16725
17237
  function FailedToLoad7() {
16726
17238
  return null;
16727
17239
  }
16728
- var LazySmartArt3DScene = React18.lazy(
17240
+ var LazySmartArt3DScene = React20.lazy(
16729
17241
  async () => {
16730
17242
  try {
16731
- return await import('./SmartArt3DScene-QZGIABOK.mjs');
17243
+ return await import('./SmartArt3DScene-D4VNNPHS.mjs');
16732
17244
  } catch {
16733
17245
  return { default: FailedToLoad7 };
16734
17246
  }
16735
17247
  }
16736
17248
  );
16737
- var SceneErrorBoundary6 = class extends React18.Component {
17249
+ var SceneErrorBoundary6 = class extends React20.Component {
16738
17250
  constructor(props) {
16739
17251
  super(props);
16740
17252
  this.state = { hasError: false };
@@ -16781,7 +17293,7 @@ function SmartArt3DRenderer({
16781
17293
  }
16782
17294
  const palette = resolvePalette2(element);
16783
17295
  const style = resolveStyle(element);
16784
- const layoutResult = computeSmartArtElementLayout(
17296
+ const layoutResult = resolveSmartArt3DLayout(
16785
17297
  element.smartArtData,
16786
17298
  nodes,
16787
17299
  { width: element.width, height: element.height },
@@ -16937,7 +17449,7 @@ function EnvelopeGlyph({
16937
17449
  }
16938
17450
  return /* @__PURE__ */ jsx("g", { "data-glyph-slices": glyph.slices.length, children: glyph.slices.map((slice, si) => {
16939
17451
  const clipId = `${glyphKey}-s${si}`;
16940
- return /* @__PURE__ */ jsxs(React18.Fragment, { children: [
17452
+ return /* @__PURE__ */ jsxs(React20.Fragment, { children: [
16941
17453
  /* @__PURE__ */ jsx("clipPath", { id: clipId, clipPathUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx(
16942
17454
  "rect",
16943
17455
  {
@@ -17865,7 +18377,7 @@ function StaticElementRendererImpl({
17865
18377
  }
17866
18378
  );
17867
18379
  }
17868
- var StaticElementRenderer = React18.memo(StaticElementRendererImpl);
18380
+ var StaticElementRenderer = React20.memo(StaticElementRendererImpl);
17869
18381
  StaticElementRenderer.displayName = "StaticElementRenderer";
17870
18382
  function SlideLayer({
17871
18383
  slide,
@@ -18338,4 +18850,4 @@ function useResizablePanels() {
18338
18850
  };
18339
18851
  }
18340
18852
 
18341
- export { ACTION_VERB_MAP, AreaChart3DContext, BarChart3DContext, ChartPartSelectionProvider, ElementRenderer, FragmentedTransitionLayer, LineChart3DContext, LoadingState, MIN_TOUCH_TARGET, MorphTransitionOverlay, PieChart3DContext, PresentationTransitionOverlay, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArt3DContext, SmartArtRenderer, StaticElementRenderer, SurfaceChart3DContext, ViewerOptionsContext, computeToolbarVisibility, detectTargetType, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useChartPartSelection, useClipboardHandlers, useCollaborationLivePatch, useCollaborativeHistory, useCollaborativeState, useComments, useCompatibilityToastsState, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useReadOnlyRecommendationState, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewPreferencesSync, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerOptionsContext, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport };
18853
+ export { ACTION_VERB_MAP, AreaChart3DContext, BarChart3DContext, ChartPartSelectionProvider, CollaborationCursorOverlay, CollaborationProvider, ElementRenderer, FragmentedTransitionLayer, InlineCollaborationContext, LineChart3DContext, LoadingState, MIN_TOUCH_TARGET, MorphTransitionOverlay, PieChart3DContext, PresentationTransitionOverlay, RemoteSelectionOverlay, RemoteUserCursors, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArt3DContext, SmartArtRenderer, StaticElementRenderer, SurfaceChart3DContext, ViewerOptionsContext, computeToolbarVisibility, detectTargetType, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useChartPartSelection, useClipboardHandlers, useCollaboration, useCollaborationDocumentSync, useCollaborativeHistory, useCollaborativeState, useComments, useCompatibilityToastsState, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useReadOnlyRecommendationState, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewPreferencesSync, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerOptionsContext, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport };