pptx-react-viewer 2.17.0 → 2.19.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 (132) hide show
  1. package/CHANGELOG.md +703 -0
  2. package/README.md +14 -14
  3. package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-2GBJETOY.js} +24 -24
  4. package/dist/AiChatPanel-2GBJETOY.js.br +0 -0
  5. package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
  6. package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-FZUKTQPQ.mjs} +4 -4
  7. package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
  8. package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
  9. package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-JHTI2AQ6.js} +2 -2
  10. package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
  11. package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
  12. package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-WRRQSYAZ.mjs} +1 -1
  13. package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
  14. package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
  15. package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
  16. package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
  17. package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
  18. package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
  19. package/dist/{chunk-7JPLVECA.js → chunk-7ARD2J6Y.js} +10502 -7059
  20. package/dist/chunk-7ARD2J6Y.js.br +0 -0
  21. package/dist/chunk-7ARD2J6Y.js.gz +0 -0
  22. package/dist/{chunk-ZA5JONCW.mjs → chunk-BO373PYH.mjs} +257 -184
  23. package/dist/chunk-BO373PYH.mjs.br +0 -0
  24. package/dist/chunk-BO373PYH.mjs.gz +0 -0
  25. package/dist/{chunk-TCGXGD6E.js → chunk-IRLOXBO7.js} +608 -535
  26. package/dist/chunk-IRLOXBO7.js.br +0 -0
  27. package/dist/chunk-IRLOXBO7.js.gz +0 -0
  28. package/dist/{chunk-AONFHTTJ.js → chunk-MVKRI3CZ.js} +36 -4
  29. package/dist/chunk-MVKRI3CZ.js.br +0 -0
  30. package/dist/chunk-MVKRI3CZ.js.gz +0 -0
  31. package/dist/{chunk-MQHC5TXI.mjs → chunk-MWEBCWVD.mjs} +38 -2347
  32. package/dist/chunk-MWEBCWVD.mjs.br +0 -0
  33. package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
  34. package/dist/{chunk-NQJPPIVH.js → chunk-NFFV3RDS.js} +1632 -1201
  35. package/dist/chunk-NFFV3RDS.js.br +0 -0
  36. package/dist/chunk-NFFV3RDS.js.gz +0 -0
  37. package/dist/{chunk-5BXATG54.js → chunk-OVPJT4EQ.js} +182 -2490
  38. package/dist/chunk-OVPJT4EQ.js.br +0 -0
  39. package/dist/chunk-OVPJT4EQ.js.gz +0 -0
  40. package/dist/{chunk-ATOUVRRQ.js → chunk-RPJ2BIQ7.js} +3 -3
  41. package/dist/chunk-RPJ2BIQ7.js.br +0 -0
  42. package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
  43. package/dist/{chunk-S64T7C4V.mjs → chunk-SQJBFMEX.mjs} +36 -4
  44. package/dist/chunk-SQJBFMEX.mjs.br +0 -0
  45. package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
  46. package/dist/{chunk-K2QU73KB.mjs → chunk-XF3EOHY2.mjs} +10455 -7039
  47. package/dist/chunk-XF3EOHY2.mjs.br +0 -0
  48. package/dist/chunk-XF3EOHY2.mjs.gz +0 -0
  49. package/dist/{chunk-422DF424.mjs → chunk-YWJBD7KV.mjs} +654 -223
  50. package/dist/chunk-YWJBD7KV.mjs.br +0 -0
  51. package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
  52. package/dist/{chunk-FXJOTEPO.mjs → chunk-ZMEYXAC6.mjs} +1 -1
  53. package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
  54. package/dist/chunk-ZMEYXAC6.mjs.gz +0 -0
  55. package/dist/i18n.js +4 -4
  56. package/dist/i18n.js.br +0 -0
  57. package/dist/i18n.js.gz +0 -0
  58. package/dist/i18n.mjs +1 -1
  59. package/dist/i18n.mjs.br +0 -0
  60. package/dist/i18n.mjs.gz +0 -0
  61. package/dist/index.d.ts +535 -17
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +65 -41
  64. package/dist/index.js.br +0 -0
  65. package/dist/index.js.gz +0 -0
  66. package/dist/index.mjs +6 -6
  67. package/dist/index.mjs.br +0 -0
  68. package/dist/index.mjs.gz +0 -0
  69. package/dist/internals.d.ts +645 -47
  70. package/dist/internals.d.ts.map +1 -1
  71. package/dist/internals.js +79 -79
  72. package/dist/internals.js.br +0 -0
  73. package/dist/internals.js.gz +0 -0
  74. package/dist/internals.mjs +4 -4
  75. package/dist/internals.mjs.br +0 -0
  76. package/dist/internals.mjs.gz +0 -0
  77. package/dist/pptx-viewer.css +1 -1
  78. package/dist/pptx-viewer.css.br +0 -0
  79. package/dist/pptx-viewer.css.gz +0 -0
  80. package/dist/{types-DU35aAJK.d.ts → types-TCH6icpi.d.ts} +25 -31
  81. package/dist/types-TCH6icpi.d.ts.map +1 -0
  82. package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +34 -5
  83. package/dist/useViewerBuildingBlocks-BKb0qs1j.d.ts.map +1 -0
  84. package/dist/viewer/index.d.ts +465 -40
  85. package/dist/viewer/index.js +27 -27
  86. package/dist/viewer/index.js.br +0 -0
  87. package/dist/viewer/index.js.gz +0 -0
  88. package/dist/viewer/index.mjs +6 -6
  89. package/dist/viewer/index.mjs.br +0 -0
  90. package/dist/viewer/index.mjs.gz +0 -0
  91. package/package.json +2 -2
  92. package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
  93. package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
  94. package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
  95. package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
  96. package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
  97. package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
  98. package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
  99. package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
  100. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +0 -1
  101. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs +0 -76
  102. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
  103. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
  104. package/dist/SurfaceChart3DScene-ODQY77SZ.js +0 -78
  105. package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
  106. package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
  107. package/dist/chunk-422DF424.mjs.br +0 -0
  108. package/dist/chunk-422DF424.mjs.gz +0 -0
  109. package/dist/chunk-5BXATG54.js.br +0 -0
  110. package/dist/chunk-5BXATG54.js.gz +0 -0
  111. package/dist/chunk-7JPLVECA.js.br +0 -0
  112. package/dist/chunk-7JPLVECA.js.gz +0 -0
  113. package/dist/chunk-AONFHTTJ.js.br +0 -0
  114. package/dist/chunk-AONFHTTJ.js.gz +0 -0
  115. package/dist/chunk-ATOUVRRQ.js.br +0 -0
  116. package/dist/chunk-ATOUVRRQ.js.gz +0 -0
  117. package/dist/chunk-FXJOTEPO.mjs.br +0 -0
  118. package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
  119. package/dist/chunk-K2QU73KB.mjs.br +0 -0
  120. package/dist/chunk-K2QU73KB.mjs.gz +0 -0
  121. package/dist/chunk-MQHC5TXI.mjs.br +0 -0
  122. package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
  123. package/dist/chunk-NQJPPIVH.js.br +0 -0
  124. package/dist/chunk-NQJPPIVH.js.gz +0 -0
  125. package/dist/chunk-S64T7C4V.mjs.br +0 -0
  126. package/dist/chunk-S64T7C4V.mjs.gz +0 -0
  127. package/dist/chunk-TCGXGD6E.js.br +0 -0
  128. package/dist/chunk-TCGXGD6E.js.gz +0 -0
  129. package/dist/chunk-ZA5JONCW.mjs.br +0 -0
  130. package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
  131. package/dist/types-DU35aAJK.d.ts.map +0 -1
  132. package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk5BXATG54_js = require('./chunk-5BXATG54.js');
4
- var chunkAONFHTTJ_js = require('./chunk-AONFHTTJ.js');
5
- var chunk7JPLVECA_js = require('./chunk-7JPLVECA.js');
3
+ var chunkOVPJT4EQ_js = require('./chunk-OVPJT4EQ.js');
4
+ var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
5
+ var chunk7ARD2J6Y_js = require('./chunk-7ARD2J6Y.js');
6
6
  var react = require('react');
7
7
  var JSZip = require('jszip');
8
8
  var reactI18next = require('react-i18next');
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
14
14
  function useVirtualizedSlides({
15
15
  totalItems,
16
16
  itemHeight,
17
- overscan = chunk7JPLVECA_js.DEFAULT_VIRTUAL_OVERSCAN
17
+ overscan = chunk7ARD2J6Y_js.DEFAULT_VIRTUAL_OVERSCAN
18
18
  }) {
19
19
  const scrollContainerRef = react.useRef(null);
20
20
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
44
44
  resizeObserver?.disconnect();
45
45
  };
46
46
  }, []);
47
- const range = chunk7JPLVECA_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
47
+ const range = chunk7ARD2J6Y_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
48
48
  const safeItemHeight = Math.max(itemHeight, 1);
49
49
  const scrollToIndex = react.useCallback(
50
50
  (index, behavior = "smooth") => {
@@ -85,7 +85,7 @@ function usePresenceTracking({
85
85
  }) {
86
86
  const [remoteUsers, setRemoteUsers] = react.useState([]);
87
87
  const projectorRef = react.useRef(null);
88
- projectorRef.current ??= chunk7JPLVECA_js.createPresenceProjector();
88
+ projectorRef.current ??= chunk7ARD2J6Y_js.createPresenceProjector();
89
89
  const projector = projectorRef.current;
90
90
  const lastBroadcastRef = react.useRef(0);
91
91
  const pendingBroadcastRef = react.useRef(null);
@@ -110,7 +110,7 @@ function usePresenceTracking({
110
110
  awareness.setLocalStateField("presence", state);
111
111
  lastBroadcastRef.current = Date.now();
112
112
  };
113
- if (elapsed >= chunk7JPLVECA_js.BROADCAST_THROTTLE_MS) {
113
+ if (elapsed >= chunk7ARD2J6Y_js.BROADCAST_THROTTLE_MS) {
114
114
  if (pendingBroadcastRef.current) {
115
115
  clearTimeout(pendingBroadcastRef.current);
116
116
  pendingBroadcastRef.current = null;
@@ -120,7 +120,7 @@ function usePresenceTracking({
120
120
  pendingBroadcastRef.current = setTimeout(() => {
121
121
  pendingBroadcastRef.current = null;
122
122
  flush();
123
- }, chunk7JPLVECA_js.BROADCAST_THROTTLE_MS - elapsed);
123
+ }, chunk7ARD2J6Y_js.BROADCAST_THROTTLE_MS - elapsed);
124
124
  }
125
125
  },
126
126
  [awareness, userName, userColor, userAvatar, role]
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
200
200
  const departureRef = react.useRef(null);
201
201
  const gateRef = react.useRef(null);
202
202
  if (!gateRef.current) {
203
- gateRef.current = chunk7JPLVECA_js.createSyncGate(() => setSynced(true));
203
+ gateRef.current = chunk7ARD2J6Y_js.createSyncGate(() => setSynced(true));
204
204
  }
205
205
  const teardown = react.useCallback(() => {
206
206
  if (timeoutRef.current) {
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
220
220
  const buildCleanup = react.useCallback(
221
221
  (provider, yDoc) => () => {
222
222
  announceDeparture();
223
- chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
223
+ chunk7ARD2J6Y_js.clearLocalAwareness(provider.awareness);
224
224
  provider.destroy();
225
225
  yDoc.destroy();
226
226
  setDoc(null);
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
245
245
  if (config.authToken) {
246
246
  opts.password = config.authToken;
247
247
  }
248
- const roomId = chunk7JPLVECA_js.validateRoomId(config.roomId);
248
+ const roomId = chunk7ARD2J6Y_js.validateRoomId(config.roomId);
249
249
  const provider = new WebrtcProvider(roomId, yDoc, opts);
250
- departureRef.current = chunk7JPLVECA_js.createDepartureChannel(roomId, provider.awareness);
250
+ departureRef.current = chunk7ARD2J6Y_js.createDepartureChannel(roomId, provider.awareness);
251
251
  setDoc(yDoc);
252
252
  setAwareness(provider.awareness);
253
253
  setClientId(provider.awareness.clientID);
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
289
289
  if (!config) {
290
290
  return;
291
291
  }
292
- const roomId = chunk7JPLVECA_js.validateRoomId(config.roomId);
293
- const transport = config.transport ?? chunk7JPLVECA_js.resolveTransportForServerUrl(config.serverUrl);
292
+ const roomId = chunk7ARD2J6Y_js.validateRoomId(config.roomId);
293
+ const transport = config.transport ?? chunk7ARD2J6Y_js.resolveTransportForServerUrl(config.serverUrl);
294
294
  if (transport === "webrtc") {
295
295
  await initWebrtc();
296
296
  return;
297
297
  }
298
- if (chunk7JPLVECA_js.isMixedContentBlocked(config.serverUrl)) {
298
+ if (chunk7ARD2J6Y_js.isMixedContentBlocked(config.serverUrl)) {
299
299
  console.warn(
300
300
  `[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
301
301
  );
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
309
309
  const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
310
310
  params: config.authToken ? { token: config.authToken } : void 0
311
311
  });
312
- departureRef.current = chunk7JPLVECA_js.createDepartureChannel(roomId, provider.awareness);
312
+ departureRef.current = chunk7ARD2J6Y_js.createDepartureChannel(roomId, provider.awareness);
313
313
  let connected = false;
314
314
  const handleStatus = (event) => {
315
315
  if (event.status === "connected") {
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
349
349
  provider.off("status", handleStatus);
350
350
  provider.off("sync", handleSynced);
351
351
  announceDeparture();
352
- chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
352
+ chunk7ARD2J6Y_js.clearLocalAwareness(provider.awareness);
353
353
  provider.destroy();
354
354
  yDoc.destroy();
355
355
  setDoc(null);
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
358
358
  cleanupRef.current = null;
359
359
  setStatus("error");
360
360
  }
361
- }, chunk7JPLVECA_js.CONNECTION_TIMEOUT_MS);
361
+ }, chunk7ARD2J6Y_js.CONNECTION_TIMEOUT_MS);
362
362
  }
363
363
  setDoc(yDoc);
364
364
  setAwareness(provider.awareness);
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
367
367
  provider.off("status", handleStatus);
368
368
  provider.off("sync", handleSynced);
369
369
  announceDeparture();
370
- chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
370
+ chunk7ARD2J6Y_js.clearLocalAwareness(provider.awareness);
371
371
  provider.destroy();
372
372
  yDoc.destroy();
373
373
  setDoc(null);
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
393
393
  ]);
394
394
  react.useEffect(() => {
395
395
  init();
396
- const disposeTeardown = chunk7JPLVECA_js.registerCollaborationTeardown({
396
+ const disposeTeardown = chunk7ARD2J6Y_js.registerCollaborationTeardown({
397
397
  leave: teardown,
398
398
  rejoin: init
399
399
  });
@@ -414,7 +414,7 @@ function useCollaborativeState({
414
414
  canvasWidth,
415
415
  canvasHeight
416
416
  }) {
417
- const userColor = chunk7JPLVECA_js.sanitizeColor(config?.userColor, "#6366f1");
417
+ const userColor = chunk7ARD2J6Y_js.sanitizeColor(config?.userColor, "#6366f1");
418
418
  const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
419
419
  const { remoteUsers, broadcastPresence } = usePresenceTracking({
420
420
  awareness,
@@ -479,6 +479,14 @@ function useSheetDismissDrag(onClose, threshold = 120) {
479
479
  };
480
480
  }
481
481
  var DEFAULT_MAX_HISTORY_ENTRIES = 120;
482
+ function serializeDocument(snapshot) {
483
+ return JSON.stringify({
484
+ width: snapshot.width,
485
+ height: snapshot.height,
486
+ slides: snapshot.slides,
487
+ templateElementsBySlideId: snapshot.templateElementsBySlideId
488
+ });
489
+ }
482
490
  function useEditorHistory(input) {
483
491
  const {
484
492
  slides,
@@ -524,8 +532,8 @@ function useEditorHistory(input) {
524
532
  width: canvasSize.width,
525
533
  height: canvasSize.height,
526
534
  activeSlideIndex,
527
- slides: slides.map(chunk7JPLVECA_js.cloneSlide),
528
- templateElementsBySlideId: chunk7JPLVECA_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
535
+ slides: slides.map(chunk7ARD2J6Y_js.cloneSlide),
536
+ templateElementsBySlideId: chunk7ARD2J6Y_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
529
537
  ...actionLabel ? { actionLabel } : {}
530
538
  };
531
539
  },
@@ -538,9 +546,9 @@ function useEditorHistory(input) {
538
546
  width: snapshot.width,
539
547
  height: snapshot.height
540
548
  });
541
- setSlides(snapshot.slides.map(chunk7JPLVECA_js.cloneSlide));
549
+ setSlides(snapshot.slides.map(chunk7ARD2J6Y_js.cloneSlide));
542
550
  setTemplateElementsBySlideId(
543
- chunk7JPLVECA_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
551
+ chunk7ARD2J6Y_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
544
552
  );
545
553
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
546
554
  setSelectedElementIds([]);
@@ -579,9 +587,9 @@ function useEditorHistory(input) {
579
587
  const currentSnapshot = buildHistorySnapshot();
580
588
  historyFutureRef.current.push(currentSnapshot);
581
589
  isApplyingHistoryRef.current = true;
582
- const nextSnapshot = chunk5BXATG54_js.cloneHistorySnapshot(previousSnapshot);
583
- lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(nextSnapshot);
584
- lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
590
+ const nextSnapshot = chunkOVPJT4EQ_js.cloneHistorySnapshot(previousSnapshot);
591
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(nextSnapshot);
592
+ lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
585
593
  applyHistorySnapshot(nextSnapshot);
586
594
  updateHistoryAvailability();
587
595
  unlockHistoryTracking();
@@ -601,9 +609,9 @@ function useEditorHistory(input) {
601
609
  const currentSnapshot = buildHistorySnapshot();
602
610
  historyPastRef.current.push(currentSnapshot);
603
611
  isApplyingHistoryRef.current = true;
604
- const targetSnapshot = chunk5BXATG54_js.cloneHistorySnapshot(nextSnapshot);
605
- lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(targetSnapshot);
606
- lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
612
+ const targetSnapshot = chunkOVPJT4EQ_js.cloneHistorySnapshot(nextSnapshot);
613
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(targetSnapshot);
614
+ lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
607
615
  applyHistorySnapshot(targetSnapshot);
608
616
  updateHistoryAvailability();
609
617
  unlockHistoryTracking();
@@ -620,9 +628,9 @@ function useEditorHistory(input) {
620
628
  historyPastRef.current = [];
621
629
  historyFutureRef.current = [];
622
630
  if (initialSnapshot) {
623
- const clonedInitial = chunk5BXATG54_js.cloneHistorySnapshot(initialSnapshot);
631
+ const clonedInitial = chunkOVPJT4EQ_js.cloneHistorySnapshot(initialSnapshot);
624
632
  lastHistorySnapshotRef.current = clonedInitial;
625
- lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
633
+ lastHistorySerializedRef.current = serializeDocument(clonedInitial);
626
634
  } else {
627
635
  lastHistorySnapshotRef.current = null;
628
636
  lastHistorySerializedRef.current = "";
@@ -654,26 +662,33 @@ function useEditorHistory(input) {
654
662
  return;
655
663
  }
656
664
  const snapshot = buildHistorySnapshot();
657
- const serialized = JSON.stringify(snapshot);
665
+ const serialized = serializeDocument(snapshot);
658
666
  if (serialized === lastHistorySerializedRef.current) {
667
+ const previous = lastHistorySnapshotRef.current;
668
+ if (previous && previous.activeSlideIndex !== snapshot.activeSlideIndex) {
669
+ lastHistorySnapshotRef.current = {
670
+ ...previous,
671
+ activeSlideIndex: snapshot.activeSlideIndex
672
+ };
673
+ }
659
674
  lastCheapHashRef.current = cheapHash;
660
675
  return;
661
676
  }
662
677
  const previousSnapshot = lastHistorySnapshotRef.current;
663
678
  if (!previousSnapshot) {
664
- lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(snapshot);
679
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(snapshot);
665
680
  lastHistorySerializedRef.current = serialized;
666
681
  lastCheapHashRef.current = cheapHash;
667
682
  updateHistoryAvailability();
668
683
  return;
669
684
  }
670
685
  onDirtyRef.current?.();
671
- historyPastRef.current.push(chunk5BXATG54_js.cloneHistorySnapshot(previousSnapshot));
686
+ historyPastRef.current.push(chunkOVPJT4EQ_js.cloneHistorySnapshot(previousSnapshot));
672
687
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
673
688
  historyPastRef.current.shift();
674
689
  }
675
690
  historyFutureRef.current = [];
676
- lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(snapshot);
691
+ lastHistorySnapshotRef.current = chunkOVPJT4EQ_js.cloneHistorySnapshot(snapshot);
677
692
  lastHistorySerializedRef.current = serialized;
678
693
  lastCheapHashRef.current = cheapHash;
679
694
  updateHistoryAvailability();
@@ -733,9 +748,9 @@ function useZoomViewport({
733
748
  const canvasStageRef = react.useRef(null);
734
749
  const canvasViewportRef = react.useRef(null);
735
750
  const renderScaleRef = react.useRef(1);
736
- const wheelBufferRef = react.useRef(chunk7JPLVECA_js.createWheelStepBuffer());
751
+ const wheelBufferRef = react.useRef(chunk7ARD2J6Y_js.createWheelStepBuffer());
737
752
  const storeRef = react.useRef(null);
738
- storeRef.current ??= chunk7JPLVECA_js.createViewerZoomStore();
753
+ storeRef.current ??= chunk7ARD2J6Y_js.createViewerZoomStore();
739
754
  const store = storeRef.current;
740
755
  const scale = useViewerStore(store, selectZoom);
741
756
  const setScale = react.useCallback(
@@ -796,7 +811,7 @@ function useZoomViewport({
796
811
  if (!wrapper || !canvasViewport) {
797
812
  return;
798
813
  }
799
- const boundedScale = chunk7JPLVECA_js.clampZoomScale(nextScale);
814
+ const boundedScale = chunk7ARD2J6Y_js.clampZoomScale(nextScale);
800
815
  const nextEditorScale = fitScale * boundedScale;
801
816
  const centerX = (bounds.minX + bounds.maxX) / 2;
802
817
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -833,29 +848,29 @@ function useZoomViewport({
833
848
  selectedElements.forEach((element) => {
834
849
  minX = Math.min(minX, element.x);
835
850
  minY = Math.min(minY, element.y);
836
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE));
837
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE));
851
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE));
852
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE));
838
853
  });
839
854
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
840
855
  return;
841
856
  }
842
857
  const selectionBounds = { minX, minY, maxX, maxY };
843
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
844
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
858
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
859
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
845
860
  const availableWidth = Math.max(
846
- effectiveEditorDimensions.width - chunk5BXATG54_js.ZOOM_TO_SELECTION_PADDING,
847
- chunk5BXATG54_js.MIN_ELEMENT_SIZE
861
+ effectiveEditorDimensions.width - chunkOVPJT4EQ_js.ZOOM_TO_SELECTION_PADDING,
862
+ chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE
848
863
  );
849
864
  const availableHeight = Math.max(
850
- effectiveEditorDimensions.height - chunk5BXATG54_js.ZOOM_TO_SELECTION_PADDING,
851
- chunk5BXATG54_js.MIN_ELEMENT_SIZE
865
+ effectiveEditorDimensions.height - chunkOVPJT4EQ_js.ZOOM_TO_SELECTION_PADDING,
866
+ chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE
852
867
  );
853
868
  const targetEditorScale = Math.min(
854
869
  availableWidth / boundsWidth,
855
870
  availableHeight / boundsHeight
856
871
  );
857
872
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
858
- const nextScale = chunk7JPLVECA_js.clampZoomScale(targetEditorScale / safeFitScale);
873
+ const nextScale = chunk7ARD2J6Y_js.clampZoomScale(targetEditorScale / safeFitScale);
859
874
  setScale(nextScale);
860
875
  window.requestAnimationFrame(() => {
861
876
  window.requestAnimationFrame(() => {
@@ -872,14 +887,14 @@ function useZoomViewport({
872
887
  ]);
873
888
  const handleWheel = react.useCallback(
874
889
  (event) => {
875
- const mapped = chunk7JPLVECA_js.mapEditingWheel(event, wheelBufferRef.current, true);
890
+ const mapped = chunk7ARD2J6Y_js.mapEditingWheel(event, wheelBufferRef.current, true);
876
891
  if (mapped.intent !== "zoom") {
877
892
  return;
878
893
  }
879
894
  event.preventDefault();
880
895
  store.dispatch({
881
896
  type: "set-zoom",
882
- zoom: chunk7JPLVECA_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
897
+ zoom: chunk7ARD2J6Y_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
883
898
  });
884
899
  },
885
900
  [store]
@@ -967,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
967
982
  const command = step.command;
968
983
  const timer = window.setTimeout(
969
984
  () => {
970
- chunk5BXATG54_js.executeMediaCommand(command);
985
+ chunkOVPJT4EQ_js.executeMediaCommand(command);
971
986
  },
972
987
  Math.max(0, step.delayMs)
973
988
  );
@@ -1104,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1104
1119
  }))
1105
1120
  );
1106
1121
  entranceAnimations.forEach((animation, animationIndex) => {
1107
- const delay = chunk7JPLVECA_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1122
+ const delay = chunk7ARD2J6Y_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1108
1123
  const timer = window.setTimeout(() => {
1109
1124
  setPresentationAnimations(
1110
1125
  (previousAnimations) => previousAnimations.map(
@@ -1136,7 +1151,7 @@ function useAnimationPlayback(input) {
1136
1151
  (controller, group) => {
1137
1152
  driveBuildReveal(
1138
1153
  controller,
1139
- chunk7JPLVECA_js.PresentationAnimationController.collectBuildStepIds(group),
1154
+ chunk7ARD2J6Y_js.PresentationAnimationController.collectBuildStepIds(group),
1140
1155
  setPresentationElementStates,
1141
1156
  buildRafRef
1142
1157
  );
@@ -1199,7 +1214,7 @@ function useAnimationPlayback(input) {
1199
1214
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1200
1215
  return;
1201
1216
  }
1202
- const controller = chunk7JPLVECA_js.PresentationAnimationController.fromSlide(slide);
1217
+ const controller = chunk7ARD2J6Y_js.PresentationAnimationController.fromSlide(slide);
1203
1218
  controllerRef.current = controller;
1204
1219
  setPresentationKeyframesCss(controller.keyframesCss);
1205
1220
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1357,12 +1372,12 @@ function useAnimationPlayback(input) {
1357
1372
  presentationTimersRef
1358
1373
  };
1359
1374
  }
1360
- var PRESENTER_CHANNEL_NAME = chunk7JPLVECA_js.PRESENTATION_CHANNEL_NAME;
1361
- var AUDIENCE_HASH = chunk7JPLVECA_js.PRESENTATION_HASH;
1362
- var PRESENTER_MSG_ORIGIN = chunk7JPLVECA_js.PRESENTATION_MESSAGE_ORIGIN;
1363
- var AUDIENCE_NONCE_KEY = chunk7JPLVECA_js.PRESENTATION_NONCE_KEY;
1375
+ var PRESENTER_CHANNEL_NAME = chunk7ARD2J6Y_js.PRESENTATION_CHANNEL_NAME;
1376
+ var AUDIENCE_HASH = chunk7ARD2J6Y_js.PRESENTATION_HASH;
1377
+ var PRESENTER_MSG_ORIGIN = chunk7ARD2J6Y_js.PRESENTATION_MESSAGE_ORIGIN;
1378
+ var AUDIENCE_NONCE_KEY = chunk7ARD2J6Y_js.PRESENTATION_NONCE_KEY;
1364
1379
  function generateSessionId() {
1365
- return chunk7JPLVECA_js.createPresentationSessionId();
1380
+ return chunk7ARD2J6Y_js.createPresentationSessionId();
1366
1381
  }
1367
1382
  function parseAudienceNonce() {
1368
1383
  const hash = window.location.hash;
@@ -1398,7 +1413,7 @@ function usePresenterWindow(input) {
1398
1413
  }, []);
1399
1414
  const swapDisplays = react.useCallback(async () => {
1400
1415
  const audience = audienceWindowRef.current;
1401
- return audience && !audience.closed ? chunk7JPLVECA_js.swapPresentationWindows(window, audience) : false;
1416
+ return audience && !audience.closed ? chunk7ARD2J6Y_js.swapPresentationWindows(window, audience) : false;
1402
1417
  }, []);
1403
1418
  const syncSlideToAudience = react.useCallback(
1404
1419
  (slideIndex) => {
@@ -1462,7 +1477,7 @@ function usePresenterWindow(input) {
1462
1477
  pollTimerRef.current = null;
1463
1478
  }
1464
1479
  if (closingSessionId) {
1465
- void chunk7JPLVECA_js.clearAudienceContent(closingSessionId);
1480
+ void chunk7ARD2J6Y_js.clearAudienceContent(closingSessionId);
1466
1481
  }
1467
1482
  }, [getChannel]);
1468
1483
  const openAudienceWindow = react.useCallback(() => {
@@ -1480,10 +1495,10 @@ function usePresenterWindow(input) {
1480
1495
  audienceWindowRef.current = blankWin;
1481
1496
  const sessionId = generateSessionId();
1482
1497
  sessionIdRef.current = sessionId;
1483
- const audienceUrl = chunk7JPLVECA_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1484
- void chunk7JPLVECA_js.resolveAudienceScreenPlacement(window).then((placement) => {
1498
+ const audienceUrl = chunk7ARD2J6Y_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1499
+ void chunk7ARD2J6Y_js.resolveAudienceScreenPlacement(window).then((placement) => {
1485
1500
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1486
- chunk7JPLVECA_js.placeAudienceWindow(blankWin, placement);
1501
+ chunk7ARD2J6Y_js.placeAudienceWindow(blankWin, placement);
1487
1502
  }
1488
1503
  return void 0;
1489
1504
  });
@@ -1513,7 +1528,7 @@ function usePresenterWindow(input) {
1513
1528
  }
1514
1529
  };
1515
1530
  if (content) {
1516
- void chunk7JPLVECA_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1531
+ void chunk7ARD2J6Y_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1517
1532
  } else {
1518
1533
  navigateOrClose(true);
1519
1534
  }
@@ -1539,7 +1554,7 @@ function usePresenterWindow(input) {
1539
1554
  }
1540
1555
  const handleMessage = (event) => {
1541
1556
  const message = event.data;
1542
- if (chunk7JPLVECA_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1557
+ if (chunk7ARD2J6Y_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1543
1558
  syncStateToAudience(snapshotRef.current);
1544
1559
  }
1545
1560
  };
@@ -1568,7 +1583,7 @@ function usePresenterWindow(input) {
1568
1583
  react.useEffect(() => {
1569
1584
  const handleBeforeUnload = () => {
1570
1585
  if (sessionIdRef.current) {
1571
- void chunk7JPLVECA_js.clearAudienceContent(sessionIdRef.current);
1586
+ void chunk7ARD2J6Y_js.clearAudienceContent(sessionIdRef.current);
1572
1587
  }
1573
1588
  };
1574
1589
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1630,7 +1645,7 @@ function useAudienceMode(input) {
1630
1645
  }
1631
1646
  channel.onmessage = (event) => {
1632
1647
  const data = event.data;
1633
- if (!chunk7JPLVECA_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1648
+ if (!chunk7ARD2J6Y_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1634
1649
  return;
1635
1650
  }
1636
1651
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1646,16 +1661,16 @@ function useAudienceMode(input) {
1646
1661
  }
1647
1662
  if (data.type === "presenter-exit") {
1648
1663
  if (expectedSessionId) {
1649
- void chunk7JPLVECA_js.clearAudienceContent(expectedSessionId);
1664
+ void chunk7ARD2J6Y_js.clearAudienceContent(expectedSessionId);
1650
1665
  }
1651
- if (chunk7JPLVECA_js.endAudienceDisplay(window)) {
1666
+ if (chunk7ARD2J6Y_js.endAudienceDisplay(window)) {
1652
1667
  handlers.onPresenterEnded?.();
1653
1668
  }
1654
1669
  }
1655
1670
  };
1656
1671
  if (expectedSessionId) {
1657
1672
  channel.postMessage({
1658
- origin: chunk7JPLVECA_js.PRESENTATION_MESSAGE_ORIGIN,
1673
+ origin: chunk7ARD2J6Y_js.PRESENTATION_MESSAGE_ORIGIN,
1659
1674
  type: "audience-ready",
1660
1675
  sessionId: expectedSessionId
1661
1676
  });
@@ -1669,7 +1684,7 @@ function useAudienceMode(input) {
1669
1684
  }, []);
1670
1685
  }
1671
1686
  function usePresentationKeyboard(input) {
1672
- const wheelBufferRef = react.useRef(chunk7JPLVECA_js.createWheelStepBuffer());
1687
+ const wheelBufferRef = react.useRef(chunk7ARD2J6Y_js.createWheelStepBuffer());
1673
1688
  const {
1674
1689
  mode,
1675
1690
  movePresentationSlide,
@@ -1682,6 +1697,7 @@ function usePresentationKeyboard(input) {
1682
1697
  onToggleInkMarkup,
1683
1698
  onToggleToolbar,
1684
1699
  onShowAllSlides,
1700
+ onToggleSubtitles,
1685
1701
  onToggleBlackScreen,
1686
1702
  onToggleWhiteScreen,
1687
1703
  rehearsing,
@@ -1689,14 +1705,14 @@ function usePresentationKeyboard(input) {
1689
1705
  presentationSlideIndex,
1690
1706
  setShowRehearsalSummary
1691
1707
  } = input;
1692
- const keyBufferRef = react.useRef(chunk7JPLVECA_js.createPresentationKeyBuffer());
1708
+ const keyBufferRef = react.useRef(chunk7ARD2J6Y_js.createPresentationKeyBuffer());
1693
1709
  react.useEffect(() => {
1694
- if (mode !== "present" || !chunk7JPLVECA_js.acceptsPresentationInput()) {
1695
- keyBufferRef.current = chunk7JPLVECA_js.createPresentationKeyBuffer();
1710
+ if (mode !== "present" || !chunk7ARD2J6Y_js.acceptsPresentationInput()) {
1711
+ keyBufferRef.current = chunk7ARD2J6Y_js.createPresentationKeyBuffer();
1696
1712
  return;
1697
1713
  }
1698
1714
  const handleKeyDown = (event) => {
1699
- const mapped = chunk7JPLVECA_js.mapPresentationKey(event, keyBufferRef.current);
1715
+ const mapped = chunk7ARD2J6Y_js.mapPresentationKey(event, keyBufferRef.current);
1700
1716
  if (mapped.action === "none") {
1701
1717
  return;
1702
1718
  }
@@ -1716,12 +1732,12 @@ function usePresentationKeyboard(input) {
1716
1732
  movePresentationSlide(-1);
1717
1733
  return;
1718
1734
  case "first": {
1719
- const first = chunk7JPLVECA_js.firstShowSlideIndex(showSlideIndexes);
1735
+ const first = chunk7ARD2J6Y_js.firstShowSlideIndex(showSlideIndexes);
1720
1736
  navigateToSlide(first ?? 0);
1721
1737
  return;
1722
1738
  }
1723
1739
  case "last": {
1724
- const last = chunk7JPLVECA_js.lastShowSlideIndex(showSlideIndexes);
1740
+ const last = chunk7ARD2J6Y_js.lastShowSlideIndex(showSlideIndexes);
1725
1741
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1726
1742
  return;
1727
1743
  }
@@ -1747,6 +1763,9 @@ function usePresentationKeyboard(input) {
1747
1763
  case "showAllSlides":
1748
1764
  onShowAllSlides?.();
1749
1765
  return;
1766
+ case "toggleSubtitles":
1767
+ onToggleSubtitles?.();
1768
+ return;
1750
1769
  case "toggleBlackScreen":
1751
1770
  onToggleBlackScreen?.();
1752
1771
  return;
@@ -1756,10 +1775,10 @@ function usePresentationKeyboard(input) {
1756
1775
  }
1757
1776
  };
1758
1777
  const handleWheel = (event) => {
1759
- if (mode !== "present" || !chunk7JPLVECA_js.acceptsPresentationInput()) {
1778
+ if (mode !== "present" || !chunk7ARD2J6Y_js.acceptsPresentationInput()) {
1760
1779
  return;
1761
1780
  }
1762
- const mapped = chunk7JPLVECA_js.mapPresentationWheel(event, wheelBufferRef.current);
1781
+ const mapped = chunk7ARD2J6Y_js.mapPresentationWheel(event, wheelBufferRef.current);
1763
1782
  if (mapped.intent === "next-slide") {
1764
1783
  event.preventDefault();
1765
1784
  movePresentationSlide(1);
@@ -1786,6 +1805,7 @@ function usePresentationKeyboard(input) {
1786
1805
  onToggleInkMarkup,
1787
1806
  onToggleToolbar,
1788
1807
  onShowAllSlides,
1808
+ onToggleSubtitles,
1789
1809
  onToggleBlackScreen,
1790
1810
  onToggleWhiteScreen,
1791
1811
  rehearsing,
@@ -1891,7 +1911,7 @@ function useRehearsalTimings(input) {
1891
1911
 
1892
1912
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1893
1913
  function handlePresentationActionImpl(action, deps) {
1894
- chunk7JPLVECA_js.runPresentationAction(
1914
+ chunk7ARD2J6Y_js.runPresentationAction(
1895
1915
  action,
1896
1916
  { slideCount: deps.slidesLength },
1897
1917
  {
@@ -1913,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
1913
1933
  function executeSlideTransition(nextSlideIndex, deps) {
1914
1934
  const incomingSlide = deps.slides[nextSlideIndex];
1915
1935
  const transition = incomingSlide?.transition;
1916
- const durationMs = deps.playTransition ? chunk7JPLVECA_js.resolveTransitionDurationMs(transition) : 0;
1936
+ const durationMs = deps.playTransition ? chunk7ARD2J6Y_js.resolveTransitionDurationMs(transition) : 0;
1917
1937
  deps.clearPresentationTimers();
1918
1938
  deps.setPresentationSlideIndex(nextSlideIndex);
1919
1939
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -1972,7 +1992,7 @@ function useSlideNavigation(input) {
1972
1992
  });
1973
1993
  const scheduleAutoAdvanceForSlide = react.useCallback(
1974
1994
  (slideIndex) => {
1975
- const delayMs = chunk7JPLVECA_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1995
+ const delayMs = chunk7ARD2J6Y_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1976
1996
  if (delayMs === void 0) {
1977
1997
  return;
1978
1998
  }
@@ -1995,7 +2015,7 @@ function useSlideNavigation(input) {
1995
2015
  if (availableSlideIndexes.length === 0) {
1996
2016
  return;
1997
2017
  }
1998
- const pastLastSlide = direction === 1 && !chunk7JPLVECA_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2018
+ const pastLastSlide = direction === 1 && !chunk7ARD2J6Y_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1999
2019
  if (rehearsing && pastLastSlide) {
2000
2020
  recordCurrentSlideTime(presentationSlideIndex);
2001
2021
  try {
@@ -2013,9 +2033,9 @@ function useSlideNavigation(input) {
2013
2033
  onAdvancePastLastSlide();
2014
2034
  return;
2015
2035
  }
2016
- const nextSlideIndex = direction === 1 ? chunk7JPLVECA_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2036
+ const nextSlideIndex = direction === 1 ? chunk7ARD2J6Y_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2017
2037
  loop: Boolean(loopContinuously) && !rehearsing
2018
- }) : chunk7JPLVECA_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2038
+ }) : chunk7ARD2J6Y_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2019
2039
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2020
2040
  return;
2021
2041
  }
@@ -2160,22 +2180,22 @@ function useZoomNavigation(input) {
2160
2180
  };
2161
2181
  }
2162
2182
  function usePresenterConsole(slideIndex, active) {
2163
- const timerRef = react.useRef(chunk7JPLVECA_js.createPresenterTimer());
2164
- const [snapshot, setSnapshot] = react.useState(() => chunk7JPLVECA_js.createInitialPresentationSnapshot(slideIndex));
2183
+ const timerRef = react.useRef(chunk7ARD2J6Y_js.createPresenterTimer());
2184
+ const [snapshot, setSnapshot] = react.useState(() => chunk7ARD2J6Y_js.createInitialPresentationSnapshot(slideIndex));
2165
2185
  const patch = react.useCallback((value) => {
2166
- setSnapshot((current) => chunk7JPLVECA_js.mergePresentationSnapshot(current, value));
2186
+ setSnapshot((current) => chunk7ARD2J6Y_js.mergePresentationSnapshot(current, value));
2167
2187
  }, []);
2168
2188
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2169
2189
  react.useEffect(() => {
2170
2190
  if (!active) {
2171
2191
  return;
2172
2192
  }
2173
- timerRef.current = chunk7JPLVECA_js.resetPresenterTimer();
2193
+ timerRef.current = chunk7ARD2J6Y_js.resetPresenterTimer();
2174
2194
  patch({ paused: false, elapsedMs: 0 });
2175
2195
  const timer = window.setInterval(() => {
2176
2196
  patch({
2177
2197
  paused: timerRef.current.paused,
2178
- elapsedMs: chunk7JPLVECA_js.presenterElapsed(timerRef.current)
2198
+ elapsedMs: chunk7ARD2J6Y_js.presenterElapsed(timerRef.current)
2179
2199
  });
2180
2200
  }, 1e3);
2181
2201
  return () => window.clearInterval(timer);
@@ -2185,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
2185
2205
  applyAudienceSnapshot: setSnapshot,
2186
2206
  setBlackout: (blackout) => patch({ blackout }),
2187
2207
  toggleTimer: () => {
2188
- timerRef.current = chunk7JPLVECA_js.togglePresenterTimer(timerRef.current);
2208
+ timerRef.current = chunk7ARD2J6Y_js.togglePresenterTimer(timerRef.current);
2189
2209
  patch({
2190
2210
  paused: timerRef.current.paused,
2191
- elapsedMs: chunk7JPLVECA_js.presenterElapsed(timerRef.current)
2211
+ elapsedMs: chunk7ARD2J6Y_js.presenterElapsed(timerRef.current)
2192
2212
  });
2193
2213
  },
2194
2214
  resetTimer: () => {
2195
- timerRef.current = chunk7JPLVECA_js.resetPresenterTimer();
2215
+ timerRef.current = chunk7ARD2J6Y_js.resetPresenterTimer();
2196
2216
  patch({ paused: false, elapsedMs: 0 });
2197
2217
  },
2198
2218
  stepZoom: (direction) => setSnapshot(
2199
- (current) => chunk7JPLVECA_js.mergePresentationSnapshot(current, {
2200
- zoom: chunk7JPLVECA_js.stepPresenterZoom(
2219
+ (current) => chunk7ARD2J6Y_js.mergePresentationSnapshot(current, {
2220
+ zoom: chunk7ARD2J6Y_js.stepPresenterZoom(
2201
2221
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2202
2222
  direction
2203
2223
  )
@@ -2226,6 +2246,7 @@ function usePresentationMode(input) {
2226
2246
  onEraseAnnotations,
2227
2247
  onToggleInkMarkup,
2228
2248
  onToggleToolbar,
2249
+ onToggleSubtitles,
2229
2250
  onSaveRehearsalTimings,
2230
2251
  loopContinuously,
2231
2252
  showWithAnimation,
@@ -2242,7 +2263,7 @@ function usePresentationMode(input) {
2242
2263
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2243
2264
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2244
2265
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2245
- const showGuard = react.useMemo(() => chunk7JPLVECA_js.createPresenterShowGuard(), []);
2266
+ const showGuard = react.useMemo(() => chunk7ARD2J6Y_js.createPresenterShowGuard(), []);
2246
2267
  const {
2247
2268
  presentationAnimations,
2248
2269
  presentationElementStates,
@@ -2321,7 +2342,7 @@ function usePresentationMode(input) {
2321
2342
  });
2322
2343
  const movePresentationSlide = react.useCallback(
2323
2344
  (direction, trigger = "explicit") => {
2324
- if (!chunk7JPLVECA_js.acceptsPresentationInput()) {
2345
+ if (!chunk7ARD2J6Y_js.acceptsPresentationInput()) {
2325
2346
  return;
2326
2347
  }
2327
2348
  if (endOfShowVisible) {
@@ -2433,6 +2454,7 @@ function usePresentationMode(input) {
2433
2454
  onToggleInkMarkup,
2434
2455
  onToggleToolbar,
2435
2456
  onShowAllSlides: openAllSlides,
2457
+ onToggleSubtitles,
2436
2458
  onToggleBlackScreen: () => presenterConsole.setBlackout(
2437
2459
  presenterConsole.snapshot.blackout === "black" ? "none" : "black"
2438
2460
  ),
@@ -2458,7 +2480,7 @@ function usePresentationMode(input) {
2458
2480
  if (mode !== "present") {
2459
2481
  return;
2460
2482
  }
2461
- return chunk7JPLVECA_js.attachPresentationVisibilityPause({
2483
+ return chunk7ARD2J6Y_js.attachPresentationVisibilityPause({
2462
2484
  root: containerRef.current ?? void 0,
2463
2485
  onHidden: () => clearPresentationTimersRef.current(),
2464
2486
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2538,11 +2560,11 @@ function usePresentationMode(input) {
2538
2560
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2539
2561
  return void 0;
2540
2562
  }
2541
- return chunk7JPLVECA_js.buildMorphTransitionPlan(
2563
+ return chunk7ARD2J6Y_js.buildMorphTransitionPlan(
2542
2564
  slides[transitionOverlay.outgoingSlideIndex],
2543
2565
  slides[transitionOverlay.incomingSlideIndex],
2544
2566
  transitionOverlay.durationMs,
2545
- chunk7JPLVECA_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2567
+ chunk7ARD2J6Y_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2546
2568
  );
2547
2569
  }, [transitionOverlay, slides]);
2548
2570
  const morphedElementStates = react.useMemo(() => {
@@ -2563,7 +2585,7 @@ function usePresentationMode(input) {
2563
2585
  if (!morphPlan) {
2564
2586
  return presentationKeyframesCss;
2565
2587
  }
2566
- const imageRules = chunk7JPLVECA_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2588
+ const imageRules = chunk7ARD2J6Y_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2567
2589
  return `${presentationKeyframesCss ?? ""}
2568
2590
  ${morphPlan.keyframesCss}
2569
2591
  ${imageRules}`;
@@ -2859,7 +2881,7 @@ function useFindReplace({
2859
2881
  const [findResults, setFindResults] = react.useState([]);
2860
2882
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2861
2883
  const performFind = react.useCallback(() => {
2862
- const results = chunk7JPLVECA_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2884
+ const results = chunk7ARD2J6Y_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2863
2885
  if (!findQuery) {
2864
2886
  setFindResults([]);
2865
2887
  setFindResultIndex(-1);
@@ -2893,7 +2915,7 @@ function useFindReplace({
2893
2915
  return;
2894
2916
  }
2895
2917
  onUpdateSlides(
2896
- (prevSlides) => chunk7JPLVECA_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2918
+ (prevSlides) => chunk7ARD2J6Y_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2897
2919
  );
2898
2920
  onMarkDirty();
2899
2921
  },
@@ -2915,13 +2937,15 @@ function useFindReplace({
2915
2937
  }, [findResults, applyReplacements, performFind]);
2916
2938
  react.useEffect(() => {
2917
2939
  const handler = (event) => {
2918
- if ((event.metaKey || event.ctrlKey) && event.key === "f") {
2919
- if (mode !== "edit") {
2920
- return;
2921
- }
2922
- event.preventDefault();
2923
- setFindReplaceOpen((prev) => !prev);
2940
+ const { action } = chunk7ARD2J6Y_js.mapEditorKey(event, {
2941
+ canEdit: mode === "edit",
2942
+ isTextInputTarget: chunk7ARD2J6Y_js.isEditorTextInputTarget(event.target)
2943
+ });
2944
+ if (action !== "find") {
2945
+ return;
2924
2946
  }
2947
+ event.preventDefault();
2948
+ setFindReplaceOpen((prev) => !prev);
2925
2949
  };
2926
2950
  window.addEventListener("keydown", handler);
2927
2951
  return () => window.removeEventListener("keydown", handler);
@@ -3361,9 +3385,28 @@ function useDerivedElementState(input) {
3361
3385
  }
3362
3386
  return templateElementsBySlideId[activeSlide.id] ?? [];
3363
3387
  }, [activeSlide, templateElementsBySlideId]);
3388
+ const activeMaster = slideMasters[activeMasterIndex];
3389
+ const activeLayout = react.useMemo(
3390
+ () => resolveActiveLayout(activeMaster, activeLayoutIndex),
3391
+ [activeMaster, activeLayoutIndex]
3392
+ );
3393
+ const masterViewElements2 = react.useMemo(
3394
+ () => computeMasterViewElements(activeMaster, activeLayout),
3395
+ [activeMaster, activeLayout]
3396
+ );
3397
+ const notesMasterElements = react.useMemo(() => notesMaster?.elements ?? [], [notesMaster]);
3398
+ const handoutMasterElements = react.useMemo(() => handoutMaster?.elements ?? [], [handoutMaster]);
3364
3399
  const elementLookup = react.useMemo(
3365
- () => buildElementLookup(templateElements, activeSlide?.elements ?? []),
3366
- [activeSlide, templateElements]
3400
+ () => buildElementLookup(
3401
+ [
3402
+ ...templateElements,
3403
+ ...masterViewElements2,
3404
+ ...notesMasterElements,
3405
+ ...handoutMasterElements
3406
+ ],
3407
+ activeSlide?.elements ?? []
3408
+ ),
3409
+ [activeSlide, templateElements, masterViewElements2, notesMasterElements, handoutMasterElements]
3367
3410
  );
3368
3411
  const selectedElement = react.useMemo(() => {
3369
3412
  if (!selectedElementId) {
@@ -3380,17 +3423,6 @@ function useDerivedElementState(input) {
3380
3423
  () => effectiveSelectedIds.map((id) => elementLookup.get(id)).filter(Boolean),
3381
3424
  [effectiveSelectedIds, elementLookup]
3382
3425
  );
3383
- const activeMaster = slideMasters[activeMasterIndex];
3384
- const activeLayout = react.useMemo(
3385
- () => resolveActiveLayout(activeMaster, activeLayoutIndex),
3386
- [activeMaster, activeLayoutIndex]
3387
- );
3388
- const masterViewElements2 = react.useMemo(
3389
- () => computeMasterViewElements(activeMaster, activeLayout),
3390
- [activeMaster, activeLayout]
3391
- );
3392
- const notesMasterElements = react.useMemo(() => notesMaster?.elements ?? [], [notesMaster]);
3393
- const handoutMasterElements = react.useMemo(() => handoutMaster?.elements ?? [], [handoutMaster]);
3394
3426
  return {
3395
3427
  activeSlide,
3396
3428
  templateElements,
@@ -3417,7 +3449,7 @@ function useViewerCoreState(_input) {
3417
3449
  const marqueeStateRef = react.useRef(null);
3418
3450
  const isDrawingRef = react.useRef(false);
3419
3451
  const justInteractedRef = react.useRef(false);
3420
- const livePatcher = react.useMemo(() => chunk7JPLVECA_js.createCollaborationLivePatcher(), []);
3452
+ const livePatcher = react.useMemo(() => chunk7ARD2J6Y_js.createCollaborationLivePatcher(), []);
3421
3453
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3422
3454
  const slidesRef = react.useRef([]);
3423
3455
  const [mode, setMode] = react.useState("edit");
@@ -3426,9 +3458,10 @@ function useViewerCoreState(_input) {
3426
3458
  const [slides, setSlides] = react.useState([]);
3427
3459
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3428
3460
  const [canvasSize, setCanvasSize] = react.useState({
3429
- width: chunk5BXATG54_js.DEFAULT_CANVAS_WIDTH,
3430
- height: chunk5BXATG54_js.DEFAULT_CANVAS_HEIGHT
3461
+ width: chunkOVPJT4EQ_js.DEFAULT_CANVAS_WIDTH,
3462
+ height: chunkOVPJT4EQ_js.DEFAULT_CANVAS_HEIGHT
3431
3463
  });
3464
+ const [slideSizeEmu, setSlideSizeEmu] = react.useState();
3432
3465
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
3433
3466
  const [selectedElementId, setSelectedElementId] = react.useState(null);
3434
3467
  const [selectedElementIds, setSelectedElementIds] = react.useState([]);
@@ -3447,7 +3480,7 @@ function useViewerCoreState(_input) {
3447
3480
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3448
3481
  inlineEditingTextRef.current = resolved;
3449
3482
  setInlineEditingTextBase(value);
3450
- chunk7JPLVECA_js.publishLiveInlineText(
3483
+ chunk7ARD2J6Y_js.publishLiveInlineText(
3451
3484
  livePatcher,
3452
3485
  slidesRef.current[activeSlideIndexRef.current],
3453
3486
  inlineEditingElementIdRef.current,
@@ -3527,6 +3560,8 @@ function useViewerCoreState(_input) {
3527
3560
  setTemplateElementsBySlideId,
3528
3561
  canvasSize,
3529
3562
  setCanvasSize,
3563
+ slideSizeEmu,
3564
+ setSlideSizeEmu,
3530
3565
  activeSlideIndex,
3531
3566
  setActiveSlideIndex,
3532
3567
  selectedElementId,
@@ -3731,6 +3766,7 @@ function useLoadContent({
3731
3766
  setTemplateElementsBySlideId,
3732
3767
  mediaDataUrls,
3733
3768
  setCanvasSize,
3769
+ setSlideSizeEmu,
3734
3770
  setHeaderFooter,
3735
3771
  setLayoutOptions,
3736
3772
  setSlideMasters,
@@ -3738,6 +3774,7 @@ function useLoadContent({
3738
3774
  setTableStyleMap,
3739
3775
  setThemeOptions,
3740
3776
  setCustomShows,
3777
+ setActiveCustomShowId,
3741
3778
  setSections,
3742
3779
  setPresentationProperties,
3743
3780
  setNotesMaster,
@@ -3782,7 +3819,7 @@ function useLoadContent({
3782
3819
  );
3783
3820
  }
3784
3821
  const previousHandler = handlerRef.current;
3785
- const handler = new chunk7JPLVECA_js.PptxHandler();
3822
+ const handler = new chunk7ARD2J6Y_js.PptxHandler();
3786
3823
  const parsed = await handler.load(buffer);
3787
3824
  if (cancelled || token !== renderTokenRef.current) {
3788
3825
  handler.dispose();
@@ -3794,7 +3831,7 @@ function useLoadContent({
3794
3831
  handlerRef.current = null;
3795
3832
  const mediaElements = [];
3796
3833
  for (const slide of parsed.slides) {
3797
- chunk7JPLVECA_js.collectMediaElements(slide.elements, mediaElements);
3834
+ chunk7ARD2J6Y_js.collectMediaElements(slide.elements, mediaElements);
3798
3835
  }
3799
3836
  for (const url of mediaDataUrls.values()) {
3800
3837
  if (url.startsWith("blob:")) {
@@ -3835,7 +3872,7 @@ function useLoadContent({
3835
3872
  }
3836
3873
  })
3837
3874
  );
3838
- const { paths: imagePaths, refs: imageRefs } = chunk7JPLVECA_js.collectImagePaths(parsed.slides);
3875
+ const { paths: imagePaths, refs: imageRefs } = chunk7ARD2J6Y_js.collectImagePaths(parsed.slides);
3839
3876
  let nextSlides = parsed.slides;
3840
3877
  if (imagePaths.size > 0) {
3841
3878
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3890,13 +3927,20 @@ function useLoadContent({
3890
3927
  }
3891
3928
  }
3892
3929
  handlerRef.current = handler;
3893
- const partition = chunk7JPLVECA_js.partitionTemplateElements(nextSlides);
3930
+ const partition = chunk7ARD2J6Y_js.partitionTemplateElements(nextSlides);
3894
3931
  setSlides(partition.slides);
3895
3932
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
3896
3933
  setCanvasSize({
3897
- width: parsed.width ?? chunk5BXATG54_js.DEFAULT_CANVAS_WIDTH,
3898
- height: parsed.height ?? chunk5BXATG54_js.DEFAULT_CANVAS_HEIGHT
3934
+ width: parsed.width ?? chunkOVPJT4EQ_js.DEFAULT_CANVAS_WIDTH,
3935
+ height: parsed.height ?? chunkOVPJT4EQ_js.DEFAULT_CANVAS_HEIGHT
3899
3936
  });
3937
+ setSlideSizeEmu(
3938
+ typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
3939
+ widthEmu: parsed.widthEmu,
3940
+ heightEmu: parsed.heightEmu,
3941
+ type: parsed.slideSizeType ?? ""
3942
+ } : void 0
3943
+ );
3900
3944
  setHeaderFooter(parsed.headerFooter ?? {});
3901
3945
  setLayoutOptions(parsed.layoutOptions ?? []);
3902
3946
  setSlideMasters(parsed.slideMasters ?? []);
@@ -3904,6 +3948,9 @@ function useLoadContent({
3904
3948
  setTableStyleMap(parsed.tableStyleMap);
3905
3949
  setThemeOptions(parsed.themeOptions ?? []);
3906
3950
  setCustomShows(parsed.customShows ?? []);
3951
+ setActiveCustomShowId(
3952
+ chunk7ARD2J6Y_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3953
+ );
3907
3954
  setSections(parsed.sections ?? []);
3908
3955
  setPresentationProperties(parsed.presentationProperties ?? {});
3909
3956
  setNotesMaster(parsed.notesMaster);
@@ -3924,7 +3971,7 @@ function useLoadContent({
3924
3971
  setHasMacros(parsed.hasMacros === true);
3925
3972
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
3926
3973
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
3927
- setGuides(chunk7JPLVECA_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3974
+ setGuides(chunk7ARD2J6Y_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3928
3975
  setActiveSlideIndex(0);
3929
3976
  clearSelection();
3930
3977
  setIsDirty(false);
@@ -3932,7 +3979,7 @@ function useLoadContent({
3932
3979
  onContentApplied?.();
3933
3980
  } catch (err) {
3934
3981
  if (!cancelled && token === renderTokenRef.current) {
3935
- if (err instanceof chunk7JPLVECA_js.EncryptedFileError) {
3982
+ if (err instanceof chunk7ARD2J6Y_js.EncryptedFileError) {
3936
3983
  setIsEncrypted(true);
3937
3984
  } else {
3938
3985
  setError(err instanceof Error ? err.message : String(err));
@@ -3957,23 +4004,12 @@ function useLoadContent({
3957
4004
  }, [content]);
3958
4005
  return { handlerRef };
3959
4006
  }
3960
-
3961
- // src/viewer/hooks/useAutosave-helpers.ts
3962
- var DEFAULT_AUTOSAVE_INTERVAL_SECONDS = 120;
3963
- var MIN_AUTOSAVE_INTERVAL_SECONDS = 10;
3964
- function computeAutosaveIntervalMs(intervalSeconds) {
3965
- return Math.max(intervalSeconds, MIN_AUTOSAVE_INTERVAL_SECONDS) * 1e3;
3966
- }
3967
-
3968
- // src/viewer/hooks/useAutosave.ts
3969
4007
  function useAutosave(input) {
3970
- const {
3971
- isDirty,
3972
- filePath,
3973
- serializeSlides,
3974
- intervalSeconds = DEFAULT_AUTOSAVE_INTERVAL_SECONDS,
3975
- enabled = true
3976
- } = input;
4008
+ const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
4009
+ const intervalMs = chunk7ARD2J6Y_js.resolveAutosaveIntervalMs({
4010
+ hostIntervalMs: input.intervalMs,
4011
+ optionsIntervalSeconds: input.intervalSeconds
4012
+ });
3977
4013
  const [autosaveStatus, setAutosaveStatus] = react.useState({
3978
4014
  state: "idle"
3979
4015
  });
@@ -3981,6 +4017,8 @@ function useAutosave(input) {
3981
4017
  const filePathRef = react.useRef(filePath);
3982
4018
  const serializeRef = react.useRef(serializeSlides);
3983
4019
  const isSavingRef = react.useRef(false);
4020
+ const changeSourcesRef = react.useRef(getChangeSources);
4021
+ const lastSnapshotRef = react.useRef(void 0);
3984
4022
  react.useEffect(() => {
3985
4023
  isDirtyRef.current = isDirty;
3986
4024
  }, [isDirty]);
@@ -3990,14 +4028,22 @@ function useAutosave(input) {
3990
4028
  react.useEffect(() => {
3991
4029
  serializeRef.current = serializeSlides;
3992
4030
  }, [serializeSlides]);
3993
- const doAutosave = react.useCallback(async () => {
3994
- if (!filePathRef.current) {
3995
- return;
3996
- }
3997
- if (!isDirtyRef.current) {
3998
- return;
3999
- }
4000
- if (isSavingRef.current) {
4031
+ react.useEffect(() => {
4032
+ changeSourcesRef.current = getChangeSources;
4033
+ }, [getChangeSources]);
4034
+ const doAutosave = react.useCallback(async (options) => {
4035
+ const path = filePathRef.current;
4036
+ if (!path) {
4037
+ return;
4038
+ }
4039
+ const sources = changeSourcesRef.current?.() ?? [];
4040
+ if (!chunk7ARD2J6Y_js.shouldWriteAutosaveSnapshot({
4041
+ filePath: path,
4042
+ isDirty: isDirtyRef.current,
4043
+ saving: isSavingRef.current,
4044
+ sources: options?.polled === true ? sources : [],
4045
+ lastSnapshot: lastSnapshotRef.current
4046
+ })) {
4001
4047
  return;
4002
4048
  }
4003
4049
  isSavingRef.current = true;
@@ -4009,7 +4055,8 @@ function useAutosave(input) {
4009
4055
  isSavingRef.current = false;
4010
4056
  return;
4011
4057
  }
4012
- await chunk7JPLVECA_js.saveAutosaveSnapshot(filePathRef.current, data);
4058
+ await chunk7ARD2J6Y_js.saveAutosaveSnapshot(path, data);
4059
+ lastSnapshotRef.current = chunk7ARD2J6Y_js.autosaveSnapshotMark(path, sources);
4013
4060
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4014
4061
  } catch (err) {
4015
4062
  setAutosaveStatus({
@@ -4033,15 +4080,14 @@ function useAutosave(input) {
4033
4080
  return;
4034
4081
  }
4035
4082
  setAutosaveStatus((prev) => prev.state === "disabled" ? { state: "idle" } : prev);
4036
- const ms = computeAutosaveIntervalMs(intervalSeconds);
4037
4083
  const id = setInterval(() => {
4038
- void doAutosave();
4039
- }, ms);
4084
+ void doAutosave({ polled: true });
4085
+ }, intervalMs);
4040
4086
  return () => clearInterval(id);
4041
- }, [enabled, filePath, intervalSeconds, doAutosave]);
4087
+ }, [enabled, filePath, intervalMs, doAutosave]);
4042
4088
  return {
4043
4089
  autosaveStatus,
4044
- triggerAutosave: doAutosave
4090
+ triggerAutosave: () => doAutosave()
4045
4091
  };
4046
4092
  }
4047
4093
  function useElementOperations(input) {
@@ -4096,11 +4142,11 @@ function useElementOperations(input) {
4096
4142
  (elementId, updates) => {
4097
4143
  if (masterView?.target) {
4098
4144
  applyMasterViewWrite(
4099
- chunk7JPLVECA_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4145
+ chunk7ARD2J6Y_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4100
4146
  );
4101
4147
  return;
4102
4148
  }
4103
- if (chunk7JPLVECA_js.isTemplateElementId(elementId)) {
4149
+ if (chunk7ARD2J6Y_js.isTemplateElementId(elementId)) {
4104
4150
  const slideId = activeSlide?.id;
4105
4151
  if (slideId) {
4106
4152
  setTemplateElementsBySlideId((prev) => ({
@@ -4148,7 +4194,7 @@ function useElementOperations(input) {
4148
4194
  );
4149
4195
  const updateSelectedShapeStyle = react.useCallback(
4150
4196
  (updates) => {
4151
- if (!selectedElement || !chunk7JPLVECA_js.hasShapeProperties(selectedElement)) {
4197
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasShapeProperties(selectedElement)) {
4152
4198
  return;
4153
4199
  }
4154
4200
  updateSelectedElement({
@@ -4159,17 +4205,17 @@ function useElementOperations(input) {
4159
4205
  );
4160
4206
  const updateSelectedTextStyle = react.useCallback(
4161
4207
  (updates) => {
4162
- if (!selectedElement || !chunk7JPLVECA_js.hasTextProperties(selectedElement)) {
4208
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasTextProperties(selectedElement)) {
4163
4209
  return;
4164
4210
  }
4165
- const inlineSel = chunk7JPLVECA_js.getInlineEditorSelection(selectedElement.textSegments);
4211
+ const inlineSel = chunk7ARD2J6Y_js.getInlineEditorSelection(selectedElement.textSegments);
4166
4212
  if (inlineSel && selectedElement.textSegments) {
4167
- const { newSegments: newSegments2, newSelection } = chunk7JPLVECA_js.applyStyleToSelectedSegments(
4213
+ const { newSegments: newSegments2, newSelection } = chunk7ARD2J6Y_js.applyStyleToSelectedSegments(
4168
4214
  selectedElement.textSegments,
4169
4215
  inlineSel,
4170
4216
  updates
4171
4217
  );
4172
- chunk7JPLVECA_js.setPendingSelectionRestore(newSelection);
4218
+ chunk7ARD2J6Y_js.setPendingSelectionRestore(newSelection);
4173
4219
  updateSelectedElement({
4174
4220
  textSegments: newSegments2
4175
4221
  });
@@ -4189,12 +4235,12 @@ function useElementOperations(input) {
4189
4235
  );
4190
4236
  const updateSelectedTextCase = react.useCallback(
4191
4237
  (mode) => {
4192
- if (!selectedElement || !chunk7JPLVECA_js.hasTextProperties(selectedElement)) {
4238
+ if (!selectedElement || !chunk7ARD2J6Y_js.hasTextProperties(selectedElement)) {
4193
4239
  return;
4194
4240
  }
4195
- const inlineSel = chunk7JPLVECA_js.getInlineEditorSelection(selectedElement.textSegments);
4241
+ const inlineSel = chunk7ARD2J6Y_js.getInlineEditorSelection(selectedElement.textSegments);
4196
4242
  if (inlineSel && selectedElement.textSegments) {
4197
- const newSegments = chunk7JPLVECA_js.applyCaseTransformToSegments(
4243
+ const newSegments = chunk7ARD2J6Y_js.applyCaseTransformToSegments(
4198
4244
  selectedElement.textSegments,
4199
4245
  inlineSel,
4200
4246
  mode
@@ -4204,14 +4250,14 @@ function useElementOperations(input) {
4204
4250
  }
4205
4251
  const updates = {};
4206
4252
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4207
- updates.textSegments = chunk7JPLVECA_js.applyCaseTransformToSegments(
4253
+ updates.textSegments = chunk7ARD2J6Y_js.applyCaseTransformToSegments(
4208
4254
  selectedElement.textSegments,
4209
4255
  null,
4210
4256
  mode
4211
4257
  );
4212
4258
  }
4213
4259
  if (typeof selectedElement.text === "string") {
4214
- updates.text = chunk7JPLVECA_js.transformTextCase(selectedElement.text, mode);
4260
+ updates.text = chunk7ARD2J6Y_js.transformTextCase(selectedElement.text, mode);
4215
4261
  }
4216
4262
  updateSelectedElement(updates);
4217
4263
  },
@@ -4224,15 +4270,15 @@ function useElementOperations(input) {
4224
4270
  [setSlides]
4225
4271
  );
4226
4272
  const masterViewTarget = masterView?.target ?? null;
4227
- const activeElements = masterViewTarget ? chunk7JPLVECA_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4273
+ const activeElements = masterViewTarget ? chunk7ARD2J6Y_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4228
4274
  const updateActiveElements = react.useCallback(
4229
4275
  (updater) => {
4230
4276
  if (masterView?.target) {
4231
4277
  applyMasterViewWrite(
4232
- chunk7JPLVECA_js.replaceMasterViewElements(
4278
+ chunk7ARD2J6Y_js.replaceMasterViewElements(
4233
4279
  masterView,
4234
4280
  masterView.target,
4235
- updater(chunk7JPLVECA_js.masterViewElements(masterView, masterView.target))
4281
+ updater(chunk7ARD2J6Y_js.masterViewElements(masterView, masterView.target))
4236
4282
  )
4237
4283
  );
4238
4284
  return;
@@ -4285,7 +4331,7 @@ function useSectionOperations(input) {
4285
4331
  const { sections, setSections, slides, setSlides, markDirty } = input;
4286
4332
  const addSection2 = react.useCallback(
4287
4333
  (name, afterSlideIndex) => {
4288
- const result = chunk7JPLVECA_js.addSection(sections, slides, name, afterSlideIndex);
4334
+ const result = chunk7ARD2J6Y_js.addSection(sections, slides, name, afterSlideIndex);
4289
4335
  setSlides(result.slides);
4290
4336
  setSections(result.sections);
4291
4337
  markDirty();
@@ -4294,7 +4340,7 @@ function useSectionOperations(input) {
4294
4340
  );
4295
4341
  const renameSection2 = react.useCallback(
4296
4342
  (sectionId, newName) => {
4297
- const result = chunk7JPLVECA_js.renameSection(sections, slides, sectionId, newName);
4343
+ const result = chunk7ARD2J6Y_js.renameSection(sections, slides, sectionId, newName);
4298
4344
  setSections(result.sections);
4299
4345
  setSlides(result.slides);
4300
4346
  markDirty();
@@ -4303,7 +4349,7 @@ function useSectionOperations(input) {
4303
4349
  );
4304
4350
  const deleteSection2 = react.useCallback(
4305
4351
  (sectionId) => {
4306
- const result = chunk7JPLVECA_js.deleteSection(sections, slides, sectionId);
4352
+ const result = chunk7ARD2J6Y_js.deleteSection(sections, slides, sectionId);
4307
4353
  setSections(result.sections);
4308
4354
  setSlides(result.slides);
4309
4355
  markDirty();
@@ -4312,52 +4358,62 @@ function useSectionOperations(input) {
4312
4358
  );
4313
4359
  const moveSectionUp2 = react.useCallback(
4314
4360
  (sectionId) => {
4315
- setSections(chunk7JPLVECA_js.moveSectionUp(sections, sectionId));
4361
+ setSections(chunk7ARD2J6Y_js.moveSectionUp(sections, sectionId));
4316
4362
  markDirty();
4317
4363
  },
4318
4364
  [sections, setSections, markDirty]
4319
4365
  );
4320
4366
  const moveSectionDown2 = react.useCallback(
4321
4367
  (sectionId) => {
4322
- setSections(chunk7JPLVECA_js.moveSectionDown(sections, sectionId));
4368
+ setSections(chunk7ARD2J6Y_js.moveSectionDown(sections, sectionId));
4323
4369
  markDirty();
4324
4370
  },
4325
4371
  [sections, setSections, markDirty]
4326
4372
  );
4327
4373
  const moveSlidesToSection2 = react.useCallback(
4328
4374
  (slideIndexes, targetSectionId) => {
4329
- const result = chunk7JPLVECA_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4375
+ const result = chunk7ARD2J6Y_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4330
4376
  setSlides(result.slides);
4331
4377
  setSections(result.sections);
4332
4378
  markDirty();
4333
4379
  },
4334
4380
  [sections, slides, setSlides, setSections, markDirty]
4335
4381
  );
4382
+ const toggleSectionCollapse = react.useCallback(
4383
+ (sectionId) => {
4384
+ setSections(
4385
+ (prev) => prev.map((sec) => sec.id === sectionId ? { ...sec, collapsed: !sec.collapsed } : sec)
4386
+ );
4387
+ markDirty();
4388
+ },
4389
+ [setSections, markDirty]
4390
+ );
4336
4391
  return {
4337
4392
  addSection: addSection2,
4338
4393
  renameSection: renameSection2,
4339
4394
  deleteSection: deleteSection2,
4340
4395
  moveSectionUp: moveSectionUp2,
4341
4396
  moveSectionDown: moveSectionDown2,
4342
- moveSlidesToSection: moveSlidesToSection2
4397
+ moveSlidesToSection: moveSlidesToSection2,
4398
+ toggleSectionCollapse
4343
4399
  };
4344
4400
  }
4345
4401
 
4346
4402
  // src/viewer/hooks/pointer-move-handlers.ts
4347
4403
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4348
- const resized = chunk7JPLVECA_js.applyResize(
4404
+ const resized = chunk7ARD2J6Y_js.applyResize(
4349
4405
  { x: startX, y: startY, width: startWidth, height: startHeight },
4350
4406
  handle,
4351
4407
  dx,
4352
4408
  dy,
4353
4409
  1,
4354
- { minSize: chunk5BXATG54_js.MIN_ELEMENT_SIZE }
4410
+ { minSize: chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE }
4355
4411
  );
4356
4412
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4357
4413
  if (!snapToGrid) {
4358
4414
  return box;
4359
4415
  }
4360
- return chunk7JPLVECA_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
4416
+ return chunk7ARD2J6Y_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE);
4361
4417
  }
4362
4418
  function resolveLiveTarget(input) {
4363
4419
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4470,7 +4526,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4470
4526
  width: el.width,
4471
4527
  height: el.height
4472
4528
  }));
4473
- const snapResult = chunk7JPLVECA_js.computeSnapToShape(
4529
+ const snapResult = chunk7ARD2J6Y_js.computeSnapToShape(
4474
4530
  targetX,
4475
4531
  targetY,
4476
4532
  primaryEl.width,
@@ -4509,7 +4565,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4509
4565
  if (live) {
4510
4566
  for (const id of Object.keys(drag.startPositionsById)) {
4511
4567
  const start = drag.startPositionsById[id];
4512
- chunk7JPLVECA_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4568
+ chunk7ARD2J6Y_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4513
4569
  x: start.x + appliedDx,
4514
4570
  y: start.y + appliedDy
4515
4571
  });
@@ -4543,27 +4599,28 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4543
4599
  if (rs.domEl) {
4544
4600
  rs.domEl.style.left = `${geo.x}px`;
4545
4601
  rs.domEl.style.top = `${geo.y}px`;
4546
- rs.domEl.style.width = `${Math.max(geo.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE)}px`;
4547
- rs.domEl.style.height = `${Math.max(geo.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE)}px`;
4602
+ rs.domEl.style.width = `${Math.max(geo.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)}px`;
4603
+ rs.domEl.style.height = `${Math.max(geo.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)}px`;
4548
4604
  }
4549
4605
  if (live) {
4550
- chunk7JPLVECA_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4606
+ chunk7ARD2J6Y_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4551
4607
  x: geo.x,
4552
4608
  y: geo.y,
4553
- width: Math.max(geo.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE),
4554
- height: Math.max(geo.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE)
4609
+ width: Math.max(geo.width, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE),
4610
+ height: Math.max(geo.height, chunkOVPJT4EQ_js.MIN_ELEMENT_SIZE)
4555
4611
  });
4556
4612
  }
4557
4613
  }
4558
4614
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4559
4615
  const dx = (e.clientX - adj.startClientX) / editorScale;
4560
- const newValue = chunk7JPLVECA_js.getDraggedShapeAdjustmentValue(adj, dx);
4561
- if (!adj.moved && Math.abs(dx) > 2) {
4616
+ const dy = (e.clientY - adj.startClientY) / editorScale;
4617
+ const adjustments = chunk7ARD2J6Y_js.getDraggedShapeAdjustments(adj, dx, dy);
4618
+ if (!adj.moved && Math.hypot(dx, dy) > 2) {
4562
4619
  adj.moved = true;
4563
4620
  }
4564
4621
  if (adj.moved) {
4565
4622
  updateElementById(adj.elementId, {
4566
- shapeAdjustments: { [adj.key]: newValue }
4623
+ shapeAdjustments: adjustments
4567
4624
  });
4568
4625
  }
4569
4626
  }
@@ -4632,13 +4689,13 @@ function processPointerUp(input) {
4632
4689
  if (i !== activeSlideIndex) {
4633
4690
  return s;
4634
4691
  }
4635
- const rerouted = chunk7JPLVECA_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4692
+ const rerouted = chunk7ARD2J6Y_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4636
4693
  if (rerouted.length === 0) {
4637
4694
  return s;
4638
4695
  }
4639
4696
  return {
4640
4697
  ...s,
4641
- elements: chunk7JPLVECA_js.applyReroutedConnectors(s.elements, rerouted)
4698
+ elements: chunk7ARD2J6Y_js.applyReroutedConnectors(s.elements, rerouted)
4642
4699
  };
4643
4700
  })
4644
4701
  );
@@ -4663,9 +4720,9 @@ function processPointerUp(input) {
4663
4720
  }
4664
4721
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4665
4722
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4666
- const hitIds = chunk7JPLVECA_js.computeMarqueeHitIds(marquee, sourceElements);
4723
+ const hitIds = chunk7ARD2J6Y_js.computeMarqueeHitIds(marquee, sourceElements);
4667
4724
  if (marquee.additive) {
4668
- const merged = chunk7JPLVECA_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4725
+ const merged = chunk7ARD2J6Y_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4669
4726
  if (merged.length > 0) {
4670
4727
  applySelection(merged[0], merged);
4671
4728
  } else {
@@ -4688,8 +4745,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4688
4745
  }
4689
4746
  return { ...el, x: start.x + dx, y: start.y + dy };
4690
4747
  });
4691
- const rerouted = chunk7JPLVECA_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4692
- return chunk7JPLVECA_js.applyReroutedConnectors(movedElements, rerouted);
4748
+ const rerouted = chunk7ARD2J6Y_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4749
+ return chunk7ARD2J6Y_js.applyReroutedConnectors(movedElements, rerouted);
4693
4750
  };
4694
4751
  if (editTemplateMode) {
4695
4752
  const slideId = activeSlide?.id;
@@ -4846,9 +4903,9 @@ function useCanvasInteractions(input) {
4846
4903
  return;
4847
4904
  }
4848
4905
  const el = elementLookup.get(editId);
4849
- if (el && chunk7JPLVECA_js.hasTextProperties(el)) {
4906
+ if (el && chunk7ARD2J6Y_js.hasTextProperties(el)) {
4850
4907
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
4851
- const newSegments = chunk7JPLVECA_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4908
+ const newSegments = chunk7ARD2J6Y_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4852
4909
  ops.updateElementById(editId, {
4853
4910
  text: committedText,
4854
4911
  textSegments: newSegments
@@ -4859,7 +4916,7 @@ function useCanvasInteractions(input) {
4859
4916
  setInlineEditingText("");
4860
4917
  };
4861
4918
  const openEquationEditorForElement = (el) => {
4862
- if (!chunk7JPLVECA_js.hasTextProperties(el)) {
4919
+ if (!chunk7ARD2J6Y_js.hasTextProperties(el)) {
4863
4920
  return false;
4864
4921
  }
4865
4922
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -4889,7 +4946,7 @@ function useCanvasInteractions(input) {
4889
4946
  justInteractedRef.current = false;
4890
4947
  } else {
4891
4948
  const el = elementLookup.get(elementId);
4892
- if (el && chunk7JPLVECA_js.hasTextProperties(el) && chunk7JPLVECA_js.canInteractWithElement(el, "textEdit")) {
4949
+ if (el && chunk7ARD2J6Y_js.hasTextProperties(el) && chunk7ARD2J6Y_js.canInteractWithElement(el, "textEdit")) {
4893
4950
  if (!openEquationEditorForElement(el)) {
4894
4951
  setInlineEditingElementId(elementId);
4895
4952
  setInlineEditingText(el.text ?? "");
@@ -4908,7 +4965,7 @@ function useCanvasInteractions(input) {
4908
4965
  if (openEquationEditorForElement(el)) {
4909
4966
  return;
4910
4967
  }
4911
- if (chunk7JPLVECA_js.hasTextProperties(el) && chunk7JPLVECA_js.canInteractWithElement(el, "textEdit")) {
4968
+ if (chunk7ARD2J6Y_js.hasTextProperties(el) && chunk7ARD2J6Y_js.canInteractWithElement(el, "textEdit")) {
4912
4969
  setInlineEditingElementId(elementId);
4913
4970
  setInlineEditingText(el.text ?? "");
4914
4971
  }
@@ -4931,7 +4988,7 @@ function useCanvasInteractions(input) {
4931
4988
  justSelectedRef.current = false;
4932
4989
  }
4933
4990
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
4934
- const movableIds = chunk7JPLVECA_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4991
+ const movableIds = chunk7ARD2J6Y_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4935
4992
  if (movableIds.length === 0) {
4936
4993
  return;
4937
4994
  }
@@ -5001,7 +5058,7 @@ function useCanvasInteractions(input) {
5001
5058
  const handleResizePointerDown = (elementId, e, handle) => {
5002
5059
  e.stopPropagation();
5003
5060
  const el = elementLookup.get(elementId);
5004
- if (!el || !chunk7JPLVECA_js.canInteractWithElement(el, "resize")) {
5061
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "resize")) {
5005
5062
  return;
5006
5063
  }
5007
5064
  resizeStateRef.current = {
@@ -5023,7 +5080,7 @@ function useCanvasInteractions(input) {
5023
5080
  };
5024
5081
  const handleRotate = (elementId, rotationDeg) => {
5025
5082
  const el = elementLookup.get(elementId);
5026
- if (!el || !chunk7JPLVECA_js.canInteractWithElement(el, "rotate")) {
5083
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "rotate")) {
5027
5084
  return;
5028
5085
  }
5029
5086
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -5040,33 +5097,18 @@ function useCanvasInteractions(input) {
5040
5097
  const handleFormatText = (updates) => {
5041
5098
  ops.updateSelectedTextStyle(updates);
5042
5099
  };
5043
- const handleAdjustmentPointerDown = (elementId, e) => {
5100
+ const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
5044
5101
  e.stopPropagation();
5045
5102
  const el = elementLookup.get(elementId);
5046
- if (!el || !("shapeType" in el) || !("shapeAdjustments" in el)) {
5047
- return;
5048
- }
5049
- if (!chunk7JPLVECA_js.canInteractWithElement(el, "adjustHandle")) {
5103
+ if (!el || !chunk7ARD2J6Y_js.canInteractWithElement(el, "adjustHandle")) {
5050
5104
  return;
5051
5105
  }
5052
- const adjEntries = Object.entries(
5053
- el.shapeAdjustments ?? {}
5106
+ shapeAdjustmentDragStateRef.current = chunk7ARD2J6Y_js.beginShapeAdjustment(
5107
+ el,
5108
+ descriptor,
5109
+ e.clientX,
5110
+ e.clientY
5054
5111
  );
5055
- if (!adjEntries.length) {
5056
- return;
5057
- }
5058
- const [key, value] = adjEntries[0];
5059
- shapeAdjustmentDragStateRef.current = {
5060
- elementId,
5061
- key,
5062
- shapeType: el.shapeType ?? "rect",
5063
- startClientX: e.clientX,
5064
- startClientY: e.clientY,
5065
- startAdjustment: value,
5066
- startWidth: el.width,
5067
- startHeight: el.height,
5068
- moved: false
5069
- };
5070
5112
  };
5071
5113
  return {
5072
5114
  handleElementClick,
@@ -5108,7 +5150,7 @@ function createFileHandlers(deps) {
5108
5150
  h = Math.round(h * scale);
5109
5151
  }
5110
5152
  addElement({
5111
- id: chunk7JPLVECA_js.generateElementId(),
5153
+ id: chunk7ARD2J6Y_js.generateElementId(),
5112
5154
  type: "image",
5113
5155
  x: Math.round((canvasSize.width - w) / 2),
5114
5156
  y: Math.round((canvasSize.height - h) / 2),
@@ -5119,7 +5161,7 @@ function createFileHandlers(deps) {
5119
5161
  };
5120
5162
  img.onerror = () => {
5121
5163
  addElement({
5122
- id: chunk7JPLVECA_js.generateElementId(),
5164
+ id: chunk7ARD2J6Y_js.generateElementId(),
5123
5165
  type: "image",
5124
5166
  x: 100,
5125
5167
  y: 100,
@@ -5145,7 +5187,7 @@ function createFileHandlers(deps) {
5145
5187
  const elFilePath = file.path;
5146
5188
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5147
5189
  addElement({
5148
- id: chunk7JPLVECA_js.generateElementId(),
5190
+ id: chunk7ARD2J6Y_js.generateElementId(),
5149
5191
  type: "media",
5150
5192
  mediaType,
5151
5193
  mediaMimeType: file.type || void 0,
@@ -5320,13 +5362,13 @@ function createStructuredElementHandlers(deps) {
5320
5362
  return;
5321
5363
  }
5322
5364
  addElement({
5323
- id: chunk7JPLVECA_js.generateElementId(),
5365
+ id: chunk7ARD2J6Y_js.generateElementId(),
5324
5366
  type: "smartArt",
5325
5367
  x: 100,
5326
5368
  y: 120,
5327
5369
  width: 600,
5328
5370
  height: 340,
5329
- smartArtData: chunk7JPLVECA_js.buildSmartArtPresetData(
5371
+ smartArtData: chunk7ARD2J6Y_js.buildSmartArtPresetData(
5330
5372
  layout,
5331
5373
  defaultItems,
5332
5374
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5338,7 +5380,7 @@ function createStructuredElementHandlers(deps) {
5338
5380
  return;
5339
5381
  }
5340
5382
  addElement({
5341
- id: chunk7JPLVECA_js.generateElementId(),
5383
+ id: chunk7ARD2J6Y_js.generateElementId(),
5342
5384
  type: "shape",
5343
5385
  x: 120,
5344
5386
  y: 200,
@@ -5397,7 +5439,7 @@ function createStructuredElementHandlers(deps) {
5397
5439
  const displayText = value || fieldTexts[fieldType] || fieldType;
5398
5440
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5399
5441
  addElement({
5400
- id: chunk7JPLVECA_js.generateElementId(),
5442
+ id: chunk7ARD2J6Y_js.generateElementId(),
5401
5443
  type: "shape",
5402
5444
  x: 120,
5403
5445
  y: 200,
@@ -5419,11 +5461,11 @@ function createStructuredElementHandlers(deps) {
5419
5461
  if (!activeSlide) {
5420
5462
  return;
5421
5463
  }
5422
- const preset = chunk7JPLVECA_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5464
+ const preset = chunk7ARD2J6Y_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5423
5465
  if (!preset) {
5424
5466
  return;
5425
5467
  }
5426
- const defaultPptxAction = chunk7JPLVECA_js.elementActionToPptxAction({
5468
+ const defaultPptxAction = chunk7ARD2J6Y_js.elementActionToPptxAction({
5427
5469
  trigger: "click",
5428
5470
  type: preset.defaultAction
5429
5471
  });
@@ -5432,7 +5474,7 @@ function createStructuredElementHandlers(deps) {
5432
5474
  defaultPptxAction.highlightClick = true;
5433
5475
  }
5434
5476
  addElement({
5435
- id: chunk7JPLVECA_js.generateElementId(),
5477
+ id: chunk7ARD2J6Y_js.generateElementId(),
5436
5478
  type: "shape",
5437
5479
  x: 150,
5438
5480
  y: 150,
@@ -5499,14 +5541,14 @@ function useInsertElements(input) {
5499
5541
  return;
5500
5542
  }
5501
5543
  addElement({
5502
- id: chunk7JPLVECA_js.generateElementId(),
5544
+ id: chunk7ARD2J6Y_js.generateElementId(),
5503
5545
  type: "text",
5504
5546
  x: 100,
5505
5547
  y: 100,
5506
5548
  width: 300,
5507
5549
  height: 60,
5508
5550
  text: "",
5509
- textStyle: { fontSize: chunk5BXATG54_js.DEFAULT_TEXT_FONT_SIZE }
5551
+ textStyle: { fontSize: chunkOVPJT4EQ_js.DEFAULT_TEXT_FONT_SIZE }
5510
5552
  });
5511
5553
  };
5512
5554
  const handleAddShape = () => {
@@ -5514,7 +5556,7 @@ function useInsertElements(input) {
5514
5556
  return;
5515
5557
  }
5516
5558
  addElement({
5517
- id: chunk7JPLVECA_js.generateElementId(),
5559
+ id: chunk7ARD2J6Y_js.generateElementId(),
5518
5560
  type: "shape",
5519
5561
  x: 150,
5520
5562
  y: 150,
@@ -5533,15 +5575,15 @@ function useInsertElements(input) {
5533
5575
  return;
5534
5576
  }
5535
5577
  addElement({
5536
- ...chunk7JPLVECA_js.newTableElement(chunk5BXATG54_js.DEFAULT_TABLE_ROWS, chunk5BXATG54_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5537
- id: chunk7JPLVECA_js.generateElementId()
5578
+ ...chunk7ARD2J6Y_js.newTableElement(chunkOVPJT4EQ_js.DEFAULT_TABLE_ROWS, chunkOVPJT4EQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5579
+ id: chunk7ARD2J6Y_js.generateElementId()
5538
5580
  });
5539
5581
  };
5540
5582
  const handleAddChart = (chartKind) => {
5541
5583
  if (!activeSlide) {
5542
5584
  return;
5543
5585
  }
5544
- addElement(chunk7JPLVECA_js.createDefaultChartElement(chartKind));
5586
+ addElement(chunk7ARD2J6Y_js.createDefaultChartElement(chartKind));
5545
5587
  };
5546
5588
  const structured = createStructuredElementHandlers({
5547
5589
  activeSlide,
@@ -5611,7 +5653,7 @@ function useClipboardHandlers(input) {
5611
5653
  if (!selectedElement) {
5612
5654
  return;
5613
5655
  }
5614
- setClipboardPayload(chunk7JPLVECA_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5656
+ setClipboardPayload(chunk7ARD2J6Y_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5615
5657
  };
5616
5658
  const handleDelete = () => {
5617
5659
  const idsToDelete = effectiveSelectedIds;
@@ -5628,7 +5670,7 @@ function useClipboardHandlers(input) {
5628
5670
  handleDelete();
5629
5671
  };
5630
5672
  const insertClone = (source) => {
5631
- const clone = chunk7JPLVECA_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5673
+ const clone = chunk7ARD2J6Y_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5632
5674
  ops.updateActiveElements((els) => [...els, clone]);
5633
5675
  ops.applySelection(clone.id);
5634
5676
  history.markDirty();
@@ -5663,7 +5705,7 @@ function resolveShapePath(el) {
5663
5705
  return el.pathData;
5664
5706
  }
5665
5707
  if ("shapeType" in el && typeof el.shapeType === "string") {
5666
- const clipPath = chunk7JPLVECA_js.getPresetShapeClipPath(el.shapeType);
5708
+ const clipPath = chunk7ARD2J6Y_js.getPresetShapeClipPath(el.shapeType);
5667
5709
  if (clipPath) {
5668
5710
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5669
5711
  if (svgPath) {
@@ -5714,7 +5756,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5714
5756
  return parts.join(" ");
5715
5757
  }
5716
5758
  function transformPathToGlobal(pathData, el) {
5717
- const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5759
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5718
5760
  if (polys.length === 0) {
5719
5761
  return pathData;
5720
5762
  }
@@ -5734,10 +5776,10 @@ function transformPathToGlobal(pathData, el) {
5734
5776
  y: pt.y * scaleY + el.y
5735
5777
  }))
5736
5778
  );
5737
- return chunk7JPLVECA_js.polygonsToSvgPath(transformed);
5779
+ return chunk7ARD2J6Y_js.polygonsToSvgPath(transformed);
5738
5780
  }
5739
5781
  function transformPathToLocal(pathData, x, y, _width, _height) {
5740
- const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5782
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5741
5783
  if (polys.length === 0) {
5742
5784
  return pathData;
5743
5785
  }
@@ -5747,10 +5789,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5747
5789
  y: pt.y - y
5748
5790
  }))
5749
5791
  );
5750
- return chunk7JPLVECA_js.polygonsToSvgPath(transformed);
5792
+ return chunk7ARD2J6Y_js.polygonsToSvgPath(transformed);
5751
5793
  }
5752
5794
  function pathBounds(pathData) {
5753
- const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5795
+ const polys = chunk7ARD2J6Y_js.svgPathToPolygons(pathData);
5754
5796
  let minX = Infinity;
5755
5797
  let minY = Infinity;
5756
5798
  let maxX = -Infinity;
@@ -5809,7 +5851,7 @@ function useMergeShapesHandler(input) {
5809
5851
  let allFragments = [];
5810
5852
  let remaining = globalPaths[0];
5811
5853
  for (let i = 1; i < globalPaths.length; i++) {
5812
- const frags = chunk7JPLVECA_js.mergeShapes("fragment", remaining, globalPaths[i]);
5854
+ const frags = chunk7ARD2J6Y_js.mergeShapes("fragment", remaining, globalPaths[i]);
5813
5855
  if (Array.isArray(frags)) {
5814
5856
  allFragments = frags;
5815
5857
  }
@@ -5838,7 +5880,7 @@ function useMergeShapesHandler(input) {
5838
5880
  bounds.height
5839
5881
  );
5840
5882
  const newEl = {
5841
- id: chunk7JPLVECA_js.generateElementId(),
5883
+ id: chunk7ARD2J6Y_js.generateElementId(),
5842
5884
  type: "shape",
5843
5885
  x: bounds.x,
5844
5886
  y: bounds.y,
@@ -5876,7 +5918,7 @@ function useMergeShapesHandler(input) {
5876
5918
  } else {
5877
5919
  let resultPath = globalPaths[0];
5878
5920
  for (let i = 1; i < globalPaths.length; i++) {
5879
- const result = chunk7JPLVECA_js.mergeShapes(operation, resultPath, globalPaths[i]);
5921
+ const result = chunk7ARD2J6Y_js.mergeShapes(operation, resultPath, globalPaths[i]);
5880
5922
  if (typeof result === "string") {
5881
5923
  resultPath = result;
5882
5924
  }
@@ -5897,7 +5939,7 @@ function useMergeShapesHandler(input) {
5897
5939
  );
5898
5940
  const primary = targets[0];
5899
5941
  const newEl = {
5900
- id: chunk7JPLVECA_js.generateElementId(),
5942
+ id: chunk7ARD2J6Y_js.generateElementId(),
5901
5943
  type: "shape",
5902
5944
  x: bounds.x,
5903
5945
  y: bounds.y,
@@ -5960,7 +6002,7 @@ function useGroupAlignLayerHandlers(input) {
5960
6002
  if (ids.length < 2 || !activeSlide) {
5961
6003
  return;
5962
6004
  }
5963
- const { elements, groupId } = chunk7JPLVECA_js.groupElements(ops.activeElements, ids, chunk7JPLVECA_js.generateElementId());
6005
+ const { elements, groupId } = chunk7ARD2J6Y_js.groupElements(ops.activeElements, ids, chunk7ARD2J6Y_js.generateElementId());
5964
6006
  if (groupId === null) {
5965
6007
  return;
5966
6008
  }
@@ -5973,11 +6015,11 @@ function useGroupAlignLayerHandlers(input) {
5973
6015
  return;
5974
6016
  }
5975
6017
  const group = selectedElement;
5976
- const intoTemplate = chunk7JPLVECA_js.isTemplateElementId(group.id);
6018
+ const intoTemplate = chunk7ARD2J6Y_js.isTemplateElementId(group.id);
5977
6019
  const childIds = group.children.map(
5978
- (child) => intoTemplate ? chunk7JPLVECA_js.makeCloneId(true, child.id || group.id) : child.id || chunk7JPLVECA_js.generateElementId()
6020
+ (child) => intoTemplate ? chunk7ARD2J6Y_js.makeCloneId(true, child.id || group.id) : child.id || chunk7ARD2J6Y_js.generateElementId()
5979
6021
  );
5980
- const { elements, childIds: usedIds } = chunk7JPLVECA_js.ungroupElements(
6022
+ const { elements, childIds: usedIds } = chunk7ARD2J6Y_js.ungroupElements(
5981
6023
  ops.activeElements,
5982
6024
  group.id,
5983
6025
  childIds,
@@ -6006,7 +6048,7 @@ function useGroupAlignLayerHandlers(input) {
6006
6048
  if (!edge) {
6007
6049
  return;
6008
6050
  }
6009
- const positions = chunk7JPLVECA_js.alignElements(selectedElements, edge);
6051
+ const positions = chunk7ARD2J6Y_js.alignElements(selectedElements, edge);
6010
6052
  for (const [id, pos] of positions) {
6011
6053
  const el = elementLookup.get(id);
6012
6054
  if (!el) {
@@ -6024,7 +6066,7 @@ function useGroupAlignLayerHandlers(input) {
6024
6066
  if (!distAxis) {
6025
6067
  return;
6026
6068
  }
6027
- const positions = chunk7JPLVECA_js.distributeElements(selectedElements, distAxis);
6069
+ const positions = chunk7ARD2J6Y_js.distributeElements(selectedElements, distAxis);
6028
6070
  for (const [id, pos] of positions) {
6029
6071
  const el = elementLookup.get(id);
6030
6072
  if (!el) {
@@ -6041,7 +6083,7 @@ function useGroupAlignLayerHandlers(input) {
6041
6083
  }
6042
6084
  const id = selectedElement.id;
6043
6085
  ops.updateActiveElements(
6044
- (els) => direction === "forward" ? chunk7JPLVECA_js.bringForward(els, id) : direction === "backward" ? chunk7JPLVECA_js.sendBackward(els, id) : els
6086
+ (els) => direction === "forward" ? chunk7ARD2J6Y_js.bringForward(els, id) : direction === "backward" ? chunk7ARD2J6Y_js.sendBackward(els, id) : els
6045
6087
  );
6046
6088
  history.markDirty();
6047
6089
  };
@@ -6051,7 +6093,7 @@ function useGroupAlignLayerHandlers(input) {
6051
6093
  }
6052
6094
  const id = selectedElement.id;
6053
6095
  ops.updateActiveElements(
6054
- (els) => direction === "front" ? chunk7JPLVECA_js.bringToFront(els, id) : chunk7JPLVECA_js.sendToBack(els, id)
6096
+ (els) => direction === "front" ? chunk7ARD2J6Y_js.bringToFront(els, id) : chunk7ARD2J6Y_js.sendToBack(els, id)
6055
6097
  );
6056
6098
  history.markDirty();
6057
6099
  };
@@ -6182,7 +6224,7 @@ function useSlideManagement(input) {
6182
6224
  theme
6183
6225
  } = input;
6184
6226
  const handleAddSlide = () => {
6185
- const newSlide = chunk7JPLVECA_js.createBlankSlide(slides.length + 1);
6227
+ const newSlide = chunk7ARD2J6Y_js.createBlankSlide(slides.length + 1);
6186
6228
  ops.updateSlides((prev) => {
6187
6229
  const next = [...prev];
6188
6230
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6245,7 +6287,7 @@ function useSlideManagement(input) {
6245
6287
  }
6246
6288
  const clone = {
6247
6289
  ...src,
6248
- id: chunk7JPLVECA_js.makeSlideId(),
6290
+ id: chunk7ARD2J6Y_js.makeSlideId(),
6249
6291
  elements: src.elements.map((el) => ({
6250
6292
  ...el,
6251
6293
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6277,7 +6319,7 @@ function useSlideManagement(input) {
6277
6319
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6278
6320
  const insertAt = activeSlideIndex + 1;
6279
6321
  const draft = {
6280
- ...chunk7JPLVECA_js.createBlankSlide(slides.length + 1),
6322
+ ...chunk7ARD2J6Y_js.createBlankSlide(slides.length + 1),
6281
6323
  layoutPath,
6282
6324
  ...layoutName ? { layoutName } : {}
6283
6325
  };
@@ -6310,9 +6352,9 @@ function useSlideManagement(input) {
6310
6352
  };
6311
6353
  const handleInsertSlideFromTemplate = (templateId) => {
6312
6354
  const insertAt = activeSlideIndex + 1;
6313
- const draft = chunk7JPLVECA_js.buildSlideTemplateSlide(templateId, chunk7JPLVECA_js.makeSlideId(), slides.length + 1, {
6355
+ const draft = chunk7ARD2J6Y_js.buildSlideTemplateSlide(templateId, chunk7ARD2J6Y_js.makeSlideId(), slides.length + 1, {
6314
6356
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6315
- scheme: chunk7JPLVECA_js.templateSchemeFromTheme(theme?.colorScheme)
6357
+ scheme: chunk7ARD2J6Y_js.templateSchemeFromTheme(theme?.colorScheme)
6316
6358
  });
6317
6359
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6318
6360
  setActiveSlideIndex(insertAt);
@@ -6349,7 +6391,7 @@ function createTableMergeHandlers(input) {
6349
6391
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6350
6392
  return;
6351
6393
  }
6352
- const newTableData = chunk7JPLVECA_js.mergeCells(
6394
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(
6353
6395
  [
6354
6396
  { row: rowIndex, col: columnIndex },
6355
6397
  { row: rowIndex, col: nextColIdx }
@@ -6357,7 +6399,7 @@ function createTableMergeHandlers(input) {
6357
6399
  td
6358
6400
  );
6359
6401
  const updates = { tableData: newTableData };
6360
- const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6402
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6361
6403
  if (newRawXml) {
6362
6404
  updates.rawXml = newRawXml;
6363
6405
  }
@@ -6383,7 +6425,7 @@ function createTableMergeHandlers(input) {
6383
6425
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6384
6426
  return;
6385
6427
  }
6386
- const newTableData = chunk7JPLVECA_js.mergeCells(
6428
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(
6387
6429
  [
6388
6430
  { row: rowIndex, col: columnIndex },
6389
6431
  { row: targetNextRowIdx, col: columnIndex }
@@ -6391,7 +6433,7 @@ function createTableMergeHandlers(input) {
6391
6433
  td
6392
6434
  );
6393
6435
  const updates = { tableData: newTableData };
6394
- const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6436
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6395
6437
  if (newRawXml) {
6396
6438
  updates.rawXml = newRawXml;
6397
6439
  }
@@ -6406,9 +6448,9 @@ function createTableMergeHandlers(input) {
6406
6448
  return;
6407
6449
  }
6408
6450
  const td = selectedElement.tableData;
6409
- const newTableData = chunk7JPLVECA_js.mergeCells(ts.selectedCells, td);
6451
+ const newTableData = chunk7ARD2J6Y_js.mergeCells(ts.selectedCells, td);
6410
6452
  const updates = { tableData: newTableData };
6411
- const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6453
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6412
6454
  if (newRawXml) {
6413
6455
  updates.rawXml = newRawXml;
6414
6456
  }
@@ -6425,9 +6467,9 @@ function createTableMergeHandlers(input) {
6425
6467
  }
6426
6468
  const { rowIndex, columnIndex } = ts;
6427
6469
  const td = selectedElement.tableData;
6428
- const newTableData = chunk7JPLVECA_js.splitCell(rowIndex, columnIndex, td);
6470
+ const newTableData = chunk7ARD2J6Y_js.splitCell(rowIndex, columnIndex, td);
6429
6471
  const updates = { tableData: newTableData };
6430
- const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6472
+ const newRawXml = chunk7ARD2J6Y_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6431
6473
  if (newRawXml) {
6432
6474
  updates.rawXml = newRawXml;
6433
6475
  }
@@ -6471,7 +6513,7 @@ function createTableStructHandlers(input) {
6471
6513
  updates.tableData = { ...el.tableData, rows: newRows };
6472
6514
  }
6473
6515
  if (el.rawXml) {
6474
- const newRawXml = chunk7JPLVECA_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6516
+ const newRawXml = chunk7ARD2J6Y_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6475
6517
  if (newRawXml) {
6476
6518
  updates.rawXml = newRawXml;
6477
6519
  }
@@ -6495,7 +6537,7 @@ function createTableStructHandlers(input) {
6495
6537
  const { rowIndex, columnIndex: colIndex } = ts;
6496
6538
  const updates = {};
6497
6539
  if (selectedElement.rawXml) {
6498
- const newRawXml = chunk7JPLVECA_js.updateCellTextStyleInRawXml(
6540
+ const newRawXml = chunk7ARD2J6Y_js.updateCellTextStyleInRawXml(
6499
6541
  selectedElement,
6500
6542
  rowIndex,
6501
6543
  colIndex,
@@ -6559,9 +6601,9 @@ function createTableStructHandlers(input) {
6559
6601
  return;
6560
6602
  }
6561
6603
  const rowIdx = ts?.rowIndex ?? 0;
6562
- const newTableData = chunk7JPLVECA_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6604
+ const newTableData = chunk7ARD2J6Y_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6563
6605
  const updates = { tableData: newTableData };
6564
- const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6606
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6565
6607
  if (newRawXml) {
6566
6608
  updates.rawXml = newRawXml;
6567
6609
  }
@@ -6574,12 +6616,12 @@ function createTableStructHandlers(input) {
6574
6616
  }
6575
6617
  const td = selectedElement.tableData;
6576
6618
  const rowIdx = ts?.rowIndex ?? 0;
6577
- const newTableData = chunk7JPLVECA_js.deleteTableRow(td, rowIdx);
6619
+ const newTableData = chunk7ARD2J6Y_js.deleteTableRow(td, rowIdx);
6578
6620
  if (newTableData === td) {
6579
6621
  return;
6580
6622
  }
6581
6623
  const updates = { tableData: newTableData };
6582
- const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6624
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6583
6625
  if (newRawXml) {
6584
6626
  updates.rawXml = newRawXml;
6585
6627
  }
@@ -6591,9 +6633,9 @@ function createTableStructHandlers(input) {
6591
6633
  return;
6592
6634
  }
6593
6635
  const colIdx = ts?.columnIndex ?? 0;
6594
- const newTableData = chunk7JPLVECA_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6636
+ const newTableData = chunk7ARD2J6Y_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6595
6637
  const updates = { tableData: newTableData };
6596
- const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6638
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6597
6639
  if (newRawXml) {
6598
6640
  updates.rawXml = newRawXml;
6599
6641
  }
@@ -6606,12 +6648,12 @@ function createTableStructHandlers(input) {
6606
6648
  }
6607
6649
  const td = selectedElement.tableData;
6608
6650
  const colIdx = ts?.columnIndex ?? 0;
6609
- const newTableData = chunk7JPLVECA_js.deleteTableColumn(td, colIdx);
6651
+ const newTableData = chunk7ARD2J6Y_js.deleteTableColumn(td, colIdx);
6610
6652
  if (newTableData === td) {
6611
6653
  return;
6612
6654
  }
6613
6655
  const updates = { tableData: newTableData };
6614
- const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6656
+ const newRawXml = chunk7ARD2J6Y_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6615
6657
  if (newRawXml) {
6616
6658
  updates.rawXml = newRawXml;
6617
6659
  }
@@ -6647,8 +6689,8 @@ async function renderToCanvas(element, options = {}) {
6647
6689
  return html2canvasPro(element, {
6648
6690
  ...options,
6649
6691
  onclone: async (doc, clonedEl) => {
6650
- await chunk7JPLVECA_js.normalizeColorsForCapture(doc, clonedEl);
6651
- chunk7JPLVECA_js.preprocessCssForCapture(clonedEl);
6692
+ await chunk7ARD2J6Y_js.normalizeColorsForCapture(doc, clonedEl);
6693
+ chunk7ARD2J6Y_js.preprocessCssForCapture(clonedEl);
6652
6694
  if (typeof userOnClone === "function") {
6653
6695
  userOnClone(doc, clonedEl);
6654
6696
  }
@@ -6704,7 +6746,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
6704
6746
  }
6705
6747
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
6706
6748
  const blob = await exportSlideToPngBlob(slideElement, options);
6707
- chunk7JPLVECA_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6749
+ chunk7ARD2J6Y_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6708
6750
  }
6709
6751
  async function copySlideToClipboard(slideElement, options = {}) {
6710
6752
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -6726,15 +6768,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
6726
6768
  continue;
6727
6769
  }
6728
6770
  const canvas = await renderElementToCanvas(stageEl, scale);
6729
- images.push(chunk7JPLVECA_js.canvasToJpegData(canvas));
6771
+ images.push(chunk7ARD2J6Y_js.canvasToJpegData(canvas));
6730
6772
  }
6731
6773
  onProgress?.(totalSlides, totalSlides);
6732
6774
  setActiveSlide(currentSlideIndex);
6733
6775
  if (images.length === 0) {
6734
- throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6776
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6735
6777
  }
6736
- const pdfBlobUrl = chunk5BXATG54_js.buildPdfFromImageData(images);
6737
- chunk7JPLVECA_js.downloadDataUrl(pdfBlobUrl, filename);
6778
+ const pdfBlobUrl = chunkOVPJT4EQ_js.buildPdfFromImageData(images);
6779
+ chunk7ARD2J6Y_js.downloadDataUrl(pdfBlobUrl, filename);
6738
6780
  }
6739
6781
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
6740
6782
  const { scale = 2, onProgress } = options;
@@ -6780,10 +6822,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
6780
6822
  onProgress?.(totalSlides, totalSlides);
6781
6823
  setActiveSlide(currentSlideIndex);
6782
6824
  if (pages.length === 0) {
6783
- throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6825
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6784
6826
  }
6785
- const pdfDataUrl = chunk5BXATG54_js.buildNotesPdf(pages);
6786
- chunk7JPLVECA_js.downloadDataUrl(pdfDataUrl, filename);
6827
+ const pdfDataUrl = chunkOVPJT4EQ_js.buildNotesPdf(pages);
6828
+ chunk7ARD2J6Y_js.downloadDataUrl(pdfDataUrl, filename);
6787
6829
  }
6788
6830
 
6789
6831
  // src/viewer/utils/export-video.ts
@@ -6814,7 +6856,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6814
6856
  }
6815
6857
  setActiveSlide(currentSlideIndex);
6816
6858
  if (slideCanvases.length === 0) {
6817
- throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6859
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6818
6860
  }
6819
6861
  const firstCanvas = slideCanvases[0];
6820
6862
  const recordingCanvas = document.createElement("canvas");
@@ -6822,12 +6864,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6822
6864
  recordingCanvas.height = firstCanvas.height;
6823
6865
  const ctx = recordingCanvas.getContext("2d");
6824
6866
  if (!ctx) {
6825
- throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNo2dContext"]);
6867
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNo2dContext"]);
6826
6868
  }
6827
6869
  const fps = 30;
6828
6870
  const stream = recordingCanvas.captureStream(fps);
6829
6871
  const recorder = new MediaRecorder(stream, {
6830
- mimeType: chunk7JPLVECA_js.pickSupportedMimeType([...chunk7JPLVECA_js.WEBM_MIME_CANDIDATES]),
6872
+ mimeType: chunk7ARD2J6Y_js.pickSupportedMimeType([...chunk7ARD2J6Y_js.WEBM_MIME_CANDIDATES]),
6831
6873
  videoBitsPerSecond: 5e6
6832
6874
  });
6833
6875
  const chunks = [];
@@ -6850,8 +6892,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6850
6892
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
6851
6893
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
6852
6894
  ctx.drawImage(slideCanvases[i], 0, 0);
6853
- const frameInterval = chunk7JPLVECA_js.fpsToFrameIntervalMs(fps);
6854
- const framesNeeded = chunk7JPLVECA_js.segmentFrameCount(duration, fps);
6895
+ const frameInterval = chunk7ARD2J6Y_js.fpsToFrameIntervalMs(fps);
6896
+ const framesNeeded = chunk7ARD2J6Y_js.segmentFrameCount(duration, fps);
6855
6897
  for (let f = 0; f < framesNeeded; f++) {
6856
6898
  if (signal?.aborted) {
6857
6899
  recorder.stop();
@@ -6898,9 +6940,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
6898
6940
  }
6899
6941
  setActiveSlide(currentSlideIndex);
6900
6942
  if (frames.length === 0) {
6901
- throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6943
+ throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6902
6944
  }
6903
- const gifBytes = chunk7JPLVECA_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6945
+ const gifBytes = chunk7ARD2J6Y_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6904
6946
  onProgress?.(totalSlides, totalSlides);
6905
6947
  const buf = new ArrayBuffer(gifBytes.length);
6906
6948
  new Uint8Array(buf).set(gifBytes);
@@ -6954,7 +6996,7 @@ function exportAllSlidesToSvg(data, options = {}) {
6954
6996
  continue;
6955
6997
  }
6956
6998
  onProgress?.(processedCount, data.slides.length);
6957
- let svg = chunk7JPLVECA_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6999
+ let svg = chunk7ARD2J6Y_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6958
7000
  if (embedFonts && fontFaces?.length) {
6959
7001
  svg = injectFontFaces(svg, fontFaces);
6960
7002
  }
@@ -6981,12 +7023,14 @@ function useExportSaveAs(input) {
6981
7023
  appProperties,
6982
7024
  customProperties,
6983
7025
  tagCollections,
7026
+ slideMasters,
6984
7027
  notesMaster,
6985
7028
  handoutMaster,
6986
7029
  guides,
6987
7030
  activeSlideIndexForGuides,
6988
7031
  theme,
6989
7032
  canvasSize,
7033
+ slideSizeEmu,
6990
7034
  modalControls,
6991
7035
  password
6992
7036
  } = input;
@@ -7010,13 +7054,13 @@ function useExportSaveAs(input) {
7010
7054
  setExportProgress(10);
7011
7055
  setExportStatusMessage("Adding presentation...");
7012
7056
  const pptxData = await serializeSlides();
7013
- const pptxFilename = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() ?? "presentation.pptx" : "presentation.pptx";
7057
+ const pptxFilename = chunk7ARD2J6Y_js.savedPresentationFileName(filePath);
7014
7058
  if (pptxData) {
7015
7059
  pkgFolder.file(pptxFilename, pptxData);
7016
7060
  }
7017
7061
  setExportProgress(70);
7018
7062
  setExportStatusMessage("Writing README...");
7019
- const readme = chunk7JPLVECA_js.generatePackageReadme(pptxFilename);
7063
+ const readme = chunk7ARD2J6Y_js.generatePackageReadme(pptxFilename);
7020
7064
  pkgFolder.file("README.txt", readme);
7021
7065
  if (abortCtrl.signal.aborted) {
7022
7066
  throw new DOMException("Export cancelled", "AbortError");
@@ -7026,8 +7070,7 @@ function useExportSaveAs(input) {
7026
7070
  const zipBlob = await zip.generateAsync({ type: "blob" });
7027
7071
  setExportProgress(95);
7028
7072
  setExportStatusMessage("Downloading...");
7029
- const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
7030
- chunk7JPLVECA_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
7073
+ chunk7ARD2J6Y_js.downloadBlob(zipBlob, `${chunk7ARD2J6Y_js.presentationBaseName(pptxFilename)}-package.zip`);
7031
7074
  setExportProgress(100);
7032
7075
  } catch (err) {
7033
7076
  if (err.name !== "AbortError") {
@@ -7043,16 +7086,15 @@ function useExportSaveAs(input) {
7043
7086
  if (!handler) {
7044
7087
  return;
7045
7088
  }
7046
- const ext = format === "ppsx" ? "ppsx" : format === "pptm" ? "pptm" : "pptx";
7047
- const baseName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop()?.replace(/\.[^.]+$/u, "") ?? "presentation" : "presentation";
7089
+ const downloadName = chunk7ARD2J6Y_js.savedPresentationFileName(filePath, format);
7048
7090
  try {
7049
7091
  const data = await buildSaveAsData(handler, format);
7050
7092
  const blob = new Blob([data], {
7051
7093
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
7052
7094
  });
7053
- chunk7JPLVECA_js.downloadBlob(blob, `${baseName}.${ext}`);
7095
+ chunk7ARD2J6Y_js.downloadBlob(blob, downloadName);
7054
7096
  } catch (err) {
7055
- console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
7097
+ console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
7056
7098
  }
7057
7099
  };
7058
7100
  const buildSaveAsData = async (handler, format) => {
@@ -7063,15 +7105,18 @@ function useExportSaveAs(input) {
7063
7105
  const pptxGuides = guides.map((g) => ({
7064
7106
  id: g.id,
7065
7107
  orientation: g.axis === "h" ? "horz" : "vert",
7066
- positionEmu: chunk7JPLVECA_js.guidePxToEmu(g.position)
7108
+ positionEmu: chunk7ARD2J6Y_js.guidePxToEmu(g.position)
7067
7109
  }));
7068
7110
  return {
7069
7111
  ...slide,
7070
7112
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
7071
7113
  };
7072
7114
  });
7073
- const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7115
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7074
7116
  const saveOptions = {
7117
+ // Save As shares Save's slide-size decision; leaving it out here is how
7118
+ // a preset picked in the inspector reached one save path and not the other.
7119
+ slideSize: chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
7075
7120
  headerFooter,
7076
7121
  presentationProperties,
7077
7122
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -7080,20 +7125,23 @@ function useExportSaveAs(input) {
7080
7125
  appProperties: appProperties ?? void 0,
7081
7126
  customProperties: customProperties.length > 0 ? customProperties : void 0,
7082
7127
  tags: tagCollections.length > 0 ? tagCollections : void 0,
7128
+ slideMasters,
7083
7129
  notesMaster,
7084
7130
  handoutMaster,
7085
7131
  outputFormat: format
7086
7132
  };
7087
- return chunk7JPLVECA_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7133
+ return chunk7ARD2J6Y_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7088
7134
  };
7089
7135
  const handleExportJson = () => {
7090
7136
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7137
+ const slideSize = chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7091
7138
  const data = {
7092
- slides: chunk7JPLVECA_js.buildSaveSlides(slides, templateElementsBySlideId),
7139
+ slides: chunk7ARD2J6Y_js.buildSaveSlides(slides, templateElementsBySlideId),
7093
7140
  width: canvasSize.width,
7094
7141
  height: canvasSize.height,
7095
- widthEmu: chunk7JPLVECA_js.guidePxToEmu(canvasSize.width),
7096
- heightEmu: chunk7JPLVECA_js.guidePxToEmu(canvasSize.height),
7142
+ widthEmu: slideSize.widthEmu,
7143
+ heightEmu: slideSize.heightEmu,
7144
+ slideSizeType: slideSize.type === "" ? void 0 : slideSize.type,
7097
7145
  theme,
7098
7146
  headerFooter,
7099
7147
  presentationProperties,
@@ -7107,7 +7155,7 @@ function useExportSaveAs(input) {
7107
7155
  handoutMaster
7108
7156
  };
7109
7157
  try {
7110
- chunk7JPLVECA_js.exportDeckJson(data, sourceName);
7158
+ chunk7ARD2J6Y_js.exportDeckJson(data, sourceName);
7111
7159
  } catch (err) {
7112
7160
  console.error("[PowerPointViewer] JSON export failed:", err);
7113
7161
  }
@@ -7147,7 +7195,7 @@ function safeConfirm(message) {
7147
7195
  }
7148
7196
  }
7149
7197
  function downloadBlob2(blob, filename) {
7150
- chunk7JPLVECA_js.downloadBlob(blob, chunk7JPLVECA_js.sanitizeDownloadFilename(filename));
7198
+ chunk7ARD2J6Y_js.downloadBlob(blob, chunk7ARD2J6Y_js.sanitizeDownloadFilename(filename));
7151
7199
  }
7152
7200
 
7153
7201
  // src/viewer/hooks/useExportHandlers.ts
@@ -7170,12 +7218,14 @@ function useExportHandlers(input) {
7170
7218
  appProperties,
7171
7219
  customProperties,
7172
7220
  tagCollections,
7221
+ slideMasters,
7173
7222
  notesMaster,
7174
7223
  handoutMaster,
7175
7224
  guides,
7176
7225
  activeSlideIndexForGuides,
7177
7226
  theme,
7178
7227
  canvasSize,
7228
+ slideSizeEmu,
7179
7229
  password
7180
7230
  } = input;
7181
7231
  const [exportModalOpen, setExportModalOpen] = react.useState(false);
@@ -7211,12 +7261,14 @@ function useExportHandlers(input) {
7211
7261
  appProperties,
7212
7262
  customProperties,
7213
7263
  tagCollections,
7264
+ slideMasters,
7214
7265
  notesMaster,
7215
7266
  handoutMaster,
7216
7267
  guides,
7217
7268
  activeSlideIndexForGuides,
7218
7269
  theme,
7219
7270
  canvasSize,
7271
+ slideSizeEmu,
7220
7272
  modalControls,
7221
7273
  password
7222
7274
  });
@@ -7253,21 +7305,21 @@ function useExportHandlers(input) {
7253
7305
  {
7254
7306
  scale: 2,
7255
7307
  onProgress: (current, total) => {
7256
- setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7257
- setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Rendering", current, total));
7308
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7309
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Rendering", current, total));
7258
7310
  },
7259
7311
  signal: abortCtrl.signal
7260
7312
  }
7261
7313
  );
7262
- setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7314
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7263
7315
  setExportStatusMessage("Building PDF...");
7264
7316
  await new Promise((r) => {
7265
7317
  setTimeout(r, 100);
7266
7318
  });
7267
- setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7319
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7268
7320
  setExportStatusMessage("Done!");
7269
7321
  } catch (err) {
7270
- if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7322
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7271
7323
  console.error("[PowerPointViewer] PDF export failed:", err);
7272
7324
  }
7273
7325
  } finally {
@@ -7297,21 +7349,21 @@ function useExportHandlers(input) {
7297
7349
  {
7298
7350
  scale: 2,
7299
7351
  onProgress: (current, total) => {
7300
- setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7301
- setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Rendering", current, total));
7352
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7353
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Rendering", current, total));
7302
7354
  },
7303
7355
  signal: abortCtrl.signal
7304
7356
  }
7305
7357
  );
7306
- setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7358
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7307
7359
  setExportStatusMessage("Building PDF...");
7308
7360
  await new Promise((r) => {
7309
7361
  setTimeout(r, 100);
7310
7362
  });
7311
- setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7363
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7312
7364
  setExportStatusMessage("Done!");
7313
7365
  } catch (err) {
7314
- if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7366
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7315
7367
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7316
7368
  }
7317
7369
  } finally {
@@ -7352,22 +7404,22 @@ function useExportHandlers(input) {
7352
7404
  scale: 1,
7353
7405
  slideDurationMs: 3e3,
7354
7406
  onProgress: (current, total) => {
7355
- setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total, 45));
7356
- setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Capturing", current, total));
7407
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total, 45));
7408
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Capturing", current, total));
7357
7409
  },
7358
7410
  onRecordProgress: (current, total) => {
7359
- setExportProgress(chunk7JPLVECA_js.recordProgressPercent(current, total));
7360
- setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Recording", current, total));
7411
+ setExportProgress(chunk7ARD2J6Y_js.recordProgressPercent(current, total));
7412
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Recording", current, total));
7361
7413
  },
7362
7414
  signal: abortCtrl.signal
7363
7415
  }
7364
7416
  );
7365
- setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7417
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7366
7418
  setExportStatusMessage("Saving file...");
7367
7419
  downloadBlob2(blob, "presentation.webm");
7368
- setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7420
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7369
7421
  } catch (err) {
7370
- if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7422
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7371
7423
  console.error("[PowerPointViewer] Video export failed:", err);
7372
7424
  }
7373
7425
  } finally {
@@ -7395,18 +7447,18 @@ function useExportHandlers(input) {
7395
7447
  scale: 0.5,
7396
7448
  slideDurationMs: 2e3,
7397
7449
  onProgress: (current, total) => {
7398
- setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7399
- setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Encoding", current, total));
7450
+ setExportProgress(chunk7ARD2J6Y_js.slideProgressPercent(current, total));
7451
+ setExportStatusMessage(chunk7ARD2J6Y_js.slideStatusLabel("Encoding", current, total));
7400
7452
  },
7401
7453
  signal: abortCtrl.signal
7402
7454
  }
7403
7455
  );
7404
- setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7456
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_ASSEMBLING_PERCENT);
7405
7457
  setExportStatusMessage("Saving file...");
7406
7458
  downloadBlob2(blob, "presentation.gif");
7407
- setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7459
+ setExportProgress(chunk7ARD2J6Y_js.EXPORT_DONE_PERCENT);
7408
7460
  } catch (err) {
7409
- if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7461
+ if (!chunk7ARD2J6Y_js.isExportAbortError(err)) {
7410
7462
  console.error("[PowerPointViewer] GIF export failed:", err);
7411
7463
  }
7412
7464
  } finally {
@@ -7447,7 +7499,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
7447
7499
  }
7448
7500
  printWindow.document.open();
7449
7501
  printWindow.document.write(
7450
- chunk7JPLVECA_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7502
+ chunk7ARD2J6Y_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7451
7503
  );
7452
7504
  printWindow.document.close();
7453
7505
  printWindow.focus();
@@ -7508,7 +7560,7 @@ function usePrintHandlers(input) {
7508
7560
  if (svgs.length === 0) {
7509
7561
  return;
7510
7562
  }
7511
- const printDoc = chunk7JPLVECA_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7563
+ const printDoc = chunk7ARD2J6Y_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7512
7564
  title: "Slides (Vector)",
7513
7565
  orientation: settings.orientation,
7514
7566
  colorFilter
@@ -7544,7 +7596,7 @@ function usePrintHandlers(input) {
7544
7596
  if (settings.printWhat === "outline") {
7545
7597
  openPrintWindow(
7546
7598
  "Outline",
7547
- `<div class="outline-page">${chunk7JPLVECA_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7599
+ `<div class="outline-page">${chunk7ARD2J6Y_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7548
7600
  settings.orientation,
7549
7601
  colorFilter,
7550
7602
  settings.frameSlides
@@ -7569,7 +7621,7 @@ function usePrintHandlers(input) {
7569
7621
  if (settings.printWhat === "slides") {
7570
7622
  openPrintWindow(
7571
7623
  "Slides",
7572
- chunk7JPLVECA_js.buildSlidesHtml(slideImages, slideIndices),
7624
+ chunk7ARD2J6Y_js.buildSlidesHtml(slideImages, slideIndices),
7573
7625
  settings.orientation,
7574
7626
  colorFilter,
7575
7627
  settings.frameSlides
@@ -7579,7 +7631,7 @@ function usePrintHandlers(input) {
7579
7631
  if (settings.printWhat === "notes") {
7580
7632
  openPrintWindow(
7581
7633
  "Notes Pages",
7582
- chunk7JPLVECA_js.buildNotesHtml(slideImages, slideIndices, slides),
7634
+ chunk7ARD2J6Y_js.buildNotesHtml(slideImages, slideIndices, slides),
7583
7635
  "portrait",
7584
7636
  colorFilter,
7585
7637
  settings.frameSlides
@@ -7590,7 +7642,7 @@ function usePrintHandlers(input) {
7590
7642
  const spp = settings.slidesPerPage;
7591
7643
  openPrintWindow(
7592
7644
  `Handout ${spp} per page`,
7593
- chunk7JPLVECA_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7645
+ chunk7ARD2J6Y_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7594
7646
  "portrait",
7595
7647
  colorFilter,
7596
7648
  settings.frameSlides
@@ -7654,8 +7706,8 @@ function useThemeHandlers(input) {
7654
7706
  return;
7655
7707
  }
7656
7708
  await handler.updateThemeColorScheme(colorScheme);
7657
- const previousMap = theme?.colorScheme ? chunk7JPLVECA_js.buildThemeColorMap(theme.colorScheme) : {};
7658
- setSlides((prev) => chunk7JPLVECA_js.reResolveSlideColors(prev, previousMap, colorScheme));
7709
+ const previousMap = theme?.colorScheme ? chunk7ARD2J6Y_js.buildThemeColorMap(theme.colorScheme) : {};
7710
+ setSlides((prev) => chunk7ARD2J6Y_js.reResolveSlideColors(prev, previousMap, colorScheme));
7659
7711
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7660
7712
  bumpHistory();
7661
7713
  history.markDirty();
@@ -7760,7 +7812,7 @@ function useThemeSwitching(input) {
7760
7812
  }
7761
7813
  try {
7762
7814
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7763
- const newData = chunk7JPLVECA_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7815
+ const newData = chunk7ARD2J6Y_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7764
7816
  onDataChange(newData);
7765
7817
  onThemeChanged?.(preset);
7766
7818
  } catch (error) {
@@ -7777,7 +7829,7 @@ function useThemeSwitching(input) {
7777
7829
  }
7778
7830
  try {
7779
7831
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7780
- const newData = chunk7JPLVECA_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7832
+ const newData = chunk7ARD2J6Y_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7781
7833
  onDataChange(newData);
7782
7834
  } catch (error) {
7783
7835
  console.error("Failed to switch to custom theme:", error);
@@ -7789,12 +7841,12 @@ function useThemeSwitching(input) {
7789
7841
  if (!data?.theme?.colorScheme) {
7790
7842
  return void 0;
7791
7843
  }
7792
- return chunk7JPLVECA_js.THEME_PRESETS.find(
7793
- (p) => chunk7JPLVECA_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7844
+ return chunk7ARD2J6Y_js.THEME_PRESETS.find(
7845
+ (p) => chunk7ARD2J6Y_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7794
7846
  );
7795
7847
  }, [data?.theme?.colorScheme]);
7796
7848
  return {
7797
- presets: chunk7JPLVECA_js.THEME_PRESETS,
7849
+ presets: chunk7ARD2J6Y_js.THEME_PRESETS,
7798
7850
  switchToPreset,
7799
7851
  switchToCustom,
7800
7852
  currentPreset
@@ -7869,7 +7921,7 @@ function usePropertyHandlers(input) {
7869
7921
  }
7870
7922
  try {
7871
7923
  const ab = await file.arrayBuffer();
7872
- const h = new chunk7JPLVECA_js.PptxHandler();
7924
+ const h = new chunk7ARD2J6Y_js.PptxHandler();
7873
7925
  const other = await h.load(ab);
7874
7926
  if (!other) {
7875
7927
  return;
@@ -7879,7 +7931,7 @@ function usePropertyHandlers(input) {
7879
7931
  width: canvasSize.width,
7880
7932
  height: canvasSize.height
7881
7933
  };
7882
- setCompareResult(chunk7JPLVECA_js.comparePresentation(cur, other));
7934
+ setCompareResult(chunk7ARD2J6Y_js.comparePresentation(cur, other));
7883
7935
  setIsComparePanelOpen(true);
7884
7936
  } catch (err) {
7885
7937
  console.warn("Compare failed:", err);
@@ -7896,7 +7948,7 @@ function usePropertyHandlers(input) {
7896
7948
  if (!diff || diff.status === "unchanged") {
7897
7949
  return;
7898
7950
  }
7899
- setSlides((prev) => chunk7JPLVECA_js.applyAcceptSlide(prev, diff));
7951
+ setSlides((prev) => chunk7ARD2J6Y_js.applyAcceptSlide(prev, diff));
7900
7952
  setIsDirty(true);
7901
7953
  },
7902
7954
  [compareResult, setSlides, setIsDirty]
@@ -7907,10 +7959,10 @@ function usePropertyHandlers(input) {
7907
7959
  if (!compareResult) {
7908
7960
  return;
7909
7961
  }
7910
- setSlides((prev) => chunk7JPLVECA_js.applyAcceptAllSlides(prev, compareResult));
7962
+ setSlides((prev) => chunk7ARD2J6Y_js.applyAcceptAllSlides(prev, compareResult));
7911
7963
  setIsDirty(true);
7912
7964
  }, [compareResult, setSlides, setIsDirty]);
7913
- const usedFontFamilies = react.useMemo(() => chunk7JPLVECA_js.collectUsedFonts(slides), [slides]);
7965
+ const usedFontFamilies = react.useMemo(() => chunk7ARD2J6Y_js.collectUsedFonts(slides), [slides]);
7914
7966
  return {
7915
7967
  handleUpdateNotes,
7916
7968
  handleUpdateSlide,
@@ -8029,7 +8081,7 @@ function useIsMobile(input) {
8029
8081
  const containerRef = input?.containerRef;
8030
8082
  const isTouchDevice = react.useSyncExternalStore(
8031
8083
  subscribeTouchCapability,
8032
- chunk7JPLVECA_js.detectTouchDevice,
8084
+ chunk7ARD2J6Y_js.detectTouchDevice,
8033
8085
  () => false
8034
8086
  // server snapshot
8035
8087
  );
@@ -8045,7 +8097,7 @@ function useIsMobile(input) {
8045
8097
  }
8046
8098
  return containerRef?.current?.clientHeight ?? window.innerHeight;
8047
8099
  });
8048
- const [orientation, setOrientation] = react.useState(chunk7JPLVECA_js.detectOrientation);
8100
+ const [orientation, setOrientation] = react.useState(chunk7ARD2J6Y_js.detectOrientation);
8049
8101
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
8050
8102
  const [initialViewportHeight] = react.useState(
8051
8103
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -8089,7 +8141,7 @@ function useIsMobile(input) {
8089
8141
  return;
8090
8142
  }
8091
8143
  const handleOrientationChange = () => {
8092
- setOrientation(chunk7JPLVECA_js.detectOrientation());
8144
+ setOrientation(chunk7ARD2J6Y_js.detectOrientation());
8093
8145
  };
8094
8146
  if (screen.orientation) {
8095
8147
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -8119,9 +8171,9 @@ function useIsMobile(input) {
8119
8171
  window.addEventListener("resize", handleResize);
8120
8172
  return () => window.removeEventListener("resize", handleResize);
8121
8173
  }, [isTouchDevice, initialViewportHeight]);
8122
- const isMobile = chunk7JPLVECA_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8123
- const isTablet = !isMobile && containerWidth >= chunk7JPLVECA_js.MOBILE_BREAKPOINT && containerWidth < chunk7JPLVECA_js.TABLET_BREAKPOINT;
8124
- const isDesktop = !isMobile && containerWidth >= chunk7JPLVECA_js.TABLET_BREAKPOINT;
8174
+ const isMobile = chunk7ARD2J6Y_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8175
+ const isTablet = !isMobile && containerWidth >= chunk7ARD2J6Y_js.MOBILE_BREAKPOINT && containerWidth < chunk7ARD2J6Y_js.TABLET_BREAKPOINT;
8176
+ const isDesktop = !isMobile && containerWidth >= chunk7ARD2J6Y_js.TABLET_BREAKPOINT;
8125
8177
  return {
8126
8178
  isMobile,
8127
8179
  isTablet,
@@ -8183,7 +8235,7 @@ function useViewerDialogs(input) {
8183
8235
  );
8184
8236
  const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8185
8237
  const fontEmbedding = react.useMemo(
8186
- () => chunk7JPLVECA_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8238
+ () => chunk7ARD2J6Y_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8187
8239
  [embeddedFontKey]
8188
8240
  );
8189
8241
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
@@ -8191,11 +8243,11 @@ function useViewerDialogs(input) {
8191
8243
  setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8192
8244
  }, [fontEmbedding]);
8193
8245
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8194
- () => typeof window !== "undefined" ? chunk7JPLVECA_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8246
+ () => typeof window !== "undefined" ? chunk7ARD2J6Y_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8195
8247
  );
8196
8248
  react.useEffect(() => {
8197
8249
  const handleWindow = () => setIsNarrowViewport(
8198
- chunk7JPLVECA_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8250
+ chunk7ARD2J6Y_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8199
8251
  );
8200
8252
  let observer = null;
8201
8253
  let raf = 0;
@@ -8209,12 +8261,12 @@ function useViewerDialogs(input) {
8209
8261
  const entry = entries[0];
8210
8262
  if (entry) {
8211
8263
  setIsNarrowViewport(
8212
- chunk7JPLVECA_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8264
+ chunk7ARD2J6Y_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8213
8265
  );
8214
8266
  }
8215
8267
  });
8216
8268
  observer.observe(el);
8217
- setIsNarrowViewport(chunk7JPLVECA_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8269
+ setIsNarrowViewport(chunk7ARD2J6Y_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8218
8270
  };
8219
8271
  attach();
8220
8272
  window.addEventListener("resize", handleWindow);
@@ -8373,20 +8425,20 @@ function useViewerDialogs(input) {
8373
8425
  }
8374
8426
  function computeGridSpacingPx(presentationGridSpacing) {
8375
8427
  if (presentationGridSpacing) {
8376
- const px = Math.round(presentationGridSpacing.cx / chunk5BXATG54_js.EMU_PER_PX);
8428
+ const px = Math.round(presentationGridSpacing.cx / chunkOVPJT4EQ_js.EMU_PER_PX);
8377
8429
  if (px > 0) {
8378
8430
  return px;
8379
8431
  }
8380
8432
  }
8381
- return chunk5BXATG54_js.GRID_SIZE;
8433
+ return chunkOVPJT4EQ_js.GRID_SIZE;
8382
8434
  }
8383
8435
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8384
8436
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8385
- return chunk7JPLVECA_js.resolveShowSlideIndexes(slides, activeShow);
8437
+ return chunk7ARD2J6Y_js.resolveShowSlideIndexes(slides, activeShow);
8386
8438
  }
8387
8439
  function computeSlideSectionGroups(slides, sections) {
8388
- return chunk7JPLVECA_js.groupSlidesBySection(sections, slides).map((group) => ({
8389
- id: group.section?.id ?? (sections.length > 0 ? chunk5BXATG54_js.UNGROUPED_SECTION_ID : "default"),
8440
+ return chunk7ARD2J6Y_js.groupSlidesBySection(sections, slides).map((group) => ({
8441
+ id: group.section?.id ?? (sections.length > 0 ? chunkOVPJT4EQ_js.UNGROUPED_SECTION_ID : chunkOVPJT4EQ_js.DEFAULT_SECTION_GROUP_ID),
8390
8442
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8391
8443
  slideIndexes: group.slideIndexes,
8392
8444
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8398,7 +8450,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8398
8450
  return void 0;
8399
8451
  }
8400
8452
  const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8401
- return chunk7JPLVECA_js.masterViewPseudoSlide(document2, {
8453
+ return chunk7ARD2J6Y_js.masterViewPseudoSlide(document2, {
8402
8454
  tab: "slides",
8403
8455
  masterIndex: 0,
8404
8456
  layoutIndex: activeLayout ? 0 : null
@@ -8426,10 +8478,10 @@ function useDerivedSlideState(input) {
8426
8478
  );
8427
8479
  const slideSectionGroups = react.useMemo(
8428
8480
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8429
- if (group.id === chunk5BXATG54_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8481
+ if (group.id === chunkOVPJT4EQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8430
8482
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8431
8483
  }
8432
- if (group.id === "default" && group.label === "Slides") {
8484
+ if (group.id === chunkOVPJT4EQ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8433
8485
  return { ...group, label: t("pptx.sections.slides") };
8434
8486
  }
8435
8487
  return group;
@@ -8529,13 +8581,13 @@ function useAnnotationHandlers(input) {
8529
8581
  }, [annotations, setMode, setSlides, history]);
8530
8582
  const handleSetMode = react.useCallback(
8531
8583
  (nextMode) => {
8532
- if (mode === "present" && nextMode !== "present" && !chunk7JPLVECA_js.mayLeaveSlideShow()) {
8584
+ if (mode === "present" && nextMode !== "present" && !chunk7ARD2J6Y_js.mayLeaveSlideShow()) {
8533
8585
  return;
8534
8586
  }
8535
8587
  if (nextMode === "present") {
8536
8588
  presentation.enterPresentMode();
8537
8589
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8538
- chunk7JPLVECA_js.stopAllPersistentAudio();
8590
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8539
8591
  pendingModeAfterAnnotationsRef.current = nextMode;
8540
8592
  if (promptKeepInkAnnotations) {
8541
8593
  setShowKeepAnnotationsDialog(true);
@@ -8544,7 +8596,7 @@ function useAnnotationHandlers(input) {
8544
8596
  }
8545
8597
  } else {
8546
8598
  if (mode === "present") {
8547
- chunk7JPLVECA_js.stopAllPersistentAudio();
8599
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8548
8600
  }
8549
8601
  setMode(nextMode);
8550
8602
  }
@@ -8583,6 +8635,8 @@ function useSerialize(input) {
8583
8635
  slides,
8584
8636
  templateElementsBySlideId,
8585
8637
  activeSlideIndex,
8638
+ canvasSize,
8639
+ slideSizeEmu,
8586
8640
  guides,
8587
8641
  headerFooter,
8588
8642
  presentationProperties,
@@ -8592,6 +8646,7 @@ function useSerialize(input) {
8592
8646
  appProperties,
8593
8647
  customProperties,
8594
8648
  tagCollections,
8649
+ slideMasters,
8595
8650
  notesMaster,
8596
8651
  handoutMaster,
8597
8652
  handlerRef,
@@ -8612,13 +8667,13 @@ function useSerialize(input) {
8612
8667
  let processedSlide = slide;
8613
8668
  if (pendingEditId) {
8614
8669
  const updatedElements = slide.elements.map((el) => {
8615
- if (el.id !== pendingEditId || !chunk7JPLVECA_js.hasTextProperties(el)) {
8670
+ if (el.id !== pendingEditId || !chunk7ARD2J6Y_js.hasTextProperties(el)) {
8616
8671
  return el;
8617
8672
  }
8618
8673
  return {
8619
8674
  ...el,
8620
8675
  text: pendingEditText,
8621
- textSegments: chunk7JPLVECA_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8676
+ textSegments: chunk7ARD2J6Y_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8622
8677
  };
8623
8678
  });
8624
8679
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8631,15 +8686,19 @@ function useSerialize(input) {
8631
8686
  const pptxGuides = guides.map((g) => ({
8632
8687
  id: g.id,
8633
8688
  orientation: g.axis === "h" ? "horz" : "vert",
8634
- positionEmu: chunk7JPLVECA_js.guidePxToEmu(g.position)
8689
+ positionEmu: chunk7ARD2J6Y_js.guidePxToEmu(g.position)
8635
8690
  }));
8636
8691
  return {
8637
8692
  ...processedSlide,
8638
8693
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8639
8694
  };
8640
8695
  });
8641
- const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8696
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8642
8697
  const saveOptions = {
8698
+ // Without this the Slide Size card edited a viewer-only pixel value and
8699
+ // the saved `p:sldSz` never moved: passing `slideSize` is the only way a
8700
+ // slide-size edit reaches the file.
8701
+ slideSize: chunk7ARD2J6Y_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8643
8702
  headerFooter,
8644
8703
  presentationProperties,
8645
8704
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -8648,14 +8707,17 @@ function useSerialize(input) {
8648
8707
  appProperties,
8649
8708
  customProperties: customProperties.length > 0 ? customProperties : void 0,
8650
8709
  tags: tagCollections.length > 0 ? tagCollections : void 0,
8710
+ slideMasters,
8651
8711
  notesMaster,
8652
8712
  handoutMaster,
8653
- ...chunk7JPLVECA_js.embeddedFontSaveOptions(embedFonts)
8713
+ ...chunk7ARD2J6Y_js.embeddedFontSaveOptions(embedFonts)
8654
8714
  };
8655
- return chunk7JPLVECA_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8715
+ return chunk7ARD2J6Y_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8656
8716
  }, [
8657
8717
  slides,
8658
8718
  templateElementsBySlideId,
8719
+ canvasSize,
8720
+ slideSizeEmu,
8659
8721
  headerFooter,
8660
8722
  presentationProperties,
8661
8723
  customShows,
@@ -8664,6 +8726,7 @@ function useSerialize(input) {
8664
8726
  appProperties,
8665
8727
  customProperties,
8666
8728
  tagCollections,
8729
+ slideMasters,
8667
8730
  notesMaster,
8668
8731
  handoutMaster,
8669
8732
  guides,
@@ -8676,102 +8739,52 @@ function useSerialize(input) {
8676
8739
  purpose
8677
8740
  ]);
8678
8741
  }
8679
-
8680
- // src/viewer/hooks/useRecoveryDetection-helpers.ts
8681
- function shouldCheckRecovery(input) {
8682
- const { alreadyChecked, filePath, loading, error, slideCount } = input;
8683
- if (alreadyChecked) {
8684
- return false;
8685
- }
8686
- if (!filePath) {
8687
- return false;
8688
- }
8689
- if (loading) {
8690
- return false;
8691
- }
8692
- if (error) {
8693
- return false;
8694
- }
8695
- if (slideCount === 0) {
8696
- return false;
8697
- }
8698
- return true;
8699
- }
8700
- var RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
8701
- function isRecentRecovery(timestamp, now) {
8702
- return now - timestamp < RECOVERY_WINDOW_MS;
8703
- }
8704
- function hasRecentRecoveryVersion(versions, now) {
8705
- if (versions.length === 0) {
8706
- return false;
8707
- }
8708
- return isRecentRecovery(versions[0].timestamp, now);
8709
- }
8710
-
8711
- // src/viewer/hooks/useRecoveryDetection.ts
8712
- var DB_NAME = "pptx-viewer-autosave";
8713
- var DB_VERSION = 1;
8714
- var STORE_NAME = "recoveryVersions";
8715
- function openAutosaveDb() {
8716
- return new Promise((resolve, reject) => {
8717
- const req = indexedDB.open(DB_NAME, DB_VERSION);
8718
- req.onupgradeneeded = () => {
8719
- const db = req.result;
8720
- if (!db.objectStoreNames.contains(STORE_NAME)) {
8721
- db.createObjectStore(STORE_NAME, { keyPath: "key" });
8722
- }
8723
- };
8724
- req.onsuccess = () => resolve(req.result);
8725
- req.onerror = () => reject(req.error);
8726
- });
8727
- }
8728
- async function getRecoveryVersion(filePath) {
8729
- try {
8730
- const db = await openAutosaveDb();
8731
- return new Promise((resolve) => {
8732
- const tx = db.transaction(STORE_NAME, "readonly");
8733
- const store = tx.objectStore(STORE_NAME);
8734
- const req = store.get(filePath);
8735
- req.onsuccess = () => {
8736
- db.close();
8737
- resolve(req.result);
8738
- };
8739
- req.onerror = () => {
8740
- db.close();
8741
- resolve(void 0);
8742
- };
8743
- });
8744
- } catch {
8745
- return void 0;
8746
- }
8747
- }
8748
8742
  function useRecoveryDetection(input) {
8749
- const { filePath, loading, error, slideCount, openVersionHistory } = input;
8743
+ const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
8750
8744
  const recoveryCheckedRef = react.useRef(false);
8745
+ const recordRef = react.useRef(null);
8746
+ const [prompt, setPrompt] = react.useState(null);
8747
+ const onRestore = input.onRestore;
8748
+ const openVersionHistory = input.openVersionHistory;
8751
8749
  react.useEffect(() => {
8752
- if (!shouldCheckRecovery({
8750
+ if (!chunk7ARD2J6Y_js.shouldProbeAutosaveRecovery({
8753
8751
  alreadyChecked: recoveryCheckedRef.current,
8754
8752
  filePath,
8755
8753
  loading,
8756
8754
  error,
8757
- slideCount
8755
+ slideCount,
8756
+ autosaveAllowed
8758
8757
  })) {
8759
8758
  return;
8760
8759
  }
8761
8760
  recoveryCheckedRef.current = true;
8762
- if (typeof indexedDB === "undefined") {
8763
- return;
8764
- }
8765
8761
  void (async () => {
8766
- try {
8767
- const version = await getRecoveryVersion(filePath);
8768
- if (version && hasRecentRecoveryVersion([version], Date.now())) {
8769
- openVersionHistory();
8770
- }
8771
- } catch {
8762
+ const offer = await chunk7ARD2J6Y_js.probeAutosaveRecovery(filePath);
8763
+ if (!offer) {
8764
+ return;
8772
8765
  }
8766
+ recordRef.current = offer.record;
8767
+ setPrompt(offer.prompt);
8768
+ openVersionHistory?.();
8773
8769
  })();
8774
- }, [filePath, loading, error, slideCount, openVersionHistory]);
8770
+ }, [filePath, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
8771
+ const restore = react.useCallback(() => {
8772
+ const record = recordRef.current;
8773
+ setPrompt(null);
8774
+ if (record && onRestore) {
8775
+ onRestore(chunk7ARD2J6Y_js.acceptAutosaveRecovery(record));
8776
+ }
8777
+ recordRef.current = null;
8778
+ }, [onRestore]);
8779
+ const discard = react.useCallback(() => {
8780
+ const record = recordRef.current;
8781
+ setPrompt(null);
8782
+ recordRef.current = null;
8783
+ if (record) {
8784
+ void chunk7ARD2J6Y_js.discardAutosaveRecovery(record);
8785
+ }
8786
+ }, []);
8787
+ return { prompt, restore, discard };
8775
8788
  }
8776
8789
  function usePresentationSetup(input) {
8777
8790
  const {
@@ -8789,7 +8802,8 @@ function usePresentationSetup(input) {
8789
8802
  history,
8790
8803
  endWithBlackSlide = true,
8791
8804
  promptKeepInkAnnotations = true,
8792
- popupToolbarEnabled = true
8805
+ popupToolbarEnabled = true,
8806
+ onToggleSubtitles
8793
8807
  } = input;
8794
8808
  const actionSoundHandlerRef = react.useRef(null);
8795
8809
  const [, setShowKeepAnnotationsDialog] = react.useState(false);
@@ -8807,7 +8821,7 @@ function usePresentationSetup(input) {
8807
8821
  containerRef,
8808
8822
  content,
8809
8823
  onSetMode: (nextMode) => {
8810
- if (mode === "present" && nextMode !== "present" && !chunk7JPLVECA_js.mayLeaveSlideShow()) {
8824
+ if (mode === "present" && nextMode !== "present" && !chunk7ARD2J6Y_js.mayLeaveSlideShow()) {
8811
8825
  return;
8812
8826
  }
8813
8827
  if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
@@ -8815,7 +8829,7 @@ function usePresentationSetup(input) {
8815
8829
  setShowKeepAnnotationsDialog(true);
8816
8830
  } else {
8817
8831
  if (mode === "present" && nextMode !== "present") {
8818
- chunk7JPLVECA_js.stopAllPersistentAudio();
8832
+ chunk7ARD2J6Y_js.stopAllPersistentAudio();
8819
8833
  stopAnimationSound();
8820
8834
  }
8821
8835
  setMode(nextMode);
@@ -8868,11 +8882,12 @@ function usePresentationSetup(input) {
8868
8882
  onEraseAnnotations: () => annotations.clearAnnotations(),
8869
8883
  onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
8870
8884
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8885
+ onToggleSubtitles,
8871
8886
  onSaveRehearsalTimings: (timings) => {
8872
- setSlides((prev) => chunk7JPLVECA_js.applyRehearsalTimings(prev, timings));
8887
+ setSlides((prev) => chunk7ARD2J6Y_js.applyRehearsalTimings(prev, timings));
8873
8888
  history.markDirty();
8874
8889
  },
8875
- loopContinuously: chunk7JPLVECA_js.shouldLoopContinuously(presentationProperties),
8890
+ loopContinuously: chunk7ARD2J6Y_js.shouldLoopContinuously(presentationProperties),
8876
8891
  showWithAnimation: presentationProperties.showWithAnimation,
8877
8892
  useTimings: presentationProperties.advanceMode !== "manual",
8878
8893
  endWithBlackSlide
@@ -9065,7 +9080,7 @@ function useEditorOperations(input) {
9065
9080
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9066
9081
  react.useEffect(() => {
9067
9082
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9068
- copiedFormatRef.current = chunk7JPLVECA_js.copyFormatFromElement(selectedElement);
9083
+ copiedFormatRef.current = chunk7ARD2J6Y_js.copyFormatFromElement(selectedElement);
9069
9084
  } else if (!formatPainterActive) {
9070
9085
  copiedFormatRef.current = null;
9071
9086
  }
@@ -9091,12 +9106,12 @@ function useEditorOperations(input) {
9091
9106
  e.stopPropagation();
9092
9107
  const element = elementLookup.get(elementId);
9093
9108
  if (element) {
9094
- const updated = chunk7JPLVECA_js.applyFormatToElement(element, copiedFormatRef.current);
9109
+ const updated = chunk7ARD2J6Y_js.applyFormatToElement(element, copiedFormatRef.current);
9095
9110
  const updates = {};
9096
- if (chunk7JPLVECA_js.hasShapeProperties(updated)) {
9111
+ if (chunk7ARD2J6Y_js.hasShapeProperties(updated)) {
9097
9112
  updates.shapeStyle = updated.shapeStyle;
9098
9113
  }
9099
- if (chunk7JPLVECA_js.hasTextProperties(updated)) {
9114
+ if (chunk7ARD2J6Y_js.hasTextProperties(updated)) {
9100
9115
  updates.textStyle = updated.textStyle;
9101
9116
  }
9102
9117
  ops.updateElementById(elementId, updates);
@@ -9167,12 +9182,14 @@ function useIOHandlers(input) {
9167
9182
  appProperties: state.appProperties ?? null,
9168
9183
  customProperties: state.customProperties,
9169
9184
  tagCollections: state.tagCollections,
9185
+ slideMasters: state.slideMasters,
9170
9186
  notesMaster: state.notesMaster,
9171
9187
  handoutMaster: state.handoutMaster,
9172
9188
  guides: state.guides,
9173
9189
  activeSlideIndexForGuides: state.activeSlideIndex,
9174
9190
  theme: state.theme,
9175
9191
  canvasSize,
9192
+ slideSizeEmu: state.slideSizeEmu,
9176
9193
  password
9177
9194
  });
9178
9195
  const printHandlers = usePrintHandlers({
@@ -9248,7 +9265,7 @@ function collectReferencedFontFamilies(slides) {
9248
9265
  const families = /* @__PURE__ */ new Set();
9249
9266
  for (const slide of slides) {
9250
9267
  for (const el of slide.elements) {
9251
- if (chunk7JPLVECA_js.hasTextProperties(el) && el.textSegments) {
9268
+ if (chunk7ARD2J6Y_js.hasTextProperties(el) && el.textSegments) {
9252
9269
  for (const seg of el.textSegments) {
9253
9270
  if (seg.style.fontFamily) {
9254
9271
  families.add(seg.style.fontFamily);
@@ -9378,7 +9395,7 @@ function useContentLifecycle(input) {
9378
9395
  content,
9379
9396
  filePath,
9380
9397
  autosaveEnabled = true,
9381
- autosaveIntervalSeconds,
9398
+ autosaveIntervalMs,
9382
9399
  embedFonts = true,
9383
9400
  slides,
9384
9401
  state,
@@ -9397,6 +9414,7 @@ function useContentLifecycle(input) {
9397
9414
  setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
9398
9415
  mediaDataUrls: state.mediaDataUrls,
9399
9416
  setCanvasSize: state.setCanvasSize,
9417
+ setSlideSizeEmu: state.setSlideSizeEmu,
9400
9418
  setHeaderFooter: state.setHeaderFooter,
9401
9419
  setLayoutOptions: state.setLayoutOptions,
9402
9420
  setSlideMasters: state.setSlideMasters,
@@ -9404,6 +9422,7 @@ function useContentLifecycle(input) {
9404
9422
  setTableStyleMap: state.setTableStyleMap,
9405
9423
  setThemeOptions: state.setThemeOptions,
9406
9424
  setCustomShows: state.setCustomShows,
9425
+ setActiveCustomShowId: state.setActiveCustomShowId,
9407
9426
  setSections: state.setSections,
9408
9427
  setPresentationProperties: state.setPresentationProperties,
9409
9428
  setNotesMaster: state.setNotesMaster,
@@ -9433,6 +9452,8 @@ function useContentLifecycle(input) {
9433
9452
  slides,
9434
9453
  templateElementsBySlideId: state.templateElementsBySlideId,
9435
9454
  activeSlideIndex: state.activeSlideIndex,
9455
+ canvasSize: state.canvasSize,
9456
+ slideSizeEmu: state.slideSizeEmu,
9436
9457
  guides: state.guides,
9437
9458
  headerFooter: state.headerFooter,
9438
9459
  presentationProperties: state.presentationProperties,
@@ -9442,6 +9463,7 @@ function useContentLifecycle(input) {
9442
9463
  appProperties: state.appProperties,
9443
9464
  customProperties: state.customProperties,
9444
9465
  tagCollections: state.tagCollections,
9466
+ slideMasters: state.slideMasters,
9445
9467
  notesMaster: state.notesMaster,
9446
9468
  handoutMaster: state.handoutMaster,
9447
9469
  handlerRef,
@@ -9457,7 +9479,31 @@ function useContentLifecycle(input) {
9457
9479
  filePath,
9458
9480
  serializeSlides: serializeForRecovery,
9459
9481
  enabled: autosaveEnabled,
9460
- ...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds }
9482
+ ...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
9483
+ // Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
9484
+ // so a poll that finds all of them unchanged can skip re-serializing a
9485
+ // deck it has already snapshotted. The two refs are read by `.current`
9486
+ // because an inline edit in progress lives there and nowhere else yet.
9487
+ getChangeSources: () => [
9488
+ slides,
9489
+ state.templateElementsBySlideId,
9490
+ state.guides,
9491
+ state.headerFooter,
9492
+ state.presentationProperties,
9493
+ state.customShows,
9494
+ state.sections,
9495
+ state.coreProperties,
9496
+ state.appProperties,
9497
+ state.customProperties,
9498
+ state.tagCollections,
9499
+ state.notesMaster,
9500
+ state.handoutMaster,
9501
+ state.embeddedFonts,
9502
+ embedFonts,
9503
+ password,
9504
+ state.inlineEditingElementIdRef.current,
9505
+ state.inlineEditingTextRef.current
9506
+ ]
9461
9507
  });
9462
9508
  return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus };
9463
9509
  }
@@ -9466,13 +9512,20 @@ function useKeyboardShortcuts(input) {
9466
9512
  inputRef.current = input;
9467
9513
  const handleKeyDown = react.useCallback((e) => {
9468
9514
  const current = inputRef.current;
9469
- const { action, dx, dy } = chunk7JPLVECA_js.mapEditorKey(e, {
9515
+ const { action, dx, dy } = chunk7ARD2J6Y_js.mapEditorKey(e, {
9470
9516
  canEdit: current.canEdit,
9471
- isPresenting: current.mode !== "edit",
9517
+ // The Slide Master view is an editing surface, not a viewing one.
9518
+ // Gating on `mode !== 'edit'` alone made `mapEditorKey` return
9519
+ // NO_ACTION there, so Delete, the arrow-key nudges and the clipboard
9520
+ // keys were all inert over a master shape even though the write path
9521
+ // behind them routes to the owning part correctly. Svelte and
9522
+ // vanilla, which render the master into their ordinary editable
9523
+ // stage, never had the gap.
9524
+ isPresenting: current.mode !== "edit" && current.mode !== "master",
9472
9525
  hasSelection: current.hasSelection,
9473
9526
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9474
9527
  isDrawing: current.activeTool !== "select",
9475
- isTextInputTarget: chunk7JPLVECA_js.isEditorTextInputTarget(e.target)
9528
+ isTextInputTarget: chunk7ARD2J6Y_js.isEditorTextInputTarget(e.target)
9476
9529
  });
9477
9530
  if (action === null) {
9478
9531
  return;
@@ -9515,6 +9568,9 @@ function useKeyboardShortcuts(input) {
9515
9568
  case "toggleShortcuts":
9516
9569
  current.onToggleShortcuts?.();
9517
9570
  break;
9571
+ case "find":
9572
+ current.onFind?.();
9573
+ break;
9518
9574
  case "nudge":
9519
9575
  current.onNudge(dx ?? 0, dy ?? 0);
9520
9576
  break;
@@ -9623,7 +9679,8 @@ function useViewerIntegration(input) {
9623
9679
  content,
9624
9680
  filePath,
9625
9681
  autosaveEnabled,
9626
- autosaveIntervalSeconds,
9682
+ autosaveAllowed = true,
9683
+ autosaveIntervalMs,
9627
9684
  canEdit,
9628
9685
  mode,
9629
9686
  slides,
@@ -9679,7 +9736,7 @@ function useViewerIntegration(input) {
9679
9736
  content,
9680
9737
  filePath,
9681
9738
  autosaveEnabled,
9682
- autosaveIntervalSeconds,
9739
+ autosaveIntervalMs,
9683
9740
  // The File > Fonts toggle, finally reaching a save call.
9684
9741
  embedFonts: dialogs.embedFontsEnabled,
9685
9742
  slides,
@@ -9723,12 +9780,13 @@ function useViewerIntegration(input) {
9723
9780
  setMode: state.setMode,
9724
9781
  setSlides: state.setSlides
9725
9782
  });
9726
- useRecoveryDetection({
9783
+ const recovery = useRecoveryDetection({
9727
9784
  filePath,
9728
9785
  loading,
9729
9786
  error,
9730
9787
  slideCount: slides.length,
9731
- openVersionHistory: () => propertyHandlers.setIsVersionHistoryOpen(true)
9788
+ autosaveAllowed,
9789
+ onRestore: setContent
9732
9790
  });
9733
9791
  react.useImperativeHandle(
9734
9792
  ref,
@@ -9773,7 +9831,7 @@ function useViewerIntegration(input) {
9773
9831
  return zoom.scale;
9774
9832
  },
9775
9833
  setZoom(level) {
9776
- zoom.setScale(chunk7JPLVECA_js.clampZoomScale(level));
9834
+ zoom.setScale(chunk7ARD2J6Y_js.clampZoomScale(level));
9777
9835
  },
9778
9836
  zoomIn() {
9779
9837
  zoom.handleZoomIn();
@@ -9936,6 +9994,7 @@ function useViewerIntegration(input) {
9936
9994
  handleEnterPresenterView,
9937
9995
  handleEnterRehearsalMode,
9938
9996
  autosaveStatus,
9997
+ recovery,
9939
9998
  isEncryptedDialogOpen,
9940
9999
  setIsEncryptedDialogOpen,
9941
10000
  handlerRef,
@@ -9988,7 +10047,7 @@ function useReducedMotion() {
9988
10047
  }
9989
10048
  function useViewerOptions() {
9990
10049
  const storeRef = react.useRef(null);
9991
- storeRef.current ??= chunk7JPLVECA_js.createViewerOptionsStore();
10050
+ storeRef.current ??= chunk7ARD2J6Y_js.createViewerOptionsStore();
9992
10051
  const store = storeRef.current;
9993
10052
  const options = react.useSyncExternalStore(
9994
10053
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -9997,9 +10056,9 @@ function useViewerOptions() {
9997
10056
  );
9998
10057
  return { optionsStore: store, options };
9999
10058
  }
10000
- var KNOWN_TAB_IDS = new Set(chunk7JPLVECA_js.TOOLBAR_TABS.map((tab) => tab.id));
10059
+ var KNOWN_TAB_IDS = new Set(chunk7ARD2J6Y_js.TOOLBAR_TABS.map((tab) => tab.id));
10001
10060
  function computeToolbarVisibility(hiddenActions) {
10002
- const isHidden = (id) => chunk7JPLVECA_js.isActionHidden(id, hiddenActions);
10061
+ const isHidden = (id) => chunk7ARD2J6Y_js.isActionHidden(id, hiddenActions);
10003
10062
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
10004
10063
  return { isHidden, isTabVisible };
10005
10064
  }
@@ -10084,12 +10143,12 @@ function useYjsDocumentSync({
10084
10143
  return;
10085
10144
  }
10086
10145
  try {
10087
- const handler = new chunk7JPLVECA_js.PptxHandler();
10146
+ const handler = new chunk7ARD2J6Y_js.PptxHandler();
10088
10147
  await handler.load(sourceBytes.buffer);
10089
- const currentSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
10148
+ const currentSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10090
10149
  doc
10091
10150
  );
10092
- const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10151
+ const slidesToSave = chunk7ARD2J6Y_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10093
10152
  const bytes = await handler.save(slidesToSave);
10094
10153
  config.onWriteBack(bytes);
10095
10154
  } catch {
@@ -10104,7 +10163,7 @@ function useYjsDocumentSync({
10104
10163
  if (!doc || !isConnected) {
10105
10164
  return;
10106
10165
  }
10107
- const docSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
10166
+ const docSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10108
10167
  doc
10109
10168
  );
10110
10169
  if (docSlides.length === 0) {
@@ -10126,11 +10185,11 @@ function useYjsDocumentSync({
10126
10185
  lastSyncedRef.current = serialized;
10127
10186
  void (async () => {
10128
10187
  const factories = await getFactories();
10129
- chunk7JPLVECA_js.reconcileSlidesInYDoc(
10188
+ chunk7ARD2J6Y_js.reconcileSlidesInYDoc(
10130
10189
  slides,
10131
10190
  doc,
10132
10191
  factories,
10133
- chunk7JPLVECA_js.LOCAL_SYNC_ORIGIN
10192
+ chunk7ARD2J6Y_js.LOCAL_SYNC_ORIGIN
10134
10193
  );
10135
10194
  scheduleWriteBack();
10136
10195
  })();
@@ -10144,10 +10203,10 @@ function useYjsDocumentSync({
10144
10203
  return;
10145
10204
  }
10146
10205
  const handleChange = (_events, transaction) => {
10147
- if (transaction?.origin === chunk7JPLVECA_js.LOCAL_SYNC_ORIGIN) {
10206
+ if (transaction?.origin === chunk7ARD2J6Y_js.LOCAL_SYNC_ORIGIN) {
10148
10207
  return;
10149
10208
  }
10150
- const remoteSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
10209
+ const remoteSlides = chunk7ARD2J6Y_js.readSlidesFromYDoc(
10151
10210
  doc
10152
10211
  );
10153
10212
  if (remoteSlides.length === 0) {
@@ -10163,7 +10222,7 @@ function useYjsDocumentSync({
10163
10222
  isApplyingRemoteRef.current = false;
10164
10223
  scheduleWriteBack();
10165
10224
  };
10166
- const unobserve = chunk7JPLVECA_js.observeYDocSlides(
10225
+ const unobserve = chunk7ARD2J6Y_js.observeYDocSlides(
10167
10226
  doc,
10168
10227
  handleChange
10169
10228
  );
@@ -10201,7 +10260,7 @@ function useBroadcastFollower({
10201
10260
  if (!broadcaster) {
10202
10261
  return;
10203
10262
  }
10204
- if (!chunk7JPLVECA_js.shouldAutoFollowBroadcaster({
10263
+ if (!chunk7ARD2J6Y_js.shouldAutoFollowBroadcaster({
10205
10264
  localRole: collab.config.role,
10206
10265
  broadcasterRole: broadcaster.role
10207
10266
  })) {
@@ -10372,10 +10431,10 @@ function useTouchGestures(input) {
10372
10431
  if (!el || !enabled) {
10373
10432
  return;
10374
10433
  }
10375
- const recognizer = chunk7JPLVECA_js.createTouchGestureRecognizer({
10434
+ const recognizer = chunk7ARD2J6Y_js.createTouchGestureRecognizer({
10376
10435
  getScale: () => scaleRef.current,
10377
- minScale: chunk7JPLVECA_js.MIN_ZOOM_SCALE,
10378
- maxScale: chunk7JPLVECA_js.MAX_ZOOM_SCALE,
10436
+ minScale: chunk7ARD2J6Y_js.MIN_ZOOM_SCALE,
10437
+ maxScale: chunk7ARD2J6Y_js.MAX_ZOOM_SCALE,
10379
10438
  callbacks: {
10380
10439
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10381
10440
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10415,7 +10474,7 @@ function scrollFocusedIntoView(keyboardInset) {
10415
10474
  return;
10416
10475
  }
10417
10476
  const rect = active.getBoundingClientRect();
10418
- const delta = chunk7JPLVECA_js.computeScrollDelta(
10477
+ const delta = chunk7ARD2J6Y_js.computeScrollDelta(
10419
10478
  { top: rect.top, bottom: rect.bottom },
10420
10479
  window.innerHeight,
10421
10480
  keyboardInset
@@ -10435,8 +10494,8 @@ function useKeyboardInsets(enabled = true) {
10435
10494
  return;
10436
10495
  }
10437
10496
  const update = () => {
10438
- const metrics = chunk7JPLVECA_js.readViewportMetrics(window);
10439
- const inset = metrics ? chunk7JPLVECA_js.computeKeyboardInset(metrics) : 0;
10497
+ const metrics = chunk7ARD2J6Y_js.readViewportMetrics(window);
10498
+ const inset = metrics ? chunk7ARD2J6Y_js.computeKeyboardInset(metrics) : 0;
10440
10499
  setKeyboardInset(inset);
10441
10500
  if (inset > 0) {
10442
10501
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10447,8 +10506,8 @@ function useKeyboardInsets(enabled = true) {
10447
10506
  vv.addEventListener("scroll", update);
10448
10507
  const onFocusIn = () => {
10449
10508
  window.requestAnimationFrame(() => {
10450
- const metrics = chunk7JPLVECA_js.readViewportMetrics(window);
10451
- const inset = metrics ? chunk7JPLVECA_js.computeKeyboardInset(metrics) : 0;
10509
+ const metrics = chunk7ARD2J6Y_js.readViewportMetrics(window);
10510
+ const inset = metrics ? chunk7ARD2J6Y_js.computeKeyboardInset(metrics) : 0;
10452
10511
  if (inset > 0) {
10453
10512
  scrollFocusedIntoView(inset);
10454
10513
  }
@@ -10461,7 +10520,7 @@ function useKeyboardInsets(enabled = true) {
10461
10520
  document.removeEventListener("focusin", onFocusIn);
10462
10521
  };
10463
10522
  }, [enabled]);
10464
- return { keyboardInset, isKeyboardOpen: chunk7JPLVECA_js.isKeyboardOpen(keyboardInset) };
10523
+ return { keyboardInset, isKeyboardOpen: chunk7ARD2J6Y_js.isKeyboardOpen(keyboardInset) };
10465
10524
  }
10466
10525
 
10467
10526
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10488,7 +10547,7 @@ function buildCanvasProps(input) {
10488
10547
  } = input;
10489
10548
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10490
10549
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10491
- const fieldContext = chunk7JPLVECA_js.buildFieldSubstitutionContext({
10550
+ const fieldContext = chunk7ARD2J6Y_js.buildFieldSubstitutionContext({
10492
10551
  headerFooter: s.headerFooter,
10493
10552
  customProperties: s.customProperties,
10494
10553
  slide: activeSlide
@@ -10498,13 +10557,13 @@ function buildCanvasProps(input) {
10498
10557
  if (mode === "present") {
10499
10558
  presentation.handlePresentationAction(action);
10500
10559
  } else if (action.url) {
10501
- chunk7JPLVECA_js.safeOpenUrl(action.url);
10560
+ chunk7ARD2J6Y_js.safeOpenUrl(action.url);
10502
10561
  }
10503
10562
  };
10504
10563
  const handleHyperlinkClick = (url) => {
10505
- if (chunk7JPLVECA_js.isPpactionUrl(url)) {
10564
+ if (chunk7ARD2J6Y_js.isPpactionUrl(url)) {
10506
10565
  if (mode === "present") {
10507
- const parsed = chunk7JPLVECA_js.parsePpactionUrl(url);
10566
+ const parsed = chunk7ARD2J6Y_js.parsePpactionUrl(url);
10508
10567
  if (parsed) {
10509
10568
  presentation.handlePresentationAction({
10510
10569
  action: parsed.action,
@@ -10514,7 +10573,7 @@ function buildCanvasProps(input) {
10514
10573
  }
10515
10574
  return;
10516
10575
  }
10517
- chunk7JPLVECA_js.safeOpenUrl(url);
10576
+ chunk7ARD2J6Y_js.safeOpenUrl(url);
10518
10577
  };
10519
10578
  return {
10520
10579
  activeSlide: effectiveSlide,
@@ -10610,7 +10669,7 @@ function buildCanvasProps(input) {
10610
10669
 
10611
10670
  // src/viewer/hooks/useScopedLayoutOptions.ts
10612
10671
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10613
- return chunk7JPLVECA_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10672
+ return chunk7ARD2J6Y_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10614
10673
  }
10615
10674
 
10616
10675
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10623,7 +10682,7 @@ function buildToolbarAnimationHandlers(input) {
10623
10682
  const current = activeSlide.animations ?? [];
10624
10683
  if (group === "motionPath") {
10625
10684
  propertyHandlers.handleUpdateSlide({
10626
- animations: chunk7JPLVECA_js.applyMotionPathPreset(current, selectedElement.id, preset)
10685
+ animations: chunk7ARD2J6Y_js.applyMotionPathPreset(current, selectedElement.id, preset)
10627
10686
  });
10628
10687
  return;
10629
10688
  }
@@ -10818,7 +10877,7 @@ function buildToolbarProps(input) {
10818
10877
  onOpenFile,
10819
10878
  onOpenRecentFile,
10820
10879
  onCreatePresentation: (templateId) => {
10821
- s.setSlides(chunk7JPLVECA_js.createBackstagePresentation(templateId));
10880
+ s.setSlides(chunk7ARD2J6Y_js.createBackstagePresentation(templateId));
10822
10881
  s.setActiveSlideIndex(0);
10823
10882
  s.setSelectedElementId(null);
10824
10883
  s.setSelectedElementIds([]);
@@ -10847,7 +10906,7 @@ function buildToolbarProps(input) {
10847
10906
  loadLayoutPreviews: input.loadLayoutPreviews,
10848
10907
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10849
10908
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10850
- templateScheme: chunk7JPLVECA_js.templateSchemeFromTheme(s.theme?.colorScheme),
10909
+ templateScheme: chunk7ARD2J6Y_js.templateSchemeFromTheme(s.theme?.colorScheme),
10851
10910
  customShows: s.customShows,
10852
10911
  activeCustomShowId: s.activeCustomShowId,
10853
10912
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10861,6 +10920,15 @@ function buildToolbarProps(input) {
10861
10920
  onToggleVersionHistory: () => propertyHandlers.setIsVersionHistoryOpen((p) => !p),
10862
10921
  onOpenPasswordProtection: () => dialogs.setIsPasswordDialogOpen(true),
10863
10922
  onOpenDocumentProperties: () => dialogs.setIsDocPropsDialogOpen(true),
10923
+ // Design > Slide Size: the size control is the inspector's SLIDE SIZE
10924
+ // card, which the deck (no-selection) panel renders. Drop the selection so
10925
+ // that panel is what the pane shows, then open it.
10926
+ onOpenSlideSize: () => {
10927
+ s.setSelectedElementId(null);
10928
+ s.setSelectedElementIds([]);
10929
+ s.setSidebarPanelMode("properties");
10930
+ s.setIsInspectorPaneOpen(true);
10931
+ },
10864
10932
  onOpenFontEmbedding: () => dialogs.setIsFontEmbeddingOpen(true),
10865
10933
  onOpenDigitalSignatures: () => dialogs.setIsDigitalSigDialogOpen(true),
10866
10934
  onEnterPresenterView,
@@ -10879,7 +10947,7 @@ function buildToolbarProps(input) {
10879
10947
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10880
10948
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10881
10949
  formatPainterActive: s.formatPainterActive,
10882
- canActivateFormatPainter: chunk7JPLVECA_js.hasCopyableFormat(selectedElement),
10950
+ canActivateFormatPainter: chunk7ARD2J6Y_js.hasCopyableFormat(selectedElement),
10883
10951
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10884
10952
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10885
10953
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -10987,7 +11055,12 @@ function useViewerBuildingBlocksCore(input) {
10987
11055
  setMode: state.setMode,
10988
11056
  setActiveSlideIndex: state.setActiveSlideIndex,
10989
11057
  setSlides: state.setSlides,
10990
- history
11058
+ history,
11059
+ // PowerPoint's bare `J` during a show toggles live captions.
11060
+ onToggleSubtitles: () => state.setPresentationProperties((prev) => ({
11061
+ ...prev,
11062
+ showSubtitles: !prev.showSubtitles
11063
+ }))
10991
11064
  });
10992
11065
  return {
10993
11066
  state,
@@ -11162,7 +11235,7 @@ function useViewerBuildingBlocks(input) {
11162
11235
  }, [incomingContent]);
11163
11236
  const onOpenFile = react.useCallback(() => {
11164
11237
  void (async () => {
11165
- const picked = await chunk7JPLVECA_js.openPptxFile();
11238
+ const picked = await chunk7ARD2J6Y_js.openPptxFile();
11166
11239
  if (picked) {
11167
11240
  setContent(picked.buffer);
11168
11241
  }
@@ -11170,7 +11243,7 @@ function useViewerBuildingBlocks(input) {
11170
11243
  }, []);
11171
11244
  const onOpenRecentFile = react.useCallback((key) => {
11172
11245
  void (async () => {
11173
- const bytes = await chunk7JPLVECA_js.readBackstageRecentFile(key);
11246
+ const bytes = await chunk7ARD2J6Y_js.readBackstageRecentFile(key);
11174
11247
  if (bytes) {
11175
11248
  setContent(bytes);
11176
11249
  }